:root {
    color-scheme: dark;
    --bg: #020617;
    --bg-soft: #0f172a;
    --panel: rgba(15, 23, 42, 0.82);
    --panel-strong: #111827;
    --line: rgba(148, 163, 184, 0.18);
    --text: #f8fafc;
    --muted: #94a3b8;
    --muted-2: #cbd5e1;
    --sky: #38bdf8;
    --sky-strong: #0284c7;
    --orange: #f97316;
    --yellow: #facc15;
    --green: #22c55e;
    --shadow: 0 24px 80px rgba(2, 8, 23, 0.42);
    --radius: 22px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    background:
        radial-gradient(circle at top left, rgba(14, 165, 233, 0.22), transparent 32rem),
        radial-gradient(circle at top right, rgba(249, 115, 22, 0.18), transparent 28rem),
        linear-gradient(135deg, #020617 0%, #0f172a 48%, #020617 100%);
}

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

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

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

.header-inner,
.page-shell,
.footer-inner {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
}

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

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

.brand-mark {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--sky), var(--orange));
    box-shadow: 0 14px 38px rgba(56, 189, 248, 0.25);
    color: white;
    font-size: 14px;
}

.brand-text {
    font-size: 21px;
}

.desktop-nav,
.mobile-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-link {
    padding: 10px 14px;
    border-radius: 999px;
    color: var(--muted-2);
    font-size: 15px;
    transition: 0.22s ease;
}

.nav-link:hover,
.nav-link.active {
    color: white;
    background: rgba(14, 165, 233, 0.14);
}

.menu-button {
    display: none;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.9);
    color: white;
    padding: 10px 13px;
    font-size: 20px;
    cursor: pointer;
}

.mobile-nav {
    display: none;
    flex-direction: column;
    align-items: stretch;
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto 14px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.96);
}

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

.mobile-category-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-top: 8px;
}

.mobile-category-link {
    padding: 10px 12px;
    border-radius: 12px;
    color: var(--muted-2);
    background: rgba(255, 255, 255, 0.04);
}

.page-shell {
    padding: 34px 0 56px;
}

.hero-carousel {
    position: relative;
    min-height: 560px;
    overflow: hidden;
    border-radius: 34px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    box-shadow: var(--shadow);
    background: #0f172a;
}

.hero-slide {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.58fr);
    gap: 34px;
    align-items: center;
    padding: 58px;
    opacity: 0;
    transform: scale(1.02);
    pointer-events: none;
    transition: opacity 0.7s ease, transform 0.7s ease;
}

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

.hero-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(24px) saturate(1.1);
    transform: scale(1.1);
    opacity: 0.36;
}

.hero-layer {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(2, 6, 23, 0.96), rgba(15, 23, 42, 0.72) 56%, rgba(2, 6, 23, 0.46)),
        radial-gradient(circle at 70% 18%, rgba(56, 189, 248, 0.22), transparent 26rem);
}

.hero-content,
.hero-poster {
    position: relative;
    z-index: 1;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    color: #bae6fd;
    background: rgba(14, 165, 233, 0.16);
    border: 1px solid rgba(56, 189, 248, 0.22);
    font-size: 14px;
    font-weight: 700;
}

.hero-content h1 {
    margin: 18px 0 16px;
    max-width: 760px;
    font-size: clamp(42px, 7vw, 84px);
    line-height: 0.96;
    letter-spacing: -0.06em;
}

.hero-content p {
    max-width: 720px;
    color: var(--muted-2);
    font-size: 18px;
    line-height: 1.85;
}

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

.hero-tags span,
.tag-row span,
.detail-tags span,
.stat-pill {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    color: #dbeafe;
    background: rgba(59, 130, 246, 0.13);
    border: 1px solid rgba(96, 165, 250, 0.16);
    font-size: 12px;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 24px;
}

.primary-button,
.ghost-button,
.small-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 999px;
    cursor: pointer;
    font-weight: 800;
    transition: transform 0.22s ease, box-shadow 0.22s ease, background 0.22s ease;
}

.primary-button {
    padding: 14px 22px;
    color: white;
    background: linear-gradient(135deg, var(--sky-strong), var(--orange));
    box-shadow: 0 18px 46px rgba(14, 165, 233, 0.28);
}

.ghost-button {
    padding: 13px 20px;
    color: white;
    border: 1px solid var(--line);
    background: rgba(15, 23, 42, 0.68);
}

.small-button {
    padding: 10px 14px;
    color: white;
    background: rgba(14, 165, 233, 0.18);
}

.primary-button:hover,
.ghost-button:hover,
.small-button:hover {
    transform: translateY(-2px);
}

.hero-poster {
    display: block;
    align-self: center;
    border-radius: 28px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.16);
    transform: rotate(2deg);
    box-shadow: 0 28px 90px rgba(0, 0, 0, 0.42);
}

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

.hero-controls {
    position: absolute;
    right: 28px;
    bottom: 28px;
    z-index: 2;
    display: flex;
    gap: 10px;
}

.hero-control {
    width: 42px;
    height: 42px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 999px;
    color: white;
    background: rgba(15, 23, 42, 0.72);
    cursor: pointer;
}

.quick-search {
    margin-top: -32px;
    position: relative;
    z-index: 3;
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 12px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: rgba(15, 23, 42, 0.88);
    backdrop-filter: blur(18px);
    box-shadow: var(--shadow);
}

.search-input,
.select-input {
    width: 100%;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 16px;
    color: white;
    outline: none;
    background: rgba(2, 6, 23, 0.72);
    padding: 13px 14px;
    font-size: 15px;
}

.select-input {
    min-width: 150px;
}

.section-block {
    margin-top: 52px;
}

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

.section-title {
    margin: 0;
    font-size: clamp(26px, 4vw, 38px);
    letter-spacing: -0.04em;
}

.section-desc,
.page-intro {
    color: var(--muted);
    line-height: 1.8;
}

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

.movie-card {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(15, 23, 42, 0.82);
    box-shadow: 0 12px 34px rgba(2, 8, 23, 0.26);
    transition: transform 0.28s ease, box-shadow 0.28s ease, border-color 0.28s ease;
}

.movie-card:hover {
    transform: translateY(-8px);
    border-color: rgba(56, 189, 248, 0.42);
    box-shadow: 0 24px 70px rgba(2, 8, 23, 0.48);
}

.poster-link {
    position: relative;
    display: block;
    overflow: hidden;
    aspect-ratio: 16 / 10;
    background: #111827;
}

.poster-link img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

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

.poster-shade {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 20%, rgba(2, 6, 23, 0.82));
}

.play-dot {
    position: absolute;
    right: 14px;
    bottom: 14px;
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: white;
    background: linear-gradient(135deg, var(--sky), var(--orange));
    box-shadow: 0 12px 34px rgba(14, 165, 233, 0.28);
}

.rank-badge {
    position: absolute;
    left: 12px;
    top: 12px;
    min-width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    color: white;
    background: linear-gradient(135deg, var(--orange), #ef4444);
    font-style: normal;
    font-weight: 900;
}

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

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

.movie-card h3 {
    margin: 0 0 8px;
    font-size: 18px;
    line-height: 1.35;
}

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

.movie-card p {
    min-height: 50px;
    color: var(--muted-2);
    font-size: 14px;
    line-height: 1.7;
}

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

.category-tile {
    min-height: 150px;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 24px;
    background:
        linear-gradient(135deg, rgba(14, 165, 233, 0.16), rgba(249, 115, 22, 0.1)),
        rgba(15, 23, 42, 0.86);
    transition: transform 0.24s ease, border-color 0.24s ease;
}

.category-tile:hover {
    transform: translateY(-5px);
    border-color: rgba(56, 189, 248, 0.42);
}

.category-tile strong {
    display: block;
    margin-bottom: 10px;
    font-size: 22px;
}

.category-tile p {
    margin: 0;
    color: var(--muted-2);
    line-height: 1.7;
}

.mini-posters {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    margin-top: 16px;
}

.mini-posters img {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 10px;
    object-fit: cover;
}

.rank-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.55fr);
    gap: 24px;
}

.rank-panel,
.detail-panel,
.player-panel {
    border: 1px solid var(--line);
    border-radius: 26px;
    background: rgba(15, 23, 42, 0.82);
    box-shadow: var(--shadow);
}

.rank-panel {
    padding: 16px;
}

.rank-row {
    display: grid;
    grid-template-columns: 44px 86px 1fr;
    gap: 14px;
    align-items: center;
    padding: 12px;
    border-radius: 18px;
    transition: background 0.22s ease, transform 0.22s ease;
}

.rank-row:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: translateX(4px);
}

.rank-number {
    font-size: 26px;
    font-weight: 900;
    color: var(--yellow);
}

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

.rank-info {
    min-width: 0;
}

.rank-info strong,
.rank-info small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rank-info small {
    margin-top: 4px;
    color: var(--muted);
}

.page-hero {
    padding: 54px;
    border: 1px solid var(--line);
    border-radius: 32px;
    background:
        radial-gradient(circle at 18% 18%, rgba(56, 189, 248, 0.22), transparent 18rem),
        linear-gradient(135deg, rgba(15, 23, 42, 0.9), rgba(2, 6, 23, 0.76));
    box-shadow: var(--shadow);
}

.page-hero h1 {
    margin: 12px 0;
    max-width: 980px;
    font-size: clamp(36px, 5vw, 64px);
    line-height: 1.05;
    letter-spacing: -0.05em;
}

.filter-bar {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 12px;
    margin: 24px 0;
}

.detail-hero {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    gap: 28px;
    align-items: start;
}

.player-panel {
    overflow: hidden;
}

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

.video-wrap video,
.video-cover {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.video-wrap video {
    object-fit: contain;
    background: #000;
}

.video-cover {
    border: 0;
    display: grid;
    place-items: center;
    cursor: pointer;
    background-size: cover;
    background-position: center;
    color: white;
    padding: 0;
}

.video-cover::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(2, 6, 23, 0.2), rgba(2, 6, 23, 0.76));
}

.video-cover span {
    position: relative;
    width: 84px;
    height: 84px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    font-size: 28px;
    background: linear-gradient(135deg, var(--sky), var(--orange));
    box-shadow: 0 20px 60px rgba(14, 165, 233, 0.34);
}

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

.detail-panel {
    padding: 26px;
}

.breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    color: var(--muted);
    font-size: 14px;
    margin-bottom: 18px;
}

.breadcrumbs a:hover {
    color: var(--sky);
}

.detail-panel h1 {
    margin: 0 0 14px;
    font-size: clamp(34px, 5vw, 58px);
    line-height: 1.06;
    letter-spacing: -0.05em;
}

.detail-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 16px 0;
}

.detail-section {
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid var(--line);
}

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

.detail-section p {
    color: var(--muted-2);
    line-height: 1.9;
    font-size: 16px;
}

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

.empty-state {
    display: none;
    padding: 36px;
    text-align: center;
    border: 1px solid var(--line);
    border-radius: 24px;
    color: var(--muted);
    background: rgba(15, 23, 42, 0.7);
}

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

.site-footer {
    border-top: 1px solid var(--line);
    background: rgba(2, 6, 23, 0.56);
}

.footer-inner {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 24px;
    padding: 34px 0;
    color: var(--muted-2);
}

.footer-brand {
    margin-bottom: 10px;
    color: white;
    font-size: 20px;
}

.footer-inner p {
    max-width: 620px;
    line-height: 1.8;
}

.footer-links {
    display: flex;
    align-items: center;
    gap: 18px;
}

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

.copyright {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 0 0 26px;
    color: var(--muted);
    font-size: 14px;
}

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

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

    .hero-poster {
        display: none;
    }
}

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

    .menu-button {
        display: inline-grid;
        place-items: center;
    }

    .header-inner {
        height: 64px;
    }

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

    .page-shell {
        padding-top: 22px;
    }

    .hero-carousel {
        min-height: 580px;
        border-radius: 24px;
    }

    .hero-slide {
        padding: 34px 24px;
    }

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

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

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

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

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

    .movie-card p {
        display: none;
    }

    .page-hero {
        padding: 32px 24px;
        border-radius: 24px;
    }

    .rank-row {
        grid-template-columns: 38px 70px 1fr;
    }

    .rank-row img {
        width: 70px;
        height: 50px;
    }

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

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

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