:root {
    --bg: #030712;
    --panel: rgba(17, 24, 39, 0.78);
    --panel-strong: rgba(17, 24, 39, 0.95);
    --muted: #9ca3af;
    --soft: #d1d5db;
    --text: #ffffff;
    --line: rgba(148, 163, 184, 0.18);
    --blue: #3b82f6;
    --blue-deep: #1d4ed8;
    --gold: #facc15;
    --radius: 22px;
    --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(37, 99, 235, 0.18), transparent 38rem),
        radial-gradient(circle at 80% 0%, rgba(250, 204, 21, 0.10), transparent 28rem),
        var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}

body.nav-open {
    overflow: hidden;
}

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

img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

button,
input {
    font: inherit;
}

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

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

.header-inner {
    width: min(1180px, calc(100% - 32px));
    height: 72px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.site-logo,
.footer-logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    letter-spacing: 0.04em;
}

.logo-mark {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--blue), var(--blue-deep));
    box-shadow: 0 12px 30px rgba(37, 99, 235, 0.42);
}

.desktop-nav,
.mobile-nav,
.footer-links {
    display: flex;
    align-items: center;
    gap: 18px;
}

.desktop-nav a,
.mobile-nav a,
.footer-links a {
    color: var(--soft);
    font-size: 15px;
    transition: color 0.2s ease, background 0.2s ease;
}

.desktop-nav a {
    padding: 8px 12px;
    border-radius: 999px;
}

.desktop-nav a:hover,
.desktop-nav a.is-active,
.mobile-nav a:hover,
.mobile-nav a.is-active,
.footer-links a:hover {
    color: #fff;
    background: rgba(59, 130, 246, 0.18);
}

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

.menu-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    margin: 5px 0;
    background: currentColor;
    border-radius: 999px;
}

.mobile-nav {
    display: none;
}

.hero-carousel {
    position: relative;
    min-height: 82vh;
    overflow: hidden;
    background: #020617;
}

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

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

.hero-slide img {
    position: absolute;
    inset: 0;
    filter: saturate(1.08) contrast(1.05);
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(3, 7, 18, 0.96) 0%, rgba(3, 7, 18, 0.76) 42%, rgba(3, 7, 18, 0.22) 100%),
        linear-gradient(0deg, rgba(3, 7, 18, 0.96) 0%, transparent 44%);
}

.hero-content {
    position: relative;
    z-index: 2;
    width: min(1180px, calc(100% - 32px));
    min-height: 82vh;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-top: 96px;
    padding-bottom: 96px;
}

.hero-kicker,
.eyebrow {
    color: var(--gold);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.hero-content h1,
.page-hero h1,
.detail-copy h1 {
    margin: 14px 0 16px;
    font-size: clamp(38px, 6vw, 72px);
    line-height: 1.02;
    letter-spacing: -0.05em;
}

.hero-content p {
    max-width: 660px;
    margin: 0;
    color: #e5e7eb;
    font-size: 18px;
    line-height: 1.8;
}

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

.hero-tags {
    margin: 24px 0 28px;
}

.hero-tags span,
.tag-list span {
    display: inline-flex;
    align-items: center;
    border: 1px solid rgba(96, 165, 250, 0.32);
    border-radius: 999px;
    color: #bfdbfe;
    background: rgba(30, 64, 175, 0.20);
}

.hero-tags span {
    padding: 8px 12px;
}

.tag-list span {
    padding: 5px 9px;
    font-size: 12px;
}

.hero-actions,
.search-row,
.section-heading,
.detail-grid,
.footer-inner,
.split-section,
.ranking-layout {
    display: flex;
    align-items: center;
}

.hero-actions {
    gap: 14px;
}

.primary-btn,
.ghost-btn,
.text-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    font-weight: 700;
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.primary-btn {
    min-height: 46px;
    padding: 0 22px;
    background: linear-gradient(135deg, var(--blue), var(--blue-deep));
    box-shadow: 0 18px 36px rgba(37, 99, 235, 0.35);
}

.ghost-btn {
    min-height: 46px;
    padding: 0 22px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.08);
}

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

.hero-control {
    position: absolute;
    top: 50%;
    z-index: 4;
    width: 48px;
    height: 48px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.42);
    color: white;
    font-size: 34px;
    line-height: 1;
}

.hero-prev {
    left: 24px;
}

.hero-next {
    right: 24px;
}

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

.hero-dots button {
    width: 30px;
    height: 4px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.35);
}

.hero-dots button.is-active {
    background: #fff;
}

.section {
    padding: 54px 0;
}

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

.section-heading {
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 24px;
}

.section-heading.compact {
    margin-bottom: 18px;
}

.section-heading h2,
.rank-panel h2,
.content-card h2 {
    margin: 6px 0 0;
    font-size: clamp(24px, 3vw, 34px);
    line-height: 1.15;
}

.text-link {
    color: #93c5fd;
}

.search-panel {
    margin: 0 0 26px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(17, 24, 39, 0.66);
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.18);
}

.search-panel label {
    display: block;
    margin-bottom: 12px;
    color: var(--soft);
    font-weight: 700;
}

.search-row {
    gap: 12px;
}

.search-row input {
    flex: 1;
    min-width: 240px;
    height: 46px;
    padding: 0 16px;
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 999px;
    outline: 0;
    background: rgba(3, 7, 18, 0.66);
    color: #fff;
}

.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.filter-buttons button {
    height: 36px;
    padding: 0 13px;
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--soft);
}

.filter-buttons button.is-active,
.filter-buttons button:hover {
    color: #fff;
    border-color: rgba(96, 165, 250, 0.55);
    background: rgba(37, 99, 235, 0.28);
}

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

.home-grid,
.related-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
}

.movie-card {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(17, 24, 39, 0.68);
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.22);
    transition: transform 0.24s ease, border-color 0.24s ease, background 0.24s ease;
}

.movie-card:hover {
    transform: translateY(-6px);
    border-color: rgba(96, 165, 250, 0.45);
    background: rgba(17, 24, 39, 0.92);
}

.poster-wrap {
    position: relative;
    display: block;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    background: rgba(15, 23, 42, 0.72);
}

.poster-wrap img {
    transition: transform 0.45s ease;
}

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

.poster-glow {
    position: absolute;
    inset: auto 0 0;
    height: 45%;
    background: linear-gradient(0deg, rgba(3, 7, 18, 0.92), transparent);
}

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

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

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

.movie-card h3 a:hover {
    color: #93c5fd;
}

.movie-card p {
    min-height: 54px;
    margin: 0 0 12px;
    color: var(--soft);
    font-size: 13px;
    line-height: 1.55;
}

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

.category-tile {
    position: relative;
    min-height: 190px;
    overflow: hidden;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(17, 24, 39, 0.75);
    box-shadow: var(--shadow);
}

.category-tile img {
    position: absolute;
    inset: 0;
    opacity: 0.28;
    filter: saturate(1.05);
    transition: transform 0.45s ease, opacity 0.45s ease;
}

.category-tile:hover img {
    opacity: 0.42;
    transform: scale(1.08);
}

.category-tile span,
.category-tile small {
    position: relative;
    z-index: 2;
    display: block;
}

.category-tile span {
    margin-bottom: 12px;
    font-size: 22px;
    font-weight: 800;
}

.category-tile small {
    color: var(--soft);
    line-height: 1.7;
}

.split-section {
    align-items: stretch;
    gap: 24px;
}

.rank-panel,
.wide-panel,
.content-card,
.category-overview-card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
    box-shadow: var(--shadow);
}

.rank-panel {
    flex: 0 0 380px;
    padding: 24px;
}

.wide-panel {
    flex: 1;
    min-width: 0;
    padding: 24px;
}

.rank-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.rank-list li + li {
    margin-top: 12px;
}

.rank-list a {
    display: grid;
    grid-template-columns: 46px 58px 1fr;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.04);
    transition: background 0.2s ease, transform 0.2s ease;
}

.rank-list a:hover {
    background: rgba(37, 99, 235, 0.22);
    transform: translateX(4px);
}

.rank-num {
    color: var(--gold);
    font-size: 18px;
    font-weight: 900;
}

.rank-list img {
    width: 58px;
    height: 76px;
    border-radius: 12px;
}

.rank-info strong,
.rank-info em {
    display: block;
}

.rank-info strong {
    margin-bottom: 4px;
}

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

.rail {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 160px;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 8px;
    scrollbar-width: none;
}

.rail::-webkit-scrollbar {
    display: none;
}

.rail-card {
    display: block;
}

.rail-card img {
    aspect-ratio: 3 / 4;
    height: auto;
    border-radius: 18px;
    margin-bottom: 10px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
}

.rail-card strong,
.rail-card span {
    display: block;
}

.rail-card strong {
    line-height: 1.35;
}

.rail-card span {
    color: var(--muted);
    font-size: 12px;
    margin-top: 4px;
}

.page-hero {
    padding: 48px 0 18px;
}

.page-hero p {
    max-width: 780px;
    margin: 0 0 26px;
    color: var(--soft);
    font-size: 17px;
    line-height: 1.8;
}

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

.breadcrumb a:hover {
    color: #93c5fd;
}

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

.category-overview-card {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 18px;
    padding: 18px;
}

.category-cover-stack {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
}

.category-cover-stack img {
    aspect-ratio: 3 / 4;
    height: auto;
    border-radius: 12px;
}

.category-overview-card h2 {
    margin: 0 0 10px;
}

.category-overview-card p {
    margin: 0 0 12px;
    color: var(--soft);
    line-height: 1.7;
}

.mini-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.mini-links a {
    color: #bfdbfe;
    font-size: 13px;
}

.ranking-layout {
    align-items: flex-start;
    gap: 24px;
}

.sticky-rank {
    position: sticky;
    top: 96px;
    max-height: calc(100vh - 120px);
    overflow: auto;
}

.detail-main {
    padding-top: 92px;
}

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

.detail-grid {
    align-items: flex-end;
    gap: 32px;
}

.detail-poster {
    flex: 0 0 260px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 28px;
    box-shadow: var(--shadow);
}

.detail-poster img {
    aspect-ratio: 3 / 4;
    height: auto;
}

.detail-copy {
    flex: 1;
}

.detail-copy h1 {
    max-width: 840px;
}

.lead {
    max-width: 820px;
    margin: 0 0 22px;
    color: #e5e7eb;
    font-size: 19px;
    line-height: 1.8;
}

.detail-tags {
    margin-bottom: 26px;
}

.player-shell {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    border: 1px solid rgba(96, 165, 250, 0.30);
    border-radius: 28px;
    background: #000;
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.5);
}

.player-shell video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background: #000;
}

.player-cover {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.player-cover::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(0, 0, 0, 0.20), rgba(0, 0, 0, 0.72)),
        radial-gradient(circle, rgba(37, 99, 235, 0.18), transparent 44%);
}

.player-cover img {
    position: absolute;
    inset: 0;
    filter: blur(2px) saturate(1.05);
    transform: scale(1.02);
}

.play-button {
    position: relative;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 92px;
    height: 92px;
    border: 1px solid rgba(255, 255, 255, 0.36);
    border-radius: 50%;
    background: rgba(37, 99, 235, 0.82);
    color: white;
    box-shadow: 0 20px 60px rgba(37, 99, 235, 0.38);
}

.play-button span {
    margin-left: 6px;
    font-size: 38px;
}

.player-shell.is-playing .player-cover {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.prose-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 22px;
}

.content-card {
    padding: 26px;
}

.content-card p {
    margin: 14px 0 0;
    color: #dbeafe;
    font-size: 16px;
    line-height: 1.9;
}

.empty-state {
    display: none;
    margin-top: 22px;
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--soft);
    text-align: center;
    background: rgba(17, 24, 39, 0.72);
}

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

.site-footer {
    margin-top: 42px;
    border-top: 1px solid var(--line);
    background: rgba(3, 7, 18, 0.78);
}

.footer-inner {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 34px 0;
    justify-content: space-between;
    gap: 28px;
}

.footer-inner p {
    max-width: 520px;
    margin: 12px 0 0;
    color: var(--muted);
    line-height: 1.7;
}

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

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

    .split-section,
    .ranking-layout {
        flex-direction: column;
    }

    .rank-panel {
        width: 100%;
        flex-basis: auto;
    }

    .sticky-rank {
        position: static;
        max-height: none;
    }
}

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

    .menu-toggle {
        display: block;
    }

    .mobile-nav {
        position: fixed;
        top: 72px;
        left: 0;
        right: 0;
        display: none;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 12px 16px 18px;
        background: rgba(3, 7, 18, 0.96);
        border-bottom: 1px solid var(--line);
    }

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

    .mobile-nav a {
        padding: 14px;
        border-radius: 14px;
    }

    .hero-carousel,
    .hero-content {
        min-height: 78vh;
    }

    .hero-content h1,
    .page-hero h1,
    .detail-copy h1 {
        font-size: 38px;
    }

    .hero-content p,
    .lead {
        font-size: 16px;
    }

    .hero-control {
        display: none;
    }

    .search-row,
    .section-heading,
    .detail-grid,
    .footer-inner {
        flex-direction: column;
        align-items: stretch;
    }

    .search-row input {
        min-width: 0;
        width: 100%;
    }

    .movie-grid,
    .home-grid,
    .related-grid,
    .category-grid,
    .category-overview-grid,
    .prose-section {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .category-overview-card {
        grid-template-columns: 1fr;
    }

    .detail-poster {
        width: min(280px, 100%);
        flex-basis: auto;
    }
}

@media (max-width: 520px) {
    .shell,
    .header-inner,
    .footer-inner,
    .hero-content {
        width: min(100% - 24px, 1180px);
    }

    .movie-grid,
    .home-grid,
    .related-grid,
    .category-grid,
    .category-overview-grid,
    .prose-section {
        grid-template-columns: 1fr;
    }

    .player-shell {
        border-radius: 18px;
    }

    .play-button {
        width: 72px;
        height: 72px;
    }

    .play-button span {
        font-size: 30px;
    }
}
