:root {
    --deep-space-950: #020617;
    --deep-space-900: #0f172a;
    --deep-space-850: #132033;
    --deep-space-800: #1e293b;
    --deep-space-700: #334155;
    --cloud-realm-300: #7dd3fc;
    --cloud-realm-400: #38bdf8;
    --cloud-realm-500: #0ea5e9;
    --cloud-realm-600: #0284c7;
    --cloud-realm-700: #0369a1;
    --cyber-blue-400: #60a5fa;
    --cyber-blue-600: #2563eb;
    --orange: #f97316;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-soft: #cbd5e1;
    --line: rgba(7, 89, 133, 0.3);
    --shadow: 0 24px 60px rgba(2, 6, 23, 0.45);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text-main);
    background: radial-gradient(circle at top left, rgba(14, 165, 233, 0.14), transparent 34rem), var(--deep-space-950);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    line-height: 1.6;
}

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

img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

button,
input,
select {
    font: inherit;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(15, 23, 42, 0.95);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(16px);
}

.header-inner,
.footer-inner,
.section-wrap,
.hero-content,
.page-hero-inner {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
}

.header-inner {
    min-height: 76px;
    display: flex;
    align-items: center;
    gap: 20px;
}

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

.brand-mark {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    color: #fff;
    background: linear-gradient(135deg, var(--cloud-realm-500), var(--cyber-blue-600));
    border-radius: 14px;
    box-shadow: 0 0 26px rgba(14, 165, 233, 0.38);
}

.brand-text,
.footer-brand {
    font-size: 1.3rem;
    background: linear-gradient(90deg, var(--cloud-realm-400), var(--cyber-blue-400));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
}

.nav-link {
    padding: 9px 12px;
    border-radius: 12px;
    color: #d1d5db;
    font-size: 0.94rem;
    transition: color 0.2s ease, background 0.2s ease;
    white-space: nowrap;
}

.nav-link:hover,
.nav-link.active {
    color: var(--cloud-realm-400);
    background: var(--deep-space-800);
}

.header-search {
    position: relative;
    display: flex;
    align-items: center;
    width: 270px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--deep-space-800);
    overflow: hidden;
}

.header-search input {
    min-width: 0;
    flex: 1;
    padding: 10px 12px;
    color: var(--text-main);
    border: 0;
    outline: 0;
    background: transparent;
}

.header-search button,
.search-panel button,
.primary-btn,
.secondary-btn,
.player-cover {
    cursor: pointer;
}

.header-search button {
    padding: 10px 13px;
    color: #fff;
    border: 0;
    background: var(--cloud-realm-600);
}

.nav-toggle {
    display: none;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 12px;
    background: var(--deep-space-800);
}

.nav-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    margin: 4px auto;
    background: #d1d5db;
}

.hero-carousel {
    position: relative;
    min-height: 76vh;
    overflow: hidden;
    background: #000;
}

.hero-slide {
    position: absolute;
    inset: 0;
    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;
    filter: saturate(1.05);
}

.hero-slide::before,
.hero-slide::after {
    content: "";
    position: absolute;
    inset: 0;
}

.hero-slide::before {
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.86), rgba(0, 0, 0, 0.48), rgba(0, 0, 0, 0.12));
}

.hero-slide::after {
    background: linear-gradient(0deg, var(--deep-space-950), transparent 46%);
}

.hero-content {
    position: relative;
    z-index: 2;
    min-height: 76vh;
    display: flex;
    align-items: center;
}

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

.eyebrow,
.rank-badge,
.kicker {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 12px;
    color: #fff;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.9);
    backdrop-filter: blur(10px);
    font-size: 0.88rem;
    font-weight: 700;
}

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

.hero-copy p {
    max-width: 620px;
    margin: 0 0 28px;
    color: #d1d5db;
    font-size: 1.08rem;
}

.hero-actions,
.detail-actions,
.panel-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
}

.primary-btn,
.secondary-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    padding: 0 22px;
    border: 0;
    border-radius: 14px;
    font-weight: 800;
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.primary-btn {
    color: #fff;
    background: var(--cloud-realm-600);
    box-shadow: 0 18px 44px rgba(2, 132, 199, 0.32);
}

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

.secondary-btn {
    color: var(--cloud-realm-300);
    border: 1px solid var(--line);
    background: rgba(30, 41, 59, 0.68);
}

.primary-btn:hover,
.secondary-btn:hover,
.movie-card:hover,
.category-tile:hover {
    transform: translateY(-2px);
}

.hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    color: var(--text-muted);
}

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

.hero-dot {
    width: 10px;
    height: 10px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.5);
    transition: width 0.2s ease, background 0.2s ease;
}

.hero-dot.is-active {
    width: 38px;
    background: var(--cloud-realm-500);
}

.section-wrap {
    padding: 70px 0;
}

.section-alt {
    background: var(--deep-space-900);
}

.section-gradient {
    background: linear-gradient(135deg, #172554, var(--deep-space-950));
}

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

.section-heading h2,
.page-hero h1,
.detail-title h1 {
    margin: 0;
    font-size: clamp(1.7rem, 4vw, 3rem);
    line-height: 1.15;
}

.section-heading p,
.page-hero p,
.detail-title p {
    max-width: 720px;
    margin: 10px 0 0;
    color: var(--text-muted);
}

.section-more {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--cloud-realm-400);
    font-weight: 700;
}

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

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

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

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

.movie-card,
.category-tile,
.info-panel,
.search-panel,
.detail-card,
.player-section {
    border: 1px solid var(--line);
    background: rgba(15, 23, 42, 0.72);
    box-shadow: var(--shadow);
}

.movie-card {
    position: relative;
    overflow: hidden;
    border-radius: 20px;
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.movie-card:hover {
    border-color: rgba(56, 189, 248, 0.55);
    background: rgba(30, 41, 59, 0.88);
}

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

.movie-card-large .poster-link {
    aspect-ratio: 16 / 9;
}

.poster-link img {
    transition: transform 0.35s ease;
}

.movie-card:hover img,
.category-tile:hover img {
    transform: scale(1.05);
}

.poster-glow {
    position: absolute;
    inset: auto 0 0;
    height: 44%;
    background: linear-gradient(0deg, rgba(2, 6, 23, 0.9), transparent);
}

.rank-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 2;
    min-width: 38px;
    justify-content: center;
    background: rgba(249, 115, 22, 0.94);
}

.card-body {
    padding: 14px;
}

.meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    color: var(--text-muted);
    font-size: 0.78rem;
}

.meta-row span {
    padding: 2px 7px;
    border-radius: 999px;
    background: rgba(51, 65, 85, 0.8);
}

.movie-card h3 {
    margin: 10px 0 6px;
    font-size: 1rem;
    line-height: 1.35;
}

.movie-card h3 a:hover,
.footer-links a:hover,
.breadcrumb a:hover {
    color: var(--cloud-realm-400);
}

.movie-card p {
    min-height: 3.3em;
    margin: 0;
    color: var(--text-muted);
    font-size: 0.9rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 12px;
}

.tag {
    display: inline-flex;
    padding: 3px 8px;
    color: var(--cloud-realm-300);
    border: 1px solid rgba(56, 189, 248, 0.22);
    border-radius: 999px;
    background: rgba(14, 165, 233, 0.08);
    font-size: 0.76rem;
}

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

.category-tile {
    position: relative;
    min-height: 190px;
    padding: 24px;
    overflow: hidden;
    border-radius: 24px;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.category-tile::before {
    content: "";
    position: absolute;
    inset: -50% auto auto -20%;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(56, 189, 248, 0.26), transparent 68%);
}

.category-tile h3 {
    position: relative;
    margin: 0 0 10px;
    font-size: 1.4rem;
}

.category-tile p,
.category-tile span {
    position: relative;
    color: var(--text-muted);
}

.category-tile span {
    display: inline-flex;
    margin-top: 20px;
    color: var(--cloud-realm-300);
    font-weight: 800;
}

.search-panel {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) auto;
    gap: 12px;
    margin-bottom: 30px;
    padding: 18px;
    border-radius: 22px;
}

.search-panel input,
.search-panel select {
    min-height: 46px;
    width: 100%;
    padding: 0 14px;
    color: var(--text-main);
    border: 1px solid var(--line);
    border-radius: 14px;
    outline: 0;
    background: var(--deep-space-800);
}

.search-panel button {
    min-height: 46px;
    padding: 0 22px;
    color: #fff;
    border: 0;
    border-radius: 14px;
    background: var(--cloud-realm-600);
    font-weight: 800;
}

.page-hero {
    padding: 72px 0 36px;
    background: radial-gradient(circle at 18% 0, rgba(56, 189, 248, 0.16), transparent 30rem), linear-gradient(135deg, rgba(23, 37, 84, 0.6), rgba(2, 6, 23, 0));
    border-bottom: 1px solid var(--line);
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
    color: var(--text-muted);
    font-size: 0.92rem;
}

.detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.65fr) minmax(300px, 0.75fr);
    gap: 28px;
}

.player-section {
    overflow: hidden;
    border-radius: 26px;
}

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

.player-shell video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background: #000;
}

.player-cover {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: grid;
    place-items: center;
    color: #fff;
    border: 0;
    background: linear-gradient(0deg, rgba(2, 6, 23, 0.74), rgba(2, 6, 23, 0.3));
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.player-cover.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.play-round {
    display: grid;
    place-items: center;
    width: 88px;
    height: 88px;
    border-radius: 999px;
    background: rgba(2, 132, 199, 0.94);
    box-shadow: 0 0 40px rgba(14, 165, 233, 0.45);
    font-size: 2rem;
}

.player-info,
.detail-card {
    padding: 22px;
}

.detail-title {
    margin-bottom: 24px;
}

.detail-card {
    margin-top: 22px;
    border-radius: 22px;
}

.detail-card h2,
.player-info h2 {
    margin: 0 0 12px;
    font-size: 1.35rem;
}

.detail-card p,
.player-info p {
    color: var(--text-soft);
}

.side-poster {
    overflow: hidden;
    border-radius: 24px;
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    aspect-ratio: 2 / 3;
}

.side-meta {
    margin-top: 16px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: rgba(15, 23, 42, 0.72);
}

.side-meta dl {
    display: grid;
    grid-template-columns: 72px 1fr;
    gap: 10px;
    margin: 0;
}

.side-meta dt {
    color: var(--text-muted);
}

.side-meta dd {
    margin: 0;
}

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

.search-results-note {
    margin: -8px 0 24px;
    color: var(--text-muted);
}

.empty-state {
    padding: 60px 20px;
    text-align: center;
    color: var(--text-muted);
    border: 1px solid var(--line);
    border-radius: 24px;
    background: rgba(15, 23, 42, 0.72);
}

.site-footer {
    border-top: 1px solid var(--line);
    background: var(--deep-space-950);
}

.footer-inner {
    display: grid;
    grid-template-columns: minmax(240px, 0.9fr) 1.6fr;
    gap: 36px;
    padding: 46px 0 24px;
}

.footer-inner p {
    max-width: 460px;
    color: var(--text-muted);
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    align-content: start;
    gap: 10px 18px;
}

.footer-links a {
    color: var(--text-soft);
}

.copyright {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 18px 0 28px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

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

    .nav-toggle {
        display: block;
    }

    body.nav-open .site-nav {
        position: absolute;
        top: 76px;
        left: 16px;
        right: 16px;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        padding: 14px;
        border: 1px solid var(--line);
        border-radius: 20px;
        background: rgba(15, 23, 42, 0.98);
        box-shadow: var(--shadow);
    }

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

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

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

    .side-poster {
        max-width: 360px;
    }
}

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

    .header-search {
        display: none;
    }

    body.nav-open .site-nav {
        top: 68px;
        grid-template-columns: 1fr;
    }

    .hero-carousel,
    .hero-content {
        min-height: 72vh;
    }

    .hero-copy {
        padding: 48px 0 72px;
    }

    .hero-copy p {
        font-size: 1rem;
    }

    .section-wrap {
        padding: 48px 0;
    }

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

    .movie-grid,
    .movie-grid.medium,
    .movie-grid.large,
    .movie-grid.rank-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px;
    }

    .category-grid,
    .related-grid,
    .footer-inner {
        grid-template-columns: 1fr;
    }

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

    .card-body {
        padding: 12px;
    }

    .movie-card p {
        font-size: 0.84rem;
    }
}

@media (max-width: 460px) {
    .movie-grid,
    .movie-grid.medium,
    .movie-grid.large,
    .movie-grid.rank-list {
        grid-template-columns: 1fr;
    }

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

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