/* 批发进销存 —— 通用样式（PC 大屏 + 手机自适应） */
:root {
  --primary: #1677ff;
  --primary-dark: #0958d9;
  --primary-soft: #e8f2ff;
  --success: #16a34a;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #64748b;
  --text: #1f2937;
  --text-sub: #6b7280;
  --border: #e5e7eb;
  --bg: #f5f7fa;
  --card: #ffffff;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(16, 24, 40, .06), 0 1px 2px rgba(16, 24, 40, .04);
  --shadow-lg: 0 10px 30px rgba(16, 24, 40, .12);
  --sidebar-w: 208px;
  --head-h: 56px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; padding: 0; height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text); background: var(--bg); font-size: 14px;
}

a { color: inherit; text-decoration: none; }
input, select, textarea { font-family: inherit; font-size: 14px; color: var(--text); }

/* ---------- 布局 ---------- */
/* dvh：手机浏览器地址栏收起/展开时高度自适应，避免底部被地址栏或 TabBar 遮住 */
.app { display: flex; height: 100vh; height: 100dvh; overflow: hidden; }

.sidebar {
  width: var(--sidebar-w); flex: 0 0 var(--sidebar-w);
  background: linear-gradient(180deg, #0f172e 0%, #142241 100%);
  color: #cbd5e1; display: flex; flex-direction: column; overflow: hidden;
}
.brand {
  height: var(--head-h); display: flex; align-items: center; gap: 10px; padding: 0 16px;
  font-size: 16px; font-weight: 700; color: #fff; letter-spacing: .5px; flex: 0 0 auto;
}
.brand .logo {
  width: 28px; height: 28px; border-radius: 8px; background: linear-gradient(135deg, #1677ff, #36cfc9);
  display: grid; place-items: center; font-size: 15px;
}
.side-menu { flex: 1; overflow-y: auto; padding: 8px 8px 24px; }
.side-foot {
  flex: 0 0 auto; display: flex; flex-direction: column; gap: 7px;
  padding: 10px 14px; border-top: 1px solid rgba(255,255,255,.08); color: #94a3b8; font-size: 12px;
}
.side-foot-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
/* ICP 备案号：法规要求网站底部展示并可跳转工信部备案系统。
   用低饱和度的辅助色，字号小但保持可读，不与业务内容抢视觉。 */
.side-icp { text-align: center; font-size: 11px; line-height: 1.6; color: #8b9cb3; word-break: break-all; }
.side-icp:empty { display: none; }
.icp-link { color: inherit; text-decoration: none; }
.icp-link:hover { color: #6cb2ff; text-decoration: underline; }
.side-menu::-webkit-scrollbar { width: 4px; }
.side-menu::-webkit-scrollbar-thumb { background: #334155; border-radius: 4px; }
.menu-group-title { padding: 12px 12px 6px; font-size: 11px; color: #64748b; letter-spacing: 1px; }
.menu-item {
  display: flex; align-items: center; gap: 9px; padding: 9px 12px; border-radius: 8px;
  cursor: pointer; margin-bottom: 2px; transition: .15s; white-space: nowrap;
}
.menu-item:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.menu-item.active { background: var(--primary); color: #fff; box-shadow: 0 4px 12px rgba(22, 119, 255, .35); }
.menu-item .icon { width: 18px; text-align: center; font-size: 15px; }
.menu-item .badge {
    margin-left: auto; background: var(--danger); color: #fff; font-size: 11px; padding: 1px 6px;
    border-radius: 10px; min-width: 18px; text-align: center;
  }

  /* 可展开父项 + 缩进子菜单 */
  .menu-item .arrow {
    margin-left: auto; font-size: 11px; color: #64748b; transition: transform .18s;
  }
  .menu-item .arrow.open { transform: rotate(90deg); }
  .menu-parent.parent-active > .menu-item { color: #fff; }
  .menu-sub { margin: 2px 0 6px; padding-left: 14px; border-left: 1px solid rgba(255,255,255,.1); }
  .menu-sub .menu-item { padding: 7px 12px; font-size: 13px; color: #a9b6c8; }
  .menu-sub .menu-item .icon { font-size: 13px; }

/* min-height: 0 必须保留：手机端 .app 变 column 后，flex:1 的 min-height 默认 auto 会被长内容撑开，
   导致 .content 不产生滚动条、整页也无法下滑（表现为「开单页不能下拉」） */
.main { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.header {
  height: var(--head-h); flex: 0 0 var(--head-h); background: #fff; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px; padding: 0 16px; box-shadow: var(--shadow); z-index: 5;
}
.header .title { font-size: 16px; font-weight: 600; }
.header .spacer { flex: 1; }
.user-chip {
  display: flex; align-items: center; gap: 8px; padding: 4px 10px; border-radius: 20px;
  background: var(--primary-soft); color: var(--primary-dark); cursor: pointer; font-size: 13px;
}
.content { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 14px; -webkit-overflow-scrolling: touch; }
.content::-webkit-scrollbar { width: 8px; height: 8px; }
.content::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 8px; }

/* ---------- 通用组件 ---------- */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 14px; overflow: hidden; }
.card-head {
  padding: 12px 14px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--border); flex-wrap: wrap;
}
.card-head h3 { margin: 0; font-size: 15px; font-weight: 600; }
.card-body { padding: 14px; }
.card-body.no-pad { padding: 0; }

.btn {
  display: inline-flex; align-items: center; gap: 5px; padding: 7px 14px; border-radius: 8px; border: 1px solid var(--border);
  background: #fff; color: var(--text); cursor: pointer; transition: .15s; white-space: nowrap; font-size: 13px;
}
.btn:hover { border-color: var(--primary); color: var(--primary); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }
.btn-danger { background: #fff; border-color: #fecaca; color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-warn { background: var(--warning); border-color: var(--warning); color: #fff; }
.btn-warn:hover { color: #fff; filter: brightness(.95); }
.btn-success { background: #16a34a; border-color: #16a34a; color: #fff; }
.btn-success:hover { background: #15803d; border-color: #15803d; color: #fff; }
.btn-info { background: #2563eb; border-color: #2563eb; color: #fff; }
.btn-info:hover { background: #1d4ed8; border-color: #1d4ed8; color: #fff; }
/* 橘红色按钮：工程项目「详情」这类需要一眼找到的主操作 */
.btn-orange { background: #ff5722; border-color: #ff5722; color: #fff; }
.btn-orange:hover { background: #e64a19; border-color: #e64a19; color: #fff; }

/* ---------- 工程项目详情页 ---------- */
.pd-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.pd-stat { background: #f8fafc; border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; }
.pd-stat .v { font-size: 17px; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; }
.pd-bill { border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; margin-bottom: 10px; }
.pd-bill:last-child { margin-bottom: 0; }
.pd-bill-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }

/* ---------- 单据附件（识别截图留档） ---------- */
.od-attach-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 12px; background: #f8fafc; border: 1px solid var(--border); border-radius: 8px 8px 0 0; }
.attach-grid { display: flex; flex-wrap: wrap; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-top: 0; border-radius: 0 0 8px 8px; }
.attach-item { width: 168px; border: 1px solid var(--border); border-radius: 8px; padding: 6px; background: #fff; }
.attach-item img { width: 100%; height: 118px; object-fit: cover; border-radius: 6px; cursor: zoom-in; background: #f1f5f9; display: block; }
.attach-item .meta { display: flex; flex-direction: column; margin: 6px 2px 2px; }
.attach-item .nm { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attach-item .btn { margin-top: 6px; width: 100%; }
.attach-view { position: fixed; inset: 0; z-index: 3000; background: rgba(15, 23, 42, .82); display: flex; align-items: center; justify-content: center; padding: 24px; cursor: zoom-out; }
.attach-view img { max-width: 100%; max-height: 100%; border-radius: 8px; box-shadow: var(--shadow-lg); }

/* ---------- 选择商品 / 选择客户 弹窗 ---------- */
.pick-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.pick-body { display: flex; gap: 10px; padding: 10px 0; min-height: 300px; }
.pick-tree {
  flex: 0 0 168px; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
  display: flex; flex-direction: column; background: #fbfdff;
}
.pick-tree.collapsed { flex: 0 0 34px; }
.pick-tree.collapsed #pkTreeList { display: none; }
.pick-tree.collapsed .tree-tool .small { display: none; }
.tree-tool { display: flex; align-items: center; justify-content: space-between; padding: 6px 8px; border-bottom: 1px solid var(--border); }
#pkTreeList { overflow-y: auto; max-height: 44vh; padding: 4px; }
.tree-node { padding: 6px 8px; border-radius: 6px; font-size: 13px; cursor: pointer; display: flex; align-items: center; gap: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tree-node:hover { background: var(--primary-soft); }
.tree-node.active { background: var(--primary); color: #fff; }
.tree-node .ti { font-size: 12px; }
.pick-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.pick-table td { vertical-align: middle; }
.pick-table tr.row-picked { background: var(--primary-soft); }
.pick-pager { border-top: 1px solid var(--border); padding-top: 8px; }
.pick-foot { display: flex; align-items: center; gap: 8px; padding-top: 10px; border-top: 1px solid var(--border); }

/* ---------- 订单详情弹窗（便于截图发客户） ---------- */
.od-wrap { background: #fff; }
.od-title { text-align: center; font-size: 17px; font-weight: 700; letter-spacing: 1px; padding: 4px 0 12px; }
.od-info { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 6px 18px; padding: 10px 12px; background: #f8fafc; border-radius: var(--radius); font-size: 13px; }
.od-info > div { display: flex; gap: 8px; }
.od-info span { color: var(--text-sub); flex: 0 0 62px; }
.od-info b { font-weight: 600; word-break: break-all; }
.od-table { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 13px; }
.od-table th { background: #f1f5f9; border: 1px solid var(--border); padding: 7px 6px; font-weight: 600; white-space: nowrap; }
.od-table td { border: 1px solid var(--border); padding: 7px 6px; vertical-align: top; height: auto; line-height: 1.5; }
/* 这两张表不带 .grid，对齐要单独写，否则 class="center/right" 无效（全部按左对齐渲染） */
.od-table td.center, .od-table th.center { text-align: center; }
.od-table td.right, .od-table th.right { text-align: right; }
.od-total { display: flex; flex-wrap: wrap; gap: 20px; padding: 10px 12px; margin-top: 10px; background: #f8fafc; border-radius: var(--radius); font-size: 13px; }
.od-total .hl { color: var(--danger); font-weight: 700; }
.od-remark { margin-top: 8px; padding: 8px 12px; font-size: 13px; color: var(--text-sub); border-left: 3px solid var(--primary); background: var(--primary-soft); border-radius: 4px; }
.btn-sm { padding: 4px 9px; font-size: 12px; border-radius: 6px; }
.btn-lg { padding: 10px 20px; font-size: 15px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.input, .select {
  padding: 7px 10px; border: 1px solid var(--border); border-radius: 8px; background: #fff; outline: none; min-width: 0;
}
.input:focus, .select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(22, 119, 255, .12); }
.field { display: flex; flex-direction: column; gap: 4px; }
.field label { font-size: 12px; color: var(--text-sub); }
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.search-input { min-width: 180px; }

table.grid { width: 100%; border-collapse: collapse; font-size: 13px; }
table.grid th {
  background: #f8fafc; text-align: left; padding: 10px 12px; font-weight: 600; color: #475569;
  border-bottom: 1px solid var(--border); white-space: nowrap; position: sticky; top: 0; z-index: 1;
}
table.grid td { padding: 9px 12px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
table.grid tbody tr:hover { background: #f8fafc; }
table.grid td.right, table.grid th.right { text-align: right; }
table.grid td.center, table.grid th.center { text-align: center; }
.table-wrap { overflow: auto; max-height: calc(100vh - 260px); }
.table-wrap::-webkit-scrollbar { width: 8px; height: 8px; }
.table-wrap::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 8px; }

.tag {
  display: inline-block; padding: 2px 8px; border-radius: 12px; font-size: 12px; line-height: 18px;
  background: #f1f5f9; color: #475569; white-space: nowrap;
}
.tag-green { background: #dcfce7; color: #15803d; }
.tag-red { background: #fee2e2; color: #b91c1c; }
.tag-orange { background: #ffedd5; color: #c2410c; }
.tag-blue { background: var(--primary-soft); color: var(--primary-dark); }
.tag-gray { background: #f1f5f9; color: #64748b; }

.stat-card { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }
.stat-card .label { font-size: 12px; color: var(--text-sub); display: flex; align-items: center; gap: 6px; }
.stat-card .value { font-size: 22px; font-weight: 700; letter-spacing: .5px; }
.stat-card .sub { font-size: 12px; color: var(--text-sub); }
.grid-stat { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); margin-bottom: 14px; }

.pagination { display: flex; gap: 6px; align-items: center; justify-content: flex-end; padding: 10px 14px; }
.pagination button { min-width: 32px; }

.modal-mask {
  position: fixed; inset: 0; background: rgba(15, 23, 42, .45); display: flex; align-items: center; justify-content: center;
  z-index: 1000; padding: 16px; animation: fade .15s ease;
}
.modal {
  background: #fff; border-radius: 12px; box-shadow: var(--shadow-lg); width: 620px; max-width: 100%;
  max-height: 92vh; display: flex; flex-direction: column; animation: pop .18s ease;
}
@keyframes fade { from { opacity: 0 } }
@keyframes pop { from { transform: translateY(12px); opacity: 0 } }
.modal-head { padding: 14px 16px; border-bottom: 1px solid var(--border); display: flex; align-items: center; }
.modal-head h4 { margin: 0; font-size: 15px; flex: 1; }
.modal-body { padding: 16px; overflow: auto; }

  /* 查看弹窗按 A4 纸张显示：794px 宽（210mm @96dpi）+ 页边距 + 纸张阴影，
     与点「打印」出来的那张纸同一版式，不再被弹窗拉成宽屏表格 */
  .print-sheet { background: #e9ecef; margin: -16px; padding: 18px 12px; display: flex; justify-content: center; }
  .print-preview {
    background: #fff; color: #111;
    width: 794px; max-width: 100%; min-height: 980px; box-sizing: border-box;
    padding: 30px; border-radius: 2px; flex: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .18), 0 10px 26px rgba(0, 0, 0, .12);
  }
  .print-preview .print-title { text-align: center; font-size: 18px; font-weight: 700; margin: 4px 0; }
  .print-preview .print-head { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 6px; gap: 12px; flex-wrap: wrap; }
  .print-preview .print-table { width: 100%; border-collapse: collapse; font-size: 12px; }
  .print-preview .print-table th, .print-preview .print-table td { border: 1px solid #333; padding: 4px 6px; }
  .print-preview .print-quote { table-layout: fixed; font-size: 10.5px; }
  .print-preview .print-quote th, .print-preview .print-quote td { padding: 3px 4px; word-break: break-all; }
  /* 表头不逐字竖排、金额不断开（列宽已按 12.5px 字号留够） */
  .print-preview .print-quote th, .print-preview .print-quote td.right { white-space: nowrap; }
  .print-preview .print-quote td.params { font-size: 9.5px; line-height: 1.35; }
  .print-preview .print-quote tr.blank td { height: 22px; }
  .print-preview .print-terms { margin-top: 8px; font-size: 12px; line-height: 1.9; }
  .print-preview .print-sign { display: flex; justify-content: space-between; margin-top: 26px; font-size: 12px; gap: 10px; flex-wrap: wrap; }
  .print-preview .center { text-align: center; }
  .print-preview .right { text-align: right; }
  .print-preview .sub { color: #666; }
  /* 工程报价单整张纸的字号比通用打印件大 2 号（明细 10.5 → 12.5、参数 9.5 → 11.5），
     客户拿到手不用凑近看；销售单 / 入库单等其他打印件不受影响 */
  .print-preview .quote-sheet .print-title { font-size: 20px; }
  .print-preview .quote-sheet .print-head { font-size: 14px; }
  .print-preview .quote-sheet .print-terms { font-size: 14px; }
  .print-preview .quote-sheet .print-sign { font-size: 14px; }
  .print-preview .quote-sheet .print-quote { font-size: 12.5px; }
  .print-preview .quote-sheet .print-quote td.params { font-size: 11.5px; }
.modal-foot { padding: 12px 16px; border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; }
.close-x { cursor: pointer; font-size: 18px; color: var(--text-sub); padding: 0 4px; }

.toast-wrap { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 2000; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  padding: 9px 16px; border-radius: 8px; background: #1f2937; color: #fff; font-size: 13px; box-shadow: var(--shadow-lg);
  animation: pop .18s ease;
}
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
.toast.warn { background: var(--warning); }

.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.form-grid .full { grid-column: 1 / -1; }

/* 商品多型号行：型号输入框加长约一倍（默认约 170px → 360px）；手机上自动撑满整行 */
.model-row { display: flex; gap: 6px; align-items: center; margin-bottom: 6px; }
.model-row .input { flex: 1 1 auto; min-width: 0; max-width: 360px; }

/* ---------- 新增 / 编辑商品（规格建档） ---------- */
.pd-head { display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.pd-fields { display: flex; gap: 12px; flex-wrap: wrap; flex: 1; min-width: 300px; }
.pd-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.pd-sub { display: flex; gap: 16px; align-items: flex-end; flex-wrap: wrap; padding: 12px 0; border-bottom: 1px solid var(--border); }
.pd-inline { display: flex; gap: 6px; align-items: center; height: 34px; }
.pd-chk { display: flex; align-items: center; gap: 6px; font-size: 13px; height: 34px; cursor: pointer; white-space: nowrap; }
.pd-tabs { display: flex; gap: 20px; border-bottom: 1px solid var(--border); margin-top: 12px; }
.pd-tab { padding: 9px 2px; font-size: 14px; color: var(--text-sub); cursor: pointer; border-bottom: 2px solid transparent; }
.pd-tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.pd-specbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 10px 0; }
.pd-spec-wrap { overflow: auto; max-height: 52vh; border: 1px solid var(--border); border-radius: 8px; }
/* 固定列宽：各列严格按表头 width 渲染（否则浏览器会把「单位」这类指定了小宽度的列均摊撑开）。
   宽度填满弹窗，多出来的空间按比例摊给各列；min-width 保底，窗口更窄时横向滚动而不是挤扁。
   注意：min-width 必须等于 goods.js 里 SPEC_COLS 各列 width 之和 + 序号 46 + 操作 56 */
.pd-spec-wrap table.grid { width: 100%; min-width: 1010px; table-layout: fixed; }
.pd-spec td { padding: 5px 6px; }
/* 输入框撑满单元格：否则文本框按浏览器默认宽度渲染，会与固定列宽不一致（或撑出格） */
.pd-spec .input, .pd-spec .select { width: 100%; padding: 5px 7px; font-size: 13px; }
.pd-num { width: 100%; }
.pd-wh { width: 100%; }
/* 单位：常用单位下拉（比纯文本框窄很多，避免被浏览器默认宽度撑长） */
.pd-spec td[data-col="unit"] { padding: 5px 2px; }
.pd-spec .pd-unit { width: 100%; padding: 5px 0 5px 6px; font-size: 13px; }
.pd-ro { background: #f8fafc; color: #64748b; }
.pd-del { color: var(--danger); cursor: pointer; font-size: 13px; }
/* ⚙ 设置 → 独立弹窗里的列勾选列表 */
.pd-colset { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px 12px; }
.pd-optc { display: flex; align-items: center; gap: 6px; font-size: 13px; white-space: nowrap; cursor: pointer; }

.empty { padding: 40px 16px; text-align: center; color: var(--text-sub); }
.empty .big { font-size: 34px; opacity: .35; }

.alert { padding: 10px 12px; border-radius: 8px; margin-bottom: 10px; display: flex; gap: 10px; align-items: flex-start; }
.alert-danger { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }
.alert-warn { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }
.alert-info { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e40af; }
.alert-success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; }
.alert .t { font-weight: 600; flex: 1; }
.alert .c { font-weight: 700; }

.chart-bars { display: flex; align-items: flex-end; gap: 3px; height: 130px; padding: 8px 0; }
.chart-bars .bar-wrap { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; }
.chart-bars .bar { width: 100%; background: linear-gradient(180deg, #60a5fa, #1677ff); border-radius: 3px 3px 0 0; min-height: 2px; }
.chart-bars .lbl { font-size: 9px; color: var(--text-sub); }

/* 监控台布局：趋势图 1.6 : 右侧面板 1；窄屏（含手机）自动变单列，避免卡片被挤出屏幕 */
.dash-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 12px; align-items: start; }
@media (max-width: 1100px) { .dash-grid { grid-template-columns: 1fr; } }

.item-line { display: flex; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px dashed var(--border); }
.qty-stepper { display: flex; align-items: center; }
.qty-stepper button { width: 28px; height: 28px; }

/* 金额/数字 */
.money { font-variant-numeric: tabular-nums; }
.red { color: var(--danger); }
.green { color: var(--success); }
.blue { color: var(--primary); }
.orange { color: #d98324; }
.sub { color: var(--text-sub); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }
.flex-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ---------- 登录（企业级 · 高端版） ---------- */
.login-page { position: relative; min-height: 100vh; display: grid; grid-template-columns: 1.06fr .94fr; background: #04070f; color: #e8f2ff; overflow: hidden; }
.login-bg { position: absolute; inset: 0; background: url('../assets/login-bg.jpg') center/cover no-repeat; opacity: .62; transform: scale(1.03); }
.login-bg::after {
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(1100px 620px at 18% 28%, rgba(22, 119, 255, .38), transparent 62%),
    radial-gradient(760px 520px at 88% 82%, rgba(54, 207, 201, .22), transparent 65%),
    linear-gradient(115deg, rgba(3, 7, 18, .95) 0%, rgba(3, 7, 18, .82) 42%, rgba(3, 7, 18, .58) 100%);
}
.login-grid {
  position: absolute; inset: 0; opacity: .3;
  background-image: linear-gradient(rgba(93, 160, 255, .12) 1px, transparent 1px), linear-gradient(90deg, rgba(93, 160, 255, .12) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(900px 520px at 30% 40%, #000 40%, transparent 85%);
  mask-image: radial-gradient(900px 520px at 30% 40%, #000 40%, transparent 85%);
}
.login-brand { position: relative; z-index: 2; padding: 6vh 5vw; display: flex; flex-direction: column; justify-content: center; gap: 22px; }
.login-logo { display: flex; align-items: center; gap: 12px; }
.login-logo .mark { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 22px; background: linear-gradient(135deg, #1677ff, #36cfc9); box-shadow: 0 10px 30px rgba(22, 119, 255, .45); }
.login-brand h1 { margin: 0; font-size: 27px; font-weight: 700; letter-spacing: .5px; }
.login-brand .sub { color: #9fb6d6; font-size: 12px; margin-top: 6px; letter-spacing: 3px; }
.login-brand .headline { font-size: 33px; line-height: 1.4; font-weight: 700; max-width: 560px; }
.login-brand .headline em { font-style: normal; background: linear-gradient(90deg, #6fb6ff, #43e6d0); -webkit-background-clip: text; background-clip: text; color: transparent; }
.login-brand .desc { color: #a9bdd9; font-size: 14px; line-height: 1.9; max-width: 540px; }
.login-feats { display: flex; flex-wrap: wrap; gap: 10px; max-width: 580px; }
.login-feats .feat { display: flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 10px; font-size: 13px; color: #cfe1ff; background: rgba(255, 255, 255, .05); border: 1px solid rgba(120, 180, 255, .16); }
.login-side { position: relative; z-index: 2; display: grid; place-items: center; padding: 5vh 4vw; }
.login-card {
  width: min(420px, 100%); padding: 32px 30px 24px; border-radius: 20px;
  background: rgba(11, 18, 34, .76); border: 1px solid rgba(122, 178, 255, .2);
  backdrop-filter: blur(20px); box-shadow: 0 30px 90px rgba(0, 0, 0, .6), inset 0 1px 0 rgba(255, 255, 255, .06);
}
.login-card h2 { margin: 0 0 4px; font-size: 21px; }
.login-card .tip { margin: 0 0 22px; color: #93a9c9; font-size: 13px; }
.login-card .field { margin-bottom: 14px; }
.login-card label { color: #b9cbe6; font-size: 12px; }
.login-card .input { width: 100%; padding: 12px 13px; border-radius: 10px; font-size: 14px; background: rgba(255, 255, 255, .055); border: 1px solid rgba(140, 190, 255, .2); color: #ecf4ff; }
.login-card .input::placeholder { color: #6f86a6; }
.login-card .input:focus { outline: none; border-color: #3d8bff; background: rgba(255, 255, 255, .09); box-shadow: 0 0 0 3px rgba(22, 119, 255, .16); }
.login-card .row { display: flex; align-items: center; justify-content: space-between; margin: 4px 0 16px; font-size: 12px; color: #93a9c9; }
.login-card .row label { display: flex; align-items: center; gap: 6px; color: #93a9c9; }
.login-btn { width: 100%; justify-content: center; padding: 13px 16px; font-size: 15px; letter-spacing: 6px; border-radius: 11px; background: linear-gradient(135deg, #1677ff, #36cfc9); border: none; color: #fff; font-weight: 600; cursor: pointer; box-shadow: 0 14px 34px rgba(22, 119, 255, .38); transition: .18s; }
.login-btn:hover { filter: brightness(1.06); transform: translateY(-1px); }
.login-btn:disabled { opacity: .75; cursor: not-allowed; transform: none; }
.login-alert { display: none; margin-bottom: 14px; padding: 10px 12px; border-radius: 10px; font-size: 13px; background: rgba(255, 77, 79, .14); border: 1px solid rgba(255, 77, 79, .38); color: #ffb3b3; }
.login-company { display: none; align-items: center; gap: 10px; margin: -6px 0 14px; padding: 10px 12px; border-radius: 10px; background: rgba(54, 207, 201, .1); border: 1px solid rgba(54, 207, 201, .3); color: #9ff0e8; font-size: 13px; }
.login-foot { margin-top: 16px; font-size: 12px; color: #7e93b2; text-align: center; line-height: 1.9; }
.login-icp { margin-top: 8px; font-size: 11.5px; color: #7f96b6; letter-spacing: .2px; }
.login-icp:empty { display: none; }
.login-icp .icp-link { color: #93aecf; }
.login-icp .icp-link:hover { color: #8fc4ff; text-decoration: underline; }
.login-platform-link { margin-top: 10px; text-align: center; font-size: 12px; color: #7e93b2; }
.login-platform-link a { color: #6fb6ff; cursor: pointer; }
.login-loading { display: inline-block; width: 13px; height: 13px; border: 2px solid rgba(255, 255, 255, .35); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; vertical-align: -2px; margin-right: 8px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 公司标识 / 到期提醒 ---------- */.brand-tenant { display: flex; align-items: center; gap: 8px; padding: 8px 10px; margin: 2px 8px 8px; border-radius: 10px; background: rgba(22, 119, 255, .08); border: 1px solid rgba(22, 119, 255, .18); }
.brand-tenant .logo { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; font-size: 14px; background: linear-gradient(135deg, #1677ff, #36cfc9); color: #fff; flex: 0 0 auto; overflow: hidden; }
.brand-tenant .logo img { width: 100%; height: 100%; object-fit: cover; }
.brand-tenant .meta { min-width: 0; }
.brand-tenant .meta b { display: block; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-tenant .meta span { font-size: 11px; color: var(--text-sub); }
/* 顶部横幅（平台公告 / 服务到期提醒）：标题与正文上下排列、左对齐，正文过长可滚动 */
  .tenant-banner { margin-bottom: 12px; align-items: flex-start; }
  .tenant-banner .tb-body { flex: 1; min-width: 0; text-align: left; }
  .tenant-banner .tb-title { font-size: 17px; font-weight: 600; line-height: 1.5; text-align: left; }
  /* 公告发布时间：跟在标题右侧，弱化处理 */
  .tenant-banner .tb-time { margin-left: 10px; font-size: 12.5px; font-weight: 400; color: #7a8798; }
  /* 公告正文：红字醒目（各级别底色都是浅色，红色可读） */
  .tenant-banner .tb-text {
    margin-top: 6px; font-size: 15px; line-height: 1.75; text-align: left;
    color: #c62828;
    white-space: pre-wrap; word-break: break-word;
    max-height: 150px; overflow-y: auto; padding-right: 6px;
  }
  /* 正文滚动条收细一点，不抢视觉 */
  .tenant-banner .tb-text::-webkit-scrollbar { width: 6px; }
  .tenant-banner .tb-text::-webkit-scrollbar-thumb { background: rgba(0,0,0,.22); border-radius: 3px; }
  .tenant-banner .tb-text::-webkit-scrollbar-track { background: transparent; }

@media (max-width: 980px) {
  .login-page { grid-template-columns: 1fr; }
  .login-brand { display: none; }
  .login-side { padding: 6vh 5vw; }
  .login-card { padding: 26px 22px 20px; }
}


/* ---------- 移动端 ---------- */
.tabbar { display: none; }
.mask-layer { display: none; }

@media (max-width: 900px) {
  .app { flex-direction: column; }
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; width: 240px; z-index: 50; transform: translateX(-100%); transition: .22s;
    box-shadow: var(--shadow-lg);
  }
  .sidebar.open { transform: none; }
  .mask-layer {
    display: block; position: fixed; inset: 0; background: rgba(15, 23, 42, .4); z-index: 40; opacity: 0; pointer-events: none; transition: .2s;
  }
  .mask-layer.show { opacity: 1; pointer-events: auto; }
  .content { padding: 10px 10px 70px; }
  .table-wrap { max-height: none; }
  .grid-stat { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .stat-card { padding: 10px 12px; }
  .stat-card .value { font-size: 18px; }
  .card-head { padding: 10px; }
  .header { padding: 0 10px; }
  .btn { padding: 6px 11px; font-size: 13px; }
  .form-grid { grid-template-columns: 1fr; }
  .search-input { min-width: 120px; flex: 1; }
  .modal { width: 100%; max-height: 90vh; }
  .tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; background: #fff; border-top: 1px solid var(--border);
    z-index: 30; padding: 4px 0 calc(4px + env(safe-area-inset-bottom));
  }
  .tabbar .tab { flex: 1; text-align: center; font-size: 11px; color: var(--text-sub); padding: 4px 0; cursor: pointer; }
  .tabbar .tab.active { color: var(--primary); }
  .tabbar .tab .ti { font-size: 18px; display: block; }
  .hide-sm { display: none !important; }

  /* ☰ 菜单按钮在手机上必须可见，否则侧边栏里的功能（商品/客户/财务/系统设置…）无法进入 */
  #btnMenu { display: inline-flex !important; align-items: center; }
  /* 标题过长时不挤压右侧按钮 */
  .header .title { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  /* 抽屉菜单适配小屏 */
  .sidebar { width: min(240px, 78vw); }

  /* 趋势图：柱子压缩铺满屏幕，日期标签每 5 根标一次，避免溢出与重叠 */
  .chart-bars { gap: 2px; }
  .chart-bars .bar-wrap { min-width: 0; }
  .chart-bars .lbl { display: none; }
  .chart-bars .bar-wrap:nth-child(5n + 1) .lbl { display: block; font-size: 8px; white-space: nowrap; }

  /* 表格：保留横向滚动，触摸更顺滑 */
  .table-wrap { -webkit-overflow-scrolling: touch; }
}

/* ---------- 开单 ---------- */
.bill-wrap { display: grid; grid-template-columns: 1fr 340px; gap: 12px; align-items: start; }
@media (max-width: 1100px) { .bill-wrap { grid-template-columns: 1fr; } }
.bill-items td { padding: 6px 8px; }
/* 明细里的数量/单价输入框：列变窄后收内边距，数字居中/右对齐，并隐藏上下箭头占位 */
.bill-items .it-qty { padding: 6px 3px; text-align: center; }
.bill-items .it-price { padding: 6px 4px; text-align: right; }
.bill-items input[type='number']::-webkit-outer-spin-button,
.bill-items input[type='number']::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.bill-items input[type='number'] { -moz-appearance: textfield; appearance: textfield; }
.bill-item-row input { width: 100%; }
.summary-box { position: sticky; top: 8px; }
.sum-row { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px dashed var(--border); }
.sum-row.total { border: none; font-size: 19px; font-weight: 700; color: var(--danger); padding-top: 10px; }

/* ---------- 售后返修：商品明细表（单位窄下拉 + 故障描述加宽） ---------- */
/* 固定列宽：各列严格按表头 width 渲染，多出的宽度给「商品名称」，否则单位列会被压到只剩十几像素 */
.as-items { table-layout: fixed; }
.as-items td { padding: 6px 5px; }
.as-items .as-unit { width: 100%; padding: 5px 2px; font-size: 12.5px; }
.as-items .as-qty { width: 100%; padding: 5px 4px; }
.as-items .as-remark { width: 100%; padding: 5px 7px; }

/* ---------- 智能采购：单据截图识别 ---------- */
.sp-zone {
  border: 2px dashed var(--border); border-radius: 12px; padding: 26px 16px; text-align: center;
  cursor: pointer; transition: .15s; background: #fbfdff; color: var(--text-sub);
}
.sp-zone .big { font-size: 30px; margin-bottom: 6px; }
.sp-zone:hover, .sp-zone-hot { border-color: var(--primary); background: var(--primary-soft); color: var(--text); }
.sp-preview { display: flex; gap: 14px; align-items: flex-start; margin-top: 12px; }
.sp-preview img { max-width: 330px; max-height: 230px; border: 1px solid var(--border); border-radius: 8px; object-fit: contain; background: #fff; }
.sp-preview .meta { display: flex; flex-direction: column; gap: 6px; }
/* 核对表：固定列宽，数量/单价等输入框撑满单元格 */
.sp-table { table-layout: fixed; }
  .sp-table th, .sp-table td { padding: 6px 8px; }
  .sp-table .input, .sp-table .select { width: 100%; padding: 5px 7px; font-size: 13px; }
  .sp-table select.sp-prod { font-size: 12.5px; }
  /* 匹配下拉与数量/单价输入框：定宽定高，超长文本省略，保证各行对齐不跳动 */
  .sp-table select.sp-prod { width: 100%; height: 30px; text-overflow: ellipsis; }
  .sp-table .sp-qty, .sp-table .sp-price { width: 100%; height: 30px; text-align: center; }
  .sp-table .sp-unit { width: 100%; height: 30px; text-align: center; padding: 5px 2px; }
  .sp-table td > b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .sp-table td > .small.sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  /* 名称 / 规格 输入框：与数量等控件同高，超长文本不撑破单元格 */
  .sp-table .sp-name, .sp-table .sp-spec { width: 100%; height: 30px; }
  /* 名称 ⇄ 规格 互换按钮：窄列里也要能一眼看到 */
  .sp-table .sp-swap { width: 100%; padding: 4px 0; font-size: 14px; line-height: 1; }
  .sp-swap:hover { border-color: var(--primary); color: var(--primary); }

/* 智能采购③ 结算条：付款金额 / 付款账户 / 本次欠款 */
.sp-settle {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 20px;
  margin-top: 12px; padding: 12px 14px;
  border: 1px solid var(--border); border-radius: 10px; background: #fbfdff;
}
.sp-settle .sp-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.sp-settle .sp-field > label { font-size: 12.5px; color: var(--text-sub); }
.sp-settle .sp-debt { height: 34px; display: flex; align-items: center; font-size: 18px; font-weight: 700; }
.sp-settle .sp-hint {
  flex: 1 1 240px; min-width: 0; padding-bottom: 8px;
  font-size: 12px; line-height: 1.6; color: var(--text-sub);
}
@media (max-width: 640px) {
  .sp-settle .sp-field, .sp-settle .sp-hint { flex: 1 1 100%; }
}

/* ---------- 工程报价单 ---------- */
/* 顶部字段固定两行：① 报价主题/单号/日期/单据状态/有效期 ② 客户单位/联系人/电话/项目/地址
   窄屏降 2 列 / 1 列，避免字段被挤成一小截 */
.q-page .q-grid { display: grid; gap: 12px 14px; }
.q-page .q-grid-1 { grid-template-columns: 1.6fr 1fr 1fr 1fr 1fr; }
.q-page .q-grid-2 { grid-template-columns: 1.5fr 1fr 1.05fr 1.25fr 1.6fr; margin-top: 12px; }
.q-page .field > label { font-size: 12.5px; }
.q-page .hint { font-size: 11.5px; color: var(--text-sub); }
.q-page .hint.warn { color: #d97706; }
/* 报价页控件统一尺寸（其它页面不受影响） */
.q-page .input, .q-page .select { height: 36px; padding: 7px 11px; font-size: 13.5px; }
.q-page .input[readonly] { background: #f8fafc; color: var(--text-sub); }
/* 报价说明的文本框撑满卡片：textarea 默认按 cols 定宽，会明显比卡片窄一截 */
.q-page textarea.input { width: 100%; height: auto; display: block; resize: vertical; }
.q-page .pill { padding: 2px 9px; border-radius: 999px; background: #eff6ff; color: var(--primary); font-size: 12px; }
@media (max-width: 1180px) {
  .q-page .q-grid-1, .q-page .q-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .q-page .q-grid-1, .q-page .q-grid-2 { grid-template-columns: 1fr; }
}

/* 明细表：固定列宽，输入框撑满单元格；总宽兜底，窄屏改成横向滚动而不是把控件压扁 */
.q-table { table-layout: fixed; min-width: 1080px; }
.q-table th { padding: 9px 8px; font-size: 12.5px; }
.q-table td { padding: 8px; vertical-align: top; }
.q-table tr.blank td { height: 34px; }
.q-table .input, .q-table .select { width: 100%; height: 34px; padding: 6px 9px; font-size: 13px; }
.q-table textarea.input { height: auto; min-height: 64px; resize: vertical; line-height: 1.45; font-family: inherit; }
.q-table .q-qty { text-align: center; }
.q-table td.money { vertical-align: middle; }
.q-table tfoot td { background: #fafcff; vertical-align: middle; }
.q-table .row-ops { display: flex; gap: 4px; justify-content: center; }
.q-table tbody tr:hover { background: #f8fbff; }

/* 施工单价列开关：一行说明 + 勾选框，放在明细表上方 */
.q-switch {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  margin-bottom: 10px;
  border: 1px solid var(--bd, #e3e8ef);
  border-radius: 8px;
  background: #fafcff;
  cursor: pointer;
  user-select: none;
}
.q-switch input { width: 16px; height: 16px; cursor: pointer; flex: none; }
/* 四个列开关横排一行，放不下自动折行 */
.q-switches { display: flex; flex-wrap: wrap; gap: 8px; }
.q-switches .q-switch { flex: 1 1 200px; margin-bottom: 0; }
.q-switch span { font-size: 12.5px; color: var(--sub, #6b7280); line-height: 1.5; }
.q-switch span b { color: var(--fg, #1f2937); }

/* 金额卡：整宽，位于「报价明细」上方；卡内明细横向排列，一行 4 项 */
.q-sum { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 20px; }
.q-sum .row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  min-height: 40px; padding: 4px 0; border-bottom: 1px dashed var(--border);
}
.q-sum .row > span {
  flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--text-sub); font-size: 13px;
}
.q-sum .row > b { font-variant-numeric: tabular-nums; }
.q-sum .row .input { flex: 0 0 118px; width: 118px; height: 34px; text-align: right; }
.q-sum .row.sub-total { border-bottom: 1px solid var(--border); }
.q-sum .row.sub-total > span { color: var(--text); font-weight: 600; }
.q-sum .row.total { border-bottom: 0; padding: 4px 12px; background: var(--primary-soft); border-radius: 8px; }
.q-sum .row.total > span { font-size: 14px; color: var(--text); font-weight: 600; }
.q-sum .row.total b { font-size: 20px; color: var(--primary); }
.q-sum .cn { margin-top: 10px; font-size: 12.5px; color: var(--text-sub); line-height: 1.7; }
.q-sum .cn b { color: var(--text); }
@media (max-width: 1400px) {
  .q-sum { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .q-sum { grid-template-columns: 1fr; }
}

/* ---------- 打印 ---------- */
.print-area { display: none; }
/* 屏幕版基础样式（明细表 / 抬头 / 签字栏）：必须写在 @media print 之前。
   两者优先级相同，谁在后面谁赢；之前 13px 的屏幕规则盖掉了打印的 10.5px，
   结果打出来比查看弹窗大一号、10 列被挤变形。 */
.print-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.print-table th, .print-table td { border: 1px solid #333; padding: 5px 7px; }
.print-table td.center, .print-table th.center { text-align: center; }
.print-table td.right, .print-table th.right { text-align: right; }
.print-title { text-align: center; font-size: 19px; font-weight: 700; margin: 6px 0; }
.print-head { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 8px; }
.print-foot { margin-top: 24px; display: flex; justify-content: space-between; font-size: 13px; }

/* ---------- 批量新增往来单位（一行一个名称） ---------- */
.batch-new { display: flex; flex-direction: column; gap: 10px; }
.batch-new textarea.input { width: 100%; resize: vertical; line-height: 1.7; }
.bn-row { display: flex; gap: 14px; flex-wrap: wrap; align-items: flex-end; }
.bn-row .field { display: flex; align-items: center; gap: 6px; font-size: 13px; white-space: nowrap; }
.bn-row .field .input { width: auto; min-width: 90px; }
@media print {
  /* A4 + 8mm 页边距 → 正文宽约 194mm ≈ 733px，与查看弹窗那张 794px 纸的内宽一致，
     两边列宽和字号才对得上（查看看到什么，打出来就是什么） */
  @page { size: A4; margin: 8mm; }
  body * { visibility: hidden !important; }
  .print-area, .print-area * { visibility: visible !important; }
  .print-area { display: block; position: absolute; left: 0; top: 0; width: 100%; }
  .print-table { width: 100%; border-collapse: collapse; font-size: 12px; }
  .print-table th, .print-table td { border: 1px solid #333; padding: 4px 6px; }
  /* 工程报价单：10 列，A4 竖版。固定列宽 + 小字号，否则「参数」列会被挤没 */
  .print-quote { table-layout: fixed; font-size: 10.5px; }
  .print-quote th, .print-quote td { padding: 3px 4px; word-break: break-all; }
  .print-quote th, .print-quote td.right { white-space: nowrap; }
  .print-quote td.params { font-size: 9.5px; line-height: 1.35; }
  .print-quote tr.blank td { height: 22px; }
  /* 报价单：说明条款 + 签字栏 */
  .print-terms { margin-top: 8px; font-size: 12px; line-height: 1.9; }
  .print-sign { display: flex; justify-content: space-between; margin-top: 26px; font-size: 12px; }
  .print-title { text-align: center; font-size: 18px; font-weight: 700; margin: 4px 0; }
  .print-head { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 6px; }
  .print-foot { margin-top: 20px; display: flex; justify-content: space-between; font-size: 12px; }
  /* 工程报价单：出纸同样大 2 号，与查看弹窗那张纸保持一致 */
  .quote-sheet .print-title { font-size: 20px; }
  .quote-sheet .print-head { font-size: 14px; }
  .quote-sheet .print-terms { font-size: 14px; }
  .quote-sheet .print-sign { font-size: 14px; }
  .quote-sheet .print-quote { font-size: 12.5px; }
  .quote-sheet .print-quote td.params { font-size: 11.5px; }
}

/* ---------- 客户还款弹窗（按单核销 + 预充值抵扣） ---------- */
.pay-dialog { display: flex; flex-direction: column; gap: 12px; }
.pay-head { display: grid; grid-template-columns: 1.4fr 1fr .9fr 1fr; gap: 10px; }
.pay-head .field, .pay-toolbar .field { margin: 0; display: flex; flex-direction: column; gap: 4px; }
.pay-toolbar { display: flex; align-items: flex-end; gap: 10px; padding: 10px 12px; background: #f8fafc; border: 1px solid var(--border); border-radius: 10px; }
.pay-toolbar .field { width: 130px; }
.pay-prepay { font-size: 13px; color: var(--text-sub); white-space: nowrap; }
.pay-table input.input { padding: 5px 7px; font-size: 12.5px; width: 100%; }
.pay-table td { padding: 6px 8px; }
.pay-foot { display: flex; align-items: center; gap: 16px; padding: 10px 12px; border-top: 1px solid var(--border); font-size: 13.5px; flex-wrap: wrap; }
.pay-foot .grow { flex: 1; }
.pay-foot b { font-size: 15px; }
@media (max-width: 1100px) { .pay-head { grid-template-columns: 1fr 1fr; } .pay-toolbar { flex-wrap: wrap; } }

/* ---------- 监控台：本系统特色功能 ---------- */
.feat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.feat-tile {
  display: flex; gap: 10px; align-items: flex-start; padding: 12px; border-radius: 10px;
  border: 1px solid var(--border); background: linear-gradient(180deg, #f7fbff, #fff);
  text-decoration: none; color: inherit; transition: .18s;
}
.feat-tile:hover { border-color: #7cb0ff; box-shadow: 0 8px 20px rgba(22, 119, 255, .14); transform: translateY(-1px); }
.feat-tile .fi {
  width: 32px; height: 32px; flex: 0 0 32px; border-radius: 9px; display: grid; place-items: center;
  font-size: 16px; background: linear-gradient(135deg, #e8f1ff, #ddf5f2);
}
.feat-tile .ft { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 2px; }
.feat-tile .fd { font-size: 12px; color: var(--text-sub); line-height: 1.55; }
@media (max-width: 1400px) { .feat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1100px) { .feat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
