:root {
    color-scheme: dark;
    --bg-1: #020617;
    --bg-2: #0f172a;
    --panel: rgba(15, 23, 42, 0.74);
    --panel-strong: rgba(15, 23, 42, 0.92);
    --border: rgba(148, 163, 184, 0.18);
    --text: #f8fafc;
    --muted: #94a3b8;
    --muted-2: #64748b;
    --emerald: #10b981;
    --emerald-soft: rgba(16, 185, 129, 0.18);
    --teal: #2dd4bf;
    --shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at 20% 5%, rgba(16, 185, 129, 0.16), transparent 28rem),
        radial-gradient(circle at 80% 0%, rgba(45, 212, 191, 0.12), transparent 26rem),
        linear-gradient(135deg, var(--bg-1), var(--bg-2) 48%, #020617);
    color: var(--text);
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    line-height: 1.6;
}

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

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

button,
input,
select {
    font: inherit;
}

.site-header {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 50;
    background: linear-gradient(180deg, rgba(2, 6, 23, 0.96), rgba(15, 23, 42, 0.82));
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(18px);
}

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

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

.brand span:last-child,
.footer-brand span:last-child {
    background: linear-gradient(90deg, #34d399, #5eead4);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 999px;
    background: rgba(16, 185, 129, 0.14);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.38);
    box-shadow: 0 0 30px rgba(16, 185, 129, 0.25);
    font-size: 13px;
}

.desktop-nav {
    display: flex;
    align-items: center;
    gap: 22px;
    color: #cbd5e1;
    font-size: 14px;
}

.desktop-nav a,
.mobile-nav a,
.footer-links a {
    transition: color 0.2s ease, transform 0.2s ease;
}

.desktop-nav a:hover,
.mobile-nav a:hover,
.footer-links a:hover {
    color: #34d399;
}

.nav-toggle {
    display: none;
    width: 42px;
    height: 42px;
    border: 1px solid var(--border);
    border-radius: 12px;
    color: #cbd5e1;
    background: rgba(15, 23, 42, 0.8);
}

.mobile-nav {
    display: none;
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto 14px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.96);
}

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

main {
    padding-top: 66px;
}

.hero {
    position: relative;
    height: 620px;
    overflow: hidden;
}

.hero-stage,
.hero-slide,
.hero-slide img,
.hero-shade {
    position: absolute;
    inset: 0;
}

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

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

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

.hero-shade {
    background:
        linear-gradient(90deg, rgba(2, 6, 23, 0.96) 0%, rgba(15, 23, 42, 0.88) 42%, rgba(15, 23, 42, 0.16) 100%),
        linear-gradient(0deg, rgba(2, 6, 23, 0.98) 0%, transparent 36%);
}

.hero-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: min(1180px, calc(100% - 32px));
    height: 100%;
    margin: 0 auto;
    max-width: 1180px;
}

.hero-content h1 {
    width: min(720px, 100%);
    margin: 0 0 18px;
    font-size: clamp(42px, 7vw, 72px);
    line-height: 1.05;
    letter-spacing: -0.04em;
}

.hero-text {
    width: min(650px, 100%);
    margin: 0 0 22px;
    color: #cbd5e1;
    font-size: clamp(17px, 2vw, 22px);
}

.eyebrow {
    margin: 0 0 12px;
    color: #34d399;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.tag-list,
.poster-tags,
.detail-meta,
.movie-meta,
.hero-actions,
.rail-actions,
.breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.tag-list span,
.poster-tags span {
    display: inline-flex;
    align-items: center;
    border: 1px solid rgba(16, 185, 129, 0.28);
    border-radius: 999px;
    background: rgba(16, 185, 129, 0.16);
    color: #a7f3d0;
}

.tag-list span {
    padding: 5px 12px;
    font-size: 13px;
}

.poster-tags {
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: 14px;
    z-index: 2;
}

.poster-tags span {
    padding: 4px 8px;
    font-size: 11px;
}

.hero-actions {
    margin-top: 30px;
}

.primary-btn,
.ghost-btn,
.search-form button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 22px;
    border: 0;
    border-radius: 999px;
    cursor: pointer;
    font-weight: 800;
    transition: transform 0.22s ease, box-shadow 0.22s ease, background 0.22s ease;
}

.primary-btn,
.search-form button {
    background: linear-gradient(90deg, var(--emerald), var(--teal));
    color: white;
    box-shadow: 0 14px 38px rgba(16, 185, 129, 0.28);
}

.ghost-btn {
    border: 1px solid var(--border);
    background: rgba(15, 23, 42, 0.7);
    color: #e2e8f0;
}

.primary-btn:hover,
.ghost-btn:hover,
.search-form button:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 45px rgba(16, 185, 129, 0.34);
}

.hero-nav {
    position: absolute;
    top: 50%;
    z-index: 5;
    width: 46px;
    height: 46px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: rgba(2, 6, 23, 0.7);
    color: #f8fafc;
    cursor: pointer;
    transform: translateY(-50%);
    transition: background 0.22s ease, color 0.22s ease;
}

.hero-nav:hover {
    background: rgba(16, 185, 129, 0.8);
}

.hero-prev {
    left: 24px;
}

.hero-next {
    right: 24px;
}

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

.hero-dot {
    width: 10px;
    height: 10px;
    border: 0;
    border-radius: 999px;
    background: #475569;
    cursor: pointer;
    transition: width 0.22s ease, background 0.22s ease;
}

.hero-dot.active {
    width: 34px;
    background: #10b981;
}

.search-strip,
.content-section,
.filter-panel,
.archive-hero,
.detail-wrap {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
}

.search-strip {
    display: grid;
    grid-template-columns: 1fr minmax(280px, 520px);
    gap: 28px;
    align-items: center;
    margin-top: -52px;
    padding: 28px;
    border: 1px solid var(--border);
    border-radius: 28px;
    background: rgba(15, 23, 42, 0.84);
    box-shadow: var(--shadow);
    position: relative;
    z-index: 10;
    backdrop-filter: blur(20px);
}

.search-strip p,
.section-heading p {
    margin: 0 0 6px;
    color: #34d399;
    font-weight: 800;
}

.search-strip h2,
.section-heading h2 {
    margin: 0;
    font-size: clamp(24px, 3vw, 34px);
}

.search-form,
.filter-panel {
    display: flex;
    gap: 12px;
}

.search-form input,
.filter-panel input,
.filter-panel select {
    width: 100%;
    min-height: 46px;
    border: 1px solid var(--border);
    border-radius: 999px;
    outline: none;
    background: rgba(2, 6, 23, 0.82);
    color: #f8fafc;
    padding: 0 16px;
}

.search-form input:focus,
.filter-panel input:focus,
.filter-panel select:focus {
    border-color: rgba(16, 185, 129, 0.72);
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.12);
}

.content-section {
    padding: 70px 0 0;
}

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

.section-heading.with-actions {
    align-items: center;
}

.section-link {
    color: #34d399;
    font-weight: 800;
}

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

.category-chip,
.category-card,
.movie-card,
.detail-card,
.player-shell,
.rank-list {
    border: 1px solid var(--border);
    background: var(--panel);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18);
    backdrop-filter: blur(18px);
}

.category-chip {
    display: block;
    min-height: 108px;
    padding: 18px;
    border-radius: 20px;
    transition: transform 0.22s ease, border-color 0.22s ease, background 0.22s ease;
}

.category-chip:hover,
.movie-card:hover,
.category-card:hover {
    transform: translateY(-5px);
    border-color: rgba(16, 185, 129, 0.54);
    background: rgba(15, 23, 42, 0.9);
}

.category-chip span {
    display: block;
    margin-bottom: 8px;
    font-size: 18px;
    font-weight: 900;
}

.category-chip small {
    color: var(--muted);
}

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

.movie-card {
    overflow: hidden;
    border-radius: 18px;
    transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease, background 0.22s ease;
}

.movie-card:hover {
    box-shadow: 0 26px 70px rgba(16, 185, 129, 0.12);
}

.poster-wrap {
    position: relative;
    display: block;
    height: 286px;
    overflow: hidden;
    background: linear-gradient(145deg, rgba(16, 185, 129, 0.18), rgba(15, 23, 42, 0.9));
}

.compact-card .poster-wrap {
    height: 240px;
}

.poster-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease, filter 0.5s ease;
}

.poster-wrap::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(2, 6, 23, 0.92), rgba(2, 6, 23, 0.12) 62%, transparent);
}

.movie-card:hover img {
    transform: scale(1.08);
    filter: saturate(1.12);
}

.movie-info {
    padding: 16px;
}

.movie-info h2 {
    margin: 0 0 9px;
    font-size: 18px;
    line-height: 1.3;
}

.movie-info h2 a:hover {
    color: #34d399;
}

.movie-info p {
    display: -webkit-box;
    margin: 0 0 14px;
    min-height: 45px;
    color: var(--muted);
    font-size: 14px;
    overflow: hidden;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.movie-meta,
.detail-meta {
    color: var(--muted-2);
    font-size: 13px;
}

.movie-meta span,
.detail-meta span {
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.09);
}

.movie-rail {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(230px, 260px);
    gap: 22px;
    overflow-x: auto;
    padding: 6px 0 18px;
    scrollbar-width: thin;
}

.rail-actions button {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.9);
    color: #f8fafc;
    cursor: pointer;
}

.rail-actions button:hover {
    background: rgba(16, 185, 129, 0.72);
}

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

.rank-list {
    border-radius: 22px;
    overflow: hidden;
}

.rank-row {
    display: grid;
    grid-template-columns: 46px 1fr auto;
    gap: 14px;
    align-items: center;
    padding: 15px 18px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.rank-row:hover {
    background: rgba(16, 185, 129, 0.1);
}

.rank-num,
.rank-badge {
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: linear-gradient(135deg, #10b981, #2dd4bf);
    color: white;
    font-weight: 900;
}

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

.rank-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 3;
    width: 42px;
    height: 42px;
    box-shadow: 0 14px 34px rgba(16, 185, 129, 0.28);
}

.rank-title {
    font-weight: 800;
}

.rank-meta {
    color: var(--muted);
    font-size: 13px;
}

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

.archive-hero {
    margin-top: 36px;
    padding: 56px;
    border: 1px solid var(--border);
    border-radius: 34px;
    background:
        linear-gradient(135deg, rgba(16, 185, 129, 0.15), transparent 40%),
        rgba(15, 23, 42, 0.78);
    box-shadow: var(--shadow);
}

.archive-hero h1 {
    margin: 0 0 16px;
    font-size: clamp(34px, 6vw, 58px);
    line-height: 1.08;
}

.archive-hero p:last-child {
    margin: 0;
    max-width: 760px;
    color: #cbd5e1;
    font-size: 18px;
}

.breadcrumb {
    margin-top: 22px;
    color: var(--muted);
    font-size: 14px;
}

.breadcrumb a {
    color: #34d399;
}

.filter-panel {
    margin-top: 26px;
    padding: 18px;
    border-radius: 24px;
    background: var(--panel);
    border: 1px solid var(--border);
}

.empty-state {
    display: none;
    padding: 42px;
    text-align: center;
    color: var(--muted);
}

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

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

.category-card {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    gap: 18px;
    padding: 24px;
    border-radius: 24px;
    transition: transform 0.22s ease, border-color 0.22s ease, background 0.22s ease;
}

.category-main span {
    color: #34d399;
    font-weight: 800;
}

.category-main h2 {
    margin: 8px 0 10px;
    font-size: 26px;
}

.category-main p,
.category-sample span {
    color: var(--muted);
}

.category-sample {
    display: grid;
    gap: 8px;
}

.category-sample a {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(2, 6, 23, 0.36);
    color: #e2e8f0;
    font-size: 14px;
}

.category-sample a:hover {
    color: #34d399;
}

.detail-wrap {
    padding: 34px 0 76px;
}

.detail-wrap .breadcrumb {
    margin: 0 0 22px;
}

.player-shell {
    width: 100%;
    margin-bottom: 28px;
    padding: 10px;
    border-radius: 24px;
}

.player-frame {
    position: relative;
    overflow: hidden;
    border-radius: 18px;
    background: #000;
    box-shadow: var(--shadow);
}

.player-frame video {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
}

.play-cover {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    gap: 10px;
    border: 0;
    background: linear-gradient(0deg, rgba(2, 6, 23, 0.62), rgba(2, 6, 23, 0.18));
    color: white;
    cursor: pointer;
    transition: opacity 0.22s ease, visibility 0.22s ease;
}

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

.play-icon {
    display: grid;
    place-items: center;
    width: 74px;
    height: 74px;
    border-radius: 999px;
    background: linear-gradient(135deg, #10b981, #2dd4bf);
    box-shadow: 0 18px 50px rgba(16, 185, 129, 0.4);
    font-size: 24px;
}

.detail-card {
    display: grid;
    grid-template-columns: 290px minmax(0, 1fr);
    gap: 28px;
    padding: 28px;
    border-radius: 26px;
}

.detail-poster {
    overflow: hidden;
    border-radius: 18px;
    background: linear-gradient(145deg, rgba(16, 185, 129, 0.18), rgba(15, 23, 42, 0.9));
}

.detail-poster img {
    width: 100%;
    height: 430px;
    object-fit: cover;
}

.detail-info h1 {
    margin: 0 0 16px;
    font-size: clamp(30px, 4vw, 48px);
    line-height: 1.15;
}

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

.detail-info p {
    margin: 0;
    color: #cbd5e1;
    font-size: 16px;
}

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

.related-section {
    width: 100%;
}

.site-footer {
    margin-top: 70px;
    border-top: 1px solid rgba(148, 163, 184, 0.14);
    background: rgba(2, 6, 23, 0.62);
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr 0.8fr;
    gap: 40px;
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 46px 0;
}

.footer-grid p {
    max-width: 460px;
    color: var(--muted);
}

.footer-grid h2 {
    margin: 0 0 16px;
    font-size: 18px;
}

.footer-links {
    display: grid;
    gap: 8px;
    color: #94a3b8;
    font-size: 14px;
}

.footer-bottom {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 20px 0 28px;
    border-top: 1px solid rgba(148, 163, 184, 0.1);
    color: var(--muted-2);
    text-align: center;
    font-size: 13px;
}

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

    .nav-toggle {
        display: grid;
        place-items: center;
    }

    .mobile-nav.open {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

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

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

@media (max-width: 760px) {
    .hero {
        height: 590px;
    }

    .hero-content {
        justify-content: end;
        padding-bottom: 86px;
    }

    .hero-nav {
        display: none;
    }

    .search-strip,
    .search-form,
    .filter-panel,
    .section-heading,
    .rank-row,
    .category-card {
        grid-template-columns: 1fr;
    }

    .search-strip,
    .filter-panel {
        display: grid;
    }

    .category-chip-grid,
    .movie-grid,
    .category-grid,
    .large-rank {
        grid-template-columns: 1fr;
    }

    .archive-hero {
        padding: 34px 24px;
    }

    .content-section {
        padding-top: 48px;
    }

    .poster-wrap {
        height: 330px;
    }

    .detail-card {
        padding: 18px;
    }

    .detail-poster img {
        height: 380px;
    }
}

@media (max-width: 480px) {
    .mobile-nav.open {
        grid-template-columns: 1fr;
    }

    .poster-wrap,
    .compact-card .poster-wrap {
        height: 300px;
    }

    .hero-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .primary-btn,
    .ghost-btn {
        width: 100%;
    }
}
