:root {
    --primary-50: #eff6ff;
    --primary-100: #dbeafe;
    --primary-500: #3b82f6;
    --primary-600: #2563eb;
    --primary-700: #1d4ed8;
    --accent-50: #f5f3ff;
    --accent-500: #8b5cf6;
    --accent-600: #7c3aed;
    --secondary-500: #06b6d4;
    --neutral-50: #f8fafc;
    --neutral-100: #f1f5f9;
    --neutral-200: #e2e8f0;
    --neutral-300: #cbd5e1;
    --neutral-400: #94a3b8;
    --neutral-500: #64748b;
    --neutral-600: #475569;
    --neutral-700: #334155;
    --neutral-800: #1e293b;
    --neutral-900: #0f172a;
    --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.08);
    --shadow-md: 0 12px 30px rgba(15, 23, 42, 0.10);
    --shadow-xl: 0 24px 60px rgba(15, 23, 42, 0.16);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    color: var(--neutral-800);
    background: var(--neutral-50);
}

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

button,
input,
select {
    font: inherit;
}

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

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, 0.95);
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(14px);
}

.header-inner {
    height: 64px;
    display: flex;
    align-items: center;
    gap: 24px;
}

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

.brand-mark {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary-500), var(--accent-500));
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.28);
}

.brand-name {
    font-size: 21px;
}

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

.nav-link {
    color: var(--neutral-600);
    font-size: 15px;
    font-weight: 650;
    transition: color 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-600);
}

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

.header-search input,
.mobile-search input,
.search-large input {
    min-width: 220px;
    border: 1px solid var(--neutral-200);
    border-radius: 12px;
    background: #fff;
    padding: 10px 12px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.header-search input:focus,
.mobile-search input:focus,
.search-large input:focus,
.filter-line select:focus {
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.header-search button,
.mobile-search button,
.search-large button,
.button-solid {
    border: 0;
    border-radius: 12px;
    padding: 10px 16px;
    color: #fff;
    background: var(--primary-600);
    cursor: pointer;
    font-weight: 700;
    transition: background 0.2s ease, transform 0.2s ease;
}

.header-search button:hover,
.mobile-search button:hover,
.search-large button:hover,
.button-solid:hover {
    background: var(--primary-700);
    transform: translateY(-1px);
}

.menu-toggle {
    display: none;
    border: 0;
    background: transparent;
    color: var(--neutral-700);
    font-size: 26px;
    cursor: pointer;
}

.mobile-panel {
    display: none;
    border-top: 1px solid var(--neutral-100);
    padding: 16px;
}

.mobile-panel.open {
    display: block;
}

.mobile-panel nav {
    display: grid;
    gap: 14px;
    margin-bottom: 16px;
}

.hero-carousel {
    position: relative;
    height: 600px;
    overflow: hidden;
    background: linear-gradient(135deg, var(--primary-500), var(--accent-500), var(--secondary-500));
}

.hero-slide {
    position: absolute;
    inset: 0;
    display: flex;
    opacity: 0;
    pointer-events: none;
    background-image: linear-gradient(120deg, rgba(37, 99, 235, 0.92), rgba(124, 58, 237, 0.74), rgba(6, 182, 212, 0.66)), var(--cover-image);
    background-size: cover;
    background-position: center;
    transition: opacity 0.6s ease;
}

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

.hero-overlay {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.22), transparent 24%), linear-gradient(90deg, rgba(15, 23, 42, 0.34), transparent 58%);
}

.hero-content {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    height: 100%;
}

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

.hero-kicker {
    display: inline-flex;
    align-items: center;
    margin-bottom: 16px;
    padding: 7px 12px;
    border: 1px solid rgba(255, 255, 255, 0.38);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    color: rgba(255, 255, 255, 0.94);
    font-weight: 700;
}

.hero-copy h1,
.page-hero h1 {
    margin: 0;
    font-size: clamp(38px, 6vw, 72px);
    line-height: 1.08;
    letter-spacing: -0.04em;
}

.hero-copy p,
.page-hero p {
    max-width: 760px;
    margin: 22px 0 0;
    color: rgba(255, 255, 255, 0.9);
    font-size: 20px;
    line-height: 1.8;
}

.hero-tags,
.category-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 22px;
}

.hero-tags span,
.category-chips a {
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
}

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

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    padding: 13px 22px;
    font-weight: 800;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

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

.button-light {
    color: var(--primary-600);
    background: #fff;
    box-shadow: var(--shadow-md);
}

.button-light:hover {
    background: var(--primary-50);
}

.button-ghost {
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.36);
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(10px);
}

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

.hero-dot {
    width: 11px;
    height: 11px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.46);
    cursor: pointer;
}

.hero-dot.active {
    width: 32px;
    border-radius: 999px;
    background: #fff;
}

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

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

.section-heading h2,
.ranking-panel h2,
.related-categories h2,
.aside-card h2 {
    margin: 0;
    color: var(--neutral-800);
    font-size: clamp(24px, 3vw, 34px);
    letter-spacing: -0.03em;
}

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

.white-band {
    background: #fff;
}

.soft-band {
    background: linear-gradient(135deg, var(--accent-50), var(--primary-50));
}

.movie-grid,
.featured-grid,
.category-grid {
    display: grid;
    gap: 22px;
}

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

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

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

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

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

.movie-card {
    display: flex;
    min-width: 0;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 20px;
    background: #fff;
    box-shadow: var(--shadow-sm);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.movie-card:hover {
    transform: translateY(-5px);
    border-color: rgba(59, 130, 246, 0.22);
    box-shadow: var(--shadow-xl);
}

.poster-frame,
.compact-thumb,
.ranking-thumb,
.search-thumb,
.category-tile,
.player-shell {
    background-image: linear-gradient(135deg, rgba(37, 99, 235, 0.72), rgba(124, 58, 237, 0.62)), var(--cover-image);
    background-size: cover;
    background-position: center;
}

.poster-frame {
    position: relative;
    display: block;
    aspect-ratio: 16 / 9;
    overflow: hidden;
}

.poster-gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.04), rgba(15, 23, 42, 0.54));
}

.play-badge {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 56px;
    height: 56px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    background: rgba(59, 130, 246, 0.88);
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.24);
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.9);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.movie-card:hover .play-badge {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.year-badge {
    position: absolute;
    right: 12px;
    bottom: 12px;
    padding: 5px 9px;
    border-radius: 8px;
    color: #fff;
    background: rgba(15, 23, 42, 0.7);
    font-size: 12px;
    font-weight: 800;
    backdrop-filter: blur(8px);
}

.card-body {
    display: grid;
    gap: 10px;
    padding: 16px;
}

.card-body strong {
    color: var(--neutral-800);
    font-size: 17px;
    line-height: 1.35;
}

.movie-card:hover .card-body strong,
.compact-card:hover strong,
.search-item:hover strong {
    color: var(--primary-600);
}

.card-desc {
    min-height: 44px;
    color: var(--neutral-600);
    font-size: 14px;
    line-height: 1.6;
}

.card-meta,
.card-tags {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: var(--neutral-500);
    font-size: 12px;
}

.card-tags {
    justify-content: flex-start;
    min-height: 18px;
    color: var(--primary-600);
    font-weight: 700;
}

.movie-card-wide .card-body {
    padding: 20px;
}

.movie-card-wide .card-body strong {
    font-size: 22px;
}

.movie-card-wide .poster-frame {
    aspect-ratio: 16 / 10;
}

.category-tile {
    min-height: 180px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 12px;
    overflow: hidden;
    border-radius: 22px;
    padding: 24px;
    color: #fff;
    box-shadow: var(--shadow-md);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

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

.category-tile span {
    font-size: 25px;
    font-weight: 900;
    letter-spacing: -0.03em;
}

.category-tile strong {
    max-width: 92%;
    color: rgba(255, 255, 255, 0.88);
    font-size: 14px;
    line-height: 1.7;
}

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

.ranking-panel,
.aside-card,
.detail-card {
    border: 1px solid rgba(226, 232, 240, 0.75);
    border-radius: 22px;
    background: #fff;
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

.ranking-panel {
    position: sticky;
    top: 86px;
}

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

.ranking-row {
    display: grid;
    grid-template-columns: 42px 88px minmax(0, 1fr) 48px;
    gap: 14px;
    align-items: center;
    border-radius: 16px;
    padding: 10px;
    background: var(--neutral-50);
    transition: background 0.2s ease, transform 0.2s ease;
}

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

.ranking-index {
    color: var(--primary-600);
    font-weight: 900;
}

.ranking-thumb {
    aspect-ratio: 16 / 10;
    border-radius: 12px;
}

.ranking-copy {
    display: grid;
    gap: 5px;
    min-width: 0;
}

.ranking-copy strong,
.compact-copy strong,
.search-copy strong {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.ranking-copy span,
.compact-copy span,
.search-copy span,
.search-copy em {
    overflow: hidden;
    color: var(--neutral-500);
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: 13px;
    font-style: normal;
}

.ranking-score {
    color: var(--accent-600);
    font-weight: 900;
}

.full-ranking {
    margin-top: 0;
}

.full-ranking .ranking-row {
    grid-template-columns: 56px 120px minmax(0, 1fr) 70px;
}

.page-hero,
.search-hero {
    color: #fff;
    background: linear-gradient(135deg, var(--primary-600), var(--accent-600), var(--secondary-500));
}

.small-hero .container,
.search-hero .container {
    padding: 70px 0;
}

.page-hero p {
    font-size: 18px;
}

.related-categories {
    padding-top: 0;
}

.related-categories div {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.related-categories a,
.filter-line label,
.tag-cloud span {
    border-radius: 999px;
    background: #fff;
    color: var(--primary-700);
    padding: 9px 13px;
    font-weight: 800;
    box-shadow: var(--shadow-sm);
}

.detail-topbar {
    background: #fff;
    border-bottom: 1px solid var(--neutral-200);
}

.breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 18px 0;
    color: var(--neutral-500);
    font-size: 14px;
}

.breadcrumbs a {
    color: var(--primary-600);
    font-weight: 700;
}

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

.player-shell {
    position: relative;
    overflow: hidden;
    border-radius: 24px;
    aspect-ratio: 16 / 9;
    background-color: #000;
    box-shadow: var(--shadow-xl);
}

.movie-player {
    width: 100%;
    height: 100%;
    display: block;
    background: #000;
}

.player-cover {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    border: 0;
    color: #fff;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.1), rgba(15, 23, 42, 0.66));
    cursor: pointer;
    font-weight: 900;
    letter-spacing: 0.02em;
}

.player-cover.hidden {
    display: none;
}

.player-play-icon {
    width: 76px;
    height: 76px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(59, 130, 246, 0.92);
    box-shadow: 0 16px 38px rgba(15, 23, 42, 0.32);
    font-size: 30px;
}

.detail-title-block {
    margin: 26px 0;
}

.detail-title-block h1 {
    margin: 0 0 14px;
    color: var(--neutral-900);
    font-size: clamp(30px, 4vw, 48px);
    line-height: 1.18;
    letter-spacing: -0.04em;
}

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

.detail-meta span {
    border-radius: 999px;
    background: #fff;
    color: var(--neutral-600);
    padding: 8px 12px;
    font-size: 14px;
    font-weight: 700;
    box-shadow: var(--shadow-sm);
}

.detail-card {
    margin-bottom: 18px;
}

.detail-card h2 {
    margin: 0 0 12px;
    color: var(--neutral-800);
    font-size: 22px;
}

.detail-card p,
.text-page p {
    margin: 0;
    color: var(--neutral-700);
    font-size: 16px;
    line-height: 1.9;
}

.detail-card + .detail-card p {
    text-align: justify;
}

.lead-text {
    font-weight: 800;
}

.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.detail-aside {
    position: sticky;
    top: 86px;
}

.compact-list {
    display: grid;
    gap: 16px;
    margin-top: 18px;
}

.compact-card {
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
}

.compact-thumb {
    aspect-ratio: 16 / 10;
    border-radius: 14px;
}

.compact-copy {
    display: grid;
    min-width: 0;
    gap: 6px;
}

.search-hero h1 {
    margin: 0 0 24px;
    font-size: clamp(36px, 5vw, 58px);
    letter-spacing: -0.04em;
}

.search-large {
    max-width: 760px;
}

.search-large input {
    flex: 1;
    min-width: 0;
    padding: 14px 16px;
}

.filter-line {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 20px;
}

.filter-line label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--neutral-700);
}

.filter-line select {
    border: 1px solid var(--neutral-200);
    border-radius: 10px;
    padding: 7px 10px;
    outline: none;
}

.search-results {
    padding-top: 34px;
}

.result-summary {
    margin-bottom: 18px;
    color: var(--neutral-600);
    font-weight: 800;
}

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

.search-item {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr);
    gap: 18px;
    align-items: center;
    border: 1px solid rgba(226, 232, 240, 0.78);
    border-radius: 20px;
    background: #fff;
    padding: 14px;
    box-shadow: var(--shadow-sm);
}

.search-item.hidden {
    display: none;
}

.search-thumb {
    aspect-ratio: 16 / 9;
    border-radius: 16px;
}

.search-copy {
    display: grid;
    gap: 9px;
    min-width: 0;
}

.search-copy strong {
    font-size: 20px;
}

.empty-state {
    display: none;
    padding: 70px 20px;
    text-align: center;
}

.empty-state.active {
    display: block;
}

.empty-state h2 {
    margin: 0 0 10px;
    color: var(--neutral-800);
}

.empty-state p {
    color: var(--neutral-500);
}

.text-page {
    max-width: 900px;
    display: grid;
    gap: 18px;
}

.site-footer {
    color: var(--neutral-300);
    background: var(--neutral-800);
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: 30px;
    padding: 46px 0;
}

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

.site-footer h2 {
    margin: 0 0 14px;
    color: #fff;
    font-size: 18px;
}

.site-footer p {
    color: var(--neutral-400);
    line-height: 1.8;
}

.site-footer a {
    display: block;
    margin: 10px 0;
    color: var(--neutral-300);
    transition: color 0.2s ease;
}

.site-footer a:hover {
    color: var(--primary-100);
}

.footer-small {
    margin-top: 20px;
    font-size: 13px;
}

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

    .menu-toggle {
        display: block;
        margin-left: auto;
    }

    .movie-grid,
    .movie-grid.three-columns,
    .featured-grid,
    .featured-grid.two-rows,
    .category-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

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

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

    .header-inner {
        height: 60px;
    }

    .brand-name {
        font-size: 19px;
    }

    .hero-carousel {
        height: 580px;
    }

    .hero-copy p,
    .page-hero p {
        font-size: 17px;
    }

    .hero-actions,
    .section-heading,
    .filter-line,
    .search-large {
        align-items: stretch;
        flex-direction: column;
    }

    .movie-grid,
    .movie-grid.three-columns,
    .featured-grid,
    .featured-grid.two-rows,
    .category-grid {
        grid-template-columns: 1fr;
    }

    .full-ranking .ranking-row,
    .ranking-row {
        grid-template-columns: 38px 76px minmax(0, 1fr);
    }

    .ranking-score {
        display: none;
    }

    .search-item,
    .compact-card {
        grid-template-columns: 1fr;
    }

    .search-thumb,
    .compact-thumb {
        width: 100%;
    }

    .small-hero .container,
    .search-hero .container {
        padding: 48px 0;
    }
}
