:root {
    color-scheme: dark;
    --bg: #020617;
    --bg-soft: #0f172a;
    --bg-card: rgba(15, 23, 42, 0.76);
    --bg-glass: rgba(15, 23, 42, 0.62);
    --line: rgba(168, 85, 247, 0.22);
    --line-strong: rgba(251, 191, 36, 0.36);
    --text: #f8fafc;
    --muted: #c4b5fd;
    --muted-2: #94a3b8;
    --amber: #fbbf24;
    --amber-soft: rgba(251, 191, 36, 0.16);
    --pink: #ec4899;
    --purple: #8b5cf6;
    --blue: #38bdf8;
    --shadow: 0 24px 80px rgba(2, 6, 23, 0.42);
    --radius: 22px;
    --max: 1280px;
}

* {
    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 15% 10%, rgba(139, 92, 246, 0.22), transparent 32rem),
        radial-gradient(circle at 90% 0%, rgba(236, 72, 153, 0.18), transparent 24rem),
        linear-gradient(180deg, #020617 0%, #0f172a 46%, #020617 100%);
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -2;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
    background-size: 38px 38px;
    mask-image: linear-gradient(to bottom, #000, transparent 78%);
}

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

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

img.image-hidden {
    opacity: 0;
}

button,
input,
select {
    font: inherit;
}

button {
    cursor: pointer;
}

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

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

.brand,
.footer-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 900;
    letter-spacing: 0.04em;
}

.brand-mark {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    color: #020617;
    background: linear-gradient(135deg, var(--amber), #fb7185 52%, #a78bfa);
    box-shadow: 0 12px 28px rgba(251, 191, 36, 0.26);
}

.brand-text {
    font-size: 1.18rem;
}

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

.site-nav a {
    padding: 10px 12px;
    border-radius: 999px;
    color: #ddd6fe;
    transition: color 0.2s ease, background 0.2s ease;
}

.site-nav a:hover {
    color: var(--amber);
    background: rgba(251, 191, 36, 0.1);
}

.nav-search {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 300px;
}

.nav-search input,
.search-panel input,
.search-panel select {
    width: 100%;
    border: 1px solid rgba(168, 85, 247, 0.3);
    border-radius: 999px;
    color: var(--text);
    background: rgba(15, 23, 42, 0.72);
    outline: none;
}

.nav-search input {
    padding: 11px 16px;
}

.search-panel input,
.search-panel select {
    padding: 13px 16px;
}

.nav-search input:focus,
.search-panel input:focus,
.search-panel select:focus {
    border-color: var(--amber);
    box-shadow: 0 0 0 4px rgba(251, 191, 36, 0.12);
}

.nav-search button,
.btn,
.hero-btn,
.play-button,
.filter-button {
    border: 0;
    border-radius: 999px;
    color: #111827;
    font-weight: 800;
    background: linear-gradient(135deg, var(--amber), #fb7185);
    box-shadow: 0 14px 32px rgba(251, 191, 36, 0.22);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.nav-search button {
    padding: 11px 18px;
}

.btn,
.hero-btn,
.filter-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
}

.nav-search button:hover,
.btn:hover,
.hero-btn:hover,
.play-button:hover,
.filter-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 38px rgba(251, 191, 36, 0.32);
}

.btn-ghost,
.hero-btn.secondary {
    color: #f8fafc;
    border: 1px solid rgba(251, 191, 36, 0.32);
    background: rgba(15, 23, 42, 0.68);
    box-shadow: none;
}

.menu-toggle {
    display: none;
    margin-left: auto;
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 8px 12px;
    background: rgba(15, 23, 42, 0.7);
}

.hero {
    position: relative;
    min-height: 82vh;
    overflow: hidden;
    border-bottom: 1px solid rgba(168, 85, 247, 0.18);
}

.hero-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.72s ease;
}

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

.hero-bg {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.hero-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.08);
    filter: saturate(1.08) contrast(1.03);
}

.hero-bg::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(2, 6, 23, 0.95) 0%, rgba(2, 6, 23, 0.72) 43%, rgba(2, 6, 23, 0.48) 100%),
        radial-gradient(circle at 72% 42%, rgba(236, 72, 153, 0.23), transparent 30rem),
        linear-gradient(180deg, transparent 44%, rgba(2, 6, 23, 0.96) 100%);
}

.hero-content {
    position: relative;
    z-index: 2;
    width: min(var(--max), calc(100% - 32px));
    min-height: 82vh;
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(280px, 0.72fr);
    gap: 36px;
    align-items: center;
    padding: 70px 0 92px;
}

.hero-copy {
    max-width: 760px;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 18px;
    padding: 8px 12px;
    border: 1px solid rgba(251, 191, 36, 0.25);
    border-radius: 999px;
    color: var(--amber);
    background: rgba(251, 191, 36, 0.08);
    font-weight: 700;
}

.hero h1 {
    margin: 0 0 20px;
    font-size: clamp(2.35rem, 7vw, 5.8rem);
    line-height: 0.98;
    letter-spacing: -0.06em;
    text-wrap: balance;
}

.hero p {
    margin: 0;
    color: #ddd6fe;
    font-size: clamp(1rem, 1.8vw, 1.25rem);
    line-height: 1.9;
}

.hero-tags,
.hero-actions,
.inline-meta,
.tag-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.hero-tags {
    margin: 22px 0 28px;
}

.hero-tags span,
.tag-row span,
.meta-pill,
.category-chip,
.rank-badge {
    border: 1px solid rgba(168, 85, 247, 0.28);
    border-radius: 999px;
    color: #e9d5ff;
    background: rgba(15, 23, 42, 0.6);
}

.hero-tags span,
.tag-row span,
.meta-pill {
    padding: 7px 11px;
    font-size: 0.85rem;
}

.hero-poster {
    position: relative;
    isolation: isolate;
}

.hero-poster::before {
    content: "";
    position: absolute;
    inset: 8% -5% -8% 6%;
    z-index: -1;
    border-radius: 34px;
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.2), rgba(139, 92, 246, 0.32));
    filter: blur(20px);
}

.hero-poster a {
    display: block;
    padding: 12px;
    border: 1px solid rgba(251, 191, 36, 0.25);
    border-radius: 34px;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(16px);
    transform: rotate(1deg);
    transition: transform 0.25s ease;
}

.hero-poster a:hover {
    transform: rotate(0deg) translateY(-4px);
}

.hero-poster img {
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    border-radius: 24px;
}

.hero-controls {
    position: absolute;
    z-index: 4;
    left: 50%;
    bottom: 32px;
    width: min(var(--max), calc(100% - 32px));
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
}

.hero-dot {
    width: 46px;
    height: 5px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.25);
}

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

.page-main,
.section,
.detail-layout,
.category-page,
.search-page {
    width: min(var(--max), calc(100% - 32px));
    margin: 0 auto;
}

.section {
    padding: 72px 0 0;
}

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

.page-head {
    display: block;
    padding: 56px 0 24px;
}

.section-kicker {
    margin-bottom: 10px;
    color: var(--amber);
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.section h2,
.page-head h1,
.detail-title h1 {
    margin: 0;
    font-size: clamp(1.8rem, 4vw, 3.25rem);
    line-height: 1.12;
    letter-spacing: -0.04em;
}

.section-head p,
.page-head p,
.detail-title p {
    max-width: 800px;
    color: var(--muted);
    line-height: 1.9;
}

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

.category-tile,
.stat-card,
.search-panel,
.detail-card,
.content-card,
.player-card,
.category-group {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--bg-card);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.category-tile {
    position: relative;
    min-height: 150px;
    overflow: hidden;
    padding: 22px;
}

.category-tile::after {
    content: "";
    position: absolute;
    right: -44px;
    bottom: -44px;
    width: 128px;
    height: 128px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(251, 191, 36, 0.28), transparent 70%);
}

.category-tile strong,
.stat-card strong {
    display: block;
    margin-bottom: 8px;
    font-size: 1.35rem;
}

.category-tile span,
.stat-card span {
    color: var(--muted);
}

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

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

.movie-card {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(168, 85, 247, 0.18);
    border-radius: 20px;
    background:
        linear-gradient(180deg, rgba(15, 23, 42, 0.78), rgba(2, 6, 23, 0.92)),
        radial-gradient(circle at 50% 0%, rgba(139, 92, 246, 0.16), transparent 60%);
    box-shadow: 0 12px 44px rgba(2, 6, 23, 0.28);
    transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.movie-card:hover {
    transform: translateY(-6px);
    border-color: var(--line-strong);
    box-shadow: 0 24px 60px rgba(2, 6, 23, 0.44);
}

.poster-link {
    position: relative;
    display: block;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.24), rgba(236, 72, 153, 0.2));
}

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

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

.card-badge,
.play-dot {
    position: absolute;
    z-index: 2;
}

.card-badge {
    top: 10px;
    left: 10px;
    padding: 5px 9px;
    border-radius: 999px;
    color: #111827;
    font-size: 0.78rem;
    font-weight: 900;
    background: var(--amber);
}

.play-dot {
    right: 10px;
    bottom: 10px;
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: #111827;
    background: rgba(251, 191, 36, 0.92);
    box-shadow: 0 10px 26px rgba(251, 191, 36, 0.25);
}

.card-body {
    padding: 14px;
}

.card-meta {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    color: var(--muted-2);
    font-size: 0.78rem;
}

.card-body h3 {
    margin: 8px 0 8px;
    font-size: 1rem;
    line-height: 1.38;
}

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

.card-body p {
    min-height: 3.8em;
    margin: 0 0 12px;
    color: var(--muted);
    font-size: 0.88rem;
    line-height: 1.65;
}

.tag-row span {
    padding: 5px 8px;
    font-size: 0.74rem;
}

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

.rank-item {
    display: grid;
    grid-template-columns: 64px 84px minmax(0, 1fr) auto;
    gap: 16px;
    align-items: center;
    padding: 12px;
    border: 1px solid rgba(168, 85, 247, 0.18);
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.68);
}

.rank-number {
    font-size: 1.35rem;
    font-weight: 900;
    color: var(--amber);
    text-align: center;
}

.rank-thumb {
    width: 84px;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    border-radius: 12px;
    background: rgba(139, 92, 246, 0.18);
}

.rank-title h3 {
    margin: 0 0 8px;
    font-size: 1.12rem;
}

.rank-title p {
    margin: 0;
    color: var(--muted);
    line-height: 1.7;
}

.rank-badge {
    padding: 8px 12px;
    color: var(--amber);
}

.search-panel {
    margin: 20px 0 32px;
    padding: 18px;
    display: grid;
    grid-template-columns: minmax(280px, 1fr) 180px 180px 160px auto;
    gap: 12px;
    align-items: center;
}

.search-note {
    margin: -12px 0 26px;
    color: var(--muted-2);
}

.detail-hero {
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid rgba(168, 85, 247, 0.18);
}

.detail-hero-bg {
    position: absolute;
    inset: 0;
    z-index: -1;
}

.detail-hero-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(12px) saturate(1.12);
    transform: scale(1.12);
    opacity: 0.34;
}

.detail-hero-bg::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(2, 6, 23, 0.94), rgba(2, 6, 23, 0.7)),
        linear-gradient(180deg, transparent, #020617 100%);
}

.detail-layout {
    display: grid;
    grid-template-columns: minmax(240px, 330px) minmax(0, 1fr);
    gap: 34px;
    padding: 54px 0;
    align-items: start;
}

.detail-poster {
    border: 1px solid rgba(251, 191, 36, 0.28);
    border-radius: 28px;
    padding: 10px;
    background: rgba(15, 23, 42, 0.55);
    box-shadow: var(--shadow);
}

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

.detail-title h1 {
    margin-bottom: 16px;
}

.inline-meta {
    margin: 20px 0 24px;
}

.detail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.player-section {
    width: min(var(--max), calc(100% - 32px));
    margin: 0 auto;
    padding: 18px 0 0;
}

.player-card {
    position: relative;
    overflow: hidden;
}

.player-wrap {
    position: relative;
    aspect-ratio: 16 / 9;
    background: #000;
}

.player-video {
    width: 100%;
    height: 100%;
    background: #000;
}

.player-cover {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: grid;
    place-items: center;
    overflow: hidden;
    background: #020617;
}

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

.player-cover img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.46;
    filter: saturate(1.1);
}

.player-cover::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at center, rgba(251, 191, 36, 0.14), transparent 30rem),
        linear-gradient(180deg, rgba(2, 6, 23, 0.18), rgba(2, 6, 23, 0.82));
}

.play-button {
    position: relative;
    z-index: 7;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 17px 28px;
    font-size: 1.08rem;
}

.content-grid {
    width: min(var(--max), calc(100% - 32px));
    margin: 0 auto;
    padding: 36px 0 78px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 24px;
}

.content-card,
.detail-card,
.category-group,
.stat-card {
    padding: 24px;
}

.content-card + .content-card {
    margin-top: 18px;
}

.content-card h2,
.detail-card h2,
.category-group h2 {
    margin: 0 0 14px;
    font-size: 1.45rem;
}

.content-card p,
.detail-card p,
.category-group p {
    color: #ddd6fe;
    line-height: 1.92;
}

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

.related-list a {
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    padding: 10px;
    border: 1px solid rgba(168, 85, 247, 0.16);
    border-radius: 14px;
    background: rgba(2, 6, 23, 0.32);
}

.related-list img {
    width: 58px;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    border-radius: 10px;
    background: rgba(139, 92, 246, 0.16);
}

.related-list strong {
    display: block;
    margin-bottom: 5px;
}

.related-list span {
    color: var(--muted-2);
    font-size: 0.86rem;
}

.category-page {
    padding-bottom: 72px;
}

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

.category-chip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 54px;
    padding: 12px 15px;
    transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.category-chip:hover {
    transform: translateY(-3px);
    border-color: rgba(251, 191, 36, 0.38);
    background: rgba(251, 191, 36, 0.08);
}

.category-chip em {
    color: var(--amber);
    font-style: normal;
    font-weight: 800;
}

.category-group {
    margin-bottom: 28px;
}

.site-footer {
    margin-top: 76px;
    border-top: 1px solid rgba(168, 85, 247, 0.18);
    background: rgba(2, 6, 23, 0.76);
}

.footer-inner {
    width: min(var(--max), calc(100% - 32px));
    margin: 0 auto;
    padding: 34px 0;
    display: flex;
    justify-content: space-between;
    gap: 28px;
}

.footer-inner p {
    max-width: 680px;
    color: var(--muted);
    line-height: 1.8;
}

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

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

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

.empty-state {
    display: none;
    padding: 32px;
    border: 1px dashed rgba(168, 85, 247, 0.3);
    border-radius: 18px;
    color: var(--muted);
    text-align: center;
}

.empty-state.is-visible {
    display: block;
}

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

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

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

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

    .site-nav {
        order: 4;
        width: 100%;
        display: none;
        padding: 10px 0 4px;
        flex-wrap: wrap;
    }

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

    .nav-search {
        order: 3;
        width: 100%;
        min-width: 0;
    }

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

    .hero-content {
        padding-top: 56px;
    }

    .hero-poster {
        max-width: 360px;
    }

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

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

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

@media (max-width: 680px) {
    .header-inner,
    .page-main,
    .section,
    .detail-layout,
    .player-section,
    .content-grid,
    .category-page,
    .search-page,
    .footer-inner {
        width: min(100% - 22px, var(--max));
    }

    .hero-content {
        width: min(100% - 22px, var(--max));
        grid-template-columns: 1fr;
        gap: 24px;
        min-height: 78vh;
    }

    .hero-poster {
        display: none;
    }

    .hero-controls {
        width: min(100% - 22px, var(--max));
    }

    .category-strip,
    .stat-grid,
    .movie-grid,
    .movie-grid.dense-grid,
    .category-cloud {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .section-head {
        display: block;
    }

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

    .rank-badge {
        display: none;
    }

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

    .detail-layout {
        padding-top: 34px;
    }

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

    .footer-inner {
        flex-direction: column;
    }
}

@media (max-width: 440px) {
    .movie-grid,
    .movie-grid.dense-grid,
    .category-cloud,
    .category-strip,
    .stat-grid {
        grid-template-columns: 1fr;
    }

    .nav-search {
        flex-direction: column;
        align-items: stretch;
    }

    .hero-actions,
    .detail-actions {
        align-items: stretch;
        flex-direction: column;
    }
}
