* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #f4f6f3; color: #21312a; font-size: 15px; }
h1, h3, h4 { margin: 0 0 10px; }
button { cursor: pointer; font-family: inherit; }

/* 登录 */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.login-card { background: #fff; padding: 36px 32px; border-radius: 14px; width: 340px;
  max-width: calc(100vw - 24px);
  box-shadow: 0 8px 32px rgba(30,60,40,.12); text-align: center; }
.login-logo { font-size: 44px; }
.login-card h1 { font-size: 24px; margin-top: 6px; }
.login-sub { color: #7a8a80; margin: 0 0 20px; }
.login-card label { display: block; text-align: left; margin: 12px 0; font-size: 14px; color: #44554b; }
.login-card input { width: 100%; padding: 10px; margin-top: 5px; border: 1px solid #cfd8d2;
  border-radius: 8px; font-size: 15px; }
.error { color: #c0392b; min-height: 20px; font-size: 14px; }

/* 字号调节控件（登录卡片内 + 顶栏各一份，逻辑在 app.js） */
.fs-switch { display: inline-flex; align-items: stretch; flex: none;
  border: 1px solid #cfd8d2; border-radius: 8px; overflow: hidden; background: #fff;
  vertical-align: middle; }
.login-card .fs-switch { margin-top: 18px; }
.fs-switch .fs-label { display: flex; align-items: center; padding: 0 4px 0 10px;
  font-size: 13px; color: #66766c; white-space: nowrap; }
.fs-switch button { border: none; background: transparent; padding: 5px 10px;
  font-size: 13px; color: #44554b; white-space: nowrap; }
.fs-switch button.active { background: #1e6b4f; color: #fff; font-weight: 700; }
.fs-switch.on-dark { border-color: rgba(255,255,255,.5); background: transparent; }
.fs-switch.on-dark .fs-label { color: rgba(255,255,255,.85); }
.fs-switch.on-dark button { color: #fff; }
.fs-switch.on-dark button.active { background: #fff; color: #1e6b4f; }

/* 顶栏与导航 */
.topbar { background: #1e6b4f; color: #fff; padding: 10px 16px; display: flex;
  justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; }
.brand { font-size: 19px; font-weight: 700; }
.brand-sub { font-size: 13px; font-weight: 400; opacity: .85; }
.top-right { display: flex; align-items: center; gap: 8px; font-size: 14px;
  flex-wrap: wrap; }
#whoami { white-space: nowrap; }
.tabs { display: flex; gap: 4px; padding: 8px 12px 0; flex-wrap: wrap; }
.tabs button { border: 1px solid #cfd8d2; background: #e8ede9; border-bottom: none;
  padding: 9px 16px; border-radius: 10px 10px 0 0; font-size: 15px; }
.tabs button.active { background: #fff; font-weight: 700; color: #1e6b4f; }
main { padding: 0 12px 30px; }
.page { background: #fff; border: 1px solid #cfd8d2; border-radius: 0 12px 12px 12px;
  padding: 16px; }

/* 组件 */
.btn { border: 1px solid #b9c6be; background: #fff; padding: 7px 14px; border-radius: 8px;
  font-size: 14px; white-space: nowrap; }
.btn.primary { background: #1e6b4f; color: #fff; border-color: #1e6b4f; }
.btn.danger { background: #c0392b; color: #fff; border-color: #c0392b; }
.btn.ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.5); }
.btn.big { width: 100%; padding: 12px; font-size: 16px; margin-top: 10px; }
.btn.small { padding: 3px 9px; font-size: 13px; }
a.btn { display: inline-block; text-decoration: none; color: #21312a; }
a.btn.primary { color: #fff; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px; margin-bottom: 16px; }
.card { background: #f2f7f4; border: 1px solid #dde6e0; border-radius: 10px; padding: 14px; }
.card .num { font-size: 22px; font-weight: 700; color: #1e6b4f; }
.card .lbl { color: #66766c; font-size: 13px; margin-top: 2px; }
.card .num.debt, .debt { color: #c0392b; }
.panel { margin-bottom: 18px; }
.panel.narrow { max-width: 520px; }
.panel-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.panel-head h3 { margin: 0; margin-right: auto; }
.grid2 { display: grid; grid-template-columns: 1fr 1.2fr; gap: 18px; }
@media (max-width: 860px) { .grid2 { grid-template-columns: 1fr; } }
.fld { display: block; margin: 10px 0; font-size: 14px; color: #44554b; }
.fld input, .fld select { display: block; width: 100%; margin-top: 4px; padding: 9px;
  border: 1px solid #cfd8d2; border-radius: 8px; font-size: 15px; background: #fff; }
.fld.inline { display: inline-block; margin: 4px 10px 4px 0; }
.fld.inline input, .fld.inline select { display: inline-block; width: auto; margin-left: 6px; }
.search { padding: 8px 10px; border: 1px solid #cfd8d2; border-radius: 8px; min-width: 180px; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { border-bottom: 1px solid #e3eae5; padding: 8px 8px; text-align: left;
  white-space: nowrap; }
th { color: #66766c; font-weight: 600; background: #f7faf8; }
tr.clickable:hover { background: #f2f7f4; cursor: pointer; }
.tag { display: inline-block; padding: 1px 8px; border-radius: 20px; font-size: 12px;
  background: #e8ede9; color: #44554b; }
.tag.admin { background: #fdeeda; color: #9a6a14; }
.tag.voided { background: #fbe3df; color: #c0392b; }
.tag.off { background: #eee; color: #999; }
.pick-list { max-height: 480px; overflow-y: auto; }
.pick-item { display: flex; justify-content: space-between; align-items: center;
  padding: 8px 6px; border-bottom: 1px solid #eef2ef; }
.pick-item .pname { font-weight: 600; }
.pick-item .pmeta { color: #66766c; font-size: 13px; }
.bill-summary { border-top: 1px dashed #cfd8d2; margin-top: 12px; padding-top: 10px;
  display: flex; flex-direction: column; gap: 4px; }
.bill-summary .fld.inline input { width: 120px; }
.cart-qty, .cart-price { width: 76px; padding: 5px; border: 1px solid #cfd8d2; border-radius: 6px; }
.msg { margin-top: 8px; font-size: 14px; color: #1e6b4f; min-height: 18px; }
.msg.err { color: #c0392b; }
.debt-line { font-size: 16px; margin: 6px 0; }
.stmt-total { margin-top: 10px; font-size: 16px; }
.hint { color: #8a978e; font-size: 13px; }

/* 弹窗与提示 */
.modal-mask { position: fixed; inset: 0; background: rgba(20,35,28,.45);
  display: flex; align-items: center; justify-content: center; z-index: 90; padding: 14px; }
.modal { background: #fff; border-radius: 12px; padding: 20px; width: 440px; max-width: 100%;
  max-height: 88vh; overflow-y: auto; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%);
  background: #21312a; color: #fff; padding: 10px 20px; border-radius: 24px;
  font-size: 14px; z-index: 99; box-shadow: 0 6px 20px rgba(0,0,0,.25); }
/* 开单已选反馈：底部合计栏 + 已选按钮状态（v7） */
.cart-bar { position: fixed; left: 10px; right: 10px; bottom: 10px; z-index: 60;
  background: #14532d; color: #fff; border-radius: 12px; padding: 10px 14px;
  display: flex; justify-content: space-between; align-items: center;
  box-shadow: 0 4px 18px rgba(0,0,0,.28); font-weight: 600; }
.cart-bar .btn { flex: none; margin-left: 10px; }
.pick-item .btn.in-cart { background: #0f766e; border-color: #0f766e; color: #fff; }
.cart-bar-btns { display: flex; flex: none; }
.cart-bar-btns .btn { margin-left: 8px; }

/* 开单选品（v8）：页签 + 3 列网格卡片 */
#prodSearch { width: 100%; }
.pick-tabs { display: flex; gap: 8px; margin: 10px 0; }
.pick-tab { border: 1px solid #cfd8d2; background: #fff; padding: 7px 18px;
  border-radius: 20px; font-size: 14px; }
.pick-tab.active { background: #1e6b4f; color: #fff; border-color: #1e6b4f;
  font-weight: 700; }
.prod-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
  max-height: 540px; overflow-y: auto; padding: 4px 2px; }
.prod-card { position: relative; display: flex; flex-direction: column; gap: 2px;
  align-items: flex-start; text-align: left; background: #f7faf8;
  border: 1.5px solid #dde6e0; border-radius: 10px; padding: 10px;
  font-size: 14px; min-height: 78px; color: inherit; }
.prod-card:active { background: #e9f3ed; }
.prod-card.selected { border-color: #1e6b4f; background: #edf7f1; }
.card-check { position: absolute; top: -7px; right: -5px; background: #1e6b4f;
  color: #fff; width: 20px; height: 20px; border-radius: 50%; font-size: 13px;
  display: flex; align-items: center; justify-content: center; }
.card-name { font-weight: 700; font-size: 15px; }
.card-code { color: #8a978e; font-size: 12px; }
.card-stock { color: #66766c; font-size: 12.5px; }
.card-in { color: #1e6b4f; font-weight: 700; font-size: 12.5px; }

/* 结算区已选小结（只读，编辑走选品面板/清单面板） */
.cart-summary { margin: 4px 0 2px; }
.cs-row { display: flex; justify-content: space-between; gap: 10px;
  padding: 5px 0; border-bottom: 1px dashed #e3eae5; font-size: 14px; }
.cs-row span:first-child { font-weight: 600; }
.cart-summary .btn { margin-top: 8px; }

/* 底部面板（v8）：选品数量/单价 + 已选清单。
   与 .modal-mask 同为 position:fixed 贴边布局，根元素 zoom 三档下均以视口为
   锚点（v6 已实测弹窗类 fixed 层在 1/1.15/1.3 档不错位）；面板 max-height
   用 vh 并允许内部滚动，特大档下也不会顶出屏幕。 */
.sheet-mask { position: fixed; inset: 0; background: rgba(20,35,28,.45);
  z-index: 70; display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: #fff; width: 100%; max-width: 560px; max-height: 92vh;
  overflow-y: auto; border-radius: 16px 16px 0 0;
  padding: 16px 16px calc(14px + env(safe-area-inset-bottom)); }
.sheet-head { display: flex; justify-content: space-between;
  align-items: flex-start; margin-bottom: 10px; }
.sheet-title { font-size: 18px; font-weight: 700; }
.sheet-sub { color: #66766c; font-size: 13px; margin-top: 2px; }
.sheet-close { border: none; background: #eef2ef; width: 34px; height: 34px;
  border-radius: 50%; font-size: 16px; flex: none; }
.sheet-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sheet-field { border: 1.5px solid #cfd8d2; border-radius: 10px; padding: 8px 10px; }
.sheet-field.active { border-color: #1e6b4f; background: #f2f8f4; }
.sf-label { display: block; font-size: 12.5px; color: #66766c; }
.sf-input { width: 100%; border: none; background: transparent; font-size: 22px;
  font-weight: 700; padding: 2px 0 0; outline: none; color: #21312a; }
.sheet-subtotal { text-align: right; font-size: 15px; margin: 10px 2px; }
.sheet-subtotal b { color: #1e6b4f; font-size: 18px; }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.keypad button { border: 1px solid #dde6e0; background: #f7faf8;
  border-radius: 10px; min-height: 50px; font-size: 20px; font-weight: 600;
  color: inherit; }
.keypad button:active { background: #e0ede5; }
.keypad .kp-wide { grid-column: 1 / -1; min-height: 40px; font-size: 15px;
  color: #c0392b; }
.sheet-actions { display: flex; gap: 10px; margin-top: 12px; }
.sheet-actions .btn { flex: 1; padding: 12px; font-size: 16px; }
.sheet-actions .btn.danger { flex: 0 1 auto; }
.cart-list { max-height: 50vh; overflow-y: auto; }
.cl-row { display: flex; align-items: center; gap: 10px; padding: 9px 2px;
  border-bottom: 1px solid #eef2ef; font-size: 14px; cursor: pointer;
  flex-wrap: wrap; }
.cl-name { font-weight: 600; margin-right: auto; }
.cl-detail { color: #66766c; white-space: nowrap; }
.cl-amt { white-space: nowrap; }

/* ============ v8 结算段 + 芝麻地式视觉对齐（仅开单页与开单相关底部层） ============
   观感参照芝麻地柜台端录屏：浅灰蓝页底 #edf0f5、纯白圆角卡片、主操作正红
   #e64340（确定/开单/收银/选中描边/页签下划线）、购物车角标橙色、文字深灰。
   只对齐布局/配色/位置/手感，名称与素材仍是统利鲜果行自己的；其他页面不动。 */
#page-billing { background: #edf0f5; border-color: transparent; }
#page-billing .panel { background: #fff; border-radius: 14px; padding: 14px;
  box-shadow: 0 1px 6px rgba(31,45,61,.06); }
#page-billing .grid2 { gap: 14px; }
#page-billing h3 { color: #222; }
/* 搜索框：浅灰圆角胶囊 */
#page-billing .search, .cust-search { background: #f0f2f5; border: none;
  border-radius: 999px; padding: 10px 16px; font-size: 14.5px; }
.cust-search { width: 100%; margin-bottom: 6px; }
/* 页签：选中红字 + 红下划线 */
#page-billing .pick-tabs { gap: 20px; border-bottom: 1px solid #eceff3;
  margin: 12px 0 10px; }
#page-billing .pick-tab { border: none; background: transparent; border-radius: 0;
  padding: 8px 2px; font-size: 15px; color: #555; }
#page-billing .pick-tab.active { background: transparent; border: none;
  color: #e64340; font-weight: 700; box-shadow: inset 0 -2.5px 0 #e64340; }
/* 商品卡片：白底圆角，选中红描边 + 红 ✓ 角标 */
#page-billing .prod-grid { max-height: none; }
.prod-card { background: #fff; border: 1.5px solid #e8ecf1; border-radius: 12px; }
.prod-card:active { background: #fafbfc; }
.prod-card.selected { border-color: #e64340; background: #fff7f6; }
.card-check { background: #e64340; }
.card-stock { color: #9aa3af; }
.card-in { color: #e64340; }
/* 主操作红统一到 #e64340（danger 类仅开单相关按钮在用） */
.btn.danger { background: #e64340; border-color: #e64340; }
.btn:disabled { opacity: .45; cursor: default; }
/* 底部栏：白底贴边，左顾客、中已选（橙角标）、右红色开单大按钮 */
/* 底栏两行：第一行顾客（左）+ 已选/合计（右），第二行清单/挂单 + 红色开单
   大按钮（占满剩余宽度）；元素比芝麻地多两个（清单/挂单），单行在窄屏与
   特大字号下必挤，两行是保底排版，位置与手感仍与原版一致（贴底白栏）。 */
.cart-bar { left: 0; right: 0; bottom: 0; background: #fff; color: #21312a;
  border-radius: 16px 16px 0 0; padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  box-shadow: 0 -2px 14px rgba(31,45,61,.14); gap: 8px; flex-wrap: wrap; }
.bar-cust { flex: 0 1 auto; min-width: 0; max-width: 48vw; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; background: transparent;
  border: none; font-size: 15px; font-weight: 600; color: #21312a;
  padding: 6px 2px; text-align: left; }
#cartBarText { flex: 0 1 auto; margin-left: auto; text-align: right; color: #555;
  font-weight: 500; font-size: 13.5px; white-space: nowrap; }
.cart-badge { display: inline-block; min-width: 19px; height: 19px; line-height: 19px;
  padding: 0 5px; border-radius: 999px; background: #ff7a1a; color: #fff;
  font-size: 12px; font-weight: 700; text-align: center; vertical-align: 1px; }
.cart-bar .btn { margin-left: 0; }
.cart-bar-btns { display: flex; width: 100%; gap: 8px; }
.cart-bar-btns .btn { margin-left: 0; }
#cartBarGo { flex: 1; padding: 10px 16px; font-size: 15px; font-weight: 700;
  border-radius: 10px; }
/* 底部层统一：白层圆角顶、主按钮正红、选中字段红描边 */
.sheet { border-radius: 18px 18px 0 0; }
.sheet .btn.primary { background: #e64340; border-color: #e64340; }
.sheet-field.active { border-color: #e64340; background: #fff7f6; }
.sheet-subtotal b { color: #e64340; }
.keypad button { border: none; background: #f4f6f8; }
.keypad button:active { background: #eceff3; }
/* 客户选择层 */
.cust-list { max-height: 46vh; overflow-y: auto; }
.cust-row { display: flex; justify-content: space-between; align-items: center;
  gap: 10px; width: 100%; padding: 12px 4px; background: none; border: none;
  border-bottom: 1px solid #eef1f4; font-size: 15px; text-align: left;
  cursor: pointer; color: inherit; }
.cust-main { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.cust-name { font-weight: 600; }
.cust-phone { color: #9aa3af; font-size: 12.5px; }
.cust-side { display: flex; align-items: center; gap: 8px; font-size: 13.5px;
  flex: none; }
.cust-row.selected .cust-name { color: #e64340; }
.cust-check { color: #e64340; font-weight: 700; font-size: 17px; }
.cust-add-toggle { width: 100%; margin-top: 10px; border: 1.5px dashed #d5dbe2;
  color: #e64340; background: #fff7f6; padding: 10px; font-size: 15px; }
.link-btn { background: none; border: none; color: #e64340; font-size: 13.5px;
  padding: 2px 4px; }
/* 结算层：字段行左标签右数值、账户 chips、红色整宽收银 */
.co-rows { margin-top: 2px; }
.co-row { display: flex; justify-content: space-between; align-items: center;
  gap: 10px; padding: 9px 2px; border-bottom: 1px solid #f0f2f5; font-size: 15px; }
button.co-row { width: 100%; background: none; border: none;
  border-bottom: 1px solid #f0f2f5; font: inherit; color: inherit;
  text-align: left; cursor: pointer; }
.co-label { color: #444; flex: none; }
.co-val { font-size: 16px; text-align: right; }
.co-disc { color: #e64340; margin-left: 10px; font-size: 14px; font-weight: 400; }
.co-methods { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 0 6px; }
.chip { position: relative; border: 1.5px solid transparent; background: #f2f3f5;
  color: #333; border-radius: 9px; padding: 9px 16px; font-size: 14.5px; }
.chip.active { background: #fff; border-color: #e64340; color: #e64340;
  font-weight: 700; }
.chip.active::after { content: "✓"; position: absolute; top: -7px; right: -5px;
  background: #e64340; color: #fff; width: 17px; height: 17px; border-radius: 50%;
  font-size: 11px; display: flex; align-items: center; justify-content: center; }
.co-paid { margin: 10px 0 4px; }
.co-paid.disabled { opacity: .45; }
.co-submit { margin-top: 14px; font-size: 17px; letter-spacing: 6px; }
/* 通料金额键盘小层：盖在结算层之上（70 之上、确认弹窗 90 之下） */
.kb-mask { z-index: 80; }
.kb-value { font-size: 30px; font-weight: 700; text-align: center;
  padding: 6px 0 12px; color: #21312a; }
/* 成功层 */
.success-sheet { text-align: center; }
.success-check { width: 64px; height: 64px; border-radius: 50%;
  background: #22b573; color: #fff; font-size: 36px; display: flex;
  align-items: center; justify-content: center; margin: 8px auto 10px; }
.success-title { font-size: 19px; font-weight: 700; margin-bottom: 10px; }
.success-rows { text-align: left; }
.success-sheet .sheet-actions a.btn { display: flex; align-items: center;
  justify-content: center; text-decoration: none; color: #21312a; }
/* 取单行 */
.park-row { cursor: default; }

/* ============ v9 全量对齐：首页/底部导航/收银台/对账/历史卡片/报表/盘点/出入库 ============
   沿用 v8 视觉规范并推广到全站：页底 #edf0f5、白圆角卡片、正红 #e64340 主按钮、
   橙 #ff7a1a 角标、胶囊搜索框、页签红字+红下划线、底部层白层圆角顶。
   品牌仍为统利鲜果行，不用对方 logo/素材。 */
body { background: #edf0f5; }
.topbar { background: #e64340; }
.fs-switch.on-dark button.active { color: #e64340; }
.btn.primary { background: #e64340; border-color: #e64340; }
.btn.danger-outline { color: #e64340; border-color: #e64340; background: #fff7f6; }
main { padding-bottom: 92px; }
.page { background: transparent; border: none; padding: 12px 2px; }
.panel { background: #fff; border-radius: 14px; padding: 14px;
  box-shadow: 0 1px 6px rgba(31,45,61,.06); }
.card { background: #fff; border: none; border-radius: 12px;
  box-shadow: 0 1px 6px rgba(31,45,61,.06); }
.card .num { color: #222; }
.card .num.debt, .debt { color: #e64340; }
.credit { color: #1a9e54; }
.search { background: #f0f2f5; border: none; border-radius: 999px; padding: 9px 16px; }
th.sortable { cursor: pointer; color: #e64340; }
.tag.settled { background: #e2f6ea; color: #1a9e54; }
.tag.debt-tag { background: #fdeceb; color: #e64340; }
.tag.partial-tag { background: #fff1e0; color: #e67e00; }
.tag.credit-tag { background: #e2f6ea; color: #1a9e54; }
.ret-mark { color: #e67e00; font-size: 12.5px; font-weight: 700; }
.toast { bottom: 92px; }

/* 首页（按原版柜台端录屏帧复刻）：深灰蓝头部整幅贴顶 + 店铺行 + 九宫格 */
.home-hero { background: linear-gradient(160deg, #39496a, #26334a);
  border-radius: 0; padding: 16px 16px 18px; color: #fff;
  margin: -12px -14px 0; box-shadow: none; }
.home-hero-top { display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 14px; }
.home-mark { width: 42px; height: 42px; border-radius: 50%; flex: none;
  background: rgba(255,255,255,.16); display: flex; align-items: center;
  justify-content: center; font-size: 20px; font-weight: 700; }
.home-links { display: flex; gap: 20px; }
.hero-link { background: none; border: none; color: #fff; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  font-size: 12.5px; padding: 0; }
.hero-link .hl-ico { font-size: 21px; line-height: 1.2; }
.home-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.hstat { min-width: 0; }
.hstat .num { font-size: 25px; font-weight: 800; white-space: nowrap; letter-spacing: .2px; }
.hstat .lbl { color: rgba(255,255,255,.62); font-size: 13px; margin-top: 3px; }
/* 大/特大字号下头部大数字收一号，避免三列挤爆（数字为千分位短格式） */
html.fs-lg .hstat .num { font-size: 22px; }
html.fs-xl .hstat .num { font-size: 19px; }
.home-shop { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: #fff; border-radius: 0; padding: 11px 16px; margin: 0 -14px;
  box-shadow: none; border-bottom: 1px solid #eceff3; }
.hs-name { font-size: 15.5px; font-weight: 600; white-space: nowrap; }
.hs-arrow { color: #b6bfca; font-size: 21px; line-height: 1; }
.home-apps { background: #fff; margin: 8px -14px 0; padding: 12px 14px 8px; }
.home-apps-title { font-size: 16.5px; font-weight: 700; margin: 0 2px 10px; }
.app-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px;
  background: #e9edf2; border-radius: 0; overflow: hidden;
  box-shadow: none; }
.app-item { display: flex; flex-direction: column; align-items: center; gap: 7px;
  background: #fff; border: none; border-radius: 0; padding: 16px 4px;
  font-size: 14.5px; color: #222; cursor: pointer; }
.app-item:active { background: #f4f6f8; }
.app-ico { width: 46px; height: 46px; border-radius: 14px; background: transparent;
  display: flex; align-items: center; justify-content: center; font-size: 27px; }
.app-ico.ico-b { background: transparent; }
.app-ico.ico-o { background: transparent; }

/* 底部三段导航（全站固定；开单页隐藏，见 app.js gotoPage）
   v10 对齐原版：青绿底栏 + 中央凸起白圆（收银台） */
.bottom-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 55;
  background: linear-gradient(180deg, #1fc9a7, #13b48f); display: flex; align-items: stretch;
  box-shadow: 0 -2px 14px rgba(19,180,143,.35);
  padding-bottom: env(safe-area-inset-bottom); }
.bottom-nav button { flex: 1; border: none; background: none; color: rgba(255,255,255,.88);
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  padding: 8px 4px 7px; font-size: 13px; cursor: pointer; }
.bottom-nav button.active { color: #fff; font-weight: 700; }
.bottom-nav .bn-ico { font-size: 20px; line-height: 1.15; }
.bottom-nav .bn-center { margin-top: -16px; }
.bottom-nav .bn-center .bn-ico { width: 48px; height: 48px; border-radius: 50%;
  background: #fff; display: flex; align-items: center;
  justify-content: center; font-size: 23px;
  box-shadow: 0 3px 10px rgba(13,120,95,.35); border: 3px solid #fff; }
.bottom-nav .bn-center.active { color: #fff; }

/* 通用页签（状态/预设/盘点模式）：红字 + 红下划线 */
.seg-tabs { display: flex; gap: 18px; border-bottom: 1px solid #eceff3;
  margin: 6px 0 12px; overflow-x: auto; }
.seg-tab { border: none; background: transparent; padding: 8px 2px;
  font-size: 15px; color: #555; white-space: nowrap; }
.seg-tab.active { color: #e64340; font-weight: 700;
  box-shadow: inset 0 -2.5px 0 #e64340; }

/* 收银台 */
.lookup-row { display: flex; gap: 8px; margin-top: 4px; }
.lookup-row input { flex: 1; padding: 9px; border: 1px solid #cfd8d2;
  border-radius: 8px; font-size: 15px; min-width: 0; }
.lookup-row .btn { flex: none; }
.cash-card { margin-top: 12px; }
.cash-pay { border-top: 1px dashed #e3e8ee; margin-top: 8px; padding-top: 6px; }

/* 订单卡片（销售历史/收银台共用） */
.order-cards { display: flex; flex-direction: column; gap: 10px; }
.order-card { background: #fff; border: 1.5px solid #e8ecf1; border-radius: 12px;
  padding: 12px; cursor: pointer; }
.cash-card { cursor: default; }
.oc-head { display: flex; justify-content: space-between; align-items: center;
  gap: 10px; font-size: 16px; }
.oc-sub { color: #8a97a3; font-size: 13px; margin-top: 3px; }
.oc-items { color: #444; font-size: 14px; margin-top: 6px; }
.oc-line { display: flex; justify-content: space-between; gap: 10px;
  padding: 5px 0; font-size: 14.5px; border-bottom: 1px solid #f4f6f8; }
.oc-nums { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 8px;
  font-size: 14px; color: #444; }
.oc-actions { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.oc-hint { margin-left: auto; color: #9aa3af; font-size: 13px; }
.hist-totals { position: sticky; bottom: 74px; margin-top: 12px; background: #fff;
  border: 1.5px solid #e8ecf1; border-radius: 12px; padding: 10px 12px;
  display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 14.5px;
  box-shadow: 0 2px 10px rgba(31,45,61,.08); }

/* 对账详情 */
.stmt-head { display: flex; flex-wrap: wrap; gap: 10px 26px; margin-bottom: 10px; }
.stmt-head-cell span { display: block; color: #8a97a3; font-size: 12.5px; }
.stmt-head-cell b { font-size: 19px; }
.stmt-return td { background: #fffaf3; }
.stmt-bar { position: fixed; left: 10px; right: 10px; bottom: 74px; z-index: 54;
  background: #fff; border-radius: 12px; padding: 10px;
  box-shadow: 0 4px 18px rgba(31,45,61,.18); display: flex; gap: 10px; }
.stmt-bar .btn { flex: 1; padding: 11px; font-size: 15px; }
#page-customers { padding-bottom: 70px; }

/* 退货层 */
.ret-row { display: flex; align-items: center; gap: 10px; padding: 9px 2px;
  border-bottom: 1px solid #eef1f4; flex-wrap: wrap; }
.ret-name { font-weight: 600; margin-right: auto; }
.ret-info { color: #8a97a3; font-size: 13px; }
.ret-qty { width: 92px; padding: 8px; border: 1.5px solid #d5dbe2;
  border-radius: 8px; font-size: 15px; }

/* 日结分区与盘点 */
.daily-line { font-size: 15px; margin: 8px 0 4px; }
.take-qty { width: 110px; padding: 8px; border: 1.5px solid #d5dbe2;
  border-radius: 8px; font-size: 15px; }
.cart-fee-rows .cs-payable { border-top: 1.5px solid #eceff3; font-size: 15px; }
#page-billing { padding-bottom: 120px; }

/* ============ 本轮照帧重排：统一页头 / 文字页签 / 各页新结构 ============ */
.topbar { display: none !important; }
/* 统一页头：白底 sticky 置顶，左返回 / 中标题 / 右槽位 */
.page-head { position: sticky; top: 0; z-index: 40; background: #fff;
  display: flex; align-items: center; gap: 8px; padding: 10px 12px;
  margin: -12px -14px 10px; border-bottom: 1px solid #eceff3;
  box-shadow: 0 1px 6px rgba(31,45,61,.05); }
.page-head .ph-back { border: none; background: none; font-size: 26px; line-height: 1;
  color: #333; padding: 2px 8px 4px 2px; flex: none; cursor: pointer; }
.page-head .ph-title { flex: 1; text-align: center; font-size: 17px; font-weight: 700;
  color: #222; min-width: 0; }
.page-head .ph-right { flex: none; min-width: 34px; display: flex; justify-content: flex-end;
  align-items: center; gap: 6px; }
.page-head.pink { background: transparent; box-shadow: none; border-bottom: none; margin: 0; }
.page-head.dark { background: linear-gradient(160deg, #39496a, #26334a); color: #fff;
  border-bottom: none; }
.page-head.dark .ph-back, .page-head.dark .ph-title { color: #fff; }
.page-head.dark .daily-date { background: rgba(255,255,255,.14); color: #fff;
  border: 1px solid rgba(255,255,255,.35); border-radius: 8px; padding: 5px 6px;
  font-size: 13px; color-scheme: dark; }
.ph-icon-btn { border: none; background: #fff; border-radius: 50%; width: 36px; height: 36px;
  font-size: 17px; box-shadow: 0 1px 5px rgba(31,45,61,.15); cursor: pointer; }
/* 页头中央分段控件（盘点 / 其他出入库） */
.ph-seg { display: inline-flex; background: #eef1f5; border-radius: 999px; padding: 3px; }
.ph-seg-btn { border: none; background: transparent; padding: 6px 14px; border-radius: 999px;
  font-size: 14.5px; color: #555; cursor: pointer; white-space: nowrap; }
.ph-seg-btn.active { background: #e64340; color: #fff; font-weight: 700; }
/* 文字页签：红字 + 红下划线 */
.txt-tabs { display: flex; gap: 18px; border-bottom: 1px solid #eceff3;
  margin: 6px 0 12px; overflow-x: auto; }
.txt-tab { border: none; background: transparent; padding: 8px 2px; font-size: 15px;
  color: #555; white-space: nowrap; cursor: pointer; }
.txt-tab.active { color: #e64340; font-weight: 700; box-shadow: inset 0 -2.5px 0 #e64340; }
/* 开单选品页签改文字页签（覆盖原胶囊样式） */
#page-billing .pick-tabs.txt-tabs { gap: 18px; }
/* 胶囊 pills（销售报表日期） */
.pill-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 2px 0 12px; }
.pill-tab { border: none; background: #f0f2f5; color: #555; padding: 7px 16px;
  border-radius: 999px; font-size: 14px; cursor: pointer; }
.pill-tab.active { background: #e64340; color: #fff; font-weight: 700; }
/* 搜索框通用 */
.search.grow { flex: 1; min-width: 0; width: 100%; }
.search.block { display: block; margin-bottom: 10px; }
/* 收银台大搜索框 */
.cash-search { display: flex; align-items: center; gap: 8px; background: #f0f2f5;
  border-radius: 999px; padding: 6px 8px 6px 16px; margin: 4px 0 6px; }
.cash-search .cs-ico { font-size: 17px; flex: none; }
.cash-search input { flex: 1; min-width: 0; border: none; background: transparent;
  font-size: 16.5px; padding: 8px 0; outline: none; color: #222; }
.cash-lookup-btn { border: none; background: none; color: #e64340; font-size: 15.5px;
  font-weight: 700; padding: 8px 10px; flex: none; cursor: pointer; }
/* 销售历史卡片（照帧）：缎带角标 + 大流水号 */
.order-card { position: relative; overflow: hidden; }
.oc-ribbon { position: absolute; top: 0; left: 0; color: #fff; font-size: 12px;
  font-weight: 700; padding: 3px 10px 3px 8px; border-radius: 0 0 12px 0; }
.oc-ribbon.debt { background: #e64340; }
.oc-ribbon.settled { background: #1a9e54; }
.oc-ribbon.voided { background: #9aa3af; }
.oc-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px;
  margin-top: 14px; }
.oc-cust { font-size: 17px; font-weight: 700; color: #222; }
.oc-print { border: 1px solid #d5dbe2; background: #fff; border-radius: 999px;
  padding: 3px 10px; font-size: 12.5px; color: #555; cursor: pointer; flex: none; }
.oc-serial { font-size: 21px; font-weight: 800; color: #39496a; white-space: nowrap; }
.oc-items-line { color: #444; font-size: 14px; margin-top: 6px; }
.oc-row2 { display: flex; justify-content: space-between; gap: 10px; font-size: 14px;
  color: #555; padding: 3px 0; }
.oc-row2 .amt { color: #ff5a1a; font-weight: 700; }
.oc-date { text-align: right; color: #9aa3af; font-size: 12.5px; margin-top: 4px; }
.oc-return-link { border: none; background: none; color: #e64340; font-size: 13.5px;
  padding: 4px 2px; cursor: pointer; }
.hist-totals { position: fixed; left: 0; right: 0; bottom: 0; top: auto; z-index: 54;
  margin: 0; border: none; border-radius: 0; display: flex; background: #fff;
  box-shadow: 0 -2px 12px rgba(31,45,61,.12); padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); }
.hist-totals .ht-cell { flex: 1; text-align: center; }
.hist-totals .ht-cell .lbl { display: block; color: #8a97a3; font-size: 12px; }
.hist-totals .ht-cell b { font-size: 16px; color: #222; }
#page-history { padding-bottom: 76px; }
/* 客户对账总览单卡 */
.cust-overview-card { background: #fff; border-radius: 14px; padding: 16px;
  box-shadow: 0 1px 6px rgba(31,45,61,.06); margin-bottom: 12px; }
.cov-row1 { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.cov-total { font-size: 30px; font-weight: 800; color: #222; }
.cov-total .yen { font-size: 17px; font-weight: 700; margin-right: 2px; }
.cov-urge { border: none; background: #ff7a1a; color: #fff; border-radius: 999px;
  padding: 8px 20px; font-size: 15px; font-weight: 700; cursor: pointer; flex: none; }
.cov-sub { color: #8a97a3; font-size: 13px; margin-top: 4px; }
.cov-div { border-top: 1px solid #eef1f4; margin: 12px 0; }
.cov-row2 { display: flex; gap: 10px; }
.cov-cell { flex: 1; min-width: 0; }
.cov-cell .amt { font-size: 19px; font-weight: 800; color: #e64340; }
.cov-cell .amt.green { color: #1a9e54; }
.cov-cell .lbl { color: #555; font-size: 13px; margin-top: 2px; }
.cust-search-row { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.section-title { font-size: 16px; font-weight: 700; margin: 10px 0 2px; color: #222; }
#custTable td.cust-name-cell { cursor: pointer; }
th.sortable-credit { cursor: pointer; color: #e64340; }
/* 对账详情：浅粉头部 */
.stmt-hero { background: #fff1f1; border-radius: 14px; padding: 4px 6px 14px;
  margin-bottom: 12px; }
.stmt-head { padding: 2px 12px 0; align-items: flex-start; }
.stmt-cust-name { font-size: 21px; font-weight: 800; color: #222; }
.stmt-contact { display: inline-block; color: #2f7fd0; font-size: 14px; margin-top: 5px;
  text-decoration: none; }
.stmt-debt-box { text-align: right; margin-left: auto; }
.stmt-debt-box .lbl { color: #8a97a3; font-size: 12.5px; }
.stmt-debt-box .amt { color: #e64340; font-size: 24px; font-weight: 800; }
.stmt-debt-box .credit-line { color: #8a97a3; font-size: 12.5px; margin-top: 2px; }
.stmt-datebar { display: flex; align-items: center; gap: 8px; background: #f4f6f8;
  border-radius: 10px; padding: 8px 10px; margin-bottom: 8px; }
.stmt-datebar input { flex: 1; min-width: 0; border: 1px solid #dde3ea; border-radius: 8px;
  padding: 6px 8px; font-size: 14px; background: #fff; }
.stmt-filter-info { font-size: 13.5px; color: #555; margin: 4px 0 10px; }
.stmt-lines { display: flex; flex-direction: column; gap: 10px; }
.stmt-card { border: 1.5px solid #e8ecf1; border-radius: 12px; padding: 10px 12px; background: #fff; }
.stmt-card.return { background: #fffaf3; }
.stmt-card-head { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.stmt-tag { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 6px;
  border: 1.5px solid #1a9e54; color: #1a9e54; background: #f2fbf5; }
.stmt-tag.pay { border-color: #2f7fd0; color: #2f7fd0; background: #f2f8fd; }
.stmt-tag.ret { border-color: #e67e00; color: #e67e00; background: #fff7ec; }
.stmt-tag.open { border-color: #9aa3af; color: #667; background: #f4f6f8; }
.stmt-card-head .sc-date { color: #8a97a3; font-size: 13px; }
.stmt-card-head .sc-right { margin-left: auto; font-weight: 700; color: #e64340; font-size: 14.5px; }
.stmt-seller { color: #8a97a3; font-size: 13px; margin-top: 4px; }
.stmt-items { width: 100%; font-size: 13.5px; margin-top: 6px; }
.stmt-items td, .stmt-items th { white-space: normal; padding: 5px 4px; }
.stmt-pay-line { font-size: 14px; color: #444; }
/* 对账底部条贴底（底栏仅首页显示后不再让位） */
.stmt-bar { bottom: 0; left: 0; right: 0; border-radius: 16px 16px 0 0;
  padding-bottom: calc(10px + env(safe-area-inset-bottom)); }
.stmt-bar .share-btn { border: 1.5px solid #07c160; color: #07c160; background: #fff;
  font-weight: 700; }
/* 库存列表行 */
.stock-stats { display: flex; gap: 8px; background: #f7f9fb; border-radius: 10px;
  padding: 10px 6px; margin-bottom: 10px; }
.stock-stats .ss-cell { flex: 1; text-align: center; min-width: 0; }
.stock-stats .ss-cell .lbl { display: block; color: #8a97a3; font-size: 12.5px; }
.stock-stats .ss-cell b { color: #ff7a1a; font-size: 17px; }
.stock-filter-row { margin-bottom: 6px; }
.prod-list { display: flex; flex-direction: column; }
.prod-row { display: flex; gap: 10px; padding: 11px 2px; border-bottom: 1px solid #eef1f4;
  align-items: flex-start; }
.prod-thumb { width: 44px; height: 44px; border-radius: 10px; flex: none; color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 19px; font-weight: 800; }
.prod-main { flex: 1; min-width: 0; }
.prod-name-line { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.prod-name-line b { font-size: 15.5px; }
.biz-tag { font-size: 11.5px; font-weight: 700; padding: 1px 7px; border-radius: 6px; }
.biz-tag.self { background: #e2f6ea; color: #1a9e54; }
.biz-tag.agent { background: #fff1e0; color: #e67e00; }
.prod-code { color: #9aa3af; font-size: 12.5px; margin-top: 2px; }
.prod-stock-line { font-weight: 700; font-size: 14px; margin-top: 2px; color: #333; }
.prod-cost { color: #ff7a1a; font-weight: 800; font-size: 15px; white-space: nowrap; }
.prod-actions { display: flex; gap: 12px; margin-top: 5px; }
.prod-actions button { border: none; background: none; color: #2f7fd0; font-size: 13.5px;
  padding: 2px 0; cursor: pointer; }
/* 销售报表 */
.sr-view-switch { display: flex; justify-content: center; gap: 6px; }
.sr-view-btn { border: none; background: #f0f2f5; color: #555; border-radius: 999px;
  padding: 6px 12px; font-size: 13.5px; cursor: pointer; white-space: nowrap; }
.sr-view-btn.active { background: #e64340; color: #fff; font-weight: 700; }
.sr-stats { display: flex; gap: 6px; background: #f7f9fb; border-radius: 10px;
  padding: 10px 4px; margin-bottom: 10px; flex-wrap: wrap; }
.sr-stats .ss-cell { flex: 1; min-width: 70px; text-align: center; }
.sr-stats .ss-cell .lbl { display: block; color: #8a97a3; font-size: 12px; }
.sr-stats .ss-cell b { font-size: 16px; color: #222; }
.sr-stats .ss-cell b.red { color: #e64340; }
.sr-ladder { background: #fff7f0; border: 1px solid #ffe1c2; color: #7a4a12;
  border-radius: 10px; padding: 8px 12px; margin: -4px 0 10px;
  font-size: 13px; line-height: 1.7; }
.sr-ladder b { color: #e64340; }
.sr-search-row { margin-bottom: 10px; }
.sr-search-row .fr-input { width: 100%; box-sizing: border-box; }
.sr-sort-row { display: flex; justify-content: space-between; align-items: center; gap: 8px;
  margin-bottom: 8px; }
.sr-range { color: #8a97a3; font-size: 13px; }
.sr-sort { border: 1px solid #dde3ea; border-radius: 8px; padding: 6px 8px; font-size: 13.5px;
  background: #fff; }
.sr-list { display: flex; flex-direction: column; gap: 10px; }
.sr-card { border: 1.5px solid #e8ecf1; border-radius: 12px; padding: 11px 12px; }
.sr-card-head { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.sr-card-head b { font-size: 15.5px; }
.sr-code { color: #9aa3af; font-size: 12.5px; }
.sr-stock { color: #8a97a3; font-size: 13px; margin-top: 3px; }
.sr-nums { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13.5px; color: #444;
  margin-top: 7px; border-top: 1px solid #f0f2f5; padding-top: 7px; }
.sr-nums .red { color: #e64340; font-weight: 700; }
.sr-info-box { background: #f4f6f8; border-radius: 10px; padding: 8px 10px; margin-top: 8px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; font-size: 13px; color: #555; }
/* 日结表 */
.daily-body { background: #fff; }
.daily-sec { text-align: center; font-size: 16px; font-weight: 800; color: #222;
  margin: 18px 0 10px; }
.daily-body .daily-sec:first-child { margin-top: 2px; }
.daily-stats { display: flex; flex-direction: column; }
.daily-stats .ds-row { display: flex; justify-content: space-between; gap: 10px;
  padding: 7px 2px; border-bottom: 1px solid #f0f2f5; font-size: 14.5px; }
.daily-stats .ds-row b { color: #222; }
.daily-print-bar { position: sticky; bottom: 0; padding: 10px 0 calc(6px + env(safe-area-inset-bottom)); }
#page-report { padding-bottom: 20px; }
/* 盘点 / 出入库元信息与行式表单 */
.meta-card { background: #f7f9fb; border-radius: 10px; padding: 6px 12px; margin-bottom: 12px; }
.meta-row { display: flex; align-items: center; gap: 10px; padding: 7px 0;
  border-bottom: 1px solid #eef1f4; font-size: 14.5px; }
.meta-row:last-child { border-bottom: none; }
.meta-row span { color: #8a97a3; flex: none; width: 72px; }
.meta-row input { flex: 1; min-width: 0; border: 1px solid #dde3ea; border-radius: 8px;
  padding: 7px 9px; font-size: 14.5px; }
.take-diff.pos { color: #1a9e54; font-weight: 700; }
.take-diff.neg { color: #e64340; font-weight: 700; }
.take-diff.none { color: #9aa3af; }
.fixed-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 54; background: #fff;
  display: flex; gap: 10px; padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  box-shadow: 0 -2px 12px rgba(31,45,61,.12); }
.fixed-bar .btn { flex: 1; padding: 11px; font-size: 15px; }
#page-stocktake, #page-transfers { padding-bottom: 84px; }
.form-card .form-row { display: flex; align-items: center; gap: 10px; padding: 10px 0;
  border-bottom: 1px solid #f0f2f5; font-size: 14.5px; }
.form-card .fr-label { color: #667; flex: none; width: 76px; }
.form-card .fr-input { flex: 1; min-width: 0; border: 1px solid #dde3ea; border-radius: 8px;
  padding: 8px 10px; font-size: 14.5px; background: #fff; }
.form-sec { font-size: 15px; font-weight: 700; margin: 14px 0 2px; color: #222; }
.party-chips { display: flex; gap: 8px; }
.party-chip { position: relative; border: 1.5px solid #d5dbe2; background: #fff; color: #333;
  border-radius: 9px; padding: 7px 18px; font-size: 14px; cursor: pointer; }
.party-chip.active { border-color: #e64340; color: #e64340; font-weight: 700; background: #fff7f6; }
.party-chip.active::after { content: "✓"; position: absolute; top: -7px; right: -5px;
  background: #e64340; color: #fff; width: 16px; height: 16px; border-radius: 50%;
  font-size: 10px; display: flex; align-items: center; justify-content: center; }
/* 开单商品卡经营标签 */
.card-biz { margin-top: 1px; }

/* ============ 设置页（顶栏瘦身：字号/账号类功能收纳于此） ============ */
.settings-h { margin: 16px 0 6px; font-size: 14px; color: #66766c; font-weight: 700; }
.panel > .settings-h:first-of-type { margin-top: 2px; }
.settings-row { display: flex; align-items: center; justify-content: space-between;
  gap: 10px; flex-wrap: wrap; padding: 6px 0; font-size: 15px; }
.settings-btns { display: flex; gap: 8px; flex-wrap: wrap; padding: 8px 0 2px; }
