:root {
    color-scheme: dark;
    --bg: #020617;
    --panel: rgba(15, 23, 42, 0.88);
    --panel-soft: rgba(30, 41, 59, 0.66);
    --line: rgba(148, 163, 184, 0.18);
    --text: #f8fafc;
    --muted: #94a3b8;
    --cyan: #22d3ee;
    --cyan-dark: #0891b2;
    --gold: #facc15;
    --danger: #fb7185;
    --shadow: 0 24px 80px rgba(0, 0, 0, 0.36);
    --radius: 24px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at 18% 0%, rgba(34, 211, 238, 0.16), transparent 34rem),
        radial-gradient(circle at 86% 12%, rgba(139, 92, 246, 0.14), transparent 28rem),
        linear-gradient(180deg, #020617 0%, #0f172a 42%, #020617 100%);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

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

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

button,
input,
select {
    font: inherit;
}

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

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

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

.logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 22px;
    font-weight: 900;
    letter-spacing: -0.04em;
}

.logo-mark {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    color: #001018;
    background: linear-gradient(135deg, var(--cyan), #60a5fa);
    box-shadow: 0 0 32px rgba(34, 211, 238, 0.32);
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 18px;
    color: #cbd5e1;
    font-weight: 700;
}

.main-nav a {
    padding: 9px 2px;
    transition: color 0.2s ease;
}

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

.top-search {
    width: min(280px, 30vw);
    display: flex;
    align-items: center;
    border: 1px solid rgba(34, 211, 238, 0.24);
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.9);
    overflow: hidden;
}

.top-search input {
    width: 100%;
    padding: 10px 14px;
    border: 0;
    outline: 0;
    color: var(--text);
    background: transparent;
}

.top-search button {
    border: 0;
    padding: 10px 16px;
    color: #001018;
    background: var(--cyan);
    cursor: pointer;
}

.nav-toggle {
    display: none;
    width: 44px;
    height: 44px;
    border: 1px solid var(--line);
    border-radius: 14px;
    color: var(--text);
    background: rgba(15, 23, 42, 0.8);
}

.hero {
    position: relative;
    min-height: 660px;
    overflow: hidden;
    border-bottom: 1px solid var(--line);
}

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

.hero-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transform: scale(1.02);
    transition: opacity 0.7s ease, transform 1.1s ease;
    background-position: center;
    background-size: cover;
}

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

.hero-content {
    position: relative;
    z-index: 2;
    min-height: 660px;
    display: flex;
    align-items: center;
    padding: 120px 0 84px;
}

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

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    padding: 8px 14px;
    border: 1px solid rgba(34, 211, 238, 0.24);
    border-radius: 999px;
    color: var(--cyan);
    background: rgba(8, 145, 178, 0.12);
    font-size: 14px;
    font-weight: 800;
}

.hero h1,
.page-hero h1,
.detail-title {
    margin: 0;
    font-size: clamp(38px, 7vw, 76px);
    line-height: 0.98;
    letter-spacing: -0.06em;
}

.hero h1 span {
    color: var(--cyan);
}

.hero-lead,
.page-lead {
    width: min(760px, 100%);
    margin: 22px 0 0;
    color: #cbd5e1;
    font-size: clamp(17px, 2vw, 21px);
}

.hero-actions,
.action-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 32px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 12px 18px;
    border: 1px solid transparent;
    border-radius: 999px;
    font-weight: 900;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

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

.btn-primary {
    color: #001018;
    background: linear-gradient(135deg, var(--cyan), #60a5fa);
    box-shadow: 0 18px 40px rgba(34, 211, 238, 0.28);
}

.btn-ghost {
    color: var(--text);
    border-color: rgba(148, 163, 184, 0.24);
    background: rgba(15, 23, 42, 0.64);
}

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

.hero-dot {
    width: 34px;
    height: 4px;
    border: 0;
    border-radius: 999px;
    background: rgba(203, 213, 225, 0.35);
    cursor: pointer;
}

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

.section {
    padding: 68px 0;
}

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

.section-title {
    margin: 0;
    font-size: clamp(26px, 3vw, 40px);
    line-height: 1.15;
    letter-spacing: -0.04em;
}

.section-desc {
    margin: 8px 0 0;
    color: var(--muted);
}

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

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

.movie-card {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: rgba(15, 23, 42, 0.76);
    box-shadow: 0 14px 45px rgba(0, 0, 0, 0.24);
    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.42);
    box-shadow: 0 22px 60px rgba(8, 145, 178, 0.16);
}

.poster-link {
    position: relative;
    display: block;
    aspect-ratio: 4 / 5.7;
    overflow: hidden;
    background: #0f172a;
}

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

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

.poster-badge,
.rank-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 2;
    padding: 5px 10px;
    border-radius: 999px;
    color: #001018;
    background: var(--cyan);
    font-size: 12px;
    font-weight: 900;
}

.card-body {
    padding: 16px;
}

.card-title {
    margin: 0;
    font-size: 18px;
    line-height: 1.25;
}

.card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
    color: var(--muted);
    font-size: 13px;
}

.card-desc {
    margin: 12px 0 0;
    color: #cbd5e1;
    font-size: 14px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

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

.tag {
    padding: 5px 9px;
    border-radius: 999px;
    color: #a5f3fc;
    background: rgba(34, 211, 238, 0.1);
    border: 1px solid rgba(34, 211, 238, 0.18);
    font-size: 12px;
    font-weight: 700;
}

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

.side-panel,
.filter-panel,
.detail-panel,
.category-card,
.rank-row,
.player-panel {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
    box-shadow: var(--shadow);
}

.side-panel {
    position: sticky;
    top: 96px;
    padding: 20px;
}

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

.rank-row {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr);
    gap: 12px;
    padding: 12px;
    box-shadow: none;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.rank-row:hover {
    border-color: rgba(34, 211, 238, 0.36);
    background: rgba(8, 145, 178, 0.1);
}

.rank-thumb {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 16px;
    background: #0f172a;
}

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

.rank-title {
    margin: 0;
    font-weight: 900;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rank-meta {
    margin-top: 4px;
    color: var(--muted);
    font-size: 13px;
}

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

.category-card {
    padding: 22px;
    min-height: 156px;
    box-shadow: none;
    transition: transform 0.22s ease, border-color 0.22s ease, background 0.22s ease;
}

.category-card:hover {
    transform: translateY(-5px);
    border-color: rgba(34, 211, 238, 0.42);
    background: rgba(15, 23, 42, 0.95);
}

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

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

.page-hero {
    padding: 78px 0 42px;
    border-bottom: 1px solid var(--line);
    background:
        linear-gradient(135deg, rgba(8, 145, 178, 0.18), transparent 36%),
        radial-gradient(circle at 82% 0%, rgba(250, 204, 21, 0.12), transparent 30rem);
}

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

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

.filter-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 170px 170px;
    gap: 14px;
    padding: 18px;
    margin-bottom: 28px;
}

.filter-panel input,
.filter-panel select {
    width: 100%;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 16px;
    padding: 12px 14px;
    color: var(--text);
    outline: none;
    background: rgba(2, 6, 23, 0.52);
}

.filter-panel input:focus,
.filter-panel select:focus {
    border-color: var(--cyan);
}

.detail-hero {
    padding: 54px 0 36px;
}

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

.detail-poster {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(15, 23, 42, 0.8);
    box-shadow: var(--shadow);
}

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

.detail-panel {
    padding: 30px;
}

.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
}

.meta-pill {
    padding: 7px 11px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 999px;
    color: #cbd5e1;
    background: rgba(15, 23, 42, 0.64);
    font-size: 13px;
    font-weight: 800;
}

.detail-line {
    margin: 22px 0 0;
    color: #dbeafe;
    font-size: 18px;
}

.player-panel {
    overflow: hidden;
    margin: 18px 0 36px;
}

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

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

.player-layer {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0.72));
    cursor: pointer;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

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

.play-button {
    width: 84px;
    height: 84px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 999px;
    color: #001018;
    background: linear-gradient(135deg, var(--cyan), #60a5fa);
    box-shadow: 0 18px 55px rgba(34, 211, 238, 0.34);
    cursor: pointer;
}

.play-button svg {
    width: 34px;
    height: 34px;
    margin-left: 4px;
}

.content-block {
    margin: 34px 0;
    padding: 26px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(15, 23, 42, 0.62);
}

.content-block h2 {
    margin: 0 0 14px;
    font-size: 26px;
}

.content-block p {
    margin: 0;
    color: #cbd5e1;
    white-space: pre-line;
}

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

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 32px 0;
    color: var(--muted);
    font-size: 14px;
}

.empty-tip {
    display: none;
    padding: 32px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--muted);
    background: rgba(15, 23, 42, 0.62);
    text-align: center;
}

@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));
    }

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

    .side-panel {
        position: static;
    }
}

@media (max-width: 820px) {
    .header-inner {
        flex-wrap: wrap;
        padding: 12px 0;
    }

    .nav-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .main-nav {
        display: none;
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        padding: 14px 0;
    }

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

    .top-search {
        width: 100%;
        order: 3;
    }

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

    .hero-content {
        padding: 92px 0 70px;
    }

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

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

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

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

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

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

@media (max-width: 520px) {
    .page-shell {
        width: min(100% - 22px, 1180px);
    }

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

    .hero h1,
    .page-hero h1,
    .detail-title {
        font-size: 38px;
    }

    .detail-panel,
    .content-block {
        padding: 20px;
    }
}
