:root {
    --night-950: #050611;
    --night-900: #090b18;
    --night-850: #0d1021;
    --night-800: #12162a;
    --silver-100: #f8fafc;
    --silver-200: #e5e7eb;
    --silver-300: #cbd5e1;
    --silver-400: #94a3b8;
    --silver-600: #475569;
    --moonlight-300: #a5b4fc;
    --moonlight-500: #6366f1;
    --moonlight-600: #4f46e5;
    --rose: #f472b6;
    --gold: #fbbf24;
    --card: rgba(15, 23, 42, 0.72);
    --line: rgba(148, 163, 184, 0.18);
    --shadow: 0 22px 70px rgba(0, 0, 0, 0.38);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: var(--silver-100);
    background:
        radial-gradient(circle at 18% 4%, rgba(99, 102, 241, 0.32), transparent 34rem),
        radial-gradient(circle at 88% 6%, rgba(244, 114, 182, 0.22), transparent 30rem),
        linear-gradient(180deg, var(--night-950), var(--night-900) 42%, #070815 100%);
    font-family: Inter, "Noto Sans SC", "Microsoft YaHei", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.65;
    min-height: 100vh;
}

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

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

.image-missing {
    opacity: 0;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 60;
    border-bottom: 1px solid var(--line);
    background: rgba(5, 6, 17, 0.76);
    backdrop-filter: blur(18px);
}

.header-inner {
    width: min(1440px, calc(100% - 32px));
    margin: 0 auto;
    min-height: 76px;
    display: flex;
    align-items: center;
    gap: 22px;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
}

.logo-mark {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    color: white;
    font-weight: 900;
    background: linear-gradient(135deg, var(--moonlight-500), var(--rose));
    box-shadow: 0 14px 32px rgba(99, 102, 241, 0.36);
}

.logo-text {
    font-size: 20px;
    font-weight: 850;
    letter-spacing: 0.02em;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 18px;
    flex: 1;
    color: var(--silver-300);
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
}

.main-nav a,
.mobile-panel a {
    transition: color 0.2s ease, transform 0.2s ease;
}

.main-nav a:hover,
.mobile-panel a:hover {
    color: white;
}

.header-search,
.mobile-search,
.wide-search {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-search input,
.mobile-search input,
.wide-search input,
.filter-bar input,
.filter-bar select {
    min-width: 0;
    color: white;
    border: 1px solid var(--line);
    outline: none;
    background: rgba(15, 23, 42, 0.68);
    border-radius: 999px;
    padding: 10px 14px;
}

.header-search input {
    width: 230px;
}

.header-search button,
.mobile-search button,
.wide-search button,
.primary-btn,
.ghost-btn,
.filter-toggle {
    border: 0;
    cursor: pointer;
    border-radius: 999px;
    color: white;
    background: linear-gradient(135deg, var(--moonlight-600), var(--rose));
    padding: 10px 18px;
    font-weight: 750;
    box-shadow: 0 14px 30px rgba(99, 102, 241, 0.22);
}

.ghost-btn,
.filter-toggle {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--line);
    box-shadow: none;
}

.ghost-btn.small {
    padding: 8px 14px;
    font-size: 14px;
}

.menu-toggle {
    display: none;
    color: white;
    font-size: 24px;
    border: 0;
    background: transparent;
}

.mobile-panel {
    display: none;
    width: min(1440px, calc(100% - 32px));
    margin: 0 auto;
    padding: 0 0 18px;
    color: var(--silver-200);
}

.mobile-panel.is-open {
    display: grid;
    gap: 12px;
}

.hero {
    position: relative;
    min-height: 720px;
    overflow: hidden;
    border-bottom: 1px solid var(--line);
}

.hero-slide {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    align-items: center;
    gap: 42px;
    width: min(1440px, calc(100% - 32px));
    margin: 0 auto;
    left: 0;
    right: 0;
    padding: 86px 0 70px;
    opacity: 0;
    transform: translateY(24px) scale(0.985);
    pointer-events: none;
    transition: opacity 0.6s ease, transform 0.6s ease;
}

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

.hero-backdrop {
    position: fixed;
    inset: 0;
    z-index: -1;
    opacity: 0.25;
    filter: blur(18px) saturate(1.2);
}

.hero-backdrop::after,
.detail-bg::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(5, 6, 17, 0.96), rgba(5, 6, 17, 0.76), rgba(5, 6, 17, 0.96));
}

.hero-backdrop img,
.detail-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

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

.eyebrow {
    display: inline-flex;
    align-items: center;
    color: var(--moonlight-300);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.hero h1,
.page-hero h1,
.detail-info h1 {
    margin: 18px 0 18px;
    font-size: clamp(42px, 7vw, 92px);
    line-height: 1.02;
    letter-spacing: -0.06em;
}

.hero p,
.page-hero p,
.detail-info .lead {
    max-width: 760px;
    color: var(--silver-300);
    font-size: clamp(16px, 2.2vw, 22px);
}

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

.hero-tags,
.tag-list {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 18px;
}

.hero-tags span,
.tag-list span {
    display: inline-flex;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 5px 10px;
    color: var(--silver-200);
    background: rgba(255, 255, 255, 0.07);
    font-size: 12px;
}

.tag-list.large span {
    font-size: 13px;
    padding: 7px 12px;
}

.hero-poster {
    position: relative;
    display: block;
    aspect-ratio: 3 / 4.1;
    border-radius: 34px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background:
        linear-gradient(135deg, rgba(99, 102, 241, 0.24), rgba(244, 114, 182, 0.14)),
        var(--night-800);
    box-shadow: var(--shadow);
}

.hero-poster::after,
.poster-wrap::after,
.detail-poster::after,
.ranking-cover::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 45%, rgba(0, 0, 0, 0.58));
    pointer-events: none;
}

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

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

.hero-dot {
    width: 34px;
    height: 5px;
    border-radius: 999px;
    border: 0;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.28);
}

.hero-dot.is-active {
    background: white;
}

.section-wrap {
    width: min(1440px, calc(100% - 32px));
    margin: 0 auto;
    padding: 52px 0;
}

.intro-panel,
.page-hero,
.small-hero {
    width: min(1440px, calc(100% - 32px));
    margin: 36px auto 0;
    padding: 34px;
    border: 1px solid var(--line);
    border-radius: 34px;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.86), rgba(30, 41, 59, 0.42));
    box-shadow: var(--shadow);
}

.intro-panel {
    display: grid;
    grid-template-columns: 1fr 460px;
    gap: 28px;
    align-items: center;
}

.intro-panel h2,
.section-head h2,
.category-block h2,
.detail-content h2 {
    margin: 6px 0 0;
    font-size: clamp(26px, 3vw, 42px);
    letter-spacing: -0.04em;
}

.wide-search input {
    width: 100%;
    min-height: 50px;
}

.wide-search.inline {
    max-width: 620px;
    margin-top: 26px;
}

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

.section-head a {
    color: var(--moonlight-300);
    font-weight: 700;
}

.section-head.compact {
    align-items: center;
}

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

.category-tile,
.category-block,
.rank-panel,
.movie-card,
.ranking-row,
.detail-content article {
    border: 1px solid var(--line);
    border-radius: 28px;
    background: var(--card);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.18);
}

.category-tile {
    min-height: 164px;
    padding: 20px;
    background:
        radial-gradient(circle at 20% 0%, rgba(99, 102, 241, 0.28), transparent 12rem),
        rgba(15, 23, 42, 0.74);
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.category-tile:hover,
.movie-card:hover,
.ranking-row:hover {
    transform: translateY(-4px);
    border-color: rgba(165, 180, 252, 0.42);
}

.category-tile strong {
    display: block;
    font-size: 22px;
}

.category-tile em {
    display: block;
    color: var(--silver-400);
    font-style: normal;
    margin: 3px 0 16px;
}

.category-tile div {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.category-tile span {
    color: var(--silver-300);
    font-size: 12px;
    border-radius: 999px;
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.08);
}

.two-column {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 390px;
    gap: 22px;
    align-items: start;
}

.filter-bar {
    display: none;
    gap: 10px;
    margin-bottom: 22px;
    flex-wrap: wrap;
}

.filter-bar.is-open {
    display: flex;
}

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

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

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

.movie-card {
    overflow: hidden;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.poster-wrap {
    position: relative;
    display: block;
    aspect-ratio: 2 / 2.85;
    overflow: hidden;
    background:
        linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(244, 114, 182, 0.16)),
        var(--night-800);
}

.poster-badge,
.play-dot {
    position: absolute;
    z-index: 2;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.56);
    color: white;
    backdrop-filter: blur(10px);
}

.poster-badge {
    top: 12px;
    left: 12px;
    padding: 5px 9px;
    font-size: 12px;
}

.play-dot {
    right: 12px;
    bottom: 12px;
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
}

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

.movie-title {
    display: -webkit-box;
    min-height: 52px;
    overflow: hidden;
    font-weight: 850;
    font-size: 18px;
    line-height: 1.45;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.movie-card-body p {
    display: -webkit-box;
    min-height: 48px;
    overflow: hidden;
    color: var(--silver-400);
    font-size: 13px;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.meta-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 12px;
    color: var(--silver-400);
    font-size: 13px;
}

.rank-panel {
    position: sticky;
    top: 96px;
    padding: 20px;
}

.rank-list {
    display: grid;
    gap: 10px;
}

.rank-item {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 12px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.055);
}

.rank-num {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 12px;
    color: var(--night-950);
    background: linear-gradient(135deg, var(--gold), white);
    font-weight: 900;
}

.rank-main {
    min-width: 0;
}

.rank-main strong,
.rank-main em {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rank-main em,
.rank-views {
    color: var(--silver-400);
    font-style: normal;
    font-size: 12px;
}

.category-block {
    padding: 24px;
    margin-bottom: 24px;
}

.category-block-head {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 20px;
}

.ranking-list {
    display: grid;
    gap: 16px;
}

.ranking-row {
    display: grid;
    grid-template-columns: 132px minmax(0, 1fr);
    gap: 20px;
    padding: 14px;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.ranking-cover {
    position: relative;
    display: block;
    aspect-ratio: 2 / 2.8;
    overflow: hidden;
    border-radius: 20px;
    background: var(--night-800);
}

.ranking-cover span {
    position: absolute;
    z-index: 3;
    left: 10px;
    bottom: 10px;
    font-weight: 900;
    color: white;
}

.ranking-content h2 {
    margin: 4px 0;
    font-size: 26px;
}

.ranking-content p {
    color: var(--silver-300);
}

.detail-hero {
    position: relative;
    overflow: hidden;
    padding: 84px 0 44px;
}

.detail-bg {
    position: absolute;
    inset: 0;
    z-index: -1;
    opacity: 0.38;
    filter: blur(16px) saturate(1.15);
}

.detail-layout {
    width: min(1440px, calc(100% - 32px));
    margin: 0 auto;
    display: grid;
    grid-template-columns: 330px minmax(0, 1fr);
    gap: 42px;
    align-items: center;
}

.detail-poster {
    position: relative;
    aspect-ratio: 2 / 2.8;
    overflow: hidden;
    border-radius: 32px;
    border: 1px solid var(--line);
    background: var(--night-800);
    box-shadow: var(--shadow);
}

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

.meta-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 24px;
}

.meta-grid span {
    display: grid;
    gap: 4px;
    padding: 13px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.065);
    color: var(--silver-200);
}

.meta-grid b {
    color: var(--silver-400);
    font-size: 12px;
}

.player-section {
    padding-top: 26px;
}

.source-label {
    color: var(--silver-400);
    font-size: 13px;
}

.video-shell {
    position: relative;
    overflow: hidden;
    border-radius: 32px;
    border: 1px solid var(--line);
    background: black;
    box-shadow: var(--shadow);
}

.video-shell video {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: black;
}

.video-start {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    gap: 8px;
    color: white;
    border: 0;
    cursor: pointer;
    background: radial-gradient(circle at center, rgba(99, 102, 241, 0.32), rgba(0, 0, 0, 0.42));
}

.video-start span {
    display: grid;
    place-items: center;
    width: 82px;
    height: 82px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--moonlight-600), var(--rose));
    box-shadow: 0 18px 44px rgba(99, 102, 241, 0.4);
}

.video-start.is-hidden {
    display: none;
}

.player-message {
    position: absolute;
    left: 18px;
    bottom: 12px;
    color: var(--silver-300);
    font-size: 13px;
}

.detail-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.detail-content article {
    padding: 28px;
}

.detail-content p {
    color: var(--silver-300);
    font-size: 17px;
}

.search-results {
    display: grid;
    gap: 12px;
    margin-bottom: 26px;
}

.search-hit {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 16px;
    border-radius: 20px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.06);
}

.search-hit p {
    margin: 4px 0 0;
    color: var(--silver-400);
}

.site-footer {
    margin-top: 50px;
    border-top: 1px solid var(--line);
    background: rgba(5, 6, 17, 0.68);
}

.footer-grid {
    width: min(1440px, calc(100% - 32px));
    margin: 0 auto;
    padding: 38px 0;
    display: grid;
    grid-template-columns: 2fr 1fr 1.4fr;
    gap: 24px;
    color: var(--silver-400);
}

.footer-grid strong,
.footer-grid span {
    display: block;
    color: white;
    margin-bottom: 8px;
}

.footer-grid a {
    display: block;
    margin: 6px 0;
    color: var(--silver-300);
}

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

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

    .menu-toggle {
        display: block;
    }

    .header-search {
        margin-left: auto;
    }

    .hero-slide,
    .detail-layout,
    .intro-panel,
    .two-column {
        grid-template-columns: 1fr;
    }

    .hero {
        min-height: 980px;
    }

    .hero-poster {
        max-width: 340px;
    }

    .rank-panel {
        position: static;
    }

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

@media (max-width: 760px) {
    .header-inner {
        min-height: 66px;
    }

    .logo-text {
        font-size: 16px;
    }

    .header-search {
        display: none;
    }

    .hero {
        min-height: 900px;
    }

    .hero-slide {
        padding-top: 54px;
        gap: 24px;
    }

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

    .intro-panel,
    .page-hero,
    .small-hero {
        padding: 24px;
        border-radius: 24px;
    }

    .wide-search {
        align-items: stretch;
        flex-direction: column;
    }

    .category-grid,
    .movie-grid,
    .movie-grid.wide,
    .movie-grid.category-full,
    .movie-grid.preview,
    .detail-content,
    .footer-grid,
    .meta-grid {
        grid-template-columns: 1fr;
    }

    .ranking-row {
        grid-template-columns: 96px minmax(0, 1fr);
        gap: 14px;
    }

    .ranking-content h2 {
        font-size: 20px;
    }

    .rank-item {
        grid-template-columns: 38px minmax(0, 1fr);
    }

    .rank-views {
        grid-column: 2;
    }
}
