:root {
  color-scheme: dark;
  --bg: #03030a;
  --bg-soft: #090b18;
  --panel: rgba(255, 255, 255, 0.08);
  --panel-strong: rgba(255, 255, 255, 0.14);
  --line: rgba(255, 255, 255, 0.14);
  --text: #f7f7ff;
  --muted: #a8adbf;
  --muted-2: #7f8496;
  --blueberry: #7d60f5;
  --blueberry-soft: #9d8df9;
  --night: #5d77ff;
  --gold: #facc15;
  --danger: #ff5a9f;
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.42);
  --max: 1240px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 20% 8%, rgba(125, 96, 245, 0.28), transparent 28%),
    radial-gradient(circle at 85% 0%, rgba(93, 119, 255, 0.23), transparent 32%),
    linear-gradient(135deg, #020208 0%, #090b18 46%, #03030a 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  line-height: 1.65;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.8), transparent 78%);
}

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

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

button,
input {
  font: inherit;
}

.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  border-bottom: 1px solid var(--line);
  background: rgba(6, 7, 18, 0.78);
  backdrop-filter: blur(18px);
}

.nav-shell {
  width: min(var(--max), calc(100% - 32px));
  height: 72px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 22px;
}

.brand,
.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.brand-mark {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  color: var(--blueberry-soft);
  filter: drop-shadow(0 0 12px rgba(125, 96, 245, 0.75));
  animation: twinkle 3s ease-in-out infinite;
}

.brand-text,
.footer-brand {
  font-size: 22px;
  background: linear-gradient(90deg, var(--blueberry-soft), var(--night));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

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

.nav-link {
  padding: 8px 12px;
  color: #d7dbeb;
  border-radius: 999px;
  transition: 0.22s ease;
}

.nav-link:hover,
.nav-link.is-active {
  color: white;
  background: rgba(125, 96, 245, 0.22);
  box-shadow: 0 0 24px rgba(125, 96, 245, 0.18);
}

.global-search {
  position: relative;
  margin-left: auto;
  width: min(310px, 32vw);
}

.global-search input,
.page-filter input {
  width: 100%;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 999px;
  outline: none;
  background: rgba(255, 255, 255, 0.09);
  padding: 11px 16px;
  transition: 0.2s ease;
}

.global-search input:focus,
.page-filter input:focus {
  border-color: var(--blueberry-soft);
  box-shadow: 0 0 0 4px rgba(125, 96, 245, 0.16);
}

.search-panel {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  width: min(520px, 88vw);
  max-height: 430px;
  overflow: auto;
  display: none;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(10, 12, 28, 0.96);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

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

.search-item {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 12px;
  padding: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.search-item:last-child {
  border-bottom: 0;
}

.search-item img {
  width: 54px;
  height: 72px;
  object-fit: cover;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.07);
}

.search-item strong {
  display: block;
  color: white;
  line-height: 1.3;
}

.search-item span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: white;
  background: rgba(255, 255, 255, 0.08);
}

.menu-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 3px auto;
  border-radius: 99px;
  background: white;
}

.mobile-panel {
  display: none;
  width: min(var(--max), calc(100% - 32px));
  margin: 0 auto 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.08);
}

.mobile-panel.is-open {
  display: grid;
  gap: 8px;
}

.mobile-panel a {
  padding: 10px 12px;
  border-radius: 12px;
  color: #e8e9f5;
}

.mobile-panel a:hover {
  background: rgba(255, 255, 255, 0.09);
}

main {
  padding-top: 72px;
}

.page-main {
  width: min(var(--max), calc(100% - 32px));
  margin: 0 auto;
}

.hero {
  width: min(var(--max), calc(100% - 32px));
  margin: 28px auto 0;
}

.hero-stage {
  position: relative;
  min-height: 620px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 34px;
  background: #060714;
  box-shadow: var(--shadow);
}

.hero-slide {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  align-items: end;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.7s ease;
}

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

.hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.05);
  filter: saturate(1.12) brightness(0.64);
}

.hero-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(2, 2, 8, 0.9), rgba(2, 2, 8, 0.48) 54%, rgba(2, 2, 8, 0.86)),
    linear-gradient(to top, rgba(3, 3, 10, 0.92), transparent 58%);
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 740px;
  padding: 64px;
}

.hero-kicker,
.section-kicker {
  margin: 0 0 10px;
  color: var(--blueberry-soft);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.hero h1,
.page-hero h1 {
  margin: 0;
  font-size: clamp(36px, 5.2vw, 70px);
  line-height: 1.04;
  text-shadow: 0 0 28px rgba(93, 119, 255, 0.5);
}

.hero h2 {
  margin: 18px 0 0;
  font-size: clamp(28px, 3vw, 46px);
  line-height: 1.15;
}

.hero p,
.page-hero p {
  max-width: 720px;
  margin: 18px 0 0;
  color: #d9dcee;
  font-size: 17px;
}

.hero-tags,
.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.hero-tags span,
.detail-meta span,
.tag-chip {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 11px;
  color: #e9eaff;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
}

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

.primary-btn,
.ghost-btn,
.section-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 18px;
  border-radius: 999px;
  font-weight: 800;
  transition: 0.22s ease;
}

.primary-btn {
  color: white;
  background: linear-gradient(135deg, var(--blueberry), var(--night));
  box-shadow: 0 18px 36px rgba(93, 119, 255, 0.24);
}

.primary-btn:hover,
.ghost-btn:hover,
.section-link:hover {
  transform: translateY(-2px);
}

.ghost-btn,
.section-link {
  color: #e8eaff;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.1);
}

.hero-side-list {
  position: absolute;
  right: 24px;
  top: 50%;
  z-index: 3;
  display: grid;
  width: 300px;
  gap: 12px;
  transform: translateY(-50%);
}

.hero-side-card {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid transparent;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
  transition: 0.22s ease;
}

.hero-side-card.is-active,
.hero-side-card:hover {
  border-color: rgba(157, 141, 249, 0.62);
  background: rgba(125, 96, 245, 0.24);
}

.hero-side-card img {
  width: 64px;
  height: 84px;
  object-fit: cover;
  border-radius: 12px;
}

.hero-side-card strong,
.hero-side-card em {
  display: block;
}

.hero-side-card strong {
  line-height: 1.3;
}

.hero-side-card em {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
}

.hero-dots {
  position: absolute;
  left: 64px;
  bottom: 34px;
  z-index: 5;
  display: flex;
  gap: 8px;
}

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

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

.section {
  width: min(var(--max), calc(100% - 32px));
  margin: 58px auto 0;
}

.page-main .section {
  width: 100%;
}

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

.section-head h2,
.content-card h2 {
  margin: 0;
  font-size: clamp(26px, 3vw, 38px);
  line-height: 1.18;
}

.intro-section {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(16px);
}

.intro-text {
  max-width: 980px;
  margin: 0;
  color: var(--muted);
  font-size: 17px;
}

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

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

.category-card {
  position: relative;
  min-height: 220px;
  overflow: hidden;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.07);
  transition: 0.25s ease;
}

.category-card:hover {
  transform: translateY(-5px);
  border-color: rgba(157, 141, 249, 0.58);
  background: rgba(125, 96, 245, 0.16);
  box-shadow: var(--shadow);
}

.category-covers {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-bottom: 16px;
}

.category-covers img {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
}

.category-card span {
  color: var(--blueberry-soft);
  font-size: 14px;
  font-weight: 800;
}

.category-card strong {
  display: block;
  margin-top: 4px;
  font-size: 20px;
}

.category-card p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
}

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

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

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

.movie-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.07);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.18);
  transition: 0.25s ease;
}

.movie-card:hover {
  transform: translateY(-6px) scale(1.015);
  border-color: rgba(157, 141, 249, 0.6);
  box-shadow: var(--shadow);
}

.poster-wrap {
  position: relative;
  display: block;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
}

.poster-wrap img {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  transition: transform 0.35s ease;
}

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

.poster-wrap::after {
  position: absolute;
  inset: auto 0 0 0;
  height: 45%;
  content: "";
  background: linear-gradient(to top, rgba(0, 0, 0, 0.78), transparent);
}

.poster-type,
.poster-score,
.rank-badge {
  position: absolute;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
}

.poster-type {
  left: 10px;
  top: 10px;
  color: white;
  background: rgba(0, 0, 0, 0.54);
  backdrop-filter: blur(10px);
}

.poster-score {
  right: 10px;
  bottom: 10px;
  color: #1a1400;
  background: var(--gold);
}

.rank-badge {
  left: 10px;
  bottom: 10px;
  color: white;
  background: linear-gradient(135deg, var(--danger), var(--blueberry));
}

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

.movie-card-title {
  display: -webkit-box;
  min-height: 46px;
  overflow: hidden;
  color: white;
  font-size: 16px;
  font-weight: 900;
  line-height: 1.35;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.movie-card-title:hover {
  color: var(--blueberry-soft);
}

.movie-meta {
  margin-top: 7px;
  color: var(--muted-2);
  font-size: 13px;
}

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

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}

.tag-chip {
  min-height: 26px;
  padding: 3px 9px;
  color: #dfe1ff;
  font-size: 12px;
}

.page-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  min-height: 300px;
  margin-top: 28px;
  padding: 42px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 30px;
  background:
    linear-gradient(135deg, rgba(125, 96, 245, 0.22), rgba(93, 119, 255, 0.08)),
    rgba(255, 255, 255, 0.06);
  box-shadow: var(--shadow);
}

.small-hero,
.category-hero,
.ranking-hero {
  min-height: 260px;
}

.page-filter {
  width: min(360px, 100%);
}

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

.breadcrumb a:hover {
  color: var(--blueberry-soft);
}

.detail-hero {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 30px;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 30px;
  background:
    radial-gradient(circle at 80% 20%, rgba(125, 96, 245, 0.28), transparent 30%),
    rgba(255, 255, 255, 0.07);
  box-shadow: var(--shadow);
}

.detail-poster img {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.35);
}

.detail-info h1 {
  margin: 0;
  font-size: clamp(32px, 4vw, 58px);
  line-height: 1.08;
}

.detail-one-line {
  max-width: 880px;
  margin: 18px 0 0;
  color: #d9dcee;
  font-size: 18px;
}

.detail-tags {
  margin-bottom: 28px;
}

.player-section {
  margin-top: 30px;
}

.player-shell {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: #000;
  box-shadow: var(--shadow);
}

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

.play-layer {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  gap: 12px;
  color: white;
  border: 0;
  cursor: pointer;
  background:
    linear-gradient(to top, rgba(0, 0, 0, 0.78), rgba(0, 0, 0, 0.2)),
    rgba(0, 0, 0, 0.28);
}

.play-layer strong {
  padding: 0 20px;
  font-size: clamp(20px, 3vw, 34px);
  text-align: center;
  text-shadow: 0 0 28px rgba(0, 0, 0, 0.65);
}

.play-icon {
  display: grid;
  width: 84px;
  height: 84px;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blueberry), var(--night));
  box-shadow: 0 18px 46px rgba(93, 119, 255, 0.38);
}

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

.detail-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.content-card {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.07);
}

.content-card p {
  margin: 16px 0 0;
  color: #d7d9e9;
  font-size: 16px;
}

.site-footer {
  width: min(var(--max), calc(100% - 32px));
  margin: 70px auto 26px;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.06);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 2fr;
  gap: 30px;
}

.site-footer p,
.site-footer a {
  color: var(--muted);
}

.site-footer a {
  display: inline-flex;
  margin: 0 14px 8px 0;
}

.site-footer a:hover {
  color: var(--blueberry-soft);
}

.site-footer h2 {
  margin: 0 0 12px;
  font-size: 17px;
}

.footer-bottom {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted-2);
  text-align: center;
}

@keyframes twinkle {
  0%, 100% {
    opacity: 1;
    transform: translateY(0);
  }

  50% {
    opacity: 0.52;
    transform: translateY(-3px);
  }
}

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

  .menu-toggle {
    display: block;
  }

  .global-search {
    width: min(420px, 48vw);
  }

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

  .hero-side-list {
    display: none;
  }

  .movie-grid,
  .dense-grid,
  .ranking-grid,
  .category-grid,
  .full-category-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .nav-shell {
    height: auto;
    min-height: 68px;
    flex-wrap: wrap;
    padding: 12px 0;
  }

  main {
    padding-top: 96px;
  }

  .global-search {
    order: 3;
    width: 100%;
  }

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

  .hero-content {
    padding: 34px 24px 76px;
  }

  .hero-dots {
    left: 24px;
  }

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

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

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

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

@media (max-width: 520px) {
  .hero,
  .section,
  .page-main,
  .site-footer {
    width: min(100% - 22px, var(--max));
  }

  .movie-grid,
  .dense-grid,
  .ranking-grid,
  .category-grid,
  .full-category-grid {
    gap: 12px;
  }

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

  .movie-card-title {
    font-size: 14px;
  }

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

  .page-hero,
  .detail-hero,
  .content-card,
  .site-footer {
    padding: 22px;
    border-radius: 22px;
  }

  .play-icon {
    width: 64px;
    height: 64px;
  }
}
