:root {
    color-scheme: dark;
    --night-950: #0d0d10;
    --night-900: #1a1a1f;
    --night-850: #222228;
    --night-800: #2c2c34;
    --night-700: #4a4a52;
    --night-500: #777782;
    --night-400: #a0a0aa;
    --night-300: #b0b0b8;
    --night-200: #d1d1d6;
    --night-100: #e7e7ea;
    --gold-500: #eab308;
    --gold-400: #facc15;
    --ember-500: #ef4444;
    --ember-400: #f87171;
    --panel: rgba(26, 26, 31, 0.78);
    --panel-soft: rgba(44, 44, 52, 0.62);
    --border: rgba(255, 255, 255, 0.08);
    --shadow: 0 18px 60px rgba(0, 0, 0, 0.45);
    --glow: 0 0 28px rgba(234, 179, 8, 0.28);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: Inter, "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
    background:
        radial-gradient(circle at top left, rgba(234, 179, 8, 0.12), transparent 34rem),
        radial-gradient(circle at top right, rgba(239, 68, 68, 0.13), transparent 30rem),
        var(--night-950);
    color: var(--night-100);
    line-height: 1.65;
}

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

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

button,
input {
    font: inherit;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--border);
    background: rgba(13, 13, 16, 0.92);
    backdrop-filter: blur(18px);
}

.nav-wrap {
    max-width: 1280px;
    margin: 0 auto;
    min-height: 72px;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
}

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

.brand span:last-child {
    background: linear-gradient(135deg, var(--gold-400), var(--ember-400));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 11px;
    display: grid;
    place-items: center;
    font-size: 14px;
    color: var(--night-950);
    background: linear-gradient(135deg, var(--gold-400), var(--ember-500));
    box-shadow: var(--glow);
}

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

.nav-link {
    padding: 9px 14px;
    border-radius: 10px;
    color: var(--night-200);
    transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.nav-link:hover,
.nav-link.is-active {
    color: var(--gold-400);
    background: rgba(250, 204, 21, 0.1);
    transform: translateY(-1px);
}

.mobile-toggle {
    display: none;
    width: 42px;
    height: 42px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--panel-soft);
    color: var(--night-100);
}

.mobile-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    margin: 4px auto;
    border-radius: 2px;
    background: var(--night-100);
}

.hero {
    position: relative;
    min-height: 600px;
    overflow: hidden;
    background: var(--night-900);
}

.hero-track,
.hero-slide {
    position: absolute;
    inset: 0;
}

.hero-slide {
    opacity: 0;
    pointer-events: none;
    background-size: cover;
    background-position: center;
    transition: opacity 0.85s ease;
}

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

.hero-overlay,
.detail-backdrop::after {
    position: absolute;
    inset: 0;
    content: "";
    background:
        linear-gradient(90deg, rgba(13, 13, 16, 0.96), rgba(13, 13, 16, 0.74) 42%, rgba(13, 13, 16, 0.22)),
        linear-gradient(0deg, var(--night-950), transparent 36%);
}

.hero-content {
    position: relative;
    z-index: 2;
    width: min(680px, calc(100% - 48px));
    min-height: 600px;
    margin-left: max(24px, calc((100vw - 1280px) / 2 + 24px));
    padding-top: 88px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 22px;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 5px 14px;
    border: 1px solid rgba(250, 204, 21, 0.28);
    border-radius: 999px;
    background: rgba(234, 179, 8, 0.16);
    color: var(--gold-400);
    font-size: 14px;
    font-weight: 700;
}

.hero h1,
.page-hero h1,
.detail-info h1 {
    margin: 0;
    color: #fff;
    font-size: clamp(36px, 6vw, 72px);
    line-height: 1.06;
    letter-spacing: -0.04em;
}

.hero p,
.page-hero p,
.detail-line {
    margin: 0;
    color: var(--night-200);
    font-size: 18px;
    max-width: 720px;
}

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

.hero-meta span,
.detail-meta span,
.wide-meta span {
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(44, 44, 52, 0.76);
    border: 1px solid var(--border);
}

.hero-actions,
.detail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

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

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

.btn-primary {
    color: var(--night-950);
    background: linear-gradient(135deg, var(--gold-400), var(--ember-500));
    box-shadow: var(--glow);
}

.btn-ghost {
    color: var(--night-100);
    background: rgba(26, 26, 31, 0.66);
    border-color: var(--border);
}

.hero-poster {
    position: absolute;
    right: max(24px, calc((100vw - 1280px) / 2 + 38px));
    bottom: 48px;
    z-index: 2;
    width: min(330px, 26vw);
    aspect-ratio: 2 / 3;
    overflow: hidden;
    border-radius: 26px;
    border: 1px solid rgba(250, 204, 21, 0.23);
    box-shadow: var(--shadow), var(--glow);
}

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

.hero-dots {
    position: absolute;
    z-index: 3;
    left: max(24px, calc((100vw - 1280px) / 2 + 24px));
    bottom: 34px;
    display: flex;
    gap: 10px;
}

.hero-dot {
    width: 42px;
    height: 4px;
    padding: 0;
    border: 0;
    border-radius: 99px;
    background: rgba(255, 255, 255, 0.28);
}

.hero-dot.is-active {
    background: linear-gradient(90deg, var(--gold-400), var(--ember-400));
}

.content-wrap {
    max-width: 1280px;
    margin: 0 auto;
    padding: 54px 24px;
}

.quick-search {
    padding-bottom: 10px;
}

.search-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
    gap: 22px;
    align-items: center;
    padding: 24px;
    border: 1px solid var(--border);
    border-radius: 24px;
    background: linear-gradient(135deg, rgba(26, 26, 31, 0.92), rgba(44, 44, 52, 0.62));
    box-shadow: var(--shadow);
}

.search-panel h2,
.section-title h2,
.side-panel h2,
.rank-aside h2,
.story-card h2 {
    margin: 0;
    color: #fff;
    font-size: 28px;
    line-height: 1.2;
}

.search-panel p,
.section-title p,
.footer-brand p {
    margin: 8px 0 0;
    color: var(--night-400);
}

.search-box {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 16px;
    min-height: 50px;
    border-radius: 14px;
    border: 1px solid rgba(250, 204, 21, 0.22);
    background: rgba(13, 13, 16, 0.72);
}

.search-box span {
    color: var(--gold-400);
    font-size: 22px;
}

.search-box input {
    width: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--night-100);
}

.category-pills,
.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 18px;
}

.category-pills a,
.filter-button {
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 9px 15px;
    color: var(--night-200);
    background: rgba(44, 44, 52, 0.55);
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.category-pills a:hover,
.filter-button:hover,
.filter-button.is-active {
    color: var(--night-950);
    background: linear-gradient(135deg, var(--gold-400), var(--ember-400));
    transform: translateY(-1px);
}

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

.section-title span {
    flex: 1;
    height: 4px;
    min-width: 120px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(234, 179, 8, 0.5), transparent);
}

.movie-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(176px, 1fr));
    gap: 24px;
}

.featured-grid {
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
}

.all-grid {
    grid-template-columns: repeat(auto-fill, minmax(154px, 1fr));
}

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

.poster-link {
    display: block;
}

.poster-frame {
    position: relative;
    display: block;
    aspect-ratio: 2 / 3;
    overflow: hidden;
    border-radius: 18px;
    border: 1px solid var(--border);
    background: var(--night-800);
    box-shadow: 0 12px 34px rgba(0, 0, 0, 0.25);
}

.poster-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.45s ease;
}

.poster-mask {
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(13, 13, 16, 0.88), rgba(13, 13, 16, 0.05) 54%);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.movie-card:hover .poster-frame img {
    transform: scale(1.08);
}

.movie-card:hover .poster-mask,
.movie-card:hover .hover-info {
    opacity: 1;
}

.quality-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    padding: 3px 8px;
    border-radius: 7px;
    color: #fff;
    background: rgba(13, 13, 16, 0.82);
    border: 1px solid var(--border);
    font-size: 12px;
    font-weight: 800;
}

.hover-info {
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 12px;
    z-index: 2;
    color: #fff;
    font-size: 13px;
    line-height: 1.45;
    opacity: 0;
    transition: opacity 0.25s ease;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-body h3 {
    margin: 12px 0 4px;
    color: var(--night-100);
    font-size: 16px;
    font-weight: 800;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-body h3 a:hover,
.wide-info h3 a:hover {
    color: var(--gold-400);
}

.card-meta,
.card-line {
    margin: 0;
    color: var(--night-400);
    font-size: 13px;
}

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

.tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.tag-row span {
    padding: 3px 8px;
    border-radius: 999px;
    color: var(--gold-400);
    background: rgba(234, 179, 8, 0.1);
    border: 1px solid rgba(234, 179, 8, 0.16);
    font-size: 12px;
}

.is-compact .card-line,
.is-compact .tag-row {
    display: none;
}

.two-column,
.ranking-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(320px, 0.8fr);
    gap: 30px;
    align-items: start;
}

.wide-list,
.side-list,
.rank-aside {
    display: grid;
    gap: 16px;
}

.wide-card {
    display: grid;
    grid-template-columns: 158px minmax(0, 1fr);
    gap: 18px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--panel);
    transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.wide-card:hover {
    border-color: rgba(250, 204, 21, 0.28);
    background: rgba(44, 44, 52, 0.82);
    transform: translateY(-2px);
}

.wide-img {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 10;
    border-radius: 15px;
    background: var(--night-800);
}

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

.rank-number {
    position: absolute;
    left: 10px;
    top: 10px;
    min-width: 34px;
    padding: 4px 8px;
    border-radius: 9px;
    color: var(--night-950);
    background: linear-gradient(135deg, var(--gold-400), var(--ember-400));
    font-size: 13px;
    font-weight: 900;
    text-align: center;
}

.wide-info h3 {
    margin: 0 0 8px;
    font-size: 18px;
    line-height: 1.32;
}

.wide-info p {
    margin: 0 0 12px;
    color: var(--night-400);
    font-size: 14px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.wide-meta {
    gap: 6px;
    font-size: 12px;
}

.side-panel,
.rank-aside {
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 24px;
    background: linear-gradient(135deg, rgba(26, 26, 31, 0.92), rgba(44, 44, 52, 0.54));
    box-shadow: var(--shadow);
}

.side-panel .wide-card,
.rank-aside .wide-card {
    grid-template-columns: 108px minmax(0, 1fr);
    padding: 10px;
}

.side-panel .wide-info p,
.side-panel .wide-meta,
.rank-aside .wide-info p,
.rank-aside .wide-meta {
    display: none;
}

.side-panel h2,
.rank-aside h2 {
    margin: 0 0 18px;
}

.rank-aside h2:not(:first-child) {
    margin-top: 28px;
}

.more-link {
    display: inline-flex;
    margin-top: 18px;
    color: var(--gold-400);
    font-weight: 800;
}

.category-card-grid,
.category-tile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 18px;
}

.category-card {
    min-height: 132px;
    padding: 22px;
    border: 1px solid var(--border);
    border-radius: 22px;
    background:
        radial-gradient(circle at right top, rgba(234, 179, 8, 0.2), transparent 56%),
        rgba(26, 26, 31, 0.8);
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.category-card:hover,
.category-tile:hover {
    transform: translateY(-3px);
    border-color: rgba(250, 204, 21, 0.3);
}

.category-card strong {
    display: block;
    color: #fff;
    font-size: 22px;
}

.category-card span {
    display: block;
    margin-top: 8px;
    color: var(--night-400);
}

.category-tile {
    position: relative;
    min-height: 230px;
    overflow: hidden;
    border-radius: 24px;
    border: 1px solid var(--border);
    background: var(--night-800);
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.category-tile img {
    width: 100%;
    height: 100%;
    min-height: 230px;
    object-fit: cover;
    transition: transform 0.45s ease;
}

.category-tile:hover img {
    transform: scale(1.07);
}

.category-tile span {
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(13, 13, 16, 0.9), rgba(13, 13, 16, 0.1));
}

.category-tile strong,
.category-tile em {
    position: absolute;
    left: 18px;
    right: 18px;
    z-index: 2;
}

.category-tile strong {
    bottom: 52px;
    color: #fff;
    font-size: 24px;
    font-style: normal;
}

.category-tile em {
    bottom: 22px;
    color: var(--night-300);
    font-style: normal;
}

.page-hero {
    position: relative;
    overflow: hidden;
    min-height: 360px;
    display: grid;
    place-items: center;
    padding: 72px 24px;
    text-align: center;
    background:
        radial-gradient(circle at top left, rgba(234, 179, 8, 0.2), transparent 30rem),
        radial-gradient(circle at right, rgba(239, 68, 68, 0.16), transparent 28rem),
        linear-gradient(135deg, var(--night-900), var(--night-950));
}

.small-hero h1 {
    font-size: clamp(34px, 5vw, 58px);
}

.small-hero > div {
    display: grid;
    justify-items: center;
    gap: 16px;
}

.detail-hero {
    position: relative;
    overflow: hidden;
    min-height: 560px;
}

.detail-backdrop {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    filter: blur(4px) saturate(1.1);
    transform: scale(1.05);
}

.detail-wrap {
    position: relative;
    z-index: 2;
    max-width: 1280px;
    min-height: 560px;
    margin: 0 auto;
    padding: 72px 24px 54px;
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    gap: 42px;
    align-items: end;
}

.detail-poster {
    aspect-ratio: 2 / 3;
    overflow: hidden;
    border-radius: 26px;
    border: 1px solid rgba(250, 204, 21, 0.25);
    box-shadow: var(--shadow), var(--glow);
    background: var(--night-800);
}

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

.detail-info {
    display: grid;
    gap: 18px;
    max-width: 820px;
}

.detail-info h1 {
    font-size: clamp(34px, 5vw, 62px);
}

.detail-tags {
    margin-top: 0;
}

.detail-main {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.85fr);
    gap: 28px;
    align-items: start;
}

.player-card,
.story-card {
    border: 1px solid var(--border);
    border-radius: 24px;
    background: var(--panel);
    box-shadow: var(--shadow);
}

.player-card {
    padding: 14px;
}

.player-shell {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    border-radius: 18px;
    background: #000;
}

.movie-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #000;
}

.player-overlay {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    border: 0;
    padding: 0;
    background: radial-gradient(circle at center, rgba(13, 13, 16, 0.2), rgba(13, 13, 16, 0.74));
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

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

.play-button {
    width: 84px;
    height: 84px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    padding-left: 5px;
    color: var(--night-950);
    font-size: 34px;
    background: linear-gradient(135deg, var(--gold-400), var(--ember-500));
    box-shadow: var(--glow), 0 18px 54px rgba(0, 0, 0, 0.45);
}

.story-card {
    padding: 26px;
}

.story-card h2 {
    font-size: 24px;
    margin-top: 20px;
}

.story-card h2:first-child {
    margin-top: 0;
}

.story-card p {
    margin: 12px 0 0;
    color: var(--night-300);
}

.site-footer {
    margin-top: 44px;
    border-top: 1px solid var(--border);
    background: rgba(13, 13, 16, 0.96);
}

.footer-grid {
    max-width: 1280px;
    margin: 0 auto;
    padding: 42px 24px;
    display: grid;
    grid-template-columns: minmax(260px, 1.2fr) repeat(2, minmax(160px, 0.45fr));
    gap: 30px;
}

.site-footer h3 {
    margin: 0 0 14px;
    color: #fff;
}

.site-footer a:not(.brand) {
    display: block;
    margin: 7px 0;
    color: var(--night-400);
}

.site-footer a:hover {
    color: var(--gold-400);
}

.footer-bottom {
    max-width: 1280px;
    margin: 0 auto;
    padding: 18px 24px 28px;
    color: var(--night-500);
    border-top: 1px solid var(--border);
}

[data-card].is-hidden {
    display: none;
}

@media (max-width: 1024px) {
    .hero-poster {
        display: none;
    }

    .hero-content {
        width: min(760px, calc(100% - 48px));
    }

    .two-column,
    .ranking-layout,
    .detail-main {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .nav-wrap {
        min-height: 64px;
        padding: 0 16px;
    }

    .mobile-toggle {
        display: block;
    }

    .main-nav {
        position: absolute;
        left: 16px;
        right: 16px;
        top: 72px;
        display: none;
        flex-direction: column;
        align-items: stretch;
        padding: 14px;
        border: 1px solid var(--border);
        border-radius: 18px;
        background: rgba(13, 13, 16, 0.96);
        box-shadow: var(--shadow);
    }

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

    .hero,
    .hero-content {
        min-height: 560px;
    }

    .hero-content {
        margin-left: 0;
        padding: 102px 20px 72px;
        width: 100%;
    }

    .hero h1,
    .page-hero h1,
    .detail-info h1 {
        font-size: 36px;
    }

    .hero p,
    .page-hero p,
    .detail-line {
        font-size: 16px;
    }

    .hero-dots {
        left: 20px;
    }

    .content-wrap {
        padding: 38px 18px;
    }

    .search-panel,
    .detail-wrap,
    .footer-grid {
        grid-template-columns: 1fr;
    }

    .detail-wrap {
        gap: 24px;
        padding-top: 44px;
        align-items: center;
    }

    .detail-poster {
        width: min(250px, 76vw);
    }

    .wide-card,
    .side-panel .wide-card,
    .rank-aside .wide-card {
        grid-template-columns: 112px minmax(0, 1fr);
    }

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

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

    .section-title span {
        width: 100%;
    }
}

@media (max-width: 430px) {
    .movie-grid,
    .featured-grid,
    .all-grid {
        grid-template-columns: 1fr 1fr;
        gap: 14px;
    }

    .card-body h3 {
        font-size: 14px;
    }

    .wide-card {
        grid-template-columns: 96px minmax(0, 1fr);
        gap: 12px;
    }

    .wide-info h3 {
        font-size: 15px;
    }
}
