:root {
    color-scheme: dark;
    --bg: #020617;
    --panel: #0f172a;
    --panel-soft: rgba(15, 23, 42, 0.76);
    --panel-strong: rgba(15, 23, 42, 0.94);
    --line: rgba(148, 163, 184, 0.18);
    --text: #f8fafc;
    --muted: #94a3b8;
    --cyan: #22d3ee;
    --cyan-dark: #0891b2;
    --blue: #3b82f6;
    --orange: #fb923c;
    --shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
    --radius: 24px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at 18% -10%, rgba(34, 211, 238, 0.18), transparent 28rem),
        radial-gradient(circle at 80% 10%, rgba(59, 130, 246, 0.16), transparent 32rem),
        linear-gradient(180deg, #020617 0%, #07111f 45%, #020617 100%);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
    line-height: 1.6;
}

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

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

button,
input {
    font: inherit;
}

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

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

.logo {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-size: 1.45rem;
    font-weight: 900;
    letter-spacing: -0.03em;
    background: linear-gradient(90deg, var(--cyan), var(--blue));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    white-space: nowrap;
}

.logo-icon {
    width: 40px;
    height: 40px;
    border-radius: 16px;
    display: inline-grid;
    place-items: center;
    color: white;
    font-size: 0.92rem;
    background: linear-gradient(135deg, var(--cyan), var(--blue));
    box-shadow: 0 0 28px rgba(34, 211, 238, 0.32);
}

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

.desktop-nav a,
.mobile-panel a {
    color: #cbd5e1;
    font-weight: 700;
    transition: color 0.2s ease, transform 0.2s ease;
}

.desktop-nav a:hover,
.desktop-nav a.active,
.mobile-panel a:hover,
.mobile-panel a.active {
    color: var(--cyan);
}

.top-search,
.mobile-search,
.big-search {
    display: flex;
    align-items: center;
    gap: 8px;
}

.top-search input,
.mobile-search input,
.big-search input,
.local-tools input {
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 999px;
    outline: none;
    color: var(--text);
    background: rgba(15, 23, 42, 0.85);
    padding: 11px 16px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.top-search input:focus,
.mobile-search input:focus,
.big-search input:focus,
.local-tools input:focus {
    border-color: rgba(34, 211, 238, 0.65);
    box-shadow: 0 0 0 4px rgba(34, 211, 238, 0.12);
}

.top-search button,
.mobile-search button,
.big-search button {
    border: 0;
    border-radius: 999px;
    color: white;
    background: linear-gradient(135deg, var(--cyan-dark), var(--blue));
    padding: 11px 18px;
    font-weight: 800;
    cursor: pointer;
}

.menu-toggle {
    display: none;
    border: 1px solid var(--line);
    border-radius: 14px;
    color: var(--text);
    background: rgba(15, 23, 42, 0.78);
    padding: 8px 12px;
    cursor: pointer;
}

.mobile-panel {
    width: min(1240px, calc(100% - 32px));
    margin: 0 auto 18px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: var(--panel-strong);
    box-shadow: var(--shadow);
}

.mobile-panel nav {
    display: grid;
    gap: 12px;
    margin-bottom: 16px;
}

main {
    min-height: 62vh;
}

.hero-carousel {
    position: relative;
    min-height: clamp(560px, 76vh, 780px);
    overflow: hidden;
    border-bottom: 1px solid var(--line);
    background: #020617;
}

.hero-slide {
    position: absolute;
    inset: 0;
    display: grid;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.7s ease;
}

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

.hero-slide::before,
.page-hero.category-cover::before,
.detail-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(2, 6, 23, 0.98) 0%, rgba(2, 6, 23, 0.76) 42%, rgba(2, 6, 23, 0.22) 100%),
        var(--hero-image) center / cover no-repeat;
    transform: scale(1.04);
    filter: saturate(1.08);
}

.hero-slide::after,
.page-hero.category-cover::after,
.detail-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 24% 32%, rgba(34, 211, 238, 0.2), transparent 24rem),
        linear-gradient(0deg, #020617 0%, transparent 38%);
}

.hero-copy {
    position: relative;
    z-index: 2;
    width: min(1240px, calc(100% - 32px));
    margin: 0 auto;
    max-width: 780px;
    justify-self: center;
}

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

.hero-copy h1,
.page-hero h1,
.detail-info h1 {
    margin: 0;
    font-size: clamp(2.4rem, 7vw, 5.8rem);
    line-height: 0.98;
    letter-spacing: -0.08em;
}

.hero-text,
.page-hero p,
.detail-one-line {
    max-width: 760px;
    margin: 22px 0 0;
    color: #cbd5e1;
    font-size: clamp(1rem, 2vw, 1.2rem);
}

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

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

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

.btn.primary {
    color: white;
    background: linear-gradient(135deg, var(--cyan-dark), var(--blue));
    box-shadow: 0 18px 35px rgba(8, 145, 178, 0.24);
}

.btn.ghost {
    border: 1px solid rgba(148, 163, 184, 0.35);
    color: #e2e8f0;
    background: rgba(15, 23, 42, 0.58);
}

.hero-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 24px;
}

.hero-tags span {
    border: 1px solid rgba(34, 211, 238, 0.3);
    border-radius: 999px;
    color: #cffafe;
    background: rgba(8, 145, 178, 0.12);
    padding: 6px 12px;
    font-size: 0.86rem;
    font-weight: 700;
}

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

.hero-dots button {
    width: 36px;
    height: 6px;
    border: 0;
    border-radius: 999px;
    background: rgba(203, 213, 225, 0.36);
    cursor: pointer;
}

.hero-dots button.active {
    background: var(--cyan);
}

.quick-filter,
.section-block,
.page-hero,
.detail-hero,
.site-footer .footer-grid {
    width: min(1240px, calc(100% - 32px));
    margin-left: auto;
    margin-right: auto;
}

.quick-filter {
    position: relative;
    z-index: 3;
    margin-top: -46px;
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 24px;
    align-items: center;
    padding: 28px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(15, 23, 42, 0.9);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.quick-filter h2,
.section-head h2,
.side-panel h2,
.ranking-panel h2,
.content-panel h2,
.player-shell h2,
.prose-panel h2 {
    margin: 0;
    color: var(--text);
    font-size: clamp(1.5rem, 3vw, 2.35rem);
    letter-spacing: -0.04em;
}

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

.big-search input {
    flex: 1;
    width: 100%;
    padding: 15px 18px;
}

.big-search button {
    padding: 15px 22px;
}

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

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

.section-head.compact {
    align-items: center;
}

.section-head > a {
    color: var(--cyan);
    font-weight: 900;
}

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

.category-tile,
.category-overview-card a {
    position: relative;
    min-height: 190px;
    display: flex;
    align-items: end;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: var(--panel);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.22);
}

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

.category-tile:hover img,
.category-overview-card a:hover img {
    transform: scale(1.08);
    opacity: 0.72;
}

.category-tile::after,
.category-overview-card a::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(2, 6, 23, 0.94) 0%, rgba(2, 6, 23, 0.25) 100%);
}

.category-tile span,
.category-overview-card div {
    position: relative;
    z-index: 2;
    display: grid;
    gap: 8px;
    padding: 20px;
}

.category-tile strong,
.category-overview-card h2 {
    font-size: 1.2rem;
    color: white;
}

.category-tile em,
.category-overview-card p {
    color: #cbd5e1;
    font-size: 0.92rem;
    font-style: normal;
}

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

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

.movie-card {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: linear-gradient(180deg, rgba(30, 41, 59, 0.84), rgba(15, 23, 42, 0.95));
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.24);
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.movie-card:hover {
    transform: translateY(-6px);
    border-color: rgba(34, 211, 238, 0.45);
    box-shadow: 0 24px 60px rgba(8, 145, 178, 0.14);
}

.movie-poster {
    position: relative;
    display: block;
    aspect-ratio: 2 / 3;
    overflow: hidden;
    background: #0f172a;
}

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

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

.poster-shade {
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.72) 0%, transparent 48%);
}

.play-badge {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 54px;
    height: 54px;
    transform: translate(-50%, -50%) scale(0.86);
    display: grid;
    place-items: center;
    border-radius: 999px;
    color: white;
    background: rgba(34, 211, 238, 0.86);
    opacity: 0;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

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

.movie-poster em {
    position: absolute;
    right: 12px;
    top: 12px;
    border-radius: 999px;
    color: white;
    background: rgba(2, 6, 23, 0.72);
    padding: 4px 9px;
    font-size: 0.75rem;
    font-style: normal;
    font-weight: 800;
}

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

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

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

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

.card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.card-meta span {
    border-radius: 999px;
    color: #cbd5e1;
    background: rgba(148, 163, 184, 0.12);
    padding: 3px 8px;
    font-size: 0.75rem;
}

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

.ranking-panel,
.side-panel,
.content-panel,
.player-shell,
.prose-panel {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel-soft);
    padding: 24px;
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.22);
}

.rank-row {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    padding: 13px 0;
    border-bottom: 1px solid var(--line);
}

.rank-row:last-child {
    border-bottom: 0;
}

.rank-row span {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    color: white;
    background: linear-gradient(135deg, var(--cyan-dark), var(--blue));
    font-weight: 900;
}

.rank-row strong {
    display: block;
    color: white;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rank-row em {
    display: block;
    color: var(--muted);
    font-style: normal;
    font-size: 0.84rem;
}

.page-hero {
    position: relative;
    margin-top: 34px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: calc(var(--radius) + 8px);
    background:
        radial-gradient(circle at 78% 28%, rgba(34, 211, 238, 0.2), transparent 20rem),
        linear-gradient(135deg, rgba(15, 23, 42, 0.94), rgba(2, 6, 23, 0.96));
    padding: clamp(36px, 8vw, 80px);
    box-shadow: var(--shadow);
}

.page-hero.slim h1 {
    font-size: clamp(2.1rem, 5vw, 4.5rem);
}

.page-hero.category-cover {
    min-height: 390px;
    display: grid;
    align-content: end;
}

.page-hero.category-cover > * {
    position: relative;
    z-index: 2;
}

.local-tools {
    margin: 0 0 22px;
}

.local-tools input {
    width: 100%;
    border-radius: 18px;
    padding: 14px 16px;
}

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

.mini-list {
    display: grid;
    gap: 12px;
    margin-top: 18px;
}

.mini-link {
    display: grid;
    grid-template-columns: 68px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    padding: 10px;
    border: 1px solid transparent;
    border-radius: 16px;
    background: rgba(15, 23, 42, 0.55);
    transition: border-color 0.2s ease, background 0.2s ease;
}

.mini-link:hover {
    border-color: rgba(34, 211, 238, 0.35);
    background: rgba(15, 23, 42, 0.9);
}

.mini-link img {
    width: 68px;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    border-radius: 12px;
}

.mini-link strong,
.mini-link em {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mini-link strong {
    color: white;
}

.mini-link em {
    margin-top: 4px;
    color: var(--muted);
    font-style: normal;
    font-size: 0.82rem;
}

.detail-hero {
    position: relative;
    min-height: 560px;
    display: grid;
    grid-template-columns: 290px minmax(0, 1fr);
    gap: clamp(24px, 5vw, 56px);
    align-items: end;
    margin-top: 34px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: calc(var(--radius) + 8px);
    padding: clamp(24px, 5vw, 56px);
    box-shadow: var(--shadow);
}

.detail-hero > * {
    position: relative;
    z-index: 2;
}

.detail-poster img {
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 24px;
    box-shadow: 0 24px 55px rgba(0, 0, 0, 0.42);
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
    color: #cbd5e1;
    font-weight: 700;
}

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

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

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

.player-frame {
    position: relative;
    overflow: hidden;
    border-radius: 22px;
    background: #000;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.38);
}

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

.player-overlay {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    border: 0;
    cursor: pointer;
    color: white;
    background: linear-gradient(0deg, rgba(2, 6, 23, 0.24), rgba(2, 6, 23, 0.1));
}

.player-overlay span {
    width: 86px;
    height: 86px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: rgba(34, 211, 238, 0.88);
    box-shadow: 0 0 40px rgba(34, 211, 238, 0.38);
    font-size: 2rem;
}

.player-frame.playing .player-overlay {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.player-shell h2,
.player-shell p {
    margin-left: 2px;
}

.player-shell h2 {
    margin-top: 20px;
}

.player-shell p,
.content-panel p,
.prose-panel p {
    color: #cbd5e1;
}

.meta-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 18px 0 0;
}

.meta-list div {
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(2, 6, 23, 0.28);
    padding: 14px;
}

.meta-list dt {
    color: var(--muted);
    font-size: 0.84rem;
}

.meta-list dd {
    margin: 4px 0 0;
    color: white;
    font-weight: 800;
}

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

.ranking-item a {
    display: grid;
    grid-template-columns: 70px 86px minmax(0, 1fr);
    gap: 16px;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: rgba(15, 23, 42, 0.72);
    padding: 14px;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.ranking-item a:hover {
    transform: translateX(4px);
    border-color: rgba(34, 211, 238, 0.35);
}

.rank-number {
    display: grid;
    place-items: center;
    width: 54px;
    height: 54px;
    border-radius: 18px;
    color: white;
    background: linear-gradient(135deg, var(--orange), var(--cyan-dark));
    font-weight: 900;
}

.ranking-item img {
    width: 86px;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    border-radius: 14px;
}

.ranking-item h2 {
    margin: 0 0 6px;
    font-size: 1.2rem;
}

.ranking-item p {
    margin: 0 0 6px;
    color: #cbd5e1;
}

.ranking-item em {
    color: var(--muted);
    font-style: normal;
}

.prose-panel {
    max-width: 900px;
}

.prose-panel h2 + p {
    margin-top: 10px;
}

.site-footer {
    margin-top: 76px;
    border-top: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.68), rgba(0, 0, 0, 0.82));
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.35fr 1fr 1fr;
    gap: 32px;
    padding: 42px 0;
}

.site-footer h2 {
    margin: 0 0 14px;
    color: white;
    font-size: 1.1rem;
}

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

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

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

[hidden] {
    display: none !important;
}

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

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

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

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

    .detail-side {
        order: -1;
    }
}

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

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

    .quick-filter,
    .footer-grid,
    .detail-hero {
        grid-template-columns: 1fr;
    }

    .detail-poster {
        max-width: 230px;
    }

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

    .hero-carousel {
        min-height: 620px;
    }
}

@media (max-width: 560px) {
    .header-inner {
        width: min(100% - 24px, 1240px);
        height: 66px;
    }

    .logo {
        font-size: 1.1rem;
    }

    .logo-icon {
        width: 34px;
        height: 34px;
        border-radius: 12px;
    }

    .quick-filter,
    .section-block,
    .page-hero,
    .detail-hero,
    .site-footer .footer-grid {
        width: min(100% - 24px, 1240px);
    }

    .quick-filter,
    .page-hero,
    .detail-hero,
    .ranking-panel,
    .side-panel,
    .content-panel,
    .player-shell,
    .prose-panel {
        padding: 18px;
        border-radius: 20px;
    }

    .hero-copy {
        width: min(100% - 24px, 1240px);
    }

    .hero-copy h1,
    .page-hero h1,
    .detail-info h1 {
        font-size: clamp(2.1rem, 13vw, 3.4rem);
    }

    .big-search {
        display: grid;
    }

    .movie-grid,
    .small-grid,
    .category-page-layout .movie-grid {
        gap: 14px;
    }

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

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

    .meta-list,
    .ranking-item a {
        grid-template-columns: 1fr;
    }
}
