:root {
    --bg: #f9fafb;
    --surface: #ffffff;
    --surface-soft: #fff7ed;
    --muted: #f3f4f6;
    --text: #111827;
    --text-soft: #4b5563;
    --text-faint: #6b7280;
    --line: #e5e7eb;
    --brand: #d97706;
    --brand-dark: #92400e;
    --brand-soft: #fef3c7;
    --shadow: 0 20px 50px rgba(15, 23, 42, 0.12);
    --radius: 18px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
    line-height: 1.6;
}

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

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

button,
input {
    font: inherit;
}

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

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

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

.header-inner {
    display: flex;
    align-items: center;
    gap: 28px;
    min-height: 72px;
}

.brand,
.footer-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    color: var(--text);
}

.brand-mark {
    display: inline-grid;
    width: 38px;
    height: 38px;
    place-items: center;
    color: #fff;
    background: linear-gradient(135deg, #f59e0b, #b45309);
    border-radius: 12px;
    box-shadow: 0 12px 30px rgba(217, 119, 6, 0.28);
}

.brand-text {
    white-space: nowrap;
    font-size: 18px;
}

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

.nav-link,
.mobile-nav-link {
    color: #374151;
    font-weight: 600;
    transition: color 0.2s ease;
}

.nav-link:hover,
.nav-link.is-active,
.mobile-nav-link:hover,
.mobile-nav-link.is-active {
    color: var(--brand);
}

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

.header-search input,
.mobile-search input,
.search-control input {
    width: 220px;
    border: 1px solid #d1d5db;
    border-radius: 999px;
    padding: 10px 14px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.header-search input:focus,
.mobile-search input:focus,
.search-control input:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.16);
}

.header-search button,
.mobile-search button {
    border: 0;
    border-radius: 999px;
    padding: 10px 16px;
    color: #fff;
    background: var(--brand);
    cursor: pointer;
}

.mobile-menu-button {
    display: none;
    margin-left: auto;
    border: 0;
    background: transparent;
    padding: 8px;
    cursor: pointer;
}

.mobile-menu-button span {
    display: block;
    width: 24px;
    height: 2px;
    margin: 5px 0;
    background: var(--text);
}

.mobile-nav {
    display: none;
    padding: 16px;
    border-top: 1px solid var(--line);
    background: #fff;
}

.mobile-nav.is-open {
    display: grid;
    gap: 14px;
}

.hero-carousel {
    position: relative;
    height: 70vh;
    min-height: 520px;
    overflow: hidden;
    background: #111827;
}

.hero-slides,
.hero-slide,
.hero-media,
.hero-media img,
.detail-bg,
.detail-bg img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.hero-slide {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.8s ease;
}

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

.hero-media,
.detail-bg {
    overflow: hidden;
    background: radial-gradient(circle at 30% 30%, rgba(245, 158, 11, 0.42), transparent 36%), linear-gradient(135deg, #111827, #451a03 60%, #020617);
}

.hero-media img,
.detail-bg img {
    object-fit: cover;
    transform: scale(1.02);
}

.hero-media.image-missing::after,
.poster-shell.image-missing::after,
.detail-bg.image-missing::after {
    content: attr(data-title);
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 18px;
    color: rgba(255, 255, 255, 0.92);
    font-size: clamp(20px, 4vw, 44px);
    font-weight: 800;
    text-align: center;
    background: radial-gradient(circle at top left, rgba(245, 158, 11, 0.45), transparent 38%), linear-gradient(135deg, #111827, #78350f);
}

.hero-overlay,
.detail-bg-mask {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.82), rgba(0, 0, 0, 0.48), rgba(0, 0, 0, 0.06));
}

.hero-content {
    position: relative;
    z-index: 2;
    display: flex;
    min-height: 100%;
    flex-direction: column;
    justify-content: center;
    color: #fff;
}

.hero-content h1,
.detail-intro h1,
.compact-hero h1 {
    max-width: 760px;
    margin: 14px 0 16px;
    font-size: clamp(36px, 6vw, 70px);
    line-height: 1.08;
    font-weight: 900;
    letter-spacing: -0.04em;
}

.hero-content p,
.detail-intro p,
.compact-hero p {
    max-width: 720px;
    margin: 0 0 28px;
    color: rgba(255, 255, 255, 0.82);
    font-size: 18px;
}

.hero-pill,
.section-kicker {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    border-radius: 999px;
    padding: 7px 13px;
    color: #fff;
    background: var(--brand);
    font-size: 14px;
    font-weight: 800;
}

.section-kicker {
    color: var(--brand-dark);
    background: var(--brand-soft);
}

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

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 11px 20px;
    font-weight: 800;
    transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}

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

.btn-primary {
    color: #fff;
    background: var(--brand);
}

.btn-primary:hover {
    background: var(--brand-dark);
}

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

.btn-ghost.light {
    color: var(--text);
    background: #fff;
    border-color: var(--line);
}

.btn-soft {
    color: var(--brand-dark);
    background: var(--brand-soft);
}

.hero-control {
    position: absolute;
    top: 50%;
    z-index: 4;
    width: 46px;
    height: 46px;
    border: 0;
    border-radius: 999px;
    color: #fff;
    background: rgba(0, 0, 0, 0.46);
    font-size: 34px;
    line-height: 1;
    cursor: pointer;
    transform: translateY(-50%);
}

.hero-prev {
    left: 24px;
}

.hero-next {
    right: 24px;
}

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

.hero-dot {
    width: 12px;
    height: 12px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.55);
    cursor: pointer;
    transition: width 0.2s ease, background 0.2s ease;
}

.hero-dot.is-active {
    width: 34px;
    background: #fff;
}

.content-section {
    padding: 72px 0;
}

.section-warm {
    background: linear-gradient(180deg, #fffbeb, #fff);
}

.section-muted {
    background: #f3f4f6;
}

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

.section-heading h2 {
    margin: 10px 0 4px;
    font-size: clamp(26px, 4vw, 38px);
    line-height: 1.1;
    font-weight: 900;
    letter-spacing: -0.03em;
}

.section-heading p {
    max-width: 720px;
    margin: 0;
    color: var(--text-faint);
}

.section-more {
    color: var(--brand);
    font-weight: 800;
}

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

.movie-grid-large {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 28px;
}

.movie-card {
    overflow: hidden;
    background: #fff;
    border: 1px solid rgba(229, 231, 235, 0.85);
    border-radius: var(--radius);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.07);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.movie-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow);
}

.poster-link {
    display: block;
}

.poster-shell {
    position: relative;
    display: block;
    aspect-ratio: 2 / 3;
    overflow: hidden;
    background: linear-gradient(135deg, #111827, #78350f);
}

.movie-card-large .poster-shell {
    aspect-ratio: 16 / 12;
}

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

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

.poster-year {
    position: absolute;
    top: 12px;
    right: 12px;
    border-radius: 999px;
    padding: 5px 10px;
    color: #fff;
    background: rgba(0, 0, 0, 0.66);
    font-size: 12px;
    font-weight: 800;
}

.card-body {
    padding: 16px;
}

.card-title {
    display: -webkit-box;
    min-height: 2.8em;
    overflow: hidden;
    color: var(--text);
    font-size: 17px;
    font-weight: 900;
    line-height: 1.4;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.card-title:hover {
    color: var(--brand);
}

.card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 10px 0;
    color: var(--text-faint);
    font-size: 13px;
}

.card-meta span {
    border-radius: 999px;
    padding: 3px 8px;
    background: #f3f4f6;
}

.card-desc {
    display: -webkit-box;
    margin: 0;
    overflow: hidden;
    color: var(--text-soft);
    font-size: 14px;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.card-tags,
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.card-tags span,
.tag-cloud span {
    border-radius: 999px;
    padding: 5px 10px;
    color: var(--brand-dark);
    background: var(--brand-soft);
    font-size: 12px;
    font-weight: 800;
}

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

.movie-card-list {
    display: grid;
    grid-template-columns: 160px 1fr;
}

.movie-card-list .poster-shell {
    height: 100%;
    min-height: 130px;
    aspect-ratio: auto;
}

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

.category-card,
.overview-card,
.year-card {
    display: block;
    padding: 26px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.category-card:hover,
.overview-card:hover,
.year-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
}

.category-card span,
.overview-main span,
.year-card span {
    color: var(--brand);
    font-weight: 900;
}

.category-card h3,
.overview-card h2,
.year-card h2 {
    margin: 8px 0;
    font-size: 24px;
    font-weight: 900;
}

.category-card p,
.overview-card p {
    color: var(--text-soft);
}

.overview-links,
.sitemap-links {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin-top: 16px;
}

.overview-links a,
.sitemap-block a {
    border-radius: 999px;
    padding: 7px 11px;
    color: #374151;
    background: #f3f4f6;
    font-size: 13px;
    font-weight: 700;
}

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

.rank-panel {
    position: sticky;
    top: 96px;
    padding: 24px;
    background: #111827;
    border-radius: var(--radius);
    color: #fff;
    box-shadow: var(--shadow);
}

.rank-panel-head span {
    color: #fbbf24;
    font-weight: 900;
}

.rank-panel-head h2 {
    margin: 4px 0 18px;
    font-size: 30px;
}

.rank-list {
    display: grid;
    gap: 10px;
    padding: 0;
    margin: 0;
    list-style: none;
}

.rank-list a {
    display: grid;
    grid-template-columns: 42px 1fr auto;
    gap: 10px;
    align-items: center;
    padding: 12px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.08);
}

.rank-num,
.ranking-index {
    color: #fbbf24;
    font-weight: 900;
}

.rank-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rank-score,
.ranking-score {
    color: #fef3c7;
    font-weight: 900;
}

.page-main {
    min-height: 60vh;
}

.compact-hero {
    padding: 86px 0;
    color: #fff;
    background: radial-gradient(circle at 20% 20%, rgba(245, 158, 11, 0.45), transparent 30%), linear-gradient(135deg, #111827, #78350f);
}

.compact-hero h1 {
    color: #fff;
}

.compact-hero p {
    max-width: 760px;
    color: rgba(255, 255, 255, 0.82);
}

.dark-hero {
    background: radial-gradient(circle at 70% 10%, rgba(245, 158, 11, 0.34), transparent 28%), linear-gradient(135deg, #020617, #111827);
}

.toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
    padding: 18px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.sticky-toolbar {
    position: sticky;
    top: 88px;
    z-index: 9;
}

.search-control {
    display: grid;
    gap: 8px;
    color: var(--text-soft);
    font-weight: 800;
}

.search-control input {
    width: 320px;
}

.wide-search input {
    width: min(580px, 82vw);
}

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

.filter-pills button {
    border: 0;
    border-radius: 999px;
    padding: 9px 14px;
    color: #374151;
    background: #fff;
    border: 1px solid var(--line);
    cursor: pointer;
}

.filter-pills button.is-active,
.filter-pills button:hover {
    color: #fff;
    background: var(--brand);
    border-color: var(--brand);
}

.result-count {
    margin: 0 0 20px;
    color: var(--text-faint);
    font-weight: 800;
}

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

.ranking-row {
    display: grid;
    grid-template-columns: 92px 58px 1fr auto;
    gap: 16px;
    align-items: center;
    padding: 16px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.ranking-cover .poster-shell {
    border-radius: 14px;
}

.ranking-title {
    font-size: 20px;
    font-weight: 900;
}

.ranking-info p {
    margin: 6px 0 0;
    color: var(--text-soft);
}

.ranking-score {
    color: var(--brand);
    font-size: 26px;
}

.detail-hero {
    position: relative;
    overflow: hidden;
    min-height: 620px;
    color: #fff;
    background: #111827;
}

.detail-hero-inner {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    gap: 42px;
    align-items: center;
    min-height: 620px;
    padding: 72px 0;
}

.detail-poster {
    border: 6px solid rgba(255, 255, 255, 0.18);
    border-radius: 24px;
    box-shadow: var(--shadow);
}

.detail-intro h1 {
    color: #fff;
}

.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 22px 0;
}

.detail-meta span {
    border-radius: 999px;
    padding: 7px 11px;
    color: #fff;
    background: rgba(255, 255, 255, 0.14);
}

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

.player-card,
.text-panel,
.side-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

.player-card {
    overflow: hidden;
}

.player-box {
    position: relative;
    overflow: hidden;
    background: #000;
    aspect-ratio: 16 / 9;
}

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

.player-overlay {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 12px;
    color: #fff;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.18), rgba(0, 0, 0, 0.72));
    transition: opacity 0.25s ease;
}

.player-box.is-playing .player-overlay {
    opacity: 0;
    pointer-events: none;
}

.player-start {
    display: grid;
    width: 82px;
    height: 82px;
    place-items: center;
    border: 0;
    border-radius: 50%;
    color: #fff;
    background: var(--brand);
    font-size: 32px;
    cursor: pointer;
    box-shadow: 0 18px 42px rgba(217, 119, 6, 0.45);
}

.player-overlay p {
    margin: 0;
    font-weight: 900;
}

.text-panel {
    margin-top: 22px;
    padding: 24px;
}

.text-panel h2,
.side-card h2 {
    margin: 0 0 14px;
    font-size: 24px;
    font-weight: 900;
}

.text-panel p {
    margin: 0;
    color: var(--text-soft);
    font-size: 17px;
}

.detail-sidebar {
    display: grid;
    gap: 18px;
}

.side-card {
    padding: 22px;
}

.side-card dl {
    display: grid;
    grid-template-columns: 64px 1fr;
    gap: 10px 14px;
    margin: 0;
}

.side-card dt {
    color: var(--text-faint);
    font-weight: 800;
}

.side-card dd {
    margin: 0;
}

.side-card a {
    display: block;
    margin: 9px 0;
    color: var(--brand);
    font-weight: 800;
}

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

.sitemap-block {
    padding: 24px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.sitemap-block.full {
    grid-column: 1 / -1;
}

.sitemap-block h2 {
    margin-top: 0;
}

.sitemap-block > div {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
}

.site-footer {
    background: #111827;
    color: #d1d5db;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 34px;
    padding: 48px 0;
}

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

.footer-grid a {
    display: block;
    margin: 7px 0;
    color: #d1d5db;
}

.footer-brand {
    color: #fff;
    font-size: 22px;
}

.footer-bottom {
    padding: 20px;
    color: #9ca3af;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

[data-search-item].is-hidden {
    display: none !important;
}

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

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

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

    .rank-panel {
        position: static;
    }
}

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

    .mobile-menu-button {
        display: block;
    }

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

    .hero-content h1,
    .detail-intro h1,
    .compact-hero h1 {
        font-size: 38px;
    }

    .hero-control {
        display: none;
    }

    .section-heading,
    .toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .movie-grid,
    .movie-grid-large,
    .category-grid,
    .overview-grid,
    .year-grid,
    .sitemap-layout {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .detail-hero-inner {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .detail-poster {
        width: min(280px, 74vw);
    }

    .ranking-row {
        grid-template-columns: 76px 1fr;
    }

    .ranking-index,
    .ranking-score {
        display: none;
    }

    .footer-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .container {
        width: min(100% - 22px, 1180px);
    }

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

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

    .hero-content p,
    .detail-intro p,
    .compact-hero p {
        font-size: 16px;
    }

    .content-section {
        padding: 48px 0;
    }

    .movie-grid,
    .movie-grid-large,
    .category-grid,
    .overview-grid,
    .year-grid,
    .sitemap-layout {
        grid-template-columns: 1fr;
    }

    .movie-card-list {
        grid-template-columns: 112px 1fr;
    }

    .movie-card-list .poster-shell {
        min-height: 150px;
    }

    .card-body {
        padding: 13px;
    }

    .search-control input,
    .wide-search input {
        width: 100%;
    }
}
