:root {
    color-scheme: dark;
    --bg: #020617;
    --bg-soft: #0f172a;
    --bg-card: rgba(15, 23, 42, 0.78);
    --bg-card-strong: rgba(15, 23, 42, 0.94);
    --line: rgba(148, 163, 184, 0.18);
    --text: #f8fafc;
    --muted: #94a3b8;
    --soft: #cbd5e1;
    --brand: #4f46e5;
    --brand-strong: #6366f1;
    --brand-soft: rgba(79, 70, 229, 0.16);
    --shadow: 0 24px 60px rgba(2, 6, 23, 0.35);
    --radius-lg: 28px;
    --radius-md: 18px;
    --radius-sm: 12px;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background:
        radial-gradient(circle at 15% 0%, rgba(79, 70, 229, 0.28), transparent 34rem),
        linear-gradient(180deg, #020617 0%, #0f172a 45%, #020617 100%);
    color: var(--text);
    min-height: 100vh;
}

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

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

button,
input,
select {
    font: inherit;
}

button {
    cursor: pointer;
}

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

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

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

.brand-mark {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--brand), #8b5cf6);
    box-shadow: 0 16px 40px rgba(79, 70, 229, 0.36);
    font-size: 15px;
}

.brand-text {
    font-size: 19px;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-link,
.nav-more-button {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid transparent;
    color: var(--soft);
    background: transparent;
    transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.nav-link:hover,
.nav-link.active,
.nav-more:hover .nav-more-button {
    color: #ffffff;
    background: rgba(79, 70, 229, 0.18);
    border-color: rgba(129, 140, 248, 0.28);
}

.nav-more {
    position: relative;
}

.nav-panel {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    width: 210px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.96);
    box-shadow: var(--shadow);
    display: none;
}

.nav-more:hover .nav-panel,
.nav-more:focus-within .nav-panel {
    display: grid;
    gap: 4px;
}

.nav-panel a {
    padding: 10px 12px;
    border-radius: 12px;
    color: var(--soft);
}

.nav-panel a:hover {
    color: #ffffff;
    background: rgba(79, 70, 229, 0.18);
}

.menu-toggle {
    display: none;
    width: 42px;
    height: 42px;
    border-radius: 14px;
    color: #ffffff;
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid var(--line);
}

.hero {
    position: relative;
    height: 600px;
    overflow: hidden;
    background: #020617;
}

.hero-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.9s ease;
}

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

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

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

.hero-image::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(2, 6, 23, 0.94), rgba(2, 6, 23, 0.58), rgba(2, 6, 23, 0.16)),
        linear-gradient(0deg, #020617 0%, rgba(2, 6, 23, 0.28) 52%, transparent 100%);
}

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

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

.hero-badge,
.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 18px;
    padding: 8px 14px;
    border: 1px solid rgba(129, 140, 248, 0.36);
    border-radius: 999px;
    color: #ffffff;
    background: rgba(79, 70, 229, 0.72);
    box-shadow: 0 12px 36px rgba(79, 70, 229, 0.22);
    backdrop-filter: blur(10px);
}

.hero h1,
.page-hero h1,
.detail-title h1 {
    margin: 0;
    font-size: clamp(34px, 6vw, 62px);
    line-height: 1.06;
    letter-spacing: -0.04em;
}

.hero p,
.page-hero p,
.detail-title p {
    margin: 18px 0 0;
    color: var(--soft);
    font-size: clamp(16px, 2vw, 20px);
    line-height: 1.75;
}

.hero-meta,
.detail-meta,
.movie-meta-line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    color: var(--muted);
}

.hero-meta {
    margin-top: 18px;
}

.hero-meta span,
.movie-meta-line span,
.detail-meta span {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.76);
    border: 1px solid var(--line);
}

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

.btn-primary,
.btn-secondary,
.btn-ghost,
.section-more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 18px;
    border-radius: 14px;
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.btn-primary {
    color: #ffffff;
    background: linear-gradient(135deg, var(--brand), #7c3aed);
    box-shadow: 0 18px 46px rgba(79, 70, 229, 0.32);
}

.btn-secondary,
.section-more {
    color: #ffffff;
    background: rgba(15, 23, 42, 0.76);
    border: 1px solid rgba(148, 163, 184, 0.24);
}

.btn-ghost {
    color: var(--soft);
    border: 1px solid rgba(148, 163, 184, 0.24);
}

.btn-primary:hover,
.btn-secondary:hover,
.btn-ghost:hover,
.section-more:hover {
    transform: translateY(-2px);
    border-color: rgba(129, 140, 248, 0.46);
}

.hero-controls {
    position: absolute;
    z-index: 4;
    right: max(24px, calc((100vw - 1180px) / 2));
    bottom: 74px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.hero-arrow,
.hero-dot {
    border: 1px solid rgba(255, 255, 255, 0.22);
    color: #ffffff;
    background: rgba(15, 23, 42, 0.72);
    backdrop-filter: blur(10px);
}

.hero-arrow {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 24px;
}

.hero-dots {
    display: flex;
    gap: 8px;
}

.hero-dot {
    width: 12px;
    height: 12px;
    padding: 0;
    border-radius: 50%;
    opacity: 0.58;
}

.hero-dot.is-active {
    opacity: 1;
    background: #ffffff;
}

.hero-search {
    width: min(620px, 100%);
    display: flex;
    gap: 10px;
    margin-top: 24px;
    padding: 8px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.76);
    backdrop-filter: blur(14px);
}

.hero-search input,
.filter-panel input,
.filter-panel select {
    width: 100%;
    border: 1px solid rgba(148, 163, 184, 0.2);
    outline: none;
    color: var(--text);
    background: rgba(2, 6, 23, 0.62);
}

.hero-search input {
    min-height: 46px;
    padding: 0 14px;
    border-radius: 14px;
}

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

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

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

.section-heading span {
    color: var(--brand-strong);
    font-weight: 700;
}

.section-heading h2 {
    margin: 6px 0 0;
    font-size: clamp(26px, 4vw, 40px);
    letter-spacing: -0.03em;
}

.section-heading p {
    max-width: 720px;
    margin: 10px 0 0;
    color: var(--muted);
    line-height: 1.75;
}

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

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

.movie-card:hover {
    transform: translateY(-6px);
    border-color: rgba(129, 140, 248, 0.45);
    background: var(--bg-card-strong);
}

.poster-link {
    position: relative;
    display: block;
    aspect-ratio: 2 / 3;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.22), rgba(15, 23, 42, 0.92));
}

.poster-link img,
.compact-card img,
.ranking-poster img,
.detail-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s ease;
}

.movie-card:hover .poster-link img,
.compact-card:hover img,
.ranking-item:hover .ranking-poster img {
    transform: scale(1.05);
}

.poster-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 5px 9px;
    border-radius: 999px;
    color: #ffffff;
    background: rgba(2, 6, 23, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.18);
    font-size: 12px;
}

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

.movie-meta-line {
    gap: 7px;
    font-size: 12px;
}

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

.movie-card h3 a:hover {
    color: #a5b4fc;
}

.movie-card p {
    min-height: 52px;
    margin: 9px 0 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.65;
}

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

.tag-row span {
    display: inline-flex;
    padding: 4px 8px;
    border-radius: 999px;
    color: #c7d2fe;
    background: rgba(79, 70, 229, 0.14);
    font-size: 12px;
}

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

.category-card {
    min-height: 172px;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background:
        linear-gradient(135deg, rgba(79, 70, 229, 0.22), rgba(15, 23, 42, 0.85)),
        rgba(15, 23, 42, 0.72);
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.category-card:hover {
    transform: translateY(-5px);
    border-color: rgba(129, 140, 248, 0.5);
}

.category-card h3 {
    margin: 0;
    font-size: 22px;
}

.category-card p {
    margin: 12px 0 0;
    color: var(--soft);
    line-height: 1.7;
}

.category-card span {
    display: inline-flex;
    margin-top: 18px;
    color: #c7d2fe;
    font-weight: 700;
}

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

.ranking-item {
    display: grid;
    grid-template-columns: 70px 92px 1fr auto;
    gap: 18px;
    align-items: center;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--bg-card);
}

.rank-number {
    font-size: 26px;
    font-weight: 900;
    color: #c7d2fe;
    text-align: center;
}

.ranking-poster {
    aspect-ratio: 2 / 3;
    overflow: hidden;
    border-radius: 14px;
    background: rgba(79, 70, 229, 0.18);
}

.ranking-info h3 {
    margin: 0;
    font-size: 20px;
}

.ranking-info p {
    margin: 8px 0 0;
    color: var(--muted);
    line-height: 1.65;
}

.page-hero {
    padding: 74px 0 34px;
}

.page-hero-card {
    padding: 34px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background:
        linear-gradient(135deg, rgba(79, 70, 229, 0.18), rgba(2, 6, 23, 0.28)),
        rgba(15, 23, 42, 0.75);
    box-shadow: var(--shadow);
}

.filter-panel {
    display: grid;
    grid-template-columns: 2fr repeat(4, 1fr);
    gap: 14px;
    margin: 26px 0 26px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: rgba(15, 23, 42, 0.74);
}

.filter-panel label {
    display: grid;
    gap: 8px;
    color: var(--muted);
    font-size: 13px;
}

.filter-panel input,
.filter-panel select {
    min-height: 44px;
    padding: 0 12px;
    border-radius: 12px;
}

.empty-state {
    margin: 30px 0;
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    color: var(--soft);
    text-align: center;
    background: rgba(15, 23, 42, 0.72);
}

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

.compact-card {
    display: grid;
    gap: 10px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--bg-card);
}

.compact-card img {
    aspect-ratio: 2 / 3;
    border-radius: 14px;
    background: rgba(79, 70, 229, 0.18);
}

.compact-card span {
    font-weight: 700;
    line-height: 1.35;
}

.compact-card small {
    color: var(--muted);
}

.detail-main {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding-top: 42px;
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    color: var(--muted);
    margin-bottom: 18px;
}

.breadcrumb a:hover {
    color: #ffffff;
}

.detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 330px;
    gap: 30px;
    align-items: start;
}

.watch-panel,
.detail-panel,
.side-panel {
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: rgba(15, 23, 42, 0.78);
    box-shadow: var(--shadow);
}

.watch-panel {
    overflow: hidden;
}

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

.movie-player {
    width: 100%;
    height: 100%;
    background: #000000;
}

.player-overlay {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    gap: 12px;
    border: 0;
    color: #ffffff;
    background:
        linear-gradient(180deg, rgba(2, 6, 23, 0.36), rgba(2, 6, 23, 0.86)),
        transparent;
    text-align: center;
    z-index: 3;
}

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

.play-circle {
    display: grid;
    width: 84px;
    height: 84px;
    place-items: center;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--brand), #7c3aed);
    box-shadow: 0 22px 60px rgba(79, 70, 229, 0.42);
    font-size: 32px;
}

.player-overlay strong {
    font-size: 22px;
}

.detail-title {
    padding: 26px;
}

.detail-meta {
    margin-top: 18px;
}

.detail-panel {
    margin-top: 24px;
    padding: 28px;
}

.detail-panel h2,
.side-panel h2 {
    margin: 0 0 16px;
    font-size: 24px;
}

.detail-panel p {
    margin: 0 0 18px;
    color: var(--soft);
    line-height: 1.9;
}

.detail-cover {
    overflow: hidden;
    border-radius: var(--radius-md);
    aspect-ratio: 2 / 3;
    background: rgba(79, 70, 229, 0.18);
}

.side-panel {
    padding: 18px;
}

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

.side-link {
    display: grid;
    grid-template-columns: 64px 1fr;
    gap: 12px;
    align-items: center;
    padding: 8px;
    border-radius: 14px;
    background: rgba(2, 6, 23, 0.3);
}

.side-link:hover {
    background: rgba(79, 70, 229, 0.18);
}

.side-link img {
    width: 64px;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    border-radius: 10px;
}

.side-link strong {
    display: block;
    line-height: 1.35;
}

.side-link span {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 13px;
}

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

.footer-inner {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 36px 0;
    display: grid;
    grid-template-columns: 1.2fr 2fr;
    gap: 30px;
}

.footer-inner p,
.footer-bottom {
    color: var(--muted);
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

.footer-links a {
    padding: 8px 12px;
    border-radius: 999px;
    color: var(--soft);
    background: rgba(15, 23, 42, 0.72);
    border: 1px solid var(--line);
}

.footer-bottom {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 0 0 30px;
    font-size: 14px;
}

[hidden] {
    display: none !important;
}

@media (max-width: 960px) {
    .menu-toggle {
        display: inline-grid;
        place-items: center;
    }

    .site-nav {
        position: absolute;
        left: 16px;
        right: 16px;
        top: 76px;
        display: none;
        padding: 14px;
        border: 1px solid var(--line);
        border-radius: 20px;
        background: rgba(15, 23, 42, 0.98);
        box-shadow: var(--shadow);
        flex-direction: column;
        align-items: stretch;
    }

    .site-nav.is-open {
        display: flex;
    }

    .nav-more {
        display: none;
    }

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

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

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

    .filter-panel {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .filter-search {
        grid-column: 1 / -1;
    }

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

    .footer-inner {
        grid-template-columns: 1fr;
    }

    .footer-links {
        justify-content: flex-start;
    }
}

@media (max-width: 640px) {
    .hero {
        height: 640px;
    }

    .hero-content {
        align-items: flex-end;
        padding-bottom: 112px;
    }

    .hero-actions,
    .hero-search,
    .section-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .hero-controls {
        left: 16px;
        right: auto;
        bottom: 38px;
    }

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

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

    .ranking-item {
        grid-template-columns: 42px 78px 1fr;
    }

    .ranking-item .btn-secondary {
        grid-column: 2 / -1;
    }

    .page-hero-card,
    .detail-panel,
    .detail-title {
        padding: 22px;
    }
}
