:root {
    --bg: #050816;
    --bg-soft: #0b1024;
    --panel: rgba(15, 23, 42, 0.84);
    --panel-solid: #10182f;
    --card: rgba(15, 23, 42, 0.72);
    --line: rgba(148, 163, 184, 0.18);
    --text: #f8fafc;
    --muted: #aab4c5;
    --soft: #dbe4f0;
    --brand: #f59e0b;
    --brand-2: #f97316;
    --accent: #38bdf8;
    --danger: #fb7185;
    --shadow: 0 24px 80px rgba(0, 0, 0, 0.38);
    --radius-xl: 28px;
    --radius-lg: 20px;
    --radius-md: 14px;
    --container: 1200px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: var(--text);
    background:
        radial-gradient(circle at 18% 0%, rgba(56, 189, 248, 0.20), transparent 34rem),
        radial-gradient(circle at 82% 8%, rgba(245, 158, 11, 0.18), transparent 30rem),
        linear-gradient(180deg, #050816 0%, #081126 44%, #050816 100%);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    line-height: 1.65;
    min-height: 100vh;
}

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

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

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

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

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

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

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

.brand-mark {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 15px;
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
    color: #111827;
    box-shadow: 0 16px 42px rgba(249, 115, 22, 0.32);
}

.brand-text {
    font-size: 20px;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.main-nav a {
    color: var(--soft);
    padding: 9px 12px;
    border-radius: 999px;
    font-size: 14px;
    transition: 0.22s ease;
}

.main-nav a:hover,
.main-nav a.active {
    color: #111827;
    background: linear-gradient(135deg, var(--brand), #fde68a);
}

.menu-toggle {
    display: none;
    width: 42px;
    height: 42px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(255,255,255,0.06);
    padding: 10px;
}

.menu-toggle span {
    display: block;
    height: 2px;
    margin: 5px 0;
    background: var(--text);
    border-radius: 999px;
}

.hero {
    position: relative;
    overflow: hidden;
    min-height: 620px;
    border-bottom: 1px solid var(--line);
}

.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(5, 8, 22, 0.96) 0%, rgba(5, 8, 22, 0.68) 48%, rgba(5, 8, 22, 0.88) 100%),
        radial-gradient(circle at 70% 30%, rgba(245, 158, 11, 0.20), transparent 28rem);
    z-index: 1;
}

.hero-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.7s ease;
}

.hero-slide.is-active {
    opacity: 1;
    pointer-events: auto;
}

.hero-bg {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.hero-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(18px) saturate(1.2) brightness(0.68);
    transform: scale(1.08);
}

.hero-bg.no-cover {
    background:
        radial-gradient(circle at 20% 20%, rgba(56,189,248,0.28), transparent 24rem),
        linear-gradient(135deg, #0b1024, #3b1d0b 58%, #111827);
}

.hero-bg.no-cover::after,
.poster-shell.no-cover::after,
.detail-cover.no-cover::after {
    content: attr(data-title);
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    text-align: center;
    padding: 20px;
    color: rgba(255,255,255,0.78);
    font-weight: 900;
    letter-spacing: 0.08em;
}

.hero-content {
    position: relative;
    z-index: 2;
    width: min(var(--container), calc(100% - 32px));
    min-height: 620px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
    align-items: center;
    gap: 54px;
    padding: 78px 0 54px;
}

.hero-copy {
    max-width: 740px;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #111827;
    background: linear-gradient(135deg, var(--brand), #fde68a);
    padding: 8px 14px;
    border-radius: 999px;
    font-weight: 800;
    font-size: 13px;
}

.hero h1 {
    font-size: clamp(42px, 6vw, 78px);
    line-height: 1.05;
    margin: 22px 0 18px;
    letter-spacing: -0.06em;
}

.hero-summary {
    color: var(--soft);
    font-size: 18px;
    max-width: 650px;
}

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

.hero-tags span,
.tag-row span,
.meta-pills span {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 5px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--soft);
    background: rgba(255,255,255,0.06);
    font-size: 12px;
}

.hero-actions,
.section-actions,
.card-actions,
.player-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

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

.btn,
.btn-ghost,
.text-link,
.muted-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    font-weight: 800;
    transition: 0.22s ease;
}

.btn {
    color: #111827;
    background: linear-gradient(135deg, var(--brand), #fde68a);
    padding: 13px 20px;
    box-shadow: 0 18px 46px rgba(245, 158, 11, 0.26);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 24px 64px rgba(245, 158, 11, 0.36);
}

.btn-ghost {
    padding: 12px 18px;
    border: 1px solid var(--line);
    color: var(--text);
    background: rgba(255,255,255,0.07);
}

.btn-ghost:hover {
    border-color: rgba(245,158,11,0.58);
    background: rgba(245,158,11,0.10);
}

.hero-poster {
    position: relative;
    aspect-ratio: 3 / 4;
    border-radius: var(--radius-xl);
    overflow: hidden;
    background: linear-gradient(135deg, rgba(56,189,248,0.22), rgba(245,158,11,0.22));
    border: 1px solid rgba(255,255,255,0.14);
    box-shadow: var(--shadow);
    transform: rotate(2deg);
}

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

.hero-poster::after {
    content: "";
    position: absolute;
    inset: auto 0 0;
    height: 40%;
    background: linear-gradient(to top, rgba(0,0,0,0.72), transparent);
}

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

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

.hero-dot.is-active {
    width: 32px;
    background: linear-gradient(135deg, var(--brand), #fde68a);
}

.section {
    padding: 58px 0;
}

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

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

.section h2,
.page-title h1 {
    margin: 6px 0 10px;
    font-size: clamp(28px, 4vw, 46px);
    line-height: 1.12;
    letter-spacing: -0.04em;
}

.section-header p,
.page-title p,
.category-intro p {
    color: var(--muted);
    margin: 0;
    max-width: 760px;
}

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

.stat-card,
.category-card,
.info-card,
.breadcrumb,
.search-panel,
.detail-panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 70px rgba(0,0,0,0.22);
}

.stat-card,
.category-card,
.info-card {
    padding: 20px;
}

.stat-card strong {
    display: block;
    font-size: 32px;
    line-height: 1.1;
}

.stat-card span,
.category-card span,
.info-card span {
    color: var(--muted);
}

.category-card {
    min-height: 166px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: 0.22s ease;
}

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

.category-card h3 {
    margin: 0 0 8px;
    font-size: 22px;
}

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

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

.movie-card {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--card);
    box-shadow: 0 16px 50px rgba(0,0,0,0.20);
    transition: 0.25s ease;
}

.movie-card:hover {
    transform: translateY(-5px);
    border-color: rgba(245,158,11,0.50);
    box-shadow: 0 26px 70px rgba(0,0,0,0.32);
}

.poster-shell {
    position: relative;
    display: block;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    background:
        radial-gradient(circle at 24% 18%, rgba(56,189,248,0.26), transparent 45%),
        linear-gradient(135deg, #111827, #2a170c);
}

.poster-shell img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: 0.35s ease;
}

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

.rank-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 3;
    padding: 5px 10px;
    border-radius: 999px;
    color: #111827;
    background: linear-gradient(135deg, var(--brand), #fde68a);
    font-size: 12px;
}

.card-body {
    padding: 15px;
}

.card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    color: var(--muted);
    font-size: 12px;
}

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

.card-body p {
    margin: 0 0 12px;
    color: var(--muted);
    font-size: 14px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-actions {
    margin-top: 14px;
    justify-content: space-between;
}

.text-link {
    color: var(--brand);
    font-size: 13px;
}

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

.page-title {
    padding: 54px 0 28px;
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    padding: 12px 16px;
    margin-bottom: 22px;
    color: var(--muted);
    font-size: 14px;
}

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

.breadcrumb em {
    color: rgba(255,255,255,0.26);
    font-style: normal;
}

.search-panel {
    padding: 18px;
    margin-bottom: 24px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 14px;
    align-items: center;
}

.search-panel input,
.search-panel select {
    width: 100%;
    color: var(--text);
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--line);
    border-radius: 14px;
    min-height: 48px;
    padding: 0 14px;
    outline: none;
}

.search-panel input:focus,
.search-panel select:focus {
    border-color: rgba(245,158,11,0.60);
    box-shadow: 0 0 0 4px rgba(245,158,11,0.08);
}

.result-count {
    color: var(--muted);
    white-space: nowrap;
}

.detail-hero {
    padding: 48px 0 28px;
}

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

.detail-cover {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-xl);
    border: 1px solid var(--line);
    aspect-ratio: 3 / 4;
    background:
        radial-gradient(circle at 30% 20%, rgba(56,189,248,0.28), transparent 44%),
        linear-gradient(145deg, #111827, #321b0b);
    box-shadow: var(--shadow);
}

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

.detail-title h1 {
    margin: 12px 0 14px;
    font-size: clamp(34px, 5vw, 62px);
    line-height: 1.08;
    letter-spacing: -0.05em;
}

.detail-title p {
    color: var(--soft);
    font-size: 18px;
    margin: 0 0 20px;
}

.detail-panel {
    padding: 24px;
    margin-top: 22px;
}

.detail-panel h2 {
    margin: 0 0 12px;
    font-size: 24px;
}

.detail-panel p {
    color: var(--soft);
    margin: 0 0 16px;
}

.player-wrap {
    background: #020617;
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.video-frame {
    position: relative;
    background: #000;
    aspect-ratio: 16 / 9;
}

.video-frame video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
}

.player-bar {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: center;
    padding: 14px 16px;
    color: var(--muted);
    background: rgba(15,23,42,0.96);
}

.player-bar strong {
    color: var(--text);
}

.table-list {
    display: grid;
    gap: 10px;
}

.table-row {
    display: grid;
    grid-template-columns: 70px 1fr 120px 120px;
    gap: 12px;
    align-items: center;
    padding: 13px 15px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(255,255,255,0.045);
}

.table-row b {
    color: var(--brand);
}

.table-row span {
    color: var(--muted);
}

.site-footer {
    margin-top: 60px;
    border-top: 1px solid var(--line);
    background: rgba(5,8,22,0.72);
}

.footer-inner {
    padding: 32px 0;
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: center;
}

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

.footer-links {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--soft);
}

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

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

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

@media (max-width: 860px) {
    .menu-toggle {
        display: block;
    }

    .main-nav {
        position: absolute;
        left: 16px;
        right: 16px;
        top: 76px;
        display: none;
        padding: 14px;
        border: 1px solid var(--line);
        border-radius: 18px;
        background: rgba(5,8,22,0.96);
        box-shadow: var(--shadow);
        justify-content: flex-start;
    }

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

    .hero,
    .hero-content {
        min-height: auto;
    }

    .hero-content {
        grid-template-columns: 1fr;
        padding: 58px 0 80px;
    }

    .hero-poster {
        max-width: 360px;
        transform: none;
    }

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

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

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

    .table-row {
        grid-template-columns: 54px 1fr;
    }
}

@media (max-width: 640px) {
    .header-inner,
    .footer-inner,
    .container {
        width: min(100% - 24px, var(--container));
    }

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

    .hero h1 {
        font-size: 40px;
    }

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

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

    .section {
        padding: 42px 0;
    }

    .section-header,
    .footer-inner,
    .player-bar {
        align-items: flex-start;
        flex-direction: column;
    }
}
