:root {
    color-scheme: dark;
    --bg: #020617;
    --bg-soft: #0f172a;
    --panel: rgba(15, 23, 42, 0.78);
    --panel-strong: rgba(15, 23, 42, 0.96);
    --line: rgba(148, 163, 184, 0.18);
    --line-strong: rgba(34, 211, 238, 0.35);
    --text: #f8fafc;
    --muted: #94a3b8;
    --soft: #cbd5e1;
    --cyan: #22d3ee;
    --cyan-strong: #06b6d4;
    --yellow: #facc15;
    --red: #f87171;
    --shadow: 0 24px 70px rgba(0, 0, 0, 0.36);
    --radius: 24px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    background:
        radial-gradient(circle at 18% 4%, rgba(8, 145, 178, 0.22), transparent 32rem),
        radial-gradient(circle at 92% 18%, rgba(59, 130, 246, 0.14), transparent 30rem),
        linear-gradient(180deg, #020617 0%, #0f172a 42%, #020617 100%);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

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

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

button,
input,
select {
    font: inherit;
}

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

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

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: min(1240px, calc(100% - 32px));
    min-height: 72px;
    margin: 0 auto;
    gap: 24px;
}

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

.brand-mark {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 14px;
    color: #001018;
    background: linear-gradient(135deg, var(--cyan), #67e8f9 48%, #ffffff 100%);
    box-shadow: 0 0 34px rgba(34, 211, 238, 0.36);
}

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

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

.desktop-nav {
    display: flex;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 14px;
    border-radius: 999px;
    color: var(--soft);
    transition: color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
    color: #ffffff;
    background: rgba(34, 211, 238, 0.12);
    box-shadow: inset 0 0 0 1px rgba(34, 211, 238, 0.18);
}

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

.menu-button span {
    display: block;
    width: 18px;
    height: 2px;
    margin: 4px auto;
    border-radius: 4px;
    background: var(--text);
}

.mobile-nav {
    display: none;
    flex-wrap: wrap;
    padding: 0 16px 16px;
}

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

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

.hero-stage {
    position: relative;
    min-height: 82vh;
}

.hero-slide {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    padding: 112px max(32px, calc((100vw - 1180px) / 2)) 164px;
    opacity: 0;
    pointer-events: none;
    background-image:
        linear-gradient(90deg, rgba(2, 6, 23, 0.96) 0%, rgba(2, 6, 23, 0.84) 40%, rgba(2, 6, 23, 0.38) 74%, rgba(2, 6, 23, 0.82) 100%),
        linear-gradient(0deg, rgba(2, 6, 23, 0.96), rgba(2, 6, 23, 0.1)),
        var(--hero-image);
    background-size: cover;
    background-position: center;
    transform: scale(1.025);
    transition: opacity 0.55s ease, transform 0.75s ease;
}

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

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

.section-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    color: var(--cyan);
    font-size: 0.85rem;
    font-weight: 800;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.section-kicker::before {
    content: "";
    width: 28px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
    box-shadow: 0 0 20px currentColor;
}

.hero h1,
.page-hero h1,
.detail-info h1 {
    margin: 0;
    font-size: clamp(2.4rem, 7vw, 5.9rem);
    line-height: 0.96;
    letter-spacing: -0.06em;
}

.hero p,
.page-hero p,
.detail-one-line {
    margin: 22px 0 0;
    color: var(--soft);
    font-size: clamp(1rem, 2vw, 1.22rem);
    line-height: 1.8;
}

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

.hero-tags {
    margin-top: 26px;
}

.hero-tags span,
.tag-row span {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 0 12px;
    border: 1px solid rgba(34, 211, 238, 0.24);
    border-radius: 999px;
    color: var(--soft);
    background: rgba(15, 23, 42, 0.72);
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-top: 32px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 22px;
    border-radius: 999px;
    font-weight: 800;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn:hover {
    transform: translateY(-2px);
}

.btn.primary {
    color: #001018;
    background: linear-gradient(135deg, #67e8f9, var(--cyan-strong));
    box-shadow: 0 18px 40px rgba(6, 182, 212, 0.32);
}

.btn.ghost {
    color: var(--text);
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(15, 23, 42, 0.72);
}

.btn.text {
    color: var(--cyan);
    padding-inline: 8px;
}

.hero-thumbs {
    position: absolute;
    left: 50%;
    bottom: 32px;
    z-index: 2;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
    width: min(1180px, calc(100% - 32px));
    transform: translateX(-50%);
}

.hero-thumb {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    padding: 10px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 18px;
    color: var(--soft);
    text-align: left;
    background: rgba(15, 23, 42, 0.72);
    backdrop-filter: blur(14px);
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.hero-thumb:hover,
.hero-thumb.active {
    border-color: var(--line-strong);
    background: rgba(8, 145, 178, 0.18);
    transform: translateY(-2px);
}

.hero-thumb img {
    width: 54px;
    height: 72px;
    border-radius: 12px;
    object-fit: cover;
    background: linear-gradient(135deg, #164e63, #0f172a);
}

.hero-thumb span {
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    font-weight: 700;
    line-height: 1.4;
}

.section {
    padding: 70px 0 0;
}

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

.section-head h2,
.filter-panel h2,
.content-panel h2,
.overview-body h2 {
    margin: 0;
    font-size: clamp(1.6rem, 3vw, 2.35rem);
    letter-spacing: -0.04em;
}

.compact-head h2 {
    font-size: 1.5rem;
}

.more-link {
    color: var(--cyan);
    font-weight: 800;
}

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

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

.movie-card {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(15, 23, 42, 0.68);
    box-shadow: 0 12px 42px rgba(0, 0, 0, 0.18);
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.movie-card:hover {
    border-color: rgba(34, 211, 238, 0.32);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
    transform: translateY(-5px);
}

.poster {
    position: relative;
    display: block;
    aspect-ratio: 2 / 3;
    overflow: hidden;
    background:
        radial-gradient(circle at 30% 20%, rgba(34, 211, 238, 0.3), transparent 28%),
        linear-gradient(135deg, #164e63, #020617);
}

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

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

.score,
.play-pill {
    position: absolute;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 900;
}

.score {
    top: 12px;
    left: 12px;
    min-width: 44px;
    color: #111827;
    background: var(--yellow);
}

.play-pill {
    right: 12px;
    bottom: 12px;
    padding: 0 12px;
    color: #001018;
    background: var(--cyan);
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.movie-card:hover .play-pill {
    opacity: 1;
    transform: translateY(0);
}

.card-body {
    padding: 16px;
}

.card-body h3 {
    margin: 0;
    font-size: 1rem;
    line-height: 1.35;
}

.meta-line,
.desc,
.overview-body p,
.content-panel p,
.footer-inner p {
    color: var(--muted);
    line-height: 1.72;
}

.meta-line {
    margin: 9px 0 0;
    font-size: 0.84rem;
}

.desc {
    display: -webkit-box;
    min-height: 48px;
    margin: 10px 0 0;
    overflow: hidden;
    font-size: 0.9rem;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.tag-row {
    margin-top: 14px;
}

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

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

.movie-card.compact .desc {
    display: none;
}

.two-column {
    display: grid;
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
    gap: 22px;
}

.panel,
.filter-panel,
.content-panel,
.overview-card,
.player-card,
.detail-info {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
    box-shadow: var(--shadow);
    backdrop-filter: blur(16px);
}

.panel {
    padding: 24px;
}

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

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

.rank-link {
    display: grid;
    grid-template-columns: 42px 54px minmax(0, 1fr) auto;
    align-items: center;
    gap: 13px;
    min-height: 74px;
    padding: 10px;
    border: 1px solid rgba(148, 163, 184, 0.12);
    border-radius: 18px;
    background: rgba(2, 6, 23, 0.28);
    transition: background 0.2s ease, border-color 0.2s ease;
}

.rank-link:hover {
    border-color: var(--line-strong);
    background: rgba(8, 145, 178, 0.14);
}

.rank-num {
    color: var(--cyan);
    font-size: 1.05rem;
    font-weight: 900;
    text-align: center;
}

.rank-link img {
    width: 54px;
    height: 72px;
    border-radius: 12px;
    object-fit: cover;
    background: linear-gradient(135deg, #164e63, #020617);
}

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

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

.rank-info em {
    margin-top: 6px;
    color: var(--muted);
    font-size: 0.86rem;
    font-style: normal;
}

.rank-score {
    color: var(--yellow);
    font-weight: 900;
}

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

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

.category-card {
    position: relative;
    min-height: 142px;
    overflow: hidden;
    padding: 18px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 22px;
    background: rgba(2, 6, 23, 0.42);
}

.category-card::before,
.overview-cover::before,
.page-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: linear-gradient(120deg, rgba(2, 6, 23, 0.94), rgba(15, 23, 42, 0.5)), var(--category-image, var(--page-image));
    background-size: cover;
    background-position: center;
    transition: transform 0.36s ease;
}

.category-card:hover::before,
.overview-card:hover .overview-cover::before {
    transform: scale(1.06);
}

.category-card strong,
.category-card em {
    position: relative;
    z-index: 1;
    display: block;
}

.category-card strong {
    font-size: 1.15rem;
}

.category-card em {
    margin-top: 12px;
    color: var(--soft);
    font-size: 0.88rem;
    font-style: normal;
    line-height: 1.6;
}

.page-main {
    padding-top: 42px;
}

.page-hero {
    position: relative;
    overflow: hidden;
    margin-bottom: 28px;
    padding: clamp(38px, 7vw, 82px);
    border: 1px solid var(--line);
    border-radius: calc(var(--radius) + 10px);
    background: rgba(15, 23, 42, 0.7);
}

.page-hero.slim {
    background:
        radial-gradient(circle at 20% 20%, rgba(34, 211, 238, 0.24), transparent 36%),
        rgba(15, 23, 42, 0.78);
}

.page-hero > * {
    position: relative;
    z-index: 1;
}

.page-hero::before {
    opacity: 0.72;
}

.page-hero.slim::before {
    display: none;
}

.compact-actions {
    margin-top: 24px;
}

.filter-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 24px;
    padding: 24px;
}

.filter-controls {
    display: grid;
    grid-template-columns: minmax(240px, 360px) 180px;
    gap: 12px;
}

.filter-controls.single {
    grid-template-columns: minmax(240px, 420px);
}

.search-box,
.select-box {
    display: grid;
    gap: 8px;
    color: var(--muted);
    font-size: 0.86rem;
    font-weight: 700;
}

.search-box input,
.select-box select {
    width: 100%;
    min-height: 46px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 16px;
    color: var(--text);
    outline: none;
    background: rgba(2, 6, 23, 0.58);
}

.search-box input {
    padding: 0 16px;
}

.select-box select {
    padding: 0 14px;
}

.search-box input:focus,
.select-box select:focus {
    border-color: var(--line-strong);
    box-shadow: 0 0 0 4px rgba(34, 211, 238, 0.1);
}

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

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

.overview-card {
    overflow: hidden;
}

.overview-cover {
    position: relative;
    display: flex;
    align-items: end;
    min-height: 166px;
    overflow: hidden;
    padding: 20px;
}

.overview-cover span {
    position: relative;
    z-index: 1;
    font-size: 1.35rem;
    font-weight: 900;
}

.overview-body {
    padding: 20px;
}

.overview-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 15px;
}

.overview-links a {
    padding: 7px 10px;
    border-radius: 999px;
    color: var(--soft);
    background: rgba(2, 6, 23, 0.42);
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 18px;
    color: var(--muted);
    font-size: 0.93rem;
}

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

.detail-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
    gap: 22px;
    align-items: stretch;
}

.player-card {
    position: relative;
    overflow: hidden;
    min-height: 420px;
    background:
        radial-gradient(circle at 30% 20%, rgba(34, 211, 238, 0.16), transparent 36%),
        #000000;
}

.video-player {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 420px;
    background: #000000;
    object-fit: contain;
}

.play-overlay {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: grid;
    place-items: center;
    gap: 14px;
    border: 0;
    color: var(--text);
    background:
        radial-gradient(circle at center, rgba(34, 211, 238, 0.18), transparent 26%),
        linear-gradient(180deg, rgba(2, 6, 23, 0.25), rgba(2, 6, 23, 0.62));
    cursor: pointer;
}

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

.play-icon {
    display: grid;
    place-items: center;
    width: 82px;
    height: 82px;
    border-radius: 999px;
    background: linear-gradient(135deg, #67e8f9, var(--cyan-strong));
    box-shadow: 0 0 44px rgba(34, 211, 238, 0.44);
}

.play-icon::before {
    content: "";
    width: 0;
    height: 0;
    margin-left: 6px;
    border-top: 16px solid transparent;
    border-bottom: 16px solid transparent;
    border-left: 24px solid #001018;
}

.detail-info {
    padding: 28px;
}

.detail-info h1 {
    font-size: clamp(2rem, 4vw, 3.4rem);
    line-height: 1.08;
}

.detail-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 26px 0 0;
}

.detail-meta div {
    padding: 14px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 16px;
    background: rgba(2, 6, 23, 0.32);
}

.detail-meta dt {
    color: var(--muted);
    font-size: 0.82rem;
}

.detail-meta dd {
    margin: 7px 0 0;
    color: var(--text);
    font-weight: 800;
}

.detail-tags {
    margin-top: 22px;
}

.detail-content-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 22px;
    margin-top: 22px;
}

.content-panel {
    padding: 28px;
}

.content-panel p {
    margin: 18px 0 0;
    color: var(--soft);
    font-size: 1rem;
}

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

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

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 30px 0;
}

.footer-inner p {
    max-width: 560px;
    margin: 0;
}

.footer-links {
    display: flex;
    gap: 16px;
    color: var(--cyan);
    font-weight: 800;
}

.is-filtered-out {
    display: none !important;
}

.cover-img.is-missing {
    opacity: 0;
}

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

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

    .detail-hero,
    .two-column {
        grid-template-columns: 1fr;
    }
}

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

    .menu-button {
        display: block;
    }

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

    .hero-slide {
        padding: 96px 20px 240px;
    }

    .hero-thumbs {
        grid-template-columns: 1fr;
        bottom: 20px;
    }

    .hero-thumb:nth-child(n + 4) {
        display: none;
    }

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

    .filter-controls,
    .filter-controls.single {
        width: 100%;
        grid-template-columns: 1fr;
    }

    .movie-grid,
    .featured-grid,
    .catalog-grid,
    .related-grid,
    .overview-grid,
    .rank-list.large,
    .category-grid,
    .category-grid.small,
    .detail-content-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .rank-list.large {
        grid-template-columns: 1fr;
    }

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

@media (max-width: 520px) {
    .container,
    .header-inner,
    .footer-inner {
        width: min(100% - 22px, 1180px);
    }

    .hero h1,
    .page-hero h1 {
        font-size: 2.35rem;
    }

    .movie-grid,
    .featured-grid,
    .catalog-grid,
    .related-grid,
    .overview-grid,
    .category-grid,
    .category-grid.small,
    .detail-content-grid {
        grid-template-columns: 1fr;
    }

    .rank-link {
        grid-template-columns: 32px 48px minmax(0, 1fr);
    }

    .rank-score {
        display: none;
    }

    .player-card,
    .video-player {
        min-height: 260px;
    }

    .page-hero,
    .detail-info,
    .content-panel,
    .panel,
    .filter-panel {
        padding: 20px;
    }
}
