:root {
    color-scheme: dark;
    --bg: #030712;
    --bg-soft: #0b1120;
    --panel: #111827;
    --panel-soft: #0f172a;
    --panel-deep: #050b18;
    --line: #1f2937;
    --line-bright: rgba(16, 185, 129, 0.45);
    --text: #f9fafb;
    --muted: #9ca3af;
    --muted-strong: #d1d5db;
    --accent: #10b981;
    --accent-2: #14b8a6;
    --accent-3: #34d399;
    --danger: #f87171;
    --shadow: 0 24px 80px rgba(0, 0, 0, 0.32);
    --radius: 18px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
    background:
        radial-gradient(circle at top left, rgba(16, 185, 129, 0.18), transparent 32rem),
        radial-gradient(circle at top right, rgba(20, 184, 166, 0.14), transparent 34rem),
        var(--bg);
    color: var(--text);
    line-height: 1.6;
}

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

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

button,
input,
select {
    font: inherit;
}

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

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(3, 7, 18, 0.88);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid rgba(31, 41, 55, 0.9);
}

.site-nav {
    height: 66px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

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

.brand-mark {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: white;
    box-shadow: 0 12px 36px rgba(16, 185, 129, 0.35);
}

.brand-name {
    font-size: 21px;
    background: linear-gradient(90deg, var(--accent-3), var(--accent-2));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.desktop-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-link {
    color: var(--muted-strong);
    padding: 9px 14px;
    border-radius: 999px;
    transition: 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
    color: white;
    background: rgba(16, 185, 129, 0.12);
}

.menu-toggle {
    display: none;
    width: 42px;
    height: 42px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.8);
    color: white;
    cursor: pointer;
}

.mobile-nav {
    display: none;
    border-top: 1px solid var(--line);
    padding: 8px 16px 16px;
}

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

.hero-carousel {
    position: relative;
    min-height: 520px;
    height: 70vh;
    overflow: hidden;
    background: var(--panel-deep);
}

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

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

.hero-slide::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: var(--hero-image);
    background-size: cover;
    background-position: center;
    filter: saturate(1.05);
}

.hero-backdrop {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(3, 7, 18, 0.96) 0%, rgba(3, 7, 18, 0.82) 44%, rgba(3, 7, 18, 0.30) 100%),
        linear-gradient(0deg, rgba(3, 7, 18, 0.95), transparent 42%);
}

.hero-content {
    position: relative;
    z-index: 2;
    height: 100%;
    display: flex;
    align-items: center;
}

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

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    color: var(--accent-3);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.hero-copy h1,
.page-hero h1,
.detail-info h1 {
    margin: 0;
    font-size: clamp(36px, 6vw, 72px);
    line-height: 1.05;
    font-weight: 900;
    background: linear-gradient(90deg, var(--accent-3), var(--accent-2));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero-copy h2 {
    margin: 26px 0 12px;
    font-size: clamp(24px, 3vw, 38px);
    line-height: 1.15;
}

.hero-desc {
    max-width: 620px;
    margin: 18px 0 0;
    color: var(--muted-strong);
    font-size: clamp(17px, 2vw, 22px);
}

.hero-meta,
.detail-meta,
.card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    color: var(--muted);
}

.hero-meta span,
.detail-meta span,
.card-meta span {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 3px 10px;
    border: 1px solid rgba(156, 163, 175, 0.18);
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.48);
}

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

.tag-row span {
    padding: 4px 10px;
    border-radius: 999px;
    color: #d1fae5;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.26);
    font-size: 12px;
}

.hero-tags {
    margin-top: 16px;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-top: 24px;
}

.primary-button,
.ghost-button,
.text-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    font-weight: 700;
    transition: 0.2s ease;
}

.primary-button {
    min-height: 44px;
    padding: 0 22px;
    color: white;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    box-shadow: 0 16px 34px rgba(16, 185, 129, 0.25);
}

.primary-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 46px rgba(16, 185, 129, 0.36);
}

.ghost-button {
    min-height: 44px;
    padding: 0 20px;
    color: var(--muted-strong);
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(156, 163, 175, 0.22);
}

.ghost-button:hover {
    border-color: var(--line-bright);
    color: white;
}

.small-actions {
    margin-top: 18px;
}

.hero-arrow {
    position: absolute;
    z-index: 4;
    top: 50%;
    transform: translateY(-50%);
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(3, 7, 18, 0.45);
    color: white;
    font-size: 30px;
    cursor: pointer;
    transition: 0.2s ease;
}

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

.hero-prev {
    left: 24px;
}

.hero-next {
    right: 24px;
}

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

.hero-dot {
    width: 10px;
    height: 10px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.36);
    cursor: pointer;
    transition: 0.2s ease;
}

.hero-dot.is-active {
    width: 30px;
    background: var(--accent);
}

.section-block {
    padding: 56px 0;
}

.intro-strip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-top: 28px;
    padding: 28px;
    border: 1px solid rgba(31, 41, 55, 0.95);
    border-radius: var(--radius);
    background: rgba(17, 24, 39, 0.68);
    box-shadow: var(--shadow);
}

.intro-strip h2,
.section-heading h2,
.rank-panel h2,
.recommend-panel h2,
.detail-article h2 {
    margin: 0;
    font-size: clamp(24px, 3vw, 34px);
    line-height: 1.2;
}

.intro-strip p {
    margin: 8px 0 0;
    color: var(--muted);
}

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

.section-heading.compact {
    align-items: center;
}

.text-link {
    color: var(--accent-3);
    gap: 8px;
}

.text-link:hover {
    color: white;
}

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

.movie-card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    background: rgba(17, 24, 39, 0.78);
    transition: 0.22s ease;
}

.movie-card:hover {
    transform: translateY(-4px);
    border-color: var(--line-bright);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
}

.poster-link {
    position: relative;
    display: block;
    aspect-ratio: 2 / 3;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(17, 24, 39, 0.9), rgba(5, 11, 24, 0.95));
}

.poster-link img,
.compact-card img,
.rank-item img,
.category-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.45s ease;
}

.movie-card:hover .poster-link img,
.compact-card:hover img,
.rank-item:hover img {
    transform: scale(1.08);
}

.poster-badge {
    position: absolute;
    left: 12px;
    top: 12px;
    padding: 4px 9px;
    border-radius: 999px;
    background: rgba(3, 7, 18, 0.74);
    color: #ecfdf5;
    font-size: 12px;
}

.card-body {
    padding: 16px;
}

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

.card-body h3 a:hover {
    color: var(--accent-3);
}

.card-body p {
    min-height: 46px;
    margin: 0 0 12px;
    color: var(--muted);
    font-size: 14px;
}

.card-meta {
    margin-bottom: 12px;
    font-size: 12px;
}

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

.wide-card {
    display: grid;
    grid-template-columns: 145px 1fr;
}

.wide-card .poster-link {
    aspect-ratio: auto;
    min-height: 180px;
}

.two-column {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 28px;
    align-items: start;
}

.rank-panel,
.recommend-panel {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px;
    background: rgba(17, 24, 39, 0.72);
    box-shadow: var(--shadow);
}

.sticky-panel {
    position: sticky;
    top: 88px;
}

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

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

.rank-item {
    display: grid;
    grid-template-columns: 46px 74px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    padding: 10px;
    border: 1px solid rgba(31, 41, 55, 0.85);
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.62);
    transition: 0.2s ease;
}

.rank-item:hover {
    border-color: var(--line-bright);
    background: rgba(16, 185, 129, 0.08);
}

.rank-number {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 999px;
    color: white;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

.rank-item img {
    height: 76px;
    border-radius: 10px;
    background: var(--panel-deep);
}

.rank-info {
    min-width: 0;
}

.rank-info strong {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rank-info em {
    display: block;
    margin-top: 5px;
    color: var(--muted);
    font-size: 12px;
    font-style: normal;
}

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

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

.category-tile {
    display: grid;
    gap: 12px;
    min-height: 184px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background:
        linear-gradient(135deg, rgba(16, 185, 129, 0.11), rgba(20, 184, 166, 0.04)),
        rgba(17, 24, 39, 0.72);
    transition: 0.22s ease;
}

.category-tile:hover {
    transform: translateY(-3px);
    border-color: var(--line-bright);
}

.category-title {
    font-size: 20px;
    font-weight: 800;
}

.category-desc {
    color: var(--muted);
    font-size: 14px;
}

.category-preview {
    display: flex;
    align-items: end;
    min-height: 72px;
    margin-top: auto;
}

.category-preview img {
    width: 54px;
    height: 72px;
    margin-right: -12px;
    border: 2px solid rgba(3, 7, 18, 0.96);
    border-radius: 10px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.28);
}

.page-hero {
    position: relative;
    overflow: hidden;
    padding: 86px 0 72px;
    background:
        linear-gradient(135deg, rgba(16, 185, 129, 0.16), rgba(20, 184, 166, 0.04)),
        rgba(5, 11, 24, 0.9);
    border-bottom: 1px solid var(--line);
}

.page-hero p {
    max-width: 680px;
    color: var(--muted-strong);
    font-size: 18px;
}

.compact-hero h1 {
    font-size: clamp(34px, 5vw, 58px);
}

.filter-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 180px;
    gap: 12px;
    margin-bottom: 22px;
}

.filter-input,
.filter-select {
    min-height: 46px;
    width: 100%;
    border: 1px solid rgba(75, 85, 99, 0.82);
    border-radius: 13px;
    background: rgba(15, 23, 42, 0.86);
    color: white;
    outline: none;
    padding: 0 14px;
}

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

.empty-state {
    display: none;
    margin: 24px 0 0;
    color: var(--muted);
}

.empty-state.is-visible {
    display: block;
}

.detail-hero {
    padding: 36px 0 42px;
    background:
        radial-gradient(circle at 15% 0%, rgba(16, 185, 129, 0.18), transparent 36rem),
        rgba(5, 11, 24, 0.72);
    border-bottom: 1px solid var(--line);
}

.detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(330px, 0.75fr);
    gap: 28px;
    align-items: center;
}

.player-shell {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    border: 1px solid rgba(75, 85, 99, 0.85);
    border-radius: 22px;
    background: black;
    box-shadow: 0 28px 90px rgba(0, 0, 0, 0.44);
}

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

.play-cover {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    border: 0;
    background:
        radial-gradient(circle, rgba(16, 185, 129, 0.12), transparent 26%),
        linear-gradient(0deg, rgba(0, 0, 0, 0.44), rgba(0, 0, 0, 0.18));
    cursor: pointer;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

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

.play-icon {
    width: 82px;
    height: 82px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    color: white;
    font-size: 36px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    box-shadow: 0 18px 60px rgba(16, 185, 129, 0.35);
}

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

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

.detail-info h1 {
    font-size: clamp(32px, 4vw, 54px);
}

.detail-one-line {
    margin: 18px 0;
    color: var(--muted-strong);
    font-size: 18px;
}

.detail-meta,
.detail-tags {
    margin-bottom: 18px;
}

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

.detail-article {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 28px;
    background: rgba(17, 24, 39, 0.72);
}

.detail-article h2 {
    margin: 0 0 12px;
}

.detail-article h2:not(:first-child) {
    margin-top: 30px;
}

.detail-article p {
    margin: 0;
    color: var(--muted-strong);
    font-size: 17px;
}

.related-heading {
    margin-top: 36px;
}

.compact-list {
    display: grid;
    gap: 13px;
    margin-top: 18px;
}

.compact-card {
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr);
    column-gap: 12px;
    align-items: center;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.65);
    transition: 0.2s ease;
}

.compact-card:hover {
    border-color: var(--line-bright);
}

.compact-card img {
    grid-row: span 2;
    height: 62px;
    border-radius: 10px;
    background: var(--panel-deep);
}

.compact-card span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 700;
}

.compact-card small {
    color: var(--muted);
}

.site-footer {
    margin-top: 40px;
    border-top: 1px solid var(--line);
    background: rgba(3, 7, 18, 0.72);
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr 1fr;
    gap: 30px;
    padding: 42px 0;
}

.site-footer h3 {
    margin: 0 0 12px;
    color: var(--accent-3);
}

.site-footer p,
.site-footer a,
.footer-bottom {
    color: var(--muted);
}

.site-footer ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 8px;
}

.site-footer a:hover {
    color: white;
}

.footer-bottom {
    border-top: 1px solid rgba(31, 41, 55, 0.8);
    padding: 16px;
    text-align: center;
    font-size: 14px;
}

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

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

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

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

    .sticky-panel {
        position: static;
    }
}

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

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

    .hero-carousel {
        height: 78vh;
    }

    .hero-arrow {
        display: none;
    }

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

    .wide-card {
        display: block;
    }

    .wide-card .poster-link {
        aspect-ratio: 2 / 3;
        min-height: 0;
    }

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

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

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

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

    .hero-copy {
        padding: 42px 0;
    }

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

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

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

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

    .detail-article {
        padding: 20px;
    }

    .rank-item {
        grid-template-columns: 42px 64px minmax(0, 1fr);
    }

    .rank-item img {
        height: 68px;
    }
}
