:root {
    --night-950: #080b10;
    --night-900: #0d1117;
    --night-850: #111820;
    --night-800: #161b22;
    --night-700: #21262d;
    --night-600: #30363d;
    --night-300: #c9d1d9;
    --night-200: #d8dee9;
    --night-100: #f0f6fc;
    --moss-800: #2a4227;
    --moss-700: #3a5937;
    --moss-600: #4d7348;
    --moss-500: #5f8e58;
    --moss-400: #7aaa73;
    --moss-300: #96c48f;
    --swamp-900: #121a16;
    --swamp-800: #1a2620;
    --swamp-700: #243329;
    --gold: #f2c14e;
    --text-muted: #8b949e;
    --shadow-swamp: 0 4px 20px rgba(45, 64, 51, 0.3);
    --shadow-swamp-lg: 0 10px 40px rgba(45, 64, 51, 0.4);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    background: var(--night-900);
    color: var(--night-100);
    line-height: 1.6;
}

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

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

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(13, 17, 23, 0.94);
    border-bottom: 1px solid var(--swamp-700);
    backdrop-filter: blur(16px);
}

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

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

.brand-mark {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: var(--moss-800);
    color: var(--moss-300);
    box-shadow: var(--shadow-swamp);
}

.brand-text {
    display: grid;
    gap: 1px;
}

.brand-text strong {
    color: var(--moss-300);
    font-size: 20px;
    letter-spacing: 0.02em;
}

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

.desktop-nav {
    display: flex;
    align-items: center;
    gap: 24px;
    color: var(--night-300);
    font-weight: 600;
}

.nav-link {
    transition: color 0.2s ease, transform 0.2s ease;
}

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

.nav-link:hover {
    transform: translateY(-1px);
}

.menu-toggle {
    display: none;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 12px;
    background: var(--night-700);
    color: var(--night-100);
    font-size: 22px;
}

.mobile-nav {
    display: none;
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto 12px;
    padding: 10px;
    border: 1px solid var(--swamp-700);
    border-radius: 18px;
    background: var(--night-800);
}

.mobile-nav.open {
    display: grid;
    gap: 4px;
}

.mobile-nav .nav-link {
    padding: 10px 12px;
    border-radius: 12px;
}

.mobile-nav .nav-link:hover,
.mobile-nav .nav-link.active {
    background: var(--swamp-800);
}

main {
    min-height: calc(100vh - 260px);
}

.hero {
    position: relative;
    height: min(800px, 74vh);
    min-height: 560px;
    overflow: hidden;
    background: var(--night-950);
}

.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-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    transform: scale(1.04);
    transition: transform 6s ease;
}

.hero-slide.active .hero-bg {
    transform: scale(1);
}

.hero-bg::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, var(--night-900) 0%, rgba(13, 17, 23, 0.82) 34%, rgba(13, 17, 23, 0.28) 72%, rgba(13, 17, 23, 0.18) 100%);
}

.hero-content {
    position: relative;
    z-index: 2;
    width: min(1180px, calc(100% - 32px));
    height: 100%;
    margin: 0 auto;
    display: flex;
    align-items: flex-end;
    padding-bottom: 78px;
}

.hero-copy {
    width: min(680px, 100%);
}

.hero-kicker,
.section-kicker,
.detail-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    padding: 6px 12px;
    border: 1px solid rgba(150, 196, 143, 0.28);
    border-radius: 999px;
    background: rgba(26, 38, 32, 0.74);
    color: var(--moss-300);
    font-size: 13px;
    font-weight: 700;
}

.hero h1 {
    margin: 0 0 18px;
    color: #fff;
    font-size: clamp(38px, 7vw, 72px);
    line-height: 1.05;
    letter-spacing: -0.04em;
}

.hero p {
    max-width: 640px;
    margin: 0 0 28px;
    color: var(--night-200);
    font-size: 18px;
}

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

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    padding: 0 22px;
    border: 1px solid transparent;
    border-radius: 999px;
    font-weight: 800;
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

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

.btn-primary {
    background: var(--moss-600);
    color: #fff;
    box-shadow: var(--shadow-swamp);
}

.btn-primary:hover {
    background: var(--moss-500);
}

.btn-ghost {
    border-color: var(--swamp-700);
    background: rgba(22, 27, 34, 0.7);
    color: var(--night-100);
}

.btn-ghost:hover {
    border-color: var(--moss-700);
    background: rgba(26, 38, 32, 0.92);
}

.hero-controls {
    position: absolute;
    right: max(24px, calc((100% - 1180px) / 2));
    bottom: 70px;
    z-index: 4;
    display: flex;
    gap: 10px;
}

.hero-control {
    width: 44px;
    height: 44px;
    border: 1px solid var(--swamp-700);
    border-radius: 999px;
    background: rgba(22, 27, 34, 0.72);
    color: var(--night-100);
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.hero-control:hover {
    background: var(--moss-600);
    color: #fff;
}

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

.hero-dot {
    width: 30px;
    height: 4px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.35);
    cursor: pointer;
}

.hero-dot.active {
    background: var(--moss-300);
}

.section {
    padding: 76px 0;
}

.section-night {
    background: var(--night-900);
}

.section-soft {
    background: var(--night-800);
}

.section-swamp {
    background: var(--swamp-900);
}

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

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

.section-title {
    margin: 0;
    color: var(--moss-300);
    font-size: clamp(28px, 3vw, 38px);
    line-height: 1.15;
}

.section-desc {
    max-width: 680px;
    margin: 10px 0 0;
    color: var(--night-300);
}

.divider-line {
    flex: 1;
    height: 4px;
    min-width: 120px;
    border-radius: 999px;
    background: linear-gradient(to right, var(--moss-600), transparent);
}

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

.movie-grid.compact {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 16px;
}

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

.movie-card {
    overflow: hidden;
    border: 1px solid rgba(36, 51, 41, 0.9);
    border-radius: 18px;
    background: var(--night-800);
    box-shadow: var(--shadow-swamp);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}

.movie-card:hover {
    transform: translateY(-5px);
    border-color: var(--moss-700);
    background: var(--night-700);
    box-shadow: var(--shadow-swamp-lg);
}

.card-media {
    position: relative;
    display: block;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    background: var(--night-700);
}

.movie-grid.wide .card-media,
.landscape-card .card-media {
    aspect-ratio: 16 / 9;
}

.card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

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

.card-media::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.72), rgba(0, 0, 0, 0.02));
    opacity: 0.82;
}

.card-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 2;
    padding: 4px 9px;
    border-radius: 999px;
    background: rgba(13, 17, 23, 0.78);
    color: var(--moss-300);
    font-size: 12px;
    font-weight: 800;
}

.card-play {
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 2;
    width: 52px;
    height: 52px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: var(--moss-600);
    color: #fff;
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.86);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

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

.card-body {
    padding: 16px;
}

.card-body h2,
.card-body h3 {
    margin: 0 0 8px;
    color: var(--night-100);
    font-size: 17px;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-body h2 a:hover,
.card-body h3 a:hover {
    color: var(--moss-300);
}

.card-meta,
.card-desc {
    margin: 0;
    color: var(--text-muted);
    font-size: 13px;
}

.card-desc {
    margin-top: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

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

.category-card {
    min-height: 170px;
    padding: 24px;
    border: 1px solid var(--swamp-700);
    border-radius: 20px;
    background: linear-gradient(135deg, var(--night-800), var(--swamp-800));
    box-shadow: var(--shadow-swamp);
    transition: transform 0.25s ease, border-color 0.25s ease;
}

.category-card:hover {
    transform: translateY(-4px);
    border-color: var(--moss-700);
}

.category-card strong {
    display: block;
    margin-bottom: 10px;
    color: var(--moss-300);
    font-size: 20px;
}

.category-card p {
    margin: 0;
    color: var(--night-300);
    font-size: 14px;
}

.horizontal-scroll {
    display: flex;
    gap: 18px;
    overflow-x: auto;
    padding-bottom: 12px;
    scrollbar-width: none;
}

.horizontal-scroll::-webkit-scrollbar {
    display: none;
}

.horizontal-scroll .movie-card {
    width: 288px;
    flex: 0 0 auto;
}

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

.rank-item {
    display: grid;
    grid-template-columns: 46px 74px 1fr;
    align-items: center;
    gap: 14px;
    padding: 12px;
    border: 1px solid var(--swamp-700);
    border-radius: 18px;
    background: var(--night-800);
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.rank-item:hover {
    transform: translateY(-2px);
    border-color: var(--moss-700);
    background: var(--night-700);
}

.rank-num {
    color: var(--gold);
    font-weight: 900;
    font-size: 22px;
    text-align: center;
}

.rank-item img {
    width: 74px;
    height: 98px;
    border-radius: 12px;
    object-fit: cover;
    background: var(--night-700);
}

.rank-item strong {
    display: block;
    color: var(--night-100);
    line-height: 1.35;
}

.rank-item small {
    display: block;
    margin-top: 5px;
    color: var(--text-muted);
}

.page-hero {
    position: relative;
    padding: 82px 0 56px;
    overflow: hidden;
    background: radial-gradient(circle at 20% 0%, rgba(77, 115, 72, 0.28), transparent 34%), var(--night-900);
}

.page-hero h1 {
    max-width: 900px;
    margin: 0;
    color: #fff;
    font-size: clamp(34px, 5vw, 58px);
    line-height: 1.1;
    letter-spacing: -0.035em;
}

.page-hero p {
    max-width: 760px;
    margin: 16px 0 0;
    color: var(--night-300);
    font-size: 17px;
}

.search-panel {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    margin-top: 26px;
    padding: 10px;
    border: 1px solid var(--swamp-700);
    border-radius: 999px;
    background: rgba(22, 27, 34, 0.74);
    box-shadow: var(--shadow-swamp);
}

.search-panel input {
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--night-100);
    padding: 0 16px;
    font: inherit;
}

.search-panel input::placeholder {
    color: var(--text-muted);
}

.search-panel button {
    border: 0;
    border-radius: 999px;
    background: var(--moss-600);
    color: #fff;
    padding: 12px 24px;
    font-weight: 800;
    cursor: pointer;
}

.detail-hero {
    position: relative;
    min-height: 520px;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
    background-position: center;
    background-size: cover;
}

.detail-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, var(--night-900) 0%, rgba(13, 17, 23, 0.8) 44%, rgba(13, 17, 23, 0.28) 100%);
}

.detail-hero .container {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 34px;
    align-items: end;
    padding-bottom: 56px;
}

.detail-cover {
    overflow: hidden;
    border: 1px solid var(--swamp-700);
    border-radius: 22px;
    box-shadow: var(--shadow-swamp-lg);
    background: var(--night-700);
}

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

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

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

.detail-title {
    margin: 0 0 14px;
    color: #fff;
    font-size: clamp(34px, 5vw, 58px);
    line-height: 1.08;
    letter-spacing: -0.035em;
}

.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 0 18px;
}

.detail-meta span,
.tag-row span {
    display: inline-flex;
    align-items: center;
    padding: 6px 11px;
    border-radius: 999px;
    background: rgba(26, 38, 32, 0.84);
    color: var(--night-200);
    font-size: 13px;
    font-weight: 700;
}

.detail-summary {
    max-width: 790px;
    margin: 0;
    color: var(--night-200);
    font-size: 17px;
}

.player-section {
    padding: 40px 0 70px;
    background: var(--night-900);
}

.player-shell {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--swamp-700);
    border-radius: 24px;
    background: #000;
    box-shadow: var(--shadow-swamp-lg);
}

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

.play-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    background: radial-gradient(circle at center, rgba(13, 17, 23, 0.25), rgba(0, 0, 0, 0.62));
    cursor: pointer;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.play-overlay span {
    width: 86px;
    height: 86px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: var(--moss-600);
    color: #fff;
    font-size: 34px;
    box-shadow: var(--shadow-swamp-lg);
    padding-left: 5px;
}

.player-shell.is-playing .play-overlay {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.content-grid {
    display: grid;
    grid-template-columns: 1.5fr 0.8fr;
    gap: 32px;
}

.prose-box,
.side-box {
    border: 1px solid var(--swamp-700);
    border-radius: 24px;
    background: var(--night-800);
    padding: 26px;
    box-shadow: var(--shadow-swamp);
}

.prose-box h2,
.side-box h2 {
    margin: 0 0 16px;
    color: var(--moss-300);
    font-size: 24px;
}

.prose-box p {
    margin: 0 0 18px;
    color: var(--night-300);
}

.prose-box p:last-child {
    margin-bottom: 0;
}

.tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

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

.site-footer {
    border-top: 1px solid var(--swamp-700);
    background: var(--night-800);
}

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

.footer-brand {
    color: var(--moss-300);
    font-size: 24px;
    font-weight: 900;
}

.site-footer p {
    max-width: 440px;
    margin: 12px 0 0;
    color: var(--text-muted);
}

.site-footer h2 {
    margin: 0 0 12px;
    color: var(--night-100);
    font-size: 16px;
}

.footer-links {
    display: grid;
    gap: 8px;
    color: var(--text-muted);
}

.footer-links a:hover {
    color: var(--moss-300);
}

.copyright {
    padding: 16px;
    border-top: 1px solid var(--swamp-700);
    color: var(--text-muted);
    text-align: center;
    font-size: 13px;
}

.empty-filter {
    display: none;
    padding: 22px;
    border: 1px solid var(--swamp-700);
    border-radius: 18px;
    background: var(--night-800);
    color: var(--night-300);
}

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

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

    .menu-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

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

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

    .detail-hero .container,
    .content-grid,
    .footer-inner {
        grid-template-columns: 1fr;
    }

    .detail-cover {
        width: 220px;
    }
}

@media (max-width: 720px) {
    .header-inner {
        height: 64px;
    }

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

    .hero {
        height: 72vh;
        min-height: 520px;
    }

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

    .hero-controls {
        right: 16px;
        bottom: 26px;
    }

    .hero-dots {
        display: none;
    }

    .section {
        padding: 54px 0;
    }

    .section-head {
        display: block;
    }

    .divider-line {
        margin-top: 18px;
    }

    .movie-grid,
    .movie-grid.compact,
    .movie-grid.wide,
    .category-grid,
    .rank-list,
    .related-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px;
    }

    .card-body {
        padding: 12px;
    }

    .card-body h2,
    .card-body h3 {
        font-size: 15px;
    }

    .search-panel {
        grid-template-columns: 1fr;
        border-radius: 22px;
    }

    .detail-hero {
        min-height: auto;
    }

    .detail-hero .container {
        padding-top: 56px;
        grid-template-columns: 1fr;
    }

    .detail-cover {
        width: 170px;
    }

    .play-overlay span {
        width: 68px;
        height: 68px;
        font-size: 28px;
    }

    .rank-item {
        grid-template-columns: 36px 58px 1fr;
        gap: 10px;
    }

    .rank-item img {
        width: 58px;
        height: 78px;
    }
}

@media (max-width: 460px) {
    .movie-grid,
    .movie-grid.compact,
    .movie-grid.wide,
    .category-grid,
    .rank-list,
    .related-grid {
        grid-template-columns: 1fr;
    }

    .horizontal-scroll .movie-card {
        width: 250px;
    }
}
