:root {
    color-scheme: dark;
    --bg: #020617;
    --bg-soft: #0f172a;
    --panel: rgba(15, 23, 42, 0.86);
    --panel-strong: rgba(15, 23, 42, 0.96);
    --border: rgba(148, 163, 184, 0.18);
    --text: #e2e8f0;
    --muted: #94a3b8;
    --faint: #64748b;
    --cyan: #22d3ee;
    --blue: #3b82f6;
    --purple: #8b5cf6;
    --pink: #ec4899;
    --amber: #f59e0b;
    --radius: 22px;
    --shadow: 0 24px 90px rgba(0, 0, 0, 0.45);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    background: var(--bg);
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
    background:
        radial-gradient(circle at 10% -10%, rgba(34, 211, 238, 0.18), transparent 32rem),
        radial-gradient(circle at 88% 0%, rgba(59, 130, 246, 0.16), transparent 32rem),
        linear-gradient(180deg, #020617 0%, #0b1120 42%, #020617 100%);
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -2;
    background-image:
        linear-gradient(rgba(148, 163, 184, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(148, 163, 184, 0.04) 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.8), transparent 84%);
}

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

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

button,
input,
select {
    font: inherit;
}

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

.nav-wrap {
    width: min(1180px, calc(100% - 32px));
    min-height: 72px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 24px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #f8fafc;
    white-space: nowrap;
}

.brand span:last-child {
    background: linear-gradient(90deg, var(--cyan), var(--blue));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.brand-icon {
    width: 34px;
    height: 34px;
    display: inline-grid;
    place-items: center;
    border-radius: 12px;
    color: #020617;
    background: linear-gradient(135deg, var(--cyan), var(--blue));
    box-shadow: 0 12px 30px rgba(34, 211, 238, 0.26);
}

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

.main-nav a,
.mobile-panel a {
    color: #cbd5e1;
    font-size: 15px;
    font-weight: 650;
    transition: color 0.2s ease, transform 0.2s ease;
}

.main-nav a:hover,
.main-nav a.active,
.mobile-panel a:hover {
    color: var(--cyan);
}

.top-search {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
}

.top-search input {
    width: 230px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 14px;
    padding: 11px 14px;
    color: var(--text);
    background: rgba(15, 23, 42, 0.92);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.top-search input:focus {
    border-color: rgba(34, 211, 238, 0.7);
    box-shadow: 0 0 0 4px rgba(34, 211, 238, 0.08);
}

.top-search button,
.btn,
.filter-form button,
.player-cta {
    border: 0;
    border-radius: 14px;
    padding: 11px 18px;
    color: #031018;
    font-weight: 800;
    background: linear-gradient(135deg, var(--cyan), var(--blue));
    box-shadow: 0 14px 34px rgba(14, 165, 233, 0.24);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.top-search button:hover,
.btn:hover,
.filter-form button:hover,
.player-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 42px rgba(14, 165, 233, 0.32);
}

.btn.secondary {
    color: var(--text);
    background: rgba(15, 23, 42, 0.72);
    border: 1px solid rgba(148, 163, 184, 0.22);
    box-shadow: none;
}

.nav-toggle {
    display: none;
    margin-left: auto;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 12px;
    padding: 9px 12px;
    color: var(--text);
    background: rgba(15, 23, 42, 0.9);
    cursor: pointer;
}

.mobile-panel {
    display: none;
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto 16px;
    padding: 14px;
    border: 1px solid rgba(148, 163, 184, 0.15);
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.96);
}

.mobile-panel.is-open {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.hero {
    position: relative;
    width: min(1180px, calc(100% - 32px));
    margin: 32px auto 0;
    min-height: 610px;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 34px;
    background:
        linear-gradient(135deg, rgba(15, 23, 42, 0.98), rgba(15, 23, 42, 0.74)),
        radial-gradient(circle at 80% 20%, rgba(34, 211, 238, 0.24), transparent 28rem);
    box-shadow: var(--shadow);
}

.hero-track {
    position: relative;
    min-height: 610px;
}

.hero-slide {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    align-items: center;
    gap: 42px;
    padding: 58px;
    opacity: 0;
    pointer-events: none;
    transform: translateX(24px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

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

.hero-kicker,
.section-kicker,
.detail-kicker {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    gap: 8px;
    margin-bottom: 18px;
    padding: 8px 12px;
    border: 1px solid rgba(34, 211, 238, 0.26);
    border-radius: 999px;
    color: #67e8f9;
    background: rgba(8, 145, 178, 0.13);
    font-size: 13px;
    font-weight: 800;
}

.hero h1,
.page-hero h1,
.detail-title h1 {
    margin: 0;
    color: #f8fafc;
    font-size: clamp(36px, 6vw, 72px);
    line-height: 0.96;
    letter-spacing: -0.06em;
}

.hero h1 span,
.page-hero h1 span,
.detail-title h1 span {
    background: linear-gradient(90deg, #67e8f9, #60a5fa, #a78bfa);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero p,
.page-hero p,
.detail-title p {
    color: #cbd5e1;
    font-size: 18px;
    line-height: 1.85;
}

.hero-actions,
.section-actions,
.detail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 26px;
}

.hero-tags,
.detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 24px;
}

.hero-tags span,
.detail-tags span,
.tag-row span,
.meta-pill {
    display: inline-flex;
    align-items: center;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 999px;
    padding: 7px 10px;
    color: #cbd5e1;
    background: rgba(15, 23, 42, 0.66);
    font-size: 12px;
    font-weight: 700;
}

.hero-media {
    position: relative;
    min-height: 440px;
}

.hero-media::before {
    content: "";
    position: absolute;
    inset: 24px -14px -18px 22px;
    border-radius: 34px;
    background: linear-gradient(135deg, rgba(34, 211, 238, 0.24), rgba(59, 130, 246, 0.06));
    filter: blur(2px);
}

.hero-poster {
    position: relative;
    overflow: hidden;
    height: 440px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 34px;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.92), rgba(30, 41, 59, 0.7));
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
}

.hero-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.86;
}

.hero-poster::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 30%, rgba(2, 6, 23, 0.86));
}

.hero-poster-card {
    position: absolute;
    left: 22px;
    right: 22px;
    bottom: 22px;
    z-index: 2;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 22px;
    padding: 18px;
    background: rgba(2, 6, 23, 0.62);
    backdrop-filter: blur(16px);
}

.hero-poster-card strong {
    display: block;
    color: #f8fafc;
    font-size: 22px;
}

.hero-poster-card span {
    display: block;
    margin-top: 8px;
    color: #cbd5e1;
    line-height: 1.6;
}

.hero-dots {
    position: absolute;
    left: 58px;
    bottom: 34px;
    display: flex;
    gap: 10px;
    z-index: 4;
}

.hero-dots button {
    width: 38px;
    height: 5px;
    border: 0;
    border-radius: 99px;
    background: rgba(148, 163, 184, 0.32);
    cursor: pointer;
}

.hero-dots button.is-active {
    background: linear-gradient(90deg, var(--cyan), var(--blue));
}

.section,
.page-hero,
.detail-wrap,
.search-wrap {
    width: min(1180px, calc(100% - 32px));
    margin: 64px auto 0;
}

.page-hero {
    margin-top: 34px;
    padding: 44px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 30px;
    background:
        linear-gradient(135deg, rgba(15, 23, 42, 0.96), rgba(15, 23, 42, 0.68)),
        radial-gradient(circle at 82% 12%, rgba(34, 211, 238, 0.18), transparent 24rem);
    box-shadow: var(--shadow);
}

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

.section-head h2,
.page-hero h1,
.search-wrap h1,
.detail-section h2 {
    margin: 0;
    color: #f8fafc;
    font-size: clamp(28px, 4vw, 44px);
    letter-spacing: -0.04em;
}

.section-head p,
.page-hero p,
.category-card p,
.search-wrap p,
.detail-section p {
    color: var(--muted);
    line-height: 1.8;
}

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

.movie-card {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.15);
    border-radius: 24px;
    background: rgba(15, 23, 42, 0.74);
    box-shadow: 0 16px 54px rgba(0, 0, 0, 0.22);
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.movie-card:hover {
    transform: translateY(-7px);
    border-color: rgba(34, 211, 238, 0.45);
    box-shadow: 0 22px 70px rgba(8, 145, 178, 0.18);
}

.poster-frame {
    position: relative;
    aspect-ratio: 2 / 3;
    margin: 0;
    overflow: hidden;
    background:
        linear-gradient(135deg, rgba(15, 23, 42, 0.96), rgba(30, 41, 59, 0.78)),
        radial-gradient(circle at 20% 20%, rgba(34, 211, 238, 0.12), transparent 18rem);
}

.poster-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s ease, opacity 0.3s ease;
}

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

.poster-frame::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 35%, rgba(2, 6, 23, 0.88));
}

.poster-frame figcaption {
    position: absolute;
    left: 12px;
    bottom: 12px;
    z-index: 2;
    border-radius: 999px;
    padding: 6px 10px;
    color: #cffafe;
    background: rgba(8, 47, 73, 0.78);
    font-size: 12px;
    font-weight: 800;
}

.rank-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 2;
    min-width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    color: #020617;
    background: linear-gradient(135deg, #fde68a, var(--amber));
    font-style: normal;
    font-weight: 900;
}

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

.movie-card-body h3 {
    margin: 0;
    color: #f8fafc;
    font-size: 19px;
    line-height: 1.35;
}

.movie-card-body.compact h3 {
    font-size: 17px;
}

.movie-meta,
.movie-line {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.7;
}

.movie-line {
    color: #cbd5e1;
}

.tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

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

.category-card {
    min-height: 190px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.15);
    border-radius: 26px;
    padding: 24px;
    background:
        linear-gradient(135deg, rgba(15, 23, 42, 0.94), rgba(15, 23, 42, 0.62)),
        radial-gradient(circle at 80% 10%, rgba(34, 211, 238, 0.16), transparent 16rem);
    transition: transform 0.24s ease, border-color 0.24s ease;
}

.category-card:hover {
    transform: translateY(-6px);
    border-color: rgba(34, 211, 238, 0.4);
}

.category-card strong {
    color: #f8fafc;
    font-size: 25px;
}

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

.rank-layout {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 24px;
}

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

.rank-item {
    display: grid;
    grid-template-columns: 48px 1fr auto;
    align-items: center;
    gap: 14px;
    border: 1px solid rgba(148, 163, 184, 0.13);
    border-radius: 18px;
    padding: 14px 16px;
    background: rgba(15, 23, 42, 0.72);
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.rank-item:hover {
    transform: translateX(4px);
    border-color: rgba(34, 211, 238, 0.38);
}

.rank-item span {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 13px;
    color: #020617;
    background: linear-gradient(135deg, var(--cyan), var(--blue));
    font-weight: 900;
}

.rank-item strong {
    color: #f8fafc;
}

.rank-item em {
    color: var(--muted);
    font-style: normal;
}

.filter-form,
.search-panel {
    display: grid;
    grid-template-columns: 1fr 180px 180px 140px;
    gap: 12px;
    margin-top: 24px;
}

.filter-form input,
.filter-form select,
.search-panel input,
.search-panel select {
    width: 100%;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 16px;
    padding: 14px 16px;
    color: var(--text);
    background: rgba(15, 23, 42, 0.88);
    outline: none;
}

.search-results {
    margin-top: 28px;
}

.breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    color: var(--muted);
    font-size: 14px;
    margin-bottom: 22px;
}

.breadcrumbs a {
    color: #67e8f9;
}

.detail-wrap {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 28px;
    align-items: start;
}

.detail-main,
.detail-side,
.detail-section {
    border: 1px solid rgba(148, 163, 184, 0.15);
    border-radius: 28px;
    background: rgba(15, 23, 42, 0.78);
    box-shadow: 0 18px 70px rgba(0, 0, 0, 0.28);
}

.detail-main {
    padding: 28px;
}

.detail-side {
    padding: 22px;
    position: sticky;
    top: 96px;
}

.detail-title {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 26px;
    align-items: center;
}

.detail-cover {
    position: relative;
    overflow: hidden;
    aspect-ratio: 2 / 3;
    border-radius: 24px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.92), rgba(30, 41, 59, 0.82));
}

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

.player-shell {
    position: relative;
    overflow: hidden;
    margin-top: 30px;
    border: 1px solid rgba(148, 163, 184, 0.17);
    border-radius: 28px;
    aspect-ratio: 16 / 9;
    background: #020617;
}

.movie-video {
    width: 100%;
    height: 100%;
    display: block;
    background: #020617;
}

.player-overlay {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    gap: 14px;
    border: 0;
    color: #f8fafc;
    background:
        linear-gradient(180deg, rgba(2, 6, 23, 0.18), rgba(2, 6, 23, 0.82)),
        radial-gradient(circle at center, rgba(34, 211, 238, 0.22), transparent 28rem);
    cursor: pointer;
}

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

.player-overlay span {
    display: block;
    font-weight: 900;
}

.play-icon {
    width: 86px;
    height: 86px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    color: #020617;
    background: linear-gradient(135deg, var(--cyan), var(--blue));
    box-shadow: 0 22px 56px rgba(14, 165, 233, 0.34);
    font-size: 34px;
}

.detail-section {
    margin-top: 24px;
    padding: 26px;
}

.detail-section h2 {
    font-size: 28px;
}

.detail-section p {
    color: #cbd5e1;
    font-size: 16px;
}

.side-list {
    display: grid;
    gap: 14px;
    margin-top: 18px;
}

.side-card {
    display: grid;
    grid-template-columns: 74px 1fr;
    gap: 12px;
    align-items: center;
    padding: 10px;
    border: 1px solid rgba(148, 163, 184, 0.12);
    border-radius: 18px;
    background: rgba(2, 6, 23, 0.34);
}

.side-card figure {
    margin: 0;
    overflow: hidden;
    aspect-ratio: 2 / 3;
    border-radius: 13px;
    background: rgba(30, 41, 59, 0.72);
}

.side-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.side-card strong {
    display: block;
    color: #f8fafc;
    line-height: 1.4;
}

.side-card span {
    display: block;
    margin-top: 6px;
    color: var(--muted);
    font-size: 13px;
}

.site-footer {
    margin-top: 72px;
    padding: 48px 0 28px;
    border-top: 1px solid rgba(148, 163, 184, 0.14);
    background: rgba(2, 6, 23, 0.78);
}

.footer-grid {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.5fr 1fr 0.8fr;
    gap: 42px;
}

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

.footer-grid h2 {
    margin: 0 0 14px;
    color: #f8fafc;
    font-size: 17px;
}

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

.footer-links a {
    color: var(--muted);
    font-size: 14px;
}

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

.copyright {
    width: min(1180px, calc(100% - 32px));
    margin: 34px auto 0;
    padding-top: 22px;
    border-top: 1px solid rgba(148, 163, 184, 0.11);
    color: var(--faint);
    text-align: center;
    font-size: 14px;
}

.empty-state {
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 24px;
    padding: 28px;
    color: var(--muted);
    background: rgba(15, 23, 42, 0.68);
}

@media (max-width: 1080px) {
    .main-nav,
    .top-search {
        display: none;
    }

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

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

    .detail-side {
        position: static;
    }

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

@media (max-width: 820px) {
    .hero {
        min-height: 760px;
        border-radius: 26px;
    }

    .hero-track {
        min-height: 760px;
    }

    .hero-slide {
        grid-template-columns: 1fr;
        padding: 34px;
    }

    .hero-media,
    .hero-poster {
        min-height: 300px;
        height: 300px;
    }

    .hero-dots {
        left: 34px;
    }

    .section-head,
    .detail-title {
        grid-template-columns: 1fr;
        display: grid;
    }

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

    .detail-cover {
        max-width: 240px;
    }

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

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

@media (max-width: 560px) {
    .nav-wrap,
    .hero,
    .section,
    .page-hero,
    .detail-wrap,
    .search-wrap,
    .footer-grid,
    .copyright {
        width: min(100% - 22px, 1180px);
    }

    .hero h1,
    .page-hero h1,
    .detail-title h1 {
        font-size: 38px;
    }

    .hero-slide,
    .page-hero,
    .detail-main,
    .detail-section {
        padding: 22px;
    }

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

    .rank-item {
        grid-template-columns: 42px 1fr;
    }

    .rank-item em {
        grid-column: 2;
    }
}
