* {
    box-sizing: border-box;
}

:root {
    --night-950: #0d0f12;
    --night-900: #13161b;
    --night-850: #171b21;
    --night-800: #1a1d23;
    --night-700: #21252b;
    --night-600: #2d333b;
    --night-500: #5f6b7a;
    --night-400: #9aa4b2;
    --night-300: #c4ccd6;
    --text-main: #e9ecef;
    --blood-600: #e63946;
    --blood-500: #ff4d4d;
    --blood-400: #ff7070;
    --gold: #ffcf5a;
    --shadow-glow: 0 0 28px rgba(230, 57, 70, 0.28);
    --shadow-card: 0 22px 60px rgba(0, 0, 0, 0.34);
    --radius-xl: 24px;
    --radius-lg: 18px;
    --radius-md: 12px;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at 20% 0%, rgba(230, 57, 70, 0.18), transparent 28rem),
        radial-gradient(circle at 85% 18%, rgba(73, 80, 87, 0.28), transparent 24rem),
        var(--night-950);
    color: var(--text-main);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

img,
video {
    display: block;
    max-width: 100%;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input {
    font: inherit;
}

button {
    cursor: pointer;
}

.container-custom {
    width: min(1200px, calc(100% - 32px));
    margin: 0 auto;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    border-bottom: 1px solid rgba(45, 51, 59, 0.82);
    background: rgba(19, 22, 27, 0.94);
    backdrop-filter: blur(18px);
}

.nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 68px;
}

.brand,
.footer-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.brand-mark {
    display: inline-grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--blood-600), #9b1c31);
    color: #fff;
    box-shadow: var(--shadow-glow);
}

.brand-text {
    font-size: 1.25rem;
}

.desktop-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-link,
.mobile-nav-link {
    color: var(--night-300);
    border-radius: 12px;
    transition: color 0.25s ease, background 0.25s ease, transform 0.25s ease;
}

.nav-link {
    padding: 10px 16px;
}

.nav-link:hover,
.nav-link.active,
.mobile-nav-link:hover,
.mobile-nav-link.active {
    color: #fff;
    background: rgba(230, 57, 70, 0.16);
}

.mobile-menu-button {
    display: none;
    width: 42px;
    height: 42px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
    border: 1px solid var(--night-600);
    border-radius: 12px;
    background: var(--night-800);
}

.mobile-menu-button span {
    width: 18px;
    height: 2px;
    border-radius: 2px;
    background: #fff;
}

.mobile-nav-panel {
    display: none;
    padding: 0 16px 16px;
    background: rgba(19, 22, 27, 0.98);
}

.mobile-nav-panel.open {
    display: grid;
    gap: 8px;
}

.mobile-nav-link {
    padding: 12px 14px;
}

.hero {
    position: relative;
    min-height: 76vh;
    overflow: hidden;
    border-bottom: 1px solid rgba(45, 51, 59, 0.6);
}

.hero-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.8s ease;
}

.hero-slide.active {
    opacity: 1;
    pointer-events: auto;
}

.hero-bg {
    position: absolute;
    inset: 0;
}

.hero-bg::after,
.detail-bg::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(13, 15, 18, 0.97), rgba(13, 15, 18, 0.68) 48%, rgba(13, 15, 18, 0.9)),
        linear-gradient(0deg, var(--night-950), transparent 55%);
}

.hero-bg img,
.detail-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: saturate(1.05) contrast(1.05);
}

.hero-content {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) 360px;
    align-items: center;
    gap: 56px;
    min-height: 76vh;
    padding: 80px 0 92px;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--blood-400);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.hero-copy h1,
.sub-hero h1,
.detail-info h1 {
    margin: 14px 0 18px;
    color: #fff;
    font-weight: 900;
    line-height: 1.06;
    text-shadow: 0 8px 30px rgba(0, 0, 0, 0.45);
}

.hero-copy h1 {
    max-width: 780px;
    font-size: clamp(2.8rem, 7vw, 5.8rem);
}

.hero-copy p {
    max-width: 760px;
    color: var(--night-300);
    font-size: clamp(1rem, 1.8vw, 1.25rem);
}

.hero-tags,
.tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.hero-tags {
    margin: 26px 0 0;
}

.hero-tags span,
.tag-row span {
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    background: rgba(19, 22, 27, 0.72);
    color: var(--night-300);
    font-size: 0.82rem;
}

.hero-tags span {
    padding: 7px 12px;
}

.tag-row span {
    padding: 5px 9px;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 32px;
}

.btn-primary,
.btn-ghost,
.btn-small,
.quick-search button,
.global-search-box button,
.filter-reset {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    font-weight: 800;
    transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.btn-primary,
.quick-search button,
.global-search-box button {
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: linear-gradient(135deg, var(--blood-600), #a70f2d);
    color: #fff;
    box-shadow: var(--shadow-glow);
}

.btn-primary,
.btn-ghost {
    min-height: 48px;
    padding: 0 22px;
}

.btn-ghost,
.filter-reset {
    border: 1px solid var(--night-600);
    background: rgba(19, 22, 27, 0.74);
    color: #fff;
}

.btn-small {
    min-height: 40px;
    padding: 0 15px;
    background: rgba(230, 57, 70, 0.14);
    color: var(--blood-400);
}

.btn-primary:hover,
.btn-ghost:hover,
.btn-small:hover,
.quick-search button:hover,
.global-search-box button:hover,
.filter-reset:hover {
    transform: translateY(-2px);
}

.hero-poster {
    position: relative;
    overflow: hidden;
    min-height: 520px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 32px;
    background: var(--night-900);
    box-shadow: var(--shadow-card), var(--shadow-glow);
}

.hero-poster img {
    width: 100%;
    height: 100%;
    min-height: 520px;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.hero-poster:hover img {
    transform: scale(1.06);
}

.hero-poster span,
.play-mini {
    position: absolute;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: rgba(230, 57, 70, 0.9);
    color: #fff;
    box-shadow: var(--shadow-glow);
}

.hero-poster span {
    right: 22px;
    bottom: 22px;
    width: 58px;
    height: 58px;
    font-size: 1.4rem;
}

.hero-controls {
    position: absolute;
    left: 50%;
    bottom: 28px;
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 14px;
    transform: translateX(-50%);
}

.hero-controls > button {
    width: 42px;
    height: 42px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    background: rgba(13, 15, 18, 0.68);
    color: #fff;
    font-size: 1.65rem;
}

.hero-dots {
    display: flex;
    gap: 8px;
}

.hero-dot {
    width: 10px;
    height: 10px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.3);
    transition: width 0.25s ease, background 0.25s ease;
}

.hero-dot.active {
    width: 32px;
    background: var(--blood-500);
}

.section-block {
    padding: 64px 0;
}

.search-strip {
    display: grid;
    grid-template-columns: 1fr minmax(280px, 520px);
    align-items: center;
    gap: 24px;
    margin-top: -38px;
    padding: 24px;
    border: 1px solid var(--night-600);
    border-radius: var(--radius-xl);
    background: rgba(19, 22, 27, 0.88);
    box-shadow: var(--shadow-card);
    position: relative;
    z-index: 8;
}

.search-strip h2,
.section-heading h2,
.content-card h2,
.category-large-body h2 {
    margin: 6px 0 0;
    color: #fff;
    font-size: clamp(1.45rem, 2.6vw, 2.2rem);
    line-height: 1.15;
}

.quick-search,
.global-search-box,
.filter-bar {
    display: flex;
    gap: 12px;
}

.quick-search input,
.global-search-box input,
.search-box input {
    width: 100%;
    min-height: 48px;
    border: 1px solid var(--night-600);
    border-radius: 14px;
    background: rgba(13, 15, 18, 0.88);
    color: #fff;
    outline: none;
    padding: 0 15px;
}

.quick-search input:focus,
.global-search-box input:focus,
.search-box input:focus {
    border-color: var(--blood-600);
    box-shadow: 0 0 0 3px rgba(230, 57, 70, 0.16);
}

.quick-search button,
.global-search-box button {
    min-width: 96px;
    padding: 0 18px;
    border: 0;
}

.section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 26px;
}

.section-heading.compact {
    align-items: center;
}

.section-heading > a,
.inline-link {
    color: var(--blood-400);
    font-weight: 700;
}

.movie-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 24px;
}

.movie-card {
    overflow: hidden;
    border: 1px solid rgba(45, 51, 59, 0.9);
    border-radius: var(--radius-lg);
    background: rgba(26, 29, 35, 0.86);
    box-shadow: 0 14px 42px rgba(0, 0, 0, 0.25);
    transition: transform 0.28s ease, border-color 0.28s ease, box-shadow 0.28s ease;
}

.movie-card:hover {
    transform: translateY(-6px);
    border-color: rgba(230, 57, 70, 0.55);
    box-shadow: var(--shadow-card), var(--shadow-glow);
}

.movie-card.horizontal {
    display: grid;
    grid-template-columns: 220px 1fr;
}

.movie-cover {
    position: relative;
    display: block;
    overflow: hidden;
    aspect-ratio: 2 / 3;
    background: var(--night-900);
}

.movie-card.horizontal .movie-cover {
    aspect-ratio: auto;
    min-height: 180px;
}

.movie-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.45s ease;
}

.movie-card:hover .movie-cover img {
    transform: scale(1.08);
}

.movie-cover-shade {
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.55), transparent 55%);
}

.play-mini {
    right: 12px;
    bottom: 12px;
    width: 38px;
    height: 38px;
    font-size: 0.9rem;
}

.rank-badge {
    position: absolute;
    left: 12px;
    top: 12px;
    display: inline-grid;
    min-width: 36px;
    height: 36px;
    place-items: center;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--gold), #c06b18);
    color: #1b1202;
    font-weight: 900;
}

.movie-card-body {
    padding: 18px;
}

.movie-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    color: var(--night-400);
    font-size: 0.8rem;
}

.movie-card-meta span {
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
}

.movie-card h3 {
    margin: 10px 0 8px;
    color: #fff;
    font-size: 1.08rem;
    line-height: 1.3;
}

.movie-card h3 a:hover {
    color: var(--blood-400);
}

.movie-card p {
    min-height: 50px;
    margin: 0 0 14px;
    color: var(--night-300);
    font-size: 0.92rem;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
}

.category-tile,
.category-large-card,
.content-card,
.ranking-panel {
    border: 1px solid rgba(45, 51, 59, 0.88);
    border-radius: var(--radius-xl);
    background: rgba(26, 29, 35, 0.84);
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.24);
}

.category-tile {
    display: block;
    overflow: hidden;
    padding: 16px;
    transition: transform 0.25s ease, border-color 0.25s ease;
}

.category-tile:hover,
.category-large-card:hover {
    transform: translateY(-4px);
    border-color: rgba(230, 57, 70, 0.48);
}

.category-preview {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    margin-bottom: 16px;
}

.category-preview img,
.category-large-preview img {
    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    border-radius: 12px;
    background: var(--night-900);
}

.category-tile strong {
    display: block;
    color: #fff;
    font-size: 1.18rem;
}

.category-tile p,
.category-large-body p,
.content-card p,
.site-footer p {
    color: var(--night-300);
}

.two-column-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 28px;
}

.feature-list,
.compact-list {
    display: grid;
    gap: 16px;
}

.ranking-panel {
    position: sticky;
    top: 92px;
    align-self: start;
    padding: 24px;
}

.compact-card {
    position: relative;
    display: grid;
    grid-template-columns: 96px 1fr;
    gap: 14px;
    align-items: center;
    overflow: hidden;
    padding: 10px;
    border: 1px solid rgba(45, 51, 59, 0.7);
    border-radius: 16px;
    background: rgba(13, 15, 18, 0.56);
    transition: transform 0.25s ease, border-color 0.25s ease;
}

.compact-card:hover {
    transform: translateX(4px);
    border-color: rgba(230, 57, 70, 0.52);
}

.compact-card img {
    width: 96px;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    border-radius: 12px;
    background: var(--night-900);
}

.compact-card strong {
    display: block;
    color: #fff;
    line-height: 1.3;
}

.compact-card em {
    display: block;
    margin-top: 4px;
    color: var(--night-400);
    font-size: 0.83rem;
    font-style: normal;
}

.compact-rank {
    position: absolute;
    left: 14px;
    top: 14px;
    display: grid;
    min-width: 26px;
    height: 26px;
    place-items: center;
    border-radius: 999px;
    background: rgba(230, 57, 70, 0.9);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 900;
}

.sub-hero,
.detail-hero {
    position: relative;
    overflow: hidden;
    padding: 76px 0;
    border-bottom: 1px solid rgba(45, 51, 59, 0.7);
    background:
        linear-gradient(135deg, rgba(16, 42, 67, 0.82), rgba(36, 59, 83, 0.58)),
        var(--night-900);
}

.sub-hero h1 {
    font-size: clamp(2.4rem, 5vw, 4.6rem);
}

.sub-hero p {
    max-width: 760px;
    color: var(--night-300);
    font-size: 1.08rem;
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
    color: var(--night-400);
    font-size: 0.92rem;
}

.breadcrumb a:hover {
    color: var(--blood-400);
}

.category-large-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
}

.category-large-card {
    display: grid;
    grid-template-columns: 44% 1fr;
    overflow: hidden;
    transition: transform 0.25s ease, border-color 0.25s ease;
}

.category-large-preview {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    padding: 14px;
    background: rgba(13, 15, 18, 0.54);
}

.category-large-body {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 14px;
    padding: 24px;
}

.filter-bar {
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 26px;
    padding: 18px;
    border: 1px solid rgba(45, 51, 59, 0.78);
    border-radius: var(--radius-lg);
    background: rgba(19, 22, 27, 0.72);
}

.search-box {
    display: grid;
    flex: 1;
    gap: 7px;
    color: var(--night-300);
    font-weight: 700;
}

.filter-reset {
    min-height: 48px;
    padding: 0 18px;
}

.detail-hero {
    min-height: 620px;
    padding: 0;
    background: var(--night-950);
}

.detail-bg {
    position: absolute;
    inset: 0;
}

.detail-hero-inner {
    position: relative;
    z-index: 2;
    padding: 72px 0;
}

.detail-layout {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    gap: 38px;
    align-items: center;
}

.detail-poster {
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 26px;
    background: var(--night-900);
    box-shadow: var(--shadow-card), var(--shadow-glow);
}

.detail-poster img {
    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
}

.detail-info h1 {
    font-size: clamp(2.3rem, 5.8vw, 5.1rem);
}

.detail-one-line {
    max-width: 820px;
    color: var(--night-300);
    font-size: 1.18rem;
}

.detail-meta-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    max-width: 780px;
    margin: 28px 0;
}

.detail-meta-grid span {
    display: grid;
    gap: 4px;
    padding: 14px 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    background: rgba(13, 15, 18, 0.58);
    color: var(--night-300);
}

.detail-meta-grid b {
    color: #fff;
}

.detail-meta-grid a {
    color: var(--blood-400);
}

.detail-tags {
    margin-bottom: 28px;
}

.player-frame {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(45, 51, 59, 0.92);
    border-radius: 28px;
    background: #050607;
    box-shadow: var(--shadow-card), var(--shadow-glow);
}

.player-frame video {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #050607;
}

.player-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 12px;
    border: 0;
    background:
        radial-gradient(circle, rgba(230, 57, 70, 0.2), transparent 24rem),
        linear-gradient(0deg, rgba(0, 0, 0, 0.46), rgba(0, 0, 0, 0.2));
    color: #fff;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.player-overlay span {
    display: grid;
    width: 78px;
    height: 78px;
    place-items: center;
    border-radius: 999px;
    background: rgba(230, 57, 70, 0.94);
    box-shadow: var(--shadow-glow);
    font-size: 2rem;
}

.player-overlay strong {
    font-size: 1.1rem;
}

.player-frame.is-playing .player-overlay {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.detail-content-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
}

.content-card {
    padding: 28px;
}

.content-card p {
    margin: 18px 0 0;
    font-size: 1.02rem;
}

.related-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.global-search-box {
    max-width: 780px;
    margin-top: 26px;
}

.site-footer {
    margin-top: 40px;
    border-top: 1px solid rgba(45, 51, 59, 0.82);
    background: rgba(13, 15, 18, 0.78);
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr 1fr;
    gap: 28px;
    padding: 42px 0;
}

.site-footer h3 {
    margin: 0 0 14px;
    color: #fff;
}

.footer-brand {
    margin-bottom: 14px;
    color: #fff;
    font-size: 1.25rem;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.footer-links a {
    padding: 7px 11px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--night-300);
}

.footer-links a:hover {
    color: #fff;
    background: rgba(230, 57, 70, 0.16);
}

.footer-bottom {
    padding: 18px 0 28px;
    border-top: 1px solid rgba(45, 51, 59, 0.52);
    color: var(--night-500);
    text-align: center;
}

.card-hidden {
    display: none !important;
}

@media (max-width: 1080px) {
    .movie-grid,
    .category-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .hero-content,
    .two-column-layout,
    .detail-layout {
        grid-template-columns: 1fr;
    }

    .hero-poster {
        display: none;
    }

    .ranking-panel {
        position: static;
    }

    .related-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .desktop-nav {
        display: none;
    }

    .mobile-menu-button {
        display: inline-flex;
    }

    .hero,
    .hero-content {
        min-height: 680px;
    }

    .hero-content {
        padding-top: 72px;
    }

    .search-strip,
    .quick-search,
    .global-search-box,
    .filter-bar,
    .footer-grid,
    .detail-content-grid,
    .category-large-grid,
    .category-large-card {
        grid-template-columns: 1fr;
    }

    .quick-search,
    .global-search-box,
    .filter-bar {
        display: grid;
    }

    .movie-grid,
    .category-grid,
    .related-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 16px;
    }

    .movie-card.horizontal {
        grid-template-columns: 1fr;
    }

    .movie-card.horizontal .movie-cover {
        aspect-ratio: 2 / 3;
    }

    .detail-meta-grid {
        grid-template-columns: 1fr;
    }

    .detail-poster {
        max-width: 260px;
    }

    .footer-grid {
        display: grid;
    }
}

@media (max-width: 480px) {
    .container-custom {
        width: min(100% - 24px, 1200px);
    }

    .movie-grid,
    .category-grid,
    .related-list {
        grid-template-columns: 1fr;
    }

    .section-block {
        padding: 42px 0;
    }

    .hero-copy h1 {
        font-size: 2.7rem;
    }

    .compact-card {
        grid-template-columns: 82px 1fr;
    }

    .compact-card img {
        width: 82px;
    }
}
