:root {
  color-scheme: dark;
  --bg: #020617;
  --bg-soft: #0f172a;
  --bg-card: rgba(15, 23, 42, 0.86);
  --border: rgba(148, 163, 184, 0.22);
  --text: #f8fafc;
  --muted: #94a3b8;
  --cyan: #22d3ee;
  --blue: #2563eb;
  --amber: #f59e0b;
  --shadow: 0 24px 60px rgba(2, 6, 23, 0.45);
  --radius: 22px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(34, 211, 238, 0.18), transparent 34rem),
    radial-gradient(circle at 80% 10%, rgba(37, 99, 235, 0.18), transparent 28rem),
    linear-gradient(180deg, #020617 0%, #0f172a 42%, #020617 100%);
  color: var(--text);
  min-height: 100vh;
}

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

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

.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  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 rgba(148, 163, 184, 0.18);
  box-shadow: 0 10px 30px rgba(2, 6, 23, 0.42);
  backdrop-filter: blur(18px);
}

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

.header-inner {
  height: 68px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.brand,
.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  background: linear-gradient(90deg, var(--cyan), #60a5fa);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  white-space: nowrap;
}

.brand-icon {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display: inline-grid;
  place-items: center;
  color: #fff;
  font-size: 0.86rem;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  box-shadow: 0 10px 30px rgba(34, 211, 238, 0.28);
}

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

.nav-link,
.mobile-link {
  color: #cbd5e1;
  font-weight: 650;
  transition: color 0.2s ease, transform 0.2s ease;
}

.nav-link:hover,
.nav-link.is-active,
.mobile-link:hover,
.mobile-link.is-active {
  color: var(--cyan);
}

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

.header-search input,
.mobile-search input,
.filter-panel input,
.filter-panel select,
.search-box input,
.search-box select {
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: rgba(15, 23, 42, 0.88);
  color: var(--text);
  border-radius: 999px;
  padding: 11px 14px;
  outline: none;
  min-width: 0;
}

.header-search input {
  width: 230px;
}

.header-search input:focus,
.mobile-search input:focus,
.filter-panel input:focus,
.filter-panel select:focus,
.search-box input:focus,
.search-box select:focus {
  border-color: rgba(34, 211, 238, 0.82);
  box-shadow: 0 0 0 4px rgba(34, 211, 238, 0.12);
}

.header-search button,
.mobile-search button,
.btn,
.search-box button,
.filter-panel button {
  border: 0;
  border-radius: 999px;
  color: white;
  font-weight: 750;
  cursor: pointer;
  padding: 11px 18px;
  background: linear-gradient(90deg, var(--cyan), var(--blue));
  box-shadow: 0 14px 30px rgba(37, 99, 235, 0.25);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.header-search button:hover,
.mobile-search button:hover,
.btn:hover,
.search-box button:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 40px rgba(34, 211, 238, 0.28);
}

.menu-toggle {
  display: none;
  margin-left: auto;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.88);
  cursor: pointer;
}

.menu-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  margin: 5px auto;
  background: #e2e8f0;
  border-radius: 2px;
}

.mobile-panel {
  display: none;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 12px 0 18px;
  border-top: 1px solid rgba(148, 163, 184, 0.16);
}

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

.mobile-link {
  display: block;
  padding: 4px 0;
}

main {
  padding-top: 68px;
}

.hero {
  position: relative;
  height: 72vh;
  min-height: 560px;
  overflow: hidden;
}

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

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

.hero-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(1.08) contrast(1.05);
}

.hero-slide::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(2, 6, 23, 0.92), rgba(15, 23, 42, 0.68) 42%, rgba(2, 6, 23, 0.22)),
    linear-gradient(0deg, #020617 0%, rgba(2, 6, 23, 0.35) 42%, rgba(2, 6, 23, 0.12) 100%);
}

.hero-content {
  position: absolute;
  inset: auto 0 0 0;
  z-index: 2;
  padding: 70px 0 84px;
}

.hero-copy {
  width: min(760px, 92vw);
}

.hero-kicker,
.poster-badge,
.type-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  color: white;
  background: rgba(34, 211, 238, 0.88);
  font-size: 0.84rem;
  font-weight: 800;
  padding: 7px 12px;
}

.hero-copy h1,
.hero-copy h2 {
  margin: 18px 0 16px;
  font-size: clamp(2.4rem, 6vw, 5.7rem);
  line-height: 0.96;
  letter-spacing: -0.06em;
}

.hero-copy p {
  color: #dbeafe;
  font-size: clamp(1rem, 2vw, 1.25rem);
  line-height: 1.85;
  margin: 0 0 28px;
}

.hero-actions,
.section-head,
.detail-meta,
.breadcrumb,
.card-tags,
.category-pills,
.hero-dots,
.tag-list {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.btn-secondary {
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.32);
  box-shadow: none;
}

.hero-dots {
  position: absolute;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  z-index: 4;
}

.hero-dot {
  width: 34px;
  height: 6px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  background: rgba(226, 232, 240, 0.35);
}

.hero-dot.is-active {
  background: linear-gradient(90deg, var(--cyan), var(--blue));
}

.section {
  padding: 64px 0 0;
}

.section-head {
  justify-content: space-between;
  margin-bottom: 24px;
}

.section-title h2,
.page-title h1,
.detail-main h1 {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 3rem);
  letter-spacing: -0.04em;
}

.section-title p,
.page-title p,
.category-card p,
.card-desc,
.detail-copy p,
.site-footer p {
  color: var(--muted);
  line-height: 1.8;
}

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

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

.card-link {
  display: block;
  height: 100%;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: 0 20px 44px rgba(2, 6, 23, 0.28);
  transition: transform 0.24s ease, border-color 0.24s ease, box-shadow 0.24s ease;
}

.card-link:hover {
  transform: translateY(-7px);
  border-color: rgba(34, 211, 238, 0.56);
  box-shadow: 0 28px 70px rgba(8, 145, 178, 0.18);
}

.poster-wrap {
  position: relative;
  aspect-ratio: 2 / 3;
  margin: 0;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.22), rgba(30, 41, 59, 0.78));
}

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

.card-link:hover img {
  transform: scale(1.05);
}

.poster-badge {
  position: absolute;
  left: 10px;
  top: 10px;
  font-size: 0.72rem;
  padding: 5px 9px;
}

.rating-badge {
  position: absolute;
  right: 10px;
  bottom: 10px;
  color: #111827;
  background: linear-gradient(90deg, #fbbf24, #f59e0b);
  border-radius: 999px;
  font-weight: 900;
  padding: 5px 9px;
  box-shadow: 0 8px 20px rgba(245, 158, 11, 0.25);
}

.card-body {
  padding: 14px;
}

.card-body h3 {
  margin: 0 0 8px;
  font-size: 1rem;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-meta {
  color: #cbd5e1;
  font-size: 0.82rem;
  margin: 0 0 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-desc {
  margin: 0 0 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 0.88rem;
}

.card-tags span,
.tag-list span,
.detail-meta span,
.category-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: rgba(30, 41, 59, 0.92);
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.18);
  padding: 5px 9px;
  font-size: 0.76rem;
}

.category-pill:hover,
.category-pill.is-active {
  color: white;
  border-color: rgba(34, 211, 238, 0.48);
  background: rgba(8, 145, 178, 0.34);
}

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

.category-card {
  display: grid;
  gap: 12px;
  min-height: 190px;
  padding: 22px;
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(34, 211, 238, 0.12), rgba(37, 99, 235, 0.08)),
    rgba(15, 23, 42, 0.86);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.category-card strong {
  font-size: 1.25rem;
}

.rank-layout,
.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 28px;
}

.rank-list,
.side-panel,
.info-panel,
.search-shell,
.filter-panel {
  border-radius: var(--radius);
  background: rgba(15, 23, 42, 0.82);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.rank-list {
  display: grid;
  gap: 10px;
  padding: 16px;
}

.rank-item {
  display: grid;
  grid-template-columns: 42px 58px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 10px;
  border-radius: 16px;
  background: rgba(30, 41, 59, 0.58);
  transition: background 0.2s ease, transform 0.2s ease;
}

.rank-item:hover {
  background: rgba(8, 145, 178, 0.22);
  transform: translateX(4px);
}

.rank-num {
  color: var(--cyan);
  font-weight: 900;
  font-size: 1.05rem;
}

.rank-item img {
  width: 58px;
  height: 78px;
  border-radius: 12px;
  object-fit: cover;
  background: rgba(30, 41, 59, 0.9);
}

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

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

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

.page-hero {
  padding: 74px 0 18px;
}

.page-title {
  display: grid;
  gap: 14px;
  max-width: 820px;
}

.filter-panel,
.search-box {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  padding: 16px;
  margin-bottom: 24px;
}

.filter-panel input,
.search-box input {
  flex: 1 1 260px;
}

.filter-panel select,
.search-box select {
  flex: 0 1 160px;
}

.empty-state {
  display: none;
  color: var(--muted);
  text-align: center;
  padding: 40px 0;
}

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

.breadcrumb {
  margin: 28px 0 18px;
  color: #93c5fd;
  font-weight: 650;
}

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

.player-shell {
  position: relative;
  overflow: hidden;
  border-radius: 26px;
  background: #000;
  box-shadow: 0 30px 80px rgba(2, 6, 23, 0.55);
  border: 1px solid rgba(148, 163, 184, 0.18);
}

.player-shell video {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  object-fit: contain;
}

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

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

.play-ring {
  width: 86px;
  height: 86px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  font-size: 2.1rem;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  box-shadow: 0 18px 44px rgba(34, 211, 238, 0.35);
}

.detail-main h1 {
  margin-top: 24px;
}

.detail-meta {
  margin: 18px 0 22px;
}

.detail-copy {
  display: grid;
  gap: 18px;
}

.detail-copy section,
.side-panel,
.info-panel {
  padding: 22px;
}

.detail-copy h2,
.side-panel h2,
.info-panel h2 {
  margin: 0 0 12px;
  font-size: 1.35rem;
}

.detail-copy p {
  margin: 0;
  font-size: 1rem;
}

.side-panel {
  position: sticky;
  top: 92px;
  align-self: start;
}

.side-cover {
  width: 100%;
  aspect-ratio: 2 / 3;
  border-radius: 20px;
  object-fit: cover;
  background: rgba(30, 41, 59, 0.9);
  margin-bottom: 18px;
}

.info-list {
  display: grid;
  gap: 12px;
  color: #cbd5e1;
}

.info-list div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  padding-bottom: 10px;
}

.info-list span:first-child {
  color: var(--muted);
}

.search-shell {
  padding: 22px;
}

.site-footer {
  margin-top: 72px;
  padding: 42px 0;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.72), rgba(2, 6, 23, 0.96));
  border-top: 1px solid rgba(148, 163, 184, 0.16);
}

.footer-inner {
  display: grid;
  gap: 18px;
}

.footer-links {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  color: #cbd5e1;
}

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

.copyright {
  margin: 0;
  font-size: 0.9rem;
}

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

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

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

  .side-panel {
    position: static;
  }
}

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

  .menu-toggle {
    display: block;
  }

  .hero {
    height: 680px;
    min-height: 680px;
  }

  .hero-content {
    padding: 54px 0 80px;
  }

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

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

@media (max-width: 620px) {
  .header-inner,
  .footer-inner,
  .container,
  .mobile-panel {
    width: min(100% - 22px, 1180px);
  }

  .brand {
    font-size: 1.18rem;
  }

  .hero-copy h1,
  .hero-copy h2 {
    font-size: 2.5rem;
  }

  .hero-copy p {
    font-size: 0.98rem;
  }

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

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

  .card-body {
    padding: 12px;
  }

  .filter-panel,
  .search-box {
    display: grid;
  }

  .filter-panel select,
  .search-box select {
    width: 100%;
  }

  .player-overlay .play-ring {
    width: 68px;
    height: 68px;
    font-size: 1.7rem;
  }
}
