:root {
    color-scheme: dark;
    --bg: #020617;
    --bg-soft: #0f172a;
    --panel: rgba(15, 23, 42, 0.82);
    --panel-strong: rgba(15, 23, 42, 0.96);
    --line: rgba(148, 163, 184, 0.18);
    --text: #f8fafc;
    --muted: #94a3b8;
    --soft: #cbd5e1;
    --accent: #38bdf8;
    --accent-2: #22d3ee;
    --warm: #f59e0b;
    --danger: #fb7185;
    --shadow: 0 24px 80px rgba(2, 6, 23, 0.48);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at 18% 0%, rgba(56, 189, 248, 0.18), transparent 36rem),
        radial-gradient(circle at 82% 14%, rgba(14, 165, 233, 0.14), transparent 34rem),
        linear-gradient(180deg, #020617 0%, #0f172a 48%, #020617 100%);
}

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

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

button,
input,
select {
    font: inherit;
}

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

.nav-shell {
    width: min(1180px, 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 {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 15px;
    background: linear-gradient(135deg, #38bdf8, #2563eb 52%, #7c3aed);
    font-size: 14px;
    font-weight: 900;
    letter-spacing: 0.06em;
    box-shadow: 0 18px 38px rgba(56, 189, 248, 0.25);
}

.brand-text {
    font-size: 22px;
    font-weight: 900;
    letter-spacing: 0.02em;
}

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

.nav-link {
    border: 1px solid transparent;
    border-radius: 999px;
    padding: 9px 16px;
    color: var(--soft);
    transition: 0.22s ease;
}

.nav-link:hover,
.nav-link.active {
    color: #ffffff;
    border-color: rgba(56, 189, 248, 0.38);
    background: rgba(56, 189, 248, 0.12);
}

.nav-toggle {
    display: none;
    width: 42px;
    height: 42px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.9);
    color: var(--text);
}

.nav-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    margin: 4px auto;
    border-radius: 99px;
    background: currentColor;
}

main {
    min-height: 60vh;
}

.hero-carousel {
    position: relative;
    width: min(1180px, calc(100% - 32px));
    min-height: 610px;
    margin: 32px auto 0;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 34px;
    background: rgba(15, 23, 42, 0.68);
    box-shadow: var(--shadow);
}

.hero-track,
.hero-slide {
    min-height: inherit;
}

.hero-slide {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 330px;
    align-items: center;
    gap: 48px;
    padding: 72px 72px 92px;
    opacity: 0;
    pointer-events: none;
    transform: scale(1.015);
    transition: opacity 0.55s ease, transform 0.55s ease;
}

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

.hero-backdrop,
.detail-shade {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(2, 6, 23, 0.96), rgba(2, 6, 23, 0.72) 48%, rgba(2, 6, 23, 0.36)),
        linear-gradient(180deg, rgba(2, 6, 23, 0.08), rgba(2, 6, 23, 0.92)),
        var(--hero-image, none) center / cover no-repeat;
    filter: saturate(1.08);
}

.hero-backdrop::after,
.detail-shade::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 70% 16%, rgba(56, 189, 248, 0.22), transparent 28rem);
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 720px;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(56, 189, 248, 0.28);
    border-radius: 999px;
    padding: 8px 13px;
    color: #bae6fd;
    background: rgba(14, 165, 233, 0.12);
    font-size: 14px;
    font-weight: 700;
}

.hero-content h1,
.page-hero h1,
.detail-info h1 {
    margin: 20px 0 18px;
    font-size: clamp(38px, 5vw, 74px);
    line-height: 1.02;
    letter-spacing: -0.05em;
}

.hero-content p,
.page-hero p,
.detail-one-line {
    max-width: 720px;
    color: #dbeafe;
    font-size: 18px;
    line-height: 1.8;
}

.tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 22px 0;
}

.tag-row span {
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 999px;
    padding: 7px 12px;
    color: #dbeafe;
    background: rgba(15, 23, 42, 0.72);
    font-size: 13px;
}

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

.primary-btn,
.ghost-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    border-radius: 999px;
    padding: 0 22px;
    font-weight: 800;
    transition: 0.22s ease;
}

.primary-btn {
    color: #00111e;
    background: linear-gradient(135deg, #67e8f9, #38bdf8 46%, #0ea5e9);
    box-shadow: 0 16px 36px rgba(56, 189, 248, 0.28);
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 22px 48px rgba(56, 189, 248, 0.34);
}

.ghost-btn {
    border: 1px solid rgba(148, 163, 184, 0.28);
    color: #e0f2fe;
    background: rgba(15, 23, 42, 0.72);
}

.ghost-btn:hover {
    border-color: rgba(56, 189, 248, 0.55);
    background: rgba(56, 189, 248, 0.12);
}

.hero-poster {
    position: relative;
    z-index: 2;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 30px;
    aspect-ratio: 2 / 3;
    background: linear-gradient(135deg, #0f172a, #164e63);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}

.hero-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-poster span {
    position: absolute;
    right: 18px;
    bottom: 18px;
    border-radius: 999px;
    padding: 8px 12px;
    color: #00111e;
    background: rgba(103, 232, 249, 0.92);
    font-size: 13px;
    font-weight: 900;
}

.hero-bottom {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 24px 32px;
}

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

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

.hero-dot.is-active {
    background: #38bdf8;
}

.hero-controls {
    display: flex;
    gap: 10px;
}

.hero-controls button {
    width: 42px;
    height: 42px;
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 999px;
    color: #ffffff;
    background: rgba(15, 23, 42, 0.78);
    cursor: pointer;
}

.content-section {
    width: min(1180px, calc(100% - 32px));
    margin: 44px auto;
}

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

.section-heading h2,
.ranking-head h2,
.copy-card h2 {
    margin: 0 0 8px;
    font-size: clamp(24px, 3vw, 34px);
    line-height: 1.1;
    letter-spacing: -0.03em;
}

.section-heading p,
.ranking-head a,
.section-heading a {
    margin: 0;
    color: var(--muted);
}

.section-heading a,
.ranking-head a {
    font-weight: 800;
    color: #7dd3fc;
}

.filter-panel {
    display: grid;
    grid-template-columns: minmax(240px, 1fr) 170px 170px;
    gap: 14px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 24px;
    padding: 16px;
    background: rgba(15, 23, 42, 0.68);
    box-shadow: 0 18px 46px rgba(2, 6, 23, 0.24);
}

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

.filter-panel label {
    display: grid;
    gap: 8px;
    color: var(--soft);
    font-size: 13px;
    font-weight: 800;
}

.filter-panel input,
.filter-panel select {
    width: 100%;
    min-height: 46px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 16px;
    padding: 0 14px;
    color: #ffffff;
    background: rgba(2, 6, 23, 0.72);
    outline: none;
}

.filter-panel input:focus,
.filter-panel select:focus {
    border-color: rgba(56, 189, 248, 0.72);
    box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.12);
}

.filter-status {
    min-height: 28px;
    margin: 18px 0;
    color: var(--muted);
}

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

.movie-card {
    position: relative;
    overflow: hidden;
    display: grid;
    grid-template-rows: auto 1fr;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 24px;
    background: rgba(15, 23, 42, 0.76);
    box-shadow: 0 18px 48px rgba(2, 6, 23, 0.22);
    transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.movie-card:hover {
    transform: translateY(-5px);
    border-color: rgba(56, 189, 248, 0.42);
    box-shadow: 0 28px 70px rgba(2, 6, 23, 0.34);
}

.poster {
    position: relative;
    overflow: hidden;
    display: block;
    aspect-ratio: 2 / 3;
    background:
        radial-gradient(circle at 30% 18%, rgba(56, 189, 248, 0.35), transparent 11rem),
        linear-gradient(135deg, #0f172a, #1e293b 48%, #0e7490);
}

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

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

.poster img.image-missing,
.hero-poster img.image-missing,
.category-tile img.image-missing,
.category-hero-card img.image-missing,
.detail-poster img.image-missing {
    display: none;
}

.poster-shade {
    position: absolute;
    inset: auto 0 0;
    height: 42%;
    background: linear-gradient(180deg, transparent, rgba(2, 6, 23, 0.86));
}

.poster-play {
    position: absolute;
    left: 50%;
    top: 50%;
    display: grid;
    place-items: center;
    width: 54px;
    height: 54px;
    border-radius: 999px;
    color: #00111e;
    background: rgba(125, 211, 252, 0.92);
    transform: translate(-50%, -50%) scale(0.86);
    opacity: 0;
    transition: 0.22s ease;
}

.movie-card:hover .poster-play {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

.poster-year {
    position: absolute;
    left: 12px;
    top: 12px;
    border-radius: 999px;
    padding: 5px 9px;
    color: #ffffff;
    background: rgba(2, 6, 23, 0.68);
    font-size: 12px;
    font-weight: 900;
}

.movie-card-body {
    position: relative;
    display: grid;
    gap: 8px;
    padding: 16px;
}

.movie-card-body strong {
    display: -webkit-box;
    overflow: hidden;
    min-height: 1.45em;
    color: #ffffff;
    font-size: 18px;
    line-height: 1.35;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
}

.movie-card-body small,
.card-meta,
.card-desc {
    color: var(--muted);
    line-height: 1.55;
}

.card-meta,
.card-desc {
    display: -webkit-box;
    overflow: hidden;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.card-meta {
    color: #bae6fd;
    font-size: 13px;
}

.card-desc {
    font-size: 14px;
}

.movie-card.small {
    grid-template-columns: 94px 1fr;
    grid-template-rows: none;
    min-height: 138px;
}

.movie-card.small .poster {
    height: 100%;
    min-height: 138px;
}

.movie-card.small .movie-card-body {
    align-content: center;
}

.movie-card.small .card-desc {
    -webkit-line-clamp: 1;
}

.rank-num {
    position: absolute;
    right: 14px;
    top: 13px;
    color: rgba(125, 211, 252, 0.22);
    font-size: 34px;
    font-style: normal;
    font-weight: 900;
    line-height: 1;
}

.split-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 380px;
    gap: 28px;
    align-items: start;
}

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

.category-tile,
.category-hero-card {
    position: relative;
    overflow: hidden;
    display: grid;
    min-height: 160px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 24px;
    background: rgba(15, 23, 42, 0.78);
}

.category-tile img,
.category-hero-card img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.42;
    filter: saturate(1.1);
}

.category-tile::after,
.category-hero-card::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(2, 6, 23, 0.08), rgba(2, 6, 23, 0.9));
}

.category-tile span,
.category-hero-card span {
    position: relative;
    z-index: 2;
    align-self: end;
    display: grid;
    gap: 8px;
    padding: 20px;
}

.category-tile strong,
.category-hero-card strong {
    font-size: 22px;
}

.category-tile small,
.category-hero-card small {
    color: #cbd5e1;
    line-height: 1.6;
}

.ranking-card {
    position: sticky;
    top: 92px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 28px;
    padding: 22px;
    background: rgba(15, 23, 42, 0.82);
    box-shadow: var(--shadow);
}

.ranking-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.ranking-list {
    display: grid;
    gap: 12px;
}

.page-hero,
.detail-hero {
    position: relative;
    overflow: hidden;
    width: min(1180px, calc(100% - 32px));
    margin: 32px auto 0;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 32px;
    background: rgba(15, 23, 42, 0.7);
    box-shadow: var(--shadow);
}

.compact-hero {
    padding: 72px;
    background:
        radial-gradient(circle at 18% 20%, rgba(56, 189, 248, 0.22), transparent 28rem),
        linear-gradient(135deg, rgba(15, 23, 42, 0.96), rgba(30, 41, 59, 0.78));
}

.category-overview {
    display: grid;
    gap: 28px;
}

.category-block {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 18px;
    align-items: stretch;
}

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

.ranking-grid .movie-card:nth-child(-n + 3) {
    border-color: rgba(245, 158, 11, 0.38);
}

.rank-table {
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 24px;
    background: rgba(15, 23, 42, 0.72);
}

.rank-row {
    display: grid;
    grid-template-columns: 64px minmax(150px, 0.8fr) minmax(220px, 1.2fr);
    gap: 18px;
    align-items: center;
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
    padding: 16px 20px;
}

.rank-row:last-child {
    border-bottom: 0;
}

.rank-row span {
    color: #7dd3fc;
    font-weight: 900;
}

.rank-row small {
    color: var(--muted);
}

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

.detail-hero .detail-shade {
    background:
        linear-gradient(90deg, rgba(2, 6, 23, 0.98), rgba(2, 6, 23, 0.76) 56%, rgba(2, 6, 23, 0.35)),
        var(--detail-image, none) center / cover no-repeat;
}

.detail-inner {
    position: relative;
    z-index: 2;
    padding: 42px 56px 60px;
}

.breadcrumb,
.breadcrumb-sep {
    display: inline-flex;
    margin-bottom: 28px;
    color: #bae6fd;
    font-weight: 800;
}

.breadcrumb-sep {
    margin-inline: 10px;
    color: rgba(203, 213, 225, 0.6);
}

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

.detail-poster {
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 28px;
    aspect-ratio: 2 / 3;
    background: linear-gradient(135deg, #0f172a, #164e63);
    box-shadow: 0 26px 72px rgba(0, 0, 0, 0.48);
}

.detail-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.detail-meta {
    display: grid;
    gap: 10px;
    margin: 24px 0;
    color: #cbd5e1;
}

.player-section {
    scroll-margin-top: 92px;
}

.player-frame {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 30px;
    background: #000000;
    box-shadow: var(--shadow);
}

.movie-video {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000000;
}

.player-overlay {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 14px;
    border: 0;
    color: #ffffff;
    background:
        radial-gradient(circle at 50% 42%, rgba(56, 189, 248, 0.2), transparent 18rem),
        linear-gradient(180deg, rgba(2, 6, 23, 0.42), rgba(2, 6, 23, 0.88));
    cursor: pointer;
}

.player-overlay.is-hidden {
    display: none;
}

.play-circle {
    display: grid;
    place-items: center;
    width: 82px;
    height: 82px;
    border-radius: 999px;
    color: #00111e;
    background: linear-gradient(135deg, #67e8f9, #38bdf8);
    font-size: 30px;
    box-shadow: 0 20px 48px rgba(56, 189, 248, 0.38);
}

.player-overlay strong {
    font-size: clamp(24px, 4vw, 42px);
}

.player-overlay small {
    color: #bae6fd;
    font-weight: 800;
}

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

.copy-card {
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 28px;
    padding: 28px;
    background: rgba(15, 23, 42, 0.74);
    box-shadow: 0 18px 48px rgba(2, 6, 23, 0.2);
}

.copy-card p {
    margin: 0;
    color: #cbd5e1;
    line-height: 1.9;
}

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

.site-footer {
    margin-top: 68px;
    border-top: 1px solid rgba(148, 163, 184, 0.16);
    background: rgba(2, 6, 23, 0.66);
}

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

.footer-brand {
    color: #ffffff;
    font-size: 22px;
    font-weight: 900;
}

.footer-inner p {
    max-width: 620px;
    margin: 0;
    line-height: 1.7;
}

.footer-links {
    display: flex;
    gap: 16px;
    color: #7dd3fc;
    font-weight: 800;
}

.is-filtered-out {
    display: none !important;
}

@media (max-width: 1100px) {
    .hero-slide {
        grid-template-columns: 1fr;
        padding: 52px 44px 92px;
    }

    .hero-poster {
        display: none;
    }

    .split-layout,
    .category-block,
    .detail-layout,
    .detail-copy {
        grid-template-columns: 1fr;
    }

    .ranking-card {
        position: static;
    }

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

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

    .site-nav {
        position: absolute;
        left: 16px;
        right: 16px;
        top: 78px;
        display: none;
        flex-direction: column;
        align-items: stretch;
        border: 1px solid rgba(148, 163, 184, 0.18);
        border-radius: 24px;
        padding: 14px;
        background: rgba(2, 6, 23, 0.96);
        box-shadow: var(--shadow);
    }

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

    .nav-link {
        border-radius: 16px;
        padding: 13px 14px;
    }

    .hero-carousel,
    .page-hero,
    .detail-hero,
    .content-section {
        width: min(100% - 22px, 1180px);
    }

    .hero-carousel {
        min-height: 590px;
        border-radius: 26px;
    }

    .hero-slide {
        padding: 42px 24px 86px;
    }

    .compact-hero,
    .detail-inner {
        padding: 42px 24px;
    }

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

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

    .rank-row {
        grid-template-columns: 44px 1fr;
    }

    .rank-row small {
        grid-column: 2;
    }

    .footer-inner {
        align-items: flex-start;
        flex-direction: column;
    }
}

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

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

    .hero-content p,
    .page-hero p,
    .detail-one-line {
        font-size: 16px;
    }

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

    .movie-card.small {
        grid-template-columns: 84px 1fr;
    }

    .category-tile,
    .category-hero-card {
        min-height: 140px;
    }

    .footer-links {
        flex-wrap: wrap;
    }
}
