:root {
  --bg: #0f172a;
  --bg-soft: #111827;
  --panel: rgba(15, 23, 42, 0.82);
  --panel-strong: rgba(30, 41, 59, 0.96);
  --line: rgba(148, 163, 184, 0.18);
  --text: #f8fafc;
  --muted: #94a3b8;
  --muted-strong: #cbd5e1;
  --cyan: #22d3ee;
  --blue: #2563eb;
  --shadow: 0 24px 80px rgba(8, 13, 28, 0.45);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 15% 8%, rgba(34, 211, 238, 0.16), transparent 32rem),
    radial-gradient(circle at 85% 0%, rgba(37, 99, 235, 0.18), transparent 30rem),
    linear-gradient(180deg, #0f172a 0%, #111827 46%, #0f172a 100%);
  min-height: 100vh;
}

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

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

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

.header-inner {
  display: flex;
  align-items: center;
  gap: 28px;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  min-height: 76px;
}

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

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

.brand-name {
  font-size: 20px;
  white-space: nowrap;
}

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

.nav-links a {
  color: var(--muted-strong);
  font-size: 15px;
  transition: color 0.2s ease;
}

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

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

.header-search input,
.search-panel input,
.filter-select {
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.92);
  color: var(--text);
  outline: none;
  padding: 0 14px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

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

.header-search button,
.primary-button,
.secondary-button,
.play-overlay button,
.search-panel button,
.filter-button {
  border: 0;
  cursor: pointer;
  border-radius: 999px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  box-shadow: 0 14px 34px rgba(37, 99, 235, 0.24);
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.header-search button {
  height: 42px;
  padding: 0 18px;
  font-weight: 700;
}

.header-search button:hover,
.primary-button:hover,
.play-overlay button:hover,
.search-panel button:hover,
.filter-button:hover,
.filter-button.active {
  transform: translateY(-1px);
  filter: brightness(1.08);
  box-shadow: 0 18px 42px rgba(34, 211, 238, 0.32);
}

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.9);
}

.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 4px auto;
  background: #e2e8f0;
}

.main-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 44px 0 72px;
}

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

.hero-slide {
  display: none;
  min-height: 70vh;
  align-items: center;
  background-size: cover;
  background-position: center;
}

.hero-slide.active {
  display: flex;
}

.hero-slide::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.28), rgba(15, 23, 42, 0.96)),
    linear-gradient(90deg, rgba(15, 23, 42, 0.84), rgba(15, 23, 42, 0.22));
}

.hero-content {
  position: relative;
  z-index: 2;
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 96px 0 84px;
}

.hero-kicker,
.section-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  color: var(--cyan);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero h1 {
  width: min(760px, 100%);
  margin: 0 0 20px;
  font-size: clamp(42px, 7vw, 78px);
  line-height: 0.98;
  letter-spacing: -0.06em;
}

.hero p {
  width: min(720px, 100%);
  margin: 0 0 30px;
  color: var(--muted-strong);
  font-size: clamp(18px, 2vw, 24px);
  line-height: 1.75;
}

.hero-actions,
.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
}

.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0 24px;
  font-weight: 800;
}

.secondary-button {
  border: 1px solid rgba(226, 232, 240, 0.22);
  color: #e2e8f0;
  background: rgba(15, 23, 42, 0.72);
  box-shadow: none;
}

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

.hero-dots button {
  width: 32px;
  height: 4px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(226, 232, 240, 0.36);
  cursor: pointer;
}

.hero-dots button.active {
  background: var(--cyan);
}

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

.section-head h1,
.section-head h2,
.page-title h1 {
  margin: 0;
  font-size: clamp(28px, 4vw, 44px);
  letter-spacing: -0.04em;
}

.section-head p,
.page-title p,
.category-intro,
.detail-lead {
  color: var(--muted-strong);
  line-height: 1.8;
}

.section-link {
  color: var(--cyan);
  font-weight: 800;
  white-space: nowrap;
}

.featured-rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(260px, 330px);
  gap: 22px;
  overflow-x: auto;
  padding: 4px 4px 22px;
  scroll-snap-type: x mandatory;
}

.featured-rail .movie-card {
  scroll-snap-align: start;
}

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

.movie-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(30, 41, 59, 0.66);
  box-shadow: 0 20px 52px rgba(0, 0, 0, 0.24);
  transition: transform 0.24s ease, border-color 0.24s ease, box-shadow 0.24s ease;
}

.movie-card:hover {
  transform: translateY(-6px);
  border-color: rgba(34, 211, 238, 0.42);
  box-shadow: 0 28px 70px rgba(34, 211, 238, 0.16);
}

.poster-link {
  position: relative;
  display: block;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.22), rgba(37, 99, 235, 0.18));
  aspect-ratio: 16 / 10;
}

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

.movie-card:hover img {
  transform: scale(1.06);
  opacity: 0.86;
}

.poster-badge,
.poster-play {
  position: absolute;
  z-index: 2;
  border-radius: 999px;
  color: #ffffff;
  font-size: 13px;
  font-weight: 800;
}

.poster-badge {
  top: 12px;
  left: 12px;
  padding: 6px 10px;
  background: rgba(15, 23, 42, 0.78);
  backdrop-filter: blur(8px);
}

.poster-play {
  right: 12px;
  bottom: 12px;
  padding: 8px 13px;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
}

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

.movie-meta-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--cyan);
  font-size: 13px;
  font-weight: 700;
}

.movie-card h2 {
  margin: 8px 0 9px;
  font-size: 19px;
  line-height: 1.3;
}

.movie-card p {
  display: -webkit-box;
  min-height: 44px;
  margin: 0 0 14px;
  overflow: hidden;
  color: var(--muted);
  line-height: 1.55;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

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

.tag-row span,
.info-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid rgba(34, 211, 238, 0.24);
  border-radius: 999px;
  color: #a5f3fc;
  background: rgba(34, 211, 238, 0.08);
  font-size: 12px;
}

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

.category-card {
  display: flex;
  min-height: 172px;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: 24px;
  background:
    radial-gradient(circle at top right, rgba(34, 211, 238, 0.16), transparent 44%),
    rgba(30, 41, 59, 0.74);
  box-shadow: var(--shadow);
  transition: transform 0.24s ease, border-color 0.24s ease;
}

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

.category-card h2 {
  margin: 0 0 12px;
  font-size: 24px;
}

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

.rank-layout {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 24px;
}

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

.rank-row {
  display: grid;
  grid-template-columns: 52px 96px 1fr;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 12px;
  background: rgba(30, 41, 59, 0.65);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.rank-row:hover {
  transform: translateX(5px);
  border-color: rgba(34, 211, 238, 0.42);
}

.rank-number {
  color: var(--cyan);
  font-size: 26px;
  font-weight: 900;
}

.rank-row img {
  width: 96px;
  height: 62px;
  object-fit: cover;
  border-radius: 12px;
}

.rank-info strong,
.rank-info em {
  display: block;
}

.rank-info strong {
  margin-bottom: 5px;
  font-size: 17px;
}

.rank-info em {
  color: var(--muted);
  font-style: normal;
  line-height: 1.5;
}

.page-title {
  margin-bottom: 30px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: 34px;
  background:
    radial-gradient(circle at top left, rgba(34, 211, 238, 0.16), transparent 40%),
    rgba(30, 41, 59, 0.72);
  box-shadow: var(--shadow);
}

.search-panel,
.filter-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-bottom: 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px;
  background: rgba(30, 41, 59, 0.64);
}

.search-panel input {
  flex: 1 1 280px;
}

.search-panel button,
.filter-button {
  min-height: 42px;
  padding: 0 18px;
  font-weight: 800;
}

.filter-button {
  border: 1px solid var(--line);
  color: var(--muted-strong);
  background: rgba(15, 23, 42, 0.76);
  box-shadow: none;
}

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

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

.player-card,
.detail-card,
.side-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: rgba(30, 41, 59, 0.72);
  box-shadow: var(--shadow);
}

.player-card {
  overflow: hidden;
}

.video-frame {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: #020617;
}

.video-frame video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.play-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: radial-gradient(circle, rgba(15, 23, 42, 0.24), rgba(15, 23, 42, 0.72));
  transition: opacity 0.24s ease, visibility 0.24s ease;
}

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

.play-overlay button {
  width: 88px;
  height: 88px;
  font-size: 17px;
  font-weight: 900;
}

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

.detail-card h1 {
  margin: 0 0 16px;
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1.08;
  letter-spacing: -0.04em;
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 20px;
}

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

.detail-section h2,
.side-card h2 {
  margin: 0 0 14px;
  font-size: 24px;
}

.detail-section p,
.detail-lead {
  margin: 0;
  color: var(--muted-strong);
  line-height: 1.9;
}

.side-card {
  position: sticky;
  top: 100px;
  padding: 20px;
}

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

.related-link {
  display: grid;
  grid-template-columns: 104px 1fr;
  gap: 12px;
  align-items: center;
  border-radius: 14px;
  padding: 8px;
  transition: background 0.2s ease;
}

.related-link:hover {
  background: rgba(15, 23, 42, 0.58);
}

.related-link img {
  width: 104px;
  height: 68px;
  object-fit: cover;
  border-radius: 12px;
}

.related-link strong,
.related-link span {
  display: block;
}

.related-link strong {
  margin-bottom: 5px;
}

.related-link span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

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

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 28px;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 42px 0;
}

.footer-grid h2 {
  margin: 0 0 14px;
  font-size: 18px;
}

.footer-grid p,
.copyright {
  color: var(--muted);
  line-height: 1.7;
}

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

.footer-links a {
  color: var(--muted-strong);
  transition: color 0.2s ease;
}

.copyright {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0 28px;
  border-top: 1px solid var(--line);
  font-size: 14px;
}

@media (max-width: 980px) {
  .header-inner {
    flex-wrap: wrap;
    gap: 14px;
    padding: 12px 0;
  }

  .nav-toggle {
    display: block;
    margin-left: auto;
  }

  .nav-links {
    display: none;
    width: 100%;
    order: 3;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 10px;
    background: rgba(15, 23, 42, 0.96);
  }

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

  .nav-links a {
    padding: 12px;
  }

  .header-search {
    width: 100%;
    order: 4;
  }

  .header-search input {
    flex: 1;
  }

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

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

  .side-card {
    position: static;
  }
}

@media (max-width: 640px) {
  .main-shell {
    width: min(100% - 24px, 1180px);
    padding-top: 28px;
  }

  .hero,
  .hero-slide {
    min-height: 640px;
  }

  .hero-content {
    padding: 84px 0 86px;
  }

  .section-head {
    display: block;
  }

  .section-link {
    display: inline-block;
    margin-top: 12px;
  }

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

  .rank-row {
    grid-template-columns: 44px 82px 1fr;
    gap: 10px;
  }

  .rank-row img {
    width: 82px;
    height: 56px;
  }

  .related-link {
    grid-template-columns: 86px 1fr;
  }

  .related-link img {
    width: 86px;
    height: 60px;
  }
}
