:root {
    color-scheme: dark;
    --bg: #020617;
    --panel: rgba(15, 23, 42, 0.82);
    --panel-strong: #0f172a;
    --line: rgba(148, 163, 184, 0.18);
    --text: #f8fafc;
    --muted: #cbd5e1;
    --soft: #94a3b8;
    --accent: #f59e0b;
    --accent-2: #2563eb;
    --accent-3: #ec4899;
    --radius: 24px;
    --shadow: 0 24px 80px rgba(2, 6, 23, 0.52);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
    background:
        radial-gradient(circle at top left, rgba(37, 99, 235, 0.22), transparent 34rem),
        radial-gradient(circle at top right, rgba(236, 72, 153, 0.2), transparent 28rem),
        var(--bg);
    color: var(--text);
    min-height: 100vh;
}

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

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

button,
input,
select {
    font: inherit;
}

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

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

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

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

.brand-mark {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 15px;
    background: linear-gradient(135deg, var(--accent), var(--accent-3));
    color: #111827;
    box-shadow: 0 10px 32px rgba(245, 158, 11, 0.28);
}

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

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

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

.nav-link:hover,
.nav-link.active {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    transform: translateY(-1px);
}

.menu-toggle {
    display: none;
    width: 42px;
    height: 42px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}

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

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

.hero-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transform: scale(1.02);
    transition: opacity 0.8s ease, transform 1.2s ease;
    pointer-events: none;
}

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

.hero-bg,
.detail-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.34;
    filter: saturate(1.12) contrast(1.04);
}

.hero-overlay,
.detail-cover {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(2, 6, 23, 0.96) 0%, rgba(2, 6, 23, 0.72) 44%, rgba(2, 6, 23, 0.36) 100%),
        linear-gradient(0deg, #020617 0%, transparent 44%);
}

.hero-content {
    position: relative;
    min-height: 650px;
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) 360px;
    align-items: center;
    gap: 64px;
    padding-top: 36px;
}

.hero-copy {
    max-width: 760px;
}

.kicker,
.hero-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--accent);
    font-size: 0.85rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.hero-copy h1,
.page-hero h1,
.detail-copy h1 {
    margin: 16px 0;
    font-size: clamp(2.25rem, 5vw, 5.4rem);
    line-height: 0.98;
    font-weight: 950;
    letter-spacing: -0.06em;
}

.hero-copy p,
.page-hero p,
.detail-copy .one-line {
    color: var(--muted);
    font-size: 1.08rem;
    line-height: 1.8;
}

.hero-tags,
.tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 18px;
}

.hero-tags span,
.tag-row span {
    padding: 6px 10px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: #e2e8f0;
    font-size: 0.78rem;
}

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

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 20px;
    border-radius: 999px;
    font-weight: 800;
    border: 1px solid rgba(255, 255, 255, 0.16);
    transition: transform 0.2s ease, background 0.2s ease, border 0.2s ease;
}

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

.btn.primary {
    background: linear-gradient(135deg, var(--accent), #f97316);
    color: #111827;
    border-color: transparent;
    box-shadow: 0 14px 38px rgba(245, 158, 11, 0.3);
}

.btn.ghost {
    background: rgba(255, 255, 255, 0.09);
    color: #fff;
}

.hero-poster {
    display: block;
    border-radius: 32px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.08);
    box-shadow: var(--shadow);
    transform: rotate(2deg);
    border: 1px solid rgba(255, 255, 255, 0.14);
}

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

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

.hero-dots button {
    width: 34px;
    height: 5px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.28);
    cursor: pointer;
}

.hero-dots button.active {
    background: var(--accent);
}

.intro-search {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
    gap: 28px;
    align-items: end;
    padding: 54px 0 16px;
}

.intro-copy h2,
.section-heading h2,
.rank-header h2 {
    margin: 8px 0 0;
    font-size: clamp(1.6rem, 3vw, 2.7rem);
    line-height: 1.1;
    letter-spacing: -0.04em;
}

.intro-copy p,
.section-heading p,
.site-footer p,
.category-overview-card p {
    color: var(--muted);
    line-height: 1.8;
}

.home-search,
.filter-panel {
    display: flex;
    gap: 10px;
    padding: 10px;
    border-radius: 24px;
    background: rgba(15, 23, 42, 0.72);
    border: 1px solid var(--line);
    box-shadow: 0 16px 42px rgba(2, 6, 23, 0.34);
}

.home-search input,
.filter-panel input,
.filter-panel select {
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    padding: 12px 14px;
    outline: none;
}

.home-search button {
    border: 0;
    border-radius: 16px;
    background: var(--accent);
    color: #111827;
    padding: 0 22px;
    font-weight: 900;
    cursor: pointer;
}

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

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

.section-link {
    display: inline-flex;
    align-items: center;
    color: var(--accent);
    font-weight: 800;
    white-space: nowrap;
}

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

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

.movie-card {
    overflow: hidden;
    border-radius: var(--radius);
    background: rgba(15, 23, 42, 0.74);
    border: 1px solid var(--line);
    box-shadow: 0 14px 34px rgba(2, 6, 23, 0.22);
    transition: transform 0.2s ease, border 0.2s ease, box-shadow 0.2s ease;
}

.movie-card:hover {
    transform: translateY(-5px);
    border-color: rgba(245, 158, 11, 0.48);
    box-shadow: 0 26px 56px rgba(2, 6, 23, 0.38);
}

.poster-link,
.poster-frame {
    display: block;
    position: relative;
}

.poster-frame {
    aspect-ratio: 3 / 4.18;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.9), rgba(15, 23, 42, 0.6));
}

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

.movie-card:hover .poster-frame img,
.category-tile:hover img,
.top-rank-card:hover img {
    transform: scale(1.07);
}

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

.play-mini {
    position: absolute;
    right: 12px;
    bottom: 12px;
    z-index: 2;
    padding: 7px 12px;
    border-radius: 999px;
    background: var(--accent);
    color: #111827;
    font-weight: 900;
    font-size: 0.8rem;
}

.rank-badge {
    position: absolute;
    left: 12px;
    top: 12px;
    z-index: 2;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--accent-3), var(--accent));
    color: #111827;
}

.card-body {
    padding: 16px;
}

.card-meta,
.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    color: var(--soft);
    font-size: 0.78rem;
}

.card-meta span,
.detail-meta span {
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
}

.card-body h3 {
    margin: 12px 0 8px;
    font-size: 1.02rem;
    line-height: 1.35;
}

.card-body p {
    margin: 0;
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.65;
}

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

.category-tile {
    position: relative;
    min-height: 176px;
    overflow: hidden;
    border-radius: 24px;
    border: 1px solid var(--line);
    background: rgba(15, 23, 42, 0.7);
    padding: 16px;
    display: flex;
    flex-direction: column;
    justify-content: end;
}

.category-tile img {
    position: absolute;
    inset: 0;
    opacity: 0.32;
}

.category-tile::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(2, 6, 23, 0.92), rgba(2, 6, 23, 0.24));
}

.category-tile span,
.category-tile em {
    position: relative;
    z-index: 2;
}

.category-tile span {
    font-size: 1.2rem;
    font-weight: 900;
}

.category-tile em {
    margin-top: 8px;
    color: var(--muted);
    font-style: normal;
    line-height: 1.5;
    font-size: 0.86rem;
}

.split-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 330px;
    gap: 26px;
    align-items: start;
}

.rank-panel {
    position: sticky;
    top: 92px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(15, 23, 42, 0.76);
    padding: 20px;
    box-shadow: var(--shadow);
}

.rank-header {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.rank-header a {
    color: var(--accent);
    font-weight: 800;
}

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

.rank-list a {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.06);
}

.rank-list b,
.rank-num {
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: rgba(245, 158, 11, 0.16);
    color: var(--accent);
    font-weight: 950;
}

.rank-list span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rank-list em {
    color: var(--soft);
    font-style: normal;
    font-size: 0.8rem;
}

.page-main {
    padding: 48px 0;
}

.page-hero {
    position: relative;
    overflow: hidden;
    border-radius: 36px;
    padding: clamp(30px, 6vw, 70px);
    background:
        linear-gradient(135deg, rgba(37, 99, 235, 0.26), rgba(236, 72, 153, 0.16)),
        rgba(15, 23, 42, 0.78);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    margin-bottom: 30px;
}

.page-hero h1 {
    font-size: clamp(2.1rem, 4vw, 4.6rem);
}

.filter-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 180px 220px;
    align-items: end;
    margin: 24px 0;
}

.filter-panel label {
    display: grid;
    gap: 7px;
    color: var(--soft);
    font-size: 0.82rem;
    font-weight: 800;
}

.filter-panel select option {
    background: #0f172a;
    color: #fff;
}

.empty-state {
    display: none;
    color: var(--muted);
    text-align: center;
    padding: 30px;
    border: 1px solid var(--line);
    border-radius: 20px;
}

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

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

.category-overview-card {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr);
    gap: 22px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(15, 23, 42, 0.74);
}

.category-cover-stack {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
    height: 210px;
}

.category-cover-stack img {
    min-width: 0;
    border-radius: 14px;
    background: #0f172a;
}

.category-overview-card h2 {
    margin: 8px 0;
    font-size: 1.65rem;
}

.top-rank-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 26px;
}

.top-rank-card {
    position: relative;
    min-height: 360px;
    overflow: hidden;
    border-radius: 28px;
    padding: 22px;
    display: flex;
    flex-direction: column;
    justify-content: end;
    border: 1px solid var(--line);
}

.top-rank-card img {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.top-rank-card::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(2, 6, 23, 0.95), rgba(2, 6, 23, 0.1));
}

.top-rank-card span,
.top-rank-card h2,
.top-rank-card p {
    position: relative;
    z-index: 2;
}

.top-rank-card span {
    color: var(--accent);
    font-weight: 950;
}

.top-rank-card h2 {
    margin: 10px 0;
    font-size: 1.7rem;
}

.top-rank-card p {
    margin: 0;
    color: var(--muted);
    line-height: 1.65;
}

.rank-rows {
    display: grid;
    gap: 12px;
}

.rank-row {
    display: grid;
    grid-template-columns: 52px 82px minmax(0, 1fr) 80px;
    align-items: center;
    gap: 16px;
    padding: 12px;
}

.rank-num {
    width: 42px;
    height: 42px;
}

.rank-thumb {
    height: 110px;
    border-radius: 16px;
    overflow: hidden;
    background: #0f172a;
}

.rank-info h3 {
    margin: 0 0 8px;
    font-size: 1.1rem;
}

.rank-info p {
    margin: 0 0 10px;
    color: var(--muted);
    line-height: 1.55;
}

.rank-row strong {
    color: var(--accent);
    font-size: 1.1rem;
}

.detail-main {
    padding-bottom: 46px;
}

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

.detail-hero-inner {
    position: relative;
    z-index: 2;
    padding: 38px 0 62px;
}

.breadcrumb,
.breadcrumb-sep {
    color: var(--muted);
    font-size: 0.9rem;
}

.detail-grid {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 44px;
    align-items: center;
    margin-top: 34px;
}

.detail-poster {
    aspect-ratio: 3 / 4.22;
    overflow: hidden;
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    box-shadow: var(--shadow);
    background: #0f172a;
}

.detail-copy h1 {
    font-size: clamp(2.2rem, 5vw, 4.6rem);
}

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

.player-section {
    margin-top: -84px;
    position: relative;
    z-index: 4;
}

.video-shell {
    position: relative;
    overflow: hidden;
    border-radius: 30px;
    background: #000;
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: var(--shadow);
    aspect-ratio: 16 / 9;
}

.video-shell video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
}

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

.play-overlay span {
    width: 86px;
    height: 86px;
    display: grid;
    place-items: center;
    padding-left: 5px;
    border-radius: 50%;
    background: var(--accent);
    color: #111827;
    font-size: 2rem;
    box-shadow: 0 18px 42px rgba(245, 158, 11, 0.34);
}

.play-overlay em {
    font-style: normal;
    font-size: 1.05rem;
    font-weight: 900;
}

.video-shell.is-playing .play-overlay {
    display: none;
}

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

.content-card {
    padding: 28px;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: rgba(15, 23, 42, 0.74);
}

.content-card h2 {
    margin: 0 0 16px;
    font-size: 1.45rem;
}

.content-card p {
    margin: 0;
    color: var(--muted);
    line-height: 1.9;
}

.site-footer {
    border-top: 1px solid var(--line);
    background: rgba(2, 6, 23, 0.82);
    padding: 34px 0;
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    color: var(--muted);
}

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

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

    .split-layout,
    .intro-search {
        grid-template-columns: 1fr;
    }

    .rank-panel {
        position: static;
    }
}

@media (max-width: 820px) {
    .menu-toggle {
        display: block;
    }

    .site-nav {
        position: absolute;
        top: 72px;
        left: 16px;
        right: 16px;
        display: none;
        flex-direction: column;
        align-items: stretch;
        padding: 14px;
        border: 1px solid var(--line);
        border-radius: 22px;
        background: rgba(15, 23, 42, 0.96);
        box-shadow: var(--shadow);
    }

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

    .hero-content,
    .detail-grid,
    .detail-content,
    .category-overview-card,
    .category-overview-grid,
    .top-rank-grid {
        grid-template-columns: 1fr;
    }

    .hero-content {
        gap: 28px;
        padding: 92px 0 84px;
    }

    .hero-poster {
        max-width: 260px;
        transform: rotate(0deg);
    }

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

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

    .rank-row {
        grid-template-columns: 40px 70px minmax(0, 1fr);
    }

    .rank-row strong {
        display: none;
    }

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

    .player-section {
        margin-top: -38px;
    }

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

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

    .hero-carousel,
    .hero-content {
        min-height: 620px;
    }

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

    .home-search {
        flex-direction: column;
    }

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

    .page-main {
        padding: 30px 0;
    }

    .page-hero {
        border-radius: 26px;
    }
}
