:root {
    --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;
    --muted-strong: #cbd5e1;
    --emerald: #10b981;
    --emerald-dark: #059669;
    --cyan: #22d3ee;
    --shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
    --radius: 24px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: Inter, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
    background:
        radial-gradient(circle at top left, rgba(16, 185, 129, 0.18), transparent 28rem),
        radial-gradient(circle at top right, rgba(34, 211, 238, 0.14), transparent 24rem),
        linear-gradient(180deg, #020617 0%, #0f172a 46%, #020617 100%);
    color: var(--text);
    min-height: 100vh;
}

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

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

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

.nav-shell {
    width: min(1240px, calc(100% - 32px));
    margin: 0 auto;
    min-height: 72px;
    display: flex;
    align-items: center;
    gap: 24px;
}

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

.brand-icon {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: linear-gradient(135deg, var(--emerald), var(--cyan));
    border-radius: 999px;
    box-shadow: 0 0 28px rgba(16, 185, 129, 0.35);
}

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

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

.desktop-nav a:hover,
.desktop-nav a.is-active,
.mobile-nav a:hover,
.mobile-nav a.is-active {
    color: #fff;
    background: rgba(16, 185, 129, 0.16);
}

.search-box {
    position: relative;
    width: min(320px, 36vw);
}

.search-box input {
    width: 100%;
    height: 42px;
    border: 1px solid var(--line);
    outline: 0;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.78);
    color: #fff;
    padding: 0 18px;
}

.search-box input:focus {
    border-color: rgba(16, 185, 129, 0.7);
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.12);
}

.search-results {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: min(420px, 92vw);
    max-height: 420px;
    overflow: auto;
    background: rgba(15, 23, 42, 0.98);
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: var(--shadow);
    padding: 10px;
}

.search-result-item {
    display: grid;
    grid-template-columns: 58px 1fr;
    gap: 12px;
    padding: 10px;
    border-radius: 14px;
    transition: background 0.2s ease;
}

.search-result-item:hover {
    background: rgba(148, 163, 184, 0.12);
}

.search-result-item img {
    width: 58px;
    height: 78px;
    object-fit: cover;
    border-radius: 10px;
    background: #111827;
}

.search-result-item strong {
    display: block;
    margin-bottom: 6px;
}

.search-result-item small {
    color: var(--muted);
}

.mobile-menu-button {
    display: none;
    width: 42px;
    height: 42px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.8);
    color: #fff;
    font-size: 22px;
}

.mobile-nav {
    width: min(1240px, calc(100% - 32px));
    margin: 0 auto 16px;
    display: grid;
    gap: 8px;
}

.hero-carousel {
    position: relative;
    height: min(80vh, 760px);
    min-height: 560px;
    overflow: hidden;
    background: #020617;
}

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

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

.hero-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.02);
}

.hero-shade {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(2, 6, 23, 0.9) 0%, rgba(2, 6, 23, 0.58) 46%, rgba(2, 6, 23, 0.18) 100%),
        linear-gradient(0deg, #020617 0%, rgba(2, 6, 23, 0.58) 34%, transparent 100%);
}

.hero-content {
    position: absolute;
    left: max(24px, calc((100% - 1240px) / 2));
    bottom: 90px;
    width: min(720px, calc(100% - 48px));
}

.hero-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    color: #fff;
    background: rgba(16, 185, 129, 0.88);
    border-radius: 999px;
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 18px;
}

.hero-content h1,
.detail-info h1 {
    margin: 0 0 18px;
    font-size: clamp(36px, 6vw, 72px);
    line-height: 1.03;
    letter-spacing: -0.04em;
}

.hero-content p,
.detail-info p,
.page-hero p {
    color: var(--muted-strong);
    font-size: clamp(17px, 2vw, 22px);
    line-height: 1.8;
    margin: 0 0 26px;
}

.hero-actions,
.detail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

.primary-button,
.ghost-button,
.section-more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 22px;
    border-radius: 999px;
    font-weight: 800;
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.primary-button {
    background: var(--emerald);
    color: #fff;
    box-shadow: 0 18px 36px rgba(16, 185, 129, 0.22);
}

.primary-button:hover,
.ghost-button:hover,
.section-more:hover {
    transform: translateY(-2px);
}

.primary-button:hover {
    background: var(--emerald-dark);
}

.ghost-button {
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.28);
    background: rgba(255, 255, 255, 0.08);
}

.hero-arrow {
    position: absolute;
    top: 50%;
    z-index: 5;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border: 0;
    border-radius: 999px;
    color: #fff;
    background: rgba(0, 0, 0, 0.48);
    font-size: 34px;
    cursor: pointer;
}

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

.hero-prev {
    left: 24px;
}

.hero-next {
    right: 24px;
}

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

.hero-dot {
    width: 12px;
    height: 12px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.48);
    cursor: pointer;
    transition: width 0.2s ease, background 0.2s ease;
}

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

.content-section {
    width: min(1240px, calc(100% - 32px));
    margin: 0 auto;
    padding: 56px 0;
}

.accent-section {
    width: min(1240px, calc(100% - 32px));
    margin-top: 24px;
    padding: 42px;
    border: 1px solid var(--line);
    border-radius: 32px;
    background: linear-gradient(135deg, rgba(6, 78, 59, 0.28), rgba(8, 47, 73, 0.28));
}

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

.section-head h2,
.rank-panel h2,
.story-card h2 {
    margin: 0;
    font-size: clamp(26px, 3vw, 36px);
    letter-spacing: -0.03em;
}

.section-head p {
    margin: 8px 0 0;
    color: var(--muted);
    line-height: 1.8;
}

.section-more {
    color: var(--emerald);
    background: rgba(16, 185, 129, 0.1);
}

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

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

.movie-card {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--bg-card);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.18);
    transition: transform 0.25s ease, background 0.25s ease, border-color 0.25s ease;
}

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

.poster-wrap {
    position: relative;
    display: block;
    aspect-ratio: 2 / 3;
    overflow: hidden;
    background: linear-gradient(135deg, #0f172a, #111827);
}

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

.movie-card:hover .poster-wrap img,
.category-tile:hover img,
.related-card:hover img {
    transform: scale(1.08);
}

.play-dot {
    position: absolute;
    right: 12px;
    bottom: 12px;
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    color: #fff;
    background: rgba(16, 185, 129, 0.92);
    box-shadow: 0 12px 30px rgba(16, 185, 129, 0.28);
}

.rank-mark {
    position: absolute;
    left: 12px;
    top: 12px;
    z-index: 2;
    min-width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    color: #fff;
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.28);
}

.card-content {
    padding: 16px;
}

.card-title {
    display: -webkit-box;
    min-height: 48px;
    margin-bottom: 10px;
    overflow: hidden;
    color: #fff;
    font-size: 17px;
    font-weight: 800;
    line-height: 1.4;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.card-title:hover {
    color: var(--emerald);
}

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

.card-tags,
.detail-genres,
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.card-tags span,
.detail-genres span,
.tag-cloud span {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0 9px;
    border-radius: 999px;
    color: #67e8f9;
    background: rgba(8, 145, 178, 0.16);
    font-size: 12px;
}

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

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

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

.category-tile {
    position: relative;
    min-height: 190px;
    overflow: hidden;
    border-radius: 24px;
    border: 1px solid var(--line);
    background: #0f172a;
}

.category-tile img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.5;
    transition: transform 0.55s ease;
}

.category-tile::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(2, 6, 23, 0.92), rgba(2, 6, 23, 0.12));
}

.category-tile span {
    position: absolute;
    left: 20px;
    right: 20px;
    bottom: 20px;
    z-index: 2;
}

.category-tile strong,
.category-tile small {
    display: block;
}

.category-tile strong {
    margin-bottom: 8px;
    font-size: 22px;
}

.category-tile small {
    color: var(--muted-strong);
    line-height: 1.6;
}

.split-section {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 32px;
    align-items: start;
}

.rank-panel {
    position: sticky;
    top: 96px;
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: 28px;
    background: rgba(15, 23, 42, 0.72);
    box-shadow: var(--shadow);
}

.rank-list,
.related-grid {
    display: grid;
    gap: 14px;
    margin: 20px 0;
}

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

.related-card {
    display: grid;
    grid-template-columns: 108px 1fr;
    gap: 14px;
    align-items: center;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.68);
    transition: background 0.2s ease, border-color 0.2s ease;
}

.related-card:hover {
    background: rgba(15, 23, 42, 0.96);
    border-color: rgba(16, 185, 129, 0.35);
}

.related-card img {
    width: 108px;
    height: 70px;
    object-fit: cover;
    border-radius: 12px;
    background: #111827;
    transition: transform 0.45s ease;
}

.related-card strong {
    display: block;
    margin-bottom: 7px;
    line-height: 1.45;
}

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

.full-button {
    width: 100%;
}

.page-hero,
.detail-hero {
    width: min(1240px, calc(100% - 32px));
    margin: 0 auto;
    padding: 72px 0 24px;
}

.page-hero span {
    color: var(--emerald);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.18em;
}

.page-hero h1 {
    margin: 14px 0 16px;
    font-size: clamp(42px, 7vw, 86px);
    line-height: 1.02;
    letter-spacing: -0.05em;
}

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 28px;
}

.filter-chip {
    min-height: 40px;
    padding: 0 16px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted-strong);
    background: rgba(15, 23, 42, 0.72);
    cursor: pointer;
}

.filter-chip:hover,
.filter-chip.is-active {
    color: #fff;
    border-color: rgba(16, 185, 129, 0.48);
    background: rgba(16, 185, 129, 0.18);
}

.empty-state {
    padding: 28px;
    border: 1px solid var(--line);
    border-radius: 20px;
    color: var(--muted);
    background: rgba(15, 23, 42, 0.72);
    text-align: center;
}

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

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

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

.player-shell {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    border: 1px solid rgba(16, 185, 129, 0.24);
    border-radius: 30px;
    background: #000;
    box-shadow: var(--shadow);
}

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

.player-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    color: #fff;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.16), rgba(2, 6, 23, 0.38));
    cursor: pointer;
}

.player-overlay span {
    width: 92px;
    height: 92px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: rgba(16, 185, 129, 0.94);
    font-size: 34px;
    box-shadow: 0 24px 60px rgba(16, 185, 129, 0.36);
}

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

.detail-info {
    padding: 30px;
    border: 1px solid var(--line);
    border-radius: 30px;
    background: rgba(15, 23, 42, 0.72);
}

.detail-info h1 {
    font-size: clamp(34px, 5vw, 56px);
}

.detail-genres {
    margin: 22px 0 26px;
}

.detail-content {
    display: grid;
    gap: 22px;
}

.story-card {
    padding: 28px;
    border: 1px solid var(--line);
    border-radius: 26px;
    background: rgba(15, 23, 42, 0.72);
}

.story-card h2 {
    margin-bottom: 16px;
}

.story-card p {
    margin: 0;
    color: var(--muted-strong);
    font-size: 17px;
    line-height: 2;
}

.tag-cloud {
    padding: 0 4px;
}

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

.footer-grid {
    width: min(1240px, calc(100% - 32px));
    margin: 0 auto;
    padding: 42px 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 42px;
}

.site-footer p {
    color: var(--muted);
    line-height: 1.8;
}

.site-footer h2 {
    margin: 0 0 14px;
    font-size: 18px;
}

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

.footer-links a {
    padding: 9px 12px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.1);
    color: var(--muted-strong);
}

.footer-links a:hover {
    color: #fff;
    background: rgba(16, 185, 129, 0.2);
}

.copyright {
    width: min(1240px, calc(100% - 32px));
    margin: 0 auto;
    padding: 20px 0 32px;
    border-top: 1px solid var(--line);
    text-align: center;
}

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

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

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

    .rank-panel {
        position: static;
    }
}

@media (max-width: 760px) {
    .nav-shell {
        min-height: 64px;
        gap: 12px;
    }

    .desktop-nav {
        display: none;
    }

    .mobile-menu-button {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .search-box {
        width: 100%;
        order: 4;
        flex-basis: 100%;
        margin-bottom: 12px;
    }

    .nav-shell {
        flex-wrap: wrap;
    }

    .brand {
        margin-right: auto;
        font-size: 18px;
    }

    .hero-carousel {
        min-height: 620px;
        height: 82vh;
    }

    .hero-content {
        bottom: 94px;
    }

    .hero-arrow {
        display: none;
    }

    .content-section,
    .accent-section,
    .page-hero,
    .detail-hero {
        width: min(100% - 24px, 1240px);
    }

    .accent-section {
        padding: 24px;
    }

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

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

    .detail-info,
    .story-card {
        padding: 22px;
    }

    .player-shell {
        border-radius: 20px;
    }
}
