:root {
    color-scheme: dark;
    --bg: #020617;
    --bg-soft: #0f172a;
    --card: rgba(15, 23, 42, 0.78);
    --card-solid: #111827;
    --line: rgba(148, 163, 184, 0.18);
    --text: #f8fafc;
    --muted: #94a3b8;
    --soft: #cbd5e1;
    --emerald: #34d399;
    --teal: #14b8a6;
    --amber: #f59e0b;
    --shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    background:
        radial-gradient(circle at 20% 0%, rgba(20, 184, 166, 0.18), transparent 34rem),
        radial-gradient(circle at 80% 18%, rgba(52, 211, 153, 0.12), transparent 28rem),
        linear-gradient(180deg, #020617 0%, #0f172a 58%, #020617 100%);
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
    line-height: 1.6;
}

body.menu-open {
    overflow: hidden;
}

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

img {
    display: block;
    max-width: 100%;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.92), rgba(20, 184, 166, 0.28));
}

button,
input,
select {
    font: inherit;
}

.container {
    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.82);
    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;
}

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

.logo-mark {
    width: 38px;
    height: 38px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #02110d;
    background: linear-gradient(135deg, var(--emerald), var(--teal));
    box-shadow: 0 12px 30px rgba(20, 184, 166, 0.35);
}

.logo-text {
    font-size: 1.1rem;
}

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

.nav-link {
    padding: 10px 14px;
    border-radius: 999px;
    color: var(--soft);
    transition: background 0.2s ease, color 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
    color: white;
    background: rgba(52, 211, 153, 0.16);
}

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

.menu-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    margin: 4px auto;
    background: currentColor;
    border-radius: 999px;
}

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

.hero-slide {
    position: absolute;
    inset: 0;
    min-height: 720px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.8s ease;
}

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

.hero-bg,
.hero-overlay {
    position: absolute;
    inset: 0;
}

.hero-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: saturate(1.08) contrast(1.08);
    transform: scale(1.02);
}

.hero-overlay {
    background:
        linear-gradient(90deg, rgba(2, 6, 23, 0.97) 0%, rgba(2, 6, 23, 0.78) 43%, rgba(2, 6, 23, 0.22) 100%),
        linear-gradient(0deg, rgba(2, 6, 23, 0.98) 0%, transparent 48%, rgba(2, 6, 23, 0.42) 100%);
}

.hero-content {
    position: relative;
    width: min(1180px, calc(100% - 32px));
    min-height: 720px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    padding: 96px 0 120px;
}

.eyebrow,
.section-kicker {
    margin: 0 0 14px;
    color: var(--emerald);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.hero-content h1 {
    max-width: 760px;
    margin: 0;
    font-size: clamp(2.8rem, 8vw, 6.8rem);
    line-height: 0.95;
    letter-spacing: -0.06em;
}

.hero-summary {
    max-width: 680px;
    margin: 28px 0 0;
    color: var(--soft);
    font-size: clamp(1.05rem, 2vw, 1.35rem);
}

.hero-tags,
.tag-row,
.detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.hero-tags {
    margin-top: 24px;
}

.hero-tags span,
.tag-row span,
.detail-tags span {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 4px 10px;
    border: 1px solid rgba(52, 211, 153, 0.28);
    border-radius: 999px;
    color: #bbf7d0;
    background: rgba(6, 78, 59, 0.28);
    font-size: 0.78rem;
}

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

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 22px;
    border: 1px solid transparent;
    border-radius: 999px;
    font-weight: 800;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

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

.btn.primary {
    color: #022c22;
    background: linear-gradient(135deg, var(--emerald), var(--teal));
    box-shadow: 0 16px 36px rgba(20, 184, 166, 0.28);
}

.btn.ghost {
    color: white;
    border-color: var(--line);
    background: rgba(15, 23, 42, 0.58);
}

.btn.small {
    min-height: 40px;
    padding: 0 16px;
    font-size: 0.9rem;
}

.hero-dots {
    position: absolute;
    left: 50%;
    bottom: 34px;
    z-index: 3;
    width: min(1180px, calc(100% - 32px));
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
}

.hero-dots button {
    width: 42px;
    height: 4px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.32);
    cursor: pointer;
}

.hero-dots button.active {
    background: var(--emerald);
}

.quick-search-panel {
    margin-top: -52px;
    position: relative;
    z-index: 5;
}

.search-card,
.filter-bar {
    border: 1px solid var(--line);
    border-radius: 24px;
    background: rgba(15, 23, 42, 0.86);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.search-card {
    padding: 22px;
}

.search-card label {
    display: block;
    margin-bottom: 10px;
    color: white;
    font-weight: 800;
}

.search-inline,
.filter-bar {
    display: flex;
    align-items: center;
    gap: 12px;
}

.search-inline input,
.filter-bar input,
.filter-bar select {
    min-height: 48px;
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 16px;
    color: white;
    background: rgba(2, 6, 23, 0.72);
    outline: none;
}

.search-inline input,
.filter-bar input {
    flex: 1;
    width: 100%;
    padding: 0 16px;
}

.filter-bar select {
    padding: 0 14px;
}

.filter-bar {
    margin: 24px 0;
    padding: 16px;
}

.filter-bar.wide select {
    min-width: 190px;
}

.result-count {
    color: var(--muted);
    white-space: nowrap;
}

.section-block {
    margin-top: 76px;
}

.page-main {
    padding: 42px 0 90px;
}

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

.section-heading h2,
.page-hero h1,
.detail-card h1 {
    margin: 0;
    font-size: clamp(2rem, 4vw, 3.2rem);
    line-height: 1.08;
    letter-spacing: -0.04em;
}

.section-heading p,
.page-hero p,
.category-preview p {
    max-width: 720px;
    margin: 8px 0 0;
    color: var(--muted);
}

.section-more,
.preview-head a,
.ranking-head a {
    color: var(--emerald);
    font-weight: 800;
}

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

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

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

.movie-card {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: var(--card);
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.22);
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.movie-card:hover {
    transform: translateY(-6px);
    border-color: rgba(52, 211, 153, 0.5);
    box-shadow: 0 26px 70px rgba(0, 0, 0, 0.34);
}

.poster-link {
    position: relative;
    display: block;
    aspect-ratio: 2 / 3;
    overflow: hidden;
}

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

.rating-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    min-height: 30px;
    padding: 0 10px;
    border-radius: 999px;
    color: #1f1300;
    background: var(--amber);
    font-weight: 900;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.26);
}

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

.movie-title {
    display: -webkit-box;
    min-height: 3.1em;
    overflow: hidden;
    font-size: 1.02rem;
    font-weight: 850;
    line-height: 1.45;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

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

.movie-meta,
.movie-desc {
    color: var(--muted);
    font-size: 0.88rem;
}

.movie-meta {
    margin: 8px 0 0;
}

.movie-desc {
    display: -webkit-box;
    min-height: 3.9em;
    margin: 8px 0 12px;
    overflow: hidden;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.movie-card.compact .movie-desc {
    -webkit-line-clamp: 2;
    min-height: 2.8em;
}

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

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

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

.category-tile img,
.category-tile-shade {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.category-tile img {
    object-fit: cover;
    opacity: 0.62;
    transition: transform 0.35s ease, opacity 0.35s ease;
}

.category-tile:hover img {
    transform: scale(1.06);
    opacity: 0.78;
}

.category-tile-shade {
    background: linear-gradient(180deg, transparent 0%, rgba(2, 6, 23, 0.92) 100%);
}

.category-tile-text {
    position: absolute;
    inset: auto 16px 16px 16px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.category-tile-text strong {
    font-size: 1.18rem;
}

.category-tile-text em,
.category-tile-text small {
    color: var(--soft);
    font-style: normal;
}

.two-column {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 28px;
    align-items: start;
}

.ranking-panel,
.side-card,
.detail-card,
.page-hero,
.category-preview {
    border: 1px solid var(--line);
    border-radius: 24px;
    background: var(--card);
    box-shadow: var(--shadow);
}

.ranking-panel {
    position: sticky;
    top: 94px;
    padding: 18px;
}

.ranking-head,
.preview-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.ranking-head span,
.preview-head h2,
.side-card h2 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 900;
}

.rank-item {
    display: grid;
    grid-template-columns: 34px 54px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    padding: 10px 0;
    border-top: 1px solid rgba(148, 163, 184, 0.12);
}

.rank-item:first-of-type {
    border-top: 0;
}

.rank-num {
    color: var(--emerald);
    font-weight: 950;
}

.rank-item img {
    width: 54px;
    height: 74px;
    border-radius: 10px;
    object-fit: cover;
}

.rank-info {
    min-width: 0;
}

.rank-info strong,
.rank-info em {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rank-info em {
    color: var(--muted);
    font-size: 0.82rem;
    font-style: normal;
}

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

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

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

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

.footer-links a {
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--soft);
}

.compact-hero {
    padding: 42px;
    background:
        radial-gradient(circle at 0% 0%, rgba(52, 211, 153, 0.18), transparent 30rem),
        rgba(15, 23, 42, 0.78);
}

.category-preview {
    margin-bottom: 28px;
    padding: 24px;
}

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

.ranking-row {
    border: 1px solid var(--line);
    border-radius: 22px;
    background: var(--card);
    overflow: hidden;
}

.ranking-row-link {
    display: grid;
    grid-template-columns: 74px 88px minmax(0, 1fr) 72px;
    gap: 18px;
    align-items: center;
    padding: 16px;
}

.ranking-row-num {
    color: var(--emerald);
    font-size: 1.5rem;
    font-weight: 950;
}

.ranking-row img {
    width: 88px;
    height: 122px;
    object-fit: cover;
    border-radius: 14px;
}

.ranking-row-body strong,
.ranking-row-body em,
.ranking-row-body small {
    display: block;
}

.ranking-row-body strong {
    font-size: 1.2rem;
}

.ranking-row-body em,
.ranking-row-body small {
    color: var(--muted);
    font-style: normal;
}

.ranking-score {
    color: var(--amber);
    font-size: 1.4rem;
    font-weight: 950;
    text-align: right;
}

.breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 22px;
    color: var(--muted);
    font-size: 0.92rem;
}

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

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

.detail-primary {
    display: grid;
    gap: 24px;
}

.player-shell {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 26px;
    background: black;
    box-shadow: var(--shadow);
    aspect-ratio: 16 / 9;
}

.movie-player {
    width: 100%;
    height: 100%;
    display: block;
    background: black;
    object-fit: contain;
}

.play-overlay {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    border: 0;
    color: white;
    background: radial-gradient(circle, rgba(2, 6, 23, 0.16), rgba(2, 6, 23, 0.72));
    cursor: pointer;
}

.player-shell.is-playing .play-overlay {
    display: none;
}

.play-icon {
    width: 78px;
    height: 78px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #022c22;
    background: linear-gradient(135deg, var(--emerald), var(--teal));
    box-shadow: 0 22px 48px rgba(20, 184, 166, 0.42);
    font-size: 1.8rem;
    padding-left: 4px;
}

.detail-card {
    padding: 28px;
}

.detail-lead {
    color: var(--soft);
    font-size: 1.12rem;
}

.detail-tags {
    margin: 18px 0;
}

.detail-meta-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin: 24px 0;
}

.detail-meta-grid div {
    padding: 14px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 16px;
    background: rgba(2, 6, 23, 0.42);
}

.detail-meta-grid span,
.detail-meta-grid strong {
    display: block;
}

.detail-meta-grid span {
    color: var(--muted);
    font-size: 0.82rem;
}

.article-text h2 {
    margin: 28px 0 10px;
}

.article-text p {
    color: var(--soft);
    font-size: 1.02rem;
}

.detail-side {
    position: sticky;
    top: 94px;
    display: grid;
    gap: 18px;
}

.detail-poster {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 24px;
    object-fit: cover;
    aspect-ratio: 2 / 3;
    box-shadow: var(--shadow);
}

.side-card {
    padding: 18px;
}

.search-item.is-hidden {
    display: none !important;
}

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

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

    .two-column,
    .detail-layout,
    .footer-inner {
        grid-template-columns: 1fr;
    }

    .ranking-panel,
    .detail-side {
        position: static;
    }

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

@media (max-width: 760px) {
    .menu-toggle {
        display: block;
    }

    .site-nav {
        position: fixed;
        top: 72px;
        left: 16px;
        right: 16px;
        display: none;
        flex-direction: column;
        align-items: stretch;
        padding: 14px;
        border: 1px solid var(--line);
        border-radius: 18px;
        background: rgba(2, 6, 23, 0.96);
        box-shadow: var(--shadow);
    }

    body.menu-open .site-nav {
        display: flex;
    }

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

    .hero-content {
        padding: 78px 0 110px;
    }

    .search-inline,
    .filter-bar,
    .section-heading,
    .ranking-row-link {
        align-items: stretch;
        flex-direction: column;
    }

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

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

    .category-tile {
        min-height: 158px;
    }

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

    .ranking-row-link {
        display: flex;
    }

    .ranking-row img {
        width: 100%;
        height: auto;
        aspect-ratio: 2 / 3;
    }

    .ranking-score {
        text-align: left;
    }
}

@media (max-width: 500px) {
    .container,
    .header-inner,
    .footer-inner,
    .hero-content,
    .hero-dots {
        width: min(100% - 24px, 1180px);
    }

    .movie-grid,
    .movie-grid.small-grid,
    .movie-grid.listing-grid,
    .category-grid,
    .category-grid.overview {
        grid-template-columns: 1fr;
    }

    .compact-hero,
    .detail-card,
    .category-preview {
        padding: 22px;
    }

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