/* 和好火锅店 — askxuningxin.me */
:root {
  --red: #b3121b;
  --red-deep: #8e0e15;
  --red-hot: #d9202b;
  --amber: #ffb020;
  --gold: #e2b75a;
  --black: #141416;
  --bezel: #2a2a2e;
  --paper: #f6f3ec;
  --paper-shade: #e6e0d3;
  --ink: #2a2c33;
  --ink-soft: #63646b;
  --pen: #1e3a8a;
  --seal: #c8102e;
  --font-body: "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  --font-brush: "Ma Shan Zheng", "STKaiti", "KaiTi", "Kaiti SC", serif;
  --font-hand: "Long Cang", "Hannotate SC", "HanziPen SC", "STXingkai", cursive;
  --board-h: 0px;
  --kiosk-h: 128px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; overflow-x: hidden; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  color: #fff5e6;
  font: 400 15px/1.6 var(--font-body);
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(255, 210, 150, 0.16), transparent 60%),
    linear-gradient(112deg, transparent 34%, rgba(255, 230, 200, 0.05) 44%, rgba(255, 230, 200, 0.11) 50%, rgba(255, 230, 200, 0.05) 56%, transparent 66%) 0 0 / 100% 960px no-repeat,
    repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.06) 0 2px, transparent 2px 9px),
    linear-gradient(180deg, #bd1620, var(--red) 40%, #9c1018);
  -webkit-tap-highlight-color: transparent;
  caret-color: var(--pen);
}
/* the parts the browser draws: scrollbar and selection carry the palette too */
html { scrollbar-color: #4a070b #8e0e15; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #8e0e15; }
::-webkit-scrollbar-thumb { background: #4a070b; border-radius: 5px; border: 2px solid #8e0e15; }
::selection { background: var(--amber); color: var(--black); }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
svg.ico { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }

/* ---------- 店招 ---------- */
.sign {
  position: relative;
  text-align: center;
  padding: calc(22px + env(safe-area-inset-top)) 20px 14px;
}
.sign .row {
  display: flex; align-items: center; justify-content: center; gap: 14px;
}
.sign .lantern {
  width: clamp(22px, 7vw, 30px); height: 40px; color: var(--amber);
  filter: drop-shadow(0 0 8px rgba(255, 176, 32, 0.55));
  stroke-width: 1.6;
}
.sign h1 {
  margin: 0;
  font: 400 clamp(38px, 12vw, 58px)/1.05 var(--font-brush);
  color: #fff7ea;
  letter-spacing: 0.04em;
  white-space: nowrap;
  text-shadow: 0 2px 0 rgba(80, 0, 0, 0.35), 0 0 24px rgba(255, 190, 120, 0.25);
}
.sign .sub {
  margin: 10px auto 0;
  display: inline-block;
  padding: 4px 12px;
  border: 1px solid rgba(226, 183, 90, 0.55);
  border-radius: 2px;
  font-size: 11px; line-height: 1.5;
  letter-spacing: 0.1em;
  white-space: nowrap;
  color: #ffd9a6;
}
.sign .sub b { font-weight: 600; color: #fff; }

/* ---------- 叫号屏 ---------- */
.board-wrap {
  position: sticky; top: 0; z-index: 20;
  padding: 6px 14px 12px;
  background: linear-gradient(180deg, #b6131c 0, #b6131c 72%, rgba(182, 19, 28, 0));
}
.board {
  max-width: 460px; margin: 0 auto;
  background: var(--black);
  border-radius: 12px;
  padding: 10px 12px 8px;
  box-shadow:
    0 14px 26px -12px rgba(0, 0, 0, 0.75),
    inset 0 0 0 1px var(--bezel),
    inset 0 2px 0 rgba(255, 255, 255, 0.05);
}
.board canvas { display: block; width: 100%; height: 68px; border-radius: 4px; }
.board .plate {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 8px;
  font-size: 10px; line-height: 1; letter-spacing: 0.24em; font-weight: 600;
  color: #8d8981;
}
.board .plate i {
  display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: var(--amber); box-shadow: 0 0 6px var(--amber); margin-right: 6px;
  vertical-align: 1px;
}
.board.off .plate i { background: #3a3128; box-shadow: none; }

/* ---------- 出票口与小票 ---------- */
.hall {
  position: relative;
  max-width: 460px;
  margin: 0 auto;
  overflow: hidden; /* stamps land from outside the paper; never widen the viewport */
  padding: 2px 18px calc(var(--kiosk-h) + 26px + env(safe-area-inset-bottom));
}
.slot {
  height: 16px; margin: 0 2px;
  border-radius: 8px;
  background: #0e0e10;
  box-shadow: inset 0 4px 8px rgba(0, 0, 0, 0.85), 0 1px 0 rgba(255, 255, 255, 0.08);
  position: relative; z-index: 3;
}
.paper {
  position: relative;
  margin: -6px 12px 30px;
  padding: 20px 18px 24px;
  color: var(--ink);
  font-size: 14px; line-height: 1.65;
  font-variant-numeric: tabular-nums;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.05), transparent 10%, transparent 90%, rgba(0, 0, 0, 0.05)),
    repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.03) 0 1px, transparent 1px 3px),
    var(--paper);
  box-shadow: 0 16px 30px -14px rgba(0, 0, 0, 0.65), 0 2px 0 rgba(0, 0, 0, 0.08);
}
.paper::before, .paper::after {
  content: ""; position: absolute; left: 0; right: 0; height: 8px;
  background-repeat: repeat-x; background-size: 16px 8px;
}
.paper::before { top: -8px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='8'%3E%3Cpolygon points='0,8 8,0 16,8' fill='%23f6f3ec'/%3E%3C/svg%3E"); }
.paper::after  { bottom: -8px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='8'%3E%3Cpolygon points='0,0 8,8 16,0' fill='%23f6f3ec'/%3E%3C/svg%3E"); }
.paper.first { margin-top: -4px; }
.paper.first::before { display: none; }
.paper + .paper { margin-top: 8px; }

.paper p { margin: 0; }
.paper .c { text-align: center; }
.paper .h { text-align: center; font-weight: 700; font-size: 19px; letter-spacing: 0.18em; }
.paper .brush { font-family: var(--font-brush); font-weight: 400; letter-spacing: 0.08em; line-height: 1.25; }
.paper .small { font-size: 12px; color: var(--ink-soft); line-height: 1.6; }
.paper .rule { border-top: 1px dashed rgba(42, 44, 51, 0.55); margin: 12px 0; height: 0; }
.paper .row { display: flex; align-items: baseline; gap: 8px; }
.paper .row .k { flex: 0 0 auto; }
.paper .row .dots { flex: 1 1 auto; border-bottom: 2px dotted rgba(42, 44, 51, 0.45); transform: translateY(-5px); }
.paper .row .v { flex: 0 0 auto; font-weight: 600; }
.paper .row.total { font-size: 17px; font-weight: 700; }
.paper .big { font-size: 56px; font-weight: 800; line-height: 1.05; letter-spacing: 0.06em; text-align: center; margin: 4px 0 2px; }
.paper .lab { font-weight: 700; margin: 14px 0 4px; letter-spacing: 0.1em; }
.paper .stub-text { font-size: 13px; letter-spacing: 0.04em; }

.queue { list-style: none; margin: 6px 0 0; padding: 0; font-size: 12.5px; color: var(--ink); }
.queue li { display: flex; justify-content: space-between; padding: 3px 0; border-bottom: 1px dotted rgba(42, 44, 51, 0.25); }
.queue li.cleared { color: var(--ink-soft); text-decoration: line-through; text-decoration-color: rgba(200, 16, 46, 0.7); text-decoration-thickness: 2px; }
.queue li b { font-weight: 600; }

/* 服务列表 */
.svc {
  position: relative;
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 4px;
  border-bottom: 1px dotted rgba(42, 44, 51, 0.35);
  cursor: pointer;
}
.svc .ico { margin-top: 3px; width: 26px; height: 26px; }
.svc .txt { flex: 1 1 auto; min-width: 0; }
.svc b { display: block; font-size: 15px; font-weight: 700; }
.svc span { display: block; font-size: 12.5px; color: var(--ink-soft); line-height: 1.55; }
.svc .stub {
  flex: 0 0 auto; align-self: center;
  font-size: 11px; letter-spacing: 0.12em; color: var(--ink-soft);
  border: 1px solid rgba(42, 44, 51, 0.5); border-radius: 2px; padding: 3px 7px;
}
.svc.done .stub { display: none; }
.svc .seal { position: absolute; right: 0; top: 50%; width: 58px; height: 58px; margin-top: -29px; }
.svc.done .txt { padding-right: 52px; }
.svc.done b { color: var(--ink); }
.done-line { display: flex; align-items: center; gap: 8px; font-weight: 600; margin-top: 10px; }
.done-line .ico { color: var(--pen); width: 20px; height: 20px; stroke-width: 2.4; }
.clear { font-size: 12.5px; color: var(--ink-soft); padding-left: 28px; }
.clear b { color: var(--seal); font-weight: 600; }

/* 印章 */
.seal { pointer-events: none; mix-blend-mode: multiply; transform: rotate(-12deg); animation: stamp 0.42s cubic-bezier(0.16, 1, 0.3, 1) both; }
.seal svg { width: 100%; height: 100%; display: block; }
.seal.big { position: absolute; right: 22px; bottom: 64px; width: 96px; height: 96px; transform: rotate(-14deg); }
@keyframes stamp {
  0%   { opacity: 0; transform: rotate(-26deg) scale(2.1); }
  100% { opacity: 0.92; transform: rotate(-12deg) scale(1); }
}
.seal.big { animation-name: stamp-big; }
@keyframes stamp-big {
  0%   { opacity: 0; transform: rotate(-30deg) scale(2.2); }
  100% { opacity: 0.92; transform: rotate(-14deg) scale(1); }
}

/* 纸鹤 */
.crane-fx {
  position: absolute; left: 12px; top: 14px;
  width: 22px; height: 22px; color: var(--seal);
  stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linejoin: round;
  pointer-events: none;
  animation: fly 1.7s cubic-bezier(0.18, 0.7, 0.3, 1) forwards;
}
@keyframes fly { to { transform: translate(var(--dx), var(--dy)) rotate(var(--rot)) scale(0.7); opacity: 0; } }

/* 认错信 */
body.dim .sign, body.dim .paper:not(.letter) { filter: brightness(0.35) saturate(0.6); }
.dimmer {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 10;
  background: rgba(14, 8, 8, 0.78);
  opacity: 0; pointer-events: none;
  transition: opacity 0.7s ease-out;
}
body.dim .dimmer { opacity: 1; }
.paper.letter { z-index: 12; padding: 30px 20px 34px; font-size: 15px; line-height: 1.9; color: #24262c; }
.paper.letter .ln { position: relative; margin: 0; min-height: 1em; }
.paper.letter .ln.gap { height: 0.9em; }
.paper.letter .ln.sig { text-align: right; margin-top: 18px; font-family: var(--font-hand); font-size: 24px; line-height: 1.2; color: #1c1d22; }
.paper.letter .ln.sig .dash { display: inline-block; width: 26px; height: 2px; background: #1c1d22; vertical-align: 8px; margin-right: 10px; border-radius: 1px; transform: rotate(-2deg); }
.paper.letter .ln.sig small { display: block; font-family: var(--font-body); font-size: 12px; color: var(--ink-soft); letter-spacing: 0.1em; margin-top: 4px; }
.margin {
  display: inline-block; margin-left: 10px;
  font-family: var(--font-hand); font-size: 18px; line-height: 1;
  color: #1c1d22; white-space: nowrap;
  transform: rotate(-3deg) translateY(-3px);
  animation: ink 0.5s ease-out both;
}

/* 打印动画 */
.print { animation: feed 0.6s cubic-bezier(0.16, 1, 0.3, 1) both; }
@keyframes feed {
  from { clip-path: inset(0 0 100% 0); transform: translateY(-8px); }
  to   { clip-path: inset(0 0 -30% 0); transform: none; }
}
.print .ln { opacity: 0; animation: ink 0.3s ease-out forwards; animation-delay: calc(var(--i, 0) * 75ms); }
@keyframes ink { from { opacity: 0; filter: blur(0.8px); } to { opacity: 1; filter: none; } }
.instant .print, .instant .print .ln, .instant .seal, .instant .margin { animation: none !important; opacity: 1; clip-path: none; }
@media (prefers-reduced-motion: reduce) {
  .print, .print .ln, .seal, .margin, .crane-fx, .tick input:checked ~ .box svg, .key .dot { animation-duration: 0.01ms !important; animation-delay: 0ms !important; animation-iteration-count: 1 !important; }
  .dimmer { transition: none; }
}

/* 点菜单 */
.ticks { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.ticks.times { grid-template-columns: 1fr 1fr 1fr; }
.ticks.days { grid-template-columns: 1fr 1fr; }
.tick .lbl { white-space: nowrap; }
.tick .today { font-style: normal; font-size: 11px; font-weight: 600; color: var(--seal); margin-left: 6px; vertical-align: 1px; }
.tick {
  position: relative;
  display: flex; align-items: center; gap: 9px;
  min-height: 44px; padding: 8px 2px;
  border-bottom: 1px dotted rgba(42, 44, 51, 0.35);
  cursor: pointer; font-size: 15px;
}
.tick input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.tick .box { position: relative; flex: 0 0 auto; width: 20px; height: 20px; border: 1.5px solid var(--ink); border-radius: 2px; }
.tick .box svg { position: absolute; left: -3px; top: -9px; width: 30px; height: 30px; color: var(--pen); stroke: currentColor; fill: none; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 34; stroke-dashoffset: 34; }
.tick input:checked ~ .box svg { animation: draw 0.35s ease-out forwards; }
.tick input:focus-visible ~ .box { outline: 2px solid var(--amber); outline-offset: 2px; }
.tick input:checked ~ .lbl { font-weight: 700; }
.tick input:disabled ~ .lbl, .tick input:disabled ~ .box { opacity: 0.75; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.tick .ico { color: var(--ink); }
.note {
  display: block; width: 100%; min-height: 90px; margin-top: 2px;
  border: 0; border-radius: 0; padding: 0 2px; resize: none; outline: none;
  background: repeating-linear-gradient(transparent 0 27px, rgba(42, 44, 51, 0.4) 27px 28px);
  font: 400 15px/28px var(--font-body); color: var(--pen);
}
.note::placeholder { color: var(--ink-soft); }
.note:focus { background-color: rgba(30, 58, 138, 0.04); }

/* 过号（次要动作，印在纸上） */
.link {
  background: none; border: 0; padding: 14px 16px; margin: -6px 0;
  font: inherit; font-size: 12px; color: var(--ink-soft);
  text-decoration: underline; text-underline-offset: 4px; text-decoration-color: rgba(42, 44, 51, 0.45);
  cursor: pointer; letter-spacing: 0.06em;
}
.link:hover { color: var(--ink); }
.skipline { color: var(--seal); font-weight: 500; }

/* 条码 */
.barcode { display: block; width: 100%; height: 42px; margin: 4px 0 2px; color: var(--ink); }

/* ---------- 取号机面板 ---------- */
.kiosk {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  background: var(--black);
  padding: 12px 20px calc(14px + env(safe-area-inset-bottom));
  box-shadow: 0 -1px 0 var(--bezel), 0 -18px 34px -14px rgba(0, 0, 0, 0.75), 0 -90px 140px -40px rgba(40, 0, 4, 0.55);
}
.kiosk .in { max-width: 460px; margin: 0 auto; display: flex; align-items: center; gap: 18px; }
.kiosk .plate { flex: 1 1 auto; min-width: 0; color: #b9b4aa; font-size: 12.5px; line-height: 1.55; }
.kiosk .plate b { display: block; color: var(--amber); font-size: 16px; font-weight: 700; letter-spacing: 0.12em; margin-bottom: 2px; }
.keywell {
  flex: 0 0 auto; padding: 7px; border-radius: 50%;
  background: #08080a;
  box-shadow: inset 0 3px 6px rgba(0, 0, 0, 0.95), 0 1px 0 rgba(255, 255, 255, 0.06);
}
.key {
  display: block; width: 84px; height: 84px; border-radius: 50%; border: 0; padding: 0;
  color: #fff3e3;
  font: 700 20px/1 var(--font-body); letter-spacing: 0.08em;
  background: radial-gradient(circle at 36% 30%, #f2525a, #b3121b 58%, #7d0c12);
  box-shadow: 0 7px 0 #4a070b, 0 12px 20px rgba(0, 0, 0, 0.6), inset 0 -5px 10px rgba(0, 0, 0, 0.3), inset 0 2px 2px rgba(255, 255, 255, 0.35);
  transition: transform 0.08s ease-out, box-shadow 0.08s ease-out, filter 0.2s;
  cursor: pointer; -webkit-user-select: none; user-select: none; touch-action: manipulation;
}
.key.small { font-size: 16px; letter-spacing: 0.04em; }
.key:active, .key.down { transform: translateY(5px); box-shadow: 0 2px 0 #4a070b, 0 4px 8px rgba(0, 0, 0, 0.5), inset 0 -2px 6px rgba(0, 0, 0, 0.35); }
.key:disabled { cursor: default; filter: saturate(0.35) brightness(0.55); }
.key:disabled:active { transform: none; }
.key:focus-visible { outline: 3px solid var(--amber); outline-offset: 5px; }
.key .dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: currentColor; margin-left: 3px; animation: blink 1s steps(2, start) infinite; vertical-align: 2px; }
@keyframes blink { to { visibility: hidden; } }

@media (min-width: 520px) {
  .sign .sub { font-size: 12px; letter-spacing: 0.18em; }
  .paper { font-size: 15px; }
}
