:root {
    color-scheme: dark;
    --page-bg: #020617;
    --panel-bg: #0f172a;
    --panel-soft: #111c32;
    --panel-card: #1e293b;
    --panel-line: #334155;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-soft: #cbd5e1;
    --brand: #38bdf8;
    --brand-strong: #0ea5e9;
    --brand-deep: #0369a1;
    --danger: #fb7185;
    --radius-lg: 22px;
    --radius-md: 16px;
    --radius-sm: 12px;
    --shadow-lg: 0 30px 80px rgba(2, 8, 23, 0.45);
    --shadow-card: 0 18px 36px rgba(2, 8, 23, 0.34);
    --container: 1180px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text-main);
    background: linear-gradient(180deg, #020617 0%, #0f172a 46%, #020617 100%);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

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

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

button,
input,
select {
    font: inherit;
}

button {
    cursor: pointer;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    border-bottom: 1px solid rgba(51, 65, 85, 0.8);
    background: linear-gradient(90deg, rgba(15, 23, 42, 0.96), rgba(30, 41, 59, 0.96), rgba(15, 23, 42, 0.96));
    backdrop-filter: blur(18px);
    box-shadow: 0 18px 45px rgba(2, 8, 23, 0.35);
}

.nav-wrap,
.container {
    width: min(100% - 32px, var(--container));
    margin: 0 auto;
}

.nav-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 68px;
    gap: 18px;
}

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

.brand-mark {
    position: relative;
    display: inline-grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--brand), var(--brand-deep));
    box-shadow: 0 0 28px rgba(56, 189, 248, 0.42);
}

.brand-mark svg {
    width: 21px;
    height: 21px;
    fill: white;
}

.brand-text {
    font-size: 20px;
    background: linear-gradient(90deg, #7dd3fc, #2563eb);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.desktop-nav {
    display: flex;
    align-items: center;
    gap: 22px;
}

.nav-link {
    position: relative;
    color: #cbd5e1;
    font-size: 14px;
    font-weight: 700;
    transition: color 0.2s ease;
}

.nav-link::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -9px;
    height: 2px;
    border-radius: 999px;
    background: var(--brand);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.24s ease;
}

.nav-link:hover,
.nav-link.is-active {
    color: white;
}

.nav-link:hover::after,
.nav-link.is-active::after {
    transform: scaleX(1);
}

.menu-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 12px;
    color: #dbeafe;
    background: rgba(51, 65, 85, 0.9);
}

.menu-lines,
.menu-lines::before,
.menu-lines::after {
    display: block;
    width: 20px;
    height: 2px;
    border-radius: 10px;
    background: currentColor;
}

.menu-lines {
    position: relative;
}

.menu-lines::before,
.menu-lines::after {
    content: "";
    position: absolute;
    left: 0;
}

.menu-lines::before {
    top: -7px;
}

.menu-lines::after {
    top: 7px;
}

.mobile-nav {
    display: none;
    border-top: 1px solid rgba(51, 65, 85, 0.8);
    padding: 12px 16px 18px;
    background: rgba(15, 23, 42, 0.98);
}

.mobile-nav.is-open {
    display: grid;
    gap: 8px;
}

.mobile-nav .nav-link {
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(30, 41, 59, 0.72);
}

.hero {
    position: relative;
    min-height: 70vh;
    overflow: hidden;
    isolation: isolate;
}

.hero-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 1s ease;
}

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

.hero-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: saturate(1.04) contrast(1.02);
}

.hero-slide::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 15%, rgba(56, 189, 248, 0.26), transparent 30%),
        linear-gradient(180deg, rgba(2, 6, 23, 0.18), rgba(2, 6, 23, 0.82) 72%, #020617 100%),
        linear-gradient(90deg, rgba(2, 6, 23, 0.92), rgba(2, 6, 23, 0.38) 48%, rgba(2, 6, 23, 0.78));
}

.hero-content {
    position: relative;
    z-index: 3;
    display: flex;
    align-items: flex-end;
    min-height: 70vh;
    padding: 110px 0 76px;
}

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

.kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    color: #7dd3fc;
    font-size: 14px;
    font-weight: 800;
}

.kicker-dot {
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: var(--brand);
    box-shadow: 0 0 18px rgba(56, 189, 248, 0.8);
}

.hero h1 {
    margin: 0 0 18px;
    font-size: clamp(38px, 7vw, 76px);
    line-height: 0.98;
    letter-spacing: -0.05em;
}

.hero-lead {
    max-width: 680px;
    margin: 0 0 28px;
    color: #dbeafe;
    font-size: clamp(17px, 2.2vw, 22px);
    line-height: 1.65;
}

.hero-meta,
.movie-meta,
.detail-meta,
.card-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    color: var(--text-muted);
    font-size: 14px;
}

.hero-meta span,
.detail-meta span,
.card-meta span,
.tag {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 5px 10px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.58);
}

.hero-actions,
.section-head,
.filter-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.hero-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
    margin-top: 30px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 20px;
    border: 1px solid transparent;
    border-radius: 13px;
    color: white;
    font-weight: 800;
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

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

.btn-primary {
    background: var(--brand-strong);
    box-shadow: 0 18px 34px rgba(14, 165, 233, 0.36);
}

.btn-primary:hover {
    background: #0284c7;
    box-shadow: 0 22px 42px rgba(14, 165, 233, 0.48);
}

.btn-ghost {
    border-color: rgba(148, 163, 184, 0.26);
    background: rgba(15, 23, 42, 0.54);
}

.btn-ghost:hover {
    border-color: rgba(56, 189, 248, 0.58);
    background: rgba(14, 165, 233, 0.14);
}

.hero-dots {
    position: absolute;
    z-index: 5;
    right: max(24px, calc((100vw - var(--container)) / 2));
    bottom: 38px;
    display: flex;
    gap: 8px;
}

.hero-dot {
    width: 9px;
    height: 9px;
    border: 0;
    border-radius: 999px;
    background: rgba(226, 232, 240, 0.48);
    transition: width 0.3s ease, background 0.3s ease;
}

.hero-dot.is-active {
    width: 34px;
    background: var(--brand);
}

.page-section {
    padding: 64px 0;
}

.page-section.soft {
    background: linear-gradient(90deg, rgba(15, 23, 42, 0.92), rgba(30, 41, 59, 0.72));
}

.section-head {
    margin-bottom: 26px;
}

.section-head h2,
.page-title h1,
.detail-copy h1 {
    margin: 0;
    font-size: clamp(28px, 4vw, 44px);
    letter-spacing: -0.04em;
}

.section-head p,
.page-title p,
.category-card p,
.detail-copy p,
.review-box p {
    color: var(--text-soft);
    line-height: 1.75;
}

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

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

.movie-card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.12);
    border-radius: var(--radius-md);
    background: var(--panel-card);
    box-shadow: var(--shadow-card);
    transition: transform 0.26s ease, border-color 0.26s ease, box-shadow 0.26s ease;
}

.movie-card:hover {
    transform: translateY(-7px) scale(1.01);
    border-color: rgba(56, 189, 248, 0.42);
    box-shadow: 0 28px 58px rgba(2, 8, 23, 0.58);
}

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

.movie-grid.compact .card-cover {
    aspect-ratio: 2 / 3;
}

.card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.52s ease;
}

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

.card-cover::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 35%, rgba(2, 6, 23, 0.82));
    opacity: 0.8;
}

.card-play {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: grid;
    place-items: center;
    color: white;
    font-size: 48px;
    opacity: 0;
    filter: drop-shadow(0 10px 24px rgba(0, 0, 0, 0.42));
    transition: opacity 0.25s ease;
}

.movie-card:hover .card-play {
    opacity: 1;
}

.card-rank {
    position: absolute;
    left: 12px;
    top: 12px;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 9px;
    border-radius: 999px;
    color: white;
    font-weight: 900;
    background: linear-gradient(135deg, #0ea5e9, #1d4ed8);
    box-shadow: 0 12px 22px rgba(14, 165, 233, 0.32);
}

.card-content {
    display: grid;
    gap: 10px;
    padding: 16px;
}

.card-title {
    display: -webkit-box;
    min-height: 2.7em;
    margin: 0;
    overflow: hidden;
    color: white;
    font-size: 17px;
    line-height: 1.35;
    font-weight: 800;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.movie-card:hover .card-title {
    color: #7dd3fc;
}

.card-desc {
    display: -webkit-box;
    min-height: 3.2em;
    margin: 0;
    overflow: hidden;
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.6;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

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

.category-card {
    position: relative;
    overflow: hidden;
    min-height: 208px;
    padding: 22px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: var(--radius-lg);
    background:
        radial-gradient(circle at 15% 0%, rgba(56, 189, 248, 0.20), transparent 35%),
        linear-gradient(145deg, rgba(30, 41, 59, 0.95), rgba(15, 23, 42, 0.92));
    box-shadow: var(--shadow-card);
    transition: transform 0.24s ease, border-color 0.24s ease;
}

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

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

.page-title {
    padding: 58px 0 32px;
}

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

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

.filter-panel,
.search-panel,
.review-box,
.detail-card {
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: var(--radius-lg);
    background: rgba(15, 23, 42, 0.74);
    box-shadow: var(--shadow-card);
}

.filter-panel,
.search-panel {
    margin-bottom: 28px;
    padding: 18px;
}

.filter-bar {
    flex-wrap: wrap;
}

.field {
    display: grid;
    gap: 7px;
    min-width: 180px;
    color: #cbd5e1;
    font-size: 13px;
    font-weight: 800;
}

.field.grow {
    flex: 1 1 260px;
}

.field input,
.field select,
.search-input {
    width: 100%;
    min-height: 44px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 13px;
    color: white;
    outline: none;
    background: rgba(2, 6, 23, 0.54);
    padding: 0 14px;
}

.field input:focus,
.field select:focus,
.search-input:focus {
    border-color: rgba(56, 189, 248, 0.72);
    box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.14);
}

.search-panel {
    position: relative;
    margin-top: 30px;
}

.search-input {
    min-height: 52px;
    font-size: 16px;
}

.search-results {
    display: none;
    margin-top: 16px;
    gap: 12px;
}

.search-results.is-open {
    display: grid;
}

.search-item {
    display: grid;
    grid-template-columns: 68px 1fr;
    gap: 14px;
    align-items: center;
    padding: 10px;
    border: 1px solid rgba(148, 163, 184, 0.12);
    border-radius: 14px;
    background: rgba(30, 41, 59, 0.78);
}

.search-item img {
    width: 68px;
    height: 88px;
    object-fit: cover;
    border-radius: 10px;
}

.search-item strong {
    display: block;
    margin-bottom: 4px;
    color: white;
}

.search-item span {
    color: var(--text-muted);
    font-size: 13px;
}

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

.rank-row {
    display: grid;
    grid-template-columns: 76px 86px 1fr auto;
    gap: 18px;
    align-items: center;
    padding: 14px;
    border: 1px solid rgba(148, 163, 184, 0.13);
    border-radius: var(--radius-md);
    background: rgba(30, 41, 59, 0.78);
    transition: transform 0.22s ease, border-color 0.22s ease;
}

.rank-row:hover {
    transform: translateX(5px);
    border-color: rgba(56, 189, 248, 0.4);
}

.rank-num {
    color: #7dd3fc;
    font-size: 28px;
    font-weight: 900;
}

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

.rank-info h2,
.rank-info h3 {
    margin: 0 0 8px;
    font-size: 20px;
}

.rank-info p {
    display: -webkit-box;
    margin: 0;
    overflow: hidden;
    color: var(--text-muted);
    line-height: 1.65;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.score {
    display: inline-grid;
    place-items: center;
    min-width: 62px;
    min-height: 42px;
    border-radius: 999px;
    color: white;
    font-weight: 900;
    background: rgba(14, 165, 233, 0.18);
    border: 1px solid rgba(56, 189, 248, 0.34);
}

.detail-hero {
    padding: 46px 0 40px;
    background:
        radial-gradient(circle at 22% 12%, rgba(14, 165, 233, 0.18), transparent 34%),
        linear-gradient(180deg, rgba(15, 23, 42, 0.92), rgba(2, 6, 23, 0));
}

.detail-layout {
    display: grid;
    grid-template-columns: 310px 1fr;
    gap: 34px;
    align-items: start;
}

.detail-poster {
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

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

.detail-copy h1 {
    margin-bottom: 18px;
}

.detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 22px 0;
}

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

.player-frame {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(56, 189, 248, 0.22);
    border-radius: var(--radius-lg);
    background: #020617;
    box-shadow: var(--shadow-lg);
    aspect-ratio: 16 / 9;
}

.player-frame video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
}

.player-overlay {
    position: absolute;
    inset: 0;
    z-index: 4;
    display: grid;
    place-items: center;
    border: 0;
    color: white;
    background: linear-gradient(180deg, rgba(2, 6, 23, 0.14), rgba(2, 6, 23, 0.58));
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

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

.player-symbol {
    display: grid;
    place-items: center;
    width: clamp(74px, 10vw, 108px);
    height: clamp(74px, 10vw, 108px);
    padding-left: 5px;
    border-radius: 999px;
    color: white;
    font-size: clamp(34px, 5vw, 50px);
    background: rgba(14, 165, 233, 0.92);
    box-shadow: 0 24px 56px rgba(14, 165, 233, 0.46);
}

.detail-columns {
    display: grid;
    grid-template-columns: 1fr 330px;
    gap: 28px;
    align-items: start;
}

.detail-card,
.review-box {
    padding: 24px;
}

.detail-card h2,
.review-box h2 {
    margin: 0 0 14px;
    font-size: 24px;
}

.detail-card p,
.review-box p {
    margin: 0;
}

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

.side-item {
    display: grid;
    grid-template-columns: 70px 1fr;
    gap: 12px;
    align-items: center;
    padding: 10px;
    border-radius: 14px;
    background: rgba(30, 41, 59, 0.72);
}

.side-item img {
    width: 70px;
    height: 92px;
    object-fit: cover;
    border-radius: 10px;
}

.side-item strong {
    display: -webkit-box;
    overflow: hidden;
    color: white;
    line-height: 1.4;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

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

.site-footer {
    margin-top: 44px;
    padding: 42px 0;
    border-top: 1px solid rgba(51, 65, 85, 0.72);
    color: var(--text-muted);
    background: #020617;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: 28px;
}

.footer-grid h2,
.footer-grid h3 {
    margin: 0 0 12px;
    color: white;
    font-size: 18px;
}

.footer-grid p,
.footer-grid a {
    color: var(--text-muted);
    line-height: 1.75;
}

.footer-links {
    display: grid;
    gap: 8px;
}

.copyright {
    margin-top: 28px;
    padding-top: 22px;
    border-top: 1px solid rgba(51, 65, 85, 0.58);
    text-align: center;
    font-size: 14px;
}

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

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

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

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

    .detail-poster {
        max-width: 340px;
    }
}

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

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

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

    .hero,
    .hero-content {
        min-height: 76vh;
    }

    .hero-content {
        padding: 92px 0 70px;
    }

    .hero-dots {
        left: 24px;
        right: auto;
        bottom: 24px;
    }

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

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

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

    .card-content {
        padding: 13px;
    }

    .card-title {
        font-size: 15px;
    }

    .card-desc {
        font-size: 13px;
    }

    .rank-row {
        grid-template-columns: 44px 72px 1fr;
        gap: 12px;
    }

    .rank-row .score {
        grid-column: 2 / 4;
        justify-self: start;
    }

    .rank-row img {
        width: 72px;
        height: 96px;
    }
}

@media (max-width: 430px) {
    .nav-wrap,
    .container {
        width: min(100% - 22px, var(--container));
    }

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