:root {
  color-scheme: light;
  --bg: #f5f5f7;
  --paper: #fff;
  --ink: #1d1d1f;
  --muted: #6e6e73;
  --line: #d2d2d7;
  --line-soft: #e8e8ed;
  --blue: #0071e3;
  --blue-dark: #005bb5;
  --track: #eeeeef;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  text-rendering: optimizeLegibility;
}

body.modal-open { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button { cursor: pointer; }

.site-header {
  width: min(1180px, calc(100% - 32px));
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 0 auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.top-nav {
  display: flex;
  gap: 6px;
  color: var(--muted);
  font-size: 14px;
}

.top-nav a {
  padding: 9px 12px;
  border-radius: 999px;
}

.top-nav a:hover {
  color: var(--ink);
  background: var(--track);
}

main,
.site-footer {
  width: min(1180px, calc(100% - 32px));
  margin-inline: auto;
}

.hero {
  min-height: 620px;
  display: grid;
  align-content: center;
  justify-items: center;
  padding: 84px 0 72px;
  text-align: center;
}

.hero > * {
  margin-left: auto;
  margin-right: auto;
}

.hero h1 {
  margin-left: auto;
  margin-right: auto;
}

.kicker {
  margin: 0 0 14px;
  color: var(--blue);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  max-width: 860px;
  margin: 0;
  font-size: clamp(30px, 4.2vw, 56px);
  line-height: 1.16;
  letter-spacing: 0;
}

.hero-copy {
  max-width: 700px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: clamp(17px, 1.7vw, 21px);
  line-height: 1.8;
}

.hero-actions {
  width: min(680px, 100%);
  max-width: 680px;
  margin-top: 38px;
}

.search-label {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 14px;
}

.search-shell {
  display: grid;
  grid-template-columns: 1fr 48px;
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  overflow: hidden;
}

.search-shell:focus-within {
  border-color: var(--blue);
}

.search-shell input,
.search-shell button {
  border: 0;
  background: transparent;
}

.search-shell input {
  min-width: 0;
  padding: 0 22px;
  outline: none;
}

.search-shell button {
  color: var(--muted);
  font-size: 24px;
}

.stats {
  justify-content: center;
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  margin-top: 32px;
  color: var(--muted);
}

.stats span {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
}

.stats strong {
  color: var(--ink);
  font-size: 24px;
}

.stats span {
  padding: 8px 12px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line-soft);
}

.index-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  padding: 72px 0 30px;
  border-top: 1px solid var(--line);
}

.index-head h2,
.detail-block h2,
.editorial h2,
.related h2 {
  margin: 0;
  font-size: clamp(28px, 4vw, 48px);
  line-height: 1.05;
}

.index-head > p {
  margin: 0;
  color: var(--muted);
}

.movie-list {
  border-top: 1px solid var(--line);
}

.movie-row {
  min-height: 112px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px;
  border-bottom: 1px solid var(--line-soft);
}

.movie-row:hover {
  background: #fff;
}

.movie-row:nth-child(6n + 1) .movie-rank,
.related-list a:nth-child(4n + 1) span {
  color: var(--blue);
}

.movie-row:nth-child(6n + 2) .movie-rank,
.related-list a:nth-child(4n + 2) span {
  color: #af52de;
}

.movie-row:nth-child(6n + 3) .movie-rank,
.related-list a:nth-child(4n + 3) span {
  color: #ff9500;
}

.movie-row:nth-child(6n + 4) .movie-rank,
.related-list a:nth-child(4n + 4) span {
  color: #34c759;
}

.movie-row:nth-child(2n) {
  background: rgba(255,255,255,.38);
}

.movie-row-main {
  min-width: 0;
  display: grid;
  grid-template-columns: 64px minmax(180px, 1fr) minmax(180px, .75fr);
  align-items: baseline;
  gap: 34px;
  padding: 28px 0;
}

.movie-rank {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.movie-title {
  min-width: 0;
  font-size: clamp(20px, 2.2vw, 28px);
  font-weight: 760;
  line-height: 1.28;
}

.movie-row:hover .movie-title,
.related-list a:hover {
  color: var(--blue);
}

.movie-meta {
  line-height: 1.75;
}

.movie-meta {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.transfer-button,
.primary-transfer,
.text-transfer {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: var(--blue);
  font-weight: 700;
  white-space: nowrap;
}

.transfer-button:hover,
.primary-transfer:hover,
.text-transfer:hover {
  background: var(--blue-dark);
}

.transfer-button::after,
.primary-transfer::after,
.text-transfer::after {
  content: "→";
  margin-left: 8px;
}

.empty-state {
  margin: 28px 0;
  color: var(--muted);
  text-align: center;
}

.detail {
  padding: 38px 0 0;
}

.back-link {
  display: inline-flex;
  margin-bottom: 42px;
  color: var(--muted);
}

.back-link:hover { color: var(--ink); }

.detail-hero {
  min-height: 460px;
  display: grid;
  align-content: center;
  padding-bottom: 64px;
  border-bottom: 1px solid var(--line);
}

.detail-hero h1 {
  max-width: 920px;
  font-size: clamp(32px, 4.8vw, 62px);
  line-height: 1.15;
}

.detail-hero p:not(.kicker) {
  max-width: 760px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 20px;
  line-height: 1.6;
}

.spec-line {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.spec-line span {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--muted);
  font-size: 14px;
}

.spec-line span:nth-child(1) { border-color: #0071e3; color: #0071e3; }
.spec-line span:nth-child(2) { border-color: #af52de; color: #af52de; }
.spec-line span:nth-child(3) { border-color: #ff9500; color: #b56200; }
.spec-line span:nth-child(4) { border-color: #34c759; color: #248a3d; }

.primary-transfer {
  width: fit-content;
  min-height: 48px;
  margin-top: 32px;
  padding-inline: 24px;
}

.detail-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  padding: 72px 0;
  border-bottom: 1px solid var(--line);
}

.detail-block {
  min-width: 0;
}

.detail-block h2 {
  font-size: clamp(28px, 3vw, 42px);
}

dl {
  margin: 24px 0 0;
}

dl div {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 18px;
  padding: 16px 0;
  border-top: 1px solid var(--line-soft);
}

dt {
  color: var(--muted);
}

dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.detail-block p {
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.7;
}

.text-transfer {
  margin-top: 24px;
}

.editorial {
  padding: 72px 0;
  border-bottom: 1px solid var(--line);
}

.editorial-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 42px;
  margin-top: 38px;
}

.editorial-grid section {
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.editorial-grid h3 {
  margin: 0 0 12px;
  font-size: 20px;
}

.editorial-grid p {
  margin: 0;
  color: var(--muted);
  line-height: 1.75;
}

.related {
  padding: 56px 0 16px;
}

.related-list {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  margin-top: 28px;
  border-top: 1px solid var(--line);
}

.related-list a {
  min-height: 110px;
  padding: 18px 18px 18px 0;
  border-bottom: 1px solid var(--line-soft);
  color: var(--ink);
  font-weight: 740;
}

.related-list span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 46px 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}

.site-footer p { margin: 0; }

.qr-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 18px;
}

.qr-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.32);
}

.qr-dialog {
  position: relative;
  width: min(430px, 100%);
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--paper);
  text-align: center;
}

.qr-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: var(--track);
  font-size: 22px;
}

.qr-dialog h2 {
  margin: 0;
  font-size: 27px;
}

.qr-subtitle {
  margin: 12px 0 20px;
  color: var(--muted);
  line-height: 1.65;
}

.qr-frame {
  width: min(320px, 100%);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  margin: 0 auto;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: #fff;
}

.qr-frame img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.qr-movie {
  margin: 14px 0 0;
  font-weight: 700;
}

[hidden] { display: none !important; }

@media (max-width: 900px) {
  .hero {
    min-height: auto;
    padding: 56px 0 46px;
  }

  .movie-row {
    grid-template-columns: 1fr;
    gap: 0;
    padding-bottom: 18px;
  }

  .movie-row-main {
    grid-template-columns: 52px 1fr;
    gap: 16px;
  }

  .movie-meta {
    grid-column: 2;
  }

  .transfer-button {
    width: fit-content;
    margin-left: 68px;
  }

  .detail-columns,
  .editorial-grid,
  .related-list {
    grid-template-columns: 1fr;
    gap: 28px;
  }
}

@media (max-width: 560px) {
  .site-header,
  main,
  .site-footer {
    width: min(100% - 24px, 1180px);
  }

  .site-header {
    min-height: 62px;
  }

  .top-nav {
    gap: 0;
    font-size: 13px;
  }

  h1 {
    font-size: 31px;
  }

  .hero-copy {
    font-size: 16px;
  }

  .stats {
    gap: 14px;
  }

  .index-head,
  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .detail-hero {
    min-height: auto;
    padding-bottom: 44px;
  }

  .detail-hero h1 {
    font-size: 30px;
  }

  dl div {
    grid-template-columns: 1fr;
    gap: 6px;
  }
}
