:root {
  --bg: #020617;
  --bg-soft: #0f172a;
  --bg-card: #111827;
  --bg-card-2: #1e293b;
  --line: #1f2937;
  --line-soft: rgba(148, 163, 184, 0.16);
  --text: #f8fafc;
  --muted: #94a3b8;
  --muted-2: #64748b;
  --amber: #f59e0b;
  --amber-2: #fbbf24;
  --red: #ef4444;
  --shadow: 0 24px 80px rgba(2, 6, 23, 0.45);
  --radius: 22px;
  --container: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(245, 158, 11, 0.12), transparent 32rem),
    radial-gradient(circle at top right, rgba(239, 68, 68, 0.08), transparent 28rem),
    var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  line-height: 1.6;
}

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

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

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  border-bottom: 1px solid rgba(30, 41, 59, 0.9);
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(18px);
}

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

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

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  color: #111827;
  background: linear-gradient(135deg, var(--amber), var(--amber-2));
  border-radius: 12px;
  font-weight: 900;
  box-shadow: 0 10px 32px rgba(245, 158, 11, 0.28);
}

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

.brand-copy strong {
  font-size: 20px;
  letter-spacing: -0.02em;
}

.brand-copy small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

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

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

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

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

.header-search input,
.mobile-search input,
.hero-search input,
.search-panel input,
.search-panel select,
.inline-filter input {
  width: 100%;
  color: var(--text);
  background: rgba(15, 23, 42, 0.82);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 999px;
  outline: none;
  padding: 11px 14px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

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

.header-search input:focus,
.mobile-search input:focus,
.hero-search input:focus,
.search-panel input:focus,
.search-panel select:focus,
.inline-filter input:focus {
  border-color: rgba(245, 158, 11, 0.72);
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.12);
}

.header-search button,
.mobile-search button,
.hero-search button {
  border: 0;
  color: #111827;
  background: var(--amber);
  border-radius: 999px;
  padding: 10px 16px;
  font-weight: 800;
}

.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  margin-left: auto;
  border: 0;
  background: transparent;
  padding: 8px;
}

.menu-toggle span {
  width: 24px;
  height: 2px;
  background: var(--text);
  border-radius: 99px;
}

.mobile-panel {
  display: none;
  padding: 12px 16px 18px;
  border-top: 1px solid var(--line);
  background: rgba(15, 23, 42, 0.98);
}

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

.hero {
  position: relative;
  min-height: 72vh;
  overflow: hidden;
  background: #020617;
}

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

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

.hero-bg,
.detail-bg {
  position: absolute;
  inset: 0;
  background-position: center;
  background-size: cover;
  filter: saturate(1.08);
  transform: scale(1.03);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(2, 6, 23, 0.96) 0%, rgba(2, 6, 23, 0.78) 38%, rgba(2, 6, 23, 0.36) 100%),
    linear-gradient(0deg, #020617 0%, rgba(2, 6, 23, 0.16) 40%, rgba(2, 6, 23, 0.82) 100%);
}

.hero-content {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  align-items: center;
  gap: 54px;
  min-height: 72vh;
  padding: 70px 0 110px;
}

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

.eyebrow {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  color: var(--amber-2);
  background: rgba(245, 158, 11, 0.11);
  border: 1px solid rgba(245, 158, 11, 0.22);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.hero h1,
.page-hero h1,
.detail-intro h1 {
  margin: 18px 0 16px;
  font-size: clamp(34px, 6vw, 70px);
  line-height: 1.02;
  letter-spacing: -0.06em;
}

.hero p,
.page-hero p,
.detail-intro p {
  max-width: 760px;
  margin: 0;
  color: #dbeafe;
  font-size: clamp(17px, 2vw, 22px);
}

.hero-tags,
.detail-tags,
.category-switches {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 26px 0;
}

.hero-tags span,
.detail-tags span,
.category-switches a {
  color: #e2e8f0;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 13px;
}

.hero-actions,
.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

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

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  color: #111827;
  background: linear-gradient(135deg, var(--amber), var(--amber-2));
  box-shadow: 0 16px 38px rgba(245, 158, 11, 0.28);
}

.btn-ghost {
  color: var(--text);
  background: rgba(15, 23, 42, 0.68);
  border: 1px solid rgba(148, 163, 184, 0.24);
}

.hero-poster {
  position: relative;
  display: block;
  border-radius: 30px;
  overflow: hidden;
  border: 1px solid rgba(245, 158, 11, 0.2);
  box-shadow: var(--shadow);
  transform: rotate(2deg);
}

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

.hero-poster span {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 18px;
  display: grid;
  place-items: center;
  min-height: 42px;
  color: #111827;
  background: rgba(245, 158, 11, 0.94);
  border-radius: 999px;
  font-weight: 900;
}

.hero-controls {
  position: absolute;
  z-index: 3;
  left: 50%;
  bottom: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  transform: translateX(-50%);
}

.hero-dots {
  display: flex;
  gap: 8px;
}

.hero-dot {
  width: 12px;
  height: 12px;
  border: 0;
  border-radius: 999px;
  background: rgba(226, 232, 240, 0.34);
  transition: width 0.2s ease, background 0.2s ease;
}

.hero-dot.active {
  width: 34px;
  background: var(--amber);
}

.hero-search {
  width: min(520px, 55vw);
  padding: 8px;
  background: rgba(2, 6, 23, 0.62);
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 999px;
  backdrop-filter: blur(12px);
}

.section {
  padding: 62px 0;
}

.section-heading,
.category-overview-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 26px;
}

.section-heading.compact {
  margin-bottom: 20px;
}

.section h2,
.panel-heading h2,
.content-card h2,
.category-overview-card h2 {
  margin: 10px 0 0;
  font-size: clamp(25px, 3vw, 38px);
  line-height: 1.14;
  letter-spacing: -0.04em;
}

.section-link {
  color: var(--amber);
  font-weight: 800;
}

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

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

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

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

.movie-card {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.92), rgba(15, 23, 42, 0.96));
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: var(--radius);
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.18);
  transition: transform 0.24s ease, border-color 0.24s ease, box-shadow 0.24s ease;
}

.movie-card:hover {
  transform: translateY(-6px);
  border-color: rgba(245, 158, 11, 0.38);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
}

.poster-frame {
  position: relative;
  overflow: hidden;
  display: block;
  background:
    linear-gradient(135deg, rgba(245, 158, 11, 0.16), rgba(239, 68, 68, 0.08)),
    #0f172a;
}

.poster-frame img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  transition: transform 0.45s ease, filter 0.45s ease;
}

.movie-card:hover .poster-frame img,
.rank-item:hover img,
.category-tile:hover img {
  transform: scale(1.08);
  filter: saturate(1.12);
}

.poster-badge {
  position: absolute;
  left: 12px;
  top: 12px;
  color: #111827;
  background: rgba(245, 158, 11, 0.94);
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 900;
}

.poster-play {
  position: absolute;
  right: 12px;
  bottom: 12px;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: #111827;
  background: rgba(248, 250, 252, 0.92);
  border-radius: 999px;
  font-size: 18px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

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

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

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

.movie-card h3 a:hover {
  color: var(--amber);
}

.movie-card-line {
  display: -webkit-box;
  min-height: 3.1em;
  margin: 0 0 14px;
  overflow: hidden;
  color: #cbd5e1;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.movie-meta,
.movie-heat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}

.movie-meta {
  padding-top: 12px;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
}

.movie-heat {
  margin-top: 8px;
}

.movie-heat a {
  color: var(--amber);
  font-weight: 800;
}

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

.compact-card h3,
.mini-card h3 {
  font-size: 16px;
}

.mini-card .movie-card-line,
.mini-card .movie-meta {
  display: none;
}

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

.ranking-panel,
.content-card,
.category-overview-card,
.search-panel,
.player-card {
  background: rgba(15, 23, 42, 0.86);
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: var(--radius);
  box-shadow: 0 18px 70px rgba(0, 0, 0, 0.18);
}

.ranking-panel {
  position: sticky;
  top: 92px;
  padding: 22px;
}

.rank-item {
  display: grid;
  grid-template-columns: 44px 82px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

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

.rank-number {
  color: var(--amber);
  font-size: 22px;
  font-weight: 950;
}

.rank-item img {
  width: 82px;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 12px;
  background: #0f172a;
}

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

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

.rank-copy small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

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

.category-tile {
  position: relative;
  overflow: hidden;
  min-height: 180px;
  padding: 22px;
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.92), rgba(15, 23, 42, 0.92));
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: var(--radius);
}

.tile-covers {
  display: flex;
  gap: 8px;
  margin-bottom: 22px;
}

.tile-covers img {
  width: 25%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 12px;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.28);
}

.category-tile span {
  display: block;
  font-size: 24px;
  font-weight: 950;
}

.category-tile small {
  color: var(--muted);
}

.page-hero,
.detail-hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.98), rgba(2, 6, 23, 0.96));
}

.small-hero {
  padding: 78px 0 58px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.small-hero p {
  color: #cbd5e1;
}

.category-overview-list {
  display: grid;
  gap: 24px;
}

.category-overview-card {
  padding: 24px;
}

.category-overview-card p {
  max-width: 640px;
  margin: 10px 0 0;
  color: var(--muted);
}

.ranking-layout {
  display: grid;
  grid-template-columns: 1.05fr 1fr 1fr;
  gap: 24px;
  align-items: start;
}

.ranking-column {
  min-width: 0;
}

.rank-list.large {
  background: rgba(15, 23, 42, 0.62);
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: var(--radius);
  padding: 14px 20px;
}

.search-page {
  padding-top: 34px;
}

.search-panel {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 190px 150px auto;
  gap: 14px;
  align-items: end;
  padding: 18px;
  margin-bottom: 18px;
}

.search-panel label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-weight: 750;
}

.search-panel button {
  border: 0;
}

.search-summary {
  margin-bottom: 18px;
  color: var(--muted);
}

.inline-filter {
  margin: -4px 0 22px;
}

.inline-filter input {
  max-width: 430px;
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 34px;
}

.pagination a,
.pagination strong,
.pagination span {
  display: grid;
  place-items: center;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.14);
}

.pagination strong {
  color: #111827;
  background: var(--amber);
}

.detail-hero {
  min-height: 560px;
}

.detail-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(2, 6, 23, 0.98), rgba(2, 6, 23, 0.74), rgba(2, 6, 23, 0.36)),
    linear-gradient(0deg, #020617, transparent 55%);
}

.detail-hero-inner {
  position: relative;
  z-index: 2;
  padding: 34px 0 70px;
}

.back-link {
  display: inline-flex;
  margin-bottom: 30px;
  color: #cbd5e1;
  font-weight: 800;
}

.detail-hero-grid {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 38px;
  align-items: end;
}

.detail-poster {
  border-radius: 28px;
  border: 1px solid rgba(245, 158, 11, 0.24);
  box-shadow: var(--shadow);
}

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

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

.detail-main,
.detail-side {
  display: grid;
  gap: 22px;
}

.player-card {
  overflow: hidden;
}

.player-shell {
  position: relative;
  background: #000;
}

.movie-player {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
}

.player-start {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  gap: 10px;
  color: #111827;
  background: radial-gradient(circle at center, rgba(245, 158, 11, 0.18), rgba(2, 6, 23, 0.34));
  border: 0;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.player-start span {
  display: grid;
  place-items: center;
  width: 74px;
  height: 74px;
  color: #111827;
  background: var(--amber);
  border-radius: 999px;
  font-size: 28px;
  box-shadow: 0 18px 45px rgba(245, 158, 11, 0.32);
}

.player-start strong {
  color: var(--text);
  font-size: 18px;
}

.player-card.is-playing .player-start {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.source-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 16px;
  background: rgba(15, 23, 42, 0.98);
}

.source-tab {
  color: #cbd5e1;
  background: rgba(30, 41, 59, 0.86);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 999px;
  padding: 8px 14px;
}

.source-tab.active {
  color: #111827;
  background: var(--amber);
}

.content-card {
  padding: 24px;
}

.content-card p {
  color: #cbd5e1;
  white-space: pre-line;
}

.meta-card dl {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 10px 14px;
  margin: 18px 0 0;
}

.meta-card dt {
  color: var(--muted);
}

.meta-card dd {
  margin: 0;
  color: #e2e8f0;
}

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

.site-footer {
  margin-top: 50px;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(15, 23, 42, 0.82);
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) 1fr 1fr;
  gap: 32px;
  padding: 42px 0;
}

.site-footer h2 {
  margin: 0 0 14px;
  font-size: 18px;
}

.site-footer p,
.site-footer a {
  color: var(--muted);
}

.site-footer p {
  max-width: 560px;
}

.site-footer ul {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
}

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

@media (max-width: 1080px) {
  .header-search {
    display: none;
  }

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

  .hero-poster {
    display: none;
  }

  .ranking-panel {
    position: static;
  }

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

@media (max-width: 820px) {
  .main-nav {
    display: none;
  }

  .menu-toggle {
    display: flex;
  }

  .hero {
    min-height: 78vh;
  }

  .hero-content {
    min-height: 78vh;
    padding: 54px 0 130px;
  }

  .hero-controls {
    display: grid;
    justify-items: start;
  }

  .hero-search {
    width: min(100%, 560px);
  }

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

  .section-heading,
  .category-overview-head,
  .detail-hero-grid,
  .footer-grid,
  .search-panel {
    grid-template-columns: 1fr;
    display: grid;
  }

  .detail-hero-grid {
    align-items: start;
  }

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

@media (max-width: 560px) {
  .container {
    width: min(100% - 22px, var(--container));
  }

  .brand-copy strong {
    font-size: 17px;
  }

  .brand-copy small {
    display: none;
  }

  .hero h1,
  .page-hero h1,
  .detail-intro h1 {
    font-size: 34px;
  }

  .hero p,
  .page-hero p,
  .detail-intro p {
    font-size: 16px;
  }

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

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

  .rank-item img {
    width: 72px;
  }

  .content-card,
  .ranking-panel,
  .category-overview-card {
    padding: 18px;
  }
}
