:root {
    color-scheme: dark;
    --bg: #020617;
    --bg-soft: #0f172a;
    --bg-panel: rgba(15, 23, 42, 0.78);
    --bg-card: #111827;
    --text: #f8fafc;
    --muted: #94a3b8;
    --muted-strong: #cbd5e1;
    --line: rgba(148, 163, 184, 0.18);
    --accent: #4f46e5;
    --accent-strong: #6366f1;
    --accent-soft: rgba(79, 70, 229, 0.16);
    --shadow: 0 22px 70px rgba(0, 0, 0, 0.35);
    --radius: 22px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
    background:
        radial-gradient(circle at 12% 0%, rgba(79, 70, 229, 0.22), transparent 30rem),
        radial-gradient(circle at 86% 18%, rgba(14, 165, 233, 0.14), transparent 28rem),
        linear-gradient(180deg, #020617 0%, #0f172a 44%, #020617 100%);
    color: var(--text);
}

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

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

button,
input,
select {
    font: inherit;
}

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

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

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

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

.brand-mark {
    width: 38px;
    height: 38px;
    display: inline-grid;
    place-items: center;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--accent), #0ea5e9);
    color: #fff;
    box-shadow: 0 14px 32px rgba(79, 70, 229, 0.38);
}

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

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

.nav-link {
    padding: 10px 14px;
    border-radius: 999px;
    color: var(--muted-strong);
    transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.nav-link:hover,
.nav-link.is-active {
    color: #fff;
    background: rgba(99, 102, 241, 0.18);
}

.nav-link:hover {
    transform: translateY(-1px);
}

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

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

.hero-slider {
    position: relative;
    min-height: 620px;
    overflow: hidden;
    background: #020617;
}

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

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

.hero-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.72;
    transform: scale(1.02);
}

.hero-layer {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(2, 6, 23, 0.96) 0%, rgba(2, 6, 23, 0.72) 45%, rgba(2, 6, 23, 0.28) 100%),
        linear-gradient(0deg, #020617 0%, rgba(2, 6, 23, 0.16) 36%, rgba(2, 6, 23, 0.2) 100%);
}

.hero-content {
    position: relative;
    z-index: 2;
    min-height: 620px;
    display: flex;
    align-items: flex-end;
    padding: 90px 0 76px;
}

.hero-copy {
    width: min(680px, 100%);
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 13px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    background: rgba(79, 70, 229, 0.72);
    color: #fff;
    font-size: 0.9rem;
    backdrop-filter: blur(12px);
}

.hero-copy h1,
.hero-copy h2 {
    margin: 20px 0 16px;
    font-size: clamp(2.45rem, 6vw, 5rem);
    line-height: 1.04;
    letter-spacing: -0.055em;
}

.hero-copy p {
    margin: 0 0 22px;
    color: var(--muted-strong);
    font-size: 1.12rem;
    line-height: 1.75;
    max-width: 62ch;
}

.hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 26px;
}

.hero-meta span,
.meta-pills span,
.tag-row span,
.detail-tags span {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 6px 11px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid var(--line);
    color: var(--muted-strong);
    font-size: 0.86rem;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
}

.primary-btn,
.secondary-btn,
.text-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 20px;
    border-radius: 14px;
    font-weight: 700;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.primary-btn {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 18px 42px rgba(79, 70, 229, 0.35);
}

.primary-btn:hover {
    background: var(--accent-strong);
    transform: translateY(-2px);
}

.secondary-btn {
    border: 1px solid var(--line);
    background: rgba(15, 23, 42, 0.68);
    color: #fff;
}

.secondary-btn:hover {
    background: rgba(30, 41, 59, 0.92);
    transform: translateY(-2px);
}

.text-btn {
    min-height: auto;
    padding: 0;
    color: #a5b4fc;
}

.hero-search {
    display: flex;
    width: min(520px, 100%);
    margin-top: 26px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.82);
    backdrop-filter: blur(14px);
}

.hero-search input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: 0;
    padding: 0 14px;
    background: transparent;
    color: #fff;
}

.hero-search button {
    border: 0;
    cursor: pointer;
}

.hero-arrow {
    position: absolute;
    top: 50%;
    z-index: 4;
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 999px;
    background: rgba(2, 6, 23, 0.62);
    color: #fff;
    cursor: pointer;
    backdrop-filter: blur(10px);
    transform: translateY(-50%);
}

.hero-arrow:hover {
    background: rgba(15, 23, 42, 0.92);
}

.hero-arrow-prev {
    left: 22px;
}

.hero-arrow-next {
    right: 22px;
}

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

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

.hero-dot.is-active {
    width: 34px;
    background: #fff;
}

.main-flow {
    padding: 64px 0 82px;
}

.section-block {
    margin-bottom: 72px;
}

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

.section-title h1,
.section-title h2 {
    margin: 0;
    font-size: clamp(1.65rem, 3vw, 2.45rem);
    letter-spacing: -0.035em;
}

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

.section-title a {
    flex: 0 0 auto;
    color: #a5b4fc;
    font-weight: 700;
}

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

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

.movie-card {
    display: flex;
    min-width: 0;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(15, 23, 42, 0.72);
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.18);
    transition: transform 0.24s ease, border-color 0.24s ease, box-shadow 0.24s ease;
}

.movie-card:hover {
    border-color: rgba(129, 140, 248, 0.5);
    transform: translateY(-6px) scale(1.015);
    box-shadow: 0 26px 70px rgba(0, 0, 0, 0.32);
}

.poster-wrap {
    position: relative;
    display: block;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    background: #0f172a;
}

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

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

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

.watch-badge {
    position: absolute;
    left: 12px;
    bottom: 12px;
    padding: 7px 12px;
    border-radius: 999px;
    background: rgba(79, 70, 229, 0.86);
    color: #fff;
    font-size: 0.84rem;
    font-weight: 700;
}

.movie-card-body {
    display: flex;
    flex: 1;
    min-height: 188px;
    flex-direction: column;
    gap: 9px;
    padding: 16px;
}

.movie-card-body strong {
    font-size: 1.04rem;
    line-height: 1.35;
    display: -webkit-box;
    overflow: hidden;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.movie-meta-line {
    color: var(--muted);
    font-size: 0.88rem;
    display: -webkit-box;
    overflow: hidden;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
}

.movie-desc {
    color: var(--muted-strong);
    font-size: 0.92rem;
    line-height: 1.62;
    display: -webkit-box;
    overflow: hidden;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

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

.tag-row {
    margin-top: auto;
}

.tag-row span {
    min-height: 26px;
    padding: 5px 9px;
    font-size: 0.78rem;
}

.movie-card-compact .movie-card-body {
    min-height: 150px;
}

.movie-card-compact .movie-desc {
    -webkit-line-clamp: 2;
}

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

.category-card {
    position: relative;
    overflow: hidden;
    padding: 24px;
    min-height: 220px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background:
        radial-gradient(circle at top right, rgba(99, 102, 241, 0.32), transparent 16rem),
        rgba(15, 23, 42, 0.76);
    box-shadow: var(--shadow);
    transition: transform 0.22s ease, border-color 0.22s ease;
}

.category-card:hover {
    transform: translateY(-5px);
    border-color: rgba(129, 140, 248, 0.5);
}

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

.category-card p {
    margin: 0 0 18px;
    color: var(--muted-strong);
    line-height: 1.7;
}

.category-mini-list {
    display: grid;
    gap: 8px;
    color: var(--muted);
    font-size: 0.92rem;
}

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

.rank-item {
    display: grid;
    grid-template-columns: 58px 84px 1fr auto;
    align-items: center;
    gap: 16px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.74);
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.rank-item:hover {
    transform: translateX(4px);
    border-color: rgba(129, 140, 248, 0.5);
}

.rank-no {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: var(--accent-soft);
    color: #c7d2fe;
    font-weight: 900;
}

.rank-item img {
    width: 84px;
    height: 106px;
    border-radius: 14px;
    object-fit: cover;
    background: #0f172a;
}

.rank-title {
    display: grid;
    gap: 8px;
}

.rank-title strong {
    font-size: 1.04rem;
}

.rank-title span {
    color: var(--muted);
    font-size: 0.9rem;
}

.rank-action {
    color: #a5b4fc;
    font-weight: 800;
    white-space: nowrap;
}

.filter-panel {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) 190px 170px;
    gap: 14px;
    padding: 18px;
    margin-bottom: 24px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(15, 23, 42, 0.76);
    box-shadow: var(--shadow);
}

.filter-panel label {
    display: grid;
    gap: 8px;
    color: var(--muted);
    font-size: 0.86rem;
}

.filter-panel input,
.filter-panel select {
    width: 100%;
    min-height: 44px;
    border: 1px solid var(--line);
    border-radius: 14px;
    outline: none;
    padding: 0 13px;
    background: rgba(2, 6, 23, 0.55);
    color: #fff;
}

.filter-panel input:focus,
.filter-panel select:focus {
    border-color: rgba(129, 140, 248, 0.65);
}

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

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

.list-hero {
    padding: 64px 0 36px;
    border-bottom: 1px solid var(--line);
    background:
        radial-gradient(circle at 24% 20%, rgba(79, 70, 229, 0.24), transparent 26rem),
        rgba(2, 6, 23, 0.2);
}

.list-hero h1 {
    margin: 0 0 14px;
    font-size: clamp(2rem, 5vw, 4rem);
    letter-spacing: -0.055em;
}

.list-hero p {
    max-width: 760px;
    margin: 0;
    color: var(--muted-strong);
    line-height: 1.8;
    font-size: 1.04rem;
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    color: var(--muted);
    font-size: 0.9rem;
}

.breadcrumb a {
    color: #c7d2fe;
}

.detail-hero {
    position: relative;
    overflow: hidden;
    min-height: 560px;
    padding: 78px 0 58px;
    border-bottom: 1px solid var(--line);
}

.detail-backdrop {
    position: absolute;
    inset: 0;
    opacity: 0.22;
}

.detail-backdrop img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(8px);
    transform: scale(1.04);
}

.detail-backdrop::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, #020617 0%, rgba(2, 6, 23, 0.86) 58%, rgba(2, 6, 23, 0.62) 100%),
        linear-gradient(0deg, #020617 0%, rgba(2, 6, 23, 0.12) 55%, #020617 100%);
}

.detail-layout {
    position: relative;
    display: grid;
    grid-template-columns: 290px 1fr;
    gap: 34px;
    align-items: end;
}

.detail-cover {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 26px;
    box-shadow: var(--shadow);
    background: #0f172a;
}

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

.detail-info {
    padding-bottom: 8px;
}

.detail-info h1 {
    margin: 18px 0 16px;
    font-size: clamp(2rem, 5vw, 4.7rem);
    line-height: 1.06;
    letter-spacing: -0.055em;
}

.detail-one-line {
    max-width: 820px;
    color: var(--muted-strong);
    font-size: 1.08rem;
    line-height: 1.78;
}

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

.player-section {
    padding: 56px 0 34px;
}

.player-shell {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 28px;
    background: #000;
    box-shadow: 0 28px 90px rgba(0, 0, 0, 0.45);
}

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

.play-overlay {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    border: 0;
    background:
        radial-gradient(circle, rgba(79, 70, 229, 0.28), transparent 22rem),
        rgba(2, 6, 23, 0.42);
    color: #fff;
    cursor: pointer;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.play-overlay span {
    width: 82px;
    height: 82px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: rgba(79, 70, 229, 0.88);
    box-shadow: 0 24px 52px rgba(79, 70, 229, 0.42);
    font-size: 2rem;
    transform: scale(1);
    transition: transform 0.2s ease;
}

.play-overlay:hover span {
    transform: scale(1.08);
}

.play-overlay.is-hidden {
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
}

.detail-content-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 28px;
    padding: 28px 0 82px;
}

.content-panel,
.side-panel {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(15, 23, 42, 0.76);
    box-shadow: var(--shadow);
}

.content-panel {
    padding: 28px;
}

.content-panel h2,
.side-panel h2 {
    margin: 0 0 16px;
    font-size: 1.35rem;
}

.content-panel p {
    margin: 0 0 22px;
    color: var(--muted-strong);
    line-height: 1.9;
}

.side-panel {
    padding: 20px;
    align-self: start;
}

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

.side-related a {
    display: grid;
    grid-template-columns: 72px 1fr;
    gap: 12px;
    align-items: center;
    padding: 8px;
    border-radius: 15px;
    background: rgba(2, 6, 23, 0.35);
    transition: background 0.2s ease;
}

.side-related a:hover {
    background: rgba(79, 70, 229, 0.14);
}

.side-related img {
    width: 72px;
    height: 94px;
    border-radius: 12px;
    object-fit: cover;
    background: #0f172a;
}

.side-related strong {
    display: block;
    margin-bottom: 7px;
    line-height: 1.36;
}

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

.pagination-note {
    margin-top: 26px;
    color: var(--muted);
    line-height: 1.7;
}

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

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

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

    .side-panel {
        align-self: stretch;
    }
}

@media (max-width: 820px) {
    .site-nav {
        position: absolute;
        left: 16px;
        right: 16px;
        top: 72px;
        display: none;
        flex-direction: column;
        align-items: stretch;
        padding: 14px;
        border: 1px solid var(--line);
        border-radius: 20px;
        background: rgba(2, 6, 23, 0.94);
        box-shadow: var(--shadow);
    }

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

    .nav-toggle {
        display: block;
    }

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

    .hero-arrow {
        display: none;
    }

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

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

    .detail-layout {
        grid-template-columns: 1fr;
        align-items: start;
    }

    .detail-cover {
        width: min(260px, 76vw);
    }

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

    .rank-action {
        grid-column: 3;
    }
}

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

    .header-inner {
        min-height: 66px;
    }

    .site-nav {
        top: 66px;
    }

    .hero-copy h1,
    .hero-copy h2 {
        font-size: 2.45rem;
    }

    .hero-content {
        padding: 74px 0 64px;
    }

    .hero-search {
        flex-direction: column;
        gap: 8px;
    }

    .hero-search input {
        min-height: 42px;
    }

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

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

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

    .rank-item {
        grid-template-columns: 42px 66px 1fr;
        gap: 10px;
        padding: 10px;
    }

    .rank-item img {
        width: 66px;
        height: 88px;
    }

    .detail-hero {
        padding-top: 54px;
    }

    .content-panel,
    .side-panel {
        padding: 20px;
    }
}
