:root {
  color-scheme: dark;
  --bg: #070b18;
  --bg-soft: #0d1428;
  --bg-card: rgba(16, 24, 48, 0.82);
  --bg-card-solid: #111a33;
  --border: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(255, 255, 255, 0.18);
  --text: #f8fbff;
  --muted: #aeb9cc;
  --soft: #76849b;
  --primary: #4f8cff;
  --primary-2: #8f5cff;
  --accent: #ffca57;
  --danger: #ff5f7c;
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  --max: 1200px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(79, 140, 255, 0.24), transparent 34rem),
    radial-gradient(circle at 85% 8%, rgba(143, 92, 255, 0.18), transparent 26rem),
    linear-gradient(180deg, #070b18 0%, #0a1023 42%, #070b18 100%);
  color: var(--text);
}

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

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

button,
input {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(7, 11, 24, 0.72);
  backdrop-filter: blur(18px);
}

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

.site-logo,
.footer-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -0.02em;
  background: linear-gradient(120deg, #ffffff, #8db4ff 48%, #ffe08a);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.site-logo::before,
.footer-logo::before {
  content: "HD";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: white;
  font-size: 13px;
  font-weight: 900;
  box-shadow: 0 12px 28px rgba(79, 140, 255, 0.35);
}

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

.nav-link,
.mobile-link {
  color: var(--muted);
  padding: 10px 13px;
  border-radius: 999px;
  transition: 0.2s ease;
}

.nav-link:hover,
.nav-link.is-active,
.mobile-link:hover,
.mobile-link.is-active {
  color: white;
  background: rgba(255, 255, 255, 0.09);
}

.nav-search,
.mobile-search {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 310px;
  padding: 5px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
}

.nav-search input,
.mobile-search input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  color: white;
  background: transparent;
  padding: 8px 12px;
}

.nav-search button,
.mobile-search button,
.btn,
.filter-buttons button,
.play-button,
.hero-dot {
  border: 0;
  cursor: pointer;
}

.nav-search button,
.mobile-search button {
  padding: 8px 14px;
  border-radius: 999px;
  color: white;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
}

.menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
}

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

.mobile-panel {
  display: none;
  width: min(var(--max), calc(100% - 32px));
  margin: 0 auto 16px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(12, 18, 36, 0.96);
}

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

.mobile-search {
  width: 100%;
}

.main {
  overflow: hidden;
}

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

.hero {
  position: relative;
  min-height: 78vh;
  isolation: isolate;
}

.hero-slider {
  width: min(1440px, 100%);
  margin: 0 auto;
  overflow: hidden;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

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

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

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: -3;
}

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

.hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(7, 11, 24, 0.96), rgba(7, 11, 24, 0.72) 38%, rgba(7, 11, 24, 0.24) 72%),
    linear-gradient(0deg, #070b18 2%, rgba(7, 11, 24, 0.2) 40%, rgba(7, 11, 24, 0.65) 100%);
}

.hero-grid {
  width: min(var(--max), calc(100% - 32px));
  min-height: 78vh;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  align-items: center;
  gap: 52px;
  padding: 72px 0 92px;
}

.hero-copy {
  max-width: 760px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 18px;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  color: #d8e5ff;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
}

.hero h1,
.page-hero h1,
.detail-title {
  margin: 0;
  font-size: clamp(38px, 6vw, 76px);
  line-height: 1.04;
  letter-spacing: -0.055em;
}

.hero h1 strong {
  display: block;
  color: #9fc0ff;
}

.hero p {
  max-width: 680px;
  color: #d6deec;
  font-size: 18px;
  line-height: 1.9;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 999px;
  color: white;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.13);
  transition: 0.2s ease;
}

.btn:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.26);
  background: rgba(255, 255, 255, 0.15);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  box-shadow: 0 18px 42px rgba(79, 140, 255, 0.28);
}

.btn-primary:hover {
  box-shadow: 0 24px 52px rgba(79, 140, 255, 0.36);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.08);
}

.hero-poster {
  position: relative;
  transform: rotate(2deg);
}

.hero-poster::before {
  content: "";
  position: absolute;
  inset: 28px -18px -18px 34px;
  z-index: -1;
  border-radius: 32px;
  background: linear-gradient(135deg, rgba(79, 140, 255, 0.45), rgba(255, 202, 87, 0.2));
  filter: blur(18px);
}

.hero-poster img {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 30px;
  box-shadow: var(--shadow);
}

.hero-poster-card {
  position: absolute;
  right: -16px;
  bottom: 22px;
  width: min(280px, 88%);
  padding: 15px;
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  background: rgba(10, 16, 35, 0.78);
  backdrop-filter: blur(16px);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.35);
}

.hero-poster-card b {
  display: block;
  margin-bottom: 6px;
  font-size: 16px;
}

.hero-poster-card span {
  color: var(--muted);
  font-size: 13px;
}

.hero-controls {
  position: absolute;
  left: 50%;
  bottom: 28px;
  z-index: 4;
  display: flex;
  gap: 9px;
  transform: translateX(-50%);
}

.hero-dot {
  width: 34px;
  height: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.25);
}

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

.page-hero {
  position: relative;
  padding: 76px 0 36px;
}

.page-hero::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 360px;
  z-index: -1;
  background:
    radial-gradient(circle at 18% 0%, rgba(79, 140, 255, 0.28), transparent 25rem),
    radial-gradient(circle at 80% 10%, rgba(143, 92, 255, 0.18), transparent 22rem);
}

.page-hero p {
  max-width: 760px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.9;
}

.section {
  padding: 36px 0;
}

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

.section-head h2 {
  margin: 0;
  font-size: clamp(25px, 3.2vw, 40px);
  letter-spacing: -0.035em;
}

.section-head p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.8;
}

.section-more {
  flex: 0 0 auto;
  color: #cfe0ff;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.06);
}

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

.movie-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.035));
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.18);
  transition: transform 0.22s ease, border-color 0.22s ease, background 0.22s ease;
}

.movie-card:hover {
  transform: translateY(-5px);
  border-color: rgba(125, 164, 255, 0.42);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.045));
}

.poster-link {
  position: relative;
  display: block;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.05);
}

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

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

.play-mark {
  position: absolute;
  right: 12px;
  bottom: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  color: #0c1224;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.28);
}

.rank-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  min-width: 36px;
  height: 36px;
  padding: 0 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 13px;
  background: linear-gradient(135deg, #ffcf5d, #ff5f7c);
  color: #21101c;
  font-weight: 900;
}

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

.movie-title {
  display: block;
  min-height: 48px;
  color: white;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.42;
}

.movie-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 8px 0;
  color: var(--soft);
  font-size: 13px;
}

.movie-meta a {
  color: #a9c4ff;
}

.heat {
  color: var(--accent);
}

.movie-card p {
  min-height: 66px;
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.chip-row span,
.detail-chip,
.breadcrumb a,
.breadcrumb span {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: #c9d6ee;
  background: rgba(255, 255, 255, 0.055);
  font-size: 12px;
}

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

.category-tile {
  position: relative;
  overflow: hidden;
  min-height: 168px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background:
    radial-gradient(circle at 80% 0%, rgba(79, 140, 255, 0.24), transparent 9rem),
    linear-gradient(180deg, rgba(255, 255, 255, 0.085), rgba(255, 255, 255, 0.035));
  transition: 0.22s ease;
}

.category-tile:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.22);
}

.category-tile h3 {
  margin: 0 0 10px;
  font-size: 22px;
}

.category-tile p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.category-tile span {
  position: absolute;
  left: 20px;
  bottom: 18px;
  color: #cfe0ff;
}

.filter-panel {
  display: grid;
  gap: 14px;
  margin: 16px 0 26px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.055);
}

.search-box {
  display: grid;
  gap: 8px;
  color: var(--muted);
}

.search-box input {
  width: 100%;
  height: 48px;
  border: 1px solid var(--border);
  border-radius: 16px;
  outline: none;
  color: white;
  background: rgba(4, 8, 20, 0.55);
  padding: 0 15px;
}

.filter-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.filter-buttons button {
  min-height: 36px;
  padding: 0 12px;
  color: #ced9ed;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
}

.filter-buttons button.is-active {
  color: white;
  border-color: rgba(143, 176, 255, 0.55);
  background: linear-gradient(135deg, rgba(79, 140, 255, 0.68), rgba(143, 92, 255, 0.58));
}

.empty-state {
  display: none;
  margin: 28px 0;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--muted);
  text-align: center;
  background: rgba(255, 255, 255, 0.05);
}

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

.rank-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) 360px;
  gap: 24px;
  align-items: start;
}

.rank-panel,
.side-panel,
.detail-info-card {
  border: 1px solid var(--border);
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.055);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.18);
}

.rank-panel {
  padding: 18px;
}

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

.mini-movie {
  display: grid;
  grid-template-columns: auto 54px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 10px;
  border: 1px solid transparent;
  border-radius: 18px;
  transition: 0.2s ease;
}

.mini-movie:hover {
  border-color: var(--border);
  background: rgba(255, 255, 255, 0.055);
}

.mini-movie img {
  width: 54px;
  height: 76px;
  object-fit: cover;
  border-radius: 12px;
}

.mini-movie strong {
  display: block;
  overflow: hidden;
  color: white;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-movie small {
  display: block;
  overflow: hidden;
  margin-top: 6px;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-rank {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  color: #0e1325;
  background: #f5cb58;
  font-weight: 900;
}

.side-panel {
  padding: 18px;
}

.side-panel h3 {
  margin: 0 0 14px;
  font-size: 20px;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.detail-shell {
  padding: 34px 0 48px;
}

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

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

.player-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #02050d;
}

.player-frame video {
  width: 100%;
  height: 100%;
  display: block;
  background: #02050d;
  object-fit: contain;
}

.player-cover {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  overflow: hidden;
  cursor: pointer;
}

.player-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.48) saturate(1.15);
}

.player-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at center, rgba(79, 140, 255, 0.28), transparent 18rem),
    linear-gradient(0deg, rgba(2, 5, 13, 0.82), rgba(2, 5, 13, 0.16));
}

.player-shell.is-playing .player-cover {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}

.play-button {
  position: absolute;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-width: 172px;
  min-height: 58px;
  padding: 0 22px;
  border-radius: 999px;
  color: white;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  box-shadow: 0 22px 56px rgba(79, 140, 255, 0.38);
}

.play-button span {
  display: inline-flex;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: var(--primary);
  background: white;
}

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

.detail-title {
  font-size: clamp(30px, 4vw, 52px);
}

.detail-subtitle {
  margin: 16px 0 0;
  color: #d7e1f0;
  font-size: 18px;
  line-height: 1.85;
}

.detail-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0 0;
}

.detail-copy {
  display: grid;
  gap: 18px;
  margin-top: 24px;
  color: #d4deed;
  line-height: 1.95;
}

.detail-copy h2 {
  margin: 0 0 -6px;
  color: white;
  font-size: 24px;
}

.detail-poster {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.05);
}

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

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

.movie-card-compact .movie-title {
  min-height: auto;
}

.movie-card-compact p {
  min-height: auto;
}

.card-hidden {
  display: none !important;
}

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

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

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

  .hero-poster {
    max-width: 380px;
    margin: 0 auto;
  }
}

@media (max-width: 880px) {
  .site-nav,
  .nav-search {
    display: none;
  }

  .menu-toggle {
    display: block;
    margin-left: auto;
  }

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

  .site-logo {
    font-size: 19px;
  }

  .hero-grid {
    min-height: auto;
    padding: 54px 0 92px;
    gap: 30px;
  }

  .hero p,
  .page-hero p {
    font-size: 15px;
  }

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

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

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

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

@media (max-width: 520px) {
  .container,
  .header-inner,
  .mobile-panel,
  .hero-grid {
    width: min(100% - 22px, var(--max));
  }

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

  .hero-actions,
  .detail-actions {
    flex-direction: column;
  }

  .btn,
  .play-button {
    width: 100%;
  }

  .hero-poster-card {
    right: 8px;
  }

  .player-shell {
    border-radius: 20px;
  }
}
