:root {
    color-scheme: dark;
    --bg: #020617;
    --bg-soft: #0f172a;
    --panel: rgba(15, 23, 42, 0.88);
    --panel-strong: rgba(15, 23, 42, 0.96);
    --line: rgba(148, 163, 184, 0.2);
    --text: #f8fafc;
    --muted: #94a3b8;
    --muted-strong: #cbd5e1;
    --emerald: #34d399;
    --emerald-dark: #10b981;
    --cyan: #22d3ee;
    --rose: #fb7185;
    --amber: #fbbf24;
    --shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
    --radius: 22px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

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

body.menu-open {
    overflow: hidden;
}

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

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

button,
input,
select {
    font: inherit;
}

button {
    cursor: pointer;
}

.container {
    width: min(100% - 2rem, 1280px);
    margin: 0 auto;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(15, 23, 42, 0.92);
    border-bottom: 1px solid rgba(148, 163, 184, 0.14);
    box-shadow: 0 16px 40px rgba(2, 6, 23, 0.36);
    backdrop-filter: blur(18px);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 4rem;
    gap: 1.25rem;
}

.brand,
.footer-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    font-weight: 800;
    white-space: nowrap;
}

.brand-mark {
    display: grid;
    width: 2.2rem;
    height: 2.2rem;
    place-items: center;
    color: #03201a;
    background: linear-gradient(135deg, var(--emerald), var(--cyan));
    border-radius: 0.8rem;
    box-shadow: 0 0 28px rgba(52, 211, 153, 0.3);
}

.brand-text {
    max-width: 17rem;
    overflow: hidden;
    font-size: 1.35rem;
    text-overflow: ellipsis;
    background: linear-gradient(90deg, var(--emerald), var(--cyan));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.desktop-nav {
    display: flex;
    align-items: center;
    gap: 1.7rem;
}

.nav-link,
.nav-button {
    color: var(--muted-strong);
    font-weight: 700;
    transition: color 0.2s ease, transform 0.2s ease;
}

.nav-link:hover,
.nav-link.is-active,
.nav-button:hover {
    color: var(--emerald);
}

.nav-dropdown {
    position: relative;
}

.dropdown-panel {
    position: absolute;
    top: 2.2rem;
    left: 0;
    display: grid;
    width: 13.5rem;
    gap: 0.35rem;
    padding: 0.75rem;
    background: rgba(15, 23, 42, 0.98);
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 1rem;
    box-shadow: var(--shadow);
    opacity: 0;
    visibility: hidden;
    transform: translateY(0.5rem);
    transition: all 0.2s ease;
}

.nav-dropdown:hover .dropdown-panel {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-panel a {
    padding: 0.65rem 0.8rem;
    color: var(--muted-strong);
    border-radius: 0.7rem;
}

.dropdown-panel a:hover {
    color: var(--text);
    background: rgba(51, 65, 85, 0.9);
}

.header-search,
.mobile-search {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.header-search input,
.mobile-search input,
.filter-bar input,
.filter-bar select,
.search-hero input {
    border: 1px solid rgba(148, 163, 184, 0.18);
    color: var(--text);
    background: rgba(30, 41, 59, 0.86);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.header-search input {
    width: 14rem;
    padding: 0.65rem 1rem;
    border-radius: 999px;
}

.header-search button,
.mobile-search button,
.search-hero button {
    border: 0;
    color: #052e24;
    background: linear-gradient(135deg, var(--emerald), var(--cyan));
    border-radius: 999px;
    font-weight: 800;
    padding: 0.65rem 1rem;
}

.header-search input:focus,
.mobile-search input:focus,
.filter-bar input:focus,
.filter-bar select:focus,
.search-hero input:focus {
    border-color: rgba(52, 211, 153, 0.8);
    box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.12);
}

.menu-toggle {
    display: none;
    width: 2.6rem;
    height: 2.6rem;
    border: 1px solid rgba(148, 163, 184, 0.2);
    background: rgba(30, 41, 59, 0.9);
    border-radius: 0.8rem;
}

.menu-toggle span {
    display: block;
    width: 1.1rem;
    height: 2px;
    margin: 0.28rem auto;
    background: var(--text);
    border-radius: 999px;
}

.mobile-panel {
    display: none;
    padding: 0 1rem 1rem;
    border-top: 1px solid rgba(148, 163, 184, 0.12);
}

.mobile-search {
    margin: 1rem 0;
}

.mobile-search input {
    min-width: 0;
    flex: 1;
    padding: 0.75rem 1rem;
    border-radius: 999px;
}

.mobile-nav {
    display: grid;
    gap: 0.4rem;
}

.mobile-nav-link {
    padding: 0.8rem 1rem;
    color: var(--muted-strong);
    background: rgba(30, 41, 59, 0.58);
    border-radius: 0.8rem;
}

.mobile-nav-link.is-active {
    color: var(--emerald);
}

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

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

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

.hero-bg,
.hero-bg::after {
    position: absolute;
    inset: 0;
}

.hero-bg::after {
    content: "";
    background:
        linear-gradient(90deg, #020617 0%, rgba(2, 6, 23, 0.94) 25%, rgba(2, 6, 23, 0.5) 62%, rgba(2, 6, 23, 0.82) 100%),
        linear-gradient(0deg, #020617 0%, transparent 35%);
}

.hero-content {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    min-height: 600px;
    padding: 5.5rem 0 7rem;
}

.hero-panel {
    width: min(100%, 44rem);
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    margin-bottom: 1rem;
    color: var(--emerald);
    font-weight: 800;
}

.eyebrow::before {
    content: "";
    width: 0.55rem;
    height: 0.55rem;
    background: var(--emerald);
    border-radius: 999px;
    box-shadow: 0 0 18px var(--emerald);
}

.hero h1,
.page-hero h1,
.detail-title h1,
.search-hero h1 {
    margin: 0;
    color: var(--text);
    font-weight: 900;
    line-height: 1.05;
    letter-spacing: -0.045em;
}

.hero h1 {
    font-size: clamp(2.8rem, 7vw, 5.8rem);
}

.hero p {
    max-width: 42rem;
    margin: 1.25rem 0 0;
    color: #cbd5e1;
    font-size: clamp(1.05rem, 2vw, 1.3rem);
    line-height: 1.8;
}

.hero-actions,
.section-actions,
.detail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
    margin-top: 2rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 3rem;
    padding: 0.85rem 1.35rem;
    border-radius: 999px;
    font-weight: 900;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn:hover {
    transform: translateY(-2px) scale(1.01);
}

.btn-primary {
    color: #052e24;
    background: linear-gradient(135deg, var(--emerald), var(--cyan));
    box-shadow: 0 16px 40px rgba(16, 185, 129, 0.28);
}

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

.hero-thumbs {
    position: absolute;
    right: max(1rem, calc((100vw - 1280px) / 2));
    bottom: 2rem;
    z-index: 4;
    display: flex;
    gap: 0.75rem;
}

.hero-thumb {
    width: 5.6rem;
    height: 4.2rem;
    padding: 0;
    overflow: hidden;
    border: 2px solid rgba(148, 163, 184, 0.25);
    background: rgba(15, 23, 42, 0.78);
    border-radius: 1rem;
    opacity: 0.78;
    transition: all 0.2s ease;
}

.hero-thumb.is-active,
.hero-thumb:hover {
    border-color: var(--emerald);
    opacity: 1;
    transform: translateY(-2px);
}

.main-section {
    padding: 4.5rem 0;
}

.section-header,
.page-hero {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.section-header h2,
.page-hero h1,
.search-hero h1 {
    margin: 0;
    font-size: clamp(2rem, 4vw, 3rem);
}

.section-header p,
.page-hero p,
.search-hero p {
    max-width: 48rem;
    margin: 0.85rem 0 0;
    color: var(--muted);
    line-height: 1.75;
}

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

.movie-card {
    overflow: hidden;
    background: var(--panel);
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: var(--radius);
    box-shadow: 0 18px 50px rgba(2, 6, 23, 0.26);
    transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.movie-card:hover {
    border-color: rgba(52, 211, 153, 0.48);
    box-shadow: 0 24px 70px rgba(16, 185, 129, 0.12);
    transform: translateY(-6px);
}

.poster-link {
    position: relative;
    display: block;
    aspect-ratio: 2 / 3;
    overflow: hidden;
    background: linear-gradient(145deg, rgba(15, 23, 42, 0.95), rgba(30, 41, 59, 0.7));
}

.poster-link::after {
    position: absolute;
    inset: auto 0 0 0;
    height: 55%;
    content: "";
    background: linear-gradient(0deg, rgba(2, 6, 23, 0.92), transparent);
}

.play-chip,
.rank-badge {
    position: absolute;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    font-weight: 900;
}

.play-chip {
    right: 0.85rem;
    bottom: 0.85rem;
    padding: 0.4rem 0.75rem;
    color: #052e24;
    background: linear-gradient(135deg, var(--emerald), var(--cyan));
}

.rank-badge {
    left: 0.85rem;
    top: 0.85rem;
    min-width: 2.15rem;
    height: 2.15rem;
    color: #111827;
    background: linear-gradient(135deg, var(--amber), #fb7185);
    box-shadow: 0 8px 24px rgba(251, 191, 36, 0.28);
}

.movie-card-body {
    padding: 1rem;
}

.movie-meta-row,
.detail-meta,
.breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    color: var(--muted);
    font-size: 0.9rem;
}

.movie-card h3 {
    margin: 0.55rem 0 0.45rem;
    font-size: 1.05rem;
    line-height: 1.35;
}

.movie-card h3 a:hover,
.text-link:hover,
.breadcrumbs a:hover {
    color: var(--emerald);
}

.movie-card p {
    display: -webkit-box;
    min-height: 3.2rem;
    margin: 0;
    overflow: hidden;
    color: var(--muted);
    line-height: 1.6;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.85rem;
}

.tag-row span,
.detail-tags span {
    display: inline-flex;
    padding: 0.28rem 0.58rem;
    color: #a7f3d0;
    background: rgba(16, 185, 129, 0.11);
    border: 1px solid rgba(52, 211, 153, 0.2);
    border-radius: 999px;
    font-size: 0.8rem;
}

.text-link {
    display: inline-flex;
    margin-top: 0.9rem;
    color: var(--emerald);
    font-weight: 900;
}

.category-band {
    padding: 4rem 0;
    background: linear-gradient(90deg, rgba(15, 23, 42, 0.9), rgba(2, 6, 23, 0.95));
    border-top: 1px solid rgba(148, 163, 184, 0.12);
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

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

.category-card {
    position: relative;
    min-height: 10rem;
    overflow: hidden;
    padding: 1.25rem;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.9), rgba(34, 211, 238, 0.82));
    border-radius: 1.35rem;
    box-shadow: var(--shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.category-card:nth-child(2n) {
    background: linear-gradient(135deg, rgba(244, 63, 94, 0.88), rgba(168, 85, 247, 0.82));
}

.category-card:nth-child(3n) {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.9), rgba(34, 211, 238, 0.78));
}

.category-card:nth-child(4n) {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.9), rgba(249, 115, 22, 0.82));
}

.category-card:hover {
    transform: translateY(-4px) scale(1.01);
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.38);
}

.category-card h3 {
    position: relative;
    z-index: 2;
    margin: 0 0 0.7rem;
    font-size: 1.45rem;
}

.category-card p {
    position: relative;
    z-index: 2;
    margin: 0;
    color: rgba(255, 255, 255, 0.86);
    line-height: 1.65;
}

.category-card::after {
    position: absolute;
    right: -2rem;
    bottom: -2rem;
    width: 7rem;
    height: 7rem;
    content: "";
    background: rgba(255, 255, 255, 0.18);
    border-radius: 999px;
}

.filter-bar {
    display: grid;
    grid-template-columns: 1fr 12rem 12rem;
    gap: 0.75rem;
    margin: 2rem 0;
}

.filter-bar input,
.filter-bar select {
    min-height: 3rem;
    padding: 0.75rem 1rem;
    border-radius: 1rem;
}

.search-hero {
    padding: 4.5rem 0 2rem;
}

.search-box {
    display: flex;
    width: min(100%, 46rem);
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.search-hero input {
    flex: 1;
    min-width: 0;
    padding: 0.95rem 1.15rem;
    border-radius: 999px;
}

.search-hero button {
    padding: 0.95rem 1.35rem;
}

.mini-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 0.85rem;
}

.mini-card {
    display: grid;
    gap: 0.5rem;
    padding: 0.65rem;
    background: rgba(15, 23, 42, 0.72);
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 1rem;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.mini-card:hover {
    border-color: rgba(52, 211, 153, 0.4);
    transform: translateY(-3px);
}

.mini-card img {
    aspect-ratio: 16 / 10;
    border-radius: 0.75rem;
}

.mini-card span {
    font-weight: 800;
}

.mini-card small {
    color: var(--muted);
}

.detail-hero {
    padding: 2rem 0 4rem;
}

.breadcrumbs {
    margin: 1.5rem 0;
}

.detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 22rem;
    gap: 2rem;
    align-items: start;
}

.detail-title {
    margin-bottom: 1.5rem;
}

.detail-title h1 {
    font-size: clamp(2.2rem, 5vw, 4.5rem);
}

.detail-meta {
    margin-top: 1rem;
}

.player-shell {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    background: #000;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 1.35rem;
    box-shadow: var(--shadow);
}

.player-shell video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background: #000;
}

.player-overlay {
    position: absolute;
    inset: 0;
    z-index: 4;
    display: grid;
    place-items: center;
    border: 0;
    color: var(--text);
    background: rgba(2, 6, 23, 0.28);
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.player-overlay img {
    position: absolute;
    inset: 0;
    opacity: 0.55;
}

.player-overlay::after {
    position: absolute;
    inset: 0;
    content: "";
    background: radial-gradient(circle, rgba(2, 6, 23, 0.2), rgba(2, 6, 23, 0.86));
}

.player-overlay span {
    position: relative;
    z-index: 2;
    display: grid;
    width: 5rem;
    height: 5rem;
    place-items: center;
    padding-left: 0.15rem;
    color: #052e24;
    background: linear-gradient(135deg, var(--emerald), var(--cyan));
    border-radius: 999px;
    font-size: 2rem;
    box-shadow: 0 0 60px rgba(52, 211, 153, 0.35);
}

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

.detail-panel,
.copy-panel {
    padding: 1.25rem;
    background: var(--panel);
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 1.25rem;
}

.detail-panel h2,
.copy-panel h2 {
    margin: 0 0 0.8rem;
    font-size: 1.35rem;
}

.detail-panel p,
.copy-panel p {
    margin: 0 0 1rem;
    color: var(--muted-strong);
    line-height: 1.85;
}

.detail-poster {
    overflow: hidden;
    aspect-ratio: 2 / 3;
    border-radius: 1.25rem;
    box-shadow: var(--shadow);
}

.detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-top: 1rem;
}

.detail-copy-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-top: 1.2rem;
}

.ranking-list {
    display: grid;
    gap: 0.85rem;
}

.ranking-row {
    display: grid;
    grid-template-columns: 3.2rem 5.5rem 1fr auto;
    gap: 1rem;
    align-items: center;
    padding: 0.75rem;
    background: var(--panel);
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 1rem;
}

.ranking-row strong {
    color: var(--amber);
    font-size: 1.15rem;
    text-align: center;
}

.ranking-row img {
    aspect-ratio: 16 / 10;
    border-radius: 0.75rem;
}

.ranking-row h3 {
    margin: 0 0 0.25rem;
}

.ranking-row p {
    margin: 0;
    color: var(--muted);
}

.site-footer {
    margin-top: 4rem;
    padding: 3rem 0 1.4rem;
    color: var(--muted);
    background: rgba(2, 6, 23, 0.9);
    border-top: 1px solid rgba(148, 163, 184, 0.14);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 2rem;
}

.footer-brand {
    color: var(--text);
    font-size: 1.15rem;
}

.site-footer p {
    max-width: 38rem;
    line-height: 1.8;
}

.site-footer h2 {
    margin: 0 0 1rem;
    color: var(--text);
    font-size: 1rem;
}

.site-footer a:not(.footer-brand) {
    display: block;
    margin: 0.55rem 0;
}

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

.footer-bottom {
    width: min(100% - 2rem, 1280px);
    margin: 2rem auto 0;
    padding-top: 1.2rem;
    border-top: 1px solid rgba(148, 163, 184, 0.14);
    text-align: center;
}

.empty-state {
    padding: 2rem;
    color: var(--muted);
    background: var(--panel);
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 1rem;
}

@media (max-width: 1100px) {
    .desktop-nav,
    .header-search {
        display: none;
    }

    .menu-toggle {
        display: block;
    }

    body.menu-open .mobile-panel {
        display: block;
    }

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

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

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

    .detail-poster {
        display: none;
    }
}

@media (max-width: 760px) {
    .container {
        width: min(100% - 1rem, 1280px);
    }

    .brand-text {
        max-width: 12rem;
        font-size: 1.05rem;
    }

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

    .hero-content {
        padding: 4rem 0 7rem;
    }

    .hero h1 {
        font-size: clamp(2.25rem, 12vw, 3.6rem);
    }

    .hero-thumbs {
        right: 1rem;
        left: 1rem;
        overflow-x: auto;
        padding-bottom: 0.25rem;
    }

    .hero-thumb {
        flex: 0 0 4.8rem;
        height: 3.6rem;
    }

    .section-header,
    .page-hero {
        display: block;
    }

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

    .movie-card-body {
        padding: 0.85rem;
    }

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

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

    .search-box {
        display: grid;
    }

    .ranking-row {
        grid-template-columns: 2.5rem 4.5rem 1fr;
    }

    .ranking-row .btn {
        grid-column: 1 / -1;
    }

    .footer-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 460px) {
    .movie-grid {
        grid-template-columns: 1fr;
    }

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