:root {
    --bg: #f8fafc;
    --panel: #ffffff;
    --ink: #0f172a;
    --muted: #64748b;
    --line: #e2e8f0;
    --dark: #020617;
    --dark-soft: #0f172a;
    --primary: #1e293b;
    --accent: #f59e0b;
    --rose: #e11d48;
    --green: #059669;
    --blue: #2563eb;
    --shadow: 0 18px 45px rgba(15, 23, 42, .12);
    --radius: 22px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    background: var(--bg);
    color: var(--ink);
    line-height: 1.6;
}

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

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

button,
input,
select {
    font: inherit;
}

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

.nav-wrap {
    max-width: 1240px;
    margin: 0 auto;
    min-height: 72px;
    padding: 0 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

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

.brand-icon {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    color: #fff;
    background: linear-gradient(135deg, #334155, #020617);
    box-shadow: 0 12px 26px rgba(15, 23, 42, .25);
}

.brand strong,
.footer-brand {
    display: block;
    font-size: 22px;
    line-height: 1.1;
    font-weight: 800;
    letter-spacing: -.03em;
}

.brand em {
    display: block;
    font-size: 12px;
    line-height: 1.4;
    color: var(--muted);
    font-style: normal;
}

.main-nav {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 18px;
    font-size: 15px;
    color: #334155;
}

.main-nav a {
    position: relative;
    white-space: nowrap;
    transition: color .2s ease;
}

.main-nav a::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -8px;
    height: 2px;
    border-radius: 99px;
    background: var(--ink);
    transform: scaleX(0);
    transition: transform .2s ease;
}

.main-nav a:hover {
    color: var(--ink);
}

.main-nav a:hover::after {
    transform: scaleX(1);
}

.menu-toggle {
    display: none;
    border: 0;
    border-radius: 14px;
    background: #eef2f7;
    color: #0f172a;
    width: 42px;
    height: 42px;
    cursor: pointer;
}

.hero {
    position: relative;
    min-height: 560px;
    height: 72vh;
    overflow: hidden;
    background: #020617;
}

.hero-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 900ms ease;
}

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

.hero-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.03);
}

.hero-layer {
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(2, 6, 23, .96), rgba(2, 6, 23, .45) 48%, rgba(2, 6, 23, .75));
}

.hero-content {
    position: absolute;
    left: 50%;
    bottom: 82px;
    width: min(1240px, calc(100% - 44px));
    transform: translateX(-50%);
    color: #fff;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 330px;
    gap: 34px;
    align-items: end;
}

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

.hero-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .16);
    backdrop-filter: blur(12px);
    font-size: 13px;
    color: rgba(255, 255, 255, .92);
}

.hero h1 {
    margin: 18px 0 14px;
    font-size: clamp(38px, 6vw, 76px);
    line-height: .95;
    letter-spacing: -.055em;
    font-weight: 900;
    text-shadow: 0 20px 60px rgba(0, 0, 0, .36);
}

.hero p {
    margin: 0 0 22px;
    color: rgba(255, 255, 255, .84);
    font-size: 18px;
    max-width: 720px;
}

.hero-actions,
.action-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 13px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    border-radius: 999px;
    padding: 0 20px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
    font-weight: 700;
}

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

.btn-primary {
    background: #fff;
    color: #020617;
    box-shadow: 0 16px 32px rgba(255, 255, 255, .18);
}

.btn-dark {
    background: var(--dark-soft);
    color: #fff;
    box-shadow: 0 16px 32px rgba(15, 23, 42, .22);
}

.btn-ghost {
    color: #fff;
    background: rgba(255, 255, 255, .15);
    border-color: rgba(255, 255, 255, .2);
    backdrop-filter: blur(12px);
}

.hero-panel {
    border: 1px solid rgba(255, 255, 255, .18);
    background: rgba(15, 23, 42, .42);
    backdrop-filter: blur(18px);
    border-radius: var(--radius);
    padding: 18px;
    box-shadow: 0 22px 68px rgba(0, 0, 0, .28);
}

.hero-panel h2 {
    margin: 0 0 14px;
    font-size: 18px;
}

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

.hero-mini-list a {
    display: grid;
    grid-template-columns: 56px 1fr;
    gap: 12px;
    align-items: center;
    border-radius: 16px;
    padding: 8px;
    background: rgba(255, 255, 255, .08);
    transition: background .2s ease;
}

.hero-mini-list a:hover {
    background: rgba(255, 255, 255, .16);
}

.hero-mini-list img {
    width: 56px;
    height: 74px;
    object-fit: cover;
    border-radius: 12px;
}

.hero-mini-list strong,
.hero-mini-list span {
    display: block;
}

.hero-mini-list span {
    font-size: 12px;
    color: rgba(255, 255, 255, .68);
}

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

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

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

.hero-arrow {
    position: absolute;
    top: 50%;
    z-index: 7;
    width: 48px;
    height: 48px;
    border: 0;
    border-radius: 50%;
    color: #fff;
    background: rgba(255, 255, 255, .14);
    backdrop-filter: blur(10px);
    cursor: pointer;
    transform: translateY(-50%);
}

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

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

.page-shell,
.content-section,
.search-hero,
.category-hero,
.detail-shell,
.footer-grid {
    max-width: 1240px;
    margin: 0 auto;
    padding-left: 22px;
    padding-right: 22px;
}

.content-section {
    padding-top: 64px;
    padding-bottom: 64px;
}

.content-section.alt {
    max-width: none;
    background: #fff;
}

.content-section.alt > .inner {
    max-width: 1240px;
    margin: 0 auto;
    padding-left: 22px;
    padding-right: 22px;
}

.section-title {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 28px;
}

.eyebrow {
    display: inline-flex;
    margin-bottom: 7px;
    color: #b45309;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.section-title h2,
.category-hero h1,
.search-hero h1,
.detail-title h1 {
    margin: 0;
    font-size: clamp(30px, 4vw, 44px);
    line-height: 1.08;
    letter-spacing: -.04em;
}

.section-more {
    color: var(--muted);
    font-weight: 700;
}

.section-more:hover {
    color: var(--ink);
}

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

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

.movie-card {
    background: var(--panel);
    border: 1px solid rgba(226, 232, 240, .88);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(15, 23, 42, .08);
    transition: transform .25s ease, box-shadow .25s ease;
}

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

.poster-link {
    position: relative;
    display: block;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    background: #0f172a;
}

.horizontal-card {
    display: grid;
    grid-template-columns: 42% 1fr;
}

.horizontal-card .poster-link {
    height: 100%;
    aspect-ratio: auto;
    min-height: 210px;
}

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

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

.poster-shade {
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(0, 0, 0, .62), rgba(0, 0, 0, 0) 55%);
}

.play-dot {
    position: absolute;
    right: 14px;
    bottom: 14px;
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, .92);
    color: #020617;
    font-size: 14px;
    box-shadow: 0 12px 24px rgba(0, 0, 0, .25);
}

.rank-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    min-width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    color: #fff;
    background: linear-gradient(135deg, #f59e0b, #e11d48);
    box-shadow: 0 12px 24px rgba(225, 29, 72, .28);
}

.card-body {
    padding: 18px;
}

.meta-line {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    color: var(--muted);
    font-size: 12px;
    margin-bottom: 8px;
}

.card-body h3 {
    margin: 0 0 8px;
    font-size: 20px;
    line-height: 1.22;
    letter-spacing: -.02em;
}

.card-body h3 a:hover {
    color: #b45309;
}

.card-body p {
    margin: 0 0 14px;
    color: #475569;
    font-size: 14px;
}

.tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

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

.category-pills {
    max-width: 1240px;
    margin: 0 auto;
    padding: 32px 22px 0;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 16px;
}

.category-pill {
    border-radius: 22px;
    padding: 18px;
    color: #fff;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: linear-gradient(135deg, #0f172a, #334155);
    box-shadow: 0 16px 34px rgba(15, 23, 42, .16);
    transition: transform .22s ease;
}

.category-pill:nth-child(3n+1) {
    background: linear-gradient(135deg, #0f172a, #7c2d12);
}

.category-pill:nth-child(3n+2) {
    background: linear-gradient(135deg, #172554, #0f766e);
}

.category-pill:hover {
    transform: translateY(-4px);
}

.category-pill strong {
    font-size: 20px;
}

.category-pill span {
    color: rgba(255, 255, 255, .72);
    font-size: 13px;
}

.search-hero,
.category-hero {
    padding-top: 56px;
    padding-bottom: 28px;
}

.search-hero p,
.category-hero p {
    max-width: 760px;
    color: var(--muted);
    font-size: 17px;
}

.filter-bar {
    margin-top: 24px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 160px 160px;
    gap: 12px;
}

.filter-bar input,
.filter-bar select {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fff;
    min-height: 52px;
    padding: 0 16px;
    outline: none;
    box-shadow: 0 10px 24px rgba(15, 23, 42, .06);
}

.filter-bar input:focus,
.filter-bar select:focus {
    border-color: #94a3b8;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    color: #64748b;
    font-size: 14px;
    margin: 22px 0;
}

.breadcrumb a:hover {
    color: #0f172a;
}

.detail-shell {
    padding-top: 22px;
    padding-bottom: 70px;
}

.detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 350px;
    gap: 34px;
}

.player-card,
.info-card,
.side-card {
    background: #fff;
    border: 1px solid rgba(226, 232, 240, .88);
    border-radius: 26px;
    overflow: hidden;
    box-shadow: 0 10px 32px rgba(15, 23, 42, .08);
}

.player-wrap {
    position: relative;
    background: #020617;
    aspect-ratio: 16 / 9;
}

.player-wrap video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    background: #020617;
}

.player-overlay {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    background: linear-gradient(0deg, rgba(2, 6, 23, .72), rgba(2, 6, 23, .24));
    pointer-events: auto;
}

.player-overlay.is-hidden {
    display: none;
}

.start-play {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, .25);
    color: #020617;
    background: rgba(255, 255, 255, .95);
    font-size: 32px;
    cursor: pointer;
    box-shadow: 0 22px 42px rgba(0, 0, 0, .32);
}

.player-message {
    padding: 12px 18px;
    color: #b91c1c;
    display: none;
}

.player-message.show {
    display: block;
}

.detail-title {
    padding: 24px 24px 0;
}

.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 14px 0 18px;
    color: #475569;
}

.detail-meta span {
    border-radius: 999px;
    background: #f1f5f9;
    padding: 7px 11px;
    font-size: 13px;
    font-weight: 700;
}

.info-card {
    margin-top: 24px;
    padding: 26px;
}

.info-card h2 {
    margin: 0 0 12px;
    font-size: 24px;
}

.info-card p {
    margin: 0 0 18px;
    color: #334155;
}

.detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 18px;
}

.side-card {
    padding: 20px;
    margin-bottom: 24px;
}

.side-card h2 {
    margin: 0 0 16px;
    font-size: 21px;
}

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

.side-list a {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
}

.side-list img {
    width: 56px;
    height: 74px;
    object-fit: cover;
    border-radius: 12px;
}

.side-list strong {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.side-list span {
    display: block;
    color: #64748b;
    font-size: 13px;
}

.related-section {
    margin-top: 36px;
}

.site-footer {
    background: #020617;
    color: #cbd5e1;
    padding: 54px 0;
}

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

.footer-brand {
    color: #fff;
    margin-bottom: 12px;
}

.site-footer p {
    margin: 0;
    color: #94a3b8;
}

.site-footer h3 {
    margin: 0 0 14px;
    color: #fff;
}

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

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

.empty-state {
    display: none;
    padding: 30px;
    border-radius: 20px;
    background: #fff;
    color: #64748b;
    border: 1px solid var(--line);
}

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

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

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

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

    .hero-panel {
        display: none;
    }
}

@media (max-width: 820px) {
    .menu-toggle {
        display: grid;
        place-items: center;
    }

    .main-nav {
        position: absolute;
        left: 16px;
        right: 16px;
        top: 72px;
        display: none;
        padding: 18px;
        border: 1px solid var(--line);
        border-radius: 22px;
        background: rgba(255, 255, 255, .96);
        box-shadow: var(--shadow);
        flex-direction: column;
        align-items: flex-start;
    }

    .main-nav.open {
        display: flex;
    }

    .hero {
        min-height: 620px;
    }

    .hero h1 {
        font-size: 42px;
    }

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

    .hero-content {
        bottom: 74px;
    }

    .hero-arrow {
        display: none;
    }

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

    .filter-bar {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .nav-wrap,
    .page-shell,
    .content-section,
    .search-hero,
    .category-hero,
    .detail-shell,
    .footer-grid {
        padding-left: 16px;
        padding-right: 16px;
    }

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

    .brand em {
        display: none;
    }

    .movie-grid,
    .category-pills,
    .footer-grid {
        grid-template-columns: 1fr;
    }

    .horizontal-card {
        grid-template-columns: 1fr;
    }

    .horizontal-card .poster-link {
        aspect-ratio: 16 / 10;
        min-height: 0;
    }

    .content-section {
        padding-top: 44px;
        padding-bottom: 44px;
    }

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

    .start-play {
        width: 76px;
        height: 76px;
        font-size: 26px;
    }
}
