:root {
  color-scheme: dark;
  --bg: #020617;
  --bg-soft: #0f172a;
  --bg-card: rgba(15, 23, 42, 0.86);
  --line: rgba(148, 163, 184, 0.18);
  --text: #f8fafc;
  --muted: #cbd5e1;
  --soft: #94a3b8;
  --gold: #facc15;
  --gold-deep: #fb923c;
  --blue: #1e3a8a;
  --radius: 22px;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.36);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 20% 0%, rgba(250, 204, 21, 0.12), transparent 28rem),
    radial-gradient(circle at 80% 10%, rgba(30, 58, 138, 0.36), transparent 34rem),
    linear-gradient(180deg, #020617 0%, #172554 46%, #020617 100%);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  line-height: 1.6;
}

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

button,
input,
select {
  font: inherit;
}

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

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

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

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  color: #111827;
  background: linear-gradient(135deg, var(--gold), var(--gold-deep));
  box-shadow: 0 10px 28px rgba(250, 204, 21, 0.26);
}

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

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

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

.main-nav a:hover {
  color: var(--gold);
  background: rgba(255, 255, 255, 0.08);
}

.top-search {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 280px;
}

.top-search input,
.filter-controls input,
.filter-controls select {
  width: 100%;
  color: var(--text);
  background: rgba(15, 23, 42, 0.82);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 14px;
  outline: none;
}

.top-search input:focus,
.filter-controls input:focus,
.filter-controls select:focus {
  border-color: rgba(250, 204, 21, 0.76);
  box-shadow: 0 0 0 4px rgba(250, 204, 21, 0.1);
}

.top-search button,
.primary-btn,
.secondary-btn,
.play-button {
  cursor: pointer;
  border: 0;
  border-radius: 999px;
  color: #111827;
  background: linear-gradient(135deg, var(--gold), var(--gold-deep));
  font-weight: 800;
  padding: 10px 18px;
  box-shadow: 0 12px 34px rgba(250, 204, 21, 0.24);
  transition: transform 0.25s ease, filter 0.25s ease;
}

.secondary-btn {
  color: var(--text);
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: none;
}

.top-search button:hover,
.primary-btn:hover,
.secondary-btn:hover,
.play-button:hover {
  transform: translateY(-2px) scale(1.02);
  filter: brightness(1.06);
}

.menu-toggle {
  display: none;
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px 11px;
}

main {
  overflow: hidden;
}

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

.hero {
  position: relative;
  min-height: calc(100vh - 72px);
  display: grid;
  align-items: center;
  isolation: isolate;
  overflow: hidden;
}

.hero-slide {
  position: absolute;
  inset: 0;
  display: grid;
  align-items: center;
  opacity: 0;
  background-position: center;
  background-size: cover;
  transform: scale(1.02);
  transition: opacity 0.7s ease, transform 1.2s ease;
}

.hero-slide::after {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(2, 6, 23, 0.92), rgba(15, 23, 42, 0.62), rgba(2, 6, 23, 0.16)),
    linear-gradient(0deg, #020617 0%, rgba(2, 6, 23, 0.18) 42%, rgba(2, 6, 23, 0.56) 100%);
}

.hero-slide.active {
  opacity: 1;
  transform: scale(1);
}

.hero-content {
  position: relative;
  z-index: 2;
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
  padding: 70px 0;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) 360px;
  gap: 34px;
  align-items: end;
}

.hero-copy {
  animation: fadeIn 0.72s ease both;
}

.eyebrow,
.score,
.detail-label {
  display: inline-flex;
  align-items: center;
  width: max-content;
  border-radius: 999px;
  color: #111827;
  background: linear-gradient(135deg, var(--gold), var(--gold-deep));
  font-size: 13px;
  font-weight: 800;
  padding: 5px 10px;
}

.hero h1,
.page-hero h1 {
  margin: 18px 0 16px;
  font-size: clamp(42px, 7vw, 82px);
  line-height: 1.02;
  letter-spacing: -0.06em;
}

.hero p,
.page-hero p {
  max-width: 780px;
  color: var(--muted);
  font-size: clamp(17px, 2vw, 22px);
}

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

.hero-panel {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(15, 23, 42, 0.62);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.hero-panel h2 {
  margin: 0 0 12px;
  font-size: 20px;
}

.mini-rank {
  display: grid;
  gap: 10px;
}

.mini-rank a {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  border-radius: 14px;
  padding: 9px;
  background: rgba(255, 255, 255, 0.06);
}

.mini-rank span:first-child {
  color: var(--gold);
  font-weight: 900;
}

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

.hero-dots button {
  width: 36px;
  height: 5px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.34);
  cursor: pointer;
}

.hero-dots button.active {
  background: var(--gold);
}

.page-hero {
  padding: 72px 0 36px;
}

.section {
  padding: 46px 0;
}

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

.section-head h2,
.filter-panel h2 {
  margin: 0;
  font-size: clamp(26px, 3vw, 38px);
  letter-spacing: -0.03em;
}

.section-head p,
.filter-panel p {
  margin: 8px 0 0;
  color: var(--soft);
}

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

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

.movie-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-card);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.24);
  transition: transform 0.28s ease, border-color 0.28s ease, box-shadow 0.28s ease;
}

.movie-card:hover {
  transform: translateY(-8px);
  border-color: rgba(250, 204, 21, 0.52);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
}

.poster {
  position: relative;
  display: block;
  aspect-ratio: 2 / 3;
  background-color: #111827;
  background-position: center;
  background-size: cover;
}

.play-dot {
  position: absolute;
  left: 50%;
  top: 50%;
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 999px;
  color: #111827;
  background: rgba(250, 204, 21, 0.92);
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.86);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

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

.poster .score {
  position: absolute;
  top: 12px;
  right: 12px;
}

.card-body {
  padding: 15px;
}

.card-title,
.rank-title {
  display: block;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.35;
}

.card-title:hover,
.rank-title:hover {
  color: var(--gold);
}

.card-meta,
.rank-meta,
.detail-meta {
  color: var(--soft);
  font-size: 13px;
  margin-top: 6px;
}

.card-body p {
  min-height: 48px;
  margin: 10px 0 12px;
  color: var(--muted);
  font-size: 14px;
}

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

.tag-row span {
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.06);
  font-size: 12px;
  padding: 4px 8px;
}

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

.category-card {
  min-height: 160px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(250, 204, 21, 0.16), transparent 42%),
    linear-gradient(180deg, rgba(30, 58, 138, 0.72), rgba(15, 23, 42, 0.9));
  transition: transform 0.25s ease, border-color 0.25s ease;
}

.category-card:hover {
  transform: translateY(-6px);
  border-color: rgba(250, 204, 21, 0.5);
}

.category-card strong {
  font-size: 20px;
}

.category-card p {
  color: var(--muted);
  margin: 8px 0 0;
}

.filter-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  margin: 22px 0 28px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(15, 23, 42, 0.66);
}

.filter-controls {
  display: flex;
  gap: 12px;
  width: min(520px, 100%);
}

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

.rank-row {
  display: grid;
  grid-template-columns: 64px 86px minmax(0, 1fr) 110px;
  align-items: center;
  gap: 16px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.72);
}

.rank-num {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 16px;
  color: #111827;
  background: linear-gradient(135deg, var(--gold), var(--gold-deep));
  font-weight: 900;
}

.rank-thumb {
  display: block;
  width: 86px;
  aspect-ratio: 16 / 10;
  border-radius: 14px;
  background-position: center;
  background-size: cover;
  background-color: #111827;
}

.rank-info p {
  margin: 5px 0 0;
  color: var(--muted);
}

.rank-heat {
  color: var(--gold);
  font-weight: 800;
  text-align: right;
}

.detail-shell {
  padding: 44px 0;
}

.breadcrumb {
  color: var(--soft);
  margin-bottom: 18px;
}

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

.detail-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 26px;
  align-items: stretch;
}

.player-wrap {
  position: relative;
  overflow: hidden;
  min-height: 420px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: #000;
  box-shadow: var(--shadow);
}

.player-wrap video {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 420px;
  object-fit: contain;
  background: #000;
}

.player-cover {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background-position: center;
  background-size: cover;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.player-cover::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle, rgba(250, 204, 21, 0.18), transparent 28rem),
    linear-gradient(180deg, rgba(2, 6, 23, 0.42), rgba(2, 6, 23, 0.88));
}

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

.play-card {
  position: relative;
  z-index: 2;
  width: min(520px, calc(100% - 32px));
  text-align: center;
  padding: 30px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 28px;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(16px);
}

.play-card h1 {
  margin: 14px 0 8px;
  font-size: clamp(26px, 4vw, 44px);
}

.detail-side {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: rgba(15, 23, 42, 0.72);
}

.detail-poster {
  aspect-ratio: 2 / 3;
  border-radius: 22px;
  background-position: center;
  background-size: cover;
  background-color: #111827;
  margin-bottom: 18px;
}

.content-panel {
  margin-top: 26px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 26px;
}

.article-card {
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: rgba(15, 23, 42, 0.72);
}

.article-card h2 {
  margin: 0 0 12px;
  font-size: 26px;
}

.article-card p {
  color: var(--muted);
  margin: 0 0 18px;
}

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

.related-item {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.05);
}

.related-thumb {
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  background-position: center;
  background-size: cover;
  background-color: #111827;
}

.related-item strong {
  display: block;
}

.related-item span {
  color: var(--soft);
  font-size: 13px;
}

.empty-state {
  display: none;
  padding: 32px;
  text-align: center;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(15, 23, 42, 0.66);
}

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

.site-footer {
  margin-top: 34px;
  padding: 46px 0 24px;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.86), #020617);
  border-top: 1px solid var(--line);
}

.footer-grid {
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) repeat(2, 220px);
  gap: 28px;
}

.footer-grid p,
.footer-grid a {
  color: var(--soft);
}

.footer-grid a {
  display: block;
  margin-top: 8px;
}

.footer-grid a:hover {
  color: var(--gold);
}

.footer-bottom {
  width: min(1240px, calc(100% - 32px));
  margin: 28px auto 0;
  padding-top: 18px;
  color: var(--soft);
  border-top: 1px solid var(--line);
  text-align: center;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

  .hero-content,
  .detail-hero,
  .content-panel {
    grid-template-columns: 1fr;
  }

  .hero-panel {
    max-width: 520px;
  }

  .detail-side {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 18px;
  }

  .detail-poster {
    margin-bottom: 0;
  }
}

@media (max-width: 820px) {
  .header-inner {
    flex-wrap: wrap;
    padding: 12px 0;
  }

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

  .main-nav {
    display: none;
    order: 4;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    padding: 8px 0;
  }

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

  .top-search {
    order: 3;
    width: 100%;
    min-width: 0;
  }

  .hero {
    min-height: 720px;
  }

  .hero-content {
    padding-top: 92px;
  }

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

  .filter-panel,
  .filter-controls {
    flex-direction: column;
    align-items: stretch;
  }

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

  .rank-heat {
    grid-column: 3;
    text-align: left;
  }

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

@media (max-width: 540px) {
  .movie-grid,
  .movie-grid.dense,
  .category-grid {
    grid-template-columns: 1fr;
  }

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

  .primary-btn,
  .secondary-btn,
  .play-button {
    text-align: center;
    width: 100%;
  }

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

  .rank-thumb {
    display: none;
  }

  .rank-info {
    grid-column: 2;
  }

  .rank-heat {
    grid-column: 2;
  }
}
