:root {
  color-scheme: dark;
  --bg: #020617;
  --panel: rgba(15, 23, 42, 0.78);
  --panel-solid: #0f172a;
  --line: rgba(59, 130, 246, 0.22);
  --line-strong: rgba(245, 158, 11, 0.48);
  --text: #f8fafc;
  --muted: #94a3b8;
  --soft: #cbd5e1;
  --blue: #2563eb;
  --blue-soft: #60a5fa;
  --amber: #f59e0b;
  --amber-strong: #fbbf24;
  --shadow: 0 24px 80px rgba(2, 6, 23, 0.45);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.28), transparent 34rem),
    linear-gradient(180deg, #020617 0%, #0f172a 42%, #020617 100%);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  line-height: 1.7;
}

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

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

button,
input,
select {
  font: inherit;
}

.container {
  width: min(1180px, calc(100% - 32px));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: linear-gradient(90deg, rgba(15, 23, 42, 0.96), rgba(30, 58, 138, 0.92), rgba(15, 23, 42, 0.96));
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
  gap: 24px;
}

.brand,
.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.brand-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: radial-gradient(circle at 35% 35%, #fef3c7, var(--amber));
  color: #0f172a;
  box-shadow: 0 0 28px rgba(245, 158, 11, 0.36);
  font-size: 14px;
}

.brand-text {
  display: grid;
  line-height: 1.15;
}

.brand-text strong {
  font-size: 20px;
  letter-spacing: 0.04em;
}

.brand-text small {
  color: #93c5fd;
  font-size: 12px;
}

.desktop-nav {
  display: flex;
  align-items: center;
  gap: 22px;
}

.nav-link,
.mobile-nav-link {
  color: #e2e8f0;
  font-weight: 650;
  transition: color 0.2s ease, transform 0.2s ease;
}

.nav-link:hover,
.nav-link.active,
.mobile-nav-link:hover,
.mobile-nav-link.active {
  color: var(--amber-strong);
}

.mobile-menu-button {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.7);
  color: white;
  cursor: pointer;
}

.mobile-menu-button span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 4px auto;
  background: currentColor;
  border-radius: 999px;
}

.mobile-nav {
  display: none;
  border-top: 1px solid var(--line);
  padding: 12px 16px 18px;
  background: rgba(2, 6, 23, 0.94);
}

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

.hero-carousel {
  position: relative;
  min-height: 72vh;
  overflow: hidden;
  background: #020617;
}

.hero-slide {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  background-position: center;
  background-size: cover;
  opacity: 0;
  pointer-events: none;
  transform: scale(1.04);
  transition: opacity 0.7s ease, transform 1.2s ease;
}

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

.hero-overlay,
.detail-hero-mask {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(2, 6, 23, 0.96) 0%, rgba(2, 6, 23, 0.72) 42%, rgba(2, 6, 23, 0.28) 100%),
    linear-gradient(0deg, #020617 0%, transparent 54%);
}

.hero-content {
  position: relative;
  z-index: 2;
  padding: 120px 0 86px;
  max-width: 1180px;
}

.hero-kicker,
.section-kicker {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  gap: 8px;
  color: var(--amber-strong);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 800;
  font-size: 13px;
}

.hero-content h1,
.hero-content h2 {
  max-width: 760px;
  margin: 12px 0 14px;
  font-size: clamp(34px, 6vw, 64px);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.hero-content p {
  max-width: 680px;
  margin: 0 0 22px;
  color: #cbd5e1;
  font-size: clamp(16px, 2vw, 20px);
}

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

.hero-tags span,
.detail-meta span {
  border: 1px solid rgba(96, 165, 250, 0.32);
  border-radius: 999px;
  padding: 6px 12px;
  background: rgba(37, 99, 235, 0.2);
  color: #bfdbfe;
  font-size: 13px;
}

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

.primary-button,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 22px;
  border-radius: 999px;
  font-weight: 800;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.primary-button {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: #111827;
  box-shadow: 0 16px 34px rgba(245, 158, 11, 0.24);
}

.ghost-button {
  border: 1px solid rgba(148, 163, 184, 0.32);
  background: rgba(15, 23, 42, 0.5);
  color: #e2e8f0;
}

.primary-button:hover,
.ghost-button:hover {
  transform: translateY(-2px) scale(1.02);
}

.hero-controls {
  position: absolute;
  z-index: 4;
  right: max(16px, calc((100vw - 1180px) / 2));
  bottom: 34px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.hero-controls button {
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(15, 23, 42, 0.74);
  color: white;
  cursor: pointer;
}

.hero-controls > button {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  font-size: 28px;
  line-height: 1;
}

.hero-dots {
  display: flex;
  gap: 8px;
}

.hero-dot {
  width: 10px;
  height: 10px;
  padding: 0;
  border-radius: 999px;
  opacity: 0.58;
}

.hero-dot.active {
  width: 28px;
  background: var(--amber);
  opacity: 1;
}

.category-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: -34px;
  position: relative;
  z-index: 5;
}

.category-strip a,
.category-card,
.filter-card,
.movie-card,
.ranking-list,
.compact-card,
.player-shell,
.detail-text {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.86), rgba(15, 23, 42, 0.58));
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.category-strip a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 72px;
  border-radius: 18px;
  padding: 18px;
  font-size: 18px;
  font-weight: 800;
}

.category-strip span {
  font-size: 24px;
}

.filter-panel {
  margin-top: 36px;
}

.filter-card {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(180px, 0.5fr) minmax(180px, 0.5fr);
  gap: 16px;
  padding: 18px;
  border-radius: 22px;
}

.filter-card label {
  display: grid;
  gap: 8px;
  color: #bfdbfe;
  font-size: 13px;
  font-weight: 800;
}

.filter-card input,
.filter-card select {
  width: 100%;
  min-height: 46px;
  border: 1px solid rgba(96, 165, 250, 0.24);
  border-radius: 14px;
  outline: none;
  background: rgba(2, 6, 23, 0.72);
  color: white;
  padding: 0 14px;
}

.filter-card input:focus,
.filter-card select:focus {
  border-color: var(--amber);
}

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

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

.section-heading h2,
.detail-text h2,
.player-section h2 {
  margin: 4px 0 0;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.2;
}

.section-heading p {
  max-width: 680px;
  margin: 8px 0 0;
  color: var(--muted);
}

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

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

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

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

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

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

.movie-card:hover {
  transform: translateY(-5px);
  border-color: var(--line-strong);
  box-shadow: 0 26px 82px rgba(37, 99, 235, 0.18);
}

.movie-poster {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(30, 64, 175, 0.7), rgba(2, 6, 23, 0.95));
}

.all-grid .movie-poster,
.related-grid .movie-poster {
  aspect-ratio: 3 / 4;
}

.movie-poster img,
.compact-card img,
.detail-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.55s ease;
}

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

.poster-play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: white;
  font-size: 40px;
  opacity: 0;
  background: rgba(2, 6, 23, 0.36);
  transition: opacity 0.2s ease;
}

.movie-card:hover .poster-play {
  opacity: 1;
}

.poster-year {
  position: absolute;
  right: 10px;
  top: 10px;
  border-radius: 999px;
  padding: 4px 10px;
  background: rgba(2, 6, 23, 0.76);
  color: #e2e8f0;
  font-size: 12px;
  font-weight: 800;
}

.movie-card-body {
  display: grid;
  gap: 9px;
  padding: 16px;
}

.movie-title {
  color: white;
  font-weight: 850;
  line-height: 1.35;
}

.movie-card:hover .movie-title {
  color: var(--amber-strong);
}

.movie-meta {
  color: var(--muted);
  font-size: 12px;
}

.movie-meta span:not(:last-child)::after {
  content: "·";
  margin-left: 10px;
  color: #475569;
}

.movie-card-body p {
  min-height: 48px;
  margin: 0;
  color: #a5b4fc;
  font-size: 13px;
}

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

.tag-list span {
  border-radius: 999px;
  padding: 4px 9px;
  background: rgba(37, 99, 235, 0.22);
  color: #bfdbfe;
  font-size: 12px;
}

.ranking-preview {
  padding-top: 18px;
}

.ranking-list {
  display: grid;
  border-radius: 22px;
  overflow: hidden;
}

.ranking-item {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 58px;
  padding: 0 18px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.ranking-item:last-child {
  border-bottom: none;
}

.ranking-number {
  color: var(--amber-strong);
  font-weight: 900;
  font-size: 20px;
}

.ranking-name {
  overflow: hidden;
  color: white;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ranking-meta {
  color: var(--muted);
  font-size: 13px;
}

.ranking-item:hover {
  background: rgba(37, 99, 235, 0.18);
}

.compact-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 16px;
}

.compact-card {
  display: grid;
  gap: 8px;
  overflow: hidden;
  border-radius: 18px;
  padding: 10px;
  transition: transform 0.24s ease, border-color 0.24s ease;
}

.compact-card:hover {
  transform: translateY(-4px);
  border-color: var(--line-strong);
}

.compact-card img {
  aspect-ratio: 3 / 4;
  border-radius: 12px;
  background: rgba(37, 99, 235, 0.2);
}

.compact-card span {
  overflow: hidden;
  font-weight: 750;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.compact-card small {
  overflow: hidden;
  color: var(--muted);
  white-space: nowrap;
  text-overflow: ellipsis;
}

.page-hero {
  position: relative;
  padding: 78px 0 62px;
  background:
    radial-gradient(circle at top right, rgba(245, 158, 11, 0.2), transparent 30rem),
    linear-gradient(135deg, rgba(30, 64, 175, 0.5), rgba(2, 6, 23, 0.98));
  border-bottom: 1px solid var(--line);
}

.page-hero h1 {
  max-width: 820px;
  margin: 10px 0 12px;
  font-size: clamp(32px, 5vw, 54px);
  line-height: 1.08;
}

.page-hero p {
  max-width: 760px;
  margin: 0;
  color: var(--soft);
  font-size: 18px;
}

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

.category-card {
  border-radius: 22px;
  overflow: hidden;
}

.category-card-main {
  display: grid;
  gap: 10px;
  padding: 24px;
}

.category-icon {
  font-size: 34px;
}

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

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

.category-card ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 18px 24px 24px;
  list-style: none;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
}

.category-card li a {
  color: #bfdbfe;
}

.detail-hero {
  position: relative;
  min-height: 560px;
  display: flex;
  align-items: end;
  background-position: center;
  background-size: cover;
}

.detail-hero-content {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 34px;
  padding: 86px 0 58px;
}

.detail-poster {
  overflow: hidden;
  aspect-ratio: 3 / 4;
  border: 1px solid rgba(245, 158, 11, 0.34);
  border-radius: 22px;
  background: rgba(15, 23, 42, 0.82);
  box-shadow: var(--shadow);
}

.detail-info h1 {
  max-width: 850px;
  margin: 12px 0;
  font-size: clamp(34px, 6vw, 64px);
  line-height: 1.05;
}

.detail-one-line {
  max-width: 820px;
  color: var(--soft);
  font-size: 19px;
}

.detail-tags {
  margin: 20px 0 26px;
}

.player-section {
  padding: 56px 0 12px;
}

.player-shell {
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  margin-top: 18px;
  background: #020617;
}

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

.player-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  gap: 10px;
  border: none;
  background: radial-gradient(circle, rgba(15, 23, 42, 0.18), rgba(2, 6, 23, 0.72));
  color: white;
  cursor: pointer;
}

.player-overlay span {
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  border-radius: 999px;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: #0f172a;
  font-size: 28px;
  box-shadow: 0 20px 54px rgba(245, 158, 11, 0.3);
}

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

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

.detail-text {
  display: grid;
  gap: 14px;
  border-radius: 24px;
  padding: 28px;
}

.detail-text h2 {
  margin-top: 0;
}

.detail-text p {
  margin: 0 0 8px;
  color: var(--soft);
  font-size: 17px;
}

.site-footer {
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.9), #020617);
  color: #cbd5e1;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr 0.8fr 1fr;
  gap: 28px;
  padding: 44px 0;
}

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

.footer-grid p {
  margin: 12px 0 0;
  color: var(--muted);
}

.footer-grid ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-grid a:hover {
  color: var(--amber-strong);
}

.footer-bottom {
  display: flex;
  justify-content: center;
  gap: 18px;
  padding: 18px;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
  color: #64748b;
  font-size: 13px;
}

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

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

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

@media (max-width: 820px) {
  .desktop-nav {
    display: none;
  }

  .mobile-menu-button {
    display: block;
  }

  .hero-carousel {
    min-height: 76vh;
  }

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

  .hero-controls {
    left: 16px;
    right: auto;
  }

  .category-strip,
  .filter-card,
  .category-grid,
  .footer-grid,
  .detail-hero-content {
    grid-template-columns: 1fr;
  }

  .section-heading {
    display: grid;
  }

  .movie-grid,
  .featured-grid,
  .all-grid,
  .related-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .detail-poster {
    width: 220px;
  }

  .ranking-item {
    grid-template-columns: 48px minmax(0, 1fr);
  }

  .ranking-meta {
    grid-column: 2;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: center;
  }
}

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

  .brand-text strong {
    font-size: 17px;
  }

  .movie-grid,
  .featured-grid,
  .all-grid,
  .related-grid {
    grid-template-columns: 1fr;
  }

  .hero-actions {
    display: grid;
  }

  .primary-button,
  .ghost-button {
    width: 100%;
  }

  .movie-card-body p {
    min-height: auto;
  }
}
