:root {
    color-scheme: dark;
    --bg: #020617;
    --bg-soft: #0f172a;
    --bg-card: rgba(15, 23, 42, 0.88);
    --bg-card-solid: #0f172a;
    --line: rgba(148, 163, 184, 0.18);
    --line-strong: rgba(148, 163, 184, 0.34);
    --text: #f8fafc;
    --text-soft: #cbd5e1;
    --muted: #94a3b8;
    --muted-deep: #64748b;
    --brand: #f8fafc;
    --brand-dark: #020617;
    --accent: #38bdf8;
    --accent-2: #a78bfa;
    --shadow: 0 24px 70px rgba(0, 0, 0, 0.36);
    --radius: 22px;
    --radius-sm: 14px;
    --max: 1280px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(56, 189, 248, 0.12), transparent 34rem),
        radial-gradient(circle at top right, rgba(167, 139, 250, 0.12), transparent 32rem),
        var(--bg);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
    line-height: 1.65;
}

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

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

button,
input,
select {
    font: inherit;
}

.site-header {
    position: fixed;
    inset: 0 0 auto;
    z-index: 50;
    background: rgba(2, 6, 23, 0.78);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(18px);
}

.nav-wrap {
    width: min(var(--max), calc(100% - 32px));
    height: 72px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-width: max-content;
}

.brand-mark {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    color: var(--bg);
    background: linear-gradient(135deg, #f8fafc, #94a3b8);
    box-shadow: 0 12px 30px rgba(148, 163, 184, 0.24);
    font-weight: 900;
}

.brand-text {
    display: grid;
    gap: 0;
    line-height: 1.1;
}

.brand-text strong,
.footer-brand {
    font-size: 20px;
    letter-spacing: -0.04em;
    font-weight: 900;
}

.brand-text small {
    color: var(--muted);
    font-size: 12px;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 8px 12px;
    border-radius: 999px;
    color: var(--text-soft);
    font-size: 14px;
    transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
    color: var(--text);
    background: rgba(148, 163, 184, 0.12);
    transform: translateY(-1px);
}

.nav-toggle {
    display: none;
    width: 42px;
    height: 42px;
    border: 1px solid var(--line);
    border-radius: 12px;
    color: var(--text);
    background: rgba(15, 23, 42, 0.88);
    cursor: pointer;
}

.site-main {
    padding-top: 72px;
}

.hero {
    position: relative;
    min-height: 85vh;
    overflow: hidden;
    isolation: isolate;
}

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

.hero-bg {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transform: scale(1.04);
    transition: opacity 0.7s ease, transform 6s ease;
}

.hero-bg.is-active {
    opacity: 1;
    transform: scale(1.1);
}

.hero-gradient {
    z-index: 1;
    background:
        linear-gradient(90deg, rgba(2, 6, 23, 0.96) 0%, rgba(2, 6, 23, 0.72) 42%, rgba(2, 6, 23, 0.22) 100%),
        linear-gradient(0deg, var(--bg) 0%, rgba(2, 6, 23, 0.2) 42%, rgba(2, 6, 23, 0.18) 100%);
}

.hero-inner {
    position: relative;
    z-index: 2;
    width: min(var(--max), calc(100% - 32px));
    min-height: calc(85vh - 72px);
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 48px;
    align-items: end;
    padding: 80px 0;
}

.hero-copy-list {
    position: relative;
    min-height: 360px;
}

.hero-panel {
    position: absolute;
    inset: auto auto 0 0;
    width: min(760px, 100%);
    opacity: 0;
    transform: translateY(18px);
    pointer-events: none;
    transition: opacity 0.35s ease, transform 0.35s ease;
}

.hero-panel.is-active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.pill-row,
.meta-line,
.tag-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.pill-row span,
.tag-row span {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 4px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.62);
    color: var(--text-soft);
    font-size: 12px;
    backdrop-filter: blur(12px);
}

.hero-panel h1 {
    margin: 18px 0 18px;
    font-size: clamp(42px, 7vw, 84px);
    line-height: 0.98;
    letter-spacing: -0.08em;
    text-wrap: balance;
}

.hero-panel p {
    width: min(680px, 100%);
    margin: 0 0 28px;
    color: var(--text-soft);
    font-size: clamp(17px, 2vw, 22px);
}

.hero-actions,
.detail-actions {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.primary-button,
.ghost-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 22px;
    border-radius: 14px;
    font-weight: 800;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.primary-button {
    color: var(--brand-dark);
    background: var(--brand);
    box-shadow: 0 18px 44px rgba(248, 250, 252, 0.18);
}

.ghost-button {
    border: 1px solid var(--line-strong);
    color: var(--text);
    background: rgba(15, 23, 42, 0.46);
    backdrop-filter: blur(12px);
}

.primary-button:hover,
.ghost-button:hover {
    transform: translateY(-2px);
}

.hero-side {
    align-self: end;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(2, 6, 23, 0.54);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.hero-kicker,
.section-heading span,
.aside-title span,
.page-hero span {
    display: inline-block;
    color: var(--accent);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.hero-thumbs {
    display: grid;
    gap: 12px;
    margin-top: 14px;
}

.hero-thumb {
    display: grid;
    grid-template-columns: 82px 1fr;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 8px;
    border: 1px solid transparent;
    border-radius: 16px;
    color: var(--text-soft);
    background: transparent;
    text-align: left;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.hero-thumb img {
    width: 82px;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    border-radius: 12px;
}

.hero-thumb span {
    font-weight: 800;
}

.hero-thumb:hover,
.hero-thumb.is-active {
    border-color: var(--line-strong);
    background: rgba(148, 163, 184, 0.12);
}

.content-section,
.filter-panel {
    width: min(var(--max), calc(100% - 32px));
    margin: 0 auto;
}

.content-section {
    padding: 54px 0;
}

.section-tight {
    padding-top: 34px;
}

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

.section-heading h2,
.aside-title h2,
.page-hero h1,
.text-panel h2 {
    margin: 4px 0 0;
    font-size: clamp(28px, 4vw, 42px);
    line-height: 1.05;
    letter-spacing: -0.06em;
}

.section-heading a {
    color: var(--text-soft);
    font-weight: 700;
}

.section-heading a:hover {
    color: var(--text);
}

.compact-heading h2,
.aside-title h2,
.text-panel h2 {
    font-size: 28px;
}

.movie-grid,
.featured-grid,
.category-grid,
.related-grid {
    display: grid;
    gap: 18px;
}

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

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

.movie-card,
.feature-card {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--bg-card);
    box-shadow: 0 12px 38px rgba(0, 0, 0, 0.2);
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.movie-card:hover,
.feature-card:hover,
.category-tile:hover,
.compact-card:hover,
.ranking-card:hover {
    transform: translateY(-4px);
    border-color: var(--line-strong);
    box-shadow: var(--shadow);
}

.poster-link,
.compact-poster,
.ranking-poster {
    position: relative;
    display: block;
    overflow: hidden;
    background: #111827;
}

.poster-link img,
.feature-card img,
.compact-poster img,
.ranking-poster img,
.detail-poster img,
.category-tile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.poster-link {
    aspect-ratio: 3 / 4;
}

.feature-card .poster-link {
    aspect-ratio: 16 / 10;
}

.movie-card:hover .poster-link img,
.feature-card:hover .poster-link img,
.category-tile:hover img,
.compact-card:hover img,
.ranking-card:hover img {
    transform: scale(1.08);
}

.poster-badge,
.rank-number,
.ranking-poster span {
    position: absolute;
    left: 12px;
    top: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    min-height: 28px;
    padding: 4px 10px;
    border-radius: 999px;
    color: var(--bg);
    background: rgba(248, 250, 252, 0.92);
    font-size: 12px;
    font-weight: 900;
}

.card-body {
    padding: 16px;
}

.meta-line {
    color: var(--muted);
    font-size: 12px;
}

.meta-line span + span::before {
    content: "•";
    margin-right: 8px;
    color: var(--muted-deep);
}

.card-body h3,
.compact-card h3,
.ranking-info h2 {
    margin: 8px 0 8px;
    color: var(--text);
    font-size: 18px;
    line-height: 1.28;
}

.card-body p,
.compact-card small,
.ranking-info p,
.footer-grid p,
.page-hero p,
.text-panel p,
.detail-one-line {
    color: var(--text-soft);
}

.card-body p {
    min-height: 48px;
    margin: 0 0 14px;
    font-size: 14px;
}

.feature-card .card-body h3 {
    font-size: 22px;
}

.category-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.large-category-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.category-tile {
    position: relative;
    min-height: 180px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--bg-card-solid);
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.category-tile img,
.category-shade {
    position: absolute;
    inset: 0;
}

.category-shade {
    background: linear-gradient(0deg, rgba(2, 6, 23, 0.92), rgba(2, 6, 23, 0.24));
}

.category-tile strong,
.category-tile small {
    position: relative;
    z-index: 1;
}

.category-tile strong {
    font-size: 22px;
    letter-spacing: -0.04em;
}

.category-tile small {
    color: var(--text-soft);
}

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

.rank-aside {
    position: sticky;
    top: 96px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(15, 23, 42, 0.72);
    box-shadow: var(--shadow);
}

.rank-list,
.ranking-list {
    display: grid;
    gap: 14px;
}

.compact-card {
    display: grid;
    grid-template-columns: 78px 1fr;
    gap: 12px;
    align-items: center;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(2, 6, 23, 0.36);
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.compact-poster {
    aspect-ratio: 3 / 4;
    border-radius: 14px;
}

.compact-card h3 {
    margin: 0 0 2px;
    font-size: 15px;
}

.compact-card p,
.compact-card small {
    display: block;
    margin: 0;
    font-size: 12px;
}

.compact-card p {
    color: var(--muted);
}

.scroll-row {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(220px, 260px);
    gap: 18px;
    overflow-x: auto;
    padding-bottom: 16px;
    scroll-snap-type: x mandatory;
}

.scroll-card {
    scroll-snap-align: start;
}

.page-hero,
.detail-hero {
    position: relative;
    overflow: hidden;
}

.small-hero {
    min-height: 360px;
    display: grid;
    place-items: end start;
    padding: 74px max(16px, calc((100vw - var(--max)) / 2)) 56px;
    background:
        radial-gradient(circle at 18% 20%, rgba(56, 189, 248, 0.18), transparent 28rem),
        radial-gradient(circle at 80% 30%, rgba(167, 139, 250, 0.18), transparent 30rem),
        linear-gradient(135deg, rgba(15, 23, 42, 0.82), rgba(2, 6, 23, 0.98));
}

.page-hero div {
    width: min(760px, 100%);
}

.page-hero p {
    margin: 16px 0 0;
    font-size: 18px;
}

.filter-panel {
    display: grid;
    grid-template-columns: 1fr 180px 220px auto;
    gap: 14px;
    align-items: end;
    padding: 18px;
    margin-top: 24px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(15, 23, 42, 0.72);
    box-shadow: var(--shadow);
}

.filter-panel label {
    display: grid;
    gap: 7px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.filter-panel input,
.filter-panel select {
    width: 100%;
    min-height: 44px;
    border: 1px solid var(--line);
    border-radius: 14px;
    color: var(--text);
    background: rgba(2, 6, 23, 0.68);
    padding: 0 12px;
    outline: none;
}

.filter-panel input:focus,
.filter-panel select:focus {
    border-color: rgba(56, 189, 248, 0.6);
}

.filter-count {
    margin: 0;
    color: var(--text-soft);
    font-weight: 900;
    white-space: nowrap;
}

.ranking-card {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 20px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--bg-card);
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.ranking-poster {
    aspect-ratio: 3 / 4;
    border-radius: 18px;
}

.ranking-poster span {
    min-width: 34px;
    font-size: 16px;
}

.ranking-info {
    align-self: center;
}

.ranking-info h2 {
    font-size: 26px;
}

.weight-bar {
    width: min(460px, 100%);
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.18);
}

.weight-bar i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.detail-hero {
    min-height: 620px;
}

.detail-backdrop,
.detail-backdrop img,
.detail-backdrop span {
    position: absolute;
    inset: 0;
}

.detail-backdrop img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(18px);
    opacity: 0.44;
    transform: scale(1.08);
}

.detail-backdrop span {
    background:
        linear-gradient(90deg, rgba(2, 6, 23, 0.96), rgba(2, 6, 23, 0.76), rgba(2, 6, 23, 0.52)),
        linear-gradient(0deg, var(--bg), transparent 56%);
}

.detail-wrap {
    position: relative;
    z-index: 1;
    width: min(var(--max), calc(100% - 32px));
    margin: 0 auto;
    padding: 56px 0 64px;
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 28px;
    color: var(--muted);
    font-size: 14px;
}

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

.breadcrumb a::after {
    content: "/";
    margin-left: 8px;
    color: var(--muted-deep);
}

.detail-grid {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 40px;
    align-items: end;
}

.detail-poster {
    overflow: hidden;
    aspect-ratio: 3 / 4;
    border: 1px solid var(--line-strong);
    border-radius: 28px;
    background: var(--bg-card-solid);
    box-shadow: var(--shadow);
}

.detail-info h1 {
    margin: 18px 0 18px;
    max-width: 820px;
    font-size: clamp(40px, 6vw, 74px);
    line-height: 1;
    letter-spacing: -0.08em;
}

.detail-one-line {
    max-width: 760px;
    margin: 0 0 20px;
    font-size: 20px;
}

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

.player-section {
    padding-top: 24px;
}

.video-shell {
    position: relative;
    overflow: hidden;
    width: 100%;
    aspect-ratio: 16 / 9;
    border: 1px solid var(--line-strong);
    border-radius: 28px;
    background: #000;
    box-shadow: var(--shadow);
}

.movie-video {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    background: #000;
}

.play-cover {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    border: 0;
    color: var(--text);
    background: rgba(2, 6, 23, 0.24);
    cursor: pointer;
    z-index: 2;
}

.play-cover span {
    width: 84px;
    height: 84px;
    display: grid;
    place-items: center;
    padding-left: 6px;
    border-radius: 999px;
    color: var(--bg);
    background: rgba(248, 250, 252, 0.92);
    font-size: 32px;
    box-shadow: 0 18px 54px rgba(0, 0, 0, 0.38);
    transition: transform 0.2s ease;
}

.play-cover:hover span {
    transform: scale(1.06);
}

.video-shell.is-playing .play-cover {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.detail-text-grid {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 24px;
}

.text-panel {
    padding: 26px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--bg-card);
}

.text-panel p {
    margin: 14px 0 0;
    font-size: 16px;
}

.site-footer {
    margin-top: 56px;
    border-top: 1px solid var(--line);
    background: rgba(2, 6, 23, 0.84);
}

.footer-grid {
    width: min(var(--max), calc(100% - 32px));
    margin: 0 auto;
    padding: 42px 0;
    display: grid;
    grid-template-columns: 1.1fr 1fr 0.8fr;
    gap: 32px;
}

.footer-grid h2 {
    margin: 0 0 12px;
    font-size: 16px;
}

.footer-grid p {
    margin: 12px 0 0;
}

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

.footer-links a {
    display: inline-flex;
    padding: 7px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--text-soft);
    font-size: 13px;
}

.footer-links a:hover {
    color: var(--text);
    border-color: var(--line-strong);
}

.is-hidden-by-filter {
    display: none !important;
}

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

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

    .hero-inner,
    .two-column-section {
        grid-template-columns: 1fr;
    }

    .hero-side,
    .rank-aside {
        position: static;
    }
}

@media (max-width: 860px) {
    .nav-toggle {
        display: inline-grid;
        place-items: center;
    }

    .main-nav {
        position: absolute;
        left: 16px;
        right: 16px;
        top: 80px;
        display: none;
        padding: 12px;
        border: 1px solid var(--line);
        border-radius: 18px;
        background: rgba(2, 6, 23, 0.96);
        box-shadow: var(--shadow);
    }

    .main-nav.is-open {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .nav-link {
        justify-content: center;
        border-radius: 12px;
    }

    .hero-inner {
        padding: 50px 0;
        align-items: end;
    }

    .hero-copy-list {
        min-height: 440px;
    }

    .hero-panel {
        position: absolute;
    }

    .hero-side {
        display: none;
    }

    .movie-grid,
    .featured-grid,
    .category-grid,
    .large-category-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .filter-panel {
        grid-template-columns: 1fr 1fr;
    }

    .filter-search {
        grid-column: 1 / -1;
    }

    .detail-grid,
    .detail-text-grid,
    .footer-grid {
        grid-template-columns: 1fr;
    }

    .detail-poster {
        width: min(280px, 100%);
    }

    .ranking-card {
        grid-template-columns: 110px 1fr;
    }
}

@media (max-width: 560px) {
    .nav-wrap,
    .content-section,
    .filter-panel,
    .detail-wrap,
    .footer-grid {
        width: min(100% - 24px, var(--max));
    }

    .brand-text strong {
        font-size: 16px;
    }

    .brand-text small {
        font-size: 11px;
    }

    .hero {
        min-height: 78vh;
    }

    .hero-inner {
        min-height: calc(78vh - 72px);
    }

    .hero-panel h1,
    .detail-info h1 {
        letter-spacing: -0.05em;
    }

    .movie-grid,
    .featured-grid,
    .category-grid,
    .large-category-grid,
    .filter-panel {
        grid-template-columns: 1fr;
    }

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

    .ranking-poster {
        max-width: 220px;
    }

    .small-hero {
        min-height: 320px;
        padding-top: 54px;
    }
}
