:root {
  --bg: #020617;
  --bg-soft: #0f172a;
  --bg-card: rgba(15, 23, 42, 0.82);
  --bg-card-solid: #111827;
  --line: rgba(148, 163, 184, 0.18);
  --text: #f8fafc;
  --muted: #94a3b8;
  --muted-2: #cbd5e1;
  --blue: #3b82f6;
  --blue-deep: #1d4ed8;
  --purple: #9333ea;
  --cyan: #22d3ee;
  --pink: #e879f9;
  --radius: 22px;
  --shadow: 0 24px 70px rgba(2, 6, 23, 0.45);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(59, 130, 246, 0.18), transparent 34rem),
    radial-gradient(circle at top right, rgba(147, 51, 234, 0.16), transparent 32rem),
    linear-gradient(180deg, #020617 0%, #0f172a 52%, #020617 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

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

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

button,
input,
select {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
  background: rgba(2, 6, 23, 0.82);
  backdrop-filter: blur(20px);
}

.header-inner,
.footer-inner,
.main-wrap {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

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

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

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 14px;
  color: white;
  background: linear-gradient(135deg, var(--blue), var(--purple));
  box-shadow: 0 12px 28px rgba(59, 130, 246, 0.3);
}

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

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

.nav-link,
.mobile-nav-link {
  color: var(--muted-2);
  border-radius: 999px;
  transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.nav-link {
  padding: 9px 14px;
}

.nav-link:hover,
.nav-link.active,
.mobile-nav-link:hover,
.mobile-nav-link.active {
  color: #fff;
  background: rgba(59, 130, 246, 0.18);
}

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

.header-search input,
.mobile-search input,
.local-search input,
.search-large input {
  width: 100%;
  color: #fff;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 999px;
  outline: none;
  background: rgba(15, 23, 42, 0.78);
  transition: border 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.header-search input {
  width: 250px;
  padding: 10px 16px;
}

.header-search input:focus,
.mobile-search input:focus,
.local-search input:focus,
.search-large input:focus {
  border-color: rgba(96, 165, 250, 0.85);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.16);
  background: rgba(15, 23, 42, 0.95);
}

.header-search button,
.mobile-search button,
.hero-actions a,
.hero-actions button,
.search-large button,
.play-button-link,
.primary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #fff;
  border: 0;
  border-radius: 999px;
  padding: 10px 16px;
  background: linear-gradient(135deg, var(--blue), var(--purple));
  box-shadow: 0 14px 32px rgba(59, 130, 246, 0.28);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.header-search button:hover,
.mobile-search button:hover,
.hero-actions a:hover,
.hero-actions button:hover,
.search-large button:hover,
.play-button-link:hover,
.primary-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 42px rgba(147, 51, 234, 0.32);
}

.menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  margin-left: auto;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.78);
}

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

.mobile-panel {
  display: none;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
  padding: 12px 16px 18px;
  background: rgba(2, 6, 23, 0.94);
}

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

.mobile-panel nav {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.mobile-nav-link {
  padding: 10px 12px;
}

.mobile-search input {
  padding: 10px 14px;
}

.hero-carousel {
  position: relative;
  min-height: 680px;
  overflow: hidden;
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
}

.hero-slide {
  position: absolute;
  inset: 0;
  display: grid;
  align-items: center;
  opacity: 0;
  visibility: hidden;
  background-position: center;
  background-size: cover;
  transition: opacity 0.7s ease, visibility 0.7s ease;
}

.hero-slide.active {
  opacity: 1;
  visibility: visible;
}

.hero-slide::before {
  position: absolute;
  inset: 0;
  content: "";
  background:
    linear-gradient(90deg, rgba(2, 6, 23, 0.95) 0%, rgba(2, 6, 23, 0.68) 48%, rgba(2, 6, 23, 0.45) 100%),
    radial-gradient(circle at 72% 34%, rgba(59, 130, 246, 0.26), transparent 28rem);
}

.hero-content {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) 360px;
  gap: 54px;
  align-items: center;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 88px 0 112px;
}

.hero-kicker,
.section-kicker,
.detail-kicker {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  color: #bfdbfe;
  border: 1px solid rgba(96, 165, 250, 0.25);
  border-radius: 999px;
  padding: 7px 12px;
  background: rgba(59, 130, 246, 0.13);
  font-size: 0.88rem;
  font-weight: 700;
}

.hero-title {
  max-width: 780px;
  margin: 0 0 18px;
  font-size: clamp(2.5rem, 7vw, 5.8rem);
  line-height: 0.95;
  font-weight: 900;
  letter-spacing: -0.06em;
}

.hero-summary {
  max-width: 700px;
  color: #dbeafe;
  font-size: clamp(1rem, 1.8vw, 1.25rem);
  line-height: 1.85;
}

.hero-meta,
.detail-meta,
.card-meta-line {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0;
  color: #dbeafe;
}

.hero-meta span,
.detail-meta span,
.card-meta-line span {
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 999px;
  padding: 7px 12px;
  background: rgba(15, 23, 42, 0.56);
}

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

.hero-actions .ghost-link,
.primary-link.ghost-link {
  border: 1px solid rgba(148, 163, 184, 0.26);
  background: rgba(15, 23, 42, 0.72);
  box-shadow: none;
}

.hero-poster-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 30px;
  background: rgba(15, 23, 42, 0.48);
  box-shadow: var(--shadow);
}

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

.hero-poster-caption {
  position: absolute;
  right: 18px;
  bottom: 18px;
  left: 18px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 18px;
  padding: 14px;
  background: rgba(2, 6, 23, 0.68);
  backdrop-filter: blur(14px);
}

.hero-poster-caption strong {
  display: block;
  margin-bottom: 3px;
}

.hero-poster-caption span {
  color: var(--muted-2);
  font-size: 0.9rem;
}

.hero-controls {
  position: absolute;
  z-index: 5;
  right: calc((100% - min(1180px, calc(100% - 32px))) / 2);
  bottom: 34px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.hero-control,
.hero-dot {
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: rgba(15, 23, 42, 0.74);
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.hero-control {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 50%;
  color: white;
}

.hero-dot {
  width: 32px;
  height: 6px;
  border-radius: 999px;
  padding: 0;
}

.hero-control:hover,
.hero-dot:hover,
.hero-dot.active {
  background: linear-gradient(135deg, var(--blue), var(--purple));
  transform: translateY(-1px);
}

.section,
.detail-page,
.category-page,
.search-page {
  padding: 58px 0;
}

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

.section-title,
.page-title,
.detail-title {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1.05;
  font-weight: 900;
  letter-spacing: -0.04em;
}

.section-desc,
.page-desc,
.detail-lead {
  max-width: 760px;
  margin: 12px 0 0;
  color: var(--muted-2);
  line-height: 1.85;
}

.section-link {
  color: #bfdbfe;
  font-weight: 800;
}

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

.movie-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: var(--radius);
  background: var(--bg-card);
  box-shadow: 0 16px 42px rgba(2, 6, 23, 0.25);
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.movie-card:hover {
  transform: translateY(-6px);
  border-color: rgba(96, 165, 250, 0.38);
  box-shadow: 0 26px 62px rgba(2, 6, 23, 0.36);
}

.poster-link {
  position: relative;
  display: block;
  overflow: hidden;
  background: #0f172a;
}

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

.movie-card:hover .poster-link img {
  transform: scale(1.08);
  filter: saturate(1.06) contrast(1.04);
}

.poster-shadow {
  position: absolute;
  inset: auto 0 0;
  height: 44%;
  background: linear-gradient(0deg, rgba(2, 6, 23, 0.86), transparent);
}

.poster-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  border-radius: 999px;
  padding: 5px 10px;
  color: #fff;
  background: rgba(2, 6, 23, 0.72);
  backdrop-filter: blur(10px);
  font-size: 0.78rem;
  font-weight: 800;
}

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

.movie-title {
  display: -webkit-box;
  min-height: 2.8em;
  overflow: hidden;
  color: #fff;
  font-size: 1rem;
  font-weight: 850;
  line-height: 1.4;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.movie-title:hover {
  color: #bfdbfe;
}

.movie-meta,
.movie-one-line {
  color: var(--muted);
  font-size: 0.86rem;
}

.movie-meta {
  margin: 8px 0 7px;
}

.movie-one-line {
  display: -webkit-box;
  min-height: 3.6em;
  overflow: hidden;
  line-height: 1.75;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.movie-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}

.tag-pill {
  display: inline-flex;
  max-width: 100%;
  align-items: center;
  border: 1px solid rgba(96, 165, 250, 0.22);
  border-radius: 999px;
  padding: 4px 8px;
  color: #bfdbfe;
  background: rgba(59, 130, 246, 0.1);
  font-size: 0.76rem;
}

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

.category-card {
  position: relative;
  overflow: hidden;
  min-height: 220px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 26px;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(59, 130, 246, 0.18), rgba(147, 51, 234, 0.12)),
    rgba(15, 23, 42, 0.82);
  box-shadow: 0 20px 48px rgba(2, 6, 23, 0.22);
  transition: transform 0.25s ease, border-color 0.25s ease;
}

.category-card:hover {
  transform: translateY(-5px);
  border-color: rgba(125, 211, 252, 0.35);
}

.category-card h2,
.category-card h3 {
  margin: 0 0 12px;
  font-size: 1.45rem;
  font-weight: 850;
}

.category-card p {
  color: var(--muted-2);
  line-height: 1.8;
}

.category-card span {
  display: inline-flex;
  margin-top: 18px;
  color: #bfdbfe;
  font-weight: 800;
}

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

.rank-panel {
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 26px;
  padding: 18px;
  background: rgba(15, 23, 42, 0.74);
  box-shadow: 0 20px 48px rgba(2, 6, 23, 0.2);
}

.rank-panel h2,
.rank-panel h3 {
  margin: 0 0 16px;
  font-size: 1.25rem;
  font-weight: 850;
}

.rank-list {
  display: grid;
  gap: 12px;
}

.rank-item {
  display: grid;
  grid-template-columns: 42px 58px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  border-radius: 18px;
  padding: 10px;
  background: rgba(2, 6, 23, 0.38);
  transition: background 0.2s ease, transform 0.2s ease;
}

.rank-item:hover {
  background: rgba(59, 130, 246, 0.16);
  transform: translateX(4px);
}

.rank-number {
  color: #bfdbfe;
  font-size: 1.2rem;
  font-weight: 900;
}

.rank-item img {
  width: 58px;
  aspect-ratio: 2 / 3;
  border-radius: 12px;
  object-fit: cover;
}

.rank-copy {
  min-width: 0;
}

.rank-copy strong,
.rank-copy em {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-copy strong {
  color: #fff;
  font-weight: 800;
}

.rank-copy em {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.84rem;
  font-style: normal;
}

.toolbar {
  display: grid;
  gap: 14px;
  margin: 24px 0 26px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 24px;
  padding: 16px;
  background: rgba(15, 23, 42, 0.58);
}

.local-search input,
.search-large input {
  padding: 14px 18px;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.filter-chip {
  color: #dbeafe;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(15, 23, 42, 0.8);
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.filter-chip:hover,
.filter-chip.active {
  color: #fff;
  border-color: rgba(96, 165, 250, 0.55);
  background: rgba(59, 130, 246, 0.28);
}

.hidden-by-filter,
.hidden-by-search {
  display: none !important;
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
  color: var(--muted);
  font-size: 0.92rem;
}

.breadcrumbs a:hover {
  color: #bfdbfe;
}

.detail-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) 340px;
  gap: 32px;
  align-items: start;
}

.player-box {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 28px;
  background: #000;
  box-shadow: var(--shadow);
  aspect-ratio: 16 / 9;
}

.video-player {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
}

.play-cover {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  gap: 14px;
  color: white;
  border: 0;
  background:
    linear-gradient(180deg, rgba(2, 6, 23, 0.18), rgba(2, 6, 23, 0.75)),
    rgba(2, 6, 23, 0.2);
  cursor: pointer;
}

.play-cover.is-hidden {
  display: none;
}

.play-icon {
  display: grid;
  width: 86px;
  height: 86px;
  place-items: center;
  border-radius: 50%;
  color: white;
  background: linear-gradient(135deg, var(--blue), var(--purple));
  box-shadow: 0 20px 44px rgba(59, 130, 246, 0.38);
  font-size: 2rem;
}

.play-cover strong {
  border-radius: 999px;
  padding: 9px 16px;
  background: rgba(15, 23, 42, 0.72);
}

.detail-side {
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 26px;
  padding: 18px;
  background: rgba(15, 23, 42, 0.74);
}

.detail-side img {
  width: 100%;
  border-radius: 20px;
  aspect-ratio: 2 / 3;
  object-fit: cover;
}

.detail-side dl {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 10px 12px;
  margin: 18px 0 0;
  color: var(--muted-2);
}

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

.detail-content {
  display: grid;
  gap: 24px;
  margin-top: 32px;
}

.content-panel {
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 26px;
  padding: 26px;
  background: rgba(15, 23, 42, 0.72);
}

.content-panel h2 {
  margin: 0 0 12px;
  font-size: 1.45rem;
  font-weight: 850;
}

.content-panel p {
  margin: 0;
  color: var(--muted-2);
  line-height: 2;
}

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

.search-hero {
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 30px;
  padding: clamp(24px, 6vw, 54px);
  background:
    linear-gradient(135deg, rgba(59, 130, 246, 0.18), rgba(147, 51, 234, 0.13)),
    rgba(15, 23, 42, 0.78);
  box-shadow: var(--shadow);
}

.search-large {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

.search-results {
  margin-top: 32px;
}

.empty-state {
  border: 1px dashed rgba(148, 163, 184, 0.25);
  border-radius: 24px;
  padding: 30px;
  color: var(--muted-2);
  text-align: center;
}

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

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

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

  .hero-poster-card,
  .detail-side {
    max-width: 380px;
  }
}

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

  .menu-toggle {
    display: block;
  }

  .header-inner {
    min-height: 64px;
  }

  .hero-carousel {
    min-height: 760px;
  }

  .hero-content {
    gap: 28px;
    padding: 58px 0 96px;
  }

  .hero-controls {
    right: 16px;
    bottom: 22px;
  }

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

@media (max-width: 700px) {
  .movie-grid,
  .related-grid,
  .category-grid,
  .rank-layout {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }

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

  .movie-one-line,
  .movie-tags {
    display: none;
  }

  .hero-title {
    letter-spacing: -0.04em;
  }

  .search-large {
    flex-direction: column;
  }

  .content-panel {
    padding: 20px;
  }
}

@media (max-width: 460px) {
  .header-inner,
  .footer-inner,
  .main-wrap,
  .hero-content {
    width: min(100% - 22px, 1180px);
  }

  .movie-grid,
  .related-grid,
  .category-grid,
  .rank-layout {
    grid-template-columns: 1fr;
  }

  .brand-text {
    font-size: 1rem;
  }
}
