:root {
  color-scheme: dark;
  --bg: #070a14;
  --bg-soft: #0f172a;
  --card: rgba(15, 23, 42, 0.82);
  --card-strong: rgba(17, 24, 39, 0.96);
  --line: rgba(148, 163, 184, 0.18);
  --text: #e5e7eb;
  --muted: #94a3b8;
  --accent: #8b5cf6;
  --accent-2: #06b6d4;
  --accent-3: #f59e0b;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
  --radius: 24px;
}

* {
  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, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(139, 92, 246, 0.24), transparent 34rem),
    radial-gradient(circle at top right, rgba(6, 182, 212, 0.17), transparent 36rem),
    linear-gradient(180deg, #0b1020 0%, #070a14 44%, #050711 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: linear-gradient(to bottom, black, transparent 78%);
  z-index: -1;
}

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 var(--line);
  background: rgba(7, 10, 20, 0.82);
  backdrop-filter: blur(18px);
}

.nav-wrap {
  width: min(1380px, calc(100% - 32px));
  margin: 0 auto;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  border-radius: 14px;
  color: white;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 12px 30px rgba(139, 92, 246, 0.36);
}

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

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

.main-nav a {
  padding: 10px 13px;
  color: var(--muted);
  border-radius: 999px;
  transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease;
  white-space: nowrap;
}

.main-nav a:hover,
.main-nav a.active {
  color: white;
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-1px);
}

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: white;
  background: rgba(255, 255, 255, 0.07);
}

main,
.page-main,
.detail-main {
  width: min(1380px, calc(100% - 32px));
  margin: 0 auto;
}

.hero-shell {
  position: relative;
  min-height: 680px;
  margin-top: 26px;
  border: 1px solid var(--line);
  border-radius: 36px;
  overflow: hidden;
  background: #0f172a;
  box-shadow: var(--shadow);
}

.hero-track,
.hero-slide {
  min-height: 680px;
}

.hero-slide {
  display: none;
  position: relative;
  grid-template-columns: minmax(0, 1.1fr) minmax(300px, 0.55fr);
  align-items: center;
  gap: 38px;
  padding: 86px clamp(28px, 6vw, 86px);
}

.hero-slide.is-active {
  display: grid;
  animation: fadeIn 0.55s ease both;
}

.hero-bg {
  position: absolute;
  inset: 0;
  opacity: 0.34;
}

.hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(22px) saturate(1.16) brightness(0.7);
  transform: scale(1.08);
}

.hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(7, 10, 20, 0.95), rgba(7, 10, 20, 0.54), rgba(7, 10, 20, 0.9)),
    radial-gradient(circle at 30% 20%, rgba(139, 92, 246, 0.38), transparent 36rem);
}

.hero-content,
.hero-poster {
  position: relative;
  z-index: 1;
}

.eyebrow,
.section-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #c4b5fd;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero-content h1 {
  max-width: 820px;
  margin: 18px 0 10px;
  font-size: clamp(40px, 6vw, 78px);
  line-height: 0.98;
  letter-spacing: -0.06em;
}

.hero-content h2 {
  margin: 0 0 18px;
  color: #bfdbfe;
  font-size: clamp(24px, 3.4vw, 44px);
  line-height: 1.1;
}

.hero-content p {
  max-width: 760px;
  margin: 0;
  color: #cbd5e1;
  font-size: 18px;
  line-height: 1.85;
}

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

.hero-actions {
  margin-top: 30px;
}

.hero-tags {
  margin-top: 22px;
}

.hero-tags span,
.detail-tags span,
.tag-row span {
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #dbeafe;
  background: rgba(255, 255, 255, 0.07);
}

.primary-btn,
.ghost-btn,
.more-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  font-weight: 800;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.primary-btn {
  color: #07111f;
  background: linear-gradient(135deg, #f8fafc, #a5f3fc);
  box-shadow: 0 14px 32px rgba(6, 182, 212, 0.24);
}

.ghost-btn,
.more-link {
  color: white;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.08);
}

.primary-btn:hover,
.ghost-btn:hover,
.more-link:hover {
  transform: translateY(-2px);
}

.hero-poster {
  justify-self: center;
  width: min(360px, 100%);
  aspect-ratio: 2 / 3;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 32px;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 35px 80px rgba(0, 0, 0, 0.45);
  transform: rotate(2deg);
}

.hero-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 24px;
}

.hero-dots {
  position: absolute;
  left: clamp(28px, 6vw, 86px);
  bottom: 34px;
  display: flex;
  gap: 10px;
  z-index: 3;
}

.hero-dots button {
  width: 38px;
  height: 8px;
  padding: 0;
  border-radius: 999px;
  border: 0;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.24);
}

.hero-dots button.is-active {
  background: white;
}

.section-block {
  margin: 32px 0;
  padding: clamp(20px, 3vw, 34px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(15, 23, 42, 0.58);
  box-shadow: 0 12px 50px rgba(0, 0, 0, 0.18);
}

.search-panel {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  align-items: center;
  gap: 20px;
}

.search-panel h2,
.section-title-row h2,
.rank-card h2,
.page-hero h1,
.detail-info h1,
.detail-article h2,
.detail-side-card h2 {
  margin: 6px 0 0;
  font-size: clamp(24px, 3vw, 36px);
  letter-spacing: -0.04em;
  line-height: 1.15;
}

.search-box {
  display: flex;
  gap: 10px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.06);
}

.search-box input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  color: white;
  background: transparent;
  padding: 12px 14px;
}

.search-box button,
.filter-strip button {
  border: 0;
  border-radius: 12px;
  color: white;
  background: rgba(255, 255, 255, 0.12);
  padding: 0 16px;
  cursor: pointer;
}

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

.filter-strip button {
  min-height: 40px;
}

.filter-strip button.is-active,
.search-box button:hover {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

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

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

.category-tile {
  position: relative;
  min-height: 190px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #111827;
  isolation: isolate;
}

.category-tile img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.48;
  transition: transform 0.35s ease, opacity 0.35s ease;
  z-index: -2;
}

.category-tile::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(7, 10, 20, 0.9), rgba(7, 10, 20, 0.1));
  z-index: -1;
}

.category-tile span,
.category-tile small {
  position: absolute;
  left: 18px;
  right: 18px;
}

.category-tile span {
  bottom: 44px;
  font-size: 22px;
  font-weight: 900;
}

.category-tile small {
  bottom: 18px;
  color: #cbd5e1;
}

.category-tile:hover img {
  opacity: 0.7;
  transform: scale(1.08);
}

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

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

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

.movie-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--card);
  transition: transform 0.24s ease, border-color 0.24s ease, box-shadow 0.24s ease;
}

.movie-card:hover {
  transform: translateY(-5px);
  border-color: rgba(139, 92, 246, 0.56);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.32);
}

.poster-link {
  position: relative;
  display: block;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  background:
    radial-gradient(circle at 20% 15%, rgba(139, 92, 246, 0.42), transparent 28%),
    linear-gradient(135deg, #111827, #020617);
}

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

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

.poster-glow {
  position: absolute;
  inset: auto 0 0 0;
  height: 46%;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.88), transparent);
  z-index: 1;
}

.poster-badge {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 2;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  color: white;
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(8px);
}

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

.movie-meta-line {
  display: flex;
  gap: 8px;
  color: #a5b4fc;
  font-size: 12px;
  font-weight: 800;
}

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

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

.tag-row {
  margin-top: 12px;
  gap: 6px;
}

.tag-row span {
  padding: 4px 7px;
  font-size: 11px;
}

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

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

.compact-card p,
.compact-card .tag-row {
  display: none;
}

.grid-with-rank {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 24px;
}

.rank-card {
  position: sticky;
  top: 96px;
  align-self: start;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--card-strong);
}

.rank-list,
.rank-page-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.rank-list li {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}

.rank-list li:last-child {
  border-bottom: 0;
}

.rank-list span,
.rank-num {
  color: #fbbf24;
  font-weight: 900;
}

.rank-list em {
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
}

.page-hero {
  margin: 26px 0 32px;
  padding: clamp(28px, 5vw, 58px);
  border: 1px solid var(--line);
  border-radius: 32px;
  background:
    linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(6, 182, 212, 0.1)),
    rgba(15, 23, 42, 0.72);
}

.category-hero,
.small-hero {
  display: grid;
  grid-template-columns: 1fr minmax(280px, 520px);
  align-items: center;
  gap: 24px;
}

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

.category-section-card {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.04);
  margin-bottom: 20px;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 24px 0;
  color: var(--muted);
}

.breadcrumb a:hover {
  color: white;
}

.detail-hero {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: clamp(24px, 5vw, 58px);
  align-items: center;
  padding: clamp(22px, 5vw, 56px);
  border: 1px solid var(--line);
  border-radius: 34px;
  background:
    radial-gradient(circle at 20% 20%, rgba(139, 92, 246, 0.26), transparent 36rem),
    rgba(15, 23, 42, 0.68);
}

.detail-poster {
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.08);
}

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

.detail-info h1 {
  margin-top: 12px;
  font-size: clamp(36px, 6vw, 64px);
}

.detail-one-line {
  max-width: 850px;
  color: #cbd5e1;
  font-size: 18px;
  line-height: 1.9;
}

.detail-tags {
  margin: 22px 0 26px;
}

.player-section {
  margin: 28px 0;
}

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

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

.player-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  gap: 12px;
  border: 0;
  color: white;
  cursor: pointer;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.24), rgba(0, 0, 0, 0.58));
}

.player-overlay span {
  width: 86px;
  height: 86px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  font-size: 30px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 24px 50px rgba(6, 182, 212, 0.28);
}

.player-overlay.is-hidden {
  display: none;
}

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

.detail-article,
.detail-side-card {
  padding: clamp(22px, 3vw, 34px);
  border: 1px solid var(--line);
  border-radius: 26px;
  background: rgba(15, 23, 42, 0.62);
}

.detail-article p {
  color: #d1d5db;
  font-size: 17px;
  line-height: 2;
}

.detail-article h2:not(:first-child) {
  margin-top: 28px;
}

.detail-side-card dl {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 14px 12px;
  color: var(--muted);
}

.detail-side-card dt {
  color: #bfdbfe;
  font-weight: 900;
}

.related-block {
  margin-bottom: 48px;
}

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

.rank-row {
  display: grid;
  grid-template-columns: 54px 90px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.05);
}

.rank-cover img {
  width: 90px;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 14px;
}

.rank-row h2 {
  margin: 0 0 8px;
  font-size: 20px;
}

.rank-row p {
  margin: 0 0 8px;
  color: var(--muted);
  line-height: 1.7;
}

.rank-row small {
  color: #c4b5fd;
}

.site-footer {
  margin-top: 54px;
  border-top: 1px solid var(--line);
  background: rgba(7, 10, 20, 0.76);
}

.footer-grid {
  width: min(1380px, calc(100% - 32px));
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 36px 0;
  color: var(--muted);
}

.footer-brand {
  color: white;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

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

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

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

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

  .rank-card {
    position: static;
  }
}

@media (max-width: 860px) {
  .nav-toggle {
    display: inline-grid;
    place-items: center;
  }

  .main-nav {
    position: absolute;
    left: 16px;
    right: 16px;
    top: 76px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: rgba(7, 10, 20, 0.96);
  }

  .main-nav.is-open {
    display: flex;
  }

  .hero-slide,
  .detail-hero,
  .search-panel,
  .category-hero,
  .small-hero {
    grid-template-columns: 1fr;
  }

  .hero-shell,
  .hero-track,
  .hero-slide {
    min-height: auto;
  }

  .hero-slide {
    padding-bottom: 82px;
  }

  .hero-poster {
    width: min(260px, 72vw);
    transform: none;
  }

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

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

  .footer-grid,
  .section-title-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .rank-row {
    grid-template-columns: 38px 76px minmax(0, 1fr);
  }

  .rank-cover img {
    width: 76px;
  }
}

@media (max-width: 520px) {
  .nav-wrap,
  main,
  .page-main,
  .detail-main,
  .footer-grid {
    width: min(100% - 22px, 1380px);
  }

  .hero-content h1 {
    font-size: 34px;
  }

  .category-grid,
  .movie-grid,
  .compact-grid,
  .mini-grid {
    grid-template-columns: 1fr;
  }

  .search-box {
    flex-direction: column;
  }

  .search-box button {
    min-height: 42px;
  }
}
