:root {
    --bg: #0f172a;
    --bg-soft: #111827;
    --panel: rgba(30, 41, 59, 0.72);
    --panel-strong: rgba(15, 23, 42, 0.88);
    --line: rgba(148, 163, 184, 0.18);
    --text: #e2e8f0;
    --muted: #94a3b8;
    --cyan: #22d3ee;
    --cyan-soft: rgba(34, 211, 238, 0.14);
    --blue: #3b82f6;
    --shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
    --radius: 22px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(34, 211, 238, 0.18), transparent 32rem),
        radial-gradient(circle at 80% 8%, rgba(59, 130, 246, 0.2), transparent 30rem),
        linear-gradient(180deg, #0f172a 0%, #111827 44%, #0f172a 100%);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
    -webkit-font-smoothing: antialiased;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image: linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: linear-gradient(to bottom, black, transparent 70%);
    z-index: -1;
}

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: 50;
    border-bottom: 1px solid var(--line);
    background: rgba(15, 23, 42, 0.78);
    backdrop-filter: blur(18px);
}

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

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

.brand-mark {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    color: #06111f;
    background: linear-gradient(135deg, #67e8f9, #3b82f6);
    box-shadow: 0 10px 30px rgba(34, 211, 238, 0.28);
}

.brand-text,
.footer-brand {
    font-size: 20px;
    background: linear-gradient(135deg, #e0f7ff, #67e8f9 48%, #60a5fa);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.desktop-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
    overflow-x: auto;
    scrollbar-width: none;
}

.desktop-nav::-webkit-scrollbar {
    display: none;
}

.nav-link {
    padding: 9px 12px;
    color: #cbd5e1;
    border-radius: 12px;
    white-space: nowrap;
    transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
    color: var(--cyan);
    background: rgba(30, 41, 59, 0.78);
}

.header-search {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 280px;
}

.header-search input,
.inline-filter input {
    width: 100%;
    color: #fff;
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 14px;
    outline: none;
    background: rgba(15, 23, 42, 0.62);
    transition: border 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.header-search input {
    padding: 11px 13px;
}

.header-search input:focus,
.inline-filter input:focus {
    border-color: rgba(34, 211, 238, 0.82);
    box-shadow: 0 0 0 4px rgba(34, 211, 238, 0.12);
    background: rgba(15, 23, 42, 0.86);
}

.header-search button,
.primary-btn,
.ghost-btn,
.section-more {
    border: 0;
    color: #031827;
    border-radius: 14px;
    font-weight: 800;
    background: linear-gradient(135deg, #22d3ee, #3b82f6);
    box-shadow: 0 14px 34px rgba(34, 211, 238, 0.22);
    transition: transform 0.2s ease, filter 0.2s ease, box-shadow 0.2s ease;
}

.header-search button {
    padding: 11px 14px;
}

.primary-btn,
.ghost-btn,
.section-more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 18px;
}

.ghost-btn,
.section-more {
    color: #c7f9ff;
    border: 1px solid rgba(34, 211, 238, 0.24);
    background: rgba(34, 211, 238, 0.08);
    box-shadow: none;
}

.header-search button:hover,
.primary-btn:hover,
.ghost-btn:hover,
.section-more:hover {
    transform: translateY(-2px);
    filter: brightness(1.08);
}

.menu-toggle {
    display: none;
    width: 42px;
    height: 42px;
    border: 1px solid var(--line);
    border-radius: 12px;
    color: var(--text);
    background: rgba(30, 41, 59, 0.76);
}

.mobile-panel {
    display: none;
    width: min(1400px, calc(100% - 32px));
    margin: 0 auto 14px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.94);
}

.mobile-panel.open {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.mobile-panel a {
    padding: 12px;
    border-radius: 12px;
    color: #dbeafe;
    background: rgba(30, 41, 59, 0.66);
}

.hero-wrap {
    position: relative;
    min-height: 82vh;
    overflow: hidden;
    background: #020617;
}

.hero-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transform: scale(1.03);
    transition: opacity 0.7s ease, transform 1.1s ease;
    pointer-events: none;
}

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

.hero-bg {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: saturate(1.14) contrast(1.04);
}

.hero-mask {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(2, 6, 23, 0.95) 0%, rgba(2, 6, 23, 0.74) 38%, rgba(2, 6, 23, 0.24) 68%, rgba(2, 6, 23, 0.88) 100%),
        linear-gradient(0deg, #0f172a 0%, rgba(15, 23, 42, 0) 38%);
}

.hero-content {
    position: absolute;
    left: max(5vw, calc((100vw - 1400px) / 2));
    bottom: 13vh;
    width: min(720px, 88vw);
    display: grid;
    gap: 22px;
}

.eyebrow {
    margin: 0;
    color: var(--cyan);
    font-size: 13px;
    font-weight: 900;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.hero-content h1,
.page-hero h1 {
    margin: 0;
    color: #fff;
    font-size: clamp(42px, 7vw, 82px);
    line-height: 0.98;
    letter-spacing: -0.045em;
    text-shadow: 0 18px 60px rgba(0, 0, 0, 0.42);
}

.hero-desc {
    margin: 0;
    color: #dbeafe;
    font-size: clamp(16px, 2vw, 21px);
    line-height: 1.8;
}

.hero-meta,
.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.hero-meta span,
.detail-meta span,
.tag {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 5px 11px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 999px;
    color: #cbd5e1;
    background: rgba(15, 23, 42, 0.48);
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

.hero-tabs {
    position: absolute;
    right: max(5vw, calc((100vw - 1400px) / 2));
    bottom: 10vh;
    display: flex;
    gap: 10px;
}

.hero-tabs button {
    width: 42px;
    height: 6px;
    padding: 0;
    overflow: hidden;
    text-indent: -99px;
    border: 0;
    border-radius: 999px;
    background: rgba(226, 232, 240, 0.36);
}

.hero-tabs button.active {
    width: 70px;
    background: linear-gradient(90deg, #22d3ee, #3b82f6);
}

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

.content-section {
    padding: 46px 0;
}

.page-main {
    padding-top: 34px;
}

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

.section-heading h2,
.search-card h2,
.spotlight-card h2,
.detail-card h1,
.detail-card h2,
.side-card h2 {
    margin: 6px 0 0;
    color: #fff;
    letter-spacing: -0.025em;
}

.section-heading h2,
.search-card h2 {
    font-size: clamp(25px, 3vw, 38px);
}

.search-card,
.page-hero,
.detail-card,
.side-card,
.spotlight-card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.82), rgba(15, 23, 42, 0.72));
    box-shadow: var(--shadow);
}

.search-card {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 22px;
    align-items: center;
    padding: 28px;
}

.search-card p,
.page-hero p,
.spotlight-card p,
.detail-card p,
.side-card p {
    color: var(--muted);
    line-height: 1.75;
}

.inline-filter input {
    padding: 15px 16px;
}

.rail-scroll {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    padding: 4px 4px 20px;
    scroll-snap-type: x proximity;
}

.rail-scroll .movie-card {
    width: min(360px, 82vw);
    flex: 0 0 auto;
    scroll-snap-align: start;
}

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

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

.movie-card {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: rgba(30, 41, 59, 0.56);
    transition: transform 0.24s ease, border 0.24s ease, box-shadow 0.24s ease;
}

.movie-card:hover {
    transform: translateY(-6px);
    border-color: rgba(34, 211, 238, 0.38);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.32);
}

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

.poster-link img,
.compact-card img,
.category-card img,
.spotlight-card img,
.side-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.poster-link img,
.compact-card img,
.category-card img {
    transition: transform 0.45s ease;
}

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

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

.play-dot,
.player-button {
    position: absolute;
    display: grid;
    place-items: center;
    border-radius: 999px;
    color: #062030;
    background: linear-gradient(135deg, #67e8f9, #3b82f6);
    box-shadow: 0 16px 40px rgba(34, 211, 238, 0.28);
}

.play-dot {
    right: 14px;
    bottom: 14px;
    width: 42px;
    height: 42px;
}

.rank-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    min-width: 38px;
    padding: 6px 9px;
    border-radius: 999px;
    color: #08111f;
    font-weight: 900;
    text-align: center;
    background: linear-gradient(135deg, #fde68a, #22d3ee);
}

.card-body {
    padding: 16px;
}

.card-title {
    display: block;
    color: #fff;
    font-size: 18px;
    font-weight: 850;
    line-height: 1.35;
}

.card-title:hover {
    color: var(--cyan);
}

.card-meta,
.card-text {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 14px;
}

.card-text {
    min-height: 47px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.65;
}

.tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.tag {
    min-height: 26px;
    font-size: 12px;
    color: #a5f3fc;
    background: rgba(34, 211, 238, 0.08);
}

.ranking-split {
    display: grid;
    grid-template-columns: 1fr 420px;
    gap: 24px;
    align-items: start;
}

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

.rank-row {
    display: grid;
    grid-template-columns: 52px 1fr auto;
    gap: 14px;
    align-items: center;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(30, 41, 59, 0.54);
    transition: border 0.2s ease, background 0.2s ease;
}

.rank-row:hover {
    border-color: rgba(34, 211, 238, 0.36);
    background: rgba(30, 41, 59, 0.86);
}

.rank-row span {
    color: var(--cyan);
    font-weight: 900;
}

.rank-row strong {
    color: #fff;
}

.rank-row em {
    color: var(--muted);
    font-style: normal;
    font-size: 13px;
}

.spotlight-card {
    overflow: hidden;
}

.spotlight-card img {
    height: 260px;
}

.spotlight-card div {
    padding: 24px;
}

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

.category-card {
    position: relative;
    min-height: 240px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: rgba(15, 23, 42, 0.7);
}

.category-card img,
.category-overlay,
.category-content {
    position: absolute;
    inset: 0;
}

.category-overlay {
    background: linear-gradient(180deg, transparent 0%, rgba(2, 6, 23, 0.92) 100%);
}

.category-content {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 22px;
}

.category-content strong {
    color: #fff;
    font-size: 25px;
}

.category-content em {
    margin-top: 8px;
    color: #cbd5e1;
    font-style: normal;
    line-height: 1.65;
}

.page-hero {
    margin: 24px 0 32px;
    padding: clamp(30px, 6vw, 72px);
    background:
        radial-gradient(circle at top right, rgba(34, 211, 238, 0.16), transparent 34rem),
        linear-gradient(135deg, rgba(30, 41, 59, 0.88), rgba(15, 23, 42, 0.78));
}

.page-hero h1 {
    margin-top: 10px;
    font-size: clamp(36px, 5vw, 60px);
}

.page-filter {
    width: min(680px, 100%);
    margin-top: 28px;
}

.wide {
    width: min(900px, 100%);
}

.detail-main {
    padding-bottom: 52px;
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    align-items: center;
    margin: 18px 0;
    color: var(--muted);
    font-size: 14px;
}

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

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

.detail-primary {
    display: grid;
    gap: 22px;
}

.player-shell {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border: 1px solid rgba(34, 211, 238, 0.2);
    border-radius: 24px;
    background: #020617;
    box-shadow: var(--shadow);
}

.player-shell video,
.player-cover {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.player-shell video {
    object-fit: contain;
    background: #020617;
}

.player-cover {
    z-index: 2;
    padding: 0;
    overflow: hidden;
    border: 0;
    background: #020617;
}

.player-cover.hidden {
    display: none;
}

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

.player-cover-mask {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, rgba(34, 211, 238, 0.16), transparent 16rem), rgba(2, 6, 23, 0.55);
}

.player-button {
    top: 50%;
    left: 50%;
    width: 76px;
    height: 76px;
    transform: translate(-50%, -50%);
    font-size: 30px;
}

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

.detail-title-row {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 18px;
}

.detail-card h1 {
    font-size: clamp(30px, 4vw, 46px);
}

.detail-card h2 {
    margin-top: 28px;
    font-size: 24px;
}

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

.detail-tags {
    margin: 18px 0;
}

.detail-side {
    display: grid;
    gap: 20px;
    position: sticky;
    top: 96px;
}

.side-card {
    overflow: hidden;
    padding: 20px;
}

.poster-panel img {
    height: 240px;
    border-radius: 18px;
}

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

.compact-card {
    display: grid;
    grid-template-columns: 116px 1fr;
    gap: 12px;
    align-items: center;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(15, 23, 42, 0.4);
}

.compact-card img {
    height: 74px;
    border-radius: 12px;
}

.compact-card strong,
.compact-card em {
    display: block;
}

.compact-card strong {
    color: #fff;
    line-height: 1.35;
}

.compact-card em {
    margin-top: 6px;
    color: var(--muted);
    font-size: 13px;
    font-style: normal;
}

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

.footer-grid {
    width: min(1400px, calc(100% - 32px));
    margin: 0 auto;
    padding: 40px 0;
    display: grid;
    grid-template-columns: 1.2fr 1fr 1fr;
    gap: 28px;
}

.footer-grid p,
.footer-links a,
.footer-bottom {
    color: var(--muted);
}

.footer-grid h2 {
    margin: 0 0 14px;
    color: #fff;
    font-size: 16px;
}

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

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

.footer-bottom {
    width: min(1400px, calc(100% - 32px));
    margin: 0 auto;
    padding: 18px 0 28px;
    border-top: 1px solid rgba(148, 163, 184, 0.1);
    font-size: 14px;
}

.is-hidden {
    display: none !important;
}

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

    .menu-toggle {
        display: inline-grid;
        place-items: center;
        margin-left: auto;
    }

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

    .ranking-split,
    .detail-grid {
        grid-template-columns: 1fr;
    }

    .detail-side {
        position: static;
    }
}

@media (max-width: 780px) {
    .header-inner {
        height: 66px;
    }

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

    .hero-wrap {
        min-height: 78vh;
    }

    .hero-content {
        bottom: 10vh;
        gap: 16px;
    }

    .hero-tabs {
        left: 16px;
        right: auto;
        bottom: 28px;
    }

    .search-card,
    .footer-grid,
    .detail-title-row {
        grid-template-columns: 1fr;
    }

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

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

    .rank-row em {
        grid-column: 2;
    }

    .compact-card {
        grid-template-columns: 96px 1fr;
    }
}

@media (max-width: 520px) {
    .content-section,
    .page-main,
    .header-inner,
    .mobile-panel,
    .footer-grid,
    .footer-bottom {
        width: min(100% - 22px, 1400px);
    }

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

    .hero-content h1,
    .page-hero h1 {
        font-size: 36px;
    }

    .hero-actions {
        display: grid;
    }

    .page-hero,
    .detail-card,
    .side-card,
    .search-card {
        border-radius: 18px;
        padding: 20px;
    }
}
