:root {
  /* 侧栏（深墨蓝） */
  --ink-1: #0F1B2D;
  --ink-2: #16263D;
  --ink-3: #1E3350;
  --ink-line: rgba(255, 255, 255, .08);
  /* 品牌蓝：全站唯一强调色（与小程序 --brand 一致） */
  --brand: #1F6FEB;
  --brand-700: #1857C4;
  --brand-50: #EAF1FE;
  /* 语义色（非紫非靛，合规） */
  --green: #119B5B;
  --green-bg: #E7F6EE;
  --orange: #B54708;
  --orange-bg: #FBEFE3;
  --red: #D92D20;
  --red-bg: #FDECEA;
  /* 文字 / 线 / 底 */
  --text: #1A2433;
  --muted: #5A6B82;
  --muted-2: #8A99AD;
  --line: #E6EAF1;
  --line-2: #EEF2F7;
  --bg: #F4F6FA;
  --card: #FFFFFF;
  --radius: 12px;
  --radius-sm: 9px;
  --shadow-sm: 0 1px 2px rgba(16, 27, 45, .06);
  --shadow: 0 1px 3px rgba(16, 27, 45, .08), 0 1px 2px rgba(16, 27, 45, .04);
  --shadow-md: 0 10px 30px rgba(16, 27, 45, .12);
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0; height: 100%;
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  font-size: 14px; color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}

button, input, select, textarea { font-family: inherit; font-size: 14px; color: inherit; }
a { color: var(--brand); text-decoration: none; }
.num, .money, .kpi .v, td.num, .bar-row .val { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }

/* ---------------- 登录 ---------------- */
.login-wrap {
  height: 100%; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #0F1B2D 0%, #16263D 58%, #1E3350 100%);
  position: relative; overflow: hidden;
}
.login-wrap::after {
  content: ''; position: absolute; width: 620px; height: 620px; right: -180px; top: -200px;
  background: radial-gradient(circle, rgba(31, 111, 235, .35), rgba(31, 111, 235, 0) 62%);
  pointer-events: none;
}
.login-box {
  position: relative; z-index: 1;
  width: 392px; background: #fff; border-radius: 16px; padding: 34px 34px 30px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .32);
}
.login-brand { display: flex; align-items: center; gap: 11px; margin-bottom: 18px; }
.login-brand .brand-mark { width: 40px; height: 40px; border-radius: 11px; }
.login-brand .lb-t { font-size: 17px; font-weight: 700; letter-spacing: .3px; }
.login-brand .lb-s { font-size: 12px; color: var(--muted); margin-top: 2px; }
.login-box h1 { margin: 0; font-size: 20px; font-weight: 700; }
.login-box .sub { color: var(--muted); margin-bottom: 22px; font-size: 13px; }
.login-tip { margin-top: 16px; font-size: 12px; color: var(--muted); background: var(--bg); padding: 11px 13px; border-radius: 9px; line-height: 1.7; border: 1px solid var(--line-2); }

/* ---------------- 布局 ---------------- */
.layout { display: flex; height: 100%; }

.sidebar {
  width: 224px; flex: 0 0 224px;
  background: linear-gradient(180deg, #16263D 0%, #0F1B2D 100%);
  color: #C3CEDD; display: flex; flex-direction: column; overflow-y: auto;
  box-shadow: 2px 0 14px rgba(16, 27, 45, .18);
}
.sidebar .brand {
  display: flex; align-items: center; gap: 11px;
  padding: 17px 18px; color: #fff; border-bottom: 1px solid var(--ink-line);
}
.sidebar .brand .brand-mark { width: 32px; height: 32px; border-radius: 9px; flex: 0 0 32px; }
.sidebar .brand .bt { font-size: 15px; font-weight: 700; letter-spacing: .4px; line-height: 1.15; }
.sidebar .brand small { display: block; font-size: 11px; font-weight: 400; color: #7C8BA1; margin-top: 3px; letter-spacing: 0; }
.menu-item {
  padding: 10px 18px 10px 20px; cursor: pointer; display: flex; align-items: center; gap: 11px;
  border-left: 3px solid transparent; transition: background .15s, color .15s; color: #B7C3D4;
}
.menu-item:hover { background: rgba(255, 255, 255, .05); color: #fff; }
.menu-item.active { background: rgba(31, 111, 235, .16); color: #fff; border-left-color: var(--brand); }
.menu-item .ico { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; flex: 0 0 20px; }
.menu-item .ico svg { width: 18px; height: 18px; }
/* ---------------- 侧栏手风琴 · 组行 ----------------
 * 12 个组名竖排全部可见、零横滑；点组名展开该组子项，其他组自动收起。
 * .on = 展开态（点击态）；.cur = 当前页所在组（路由推导）——用户点开别的组时，
 * 原组的淡竖条留在原地，不会「不知道自己页在哪组」。 */
.mg {
  padding: 10px 18px 10px 19px; cursor: pointer; display: flex; align-items: center; gap: 8px;
  color: #8FA0B8; font-size: 13px; font-weight: 600; border-left: 3px solid transparent;
  transition: background .15s, color .15s; user-select: none;
}
.mg:hover { background: rgba(255, 255, 255, .05); color: #fff; }
.mg:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.mg .mgn { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mg .mg-n { flex: 0 0 auto; font-size: 10.5px; font-weight: 500; color: #56698A; }
.mg .ar { flex: 0 0 auto; font-size: 13px; line-height: 1; color: #56698A; transition: transform .18s ease, color .15s; }
.mg.cur { color: #fff; border-left-color: rgba(31, 111, 235, .45); }
.mg.on { color: #fff; background: rgba(31, 111, 235, .12); border-left-color: var(--brand); }
.mg.on .mg-n { color: #8FB6F5; }
.mg.on .ar { transform: rotate(90deg); color: #8FB6F5; }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: 58px; flex: 0 0 58px; background: #fff; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; padding: 0 22px;
}
.topbar .title { font-size: 16.5px; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.topbar .title::before { content: ''; width: 4px; height: 17px; border-radius: 2px; background: var(--brand); }
.topbar .user { color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 16px; }
.topbar .user a { color: var(--muted); font-size: 13px; }
.topbar .user a:hover { color: var(--brand); }
.topbar .user #acct { display: none; } /* 桌面端用户名即可点；手机端用户名是隐藏的，才需要文字链 */
.content { flex: 1; overflow-y: auto; padding: 18px 22px 44px; }

/* ---------------- 通用组件 ---------------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; margin-bottom: 16px; }
.card > h3, .card > .hd {
  position: relative; margin: 0 0 14px; padding-left: 12px;
  font-size: 15px; font-weight: 600; color: var(--text);
  display: flex; align-items: center; gap: 8px;
}
.card > h3::before, .card > .hd::before {
  content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 4px; height: 15px; border-radius: 2px; background: var(--brand);
}
.card > .bd { }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.toolbar .grow { flex: 1; }

.btn {
  border: 1px solid var(--line); background: #fff; padding: 7px 15px; border-radius: 8px;
  cursor: pointer; transition: all .15s; white-space: nowrap; gap: 6px;
  display: inline-flex; align-items: center; justify-content: center;
  text-decoration: none; line-height: 1.45; color: var(--text);
}
.btn svg { width: 16px; height: 16px; }
.btn:hover { border-color: var(--brand); color: var(--brand); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn:active { transform: translateY(0); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-700); color: #fff; }
.btn.green { background: var(--green); border-color: var(--green); color: #fff; }
.btn.green:hover { filter: brightness(.95); color: #fff; }
.btn.danger { color: var(--red); border-color: #FBD0CB; }
.btn.danger:hover { background: var(--red-bg); color: var(--red); border-color: #F29BA0; }
.btn.sm { padding: 4px 11px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.input, .select {
  border: 1px solid var(--line); border-radius: 8px; padding: 7px 11px; background: #fff; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.input:focus, .select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-50); }
.input.w-sm { width: 110px; }
.input.w-md { width: 182px; }

table.tbl { width: 100%; border-collapse: collapse; }
table.tbl th {
  text-align: left; padding: 10px 12px; background: #F7F9FC; font-weight: 600;
  font-size: 12.5px; color: var(--muted); border-bottom: 1px solid var(--line); white-space: nowrap;
}
table.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; font-size: 13.5px; }
table.tbl tbody tr:hover td { background: #F8FAFE; }
table.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
table.tbl th.num { text-align: right; }
table.tbl tr.total { font-weight: 700; background: #F7F9FC; }
table.tbl tr.total td { border-top: 2px solid var(--line); }
/* 从提醒中枢跳进来时高亮目标行（配合 Pages.ar 的 ?no= 参数） */
table.tbl tbody tr.row-hl td { background: #FFF8E8; box-shadow: inset 0 0 0 9999px rgba(255, 214, 102, .12); }
table.tbl tbody tr.row-hl td:first-child { box-shadow: inset 3px 0 0 var(--orange); }

.tag { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 20px; font-size: 12px; line-height: 1.65; font-weight: 500; }
.tag.green { background: var(--green-bg); color: #0E7A47; }
.tag.orange { background: var(--orange-bg); color: var(--orange); }
.tag.blue { background: var(--brand-50); color: var(--brand-700); }
.tag.red { background: var(--red-bg); color: #B42318; }
.tag.gray { background: #EEF1F6; color: var(--muted); }
.tag.purple { background: #F0ECFE; color: #5925B8; }

.money { font-variant-numeric: tabular-nums; }
.pos { color: var(--green); }
.neg { color: var(--red); }
.muted { color: var(--muted); }
.empty { padding: 46px 16px; text-align: center; color: var(--muted-2); font-size: 13.5px; }
.empty svg { width: 34px; height: 34px; opacity: .5; margin-bottom: 8px; }

/* KPI */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 16px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 15px 17px; transition: transform .15s, box-shadow .15s; }
.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.kpi .k { font-size: 12px; color: var(--muted); margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.kpi .v { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.3px; }
.kpi.accent-green .v { color: var(--green); }
.kpi.accent-red .v { color: var(--red); }
.kpi.accent-blue .v { color: var(--brand); }
.kpi .k svg { color: var(--brand); opacity: .7; flex: 0 0 auto; }
/* 工作台可点击 KPI 卡片：跳转到对应明细页 */
.kpi-link { cursor: pointer; position: relative; }
.kpi-link:active { transform: scale(.98); }
@media (hover: hover){ .kpi-link:hover { border-color: var(--brand); box-shadow: 0 6px 18px rgba(31,111,235,.14); } }
.kpi-link::after { content: '›'; position: absolute; right: 12px; bottom: 10px; font-size: 18px; color: var(--brand); opacity: 0; transition: opacity .15s; }
@media (hover: hover){ .kpi-link:hover::after { opacity: .55; } }

/* ================= 🤖 智能提醒中枢（工作台首屏第一张卡） =================
   版式照小程序首页那张卡：卡头（锦鲤 + 标题 + 计数 + 记要货/刷新）→ 一排五类计数
        → 分组小节（同色族图标 + 「N 笔未收」+ 一句人话 + 「全部 ›」）→ 白色行卡竖排。
   锦鲤只是吉祥物，**不是 AI 助理**（别做成可点对话）。
   颜色只取既有的 --red / --orange / --brand / --green / --muted，五类各占一个，不引新色。 */
.hub-card {
  position: relative; overflow: hidden;
  padding: 0; margin-bottom: 16px; border-radius: 16px;
  border: 1px solid #E1E9F6;
  background: linear-gradient(180deg, #F6FAFF 0, #FFFFFF 150px);
  box-shadow: 0 8px 26px rgba(16, 42, 94, .08);
}
.hub-card::before { /* 顶部细条：全站只此一处，标志「首屏第一优先」 */
  content: ''; position: absolute; left: 0; right: 0; top: 0; height: 3px;
  background: linear-gradient(90deg, #1F6FEB, #4A94F8 52%, #F2A93B);
}
.hub-loading { color: var(--muted); font-size: 13px; padding: 18px; }
.hub-hd { display: flex; align-items: flex-start; gap: 12px; padding: 16px 18px 0; }
.hub-ava { flex: 0 0 auto; width: 46px; height: 46px; border-radius: 15px;
  box-shadow: 0 5px 14px rgba(31, 111, 235, .18); }
.hub-mascot { display: block; width: 100%; height: 100%; }
.hub-tt { flex: 1 1 auto; min-width: 0; }
.hub-t-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.hub-t { font-size: 17px; font-weight: 800; letter-spacing: -.2px; }
.hub-cnt { font-size: 11.5px; font-weight: 700; padding: 2px 9px; border-radius: 999px;
  background: var(--brand-50); color: var(--brand); white-space: nowrap; }
.hub-cnt.danger { background: var(--red-bg); color: var(--red); }
.hub-cnt.ok { background: var(--green-bg); color: var(--green); }
.hub-sub { font-size: 12px; color: var(--muted); margin-top: 4px; line-height: 1.5; }
.hub-acts { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; margin-left: auto; }

/* 五类计数：数字大、名字小，点一下滚到对应小节（桌面横排「图标 数字 名字」，手机竖排） */
.hub-chips { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin: 13px 18px 0; }
.hub-chip {
  display: flex; align-items: center; gap: 8px; min-width: 0;
  background: #fff; border: 1px solid var(--line); border-radius: 11px;
  padding: 9px 11px; cursor: pointer; text-align: left;
  transition: border-color .15s, box-shadow .15s, transform .12s;
}
.hub-chip-ic { font-size: 13px; line-height: 1; opacity: .9; flex: 0 0 auto; }
.hub-chip b { font-size: 19px; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.hub-chip-nm { font-size: 11.5px; color: var(--muted); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.hub-chip.red { border-color: #F7CEC9; background: #FFF6F5; }
.hub-chip.red b { color: var(--red); }
.hub-chip.yellow { border-color: #F3D9BE; background: #FFF9F3; }
.hub-chip.yellow b { color: var(--orange); }
.hub-chip.gray b { color: var(--muted-2); }
.hub-chip.zero { opacity: .58; }
@media (hover: hover){ .hub-chip:hover { border-color: var(--brand); box-shadow: 0 6px 16px rgba(31, 111, 235, .12); transform: translateY(-1px); } }

/* 分组小节：一类一张，标题 + 计数 + 一句人话 + 「全部 ›」 */
.hub-secs { padding: 0 18px 16px; margin-top: 13px; display: flex; flex-direction: column; gap: 11px; }
.hub-sec { border: 1px solid var(--line); border-radius: 13px; overflow: hidden; background: #fff; }
.hub-sec-hd { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--acc-soft, #F6F8FC); }
.hub-sec-ic { flex: 0 0 auto; width: 28px; height: 28px; border-radius: 9px; background: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 14px;
  box-shadow: 0 1px 3px rgba(16, 27, 45, .08); }
.hub-sec-tt { flex: 1 1 auto; min-width: 0; }
.hub-sec-tl { display: flex; align-items: center; gap: 7px; }
.hub-sec-nm { font-size: 13.5px; font-weight: 800; color: var(--text); white-space: nowrap; }
.hub-sec-n { font-size: 11px; font-weight: 700; color: var(--acc, var(--muted)); background: #fff;
  border-radius: 999px; padding: 1px 7px; white-space: nowrap; }
.hub-sec-sub { font-size: 11.5px; color: var(--muted); margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hub-sec-all { flex: 0 0 auto; font-size: 12px; font-weight: 700; color: var(--acc, var(--brand)); white-space: nowrap; }
.hub-sec-bd { padding: 7px 8px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
@media (min-width: 1080px) { /* 宽屏双列：一行两张行卡，别让金额孤零零飘到 900px 外 */
  .hub-sec-bd { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
}
.hub-sec-more { display: block; text-align: center; font-size: 12px; font-weight: 600;
  color: var(--acc, var(--brand)); padding: 7px 0 9px; background: #FCFDFF; border-top: 1px dashed var(--line); }

/* 行卡：四块拼图用 grid 摆（名称行/单号日期/金额/操作），手机与桌面各自对齐、不互相挤 */
.hub-row { display: grid; grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "top amt" "dim ops";
  column-gap: 10px; row-gap: 1px; align-items: center;
  padding: 9px 10px; background: #FCFDFF; border: 1px solid #EEF3FA; border-radius: 10px; cursor: pointer;
  transition: border-color .14s, background .14s, box-shadow .14s; }
@media (hover: hover){ .hub-row:hover { background: #fff; border-color: var(--acc, var(--brand));
  box-shadow: 0 6px 16px rgba(16, 42, 94, .08); } }
.hub-row.is-lead { background: var(--acc-soft, #FFF7F6); border-color: transparent; }
.hub-row-top { grid-area: top; display: flex; align-items: center; gap: 6px; min-width: 0; }
.hub-row-name { flex: 0 1 auto; min-width: 0; font-size: 13.5px; font-weight: 700; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hub-tag { flex: 0 0 auto; font-size: 10.5px; font-weight: 700; padding: 2px 6px;
  border-radius: 5px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.hub-tag.red { background: var(--red-bg); color: var(--red); }
.hub-tag.yellow { background: var(--orange-bg); color: var(--orange); }
.hub-tag.gray { background: var(--line-2); color: var(--muted); }
.hub-lead { flex: 0 0 auto; font-size: 10.5px; font-weight: 800; color: var(--red);
  background: #fff; border: 1px solid #F6C9C4; border-radius: 5px; padding: 1px 5px; }
.hub-row-dim { grid-area: dim; font-size: 11.5px; color: var(--muted); align-self: start;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.hub-row-amt { grid-area: amt; justify-self: end; font-size: 14.5px; font-weight: 800; color: var(--red);
  letter-spacing: -.2px; font-variant-numeric: tabular-nums; }
.hub-row-amt:empty { display: none; }
.hub-row-ops { grid-area: ops; justify-self: end; display: flex; align-items: center; gap: 6px; }
.hub-row-ops .btn { white-space: nowrap; }
.hub-dim { font-size: 12px; color: var(--muted-2); font-weight: 400; }

/* 空态：锦鲤没捞到事 */
.hub-empty { display: flex; align-items: flex-start; gap: 8px; font-size: 12.5px; line-height: 1.6;
  color: var(--muted); background: #F7FAFF; border: 1px dashed #D9E5F7; border-radius: 12px; padding: 13px 14px; }
.hub-empty svg { flex: 0 0 auto; color: var(--green); margin-top: 1px; }

@media (max-width: 900px) {
  .hub-hd { padding: 14px 15px 0; }
  .hub-chips { margin: 12px 15px 0; }
  .hub-secs { padding: 0 15px 14px; }
}
@media (max-width: 640px) {
  .hub-ava { width: 42px; height: 42px; border-radius: 13px; }
  .hub-t { font-size: 16px; }
  /* 手机不放那句旁白：标题 + 计数已经说清了，多两行反而挤掉首屏 */
  .hub-sub { display: none; }
  .hub-acts .btn { padding: 4px 9px; font-size: 12px; }
  /* 计数：五格都露出来（只缩小字号内边距，2 字标签 10px 在 320px 屏也放得下） */
  .hub-chips { gap: 6px; }
  .hub-chip { flex-direction: column; align-items: center; padding: 7px 3px 8px; border-radius: 10px; gap: 0; }
  .hub-chip b { font-size: 17px; }
  .hub-chip-nm { font-size: 10px; color: var(--muted); }
  .hub-sec-hd { padding: 9px 10px; gap: 9px; }
  .hub-sec-sub { font-size: 11px; }
  .hub-sec-bd { padding: 6px; gap: 6px; }
  /* 🚨 手机行卡铁律：**每一行都给足整行宽度**，别让标签/金额跟客户名抢横向空间。
     390px 实测：第一行若同时塞「🔥最急 + 逾期16天 + 客户名 + ¥金额」，
     客户名只剩 114px，「河南省山果建材有限公司」被压成一列竖字（2026-11-10 踩到）。
     所以三行摆：
       ① 标签 + 客户名（跨两列，名字至少 290px）
       ② 单号 · 到期日（跨两列，单号和日期都不截断）
       ③ 金额（左） ……… 催 / 去处理（右）
     整卡 ~81px，比原来四行 100px 还矮，而信息一个不少。
     🚨 别写 grid-column 调位置：会把 `grid-area: amt` 覆盖成 auto，金额被自动放进第一列。 */
  .hub-row { grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "top top" "dim dim" "amt ops";
    column-gap: 8px; row-gap: 3px; padding: 7px 9px; }
  .hub-row-top { flex-wrap: wrap; gap: 5px; }
  .hub-lead { order: -2; }
  .hub-tag { order: -1; }
  .hub-row-name { order: 0; flex: 1 1 auto; font-size: 12.5px; line-height: 1.35; white-space: normal;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .hub-row-dim { font-size: 11px; }
  .hub-row-amt { grid-area: amt; justify-self: start; font-size: 15px; line-height: 1.25; }
  .hub-row-ops { grid-area: ops; gap: 6px; }
  /* 🚨 必须写到 .btn.sm 这一级：.btn.sm 在文件后段重新定义了 padding，
     同特异性下后定义者胜，光写 .hub-row-ops .btn 会被它盖掉（按钮比设计大一圈、行卡被撑高）。
     高度写死 28px，别靠 padding 累加 —— 否则字号/行高一改，行卡高度就跟着飘。 */
  .hub-row-ops .btn.sm { height: 28px; padding: 0 10px; font-size: 12px; border-radius: 8px; }
}

/* ---------------- 工作台 · 常用操作（图标网格） ----------------
   🚨 手机端铁律：入口不做「整行全宽按钮」。
   24 个全宽按钮在 390px 上要滚 1100px，一屏只露 6 个，看着空、找东西慢。
   改成分组图标格：手机 3 列 / 平板 4 列 / 桌面 6 列，一屏看全一组。 */
.wbq-tip { font-size: 12px; font-weight: 400; color: var(--muted-2); }
.wbq-grp { margin-top: 13px; }
.wbq-grp:first-of-type { margin-top: 2px; }
.wbq-gt { font-size: 11.5px; font-weight: 700; color: var(--muted-2);
  letter-spacing: .5px; margin: 0 0 8px 2px; }
/* 8 列是为了「一组一行」：四组分别 8 / 5 / 5 / 6 个入口，6 列会把第一组拆成 6+2 孤零零两个 */
.wbq-grid { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 9px; }
.wbq { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px;
  padding: 13px 4px 11px; border-radius: 12px; background: var(--bg-soft, #F7F9FC);
  border: 1px solid transparent; color: var(--text); text-decoration: none; min-width: 0;
  transition: background .14s, border-color .14s, transform .12s, box-shadow .14s; }
.wbq-ic { display: flex; color: var(--brand); }
.wbq-tx { font-size: 12.5px; font-weight: 600; white-space: nowrap; }
@media (hover: hover) {
  .wbq:hover { background: #fff; border-color: var(--brand); color: var(--brand);
    box-shadow: 0 8px 18px rgba(31, 111, 235, .12); transform: translateY(-1px); }
}
.wbq:active { transform: scale(.97); background: #EEF4FF; border-color: var(--brand); }
@media (max-width: 1024px) { .wbq-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 640px) {
  .wbq-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .wbq { padding: 10px 3px 9px; gap: 5px; border-radius: 11px; }
  .wbq-ic svg { width: 19px; height: 19px; }
  .wbq-tx { font-size: 11.5px; }
  .wbq-tip { display: none; }
  .wbq-gt { margin-bottom: 7px; }
}

/* ---------------- 工作台 · 经营速览（数字卡，不是假表单） ---------------- */
.wbk-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.wbk { min-width: 0; padding: 11px 13px; border-radius: 11px;
  background: var(--bg-soft, #F7F9FC); border: 1px solid var(--line-2, #EEF3FA); }
.wbk-l { display: block; font-size: 11.5px; color: var(--muted); margin-bottom: 5px; }
.wbk-v { display: block; font-size: 16px; font-weight: 800; letter-spacing: -.2px;
  font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 1024px) { .wbk-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 640px) {
  .wbk-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .wbk { padding: 10px 11px; }
  .wbk-l { font-size: 11px; margin-bottom: 4px; }
  .wbk-v { font-size: 15px; }
}

/* 经营概览「快捷操作」：8 个入口走 4 列图标格（原来是一串 .btn 流式换行，
   手机上排成 3+3+2 参差不齐，按钮宽度还各不相同）。
   🚨 放在上面 .wbq-grid 的各断点之后 —— 同特异性后定义者胜，这里钉死 4 列，
      手机不再退回 3 列，8 个入口正好两行对齐。 */
.qk-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 640px) { .qk-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; } }

/* 卡片标题里的长提示：允许截断，绝不把标题本身挤成竖排（矿业新闻就是被它挤歪的） */
.card > h3 > .h3-t { flex: 0 0 auto; white-space: nowrap; }
.news-hint { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------------- 经营概览 · 品牌横幅（深蓝渐变 hero） ---------------- */
.dash-hero {
  position: relative; overflow: hidden;
  background: linear-gradient(120deg, #0B1F4B 0%, #14357E 46%, #1F6FEB 100%);
  border-radius: var(--radius); color: #fff; padding: 24px 26px 20px; margin-bottom: 16px;
  box-shadow: 0 12px 28px rgba(16, 42, 94, .22);
}
.dash-hero::after { /* 右上淡光斑：让纯渐变有层次，不抢内容 */
  content: ''; position: absolute; right: -40px; top: -64px; width: 240px; height: 240px;
  border-radius: 50%; background: radial-gradient(circle, rgba(255, 255, 255, .15), rgba(255, 255, 255, 0) 70%);
  pointer-events: none;
}
.dash-hero .dh-t { font-size: 24px; font-weight: 800; letter-spacing: .5px; }
.dash-hero .dh-s { margin-top: 6px; font-size: 13px; color: rgba(255, 255, 255, .84); }
.dash-hero .dh-meta { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 8px; }
.dash-hero .dh-chip {
  display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600;
  background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .22);
  padding: 4px 11px; border-radius: 999px; color: #fff;
}
.dash-hero .dh-chip svg { opacity: .85; }
@media (max-width: 640px) {
  .dash-hero { padding: 18px 18px 16px; }
  .dash-hero .dh-t { font-size: 20px; }
}

/* ---------------- 财务看板·月度趋势组合图 ----------------
   🚨 2026-09-19：Y 轴刻度曾渲染成「474323720」。
      除了 SVG 里 text-anchor 的坐标修正（见 pages.js drawTrend），
      这里必须给 <svg> 一个**明确高度**：只写 width:100% 时 svg 会被
      按 viewBox 宽高比撑开，在窄卡片里高度塌到 150px 以下，
      刻度文字被压扁粘连。高度用 min() 兼容小屏。 */
.chart-legend { margin-left: auto; display: flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 400; color: var(--muted); flex-wrap: wrap; }
.chart-legend .cl { width: 14px; height: 3px; border-radius: 2px; display: inline-block; margin-left: 10px; }
.chart-legend .cl:first-child { margin-left: 0; }
.cl-bar-blue { background: #1F6FEB; height: 9px !important; width: 9px !important; border-radius: 2px; }
.cl-bar-amber { background: #D97706; height: 9px !important; width: 9px !important; border-radius: 2px; }
.cl-line-green { background: #059669; }
.cl-line-red { background: #DC2626; }
.fin-chart-wrap { width: 100%; }
.fin-chart-wrap > svg { display: block; width: 100%; height: min(300px, 62vw); min-height: 210px; overflow: visible; }

/* ---------------- 财务看板 · 月度明细可折叠 ----------------
   手机上 12 个月 + 合计折成 13 张卡，拉到尾部太长。
   收起态只留「合计」卡；🚨 必须用 #mtab（ID）压过手机端
   `table.tbl:not(.items-tbl) tr { display:block }`(0,2,2) 的卡片化规则，
   否则 display:none 被盖掉、收起无效。 */
.mtab-hd { cursor: pointer; user-select: none; -webkit-user-select: none; }
.mtab-hd .mtab-toggle { margin-left: auto; font-size: 12px; font-weight: 600; color: var(--brand); white-space: nowrap; }
@media (hover: hover) { .mtab-hd:hover .mtab-toggle { text-decoration: underline; } }
#mtab.mtab-collapsed tr.mrow { display: none; }

/* 弹窗 */
.mask {
  position: fixed; inset: 0; background: rgba(16, 27, 45, .5); z-index: 50;
  display: flex; align-items: flex-start; justify-content: center; padding: 46px 16px; overflow-y: auto;
}
.dialog { background: #fff; border-radius: 14px; width: 640px; max-width: 100%; box-shadow: 0 24px 60px rgba(0, 0, 0, .3); display: flex; flex-direction: column; max-height: 90vh; }
.dialog.wide { width: 880px; }
.dialog .hd { padding: 16px 20px; border-bottom: 1px solid var(--line); font-weight: 600; display: flex; justify-content: space-between; align-items: center; font-size: 15px; }
.dialog .bd { padding: 18px 20px; overflow-y: auto; flex: 1 1 auto; }
.dialog .ft { padding: 13px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; }
.dialog .x { cursor: pointer; color: var(--muted-2); font-size: 22px; line-height: 1; display: inline-flex; }
.dialog .x:hover { color: var(--text); }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px 16px; }
.fld { display: flex; flex-direction: column; gap: 5px; }
.fld.full { grid-column: 1 / -1; }
.fld label { font-size: 12.5px; color: var(--muted); }
.fld label .req { color: var(--red); }
/* ★ 只读展示字段（弹窗内预览，如实时金额） */
.fld-disp { display: block; padding: 7px 10px; background: var(--bg-soft); border: 1px dashed var(--border); border-radius: 6px; font-size: 14px; font-weight: 600; color: var(--text); min-height: 18px; }

/* ---------------- 规格内联编辑器（商品表单内，对齐小程序端） ---------------- */
.spec-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.spec-count { margin-left: auto; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.spec-rows { display: flex; flex-direction: column; gap: 8px; }
.spec-row { display: grid; grid-template-columns: 1fr 76px 100px 100px 30px; gap: 8px; align-items: center; }
.spec-row .input { padding: 7px 10px; font-size: 13px; }
.spec-row .sp-name { font-weight: 600; }
.spec-x {
  border: none; background: #fdecea; color: #d92d20; border-radius: 8px;
  width: 28px; height: 28px; cursor: pointer; font-size: 15px; line-height: 1; flex: 0 0 auto;
}
.spec-x:hover { background: #fbd5d2; }
.spec-empty {
  font-size: 12px; color: var(--muted); background: #f8fafc; border: 1px dashed var(--line);
  border-radius: 10px; padding: 12px 14px; line-height: 1.7;
}
/* 规格库选择弹层 */
.spec-lib-tools { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.spec-lib-tools #spLibClear { font-size: 12px; color: var(--brand); }
.spec-lib-list { max-height: 44vh; overflow: auto; border: 1px solid var(--line); border-radius: 10px; }
.spec-lib-row { display: flex; gap: 10px; align-items: center; padding: 9px 12px; cursor: pointer; border-bottom: 1px solid var(--line); }
.spec-lib-row:last-child { border-bottom: none; }
.spec-lib-row:hover { background: #f8fafc; }
.spec-lib-row.on { background: #eaf2ff; }
.sl-name { font-size: 13px; font-weight: 600; }
.sl-sub { font-size: 11.5px; color: var(--muted); margin-left: auto; text-align: right; }
@media (max-width: 640px) {
  .spec-row { grid-template-columns: 1fr 1fr; }
  .spec-row .sp-name { grid-column: 1 / -1; }
  .spec-row .spec-x { grid-column: 1 / -1; justify-self: end; width: auto; padding: 4px 16px; }
}

/* ==========================================================================
 * 单据录入页（billPage 单源：销售/报价/采购/工单/退货 全部生效）
 * 表头字段网格：标签与输入框成对，永不折行拆散；客户独占双列给最大位置。
 * ========================================================================== */
.bf-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px 16px; align-items: end; margin-bottom: 4px; }
.bf-field { display: flex; align-items: center; gap: 7px; min-width: 0; }
.bf-field > label { flex: 0 0 auto; font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.bf-field .input { flex: 1 1 auto; width: auto; min-width: 0; }
.bf-field .bf-ctl { display: flex; align-items: center; gap: 8px; flex: 1 1 auto; min-width: 0; flex-wrap: wrap; }
.bf-pname { flex: 1 1 auto; min-width: 0; font-weight: 700; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bf-pname:empty { display: none; }
.bf-partner { grid-column: span 2; }
.bf-span { grid-column: 1 / -1; }

/* 合计卡三区：汇总大数字 → 调整输入 → 动作按钮 */
.bf-sums { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 26px; padding: 2px 0 12px; border-bottom: 1px dashed var(--line); }
.bf-sum { display: flex; align-items: baseline; gap: 7px; min-width: 0; }
.bf-sum label { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.bf-sum b { font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.3px; }
.bf-sum.hl b { font-size: 21px; color: var(--brand); }
.bf-adj { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; margin-top: 12px; }
.bf-adj .bf-field { flex: 0 0 auto; }
.bf-adj .bf-field .input { width: 110px; flex: 0 0 auto; }
.bf-acts { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line); }
.bf-acts .grow { flex: 1; }

/* 📱 手机底部固定操作栏：桌面隐藏；手机上保存/存草稿恒在拇指可及处 */
.bill-fab { display: none; }
.bill-fab-spacer { display: none; }
@media (max-width: 768px) {
  /* 表头：两列，标签在上一目了然；客户/摘要/口径独占整行 */
  .bf-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 10px; }
  .bf-field { flex-direction: column; align-items: stretch; gap: 4px; }
  .bf-field > label { font-size: 11.5px; }
  .bf-field .input { width: 100%; flex: 0 0 auto; }
  .bf-partner { grid-column: 1 / -1; }
  .bf-partner .bf-ctl { flex-wrap: nowrap; }
  .bf-partner .bf-ctl .btn { flex: 0 0 auto; min-height: 40px; }

  /* 汇总：2×2 数字卡，应收（应付）高亮卡 */
  .bf-sums { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 0; border-bottom: none; }
  .bf-sum { flex-direction: column; align-items: flex-start; gap: 2px;
    background: #F8FAFC; border: 1px solid var(--line); border-radius: 10px; padding: 8px 11px; }
  .bf-sum label { font-size: 11px; }
  .bf-sum b { font-size: 17px; }
  .bf-sum.hl { background: var(--brand-50, #EFF5FF); border-color: #C9DCFA; }
  .bf-sum.hl b { font-size: 19px; }
  .bf-sums #taxSub { grid-column: 1 / -1; }

  /* 调整：折扣/运费两列 + 估算按钮整行 */
  .bf-adj { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
  .bf-adj .bf-field .input { width: 100%; }
  .bf-adj #estFreight { grid-column: 1 / -1; min-height: 40px; }

  /* 动作区：与底部固定栏重复无害（同函数），保留卡内入口防固定栏被弹层遮挡 */
  .bf-acts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
  .bf-acts .grow { display: none; }
  .bf-acts .btn { min-height: 42px; }

  .bill-fab {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    align-items: center; gap: 8px;
    padding: 9px 12px calc(9px + env(safe-area-inset-bottom));
    background: #fff; border-top: 1px solid var(--line);
    box-shadow: 0 -6px 18px rgba(16, 27, 45, .10);
  }
  .bill-fab .btn { flex: 1 1 0; min-height: 42px; }
  .bf-fab-amt { flex: 0 0 auto; display: flex; flex-direction: column; line-height: 1.15; min-width: 0; max-width: 40%; }
  .bf-fab-amt i { font-style: normal; font-size: 10.5px; color: var(--muted); white-space: nowrap; }
  .bf-fab-amt b { font-size: 17px; font-weight: 800; color: var(--brand);
    font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .bill-fab-spacer { display: block; height: 64px; }
}

/* 开单明细表 */
.items-tbl input, .items-tbl select { width: 100%; border: 1px solid var(--line); border-radius: 6px; padding: 5px 7px; outline: none; }
.items-tbl input:focus, .items-tbl select:focus { border-color: var(--brand); }
/* ★ 2026-10-23：列宽固定（table-layout:fixed），商品/规格不让内容撑宽表格去挤压「长×宽」。
   商品名允许折两行显示完整（不再单行截断）；规格超长仍省略，全文走 title 悬浮。 */
/* ★ 2026-10-26：明细表新增「备注」列（120px）→ 各列宽度合计 1260，min-width 同步抬到 1246，
   否则窄屏下 table-layout:fixed 会把品名/规格再压一轮，输入框挤到写不下字。 */
.items-tbl { table-layout: fixed; width: 100%; min-width: 1246px; }
.items-tbl th.cell-name, .items-tbl th.cell-spec, .items-tbl th.cell-dim { white-space: nowrap; }
/* 商品名：折两行（最多 2 行，超出才省略），信息完整不截断 */
.items-tbl .cell-name { vertical-align: top; }
.items-tbl .cell-name .name-clamp {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; line-height: 1.35; word-break: break-word; font-size: 13px; font-weight: 600;
}
/* ★ 商品名第二排：材质/钢种（如「安钢65锰」），小灰字，与商品名同格 */
.items-tbl .cell-name .name-sub { display: block; font-size: 11px; font-weight: 400; color: #667085; line-height: 1.3; margin-top: 2px; }
/* ★ 2026-10-23：明细表「重量」列——单件重(市斤) 可编辑 + 单位提示，对齐小程序 */
.items-tbl th .th-sub { display: block; font-size: 10px; font-weight: 400; color: #98A2B3; line-height: 1.2; }
.items-tbl .cell-weight { white-space: nowrap; }
.items-tbl .cell-weight input { width: 54px; }
.items-tbl .cell-weight .w-unit { font-size: 10px; color: #98A2B3; }
/* ★ 2026-10-23：缺货自动生成采购工单的「提醒 + 跳转」弹层 */
.po-gen-list { margin: 0 0 6px; }
.po-gen-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 10px; background: #f8fafc; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 6px; font-size: 13px; }
.po-jump { color: var(--brand); font-weight: 600; white-space: nowrap; cursor: pointer; }
.po-jump:hover { text-decoration: underline; }
/* 规格：超长省略，hover 看全文（材质长串不撑表） */
.items-tbl .cell-spec { overflow: hidden; }
.items-tbl .cell-spec a { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* 开单明细「长×宽」单元格：竖排分层（尺寸 / 张数+可用库存），不再挤一行导致换行错乱 */
.items-tbl .cell-dim { display: flex; flex-direction: column; gap: 6px; padding: 7px 4px; }
.items-tbl .cell-dim .dim-1 { display: flex; align-items: center; gap: 4px; flex-wrap: nowrap; }
.items-tbl .cell-dim .dim-x { color: #98A2B3; }
.items-tbl .cell-dim .dim-gou { font-size: 11px; color: #667085; display: inline-flex; align-items: center; gap: 2px; white-space: nowrap; }
.items-tbl .cell-dim .dim-2 { display: flex; align-items: center; gap: 6px; min-height: 20px; }
.items-tbl .cell-dim .dim-lbl { font-size: 11px; color: #667085; white-space: nowrap; }
.items-tbl .cell-dim .dim-area { font-size: 11px; color: #667085; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* ★ 库存前置校验：超出本仓可用库存的明细行整行标红预警（不拦草稿，仅审核前硬拦） */
.items-tbl tr.row-short { background: #fff5f5; }
.items-tbl tr.row-short .dim-area.red { color: #e23b3b; font-weight: 600; }
.spec-hint { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.pick-row { padding: 9px 11px; border-bottom: 1px solid var(--line-2); cursor: pointer; display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.pick-row:hover { background: var(--brand-50); }

/* Toast */
.toast {
  position: fixed; top: 22px; left: 50%; transform: translateX(-50%);
  background: rgba(16, 27, 45, .94); color: #fff; padding: 10px 20px; border-radius: 9px;
  z-index: 200; font-size: 14px; box-shadow: 0 8px 24px rgba(0, 0, 0, .25);
}
.toast.err { background: #B42318; }
.toast.ok { background: #0E7A47; }

/* 历史带入 */
.history-panel { background: #FBF7EC; border: 1px solid #F4E3B8; border-radius: 10px; padding: 12px 14px; margin-bottom: 14px; }
.history-panel .t { font-size: 13px; font-weight: 600; margin-bottom: 9px; color: #92590A; display: flex; align-items: center; gap: 6px; }
.history-panel .t svg { width: 16px; height: 16px; }
.history-panel .h { display: flex; flex-wrap: wrap; gap: 8px; }
.history-panel .chip {
  background: #fff; border: 1px solid #EAD7A6; border-radius: 7px; padding: 6px 11px;
  font-size: 12.5px; cursor: pointer; max-width: 360px;
}
.history-panel .chip:hover { background: #FCF3DC; }
.history-panel .h-acts { margin-top: 10px; }

/* 运费参考三档（对齐小程序 saleEdit 运费建议） */
.fsg-panel { background: #EFF6FF; border: 1px solid #BFD8FB; border-radius: 10px; padding: 12px 14px; margin-top: 12px; }
.fsg-need { font-size: 12.5px; color: #667085; }
.fsg-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 9px; }
.fsg-title { font-size: 13px; font-weight: 600; color: #0A3A70; }
.fsg-ratio { font-size: 12px; color: #175CD3; background: #DBEAFE; border-radius: 6px; padding: 2px 8px; }
.fsg-ratio.warn { color: #B42318; background: #FEE4E2; }
.fsg-self { margin-left: auto; font-size: 12px; color: #475467; text-decoration: none; }
.fsg-self:hover { text-decoration: underline; }
.fsg-tiers { display: flex; gap: 10px; flex-wrap: wrap; }
.fsg-tier {
  flex: 1; min-width: 120px; text-align: left; cursor: pointer;
  background: #fff; border: 1px solid #BFD8FB; border-radius: 9px; padding: 9px 11px;
  transition: transform .08s ease, box-shadow .08s ease;
}
.fsg-tier:hover { box-shadow: 0 2px 8px rgba(31,111,235,.18); transform: translateY(-1px); }
.fsg-tier-name { font-size: 12px; color: #475467; font-weight: 600; }
.fsg-tier-amt { font-size: 17px; font-weight: 700; color: #1F6FEB; margin: 2px 0; }
.fsg-tier-sub { font-size: 11px; color: #667085; }
.fsg-tier-tip { font-size: 11px; color: #98A2B3; margin-top: 2px; }
.fsg-note { font-size: 11.5px; color: #667085; margin-top: 9px; line-height: 1.5; }

/* 柱状（毛利分布） */
.bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 9px; }
.bar-row .nm { width: 150px; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-row .track { flex: 1; height: 18px; background: var(--line-2); border-radius: 5px; overflow: hidden; }
.bar-row .fill { height: 100%; border-radius: 5px; background: var(--brand); }
.bar-row .val { width: 120px; text-align: right; font-variant-numeric: tabular-nums; font-size: 13px; }

/* 公众号页用到的辅助类 */
.link-btn { color: var(--brand); cursor: pointer; font-size: 13px; }
.link-btn.primary { font-weight: 600; }
.link-btn:hover { text-decoration: underline; }
.mt16 { margin-top: 16px; }
.mt8 { margin-top: 8px; }
.small { font-size: 12px; }

/* 表格内操作链接 */
.op { color: var(--brand); cursor: pointer; text-decoration: none; }
.op:hover { text-decoration: underline; }
.op-unbind { color: var(--red); cursor: pointer; }
.op-unbind:hover { text-decoration: underline; }

/* 品牌标记（登录/侧栏） */
.brand-mark {
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #1F6FEB, #1857C4); color: #fff;
  box-shadow: 0 4px 12px rgba(31, 111, 235, .35);
}
.brand-mark svg { width: 60%; height: 60%; }
/* 品牌 logo 资源位：--badge 白底承载彩色徽章；--flat 透明承载简化图标 */
.brand-mark img { width: 100%; height: 100%; object-fit: contain; display: block; border-radius: inherit; }
.brand-mark--badge { background: #fff; box-shadow: 0 4px 12px rgba(31, 111, 235, .18); overflow: hidden; }
.brand-mark--flat { background: transparent; box-shadow: none; }

/* 列表空态小图标（页面级） */
.empty-ico { display: flex; flex-direction: column; align-items: center; gap: 8px; }

/* ==========================================================================
 * 响应式：桌面 / 平板 / 手机
 * 两条硬约定（改动前必读，见 api.js 里 tableHtml 的注释）：
 *   1. 列表表格必须 .tbl-wrap 包裹 + 每个 td 带 data-l="列标题"
 *   2. .items-tbl 是开单明细那种「可编辑表格」，永不卡片化
 * ========================================================================== */
.tbl-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* 列表导出条：紧贴表格上方一行，不占位、不挤压工具栏 */
.exp-bar { display: flex; align-items: center; gap: 10px; font-size: 12px; margin: 2px 0 6px; }
.exp-bar .exp-do { color: var(--brand); text-decoration: none; cursor: pointer; }
.exp-bar .exp-do:hover { text-decoration: underline; }

.hamburger { display: none; }
.drawer-mask { position: fixed; inset: 0; background: rgba(16, 27, 45, .45); z-index: 65; }
.sb-user { display: none; }

/* ---------------- 平板 / 小笔记本 ---------------- */
@media (max-width: 1100px) {
  .sidebar { width: 200px; flex-basis: 200px; }
  .content { padding: 16px 16px 36px; }
}

/* ---------------- 手机 ---------------- */
@media (max-width: 768px) {
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; z-index: 70;
    width: 268px; flex-basis: 268px;
    transform: translateX(-100%); transition: transform .22s ease;
    box-shadow: 4px 0 18px rgba(16, 27, 45, .22);
  }
  .sidebar.open { transform: translateX(0); }
  .sb-user {
    display: block; padding: 11px 20px; color: #9FB0C6; font-size: 12.5px;
    border-bottom: 1px solid var(--ink-line);
  }

  .topbar { height: 54px; flex-basis: 54px; padding: 0 12px; gap: 8px; }
  .topbar .title { font-size: 15px; flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topbar .user { gap: 14px; font-size: 13px; flex: 0 0 auto; }
  .topbar .user #un { display: none; }
  .topbar .user #acct { display: inline; }
  .hamburger {
    display: inline-flex; align-items: center; justify-content: center;
    width: 36px; height: 36px; flex: 0 0 36px; margin-right: 8px;
    border: 1px solid var(--line); border-radius: 9px; background: #fff;
    cursor: pointer; color: var(--muted);
  }
  .hamburger svg { width: 20px; height: 20px; }

  .content { padding: 12px 12px calc(28px + env(safe-area-inset-bottom)); }

  .card { padding: 13px 14px; margin-bottom: 12px; border-radius: 13px; }
  .card > h3, .card > .hd { font-size: 14.5px; margin-bottom: 11px; }
  /* 指标卡：手机一律双列紧凑卡。
     🚨 别再加「≤400px 转 1 列」——390px iPhone 会命中，9~11 个指标拉成一屏多长条，
        每张卡 85px 高只放一个数字，这是「经营概览 / 财务看板 / 老板大屏」共同的病根。 */
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin-bottom: 12px; }
  .kpi { padding: 10px 11px; border-radius: 11px; }
  .kpi .k { font-size: 11.5px; margin-bottom: 5px; gap: 4px; line-height: 1.3; }
  .kpi .k svg { width: 13px; height: 13px; }
  /* 数字不换行但允许省略：双列格约 156px 可用宽度，¥1,234,567.89 也放得下，省略号只是兜底 */
  .kpi .v { font-size: 17px; letter-spacing: -.4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

  .toolbar { gap: 8px; }
  .toolbar .input, .toolbar .select { width: 100%; flex: 1 1 100%; }
  .toolbar .input.w-sm, .toolbar .input.w-md { width: 100%; }
  .toolbar .grow { display: none; }

  .btn { min-height: 42px; padding: 9px 14px; }
  .btn.sm { min-height: 36px; padding: 6px 11px; }
  .input, .select, textarea { min-height: 42px; }

  /* 表格 → 卡片（.items-tbl 除外） */
  .tbl-wrap { overflow-x: visible; }
  table.tbl:not(.items-tbl),
  table.tbl:not(.items-tbl) tbody,
  table.tbl:not(.items-tbl) tr,
  table.tbl:not(.items-tbl) td { display: block; width: 100%; }
  table.tbl:not(.items-tbl) thead { display: none; }
  table.tbl:not(.items-tbl) tr {
    background: #fff; border: 1px solid var(--line); border-radius: 12px;
    margin-bottom: 10px; padding: 8px 12px;
    box-shadow: var(--shadow-sm);
  }
  table.tbl:not(.items-tbl) tr:hover td { background: transparent; }
  /* 🚨 卡片行的正确写法：块容器 + 悬挂标签（见铁律 #30/#111） */
  table.tbl:not(.items-tbl) td {
    position: relative; display: block; width: 100%;
    padding: 5px 0 5px 82px; border: none; min-height: 27px;
  }
  table.tbl:not(.items-tbl) td::before {
    position: absolute; left: 0; top: 5px; width: 76px;
    content: attr(data-l); color: var(--muted); font-size: 12.5px; line-height: 1.5;
  }
  table.tbl:not(.items-tbl) td.num { text-align: right; }
  table.tbl:not(.items-tbl) td:empty { display: none; }

  .mask { padding: 0; align-items: flex-end; }
  .dialog {
    width: 100%; max-width: 100%; border-radius: 16px 16px 0 0;
    max-height: 92vh; display: flex; flex-direction: column;
    animation: sheetUp .22s ease;
  }
  .dialog.wide { width: 100%; }
  .dialog .hd { padding: 14px 16px; }
  .dialog .bd { padding: 14px 16px; flex: 1 1 auto; overflow-y: auto; -webkit-overflow-scrolling: touch; }
  .dialog .ft { padding: 11px 16px calc(11px + env(safe-area-inset-bottom)); flex: 0 0 auto; }
  .dialog .ft .btn { flex: 1; min-height: 46px; }

  .form-grid { grid-template-columns: 1fr; gap: 12px; }

  .login-wrap { padding: 16px; }
  .login-box { width: 100%; max-width: 392px; padding: 26px 22px; }

  /* 明细表列宽固定（见 .items-tbl 基础规则），窄屏改为横向滚动，不压缩输入框 */
  .items-tbl { min-width: 1106px; }

  /* 工具页：规格网格在手机上单列堆叠，避免挤压溢出 */
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .wf-row-t { font-size: 13.5px; }
}

@keyframes sheetUp {
  from { transform: translateY(26px); opacity: .5; }
  to { transform: translateY(0); opacity: 1; }
}

/* ---------------- 小屏手机 ---------------- */
@media (max-width: 400px) {
  /* 🚨 原来这里是 `.kpis { grid-template-columns: 1fr }` —— 390px 的 iPhone 正好命中，
     把所有经营页的指标卡压成一列。已删除：双列在 320px 上仍放得下（每格 148px）。 */
  table.tbl:not(.items-tbl) td { padding-left: 74px; }
  table.tbl:not(.items-tbl) td::before { width: 68px; }
}

/* ==========================================================================
 * 手机 · 「经营」分组（经营概览 / 财务看板 / 老板大屏）专用适配
 * 三个页面结构不同但病根同一个：桌面按 800~1200px 画的图，直接缩到 366px 就糊。
 *   ① 指标卡：双列紧凑（见上面 .kpis）
 *   ② 图表：SVG 按 viewBox 等比缩放 → 10px 刻度字变 4px，等于不可读 → 改横向可滑
 *   ③ 工具栏长说明、卡片标题旁的提示：让它们换行或隐藏，别把标题挤成竖排
 * ========================================================================== */
@media (max-width: 768px) {
  /* 图表横向可滑：宽度钉在 660px，刻度 10px 仍是 10px，滑动比重画一套小图实在 */
  .fin-chart-wrap { overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; }
  .fin-chart-wrap > svg { width: 660px; max-width: none; height: 236px; min-height: 0; }
  .fin-chart-wrap::after {
    content: '← 左右滑动看全 12 个月'; display: block; margin-top: 4px;
    font-size: 11px; color: var(--muted-2); text-align: right;
  }

  /* 工具栏里的「数据来源」长说明：独占一行、降两级字号，别跟年份挤一行 */
  .tool-tip { flex: 1 1 100%; margin-left: 0 !important; font-size: 11.5px;
    line-height: 1.5; color: var(--muted-2); }

  /* 老板大屏：8 个指标也走双列，字号收到 18px，图表同样横向可滑 */
  .bigscreen .bs-top { margin-bottom: 12px; }
  .bigscreen .bs-top .co { font-size: 16px; letter-spacing: 0; }
  .bigscreen .bs-logo { height: 26px; }
  .bigscreen .bs-top .dt { font-size: 11.5px; }
  .bigscreen .bs-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin-bottom: 12px; }
  .bigscreen .bs-kpi { padding: 10px 11px; border-radius: 11px; }
  .bigscreen .bs-kpi .k { font-size: 11.5px; margin-bottom: 5px; line-height: 1.3; }
  .bigscreen .bs-kpi .v { font-size: 18px; letter-spacing: -.4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .bigscreen .bs-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .bigscreen .bs-strip .bs-kpi { padding: 10px 11px; }
  .bigscreen .bs-strip .bs-kpi .v { font-size: 17px; }
  .bigscreen .bs-chart { padding: 12px 12px; margin-bottom: 12px; }
  .bigscreen .bs-chart h3 { font-size: 14px; margin-bottom: 8px; }
  /* 大屏趋势图：和财务看板同一套「宽度钉 660px、横向可滑」策略，刻度字保持 10px 可读 */
  .bigscreen .bs-chart { overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; }
  .bigscreen .bs-chart svg { width: 660px; max-width: none; height: 236px; min-height: 0; }

  /* 卡片标题旁的提示（如「更新于 … · 共 128 条」）：窄屏隐藏，标题保持一行不竖排 */
  .news-hint { display: none; }

  /* 月度明细等表格卡：行高再收一点，13 个月少滚 200px */
  table.tbl:not(.items-tbl) td { padding-top: 4px; padding-bottom: 4px; }
}

/* ==========================================================================
 * 打印（对账单导出 PDF）：只导出对账单本身，隐藏后台外壳
 * —— 修复「Web 端导出 PDF 对账单却把整个后台界面一起打进去」的问题
 * ========================================================================== */
@media print {
  html, body { background: #fff !important; height: auto !important; }
  .layout { display: block !important; height: auto !important; }
  .sidebar, .topbar, .toolbar, .toast, .mask, .drawer-mask, .noprint { display: none !important; }
  .main { display: block !important; }
  .content { padding: 0 !important; overflow: visible !important; }
  .card { box-shadow: none !important; border: none !important; margin: 0 !important; padding: 0 !important; }
  .card > h3::before { display: none !important; }
  #stmt-print { display: block !important; }
  table.tbl th { background: #F0F2F5 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  table.tbl, table.tbl th, table.tbl td { color: #000 !important; }
}

/* 对账单打印头 */
.stmt-print .stmt-hd { display: flex; align-items: center; gap: 14px; line-height: 1.5; margin-bottom: 14px; }
.stmt-print .stmt-logo { height: 58px; width: auto; flex: 0 0 auto; }
.stmt-print .stmt-hdt { flex: 1 1 auto; }
.stmt-print .stmt-hd .co { font-size: 18px; font-weight: 700; color: var(--text); }
.stmt-print .stmt-hd .meta { font-size: 13px; color: var(--muted); }

/* 对账单页脚 · 展厅太阳码（固定槽位，屏幕与打印一致） */
.stmt-print .stmt-ft { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--line); }
.stmt-print .stmt-ft .note { font-size: 12px; color: var(--muted); line-height: 1.8; }
.stmt-print .stmt-ft .qr { text-align: center; flex: none; }
.stmt-print .stmt-ft .qr img { width: 72px; height: 72px; display: block; }
.stmt-print .stmt-ft .qr .t { font-size: 11px; color: var(--muted); line-height: 1.5; margin-top: 3px; }
@media print {
  .stmt-print .stmt-ft .qr img { width: 84px; height: 84px; -webkit-print-color-adjust: exact; print-color-adjust: exact; } /* 84px @96dpi ≈ 22.2mm，纸质差也能扫 */
}

/* ==========================================================================
 * 老板大屏看板
 * ========================================================================== */
.bigscreen .bs-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 16px; flex-wrap: wrap; gap: 8px; }
.bigscreen .bs-brand { display: flex; align-items: center; gap: 10px; }
.bigscreen .bs-logo { height: 34px; width: auto; flex: 0 0 auto; }
.bigscreen .bs-top .co { font-size: 22px; font-weight: 800; letter-spacing: .5px; }
.bigscreen .bs-top .dt { color: var(--muted); font-size: 14px; }
.bigscreen .bs-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-bottom: 18px; }
.bigscreen .bs-kpi { background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 20px 22px; }
.bigscreen .bs-kpi .k { font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.bigscreen .bs-kpi .v { font-size: 30px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.5px; }
.bigscreen .bs-kpi.accent-green .v { color: var(--green); }
.bigscreen .bs-kpi.accent-red .v { color: var(--red); }
.bigscreen .bs-kpi.accent-blue .v { color: var(--brand); }
.bigscreen .bs-chart { background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 16px 18px; margin-bottom: 18px; }
.bigscreen .bs-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.bigscreen .bs-strip .bs-kpi { padding: 16px 18px; }
.bigscreen .bs-strip .bs-kpi .v { font-size: 24px; }
/* 大屏趋势图：桌面按 viewBox 等比缩放；手机端交给下面的 经营 媒体查询做横向滑动（见 #786 区块） */
.bigscreen .bs-chart svg { display: block; width: 100%; height: 280px; min-height: 0; }

/* ==========================================================================
 * 轴感知规格矩阵弹层（与小程序规格矩阵同源）
 * ========================================================================== */
.spec-dialog { width: 760px; max-width: 94vw; }
.spec-dialog .bd { padding: 12px 14px; }
.mx-filter { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; flex-wrap: wrap; }
.mx-filter-label { color: var(--muted); font-size: 13px; }
.mx-seg { display: flex; gap: 6px; flex-wrap: wrap; }
.mx-seg-item { padding: 4px 13px; border: 1px solid var(--line); border-radius: 14px; font-size: 13px; cursor: pointer; color: var(--text); background: #fff; }
.mx-seg-item:hover { border-color: var(--brand); }
.mx-seg-item.on { background: var(--brand); color: #fff; border-color: var(--brand); }
.mx-row { display: flex; align-items: stretch; }
.mx-head { position: sticky; top: 0; z-index: 2; background: #fff; }
.mx-rhead { flex: 0 0 86px; display: flex; align-items: center; justify-content: center; font-size: 13px; color: var(--muted); font-weight: 600; border: 1px solid var(--line); background: #FAFBFC; }
.mx-hcell { flex: 1 1 0; min-width: 0; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; color: var(--text); border: 1px solid var(--line); border-left: none; background: #FAFBFC; padding: 7px 2px; }
.mx-cell { flex: 1 1 0; min-width: 0; border: 1px solid var(--line); border-left: none; border-top: none; min-height: 48px; display: flex; align-items: center; justify-content: center; gap: 4px; cursor: pointer; padding: 4px 2px; position: relative; color: var(--text); }
.mx-cell:hover { background: var(--brand-50); }
.mx-cell.on { background: var(--brand); color: #fff; border-color: var(--brand); }
.mx-cell.none { background: #F7F8FA; color: #B0B7C3; border-style: dashed; cursor: not-allowed; }
.mx-cell.none:hover { background: #F7F8FA; }
.mx-price { font-size: 13px; font-variant-numeric: tabular-nums; }
.mx-check { font-weight: 700; }
.mx-nonetext { font-size: 12px; color: #B0B7C3; }
.mx-count { color: var(--muted); font-size: 13px; margin-right: auto; }
.mx-count b { color: var(--brand); }
.spec-grid { display: flex; flex-wrap: wrap; gap: 10px; padding: 4px 0; }
.spec-chip { position: relative; min-width: 124px; border: 1px solid var(--line); border-radius: 10px; padding: 10px 13px; cursor: pointer; background: #fff; }
.spec-chip:hover { border-color: var(--brand); }
.spec-chip.on { border-color: var(--brand); background: var(--brand-50); }
.spec-chip-name { font-size: 14px; color: var(--text); }
.spec-chip-price { font-size: 13px; color: var(--muted); margin-top: 3px; }
.spec-chip-check { position: absolute; top: 7px; right: 10px; color: var(--brand); font-weight: 700; }

/* ==========================================================================
 * AI 助理 / OCR 识别
 * ========================================================================== */
.chat { display: flex; flex-direction: column; gap: 11px; max-height: 56vh; overflow-y: auto; padding: 6px 2px 8px; }
.chat .row { display: flex; gap: 10px; }
.chat .row.me { justify-content: flex-end; }
.chat .bubble { max-width: 80%; padding: 10px 13px; border-radius: 12px; font-size: 13.5px; line-height: 1.62; word-break: break-word; box-shadow: var(--shadow-sm); }
.chat .row.me .bubble { background: var(--brand); color: #fff; border-bottom-right-radius: 3px; }
.chat .row.ai .bubble { background: #F2F5FA; color: var(--text); border-bottom-left-radius: 3px; }
.chat .bubble p { margin: 0 0 6px; } .chat .bubble p:last-child { margin: 0; }
.chat .bubble .ai-card { background: #fff; }
.quick { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 10px; }
.quick .qc { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 5px 12px; font-size: 12.5px; cursor: pointer; color: var(--muted); }
.quick .qc:hover { border-color: var(--brand); color: var(--brand); }
.chat-in { display: flex; gap: 10px; margin-top: 12px; align-items: flex-end; }
.chat-in textarea { flex: 1; min-height: 46px; max-height: 140px; resize: vertical; }

.ai-card { background: #F7F9FC; border: 1px solid var(--line-2); border-radius: 10px; padding: 11px 13px; margin-top: 8px; }
.ai-card-h { font-weight: 600; font-size: 13.5px; margin-bottom: 7px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ai-card-h .tag { font-size: 11.5px; }
.ai-fields { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.ai-fields .f { font-size: 13px; } .ai-fields .f .k { color: var(--muted); margin-right: 5px; }
.ai-list-t { font-size: 12px; color: var(--muted); margin: 9px 0 4px; }
.ai-rows .r { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; border-top: 1px dashed var(--line-2); font-size: 13px; }
.ai-rows .r:first-child { border-top: none; }
.ai-rows .r .v { color: var(--text); text-align: right; }
.ai-blocks p { margin: 0 0 7px; font-size: 13.5px; line-height: 1.65; } .ai-blocks p:last-child { margin: 0; }
.ai-note { margin-top: 8px; font-size: 12.5px; color: var(--orange); background: var(--orange-bg); padding: 7px 10px; border-radius: 8px; line-height: 1.55; }
.ai-deg { margin-top: 8px; font-size: 12px; color: var(--orange); background: var(--orange-bg); padding: 6px 10px; border-radius: 8px; line-height: 1.5; }
.ai-write-ft { margin-top: 11px; display: flex; justify-content: flex-end; }
.ai-summary-link { display: inline-flex; align-items: center; gap: 6px; margin-top: 4px; font-size: 12.5px; }

/* OCR 页 */
.ocr-pick { display: flex; flex-wrap: wrap; gap: 8px; }
.ocr-pick .qc { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 5px 13px; font-size: 12.5px; cursor: pointer; color: var(--muted); }
.ocr-pick .qc:hover, .ocr-pick .qc.on { border-color: var(--brand); color: var(--brand); }
.ocr-result .ai-card { background: #fff; }
.ocr-flags { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
.ocr-flags .tag { font-size: 11.5px; }

/* 引擎自检总体结论横幅：把「可用/降级/不可用」放最前，避免老板被备用通道的限流红叉误导 */
.ai-verdict { display: flex; align-items: flex-start; gap: 8px; padding: 9px 12px; border-radius: 9px; font-size: 13px; line-height: 1.55; margin-bottom: 4px; }
.ai-verdict svg { flex: none; margin-top: 1px; }
.ai-verdict.ok { background: var(--green-bg); color: #0E7A47; }
.ai-verdict.warn { background: var(--orange-bg); color: #B54708; }
.ai-verdict.bad { background: #FEF3F2; color: #B42318; }

/* ==========================================================================
 * 工具页（运费估算 / 单据打印）—— pages-tools.js 专用类
 * 命名与全局组件区分：.inp / .form-row / .seg / .wf-* / .pb-*（全局只有 .input）
 * ========================================================================== */
.row { display: flex; align-items: center; flex-wrap: wrap; }
.card-hd { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.card-hd-t { font-size: 15px; font-weight: 600; color: var(--text); }
.card-bd { } /* 同 .card 内已有 padding，留作语义容器 */
.kv { display: flex; gap: 8px; padding: 4px 0; font-size: 13.5px; }
.kv span { color: var(--muted); min-width: 72px; flex: none; }
.kv b { font-weight: 500; }

.inp {
  border: 1px solid var(--line); border-radius: 8px; padding: 7px 11px; background: #fff; outline: none;
  width: 100%; transition: border-color .15s, box-shadow .15s; color: var(--text); font-size: 14px;
}
.inp:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-50); }
.inp[readonly] { background: #F7F9FC; color: var(--muted); }
.form-row { display: flex; flex-direction: column; gap: 5px; margin-bottom: 9px; }
.form-row .lb, .lb { font-size: 12.5px; color: var(--muted); }

/* 分段器（计价方式 / 单据类型切换） */
.seg { display: flex; gap: 8px; flex-wrap: wrap; }
.seg-i {
  padding: 8px 14px; border: 1px solid var(--line); border-radius: 9px; cursor: pointer;
  background: #fff; color: var(--text); font-size: 13.5px; line-height: 1.2;
  display: flex; flex-direction: column; gap: 2px; align-items: flex-start;
}
.seg-i .seg-sub { font-size: 11.5px; color: var(--muted); }
.seg-i:hover { border-color: var(--brand); }
.seg-i.on { background: var(--brand); color: #fff; border-color: var(--brand); }
.seg-i.on .seg-sub { color: rgba(255, 255, 255, .85); }

/* 小按钮 / 幽灵按钮 */
.btn.tiny { padding: 3px 10px; font-size: 12px; min-height: 28px; }
.btn.ghost { background: #fff; color: var(--muted); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--brand); color: var(--brand); }

/* 运费估算器 */
.wf-row { border: 1px solid var(--line); border-radius: 10px; padding: 13px 14px; margin-bottom: 12px; background: #fff; }
.wf-row-hd { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 9px; }
.wf-row-t { font-size: 14px; font-weight: 600; }
.wf-hint { font-size: 11.5px; color: var(--orange); background: var(--orange-bg); padding: 6px 9px; border-radius: 7px; margin: 2px 0 9px; line-height: 1.5; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 9px; }
.wf-sum-lines { margin-bottom: 10px; }
.wf-sum-line { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-top: 1px dashed var(--line-2); font-size: 13px; }
.wf-sum-line:first-child { border-top: none; }
.wf-sum-line b { font-variant-numeric: tabular-nums; }
.wf-total { background: var(--bg); border: 1px solid var(--line-2); border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.wf-total-i { display: flex; justify-content: space-between; gap: 12px; font-size: 13.5px; }
.wf-total-i .k { color: var(--muted); }
.wf-total-i.big { font-size: 17px; font-weight: 700; }
.wf-total-i.big .v { color: var(--brand); }
.wf-truck { margin-top: 8px; font-size: 12.5px; color: var(--muted); background: #fff; border: 1px dashed var(--line); border-radius: 8px; padding: 7px 10px; }

/* ★ 可复用「估算运费」弹窗（销售开单 / 销售工单详情 共用） */
.freight-modal { display: flex; flex-direction: column; gap: 12px; }
.fm-tools { display: flex; gap: 8px; flex-wrap: wrap; }
.fm-mode { display: flex; flex-direction: column; gap: 8px; }
#fmRows { max-height: 46vh; overflow-y: auto; padding-right: 4px; }
.fm-acts { display: flex; gap: 8px; justify-content: flex-end; margin-top: 2px; }

/* 单据打印列表 */
.pb-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line-2); }
.pb-item:last-child { border-bottom: none; }
.pb-item-main { flex: 1 1 auto; min-width: 0; }
.pb-item-t { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.pb-item-s { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.pb-item-r { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }

/* ============ 智能助理悬浮球（全局常驻，可拖动；点击展开右侧侧边栏） ============ */
/* z-index: 悬浮球 80 / 遮罩 85 / 侧栏 90 —— 高于抽屉(65)，低于 toast(200) */
.ai-fab {
  position: fixed; right: 22px; bottom: 84px; z-index: 80;
  display: flex; align-items: center; justify-content: center;
  width: 64px; height: 64px; border-radius: 50%; border: none; cursor: pointer;
  background: transparent; color: #fff; box-shadow: none;
  transition: transform .16s ease, opacity .16s ease;
  -webkit-tap-highlight-color: transparent;
  touch-action: none; /* 自主拖拽，禁掉浏览器手势接管 */
  user-select: none;
  overflow: visible;
}
/* 淡黄圣光：呼吸脉动（机甲小将的护体暖光） */
.ai-fab::before {
  content: ''; position: absolute; inset: -10px; border-radius: 50%;
  background: radial-gradient(circle at 50% 56%,
    rgba(255, 231, 163, .60) 0%,
    rgba(255, 208, 112, .32) 42%,
    rgba(255, 196, 86, 0) 72%);
  animation: aiFabGlow 3.2s ease-in-out infinite;
  pointer-events: none;
}
.ai-fab-img {
  position: relative; width: 100%; height: 100%; object-fit: contain;
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, .26));
  animation: aiFabFloat 3.4s ease-in-out infinite;
  pointer-events: none;
}
/* 锦鲤守护灵：静态，悬于小将军左后上方（不游动，仅作为守护灵装饰） */
.ai-fab-koi {
  position: absolute; left: 50%; top: 50%; width: 52px; height: 52px;
  transform: translate(-78%, -90%);
  pointer-events: none; z-index: 0;
  opacity: .95;
  filter: drop-shadow(0 0 8px rgba(255, 205, 105, .55));
}
.ai-fab-img { z-index: 1; }
@keyframes aiFabGlow {
  0%, 100% { transform: scale(.90); opacity: .50; }
  50%      { transform: scale(1.10); opacity: 1; }
}
@keyframes aiFabFloat {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50%      { transform: translateY(-3px) rotate(1.2deg); }
}
/* 锦鲤改为 canvas 程序化绘制（见 fish.js），不再使用 GIF / 轨道关键帧 */
.ai-fab:hover { transform: translateY(-2px); }
.ai-fab:active { transform: scale(.94); }
.ai-fab.hide { opacity: 0; pointer-events: none; transform: scale(.8); }
/* 拖动中：去掉过渡与 hover 位移，跟手；同时放大一点点提升手感 */
.ai-fab.dragging { transition: none; transform: scale(1.06); cursor: grabbing; }
.ai-fab-ico { display: flex; align-items: center; justify-content: center; line-height: 1; pointer-events: none; }
.ai-fab-t { font-size: 9.5px; font-weight: 700; letter-spacing: .4px; margin-top: 1px; opacity: .92; pointer-events: none; }

.fab-mask {
  position: fixed; inset: 0; z-index: 85; background: rgba(16, 24, 40, .42);
  opacity: 0; pointer-events: none; transition: opacity .2s ease;
}
.fab-mask.open { opacity: 1; pointer-events: auto; }

/* 右侧侧边栏（抽屉）：从右边滑入，宽度自适应，不再用底部弹层 */
.fab-sheet {
  position: fixed; z-index: 90; top: 0; right: 0; bottom: 0;
  width: 420px; max-width: 92vw;
  display: flex; flex-direction: column;
  background: #fff; border-radius: 14px 0 0 14px;
  box-shadow: -12px 0 34px rgba(16, 24, 40, .18);
  transform: translateX(102%);
  transition: transform .26s cubic-bezier(.32, .72, .32, 1);
}
.fab-sheet.open { transform: translateX(0); }

.fab-sheet-hd {
  flex: none; display: flex; align-items: center; gap: 6px;
  padding: 12px 14px 10px; border-bottom: 1px solid var(--line-2);
}
.fab-sheet-hd .grow { flex: 1 1 auto; min-width: 0; }
.fs-tabs { display: flex; gap: 4px; flex: none; }
.fs-tab {
  display: inline-flex; align-items: center; gap: 5px; cursor: pointer;
  padding: 6px 12px; border-radius: 16px; font-size: 13px; color: var(--muted);
  border: 1px solid transparent; transition: all .15s ease;
}
.fs-tab.on { color: var(--brand); background: var(--brand-bg, #EAF2FE); border-color: transparent; font-weight: 600; }
.fs-more { font-size: 12.5px; color: var(--brand); margin-right: 4px; flex: none; }
.fs-x { display: flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 8px; color: var(--muted); cursor: pointer; flex: none; }
.fs-x:hover { background: var(--line-2); color: var(--text); }

/* 关键：内层必须 min-height:0，否则 flex 子项无法滚动（真机/浏览器一致坑） */
.fab-sheet-bd { flex: 1 1 auto; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 12px 14px 18px; }
.fs-pane { display: flex; flex-direction: column; }
#fsAi { height: 100%; min-height: 0; }
.fab-sheet-bd .chat { flex: 1 1 auto; min-height: 120px; }
.fab-sheet-bd .chat-in { flex: none; }
.fab-sheet-bd .chat-in .input { flex: 1 1 auto; min-width: 0; }
.fab-sheet-bd .chat-in .btn { flex: none; }

@media (max-width: 768px) {
  .ai-fab { right: 16px; bottom: 76px; width: 52px; height: 52px; }
  .fab-sheet { width: 100%; max-width: 100vw; border-radius: 0; }
}

/* ==========================================================================
 * 矿业新闻卡（经营概览）—— 复用 newsSvc，零 AI token，与小程序展示一致
 * ========================================================================== */
.news-hint { color: var(--muted-2); font-size: 12px; font-weight: 400; }
.news-tabs { display: flex; gap: 7px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 4px; -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
.news-tab {
  flex: 0 0 auto; padding: 5px 13px; border: 1px solid var(--line); border-radius: 15px;
  font-size: 13px; cursor: pointer; color: var(--muted); background: #fff; white-space: nowrap;
  transition: border-color .15s, color .15s, background .15s;
}
.news-tab:hover { border-color: var(--brand); color: var(--brand); }
.news-tab.on { background: var(--brand); color: #fff; border-color: var(--brand); }
.news-item { display: flex; gap: 11px; padding: 10px 2px; border-bottom: 1px solid var(--line-2); cursor: pointer; align-items: flex-start; }
.news-item:last-child { border-bottom: none; }
.news-item:hover { background: var(--brand-50); border-radius: 8px; }
.news-rank {
  flex: 0 0 22px; height: 22px; border-radius: 6px; background: var(--line-2); color: var(--muted);
  display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; margin-top: 1px;
}
.news-item:nth-child(1) .news-rank { background: var(--red); color: #fff; }
.news-item:nth-child(2) .news-rank { background: #F59E0B; color: #fff; }
.news-item:nth-child(3) .news-rank { background: var(--brand); color: #fff; }
.news-body { flex: 1 1 auto; min-width: 0; }
.news-title {
  font-size: 13.5px; color: var(--text); line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.news-item:hover .news-title { color: var(--brand); }
.news-meta { margin-top: 4px; font-size: 12px; color: var(--muted-2); display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.news-heat { color: var(--orange); font-weight: 600; }

/* ==========================================================================
   招标商机（pages-bid.js）—— 对齐小程序 pages/bid/bid
   ========================================================================== */
.bid-top { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.bid-stats { display: flex; gap: 28px; flex-wrap: wrap; }
.bs-cell { min-width: 82px; }
.bs-n { font-size: 24px; font-weight: 500; color: var(--text); line-height: 1.15; }
.bs-n.warn { color: var(--red); }
.bs-n.sm { font-size: 14px; font-weight: 400; padding-top: 8px; }
.bs-l { font-size: 12px; color: var(--muted-2); }
.bid-acts { margin-left: auto; display: flex; gap: 8px; }

.bid-filter { margin-top: 14px; }
.bf-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.bf-row .inp { flex: 0 1 auto; min-width: 130px; }
.bf-row .inp:last-of-type { flex: 1 1 200px; }
.bf-hint { margin-top: 10px; font-size: 12.5px; color: var(--muted-2); line-height: 1.7; }

.bid-list { display: grid; gap: 12px; margin-top: 14px; }
.bid-card { margin: 0; }
.bc-hd { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.bc-badge {
  font-size: 11.5px; padding: 2px 8px; border-radius: 5px;
  background: #EAECF0; color: var(--muted); max-width: 220px;
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.bc-badge.manual { background: #E6F1FB; color: #185FA5; }
.bc-tag { font-size: 11.5px; padding: 2px 8px; border-radius: 5px; background: #F2F4F7; color: var(--muted); }
.bc-status { margin-left: auto; font-size: 11.5px; padding: 2px 8px; border-radius: 5px; background: #EAECF0; color: var(--muted); }
.bc-status.s0 { background: #E6F1FB; color: #185FA5; }
.bc-status.s1 { background: #FAEEDA; color: var(--orange); }
.bc-status.s2 { background: #EEEDFE; color: #534AB7; }
.bc-status.s3 { background: #EAECF0; color: var(--muted); }
.bc-status.s4 { background: #EAF3DE; color: #3B6D11; }
.bc-status.s5 { background: #EAECF0; color: var(--muted); }

.bc-title { font-size: 15px; font-weight: 500; color: var(--text); line-height: 1.45; }
.bc-line { display: flex; gap: 10px; margin-top: 6px; font-size: 13px; line-height: 1.6; }
.bc-k { flex: none; width: 74px; color: var(--muted-2); }
.bc-v { flex: 1; min-width: 0; color: var(--muted); word-break: break-word; }
.bc-ft { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.bc-dl { font-size: 12.5px; color: var(--muted); }
.bc-dl.urgent { color: var(--red); font-weight: 600; }
.bc-acts { margin-left: auto; display: flex; gap: 12px; flex-wrap: wrap; }
.lnk { font-size: 12.5px; color: var(--brand); cursor: pointer; }
.lnk:hover { text-decoration: underline; }
.lnk.danger { color: var(--red); }

.bid-tail { text-align: center; font-size: 12px; color: var(--muted-2); padding: 16px 0 6px; }
.bid-empty { text-align: left; }
.be-t { font-size: 14px; font-weight: 500; color: var(--text); }
.be-s { margin-top: 8px; font-size: 12.5px; color: var(--muted-2); line-height: 1.75; }

/* ---- 录入弹层 ---- */
.bid-modal { display: none; }
.bid-modal.open { display: block; }
.bid-mask { position: fixed; inset: 0; background: rgba(16, 24, 40, .45); z-index: 300; }
.bid-sheet {
  position: fixed; z-index: 301; left: 50%; top: 6vh; transform: translateX(-50%);
  width: min(760px, calc(100vw - 24px)); max-height: 88vh;
  display: flex; flex-direction: column;
  background: #fff; border-radius: var(--border-radius-lg);
  border: 0.5px solid var(--line-2);
}
.bm-hd { display: flex; align-items: center; padding: 14px 18px; border-bottom: 0.5px solid var(--line-2); font-size: 14px; font-weight: 500; }
.bm-x { margin-left: auto; cursor: pointer; color: var(--muted-2); }
.bm-bd { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 14px 18px; }
.bm-ft { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 0.5px solid var(--line-2); }
.bm-tip { font-size: 12.5px; color: var(--muted); line-height: 1.7; margin-bottom: 8px; }
.bm-ta { width: 100%; box-sizing: border-box; min-height: 110px; }
.bm-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }

@media (max-width: 768px) {
  .bid-top { gap: 10px; }
  .bid-stats { gap: 16px; }
  .bid-acts { margin-left: 0; width: 100%; }
  .bid-acts .btn { flex: 1; }
  .bf-row .inp, .bf-row .inp:last-of-type { flex: 1 1 100%; min-width: 0; }
  .bc-status { margin-left: 0; }
  .bc-acts { margin-left: 0; width: 100%; }
  .bid-sheet { top: 0; width: 100vw; max-height: 100vh; height: 100vh; border-radius: 0; }
  .bm-grid { grid-template-columns: 1fr; }
}

/* ===================== 询价线索（Web） ===================== */
.iq-top { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.iq-stats { display: flex; gap: 14px; flex: 1; min-width: 240px; }
.iq-cell { background: #F7F9FC; border-radius: 12px; padding: 12px 18px; text-align: center; min-width: 84px; }
.iq-n { font-size: 26px; font-weight: 700; color: #1D2939; line-height: 1.2; }
.iq-l { font-size: 12px; color: #98A2B3; margin-top: 2px; }
.iq-acts { display: flex; gap: 8px; }
.iq-filter { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.iq-filter .inp { flex: 0 0 auto; }
.iq-filter #iqKw { flex: 1; min-width: 200px; }
.iq-hint { flex-basis: 100%; font-size: 12px; color: #98A2B3; }

.iq-card { padding: 16px 18px; }
.iq-ch { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.iq-co { color: #98A2B3; font-size: 13px; font-weight: 400; }
.iq-st { margin-left: auto; font-size: 12px; padding: 3px 12px; border-radius: 10px; font-weight: 600; }
.iq-row { display: flex; gap: 8px; font-size: 13px; padding: 3px 0; }
.iq-k { width: 52px; color: #98A2B3; flex: none; }
.iq-v { color: #344054; min-width: 0; word-break: break-all; }
.iq-ft { display: flex; align-items: center; gap: 10px; margin-top: 10px; font-size: 12px; }
.iq-t { color: #B0B7C3; }
.iq-o { color: #1F6FEB; background: #EAF1FE; padding: 2px 10px; border-radius: 8px; }
.iq-acts { margin-left: auto; display: flex; gap: 14px; }
.iq-tail { text-align: center; color: #98A2B3; font-size: 12px; padding: 14px 0; }

/* 询价里的结构化筛网清单（展厅「按型号反查」带入）：销售照表报价，不用再问客户 */
.iq-pre { white-space: pre-line; line-height: 1.7; }
.iq-spec { margin: 8px 0 2px; border: 1px solid #E4EAF2; border-radius: 10px; overflow: hidden; }
.iq-spec-hd { background: #F5F8FC; padding: 8px 12px; font-size: 12.5px; font-weight: 700; color: #0E4C92;
  display: flex; align-items: center; gap: 8px; }
.iq-spec-k { font-size: 11px; font-weight: 600; color: #2456A6; background: #E8F1FB;
  padding: 1px 8px; border-radius: 8px; }
.iq-tbl { width: 100%; border-collapse: collapse; }
.iq-tbl th { font-size: 11px; color: #98A2B3; font-weight: 600; text-align: left; padding: 6px 12px;
  border-bottom: 1px solid #EEF2F7; background: #FCFDFE; white-space: nowrap; }
.iq-tbl td { font-size: 12.5px; color: #344054; padding: 7px 12px; border-bottom: 1px solid #F3F6FA; }
.iq-tbl tr:last-child td { border-bottom: none; }
.iq-tbl .ar { text-align: right; }
.iq-tbl .mono { font-family: ui-monospace, Menlo, Consolas, monospace; }
.iq-spec-sum { padding: 8px 12px; background: #F5F8FC; font-size: 12px; color: #344054; }
.iq-spec-sum b { color: #0E4C92; font-size: 13px; }
.iq-empty { text-align: center; padding: 60px 20px; }
.iq-e-t { font-size: 15px; color: #475467; font-weight: 600; }
.iq-e-s { font-size: 13px; color: #98A2B3; margin-top: 8px; line-height: 1.6; }

/* 状态色（与小程序 iq-s* 同源：蓝/橙/紫/绿/灰） */
.iq-st.s0, .s0t { background: #EAF1FE; color: #1F6FEB; }
.iq-st.s1 { background: #FEF0E6; color: #B54708; }
.iq-st.s2, .s2t { background: #F0EBFE; color: #7A5AF8; }
.iq-st.s3 { background: #F2F4F7; color: #98A2B3; }
.iq-st.s4, .s4t { background: #E7F8EF; color: #0F9D58; }

/* 商品主图上传控件（formDialog type:image） */
.img-edit { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.img-prev { width: 96px; height: 96px; border-radius: 10px; object-fit: cover; border: 1px solid var(--line, #e9edf3); background: #f0f3f8; }
.img-ph { width: 96px; height: 96px; border-radius: 10px; display: flex; align-items: center; justify-content: center;
  background: #f0f3f8; color: #98A2B3; font-size: 12px; border: 1px dashed #cdd5e0; }
.img-ops { display: flex; align-items: center; gap: 8px; }
.img-file { font-size: 12px; max-width: 220px; }
.btn.sm { padding: 5px 12px; font-size: 13px; }

/* 商品多图上传控件（formDialog type:images，2026-09-18） */
.img-edit.multi { flex-direction: column; align-items: flex-start; }
.img-gallery { display: flex; flex-wrap: wrap; gap: 12px; }
.img-cell { position: relative; width: 96px; height: 96px; border-radius: 10px; overflow: hidden;
  border: 1px solid var(--line, #e9edf3); background: #f0f3f8; }
.img-el { width: 96px; height: 96px; object-fit: cover; display: block; }
.img-badge { position: absolute; left: 0; bottom: 0; background: var(--brand, #1F6FEB); color: #fff;
  font-size: 11px; line-height: 1.5; padding: 1px 8px; border-top-right-radius: 8px; }
.img-x { position: absolute; top: 0; right: 0; width: 22px; height: 22px; line-height: 20px; padding: 0;
  text-align: center; border: none; border-bottom-left-radius: 8px; background: rgba(0,0,0,.55); color: #fff;
  font-size: 15px; cursor: pointer; }
.img-mv { position: absolute; bottom: 0; width: 28px; height: 22px; line-height: 20px; padding: 0;
  text-align: center; border: none; background: rgba(31,111,235,.92); color: #fff; font-size: 15px; cursor: pointer; }
.img-mv-l { left: 0; border-top-right-radius: 8px; }
.img-mv-r { right: 0; border-top-left-radius: 8px; }
.img-hint { color: #98A2B3; font-size: 12px; }

/* ============================================================ 分类管理页 */
/* 顶部说明条：把口径说清楚，避免用户以为"商品数>0 的分类被 bug 卡住" */
.cat-tip { font-size: 12.5px; color: #667085; background: #F8FAFC; border: 1px solid #EAECF0;
  border-radius: 8px; padding: 9px 12px; margin: 0 0 12px; line-height: 1.7; }
.cat-tip b { color: #101828; }

/* 分类名层级：大类加粗深色，下级常规浅色。缩进由内联 padding-left 给（层数不定） */
.cat-n1 { font-weight: 600; color: #101828; }
.cat-n2 { color: #344054; }
.cat-branch { color: #CDD5E0; margin-right: 5px; font-size: 12px; }

/* 手机端：说明条字号略降 */
@media (max-width: 768px) {
  .cat-tip { font-size: 12px; }
}

/* ===== 拓客统计（按推荐来源） ===== */
.iq-refcard { margin-bottom: 12px; }
.iq-refh { display: flex; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.iq-refh b { font-size: 15px; color: #1D2B3A; }
.iq-refs { font-size: 12px; color: #98A2B3; }
.iq-refm { font-size: 12px; color: #667085; margin-bottom: 8px; }
.iq-reft { width: 100%; border-collapse: collapse; font-size: 13px; }
.iq-reft th, .iq-reft td { text-align: right; padding: 6px 8px; border-bottom: 1px solid #F2F4F7; white-space: nowrap; }
.iq-reft th:first-child, .iq-reft td:first-child { text-align: left; }
.iq-reft th { color: #98A2B3; font-weight: 500; font-size: 12px; }
.iq-refe { font-size: 13px; color: #98A2B3; padding: 10px 0; line-height: 1.6; }

/* ===== 客户采购检索（pages-cust.js） ===== */
.ch-top { padding: 16px 18px; }
.ch-title { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 12px; }
.ch-title svg { color: var(--brand); }
.ch-bar { display: flex; gap: 10px; align-items: center; }
.ch-bar .inp { flex: 1; }
.ch-hint { margin-top: 10px; font-size: 12.5px; color: var(--muted-2); line-height: 1.5; }

.ch-empty { padding: 32px 16px; text-align: center; color: var(--muted-2); font-size: 13.5px; }
.ch-empty2 { padding: 18px 4px; text-align: center; color: var(--muted-2); font-size: 13px; }

/* 客户卡片 */
.ch-cust { padding: 0; overflow: hidden; }
.ch-cust-h { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px 12px; padding: 14px 18px; border-bottom: 1px solid var(--line-2); background: var(--bg); }
.ch-cust-h b { font-size: 15px; color: var(--text); }
.ch-sub { font-size: 12.5px; color: var(--muted); }
.ch-cust-h .lnk { margin-left: auto; }

/* 区块 */
.ch-sec { padding: 12px 18px; border-bottom: 1px solid var(--line-2); }
.ch-sec:last-child { border-bottom: none; }
.ch-sec-t { font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 8px; }

/* 单据 / 记录 */
.ch-ord { padding: 8px 0; border-top: 1px dashed var(--line-2); }
.ch-ord:first-of-type { border-top: none; }
.ch-ord-h { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--muted); }
.ch-ord-h .ch-amt { margin-left: auto; color: var(--brand); font-weight: 700; font-size: 14px; }
.ch-it { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; padding: 4px 0 4px 12px; font-size: 13.5px; }
.ch-it-n { color: var(--text); font-weight: 500; }
.ch-it-s { color: var(--muted); }
.ch-it-q { color: var(--muted-2); margin-left: auto; }

/* 状态徽标（与 showroom.js 共用，补齐缺失的基础样式） */
.badge { display: inline-flex; align-items: center; padding: 1px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 500; line-height: 18px; border: 1px solid transparent; }
.badge.b { color: var(--muted); background: var(--line-2); border-color: var(--line); }
.badge.g { color: var(--green); background: var(--green-bg); border-color: #C7EAD6; }
.badge.gr { color: var(--brand); background: var(--brand-50); border-color: #C9DCFB; }
.badge.ok { color: var(--green); background: var(--green-bg); }
.badge.warn { color: var(--orange); background: var(--orange-bg); }
.badge.danger { color: var(--red); background: var(--red-bg); }
.badge.info { color: var(--brand); background: var(--brand-50); }
