:root {
    color-scheme: dark;
    --bg: #020617;
    --bg-soft: #0f172a;
    --panel: rgba(15, 23, 42, 0.72);
    --panel-solid: #0f172a;
    --panel-strong: #111827;
    --line: rgba(148, 163, 184, 0.18);
    --line-strong: rgba(56, 189, 248, 0.28);
    --text: #f8fafc;
    --muted: #94a3b8;
    --muted-soft: #64748b;
    --sky: #38bdf8;
    --sky-deep: #0284c7;
    --blue: #2563eb;
    --amber: #fbbf24;
    --rose: #fb7185;
    --green: #34d399;
    --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
    --radius: 20px;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--bg);
    scroll-behavior: smooth;
}

body {
    min-height: 100%;
    margin: 0;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(14, 165, 233, 0.22), transparent 34rem),
        radial-gradient(circle at 86% 18%, rgba(37, 99, 235, 0.18), transparent 30rem),
        linear-gradient(180deg, #020617 0%, #0f172a 48%, #020617 100%);
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    line-height: 1.6;
}

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

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

button,
input,
select {
    font: inherit;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.98), rgba(15, 23, 42, 0.9));
    backdrop-filter: blur(18px);
}

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

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-width: max-content;
}

.brand-mark {
    width: 38px;
    height: 38px;
    display: inline-grid;
    place-items: center;
    color: white;
    background: linear-gradient(135deg, var(--sky), var(--blue));
    border-radius: 14px;
    box-shadow: 0 12px 32px rgba(56, 189, 248, 0.28);
}

.brand-copy {
    display: grid;
    line-height: 1.1;
}

.brand-title {
    font-size: 21px;
    font-weight: 800;
    letter-spacing: 0.02em;
    background: linear-gradient(90deg, #7dd3fc, #2563eb);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.brand-subtitle {
    margin-top: 4px;
    color: var(--muted);
    font-size: 12px;
}

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

.desktop-nav a,
.mobile-panel a {
    color: #cbd5e1;
    padding: 9px 12px;
    border-radius: 12px;
    font-size: 14px;
    transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.desktop-nav a:hover,
.mobile-panel a:hover {
    color: white;
    background: rgba(30, 41, 59, 0.9);
}

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

.header-search input,
.mobile-search input,
.search-page-form input,
.search-page-form select {
    width: 100%;
    color: white;
    background: rgba(15, 23, 42, 0.82);
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 13px;
    padding: 10px 12px;
    outline: none;
    transition: border 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.header-search input:focus,
.mobile-search input:focus,
.search-page-form input:focus,
.search-page-form select:focus {
    border-color: rgba(56, 189, 248, 0.75);
    box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.12);
}

.header-search button,
.mobile-search button,
.search-page-form button,
.primary-button,
.ghost-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 13px;
    padding: 10px 16px;
    color: white;
    background: linear-gradient(135deg, var(--sky), var(--blue));
    cursor: pointer;
    font-weight: 700;
    box-shadow: 0 14px 36px rgba(37, 99, 235, 0.25);
    transition: transform 0.2s ease, filter 0.2s ease, background 0.2s ease;
}

.header-search button:hover,
.mobile-search button:hover,
.search-page-form button:hover,
.primary-button:hover,
.ghost-button:hover {
    transform: translateY(-1px);
    filter: brightness(1.06);
}

.ghost-button {
    color: #dbeafe;
    background: rgba(15, 23, 42, 0.56);
    border: 1px solid rgba(125, 211, 252, 0.28);
    box-shadow: none;
}

.menu-toggle {
    display: none;
    width: 42px;
    height: 42px;
    padding: 10px;
    border: 0;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.9);
    cursor: pointer;
}

.menu-toggle span {
    display: block;
    height: 2px;
    margin: 5px 0;
    background: #cbd5e1;
    border-radius: 99px;
}

.mobile-panel {
    display: none;
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 0 0 18px;
}

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

.mobile-panel nav {
    display: grid;
    gap: 6px;
    margin-top: 12px;
}

.mobile-search {
    display: flex;
    gap: 8px;
}

.hero-slider {
    position: relative;
    height: 620px;
    overflow: hidden;
    isolation: isolate;
    border-bottom: 1px solid rgba(148, 163, 184, 0.16);
}

.hero-track,
.hero-slide {
    position: absolute;
    inset: 0;
}

.hero-slide {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.7s ease;
}

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

.hero-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.02);
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(2, 6, 23, 0.96) 0%, rgba(2, 6, 23, 0.84) 34%, rgba(2, 6, 23, 0.28) 68%, rgba(2, 6, 23, 0.7) 100%),
        linear-gradient(0deg, rgba(2, 6, 23, 0.98) 0%, rgba(2, 6, 23, 0.18) 52%, rgba(2, 6, 23, 0.35) 100%);
}

.hero-content {
    position: relative;
    z-index: 2;
    width: min(1180px, calc(100% - 32px));
    height: 100%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    max-width: 1180px;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    width: max-content;
    color: var(--amber);
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 14px;
}

.hero-content h1 {
    max-width: 760px;
    margin: 0 0 18px;
    color: white;
    font-size: clamp(42px, 7vw, 76px);
    line-height: 1.05;
    font-weight: 900;
    letter-spacing: -0.045em;
}

.hero-line {
    max-width: 760px;
    margin: 0 0 14px;
    color: #e2e8f0;
    font-size: clamp(18px, 2.5vw, 24px);
}

.hero-summary {
    max-width: 700px;
    margin: 0 0 24px;
    color: var(--muted);
    font-size: 16px;
}

.hero-tags,
.tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.hero-tags span,
.tag-row span {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 4px 10px;
    color: #bae6fd;
    background: rgba(14, 165, 233, 0.13);
    border: 1px solid rgba(56, 189, 248, 0.18);
    border-radius: 999px;
    font-size: 12px;
}

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

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

.hero-dot {
    width: 36px;
    height: 5px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: rgba(203, 213, 225, 0.35);
    cursor: pointer;
}

.hero-dot.is-active {
    background: var(--sky);
}

.quick-categories {
    padding: 48px 0 8px;
}

.quick-inner,
.content-section,
.page-main,
.detail-main,
.ranking-layout {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
}

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

.content-section.flush-top {
    padding-top: 0;
}

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

.section-heading.compact {
    margin-bottom: 22px;
}

.section-heading h2 {
    margin: 0;
    color: white;
    font-size: clamp(26px, 4vw, 36px);
    line-height: 1.2;
    font-weight: 900;
    letter-spacing: -0.03em;
}

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

.section-more {
    color: var(--sky);
    font-size: 14px;
    font-weight: 800;
}

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

.category-tile {
    display: grid;
    gap: 8px;
    min-height: 118px;
    padding: 22px;
    border: 1px solid rgba(56, 189, 248, 0.16);
    border-radius: var(--radius);
    background:
        radial-gradient(circle at top right, rgba(56, 189, 248, 0.22), transparent 55%),
        rgba(15, 23, 42, 0.72);
    box-shadow: 0 20px 52px rgba(0, 0, 0, 0.22);
    transition: transform 0.25s ease, border 0.25s ease, background 0.25s ease;
}

.category-tile:hover {
    transform: translateY(-4px);
    border-color: rgba(56, 189, 248, 0.42);
}

.category-tile span {
    color: white;
    font-size: 20px;
    font-weight: 900;
}

.category-tile small {
    color: var(--muted);
}

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

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

.movie-card {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: var(--radius);
    background: rgba(15, 23, 42, 0.66);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.24);
    transition: transform 0.25s ease, border 0.25s ease, box-shadow 0.25s ease;
}

.movie-card:hover {
    transform: translateY(-5px);
    border-color: rgba(56, 189, 248, 0.42);
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.34);
}

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

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

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

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

.play-chip {
    position: absolute;
    right: 12px;
    bottom: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    color: white;
    background: rgba(14, 165, 233, 0.92);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
}

.rank-badge {
    position: absolute;
    left: 12px;
    top: 12px;
    z-index: 2;
    display: inline-grid;
    place-items: center;
    min-width: 34px;
    height: 34px;
    color: white;
    background: linear-gradient(135deg, var(--rose), #f97316);
    border-radius: 12px;
    font-size: 14px;
    font-weight: 900;
    box-shadow: 0 12px 34px rgba(251, 113, 133, 0.3);
}

.card-body {
    padding: 15px;
}

.card-title {
    display: block;
    color: white;
    font-size: 16px;
    font-weight: 850;
    line-height: 1.35;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: color 0.2s ease;
}

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

.card-line {
    display: -webkit-box;
    min-height: 42px;
    margin: 8px 0 12px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.55;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    color: var(--muted-soft);
    font-size: 12px;
    margin-bottom: 10px;
}

.movie-card-horizontal {
    display: grid;
    grid-template-columns: 138px minmax(0, 1fr);
    min-height: 188px;
}

.movie-card-horizontal .poster {
    height: 100%;
    aspect-ratio: auto;
}

.movie-card-horizontal .card-body {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.page-main {
    padding: 34px 0 72px;
}

.page-hero {
    position: relative;
    overflow: hidden;
    margin: 28px 0 28px;
    padding: clamp(36px, 6vw, 72px);
    border: 1px solid rgba(56, 189, 248, 0.18);
    border-radius: 28px;
    background:
        radial-gradient(circle at top right, rgba(56, 189, 248, 0.24), transparent 36rem),
        radial-gradient(circle at bottom left, rgba(37, 99, 235, 0.18), transparent 28rem),
        rgba(15, 23, 42, 0.72);
    box-shadow: var(--shadow);
}

.page-hero h1 {
    max-width: 850px;
    margin: 0 0 14px;
    font-size: clamp(34px, 6vw, 58px);
    line-height: 1.1;
    font-weight: 900;
    letter-spacing: -0.04em;
}

.page-hero p {
    max-width: 780px;
    margin: 0;
    color: #cbd5e1;
    font-size: 18px;
}

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

.category-card-large {
    position: relative;
    min-height: 230px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 20px;
    border-radius: var(--radius);
    border: 1px solid rgba(148, 163, 184, 0.14);
    background: rgba(15, 23, 42, 0.7);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.24);
}

.category-card-large img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.category-card-large:hover img {
    transform: scale(1.08);
}

.category-card-mask {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(2, 6, 23, 0.12), rgba(2, 6, 23, 0.95));
}

.category-card-large strong,
.category-card-large small {
    position: relative;
    z-index: 2;
}

.category-card-large strong {
    color: white;
    font-size: 21px;
    font-weight: 900;
}

.category-card-large small {
    margin-top: 8px;
    color: var(--muted);
}

.ranking-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 28px;
    padding-bottom: 70px;
}

.ranking-side,
.detail-sidebar .side-panel,
.prose-card,
.search-panel {
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: var(--radius);
    background: rgba(15, 23, 42, 0.72);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.26);
}

.ranking-side {
    position: sticky;
    top: 92px;
    align-self: start;
    padding: 22px;
}

.ranking-side h2,
.side-panel h2 {
    margin: 0 0 16px;
    color: white;
    font-size: 20px;
}

.side-rank-list,
.side-category-list {
    display: grid;
    gap: 8px;
}

.side-rank-list a,
.side-category-list a {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 40px;
    color: #cbd5e1;
    background: rgba(2, 6, 23, 0.32);
    border: 1px solid rgba(148, 163, 184, 0.08);
    border-radius: 12px;
    padding: 9px 10px;
    font-size: 13px;
    transition: color 0.2s ease, border 0.2s ease, background 0.2s ease;
}

.side-rank-list a:hover,
.side-category-list a:hover {
    color: white;
    border-color: rgba(56, 189, 248, 0.3);
    background: rgba(14, 165, 233, 0.08);
}

.side-rank-list span {
    display: inline-grid;
    place-items: center;
    width: 24px;
    height: 24px;
    flex: 0 0 auto;
    color: white;
    background: rgba(56, 189, 248, 0.18);
    border-radius: 8px;
    font-weight: 900;
}

.pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 32px;
}

.pagination a,
.pagination span {
    display: inline-grid;
    place-items: center;
    min-width: 42px;
    min-height: 42px;
    padding: 0 12px;
    color: #cbd5e1;
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.72);
}

.pagination .current {
    color: white;
    border-color: rgba(56, 189, 248, 0.45);
    background: rgba(14, 165, 233, 0.2);
}

.search-panel {
    padding: 24px;
    margin-bottom: 70px;
}

.search-page-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 160px 150px 120px;
    gap: 12px;
    margin-bottom: 24px;
}

.search-result-title {
    margin-bottom: 18px;
    color: white;
    font-size: 22px;
    font-weight: 900;
}

.detail-main {
    padding: 30px 0 76px;
}

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

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

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

.detail-content {
    min-width: 0;
}

.player-card,
.movie-intro {
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 24px;
    background: rgba(15, 23, 42, 0.74);
    box-shadow: var(--shadow);
}

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

.movie-player {
    width: 100%;
    height: 100%;
    display: block;
    background: #000;
}

.play-overlay {
    position: absolute;
    left: 50%;
    top: 50%;
    display: inline-grid;
    place-items: center;
    width: 82px;
    height: 82px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    color: white;
    background: rgba(14, 165, 233, 0.86);
    transform: translate(-50%, -50%);
    cursor: pointer;
    box-shadow: 0 22px 58px rgba(14, 165, 233, 0.32);
    transition: transform 0.2s ease, opacity 0.2s ease, visibility 0.2s ease;
}

.play-overlay:hover {
    transform: translate(-50%, -50%) scale(1.05);
}

.play-overlay span {
    margin-left: 5px;
    font-size: 34px;
}

.play-overlay.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.movie-intro {
    margin-top: 24px;
    padding: 28px;
}

.intro-head {
    display: grid;
    grid-template-columns: 170px minmax(0, 1fr);
    gap: 24px;
    align-items: start;
    margin-bottom: 28px;
}

.intro-head img {
    width: 170px;
    aspect-ratio: 3 / 4.2;
    object-fit: cover;
    border-radius: 18px;
    box-shadow: 0 18px 52px rgba(0, 0, 0, 0.35);
}

.movie-intro h1 {
    margin: 0 0 12px;
    font-size: clamp(30px, 5vw, 52px);
    line-height: 1.1;
    letter-spacing: -0.04em;
}

.intro-line {
    margin: 0 0 16px;
    color: #dbeafe;
    font-size: 18px;
}

.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    margin-bottom: 16px;
    color: var(--muted);
}

.movie-intro h2,
.prose-card h2 {
    margin: 26px 0 12px;
    color: white;
    font-size: 24px;
}

.movie-intro p,
.prose-card p {
    color: #cbd5e1;
    margin: 0 0 16px;
    font-size: 16px;
}

.related-section {
    width: 100%;
}

.detail-sidebar {
    display: grid;
    gap: 18px;
    align-content: start;
}

.detail-sidebar .side-panel {
    padding: 20px;
}

.prose-card {
    padding: 30px;
}

.site-footer {
    border-top: 1px solid rgba(148, 163, 184, 0.14);
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.86), #020617);
}

.footer-inner {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 40px 0;
    display: grid;
    gap: 22px;
}

.footer-brand {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    max-width: 680px;
}

.footer-brand strong {
    color: white;
    font-size: 20px;
}

.footer-brand p,
.footer-copy {
    margin: 6px 0 0;
    color: var(--muted);
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

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

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

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

    .header-search {
        margin-left: auto;
    }

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

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

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

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

    .ranking-side,
    .detail-sidebar {
        position: static;
    }
}

@media (max-width: 760px) {
    .header-inner {
        height: 64px;
        gap: 12px;
    }

    .brand-subtitle,
    .header-search {
        display: none;
    }

    .hero-slider {
        height: 560px;
    }

    .hero-content {
        justify-content: flex-end;
        padding-bottom: 94px;
    }

    .hero-summary {
        display: none;
    }

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

    .movie-card-horizontal {
        grid-template-columns: 112px minmax(0, 1fr);
    }

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

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

    .intro-head {
        grid-template-columns: 1fr;
    }

    .intro-head img {
        width: 150px;
    }
}

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

    .movie-card-horizontal {
        grid-template-columns: 1fr;
    }

    .mobile-search {
        flex-direction: column;
    }

    .play-overlay {
        width: 68px;
        height: 68px;
    }
}
