* {
  box-sizing: border-box;
}

:root {
  color-scheme: dark;
  --bg: #020617;
  --bg-soft: #0f172a;
  --bg-card: #1e293b;
  --bg-card-soft: rgba(30, 41, 59, 0.74);
  --line: #334155;
  --text: #f8fafc;
  --muted: #94a3b8;
  --muted-strong: #cbd5e1;
  --primary: #10b981;
  --primary-dark: #059669;
  --primary-soft: rgba(16, 185, 129, 0.18);
  --teal: #0d9488;
  --shadow: 0 25px 50px rgba(0, 0, 0, 0.35);
  --radius: 1rem;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(16, 185, 129, 0.18), transparent 30rem),
    linear-gradient(135deg, #0f172a 0%, #1e293b 48%, #0f172a 100%);
}

body.menu-open {
  overflow: hidden;
}

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

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

button,
input,
select {
  font: inherit;
}

.container {
  width: min(1180px, calc(100% - 2rem));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid rgba(51, 65, 85, 0.85);
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(14px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 4rem;
}

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

.brand-title {
  font-size: 1.2rem;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.75rem;
  color: white;
  font-size: 0.9rem;
  background: linear-gradient(135deg, var(--primary), var(--teal));
  box-shadow: 0 15px 30px rgba(16, 185, 129, 0.22);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.4rem;
  color: var(--muted-strong);
}

.site-nav a {
  transition: color 0.2s ease;
}

.site-nav a:hover {
  color: #6ee7b7;
}

.nav-toggle {
  display: none;
  width: 2.5rem;
  height: 2.5rem;
  border: 0;
  border-radius: 0.7rem;
  background: rgba(30, 41, 59, 0.82);
}

.nav-toggle span {
  display: block;
  width: 1.25rem;
  height: 2px;
  margin: 0.28rem auto;
  background: white;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

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

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transform: scale(1.02);
  transition: opacity 0.8s ease, transform 1.1s ease;
}

.hero-slide.is-active {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
}

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

.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.05), rgba(15, 23, 42, 0.58) 48%, #0f172a 100%),
    linear-gradient(90deg, rgba(2, 6, 23, 0.82), rgba(2, 6, 23, 0.32), rgba(2, 6, 23, 0.12));
}

.hero-content {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: flex-end;
  min-height: 600px;
  padding: 6rem 0 5rem;
}

.hero-copy {
  max-width: 45rem;
}

.hero-kicker,
.section-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.38rem 0.78rem;
  border-radius: 999px;
  color: white;
  background: var(--primary);
  font-size: 0.9rem;
  font-weight: 700;
}

.hero h1 {
  margin: 1rem 0;
  font-size: clamp(2.6rem, 7vw, 5.8rem);
  line-height: 0.98;
  letter-spacing: -0.06em;
}

.hero p {
  max-width: 42rem;
  margin: 0 0 1.6rem;
  color: #e2e8f0;
  font-size: clamp(1rem, 2vw, 1.25rem);
}

.hero-actions,
.section-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 2.8rem;
  padding: 0.78rem 1.35rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font-weight: 800;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

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

.btn-primary {
  color: white;
  background: var(--primary);
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-ghost {
  color: white;
  border-color: rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(8px);
}

.hero-dots {
  position: absolute;
  z-index: 5;
  left: 50%;
  bottom: 2rem;
  display: flex;
  gap: 0.5rem;
  transform: translateX(-50%);
}

.hero-dot {
  width: 0.8rem;
  height: 0.8rem;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.38);
}

.hero-dot.is-active {
  width: 2.4rem;
  background: var(--primary);
}

.section {
  padding: 4.5rem 0;
}

.section.alt {
  background: linear-gradient(90deg, rgba(6, 78, 59, 0.24), rgba(19, 78, 74, 0.18));
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2rem;
}

.section-head h1,
.section-head h2 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.section-head p {
  max-width: 42rem;
  margin: 0.75rem 0 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.inline-link {
  color: #6ee7b7;
  font-weight: 800;
  white-space: nowrap;
}

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

.movie-card {
  overflow: hidden;
  border: 1px solid rgba(51, 65, 85, 0.58);
  border-radius: 0.9rem;
  background: rgba(30, 41, 59, 0.88);
  box-shadow: 0 18px 35px rgba(0, 0, 0, 0.2);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.movie-card:hover {
  transform: translateY(-6px) scale(1.015);
  border-color: rgba(16, 185, 129, 0.55);
  box-shadow: var(--shadow);
}

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

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

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

.poster-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(15, 23, 42, 0.9), transparent 54%);
}

.poster-badge {
  position: absolute;
  top: 0.65rem;
  left: 0.65rem;
  z-index: 2;
  padding: 0.28rem 0.5rem;
  border-radius: 0.42rem;
  color: white;
  background: rgba(16, 185, 129, 0.92);
  font-size: 0.72rem;
  font-weight: 800;
}

.card-body {
  padding: 0.82rem;
}

.card-body h2,
.card-body h3 {
  display: -webkit-box;
  min-height: 2.55rem;
  margin: 0;
  overflow: hidden;
  color: white;
  font-size: 0.96rem;
  line-height: 1.32;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.movie-card:hover h2,
.movie-card:hover h3 {
  color: #34d399;
}

.card-meta,
.card-genre,
.card-summary {
  margin: 0.45rem 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.card-summary {
  display: -webkit-box;
  overflow: hidden;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.small-tags {
  margin-top: 0.75rem;
}

.tag-list span,
.meta-pill {
  display: inline-flex;
  align-items: center;
  min-height: 1.6rem;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  color: #cbd5e1;
  background: rgba(51, 65, 85, 0.86);
  font-size: 0.78rem;
}

.category-cloud {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.85rem;
}

.category-pill {
  padding: 0.85rem 1.15rem;
  border-radius: 999px;
  color: white;
  background: rgba(30, 41, 59, 0.88);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.24);
  transition: transform 0.2s ease, background 0.2s ease;
}

.category-pill:hover {
  transform: translateY(-3px) scale(1.03);
  background: var(--primary-dark);
}

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

.category-tile {
  min-height: 13rem;
  padding: 1.4rem;
  border: 1px solid rgba(51, 65, 85, 0.74);
  border-radius: 1rem;
  background:
    radial-gradient(circle at top right, rgba(16, 185, 129, 0.22), transparent 9rem),
    rgba(30, 41, 59, 0.88);
  box-shadow: 0 18px 32px rgba(0, 0, 0, 0.18);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.category-tile:hover {
  transform: translateY(-5px);
  border-color: rgba(16, 185, 129, 0.58);
}

.category-count {
  display: inline-flex;
  margin-bottom: 2.7rem;
  padding: 0.28rem 0.58rem;
  border-radius: 999px;
  color: #6ee7b7;
  background: rgba(16, 185, 129, 0.12);
  font-weight: 800;
  font-size: 0.82rem;
}

.category-tile h2 {
  margin: 0 0 0.55rem;
  font-size: 1.45rem;
}

.category-tile p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.rank-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.rank-panel {
  padding: 1.15rem;
  border-radius: 1rem;
  background: rgba(30, 41, 59, 0.82);
  box-shadow: 0 18px 32px rgba(0, 0, 0, 0.18);
}

.rank-panel h2 {
  margin: 0 0 1rem;
  font-size: 1.45rem;
}

.rank-list {
  display: grid;
  gap: 0.75rem;
}

.rank-row {
  display: grid;
  grid-template-columns: 2.2rem 4.2rem 1fr auto;
  align-items: center;
  gap: 0.75rem;
  min-height: 5.1rem;
  padding: 0.6rem;
  border-radius: 0.8rem;
  background: rgba(51, 65, 85, 0.52);
  transition: background 0.2s ease;
}

.rank-row:hover {
  background: rgba(51, 65, 85, 0.92);
}

.rank-number {
  color: #6ee7b7;
  font-weight: 900;
  font-size: 1.1rem;
}

.rank-row img {
  width: 4.2rem;
  height: 4.2rem;
  border-radius: 0.6rem;
  object-fit: cover;
}

.rank-title {
  color: white;
  font-weight: 800;
}

.rank-meta {
  color: var(--muted);
  font-size: 0.82rem;
}

.search-panel {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  padding: 1rem;
  border: 1px solid rgba(51, 65, 85, 0.72);
  border-radius: 1rem;
  background: rgba(15, 23, 42, 0.62);
}

.search-panel input,
.search-panel select {
  width: 100%;
  min-height: 3rem;
  padding: 0 0.9rem;
  border: 1px solid rgba(71, 85, 105, 0.95);
  border-radius: 0.75rem;
  color: white;
  background: rgba(30, 41, 59, 0.9);
  outline: none;
}

.search-panel input:focus,
.search-panel select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.12);
}

.filter-count {
  margin: 0 0 1.2rem;
  color: var(--muted);
}

.empty-state {
  display: none;
  padding: 3rem 1rem;
  border: 1px solid rgba(51, 65, 85, 0.72);
  border-radius: 1rem;
  color: var(--muted);
  text-align: center;
  background: rgba(15, 23, 42, 0.62);
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(18rem, 1fr);
  gap: 2rem;
}

.player-card,
.detail-card,
.review-card,
.related-card {
  overflow: hidden;
  border: 1px solid rgba(51, 65, 85, 0.68);
  border-radius: 1.35rem;
  background: rgba(30, 41, 59, 0.86);
  box-shadow: var(--shadow);
}

.player-card {
  position: relative;
  margin-bottom: 1.5rem;
  background: #000;
}

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

.player-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.24), rgba(2, 6, 23, 0.78));
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

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

.player-start {
  display: inline-grid;
  place-items: center;
  width: 6rem;
  height: 6rem;
  border: 0;
  border-radius: 999px;
  color: white;
  background: linear-gradient(135deg, var(--primary), var(--teal));
  box-shadow: 0 18px 36px rgba(16, 185, 129, 0.38);
  font-weight: 900;
  transition: transform 0.2s ease;
}

.player-start:hover {
  transform: scale(1.07);
}

.detail-card,
.review-card,
.related-card {
  padding: 1.5rem;
}

.detail-card h1 {
  margin: 0.9rem 0 1rem;
  font-size: clamp(2rem, 4vw, 3.25rem);
  line-height: 1.08;
  letter-spacing: -0.04em;
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.detail-card h2,
.review-card h2,
.related-card h2 {
  margin: 1.2rem 0 0.75rem;
  font-size: 1.5rem;
}

.detail-card p,
.review-card p {
  color: #d1d5db;
  line-height: 1.82;
}

.related-card {
  position: sticky;
  top: 5.4rem;
}

.related-list {
  display: grid;
  gap: 0.85rem;
}

.related-item {
  display: grid;
  grid-template-columns: 7rem 1fr;
  gap: 0.75rem;
  padding: 0.65rem;
  border-radius: 0.85rem;
  background: rgba(51, 65, 85, 0.56);
  transition: background 0.2s ease;
}

.related-item:hover {
  background: rgba(51, 65, 85, 0.92);
}

.related-item img {
  width: 7rem;
  height: 4.5rem;
  border-radius: 0.6rem;
  object-fit: cover;
}

.related-item h3 {
  display: -webkit-box;
  margin: 0 0 0.3rem;
  overflow: hidden;
  font-size: 0.96rem;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.related-item p {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.breadcrumb {
  display: inline-flex;
  margin-bottom: 1.2rem;
  color: #6ee7b7;
  font-weight: 800;
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 2rem;
}

.pagination a,
.pagination span {
  min-width: 2.6rem;
  padding: 0.7rem 0.9rem;
  border-radius: 0.72rem;
  text-align: center;
  background: rgba(30, 41, 59, 0.9);
}

.pagination .active {
  color: white;
  background: var(--primary);
}

.callout {
  padding: 4rem 1rem;
  text-align: center;
  background: linear-gradient(90deg, rgba(30, 41, 59, 0.86), rgba(15, 23, 42, 0.92));
}

.callout h2 {
  margin: 0 0 1rem;
  font-size: clamp(2rem, 4vw, 3rem);
}

.callout p {
  max-width: 44rem;
  margin: 0 auto 1.5rem;
  color: var(--muted-strong);
  font-size: 1.1rem;
}

.site-footer {
  border-top: 1px solid rgba(51, 65, 85, 0.86);
  background: #020617;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2rem;
  padding: 3rem 0;
}

.footer-grid h2 {
  margin: 0 0 0.9rem;
  font-size: 1rem;
}

.footer-grid p,
.footer-grid a {
  display: block;
  margin: 0.45rem 0;
  color: var(--muted);
  line-height: 1.65;
  font-size: 0.92rem;
}

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

.footer-bottom {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  width: min(1180px, calc(100% - 2rem));
  margin-inline: auto;
  padding: 1.25rem 0;
  border-top: 1px solid rgba(51, 65, 85, 0.68);
  color: #64748b;
  font-size: 0.9rem;
}

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

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

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

  .site-nav {
    position: fixed;
    inset: 4rem 0 auto 0;
    display: grid;
    gap: 0;
    padding: 0.8rem 1rem 1.2rem;
    border-bottom: 1px solid rgba(51, 65, 85, 0.86);
    background: rgba(15, 23, 42, 0.98);
    transform: translateY(-125%);
    transition: transform 0.25s ease;
  }

  body.menu-open .site-nav {
    transform: translateY(0);
  }

  .site-nav a {
    padding: 0.85rem 0;
  }

  body.menu-open .nav-toggle span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  body.menu-open .nav-toggle span:nth-child(2) {
    opacity: 0;
  }

  body.menu-open .nav-toggle span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  .hero,
  .hero-content {
    min-height: 540px;
  }

  .hero-content {
    padding: 5rem 0 4.5rem;
  }

  .section-head {
    display: block;
  }

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

  .detail-layout,
  .footer-grid,
  .search-panel {
    grid-template-columns: 1fr;
  }

  .related-card {
    position: static;
  }

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

@media (max-width: 560px) {
  .container {
    width: min(100% - 1rem, 1180px);
  }

  .brand-title {
    font-size: 1rem;
  }

  .brand-mark {
    width: 2.25rem;
    height: 2.25rem;
  }

  .movie-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
  }

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

  .rank-row {
    grid-template-columns: 2rem 3.6rem 1fr;
  }

  .rank-row img {
    width: 3.6rem;
    height: 3.6rem;
  }

  .rank-meta {
    display: none;
  }

  .related-item {
    grid-template-columns: 5.8rem 1fr;
  }

  .related-item img {
    width: 5.8rem;
    height: 4rem;
  }

  .footer-bottom {
    display: block;
  }
}
