:root {
  color-scheme: dark;
  --bg: #020617;
  --panel: #0f172a;
  --panel-soft: #111827;
  --card: #1e293b;
  --line: rgba(148, 163, 184, 0.18);
  --text: #f8fafc;
  --muted: #94a3b8;
  --blue: #2563eb;
  --blue-strong: #1d4ed8;
  --cyan: #38bdf8;
  --yellow: #fbbf24;
  --green: #22c55e;
  --red: #fb7185;
  --shadow: 0 24px 70px rgba(2, 6, 23, 0.55);
  --radius: 22px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: radial-gradient(circle at top left, rgba(37, 99, 235, 0.18), transparent 34rem), var(--bg);
  color: var(--text);
  min-height: 100vh;
}

body.menu-open {
  overflow: hidden;
}

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

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

button,
input,
select {
  font: inherit;
}

.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 {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.logo,
.footer-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 800;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.logo-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  box-shadow: 0 14px 38px rgba(37, 99, 235, 0.35);
}

.main-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
}

.main-nav a {
  color: #cbd5e1;
  padding: 10px 12px;
  border-radius: 999px;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
  font-size: 14px;
}

.main-nav a:hover,
.main-nav a.is-active {
  background: rgba(37, 99, 235, 0.16);
  color: #ffffff;
  transform: translateY(-1px);
}

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

.mobile-toggle span {
  display: block;
  height: 2px;
  margin: 5px 0;
  background: #e2e8f0;
  border-radius: 3px;
}

.hero {
  width: min(1280px, calc(100% - 32px));
  min-height: 70vh;
  margin: 28px auto 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 24px;
}

.hero-stage {
  position: relative;
  min-height: 70vh;
  overflow: hidden;
  border-radius: 32px;
  background: #0f172a;
  box-shadow: var(--shadow);
}

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

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

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

.hero-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(2, 6, 23, 0.92) 0%, rgba(2, 6, 23, 0.58) 48%, rgba(2, 6, 23, 0.12) 100%), linear-gradient(0deg, rgba(2, 6, 23, 0.95), transparent 52%);
}

.hero-content {
  position: absolute;
  inset: auto auto 0 0;
  width: min(700px, 88%);
  padding: clamp(28px, 5vw, 72px);
}

.hero-label,
.section-kicker {
  display: inline-flex;
  width: max-content;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: 999px;
  color: #dbeafe;
  background: rgba(37, 99, 235, 0.22);
  border: 1px solid rgba(96, 165, 250, 0.28);
  font-size: 13px;
  font-weight: 700;
}

.hero h1,
.page-hero h1,
.detail-copy h1 {
  margin: 18px 0 16px;
  font-size: clamp(38px, 6vw, 76px);
  line-height: 0.95;
  letter-spacing: -0.06em;
}

.hero p,
.page-hero p,
.detail-copy .lead {
  color: #cbd5e1;
  font-size: clamp(16px, 2vw, 20px);
  line-height: 1.8;
  margin: 0 0 22px;
}

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

.hero-tags span,
.tag-row span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 10px;
  border-radius: 999px;
  color: #dbeafe;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.22);
  font-size: 12px;
}

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

.primary-btn,
.ghost-btn,
.section-link,
.filter-bar button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 14px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.primary-btn {
  background: var(--blue);
  color: #fff;
  font-weight: 800;
  box-shadow: 0 14px 36px rgba(37, 99, 235, 0.35);
}

.primary-btn:hover,
.filter-bar button:hover {
  background: var(--blue-strong);
  transform: translateY(-2px);
}

.ghost-btn,
.section-link {
  color: #e2e8f0;
  background: rgba(15, 23, 42, 0.72);
  border-color: rgba(148, 163, 184, 0.22);
}

.ghost-btn:hover,
.section-link:hover {
  transform: translateY(-2px);
  border-color: rgba(96, 165, 250, 0.48);
}

.hero-control {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 46px;
  height: 46px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(2, 6, 23, 0.56);
  color: #fff;
  cursor: pointer;
  font-size: 38px;
  line-height: 0;
}

.hero-prev {
  left: 18px;
}

.hero-next {
  right: 18px;
}

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

.hero-dot {
  width: 10px;
  height: 10px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.45);
  cursor: pointer;
  transition: width 0.2s ease, background 0.2s ease;
}

.hero-dot.is-active {
  width: 32px;
  background: var(--blue);
}

.hero-panel,
.search-card,
.ranking-box,
.category-card,
.movie-card,
.player-box {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.96), rgba(15, 23, 42, 0.72));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero-panel {
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
}

.hero-panel h2 {
  margin: 0;
  font-size: 28px;
}

.hero-panel p {
  margin: 0;
  color: var(--muted);
  line-height: 1.8;
}

.hero-ranks,
.ranking-box {
  display: grid;
  gap: 10px;
}

.rank-row {
  display: grid;
  grid-template-columns: 28px 48px 1fr;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 16px;
  background: rgba(30, 41, 59, 0.62);
  transition: background 0.2s ease, transform 0.2s ease;
}

.rank-row:hover {
  transform: translateX(3px);
  background: rgba(37, 99, 235, 0.18);
}

.rank-row span {
  color: var(--yellow);
  font-weight: 900;
}

.rank-row img {
  width: 48px;
  height: 64px;
  object-fit: cover;
  border-radius: 10px;
}

.rank-row strong {
  display: block;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-row em {
  grid-column: 3;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  margin-top: -18px;
}

.search-shell,
.content-section,
.page-hero,
.detail-hero,
.player-section {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
}

.search-shell {
  padding: 32px 0 8px;
}

.search-card {
  padding: 24px;
}

.search-card h2,
.section-head h2,
.detail-text h2 {
  margin: 8px 0 8px;
  font-size: clamp(26px, 4vw, 40px);
  letter-spacing: -0.04em;
}

.search-card p {
  margin: 0 0 20px;
  color: var(--muted);
}

.filter-bar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 200px 104px;
  gap: 12px;
  margin: 20px 0 28px;
}

.filter-bar input,
.filter-bar select {
  min-height: 46px;
  color: #e2e8f0;
  background: rgba(2, 6, 23, 0.54);
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 14px;
  outline: 0;
  padding: 0 14px;
}

.filter-bar input:focus,
.filter-bar select:focus {
  border-color: rgba(96, 165, 250, 0.7);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.16);
}

.filter-bar button {
  background: var(--blue);
  color: #fff;
}

.content-section {
  padding: 58px 0;
}

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

.section-head h2 {
  margin-bottom: 0;
}

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

.movie-card {
  overflow: hidden;
  transition: transform 0.24s ease, border-color 0.24s ease, box-shadow 0.24s ease;
}

.movie-card:hover {
  transform: translateY(-6px);
  border-color: rgba(96, 165, 250, 0.46);
  box-shadow: 0 28px 74px rgba(2, 6, 23, 0.72);
}

.poster-link {
  position: relative;
  display: block;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: #0f172a;
}

.poster-link img {
  height: 100%;
  object-fit: cover;
  transform: scale(1.002);
  transition: transform 0.35s ease, filter 0.35s ease;
}

.movie-card:hover .poster-link img {
  transform: scale(1.065);
  filter: brightness(0.8);
}

.play-chip,
.rank-badge {
  position: absolute;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  border-radius: 999px;
}

.play-chip {
  left: 14px;
  bottom: 14px;
  height: 34px;
  padding: 0 13px;
  background: rgba(37, 99, 235, 0.86);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.movie-card:hover .play-chip {
  opacity: 1;
  transform: translateY(0);
}

.rank-badge {
  top: 12px;
  left: 12px;
  min-width: 34px;
  height: 34px;
  background: linear-gradient(135deg, #f97316, #ef4444);
}

.movie-info {
  padding: 16px;
}

.meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #93c5fd;
  font-size: 13px;
  margin-bottom: 8px;
}

.movie-info h3 {
  margin: 0 0 8px;
  font-size: 18px;
  line-height: 1.35;
}

.movie-info h3 a:hover {
  color: #93c5fd;
}

.movie-info p {
  min-height: 44px;
  color: var(--muted);
  margin: 0 0 12px;
  font-size: 14px;
  line-height: 1.6;
}

.tag-row {
  gap: 6px;
}

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

.ranking-box {
  padding: 16px;
  position: sticky;
  top: 92px;
}

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

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

.category-card {
  display: block;
  min-height: 160px;
  padding: 24px;
  overflow: hidden;
  position: relative;
  transition: transform 0.22s ease, border-color 0.22s ease;
}

.category-card::after {
  content: "";
  position: absolute;
  width: 160px;
  height: 160px;
  right: -54px;
  bottom: -60px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.36), transparent 70%);
}

.category-card:hover {
  transform: translateY(-5px);
  border-color: rgba(96, 165, 250, 0.52);
}

.category-card span {
  position: relative;
  z-index: 1;
  display: block;
  font-size: 22px;
  font-weight: 900;
  margin-bottom: 12px;
}

.category-card p {
  position: relative;
  z-index: 1;
  color: var(--muted);
  line-height: 1.7;
  margin: 0;
}

.category-card em {
  position: relative;
  z-index: 1;
  display: inline-flex;
  margin-top: 18px;
  color: #93c5fd;
  font-style: normal;
  font-weight: 700;
}

.page-hero,
.detail-hero {
  margin-top: 28px;
  border-radius: 32px;
  padding: clamp(28px, 6vw, 68px);
  background: radial-gradient(circle at 18% 12%, rgba(37, 99, 235, 0.32), transparent 36rem), linear-gradient(135deg, rgba(15, 23, 42, 0.96), rgba(2, 6, 23, 0.78));
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.compact-hero h1 {
  font-size: clamp(34px, 5vw, 58px);
}

.detail-layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: clamp(24px, 5vw, 56px);
  align-items: center;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 24px;
}

.breadcrumb a:hover {
  color: #93c5fd;
}

.detail-poster img {
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 26px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: var(--shadow);
}

.detail-copy h1 {
  margin-top: 20px;
}

.detail-tags {
  margin-top: 12px;
}

.player-section {
  padding-top: 34px;
}

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

.player-box video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

.player-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 16px;
  border: 0;
  color: #fff;
  background: linear-gradient(180deg, rgba(2, 6, 23, 0.18), rgba(2, 6, 23, 0.72));
  cursor: pointer;
  text-align: center;
}

.player-overlay[hidden] {
  display: none;
}

.player-icon {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  margin: 0 auto;
  border-radius: 999px;
  background: var(--blue);
  box-shadow: 0 18px 42px rgba(37, 99, 235, 0.45);
}

.player-overlay strong {
  font-size: 24px;
}

.narrow-section {
  width: min(900px, calc(100% - 32px));
}

.detail-text p {
  color: #cbd5e1;
  font-size: 17px;
  line-height: 2;
}

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

.compact-card .movie-info p {
  display: none;
}

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

.footer-inner {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  padding: 36px 0 24px;
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 24px;
}

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

.footer-links {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px 18px;
}

.footer-links a {
  color: #cbd5e1;
  font-size: 14px;
}

.footer-links a:hover {
  color: #93c5fd;
}

.copyright {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0 28px;
  color: #64748b;
  border-top: 1px solid var(--line);
  font-size: 13px;
}

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

@media (max-width: 1120px) {
  .hero,
  .split-layout,
  .footer-inner {
    grid-template-columns: 1fr;
  }

  .hero-panel,
  .ranking-box {
    position: static;
  }

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

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

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

  .footer-links {
    justify-content: flex-start;
  }
}

@media (max-width: 760px) {
  .nav-wrap {
    min-height: 64px;
  }

  .mobile-toggle {
    display: block;
  }

  .main-nav {
    position: fixed;
    left: 16px;
    right: 16px;
    top: 76px;
    display: none;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: rgba(2, 6, 23, 0.96);
    box-shadow: var(--shadow);
  }

  body.menu-open .main-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: stretch;
  }

  .main-nav a {
    text-align: center;
  }

  .hero {
    width: min(100% - 20px, 1280px);
    min-height: auto;
    margin-top: 10px;
  }

  .hero-stage {
    min-height: 620px;
    border-radius: 24px;
  }

  .hero-content {
    width: 100%;
    padding: 28px;
  }

  .hero-control {
    top: auto;
    bottom: 22px;
  }

  .hero-dots {
    display: none;
  }

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

  .content-section {
    padding: 38px 0;
  }

  .section-head {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .movie-info {
    padding: 12px;
  }

  .movie-info h3 {
    font-size: 15px;
  }

  .movie-info p,
  .tag-row {
    display: none;
  }

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

  .detail-poster {
    max-width: 260px;
  }

  .player-overlay strong {
    font-size: 18px;
  }

  .rank-row {
    grid-template-columns: 24px 42px 1fr;
  }
}

@media (max-width: 460px) {
  .movie-grid,
  .category-grid,
  .category-grid.large,
  .related-grid {
    grid-template-columns: 1fr;
  }

  .hero-stage {
    min-height: 560px;
  }
}
