* {
    box-sizing: border-box;
}

:root {
    color-scheme: dark;
    --bg: #020617;
    --panel: rgba(15, 23, 42, 0.78);
    --panel-strong: rgba(15, 23, 42, 0.95);
    --line: rgba(148, 163, 184, 0.18);
    --text: #f8fafc;
    --muted: #94a3b8;
    --soft: #cbd5e1;
    --brand: #10b981;
    --brand-2: #34d399;
    --brand-dark: #047857;
    --shadow: 0 24px 80px rgba(0, 0, 0, 0.36);
    --radius: 22px;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: radial-gradient(circle at 20% 0%, rgba(16, 185, 129, 0.16), transparent 32%),
                radial-gradient(circle at 82% 12%, rgba(56, 189, 248, 0.10), transparent 28%),
                var(--bg);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    line-height: 1.6;
}

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

img {
    display: block;
    width: 100%;
}

button,
input,
select {
    font: inherit;
}

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

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

.site-header {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    z-index: 50;
    background: rgba(2, 6, 23, 0.88);
    border-bottom: 1px solid rgba(148, 163, 184, 0.14);
    backdrop-filter: blur(14px);
}

.nav-wrap {
    width: min(1220px, calc(100% - 32px));
    height: 66px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #f8fafc;
    font-size: 20px;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.brand.small {
    font-size: 17px;
}

.brand-mark {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #06281d;
    background: linear-gradient(135deg, var(--brand-2), var(--brand));
    box-shadow: 0 0 28px rgba(16, 185, 129, 0.36);
    font-size: 12px;
}

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

.nav-links a {
    padding: 9px 14px;
    border-radius: 999px;
    color: #cbd5e1;
    transition: color 0.2s ease, background 0.2s ease;
}

.nav-links a:hover,
.nav-links a.active {
    color: #ecfdf5;
    background: rgba(16, 185, 129, 0.15);
}

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

.mobile-menu-btn span {
    display: block;
    height: 2px;
    margin: 5px 0;
    border-radius: 99px;
    background: var(--soft);
}

.hero {
    min-height: 100vh;
    position: relative;
    overflow: hidden;
    background: #020617;
}

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

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

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

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

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(2, 6, 23, 0.96), rgba(2, 6, 23, 0.74) 42%, rgba(2, 6, 23, 0.28) 100%),
                linear-gradient(0deg, #020617 0%, rgba(2, 6, 23, 0.22) 38%, rgba(2, 6, 23, 0.55) 100%);
}

.hero-content {
    position: relative;
    z-index: 2;
    width: min(1220px, calc(100% - 32px));
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-top: 70px;
    max-width: 1220px;
}

.hero-kicker,
.section-kicker {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    color: var(--brand-2);
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-size: 13px;
}

.hero-content h1 {
    max-width: 780px;
    margin: 18px 0 18px;
    font-size: clamp(42px, 7vw, 86px);
    line-height: 0.98;
    letter-spacing: -0.06em;
}

.hero-content p {
    max-width: 720px;
    margin: 0;
    color: #cbd5e1;
    font-size: clamp(17px, 2vw, 22px);
}

.hero-tags,
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 24px;
}

.hero-tags span,
.tag-cloud span {
    padding: 7px 12px;
    border: 1px solid rgba(52, 211, 153, 0.22);
    border-radius: 999px;
    color: #d1fae5;
    background: rgba(6, 78, 59, 0.42);
    font-size: 13px;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 34px;
}

.btn,
.search-row button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 20px;
    border: 0;
    border-radius: 999px;
    color: #ecfdf5;
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.btn:hover,
.search-row button:hover {
    transform: translateY(-1px);
}

.btn.primary,
.search-row button {
    background: linear-gradient(135deg, #10b981, #059669);
    box-shadow: 0 14px 40px rgba(16, 185, 129, 0.24);
}

.btn.ghost {
    border: 1px solid rgba(203, 213, 225, 0.28);
    background: rgba(15, 23, 42, 0.62);
    backdrop-filter: blur(10px);
}

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

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

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

.search-panel {
    position: relative;
    z-index: 6;
    margin-top: -72px;
}

.global-search-form,
.filter-panel,
.content-card,
.category-tile,
.movie-card,
.player-shell,
.rank-item {
    border: 1px solid var(--line);
    background: var(--panel);
    box-shadow: var(--shadow);
    backdrop-filter: blur(16px);
}

.global-search-form {
    padding: 22px;
    border-radius: var(--radius);
}

.global-search-form label,
.filter-panel label span {
    display: block;
    margin-bottom: 10px;
    color: #e2e8f0;
    font-weight: 700;
}

.search-row {
    display: flex;
    gap: 12px;
}

.search-row input,
.filter-panel input,
.filter-panel select {
    width: 100%;
    border: 1px solid rgba(148, 163, 184, 0.22);
    outline: none;
    border-radius: 999px;
    background: rgba(2, 6, 23, 0.66);
    color: var(--text);
    min-height: 46px;
    padding: 0 16px;
}

.search-row input:focus,
.filter-panel input:focus,
.filter-panel select:focus {
    border-color: rgba(52, 211, 153, 0.72);
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.10);
}

.section {
    padding: 74px 0 0;
}

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

.section h2,
.page-hero h1,
.detail-info h1 {
    margin: 8px 0 0;
    font-size: clamp(28px, 4vw, 48px);
    line-height: 1.1;
    letter-spacing: -0.04em;
}

.text-link {
    color: var(--brand-2);
    font-weight: 800;
}

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

.movie-card {
    overflow: hidden;
    border-radius: 18px;
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.movie-card:hover {
    transform: translateY(-4px);
    border-color: rgba(52, 211, 153, 0.46);
    box-shadow: 0 24px 80px rgba(16, 185, 129, 0.12);
}

.movie-card.is-hidden {
    display: none;
}

.poster-link,
.poster-shell {
    display: block;
}

.poster-shell {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.9), rgba(6, 78, 59, 0.55));
}

.poster-shell img,
.rank-cover img,
.detail-poster img,
.category-poster-grid img {
    height: 100%;
    object-fit: cover;
}

.poster-shell img {
    transition: transform 0.45s ease;
}

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

.poster-mask {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(0deg, rgba(2, 6, 23, 0.82), transparent 70%);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.movie-card:hover .poster-mask {
    opacity: 1;
}

.play-icon,
.player-play {
    width: 52px;
    height: 52px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(16, 185, 129, 0.95);
    color: #052e22;
    box-shadow: 0 10px 30px rgba(16, 185, 129, 0.35);
    font-size: 18px;
}

.year-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 5px 9px;
    border-radius: 999px;
    color: #ecfdf5;
    background: rgba(16, 185, 129, 0.90);
    font-size: 12px;
    font-weight: 800;
}

.card-body {
    padding: 16px;
}

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

.card-body h3 a:hover {
    color: var(--brand-2);
}

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

.card-desc.compact {
    min-height: 44px;
}

.card-meta,
.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.card-meta span,
.detail-meta span {
    padding: 5px 9px;
    border-radius: 9px;
    background: rgba(30, 41, 59, 0.72);
    color: #cbd5e1;
    font-size: 12px;
}

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

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

.rank-item {
    display: grid;
    grid-template-columns: 48px 86px 1fr auto;
    align-items: center;
    gap: 14px;
    border-radius: 18px;
    padding: 12px;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.rank-item:hover {
    transform: translateX(4px);
    border-color: rgba(52, 211, 153, 0.46);
}

.rank-num {
    color: var(--brand-2);
    font-size: 22px;
    font-weight: 900;
}

.rank-cover {
    height: 54px;
    border-radius: 12px;
    overflow: hidden;
    background: rgba(15, 23, 42, 0.9);
}

.rank-info strong,
.rank-info em {
    display: block;
}

.rank-info strong {
    color: #f8fafc;
}

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

.rank-score {
    color: #d1fae5;
    border: 1px solid rgba(52, 211, 153, 0.25);
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 12px;
    background: rgba(6, 78, 59, 0.35);
}

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

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

.category-tile {
    display: grid;
    grid-template-columns: 190px 1fr;
    gap: 18px;
    border-radius: var(--radius);
    padding: 16px;
    overflow: hidden;
}

.category-cover {
    min-height: 152px;
}

.category-poster-grid {
    height: 100%;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
}

.category-poster-grid img {
    min-height: 72px;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.9);
}

.category-text h2 {
    margin: 0 0 8px;
    font-size: 24px;
}

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

.category-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.category-links a {
    color: #cbd5e1;
    background: rgba(30, 41, 59, 0.70);
    border-radius: 999px;
    padding: 5px 9px;
    font-size: 12px;
}

.page-main {
    padding-top: 96px;
}

.page-hero {
    min-height: 310px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

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

.page-hero.split {
    align-items: end;
}

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

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

.filter-panel {
    width: min(420px, 100%);
    display: grid;
    gap: 14px;
    padding: 18px;
    border-radius: var(--radius);
}

.empty-state {
    display: none;
    padding: 38px;
    text-align: center;
    color: var(--muted);
    border: 1px dashed rgba(148, 163, 184, 0.28);
    border-radius: var(--radius);
    background: rgba(15, 23, 42, 0.48);
}

.empty-state.is-visible {
    display: block;
}

.detail-main {
    padding-top: 0;
}

.detail-hero {
    position: relative;
    min-height: 710px;
    overflow: hidden;
    background: #020617;
}

.detail-backdrop {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(2px) saturate(1.05);
    opacity: 0.48;
}

.detail-shade {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(2, 6, 23, 0.96), rgba(2, 6, 23, 0.70)),
                linear-gradient(0deg, #020617, rgba(2, 6, 23, 0.08));
}

.detail-hero-inner {
    position: relative;
    z-index: 2;
    padding-top: 112px;
}

.detail-layout {
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 36px;
    align-items: center;
}

.detail-poster {
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.20);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    background: rgba(15, 23, 42, 0.9);
}

.detail-info h1 {
    max-width: 850px;
    font-size: clamp(36px, 6vw, 72px);
}

.detail-line {
    max-width: 840px;
    color: #cbd5e1;
    font-size: 20px;
}

.player-shell {
    position: relative;
    overflow: hidden;
    border-radius: 26px;
    aspect-ratio: 16 / 9;
    background: #000;
}

.movie-player {
    width: 100%;
    height: 100%;
    display: block;
    background: #000;
}

.player-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: #f8fafc;
    border: 0;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.20), rgba(2, 6, 23, 0.76));
    cursor: pointer;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

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

.detail-content {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 18px;
}

.content-card {
    border-radius: var(--radius);
    padding: 24px;
}

.content-card h2 {
    margin: 0 0 16px;
    font-size: 26px;
}

.content-card p {
    color: #cbd5e1;
    margin: 0 0 14px;
}

.site-footer {
    margin-top: 90px;
    border-top: 1px solid rgba(148, 163, 184, 0.14);
    background: rgba(2, 6, 23, 0.86);
}

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

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

.footer-brand p {
    max-width: 480px;
}

.footer-col {
    display: grid;
    gap: 8px;
    align-content: start;
}

.footer-col h3 {
    margin: 0 0 8px;
}

.footer-col a:hover {
    color: var(--brand-2);
}

.footer-copy {
    border-top: 1px solid rgba(148, 163, 184, 0.12);
    padding: 18px 16px;
    text-align: center;
    color: #64748b;
    font-size: 14px;
}

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

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

.search-page-form {
    width: min(680px, 100%);
}

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

    .category-grid,
    .home-rank,
    .full-rank {
        grid-template-columns: 1fr;
    }

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

@media (max-width: 780px) {
    .mobile-menu-btn {
        display: block;
    }

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

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

    .hero-content h1 {
        font-size: clamp(40px, 13vw, 60px);
    }

    .search-row,
    .section-head,
    .page-hero,
    .page-hero.split {
        display: grid;
    }

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

    .category-tile,
    .detail-layout,
    .detail-content,
    .footer-inner {
        grid-template-columns: 1fr;
    }

    .rank-item {
        grid-template-columns: 38px 70px 1fr;
    }

    .rank-score {
        grid-column: 3;
        width: fit-content;
    }

    .detail-hero {
        min-height: auto;
        padding-bottom: 42px;
    }

    .detail-hero-inner {
        padding-top: 96px;
    }

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

@media (max-width: 520px) {
    .movie-grid,
    .featured-grid {
        grid-template-columns: 1fr;
    }

    .category-cover {
        min-height: 190px;
    }

    .home-rank .rank-item,
    .full-rank .rank-item {
        grid-template-columns: 34px 62px 1fr;
        gap: 10px;
    }

    .hero-dots {
        bottom: 24px;
    }
}
