:root {
  --page-bg: #0c0a09;
  --panel-bg: #1c1917;
  --panel-soft: #292524;
  --panel-deep: #151210;
  --line: rgba(245, 158, 11, 0.22);
  --line-soft: rgba(255, 255, 255, 0.08);
  --text: #f8f4ec;
  --muted: #c5b9aa;
  --subtle: #8b8278;
  --brand: #f59e0b;
  --brand-deep: #b45309;
  --brand-soft: rgba(245, 158, 11, 0.15);
  --red-soft: rgba(127, 29, 29, 0.32);
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
  --radius: 18px;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(245, 158, 11, 0.16), transparent 32rem),
    radial-gradient(circle at 80% 10%, rgba(127, 29, 29, 0.18), transparent 28rem),
    var(--page-bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  line-height: 1.65;
}

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

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

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

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(12, 10, 9, 0.86);
  backdrop-filter: blur(20px);
}

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

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
  letter-spacing: 0.04em;
  color: #fff7ed;
  white-space: nowrap;
}

.logo-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--brand), #dc2626 80%);
  box-shadow: 0 14px 30px rgba(245, 158, 11, 0.28);
}

.logo-text {
  font-size: 1.1rem;
}

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

.site-nav a {
  padding: 9px 14px;
  border-radius: 999px;
  color: var(--muted);
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.site-nav a:hover,
.site-nav a.is-active {
  color: #fff;
  background: var(--brand-soft);
  transform: translateY(-1px);
}

.hero {
  position: relative;
  min-height: clamp(620px, 72vh, 820px);
  overflow: hidden;
  border-bottom: 1px solid var(--line-soft);
}

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

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

.hero-image,
.hero-fallback {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero-image {
  object-fit: cover;
  filter: saturate(1.06) contrast(1.05);
}

.hero-fallback {
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 20% 20%, rgba(245, 158, 11, 0.35), transparent 22rem),
    linear-gradient(135deg, #1c1917, #451a03 48%, #0c0a09);
  color: rgba(255, 255, 255, 0.16);
  font-size: clamp(4rem, 16vw, 11rem);
  font-weight: 900;
  letter-spacing: -0.08em;
}

.hero-image + .hero-fallback {
  display: none;
}

.hero-image.is-broken + .hero-fallback {
  display: grid;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(12, 10, 9, 0.95), rgba(12, 10, 9, 0.62) 42%, rgba(12, 10, 9, 0.14)),
    linear-gradient(to top, var(--page-bg), rgba(12, 10, 9, 0.05) 48%);
}

.hero-content {
  position: relative;
  min-height: clamp(620px, 72vh, 820px);
  display: grid;
  align-content: center;
  padding: 92px 0 120px;
}

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

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.36);
  color: #fbbf24;
  font-size: 0.92rem;
  font-weight: 800;
}

.hero-title {
  margin: 0 0 18px;
  color: #fff;
  font-size: clamp(2.7rem, 7vw, 6.2rem);
  line-height: 0.98;
  letter-spacing: -0.06em;
  text-shadow: 0 16px 50px rgba(0, 0, 0, 0.65);
}

.hero-desc {
  max-width: 640px;
  margin: 0 0 28px;
  color: #e7ded3;
  font-size: clamp(1rem, 2vw, 1.22rem);
}

.hero-meta,
.movie-meta,
.detail-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
}

.hero-meta {
  margin-bottom: 20px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.06);
  color: #f5eadb;
  font-size: 0.84rem;
}

.pill.is-brand {
  border-color: rgba(245, 158, 11, 0.36);
  background: rgba(245, 158, 11, 0.18);
  color: #fbbf24;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 11px 18px;
  border-radius: 13px;
  border: 1px solid transparent;
  color: #fff;
  background: var(--panel-soft);
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover {
  transform: translateY(-2px);
  border-color: var(--line);
}

.btn-primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-deep));
  box-shadow: 0 18px 44px rgba(245, 158, 11, 0.25);
  font-weight: 900;
}

.btn-primary:hover {
  box-shadow: 0 20px 55px rgba(245, 158, 11, 0.36);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
}

.hero-controls {
  position: absolute;
  left: 50%;
  bottom: 34px;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 10px;
  transform: translateX(-50%);
}

.hero-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.48);
  cursor: pointer;
  transition: width 0.2s ease, background 0.2s ease;
}

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

.hero-arrow {
  position: absolute;
  top: 50%;
  z-index: 4;
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.48);
  color: #fff;
  cursor: pointer;
  transform: translateY(-50%);
  transition: background 0.2s ease, transform 0.2s ease;
}

.hero-arrow:hover {
  background: rgba(0, 0, 0, 0.72);
  transform: translateY(-50%) scale(1.06);
}

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

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

.main {
  padding: 56px 0;
}

.section {
  margin-bottom: 68px;
}

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

.section-title {
  margin: 0;
  color: #fff7ed;
  font-size: clamp(1.6rem, 3vw, 2.35rem);
  line-height: 1.14;
  letter-spacing: -0.04em;
}

.section-kicker {
  margin: 0 0 6px;
  color: var(--brand);
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.section-desc {
  max-width: 720px;
  margin: 8px 0 0;
  color: var(--muted);
}

.scroll-row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(190px, 235px);
  gap: 18px;
  overflow-x: auto;
  padding: 3px 2px 18px;
  scroll-snap-type: x proximity;
}

.scroll-row > * {
  scroll-snap-align: start;
}

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

.movie-card {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(41, 37, 36, 0.72), rgba(28, 25, 23, 0.96));
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.18);
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

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

.poster-link,
.poster-frame {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 3 / 4;
  background:
    radial-gradient(circle at 24% 18%, rgba(245, 158, 11, 0.26), transparent 42%),
    linear-gradient(135deg, #292524, #0c0a09);
}

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

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

.poster-img.is-broken {
  display: none;
}

.poster-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  color: rgba(255, 255, 255, 0.72);
  text-align: center;
  font-size: 1rem;
  font-weight: 900;
}

.poster-overlay {
  position: absolute;
  inset: auto 0 0;
  min-height: 44%;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.92), transparent);
}

.rank-badge,
.type-badge {
  position: absolute;
  z-index: 2;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 900;
}

.rank-badge {
  top: 10px;
  left: 10px;
  min-width: 36px;
  padding: 5px 9px;
  background: linear-gradient(135deg, #facc15, #d97706);
  color: #1c1917;
  text-align: center;
}

.type-badge {
  right: 10px;
  bottom: 10px;
  padding: 5px 10px;
  background: rgba(0, 0, 0, 0.68);
  color: #fef3c7;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.movie-body {
  padding: 14px;
}

.movie-title {
  display: block;
  min-height: 2.9em;
  color: #fff;
  font-size: 1rem;
  font-weight: 900;
  line-height: 1.35;
}

.movie-title:hover {
  color: #fbbf24;
}

.movie-meta {
  margin-top: 8px;
  font-size: 0.82rem;
}

.movie-line {
  min-height: 3.75em;
  margin: 10px 0 12px;
  color: var(--muted);
  font-size: 0.88rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: #d7cec3;
  font-size: 0.75rem;
}

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

.category-tile {
  position: relative;
  overflow: hidden;
  min-height: 190px;
  padding: 24px;
  border: 1px solid var(--line-soft);
  border-radius: 24px;
  background:
    radial-gradient(circle at 78% 10%, rgba(245, 158, 11, 0.2), transparent 12rem),
    linear-gradient(145deg, rgba(41, 37, 36, 0.92), rgba(28, 25, 23, 0.88));
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.category-tile:hover {
  transform: translateY(-4px);
  border-color: rgba(245, 158, 11, 0.42);
}

.category-tile h3 {
  margin: 0 0 10px;
  color: #fff;
  font-size: 1.35rem;
}

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

.category-count {
  display: inline-flex;
  padding: 7px 11px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: #fbbf24;
  font-weight: 900;
}

.toolbar {
  display: grid;
  grid-template-columns: 1.6fr repeat(3, minmax(140px, 1fr));
  gap: 12px;
  margin: 22px 0 26px;
  padding: 16px;
  border: 1px solid var(--line-soft);
  border-radius: 22px;
  background: rgba(28, 25, 23, 0.78);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.22);
}

.input,
.select {
  width: 100%;
  min-height: 46px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  outline: none;
  background: rgba(12, 10, 9, 0.76);
  color: #fff;
}

.input {
  padding: 0 15px;
}

.select {
  padding: 0 12px;
}

.input:focus,
.select:focus {
  border-color: rgba(245, 158, 11, 0.62);
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.12);
}

.result-note {
  margin: -8px 0 18px;
  color: var(--subtle);
  font-size: 0.92rem;
}

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

.rank-item {
  display: grid;
  grid-template-columns: 60px 92px 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 18px;
  background: rgba(28, 25, 23, 0.78);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.rank-item:hover {
  transform: translateX(3px);
  border-color: rgba(245, 158, 11, 0.42);
}

.rank-number {
  color: #fbbf24;
  font-size: 1.6rem;
  font-weight: 950;
  text-align: center;
}

.rank-thumb {
  aspect-ratio: 3 / 4;
  border-radius: 12px;
  overflow: hidden;
  background: linear-gradient(135deg, #292524, #0c0a09);
}

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

.rank-info h3 {
  margin: 0 0 8px;
  color: #fff;
  font-size: 1.1rem;
}

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

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

.page-title {
  margin: 0;
  color: #fff;
  font-size: clamp(2.2rem, 5vw, 4.8rem);
  line-height: 1.02;
  letter-spacing: -0.06em;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
  color: var(--subtle);
  font-size: 0.94rem;
}

.breadcrumb a {
  color: #fbbf24;
}

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

.detail-panel,
.side-panel {
  border: 1px solid var(--line-soft);
  border-radius: 24px;
  background: rgba(28, 25, 23, 0.78);
  box-shadow: var(--shadow);
}

.detail-panel {
  overflow: hidden;
}

.player {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: #000;
}

.player video,
.player-poster,
.player-shade {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.player video {
  object-fit: contain;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.player video.is-ready {
  opacity: 1;
}

.player-poster {
  object-fit: cover;
  opacity: 0.62;
  filter: blur(0.4px) saturate(1.08);
}

.player-poster.is-broken {
  display: none;
}

.player-shade {
  background:
    radial-gradient(circle, rgba(245, 158, 11, 0.24), transparent 35%),
    linear-gradient(to top, rgba(0, 0, 0, 0.86), rgba(0, 0, 0, 0.2));
}

.play-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  text-align: center;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

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

.play-button {
  width: 86px;
  height: 86px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--brand), var(--brand-deep));
  color: #fff;
  font-size: 2.2rem;
  box-shadow: 0 20px 60px rgba(245, 158, 11, 0.34);
  cursor: pointer;
  transition: transform 0.2s ease;
}

.play-button:hover {
  transform: scale(1.06);
}

.player-caption {
  margin-top: 16px;
  color: #fff7ed;
  font-weight: 900;
}

.player-status {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.92rem;
}

.detail-content {
  padding: 28px;
}

.detail-title {
  margin: 0 0 14px;
  color: #fff;
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1.08;
  letter-spacing: -0.05em;
}

.detail-meta {
  margin-bottom: 20px;
}

.detail-section {
  margin-top: 26px;
}

.detail-section h2 {
  margin: 0 0 12px;
  color: #fef3c7;
  font-size: 1.35rem;
}

.detail-section p {
  margin: 0;
  color: #d7cec3;
}

.side-panel {
  padding: 20px;
  position: sticky;
  top: 92px;
}

.side-panel h2 {
  margin: 0 0 16px;
  color: #fff7ed;
  font-size: 1.25rem;
}

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

.related-item {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 12px;
  align-items: center;
  padding: 8px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  transition: background 0.2s ease;
}

.related-item:hover {
  background: rgba(245, 158, 11, 0.11);
}

.related-thumb {
  position: relative;
  overflow: hidden;
  aspect-ratio: 3 / 4;
  border-radius: 10px;
  background: linear-gradient(135deg, #292524, #0c0a09);
}

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

.related-title {
  color: #fff;
  font-weight: 900;
  line-height: 1.3;
}

.related-meta {
  margin-top: 5px;
  color: var(--subtle);
  font-size: 0.84rem;
}

.site-footer {
  margin-top: 72px;
  border-top: 1px solid var(--line-soft);
  background: rgba(0, 0, 0, 0.22);
}

.footer-inner {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 28px;
  padding: 36px 0;
  color: var(--muted);
}

.footer-inner strong {
  display: block;
  color: #fff7ed;
  margin-bottom: 10px;
}

.footer-links {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.footer-links a {
  color: #fbbf24;
}

.empty-state {
  display: none;
  padding: 32px;
  border: 1px dashed var(--line);
  border-radius: 20px;
  color: var(--muted);
  text-align: center;
}

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

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

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

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

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

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

  .side-panel {
    position: static;
  }
}

@media (max-width: 740px) {
  .header-inner {
    min-height: auto;
    padding: 14px 0;
    align-items: flex-start;
    flex-direction: column;
  }

  .site-nav {
    justify-content: flex-start;
    gap: 4px;
  }

  .site-nav a {
    padding: 7px 10px;
    font-size: 0.92rem;
  }

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

  .hero-arrow {
    display: none;
  }

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

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

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

  .rank-item {
    grid-template-columns: 42px 74px 1fr;
  }

  .rank-item .btn {
    grid-column: 1 / -1;
  }

  .footer-inner {
    grid-template-columns: 1fr;
  }

  .footer-links {
    justify-content: flex-start;
  }
}

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

  .movie-grid {
    gap: 11px;
  }

  .movie-body {
    padding: 11px;
  }

  .movie-line {
    display: none;
  }
}


.poster-img {
  position: relative;
  z-index: 1;
}

.poster-img.is-broken,
.hero-image.is-broken,
.player-poster.is-broken,
.rank-thumb img.is-broken,
.related-thumb img.is-broken {
  display: none;
}

.poster-img.is-broken + .poster-fallback {
  z-index: 1;
}

.poster-overlay {
  z-index: 2;
}
