:root {
  --stellar-dark: #0a0e27;
  --stellar-deep: #141b3d;
  --stellar-mid: #1e2847;
  --stellar-light: #2a3857;
  --stellar-glow: #4a90e2;
  --stellar-sky: #38bdf8;
  --text-main: #ffffff;
  --text-soft: #d1d5db;
  --text-muted: #9ca3af;
  --line: rgba(42, 56, 87, 0.45);
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.32);
  --glow: 0 0 28px rgba(74, 144, 226, 0.34);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--stellar-dark);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text-main);
  background:
    radial-gradient(circle at 18% 8%, rgba(74, 144, 226, 0.22), transparent 32rem),
    radial-gradient(circle at 90% 10%, rgba(56, 189, 248, 0.12), transparent 34rem),
    linear-gradient(180deg, var(--stellar-dark) 0%, var(--stellar-deep) 38%, var(--stellar-dark) 100%);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

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

button, input, select {
  font: inherit;
}

button {
  border: 0;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid rgba(42, 56, 87, 0.36);
  background: rgba(10, 14, 39, 0.94);
  backdrop-filter: blur(16px);
}

.header-inner {
  max-width: 1280px;
  height: 4rem;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

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

.brand-mark {
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, var(--stellar-glow), var(--stellar-sky));
  box-shadow: var(--glow);
  font-size: 0.82rem;
}

.brand-text {
  font-size: 1.2rem;
  white-space: nowrap;
}

.desktop-nav {
  display: flex;
  align-items: center;
  gap: 1.3rem;
  margin-left: 1rem;
}

.nav-link {
  color: var(--text-soft);
  font-size: 0.94rem;
  transition: color 0.2s ease;
}

.nav-link:hover, .nav-link.is-active {
  color: var(--stellar-sky);
}

.header-search {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.header-search input, .mobile-search input, .filter-panel input, .filter-panel select {
  border: 1px solid rgba(42, 56, 87, 0.7);
  outline: none;
  color: var(--text-main);
  background: rgba(30, 40, 71, 0.9);
  border-radius: 0.75rem;
  padding: 0.72rem 0.9rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.header-search input {
  width: min(22vw, 18rem);
}

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

.header-search button, .mobile-search button, .primary-button, .ghost-button, .hero-control, .player-button {
  cursor: pointer;
  color: #fff;
  border-radius: 0.8rem;
  background: linear-gradient(135deg, var(--stellar-glow), var(--stellar-sky));
  box-shadow: var(--glow);
  padding: 0.72rem 1rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.header-search button:hover, .mobile-search button:hover, .primary-button:hover, .hero-control:hover, .player-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 36px rgba(74, 144, 226, 0.5);
}

.ghost-button {
  background: rgba(30, 40, 71, 0.86);
  border: 1px solid rgba(74, 144, 226, 0.45);
  box-shadow: none;
}

.menu-toggle {
  display: none;
  margin-left: auto;
  width: 2.5rem;
  height: 2.5rem;
  color: #fff;
  border-radius: 0.75rem;
  background: rgba(30, 40, 71, 0.9);
}

.mobile-panel {
  display: none;
  border-top: 1px solid rgba(42, 56, 87, 0.36);
  padding: 1rem;
}

.mobile-panel.is-open {
  display: block;
}

.mobile-search {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.mobile-search input {
  flex: 1;
  min-width: 0;
}

.mobile-nav-link {
  display: block;
  padding: 0.78rem 1rem;
  border-radius: 0.75rem;
  color: var(--text-soft);
}

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

main {
  min-height: 70vh;
}

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

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

.hero-slide.is-active {
  display: flex;
  animation: fadeHero 0.65s ease both;
}

.hero-content {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 5rem 1rem 4rem;
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(18rem, 0.7fr);
  gap: 2rem;
  align-items: center;
}

.hero-panel {
  max-width: 52rem;
  padding: 2rem;
  border-radius: 1.5rem;
  border: 1px solid rgba(74, 144, 226, 0.24);
  background: linear-gradient(135deg, rgba(10, 14, 39, 0.84), rgba(20, 27, 61, 0.68));
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.hero-panel h1 {
  margin: 0 0 0.8rem;
  font-size: clamp(2rem, 5vw, 4.2rem);
  line-height: 1.04;
  letter-spacing: -0.04em;
}

.hero-panel h2 {
  margin: 0 0 1rem;
  font-size: clamp(1.3rem, 2.5vw, 2rem);
}

.eyebrow {
  margin: 0 0 0.8rem;
  color: var(--stellar-sky);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-lead {
  margin: 0 0 1.4rem;
  color: var(--text-soft);
  font-size: 1.05rem;
  max-width: 44rem;
}

.hero-actions, .section-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  align-items: center;
}

.hero-poster {
  border-radius: 1.5rem;
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.08);
  aspect-ratio: 2 / 3;
}

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

.hero-controls {
  position: absolute;
  right: 1rem;
  bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.hero-control {
  width: 2.6rem;
  height: 2.6rem;
  padding: 0;
}

.hero-dots {
  display: flex;
  gap: 0.45rem;
}

.hero-dot {
  width: 0.6rem;
  height: 0.6rem;
  padding: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.4);
}

.hero-dot.is-active {
  background: var(--stellar-sky);
  box-shadow: 0 0 18px rgba(56, 189, 248, 0.75);
}

.section, .page-shell {
  max-width: 1280px;
  margin: 0 auto;
  padding: 4rem 1rem;
}

.section-full {
  padding: 4rem 0;
  background: linear-gradient(180deg, rgba(20, 27, 61, 0.75), rgba(10, 14, 39, 0.95));
}

.section-header, .page-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: end;
  margin-bottom: 1.8rem;
}

.section-title, .page-title {
  margin: 0;
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  line-height: 1.15;
}

.section-desc, .page-desc {
  margin: 0.6rem 0 0;
  color: var(--text-muted);
  max-width: 54rem;
}

.movie-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 1.2rem;
}

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

.movie-card {
  min-width: 0;
  overflow: hidden;
  border-radius: 1rem;
  border: 1px solid rgba(42, 56, 87, 0.55);
  background: rgba(20, 27, 61, 0.82);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.18);
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

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

.poster-wrap {
  position: relative;
  display: block;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  background: var(--stellar-mid);
}

.movie-card-large .poster-wrap {
  aspect-ratio: 16 / 9;
}

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

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

.poster-shine {
  position: absolute;
  inset: auto 0 0;
  height: 50%;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.78));
}

.rank-badge {
  position: absolute;
  left: 0.75rem;
  top: 0.75rem;
  z-index: 2;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: white;
  font-weight: 800;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.movie-card-body {
  padding: 1rem;
}

.movie-card-meta, .detail-meta, .breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
  font-size: 0.86rem;
}

.movie-card h3 {
  margin: 0.42rem 0;
  font-size: 1rem;
  line-height: 1.35;
}

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

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.42rem;
  margin-top: 0.8rem;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 1.6rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  color: #dbeafe;
  background: rgba(74, 144, 226, 0.18);
  border: 1px solid rgba(74, 144, 226, 0.24);
  font-size: 0.78rem;
}

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

.category-card {
  min-height: 11rem;
  padding: 1.3rem;
  border-radius: 1rem;
  background: linear-gradient(135deg, rgba(30, 40, 71, 0.92), rgba(20, 27, 61, 0.82));
  border: 1px solid rgba(42, 56, 87, 0.6);
  transition: transform 0.25s ease, border-color 0.25s ease;
}

.category-card:hover {
  transform: translateY(-4px);
  border-color: var(--stellar-glow);
}

.category-card h2, .category-card h3 {
  margin: 0 0 0.6rem;
}

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

.filter-panel {
  display: grid;
  grid-template-columns: 1fr 13rem 14rem;
  gap: 0.8rem;
  align-items: end;
  margin: 0 0 1.5rem;
  padding: 1rem;
  border-radius: 1rem;
  background: rgba(10, 14, 39, 0.62);
  border: 1px solid rgba(42, 56, 87, 0.45);
}

.filter-panel label {
  display: grid;
  gap: 0.4rem;
  color: var(--text-muted);
  font-size: 0.86rem;
}

.filter-panel input, .filter-panel select {
  width: 100%;
}

.empty-state {
  display: none;
  padding: 2rem;
  text-align: center;
  color: var(--text-muted);
  border: 1px dashed rgba(74, 144, 226, 0.4);
  border-radius: 1rem;
}

.empty-state.is-visible {
  display: block;
}

.detail-hero {
  max-width: 1280px;
  margin: 0 auto;
  padding: 2rem 1rem 4rem;
}

.breadcrumb {
  margin: 1rem 0 1.6rem;
}

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

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(18rem, 0.7fr);
  gap: 2rem;
  align-items: start;
}

.player-shell {
  position: relative;
  overflow: hidden;
  border-radius: 1.25rem;
  border: 1px solid rgba(74, 144, 226, 0.28);
  background: #000;
  box-shadow: var(--shadow);
}

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

.player-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.25), rgba(0, 0, 0, 0.7));
  cursor: pointer;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

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

.player-button {
  width: 4.4rem;
  height: 4.4rem;
  border-radius: 999px;
  padding: 0;
  font-size: 1.7rem;
}

.detail-card {
  padding: 1.4rem;
  border-radius: 1.25rem;
  background: rgba(20, 27, 61, 0.84);
  border: 1px solid rgba(42, 56, 87, 0.55);
}

.detail-cover {
  overflow: hidden;
  border-radius: 1rem;
  margin-bottom: 1rem;
  aspect-ratio: 2 / 3;
  background: var(--stellar-mid);
}

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

.detail-title {
  margin: 0 0 0.8rem;
  font-size: clamp(2rem, 4vw, 3.6rem);
  line-height: 1.08;
}

.content-block {
  margin-top: 1.5rem;
  padding: 1.4rem;
  border-radius: 1.2rem;
  background: rgba(10, 14, 39, 0.5);
  border: 1px solid rgba(42, 56, 87, 0.42);
}

.content-block h2 {
  margin: 0 0 0.8rem;
  font-size: 1.35rem;
}

.content-block p {
  margin: 0;
  color: var(--text-soft);
}

.related-section {
  margin-top: 3rem;
}

.site-footer {
  border-top: 1px solid rgba(42, 56, 87, 0.42);
  background: rgba(10, 14, 39, 0.95);
}

.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 2.5rem 1rem;
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 2rem;
}

.footer-inner p {
  color: var(--text-muted);
  max-width: 36rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: end;
  gap: 0.8rem 1.2rem;
  color: var(--text-muted);
}

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

.pagination-note {
  color: var(--text-muted);
  margin-top: 1rem;
}

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

@keyframes fadeHero {
  from {
    opacity: 0;
    transform: scale(1.01);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@media (max-width: 1180px) {
  .movie-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
  .movie-grid.large-grid, .category-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 920px) {
  .desktop-nav, .header-search {
    display: none;
  }
  .menu-toggle {
    display: inline-grid;
    place-items: center;
  }
  .hero-content, .detail-layout, .footer-inner {
    grid-template-columns: 1fr;
  }
  .hero-poster {
    max-width: 18rem;
    margin: 0 auto;
  }
  .movie-grid, .movie-grid.large-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .filter-panel {
    grid-template-columns: 1fr;
  }
  .footer-links {
    justify-content: start;
  }
}

@media (max-width: 640px) {
  .section, .page-shell, .detail-hero {
    padding-left: 0.85rem;
    padding-right: 0.85rem;
  }
  .hero-panel {
    padding: 1.2rem;
  }
  .movie-grid, .movie-grid.large-grid, .category-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
  }
  .movie-card-body {
    padding: 0.8rem;
  }
  .movie-card p {
    min-height: 3.8rem;
    -webkit-line-clamp: 2;
  }
  .section-header, .page-header {
    display: block;
  }
  .hero-controls {
    left: 1rem;
    right: auto;
  }
}
