:root {
    color-scheme: dark;
    --bg: #020617;
    --bg-soft: #0f172a;
    --panel: rgba(15, 23, 42, 0.82);
    --panel-strong: rgba(30, 41, 59, 0.9);
    --line: rgba(148, 163, 184, 0.18);
    --text: #f8fafc;
    --muted: #94a3b8;
    --soft: #cbd5e1;
    --accent: #ef4444;
    --accent-2: #f97316;
    --accent-soft: rgba(239, 68, 68, 0.16);
    --cyan: #22d3ee;
    --shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
    --radius: 22px;
}

* {
    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;
    background:
        radial-gradient(circle at 20% 0%, rgba(239, 68, 68, 0.16), transparent 32rem),
        radial-gradient(circle at 90% 10%, rgba(34, 211, 238, 0.12), transparent 30rem),
        linear-gradient(180deg, #020617 0%, #0f172a 45%, #020617 100%);
    color: var(--text);
    min-height: 100vh;
}

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

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

button,
input,
select {
    font: inherit;
}

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

.nav-wrap {
    width: min(1200px, calc(100% - 32px));
    height: 68px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

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

.brand-mark {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 11px;
    color: #fff;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    box-shadow: 0 0 28px rgba(239, 68, 68, 0.35);
}

.brand-text {
    font-size: 20px;
    background: linear-gradient(90deg, #ef4444, #fb923c);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    white-space: nowrap;
}

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

.nav-link,
.mobile-nav-link {
    color: var(--soft);
    border-radius: 999px;
    transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.nav-link {
    padding: 9px 15px;
    font-size: 14px;
}

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

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

.nav-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    margin: 5px auto;
    background: #fff;
    border-radius: 99px;
}

.mobile-nav {
    display: none;
    width: min(1200px, calc(100% - 32px));
    margin: 0 auto 14px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(2, 6, 23, 0.92);
}

.mobile-nav.open {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.mobile-nav-link {
    padding: 10px 12px;
    color: var(--soft);
    font-size: 14px;
}

.hero {
    min-height: 78vh;
    position: relative;
    overflow: hidden;
    padding-top: 68px;
}

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

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

.hero-bg {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(127, 29, 29, 0.28), rgba(2, 6, 23, 0.72));
}

.hero-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.62;
}

.hero-bg::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(0deg, #020617 0%, rgba(2, 6, 23, 0.88) 18%, rgba(2, 6, 23, 0.22) 60%, rgba(2, 6, 23, 0.65) 100%),
        radial-gradient(circle at 20% 72%, rgba(239, 68, 68, 0.26), transparent 24rem);
}

.hero-content {
    position: relative;
    z-index: 2;
    width: min(1200px, calc(100% - 32px));
    min-height: calc(78vh - 68px);
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(300px, 0.58fr);
    gap: 34px;
    align-items: end;
    padding: 72px 0 74px;
}

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

.eyebrow,
.detail-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 999px;
    color: #fecaca;
    background: rgba(239, 68, 68, 0.15);
    backdrop-filter: blur(10px);
    font-size: 14px;
}

.hero h1,
.page-hero h1,
.detail-title {
    margin: 18px 0 18px;
    font-size: clamp(34px, 6vw, 70px);
    line-height: 1.04;
    letter-spacing: -0.055em;
}

.hero p,
.page-hero p {
    margin: 0;
    color: #dbeafe;
    font-size: clamp(16px, 2.3vw, 20px);
    line-height: 1.8;
}

.hero-actions,
.section-actions,
.detail-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
    margin-top: 28px;
}

.btn-primary,
.btn-ghost,
.btn-soft {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 14px;
    padding: 12px 18px;
    font-weight: 700;
    line-height: 1;
    border: 1px solid transparent;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

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

.btn-ghost {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(12px);
}

.btn-soft {
    color: #fecaca;
    border-color: rgba(239, 68, 68, 0.22);
    background: rgba(239, 68, 68, 0.12);
}

.btn-primary:hover,
.btn-ghost:hover,
.btn-soft:hover {
    transform: translateY(-2px);
}

.hero-panel {
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 26px;
    background: rgba(15, 23, 42, 0.46);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.hero-panel img {
    width: 100%;
    aspect-ratio: 4 / 5;
    object-fit: cover;
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.32), rgba(15, 23, 42, 0.9));
}

.hero-panel h2 {
    margin: 16px 0 8px;
    font-size: 22px;
}

.hero-panel p {
    font-size: 14px;
    color: var(--soft);
    line-height: 1.7;
}

.hero-control {
    position: absolute;
    z-index: 5;
    top: 50%;
    transform: translateY(-50%);
    width: 46px;
    height: 46px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    color: #fff;
    background: rgba(0, 0, 0, 0.45);
    cursor: pointer;
    backdrop-filter: blur(12px);
}

.hero-control.prev {
    left: 18px;
}

.hero-control.next {
    right: 18px;
}

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

.hero-dot {
    width: 9px;
    height: 9px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.46);
    cursor: pointer;
    transition: width 0.25s ease, background 0.25s ease;
}

.hero-dot.active {
    width: 34px;
    background: #ef4444;
}

.main-section,
.page-section {
    width: min(1200px, calc(100% - 32px));
    margin: 0 auto;
    padding: 70px 0;
}

.page-hero {
    width: min(1200px, calc(100% - 32px));
    margin: 0 auto;
    padding: 138px 0 42px;
}

.page-hero.compact {
    padding-bottom: 20px;
}

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

.section-title-row h2,
.page-section h2 {
    margin: 0;
    font-size: clamp(26px, 4vw, 38px);
    letter-spacing: -0.035em;
}

.section-title-row p {
    margin: 8px 0 0;
    color: var(--muted);
}

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

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

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

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

.movie-card-link {
    display: block;
    min-height: 100%;
    border: 1px solid rgba(148, 163, 184, 0.15);
    border-radius: 22px;
    overflow: hidden;
    background: rgba(15, 23, 42, 0.82);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.22);
    transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

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

.poster-wrap {
    position: relative;
    display: block;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    background:
        linear-gradient(135deg, rgba(239, 68, 68, 0.26), rgba(2, 6, 23, 0.88)),
        radial-gradient(circle at 30% 20%, rgba(249, 115, 22, 0.35), transparent 18rem);
}

.poster-wrap::after {
    content: attr(data-title);
    position: absolute;
    inset: auto 14px 14px;
    color: rgba(255, 255, 255, 0.86);
    font-size: 15px;
    font-weight: 800;
    line-height: 1.35;
    text-shadow: 0 3px 12px rgba(0, 0, 0, 0.55);
    opacity: 0;
}

.poster-wrap.no-cover::after {
    opacity: 1;
}

.poster-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s ease, opacity 0.2s ease;
}

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

.card-play {
    position: absolute;
    right: 13px;
    bottom: 13px;
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: rgba(239, 68, 68, 0.86);
    box-shadow: 0 12px 26px rgba(239, 68, 68, 0.36);
}

.rank-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    color: #fff;
    font-weight: 900;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    box-shadow: 0 12px 24px rgba(239, 68, 68, 0.3);
}

.card-body {
    display: block;
    padding: 16px;
}

.card-title {
    display: block;
    min-height: 48px;
    color: #fff;
    font-size: 17px;
    line-height: 1.38;
}

.card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 12px;
}

.card-meta span,
.info-pill,
.tag-pill {
    display: inline-flex;
    align-items: center;
    min-height: 25px;
    padding: 4px 8px;
    border-radius: 999px;
    color: #cbd5e1;
    background: rgba(148, 163, 184, 0.12);
    font-size: 12px;
}

.card-genre,
.card-line {
    display: block;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.55;
}

.card-genre {
    margin-top: 12px;
    color: #fecaca;
}

.card-line {
    margin-top: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

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

.category-chip,
.category-panel {
    display: block;
    min-height: 100%;
    padding: 20px;
    border: 1px solid rgba(148, 163, 184, 0.15);
    border-radius: 22px;
    background:
        linear-gradient(135deg, rgba(15, 23, 42, 0.92), rgba(30, 41, 59, 0.72)),
        radial-gradient(circle at top right, rgba(239, 68, 68, 0.16), transparent 16rem);
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.category-chip:hover,
.category-panel:hover {
    transform: translateY(-4px);
    border-color: rgba(239, 68, 68, 0.32);
}

.category-chip strong,
.category-panel strong {
    display: block;
    color: #fff;
    font-size: 20px;
}

.category-chip span,
.category-panel span,
.category-panel p {
    display: block;
    margin-top: 10px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.7;
}

.glass-band {
    margin: 28px 0;
    padding: 28px;
    border: 1px solid var(--line);
    border-radius: 26px;
    background: rgba(15, 23, 42, 0.64);
    box-shadow: var(--shadow);
    backdrop-filter: blur(16px);
}

.horizontal-scroll {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(250px, 310px);
    gap: 22px;
    overflow-x: auto;
    padding: 6px 2px 18px;
    scrollbar-width: thin;
}

.search-panel {
    display: grid;
    grid-template-columns: minmax(240px, 1fr) 160px 160px 160px;
    gap: 14px;
    align-items: center;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: rgba(15, 23, 42, 0.76);
}

.search-panel input,
.search-panel select {
    width: 100%;
    height: 46px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 14px;
    padding: 0 14px;
    color: #fff;
    background: rgba(2, 6, 23, 0.55);
    outline: none;
}

.search-panel input:focus,
.search-panel select:focus {
    border-color: rgba(239, 68, 68, 0.52);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.16);
}

.no-results {
    display: none;
    padding: 32px;
    text-align: center;
    color: var(--muted);
    border: 1px dashed rgba(148, 163, 184, 0.22);
    border-radius: 22px;
}

.no-results.show {
    display: block;
}

.detail-hero {
    position: relative;
    padding: 118px 0 54px;
    overflow: hidden;
}

.detail-bg {
    position: absolute;
    inset: 0;
    opacity: 0.32;
    background: linear-gradient(135deg, rgba(127, 29, 29, 0.35), rgba(2, 6, 23, 0.88));
}

.detail-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(12px);
    transform: scale(1.05);
}

.detail-bg::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, #020617, rgba(2, 6, 23, 0.48));
}

.detail-inner {
    position: relative;
    z-index: 2;
    width: min(1200px, calc(100% - 32px));
    margin: 0 auto;
    display: grid;
    grid-template-columns: 330px minmax(0, 1fr);
    gap: 36px;
    align-items: end;
}

.detail-poster {
    border-radius: 26px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(15, 23, 42, 0.72);
    box-shadow: var(--shadow);
}

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

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

.breadcrumb a {
    color: #fecaca;
}

.detail-title {
    font-size: clamp(32px, 5vw, 58px);
}

.detail-subtitle {
    max-width: 760px;
    color: #dbeafe;
    font-size: 18px;
    line-height: 1.8;
}

.info-row,
.tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 18px;
}

.player-section {
    width: min(1200px, calc(100% - 32px));
    margin: 0 auto;
    padding: 34px 0 70px;
}

.player-shell {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 28px;
    background: #000;
    box-shadow: var(--shadow);
    cursor: pointer;
}

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

.player-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    color: #fff;
    border: 0;
    background: radial-gradient(circle at center, rgba(239, 68, 68, 0.24), rgba(0, 0, 0, 0.62));
    cursor: pointer;
}

.player-shell.is-playing .player-overlay {
    display: none;
}

.play-icon {
    width: 76px;
    height: 76px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    box-shadow: 0 20px 44px rgba(239, 68, 68, 0.38);
    font-size: 30px;
}

.content-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 28px;
    width: min(1200px, calc(100% - 32px));
    margin: 0 auto;
    padding-bottom: 70px;
}

.article-panel,
.side-panel {
    border: 1px solid var(--line);
    border-radius: 26px;
    background: rgba(15, 23, 42, 0.72);
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.22);
}

.article-panel {
    padding: clamp(22px, 4vw, 36px);
}

.article-panel h2,
.side-panel h2 {
    margin: 0 0 18px;
    font-size: 26px;
}

.article-panel p {
    color: var(--soft);
    line-height: 1.9;
    font-size: 16px;
}

.side-panel {
    padding: 20px;
    align-self: start;
}

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

.side-item {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    padding: 10px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.04);
    transition: background 0.2s ease;
}

.side-item:hover {
    background: rgba(239, 68, 68, 0.12);
}

.side-item img {
    width: 72px;
    height: 92px;
    object-fit: cover;
    border-radius: 12px;
    background: rgba(148, 163, 184, 0.12);
}

.side-item strong {
    display: block;
    color: #fff;
    line-height: 1.35;
}

.side-item span {
    display: block;
    margin-top: 6px;
    color: var(--muted);
    font-size: 12px;
}

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

.site-footer {
    border-top: 1px solid var(--line);
    background: rgba(2, 6, 23, 0.86);
}

.footer-inner {
    width: min(1200px, calc(100% - 32px));
    margin: 0 auto;
    padding: 40px 0;
    display: grid;
    grid-template-columns: 1.2fr 0.7fr 1fr;
    gap: 30px;
}

.footer-brand p,
.footer-links a {
    color: var(--muted);
    line-height: 1.7;
}

.footer-brand p {
    margin: 16px 0 0;
}

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

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

.footer-links a:hover {
    color: #fecaca;
}

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

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

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

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

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

    .nav-toggle {
        display: block;
    }

    .hero-content {
        grid-template-columns: 1fr;
        align-items: center;
        padding-top: 44px;
    }

    .hero-panel {
        display: none;
    }

    .hero-control {
        display: none;
    }

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

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

    .footer-brand {
        grid-column: 1 / -1;
    }
}

@media (max-width: 560px) {
    .nav-wrap,
    .main-section,
    .page-section,
    .page-hero,
    .detail-inner,
    .player-section,
    .content-grid,
    .footer-inner {
        width: min(100% - 24px, 1200px);
    }

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

    .hero {
        min-height: 82vh;
    }

    .hero-content {
        min-height: calc(82vh - 68px);
        padding-bottom: 64px;
    }

    .hero-actions,
    .section-actions,
    .detail-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .btn-primary,
    .btn-ghost,
    .btn-soft {
        width: 100%;
    }

    .movie-grid,
    .movie-grid.small,
    .movie-grid.featured,
    .category-grid,
    .category-panels,
    .footer-inner,
    .footer-links.compact {
        grid-template-columns: 1fr;
    }

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

    .detail-hero {
        padding-top: 104px;
    }

    .play-icon {
        width: 62px;
        height: 62px;
        font-size: 24px;
    }
}
