/* app.css — 员工开票端（2026-10-22 改版）
 *
 * 设计基线：390×844，品牌蓝 #014DB2，页面底 #F5F7FA，卡片圆角 12、控件 8。
 * 金额与单号一律等宽字体；二维码永远白底黑块（不跟主题走）。
 *
 * 零构建：没有预处理器、没有 CDN。字体优先用系统里已有的 Noto Sans SC /
 * JetBrains Mono，缺了就退到平台自带的黑体与等宽 —— 内网机器上外链字体
 * 一定加载不出来，写死 CDN 只会让首屏白一下再跳字。
 */

:root {
  --brand: #014DB2;
  --brand-weak: #EEF4FD;
  --brand-line: #E8F1FD;
  --bg: #F5F7FA;
  --surface: #FFFFFF;
  --line: #D8DEE8;
  --line-soft: #E8ECF2;
  --divider: #EFEFF1;
  --text: #0A1628;
  --text-2: #3E4756;
  --text-3: #6B7280;
  --text-4: #9AA1AC;
  --text-5: #B0B7C3;
  --warn: #B45309;
  --warn-bg: #FEF3C7;
  --ok: #10B981;
  --ok-bg: #E7F7EF;
  --danger: #EF4444;
  --danger-bg: #FDECEC;
  --mute: #F1F3F6;
  --mask: rgba(10, 22, 40, .45);
  --sans: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", "SFMono-Regular", "Cascadia Mono", Consolas, "Liberation Mono", monospace;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body { height: 100%; }

body {
  background: #E9EDF3;
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

body, input, textarea, button, select { font-family: var(--sans); }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
input, textarea { font-size: 16px; } /* <16px 在 iOS 上聚焦会自动放大页面 */
[hidden] { display: none !important; }

#root {
  position: relative;
  width: 100%;
  max-width: 390px;
  height: 100dvh;
  margin: 0 auto;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
@media (min-width: 431px) {
  #root { box-shadow: 0 0 0 1px #DDE3EC, 0 24px 60px rgba(10, 22, 40, .14); }
}

.page { flex: 1; min-height: 0; display: flex; flex-direction: column; background: var(--bg); }

/* ── 顶栏 ─────────────────────────────────────────────────────────── */
.tb {
  flex-shrink: 0;
  height: calc(52px + env(safe-area-inset-top, 0px));
  padding: env(safe-area-inset-top, 0px) 16px 0;
  background: var(--surface);
  display: flex;
  align-items: center;
  gap: 10px;
}
.tb .tbt { font-size: 17px; font-weight: 600; color: var(--text); }
.tb .entry {
  margin-left: auto;
  font-size: 12px;
  font-weight: 500;
  color: var(--brand);
  padding: 8px 0 8px 12px;
}
.icon-btn {
  width: 36px; height: 36px;
  margin-left: -8px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-2);
}
.icon-btn.right { margin-left: auto; margin-right: -8px; }

/* ── 金额页 ───────────────────────────────────────────────────────── */
.sum {
  flex-shrink: 0;
  height: 56px;
  padding: 0 16px;
  background: var(--surface);
  display: flex;
  align-items: center;
}
.suml { display: flex; flex-direction: column; gap: 2px; }
.sumk { font-size: 12px; color: var(--text-3); }
.sumv {
  font-family: var(--mono);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -.3px;
  color: var(--text);
}
.sumf {
  margin-left: auto;
  font-size: 12px;
  font-weight: 500;
  color: var(--danger);
  padding: 8px 0 8px 12px;
}

.list {
  flex: 1;
  min-height: 0;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.card {
  flex-shrink: 0;
  width: 100%;
  height: 84px;
  padding: 16px;
  background: var(--surface);
  border: 2px solid transparent;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
}
.card.on { border-color: var(--brand); }
.r1 { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.amt {
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -.3px;
  color: var(--text);
}
.pill {
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}
.pill.wait { background: var(--warn-bg); color: var(--warn); }
.pill.busy { background: var(--brand-weak); color: var(--brand); }
.pill.done { background: var(--ok-bg); color: var(--ok); }
.pill.fail { background: var(--danger-bg); color: var(--danger); }
.pill.gray { background: var(--mute); color: var(--text-3); }
.meta {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-4);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── 分页条 ───────────────────────────────────────────────────────── */
.pager {
  flex-shrink: 0;
  height: calc(48px + var(--safe-b));
  padding: 0 16px var(--safe-b);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.pgg { display: flex; align-items: center; gap: 4px; }
.pgb {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: var(--mute);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-2);
}
.pgb.off { background: var(--surface); color: #C7CFDB; pointer-events: none; }
.pgn {
  width: 52px;
  text-align: center;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
}
.pgt { font-size: 11px; color: var(--text-4); }

/* ── 空 / 错 / 骨架 ───────────────────────────────────────────────── */
.empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px;
  text-align: center;
}
.et { font-size: 15px; font-weight: 500; color: var(--text-2); }
.ed { font-size: 12px; color: var(--text-4); line-height: 1.7; }
.skel { flex-shrink: 0; height: 84px; border-radius: 12px; background: #EDF0F5; }

/* ── 遮罩 / 底部浮层 ──────────────────────────────────────────────── */
.mask {
  position: absolute;
  inset: 0;
  background: var(--mask);
  animation: fade .16s ease;
  z-index: 20;
}
.sheet {
  position: absolute;
  left: 0; right: 0;
  bottom: var(--kb, 0);
  z-index: 21;
  background: var(--surface);
  border-radius: 20px;
  padding: 16px 16px calc(16px + var(--safe-b));
  animation: up .18s cubic-bezier(.2, .8, .3, 1);
}
.hd {
  width: 40px; height: 4px;
  border-radius: 2px;
  background: #DFE4EC;
  margin: 0 auto;
}
.opts { display: flex; gap: 10px; margin-top: 16px; }
.opt {
  flex: 1;
  height: 88px;
  border-radius: 14px;
  background: #F7F9FC;
  border: 1px solid var(--line-soft);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.opt:active { background: var(--brand-weak); border-color: var(--brand-line); }
.opt svg { color: var(--brand); }
.on-n { font-size: 15px; font-weight: 600; color: var(--text); }
.on-d { font-size: 11px; color: var(--text-4); }

.sh { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.st1 { font-size: 15px; font-weight: 600; color: var(--text); }
.sa {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 700;
  color: var(--text-3);
}
.cl {
  margin-left: auto;
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; line-height: 1;
  color: var(--text-4);
}

.inbox {
  width: 100%;
  height: 96px;
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
  resize: none;
  outline: none;
}
.inbox:focus { border-color: var(--brand); }
.inbox::placeholder { color: var(--text-5); }

.br { display: flex; gap: 10px; margin-top: 12px; }
.bp {
  height: 40px;
  padding: 0 16px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 500; color: var(--text-2);
}
.bs {
  flex: 1;
  height: 40px;
  border-radius: 12px;
  background: #E4E9F0;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 600;
  color: var(--text-4);
}
.bs.on { background: var(--brand); color: #fff; }

/* ── 核对页 ───────────────────────────────────────────────────────── */
.verify-head {
  flex-shrink: 0;
  background: var(--surface);
  padding: 12px 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.vh-amt {
  font-family: var(--mono);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -.4px;
  color: var(--text);
}
.vh-meta {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-4);
}
.body {
  flex: 1;
  min-height: 0;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  overscroll-behavior: contain; /* 滚到底不把底栏顶起来（文档 §9.1） */
  -webkit-overflow-scrolling: touch;
}
.kcard {
  background: var(--surface);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
}
.kh { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kht { font-size: 15px; font-weight: 600; color: var(--text); }
.kp {
  height: 23px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--brand-weak);
  display: inline-flex; align-items: center;
  font-size: 11px; font-weight: 500; color: var(--brand);
}
.kp.optional { background: var(--mute); color: var(--text-3); }
.kl { margin-top: 10px; font-size: 13px; font-weight: 500; color: var(--text-2); }
.kl.s { margin-top: 9px; }

.ki {
  width: 100%;
  height: 42px;
  margin-top: 8px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-size: 15px;
  outline: none;
}
.ki::placeholder { color: var(--text-5); }
.ki:focus { border-color: var(--brand); }
.ki.err { border-color: var(--danger); }
.ki.mono { font-family: var(--mono); font-size: 13px; }
.ke { margin-top: 5px; font-size: 12px; color: var(--danger); }

.kf {
  margin-top: 10px;
  padding: 4px 0;
  align-self: flex-start;
  font-size: 13px;
  font-weight: 500;
  color: var(--brand);
}
.khint { margin-top: 4px; font-size: 12px; color: var(--warn); line-height: 1.5; }
.krow { display: flex; gap: 10px; margin-top: 9px; }
.kcol { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.kcol .lab { font-size: 12px; font-weight: 500; color: var(--text-3); }
.kcol .inp {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  outline: none;
}
.kcol .inp::placeholder { color: var(--text-5); }
.kcol .inp:focus { border-color: var(--brand); }
.kcol .inp.err { border-color: var(--danger); }
.kcol .inp.mono { font-family: var(--mono); font-size: 12px; }

.foot {
  flex-shrink: 0;
  padding: 12px 16px calc(20px + var(--safe-b));
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.foot .miss { font-size: 12px; font-weight: 500; color: var(--danger); line-height: 1.5; }
.foot .go {
  height: 48px;
  border-radius: 10px;
  background: #E4E9F0;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 600;
  color: var(--text-4);
}
.foot .go.on { background: var(--brand); color: #fff; }

/* ── 核对信息（只读回显，2026-10-23）────────────────────────────── */
.pv-card {
  background: var(--surface);
  border-radius: 12px;
  padding: 15px 16px 10px;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}
.pv-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 0;
  border-bottom: 1px solid #F4F6F9;
}
.pv-row:last-child { border-bottom: 0; }
.pv-l { width: 84px; flex-shrink: 0; font-size: 12px; color: var(--text-3); line-height: 1.6; }
.pv-v {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  color: var(--text);
  line-height: 1.5;
  overflow-wrap: anywhere;   /* 不拦腰切数字：长税号整段换行 */
  word-break: normal;
  user-select: text;         /* 员工常要长按复制税号去别处对 */
}
.pv-v.m { font-family: var(--mono); font-size: 11.5px; }
.pv-v.none { color: #B0B7C3; }
.pv-hint { display: flex; gap: 6px; align-items: flex-start; padding: 0 4px 4px; }
.pv-hint svg { flex-shrink: 0; margin-top: 1px; }
.pv-hint span { font-size: 11px; color: #9AA1AC; line-height: 1.6; }

/* 两个按钮等宽：边框宽度双方一致，只用颜色区分（文档 §9.2 的 2px 坑） */
.foot .frow { display: flex; gap: 10px; }
.fbtn {
  flex: 1;
  height: 48px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
  border: 1px solid transparent;
}
.fbtn.g { background: var(--surface); border-color: var(--line); color: var(--text-2); font-weight: 500; }
.fbtn.p { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.fbtn.dis { pointer-events: none; }
.fbtn.p.dis { background: #8FA8C8; border-color: #8FA8C8; }
.fbtn.g.dis { color: var(--text-5); }

/* ── 结果页 ───────────────────────────────────────────────────────── */
.res {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 0 24px calc(24px + var(--safe-b));
  text-align: center;
}
.rico {
  width: 72px; height: 72px;
  border-radius: 36px;
  display: flex; align-items: center; justify-content: center;
}
.rt { font-size: 20px; font-weight: 600; color: var(--text); }
.rm {
  font-family: var(--mono);
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -.5px;
  color: var(--text);
}
.rd { font-size: 12px; color: var(--text-4); line-height: 1.6; }
.rno {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text-3);
  word-break: break-all;
}
.rbtn {
  height: 44px;
  padding: 0 24px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 500;
}
.rbtn.g { background: var(--surface); border: 1px solid var(--line); color: var(--text-2); }
.rbtn.p { background: var(--brand); color: #fff; font-weight: 600; }
.rbtn.danger { background: var(--danger); color: #fff; font-weight: 600; }
.rrow { display: flex; gap: 10px; width: 100%; max-width: 320px; }
.rrow .rbtn { flex: 1; padding: 0; }
.res .qr { width: 100px; height: 100px; background: #fff; border: 1px solid var(--divider); }

/* ── 记录页 ───────────────────────────────────────────────────────── */
.seg {
  flex-shrink: 0;
  height: 56px;
  padding: 0 16px;
  background: var(--surface);
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}
.seg::-webkit-scrollbar { display: none; }
.ch {
  flex-shrink: 0;
  height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  display: flex; align-items: center;
  font-size: 12px; font-weight: 500;
  white-space: nowrap;
}
.ch.on { background: var(--brand); color: #fff; font-weight: 600; }
.ch.off { background: var(--surface); border: 1px solid var(--line); color: var(--text-2); }
.ch.dg { background: var(--danger-bg); color: var(--danger); font-weight: 600; }
.ch.dgon { background: var(--danger); color: #fff; font-weight: 600; }
.ch.dgm { background: var(--mute); color: var(--text-4); font-weight: 600; }

.tk {
  flex-shrink: 0;
  width: 100%;
  height: 96px;
  background: var(--surface);
  border-radius: 12px;
  display: flex;
  overflow: hidden;
  text-align: left;
}
.tkb { width: 3px; flex-shrink: 0; background: var(--text-4); }
.tki {
  flex: 1;
  min-width: 0;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.tka {
  font-family: var(--mono);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -.3px;
  color: var(--text);
}
.tks { font-size: 11px; font-weight: 600; }
.tkt {
  font-size: 13px;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tkn {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-4);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* 失败卡片多一行原因：卡片高度跟着涨，最多两行，长的留给详情页。 */
.tk.tkb-fail { height: auto; min-height: 96px; padding-bottom: 12px; box-sizing: border-box; }
.tkr {
  font-size: 12px;
  line-height: 1.45;
  color: var(--danger);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── 详情页 ───────────────────────────────────────────────────────── */
.hc {
  background: var(--surface);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.big {
  font-family: var(--mono);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -.5px;
  color: var(--text);
}
.sb {
  height: 26px;
  padding: 0 12px;
  border-radius: 999px;
  display: inline-flex; align-items: center;
  font-size: 12px; font-weight: 600;
}
.qc {
  background: var(--surface);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.qc .qr { width: 132px; height: 132px; background: #fff; }
.qn { font-size: 11px; color: var(--text-4); }
.ic { background: var(--surface); border-radius: 12px; padding: 14px 16px; }
.ict { margin-bottom: 8px; font-size: 13px; font-weight: 500; color: var(--text-3); }
.fr { min-height: 26px; display: flex; align-items: flex-start; gap: 8px; padding: 3px 0; }
.fl {
  width: 64px;
  flex-shrink: 0;
  text-align: right;
  font-size: 12px;
  color: var(--text-4);
  padding-top: 1px;
}
.fv { flex: 1; font-size: 13px; font-weight: 500; color: var(--text); word-break: break-all; }
.fv.m { font-family: var(--mono); font-size: 11px; font-weight: 400; }
.fv.e { font-weight: 400; color: var(--text-5); }
.detail-actions { display: flex; gap: 10px; margin-top: 4px; width: 100%; }
/* 两个按钮等宽；文案不换行 —— 「下载发票码」在 390 宽里断成两行会把按钮撑高 */
.detail-actions .bp,
.detail-actions .bs {
  flex: 1 1 0;
  min-width: 0;
  justify-content: center;
  padding: 0 8px;
  white-space: nowrap;
  font-size: 13px;
}

/* ── 对话流 ───────────────────────────────────────────────────────── */
.flow {
  flex: 1;
  min-height: 0;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.tmlab { font-size: 11px; color: var(--text-5); text-align: center; }
.mine { display: flex; justify-content: flex-end; }
.mb {
  width: 300px;
  max-width: 86%;
  background: var(--brand);
  border-radius: 12px;
  padding: 14px;
  color: #fff;
}
.mb .mamt { font-family: var(--mono); font-size: 18px; font-weight: 700; }
.mb .ml1 { margin-top: 6px; font-size: 11px; color: #D6E3F6; }
.mb .ml2 { margin-top: 4px; font-size: 11px; color: #A9C3E4; }
.sys { display: flex; gap: 8px; align-items: flex-start; }
.av {
  width: 26px; height: 26px;
  flex-shrink: 0;
  border-radius: 13px;
  background: var(--brand);
  color: #fff;
  font-size: 12px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
}
.av.gray { background: #C7D3E3; }
.cs {
  width: 268px;
  max-width: calc(100% - 34px);
  background: var(--surface);
  border-radius: 12px;
  padding: 12px;
  display: flex; flex-direction: column; gap: 4px;
}
.cst { font-size: 13px; font-weight: 500; color: var(--text); }
.cds { font-size: 11px; color: var(--text-4); line-height: 1.55; }
.card2 {
  width: 268px;
  max-width: calc(100% - 34px);
  background: var(--surface);
  border-radius: 12px;
  padding: 12px;
  display: flex; flex-direction: column; gap: 10px;
}
.srow { display: flex; align-items: center; gap: 6px; }
.srow .spr { flex: 1; }
.srow .stm { font-family: var(--mono); font-size: 10px; color: var(--text-5); }
.dot {
  width: 18px; height: 18px;
  flex-shrink: 0;
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
}
.dot.ok { background: var(--ok); }
.dot.no { background: var(--danger); }
.srow .lbl { font-size: 13px; font-weight: 600; color: var(--text); }
.qrrow { display: flex; gap: 10px; align-items: center; }
.qrb {
  width: 88px; height: 88px;
  flex-shrink: 0;
  background: #fff;
  border: 1px solid #EDEFF3;
  object-fit: contain;
}
.qrb.blank {
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; color: var(--text-5); text-align: center; padding: 6px;
}
.qcol { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.qcol .qno {
  font-family: var(--mono);
  font-size: 11px; font-weight: 500; color: var(--text);
  word-break: break-all;
}
.qcol .qd { font-size: 10px; color: var(--text-4); line-height: 1.5; }
.btns { display: flex; gap: 8px; }
.btns .bb {
  flex: 1;
  height: 34px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
}
.bb.ghost { background: var(--surface); border: 1px solid var(--line); color: var(--text-2); font-weight: 500; }
.bb.primary { background: var(--brand); color: #fff; font-weight: 600; }
.bb.line {
  flex: none;
  width: 120px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--brand);
  font-weight: 600;
}
.mfoot {
  margin-top: auto;
  padding-top: 8px;
  font-size: 11px;
  color: var(--text-5);
  text-align: center;
}

/* ── 登录 ─────────────────────────────────────────────────────────── */
.login {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 130px 24px calc(32px + var(--safe-b));
  overflow-y: auto;
}
.login-head { display: flex; flex-direction: column; align-items: center; gap: 14px; }
/* 品牌标整块由 SVG 自己画（蓝底圆角 + 白色票据形），CSS 只负责尺寸 */
.logo { width: 56px; height: 56px; display: block; line-height: 0; }
.logo svg { width: 100%; height: 100%; display: block; }
.lg-title { font-size: 22px; font-weight: 600; color: var(--text); }
.lg-sub { font-size: 13px; color: var(--text-3); }
.lg-gap { height: 44px; flex-shrink: 0; }
.lform {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  flex-direction: column;
}
.lform .lab { font-size: 13px; font-weight: 500; color: var(--text-2); }
.lform .lab + .lab, .lform .li + .lab { margin-top: 18px; }
.li {
  width: 100%;
  height: 46px;
  margin-top: 8px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-family: var(--mono);
  font-size: 16px;
  outline: none;
}
.li::placeholder { color: var(--text-5); font-family: var(--sans); font-size: 14px; }
.li:focus { border-color: var(--brand); }
.li.err { border-color: var(--danger); }
.lg-err { margin-top: 6px; font-size: 12px; color: var(--danger); min-height: 0; }
.lg-btns { display: flex; gap: 10px; margin-top: 22px; }
.lb {
  height: 48px;
  flex: 1;
  border-radius: 10px;
  background: var(--brand);
  color: #fff;
  font-size: 16px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
}
/* 次要按钮：只描边，查询不该比开票更抢眼 */
.lb.ghost {
  background: var(--surface);
  color: var(--brand);
  border: 1px solid var(--brand-line);
}
.lb:disabled { background: #8FA9D6; }
.lb.ghost:disabled { background: var(--surface); color: #8FA9D6; border-color: var(--line-soft); }
.lg-foot {
  margin-top: 18px;
  font-size: 12px;
  color: var(--text-4);
  text-align: center;
  line-height: 1.7;
}

/* ── 抽屉 ─────────────────────────────────────────────────────────── */
.drw {
  position: absolute;
  top: 0; right: 0;
  z-index: 21;
  width: 320px;
  max-width: 88%;
  height: 100%;
  padding: calc(28px + env(safe-area-inset-top, 0px)) 20px calc(20px + var(--safe-b));
  background: var(--surface);
  border-radius: 16px 0 0 16px;
  display: flex;
  flex-direction: column;
  animation: slide .2s ease;
}
.drw-acct { display: flex; align-items: center; gap: 12px; }
/* 头像就是首页那个品牌标（SVG 自带蓝底圆角），别再加圆角/底色去裁它 */
.drw-av {
  width: 48px; height: 48px;
  flex-shrink: 0;
  line-height: 0;
}
.drw-av svg { width: 100%; height: 100%; display: block; }
.drw-name { font-size: 16px; font-weight: 600; color: var(--text); }
.drw-id {
  margin-top: 2px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-4);
  word-break: break-all;
}
.drw-quota {
  margin-top: 20px;
  padding: 14px;
  border-radius: 12px;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.drw-qk { font-size: 12px; color: var(--text-3); }
.drw-qv {
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
}
.drw-calc {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-4);
  line-height: 1.6;
}
.drw-list { margin-top: 24px; }
.drw-item {
  width: 100%;
  padding: 0 0 16px;
  text-align: left;
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
}
.drw-item.danger { color: var(--danger); }
.drw-foot { margin-top: auto; font-size: 11px; color: var(--text-5); line-height: 1.6; }

/* ── 取票码弹层 ───────────────────────────────────────────────────── */
.qr-pop {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--mask);
}
.qr-box {
  width: 300px;
  max-width: 100%;
  padding: 24px;
  border-radius: 16px;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  animation: pop .16s ease;
}
.qr-box img { width: 220px; height: 220px; object-fit: contain; background: #fff; }
.qr-box .qno { font-family: var(--mono); font-size: 13px; color: var(--text); word-break: break-all; text-align: center; }
.qr-box .qtip { font-size: 12px; color: var(--text-4); text-align: center; }
.qr-box .qclose {
  width: 100%;
  height: 44px;
  border-radius: 10px;
  background: var(--mute);
  color: var(--text-2);
  font-size: 14px; font-weight: 500;
  display: flex; align-items: center; justify-content: center;
}

/* ── 轻提示 ───────────────────────────────────────────────────────── */
#toast {
  position: fixed;
  left: 50%;
  bottom: calc(88px + var(--safe-b));
  z-index: 60;
  max-width: 320px;
  padding: 10px 16px;
  border-radius: 10px;
  background: rgba(10, 22, 40, .88);
  color: #fff;
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
  transform: translate(-50%, 8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.ok { background: rgba(16, 133, 95, .95); }
#toast.err { background: rgba(190, 44, 44, .95); }

/* ── 动画 ─────────────────────────────────────────────────────────── */
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes up { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes slide { from { transform: translateX(100%); } to { transform: translateX(0); } }
@keyframes pop { from { transform: scale(.96); opacity: 0; } to { transform: scale(1); opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* 键盘弹出时底部浮层跟着抬起来（chat.js 写 --kb） */
@media (max-height: 640px) {
  .login { padding-top: 48px; }
}

/* 出行人「添加/删除」那种文字按钮（2026-11-23 多出行人） */
.link-btn { color: var(--brand); padding: 8px 0; font-size: 14px; }
.link-btn:active { opacity: .6; }

/* 票面显示开关（2026-11-23）：一个勾选 → 税局同侧两个「是否展示」一起勾 */
.chk { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text); padding: 6px 0; }
.chk input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--brand); }

/* 票面显示开关：放在「购方信息」标题行里（2026-11-23 用户定） */
.chk.sm { padding: 0; font-size: 13px; gap: 4px; margin-left: 0; font-weight: normal; }
/* 标题行右侧那一组（发票展示 + 两个勾选）整体靠右、内部间距均匀，别被 space-between 拉开 */
.kh-chk { display: inline-flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.kh-chk .kp { white-space: nowrap; }
.chk.sm input[type="checkbox"] { width: 16px; height: 16px; }

/* 「＋ 添加出行人」放在行程信息标题行（2026-11-23 用户定）：像个小胶囊，可点 */
.add-pax {
  height: 26px; padding: 0 12px; border-radius: 999px;
  background: var(--brand-weak); color: var(--brand);
  font-size: 12px; font-weight: 500;
}
.add-pax:active { opacity: .65; }

/* 日期选择器（出行日期）：Chrome/安卓默认把日期居中，和旁边输入框不齐 —— 强制靠左 */
input[type="date"] { text-align: left; }
input[type="date"]::-webkit-date-and-time-value { text-align: left; }
input[type="date"]::-webkit-datetime-edit { text-align: left; }

/* ICP 备案号（2026-12-02）：页面底部悬挂，管局要求 */
.icp { text-align: center; padding: 14px 0 18px; font-size: 11px; color: #8A94A6; }
.icp a { color: #8A94A6; text-decoration: none; }
