:root {
  color-scheme: dark;
  --bg: #020617;
  --bg-soft: #0f172a;
  --bg-card: rgba(15, 23, 42, 0.72);
  --bg-card-strong: rgba(15, 23, 42, 0.92);
  --text: #f8fafc;
  --muted: #94a3b8;
  --line: rgba(168, 85, 247, 0.22);
  --purple: #a855f7;
  --purple-soft: rgba(168, 85, 247, 0.16);
  --pink: #ec4899;
  --blue: #38bdf8;
  --radius: 22px;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.38);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 18% -10%, rgba(168, 85, 247, 0.28), transparent 34rem),
    radial-gradient(circle at 86% 4%, rgba(236, 72, 153, 0.18), transparent 28rem),
    linear-gradient(180deg, #020617 0%, #0f172a 52%, #020617 100%);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  line-height: 1.65;
}

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

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

button,
input,
select {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--line);
  background: rgba(2, 6, 23, 0.82);
  backdrop-filter: blur(20px);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
}

.header-inner {
  width: min(1280px, calc(100% - 32px));
  height: 72px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 20px;
}

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

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--purple), var(--pink));
  color: #fff;
  box-shadow: 0 14px 35px rgba(168, 85, 247, 0.36);
}

.brand-text {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.02em;
  background: linear-gradient(90deg, #c084fc, #f0abfc, #f472b6);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  white-space: nowrap;
}

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

.nav-link {
  padding: 9px 14px;
  border-radius: 12px;
  color: #cbd5e1;
  transition: 0.22s ease;
}

.nav-link:hover,
.nav-link.is-active {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

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

.header-search input,
.mobile-search input,
.search-panel input,
.filter-bar input,
.filter-bar select {
  border: 1px solid rgba(168, 85, 247, 0.32);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  border-radius: 14px;
  outline: none;
  transition: 0.22s ease;
}

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

.header-search input:focus,
.mobile-search input:focus,
.search-panel input:focus,
.filter-bar input:focus,
.filter-bar select:focus {
  border-color: rgba(216, 180, 254, 0.85);
  box-shadow: 0 0 0 4px rgba(168, 85, 247, 0.14);
}

.header-search button,
.mobile-search button,
.search-panel button,
.primary-button,
.ghost-button,
.text-button {
  border: 0;
  border-radius: 14px;
  cursor: pointer;
  transition: 0.22s ease;
}

.header-search button,
.mobile-search button,
.search-panel button,
.primary-button {
  padding: 10px 18px;
  color: #fff;
  background: linear-gradient(135deg, var(--purple), var(--pink));
  box-shadow: 0 16px 34px rgba(168, 85, 247, 0.28);
}

.header-search button:hover,
.mobile-search button:hover,
.search-panel button:hover,
.primary-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 44px rgba(236, 72, 153, 0.28);
}

.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.ghost-button:hover,
.text-button:hover {
  border-color: rgba(216, 180, 254, 0.8);
  color: #f0abfc;
  transform: translateY(-2px);
}

.text-button {
  display: inline-flex;
  color: #c084fc;
  font-weight: 700;
}

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

.mobile-panel {
  display: none;
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  padding: 0 0 18px;
}

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

.mobile-panel nav {
  display: grid;
  gap: 8px;
  padding: 14px 0;
}

.mobile-search input {
  width: 100%;
  padding: 11px 14px;
}

.hero-slider {
  position: relative;
  min-height: 680px;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background: #020617;
}

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

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

.hero-slide > img {
  width: 100%;
  height: 100%;
  min-height: 680px;
  object-fit: cover;
  filter: saturate(1.06) contrast(1.04);
}

.hero-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(2, 6, 23, 0.94), rgba(15, 23, 42, 0.66) 44%, rgba(2, 6, 23, 0.22)),
    linear-gradient(0deg, #020617 0%, transparent 42%),
    radial-gradient(circle at 74% 18%, rgba(168, 85, 247, 0.24), transparent 28rem);
}

.hero-content {
  position: absolute;
  left: max(24px, calc((100% - 1280px) / 2 + 16px));
  bottom: 90px;
  width: min(680px, calc(100% - 48px));
}

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

.eyebrow span,
.hero-tags span,
.tag-row span,
.pill,
.movie-category {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 10px;
  background: rgba(255, 255, 255, 0.12);
  color: #e9d5ff;
  font-size: 13px;
}

.eyebrow span:first-child,
.movie-category,
.pill {
  background: rgba(168, 85, 247, 0.22);
  color: #f0abfc;
}

.hero-content h1 {
  margin: 20px 0 16px;
  font-size: clamp(42px, 6vw, 84px);
  line-height: 1.02;
  letter-spacing: -0.06em;
}

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

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

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

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

.hero-dot.is-active {
  width: 34px;
  background: linear-gradient(90deg, var(--purple), var(--pink));
}

.home-search-panel,
.section-wrap,
.page-hero,
.detail-layout {
  width: min(1280px, calc(100% - 32px));
  margin-left: auto;
  margin-right: auto;
}

.home-search-panel {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 24px;
  align-items: center;
  margin-top: -42px;
  position: relative;
  z-index: 3;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: rgba(15, 23, 42, 0.82);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.home-search-panel h2,
.section-heading h2,
.page-hero h1,
.detail-section h2,
.player-title-row h1 {
  margin: 0;
  line-height: 1.16;
}

.home-search-panel h2 {
  font-size: clamp(26px, 4vw, 42px);
}

.home-search-panel p,
.page-hero p,
.detail-one-line,
.detail-section p,
.movie-card-body p,
.rank-info p,
.category-card-body p,
.site-footer p {
  color: var(--muted);
}

.home-search-panel form,
.search-panel {
  justify-content: flex-end;
}

.home-search-panel input,
.search-panel input {
  width: min(100%, 520px);
  padding: 14px 16px;
}

.section-wrap {
  padding: 66px 0 0;
}

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

.section-heading span,
.page-hero span,
.eyebrow-text {
  display: inline-flex;
  color: #c084fc;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.section-heading h2 {
  margin-top: 8px;
  font-size: clamp(28px, 4vw, 44px);
}

.section-heading a {
  color: #c084fc;
  font-weight: 700;
}

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

.movie-card {
  overflow: hidden;
  border: 1px solid rgba(168, 85, 247, 0.16);
  border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.76), rgba(2, 6, 23, 0.86));
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.24);
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.movie-card:hover {
  transform: translateY(-6px);
  border-color: rgba(216, 180, 254, 0.42);
  box-shadow: 0 28px 64px rgba(168, 85, 247, 0.18);
}

.movie-cover {
  position: relative;
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.18), rgba(236, 72, 153, 0.12));
}

.movie-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(2, 6, 23, 0.8), transparent 58%);
}

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

.movie-card:hover .movie-cover img,
.category-tile:hover img,
.category-preview a:hover img,
.rank-cover:hover img {
  transform: scale(1.08);
}

.movie-year,
.movie-type {
  position: absolute;
  z-index: 2;
  top: 12px;
  display: inline-flex;
  border-radius: 999px;
  padding: 4px 9px;
  color: #fff;
  font-size: 12px;
  background: rgba(2, 6, 23, 0.68);
  backdrop-filter: blur(10px);
}

.movie-year {
  right: 12px;
}

.movie-type {
  left: 12px;
}

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

.movie-card-body h3 {
  margin: 10px 0 8px;
  font-size: 19px;
  line-height: 1.34;
}

.movie-card-body h3 a:hover,
.rank-info h2 a:hover {
  color: #d8b4fe;
}

.movie-card-body p {
  display: -webkit-box;
  min-height: 52px;
  margin: 0 0 14px;
  overflow: hidden;
  font-size: 14px;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.tag-row span {
  color: #bae6fd;
  background: rgba(56, 189, 248, 0.12);
}

.category-band {
  padding-top: 54px;
}

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

.category-tile {
  position: relative;
  min-height: 168px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-soft);
}

.category-tile img {
  width: 100%;
  height: 100%;
  min-height: 168px;
  object-fit: cover;
  opacity: 0.78;
  transition: transform 0.55s ease, opacity 0.3s ease;
}

.category-tile span {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 16px;
  z-index: 2;
  font-size: 22px;
  font-weight: 800;
}

.category-tile::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(2, 6, 23, 0.88), transparent 70%);
}

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

.movie-card-wide {
  display: grid;
  grid-template-columns: 42% 1fr;
}

.movie-card-wide .movie-cover {
  height: 100%;
  aspect-ratio: auto;
}

.page-hero {
  margin-top: 40px;
  padding: 58px;
  border: 1px solid var(--line);
  border-radius: 32px;
  background:
    radial-gradient(circle at 82% 18%, rgba(236, 72, 153, 0.18), transparent 28rem),
    linear-gradient(135deg, rgba(15, 23, 42, 0.86), rgba(2, 6, 23, 0.88));
  box-shadow: var(--shadow);
}

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

.compact-hero p {
  max-width: 820px;
  margin: 16px 0 0;
  font-size: 18px;
}

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

.category-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-card);
}

.category-preview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  height: 150px;
  overflow: hidden;
}

.category-preview a {
  overflow: hidden;
}

.category-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.55s ease;
}

.category-card-body {
  padding: 22px;
}

.category-card-body h2 {
  margin: 0 0 8px;
}

.filter-bar {
  display: flex;
  gap: 14px;
  margin-bottom: 24px;
}

.filter-bar input {
  flex: 1;
  min-width: 0;
  padding: 13px 15px;
}

.filter-bar select {
  width: 180px;
  padding: 13px 15px;
}

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

.rank-card {
  display: grid;
  grid-template-columns: 72px 180px 1fr;
  gap: 20px;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-card);
}

.rank-number {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--purple), var(--pink));
  font-size: 24px;
  font-weight: 900;
}

.rank-cover {
  overflow: hidden;
  border-radius: 16px;
  aspect-ratio: 16 / 10;
}

.rank-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.55s ease;
}

.rank-info h2 {
  margin: 0 0 8px;
  font-size: 24px;
}

.rank-info p {
  margin: 0 0 12px;
}

.search-page {
  min-height: 520px;
}

.search-panel {
  justify-content: flex-start;
  margin-bottom: 24px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-card);
}

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

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 28px;
  padding-top: 34px;
}

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

.breadcrumb a {
  color: #c084fc;
}

.player-card,
.detail-section,
.detail-meta-card {
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--bg-card-strong);
  box-shadow: var(--shadow);
}

.player-card {
  padding: 24px;
}

.player-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

.player-title-row h1 {
  margin-top: 8px;
  font-size: clamp(30px, 4vw, 50px);
}

.player-shell {
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  background: #000;
  aspect-ratio: 16 / 9;
}

.movie-player {
  width: 100%;
  height: 100%;
  background: #000;
}

.play-layer {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border: 0;
  background:
    radial-gradient(circle at center, rgba(168, 85, 247, 0.22), transparent 24rem),
    rgba(2, 6, 23, 0.18);
  cursor: pointer;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.play-layer span {
  width: 92px;
  height: 92px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  padding-left: 6px;
  color: #fff;
  font-size: 36px;
  background: linear-gradient(135deg, var(--purple), var(--pink));
  box-shadow: 0 22px 60px rgba(168, 85, 247, 0.44);
}

.play-layer.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.detail-one-line {
  margin: 18px 0 0;
  font-size: 18px;
}

.detail-section {
  margin-top: 24px;
  padding: 26px;
}

.detail-section h2 {
  margin-bottom: 12px;
  font-size: 28px;
}

.detail-section p {
  margin: 0;
  font-size: 17px;
}

.detail-aside {
  position: sticky;
  top: 96px;
  align-self: start;
}

.detail-aside > img {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 26px;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  background: var(--bg-soft);
  box-shadow: var(--shadow);
}

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

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

.detail-meta-card dl {
  display: grid;
  gap: 12px;
  margin: 0;
}

.detail-meta-card dl div {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
}

.detail-meta-card dt {
  color: var(--muted);
}

.detail-meta-card dd {
  margin: 0;
}

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

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

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

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

.footer-brand {
  margin-bottom: 16px;
}

.site-footer h2 {
  margin: 0 0 14px;
  font-size: 18px;
}

.footer-links {
  display: grid;
  gap: 8px;
}

.footer-links a {
  color: var(--muted);
}

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

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

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

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

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

  .detail-aside {
    position: static;
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 18px;
  }

  .detail-aside > img {
    aspect-ratio: 3 / 4;
  }

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

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

  .menu-toggle {
    display: inline-grid;
    place-items: center;
    margin-left: auto;
  }

  .brand-text {
    font-size: 18px;
  }

  .hero-slider,
  .hero-slide > img {
    min-height: 620px;
  }

  .hero-content {
    bottom: 76px;
  }

  .hero-actions,
  .player-title-row,
  .section-heading,
  .filter-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .home-search-panel {
    grid-template-columns: 1fr;
    margin-top: 22px;
  }

  .home-search-panel form,
  .search-panel {
    flex-direction: column;
    align-items: stretch;
  }

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

  .movie-card-wide {
    grid-template-columns: 1fr;
  }

  .rank-card {
    grid-template-columns: 54px 120px 1fr;
    gap: 14px;
  }

  .rank-info h2 {
    font-size: 20px;
  }

  .page-hero {
    padding: 34px 24px;
  }

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

  .detail-aside > img {
    max-width: 360px;
  }
}

@media (max-width: 560px) {
  .header-inner,
  .mobile-panel,
  .home-search-panel,
  .section-wrap,
  .page-hero,
  .detail-layout,
  .footer-grid {
    width: min(100% - 22px, 1280px);
  }

  .brand-mark {
    width: 34px;
    height: 34px;
  }

  .brand-text {
    max-width: 168px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .hero-slider,
  .hero-slide > img {
    min-height: 590px;
  }

  .hero-content h1 {
    font-size: 38px;
  }

  .movie-grid,
  .search-results,
  .category-tile-grid,
  .category-card-grid,
  .footer-grid,
  .related-grid {
    grid-template-columns: 1fr;
  }

  .rank-card {
    grid-template-columns: 44px 1fr;
  }

  .rank-cover {
    grid-column: 1 / -1;
  }

  .filter-bar select {
    width: 100%;
  }
}
