:root {
  --bg: #020617;
  --bg-soft: #0f172a;
  --bg-card: rgba(15, 23, 42, 0.72);
  --bg-card-solid: #111827;
  --line: rgba(148, 163, 184, 0.16);
  --text: #f8fafc;
  --muted: #94a3b8;
  --soft: #cbd5e1;
  --emerald: #10b981;
  --emerald-dark: #059669;
  --cyan: #22d3ee;
  --shadow: 0 24px 70px rgba(2, 6, 23, 0.38);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(circle at 8% 0%, rgba(16, 185, 129, 0.14), transparent 32rem),
    radial-gradient(circle at 92% 4%, rgba(34, 211, 238, 0.12), transparent 28rem),
    linear-gradient(180deg, #020617 0%, #0f172a 45%, #020617 100%);
  color: var(--text);
  min-height: 100vh;
}

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

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

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

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

.header-inner,
.footer-inner,
.content-section,
.page-hero,
.breadcrumb,
.detail-layout,
.quick-search {
  width: min(1180px, calc(100% - 32px));
  margin-inline: auto;
}

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

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--emerald), var(--cyan));
  color: #031018;
  font-size: 15px;
  box-shadow: 0 12px 30px rgba(16, 185, 129, 0.32);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-link {
  color: var(--soft);
  padding: 10px 14px;
  border-radius: 999px;
  transition: background 0.2s ease, color 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
  color: #ffffff;
  background: rgba(16, 185, 129, 0.15);
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.8);
}

.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 4px auto;
  border-radius: 999px;
  background: var(--text);
}

.hero {
  position: relative;
  height: min(70vh, 720px);
  min-height: 540px;
  overflow: hidden;
  background: #020617;
}

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1s ease;
}

.hero-slide.active {
  opacity: 1;
  z-index: 1;
}

.hero-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.03);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(2, 6, 23, 0.88) 0%, rgba(2, 6, 23, 0.58) 38%, rgba(2, 6, 23, 0.14) 100%),
    linear-gradient(0deg, #020617 0%, rgba(2, 6, 23, 0.1) 44%);
}

.hero-content {
  position: absolute;
  left: max(24px, calc((100vw - 1180px) / 2));
  right: 24px;
  bottom: clamp(70px, 11vw, 128px);
  z-index: 2;
  max-width: 760px;
}

.hero-tags,
.detail-meta,
.card-meta,
.quick-links,
.chip-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.hero-tags span,
.detail-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.64);
  border: 1px solid rgba(148, 163, 184, 0.18);
  color: #dbeafe;
  font-size: 14px;
}

.hero-tags span:first-child,
.detail-meta span:first-child {
  background: var(--emerald-dark);
  color: #ffffff;
  border-color: transparent;
}

.hero h1 {
  margin: 20px 0 16px;
  font-size: clamp(42px, 7vw, 76px);
  line-height: 0.98;
  letter-spacing: -0.06em;
  max-width: 820px;
}

.hero p {
  max-width: 660px;
  color: #e2e8f0;
  font-size: clamp(17px, 2.3vw, 22px);
  line-height: 1.72;
  margin: 0 0 28px;
}

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

.btn,
.quick-search-form button,
.search-page-form button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  padding: 12px 22px;
  font-weight: 800;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.btn:hover,
.quick-search-form button:hover,
.search-page-form button:hover {
  transform: translateY(-1px);
}

.btn.primary,
.quick-search-form button,
.search-page-form button {
  color: #022c22;
  background: linear-gradient(135deg, var(--emerald), var(--cyan));
  box-shadow: 0 20px 45px rgba(16, 185, 129, 0.26);
}

.btn.ghost {
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(15, 23, 42, 0.42);
}

.btn.ghost:hover {
  border-color: rgba(16, 185, 129, 0.5);
  background: rgba(16, 185, 129, 0.12);
}

.hero-arrow {
  position: absolute;
  top: 50%;
  z-index: 5;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  color: #ffffff;
  background: rgba(2, 6, 23, 0.48);
  font-size: 42px;
  line-height: 0;
  backdrop-filter: blur(14px);
  transition: background 0.2s ease;
}

.hero-arrow:hover {
  background: rgba(16, 185, 129, 0.7);
}

.hero-prev {
  left: 24px;
}

.hero-next {
  right: 24px;
}

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

.hero-dot {
  width: 12px;
  height: 12px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.45);
  transition: width 0.25s ease, background 0.25s ease;
}

.hero-dot.active {
  width: 32px;
  background: var(--emerald);
}

.quick-search {
  position: relative;
  z-index: 8;
  margin-top: -42px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: rgba(15, 23, 42, 0.86);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.quick-search-form,
.search-page-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
}

.quick-search-form input,
.search-page-form input,
.filter-bar input {
  width: 100%;
  min-height: 48px;
  color: var(--text);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 18px;
  background: rgba(2, 6, 23, 0.54);
  outline: none;
  padding: 0 16px;
}

.quick-search-form input:focus,
.search-page-form input:focus,
.filter-bar input:focus {
  border-color: rgba(16, 185, 129, 0.7);
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1);
}

.quick-links {
  margin-top: 16px;
}

.quick-links a,
.category-chip {
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--soft);
  background: rgba(15, 23, 42, 0.74);
  border: 1px solid var(--line);
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.quick-links a:hover,
.category-chip:hover,
.category-chip.active {
  color: #ffffff;
  border-color: rgba(16, 185, 129, 0.5);
  background: rgba(16, 185, 129, 0.14);
}

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

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

.eyebrow {
  display: inline-flex;
  color: var(--emerald);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.section-head h2,
.page-hero h1,
.detail-card h1,
.detail-card h2,
.side-card h2 {
  margin: 0;
  color: var(--text);
  letter-spacing: -0.04em;
}

.section-head h2 {
  font-size: clamp(28px, 4vw, 42px);
}

.more-link {
  color: var(--emerald);
  font-weight: 700;
}

.more-link:hover {
  color: var(--cyan);
}

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

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

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

.movie-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  border-radius: 22px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  box-shadow: 0 16px 48px rgba(2, 6, 23, 0.24);
  transition: transform 0.26s ease, box-shadow 0.26s ease, border-color 0.26s ease;
}

.movie-card:hover {
  transform: translateY(-6px);
  border-color: rgba(16, 185, 129, 0.45);
  box-shadow: 0 28px 80px rgba(2, 6, 23, 0.45);
}

.cover-wrap {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #111827;
}

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

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

.cover-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.76), transparent 56%);
  opacity: 0.78;
}

.badge {
  position: absolute;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  padding: 7px 9px;
}

.badge-region {
  top: 10px;
  left: 10px;
  color: #ffffff;
  background: var(--emerald-dark);
}

.badge-year {
  right: 10px;
  bottom: 10px;
  color: #ffffff;
  background: rgba(2, 6, 23, 0.76);
}

.play-badge {
  position: absolute;
  left: 50%;
  top: 50%;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 999px;
  color: #022c22;
  background: rgba(16, 185, 129, 0.92);
  transform: translate(-50%, -50%) scale(0.65);
  opacity: 0;
  transition: opacity 0.26s ease, transform 0.26s ease;
}

.movie-card:hover .play-badge {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.card-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
}

.card-body strong {
  color: #ffffff;
  font-size: 17px;
  line-height: 1.35;
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  transition: color 0.2s ease;
}

.movie-card:hover .card-body strong {
  color: var(--emerald);
}

.card-desc {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.card-meta {
  justify-content: space-between;
  color: #64748b;
  font-size: 12px;
}

.movie-card-small {
  display: grid;
  grid-template-columns: 112px 1fr;
  border-radius: 16px;
}

.movie-card-small .cover-wrap {
  aspect-ratio: auto;
  height: 100%;
  min-height: 92px;
}

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

.movie-card-small .card-desc,
.movie-card-small .badge-year,
.movie-card-small .play-badge {
  display: none;
}

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

.category-card {
  display: flex;
  flex-direction: column;
  min-height: 210px;
  overflow: hidden;
  border-radius: 24px;
  padding: 18px;
  border: 1px solid var(--line);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.12), rgba(15, 23, 42, 0.9));
  transition: transform 0.25s ease, border-color 0.25s ease;
}

.category-card:hover {
  transform: translateY(-4px);
  border-color: rgba(16, 185, 129, 0.5);
}

.category-card strong {
  margin-top: auto;
  color: #ffffff;
  font-size: 20px;
}

.category-card span:not(.category-cover-stack) {
  color: var(--muted);
  line-height: 1.6;
  margin-top: 8px;
}

.category-card em {
  margin-top: 14px;
  color: var(--emerald);
  font-style: normal;
  font-weight: 800;
}

.category-cover-stack {
  display: flex;
  min-height: 74px;
  margin-bottom: 16px;
}

.category-cover-stack img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 18px;
  border: 3px solid rgba(15, 23, 42, 0.9);
  margin-right: -20px;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.24);
}

.section-panel,
.detail-card,
.side-card {
  border: 1px solid var(--line);
  border-radius: 28px;
  background: rgba(15, 23, 42, 0.58);
  box-shadow: var(--shadow);
}

.section-panel {
  padding: clamp(22px, 4vw, 40px);
}

.split-section {
  display: grid;
  grid-template-columns: 0.88fr 1.12fr;
  gap: 24px;
  align-items: start;
}

.rank-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.rank-row {
  display: grid;
  grid-template-columns: 44px 92px 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 12px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 18px;
  background: rgba(2, 6, 23, 0.32);
  transition: transform 0.22s ease, border-color 0.22s ease, background 0.22s ease;
}

.rank-row:hover {
  transform: translateX(4px);
  border-color: rgba(16, 185, 129, 0.45);
  background: rgba(16, 185, 129, 0.08);
}

.rank-no {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  color: #022c22;
  background: linear-gradient(135deg, var(--emerald), var(--cyan));
  font-weight: 900;
}

.rank-row img {
  width: 92px;
  height: 58px;
  object-fit: cover;
  border-radius: 12px;
  background: #111827;
}

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

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

.rank-info strong {
  color: #ffffff;
  margin-bottom: 6px;
}

.rank-info span,
.rank-tags {
  color: var(--muted);
  font-size: 13px;
}

.page-main {
  padding-top: 32px;
}

.page-hero {
  padding: clamp(44px, 8vw, 84px);
  border: 1px solid var(--line);
  border-radius: 34px;
  background:
    radial-gradient(circle at 12% 0%, rgba(16, 185, 129, 0.24), transparent 28rem),
    radial-gradient(circle at 86% 10%, rgba(34, 211, 238, 0.16), transparent 24rem),
    rgba(15, 23, 42, 0.6);
  box-shadow: var(--shadow);
}

.page-hero h1 {
  font-size: clamp(36px, 5vw, 62px);
}

.page-hero p {
  max-width: 720px;
  color: var(--soft);
  line-height: 1.8;
  font-size: 18px;
  margin: 16px 0 0;
}

.chip-row {
  margin-top: 26px;
}

.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(15, 23, 42, 0.7);
}

.filter-bar input {
  flex: 1 1 260px;
}

.filter-btn {
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--soft);
  background: rgba(2, 6, 23, 0.45);
}

.filter-btn.active,
.filter-btn:hover {
  color: #ffffff;
  border-color: rgba(16, 185, 129, 0.5);
  background: rgba(16, 185, 129, 0.18);
}

.full-rank {
  gap: 10px;
}

.search-page-form {
  max-width: 760px;
  margin-top: 28px;
}

.search-status {
  color: var(--muted);
  margin-bottom: 24px;
}

.search-grid .movie-card {
  display: none;
}

.search-grid.search-active .movie-card {
  display: flex;
}

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

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

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(320px, 0.8fr);
  gap: 26px;
  align-items: start;
}

.detail-primary {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.player-shell {
  position: relative;
  overflow: hidden;
  border-radius: 28px;
  aspect-ratio: 16 / 9;
  border: 1px solid rgba(16, 185, 129, 0.28);
  background: #020617;
  box-shadow: var(--shadow);
}

.player-shell video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #020617;
}

.play-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border: 0;
  color: #022c22;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.14), rgba(2, 6, 23, 0.58));
  transition: opacity 0.25s ease;
}

.play-overlay span {
  display: grid;
  place-items: center;
  width: 86px;
  height: 86px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--emerald), var(--cyan));
  font-size: 34px;
  box-shadow: 0 22px 48px rgba(16, 185, 129, 0.36);
}

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

.detail-card,
.side-card {
  padding: clamp(20px, 3vw, 30px);
}

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

.detail-card h1 {
  font-size: clamp(30px, 4vw, 48px);
}

.detail-card h2,
.side-card h2 {
  font-size: 24px;
  margin: 24px 0 14px;
}

.detail-card p {
  color: var(--soft);
  line-height: 1.92;
  margin: 0;
}

.detail-card .lead-text {
  color: var(--emerald);
  font-size: 18px;
  font-style: italic;
  margin-bottom: 14px;
}

.detail-sidebar {
  position: sticky;
  top: 96px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.cover-side img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 20px;
  background: #111827;
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.tag-cloud a {
  color: var(--soft);
  padding: 8px 11px;
  border-radius: 999px;
  background: rgba(2, 6, 23, 0.46);
  border: 1px solid var(--line);
}

.tag-cloud a:hover {
  color: #ffffff;
  background: rgba(16, 185, 129, 0.16);
}

.related-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

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

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 34px 0;
  color: var(--muted);
}

.footer-inner strong {
  color: #ffffff;
  font-size: 18px;
}

.footer-inner p {
  margin: 8px 0 0;
}

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

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

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

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

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

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

  .detail-sidebar {
    position: static;
  }
}

@media (max-width: 780px) {
  .header-inner {
    min-height: 64px;
  }

  .nav-toggle {
    display: block;
  }

  .site-nav {
    position: absolute;
    left: 16px;
    right: 16px;
    top: 72px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: rgba(2, 6, 23, 0.95);
  }

  .site-nav.open {
    display: flex;
  }

  .nav-link {
    border-radius: 14px;
  }

  .hero {
    min-height: 620px;
  }

  .hero-arrow {
    display: none;
  }

  .hero-content {
    left: 18px;
    right: 18px;
    bottom: 82px;
  }

  .quick-search-form,
  .search-page-form {
    grid-template-columns: 1fr;
  }

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

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

  .rank-row {
    grid-template-columns: 34px 84px 1fr;
  }

  .rank-tags {
    display: none;
  }

  .filter-bar {
    flex-wrap: wrap;
  }

  .filter-bar input {
    flex-basis: 100%;
  }

  .page-hero {
    padding: 34px 22px;
    border-radius: 26px;
  }
}

@media (max-width: 520px) {
  .brand {
    font-size: 19px;
  }

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

  .movie-card-small {
    grid-template-columns: 100px 1fr;
  }

  .hero h1 {
    font-size: 38px;
  }

  .content-section {
    padding-top: 54px;
  }

  .rank-row {
    grid-template-columns: 32px 72px 1fr;
    gap: 10px;
  }

  .rank-row img {
    width: 72px;
    height: 52px;
  }
}
