:root {
    color-scheme: dark;
    --bg: #020617;
    --bg-soft: #0f172a;
    --panel: rgba(15, 23, 42, 0.78);
    --panel-strong: rgba(15, 23, 42, 0.96);
    --text: #e2e8f0;
    --muted: #94a3b8;
    --line: rgba(148, 163, 184, 0.18);
    --cyan: #22d3ee;
    --blue: #3b82f6;
    --violet: #8b5cf6;
    --radius: 24px;
    --shadow: 0 24px 80px rgba(0, 0, 0, 0.4);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(34, 211, 238, 0.14), transparent 34rem),
        radial-gradient(circle at top right, rgba(59, 130, 246, 0.12), transparent 32rem),
        var(--bg);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background: linear-gradient(180deg, rgba(2, 6, 23, 0.08), #020617 64%);
    pointer-events: none;
}

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

img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #0b1220;
}

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

.header-inner {
    width: min(1280px, calc(100% - 32px));
    min-height: 72px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 20px;
}

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

.brand-mark {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--cyan), var(--blue));
    color: white;
    box-shadow: 0 0 28px rgba(34, 211, 238, 0.35);
}

.brand-text {
    font-size: 20px;
    color: #f8fafc;
}

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

.nav-link {
    position: relative;
    padding: 10px 14px;
    border-radius: 999px;
    color: var(--muted);
    font-weight: 600;
    transition: color 0.2s ease, background 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
    color: white;
    background: rgba(34, 211, 238, 0.12);
}

.header-search {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 280px;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.72);
}

.header-search input,
.hero-search input,
.filter-bar input,
.filter-bar select {
    width: 100%;
    min-width: 0;
    border: 0;
    outline: 0;
    color: white;
    background: transparent;
    font: inherit;
}

.header-search button,
.hero-search button,
.filter-bar button {
    border: 0;
    border-radius: 999px;
    padding: 9px 14px;
    color: white;
    background: linear-gradient(135deg, var(--cyan), var(--blue));
    font-weight: 700;
    cursor: pointer;
}

.nav-toggle {
    display: none;
    margin-left: auto;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 9px 14px;
    color: white;
    background: rgba(15, 23, 42, 0.82);
}

.hero-slider {
    position: relative;
    min-height: 80vh;
    overflow: hidden;
    display: grid;
    align-items: end;
    isolation: isolate;
}

.hero-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transform: scale(1.02);
    transition: opacity 0.65s ease, transform 0.65s ease;
    background:
        linear-gradient(90deg, rgba(2, 6, 23, 0.94) 0%, rgba(2, 6, 23, 0.66) 44%, rgba(2, 6, 23, 0.28) 100%),
        linear-gradient(0deg, #020617 0%, rgba(2, 6, 23, 0.06) 38%),
        var(--hero-image) center / cover no-repeat;
}

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

.hero-content {
    position: relative;
    z-index: 2;
    width: min(1280px, calc(100% - 32px));
    margin: 0 auto;
    padding: 140px 0 130px;
}

.eyebrow {
    margin: 0 0 12px;
    color: var(--cyan);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.hero-content h1,
.page-hero h1,
.detail-copy h1 {
    max-width: 780px;
    margin: 0;
    color: white;
    font-size: clamp(38px, 7vw, 76px);
    line-height: 1.02;
    letter-spacing: -0.05em;
}

.hero-summary,
.page-hero p,
.detail-line {
    max-width: 720px;
    margin: 22px 0 0;
    color: #cbd5e1;
    font-size: clamp(16px, 2vw, 20px);
    line-height: 1.8;
}

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

.hero-tags span,
.tag-row span {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 5px 10px;
    border: 1px solid rgba(34, 211, 238, 0.2);
    border-radius: 999px;
    color: #a5f3fc;
    background: rgba(8, 145, 178, 0.12);
    font-size: 12px;
}

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

.btn-primary,
.btn-secondary,
.section-link,
.text-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 22px;
    border-radius: 999px;
    font-weight: 800;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.btn-primary {
    color: white;
    background: linear-gradient(135deg, var(--cyan), var(--blue));
    box-shadow: 0 16px 44px rgba(34, 211, 238, 0.28);
}

.btn-secondary,
.section-link,
.text-link {
    color: #dbeafe;
    border: 1px solid rgba(148, 163, 184, 0.28);
    background: rgba(15, 23, 42, 0.68);
}

.btn-primary:hover,
.btn-secondary:hover,
.section-link:hover,
.text-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.22);
}

.hero-controls {
    position: absolute;
    right: min(6vw, 80px);
    bottom: 46px;
    z-index: 4;
    display: flex;
    align-items: center;
    gap: 14px;
}

.hero-arrow,
.hero-dot {
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: white;
    background: rgba(0, 0, 0, 0.38);
    cursor: pointer;
    backdrop-filter: blur(10px);
}

.hero-arrow {
    width: 46px;
    height: 46px;
    border-radius: 999px;
    font-size: 32px;
    line-height: 1;
}

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

.hero-dot {
    width: 10px;
    height: 10px;
    padding: 0;
    border-radius: 999px;
}

.hero-dot.is-active {
    width: 28px;
    background: var(--cyan);
}

.hero-search {
    position: absolute;
    left: 50%;
    bottom: 34px;
    z-index: 4;
    width: min(560px, calc(100% - 32px));
    display: flex;
    gap: 10px;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.78);
    transform: translateX(-50%);
    backdrop-filter: blur(18px);
}

.section,
.page-main {
    width: min(1280px, calc(100% - 32px));
    margin: 0 auto;
}

.section {
    padding: 72px 0 0;
}

.section-overlap {
    position: relative;
    z-index: 5;
    margin-top: -46px;
}

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

.section-head h2,
.movie-article h2,
.player-section h2 {
    margin: 0;
    color: white;
    font-size: clamp(24px, 3vw, 34px);
    letter-spacing: -0.03em;
}

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

.category-tile,
.category-cover {
    position: relative;
    min-height: 170px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: end;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background:
        linear-gradient(180deg, rgba(2, 6, 23, 0.04), rgba(2, 6, 23, 0.9)),
        var(--tile-image) center / cover no-repeat;
    box-shadow: var(--shadow);
    transition: transform 0.25s ease, border-color 0.25s ease;
}

.category-tile:hover,
.category-cover:hover,
.movie-card:hover {
    transform: translateY(-5px);
    border-color: rgba(34, 211, 238, 0.46);
}

.category-tile span,
.category-cover span {
    color: white;
    font-size: 22px;
    font-weight: 900;
}

.category-tile p,
.category-body p {
    margin: 8px 0 0;
    color: #cbd5e1;
    line-height: 1.7;
}

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

.movie-card {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.92), rgba(15, 23, 42, 0.62));
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.24);
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

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

.poster-link img {
    transition: transform 0.45s ease, filter 0.45s ease;
}

.movie-card:hover img {
    transform: scale(1.06);
    filter: saturate(1.08);
}

.year-badge,
.rank-badge {
    position: absolute;
    z-index: 2;
    top: 10px;
    border-radius: 999px;
    padding: 5px 9px;
    color: white;
    font-size: 12px;
    font-weight: 800;
    background: rgba(2, 6, 23, 0.72);
    backdrop-filter: blur(10px);
}

.year-badge {
    left: 10px;
}

.rank-badge {
    right: 10px;
    background: linear-gradient(135deg, var(--cyan), var(--blue));
}

.movie-info {
    padding: 14px;
}

.movie-info h3 {
    margin: 0;
    color: white;
    font-size: 16px;
    line-height: 1.35;
}

.movie-info h3 a:hover {
    color: var(--cyan);
}

.movie-meta,
.movie-desc {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.6;
}

.movie-desc {
    color: #cbd5e1;
}

.tag-row {
    margin-top: 12px;
}

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

.ranking-layout.wide {
    grid-template-columns: 380px minmax(0, 1fr);
}

.rank-list {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
    box-shadow: var(--shadow);
}

.sticky-rank {
    position: sticky;
    top: 94px;
    align-self: start;
}

.rank-row {
    display: grid;
    grid-template-columns: 54px 1fr;
    gap: 0 12px;
    padding: 16px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.rank-row:hover {
    background: rgba(34, 211, 238, 0.08);
}

.rank-num {
    grid-row: span 2;
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 14px;
    color: white;
    background: rgba(34, 211, 238, 0.14);
    font-weight: 900;
}

.rank-title {
    color: white;
    font-weight: 800;
}

.rank-meta {
    color: var(--muted);
    font-size: 13px;
}

.page-main {
    padding-top: 42px;
}

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

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

.page-hero {
    position: relative;
    overflow: hidden;
    min-height: 300px;
    padding: 52px;
    border: 1px solid var(--line);
    border-radius: 34px;
    background:
        linear-gradient(90deg, rgba(2, 6, 23, 0.94), rgba(2, 6, 23, 0.7)),
        var(--hero-image) center / cover no-repeat,
        linear-gradient(135deg, rgba(34, 211, 238, 0.22), rgba(59, 130, 246, 0.08));
    box-shadow: var(--shadow);
}

.compact-hero {
    min-height: 250px;
    background:
        radial-gradient(circle at top right, rgba(34, 211, 238, 0.18), transparent 28rem),
        linear-gradient(135deg, rgba(15, 23, 42, 0.92), rgba(15, 23, 42, 0.56));
}

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

.category-card {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
    box-shadow: var(--shadow);
}

.category-cover {
    min-height: 210px;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.category-body {
    padding: 20px;
}

.category-body h2 {
    margin: 0;
    color: white;
    font-size: 24px;
}

.mini-posters {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin: 16px 0;
}

.mini-posters img {
    aspect-ratio: 2 / 3;
    border-radius: 12px;
}

.filter-bar {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) repeat(3, minmax(140px, 190px));
    gap: 12px;
    margin-bottom: 24px;
}

.filter-bar input,
.filter-bar select {
    height: 48px;
    padding: 0 16px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.74);
}

.filter-bar select {
    color: #e2e8f0;
}

.empty-message {
    margin: 40px 0 0;
    color: var(--muted);
    text-align: center;
    font-size: 18px;
}

.detail-hero {
    position: relative;
    overflow: hidden;
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 36px;
    align-items: end;
    padding: 38px;
    border: 1px solid var(--line);
    border-radius: 34px;
    background:
        linear-gradient(90deg, rgba(2, 6, 23, 0.94), rgba(2, 6, 23, 0.72)),
        var(--hero-image) center / cover no-repeat;
    box-shadow: var(--shadow);
}

.detail-poster {
    overflow: hidden;
    aspect-ratio: 2 / 3;
    border-radius: 26px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.46);
}

.detail-copy {
    position: relative;
    z-index: 2;
}

.detail-meta {
    margin: 14px 0 0;
    color: var(--muted);
    font-weight: 700;
}

.player-shell {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    border: 1px solid rgba(34, 211, 238, 0.18);
    border-radius: 28px;
    background: #000;
    box-shadow: var(--shadow);
}

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

.play-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    border: 0;
    color: white;
    background: linear-gradient(180deg, rgba(2, 6, 23, 0.08), rgba(2, 6, 23, 0.66));
    cursor: pointer;
    font-size: 18px;
    font-weight: 900;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.play-icon {
    width: 82px;
    height: 82px;
    display: grid;
    place-items: center;
    padding-left: 5px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--cyan), var(--blue));
    box-shadow: 0 0 44px rgba(34, 211, 238, 0.38);
}

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

.movie-article {
    padding: 34px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
    box-shadow: var(--shadow);
}

.movie-article h2 + p {
    margin-top: 12px;
}

.movie-article p {
    color: #cbd5e1;
    font-size: 17px;
    line-height: 1.9;
}

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

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

.footer-inner {
    width: min(1280px, calc(100% - 32px));
    margin: 0 auto;
    padding: 34px 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    color: var(--muted);
}

.footer-brand {
    color: white;
    font-size: 20px;
}

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

.footer-links a:hover {
    color: var(--cyan);
}

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

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

    .ranking-layout,
    .ranking-layout.wide {
        grid-template-columns: 1fr;
    }

    .sticky-rank {
        position: static;
    }

    .detail-hero {
        grid-template-columns: 240px minmax(0, 1fr);
    }
}

@media (max-width: 820px) {
    .header-inner {
        min-height: 66px;
    }

    .nav-toggle {
        display: inline-flex;
    }

    .nav-links {
        position: absolute;
        top: 66px;
        left: 16px;
        right: 16px;
        display: none;
        flex-direction: column;
        align-items: stretch;
        padding: 14px;
        border: 1px solid var(--line);
        border-radius: 22px;
        background: rgba(2, 6, 23, 0.96);
        box-shadow: var(--shadow);
    }

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

    .header-search {
        display: none;
    }

    .hero-content {
        padding: 110px 0 150px;
    }

    .hero-controls {
        right: 18px;
        bottom: 92px;
    }

    .hero-search {
        bottom: 24px;
    }

    .section-head {
        align-items: start;
        flex-direction: column;
    }

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

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

    .page-hero,
    .detail-hero {
        padding: 26px;
        border-radius: 26px;
    }

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

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

@media (max-width: 560px) {
    .brand-text {
        font-size: 17px;
    }

    .hero-slider {
        min-height: 78vh;
    }

    .hero-content h1,
    .page-hero h1,
    .detail-copy h1 {
        font-size: 36px;
    }

    .hero-search {
        border-radius: 24px;
        flex-direction: column;
    }

    .hero-search button {
        width: 100%;
    }

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