:root {
    color-scheme: dark;
    --page-bg: #020617;
    --panel-bg: rgba(15, 23, 42, 0.72);
    --panel-strong: rgba(15, 23, 42, 0.92);
    --card-bg: rgba(30, 41, 59, 0.68);
    --line-soft: rgba(245, 158, 11, 0.16);
    --line-strong: rgba(245, 158, 11, 0.36);
    --text-main: #f8fafc;
    --text-soft: #cbd5e1;
    --text-muted: #94a3b8;
    --amber: #f59e0b;
    --amber-dark: #d97706;
    --amber-soft: rgba(245, 158, 11, 0.14);
    --shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
    --radius: 18px;
    --radius-lg: 28px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at 10% 0%, rgba(245, 158, 11, 0.14), transparent 26rem),
        radial-gradient(circle at 90% 10%, rgba(251, 146, 60, 0.08), transparent 24rem),
        linear-gradient(180deg, #020617 0%, #0f172a 48%, #020617 100%);
    color: var(--text-main);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    line-height: 1.6;
}

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

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

button,
input,
select {
    font: inherit;
}

.container {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
}

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

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

.site-logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: max-content;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.logo-mark {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    color: #111827;
    background: linear-gradient(135deg, #fbbf24, #f97316);
    box-shadow: 0 12px 36px rgba(245, 158, 11, 0.26);
}

.logo-text {
    font-size: 18px;
}

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

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

.nav-link:hover,
.nav-link.is-active {
    color: var(--amber);
    background: var(--amber-soft);
}

.header-search {
    display: flex;
    align-items: center;
    gap: 8px;
    width: min(320px, 28vw);
}

.header-search input,
.filter-bar input,
.filter-bar select {
    width: 100%;
    min-height: 42px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 13px;
    background: rgba(15, 23, 42, 0.78);
    color: var(--text-main);
    outline: none;
    padding: 0 14px;
    transition: 0.2s ease;
}

.header-search input:focus,
.filter-bar input:focus,
.filter-bar select:focus {
    border-color: var(--line-strong);
    box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.1);
}

.header-search button,
.btn-primary,
.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    border: 0;
    border-radius: 13px;
    cursor: pointer;
    transition: 0.22s ease;
    white-space: nowrap;
}

.header-search button,
.btn-primary {
    padding: 0 18px;
    color: #111827;
    font-weight: 800;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    box-shadow: 0 15px 35px rgba(245, 158, 11, 0.22);
}

.header-search button:hover,
.btn-primary:hover {
    transform: translateY(-1px);
    background: linear-gradient(135deg, #fcd34d, #f97316);
    box-shadow: 0 20px 42px rgba(245, 158, 11, 0.28);
}

.btn-secondary {
    padding: 0 18px;
    color: var(--text-main);
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(15, 23, 42, 0.58);
}

.btn-secondary:hover {
    border-color: var(--line-strong);
    background: rgba(245, 158, 11, 0.12);
}

.nav-toggle {
    display: none;
    width: 42px;
    height: 42px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 13px;
    background: rgba(15, 23, 42, 0.74);
    cursor: pointer;
}

.nav-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    margin: 4px auto;
    border-radius: 99px;
    background: var(--text-main);
}

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

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

.hero-slide {
    opacity: 0;
    background-position: center;
    background-size: cover;
    transition: opacity 0.7s ease, transform 1.2s ease;
    transform: scale(1.03);
    pointer-events: none;
}

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

.hero-shade {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(2, 6, 23, 0.92), rgba(2, 6, 23, 0.45), rgba(2, 6, 23, 0.84)),
        linear-gradient(0deg, #020617 0%, rgba(2, 6, 23, 0.25) 38%, rgba(2, 6, 23, 0.12) 100%);
}

.hero-content {
    position: relative;
    z-index: 2;
    min-height: clamp(560px, 72vh, 780px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    max-width: 760px;
}

.hero-pill {
    display: inline-flex;
    align-items: center;
    width: max-content;
    min-height: 34px;
    padding: 0 14px;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    color: var(--amber);
    background: rgba(245, 158, 11, 0.16);
    backdrop-filter: blur(10px);
    font-weight: 700;
    font-size: 14px;
}

.hero-content h1,
.hero-content h2 {
    margin: 22px 0 18px;
    max-width: 720px;
    font-size: clamp(38px, 7vw, 78px);
    line-height: 1.04;
    letter-spacing: -0.05em;
    text-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

.hero-content p {
    max-width: 660px;
    margin: 0 0 32px;
    color: #dbeafe;
    font-size: clamp(16px, 2vw, 20px);
    line-height: 1.75;
}

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

.hero-arrow {
    position: absolute;
    top: 50%;
    z-index: 5;
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 50%;
    color: var(--text-main);
    background: rgba(0, 0, 0, 0.42);
    cursor: pointer;
    transform: translateY(-50%);
    transition: 0.22s ease;
    font-size: 32px;
    line-height: 1;
}

.hero-arrow:hover {
    background: rgba(245, 158, 11, 0.26);
    border-color: var(--line-strong);
}

.hero-prev {
    left: 24px;
}

.hero-next {
    right: 24px;
}

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

.hero-dot {
    width: 9px;
    height: 9px;
    border: 0;
    border-radius: 99px;
    background: rgba(255, 255, 255, 0.48);
    cursor: pointer;
    transition: 0.22s ease;
}

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

.home-stack,
.page-stack {
    padding: 56px 0 72px;
    display: grid;
    gap: 60px;
}

.search-panel,
.page-hero-card,
.featured-panel,
.detail-card,
.player-card,
.related-panel {
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-lg);
    background: var(--panel-bg);
    box-shadow: var(--shadow);
}

.search-panel {
    display: grid;
    grid-template-columns: 0.9fr 1.5fr;
    gap: 28px;
    align-items: center;
    padding: 28px;
}

.search-panel h2,
.page-hero-card h1,
.section-heading h2,
.featured-info h2,
.detail-card h1,
.related-panel h2 {
    margin: 0;
    line-height: 1.2;
}

.search-panel p,
.page-hero-card p,
.section-heading p,
.movie-card p,
.featured-info p,
.detail-card p,
.site-footer p,
.category-overview-card p,
.category-tile p {
    color: var(--text-muted);
}

.filter-bar {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) 170px 160px;
    gap: 12px;
}

.empty-state {
    margin-top: 18px;
    padding: 18px;
    border: 1px dashed rgba(148, 163, 184, 0.3);
    border-radius: var(--radius);
    color: var(--text-muted);
    text-align: center;
}

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

.section-heading h2 {
    font-size: clamp(24px, 3vw, 34px);
}

.section-heading p {
    margin: 8px 0 0;
}

.section-more {
    color: var(--amber);
    font-weight: 800;
    white-space: nowrap;
}

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

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

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

.movie-card {
    position: relative;
    display: block;
    overflow: hidden;
    border: 1px solid rgba(245, 158, 11, 0.12);
    border-radius: var(--radius);
    background: var(--card-bg);
    transition: transform 0.24s ease, border-color 0.24s ease, box-shadow 0.24s ease, background 0.24s ease;
}

.movie-card:hover {
    transform: translateY(-6px);
    border-color: var(--line-strong);
    background: rgba(30, 41, 59, 0.92);
    box-shadow: 0 22px 48px rgba(0, 0, 0, 0.34), 0 0 0 1px rgba(245, 158, 11, 0.08);
}

.poster-frame {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 10;
    background: #0f172a;
}

.poster-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.01);
    transition: transform 0.38s ease, opacity 0.38s ease;
}

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

.poster-frame::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 30%, rgba(0, 0, 0, 0.76));
}

.play-float {
    position: absolute;
    z-index: 2;
    left: 50%;
    top: 50%;
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: #111827;
    background: var(--amber);
    transform: translate(-50%, -50%) scale(0.78);
    opacity: 0;
    transition: 0.24s ease;
}

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

.rank-badge {
    position: absolute;
    z-index: 3;
    top: 12px;
    left: 12px;
    min-width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    color: #111827;
    background: linear-gradient(135deg, #fbbf24, #f97316);
    font-weight: 900;
}

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

.movie-meta-line {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
    color: var(--text-muted);
    font-size: 12px;
}

.movie-card h3 {
    margin: 0 0 10px;
    color: var(--text-main);
    font-size: 18px;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.22s ease;
}

.movie-card:hover h3 {
    color: var(--amber);
}

.movie-card p {
    min-height: 48px;
    margin: 0 0 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 14px;
}

.movie-card-slim {
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    min-height: 142px;
}

.movie-card-slim .poster-frame {
    aspect-ratio: auto;
    height: 100%;
}

.movie-card-slim h3 {
    font-size: 16px;
}

.movie-card-slim p {
    min-height: 42px;
    font-size: 13px;
}

.tag-row,
.detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-row span,
.detail-tags span {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0 9px;
    border-radius: 999px;
    color: #fcd34d;
    background: rgba(245, 158, 11, 0.12);
    font-size: 12px;
}

.featured-panel {
    padding: 28px;
    background:
        radial-gradient(circle at 82% 12%, rgba(245, 158, 11, 0.18), transparent 20rem),
        linear-gradient(135deg, rgba(245, 158, 11, 0.08), rgba(30, 41, 59, 0.7));
}

.featured-card {
    display: grid;
    grid-template-columns: 0.86fr 1.14fr;
    gap: 28px;
    align-items: center;
}

.featured-poster {
    overflow: hidden;
    border-radius: 24px;
    aspect-ratio: 16 / 10;
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.38);
}

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

.featured-info h2 {
    margin-top: 16px;
    font-size: clamp(28px, 4vw, 48px);
}

.featured-info p {
    margin: 18px 0;
}

.featured-info .btn-primary {
    margin-top: 24px;
}

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

.category-tile,
.category-overview-card {
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
    background: var(--panel-bg);
    transition: 0.22s ease;
}

.category-tile {
    padding: 22px;
}

.category-tile span,
.category-overview-card h2 {
    color: var(--text-main);
    font-weight: 900;
}

.category-tile p {
    margin: 8px 0 0;
    font-size: 14px;
}

.category-tile:hover,
.category-overview-card:hover {
    transform: translateY(-4px);
    border-color: var(--line-strong);
    background: rgba(30, 41, 59, 0.9);
}

.page-hero-card {
    padding: clamp(28px, 5vw, 48px);
}

.page-hero-card h1 {
    margin-top: 18px;
    font-size: clamp(34px, 5vw, 56px);
    letter-spacing: -0.04em;
}

.page-hero-card p {
    max-width: 760px;
    margin: 16px 0 0;
    font-size: 17px;
}

.page-hero-card .filter-bar {
    margin-top: 26px;
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 18px;
    color: var(--text-muted);
    font-size: 14px;
}

.breadcrumb a {
    color: #fcd34d;
}

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

.category-overview-card {
    display: grid;
    grid-template-columns: 210px minmax(0, 1fr);
    gap: 22px;
    overflow: hidden;
    padding: 18px;
}

.category-collage {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    min-height: 130px;
}

.category-collage img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
}

.category-overview-card p {
    margin: 10px 0 14px;
}

.category-overview-card span {
    color: var(--amber);
    font-weight: 800;
}

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

.ranking-row {
    display: grid;
    grid-template-columns: 52px 84px 1fr auto 82px;
    gap: 16px;
    align-items: center;
    padding: 12px;
    border: 1px solid rgba(245, 158, 11, 0.12);
    border-radius: 16px;
    background: rgba(15, 23, 42, 0.68);
    transition: 0.22s ease;
}

.ranking-row:hover {
    border-color: var(--line-strong);
    background: rgba(30, 41, 59, 0.9);
}

.ranking-number {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    color: #111827;
    background: var(--amber);
    font-weight: 900;
}

.ranking-row img {
    width: 84px;
    height: 54px;
    object-fit: cover;
    border-radius: 12px;
}

.ranking-title {
    font-weight: 800;
}

.ranking-meta {
    color: var(--text-muted);
    font-size: 14px;
}

.ranking-go {
    color: var(--amber);
    font-weight: 800;
    text-align: right;
}

.detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 28px;
    padding: 34px 0 76px;
}

.detail-main {
    display: grid;
    gap: 22px;
}

.player-card {
    overflow: hidden;
    padding: 14px;
}

.video-shell {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    border-radius: 20px;
    background: #000;
}

.video-shell video {
    width: 100%;
    height: 100%;
    display: block;
    background: #000;
    cursor: pointer;
}

.video-cover {
    position: absolute;
    inset: 0;
    border: 0;
    background-position: center;
    background-size: cover;
    cursor: pointer;
    transition: opacity 0.22s ease, visibility 0.22s ease;
}

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

.video-cover-shade {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.78));
}

.play-button-large {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 82px;
    height: 82px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: #111827;
    background: var(--amber);
    box-shadow: 0 22px 60px rgba(245, 158, 11, 0.36);
    transform: translate(-50%, -50%);
    font-size: 30px;
}

.detail-card {
    padding: clamp(24px, 4vw, 36px);
}

.detail-topline {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-bottom: 18px;
    color: var(--text-muted);
}

.detail-card h1 {
    font-size: clamp(30px, 5vw, 52px);
    letter-spacing: -0.04em;
}

.lead-text {
    margin: 18px 0 18px;
    color: var(--text-soft) !important;
    font-size: 18px;
}

.detail-tags {
    margin: 18px 0 30px;
}

.detail-card section {
    margin-top: 30px;
    padding-top: 28px;
    border-top: 1px solid rgba(148, 163, 184, 0.18);
}

.detail-card h2 {
    margin: 0 0 12px;
    font-size: 24px;
}

.detail-card section p {
    margin: 0;
    color: var(--text-soft);
    font-size: 16px;
}

.related-panel {
    position: sticky;
    top: 96px;
    align-self: start;
    padding: 20px;
}

.related-panel h2 {
    margin-bottom: 16px;
    font-size: 24px;
}

.related-list {
    display: grid;
    gap: 14px;
}

.site-footer {
    border-top: 1px solid rgba(245, 158, 11, 0.14);
    background: rgba(2, 6, 23, 0.78);
    padding: 34px 0;
}

.footer-grid {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
}

.footer-grid strong {
    font-size: 18px;
}

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

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    color: var(--text-soft);
}

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

[data-card][hidden] {
    display: none !important;
}

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

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

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

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

    .related-panel {
        position: static;
    }
}

@media (max-width: 880px) {
    .header-inner {
        flex-wrap: wrap;
        padding: 14px 0;
    }

    .nav-toggle {
        display: block;
        margin-left: auto;
    }

    .site-nav {
        order: 3;
        width: 100%;
        display: none;
        align-items: stretch;
        flex-direction: column;
        padding: 10px;
        border: 1px solid rgba(245, 158, 11, 0.14);
        border-radius: 18px;
        background: rgba(15, 23, 42, 0.96);
    }

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

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

    .header-search {
        order: 4;
        width: 100%;
    }

    .hero-arrow {
        display: none;
    }

    .search-panel,
    .featured-card,
    .category-overview-card {
        grid-template-columns: 1fr;
    }

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

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

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

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

    .ranking-meta,
    .ranking-go {
        display: none;
    }
}

@media (max-width: 580px) {
    .container,
    .header-inner {
        width: min(100% - 22px, 1180px);
    }

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

    .hero-content h1,
    .hero-content h2 {
        font-size: 38px;
    }

    .hero-content p {
        font-size: 15px;
    }

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

    .movie-card-slim {
        grid-template-columns: 104px minmax(0, 1fr);
    }

    .section-heading,
    .footer-grid {
        align-items: flex-start;
        flex-direction: column;
    }

    .search-panel,
    .featured-panel,
    .page-hero-card,
    .detail-card,
    .related-panel {
        border-radius: 20px;
    }
}
