:root {
  --bg: #f8fafc;
  --paper: #ffffff;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --slate: #0f172a;
  --slate-soft: #1e293b;
  --purple: #7c3aed;
  --shadow: 0 22px 45px rgba(15, 23, 42, 0.12);
  --radius: 22px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
  line-height: 1.65;
}

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

img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

img.image-hidden {
  opacity: 0;
}

button,
input,
select {
  font: inherit;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  color: #fff;
  background: rgba(15, 23, 42, 0.96);
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
  backdrop-filter: blur(18px);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 72px;
}

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

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  box-shadow: 0 12px 30px rgba(59, 130, 246, 0.36);
}

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

.desktop-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.nav-link {
  padding: 10px 13px;
  border-radius: 999px;
  color: #cbd5e1;
  transition: color 0.2s ease, background 0.2s ease;
}

.nav-link:hover,
.nav-link.is-active {
  color: #fff;
  background: rgba(59, 130, 246, 0.18);
}

.site-search-form,
.mobile-search-form,
.hero-search,
.search-page-form {
  display: flex;
  align-items: stretch;
}

.site-search-form input,
.mobile-search-form input,
.hero-search input,
.search-page-form input {
  min-width: 0;
  border: 0;
  outline: 0;
}

.site-search-form input {
  width: 210px;
  padding: 11px 14px;
  color: #fff;
  background: #1e293b;
  border-radius: 999px 0 0 999px;
}

.site-search-form button,
.mobile-search-form button,
.hero-search button,
.search-page-form button {
  border: 0;
  color: #fff;
  background: var(--blue);
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.site-search-form button {
  padding: 0 16px;
  border-radius: 0 999px 999px 0;
}

.site-search-form button:hover,
.mobile-search-form button:hover,
.hero-search button:hover,
.search-page-form button:hover {
  background: var(--blue-dark);
}

.mobile-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 12px;
  background: rgba(148, 163, 184, 0.12);
  cursor: pointer;
}

.mobile-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  margin: 5px auto;
  background: #fff;
}

.mobile-panel {
  display: none;
  padding: 16px;
  border-top: 1px solid rgba(148, 163, 184, 0.16);
  background: #0f172a;
}

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

.mobile-search-form {
  margin-bottom: 12px;
}

.mobile-search-form input {
  flex: 1;
  padding: 12px 14px;
  color: #fff;
  background: #1e293b;
  border-radius: 14px 0 0 14px;
}

.mobile-search-form button {
  padding: 0 18px;
  border-radius: 0 14px 14px 0;
}

.mobile-link {
  display: block;
  padding: 12px 4px;
  color: #dbeafe;
}

.hero {
  position: relative;
  min-height: 660px;
  overflow: hidden;
  color: #fff;
  background: #0f172a;
}

.hero-track,
.hero-slide,
.hero-bg {
  position: absolute;
  inset: 0;
}

.hero-slide {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.55s ease;
}

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

.hero-bg::after {
  position: absolute;
  inset: 0;
  content: "";
  background:
    linear-gradient(90deg, rgba(15, 23, 42, 0.94) 0%, rgba(15, 23, 42, 0.76) 43%, rgba(30, 64, 175, 0.42) 100%),
    radial-gradient(circle at 25% 40%, rgba(59, 130, 246, 0.44), transparent 35%),
    radial-gradient(circle at 80% 20%, rgba(124, 58, 237, 0.38), transparent 32%);
}

.hero-bg img {
  filter: saturate(1.1) contrast(1.05);
}

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

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 13px;
  color: #dbeafe;
  background: rgba(37, 99, 235, 0.18);
  border: 1px solid rgba(147, 197, 253, 0.28);
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
}

.hero h1,
.page-hero h1,
.detail-info h1 {
  margin: 18px 0 18px;
  font-size: clamp(38px, 6vw, 72px);
  line-height: 1.05;
  letter-spacing: -0.05em;
}

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

.hero-tags,
.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hero-tags span,
.tag-row span {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  color: #1d4ed8;
  background: #dbeafe;
  font-size: 12px;
  font-weight: 700;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

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

.primary-btn {
  color: #fff;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  box-shadow: 0 16px 28px rgba(37, 99, 235, 0.3);
}

.ghost-btn {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
}

.primary-btn:hover,
.ghost-btn:hover,
.wide-link:hover {
  transform: translateY(-2px);
}

.hero-controls {
  position: absolute;
  z-index: 4;
  left: 50%;
  bottom: 110px;
  display: flex;
  gap: 10px;
  width: min(1180px, calc(100% - 32px));
  transform: translateX(-50%);
}

.hero-dot {
  width: 40px;
  height: 5px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.35);
  cursor: pointer;
}

.hero-dot.is-active {
  background: #fff;
}

.hero-search {
  position: absolute;
  z-index: 5;
  left: 50%;
  bottom: 34px;
  width: min(760px, calc(100% - 32px));
  padding: 8px;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.28);
  transform: translateX(-50%);
  backdrop-filter: blur(18px);
}

.hero-search input {
  flex: 1;
  padding: 14px 18px;
  color: #fff;
  background: transparent;
}

.hero-search button,
.search-page-form button {
  padding: 0 24px;
  border-radius: 999px;
}

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

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

.section-heading h2 {
  margin: 0;
  font-size: clamp(26px, 3vw, 38px);
  line-height: 1.15;
  letter-spacing: -0.035em;
}

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

.compact-heading {
  display: block;
}

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

.category-tile {
  min-height: 164px;
  padding: 22px;
  color: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.category-tile:hover {
  transform: translateY(-5px);
  box-shadow: 0 28px 50px rgba(15, 23, 42, 0.18);
}

.category-tile span {
  display: block;
  margin-bottom: 12px;
  font-size: 22px;
  font-weight: 900;
}

.category-tile strong {
  display: block;
  color: rgba(255, 255, 255, 0.84);
  font-size: 14px;
  font-weight: 600;
}

.accent-blue { background: linear-gradient(135deg, #2563eb, #1e40af); }
.accent-purple { background: linear-gradient(135deg, #7c3aed, #4c1d95); }
.accent-cyan { background: linear-gradient(135deg, #0891b2, #164e63); }
.accent-orange { background: linear-gradient(135deg, #f97316, #9a3412); }
.accent-red { background: linear-gradient(135deg, #dc2626, #7f1d1d); }
.accent-pink { background: linear-gradient(135deg, #db2777, #831843); }
.accent-violet { background: linear-gradient(135deg, #6d28d9, #312e81); }
.accent-green { background: linear-gradient(135deg, #16a34a, #14532d); }
.accent-yellow { background: linear-gradient(135deg, #ca8a04, #713f12); }
.accent-slate { background: linear-gradient(135deg, #334155, #0f172a); }

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

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

.single-column {
  grid-template-columns: 1fr;
}

.movie-card {
  overflow: hidden;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 14px 32px 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(37, 99, 235, 0.28);
  box-shadow: var(--shadow);
}

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

.poster {
  position: relative;
  display: block;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background:
    radial-gradient(circle at 30% 20%, rgba(59, 130, 246, 0.36), transparent 32%),
    linear-gradient(135deg, #0f172a, #1e293b);
}

.poster img {
  transition: transform 0.35s ease;
}

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

.play-chip,
.rank-badge {
  position: absolute;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  border-radius: 999px;
}

.play-chip {
  right: 12px;
  bottom: 12px;
  padding: 6px 10px;
  background: rgba(37, 99, 235, 0.9);
}

.rank-badge {
  top: 10px;
  left: 10px;
  width: 34px;
  height: 34px;
  background: linear-gradient(135deg, #f97316, #dc2626);
  box-shadow: 0 12px 20px rgba(220, 38, 38, 0.32);
}

.card-body {
  padding: 16px;
}

.card-body h2,
.ranking-item h2 {
  margin: 8px 0 8px;
  font-size: 18px;
  line-height: 1.35;
}

.card-body h2 a:hover,
.ranking-item h2 a:hover {
  color: var(--blue);
}

.card-body p,
.ranking-item p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 14px;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: #64748b;
  font-size: 13px;
}

.meta-row span {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  background: #f1f5f9;
  border-radius: 999px;
}

.compact-card .card-body h2 {
  font-size: 17px;
}

.compact-card .card-body p {
  min-height: 44px;
}

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

.ranking-panel,
.side-recommend,
.content-card,
.toolbar {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.07);
}

.ranking-panel,
.side-recommend {
  padding: 22px;
}

.ranking-list {
  display: grid;
  gap: 14px;
}

.ranking-item {
  display: grid;
  grid-template-columns: auto 82px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
}

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

.ranking-number {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: #fff;
  background: var(--blue);
  border-radius: 12px;
  font-weight: 900;
}

.ranking-cover {
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: #0f172a;
  border-radius: 14px;
}

.wide-link {
  width: 100%;
  margin-top: 18px;
  color: #fff;
  background: var(--slate);
}

.page-hero {
  color: #fff;
  background:
    radial-gradient(circle at 15% 25%, rgba(59, 130, 246, 0.34), transparent 30%),
    radial-gradient(circle at 80% 15%, rgba(124, 58, 237, 0.32), transparent 30%),
    linear-gradient(135deg, #0f172a, #1e3a8a 58%, #312e81);
}

.page-hero-inner {
  padding: 74px 0;
}

.page-hero p {
  max-width: 780px;
  margin: 0;
  color: #dbeafe;
  font-size: 18px;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: end;
  margin-bottom: 28px;
  padding: 18px;
}

.toolbar label {
  display: grid;
  gap: 7px;
  min-width: min(320px, 100%);
  color: #334155;
  font-weight: 800;
}

.toolbar input,
.toolbar select {
  height: 46px;
  padding: 0 14px;
  color: #0f172a;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 14px;
  outline: 0;
}

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

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

.search-page-form {
  width: min(760px, 100%);
  margin-top: 26px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
}

.search-page-form input {
  flex: 1;
  padding: 14px 18px;
  color: #fff;
  background: transparent;
}

.search-page-form input::placeholder,
.hero-search input::placeholder,
.site-search-form input::placeholder,
.mobile-search-form input::placeholder {
  color: #cbd5e1;
}

.detail-hero {
  color: #fff;
  background:
    radial-gradient(circle at 20% 20%, rgba(59, 130, 246, 0.28), transparent 34%),
    linear-gradient(135deg, #020617, #172554 65%, #312e81);
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 26px;
  color: #bfdbfe;
  font-size: 14px;
}

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

.detail-grid {
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  gap: 42px;
  align-items: center;
  padding: 34px 0 70px;
}

.detail-poster {
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background:
    radial-gradient(circle at 30% 20%, rgba(59, 130, 246, 0.34), transparent 30%),
    linear-gradient(135deg, #0f172a, #1e293b);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 28px;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.35);
}

.detail-info .lead-text {
  max-width: 820px;
  margin: 0 0 20px;
  color: #dbeafe;
  font-size: 20px;
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0;
}

.detail-meta span {
  padding: 8px 12px;
  color: #e0f2fe;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
}

.large-tags {
  margin-bottom: 26px;
}

.player-shell {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: #020617;
  border-radius: 28px;
  box-shadow: var(--shadow);
}

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

.player-cover {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 14px;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(2, 6, 23, 0.36), rgba(30, 64, 175, 0.36)),
    rgba(2, 6, 23, 0.18);
  border: 0;
  cursor: pointer;
}

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

.play-ring {
  display: grid;
  place-items: center;
  width: 82px;
  height: 82px;
  margin: 0 auto;
  color: #fff;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  border-radius: 50%;
  box-shadow: 0 18px 45px rgba(37, 99, 235, 0.34);
  font-size: 32px;
}

.player-cover strong {
  font-size: 22px;
}

.detail-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}

.content-card {
  padding: 28px;
}

.content-card h2 {
  margin: 0 0 14px;
  font-size: 26px;
}

.content-card p {
  margin: 0;
  color: #334155;
  font-size: 17px;
}

.site-footer {
  margin-top: 40px;
  color: #cbd5e1;
  background: linear-gradient(135deg, #0f172a, #111827);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.1fr;
  gap: 32px;
  padding: 46px 0;
}

.site-footer h2 {
  margin: 0 0 12px;
  color: #fff;
  font-size: 17px;
}

.site-footer p {
  margin: 12px 0 0;
  color: #94a3b8;
}

.site-footer ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-footer li + li {
  margin-top: 8px;
}

.site-footer a:hover {
  color: #60a5fa;
}

@media (max-width: 1100px) {
  .desktop-nav,
  .site-search-form {
    display: none;
  }

  .mobile-toggle {
    display: block;
    margin-left: auto;
  }

  .hero-content {
    transform: none;
  }

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

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

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

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

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

  .hero {
    min-height: 620px;
  }

  .hero-content {
    padding-top: 92px;
  }

  .hero-actions,
  .section-heading,
  .detail-content {
    display: block;
  }

  .hero-actions a + a {
    margin-top: 10px;
  }

  .hero-controls {
    bottom: 124px;
  }

  .hero-search,
  .search-page-form {
    border-radius: 24px;
  }

  .hero-search input,
  .search-page-form input {
    width: 100%;
  }

  .hero-search button,
  .search-page-form button {
    padding: 0 16px;
  }

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

  .section-heading p {
    margin-top: 8px;
  }

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

  .card-body {
    padding: 13px;
  }

  .card-body p {
    display: none;
  }

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

  .detail-poster {
    width: min(320px, 100%);
    margin: 0 auto;
  }

  .detail-info h1 {
    font-size: 38px;
  }

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

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

  .footer-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 460px) {
  .category-grid,
  .movie-grid,
  .small-grid,
  .catalog-grid {
    grid-template-columns: 1fr;
  }

  .hero h1,
  .page-hero h1 {
    font-size: 34px;
  }

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

  .ranking-number {
    display: none;
  }
}
