:root {
    --bg: #020617;
    --panel: #0f172a;
    --panel-soft: #111c32;
    --line: rgba(148, 163, 184, 0.18);
    --text: #e2e8f0;
    --muted: #94a3b8;
    --muted-strong: #cbd5e1;
    --brand: #34d399;
    --brand-deep: #10b981;
    --accent: #22d3ee;
    --gold: #facc15;
    --danger: #fb7185;
    --shadow: 0 24px 70px rgba(0, 0, 0, 0.36);
    --radius: 22px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: var(--text);
    background:
        radial-gradient(circle at 18% 12%, rgba(16, 185, 129, 0.12), transparent 28rem),
        radial-gradient(circle at 82% 4%, rgba(34, 211, 238, 0.12), transparent 30rem),
        linear-gradient(180deg, #020617 0%, #0f172a 46%, #020617 100%);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

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

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

button,
input,
select {
    font: inherit;
}

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

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

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

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

.logo-mark {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--brand), var(--accent));
    color: #001a19;
    box-shadow: 0 14px 34px rgba(16, 185, 129, 0.24);
}

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

.nav-links a,
.mobile-panel a {
    color: var(--muted-strong);
    padding: 10px 14px;
    border-radius: 999px;
    transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.nav-links a:hover,
.mobile-panel a:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-1px);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

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

.search-pill {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    border: 1px solid rgba(52, 211, 153, 0.28);
    border-radius: 999px;
    color: #dffcf3;
    background: rgba(16, 185, 129, 0.12);
}

.mobile-panel {
    display: none;
    border-top: 1px solid var(--line);
    padding: 12px 0 18px;
}

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

.hero-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.85s ease, visibility 0.85s ease;
}

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

.hero-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    transform: scale(1.04);
    transition: transform 6s ease;
}

.hero-slide.is-active .hero-bg {
    transform: scale(1.01);
}

.hero-bg::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(2, 6, 23, 0.94) 0%, rgba(2, 6, 23, 0.74) 42%, rgba(2, 6, 23, 0.24) 100%),
        linear-gradient(0deg, #020617 0%, rgba(2, 6, 23, 0) 38%);
}

.hero-content {
    position: relative;
    z-index: 2;
    min-height: 78vh;
    display: grid;
    align-items: center;
    padding: 90px 0 120px;
}

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

.hero-kicker {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
    padding: 8px 14px;
    border: 1px solid rgba(52, 211, 153, 0.35);
    border-radius: 999px;
    color: #b7f7e3;
    background: rgba(16, 185, 129, 0.14);
}

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

.hero h2 {
    margin: 16px 0 16px;
    font-size: clamp(32px, 5vw, 62px);
    line-height: 1.05;
    letter-spacing: -0.05em;
}

.hero p {
    max-width: 680px;
    margin: 0 0 26px;
    color: var(--muted-strong);
    font-size: clamp(16px, 2vw, 21px);
}

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

.badge,
.meta-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 11px;
    border-radius: 999px;
    color: #d8f7ef;
    background: rgba(15, 23, 42, 0.68);
    border: 1px solid rgba(148, 163, 184, 0.18);
    font-size: 13px;
}

.badge.brand {
    color: #022c22;
    background: linear-gradient(135deg, var(--brand), var(--accent));
    border-color: transparent;
    font-weight: 800;
}

.hero-buttons,
.section-head,
.filter-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 46px;
    padding: 0 20px;
    border: 1px solid transparent;
    border-radius: 999px;
    color: #022c22;
    font-weight: 800;
    background: linear-gradient(135deg, var(--brand), var(--accent));
    box-shadow: 0 18px 45px rgba(16, 185, 129, 0.22);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 22px 55px rgba(16, 185, 129, 0.34);
}

.btn.ghost {
    color: var(--text);
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--line);
    box-shadow: none;
}

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

.hero-dots button {
    width: 12px;
    height: 12px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.32);
    transition: width 0.25s ease, background 0.25s ease;
}

.hero-dots button.is-active {
    width: 36px;
    background: var(--brand);
}

.section {
    padding: 72px 0;
}

.section.compact {
    padding: 46px 0;
}

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

.section-subtitle {
    margin: 0;
    color: var(--muted);
}

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

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

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

.movie-card {
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.88), rgba(15, 23, 42, 0.62));
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.18);
    transition: transform 0.24s ease, border-color 0.24s ease, box-shadow 0.24s ease;
}

.movie-card:hover {
    transform: translateY(-6px);
    border-color: rgba(52, 211, 153, 0.42);
    box-shadow: var(--shadow);
}

.card-media {
    position: relative;
    display: block;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #0b1220;
}

.card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.55s ease, opacity 0.3s ease;
}

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

.card-media::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(2, 6, 23, 0.78), rgba(2, 6, 23, 0.04));
}

.play-badge {
    position: absolute;
    z-index: 2;
    left: 50%;
    top: 50%;
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    color: #022c22;
    background: rgba(52, 211, 153, 0.9);
    transform: translate(-50%, -50%) scale(0.82);
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

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

.card-body {
    padding: 18px;
}

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

.card-body p {
    display: -webkit-box;
    min-height: 46px;
    margin: 0;
    overflow: hidden;
    color: var(--muted);
    font-size: 14px;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.category-card {
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background:
        radial-gradient(circle at top right, rgba(34, 211, 238, 0.15), transparent 13rem),
        linear-gradient(180deg, rgba(15, 23, 42, 0.92), rgba(15, 23, 42, 0.58));
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.category-card:hover {
    transform: translateY(-4px);
    border-color: rgba(52, 211, 153, 0.42);
}

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

.category-card p {
    margin: 0 0 18px;
    color: var(--muted);
}

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

.rank-item {
    display: grid;
    grid-template-columns: 64px 112px 1fr auto;
    gap: 18px;
    align-items: center;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: rgba(15, 23, 42, 0.64);
    transition: background 0.2s ease, transform 0.2s ease;
}

.rank-item:hover {
    background: rgba(30, 41, 59, 0.82);
    transform: translateX(4px);
}

.rank-no {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 16px;
    color: #022c22;
    background: linear-gradient(135deg, var(--gold), var(--brand));
    font-weight: 900;
}

.rank-cover {
    aspect-ratio: 16 / 10;
    overflow: hidden;
    border-radius: 14px;
    background: #0b1220;
}

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

.rank-title {
    margin: 0 0 6px;
    font-size: 18px;
}

.page-hero {
    padding: 70px 0 42px;
    border-bottom: 1px solid var(--line);
    background:
        radial-gradient(circle at 20% 20%, rgba(52, 211, 153, 0.14), transparent 24rem),
        radial-gradient(circle at 80% 0%, rgba(34, 211, 238, 0.12), transparent 24rem);
}

.page-hero p {
    max-width: 760px;
    margin: 16px 0 0;
    color: var(--muted-strong);
    font-size: 18px;
}

.filter-bar {
    margin: 0 0 26px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: rgba(15, 23, 42, 0.6);
}

.filter-bar input,
.filter-bar select {
    min-height: 44px;
    border: 1px solid var(--line);
    border-radius: 14px;
    color: var(--text);
    background: rgba(2, 6, 23, 0.66);
    padding: 0 14px;
    outline: none;
}

.filter-bar input {
    flex: 1 1 260px;
}

.filter-bar select {
    flex: 0 0 160px;
}

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

.breadcrumb a {
    color: #b7f7e3;
}

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

.player-card,
.detail-panel,
.side-panel {
    border: 1px solid var(--line);
    border-radius: 24px;
    background: rgba(15, 23, 42, 0.7);
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.2);
}

.player-card {
    overflow: hidden;
}

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

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

.player-overlay {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    cursor: pointer;
    background-size: cover;
    background-position: center;
    transition: opacity 0.22s ease, visibility 0.22s ease;
}

.player-overlay::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(2, 6, 23, 0.82), rgba(2, 6, 23, 0.22));
}

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

.player-button {
    position: relative;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 86px;
    height: 86px;
    border: 0;
    border-radius: 50%;
    color: #022c22;
    background: linear-gradient(135deg, var(--brand), var(--accent));
    box-shadow: 0 26px 70px rgba(16, 185, 129, 0.36);
    transition: transform 0.2s ease;
}

.player-button:hover {
    transform: scale(1.06);
}

.player-caption {
    padding: 18px 20px;
    color: var(--muted-strong);
}

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

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

.detail-panel p {
    margin: 0 0 18px;
    color: var(--muted-strong);
}

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

.tag-list span {
    padding: 6px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: #cff8ec;
    background: rgba(16, 185, 129, 0.1);
    font-size: 13px;
}

.side-panel {
    padding: 20px;
}

.side-movie {
    display: grid;
    grid-template-columns: 92px 1fr;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
}

.side-movie:last-child {
    border-bottom: 0;
}

.side-movie img {
    width: 92px;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    border-radius: 12px;
    background: #0b1220;
}

.side-movie h3 {
    margin: 0 0 6px;
    font-size: 15px;
    line-height: 1.32;
}

.side-movie p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

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

.footer-inner {
    display: grid;
    grid-template-columns: 1.2fr repeat(3, 1fr);
    gap: 28px;
    padding: 42px 0;
}

.footer h2,
.footer h3 {
    margin: 0 0 12px;
    font-size: 18px;
}

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

.footer a {
    display: block;
    margin: 8px 0;
}

.footer-bottom {
    padding: 18px 0 34px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    text-align: center;
}

.empty-state {
    display: none;
    padding: 36px;
    border: 1px dashed var(--line);
    border-radius: 22px;
    color: var(--muted);
    text-align: center;
}

@media (max-width: 1024px) {
    .movie-grid,
    .movie-grid.three,
    .movie-grid.category-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

    .footer-inner {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 760px) {
    .nav-links,
    .search-pill {
        display: none;
    }

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

    .mobile-panel.is-open {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 6px;
    }

    .hero,
    .hero-content {
        min-height: 72vh;
    }

    .hero-content {
        padding: 64px 0 100px;
    }

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

    .rank-item {
        grid-template-columns: 46px 92px 1fr;
    }

    .rank-item .btn {
        grid-column: 1 / -1;
    }

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