:root {
    --primary-50: #eff6ff;
    --primary-100: #dbeafe;
    --primary-600: #2563eb;
    --primary-700: #1d4ed8;
    --primary-800: #1e40af;
    --primary-900: #172554;
    --accent-400: #fbbf24;
    --accent-500: #f59e0b;
    --accent-600: #d97706;
    --neutral-50: #f8fafc;
    --neutral-100: #f1f5f9;
    --neutral-200: #e2e8f0;
    --neutral-300: #cbd5e1;
    --neutral-500: #64748b;
    --neutral-600: #475569;
    --neutral-700: #334155;
    --neutral-800: #1e293b;
    --neutral-900: #0f172a;
    --white: #ffffff;
    --shadow-sm: 0 6px 18px rgba(15, 23, 42, 0.06);
    --shadow-md: 0 18px 45px rgba(15, 23, 42, 0.14);
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 22px;
    --container: 1200px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--neutral-50);
    color: var(--neutral-900);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", "Microsoft YaHei", sans-serif;
    line-height: 1.6;
}

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

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

button,
input,
select {
    font: inherit;
}

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

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, 0.92);
    border-bottom: 1px solid rgba(226, 232, 240, 0.9);
    backdrop-filter: blur(18px);
}

.nav-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 72px;
}

.site-logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.logo-mark {
    display: inline-grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary-600), var(--primary-900));
    color: var(--white);
    box-shadow: 0 12px 28px rgba(37, 99, 235, 0.28);
}

.logo-text {
    font-size: 1.16rem;
}

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

.nav-link,
.mobile-link {
    padding: 10px 14px;
    border-radius: 999px;
    color: var(--neutral-600);
    font-weight: 650;
    transition: color 0.2s ease, background 0.2s ease;
}

.nav-link:hover,
.nav-link.is-active,
.mobile-link:hover,
.mobile-link.is-active {
    background: var(--primary-50);
    color: var(--primary-700);
}

.menu-toggle {
    display: none;
    width: 42px;
    height: 42px;
    padding: 9px;
    border: 0;
    border-radius: 12px;
    background: var(--neutral-100);
}

.menu-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    margin: 5px 0;
    background: var(--neutral-800);
    border-radius: 999px;
}

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

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

.hero-carousel {
    position: relative;
    height: 560px;
    overflow: hidden;
    background: var(--neutral-900);
}

.hero-slide {
    position: absolute;
    inset: 0;
    display: grid;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.8s ease;
}

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

.hero-slide img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: radial-gradient(circle at 25% 25%, rgba(37, 99, 235, 0.45), transparent 36%), linear-gradient(135deg, #0f172a, #1e3a8a);
}

img.is-missing {
    opacity: 0;
}

.hero-slide::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(2, 6, 23, 0.92), rgba(2, 6, 23, 0.62) 46%, rgba(2, 6, 23, 0.1));
}

.hero-content {
    position: relative;
    z-index: 1;
    width: min(100% - 32px, var(--container));
    margin: 0 auto;
    color: var(--white);
}

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

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    margin-bottom: 18px;
    border-radius: 999px;
    background: rgba(245, 158, 11, 0.18);
    color: #fde68a;
    font-weight: 700;
}

.hero-copy h1 {
    margin: 0 0 18px;
    font-size: clamp(2.4rem, 7vw, 5.1rem);
    line-height: 1.04;
    letter-spacing: -0.06em;
}

.hero-copy p {
    max-width: 650px;
    margin: 0 0 22px;
    color: rgba(255, 255, 255, 0.86);
    font-size: clamp(1rem, 2vw, 1.22rem);
}

.hero-meta,
.detail-meta,
.rank-tags,
.card-meta,
.tag-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 9px;
}

.hero-meta span,
.detail-meta span,
.rank-tags span,
.tag-row span {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    color: inherit;
    font-size: 0.86rem;
}

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

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

.btn-primary {
    background: var(--primary-600);
    color: var(--white);
    box-shadow: 0 16px 34px rgba(37, 99, 235, 0.35);
}

.btn-primary:hover,
.btn-soft:hover,
.btn-ghost:hover {
    transform: translateY(-2px);
}

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

.btn-ghost {
    background: rgba(255, 255, 255, 0.14);
    color: var(--white);
    border: 1px solid rgba(255, 255, 255, 0.24);
}

.btn-soft {
    background: var(--primary-50);
    color: var(--primary-700);
}

.hero-controls {
    position: absolute;
    left: 50%;
    bottom: 24px;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 10px;
    transform: translateX(-50%);
}

.hero-dot {
    width: 42px;
    height: 5px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.35);
}

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

.hero-arrow {
    position: absolute;
    top: 50%;
    z-index: 3;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.55);
    color: var(--white);
    transform: translateY(-50%);
}

.hero-arrow.prev {
    left: 18px;
}

.hero-arrow.next {
    right: 18px;
}

.main-section {
    padding: 58px 0;
}

.main-section.compact {
    padding: 36px 0;
}

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

.section-head h2 {
    margin: 0 0 4px;
    font-size: clamp(1.7rem, 4vw, 2.4rem);
    line-height: 1.15;
    letter-spacing: -0.04em;
}

.section-head p {
    margin: 0;
    color: var(--neutral-600);
}

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

.search-panel,
.filter-panel,
.page-hero,
.info-panel {
    border: 1px solid var(--neutral-200);
    border-radius: var(--radius-lg);
    background: var(--white);
    box-shadow: var(--shadow-sm);
}

.search-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    padding: 16px;
    margin-top: -34px;
    position: relative;
    z-index: 4;
}

.search-input,
.select-input {
    width: 100%;
    height: 48px;
    border: 1px solid var(--neutral-200);
    border-radius: 12px;
    background: var(--neutral-50);
    color: var(--neutral-900);
    padding: 0 14px;
    outline: none;
}

.search-input:focus,
.select-input:focus {
    border-color: var(--primary-600);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

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

.movie-card {
    overflow: hidden;
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: var(--radius-md);
    background: var(--white);
    box-shadow: var(--shadow-sm);
    transition: transform 0.24s ease, box-shadow 0.24s ease;
}

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

.card-poster {
    position: relative;
    display: block;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: radial-gradient(circle at 30% 10%, rgba(37, 99, 235, 0.45), transparent 38%), linear-gradient(135deg, #111827, #1e3a8a);
}

.movie-card.large .card-poster {
    aspect-ratio: 21 / 10;
}

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

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

.card-poster::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 40%, rgba(2, 6, 23, 0.82));
    opacity: 0;
    transition: opacity 0.2s ease;
}

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

.poster-badge,
.poster-play {
    position: absolute;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    color: var(--white);
    font-size: 0.78rem;
    font-weight: 800;
}

.poster-badge {
    top: 12px;
    right: 12px;
    padding: 5px 9px;
    background: rgba(2, 6, 23, 0.72);
}

.poster-play {
    left: 12px;
    bottom: 12px;
    padding: 6px 12px;
    background: var(--primary-600);
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.movie-card:hover .poster-play {
    opacity: 1;
    transform: translateY(0);
}

.card-body {
    padding: 16px;
}

.card-title {
    display: -webkit-box;
    min-height: 52px;
    overflow: hidden;
    color: var(--neutral-900);
    font-size: 1.05rem;
    font-weight: 800;
    line-height: 1.35;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

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

.card-desc {
    display: -webkit-box;
    min-height: 46px;
    margin: 8px 0 12px;
    overflow: hidden;
    color: var(--neutral-600);
    font-size: 0.92rem;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.card-meta {
    color: var(--neutral-500);
    font-size: 0.84rem;
}

.card-meta a {
    padding: 4px 9px;
    border-radius: 999px;
    background: var(--primary-50);
    color: var(--primary-700);
    font-weight: 800;
}

.tag-row {
    margin-top: 12px;
    color: var(--neutral-600);
}

.tag-row span {
    background: var(--neutral-100);
}

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

.category-card {
    position: relative;
    overflow: hidden;
    min-height: 168px;
    padding: 22px;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, var(--primary-900), var(--primary-600));
    color: var(--white);
    box-shadow: var(--shadow-sm);
}

.category-card::after {
    content: "";
    position: absolute;
    width: 150px;
    height: 150px;
    right: -50px;
    bottom: -55px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.16);
}

.category-card h3 {
    position: relative;
    z-index: 1;
    margin: 0 0 8px;
    font-size: 1.35rem;
}

.category-card p,
.category-card small {
    position: relative;
    z-index: 1;
    margin: 0;
    color: rgba(255, 255, 255, 0.82);
}

.category-card small {
    display: inline-block;
    margin-top: 18px;
    font-weight: 800;
}

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

.ranking-row {
    display: grid;
    grid-template-columns: 54px 92px minmax(0, 1fr);
    gap: 16px;
    align-items: center;
    padding: 14px;
    border: 1px solid var(--neutral-200);
    border-radius: var(--radius-md);
    background: var(--white);
    box-shadow: var(--shadow-sm);
}

.rank-number {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: var(--neutral-100);
    color: var(--neutral-700);
    font-weight: 900;
}

.ranking-row.top-rank .rank-number {
    background: var(--accent-500);
    color: var(--white);
}

.rank-cover {
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-radius: 12px;
    background: linear-gradient(135deg, #0f172a, #1e40af);
}

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

.rank-title {
    font-size: 1.05rem;
    font-weight: 850;
}

.rank-main p {
    display: -webkit-box;
    margin: 5px 0 8px;
    overflow: hidden;
    color: var(--neutral-600);
    font-size: 0.92rem;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.rank-tags span {
    background: var(--neutral-100);
    color: var(--neutral-600);
}

.page-hero {
    margin-top: 28px;
    padding: 34px;
    background: radial-gradient(circle at 86% 20%, rgba(37, 99, 235, 0.14), transparent 35%), var(--white);
}

.page-hero h1 {
    margin: 0 0 10px;
    font-size: clamp(2rem, 5vw, 3.3rem);
    letter-spacing: -0.05em;
}

.page-hero p {
    max-width: 760px;
    margin: 0;
    color: var(--neutral-600);
}

.filter-panel {
    display: grid;
    grid-template-columns: minmax(0, 1.8fr) repeat(3, minmax(140px, 1fr));
    gap: 12px;
    padding: 16px;
    margin-bottom: 26px;
}

.empty-state {
    display: none;
    padding: 44px;
    border-radius: var(--radius-lg);
    background: var(--white);
    color: var(--neutral-600);
    text-align: center;
}

.empty-state.is-visible {
    display: block;
}

.detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.8fr) 360px;
    gap: 26px;
    align-items: start;
}

.breadcrumbs {
    margin: 22px 0;
    color: var(--neutral-500);
    font-size: 0.92rem;
}

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

.player-panel {
    overflow: hidden;
    border-radius: var(--radius-lg);
    background: #020617;
    box-shadow: var(--shadow-md);
}

.player-frame {
    position: relative;
    aspect-ratio: 16 / 9;
    background: radial-gradient(circle at 30% 20%, rgba(37, 99, 235, 0.32), transparent 38%), #020617;
}

.player-frame video,
.player-poster {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.player-poster {
    opacity: 0.56;
}

.player-overlay {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 24px;
    color: var(--white);
    text-align: center;
    background: linear-gradient(180deg, rgba(2, 6, 23, 0.08), rgba(2, 6, 23, 0.74));
}

.play-button {
    display: grid;
    place-items: center;
    width: 82px;
    height: 82px;
    margin: 0 auto 16px;
    border: 0;
    border-radius: 50%;
    background: var(--primary-600);
    color: var(--white);
    font-size: 2rem;
    box-shadow: 0 20px 45px rgba(37, 99, 235, 0.38);
}

.player-panel.is-playing .player-overlay,
.player-panel.is-playing .player-poster {
    display: none;
}

.player-note {
    padding: 14px 18px;
    color: rgba(255, 255, 255, 0.76);
    font-size: 0.9rem;
}

.detail-card,
.side-card {
    padding: 22px;
    border: 1px solid var(--neutral-200);
    border-radius: var(--radius-lg);
    background: var(--white);
    box-shadow: var(--shadow-sm);
}

.detail-card h1 {
    margin: 0 0 12px;
    font-size: clamp(2rem, 5vw, 3.4rem);
    line-height: 1.1;
    letter-spacing: -0.05em;
}

.detail-card h2,
.side-card h2 {
    margin: 0 0 14px;
    font-size: 1.35rem;
}

.detail-card p {
    color: var(--neutral-700);
}

.detail-meta span {
    background: var(--neutral-100);
    color: var(--neutral-700);
}

.info-list {
    display: grid;
    gap: 12px;
    margin: 0;
}

.info-list div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--neutral-200);
}

.info-list dt {
    color: var(--neutral-500);
}

.info-list dd {
    margin: 0;
    text-align: right;
    font-weight: 800;
}

.compact-list {
    display: grid;
    gap: 12px;
}

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

.compact-card img {
    width: 82px;
    height: 62px;
    border-radius: 10px;
    object-fit: cover;
    background: linear-gradient(135deg, #0f172a, #1e40af);
}

.compact-info strong,
.compact-info small {
    display: block;
}

.compact-info strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.compact-info small {
    color: var(--neutral-500);
}

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

.site-footer {
    margin-top: 64px;
    padding: 44px 0;
    background: var(--neutral-900);
    color: rgba(255, 255, 255, 0.78);
}

.footer-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) 1fr 1fr;
    gap: 28px;
}

.footer-logo {
    color: var(--white);
}

.footer-desc {
    max-width: 520px;
}

.site-footer h3 {
    margin: 0 0 12px;
    color: var(--white);
}

.site-footer a,
.site-footer p {
    display: block;
    margin: 8px 0;
}

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

@media (max-width: 1024px) {
    .movie-grid,
    .category-grid,
    .search-results {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

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

    .filter-panel {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

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

    .menu-toggle {
        display: block;
    }

    .hero-carousel {
        height: 520px;
    }

    .hero-arrow {
        display: none;
    }

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

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

    .movie-grid,
    .category-grid,
    .search-results {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px;
    }

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

    .rank-main p {
        -webkit-line-clamp: 1;
    }

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

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

    .hero-carousel {
        height: 500px;
    }

    .hero-meta span:nth-child(n + 4) {
        display: none;
    }

    .movie-grid,
    .category-grid,
    .search-results {
        grid-template-columns: 1fr;
    }

    .page-hero,
    .detail-card,
    .side-card {
        padding: 20px;
    }
}
