/* ==========================================================================
   净影 — Apple 产品页式的克制：单色系、一条细描边、一个真实强调色
   规则：不用渐变、不用玻璃卡片堆叠、动效只做 140–240ms 的位移与淡入
   ========================================================================== */

:root {
  --bg: #fbfbfd;
  --surface: #ffffff;
  --ink: #1d1d1f;
  --ink-2: #6e6e73;
  --ink-3: #86868b;
  --line: rgba(0, 0, 0, 0.082);
  --line-2: rgba(0, 0, 0, 0.14);
  --hover: rgba(0, 0, 0, 0.032);
  --press: rgba(0, 0, 0, 0.06);
  --accent: #0071e3;
  --danger: #b42318;
  --danger-bg: #fff5f4;
  --warn: #7a4b00;
  --skel: rgba(0, 0, 0, 0.06);
  --shadow-player: 0 1px 2px rgba(0, 0, 0, 0.05), 0 26px 48px -26px rgba(0, 0, 0, 0.3);
  --ease: cubic-bezier(0.32, 0.72, 0, 1);
  --wrap: 1000px;
  --stage: 860px;
  --gutter: 24px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --surface: #111113;
    --ink: #f5f5f7;
    --ink-2: #a1a1a6;
    --ink-3: #8e8e93;
    --line: rgba(255, 255, 255, 0.1);
    --line-2: rgba(255, 255, 255, 0.18);
    --hover: rgba(255, 255, 255, 0.055);
    --press: rgba(255, 255, 255, 0.1);
    --accent: #2997ff;
    --danger: #ff8a80;
    --danger-bg: rgba(180, 35, 24, 0.16);
    --warn: #e3b341;
    --skel: rgba(255, 255, 255, 0.08);
    --shadow-player: 0 1px 2px rgba(0, 0, 0, 0.5), 0 26px 48px -26px rgba(0, 0, 0, 0.9);
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img,
video {
  max-width: 100%;
}

::selection {
  background: rgba(0, 113, 227, 0.18);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

a {
  color: inherit;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -48px;
  z-index: 50;
  padding: 8px 14px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--bg);
  font-size: 13px;
  text-decoration: none;
  transition: top 0.16s var(--ease);
}

.skip-link:focus {
  top: 12px;
}

/* ------------------------------ 顶部 ------------------------------ */

.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

.nav-inner {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--gutter);
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  width: 19px;
  height: 19px;
  color: var(--ink);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 18px;
}

.nav-pills {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-link {
  font-size: 13px;
  color: var(--ink-2);
  text-decoration: none;
  transition: color 0.16s var(--ease);
}

.nav-link:hover {
  color: var(--ink);
}

/* 导航胶囊：作者与赞赏共用一套 */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 10px 0 4px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: transparent;
  color: var(--ink-2);
  font: inherit;
  font-size: 12.5px;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.16s var(--ease), color 0.16s var(--ease),
    border-color 0.16s var(--ease);
}

.pill:hover {
  background: var(--hover);
  color: var(--ink);
}

.pill:active {
  background: var(--press);
}

.pill-avatar,
.pill-initial {
  width: 20px;
  height: 20px;
  flex: none;
  border-radius: 50%;
  background: var(--ink);
}

.pill-avatar {
  display: block;
  object-fit: cover;
  object-position: center;
}

.pill-initial {
  display: grid;
  place-items: center;
  color: var(--bg);
  font-size: 11px;
  line-height: 1;
}

.pill .arrow {
  width: 11px;
  height: 11px;
  opacity: 0.55;
}

.tip {
  gap: 5px;
  padding: 0 11px;
}

.tip-icon {
  width: 13px;
  height: 13px;
  opacity: 0.8;
}

/* ------------------------------ 首屏 ------------------------------ */

main {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.hero {
  padding: 76px 0 0;
  text-align: center;
}

.eyebrow {
  margin: 0 0 14px;
  font-size: 12.5px;
  letter-spacing: 0.06em;
  color: var(--ink-3);
}

h1 {
  margin: 0;
  font-size: clamp(32px, 5vw, 52px);
  line-height: 1.08;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.lede {
  margin: 18px auto 0;
  max-width: 30em;
  font-size: 18px;
  line-height: 1.55;
  color: var(--ink-2);
  letter-spacing: -0.005em;
}

.lede strong {
  color: var(--ink);
  font-weight: 600;
}

.features {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
  font-size: 12.5px;
  color: var(--ink-3);
}

.features li + li::before {
  content: "·";
  margin: 0 9px;
  color: var(--ink-3);
  opacity: 0.7;
}

/* 输入区 */

.composer {
  margin: 30px auto 0;
  max-width: 620px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: 16px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 10px 28px -22px rgba(0, 0, 0, 0.35);
  transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease);
}

.composer:focus-within {
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--ink) 6%, transparent);
}

.paste-btn {
  flex: none;
  height: 40px;
  padding: 0 11px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--ink-2);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.16s var(--ease), color 0.16s var(--ease);
}

.paste-btn svg {
  width: 15px;
  height: 15px;
}

.paste-btn:hover {
  background: var(--hover);
  color: var(--ink);
}

.paste-btn:active {
  background: var(--press);
}

#share-input {
  flex: 1;
  min-width: 0;
  max-height: 132px;
  padding: 9px 8px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  line-height: 1.45;
  resize: none;
  outline: none;
  overflow-y: auto;
}

#share-input::placeholder {
  color: var(--ink-3);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  cursor: pointer;
  font: inherit;
  text-decoration: none;
  transition: background 0.18s var(--ease), opacity 0.18s var(--ease),
    transform 0.12s var(--ease), color 0.18s var(--ease);
}

.btn-primary {
  flex: none;
  height: 44px;
  padding: 0 20px;
  border-radius: 12px;
  background: var(--ink);
  color: var(--bg);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.005em;
}

.btn-primary:hover:not(:disabled) {
  opacity: 0.88;
}

.btn-primary:active:not(:disabled) {
  transform: scale(0.985);
}

.btn-primary:disabled {
  opacity: 0.45;
  cursor: default;
}

.spinner {
  display: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  border-top-color: transparent;
  animation: spin 0.7s linear infinite;
}

.is-loading .spinner {
  display: inline-block;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.field-hint {
  margin: 12px 0 0;
  font-size: 13px;
  color: var(--ink-3);
}

.notice {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin: 16px auto 0;
  padding: 10px 12px;
  max-width: 620px;
  border-radius: 10px;
  font-size: 13.5px;
  line-height: 1.5;
  text-align: left;
}

.notice[hidden] {
  display: none;
}

.notice-error {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid color-mix(in srgb, var(--danger) 18%, transparent);
}

/* ------------------------------ 结果区 ------------------------------ */

.stage {
  max-width: var(--stage);
  margin: 44px auto 0;
  min-height: 100px;
}

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 40px 0 44px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--ink-3);
  font-size: 13.5px;
}

.empty p {
  margin: 0;
}

.empty-icon {
  width: 22px;
  height: 22px;
  opacity: 0.55;
}

.empty[hidden],
.skeleton[hidden],
.result[hidden],
.facts[hidden],
.gallery[hidden],
.inline-notes[hidden] {
  display: none;
}

.skeleton {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  gap: 40px;
}

.skeleton-player {
  aspect-ratio: 9 / 16;
  max-height: 440px;
  border-radius: 16px;
  background: var(--skel);
  animation: pulse 1.6s ease-in-out infinite;
}

.skeleton-line {
  height: 12px;
  border-radius: 6px;
  background: var(--skel);
  margin-bottom: 14px;
  animation: pulse 1.6s ease-in-out infinite;
}

.skeleton-line.w40 { width: 40%; }
.skeleton-line.w60 { width: 60%; }
.skeleton-line.w100 { width: 100%; }

@keyframes pulse {
  0%,
  100% { opacity: 0.55; }
  50% { opacity: 1; }
}

.result {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  gap: 40px;
  align-items: start;
  animation: rise 0.24s var(--ease) both;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}

.result-media {
  min-width: 0;
}

.player {
  position: relative;
  aspect-ratio: 9 / 16;
  max-height: 460px;
  border-radius: 16px;
  overflow: hidden;
  background: #000;
  box-shadow: var(--shadow-player);
}

.player.is-landscape {
  aspect-ratio: 16 / 9;
  max-height: 300px;
}

.player video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  background: #000;
}

.play-btn {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.94);
  color: #111;
  cursor: pointer;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.3);
  transition: transform 0.16s var(--ease), opacity 0.16s var(--ease);
}

.play-btn svg {
  width: 24px;
  height: 24px;
  margin-left: 2px;
}

.play-btn:hover {
  transform: scale(1.05);
}

.play-btn:active {
  transform: scale(0.97);
}

.player.is-playing .play-btn {
  opacity: 0;
  pointer-events: none;
}

.gallery {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.gallery a {
  display: block;
  border-radius: 10px;
  overflow: hidden;
  background: var(--hover);
}

.gallery img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.player-caption {
  margin: 12px 0 0;
  font-size: 12.5px;
  color: var(--ink-3);
  text-align: center;
  min-height: 18px;
  font-variant-numeric: tabular-nums;
}

.result-detail {
  min-width: 0;
}

.result-detail h2 {
  margin: 0 0 8px;
  font-size: 21px;
  line-height: 1.4;
  font-weight: 600;
  letter-spacing: -0.012em;
  overflow-wrap: anywhere;
}

.byline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin: 0;
  font-size: 13.5px;
  color: var(--ink-2);
}

.byline .dot {
  color: var(--line-2);
}

.facts {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin: 18px 0 0;
  padding: 11px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  color: var(--ink-2);
}

.facts div {
  display: flex;
  gap: 6px;
}

.facts dt {
  color: var(--ink-3);
}

.facts dd {
  margin: 0;
  font-variant-numeric: tabular-nums;
}

.quality-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 26px 0 0;
  font-size: 13px;
  color: var(--ink-3);
}

.quality-count {
  font-variant-numeric: tabular-nums;
}

.quality-list {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
}

.q-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 12px 10px;
  margin: 0 -10px;
  border-top: 1px solid var(--line);
  transition: background 0.16s var(--ease);
}

.q-row:last-child {
  border-bottom: 1px solid var(--line);
}

.q-row:hover,
.q-row.is-selected {
  background: var(--hover);
  border-radius: 10px;
}

.q-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.005em;
}

.q-row.is-original .q-label {
  font-weight: 600;
}

.q-chip {
  padding: 1px 6px;
  border-radius: 5px;
  background: var(--ink);
  color: var(--bg);
  font-size: 10.5px;
  font-weight: 400;
  letter-spacing: 0.02em;
}

.q-chip.is-quiet {
  background: transparent;
  border: 1px solid var(--line-2);
  color: var(--ink-2);
}

.q-meta {
  margin-top: 3px;
  font-size: 12.5px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

.q-actions {
  display: flex;
  gap: 6px;
  flex: none;
}

.btn-ghost,
.btn-quiet {
  height: 32px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 400;
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.16s var(--ease), color 0.16s var(--ease);
}

.btn-ghost {
  border: 1px solid var(--line-2);
  background: transparent;
}

.btn-ghost:hover {
  background: var(--hover);
}

.btn-quiet {
  border: 1px solid transparent;
  background: var(--hover);
  font: inherit;
  font-size: 13px;
  line-height: 1;
}

.btn-quiet:disabled {
  opacity: 0.6;
  cursor: default;
}

.btn-quiet:hover {
  background: var(--press);
}

.btn-quiet svg {
  width: 14px;
  height: 14px;
  opacity: 0.7;
}

.q-row.is-selected .btn-quiet {
  background: var(--ink);
  color: var(--bg);
}

.q-row.is-selected .btn-quiet svg {
  opacity: 0.85;
}

.btn-ghost[disabled] {
  opacity: 0.4;
  cursor: default;
}

.inline-notes {
  margin: 18px 0 0;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--ink-3);
}

.inline-notes p {
  display: flex;
  gap: 6px;
  margin: 0;
}

.inline-notes p::before {
  content: "·";
  color: var(--line-2);
}

.result-foot {
  margin: 16px 0 0;
  font-size: 12.5px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

/* ------------------------------ 说明 / 免责 ------------------------------ */

.notes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px;
  max-width: var(--stage);
  margin: 72px auto 0;
  padding-top: 32px;
  border-top: 1px solid var(--line);
}

.note h3 {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.005em;
}

.note p {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--ink-2);
}

.legal {
  max-width: var(--stage);
  margin: 52px auto 0;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.legal h2 {
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 600;
}

.legal p {
  margin: 0 0 10px;
  font-size: 13px;
  line-height: 1.75;
  color: var(--ink-3);
}

.legal p:last-child {
  margin-bottom: 0;
}

.legal a {
  color: var(--ink-2);
  text-underline-offset: 3px;
}

.footer {
  margin-top: 72px;
  border-top: 1px solid var(--line);
  padding: 22px 0 52px;
}

.footer-inner {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: space-between;
  font-size: 12.5px;
  color: var(--ink-3);
}

.footer-right {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.footer-right a {
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.16s var(--ease), color 0.16s var(--ease);
}

.footer-right a:hover {
  color: var(--ink-2);
  border-color: var(--line-2);
}

.footer-sep {
  color: var(--line-2);
}

/* ------------------------------ 赞赏面板 ------------------------------ */

.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(0, 0, 0, 0.42);
  opacity: 0;
  transition: opacity 0.22s var(--ease);
}

.sheet-backdrop[hidden] {
  display: none;
}

.sheet-backdrop.is-on {
  opacity: 1;
}

.sheet {
  position: fixed;
  z-index: 61;
  left: 50%;
  top: 50%;
  width: min(420px, calc(100vw - 32px));
  max-height: min(78vh, 720px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 26px 24px 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 30px 70px -30px rgba(0, 0, 0, 0.5), 0 2px 8px rgba(0, 0, 0, 0.08);
  opacity: 0;
  transform: translate(-50%, -46%) scale(0.985);
  transition: opacity 0.2s var(--ease), transform 0.26s var(--ease);
}

.sheet[hidden] {
  display: none;
}

.sheet.is-on {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.sheet-grip {
  display: none;
}

.sheet-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 50%;
  background: var(--hover);
  color: var(--ink-2);
  cursor: pointer;
  transition: background 0.16s var(--ease), color 0.16s var(--ease);
}

.sheet-close:hover {
  background: var(--press);
  color: var(--ink);
}

.sheet-close svg {
  width: 14px;
  height: 14px;
}

.sheet-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.sheet h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.sheet-lede {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--ink-2);
}

.sheet-lede strong {
  color: var(--ink);
  font-weight: 600;
}

.qr {
  margin: 2px 0 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.qr img {
  width: 100%;
  max-width: 240px;
  height: auto;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--hover);
}

.qr figcaption {
  font-size: 12px;
  line-height: 1.6;
  color: var(--ink-3);
  text-align: center;
}

.qr-fallback {
  width: 100%;
  max-width: 240px;
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  padding: 18px;
  border: 1px dashed var(--line-2);
  border-radius: 14px;
  color: var(--ink-3);
  font-size: 12.5px;
  line-height: 1.6;
  text-align: center;
}

.sheet-note {
  margin: 0;
  font-size: 12px;
  line-height: 1.7;
  color: var(--ink-3);
}

.sheet-note a {
  color: var(--ink-2);
  text-underline-offset: 3px;
}

body.sheet-lock {
  overflow: hidden;
}

/* 深色下纯黑背景里面板要抬一层，否则和遮罩糊在一起 */
@media (prefers-color-scheme: dark) {
  .sheet-backdrop {
    background: rgba(0, 0, 0, 0.62);
  }

  .sheet {
    background: #1c1c1e;
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 30px 70px -30px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(255, 255, 255, 0.04);
  }

  .qr img {
    border-color: rgba(255, 255, 255, 0.12);
  }
}

/* ------------------------------ 响应式 ------------------------------ */

@media (max-width: 860px) {
  .result,
  .skeleton {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .result-media {
    max-width: 300px;
    width: 100%;
    margin: 0 auto;
  }

  .player,
  .skeleton-player {
    max-height: 420px;
  }

  .notes {
    grid-template-columns: 1fr;
    gap: 24px;
    margin-top: 56px;
  }
}

@media (max-width: 640px) {
  :root {
    --gutter: 18px;
  }

  .hero {
    padding-top: 48px;
  }

  .nav-link {
    display: none;
  }

  .composer {
    max-width: none;
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-areas:
      "input input"
      "paste submit";
    gap: 2px 8px;
    padding: 6px 8px 8px;
  }

  #share-input {
    grid-area: input;
    padding: 9px 2px 10px;
    font-size: 15px;
    border-bottom: 1px solid var(--line);
  }

  .paste-btn {
    grid-area: paste;
    justify-self: start;
    width: 40px;
    height: 40px;
    padding: 0;
    justify-content: center;
  }

  .paste-label {
    display: none;
  }

  .btn-primary {
    grid-area: submit;
    justify-self: end;
    height: 40px;
    padding: 0 16px;
  }

  .legal,
  .notes {
    margin-top: 40px;
  }

  .sheet {
    left: 0;
    right: 0;
    top: auto;
    bottom: 0;
    width: 100%;
    max-height: 84vh;
    padding: 10px 18px calc(20px + env(safe-area-inset-bottom));
    border-radius: 20px 20px 0 0;
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
    transform: translateY(102%);
  }

  .sheet.is-on {
    transform: translateY(0);
  }

  .sheet-grip {
    display: block;
    width: 36px;
    height: 4px;
    margin: 2px auto 12px;
    border-radius: 999px;
    background: var(--line-2);
  }

  .sheet-close {
    top: 10px;
    right: 12px;
  }

  .qr img {
    max-width: 220px;
  }

  .footer {
    margin-top: 48px;
  }

  .footer-inner {
    flex-direction: column;
    gap: 6px;
  }
}

@media (max-width: 520px) {
  h1 {
    font-size: 30px;
    letter-spacing: -0.025em;
  }

  h1 .br-wide {
    display: none;
  }

  .lede {
    font-size: 16px;
  }

  .q-row {
    grid-template-columns: 1fr;
    gap: 9px;
    padding: 12px 8px;
    margin: 0 -8px;
  }

  .q-actions {
    justify-content: flex-start;
  }

  .result-detail h2 {
    font-size: 19px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
