:root {
  color-scheme: dark;
  --bg: #020617;
  --panel: rgba(15, 23, 42, 0.78);
  --panel-strong: #0f172a;
  --line: rgba(148, 163, 184, 0.18);
  --text: #f8fafc;
  --muted: #94a3b8;
  --soft: #cbd5e1;
  --cyan: #22d3ee;
  --blue: #2563eb;
  --orange: #f97316;
  --yellow: #facc15;
  --radius: 22px;
  --shadow: 0 24px 60px rgba(2, 6, 23, 0.42);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 15% 0%, rgba(34, 211, 238, 0.16), transparent 28rem),
    radial-gradient(circle at 85% 10%, rgba(37, 99, 235, 0.2), transparent 30rem),
    linear-gradient(180deg, #020617 0%, #0f172a 48%, #020617 100%);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  line-height: 1.6;
}

body.menu-open {
  overflow: hidden;
}

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

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

button,
input,
select {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(2, 6, 23, 0.82);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.nav-wrap {
  width: min(1200px, calc(100% - 32px));
  height: 72px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

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

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  box-shadow: 0 14px 36px rgba(34, 211, 238, 0.28);
}

.brand-text {
  font-size: 1.1rem;
}

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

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

.nav-link:hover,
.nav-link.active {
  color: #ffffff;
  background: rgba(34, 211, 238, 0.13);
}

.mobile-menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.8);
  color: #ffffff;
}

.mobile-menu-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 4px auto;
  background: #ffffff;
  border-radius: 999px;
}

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

.hero-slider {
  position: absolute;
  inset: 0;
}

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

.hero-slide.active {
  opacity: 1;
  transform: scale(1);
}

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

.hero-slide::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(2, 6, 23, 0.98), rgba(2, 6, 23, 0.48) 48%, rgba(2, 6, 23, 0.86)),
    linear-gradient(0deg, #020617 0%, rgba(2, 6, 23, 0.12) 48%, rgba(2, 6, 23, 0.4) 100%);
}

.hero-content {
  position: relative;
  z-index: 2;
  width: min(1200px, calc(100% - 32px));
  min-height: 72vh;
  margin: 0 auto;
  display: flex;
  align-items: flex-end;
  padding: 88px 0 76px;
}

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

.hero-badge,
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #fef08a;
  font-weight: 800;
  margin-bottom: 16px;
}

.hero h1 {
  margin: 0 0 10px;
  font-size: clamp(2.55rem, 6vw, 5.8rem);
  line-height: 0.98;
  letter-spacing: -0.06em;
}

.hero h2 {
  margin: 0 0 18px;
  font-size: clamp(1.6rem, 4vw, 3.2rem);
  line-height: 1.05;
}

.hero p {
  max-width: 640px;
  margin: 0 0 22px;
  color: #dbeafe;
  font-size: 1.08rem;
}

.hero-meta,
.pill-list,
.detail-meta,
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.hero-meta span,
.pill-list a,
.pill-list span,
.detail-meta span,
.tags span {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 6px 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #e0f2fe;
  backdrop-filter: blur(12px);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
}

.btn,
button.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 12px 22px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  color: #ffffff;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 18px 36px rgba(37, 99, 235, 0.32);
  transition: transform 0.2s ease, filter 0.2s ease;
}

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

.btn.secondary {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: none;
}

.hero-dots {
  position: absolute;
  z-index: 5;
  right: max(24px, calc((100vw - 1200px) / 2));
  bottom: 38px;
  display: flex;
  gap: 9px;
}

.hero-dot {
  width: 12px;
  height: 12px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.34);
  cursor: pointer;
}

.hero-dot.active {
  width: 34px;
  background: var(--cyan);
}

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

.stack {
  display: grid;
  gap: 62px;
}

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

.section-head h2,
.page-title h1,
.detail-title h1 {
  margin: 0;
  color: #ffffff;
  font-size: clamp(1.65rem, 3vw, 2.55rem);
  line-height: 1.15;
}

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

.section-more {
  color: var(--cyan);
  font-weight: 800;
}

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

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

.movie-card {
  border: 1px solid var(--line);
  border-radius: 20px;
  overflow: hidden;
  background: rgba(15, 23, 42, 0.62);
  box-shadow: 0 10px 28px rgba(2, 6, 23, 0.22);
  transition: transform 0.22s ease, border-color 0.22s ease, background 0.22s ease;
}

.movie-card:hover {
  transform: translateY(-6px) scale(1.01);
  border-color: rgba(34, 211, 238, 0.58);
  background: rgba(15, 23, 42, 0.96);
}

.movie-link {
  display: block;
  height: 100%;
}

.poster-shell {
  position: relative;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  background:
    radial-gradient(circle at 30% 20%, rgba(34, 211, 238, 0.3), transparent 42%),
    linear-gradient(135deg, #1e293b, #020617);
}

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

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

.poster-shell::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 45%, rgba(0, 0, 0, 0.82));
}

.duration-pill,
.rank-badge,
.play-hover {
  position: absolute;
  z-index: 2;
}

.duration-pill {
  right: 10px;
  bottom: 10px;
  padding: 4px 8px;
  border-radius: 9px;
  background: rgba(0, 0, 0, 0.72);
  color: #ffffff;
  font-size: 0.75rem;
}

.rank-badge {
  top: 10px;
  left: 10px;
  min-width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--orange), #ef4444);
  color: #ffffff;
}

.play-hover {
  left: 50%;
  top: 50%;
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(34, 211, 238, 0.92);
  color: #ffffff;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.85);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.movie-card:hover .play-hover {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.movie-info {
  padding: 14px;
}

.movie-info h3 {
  margin: 0 0 8px;
  font-size: 1rem;
  line-height: 1.3;
  color: #ffffff;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.movie-info p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.88rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.meta-row,
.score-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--soft);
  font-size: 0.82rem;
}

.score-row {
  margin-top: 7px;
  color: #fef08a;
}

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

.category-tile {
  min-height: 178px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background:
    linear-gradient(135deg, rgba(34, 211, 238, 0.12), rgba(37, 99, 235, 0.1)),
    rgba(15, 23, 42, 0.74);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.category-tile:hover {
  transform: translateY(-5px);
  border-color: rgba(34, 211, 238, 0.48);
}

.category-tile strong {
  font-size: 1.28rem;
}

.category-tile p {
  color: var(--muted);
  margin: 10px 0 0;
}

.search-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(15, 23, 42, 0.68);
  backdrop-filter: blur(16px);
  margin: 26px 0 34px;
}

.hero .search-panel {
  max-width: 760px;
  margin: 24px 0 0;
  padding: 10px;
  background: rgba(2, 6, 23, 0.62);
}

.search-panel input,
.search-panel select {
  min-height: 46px;
  width: 100%;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 999px;
  outline: 0;
  background: rgba(2, 6, 23, 0.78);
  color: #ffffff;
  padding: 0 16px;
}

.search-panel select {
  min-width: 160px;
}

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

.rank-item {
  display: grid;
  grid-template-columns: 56px 100px 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(15, 23, 42, 0.72);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.rank-item:hover {
  transform: translateX(4px);
  border-color: rgba(34, 211, 238, 0.48);
}

.rank-no {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--orange), var(--blue));
  font-weight: 900;
}

.rank-cover {
  width: 100px;
  aspect-ratio: 16 / 10;
  border-radius: 14px;
  overflow: hidden;
  background: linear-gradient(135deg, #1e293b, #020617);
}

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

.rank-main strong {
  display: block;
  color: #ffffff;
  margin-bottom: 4px;
}

.rank-main p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.rank-score {
  color: #fef08a;
  font-weight: 900;
}

.row-scroll {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(260px, 1fr);
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 6px;
  scroll-snap-type: x mandatory;
}

.row-card {
  scroll-snap-align: start;
  display: grid;
  grid-template-columns: 116px 1fr;
  gap: 14px;
  align-items: center;
  min-width: 260px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(15, 23, 42, 0.72);
}

.row-thumb {
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: 16px;
  overflow: hidden;
  background: linear-gradient(135deg, #1e293b, #020617);
}

.row-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.row-thumb span {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.18);
}

.row-card strong {
  display: block;
  margin-bottom: 4px;
}

.row-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.page-hero {
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(34, 211, 238, 0.18), rgba(37, 99, 235, 0.16)),
    rgba(15, 23, 42, 0.68);
}

.page-title {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
  padding: 62px 0 52px;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 0.92rem;
}

.breadcrumb a:hover {
  color: var(--cyan);
}

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

.detail-main,
.detail-side,
.content-card {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(15, 23, 42, 0.72);
  box-shadow: var(--shadow);
}

.detail-main {
  overflow: hidden;
}

.player-shell {
  position: relative;
  background: #000000;
}

.player-shell video {
  width: 100%;
  aspect-ratio: 16 / 9;
  display: block;
  background: #000000;
}

.player-layer {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: grid;
  place-items: center;
  border: 0;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.72), rgba(0, 0, 0, 0.18));
  color: #ffffff;
  cursor: pointer;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.player-layer-inner {
  display: grid;
  place-items: center;
  gap: 10px;
  font-weight: 900;
}

.play-circle {
  width: 78px;
  height: 78px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  box-shadow: 0 18px 46px rgba(34, 211, 238, 0.36);
  font-size: 2rem;
}

.player-shell.player-active .player-layer {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.detail-body {
  padding: 24px;
}

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

.detail-section {
  margin-top: 28px;
}

.detail-section h2 {
  margin: 0 0 12px;
  color: #ffffff;
  font-size: 1.35rem;
}

.detail-section p {
  margin: 0;
  color: #dbeafe;
  text-align: justify;
}

.detail-side {
  position: sticky;
  top: 94px;
  padding: 18px;
}

.side-poster {
  position: relative;
  border-radius: 22px;
  overflow: hidden;
  background: linear-gradient(135deg, #1e293b, #020617);
  aspect-ratio: 2 / 3;
  margin-bottom: 18px;
}

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

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

.related-card {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border-radius: 16px;
  background: rgba(2, 6, 23, 0.48);
  transition: background 0.2s ease;
}

.related-card:hover {
  background: rgba(34, 211, 238, 0.11);
}

.related-thumb {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: 12px;
  background: linear-gradient(135deg, #1e293b, #020617);
}

.related-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.related-card strong {
  display: block;
  color: #ffffff;
  font-size: 0.95rem;
  line-height: 1.25;
  margin-bottom: 4px;
}

.related-card span {
  color: var(--muted);
  font-size: 0.82rem;
}

.site-footer {
  border-top: 1px solid var(--line);
  background: rgba(2, 6, 23, 0.82);
}

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

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

.footer-links a:hover,
.footer-brand:hover {
  color: var(--cyan);
}

.hidden-card {
  display: none !important;
}

.empty-state {
  display: none;
  padding: 38px;
  border: 1px solid var(--line);
  border-radius: 22px;
  text-align: center;
  color: var(--muted);
  background: rgba(15, 23, 42, 0.72);
}

.empty-state.show {
  display: block;
}

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

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

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

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

  .nav-links {
    position: fixed;
    left: 16px;
    right: 16px;
    top: 82px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: rgba(2, 6, 23, 0.96);
    box-shadow: var(--shadow);
  }

  body.menu-open .nav-links {
    display: flex;
  }

  .nav-link {
    text-align: center;
  }

  .hero,
  .hero-content {
    min-height: 78vh;
  }

  .hero-dots {
    left: 16px;
    right: auto;
  }

  .section-head,
  .search-panel {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .search-panel {
    display: grid;
  }

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

  .rank-item {
    grid-template-columns: 42px 86px 1fr;
  }

  .rank-score {
    grid-column: 3;
  }

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

  .detail-side {
    position: static;
  }
}

@media (max-width: 520px) {
  .nav-wrap,
  .main,
  .page-main,
  .page-title,
  .footer-inner,
  .hero-content {
    width: min(100% - 24px, 1200px);
  }

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

  .hero-content {
    padding-bottom: 68px;
  }

  .hero-actions {
    align-items: stretch;
  }

  .hero-actions .btn {
    width: 100%;
  }

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

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

  .movie-info {
    padding: 12px;
  }

  .movie-info p {
    display: none;
  }

  .row-card {
    grid-template-columns: 96px 1fr;
  }
}
