:root {
    color-scheme: dark;
    --bg: #020617;
    --bg-soft: #0f172a;
    --bg-card: rgba(15, 23, 42, 0.82);
    --border: rgba(148, 163, 184, 0.18);
    --text: #f8fafc;
    --muted: #94a3b8;
    --muted-strong: #cbd5e1;
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-soft: rgba(99, 102, 241, 0.18);
    --accent: #22d3ee;
    --radius-lg: 28px;
    --radius-md: 18px;
    --shadow: 0 26px 80px rgba(2, 6, 23, 0.48);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(79, 70, 229, 0.28), transparent 36rem),
        radial-gradient(circle at top right, rgba(34, 211, 238, 0.14), transparent 30rem),
        linear-gradient(180deg, #020617 0%, #0f172a 48%, #020617 100%);
}

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

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

button,
input,
select {
    font: inherit;
}

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

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

.brand,
.footer-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 15px;
    display: grid;
    place-items: center;
    color: #ffffff;
    font-weight: 900;
    background: linear-gradient(135deg, #6366f1, #8b5cf6 48%, #22d3ee);
    box-shadow: 0 16px 40px rgba(99, 102, 241, 0.35);
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.05;
}

.brand-text strong {
    font-size: 20px;
    letter-spacing: 0.02em;
}

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

.main-nav {
    display: flex;
    align-items: center;
    gap: 22px;
    color: var(--muted-strong);
    font-size: 15px;
}

.main-nav a {
    transition: color 0.2s ease;
}

.main-nav a:hover {
    color: #ffffff;
}

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

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

.hero {
    position: relative;
    min-height: 640px;
    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-slide > img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.04);
    filter: saturate(1.08) contrast(1.04);
}

.hero-shade {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(2, 6, 23, 0.95) 0%, rgba(2, 6, 23, 0.74) 40%, rgba(2, 6, 23, 0.3) 100%),
        linear-gradient(0deg, #020617 0%, rgba(2, 6, 23, 0.1) 48%, rgba(2, 6, 23, 0.58) 100%);
}

.hero-content {
    position: absolute;
    left: max(24px, calc((100vw - 1180px) / 2));
    bottom: 88px;
    width: min(680px, calc(100% - 48px));
}

.hero-pill,
.section-kicker {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    border: 1px solid rgba(99, 102, 241, 0.38);
    border-radius: 999px;
    color: #e0e7ff;
    background: rgba(79, 70, 229, 0.42);
    backdrop-filter: blur(12px);
    font-size: 13px;
    letter-spacing: 0.05em;
}

.hero h1 {
    margin: 18px 0 16px;
    max-width: 620px;
    font-size: clamp(38px, 6vw, 72px);
    line-height: 0.98;
    letter-spacing: -0.05em;
}

.hero p {
    max-width: 620px;
    margin: 0 0 20px;
    color: #dbeafe;
    font-size: 18px;
    line-height: 1.75;
}

.hero-tags,
.card-tags,
.detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.hero-tags span,
.card-tags span,
.detail-tags span {
    padding: 6px 10px;
    border-radius: 999px;
    color: #cbd5e1;
    background: rgba(15, 23, 42, 0.72);
    border: 1px solid rgba(148, 163, 184, 0.18);
    font-size: 12px;
}

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

.btn-primary,
.btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 24px;
    border-radius: 14px;
    font-weight: 800;
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), #8b5cf6);
    color: #ffffff;
    box-shadow: 0 18px 40px rgba(99, 102, 241, 0.28);
}

.btn-ghost {
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(15, 23, 42, 0.45);
    color: #ffffff;
}

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

.hero-arrow {
    position: absolute;
    top: 50%;
    z-index: 3;
    width: 46px;
    height: 46px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 50%;
    color: #ffffff;
    background: rgba(2, 6, 23, 0.5);
    font-size: 34px;
    line-height: 1;
    transform: translateY(-50%);
}

.hero-prev {
    left: 24px;
}

.hero-next {
    right: 24px;
}

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

.hero-dots button {
    width: 10px;
    height: 10px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.5);
    transition: width 0.2s ease, background 0.2s ease;
}

.hero-dots button.is-active {
    width: 34px;
    background: #ffffff;
}

.search-band,
.section-wrap,
.page-hero,
.detail-main,
.breadcrumb,
.site-footer,
.category-overview-block {
    width: min(1180px, calc(100% - 32px));
    margin-left: auto;
    margin-right: auto;
}

.search-band {
    display: grid;
    grid-template-columns: 1fr minmax(280px, 520px);
    gap: 20px;
    align-items: center;
    margin-top: -48px;
    position: relative;
    z-index: 6;
    padding: 24px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: rgba(15, 23, 42, 0.86);
    box-shadow: var(--shadow);
    backdrop-filter: blur(22px);
}

.search-band h2,
.section-head h2,
.page-hero h1,
.detail-info h1,
.story-card h2 {
    margin: 0;
}

.search-band h2 {
    font-size: 24px;
}

.search-band p,
.section-head p,
.page-hero p,
.site-footer p,
.story-card p {
    color: var(--muted-strong);
    line-height: 1.75;
}

.filter-panel {
    display: grid;
    grid-template-columns: 1fr 160px;
    gap: 12px;
}

.filter-panel input,
.filter-panel select {
    width: 100%;
    min-height: 46px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 14px;
    color: #ffffff;
    background: rgba(2, 6, 23, 0.78);
    outline: none;
    padding: 0 14px;
}

.filter-panel input:focus,
.filter-panel select:focus {
    border-color: rgba(99, 102, 241, 0.9);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.16);
}

.section-wrap,
.category-overview-block {
    padding: 76px 0 0;
}

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

.section-head h2 {
    margin-top: 12px;
    font-size: clamp(26px, 3vw, 38px);
    letter-spacing: -0.03em;
}

.section-head a {
    color: #a5b4fc;
    font-weight: 800;
}

.compact-head {
    align-items: center;
}

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

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

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

.movie-card {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 24px;
    background: var(--bg-card);
    box-shadow: 0 18px 50px rgba(2, 6, 23, 0.28);
    transition: transform 0.22s ease, border-color 0.22s ease, background 0.22s ease;
}

.movie-card:hover {
    transform: translateY(-6px);
    border-color: rgba(99, 102, 241, 0.48);
    background: rgba(30, 41, 59, 0.88);
}

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

.card-poster::after,
.rank-thumb::after,
.detail-poster::after {
    position: absolute;
    inset: 0;
    content: "";
    background: linear-gradient(180deg, transparent 42%, rgba(2, 6, 23, 0.82) 100%);
}

.card-poster img,
.rank-thumb img,
.detail-poster img,
.category-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.28s ease;
}

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

.card-year,
.card-heat {
    position: absolute;
    z-index: 2;
    padding: 6px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    background: rgba(2, 6, 23, 0.72);
    backdrop-filter: blur(10px);
}

.card-year {
    left: 12px;
    top: 12px;
}

.card-heat {
    right: 12px;
    bottom: 12px;
    color: #fde68a;
}

.card-body {
    padding: 18px;
}

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

.card-body h3 {
    margin: 10px 0 8px;
    font-size: 19px;
    line-height: 1.28;
}

.card-body h3 a:hover,
.rank-info h3 a:hover {
    color: #c4b5fd;
}

.card-body p {
    min-height: 66px;
    margin: 0 0 14px;
    color: var(--muted-strong);
    font-size: 14px;
    line-height: 1.62;
}

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

.category-card {
    position: relative;
    min-height: 220px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 8px;
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 24px;
    background: #0f172a;
}

.category-card::before {
    position: absolute;
    inset: 0;
    z-index: 1;
    content: "";
    background: linear-gradient(180deg, rgba(2, 6, 23, 0.12), rgba(2, 6, 23, 0.94));
}

.category-card img {
    position: absolute;
    inset: 0;
}

.category-card span,
.category-card p {
    position: relative;
    z-index: 2;
}

.category-card span {
    font-size: 22px;
    font-weight: 900;
}

.category-card p {
    margin: 0;
    color: #cbd5e1;
    font-size: 13px;
    line-height: 1.6;
}

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

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

.rank-row {
    display: grid;
    grid-template-columns: 54px 86px 1fr;
    gap: 14px;
    align-items: center;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: rgba(15, 23, 42, 0.78);
}

.rank-index {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 15px;
    color: #ffffff;
    background: linear-gradient(135deg, #6366f1, #22d3ee);
    font-weight: 900;
}

.rank-thumb {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 10;
    border-radius: 15px;
    background: #0f172a;
}

.rank-info h3 {
    margin: 0 0 5px;
    font-size: 17px;
}

.rank-info p {
    margin: 0 0 8px;
    color: var(--muted-strong);
    font-size: 13px;
    line-height: 1.5;
}

.rank-meta strong {
    color: #fde68a;
}

.page-main {
    padding-bottom: 80px;
}

.page-hero {
    margin-top: 36px;
    padding: 64px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background:
        linear-gradient(135deg, rgba(99, 102, 241, 0.26), rgba(34, 211, 238, 0.08)),
        rgba(15, 23, 42, 0.78);
    box-shadow: var(--shadow);
}

.page-hero h1 {
    margin-top: 14px;
    font-size: clamp(36px, 5vw, 64px);
    letter-spacing: -0.05em;
}

.page-hero p {
    max-width: 760px;
    margin: 18px 0 0;
    font-size: 17px;
}

.page-filter {
    margin-top: 28px;
}

.large-ranking {
    gap: 18px;
}

.large-ranking .rank-row {
    grid-template-columns: 64px 124px 1fr;
}

.detail-main {
    padding: 30px 0 80px;
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 9px;
    margin-top: 28px;
    color: var(--muted);
    font-size: 14px;
}

.breadcrumb a:hover {
    color: #ffffff;
}

.detail-hero {
    display: grid;
    grid-template-columns: minmax(240px, 360px) 1fr;
    gap: 34px;
    align-items: stretch;
    margin-top: 24px;
    padding: 26px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background:
        radial-gradient(circle at top right, rgba(99, 102, 241, 0.25), transparent 28rem),
        rgba(15, 23, 42, 0.78);
    box-shadow: var(--shadow);
}

.detail-poster {
    position: relative;
    overflow: hidden;
    min-height: 480px;
    border-radius: 24px;
    background: #0f172a;
}

.detail-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.detail-info h1 {
    margin-top: 18px;
    font-size: clamp(34px, 5vw, 62px);
    line-height: 1.05;
    letter-spacing: -0.04em;
}

.detail-one-line {
    margin: 18px 0 0;
    color: #dbeafe;
    font-size: 18px;
    line-height: 1.8;
}

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

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

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

.detail-meta dd {
    margin: 5px 0 0;
    font-weight: 900;
}

.player-section,
.detail-content {
    margin-top: 34px;
}

.player-box {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(99, 102, 241, 0.35);
    border-radius: var(--radius-lg);
    background: #000000;
    box-shadow: var(--shadow);
}

.player-box video {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000000;
}

.play-overlay {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    border: 0;
    color: #ffffff;
    background: linear-gradient(180deg, rgba(2, 6, 23, 0.18), rgba(2, 6, 23, 0.64));
    cursor: pointer;
}

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

.play-overlay span {
    width: 86px;
    height: 86px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    box-shadow: 0 20px 60px rgba(99, 102, 241, 0.42);
    font-size: 34px;
    transform: translateX(3px);
}

.story-card {
    padding: 34px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: rgba(15, 23, 42, 0.78);
}

.story-card h2 {
    font-size: 28px;
}

.story-card p {
    margin: 18px 0 0;
    font-size: 16px;
}

.related-section {
    width: 100%;
}

.site-footer {
    margin-top: 80px;
    padding: 42px 0 28px;
    border-top: 1px solid var(--border);
}

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

.footer-brand {
    font-size: 22px;
    font-weight: 900;
}

.site-footer h2 {
    margin: 0 0 14px;
    font-size: 16px;
}

.site-footer ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.site-footer li + li {
    margin-top: 9px;
}

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

.site-footer a:hover {
    color: #ffffff;
}

.footer-bottom {
    margin-top: 28px;
    color: var(--muted);
    font-size: 14px;
}

[data-card].is-hidden {
    display: none;
}

.no-result {
    grid-column: 1 / -1;
    padding: 28px;
    border: 1px dashed rgba(148, 163, 184, 0.28);
    border-radius: 20px;
    color: var(--muted-strong);
    text-align: center;
}

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

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

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

@media (max-width: 860px) {
    .nav-wrap {
        height: auto;
        min-height: 68px;
        flex-wrap: wrap;
        padding: 12px 0;
    }

    .menu-toggle {
        display: block;
    }

    .main-nav {
        display: none;
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 12px 0;
    }

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

    .main-nav a {
        padding: 12px 0;
        border-top: 1px solid rgba(148, 163, 184, 0.12);
    }

    .hero {
        min-height: 590px;
    }

    .hero-content {
        bottom: 82px;
    }

    .hero p {
        font-size: 16px;
    }

    .hero-arrow {
        display: none;
    }

    .search-band,
    .filter-panel,
    .detail-hero,
    .footer-grid,
    .large-ranking .rank-row {
        grid-template-columns: 1fr;
    }

    .search-band {
        margin-top: 22px;
    }

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

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

    .page-hero {
        padding: 34px;
    }

    .detail-poster {
        min-height: auto;
        aspect-ratio: 3 / 4;
    }

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

@media (max-width: 560px) {
    .movie-grid,
    .small-grid,
    .category-movie-grid,
    .category-grid {
        grid-template-columns: 1fr;
    }

    .rank-row {
        grid-template-columns: 48px 74px 1fr;
    }

    .rank-info p,
    .rank-meta span:nth-child(3) {
        display: none;
    }

    .detail-hero,
    .story-card {
        padding: 20px;
    }

    .play-overlay span {
        width: 66px;
        height: 66px;
        font-size: 26px;
    }
}
