:root {
    color-scheme: dark;
    --bg: #020617;
    --bg-soft: #0f172a;
    --panel: rgba(15, 23, 42, 0.84);
    --panel-strong: #111827;
    --text: #f8fafc;
    --muted: #94a3b8;
    --line: rgba(148, 163, 184, 0.22);
    --accent: #10b981;
    --accent-strong: #059669;
    --accent-soft: rgba(16, 185, 129, 0.16);
    --gold: #f59e0b;
    --radius: 18px;
    --shadow: 0 24px 80px rgba(0, 0, 0, 0.38);
    --container: min(1180px, calc(100% - 32px));
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(16, 185, 129, 0.14), transparent 36rem),
        linear-gradient(180deg, #020617 0%, #0f172a 42%, #020617 100%);
    font-family: Inter, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}

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

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

button,
input {
    font: inherit;
}

button {
    cursor: pointer;
}

.container {
    width: var(--container);
    margin: 0 auto;
}

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

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

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

.brand-icon {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    color: #ffffff;
    background: linear-gradient(135deg, var(--accent), #22d3ee);
    box-shadow: 0 0 32px rgba(16, 185, 129, 0.28);
}

.brand-text {
    display: grid;
    line-height: 1.18;
}

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

.brand-text em {
    color: var(--accent);
    font-size: 12px;
    font-style: normal;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 28px;
}

.nav-link {
    color: #cbd5e1;
    font-weight: 600;
    transition: color 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
    color: var(--accent);
}

.menu-toggle {
    display: none;
    color: var(--text);
    background: rgba(15, 23, 42, 0.82);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 8px 12px;
}

.mobile-nav {
    display: none;
    border-top: 1px solid var(--line);
    padding: 12px 16px 16px;
    background: rgba(2, 6, 23, 0.96);
}

.mobile-nav a {
    display: block;
    padding: 12px 0;
    color: #cbd5e1;
}

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

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

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

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

.hero-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.02);
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(0, 0, 0, 0.86) 0%, rgba(0, 0, 0, 0.54) 42%, rgba(0, 0, 0, 0.10) 100%),
        linear-gradient(180deg, transparent 38%, #020617 100%);
}

.hero-content {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
}

.hero-copy {
    max-width: 680px;
    padding-top: 28px;
}

.hero-tags,
.card-meta,
.detail-tags-list,
.tag-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.hero-tags span,
.detail-tags-list span,
.tag-row span,
.card-meta span {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 5px 10px;
    color: #d1fae5;
    background: rgba(16, 185, 129, 0.18);
    border: 1px solid rgba(16, 185, 129, 0.26);
    font-size: 12px;
}

.hero-copy h1 {
    margin: 20px 0 16px;
    font-size: clamp(42px, 7vw, 80px);
    line-height: 1;
    letter-spacing: -0.05em;
}

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

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

.primary-btn,
.ghost-btn,
.text-btn,
.search-form button,
.search-page-box button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    border: 0;
    font-weight: 700;
}

.primary-btn,
.search-form button,
.search-page-box button {
    min-height: 46px;
    padding: 0 24px;
    color: #ffffff;
    background: linear-gradient(135deg, var(--accent), var(--accent-strong));
    box-shadow: 0 16px 36px rgba(16, 185, 129, 0.22);
}

.ghost-btn {
    min-height: 46px;
    padding: 0 22px;
    color: #e2e8f0;
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid var(--line);
}

.text-btn {
    color: var(--accent);
    padding: 0;
}

.hero-controls {
    position: absolute;
    left: 50%;
    bottom: 34px;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 14px;
    z-index: 5;
}

.hero-prev,
.hero-next {
    width: 44px;
    height: 44px;
    color: var(--text);
    background: rgba(15, 23, 42, 0.68);
    border: 1px solid var(--line);
    border-radius: 50%;
    font-size: 28px;
}

.hero-dots {
    display: flex;
    gap: 8px;
}

.hero-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 0;
    background: rgba(226, 232, 240, 0.4);
}

.hero-dot.active {
    width: 28px;
    border-radius: 999px;
    background: var(--accent);
}

.search-band,
.content-section,
.split-section,
.detail-section,
.player-section {
    margin-top: 44px;
}

.search-band {
    display: grid;
    grid-template-columns: 1fr minmax(280px, 480px);
    gap: 28px;
    align-items: center;
    padding: 26px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(15, 23, 42, 0.78);
    box-shadow: var(--shadow);
}

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

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

.search-form,
.search-page-box,
.local-filter {
    display: flex;
    gap: 10px;
}

.search-form input,
.search-page-box input,
.local-filter input,
.filter-input {
    width: 100%;
    min-height: 46px;
    color: var(--text);
    background: rgba(2, 6, 23, 0.68);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 0 18px;
    outline: none;
}

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

.section-kicker {
    display: inline-flex;
    margin-bottom: 8px;
    color: var(--accent);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

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

.section-head p {
    margin: 8px 0 0;
}

.section-link {
    color: var(--accent);
    font-weight: 700;
    white-space: nowrap;
}

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

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

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

.movie-card {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(15, 23, 42, 0.78);
    box-shadow: 0 18px 46px rgba(0, 0, 0, 0.22);
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.movie-card:hover {
    transform: translateY(-6px);
    border-color: rgba(16, 185, 129, 0.42);
    box-shadow: 0 24px 60px rgba(16, 185, 129, 0.13);
}

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

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

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

.poster-shade {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 50%, rgba(0, 0, 0, 0.78) 100%);
    opacity: 0.88;
}

.play-mark {
    position: absolute;
    top: 50%;
    left: 50%;
    display: grid;
    place-items: center;
    width: 54px;
    height: 54px;
    color: #ffffff;
    background: rgba(16, 185, 129, 0.92);
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0.82);
    opacity: 0;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.movie-card:hover .play-mark {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.movie-card-body {
    padding: 16px;
}

.card-meta {
    margin-bottom: 10px;
}

.card-meta span {
    color: #cbd5e1;
    background: rgba(30, 41, 59, 0.8);
    border-color: rgba(148, 163, 184, 0.18);
}

.movie-card h3 {
    margin: 0 0 10px;
    font-size: 18px;
    line-height: 1.35;
}

.movie-card p {
    min-height: 48px;
    margin: 0 0 14px;
    color: var(--muted);
    line-height: 1.6;
    font-size: 14px;
}

.tag-row span {
    color: #a7f3d0;
    font-size: 11px;
}

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

.category-tile,
.category-card-main {
    display: grid;
    gap: 18px;
    padding: 22px;
    min-height: 210px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background:
        radial-gradient(circle at top right, rgba(16, 185, 129, 0.22), transparent 180px),
        rgba(15, 23, 42, 0.8);
}

.category-tile span,
.category-card h2 {
    font-size: 24px;
    font-weight: 800;
}

.category-tile strong {
    color: var(--muted);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.7;
}

.tile-posters,
.category-card-posters {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    min-height: 82px;
}

.tile-posters img,
.category-card-posters img {
    width: 58px;
    height: 82px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    transform: rotate(-3deg);
}

.tile-posters img:nth-child(2),
.category-card-posters img:nth-child(2) {
    transform: translateY(-8px) rotate(3deg);
}

.tile-posters img:nth-child(3),
.category-card-posters img:nth-child(3) {
    transform: rotate(5deg);
}

.split-section {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 26px;
    align-items: start;
}

.compact-section {
    margin-top: 0;
}

.rank-panel {
    position: sticky;
    top: 94px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 22px;
    background: rgba(15, 23, 42, 0.82);
}

.small-head {
    margin-bottom: 14px;
}

.small-head h2 {
    font-size: 24px;
}

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

.rank-list a {
    display: grid;
    grid-template-columns: 42px 1fr;
    gap: 10px;
    align-items: center;
    padding: 12px;
    border-radius: 14px;
    background: rgba(2, 6, 23, 0.4);
}

.rank-list span {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    color: #0f172a;
    background: var(--accent);
    font-weight: 900;
}

.rank-list strong,
.rank-list em {
    display: block;
}

.rank-list em {
    color: var(--muted);
    font-size: 12px;
    font-style: normal;
}

.page-hero,
.detail-head {
    padding: 72px 0 30px;
    background:
        radial-gradient(circle at 15% 0%, rgba(16, 185, 129, 0.2), transparent 320px),
        linear-gradient(180deg, rgba(15, 23, 42, 0.72), transparent 100%);
}

.slim-hero {
    padding-bottom: 48px;
}

.page-hero h1,
.detail-copy h1 {
    font-size: clamp(38px, 6vw, 64px);
    line-height: 1.05;
    letter-spacing: -0.04em;
}

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

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

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

.local-filter {
    max-width: 460px;
    margin-top: 24px;
}

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

.detail-poster {
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 24px;
    box-shadow: var(--shadow);
}

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

.detail-copy .lead-text {
    max-width: 760px;
    color: #dbeafe;
    font-size: 18px;
    line-height: 1.8;
}

.detail-tags-list {
    margin: 22px 0 26px;
}

.player-section {
    scroll-margin-top: 92px;
}

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

.movie-player {
    display: block;
    width: 100%;
    height: 100%;
    background: #000000;
}

.play-action {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    color: #ffffff;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.22), rgba(0, 0, 0, 0.58));
    border: 0;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.play-action span {
    display: grid;
    place-items: center;
    width: 82px;
    height: 82px;
    border-radius: 50%;
    background: rgba(16, 185, 129, 0.94);
    box-shadow: 0 0 0 18px rgba(16, 185, 129, 0.12);
    font-size: 30px;
}

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

.play-status {
    position: absolute;
    left: 18px;
    bottom: 18px;
    color: #e2e8f0;
    font-size: 14px;
}

.detail-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

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

.story-card p {
    margin: 12px 0 0;
}

.ranking-section {
    display: grid;
    gap: 18px;
}

.ranking-row {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 20px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(15, 23, 42, 0.76);
}

.ranking-poster {
    position: relative;
    overflow: hidden;
    border-radius: 16px;
}

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

.ranking-poster span {
    position: absolute;
    top: 8px;
    left: 8px;
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    color: #020617;
    background: var(--gold);
    font-weight: 900;
}

.ranking-info h2 {
    margin: 10px 0;
    font-size: 24px;
}

.search-page-box {
    max-width: 680px;
    margin-top: 24px;
}

.result-info {
    margin-bottom: 20px;
    color: var(--muted);
    font-weight: 700;
}

.site-footer {
    margin-top: 72px;
    padding: 42px 0 24px;
    border-top: 1px solid var(--line);
    background: rgba(2, 6, 23, 0.88);
}

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

.footer-brand {
    margin-bottom: 14px;
}

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

.site-footer a:not(.brand) {
    display: block;
    margin: 8px 0;
    color: var(--muted);
}

.site-footer a:hover {
    color: var(--accent);
}

.footer-bottom {
    width: var(--container);
    margin: 28px auto 0;
    padding-top: 18px;
    color: var(--muted);
    border-top: 1px solid var(--line);
    font-size: 14px;
    text-align: center;
}

.hidden-by-filter {
    display: none !important;
}

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

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

    .split-section {
        grid-template-columns: 1fr;
    }

    .rank-panel {
        position: static;
    }
}

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

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

    .hero-carousel {
        height: 74vh;
        min-height: 560px;
    }

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

    .search-band,
    .detail-layout,
    .detail-section,
    .footer-grid {
        grid-template-columns: 1fr;
    }

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

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

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

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

    .brand-text strong {
        font-size: 17px;
    }

    .hero-carousel {
        min-height: 590px;
    }

    .hero-copy h1,
    .page-hero h1,
    .detail-copy h1 {
        font-size: 38px;
    }

    .hero-actions,
    .search-form,
    .search-page-box {
        flex-direction: column;
    }

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

    .ranking-row {
        grid-template-columns: 96px 1fr;
    }
}
