:root {
  color-scheme: dark;
  --bg-deep: #020617;
  --bg-main: #0f172a;
  --bg-card: rgba(15, 23, 42, 0.72);
  --bg-card-strong: rgba(15, 23, 42, 0.92);
  --border-soft: rgba(148, 163, 184, 0.18);
  --border-cyan: rgba(6, 182, 212, 0.46);
  --text-main: #ffffff;
  --text-muted: #94a3b8;
  --text-soft: #cbd5e1;
  --cyan: #22d3ee;
  --cyan-strong: #06b6d4;
  --blue: #2563eb;
  --danger: #f87171;
  --shadow-cyan: 0 20px 80px rgba(6, 182, 212, 0.18);
  --radius-lg: 18px;
  --radius-md: 12px;
  --max-width: 1280px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  color: var(--text-main);
  background:
    radial-gradient(circle at top left, rgba(34, 211, 238, 0.18), transparent 34rem),
    linear-gradient(180deg, var(--bg-deep), var(--bg-main) 48%, var(--bg-deep));
  -webkit-font-smoothing: antialiased;
}

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;
  background: rgba(2, 6, 23, 0.82);
  border-bottom: 1px solid rgba(30, 41, 59, 0.8);
  backdrop-filter: blur(18px);
}

.top-nav {
  width: min(var(--max-width), calc(100% - 32px));
  min-height: 64px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

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

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #001018;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  box-shadow: 0 0 30px rgba(34, 211, 238, 0.38);
}

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

.nav-links a {
  padding: 10px 14px;
  border-radius: 999px;
  color: var(--text-soft);
  transition: color 0.18s ease, background 0.18s ease;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--cyan);
  background: rgba(34, 211, 238, 0.1);
}

.menu-toggle {
  display: none;
  color: var(--text-main);
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.8);
  padding: 8px 11px;
}

.hero {
  position: relative;
  height: 72vh;
  min-height: 580px;
  overflow: hidden;
  background: #020617;
}

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

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

.hero-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.04);
  filter: saturate(1.08) contrast(1.05);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(2, 6, 23, 0.94), rgba(2, 6, 23, 0.54), rgba(2, 6, 23, 0.25)),
    linear-gradient(0deg, #020617 0%, rgba(2, 6, 23, 0.46) 42%, rgba(2, 6, 23, 0.08) 100%);
}

.hero-content {
  position: absolute;
  left: max(24px, calc((100vw - var(--max-width)) / 2));
  right: max(24px, calc((100vw - var(--max-width)) / 2));
  bottom: 70px;
  max-width: 760px;
}

.hero-kicker {
  color: var(--cyan);
  font-weight: 700;
  margin: 0 0 12px;
}

.hero h1 {
  margin: 0;
  font-size: clamp(2.4rem, 6vw, 5.6rem);
  line-height: 0.95;
  letter-spacing: -0.05em;
}

.hero-desc {
  margin: 20px 0 0;
  color: var(--text-soft);
  font-size: clamp(1rem, 2vw, 1.3rem);
  line-height: 1.75;
  max-width: 680px;
}

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

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

.hero-tags span,
.tag-row span,
.detail-tags span {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border-cyan);
  border-radius: 999px;
  background: rgba(6, 182, 212, 0.12);
  color: #a5f3fc;
  padding: 6px 10px;
  font-size: 0.82rem;
}

.hero-actions,
.section-heading,
.breadcrumbs,
.detail-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

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

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

.btn {
  color: #ffffff;
  background: linear-gradient(135deg, var(--cyan-strong), var(--blue));
  box-shadow: 0 14px 36px rgba(6, 182, 212, 0.28);
}

.btn-outline {
  border: 1px solid var(--border-soft);
  color: var(--text-soft);
  background: rgba(15, 23, 42, 0.52);
}

.btn:hover,
.btn-outline:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-cyan);
}

.hero-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  color: #fff;
  background: rgba(2, 6, 23, 0.58);
  backdrop-filter: blur(8px);
}

.hero-arrow:hover {
  border-color: var(--border-cyan);
  color: var(--cyan);
}

.hero-prev {
  left: 18px;
}

.hero-next {
  right: 18px;
}

.hero-dots {
  position: absolute;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
}

.hero-dots button {
  width: 10px;
  height: 10px;
  border: 0;
  border-radius: 99px;
  background: rgba(148, 163, 184, 0.5);
  transition: width 0.18s ease, background 0.18s ease;
}

.hero-dots button.is-active {
  width: 32px;
  background: var(--cyan);
}

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

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

.section-block.alt {
  background: rgba(15, 23, 42, 0.32);
}

.section-heading {
  justify-content: space-between;
  margin-bottom: 26px;
}

.section-title {
  margin: 0;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
}

.section-subtitle,
.page-lead {
  color: var(--text-muted);
  line-height: 1.8;
}

.grid,
.category-grid,
.related-grid {
  display: grid;
  gap: 22px;
}

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

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

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

.movie-card,
.category-card,
.info-card,
.rank-item,
.compact-card,
.detail-panel,
.player-panel {
  border: 1px solid var(--border-soft);
  background: var(--bg-card);
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(12px);
}

.movie-card,
.category-card,
.info-card,
.detail-panel,
.player-panel {
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.movie-card {
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.movie-card:hover {
  transform: translateY(-5px);
  border-color: var(--border-cyan);
  box-shadow: var(--shadow-cyan);
}

.movie-poster {
  position: relative;
  display: block;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.9), rgba(8, 47, 73, 0.7));
}

.movie-poster img,
.compact-cover img,
.detail-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

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

.movie-score,
.rank-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #001018;
  background: linear-gradient(135deg, var(--cyan), #60a5fa);
  font-weight: 800;
}

.movie-score {
  position: absolute;
  right: 10px;
  top: 10px;
  min-width: 42px;
  height: 28px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 0.82rem;
}

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

.movie-meta,
.compact-card p,
.breadcrumbs,
.detail-meta,
.category-card p,
.rank-meta {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.movie-card h3,
.compact-card h3,
.rank-item h3 {
  margin: 6px 0 8px;
  font-size: 1rem;
  line-height: 1.35;
}

.movie-desc {
  margin: 0 0 12px;
  min-height: 42px;
  color: var(--text-soft);
  font-size: 0.9rem;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.page-hero {
  padding: 104px 0 42px;
}

.page-hero h1 {
  margin: 0 0 16px;
  font-size: clamp(2rem, 5vw, 4.4rem);
  line-height: 1.05;
}

.page-lead {
  max-width: 850px;
  margin: 0;
  font-size: 1.08rem;
}

.category-card {
  padding: 22px;
  min-height: 210px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.category-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-cyan);
}

.category-card h2,
.info-card h2 {
  margin: 0 0 12px;
}

.category-card ul {
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
  color: var(--text-soft);
  font-size: 0.92rem;
}

.filter-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px 180px;
  gap: 14px;
  padding: 18px;
  margin: 22px 0 28px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  background: rgba(15, 23, 42, 0.78);
}

.filter-bar input,
.filter-bar select {
  width: 100%;
  min-height: 46px;
  color: var(--text-main);
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 12px;
  outline: none;
  background: rgba(2, 6, 23, 0.72);
  padding: 0 14px;
}

.filter-bar input:focus,
.filter-bar select:focus {
  border-color: var(--border-cyan);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.08);
}

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

.rank-item {
  display: grid;
  grid-template-columns: 56px 92px minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 14px;
  border-radius: var(--radius-lg);
}

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

.rank-cover {
  display: block;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.9);
}

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

.rank-item h3 {
  font-size: 1.08rem;
}

.rank-score {
  padding: 8px 12px;
  border: 1px solid var(--border-cyan);
  border-radius: 999px;
  color: var(--cyan);
}

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

.detail-panel,
.player-panel,
.info-card {
  padding: 24px;
}

.detail-hero {
  padding: 96px 0 32px;
}

.breadcrumbs {
  margin-bottom: 18px;
}

.breadcrumbs a:hover,
.movie-card h3 a:hover,
.compact-card h3 a:hover,
.rank-item h3 a:hover {
  color: var(--cyan);
}

.detail-title {
  margin: 0 0 16px;
  font-size: clamp(2rem, 5vw, 4.2rem);
  line-height: 1.05;
}

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

.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 22px 0 0;
}

.player {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: #000000;
  aspect-ratio: 16 / 9;
}

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

.play-overlay,
.player-loading,
.player-error {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}

.play-overlay {
  border: 0;
  color: #ffffff;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.32), rgba(0, 0, 0, 0.72));
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.play-overlay span {
  width: 78px;
  height: 78px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #001018;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  box-shadow: 0 0 40px rgba(34, 211, 238, 0.52);
  font-size: 2rem;
}

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

.player-loading {
  color: var(--cyan);
  background: rgba(0, 0, 0, 0.76);
}

.player-error {
  color: var(--danger);
  background: rgba(0, 0, 0, 0.82);
  text-align: center;
  padding: 24px;
}

.text-panel {
  margin-top: 22px;
}

.text-panel h2 {
  margin: 0 0 12px;
  color: var(--cyan);
}

.text-panel p {
  margin: 0;
  color: var(--text-soft);
  line-height: 1.9;
}

.detail-poster {
  overflow: hidden;
  border-radius: var(--radius-lg);
  aspect-ratio: 2 / 3;
  background: rgba(15, 23, 42, 0.9);
}

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

.compact-card {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 14px;
  padding: 12px;
  border-radius: 14px;
}

.compact-cover {
  overflow: hidden;
  border-radius: 10px;
  aspect-ratio: 2 / 3;
  background: rgba(15, 23, 42, 0.9);
}

.compact-card h3 {
  font-size: 0.98rem;
}

.compact-card span {
  color: var(--text-soft);
  font-size: 0.84rem;
}

.site-footer {
  margin-top: 60px;
  border-top: 1px solid rgba(30, 41, 59, 0.8);
  background: rgba(2, 6, 23, 0.78);
}

.footer-inner {
  width: min(var(--max-width), calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0;
  color: var(--text-muted);
  display: grid;
  gap: 10px;
}

.footer-brand {
  color: var(--text-main);
}

.is-hidden-by-filter {
  display: none !important;
}

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

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

@media (max-width: 860px) {
  .menu-toggle {
    display: inline-flex;
  }

  .nav-links {
    position: absolute;
    left: 16px;
    right: 16px;
    top: 70px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding: 14px;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    background: rgba(2, 6, 23, 0.96);
  }

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

  .hero {
    height: 82vh;
    min-height: 610px;
  }

  .hero-content {
    bottom: 74px;
  }

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

  .filter-bar,
  .detail-layout,
  .rank-item {
    grid-template-columns: 1fr;
  }

  .rank-cover {
    width: 92px;
  }
}

@media (max-width: 520px) {
  .top-nav,
  .container,
  .page-main,
  .footer-inner {
    width: min(100% - 22px, var(--max-width));
  }

  .grid,
  .category-grid,
  .related-grid {
    gap: 14px;
  }

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

  .hero-arrow {
    display: none;
  }

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