:root {
    color-scheme: dark;
    --bg: #020617;
    --bg-soft: #0f172a;
    --panel: rgba(15, 23, 42, 0.78);
    --panel-strong: rgba(15, 23, 42, 0.94);
    --line: rgba(148, 163, 184, 0.18);
    --text: #f8fafc;
    --muted: #94a3b8;
    --soft: #cbd5e1;
    --blue: #2563eb;
    --blue-light: #38bdf8;
    --cyan: #22d3ee;
    --accent: #facc15;
    --danger: #ef4444;
    --radius-xl: 24px;
    --radius-lg: 18px;
    --shadow: 0 28px 80px rgba(0, 0, 0, 0.38);
    --max: 1180px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    background: var(--bg);
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
    background:
        radial-gradient(circle at top left, rgba(37, 99, 235, 0.22), transparent 34rem),
        radial-gradient(circle at top right, rgba(34, 211, 238, 0.16), transparent 30rem),
        linear-gradient(180deg, #020617 0%, #0f172a 46%, #020617 100%);
}

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

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

button,
input,
select {
    font: inherit;
}

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

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

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

.brand {
    font-size: 22px;
}

.brand-mark {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    color: white;
    background: linear-gradient(135deg, var(--blue), var(--cyan));
    box-shadow: 0 12px 34px rgba(37, 99, 235, 0.45);
}

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

.nav-links > a,
.nav-dropdown > button,
.nav-dropdown div a {
    border: 0;
    border-radius: 12px;
    padding: 10px 14px;
    color: var(--soft);
    background: transparent;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.nav-links > a:hover,
.nav-links > a.is-active,
.nav-dropdown > button:hover {
    color: white;
    background: rgba(37, 99, 235, 0.88);
}

.nav-dropdown {
    position: relative;
}

.nav-dropdown div {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 190px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--panel-strong);
    box-shadow: var(--shadow);
    display: grid;
    gap: 4px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
}

.nav-dropdown:hover div,
.nav-dropdown:focus-within div {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav-dropdown div a:hover {
    color: white;
    background: rgba(51, 65, 85, 0.9);
}

.nav-toggle {
    display: none;
    border: 1px solid var(--line);
    border-radius: 12px;
    color: white;
    background: rgba(30, 41, 59, 0.8);
    padding: 9px 12px;
}

.hero {
    position: relative;
    height: min(720px, 72vh);
    min-height: 560px;
    overflow: hidden;
    border-bottom: 1px solid var(--line);
}

.hero-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.7s ease, visibility 0.7s ease;
}

.hero-slide.is-active {
    opacity: 1;
    visibility: visible;
}

.hero-slide > img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.04);
    filter: saturate(1.08) contrast(1.05);
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(2, 6, 23, 0.95) 0%, rgba(2, 6, 23, 0.68) 42%, rgba(2, 6, 23, 0.16) 100%),
        linear-gradient(0deg, #020617 0%, rgba(2, 6, 23, 0.22) 42%, rgba(2, 6, 23, 0.08) 100%);
}

.hero-content {
    position: absolute;
    left: max(24px, calc((100vw - var(--max)) / 2));
    bottom: 116px;
    width: min(650px, calc(100% - 48px));
}

.eyebrow,
.section-title span,
.category-overview-card span,
.intro-card span,
.page-hero span {
    display: inline-flex;
    margin-bottom: 10px;
    color: var(--blue-light);
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.hero-content h1,
.page-hero h1,
.detail-info h1 {
    margin: 0 0 18px;
    font-size: clamp(40px, 7vw, 76px);
    line-height: 0.98;
    letter-spacing: -0.05em;
}

.hero-content p,
.page-hero p,
.detail-info .lead {
    margin: 0;
    color: #dbeafe;
    font-size: 18px;
    line-height: 1.8;
}

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

.hero-tags span,
.tag-row span {
    border: 1px solid rgba(56, 189, 248, 0.3);
    border-radius: 999px;
    padding: 5px 10px;
    color: #dbeafe;
    background: rgba(14, 165, 233, 0.12);
    font-size: 12px;
}

.tag-row.large span {
    font-size: 14px;
    padding: 7px 12px;
}

.hero-actions,
.detail-info .btn {
    margin-top: 28px;
}

.btn,
.hero-search button,
.inline-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    border-radius: 14px;
    padding: 12px 18px;
    font-weight: 700;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn:hover,
.hero-search button:hover,
.inline-link:hover {
    transform: translateY(-2px);
}

.btn.primary,
.hero-search button,
.inline-link {
    color: white;
    background: linear-gradient(135deg, var(--blue), var(--cyan));
    box-shadow: 0 16px 38px rgba(37, 99, 235, 0.34);
}

.btn.ghost {
    margin-left: 10px;
    color: white;
    border-color: var(--line);
    background: rgba(15, 23, 42, 0.74);
}

.hero-dots {
    position: absolute;
    left: max(24px, calc((100vw - var(--max)) / 2));
    bottom: 58px;
    display: flex;
    gap: 8px;
}

.hero-dots button {
    width: 34px;
    height: 6px;
    border: 0;
    border-radius: 999px;
    background: rgba(203, 213, 225, 0.35);
    cursor: pointer;
}

.hero-dots button.is-active {
    background: linear-gradient(90deg, var(--blue), var(--cyan));
}

.hero-search {
    position: absolute;
    right: max(24px, calc((100vw - var(--max)) / 2));
    bottom: 58px;
    width: min(420px, calc(100% - 48px));
    display: flex;
    gap: 10px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.76);
    backdrop-filter: blur(16px);
}

.hero-search input,
.filter-panel input,
.filter-panel select {
    width: 100%;
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 12px;
    color: white;
    outline: none;
    background: rgba(2, 6, 23, 0.64);
    padding: 12px 13px;
}

.hero-search input::placeholder,
.filter-panel input::placeholder {
    color: #64748b;
}

.section-shell,
.detail-wrap {
    width: min(var(--max), calc(100% - 32px));
    margin: 0 auto;
}

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

.intro-grid {
    display: grid;
    grid-template-columns: 1.3fr 1fr 1fr;
    gap: 18px;
}

.intro-card,
.category-card,
.category-overview-card,
.movie-card,
.ranking-panel,
.detail-info,
.detail-poster,
.detail-content > div,
.filter-panel,
.rank-item,
.player-section {
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.86), rgba(15, 23, 42, 0.52));
    box-shadow: 0 18px 55px rgba(0, 0, 0, 0.18);
}

.intro-card,
.category-card,
.category-overview-card,
.ranking-panel,
.detail-info,
.detail-content > div,
.filter-panel,
.player-section {
    padding: 24px;
}

.intro-card.highlight {
    background:
        radial-gradient(circle at top right, rgba(56, 189, 248, 0.2), transparent 22rem),
        linear-gradient(135deg, rgba(30, 64, 175, 0.44), rgba(15, 23, 42, 0.8));
}

.intro-card h2,
.section-title h2,
.category-overview-card h2,
.detail-content h2 {
    margin: 0 0 12px;
    font-size: clamp(24px, 3vw, 34px);
    line-height: 1.1;
}

.intro-card p,
.category-overview-card p,
.detail-content p,
.movie-card p,
.rank-info p,
.site-footer p {
    color: var(--muted);
    line-height: 1.75;
}

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

.section-title.small {
    margin-bottom: 14px;
}

.section-title a {
    color: var(--blue-light);
    font-weight: 700;
}

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

.category-card {
    display: grid;
    min-height: 168px;
    align-content: space-between;
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.category-card:hover,
.movie-card:hover,
.rank-item:hover,
.category-overview-card:hover {
    transform: translateY(-4px);
    border-color: rgba(56, 189, 248, 0.52);
}

.category-card span {
    font-size: 22px;
    font-weight: 800;
}

.category-card strong {
    color: var(--muted);
    font-weight: 500;
    line-height: 1.65;
}

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

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

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

.movie-card {
    overflow: hidden;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.movie-poster {
    position: relative;
    display: block;
    aspect-ratio: 2 / 3;
    overflow: hidden;
    background: #0f172a;
}

.movie-poster img,
.detail-poster img,
.rank-thumb img,
.category-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s ease, filter 0.35s ease;
}

.movie-card:hover .movie-poster img,
.category-overview-card:hover img,
.rank-item:hover img {
    transform: scale(1.06);
    filter: saturate(1.1);
}

.poster-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    border-radius: 999px;
    padding: 5px 9px;
    color: #111827;
    background: var(--accent);
    font-size: 12px;
    font-weight: 900;
}

.movie-body {
    padding: 16px;
}

.movie-title {
    margin: 0 0 9px;
    font-size: 18px;
    line-height: 1.32;
}

.movie-title a:hover,
.rank-info a:hover {
    color: var(--blue-light);
}

.movie-meta,
.detail-meta,
.rank-info div {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    color: var(--soft);
    font-size: 13px;
}

.movie-meta span,
.detail-meta span,
.rank-info div span {
    border-radius: 999px;
    padding: 4px 9px;
    background: rgba(51, 65, 85, 0.76);
}

.movie-card p {
    min-height: 72px;
    margin: 12px 0 0;
    font-size: 14px;
}

.home-rank,
.full-rank {
    display: grid;
    gap: 12px;
}

.rank-item {
    display: grid;
    grid-template-columns: 48px 74px minmax(0, 1fr);
    gap: 14px;
    align-items: center;
    padding: 12px;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.rank-num {
    display: flex;
    width: 42px;
    height: 42px;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    color: white;
    background: linear-gradient(135deg, var(--blue), #7c3aed);
    font-weight: 900;
}

.rank-thumb {
    aspect-ratio: 2 / 3;
    overflow: hidden;
    border-radius: 12px;
    background: #0f172a;
}

.rank-info h3 {
    margin: 0 0 6px;
    font-size: 16px;
    line-height: 1.3;
}

.rank-info p {
    margin: 0 0 8px;
    font-size: 13px;
}

.page-hero {
    width: min(var(--max), calc(100% - 32px));
    margin: 30px auto 0;
    border: 1px solid var(--line);
    border-radius: 30px;
    background:
        radial-gradient(circle at top right, rgba(34, 211, 238, 0.2), transparent 26rem),
        linear-gradient(135deg, rgba(30, 64, 175, 0.45), rgba(15, 23, 42, 0.85));
    padding: 62px;
    box-shadow: var(--shadow);
}

.page-hero.slim h1 {
    font-size: clamp(38px, 6vw, 64px);
}

.filter-panel {
    margin-bottom: 24px;
}

.filter-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) 220px 180px;
    gap: 14px;
}

.filter-panel label span {
    display: block;
    margin-bottom: 8px;
    color: var(--soft);
    font-size: 13px;
    font-weight: 700;
}

.filter-count {
    margin: 12px 0 0;
    color: var(--muted);
}

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

.category-overview-card {
    display: grid;
    grid-template-columns: 164px minmax(0, 1fr);
    gap: 20px;
    align-items: center;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.category-cover {
    aspect-ratio: 2 / 3;
    overflow: hidden;
    border-radius: 18px;
    background: #0f172a;
}

.detail-wrap {
    padding: 30px 0 60px;
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    color: var(--muted);
    margin-bottom: 20px;
}

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

.detail-grid {
    display: grid;
    grid-template-columns: 330px minmax(0, 1fr);
    gap: 24px;
    align-items: stretch;
}

.detail-poster {
    overflow: hidden;
    padding: 0;
    background: #0f172a;
}

.detail-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 480px;
}

.detail-meta {
    margin-top: 22px;
}

.player-section {
    margin: 28px 0;
}

.video-player {
    position: relative;
    overflow: hidden;
    border-radius: 22px;
    background: black;
    aspect-ratio: 16 / 9;
}

.video-player video {
    width: 100%;
    height: 100%;
    display: block;
    background: black;
}

.player-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    color: white;
    background: rgba(0, 0, 0, 0.28);
    cursor: pointer;
    transition: background 0.2s ease, opacity 0.2s ease;
}

.player-overlay span {
    width: 84px;
    height: 84px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--blue), var(--cyan));
    box-shadow: 0 22px 50px rgba(37, 99, 235, 0.48);
    font-size: 34px;
    text-indent: 5px;
    transition: transform 0.2s ease;
}

.player-overlay:hover {
    background: rgba(0, 0, 0, 0.42);
}

.player-overlay:hover span {
    transform: scale(1.08);
}

.video-player.is-playing .player-overlay {
    opacity: 0;
    pointer-events: none;
}

.detail-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.detail-related {
    width: 100%;
    padding-left: 0;
    padding-right: 0;
}

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

.site-footer {
    border-top: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.5), rgba(2, 6, 23, 0.94));
}

.footer-shell {
    width: min(var(--max), calc(100% - 32px));
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.2fr 0.7fr 0.7fr;
    gap: 28px;
    padding: 46px 0;
}

.site-footer h2 {
    margin: 0 0 14px;
    font-size: 17px;
}

.site-footer ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 9px;
    color: var(--muted);
}

.site-footer a:hover {
    color: var(--blue-light);
}

[data-movie-card].is-hidden {
    display: none;
}

@media (max-width: 1080px) {
    .two-column,
    .detail-grid,
    .detail-content,
    .footer-shell,
    .intro-grid {
        grid-template-columns: 1fr;
    }

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

    .ranking-panel {
        position: static;
    }

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

@media (max-width: 820px) {
    .nav-toggle {
        display: inline-flex;
    }

    .nav-links {
        position: absolute;
        top: 72px;
        left: 16px;
        right: 16px;
        display: none;
        flex-direction: column;
        align-items: stretch;
        padding: 14px;
        border: 1px solid var(--line);
        border-radius: 18px;
        background: var(--panel-strong);
        box-shadow: var(--shadow);
    }

    .nav-links.is-open {
        display: flex;
    }

    .nav-dropdown div {
        position: static;
        width: 100%;
        margin-top: 8px;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
    }

    .hero {
        min-height: 680px;
        height: 84vh;
    }

    .hero-content {
        bottom: 178px;
    }

    .hero-search {
        left: 24px;
        right: 24px;
        width: auto;
        flex-direction: column;
    }

    .hero-dots {
        bottom: 148px;
    }

    .movie-grid,
    .compact-grid,
    .related-grid,
    .category-grid,
    .category-overview-grid,
    .filter-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .page-hero {
        padding: 34px 24px;
    }

    .category-overview-card {
        grid-template-columns: 120px minmax(0, 1fr);
    }
}

@media (max-width: 560px) {
    .nav-shell,
    .section-shell,
    .detail-wrap,
    .footer-shell,
    .page-hero {
        width: min(100% - 22px, var(--max));
    }

    .brand {
        font-size: 18px;
    }

    .hero-content h1,
    .page-hero h1,
    .detail-info h1 {
        font-size: 38px;
    }

    .movie-grid,
    .compact-grid,
    .related-grid,
    .category-grid,
    .category-overview-grid,
    .filter-grid {
        grid-template-columns: 1fr;
    }

    .rank-item {
        grid-template-columns: 42px 64px minmax(0, 1fr);
    }

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

    .category-cover {
        max-width: 180px;
    }

    .btn.ghost {
        margin-left: 0;
        margin-top: 10px;
    }
}
