:root {
  color-scheme: dark;
  --bg: #020617;
  --bg-soft: #0f172a;
  --panel: #111827;
  --panel-2: #1e293b;
  --line: rgba(148, 163, 184, 0.18);
  --text: #f8fafc;
  --muted: #94a3b8;
  --cyan: #22d3ee;
  --blue: #3b82f6;
  --orange: #fb923c;
  --green: #34d399;
  --radius: 18px;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.32);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(34, 211, 238, 0.16), transparent 34rem),
    radial-gradient(circle at top right, rgba(59, 130, 246, 0.15), transparent 30rem),
    linear-gradient(180deg, #0f172a 0%, #020617 44%, #020617 100%);
}

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

img {
  display: block;
  max-width: 100%;
  background: linear-gradient(135deg, #0f172a, #1e293b);
}

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: linear-gradient(90deg, rgba(15, 23, 42, 0.96), rgba(30, 41, 59, 0.96), rgba(15, 23, 42, 0.96));
  border-bottom: 1px solid var(--line);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(16px);
}

.nav-wrap {
  min-height: 68px;
  display: flex;
  align-items: center;
  gap: 22px;
}

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

.brand-icon {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  color: #082f49;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  box-shadow: 0 10px 26px rgba(34, 211, 238, 0.32);
}

.brand-text,
.footer-brand {
  font-size: 1.2rem;
  background: linear-gradient(90deg, #67e8f9, #60a5fa);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

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

.nav-links a {
  color: #cbd5e1;
  font-size: 0.95rem;
  transition: color 0.2s ease;
}

.nav-links a:hover {
  color: #ffffff;
}

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

.nav-search input,
.search-panel input,
.search-panel select {
  border: 1px solid rgba(148, 163, 184, 0.22);
  outline: none;
  color: var(--text);
  background: rgba(15, 23, 42, 0.86);
  border-radius: 999px;
  padding: 10px 14px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.nav-search input {
  width: 220px;
}

.nav-search input:focus,
.search-panel input:focus,
.search-panel select:focus {
  border-color: rgba(34, 211, 238, 0.68);
  box-shadow: 0 0 0 4px rgba(34, 211, 238, 0.12);
}

.nav-search button,
.primary-button,
.ghost-button,
.search-panel button,
.player-overlay,
.back-top {
  border: 0;
  cursor: pointer;
}

.nav-search button,
.primary-button,
.search-panel button {
  color: #062233;
  font-weight: 800;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  border-radius: 999px;
  padding: 10px 18px;
  box-shadow: 0 14px 30px rgba(34, 211, 238, 0.22);
}

.ghost-button {
  color: #e2e8f0;
  border: 1px solid rgba(226, 232, 240, 0.22);
  background: rgba(15, 23, 42, 0.62);
  border-radius: 999px;
  padding: 10px 18px;
}

.menu-toggle {
  display: none;
  margin-left: auto;
  color: #fff;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px 12px;
}

.hero-carousel {
  position: relative;
  min-height: 520px;
  overflow: hidden;
  isolation: isolate;
}

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

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

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

.hero-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(2, 6, 23, 0.9), rgba(15, 23, 42, 0.52), rgba(2, 6, 23, 0.45)),
    linear-gradient(0deg, rgba(2, 6, 23, 1), rgba(2, 6, 23, 0.08) 48%, rgba(2, 6, 23, 0.72));
}

.hero-content {
  position: relative;
  z-index: 2;
  min-height: 520px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 72px 0 72px;
}

.hero-content h1 {
  max-width: 760px;
  margin: 14px 0 18px;
  font-size: clamp(2.5rem, 6vw, 5.4rem);
  line-height: 0.95;
  letter-spacing: -0.05em;
}

.hero-content p {
  max-width: 700px;
  margin: 0 0 24px;
  color: #dbeafe;
  font-size: clamp(1rem, 2.2vw, 1.25rem);
  line-height: 1.75;
}

.eyebrow,
.section-kicker {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  border: 1px solid rgba(34, 211, 238, 0.3);
  color: #67e8f9;
  background: rgba(8, 145, 178, 0.15);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.hero-actions,
.meta-pills {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.meta-pills {
  margin-bottom: 24px;
}

.meta-pills span {
  color: #e2e8f0;
  background: rgba(15, 23, 42, 0.62);
  border: 1px solid rgba(226, 232, 240, 0.12);
  border-radius: 999px;
  padding: 7px 12px;
}

.carousel-button {
  position: absolute;
  top: 50%;
  z-index: 3;
  width: 42px;
  height: 42px;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 50%;
  background: rgba(2, 6, 23, 0.6);
  cursor: pointer;
  transform: translateY(-50%);
  transition: background 0.2s ease, transform 0.2s ease;
}

.carousel-button:hover {
  background: rgba(8, 145, 178, 0.82);
  transform: translateY(-50%) scale(1.04);
}

.carousel-button.prev {
  left: 22px;
}

.carousel-button.next {
  right: 22px;
}

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

.carousel-dots button {
  width: 10px;
  height: 10px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.44);
  cursor: pointer;
  transition: width 0.2s ease, background 0.2s ease;
}

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

main {
  min-height: 60vh;
}

.page-section {
  padding: 64px 0;
}

.page-section.tight {
  padding-top: 36px;
}

.section-heading {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 28px;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  letter-spacing: -0.03em;
}

.section-heading p {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  line-height: 1.75;
}

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

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

.movie-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(15, 23, 42, 0.84);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.18);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.movie-card:hover {
  transform: translateY(-4px);
  border-color: rgba(34, 211, 238, 0.55);
  box-shadow: 0 24px 58px rgba(34, 211, 238, 0.12);
}

.poster-link {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 16 / 9;
}

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

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

.quality-badge,
.play-mark {
  position: absolute;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.quality-badge {
  right: 10px;
  bottom: 10px;
  color: #fff;
  background: rgba(0, 0, 0, 0.66);
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 0.75rem;
}

.play-mark {
  left: 50%;
  top: 50%;
  width: 52px;
  height: 52px;
  color: #fff;
  background: rgba(34, 211, 238, 0.82);
  border-radius: 50%;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.8);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

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

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

.movie-meta {
  color: var(--muted);
  font-size: 0.78rem;
  margin-bottom: 8px;
}

.movie-card h3 {
  margin: 0 0 10px;
  font-size: 1.05rem;
  line-height: 1.35;
}

.movie-card h3 a:hover {
  color: var(--cyan);
}

.movie-card p {
  min-height: 48px;
  margin: 0 0 12px;
  color: #cbd5e1;
  font-size: 0.92rem;
  line-height: 1.6;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.tag-row span {
  color: #67e8f9;
  background: rgba(8, 145, 178, 0.14);
  border: 1px solid rgba(34, 211, 238, 0.16);
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 0.74rem;
}

.horizontal-scroll {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(260px, 320px);
  gap: 20px;
  overflow-x: auto;
  padding: 4px 2px 18px;
  scrollbar-color: rgba(34, 211, 238, 0.5) rgba(15, 23, 42, 0.9);
}

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

.category-card {
  min-height: 150px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  background:
    radial-gradient(circle at top right, rgba(34, 211, 238, 0.18), transparent 54%),
    rgba(15, 23, 42, 0.84);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.category-card:hover {
  transform: translateY(-4px);
  border-color: rgba(34, 211, 238, 0.52);
}

.category-card strong {
  display: block;
  margin-bottom: 8px;
  font-size: 1.18rem;
}

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

.category-count {
  color: #67e8f9;
  font-weight: 800;
}

.rank-panel {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 22px;
}

.rank-list,
.info-panel,
.search-panel,
.detail-card,
.player-card,
.side-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(15, 23, 42, 0.86);
  box-shadow: var(--shadow);
}

.rank-list {
  overflow: hidden;
}

.rank-row {
  display: grid;
  grid-template-columns: 58px 1fr 160px 70px;
  gap: 12px;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  transition: background 0.2s ease;
}

.rank-row:hover {
  background: rgba(34, 211, 238, 0.08);
}

.rank-number {
  color: var(--orange);
  font-weight: 900;
}

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

.rank-region {
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-score {
  color: var(--cyan);
  font-weight: 900;
  text-align: right;
}

.info-panel {
  padding: 24px;
}

.info-panel h3 {
  margin-top: 0;
}

.info-panel p {
  color: var(--muted);
  line-height: 1.75;
}

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

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

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

.player-card {
  overflow: hidden;
}

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

.player-shell video {
  width: 100%;
  height: 100%;
  display: block;
  background: #000;
}

.player-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: #fff;
  background: linear-gradient(180deg, rgba(2, 6, 23, 0.16), rgba(2, 6, 23, 0.72));
  transition: opacity 0.24s ease, visibility 0.24s ease;
}

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

.play-badge {
  width: 74px;
  height: 74px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #083344;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  border-radius: 50%;
  box-shadow: 0 18px 44px rgba(34, 211, 238, 0.32);
  font-size: 1.6rem;
}

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

.detail-card h1 {
  margin: 0 0 14px;
  font-size: clamp(1.8rem, 4vw, 3rem);
  letter-spacing: -0.03em;
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 20px;
  color: var(--muted);
}

.detail-meta span,
.info-list span {
  color: #e2e8f0;
  background: rgba(30, 41, 59, 0.86);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
}

.detail-card h2 {
  margin: 28px 0 12px;
  font-size: 1.28rem;
}

.detail-card p {
  color: #d1d5db;
  line-height: 1.85;
}

.side-card {
  padding: 20px;
  margin-bottom: 20px;
}

.side-card h2,
.side-card h3 {
  margin-top: 0;
}

.info-list {
  display: grid;
  gap: 10px;
  color: var(--muted);
}

.info-list div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

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

.related-item {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 12px;
  align-items: center;
}

.related-item img {
  width: 96px;
  height: 58px;
  border-radius: 12px;
  object-fit: cover;
}

.related-item strong {
  display: block;
  margin-bottom: 4px;
  line-height: 1.4;
}

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

.search-panel {
  padding: 24px;
  margin-bottom: 26px;
}

.search-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 190px 150px 120px;
  gap: 12px;
}

.search-status {
  margin: 12px 0 0;
  color: var(--muted);
}

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

.footer-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr 1.1fr;
  gap: 36px;
  padding: 44px 0;
}

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

.site-footer p {
  max-width: 420px;
  color: var(--muted);
  line-height: 1.7;
}

.footer-links {
  display: grid;
  gap: 10px;
}

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

.footer-links a {
  color: #cbd5e1;
}

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

.back-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 40;
  width: 48px;
  height: 48px;
  color: #062233;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  border-radius: 50%;
  font-weight: 900;
  box-shadow: 0 14px 34px rgba(34, 211, 238, 0.28);
}

.empty-state {
  border: 1px dashed rgba(148, 163, 184, 0.35);
  border-radius: var(--radius);
  padding: 36px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 980px) {
  .nav-wrap {
    flex-wrap: wrap;
    padding: 12px 0;
  }

  .menu-toggle {
    display: inline-flex;
  }

  .nav-links,
  .nav-search {
    display: none;
    width: 100%;
  }

  .nav-links.is-open,
  .nav-search.is-open {
    display: grid;
  }

  .nav-links {
    gap: 12px;
    order: 3;
  }

  .nav-search {
    grid-template-columns: 1fr auto;
    order: 4;
  }

  .nav-search input {
    width: 100%;
  }

  .movie-grid,
  .movie-grid.three,
  .category-grid,
  .rank-panel,
  .detail-layout,
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }

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

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

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

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

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

  .carousel-button {
    display: none;
  }

  .movie-grid,
  .movie-grid.three,
  .category-grid,
  .footer-grid,
  .search-grid {
    grid-template-columns: 1fr;
  }

  .rank-row {
    grid-template-columns: 44px 1fr 54px;
  }

  .rank-region {
    display: none;
  }

  .related-item {
    grid-template-columns: 82px 1fr;
  }

  .related-item img {
    width: 82px;
    height: 52px;
  }
}
