:root {
  color-scheme: dark;
  --bg: #020617;
  --bg-soft: #0f172a;
  --panel: rgba(15, 23, 42, 0.74);
  --panel-strong: rgba(15, 23, 42, 0.92);
  --line: rgba(148, 163, 184, 0.18);
  --text: #f8fafc;
  --muted: #94a3b8;
  --soft: #cbd5e1;
  --sky: #38bdf8;
  --blue: #2563eb;
  --amber: #f59e0b;
  --radius: 22px;
  --shadow: 0 22px 70px rgba(2, 8, 23, 0.48);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(56, 189, 248, 0.12), transparent 34rem),
    linear-gradient(180deg, #020617 0%, #0f172a 52%, #020617 100%);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  line-height: 1.6;
}

body.menu-open {
  overflow: hidden;
}

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

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

button,
input,
select {
  font: inherit;
}

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

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

.site-header-inner {
  width: min(1240px, calc(100% - 32px));
  height: 76px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
}

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

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--sky), var(--blue));
  box-shadow: 0 12px 30px rgba(37, 99, 235, 0.34);
}

.brand-text strong {
  display: block;
  font-size: 22px;
  line-height: 1.1;
  letter-spacing: 0.02em;
  background: linear-gradient(90deg, #e0f2fe, #93c5fd);
  -webkit-background-clip: text;
  color: transparent;
}

.brand-text small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.desktop-nav {
  display: flex;
  align-items: center;
  gap: 5px;
  overflow-x: auto;
  scrollbar-width: none;
}

.desktop-nav::-webkit-scrollbar {
  display: none;
}

.nav-link,
.mobile-link {
  color: var(--soft);
  font-size: 14px;
  font-weight: 650;
  transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.nav-link {
  padding: 10px 12px;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}

.nav-link:hover,
.nav-link.is-active {
  color: #7dd3fc;
  border-color: #38bdf8;
}

.menu-button {
  width: 44px;
  height: 44px;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(15, 23, 42, 0.82);
  color: var(--text);
  cursor: pointer;
}

.menu-button span {
  width: 19px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.mobile-nav {
  display: none;
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
  padding: 0 0 16px;
}

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

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

.mobile-link:hover,
.mobile-link.is-active {
  color: #7dd3fc;
  background: rgba(14, 165, 233, 0.16);
}

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

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.9s ease;
}

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

.hero-slide img,
.detail-bg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background:
    linear-gradient(135deg, rgba(14, 165, 233, 0.16), rgba(37, 99, 235, 0.08)),
    #0f172a;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(2, 6, 23, 0.98) 0%, rgba(2, 6, 23, 0.78) 42%, rgba(2, 6, 23, 0.18) 100%),
    linear-gradient(0deg, #020617 0%, transparent 45%);
}

.hero-content {
  position: absolute;
  left: max(32px, calc((100% - 1180px) / 2));
  bottom: 118px;
  max-width: 720px;
  z-index: 2;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 13px;
  border-radius: 999px;
  background: rgba(14, 165, 233, 0.2);
  color: #bae6fd;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.hero-content h1,
.page-hero h1,
.detail-info h1 {
  margin: 18px 0 16px;
  font-size: clamp(34px, 6vw, 64px);
  line-height: 1.08;
  letter-spacing: -0.05em;
}

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

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

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

.primary-button,
.search-panel button {
  border: 0;
  background: linear-gradient(135deg, var(--sky), var(--blue));
  color: white;
  box-shadow: 0 16px 34px rgba(37, 99, 235, 0.34);
  cursor: pointer;
}

.ghost-button {
  border: 1px solid rgba(226, 232, 240, 0.22);
  background: rgba(15, 23, 42, 0.65);
  color: #e2e8f0;
}

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

.hero-arrow {
  position: absolute;
  top: 50%;
  z-index: 5;
  width: 46px;
  height: 46px;
  transform: translateY(-50%);
  border: 1px solid rgba(226, 232, 240, 0.18);
  border-radius: 999px;
  background: rgba(2, 6, 23, 0.56);
  color: white;
  font-size: 34px;
  line-height: 1;
  cursor: pointer;
}

.hero-prev {
  left: 22px;
}

.hero-next {
  right: 22px;
}

.hero-dots {
  position: absolute;
  left: 50%;
  bottom: 36px;
  z-index: 5;
  display: flex;
  gap: 8px;
  transform: translateX(-50%);
}

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

.hero-dot.is-active {
  width: 34px;
  background: white;
}

.hero-search {
  position: absolute;
  left: max(32px, calc((100% - 1180px) / 2));
  right: max(32px, calc((100% - 1180px) / 2));
  bottom: 34px;
  z-index: 4;
  display: flex;
  max-width: 520px;
  border: 1px solid rgba(226, 232, 240, 0.16);
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.74);
  backdrop-filter: blur(16px);
  overflow: hidden;
}

.hero-search input,
.search-panel input,
.toolbar input,
.toolbar select {
  width: 100%;
  border: 0;
  outline: none;
  background: rgba(15, 23, 42, 0.86);
  color: var(--text);
}

.hero-search input {
  padding: 15px 18px;
}

.hero-search button {
  border: 0;
  padding: 0 20px;
  background: rgba(14, 165, 233, 0.92);
  color: white;
  font-weight: 800;
  cursor: pointer;
}

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

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

.section-kicker {
  color: var(--sky);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.section-heading h2 {
  margin: 5px 0 0;
  font-size: clamp(26px, 3vw, 36px);
  line-height: 1.2;
}

.section-more {
  flex: none;
  color: #7dd3fc;
  font-weight: 800;
}

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

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

.movie-card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 18px 50px rgba(2, 8, 23, 0.18);
  overflow: hidden;
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.movie-card:hover {
  transform: translateY(-5px);
  border-color: rgba(56, 189, 248, 0.42);
  box-shadow: var(--shadow);
}

.movie-card-wide {
  display: grid;
  grid-template-columns: 180px 1fr;
  min-height: 178px;
}

.poster-link {
  display: block;
  height: 100%;
}

.poster-frame {
  position: relative;
  display: block;
  aspect-ratio: 16 / 10;
  min-height: 162px;
  overflow: hidden;
  background:
    radial-gradient(circle at top left, rgba(14, 165, 233, 0.22), transparent 36%),
    linear-gradient(135deg, #1e293b, #020617);
}

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

.poster-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.96;
  transition: transform 0.35s ease, opacity 0.35s ease;
}

.movie-card:hover .poster-frame img {
  transform: scale(1.06);
  opacity: 0.82;
}

.play-badge {
  position: absolute;
  inset: auto 14px 14px auto;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(14, 165, 233, 0.86);
  color: white;
  box-shadow: 0 12px 28px rgba(14, 165, 233, 0.3);
}

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

.movie-card-meta,
.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.movie-card h2 {
  margin: 9px 0 8px;
  color: white;
  font-size: 18px;
  line-height: 1.35;
}

.movie-card h2 a:hover {
  color: #7dd3fc;
}

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

.movie-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 15px;
  color: #7dd3fc;
  font-size: 13px;
  font-weight: 800;
}

.rating {
  color: var(--amber);
  font-weight: 900;
}

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

.category-chip,
.category-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(14, 165, 233, 0.12), transparent),
    rgba(15, 23, 42, 0.78);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.category-chip {
  min-height: 148px;
  padding: 22px;
}

.category-chip:hover,
.category-panel:hover {
  transform: translateY(-4px);
  border-color: rgba(56, 189, 248, 0.42);
}

.category-chip span,
.category-panel-main span {
  display: block;
  margin-bottom: 10px;
  color: white;
  font-size: 20px;
  font-weight: 900;
}

.category-chip small,
.category-panel-main p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

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

.category-panel {
  padding: 22px;
}

.category-panel-links {
  display: grid;
  gap: 9px;
  margin-top: 18px;
}

.category-panel-links a {
  color: #bae6fd;
  font-size: 14px;
}

.page-hero,
.detail-hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at top right, rgba(14, 165, 233, 0.18), transparent 34rem),
    linear-gradient(135deg, #0f172a, #020617);
}

.compact-hero {
  padding: 76px 0 70px;
}

.ranking-hero {
  background:
    radial-gradient(circle at top left, rgba(245, 158, 11, 0.16), transparent 32rem),
    linear-gradient(135deg, #111827, #020617);
}

.search-hero {
  background:
    radial-gradient(circle at top left, rgba(34, 211, 238, 0.14), transparent 34rem),
    linear-gradient(135deg, #082f49, #020617);
}

.toolbar,
.search-panel {
  display: flex;
  align-items: end;
  gap: 14px;
  margin-bottom: 26px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(15, 23, 42, 0.62);
}

.toolbar label,
.search-panel label {
  display: grid;
  flex: 1;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.toolbar input,
.toolbar select,
.search-panel input {
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.simple-toolbar {
  justify-content: flex-end;
}

.simple-toolbar label {
  max-width: 240px;
}

.empty-state {
  display: none;
  padding: 56px;
  border: 1px solid var(--line);
  border-radius: 22px;
  color: var(--muted);
  text-align: center;
  background: rgba(15, 23, 42, 0.68);
}

.empty-state.is-visible {
  display: block;
}

.detail-hero {
  min-height: 620px;
}

.detail-bg,
.detail-mask {
  position: absolute;
  inset: 0;
}

.detail-bg {
  filter: blur(7px) saturate(1.05);
  transform: scale(1.04);
  opacity: 0.3;
}

.detail-mask {
  background:
    linear-gradient(90deg, rgba(2, 6, 23, 0.98), rgba(2, 6, 23, 0.72)),
    linear-gradient(0deg, #020617, transparent 60%);
}

.detail-layout {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 46px;
  align-items: center;
  min-height: 620px;
  padding: 54px 0;
}

.detail-poster {
  border: 1px solid var(--line);
  border-radius: 26px;
  background: rgba(15, 23, 42, 0.84);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.detail-poster img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  background: linear-gradient(135deg, #1e293b, #020617);
}

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

.breadcrumb a:hover {
  color: #7dd3fc;
}

.detail-meta {
  margin-top: 24px;
  font-size: 15px;
}

.detail-meta span {
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.68);
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 22px;
}

.tag-list span {
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.12);
  color: var(--soft);
  font-size: 13px;
}

.player-section {
  margin-top: -54px;
  position: relative;
  z-index: 5;
}

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

.video-player {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: black;
  cursor: pointer;
}

.player-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border: 0;
  background: linear-gradient(0deg, rgba(2, 6, 23, 0.4), rgba(2, 6, 23, 0.08));
  color: white;
  cursor: pointer;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.player-overlay span {
  width: 86px;
  height: 86px;
  display: grid;
  place-items: center;
  padding-left: 6px;
  border-radius: 50%;
  background: rgba(14, 165, 233, 0.9);
  box-shadow: 0 22px 46px rgba(14, 165, 233, 0.34);
  font-size: 34px;
}

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

.player-controls {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.player-shell:hover .player-controls,
.player-controls:focus-within {
  opacity: 1;
}

.player-controls button {
  min-height: 38px;
  border: 1px solid rgba(226, 232, 240, 0.18);
  border-radius: 12px;
  background: rgba(2, 6, 23, 0.68);
  color: white;
  cursor: pointer;
}

.player-toggle {
  width: 44px;
}

.player-mute,
.player-fullscreen {
  padding: 0 14px;
}

.detail-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  padding: 46px 0 0;
}

.text-panel {
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 26px;
  background: rgba(15, 23, 42, 0.68);
}

.text-panel h2 {
  margin: 0 0 12px;
  font-size: 23px;
}

.text-panel p {
  margin: 0;
  color: #cbd5e1;
  white-space: pre-wrap;
}

.detail-pager {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.detail-pager a {
  padding: 11px 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.68);
  color: #bae6fd;
  font-weight: 750;
}

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

.footer-grid {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 42px 0;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 34px;
}

.footer-brand {
  color: white;
  font-size: 22px;
}

.site-footer p,
.site-footer a,
.site-footer li {
  color: var(--muted);
  font-size: 14px;
}

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

.site-footer ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-footer li + li {
  margin-top: 8px;
}

.site-footer a:hover {
  color: #7dd3fc;
}

.footer-bottom {
  padding: 18px 0 24px;
  color: #64748b;
  font-size: 13px;
  text-align: center;
}

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

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

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

  .menu-button {
    display: flex;
  }

  .hero-content {
    left: 22px;
    right: 22px;
    bottom: 132px;
  }

  .hero-search {
    left: 22px;
    right: 22px;
  }

  .hero-arrow {
    display: none;
  }

  .movie-grid,
  .wide-grid,
  .category-grid,
  .category-panels,
  .footer-grid,
  .detail-layout {
    grid-template-columns: 1fr;
  }

  .detail-layout {
    gap: 28px;
  }

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

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

@media (max-width: 620px) {
  .site-header-inner {
    height: 68px;
  }

  .brand-text small {
    display: none;
  }

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

  .hero-content h1,
  .page-hero h1,
  .detail-info h1 {
    letter-spacing: -0.03em;
  }

  .section-heading,
  .toolbar,
  .search-panel {
    align-items: stretch;
    flex-direction: column;
  }

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

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

  .mobile-nav.is-open {
    grid-template-columns: 1fr;
  }

  .player-controls {
    opacity: 1;
  }
}
