:root {
    color-scheme: dark;
    --bg: #08080b;
    --bg-soft: #111018;
    --panel: rgba(24, 23, 32, 0.78);
    --panel-strong: rgba(34, 29, 43, 0.94);
    --line: rgba(255, 255, 255, 0.12);
    --text: #f8f4ec;
    --muted: #c7bcae;
    --amber: #fbbf24;
    --red: #ef4444;
    --rose: #fb7185;
    --shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
    --radius: 24px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at 12% 8%, rgba(251, 191, 36, 0.15), transparent 34%),
        radial-gradient(circle at 78% 0%, rgba(239, 68, 68, 0.20), transparent 31%),
        linear-gradient(180deg, #07070a 0%, #111018 45%, #09090d 100%);
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    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: 72px 72px;
    mask-image: linear-gradient(to bottom, black, transparent 80%);
}

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

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

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

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    width: min(1440px, calc(100% - 32px));
    margin: 0 auto;
    padding: 18px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    backdrop-filter: blur(22px);
}

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

.brand-mark {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--amber), var(--red));
    color: #160805;
    box-shadow: 0 10px 30px rgba(239, 68, 68, 0.28);
}

.brand-text {
    font-size: clamp(18px, 2vw, 24px);
    background: linear-gradient(90deg, #fde68a, #fca5a5, #fde68a);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(17, 16, 24, 0.74);
}

.site-nav a {
    padding: 10px 18px;
    border-radius: 999px;
    color: #ece5da;
    transition: 0.22s ease;
}

.site-nav a:hover,
.site-nav a.active {
    color: #140704;
    background: linear-gradient(135deg, var(--amber), #f97316);
}

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

.hero {
    position: relative;
    min-height: 620px;
    margin-top: 16px;
    overflow: hidden;
    border-radius: 36px;
    border: 1px solid var(--line);
    background: #111018;
    box-shadow: var(--shadow);
}

.hero-slide {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template-columns: minmax(0, 1.06fr) minmax(280px, 0.54fr);
    gap: clamp(24px, 5vw, 76px);
    align-items: center;
    padding: clamp(28px, 6vw, 84px);
    opacity: 0;
    transform: scale(1.02);
    transition: opacity 0.6s ease, transform 0.6s ease;
    pointer-events: none;
}

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

.hero-backdrop {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(8, 8, 11, 0.92), rgba(8, 8, 11, 0.58), rgba(8, 8, 11, 0.94)),
        var(--hero-image) center / cover;
    filter: saturate(1.08);
    transform: scale(1.05);
}

.hero-backdrop::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 35% 36%, rgba(251, 191, 36, 0.18), transparent 38%),
        radial-gradient(circle at 88% 20%, rgba(239, 68, 68, 0.22), transparent 32%);
}

.hero-content,
.hero-cover {
    position: relative;
    z-index: 2;
}

.eyebrow {
    margin: 0 0 12px;
    color: var(--amber);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.hero h1,
.page-hero h1,
.detail-info h1 {
    margin: 0;
    font-size: clamp(34px, 7vw, 76px);
    line-height: 1.05;
    letter-spacing: -0.06em;
}

.hero-desc,
.page-hero p,
.detail-line {
    max-width: 760px;
    color: var(--muted);
    font-size: clamp(16px, 2.4vw, 21px);
    line-height: 1.8;
}

.hero-tags,
.tag-row,
.detail-tags,
.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.hero-tags span,
.tag-row span,
.detail-tags a,
.detail-meta span {
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: #f5dec4;
    background: rgba(255, 255, 255, 0.08);
}

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

.primary-btn,
.ghost-btn,
.search-form button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 22px;
    border: 0;
    border-radius: 999px;
    font-weight: 800;
    cursor: pointer;
}

.primary-btn,
.search-form button {
    color: #180704;
    background: linear-gradient(135deg, var(--amber), #fb923c, var(--red));
    box-shadow: 0 16px 40px rgba(239, 68, 68, 0.30);
}

.ghost-btn {
    color: #f8ead4;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.08);
}

.hero-cover {
    justify-self: center;
    width: min(360px, 86vw);
    aspect-ratio: 2 / 3;
    overflow: hidden;
    border-radius: 32px;
    border: 1px solid rgba(255, 255, 255, 0.20);
    background:
        linear-gradient(135deg, rgba(251, 191, 36, 0.22), rgba(239, 68, 68, 0.22)),
        #16131c;
    box-shadow: 0 28px 90px rgba(0, 0, 0, 0.55);
    transform: rotate(2deg);
}

.hero-cover img,
.detail-poster img,
.poster-shell img,
.small-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-controls {
    position: absolute;
    z-index: 4;
    left: clamp(28px, 6vw, 84px);
    bottom: 34px;
    display: flex;
    gap: 10px;
}

.hero-dot {
    width: 34px;
    height: 8px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.22);
    cursor: pointer;
}

.hero-dot.active {
    background: linear-gradient(90deg, var(--amber), var(--red));
}

.panel,
.section-block,
.page-hero,
.detail-hero {
    margin-top: 28px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
    box-shadow: 0 18px 54px rgba(0, 0, 0, 0.24);
}

.quick-search {
    padding: 26px;
    display: grid;
    grid-template-columns: 1fr minmax(280px, 520px);
    gap: 24px;
    align-items: center;
}

.quick-search h2,
.section-head h2,
.category-overview h2,
.detail-content h2 {
    margin: 0;
    font-size: clamp(24px, 3.6vw, 38px);
    letter-spacing: -0.03em;
}

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

.search-form input,
.filter-bar input,
.filter-bar select {
    width: 100%;
    min-height: 48px;
    padding: 0 16px;
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: 999px;
    outline: none;
    background: rgba(255, 255, 255, 0.08);
}

.filter-bar select {
    width: auto;
    min-width: 150px;
}

.section-block {
    padding: clamp(20px, 4vw, 34px);
}

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

.section-head a {
    color: var(--amber);
    font-weight: 800;
}

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

.category-tile {
    min-height: 168px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: linear-gradient(145deg, rgba(251, 191, 36, 0.12), rgba(239, 68, 68, 0.08));
    transition: transform 0.22s ease, border-color 0.22s ease;
}

.category-tile:hover,
.movie-card:hover,
.small-card:hover {
    transform: translateY(-4px);
    border-color: rgba(251, 191, 36, 0.48);
}

.category-tile strong {
    font-size: 21px;
}

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

.category-tile div {
    display: grid;
    gap: 6px;
    color: #f7d598;
    font-size: 13px;
}

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

.movie-card {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.055);
    transition: transform 0.22s ease, border-color 0.22s ease;
}

.poster-link,
.poster-shell {
    display: block;
}

.poster-shell {
    position: relative;
    aspect-ratio: 2 / 3;
    overflow: hidden;
    background:
        radial-gradient(circle at 28% 20%, rgba(251, 191, 36, 0.24), transparent 40%),
        linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(239, 68, 68, 0.16)),
        #15131c;
}

.rank-badge {
    position: absolute;
    z-index: 2;
    left: 12px;
    top: 12px;
    min-width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    color: #1c0804;
    background: linear-gradient(135deg, var(--amber), var(--red));
}

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

.movie-title {
    display: block;
    min-height: 48px;
    font-weight: 800;
    line-height: 1.4;
}

.movie-meta,
.movie-line {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.6;
}

.movie-line {
    display: -webkit-box;
    min-height: 42px;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.tag-row {
    margin-top: 12px;
    gap: 6px;
}

.tag-row span {
    padding: 5px 8px;
    font-size: 12px;
}

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

.small-card {
    min-height: 112px;
    padding: 10px;
    display: grid;
    grid-template-columns: 70px 1fr;
    grid-template-rows: 1fr auto;
    gap: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.06);
    transition: transform 0.22s ease, border-color 0.22s ease;
}

.small-card img {
    grid-row: 1 / 3;
    height: 92px;
    border-radius: 12px;
    background: #17141d;
}

.small-card span {
    align-self: end;
    font-weight: 800;
    line-height: 1.4;
}

.small-card em {
    color: var(--muted);
    font-size: 12px;
    font-style: normal;
}

.page-hero {
    padding: clamp(28px, 6vw, 68px);
    background:
        radial-gradient(circle at 18% 18%, rgba(251, 191, 36, 0.16), transparent 32%),
        radial-gradient(circle at 80% 8%, rgba(239, 68, 68, 0.18), transparent 34%),
        var(--panel-strong);
}

.compact-hero h1 {
    max-width: 980px;
    font-size: clamp(34px, 6vw, 64px);
}

.overview-stack {
    display: grid;
    gap: 18px;
}

.category-overview {
    padding: 24px;
}

.detail-hero {
    padding: clamp(24px, 5vw, 58px);
    display: grid;
    grid-template-columns: minmax(240px, 360px) 1fr;
    gap: clamp(24px, 5vw, 54px);
    align-items: center;
    background:
        radial-gradient(circle at 14% 14%, rgba(251, 191, 36, 0.16), transparent 32%),
        radial-gradient(circle at 70% 18%, rgba(239, 68, 68, 0.16), transparent 35%),
        var(--panel-strong);
}

.detail-poster {
    overflow: hidden;
    aspect-ratio: 2 / 3;
    border-radius: 30px;
    border: 1px solid var(--line);
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.18), rgba(239, 68, 68, 0.16));
    box-shadow: var(--shadow);
}

.breadcrumb {
    margin: 0 0 14px;
    color: var(--muted);
}

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

.detail-meta,
.detail-tags {
    margin-top: 16px;
}

.detail-info .primary-btn {
    margin-top: 24px;
}

.player-panel {
    padding: clamp(16px, 3vw, 26px);
}

.video-wrap {
    position: relative;
    overflow: hidden;
    border-radius: 22px;
    background: #050506;
    aspect-ratio: 16 / 9;
}

.video-wrap video {
    width: 100%;
    height: 100%;
    background: #050506;
}

.player-start {
    position: absolute;
    inset: 0;
    display: grid;
    place-content: center;
    gap: 14px;
    color: #fff7ed;
    border: 0;
    background: linear-gradient(180deg, rgba(7, 7, 10, 0.20), rgba(7, 7, 10, 0.68));
    cursor: pointer;
}

.player-start span {
    width: 82px;
    height: 82px;
    display: grid;
    place-items: center;
    margin: 0 auto;
    border-radius: 999px;
    color: #210807;
    background: linear-gradient(135deg, var(--amber), var(--red));
    font-size: 30px;
    box-shadow: 0 18px 48px rgba(239, 68, 68, 0.38);
}

.player-start strong {
    font-size: 20px;
}

.player-start.is-hidden {
    display: none;
}

.detail-content {
    color: #eadfce;
    line-height: 1.9;
    font-size: 17px;
}

.detail-content h2 + p {
    margin-top: 12px;
}

.detail-content p {
    margin: 12px 0 0;
}

.site-footer {
    width: min(1440px, calc(100% - 32px));
    margin: 32px auto 0;
    padding: 34px 0 46px;
    color: var(--muted);
}

.footer-brand {
    margin-bottom: 12px;
    color: var(--text);
    font-size: 22px;
    font-weight: 900;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 12px;
}

.footer-links a {
    color: #f7d598;
}

.is-filtered-out {
    display: none;
}

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

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

@media (max-width: 900px) {
    .site-nav {
        position: absolute;
        top: 72px;
        right: 0;
        display: none;
        width: min(260px, 86vw);
        border-radius: 24px;
        padding: 12px;
        flex-direction: column;
        align-items: stretch;
    }

    .site-nav.open {
        display: flex;
    }

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

    .hero {
        min-height: 720px;
    }

    .hero-slide,
    .detail-hero,
    .quick-search {
        grid-template-columns: 1fr;
    }

    .hero-cover {
        display: none;
    }

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

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

@media (max-width: 620px) {
    main,
    .site-header,
    .site-footer {
        width: min(100% - 20px, 1440px);
    }

    .hero {
        min-height: 660px;
        border-radius: 26px;
    }

    .hero-slide {
        padding: 28px;
    }

    .hero-actions,
    .search-form,
    .filter-bar,
    .section-head {
        align-items: stretch;
        flex-direction: column;
    }

    .filter-bar select {
        width: 100%;
    }

    .movie-grid,
    .small-grid,
    .category-grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

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

    .movie-title {
        min-height: auto;
    }

    .small-card {
        grid-template-columns: 56px 1fr;
        min-height: 96px;
    }

    .small-card img {
        height: 76px;
    }

    .detail-hero,
    .section-block,
    .page-hero {
        border-radius: 20px;
    }
}
