:root {
  --bg: #020617;
  --bg-soft: #0f172a;
  --panel: #111827;
  --panel-2: #0b1220;
  --line: #1e293b;
  --text: #f8fafc;
  --muted: #94a3b8;
  --muted-2: #64748b;
  --blue: #3b82f6;
  --blue-2: #60a5fa;
  --cyan: #22d3ee;
  --radius: 18px;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.22), transparent 32rem),
    linear-gradient(180deg, #020617 0%, #0f172a 48%, #020617 100%);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

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

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

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

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

.container.narrow {
  width: min(920px, calc(100% - 32px));
}

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

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

.brand,
.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  box-shadow: 0 0 28px rgba(59, 130, 246, 0.45);
  font-size: 14px;
}

.brand-name {
  font-size: 20px;
}

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

.nav-link {
  color: #cbd5e1;
  font-size: 15px;
  transition: color 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
  color: #fff;
}

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #0f172a;
  padding: 10px;
}

.nav-toggle span {
  display: block;
  height: 2px;
  margin: 5px 0;
  background: #cbd5e1;
}

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

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

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

.hero-bg,
.detail-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.35;
  filter: blur(1px) saturate(1.1);
  transform: scale(1.02);
}

.hero-overlay,
.detail-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(2, 6, 23, 0.96) 0%, rgba(2, 6, 23, 0.78) 42%, rgba(2, 6, 23, 0.35) 100%),
    linear-gradient(180deg, rgba(2, 6, 23, 0.18), #020617 100%);
}

.hero-inner {
  position: relative;
  z-index: 2;
  width: min(1200px, calc(100% - 32px));
  min-height: 680px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 360px;
  align-items: center;
  gap: 56px;
  padding: 80px 0 90px;
}

.hero-copy {
  max-width: 720px;
}

.eyebrow {
  color: var(--blue-2);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin: 0 0 16px;
}

.hero-copy h1,
.page-hero h1,
.detail-title-row h1 {
  margin: 0;
  font-size: clamp(38px, 6vw, 72px);
  line-height: 1.02;
  letter-spacing: -0.04em;
}

.hero-desc,
.page-hero p,
.detail-title-row p {
  color: #cbd5e1;
  font-size: 20px;
  line-height: 1.7;
  margin: 24px 0 0;
}

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

.hero-tags span,
.tag-row span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 10px;
  border-radius: 999px;
  color: #dbeafe;
  background: rgba(30, 41, 59, 0.82);
  border: 1px solid rgba(96, 165, 250, 0.22);
  font-size: 13px;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 22px;
  border-radius: 12px;
  font-weight: 800;
  transition: transform 0.2s ease, background 0.2s ease, border 0.2s ease;
}

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

.btn.primary {
  background: linear-gradient(135deg, var(--blue), #2563eb);
  color: #fff;
  box-shadow: 0 16px 32px rgba(37, 99, 235, 0.35);
}

.btn.ghost {
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(148, 163, 184, 0.26);
  color: #dbeafe;
}

.hero-poster {
  position: relative;
  overflow: hidden;
  border-radius: 28px;
  background: var(--panel);
  box-shadow: var(--shadow);
  aspect-ratio: 2 / 3;
}

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

.hero-poster:hover img {
  transform: scale(1.06);
}

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

.hero-dot {
  width: 10px;
  height: 10px;
  padding: 0;
  border-radius: 999px;
  border: 0;
  background: rgba(148, 163, 184, 0.55);
  transition: width 0.25s ease, background 0.25s ease;
}

.hero-dot.is-active {
  width: 32px;
  background: var(--blue-2);
}

.quick-search-section {
  position: relative;
  margin-top: -44px;
  z-index: 10;
}

.quick-search-section .container {
  padding: 30px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 24px;
  background: rgba(15, 23, 42, 0.92);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
  text-align: center;
}

.quick-search-section h2 {
  margin: 0;
  font-size: 28px;
}

.quick-search-section p {
  margin: 8px 0 20px;
  color: var(--muted);
}

.home-search {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
}

.home-search input,
.filter-bar input,
.filter-bar select {
  width: 100%;
  min-height: 48px;
  border-radius: 12px;
  border: 1px solid var(--line);
  color: #fff;
  background: #0f172a;
  padding: 0 14px;
  outline: none;
}

.home-search input:focus,
.filter-bar input:focus,
.filter-bar select:focus {
  border-color: rgba(96, 165, 250, 0.85);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.14);
}

.home-search button {
  min-height: 48px;
  padding: 0 24px;
  border: 0;
  border-radius: 12px;
  color: #fff;
  font-weight: 800;
  background: var(--blue);
}

.content-section {
  padding: 74px 0;
}

.content-section.alt {
  background: rgba(15, 23, 42, 0.46);
  border-top: 1px solid rgba(30, 41, 59, 0.6);
  border-bottom: 1px solid rgba(30, 41, 59, 0.6);
}

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

.section-heading h2 {
  margin: 0;
  font-size: 30px;
  letter-spacing: -0.03em;
}

.section-heading p {
  margin: 8px 0 0;
  color: var(--muted);
}

.section-more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--blue-2);
  font-weight: 700;
  white-space: nowrap;
}

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

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

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

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

.movie-card {
  display: block;
  overflow: hidden;
  border-radius: var(--radius);
  background: rgba(15, 23, 42, 0.86);
  border: 1px solid rgba(148, 163, 184, 0.12);
  transition: transform 0.24s ease, border-color 0.24s ease, box-shadow 0.24s ease;
}

.movie-card:hover {
  transform: translateY(-6px);
  border-color: rgba(59, 130, 246, 0.75);
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.66);
}

.poster-frame {
  position: relative;
  overflow: hidden;
  margin: 0;
  aspect-ratio: 2 / 3;
  background: #0b1220;
}

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

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

.year-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.play-hover {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 30px;
  background: rgba(2, 6, 23, 0.34);
  opacity: 0;
  transition: opacity 0.22s ease;
}

.movie-card:hover .play-hover {
  opacity: 1;
}

.movie-card-body {
  padding: 16px;
}

.movie-meta {
  margin: 0 0 6px;
  color: var(--blue-2);
  font-size: 12px;
  font-weight: 700;
}

.movie-card h3 {
  margin: 0;
  font-size: 18px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

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

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

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

.category-card {
  position: relative;
  overflow: hidden;
  min-height: 240px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  border-radius: 24px;
  padding: 22px;
  background: var(--panel);
  border: 1px solid rgba(148, 163, 184, 0.16);
}

.category-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.36;
  transition: transform 0.45s ease, opacity 0.45s ease;
}

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

.category-card:hover img {
  opacity: 0.5;
  transform: scale(1.08);
}

.category-card span,
.category-card strong,
.category-card p {
  position: relative;
  z-index: 2;
}

.category-card span {
  color: var(--blue-2);
  font-weight: 800;
  margin-bottom: 8px;
}

.category-card strong {
  font-size: 22px;
}

.category-card p {
  margin: 10px 0 0;
  color: #cbd5e1;
  line-height: 1.6;
}

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

.rank-panel,
.movie-info-panel {
  border-radius: 24px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  background: rgba(15, 23, 42, 0.86);
  box-shadow: var(--shadow);
}

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

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

.rank-head h2 {
  margin: 0;
  font-size: 22px;
}

.rank-head a {
  color: var(--blue-2);
  font-weight: 700;
}

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

.rank-list.expanded {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.rank-item {
  display: grid;
  grid-template-columns: 42px 58px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 10px;
  border-radius: 16px;
  background: rgba(2, 6, 23, 0.34);
  border: 1px solid transparent;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.rank-item:hover {
  border-color: rgba(96, 165, 250, 0.48);
  background: rgba(30, 41, 59, 0.72);
}

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

.rank-item img {
  width: 58px;
  height: 82px;
  object-fit: cover;
  border-radius: 10px;
}

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

.rank-item p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.page-hero,
.detail-hero {
  position: relative;
  overflow: hidden;
  background: var(--bg);
}

.page-hero.compact {
  padding: 92px 0 72px;
  background:
    radial-gradient(circle at 20% 20%, rgba(59, 130, 246, 0.22), transparent 30rem),
    linear-gradient(180deg, #0f172a 0%, #020617 100%);
}

.page-hero h1 {
  max-width: 880px;
}

.page-hero p {
  max-width: 760px;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
  margin-top: 24px;
  color: var(--muted);
  font-size: 14px;
}

.breadcrumb a:hover {
  color: #fff;
}

.filter-bar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 180px 180px;
  gap: 14px;
  align-items: end;
  padding: 18px;
  margin-bottom: 26px;
  border-radius: 20px;
  background: rgba(15, 23, 42, 0.82);
  border: 1px solid rgba(148, 163, 184, 0.14);
}

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

.empty-state {
  padding: 32px;
  margin: 0 0 24px;
  border: 1px dashed rgba(148, 163, 184, 0.24);
  border-radius: 20px;
  color: var(--muted);
  text-align: center;
}

.detail-hero {
  min-height: 460px;
}

.detail-hero-inner {
  position: relative;
  z-index: 2;
  padding: 76px 0 86px;
}

.detail-title-row {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
  margin-top: 72px;
}

.detail-title-row div {
  max-width: 860px;
}

.detail-section {
  padding-top: 40px;
}

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

.detail-poster {
  position: sticky;
  top: 92px;
}

.detail-poster img {
  width: 100%;
  border-radius: 24px;
  box-shadow: var(--shadow);
  aspect-ratio: 2 / 3;
  object-fit: cover;
}

.tag-row.tall {
  margin-top: 18px;
}

.player-box {
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  background: #000;
  border: 1px solid rgba(148, 163, 184, 0.18);
  box-shadow: var(--shadow);
  aspect-ratio: 16 / 9;
}

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

.player-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border: 0;
  color: #fff;
  background: linear-gradient(180deg, rgba(2, 6, 23, 0.28), rgba(2, 6, 23, 0.74));
  transition: opacity 0.22s ease, visibility 0.22s ease;
}

.player-overlay span {
  width: 84px;
  height: 84px;
  display: grid;
  place-items: center;
  padding-left: 6px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  box-shadow: 0 0 45px rgba(59, 130, 246, 0.58);
  font-size: 34px;
}

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

.movie-info-panel {
  padding: 28px;
  margin-top: 24px;
}

.movie-info-panel h2 {
  margin: 28px 0 12px;
  font-size: 24px;
}

.movie-info-panel h2:first-child {
  margin-top: 0;
}

.movie-info-panel p {
  margin: 0;
  color: #cbd5e1;
  line-height: 1.86;
  font-size: 16px;
}

.meta-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 24px;
}

.meta-list div {
  padding: 14px;
  border-radius: 14px;
  background: rgba(2, 6, 23, 0.38);
}

.meta-list dt {
  color: var(--muted-2);
  font-size: 13px;
  margin-bottom: 5px;
}

.meta-list dd {
  margin: 0;
  color: #fff;
  font-weight: 700;
}

.detail-nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.detail-nav a {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  padding: 16px;
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.82);
  border: 1px solid rgba(148, 163, 184, 0.14);
  color: #dbeafe;
}

.site-footer {
  padding: 54px 0 28px;
  background: #0f172a;
  border-top: 1px solid var(--line);
}

.footer-grid {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 34px;
}

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

.footer-grid h2 {
  margin: 0 0 14px;
  font-size: 18px;
}

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

.footer-grid a:hover {
  color: #fff;
}

.footer-bottom {
  width: min(1200px, calc(100% - 32px));
  margin: 32px auto 0;
  padding-top: 22px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid rgba(148, 163, 184, 0.14);
  font-size: 14px;
}

[hidden] {
  display: none !important;
}

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

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

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

  .rank-panel,
  .detail-poster {
    position: static;
  }

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

@media (max-width: 860px) {
  .nav-toggle {
    display: block;
  }

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

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

  .nav-link {
    padding: 13px 14px;
    border-radius: 12px;
  }

  .nav-link:hover,
  .nav-link.active {
    background: rgba(59, 130, 246, 0.14);
  }

  .hero-inner {
    grid-template-columns: 1fr;
    gap: 28px;
    min-height: 720px;
    padding-top: 56px;
  }

  .hero-poster {
    width: min(280px, 70vw);
  }

  .hero-copy h1,
  .page-hero h1,
  .detail-title-row h1 {
    font-size: clamp(34px, 10vw, 52px);
  }

  .hero-desc,
  .page-hero p,
  .detail-title-row p {
    font-size: 17px;
  }

  .section-heading,
  .detail-title-row {
    align-items: start;
    flex-direction: column;
  }

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

  .movie-grid,
  .featured-grid,
  .compact-grid,
  .related-grid,
  .catalog-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
  }

  .category-grid,
  .category-grid.big,
  .rank-list.expanded,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .footer-bottom,
  .home-search,
  .detail-nav {
    grid-template-columns: 1fr;
    flex-direction: column;
  }
}

@media (max-width: 560px) {
  .container,
  .container.narrow,
  .nav-shell,
  .footer-grid,
  .footer-bottom {
    width: min(100% - 24px, 1200px);
  }

  .brand-name {
    font-size: 18px;
  }

  .hero-slider,
  .hero-inner {
    min-height: 690px;
  }

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

  .movie-card-body {
    padding: 12px;
  }

  .movie-card h3 {
    font-size: 16px;
  }

  .movie-line {
    font-size: 13px;
  }

  .content-section {
    padding: 52px 0;
  }

  .page-hero.compact {
    padding: 64px 0 56px;
  }

  .detail-grid {
    gap: 20px;
  }

  .meta-list {
    grid-template-columns: 1fr;
  }

  .player-overlay span {
    width: 68px;
    height: 68px;
    font-size: 28px;
  }
}
