:root {
    color-scheme: dark;
    --bg: #020617;
    --panel: rgba(15, 23, 42, 0.78);
    --panel-strong: rgba(15, 23, 42, 0.94);
    --line: rgba(148, 163, 184, 0.22);
    --text: #f8fafc;
    --muted: #94a3b8;
    --cyan: #22d3ee;
    --blue: #3b82f6;
    --green: #22c55e;
    --shadow: 0 22px 60px rgba(2, 8, 23, 0.48);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at 20% 0%, rgba(34, 211, 238, 0.16), transparent 34rem),
        radial-gradient(circle at 90% 10%, rgba(59, 130, 246, 0.14), transparent 32rem),
        linear-gradient(135deg, #020617 0%, #0f172a 52%, #020617 100%);
    color: var(--text);
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
    -webkit-font-smoothing: antialiased;
}

img {
    max-width: 100%;
}

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

button,
input {
    font: inherit;
}

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

.site-header {
    position: sticky;
    top: 0;
    z-index: 90;
    background: linear-gradient(90deg, rgba(2, 6, 23, 0.96), rgba(15, 23, 42, 0.94), rgba(2, 6, 23, 0.96));
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
    box-shadow: 0 12px 36px rgba(2, 8, 23, 0.28);
    backdrop-filter: blur(14px);
}

.nav-shell {
    height: 68px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

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

.brand-mark {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--blue), var(--cyan));
    box-shadow: 0 14px 28px rgba(34, 211, 238, 0.22);
    font-weight: 900;
}

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

.brand-text strong,
.footer-brand {
    font-size: 1.26rem;
    font-weight: 900;
    letter-spacing: 0.02em;
    background: linear-gradient(90deg, #60a5fa, #22d3ee);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.brand-text em {
    margin-top: 4px;
    color: var(--muted);
    font-style: normal;
    font-size: 0.78rem;
}

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

.desktop-nav a,
.mobile-nav a {
    padding: 10px 15px;
    color: #cbd5e1;
    border-radius: 12px;
    transition: 0.24s ease;
}

.desktop-nav a:hover,
.mobile-nav a:hover {
    color: #ffffff;
    background: rgba(51, 65, 85, 0.58);
}

.menu-toggle {
    display: none;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 12px;
    background: rgba(51, 65, 85, 0.5);
    color: #ffffff;
    padding: 10px;
}

.menu-toggle span {
    display: block;
    height: 2px;
    margin: 5px 0;
    background: #ffffff;
    border-radius: 999px;
}

.mobile-nav {
    display: none;
    border-top: 1px solid rgba(148, 163, 184, 0.16);
    padding: 10px 16px 14px;
    background: rgba(2, 6, 23, 0.98);
}

.mobile-nav.is-open {
    display: grid;
    gap: 4px;
}

.hero-slider {
    position: relative;
    min-height: 72vh;
    overflow: hidden;
    isolation: isolate;
}

.hero-slide {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transform: scale(1.02);
    transition: opacity 0.7s ease, transform 1.2s ease;
}

.hero-slide.is-active {
    opacity: 1;
    transform: scale(1);
    z-index: 2;
}

.hero-slide::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(2, 6, 23, 0.96) 0%, rgba(2, 6, 23, 0.72) 45%, rgba(2, 6, 23, 0.12) 100%),
        linear-gradient(0deg, #020617 0%, rgba(2, 6, 23, 0) 32%);
}

.hero-content {
    position: relative;
    z-index: 3;
    width: min(760px, calc(100% - 32px));
    margin: 0 auto;
    padding: 96px 0 120px;
}

.hero-kicker,
.section-kicker,
.detail-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(34, 211, 238, 0.48);
    background: rgba(34, 211, 238, 0.14);
    color: #67e8f9;
    border-radius: 999px;
    padding: 8px 14px;
    font-size: 0.92rem;
    font-weight: 700;
    backdrop-filter: blur(6px);
}

.hero-content h1 {
    margin: 24px 0 10px;
    font-size: clamp(2.2rem, 6vw, 5.2rem);
    line-height: 0.98;
    font-weight: 950;
    letter-spacing: -0.04em;
}

.hero-title {
    margin: 0 0 20px;
    color: #e0f2fe;
    font-size: clamp(1.55rem, 3.2vw, 3.2rem);
    line-height: 1.08;
    font-weight: 900;
}

.hero-desc {
    max-width: 660px;
    margin: 0 0 30px;
    color: #cbd5e1;
    font-size: clamp(1rem, 1.6vw, 1.24rem);
    line-height: 1.8;
}

.hero-actions,
.detail-actions,
.section-head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
}

.btn-primary,
.btn-secondary,
.btn-soft {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 46px;
    border-radius: 999px;
    font-weight: 850;
    transition: 0.24s ease;
}

.btn-primary {
    padding: 13px 24px;
    background: linear-gradient(90deg, var(--cyan), var(--blue));
    color: #ffffff;
    box-shadow: 0 16px 34px rgba(34, 211, 238, 0.26);
}

.btn-primary:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 18px 40px rgba(34, 211, 238, 0.36);
}

.btn-secondary,
.btn-soft {
    padding: 12px 21px;
    color: #dbeafe;
    background: rgba(15, 23, 42, 0.76);
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.btn-secondary:hover,
.btn-soft:hover {
    background: rgba(51, 65, 85, 0.72);
    color: #ffffff;
}

.hero-search {
    display: flex;
    gap: 10px;
    width: min(580px, 100%);
    margin-top: 24px;
    padding: 8px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(2, 6, 23, 0.58);
    border-radius: 999px;
    backdrop-filter: blur(10px);
}

.hero-search input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: 0;
    color: #ffffff;
    background: transparent;
    padding: 0 12px;
}

.hero-search button {
    border: 0;
    padding: 10px 18px;
    border-radius: 999px;
    background: rgba(34, 211, 238, 0.95);
    color: #06202d;
    font-weight: 850;
}

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

.hero-dot {
    width: 36px;
    height: 6px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.28);
    transition: 0.2s ease;
}

.hero-dot.is-active {
    width: 54px;
    background: linear-gradient(90deg, var(--cyan), var(--blue));
}

.section {
    padding: 72px 0;
}

.section.compact {
    padding: 42px 0;
}

.section-head {
    justify-content: space-between;
    margin-bottom: 26px;
}

.section-title h2,
.page-title h1,
.detail-content h2,
.player-section h2,
.related-section h2 {
    margin: 0;
    color: #ffffff;
    font-size: clamp(1.6rem, 3vw, 2.45rem);
    font-weight: 950;
    letter-spacing: -0.03em;
}

.section-title p,
.page-title p {
    margin: 10px 0 0;
    max-width: 760px;
    color: var(--muted);
    line-height: 1.8;
}

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

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

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

.movie-card a {
    display: block;
    height: 100%;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 22px;
    background: rgba(15, 23, 42, 0.58);
    box-shadow: 0 12px 30px rgba(2, 8, 23, 0.26);
    transition: 0.35s ease;
}

.movie-card a:hover {
    transform: translateY(-8px);
    border-color: rgba(34, 211, 238, 0.48);
    box-shadow: 0 24px 54px rgba(34, 211, 238, 0.16);
}

.poster-wrap {
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: rgba(15, 23, 42, 0.9);
}

.poster-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1);
    transition: transform 0.7s ease;
}

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

.poster-shade {
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.76), rgba(0, 0, 0, 0.06) 62%);
}

.type-badge,
.year-badge,
.rank-badge {
    position: absolute;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 4px 10px;
    border-radius: 999px;
    color: #ffffff;
    font-size: 0.76rem;
    font-weight: 800;
    backdrop-filter: blur(7px);
}

.type-badge {
    left: 12px;
    top: 12px;
    background: rgba(8, 145, 178, 0.88);
}

.year-badge {
    right: 12px;
    top: 12px;
    background: rgba(15, 23, 42, 0.72);
}

.rank-badge {
    left: 12px;
    bottom: 12px;
    background: rgba(234, 179, 8, 0.92);
    color: #1f1300;
}

.play-float {
    position: absolute;
    right: 14px;
    bottom: 14px;
    z-index: 3;
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(34, 211, 238, 0.92);
    color: #06202d;
    box-shadow: 0 12px 24px rgba(34, 211, 238, 0.32);
}

.movie-card-body {
    padding: 17px 17px 18px;
}

.movie-card h3 {
    margin: 0 0 10px;
    color: #ffffff;
    font-size: 1.04rem;
    font-weight: 900;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.movie-card p {
    margin: 0 0 14px;
    color: #94a3b8;
    line-height: 1.65;
    font-size: 0.92rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-bottom: 13px;
}

.card-tags span {
    border: 1px solid rgba(34, 211, 238, 0.22);
    background: rgba(34, 211, 238, 0.09);
    color: #a5f3fc;
    border-radius: 999px;
    padding: 4px 8px;
    font-size: 0.74rem;
}

.card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: #64748b;
    font-size: 0.8rem;
}

.card-meta span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

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

.rank-panel,
.category-panel,
.filter-panel,
.info-panel,
.detail-content,
.player-section,
.related-section {
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 26px;
    background: rgba(15, 23, 42, 0.6);
    box-shadow: var(--shadow);
    backdrop-filter: blur(12px);
}

.rank-panel {
    position: sticky;
    top: 92px;
    padding: 20px;
}

.rank-panel h2 {
    margin: 0 0 18px;
    font-size: 1.2rem;
}

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

.rank-row {
    display: grid;
    grid-template-columns: 42px 68px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    padding: 10px;
    border-radius: 18px;
    background: rgba(2, 6, 23, 0.32);
    transition: 0.24s ease;
}

.rank-row:hover {
    background: rgba(51, 65, 85, 0.46);
}

.rank-number {
    color: #67e8f9;
    font-size: 1.1rem;
    font-weight: 950;
}

.rank-row img {
    width: 68px;
    height: 52px;
    object-fit: cover;
    border-radius: 12px;
}

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

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

.rank-info strong {
    color: #ffffff;
    font-size: 0.94rem;
}

.rank-info em {
    margin-top: 5px;
    color: var(--muted);
    font-size: 0.78rem;
    font-style: normal;
}

.page-hero {
    padding: 72px 0 34px;
}

.page-title {
    max-width: 860px;
}

.filter-panel {
    display: grid;
    gap: 16px;
    padding: 18px;
    margin-bottom: 28px;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(2, 6, 23, 0.36);
    border-radius: 18px;
    padding: 12px 14px;
}

.search-box span {
    color: #67e8f9;
    font-weight: 900;
}

.search-box input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: 0;
    color: #ffffff;
    background: transparent;
}

.filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.filter-chip {
    border: 0;
    border-radius: 999px;
    padding: 9px 14px;
    color: #cbd5e1;
    background: rgba(51, 65, 85, 0.58);
    transition: 0.2s ease;
}

.filter-chip.is-active,
.filter-chip:hover {
    color: #ffffff;
    background: linear-gradient(90deg, var(--cyan), var(--blue));
}

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

.category-panel {
    padding: 22px;
    transition: 0.25s ease;
}

.category-panel:hover {
    transform: translateY(-5px);
    border-color: rgba(34, 211, 238, 0.42);
}

.category-panel strong {
    display: block;
    margin-bottom: 9px;
    color: #ffffff;
    font-size: 1.1rem;
}

.category-panel p {
    margin: 0;
    color: var(--muted);
    line-height: 1.65;
    font-size: 0.92rem;
}

.detail-hero {
    position: relative;
    padding: 64px 0 52px;
    overflow: hidden;
}

.detail-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(2, 6, 23, 0.96), rgba(2, 6, 23, 0.74), rgba(2, 6, 23, 0.32)), var(--detail-bg, none);
    background-size: cover;
    background-position: center;
    filter: saturate(1.04);
}

.detail-shell {
    position: relative;
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    gap: 34px;
    align-items: center;
}

.detail-cover {
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 28px;
    box-shadow: 0 24px 70px rgba(2, 8, 23, 0.48);
    background: rgba(15, 23, 42, 0.88);
}

.detail-cover img {
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
}

.detail-info h1 {
    margin: 18px 0 16px;
    color: #ffffff;
    font-size: clamp(2rem, 5vw, 4.5rem);
    line-height: 1.04;
    font-weight: 950;
    letter-spacing: -0.045em;
}

.detail-info p {
    max-width: 760px;
    margin: 0 0 20px;
    color: #cbd5e1;
    font-size: 1.12rem;
    line-height: 1.86;
}

.meta-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 0 24px;
}

.meta-pills span {
    padding: 7px 12px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.64);
    color: #e2e8f0;
    font-size: 0.88rem;
}

.detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 330px;
    gap: 28px;
    padding: 46px 0 72px;
}

.player-section,
.detail-content,
.related-section {
    padding: 26px;
    margin-bottom: 26px;
}

.player-frame {
    position: relative;
    overflow: hidden;
    margin-top: 18px;
    border-radius: 24px;
    background: #000000;
    aspect-ratio: 16 / 9;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
}

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

.player-cover {
    position: absolute;
    inset: 0;
    z-index: 4;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    border: 0;
    color: #ffffff;
    background: rgba(2, 6, 23, 0.28);
    cursor: pointer;
    transition: opacity 0.24s ease, visibility 0.24s ease;
}

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

.player-cover img {
    position: absolute;
    inset: 0;
    z-index: -2;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.62;
}

.player-cover::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(0deg, rgba(2, 6, 23, 0.74), rgba(2, 6, 23, 0.2));
}

.play-button {
    width: 82px;
    height: 82px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--cyan), var(--blue));
    color: #ffffff;
    font-size: 2rem;
    box-shadow: 0 20px 46px rgba(34, 211, 238, 0.32);
}

.watch-label {
    font-weight: 900;
    letter-spacing: 0.08em;
}

.detail-content p {
    margin: 14px 0 24px;
    color: #cbd5e1;
    line-height: 1.95;
    font-size: 1rem;
}

.side-card {
    padding: 20px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 24px;
    background: rgba(15, 23, 42, 0.58);
}

.side-card h2 {
    margin: 0 0 16px;
    font-size: 1.15rem;
}

.related-mini {
    display: grid;
    gap: 12px;
}

.related-mini a {
    display: grid;
    grid-template-columns: 74px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    padding: 8px;
    border-radius: 16px;
    background: rgba(2, 6, 23, 0.28);
}

.related-mini img {
    width: 74px;
    height: 56px;
    object-fit: cover;
    border-radius: 12px;
}

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

.related-mini strong {
    color: #ffffff;
    font-size: 0.92rem;
}

.related-mini em {
    margin-top: 6px;
    color: var(--muted);
    font-style: normal;
    font-size: 0.78rem;
}

.empty-state {
    display: none;
    padding: 42px 20px;
    text-align: center;
    color: var(--muted);
    border: 1px dashed rgba(148, 163, 184, 0.24);
    border-radius: 22px;
}

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

.site-footer {
    border-top: 1px solid rgba(148, 163, 184, 0.16);
    background: linear-gradient(135deg, rgba(2, 6, 23, 0.98), rgba(15, 23, 42, 0.96));
    padding: 44px 0 26px;
}

.footer-grid {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
}

.footer-grid p {
    max-width: 620px;
    color: var(--muted);
    line-height: 1.8;
}

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

.footer-links a {
    color: #cbd5e1;
    border-radius: 999px;
    background: rgba(51, 65, 85, 0.42);
    padding: 10px 14px;
}

.footer-copy {
    margin-top: 28px;
    color: #64748b;
    font-size: 0.9rem;
}

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

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

    .rank-panel {
        position: static;
    }
}

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

    .menu-toggle {
        display: block;
    }

    .hero-slider {
        min-height: 78vh;
    }

    .hero-content {
        padding-top: 78px;
        padding-bottom: 108px;
    }

    .hero-actions,
    .section-head,
    .footer-grid {
        align-items: flex-start;
        flex-direction: column;
    }

    .hero-search {
        border-radius: 22px;
        flex-direction: column;
    }

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

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

    .detail-cover {
        max-width: 260px;
    }
}

@media (max-width: 520px) {
    .container {
        width: min(100% - 22px, 1180px);
    }

    .brand-text strong {
        font-size: 1.02rem;
    }

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

    .poster-wrap {
        aspect-ratio: 16 / 9;
    }

    .rank-row {
        grid-template-columns: 34px 60px minmax(0, 1fr);
    }

    .rank-row img {
        width: 60px;
        height: 48px;
    }
}
