:root {
    --color-primary-50: #f0f9ff;
    --color-primary-100: #e0f2fe;
    --color-primary-600: #0284c7;
    --color-primary-700: #0369a1;
    --color-primary-800: #075985;
    --color-primary-900: #0c4a6e;
    --color-accent-400: #fbbf24;
    --color-accent-500: #f59e0b;
    --color-accent-600: #d97706;
    --color-neutral-50: #fafaf9;
    --color-neutral-100: #f5f5f4;
    --color-neutral-200: #e7e5e4;
    --color-neutral-300: #d6d3d1;
    --color-neutral-600: #57534e;
    --color-neutral-700: #44403c;
    --color-neutral-800: #292524;
    --color-neutral-900: #1c1917;
    --shadow-card: 0 12px 30px rgba(12, 74, 110, 0.12);
    --shadow-hover: 0 18px 45px rgba(12, 74, 110, 0.22);
    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 8px;
    font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--color-neutral-900);
    background: var(--color-neutral-50);
}

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

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

button,
input,
select {
    font: inherit;
}

.site-nav {
    position: sticky;
    top: 0;
    z-index: 50;
    color: #ffffff;
    background: linear-gradient(90deg, var(--color-primary-900), var(--color-primary-800));
    box-shadow: 0 12px 30px rgba(12, 74, 110, 0.22);
}

.nav-inner {
    max-width: 1280px;
    height: 64px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

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

.brand-icon {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    color: var(--color-primary-900);
    background: linear-gradient(135deg, var(--color-accent-400), var(--color-accent-600));
    box-shadow: 0 8px 20px rgba(245, 158, 11, 0.35);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 22px;
    font-weight: 600;
}

.nav-links a {
    opacity: 0.92;
    transition: color 0.2s ease, opacity 0.2s ease;
}

.nav-links a:hover {
    opacity: 1;
    color: var(--color-accent-400);
}

.nav-toggle {
    display: none;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.08);
    cursor: pointer;
}

.nav-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    margin: 5px auto;
    background: #ffffff;
    border-radius: 999px;
}

.hero-slider {
    position: relative;
    height: 560px;
    overflow: hidden;
    background: #000000;
}

.hero-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    pointer-events: none;
    transition: opacity 1s ease;
}

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

.hero-slide > img,
.hero-slide .hero-fallback {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-shade {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 30%, rgba(245, 158, 11, 0.24), transparent 32%),
        linear-gradient(0deg, rgba(0, 0, 0, 0.88), rgba(0, 0, 0, 0.42), rgba(0, 0, 0, 0.12));
}

.hero-content {
    position: absolute;
    left: 50%;
    bottom: 62px;
    width: min(1180px, calc(100% - 48px));
    transform: translateX(-50%);
    color: #ffffff;
}

.hero-content h1 {
    max-width: 780px;
    margin: 12px 0 14px;
    font-size: clamp(34px, 7vw, 60px);
    line-height: 1.02;
    letter-spacing: -0.04em;
}

.hero-content p {
    max-width: 720px;
    margin: 0 0 18px;
    color: rgba(255, 255, 255, 0.86);
    font-size: 18px;
    line-height: 1.65;
}

.hero-meta,
.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 24px;
}

.hero-meta span,
.detail-meta span,
.tag-chips span {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.14);
    backdrop-filter: blur(8px);
}

.hero-actions,
.inline-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 20px;
    border-radius: var(--radius-sm);
    font-weight: 800;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

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

.btn-primary {
    color: #ffffff;
    background: var(--color-accent-500);
    box-shadow: 0 12px 24px rgba(245, 158, 11, 0.32);
}

.btn-primary:hover {
    background: var(--color-accent-600);
}

.btn-ghost {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.28);
    backdrop-filter: blur(8px);
}

.btn-light {
    color: var(--color-primary-700);
    background: var(--color-primary-50);
    border: 1px solid var(--color-primary-100);
}

.hero-dots {
    position: absolute;
    right: 32px;
    bottom: 32px;
    display: flex;
    gap: 8px;
}

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

.hero-dots button.is-active {
    width: 32px;
    background: var(--color-accent-500);
}

.quick-search-panel,
.page-container {
    width: min(1280px, calc(100% - 48px));
    margin: 0 auto;
}

.quick-search-panel {
    transform: translateY(-36px);
    margin-bottom: -10px;
    padding: 24px;
    display: grid;
    grid-template-columns: 1fr minmax(320px, 460px);
    gap: 24px;
    align-items: center;
    border-radius: var(--radius-lg);
    background: #ffffff;
    box-shadow: var(--shadow-card);
}

.quick-search-panel h2,
.section-heading h2,
.page-hero h1 {
    margin: 6px 0;
}

.quick-search-panel p,
.page-hero p,
.section-heading p,
.category-tile p,
.content-card p,
.ranking-info p,
.detail-card p,
.site-footer p {
    color: var(--color-neutral-600);
    line-height: 1.7;
}

.quick-search-form,
.filter-panel {
    display: flex;
    gap: 12px;
}

.quick-search-form input,
.filter-panel input,
.filter-panel select {
    width: 100%;
    min-height: 46px;
    border: 1px solid var(--color-neutral-200);
    border-radius: var(--radius-sm);
    padding: 0 14px;
    color: var(--color-neutral-800);
    background: #ffffff;
    outline: none;
    transition: border 0.2s ease, box-shadow 0.2s ease;
}

.quick-search-form input:focus,
.filter-panel input:focus,
.filter-panel select:focus {
    border-color: var(--color-primary-600);
    box-shadow: 0 0 0 4px rgba(2, 132, 199, 0.12);
}

.quick-search-form button {
    min-width: 112px;
    border: 0;
    border-radius: var(--radius-sm);
    color: #ffffff;
    background: var(--color-primary-600);
    font-weight: 800;
    cursor: pointer;
}

.section-stack {
    display: grid;
    gap: 64px;
}

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

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

.section-kicker {
    display: inline-flex;
    color: var(--color-accent-600);
    font-size: 13px;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.text-link {
    color: var(--color-primary-700);
    font-weight: 800;
}

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

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

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

.poster-shell {
    position: relative;
    aspect-ratio: 2 / 3;
    overflow: hidden;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--color-primary-900), var(--color-primary-600));
    box-shadow: var(--shadow-card);
    transition: transform 0.28s ease, box-shadow 0.28s ease;
}

.movie-card:hover .poster-shell,
.ranking-card:hover .poster-shell {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.poster-shell img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s ease;
}

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

.poster-fallback {
    position: absolute;
    inset: 0;
    padding: 18px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    color: #ffffff;
    background:
        radial-gradient(circle at 20% 15%, rgba(251, 191, 36, 0.38), transparent 32%),
        linear-gradient(135deg, var(--color-primary-900), var(--color-primary-600));
}

.poster-fallback[hidden] {
    display: none;
}

.poster-fallback span {
    font-size: 12px;
    opacity: 0.82;
}

.poster-fallback strong {
    font-size: clamp(18px, 3vw, 28px);
    line-height: 1.18;
}

.year-badge,
.play-badge,
.rank-pill,
.category-count {
    position: absolute;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: #ffffff;
    font-weight: 900;
    font-size: 12px;
}

.year-badge {
    top: 10px;
    right: 10px;
    min-height: 26px;
    padding: 0 8px;
    background: var(--color-accent-500);
}

.play-badge {
    left: 10px;
    bottom: 10px;
    width: 32px;
    height: 32px;
    background: rgba(0, 0, 0, 0.58);
    backdrop-filter: blur(8px);
}

.poster-overlay {
    position: absolute;
    inset: auto 0 0;
    z-index: 2;
    min-height: 46%;
    padding: 44px 12px 12px;
    display: flex;
    align-items: flex-end;
    color: #ffffff;
    opacity: 0;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.86), transparent);
    transition: opacity 0.25s ease;
}

.movie-card:hover .poster-overlay {
    opacity: 1;
}

.poster-overlay p {
    margin: 0;
    font-size: 12px;
    line-height: 1.5;
}

.movie-card-body {
    padding-top: 10px;
}

.movie-card-body h3 {
    margin: 0 0 6px;
    font-size: 16px;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    transition: color 0.2s ease;
}

.movie-card:hover h3 {
    color: var(--color-primary-600);
}

.meta-line,
.tag-line,
.card-excerpt {
    margin: 0;
    color: var(--color-neutral-600);
    font-size: 13px;
    line-height: 1.55;
}

.tag-line {
    color: var(--color-neutral-700);
}

.card-excerpt {
    margin-top: 6px;
}

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

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

.category-tile {
    position: relative;
    min-height: 180px;
    padding: 22px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: linear-gradient(135deg, #ffffff, var(--color-primary-50));
    box-shadow: var(--shadow-card);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.category-tile:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.category-tile h3 {
    margin: 28px 0 8px;
    font-size: 22px;
}

.category-tile small {
    color: var(--color-primary-700);
    font-weight: 700;
}

.category-count {
    top: 18px;
    right: 18px;
    padding: 5px 10px;
    color: var(--color-primary-700);
    background: var(--color-primary-100);
}

.ranking-panel,
.content-card,
.detail-card,
.side-card,
.category-overview-block {
    border-radius: var(--radius-lg);
    background: #ffffff;
    box-shadow: var(--shadow-card);
}

.ranking-panel {
    position: sticky;
    top: 88px;
    padding: 22px;
}

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

.rank-row {
    display: grid;
    grid-template-columns: 38px 1fr;
    gap: 8px 12px;
    align-items: center;
    padding: 12px;
    border-radius: var(--radius-sm);
    background: var(--color-neutral-50);
    transition: background 0.2s ease, transform 0.2s ease;
}

.rank-row:hover {
    background: var(--color-primary-50);
    transform: translateX(3px);
}

.rank-number {
    grid-row: span 2;
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    color: #ffffff;
    background: var(--color-accent-500);
    font-weight: 900;
}

.rank-title {
    font-weight: 800;
    line-height: 1.3;
}

.rank-meta {
    color: var(--color-neutral-600);
    font-size: 12px;
}

.page-top {
    padding-top: 48px;
}

.page-hero,
.category-header {
    border-radius: var(--radius-lg);
    color: #ffffff;
    background:
        radial-gradient(circle at 12% 20%, rgba(251, 191, 36, 0.30), transparent 30%),
        linear-gradient(135deg, var(--color-primary-900), var(--color-primary-700));
    box-shadow: var(--shadow-card);
}

.page-hero {
    padding: 48px;
}

.compact-hero h1 {
    font-size: clamp(32px, 5vw, 52px);
}

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

.category-overview-block,
.content-card,
.detail-card,
.side-card {
    padding: 28px;
}

.category-header {
    padding: 48px 0;
}

.category-header .page-container {
    display: grid;
    gap: 10px;
}

.category-header h1 {
    margin: 0;
    font-size: clamp(32px, 5vw, 52px);
}

.back-link,
.breadcrumb a {
    color: var(--color-primary-700);
    font-weight: 800;
}

.category-header .back-link {
    color: rgba(255, 255, 255, 0.9);
}

.filter-panel {
    padding: 18px;
    border-radius: var(--radius-lg);
    background: #ffffff;
    box-shadow: var(--shadow-card);
}

.wide-filter {
    grid-template-columns: minmax(0, 1fr) 180px 180px;
}

.empty-state {
    padding: 24px;
    text-align: center;
    border-radius: var(--radius-md);
    background: #ffffff;
    color: var(--color-neutral-600);
    box-shadow: var(--shadow-card);
}

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

.ranking-card {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr);
    gap: 20px;
    padding: 18px;
    border-radius: var(--radius-lg);
    background: #ffffff;
    box-shadow: var(--shadow-card);
}

.ranking-poster .poster-shell {
    width: 120px;
}

.ranking-info h2 {
    margin: 8px 0;
    font-size: 22px;
}

.rank-pill {
    position: static;
    width: fit-content;
    padding: 5px 10px;
    background: var(--color-accent-500);
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 22px;
    color: var(--color-neutral-600);
}

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

.detail-primary {
    display: grid;
    gap: 24px;
}

.player-card {
    overflow: hidden;
    border-radius: var(--radius-lg);
    background: #000000;
    box-shadow: var(--shadow-hover);
}

.video-frame {
    position: relative;
    aspect-ratio: 16 / 9;
    background: #000000;
}

.video-frame video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background: #000000;
}

.player-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    color: #ffffff;
    background:
        radial-gradient(circle at 50% 38%, rgba(245, 158, 11, 0.28), transparent 28%),
        linear-gradient(180deg, rgba(0, 0, 0, 0.22), rgba(0, 0, 0, 0.72));
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

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

.player-button {
    min-width: 164px;
    min-height: 56px;
    border: 0;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #ffffff;
    background: var(--color-accent-500);
    font-weight: 900;
    box-shadow: 0 18px 35px rgba(245, 158, 11, 0.35);
    cursor: pointer;
}

.player-overlay p,
.player-message {
    margin: 0;
    color: rgba(255, 255, 255, 0.76);
}

.player-message {
    min-height: 28px;
    padding: 0 16px 12px;
    color: var(--color-neutral-300);
    font-size: 13px;
}

.detail-card h1 {
    margin: 0 0 14px;
    font-size: clamp(28px, 4vw, 42px);
}

.detail-card h2 {
    margin: 28px 0 10px;
}

.detail-meta span,
.tag-chips span {
    color: var(--color-primary-800);
    background: var(--color-primary-100);
}

.lead-text {
    font-size: 18px;
    font-weight: 700;
    color: var(--color-neutral-800) !important;
}

.tag-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 18px 0 8px;
}

.detail-sidebar {
    display: grid;
    gap: 18px;
    position: sticky;
    top: 88px;
}

.side-poster {
    width: 100%;
}

.side-card dl {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 12px;
    margin: 0;
}

.side-card dt {
    color: var(--color-neutral-600);
    font-weight: 700;
}

.side-card dd {
    margin: 0;
    min-width: 0;
}

.related-section {
    padding-bottom: 24px;
}

.prose-card {
    font-size: 17px;
}

.site-footer {
    margin-top: 72px;
    padding: 52px 24px 28px;
    color: var(--color-neutral-300);
    background: var(--color-neutral-900);
}

.footer-grid {
    max-width: 1280px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.4fr;
    gap: 32px;
}

.site-footer h3,
.footer-brand strong {
    color: #ffffff;
}

.site-footer ul {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 8px;
}

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

.footer-bottom {
    max-width: 1280px;
    margin: 34px auto 0;
    padding-top: 22px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: var(--color-neutral-300);
    font-size: 14px;
}

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

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

    .ranking-panel,
    .detail-sidebar {
        position: static;
    }
}

@media (max-width: 900px) {
    .nav-toggle {
        display: inline-block;
    }

    .nav-links {
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        display: none;
        padding: 14px 24px 22px;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        background: var(--color-primary-800);
        border-top: 1px solid rgba(255, 255, 255, 0.12);
    }

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

    .nav-links a {
        padding: 12px 0;
    }

    .quick-search-panel,
    .wide-filter,
    .footer-grid {
        grid-template-columns: 1fr;
    }

    .quick-search-form,
    .filter-panel {
        flex-direction: column;
    }

    .hero-slider {
        height: 520px;
    }

    .hero-dots {
        left: 24px;
        right: auto;
    }

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

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

@media (max-width: 640px) {
    .nav-inner,
    .quick-search-panel,
    .page-container {
        width: 100%;
    }

    .nav-inner {
        padding: 0 16px;
    }

    .page-container,
    .quick-search-panel {
        width: calc(100% - 28px);
    }

    .hero-slider {
        height: 500px;
    }

    .hero-content {
        width: calc(100% - 32px);
        bottom: 70px;
    }

    .hero-content p {
        font-size: 15px;
    }

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

    .section-heading,
    .footer-bottom {
        align-items: flex-start;
        flex-direction: column;
    }

    .page-hero,
    .category-overview-block,
    .content-card,
    .detail-card,
    .side-card {
        padding: 22px;
    }

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

    .ranking-poster .poster-shell {
        width: 90px;
    }

    .ranking-info h2 {
        font-size: 18px;
    }

    .detail-card h1 {
        font-size: 28px;
    }
}
