* {
    box-sizing: border-box;
}

:root {
    --bg: #030712;
    --bg-soft: #07111f;
    --panel: rgba(15, 23, 42, 0.78);
    --panel-strong: rgba(17, 24, 39, 0.94);
    --line: rgba(148, 163, 184, 0.18);
    --text: #f8fafc;
    --muted: #cbd5e1;
    --muted-soft: #94a3b8;
    --blue: #2563eb;
    --blue-light: #60a5fa;
    --yellow: #facc15;
    --radius: 22px;
    --shadow: 0 20px 70px rgba(0, 0, 0, 0.35);
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(37, 99, 235, 0.24), transparent 34rem),
        radial-gradient(circle at top right, rgba(30, 64, 175, 0.2), transparent 28rem),
        linear-gradient(180deg, #030712 0%, #07111f 46%, #030712 100%);
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
    line-height: 1.6;
}

body.nav-open {
    overflow: hidden;
}

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: 60;
    border-bottom: 1px solid var(--line);
    background: rgba(3, 7, 18, 0.76);
    backdrop-filter: blur(18px);
}

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

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

.logo-mark {
    width: 40px;
    height: 40px;
    display: inline-grid;
    place-items: center;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--blue), #1d4ed8 55%, #172554);
    box-shadow: 0 12px 32px rgba(37, 99, 235, 0.42);
}

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

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

.nav-link {
    display: inline-flex;
    align-items: center;
    padding: 10px 14px;
    border-radius: 12px;
    color: var(--muted);
    font-size: 0.94rem;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.nav-link:hover,
.nav-link.is-active {
    color: #ffffff;
    background: rgba(37, 99, 235, 0.92);
    transform: translateY(-1px);
}

.nav-toggle {
    display: none;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 14px;
    color: #ffffff;
    background: rgba(15, 23, 42, 0.8);
    cursor: pointer;
}

.nav-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    margin: 5px auto;
    border-radius: 999px;
    background: #ffffff;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

body.nav-open .nav-toggle span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

body.nav-open .nav-toggle span:nth-child(2) {
    opacity: 0;
}

body.nav-open .nav-toggle span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.mobile-nav {
    display: none;
    width: min(1280px, calc(100% - 32px));
    margin: 0 auto 18px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

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

.hero {
    position: relative;
    width: min(1400px, calc(100% - 24px));
    min-height: 78vh;
    margin: 0 auto;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 0 0 34px 34px;
    background: #020617;
    box-shadow: var(--shadow);
}

.hero-slide {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.74fr);
    align-items: center;
    gap: 40px;
    padding: 112px 64px 70px;
    opacity: 0;
    pointer-events: none;
    transform: scale(1.02);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

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

.hero-slide::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(3, 7, 18, 0.92) 0%, rgba(3, 7, 18, 0.68) 46%, rgba(3, 7, 18, 0.24) 100%),
        linear-gradient(180deg, rgba(3, 7, 18, 0.18) 0%, #030712 100%);
    z-index: 1;
}

.hero-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: saturate(1.05) contrast(1.05);
}

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

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 13px;
    border: 1px solid rgba(96, 165, 250, 0.36);
    border-radius: 999px;
    color: #bfdbfe;
    background: rgba(37, 99, 235, 0.14);
    backdrop-filter: blur(10px);
    font-size: 0.9rem;
}

.hero h1,
.page-hero h1,
.detail-title h1 {
    margin: 18px 0 16px;
    font-size: clamp(2.5rem, 6vw, 5.8rem);
    line-height: 0.98;
    letter-spacing: -0.06em;
}

.hero p,
.page-hero p {
    max-width: 760px;
    margin: 0;
    color: var(--muted);
    font-size: clamp(1rem, 2vw, 1.25rem);
}

.hero-tags,
.card-tags,
.detail-tags,
.category-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.hero-tags {
    margin: 24px 0 30px;
}

.hero-tags span,
.card-tags span,
.detail-tags span,
.category-tags span {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    color: #dbeafe;
    background: rgba(30, 64, 175, 0.4);
    border: 1px solid rgba(96, 165, 250, 0.24);
    font-size: 0.82rem;
}

.hero-actions,
.section-heading-actions,
.detail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.button-primary,
.button-secondary,
.card-more,
.search-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 20px;
    border: 0;
    border-radius: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.button-primary,
.search-submit {
    color: #ffffff;
    background: linear-gradient(135deg, var(--blue), #1d4ed8);
    box-shadow: 0 16px 34px rgba(37, 99, 235, 0.3);
}

.button-secondary {
    color: #ffffff;
    border: 1px solid var(--line);
    background: rgba(15, 23, 42, 0.68);
}

.button-primary:hover,
.button-secondary:hover,
.card-more:hover,
.search-submit:hover {
    transform: translateY(-2px);
}

.hero-poster-card {
    align-self: end;
    padding: 14px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 28px;
    background: rgba(15, 23, 42, 0.58);
    backdrop-filter: blur(18px);
    box-shadow: var(--shadow);
}

.hero-poster-card img {
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    border-radius: 22px;
}

.hero-poster-caption {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 2px 4px;
    color: var(--muted);
}

.hero-controls {
    position: absolute;
    left: 64px;
    bottom: 28px;
    z-index: 3;
    display: flex;
    gap: 10px;
}

.hero-dot {
    width: 38px;
    height: 5px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.34);
    cursor: pointer;
}

.hero-dot.is-active {
    background: #60a5fa;
}

.section,
.page-hero,
.detail-main {
    padding: 56px 0;
}

.page-hero {
    width: min(1280px, calc(100% - 32px));
    margin: 0 auto;
}

.page-hero-inner,
.feature-panel,
.search-panel,
.detail-panel,
.player-section,
.category-card,
.ranking-row {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
    backdrop-filter: blur(16px);
    box-shadow: 0 16px 44px rgba(0, 0, 0, 0.18);
}

.page-hero-inner {
    padding: clamp(28px, 5vw, 56px);
    overflow: hidden;
    background:
        linear-gradient(135deg, rgba(37, 99, 235, 0.16), rgba(15, 23, 42, 0.78)),
        var(--panel);
}

.page-hero h1 {
    margin-top: 12px;
}

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

.section-heading h2 {
    margin: 0;
    font-size: clamp(1.7rem, 3vw, 2.5rem);
    letter-spacing: -0.04em;
}

.section-heading p {
    margin: 8px 0 0;
    color: var(--muted-soft);
}

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

.movie-card {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: rgba(15, 23, 42, 0.82);
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.movie-card:hover {
    transform: translateY(-6px);
    border-color: rgba(96, 165, 250, 0.42);
    box-shadow: 0 18px 55px rgba(0, 0, 0, 0.28);
}

.poster-link {
    position: relative;
    display: block;
    overflow: hidden;
    background: #020617;
}

.poster-link img {
    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    transition: transform 0.45s ease;
}

.movie-card:hover .poster-link img,
.strip-item:hover img {
    transform: scale(1.06);
}

.poster-glow {
    position: absolute;
    inset: auto 0 0;
    height: 45%;
    background: linear-gradient(180deg, transparent, rgba(3, 7, 18, 0.82));
}

.rank-badge,
.strip-rank {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 2;
    min-width: 34px;
    min-height: 34px;
    display: inline-grid;
    place-items: center;
    border-radius: 12px;
    color: #0f172a;
    background: var(--yellow);
    font-weight: 900;
}

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

.card-meta-row,
.detail-meta,
.breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    color: var(--muted-soft);
    font-size: 0.9rem;
}

.card-meta-row span:not(:last-child)::after,
.detail-meta span:not(:last-child)::after {
    content: "·";
    margin-left: 8px;
    color: #475569;
}

.movie-card h3 {
    min-height: 3.2em;
    margin: 10px 0 8px;
    font-size: 1.08rem;
    line-height: 1.35;
}

.movie-card h3 a:hover,
.breadcrumbs a:hover,
.footer-links a:hover {
    color: var(--blue-light);
}

.movie-card p {
    display: -webkit-box;
    min-height: 4.8em;
    margin: 0 0 14px;
    overflow: hidden;
    color: var(--muted);
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    font-size: 0.94rem;
}

.card-tags {
    margin-bottom: 14px;
}

.card-more {
    min-height: 38px;
    width: 100%;
    color: #ffffff;
    background: rgba(37, 99, 235, 0.82);
}

.feature-panel,
.search-panel {
    padding: clamp(20px, 4vw, 34px);
}

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

.category-card {
    padding: 22px;
    min-height: 170px;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.category-card:hover {
    transform: translateY(-5px);
    border-color: rgba(96, 165, 250, 0.42);
}

.category-card h2,
.category-card h3 {
    margin: 0 0 10px;
    font-size: 1.25rem;
}

.category-card p {
    margin: 0 0 18px;
    color: var(--muted);
}

.category-card span {
    color: var(--blue-light);
    font-weight: 700;
}

.search-form,
.listing-toolbar {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    margin: 24px 0;
}

.search-form input,
.listing-toolbar input,
.listing-toolbar select {
    width: 100%;
    min-height: 48px;
    border: 1px solid var(--line);
    border-radius: 15px;
    color: #ffffff;
    background: rgba(15, 23, 42, 0.88);
    outline: none;
    padding: 0 16px;
}

.search-form input:focus,
.listing-toolbar input:focus,
.listing-toolbar select:focus {
    border-color: rgba(96, 165, 250, 0.68);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.16);
}

.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 24px;
}

.filter-chip {
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
    background: rgba(15, 23, 42, 0.72);
    padding: 8px 13px;
    cursor: pointer;
}

.filter-chip.is-active,
.filter-chip:hover {
    color: #ffffff;
    border-color: rgba(96, 165, 250, 0.48);
    background: rgba(37, 99, 235, 0.72);
}

.strip-scroll {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 150px;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 8px;
    scrollbar-width: none;
}

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

.strip-item {
    position: relative;
    display: block;
    overflow: hidden;
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.8);
}

.strip-item img {
    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    transition: transform 0.35s ease;
}

.strip-item span:last-child {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 38px 10px 10px;
    background: linear-gradient(180deg, transparent, rgba(3, 7, 18, 0.94));
    font-weight: 700;
    font-size: 0.9rem;
}

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

.ranking-row {
    display: grid;
    grid-template-columns: 62px 88px 1fr auto;
    align-items: center;
    gap: 16px;
    padding: 12px;
}

.ranking-row img {
    width: 88px;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    border-radius: 14px;
}

.ranking-row h3 {
    margin: 0 0 8px;
    font-size: 1.18rem;
}

.ranking-row p {
    margin: 0;
    color: var(--muted);
}

.ranking-num {
    display: inline-grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 14px;
    color: #0f172a;
    background: var(--yellow);
    font-weight: 900;
}

.detail-main {
    width: min(1280px, calc(100% - 32px));
    margin: 0 auto;
}

.detail-grid {
    display: grid;
    grid-template-columns: minmax(280px, 0.35fr) minmax(0, 1fr);
    gap: 28px;
    align-items: start;
}

.detail-cover {
    position: sticky;
    top: 96px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 28px;
    background: rgba(15, 23, 42, 0.78);
    box-shadow: var(--shadow);
}

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

.detail-panel {
    padding: clamp(22px, 4vw, 40px);
}

.breadcrumbs {
    margin-bottom: 18px;
}

.detail-title h1 {
    font-size: clamp(2.1rem, 5vw, 4.6rem);
}

.detail-meta {
    margin-bottom: 20px;
}

.detail-tags {
    margin: 20px 0 28px;
}

.detail-content h2 {
    margin: 30px 0 10px;
    font-size: 1.45rem;
}

.detail-content p {
    color: var(--muted);
    margin: 0;
}

.player-section {
    margin: 34px 0;
    padding: 14px;
}

.player-shell {
    position: relative;
    overflow: hidden;
    border-radius: 22px;
    background: #000000;
    aspect-ratio: 16 / 9;
}

.movie-video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000000;
}

.player-overlay {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    border: 0;
    color: #ffffff;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.12), rgba(0, 0, 0, 0.66));
    cursor: pointer;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.player-shell.is-playing .player-overlay {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.play-icon {
    width: 76px;
    height: 76px;
    display: inline-grid;
    place-items: center;
    border-radius: 50%;
    color: #ffffff;
    background: rgba(37, 99, 235, 0.92);
    box-shadow: 0 16px 38px rgba(37, 99, 235, 0.35);
    font-size: 2rem;
}

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

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

.search-result-card {
    display: grid;
    grid-template-columns: 92px 1fr;
    gap: 14px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.82);
}

.search-result-card img {
    width: 92px;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    border-radius: 13px;
}

.search-result-card h3 {
    margin: 0 0 8px;
}

.search-result-card p {
    margin: 0;
    color: var(--muted);
    font-size: 0.92rem;
}

.empty-state {
    display: none;
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: 18px;
    color: var(--muted);
    background: rgba(15, 23, 42, 0.68);
}

.site-footer {
    border-top: 1px solid var(--line);
    background: rgba(3, 7, 18, 0.74);
}

.footer-inner {
    width: min(1280px, calc(100% - 32px));
    margin: 0 auto;
    padding: 38px 0;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 28px;
    align-items: center;
}

.footer-logo {
    margin-bottom: 12px;
    font-size: 1.15rem;
}

.site-footer p {
    max-width: 720px;
    margin: 0;
    color: var(--muted-soft);
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 12px;
    color: var(--muted);
}

.hidden-by-filter {
    display: none !important;
}

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

    .nav-toggle {
        display: block;
    }

    body.nav-open .mobile-nav {
        display: grid;
    }

    .hero-slide {
        grid-template-columns: 1fr;
        padding: 104px 34px 82px;
    }

    .hero-poster-card {
        display: none;
    }

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

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

@media (max-width: 860px) {
    .hero {
        min-height: 76vh;
        border-radius: 0 0 24px 24px;
    }

    .hero-slide {
        padding: 96px 22px 78px;
    }

    .hero h1,
    .page-hero h1,
    .detail-title h1 {
        letter-spacing: -0.04em;
    }

    .hero-controls {
        left: 24px;
    }

    .section-heading,
    .footer-inner,
    .detail-grid,
    .ranking-row {
        grid-template-columns: 1fr;
    }

    .section-heading {
        align-items: start;
    }

    .detail-cover {
        position: static;
        max-width: 360px;
    }

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

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

    .search-form,
    .listing-toolbar {
        grid-template-columns: 1fr;
    }

    .ranking-row img {
        width: 120px;
    }

    .footer-links {
        justify-content: flex-start;
    }
}

@media (max-width: 540px) {
    .header-inner,
    .main,
    .page-hero,
    .detail-main,
    .footer-inner,
    .mobile-nav {
        width: min(100% - 22px, 1280px);
    }

    .movie-grid,
    .related-grid {
        grid-template-columns: 1fr;
    }

    .hero-actions,
    .detail-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .button-primary,
    .button-secondary {
        width: 100%;
    }

    .search-result-card {
        grid-template-columns: 78px 1fr;
    }

    .search-result-card img {
        width: 78px;
    }
}
