:root {
    color-scheme: dark;
    --bg: #020617;
    --panel: rgba(15, 23, 42, 0.74);
    --panel-strong: rgba(15, 23, 42, 0.94);
    --card: rgba(15, 23, 42, 0.72);
    --card-soft: rgba(30, 41, 59, 0.54);
    --line: rgba(51, 65, 85, 0.72);
    --line-soft: rgba(51, 65, 85, 0.42);
    --text: #f8fafc;
    --muted: #cbd5e1;
    --subtle: #94a3b8;
    --deep: #0f172a;
    --accent: #fbbf24;
    --accent-soft: rgba(251, 191, 36, 0.12);
    --shadow: 0 24px 80px rgba(2, 6, 23, 0.48);
    --radius-xl: 28px;
    --radius-lg: 20px;
    --radius-md: 14px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(30, 64, 175, 0.32), transparent 34rem),
        radial-gradient(circle at top right, rgba(120, 53, 15, 0.18), transparent 36rem),
        var(--bg);
    color: var(--text);
    font-family: Inter, 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%;
}

img.image-missing {
    opacity: 0;
}

button,
input,
select {
    font: inherit;
}

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

.site-header.is-scrolled {
    background: rgba(2, 6, 23, 0.94);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.24);
}

.nav-shell {
    width: min(1280px, calc(100% - 32px));
    height: 68px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-width: max-content;
}

.brand-mark {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: linear-gradient(135deg, #f8fafc, #94a3b8);
    color: #0f172a;
    font-weight: 900;
    box-shadow: var(--shadow);
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.brand-text strong {
    color: var(--text);
    font-size: 17px;
    letter-spacing: 0.02em;
}

.brand-text small {
    color: var(--subtle);
    font-size: 12px;
}

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

.desktop-nav a {
    color: var(--muted);
    padding: 9px 13px;
    border-radius: 999px;
    font-size: 14px;
    transition: 0.22s ease;
}

.desktop-nav a:hover,
.desktop-nav a.is-active {
    color: var(--text);
    background: rgba(30, 41, 59, 0.9);
}

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

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

.mobile-nav {
    display: none;
    width: min(1280px, calc(100% - 32px));
    margin: 0 auto 16px;
    padding: 10px;
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-md);
    background: var(--panel-strong);
}

.mobile-nav a {
    display: block;
    padding: 12px 14px;
    color: var(--muted);
    border-radius: 10px;
}

.mobile-nav a:hover {
    color: var(--text);
    background: rgba(30, 41, 59, 0.8);
}

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

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

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

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

.hero-layer {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(to top, #020617 4%, rgba(2, 6, 23, 0.72) 42%, rgba(2, 6, 23, 0.18) 100%),
        linear-gradient(to right, rgba(2, 6, 23, 0.82), rgba(2, 6, 23, 0.16));
}

.hero-content {
    position: absolute;
    left: max(24px, calc((100vw - 1280px) / 2 + 24px));
    right: 24px;
    bottom: 92px;
    max-width: 820px;
}

.hero-kicker {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 18px;
}

.hero-kicker span,
.detail-badges span,
.detail-tags span {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 4px 11px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.72);
    color: var(--muted);
    font-size: 13px;
}

.hero-content h1,
.hero-content h2 {
    margin: 0 0 16px;
    max-width: 760px;
    color: var(--text);
    font-size: clamp(36px, 6vw, 78px);
    line-height: 1.03;
    letter-spacing: -0.05em;
}

.hero-content h2 + p,
.hero-content h1 + h2 + p {
    max-width: 720px;
}

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

.hero-actions,
.category-strip,
.detail-badges,
.detail-tags,
.footer-links,
.pagination,
.hero-dots {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.primary-btn,
.ghost-btn,
.search-bar button,
.filter-bar button,
.card-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 20px;
    border-radius: 12px;
    font-weight: 700;
    transition: transform 0.22s ease, background 0.22s ease, border-color 0.22s ease;
}

.primary-btn,
.search-bar button,
.filter-bar button,
.card-link {
    border: 0;
    color: #0f172a;
    background: linear-gradient(135deg, #f8fafc, #cbd5e1);
}

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

.primary-btn:hover,
.ghost-btn:hover,
.search-bar button:hover,
.filter-bar button:hover,
.card-link:hover {
    transform: translateY(-2px);
}

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

.hero-dots button {
    width: 28px;
    height: 4px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: rgba(226, 232, 240, 0.35);
    cursor: pointer;
}

.hero-dots button.is-active {
    width: 48px;
    background: #f8fafc;
}

.section-shell {
    width: min(1280px, calc(100% - 32px));
    margin: 0 auto;
    padding: 64px 0;
}

.quick-search {
    padding-top: 34px;
    padding-bottom: 34px;
}

.search-bar,
.filter-bar {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--line-soft);
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(16px);
}

.filter-bar {
    grid-template-columns: minmax(220px, 1fr) 180px 160px auto;
}

.search-bar input,
.filter-bar input,
.filter-bar select {
    width: 100%;
    min-height: 48px;
    padding: 0 16px;
    border: 1px solid var(--line-soft);
    border-radius: 13px;
    outline: none;
    background: rgba(2, 6, 23, 0.62);
    color: var(--text);
}

.search-bar input:focus,
.filter-bar input:focus,
.filter-bar select:focus {
    border-color: rgba(248, 250, 252, 0.5);
}

.category-strip {
    margin-top: 18px;
}

.category-strip a {
    padding: 8px 13px;
    border: 1px solid var(--line-soft);
    border-radius: 999px;
    color: var(--muted);
    background: rgba(15, 23, 42, 0.55);
    transition: 0.2s ease;
}

.category-strip a:hover {
    color: var(--text);
    border-color: var(--line);
    background: rgba(30, 41, 59, 0.82);
}

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

.section-heading span,
.page-hero span,
.category-card span,
.panel-title span {
    color: var(--accent);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.section-heading h2 {
    margin: 2px 0 0;
    font-size: clamp(26px, 4vw, 44px);
    line-height: 1.1;
    letter-spacing: -0.04em;
}

.section-heading a,
.panel-title a {
    color: var(--muted);
    font-weight: 700;
}

.section-heading a:hover,
.panel-title a:hover {
    color: var(--text);
}

.compact-heading {
    align-items: start;
    flex-direction: column;
}

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

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

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

.movie-card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--line-soft);
    border-radius: 20px;
    background: var(--card);
    box-shadow: 0 16px 60px rgba(2, 6, 23, 0.2);
    transition: transform 0.28s ease, border-color 0.28s ease, background 0.28s ease, box-shadow 0.28s ease;
}

.movie-card:hover {
    transform: translateY(-5px);
    border-color: rgba(148, 163, 184, 0.62);
    background: rgba(15, 23, 42, 0.96);
    box-shadow: 0 28px 90px rgba(2, 6, 23, 0.42);
}

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

.featured-grid .poster-wrap {
    aspect-ratio: 16 / 10;
}

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

.movie-card:hover .poster-wrap img {
    transform: scale(1.07);
}

.quality-badge,
.duration-badge,
.rank-mark {
    position: absolute;
    z-index: 2;
    padding: 4px 8px;
    border-radius: 999px;
    color: #0f172a;
    background: rgba(248, 250, 252, 0.94);
    font-size: 11px;
    font-weight: 900;
}

.quality-badge {
    top: 10px;
    left: 10px;
}

.duration-badge {
    right: 10px;
    bottom: 10px;
    color: #e2e8f0;
    background: rgba(2, 6, 23, 0.78);
}

.rank-mark {
    top: 10px;
    right: 10px;
    color: #0f172a;
    background: var(--accent);
}

.movie-info {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 7px;
    padding: 14px;
}

.movie-info strong {
    color: var(--text);
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.movie-info span {
    color: var(--subtle);
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.movie-info em {
    color: var(--muted);
    font-size: 13px;
    font-style: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.movie-card-small {
    flex-direction: row;
    min-height: 132px;
}

.movie-card-small .poster-wrap {
    width: 94px;
    min-width: 94px;
    aspect-ratio: 3 / 4;
}

.movie-card-small .quality-badge,
.movie-card-small .duration-badge {
    display: none;
}

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

.ranking-panel,
.sidebar-box,
.rank-column,
.detail-card,
.category-card,
.search-panel {
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-lg);
    background: var(--panel);
    box-shadow: 0 18px 80px rgba(2, 6, 23, 0.2);
}

.ranking-panel,
.sidebar-box,
.rank-column,
.detail-card,
.search-panel {
    padding: 22px;
}

.panel-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.ranking-item {
    display: grid;
    grid-template-columns: 34px 56px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--line-soft);
}

.ranking-item:last-child {
    border-bottom: 0;
}

.ranking-item img {
    width: 56px;
    height: 74px;
    object-fit: cover;
    border-radius: 10px;
    background: #0f172a;
}

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

.ranking-item small {
    color: var(--subtle);
    font-size: 12px;
}

.ranking-item b,
.list-rank {
    color: var(--accent);
}

.list-rank {
    font-weight: 900;
    text-align: center;
}

.page-hero {
    position: relative;
    overflow: hidden;
    background:
        linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(2, 6, 23, 0.6)),
        radial-gradient(circle at 20% 20%, rgba(251, 191, 36, 0.12), transparent 26rem);
}

.small-hero {
    padding: 78px max(24px, calc((100vw - 1280px) / 2 + 24px)) 64px;
    border-bottom: 1px solid var(--line-soft);
}

.page-hero div {
    max-width: 820px;
}

.page-hero h1 {
    margin: 10px 0 16px;
    font-size: clamp(34px, 5vw, 64px);
    line-height: 1.05;
    letter-spacing: -0.05em;
}

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

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

.category-card {
    padding: 26px;
    min-height: 280px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.category-card h2 {
    margin: 0;
    font-size: 28px;
}

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

.category-samples {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: auto;
}

.category-samples a {
    color: var(--subtle);
    padding: 5px 9px;
    border-radius: 999px;
    background: rgba(30, 41, 59, 0.58);
    font-size: 13px;
}

.card-link {
    align-self: flex-start;
    margin-top: 6px;
}

.rank-layout {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
    align-items: start;
}

.rank-column h2,
.sidebar-box h2,
.detail-card h2 {
    margin: 0 0 16px;
}

.filter-bar {
    margin-bottom: 24px;
}

.search-grid {
    max-height: 1400px;
    overflow: auto;
    padding-right: 4px;
}

.empty-result {
    margin: 0 0 18px;
    color: var(--accent);
    font-weight: 700;
}

.pagination {
    justify-content: center;
    margin-top: 34px;
}

.pagination a,
.pagination span,
.pagination strong {
    min-width: 42px;
    height: 42px;
    display: inline-grid;
    place-items: center;
    padding: 0 12px;
    border: 1px solid var(--line-soft);
    border-radius: 12px;
    color: var(--muted);
    background: rgba(15, 23, 42, 0.58);
}

.pagination strong,
.pagination a:hover {
    color: var(--text);
    border-color: var(--line);
    background: rgba(30, 41, 59, 0.82);
}

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

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

.watch-page {
    padding-top: 34px;
}

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

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

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

.play-button {
    position: absolute;
    inset: auto auto 28px 28px;
    min-height: 52px;
    padding: 0 22px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    border: 0;
    border-radius: 999px;
    color: #0f172a;
    background: rgba(248, 250, 252, 0.96);
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 16px 42px rgba(0, 0, 0, 0.36);
    z-index: 4;
}

.play-button span {
    width: 30px;
    height: 30px;
    display: inline-grid;
    place-items: center;
    border-radius: 50%;
    background: #0f172a;
    color: #f8fafc;
    font-size: 13px;
}

.player-card.is-playing .play-button,
.play-button[hidden] {
    display: none;
}

.detail-card {
    margin-top: 22px;
}

.detail-card h1 {
    margin: 18px 0 12px;
    font-size: clamp(30px, 5vw, 54px);
    line-height: 1.1;
    letter-spacing: -0.04em;
}

.lead-text {
    color: #dbeafe;
    font-size: 19px;
}

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

.detail-card p {
    color: var(--muted);
}

.sidebar-box {
    position: sticky;
    top: 92px;
}

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

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

.footer-shell strong {
    font-size: 22px;
}

.footer-shell p {
    max-width: 680px;
    color: var(--subtle);
}

.footer-links a {
    padding: 7px 10px;
    border-radius: 999px;
    color: var(--muted);
    background: rgba(15, 23, 42, 0.72);
}

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

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

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

    .split-layout,
    .watch-layout,
    .footer-shell {
        grid-template-columns: 1fr;
    }

    .sidebar-box {
        position: static;
    }
}

@media (max-width: 820px) {
    .desktop-nav {
        display: none;
    }

    .menu-toggle {
        display: block;
    }

    .mobile-nav.is-open {
        display: block;
    }

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

    .hero-content {
        left: 20px;
        right: 20px;
        bottom: 76px;
    }

    .hero-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .primary-btn,
    .ghost-btn {
        width: 100%;
    }

    .search-bar,
    .filter-bar {
        grid-template-columns: 1fr;
    }

    .movie-grid,
    .featured-grid,
    .compact-grid,
    .rank-layout,
    .category-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px;
    }

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

    .section-shell {
        padding: 42px 0;
    }

    .ranking-panel,
    .sidebar-box,
    .rank-column,
    .detail-card,
    .search-panel {
        padding: 16px;
    }

    .ranking-item {
        grid-template-columns: 28px 50px minmax(0, 1fr) auto;
    }

    .ranking-item img {
        width: 50px;
        height: 66px;
    }
}

@media (max-width: 560px) {
    .brand-text small {
        display: none;
    }

    .nav-shell,
    .section-shell,
    .footer-shell,
    .mobile-nav {
        width: min(100% - 24px, 1280px);
    }

    .hero-content h1,
    .hero-content h2,
    .page-hero h1 {
        letter-spacing: -0.03em;
    }

    .movie-grid,
    .featured-grid,
    .compact-grid,
    .category-grid,
    .rank-layout {
        grid-template-columns: 1fr;
    }

    .search-grid {
        max-height: none;
    }

    .movie-card-small {
        min-height: 118px;
    }

    .movie-card-small .poster-wrap {
        width: 84px;
        min-width: 84px;
    }

    .small-hero {
        padding: 56px 16px 44px;
    }

    .play-button {
        left: 16px;
        bottom: 16px;
    }
}
