/* 组件：描粗边的「贴纸风」——深墨色粗描边 + 实心错位阴影 + 胖按钮 + emoji，配合首屏的黏土插画。
 * 顶栏、标题、炉子台词气泡、谁来过、纸片卡、群聊示例、表单、按钮、提示、主人凭证、炭火投料位、结果卡。 */

:root {
  --line: 2.5px solid var(--ink);
  --pop: 0 4px 0 var(--ink);
  --pop-lg: 0 6px 0 var(--ink);
}

/* ---------- 顶栏：两个贴纸胶囊 ---------- */
.topbar {
  position: relative;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: var(--text-xs);
}
.brand, .season-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px 4px 8px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  color: var(--ink);
  background: var(--paper-hi);
  box-shadow: 0 3px 0 var(--ink);
  font-weight: 900;
  letter-spacing: 0.04em;
  text-decoration: none;
}
.brand small { font-weight: 700; color: var(--ink-soft); letter-spacing: 0.08em; }
.brand__dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--ember-500);
  box-shadow: 0 0 0 2px rgba(255, 122, 47, 0.25);
}
.season-chip { padding: 4px 11px; font-weight: 800; }
.season-chip::before { content: "❄"; color: #6c7fd8; }

/* ---------- 首屏文字 ---------- */
.hero-copy { position: relative; z-index: 2; text-align: center; margin: 4px 0 8px; }
.hero-copy h1 {
  margin: 0;
  font-size: var(--text-hero);
  line-height: 1.24;
  font-weight: 900;
  letter-spacing: 0.02em;
  color: #fff6e8;
  text-shadow: 0 3px 0 rgba(3, 5, 22, 0.7), 0 0 28px rgba(255, 170, 90, 0.22);
}
/* 「炼歪」两个字是真的歪的 */
.tilt {
  display: inline-block;
  padding: 0 3px 8px;
  color: var(--ember-300);
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 10' preserveAspectRatio='none'><path d='M2 6 Q 14 1 26 6 T 50 6 T 74 6 T 98 5' fill='none' stroke='%23ff9a45' stroke-width='2.6' stroke-linecap='round'/></svg>") center bottom / 100% 9px no-repeat;
}
.tilt b { display: inline-block; font-weight: inherit; }
.tilt b:first-child { rotate: -5deg; translate: 0 1px; }
.tilt b:last-child { rotate: 10deg; translate: 2px 4px; }
.lede { margin: 12px auto 0; max-width: 19em; color: var(--sky-muted); font-size: var(--text-sm); text-wrap: balance; }

/* 开炉时间贴纸 */
.stamp {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  padding: 5px 13px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  font-size: var(--text-xs);
  font-weight: 900;
  letter-spacing: 0.04em;
  color: var(--ink);
  background: var(--ember-300);
  box-shadow: 0 3px 0 var(--ink);
  rotate: -2deg;
}
.stamp::before {
  content: "";
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--ember-700);
}

/* ---------- 炉子的台词气泡 ---------- */
.stove-talk {
  position: absolute;
  z-index: 3;
  left: 5%;
  top: 27%;
  max-width: 46%;
  padding: 8px 12px;
  border: var(--line);
  border-radius: 16px 16px 16px 16px;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.4;
  color: var(--ink);
  background: var(--paper-hi);
  box-shadow: var(--pop);
  transform-origin: 90% 110%;
  animation: talk-pop 0.5s var(--ease-pop) 0.6s both, talk-bob 3.2s ease-in-out 1.1s infinite;
}
/* 尾巴指向右下方的炉子 */
.stove-talk::after, .stove-talk::before {
  content: "";
  position: absolute;
  right: 18px;
  bottom: -11px;
  width: 0; height: 0;
  border-style: solid;
  border-width: 11px 0 0 14px;
  border-color: var(--ink) transparent transparent transparent;
}
.stove-talk::after { right: 20.5px; bottom: -6.5px; border-width: 8px 0 0 10px; border-color: var(--paper-hi) transparent transparent transparent; }
.stove-talk.is-new { animation: talk-pop 0.5s var(--ease-pop) both, talk-bob 3.2s ease-in-out 0.5s infinite; }
@keyframes talk-pop { from { opacity: 0; transform: scale(0.5) rotate(-6deg); } to { opacity: 1; transform: none; } }
@keyframes talk-bob { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-4px) rotate(-1deg); } }

/* ---------- 愿望（主人页 / 投料页） ---------- */
.wish-block { position: relative; z-index: 2; text-align: center; margin: 0 0 6px; }
.wish-block__who { margin: 0; font-size: var(--text-sm); color: var(--sky-muted); letter-spacing: 0.04em; }
.wish-block__who b { color: var(--sky-text); }
.wish-quote {
  margin: 6px auto 0;
  max-width: 15em;
  font-family: var(--font-letter);
  font-weight: 900;
  font-size: var(--text-2xl);
  line-height: 1.38;
  color: #fff3dc;
  text-shadow: 0 0 22px rgba(255, 170, 90, 0.28), 0 2px 0 rgba(3, 5, 22, 0.5);
  text-wrap: balance;
}
.wish-quote::before { content: "「"; color: var(--ember-300); }
.wish-quote::after { content: "」"; color: var(--ember-300); }
.hook-tag {
  display: inline-block;
  margin-top: 12px;
  padding: 4px 12px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  font-size: var(--text-sm);
  font-weight: 900;
  color: var(--ink);
  background: #c9b8ff;
  box-shadow: 0 3px 0 var(--ink);
  rotate: 1.5deg;
}

/* ---------- 谁来过 ---------- */
.crowd {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding: 4px 14px 4px 4px;
  border-radius: 999px;
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--sky-text);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}
.crowd--empty { padding: 6px 14px; }
.crowd__faces { display: inline-flex; }
.crowd__faces i {
  display: grid;
  place-items: center;
  width: 28px; height: 28px;
  margin-left: -9px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  font-style: normal;
  font-size: 12px;
  font-weight: 900;
  color: var(--ink);
  background: #a8d8ff;
}
.crowd__faces i:first-child { margin-left: 0; }
.crowd__faces i:nth-child(2) { background: var(--ember-300); }
.crowd__faces i:nth-child(3) { background: #c9b8ff; }
.crowd__faces i:nth-child(4) { background: #ffc2d6; }
.crowd__faces i:nth-child(5) { background: #b9f0c5; }
.crowd__faces .crowd__more { background: var(--paper-hi); font-size: 10px; }
.on-paper { margin-top: 14px; }
.on-paper .crowd { margin-top: 0; color: var(--ink); background: rgba(43, 28, 24, 0.06); box-shadow: none; }

/* ---------- 纸片卡（贴纸描边） ---------- */
.paper {
  position: relative;
  z-index: 2;
  margin: 24px 0;
  padding: 22px 18px 20px;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255, 175, 95, 0.12), transparent 38%),
    var(--grain),
    linear-gradient(180deg, var(--paper-hi), var(--paper) 60%, var(--paper-lo));
  border: var(--line);
  border-radius: 22px;
  box-shadow: var(--pop-lg), 0 24px 40px -14px rgba(0, 0, 0, 0.6);
}
.paper--tilt-l { rotate: -0.7deg; }
.paper--tilt-r { rotate: 0.6deg; }
/* 和纸胶带 */
.paper--taped::before,
.paper--taped-corner::before {
  content: "";
  position: absolute;
  top: -13px; left: 50%;
  width: 88px; height: 22px;
  margin-left: -44px;
  background: repeating-linear-gradient(-45deg, rgba(255, 196, 130, 0.85) 0 7px, rgba(255, 176, 110, 0.72) 7px 14px);
  clip-path: polygon(3% 8%, 97% 0, 100% 50%, 96% 100%, 2% 94%, 0 50%);
  rotate: -3deg;
}
.paper--taped-corner::before { left: 26px; margin-left: 0; rotate: -10deg; width: 72px; }
.paper__kicker {
  margin: 0 0 4px;
  font-size: var(--text-2xs);
  font-weight: 900;
  letter-spacing: 0.2em;
  color: var(--ember-700);
}
.paper__title {
  margin: 0 0 14px;
  font-family: var(--font-letter);
  font-weight: 900;
  font-size: var(--text-xl);
  line-height: 1.3;
}
.hint { margin: 8px 0 0; font-size: var(--text-xs); line-height: 1.6; color: var(--ink-soft); }
.hint--center { text-align: center; }

/* ---------- 首页示例：「炼歪现场」群聊 ---------- */
.chat { padding: 0; overflow: hidden; }
.chat__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: var(--line);
  font-weight: 900;
  background: var(--paper-lo);
}
.chat__head small {
  padding: 1px 8px;
  border: 1.5px solid var(--ink);
  border-radius: 6px;
  font-size: var(--text-2xs);
  font-weight: 800;
  color: var(--ink-soft);
}
.chat__body { display: grid; gap: 10px; padding: 14px 12px 16px; }
.chat__sys {
  justify-self: center;
  margin: 0 0 2px;
  padding: 3px 11px;
  border-radius: 999px;
  font-size: var(--text-2xs);
  font-weight: 700;
  color: var(--ink-soft);
  background: rgba(43, 28, 24, 0.08);
}
.msg { display: flex; align-items: flex-start; gap: 8px; }
.msg--stove { flex-direction: row-reverse; }
.avatar {
  flex: none;
  display: grid;
  place-items: center;
  width: 34px; height: 34px;
  border: 2px solid var(--ink);
  border-radius: 11px;
  font-size: 14px;
  font-weight: 900;
  color: var(--ink);
  background: #a8d8ff;
  overflow: hidden;
}
.msg:nth-of-type(4n+3) .avatar { background: #c9b8ff; }
.msg:nth-of-type(4n+5) .avatar { background: #b9f0c5; }
.avatar--stove { background: #2a2350 !important; }
.avatar--stove img { width: 28px; height: auto; }
.msg__body { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; }
.msg--stove .msg__body { align-items: flex-end; }
.msg__name { margin: 0 0 3px; font-size: var(--text-2xs); font-weight: 700; color: var(--ink-soft); }
.msg__bubble {
  margin: 0;
  padding: 8px 11px;
  max-width: 15em;
  border: 2px solid var(--ink);
  border-radius: 4px 14px 14px 14px;
  font-size: var(--text-sm);
  line-height: 1.45;
  background: #fffdf7;
  box-shadow: 0 2px 0 var(--ink);
}
.msg--stove .msg__bubble { border-radius: 14px 4px 14px 14px; background: var(--ember-300); }
.chat__finale {
  margin-top: 6px;
  padding: 16px 14px 14px;
  border: 2px solid var(--ink);
  border-radius: 16px;
  text-align: center;
  color: #f3dfc4;
  background:
    radial-gradient(ellipse at 20% 0%, rgba(255, 150, 70, 0.35), transparent 60%),
    linear-gradient(135deg, var(--clay-deep), #5e2419);
  box-shadow: 0 4px 0 var(--ink);
}
.sticker {
  display: inline-block;
  padding: 3px 11px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  font-size: var(--text-xs);
  font-weight: 900;
  color: var(--ink);
  background: var(--legend);
  box-shadow: 0 2px 0 var(--ink);
  rotate: -3deg;
}
.chat__final-title {
  margin: 10px 0 4px;
  font-family: var(--font-letter);
  font-weight: 900;
  font-size: 1.35rem;
  color: var(--ember-100);
}
.chat__final-text { margin: 0; font-size: var(--text-sm); line-height: 1.6; }

/* ---------- 表单 ---------- */
.field { margin: 0 0 16px; }
.field__label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 7px;
  font-size: var(--text-sm);
  font-weight: 900;
}
.field__count { font-weight: 600; font-size: var(--text-2xs); color: var(--ink-faint); font-variant-numeric: tabular-nums; }
.field input {
  width: 100%;
  min-height: 50px;
  padding: 11px 14px;
  font: inherit;
  font-size: 16px; /* 防止 iOS 聚焦时放大页面 */
  font-weight: 600;
  color: var(--ink);
  background: #fffdf7;
  border: 2px solid var(--ink);
  border-radius: 14px;
  box-shadow: inset 0 3px 0 rgba(43, 28, 24, 0.07);
  outline: none;
  transition: box-shadow 0.2s var(--ease-out), background 0.2s;
  -webkit-appearance: none;
  appearance: none;
}
.field input::placeholder { color: var(--ink-faint); font-weight: 500; }
.field input:focus { background: #fff; box-shadow: 0 0 0 4px rgba(255, 122, 47, 0.35); }
.form-lede { margin: 0 0 14px; font-size: var(--text-sm); font-weight: 700; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chip {
  min-height: 36px;
  padding: 5px 12px;
  font: inherit;
  font-size: var(--text-xs);
  font-weight: 800;
  color: var(--ink);
  background: var(--paper-hi);
  border: 2px solid var(--ink);
  border-radius: 999px;
  box-shadow: 0 2px 0 var(--ink);
  cursor: pointer;
  transition: translate 0.1s, box-shadow 0.1s, background 0.15s;
}
.chip:nth-child(odd) { rotate: -1.2deg; }
.chip:nth-child(even) { rotate: 1.2deg; }
.chip:active { translate: 0 2px; box-shadow: 0 0 0 var(--ink); }
.chip:focus-visible { outline: 3px solid var(--ember-500); outline-offset: 2px; }
.chip.is-picked { background: var(--ember-300); }

/* ---------- 按钮：胖、描边、厚底 ---------- */
.btn {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 56px;
  padding: 12px 20px;
  border: var(--line);
  border-radius: 999px;
  font: inherit;
  font-size: var(--text-lg);
  font-weight: 900;
  letter-spacing: 0.1em;
  text-decoration: none;
  color: var(--ink);
  background: linear-gradient(180deg, #ffd27a 0%, var(--ember-400) 55%, var(--ember-500) 100%);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.55), 0 5px 0 var(--ink), 0 14px 24px -10px rgba(255, 110, 40, 0.7);
  cursor: pointer;
  transition: transform 0.1s var(--ease-out), box-shadow 0.1s, filter 0.2s;
}
.btn:hover { filter: brightness(1.05) saturate(1.05); }
.btn:active { transform: translateY(4px); box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.5), 0 1px 0 var(--ink); }
.btn:focus-visible { outline: 3px solid var(--ember-100); outline-offset: 3px; }
.btn__icon { width: 20px; height: 20px; fill: currentColor; flex: none; }
.btn[disabled] { cursor: progress; }
.btn.is-busy::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, 0.55) 50%, transparent 70%);
  transform: translateX(-100%);
  animation: shimmer 1.1s var(--ease-soft) infinite;
}
@keyframes shimmer { to { transform: translateX(100%); } }
.btn--ink {
  font-size: var(--text-base);
  color: var(--paper-hi);
  background: linear-gradient(180deg, var(--clay-light), var(--clay));
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.2), 0 5px 0 var(--ink);
}
.btn--line {
  min-height: 50px;
  font-size: var(--text-base);
  color: var(--ink);
  background: var(--paper-hi);
  box-shadow: 0 4px 0 var(--ink);
}
.btn--line:active { box-shadow: 0 1px 0 var(--ink); }
.btn-row { display: grid; gap: 16px; margin-top: 18px; }

/* ---------- 提示 ---------- */
.notice {
  margin: 16px 0 0;
  padding: 11px 13px;
  border: 2px solid var(--ink);
  border-radius: 14px;
  font-size: var(--text-sm);
  font-weight: 700;
  line-height: 1.55;
  white-space: pre-line;
  box-shadow: 0 3px 0 var(--ink);
  animation: pop-in 0.35s var(--ease-pop);
}
.notice--warn { color: #7a2412; background: #ffe0d2; }
.notice--soft { color: #5c3f00; background: #fff0c2; }
.notice--care { color: #262c6b; background: #e6e8ff; }

.toast {
  position: fixed;
  left: 50%; bottom: calc(28px + env(safe-area-inset-bottom));
  z-index: 60;
  /* left:50% 时默认只能占半屏宽，长一点的提示会被挤成好几行 */
  width: max-content;
  max-width: calc(100vw - 32px);
  text-align: center;
  padding: 10px 18px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  font-size: var(--text-sm);
  font-weight: 900;
  color: var(--ink);
  background: var(--ember-300);
  box-shadow: 0 4px 0 var(--ink);
  opacity: 0;
  transform: translate(-50%, 14px);
  transition: opacity 0.2s, transform 0.25s var(--ease-out);
  pointer-events: none;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 开炉成功：主人凭证 ---------- */
.ticket {
  position: relative;
  margin: 16px 0 4px;
  padding: 16px 22px 14px;
  border-radius: 12px;
  background: #fffaf0;
  -webkit-mask: radial-gradient(circle 10px at 0 50%, transparent 96%, #000) 0 0 / 51% 100% no-repeat,
                radial-gradient(circle 10px at 100% 50%, transparent 96%, #000) 100% 0 / 51% 100% no-repeat;
  mask: radial-gradient(circle 10px at 0 50%, transparent 96%, #000) 0 0 / 51% 100% no-repeat,
        radial-gradient(circle 10px at 100% 50%, transparent 96%, #000) 100% 0 / 51% 100% no-repeat;
}
.ticket::before {
  content: "";
  position: absolute;
  inset: 6px 16px;
  border: 1.5px dashed rgba(43, 28, 24, 0.45);
  border-radius: 8px;
  pointer-events: none;
}
.ticket__label { font-size: var(--text-2xs); font-weight: 900; letter-spacing: 0.2em; color: var(--ink-faint); }
.ticket__url {
  margin-top: 4px;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  line-height: 1.5;
  word-break: break-all;
  color: var(--ink);
  -webkit-user-select: all;
  user-select: all;
}
.seal {
  position: absolute;
  top: 16px; right: 14px;
  display: grid;
  place-items: center;
  width: 64px; height: 64px;
  border-radius: 50%;
  font-family: var(--font-letter);
  font-size: 13px;
  font-weight: 900;
  line-height: 1.15;
  text-align: center;
  color: var(--seal);
  box-shadow: inset 0 0 0 2.5px var(--seal), inset 0 0 0 5px transparent, inset 0 0 0 6.5px var(--seal);
  opacity: 0.85;
  rotate: 14deg;
  animation: stamp-in 0.5s var(--ease-pop) 0.15s both;
}
@keyframes stamp-in {
  from { opacity: 0; transform: scale(1.8); }
  to { opacity: 0.85; transform: scale(1); }
}

/* ---------- 主人页：人数 + 炭火投料位 ---------- */
.count-line { display: flex; align-items: flex-end; gap: 12px; }
.big-count {
  font-family: var(--font-letter);
  font-weight: 900;
  font-size: 3.6rem;
  line-height: 0.9;
  color: var(--ember-600);
  text-shadow: 0 3px 0 var(--ink);
}
.count-line p { margin: 0 0 4px; font-weight: 800; font-size: var(--text-sm); line-height: 1.45; }
.hearth {
  margin-top: 16px;
  padding: 14px 12px 10px;
  border: 2px solid var(--ink);
  border-radius: 16px;
  background: radial-gradient(ellipse at 50% 130%, #5a200e, #1d0d09 70%);
  box-shadow: inset 0 3px 10px rgba(0, 0, 0, 0.65);
}
.coals { display: grid; grid-template-columns: repeat(13, 1fr); gap: 7px 5px; }
.coal {
  aspect-ratio: 1;
  border-radius: 42% 55% 48% 52% / 50% 44% 56% 48%;
  background: radial-gradient(circle at 35% 30%, #4d3d38, #221714 72%);
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.45);
}
.coal:nth-child(3n) { border-radius: 55% 45% 52% 46% / 46% 56% 44% 54%; }
.coal:nth-child(4n+1) { rotate: 18deg; }
.coal.is-lit {
  background: radial-gradient(circle at 38% 32%, #fff1c2, #ffb054 35%, #ff6a1f 70%, #a8340f);
  box-shadow: 0 0 9px 1px rgba(255, 122, 47, 0.8);
  animation: coal-glow 2.6s var(--ease-soft) infinite;
  animation-delay: calc(var(--i, 0) * -0.23s);
}
@keyframes coal-glow { 0%, 100% { opacity: 0.8; } 50% { opacity: 1; } }
.hearth__meta {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  font-size: var(--text-2xs);
  font-weight: 700;
  letter-spacing: 0.12em;
  color: #d9b89a;
}
.secret-line {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 16px 0 0;
  padding: 11px 12px;
  border: 2px dashed rgba(43, 28, 24, 0.35);
  border-radius: 14px;
  font-size: var(--text-xs);
  font-weight: 700;
  line-height: 1.6;
  color: var(--ink-soft);
}

/* 投料页：剩余投料位小签 */
.slots-left {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 10px;
  padding: 3px 11px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  font-size: var(--text-xs);
  font-weight: 800;
  background: var(--paper-hi);
}
.slots-left::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ember-500); }
.slots-left b { color: var(--ember-700); font-variant-numeric: tabular-nums; }

/* ---------- 结果卡 ---------- */
.result { text-align: center; padding-top: 34px; animation: pop-in 0.6s var(--ease-pop); }
.ribbon {
  position: absolute;
  top: -8px; left: 20px;
  padding: 10px 8px 14px;
  font-size: var(--text-2xs);
  font-weight: 900;
  letter-spacing: 0.1em;
  color: var(--paper-hi);
  background: linear-gradient(180deg, var(--clay-light), var(--clay));
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 80%, 0 100%);
}
.result__label { margin: 0; font-size: var(--text-sm); font-weight: 700; color: var(--ink-soft); }
.gift-name {
  margin: 10px 0 8px;
  font-family: var(--font-letter);
  font-weight: 900;
  font-size: clamp(1.6rem, 1.2rem + 2vw, 2rem);
  line-height: 1.3;
  color: var(--clay);
  text-wrap: balance;
}
.gift-name span {
  background: linear-gradient(transparent 62%, rgba(255, 190, 102, 0.7) 62% 90%, transparent 90%);
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
.gift-one-liner { margin: 0 0 16px; font-weight: 800; }
.bubble {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 14px;
  border: 2px solid var(--ink);
  border-radius: 16px;
  text-align: left;
  font-size: var(--text-sm);
  line-height: 1.6;
  background: var(--ember-300);
  box-shadow: 0 3px 0 var(--ink);
}
.bubble__avatar {
  flex: none;
  display: grid;
  place-items: center;
  width: 34px; height: 34px;
  border: 2px solid var(--ink);
  border-radius: 11px;
  overflow: hidden;
  background: #2a2350;
}
.bubble__avatar img { width: 28px; height: auto; }
.bubble__who { display: block; font-size: var(--text-2xs); font-weight: 900; letter-spacing: 0.14em; color: var(--clay-dark); }
.bubble p { margin: 0; font-weight: 700; }
.ai-tag {
  display: inline-block;
  margin-top: 10px;
  padding: 1px 7px;
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-faint);
  border-radius: 4px;
  box-shadow: inset 0 0 0 1px var(--paper-edge);
}
.result__aside { margin: 14px 0 0; font-size: var(--text-xs); font-weight: 600; color: var(--ink-soft); text-wrap: balance; }
.result[data-reaction="rare"] { box-shadow: var(--pop-lg), 0 0 0 4px var(--rare), 0 0 36px rgba(167, 123, 255, 0.6); }
.result[data-reaction="legend"] { box-shadow: var(--pop-lg), 0 0 0 4px var(--legend), 0 0 44px rgba(255, 210, 74, 0.7); }

@keyframes pop-in {
  from { opacity: 0; transform: scale(0.88) translateY(8px); }
  to { opacity: 1; transform: none; }
}
.rise { animation: rise-in 0.7s var(--ease-out) both; animation-delay: var(--d, 0s); }
@keyframes rise-in { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

/* 材料飞进炉子 */
.fly-token {
  position: fixed;
  left: 0; top: 0;
  z-index: 50;
  padding: 7px 14px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  font-weight: 900;
  font-size: var(--text-sm);
  color: var(--ink);
  background: var(--paper-hi);
  box-shadow: 0 3px 0 var(--ink), 0 0 24px rgba(255, 150, 70, 0.65);
  pointer-events: none;
  transform: translate(var(--from-x), var(--from-y)) translate(-50%, -50%);
}
.fly-token.is-flying { animation: fly-arc 0.9s var(--ease-out) forwards; }
@keyframes fly-arc {
  0%   { transform: translate(var(--from-x), var(--from-y)) translate(-50%, -50%) scale(1) rotate(0); }
  45%  { transform: translate(calc((var(--from-x) + var(--to-x)) / 2), calc(min(var(--from-y), var(--to-y)) - 90px)) translate(-50%, -50%) scale(1.12) rotate(-16deg); }
  100% { transform: translate(var(--to-x), var(--to-y)) translate(-50%, -50%) scale(0.2) rotate(40deg); opacity: 0.1; }
}

/* ---------- 页脚 ---------- */
.footer {
  position: relative;
  z-index: 2;
  margin-top: 44px;
  text-align: center;
  font-size: var(--text-2xs);
  letter-spacing: 0.1em;
  color: var(--sky-dim);
}
.footer__mark { display: block; margin-bottom: 6px; font-size: var(--text-xs); color: var(--sky-muted); }
.footer a { color: inherit; }

.dev-badge {
  position: fixed;
  left: 8px; bottom: 8px;
  z-index: 70;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 800;
  color: #000;
  background: #ffcf4a;
  opacity: 0.75;
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0s !important;
    transition-duration: 0.001ms !important;
  }
}
