:root {
  --stellar-dark: #0a0e27;
  --stellar-deep: #141b3d;
  --stellar-mid: #1e2847;
  --stellar-light: #2a3857;
  --stellar-glow: #4a90e2;
  --primary: #0ea5e9;
  --text: #ffffff;
  --muted: #aeb8d4;
  --soft: #d7def7;
  --danger: #ef4444;
  --shadow-glow: 0 0 24px rgba(74, 144, 226, 0.32);
  --shadow-card: 0 18px 48px rgba(0, 0, 0, 0.34);
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 10px;
  --container: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--stellar-dark);
  color: var(--text);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.6;
}

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

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

button,
input,
select {
  font: inherit;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid rgba(74, 144, 226, 0.18);
  background: rgba(10, 14, 39, 0.92);
  backdrop-filter: blur(16px);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 72px;
}

.site-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.logo-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--stellar-glow), var(--primary));
  box-shadow: var(--shadow-glow);
}

.logo-text {
  font-size: 20px;
}

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

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

.nav-link:hover,
.nav-link.is-active {
  color: var(--text);
  background: rgba(74, 144, 226, 0.18);
}

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

.header-search input,
.mobile-search input,
.hero-search input,
.search-panel input,
.search-panel select {
  border: 1px solid rgba(74, 144, 226, 0.32);
  border-radius: 999px;
  background: rgba(20, 27, 61, 0.88);
  color: var(--text);
  outline: none;
  transition: border 0.2s ease, box-shadow 0.2s ease;
}

.header-search input {
  width: 220px;
  padding: 10px 14px;
}

.header-search input:focus,
.mobile-search input:focus,
.hero-search input:focus,
.search-panel input:focus,
.search-panel select:focus {
  border-color: var(--stellar-glow);
  box-shadow: var(--shadow-glow);
}

.header-search button,
.mobile-search button,
.hero-search button,
.search-panel button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  color: var(--text);
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.header-search button,
.mobile-search button,
.hero-search button,
.search-panel button {
  padding: 10px 16px;
  background: var(--stellar-glow);
}

.header-search button:hover,
.mobile-search button:hover,
.hero-search button:hover,
.search-panel button:hover,
.button-primary:hover {
  background: var(--primary);
  transform: translateY(-1px);
  box-shadow: var(--shadow-glow);
}

.mobile-menu-button {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(74, 144, 226, 0.24);
  border-radius: 12px;
  background: rgba(30, 40, 71, 0.7);
  cursor: pointer;
}

.mobile-menu-button span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 4px auto;
  background: var(--text);
}

.mobile-nav {
  display: none;
  padding: 0 16px 16px;
  border-top: 1px solid rgba(74, 144, 226, 0.18);
}

.hero-carousel {
  position: relative;
  height: 70vh;
  min-height: 560px;
  overflow: hidden;
  background: var(--stellar-dark);
}

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

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

.hero-bg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: radial-gradient(circle at 30% 20%, rgba(74, 144, 226, 0.35), transparent 42%), var(--stellar-mid);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to top, var(--stellar-dark) 0%, rgba(10, 14, 39, 0.64) 42%, rgba(10, 14, 39, 0.18) 100%),
    linear-gradient(to right, rgba(10, 14, 39, 0.88), rgba(10, 14, 39, 0.12));
}

.hero-content {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: flex-end;
  height: 100%;
  padding-bottom: 118px;
}

.hero-copy {
  width: min(720px, 100%);
}

.hero-tags,
.card-meta-top,
.detail-tags,
.meta-row,
.category-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.hero-tags span,
.card-meta-top span,
.detail-tags span,
.meta-row span,
.category-tags a,
.chip {
  border: 1px solid rgba(74, 144, 226, 0.34);
  border-radius: 999px;
  background: rgba(74, 144, 226, 0.18);
  color: var(--soft);
}

.hero-tags span,
.detail-tags span,
.meta-row span,
.category-tags a,
.chip {
  padding: 6px 12px;
}

.hero-copy h1 {
  margin: 18px 0 16px;
  font-size: clamp(40px, 7vw, 76px);
  line-height: 1.02;
  letter-spacing: -0.05em;
}

.hero-copy p {
  max-width: 640px;
  margin: 0 0 26px;
  color: var(--soft);
  font-size: clamp(16px, 2vw, 22px);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.button {
  min-height: 48px;
  padding: 12px 22px;
  font-weight: 700;
}

.button-primary {
  background: var(--stellar-glow);
}

.button-ghost {
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.08);
}

.button-ghost:hover {
  background: rgba(255, 255, 255, 0.16);
  transform: translateY(-1px);
}

.hero-control {
  position: absolute;
  top: 50%;
  z-index: 6;
  display: grid;
  width: 50px;
  height: 50px;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.5);
  color: var(--text);
  cursor: pointer;
  font-size: 32px;
  transform: translateY(-50%);
  transition: background 0.2s ease;
}

.hero-control:hover {
  background: rgba(0, 0, 0, 0.75);
}

.hero-control-prev {
  left: 24px;
}

.hero-control-next {
  right: 24px;
}

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

.hero-dot {
  width: 9px;
  height: 9px;
  border: 0;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.55);
  cursor: pointer;
  transition: width 0.25s ease, background 0.25s ease;
}

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

.hero-search {
  position: absolute;
  z-index: 7;
  right: max(16px, calc((100vw - var(--container)) / 2));
  bottom: 86px;
  display: flex;
  gap: 10px;
  width: min(460px, calc(100% - 32px));
  padding: 10px;
  border: 1px solid rgba(74, 144, 226, 0.25);
  border-radius: 999px;
  background: rgba(10, 14, 39, 0.72);
  backdrop-filter: blur(12px);
}

.hero-search input {
  flex: 1;
  min-width: 0;
  padding: 12px 16px;
}

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

.section-deep {
  background: var(--stellar-deep);
}

.section-gradient-down {
  background: linear-gradient(to bottom, var(--stellar-dark), var(--stellar-deep));
}

.section-gradient-up {
  background: linear-gradient(to bottom, var(--stellar-deep), var(--stellar-dark));
}

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

.eyebrow {
  display: inline-block;
  margin-bottom: 8px;
  color: var(--stellar-glow);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.section-heading h2,
.page-title h1 {
  margin: 0;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.15;
}

.section-heading p,
.page-title p,
.empty-state,
.footer-grid p {
  margin: 10px 0 0;
  color: var(--muted);
}

.section-more {
  flex: 0 0 auto;
  color: var(--stellar-glow);
  font-weight: 700;
}

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

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

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

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

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

.poster-frame {
  position: relative;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  border: 1px solid rgba(74, 144, 226, 0.18);
  border-radius: var(--radius-md);
  background:
    radial-gradient(circle at 20% 10%, rgba(74, 144, 226, 0.25), transparent 36%),
    linear-gradient(135deg, var(--stellar-mid), var(--stellar-deep));
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.22);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border 0.3s ease;
}

.movie-card--large .poster-frame,
.movie-card--wide .poster-frame {
  aspect-ratio: 16 / 9;
}

.movie-card:hover .poster-frame {
  border-color: rgba(74, 144, 226, 0.58);
  box-shadow: var(--shadow-glow);
  transform: translateY(-4px);
}

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

.poster-frame img.is-missing {
  opacity: 0;
}

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

.poster-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0.26), transparent);
}

.play-chip {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border-radius: 999px;
  background: rgba(74, 144, 226, 0.92);
  box-shadow: var(--shadow-glow);
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.9);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

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

.card-meta-top {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  justify-content: space-between;
}

.card-meta-top span {
  padding: 4px 9px;
  background: rgba(0, 0, 0, 0.58);
  color: var(--text);
  font-size: 12px;
}

.rank-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(74, 144, 226, 0.9);
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
}

.card-copy {
  position: absolute;
  right: 14px;
  bottom: 14px;
  left: 14px;
}

.card-copy h3 {
  display: -webkit-box;
  margin: 0 0 6px;
  overflow: hidden;
  color: var(--text);
  font-size: 17px;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  transition: color 0.2s ease;
}

.movie-card:hover h3 {
  color: var(--stellar-glow);
}

.card-copy p {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
}

.horizontal-rail {
  overflow-x: auto;
  padding-bottom: 12px;
  scrollbar-color: var(--stellar-glow) var(--stellar-mid);
  scrollbar-width: thin;
}

.rail-track {
  display: flex;
  gap: 18px;
  width: max-content;
}

.rail-track .movie-card {
  width: 204px;
}

.category-block {
  margin-top: 44px;
}

.category-block h3 {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 18px;
  font-size: 24px;
}

.category-block h3::before {
  content: "";
  width: 4px;
  height: 26px;
  border-radius: 4px;
  background: var(--stellar-glow);
}

.page-hero {
  padding: 76px 0 34px;
  background:
    radial-gradient(circle at 16% 20%, rgba(74, 144, 226, 0.22), transparent 32%),
    linear-gradient(to bottom, var(--stellar-deep), var(--stellar-dark));
}

.page-title {
  max-width: 820px;
}

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

.breadcrumb a {
  color: var(--stellar-glow);
}

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

.stat-card,
.category-card,
.info-card,
.search-panel,
.detail-card,
.player-shell,
.recommend-panel {
  border: 1px solid rgba(74, 144, 226, 0.18);
  border-radius: var(--radius-md);
  background: rgba(20, 27, 61, 0.74);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.24);
}

.stat-card,
.category-card,
.info-card,
.search-panel,
.recommend-panel {
  padding: 22px;
}

.stat-card strong {
  display: block;
  font-size: 34px;
  line-height: 1;
}

.stat-card span,
.category-card p,
.info-card p {
  color: var(--muted);
}

.category-card {
  display: flex;
  min-height: 150px;
  flex-direction: column;
  justify-content: space-between;
  transition: border 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.category-card:hover {
  border-color: rgba(74, 144, 226, 0.62);
  box-shadow: var(--shadow-glow);
  transform: translateY(-3px);
}

.category-card h3,
.info-card h3,
.recommend-panel h3 {
  margin: 0 0 10px;
}

.category-count {
  color: var(--stellar-glow);
  font-weight: 800;
}

.search-panel {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr auto;
  gap: 12px;
  margin: 26px 0 34px;
}

.search-panel input,
.search-panel select {
  min-width: 0;
  padding: 13px 16px;
  border-radius: var(--radius-sm);
}

.search-status {
  margin-bottom: 20px;
  color: var(--muted);
}

.detail-hero {
  padding: 52px 0;
  background:
    radial-gradient(circle at 70% 12%, rgba(74, 144, 226, 0.25), transparent 34%),
    linear-gradient(to bottom, var(--stellar-deep), var(--stellar-dark));
}

.detail-layout {
  display: grid;
  grid-template-columns: 310px 1fr;
  gap: 34px;
  align-items: start;
}

.detail-poster {
  overflow: hidden;
  border: 1px solid rgba(74, 144, 226, 0.22);
  border-radius: var(--radius-lg);
  background: var(--stellar-mid);
  box-shadow: var(--shadow-card);
}

.detail-poster img {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
}

.detail-copy h1 {
  margin: 12px 0 18px;
  font-size: clamp(34px, 5vw, 60px);
  line-height: 1.08;
}

.detail-one-line {
  margin: 0 0 22px;
  color: var(--soft);
  font-size: 20px;
}

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

.detail-main {
  display: grid;
  grid-template-columns: minmax(0, 2fr) 340px;
  gap: 26px;
  padding: 54px 0;
}

.player-shell {
  position: relative;
  overflow: hidden;
  background: #000;
}

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

.player-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border: 0;
  background:
    radial-gradient(circle at center, rgba(74, 144, 226, 0.18), transparent 42%),
    rgba(0, 0, 0, 0.35);
  color: var(--text);
  cursor: pointer;
}

.player-overlay span {
  display: grid;
  width: 88px;
  height: 88px;
  place-items: center;
  border-radius: 999px;
  background: rgba(74, 144, 226, 0.92);
  box-shadow: var(--shadow-glow);
  font-size: 34px;
}

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

.player-status {
  padding: 12px 16px;
  color: var(--muted);
  background: rgba(10, 14, 39, 0.86);
  font-size: 14px;
}

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

.detail-card h2 {
  margin: 0 0 14px;
}

.detail-card p {
  margin: 0;
  color: var(--soft);
}

.detail-sidebar {
  display: grid;
  gap: 18px;
}

.info-list {
  display: grid;
  gap: 11px;
  margin: 0;
}

.info-list div {
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: 12px;
  color: var(--soft);
}

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

.info-list dd {
  margin: 0;
}

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

.ranking-list {
  display: grid;
  gap: 16px;
}

.ranking-item {
  display: grid;
  grid-template-columns: 72px 110px 1fr auto;
  gap: 18px;
  align-items: center;
  padding: 14px;
  border: 1px solid rgba(74, 144, 226, 0.18);
  border-radius: var(--radius-md);
  background: rgba(20, 27, 61, 0.72);
  transition: border 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.ranking-item:hover {
  border-color: rgba(74, 144, 226, 0.56);
  box-shadow: var(--shadow-glow);
  transform: translateY(-2px);
}

.ranking-number {
  color: var(--stellar-glow);
  font-size: 30px;
  font-weight: 900;
  text-align: center;
}

.ranking-cover {
  overflow: hidden;
  border-radius: 12px;
  background: var(--stellar-mid);
}

.ranking-cover img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.ranking-copy h2 {
  margin: 0 0 6px;
  font-size: 20px;
}

.ranking-copy p {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.ranking-heat {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(74, 144, 226, 0.18);
  color: var(--stellar-glow);
  font-weight: 800;
  white-space: nowrap;
}

.pagination-note {
  margin-top: 28px;
  color: var(--muted);
  text-align: center;
}

.site-footer {
  border-top: 1px solid rgba(74, 144, 226, 0.18);
  background: var(--stellar-deep);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 36px;
  padding: 46px 0 34px;
}

.footer-logo {
  margin-bottom: 12px;
}

.footer-grid h3 {
  margin: 0 0 12px;
}

.footer-grid a {
  display: block;
  margin: 8px 0;
  color: var(--muted);
}

.footer-grid a:hover {
  color: var(--stellar-glow);
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  padding: 18px 0 28px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--muted);
  font-size: 13px;
}

.back-to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 80;
  display: none;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 999px;
  background: var(--stellar-glow);
  color: var(--text);
  box-shadow: var(--shadow-glow);
  cursor: pointer;
}

.back-to-top.is-visible {
  display: block;
}

@media (max-width: 1100px) {
  .desktop-nav,
  .header-search {
    display: none;
  }

  .mobile-menu-button {
    display: block;
    margin-left: auto;
  }

  .mobile-nav.is-open {
    display: grid;
    gap: 10px;
  }

  .mobile-nav .nav-link {
    display: block;
  }

  .mobile-search input {
    flex: 1;
    padding: 12px 14px;
  }

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

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

@media (max-width: 820px) {
  .hero-carousel {
    height: 76vh;
    min-height: 620px;
  }

  .hero-content {
    align-items: center;
    padding-bottom: 120px;
  }

  .hero-search {
    right: 16px;
    bottom: 72px;
    left: 16px;
    width: auto;
  }

  .hero-control {
    display: none;
  }

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

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

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

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

  .detail-poster {
    width: min(320px, 100%);
  }

  .ranking-item {
    grid-template-columns: 54px 92px 1fr;
  }

  .ranking-heat {
    grid-column: 3;
    width: max-content;
  }

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

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

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

  .hero-search input,
  .hero-search button {
    width: 100%;
  }

  .movie-grid,
  .movie-grid--large,
  .movie-grid--wide,
  .stats-grid,
  .category-grid,
  .related-grid {
    gap: 14px;
  }

  .card-copy h3 {
    font-size: 15px;
  }

  .rail-track .movie-card {
    width: 164px;
  }

  .detail-card,
  .info-card,
  .search-panel,
  .recommend-panel {
    padding: 18px;
  }
}
