* {
    box-sizing: border-box;
}

:root {
    color-scheme: dark;
    --bg: #020617;
    --panel: rgba(15, 23, 42, 0.76);
    --panel-strong: rgba(15, 23, 42, 0.96);
    --line: rgba(148, 163, 184, 0.18);
    --muted: #94a3b8;
    --text: #e2e8f0;
    --white: #f8fafc;
    --cyan: #22d3ee;
    --blue: #3b82f6;
    --green: #22c55e;
    --orange: #f59e0b;
    --rose: #fb7185;
    --shadow: 0 24px 80px rgba(0, 0, 0, 0.38);
    --radius: 22px;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(34, 211, 238, 0.15), transparent 34rem),
        radial-gradient(circle at 80% 10%, rgba(59, 130, 246, 0.14), transparent 32rem),
        linear-gradient(180deg, #020617 0%, #0f172a 48%, #020617 100%);
}

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

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

button,
input,
select {
    font: inherit;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    border-bottom: 1px solid rgba(148, 163, 184, 0.16);
    background: linear-gradient(90deg, rgba(15, 23, 42, 0.96), rgba(30, 41, 59, 0.94), rgba(15, 23, 42, 0.96));
    backdrop-filter: blur(16px);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: min(1240px, calc(100% - 32px));
    height: 70px;
    margin: 0 auto;
    gap: 18px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    letter-spacing: 0.02em;
    color: var(--white);
}

.brand span:last-child {
    background: linear-gradient(90deg, var(--cyan), #60a5fa);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.brand-icon {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 12px;
    color: #0f172a;
    background: linear-gradient(135deg, var(--cyan), var(--blue));
    box-shadow: 0 0 30px rgba(34, 211, 238, 0.32);
}

.desktop-nav {
    display: flex;
    align-items: center;
    gap: 6px;
}

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

.desktop-nav a:hover,
.desktop-nav a.is-active,
.mobile-nav a:hover,
.mobile-nav a.is-active {
    color: var(--cyan);
    background: rgba(15, 23, 42, 0.72);
}

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

.header-search input,
.mobile-nav input,
.catalog-controls input,
.catalog-controls select {
    width: 100%;
    border: 1px solid rgba(148, 163, 184, 0.22);
    outline: none;
    border-radius: 999px;
    color: var(--text);
    background: rgba(2, 6, 23, 0.54);
    padding: 11px 15px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.header-search input:focus,
.mobile-nav input:focus,
.catalog-controls input:focus,
.catalog-controls select:focus {
    border-color: rgba(34, 211, 238, 0.72);
    box-shadow: 0 0 0 4px rgba(34, 211, 238, 0.10);
}

.header-search button,
.mobile-nav button,
.hero-search button,
.cta-button,
.ghost-button,
.play-cta,
.catalog-controls button {
    border: 0;
    cursor: pointer;
    border-radius: 999px;
    color: #07111f;
    background: linear-gradient(135deg, var(--cyan), var(--blue));
    padding: 11px 18px;
    font-weight: 800;
    box-shadow: 0 12px 34px rgba(34, 211, 238, 0.22);
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.header-search button:hover,
.mobile-nav button:hover,
.hero-search button:hover,
.cta-button:hover,
.ghost-button:hover,
.play-cta:hover,
.catalog-controls button:hover {
    transform: translateY(-2px);
    filter: brightness(1.05);
    box-shadow: 0 18px 44px rgba(34, 211, 238, 0.30);
}

.nav-toggle {
    display: none;
    width: 42px;
    height: 42px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 12px;
    color: var(--text);
    background: rgba(15, 23, 42, 0.82);
}

.mobile-nav {
    display: none;
    width: min(1240px, calc(100% - 32px));
    margin: 0 auto 16px;
    padding: 14px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.96);
}

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

.mobile-nav form {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.page-shell,
.home-shell {
    width: min(1240px, calc(100% - 32px));
    margin: 0 auto;
}

.home-shell {
    padding: 54px 0 80px;
}

.page-shell {
    padding: 44px 0 80px;
}

.hero-slider {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 32px;
    min-height: 570px;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.92), rgba(15, 23, 42, 0.60));
    box-shadow: var(--shadow);
}

.hero-track {
    position: relative;
    min-height: 570px;
}

.hero-slide {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template-columns: minmax(0, 1.12fr) minmax(320px, 0.88fr);
    gap: 40px;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transform: scale(1.02);
    transition: opacity 0.7s ease, transform 0.7s ease;
    padding: 54px;
}

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

.hero-slide::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(2, 6, 23, 0.96) 0%, rgba(2, 6, 23, 0.74) 48%, rgba(2, 6, 23, 0.18) 100%),
        radial-gradient(circle at 18% 20%, rgba(34, 211, 238, 0.16), transparent 28rem);
    z-index: 1;
}

.hero-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.42;
    filter: saturate(1.1) contrast(1.08);
}

.hero-content,
.hero-poster {
    position: relative;
    z-index: 2;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 18px;
    padding: 8px 13px;
    border: 1px solid rgba(34, 211, 238, 0.32);
    border-radius: 999px;
    color: var(--cyan);
    background: rgba(34, 211, 238, 0.10);
    font-size: 13px;
    font-weight: 800;
}

.hero-content h1,
.hero-content h2 {
    max-width: 790px;
    margin: 0;
    color: var(--white);
    font-size: clamp(34px, 5.2vw, 70px);
    line-height: 1.05;
    letter-spacing: -0.04em;
}

.hero-content p {
    max-width: 720px;
    color: #cbd5e1;
    font-size: 17px;
    line-height: 1.85;
}

.hero-meta,
.detail-meta,
.breadcrumb,
.card-meta,
.ranking-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.hero-meta span,
.detail-meta span,
.ranking-meta span {
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 999px;
    color: #dbeafe;
    background: rgba(15, 23, 42, 0.62);
    padding: 7px 12px;
    font-size: 13px;
    font-weight: 700;
}

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

.ghost-button {
    color: #dbeafe;
    border: 1px solid rgba(148, 163, 184, 0.24);
    background: rgba(15, 23, 42, 0.72);
    box-shadow: none;
}

.hero-search {
    display: flex;
    gap: 10px;
    max-width: 610px;
    margin-top: 26px;
}

.hero-search input {
    min-width: 0;
    flex: 1;
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 999px;
    color: var(--text);
    outline: none;
    background: rgba(2, 6, 23, 0.64);
    padding: 14px 18px;
}

.hero-poster {
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 28px;
    background: rgba(15, 23, 42, 0.72);
    box-shadow: 0 28px 70px rgba(0, 0, 0, 0.42);
}

.hero-poster img {
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
}

.hero-poster .poster-caption {
    padding: 18px;
    color: #e0f2fe;
    font-weight: 800;
}

.hero-dots {
    position: absolute;
    left: 54px;
    bottom: 34px;
    z-index: 3;
    display: flex;
    gap: 10px;
}

.hero-dots button {
    width: 34px;
    height: 6px;
    border: 0;
    border-radius: 999px;
    cursor: pointer;
    background: rgba(148, 163, 184, 0.42);
}

.hero-dots button.is-active {
    background: linear-gradient(90deg, var(--cyan), var(--blue));
}

.section-block {
    margin-top: 74px;
}

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

.section-head h2,
.page-title h1,
.detail-main h1 {
    margin: 0;
    color: var(--white);
    letter-spacing: -0.025em;
}

.section-head h2 {
    font-size: clamp(24px, 3vw, 36px);
}

.section-head p,
.page-title p {
    margin: 10px 0 0;
    color: var(--muted);
    line-height: 1.75;
}

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

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

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

.movie-card {
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.15);
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.82), rgba(15, 23, 42, 0.58));
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.20);
    transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.movie-card:hover {
    transform: translateY(-6px);
    border-color: rgba(34, 211, 238, 0.46);
    box-shadow: 0 24px 60px rgba(34, 211, 238, 0.10), 0 24px 80px rgba(0, 0, 0, 0.35);
}

.poster-link {
    position: relative;
    display: block;
    overflow: hidden;
    background: #0f172a;
}

.poster-link img {
    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    transform: scale(1.001);
    transition: transform 0.35s ease, opacity 0.35s ease;
}

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

.poster-year,
.rank-mark {
    position: absolute;
    top: 12px;
    left: 12px;
    border-radius: 999px;
    padding: 6px 10px;
    color: #e0f2fe;
    background: rgba(2, 6, 23, 0.72);
    backdrop-filter: blur(8px);
    font-size: 12px;
    font-weight: 800;
}

.rank-mark {
    left: auto;
    right: 12px;
    color: #111827;
    background: linear-gradient(135deg, #facc15, #fb923c);
}

.poster-play {
    position: absolute;
    left: 50%;
    top: 50%;
    display: grid;
    width: 54px;
    height: 54px;
    place-items: center;
    border-radius: 999px;
    color: #07111f;
    background: linear-gradient(135deg, var(--cyan), var(--blue));
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.78);
    transition: opacity 0.22s ease, transform 0.22s ease;
}

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

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

.card-meta {
    gap: 8px;
    color: var(--muted);
    font-size: 12px;
}

.card-meta span:not(:last-child)::after {
    content: "·";
    margin-left: 8px;
    color: #475569;
}

.movie-card h3 {
    margin: 10px 0 8px;
    color: var(--white);
    font-size: 18px;
    line-height: 1.35;
}

.movie-card-compact h3 {
    font-size: 15px;
}

.movie-card p {
    min-height: 52px;
    margin: 0;
    color: #a8b5c8;
    font-size: 14px;
    line-height: 1.7;
}

.movie-card-compact p {
    display: none;
}

.card-bottom {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 14px;
    color: var(--muted);
    font-size: 13px;
}

.score {
    color: #facc15;
    font-weight: 800;
}

.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 12px;
}

.card-tags span,
.tag-list span {
    border: 1px solid rgba(34, 211, 238, 0.24);
    border-radius: 999px;
    color: #a5f3fc;
    background: rgba(34, 211, 238, 0.08);
    padding: 5px 9px;
    font-size: 12px;
}

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

.category-card {
    position: relative;
    overflow: hidden;
    min-height: 190px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 24px;
    background:
        linear-gradient(135deg, rgba(34, 211, 238, 0.13), rgba(59, 130, 246, 0.05)),
        rgba(15, 23, 42, 0.72);
    padding: 22px;
    transition: transform 0.22s ease, border-color 0.22s ease;
}

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

.category-card h2,
.category-card h3 {
    margin: 0 0 12px;
    color: var(--white);
}

.category-card p {
    color: var(--muted);
    line-height: 1.75;
}

.category-card span {
    color: var(--cyan);
    font-weight: 800;
}

.page-title {
    margin-bottom: 30px;
}

.page-title h1 {
    font-size: clamp(32px, 4vw, 54px);
}

.catalog-controls {
    display: grid;
    grid-template-columns: 1.3fr 0.7fr 0.7fr auto;
    gap: 12px;
    margin: 26px 0 28px;
    padding: 16px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 22px;
    background: rgba(15, 23, 42, 0.62);
}

.breadcrumb {
    margin-bottom: 20px;
    color: #94a3b8;
    font-size: 14px;
}

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

.detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.55fr);
    gap: 34px;
    align-items: start;
}

.player-card,
.detail-side,
.content-panel,
.ranking-row {
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 24px;
    background: rgba(15, 23, 42, 0.72);
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.24);
}

.player-wrap {
    position: relative;
    overflow: hidden;
    border-radius: 24px;
    background: #000;
}

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

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

.play-overlay.is-hidden {
    display: none;
}

.play-overlay-inner {
    display: grid;
    place-items: center;
    gap: 12px;
    text-align: center;
}

.play-overlay-icon {
    display: grid;
    width: 76px;
    height: 76px;
    place-items: center;
    border-radius: 999px;
    color: #07111f;
    background: linear-gradient(135deg, var(--cyan), var(--blue));
    box-shadow: 0 18px 48px rgba(34, 211, 238, 0.28);
    font-size: 28px;
}

.detail-main h1 {
    margin-top: 22px;
    font-size: clamp(30px, 4vw, 48px);
}

.detail-main .lead {
    color: #cbd5e1;
    font-size: 17px;
    line-height: 1.85;
}

.detail-meta {
    margin: 18px 0 20px;
}

.detail-side {
    overflow: hidden;
}

.detail-side img {
    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
}

.detail-side-body {
    padding: 20px;
}

.detail-side-body h2 {
    margin: 0 0 12px;
    color: var(--white);
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.content-panel {
    margin-top: 26px;
    padding: 26px;
}

.content-panel h2 {
    margin: 0 0 14px;
    color: var(--white);
}

.content-panel p {
    color: #cbd5e1;
    line-height: 1.95;
}

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

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

.ranking-row {
    display: grid;
    grid-template-columns: 86px 92px minmax(0, 1fr) auto;
    gap: 18px;
    align-items: center;
    padding: 14px;
}

.ranking-number {
    display: grid;
    width: 54px;
    height: 54px;
    place-items: center;
    border-radius: 16px;
    color: #111827;
    background: linear-gradient(135deg, #fde047, #fb923c);
    font-size: 22px;
    font-weight: 900;
}

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

.ranking-row h2 {
    margin: 0 0 8px;
    color: var(--white);
    font-size: 20px;
}

.ranking-row p {
    margin: 0;
    color: var(--muted);
    line-height: 1.7;
}

.empty-state {
    display: none;
    margin-top: 20px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 20px;
    color: var(--muted);
    background: rgba(15, 23, 42, 0.62);
    padding: 24px;
    text-align: center;
}

.empty-state.is-visible {
    display: block;
}

.pager-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 14px;
    margin-top: 26px;
}

.pager-links a {
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 999px;
    color: #dbeafe;
    background: rgba(15, 23, 42, 0.74);
    padding: 11px 16px;
    font-weight: 800;
}

@media (max-width: 1120px) {
    .movie-grid,
    .related-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

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

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

    .hero-poster {
        display: none;
    }
}

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

    .nav-toggle {
        display: inline-grid;
        place-items: center;
    }

    .hero-slider,
    .hero-track {
        min-height: 620px;
    }

    .hero-slide {
        padding: 34px 24px 70px;
    }

    .hero-dots {
        left: 24px;
        bottom: 24px;
    }

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

    .catalog-controls {
        grid-template-columns: 1fr;
    }

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

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

@media (max-width: 540px) {
    .header-inner,
    .page-shell,
    .home-shell,
    .mobile-nav {
        width: min(100% - 22px, 1240px);
    }

    .home-shell,
    .page-shell {
        padding-bottom: 54px;
    }

    .hero-content h1,
    .hero-content h2 {
        font-size: 34px;
    }

    .hero-search,
    .mobile-nav form {
        flex-direction: column;
    }

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

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

    .ranking-row {
        grid-template-columns: 1fr;
    }

    .ranking-number {
        width: 48px;
        height: 48px;
    }

    .ranking-row img {
        width: 100%;
        max-width: 160px;
    }
}