:root {
  color-scheme: dark;
  --bg: #020617;
  --bg-soft: #0f172a;
  --panel: rgba(15, 23, 42, 0.78);
  --panel-strong: rgba(15, 23, 42, 0.96);
  --line: rgba(148, 163, 184, 0.18);
  --text: #f8fafc;
  --muted: #94a3b8;
  --muted-strong: #cbd5e1;
  --cyan: #22d3ee;
  --cyan-dark: #0891b2;
  --green: #22c55e;
  --purple: #a855f7;
  --orange: #f97316;
  --radius: 1.25rem;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.36);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 18% 8%, rgba(34, 211, 238, 0.14), transparent 30rem),
    radial-gradient(circle at 82% 18%, rgba(168, 85, 247, 0.18), transparent 32rem),
    linear-gradient(135deg, #020617 0%, #000000 48%, #0f172a 100%);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  line-height: 1.6;
}

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

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

button,
input,
select {
  font: inherit;
}

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

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

.nav-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  gap: 24px;
}

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

.logo {
  font-size: 1.35rem;
}

.logo-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--cyan), var(--purple));
  color: #020617;
  box-shadow: 0 12px 34px rgba(34, 211, 238, 0.22);
}

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

.nav-link {
  padding: 9px 14px;
  border-radius: 999px;
  color: var(--muted-strong);
  transition: color 180ms ease, background 180ms ease, transform 180ms ease;
}

.nav-link:hover,
.nav-link.active {
  color: var(--text);
  background: rgba(34, 211, 238, 0.12);
}

.nav-link:hover {
  transform: translateY(-1px);
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.76);
  color: var(--text);
}

.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 4px auto;
  border-radius: 99px;
  background: currentColor;
}

.hero-carousel {
  position: relative;
  overflow: hidden;
  min-height: 620px;
  border-bottom: 1px solid var(--line);
}

.hero-track {
  position: relative;
  min-height: 620px;
}

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 560ms ease, transform 680ms ease;
  transform: scale(1.015);
}

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

.hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.42;
}

.hero-bg.image-error {
  display: none;
}

.hero-fallback {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(120deg, rgba(15, 23, 42, 0.95), rgba(2, 6, 23, 0.78)),
    radial-gradient(circle at 70% 35%, rgba(34, 211, 238, 0.26), transparent 28rem),
    radial-gradient(circle at 20% 65%, rgba(168, 85, 247, 0.24), transparent 30rem);
}

.hero-layer {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(2, 6, 23, 0.96) 0%, rgba(2, 6, 23, 0.72) 48%, rgba(2, 6, 23, 0.24) 100%);
}

.hero-content {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 34px;
  min-height: 620px;
  padding: 92px 0 70px;
  align-items: center;
}

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

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border: 1px solid rgba(34, 211, 238, 0.24);
  border-radius: 999px;
  background: rgba(34, 211, 238, 0.11);
  color: var(--cyan);
  font-size: 0.9rem;
  font-weight: 700;
}

.hero-copy h1,
.page-hero h1,
.detail-title h1 {
  margin: 18px 0 14px;
  font-size: clamp(2.25rem, 6vw, 5.15rem);
  line-height: 0.96;
  letter-spacing: -0.07em;
}

.hero-copy p,
.page-hero p,
.detail-title p {
  max-width: 720px;
  color: var(--muted-strong);
  font-size: 1.08rem;
}

.hero-actions,
.section-actions,
.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 11px 18px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-weight: 800;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease, border-color 180ms ease;
}

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

.btn-primary {
  background: linear-gradient(135deg, var(--cyan), var(--green));
  color: #020617;
  box-shadow: 0 18px 40px rgba(34, 211, 238, 0.22);
}

.btn-ghost {
  border-color: var(--line);
  background: rgba(15, 23, 42, 0.62);
  color: var(--text);
}

.btn-ghost:hover {
  border-color: rgba(34, 211, 238, 0.38);
  background: rgba(34, 211, 238, 0.12);
}

.hero-search {
  display: flex;
  width: min(100%, 620px);
  margin-top: 28px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.74);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.28);
}

.hero-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  padding: 0 18px;
  background: transparent;
  color: var(--text);
}

.hero-search button {
  border: 0;
  border-radius: 999px;
  padding: 10px 18px;
  background: var(--cyan);
  color: #020617;
  font-weight: 900;
  cursor: pointer;
}

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

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

.tag,
.category-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.62);
  color: var(--muted-strong);
  font-size: 0.84rem;
}

.category-pill:hover {
  color: var(--text);
  border-color: rgba(34, 211, 238, 0.34);
  background: rgba(34, 211, 238, 0.12);
}

.hero-panel {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: end;
  gap: 12px;
}

.hero-feature-card {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(15, 23, 42, 0.68);
  backdrop-filter: blur(18px);
  transition: transform 180ms ease, border-color 180ms ease;
}

.hero-feature-card:hover {
  transform: translateX(-4px);
  border-color: rgba(34, 211, 238, 0.32);
}

.hero-feature-card img {
  width: 88px;
  height: 120px;
  border-radius: 16px;
  object-fit: cover;
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.16), rgba(168, 85, 247, 0.16));
}

.hero-feature-card img.image-error {
  display: none;
}

.hero-feature-card h2 {
  margin: 4px 0 6px;
  font-size: 1rem;
}

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

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

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

.hero-dot.is-active {
  background: var(--cyan);
}

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

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

.section-head h2,
.detail-section h2,
.player-section h2 {
  margin: 0 0 6px;
  font-size: clamp(1.45rem, 3vw, 2.2rem);
  letter-spacing: -0.04em;
}

.section-head p,
.detail-section p,
.player-section p {
  margin: 0;
  color: var(--muted);
}

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

.movie-card {
  min-width: 0;
}

.poster {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 2 / 3;
  border: 1px solid var(--line);
  border-radius: 22px;
  background:
    linear-gradient(135deg, rgba(34, 211, 238, 0.16), rgba(168, 85, 247, 0.18)),
    #0f172a;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.22);
}

.poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 240ms ease, opacity 240ms ease;
}

.poster img.image-error {
  display: none;
}

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

.poster-shine {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 42%, rgba(2, 6, 23, 0.92) 100%);
}

.quality,
.score,
.year-badge {
  position: absolute;
  z-index: 2;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 900;
}

.quality {
  top: 10px;
  left: 10px;
  background: rgba(34, 211, 238, 0.92);
  color: #022c22;
}

.score {
  right: 10px;
  bottom: 10px;
  background: rgba(2, 6, 23, 0.78);
  color: #facc15;
  backdrop-filter: blur(10px);
}

.movie-info {
  padding: 12px 3px 0;
}

.movie-info h2 {
  margin: 0 0 5px;
  overflow: hidden;
  font-size: 1rem;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.movie-info h2 a:hover {
  color: var(--cyan);
}

.movie-meta {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.86rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.mini-tags {
  margin-top: 8px;
}

.mini-tags .tag {
  min-height: 24px;
  padding: 2px 8px;
  font-size: 0.76rem;
}

.ranking-layout {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 24px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.panel.pad {
  padding: 22px;
}

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

.rank-item {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid transparent;
  border-radius: 16px;
  color: var(--muted-strong);
  transition: background 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.rank-item:hover {
  transform: translateX(4px);
  border-color: rgba(34, 211, 238, 0.28);
  background: rgba(34, 211, 238, 0.09);
  color: var(--text);
}

.rank-no {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: rgba(34, 211, 238, 0.13);
  color: var(--cyan);
  font-weight: 900;
}

.rank-title {
  overflow: hidden;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.page-hero {
  padding: 78px 0 34px;
}

.page-hero-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 32px;
  background:
    radial-gradient(circle at 20% 20%, rgba(34, 211, 238, 0.18), transparent 28rem),
    radial-gradient(circle at 85% 10%, rgba(168, 85, 247, 0.20), transparent 28rem),
    rgba(15, 23, 42, 0.72);
  box-shadow: var(--shadow);
  padding: clamp(26px, 5vw, 56px);
}

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

.category-card {
  display: block;
  min-height: 172px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(15, 23, 42, 0.72);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.20);
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.category-card:hover {
  transform: translateY(-4px);
  border-color: rgba(34, 211, 238, 0.34);
  background: rgba(15, 23, 42, 0.95);
}

.category-card h2 {
  margin: 0 0 10px;
  font-size: 1.28rem;
}

.category-card p {
  margin: 0;
  color: var(--muted);
}

.filter-panel {
  display: grid;
  grid-template-columns: 1fr 180px 160px 140px;
  gap: 12px;
  margin: 0 0 26px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(15, 23, 42, 0.72);
}

.filter-panel input,
.filter-panel select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  outline: 0;
  background: rgba(2, 6, 23, 0.72);
  color: var(--text);
  padding: 12px 14px;
}

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

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

.pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 36px;
}

.page-link {
  min-width: 42px;
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--muted-strong);
  text-align: center;
}

.page-link:hover,
.page-link.active {
  border-color: rgba(34, 211, 238, 0.38);
  background: rgba(34, 211, 238, 0.12);
  color: var(--text);
}

.detail-hero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}

.detail-bg {
  position: absolute;
  inset: 0;
  opacity: 0.28;
}

.detail-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(12px);
  transform: scale(1.08);
}

.detail-bg img.image-error {
  display: none;
}

.detail-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, #020617 0%, rgba(2, 6, 23, 0.86) 52%, rgba(2, 6, 23, 0.68) 100%),
    radial-gradient(circle at 80% 30%, rgba(34, 211, 238, 0.20), transparent 30rem);
}

.detail-grid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 34px;
  padding: 72px 0 56px;
  align-items: end;
}

.detail-poster {
  overflow: hidden;
  aspect-ratio: 2 / 3;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.16), rgba(168, 85, 247, 0.18));
  box-shadow: var(--shadow);
}

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

.detail-poster img.image-error {
  display: none;
}

.detail-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 26px;
}

.fact {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.62);
}

.fact span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
}

.fact strong {
  display: block;
  overflow: hidden;
  margin-top: 4px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-section,
.detail-section {
  padding: 54px 0 0;
}

.player-shell {
  position: relative;
  overflow: hidden;
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: #000;
  box-shadow: var(--shadow);
}

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

.play-layer {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  gap: 12px;
  border: 0;
  background: radial-gradient(circle at center, rgba(34, 211, 238, 0.16), rgba(2, 6, 23, 0.78));
  color: var(--text);
  cursor: pointer;
}

.player-shell.is-playing .play-layer {
  display: none;
}

.play-icon {
  display: grid;
  place-items: center;
  width: 78px;
  height: 78px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--cyan), var(--green));
  box-shadow: 0 20px 50px rgba(34, 211, 238, 0.32);
}

.play-icon::before {
  content: "";
  width: 0;
  height: 0;
  margin-left: 5px;
  border-top: 14px solid transparent;
  border-bottom: 14px solid transparent;
  border-left: 22px solid #020617;
}

.play-layer span:last-child {
  font-size: 1.05rem;
  font-weight: 900;
}

.detail-content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 24px;
}

.prose-card,
.side-card {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(15, 23, 42, 0.72);
}

.prose-card + .prose-card,
.side-card + .side-card {
  margin-top: 18px;
}

.prose-card h2,
.side-card h2 {
  margin: 0 0 12px;
  font-size: 1.36rem;
}

.prose-card p {
  margin: 0;
  color: var(--muted-strong);
  white-space: pre-line;
}

.info-list {
  display: grid;
  gap: 10px;
}

.info-list div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.info-list span {
  color: var(--muted);
}

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

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

.footer-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 34px;
  padding: 42px 0;
}

.footer-logo {
  margin-bottom: 12px;
  font-size: 1.2rem;
}

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

.site-footer h2 {
  margin: 0 0 12px;
  font-size: 1rem;
}

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

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

.copyright {
  padding: 18px 0 26px;
  border-top: 1px solid var(--line);
  font-size: 0.9rem;
}

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

  .hero-content,
  .ranking-layout,
  .detail-content-grid {
    grid-template-columns: 1fr;
  }

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

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

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

  .nav-toggle {
    display: block;
  }

  .site-nav {
    position: absolute;
    top: 72px;
    left: 11px;
    right: 11px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: rgba(2, 6, 23, 0.96);
    box-shadow: var(--shadow);
  }

  .site-nav.open {
    display: flex;
  }

  .nav-link {
    border-radius: 14px;
  }

  .hero-carousel,
  .hero-track,
  .hero-content {
    min-height: 760px;
  }

  .hero-content {
    align-items: end;
    padding-top: 54px;
  }

  .hero-panel {
    grid-template-columns: 1fr;
  }

  .hero-feature-card:nth-child(n + 3) {
    display: none;
  }

  .hero-search {
    border-radius: 22px;
    flex-direction: column;
  }

  .hero-search input {
    min-height: 46px;
  }

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

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

  .filter-panel {
    grid-template-columns: 1fr 1fr;
  }

  .detail-grid {
    grid-template-columns: 150px minmax(0, 1fr);
    gap: 18px;
    padding-top: 46px;
  }

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

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

@media (max-width: 560px) {
  .logo {
    font-size: 1.05rem;
  }

  .hero-copy h1,
  .page-hero h1,
  .detail-title h1 {
    font-size: clamp(2rem, 14vw, 3.4rem);
  }

  .hero-carousel,
  .hero-track,
  .hero-content {
    min-height: 820px;
  }

  .main-section {
    padding: 50px 0;
  }

  .section-head {
    display: block;
  }

  .section-actions {
    margin-top: 14px;
  }

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

  .category-grid,
  .related-grid,
  .filter-panel {
    grid-template-columns: 1fr;
  }

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

  .rank-meta {
    grid-column: 2;
  }

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

  .detail-poster {
    width: min(220px, 72vw);
  }

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

  .prose-card,
  .side-card {
    padding: 18px;
  }
}
