:root {
  --bg: #0f1419;
  --panel: #1f2933;
  --panel-soft: rgba(31, 41, 51, 0.78);
  --panel-deep: #111821;
  --line: #323f4b;
  --line-soft: rgba(126, 34, 206, 0.28);
  --text: #ffffff;
  --muted: #cbd2d9;
  --muted-2: #9aa5b1;
  --muted-3: #7b8794;
  --mystery: #9333ea;
  --mystery-light: #d8b4fe;
  --accent: #f97316;
  --radius: 18px;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
  --glow: 0 0 26px rgba(147, 51, 234, 0.32);
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(147, 51, 234, 0.18), transparent 34rem),
    radial-gradient(circle at top right, rgba(65, 105, 179, 0.18), transparent 32rem),
    var(--bg);
  color: var(--text);
}

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

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

button,
input {
  font: inherit;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid rgba(50, 63, 75, 0.9);
  background: rgba(31, 41, 51, 0.92);
  backdrop-filter: blur(14px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 74px;
  gap: 22px;
}

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

.brand-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--mystery), #6b21a8);
  box-shadow: var(--glow);
  color: #fff;
  font-size: 16px;
}

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

.brand-text strong {
  font-size: 21px;
  letter-spacing: 0.03em;
}

.brand-text em {
  margin-top: 3px;
  color: var(--muted-3);
  font-size: 12px;
  font-style: normal;
}

.desktop-nav {
  display: flex;
  align-items: center;
  gap: 24px;
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
}

.desktop-nav a {
  transition: color 0.2s ease;
}

.desktop-nav a:hover {
  color: #fff;
}

.top-search {
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(310px, 30vw);
}

.top-search input,
.filter-box input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: none;
  background: rgba(15, 20, 25, 0.58);
  color: #fff;
  padding: 11px 14px;
  transition: border 0.2s ease, box-shadow 0.2s ease;
}

.top-search input:focus,
.filter-box input:focus {
  border-color: var(--mystery);
  box-shadow: 0 0 0 3px rgba(147, 51, 234, 0.22);
}

.top-search button,
.hero-btn,
.section-link,
.play-action,
.filter-btn {
  border: 0;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(135deg, var(--mystery), #6b21a8);
  padding: 11px 16px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.top-search button:hover,
.hero-btn:hover,
.section-link:hover,
.play-action:hover,
.filter-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--glow);
}

.menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(15, 20, 25, 0.45);
  cursor: pointer;
}

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

.mobile-panel {
  display: none;
  border-top: 1px solid var(--line);
  padding: 10px 16px 16px;
  background: rgba(15, 20, 25, 0.96);
}

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

.mobile-panel a {
  border-radius: 12px;
  padding: 12px 14px;
  color: var(--muted);
  background: rgba(31, 41, 51, 0.72);
}

.hero {
  position: relative;
  min-height: 620px;
  overflow: hidden;
  border-bottom: 1px solid rgba(50, 63, 75, 0.65);
}

.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-image {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

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

.hero-image::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to top, #0f1419 0%, rgba(15, 20, 25, 0.84) 35%, rgba(15, 20, 25, 0.2) 100%),
    linear-gradient(to right, rgba(15, 20, 25, 0.96), rgba(15, 20, 25, 0.58), rgba(15, 20, 25, 0.1));
}

.hero-content {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: flex-end;
  min-height: 620px;
  padding: 112px 0 82px;
}

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

.hero-copy h1,
.hero-copy h2 {
  margin: 0 0 18px;
  font-size: clamp(36px, 6vw, 72px);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.hero-copy p {
  max-width: 720px;
  margin: 0 0 28px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.72;
}

.hero-tags,
.tag-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.hero-tags {
  margin-bottom: 18px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border: 1px solid rgba(216, 180, 254, 0.22);
  border-radius: 999px;
  background: rgba(147, 51, 234, 0.2);
  color: var(--mystery-light);
  padding: 3px 10px;
  font-size: 12px;
  line-height: 1.2;
}

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

.hero-btn.secondary,
.section-link.secondary,
.filter-btn.secondary {
  border: 1px solid var(--line);
  background: rgba(31, 41, 51, 0.76);
}

.hero-control {
  position: absolute;
  top: 50%;
  z-index: 4;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(203, 210, 217, 0.25);
  border-radius: 50%;
  background: rgba(15, 20, 25, 0.55);
  color: #fff;
  cursor: pointer;
  transform: translateY(-50%);
  transition: background 0.2s ease, transform 0.2s ease;
}

.hero-control:hover {
  background: rgba(147, 51, 234, 0.78);
  transform: translateY(-50%) scale(1.06);
}

.hero-control.prev {
  left: 24px;
}

.hero-control.next {
  right: 24px;
}

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

.hero-dots button {
  width: 34px;
  height: 5px;
  border: 0;
  border-radius: 999px;
  background: rgba(203, 210, 217, 0.32);
  cursor: pointer;
  transition: background 0.2s ease, width 0.2s ease;
}

.hero-dots button.is-active {
  width: 48px;
  background: var(--mystery);
}

.main {
  padding: 56px 0;
}

.section {
  margin-bottom: 64px;
}

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

.section-title {
  margin: 0;
  font-size: clamp(26px, 4vw, 40px);
  line-height: 1.12;
}

.section-subtitle {
  max-width: 760px;
  margin: 10px 0 0;
  color: var(--muted-2);
  font-size: 15px;
  line-height: 1.7;
}

.section-link {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}

.grid {
  display: grid;
  gap: 22px;
}

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

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

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

.movie-card,
.category-card,
.rank-item,
.info-panel {
  border: 1px solid rgba(50, 63, 75, 0.86);
  border-radius: var(--radius);
  background: rgba(31, 41, 51, 0.78);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
  overflow: hidden;
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.movie-card:hover,
.category-card:hover,
.rank-item:hover {
  border-color: var(--line-soft);
  box-shadow: var(--glow);
  transform: translateY(-5px);
}

.poster-link {
  position: relative;
  display: block;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: linear-gradient(135deg, #1f2933, #0f1419);
}

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

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

.poster-shade {
  position: absolute;
  inset: auto 0 0;
  height: 46%;
  background: linear-gradient(to top, rgba(15, 20, 25, 0.9), transparent);
}

.play-chip {
  position: absolute;
  right: 12px;
  bottom: 12px;
  border-radius: 999px;
  background: rgba(147, 51, 234, 0.9);
  padding: 6px 11px;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.movie-card:hover .play-chip {
  opacity: 1;
  transform: translateY(0);
}

.card-body {
  padding: 15px;
}

.card-body h3 {
  margin: 7px 0 8px;
  font-size: 17px;
  line-height: 1.35;
}

.card-body h3 a:hover,
.rank-info h3 a:hover {
  color: var(--mystery-light);
}

.card-body p {
  min-height: 48px;
  margin: 0 0 13px;
  color: var(--muted-2);
  font-size: 13px;
  line-height: 1.55;
}

.meta-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted-3);
  font-size: 12px;
}

.meta-row span + span::before {
  content: "·";
  margin-right: 8px;
  color: var(--line);
}

.category-card {
  display: block;
  padding: 22px;
  min-height: 170px;
  background:
    linear-gradient(135deg, rgba(147, 51, 234, 0.16), rgba(31, 41, 51, 0.75)),
    rgba(31, 41, 51, 0.78);
}

.category-card h3 {
  margin: 0 0 12px;
  font-size: 22px;
}

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

.category-card span {
  display: inline-flex;
  margin-top: 20px;
  color: var(--mystery-light);
  font-weight: 700;
}

.rank-item {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  min-height: 150px;
}

.rank-cover {
  position: relative;
  display: block;
  min-height: 150px;
  overflow: hidden;
}

.rank-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.rank-num {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--mystery), #6b21a8);
  color: #fff;
  font-weight: 800;
}

.rank-info {
  padding: 16px;
}

.rank-info h3 {
  margin: 0 0 8px;
  font-size: 19px;
}

.rank-info p {
  margin: 0 0 14px;
  color: var(--muted-2);
  line-height: 1.62;
}

.filter-box {
  display: grid;
  gap: 14px;
  margin-bottom: 28px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(31, 41, 51, 0.62);
}

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

.page-hero {
  padding: 66px 0 34px;
}

.page-hero h1 {
  margin: 0;
  font-size: clamp(34px, 5vw, 54px);
  letter-spacing: -0.03em;
}

.page-hero p {
  max-width: 820px;
  margin: 14px 0 0;
  color: var(--muted-2);
  line-height: 1.75;
}

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

.breadcrumb a {
  color: var(--mystery-light);
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, 0.75fr);
  gap: 28px;
  align-items: start;
}

.player-shell {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(126, 34, 206, 0.35);
  border-radius: 22px;
  background: #000;
  box-shadow: var(--shadow);
  aspect-ratio: 16 / 9;
}

.main-video {
  width: 100%;
  height: 100%;
  background: #000;
}

.player-mask {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background:
    linear-gradient(to top, rgba(15, 20, 25, 0.96), rgba(15, 20, 25, 0.3)),
    rgba(15, 20, 25, 0.35);
  cursor: pointer;
  transition: opacity 0.25s ease;
}

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

.play-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 132px;
  min-height: 52px;
  font-size: 17px;
}

.detail-title {
  margin: 22px 0 12px;
  font-size: clamp(30px, 5vw, 48px);
  line-height: 1.12;
}

.detail-lead {
  color: var(--muted);
  font-size: 17px;
  line-height: 1.78;
}

.info-panel {
  padding: 20px;
}

.info-panel img {
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: 16px;
  object-fit: cover;
  margin-bottom: 18px;
}

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

.info-list div {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid rgba(50, 63, 75, 0.7);
  padding-bottom: 10px;
  color: var(--muted-2);
}

.info-list strong {
  color: #fff;
  font-weight: 700;
}

.content-panel {
  margin-top: 28px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(31, 41, 51, 0.7);
  padding: 26px;
}

.content-panel h2 {
  margin: 0 0 14px;
  font-size: 25px;
}

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

.content-panel + .content-panel {
  margin-top: 18px;
}

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

.empty-message {
  display: none;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted-2);
  background: rgba(31, 41, 51, 0.62);
}

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

.site-footer {
  margin-top: 44px;
  border-top: 1px solid var(--line);
  background: rgba(15, 20, 25, 0.92);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: 30px;
  padding: 44px 0;
}

.footer-brand {
  display: inline-flex;
  margin-bottom: 12px;
  color: #fff;
  font-size: 21px;
  font-weight: 800;
}

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

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

.site-footer a {
  display: block;
  margin-top: 8px;
  transition: color 0.2s ease;
}

.site-footer a:hover {
  color: var(--mystery-light);
}

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

  .related-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,
  .top-search {
    display: none;
  }

  .menu-toggle {
    display: block;
  }

  .hero,
  .hero-content {
    min-height: 560px;
  }

  .hero-control {
    display: none;
  }

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

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

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

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

@media (max-width: 540px) {
  .container {
    width: min(100% - 24px, 1180px);
  }

  .brand-text em {
    display: none;
  }

  .brand-text strong {
    font-size: 18px;
  }

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

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

  .hero-btn {
    justify-content: center;
    text-align: center;
  }

  .movie-grid,
  .related-grid {
    gap: 14px;
  }

  .card-body {
    padding: 12px;
  }

  .card-body h3 {
    font-size: 15px;
  }

  .card-body p {
    min-height: auto;
    font-size: 12px;
  }

  .rank-item {
    grid-template-columns: 96px minmax(0, 1fr);
  }

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