* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: "Microsoft YaHei", "PingFang SC", sans-serif; background: #f5f7fa; color: #333; font-size: 14px; }
a { color: #1867c0; text-decoration: none; }

/* ---------- 布局 ---------- */
.layout { display: flex; min-height: 100vh; }
.sidebar { width: 210px; background: #1e2a3a; color: #cfd8e3; flex-shrink: 0; display: flex; flex-direction: column; }
.sidebar .logo { padding: 18px 16px; font-size: 16px; font-weight: bold; color: #fff; border-bottom: 1px solid #2c3e50; }
.sidebar nav { flex: 1; padding: 8px 0; }
.sidebar nav a { display: block; padding: 12px 18px; color: #cfd8e3; }
.sidebar nav a:hover { background: #2c3e50; color: #fff; }
.sidebar nav a.active { background: #1867c0; color: #fff; }
.sidebar .userbox { padding: 14px 16px; border-top: 1px solid #2c3e50; font-size: 13px; }
.sidebar .userbox button { margin-top: 8px; }

/* ---------- 侧边栏折叠（图标模式） ---------- */
.sidebar { transition: width .2s ease; }
.sidebar-head { display: flex; align-items: center; justify-content: space-between; padding-right: 10px; }
.collapse-btn { background: none; border: none; color: #cfd8e3; font-size: 16px; cursor: pointer; padding: 6px; line-height: 1; }
.collapse-btn:hover { color: #fff; }
.sidebar.collapsed { width: 64px; }
.sidebar.collapsed .logo { display: none; }
.sidebar.collapsed .sidebar-head { justify-content: center; padding-right: 0; }
.sidebar.collapsed .nav-label { display: none; }
.sidebar.collapsed nav a { padding: 14px 0; text-align: center; font-size: 18px; }
.sidebar.collapsed .userbox { padding: 10px 0; text-align: center; }
.sidebar.collapsed .userbox .ub-full { display: none; }
.sidebar.collapsed .userbox .ub-mini { display: inline-block; }
.userbox .ub-mini { display: none; margin-top: 0; }
.main { flex: 1; padding: 20px; overflow: auto; }

/* ---------- 通用组件 ---------- */
.page-title { font-size: 18px; font-weight: bold; margin-bottom: 14px; }
.toolbar { display: flex; gap: 10px; margin-bottom: 14px; align-items: center; flex-wrap: wrap; }
.toolbar input[type=text] { padding: 7px 10px; border: 1px solid #d0d7de; border-radius: 4px; width: 240px; }
.btn { padding: 7px 16px; border: none; border-radius: 4px; cursor: pointer; background: #e7ecf1; color: #333; font-size: 13px; }
.btn:hover { opacity: .88; }
.btn-primary { background: #1867c0; color: #fff; }
.btn-danger { background: #d64541; color: #fff; }
.btn-warn { background: #e8a200; color: #fff; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
#import-bar { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; padding: 8px 10px; background: #f3f6fa; border: 1px dashed #cfd8e3; border-radius: 8px; }

.card { background: #fff; border-radius: 8px; padding: 16px; box-shadow: 0 1px 3px rgba(0,0,0,.06); }

table.grid { width: 100%; border-collapse: collapse; background: #fff; }
table.grid.grid-fixed { table-layout: fixed; }
table.grid th, table.grid td { border: 1px solid #e5e9f0; padding: 9px 10px; text-align: left; vertical-align: top; word-break: break-word; overflow-wrap: anywhere; }
table.grid th { background: #f0f4f8; font-weight: 600; white-space: nowrap; }
table.grid th .th-wrap { white-space: normal; display: inline-block; line-height: 1.3; }
table.grid th .th-wrap small { font-weight: 400; color: #5a6a7f; }
table.grid tr:hover td { background: #f8fafc; }
table.grid .filter-row td { background: #fafbfc; padding: 5px 6px; }
table.grid .filter-row input, table.grid .filter-row select { padding: 4px 6px; border: 1px solid #d0d7de; border-radius: 3px; font-size: 12px; }
.op-info { font-size: 12px; color: #888; white-space: nowrap; }
.op-under { display: block; font-size: 12px; color: #999; margin-bottom: 6px; }
.row-ops { display: flex; gap: 6px; flex-wrap: wrap; }
.empty { text-align: center; color: #999; padding: 30px 0; }
.tag { display: inline-block; padding: 2px 8px; border-radius: 3px; font-size: 12px; background: #eef3f8; color: #1867c0; }
.tag-warn { background: #fdf3e5; color: #c47b1a; }
.tag-green { background: #e6f4ea; color: #2e7d32; }
/* 物资库 保安/保洁 筛选 */
.mat-filter { display: inline-flex; gap: 4px; align-items: center; margin: 0 2px; }
.chip { padding: 5px 12px; font-size: 13px; border: 1px solid #d0d7de; background: #fff; border-radius: 14px; cursor: pointer; color: #444; }
.chip:hover { border-color: #1867c0; color: #1867c0; }
.chip.on { background: #1867c0; border-color: #1867c0; color: #fff; }

/* ---------- 弹窗表单 ---------- */
.modal-mask { position: fixed; inset: 0; background: rgba(0,0,0,.4); display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; overflow: auto; z-index: 99; }
.modal { background: #fff; border-radius: 8px; width: 680px; max-width: 100%; padding: 20px 24px; }
.modal h3 { margin-bottom: 16px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 18px; }
.form-item { display: flex; flex-direction: column; gap: 5px; }
.form-item.drag-over { outline: 2px dashed #1867c0; outline-offset: -4px; background: #eef5fd; border-radius: 6px; }
.form-item.full { grid-column: 1 / -1; }
.form-item label { font-size: 13px; color: #555; }
.form-item label .req { color: #d64541; }
.form-item input, .form-item select, .form-item textarea {
  padding: 9px 12px; border: 1px solid #d0d7de; border-radius: 4px; font-size: 14px; font-family: inherit; width: 100%; box-sizing: border-box;
}
.form-item .hint { font-size: 12px; color: #999; }
.form-actions { margin-top: 18px; text-align: right; display: flex; gap: 10px; justify-content: flex-end; }
.img-preview { display: flex; gap: 8px; flex-wrap: wrap; }
.img-preview a img { width: 64px; height: 64px; object-fit: cover; border: 1px solid #ddd; border-radius: 4px; }
.img-preview .rm { cursor: pointer; color: #d64541; font-size: 12px; }

/* ---------- 图片查看 ---------- */
#img-tip { position: fixed; z-index: 200; display: none; pointer-events: none;
  background: #fff; border: 1px solid #d0d7de; border-radius: 6px; padding: 4px;
  box-shadow: 0 4px 16px rgba(0,0,0,.18); }
#img-tip img { max-width: 260px; max-height: 260px; display: block; border-radius: 4px; }
.lightbox-mask { position: fixed; inset: 0; background: rgba(0,0,0,.75); z-index: 300;
  display: none; align-items: center; justify-content: center; padding: 30px; }
.lightbox-mask img { max-width: 92vw; max-height: 88vh; border-radius: 6px;
  box-shadow: 0 8px 40px rgba(0,0,0,.5); background: #fff; }
.lightbox-close { position: fixed; top: 18px; right: 24px; z-index: 301;
  background: #fff; color: #333; border: none; border-radius: 20px;
  padding: 8px 18px; font-size: 14px; cursor: pointer; box-shadow: 0 2px 10px rgba(0,0,0,.3); }
.lightbox-close:hover { background: #f0f4f8; }

/* ---------- 粘贴识别 ---------- */
.paste-box { border: 1px dashed #1867c0; border-radius: 8px; padding: 10px 12px; margin-bottom: 12px; background: #f5f9ff; }
.paste-box textarea { width: 100%; border: 1px solid #d0d7de; border-radius: 4px; padding: 7px 10px; font-size: 13px; font-family: inherit; }
.paste-box .hint { font-size: 12px; color: #888; margin-top: 4px; }

/* ---------- 登录页 / 首页 ---------- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg,#1e2a3a,#1867c0); }
.login-box { background: #fff; padding: 36px; border-radius: 10px; width: 360px; }
.login-box h2 { margin-bottom: 22px; text-align: center; }
.login-box .form-item { margin-bottom: 14px; }
.login-box .btn { width: 100%; padding: 10px; }
.err-msg { color: #d64541; font-size: 13px; min-height: 18px; margin-bottom: 8px; }

.dash-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.dash-card { background: #fff; border-radius: 10px; padding: 22px; box-shadow: 0 1px 4px rgba(0,0,0,.07); display: block; color: #333; transition: transform .15s; }
.dash-card:hover { transform: translateY(-3px); }
.dash-card .icon { font-size: 30px; }
.dash-card .name { font-weight: bold; margin: 10px 0 6px; font-size: 15px; }
.dash-card .desc { font-size: 12px; color: #888; line-height: 1.6; }

/* ---------- 登录框移动端兜底 ---------- */
.login-box { max-width: 92%; }

/* ---------- 顶栏（桌面默认显示；含「🔗分享」按钮，移动端抽屉样式见下方媒体查询） ---------- */
.topbar {
  display: flex; align-items: center; gap: 12px;
  background: #1e2a3a; color: #fff; padding: 10px 14px;
  position: sticky; top: 0; z-index: 50;
}
.sidebar-overlay { display: none; }

@media (max-width: 820px) {
  .layout { display: block; }
  /* 侧边栏改为抽屉，默认隐藏，点汉堡滑出 */
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 120;
    width: 240px; transform: translateX(-100%); transition: transform .25s ease;
    box-shadow: 2px 0 16px rgba(0,0,0,.25);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay.show {
    display: block; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 110;
  }
  /* 顶部条：汉堡 + 标题 */
  .topbar {
    display: flex; align-items: center; gap: 12px;
    background: #1e2a3a; color: #fff; padding: 10px 14px;
    position: sticky; top: 0; z-index: 50;
  }
  .topbar .hamb { font-size: 20px; background: none; border: none; color: #fff; cursor: pointer; padding: 0 4px; }
  .topbar .t-title { font-weight: bold; font-size: 15px; }

  .main { padding: 12px; }

  /* 移动端禁用图标折叠，保持抽屉正常展开 */
  .sidebar.collapsed { width: 240px; }
  .sidebar.collapsed .logo { display: block; }
  .sidebar.collapsed .sidebar-head { justify-content: space-between; padding-right: 10px; }
  .sidebar.collapsed .nav-label { display: inline; }
  .sidebar.collapsed nav a { padding: 12px 18px; text-align: left; font-size: 14px; }
  .sidebar.collapsed .userbox .ub-full { display: block; }
  .sidebar.collapsed .userbox .ub-mini { display: none; }
  .toolbar { gap: 8px; }
  .toolbar input[type=text] { width: 100%; }
  .toolbar .btn { flex: 1 1 auto; }

  /* 表单两列 → 单列 */
  .form-grid { grid-template-columns: 1fr; gap: 10px; }
  .modal { width: 100%; padding: 16px; border-radius: 0; min-height: 100vh; }
  .modal-mask { padding: 0; align-items: stretch; }

  .dash-grid { grid-template-columns: 1fr; }
  .img-preview a img { width: 52px; height: 52px; }

  /* 表格横向滚动，避免窄屏挤压变形 */
  .table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table-scroll table.grid { min-width: 760px; }
  .lightbox-mask img { max-width: 100vw; max-height: 100vh; }
}

/* ---------- 模板管理 / 办理退款函预览 ---------- */
.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; gap: 10px; flex-wrap: wrap; }
.page-head h2 { font-size: 18px; font-weight: bold; }
.filter-input { padding: 7px 10px; border: 1px solid #d0d7de; border-radius: 4px; width: 240px; font-size: 13px; }
.tag-blue { background: #1867c0; color: #fff; }
.tag-warn { background: #fdf3e5; color: #c47b1a; }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.modal-x { border: none; background: transparent; font-size: 22px; line-height: 1; cursor: pointer; color: #888; }
.modal-body { font-size: 14px; }
.a4 { width: 794px; max-width: 100%; min-height: 1123px; margin: 0 auto; padding: 18mm; background: #fff; box-shadow: 0 1px 6px rgba(0,0,0,.12); box-sizing: border-box; }
@media print { .a4 { box-shadow: none; } }

/* 自动填充字段下划线（屏幕与打印都显示） */
.auto-fill { text-decoration: underline; padding: 0 4px; font-weight: bold; }

/* ---------- 盖章 / 签名浮层 ---------- */
.a4 { position: relative; }
.stamp-item { position: absolute; cursor: move; touch-action: none; }
.stamp-item img { width: 100%; height: 100%; display: block; user-select: none; -webkit-user-drag: none; pointer-events: auto; cursor: move; }
.stamp-item.selected { outline: 1px dashed #1867c0; }
.stamp-item .stamp-x, .stamp-item .stamp-rot, .stamp-item .stamp-rs { position: absolute; z-index: 2; display: none; }
.stamp-item.selected .stamp-x, .stamp-item.selected .stamp-rot, .stamp-item.selected .stamp-rs { display: flex; }
.stamp-item .stamp-x { top: -12px; right: -12px; width: 22px; height: 22px; background: #d64541; color: #fff; border-radius: 50%; align-items: center; justify-content: center; cursor: pointer; font-size: 14px; line-height: 1; }
.stamp-item .stamp-rot { top: -30px; left: 50%; margin-left: -11px; width: 22px; height: 22px; background: #1867c0; color: #fff; border-radius: 50%; align-items: center; justify-content: center; cursor: grab; font-size: 13px; touch-action: none; }
.stamp-item .stamp-rs { bottom: -8px; right: -8px; width: 16px; height: 16px; background: #fff; border: 2px solid #1867c0; border-radius: 3px; cursor: nwse-resize; touch-action: none; }
.stamp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; max-height: 340px; overflow: auto; }
.stamp-cell { border: 1px solid #e5e9f0; border-radius: 6px; padding: 8px; cursor: pointer; text-align: center; }
.stamp-cell:hover { border-color: #1867c0; box-shadow: 0 0 0 2px rgba(24,103,192,.15); }
.stamp-cell img { max-width: 100%; max-height: 90px; object-fit: contain; }
.stamp-cell-name { font-size: 12px; color: #666; margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- 模板管理：分类标签 + 公章库卡片 ---------- */
.cat-tabs { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.cat-tab { padding: 6px 16px; border: 1px solid #d0d7de; border-radius: 18px; background: #fff; cursor: pointer; font-size: 13px; }
.cat-tab.active { background: #1867c0; color: #fff; border-color: #1867c0; }
.seal-lib { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.seal-card { border: 1px solid #e5e9f0; border-radius: 8px; background: #fff; padding: 10px; }
.seal-card-img { height: 120px; display: flex; align-items: center; justify-content: center; background: repeating-conic-gradient(#eee 0 25%, #fff 0 50%) 0 0 / 20px 20px; border-radius: 6px; overflow: hidden; cursor: zoom-in; }
.seal-card-img img { max-width: 100%; max-height: 110px; object-fit: contain; }
.seal-card-name { font-size: 13px; margin: 8px 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seal-card-ops { display: flex; gap: 6px; flex-wrap: wrap; }

/* 报价单岗位小表格 */
.quote-mini-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.quote-mini-table th, .quote-mini-table td { border: 1px solid #d0d7de; padding: 5px 7px; text-align: left; }
.quote-mini-table th { background: #f0f4f8; font-weight: 600; }

/* 中标价（报价计算器列表内）标红 */
.win-price, .quote-list-round.win .quote-mini-table td { color: #c0392b; font-weight: 600; }

/* 报价计算器备注列放宽，避免每个字都换行 */
.quote-mini-table th:nth-child(8),
.quote-mini-table td:nth-child(8) { min-width: 180px; max-width: 360px; }
.quote-round-tbl th:nth-child(8),
.quote-round-tbl td:nth-child(8) { min-width: 180px; }
.quote-round-tbl td:nth-child(8) input { min-width: 180px; }

/* ---------- 时间筛选：区间输入不再拥挤 ---------- */
.date-range-filter { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.date-range-filter input[type=date] { min-width: 86px; width: auto; padding: 4px 6px; font-size: 12px; }
.date-range-sep { color: #999; }

/* 列表单元格自动换行（长文本如项目名/公司名/退保说明分两行显示） */
table.grid td.wrap { white-space: normal; word-break: break-word; overflow-wrap: anywhere; }

/* ---------- 价格计算器：多轮报价编辑器 ---------- */
.quote-round-box { border: 1px solid #d0d7de; border-radius: 8px; padding: 10px 12px; margin-bottom: 10px; background: #fff; }
.quote-round-box.win { border-color: #e0a800; background: #fffdf3; box-shadow: 0 0 0 2px rgba(224,168,0,.12); }
.quote-round-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.quote-round-head b { font-size: 14px; }
.round-name-input { width: 160px !important; padding: 4px 8px !important; font-size: 13px; }
.quote-round-ops { display: flex; gap: 6px; flex-wrap: wrap; }
.quote-round-tag { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12px; background: #eef3f8; color: #1867c0; }
.quote-round-tag.win { background: #e0a800; color: #fff; }
.quote-round-tbl { margin: 6px 0; font-size: 13px; }
.quote-round-totals { display: flex; gap: 18px; flex-wrap: wrap; font-size: 13px; color: #444; margin-top: 4px; }
.quote-round-totals b { color: #c0392b; }

/* 报价计算器弹窗加宽，避免岗位子表溢出 */
.modal.modal-wide { width: 960px; max-width: 96vw; }
.modal.modal-wide .form-grid { grid-template-columns: 1fr 1fr; }
.quote-round-tbl { min-width: 760px; }
.quote-round-tbl th, .quote-round-tbl td { padding: 5px 4px; white-space: nowrap; }
.quote-round-tbl input, .quote-round-tbl select { padding: 5px 6px; font-size: 13px; min-width: 60px; }

/* 报价计算器弹窗：整页打开，内部可滚动 */
.modal.quote-modal {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: 100%;
  border-radius: 0;
  display: flex;
  flex-direction: column;
  padding: 0;
}
.modal.quote-modal .modal-head {
  flex-shrink: 0;
  padding: 12px 20px;
  border-bottom: 1px solid #e2e6ec;
  margin-bottom: 0;
}
.modal.quote-modal .modal-body {
  flex: 1;
  overflow: auto;
  padding: 14px 20px;
}
.modal.quote-modal .form-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  grid-template-areas: "info amount" "table table";
  gap: 16px 18px;
  align-items: start;
}
.modal.quote-modal .form-zone-info {
  grid-area: info;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px 18px;
  align-items: start;
}
.modal.quote-modal .form-zone-amount {
  grid-area: amount;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px 16px;
  align-items: start;
  background: #e6f1fb;
  border: 1px solid #b5d4f4;
  border-radius: 10px;
  padding: 12px 14px;
}
.modal.quote-modal .form-zone-table { grid-area: table; }
.modal.quote-modal .form-item.full,
.modal.quote-modal .form-zone-info .form-item.full { grid-column: 1 / -1; }
.modal.quote-modal .form-item label {
  font-size: 13px;
  color: #555;
  margin-bottom: 2px;
}
.modal.quote-modal .form-item input,
.modal.quote-modal .form-item select,
.modal.quote-modal .form-item textarea {
  padding: 6px 8px;
  font-size: 13px;
}
@media (max-width: 1200px) {
  .modal.quote-modal .form-grid { grid-template-columns: 1fr; grid-template-areas: "info" "amount" "table"; }
  .modal.quote-modal .form-zone-info { grid-template-columns: repeat(2, 1fr); }
}
.quote-round-tbl input[type=number] { min-width: 70px; }

/* toolbar 内独立筛选条（日期区间放不下一行时移到 toolbar 右侧） */
#filter-bar-above { margin-left: auto; }
.filter-bar-above { display: inline-flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.filter-bar-above label { font-size: 12px; color: #666; margin-bottom: 0; margin-right: 4px; white-space: nowrap; }
.filter-above-item { display: inline-flex; align-items: center; }
.filter-above-item input[type=date] { padding: 4px 6px; border: 1px solid #d0d7de; border-radius: 3px; font-size: 13px; }
.filter-above-item .date-range-sep { margin: 0 4px; color: #888; }
.filter-bar-above .btn { margin-left: 4px; }

/* 列表内多轮小卡片 */
.quote-list-round { border: 1px solid #eef0f3; border-radius: 6px; padding: 6px 8px; margin-bottom: 8px; background: #fcfcfd; }
.quote-list-round.win { border-color: #e0a800; background: #fffdf3; }
.quote-list-round-title { font-size: 12px; font-weight: 600; color: #555; margin-bottom: 4px; }

/* ===== 拼图报价编辑器 v2（Excel 式） ===== */
.pz-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 0; border-bottom: 1px dashed #e2e6ec; margin-bottom: 10px; }
.pz-toolbar .pz-sep { width: 1px; height: 20px; background: #ddd; margin: 0 4px; }
.pz-tip { font-size: 12px; color: #888; margin-left: auto; }
.pz-table-card { border: 1px solid #e2e6ec; border-radius: 8px; padding: 10px 12px; margin-bottom: 14px; background: #fff; }
.pz-table-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.pz-table-name { font-size: 15px; font-weight: 600; border: none; border-bottom: 1px dashed #ccc; min-width: 140px; background: transparent; }
.pz-table-head .pz-head-tools { margin-left: auto; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12px; color: #666; }
.pz-tbl { table-layout: auto; }
.pz-tbl th, .pz-tbl td { padding: 3px 5px; vertical-align: middle; }
.pz-letters th { background: #eef2f7; color: #7a8699; font-size: 11px; font-weight: 600; text-align: center; padding: 2px 4px; }
.pz-letter .pz-money { color: #e67e22; margin-left: 2px; }
.pz-rowno { width: 34px; min-width: 34px; text-align: center; background: #f7f9fb; color: #98a2b3; font-size: 12px; }
.pz-collab { background: #f7f9fb; position: relative; }
.pz-collab-in { width: 100%; min-width: 64px; border: none; background: transparent; font-weight: 600; font-size: 13px; }
.pz-colx { position: absolute; top: 1px; right: 1px; border: none; background: none; color: #ccc; cursor: pointer; font-size: 12px; line-height: 1; padding: 1px 3px; }
.pz-colx:hover { color: #c0392b; }
.pz-cell { position: relative; min-width: 84px; }
.pz-in { width: 100%; min-width: 72px; box-sizing: border-box; }
.pz-num { font-family: Consolas, monospace; }
.pz-badge { position: absolute; top: 0; right: 0; font-size: 10px; line-height: 1; padding: 1px 3px; border-radius: 0 0 0 4px; color: #fff; }
.pz-badge.b-fx { background: #378add; }
.pz-badge.b-rg { background: #ba7517; }
.pz-badge.b-rd { background: #7f77dd; }
.pz-badge.b-pc { background: #1d9e75; }
.pz-cv { display: block; font-size: 11px; color: #c0392b; margin-top: 1px; font-family: Consolas, monospace; }
.pz-linked { background: #f2f8f4; }
.pz-linkval { color: #1a7f37; font-weight: 600; font-size: 13px; }
.pz-sec td { background: #f0f4fa; }
.pz-sec-name { border: none; background: transparent; font-weight: 700; color: #2c5282; font-size: 13px; min-width: 160px; }
.pz-subtotal td { background: #fafbf4; color: #6b6f3e; font-weight: 600; font-size: 12px; }
.pz-totalrow td { background: #f3f6f9; font-size: 13px; }
.pz-num-cell { text-align: right; font-family: Consolas, monospace; }
.pz-ops { width: 78px; min-width: 78px; text-align: center; white-space: nowrap; }
.pz-opbtn { border: 1px solid #dde2e8; background: #fff; border-radius: 4px; cursor: pointer; font-size: 11px; padding: 1px 4px; margin: 0 1px; color: #667; }
.pz-opbtn:hover { background: #f0f4fa; }
.pz-opbtn.pz-del:hover { background: #fdecea; color: #c0392b; border-color: #f5c6c0; }
.pz-empty { color: #aaa; padding: 10px; text-align: center; }
.pz-fill { border: 1px dashed #b6c4d8; background: #f8fafd; border-radius: 6px; padding: 8px 10px; margin-bottom: 8px; font-size: 13px; }
.pz-fill-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 4px 0; }
.pz-fill-hint { font-size: 12px; color: #999; }
.pz-reconcile { margin-top: 8px; padding: 8px 10px; background: #f8fafc; border-radius: 6px; font-size: 13px; }
.pz-reconcile-title { font-weight: 600; color: #555; margin-bottom: 6px; }
.pz-rule { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 3px 0; }
.pz-rule.ok { color: #1a7f37; }
.pz-rule.bad { color: #c0392b; }
.pz-reconcile-add { margin-top: 6px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pz-banner { margin: 10px 0; padding: 8px 12px; border-radius: 6px; font-weight: 600; }
.pz-banner.ok { background: #e7f6ec; color: #1a7f37; }
.pz-banner.bad { background: #fdecea; color: #c0392b; }
.pz-toast { position: fixed; left: 50%; bottom: 40px; transform: translateX(-50%); background: #2c3e50; color: #fff; padding: 10px 18px; border-radius: 8px; font-size: 13px; z-index: 9999; box-shadow: 0 4px 16px rgba(0,0,0,.25); max-width: 90vw; }
.pz-matbox { position: absolute; z-index: 9998; background: #fff; border: 1px solid #d6dde6; border-radius: 6px; box-shadow: 0 6px 20px rgba(0,0,0,.12); max-height: 260px; overflow: auto; }
.pz-matitem { padding: 6px 10px; cursor: pointer; display: flex; align-items: center; gap: 6px; font-size: 13px; }
.pz-matitem:hover { background: #f0f6ff; }
.pz-matmeta { color: #888; font-size: 12px; }
.pz-matbox-hd { padding: 5px 10px; background: #f3f6fb; color: #5a6b80; font-size: 12px; border-bottom: 1px solid #e3e9f1; position: sticky; top: 0; }
.wz-pick-panel { padding: 8px 10px 10px; background: #f7faff; border-top: 1px dashed #d6e0ee; font-size: 13px; display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.wz-pick-panel .wz-in { text-align: center; }
.sublib-item { display: flex; align-items: center; justify-content: space-between; padding: 8px 4px; border-bottom: 1px solid #eee; }

/* ===== 报价向导（pzwizard.js）===== */
.wz-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 12px; background: #f4f8fd; border: 1px solid #d9e4f2; border-radius: 8px; margin-bottom: 12px; font-size: 13px; }
.wz-step { font-weight: 700; color: #2c5282; font-size: 14px; margin-right: 4px; }
.wz-head input.wz-num { width: 90px; }
.wz-target { color: #c0392b; font-family: Consolas, monospace; font-size: 15px; }
.wz-head-btns { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.wz-hint { font-size: 12px; color: #8a94a6; margin: 4px 0 10px; }
.wz-start { border: 1px dashed #b6c4d8; background: #f8fafd; border-radius: 8px; padding: 24px; text-align: center; color: #556; font-size: 14px; }
.wz-start label { margin: 0 12px; cursor: pointer; }
.wz-start .btn { margin-top: 14px; }
.wz-card { border-color: #d9e4f2; }
.wz-card.wz-master { border-color: #c9dcc9; background: #fbfdfb; }
.wz-tbl th, .wz-tbl td { padding: 4px 6px; vertical-align: middle; }
.wz-icon { font-size: 13px; text-align: center; width: 30px; min-width: 30px; }
.wz-type { font-size: 12px; padding: 2px 3px; border: 1px solid #dde2e8; border-radius: 4px; background: #fff; max-width: 96px; }
.wz-in { width: 100%; min-width: 70px; box-sizing: border-box; }
.wz-in.wz-name { min-width: 110px; }
.wz-num { font-family: Consolas, monospace; text-align: right; }
/* 智能分摊时因超出引用价被自动下调的行，标红提醒 */
.grid.wz-tbl tr.pz-reduced > td { background: #ffe3e3 !important; }
.grid.wz-tbl tr.pz-reduced > td .wz-in { color: #b00000; }
.wz-val { text-align: right; font-family: Consolas, monospace; font-weight: 600; color: #2c3e50; min-width: 86px; white-space: nowrap; }
.wz-ops { width: 92px; min-width: 92px; text-align: center; white-space: nowrap; }
.wz-sec td { background: #f0f4fa; }
.wz-sec-name { border: none; background: transparent; font-weight: 700; color: #2c5282; font-size: 13px; min-width: 140px; }
.wz-th { border: none; background: transparent; font-weight: 700; color: #2c3e50; font-size: 13px; min-width: 60px; width: 100%; text-align: center; }
.wz-th:hover, .wz-th:focus { background: #fff; border: 1px solid #2c5282; border-radius: 4px; }
.wz-check { font-size: 12px; padding: 2px 8px; border-radius: 10px; margin-left: 8px; font-weight: 600; }
.wz-check.ok { background: #e6f6ec; color: #1a7f37; }
.wz-check.bad { background: #fdecea; color: #c0392b; }
.wz-addbar { margin: 6px 0 14px; font-size: 13px; color: #667; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.wz-adv { color: #999; border-color: #e3e6ea; }
.wz-rounds { border: 1px solid #e2e6ec; border-radius: 8px; padding: 10px 12px; margin-top: 4px; background: #fffdf7; }

/* ===== v4：横版流水线 + 模板选择 + 引用价格 ===== */
.pz-tables-h { display: flex; gap: 16px; align-items: stretch; overflow-x: auto; padding-bottom: 8px; }
.pz-tables-h > .pz-table-card { flex: 1 1 420px; min-width: 420px; max-width: none; display: flex; flex-direction: column; }
.pz-tables-h > .pz-table-card > .table-scroll { flex: 1; overflow: auto; }
.pz-tables-h .wz-tbl { width: 100%; }
.pz-tables-h .wz-tbl th { white-space: nowrap; }
.pz-tables-h > .wz-master { border-color: #c9dcc9; background: #fbfdfb; }
.wz-sep { color: #b6c0d0; margin: 0 4px; }
.wz-addbar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 12px 0; padding: 10px 12px; background: #f6f9fd; border: 1px dashed #c4d3e6; border-radius: 8px; font-size: 13px; }
.wz-tpls { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin: 14px 0; text-align: left; }
.wz-tpl { display: flex; flex-direction: column; gap: 4px; border: 1px solid #d6deea; border-radius: 8px; padding: 12px 14px; cursor: pointer; background: #fff; transition: .15s; }
.wz-tpl:hover { border-color: #2c5282; box-shadow: 0 2px 10px rgba(44,82,130,.12); }
.wz-tpl input { display: none; }
.wz-tpl b { font-size: 14px; color: #2c3e50; }
.wz-tpl span { font-size: 12px; color: #788; line-height: 1.5; }
.wz-tpl:has(input:checked) { border-color: #2c5282; background: #f0f6ff; box-shadow: 0 0 0 2px #2c528233; }
.btn-ref { background: #fff; border: 1px solid #2c5282; color: #2c5282; }
.btn-ref:hover { background: #eef4ff; }
/* 引用价格拾取态 */
.pz-ref-pick { cursor: crosshair; }
.pz-ref-pick td[data-calc], .pz-ref-pick td[data-sub], .pz-ref-pick td[data-ttotal],
.pz-ref-pick td[data-wzcalc], .pz-ref-pick td[data-wzsub], .pz-ref-pick td[data-wztotal],
.pz-ref-pick td[data-wzftot], .pz-ref-pick td[data-wzmtot] { outline: 2px dashed #2c5282; outline-offset: -2px; }
.pz-ref-src { background: #fff3cd !important; outline: 2px solid #e0a800 !important; }
.pz-linked .pz-linkval { color: #2c5282; font-weight: 600; }
.wz-rounds-title { font-size: 13px; font-weight: 600; color: #8a6d1a; margin-bottom: 6px; }
.wz-round { display: flex; align-items: center; gap: 10px; padding: 5px 4px; border-bottom: 1px dashed #eee; font-size: 13px; flex-wrap: wrap; }
.wz-round:last-child { border-bottom: none; }
.wz-round .win { color: #c0392b; font-weight: 700; }
.wz-base-item { display: inline-flex; align-items: center; gap: 4px; margin: 4px 10px 4px 0; font-size: 13px; cursor: pointer; }

/* ==================== 拼图报价 · 查看模式 ==================== */
.pz-mode { display: inline-flex; gap: 2px; background: #f0f2f5; border-radius: 6px; padding: 2px; }
.pz-mode .btn { border: none; background: transparent; }
.pz-mode .btn.btn-primary { background: #1867c0; color: #fff; }

/* 总价 Hero 卡 */
.pz-hero { background: linear-gradient(135deg, #1f6feb 0%, #0b4fb5 100%); color: #fff; border-radius: 12px; padding: 16px 22px; margin: 10px 0; box-shadow: 0 2px 10px rgba(31,111,235,.18); }
.pz-hero-label { font-size: 13px; opacity: .85; }
.pz-hero-total { font-size: 30px; font-weight: 700; margin: 4px 0 2px; letter-spacing: .5px; }
.pz-hero-chips { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 13px; opacity: .92; margin-top: 6px; }
.pz-hero-chips span { white-space: nowrap; }
.pz-hero-sub { font-size: 14px; margin: 4px 0 8px; opacity: .95; }
.pz-hero-sub b { font-weight: 600; }
.pz-hero-win { margin-top: 6px; border: 1px solid rgba(255,255,255,.6); background: rgba(255,255,255,.14); color: #fff; border-radius: 16px; padding: 3px 12px; cursor: pointer; font-size: 12px; transition: background .15s; }
.pz-hero-win:hover { background: rgba(255,255,255,.26); }
.pz-hero-win.on { background: #ffd54a; color: #5a3e00; border-color: #ffd54a; font-weight: 600; }

/* 拼图报价多轮切换 Tab */
.pz-round-tabs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 0 10px; border-bottom: 1px dashed #e4e8ee; margin-bottom: 10px; }
.pz-round-tab { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border: 1px solid #d7dde5; border-radius: 16px; background: #fff; cursor: pointer; font-size: 13px; color: #1f2329; transition: all .15s; }
.pz-round-tab:hover { border-color: #1867c0; }
.pz-round-tab.active { background: #1867c0; border-color: #1867c0; color: #fff; font-weight: 600; }
.pz-round-win { font-size: 11px; color: #ffb300; }
.pz-round-tab.active .pz-round-win { color: #ffe08a; }
.pz-round-setwin { font-size: 11px; color: #1867c0; text-decoration: underline; }
.pz-round-tab.active .pz-round-setwin { color: #cfe2ff; }
.pz-round-del { font-size: 12px; color: #c0392b; margin-left: 2px; }
.pz-round-del:hover { font-weight: 700; }

/* 多标段：列表分组折叠 */
.sec-info { min-height: 1px; font-size: 13px; line-height: 1.6; color: #1f2329; }
.sec-info:empty { display: none; }
.sec-info .tag { vertical-align: middle; }
.sec-info small { color: #8a929c; }
.grp-head { background: #f1f6ff; cursor: pointer; user-select: none; }
.grp-head:hover { background: #e6efff; }
.grp-head.collapsed { background: #f1f6ff; }
.grp-head td { padding: 8px 12px; border-top: 2px solid #d3e0f5; }
.grp-head .caret { display: inline-block; width: 14px; color: #1867c0; font-size: 12px; }
.grp-head b { color: #16335c; }
.grp-count { margin-left: 8px; font-size: 12px; color: #6b7a8d; font-weight: 400; }
.grp-child.grp-hidden { display: none; }
.grp-child td { background: #fff; }


/* 吸顶目录导航 */
.pz-view-nav { position: sticky; top: 0; z-index: 20; display: flex; flex-wrap: wrap; gap: 8px; padding: 8px; background: #fff; border: 1px solid #e4e8ee; border-radius: 10px; margin-bottom: 12px; }
.pz-nav-chip { display: flex; flex-direction: column; align-items: flex-start; border: 1px solid #e4e8ee; background: #fff; border-radius: 8px; padding: 6px 10px; cursor: pointer; font-size: 13px; color: #1f2329; min-width: 120px; transition: border-color .15s, background .15s; }
.pz-nav-chip:hover { border-color: #1867c0; background: #f5f9ff; }
.pz-nav-idx { display: inline-block; background: #1867c0; color: #fff; border-radius: 4px; font-size: 11px; padding: 0 5px; margin-right: 6px; }
.pz-nav-meta { font-size: 11px; color: #98a0aa; margin-top: 2px; }
.pz-nav-act { justify-content: center; align-items: center; border-color: #1867c0; color: #1867c0; font-weight: 600; }

/* 分区卡片 */
.pz-zone { background: #fff; border: 1px solid #e4e8ee; border-radius: 10px; margin-bottom: 12px; overflow: hidden; }
.pz-zone-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: #fafbfc; border-bottom: 1px solid #eef1f5; cursor: pointer; user-select: none; }
.pz-zone-name { font-size: 15px; font-weight: 600; }
.pz-zone-meta { font-size: 12px; color: #98a0aa; }
.pz-zone-toggle { margin-left: auto; color: #7a828c; font-size: 14px; }
.pz-zone-body { padding: 4px 6px 10px; }
.pz-badge-z { font-size: 12px; padding: 1px 8px; border-radius: 4px; color: #fff; }
.z-master { background: #1867c0; }
.z-sub { background: #0f9e8a; }
.z-mat { background: #3b8e1f; }
.z-con { background: #c47b1a; }
.z-other { background: #8a93a0; }
.pz-ok-mark { font-size: 12px; color: #1a9f5a; background: #e7f7ee; border-radius: 4px; padding: 1px 7px; }
.pz-bad-mark { font-size: 12px; color: #c0392b; background: #fdecea; border-radius: 4px; padding: 1px 7px; }

/* 并排对比 */
.pz-compare { display: flex; flex-wrap: wrap; gap: 12px; }
.pz-compare .pz-zone { flex: 1 1 360px; min-width: 320px; }

/* 只读表格微调 */
.pz-tbl-ro td.pz-cell { padding: 5px 8px; }
.pz-tbl-ro .pz-num-cell { text-align: right; font-variant-numeric: tabular-nums; }
.pz-tbl-ro .pz-linked .pz-linkval { color: #2c5282; font-weight: 600; }


