/* ==========================================================================
   天鸿茶室点餐系统 · 公共样式
   设计语言：纸白 · 墨黑 · 黄铜笔触 · 印章红（编辑式茶室风）
   —— 无大圆角、无投影分层，靠留白与 1px 细线组织版面。
   ========================================================================== */

:root {
  /* ---- 纸面 ---- */
  --paper: #f6f6f5;
  --surface: #ffffff;
  --surface-2: #fbfbfa;
  --surface-3: #f0f0ee;

  /* ---- 墨 ---- */
  --ink: #111111;
  --ink-2: #4a4a47;
  --ink-3: #6f6f6b;
  --muted: #9c9c97;

  /* ---- 细线 ---- */
  --line: #e8e8e5;
  --line-2: #dcdcd8;
  --line-3: #c9c9c4;

  /* ---- 黄铜（点缀：笔触 / 细线 / 选中态） ---- */
  --brass: #cca560;
  --brass-deep: #a8823f;
  --brass-soft: #f7f2e6;

  /* ---- 印章红（仅小面积使用：角标 / 数量 / 待办） ---- */
  --seal: #8a1623;
  --seal-soft: #f9edef;

  /* ---- 状态：茶绿 / 石板 ---- */
  --tea: #3c5c4e;
  --tea-soft: #eef2ef;
  --slate: #46545e;
  --slate-soft: #eef0f2;

  /* ---- 兼容旧变量名（页面与脚本大量引用，统一指向新令牌） ---- */
  --bg: var(--paper);
  --bg-soft: var(--surface-2);
  --card: var(--surface);
  --line-strong: var(--line-2);
  --primary: var(--ink);
  --primary-dark: var(--tea);
  --primary-soft: var(--tea-soft);
  --accent: var(--brass);
  --accent-soft: var(--brass-soft);
  --text: var(--ink);
  --text-2: var(--ink-2);
  --red: var(--seal);
  --red-soft: var(--seal-soft);
  --blue: var(--slate);
  --green: var(--tea);
  --orange: var(--brass-deep);

  /* ---- 几何：极小圆角、去投影 ---- */
  --radius: 2px;
  --radius-sm: 2px;
  --shadow: 0 0 0 rgba(0, 0, 0, 0);
  --shadow-lg: 0 16px 48px rgba(22, 22, 20, 0.16);

  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei",
    "Hiragino Sans GB", "Source Han Sans SC", sans-serif;
  --font-serif: "Songti SC", "Noto Serif SC", "Source Han Serif SC", "STSong",
    "SimSun", "Times New Roman", serif;

  /* 黄铜笔触：中点粗、两端尖，微微倾斜 —— 本设计的签名元素 */
  --brush: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 240 6' preserveAspectRatio='none'%3E%3Cpath d='M0 3.6C46 2.4 150 1 240 .8C150 2.6 46 4.7 0 5.2Z' fill='%23cca560'/%3E%3C/svg%3E");
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body { min-height: 100vh; }

a { color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--brass); }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
img { display: block; max-width: 100%; }

/* ---------------- 排版工具 ---------------- */

/* 衬线标题（编辑式版面里所有「标题」都用它） */
.serif, h1, h2, h3 { font-family: var(--font-serif); font-weight: 600; letter-spacing: .04em; }

/* 极小号字距标签 */
.eyebrow {
  font-size: 10px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
}

/* 黄铜笔触（签名元素）：中点粗两端尖 */
.brush {
  display: block;
  height: 5px;
  background: var(--brush) no-repeat;
  background-size: 100% 100%;
}

/* 1px 黄铜细线 */
.hair-brass { height: 1px; background: var(--brass); opacity: .55; }

/* 数字统一用等宽数字 */
.num { font-variant-numeric: tabular-nums; }

/* ---------------- 通用控件 ---------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 15px;
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--ink);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: .03em;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
  white-space: nowrap;
  user-select: none;
}
.btn:hover { background: var(--surface-2); border-color: var(--line-3); }
.btn:active { background: var(--surface-3); }
.btn:disabled { opacity: .4; cursor: not-allowed; }

/* 主按钮：墨黑填充、直角感、宽字距 */
.btn-primary {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
  letter-spacing: .08em;
}
.btn-primary:hover { background: #000; border-color: #000; }

.btn-accent {
  background: var(--brass);
  border-color: var(--brass);
  color: #2e2514;
}
.btn-accent:hover { background: var(--brass-deep); border-color: var(--brass-deep); color: #fff; }

.btn-danger { background: var(--surface); border-color: #dfbcc1; color: var(--seal); }
.btn-danger:hover { background: var(--seal-soft); border-color: var(--seal); }

.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--surface-2); border-color: transparent; }

.btn-sm { padding: 5px 11px; font-size: 12.5px; }
.btn-lg { padding: 13px 22px; font-size: 15px; letter-spacing: .1em; }
.btn-block { width: 100%; }

.input, .select, .textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  background: var(--surface);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--brass);
  box-shadow: 0 0 0 3px rgba(204, 165, 96, .16);
}
.textarea { resize: vertical; min-height: 72px; }

.field { margin-bottom: 13px; }
.field > label {
  display: block;
  font-size: 10px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}
.field-row { display: flex; gap: 10px; }
.field-row > * { flex: 1; min-width: 0; }

/* 标签：极细边框 + 白底，不用色块 */
.tag {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 2px;
  font-size: 10.5px;
  letter-spacing: .1em;
  background: var(--surface);
  border: 1px solid var(--line-2);
  color: var(--ink-2);
  line-height: 1.7;
}
.tag-green { border-color: #bdd0c6; color: var(--tea); background: var(--tea-soft); }
.tag-red { border-color: #e0c0c5; color: var(--seal); background: var(--seal-soft); }
.tag-gray { border-color: var(--line-2); color: var(--muted); background: var(--surface-2); }
.tag-blue { border-color: #c3ccd3; color: var(--slate); background: var(--slate-soft); }

.empty {
  padding: 48px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 13.5px;
  letter-spacing: .04em;
}
.empty-icon { font-size: 30px; opacity: .28; margin-bottom: 10px; filter: grayscale(1); }
.empty-icon .ico-line { width: 30px; height: 30px; margin: 0 auto; }

.spin {
  width: 15px; height: 15px;
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------- 图标（细线、单色） ---------------- */

.ico-line { width: 16px; height: 16px; display: inline-block; vertical-align: -3px; flex-shrink: 0; }
.ico-line path, .ico-line circle, .ico-line rect, .ico-line line, .ico-line polyline, .ico-line polygon {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.25;
  stroke-linecap: square;
  stroke-linejoin: miter;
}

/* ---------------- 提示 / 弹窗 ---------------- */

#toasts {
  position: fixed;
  top: 16px; left: 50%;
  transform: translateX(-50%);
  z-index: 9000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}
.toast {
  padding: 9px 18px;
  border-radius: 2px;
  background: var(--ink);
  color: #fff;
  font-size: 13.5px;
  letter-spacing: .05em;
  box-shadow: var(--shadow-lg);
  animation: toastIn .2s ease;
  max-width: 84vw;
}
.toast.ok { background: var(--tea); }
.toast.err { background: var(--seal); }
.toast.warn { background: var(--brass-deep); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-10px); } }

.mask {
  position: fixed; inset: 0;
  background: rgba(20, 20, 18, .48);
  z-index: 8000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  backdrop-filter: blur(2px);
}
.modal {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 460px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  animation: modalIn .18s ease;
}
@keyframes modalIn { from { opacity: 0; transform: translateY(8px); } }
.modal-head {
  padding: 15px 18px 13px;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 16px;
  letter-spacing: .08em;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-body { padding: 18px; overflow: auto; }
.modal-foot {
  padding: 13px 18px;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 9px;
  justify-content: flex-end;
}
.modal-x {
  border: none; background: none; cursor: pointer;
  font-size: 20px; color: var(--muted); line-height: 1;
  padding: 0 4px;
}
.modal-x:hover { color: var(--ink); }

/* ---------------- 表格 ---------------- */

.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th {
  text-align: left;
  padding: 10px 12px;
  font-weight: 500;
  font-size: 10px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--surface);
  border-bottom: 1px solid var(--line-2);
  white-space: nowrap;
}
.table td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.table tbody tr:hover { background: var(--surface-2); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------------- 登录页 ---------------- */

.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--paper);
  padding: 20px;
}
.login-card {
  width: 100%;
  max-width: 372px;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 38px 30px 30px;
  border: 1px solid var(--line);
}
.login-logo { text-align: center; margin-bottom: 26px; }
.login-logo .mark {
  width: 46px; height: 46px;
  margin: 0 auto 14px;
  border-radius: 2px;
  background: var(--ink);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-serif);
  font-size: 23px;
}
.login-logo h1 {
  font-family: var(--font-serif);
  font-size: 20px;
  margin: 0 0 6px;
  letter-spacing: .18em;
  font-weight: 600;
}
.login-logo p { margin: 0; color: var(--muted); font-size: 10px; letter-spacing: .24em; text-transform: uppercase; }
.login-logo .brush { width: 54px; margin: 14px auto 0; }

/* ---------------- 布局骨架 ---------------- */

.app { display: flex; min-height: 100vh; }
.side {
  width: 214px;
  flex-shrink: 0;
  background: var(--surface);
  color: var(--ink-2);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  border-right: 1px solid var(--line);
}
.side-brand {
  padding: 22px 20px 18px;
  border-bottom: 1px solid var(--line);
}
.side-brand .b1 {
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: .2em;
}
.side-brand .b2 {
  font-size: 9.5px;
  color: var(--muted);
  margin-top: 5px;
  letter-spacing: .26em;
}
.side-brand .brush { width: 34px; margin-top: 12px; height: 4px; }
.side-nav { flex: 1; overflow-y: auto; padding: 12px 0; }
.side-item {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 20px;
  cursor: pointer;
  font-size: 13.5px;
  letter-spacing: .05em;
  transition: background .14s, color .14s, border-color .14s;
  color: var(--ink-2);
  border-left: 2px solid transparent;
}
.side-item:hover { background: var(--surface-2); color: var(--ink); }
.side-item.on {
  background: var(--brass-soft);
  border-left-color: var(--brass);
  color: var(--ink);
  font-weight: 600;
}
.side-item .ico { width: 17px; height: 17px; flex-shrink: 0; opacity: .72; }
.side-item.on .ico { opacity: 1; }
.side-item .ico path, .side-item .ico circle, .side-item .ico rect,
.side-item .ico line, .side-item .ico polyline, .side-item .ico polygon {
  fill: none; stroke: currentColor; stroke-width: 1.25;
  stroke-linecap: square; stroke-linejoin: miter;
}
.side-item .badge {
  margin-left: auto;
  background: var(--seal); color: #fff;
  font-size: 10.5px; padding: 0 6px;
  border-radius: 2px; line-height: 17px; min-width: 17px; text-align: center;
  letter-spacing: 0;
}
.side-foot {
  padding: 14px 20px 18px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
}
.side-foot .who { color: var(--ink-2); font-size: 12.5px; margin-bottom: 9px; letter-spacing: .05em; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 58px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 22px;
  position: sticky; top: 0; z-index: 60;
}
.topbar h2 {
  font-family: var(--font-serif);
  font-size: 16px;
  margin: 0;
  font-weight: 600;
  letter-spacing: .12em;
}
.topbar .spacer { flex: 1; }
.topbar .stat-inline { font-size: 12.5px; color: var(--ink-3); letter-spacing: .04em; }
.topbar .stat-inline b { color: var(--ink); font-variant-numeric: tabular-nums; font-weight: 600; }

.content { padding: 20px 22px 44px; flex: 1; }

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 16px;
  overflow: hidden;
}
.panel-head {
  padding: 14px 17px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.panel-head h3 {
  font-family: var(--font-serif);
  font-size: 14.5px;
  margin: 0;
  font-weight: 600;
  letter-spacing: .12em;
}
.panel-head .spacer { flex: 1; }
.panel-body { padding: 17px; }
.panel-body.flush { padding: 0; }

.grid { display: grid; gap: 14px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* 指标卡 */
.kpi {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.kpi .label {
  font-size: 10px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 9px;
}
.kpi .value {
  font-family: var(--font-serif);
  font-size: 26px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: .01em;
}
.kpi .value.sm { font-size: 20px; }
.kpi .sub { font-size: 11.5px; color: var(--muted); margin-top: 7px; letter-spacing: .04em; }
.kpi .value .unit { font-size: 13px; font-weight: 400; color: var(--muted); margin-left: 3px; font-family: var(--font); }

/* 状态点：方点，不用圆点 */
.dot { width: 7px; height: 7px; display: inline-block; }
.dot-idle { background: var(--line-3); }
.dot-occupied { background: var(--tea); }
.dot-reserved { background: var(--brass); }
.dot-cleaning { background: var(--slate); }

/* 状态标签：极细边框、无圆角 */
.status-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 1px 8px;
  border-radius: 2px;
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: .06em;
  border: 1px solid transparent;
}
.s-pending { background: var(--seal-soft); color: var(--seal); border-color: #e0c0c5; }
.s-accepted { background: var(--brass-soft); color: var(--brass-deep); border-color: #e6d6b6; }
.s-serving { background: var(--slate-soft); color: var(--slate); border-color: #c3ccd3; }
.s-done { background: var(--tea-soft); color: var(--tea); border-color: #bdd0c6; }
.s-canceled { background: var(--surface-2); color: var(--muted); border-color: var(--line-2); }
.s-paid { background: var(--tea-soft); color: var(--tea); border-color: #bdd0c6; }
.s-unpaid { background: var(--seal-soft); color: var(--seal); border-color: #e0c0c5; }

/* ---------------- 点单组件（顾客端 / 前台端共用） ---------------- */

/* 底部抽屉：直角 + 细线 */
.sheet-mask {
  position: fixed; inset: 0; background: rgba(20, 20, 18, .44);
  z-index: 80; opacity: 0; pointer-events: none; transition: opacity .2s;
}
.sheet-mask.show { opacity: 1; pointer-events: auto; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 90;
  background: var(--card);
  border-top: 1px solid var(--line);
  max-height: 80vh;
  display: flex; flex-direction: column;
  transform: translateY(110%);
  transition: transform .26s cubic-bezier(.32, .72, 0, 1);
}
.sheet.show { transform: none; }
.sheet-head {
  padding: 16px 18px 13px;
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-serif);
  font-weight: 600; font-size: 15px; letter-spacing: .14em;
}
.sheet-head .clear {
  margin-left: auto; font-size: 11.5px; color: var(--muted);
  cursor: pointer; font-weight: 400; letter-spacing: .1em;
  font-family: var(--font);
}
.sheet-head .clear:hover { color: var(--ink); }
.sheet-body { overflow-y: auto; padding: 4px 18px 14px; flex: 1; }
.sheet-foot { padding: 14px 18px calc(16px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }

/* 明细行 */
.ci { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.ci:last-child { border-bottom: none; }
.ci img { width: 50px; height: 50px; object-fit: cover; background: var(--surface-3); flex-shrink: 0; }
.ci .mid { flex: 1; min-width: 0; }
.ci .nm { font-size: 13.5px; font-weight: 600; letter-spacing: .04em; }
.ci .pr { font-size: 11.5px; color: var(--muted); margin-top: 4px; font-variant-numeric: tabular-nums; letter-spacing: .04em; }

/* 订单条目 / 汇总 */
.oitem { display: flex; font-size: 13px; padding: 6px 0; letter-spacing: .04em; }
.oitem .n { flex: 1; }
.oitem .x { color: var(--muted); margin: 0 14px; font-variant-numeric: tabular-nums; }
.oitem .p { font-variant-numeric: tabular-nums; }

.sumrow { display: flex; font-size: 12.5px; padding: 5px 0; color: var(--ink-2); letter-spacing: .06em; }
.sumrow .v { margin-left: auto; font-variant-numeric: tabular-nums; }
.sumrow.total {
  font-size: 14px; font-weight: 600; color: var(--ink);
  padding-top: 11px; margin-top: 7px; border-top: 1px solid var(--line);
}
.sumrow.total .v { font-size: 19px; letter-spacing: .01em; }

/* 状态完成卡 */
.done-card { text-align: center; padding: 26px 18px 16px; }
.done-card .ico {
  width: 54px; height: 54px; margin: 0 auto 15px;
  background: var(--surface-2); border: 1px solid var(--line-2);
  color: var(--ink);
  display: flex; align-items: center; justify-content: center;
}
.done-card .ico .ico-line { width: 23px; height: 23px; }
.done-card h3 {
  font-family: var(--font-serif);
  margin: 0 0 8px; font-size: 17px; letter-spacing: .12em; font-weight: 600;
}
.done-card p { margin: 0; color: var(--muted); font-size: 11px; letter-spacing: .1em; }

/* 进度：方点 + 细线 */
.track { display: flex; padding: 20px 4px 8px; }
.track .step { flex: 1; text-align: center; position: relative; }
.track .step .dot2 {
  width: 9px; height: 9px; margin: 0 auto 11px;
  background: var(--line-2); position: relative; z-index: 2;
  font-size: 0; line-height: 0; overflow: hidden;
}
.track .step.on .dot2 { background: var(--ink); }
.track .step .txt { font-size: 10.5px; color: var(--muted); letter-spacing: .1em; }
.track .step.on .txt { color: var(--ink); font-weight: 600; }
.track .step::after {
  content: ''; position: absolute; top: 4px; left: 50%; width: 100%; height: 1px;
  background: var(--line-2); z-index: 1;
}
.track .step:last-child::after { display: none; }
.track .step.on::after { background: var(--brass); }

/* 支付方式选择 */
.pay-methods { display: flex; gap: 10px; margin: 4px 0 12px; }
.pay-m {
  flex: 1; border: 1px solid var(--line-2); border-radius: 2px;
  padding: 13px 10px; cursor: pointer; text-align: center; background: var(--surface);
  transition: border-color .15s, background .15s;
}
.pay-m:hover { border-color: var(--line-3); }
.pay-m.on { border-color: var(--ink); background: var(--surface-2); }
.pay-m .pi { height: 20px; line-height: 1; color: var(--ink-2); }
.pay-m .pi .ico-line { width: 20px; height: 20px; }
.pay-m.on .pi { color: var(--ink); }
.pay-m .pt { font-size: 12.5px; font-weight: 600; margin-top: 6px; letter-spacing: .06em; }
.pay-m .pd { font-size: 10px; color: var(--muted); margin-top: 3px; letter-spacing: .06em; }

/* 分段选择器（堂食 / 外带 这类二选一）。与 .pay-m 同样是 2px 直角、选中=墨黑 */
.seg {
  display: flex;
  border: 1px solid var(--line-2);
  border-radius: 2px;
  overflow: hidden;
  background: var(--surface);
}
.seg > button {
  flex: 1;
  padding: 9px 4px;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 13px;
  letter-spacing: .12em;
  color: var(--ink-2);
  cursor: pointer;
  transition: background .15s, color .15s;
}
.seg > button + button { border-left: 1px solid var(--line-2); }
.seg > button:hover { background: var(--surface-2); }
.seg > button.on { background: var(--ink); color: #fff; }
.seg > button.on:hover { background: var(--ink); }
.seg-sm > button { padding: 7px 14px; font-size: 12.5px; flex: 0 0 auto; }
.seg-hint { font-size: 11px; color: var(--muted); margin-top: 7px; letter-spacing: .04em; }

/* 外带角标：印章红描边，与「热销」同源但更克制 */
.tag-takeaway {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 2px;
  font-size: 10.5px;
  letter-spacing: .12em;
  border: 1px solid #e0c0c5;
  background: var(--seal-soft);
  color: var(--seal);
  line-height: 1.7;
  vertical-align: 1px;
}

/* 说明块：黄铜左竖条（.mock-note 为旧名，保留兼容） */
.hint-note,
.mock-note {
  background: var(--brass-soft);
  border-left: 2px solid var(--brass);
  color: #6b5426; font-size: 12px; line-height: 1.65;
  padding: 10px 12px; letter-spacing: .02em;
}

/* 滚动条 */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d4d4d0; border-radius: 5px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #bcbcb7; background-clip: content-box; }

/* 骨架屏 */
.skel {
  background: linear-gradient(90deg, #efefec 25%, #f8f8f6 37%, #efefec 63%);
  background-size: 400% 100%;
  animation: skel 1.3s ease infinite;
  border-radius: 2px;
}
@keyframes skel { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ===== 规格选择（分类功能选项：辣度 / 加料 等） ===== */
.spec-body { padding-bottom: 4px; }
.spec-item { display: flex; gap: 12px; align-items: center; padding: 4px 0 14px; border-bottom: 1px solid var(--line); }
.spec-thumb { width: 56px; height: 56px; object-fit: cover; background: var(--surface-3); flex-shrink: 0; }
.spec-meta { min-width: 0; }
.spec-name { font-size: 14.5px; font-weight: 600; letter-spacing: .04em; font-family: var(--font-serif); }
.spec-price { font-size: 12px; color: var(--muted); margin-top: 5px; font-variant-numeric: tabular-nums; }
.spec-group { padding: 15px 0 4px; }
.spec-group + .spec-group { border-top: 1px solid var(--line); }
.spec-gh { display: flex; align-items: center; gap: 8px; margin-bottom: 11px; }
.spec-gn { font-size: 13px; font-weight: 600; letter-spacing: .08em; }
.spec-req { font-size: 10px; color: var(--seal); border: 1px solid currentColor; padding: 1px 5px; letter-spacing: .1em; }
.spec-multi { font-size: 10.5px; color: var(--muted); letter-spacing: .06em; }
.spec-vals { display: flex; flex-wrap: wrap; gap: 8px; }
.opt-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border: 1px solid var(--line); background: var(--surface);
  color: var(--ink); font-size: 12.5px; letter-spacing: .05em; cursor: pointer;
  font-family: inherit; border-radius: 2px;
}
.opt-chip:hover { border-color: var(--brass); }
.opt-chip.on { border-color: var(--brass-deep); background: var(--brass-soft); font-weight: 600; }
.opt-delta { font-size: 11px; color: var(--brass-deep); font-variant-numeric: tabular-nums; }

/* ==================== 代客下单 · 会员选择器 ==================== */
.mpick { position: relative; width: 240px; }
.mpick.has-member { width: auto; max-width: 100%; }
.mpick-pop {
  display: none; position: absolute; z-index: 40; top: calc(100% + 4px); left: 0;
  width: 320px; max-height: 300px; overflow: auto;
  background: var(--surface); border: 1px solid var(--ink); border-radius: 2px;
  box-shadow: 0 8px 24px rgba(17, 17, 17, .12);
}
.mpick-row {
  display: flex; align-items: center; gap: 9px; padding: 9px 12px; cursor: pointer;
  font-size: 13px; border-bottom: 1px solid var(--line);
}
.mpick-row:last-child { border-bottom: 0; }
.mpick-row:hover { background: var(--surface-2); }
.mpick-nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.mpick-ph { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.mpick-empty { padding: 11px 12px; font-size: 12.5px; color: var(--muted); }

/* 选中后的会员 chip：两行（昵称一行、手机号·等级·余额一行），避免在窄面板里被截断 */
.mchip {
  display: flex; flex-direction: column; gap: 1px;
  border: 1px solid var(--tea); background: var(--tea-soft); border-radius: 2px;
  padding: 5px 8px 6px 10px; font-size: 12.5px; max-width: 100%;
}
.mchip-top { display: flex; align-items: center; gap: 7px; }
.mchip-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--tea); flex: 0 0 auto; }
.mchip-nm { font-weight: 650; white-space: nowrap; }
.mchip-sub { color: var(--tea); font-size: 11px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.mchip-cp {
  font-size: 10.5px; letter-spacing: .06em; color: var(--seal);
  border: 1px solid currentColor; padding: 0 5px; border-radius: 2px; white-space: nowrap;
}
.mchip-x {
  border: 0; background: transparent; color: var(--tea); cursor: pointer;
  font-size: 15px; line-height: 1; padding: 0 2px; margin-left: auto; font-family: inherit;
}
.mchip-x:hover { color: var(--seal); }

/* 购物车栏的会员优惠预估 */
.cart-member {
  font-size: 12px; color: var(--tea); background: var(--tea-soft);
  border: 1px solid #bdd0c6; border-radius: 2px; padding: 4px 9px; white-space: nowrap;
}

/* 小票 / 标签文本预览（收银端打印、管理端模板编辑共用） */.receipt {
  background: var(--surface); border: 1px solid var(--line);
  padding: 15px;
  font-family: "Courier New", ui-monospace, monospace;
  font-size: 12.5px; line-height: 1.5;
  white-space: pre; overflow-x: auto;
  color: var(--ink);
}
.ci .spec-row { display: flex; align-items: center; gap: 8px; }
.ci .spec-txt { font-size: 11.5px; color: var(--brass-deep); letter-spacing: .04em; }
.ci .spec-edit {
  border: 1px solid var(--line); background: transparent; color: var(--muted);
  font-size: 10.5px; padding: 1px 7px; cursor: pointer; border-radius: 2px; font-family: inherit;
}
.ci .spec-edit:hover { color: var(--ink); border-color: var(--ink); }

/* 表格行「已关闭」态（分类 / 优惠券停用）：整体压暗，开关仍可操作 */
.table tbody tr.off > td { opacity: .45; }
.table tbody tr.off > td:last-child { opacity: 1; }

/* 菜品多选器（优惠券指定菜品） */
.pick-list {
  max-height: 210px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--surface);
  padding: 6px 4px;
}
.pick-cat {
  font-size: 11px;
  color: var(--brass-deep);
  letter-spacing: .1em;
  padding: 7px 9px 4px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 3px;
}
.pick-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  font-size: 13px;
  cursor: pointer;
  border-radius: 2px;
}
.pick-row:hover { background: var(--surface-2); }
.pick-row input[type=checkbox] { accent-color: var(--ink); }
.pick-row span { flex: 1; }
.pick-row em { font-style: normal; font-size: 12px; color: var(--muted); }

/* ---------- 二维码弹窗（券分享 / 桌台码，三端共用） ---------- */
.qr-box { text-align: center; }
.qr-canvas { display: flex; justify-content: center; align-items: center; min-height: 60px; }
.qr-img { width: 200px; height: 200px; display: block; image-rendering: pixelated; }
.qr-fail { font-size: 12px; color: var(--muted); padding: 18px 0; }
.qr-cap { font-size: 12.5px; color: var(--ink-2); margin-top: 11px; letter-spacing: .03em; }
.qr-link {
  margin-top: 9px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  font-size: 11px;
  color: var(--muted);
  word-break: break-all;
  line-height: 1.6;
  text-align: left;
}

/* ---------------- 提醒设置：设置行 + 开关 ----------------
   第 13 轮修：此前 .switch / .sound-row 系列**完全没有任何样式**，
   「响铃提醒 / 中文语音播报 / 异常单提醒」三个按钮渲染成看不出、点不到的空按钮。
   开关沿用编辑式茶室的方角语言（--radius 2px、无阴影），开=墨色底 + 黄铜滑块。
------------------------------------------------------------------------- */
.sound-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.sound-row:last-child { border-bottom: 0; }
.sound-row > div:first-child { min-width: 0; }
.sr-l { font-size: 14px; color: var(--ink); letter-spacing: .02em; }
.sr-d { font-size: 11.5px; color: var(--muted); margin-top: 3px; line-height: 1.5; }
.sound-row .spacer { flex: 1; }

.switch {
  position: relative;
  flex: none;
  width: 46px;
  height: 24px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  cursor: pointer;
  transition: background .16s, border-color .16s;
}
.switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  transition: transform .16s, background .16s, border-color .16s;
}
.switch:hover { border-color: var(--brass); }
.switch:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }
.switch.on { background: var(--ink); border-color: var(--ink); }
.switch.on::after {
  transform: translateX(22px);
  background: var(--brass);
  border-color: var(--brass);
}

/* ---------------- 小票图片（顾客端「保存小票」预览） ---------------- */
.rcpt-wrap { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.rcpt-img {
  width: 100%;
  max-width: 330px;
  display: block;
  border: 1px solid var(--line);
  background: #fff;
}
.rcpt-tip { font-size: 12px; color: var(--muted); text-align: center; line-height: 1.7; }

@media (max-width: 860px) {
  .side { position: fixed; left: 0; top: 0; z-index: 200; transform: translateX(-100%); transition: transform .22s; }
  .side.open { transform: none; box-shadow: var(--shadow-lg); }
  .content { padding: 14px; }
}
