:root {
    --primary-50: #e6f1ff;
    --primary-100: #cce4ff;
    --primary-300: #4da9ff;
    --primary-500: #0073e6;
    --primary-600: #005bb3;
    --primary-700: #004380;
    --secondary-50: #f0f9ff;
    --secondary-500: #0ea5e9;
    --secondary-600: #0284c7;
    --accent-300: #fde68a;
    --accent-400: #fbbf24;
    --accent-500: #f59e0b;
    --neutral-50: #fafafa;
    --neutral-100: #f5f5f5;
    --neutral-200: #e5e5e5;
    --neutral-300: #d4d4d4;
    --neutral-500: #737373;
    --neutral-600: #525252;
    --neutral-700: #404040;
    --neutral-800: #262626;
    --neutral-900: #171717;
    --shadow-soft: 0 2px 15px -3px rgba(0, 0, 0, .07), 0 10px 20px -2px rgba(0, 0, 0, .04);
    --shadow-medium: 0 4px 25px -5px rgba(0, 0, 0, .1), 0 10px 30px -5px rgba(0, 0, 0, .08);
    --shadow-large: 0 10px 40px -10px rgba(0, 0, 0, .15), 0 20px 50px -10px rgba(0, 0, 0, .12);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

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

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

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

button,
input,
select {
    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, .95);
    border-bottom: 1px solid var(--neutral-200);
    box-shadow: 0 1px 2px rgba(0, 0, 0, .05);
    backdrop-filter: blur(8px);
}

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

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

.brand-mark {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    color: #fff;
    background: linear-gradient(135deg, var(--primary-500), var(--secondary-500));
    box-shadow: var(--shadow-soft);
}

.brand-text {
    display: grid;
    line-height: 1.2;
}

.brand-text strong {
    font-size: 20px;
}

.brand-text small {
    color: var(--neutral-500);
    font-size: 12px;
    font-weight: 500;
}

.nav-panel {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}

.nav-link {
    color: var(--neutral-700);
    font-weight: 600;
    transition: color .2s ease;
}

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

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

.nav-search input {
    width: 210px;
    padding: 10px 12px;
    border: 1px solid var(--neutral-300);
    border-radius: 12px;
    outline: none;
    transition: box-shadow .2s ease, border-color .2s ease;
}

.nav-search input:focus,
.filter-card input:focus,
.filter-card select:focus {
    border-color: transparent;
    box-shadow: 0 0 0 3px rgba(0, 115, 230, .18);
}

.nav-search button,
.btn,
.text-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    cursor: pointer;
    font-weight: 700;
    transition: transform .2s ease, box-shadow .2s ease, background .2s ease, color .2s ease;
}

.nav-search button {
    padding: 10px 15px;
    color: #fff;
    background: var(--primary-600);
    border-radius: 12px;
}

.nav-search button:hover,
.btn-primary:hover {
    background: var(--primary-700);
}

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

.menu-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    margin: 5px auto;
    background: var(--neutral-700);
}

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

.hero-track,
.hero-slide,
.hero-bg,
.hero-overlay {
    position: absolute;
    inset: 0;
}

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

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

.hero-bg {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.02);
}

.hero-overlay {
    background: linear-gradient(90deg, rgba(0, 0, 0, .82), rgba(0, 0, 0, .54) 48%, rgba(0, 0, 0, .08));
}

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

.hero-copy {
    width: min(680px, 100%);
    color: #fff;
}

.eyebrow {
    display: inline-flex;
    margin-bottom: 12px;
    color: var(--accent-300);
    font-size: 14px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.hero-copy h1,
.hero-copy h2 {
    margin: 0 0 16px;
    font-size: clamp(36px, 5vw, 64px);
    line-height: 1.06;
    letter-spacing: -.04em;
}

.hero-copy p {
    margin: 0 0 22px;
    max-width: 650px;
    color: rgba(255, 255, 255, .86);
    font-size: 18px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hero-meta,
.detail-meta,
.card-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.hero-meta {
    margin-bottom: 30px;
    color: #fff;
    font-weight: 700;
}

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

.btn {
    min-height: 44px;
    padding: 0 22px;
    border-radius: 12px;
}

.btn-primary {
    color: #fff;
    background: var(--primary-600);
    box-shadow: var(--shadow-medium);
}

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

.btn-light {
    color: var(--neutral-900);
    background: #fff;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-large);
}

.hero-arrow {
    position: absolute;
    top: 50%;
    z-index: 4;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 999px;
    color: #fff;
    background: rgba(0, 0, 0, .5);
    font-size: 34px;
    line-height: 1;
    cursor: pointer;
    transition: background .2s ease;
}

.hero-prev {
    left: 22px;
}

.hero-next {
    right: 22px;
}

.hero-arrow:hover {
    background: rgba(0, 0, 0, .72);
}

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

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

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

.hero-quick {
    position: absolute;
    z-index: 4;
    left: 50%;
    bottom: 82px;
    display: flex;
    gap: 12px;
    transform: translateX(-50%);
}

.hero-quick a {
    padding: 8px 14px;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, .24);
    border-radius: 999px;
    background: rgba(0, 0, 0, .28);
    backdrop-filter: blur(8px);
}

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

.bg-white {
    background: #fff;
}

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

.dark-section {
    color: #fff;
    background: var(--neutral-900);
}

.section-heading {
    margin-bottom: 26px;
    text-align: center;
}

.section-heading.align-left {
    text-align: left;
}

.section-heading h2 {
    margin: 0;
    font-size: clamp(26px, 3vw, 36px);
    line-height: 1.2;
}

.section-heading p {
    margin: 8px auto 0;
    max-width: 720px;
    color: var(--neutral-600);
}

.dark-section .section-heading p {
    color: rgba(255, 255, 255, .72);
}

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

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

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

.card-link,
.movie-card > a {
    display: block;
    height: 100%;
    overflow: hidden;
    background: #fff;
    border-radius: 16px;
    box-shadow: var(--shadow-soft);
    transition: transform .25s ease, box-shadow .25s ease;
}

.card-link:hover,
.movie-card > a:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-medium);
}

.poster {
    position: relative;
    height: 210px;
    overflow: hidden;
    background: var(--neutral-200);
}

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

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

.duration,
.rank-badge {
    position: absolute;
    z-index: 2;
    right: 10px;
    top: 10px;
    padding: 4px 8px;
    color: #fff;
    background: rgba(0, 0, 0, .68);
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
}

.rank-badge {
    left: 10px;
    right: auto;
    background: var(--primary-600);
}

.card-content {
    padding: 16px;
}

.card-content h3 {
    margin: 0 0 8px;
    color: var(--neutral-900);
    font-size: 17px;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color .2s ease;
}

.card-link:hover h3,
.movie-card > a:hover h2,
.movie-card > a:hover h3 {
    color: var(--primary-600);
}

.card-content p {
    min-height: 44px;
    margin: 0 0 12px;
    color: var(--neutral-600);
    font-size: 14px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

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

.card-meta span:first-child,
.rank-score {
    color: var(--accent-500);
    font-weight: 800;
}

.scroll-row {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(280px, 1fr);
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 14px;
    scrollbar-width: none;
}

.scroll-row::-webkit-scrollbar {
    display: none;
}

.movie-card-horizontal .card-link {
    display: flex;
    gap: 14px;
    align-items: stretch;
}

.horizontal-poster {
    width: 132px;
    height: auto;
    min-height: 112px;
    flex: none;
}

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

.category-tile {
    position: relative;
    min-height: 180px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: end;
    overflow: hidden;
    color: #fff;
    border-radius: 18px;
    box-shadow: var(--shadow-soft);
    isolation: isolate;
}

.category-tile::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(0deg, rgba(0, 0, 0, .78), rgba(0, 0, 0, .1));
}

.category-tile img {
    position: absolute;
    inset: 0;
    z-index: -2;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .35s ease;
}

.category-tile:hover img {
    transform: scale(1.08);
}

.category-tile span {
    font-size: 22px;
    font-weight: 800;
}

.category-tile small {
    margin-top: 6px;
    color: rgba(255, 255, 255, .82);
}

.split-layout {
    display: grid;
    grid-template-columns: .8fr 1.2fr;
    gap: 34px;
    align-items: start;
}

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

.rank-row {
    display: grid;
    grid-template-columns: 46px 58px 1fr auto;
    gap: 14px;
    align-items: center;
    padding: 10px;
    color: #fff;
    background: rgba(255, 255, 255, .08);
    border-radius: 14px;
    transition: background .2s ease;
}

.rank-row:hover {
    background: rgba(255, 255, 255, .14);
}

.rank-row img {
    width: 58px;
    height: 42px;
    object-fit: cover;
    border-radius: 10px;
}

.rank-index {
    color: var(--accent-300);
    font-weight: 900;
}

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

.sub-hero {
    padding: 76px 0;
    color: #fff;
    background: linear-gradient(135deg, var(--primary-600), var(--secondary-600));
}

.sub-hero h1 {
    margin: 0 0 12px;
    font-size: clamp(34px, 5vw, 56px);
    line-height: 1.1;
}

.sub-hero p {
    max-width: 760px;
    margin: 0;
    color: rgba(255, 255, 255, .82);
    font-size: 18px;
}

.category-hero,
.rank-hero,
.search-hero {
    background: radial-gradient(circle at 18% 20%, rgba(255, 255, 255, .18), transparent 28%), linear-gradient(135deg, var(--primary-700), var(--secondary-600));
}

.breadcrumb {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 16px;
    color: rgba(255, 255, 255, .82);
    font-size: 14px;
}

.breadcrumb a:hover {
    color: #fff;
    text-decoration: underline;
}

.breadcrumb.dark {
    color: rgba(255, 255, 255, .72);
}

.page-stack {
    display: grid;
    gap: 28px;
    padding: 34px 0 58px;
}

.category-overview,
.filter-card,
.detail-card,
.side-card {
    padding: 24px;
    background: #fff;
    border-radius: 18px;
    box-shadow: var(--shadow-soft);
}

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

.category-overview h2,
.detail-card h2,
.side-card h2 {
    margin: 0 0 8px;
    font-size: 24px;
}

.category-overview p {
    margin: 0;
    color: var(--neutral-600);
}

.text-link {
    color: var(--primary-600);
    white-space: nowrap;
}

.text-link:hover {
    color: var(--primary-700);
    text-decoration: underline;
}

.filter-grid {
    display: grid;
    grid-template-columns: 1.6fr repeat(3, 1fr);
    gap: 14px;
}

.filter-card label {
    display: grid;
    gap: 6px;
    color: var(--neutral-700);
    font-weight: 700;
}

.filter-card input,
.filter-card select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--neutral-300);
    border-radius: 12px;
    background: #fff;
    outline: none;
}

.filter-empty {
    margin: 16px 0 0;
    color: var(--neutral-600);
    text-align: center;
}

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

.ranking-item > a {
    display: grid;
    grid-template-columns: 72px 112px 1fr;
    gap: 18px;
    align-items: center;
    padding: 14px;
}

.ranking-number {
    color: var(--primary-600);
    font-size: 24px;
    font-weight: 900;
}

.ranking-item img {
    width: 112px;
    height: 76px;
    object-fit: cover;
    border-radius: 12px;
}

.ranking-item h2 {
    margin: 0 0 6px;
    font-size: 20px;
}

.ranking-item p {
    margin: 0 0 8px;
    color: var(--neutral-600);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.player-wrap {
    padding: 28px 0 36px;
    background: var(--neutral-900);
}

.movie-player {
    position: relative;
    overflow: hidden;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: 18px;
    box-shadow: var(--shadow-large);
}

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

.player-overlay {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    border: 0;
    color: #fff;
    background: linear-gradient(0deg, rgba(0, 0, 0, .62), rgba(0, 0, 0, .18));
    cursor: pointer;
    transition: opacity .25s ease;
}

.player-overlay span {
    width: 84px;
    height: 84px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: rgba(0, 115, 230, .92);
    font-size: 34px;
    box-shadow: var(--shadow-large);
}

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

.movie-player.is-error .player-overlay span {
    width: auto;
    height: auto;
    padding: 14px 18px;
    border-radius: 12px;
    font-size: 16px;
}

.movie-detail {
    padding: 36px 0 58px;
}

.detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(300px, .9fr);
    gap: 28px;
    align-items: start;
}

.detail-main {
    display: grid;
    gap: 22px;
}

.detail-head {
    display: grid;
    grid-template-columns: 210px 1fr;
    gap: 24px;
}

.detail-head img {
    width: 210px;
    height: 300px;
    object-fit: cover;
    border-radius: 16px;
    box-shadow: var(--shadow-soft);
}

.detail-head h1 {
    margin: 0 0 12px;
    font-size: clamp(30px, 4vw, 44px);
    line-height: 1.14;
}

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

.detail-meta {
    margin: 18px 0;
    color: var(--neutral-600);
    font-weight: 700;
}

.detail-meta span:first-child {
    color: var(--accent-500);
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-list span {
    padding: 6px 10px;
    color: var(--primary-700);
    background: var(--primary-50);
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
}

.detail-side {
    position: sticky;
    top: 92px;
}

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

.side-list .horizontal-poster {
    width: 110px;
}

.side-list .card-content p {
    display: none;
}

.site-footer {
    color: rgba(255, 255, 255, .82);
    background: var(--neutral-900);
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.2fr .8fr 1fr;
    gap: 32px;
    padding: 42px 0;
}

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

.site-footer p {
    max-width: 420px;
    margin: 12px 0 0;
    color: rgba(255, 255, 255, .68);
}

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

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
}

.footer-links.compact {
    gap: 8px 12px;
}

.footer-links a:hover {
    color: #fff;
    text-decoration: underline;
}

.footer-bottom {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    padding: 18px;
    border-top: 1px solid rgba(255, 255, 255, .08);
    color: rgba(255, 255, 255, .58);
    font-size: 14px;
}

.is-hidden {
    display: none !important;
}

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

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

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

@media (max-width: 860px) {
    .menu-toggle {
        display: block;
    }

    .nav-shell {
        flex-wrap: wrap;
        padding: 12px 0;
    }

    .nav-panel {
        display: none;
        flex-basis: 100%;
        padding: 16px 0 6px;
        border-top: 1px solid var(--neutral-200);
    }

    .site-header.is-open .nav-panel {
        display: grid;
        gap: 16px;
    }

    .nav-links {
        display: grid;
        gap: 12px;
    }

    .nav-search {
        align-items: stretch;
    }

    .nav-search input {
        flex: 1;
        width: auto;
    }

    .hero {
        height: 640px;
    }

    .hero-overlay {
        background: linear-gradient(0deg, rgba(0, 0, 0, .86), rgba(0, 0, 0, .38));
    }

    .hero-content {
        align-items: end;
        padding-bottom: 150px;
    }

    .hero-arrow {
        display: none;
    }

    .hero-quick {
        bottom: 86px;
        flex-wrap: wrap;
        justify-content: center;
    }

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

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

    .detail-side {
        position: static;
    }

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

    .detail-head img {
        width: 180px;
        height: 260px;
    }
}

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

    .brand-text small {
        display: none;
    }

    .hero-copy p {
        font-size: 16px;
    }

    .hero-meta {
        gap: 8px;
        font-size: 14px;
    }

    .page-section {
        padding: 42px 0;
    }

    .movie-grid,
    .compact-grid,
    .category-grid,
    .filter-grid {
        grid-template-columns: 1fr;
    }

    .poster {
        height: 230px;
    }

    .movie-card-horizontal .card-link {
        display: grid;
        grid-template-columns: 110px 1fr;
    }

    .horizontal-poster {
        width: 110px;
        min-height: 128px;
    }

    .ranking-item > a {
        grid-template-columns: 52px 88px 1fr;
        gap: 12px;
    }

    .ranking-item img {
        width: 88px;
        height: 68px;
    }

    .footer-bottom {
        display: grid;
        text-align: center;
        gap: 4px;
    }
}
