/* 幸运珠 · 定制版 B 端 —— 样式表（无构建、无第三方依赖） */
:root {
  --brand: #3f5efb;
  --brand-2: #2f4bd0;
  --brand-soft: #eef1ff;
  --ok: #0f9d58;
  --ok-soft: #e6f6ee;
  --warn: #c77700;
  --warn-soft: #fff4e0;
  --danger: #d93025;
  --danger-soft: #fdeceb;
  --ink: #1f2430;
  --ink-2: #5b6474;
  --ink-3: #8b93a3;
  --line: #e6e9f0;
  --bg: #f5f6fa;
  --card: #fff;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(20, 27, 45, .06), 0 8px 24px rgba(20, 27, 45, .06);
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

/* 防止手机端"双击放大 / 点输入框放大"：
   touch-action: manipulation 关掉双击缩放（仍保留双指缩放）；
   iOS 在输入框字号 <16px 时聚焦会自动放大页面，所以手机上输入控件统一 16px。 */
html, body { touch-action: manipulation; -webkit-text-size-adjust: 100%; }
button, .btn, .nav button, a, select { touch-action: manipulation; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; }

/* ---------- 登录页 ---------- */
.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: radial-gradient(1200px 600px at 50% -10%, #dfe6ff 0%, var(--bg) 55%);
  padding: 24px;
}
.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--card);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 28px 24px 22px;
}
.login-brand { text-align: center; margin-bottom: 18px; }
.login-brand .logo {
  width: 52px; height: 52px; margin: 0 auto 10px;
  border-radius: 14px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brand), #7b8cff);
  color: #fff; font-size: 24px; font-weight: 700;
}
.login-brand h1 { font-size: 19px; }
.login-brand p { margin: 6px 0 0; color: var(--ink-3); font-size: 12.5px; }
.login-tip {
  margin-top: 14px; padding: 10px 12px; border-radius: 10px;
  background: var(--brand-soft); color: var(--brand-2); font-size: 12.5px; line-height: 1.5;
}
.captcha-row { display: flex; gap: 8px; align-items: center; }
.captcha-row img { height: 40px; border-radius: 8px; border: 1px solid var(--line); cursor: pointer; background: #fff; }

/* ---------- 布局 ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 208px; flex: 0 0 208px; background: #111a2e; color: #cdd5e6;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.sidebar .brand {
  padding: 18px 16px 16px; border-bottom: 1px solid rgba(255, 255, 255, .08);
  display: flex; align-items: center; gap: 10px;
}
.sidebar .brand .logo {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brand), #7b8cff); color: #fff; font-weight: 700; font-size: 15px;
}
.sidebar .brand strong { color: #fff; font-size: 14px; display: block; }
.sidebar .brand span { font-size: 11px; color: #7d8aa5; }
.nav { padding: 10px 8px; overflow-y: auto; flex: 1; }
.nav button {
  width: 100%; display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; margin: 2px 0; border: 0; border-radius: 9px;
  background: transparent; color: #cdd5e6; cursor: pointer; text-align: left; font-size: 13.5px;
}
.nav button:hover { background: rgba(255, 255, 255, .07); }
.nav button.active { background: var(--brand); color: #fff; font-weight: 600; }
.nav button .ico { width: 18px; text-align: center; opacity: .9; }
.sidebar .foot { padding: 12px; border-top: 1px solid rgba(255, 255, 255, .08); font-size: 12px; color: #7d8aa5; }
.sidebar .foot .who { color: #e6ebf5; margin-bottom: 6px; }
.sidebar .foot .who small { color: #7d8aa5; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  background: var(--card); border-bottom: 1px solid var(--line);
  padding: 14px 22px; display: flex; align-items: center; gap: 14px; position: sticky; top: 0; z-index: 20;
}
.topbar h2 { font-size: 16px; }
.topbar .sub { color: var(--ink-3); font-size: 12.5px; }
.topbar .spacer { flex: 1; }
/* 顶栏门店切换：必须写在媒体查询之前，否则会盖掉移动端的宽度规则 */
.store-picker { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.store-picker select {
  width: auto; min-width: 160px; padding: 7px 10px; border-radius: 9px;
  border: 1px solid var(--line); background: #fff; font-size: 13px;
}
.store-tag { font-size: 11.5px; color: var(--ink-3); white-space: nowrap; }
.content { padding: 20px 22px 60px; }

/* ---------- 卡片 / 栅格 ---------- */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); margin-bottom: 16px;
  /* 不要用 overflow:hidden：会把会员联想下拉、浮层裁掉 */
  overflow: visible;
}
.card > header {
  padding: 13px 16px; border-bottom: 1px solid var(--line);
  border-radius: var(--radius) var(--radius) 0 0;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.card > header h3 { font-size: 14.5px; }
.card > header .hint { color: var(--ink-3); font-size: 12px; }
.card > .body { padding: 16px; }
.card > .body.tight { padding: 10px 12px; }
.grid { display: grid; gap: 14px; }
.grid.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.c4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.split { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.split > * { min-width: 0; }

/* ---------- 统计卡 ---------- */
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.stat .label { color: var(--ink-3); font-size: 12.5px; }
.stat .value { font-size: 22px; font-weight: 700; margin-top: 4px; letter-spacing: -.3px; }
.stat .value small { font-size: 12px; font-weight: 500; color: var(--ink-3); margin-left: 4px; }
.stat.accent { background: linear-gradient(135deg, #f1f4ff, #fbfcff); border-color: #dde3ff; }

/* ---------- 表单 ---------- */
.field { margin-bottom: 12px; }
.field > label { display: block; font-size: 12.5px; color: var(--ink-2); margin-bottom: 5px; }
.field > label .req { color: var(--danger); margin-left: 2px; }
input[type=text], input[type=password], input[type=number], input[type=date], input[type=tel], select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px;
  background: #fff; outline: none; transition: border .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(63, 94, 251, .12); }
input:disabled, select:disabled { background: #f6f7fa; color: var(--ink-3); }
textarea { min-height: 68px; resize: vertical; }
.inline { display: flex; gap: 8px; align-items: center; }
.inline > * { min-width: 0; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 14px; border-radius: 9px; border: 1px solid var(--line);
  background: #fff; color: var(--ink); cursor: pointer; font-size: 13.5px;
  transition: background .15s, border .15s, transform .05s; white-space: nowrap;
}
.btn:hover { background: #f7f8fc; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-2); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.ghost { background: transparent; }
.btn.sm { padding: 5px 10px; font-size: 12.5px; border-radius: 8px; }
.btn.link { border: 0; background: transparent; color: var(--brand); padding: 4px 6px; }
.btn.link.danger { color: var(--danger); }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 9px 10px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--ink-3); font-weight: 500; font-size: 12.5px; background: #fafbfe; white-space: nowrap; }
tbody tr:hover { background: #fafbff; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.mono { font-family: var(--mono); font-size: 12.5px; }
.empty { padding: 26px; text-align: center; color: var(--ink-3); font-size: 13px; }

/* ---------- 徽标 ---------- */
.badge {
  display: inline-block; padding: 1px 8px; border-radius: 999px;
  font-size: 12px; background: #eef1f7; color: var(--ink-2); white-space: nowrap;
}
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.brand { background: var(--brand-soft); color: var(--brand-2); }
.badge.mono { font-family: var(--mono); }

/* ---------- 会员搜索 ---------- */
.search-box { position: relative; }
.search-box input { padding-left: 34px; height: 42px; font-size: 15px; }
.search-box .mag { position: absolute; left: 12px; top: 11px; color: var(--ink-3); }
.suggest {
  position: absolute; z-index: 30; left: 0; right: 0; top: 46px;
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 12px 32px rgba(20, 27, 45, .14); max-height: 340px; overflow: auto;
}
.suggest .item { padding: 9px 12px; cursor: pointer; border-bottom: 1px solid #f2f4f9; display: flex; gap: 10px; align-items: center; }
.suggest .item:last-child { border-bottom: 0; }
.suggest .item:hover, .suggest .item.sel { background: var(--brand-soft); }
.suggest .item .who { flex: 1; min-width: 0; }
.suggest .item .who b { font-weight: 600; }
.suggest .item .who small { display: block; color: var(--ink-3); font-size: 12px; }
.suggest .item .tag { font-size: 11px; color: var(--brand-2); background: var(--brand-soft); padding: 1px 6px; border-radius: 6px; }

/* ---------- 会员面板 ---------- */
.member-head { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.member-head .avatar {
  width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand-2); font-weight: 700; font-size: 16px;
}
.member-head .who b { font-size: 16px; }
.member-head .who div { color: var(--ink-3); font-size: 12.5px; }
.balances { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin-top: 14px; }
.bal { background: #fafbfe; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.bal .k { font-size: 12px; color: var(--ink-3); }
.bal .v { font-size: 20px; font-weight: 700; letter-spacing: -.3px; }
.bal .v small { font-size: 11.5px; color: var(--ink-3); font-weight: 500; margin-left: 3px; }
.bal.coin .v { color: #b25c00; }
.bal.integral .v { color: var(--brand-2); }

/* ---------- tab ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); padding: 0 16px; flex-wrap: wrap; }
.tabs button {
  border: 0; background: transparent; padding: 11px 12px; cursor: pointer;
  color: var(--ink-2); font-size: 13.5px; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tabs button.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }
.tab-body { padding: 16px; }

/* ---------- 模态 ---------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(17, 26, 46, .45);
  display: grid; place-items: center; z-index: 100; padding: 16px;
  animation: fade .12s ease-out;
}
.modal {
  background: #fff; border-radius: 14px; width: 100%; max-width: 520px;
  max-height: 88vh; display: flex; flex-direction: column; box-shadow: 0 24px 60px rgba(10, 16, 30, .3);
}
.modal.wide { max-width: 780px; }
.modal > header { padding: 15px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; }
.modal > header h3 { font-size: 15px; flex: 1; }
.modal > .body { padding: 16px 18px; overflow: auto; }
.modal > footer { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* ---------- 提示 ---------- */
.toasts { position: fixed; top: 16px; right: 16px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: #111a2e; color: #fff; padding: 10px 14px; border-radius: 10px;
  box-shadow: var(--shadow); font-size: 13px; max-width: 380px; animation: slide .15s ease-out;
}
.toast.ok { background: #0f7a47; }
.toast.err { background: #b3261e; }
.toast.warn { background: #8a5b00; }
@keyframes slide { from { transform: translateX(12px); opacity: 0; } to { transform: none; opacity: 1; } }

.alert { padding: 10px 12px; border-radius: 10px; font-size: 13px; margin-bottom: 12px; }
.alert.info { background: var(--brand-soft); color: var(--brand-2); }
.alert.warn { background: var(--warn-soft); color: var(--warn); }
.alert.danger { background: var(--danger-soft); color: var(--danger); }
.alert.ok { background: var(--ok-soft); color: var(--ok); }

.muted { color: var(--ink-3); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.mt { margin-top: 12px; }
.mb0 { margin-bottom: 0; }
.hr { height: 1px; background: var(--line); margin: 14px 0; }
.flex1 { flex: 1; }
.pill-ops { display: flex; gap: 6px; flex-wrap: wrap; }
.pill-ops button {
  border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 12px;
  cursor: pointer; font-size: 13px;
}
.pill-ops button.on { background: var(--brand); color: #fff; border-color: var(--brand); }
.amount { font-variant-numeric: tabular-nums; }
.cart-line { display: flex; align-items: center; gap: 8px; }
.qty-btn { width: 26px; height: 26px; border-radius: 7px; border: 1px solid var(--line); background: #fff; cursor: pointer; }

/* ---------- 搜索框内嵌扫码按钮 ---------- */
.scan-inline {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  padding: 5px 9px; line-height: 1; z-index: 2;
}
.search-box input { padding-right: 48px; }

/* 手机上隐藏的次要列 */
@media (max-width: 720px) { .hide-sm { display: none !important; } }

/* ---------- 移动端 ---------- */
@media (max-width: 900px) {
  .grid.c3, .grid.c4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* minmax(0,1fr)：单列时列最小值取 0，避免表格/长文本把整页撑宽（grid 塌陷） */
  .split { grid-template-columns: minmax(0, 1fr); }
  .balances { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  /* iOS 聚焦放大阈值 */
  input, select, textarea { font-size: 16px !important; }
  .app { flex-direction: column; }
  .sidebar { position: sticky; top: 0; z-index: 40; height: auto; width: 100%; flex: none; }
  .sidebar .brand { padding: 10px 12px; }
  .sidebar .brand .logo { width: 30px; height: 30px; font-size: 13px; }
  .sidebar .brand strong { font-size: 13px; }
  .sidebar .brand span { font-size: 10.5px; }
  /* 导航网格：列数由 JS 按可见入口数给（--nav-cols），避免最后一行右侧空出格子 */
  .nav { display: grid; grid-template-columns: repeat(var(--nav-cols, 4), minmax(0, 1fr)); gap: 5px; padding: 7px; overflow: visible; }
  .nav button { width: auto; justify-content: center; padding: 8px 3px; font-size: 12px; border-radius: 8px; }
  .nav button .ico { display: none; }
  .sidebar .foot { display: none; }

  /* 兜底 1：手机上禁止横向滚动。用 clip（不产生滚动容器，不会破坏 position:sticky） */
  html { overflow-x: clip; }
  body { max-width: 100vw; overflow-x: clip; }

  /* 兜底 2：个别内置浏览器（微信/UC/夸克等 WebView）会把 flex 容器算窄，右侧空出一条。
     100vw 直接按视口算宽度，不受父容器影响，能强制铺满。 */
  .app { width: 100vw; }
  .sidebar { width: 100vw; min-width: 100%; }
  .main { width: 100%; }
  .topbar { width: 100%; }

  .content { padding: 10px 10px 48px; }
  .card { margin-bottom: 10px; border-radius: 10px; }
  .card > header { padding: 9px 11px; gap: 6px; }
  .card > header h3 { font-size: 13.5px; }
  .card > header .hint { font-size: 11px; }
  .card > .body { padding: 11px; }
  .card > .body.tight { padding: 6px; }
  .tab-body { padding: 11px; }

  /* 顶栏：标题 + 门店选择器同一行，右侧不再空出一块 */
  .topbar { padding: 9px 11px; gap: 8px; flex-wrap: nowrap; align-items: center; }
  .topbar > div:first-child { min-width: 0; flex: 1 1 auto; }
  .topbar h2 { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .topbar .sub { display: none; }
  .topbar .spacer { display: none; }
  #topActions { flex: 0 1 auto; min-width: 0; max-width: 66vw; justify-content: flex-end; margin-left: auto; }
  #topActions .store-picker { min-width: 0; max-width: 100%; }
  #topActions .store-picker select { width: 100%; min-width: 0; max-width: 100%; }
  #topActions > b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  .grid.c2, .grid.c3, .grid.c4 { grid-template-columns: minmax(0, 1fr); }
  .row2 { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .stat { padding: 11px 12px; }
  .stat .value { font-size: 19px; }
  .balances { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .bal { padding: 9px 10px; }
  .bal .v { font-size: 17px; }

  /* 表格：字号与内边距收紧，横向滚动更顺 */
  .table-wrap { -webkit-overflow-scrolling: touch; margin: 0 -2px; }
  table { font-size: 12px; }
  th, td { padding: 7px 7px; }
  .thumb { width: 34px; height: 34px; }
  .thumb-empty { width: 34px; height: 34px; font-size: 10px; }

  /* 触控目标：按钮至少 38px 高 */
  .btn { min-height: 38px; padding: 8px 12px; }
  .btn.sm { min-height: 32px; padding: 6px 10px; }
  .btn-row { gap: 6px; }
  .tabs { padding: 0 8px; gap: 0; overflow-x: auto; }
  .tabs button { padding: 10px 9px; font-size: 13px; white-space: nowrap; }

  .search-box input { height: 42px; font-size: 15px; }
  .suggest { top: 46px; max-height: 52vh; }
  .member-head { gap: 8px; }
  .member-head .avatar { width: 40px; height: 40px; }
  .member-head .who b { font-size: 15px; }

  /* 弹窗：从底部弹出、占满宽度，手指更好点 */
  .modal-mask { padding: 0; align-items: flex-end; }
  .modal, .modal.wide {
    max-width: none; width: 100%; max-height: 92vh;
    border-radius: 14px 14px 0 0;
  }
  .modal > header { padding: 12px 14px; }
  .modal > .body { padding: 13px 14px; }
  .modal > footer { padding: 10px 14px; position: sticky; bottom: 0; background: #fff; }
  .toasts { top: 8px; right: 8px; left: 8px; }
  .toast { max-width: none; }
}

/* ---------- 扫码兑换：条码输入 + 扫码/加入 ---------- */
/* 电脑端：输入框占满剩余宽度，两个按钮在右边，和改造前完全一致 */
.scan-row input { flex: 1; }
.scan-actions { display: flex; gap: 8px; }
@media (max-width: 720px) {
  /* 手机端：输入框变短，【扫码】【加入】回到输入框右边，按钮收小省地方 */
  .ex-scan .scan-row { flex-direction: row; align-items: center; gap: 6px; }
  .ex-scan .scan-row input {
    flex: 1 1 auto; width: auto; min-width: 0;
    height: 36px; font-size: 14px;
  }
  .ex-scan .scan-actions { flex: none; gap: 6px; }
  .ex-scan .scan-actions .btn {
    flex: none; min-height: 34px; padding: 6px 10px; font-size: 13px; white-space: nowrap;
  }
  /* 会员输入框同样压矮，两个输入框高度一致 */
  .ex-scan .search-box input { height: 36px; font-size: 14px; }
  .ex-scan .scan-inline { padding: 3px 7px; }
  /* 卡片里的横排（合计 + 暂存/清空/结账）在手机上允许换行，避免把页面撑出横向滚动 */
  .ex-scan .inline { flex-wrap: wrap; }
  .ex-scan .inline > .flex1 { flex: 1 1 100%; }
  .ex-scan .inline > .btn { flex: 1 1 auto; }
  /* 任何卡片内的表格/图片都不许把页面撑宽 */
  .card { max-width: 100%; }
  .table-wrap { max-width: 100%; }
}

/* ---------- 营收报表：支付方式清单 ---------- */
.pay-table { width: 100%; border-collapse: collapse; }
.pay-table td { padding: 6px 2px; border-bottom: 1px dashed var(--line); font-size: 13px; }
.pay-table td:first-child { color: var(--ink-2); }
.pay-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.pay-table tr:last-child td { border-bottom: 0; }

/* ---------- 设备小票（售珠机/兑币机推单） ---------- */
.receipt {
  width: 100%; max-width: 300px; margin: 0 auto; background: #fff; color: #111;
  font: 12px/1.55 ui-monospace, Menlo, Consolas, "PingFang SC", monospace; padding: 4px 2px;
}
.receipt .rc-store { text-align: center; font-weight: 700; font-size: 14px; letter-spacing: .5px; }
.receipt .rc-title { text-align: center; font-size: 11px; color: #666; margin-bottom: 4px; }
.receipt .rc-sep { border-top: 1px dashed #bbb; margin: 6px 0; }
.receipt .rc-row { display: flex; justify-content: space-between; gap: 10px; }
.receipt .rc-row span:first-child { color: #444; flex: none; }
.receipt .rc-row span:last-child { text-align: right; word-break: break-all; }
.receipt .rc-item span:first-child { flex: 1; }
.receipt .rc-total { font-size: 15px; font-weight: 700; padding: 2px 0; }
.receipt .rc-foot { text-align: center; color: #333; margin-top: 4px; }
.receipt .rc-reprint { text-align: center; color: #b3261e; font-size: 11px; margin-top: 2px; }
.receipt .rc-stage { text-align: center; color: #888; font-size: 10px; margin-top: 2px; }
.receipt .rc-note { text-align: center; color: #b3261e; font-size: 10.5px; margin-top: 4px; }
.receipt .rc-raw { background: #f6f7fa; border: 1px dashed #ccc; border-radius: 6px; padding: 6px;
  font-size: 10px; line-height: 1.4; white-space: pre-wrap; word-break: break-all; margin-top: 6px; max-height: 260px; overflow: auto; }
.receipt-modal .body { background: var(--bg); }

/* 打印：只输出小票（在 #modalRoot 里），其它界面元素全部隐藏 */
@media print {
  body.printing { background: #fff; }
  body.printing .app, body.printing .toasts { display: none !important; }
  body.printing .modal-mask {
    position: static !important; background: #fff !important;
    padding: 0 !important; display: block !important; animation: none !important;
  }
  body.printing .modal {
    box-shadow: none !important; border: 0 !important; border-radius: 0 !important;
    max-width: none !important; width: auto !important; max-height: none !important;
    animation: none !important;
  }
  body.printing .modal > header,
  body.printing .modal > footer { display: none !important; }
  body.printing .modal > .body { padding: 0 !important; overflow: visible !important; }
  body.printing .receipt { max-width: none; width: 100%; font-size: 12px; }
  @page { margin: 4mm; }
}

/* ---------- 扫码弹窗（取景框别占满屏幕） ---------- */
.cam-box { position: relative; background: #000; border-radius: 10px; overflow: hidden; }
.cam-box video { width: 100%; max-height: 46vh; object-fit: cover; display: block; }
.cam-modal .body { padding-bottom: 8px; }
@media (max-width: 720px) {
  /* 手机上把取景框压到 38vh：弹窗整体只占半屏多点，店里能看到下面的按钮 */
  .cam-box video { max-height: 38vh; }
  .cam-modal .body { padding: 10px 11px; }
  .cam-modal .cam-help { font-size: 11px; line-height: 1.45; }
  .cam-modal .cam-diag { display: none; }   /* 诊断行是给开发看的，手机上省地方 */
}

/* ---------- 商品缩略图 ---------- */
.thumb {
  width: 44px; height: 44px; border-radius: 8px; object-fit: cover;
  border: 1px solid var(--line); background: #f6f7fa; display: block;
}
.thumb-empty {
  width: 44px; height: 44px; border-radius: 8px; border: 1px dashed var(--line);
  display: grid; place-items: center; color: var(--ink-3); font-size: 11px; background: #fafbfe;
}
.img-pick {
  display: flex; gap: 10px; align-items: center;
}
.img-preview {
  width: 76px; height: 76px; border-radius: 10px; object-fit: cover;
  border: 1px solid var(--line); background: #f6f7fa;
}

/* ---------- 业绩图：手机保存 / 分享 ---------- */
/* iOS Safari 只对 blob:/http(s) 图片提供「存储到照片」，data: 地址长按没有这个选项，
   所以弹窗里的图用 blob 地址（见 app.js dataUrlToBlob），并显式放开长按菜单。 */
.revimg-modal img.revimg-pic {
  display: block; width: 100%; border-radius: 10px; border: 1px solid var(--line);
  -webkit-touch-callout: default; -webkit-user-select: auto; user-select: auto;
  touch-action: pinch-zoom;   /* 保留双指放大 */
  cursor: zoom-in;
}
/* 点图片后的全屏预览：图铺满屏幕，长按保存成功率最高 */
.revimg-viewer {
  position: fixed; inset: 0; z-index: 9999; background: #0b0b0c;
  display: flex; align-items: center; justify-content: center; padding: 10px;
  animation: fade .12s ease-out;
}
.revimg-viewer img {
  max-width: 100%; max-height: 100%; width: auto; height: auto;
  -webkit-touch-callout: default; touch-action: pinch-zoom;
}
.revimg-viewer .hint {
  position: absolute; top: 14px; left: 0; right: 0; text-align: center;
  color: #fff; font-size: 13px; opacity: .8; pointer-events: none;
}
