:root {
    color-scheme: dark;
    --bg: #070913;
    --bg-soft: #101527;
    --panel: rgba(15, 21, 39, 0.82);
    --panel-solid: #11182b;
    --card: #151c30;
    --line: rgba(255, 255, 255, 0.10);
    --text: #f8fafc;
    --muted: #a7b0c5;
    --accent: #ff4d67;
    --accent-2: #7c3aed;
    --gold: #f9b234;
    --radius-xl: 28px;
    --radius-lg: 20px;
    --shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    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(255, 77, 103, 0.18), transparent 28rem),
        radial-gradient(circle at 80% 0, rgba(124, 58, 237, 0.20), transparent 30rem),
        linear-gradient(180deg, #080a14 0%, #0b1020 46%, #070913 100%);
}

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

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

button,
input {
    font: inherit;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    border-bottom: 1px solid var(--line);
    background: rgba(7, 9, 19, 0.76);
    backdrop-filter: blur(18px);
}

.header-inner {
    width: min(1400px, calc(100% - 40px));
    min-height: 74px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 24px;
}

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

.brand-mark {
    width: 40px;
    height: 40px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    box-shadow: 0 14px 36px rgba(255, 77, 103, 0.32);
}

.brand-text {
    font-size: 1.35rem;
}

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

.main-nav a,
.category-strip a {
    color: var(--muted);
    padding: 10px 14px;
    border-radius: 999px;
    transition: 0.2s ease;
}

.main-nav a:hover,
.main-nav a.is-active,
.category-strip a:hover,
.category-strip a.is-active {
    color: #fff;
    background: rgba(255, 255, 255, 0.10);
}

.header-search {
    width: min(310px, 30vw);
    display: flex;
    align-items: center;
    padding: 5px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
}

.header-search input,
.inline-filter input {
    min-width: 0;
    flex: 1;
    color: #fff;
    border: 0;
    outline: 0;
    background: transparent;
}

.header-search input {
    padding: 0 12px;
}

.header-search button,
.inline-filter button {
    cursor: pointer;
    border: 0;
    color: #fff;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

.header-search button {
    padding: 8px 14px;
}

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

.menu-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    margin: 4px auto;
    background: #fff;
}

main {
    width: min(1400px, calc(100% - 40px));
    margin: 0 auto;
}

.hero-slider {
    position: relative;
    min-height: 680px;
    margin-top: 28px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
    background: #080b14;
}

.hero-slide {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.55fr);
    align-items: center;
    gap: 40px;
    padding: 72px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.6s ease;
}

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

.hero-backdrop {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(7, 9, 19, 0.96), rgba(7, 9, 19, 0.66), rgba(7, 9, 19, 0.86)),
        var(--hero-image) center / cover;
    filter: saturate(1.1);
    transform: scale(1.04);
}

.hero-content,
.hero-poster {
    position: relative;
    z-index: 2;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #ffd7df;
    font-size: 0.86rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.hero-content h1,
.page-hero h1,
.detail-info h1 {
    margin: 16px 0 12px;
    font-size: clamp(2.2rem, 6vw, 5.8rem);
    line-height: 0.98;
    letter-spacing: -0.08em;
}

.hero-content h2 {
    margin: 0 0 16px;
    color: #fff;
    font-size: clamp(1.4rem, 3vw, 2.5rem);
}

.hero-content p,
.page-hero p,
.lead-text {
    max-width: 760px;
    color: var(--muted);
    font-size: 1.08rem;
    line-height: 1.8;
}

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

.hero-tags span,
.chip-row span,
.detail-meta span,
.tag-cloud span {
    color: #fff;
    padding: 6px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.09);
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 28px;
}

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

.primary-btn {
    color: #fff;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    box-shadow: 0 16px 42px rgba(255, 77, 103, 0.28);
}

.ghost-btn {
    border: 1px solid var(--line);
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

.primary-btn:hover,
.ghost-btn:hover,
.movie-card:hover,
.category-card:hover,
.category-overview-card:hover {
    transform: translateY(-4px);
}

.hero-poster img {
    width: min(360px, 100%);
    aspect-ratio: 3 / 4.2;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 30px;
    box-shadow: 0 26px 90px rgba(0, 0, 0, 0.55);
}

.hero-dots {
    position: absolute;
    left: 72px;
    bottom: 36px;
    z-index: 3;
    display: flex;
    gap: 10px;
}

.hero-dots button {
    width: 38px;
    height: 6px;
    cursor: pointer;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.30);
}

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

.category-strip {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    margin: 24px 0 10px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
}

.category-strip a {
    flex: 0 0 auto;
}

.section-block {
    margin: 54px 0;
}

.dark-panel {
    padding: 32px;
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
}

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

.section-heading h2 {
    margin: 6px 0 0;
    font-size: clamp(1.6rem, 3vw, 2.8rem);
    letter-spacing: -0.05em;
}

.section-heading a {
    color: #ffd7df;
    font-weight: 800;
}

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

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

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

.movie-card {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.06);
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.18);
    transition: transform 0.22s ease, border-color 0.22s ease, background 0.22s ease;
}

.movie-card:hover {
    border-color: rgba(255, 255, 255, 0.26);
    background: rgba(255, 255, 255, 0.09);
}

.poster-link {
    position: relative;
    display: block;
    overflow: hidden;
    background: #101527;
}

.poster-link img {
    width: 100%;
    aspect-ratio: 3 / 4.15;
    object-fit: cover;
    transition: transform 0.4s ease;
}

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

.rank-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 2;
    min-width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    color: #121212;
    background: linear-gradient(135deg, #ffe08a, var(--gold));
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
}

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

.movie-card-body h2 {
    margin: 8px 0;
    font-size: 1rem;
    line-height: 1.35;
}

.movie-card-body p {
    min-height: 66px;
    margin: 0 0 12px;
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.6;
}

.meta-line {
    color: #ffd7df;
    font-size: 0.78rem;
    font-weight: 800;
}

.compact {
    display: grid;
    grid-template-columns: 118px 1fr;
}

.compact .poster-link img {
    height: 100%;
    aspect-ratio: 3 / 4;
}

.compact .movie-card-body p {
    min-height: auto;
}

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

.category-card,
.category-overview-card a {
    position: relative;
    min-height: 180px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: end;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.06);
    transition: transform 0.22s ease;
}

.category-card img,
.category-overview-card img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.38;
}

.category-card::after,
.category-overview-card a::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent, rgba(7, 9, 19, 0.92));
}

.category-card span,
.category-card strong,
.category-overview-card div {
    position: relative;
    z-index: 2;
}

.category-card span,
.category-overview-card h2 {
    font-size: 1.35rem;
    font-weight: 900;
}

.category-card strong,
.category-overview-card p {
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.65;
}

.page-hero,
.detail-hero {
    margin-top: 28px;
    padding: 54px;
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    background:
        radial-gradient(circle at top right, rgba(255, 77, 103, 0.18), transparent 36rem),
        linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03));
    box-shadow: var(--shadow);
}

.compact-hero,
.category-hero,
.search-hero {
    min-height: 300px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.inline-filter {
    width: min(680px, 100%);
    display: flex;
    gap: 8px;
    margin-top: 26px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.07);
}

.inline-filter input {
    padding: 0 14px;
}

.inline-filter button {
    padding: 12px 18px;
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 24px;
    color: var(--muted);
}

.breadcrumb a {
    color: #ffd7df;
}

.detail-hero {
    display: grid;
    grid-template-columns: minmax(220px, 350px) 1fr;
    gap: 42px;
    align-items: center;
}

.detail-poster img {
    width: 100%;
    aspect-ratio: 3 / 4.2;
    object-fit: cover;
    border-radius: 30px;
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.45);
}

.watch-section {
    margin: 44px 0;
}

.player-shell {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    background: #000;
    box-shadow: var(--shadow);
}

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

.player-overlay {
    position: absolute;
    inset: 0;
    z-index: 4;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    cursor: pointer;
    border: 0;
    color: #fff;
    background: radial-gradient(circle, rgba(255, 77, 103, 0.20), rgba(0, 0, 0, 0.62));
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

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

.play-icon {
    width: 86px;
    height: 86px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    font-size: 2rem;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    box-shadow: 0 20px 50px rgba(255, 77, 103, 0.45);
}

.story-block {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 24px;
}

.story-card,
.side-card {
    padding: 28px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.06);
}

.story-card h2,
.side-card h2 {
    margin: 0 0 14px;
    font-size: 1.45rem;
}

.story-card p {
    margin: 0 0 22px;
    color: var(--muted);
    line-height: 1.9;
}

.side-card dl {
    display: grid;
    grid-template-columns: 84px 1fr;
    gap: 12px;
    margin: 0;
}

.side-card dt {
    color: #ffd7df;
    font-weight: 800;
}

.side-card dd {
    margin: 0;
    color: var(--muted);
}

.site-footer {
    margin-top: 80px;
    padding: 46px max(20px, calc((100vw - 1400px) / 2)) 24px;
    border-top: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.04);
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: 32px;
}

.footer-grid p,
.footer-bottom {
    color: var(--muted);
    line-height: 1.8;
}

.footer-grid h2 {
    margin: 0 0 12px;
    font-size: 1rem;
}

.footer-grid a:not(.footer-brand) {
    display: block;
    color: var(--muted);
    margin: 8px 0;
}

.footer-bottom {
    margin-top: 32px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
}

.is-filtered-out {
    display: none !important;
}

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

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

    .hero-slide {
        grid-template-columns: 1fr;
    }

    .hero-poster {
        display: none;
    }
}

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

    .main-nav {
        order: 4;
        width: 100%;
        display: none;
        flex-direction: column;
        align-items: stretch;
        margin-left: 0;
    }

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

    .header-search {
        width: min(420px, 100%);
        margin-left: auto;
    }

    .menu-toggle {
        display: block;
    }

    .hero-slider {
        min-height: 620px;
    }

    .hero-slide {
        padding: 42px 28px;
    }

    .hero-dots {
        left: 28px;
    }

    .detail-hero,
    .story-block,
    .footer-grid {
        grid-template-columns: 1fr;
    }

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

@media (max-width: 680px) {
    main,
    .header-inner {
        width: min(100% - 24px, 1400px);
    }

    .hero-slider {
        min-height: 640px;
        border-radius: 22px;
    }

    .hero-content h1,
    .page-hero h1,
    .detail-info h1 {
        font-size: clamp(2rem, 14vw, 3.4rem);
    }

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

    .compact {
        grid-template-columns: 96px 1fr;
    }

    .page-hero,
    .detail-hero,
    .dark-panel,
    .story-card,
    .side-card {
        padding: 22px;
        border-radius: 22px;
    }

    .movie-card-body p {
        min-height: auto;
    }

    .inline-filter {
        border-radius: 22px;
        flex-direction: column;
    }

    .inline-filter input {
        min-height: 46px;
    }
}

@media (max-width: 430px) {
    .movie-grid,
    .ranking-grid,
    .ranking-list,
    .category-grid,
    .category-overview-grid {
        grid-template-columns: 1fr;
    }
}
