:root {
    color-scheme: dark;
    --bg: #0f1117;
    --bg-soft: #151924;
    --panel: rgba(255, 255, 255, 0.08);
    --panel-strong: rgba(255, 255, 255, 0.13);
    --text: #f8fafc;
    --muted: #aeb7c8;
    --line: rgba(255, 255, 255, 0.12);
    --red: #dc2626;
    --red-dark: #991b1b;
    --amber: #f59e0b;
    --teal: #14b8a6;
    --shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
    --radius: 24px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(220, 38, 38, 0.22), transparent 34rem),
        radial-gradient(circle at top right, rgba(20, 184, 166, 0.18), transparent 30rem),
        linear-gradient(135deg, #080a10, #141827 46%, #0e1724);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

body::before {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    content: "";
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
    background-size: 42px 42px;
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.95), transparent 82%);
}

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

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

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

.header-inner,
.footer-inner,
.page-shell {
    width: min(1220px, calc(100% - 32px));
    margin: 0 auto;
}

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

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

.brand-mark {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--red), var(--amber));
    box-shadow: 0 18px 35px rgba(220, 38, 38, 0.28);
}

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

.nav-link,
.mobile-link {
    border: 1px solid transparent;
    color: var(--muted);
    transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.nav-link {
    padding: 10px 16px;
    border-radius: 999px;
    font-size: 15px;
}

.nav-link:hover,
.nav-link.is-active,
.mobile-link:hover,
.mobile-link.is-active {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.09);
}

.menu-button {
    display: none;
    width: 44px;
    height: 44px;
    color: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.08);
}

.mobile-nav {
    display: none;
    flex-direction: column;
    gap: 8px;
    padding: 0 16px 16px;
}

.mobile-nav.is-open {
    display: flex;
}

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

.page-shell {
    padding: 34px 0 58px;
}

.hero-carousel {
    position: relative;
    min-height: 620px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 34px;
    background: #090b12;
    box-shadow: var(--shadow);
}

.hero-slide {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.58fr);
    gap: 36px;
    align-items: center;
    padding: 58px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.55s ease, transform 0.55s ease;
    transform: scale(1.02);
}

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

.hero-slide::before {
    position: absolute;
    inset: 0;
    content: "";
    background:
        linear-gradient(90deg, rgba(9, 11, 18, 0.93) 0%, rgba(9, 11, 18, 0.75) 42%, rgba(9, 11, 18, 0.24) 100%),
        var(--hero-bg);
    background-size: cover;
    background-position: center;
    filter: saturate(1.18);
}

.hero-slide::after {
    position: absolute;
    inset: 0;
    content: "";
    background:
        radial-gradient(circle at 18% 22%, rgba(245, 158, 11, 0.24), transparent 24rem),
        linear-gradient(135deg, rgba(220, 38, 38, 0.42), rgba(20, 184, 166, 0.18));
}

.hero-copy,
.hero-poster {
    position: relative;
    z-index: 2;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    margin-bottom: 18px;
    color: #fed7aa;
    border: 1px solid rgba(251, 191, 36, 0.28);
    border-radius: 999px;
    background: rgba(245, 158, 11, 0.12);
    font-size: 14px;
    font-weight: 700;
}

.hero-copy h1,
.hero-copy h2 {
    max-width: 760px;
    margin: 0;
    font-size: clamp(40px, 6vw, 78px);
    line-height: 0.95;
    letter-spacing: -0.06em;
}

.hero-copy p {
    max-width: 680px;
    margin: 22px 0 0;
    color: rgba(255, 255, 255, 0.83);
    font-size: 18px;
    line-height: 1.75;
}

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

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    padding: 0 20px;
    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);
}

.btn-primary {
    color: #fff;
    background: linear-gradient(135deg, var(--red), #f97316);
    box-shadow: 0 18px 36px rgba(220, 38, 38, 0.28);
}

.btn-ghost {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
}

.hero-poster {
    justify-self: end;
    width: min(360px, 100%);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 30px;
    background: rgba(255, 255, 255, 0.12);
    box-shadow: 0 28px 70px rgba(0, 0, 0, 0.42);
}

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

.hero-poster-caption {
    padding: 18px;
    background: rgba(8, 10, 16, 0.82);
}

.hero-controls {
    position: absolute;
    right: 28px;
    bottom: 26px;
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 10px;
}

.hero-dot {
    width: 11px;
    height: 11px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.4);
    transition: width 0.2s ease, background 0.2s ease;
}

.hero-dot.is-active {
    width: 32px;
    background: #fff;
}

.section {
    margin-top: 54px;
}

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

.section-kicker {
    margin: 0 0 7px;
    color: var(--amber);
    font-size: 13px;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.section-heading h2,
.page-title h1,
.detail-title {
    margin: 0;
    font-size: clamp(30px, 3vw, 46px);
    line-height: 1.08;
    letter-spacing: -0.04em;
}

.section-heading p,
.page-title p,
.category-intro,
.detail-subtitle {
    color: var(--muted);
    line-height: 1.75;
}

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

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

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

.movie-card:hover {
    transform: translateY(-7px);
    border-color: rgba(245, 158, 11, 0.44);
    background: rgba(255, 255, 255, 0.12);
}

.poster-link {
    position: relative;
    display: block;
    overflow: hidden;
    background: #111827;
}

.poster-link img {
    width: 100%;
    aspect-ratio: 4 / 5.35;
    object-fit: cover;
    transition: transform 0.45s ease;
}

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

.poster-badge,
.rank-number {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 6px 10px;
    border-radius: 999px;
    color: #fff;
    background: rgba(220, 38, 38, 0.92);
    font-size: 12px;
    font-weight: 900;
}

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

.movie-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 12px;
}

.movie-meta span {
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
}

.movie-card-title {
    margin: 0;
    font-size: 18px;
    line-height: 1.28;
}

.movie-card-title a:hover {
    color: #fbbf24;
}

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

.tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 13px;
}

.tag-chip {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    padding: 5px 9px;
    overflow: hidden;
    color: #d1fae5;
    border: 1px solid rgba(20, 184, 166, 0.24);
    border-radius: 999px;
    background: rgba(20, 184, 166, 0.1);
    font-size: 12px;
    white-space: nowrap;
    text-overflow: ellipsis;
}

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

.category-card {
    position: relative;
    min-height: 180px;
    overflow: hidden;
    padding: 26px;
    border: 1px solid var(--line);
    border-radius: 26px;
    background:
        linear-gradient(135deg, rgba(220, 38, 38, 0.18), rgba(20, 184, 166, 0.12)),
        rgba(255, 255, 255, 0.07);
    transition: transform 0.25s ease, border-color 0.25s ease;
}

.category-card:hover {
    transform: translateY(-6px);
    border-color: rgba(245, 158, 11, 0.46);
}

.category-card h2,
.category-card h3 {
    margin: 0 0 12px;
    font-size: 24px;
}

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

.search-panel {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.08);
}

.search-input {
    width: 100%;
    min-height: 52px;
    padding: 0 18px;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 18px;
    outline: none;
    background: rgba(0, 0, 0, 0.22);
}

.search-input:focus {
    border-color: rgba(245, 158, 11, 0.58);
}

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

.rank-item {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr) auto;
    gap: 16px;
    align-items: center;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.075);
    transition: transform 0.2s ease, background 0.2s ease;
}

.rank-item:hover {
    transform: translateX(4px);
    background: rgba(255, 255, 255, 0.12);
}

.rank-thumb {
    width: 72px;
    height: 92px;
    overflow: hidden;
    border-radius: 16px;
    background: #111827;
}

.rank-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.rank-index {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border-radius: 14px;
    color: #fff;
    background: linear-gradient(135deg, var(--red), var(--amber));
    font-weight: 900;
}

.rank-title {
    margin: 0;
    font-size: 18px;
}

.rank-desc {
    margin: 6px 0 0;
    color: var(--muted);
    line-height: 1.6;
}

.page-title {
    margin: 0 0 28px;
    padding: 34px;
    border: 1px solid var(--line);
    border-radius: 30px;
    background:
        linear-gradient(135deg, rgba(220, 38, 38, 0.17), rgba(20, 184, 166, 0.11)),
        rgba(255, 255, 255, 0.065);
}

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

.breadcrumb a:hover {
    color: #fbbf24;
}

.detail-hero {
    display: grid;
    grid-template-columns: 340px minmax(0, 1fr);
    gap: 34px;
    align-items: start;
}

.detail-poster {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 30px;
    background: rgba(255, 255, 255, 0.08);
    box-shadow: var(--shadow);
}

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

.detail-panel {
    padding: 34px;
    border: 1px solid var(--line);
    border-radius: 30px;
    background: rgba(255, 255, 255, 0.075);
}

.detail-subtitle {
    margin: 18px 0 0;
    font-size: 18px;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 24px;
}

.info-cell {
    padding: 14px;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.06);
}

.info-cell strong {
    display: block;
    margin-bottom: 5px;
    color: #fcd34d;
    font-size: 12px;
}

.player-card {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 32px;
    background: #000;
    box-shadow: var(--shadow);
}

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

.player-overlay {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    border: 0;
    color: #fff;
    background:
        linear-gradient(135deg, rgba(5, 7, 12, 0.58), rgba(5, 7, 12, 0.28)),
        rgba(0, 0, 0, 0.18);
    transition: opacity 0.22s ease, visibility 0.22s ease;
}

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

.play-button-core {
    display: grid;
    width: 92px;
    height: 92px;
    place-items: center;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--red), var(--amber));
    box-shadow: 0 24px 70px rgba(220, 38, 38, 0.42);
    font-size: 34px;
}

.article-block {
    padding: 30px;
    border: 1px solid var(--line);
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.075);
}

.article-block h2 {
    margin: 0 0 14px;
    font-size: 28px;
}

.article-block p {
    margin: 0;
    color: rgba(255, 255, 255, 0.82);
    line-height: 1.92;
    white-space: pre-line;
}

.site-footer {
    border-top: 1px solid var(--line);
    background: rgba(0, 0, 0, 0.22);
}

.footer-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 28px 0;
    color: var(--muted);
}

.footer-inner strong {
    color: #fff;
}

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

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

    .hero-slide {
        grid-template-columns: 1fr;
        min-height: 760px;
    }

    .hero-poster {
        justify-self: start;
        width: 260px;
    }

    .detail-hero {
        grid-template-columns: 280px minmax(0, 1fr);
    }
}

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

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

    .hero-carousel {
        min-height: 720px;
        border-radius: 24px;
    }

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

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

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

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

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

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

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

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

    .rank-index {
        display: none;
    }
}

@media (max-width: 560px) {
    .header-inner,
    .footer-inner,
    .page-shell {
        width: min(100% - 22px, 1220px);
    }

    .brand {
        font-size: 18px;
    }

    .brand-mark {
        width: 34px;
        height: 34px;
    }

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

    .hero-slide {
        padding: 26px 18px;
    }

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

    .hero-poster {
        width: 210px;
    }

    .movie-grid,
    .movie-grid.compact,
    .category-grid,
    .info-grid {
        grid-template-columns: 1fr;
    }

    .page-title,
    .detail-panel,
    .article-block {
        padding: 22px;
        border-radius: 22px;
    }

    .play-button-core {
        width: 72px;
        height: 72px;
        font-size: 28px;
    }
}
