:root {
    color-scheme: dark;
    --bg: #020617;
    --panel: rgba(15, 23, 42, .86);
    --panel-strong: #0f172a;
    --line: rgba(148, 163, 184, .18);
    --text: #f8fafc;
    --muted: #94a3b8;
    --cyan: #06b6d4;
    --blue: #3b82f6;
    --violet: #8b5cf6;
    --pink: #ec4899;
    --green: #22c55e;
    --orange: #f97316;
    --amber: #f59e0b;
    --red: #ef4444;
    --shadow: 0 24px 80px rgba(2, 6, 23, .45);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: radial-gradient(circle at top left, rgba(8, 145, 178, .18), transparent 32rem), linear-gradient(180deg, #020617 0%, #0f172a 42%, #020617 100%);
    color: var(--text);
    min-height: 100vh;
}

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

button,
input,
select {
    font: inherit;
}

img {
    max-width: 100%;
}

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

.site-header {
    position: sticky;
    top: 0;
    z-index: 60;
    background: linear-gradient(90deg, rgba(2, 6, 23, .96), rgba(15, 23, 42, .96), rgba(2, 6, 23, .96));
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(18px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, .22);
}

.header-inner {
    height: 68px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.logo,
.footer-logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 900;
    letter-spacing: .02em;
    font-size: 1.45rem;
    background: linear-gradient(90deg, #67e8f9, #60a5fa);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.logo-mark {
    width: 34px;
    height: 34px;
    border-radius: 12px;
    display: inline-grid;
    place-items: center;
    color: white;
    background: linear-gradient(135deg, var(--cyan), var(--blue));
    box-shadow: 0 12px 28px rgba(6, 182, 212, .28);
}

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

.desktop-nav a,
.mobile-nav a {
    color: #cbd5e1;
    padding: 10px 16px;
    border-radius: 14px;
    transition: background .22s ease, color .22s ease, transform .22s ease;
}

.desktop-nav a:hover,
.desktop-nav a.active,
.mobile-nav a:hover,
.mobile-nav a.active {
    color: #fff;
    background: rgba(6, 182, 212, .18);
    box-shadow: inset 0 0 0 1px rgba(103, 232, 249, .18);
}

.menu-toggle {
    display: none;
    width: 42px;
    height: 42px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(15, 23, 42, .72);
    color: var(--text);
    cursor: pointer;
}

.menu-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    margin: 4px auto;
    background: #e2e8f0;
    border-radius: 999px;
}

.mobile-nav {
    display: none;
    padding: 0 16px 16px;
    border-top: 1px solid var(--line);
}

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

.hero-carousel {
    position: relative;
    height: min(720px, 76vh);
    min-height: 520px;
    overflow: hidden;
    background: #020617;
}

.hero-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    display: flex;
    align-items: flex-end;
    background-size: cover;
    background-position: center;
    transition: opacity .9s ease, transform 7s ease;
    transform: scale(1.03);
}

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

.hero-slide::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, #020617 0%, rgba(2, 6, 23, .08) 38%, transparent 70%);
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 2;
    padding: 0 0 90px;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    padding: 6px 12px;
    border-radius: 999px;
    color: #cffafe;
    background: rgba(6, 182, 212, .2);
    border: 1px solid rgba(103, 232, 249, .25);
    font-size: .9rem;
    font-weight: 700;
}

.hero-content h1,
.page-hero h1,
.detail-copy h1 {
    margin: 0;
    font-size: clamp(2.4rem, 6vw, 5.7rem);
    line-height: 1.02;
    letter-spacing: -.05em;
    text-shadow: 0 16px 42px rgba(0, 0, 0, .48);
}

.hero-content p {
    width: min(760px, 100%);
    color: #cbd5e1;
    font-size: clamp(1.05rem, 2vw, 1.32rem);
    line-height: 1.8;
    margin: 20px 0 24px;
}

.hero-tags,
.tag-row,
.filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.hero-tags span,
.tag-row span,
.filter-chips button {
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, .28);
    background: rgba(15, 23, 42, .72);
    color: #cbd5e1;
    padding: 7px 12px;
    font-size: .86rem;
}

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

.primary-button,
.ghost-button,
.text-button,
.quick-search-form button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    border-radius: 999px;
    padding: 0 24px;
    font-weight: 800;
    transition: transform .22s ease, box-shadow .22s ease, background .22s ease;
}

.primary-button,
.quick-search-form button {
    background: linear-gradient(135deg, var(--cyan), var(--blue));
    color: #fff;
    box-shadow: 0 16px 36px rgba(6, 182, 212, .26);
}

.primary-button:hover,
.quick-search-form button:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 42px rgba(6, 182, 212, .38);
}

.ghost-button,
.text-button {
    border: 1px solid rgba(148, 163, 184, .25);
    color: #dbeafe;
    background: rgba(15, 23, 42, .64);
}

.ghost-button:hover,
.text-button:hover {
    transform: translateY(-2px);
    background: rgba(30, 41, 59, .9);
}

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

.hero-dot {
    width: 10px;
    height: 10px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, .45);
    cursor: pointer;
    transition: width .25s ease, background .25s ease;
}

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

.quick-search-panel {
    margin-top: -38px;
    position: relative;
    z-index: 12;
}

.quick-search-inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(300px, 520px);
    gap: 24px;
    align-items: center;
    padding: 28px;
    border: 1px solid var(--line);
    border-radius: 28px;
    background: rgba(15, 23, 42, .9);
    box-shadow: var(--shadow);
    backdrop-filter: blur(20px);
}

.quick-search-inner h2 {
    margin: 0 0 8px;
    font-size: clamp(1.45rem, 3vw, 2rem);
}

.quick-search-inner p {
    margin: 0;
    color: var(--muted);
    line-height: 1.8;
}

.quick-search-form,
.filter-bar {
    display: flex;
    gap: 12px;
}

.quick-search-form input,
.filter-bar input,
.filter-bar select {
    width: 100%;
    min-height: 48px;
    border: 1px solid rgba(148, 163, 184, .22);
    border-radius: 16px;
    background: rgba(2, 6, 23, .56);
    color: var(--text);
    padding: 0 16px;
    outline: none;
}

.quick-search-form input:focus,
.filter-bar input:focus,
.filter-bar select:focus {
    border-color: rgba(103, 232, 249, .65);
    box-shadow: 0 0 0 4px rgba(6, 182, 212, .12);
}

.content-section {
    padding: 72px 0 0;
}

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

.section-head h2,
.featured-panel h2,
.player-section h2,
.detail-text h2 {
    margin: 0;
    font-size: clamp(1.8rem, 3.5vw, 2.45rem);
    letter-spacing: -.03em;
}

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

.section-more {
    color: #67e8f9;
    font-weight: 800;
    white-space: nowrap;
}

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

.movie-card {
    min-width: 0;
}

.movie-card-link {
    display: block;
    height: 100%;
    overflow: hidden;
    border-radius: 22px;
    border: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(15, 23, 42, .92), rgba(2, 6, 23, .96));
    box-shadow: 0 18px 46px rgba(0, 0, 0, .22);
    transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease;
}

.movie-card-link:hover {
    transform: translateY(-6px);
    border-color: rgba(103, 232, 249, .42);
    box-shadow: 0 26px 60px rgba(6, 182, 212, .12);
}

.poster {
    position: relative;
    min-height: 280px;
    overflow: hidden;
    background-size: cover;
    background-position: center;
    background-color: #0f172a;
}

.poster-card {
    aspect-ratio: 3 / 4;
}

.poster-small {
    min-height: 150px;
    aspect-ratio: 16 / 10;
    border-radius: 18px;
}

.poster-detail {
    min-height: auto;
    width: 260px;
    aspect-ratio: 3 / 4;
    border-radius: 24px;
    box-shadow: var(--shadow);
}

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

.poster-badge,
.poster-year {
    position: absolute;
    z-index: 2;
    top: 12px;
    border-radius: 999px;
    padding: 5px 10px;
    font-size: .8rem;
    font-weight: 800;
    background: rgba(2, 6, 23, .72);
    border: 1px solid rgba(255, 255, 255, .12);
    backdrop-filter: blur(10px);
}

.poster-badge {
    left: 12px;
    color: #cffafe;
}

.poster-year {
    right: 12px;
    color: #fef3c7;
}

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

.movie-card-body h3 {
    margin: 0 0 10px;
    color: #fff;
    font-size: 1.08rem;
    line-height: 1.42;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.movie-card-body p {
    color: var(--muted);
    margin: 0 0 14px;
    line-height: 1.7;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.movie-meta,
.detail-facts {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    color: #94a3b8;
    font-size: .9rem;
}

.movie-meta span,
.detail-facts span {
    padding: 5px 9px;
    border-radius: 999px;
    background: rgba(15, 23, 42, .72);
}

.category-band,
.ranking-band {
    margin-top: 82px;
    padding: 72px 0;
    background: linear-gradient(90deg, rgba(15, 23, 42, .9), rgba(30, 41, 59, .75), rgba(15, 23, 42, .9));
    border-block: 1px solid var(--line);
}

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

.category-card,
.category-overview-card {
    display: block;
    border-radius: 24px;
    padding: 22px;
    min-height: 180px;
    border: 1px solid rgba(255, 255, 255, .12);
    background: linear-gradient(135deg, rgba(6, 182, 212, .22), rgba(59, 130, 246, .12));
    box-shadow: 0 18px 42px rgba(0, 0, 0, .18);
    transition: transform .22s ease, filter .22s ease;
}

.category-card:hover,
.category-overview-card:hover {
    transform: translateY(-5px);
    filter: brightness(1.08);
}

.category-card span {
    display: block;
    color: #fff;
    font-size: 1.45rem;
    font-weight: 900;
    margin-bottom: 12px;
}

.category-card p,
.category-overview-card p {
    color: #cbd5e1;
    line-height: 1.7;
    margin: 0 0 14px;
}

.category-card div {
    display: grid;
    gap: 6px;
    color: #bae6fd;
    font-size: .9rem;
}

.category-card.blue,
.category-overview-card.blue {
    background: linear-gradient(135deg, rgba(59, 130, 246, .3), rgba(14, 165, 233, .14));
}

.category-card.violet,
.category-overview-card.violet {
    background: linear-gradient(135deg, rgba(139, 92, 246, .3), rgba(236, 72, 153, .12));
}

.category-card.emerald,
.category-overview-card.emerald,
.category-card.green,
.category-overview-card.green {
    background: linear-gradient(135deg, rgba(16, 185, 129, .3), rgba(34, 197, 94, .12));
}

.category-card.red,
.category-overview-card.red {
    background: linear-gradient(135deg, rgba(239, 68, 68, .3), rgba(249, 115, 22, .12));
}

.category-card.amber,
.category-overview-card.amber,
.category-card.orange,
.category-overview-card.orange {
    background: linear-gradient(135deg, rgba(245, 158, 11, .3), rgba(249, 115, 22, .12));
}

.category-card.pink,
.category-overview-card.pink {
    background: linear-gradient(135deg, rgba(236, 72, 153, .3), rgba(244, 114, 182, .12));
}

.category-card.indigo,
.category-overview-card.indigo {
    background: linear-gradient(135deg, rgba(99, 102, 241, .3), rgba(14, 165, 233, .12));
}

.category-card.teal,
.category-overview-card.teal {
    background: linear-gradient(135deg, rgba(20, 184, 166, .3), rgba(6, 182, 212, .12));
}

.category-card.slate,
.category-overview-card.slate {
    background: linear-gradient(135deg, rgba(100, 116, 139, .35), rgba(15, 23, 42, .72));
}

.horizontal-scroll {
    display: flex;
    gap: 18px;
    overflow-x: auto;
    padding: 2px 0 18px;
    scroll-snap-type: x mandatory;
}

.compact-card {
    min-width: 190px;
    scroll-snap-align: start;
}

.compact-card span {
    display: block;
    margin-top: 10px;
    font-weight: 800;
    line-height: 1.4;
}

.ranking-layout {
    display: grid;
    grid-template-columns: 360px minmax(0, 1fr);
    gap: 36px;
    align-items: start;
}

.rank-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 12px;
}

.rank-item a {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) 52px;
    gap: 12px;
    align-items: center;
    min-height: 54px;
    padding: 12px 14px;
    border-radius: 18px;
    background: rgba(15, 23, 42, .74);
    border: 1px solid var(--line);
    transition: transform .2s ease, border-color .2s ease;
}

.rank-item a:hover {
    transform: translateX(4px);
    border-color: rgba(103, 232, 249, .42);
}

.rank-number {
    font-size: 1.05rem;
    font-weight: 900;
    color: #67e8f9;
}

.rank-title {
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.rank-score {
    color: #fde68a;
    text-align: right;
    font-weight: 900;
}

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

.page-main {
    padding-bottom: 88px;
}

.page-hero,
.detail-hero-inner {
    padding: 76px 0 36px;
}

.slim-hero {
    min-height: 280px;
}

.page-hero p,
.lead-text {
    width: min(760px, 100%);
    color: #cbd5e1;
    line-height: 1.8;
    font-size: 1.1rem;
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    color: #94a3b8;
    margin-bottom: 28px;
}

.breadcrumb a {
    color: #67e8f9;
}

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

.category-overview-card {
    display: grid;
    grid-template-columns: minmax(240px, 360px) minmax(0, 1fr);
    gap: 24px;
    align-items: center;
    min-height: 260px;
}

.category-overview-copy h2 {
    margin: 0 0 12px;
    font-size: 2rem;
}

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

.filter-bar {
    align-items: center;
    margin-bottom: 26px;
}

.filter-chips button {
    cursor: pointer;
}

.filter-chips button.is-active,
.filter-chips button:hover {
    color: #fff;
    border-color: rgba(103, 232, 249, .45);
    background: rgba(6, 182, 212, .22);
}

.advanced-filter {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) repeat(3, minmax(150px, 190px));
}

.detail-hero {
    background-size: cover;
    background-position: center;
    border-bottom: 1px solid var(--line);
}

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

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

.detail-tags {
    margin: 20px 0;
}

.detail-facts {
    margin: 22px 0 26px;
}

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

.player-frame {
    position: relative;
    overflow: hidden;
    border-radius: 28px;
    border: 1px solid rgba(103, 232, 249, .22);
    background: #000;
    box-shadow: var(--shadow);
    aspect-ratio: 16 / 9;
}

.movie-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background: #000;
    object-fit: contain;
    z-index: 1;
}

.player-start {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 12px;
    border: 0;
    color: white;
    background: radial-gradient(circle at center, rgba(6, 182, 212, .28), rgba(2, 6, 23, .78));
    cursor: pointer;
    transition: opacity .25s ease, visibility .25s ease;
}

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

.play-icon {
    width: 78px;
    height: 78px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--cyan), var(--blue));
    box-shadow: 0 20px 50px rgba(6, 182, 212, .34);
    font-size: 2rem;
}

.detail-text {
    color: #cbd5e1;
    line-height: 1.9;
    font-size: 1.05rem;
}

.detail-text h2 {
    color: #fff;
    margin-top: 32px;
    margin-bottom: 12px;
}

.site-footer {
    border-top: 1px solid var(--line);
    background: linear-gradient(180deg, #0f172a, #020617);
    color: #cbd5e1;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.6fr 1fr 1fr;
    gap: 32px;
    padding: 48px 0;
}

.footer-grid p {
    color: var(--muted);
    line-height: 1.8;
}

.footer-grid h2 {
    margin: 0 0 14px;
    font-size: 1rem;
    color: #fff;
}

.footer-grid a:not(.footer-logo) {
    display: block;
    color: #94a3b8;
    margin: 10px 0;
}

.footer-grid a:hover {
    color: #67e8f9;
}

.footer-bottom {
    border-top: 1px solid var(--line);
    text-align: center;
    color: #64748b;
    padding: 18px;
}

.movie-card.is-hidden {
    display: none;
}

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

    .menu-toggle {
        display: block;
    }

    .hero-carousel {
        height: 680px;
        min-height: 580px;
    }

    .quick-search-inner,
    .ranking-layout,
    .category-overview-card,
    .detail-layout,
    .footer-grid {
        grid-template-columns: 1fr;
    }

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

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

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

@media (max-width: 640px) {
    .container {
        width: min(100% - 24px, 1200px);
    }

    .logo {
        font-size: 1.1rem;
    }

    .hero-content {
        padding-bottom: 80px;
    }

    .hero-actions,
    .quick-search-form,
    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .movie-grid,
    .category-grid,
    .featured-grid,
    .category-preview,
    .advanced-filter {
        grid-template-columns: 1fr;
    }

    .section-head {
        align-items: flex-start;
        flex-direction: column;
    }

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

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