:root {
    color-scheme: dark;
    --bg: #020617;
    --panel: rgba(15, 23, 42, 0.72);
    --panel-strong: rgba(15, 23, 42, 0.92);
    --line: rgba(148, 163, 184, 0.18);
    --text: #f8fafc;
    --muted: #94a3b8;
    --soft: #cbd5e1;
    --cyan: #22d3ee;
    --blue: #2563eb;
    --amber: #facc15;
    --shadow: 0 24px 80px rgba(6, 182, 212, 0.16);
}

html {
    scroll-behavior: smooth;
}

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

img {
    max-width: 100%;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 80;
    background: linear-gradient(90deg, rgba(15, 23, 42, 0.95), rgba(30, 41, 59, 0.92), rgba(15, 23, 42, 0.95));
    border-bottom: 1px solid var(--line);
    box-shadow: 0 12px 40px rgba(2, 6, 23, 0.38);
    backdrop-filter: blur(16px);
}

.nav-shell {
    width: min(1200px, calc(100% - 32px));
    margin: 0 auto;
    padding: 16px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

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

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

.brand-name {
    font-size: clamp(1rem, 1.6vw, 1.45rem);
    background: linear-gradient(90deg, #67e8f9, #3b82f6);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

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

.nav-link,
.mobile-nav-link {
    color: var(--soft);
    font-weight: 600;
    transition: color 0.2s ease;
}

.nav-link:hover,
.nav-link.active,
.mobile-nav-link:hover {
    color: var(--cyan);
}

.mobile-menu-button {
    display: none;
    width: 42px;
    height: 42px;
    border: 1px solid var(--line);
    border-radius: 12px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
    background: rgba(15, 23, 42, 0.78);
}

.mobile-menu-button span {
    width: 20px;
    height: 2px;
    border-radius: 999px;
    background: var(--soft);
}

.mobile-nav {
    display: none;
    width: min(1200px, calc(100% - 32px));
    margin: 0 auto;
    padding: 0 0 16px;
    border-top: 1px solid var(--line);
}

.mobile-nav.is-open {
    display: grid;
    gap: 10px;
}

.mobile-nav-link {
    padding: 10px 0;
}

.hero-carousel {
    position: relative;
    min-height: 680px;
    overflow: hidden;
    background: #020617;
}

.hero-slides,
.hero-slide,
.hero-backdrop {
    position: absolute;
    inset: 0;
}

.hero-slide {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.55s ease;
}

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

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

.hero-backdrop::after,
.detail-bg::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(2, 6, 23, 0.96) 0%, rgba(15, 23, 42, 0.78) 44%, rgba(2, 6, 23, 0.55) 100%),
        linear-gradient(0deg, #020617 0%, rgba(2, 6, 23, 0.1) 48%, rgba(2, 6, 23, 0.55) 100%);
}

.hero-content {
    position: relative;
    z-index: 2;
    width: min(1200px, calc(100% - 32px));
    min-height: 680px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 330px;
    align-items: center;
    gap: 56px;
    padding: 76px 0 96px;
}

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

.hero-copy h1,
.page-hero h1,
.detail-intro h1 {
    margin: 0;
    font-size: clamp(2.4rem, 6vw, 5.6rem);
    line-height: 0.98;
    letter-spacing: -0.05em;
    color: white;
}

.hero-summary,
.page-hero p,
.detail-one-line {
    max-width: 760px;
    margin: 22px 0 0;
    color: var(--soft);
    font-size: clamp(1rem, 1.4vw, 1.25rem);
    line-height: 1.8;
}

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

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

.hero-actions,
.detail-intro .primary-button {
    margin-top: 30px;
}

.primary-button,
.secondary-button,
.text-link {
    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 {
    background: linear-gradient(135deg, #06b6d4, #2563eb);
    color: white;
    box-shadow: 0 16px 36px rgba(6, 182, 212, 0.28);
}

.secondary-button {
    margin-left: 12px;
    color: var(--soft);
    background: rgba(15, 23, 42, 0.72);
    border: 1px solid var(--line);
}

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

.small-button {
    min-height: 40px;
    padding: 0 16px;
    border-radius: 12px;
}

.hero-poster {
    position: relative;
    display: block;
    border-radius: 28px;
    overflow: hidden;
    box-shadow: var(--shadow), 0 28px 80px rgba(2, 6, 23, 0.58);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transform: perspective(900px) rotateY(-8deg);
}

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

.hero-poster span,
.card-play {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 66px;
    height: 66px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    color: white;
    background: rgba(6, 182, 212, 0.9);
    box-shadow: 0 18px 50px rgba(6, 182, 212, 0.32);
}

.hero-arrow {
    position: absolute;
    z-index: 4;
    top: 50%;
    width: 50px;
    height: 50px;
    border-radius: 999px;
    color: white;
    background: rgba(15, 23, 42, 0.62);
    border: 1px solid rgba(255, 255, 255, 0.14);
    font-size: 2.2rem;
    line-height: 1;
    backdrop-filter: blur(12px);
}

.hero-arrow-left {
    left: 22px;
}

.hero-arrow-right {
    right: 22px;
}

.hero-dots {
    position: absolute;
    z-index: 4;
    left: 50%;
    bottom: 32px;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
}

.hero-dot {
    width: 18px;
    height: 5px;
    border-radius: 999px;
    background: #475569;
    transition: width 0.2s ease, background 0.2s ease;
}

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

.section-shell,
.home-search-section,
.detail-shell,
.footer-grid,
.footer-bottom {
    width: min(1200px, calc(100% - 32px));
    margin: 0 auto;
}

.section-shell,
.home-search-section {
    padding: 66px 0;
}

.section-heading {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 28px;
}

.section-heading > span {
    width: 5px;
    height: 36px;
    border-radius: 999px;
    background: linear-gradient(180deg, var(--cyan), var(--blue));
    flex: 0 0 auto;
    margin-top: 4px;
}

.section-heading h2 {
    margin: 0;
    color: white;
    font-size: clamp(1.5rem, 2.5vw, 2.25rem);
    font-weight: 850;
    letter-spacing: -0.03em;
}

.section-heading p {
    margin: 6px 0 0;
    color: var(--muted);
}

.compact-heading {
    margin-bottom: 18px;
}

.filter-panel {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) 170px 150px 170px;
    gap: 12px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: rgba(15, 23, 42, 0.72);
    box-shadow: 0 18px 60px rgba(2, 6, 23, 0.22);
}

.search-box {
    display: flex;
    align-items: center;
    gap: 10px;
}

.search-box span {
    color: var(--cyan);
    font-weight: 800;
}

.filter-panel input,
.filter-panel select {
    width: 100%;
    height: 46px;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(2, 6, 23, 0.58);
    color: var(--text);
    padding: 0 14px;
    outline: none;
}

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

.category-pill,
.category-card,
.content-card {
    display: block;
    border-radius: 22px;
    border: 1px solid var(--line);
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.78), rgba(30, 41, 59, 0.5));
    box-shadow: 0 18px 60px rgba(2, 6, 23, 0.22);
}

.category-pill {
    min-height: 132px;
    padding: 20px;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.category-pill:hover,
.category-card:hover,
.movie-card:hover {
    transform: translateY(-4px);
    border-color: rgba(34, 211, 238, 0.32);
    box-shadow: var(--shadow);
}

.category-pill span {
    display: block;
    color: white;
    font-size: 1.2rem;
    font-weight: 850;
}

.category-pill small {
    display: block;
    margin-top: 10px;
    color: var(--muted);
    line-height: 1.7;
}

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

.listing-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    margin-top: 24px;
}

.movie-rail {
    display: flex;
    gap: 18px;
    overflow-x: auto;
    padding: 6px 4px 22px;
    scroll-snap-type: x mandatory;
}

.rail-item {
    width: 230px;
    min-width: 230px;
    scroll-snap-align: start;
}

.movie-card {
    position: relative;
    overflow: hidden;
    border-radius: 20px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: rgba(15, 23, 42, 0.78);
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.poster-link {
    position: relative;
    display: block;
    overflow: hidden;
    background: #0f172a;
}

.poster-link img {
    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    transition: transform 0.45s ease, opacity 0.2s ease;
}

.movie-card:hover .poster-link img {
    transform: scale(1.08);
    opacity: 0.86;
}

.card-play {
    width: 48px;
    height: 48px;
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.movie-card:hover .card-play {
    opacity: 1;
}

.rating-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0 8px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.82);
    color: var(--amber);
    font-size: 0.78rem;
    font-weight: 850;
    backdrop-filter: blur(8px);
}

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

.movie-card h2 {
    margin: 0;
    font-size: 1rem;
    line-height: 1.35;
    font-weight: 850;
}

.movie-card h2 a {
    color: white;
}

.movie-card h2 a:hover {
    color: var(--cyan);
}

.card-line {
    margin: 8px 0 0;
    min-height: 42px;
    color: var(--muted);
    font-size: 0.86rem;
    line-height: 1.6;
}

.movie-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    margin-top: 12px;
    color: #94a3b8;
    font-size: 0.78rem;
}

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

.tag-row span {
    min-height: 24px;
    padding: 3px 8px;
    font-size: 0.72rem;
}

.glass-section {
    width: min(1240px, calc(100% - 24px));
    padding: 56px 20px;
    border-radius: 32px;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.58), rgba(30, 41, 59, 0.42));
    border: 1px solid var(--line);
}

.split-section {
    display: grid;
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
    gap: 36px;
}

.rank-list,
.compact-list,
.ranking-table {
    display: grid;
    gap: 12px;
}

.rank-item,
.ranking-row {
    display: grid;
    align-items: center;
    grid-template-columns: 46px 58px minmax(0, 1fr) auto;
    gap: 12px;
    min-height: 74px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.72);
    color: var(--soft);
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.rank-item:hover,
.ranking-row:hover {
    transform: translateX(4px);
    border-color: rgba(34, 211, 238, 0.32);
}

.rank-item strong,
.ranking-row strong {
    color: var(--cyan);
    font-size: 1.2rem;
}

.rank-item img,
.ranking-row img {
    width: 58px;
    height: 58px;
    border-radius: 14px;
    object-fit: cover;
}

.rank-item span,
.ranking-title {
    min-width: 0;
    color: white;
    font-weight: 800;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rank-item em,
.ranking-row em {
    color: var(--amber);
    font-style: normal;
    font-weight: 850;
}

.text-link {
    margin-top: 16px;
    color: var(--cyan);
    background: rgba(8, 145, 178, 0.12);
    border: 1px solid rgba(34, 211, 238, 0.22);
}

.movie-card-compact {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
}

.movie-card-compact .poster-link img {
    height: 138px;
    aspect-ratio: auto;
}

.movie-card-compact .tag-row {
    display: none;
}

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

.slim-hero {
    min-height: 330px;
    display: flex;
    align-items: center;
    background:
        radial-gradient(circle at 15% 20%, rgba(34, 211, 238, 0.2), transparent 32rem),
        linear-gradient(135deg, rgba(15, 23, 42, 0.94), rgba(2, 6, 23, 0.98));
    border-bottom: 1px solid var(--line);
}

.slim-hero > div {
    width: min(1200px, calc(100% - 32px));
    margin: 0 auto;
    padding: 70px 0;
}

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

.category-card {
    overflow: hidden;
    padding: 18px;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

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

.category-posters img {
    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    border-radius: 12px;
}

.category-card h2 {
    margin: 0;
    color: white;
    font-size: 1.3rem;
    font-weight: 850;
}

.category-card p {
    color: var(--muted);
    line-height: 1.75;
}

.ranking-row {
    grid-template-columns: 62px 72px minmax(0, 1fr) 120px 120px 90px;
}

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

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

.detail-shell {
    position: relative;
    z-index: 2;
    padding: 38px 0 70px;
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    color: var(--muted);
    margin-bottom: 34px;
}

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

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

.breadcrumb strong {
    color: white;
}

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

.detail-poster {
    border-radius: 26px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: var(--shadow), 0 32px 90px rgba(2, 6, 23, 0.52);
}

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

.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 22px;
}

.detail-meta span {
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    padding: 0 12px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.72);
    border: 1px solid var(--line);
    color: var(--soft);
    font-weight: 650;
}

.video-shell {
    position: relative;
    overflow: hidden;
    border-radius: 28px;
    background: #000;
    border: 1px solid rgba(148, 163, 184, 0.18);
    box-shadow: 0 28px 90px rgba(2, 6, 23, 0.5);
}

.video-element {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: black;
}

.player-overlay {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
    justify-content: center;
    color: white;
    background: radial-gradient(circle at center, rgba(8, 145, 178, 0.18), rgba(2, 6, 23, 0.72));
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.player-overlay span {
    width: 82px;
    height: 82px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--cyan), var(--blue));
    box-shadow: 0 20px 50px rgba(6, 182, 212, 0.36);
    font-size: 2rem;
}

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

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

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

.content-card {
    padding: 28px;
}

.content-card h2 {
    margin: 0 0 14px;
    color: white;
    font-size: 1.45rem;
    font-weight: 850;
}

.content-card p {
    margin: 0;
    color: var(--soft);
    line-height: 1.9;
}

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

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

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

.footer-grid {
    display: grid;
    grid-template-columns: 1.3fr 0.8fr 0.8fr;
    gap: 42px;
    padding: 54px 0 34px;
}

.footer-brand {
    font-size: 1.15rem;
}

.site-footer p {
    color: var(--muted);
    line-height: 1.8;
    margin: 14px 0 0;
}

.site-footer h2 {
    margin: 0 0 16px;
    color: white;
    font-size: 1.08rem;
    font-weight: 850;
}

.footer-links {
    display: grid;
    gap: 9px;
}

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

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

.footer-bottom {
    padding: 22px 0 34px;
    color: var(--muted);
    border-top: 1px solid var(--line);
}

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

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

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

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

    .hero-content,
    .detail-layout,
    .split-section,
    .detail-content,
    .footer-grid {
        grid-template-columns: 1fr;
    }

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

    .hero-poster {
        max-width: 260px;
        transform: none;
    }

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

    .ranking-row {
        grid-template-columns: 50px 62px minmax(0, 1fr);
    }

    .ranking-row span:not(.ranking-title),
    .ranking-row em {
        display: none;
    }
}

@media (max-width: 640px) {
    .nav-shell,
    .section-shell,
    .home-search-section,
    .detail-shell,
    .footer-grid,
    .footer-bottom,
    .slim-hero > div {
        width: min(100% - 24px, 1200px);
    }

    .brand-name {
        max-width: 220px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .hero-copy h1,
    .page-hero h1,
    .detail-intro h1 {
        font-size: clamp(2.1rem, 13vw, 3.6rem);
    }

    .hero-content {
        gap: 28px;
        padding-top: 54px;
    }

    .hero-arrow {
        display: none;
    }

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

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

    .card-line {
        display: none;
    }

    .secondary-button {
        margin: 12px 0 0;
    }

    .primary-button,
    .secondary-button {
        width: 100%;
    }

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