:root {
  --red: #ef4444;
  --orange: #f97316;
  --yellow: #facc15;
  --green: #22c55e;
  --cyan: #06b6d4;
  --blue: #2563eb;
  --purple: #7c3aed;
  --pink: #ec4899;
  --slate: #0f172a;
  --text: #1f2937;
  --muted: #6b7280;
  --line: #e5e7eb;
  --panel: #ffffff;
  --soft: #f8fafc;
  --shadow: 0 18px 45px rgba(15, 23, 42, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: #f3f4f6;
}

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

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

.rainbow-line {
  height: 4px;
  background: linear-gradient(90deg, #f87171, #fbbf24, #4ade80, #22d3ee, #60a5fa, #a78bfa);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(18px);
}

.nav-wrap {
  width: min(1280px, calc(100% - 32px));
  min-height: 68px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: auto 1fr minmax(220px, 320px);
  align-items: center;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 25px;
  font-weight: 800;
  letter-spacing: -0.04em;
  white-space: nowrap;
  background: linear-gradient(90deg, #ef4444, #f97316, #eab308, #16a34a, #0891b2, #2563eb, #7c3aed);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.brand-icon {
  width: 38px;
  height: 38px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 15px;
  box-shadow: 0 10px 22px rgba(124, 58, 237, 0.28);
  background: linear-gradient(135deg, #dc2626, #f97316, #7c3aed);
}

.nav-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  font-weight: 700;
  color: #374151;
}

.nav-links a {
  position: relative;
  padding: 23px 0;
  transition: color 0.2s ease;
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 15px;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, #ef4444, #7c3aed);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.2s ease;
}

.nav-links a:hover {
  color: #2563eb;
}

.nav-links a:hover::after {
  transform: scaleX(1);
}

.header-search {
  position: relative;
}

.header-search input,
.catalog-toolbar input,
.catalog-toolbar select {
  width: 100%;
  border: 1px solid #d1d5db;
  border-radius: 999px;
  padding: 12px 18px;
  color: #111827;
  background: #fff;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.header-search input:focus,
.catalog-toolbar input:focus,
.catalog-toolbar select:focus {
  border-color: #60a5fa;
  box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.18);
}

.search-results {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  right: 0;
  display: none;
  max-height: 430px;
  overflow: auto;
  padding: 8px;
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--shadow);
}

.search-results.is-open {
  display: block;
}

.search-result-item {
  display: block;
  padding: 12px;
  border-radius: 14px;
}

.search-result-item:hover {
  background: #eff6ff;
}

.search-result-item strong {
  display: block;
  margin-bottom: 4px;
  color: #111827;
}

.search-result-item span {
  display: block;
  color: #6b7280;
  font-size: 13px;
}

.menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 12px;
  background: #f3f4f6;
}

.menu-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  margin: 4px auto;
  background: #111827;
}

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

.hero-slider {
  position: relative;
  height: min(70vh, 720px);
  min-height: 540px;
  overflow: hidden;
  color: #fff;
  background: linear-gradient(90deg, #f87171, #fbbf24, #4ade80, #22d3ee, #60a5fa, #a78bfa);
}

.hero-slide {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.75s ease;
}

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

.hero-slide img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.03);
  filter: saturate(1.05) contrast(1.05);
}

.hero-slide.is-active img {
  animation: heroZoom 7s ease both;
}

@keyframes heroZoom {
  from {
    transform: scale(1.05);
  }
  to {
    transform: scale(1.12);
  }
}

.hero-shade {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 70% 25%, rgba(255, 255, 255, 0.18), transparent 28%),
    linear-gradient(90deg, rgba(15, 23, 42, 0.88), rgba(15, 23, 42, 0.55) 44%, rgba(15, 23, 42, 0.24)),
    linear-gradient(0deg, rgba(15, 23, 42, 0.88), transparent 40%);
}

.hero-content {
  position: relative;
  width: min(1200px, calc(100% - 36px));
  display: grid;
  grid-template-columns: minmax(0, 1fr) 290px;
  align-items: end;
  gap: 34px;
  z-index: 2;
}

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

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  margin-bottom: 18px;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(10px);
  font-weight: 700;
}

.hero-copy h1,
.hero-copy h2 {
  margin: 0 0 20px;
  font-size: clamp(42px, 7vw, 82px);
  line-height: 0.96;
  letter-spacing: -0.07em;
}

.hero-copy p {
  max-width: 720px;
  margin: 0 0 26px;
  color: rgba(255, 255, 255, 0.88);
  font-size: clamp(16px, 2vw, 20px);
  line-height: 1.8;
}

.hero-actions,
.section-head,
.card-kicker,
.tag-row,
.breadcrumb,
.detail-meta,
.pagination-links {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 20px;
  border: 0;
  border-radius: 999px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(90deg, #ef4444, #7c3aed);
  box-shadow: 0 14px 28px rgba(124, 58, 237, 0.28);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 20px 34px rgba(124, 58, 237, 0.34);
}

.btn.light {
  color: #111827;
  background: #fff;
  box-shadow: 0 14px 28px rgba(255, 255, 255, 0.2);
}

.btn.ghost {
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(10px);
}

.hero-panel {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 14px;
}

.hero-mini-card {
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(16px);
  box-shadow: 0 28px 60px rgba(0, 0, 0, 0.24);
}

.hero-mini-card strong {
  display: block;
  font-size: 18px;
  margin-bottom: 8px;
}

.hero-mini-card span {
  display: block;
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.6;
}

.hero-controls {
  position: absolute;
  left: 50%;
  bottom: 24px;
  width: min(1200px, calc(100% - 36px));
  display: flex;
  justify-content: space-between;
  align-items: center;
  transform: translateX(-50%);
  z-index: 5;
}

.slide-dots {
  display: flex;
  gap: 10px;
}

.slide-dots button {
  width: 46px;
  height: 5px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.35);
  cursor: pointer;
}

.slide-dots button.is-active {
  background: #fff;
}

.slide-arrows {
  display: flex;
  gap: 10px;
}

.slide-arrows button {
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  cursor: pointer;
  backdrop-filter: blur(10px);
}

.section,
.catalog-page,
.detail-layout,
.page-hero-inner {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
}

.section {
  padding: 64px 0;
}

.section.alt {
  width: 100%;
  background: #fff;
}

.section.alt > .section-inner {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
}

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

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

.section-title span,
.category-icon {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(135deg, #ef4444, #f97316, #7c3aed);
}

.section-title h2,
.page-copy h1,
.detail-title h1 {
  margin: 0;
  color: #111827;
  font-size: clamp(26px, 4vw, 38px);
  line-height: 1.18;
  letter-spacing: -0.04em;
}

.section-head a {
  color: #2563eb;
  font-weight: 800;
}

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

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

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

.movie-card {
  overflow: hidden;
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.movie-card:hover {
  transform: translateY(-5px);
  border-color: rgba(96, 165, 250, 0.55);
  box-shadow: 0 24px 46px rgba(15, 23, 42, 0.15);
}

.poster-link {
  position: relative;
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: linear-gradient(135deg, #f1f5f9, #e0e7ff);
}

.movie-grid.compact .poster-link {
  aspect-ratio: 3 / 4;
}

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

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

.poster-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 45%, rgba(0, 0, 0, 0.75));
}

.duration,
.rank-badge {
  position: absolute;
  color: #fff;
  font-weight: 800;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.58);
  backdrop-filter: blur(8px);
}

.duration {
  right: 12px;
  bottom: 12px;
  padding: 5px 9px;
  font-size: 12px;
}

.rank-badge {
  left: 12px;
  top: 12px;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #ef4444, #7c3aed);
}

.card-body {
  padding: 17px;
}

.card-kicker {
  justify-content: space-between;
  margin-bottom: 8px;
  color: #6b7280;
  font-size: 13px;
  font-weight: 700;
}

.movie-card h3 {
  margin: 0 0 8px;
  color: #111827;
  font-size: 19px;
  line-height: 1.35;
}

.movie-card h3 a:hover {
  color: #2563eb;
}

.movie-card p {
  margin: 0 0 14px;
  min-height: 48px;
  color: #6b7280;
  line-height: 1.7;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.tag-row {
  gap: 7px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  color: #2563eb;
  background: #eff6ff;
  font-size: 12px;
  font-weight: 800;
}

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

.category-card {
  position: relative;
  overflow: hidden;
  min-height: 190px;
  padding: 24px;
  border-radius: 28px;
  color: #fff;
  box-shadow: var(--shadow);
  background: linear-gradient(135deg, #ef4444, #f97316, #7c3aed);
}

.category-card:nth-child(2n) {
  background: linear-gradient(135deg, #2563eb, #06b6d4, #22c55e);
}

.category-card:nth-child(3n) {
  background: linear-gradient(135deg, #7c3aed, #ec4899, #ef4444);
}

.category-card::after {
  content: "";
  position: absolute;
  right: -40px;
  bottom: -40px;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
}

.category-card h2,
.category-card h3 {
  position: relative;
  margin: 0 0 12px;
  font-size: 24px;
}

.category-card p {
  position: relative;
  margin: 0 0 20px;
  color: rgba(255, 255, 255, 0.86);
  line-height: 1.7;
}

.category-card span {
  position: relative;
  font-weight: 900;
}

.page-hero {
  padding: 72px 0;
  color: #fff;
  background: linear-gradient(100deg, #ef4444, #f97316, #22c55e, #06b6d4, #2563eb, #7c3aed);
}

.page-hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 30px;
  align-items: center;
}

.page-copy h1 {
  margin-bottom: 16px;
  color: #fff;
  font-size: clamp(36px, 5vw, 60px);
}

.page-copy p {
  max-width: 780px;
  margin: 0;
  color: rgba(255, 255, 255, 0.86);
  font-size: 18px;
  line-height: 1.8;
}

.page-stats {
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(14px);
}

.page-stats strong {
  display: block;
  margin-bottom: 8px;
  font-size: 26px;
}

.catalog-page {
  padding: 48px 0 72px;
}

.catalog-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px 180px;
  gap: 14px;
  margin-bottom: 28px;
  padding: 18px;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
}

.detail-hero {
  padding: 28px 0;
  color: #fff;
  background: linear-gradient(90deg, #ef4444, #f97316, #7c3aed);
}

.breadcrumb {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 800;
}

.breadcrumb a:hover {
  color: #fff;
  text-decoration: underline;
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(300px, 0.95fr);
  gap: 28px;
  padding: 42px 0 72px;
}

.player-card,
.detail-card,
.sidebar-card {
  border-radius: 26px;
  background: #fff;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.1);
}

.player-box {
  position: relative;
  overflow: hidden;
  border-radius: 26px 26px 0 0;
  background: #020617;
}

.player-box video {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #020617;
}

.play-cover {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  width: 100%;
  border: 0;
  padding: 0;
  background: #020617;
  cursor: pointer;
}

.play-cover.is-hidden {
  display: none;
}

.play-cover img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.68;
}

.play-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(2, 6, 23, 0.18), rgba(2, 6, 23, 0.72));
}

.play-icon {
  position: relative;
  z-index: 2;
  width: 86px;
  height: 86px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #fff;
  font-size: 30px;
  background: linear-gradient(135deg, #ef4444, #7c3aed);
  box-shadow: 0 22px 45px rgba(0, 0, 0, 0.32);
}

.detail-title {
  padding: 24px;
}

.detail-title h1 {
  margin-bottom: 12px;
}

.detail-title p {
  margin: 0;
  color: #6b7280;
  font-size: 17px;
  line-height: 1.8;
}

.detail-meta {
  margin-top: 18px;
  gap: 10px;
}

.meta-pill {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  color: #374151;
  background: #f3f4f6;
  font-weight: 800;
  font-size: 13px;
}

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

.detail-card h2,
.sidebar-card h2 {
  margin: 0 0 18px;
  color: #111827;
  font-size: 24px;
}

.detail-card p {
  margin: 0 0 18px;
  color: #374151;
  font-size: 17px;
  line-height: 1.9;
}

.sidebar-card {
  padding: 20px;
  margin-bottom: 22px;
}

.sidebar-cover {
  overflow: hidden;
  margin-bottom: 16px;
  border-radius: 20px;
  aspect-ratio: 4 / 3;
  background: #e5e7eb;
}

.sidebar-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

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

.related-item {
  display: grid;
  grid-template-columns: 86px 1fr;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border-radius: 16px;
  transition: background 0.2s ease;
}

.related-item:hover {
  background: #eff6ff;
}

.related-item img {
  width: 86px;
  height: 62px;
  border-radius: 12px;
  object-fit: cover;
  background: #e5e7eb;
}

.related-item strong {
  display: block;
  margin-bottom: 5px;
  color: #111827;
}

.related-item span {
  color: #6b7280;
  font-size: 13px;
}

.pagination-links {
  margin-top: 22px;
  justify-content: space-between;
}

.pagination-links a {
  color: #2563eb;
  font-weight: 900;
}

.site-footer {
  color: #d1d5db;
  background: #111827;
}

.footer-inner {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  padding: 42px 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 30px;
  align-items: start;
}

.footer-brand {
  margin-bottom: 14px;
}

.footer-inner p {
  max-width: 520px;
  margin: 0;
  color: #9ca3af;
  line-height: 1.8;
}

.footer-links {
  display: grid;
  grid-template-columns: repeat(2, auto);
  gap: 12px 24px;
  font-weight: 800;
}

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

.footer-bottom {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  padding: 20px 0 28px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: #9ca3af;
}

.empty-state {
  display: none;
  padding: 40px;
  border-radius: 24px;
  text-align: center;
  color: #6b7280;
  background: #fff;
}

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

@media (max-width: 1180px) {
  .nav-wrap {
    grid-template-columns: auto auto;
  }

  .menu-toggle {
    display: block;
    justify-self: end;
  }

  .nav-links,
  .header-search {
    grid-column: 1 / -1;
    display: none;
    width: 100%;
  }

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

  .nav-links.is-open {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 0 0 14px;
  }

  .nav-links a {
    padding: 10px 0;
  }

  .header-search.is-open {
    padding-bottom: 16px;
  }

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

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

@media (max-width: 880px) {
  .hero-content,
  .page-hero-inner,
  .detail-layout,
  .footer-inner {
    grid-template-columns: 1fr;
  }

  .hero-slider {
    min-height: 660px;
  }

  .hero-panel {
    display: none;
  }

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

  .catalog-toolbar {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .nav-wrap,
  .section,
  .catalog-page,
  .detail-layout,
  .page-hero-inner,
  .breadcrumb,
  .footer-inner,
  .footer-bottom {
    width: min(100% - 24px, 1280px);
  }

  .brand {
    font-size: 21px;
  }

  .hero-slider {
    min-height: 700px;
  }

  .hero-copy h1,
  .hero-copy h2 {
    font-size: 42px;
  }

  .hero-controls {
    width: calc(100% - 24px);
  }

  .slide-dots button {
    width: 28px;
  }

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

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