* {
  box-sizing: border-box;
}

:root {
  color-scheme: dark;
  --bg: #08111f;
  --bg-soft: #0f1c2d;
  --panel: rgba(15, 23, 42, 0.82);
  --panel-strong: #111c2f;
  --text: #f8fafc;
  --muted: #94a3b8;
  --line: rgba(148, 163, 184, 0.18);
  --cyan: #22d3ee;
  --cyan-strong: #0891b2;
  --cyan-soft: rgba(34, 211, 238, 0.16);
  --amber: #f59e0b;
  --radius: 20px;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.36);
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(34, 211, 238, 0.16), transparent 34rem),
    radial-gradient(circle at bottom right, rgba(99, 102, 241, 0.16), transparent 30rem),
    linear-gradient(180deg, #08111f 0%, #111827 46%, #08111f 100%);
  color: var(--text);
}

body.menu-open {
  overflow: hidden;
}

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

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: linear-gradient(90deg, rgba(15, 23, 42, 0.96), rgba(30, 41, 59, 0.96), rgba(15, 23, 42, 0.96));
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.28);
}

.nav-wrap {
  max-width: 1240px;
  height: 72px;
  margin: 0 auto;
  padding: 0 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

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

.brand-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: #03111f;
  background: linear-gradient(135deg, var(--cyan), #67e8f9);
  box-shadow: 0 0 30px rgba(34, 211, 238, 0.36);
  font-weight: 900;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand-text strong {
  font-size: 1.35rem;
  letter-spacing: 0.04em;
}

.brand-text small {
  margin-top: 4px;
  color: #67e8f9;
  font-size: 0.75rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 18px;
  overflow: hidden;
  white-space: nowrap;
}

.nav-link {
  color: #cbd5e1;
  font-size: 0.94rem;
  font-weight: 600;
  transition: color 0.2s ease, transform 0.2s ease;
}

.nav-link:hover,
.nav-link.is-active {
  color: var(--cyan);
  transform: translateY(-1px);
}

.menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 12px;
  background: rgba(148, 163, 184, 0.14);
  color: white;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
}

.menu-toggle span {
  width: 20px;
  height: 2px;
  background: currentColor;
  border-radius: 99px;
}

.mobile-panel {
  display: none;
  border-top: 1px solid var(--line);
  padding: 14px 22px 22px;
  background: rgba(15, 23, 42, 0.98);
}

.mobile-panel.is-open {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.mobile-link {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: #dbeafe;
  background: rgba(15, 23, 42, 0.72);
}

.mobile-link:hover,
.mobile-link.is-active {
  border-color: rgba(34, 211, 238, 0.58);
  color: var(--cyan);
}

main {
  min-height: 70vh;
}

.hero-slider {
  position: relative;
  min-height: clamp(560px, 76vh, 760px);
  overflow: hidden;
  background: #06101f;
}

.hero-track,
.hero-slide {
  position: absolute;
  inset: 0;
}

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

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

.hero-slide::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(8, 17, 31, 0.98) 0%, rgba(8, 17, 31, 0.74) 44%, rgba(8, 17, 31, 0.28) 100%),
    radial-gradient(circle at 18% 30%, rgba(34, 211, 238, 0.24), transparent 30rem);
  z-index: 1;
}

.hero-visual {
  position: absolute;
  inset: 0;
  background-image: var(--hero-image), linear-gradient(135deg, #172554, #0f172a);
  background-size: cover;
  background-position: center;
  transform: scale(1.04);
  filter: saturate(1.08) contrast(1.05);
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 760px;
  margin-left: max(24px, calc((100vw - 1240px) / 2));
  padding: 90px 24px 120px;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--cyan);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-size: 0.78rem;
  font-weight: 800;
}

.hero-content h1,
.page-hero h1,
.detail-hero h1 {
  margin: 0;
  font-size: clamp(2.6rem, 7vw, 5.8rem);
  line-height: 0.98;
  letter-spacing: -0.06em;
}

.hero-text,
.page-hero p,
.detail-lead {
  max-width: 710px;
  color: #cbd5e1;
  font-size: clamp(1rem, 1.6vw, 1.22rem);
  line-height: 1.85;
}

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

.hero-tags span,
.detail-tags span {
  padding: 7px 12px;
  border-radius: 999px;
  color: #cffafe;
  background: rgba(8, 145, 178, 0.2);
  border: 1px solid rgba(34, 211, 238, 0.28);
  font-size: 0.86rem;
}

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

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

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  color: #04111f;
  background: linear-gradient(135deg, var(--cyan), #67e8f9);
  box-shadow: 0 12px 35px rgba(34, 211, 238, 0.28);
}

.btn-secondary {
  color: white;
  background: rgba(15, 23, 42, 0.74);
  border: 1px solid rgba(34, 211, 238, 0.38);
}

.btn-ghost {
  color: #dbeafe;
  background: rgba(148, 163, 184, 0.12);
  border: 1px solid rgba(148, 163, 184, 0.22);
}

.hero-controls {
  position: absolute;
  left: 50%;
  bottom: 28px;
  z-index: 4;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(15, 23, 42, 0.68);
  backdrop-filter: blur(14px);
}

.hero-controls button {
  border: 0;
  color: white;
  background: transparent;
}

.hero-controls > button {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(148, 163, 184, 0.16);
  font-size: 1.6rem;
  line-height: 1;
}

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

.hero-dot {
  width: 10px;
  height: 10px;
  padding: 0;
  border-radius: 999px;
  opacity: 0.45;
  background: white;
  transition: width 0.2s ease, opacity 0.2s ease, background 0.2s ease;
}

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

.section-wrap {
  width: min(1240px, calc(100% - 44px));
  margin: 0 auto;
  padding: 58px 0;
}

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

.section-head h2,
.site-footer h2,
.detail-block h2 {
  margin: 0;
  font-size: clamp(1.55rem, 2.4vw, 2.35rem);
  letter-spacing: -0.04em;
}

.section-head p:not(.eyebrow),
.center-head p,
.detail-block p {
  color: var(--muted);
  line-height: 1.82;
}

.center-head {
  justify-content: center;
  text-align: center;
}

.text-link {
  color: var(--cyan);
  font-weight: 800;
}

.text-link:hover {
  color: #67e8f9;
}

.quick-search {
  padding-bottom: 20px;
}

.home-search,
.search-box {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid rgba(34, 211, 238, 0.24);
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.74);
  box-shadow: var(--shadow);
}

.home-search {
  max-width: 820px;
  margin: 28px auto 0;
  padding: 0 20px;
  height: 62px;
}

.search-box {
  flex: 1 1 320px;
  padding: 0 16px;
  height: 52px;
  box-shadow: none;
}

.home-search input,
.search-box input {
  width: 100%;
  height: 100%;
  border: 0;
  outline: 0;
  color: white;
  background: transparent;
}

.home-search input::placeholder,
.search-box input::placeholder {
  color: #64748b;
}

.search-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 28px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(15, 23, 42, 0.54);
}

.filter-chips {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-chips button {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  color: #cbd5e1;
  background: rgba(148, 163, 184, 0.1);
}

.filter-chips button.is-active,
.filter-chips button:hover {
  color: #04111f;
  border-color: transparent;
  background: var(--cyan);
}

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

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

.category-tile {
  min-height: 190px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: end;
  gap: 10px;
  position: relative;
  isolation: isolate;
  background-image: var(--cover-image), linear-gradient(135deg, #172554, #0f172a);
  background-size: cover;
  background-position: center;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.22);
}

.category-tile::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, rgba(2, 6, 23, 0.12), rgba(2, 6, 23, 0.9));
}

.category-tile span {
  font-size: 1.3rem;
  font-weight: 900;
}

.category-tile strong {
  color: #cbd5e1;
  font-size: 0.88rem;
  font-weight: 500;
  line-height: 1.6;
}

.category-tile:hover {
  transform: translateY(-3px);
  border-color: rgba(34, 211, 238, 0.42);
}

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

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

.movie-card {
  min-width: 0;
}

.movie-cover {
  position: relative;
  display: block;
  aspect-ratio: 2 / 3;
  border-radius: 16px;
  overflow: hidden;
  background-image: var(--cover-image), linear-gradient(135deg, #172554, #0f172a 55%, #083344);
  background-size: cover;
  background-position: center;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
  transition: transform 0.28s ease, box-shadow 0.28s ease;
}

.movie-cover::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 30%, rgba(2, 6, 23, 0.72));
  opacity: 0.82;
  transition: opacity 0.28s ease;
}

.movie-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.42);
  opacity: 0;
  transition: opacity 0.28s ease;
}

.movie-card:hover .movie-cover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
}

.movie-card:hover .movie-cover::after {
  opacity: 1;
}

.cover-play {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0.84);
  display: grid;
  place-items: center;
  color: #06101f;
  background: rgba(255, 255, 255, 0.92);
  opacity: 0;
  transition: transform 0.24s ease, opacity 0.24s ease;
  font-weight: 900;
}

.movie-card:hover .cover-play {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.rank-badge {
  position: absolute;
  left: 10px;
  top: 10px;
  z-index: 3;
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #04111f;
  background: linear-gradient(135deg, #fbbf24, #f97316);
  font-weight: 900;
}

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

.movie-card h3 {
  margin: 0;
  min-height: 2.8em;
  font-size: 1rem;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.movie-card h3 a:hover {
  color: var(--cyan);
}

.movie-meta {
  margin: 8px 0 0;
  color: #94a3b8;
  font-size: 0.85rem;
}

.movie-line {
  margin: 8px 0 0;
  color: #64748b;
  font-size: 0.86rem;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ranking-band {
  width: 100%;
  max-width: none;
  padding: 64px max(22px, calc((100vw - 1240px) / 2));
  background: linear-gradient(135deg, rgba(8, 145, 178, 0.14), rgba(30, 41, 59, 0.52));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.page-hero,
.detail-hero {
  position: relative;
  overflow: hidden;
  min-height: 340px;
  display: flex;
  align-items: end;
  padding: 88px max(22px, calc((100vw - 1240px) / 2)) 54px;
  background-image:
    linear-gradient(90deg, rgba(8, 17, 31, 0.96), rgba(8, 17, 31, 0.64)),
    var(--hero-image),
    linear-gradient(135deg, #172554, #0f172a);
  background-size: cover;
  background-position: center;
}

.compact-hero {
  min-height: 300px;
}

.page-hero > div,
.detail-hero-inner {
  position: relative;
  z-index: 2;
  width: min(900px, 100%);
}

.breadcrumb {
  color: var(--cyan);
  font-weight: 700;
}

.detail-hero-inner > span {
  color: var(--muted);
  margin: 0 8px;
}

.detail-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 30px;
  align-items: start;
}

.detail-poster {
  position: sticky;
  top: 96px;
}

.poster-large {
  aspect-ratio: 2 / 3;
  border-radius: 22px;
  background-image: var(--cover-image), linear-gradient(135deg, #172554, #0f172a);
  background-size: cover;
  background-position: center;
  box-shadow: var(--shadow);
}

.poster-info {
  margin-top: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.68);
}

.poster-info p {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin: 0;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.poster-info p:last-child {
  border-bottom: 0;
}

.poster-info strong {
  color: #cbd5e1;
}

.poster-info span,
.poster-info a {
  color: var(--cyan);
  text-align: right;
}

.detail-main {
  min-width: 0;
}

.player-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(34, 211, 238, 0.2);
  border-radius: 24px;
  background: #020617;
  box-shadow: var(--shadow);
}

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

.play-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  border: 0;
  color: white;
  background:
    radial-gradient(circle at center, rgba(34, 211, 238, 0.18), transparent 18rem),
    rgba(2, 6, 23, 0.46);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  transition: opacity 0.24s ease, visibility 0.24s ease;
}

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

.play-circle {
  width: 78px;
  height: 78px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #04111f;
  background: linear-gradient(135deg, var(--cyan), #67e8f9);
  box-shadow: 0 0 60px rgba(34, 211, 238, 0.42);
  font-size: 1.7rem;
}

.player-message {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 14px;
  z-index: 3;
  color: #fecaca;
  text-align: center;
  pointer-events: none;
}

.detail-content {
  margin-top: 26px;
  display: grid;
  gap: 18px;
}

.detail-block {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(15, 23, 42, 0.62);
}

.detail-block h2 {
  margin-bottom: 14px;
}

.detail-block p {
  margin: 0 0 12px;
}

.detail-block p:last-child {
  margin-bottom: 0;
}

.site-footer {
  margin-top: 50px;
  padding: 54px max(22px, calc((100vw - 1240px) / 2)) 26px;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.6), #020617);
  border-top: 1px solid var(--line);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 34px;
}

.site-footer p {
  color: var(--muted);
  line-height: 1.8;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
}

.footer-links a {
  color: #cbd5e1;
}

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

.footer-bottom {
  margin-top: 34px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: #64748b;
}

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

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

  .menu-toggle {
    display: flex;
  }

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

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

  .detail-layout {
    grid-template-columns: 240px minmax(0, 1fr);
  }
}

@media (max-width: 780px) {
  .nav-wrap {
    height: 64px;
    padding: 0 16px;
  }

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

  .brand-text strong {
    font-size: 1.12rem;
  }

  .brand-text small {
    display: none;
  }

  .hero-slider {
    min-height: 650px;
  }

  .hero-slide::before {
    background: linear-gradient(180deg, rgba(8, 17, 31, 0.92), rgba(8, 17, 31, 0.76));
  }

  .hero-content {
    margin-left: 0;
    padding: 82px 22px 118px;
  }

  .section-wrap {
    width: min(100% - 28px, 1240px);
    padding: 42px 0;
  }

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

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

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

  .category-tile {
    min-height: 156px;
  }

  .page-hero,
  .detail-hero {
    min-height: 290px;
    padding: 72px 18px 38px;
  }

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

  .detail-poster {
    position: static;
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr);
    gap: 14px;
  }

  .poster-info {
    margin-top: 0;
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }

  .footer-bottom {
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .mobile-panel.is-open {
    grid-template-columns: 1fr;
  }

  .hero-actions,
  .search-panel {
    flex-direction: column;
    align-items: stretch;
  }

  .btn {
    width: 100%;
  }

  .category-grid,
  .large-category-grid {
    grid-template-columns: 1fr;
  }

  .movie-card h3 {
    font-size: 0.94rem;
  }

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

  .poster-large {
    max-width: 220px;
  }
}
