:root {
    --bg: #020617;
    --panel: rgba(15, 23, 42, 0.78);
    --panel-strong: rgba(15, 23, 42, 0.94);
    --line: rgba(148, 163, 184, 0.22);
    --text: #f8fafc;
    --muted: #94a3b8;
    --blue: #2563eb;
    --cyan: #22d3ee;
    --gold: #f59e0b;
    --radius: 24px;
    --shadow: 0 24px 80px rgba(2, 6, 23, 0.46);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(37, 99, 235, 0.30), transparent 36rem),
        radial-gradient(circle at top right, rgba(34, 211, 238, 0.18), transparent 32rem),
        linear-gradient(180deg, #020617 0%, #0f172a 52%, #020617 100%);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    line-height: 1.6;
}

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

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

button,
input {
    font: inherit;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 80;
    border-bottom: 1px solid var(--line);
    background: rgba(2, 6, 23, 0.74);
    backdrop-filter: blur(18px);
}

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

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
}

.brand-mark {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    color: #fff;
    font-weight: 900;
    background: linear-gradient(135deg, var(--blue), var(--cyan));
    box-shadow: 0 12px 28px rgba(34, 211, 238, 0.24);
}

.brand-text,
.footer-brand {
    font-size: 20px;
    font-weight: 900;
    letter-spacing: -0.04em;
    background: linear-gradient(90deg, #60a5fa, #22d3ee);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
}

.nav-link {
    padding: 9px 14px;
    border-radius: 999px;
    color: #cbd5e1;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
    color: #fff;
    background: rgba(34, 211, 238, 0.12);
    transform: translateY(-1px);
}

.header-search {
    width: 280px;
    display: flex;
    align-items: center;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.72);
}

.header-search input,
.search-panel input {
    min-width: 0;
    flex: 1;
    border: 0;
    outline: 0;
    color: #fff;
    background: transparent;
}

.header-search input {
    padding: 10px 12px 10px 16px;
}

.header-search button,
.search-panel button {
    border: 0;
    padding: 10px 16px;
    color: #fff;
    cursor: pointer;
    background: linear-gradient(90deg, var(--blue), var(--cyan));
}

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

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

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

.hero-slide img,
.detail-backdrop img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.58;
}

.hero-slide::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 72% 28%, rgba(34, 211, 238, 0.26), transparent 22rem),
        linear-gradient(90deg, rgba(2, 6, 23, 0.96), rgba(2, 6, 23, 0.66) 44%, rgba(2, 6, 23, 0.18));
    z-index: 1;
}

.hero-overlay {
    position: absolute;
    inset: auto 0 0;
    height: 45%;
    background: linear-gradient(0deg, var(--bg), transparent);
    z-index: 2;
}

.hero-content {
    position: relative;
    z-index: 5;
    width: min(1240px, calc(100% - 32px));
    height: 100%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    max-width: 720px;
    margin-left: max(16px, calc((100% - 1240px) / 2));
}

.eyebrow,
.section-kicker {
    display: inline-flex;
    align-items: center;
    width: max-content;
    margin-bottom: 14px;
    padding: 7px 14px;
    border: 1px solid rgba(34, 211, 238, 0.28);
    border-radius: 999px;
    color: #bae6fd;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.08em;
    background: rgba(8, 47, 73, 0.42);
}

.hero h1,
.page-hero h1,
.detail-intro h1 {
    margin: 0;
    font-size: clamp(40px, 8vw, 88px);
    line-height: 0.96;
    letter-spacing: -0.08em;
}

.hero p,
.page-hero p,
.detail-intro p {
    max-width: 680px;
    margin: 22px 0 0;
    color: #cbd5e1;
    font-size: clamp(16px, 2vw, 20px);
}

.hero-tags,
.tag-row,
.detail-meta,
.movie-card-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.hero-tags,
.detail-tags {
    margin-top: 20px;
}

.hero-tags span,
.tag-row span,
.detail-meta span,
.movie-card-meta span {
    padding: 5px 10px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 999px;
    color: #dbeafe;
    font-size: 12px;
    background: rgba(15, 23, 42, 0.62);
}

.hero-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 28px;
}

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

.primary-btn {
    color: #fff;
    background: linear-gradient(90deg, var(--blue), var(--cyan));
    box-shadow: 0 16px 36px rgba(37, 99, 235, 0.28);
}

.ghost-btn {
    border: 1px solid var(--line);
    color: #e2e8f0;
    background: rgba(15, 23, 42, 0.62);
}

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

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

.hero-arrow,
.hero-dot {
    border: 1px solid var(--line);
    color: #fff;
    cursor: pointer;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(10px);
}

.hero-arrow {
    width: 42px;
    height: 42px;
    border-radius: 999px;
    font-size: 28px;
}

.hero-dots {
    display: flex;
    gap: 8px;
}

.hero-dot {
    width: 12px;
    height: 12px;
    padding: 0;
    border-radius: 999px;
}

.hero-dot.active {
    width: 32px;
    background: linear-gradient(90deg, var(--blue), var(--cyan));
}

.hero-category-strip {
    position: absolute;
    left: 50%;
    bottom: 24px;
    z-index: 15;
    width: min(1240px, calc(100% - 32px));
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(2, 6, 23, 0.60);
    backdrop-filter: blur(16px);
    transform: translateX(-50%);
}

.hero-category-strip a {
    white-space: nowrap;
    padding: 8px 14px;
    border-radius: 999px;
    color: #dbeafe;
    background: rgba(37, 99, 235, 0.18);
}

.content-section {
    width: min(1240px, calc(100% - 32px));
    margin: 0 auto;
    padding: 56px 0;
}

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

.section-head h2 {
    margin: 0;
    font-size: clamp(28px, 4vw, 44px);
    line-height: 1;
    letter-spacing: -0.06em;
}

.section-more {
    color: #67e8f9;
    font-weight: 800;
}

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

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

.movie-card,
.category-card,
.rank-row,
.detail-copy,
.detail-side,
.player-shell {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.movie-card {
    transition: transform 0.24s ease, border-color 0.24s ease, background 0.24s ease;
}

.movie-card:hover {
    transform: translateY(-6px);
    border-color: rgba(34, 211, 238, 0.44);
    background: var(--panel-strong);
}

.poster-link {
    position: relative;
    display: block;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background:
        radial-gradient(circle at top right, rgba(34, 211, 238, 0.32), transparent 12rem),
        linear-gradient(135deg, #1e293b, #020617);
}

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

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

.poster-shade {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 42%, rgba(2, 6, 23, 0.86));
}

.play-dot,
.rank-badge {
    position: absolute;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    color: #fff;
    font-weight: 900;
}

.play-dot {
    right: 12px;
    bottom: 12px;
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, var(--blue), var(--cyan));
}

.rank-badge {
    left: 12px;
    top: 12px;
    padding: 6px 10px;
    font-size: 12px;
    background: linear-gradient(135deg, #f97316, var(--gold));
}

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

.movie-card-meta {
    margin-bottom: 10px;
}

.movie-card h3 {
    margin: 0;
    font-size: 19px;
    line-height: 1.25;
}

.movie-card p {
    display: -webkit-box;
    min-height: 46px;
    margin: 10px 0 12px;
    overflow: hidden;
    color: var(--muted);
    font-size: 14px;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.card-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 14px;
    color: #67e8f9;
    font-size: 13px;
}

.card-bottom strong,
.heat-value {
    color: #fbbf24;
}

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

.category-card {
    position: relative;
    min-height: 190px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: end;
    isolation: isolate;
    transition: transform 0.24s ease, border-color 0.24s ease;
}

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

.category-card img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -2;
    opacity: 0.36;
}

.category-card::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(180deg, rgba(2, 6, 23, 0.14), rgba(2, 6, 23, 0.92));
}

.category-card span {
    font-size: 22px;
    font-weight: 900;
}

.category-card p {
    margin: 8px 0 0;
    color: #cbd5e1;
    font-size: 14px;
}

.page-hero,
.detail-hero {
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(circle at 24% 20%, rgba(37, 99, 235, 0.34), transparent 30rem),
        linear-gradient(135deg, #020617, #111827);
}

.small-hero {
    min-height: 360px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 96px 16px 64px;
    text-align: center;
}

.search-panel {
    width: min(720px, 100%);
    margin: 28px auto 0;
    display: flex;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.78);
}

.search-panel input {
    padding: 16px 20px;
}

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

.filter-bar button {
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 9px 15px;
    color: #dbeafe;
    cursor: pointer;
    background: rgba(15, 23, 42, 0.76);
}

.filter-bar button.active,
.filter-bar button:hover {
    border-color: rgba(34, 211, 238, 0.44);
    background: rgba(37, 99, 235, 0.30);
}

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

.rank-row {
    display: grid;
    grid-template-columns: 128px 1fr auto;
    gap: 18px;
    align-items: center;
    padding: 12px;
}

.rank-cover {
    position: relative;
    display: block;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    border-radius: 18px;
    background: linear-gradient(135deg, #1e293b, #020617);
}

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

.rank-cover span {
    position: absolute;
    left: 8px;
    top: 8px;
    min-width: 34px;
    height: 28px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    color: #fff;
    font-size: 12px;
    font-weight: 900;
    background: linear-gradient(135deg, #f97316, var(--gold));
}

.rank-info h2 {
    margin: 0 0 8px;
    font-size: 22px;
}

.rank-info p {
    margin: 0 0 10px;
    color: var(--muted);
}

.heat-value {
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(251, 191, 36, 0.12);
}

.detail-hero {
    min-height: 620px;
    display: flex;
    align-items: end;
    padding: 110px 0 64px;
}

.detail-backdrop {
    position: absolute;
    inset: 0;
    opacity: 0.48;
}

.detail-backdrop::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(2, 6, 23, 0.98), rgba(2, 6, 23, 0.72), rgba(2, 6, 23, 0.34)),
        linear-gradient(0deg, var(--bg), transparent 46%);
}

.detail-hero-inner {
    position: relative;
    z-index: 3;
    width: min(1240px, calc(100% - 32px));
    margin: 0 auto;
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 34px;
    align-items: end;
}

.detail-poster {
    overflow: hidden;
    aspect-ratio: 3 / 4;
    border: 1px solid var(--line);
    border-radius: 28px;
    background: linear-gradient(135deg, #1e293b, #020617);
    box-shadow: var(--shadow);
}

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

.breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
    color: #bae6fd;
    font-size: 14px;
}

.detail-meta {
    margin-top: 22px;
}

.detail-section {
    padding-top: 0;
}

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

.player-shell video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
}

.player-start {
    position: absolute;
    left: 50%;
    top: 50%;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    border: 0;
    border-radius: 999px;
    padding: 14px 22px;
    color: #fff;
    cursor: pointer;
    background: linear-gradient(90deg, var(--blue), var(--cyan));
    box-shadow: 0 18px 48px rgba(34, 211, 238, 0.28);
    transform: translate(-50%, -50%);
}

.player-start span {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
}

.player-shell.is-playing .player-start {
    opacity: 0;
    pointer-events: none;
}

.player-status {
    position: absolute;
    left: 18px;
    bottom: 18px;
    color: #bae6fd;
    font-size: 13px;
}

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

.detail-copy,
.detail-side {
    padding: 26px;
}

.detail-copy h2,
.detail-side h2 {
    margin: 0 0 12px;
    font-size: 24px;
}

.detail-copy p {
    margin: 0 0 24px;
    color: #cbd5e1;
}

.detail-side dl {
    margin: 0;
}

.detail-side div {
    display: grid;
    grid-template-columns: 70px 1fr;
    gap: 12px;
    padding: 11px 0;
    border-bottom: 1px solid var(--line);
}

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

.detail-side dd {
    margin: 0;
    color: #e2e8f0;
}

.compact-card .movie-card-body p {
    min-height: auto;
}

.site-footer {
    margin-top: 40px;
    border-top: 1px solid var(--line);
    background: rgba(2, 6, 23, 0.72);
}

.footer-inner {
    width: min(1240px, calc(100% - 32px));
    margin: 0 auto;
    padding: 36px 0;
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 24px;
}

.footer-inner p {
    margin: 10px 0 0;
    color: var(--muted);
}

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

.footer-links a {
    padding: 7px 12px;
    border-radius: 999px;
    color: #cbd5e1;
    background: rgba(15, 23, 42, 0.72);
}

.movie-card.hidden-by-search,
.rank-row.hidden-by-search {
    display: none;
}

@media (max-width: 1040px) {
    .header-inner {
        flex-wrap: wrap;
        padding: 14px 0;
    }

    .main-nav {
        order: 3;
        width: 100%;
        overflow-x: auto;
    }

    .header-search {
        width: min(420px, 100%);
    }

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

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

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

    .detail-poster {
        width: min(280px, 68vw);
    }
}

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

    .hero-content {
        margin-left: auto;
        padding-top: 28px;
    }

    .hero-controls {
        bottom: 110px;
    }

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

    .rank-row {
        grid-template-columns: 92px 1fr;
    }

    .heat-value {
        grid-column: 2;
        width: max-content;
    }

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

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

    .search-panel,
    .header-search {
        border-radius: 18px;
    }

    .detail-hero {
        min-height: auto;
        padding-top: 140px;
    }
}
