:root {
    --bg: #020617;
    --bg-soft: #0f172a;
    --bg-card: rgba(15, 23, 42, 0.84);
    --bg-card-strong: rgba(15, 23, 42, 0.96);
    --line: rgba(148, 163, 184, 0.22);
    --text: #f8fafc;
    --muted: #cbd5e1;
    --subtle: #94a3b8;
    --accent: #ef4444;
    --accent-2: #f97316;
    --accent-3: #fb7185;
    --shadow: 0 24px 60px rgba(0, 0, 0, 0.36);
    --radius: 22px;
    --container: 1180px;
}

* {
    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;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(239, 68, 68, 0.18), transparent 34rem),
        radial-gradient(circle at top right, rgba(249, 115, 22, 0.15), transparent 30rem),
        linear-gradient(180deg, #020617 0%, #0f172a 45%, #020617 100%);
    min-height: 100vh;
}

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

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

button,
input,
select {
    font: inherit;
}

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

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 60;
    border-bottom: 1px solid rgba(148, 163, 184, 0.16);
    background: linear-gradient(90deg, rgba(15, 23, 42, 0.94), rgba(30, 41, 59, 0.9), rgba(15, 23, 42, 0.94));
    backdrop-filter: blur(18px);
}

.header-inner {
    width: min(1280px, calc(100% - 28px));
    height: 68px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 18px;
}

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

.brand-mark {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    color: #fff;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    box-shadow: 0 12px 28px rgba(239, 68, 68, 0.3);
}

.brand-text,
.footer-brand {
    font-size: 1.18rem;
    background: linear-gradient(90deg, #ef4444, #f97316, #fbbf24);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
}

.nav-link {
    padding: 9px 12px;
    border-radius: 999px;
    color: var(--muted);
    font-size: 0.94rem;
    transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.nav-link:hover,
.nav-link.is-active {
    color: #fff;
    background: rgba(239, 68, 68, 0.14);
}

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

.nav-link-sub {
    display: none;
}

.site-search {
    position: relative;
    width: min(270px, 26vw);
}

.site-search-input,
.catalog-search,
.year-filter,
.type-filter {
    width: 100%;
    border: 1px solid rgba(148, 163, 184, 0.22);
    color: var(--text);
    background: rgba(2, 6, 23, 0.52);
    border-radius: 999px;
    padding: 10px 14px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.site-search-input:focus,
.catalog-search:focus,
.year-filter:focus,
.type-filter:focus {
    border-color: rgba(239, 68, 68, 0.7);
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.12);
}

.site-search-results {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: min(420px, 88vw);
    display: none;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.98);
    box-shadow: var(--shadow);
}

.site-search-results.is-visible {
    display: block;
}

.search-result-item {
    display: flex;
    gap: 12px;
    padding: 10px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.14);
}

.search-result-item:last-child {
    border-bottom: 0;
}

.search-result-item img {
    width: 48px;
    height: 64px;
    object-fit: cover;
    border-radius: 10px;
}

.search-result-item strong {
    display: block;
    margin-bottom: 4px;
}

.search-result-item span {
    color: var(--subtle);
    font-size: 0.84rem;
}

.menu-toggle {
    display: none;
    width: 42px;
    height: 42px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.86);
    padding: 10px;
}

.menu-toggle span {
    display: block;
    height: 2px;
    margin: 5px 0;
    border-radius: 99px;
    background: #fff;
}

.hero-section {
    position: relative;
    min-height: 78vh;
    overflow: hidden;
    isolation: isolate;
}

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

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

.hero-backdrop,
.detail-backdrop {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    filter: blur(3px) saturate(1.15);
    transform: scale(1.04);
    opacity: 0.55;
}

.hero-overlay,
.detail-overlay {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(2, 6, 23, 0.96) 0%, rgba(2, 6, 23, 0.76) 45%, rgba(2, 6, 23, 0.34) 100%),
        linear-gradient(0deg, #020617 0%, rgba(2, 6, 23, 0.16) 45%, rgba(2, 6, 23, 0.56) 100%);
}

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

.eyebrow,
.section-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 13px;
    color: #fca5a5;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.hero-copy h1,
.page-hero h1,
.detail-info h1 {
    margin: 0;
    font-size: clamp(2.5rem, 6vw, 5.8rem);
    line-height: 0.96;
    letter-spacing: -0.055em;
}

.hero-copy p,
.page-hero p,
.detail-one-line {
    max-width: 780px;
    color: var(--muted);
    font-size: clamp(1rem, 2vw, 1.18rem);
    line-height: 1.9;
}

.hero-tags,
.detail-tags,
.tag-row,
.info-list p:last-child {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.hero-tags span,
.detail-tags span,
.tag-row span,
.info-list p:last-child span {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 4px 10px;
    border: 1px solid rgba(248, 250, 252, 0.16);
    border-radius: 999px;
    color: #fff;
    background: rgba(15, 23, 42, 0.42);
    font-size: 0.82rem;
}

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

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 19px;
    border-radius: 999px;
    font-weight: 800;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

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

.btn-primary {
    color: #fff;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    box-shadow: 0 18px 36px rgba(239, 68, 68, 0.32);
}

.btn-ghost {
    border: 1px solid rgba(248, 250, 252, 0.18);
    background: rgba(248, 250, 252, 0.08);
}

.btn-link {
    color: #fed7aa;
}

.hero-poster {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(248, 250, 252, 0.15);
    border-radius: 30px;
    background: rgba(15, 23, 42, 0.72);
    box-shadow: var(--shadow);
}

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

.hero-poster span {
    position: absolute;
    left: 18px;
    bottom: 18px;
    padding: 9px 13px;
    border-radius: 999px;
    background: rgba(2, 6, 23, 0.7);
    backdrop-filter: blur(10px);
}

.hero-arrow {
    position: absolute;
    top: 50%;
    z-index: 5;
    width: 46px;
    height: 46px;
    border: 1px solid rgba(248, 250, 252, 0.18);
    border-radius: 50%;
    color: #fff;
    background: rgba(15, 23, 42, 0.56);
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
}

.hero-prev {
    left: 22px;
}

.hero-next {
    right: 22px;
}

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

.hero-dot {
    width: 10px;
    height: 10px;
    border: 0;
    border-radius: 999px;
    background: rgba(248, 250, 252, 0.36);
    cursor: pointer;
}

.hero-dot.is-active {
    width: 32px;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.content-section {
    padding: 58px 0;
}

.page-main {
    padding-top: 86px;
}

.page-hero {
    padding: 64px 0 28px;
}

.page-hero h1 {
    font-size: clamp(2.3rem, 5vw, 4.6rem);
}

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

.section-heading h2 {
    margin: 0;
    font-size: clamp(1.8rem, 3vw, 2.6rem);
    letter-spacing: -0.035em;
}

.section-link {
    color: #fed7aa;
    font-weight: 800;
}

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

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

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

.movie-card {
    min-width: 0;
}

.movie-card-link {
    display: block;
    height: 100%;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: var(--radius);
    background: linear-gradient(180deg, rgba(30, 41, 59, 0.82), rgba(15, 23, 42, 0.92));
    box-shadow: 0 16px 38px rgba(0, 0, 0, 0.24);
    transition: transform 0.24s ease, border-color 0.24s ease, box-shadow 0.24s ease;
}

.movie-card-link:hover {
    transform: translateY(-6px);
    border-color: rgba(239, 68, 68, 0.52);
    box-shadow: 0 28px 58px rgba(0, 0, 0, 0.36);
}

.poster-frame {
    position: relative;
    overflow: hidden;
    background: #0f172a;
}

.poster-frame img {
    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    transform: scale(1.001);
    transition: transform 0.36s ease, filter 0.36s ease;
}

.movie-card-link:hover .poster-frame img {
    transform: scale(1.055);
    filter: saturate(1.14);
}

.poster-frame::after {
    content: "";
    position: absolute;
    inset: auto 0 0 0;
    height: 44%;
    background: linear-gradient(0deg, rgba(2, 6, 23, 0.88), transparent);
}

.poster-play {
    position: absolute;
    right: 12px;
    bottom: 12px;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    box-shadow: 0 10px 24px rgba(239, 68, 68, 0.38);
}

.rank-number {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 3;
    min-width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    color: #fff;
    font-weight: 900;
    background: rgba(239, 68, 68, 0.9);
}

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

.movie-meta-line {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    color: #fca5a5;
    font-size: 0.79rem;
    font-weight: 800;
}

.movie-card h3 {
    margin: 8px 0 7px;
    font-size: 1.08rem;
    line-height: 1.35;
}

.movie-card p {
    margin: 0 0 12px;
    color: var(--subtle);
    font-size: 0.92rem;
    line-height: 1.65;
}

.movie-card-small .movie-card-body {
    padding: 13px;
}

.movie-card-small h3 {
    font-size: 1rem;
}

.channel-band {
    background: linear-gradient(90deg, rgba(15, 23, 42, 0.65), rgba(30, 41, 59, 0.7), rgba(15, 23, 42, 0.65));
    border-block: 1px solid rgba(148, 163, 184, 0.12);
}

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

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

.category-tile {
    position: relative;
    overflow: hidden;
    min-height: 220px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 26px;
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.86), rgba(15, 23, 42, 0.88));
    padding: 18px;
    display: flex;
    flex-direction: column;
    justify-content: end;
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.22);
}

.category-tile::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(2, 6, 23, 0.92) 0%, transparent 74%);
}

.category-covers {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    opacity: 0.48;
}

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

.category-tile div:last-child {
    position: relative;
    z-index: 2;
}

.category-tile span {
    color: #fed7aa;
    font-weight: 800;
}

.category-tile h3 {
    margin: 8px 0;
    font-size: 1.35rem;
}

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

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

.ranking-panel {
    position: sticky;
    top: 88px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 28px;
    background: rgba(15, 23, 42, 0.78);
    padding: 20px;
    box-shadow: var(--shadow);
}

.ranking-panel-head {
    margin-bottom: 16px;
}

.ranking-panel-head span {
    color: #fca5a5;
    font-weight: 900;
}

.ranking-panel-head h2 {
    margin: 4px 0 8px;
}

.ranking-panel-head a {
    color: #fed7aa;
    font-weight: 800;
}

.ranking-list {
    display: grid;
    gap: 13px;
}

.ranking-list .movie-card-link {
    display: grid;
    grid-template-columns: 82px 1fr;
}

.ranking-list .poster-frame img {
    height: 128px;
    aspect-ratio: auto;
}

.filter-panel {
    display: grid;
    grid-template-columns: minmax(240px, 1fr) 180px 180px;
    gap: 12px;
    margin-bottom: 24px;
    padding: 16px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 24px;
    background: rgba(15, 23, 42, 0.66);
}

select option {
    color: #0f172a;
}

.empty-state {
    display: none;
    padding: 32px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 24px;
    color: var(--muted);
    text-align: center;
    background: rgba(15, 23, 42, 0.72);
}

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

.movie-detail-main {
    padding-top: 68px;
}

.detail-hero {
    position: relative;
    min-height: 72vh;
    overflow: hidden;
    isolation: isolate;
}

.detail-hero-inner {
    position: relative;
    z-index: 2;
    padding: 48px 0;
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 30px;
    color: var(--subtle);
}

.breadcrumb a {
    color: #fed7aa;
}

.detail-layout {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 36px;
    align-items: center;
}

.detail-poster {
    overflow: hidden;
    border: 1px solid rgba(248, 250, 252, 0.16);
    border-radius: 30px;
    box-shadow: var(--shadow);
}

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

.detail-meta {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin: 28px 0;
}

.detail-meta div,
.detail-side-card,
.detail-article,
.player-card {
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 24px;
    background: rgba(15, 23, 42, 0.76);
}

.detail-meta div {
    padding: 12px;
}

.detail-meta dt {
    color: var(--subtle);
    font-size: 0.84rem;
}

.detail-meta dd {
    margin: 4px 0 0;
    font-weight: 900;
}

.player-card {
    overflow: hidden;
    box-shadow: var(--shadow);
}

.video-shell {
    position: relative;
    background: #000;
}

.movie-player {
    width: 100%;
    max-height: 72vh;
    aspect-ratio: 16 / 9;
    background: #000;
}

.player-overlay {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    gap: 12px;
    border: 0;
    color: #fff;
    background:
        radial-gradient(circle at center, rgba(239, 68, 68, 0.22), transparent 20rem),
        rgba(2, 6, 23, 0.38);
    cursor: pointer;
}

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

.player-icon {
    width: 76px;
    height: 76px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    box-shadow: 0 22px 50px rgba(239, 68, 68, 0.38);
}

.player-meta {
    padding: 20px;
}

.player-meta h2 {
    margin: 0 0 8px;
}

.player-meta p {
    margin: 0;
    color: var(--muted);
}

.detail-content-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 24px;
    align-items: start;
}

.detail-article,
.detail-side-card {
    padding: 26px;
}

.detail-article h2,
.detail-side-card h2 {
    margin: 0 0 14px;
}

.detail-article p,
.info-list p {
    color: var(--muted);
    line-height: 1.95;
}

.info-list strong {
    color: #fff;
}

.library-index {
    display: grid;
    gap: 24px;
}

.index-group {
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 24px;
    background: rgba(15, 23, 42, 0.66);
    padding: 22px;
}

.index-group h2 {
    margin: 0 0 16px;
    color: #fca5a5;
}

.index-group ul {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px 18px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.index-group a {
    display: block;
    padding: 11px 12px;
    border-radius: 14px;
    background: rgba(2, 6, 23, 0.36);
    color: #fff;
}

.index-group span {
    display: block;
    margin-top: 4px;
    color: var(--subtle);
    font-size: 0.84rem;
}

.site-footer {
    border-top: 1px solid rgba(148, 163, 184, 0.14);
    background: rgba(2, 6, 23, 0.72);
}

.footer-inner {
    width: min(var(--container), calc(100% - 32px));
    margin: 0 auto;
    padding: 36px 0;
    display: grid;
    grid-template-columns: 1fr 1.4fr;
    gap: 32px;
}

.footer-inner p {
    color: var(--subtle);
    line-height: 1.8;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-content: start;
}

.footer-links a {
    padding: 8px 12px;
    border-radius: 999px;
    color: var(--muted);
    background: rgba(15, 23, 42, 0.8);
}

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

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

    .hero-content,
    .two-column-section,
    .detail-content-grid {
        grid-template-columns: 1fr;
    }

    .hero-poster {
        display: none;
    }

    .ranking-panel {
        position: static;
    }
}

@media (max-width: 820px) {
    .header-inner {
        height: auto;
        min-height: 66px;
        flex-wrap: wrap;
        padding: 10px 0;
    }

    .menu-toggle {
        display: block;
        margin-left: auto;
    }

    .site-nav {
        order: 4;
        display: none;
        width: 100%;
        flex-wrap: wrap;
        margin-left: 0;
    }

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

    .nav-link-sub {
        display: inline-flex;
    }

    .site-search {
        order: 3;
        width: 100%;
    }

    .hero-section,
    .hero-content {
        min-height: 82vh;
    }

    .hero-content {
        padding-top: 140px;
    }

    .hero-arrow {
        display: none;
    }

    .movie-grid,
    .featured-grid,
    .compact-grid,
    .catalog-grid,
    .category-grid,
    .category-grid-large,
    .index-group ul {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .filter-panel,
    .detail-layout,
    .detail-meta,
    .footer-inner {
        grid-template-columns: 1fr;
    }

    .detail-poster {
        width: min(260px, 80vw);
    }
}

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

    .movie-grid,
    .featured-grid,
    .compact-grid,
    .catalog-grid,
    .category-grid,
    .category-grid-large,
    .index-group ul {
        grid-template-columns: 1fr;
    }

    .hero-copy h1,
    .page-hero h1,
    .detail-info h1 {
        font-size: 2.25rem;
    }

    .content-section {
        padding: 42px 0;
    }
}
