:root {
    color-scheme: dark;
    --page-bg: #020617;
    --panel-bg: rgba(15, 23, 42, 0.82);
    --panel-strong: #0f172a;
    --line: rgba(148, 163, 184, 0.22);
    --text: #f8fafc;
    --muted: #94a3b8;
    --soft: #cbd5e1;
    --cyan: #22d3ee;
    --blue: #3b82f6;
    --green: #34d399;
    --purple: #a78bfa;
    --shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

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

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

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

button,
input,
select {
    font: inherit;
}

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

.nav-shell,
.container {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
}

.nav-shell {
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.brand-mark {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--blue), var(--cyan));
    color: #fff;
    box-shadow: 0 16px 40px rgba(34, 211, 238, 0.26);
}

.brand-name {
    font-size: 1.25rem;
    background: linear-gradient(90deg, #60a5fa, #22d3ee);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
}

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

.nav-link {
    display: inline-flex;
    align-items: center;
    padding: 10px 14px;
    border-radius: 12px;
    color: #dbeafe;
    transition: 0.2s ease;
}

.nav-link:hover,
.nav-link.is-active {
    color: #fff;
    background: rgba(51, 65, 85, 0.88);
}

.mobile-menu-button {
    display: none;
    border: 0;
    border-radius: 12px;
    padding: 10px 12px;
    color: var(--text);
    background: rgba(30, 41, 59, 0.8);
    cursor: pointer;
}

.mobile-nav {
    display: none;
    border-top: 1px solid var(--line);
    padding: 12px 16px 18px;
    background: rgba(15, 23, 42, 0.96);
}

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

.page-main {
    min-height: calc(100vh - 72px);
}

.hero-section {
    position: relative;
    margin-bottom: 72px;
    overflow: hidden;
}

.hero-carousel {
    position: relative;
    min-height: 620px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

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

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

.hero-image {
    position: absolute;
    inset: 0;
}

.hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.74;
}

.hero-image::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(2, 6, 23, 0.96), rgba(2, 6, 23, 0.68) 48%, rgba(2, 6, 23, 0.35)),
        linear-gradient(0deg, #020617 0%, transparent 36%, rgba(2, 6, 23, 0.42) 100%);
}

.hero-content {
    position: relative;
    z-index: 2;
    width: min(1180px, calc(100% - 32px));
    min-height: 620px;
    margin: 0 auto;
    display: grid;
    align-items: center;
    padding: 92px 0 84px;
}

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

.eyebrow,
.section-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--cyan);
    font-size: 0.84rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.hero-copy h1,
.hero-copy h2 {
    margin: 16px 0 20px;
    font-size: clamp(2.45rem, 7vw, 5.35rem);
    line-height: 0.98;
    letter-spacing: -0.06em;
}

.hero-title-small {
    display: block;
    margin-bottom: 10px;
    font-size: clamp(1.2rem, 2.4vw, 2rem);
    color: #a5f3fc;
    letter-spacing: 0;
}

.hero-copy p {
    max-width: 720px;
    color: #dbeafe;
    font-size: clamp(1rem, 1.8vw, 1.2rem);
    line-height: 1.8;
}

.hero-meta,
.card-meta,
.detail-meta,
.rank-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    color: var(--soft);
}

.meta-pill,
.tag-pill {
    display: inline-flex;
    align-items: center;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 999px;
    padding: 6px 10px;
    background: rgba(15, 23, 42, 0.58);
    color: #dbeafe;
    font-size: 0.86rem;
}

.hero-actions,
.section-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
    margin-top: 28px;
}

.btn-primary,
.btn-secondary,
.btn-soft {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 44px;
    border-radius: 999px;
    padding: 0 22px;
    font-weight: 800;
    transition: 0.22s ease;
}

.btn-primary {
    color: #fff;
    background: linear-gradient(90deg, var(--cyan), var(--blue));
    box-shadow: 0 18px 46px rgba(34, 211, 238, 0.22);
}

.btn-primary:hover,
.btn-secondary:hover,
.btn-soft:hover {
    transform: translateY(-2px) scale(1.02);
}

.btn-secondary {
    color: #e0f2fe;
    border: 1px solid rgba(34, 211, 238, 0.42);
    background: rgba(8, 47, 73, 0.48);
}

.btn-soft {
    color: #e2e8f0;
    border: 1px solid rgba(148, 163, 184, 0.26);
    background: rgba(15, 23, 42, 0.78);
}

.hero-control {
    position: absolute;
    z-index: 4;
    top: 50%;
    width: 46px;
    height: 46px;
    border: 0;
    border-radius: 999px;
    color: #fff;
    background: rgba(0, 0, 0, 0.42);
    backdrop-filter: blur(10px);
    cursor: pointer;
    transform: translateY(-50%);
    transition: 0.2s ease;
}

.hero-control:hover {
    background: rgba(0, 0, 0, 0.72);
}

.hero-control.prev {
    left: max(16px, calc((100vw - 1180px) / 2 - 64px));
}

.hero-control.next {
    right: max(16px, calc((100vw - 1180px) / 2 - 64px));
}

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

.hero-dot {
    width: 10px;
    height: 10px;
    border: 0;
    border-radius: 999px;
    background: rgba(226, 232, 240, 0.38);
    cursor: pointer;
}

.hero-dot.is-active {
    width: 30px;
    background: var(--cyan);
}

.section-block {
    margin: 72px 0;
}

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

.section-heading h2,
.section-heading h1,
.detail-content h1 {
    margin: 0;
    font-size: clamp(1.7rem, 3vw, 2.55rem);
    line-height: 1.1;
}

.section-heading p,
.category-intro,
.page-intro {
    max-width: 760px;
    color: var(--muted);
    line-height: 1.8;
}

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

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

.movie-card {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.94), rgba(15, 23, 42, 0.72));
    box-shadow: 0 16px 42px rgba(0, 0, 0, 0.2);
    transition: transform 0.24s ease, border-color 0.24s ease, box-shadow 0.24s ease;
}

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

.poster-wrap {
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.96), rgba(8, 47, 73, 0.88));
}

.poster-wrap.tall {
    aspect-ratio: 3 / 4;
}

.poster-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s ease, opacity 0.35s ease;
}

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

.poster-overlay {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    opacity: 0;
    background: linear-gradient(0deg, rgba(2, 6, 23, 0.9), rgba(2, 6, 23, 0.18));
    transition: opacity 0.22s ease;
}

.movie-card:hover .poster-overlay {
    opacity: 1;
}

.play-badge,
.large-play {
    display: grid;
    place-items: center;
    border-radius: 999px;
    color: #fff;
    background: linear-gradient(135deg, var(--cyan), var(--blue));
    box-shadow: 0 16px 36px rgba(34, 211, 238, 0.25);
}

.play-badge {
    width: 54px;
    height: 54px;
    font-size: 1.25rem;
}

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

.movie-card h3 {
    margin: 0 0 10px;
    font-size: 1.05rem;
    line-height: 1.35;
}

.movie-card p {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 0.93rem;
    line-height: 1.62;
}

.line-clamp-2 {
    display: -webkit-box;
    overflow: hidden;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.line-clamp-3 {
    display: -webkit-box;
    overflow: hidden;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

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

.category-tile {
    position: relative;
    min-height: 154px;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 22px;
    padding: 22px;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.96), rgba(8, 47, 73, 0.72));
    transition: 0.22s ease;
}

.category-tile::before {
    content: "";
    position: absolute;
    top: -42px;
    right: -42px;
    width: 110px;
    height: 110px;
    border-radius: 999px;
    background: rgba(34, 211, 238, 0.15);
}

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

.category-tile h3 {
    position: relative;
    margin: 0 0 10px;
    font-size: 1.25rem;
}

.category-tile p {
    position: relative;
    margin: 0;
    color: var(--muted);
    line-height: 1.65;
}

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

.rank-row {
    display: grid;
    grid-template-columns: 58px 96px 1fr auto;
    gap: 18px;
    align-items: center;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 18px;
    padding: 12px;
    background: rgba(15, 23, 42, 0.72);
    transition: 0.2s ease;
}

.rank-row:hover {
    border-color: rgba(34, 211, 238, 0.42);
    transform: translateX(3px);
}

.rank-number {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 14px;
    color: #fff;
    font-weight: 900;
    background: linear-gradient(135deg, #0ea5e9, #22d3ee);
}

.rank-thumb {
    width: 96px;
    height: 62px;
    overflow: hidden;
    border-radius: 14px;
    background: #0f172a;
}

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

.rank-title h3 {
    margin: 0 0 8px;
    font-size: 1.05rem;
}

.rank-score {
    color: #fbbf24;
    font-weight: 900;
}

.filters {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) 220px 220px;
    gap: 14px;
    margin: 28px 0;
}

.search-input,
.filter-select {
    width: 100%;
    min-height: 48px;
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 14px;
    padding: 0 16px;
    color: #e2e8f0;
    outline: 0;
    background: rgba(15, 23, 42, 0.88);
}

.search-input:focus,
.filter-select:focus {
    border-color: rgba(34, 211, 238, 0.58);
    box-shadow: 0 0 0 4px rgba(34, 211, 238, 0.1);
}

.empty-state {
    display: none;
    border: 1px dashed rgba(148, 163, 184, 0.28);
    border-radius: 20px;
    padding: 34px;
    color: var(--muted);
    text-align: center;
    background: rgba(15, 23, 42, 0.58);
}

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

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 28px 0;
    color: var(--muted);
    font-size: 0.94rem;
}

.breadcrumb a {
    color: #67e8f9;
}

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

.detail-content,
.detail-sidebar,
.content-card {
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 24px;
    background: rgba(15, 23, 42, 0.76);
    box-shadow: var(--shadow);
}

.detail-content {
    overflow: hidden;
}

.player-panel {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    background: #020617;
}

.player-panel video {
    width: 100%;
    height: 100%;
    display: block;
    background: #020617;
}

.player-cover {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    gap: 14px;
    border: 0;
    color: #fff;
    background:
        linear-gradient(0deg, rgba(2, 6, 23, 0.8), rgba(2, 6, 23, 0.22)),
        rgba(2, 6, 23, 0.25);
    cursor: pointer;
    transition: opacity 0.24s ease, visibility 0.24s ease;
}

.player-cover.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.large-play {
    width: 82px;
    height: 82px;
    font-size: 1.8rem;
}

.player-cover strong {
    font-size: 1.08rem;
}

.player-error {
    position: absolute;
    left: 18px;
    right: 18px;
    bottom: 18px;
    border: 1px solid rgba(248, 113, 113, 0.42);
    border-radius: 14px;
    padding: 12px 14px;
    color: #fecaca;
    background: rgba(127, 29, 29, 0.82);
}

.detail-body {
    padding: 26px;
}

.detail-body h1 {
    margin: 12px 0 16px;
}

.detail-body h2,
.detail-sidebar h2,
.content-card h2 {
    margin: 0 0 14px;
    font-size: 1.35rem;
}

.detail-body p,
.content-card p {
    color: #cbd5e1;
    line-height: 1.9;
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.detail-sidebar {
    padding: 18px;
}

.side-poster {
    overflow: hidden;
    border-radius: 20px;
    background: #020617;
}

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

.info-list {
    display: grid;
    gap: 10px;
    margin: 18px 0;
    color: #dbeafe;
}

.info-list span {
    color: var(--muted);
}

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

.related-card {
    display: grid;
    grid-template-columns: 84px 1fr;
    gap: 12px;
    align-items: center;
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 16px;
    padding: 10px;
    background: rgba(2, 6, 23, 0.28);
    transition: 0.2s ease;
}

.related-card:hover {
    border-color: rgba(34, 211, 238, 0.38);
}

.related-card img {
    width: 84px;
    height: 58px;
    border-radius: 12px;
    object-fit: cover;
}

.related-card h3 {
    margin: 0 0 8px;
    font-size: 0.98rem;
}

.related-card p {
    margin: 0;
    color: var(--muted);
    font-size: 0.86rem;
}

.footer {
    margin-top: 90px;
    border-top: 1px solid rgba(148, 163, 184, 0.16);
    background: rgba(2, 6, 23, 0.62);
}

.footer-inner {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 34px 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    color: var(--muted);
}

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

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

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

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

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

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

    .mobile-menu-button {
        display: inline-flex;
    }

    .hero-carousel,
    .hero-content {
        min-height: 560px;
    }

    .hero-control {
        display: none;
    }

    .section-heading {
        display: grid;
    }

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

    .filters {
        grid-template-columns: 1fr;
    }

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

    .rank-score {
        grid-column: 3;
    }

    .rank-thumb {
        width: 72px;
        height: 52px;
    }

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

@media (max-width: 520px) {
    .nav-shell,
    .container,
    .hero-content,
    .footer-inner {
        width: min(100% - 22px, 1180px);
    }

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

    .hero-copy h1,
    .hero-copy h2 {
        font-size: 2.35rem;
    }

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

    .rank-thumb {
        display: none;
    }

    .rank-score {
        grid-column: 2;
    }
}
