:root {
    color-scheme: dark;
    --bg: #020617;
    --panel: rgba(15, 23, 42, 0.82);
    --panel-strong: #0f172a;
    --line: rgba(148, 163, 184, 0.16);
    --text: #e2e8f0;
    --muted: #94a3b8;
    --soft: #cbd5e1;
    --brand: #34d399;
    --brand-2: #10b981;
    --gold: #fbbf24;
    --rose: #fb7185;
    --shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
    --radius: 24px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(16, 185, 129, 0.18), transparent 34rem),
        radial-gradient(circle at 85% 8%, rgba(59, 130, 246, 0.16), transparent 32rem),
        linear-gradient(135deg, #020617 0%, #0f172a 46%, #111827 100%);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
}

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

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

button,
input,
select {
    font: inherit;
}

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

.nav-shell {
    width: min(1220px, calc(100% - 32px));
    height: 68px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 24px;
}

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

.brand-mark {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    color: #022c22;
    background: linear-gradient(135deg, var(--brand), #a7f3d0);
    border-radius: 12px;
    box-shadow: 0 12px 30px rgba(16, 185, 129, 0.34);
}

.nav-search {
    flex: 1;
    max-width: 520px;
    display: flex;
    align-items: center;
    background: rgba(15, 23, 42, 0.86);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 4px;
}

.nav-search input,
.mobile-panel input,
.filter-bar input,
.filter-bar select {
    width: 100%;
    color: var(--text);
    background: transparent;
    border: 0;
    outline: 0;
}

.nav-search input {
    padding: 10px 14px;
}

.nav-search button,
.mobile-panel button,
.primary-btn,
.ghost-btn,
.filter-bar button {
    border: 0;
    cursor: pointer;
    border-radius: 999px;
    transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.nav-search button,
.primary-btn,
.filter-bar button {
    color: #022c22;
    background: linear-gradient(135deg, var(--brand), #a7f3d0);
    font-weight: 800;
    padding: 10px 18px;
}

.nav-search button:hover,
.mobile-panel button:hover,
.primary-btn:hover,
.filter-bar button:hover {
    transform: translateY(-1px);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 18px;
    color: var(--soft);
    font-size: 15px;
}

.nav-links a:hover,
.mobile-links a:hover,
.footer-grid a:hover {
    color: var(--brand);
}

.menu-toggle {
    display: none;
    color: #fff;
    background: rgba(148, 163, 184, 0.12);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 8px 12px;
}

.mobile-panel {
    display: none;
    width: min(1220px, calc(100% - 32px));
    margin: 0 auto 16px;
    padding: 14px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 18px;
}

.mobile-panel.is-open {
    display: block;
}

.mobile-panel form {
    display: flex;
    gap: 8px;
    padding: 8px;
    background: rgba(15, 23, 42, 0.86);
    border: 1px solid var(--line);
    border-radius: 18px;
}

.mobile-panel button {
    color: #022c22;
    background: var(--brand);
    font-weight: 800;
    padding: 8px 14px;
}

.mobile-links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 14px;
}

.mobile-links a {
    color: var(--soft);
    padding: 10px;
    background: rgba(148, 163, 184, 0.08);
    border-radius: 12px;
}

main {
    width: min(1220px, calc(100% - 32px));
    margin: 0 auto;
}

.hero {
    position: relative;
    min-height: 560px;
    margin: 24px auto 52px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 32px;
    box-shadow: var(--shadow);
    background: #0f172a;
}

.hero-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transform: scale(1.02);
    transition: opacity 0.6s ease, transform 1s ease;
}

.hero-slide.is-active {
    opacity: 1;
    transform: scale(1);
    z-index: 2;
}

.hero-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.56;
}

.hero-slide::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(2, 6, 23, 0.92) 0%, rgba(2, 6, 23, 0.70) 45%, rgba(2, 6, 23, 0.22) 100%),
        linear-gradient(0deg, rgba(2, 6, 23, 0.82), transparent 48%);
}

.hero-content {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: grid;
    align-content: center;
    max-width: 710px;
    padding: 72px;
}

.eyebrow {
    display: inline-flex;
    width: fit-content;
    gap: 8px;
    align-items: center;
    color: #bbf7d0;
    background: rgba(16, 185, 129, 0.13);
    border: 1px solid rgba(52, 211, 153, 0.26);
    border-radius: 999px;
    padding: 8px 13px;
    font-size: 14px;
    font-weight: 700;
}

.hero h1,
.page-hero h1,
.detail-title h1 {
    margin: 18px 0 14px;
    font-size: clamp(34px, 6vw, 66px);
    line-height: 1.05;
    letter-spacing: -0.06em;
}

.hero p {
    max-width: 620px;
    margin: 0;
    color: var(--soft);
    font-size: 18px;
    line-height: 1.8;
}

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

.ghost-btn {
    color: #fff;
    background: rgba(15, 23, 42, 0.60);
    border: 1px solid rgba(226, 232, 240, 0.20);
    font-weight: 800;
    padding: 10px 18px;
}

.ghost-btn:hover {
    border-color: rgba(52, 211, 153, 0.55);
    color: var(--brand);
}

.hero-dots {
    position: absolute;
    left: 72px;
    bottom: 42px;
    z-index: 4;
    display: flex;
    gap: 10px;
}

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

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

.hero-side {
    position: absolute;
    right: 36px;
    bottom: 36px;
    z-index: 4;
    width: min(360px, 36vw);
    display: grid;
    gap: 12px;
}

.hero-mini {
    display: grid;
    grid-template-columns: 72px 1fr;
    gap: 12px;
    padding: 10px;
    background: rgba(15, 23, 42, 0.72);
    border: 1px solid var(--line);
    border-radius: 18px;
    backdrop-filter: blur(14px);
}

.hero-mini img {
    width: 72px;
    height: 94px;
    object-fit: cover;
    border-radius: 12px;
}

.hero-mini strong {
    display: block;
    margin: 5px 0 6px;
}

.hero-mini span,
.movie-meta,
.rank-copy em,
.cat-meta,
.detail-meta,
.breadcrumb,
.footer-grid p,
.copyright {
    color: var(--muted);
}

.section,
.page-hero,
.detail-layout,
.player-card {
    margin-bottom: 46px;
}

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

.section-title h2,
.page-hero h1 {
    margin: 0;
    font-size: clamp(26px, 3vw, 38px);
}

.section-title p,
.page-hero p {
    margin: 8px 0 0;
    color: var(--muted);
    line-height: 1.8;
}

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

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

.movie-card:hover {
    transform: translateY(-4px);
    border-color: rgba(52, 211, 153, 0.46);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
}

.poster-wrap {
    position: relative;
    display: block;
    aspect-ratio: 2 / 3;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.28), rgba(30, 41, 59, 0.88));
}

.poster-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.poster-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    color: #022c22;
    background: rgba(167, 243, 208, 0.94);
    border-radius: 999px;
    padding: 5px 10px;
    font-size: 12px;
    font-weight: 800;
}

.movie-info {
    padding: 15px;
}

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

.movie-info h3 a:hover {
    color: var(--brand);
}

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

.movie-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    font-size: 12px;
}

.movie-meta span,
.tag-list span,
.detail-meta span {
    background: rgba(148, 163, 184, 0.10);
    border: 1px solid rgba(148, 163, 184, 0.13);
    border-radius: 999px;
    padding: 5px 9px;
}

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

.category-card {
    min-height: 176px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 20px;
    background:
        linear-gradient(135deg, rgba(16, 185, 129, 0.20), transparent),
        rgba(15, 23, 42, 0.82);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.category-card:hover {
    border-color: rgba(52, 211, 153, 0.42);
}

.category-card h2,
.category-card h3 {
    margin: 0 0 8px;
}

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

.cat-meta {
    display: flex;
    justify-content: space-between;
    margin-top: 18px;
    font-size: 14px;
}

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

.rank-item {
    display: grid;
    grid-template-columns: 48px 72px 1fr auto;
    align-items: center;
    gap: 14px;
    padding: 12px;
    background: rgba(15, 23, 42, 0.78);
    border: 1px solid var(--line);
    border-radius: 18px;
}

.rank-item:hover {
    border-color: rgba(52, 211, 153, 0.44);
}

.rank-num {
    color: var(--gold);
    font-weight: 900;
    font-size: 18px;
}

.rank-item img {
    width: 72px;
    height: 96px;
    object-fit: cover;
    border-radius: 12px;
}

.rank-copy strong {
    display: block;
    margin-bottom: 6px;
}

.rank-copy em {
    font-style: normal;
    font-size: 13px;
}

.rank-hot {
    color: #022c22;
    background: var(--brand);
    border-radius: 999px;
    padding: 6px 10px;
    font-weight: 900;
}

.filter-bar {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr auto;
    gap: 10px;
    margin-bottom: 22px;
    padding: 12px;
    background: rgba(15, 23, 42, 0.72);
    border: 1px solid var(--line);
    border-radius: 20px;
}

.filter-bar label {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 0 12px;
    background: rgba(2, 6, 23, 0.42);
    border: 1px solid var(--line);
    border-radius: 14px;
}

.filter-bar select {
    appearance: none;
}

.detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.6fr);
    gap: 28px;
    align-items: start;
}

.breadcrumb {
    margin: 22px 0;
    font-size: 14px;
}

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

.detail-title {
    margin-bottom: 20px;
}

.detail-title h1 {
    margin-top: 8px;
}

.detail-meta,
.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.player-card,
.detail-panel,
.side-panel {
    background: rgba(15, 23, 42, 0.78);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.player-card {
    overflow: hidden;
}

.video-box {
    position: relative;
    aspect-ratio: 16 / 9;
    background: #020617;
}

.video-box video {
    width: 100%;
    height: 100%;
    display: block;
    background: #020617;
}

.player-cover {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, rgba(2, 6, 23, 0.50), rgba(2, 6, 23, 0.86));
}

.video-box.is-playing .player-cover {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.play-trigger {
    width: 86px;
    height: 86px;
    border: 0;
    border-radius: 999px;
    color: #022c22;
    background: linear-gradient(135deg, var(--brand), #a7f3d0);
    font-size: 34px;
    cursor: pointer;
    box-shadow: 0 18px 60px rgba(16, 185, 129, 0.32);
}

.player-caption,
.detail-panel,
.side-panel {
    padding: 22px;
}

.player-caption h2,
.detail-panel h2,
.side-panel h2 {
    margin: 0 0 12px;
}

.detail-panel p {
    color: var(--soft);
    line-height: 1.9;
}

.side-panel {
    position: sticky;
    top: 92px;
}

.side-panel .movie-card {
    margin-bottom: 14px;
}

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

.footer-grid {
    width: min(1220px, calc(100% - 32px));
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 32px;
}

.footer-brand {
    margin-bottom: 12px;
    font-size: 24px;
    font-weight: 900;
}

.footer-grid h3 {
    margin: 0 0 12px;
}

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

.copyright {
    width: min(1220px, calc(100% - 32px));
    margin: 28px auto 0;
    padding-top: 18px;
    border-top: 1px solid var(--line);
    font-size: 14px;
}

.empty-state {
    display: none;
    padding: 28px;
    text-align: center;
    color: var(--muted);
    background: rgba(15, 23, 42, 0.78);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

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

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

    .hero-side {
        display: none;
    }

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

    .side-panel {
        position: static;
    }
}

@media (max-width: 780px) {
    .nav-search,
    .nav-links {
        display: none;
    }

    .menu-toggle {
        display: inline-flex;
        margin-left: auto;
    }

    .hero {
        min-height: 620px;
        margin-top: 16px;
        border-radius: 24px;
    }

    .hero-content {
        padding: 38px 24px;
        align-content: end;
    }

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

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

    .section-head,
    .page-hero {
        display: block;
    }

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

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

    .rank-item {
        grid-template-columns: 36px 62px 1fr;
    }

    .rank-hot {
        grid-column: 3;
        width: fit-content;
    }

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

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

    .brand span:last-child {
        max-width: 8em;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .hero h1,
    .page-hero h1,
    .detail-title h1 {
        font-size: 34px;
    }
}
