/* ==========================================================================
   业务补充样式（框架样式见 css/wxui.css）
   ========================================================================== */

/* ---------- 登录页 ---------- */
.wx-login-screen {
  position: fixed;
  inset: 0;
  background: linear-gradient(160deg, #07c160 0%, #06ad56 100%);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.wx-login-box {
  width: 100%;
  max-width: 360px;
  background: #fff;
  border-radius: 16px;
  padding: 28px 22px 22px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, .15);
}

.wx-login-logo {
  font-size: 37px;
  text-align: center;
  line-height: 1;
  margin-bottom: 8px;
}

.wx-login-logo-img {
  display: block;
  width: 64px;
  height: 64px;
  margin: 0 auto 10px;
  border-radius: 14px;
  box-shadow: 0 4px 14px rgba(7, 193, 96, .28);
}

.wx-login-box h2 {
  margin: 0 0 18px;
  color: #191919;
  text-align: center;
  font-size: 18px;
  font-weight: 600;
}

.wx-login-msg {
  min-height: 18px;
  margin-bottom: 8px;
  color: #fa5151;
  font-size: 13px;
  text-align: center;
  word-break: break-word;
}

.wx-login-tip {
  margin-top: 14px;
  color: rgba(255, 255, 255, .9);
  font-size: 12px;
  text-align: center;
  line-height: 1.6;
}

/* ---------- 库存概览列表 ---------- */
.inv-item {
  padding: 12px 0;
  border-bottom: 1px solid #f0f0f0;
}

.inv-item:last-child { border-bottom: none; }

.inv-name {
  font-size: 15px;
  font-weight: 500;
  color: #191919;
}

.inv-sub {
  font-size: 12px;
  color: #7f7f7f;
  margin-top: 2px;
}

/* ---------- 单据列表 ---------- */
.rec-item {
  border-bottom: 1px solid #f0f0f0;
}

.rec-item:last-child { border-bottom: none; }

/* ---------- 打印单据 ---------- */
.wx-print-area .pl {
  margin: 6px 0;
  display: flex;
  justify-content: space-between;
}

.wx-print-area .pl-total {
  border-top: 1px solid #000;
  padding-top: 8px;
  margin-top: 10px;
  font-weight: 700;
}

/* ---------- 小工具 ---------- */
.text-right { text-align: right; }
.text-center { text-align: center; }
.mt-sm { margin-top: 6px; }
.mt-md { margin-top: 12px; }
.mb-sm { margin-bottom: 6px; }
.mb-md { margin-bottom: 12px; }

/* ---------- 行内小按钮（导出 / 复制等） ---------- */
.wx-btn-sm {
  width: auto;
  min-width: 56px;
  padding: 0 12px;
  height: 30px;
  line-height: 30px;
  font-size: 12px;
  border-radius: 6px;
  margin: 0;
  flex: none;
}

/* ---------- 添加到桌面引导条 ---------- */
.wx-install-tip {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0 0;
  padding: 12px 14px;
  border-radius: 10px;
  background: #e8f8ef;
  border: 1px solid #b7e8cd;
  color: #0a6b3d;
  font-size: 13px;
  line-height: 1.5;
}

.wx-install-tip .wx-install-icon {
  font-size: 18px;
  line-height: 1;
  flex: none;
}

.wx-install-tip .wx-install-bd { flex: 1; }

.wx-install-tip .wx-install-close {
  flex: none;
  border: none;
  background: transparent;
  color: #0a6b3d;
  font-size: 12px;
  padding: 4px 6px;
  border-radius: 6px;
}

/* ---------- 打印单据抬头 ---------- */
.wx-print-area h2 {
  font-size: 16px;
  letter-spacing: 2px;
}

/* ---------- 空态与卡片间距微调 ---------- */
.wx-card .wx-row + .wx-row { border-top: 1px solid #f2f2f2; }

/* ==========================================================================
   库管精灵式首页（v20261017c）
   ========================================================================== */
.sp-hello {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 14px 12px;
}
.sp-hello-t { font-size: 15px; font-weight: 600; color: #191919; }
.sp-hello-s { font-size: 12px; color: #7f7f7f; margin-top: 3px; }
.sp-hello-btn {
  flex: none;
  border: none;
  background: #07c160;
  color: #fff;
  font-size: 13px;
  padding: 7px 14px;
  border-radius: 999px;
}

/* 顶部四宫格统计 */
.sp-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 0 12px 12px;
}
.sp-stat {
  background: #fff;
  border-radius: 12px;
  padding: 12px 4px 10px;
  text-align: center;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .05);
  cursor: pointer;
}
.sp-stat-n { font-size: 18px; font-weight: 700; color: #07c160; line-height: 1.2; }
.sp-stat-warn { color: #fa5151; }
.sp-stat-l { font-size: 11px; color: #7f7f7f; margin-top: 4px; }

/* 功能图标网格 */
.sp-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px 0;
  padding: 4px 6px 14px;
}
.sp-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 10px 2px;
  border-radius: 10px;
  cursor: pointer;
}
.sp-item:active { background: #f2f2f2; }
.sp-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  line-height: 1;
}
.sp-icon-in    { background: #e8f8ef; }
.sp-icon-out   { background: #fff1e8; }
.sp-icon-move  { background: #eef3ff; }
.sp-icon-check { background: #f0eaff; }
.sp-icon-rec   { background: #fff8e1; }
.sp-icon-stats { background: #e6f7fa; }
.sp-icon-mgr   { background: #eef0f2; }
.sp-icon-alert { background: #ffecec; }
.sp-icon-print { background: #eef0f2; }
.sp-icon-doc   { background: #eefaf0; }
.sp-icon-me    { background: #e8f0ff; }
.sp-icon-help  { background: #f5f5f5; }
.sp-text { font-size: 12px; color: #3d3d3d; }

/* ==========================================================================
   表单增强（v20261017c）
   ========================================================================== */
/* 数量单位后缀 */
.wx-unit {
  flex: none;
  min-width: 34px;
  padding-left: 8px;
  font-size: 14px;
  color: #07c160;
  font-weight: 600;
  line-height: 40px;
}
/* 复选框行 */
.wx-check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  color: #3d3d3d;
  line-height: 1.5;
  margin: 4px 0 12px;
  cursor: pointer;
}
.wx-check input { width: 18px; height: 18px; margin-top: 1px; flex: none; accent-color: #07c160; }
/* 数量规范提示 */
.qty-hint-ok { color: #7f7f7f; }
.qty-hint-bad { color: #fa5151; }

/* ==========================================================================
   我的页面（v20261017c）
   ========================================================================== */
.my-profile { display: flex; align-items: center; gap: 14px; }
.my-avatar {
  width: 54px; height: 54px; flex: none;
  border-radius: 50%;
  background: #e8f8ef;
  display: flex; align-items: center; justify-content: center;
  font-size: 23px;
}
.my-profile-bd { flex: 1; min-width: 0; }
.my-name { font-size: 15px; font-weight: 600; color: #191919; }

/* 预警条目 */
.alert-item {
  padding: 10px 0;
  border-bottom: 1px solid #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.alert-item:last-child { border-bottom: none; }
.alert-item-t { font-size: 14px; color: #191919; }
.alert-item-s { font-size: 12px; color: #7f7f7f; margin-top: 2px; }
.alert-badge {
  flex: none;
  font-size: 12px;
  color: #fa5151;
  background: #ffecec;
  border-radius: 6px;
  padding: 3px 8px;
  white-space: nowrap;
}
.alert-ok { font-size: 13px; color: #7f7f7f; padding: 6px 0; }

/* 盘点差异结果 */
.check-diff {
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 14px;
  line-height: 1.6;
}
.check-diff-profit { background: #e8f8ef; color: #0a6b3d; }
.check-diff-loss { background: #ffecec; color: #a03028; }
.check-diff-even { background: #f2f2f2; color: #4d4d4d; }

/* ==========================================================================
   「我的」功能菜单（竖列表，替代横向分段器） v20261017c
   ========================================================================== */
.my-menu-card { padding: 2px 14px; }

.my-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 0;
  border-bottom: 1px solid #f0f0f0;
  cursor: pointer;
}

.my-menu-item:last-child { border-bottom: none; }
.my-menu-item:active { background: #f7f7f7; }

.my-menu-ic {
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 10px;
  background: #e8f8ef;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
}

.my-menu-bd { flex: 1; min-width: 0; }
.my-menu-t { font-size: 15px; font-weight: 500; color: #191919; }
.my-menu-s { font-size: 12px; color: #7f7f7f; margin-top: 2px; }
.my-menu-arrow { color: #c8c8c8; font-size: 16px; flex: none; line-height: 1; }

/* 子页返回条 */
.my-back {
  font-size: 13px;
  color: #07c160;
  padding: 10px 14px 0;
  cursor: pointer;
}

/* ==========================================================================
   按钮组（可换行，防止文字出框） v20261017c
   ========================================================================== */
.wx-btn-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.wx-btn-wrap .wx-btn {
  flex: 1 1 30%;
  min-width: 88px;
  width: auto;
  padding: 0 10px;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==========================================================================
   单据格式：模板上传 + 字段勾选 v20261017c
   ========================================================================== */
.df-sep { height: 1px; background: #f0f0f0; margin: 14px 0; }

/* 预警推送卡片分组标题与说明 v20261017g */
.wx-card-sub {
  font-size: 14px;
  font-weight: 600;
  color: #07C160;
  margin: 14px 0 8px;
  padding-left: 8px;
  border-left: 3px solid #07C160;
}
.wx-tiny { font-size: 12px; line-height: 1.5; }

.wx-file {
  display: block;
  width: 100%;
  font-size: 13px;
  color: #3d3d3d;
}

.tpl-preview {
  display: block;
  max-width: 100%;
  max-height: 180px;
  margin-top: 10px;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  background: #fafafa;
}

.df-fields {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px 10px;
}

.df-field {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: #3d3d3d;
  cursor: pointer;
}

.df-field input { width: 17px; height: 17px; flex: none; accent-color: #07c160; }

/* 打印单据：顶部模板图 */
.wx-print-area .tpl-img {
  display: block;
  max-width: 100%;
  max-height: 240px;
  margin: 0 auto 12px;
}

/* 打印预览模态正文（内置浏览器兜底） v20261017c */
.print-preview-body {
  max-height: 60vh;
  overflow: auto;
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 8px;
  padding: 14px;
  font-size: 14px;
}

.print-preview-body h2 { margin: 0 0 10px; font-size: 15px; text-align: center; }
.print-preview-body .pl { margin: 6px 0; display: flex; justify-content: space-between; gap: 16px; }
.print-preview-body .tpl-img { display: block; max-width: 100%; max-height: 200px; margin: 0 auto 10px; }

/* 已作废单据置灰 */
.rec-voided { opacity: .55; }
.rec-voided .wx-value { text-decoration: line-through; }

/* 记录卡片：重量（数量）作为物料名下的第二行，突出显示 */
.rec-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.rec-name { font-size: 15px; font-weight: 600; color: var(--wx-text); }
.rec-weight {
  display: flex; align-items: baseline; gap: 4px;
  margin: 6px 0 2px; font-size: 13px; color: var(--wx-text-2);
}
.rec-weight b { font-size: 22px; font-weight: 700; line-height: 1; }
.rec-weight .rec-weight-u { font-size: 13px; }
.rec-weight.in b { color: var(--wx-green-dark); }
.rec-weight.out b { color: #c0392b; }
.rec-weight.move b { color: #1270c8; }
.rec-weight.check b { color: #c97a12; }
.rec-actions { margin-top: 8px; flex-wrap: wrap; }
.rec-actions .wx-btn { width: auto; }

/* 操作记录紧凑列表行（替代卡片，省空间）v20261017h */
.rec-row { padding: 9px 12px; border-bottom: 1px solid var(--wx-line-light); }
.rec-row:last-child { border-bottom: none; }
.rec-row-voided { opacity: .5; }
.rec-row-top { display: flex; align-items: center; gap: 6px; min-width: 0; }
.rec-row-name {
  font-size: 14px; font-weight: 600; color: var(--wx-text);
  flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.rec-row-mid { display: flex; align-items: baseline; gap: 10px; margin-top: 3px; }
.rec-row .rec-weight { margin: 0; }
.rec-row .rec-weight b { font-size: 16px; }
.rec-row-time {
  font-size: 12px; color: #999; flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.rec-row-meta { font-size: 12px; color: #999; margin-top: 2px; }
.rec-row-actions { margin-top: 7px; display: flex; gap: 8px; }

/* ==========================================================================
   两列表单（v20261016a）：出入库/移库等登记表单用网格排布，减少纵向滚动
   ========================================================================== */
.wx-form2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 12px;
  align-items: start;
}
.wx-form2 .wx-field { margin-bottom: 12px; }
.wx-form2 .col2 { grid-column: 1 / -1; }
/* 表单内小标题（如「物流信息」） */
.wx-form-hd {
  font-size: 14px;
  font-weight: 600;
  color: var(--wx-text);
  margin: 2px 0 4px;
  grid-column: 1 / -1;
}
.wx-form-hd::before {
  content: "";
  display: inline-block;
  width: 3px;
  height: 13px;
  background: var(--wx-green);
  border-radius: 2px;
  margin-right: 7px;
  vertical-align: -1px;
}
/* 极窄屏退回单列（保证输入不挤压） */
@media (max-width: 320px) {
  .wx-form2 { grid-template-columns: 1fr; }
}

/* ==========================================================================
   统计页（v20261016a）：筛选快捷、KPI 卡、汇总表
   ========================================================================== */
.wx-stat-quick {
  margin-top: 10px;
  flex-wrap: wrap;
  gap: 8px;
}
.wx-stat-quick .wx-btn { flex: 1 1 auto; min-width: 64px; }

/* KPI 概览：四宫格（入库/出库/移库/盘点） */
.stat-kpis {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.stat-kpi {
  background: var(--wx-bg-gray);
  border-radius: 10px;
  padding: 12px 14px;
}
.stat-kpi-n { font-size: 19px; font-weight: 700; line-height: 1.2; }
.stat-kpi-l { font-size: 12px; color: var(--wx-text-2); margin-top: 4px; }
.stat-kpi-in .stat-kpi-n { color: var(--wx-green); }
.stat-kpi-out .stat-kpi-n { color: #fa5151; }
.stat-kpi-move .stat-kpi-n { color: #10aeff; }
.stat-kpi-check .stat-kpi-n { color: #ff8f1f; }

/* 汇总表 / 列表表格 */
.stat-table { width: 100%; overflow-x: auto; }
.stat-table table { width: 100%; border-collapse: collapse; font-size: 13px; }
.stat-table th, .stat-table td {
  padding: 8px 6px;
  text-align: right;
  border-bottom: 1px solid var(--wx-line-light);
  white-space: nowrap;
}
.stat-table th:first-child, .stat-table td:first-child { text-align: left; }
.stat-table thead th { color: var(--wx-text-2); font-weight: 600; background: var(--wx-bg-gray); }
.stat-table tfoot td { font-weight: 700; border-top: 2px solid var(--wx-line); border-bottom: none; }

/* 客户/供应商汇总条 */
.stat-bar-row { padding: 10px 0; border-bottom: 1px solid var(--wx-line-light); }
.stat-bar-row:last-child { border-bottom: none; }
.stat-bar-row .wx-row { padding: 0; }
.stat-bar-track { background: var(--wx-line-light); height: 8px; border-radius: 4px; overflow: hidden; margin-top: 6px; }
.stat-bar-fill { background: var(--wx-green); height: 100%; border-radius: 4px; transition: width .3s; }
.stat-bar-fill.in { background: var(--wx-green); }
.stat-bar-fill.out { background: #fa5151; }

/* 每日趋势（出入库双向条） */
.stat-trend-row { display: flex; align-items: center; gap: 8px; padding: 5px 0; font-size: 12px; }
.stat-trend-date { width: 42px; flex: none; color: var(--wx-text-2); }
.stat-trend-bars { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.stat-trend-line { display: flex; align-items: center; gap: 6px; }
.stat-trend-line .lab { width: 28px; flex: none; color: var(--wx-text-2); }
.stat-trend-line .bar { height: 8px; border-radius: 4px; }
.stat-trend-line .bar.in { background: var(--wx-green); }
.stat-trend-line .bar.out { background: #fa5151; }
.stat-trend-line .val { width: 56px; flex: none; text-align: right; color: var(--wx-text); }

/* 统计页内空态 */
.stat-empty { text-align: center; color: var(--wx-text-3); font-size: 13px; padding: 28px 0; }

/* ================= 单据打印（2026-10-19 重做） ================= */
/* 版式由 js/print.js 生成：pr-doc 内是一个 4 列表格，打印与屏幕预览共用同一套结构，
   保证「预览所见」与「打印所得」一致。 */
.pr-doc {
  background: #fff;
  color: #111;
  box-sizing: border-box;
  font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  line-height: 1.5;
}
.pr-company { text-align: center; font-size: 1.5em; font-weight: 700; letter-spacing: 2px; }
.pr-title {
  text-align: center;
  font-size: 1.7em;
  font-weight: 700;
  letter-spacing: 6px;
  margin: 6px 0 10px;
  padding-bottom: 8px;
  border-bottom: 2px solid #111;
}
.pr-grid { width: 100%; border-collapse: collapse; table-layout: fixed; }
.pr-grid td {
  border: 1px solid #333;
  padding: 7px 8px;
  vertical-align: middle;
  word-break: break-all;
}
.pr-lab { color: #666; font-size: 0.82em; margin-right: 8px; }
.pr-val { color: #111; font-weight: 500; }
.pr-cell-full .pr-val { font-weight: 400; }
.pr-sign {
  display: flex;
  justify-content: space-between;
  margin-top: 18px;
  padding-top: 8px;
  border-top: 1px solid #333;
  font-size: 0.92em;
}
.pr-foot { text-align: center; margin-top: 12px; color: #888; font-size: 0.78em; }

/* ---- 图形元素（版式构件，不是数据字段） ---- */
.pr-cell-decor { padding: 6px 8px; vertical-align: middle; }
.pr-decor-line { border-top: 2px solid #333; margin: 0 14px; height: 0; }
.pr-decor-grid-head {
  text-align: center; color: #666; font-size: 0.82em;
  border: 1px solid #333; border-bottom: none; padding: 4px 6px;
}
.pr-decor-tbl { width: 100%; border-collapse: collapse; table-layout: fixed; }
.pr-decor-tbl td { border: 1px solid #333; height: 26px; padding: 2px 4px; }
.pr-decor-note {
  background: #f6f6f6; border: 1px solid #ddd; border-radius: 6px;
  color: #555; font-size: 0.92em; line-height: 1.6; padding: 8px 10px;
}
.pr-decor-sign {
  display: flex; justify-content: space-around; flex-wrap: wrap;
  gap: 6px 16px; color: #111; font-size: 0.92em;
}

/* 屏幕上的预览容器：等比缩放，不撑破手机屏 */
.pr-preview-box {
  background: #8a8a8a;
  padding: 12px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  max-height: 62vh;
}
.pr-preview-inner { transform-origin: top center; }

/* 打印通道：只输出单据本体，其余界面元素全部隐藏
   历史坑：旧实现用 body * { visibility:hidden } —— 元素只是「看不见」，但仍占着整页高度，
   于是「手机端那一条很长的页面」被一并排版，白白多出 2 张空白纸（打印 1 张单据出 3 张纸）。
   必须用 display:none 把它们从排版流里彻底移除，并让单据宽度自适应纸张可打印区域。 */
@media print {
  @page { size: A4 portrait; margin: 8mm; }
  html, body {
    height: auto !important;
    overflow: visible !important;
    background: #fff !important;
  }
  /* 除打印区外，body 下所有节点都不参与排版 */
  body > *:not(#printArea) { display: none !important; }
  #printArea {
    display: block !important;
    position: static !important;
    left: auto; top: auto;
    width: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
  }
  /* 屏幕上是固定 794px（A4@96dpi），打印时必须交出宽度控制权，否则会超出可打印区域被切断 */
  #printArea .pr-doc {
    width: auto !important;
    max-width: 100% !important;
    min-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
    border: none !important;
    page-break-inside: avoid;
    break-inside: avoid;
  }
  #printArea .pr-grid { page-break-inside: auto; }
  .pr-preview-box { max-height: none !important; overflow: visible !important; }
  .no-print { display: none !important; }
}

/* ---------- 打印模板设计器 ---------- */
.tpl-paper-row { display: flex; gap: 8px; }
.tpl-paper-row .wx-seg { flex: 1; }
.tpl-field-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.tpl-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px; border: 1px solid #ddd; border-radius: 16px;
  font-size: 13px; background: #fff; color: var(--wx-text-2);
}
.tpl-chip.on { border-color: var(--wx-green, #07C160); color: var(--wx-green, #07C160); background: #f0fbf4; }
.tpl-row {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 0; border-bottom: 1px dashed #eee;
}
.tpl-row-idx {
  width: 22px; height: 22px; flex: none; border-radius: 50%;
  background: #f2f2f2; color: #888; font-size: 12px;
  display: flex; align-items: center; justify-content: center;
}
.tpl-row-keys { flex: 1; font-size: 13px; color: var(--wx-text); }
.tpl-row-btns { display: flex; gap: 4px; }
.tpl-row-btns button {
  width: 26px; height: 26px; border-radius: 6px; border: 1px solid #e5e5e5;
  background: #fafafa; color: #666; font-size: 13px; line-height: 1;
}
.tpl-row-btns button:disabled { opacity: .35; }

/* 图形元素配置面板 */
.tpl-decor-cfg {
  border: 1px solid #eee; border-radius: 10px;
  padding: 10px 12px; margin-bottom: 10px; background: #fafafa;
}
.tpl-decor-cfg-t { font-size: 13px; font-weight: 600; color: var(--wx-text-1); margin-bottom: 8px; }
.tpl-decor-cfg-row { display: flex; align-items: center; gap: 8px; }
.tpl-decor-cfg-row label { font-size: 12px; color: var(--wx-text-2); flex: none; }
.tpl-decor-cfg-row input {
  width: 64px; flex: none; height: 32px; border: 1px solid #e5e5e5;
  border-radius: 8px; padding: 0 8px; font-size: 13px; background: #fff;
}

/* 打印结果图片（微信里长按保存） */
.pr-img-wrap { text-align: center; background: #8a8a8a; padding: 12px; }
.pr-img-wrap img { max-width: 100%; box-shadow: 0 2px 12px rgba(0,0,0,.3); }
.pr-tip {
  background: #fff9e6; border: 1px solid #ffe58f; color: #7a5b00;
  padding: 10px 12px; border-radius: 8px; font-size: 13px; margin-bottom: 10px;
}

/* ---------- 往来单位统计 & 操作历史 ---------- */
.ta-r { text-align: right; }
.wx-row-head {
  background: #fafafa;
  font-size: 12px;
  color: var(--wx-text-2);
  font-weight: 600;
}
.wx-row-head > div { padding-bottom: 2px; }
.wx-val-in { color: #07C160; font-weight: 600; }
.wx-val-out { color: #fa5151; font-weight: 600; }

/* ---------- 打印模板库（横向滑动卡片流，每张带缩略图） ---------- */
/* 关键：隐藏系统滚动条（手机上那条灰条很丑），改为手势横滑 + 边缘渐隐提示 */
.tpl-lib-list {
  display: flex; flex-wrap: nowrap; gap: 10px;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  scrollbar-width: none;              /* Firefox */
  -ms-overflow-style: none;           /* IE/Edge 旧 */
  padding: 2px 16px 8px;              /* 左右留 16 给渐隐和阴影 */
  margin: 0 -16px;                    /* 抵消父级 padding，让卡片能滑到边 */
  scroll-snap-type: x mandatory;      /* 磁性吸附，滑一下停一张 */
}
.tpl-lib-list::-webkit-scrollbar { display: none; }   /* Chrome/Safari */

.tpl-lib-card {
  flex: 0 0 auto;
  width: 116px;
  scroll-snap-align: start;
  border: 2px solid #e8e8e8;
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
  cursor: pointer;
  transition: border-color .15s, transform .15s;
}
.tpl-lib-card:active { transform: scale(.97); }
.tpl-lib-card.on { border-color: #07C160; box-shadow: 0 2px 10px rgba(7,193,96,.18); }
/* 缩略图窗：固定高度，内部用 transform 缩小真实单据 */
.tpl-lib-thumb {
  position: relative; height: 82px; overflow: hidden;
  background: #fafafa; border-bottom: 1px solid #eee;
}
.tpl-lib-thumb-in { transform-origin: top left; pointer-events: none; }
.tpl-lib-card-meta { padding: 6px 8px 7px; }
.tpl-lib-card-name {
  font-size: 12px; font-weight: 600; color: #333;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tpl-lib-card-sub { font-size: 10px; color: #999; margin-top: 2px; }
.tpl-lib-card.on .tpl-lib-card-name { color: #07C160; }
.tpl-lib-card-badge {
  position: absolute; top: 4px; right: 4px; z-index: 2;
  font-style: normal; font-size: 9px; line-height: 1;
  background: rgba(0,0,0,.55); color: #fff;
  border-radius: 3px; padding: 2px 4px;
}
/* 左右渐隐，暗示"这里还能滑" */
.tpl-lib-fade { position: relative; }
.tpl-lib-fade::before, .tpl-lib-fade::after {
  content: ''; position: absolute; top: 0; bottom: 8px; width: 18px;
  pointer-events: none; z-index: 3;
}
.tpl-lib-fade::before { left: 0; background: linear-gradient(to right, #fff, rgba(255,255,255,0)); }
.tpl-lib-fade::after { right: 0; background: linear-gradient(to left, #fff, rgba(255,255,255,0)); }
.tpl-cur-name { color: var(--wx-text-1); }

/* 打印时的格式选择列表 */
.tpl-pick-row {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 14px; border-radius: 10px;
  background: #fafafa; border: 1px solid #eee;
  margin-bottom: 9px; cursor: pointer;
}
.tpl-pick-row.on { background: #e7f8ee; border-color: #07C160; }
.tpl-pick-row:active { background: #f0f0f0; }
.tpl-pick-main { flex: 1; min-width: 0; }
.tpl-pick-name { font-size: 15px; font-weight: 600; color: var(--wx-text-1); }
.tpl-pick-meta { font-size: 12px; color: var(--wx-text-2); margin-top: 3px; }
.tpl-pick-warn { font-size: 11px; color: #fa5151; flex: 0 0 auto; }
.tpl-tag {
  display: inline-block; font-size: 10px; font-weight: 400;
  background: #fff; border: 1px solid #ddd; border-radius: 4px;
  padding: 0 4px; margin-left: 6px; color: #999; vertical-align: middle;
}

/* ================= v20261027 新增 ================= */

/* 1) 手机横滑：模板卡片流 / 单据预览 / 弹层都要能吃横向手势，
      并且横向滑到头时不要顺势把整页拖走（overscroll 收敛在容器内） */
.tpl-lib-list,
.pr-preview-box,
.wx-modal-box,
.print-preview-body {
  touch-action: pan-x pan-y;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.tpl-lib-list { width: 100%; max-width: 100%; }

/* 打印按钮浮在预览上时，别拦住手势 */
.pr-preview-box { position: relative; }

/* 2) 出入库多物料明细行 */
.line-list { display: flex; flex-direction: column; gap: 8px; }
.line-row {
  border: 1px solid #eee; border-radius: 10px; padding: 8px 10px; background: #fafafa;
}
.line-row-main {
  display: flex; align-items: center; gap: 8px;
}
.line-row-main select { flex: 1; min-width: 0; }
.line-row-main input { width: 88px; flex: none; }
.line-row-main .line-unit { font-size: 12px; color: #888; width: 26px; flex: none; }
.line-row-main .line-del {
  flex: none; width: 28px; height: 28px; border-radius: 8px; border: 1px solid #f0d0cc;
  background: #fff; color: #d43c33; font-size: 15px; line-height: 1;
}
.line-row-idx { font-size: 12px; color: #999; margin-right: 2px; }
.line-add { margin-top: 8px; }

/* 3) 单据打印：多物料明细表 */
.pr-lines { width: 100%; border-collapse: collapse; margin-top: 8px; table-layout: fixed; }
.pr-lines th, .pr-lines td {
  border: 1px solid #333; padding: 5px 6px; font-size: 0.92em; word-break: break-all;
}
.pr-lines th { background: #f4f4f4; font-weight: 600; text-align: center; }
.pr-lines td.num { text-align: right; }
.pr-lines td.center { text-align: center; }
.pr-lines-foot td { border-top: 2px solid #333; font-weight: 600; }

/* 4) 人员列表：账号名 */
.user-account { font-size: 12px; color: #888; word-break: break-all; }

/* 5) 登录验证码 */
.captcha-row { display: flex; align-items: center; gap: 10px; }
.captcha-img {
  height: 42px; min-width: 108px; border-radius: 8px; border: 1px solid #e5e5e5;
  background: #f7f7f7; display: flex; align-items: center; justify-content: center;
  font-size: 21px; letter-spacing: 5px; font-weight: 700; color: #2b6cb0;
  user-select: none; -webkit-user-select: none; font-family: "Courier New", monospace;
  cursor: pointer;
}
.captcha-input { flex: 1; min-width: 0; }

/* 6) 单据编号规则预览 */
.docno-preview {
  background: #f0fbf4; border: 1px dashed #07C160; color: #07853f;
  border-radius: 8px; padding: 8px 10px; font-size: 15px; letter-spacing: .5px;
  font-weight: 600; text-align: center; word-break: break-all;
}

/* 7) 往来单位统计：整行可点 */
.wx-row-click { cursor: pointer; }
.wx-row-click:active { background: #f7f7f7; }

/* 8) 模板设计器：行内字段编排 */
.tpl-row { align-items: flex-start; }
.tpl-row-body { flex: 1; min-width: 0; }
.tpl-row-fields { display: flex; flex-wrap: wrap; gap: 6px; }
.tpl-fchip {
  display: inline-flex; align-items: center; gap: 2px;
  background: #fff; border: 1px solid #e5e5e5; border-radius: 8px;
  padding: 3px 4px 3px 8px; font-size: 12px; color: #333;
}
.tpl-fchip .fx { display: flex; gap: 1px; }
.tpl-fchip button {
  width: 20px; height: 20px; border: none; background: #f5f5f5; border-radius: 5px;
  color: #666; font-size: 11px; line-height: 1; padding: 0;
}
.tpl-fchip button:disabled { opacity: .3; }
.tpl-row-tools { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.tpl-row-tools .wx-btn { padding: 3px 8px; font-size: 12px; width: auto; margin: 0; }
.tpl-fchip .fn { white-space: nowrap; }
.tpl-fchip .fw { font-style: normal; color: #bbb; font-size: 10px; margin-left: 2px; }
.tpl-row-empty { font-size: 12px; color: #bbb; }
/* 行内「加字段」面板 */
.tpl-row-picker {
  margin-top: 8px; padding: 8px 10px; border: 1px dashed #cfe8d8;
  background: #f8fdf9; border-radius: 8px;
}
.tpl-row-picker .tpl-chip { padding: 5px 9px; font-size: 12px; }

/* 9) 操作历史：终端 / IP 行 */
.audit-net { font-size: 12px; color: #999; margin-top: 2px; }

/* 10) 页脚备案信息（域名上线后必须公示） */
.site-footer {
  text-align: center;
  padding: 18px 12px 26px;
  font-size: 11px;
  line-height: 1.9;
  color: #9a9a9a;
}
.site-footer a { color: #8a8a8a; text-decoration: none; }
.site-footer a:active { text-decoration: underline; }
.site-footer .sf-sep { margin: 0 6px; color: #ccc; }
.site-footer .sf-copy { margin-top: 2px; color: #b0b0b0; }
/* 登录页页脚在白色卡片内，用灰度文字 */
.wx-login-screen .site-footer { padding: 12px 0 2px; color: #a5a5a5; }
.wx-login-screen .site-footer a { color: #8a8a8a; }

/* 11) 危险操作区：删除入口折叠在编辑表单底部，避免误触 */
.danger-zone {
  margin-top: 10px;
  border-top: 1px dashed #e6e0da;
  padding-top: 8px;
}
.dz-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 2px;
  font-size: 13px;
  color: #9a9a9a;
  cursor: pointer;
  user-select: none;
}
.dz-toggle:active { background: #faf8f6; }
.dz-arrow { color: #c4c4c4; font-size: 15px; }
.dz-body {
  padding: 8px 10px 12px;
  background: #fff8f6;
  border: 1px solid #f6ded6;
  border-radius: 10px;
}
.dz-body .wx-muted { font-size: 12px; line-height: 1.7; margin-bottom: 10px; }
.wx-btn.wx-btn-danger {
  background: #fff;
  color: #e64340;
  border: 1px solid #e64340;
}
.wx-btn.wx-btn-danger:active { background: #fdecea; }
