:root {
    color-scheme: dark;
    --bg: #0a0e1a;
    --panel: #0f1420;
    --panel-soft: rgba(255, 255, 255, 0.05);
    --line: rgba(255, 255, 255, 0.1);
    --text: #ffffff;
    --muted: #9ca3af;
    --soft: #d1d5db;
    --cyan: #22d3ee;
    --cyan-dark: #06b6d4;
    --shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
    background: radial-gradient(circle at top left, rgba(6, 182, 212, 0.16), transparent 32rem), var(--bg);
    color: var(--text);
    line-height: 1.6;
}

body.searching {
    overflow: hidden;
}

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

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

button,
input {
    font: inherit;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 40;
    border-bottom: 1px solid var(--line);
    background: rgba(10, 14, 26, 0.82);
    backdrop-filter: blur(16px);
}

.header-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0.9rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.brand-mark {
    width: 2.25rem;
    height: 2.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--cyan), #2563eb);
    color: #001018;
    box-shadow: 0 12px 30px rgba(34, 211, 238, 0.3);
}

.desktop-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.desktop-nav a,
.mobile-panel a,
.footer-links a {
    color: var(--soft);
    padding: 0.5rem 0.7rem;
    border-radius: 999px;
    transition: color 0.2s ease, background 0.2s ease;
}

.desktop-nav a:hover,
.mobile-panel a:hover,
.footer-links a:hover {
    color: var(--cyan);
    background: rgba(255, 255, 255, 0.06);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.search-open,
.menu-toggle,
.search-close {
    color: var(--text);
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.06);
    border-radius: 999px;
    padding: 0.5rem 0.85rem;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.search-open:hover,
.menu-toggle:hover,
.search-close:hover {
    border-color: rgba(34, 211, 238, 0.5);
    background: rgba(6, 182, 212, 0.2);
}

.menu-toggle {
    display: none;
}

.mobile-panel {
    display: none;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1rem 1rem;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.mobile-panel.is-open {
    display: flex;
}

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

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

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

.hero-image {
    height: 100%;
    object-fit: cover;
    transform: scale(1.02);
    filter: saturate(1.04) contrast(1.02);
}

.hero-shade {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, #0a0e1a 8%, rgba(10, 14, 26, 0.66) 48%, rgba(10, 14, 26, 0.16)), linear-gradient(to right, rgba(10, 14, 26, 0.86), rgba(10, 14, 26, 0.18));
}

.hero-content {
    position: absolute;
    left: max(1.2rem, calc((100vw - 1280px) / 2 + 1rem));
    bottom: 7.8rem;
    width: min(720px, calc(100% - 2rem));
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    color: var(--cyan);
    font-size: 0.88rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 0.7rem;
}

.hero h1,
.page-hero h1,
.detail-info h1 {
    margin: 0;
    font-size: clamp(2.3rem, 7vw, 5rem);
    line-height: 1.02;
    letter-spacing: -0.05em;
}

.hero p {
    margin: 1rem 0 0;
    max-width: 42rem;
    color: var(--soft);
    font-size: clamp(1rem, 1.6vw, 1.25rem);
}

.hero-tags,
.tag-row {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.hero-tags span,
.tag-row span {
    color: #dffaff;
    border: 1px solid rgba(34, 211, 238, 0.28);
    background: rgba(6, 182, 212, 0.12);
    border-radius: 999px;
    padding: 0.25rem 0.65rem;
    font-size: 0.82rem;
}

.hero-buttons,
.detail-actions {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    flex-wrap: wrap;
    margin-top: 1.4rem;
}

.btn-primary,
.btn-ghost,
.text-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    font-weight: 700;
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.btn-primary {
    color: #001018;
    background: linear-gradient(135deg, var(--cyan), var(--cyan-dark));
    padding: 0.8rem 1.2rem;
    box-shadow: 0 18px 42px rgba(34, 211, 238, 0.24);
}

.btn-ghost {
    color: var(--text);
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.08);
    padding: 0.78rem 1.15rem;
}

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

.hero-dots {
    position: absolute;
    right: max(1.2rem, calc((100vw - 1280px) / 2 + 1rem));
    bottom: 8rem;
    display: flex;
    gap: 0.55rem;
}

.hero-dot {
    width: 0.62rem;
    height: 0.62rem;
    border-radius: 999px;
    border: 0;
    background: rgba(255, 255, 255, 0.36);
    cursor: pointer;
    transition: width 0.25s ease, background 0.25s ease;
}

.hero-dot.is-active {
    width: 2rem;
    background: var(--cyan);
}

.hero-category-bar {
    position: absolute;
    left: 50%;
    bottom: 1.5rem;
    transform: translateX(-50%);
    width: min(1280px, calc(100% - 2rem));
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
    padding: 0.9rem;
    border: 1px solid var(--line);
    border-radius: 1rem;
    background: rgba(15, 20, 32, 0.76);
    backdrop-filter: blur(14px);
}

.hero-category-bar a,
.hero-category-bar strong {
    border-radius: 999px;
    padding: 0.35rem 0.7rem;
}

.hero-category-bar a {
    color: var(--soft);
    background: rgba(255, 255, 255, 0.05);
}

.hero-category-bar a:hover {
    color: var(--cyan);
}

.page-wrap,
.content-section {
    width: min(1280px, calc(100% - 2rem));
    margin: 0 auto;
}

.content-section {
    padding: 3.5rem 0 0;
}

.section-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.3rem;
}

.section-heading h2 {
    margin: 0;
    font-size: clamp(1.45rem, 3vw, 2rem);
    letter-spacing: -0.02em;
}

.section-heading a,
.text-link {
    color: var(--cyan);
}

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

.movie-card {
    border: 1px solid var(--line);
    border-radius: 1rem;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.045);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.18);
    transition: transform 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}

.movie-card:hover {
    transform: translateY(-5px);
    border-color: rgba(34, 211, 238, 0.42);
    background: rgba(255, 255, 255, 0.07);
}

.poster {
    position: relative;
    display: block;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: #111827;
}

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

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

.play-badge {
    position: absolute;
    right: 0.75rem;
    bottom: 0.75rem;
    width: 2.25rem;
    height: 2.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.62);
    color: var(--cyan);
    backdrop-filter: blur(8px);
}

.movie-card-body {
    padding: 1rem;
}

.meta-line {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-wrap: wrap;
    color: var(--muted);
    font-size: 0.82rem;
}

.meta-line span + span::before {
    content: "·";
    margin-right: 0.45rem;
    color: rgba(255, 255, 255, 0.28);
}

.movie-card h3,
.rank-row h3 {
    margin: 0.45rem 0;
    font-size: 1.05rem;
    line-height: 1.35;
}

.movie-card h3 a:hover,
.rank-row h3 a:hover {
    color: var(--cyan);
}

.movie-card p,
.rank-row p,
.page-hero p,
.site-footer p,
.detail-content p {
    margin: 0;
    color: var(--soft);
}

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

.category-card {
    min-height: 10rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border: 1px solid var(--line);
    border-radius: 1rem;
    padding: 1rem;
    background: linear-gradient(145deg, rgba(6, 182, 212, 0.14), rgba(255, 255, 255, 0.045));
    transition: transform 0.25s ease, border-color 0.25s ease;
}

.category-card:hover {
    transform: translateY(-4px);
    border-color: rgba(34, 211, 238, 0.48);
}

.category-card span {
    color: var(--cyan);
    font-weight: 800;
}

.category-card p {
    color: var(--soft);
    margin: 0.6rem 0;
}

.category-card strong {
    color: #fff;
}

.page-hero {
    margin-top: 2rem;
    border: 1px solid var(--line);
    border-radius: 1.5rem;
    padding: clamp(1.5rem, 5vw, 3rem);
    background: radial-gradient(circle at top right, rgba(34, 211, 238, 0.18), transparent 26rem), rgba(255, 255, 255, 0.045);
    box-shadow: var(--shadow);
}

.small-hero {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1rem;
}

.small-hero h1 {
    font-size: clamp(2.1rem, 6vw, 4rem);
}

.small-hero p {
    max-width: 52rem;
    margin-top: 0.8rem;
}

.rank-list {
    display: grid;
    gap: 0.8rem;
    padding: 2rem 0 4rem;
}

.rank-row {
    display: grid;
    grid-template-columns: 3rem 7.5rem 1fr auto;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    border: 1px solid var(--line);
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.045);
}

.rank-number {
    color: var(--cyan);
    font-size: 1.35rem;
    font-weight: 900;
    text-align: center;
}

.rank-poster {
    aspect-ratio: 16 / 10;
    border-radius: 0.75rem;
    overflow: hidden;
    background: #111827;
}

.rank-poster img {
    height: 100%;
    object-fit: cover;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-wrap: wrap;
    color: var(--muted);
    padding: 1.5rem 0 1rem;
}

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

.detail-hero {
    display: grid;
    grid-template-columns: minmax(240px, 420px) 1fr;
    gap: 2rem;
    align-items: end;
    border: 1px solid var(--line);
    border-radius: 1.5rem;
    padding: clamp(1rem, 3vw, 2rem);
    background: radial-gradient(circle at top left, rgba(34, 211, 238, 0.18), transparent 28rem), rgba(255, 255, 255, 0.045);
    box-shadow: var(--shadow);
}

.detail-poster {
    aspect-ratio: 16 / 10;
    border-radius: 1rem;
    overflow: hidden;
    background: #111827;
}

.detail-poster img {
    height: 100%;
    object-fit: cover;
}

.detail-info h1 {
    font-size: clamp(2rem, 5vw, 4.5rem);
}

.lead {
    color: var(--soft);
    font-size: 1.08rem;
    max-width: 58rem;
}

.tag-row.large span {
    font-size: 0.9rem;
}

.player-section {
    padding-top: 2rem;
}

.player-shell {
    position: relative;
    border: 1px solid rgba(34, 211, 238, 0.28);
    border-radius: 1.25rem;
    overflow: hidden;
    background: #000;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
}

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

.player-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    border: 0;
    color: #fff;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.74), rgba(0, 0, 0, 0.2));
    cursor: pointer;
}

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

.player-overlay span {
    width: 5rem;
    height: 5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    color: #001018;
    background: var(--cyan);
    font-size: 1.8rem;
    box-shadow: 0 18px 50px rgba(34, 211, 238, 0.36);
}

.player-overlay strong {
    font-size: 1.1rem;
}

.detail-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 2rem;
}

.detail-content article {
    border: 1px solid var(--line);
    border-radius: 1rem;
    padding: 1.25rem;
    background: rgba(255, 255, 255, 0.045);
}

.detail-content h2 {
    margin: 0 0 0.7rem;
    color: var(--cyan);
}

.detail-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1.25rem;
}

.detail-nav a {
    color: var(--soft);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 0.55rem 0.85rem;
    background: rgba(255, 255, 255, 0.04);
}

.detail-nav a:hover {
    color: var(--cyan);
    border-color: rgba(34, 211, 238, 0.45);
}

.site-footer {
    margin-top: 4rem;
    border-top: 1px solid var(--line);
    background: rgba(0, 0, 0, 0.18);
}

.footer-inner {
    width: min(1280px, calc(100% - 2rem));
    margin: 0 auto;
    padding: 2rem 0;
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 1.5rem;
}

.footer-links {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.search-layer {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding: 8vh 1rem 1rem;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(12px);
}

.search-layer.is-open {
    display: flex;
}

.search-card {
    position: relative;
    width: min(760px, 100%);
    max-height: 82vh;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 1.25rem;
    padding: 1.25rem;
    background: #0f1420;
    box-shadow: var(--shadow);
}

.search-card h2 {
    margin: 0 0 1rem;
}

.search-close {
    position: absolute;
    right: 1rem;
    top: 1rem;
}

.search-card input {
    width: 100%;
    border: 1px solid rgba(34, 211, 238, 0.34);
    border-radius: 999px;
    padding: 0.8rem 1rem;
    color: var(--text);
    outline: none;
    background: rgba(255, 255, 255, 0.06);
}

.search-results {
    display: grid;
    gap: 0.7rem;
    max-height: 58vh;
    overflow: auto;
    margin-top: 1rem;
    padding-right: 0.2rem;
}

.search-result {
    display: grid;
    grid-template-columns: 5rem 1fr;
    gap: 0.8rem;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 0.9rem;
    padding: 0.55rem;
    background: rgba(255, 255, 255, 0.04);
}

.search-result:hover {
    border-color: rgba(34, 211, 238, 0.42);
}

.search-result img {
    height: 3.3rem;
    object-fit: cover;
    border-radius: 0.6rem;
}

.search-result h3 {
    margin: 0;
    font-size: 1rem;
}

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

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

    .menu-toggle {
        display: inline-flex;
    }

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

    .detail-hero,
    .detail-content,
    .footer-inner {
        grid-template-columns: 1fr;
    }

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

@media (max-width: 720px) {
    .hero {
        min-height: 660px;
    }

    .hero-content {
        bottom: 10rem;
    }

    .hero-dots {
        left: 1rem;
        right: auto;
        bottom: 6.8rem;
    }

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

    .small-hero,
    .section-heading,
    .detail-nav {
        align-items: flex-start;
        flex-direction: column;
    }

    .rank-row {
        grid-template-columns: 2.4rem 5rem 1fr;
    }

    .rank-row .text-link {
        grid-column: 2 / 4;
        justify-content: flex-start;
    }
}

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

    .hero-category-bar {
        display: none;
    }

    .hero-content {
        bottom: 5.5rem;
    }

    .hero-dots {
        bottom: 2rem;
    }
}
