:root {
    color-scheme: dark;
    --bg: #020617;
    --bg-soft: #0f172a;
    --bg-card: rgba(15, 23, 42, 0.72);
    --bg-card-strong: rgba(15, 23, 42, 0.92);
    --line: rgba(148, 163, 184, 0.18);
    --text: #f8fafc;
    --muted: #94a3b8;
    --muted-strong: #cbd5e1;
    --accent: #ef4444;
    --accent-strong: #dc2626;
    --accent-soft: rgba(239, 68, 68, 0.14);
    --shadow: 0 24px 80px rgba(0, 0, 0, 0.38);
    --radius-xl: 28px;
    --radius-lg: 20px;
    --radius-md: 14px;
    --max: 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", "Microsoft YaHei", sans-serif;
    background:
        radial-gradient(circle at top left, rgba(239, 68, 68, 0.18), transparent 32rem),
        radial-gradient(circle at top right, rgba(59, 130, 246, 0.12), transparent 30rem),
        linear-gradient(135deg, #020617 0%, #0f172a 48%, #020617 100%);
    color: var(--text);
    min-height: 100vh;
}

body.no-scroll {
    overflow: hidden;
}

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

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

img.image-missing {
    opacity: 0;
}

button,
input {
    font: inherit;
}

button {
    cursor: pointer;
}

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    background: rgba(2, 6, 23, 0.92);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(18px);
}

.nav-shell {
    width: min(var(--max), calc(100% - 32px));
    min-height: 76px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 24px;
}

.brand,
.footer-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.brand-icon {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent);
    box-shadow: 0 0 34px rgba(239, 68, 68, 0.35);
}

.brand-copy {
    display: grid;
    gap: 2px;
}

.brand-copy strong {
    font-size: 22px;
    letter-spacing: -0.03em;
}

.brand-copy small {
    color: var(--muted);
    font-size: 12px;
}

.desktop-nav {
    display: flex;
    align-items: center;
    gap: 18px;
    flex: 1;
    overflow: hidden;
    white-space: nowrap;
}

.desktop-nav a,
.mobile-panel a,
.footer-links a {
    color: var(--muted-strong);
    transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.desktop-nav a:hover,
.mobile-panel a:hover,
.footer-links a:hover {
    color: #ffffff;
}

.nav-search {
    display: flex;
    align-items: center;
    width: min(330px, 32vw);
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 999px;
    overflow: hidden;
    background: rgba(15, 23, 42, 0.7);
}

.nav-search input,
.mobile-search input,
.search-page-form input,
.inline-filter input {
    width: 100%;
    border: 0;
    outline: 0;
    color: var(--text);
    background: transparent;
}

.nav-search input {
    padding: 11px 14px 11px 18px;
}

.nav-search button,
.mobile-search button,
.search-page-form button {
    border: 0;
    color: #ffffff;
    background: var(--accent);
    padding: 11px 16px;
    transition: background 0.2s ease;
}

.nav-search button:hover,
.mobile-search button:hover,
.search-page-form button:hover {
    background: var(--accent-strong);
}

.mobile-menu-toggle {
    display: none;
    width: 42px;
    height: 42px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.72);
    color: var(--text);
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
}

.mobile-menu-toggle span {
    width: 19px;
    height: 2px;
    background: currentColor;
    border-radius: 99px;
}

.mobile-panel {
    width: min(var(--max), calc(100% - 32px));
    margin: 0 auto;
    padding: 0 0 18px;
    display: grid;
    gap: 10px;
}

.mobile-panel[hidden] {
    display: none;
}

.mobile-panel a {
    padding: 11px 14px;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.7);
}

.mobile-search,
.search-page-form {
    display: flex;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.7);
}

.mobile-search input,
.search-page-form input {
    padding: 12px 16px;
}

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

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

.hero-carousel {
    position: relative;
    height: min(640px, calc(100vh - 10px));
    min-height: 500px;
    overflow: hidden;
    background: #020617;
}

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

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

.hero-slide img,
.detail-backdrop {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.02);
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(to top, #020617 0%, rgba(2, 6, 23, 0.84) 36%, rgba(2, 6, 23, 0.34) 100%),
        linear-gradient(to right, rgba(2, 6, 23, 0.82), rgba(2, 6, 23, 0.18));
}

.hero-content {
    position: absolute;
    left: max(16px, calc((100% - var(--max)) / 2));
    right: 16px;
    bottom: 74px;
    max-width: 760px;
}

.hero-label,
.category-pill,
.year-pill,
.rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    font-weight: 700;
}

.hero-label {
    padding: 8px 15px;
    color: #ffffff;
    background: rgba(239, 68, 68, 0.9);
    backdrop-filter: blur(10px);
    margin-bottom: 16px;
}

.hero-content h1,
.page-hero h1,
.detail-copy h1 {
    margin: 0;
    font-size: clamp(36px, 7vw, 68px);
    line-height: 1.02;
    letter-spacing: -0.06em;
}

.hero-content p,
.page-hero p,
.detail-copy p {
    color: var(--muted-strong);
    font-size: clamp(16px, 2vw, 20px);
    line-height: 1.75;
}

.hero-meta,
.detail-meta,
.movie-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    color: var(--muted);
}

.hero-meta span,
.detail-meta span {
    padding: 7px 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.62);
}

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

.primary-button,
.ghost-button,
.section-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    font-weight: 800;
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.primary-button {
    color: #ffffff;
    background: var(--accent);
    padding: 13px 24px;
    box-shadow: 0 18px 44px rgba(239, 68, 68, 0.28);
}

.primary-button:hover,
.ghost-button:hover,
.section-action:hover {
    transform: translateY(-2px);
}

.primary-button:hover {
    background: var(--accent-strong);
}

.ghost-button,
.section-action {
    color: var(--text);
    border: 1px solid var(--line);
    background: rgba(15, 23, 42, 0.62);
    padding: 12px 20px;
}

.small-button {
    padding: 10px 16px;
    font-size: 14px;
}

.hero-control {
    position: absolute;
    top: 50%;
    width: 48px;
    height: 48px;
    border-radius: 999px;
    border: 1px solid rgba(226, 232, 240, 0.2);
    background: rgba(2, 6, 23, 0.56);
    color: #ffffff;
    font-size: 36px;
    line-height: 1;
    backdrop-filter: blur(10px);
}

.hero-prev {
    left: 20px;
}

.hero-next {
    right: 20px;
}

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

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

.hero-dot.is-active {
    width: 34px;
    background: var(--accent);
}

.page-sections {
    padding: 58px 0;
    display: grid;
    gap: 58px;
}

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

.section-heading h2,
.showcase-panel h2,
.related-sidebar h2,
.detail-article h2 {
    margin: 0;
    font-size: clamp(24px, 3vw, 34px);
    letter-spacing: -0.04em;
}

.section-heading p {
    color: var(--muted);
    margin: 7px 0 0;
}

.movie-grid {
    display: grid;
    gap: 22px;
}

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

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

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

.movie-card:hover {
    transform: translateY(-5px);
    border-color: rgba(239, 68, 68, 0.55);
    box-shadow: var(--shadow);
}

.movie-link {
    display: block;
    height: 100%;
}

.movie-cover {
    position: relative;
    aspect-ratio: 16 / 9;
    margin: 0;
    overflow: hidden;
    background:
        linear-gradient(135deg, rgba(239, 68, 68, 0.18), rgba(59, 130, 246, 0.1)),
        #0f172a;
}

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

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

.movie-cover::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(2, 6, 23, 0.86), transparent 58%);
}

.play-mark {
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 2;
    transform: translate(-50%, -50%) scale(0.9);
    width: 48px;
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    color: #ffffff;
    background: rgba(239, 68, 68, 0.92);
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.movie-card:hover .play-mark {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.category-pill,
.year-pill,
.rank-badge {
    position: absolute;
    z-index: 3;
    padding: 5px 9px;
    font-size: 12px;
    backdrop-filter: blur(8px);
}

.category-pill {
    left: 12px;
    top: 12px;
    color: #fecaca;
    background: rgba(2, 6, 23, 0.74);
}

.year-pill {
    right: 12px;
    bottom: 12px;
    color: #e2e8f0;
    background: rgba(2, 6, 23, 0.74);
}

.rank-badge {
    right: 12px;
    top: 12px;
    color: #ffffff;
    background: rgba(239, 68, 68, 0.88);
}

.movie-body {
    padding: 16px;
}

.featured-card .movie-body {
    padding: 22px;
}

.movie-body h3 {
    margin: 0 0 9px;
    line-height: 1.35;
    font-size: 17px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.2s ease;
}

.featured-card .movie-body h3 {
    font-size: 22px;
}

.movie-card:hover h3 {
    color: #f87171;
}

.movie-body p {
    margin: 0 0 12px;
    color: var(--muted);
    line-height: 1.65;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.movie-meta {
    font-size: 12px;
    gap: 8px;
}

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

.tag-row span {
    color: #cbd5e1;
    background: rgba(30, 41, 59, 0.78);
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 999px;
    padding: 5px 9px;
    font-size: 12px;
}

.large-tags span {
    font-size: 14px;
    padding: 7px 11px;
}

.horizontal-scroller {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 286px;
    gap: 22px;
    overflow-x: auto;
    padding: 4px 2px 18px;
    scrollbar-width: thin;
}

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

.category-tile,
.category-overview-card,
.showcase-panel,
.related-sidebar,
.detail-article,
.player-shell {
    border: 1px solid var(--line);
    background: var(--bg-card);
    border-radius: var(--radius-lg);
}

.category-tile {
    position: relative;
    min-height: 130px;
    padding: 18px;
    overflow: hidden;
    display: grid;
    align-content: space-between;
}

.category-tile::before,
.category-overview-card::before,
.showcase-panel::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.16), transparent 48%);
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.category-tile:hover::before,
.category-overview-card:hover::before,
.showcase-panel:hover::before {
    opacity: 1;
}

.category-tile span,
.category-overview-head span {
    font-weight: 900;
    font-size: 20px;
}

.category-tile strong,
.category-overview-head strong {
    color: #fca5a5;
}

.category-tile small {
    color: var(--muted);
    line-height: 1.5;
}

.split-showcase {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
}

.showcase-panel,
.category-overview-card,
.detail-article,
.related-sidebar {
    position: relative;
    padding: 24px;
}

.compact-list {
    display: grid;
    gap: 14px;
    margin-top: 18px;
}

.compact-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.56);
    transition: background 0.2s ease, transform 0.2s ease;
}

.compact-item:hover {
    background: rgba(30, 41, 59, 0.86);
    transform: translateX(3px);
}

.compact-item img {
    width: 98px;
    height: 62px;
    flex: 0 0 98px;
    object-fit: cover;
    border-radius: 10px;
    background: #0f172a;
}

.compact-item strong {
    display: block;
    margin-bottom: 4px;
    line-height: 1.35;
}

.compact-item small {
    display: block;
    color: var(--muted);
    line-height: 1.4;
}

.compact-rank {
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: var(--accent);
    font-weight: 900;
}

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

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

.page-hero {
    position: relative;
    overflow: hidden;
    background:
        linear-gradient(135deg, rgba(239, 68, 68, 0.18), transparent 38%),
        linear-gradient(180deg, rgba(15, 23, 42, 0.92), rgba(2, 6, 23, 0.2));
    border-bottom: 1px solid var(--line);
}

.small-hero .content-shell {
    padding: 56px 0 46px;
}

.page-hero h1 {
    max-width: 860px;
}

.page-hero p {
    max-width: 820px;
}

.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 9px;
    flex-wrap: wrap;
    color: var(--muted);
    margin-bottom: 18px;
}

.breadcrumbs a:hover {
    color: #ffffff;
}

.inline-filter {
    max-width: 680px;
    margin-top: 24px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.7);
}

.inline-filter input {
    padding: 15px 20px;
}

.category-overview-card {
    display: grid;
    gap: 16px;
}

.category-overview-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

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

.mini-list .compact-item:nth-child(n + 4) {
    display: none;
}

.search-page-form {
    max-width: 780px;
    margin-top: 26px;
}

.search-page-form input {
    font-size: 16px;
}

.search-page-form button {
    padding-inline: 24px;
    font-weight: 800;
}

.empty-filter-message {
    text-align: center;
    color: var(--muted);
    border: 1px solid var(--line);
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 28px;
}

.detail-page {
    padding-top: 76px;
}

.detail-hero {
    position: relative;
    min-height: 560px;
    overflow: hidden;
    display: flex;
    align-items: end;
}

.detail-backdrop {
    position: absolute;
    inset: 0;
    filter: blur(2px);
    opacity: 0.45;
}

.detail-backdrop-mask {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(to top, #020617 0%, rgba(2, 6, 23, 0.82) 55%, rgba(2, 6, 23, 0.45) 100%),
        radial-gradient(circle at 18% 48%, rgba(239, 68, 68, 0.22), transparent 34rem);
}

.detail-hero-inner {
    position: relative;
    padding: 54px 0;
}

.detail-intro {
    display: grid;
    grid-template-columns: 330px minmax(0, 1fr);
    gap: 34px;
    align-items: end;
}

.detail-poster {
    margin: 0;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    border-radius: var(--radius-xl);
    border: 1px solid rgba(226, 232, 240, 0.18);
    box-shadow: var(--shadow);
    background: #0f172a;
}

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

.detail-copy p {
    max-width: 850px;
}

.player-section {
    margin-top: -18px;
    position: relative;
    z-index: 2;
}

.player-shell {
    position: relative;
    overflow: hidden;
    background: #000000;
    box-shadow: var(--shadow);
}

.video-player {
    width: 100%;
    aspect-ratio: 16 / 9;
    display: block;
    background: #000000;
}

.player-start {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 12px;
    border: 0;
    color: #ffffff;
    background:
        linear-gradient(to top, rgba(2, 6, 23, 0.94), rgba(2, 6, 23, 0.42)),
        radial-gradient(circle, rgba(239, 68, 68, 0.22), transparent 22rem);
}

.player-start span {
    width: 76px;
    height: 76px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: var(--accent);
    box-shadow: 0 18px 52px rgba(239, 68, 68, 0.34);
    font-size: 30px;
}

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

.player-start small {
    color: var(--muted-strong);
}

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

.detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 28px;
    padding: 48px 0 72px;
    align-items: start;
}

.detail-article {
    display: grid;
    gap: 28px;
}

.detail-article section + section {
    border-top: 1px solid var(--line);
    padding-top: 24px;
}

.detail-article p {
    color: var(--muted-strong);
    line-height: 1.95;
    font-size: 17px;
}

.related-sidebar {
    position: sticky;
    top: 100px;
}

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

.info-list div {
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 13px;
    background: rgba(15, 23, 42, 0.5);
}

.info-list dt {
    color: var(--muted);
    font-size: 13px;
    margin-bottom: 4px;
}

.info-list dd {
    margin: 0;
    color: var(--text);
}

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

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

.footer-grid h2 {
    margin: 0 0 14px;
    font-size: 16px;
}

.footer-grid p {
    color: var(--muted);
    line-height: 1.75;
    margin: 14px 0 0;
}

.footer-links {
    display: grid;
    gap: 8px;
}

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

    .nav-shell {
        justify-content: space-between;
    }

    .mobile-menu-toggle {
        display: inline-flex;
    }

    .nav-search {
        width: min(420px, 44vw);
    }

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

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

    .related-sidebar {
        position: static;
    }
}

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

    .brand-copy small {
        display: none;
    }

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

    .hero-content {
        bottom: 88px;
    }

    .hero-control {
        display: none;
    }

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

    .four-cols,
    .three-cols,
    .category-grid,
    .category-overview-grid,
    .split-showcase,
    .ranking-strip,
    .top-ranking,
    .footer-grid {
        grid-template-columns: 1fr;
    }

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

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

    .detail-copy h1 {
        font-size: clamp(32px, 10vw, 52px);
    }

    .info-list {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .nav-shell {
        width: min(100% - 22px, var(--max));
        min-height: 66px;
    }

    .page-main,
    .detail-page {
        padding-top: 66px;
    }

    .content-shell,
    .mobile-panel,
    .footer-grid {
        width: min(100% - 22px, var(--max));
    }

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

    .brand-copy strong {
        font-size: 19px;
    }

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

    .hero-content p {
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .page-sections {
        padding: 38px 0;
        gap: 38px;
    }

    .horizontal-scroller {
        grid-auto-columns: 84vw;
    }

    .compact-item img {
        width: 86px;
        height: 58px;
        flex-basis: 86px;
    }

    .detail-hero {
        min-height: auto;
    }

    .detail-hero-inner {
        padding: 34px 0;
    }
}
