:root {
    --bg: #020617;
    --panel: rgba(15, 23, 42, 0.72);
    --panel-strong: rgba(15, 23, 42, 0.94);
    --card: rgba(30, 41, 59, 0.52);
    --card-hover: rgba(30, 41, 59, 0.82);
    --line: #1e293b;
    --line-soft: rgba(51, 65, 85, 0.75);
    --text: #f1f5f9;
    --muted: #94a3b8;
    --muted-strong: #cbd5e1;
    --accent: #10b981;
    --accent-light: #34d399;
    --accent-soft: rgba(16, 185, 129, 0.18);
    --danger: #f87171;
    --shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(16, 185, 129, 0.12), transparent 32rem),
        radial-gradient(circle at top right, rgba(56, 189, 248, 0.08), transparent 30rem),
        var(--bg);
    color: var(--text);
    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,
video {
    display: block;
    max-width: 100%;
}

button,
input,
select {
    font: inherit;
}

button {
    cursor: pointer;
}

.container {
    width: min(100% - 2rem, 1280px);
    margin: 0 auto;
}

.site-header {
    position: fixed;
    z-index: 80;
    top: 0;
    right: 0;
    left: 0;
    background: rgba(15, 23, 42, 0.95);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(10px);
}

.nav-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 4rem;
}

.site-logo,
.footer-logo {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--text);
    font-weight: 800;
    letter-spacing: 0.02em;
}

.logo-mark {
    display: inline-grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    color: #fff;
    background: linear-gradient(135deg, var(--accent), var(--accent-light));
    border-radius: 999px;
    box-shadow: 0 0 28px rgba(16, 185, 129, 0.38);
    font-size: 0.82rem;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1.35rem;
}

.nav-link {
    color: var(--muted-strong);
    transition: color 0.2s ease, background 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
    color: var(--accent-light);
}

.menu-toggle {
    display: none;
    color: var(--muted-strong);
    background: transparent;
    border: 0;
    font-size: 1.4rem;
}

main {
    padding-top: 4rem;
}

.hero {
    position: relative;
    min-height: 70vh;
    overflow: hidden;
    background: var(--bg);
}

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

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

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

.hero-bg img {
    object-fit: cover;
    transform: scale(1.02);
}

.hero-shade {
    background:
        linear-gradient(to top, #020617 4%, rgba(2, 6, 23, 0.72) 42%, rgba(2, 6, 23, 0.08)),
        linear-gradient(to right, rgba(2, 6, 23, 0.92), rgba(2, 6, 23, 0.28), rgba(2, 6, 23, 0.66));
}

.hero-content {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: flex-end;
    min-height: 70vh;
    padding-bottom: 7rem;
}

.hero-copy {
    width: min(100%, 44rem);
}

.pill,
.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 1rem;
    padding: 0.28rem 0.72rem;
    color: var(--accent-light);
    background: var(--accent-soft);
    border: 1px solid rgba(16, 185, 129, 0.28);
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 700;
}

.hero h1 {
    margin: 0 0 1rem;
    color: #fff;
    font-size: clamp(2.3rem, 6vw, 4.8rem);
    line-height: 1.05;
    letter-spacing: -0.04em;
}

.hero p {
    width: min(100%, 42rem);
    margin: 0 0 1.5rem;
    color: var(--muted-strong);
    font-size: 1.08rem;
}

.hero-meta,
.detail-meta,
.card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.hero-meta span,
.detail-meta span,
.card-meta span {
    padding: 0.28rem 0.62rem;
    color: var(--muted-strong);
    background: rgba(30, 41, 59, 0.68);
    border: 1px solid var(--line-soft);
    border-radius: 999px;
    font-size: 0.78rem;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-top: 1.6rem;
}

.btn,
.section-more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.8rem;
    padding: 0.7rem 1.3rem;
    border-radius: 0.75rem;
    font-weight: 700;
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.btn:hover,
.section-more:hover {
    transform: translateY(-1px);
}

.btn.primary {
    color: #fff;
    background: var(--accent);
}

.btn.primary:hover {
    background: #059669;
}

.btn.ghost,
.section-more {
    color: var(--text);
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid var(--line-soft);
}

.btn.ghost:hover,
.section-more:hover {
    border-color: rgba(52, 211, 153, 0.58);
    color: var(--accent-light);
}

.hero-nav {
    position: absolute;
    z-index: 5;
    top: 50%;
    width: 2.8rem;
    height: 2.8rem;
    transform: translateY(-50%);
    color: #fff;
    background: rgba(15, 23, 42, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    font-size: 2rem;
    line-height: 1;
    transition: background 0.2s ease, color 0.2s ease;
}

.hero-nav:hover {
    color: var(--accent-light);
    background: rgba(15, 23, 42, 0.88);
}

.hero-prev {
    left: 1rem;
}

.hero-next {
    right: 1rem;
}

.hero-dots {
    position: absolute;
    z-index: 6;
    right: 50%;
    bottom: 2rem;
    display: flex;
    gap: 0.5rem;
    transform: translateX(50%);
}

.hero-dot {
    width: 0.58rem;
    height: 0.58rem;
    padding: 0;
    background: rgba(255, 255, 255, 0.46);
    border: 0;
    border-radius: 999px;
    transition: width 0.2s ease, background 0.2s ease;
}

.hero-dot.active {
    width: 2rem;
    background: var(--accent-light);
}

.hero-thumbs {
    position: relative;
    z-index: 7;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.75rem;
    margin-top: -5rem;
    padding-bottom: 1rem;
}

.hero-thumb {
    display: grid;
    grid-template-columns: 5rem 1fr;
    align-items: center;
    gap: 0.7rem;
    padding: 0.5rem;
    background: rgba(15, 23, 42, 0.72);
    border: 1px solid var(--line-soft);
    border-radius: 1rem;
    backdrop-filter: blur(8px);
    overflow: hidden;
}

.hero-thumb:hover {
    border-color: rgba(52, 211, 153, 0.52);
}

.hero-thumb img {
    width: 5rem;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: 0.65rem;
}

.hero-thumb span {
    min-width: 0;
    color: var(--muted-strong);
    font-size: 0.86rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.section-block {
    padding: 4rem 0;
}

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

.section-head h2,
.page-hero h1,
.detail-title h1 {
    margin: 0;
    color: #fff;
    line-height: 1.12;
    letter-spacing: -0.03em;
}

.section-head h2 {
    font-size: clamp(1.8rem, 3vw, 2.5rem);
}

.section-head p,
.page-hero p,
.detail-title p,
.category-card p,
.side-card p {
    margin: 0.55rem 0 0;
    color: var(--muted);
}

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

.movie-card {
    min-width: 0;
}

.movie-card a {
    display: block;
    height: 100%;
    background: var(--card);
    border: 1px solid transparent;
    border-radius: 1rem;
    overflow: hidden;
    transition: transform 0.22s ease, border-color 0.22s ease, background 0.22s ease, box-shadow 0.22s ease;
}

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

.card-poster {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #0f172a;
}

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

.movie-card a:hover .card-poster img {
    transform: scale(1.055);
}

.card-poster::after {
    content: "";
    position: absolute;
    inset: 0;
    opacity: 0;
    background: linear-gradient(to top, rgba(15, 23, 42, 0.88), transparent);
    transition: opacity 0.25s ease;
}

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

.score-badge,
.year-badge {
    position: absolute;
    z-index: 2;
    top: 0.65rem;
    padding: 0.22rem 0.5rem;
    color: #fff;
    border-radius: 0.5rem;
    font-size: 0.76rem;
    font-weight: 800;
}

.score-badge {
    left: 0.65rem;
    background: rgba(16, 185, 129, 0.92);
}

.year-badge {
    right: 0.65rem;
    background: rgba(15, 23, 42, 0.84);
}

.play-hover {
    position: absolute;
    z-index: 3;
    top: 50%;
    left: 50%;
    display: grid;
    place-items: center;
    width: 3rem;
    height: 3rem;
    opacity: 0;
    color: #fff;
    background: rgba(16, 185, 129, 0.9);
    border-radius: 999px;
    transform: translate(-50%, -50%) scale(0.9);
    transition: opacity 0.22s ease, transform 0.22s ease;
}

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

.card-body {
    padding: 1rem;
}

.card-body h3 {
    margin: 0 0 0.45rem;
    color: var(--text);
    font-size: 1rem;
    line-height: 1.35;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: color 0.2s ease;
}

.movie-card a:hover h3 {
    color: var(--accent-light);
}

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

.movie-card-compact .card-body p {
    min-height: 0;
}

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

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

.category-tile,
.category-card {
    display: block;
    padding: 1.2rem;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 1rem;
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.category-tile:hover,
.category-card:hover {
    transform: translateY(-2px);
    background: var(--card-hover);
    border-color: rgba(52, 211, 153, 0.5);
}

.category-tile strong,
.category-card h2 {
    display: block;
    margin: 0 0 0.5rem;
    color: #fff;
    font-size: 1.18rem;
}

.category-tile p,
.category-card p {
    margin: 0 0 1rem;
    color: var(--muted);
    font-size: 0.92rem;
}

.category-tile div,
.category-samples {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.category-tile span,
.category-samples a {
    max-width: 100%;
    padding: 0.2rem 0.48rem;
    color: var(--muted-strong);
    background: rgba(30, 41, 59, 0.8);
    border-radius: 999px;
    font-size: 0.75rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rank-section {
    padding-top: 2rem;
}

.rank-list,
.ranking-list {
    display: grid;
    gap: 0.75rem;
}

.rank-row,
.ranking-card a {
    display: grid;
    align-items: center;
    gap: 1rem;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 1rem;
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.rank-row {
    grid-template-columns: 3.2rem 7rem 1fr auto;
    padding: 0.65rem;
}

.ranking-card a {
    grid-template-columns: 4rem 8rem 1fr auto;
    padding: 0.75rem;
}

.rank-row:hover,
.ranking-card a:hover {
    transform: translateY(-1px);
    background: var(--card-hover);
    border-color: rgba(52, 211, 153, 0.5);
}

.rank-index,
.ranking-no {
    color: var(--accent-light);
    font-weight: 900;
    text-align: center;
}

.rank-row img,
.ranking-card img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: 0.75rem;
    background: #0f172a;
}

.rank-info,
.ranking-copy {
    min-width: 0;
}

.rank-info strong,
.ranking-copy strong {
    display: block;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rank-info em,
.ranking-copy em,
.ranking-copy small {
    display: block;
    color: var(--muted);
    font-style: normal;
    font-size: 0.86rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rank-score,
.ranking-score {
    padding: 0.35rem 0.7rem;
    color: #fff;
    background: var(--accent);
    border-radius: 0.65rem;
    font-weight: 900;
}

.page-main {
    min-height: 100vh;
}

.page-hero {
    padding: 5rem 0 3rem;
    background: linear-gradient(to bottom, rgba(15, 23, 42, 0.74), transparent);
}

.page-hero h1 {
    font-size: clamp(2.2rem, 4vw, 4rem);
}

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

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

.filter-panel {
    display: grid;
    grid-template-columns: minmax(16rem, 1fr) repeat(3, minmax(9rem, 0.35fr));
    gap: 0.9rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 1rem;
}

.filter-panel label {
    display: grid;
    gap: 0.4rem;
    color: var(--muted);
    font-size: 0.82rem;
}

.filter-panel input,
.filter-panel select {
    width: 100%;
    min-height: 2.75rem;
    color: var(--text);
    background: rgba(2, 6, 23, 0.74);
    border: 1px solid var(--line-soft);
    border-radius: 0.75rem;
    outline: none;
    padding: 0 0.85rem;
}

.filter-panel input:focus,
.filter-panel select:focus {
    border-color: rgba(52, 211, 153, 0.68);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.14);
}

.empty-filter {
    margin: 1rem 0;
    color: var(--muted);
    text-align: center;
}

.detail-shell {
    padding-top: 2rem;
}

.detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(18rem, 0.85fr);
    gap: 2rem;
    align-items: start;
}

.player-card,
.content-panel,
.tag-panel,
.side-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 1rem;
    box-shadow: var(--shadow);
}

.player-card {
    overflow: hidden;
}

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

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

.player-overlay {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: grid;
    place-items: center;
    gap: 0.8rem;
    padding: 2rem;
    color: #fff;
    background: linear-gradient(to top, rgba(2, 6, 23, 0.8), rgba(2, 6, 23, 0.18));
    border: 0;
    text-align: center;
}

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

.big-play {
    display: grid;
    place-items: center;
    width: 5rem;
    height: 5rem;
    padding-left: 0.2rem;
    background: rgba(16, 185, 129, 0.92);
    border-radius: 999px;
    box-shadow: 0 0 40px rgba(16, 185, 129, 0.5);
    font-size: 2rem;
}

.player-controls {
    position: absolute;
    z-index: 6;
    right: 0;
    bottom: 0;
    left: 0;
    display: flex;
    gap: 0.8rem;
    align-items: center;
    padding: 1rem;
    background: linear-gradient(to top, rgba(2, 6, 23, 0.92), transparent);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.video-player:hover .player-controls,
.video-player.playing .player-controls {
    opacity: 1;
}

.player-controls button {
    min-height: 2.4rem;
    color: #fff;
    background: rgba(15, 23, 42, 0.78);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 0.65rem;
    padding: 0.35rem 0.7rem;
}

.player-controls button:hover {
    color: var(--accent-light);
    border-color: rgba(52, 211, 153, 0.52);
}

.player-error {
    position: absolute;
    z-index: 8;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 2rem;
    color: var(--danger);
    background: rgba(2, 6, 23, 0.92);
    text-align: center;
}

.detail-title {
    padding: 1.7rem 0;
}

.detail-title h1 {
    font-size: clamp(2rem, 3.2vw, 3.2rem);
}

.detail-meta {
    margin-top: 1rem;
}

.content-panel,
.tag-panel,
.side-card {
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.content-panel h2,
.tag-panel h2,
.side-card h2 {
    margin: 0 0 0.8rem;
    color: #fff;
    font-size: 1.18rem;
}

.content-panel p,
.side-card p {
    margin: 0;
    color: var(--muted-strong);
    white-space: pre-line;
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.tag-list a,
.category-link {
    display: inline-flex;
    padding: 0.35rem 0.7rem;
    color: var(--accent-light);
    background: var(--accent-soft);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 999px;
    font-size: 0.88rem;
}

.detail-side {
    position: sticky;
    top: 5.2rem;
}

.related-list {
    display: grid;
    gap: 0.85rem;
}

.related-item {
    display: grid;
    grid-template-columns: 7rem 1fr;
    gap: 0.75rem;
    align-items: center;
}

.related-item:hover strong {
    color: var(--accent-light);
}

.related-item img {
    width: 7rem;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: 0.65rem;
    background: #0f172a;
}

.related-item span {
    min-width: 0;
}

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

.related-item strong {
    color: var(--text);
    font-size: 0.9rem;
    transition: color 0.2s ease;
}

.related-item em {
    color: var(--muted);
    font-size: 0.8rem;
    font-style: normal;
}

.site-footer {
    margin-top: 3rem;
    background: rgba(15, 23, 42, 0.82);
    border-top: 1px solid var(--line);
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr 1fr;
    gap: 2rem;
    padding: 3rem 0;
}

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

.footer-grid h2 {
    margin: 0 0 1rem;
    color: #fff;
    font-size: 1rem;
}

.footer-links {
    display: grid;
    gap: 0.45rem;
}

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

.footer-links a:hover {
    color: var(--accent-light);
}

.footer-bottom {
    padding: 1.2rem;
    color: #64748b;
    border-top: 1px solid var(--line);
    text-align: center;
    font-size: 0.88rem;
}

[hidden] {
    display: none !important;
}

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

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

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

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

    .detail-side {
        position: static;
    }
}

@media (max-width: 760px) {
    .container {
        width: min(100% - 1rem, 1280px);
    }

    .menu-toggle {
        display: inline-flex;
    }

    .nav-links {
        position: fixed;
        top: 4rem;
        right: 0.75rem;
        left: 0.75rem;
        display: none;
        flex-direction: column;
        align-items: stretch;
        gap: 0.35rem;
        padding: 0.85rem;
        background: var(--panel-strong);
        border: 1px solid var(--line);
        border-radius: 1rem;
        box-shadow: var(--shadow);
    }

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

    .nav-link {
        padding: 0.75rem;
        border-radius: 0.65rem;
    }

    .nav-link:hover,
    .nav-link.active {
        background: rgba(30, 41, 59, 0.6);
    }

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

    .hero-content {
        padding-bottom: 6rem;
    }

    .hero-nav {
        display: none;
    }

    .hero-thumbs {
        display: none;
    }

    .section-head {
        display: block;
    }

    .section-more {
        margin-top: 1rem;
    }

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

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

    .rank-row,
    .ranking-card a {
        grid-template-columns: 2.5rem 6.5rem 1fr;
    }

    .rank-score,
    .ranking-score {
        grid-column: 3;
        justify-self: start;
    }

    .ranking-copy em {
        white-space: normal;
    }

    .related-item {
        grid-template-columns: 6.4rem 1fr;
    }
}
