/* ============================================================
   中华建材公司管理网站 —— 门户层样式
   在原有看板样式之上，新增主导航、首页、出勤、盘库、工作助手、权限配置
   ============================================================ */

/* ---------- 多页容器 ---------- */
.portal-nav {
  height: 44px; display: flex; align-items: center; gap: 4px;
  padding: 0 16px; background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 60px; z-index: 29;
  overflow-x: auto; scrollbar-width: none;
}
.portal-nav::-webkit-scrollbar { display: none; }
.pn-item {
  height: 30px; padding: 0 13px; border: 0; border-radius: 8px;
  background: transparent; color: var(--ink-2);
  font-size: 13.5px; font-weight: 500; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 6px;
  transition: .15s;
}
.pn-item:hover { background: var(--surface-2); color: var(--ink); }
.pn-item.is-on { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.pn-item .pn-badge { font-size: 10.5px; background: var(--danger); color: #fff; border-radius: 999px; padding: 0 5px; line-height: 15px; min-width: 15px; text-align: center; }
.pn-spacer { flex: 1; }
.pn-admin {
  height: 30px; padding: 0 11px; border: 1px solid var(--line-2); border-radius: 8px;
  background: var(--surface); color: var(--ink-2); font-size: 12.5px;
  display: inline-flex; align-items: center; gap: 5px; white-space: nowrap;
}
.pn-admin:hover { border-color: #9db3cd; background: #fbfdff; }

.page-view { position: absolute; inset: 104px 0 0 0; overflow-y: auto; background: var(--bg); }
.page-view > .layout { height: 100%; }
.page-view:not(#page-containers) { padding: 24px 28px 64px; }
.page-view::-webkit-scrollbar { width: 10px; }
.page-view::-webkit-scrollbar-thumb { background: #d7e0ec; border-radius: 8px; border: 3px solid var(--bg); }

/* 非海柜页隐藏只属于看板的顶栏控件 */
body:not([data-page="containers"]) .search-wrap,
body:not([data-page="containers"]) .stats,
body:not([data-page="containers"]) #newBtn,
body:not([data-page="containers"]) #confBtn { display: none !important; }

/* ---------- 通用页面骨架 ---------- */
.pt-wrap { max-width: 1280px; margin: 0 auto; }
.pt-head { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; margin-bottom: 20px; }
.pt-head h1 { font-size: 22px; letter-spacing: -.4px; }
.pt-head p { color: var(--ink-2); font-size: 13px; margin-top: 3px; }
.pt-head .pt-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pt-date { font-size: 12.5px; color: var(--ink-3); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 5px 10px; }
/* 日期是会增高到 40px 的「胶囊」，文字必须垂直居中；input[type=date] 不套这层 */
span.pt-date { display: inline-flex; align-items: center; justify-content: center; white-space: nowrap; }

/* ---------- 日期控件占位层 ----------
 * 原生 date / datetime-local 的空状态文案由内核决定，微信 / 部分安卓会显示
 * 「yyyy/mm/日」「--:--」这种中英混排。统一盖一层中文占位，有值或聚焦时让开。 */
.dt-host { position: relative; display: inline-flex; align-items: center; max-width: 100%; }
.dt-host > input { min-width: 0; }
.dt-ph {
  position: absolute; top: 50%; transform: translateY(-50%);
  padding: 0 2px; background: var(--surface); color: var(--ink-3);
  line-height: 1.2; white-space: nowrap; pointer-events: none; user-select: none;
}
.dt-host.has-val > .dt-ph, .dt-host:focus-within > .dt-ph { display: none; }
.dt-host[hidden] { display: none !important; }
.dt-host:not(.has-val):not(:focus-within) > input::-webkit-datetime-edit { color: transparent; }
/* 表单行里的日期字段原本满宽，包一层后仍要占满整格 */
.pf-field > .dt-host, .fld > .dt-host { display: block; width: 100%; }
.pf-field > .dt-host > input, .fld > .dt-host > input { width: 100%; }

/* ---------- 语音播报 ---------- */
.btn-speak { display: inline-flex; align-items: center; gap: 6px; }
.btn-speak .icon { stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.btn-speak.is-speaking,
.btn.is-speaking { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-speak.is-speaking .icon,
.btn.is-speaking .icon { animation: speakPulse 1.1s ease-in-out infinite; }
.btn-speak.is-off { opacity: .55; }

/* 播报兜底字幕：微信里没有系统语音、在线合成也失败时，把要读的内容摆出来 */
.speak-fb { margin: 0 0 14px; background: var(--surface); border: 1px solid var(--line);
  border-left: 3px solid var(--brand); border-radius: var(--r-md); padding: 12px 14px; }
.speak-fb[hidden] { display: none; }
.speak-fb .sf-head { display: flex; align-items: center; justify-content: space-between;
  font-size: 12.5px; font-weight: 600; color: var(--brand); margin-bottom: 6px; }
.speak-fb .sf-head .x { border: 0; background: none; font-size: 20px; line-height: 1;
  color: var(--ink-3); cursor: pointer; padding: 0 4px; }
.speak-fb p { margin: 0; font-size: 14px; line-height: 1.75; color: var(--ink); }
@keyframes speakPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .35; }
}


.pt-loading { color: var(--ink-3); font-size: 13px; padding: 30px 0; text-align: center; }
.pt-err { color: var(--danger); background: var(--danger-soft); border: 1px solid #f3cdc7; border-radius: 10px; padding: 12px 14px; font-size: 13px; }

/* ---------- 海柜记录：与其它分页同一套页头 + 卡片 ----------
   原来这里是整块看板外壳（顶栏搜索/统计、贴边侧栏），换页时"像另一个站"。
   现在收进 .pt-wrap：页头写标题与入口，列表与详情装同一张卡片，滚动留在卡片里。 */
#page-containers { padding: 22px 28px 24px; }
#page-containers .ct-wrap { height: 100%; display: flex; flex-direction: column; min-height: 0; }
#page-containers .pt-head { flex: none; margin-bottom: 16px; }
.ct-stats { display: flex; gap: 6px; flex-wrap: wrap; }
.ct-body {
  flex: 1; min-height: 0; height: auto; display: grid; grid-template-columns: 336px minmax(0, 1fr);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--shadow-sm); overflow: hidden;
}
#page-containers .sidebar { border-right: 1px solid var(--line); background: var(--surface); }
/* 筛选是页面的主要入口，宁可换行也别把「已完成」藏在横向滚动里 */
#page-containers .chips { flex-wrap: wrap; overflow: visible; row-gap: 6px; }
#page-containers .main { background: var(--bg); padding: 20px 22px 48px; }
/* 只有查看权限：时间轴的圆圈别给「可以点」的手感 */
#page-containers .tl.is-ro [data-node] { pointer-events: none; cursor: default; }
#page-containers .tl.is-ro [data-node]:hover { border-color: var(--line); }
.side-search { position: relative; margin: 0 12px 9px; }
.side-search .icon {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  width: 15px; height: 15px; color: var(--ink-3);
  stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round;
  pointer-events: none;
}
.side-search input {
  width: 100%; height: 34px; padding: 0 10px 0 32px; border-radius: 9px;
  border: 1px solid var(--line); background: var(--surface-2);
  font-size: 13px; outline: none; transition: .15s;
}
.side-search input:focus { background: #fff; border-color: var(--brand-2); box-shadow: 0 0 0 3px rgba(22,104,179,.1); }
#page-containers .side-head { padding: 13px 14px 7px; }
#page-containers .side-head > span:first-child { font-size: 13px; letter-spacing: 0; }
/* 详情抬头原来直接铺在灰底上，现在也装进卡片，和列表、其它分页一致 */
#page-containers .detail-head {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: 16px 18px; box-shadow: var(--shadow-sm);
}

@media (max-width: 1080px) and (min-width: 861px) {
  #page-containers .ct-body { grid-template-columns: 290px minmax(0, 1fr); }
}
@media (max-width: 860px) {
  #page-containers { padding: 16px 14px 40px; }
  #page-containers .ct-wrap { height: auto; display: block; }
  #page-containers .pt-head { margin-bottom: 14px; }
  #page-containers .ct-body { display: block; }
  #page-containers .sidebar { max-height: 46vh; }
  #page-containers .main { padding: 16px 14px 44px; }
  .ct-stats .stat { padding: 4px 8px; font-size: 11.5px; }
  .ct-stats .stat b { font-size: 13.5px; }
}
@media (max-width: 420px) {
  /* 新建入口现在在页头，不再挤顶栏：保留文字，别缩成一个「+」 */
  #page-containers #newBtn { width: auto; padding: 0 12px; justify-content: center; }
  #page-containers #newBtn .new-text { display: inline; }
  .ct-wrap .pt-actions { width: 100%; justify-content: flex-end; }
}

/* ---------- 首页 ---------- */
.home-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; }
.hm-card {
  grid-column: span 12; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); padding: 18px 18px 16px; box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; min-width: 0;
}
.hm-card.span-7 { grid-column: span 7; }
.hm-card.span-5 { grid-column: span 5; }
.hm-card.span-6 { grid-column: span 6; }
.hm-card.span-4 { grid-column: span 4; }
.hm-head { display: flex; align-items: center; gap: 9px; margin-bottom: 13px; }
.hm-head h2 { font-size: 14.5px; font-weight: 600; }
.hm-head .hm-ic { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); flex: none; }
.hm-head .hm-ic.warn { background: var(--warn-soft); color: var(--warn); }
.hm-head .hm-ic.ok { background: var(--ok-soft); color: var(--ok); }
.hm-head .hm-more { margin-left: auto; font-size: 12.5px; color: var(--brand-2); background: none; border: 0; }
.hm-head .hm-more:hover { text-decoration: underline; }

/* ---------- 公司公告（占位） ---------- */
.hm-notice { grid-column: span 12; }
.hm-head .hm-ic.info { background: var(--accent-soft); color: var(--accent); }
.notice-empty {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  padding: 14px 16px; border: 1px dashed var(--line-2); border-radius: 10px;
  background: var(--surface-2);
}
.notice-empty b { font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.notice-empty span { font-size: 12.5px; color: var(--ink-3); }

/* 公司公告：首页 3 条卡片 + 全文弹层 + 编辑表单 */
.ntc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.ntc-card {
  padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface-2); cursor: pointer; transition: .15s;
}
.ntc-card:hover { border-color: var(--brand); background: var(--surface); }
.ntc-c-t {
  font-size: 13.5px; font-weight: 600; color: var(--ink); line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.ntc-c-b {
  font-size: 12.5px; color: var(--ink-2); margin-top: 6px; line-height: 1.55;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.ntc-c-m { font-size: 11.5px; color: var(--ink-3); margin-top: 8px; }
.ntc-body { font-size: 13.5px; line-height: 1.85; color: var(--ink-2); white-space: pre-wrap; word-break: break-word; }
.ntc-list { display: flex; flex-direction: column; gap: 10px; }
.ntc-row { padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; transition: .15s; }
.ntc-row:hover { border-color: var(--brand); }
.ntc-row-t { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.ntc-row-b { font-size: 12.5px; color: var(--ink-2); margin-top: 4px; line-height: 1.55; }
.ntc-form { display: flex; flex-direction: column; }
.ntc-lb { font-size: 12.5px; color: var(--ink-3); margin-bottom: 5px; }
.ntc-in, .ntc-ta {
  width: 100%; border: 1px solid var(--line-2); border-radius: 9px;
  background: var(--surface); color: var(--ink); font-size: 13.5px; padding: 9px 11px;
}
.ntc-in { height: 36px; margin-bottom: 13px; }
.ntc-ta { line-height: 1.65; resize: vertical; min-height: 140px; }
.ntc-in:focus, .ntc-ta:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
/* 手写弹窗：材料名称那一行右边挂个「从材料表里选择」，表里有就别手打名字了 */
.qc-lb-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 5px; }
.qc-lb-row .ntc-lb { margin-bottom: 0; }
.qc-pick {
  flex: none; height: 24px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: 999px;
  background: transparent; color: var(--ink-3); font-size: 11.5px; font-weight: 500; line-height: 22px;
  white-space: nowrap;
}
.qc-pick:hover { border-color: var(--brand); color: var(--brand); background: #fff; }

.hm-kpis { display: flex; gap: 20px; flex-wrap: wrap; }
.hm-kpi { min-width: 84px; }
.hm-kpi b { font-size: 27px; font-weight: 650; letter-spacing: -1px; font-variant-numeric: tabular-nums; display: block; line-height: 1.1; }
.hm-kpi span { font-size: 12px; color: var(--ink-3); }
.hm-kpi.is-warn b { color: var(--danger); }
.hm-kpi.is-ok b { color: var(--ok); }

/* 盘库预警列表 */
.alert-list { display: flex; flex-direction: column; gap: 8px; }
.alert-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border: 1px solid #f3cdc7; background: #fff8f7;
  border-radius: 10px;
}
.alert-item .ai-main { min-width: 0; flex: 1; }
.alert-item .ai-name { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.alert-item .ai-sub { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.alert-item .ai-num { text-align: right; flex: none; }
.alert-item .ai-num b { color: var(--danger); font-size: 17px; font-variant-numeric: tabular-nums; }
.alert-item .ai-num span { display: block; font-size: 11.5px; color: var(--ink-3); }
.hm-empty { color: var(--ink-3); font-size: 13px; padding: 14px; text-align: center; background: var(--surface-2); border-radius: 10px; }

/* 首页：概览短文（事先生成的一篇话） */
.brief-body { min-width: 0; }
.brief-h {
  font-size: 12.5px; font-weight: 600; color: var(--brand);
  letter-spacing: .2px; margin-bottom: 8px;
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
}
.brief-h .brief-at { font-weight: 400; color: var(--ink-3); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.brief-body p {
  font-size: 13.5px; line-height: 1.95; color: var(--ink-2);
  margin: 0 0 9px; word-break: break-word;
}
.brief-body p:last-child { margin-bottom: 0; color: var(--ink-3); font-size: 12.5px; }

/* 首页：出勤卡片顶上的「昨天」汇总 */
.att-yest {
  font-size: 12.5px; color: var(--ink-2); line-height: 1.7;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 9px; padding: 9px 11px; margin-bottom: 12px;
}
.att-yest b { font-variant-numeric: tabular-nums; color: var(--ink); }
@media (max-width: 560px) {
  .brief-body p { font-size: 13px; line-height: 1.9; }
}

/* 首页：出勤概览 */
.ov-att { display: flex; flex-direction: column; gap: 10px; }
.ov-att-row { display: flex; align-items: center; gap: 12px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.ov-att-row .oa-name { width: 52px; font-weight: 600; font-size: 13.5px; flex: none; }
.ov-att-row .oa-nums { display: flex; gap: 16px; flex: 1; min-width: 0; flex-wrap: wrap; }
.ov-att-row .oa-num { flex: none; white-space: nowrap; }
.ov-att-row .oa-num b { font-size: 15px; font-variant-numeric: tabular-nums; }
.ov-att-row .oa-num span { font-size: 11.5px; color: var(--ink-3); }
.ov-att-row.is-bad { border-color: #f3cdc7; background: #fff8f7; }

/* 首页：海柜进度（旧的全宽横条已换成左右两栏，下面的 .flow-* 已无人引用，留着备查） */

/* 海柜进度：左列阶段压窄（固定上限，屏幕再宽也不跟着拉长），右列放待入库材料 */
.sea-split {
  display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr);
  gap: 16px; align-items: start; min-width: 0;
}
.sea-stages, .sea-matbox { min-width: 0; }
.sea-stage-grid { display: flex; flex-direction: column; gap: 7px; }
.sea-col-h {
  font-size: 11.5px; color: var(--ink-3); letter-spacing: .02em;
  display: flex; align-items: baseline; gap: 4px; margin-bottom: 8px; white-space: nowrap;
}
.sea-col-h b { font-size: 12.5px; font-weight: 650; color: var(--ink); font-variant-numeric: tabular-nums; }
.sea-stage { display: flex; align-items: center; gap: 8px; }
.sea-stage .ss-l { flex: none; width: 56px; font-size: 12.5px; color: var(--ink-2); }
.sea-stage .ss-t {
  flex: 1; min-width: 16px; height: 6px; border-radius: 999px;
  background: var(--surface-3); overflow: hidden;
}
.sea-stage .ss-t i {
  display: block; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--brand-2), var(--brand));
}
.sea-stage .ss-n {
  flex: none; width: 18px; text-align: right; font-size: 12.5px; font-weight: 600;
  font-variant-numeric: tabular-nums; color: var(--ink);
}
.sea-stage.is-zero .ss-l, .sea-stage.is-zero .ss-n { color: var(--ink-3); font-weight: 500; }
/* 0 票的阶段不画底槽，否则 7 条灰线看着像表格分隔线 */
.sea-stage.is-zero .ss-t { background: transparent; }

.sea-matbox { border-left: 1px solid var(--line); padding-left: 16px; }
.sea-mats {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; max-height: 202px; overflow-y: auto; overscroll-behavior: contain;
}
.sea-mat {
  display: flex; align-items: baseline; gap: 8px;
  padding: 5px 2px 5px 0; border-bottom: 1px solid var(--line);
}
.sea-mat:last-child { border-bottom: 0; }
.sea-mat .sm-n {
  flex: 1; min-width: 0; font-size: 12.5px; color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sea-mat .sm-b {
  flex: none; font-size: 11px; color: var(--ink-3);
  background: var(--surface-2); border-radius: 4px; padding: 1px 5px;
}
.sea-mat .sm-q {
  flex: none; font-size: 13px; font-weight: 600; color: var(--ink);
  font-variant-numeric: tabular-nums; text-align: right;
}
.sea-mat .sm-q em { font-style: normal; font-size: 11.5px; font-weight: 500; color: var(--ink-3); margin-left: 2px; }
.sea-mat-empty { font-size: 12.5px; color: var(--ink-3); line-height: 1.75; padding: 2px 0 4px; }
.sea-mat-note { font-size: 11.5px; color: var(--ink-3); margin-top: 7px; }

/* ---------- 出勤 ---------- */
.att-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.att-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; box-shadow: var(--shadow-sm); }
.att-card.is-bad { border-color: #f0c9c3; }
.att-card-top { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.att-card-top h3 { font-size: 16px; font-weight: 650; }
.att-card-top .att-tag { margin-left: auto; }
.att-metrics { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.att-metric { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.att-metric .am-label { font-size: 12px; color: var(--ink-3); }
.att-metric .am-val { font-size: 22px; font-weight: 650; font-variant-numeric: tabular-nums; margin-top: 3px; }
.att-metric .am-val small { font-size: 12.5px; font-weight: 400; color: var(--ink-3); }
.att-metric.is-low .am-val { color: var(--danger); }
.att-note { margin-top: 12px; font-size: 12.5px; color: var(--ink-2); background: var(--surface-2); border-radius: 8px; padding: 9px 11px; }
.att-note:empty { display: none; }
.att-foot { margin-top: 14px; display: flex; gap: 8px; }
.att-none { color: var(--ink-3); font-size: 13px; padding: 26px 0; text-align: center; }

/* ---------- 盘库 ---------- */
.inv-toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.inv-toolbar .inv-search { height: 34px; padding: 0 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); font-size: 13px; min-width: 220px; }
.inv-table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow-sm); }
.inv-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.inv-table th { text-align: left; font-weight: 600; color: var(--ink-2); font-size: 12px; padding: 11px 14px; background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
.inv-table td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.inv-table tr:last-child td { border-bottom: 0; }
.inv-table tbody tr:hover { background: #fafcff; }
.inv-table tr.is-low { background: #fff8f7; }
.inv-table tr.is-low:hover { background: #fff1ef; }
.inv-table .num { font-variant-numeric: tabular-nums; }
.inv-table .inv-name { font-weight: 600; }
.inv-table .inv-ops { display: flex; gap: 6px; justify-content: flex-end; }
.inv-empty { padding: 34px; text-align: center; color: var(--ink-3); font-size: 13px; }
/* 价格表「只画 150 行」的分界条：告诉人还剩多少，点一下再加一屏 */
.pr-more {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 10px 14px; border-top: 1px solid var(--line); background: var(--surface-2);
  font-size: 12.5px; color: var(--ink-3); font-variant-numeric: tabular-nums;
}
.pr-more .btn { flex: none; }
@media (max-width: 640px) {
  .pr-more { padding: 10px 12px; font-size: 12px; }
  .pr-more .btn { height: 34px; }
}
.inv-summary { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 12px; font-size: 12.5px; color: var(--ink-2); }
.inv-summary b { color: var(--ink); }
.inv-summary .is-danger { color: var(--danger); }

/* ---------------- 日常盘库（按星期） ---------------- */
.inv-week { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 12px; }
.inv-day {
  display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 13px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface);
  color: var(--ink-2); font-size: 13px; cursor: pointer; transition: .15s; white-space: nowrap;
}
.inv-day:hover { border-color: var(--brand); color: var(--brand); }
.inv-day.is-on { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
/* 星期条上的品类名：比星期小一号、颜色淡一档，不抢星期本身 */
.inv-day-cat { font-size: 11.5px; font-weight: 500; color: var(--ink-3); }
.inv-day.is-on .inv-day-cat { color: rgba(255,255,255,.86); }
.inv-day-num {
  font-size: 11px; padding: 0 6px; border-radius: 999px;
  background: var(--surface-3); color: var(--ink-2); font-variant-numeric: tabular-nums;
}
.inv-day.is-on .inv-day-num { background: rgba(255,255,255,.24); color: #fff; }
.inv-hint { font-size: 12.5px; color: var(--ink-3); }

/* 拍照找料：工具栏按钮 + 结果条 */
.inv-cam { white-space: nowrap; letter-spacing: .04em; }
.vis-panel {
  display: flex; gap: 12px; align-items: flex-start;
  margin-bottom: 14px; padding: 12px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); box-shadow: var(--shadow-sm);
}
.vis-panel[hidden] { display: none; }
.vis-thumb {
  width: 84px; height: 84px; flex: 0 0 84px; object-fit: cover;
  border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2);
}
.vis-main { flex: 1 1 auto; min-width: 0; }
.vis-status { font-size: 12.5px; color: var(--ink-3); line-height: 1.55; margin-bottom: 8px; word-break: break-all; }
.vis-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.vis-chip {
  display: inline-flex; flex-direction: column; gap: 2px; align-items: flex-start;
  max-width: 100%; padding: 7px 12px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--ink);
  font: inherit; text-align: left;
}
.vis-chip b { font-size: 13px; font-weight: 600; }
.vis-chip span { font-size: 11.5px; color: var(--ink-3); }
.vis-chip:hover { border-color: var(--brand); color: var(--brand); }
.vis-chip.is-on { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }
.vis-close {
  flex: 0 0 auto; border: 0; background: transparent; cursor: pointer;
  color: var(--ink-3); font-size: 13px; line-height: 1; padding: 4px 2px;
}
.vis-close:hover { color: var(--ink); }
@media (max-width: 640px) {
  .vis-panel { padding: 10px; gap: 10px; }
  .vis-thumb { width: 64px; height: 64px; flex-basis: 64px; }
  .vis-chip { padding: 6px 10px; }
  .vis-chip b { font-size: 12.5px; }
}
/* 查看页顶部的近 7 天范围条（替代盘点页的星期条） */
.inv-range { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.inv-range-tag {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 13px;
  border: 1px dashed var(--line-2); border-radius: 10px; background: var(--surface-2);
  font-size: 13px; color: var(--ink-2); white-space: nowrap;
}
.inv-range-tag b { color: var(--brand); font-variant-numeric: tabular-nums; }
.inv-week[hidden], .inv-range[hidden], .pt-date[hidden] { display: none !important; }
.inv-table .inv-muted { color: var(--ink-3); font-size: 12.5px; }
.inv-item-alt {
  font-size: 11.5px; color: var(--ink-3); margin-top: 2px; max-width: 360px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.inv-qty {
  width: 96px; height: 30px; padding: 0 8px; text-align: right;
  border: 1px solid var(--line); border-radius: 8px; background: var(--surface);
  font-size: 13px; font-variant-numeric: tabular-nums;
}
.inv-qty:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.inv-note {
  width: 100%; height: 30px; padding: 0 9px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--surface); font-size: 12.5px;
}
.inv-note:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.inv-table tr.is-filled td { background: #f5fbf7; }
.inv-table tr.is-filled:hover td { background: #eef8f1; }
.inv-foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 14px; }
.inv-foot-num { font-size: 13px; color: var(--ink-2); }
.inv-foot-num b { color: var(--ink); }
.inv-foot-num b.is-ok { color: var(--ok); }
.inv-days { display: flex; gap: 14px; flex-wrap: wrap; padding-top: 4px; }
.inv-chk { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.inv-chk input { width: 15px; height: 15px; }

/* ---------- 矿棉板吊顶计算 ---------- */
.cc-opts {
  display: flex; gap: 10px 16px; flex-wrap: wrap; align-items: flex-end;
  padding: 13px 16px; margin-bottom: 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
}
.cc-f { display: flex; flex-direction: column; gap: 5px; }
.cc-f > span { font-size: 11.5px; color: var(--ink-3); }
.cc-sel {
  height: 32px; padding: 0 9px; border: 1px solid var(--line-2); border-radius: 8px;
  background: var(--surface); color: var(--ink); font-size: 13px; min-width: 86px;
}
/* 吊顶高度这类数字参数：跟下拉同高，窄一点 */
.cc-inp {
  width: 104px; height: 32px; padding: 0 9px; box-sizing: border-box;
  border: 1px solid var(--line-2); border-radius: 8px;
  background: var(--surface); color: var(--ink); font-size: 13px; font-family: inherit;
}
.cc-inp:focus { outline: none; border-color: var(--brand); }
.cc-inp::placeholder { color: #a9b6c7; font-size: 12px; }
.cc-fixed {
  flex: 1 1 100%; margin-top: 2px; padding: 8px 11px;
  background: var(--surface-2); border: 1px dashed var(--line-2); border-radius: 8px;
  font-size: 12px; color: var(--ink-2); line-height: 1.5;
}
.cc-tip {
  padding: 9px 12px; margin-bottom: 10px; border-radius: 9px;
  background: var(--surface-2); border: 1px solid var(--line); border-left: 3px solid var(--brand);
  font-size: 12.5px; color: var(--ink-2); line-height: 1.6;
}
.cc-sect { margin-bottom: 16px; }
.cc-rooms, .cc-table { max-width: 900px; }
.cc-rooms, .cc-table { table-layout: fixed; width: 900px; max-width: 100%; }
.cc-table th:nth-child(2) { width: 110px; }
.cc-table td { white-space: normal; }
.cc-sect-h.is-left { justify-content: flex-start; gap: 12px; }
.cc-sect-h {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-bottom: 9px; font-size: 13px; font-weight: 600; color: var(--ink);
}
.cc-sect-h .cc-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.cc-rooms .cc-in {
  width: 100%; height: 30px; padding: 0 9px; border: 1px solid var(--line-2); border-radius: 7px;
  background: var(--surface); color: var(--ink); font-size: 13px;
}
.cc-rooms .cc-in:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.cc-rooms .cc-name { min-width: 140px; }
.cc-num, .cc-area { text-align: right; font-variant-numeric: tabular-nums; }
.cc-table td { padding: 9px 12px; }
.cc-check {
  margin-top: 10px; padding: 10px 13px; border-radius: 9px;
  background: var(--surface-2); border: 1px dashed var(--line-2);
  font-size: 12.5px; color: var(--ink-2); line-height: 1.6;
}

/* ---------- 工作助手 ---------- */
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }

/* 桌面端让每一行等高：短卡片的描述区留白，换所有「打开 XX」按钮落在同一组水平线上 */
@media (min-width: 700px) {
  .tool-grid { grid-auto-rows: 1fr; }
  .adm-grid { grid-auto-rows: 1fr; }
}
/* 卡片撑满行高、描述占满剩余空间，按钮吸在卡片底部：
   同一行的「打开 XX」按钮落在同一条水平线上，不受描述文字长短影响 */
.tool-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: 20px; box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; height: 100%; min-width: 0;
}
.tool-card .tc-ic { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); margin-bottom: 12px; flex: none; }
.tool-card h3 { font-size: 15px; font-weight: 650; }
.tool-card p { font-size: 12.5px; color: var(--ink-2); margin-top: 5px; line-height: 1.6; flex: 1 1 auto; }
.tool-card .adm-go, .tool-card .tc-soon { align-self: flex-start; margin-top: 14px; flex: none; }
.tool-card .tc-soon { display: inline-block; font-size: 11.5px; color: var(--warn); background: var(--warn-soft); border-radius: 999px; padding: 2px 9px; }
.tool-note { margin-top: 18px; font-size: 12.5px; color: var(--ink-2); background: var(--surface); border: 1px dashed var(--line-2); border-radius: 10px; padding: 12px 14px; }

/* ---------- 材料图册 ---------- */
.cat-bar { display: flex; align-items: center; gap: 12px; margin: 0 0 14px; flex-wrap: wrap; }
.cat-search {
  width: 100%; max-width: 380px; font: inherit; font-size: 14px;
  padding: 9px 13px; border: 1px solid var(--line); border-radius: 9px;
  background: var(--surface); color: var(--ink);
  -webkit-appearance: none; appearance: none;
}
.cat-search::placeholder { color: var(--ink-3); }
.cat-search:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.cat-sel {
  font: inherit; font-size: 13.5px; padding: 9px 30px 9px 12px;
  border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--ink);
  -webkit-appearance: none; appearance: none; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%), linear-gradient(135deg, var(--ink-3) 50%, transparent 50%);
  background-position: calc(100% - 15px) 17px, calc(100% - 10px) 17px;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat;
}
.cat-sel:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.cat-hit { font-size: 12.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.cat-card {
  margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  overflow: hidden; cursor: zoom-in; box-shadow: var(--shadow-sm);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.cat-card:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(0,0,0,.09); border-color: var(--line-2); }
.cat-ph {
  position: relative; aspect-ratio: 4 / 3; background: var(--surface-2);
  display: grid; place-items: center; overflow: hidden;
}
/* 图要完整显示，不裁切：留白也不要紧，材料照片裁掉边角反而看不懂 */
.cat-ph img { width: 100%; height: 100%; object-fit: contain; display: block; }
.cat-ph.is-empty::after {
  content: '暂无图片'; font-size: 12px; color: var(--ink-3);
}
.cat-card figcaption { padding: 10px 12px 12px; display: flex; align-items: flex-start; gap: 8px; }
.cat-txt { min-width: 0; flex: 1 1 auto; }
.cat-name { font-size: 14px; font-weight: 650; color: var(--ink); line-height: 1.35; }
.cat-spec { margin-top: 4px; font-size: 12.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
/* 每张卡片的「复制」：复制这一种材料的名称 + 规格 */
.cat-cp {
  flex: none; font: inherit; font-size: 11.5px; line-height: 1; padding: 5px 8px;
  border: 1px solid var(--line); border-radius: 7px; background: var(--surface);
  color: var(--ink-2); cursor: pointer; white-space: nowrap;
  transition: color .14s, border-color .14s, background .14s;
}
.cat-cp:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }
.cat-cp:active { transform: translateY(1px); }
.cat-cp:disabled { opacity: .6; cursor: default; }

.cat-lightbox {
  position: fixed; inset: 0; z-index: 90; background: rgba(12,14,18,.86);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; padding: 32px; cursor: zoom-out;
}
.cat-lightbox img {
  max-width: min(1000px, 92vw); max-height: 78vh; object-fit: contain;
  border-radius: 10px; background: #fff; box-shadow: 0 18px 50px rgba(0,0,0,.45);
}
.cat-lb-cap { font-size: 13.5px; color: rgba(255,255,255,.92); text-align: center; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; justify-content: center; }
/* 原图档要从数据库取，大图会有 1~2 秒，给个提示别让人以为卡住 */
.cat-lb-hd {
  font-size: 12px; color: rgba(255,255,255,.72); letter-spacing: .3px;
  padding: 3px 10px; border-radius: 999px; background: rgba(255,255,255,.1);
}
.cat-lb-fix {
  font: inherit; font-size: 12.5px; padding: 6px 14px; border-radius: 8px;
  border: 1px solid rgba(255,255,255,.38); background: rgba(255,255,255,.1);
  color: #fff; cursor: pointer;
}
.cat-lb-fix:hover { background: rgba(255,255,255,.22); }
.cat-lb-fix:disabled { opacity: .6; cursor: default; }
.cat-lb-cp {
  font: inherit; font-size: 12.5px; padding: 6px 14px; border-radius: 8px;
  border: 1px solid rgba(255,255,255,.38); background: rgba(255,255,255,.1);
  color: #fff; cursor: pointer;
}
.cat-lb-cp:hover { background: rgba(255,255,255,.22); }

/* 管理页 · 材料图册列表 */
.cat-th {
  width: 56px; height: 56px; border-radius: 8px; overflow: hidden;
  background: var(--surface-2); border: 1px solid var(--line);
  display: grid; place-items: center;
}
.cat-th img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cat-th span { font-size: 11px; color: var(--ink-3); }
.cat-mv { min-width: 30px; padding-left: 0; padding-right: 0; text-align: center; font-size: 13px; }
.cat-edit-pic {
  width: 100%; height: 190px; border-radius: 10px; overflow: hidden;
  background: var(--surface-2); border: 1px solid var(--line);
  display: grid; place-items: center;
}
.cat-edit-pic img { width: 100%; height: 100%; object-fit: contain; display: block; }
.cat-edit-bar { display: flex; align-items: center; gap: 10px; margin-top: 9px; flex-wrap: wrap; }
.cat-edit-bar label.btn { cursor: pointer; }

/* ---------- 材料价格表 ---------- */
.pr-price { text-align: right; font-variant-numeric: tabular-nums; font-weight: 650; color: var(--ink); white-space: nowrap; }
/* 材料顺序：↓ 下移一位 / 末尾 移到最后。同名 / 同类的料按这个顺序被 AI 先挑到，所以顺序可调 */
.pr-move { min-height: 26px; padding: 0 8px; font-size: 14px; line-height: 1; }
.pr-move-last { font-size: 12px; padding: 0 7px; letter-spacing: 0; }
.pr-move[disabled], .inv-ops .btn[disabled] { opacity: .3; cursor: default; }
.pr-moves { display: flex; gap: 4px; justify-content: flex-end; align-items: center; }
/* 名称格：类别（小字）→ 中文名 → 【常见叫法】→ 泰文名，没有的就不占行 */
.pr-cat { font-size: 11px; line-height: 1.5; color: var(--ink-3); font-weight: 400; letter-spacing: .2px; }
.pr-nm { font-weight: 650; color: var(--ink); line-height: 1.45; }
/* 材料名称后面的小喇叭：点一下朗读这一项的名称（和日常盘库同一套语音包） */
.pr-speak {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 20px; height: 20px; margin-left: 6px; padding: 0;
  border: 1px solid var(--line-2); border-radius: 50%; background: var(--surface);
  color: var(--ink-2); cursor: pointer; vertical-align: -3px;
  -webkit-tap-highlight-color: transparent;
}
/* 手机上圆圈只有 20px，手指不好点：把可点范围往外撑到 36px，视觉不变 */
@media (pointer: coarse) {
  .pr-speak::after { content: ''; position: absolute; inset: -8px; }
}
.pr-speak:hover { color: var(--brand); border-color: var(--brand); }
.pr-speak:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.pr-speak.is-speaking { background: var(--brand); border-color: var(--brand); color: #fff; }
.pr-speak.is-speaking svg { animation: speakPulse 1.1s ease-in-out infinite; }
.pr-speak:disabled { cursor: default; opacity: .8; }
.pr-al { font-size: 11px; line-height: 1.5; color: var(--ink-3); font-weight: 400; margin-top: 1px; overflow-wrap: anywhere; }
.pr-th { font-size: 11.5px; line-height: 1.5; color: var(--ink-3); font-weight: 400; margin-top: 1px; overflow-wrap: anywhere; }
/* 单位格里跟在基本单位后面的「其他单位」：+片、张 */
.pr-units { display: block; font-size: 10.5px; line-height: 1.45; color: var(--ink-3); font-weight: 400; margin-top: 1px; overflow-wrap: anywhere; }
.pr-cut { color: var(--brand); font-weight: 700; }
/* 电动工具报价表：折后单价列 + 手机上保住名称列（多列时挤不下就横向滑动） */
.tl-disc { min-width: 132px; }
#tlWrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
@media (max-width: 640px) {
  /* 手机上收起「序号」「规格」，保住名称 + 两个价格并排，不用横滑 */
  #tlWrap .inv-table th:nth-child(1), #tlWrap .inv-table td:nth-child(1) { display: none; }
  #tlWrap .inv-table th:nth-child(2), #tlWrap .inv-table td:nth-child(2) { display: table-cell; }
  #tlWrap .inv-table th:nth-child(3), #tlWrap .inv-table td:nth-child(3) { display: none; }
  #tlWrap .inv-table th, #tlWrap .inv-table td { padding: 10px 6px; }
  #tlWrap .inv-table th { font-size: 11px; }
  #tlWrap .inv-table td { font-size: 12.5px; }
}
.pr-hint { margin: 8px 0 6px; font-size: 12.5px; color: var(--ink-3); line-height: 1.65; }

/* ---------- 管理页 ---------- */
.adm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.adm-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: 20px; box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; min-width: 0;
}
.adm-card .tc-ic {
  width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand); margin-bottom: 12px; font-size: 18px;
}
.adm-card h3 { font-size: 15px; font-weight: 650; }
.adm-card p { font-size: 12.5px; color: var(--ink-2); margin-top: 5px; line-height: 1.6; flex: 1; }
.adm-card .adm-go { margin-top: 14px; align-self: flex-start; }
.adm-card .tc-soon { align-self: flex-start; margin-top: 14px; }

/* ---------- 权限配置弹窗 ---------- */
.perm-wrap { font-size: 13px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.perm-scroll-tip { display: none; color: var(--ink-3); font-size: 12px; margin: 0 0 8px; }
.adm-meta { display: none; }
.perm-hint { color: var(--ink-2); font-size: 12.5px; margin-bottom: 14px; line-height: 1.6; }
.perm-table { width: 100%; border-collapse: collapse; min-width: 580px; }
.perm-table .perm-admin-col { border-left: 1px solid var(--line-2); }
.perm-table th, .perm-table td { padding: 10px 10px; border-bottom: 1px solid var(--line); text-align: center; }
.perm-table th { font-size: 11.5px; color: var(--ink-2); font-weight: 600; background: var(--surface-2); }
.perm-table th:first-child, .perm-table td:first-child { text-align: left; }
.perm-table .pm-name { font-weight: 600; }
.perm-table .pm-sub { font-size: 11.5px; color: var(--ink-3); font-weight: 400; }
.perm-table tr.is-admin td { background: #f7fbff; color: var(--ink-3); }
.perm-table .pm-fixed { font-size: 12px; color: var(--ok); }
.perm-check { width: 16px; height: 16px; accent-color: var(--brand); cursor: pointer; }
.perm-group-head td { background: var(--surface-3); font-weight: 600; font-size: 12px; color: var(--ink-2); text-align: left; padding: 7px 10px; }
.perm-save-bar { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
.perm-save-bar .perm-msg { font-size: 12.5px; color: var(--ink-3); }
.perm-save-bar .perm-msg.ok { color: var(--ok); }
.perm-save-bar .perm-msg.err { color: var(--danger); }

/* ---------- 表单弹窗内 ---------- */
.pf-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.pf-row.one { grid-template-columns: 1fr; }
.pf-row.three { grid-template-columns: 1fr 1fr 1fr; }
.pf-field label { display: block; font-size: 12.5px; color: var(--ink-2); margin-bottom: 5px; font-weight: 500; }
.pf-field input, .pf-field select, .pf-field textarea {
  width: 100%; height: 38px; padding: 0 11px; border: 1px solid var(--line-2);
  border-radius: 9px; background: var(--surface); font-size: 13.5px; outline: none;
}
/* 只读字段：姓名 / 岗位（编辑时锁死，以人员管理为准） */
.pf-static {
  display: flex; align-items: center; min-height: 38px; padding: 8px 11px;
  border: 1px solid var(--line); border-radius: 9px; background: var(--surface-2);
  color: var(--ink); font-size: 13.5px; line-height: 1.5;
  overflow-wrap: anywhere;
}
.pf-note {
  margin-top: 8px; padding: 7px 10px; border-radius: 8px; line-height: 1.55;
  font-size: 12px; color: #8a5a12; background: #fff7e8; border: 1px solid #f1ddb9;
}
.pf-row[hidden], .pf-note[hidden] { display: none !important; }
.pf-field textarea { height: 76px; padding: 9px 11px; resize: vertical; }
.pf-field input:focus, .pf-field select:focus, .pf-field textarea:focus { border-color: var(--brand-2); box-shadow: 0 0 0 3px rgba(22,104,179,.1); }
.pf-err { color: var(--danger); font-size: 12.5px; min-height: 18px; margin-top: 8px; }

/* ---------- 响应式 ---------- */
@media (max-width: 1024px) {
  .hm-card.span-7, .hm-card.span-5, .hm-card.span-6, .hm-card.span-4 { grid-column: span 12; }
  .att-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .page-view:not(#page-containers) { padding: 16px 14px 60px; }
  .portal-nav { padding: 0 10px; }
  .pt-head h1 { font-size: 19px; }
  /* 只对盘库「查看 / 盘点」表隐藏第 2 列（类别）：
   * 价格表、工具报价表的第 2 列是材料名称，绝不能跟着一起藏 */
  .inv-table.inv-view th:nth-child(2), .inv-table.inv-view td:nth-child(2),
  .inv-table.inv-count th:nth-child(2), .inv-table.inv-count td:nth-child(2) { display: none; }
  /* 海柜进度：手机上左右两栏改成上下，阶段排成两列省高度 */
  .sea-split { grid-template-columns: 1fr; gap: 12px; }
  .sea-stage-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px; }
  .sea-matbox { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); padding-top: 10px; }
  .sea-mats { max-height: none; }
}

/* ============================================================
   出勤（按人明细 · 中/缅双语）
   ============================================================ */
.att-tabs { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.att-tab {
  display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 14px;
  border-radius: 9px; border: 1px solid var(--line); background: var(--surface);
  color: var(--ink-2); font-size: 13.5px; font-weight: 500; cursor: pointer; transition: .15s;
}
.att-tab:hover { border-color: var(--brand-2); color: var(--brand); }
.att-tab.is-on { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); font-weight: 650; }
.att-tab-num {
  font-size: 11.5px; min-width: 18px; height: 18px; border-radius: 999px;
  background: var(--surface-3); color: var(--ink-2);
  display: inline-grid; place-items: center; padding: 0 5px;
}
.att-tab.is-on .att-tab-num { background: var(--brand); color: #fff; }
/* 当前仓库的管理员（管理页设置） */
.att-wh-mgr {
  margin-left: auto; display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 12px;
  border-radius: 9px; background: var(--surface-2); border: 1px dashed var(--line-2);
  font-size: 12.5px; color: var(--ink-2); white-space: nowrap;
}
.att-wh-mgr-k { color: var(--ink-3); }
.att-wh-mgr b { font-weight: 650; color: var(--ink); }
.att-wh-mgr.is-empty b { font-weight: 400; color: var(--ink-3); }

/* ---------------- 仓库考勤：上下班拍照 ----------------
 * 整仓每天两格（上班 / 下班），不绑到具体人 —— 拍的是仓库当天的样子。
 * 手机上 input[capture] 直接起相机，这里只管展示。 */
.att-photos {
  border: 1px solid var(--line); border-radius: 12px; background: var(--surface);
  padding: 14px 16px 16px; margin-bottom: 14px;
}
.ap-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.ap-head b { font-size: 14px; font-weight: 650; }
.ap-head span { font-size: 12px; color: var(--ink-3); }
.ap-grp + .ap-grp { margin-top: 14px; }
.ap-grp-h {
  display: flex; align-items: center; gap: 7px; margin-bottom: 8px;
  font-size: 12.5px; font-weight: 650; color: var(--ink-2);
}
.ap-grp-h::before { content: ''; width: 3px; height: 12px; border-radius: 2px; background: var(--brand); }
.ap-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; max-width: 680px; }
.ap-grid.is-one { grid-template-columns: 1fr; max-width: 330px; }
.ap-cell {
  position: relative; border: 1px dashed var(--line-2); border-radius: 11px;
  background: var(--surface-2); overflow: hidden; min-height: 150px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
}
.ap-cell.has-photo { border-style: solid; border-color: var(--line); background: #0b1622; padding: 0; }
.ap-cell.is-busy { opacity: .5; pointer-events: none; }
.ap-ph { width: 28px; height: 28px; color: var(--ink-3); }
.ap-ph svg { width: 100%; height: 100%; }
.ap-label { font-size: 13px; color: var(--ink-2); font-weight: 600; }
.ap-muted { font-size: 12px; color: var(--ink-3); }
.ap-cell.is-empty .ap-take { margin-top: 2px; }
.ap-shot {
  display: block; width: 100%; aspect-ratio: 4 / 3; border: 0; padding: 0;
  background: #0b1622; cursor: zoom-in; overflow: hidden;
}
.ap-shot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ap-shot .ap-muted { color: #9fb2c4; }
.ap-meta {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  width: 100%; padding: 7px 10px; background: var(--surface);
}
.ap-meta .ap-label { font-size: 12.5px; }
.ap-time { font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.ap-retake {
  position: absolute; right: 8px; top: 8px; height: 27px; padding: 0 10px;
  border-radius: 7px; border: 1px solid rgba(255, 255, 255, .55);
  background: rgba(8, 20, 32, .58); color: #fff; font-size: 12px; cursor: pointer;
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
.ap-retake:hover { background: rgba(8, 20, 32, .8); }

/* ---------------- 业务打卡（岗位=业务，只能本人打） ---------------- */
.bz-me { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); padding: 16px 18px 18px; }
.bz-me-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.bz-me-head b { font-size: 16px; font-weight: 650; }
.bz-role { display: block; font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.bz-day { margin-left: auto; font-size: 12.5px; color: var(--ink-3); white-space: nowrap; }
.bz-punch { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; max-width: 520px; }
.bz-punch-item {
  display: flex; flex-direction: column; align-items: flex-start; gap: 8px;
  padding: 11px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2);
}
.bz-punch-item.is-done { border-color: #bfe0d2; background: #f2faf6; }
.bz-punch-item .btn { width: 100%; justify-content: center; }
.bz-k { font-size: 12px; color: var(--ink-3); }
.bz-clock { font-size: 20px; font-weight: 650; letter-spacing: -.4px; font-variant-numeric: tabular-nums; color: var(--ink); }
.bz-field { margin-top: 12px; }
.bz-field > label { display: block; font-size: 12.5px; color: var(--ink-2); font-weight: 600; margin-bottom: 6px; }
.bz-field > label .bz-hint { font-weight: 400; margin-left: 4px; }
.bz-field textarea {
  width: 100%; box-sizing: border-box; border: 1px solid var(--line); border-radius: 9px;
  padding: 9px 11px; font: inherit; font-size: 13.5px; line-height: 1.55;
  background: var(--surface); color: var(--ink); resize: vertical;
}
.bz-field textarea:focus { outline: 2px solid var(--brand-soft); border-color: var(--brand); }
.bz-field-foot { display: flex; align-items: center; gap: 10px; margin-top: 7px; }
.bz-hint { font-size: 12px; color: var(--ink-3); }
.bz-field-foot .btn { margin-left: auto; }
.bz-done-txt {
  border: 1px dashed var(--line-2); border-radius: 9px; padding: 10px 12px;
  font-size: 13.5px; line-height: 1.6; color: var(--ink); background: var(--surface-2); white-space: pre-wrap;
}
.bz-done-tip { font-size: 12.5px; color: var(--ink-3); padding: 8px 0; }
/* 昨天收工写的「明日计划」，今天只读显示成「今日计划」 */
.bz-planref {
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
  margin: 0 0 12px; padding: 8px 11px;
  border-left: 3px solid var(--brand-soft); border-radius: 0 9px 9px 0;
  background: var(--surface-2);
}
.bz-planref .bz-k { flex: none; font-weight: 600; color: var(--ink-2); }
.bz-planref p {
  flex: 1 1 160px; margin: 0; font-size: 12.5px; line-height: 1.55;
  color: var(--ink-2); white-space: pre-wrap; word-break: break-word;
}
.bz-planref-src { flex: none; font-size: 11.5px; color: var(--ink-3); }

.bz-sec { margin-top: 22px; }
.bz-sec-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.bz-sec-head h2 { font-size: 15px; font-weight: 650; margin: 0; }
.bz-sec-sub { font-size: 12.5px; color: var(--ink-3); }
.bz-warn {
  border: 1px solid #f0d9a8; background: #fdf7e7; color: #7a5b1b;
  font-size: 12.5px; line-height: 1.55; border-radius: 9px; padding: 9px 12px; margin-bottom: 10px;
}
.bz-team { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.bz-mem { border: 1px solid var(--line); border-radius: 11px; background: var(--surface); padding: 13px 14px; }
.bz-mem-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.bz-mem-top b { font-size: 14.5px; font-weight: 650; }
.bz-mem-sub { font-size: 12px; color: var(--ink-3); margin-top: 3px; }
.bz-mem-row { display: flex; gap: 8px; margin-top: 9px; }
.bz-mem-row p { margin: 0; font-size: 13px; line-height: 1.55; white-space: pre-wrap; word-break: break-word; color: var(--ink); }
.bz-tag { font-size: 11.5px; padding: 2px 8px; border-radius: 999px; font-weight: 600; white-space: nowrap; }
.bz-tag.is-none { background: var(--surface-3); color: var(--ink-3); }
.bz-tag.is-in { background: #e8f1fd; color: #1c5fa8; }
.bz-tag.is-done { background: #e7f6ee; color: #17694a; }
.bz-tag.is-warn { background: #fdf3df; color: #8a5a00; }

/* 业务打卡：照片 + 定位 */
.bz-done-line { display: flex; align-items: center; gap: 9px; }
.bz-need { font-size: 11.5px; color: var(--ink-3); }
.bz-geo { font-size: 11.5px; color: var(--ink-3); line-height: 1.45; word-break: break-all; }
.bz-geo.is-bad { color: #a4521b; font-weight: 600; }
.bz-thumb {
  width: 44px; height: 44px; flex: none; padding: 0; border: 1px solid var(--line);
  border-radius: 8px; overflow: hidden; background: var(--surface-3); cursor: zoom-in;
}
.bz-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bz-mem-shots { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 9px; }
.bz-mini { display: flex; align-items: center; gap: 7px; }
.bz-mini > span { font-size: 11.5px; color: var(--ink-3); line-height: 1.35; }

.bz-punch-form .pf-field + .pf-field { margin-top: 13px; }
.bz-shot {
  position: relative; width: 100%; max-width: 320px; aspect-ratio: 4 / 3;
  border: 1px solid var(--line); border-radius: 11px; overflow: hidden; background: #0b1622;
}
.bz-shot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bz-shot.is-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  border-style: dashed; border-color: var(--line-2); background: var(--surface-2); color: var(--ink-3);
}
.bz-shot-ph { width: 30px; height: 30px; color: var(--ink-3); }
.bz-shot-ph svg { width: 100%; height: 100%; }
.bz-shot-tip { font-size: 12px; color: var(--ink-3); }
.bz-shot-retake {
  position: absolute; right: 8px; top: 8px; height: 28px; padding: 0 11px;
  border-radius: 7px; border: 1px solid rgba(255, 255, 255, .55);
  background: rgba(8, 20, 32, .58); color: #fff; font-size: 12px; cursor: pointer;
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
.bz-shot-retake:hover { background: rgba(8, 20, 32, .8); }
.bz-geo-row {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  border: 1px solid var(--line); border-radius: 9px; padding: 9px 11px;
  background: var(--surface-2); font-size: 13px; line-height: 1.5; color: var(--ink-2);
}
.bz-geo-row.is-ok { border-color: #bfe0d2; background: #f2faf6; color: #17694a; }
.bz-geo-row.is-bad { border-color: #f0d9a8; background: #fdf7e7; color: #7a5b1b; }
.bz-geo-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }
.bz-geo-row.is-busy .bz-geo-dot { animation: bzPulse 1s ease-in-out infinite; }
@keyframes bzPulse { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }
.bz-geo-row .btn { margin-left: auto; }
.bz-geo-txt b { font-variant-numeric: tabular-nums; }
@media (max-width: 640px) {
  /* 手机弹窗里照片别占满屏，给计划和按钮留出位置 */
  .bz-shot { max-width: 232px; }
  .bz-geo-row { font-size: 12.5px; }
}

/* 管理 → 业务打卡记录（只读查询） */
.att-table.bz-log-table { min-width: 1180px; }
.att-table.bz-log-table td { vertical-align: top; }
.bz-log-table th:nth-child(1), .bz-log-table td:nth-child(1) { width: 118px; white-space: nowrap; }
.bz-log-table th:nth-child(2), .bz-log-table td:nth-child(2) { width: 128px; }
.bz-log-table th:nth-child(3), .bz-log-table td:nth-child(3),
.bz-log-table th:nth-child(4), .bz-log-table td:nth-child(4) { width: 128px; }
.bz-log-table th:nth-child(5), .bz-log-table td:nth-child(5) { width: 96px; }
.bz-log-t { display: flex; align-items: center; gap: 7px; }
.bz-log-t .bz-thumb { width: 36px; height: 36px; border-radius: 6px; }
.bz-log-geo {
  font-size: 11px; color: var(--ink-3); margin-top: 4px;
  font-variant-numeric: tabular-nums; word-break: break-all; line-height: 1.4;
}
.bz-log-geo.is-bad { color: #a4521b; font-weight: 600; }
.bz-log-txt {
  white-space: pre-wrap; word-break: break-word; max-width: 340px;
  font-size: 12.5px; line-height: 1.6; color: var(--ink-2);
}
.att-q-bar #blGo { margin-left: auto; }
/* 智能总结和查询捆在一起贴右边：手机上整体换到下一行，两个按钮仍并排 */
.att-q-actions { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; }
.att-q-bar .btn-ai { display: inline-flex; align-items: center; gap: 6px; }
.att-q-bar .btn-ai svg { flex: 0 0 auto; color: var(--brand); }
.att-q-bar .btn-ai:hover svg { color: var(--brand-strong, var(--brand)); }

/* ---------------- 业务打卡：AI 工作总结弹窗 ---------------- */
.aisum-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.aisum-seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 8px; overflow: hidden; background: var(--surface); }
.aisum-seg button {
  border: 0; background: transparent; padding: 6px 13px; font-size: 12.5px;
  color: var(--ink-2); cursor: pointer; white-space: nowrap;
}
.aisum-seg button + button { border-left: 1px solid var(--line); }
.aisum-seg button.is-on { background: var(--brand); color: #fff; font-weight: 600; }
.aisum-meta { font-size: 12px; color: var(--ink-3); }
.aisum-body {
  max-height: min(58vh, 540px); overflow: auto; overscroll-behavior: contain;
  padding: 2px 4px 6px 2px; font-size: 13.5px; line-height: 1.8; color: var(--ink);
}
.aisum-body h3 { font-size: 15px; font-weight: 650; margin: 18px 0 6px; letter-spacing: .01em; }
.aisum-body h4 {
  font-size: 14px; font-weight: 650; margin: 16px 0 5px; color: var(--ink);
  padding-left: 9px; border-left: 3px solid var(--brand); line-height: 1.4;
}
.aisum-body h3:first-child, .aisum-body h4:first-child { margin-top: 2px; }
.aisum-body p { margin: 0 0 8px; }
.aisum-body ul, .aisum-body ol { margin: 4px 0 10px; padding-left: 22px; }
.aisum-body ul { list-style: disc; }
.aisum-body ol { list-style: decimal; }
.aisum-body li { margin: 3px 0; display: list-item; }
.aisum-body li::marker { color: var(--ink-3); }
.aisum-body b { font-weight: 650; }
.aisum-body code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px; background: var(--surface-2); padding: 1px 4px; border-radius: 4px;
}
.aisum-wait { color: var(--ink-3); font-size: 13px; padding: 26px 8px; text-align: center; line-height: 1.9; }
.aisum-err { color: #b3261e; font-size: 12.8px; padding: 10px 0 2px; line-height: 1.7; }
.aisum-tip { margin-top: 10px; padding-top: 9px; border-top: 1px dashed var(--line); font-size: 11.5px; color: var(--ink-3); }
@media (max-width: 700px) {
  .att-q-bar .btn-ai { flex: 0 0 auto; }
  .att-q-actions { flex: 1 0 100%; justify-content: flex-end; }
  .aisum-body { max-height: 62vh; font-size: 13.5px; }
  .aisum-bar { gap: 8px; }
  .aisum-meta { flex: 1 1 100%; }
}

@media (max-width: 700px) {
  .bz-log-txt { max-width: 220px; }
  .att-q-bar #blGo { margin-left: 0; }
}
.stf-bind { font-size: 12.5px; color: var(--ink-2); }
.stf-bind.is-warn { color: #8a5a00; font-weight: 600; }

/* ---------------- 出勤页：车辆情况 ---------------- */
.veh-wrap { margin-top: 20px; }
.veh-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 10px; }
.veh-title { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.veh-title h2 { font-size: 15px; font-weight: 650; margin: 0; }
.veh-title span { font-size: 12px; color: var(--ink-3); }
.veh-chips { display: flex; align-items: center; gap: 8px; margin-left: auto; flex-wrap: wrap; }
.veh-chip {
  display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px;
  border-radius: 999px; font-size: 12px; background: var(--surface-2); color: var(--ink-2);
  border: 1px solid var(--line); white-space: nowrap;
}
.veh-chip b { font-weight: 650; font-variant-numeric: tabular-nums; }
.veh-chip i { width: 6px; height: 6px; border-radius: 50%; background: var(--ink-3); display: inline-block; }
.veh-chip.vst-run i { background: var(--ok); }
.veh-chip.vst-fix i { background: #d98014; }
.veh-table { min-width: 720px; }
.veh-plate { font-size: 14px; letter-spacing: .3px; font-variant-numeric: tabular-nums; }
/* 车辆名册里的缩略图：一车一张，点了看大图；没图时留一个灰底占位，列宽不跳 */
.veh-plate-cell { display: flex; align-items: center; gap: 9px; }
.veh-thumb {
  width: 46px; height: 34px; border-radius: 5px; flex: none;
  object-fit: cover; background: var(--surface-2); border: 1px solid var(--line);
}
.veh-thumb:not(.is-empty) { cursor: zoom-in; }
.veh-thumb.is-empty {
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 10.5px; color: var(--ink-3); font-weight: 400; letter-spacing: 0;
}
/* 表单里的车辆图片：比材料图小一点，够看清车就行。
 * 图片用绝对定位铺满容器 —— 不然在 grid 里 100% 高度会退化成按原图比例撑高，
 * 小预览框会被撑破，图上下被裁掉。 */
.veh-pic { width: 200px; height: 140px; position: relative; }
.veh-pic img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.veh-pic .pk-pic-empty { position: relative; }
.veh-pic-bar { margin-top: 8px; align-items: center; }
/* 车况汇报弹窗顶部：车辆照片只放一枚小缩略图，点开才看大图，不占掉半屏 */
.vr-pic {
  display: inline-flex; align-items: center; gap: 10px;
  margin-bottom: 12px; cursor: zoom-in; border-radius: 8px;
}
.vr-pic img {
  width: 88px; height: 64px; border-radius: 8px; object-fit: cover;
  border: 1px solid var(--line); background: var(--surface-2); display: block;
}
.vr-pic:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
.vr-pic-tip { font-size: 12px; color: var(--ink-3); }
@media (max-width: 700px) {
  .veh-thumb { width: 40px; height: 30px; }
  .veh-pic { width: 100%; height: 160px; }
  .vr-pic img { width: 72px; height: 54px; }
}
.veh-seg {
  display: inline-flex; border: 1px solid var(--line); border-radius: 9px;
  background: var(--surface); overflow: hidden;
}
.veh-st {
  border: 0; background: transparent; color: var(--ink-2); cursor: pointer;
  font-size: 12.5px; line-height: 1; padding: 7px 11px; white-space: nowrap;
  border-right: 1px solid var(--line); transition: .15s;
}
.veh-st:last-child { border-right: 0; }
.veh-st:not(.is-ro):not(.is-on):hover { background: var(--surface-2); }
.veh-st:disabled { cursor: default; }
/* 只读成员：按钮还是能点，点了会提示无权限——比灰掉不响应更好懂 */
.veh-st.is-ro { cursor: default; color: var(--ink-3); }
/* 当前状态：实心色块，一眼能看出选中的是哪个（浅色底在现场手机上容易看不清） */
.veh-st.is-on { color: #fff; font-weight: 650; box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.veh-st.vst-run.is-on { background: var(--ok); }
.veh-st.vst-fix.is-on { background: #d98014; }
.veh-status-cell { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.veh-report-btn {
  display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 11px;
  border: 1px dashed var(--line-2); border-radius: 9px; background: var(--surface);
  color: var(--ink-2); font-size: 12.5px; cursor: pointer; white-space: nowrap; transition: .15s;
}
.veh-report-btn:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }
.veh-report-btn .vr-ic { font-size: 11px; opacity: .75; }
/* 今天已经报过：点个小绿点，不是催交，只是别让人重复问 */
.veh-report-btn.is-done { border-style: solid; border-color: #bfe0cd; background: #f4fbf7; }
.veh-report-btn .vr-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); display: inline-block; margin-left: 1px; }
/* 车况列：基础车况下面挂最新一条汇报 */
.veh-last {
  margin-top: 4px; font-size: 11.5px; color: var(--ink-3);
  display: block; max-width: 250px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.veh-last b { color: var(--brand); font-weight: 600; }
/* 车况汇报弹窗 */
.vr-his { margin-top: 4px; border-top: 1px solid var(--line); padding-top: 12px; }
.vr-his h4 { font-size: 13px; margin: 0 0 8px; display: flex; align-items: center; gap: 7px; }
.vr-count { font-size: 11.5px; color: var(--ink-3); background: var(--surface-3); border-radius: 999px; padding: 1px 8px; }
.vr-list { list-style: none; margin: 0; padding: 0; max-height: 230px; overflow: auto; }
.vr-list li { padding: 9px 0; border-bottom: 1px dashed var(--line); }
.vr-list li:last-child { border-bottom: 0; }
.vr-meta { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink-2); margin-bottom: 3px; }
.vr-meta b { font-variant-numeric: tabular-nums; }
.vr-who { color: var(--ink-3); }
.vr-text { font-size: 13px; color: var(--ink); line-height: 1.65; white-space: pre-wrap; }
.vr-empty { font-size: 12.5px; color: var(--ink-3); padding: 4px 0 2px; }
/* 「选填」小标 + 提示：说清楚车况正常不用填，避免被人当成每日任务 */
.vr-opt {
  margin-left: 6px; font-size: 11px; font-weight: 400; color: var(--ink-3);
  background: var(--surface-3); border-radius: 999px; padding: 1px 7px;
}
.vr-hint { margin-top: 6px; font-size: 11.5px; color: var(--ink-3); line-height: 1.6; }

/* 首页「今日出勤」里的车辆提醒：有维修或有人报了车况才出现 */
.veh-note {
  margin: 0 0 12px; padding: 10px 12px;
  border: 1px solid #f2d9bd; border-radius: 10px; background: #fffaf3;
}
.vn-head { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: #8a5a17; }
.vn-head b { font-weight: 650; }
.vn-ic { color: #d98014; font-size: 13px; line-height: 1; }
.vn-n {
  background: #f8e6cb; color: #8a5a17; border-radius: 999px;
  padding: 0 7px; font-size: 11.5px; font-variant-numeric: tabular-nums;
}
.vn-more {
  margin-left: auto; border: 0; background: none; padding: 2px 0;
  color: var(--brand); font-size: 12px; cursor: pointer;
}
.vn-more:hover { text-decoration: underline; }
.vn-list { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.vn-list li { display: flex; align-items: center; gap: 8px; font-size: 12.5px; min-width: 0; }
.vn-plate { font-weight: 650; letter-spacing: .3px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.vn-wh { color: var(--ink-3); font-size: 11.5px; white-space: nowrap; }
.vn-tag { font-size: 11px; padding: 1px 7px; border-radius: 999px; white-space: nowrap; }
.vn-tag.is-fix { background: #fbe6cf; color: #a96618; }
.vn-tag.is-rep { background: var(--brand-soft); color: var(--brand); }
.vn-txt { flex: 1 1 auto; min-width: 0; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vn-who { color: var(--ink-3); font-size: 11.5px; white-space: nowrap; }
.vn-rest { margin-top: 7px; font-size: 11.5px; color: var(--ink-3); }

.att-sum {
  display: flex; gap: 24px; align-items: baseline; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: 14px 18px; margin-bottom: 14px; box-shadow: var(--shadow-sm);
}
.att-sum-item b { font-size: 22px; font-weight: 650; letter-spacing: -.5px; margin-right: 5px; }
.att-sum-item span { font-size: 12.5px; color: var(--ink-3); }
.att-sum-date { margin-left: auto; font-size: 12.5px; color: var(--ink-3); }

.att-table-wrap {
  overflow-x: auto; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-sm);
}
.att-table { width: 100%; min-width: 820px; border-collapse: collapse; font-size: 13px; }
.att-table th {
  text-align: left; padding: 11px 14px; font-size: 11.5px; color: var(--ink-2); font-weight: 600;
  background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap;
}
.att-table td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.att-table tbody tr:last-child td { border-bottom: 0; }
.att-alt { display: block; font-size: 11.5px; color: var(--ink-3); font-weight: 400; margin-top: 2px; line-height: 1.65; }
.att-shift { display: inline-block; font-size: 11.5px; padding: 2px 9px; border-radius: 999px; background: var(--surface-3); color: var(--ink-2); white-space: nowrap; }
.att-shift.sh-am { background: #eaf3ff; color: #2a6bb5; }
.att-shift.sh-pm { background: #fff3e6; color: #a96618; }
.att-shift.sh-full { background: var(--ok-soft); color: var(--ok); }
.att-shift.sh-ot { background: #f1ebff; color: #5b3fa8; }
/* 请假标：跟在班次后面，事由另起一行 */
.att-leave {
  display: inline-block; margin-left: 5px; font-size: 11.5px; padding: 2px 9px;
  border-radius: 999px; background: #fdecec; color: #b52d2d; white-space: nowrap; vertical-align: top;
}
.att-leave-why { color: #b05252; }
.att-num b { font-size: 15px; font-variant-numeric: tabular-nums; }
.att-num small { font-size: 11px; color: var(--ink-3); }
.att-muted { color: var(--ink-3); }
.att-ops { text-align: right; white-space: nowrap; }
.att-ops .btn + .btn { margin-left: 6px; }
.att-trans { margin-top: 8px; }

/* 必填标记 */
.pf-field label .req { color: #d94848; font-weight: 700; margin-left: 1px; }

/* 语音输入按钮：待机 / 聆听中 */
.att-mic { margin-top: 8px; display: inline-flex; align-items: center; gap: 6px; }
.att-mic::before {
  content: ""; width: 7px; height: 7px; border-radius: 999px;
  background: var(--ink-3); flex: none;
}
.att-mic.is-listening { background: #fdecec; border-color: #f0b4b4; color: #b52d2d; }
.att-mic.is-listening::before { background: #e23b3b; animation: micPulse 1s infinite; }
.att-mic.is-busy { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); cursor: progress; animation: mic-breathe 1s ease-in-out infinite; }
.att-mic.is-busy::before { background: var(--brand); }
.att-mic.is-off { opacity: .6; }
@keyframes micPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(226, 59, 59, .55); }
  50% { box-shadow: 0 0 0 5px rgba(226, 59, 59, 0); }
}
.att-staff-form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; align-items: end; margin-bottom: 16px; }
.att-staff-form .pf-field { margin: 0; }

/* ---------------- 人员管理（管理页弹窗） ---------------- */
.stf-toolbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.stf-tabs { margin-bottom: 12px; }
.stf-tools { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.stf-form {
  border: 1px solid var(--line); border-radius: 12px; padding: 14px 14px 12px;
  background: var(--surface); margin-bottom: 14px;
}
.stf-form-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.stf-form-head b { font-size: 14px; }
.stf-form-head .att-muted { font-size: 12px; }
.stf-form-foot { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 10px; }
.stf-form-foot .pf-err { margin-right: auto; text-align: left; }
.stf-count { margin-top: 10px; font-size: 12px; color: var(--ink-2); }
.stf-wh {
  display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px;
  background: var(--brand-soft); color: var(--brand); white-space: nowrap;
}
.stf-wh.wh-cn { background: rgba(15, 76, 129, .08); color: var(--ink-2); }
.stf-wh.wh-other { background: transparent; color: var(--ink-2); border: 1px dashed var(--line-2); }
.stf-off td { opacity: .45; }
.stf-off .btn { opacity: 1; }

/* ---------------- 仓库管理员（管理页弹窗） ---------------- */
.wm-wrap { display: flex; flex-direction: column; gap: 10px; }
.wm-row {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--surface);
}
.wm-wh {
  display: inline-block; padding: 3px 11px; border-radius: 999px; font-size: 12.5px;
  background: var(--brand-soft); color: var(--brand); white-space: nowrap; min-width: 82px; text-align: center;
}
.wm-wh.wh-cn { background: rgba(15, 76, 129, .08); color: var(--ink-2); }
.wm-sel {
  flex: 1; min-width: 0; height: 34px; padding: 0 10px; border-radius: 9px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-size: 13px;
}
.wm-sel:disabled { background: var(--surface-2); color: var(--ink-3); }
.wm-note { font-size: 12px; color: var(--ink-3); white-space: nowrap; }
.wm-fields { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.wm-label { font-size: 11.5px; color: var(--ink-3); }
.wm-user {
  flex: 1; min-width: 0; height: 34px; padding: 0 10px; border-radius: 9px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-size: 13px;
}

/* ---------------- 日常盘库：子页签 / 仓库切换 / 库存警戒 ---------------- */
.inv-whbar { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-bottom: 12px; }
.inv-whbar .inv-hint + .inv-hint { margin-left: 2px; }
.inv-warn { display: block; font-size: 10.5px; color: var(--danger, #d0453b); font-weight: 400; white-space: nowrap; }
.inv-day.is-flex { border-style: dashed; }
/* 仓库按钮旁的「查看所有低库存」：红色系，和选中的仓区分开 */
.inv-low-btn { color: var(--danger, #d0453b); border-color: #f3cdc7; background: #fffafa; margin-left: 4px; }
.inv-low-btn:hover { color: #b03a31; border-color: var(--danger, #d0453b); background: #fff3f2; }
.inv-low-btn .inv-day-num { background: #fdecea; color: var(--danger, #d0453b); font-weight: 600; }
/* 全部低库存弹窗里的清单 */
.ls-list { display: flex; flex-direction: column; gap: 8px; }

/* 字段下方的说明文字 */
.pf-hint { font-size: 11.5px; color: var(--ink-3); margin-top: 5px; line-height: 1.5; }

/* 批量新增出勤 */
.att-batch-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-bottom: 12px; padding: 9px 12px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px;
}
.att-chk-inline { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.att-chk { width: 34px; text-align: center; }
.att-chk input { width: 16px; height: 16px; accent-color: var(--brand-2); cursor: pointer; }
.att-batch-sep { font-size: 12.5px; color: var(--ink-3); }
.att-batch-bar select { height: 32px; padding: 0 8px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--surface); font-size: 13px; }
.att-batch-count { margin-left: auto; font-size: 12.5px; color: var(--ink-2); font-weight: 600; }
.att-batch-wrap { max-height: 52vh; overflow: auto; }
.att-batch { min-width: 820px; }
.att-batch th, .att-batch td { padding: 8px 10px; }
.att-batch input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--brand-2); cursor: pointer; }
.att-batch select, .att-batch input[type="number"] {
  height: 32px; padding: 0 8px; border: 1px solid var(--line-2); border-radius: 8px;
  background: var(--surface); font-size: 13px; width: 100%; min-width: 84px;
}
.att-batch input[type="number"] { min-width: 66px; }
.att-badge {
  display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: 999px;
  background: var(--surface-3); color: var(--ink-3); white-space: nowrap;
}
.att-badge.is-new { background: var(--ok-soft); color: var(--ok); }
.att-badge.is-del { background: #fdecec; color: #b52d2d; }

#fShiftSeg { margin: 0; }
#fShiftSeg .seg-btn { font-size: 12.5px; }
/* 上班 / 请假：比班次小一号，避免两个分段挤在一起分不清主次 */
#fWorkSeg { margin: 0; max-width: 300px; }
#fWorkSeg .seg-btn { font-size: 12.5px; height: 30px; }

/* 出勤查看：按天 / 按区间 */
.att-q-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-bottom: 14px; padding: 9px 12px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px;
}
.att-q-seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 8px; overflow: hidden; background: var(--surface); }
.att-q-seg button {
  border: 0; background: transparent; padding: 6px 14px; font-size: 13px;
  color: var(--ink-2); cursor: pointer; white-space: nowrap;
}
.att-q-seg button + button { border-left: 1px solid var(--line); }
.att-q-seg button.is-on { background: var(--brand); color: #fff; font-weight: 600; }
.att-q-bar input[type="date"], .att-q-bar select {
  height: 32px; padding: 0 8px; border: 1px solid var(--line-2); border-radius: 8px;
  background: var(--surface); font-size: 13px;
}
.att-q-bar > span { display: inline-flex; align-items: center; gap: 6px; }
.att-q-dash { font-style: normal; color: var(--ink-3); font-size: 12px; }
.att-q-bar #qGo { margin-left: auto; }
.att-q-total td { font-weight: 650; background: var(--surface-2); }
.att-table tfoot td { padding: 10px 14px; border-top: 1px solid var(--line); background: var(--surface-2); }
@media (max-width: 700px) {
  .att-staff-form { grid-template-columns: 1fr; }
  .pf-row.three { grid-template-columns: 1fr; }
  .att-sum { gap: 16px; }
  .att-sum-date { margin-left: 0; width: 100%; }
  .att-q-bar #qGo { margin-left: 0; }
}
@media (max-width: 640px) {
  /* 出勤编辑：手机上姓名/岗位/加班并排太挤，一行一个 */
  .att-edit .pf-row:not(.one) { grid-template-columns: 1fr; }
  #fWorkSeg { max-width: none; }
  .pf-static { min-height: 36px; font-size: 13px; }
}

/* ---------- 采购地 ---------- */
.inv-origin {
  display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 999px;
  font-size: 11px; line-height: 17px; vertical-align: 1px; white-space: nowrap;
}
.inv-origin.is-cn { background: var(--accent-soft); color: var(--accent); }
.inv-origin.is-local { background: var(--ok-soft); color: var(--ok); }

/* ---------- 采购地批量设置（临时工具） ---------- */
.og-mask {
  position: fixed; inset: 0; z-index: 9000; background: rgba(18, 32, 48, .42);
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.og-panel {
  width: min(860px, 100%); max-height: calc(100vh - 48px); display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 24px 60px rgba(15, 30, 50, .22); overflow: hidden;
}
.og-head {
  display: flex; align-items: flex-start; gap: 16px;
  padding: 16px 18px 13px; border-bottom: 1px solid var(--line);
}
.og-head h2 { font-size: 16px; font-weight: 650; color: var(--ink); }
.og-head p { font-size: 12.5px; color: var(--ink-3); margin-top: 4px; max-width: 620px; line-height: 1.5; }
.og-head .btn { margin-left: auto; flex: none; }
.og-bar { display: flex; gap: 8px; padding: 12px 18px 0; }
.og-search {
  flex: 1; height: 32px; padding: 0 11px; border: 1px solid var(--line-2); border-radius: 8px;
  background: var(--surface); color: var(--ink); font-size: 13px;
}
.og-bar select {
  height: 32px; padding: 0 8px; border: 1px solid var(--line-2); border-radius: 8px;
  background: var(--surface); color: var(--ink-2); font-size: 13px; min-width: 132px;
}
.og-seg { display: flex; gap: 6px; flex-wrap: wrap; padding: 10px 18px 0; }
.og-seg-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px;
  border: 1px solid var(--line); border-radius: 9px; background: var(--surface);
  color: var(--ink-2); font-size: 12.5px; cursor: pointer;
}
.og-seg-btn b { font-size: 11px; padding: 0 6px; border-radius: 999px; background: var(--surface-3); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.og-seg-btn.is-on { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.og-seg-btn.is-on b { background: rgba(255, 255, 255, .24); color: #fff; }
.og-bulk {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 11px 18px 11px; border-bottom: 1px solid var(--line);
}
.og-bulk-tip { font-size: 12.5px; color: var(--ink-3); }
.og-list { flex: 1; overflow-y: auto; padding: 6px 10px 6px 12px; min-height: 180px; }
.og-list::-webkit-scrollbar { width: 10px; }
.og-list::-webkit-scrollbar-thumb { background: #d7e0ec; border-radius: 8px; border: 3px solid var(--surface); }
.og-row {
  display: flex; align-items: center; gap: 14px; padding: 8px 8px 8px 10px;
  border-bottom: 1px solid var(--line); border-radius: 8px;
}
.og-row:hover { background: var(--surface-2); }
.og-row.is-unset .og-name { color: var(--ink-2); }
.og-name { flex: 1; min-width: 0; font-size: 13px; font-weight: 600; color: var(--ink); }
.og-sub {
  font-size: 11.5px; color: var(--ink-3); font-weight: 400; margin-top: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 560px;
}
.og-btns { display: flex; gap: 6px; flex: none; }
.og-btn {
  height: 28px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface); color: var(--ink-2); font-size: 12.5px; cursor: pointer;
}
.og-btn:hover { border-color: var(--brand); color: var(--brand); }
.og-btn.is-on.is-cn { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 600; }
.og-btn.is-on.is-local { background: var(--ok-soft); border-color: var(--ok); color: var(--ok); font-weight: 600; }
.og-btn.is-on[data-set=""] { background: var(--surface-3); border-color: var(--line-2); color: var(--ink-2); font-weight: 600; }
.og-empty { padding: 30px 0; text-align: center; color: var(--ink-3); font-size: 13px; }
.og-foot {
  display: flex; align-items: center; gap: 10px; padding: 12px 18px;
  border-top: 1px solid var(--line); background: var(--surface-2);
}
.og-foot #ogInfo { font-size: 12.5px; color: var(--ink-2); }
.og-foot #ogInfo b { color: var(--ink); }
.og-foot #ogInfo b.is-dirty { color: var(--warn); }
.og-grow { flex: 1; }
@media (max-width: 700px) {
  .og-mask { padding: 0; }
  .og-panel { max-height: 100vh; border-radius: 0; }
  .og-sub { display: none; }
  .og-bulk .btn { flex: 1; }
}
.og-days { display: flex; gap: 5px; flex: none; flex-wrap: wrap; justify-content: flex-end; }
.og-dchip {
  width: 30px; height: 28px; padding: 0; border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface); color: var(--ink-3); font-size: 12.5px; cursor: pointer;
}
.og-dchip:hover { border-color: var(--brand); color: var(--brand); }
.og-dchip.is-on { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
@media (max-width: 700px) {
  .og-days { gap: 4px; }
  .og-dchip { width: 26px; height: 26px; font-size: 12px; }
}

/* ---------- 海柜拼柜助手 ---------- */
.sp-sum { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.sp-kpi {
  flex: 1 1 150px; min-width: 138px; padding: 12px 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
}
.sp-kpi span { display: block; font-size: 11.5px; color: var(--ink-3); }
.sp-kpi b {
  display: block; margin-top: 4px; font-size: 21px; font-weight: 700;
  letter-spacing: -.5px; font-variant-numeric: tabular-nums;
}
.sp-kpi i { display: block; margin-top: 3px; font-style: normal; font-size: 11.5px; color: var(--ink-3); }
.sp-kpi.is-ok b { color: var(--ok); }
.sp-kpi.is-warn b { color: var(--warn); }
.sp-tbl-wrap {
  overflow-x: auto; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); box-shadow: var(--shadow-sm);
}
.sp-tbl { min-width: 880px; }
.sp-tbl th { padding: 10px 8px; }
.sp-tbl td { padding: 7px 8px; }
.sp-in {
  width: 100%; height: 30px; padding: 0 8px; border: 1px solid var(--line-2); border-radius: 7px;
  background: var(--surface); color: var(--ink); font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.sp-in:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.sp-freight {
  height: 32px; width: 132px; padding: 0 9px; border: 1px solid var(--line-2); border-radius: 8px;
  background: var(--surface); color: var(--ink); font-size: 13px;
}
.sp-freight:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.sp-badge {
  display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: 999px;
  background: var(--ok-soft); color: var(--ok);
}
.sp-badge.is-cur { background: var(--brand-soft); color: var(--brand); }
.inv-table tfoot td {
  font-weight: 600; background: var(--surface-2);
  border-top: 1px solid var(--line); border-bottom: 0;
}

/* 型号规格下拉（自绘，不用原生 datalist，避免跟随系统深色主题） */
.sp-sug {
  position: fixed; z-index: 70; padding: 4px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 14px 36px rgba(16, 24, 40, .18); max-height: 292px; overflow-y: auto;
}
.sp-sug-i {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 9px; border-radius: 7px; cursor: pointer; font-size: 13px; color: var(--ink);
}
.sp-sug-i b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-sug-i span {
  margin-left: auto; flex: 0 0 auto; color: var(--ink-3); font-size: 11.5px;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.sp-sug-i:hover, .sp-sug-i.is-on { background: var(--brand-soft); }
.sp-sug-i.is-on b { color: var(--brand); }

/* 添加 / 编辑产品信息：包装单位快捷按钮（不用原生下拉） */
.pk-units { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.pk-unit {
  font: inherit; font-size: 12.5px; padding: 4px 11px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-2);
}
.pk-unit:hover { border-color: var(--brand); color: var(--brand); }
.pk-unit.is-on { background: var(--brand); border-color: var(--brand); color: #fff; }

/* 产品图片：表单里的预览框 + 列表缩略图 */
.pk-pic { width: 190px; max-width: 100%; height: 190px; }
.pk-pic-empty { font-size: 12.5px; color: var(--ink-3); }
.pk-tip-dot { margin: 0 6px; }
/* 产品信息列表（弹窗里）列多，手机上留图片 / 名称 / 单重 / 体积 / 操作 */
#pkList .inv-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
#pkList .cat-th { width: 46px; height: 46px; }
/* 名称下面那句「还没加图片」不能 nowrap，否则会把整张表撑宽 */
#pkList .inv-item-alt { white-space: normal; max-width: none; line-height: 1.45; }
@media (max-width: 640px) {
  #pkList .inv-table th:nth-child(2), #pkList .inv-table td:nth-child(2) { display: table-cell; }
  #pkList .inv-table th:nth-child(3), #pkList .inv-table td:nth-child(3),
  #pkList .inv-table th:nth-child(4), #pkList .inv-table td:nth-child(4),
  #pkList .inv-table th:nth-child(5), #pkList .inv-table td:nth-child(5),
  #pkList .inv-table th:nth-child(7), #pkList .inv-table td:nth-child(7) { display: none; }
  #pkList .inv-table th, #pkList .inv-table td { padding: 9px 5px; }
  #pkList .inv-table th { font-size: 11px; }
  #pkList .inv-table td { font-size: 12.5px; }
  /* 列宽是写在 th 上的行内样式，这里必须用 !important 才压得住 */
  #pkList .inv-table th:nth-child(1), #pkList .inv-table td:nth-child(1) { width: 44px !important; }
  #pkList .inv-table th:nth-child(6), #pkList .inv-table td:nth-child(6) { width: 72px !important; }
  #pkList .inv-table th:nth-child(8), #pkList .inv-table td:nth-child(8) { width: 104px !important; }
  #pkList .inv-table .btn-xs { padding: 0 7px; }
}

/* 助手页底部：历史方案快照入口（次要入口，放页脚右边） */
.sp-foot { display: flex; justify-content: flex-end; margin-top: 10px; }

/* 警戒线设置面板：一行一个物料，右侧填数量 */
.wg-row {
  display: flex; align-items: center; gap: 12px; padding: 7px 8px 7px 10px;
  border-bottom: 1px solid var(--line); border-radius: 8px;
}
.wg-row:hover { background: var(--surface-2); }
.wg-row.is-unset .og-name { color: var(--ink-2); }
.wg-origin { flex: 0 0 80px; }
.wg-in-wrap { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.wg-unit { font-size: 11.5px; color: var(--ink-3); min-width: 34px; }

/* 搜索栏语音输入：麦克风用绝对定位贴在输入框右端，不包裹、不改各页面原有的 flex 宽度 */
.mic-btn {
  position: absolute; z-index: 3;
  transform: translateY(-50%);
  /* 位置由脚本按布局值算好后置为 visible；默认藏着，
     免得脚本还没跑（或弹窗进场动画期间）按钮按静态位置闪到输入框外 */
  visibility: hidden;
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; padding: 0; border: 0; border-radius: 7px;
  background: transparent; color: var(--ink-3); cursor: pointer;
}
.mic-btn:hover { background: var(--brand-soft); color: var(--brand); }
.mic-btn.is-on { background: var(--danger); color: #fff; animation: mic-pulse 1.2s ease-in-out infinite; }
.mic-btn.is-off { opacity: .38; cursor: not-allowed; }
/* 云端识别：录音中红色脉冲（is-on），上传识别中蓝色呼吸（is-busy） */
.mic-btn.is-busy { background: var(--brand-soft); color: var(--brand); cursor: progress; animation: mic-breathe 1s ease-in-out infinite; }
@keyframes mic-breathe { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
input.has-mic::-webkit-search-cancel-button { display: none; }
/* 录音脉冲改成按钮内圈的白色呼吸：外扩的 box-shadow 会跑出输入框（手机上尤其明显） */
@keyframes mic-pulse { 0%, 100% { box-shadow: inset 0 0 0 0 rgba(255,255,255,.5); } 50% { box-shadow: inset 0 0 0 5px rgba(255,255,255,0); } }
@media (max-width: 720px) { .mic-btn { width: 28px; height: 28px; } }

/* 语音失败横幅：微信里 toast 一闪而过，这里停 12 秒并且点一下可关 */
.mic-banner {
  position: fixed; left: 50%; top: 10px; z-index: 9999;
  transform: translate(-50%, -14px);
  max-width: min(92vw, 560px);
  background: #7f2318; color: #fff;
  font-size: 13px; line-height: 1.65; letter-spacing: .1px;
  padding: 10px 14px; border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .3);
  opacity: 0; pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}
.mic-banner.on { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }

/* ============================================================
   手机模式统一规范（≤640px）
   1) 输入控件字号 ≥16px：iOS 聚焦不再自动放大页面
   2) 触控目标 ≥36px（主要按钮 40px）
   3) 盘库：查看＝横滑 + 冻结首列；盘点＝一料一卡
   4) 出勤／车辆表格冻结首列，横向滑动时不会丢失行身份
   5) 弹窗在手机上变成底部抽屉，页脚避开 home indicator
   6) 信息性小字抬到 12px
   ============================================================ */

.inv-unit-in { display: none; }

/* ---------- 视口高度：优先用 dvh，Safari 地址栏伸缩时不跳动 ---------- */
@supports (height: 100dvh) {
  body { min-height: 100dvh; }
  .layout { height: calc(100dvh - 60px); }
  #app.has-preview .layout { height: calc(100dvh - 94px); }
  .modal { max-height: calc(100dvh - 48px); }
}

@media (max-width: 640px) {

  /* ---------- 1. 输入控件：统一 16px ---------- */
  .page-view input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]),
  .page-view select,
  .page-view textarea,
  .modal input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]),
  .modal select,
  .modal textarea,
  .login-card input { font-size: 16px; }
  .modal select, .page-view select, .modal .select, .page-view .select { font-size: 16px !important; }

  /* 任意表格容器都可横滑，避免 overflow:hidden 把右侧列直接吃掉 */
  .inv-table-wrap:not(.is-cards) { overflow-x: auto; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }

  /* ---------- 2. 触控目标 ---------- */
  .portal-nav { gap: 2px; padding: 0 8px; scrollbar-width: none; -ms-overflow-style: none; }
  .portal-nav::-webkit-scrollbar { display: none; }
  .pn-item { height: 38px; padding: 0 9px; font-size: 13px; gap: 4px; }
  .chip { height: 36px; padding: 0 12px; }
  .att-tab, .inv-day { height: 40px; padding: 0 12px; }
  .veh-st { min-height: 36px; padding: 10px 11px; }
  .veh-report-btn { height: 36px; }
  .mic-btn { width: 36px; height: 36px; }
  .mem-btn { min-height: 36px; }
  .inv-toolbar .inv-search { height: 40px; }
  .btn-sm { min-height: 36px; }
  .btn-xs { min-height: 36px; padding: 0 10px; }
  .modal-head .x { width: 40px; height: 40px; }
  .conf-chip { height: 36px; }
  .hm-more, .vn-more { padding: 9px 0; }
  .switch-btn { padding: 10px 0; }
  .cc-sel, .sp-in, .sp-freight { height: 40px; }
  .cc-in { height: 40px !important; }
  .cc-sel { padding: 0 6px; }
  .cat-cp { min-height: 36px; padding: 0 10px; }

  /* ---------- 3a. 盘库「查看」：横滑 + 冻结首列 ---------- */
  .inv-table-wrap.is-view {
    overflow-x: auto; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain;
  }
  .inv-table-wrap.is-view .inv-table { min-width: 556px; }
  .inv-table-wrap.is-view .inv-table th:nth-child(1),
  .inv-table-wrap.is-view .inv-table td:nth-child(1) { width: 160px; max-width: 160px; }
  .inv-table-wrap.is-view .inv-table td:nth-child(1) { white-space: normal; }
  .inv-table-wrap.is-view .inv-table th:nth-child(6),
  .inv-table-wrap.is-view .inv-table td:nth-child(6) { min-width: 120px; white-space: normal; }
  .inv-table-wrap.is-view .inv-table th,
  .inv-table-wrap.is-view .inv-table td { padding: 10px 11px; }
  .inv-table-wrap.is-view .inv-table th:nth-child(1),
  .inv-table-wrap.is-view .inv-table td:nth-child(1) {
    position: sticky; left: 0; z-index: 2;
    background: var(--surface);
    box-shadow: 1px 0 0 var(--line), 10px 0 12px -10px rgba(15, 40, 70, .28);
  }
  .inv-table-wrap.is-view .inv-table th:nth-child(1) { background: var(--surface-2); z-index: 3; }
  .inv-table-wrap.is-view .inv-table tr.is-low td:nth-child(1) { background: #fff8f7; }

  /* ---------- 3b. 盘库「盘点」：一料一卡 ---------- */
  .inv-table-wrap.is-cards {
    background: transparent; border: 0; box-shadow: none; overflow: visible;
  }
  .inv-table-wrap.is-cards .inv-table,
  .inv-table-wrap.is-cards .inv-table tbody { display: block; }
  .inv-table-wrap.is-cards .inv-table thead { display: none; }
  .inv-table-wrap.is-cards .inv-table tr {
    display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px;
    padding: 12px; margin-bottom: 10px;
    border: 1px solid var(--line); border-radius: 12px;
    background: var(--surface); box-shadow: var(--shadow-sm);
  }
  .inv-table-wrap.is-cards .inv-table tr:hover { background: var(--surface); }
  .inv-table-wrap.is-cards .inv-table td {
    display: block; padding: 0 !important; border: 0 !important;
    flex: 0 0 auto; background: transparent !important;
  }
  .inv-table-wrap.is-cards .inv-table td.inv-name {
    flex: 1 1 calc(100% - 60px); font-size: 15px; line-height: 1.35; font-weight: 600;
  }
  .inv-table-wrap.is-cards .inv-table td.inv-cat { display: none; }
  .inv-table-wrap.is-cards .inv-table td.inv-speakcell { order: 1; margin-left: auto; }
  .inv-table-wrap.is-cards .inv-table td.inv-stock {
    order: 2; text-align: left !important; font-size: 13.5px; font-weight: 600;
  }
  .inv-table-wrap.is-cards .inv-table td.inv-stock::before {
    content: "库存 "; font-weight: 400; font-size: 12px; color: var(--ink-3);
  }
  .inv-table-wrap.is-cards .inv-table td.inv-unit { display: none; }
  .inv-table-wrap.is-cards .inv-unit-in { display: inline; margin-left: 2px; font-weight: 400; color: var(--ink-2); }
  .inv-table-wrap.is-cards .inv-table td.inv-last {
    order: 4; text-align: left !important; font-size: 12.5px;
  }
  .inv-table-wrap.is-cards .inv-table td.inv-last::before {
    content: "上次实盘 "; font-size: 12px; color: var(--ink-3);
  }
  .inv-table-wrap.is-cards .inv-table td.inv-qtycell,
  .inv-table-wrap.is-cards .inv-table td.inv-notecell {
    order: 5; flex: 1 1 100%; text-align: left !important; padding-top: 4px !important;
  }
  .inv-table-wrap.is-cards .inv-table td.inv-notecell { order: 6; }
  .inv-table-wrap.is-cards .inv-table td.inv-qtycell::before,
  .inv-table-wrap.is-cards .inv-table td.inv-notecell::before {
    display: block; margin-bottom: 5px; font-size: 12px; color: var(--ink-3);
  }
  .inv-table-wrap.is-cards .inv-table td.inv-qtycell::before { content: "本次实盘"; }
  .inv-table-wrap.is-cards .inv-table td.inv-notecell::before { content: "备注"; }
  .inv-table-wrap.is-cards .inv-qty,
  .inv-table-wrap.is-cards .inv-note {
    width: 100%; height: 42px; font-size: 16px; text-align: left; padding: 0 12px;
  }
  /* 苹果数字键盘没有小数点，用 decimal 才不会把 12.5 输成 125 */
  .inv-table-wrap.is-cards .inv-warn { display: block; margin-top: 1px; font-size: 12px; }
  .inv-table-wrap.is-cards .inv-table tr.is-filled { border-color: #bfe3cd; background: #f7fcf9; }
  .inv-table-wrap.is-cards .inv-table tr.is-low { border-color: #f3c9c4; background: #fff8f7; }

  /* ---------- 4. 出勤／车辆表格：冻结首列 ---------- */
  .att-table-wrap { -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
  .att-table th,
  .att-table td { padding: 10px 10px; }
  .att-table th:nth-child(1),
  .att-table td:nth-child(1) {
    position: sticky; left: 0; z-index: 2;
    background: var(--surface);
    box-shadow: 1px 0 0 var(--line), 10px 0 12px -10px rgba(15, 40, 70, .28);
  }
  .att-table th:nth-child(1) { background: var(--surface-2); z-index: 3; }

  /* ---------- 3c. 分区标题 + 右侧按钮：窄屏不要挤成一字一行 ---------- */
  .cc-sect-h { flex-wrap: wrap; gap: 8px; }
  .cc-sect-h > span:first-child { white-space: nowrap; }
  .cc-sect-h > span:last-child { width: 100%; }
  .cc-sect-h .btn-sm { flex: 1 1 auto; justify-content: center; }
  /* 四个按钮（一键清空 / 从产品信息选 / 添加产品信息 / 加一行）：两两一行，比 3+1 整齐 */
  .cc-sect-h .cc-acts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .cc-sect-h .cc-acts .btn-sm { flex: none; width: 100%; }
  /* 两列排开时「一键清空」要有边框，不然像四个按钮里飘着一行红字 */
  .cc-sect-h .cc-acts .btn-danger-ghost { border-color: var(--line-2); background: var(--surface); }
  /* 工地距离查询只有一个「粘贴」，留在标题右边就行，别单独占一整行 */
  .dst-wrap .cc-sect-h > span:last-child { width: auto; }
  .dst-wrap .cc-sect-h .cc-acts { display: flex; }
  .dst-wrap .cc-sect-h .cc-acts .btn-sm { width: auto; }

  /* ---------- 4a. 各列表：主列冻结，次要列在手机上让位 ---------- */
  .inv-table-wrap:not(.is-cards) .inv-table th:first-child,
  .inv-table-wrap:not(.is-cards) .inv-table td:first-child {
    position: sticky; left: 0; z-index: 2; background: var(--surface);
    box-shadow: 1px 0 0 var(--line), 8px 0 10px -10px rgba(15, 40, 70, .22);
  }
  .inv-table-wrap:not(.is-cards) .inv-table thead th:first-child { background: var(--surface-2); z-index: 3; }
  /* 价格表：↓ / 末尾 这一列冻在右边，手机上不用先横滑到底才点得到 */
  .inv-table-wrap:not(.is-cards) .pr-table.has-moves th:last-child,
  .inv-table-wrap:not(.is-cards) .pr-table.has-moves td:last-child,
  .inv-table-wrap:not(.is-cards) .pr-table.pr-ops th:last-child,
  .inv-table-wrap:not(.is-cards) .pr-table.pr-ops td:last-child {
    position: sticky; right: 0; z-index: 2; background: var(--surface);
    box-shadow: -1px 0 0 var(--line), -8px 0 10px -10px rgba(15, 40, 70, .22);
  }
  .inv-table-wrap:not(.is-cards) .pr-table.has-moves thead th:last-child,
  .inv-table-wrap:not(.is-cards) .pr-table.pr-ops thead th:last-child { background: var(--surface-2); z-index: 3; }
  /* 物料档案：手机上只留「名称（含单位/库存）」和「操作」，其余转成名称下的一行小字 */
  .adm-items th:nth-child(2), .adm-items td:nth-child(2),
  .adm-items th:nth-child(3), .adm-items td:nth-child(3),
  .adm-items th:nth-child(4), .adm-items td:nth-child(4),
  .adm-items th:nth-child(5), .adm-items td:nth-child(5),
  .adm-items th:nth-child(6), .adm-items td:nth-child(6),
  .adm-items th:nth-child(7), .adm-items td:nth-child(7) { display: none; }
  .adm-items .adm-meta { display: block; margin-top: 3px; font-size: 12px; color: var(--ink-2); }
  .adm-items td:nth-child(8) { width: 112px; }
  .adm-items td:nth-child(8) .inv-ops { flex-wrap: nowrap; gap: 6px; }
  /* 公告管理：只留 标题（含日期信息）和 操作 */
  .adm-notices th:nth-child(2), .adm-notices td:nth-child(2),
  .adm-notices th:nth-child(3), .adm-notices td:nth-child(3),
  .adm-notices th:nth-child(4), .adm-notices td:nth-child(4) { display: none; }
  .adm-notices .adm-meta { display: block; margin-top: 3px; font-size: 12px; color: var(--ink-2); }
  .adm-notices td:nth-child(5) { width: 128px; }
  .adm-notices .inv-item-alt { white-space: normal; max-width: none; }
  .adm-items .inv-item-alt { white-space: normal; max-width: none; }
  /* 电动工具报价：序号在手机上没意义 */
  .tool-price th:nth-child(1), .tool-price td:nth-child(1) { display: none; }
  /* 库存报警：只留 名称 / 当前库存 / 建议补货 */
  .inv-alert th:nth-child(2), .inv-alert td:nth-child(2),
  .inv-alert th:nth-child(3), .inv-alert td:nth-child(3),
  .inv-alert th:nth-child(5), .inv-alert td:nth-child(5) { display: none; }

  /* ---------- 4b. 权限矩阵：冻结成员列 + 放大勾选框 ---------- */
  .perm-table { min-width: 620px; }
  .perm-table th, .perm-table td { padding: 12px 10px; }
  .perm-table thead tr:first-child th:first-child,
  .perm-table tbody td:first-child {
    position: sticky; left: 0; z-index: 2;
    background: var(--surface);
    box-shadow: 1px 0 0 var(--line-2), 10px 0 12px -10px rgba(15, 40, 70, .22);
    min-width: 116px;
  }
  .perm-table thead tr:first-child th:first-child { background: var(--surface-2); z-index: 3; }
  .perm-table tr.is-admin td:first-child { background: #f7fbff; }
  .perm-check { width: 22px; height: 22px; }
  .perm-scroll-tip { display: block; }

  /* ---------- 5. 弹窗：底部抽屉 + 安全区 ---------- */
  .modal-root { padding: 0; align-items: end; }
  .modal {
    width: 100%; max-width: none;
    max-height: 92dvh; border-radius: 16px 16px 0 0;
  }
  .modal.sm { width: 100%; }
  .modal-head { padding: 14px 16px; }
  .modal-body { padding: 14px 16px 6px; }
  .modal-foot {
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    flex-wrap: wrap;
  }
  .modal-foot .btn { flex: 1 1 auto; justify-content: center; }
  /* 「播报」是次要动作，别跟编辑/关闭抢宽度 */
  .modal-foot > .btn-speak { flex: 0 0 auto; }
  .page-view:not(#page-containers) { padding-bottom: calc(56px + env(safe-area-inset-bottom)); }

  /* ---------- 6. 页头与采集助手：窄屏不再挤成竖排 ---------- */
  .pt-head { gap: 10px; margin-bottom: 14px; }
  .pt-head h1 { font-size: 20px; }
  .pt-head p {
    font-size: 12.5px; display: -webkit-box; -webkit-line-clamp: 2;
    -webkit-box-orient: vertical; overflow: hidden;
  }
  .pt-head .pt-actions { margin-left: 0; width: 100%; }
  .pt-date { height: 40px; padding: 0 12px; font-size: 16px; }
  .collect-head { flex-wrap: wrap; gap: 6px 8px; }
  .collect-head b, .collect-head .tag { flex: none; white-space: nowrap; }
  .collect-head .sub { flex: 1 1 100%; margin-left: 0; }
  .collect-row .select, .collect-row .input { flex: 1 1 140px; width: auto; min-width: 0; height: 36px; }
  .collect textarea { min-height: 84px; }
  .modal .input, .modal .select { height: 36px; }
  .modal .rm { width: 36px; height: 36px; }
  /* 复选框在手机上放大到 18px，手指点得中 */
  .page-view input[type="checkbox"], .modal input[type="checkbox"] { width: 18px; height: 18px; }
  .modal .mem-tab { min-height: 36px; }

  /* ---------- 6b. 计算器房间行：手机上改成一张卡，长宽不再挤成竖排 ---------- */
  .cc-rooms { display: block; width: 100%; }
  .cc-rooms thead { display: none; }
  .cc-rooms tbody { display: block; }
  .cc-rooms tr {
    display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
    padding: 10px; margin-bottom: 10px;
    border: 1px solid var(--line); border-radius: 10px; background: var(--surface);
  }
  .cc-rooms td { display: block; padding: 0 !important; border: 0 !important; flex: 1 1 0; min-width: 0; }
  .cc-rooms td:first-child { flex: 1 1 100%; }
  .cc-rooms td:last-child { flex: 0 0 auto; }
  .cc-rooms td.cc-area { flex: 0 0 auto; font-size: 13px; color: var(--ink-2); }
  .cc-rooms .cc-name { min-width: 0; }
  .cc-rooms .cc-in { width: 100%; }
  /* 全局窄屏规则会按 nth-child(2) 隐藏「类别」列，这里必须把「长」还原回来 */
  .inv-table.cc-rooms td:nth-child(2),
  .inv-table.cc-rooms th:nth-child(2) { display: block; }

  /* ---------- 7. 文字与卡片 ---------- */
  .inv-warn { font-size: 12px; }
  .inv-item-alt, .att-alt { font-size: 12px; }
  .ntc-c-m, .pill, .att-tab-num, .count, .gate-foot, .inv-day-num, .inv-day-cat { font-size: 12px; }
  /* 车辆卡、出勤班次、首页统计：这些是信息不是装饰，抬到 12px */
  .vn-n, .vn-wh, .vn-who, .vn-tag { font-size: 12px; }
  .att-shift { font-size: 12px; }
  .oa-num span, .hm-kpi span, .vn-h, .vr-unit { font-size: 12px; }
  .ov-att-row .oa-num span { font-size: 12px; }
  .alert-item .ai-num span, .att-num small { font-size: 12px; }
  .veh-last { font-size: 12px; }
  .ntc-grid { grid-template-columns: minmax(0, 1fr); }
  .cat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .cat-card figcaption { flex-direction: column; align-items: stretch; gap: 8px; padding: 9px 10px 10px; }
  .cat-name { font-size: 13.5px; }
  .cat-cp { align-self: flex-start; }
  .veh-last { max-width: none; white-space: normal; }
}

/* 窄屏（≤420）：顶部栏只留图标，避免 360/320 上整页横向溢出 */
/* 320 这类超窄屏：两列表单挤不下，一律单列 */
@media (max-width: 360px) {
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .col-2, .form-grid .col-3, .form-grid .col-4 { grid-column: span 1; }
  .ie-grid { grid-template-columns: 1fr; }
  .ie-grid2 { grid-template-columns: 1fr 1fr; }
  .modal .grid-2 { grid-template-columns: 1fr; }
}

/* 小屏（≤480）：导航 7 项必须装得下，不许横滑（多了「业务打卡」一项，原来 400 的线不够用了） */
@media (max-width: 480px) {
  .portal-nav { padding: 0 6px; gap: 1px; }
  .pn-item { padding: 0 5px; font-size: 12px; gap: 3px; }
}

/* 更窄（≤380）：再收一点，iPhone SE / 375 也不横滑 */
@media (max-width: 380px) {
  .portal-nav { padding: 0 4px; }
  .pn-item { padding: 0 4px; font-size: 11.5px; }
}

/* 极窄（≤340）：320 的老机型也要七项全见 */
@media (max-width: 340px) {
  .portal-nav { padding: 0 3px; }
  .pn-item { padding: 0 3px; font-size: 11px; }
}

@media (max-width: 420px) {
  .topbar { padding-left: 12px; padding-right: 12px; gap: 8px; }
  .brand { gap: 8px; }
  .brand-text span { display: none; }
  #newBtn { width: 40px; padding: 0; justify-content: center; }
  #newBtn .new-text { display: none; }
  .user-chip #userName { display: none; }
  .user-chip { padding: 3px; }
  .user-chip .avatar { width: 32px; height: 32px; font-size: 13px; }
}

/* ============================================================
   装到桌面（PWA 安装引导）
   ============================================================ */
.inst-tip {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; margin-bottom: 14px;
  background: linear-gradient(180deg, #fff, #f6fafe);
  border: 1px solid #d8e6f5; border-radius: 12px;
}
.inst-tip img { width: 34px; height: 34px; border-radius: 9px; flex: none; }
.inst-tip .it-txt { min-width: 0; flex: 1; }
.inst-tip .it-txt b { display: block; font-size: 13.5px; color: var(--ink); }
.inst-tip .it-txt span { display: block; font-size: 12px; color: var(--ink-2); margin-top: 2px; }
.inst-tip .inst-tip-go {
  flex: none; height: 32px; padding: 0 12px; font-size: 12.5px;
  color: var(--brand); border-color: #c9dcf0; background: #fff;
}
.inst-tip .inst-tip-x {
  flex: none; width: 26px; height: 26px; border: 0; border-radius: 50%;
  background: transparent; color: var(--ink-3); font-size: 17px; line-height: 1; cursor: pointer;
}
.inst-tip .inst-tip-x:hover { background: var(--surface-2); color: var(--ink); }

.inst-wrap { position: fixed; inset: 0; z-index: 9998; display: flex; align-items: flex-end; justify-content: center; }
.inst-wrap[hidden] { display: none; }
.inst-mask { position: absolute; inset: 0; background: rgba(10, 24, 40, .46); opacity: 0; transition: opacity .22s; }
.inst-card {
  position: relative; width: min(480px, 100%); max-height: 90vh; overflow-y: auto;
  background: #fff; border-radius: 18px 18px 0 0;
  padding: 20px 20px calc(18px + env(safe-area-inset-bottom));
  box-shadow: 0 -12px 40px rgba(9, 26, 44, .22);
  transform: translateY(18px); opacity: 0;
  transition: transform .24s cubic-bezier(.2, .8, .3, 1), opacity .24s;
}
.inst-wrap.is-open .inst-mask { opacity: 1; }
.inst-wrap.is-open .inst-card { transform: none; opacity: 1; }
@media (min-width: 720px) {
  .inst-wrap { align-items: center; }
  .inst-card { border-radius: 18px; padding-bottom: 18px; }
}
.inst-x {
  position: absolute; top: 10px; right: 10px; width: 30px; height: 30px;
  border: 0; border-radius: 50%; background: var(--surface-2); color: var(--ink-2);
  font-size: 18px; line-height: 1; cursor: pointer;
}
.inst-head { display: flex; gap: 12px; align-items: center; padding-right: 34px; }
.inst-icon { width: 56px; height: 56px; border-radius: 14px; flex: none; box-shadow: 0 6px 16px rgba(15, 76, 129, .18); }
.inst-title { min-width: 0; }
.inst-badge {
  display: inline-block; font-size: 11px; font-weight: 600; color: var(--brand);
  background: var(--brand-soft); border-radius: 6px; padding: 2px 7px; margin-bottom: 5px;
}
.inst-title h3 { font-size: 16.5px; letter-spacing: -.2px; line-height: 1.3; }
.inst-steps { margin: 16px 0 0; padding: 0; list-style: none; counter-reset: ins; }
.inst-steps li {
  position: relative; padding: 0 0 12px 30px; counter-increment: ins;
  font-size: 13.5px; color: var(--ink-2); line-height: 1.55;
}
.inst-steps li::before {
  content: counter(ins); position: absolute; left: 0; top: 1px;
  width: 20px; height: 20px; border-radius: 50%; background: var(--brand); color: #fff;
  font-size: 11.5px; font-weight: 700; display: grid; place-items: center;
}
.inst-steps b { color: var(--ink); font-weight: 600; }
.inst-hint {
  display: flex; align-items: center; gap: 8px; margin: 0 0 14px;
  font-size: 12px; color: var(--ink-2); background: var(--surface-2);
  border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; line-height: 1.45;
}
.inst-hint svg { width: 18px; height: 18px; flex: none; color: var(--brand); }
.inst-foot { display: flex; gap: 10px; }
.inst-foot .btn { flex: 1; height: 44px; font-size: 14.5px; }
.inst-foot .inst-main { background: var(--brand); border-color: var(--brand); color: #fff; }
.inst-foot .inst-main:hover { background: var(--brand-2); border-color: var(--brand-2); }
.inst-note { margin-top: 12px; font-size: 11.5px; color: var(--ink-3); line-height: 1.5; text-align: center; }

/* ============================================================
   价格表（材料 / 电动工具）：手机上改成一料两行
   —— 材料名称是最重要的一列，绝不能被 「隐藏第 2 列」 的旧规则带走，
      也不再靠横向滚动：名称独占一行，规格/单位在下一行，单价固定在右上。
   ============================================================ */
@media (max-width: 640px) {
  .pr-table.inv-table { display: block; width: 100%; }
  .pr-table thead { display: none; }
  .pr-table tbody { display: block; }
  .pr-table tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "name price" "spec unit" "cut cut";
    column-gap: 10px;
    padding: 11px 12px;
    border-bottom: 1px solid var(--line);
  }
  .pr-table tr:last-child { border-bottom: 0; }
  .pr-table td { border: 0; padding: 0; }
  .pr-table td:nth-child(1) { display: none; }              /* 序号：手机上省掉 */
  .pr-table td:nth-child(2) {
    grid-area: name; font-size: 14px; font-weight: 600; line-height: 1.4;
    white-space: normal; word-break: break-word;
  }
  .pr-table td:nth-child(3) { grid-area: spec; margin-top: 3px; font-size: 12.5px; line-height: 1.35; white-space: normal; }
  .pr-table td:nth-child(4) { grid-area: unit; margin-top: 3px; font-size: 12.5px; text-align: right; white-space: nowrap; }
  .pr-table td:nth-child(5) { grid-area: price; font-size: 14.5px; text-align: right; white-space: nowrap; align-self: start; }
  .pr-table td:nth-child(6) { grid-area: cut; margin-top: 5px; font-size: 13px; text-align: right; white-space: nowrap; }
  .pr-table td.pr-cut::before { content: '折后 '; font-size: 12px; font-weight: 400; color: var(--ink-3); }
  /* 管理页的价格表第 6 列是「操作」按钮，不写「折后」前缀 */
  .pr-table.pr-ops td:nth-child(6) { white-space: normal; }
}

/* ============================================================
   首页 · 库存预警按采购地分栏（国内采购 / 本地采购 / 未设采购地）
   —— 两栏并排，手机上上下堆叠；每栏各自计数、各自收口
   ============================================================ */
.alert-sum { font-size: 12.5px; color: var(--ink-2); margin-bottom: 10px; line-height: 1.6; }
.alert-sum b { color: var(--danger); font-variant-numeric: tabular-nums; }

.alert-split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}
.alert-col {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}
.alert-col.is-none {
  grid-column: 1 / -1;
  border-style: dashed;
  background: var(--surface-2);
}

.ac-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.ac-tag {
  font-size: 12px; font-weight: 700; line-height: 20px; padding: 0 8px;
  border-radius: 999px; background: var(--brand-soft); color: var(--brand);
  white-space: nowrap;
}
/* 国内=蓝、本地=青绿，两栏一眼分得开（盘库页的小徽标另有配色，不动） */
.alert-col.is-local .ac-tag { background: var(--accent-soft); color: var(--accent); }
.alert-col.is-none .ac-tag { background: var(--surface); color: var(--ink-3); border: 1px solid var(--line); }
.ac-n { margin-left: auto; font-size: 11.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ac-none { font-size: 12.5px; color: var(--ink-3); padding: 6px 4px 4px; }
.ac-more { margin-top: 8px; font-size: 12px; color: var(--brand); }
.ac-tip { margin: -2px 0 8px; font-size: 11.5px; color: var(--ink-3); line-height: 1.5; }

/* 「未设采购地」整行横跨，桌面上内部排两列，别把一行拉成一米长 */
@media (min-width: 861px) {
  .alert-col.is-none .alert-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
}

/* 两栏并排时每行收紧一点，名称不至于被挤没 */
.alert-col .alert-item { padding: 8px 9px; gap: 8px; }
/* 分栏后名称可用宽度只有一半，允许两行，别把「阻燃板15mm（70张/架）」截成省略号 */
.alert-col .alert-item .ai-name {
  font-size: 13px; white-space: normal; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.alert-col .alert-item .ai-num b { font-size: 15.5px; }
.alert-col .alert-item .ai-num span { font-size: 11px; }
/* 右边那列是「建议补」，换个颜色和左边「当前库存」分开 */
.alert-col .alert-item .ai-num + .ai-num b { color: var(--brand); }

@media (max-width: 860px) {
  .alert-split { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .alert-col.is-none { grid-column: auto; }
  .alert-col .alert-item { padding: 9px 10px; }
  .alert-col .alert-item .ai-name { font-size: 13.5px; }
  .alert-col .alert-item .ai-num b { font-size: 16.5px; }
}

/* ---------------- 手机：仓库拍照 / 业务打卡 ---------------- */
@media (max-width: 640px) {
  .att-photos { padding: 12px 12px 14px; }
  .ap-head { display: block; margin-bottom: 10px; }
  .ap-head span { display: block; margin-top: 3px; line-height: 1.45; }
  .ap-grid { gap: 10px; }
  .ap-cell { min-height: 126px; }
  .ap-label { font-size: 12.5px; }
  .ap-meta { padding: 6px 8px; }
  .bz-me { padding: 14px 14px 16px; }
  .bz-me-head { flex-wrap: wrap; }
  .bz-punch { gap: 8px; }
  .bz-punch-item { padding: 10px; }
  .bz-clock { font-size: 18px; }
  .bz-team { grid-template-columns: 1fr; }
}

/* ---------- 常用材料检测报告（工作助手） ---------- */
.rep-list { display: flex; flex-direction: column; gap: 10px; }
.rep-row {
  display: flex; align-items: flex-start; gap: 14px; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: 14px 16px; box-shadow: var(--shadow-sm);
  transition: border-color .15s, box-shadow .15s;
}
.rep-row:hover { border-color: var(--line-2); box-shadow: 0 6px 18px rgba(0,0,0,.06); }
.rep-thumb {
  flex: none; width: 56px; height: 56px; border-radius: 10px; overflow: hidden;
  background: var(--surface-2); display: grid; place-items: center;
}
.rep-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rep-thumb.is-doc { background: #fdf2f2; border: 1px solid #f2dcdc; }
.rep-tag { font-size: 11.5px; font-weight: 700; letter-spacing: .3px; color: #c0392b; }
.rep-body { flex: 1 1 240px; min-width: 0; }
.rep-title { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.rep-title b { font-size: 14.5px; font-weight: 650; color: var(--ink); }
.rep-spec { font-size: 12.5px; color: var(--ink-2); }
.rep-meta { display: flex; flex-wrap: wrap; gap: 3px 16px; margin-top: 5px; font-size: 12.5px; color: var(--ink-2); }
.rep-k { color: var(--ink-3); margin-right: 4px; }
.rep-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 5px; font-size: 12px; color: var(--ink-3); }
.rep-dot { font-style: normal; color: var(--line-2); }
.rep-acts { flex: none; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; margin-left: auto; }

/* 上传 / 编辑弹窗 */
.rep-form { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.rep-form .rep-full { grid-column: 1 / -1; }
.rep-f { display: flex; flex-direction: column; min-width: 0; }
.rep-f input { width: 100%; min-width: 0; }
.rep-pick { display: flex; align-items: center; gap: 10px; margin: 2px 0 6px; flex-wrap: wrap; }
.rep-pick-name { font-size: 12.5px; color: var(--ink-2); word-break: break-all; }
.rep-hint { font-size: 12px; color: var(--ink-3); min-height: 16px; margin-bottom: 8px; }
.rep-empty-hint { margin-top: 6px; font-size: 12.5px; color: var(--ink-3); line-height: 1.7; }

@media (max-width: 640px) {
  .rep-row { padding: 12px; gap: 10px; }
  .rep-thumb { width: 46px; height: 46px; }
  .rep-body { flex: 1 1 160px; }
  .rep-acts { width: 100%; justify-content: flex-start; margin-left: 0; }
  .rep-acts .btn { flex: 1 1 0; min-width: 64px; }
  .rep-form { grid-template-columns: 1fr; }
}

/* ---------- AI 报价单 ---------- */
.qte-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: 14px 16px; margin-bottom: 12px; box-shadow: var(--shadow-sm);
}
.qte-card-h {
  font-size: 13.5px; font-weight: 650; color: var(--ink); margin-bottom: 10px;
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
}
.qte-card-h span { font-size: 12px; font-weight: 400; color: var(--ink-3); }
.qte-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 14px; }
.qte-f { display: flex; flex-direction: column; min-width: 0; }
.qte-f label { font-size: 12px; color: var(--ink-3); margin-bottom: 4px; }
.qte-in, .qte-ta {
  width: 100%; box-sizing: border-box; border: 1px solid var(--line); border-radius: 8px;
  padding: 8px 10px; font-size: 13.5px; color: var(--ink); background: var(--surface);
  font-family: inherit;
}
.qte-in:focus, .qte-ta:focus { outline: none; border-color: var(--brand); }
/* 占位提示（例如：…）再淡一点，跟真正填进去的字拉开层次；
   色值沿用 styles.css 里 .input 的占位色，opacity 兜住 Firefox 默认的半透明 */
.qte-in::placeholder, .qte-ta::placeholder,
.ntc-in::placeholder, .ntc-ta::placeholder { color: #a9b6c7; opacity: 1; }
.qte-ta { resize: vertical; min-height: 68px; line-height: 1.6; }
/* ④ 报价说明：含税 / 运费 / 卸货 三个条件下拉 */
.qte-note-cond { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 14px; margin-bottom: 8px; }
.qte-note-cond .qte-f > span { font-size: 12px; color: var(--ink-3); margin-bottom: 4px; }
.qte-sel {
  width: 100%; box-sizing: border-box; border: 1px solid var(--line); border-radius: 8px;
  padding: 8px 10px; font-size: 13.5px; color: var(--ink); background: var(--surface);
  font-family: inherit; appearance: none; -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%), linear-gradient(135deg, var(--ink-3) 50%, transparent 50%);
  background-position: calc(100% - 15px) 50%, calc(100% - 10px) 50%;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 28px;
}
.qte-sel:focus { outline: none; border-color: var(--brand); }
.qte-ask-row { display: flex; align-items: center; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
/* .btn 自带 display:inline-flex，会盖掉 [hidden]，这里单独兜一下 */
.qte-ask-row .btn[hidden] { display: none; }
.qte-msg { font-size: 12.5px; color: var(--ink-3); line-height: 1.5; }
.qte-msg.is-err { color: var(--danger, #d0453b); }
.qte-msg.is-ok { color: var(--ok); }
.qte-msg.is-warn { color: #9a6412; }
/* ① 里加的图片（手写单 / 微信截图） */
.qte-pics { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.qte-pics[hidden] { display: none; }
.qte-pic {
  position: relative; width: 92px; height: 92px; border-radius: 9px; overflow: hidden;
  border: 1px solid var(--line); background: var(--surface-2);
}
.qte-pic img { width: 100%; height: 100%; object-fit: cover; display: block; cursor: zoom-in; }
.qte-pic button {
  position: absolute; top: 2px; right: 2px; width: 20px; height: 20px; padding: 0;
  border: 0; border-radius: 50%; background: rgba(0, 0, 0, .55); color: #fff;
  font-size: 12px; line-height: 20px; cursor: pointer;
}
/* 表格附件 */
.qte-file {
  display: inline-flex; align-items: center; gap: 8px; max-width: 100%;
  padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px;
  background: var(--surface-2);
}
.qte-file-ic {
  flex: none; width: 26px; height: 26px; border-radius: 6px; background: var(--brand);
  color: #fff; font-size: 12px; font-weight: 650; line-height: 26px; text-align: center;
}
.qte-file-n {
  min-width: 0; max-width: 180px; font-size: 13px; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.qte-file-c { flex: none; font-size: 11.5px; color: var(--ink-3); }
.qte-file[role="button"] { cursor: pointer; }
.qte-file[role="button"]:hover { background: var(--surface); border-color: var(--line-2); }
/* 附件保留说明 + 列表里的附件数 */
.qte-keep { margin-top: 8px; font-size: 12px; color: var(--ink-3); line-height: 1.5; }
.qte-keep[hidden] { display: none; }
.qte-filetag {
  font-size: 11.5px; color: var(--ink-2); background: var(--surface-2);
  border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; flex: none;
}
.qte-file button {
  flex: none; width: 20px; height: 20px; padding: 0; border: 0; border-radius: 50%;
  background: transparent; color: var(--ink-3); font-size: 13px; line-height: 20px; cursor: pointer;
}
.qte-file button:hover { background: rgba(0, 0, 0, .06); color: var(--ink); }
/* 文件拖到 ① 卡片上时的高亮 */
.qte-card.is-drop {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}
@media (max-width: 620px) {
  .qte-pic { width: 82px; height: 82px; }
}
.qte-pick { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 2px; }
.qte-pick .qte-in { flex: 1 1 220px; }
.qte-pick-list { margin-top: 8px; max-height: 232px; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; }
.qte-pick-row {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px;
  border-bottom: 1px solid var(--line); cursor: pointer;
}
.qte-pick-row:last-child { border-bottom: 0; }
.qte-pick-row:hover { background: var(--surface-2); }
.qte-pick-n { flex: 1 1 auto; min-width: 0; font-size: 13px; color: var(--ink); }
.qte-pick-s { font-size: 11.5px; color: var(--ink-3); white-space: nowrap; flex: 0 1 auto; min-width: 0;
  display: inline-flex; align-items: center; gap: 6px; }
/* 规格文字太长时先省略，别把右边的单价挤出去 */
.qte-st { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qte-pick-p { flex: none; font-variant-numeric: tabular-nums; font-weight: 650; color: var(--ink); font-size: 13px; }
/* 单价后面带单位（฿38.40/个）：单位不一致时才知道这个价是「每个」的 */
.qte-pick-pu { font-style: normal; font-weight: 500; color: var(--ink-3); font-size: 11px; margin-left: 1px; }
.qte-pick-none { color: var(--ink-3); font-weight: 500; font-size: 12px; }
/* 挑材料时就标出单位对不对得上 */
.qte-pick-u { display: inline-block; flex: none; padding: 0 5px; border-radius: 999px; font-size: 10.5px; font-weight: 600; line-height: 15px; background: #fff1d8; color: #8a5306; }
.qte-pick-u.is-ok { background: var(--brand-soft); color: var(--brand); }
/* 弹窗顶部那句单位说明 */
.qte-unit-tip { margin: 8px 0 0; padding: 7px 9px; border-radius: 8px; background: var(--surface-2); color: var(--ink-3); font-size: 11.5px; line-height: 1.6; }
.qte-unit-tip b { color: var(--ink-2, var(--ink)); font-weight: 600; }
.qte-lines-wrap { overflow-x: auto; margin-top: 10px; }
.qte-lines { width: 100%; min-width: 960px; border-collapse: collapse; }
/* 统一折扣：桌面挂在「报价单价」表头右边，手机上表格上方单独一行 */
.qte-th-qp { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.qte-ud-grp { display: inline-flex; align-items: center; gap: 5px; }
.qte-ud-lb { font-size: 11px; color: var(--ink-3); white-space: nowrap; }
.qte-ud {
  display: inline-flex; align-items: center; height: 24px; padding: 0 5px;
  border: 1px solid var(--line-2); border-radius: 7px; background: var(--surface); white-space: nowrap;
}
.qte-ud:focus-within { border-color: var(--brand); }
.qte-ud input {
  width: 52px; padding: 0 2px; border: 0; background: transparent;
  font-family: inherit; font-size: 11.5px; color: var(--brand); text-align: right;
  font-variant-numeric: tabular-nums; -moz-appearance: textfield; appearance: textfield;
}
.qte-ud input:focus { outline: none; }
.qte-ud input::placeholder { color: var(--ink-3); font-size: 10.5px; }
.qte-ud input::-webkit-outer-spin-button,
.qte-ud input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.qte-ud i { font-style: normal; font-size: 10.5px; color: var(--ink-3); }
.qte-ud-bar { display: none; }
.qte-lines th {
  font-size: 12px; color: var(--ink-3); font-weight: 500; text-align: left;
  padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.qte-lines td { padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.qte-lines .qte-in { padding: 6px 8px; font-size: 13px; }
.qte-ln-n { font-size: 13.5px; font-weight: 600; color: var(--ink); }
/* 来源：客户单上对应的那一行原文（桌面单独一列，手机上放在材料名下面） */
.qte-lines td.qte-td-src { vertical-align: top; padding-top: 9px; }
.qte-src-txt {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  font-size: 11.5px; line-height: 1.5; color: var(--ink-3); word-break: break-word;
  width: 100%; margin: 0; padding: 0; border: 0; background: none; text-align: left;
  font-family: inherit; cursor: pointer;
}
.qte-src-txt:hover { color: var(--brand); text-decoration: underline dotted; }
.qte-src-none {
  font-size: 11.5px; color: var(--ink-3); opacity: .55;
  margin: 0; padding: 0; border: 0; background: none; font-family: inherit; cursor: pointer;
}
.qte-src-none:hover { opacity: 1; color: var(--brand); text-decoration: underline dotted; }
.qte-ln-src {
  display: none; margin-top: 3px; font-size: 11.5px; line-height: 1.45;
  color: var(--ink-3); word-break: break-word;
  width: 100%; padding: 0; border: 0; background: none; text-align: left;
  font-family: inherit; cursor: pointer;
}
/* 改来源 / 改名的输入条 */
.qte-src-man { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.qte-src-man .ntc-in { flex: 1 1 auto; min-width: 0; }
.qte-src-man .btn { flex: none; }
.qte-src-rename { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.qte-src-lb { font-size: 11.5px; color: var(--ink-3); line-height: 1.5; }
/* 修改弹窗里的「记住客户叫法」 */
.qte-rem {
  display: flex; align-items: center; gap: 6px; margin-top: 8px; padding: 6px 9px;
  border-radius: 8px; background: var(--brand-soft); font-size: 11.5px; color: var(--ink-2); cursor: pointer;
}
.qte-rem input { flex: none; margin: 0; }
.qte-pick-row.is-cur { background: var(--brand-soft); }
.qte-ln-s { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; }
/* 单位换算说明：客户报 100 ㎡，按 2.88 ㎡/张 → 35 张 */
.qte-ln-conv { font-size: 11px; color: var(--brand); margin-top: 2px; }
/* 单位对不上（箱 / 件 / 套 ↔ 个）：价格表按哪个单位卖、单价多少，用琥珀色提醒数量要重填 */
.qte-ln-conv.is-warn { color: #8a5306; background: #fff6e5; border-radius: 6px; padding: 1px 6px; display: inline-block; line-height: 1.5; }
/* 数量还没按价格表单位重填：框标成琥珀色，填过就撤掉 */
.qte-td-qty.is-check input { border-color: #e0a44a; background: #fffaf0; box-shadow: 0 0 0 2px rgba(224, 164, 74, .14); }
/* 单位不同时数量框下面两个出口：确认（按 1:1 用客户的数量）/ 重填（清空自己数） */
.qte-qty-ask { display: flex; gap: 4px; margin-top: 5px; }
.qte-ask {
  flex: 1 1 0; min-width: 0; min-height: 24px; padding: 4px 2px; font-size: 11.5px; line-height: 1.25;
  border: 1px solid #e0a44a; border-radius: 6px; background: #fff; color: #8a5306;
  cursor: pointer; font-family: inherit; white-space: nowrap;
}
.qte-ask:hover { background: #fff6e5; }
.qte-ask.is-re { border-color: var(--line); color: var(--ink-3); }
.qte-ask.is-re:hover { background: #f7f8fa; }
.qte-ask:disabled { opacity: .5; cursor: default; }
/* 单位提示里的一键登记：把客户这个单位记成该材料的其他单位（1:1 同价） */
.qte-reg-u {
  margin-left: 4px; padding: 0 5px; font-size: 10.5px; line-height: 1.6;
  border: 1px solid #e2bd8f; border-radius: 6px; background: #fff; color: #8a5306;
  cursor: pointer; font-family: inherit; white-space: nowrap;
}
.qte-reg-u:hover { background: #fff6e5; }
.qte-reg-u:disabled { opacity: .5; cursor: default; }
/* 手机上「确认 / 重填」是手指点的，给足高度 */
@media (max-width: 620px) {
  .qte-ask { min-height: 30px; font-size: 12px; }
}
/* 人工标记过「不在价格表」：解释这条为什么没自动配价 */
.qte-ln-neg { font-size: 11px; color: #8a5306; margin-top: 2px; }

/* ---------- 待定价行（价格表里没找到的材料） ----------
 * 排在明细最后，数量先填好、单价留空；行下面给「别名捆绑」入口。 */
.qte-lines tr.qte-ln-need { background: var(--warn-soft); }
.qte-tag { display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 999px; font-size: 10.5px; font-weight: 600; line-height: 16px; vertical-align: 1px; }
.qte-tag.is-wait { background: #f3ddc0; color: #8a5306; }
.qte-tag.is-filled { background: var(--brand-soft); color: var(--brand); }
/* 这条单价来自电动工具报价表（不是建材价格表），给个颜色区分 */
.qte-tag.is-tool { background: #ece9fe; color: #5b46c9; }
/* 材料名后面那个「修改」：小号描边按钮，随时可以改选价格表里的料或转待定价 */
.qte-edit { margin-left: 6px; padding: 0 7px; height: 20px; border: 1px solid var(--line-2); border-radius: 999px;
  background: transparent; color: var(--ink-3); font-size: 11px; font-weight: 500; line-height: 18px; vertical-align: 1px; }
.qte-edit:hover { border-color: var(--brand); color: var(--brand); background: #fff; }
.qte-in.is-need { border-color: #e2bd8f; background: #fffdf8; }
/* 价格表单价：只读，做成「平铺的数字」而不是输入框，一眼看出这里不能改 */
.qte-base {
  display: inline-block; font-size: 13px; color: var(--ink-2);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.qte-base.is-none { color: var(--ink-3); }
.qte-lines td.qte-td-base { color: var(--ink-2); text-align: right; }
/* 报价单价框：折扣不是一列，就是右边挂着的小格（带 %），填完左边自动算 */
.qte-qp-box {
  display: flex; align-items: stretch; min-width: 0;
  border: 1px solid var(--line); border-radius: 8px; background: var(--surface); overflow: hidden;
}
.qte-qp-box:focus-within { border-color: var(--brand); }
.qte-qp-box.is-need { border-color: #e2bd8f; background: #fffdf8; }
.qte-qp-box .qte-in {
  flex: 1 1 auto; min-width: 0; border: 0; border-radius: 0; background: transparent;
  padding: 6px 8px; text-align: right; font-variant-numeric: tabular-nums;
}
.qte-qp-box .qte-in:focus { border: 0; }
/* 折扣小格：虚线分隔 + 淡底，一眼看出是调价用的，不是另一个价格 */
.qte-mk-box {
  flex: none; display: flex; align-items: center; padding: 0 6px 0 0;
  border-left: 1px dashed var(--line-2); background: var(--surface-2);
}
.qte-mk-in {
  width: 42px; padding: 6px 1px 6px 6px; border: 0; background: transparent;
  font-family: inherit; font-size: 12.5px; color: var(--brand); text-align: right;
  font-variant-numeric: tabular-nums; -moz-appearance: textfield; appearance: textfield;
}
.qte-mk-in:focus { outline: none; }
/* 去掉浏览器自带的上下箭头：格子只有 40 多像素，箭头一来数就挤没了 */
.qte-mk-in::-webkit-outer-spin-button,
.qte-mk-in::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.qte-mk-in::placeholder { color: var(--ink-3); font-size: 10.5px; }
.qte-mk-pc { font-style: normal; font-size: 10.5px; color: var(--ink-3); }
.qte-mk-box.is-off { opacity: .55; }
.qte-in.is-off, .qte-in:disabled {
  background: var(--surface-3); color: var(--ink-3); border-color: var(--line); cursor: not-allowed;
}
.qte-amt.is-wait { color: var(--warn); font-weight: 500; }
.qte-bind-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.qte-bind-hint { flex: 1 1 160px; min-width: 0; font-size: 11.5px; color: var(--ink-3); line-height: 1.5; }
.qte-bind-btn { height: 24px; padding: 0 9px; border: 1px dashed #d3b184; border-radius: 999px; background: #fff; color: var(--warn); font-size: 11.5px; font-weight: 600; }
.qte-bind-btn:hover { background: var(--warn-soft); }
.qte-bind-ok { padding: 2px 9px; border-radius: 999px; background: var(--ok-soft); color: var(--ok); font-size: 11.5px; }
.qte-bind-x { padding: 0; border: 0; background: transparent; color: var(--ink-3); font-size: 11.5px; text-decoration: underline; }
.qte-amt { text-align: right; font-variant-numeric: tabular-nums; font-weight: 650; white-space: nowrap; }
.qte-sum { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; border-top: 1px dashed var(--line-2); padding-top: 12px; }
.qte-sum > div { display: flex; justify-content: space-between; font-size: 13px; color: var(--ink-2); }
.qte-sum b { font-variant-numeric: tabular-nums; color: var(--ink); }
.qte-sum .is-total { border-top: 1px solid var(--line); padding-top: 8px; margin-top: 2px; font-size: 14.5px; align-items: baseline; }
.qte-sum .is-total b { font-size: 19px; color: var(--brand); }
.qte-foot { display: flex; gap: 10px; flex-wrap: wrap; margin: 4px 0 8px; }
.qte-prev {
  margin: 0; font-size: 13px; line-height: 1.9; white-space: pre-wrap; word-break: break-word;
  font-family: inherit; color: var(--ink);
}

/* 报价单预设版式：表格 / 图片 / Excel 同一套列与文案 */
.qte-prev-tabs {
  display: inline-flex; gap: 3px; padding: 3px; margin-bottom: 14px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 9px;
}
.qte-prev-tabs button {
  border: 0; background: transparent; border-radius: 7px; padding: 5px 16px;
  font-size: 12.5px; color: var(--ink-2);
}
.qte-prev-tabs button.is-on {
  background: var(--surface); color: var(--brand); font-weight: 600; box-shadow: var(--shadow-sm);
}
.qte-prev-pane[hidden] { display: none; }
.qte-prev-warn {
  margin: 0 0 12px; padding: 8px 11px; border-radius: 8px;
  background: var(--warn-soft); color: #7d5108; font-size: 12.5px; line-height: 1.55;
}
.qte-doc-tb .qte-doc-wait { color: var(--warn); font-weight: 600; }
.qte-prev-copybar { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.qte-prev-copybar span { font-size: 11.5px; color: var(--ink-3); }
.qte-prev-img { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 8px; }
.qte-prev-img img { display: block; width: 100%; height: auto; border-radius: 6px; }
.qte-prev-hint { margin: 9px 0 0; text-align: center; font-size: 11.5px; color: var(--ink-3); line-height: 1.6; }
.qte-prev-load, .qte-prev-err { padding: 46px 12px; text-align: center; font-size: 12.5px; color: var(--ink-3); }
.qte-prev-err { color: var(--danger); }

.qte-doc { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 20px 22px 16px; }
.qte-doc-hd {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 16px;
  padding-bottom: 10px; border-bottom: 2px solid var(--brand);
}
.qte-doc-co b { display: block; font-size: 21px; line-height: 1.2; letter-spacing: .5px; color: var(--ink); }
.qte-doc-co span { display: block; margin-top: 3px; font-size: 8.5px; letter-spacing: 1.3px; color: var(--ink-3); }
.qte-doc-kd { text-align: right; }
.qte-doc-kd b { display: block; font-size: 15.5px; line-height: 1.2; letter-spacing: 1px; color: var(--brand); }
.qte-doc-kd span { display: block; margin-top: 3px; font-size: 8.5px; letter-spacing: 2px; color: var(--ink-3); }
.qte-doc-meta {
  margin-top: 12px; padding: 10px 14px; border-radius: 8px; background: var(--surface-2);
  display: flex; flex-direction: column; gap: 4px; font-size: 12.5px;
}
.qte-doc-meta > div { display: flex; flex-wrap: wrap; row-gap: 3px; }
.qte-doc-meta > div > span { display: inline-block; margin-right: 22px; }
.qte-doc-meta .k { color: var(--ink-3); margin-right: 4px; }
.qte-doc-meta .v { font-weight: 600; color: var(--ink); }
.qte-doc-scroll { margin-top: 14px; overflow-x: auto; }
.qte-doc-tip { display: none; }
.qte-doc-tb { width: 100%; min-width: 700px; border-collapse: collapse; font-size: 12.5px; }
.qte-doc-tb th {
  background: var(--brand); color: #fff; font-weight: 600; padding: 9px 8px;
  border: 1px solid var(--brand); white-space: nowrap;
}
.qte-doc-tb td { border: 1px solid var(--line); padding: 8px; vertical-align: top; line-height: 1.55; }
.qte-doc-tb tbody tr:nth-child(even) td { background: #fafcfe; }
.qte-doc-tb .ta-left { text-align: left; }
.qte-doc-tb .ta-center { text-align: center; }
.qte-doc-tb .ta-right { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.qte-doc-tb .qte-doc-spec { color: var(--ink-2); }
.qte-doc-tb .qte-doc-amt { font-weight: 600; }
.qte-doc-sums { width: min(320px, 100%); margin: 12px 0 0 auto; }
.qte-doc-sums > div {
  display: flex; justify-content: space-between; gap: 20px;
  padding: 6px 10px; font-size: 12.5px; color: var(--ink-2);
  border-bottom: 1px dashed var(--line);
}
.qte-doc-sums b { font-variant-numeric: tabular-nums; color: var(--ink); font-weight: 600; }
.qte-doc-sums .is-total {
  margin-top: 6px; padding: 9px 10px; border: 0; border-radius: 8px;
  background: var(--brand-soft); color: var(--brand); font-weight: 700; font-size: 13.5px;
}
.qte-doc-sums .is-total b { color: var(--brand); font-size: 15px; }
.qte-doc-note {
  margin-top: 14px; padding: 9px 12px;
  background: var(--surface-2); border-left: 3px solid var(--brand); border-radius: 0 8px 8px 0;
}
.qte-doc-note b { font-size: 11.5px; color: var(--brand); }
.qte-doc-note p { margin: 3px 0 0; font-size: 12.5px; line-height: 1.7; color: var(--ink-2); white-space: pre-wrap; }
.qte-doc-ft {
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  margin-top: 16px; padding-top: 10px; border-top: 1px solid var(--line);
  font-size: 12px; color: var(--ink-2);
}
.qte-doc-gen { margin-top: 8px; text-align: center; font-size: 10.5px; color: var(--ink-3); }

@media (max-width: 620px) {
  .qte-doc { padding: 14px 13px 12px; }
  .qte-doc-co b { font-size: 18px; }
  .qte-doc-kd b { font-size: 13.5px; }
  .qte-doc-tb { min-width: 640px; }
  .qte-doc-tip { display: block; margin-top: 6px; font-size: 11px; color: var(--ink-3); }
  .qte-prev-tabs { display: flex; }
  .qte-prev-tabs button { flex: 1; padding: 7px 0; }
}

/* 报价单列表 */
.qte-list { display: flex; flex-direction: column; gap: 10px; }
.qte-lrow {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: 13px 16px; box-shadow: var(--shadow-sm);
}
.qte-lrow:hover { border-color: var(--line-2); }
.qte-lmain { flex: 1 1 240px; min-width: 0; }
.qte-ltop { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.qte-ltop b { font-size: 14.5px; font-weight: 650; color: var(--ink); }
.qte-no {
  font-size: 11.5px; color: var(--brand); background: var(--accent-soft);
  border-radius: 999px; padding: 1px 8px; font-variant-numeric: tabular-nums;
}
.qte-lsub { font-size: 12.5px; color: var(--ink-3); margin-top: 4px; }
.qte-lsum { flex: none; font-size: 17px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.qte-lact { flex: none; display: flex; gap: 6px; align-items: center; }

@media (max-width: 860px) {
  .qte-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .qte-grid { grid-template-columns: 1fr; }
  /* 说明的三个条件在手机上仍排一行（三个字：含税 / 含运费 / 含卸货） */
  .qte-note-cond { gap: 8px; }
  .qte-note-cond .qte-f > span { font-size: 11.5px; }
  .qte-sel { padding: 7px 22px 7px 8px; font-size: 12.5px; background-position: calc(100% - 12px) 50%, calc(100% - 7px) 50%; }
  .qte-lrow { padding: 12px; gap: 10px; }
  .qte-lsum { font-size: 16px; }
  .qte-lact { width: 100%; }
  .qte-lact .btn { flex: 1 1 0; }
  .qte-foot .btn { flex: 1 1 0; }
}

/* 手机上明细表改成一条一卡：名称占一行，单价/报价单价并排，折扣/数量、金额/删除再两行 */
@media (max-width: 620px) {
  .qte-lines-wrap { overflow-x: visible; }
  .qte-lines { min-width: 0; width: 100%; }
  .qte-lines thead { display: none; }
  .qte-lines tbody { display: block; }
  .qte-lines tr {
    display: grid; grid-template-columns: 1fr 1fr; gap: 8px 10px;
    grid-template-areas:
      "name name"
      "base qty"
      "qp   qp"
      "amt  x";
    padding: 11px 0; border-bottom: 1px solid var(--line);
  }
  .qte-lines td { display: block; border: 0; padding: 0; }
  .qte-lines td.inv-name { grid-area: name; }
  .qte-lines td.qte-td-base { grid-area: base; text-align: left; }
  .qte-lines td.qte-td-src { display: none; }
  .qte-ln-src { display: block; }
  .qte-lines td.qte-td-qp { grid-area: qp; }
  .qte-lines td.qte-td-qty { grid-area: qty; }
  .qte-lines td.qte-amt { grid-area: amt; align-self: center; text-align: left; }
  .qte-lines td.qte-td-x { grid-area: x; text-align: right; align-self: center; }
  /* 表头在手机上藏了，每个格子自己带一行小标题 */
  .qte-lines td.qte-td-base::before { content: '单价 ฿'; }
  .qte-lines td.qte-td-qp::before { content: '报价单价 ฿'; }
  .qte-lines td.qte-td-qty::before { content: '数量'; }
  .qte-lines td.qte-amt::before { content: '金额'; }
  .qte-lines td.qte-td-base::before,
  .qte-lines td.qte-td-qp::before,
  .qte-lines td.qte-td-qty::before,
  .qte-lines td.qte-amt::before {
    display: block; font-size: 11px; color: var(--ink-3); font-weight: 400; margin-bottom: 3px;
  }
  .qte-lines td.qte-amt { font-weight: 650; }
  .qte-ud-bar {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    margin: 2px 0 10px; font-size: 12px; color: var(--ink-3);
  }
  .qte-ud-bar .qte-msg { font-size: 11.5px; }
  .qte-mk-in { width: 52px; font-size: 13px; }
  .qte-lines td.qte-td-qp .qte-in { padding: 7px 9px; }
}

/* ---------- 使用说明（帮助页） ---------- */
.hp-wrap { max-width: 1180px; }
/* 左目录 / 右正文：目录跟着滚动停在原位，正文单独一栏，读长文不用来回翻 */
.hp-cols { display: grid; grid-template-columns: 234px minmax(0, 1fr); gap: 28px; align-items: start; }
.hp-side { position: sticky; top: 0; min-width: 0; padding-bottom: 12px; }
.hp-main { min-width: 0; max-width: 860px; }
.hp-bar { display: flex; align-items: center; gap: 12px; margin: 2px 0 8px; }
.hp-q {
  flex: 1 1 auto; min-height: 40px; padding: 0 14px; border: 1px solid var(--line);
  border-radius: 10px; background: var(--surface); color: var(--ink); font-size: 14px;
}
.hp-q:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.hp-hit { display: block; min-height: 16px; margin: 0 2px 8px; font-size: 12px; color: var(--ink-3); }
/* 桌面版目录在左栏竖排；窄屏回到顶部横排（见下面的媒体查询） */
.hp-toc { display: flex; flex-direction: column; gap: 2px; margin-bottom: 0; }
.hp-toc-i {
  border: 1px solid transparent; background: transparent; color: var(--ink-2);
  border-radius: 8px; padding: 7px 9px; font-size: 12.5px; line-height: 1.5;
  text-align: left; cursor: pointer;
  transition: background .15s, color .15s;
}
.hp-toc-i:hover { background: var(--brand-soft); color: var(--brand); }
/* 滚到哪一章，目录里就把那一章点亮 */
.hp-toc-i.is-cur { background: var(--brand-soft); color: var(--brand); font-weight: 650; }
/* 搜索把某章滤掉了，对应的目录按钮跟着灰掉，点了也没内容 */
.hp-toc-i.is-off { opacity: .35; pointer-events: none; }
.hp-sect { margin-bottom: 24px; scroll-margin-top: 12px; }
.hp-h2 { display: flex; align-items: center; gap: 6px; font-size: 16px; margin: 0 0 3px; color: var(--ink); }
.hp-desc { font-size: 12.5px; color: var(--ink-3); margin: 0 0 11px; }
.hp-items { display: flex; flex-direction: column; gap: 10px; }
.hp-item {
  position: relative;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); padding: 14px 16px; box-shadow: var(--shadow-sm);
}
/* 搜索时用 hidden 收起来；作者写的 display 会盖掉 hidden，必须显式关掉 */
.hp-item[hidden], .hp-sect[hidden] { display: none !important; }
.hp-h3 { font-size: 14px; margin: 0 0 8px; color: var(--ink); }
/* styles.css 里 ol/ul 被全局去掉了序号，这里单独恢复：步骤要能数得清第几步 */
.hp-steps {
  margin: 0; padding-left: 22px; list-style: decimal;
  font-size: 13px; line-height: 1.85; color: var(--ink-2);
}
.hp-steps li { display: list-item; margin-bottom: 3px; }
.hp-steps li::marker { color: var(--brand); font-weight: 700; }
.hp-steps b, .hp-note b { color: var(--ink); font-weight: 650; }
.hp-note {
  margin-top: 10px; padding: 8px 11px; background: var(--brand-soft);
  border-left: 3px solid var(--brand); border-radius: 6px;
  font-size: 12.5px; line-height: 1.75; color: var(--ink-2);
}
.hp-empty { padding: 34px 0; text-align: center; color: var(--ink-3); font-size: 13px; }
.hp-empty[hidden] { display: none !important; }

/* ---------- 编辑态（管理员 / 内勤）：正文直接改 ---------- */
.hp-editbar {
  position: sticky; top: 0; z-index: 6;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin: 0 0 12px; padding: 8px 10px 8px 12px;
  background: var(--warn-soft); border: 1px solid #f0ddb8; border-radius: 10px;
  color: var(--warn); font-size: 12.5px; box-shadow: var(--shadow-sm);
}
.hp-eb-sp { flex: 1; }
.hp-body.is-edit .hp-item { border-color: #d7e4f3; }
.hp-body.is-edit .hp-item:hover { border-color: var(--brand); }
.hp-body.is-edit [contenteditable] { outline: none; border-radius: 4px; min-height: 1em; }
.hp-body.is-edit [contenteditable]:hover { background: #f4f9ff; }
.hp-body.is-edit [contenteditable]:focus {
  background: #fff;
  box-shadow: 0 0 0 2px var(--brand-soft), 0 0 0 3px #bad5ef;
}
.hp-body.is-edit .hp-h3 { padding-right: 26px; }   /* 别让标题钻到删除按钮下面 */
.hp-x {
  position: absolute; top: 8px; right: 8px; width: 22px; height: 22px;
  padding: 0; border: 1px solid transparent; border-radius: 6px;
  background: transparent; color: var(--ink-3); font-size: 15px; line-height: 1; cursor: pointer;
}
.hp-x:hover { color: var(--danger); background: var(--danger-soft); border-color: #f0cdc8; }
.hp-add {
  margin-top: 9px; height: 30px; padding: 0 12px;
  border: 1px dashed var(--line-2); border-radius: 8px;
  background: transparent; color: var(--ink-3); font-size: 12.5px; cursor: pointer;
}
.hp-add:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }
/* 提示框空着也能点进去写：给个灰字占位 */
.hp-note[contenteditable]:empty::before { content: '（这一条没有补充提示，可留空）'; color: var(--ink-3); }

/* 窄屏（平板 / 手机）：目录回到正文上方，横排可滑 */
@media (max-width: 1000px) {
  .hp-cols { display: block; }
  .hp-side { position: static; }
  .hp-main { max-width: none; }
  .hp-toc { flex-direction: row; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; }
  .hp-toc-i { border-color: var(--line); background: var(--surface); border-radius: 999px; padding: 6px 12px; }
  .hp-toc-i:hover { border-color: var(--brand); }
  .hp-toc-i.is-cur { border-color: var(--brand); }
  .hp-hit { margin-bottom: 6px; }
}

@media (max-width: 640px) {
  .hp-bar { flex-wrap: wrap; gap: 8px; }
  .hp-q { min-height: 40px; font-size: 16px; }   /* 手机上小于 16px 会被 iOS 放大 */
  .hp-toc { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
  .hp-toc::-webkit-scrollbar { display: none; }
  .hp-toc-i { flex: none; }
  .hp-item { padding: 12px 13px; }
  .hp-steps { padding-left: 18px; font-size: 12.5px; line-height: 1.8; }
  /* 手机上编辑条只留三个按钮，提示文字省掉，不然要折成两行 */
  .hp-eb-t { display: none; }
  .hp-editbar { gap: 6px; padding: 8px; }
}

/* ============================================================
   海柜记录 · 编辑订单里的「从产品信息选」
   压在编辑弹窗之上的一层（不替换它，关掉表单原样还在）
   ============================================================ */
.pkpick { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 24px; }
.pkpick-mask { position: absolute; inset: 0; background: rgba(12, 24, 40, .46); backdrop-filter: blur(2px); }
.pkpick-card {
  position: relative; z-index: 1; width: min(880px, 100%); max-height: calc(100vh - 48px);
  background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; overflow: hidden; animation: pop .18s ease-out;
}
.pkpick-head { display: flex; align-items: flex-start; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.pkpick-head h3 { font-size: 16px; letter-spacing: -.1px; }
.pkpick-head .sub { font-size: 12.5px; color: var(--ink-3); line-height: 1.6; margin-top: 3px; }
.pkpick-x {
  margin-left: auto; flex: 0 0 auto; width: 30px; height: 30px; border-radius: 8px; border: 0;
  background: var(--surface-2); color: var(--ink-2); display: grid; place-items: center; cursor: pointer;
}
.pkpick-x:hover { background: var(--surface-3); color: var(--ink); }
.pkpick-body { padding: 14px 20px; overflow-y: auto; flex: 1; }
.pkpick-bar { margin-bottom: 10px; }
.pkpick .cat-search { max-width: none; width: 100%; }
.pkpick .inv-table-wrap { overflow-x: auto; }
.pkpick .inv-table td { padding: 10px 12px; }
.pkpick .inv-table th { padding: 9px 12px; }
.pkpick [data-pk-add].is-done { color: var(--ok); border-color: var(--ok); background: var(--ok-soft); }
.pkpick-foot {
  display: flex; align-items: center; gap: 10px; padding: 12px 20px;
  border-top: 1px solid var(--line); background: var(--surface-2);
  font-size: 12.5px; color: var(--ink-3); font-variant-numeric: tabular-nums;
}
.pkpick-foot .right { margin-left: auto; display: flex; gap: 8px; }
/* 编辑订单里「添加产品 / 从产品信息选」并排 */
.ie-add-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; }

@media (max-width: 640px) {
  .pkpick { padding: 10px; }
  .pkpick-card { max-height: calc(100vh - 20px); border-radius: 13px; }
  .pkpick-head { padding: 13px 14px; }
  .pkpick-head .sub { display: none; }   /* 手机上省一行，标题自己说明得清 */
  .pkpick-body { padding: 12px 12px; }
  .pkpick-foot { padding: 10px 12px; }
  .pkpick .inv-table th, .pkpick .inv-table td { padding: 9px 8px; }
  .pkpick .cat-th { width: 44px; height: 44px; }
  .pkpick .pkp-hide-s { display: none; }   /* 体积列让位，名称和毛重留住 */
  .pkpick .inv-item-alt { max-width: 150px; }
}

/* ============================================================
   工作助手 · 工地距离查询
   仓库条 / 输入框 / 结果卡 / 自绘示意图 / 历史
   ============================================================ */
.dst-whs { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.dst-wh {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  padding: 8px 12px; font-size: 13px;
}
.dst-wh b { font-weight: 600; color: var(--ink); }
.dst-wh-c { color: var(--ink-3); font-variant-numeric: tabular-nums; font-size: 12px; }
.dst-dot { width: 9px; height: 9px; border-radius: 50%; background: #245bdb; flex: none; }
.dst-dot.is-2 { background: #0b8a5a; }

.dst-ta {
  width: 100%; height: 74px; min-height: 58px; padding: 10px 12px; resize: vertical;
  border: 1px solid var(--line-2, var(--line)); border-radius: 10px;
  background: var(--surface); color: var(--ink); font: 13.5px/1.6 inherit;
}
.dst-ta::placeholder { text-align: center; color: var(--ink-3); }
.dst-ta:focus { outline: none; border-color: var(--brand, #245bdb); box-shadow: 0 0 0 3px rgba(36, 91, 219, .08); }
.dst-acts { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.dst-tip { font-size: 12.5px; color: var(--ink-2); min-height: 18px; margin-top: 8px; text-align: center; }
.dst-tip.is-bad { color: #c0392b; }
.dst-tip.is-ok { color: #0b8a5a; }

/* 缩略图就够了，别占半屏：96×64 的方图，按钮放右边 */
.dst-imgbox { margin-top: 12px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: #f7f9fc; display: flex; align-items: center; gap: 12px; }
.dst-imgbox[hidden] { display: none; }
.dst-imgbox img { width: 96px; height: 64px; object-fit: cover; border-radius: 6px; display: block; flex: 0 0 auto; border: 1px solid var(--line); background: #eef2f7; }
.dst-imgmain { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.dst-imgact { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 0; }
.dst-imgbox .dst-ai { margin-top: 0; min-height: 0; }
.dst-ai { font-size: 12.5px; color: var(--ink-2); margin-top: 6px; min-height: 18px; }
.dst-ai.is-ok { color: #0b8a5a; }
.dst-ai.is-warn { color: #b26a00; }
.dst-ai.is-bad { color: #c0392b; }
/* 截图投放区：虚线框，拖进来 / 粘进来都行。图标与两行说明横排，省掉竖排的大块留白 */
.dst-drop {
  position: relative; padding: 11px 14px 13px; cursor: text;
  border: 2px dashed #c8d7e9; border-radius: 12px; background: #fbfdff;
  transition: border-color .15s ease, background .15s ease;
}
.dst-drop:hover { border-color: #a9c1dc; }
.dst-drop.is-drag { border-color: var(--brand, #245bdb); background: #f5f9ff; }
.dst-drop-in { display: flex; align-items: center; gap: 9px; margin: 0 0 9px; pointer-events: none; }
.dst-drop-ic { width: 20px; height: 20px; flex: 0 0 auto; color: var(--brand, #245bdb); display: block; margin: 0; }
.dst-drop-tx { min-width: 0; }
.dst-drop-t { font-size: 13.5px; font-weight: 600; color: var(--ink); line-height: 1.35; }
.dst-drop-s { font-size: 12px; color: var(--ink-3); margin-top: 2px; line-height: 1.4; }
.dst-dropmask {
  position: absolute; inset: 0; z-index: 6;
  display: flex; align-items: center; justify-content: center;
  border: 2px dashed var(--brand, #245bdb); border-radius: 14px;
  background: #f3f7fe; color: var(--brand, #245bdb);
  font-size: 15px; font-weight: 600; letter-spacing: .3px;
  pointer-events: none; opacity: 0; visibility: hidden;
  transition: opacity .12s ease;
}
.dst-dropmask::before { content: '↓'; margin-right: 9px; font-size: 17px; font-weight: 700; }
.dst-drop.is-drag .dst-dropmask { opacity: 1; visibility: visible; }

.dst-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.dst-card {
  border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px;
  background: var(--surface); position: relative;
}
.dst-card.is-near { border-color: #9fc3ff; box-shadow: 0 0 0 2px rgba(36, 91, 219, .07); }
.dst-card-h { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); }
.dst-card-h b { color: var(--ink); font-size: 14px; }
.dst-near { margin-left: auto; font-size: 11px; color: #245bdb; background: #eef3ff; border-radius: 999px; padding: 1px 8px; }
.dst-big { margin: 8px 0 2px; font-size: 27px; font-weight: 650; letter-spacing: -.6px; color: var(--ink); font-variant-numeric: tabular-nums; }
.dst-big small { font-size: 12.5px; font-weight: 400; color: var(--ink-2); margin-left: 5px; letter-spacing: 0; }
.dst-big.is-wait { font-size: 19px; color: var(--ink-3); font-weight: 500; letter-spacing: 0; }
.dst-road { font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.dst-road b { color: var(--ink); }
.dst-est { color: var(--ink-3); font-size: 12px; }
.dst-dir { font-size: 12px; color: var(--ink-3); margin-top: 7px; }

.dst-map { margin-top: 14px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fbfdff; max-width: 920px; }
.dst-map svg { display: block; width: 100%; height: auto; }
.dst-map-cap { padding: 7px 12px 8px; font-size: 11.5px; color: var(--ink-3); border-top: 1px dashed var(--line); }

.dst-meta { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 10px; font-size: 12.5px; color: var(--ink-2); }
.dst-meta b { color: var(--ink); font-variant-numeric: tabular-nums; }
.dst-warn { color: #b26a00; }
.dst-acts2 { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.dst-note { margin-top: 12px; }

.dst-hlist { border-top: 1px solid var(--line); }
.dst-hitem {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 10px 2px; border-bottom: 1px solid var(--line); font-size: 12.5px;
}
.dst-hmain { display: flex; flex-direction: column; gap: 2px; min-width: 210px; }
.dst-hmain b { color: var(--ink); font-variant-numeric: tabular-nums; font-size: 13px; }
.dst-hmain span { color: var(--ink-3); font-size: 11.5px; }
.dst-hdist { color: var(--ink-2); flex: 1; min-width: 200px; font-variant-numeric: tabular-nums; }
.dst-hact { display: flex; gap: 6px; }

@media (max-width: 640px) {
  .dst-whs { gap: 8px; }
  .dst-wh { flex: 1 1 100%; }
  .dst-cards { grid-template-columns: 1fr; }
  .dst-big { font-size: 24px; }
  .dst-hmain { min-width: 100%; }
  .dst-hdist { min-width: 100%; }
  .dst-ta { height: 78px; min-height: 62px; }
  .dst-drop { padding: 10px 11px 12px; }
  .dst-drop-in { margin-bottom: 8px; gap: 8px; }
  .dst-drop-t { font-size: 13px; }
  .dst-drop-s { font-size: 11.5px; }
  .dst-drop-ic { width: 18px; height: 18px; }
}

/* 打印 / 存 PDF：只留正文，去掉顶栏、导航和筛选条 */
@media print {
  .topbar, .portal-nav, .preview-bar, .hp-side, .hp-bar, .hp-toc, .hp-editbar, .hp-add, .hp-x,
  .pt-actions, .toasts, .modal-root, .lightbox { display: none !important; }
  .page-view {
    position: static !important; inset: auto !important;
    overflow: visible !important; padding: 0 !important;
  }
  .hp-wrap { max-width: none; }
  .hp-cols { display: block; }
  .hp-main { max-width: none; }
  .hp-item { box-shadow: none; break-inside: avoid; page-break-inside: avoid; }
  .hp-sect { break-inside: auto; }
  .hp-h2 { break-after: avoid; }
}
