:root {
    --bg: #020617;
    --panel: rgba(15, 23, 42, 0.78);
    --panel-solid: #0f172a;
    --panel-soft: rgba(30, 41, 59, 0.72);
    --line: rgba(148, 163, 184, 0.18);
    --line-strong: rgba(148, 163, 184, 0.32);
    --text: #f8fafc;
    --muted: #94a3b8;
    --muted-strong: #cbd5e1;
    --accent: #38bdf8;
    --accent-2: #f97316;
    --accent-3: #22c55e;
    --shadow: 0 24px 80px rgba(2, 6, 23, 0.45);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: Inter, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at 10% 0%, rgba(56, 189, 248, 0.16), transparent 28rem),
        radial-gradient(circle at 90% 8%, rgba(249, 115, 22, 0.13), transparent 28rem),
        linear-gradient(180deg, #020617 0%, #0f172a 42%, #020617 100%);
}

body.no-scroll {
    overflow: hidden;
}

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

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

button,
input,
select {
    font: inherit;
}

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

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

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-width: max-content;
}

.brand-mark {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    color: white;
    background: linear-gradient(135deg, #38bdf8, #2563eb 45%, #f97316);
    box-shadow: 0 14px 34px rgba(37, 99, 235, 0.35);
}

.brand-text strong,
.brand-text em {
    display: block;
    line-height: 1.1;
}

.brand-text strong {
    font-size: 21px;
    letter-spacing: 0.04em;
}

.brand-text em {
    margin-top: 5px;
    font-size: 12px;
    font-style: normal;
    color: var(--muted);
}

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

.desktop-nav a,
.mobile-nav a {
    border-radius: 999px;
    color: var(--muted-strong);
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.desktop-nav a {
    padding: 10px 15px;
}

.desktop-nav a:hover,
.desktop-nav a.active,
.mobile-nav a:hover,
.mobile-nav a.active {
    color: white;
    background: rgba(148, 163, 184, 0.12);
}

.site-search {
    position: relative;
    margin-left: auto;
    width: min(340px, 34vw);
}

.site-search input,
.filter-input,
.filter-select {
    width: 100%;
    border: 1px solid var(--line);
    outline: none;
    color: white;
    background: rgba(15, 23, 42, 0.86);
    border-radius: 999px;
    padding: 12px 16px;
    transition: border 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.site-search input:focus,
.filter-input:focus,
.filter-select:focus {
    border-color: rgba(56, 189, 248, 0.72);
    box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.12);
    background: rgba(15, 23, 42, 0.95);
}

.search-panel {
    position: absolute;
    right: 0;
    top: calc(100% + 12px);
    width: min(420px, 92vw);
    display: none;
    border: 1px solid var(--line);
    border-radius: 22px;
    overflow: hidden;
    background: rgba(15, 23, 42, 0.98);
    box-shadow: var(--shadow);
}

.search-panel.active {
    display: block;
}

.search-result {
    display: grid;
    grid-template-columns: 54px 1fr;
    gap: 12px;
    padding: 12px;
    border-bottom: 1px solid var(--line);
}

.search-result:last-child {
    border-bottom: 0;
}

.search-result img {
    width: 54px;
    height: 72px;
    object-fit: cover;
    border-radius: 12px;
    background: #111827;
}

.search-result strong {
    display: block;
    margin-bottom: 5px;
    color: white;
}

.search-result span {
    display: block;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.45;
}

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

.mobile-nav {
    display: none;
    width: min(1200px, calc(100% - 32px));
    margin: 0 auto 14px;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.mobile-nav a {
    padding: 12px;
    text-align: center;
    background: rgba(15, 23, 42, 0.74);
}

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

.hero {
    position: relative;
    min-height: 650px;
    overflow: hidden;
    border-bottom: 1px solid var(--line);
}

.hero-slider {
    position: relative;
    min-height: 650px;
}

.hero-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transform: scale(1.015);
    background-size: cover;
    background-position: center;
    transition: opacity 1s ease, transform 1s ease;
}

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

.hero-slide::after {
    content: "";
    position: absolute;
    inset: auto 0 0;
    height: 42%;
    background: linear-gradient(180deg, transparent, #020617 88%);
}

.hero-content {
    position: relative;
    z-index: 3;
    width: min(1200px, calc(100% - 32px));
    min-height: 650px;
    margin: 0 auto;
    padding: 96px 0 72px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    align-items: center;
    gap: 54px;
}

.hero-kicker,
.section-kicker,
.breadcrumb {
    color: var(--accent);
    font-size: 14px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.hero h1 {
    max-width: 760px;
    margin: 18px 0 18px;
    font-size: clamp(40px, 7vw, 78px);
    line-height: 0.98;
    letter-spacing: -0.05em;
}

.hero p {
    max-width: 760px;
    color: var(--muted-strong);
    font-size: clamp(16px, 1.6vw, 20px);
    line-height: 1.9;
}

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

.hero-meta span,
.meta-pills span,
.tag-row span,
.category-tags span {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted-strong);
    background: rgba(15, 23, 42, 0.58);
}

.hero-meta span,
.meta-pills span {
    padding: 7px 12px;
}

.tag-row span,
.category-tags span {
    padding: 5px 10px;
    font-size: 12px;
}

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

.btn-primary,
.btn-secondary,
.watch-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    border-radius: 999px;
    font-weight: 700;
    transition: transform 0.2s ease, background 0.2s ease, border 0.2s ease;
}

.btn-primary {
    padding: 0 22px;
    color: #020617;
    background: linear-gradient(135deg, #f8fafc, #38bdf8);
}

.btn-secondary {
    padding: 0 22px;
    color: white;
    border: 1px solid var(--line-strong);
    background: rgba(15, 23, 42, 0.56);
}

.btn-primary:hover,
.btn-secondary:hover,
.watch-link:hover {
    transform: translateY(-2px);
}

.hero-poster {
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 32px;
    background: rgba(15, 23, 42, 0.48);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

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

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

.hero-dot {
    width: 42px;
    height: 6px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.28);
    cursor: pointer;
}

.hero-dot.active {
    background: white;
}

.section-block {
    padding: 64px 0 18px;
}

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

.section-head h2,
.page-title h1,
.detail-copy h2 {
    margin: 8px 0 0;
    font-size: clamp(28px, 4vw, 42px);
    line-height: 1.12;
    letter-spacing: -0.03em;
}

.section-head p,
.page-title p,
.category-card p,
.detail-copy p {
    color: var(--muted-strong);
    line-height: 1.8;
}

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

.movie-card {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: rgba(15, 23, 42, 0.72);
    box-shadow: 0 18px 50px rgba(2, 6, 23, 0.24);
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.movie-card:hover {
    transform: translateY(-6px);
    border-color: rgba(56, 189, 248, 0.46);
    box-shadow: 0 26px 70px rgba(2, 6, 23, 0.38);
}

.poster-link {
    position: relative;
    display: block;
    overflow: hidden;
    background: #111827;
}

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

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

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

.rank-badge {
    position: absolute;
    z-index: 3;
    top: 10px;
    left: 10px;
    min-width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    color: #020617;
    background: linear-gradient(135deg, #fbbf24, #f97316);
    box-shadow: 0 10px 28px rgba(249, 115, 22, 0.32);
}

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

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

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

.movie-card p {
    min-height: 45px;
    margin: 0 0 12px;
    color: var(--muted-strong);
    font-size: 13px;
    line-height: 1.65;
}

.compact .movie-card-body {
    padding: 12px;
}

.compact h3 {
    font-size: 15px;
}

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

.category-card {
    position: relative;
    min-height: 240px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 28px;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.92), rgba(30, 41, 59, 0.66));
    box-shadow: 0 20px 70px rgba(2, 6, 23, 0.26);
}

.category-card-media {
    position: absolute;
    inset: 0;
    opacity: 0.28;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
}

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

.category-card-body {
    position: relative;
    z-index: 2;
    min-height: 240px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: end;
    background: linear-gradient(180deg, rgba(2, 6, 23, 0.1), rgba(2, 6, 23, 0.92));
}

.category-card h2,
.category-card h3 {
    margin: 0 0 10px;
    font-size: 24px;
}

.page-hero {
    padding: 64px 0 28px;
}

.page-title {
    max-width: 820px;
}

.filters {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 170px 170px;
    gap: 12px;
    margin: 22px 0 28px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: rgba(15, 23, 42, 0.52);
}

.filter-select {
    border-radius: 16px;
    color: white;
}

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

.ranking-item {
    display: grid;
    grid-template-columns: 58px 78px minmax(0, 1fr) auto;
    align-items: center;
    gap: 16px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: rgba(15, 23, 42, 0.66);
}

.ranking-rank {
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    font-size: 18px;
    font-weight: 800;
    color: #020617;
    background: linear-gradient(135deg, #f8fafc, #38bdf8);
}

.ranking-thumb img {
    width: 78px;
    height: 104px;
    object-fit: cover;
    border-radius: 14px;
    background: #111827;
}

.ranking-info h3 {
    margin: 0 0 6px;
    font-size: 19px;
}

.ranking-info p {
    margin: 0 0 8px;
    color: var(--muted-strong);
    line-height: 1.55;
}

.watch-link {
    padding: 0 18px;
    color: white;
    background: rgba(56, 189, 248, 0.18);
    border: 1px solid rgba(56, 189, 248, 0.35);
}

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

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

.detail-hero-inner {
    position: relative;
    z-index: 1;
    width: min(1200px, calc(100% - 32px));
    margin: 0 auto;
    padding: 64px 0;
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    gap: 42px;
    align-items: center;
}

.detail-poster {
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 30px;
    background: rgba(15, 23, 42, 0.66);
    box-shadow: var(--shadow);
}

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

.breadcrumb {
    margin-bottom: 18px;
    color: var(--muted);
    text-transform: none;
    letter-spacing: 0;
}

.breadcrumb a {
    color: var(--accent);
}

.detail-info h1 {
    margin: 0 0 18px;
    font-size: clamp(36px, 6vw, 68px);
    line-height: 1.02;
    letter-spacing: -0.04em;
}

.detail-info .lead {
    max-width: 780px;
    color: var(--muted-strong);
    font-size: 18px;
    line-height: 1.9;
}

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

.player-shell {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 30px;
    background: #000;
    box-shadow: var(--shadow);
}

.player-shell video {
    width: 100%;
    aspect-ratio: 16 / 9;
    display: block;
    background: #000;
}

.play-overlay {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    gap: 12px;
    border: 0;
    color: white;
    cursor: pointer;
    background: radial-gradient(circle, rgba(2, 6, 23, 0.15), rgba(2, 6, 23, 0.58));
}

.play-overlay strong,
.play-overlay span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.play-overlay strong {
    width: 86px;
    height: 86px;
    border-radius: 999px;
    color: #020617;
    font-size: 34px;
    background: linear-gradient(135deg, #f8fafc, #38bdf8);
    box-shadow: 0 18px 60px rgba(56, 189, 248, 0.32);
}

.play-overlay span {
    padding: 10px 18px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.7);
}

.play-overlay.hidden {
    display: none;
}

.detail-content-grid {
    width: min(1200px, calc(100% - 32px));
    margin: 38px auto 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 28px;
}

.detail-copy,
.detail-side {
    border: 1px solid var(--line);
    border-radius: 28px;
    background: rgba(15, 23, 42, 0.66);
    box-shadow: 0 20px 70px rgba(2, 6, 23, 0.2);
}

.detail-copy {
    padding: 30px;
}

.detail-copy h2 {
    font-size: 28px;
    margin-top: 0;
}

.detail-copy p {
    font-size: 16px;
}

.detail-side {
    padding: 24px;
    align-self: start;
}

.detail-side h2 {
    margin: 0 0 16px;
    font-size: 22px;
}

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

.side-list a {
    display: grid;
    grid-template-columns: 58px 1fr;
    gap: 12px;
    align-items: center;
    padding: 8px;
    border-radius: 16px;
    background: rgba(30, 41, 59, 0.56);
}

.side-list img {
    width: 58px;
    height: 78px;
    object-fit: cover;
    border-radius: 10px;
    background: #111827;
}

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

.side-list span {
    color: var(--muted);
    font-size: 12px;
}

.related-section {
    padding-bottom: 72px;
}

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

.empty-state.active {
    display: block;
}

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

.footer-inner {
    width: min(1200px, calc(100% - 32px));
    margin: 0 auto;
    padding: 36px 0;
    display: flex;
    justify-content: space-between;
    gap: 24px;
    color: var(--muted-strong);
}

.footer-inner strong {
    color: white;
    font-size: 20px;
}

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

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

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

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

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

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

    .desktop-nav {
        display: none;
    }

    .menu-toggle {
        display: inline-grid;
        place-items: center;
        margin-left: auto;
    }

    .site-search {
        order: 3;
        width: 100%;
        margin-left: 0;
    }

    .mobile-nav.open {
        display: grid;
    }

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

    .hero-content {
        grid-template-columns: 1fr;
        padding-top: 54px;
        gap: 26px;
    }

    .hero-poster {
        width: min(260px, 80vw);
    }

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

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

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

    .detail-poster {
        width: min(280px, 78vw);
    }

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

    .ranking-item .watch-link {
        grid-column: 2 / -1;
        width: max-content;
    }
}

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

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

    .movie-card p {
        min-height: auto;
    }

    .hero h1,
    .detail-info h1 {
        letter-spacing: -0.03em;
    }

    .player-section,
    .detail-content-grid,
    .main-wrap,
    .page-wrap,
    .detail-hero-inner,
    .header-inner,
    .footer-inner {
        width: min(100% - 22px, 1200px);
    }

    .detail-copy,
    .detail-side {
        padding: 20px;
    }
}
