:root {
    --bg: #020617;
    --bg-soft: #0f172a;
    --card: rgba(15, 23, 42, 0.74);
    --card-strong: rgba(30, 41, 59, 0.92);
    --line: rgba(148, 163, 184, 0.24);
    --line-strong: rgba(34, 211, 238, 0.42);
    --text: #e2e8f0;
    --muted: #94a3b8;
    --soft: #cbd5e1;
    --cyan: #22d3ee;
    --cyan-deep: #0891b2;
    --blue: #60a5fa;
    --yellow: #facc15;
    --shadow: 0 24px 60px rgba(0, 0, 0, 0.38);
    --radius: 18px;
}

* {
    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(8, 145, 178, 0.22), transparent 30rem),
        radial-gradient(circle at 90% 8%, rgba(37, 99, 235, 0.18), transparent 26rem),
        linear-gradient(180deg, #020617 0%, #0f172a 48%, #020617 100%);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    line-height: 1.6;
}

img,
video {
    display: block;
    max-width: 100%;
}

img {
    object-fit: cover;
}

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

button,
input,
select {
    font: inherit;
}

button {
    cursor: pointer;
}

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

.header-inner {
    width: min(1220px, calc(100% - 32px));
    height: 72px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 24px;
}

.logo {
    flex: 0 0 auto;
    font-size: 24px;
    font-weight: 900;
    letter-spacing: -0.04em;
    background: linear-gradient(90deg, var(--cyan), var(--blue));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    white-space: nowrap;
}

.desktop-nav {
    display: flex;
    align-items: center;
    gap: 18px;
    color: var(--soft);
    font-size: 15px;
    font-weight: 700;
}

.desktop-nav a,
.mobile-panel a,
.site-footer a {
    transition: color 0.18s ease, transform 0.18s ease;
}

.desktop-nav a:hover,
.mobile-panel a:hover,
.site-footer a:hover {
    color: var(--cyan);
}

.header-search {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-search input,
.home-search-block input,
.filter-panel input,
.filter-panel select {
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.72);
    color: var(--text);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.header-search input {
    width: 240px;
    padding: 10px 12px;
}

.header-search input:focus,
.home-search-block input:focus,
.filter-panel input:focus,
.filter-panel select:focus {
    border-color: var(--cyan);
    box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.14);
    background: rgba(15, 23, 42, 0.95);
}

.header-search button,
.home-search-block button {
    border: 0;
    border-radius: 12px;
    padding: 10px 16px;
    color: #00131a;
    font-weight: 900;
    background: linear-gradient(90deg, var(--cyan), var(--blue));
}

.menu-toggle {
    display: none;
    width: 42px;
    height: 42px;
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.74);
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
}

.menu-toggle span {
    width: 18px;
    height: 2px;
    border-radius: 3px;
    background: var(--text);
}

.mobile-panel {
    display: none;
    border-top: 1px solid rgba(148, 163, 184, 0.16);
    background: rgba(2, 6, 23, 0.94);
}

.mobile-panel nav {
    width: min(1220px, calc(100% - 32px));
    margin: 0 auto;
    padding: 18px 0 22px;
    display: grid;
    gap: 12px;
    color: var(--soft);
    font-weight: 800;
}

.mobile-open .mobile-panel {
    display: block;
}

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

.hero-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.9s ease;
    background-size: cover;
    background-position: center;
}

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

.hero-shade {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(2, 6, 23, 0.94) 0%, rgba(2, 6, 23, 0.78) 38%, rgba(2, 6, 23, 0.2) 72%, rgba(2, 6, 23, 0.92) 100%),
        linear-gradient(180deg, rgba(2, 6, 23, 0.25) 0%, rgba(2, 6, 23, 0.95) 100%);
}

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

.eyebrow {
    margin: 0 0 14px;
    color: var(--cyan);
    font-size: 14px;
    font-weight: 900;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.hero-content h1,
.hero-content h2 {
    margin: 0;
    max-width: 760px;
    letter-spacing: -0.06em;
    line-height: 1.05;
}

.hero-content h1 {
    font-size: clamp(42px, 7vw, 86px);
    font-weight: 1000;
}

.hero-content h2 {
    margin-top: 12px;
    font-size: clamp(28px, 4vw, 50px);
    font-weight: 900;
    color: #f8fafc;
}

.hero-summary {
    max-width: 680px;
    margin: 22px 0 0;
    color: var(--soft);
    font-size: 18px;
}

.hero-actions,
.hero-chips {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.hero-actions {
    margin-top: 32px;
}

.hero-chips {
    margin-top: 22px;
}

.hero-chips a,
.tag-row span {
    display: inline-flex;
    align-items: center;
    border: 1px solid rgba(34, 211, 238, 0.22);
    border-radius: 999px;
    background: rgba(8, 145, 178, 0.12);
    color: #a5f3fc;
    font-size: 13px;
    font-weight: 800;
}

.hero-chips a {
    padding: 8px 14px;
}

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

.hero-dot {
    width: 10px;
    height: 10px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.5);
    transition: width 0.22s ease, background 0.22s ease;
}

.hero-dot.is-active {
    width: 34px;
    background: var(--cyan);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 20px;
    border-radius: 14px;
    font-weight: 950;
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

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

.btn-primary {
    color: #00131a;
    background: linear-gradient(90deg, var(--cyan), var(--blue));
    box-shadow: 0 18px 36px rgba(34, 211, 238, 0.22);
}

.btn-ghost {
    color: var(--text);
    border: 1px solid rgba(148, 163, 184, 0.28);
    background: rgba(15, 23, 42, 0.56);
}

.home-search-block,
.page-hero,
.section-block,
.filter-panel,
.detail-wrap,
.site-footer {
    width: min(1220px, calc(100% - 32px));
    margin-left: auto;
    margin-right: auto;
}

.home-search-block {
    margin-top: -58px;
    position: relative;
    z-index: 10;
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 28px;
    align-items: center;
    padding: 28px;
    border: 1px solid rgba(34, 211, 238, 0.24);
    border-radius: 24px;
    background: rgba(15, 23, 42, 0.86);
    box-shadow: var(--shadow);
    backdrop-filter: blur(14px);
}

.home-search-block h2,
.page-hero h1,
.section-title h2,
.detail-info h1,
.text-card h2,
.site-footer h2,
.site-footer h3 {
    margin: 0;
    color: #fff;
}

.home-search-block h2 {
    font-size: clamp(24px, 3vw, 36px);
    letter-spacing: -0.04em;
}

.home-search-block p,
.page-hero p,
.detail-info .lead,
.text-card p,
.site-footer p {
    color: var(--soft);
}

.home-search-block form {
    display: flex;
    gap: 10px;
}

.home-search-block input {
    flex: 1;
    min-width: 0;
    padding: 14px 16px;
}

.home-search-block button {
    padding: 0 22px;
}

.section-block {
    padding: 58px 0 0;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.section-title.left {
    justify-content: flex-start;
}

.section-title span {
    width: 5px;
    height: 34px;
    border-radius: 99px;
    background: linear-gradient(180deg, var(--cyan), var(--blue));
}

.section-title h2 {
    font-size: 28px;
    font-weight: 950;
    letter-spacing: -0.04em;
}

.section-title a {
    margin-left: auto;
    color: var(--cyan);
    font-weight: 850;
}

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

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

.movie-card {
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: var(--radius);
    background: var(--card);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
    transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease, background 0.22s ease;
}

.movie-card:hover {
    transform: translateY(-5px);
    border-color: var(--line-strong);
    background: rgba(15, 23, 42, 0.94);
    box-shadow: 0 20px 42px rgba(8, 145, 178, 0.18);
}

.poster-wrap {
    position: relative;
    display: block;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: #111827;
}

.poster-wrap img {
    width: 100%;
    height: 100%;
    transition: transform 0.35s ease;
}

.movie-card:hover .poster-wrap img,
.category-card:hover img,
.small-card:hover img {
    transform: scale(1.06);
}

.poster-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 4px 9px;
    border-radius: 999px;
    color: #00131a;
    background: var(--cyan);
    font-size: 12px;
    font-weight: 950;
}

.play-float {
    position: absolute;
    right: 12px;
    bottom: 12px;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: rgba(2, 6, 23, 0.74);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.24);
    opacity: 0;
    transform: scale(0.92);
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.movie-card:hover .play-float {
    opacity: 1;
    transform: scale(1);
}

.card-content {
    padding: 16px;
}

.card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.card-content h3 {
    margin: 10px 0 8px;
    color: #fff;
    font-size: 18px;
    line-height: 1.35;
}

.card-content h3 a:hover {
    color: var(--cyan);
}

.card-content p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
}

.tag-row {
    margin-top: 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-row span {
    padding: 4px 9px;
}

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

.rank-panel,
.category-panel,
.text-card {
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: var(--radius);
    background: rgba(15, 23, 42, 0.64);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.2);
}

.rank-panel {
    padding: 20px;
}

.sticky-rank {
    position: sticky;
    top: 96px;
}

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

.rank-item {
    display: grid;
    grid-template-columns: 34px 58px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    padding: 10px;
    border-radius: 14px;
    background: rgba(30, 41, 59, 0.42);
    transition: background 0.18s ease, transform 0.18s ease;
}

.rank-item:hover {
    transform: translateX(4px);
    background: rgba(8, 145, 178, 0.16);
}

.rank-num {
    color: var(--yellow);
    font-size: 20px;
    font-weight: 1000;
    text-align: center;
}

.rank-item img {
    width: 58px;
    height: 58px;
    border-radius: 12px;
}

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

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

.rank-text strong {
    color: #fff;
    font-size: 14px;
}

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

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

.category-panel {
    padding: 20px;
}

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

.panel-heading h3 {
    margin: 0;
    color: #fff;
    font-size: 20px;
}

.panel-heading a {
    color: var(--cyan);
    font-weight: 800;
}

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

.small-card {
    position: relative;
    overflow: hidden;
    min-height: 132px;
    border-radius: 15px;
    background: #111827;
}

.small-card img {
    width: 100%;
    height: 132px;
    transition: transform 0.35s ease;
}

.small-card:after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 0%, rgba(2, 6, 23, 0.9) 100%);
}

.small-card span {
    position: absolute;
    z-index: 2;
    left: 12px;
    right: 12px;
    bottom: 10px;
    color: #fff;
    font-weight: 900;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.page-hero {
    margin-top: 40px;
    padding: 70px 42px;
    border: 1px solid rgba(34, 211, 238, 0.2);
    border-radius: 30px;
    background:
        radial-gradient(circle at 18% 18%, rgba(34, 211, 238, 0.2), transparent 24rem),
        linear-gradient(135deg, rgba(15, 23, 42, 0.92), rgba(2, 6, 23, 0.86));
    box-shadow: var(--shadow);
}

.page-hero.slim {
    padding-top: 56px;
    padding-bottom: 56px;
}

.page-hero h1 {
    font-size: clamp(36px, 5vw, 62px);
    line-height: 1.08;
    letter-spacing: -0.06em;
}

.page-hero p:last-child {
    max-width: 760px;
    margin: 18px 0 0;
    font-size: 17px;
}

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

.category-card {
    position: relative;
    min-height: 238px;
    overflow: hidden;
    border-radius: 22px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    background: #111827;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.22);
}

.category-card img {
    width: 100%;
    height: 238px;
    transition: transform 0.35s ease;
}

.category-layer {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(2, 6, 23, 0.04) 0%, rgba(2, 6, 23, 0.92) 100%);
}

.category-card strong,
.category-card em {
    position: absolute;
    z-index: 2;
    left: 18px;
    right: 18px;
}

.category-card strong {
    bottom: 74px;
    color: #fff;
    font-size: 22px;
    font-weight: 1000;
}

.category-card em {
    bottom: 18px;
    color: var(--soft);
    font-style: normal;
    font-size: 13px;
}

.filter-panel {
    margin-top: 26px;
    padding: 22px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 22px;
    background: rgba(15, 23, 42, 0.7);
}

.filter-grid {
    display: grid;
    grid-template-columns: 1.4fr repeat(3, 1fr);
    gap: 16px;
}

.filter-grid label {
    display: grid;
    gap: 8px;
    color: var(--soft);
    font-size: 13px;
    font-weight: 900;
}

.filter-grid input,
.filter-grid select {
    width: 100%;
    padding: 12px 14px;
}

.movie-card[hidden] {
    display: none;
}

.detail-hero {
    position: relative;
    overflow: hidden;
    padding: 72px 0 38px;
    background: #020617;
}

.detail-backdrop {
    position: absolute;
    inset: 0;
    opacity: 0.28;
    filter: blur(4px);
    transform: scale(1.04);
    background-size: cover;
    background-position: center;
}

.detail-hero:after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(2, 6, 23, 0.98), rgba(2, 6, 23, 0.72), rgba(2, 6, 23, 0.96)),
        linear-gradient(180deg, rgba(2, 6, 23, 0.1), rgba(2, 6, 23, 1));
}

.detail-wrap {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: 330px minmax(0, 1fr);
    gap: 36px;
    align-items: end;
}

.detail-poster {
    overflow: hidden;
    border-radius: 24px;
    border: 1px solid rgba(148, 163, 184, 0.24);
    box-shadow: var(--shadow);
}

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

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

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

.detail-info h1 {
    font-size: clamp(36px, 5.4vw, 72px);
    line-height: 1.05;
    letter-spacing: -0.06em;
}

.detail-info .lead {
    max-width: 830px;
    margin: 20px 0 0;
    font-size: 18px;
}

.detail-stats {
    margin-top: 22px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.detail-stats span {
    padding: 8px 12px;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.72);
    color: var(--soft);
    border: 1px solid rgba(148, 163, 184, 0.2);
    font-weight: 850;
    font-size: 14px;
}

.detail-tags {
    margin: 22px 0 26px;
}

.player-section {
    padding-top: 34px;
}

.player-shell {
    position: relative;
    overflow: hidden;
    border-radius: 26px;
    border: 1px solid rgba(34, 211, 238, 0.26);
    background: #000;
    box-shadow: var(--shadow);
    aspect-ratio: 16 / 9;
}

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

.player-poster {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    border: 0;
    color: #fff;
    background: rgba(2, 6, 23, 0.28);
    backdrop-filter: blur(1px);
}

.player-shell.is-playing .player-poster {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.play-ring {
    width: 82px;
    height: 82px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    color: #00131a;
    background: linear-gradient(90deg, var(--cyan), var(--blue));
    box-shadow: 0 18px 48px rgba(34, 211, 238, 0.28);
    font-size: 32px;
    line-height: 1;
}

.player-poster strong {
    max-width: min(620px, calc(100% - 48px));
    text-align: center;
    font-size: clamp(22px, 4vw, 38px);
    letter-spacing: -0.04em;
}

.detail-text {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.text-card {
    padding: 26px;
}

.text-card h2 {
    font-size: 24px;
    margin-bottom: 14px;
}

.text-card p {
    margin: 0;
    font-size: 16px;
}

.site-footer {
    margin-top: 72px;
    padding: 44px 0 30px;
    border-top: 1px solid rgba(148, 163, 184, 0.16);
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr 1.1fr;
    gap: 28px;
}

.site-footer h2 {
    font-size: 26px;
    background: linear-gradient(90deg, var(--cyan), var(--blue));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.site-footer h3 {
    margin-bottom: 14px;
    font-size: 16px;
}

.site-footer p,
.site-footer li,
.footer-bottom {
    color: var(--muted);
    font-size: 14px;
}

.site-footer ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 8px;
}

.footer-bottom {
    margin-top: 32px;
    padding-top: 22px;
    border-top: 1px solid rgba(148, 163, 184, 0.14);
    text-align: center;
}

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

    .menu-toggle {
        display: flex;
    }

    .header-search {
        margin-left: auto;
    }

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

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

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

    .sticky-rank {
        position: static;
    }

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

@media (max-width: 780px) {
    .header-inner {
        height: 64px;
    }

    .header-search {
        display: none;
    }

    .logo {
        font-size: 21px;
    }

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

    .hero-content h1 {
        font-size: 42px;
    }

    .hero-summary {
        font-size: 16px;
    }

    .home-search-block {
        grid-template-columns: 1fr;
        margin-top: -34px;
        padding: 22px;
    }

    .home-search-block form {
        flex-direction: column;
    }

    .movie-grid,
    .compact-grid,
    .category-panels,
    .small-card-grid,
    .category-grid,
    .filter-grid {
        grid-template-columns: 1fr 1fr;
    }

    .page-hero {
        padding: 42px 24px;
        border-radius: 24px;
    }

    .detail-hero {
        padding-top: 42px;
    }

    .detail-wrap {
        gap: 24px;
    }

    .player-shell {
        border-radius: 18px;
    }
}

@media (max-width: 520px) {
    .movie-grid,
    .compact-grid,
    .category-panels,
    .small-card-grid,
    .category-grid,
    .filter-grid {
        grid-template-columns: 1fr;
    }

    .section-title {
        align-items: flex-start;
    }

    .section-title h2 {
        font-size: 24px;
    }

    .hero-slider,
    .hero-content {
        min-height: 600px;
    }

    .hero-actions,
    .hero-chips {
        align-items: stretch;
    }

    .btn,
    .hero-chips a {
        width: 100%;
    }

    .detail-stats span {
        width: 100%;
    }
}
