:root {
    color-scheme: dark;
    --bg: #020617;
    --panel: rgba(15, 23, 42, 0.78);
    --panel-strong: rgba(15, 23, 42, 0.94);
    --line: rgba(148, 163, 184, 0.18);
    --text: #f8fafc;
    --muted: #94a3b8;
    --soft: #cbd5e1;
    --brand: #38bdf8;
    --brand-strong: #0ea5e9;
    --accent: #f472b6;
    --radius: 24px;
    --shadow: 0 24px 80px rgba(2, 6, 23, 0.55);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background:
        radial-gradient(circle at 20% 0%, rgba(14, 165, 233, 0.18), transparent 32rem),
        radial-gradient(circle at 90% 18%, rgba(244, 114, 182, 0.12), transparent 30rem),
        linear-gradient(135deg, #020617 0%, #0f172a 48%, #020617 100%);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
    line-height: 1.65;
    min-height: 100vh;
}

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

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

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

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

.header-inner {
    max-width: 1280px;
    margin: 0 auto;
    min-height: 76px;
    display: flex;
    align-items: center;
    gap: 22px;
    padding: 0 24px;
}

.site-logo {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.logo-mark {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--brand), var(--accent));
    color: white;
    font-weight: 900;
    box-shadow: 0 12px 28px rgba(14, 165, 233, 0.28);
}

.logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.logo-text strong {
    font-size: 20px;
    letter-spacing: 0.02em;
}

.logo-text small {
    margin-top: 4px;
    color: var(--muted);
    font-size: 12px;
}

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

.nav-link {
    color: var(--soft);
    font-weight: 700;
    font-size: 15px;
    transition: color 0.2s ease, transform 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
    color: var(--brand);
}

.nav-link:hover {
    transform: translateY(-1px);
}

.header-search {
    position: relative;
    width: min(300px, 26vw);
}

.header-search input,
.mobile-search input,
.filter-bar input,
.filter-bar select,
.local-search-row input {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.76);
    color: var(--text);
    outline: none;
    padding: 12px 16px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.header-search input:focus,
.mobile-search input:focus,
.filter-bar input:focus,
.filter-bar select:focus,
.local-search-row input:focus {
    border-color: rgba(56, 189, 248, 0.85);
    box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.12);
    background: rgba(15, 23, 42, 0.95);
}

.search-panel {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: min(420px, 90vw);
    max-height: 430px;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--panel-strong);
    box-shadow: var(--shadow);
    display: none;
}

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

.search-item {
    display: grid;
    grid-template-columns: 48px 1fr;
    gap: 12px;
    padding: 12px;
    border-bottom: 1px solid var(--line);
}

.search-item:last-child {
    border-bottom: 0;
}

.search-item img {
    width: 48px;
    height: 68px;
    object-fit: cover;
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.8);
}

.search-item strong {
    display: block;
    font-size: 14px;
}

.search-item span {
    color: var(--muted);
    font-size: 12px;
}

.mobile-menu-button {
    display: none;
    width: 44px;
    height: 44px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.84);
    color: var(--text);
    font-size: 22px;
}

.mobile-nav {
    display: none;
    padding: 0 24px 20px;
    border-top: 1px solid var(--line);
    background: rgba(2, 6, 23, 0.95);
}

.mobile-nav.is-open {
    display: grid;
    gap: 14px;
}

.mobile-nav a {
    color: var(--soft);
    font-weight: 700;
}

main {
    min-height: 70vh;
}

.hero-slider {
    position: relative;
    min-height: 680px;
    overflow: hidden;
}

.hero-slide {
    display: none;
    position: relative;
    min-height: 680px;
    isolation: isolate;
}

.hero-slide.is-active {
    display: block;
}

.hero-slide::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -3;
    background-image: var(--hero-image);
    background-size: cover;
    background-position: center;
    filter: blur(10px) saturate(1.1);
    transform: scale(1.06);
    opacity: 0.42;
}

.hero-backdrop {
    position: absolute;
    inset: 0;
    z-index: -2;
    background:
        linear-gradient(90deg, rgba(2, 6, 23, 0.97), rgba(2, 6, 23, 0.74) 52%, rgba(2, 6, 23, 0.25)),
        linear-gradient(to top, #020617 0%, transparent 42%);
}

.hero-content {
    width: min(1280px, calc(100% - 48px));
    margin: 0 auto;
    min-height: 680px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 390px;
    align-items: center;
    gap: 64px;
    padding: 96px 0 64px;
}

.hero-copy {
    max-width: 780px;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--brand);
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.hero-copy h1,
.page-hero h1,
.detail-copy h1 {
    margin: 16px 0;
    font-size: clamp(38px, 6vw, 76px);
    line-height: 1.04;
    letter-spacing: -0.05em;
}

.hero-copy p,
.page-hero p,
.detail-copy p {
    max-width: 760px;
    color: var(--soft);
    font-size: clamp(16px, 2vw, 21px);
}

.hero-actions,
.local-search-row,
.adjacent-links {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 26px;
}

.primary-button,
.ghost-button,
.section-more {
    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, background 0.2s ease;
}

.primary-button {
    color: white;
    background: linear-gradient(135deg, var(--brand-strong), var(--accent));
    box-shadow: 0 16px 34px rgba(14, 165, 233, 0.28);
}

.ghost-button,
.section-more {
    color: var(--text);
    border: 1px solid var(--line);
    background: rgba(15, 23, 42, 0.72);
}

.primary-button:hover,
.ghost-button:hover,
.section-more:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 38px rgba(2, 6, 23, 0.35);
}

.small {
    min-height: 38px;
    padding: 0 14px;
    font-size: 13px;
}

.hero-poster {
    position: relative;
    border-radius: 32px;
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 1px solid rgba(255, 255, 255, 0.12);
    transform: rotate(2deg);
}

.hero-poster::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(2, 6, 23, 0.72), transparent 55%);
}

.hero-poster img {
    aspect-ratio: 2 / 3;
    width: 100%;
    object-fit: cover;
    background: rgba(15, 23, 42, 0.8);
}

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

.hero-dot {
    width: 42px;
    height: 6px;
    border: 0;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.34);
    cursor: pointer;
}

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

.quick-search-section,
.content-section {
    width: min(1280px, calc(100% - 48px));
    margin: 0 auto;
}

.quick-search-card {
    margin-top: -48px;
    position: relative;
    z-index: 6;
    padding: 30px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(15, 23, 42, 0.82);
    box-shadow: var(--shadow);
    backdrop-filter: blur(20px);
}

.quick-search-card span,
.section-heading span {
    color: var(--brand);
    font-weight: 800;
}

.quick-search-card h2,
.section-heading h2 {
    margin: 6px 0 0;
    font-size: clamp(24px, 3vw, 36px);
    letter-spacing: -0.03em;
}

.local-search-row input {
    max-width: 640px;
}

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

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

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

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

.movie-card {
    border: 1px solid var(--line);
    border-radius: 22px;
    background: rgba(15, 23, 42, 0.7);
    overflow: hidden;
    box-shadow: 0 18px 42px rgba(2, 6, 23, 0.22);
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.movie-card:hover {
    transform: translateY(-6px);
    border-color: rgba(56, 189, 248, 0.42);
    background: rgba(15, 23, 42, 0.92);
}

.poster-link {
    display: block;
    position: relative;
    overflow: hidden;
    background: rgba(15, 23, 42, 0.8);
}

.poster-link img {
    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    transition: transform 0.3s ease, filter 0.3s ease;
}

.movie-card:hover .poster-link img {
    transform: scale(1.05);
    filter: brightness(0.72);
}

.play-mark {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    color: white;
    background: rgba(14, 165, 233, 0.86);
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.movie-card:hover .play-mark {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.rank-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 2;
    min-width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--accent), var(--brand));
    color: white;
    font-style: normal;
    font-weight: 900;
}

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

.movie-card h3 {
    margin: 0 0 8px;
    font-size: 17px;
    line-height: 1.35;
}

.movie-card h3 a:hover {
    color: var(--brand);
}

.movie-card p {
    margin: 0 0 12px;
    color: var(--muted);
    font-size: 14px;
}

.movie-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    color: var(--muted);
    font-size: 13px;
}

.movie-meta span {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0 9px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.1);
}

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

.tag-row span {
    color: #bae6fd;
    border: 1px solid rgba(56, 189, 248, 0.18);
    border-radius: 999px;
    background: rgba(14, 165, 233, 0.09);
    font-size: 12px;
    padding: 4px 9px;
}

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

.category-tile {
    position: relative;
    min-height: 210px;
    display: flex;
    flex-direction: column;
    justify-content: end;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 24px;
    overflow: hidden;
    background: rgba(15, 23, 42, 0.82);
    isolation: isolate;
}

.category-tile::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -2;
    background-image: var(--tile-image);
    background-size: cover;
    background-position: center;
    opacity: 0.28;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.category-tile::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(to top, rgba(2, 6, 23, 0.96), rgba(2, 6, 23, 0.34));
}

.category-tile:hover::before {
    transform: scale(1.08);
    opacity: 0.38;
}

.category-tile span {
    color: var(--brand);
    font-weight: 800;
}

.category-tile strong {
    display: block;
    font-size: 38px;
    line-height: 1.1;
}

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

.page-hero,
.detail-hero {
    position: relative;
    overflow: hidden;
    isolation: isolate;
}

.compact-page-hero {
    width: min(1280px, calc(100% - 48px));
    margin: 36px auto 0;
    padding: 78px 42px;
    border: 1px solid var(--line);
    border-radius: 32px;
    background:
        radial-gradient(circle at 82% 10%, rgba(56, 189, 248, 0.22), transparent 20rem),
        linear-gradient(135deg, rgba(15, 23, 42, 0.92), rgba(2, 6, 23, 0.9));
    box-shadow: var(--shadow);
}

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

.category-overview-card {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 20px;
    border: 1px solid var(--line);
    border-radius: 26px;
    overflow: hidden;
    background: rgba(15, 23, 42, 0.76);
}

.category-preview {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2px;
    background: rgba(15, 23, 42, 0.8);
}

.category-preview img {
    width: 100%;
    height: 100%;
    min-height: 120px;
    object-fit: cover;
}

.category-overview-body {
    padding: 22px 22px 22px 0;
}

.category-overview-body span {
    color: var(--brand);
    font-weight: 800;
}

.category-overview-body h2 {
    margin: 6px 0;
}

.category-overview-body p {
    color: var(--muted);
}

.filter-bar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 180px 180px;
    gap: 14px;
    margin-bottom: 24px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: rgba(15, 23, 42, 0.68);
}

.detail-hero {
    min-height: 560px;
}

.detail-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -3;
    background-image: var(--detail-image);
    background-size: cover;
    background-position: center;
    filter: blur(12px) saturate(1.08);
    transform: scale(1.06);
    opacity: 0.32;
}

.detail-overlay {
    position: absolute;
    inset: 0;
    z-index: -2;
    background:
        linear-gradient(90deg, #020617 0%, rgba(2, 6, 23, 0.82) 58%, rgba(2, 6, 23, 0.35)),
        linear-gradient(to top, #020617 0%, transparent 48%);
}

.detail-inner {
    width: min(1280px, calc(100% - 48px));
    margin: 0 auto;
    min-height: 560px;
    display: grid;
    grid-template-columns: 310px minmax(0, 1fr);
    align-items: center;
    gap: 46px;
    padding: 70px 0;
}

.detail-poster {
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 28px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.detail-poster img {
    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    background: rgba(15, 23, 42, 0.8);
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    color: var(--muted);
    font-size: 14px;
}

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

.large-meta {
    margin: 18px 0;
}

.player-shell {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 28px;
    background: #000;
    box-shadow: var(--shadow);
    aspect-ratio: 16 / 9;
}

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

.player-start {
    position: absolute;
    inset: 0;
    display: grid;
    place-content: center;
    gap: 12px;
    border: 0;
    color: white;
    background:
        radial-gradient(circle at center, rgba(14, 165, 233, 0.25), transparent 18rem),
        linear-gradient(rgba(2, 6, 23, 0.18), rgba(2, 6, 23, 0.68));
    cursor: pointer;
}

.player-start strong {
    width: 86px;
    height: 86px;
    display: grid;
    place-items: center;
    margin: 0 auto;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--brand-strong), var(--accent));
    box-shadow: 0 18px 40px rgba(14, 165, 233, 0.35);
    font-size: 34px;
}

.player-start span {
    font-size: 18px;
    font-weight: 900;
}

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

.player-message {
    position: absolute;
    left: 18px;
    bottom: 18px;
    color: #e0f2fe;
    background: rgba(2, 6, 23, 0.78);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 8px 14px;
    font-size: 13px;
    display: none;
}

.player-message.is-visible {
    display: block;
}

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

.detail-panel {
    border: 1px solid var(--line);
    border-radius: 24px;
    background: rgba(15, 23, 42, 0.72);
    padding: 28px;
}

.detail-panel h2 {
    margin-top: 0;
}

.detail-panel p {
    color: var(--soft);
    white-space: pre-line;
}

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

.rank-row {
    display: grid;
    grid-template-columns: 70px 86px minmax(0, 1fr) auto;
    align-items: center;
    gap: 18px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: rgba(15, 23, 42, 0.72);
}

.rank-number {
    font-size: 28px;
    font-weight: 900;
    color: var(--brand);
    text-align: center;
}

.rank-cover img {
    width: 86px;
    height: 120px;
    object-fit: cover;
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.8);
}

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

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

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

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

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

.footer-grid a {
    display: block;
    margin-top: 8px;
}

.footer-grid a:hover {
    color: var(--brand);
}

.footer-grid h3 {
    margin: 0 0 12px;
}

.footer-logo {
    margin-bottom: 14px;
}

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

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

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

    .mobile-menu-button {
        display: inline-grid;
        place-items: center;
    }

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

    .hero-poster,
    .detail-poster {
        max-width: 340px;
    }

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

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

@media (max-width: 820px) {
    .header-search {
        display: none;
    }

    .header-inner {
        padding: 0 16px;
    }

    .hero-slider,
    .hero-slide,
    .hero-content {
        min-height: auto;
    }

    .hero-content {
        width: min(100% - 32px, 1280px);
        padding: 70px 0 90px;
        gap: 30px;
    }

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

    .category-grid,
    .category-overview-grid,
    .detail-text-grid,
    .footer-grid {
        grid-template-columns: 1fr;
    }

    .category-overview-card {
        grid-template-columns: 1fr;
    }

    .category-overview-body {
        padding: 20px;
    }

    .filter-bar {
        grid-template-columns: 1fr;
    }

    .rank-row {
        grid-template-columns: 48px 72px minmax(0, 1fr);
    }

    .rank-row .ghost-button {
        grid-column: 2 / -1;
        justify-self: start;
    }

    .rank-cover img {
        width: 72px;
        height: 102px;
    }

    .compact-page-hero,
    .content-section,
    .quick-search-section,
    .detail-inner,
    .footer-grid {
        width: min(100% - 32px, 1280px);
    }

    .compact-page-hero {
        padding: 46px 22px;
    }
}

@media (max-width: 520px) {
    .logo-text small {
        display: none;
    }

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

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

    .hero-copy h1,
    .page-hero h1,
    .detail-copy h1 {
        font-size: 34px;
    }

    .player-start strong {
        width: 68px;
        height: 68px;
    }
}
