:root {
  color-scheme: dark;
  --bg: #020617;
  --bg-soft: #0f172a;
  --panel: rgba(15, 23, 42, 0.78);
  --panel-strong: rgba(15, 23, 42, 0.94);
  --line: rgba(148, 163, 184, 0.18);
  --text: #ffffff;
  --muted: #94a3b8;
  --soft: #cbd5e1;
  --accent: #ef4444;
  --accent-light: #f87171;
  --accent-deep: #991b1b;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 20% 0%, rgba(239, 68, 68, 0.18), transparent 32rem),
    radial-gradient(circle at 80% 10%, rgba(14, 165, 233, 0.10), transparent 28rem),
    linear-gradient(135deg, #020617 0%, #0f172a 45%, #020617 100%);
  color: var(--text);
}

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

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

button,
input,
select {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid rgba(51, 65, 85, 0.55);
  background: rgba(2, 6, 23, 0.88);
  backdrop-filter: blur(18px);
}

.nav-shell {
  width: min(1280px, calc(100% - 32px));
  height: 76px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 24px;
}

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

.brand-mark {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, #ef4444, #991b1b);
  box-shadow: 0 12px 30px rgba(239, 68, 68, 0.35);
}

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

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

.nav-links a,
.mobile-menu a,
.footer-links a {
  color: var(--soft);
  transition: color 0.2s ease;
}

.nav-links a:hover,
.mobile-menu a:hover,
.footer-links a:hover {
  color: var(--accent-light);
}

.top-search {
  display: flex;
  align-items: center;
  gap: 8px;
}

.top-search input,
.mobile-menu input,
.filter-bar input,
.filter-bar select,
.hero-search input {
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 999px;
  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;
}

.top-search input {
  width: 230px;
  padding: 10px 14px;
}

.top-search button,
.mobile-menu button,
.hero-search button,
.primary-btn,
.ghost-btn,
.filter-bar select {
  border: 0;
  border-radius: 999px;
  color: #fff;
  cursor: pointer;
}

.top-search button,
.mobile-menu button,
.hero-search button,
.primary-btn {
  padding: 10px 18px;
  background: linear-gradient(135deg, #ef4444, #b91c1c);
  box-shadow: 0 12px 26px rgba(239, 68, 68, 0.28);
}

.ghost-btn {
  padding: 10px 18px;
  border: 1px solid rgba(248, 113, 113, 0.38);
  background: rgba(239, 68, 68, 0.14);
}

.nav-toggle {
  display: none;
  margin-left: auto;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.75);
  color: var(--text);
  padding: 8px 12px;
}

.mobile-menu {
  display: none;
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto 16px;
  padding: 16px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.96);
}

.mobile-menu.is-open {
  display: grid;
  gap: 14px;
}

.mobile-menu form {
  display: flex;
  gap: 8px;
}

.mobile-menu input {
  flex: 1;
  padding: 10px 14px;
}

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

.hero {
  position: relative;
  min-height: 640px;
  margin: 28px auto 56px;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: var(--radius-xl);
  background: #020617;
  box-shadow: var(--shadow);
}

.hero-slide {
  position: absolute;
  inset: 0;
  display: grid;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.8s ease;
  background-image:
    linear-gradient(90deg, rgba(2, 6, 23, 0.96) 0%, rgba(2, 6, 23, 0.74) 45%, rgba(2, 6, 23, 0.22) 100%),
    linear-gradient(0deg, rgba(2, 6, 23, 0.9), rgba(2, 6, 23, 0.06)),
    var(--hero-image);
  background-size: cover;
  background-position: center;
}

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

.hero-content {
  width: min(760px, calc(100% - 48px));
  margin-left: clamp(24px, 6vw, 72px);
  padding-top: 54px;
}

.hero-eyebrow,
.page-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  padding: 7px 12px;
  border: 1px solid rgba(248, 113, 113, 0.32);
  border-radius: 999px;
  background: rgba(239, 68, 68, 0.13);
  color: #fecaca;
  font-size: 14px;
}

.hero h1,
.page-title h1,
.detail-title h1 {
  margin: 0;
  font-size: clamp(34px, 6vw, 74px);
  line-height: 0.98;
  letter-spacing: -0.055em;
}

.hero p,
.page-title p {
  max-width: 720px;
  margin: 18px 0 0;
  color: var(--soft);
  font-size: clamp(16px, 2vw, 20px);
  line-height: 1.8;
}

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

.hero-search {
  display: flex;
  width: min(560px, 100%);
  gap: 10px;
  margin-top: 26px;
  padding: 8px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(12px);
}

.hero-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  padding: 10px 14px;
}

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

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

.hero-tags a,
.tag-row span,
.meta-tags span {
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
  color: var(--soft);
  font-size: 13px;
  padding: 6px 10px;
}

.hero-dots {
  position: absolute;
  left: clamp(24px, 6vw, 72px);
  bottom: 32px;
  display: flex;
  gap: 10px;
  z-index: 5;
}

.hero-dots button {
  width: 44px;
  height: 6px;
  border: 0;
  border-radius: 999px;
  background: rgba(203, 213, 225, 0.3);
  cursor: pointer;
}

.hero-dots button.is-active {
  background: var(--accent);
}

.section {
  margin: 54px 0;
}

.section-head,
.page-title {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
}

.section-head h2,
.page-title h1,
.detail-section h2 {
  margin: 0;
  letter-spacing: -0.035em;
}

.section-head h2,
.detail-section h2 {
  font-size: clamp(24px, 3vw, 34px);
}

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

.section-more {
  flex: none;
  color: var(--accent-light);
}

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

.movie-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: var(--radius-lg);
  background: rgba(15, 23, 42, 0.58);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.22);
  transition: transform 0.22s ease, border-color 0.22s ease, background 0.22s ease;
}

.movie-card:hover {
  transform: translateY(-6px);
  border-color: rgba(248, 113, 113, 0.48);
  background: rgba(15, 23, 42, 0.86);
}

.poster-link {
  position: relative;
  display: block;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  background: linear-gradient(135deg, #111827, #020617);
}

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

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

.poster-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(2, 6, 23, 0.88), transparent 45%);
  opacity: 0.8;
}

.play-chip {
  position: absolute;
  right: 12px;
  bottom: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(239, 68, 68, 0.92);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.card-content {
  padding: 15px;
}

.card-meta,
.detail-meta,
.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.card-content h3 {
  min-height: 48px;
  margin: 8px 0 8px;
  color: var(--text);
  font-size: 17px;
  line-height: 1.42;
}

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

.card-content p {
  min-height: 60px;
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.compact .card-content p {
  min-height: auto;
}

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

.category-card {
  position: relative;
  overflow: hidden;
  min-height: 160px;
  padding: 24px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 70% 0%, rgba(239, 68, 68, 0.28), transparent 70%),
    rgba(15, 23, 42, 0.72);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.22);
  transition: transform 0.22s ease, border-color 0.22s ease;
}

.category-card:hover {
  transform: translateY(-5px);
  border-color: rgba(248, 113, 113, 0.44);
}

.category-card h3 {
  margin: 0 0 10px;
  font-size: 22px;
}

.category-card p {
  margin: 0;
  color: var(--soft);
  line-height: 1.7;
}

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

.rank-item {
  display: grid;
  grid-template-columns: 70px 72px 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 12px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.62);
}

.rank-number {
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.95), rgba(153, 27, 27, 0.92));
  font-weight: 800;
}

.rank-poster {
  width: 72px;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  border-radius: 12px;
  background: #111827;
}

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

.rank-info h3 {
  margin: 0 0 6px;
  font-size: 18px;
}

.rank-info p {
  margin: 0;
  color: var(--muted);
}

.rank-link {
  color: var(--accent-light);
}

.filter-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
}

.filter-bar input {
  flex: 1;
  min-width: 0;
  padding: 13px 16px;
}

.filter-bar select {
  min-width: 150px;
  padding: 13px 16px;
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid rgba(148, 163, 184, 0.22);
}

.main-space {
  padding-top: 36px;
}

.breadcrumbs {
  margin: 26px 0 18px;
}

.breadcrumbs a {
  color: var(--accent-light);
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.75fr);
  gap: 28px;
  align-items: start;
}

.player-card,
.detail-side,
.detail-section,
.search-panel {
  border: 1px solid rgba(148, 163, 184, 0.15);
  border-radius: var(--radius-lg);
  background: rgba(15, 23, 42, 0.68);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.22);
}

.player-card {
  overflow: hidden;
}

.player-shell {
  position: relative;
  background: #000;
  aspect-ratio: 16 / 9;
}

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

.play-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border: 0;
  background: rgba(2, 6, 23, 0.32);
  color: #fff;
  cursor: pointer;
  transition: opacity 0.22s ease, visibility 0.22s ease;
}

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

.play-overlay span {
  display: grid;
  place-items: center;
  width: 86px;
  height: 86px;
  border-radius: 999px;
  background: rgba(239, 68, 68, 0.92);
  box-shadow: 0 18px 48px rgba(239, 68, 68, 0.34);
  font-size: 32px;
  transform: translateX(3px);
}

.player-caption {
  padding: 18px 20px 22px;
}

.detail-title h1 {
  margin-bottom: 14px;
  font-size: clamp(30px, 4vw, 52px);
}

.detail-title p {
  color: var(--soft);
  font-size: 18px;
  line-height: 1.8;
}

.detail-side {
  padding: 18px;
}

.detail-cover {
  overflow: hidden;
  border-radius: 18px;
  aspect-ratio: 2 / 3;
  background: #111827;
}

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

.detail-facts {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.detail-facts div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.detail-facts span {
  color: var(--muted);
}

.detail-section {
  padding: 24px;
  margin-top: 24px;
}

.detail-section p {
  color: var(--soft);
  line-height: 1.9;
}

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

.search-panel {
  padding: 24px;
}

.no-results {
  display: none;
  padding: 28px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: var(--radius-lg);
  background: rgba(15, 23, 42, 0.62);
  color: var(--muted);
}

.no-results.is-visible {
  display: block;
}

.site-footer {
  margin-top: 72px;
  border-top: 1px solid rgba(148, 163, 184, 0.13);
  background: rgba(2, 6, 23, 0.6);
}

.footer-inner {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  padding: 36px 0;
  display: flex;
  justify-content: space-between;
  gap: 28px;
}

.footer-inner p,
.copyright {
  color: var(--muted);
}

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

.copyright {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  padding: 0 0 28px;
}

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

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

@media (max-width: 900px) {
  .nav-links,
  .top-search {
    display: none;
  }

  .nav-toggle {
    display: block;
  }

  .hero {
    min-height: 590px;
  }

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

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

  .rank-item {
    grid-template-columns: 52px 62px 1fr;
  }

  .rank-link {
    display: none;
  }
}

@media (max-width: 640px) {
  .nav-shell {
    width: min(100% - 24px, 1280px);
    height: 66px;
  }

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

  .page {
    width: min(100% - 24px, 1280px);
  }

  .hero {
    min-height: 620px;
    margin-top: 18px;
    border-radius: 22px;
  }

  .hero-content {
    width: calc(100% - 32px);
    margin-left: 16px;
  }

  .hero-actions,
  .filter-bar,
  .footer-inner,
  .section-head,
  .page-title {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-search,
  .mobile-menu form {
    border-radius: 18px;
    flex-direction: column;
  }

  .hero-search button,
  .mobile-menu button {
    width: 100%;
  }

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

  .card-content {
    padding: 12px;
  }

  .card-content h3 {
    font-size: 15px;
  }

  .card-content p {
    display: none;
  }

  .rank-item {
    grid-template-columns: 42px 56px 1fr;
    gap: 10px;
  }

  .rank-number {
    width: 38px;
    height: 38px;
    border-radius: 12px;
  }
}
