:root {
    --slate-950: #020617;
    --slate-900: #0f172a;
    --slate-850: #111827;
    --slate-800: #1e293b;
    --slate-700: #334155;
    --slate-600: #475569;
    --slate-500: #64748b;
    --slate-200: #e2e8f0;
    --slate-100: #f1f5f9;
    --white: #ffffff;
    --emerald: #10b981;
    --emerald-dark: #059669;
    --teal: #14b8a6;
    --amber: #f59e0b;
    --shadow: 0 24px 60px rgba(15, 23, 42, 0.18);
    --soft-shadow: 0 12px 32px rgba(15, 23, 42, 0.12);
    --radius-xl: 28px;
    --radius-lg: 20px;
    --radius-md: 14px;
    --max-width: 1200px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    color: var(--slate-900);
    background: linear-gradient(180deg, #f8fafc 0%, #eef2f7 46%, #f8fafc 100%);
}

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

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

button,
input {
    font: inherit;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    color: var(--white);
    background: linear-gradient(90deg, var(--slate-900), var(--slate-800));
    box-shadow: 0 16px 40px rgba(2, 6, 23, 0.26);
}

.header-inner {
    width: min(var(--max-width), calc(100% - 32px));
    height: 72px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-width: max-content;
}

.brand-icon {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 14px;
    color: var(--slate-950);
    background: linear-gradient(135deg, var(--emerald), #7dd3fc);
    box-shadow: 0 12px 28px rgba(16, 185, 129, 0.25);
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.brand-text strong {
    font-size: 20px;
    letter-spacing: 0.06em;
}

.brand-text em {
    margin-top: 4px;
    font-size: 12px;
    color: #94a3b8;
    font-style: normal;
}

.desktop-nav {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    flex: 1;
}

.nav-link,
.mobile-nav-link {
    border-radius: 999px;
    color: #dbeafe;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.nav-link {
    padding: 10px 14px;
    font-size: 14px;
    font-weight: 650;
}

.nav-link:hover,
.nav-link.is-active,
.mobile-nav-link:hover,
.mobile-nav-link.is-active {
    color: var(--white);
    background: rgba(16, 185, 129, 0.18);
}

.menu-button {
    display: none;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.08);
    cursor: pointer;
}

.menu-button span {
    display: block;
    width: 20px;
    height: 2px;
    margin: 5px auto;
    border-radius: 2px;
    background: var(--white);
}

.mobile-nav {
    display: none;
    width: min(var(--max-width), calc(100% - 32px));
    margin: 0 auto;
    padding: 0 0 16px;
}

.mobile-nav.is-open {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.mobile-nav-link {
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.06);
}

.hero {
    position: relative;
    overflow: hidden;
    min-height: 680px;
    color: var(--white);
    background: var(--slate-950);
}

.hero-carousel {
    position: relative;
    width: 100%;
    min-height: 680px;
}

.hero-slide {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    align-items: center;
    gap: 56px;
    width: min(var(--max-width), calc(100% - 32px));
    margin: 0 auto;
    opacity: 0;
    pointer-events: none;
    transform: translateY(16px);
    transition: opacity 0.55s ease, transform 0.55s ease;
}

.hero-slide.is-active {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.hero-backdrop {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 760px;
    opacity: 0;
    pointer-events: none;
}

.hero-slide.is-active .hero-backdrop {
    opacity: 1;
}

.hero-backdrop img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(18px) saturate(1.05);
    transform: scale(1.08);
}

.hero-backdrop::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 72% 30%, rgba(20, 184, 166, 0.35), transparent 34%), linear-gradient(90deg, rgba(2, 6, 23, 0.98), rgba(15, 23, 42, 0.82) 48%, rgba(15, 23, 42, 0.48));
}

.hero-content,
.hero-poster {
    position: relative;
    z-index: 2;
}

.hero-kicker,
.eyebrow {
    margin: 0 0 12px;
    color: var(--emerald);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.hero h1,
.hero h2 {
    margin: 0;
    max-width: 820px;
    font-size: clamp(44px, 7vw, 82px);
    line-height: 0.96;
    letter-spacing: -0.055em;
}

.hero-summary {
    max-width: 720px;
    margin: 28px 0 0;
    color: #dbeafe;
    font-size: 18px;
    line-height: 1.8;
}

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

.primary-button,
.ghost-button,
.text-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    border-radius: 999px;
    font-weight: 800;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.primary-button {
    padding: 0 24px;
    color: var(--slate-950);
    background: linear-gradient(135deg, var(--emerald), #6ee7b7);
    box-shadow: 0 18px 34px rgba(16, 185, 129, 0.32);
}

.ghost-button {
    padding: 0 22px;
    color: var(--white);
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(16px);
}

.ghost-button.dark {
    color: var(--slate-900);
    border-color: rgba(15, 23, 42, 0.12);
    background: rgba(255, 255, 255, 0.82);
}

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

.hero-poster {
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 34px;
    box-shadow: 0 36px 82px rgba(0, 0, 0, 0.42);
}

.hero-poster img {
    aspect-ratio: 2 / 3;
    object-fit: cover;
}

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

.hero-dot {
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    color: #cbd5e1;
    background: rgba(255, 255, 255, 0.12);
    cursor: pointer;
}

.hero-dot.is-active {
    color: var(--slate-950);
    background: var(--emerald);
}

.search-panel,
.content-section,
.detail-content,
.pager-links {
    width: min(var(--max-width), calc(100% - 32px));
    margin: 0 auto;
}

.search-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 460px);
    align-items: center;
    gap: 24px;
    margin-top: -56px;
    padding: 28px;
    border-radius: var(--radius-xl);
    background: rgba(255, 255, 255, 0.94);
    box-shadow: var(--shadow);
    position: relative;
    z-index: 10;
}

.search-panel h2,
.section-heading h2,
.sub-hero h1,
.detail-info h1 {
    margin: 0;
    color: var(--slate-900);
}

.search-panel h2 {
    font-size: clamp(24px, 4vw, 38px);
}

.global-search input,
.filter-bar input {
    width: 100%;
    height: 52px;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    padding: 0 20px;
    color: var(--slate-900);
    background: var(--white);
    outline: none;
    transition: border 0.2s ease, box-shadow 0.2s ease;
}

.global-search input:focus,
.filter-bar input:focus {
    border-color: var(--emerald);
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.14);
}

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

.section-heading {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 480px);
    gap: 24px;
    align-items: end;
    margin-bottom: 28px;
}

.section-heading h2 {
    font-size: clamp(28px, 4vw, 44px);
    letter-spacing: -0.04em;
}

.section-heading p {
    margin: 0;
    color: var(--slate-600);
    line-height: 1.8;
}

.filter-bar {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 8px;
}

.filter-bar span,
.global-search span {
    color: var(--slate-600);
    white-space: nowrap;
}

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

.movie-card {
    overflow: hidden;
    border-radius: var(--radius-lg);
    background: var(--white);
    box-shadow: var(--soft-shadow);
    transition: transform 0.22s ease, box-shadow 0.22s ease;
}

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

.poster-link {
    position: relative;
    display: block;
    overflow: hidden;
    background: var(--slate-800);
}

.poster-link img {
    aspect-ratio: 2 / 3;
    object-fit: cover;
    transition: transform 0.32s ease, filter 0.32s ease;
}

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

.rank-mark {
    position: absolute;
    z-index: 2;
    top: 12px;
    left: 12px;
    display: grid;
    place-items: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border-radius: 999px;
    color: var(--slate-950);
    background: linear-gradient(135deg, #fcd34d, var(--amber));
    box-shadow: 0 10px 24px rgba(245, 158, 11, 0.35);
}

.movie-card-body {
    padding: 18px;
}

.movie-meta {
    margin: 0 0 8px;
    color: var(--emerald-dark);
    font-size: 13px;
    font-weight: 800;
}

.movie-card h3 {
    min-height: 3.1em;
    margin: 0;
    color: var(--slate-900);
    font-size: 18px;
    line-height: 1.35;
}

.movie-card h3 a:hover {
    color: var(--emerald-dark);
}

.movie-line {
    min-height: 4.5em;
    margin: 12px 0 14px;
    color: var(--slate-600);
    font-size: 14px;
    line-height: 1.55;
}

.tag-row,
.detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-row span,
.detail-tags span {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0 10px;
    border-radius: 999px;
    color: #047857;
    background: #d1fae5;
    font-size: 12px;
    font-weight: 750;
}

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

.category-tile {
    position: relative;
    overflow: hidden;
    min-height: 260px;
    border-radius: var(--radius-lg);
    color: var(--white);
    background: var(--slate-900);
    box-shadow: var(--soft-shadow);
}

.category-tile img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.58;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.category-tile::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(2, 6, 23, 0.12), rgba(2, 6, 23, 0.88));
}

.category-tile span,
.category-tile p {
    position: relative;
    z-index: 2;
    display: block;
    padding: 0 22px;
}

.category-tile span {
    margin-top: 148px;
    font-size: 24px;
    font-weight: 900;
}

.category-tile p {
    margin: 10px 0 0;
    color: #dbeafe;
    line-height: 1.55;
}

.category-tile:hover img {
    transform: scale(1.05);
    opacity: 0.72;
}

.sub-hero {
    padding: 100px max(16px, calc((100% - var(--max-width)) / 2)) 76px;
    color: var(--white);
    background: radial-gradient(circle at 70% 20%, rgba(16, 185, 129, 0.35), transparent 30%), linear-gradient(135deg, var(--slate-950), var(--slate-800));
}

.sub-hero h1 {
    max-width: 900px;
    color: var(--white);
    font-size: clamp(38px, 6vw, 68px);
    line-height: 1;
    letter-spacing: -0.055em;
}

.sub-hero p:last-child {
    max-width: 760px;
    margin: 22px 0 0;
    color: #dbeafe;
    font-size: 18px;
    line-height: 1.8;
}

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

.overview-card {
    overflow: hidden;
    border-radius: var(--radius-xl);
    background: var(--white);
    box-shadow: var(--soft-shadow);
}

.overview-images {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    background: var(--slate-900);
}

.overview-images img {
    aspect-ratio: 2 / 3;
    object-fit: cover;
}

.overview-body {
    padding: 24px;
}

.overview-body h2 {
    margin: 0 0 12px;
    font-size: 26px;
}

.overview-body p {
    color: var(--slate-600);
    line-height: 1.7;
}

.text-button {
    min-height: 40px;
    padding: 0 18px;
    color: var(--emerald-dark);
    background: #d1fae5;
}

.detail-hero {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 42px;
    width: min(var(--max-width), calc(100% - 32px));
    margin: 0 auto;
    padding: 76px 0 44px;
}

.detail-cover {
    overflow: hidden;
    border-radius: 30px;
    box-shadow: var(--shadow);
    background: var(--slate-800);
}

.detail-cover img {
    aspect-ratio: 2 / 3;
    object-fit: cover;
}

.detail-info {
    align-self: center;
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
    color: var(--slate-500);
    font-size: 14px;
}

.breadcrumb a:hover {
    color: var(--emerald-dark);
}

.detail-info h1 {
    max-width: 860px;
    font-size: clamp(34px, 5vw, 60px);
    line-height: 1.05;
    letter-spacing: -0.05em;
}

.detail-line {
    margin: 22px 0 22px;
    color: var(--slate-600);
    font-size: 18px;
    line-height: 1.8;
}

.player-section {
    width: min(var(--max-width), calc(100% - 32px));
    margin: 0 auto;
}

.player-shell {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-xl);
    background: #000;
    box-shadow: var(--shadow);
}

.movie-video {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
}

.player-cover {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    border: 0;
    padding: 0;
    background: #000;
    cursor: pointer;
}

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

.player-cover img {
    position: absolute;
    inset: 0;
    height: 100%;
    object-fit: cover;
    opacity: 0.55;
}

.play-circle {
    position: relative;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 92px;
    height: 92px;
    border-radius: 50%;
    color: var(--slate-950);
    background: var(--emerald);
    font-size: 34px;
    box-shadow: 0 22px 48px rgba(16, 185, 129, 0.34);
}

.detail-content {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 24px;
    padding-top: 36px;
}

.detail-block {
    border-radius: var(--radius-lg);
    padding: 28px;
    background: var(--white);
    box-shadow: var(--soft-shadow);
}

.detail-block h2 {
    margin: 0 0 16px;
    font-size: 26px;
    letter-spacing: -0.03em;
}

.detail-block p {
    margin: 0 0 14px;
    color: var(--slate-700);
    line-height: 1.9;
}

.detail-meta-block dl {
    margin: 0;
    display: grid;
    gap: 14px;
}

.detail-meta-block div {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 12px;
    padding-bottom: 14px;
    border-bottom: 1px solid #e2e8f0;
}

.detail-meta-block dt {
    color: var(--slate-500);
    font-weight: 800;
}

.detail-meta-block dd {
    margin: 0;
    color: var(--slate-900);
}

.pager-links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    padding-top: 24px;
}

.pager-links a {
    padding: 18px 20px;
    border-radius: var(--radius-md);
    color: var(--slate-900);
    background: var(--white);
    box-shadow: var(--soft-shadow);
}

.pager-links a:last-child {
    text-align: right;
}

.pager-links a:hover {
    color: var(--emerald-dark);
}

.site-footer {
    margin-top: 84px;
    color: #cbd5e1;
    background: var(--slate-950);
}

.footer-inner {
    width: min(var(--max-width), calc(100% - 32px));
    margin: 0 auto;
    padding: 56px 0 28px;
}

.footer-main {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: 34px;
}

.footer-brand {
    margin-bottom: 16px;
    color: var(--white);
    font-size: 24px;
    font-weight: 900;
}

.site-footer h2 {
    margin: 0 0 16px;
    color: var(--white);
    font-size: 18px;
}

.site-footer p {
    margin: 0;
    line-height: 1.8;
}

.footer-links {
    display: grid;
    gap: 10px;
}

.footer-links a:hover {
    color: var(--emerald);
}

.copyright {
    margin-top: 36px;
    padding-top: 24px;
    border-top: 1px solid rgba(148, 163, 184, 0.16);
    text-align: center;
    color: #94a3b8;
}

[data-search-card][hidden] {
    display: none;
}

.back-to-top {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 40;
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border: 0;
    border-radius: 50%;
    color: var(--slate-950);
    background: var(--emerald);
    box-shadow: 0 16px 34px rgba(16, 185, 129, 0.35);
    cursor: pointer;
}

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

    .menu-button {
        display: block;
    }

    .hero-slide {
        grid-template-columns: minmax(0, 1fr) 260px;
        gap: 28px;
    }

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

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

@media (max-width: 760px) {
    .header-inner {
        height: 66px;
    }

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

    .hero,
    .hero-carousel {
        min-height: 760px;
    }

    .hero-slide {
        grid-template-columns: 1fr;
        align-content: center;
        gap: 28px;
        padding: 60px 0 90px;
    }

    .hero-poster {
        width: min(260px, 74vw);
        margin: 0 auto;
        order: -1;
    }

    .hero h1,
    .hero h2 {
        font-size: clamp(36px, 13vw, 56px);
    }

    .hero-summary {
        font-size: 16px;
    }

    .search-panel,
    .section-heading,
    .detail-hero,
    .footer-main,
    .pager-links {
        grid-template-columns: 1fr;
    }

    .search-panel {
        margin-top: -34px;
        padding: 22px;
    }

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

    .movie-card-body {
        padding: 14px;
    }

    .movie-card h3 {
        font-size: 16px;
    }

    .movie-line {
        font-size: 13px;
    }

    .category-tile {
        min-height: 220px;
    }

    .category-tile span {
        margin-top: 120px;
        font-size: 20px;
    }

    .detail-cover {
        width: min(280px, 76vw);
        margin: 0 auto;
    }

    .pager-links a:last-child {
        text-align: left;
    }
}

@media (max-width: 520px) {
    .movie-grid,
    .category-grid,
    .overview-grid {
        grid-template-columns: 1fr;
    }

    .mobile-nav.is-open {
        grid-template-columns: 1fr;
    }

    .filter-bar {
        display: grid;
    }

    .play-circle {
        width: 72px;
        height: 72px;
        font-size: 28px;
    }
}
