/* ==========================================================================
   跟单进度 · 样式
   ========================================================================== */
:root {
  --ink: #16242a;
  --ink-2: #38505a;
  --muted: #72858d;
  --line: #e2e8ea;
  --line-2: #eef2f3;
  --bg: #f1f5f5;
  --card: #ffffff;
  --accent: #1f6f5c;
  --accent-2: #2b8a72;
  --accent-soft: #e6f2ee;
  --danger: #b3392f;
  --danger-soft: #fbeceb;
  --warn: #a8641a;
  --warn-soft: #fdf3e3;
  --info: #2d6a9f;
  --info-soft: #e9f1f8;
  --radius: 10px;
  --radius-sm: 7px;
  --shadow-1: 0 1px 2px rgba(16, 40, 48, .06), 0 1px 3px rgba(16, 40, 48, .04);
  --shadow-2: 0 12px 32px rgba(12, 32, 38, .16);
  --row-h: 36px;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC",
          "Hiragino Sans GB", "Source Han Sans SC", sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  font-size: 13.5px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
a { color: var(--accent); text-decoration: none; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #c8d3d6; border-radius: 6px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #aebcc0; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------------------------------------------------------------- 启动 / 登录 */
.boot-screen {
  position: fixed; inset: 0; display: flex; flex-direction: column; gap: 14px;
  align-items: center; justify-content: center; color: var(--muted);
}
.boot-logo {
  width: 52px; height: 52px; border-radius: 14px; background: var(--accent); color: #fff;
  display: grid; place-items: center; font-size: 24px; font-weight: 700;
  box-shadow: 0 8px 24px rgba(31, 111, 92, .28);
}
.login-body {
  background:
    radial-gradient(1100px 520px at 12% -10%, #dceee8 0%, rgba(220, 238, 232, 0) 62%),
    radial-gradient(900px 480px at 105% 110%, #e3ebf3 0%, rgba(227, 235, 243, 0) 58%),
    var(--bg);
}
.login-wrap { min-height: 100%; display: grid; place-items: center; padding: 24px; }
.login-card {
  width: 100%; max-width: 380px; background: var(--card); border: 1px solid var(--line);
  border-radius: 16px; padding: 28px 28px 22px; box-shadow: var(--shadow-2);
}
.login-brand { display: flex; gap: 14px; align-items: center; margin-bottom: 22px; }
.logo-mark {
  width: 46px; height: 46px; border-radius: 13px; background: var(--accent); color: #fff;
  display: grid; place-items: center; font-size: 22px; font-weight: 700; flex: none;
}
.login-card h1 { font-size: 19px; letter-spacing: .5px; }
.login-sub { margin: 3px 0 0; color: var(--muted); font-size: 12.5px; }
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 12.5px; color: var(--ink-2); margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: #fbfcfc; outline: none; transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--accent-2); box-shadow: 0 0 0 3px rgba(43, 138, 114, .12); background: #fff;
}
.login-error { color: var(--danger); font-size: 12.5px; min-height: 18px; margin-bottom: 8px; }
.login-tip { text-align: center; color: var(--muted); font-size: 12px; margin: 16px 0 0; }

/* ---------------------------------------------------------------- 基础控件 */
.btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: #fff; color: var(--ink-2); cursor: pointer;
  font-size: 13px; line-height: 1.3; white-space: nowrap; transition: background .15s, border-color .15s, color .15s;
}
.btn:hover { background: #f6f9f9; border-color: #d3dcdf; }
.btn:active { transform: translateY(.5px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: #eef3f3; }
.btn.danger { color: var(--danger); border-color: #eccfcc; background: #fff; }
.btn.danger:hover { background: var(--danger-soft); }
.btn.sm { padding: 4px 9px; font-size: 12.5px; }
.btn.block { width: 100%; justify-content: center; padding: 11px; font-size: 14px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-icon {
  width: 30px; height: 30px; padding: 0; justify-content: center; border-radius: var(--radius-sm);
  border: 1px solid transparent; background: transparent; color: var(--muted); cursor: pointer;
}
.btn-icon:hover { background: #eef3f3; color: var(--ink); }
.input, .select {
  padding: 6px 9px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff;
  outline: none; min-width: 0;
}
.input:focus, .select:focus { border-color: var(--accent-2); box-shadow: 0 0 0 3px rgba(43, 138, 114, .12); }
.mini-input { padding: 3px 6px; font-size: 12.5px; }

/* ---------------------------------------------------------------- 主框架 */
#app { height: 100%; }
.shell { display: grid; grid-template-columns: 212px 1fr; height: 100vh; height: 100dvh; overflow: hidden; }
.sidebar {
  background: #14211f; color: #cfdbd8; display: flex; flex-direction: column;
  padding: 16px 12px 10px; gap: 4px; overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 2px 8px 16px; }
.brand .logo-mark { width: 34px; height: 34px; border-radius: 10px; font-size: 17px; box-shadow: none; }
.brand-text strong { display: block; color: #fff; font-size: 14.5px; letter-spacing: .5px; }
.brand-text small { color: #7d9490; font-size: 11px; }
.nav-group { margin: 10px 8px 4px; font-size: 11px; color: #6c8380; letter-spacing: .08em; }
.nav-item {
  display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 8px;
  color: #c3d2ce; cursor: pointer; border: 0; background: none; width: 100%; text-align: left;
  font-size: 13.5px; transition: background .15s, color .15s;
}
.nav-item:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.nav-item.active { background: var(--accent); color: #fff; box-shadow: 0 4px 14px rgba(31, 111, 92, .35); }
.nav-item .ico { width: 16px; text-align: center; opacity: .9; font-size: 14px; }
.nav-item .badge {
  margin-left: auto; background: rgba(255, 255, 255, .14); border-radius: 20px; padding: 1px 7px;
  font-size: 11px; color: #d8e5e1;
}
.nav-item.active .badge { background: rgba(0, 0, 0, .18); }
.nav-item.nav-link { text-decoration: none; }
.nav-item.nav-link .badge { margin-left: auto; font-size: 10px; }
.sidebar-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, .08); }
.user-chip { display: flex; align-items: center; gap: 9px; padding: 6px 8px; border-radius: 8px; cursor: pointer; }
.user-chip:hover { background: rgba(255, 255, 255, .07); }
/* 备案号（法规要求在网站底部展示） */
.icp-link {
  display: block; margin-top: 6px; padding: 0 4px; font-size: 11px; text-align: center;
  color: #6f8a85; text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.icp-link:hover { color: #cfe0d9; text-decoration: underline; }
body.nav-collapsed .icp-link { display: none; }
.site-icp {
  position: fixed; left: 0; right: 0; bottom: 14px; margin: 0;
  text-align: center; font-size: 12px; color: #9fb0b3;
}
.site-icp a { color: inherit; text-decoration: none; }
.site-icp a:hover { color: var(--accent); text-decoration: underline; }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; background: #2c4b45; color: #e8f2ef;
  display: grid; place-items: center; font-size: 12.5px; font-weight: 600; flex: none;
}
.user-chip .who { min-width: 0; }
.user-chip .who b { display: block; color: #fff; font-size: 12.8px; font-weight: 500; }
.user-chip .who span { color: #7d9490; font-size: 11px; }

.main { display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
.topbar {
  display: flex; align-items: center; gap: 10px; padding: 10px 16px; background: var(--card);
  border-bottom: 1px solid var(--line); min-height: 56px; flex: none;
}
.topbar h2 { font-size: 15.5px; letter-spacing: .2px; }
.topbar .sub { color: var(--muted); font-size: 12px; margin-left: 2px; }
.spacer { flex: 1; }
.view-host { flex: 1; overflow: hidden; display: flex; flex-direction: column; min-height: 0; }

/* ---------------------------------------------------------------- 工具条 */
.toolbar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 9px 16px;
  background: #fbfcfc; border-bottom: 1px solid var(--line); flex: none;
}
.searchbox { position: relative; }
.searchbox input {
  width: 220px; padding: 6px 10px 6px 28px; border: 1px solid var(--line); border-radius: 20px;
  background: #fff; outline: none;
}
.searchbox input:focus { border-color: var(--accent-2); box-shadow: 0 0 0 3px rgba(43, 138, 114, .1); }
.searchbox .mag { position: absolute; left: 9px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 12px; }
.filter-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 20px;
  border: 1px solid var(--line); background: #fff; color: var(--ink-2); cursor: pointer; font-size: 12.5px;
}
.filter-chip:hover { border-color: #cfdadc; background: #f7fafa; }
.filter-chip.active { background: var(--accent-soft); border-color: #bfded5; color: var(--accent); }
.filter-chip .x { opacity: .55; font-size: 14px; }
.filter-chip .x:hover { opacity: 1; }
.summary-pill {
  font-size: 12.3px; color: var(--ink-2); background: #eef4f3; border-radius: 20px; padding: 5px 11px;
  white-space: nowrap;
}
.summary-pill b { color: var(--accent); }

/* ---------------------------------------------------------------- 表格 */
.table-scroll {
  flex: 1; overflow: auto; background: var(--card); position: relative; min-height: 0;
  overscroll-behavior: contain;
}
table.grid { border-collapse: separate; border-spacing: 0; width: max-content; min-width: 100%; }
table.grid th {
  position: sticky; top: 0; z-index: 5; background: #f4f7f7; color: var(--ink-2);
  font-weight: 600; font-size: 12.3px; text-align: left; padding: 0 8px; height: 34px;
  border-bottom: 1px solid var(--line); border-right: 1px solid var(--line-2);
  white-space: nowrap; user-select: none;
}
table.grid th.sortable { cursor: pointer; }
table.grid th.sortable:hover { background: #eaf0f0; }
table.grid th .sort-ind { color: var(--accent); font-size: 10px; margin-left: 3px; }
table.grid th.grp-start, table.grid td.grp-start { border-left: 2px solid #dfe7e8; }
table.grid td {
  padding: 0 8px; height: var(--row-h); border-bottom: 1px solid var(--line-2);
  border-right: 1px solid var(--line-2); font-size: 13px; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 320px;
  background: var(--card); vertical-align: middle;
}
table.grid tr:hover td { background: #f7fbfa; }
table.grid tr.priority td { background: #fffaf0; }
table.grid tr.priority:hover td { background: #fff5e3; }
/* 货期预警：黄=离工厂货期 15 天内且面部没完成；深粉=7 天内且底部没完成 */
table.grid tr.row-warn td { background: #C6E0B4; }
table.grid tr.row-warn:hover td { background: #B9D8A3; }
table.grid tr.row-urgent td { background: #B4C6E7; }
table.grid tr.row-urgent:hover td { background: #A5BADD; }
table.grid tr.row-warn td.actions, table.grid tr.row-urgent td.actions { background: inherit; }
table.grid tr.settled td { background: #f0f8f3; }
table.grid tr.settled:hover td { background: #e8f5ec; }
table.grid tr.settled.priority td { background: #fffaf0; }
/* 生产已完成：整行灰掉（还留在主页，可以改、可以退回未完成） */
table.grid tr.row-ready td { background: #ebefef; color: #7b8a8e; }
table.grid tr.row-ready:hover td { background: #e4e9e9; }
table.grid tr.row-ready td.actions { background: #ebefef; }
/* 业务员自己标的行颜色（管理员/生管/财务看不到，因为后端根本不返回） */
/* 红＝大红（原来的浅粉跟货期预警的深粉撞色，改成大红） */
table.grid tr.row-c-red td { background: #FF8A80; }
table.grid tr.row-c-orange td { background: #FFE6C7; }
table.grid tr.row-c-green td { background: #FFF1B8; }
table.grid tr.row-c-blue td { background: #FFD9E6; }
table.grid tr.row-c-purple td { background: #E9DDFF; }
table.grid tr.row-c-red:hover td { background: #ff7a6f; }
table.grid tr.row-c-red td.date-late,
table.grid tr.row-c-red td.date-soon { color: #6d0f08; }   /* 大红底上红字看不清，压深一点 */
table.grid tr.row-c-orange:hover td { background: #ffddb5; }
table.grid tr.row-c-green:hover td { background: #FFE79B; }
table.grid tr.row-c-blue:hover td { background: #FFC6DA; }
table.grid tr.row-c-purple:hover td { background: #dfcdff; }
/* 行颜色按钮 */
.row-actions button.color-dot {
  border: 1px solid #cfdadc; background: #fff; border-radius: 50%;
  font-size: 10px; color: #9aa8ac; padding: 0;
}
.row-actions button.color-dot.has { color: #5b6e73; }
/* 行颜色菜单 */
.color-pop { width: 196px; }
.color-swatches { display: flex; gap: 8px; }
.color-swatches .swatch {
  width: 28px; height: 28px; border-radius: 8px; cursor: pointer;
  border: 2px solid transparent; padding: 0;
}
.color-swatches .swatch.on { border-color: var(--accent); }
.color-swatches .swatch.none {
  background: #f4f7f7; color: #7d8f93; font-size: 12px; border: 1px solid var(--line);
}
.color-swatches .swatch.none.on { border-color: var(--accent); }
/* 行颜色菜单里的「清空」：清掉手动颜色，恢复货期自动色 */
.color-clear {
  width: 100%; margin-top: 8px; padding: 5px 0; border: 1px solid var(--line);
  border-radius: 8px; background: #fff; color: #5b6e73; font-size: 12px; cursor: pointer;
}
.color-clear:hover { border-color: var(--accent); color: var(--accent); background: #f6faf9; }
/* 生产状态按钮组 */
.status-seg { display: inline-flex; gap: 4px; }
.status-seg .btn.on { box-shadow: inset 0 0 0 1px var(--accent); }
/* 粘贴上传图片 */
.paste-zone {
  border: 2px dashed #cfdadc; border-radius: 10px; padding: 20px 14px; text-align: center;
  color: var(--ink-2); line-height: 1.7; cursor: text; outline: none;
}
.paste-zone:focus { border-color: var(--accent-2); background: #f5fbf9; }
.paste-key {
  display: inline-block; margin-bottom: 6px; padding: 2px 10px; border-radius: 20px;
  background: #eef4f3; color: var(--ink-2); font-size: 12px; letter-spacing: .5px;
}
.paste-list { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.paste-item { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.paste-item img {
  width: 44px; height: 44px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line);
}
.paste-item .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip-abnormal { color: #a4491b; background: #ffe9d8; border-color: #f4cdb0; }
.finance-mode table.grid tr.settled td,
.finance-mode table.grid tr.settled.priority td { background: #eaf6ee; }
table.grid td.idx, table.grid th.idx { width: 56px; color: var(--muted); font-size: 11.5px; text-align: right; white-space: nowrap; }
/* 置顶星标（业务员，在编号前面）：没置顶是淡灰的 ☆，置顶是金色 ★ */
.pin-star {
  border: 0; background: none; padding: 0; margin: 0 3px 0 0; cursor: pointer;
  font-size: 12px; line-height: 1; color: #b6c5c5; opacity: .6; vertical-align: 1px;
}
.pin-star:hover { opacity: 1; color: #d99a00; }
.pin-star.on { color: #e8a400; opacity: 1; }
.pin-star.ro { cursor: default; }
.pin-star.ro:hover { color: #e8a400; }
table.grid td.actions, table.grid th.actions {
  position: sticky; right: 0; z-index: 4; width: 74px; background: var(--card);
  border-left: 1px solid var(--line); text-align: center;
}
table.grid th.actions { background: #f4f7f7; z-index: 6; }
table.grid tr:hover td.actions { background: #f7fbfa; }
/* 固定列：横向拖动表格时贴在左边不动（客户 / 工厂 / 款号 …） */
table.grid th.pin, table.grid td.pin { position: sticky; z-index: 3; }
table.grid th.pin { z-index: 7; }
table.grid th.pin.pin-last, table.grid td.pin.pin-last { border-right: 2px solid #d6e2e0; }
/* 往右拖了才加阴影，一眼看出「固定到这儿为止」 */
.table-scroll.pin-shadow table.grid .pin-last {
  border-right-color: #bfd3cf;
  box-shadow: 10px 0 12px -10px rgba(15, 60, 50, .55);
}
.pin-list { display: flex; flex-direction: column; gap: 6px; }
.pin-item {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px; cursor: pointer;
  border: 1px solid var(--line); border-radius: 8px; background: #fff; font-size: 13px;
}
.pin-item:hover { background: #f3f8f7; }
.pin-item input { margin: 0; }
.cell-editable { cursor: text; }
.cell-editable:hover { box-shadow: inset 0 0 0 1px #b9d6ce; border-radius: 4px; }
.cell-empty::after { content: ""; }
td .multiline { white-space: normal; line-height: 1.35; max-height: 34px; overflow: hidden; }
.cell-num { text-align: right; font-variant-numeric: tabular-nums; }
.cell-date { font-variant-numeric: tabular-nums; }
.date-late { color: var(--danger); font-weight: 600; }
.date-soon { color: var(--warn); font-weight: 600; }

.grid-img {
  width: 30px; height: 30px; border-radius: 5px; object-fit: cover; cursor: pointer;
  background: #eef2f3; display: block; border: 1px solid var(--line);
}
/* 图片角标：这个单还有几张 */
.img-wrap { position: relative; display: inline-block; line-height: 0; }
.img-more {
  position: absolute; right: -4px; bottom: -4px; min-width: 15px; height: 15px;
  padding: 0 3px; border-radius: 8px; background: var(--accent); color: #fff;
  font-size: 10px; font-style: normal; line-height: 15px; text-align: center;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .2); pointer-events: none;
}
.grid-img-empty {
  width: 30px; height: 30px; border-radius: 5px; border: 1px dashed #cfdadc; color: #a9b8bc;
  display: grid; place-items: center; font-size: 15px; cursor: pointer; background: #fafcfc;
}
.grid-img-empty:hover { border-color: var(--accent-2); color: var(--accent-2); }

/* 状态胶囊 */
.chip {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 20px;
  font-size: 11.8px; line-height: 1.7; border: 1px solid transparent; white-space: nowrap;
}
.chip-empty { color: #a4b2b6; border-color: #e3eaeb; background: #fafcfc; }
.chip-run { color: var(--info); background: var(--info-soft); border-color: #cfe0ef; }
.chip-done { color: var(--accent); background: var(--accent-soft); border-color: #c4e0d7; }
.chip-hold { color: var(--warn); background: var(--warn-soft); border-color: #eddcbd; }
.chip-open { color: #43565e; background: #f0f4f5; border-color: #dde5e7; }
.chip-done-order { color: #fff; background: var(--accent); border-color: var(--accent); }
.chip-cancel { color: var(--muted); background: #f1f4f5; border-color: #e2e8ea; text-decoration: line-through; }
.chip-star { color: #b0731a; background: #fdf4e0; border-color: #eddcb6; }
.chip-settled { color: #fff; background: var(--accent); border-color: var(--accent); }
.chip-unsettled { color: #6b7c84; background: #f4f7f7; border-color: #e3e8ea; }
.chip-none { color: #9aa8ac; background: #f6f8f8; border-color: #e6ebec; }
.chip-cell { cursor: pointer; }
.chip-cell:hover { filter: brightness(.97); box-shadow: 0 0 0 1px rgba(31, 111, 92, .25); }
.step-note-dot { width: 5px; height: 5px; border-radius: 50%; background: #9db4b0; display: inline-block; }
.docs-count { font-size: 12px; color: var(--accent); cursor: pointer; }

/* 行操作 */
.row-actions { display: flex; gap: 2px; justify-content: center; }
.row-actions button { width: 24px; height: 24px; border-radius: 5px; border: 0; background: transparent; cursor: pointer; color: var(--muted); font-size: 13px; }
.row-actions button:hover { background: #eaf1f0; color: var(--ink); }
.row-actions button.del:hover { background: var(--danger-soft); color: var(--danger); }

/* 空状态 */
.empty-state { padding: 64px 24px; text-align: center; color: var(--muted); }
.empty-state .big { font-size: 34px; margin-bottom: 10px; opacity: .35; }
.empty-state h3 { color: var(--ink-2); font-size: 14.5px; margin-bottom: 6px; }

/* 分页 */
.pager {
  display: flex; align-items: center; gap: 10px; padding: 8px 16px; border-top: 1px solid var(--line);
  background: #fbfcfc; font-size: 12.5px; color: var(--muted); flex: none;
}
.pager .btn { padding: 4px 10px; }
.foot-stat { font-size: 13px; color: var(--ink-2); }
.foot-stat b { color: var(--accent); font-size: 14px; font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- 抽屉 */
.drawer-mask {
  position: fixed; inset: 0; background: rgba(12, 30, 34, .35); z-index: 60;
  opacity: 0; transition: opacity .18s;
}
.drawer-mask.show { opacity: 1; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 94vw); background: var(--card);
  z-index: 61; box-shadow: -10px 0 40px rgba(10, 30, 34, .18); display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform .22s cubic-bezier(.3, .8, .4, 1);
}
.drawer.show { transform: translateX(0); }
.drawer-head {
  display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line);
  flex: none;
}
.drawer-head h3 { font-size: 15px; }
.drawer-head .sub { color: var(--muted); font-size: 12px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 4px 18px 24px; }
.drawer-foot {
  display: flex; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line);
  background: #fbfcfc; flex: none;
}
.section { margin-top: 18px; }
.section > h4 {
  font-size: 12px; color: var(--muted); letter-spacing: .08em; text-transform: uppercase;
  margin-bottom: 8px; display: flex; align-items: center; gap: 8px;
}
.section > h4::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.kv { display: grid; grid-template-columns: 96px 1fr; gap: 8px 12px; align-items: start; }
.kv > .k { color: var(--muted); font-size: 12.5px; padding-top: 6px; }
.kv > .v { min-width: 0; }
.step-list { display: flex; flex-direction: column; gap: 6px; }
.step-row {
  display: grid; grid-template-columns: 96px 1fr; gap: 10px; align-items: center;
  padding: 5px 0; border-bottom: 1px dashed var(--line-2);
}
.step-row .k { color: var(--muted); font-size: 12.5px; }
.step-edit { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.step-edit .note { flex: 1; min-width: 120px; }
.gallery { display: flex; flex-wrap: wrap; gap: 8px; }
.gallery .item { position: relative; }
.gallery img { width: 92px; height: 92px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); display: block; }
.gallery .del {
  position: absolute; top: -6px; right: -6px; width: 20px; height: 20px; border-radius: 50%;
  background: #fff; border: 1px solid var(--line); color: var(--danger); cursor: pointer;
  font-size: 12px; line-height: 1; display: grid; place-items: center;
}
.upload-tile {
  width: 92px; height: 92px; border-radius: 8px; border: 1px dashed #c9d6d8; display: grid;
  place-items: center; color: var(--muted); cursor: pointer; background: #fafcfc; text-align: center;
  font-size: 12px; gap: 2px;
}
.upload-tile:hover { border-color: var(--accent-2); color: var(--accent); background: #f4faf8; }
.history-list { display: flex; flex-direction: column; gap: 7px; font-size: 12.5px; }
.history-list .h-item { display: grid; grid-template-columns: 118px 1fr; gap: 8px; color: var(--ink-2); }
.history-list .h-time { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 11.5px; }
.history-list .h-diff { color: var(--muted); }
.history-list .h-diff s { color: #a5574f; text-decoration-thickness: 1px; }
.history-list .h-diff b { color: var(--accent); font-weight: 500; }

/* ---------------------------------------------------------------- 弹窗 */
.modal-mask {
  position: fixed; inset: 0; background: rgba(12, 30, 34, .4); z-index: 70;
  display: grid; place-items: center; padding: 20px; opacity: 0; transition: opacity .16s;
}
.modal-mask.show { opacity: 1; }
.modal {
  background: var(--card); border-radius: 14px; box-shadow: var(--shadow-2); width: min(720px, 96vw);
  max-height: 88vh; display: flex; flex-direction: column; transform: translateY(8px) scale(.99);
  transition: transform .18s;
}
.modal-mask.show .modal { transform: none; }
.modal.narrow { width: min(440px, 96vw); }
.modal.wide { width: min(980px, 96vw); }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 15px 20px; border-bottom: 1px solid var(--line); }
.modal-head h3 { font-size: 15px; }
.modal-body { padding: 16px 20px; overflow-y: auto; }
.modal-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 12px 20px; border-top: 1px solid var(--line); background: #fbfcfc; border-radius: 0 0 14px 14px; }
.modal-foot a.btn { text-decoration: none; }
/* 装小助手的 1-2-3 步 */
.helper-steps { display: flex; flex-direction: column; gap: 9px; }
.helper-steps > div { display: flex; gap: 8px; align-items: flex-start; line-height: 1.65; font-size: 13px; }
.helper-steps i {
  flex: none; width: 20px; height: 20px; margin-top: 1px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent); font-style: normal;
  font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center;
}
.helper-steps code { background: #f2f6f5; border-radius: 4px; padding: 1px 5px; font-size: 12px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); padding: 0 20px; }
.tab { padding: 9px 12px; border: 0; background: none; cursor: pointer; color: var(--muted); border-bottom: 2px solid transparent; font-size: 13px; }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }

/* 列选择器 */
.col-groups { columns: 2; column-gap: 22px; }
.col-group { margin-bottom: 14px; break-inside: avoid; }
.col-group > .g-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.col-group > .g-head b { font-size: 12.5px; color: var(--ink-2); }
.col-group > .g-head .hint { color: var(--muted); font-size: 11.5px; }
.col-list { display: flex; flex-direction: column; gap: 3px; }
.col-item {
  display: flex; align-items: center; gap: 8px; padding: 5px 8px; border-radius: 6px;
  border: 1px solid transparent; background: #fafcfc;
}
.col-item:hover { background: #f3f8f7; }
.col-item.dragging { opacity: .4; }
.col-item .handle { cursor: grab; color: #b6c4c7; font-size: 12px; }
.col-item label { display: flex; align-items: center; gap: 6px; cursor: pointer; flex: 1; font-size: 12.8px; }
.col-item .fgroup { color: var(--muted); font-size: 11px; margin-left: auto; }
.drag-over { outline: 2px dashed var(--accent-2); outline-offset: 1px; }

/* 权限矩阵 */
.perm-table { width: 100%; border-collapse: collapse; font-size: 12.6px; }
.perm-table th, .perm-table td { padding: 6px 8px; border-bottom: 1px solid var(--line-2); text-align: left; }
.perm-table th { background: #f7fafa; font-weight: 600; color: var(--ink-2); position: sticky; top: 0; z-index: 2; }
.perm-table td.c { text-align: center; }
.perm-table tr.grp-row td { background: #f4f8f7; font-weight: 600; color: var(--accent); }
.perm-table input[type=checkbox] { width: 15px; height: 15px; accent-color: var(--accent); cursor: pointer; }
.group-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.group-tab {
  padding: 6px 12px; border-radius: 20px; border: 1px solid var(--line); background: #fff;
  cursor: pointer; font-size: 12.8px; color: var(--ink-2);
}
.group-tab.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.group-tab .n { opacity: .6; font-size: 11px; margin-left: 4px; }
.switch { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.switch input { display: none; }
.switch .track { width: 34px; height: 19px; border-radius: 20px; background: #d6e0e2; position: relative; transition: background .15s; flex: none; }
.switch .track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 15px; height: 15px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::after { transform: translateX(15px); }

/* 名片列表（手机） */
.card-list { padding: 10px 12px 90px; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; flex: 1; }
.order-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 11px 12px;
  box-shadow: var(--shadow-1); display: flex; flex-direction: column; gap: 6px;
}
.order-card.priority { border-color: #ecd9ae; background: linear-gradient(#fffdf7, #fffaf0); }
.order-card.warn { border-color: #a9cf90; background: #f4fbef; }
.order-card.urgent { border-color: #93aedb; background: #f3f6fd; }
.order-card.settled { border-color: #c9e3d6; background: #f6fbf8; }
.oc-top { display: flex; align-items: center; gap: 8px; }
.oc-top .no { font-weight: 600; font-size: 13.5px; letter-spacing: .2px; }
.oc-top .style { color: var(--ink-2); font-size: 12.8px; }
.oc-top .spacer { flex: 1; }
.oc-mid { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12.6px; color: var(--ink-2); }
.oc-mid .k { color: var(--muted); font-size: 11.5px; margin-right: 3px; }
.oc-bot { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.oc-bot .dates { color: var(--muted); font-size: 11.8px; }
.oc-thumb { width: 46px; height: 46px; border-radius: 8px; object-fit: cover; border: 1px solid var(--line); flex: none; }

/* 手机底部导航 */
.mobile-nav { display: none; }
.mobile-only { display: none; }

/* Toast */
.toast-host { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 90; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  background: #16242a; color: #fff; padding: 9px 16px; border-radius: 22px; font-size: 13px;
  box-shadow: var(--shadow-2); opacity: 0; transform: translateY(8px); transition: all .18s;
  max-width: 86vw;
}
.toast.show { opacity: 1; transform: none; }
.toast.err { background: #8f2f27; }
.toast.ok { background: #1f6f5c; }

/* 图片查看 */
.lightbox { position: fixed; inset: 0; background: rgba(8, 20, 24, .86); z-index: 95; display: grid; place-items: center; padding: 24px; }
.lightbox img { max-width: 94vw; max-height: 90vh; border-radius: 8px; box-shadow: var(--shadow-2); }
.lightbox .close { position: absolute; top: 18px; right: 22px; color: #fff; font-size: 28px; cursor: pointer; line-height: 1; z-index: 2; }
/* 看图：放大缩小 / 拖动 */
.lightbox .lb-stage {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.lightbox .lb-stage img { transform-origin: center center; user-select: none; -webkit-user-drag: none; }
.lightbox.zoomed .lb-stage { cursor: grab; }
.lightbox.dragging .lb-stage { cursor: grabbing; }
.lightbox.zoomed .lb-stage img { cursor: grab; }
.lightbox .lb-tools {
  position: absolute; left: 50%; transform: translateX(-50%); bottom: 56px;
  display: flex; align-items: center; gap: 6px;
  background: rgba(0, 0, 0, .4); padding: 5px 8px; border-radius: 22px;
}
.lightbox .lb-tool {
  min-width: 30px; height: 28px; padding: 0 8px; border: 0; border-radius: 14px;
  background: rgba(255, 255, 255, .16); color: #fff; font-size: 15px; cursor: pointer;
}
.lightbox .lb-tool:hover { background: rgba(255, 255, 255, .32); }
.lightbox .lb-zoom {
  color: #fff; font-size: 12px; min-width: 46px; text-align: center; font-variant-numeric: tabular-nums;
}
/* 多张图片翻页 */
.lightbox .lb-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 46px; height: 46px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(255, 255, 255, .16); color: #fff; font-size: 26px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
}
.lightbox .lb-nav:hover { background: rgba(255, 255, 255, .3); }
.lightbox .lb-nav.prev { left: 18px; }
.lightbox .lb-nav.next { right: 18px; }
.lightbox .lb-bar {
  position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 10px; color: #fff; font-size: 13px;
  background: rgba(0, 0, 0, .35); padding: 5px 14px; border-radius: 20px;
}
.lightbox .lb-bar .lb-label { opacity: .85; }
.lightbox .lb-bar .lb-count { font-variant-numeric: tabular-nums; }

/* 个人偏好 / 设置页 */
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.panel + .panel { margin-top: 12px; }
.panel h3 { font-size: 14px; margin-bottom: 4px; }
.panel .desc { color: var(--muted); font-size: 12.2px; margin-bottom: 12px; line-height: 1.6; }
.form-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.form-row > label { min-width: 110px; color: var(--ink-2); font-size: 12.8px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px 16px; }
.hint-line { color: var(--muted); font-size: 12px; line-height: 1.7; }
.chk-grid { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.page-scroll { flex: 1; overflow-y: auto; padding: 16px; }
.list-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.list-table th, .list-table td { padding: 8px 10px; border-bottom: 1px solid var(--line-2); text-align: left; }
.list-table .cell-num { text-align: right; font-variant-numeric: tabular-nums; }
/* 名录：名称列只占内容宽度，数量紧跟名称，不撑到最右边 */
.list-table .dir-name { white-space: nowrap; }
/* 名录 · 工厂页顶上的未完成数量合计 */
.dir-summary { margin: 2px 0 10px; font-size: 12.5px; color: var(--ink-2); }
.dir-summary b { color: var(--accent); font-size: 14px; }
.list-table th { color: var(--muted); font-weight: 500; font-size: 12px; background: #fafcfc; position: sticky; top: 0; }
.list-table tr:hover td { background: #f8fbfa; }
.tag { display: inline-block; padding: 1px 7px; border-radius: 4px; background: #eef3f3; color: var(--ink-2); font-size: 11.5px; }
.tag.off { background: #f6eeee; color: var(--danger); }
.tag.on { background: var(--accent-soft); color: var(--accent); }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.mono { font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- 步骤气泡 */
.popover {
  position: fixed; z-index: 80; width: 268px; background: var(--card); border: 1px solid var(--line);
  border-radius: 10px; box-shadow: var(--shadow-2); padding: 11px 12px 10px;
}
.pop-title { font-size: 12.5px; color: var(--muted); margin-bottom: 7px; }
.pop-status { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 9px; }
.pop-line { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; }
.pop-line > span { width: 34px; color: var(--muted); font-size: 12px; flex: none; }
.pop-line input, .pop-line .input { flex: 1; min-width: 0; }
/* 快捷进度列：点一下弹窗（可标「已完成」）的开关，只出现在这 5 列的弹窗里 */
.pop-opt { display: flex; align-items: flex-start; gap: 5px; margin: -2px 0 8px; cursor: pointer; }
.pop-opt input { margin: 2px 0 0; flex: none; accent-color: var(--accent); }
.pop-opt span { font-size: 11.5px; color: var(--muted); line-height: 1.45; }
.pop-foot { display: flex; gap: 6px; justify-content: flex-end; margin-top: 4px; }

/* ---------------------------------------------------------------- 列宽拖动 / 表头筛选 */
table.grid th { position: sticky; top: 0; z-index: 5; }
table.grid th .col-resizer {
  position: absolute; top: 0; right: -3px; width: 7px; height: 100%;
  cursor: col-resize; z-index: 8;
}
table.grid th .col-resizer:hover { background: linear-gradient(90deg, transparent 40%, #9fc7bc 40%, #9fc7bc 60%, transparent 60%); }
body.resizing { cursor: col-resize !important; user-select: none; }
body.resizing table.grid td, body.resizing table.grid th { user-select: none; }
.th-label { pointer-events: none; }
.funnel {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; margin-left: 4px; padding: 0; border-radius: 5px;
  border: 1px solid #dbe4e5; background: #fff; color: #7f9398; cursor: pointer;
  vertical-align: middle; flex: none;
}
.funnel:hover { color: var(--accent); border-color: #bcd9cf; background: var(--accent-soft); }
.funnel.on { color: #fff; background: var(--accent); border-color: var(--accent); }

/* 拖动表头换顺序 */
table.grid th { cursor: pointer; }
table.grid th.th-dragging { opacity: .35; }
table.grid th.drop-before::before,
table.grid th.drop-after::after {
  content: ""; position: absolute; top: 0; bottom: 0; width: 3px;
  background: var(--accent); z-index: 9; border-radius: 2px;
}
table.grid th.drop-before::before { left: -2px; }
table.grid th.drop-after::after { right: -2px; }

/* 进度气泡里的「清空」按钮：和状态按钮区分开 */
.pop-status .clear-btn {
  border: 1px dashed #c9d6d8; background: #fafcfc; color: var(--muted);
}
.pop-status .clear-btn:hover { color: var(--danger); border-color: #e3b7b2; background: #fdf3f2; }
.pop-status .clear-btn.primary {
  color: var(--accent); border: 1px solid var(--accent); background: var(--accent-soft);
  font-weight: 600;
}

.facet-pop {
  position: fixed; z-index: 85; width: 236px; background: var(--card);
  border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-2);
  padding: 8px; display: flex; flex-direction: column; gap: 6px;
}
.fp-head { display: flex; align-items: center; font-size: 12.5px; color: var(--muted); padding: 0 2px; }
.fp-head .btn-icon { margin-left: auto; width: 22px; height: 22px; font-size: 11px; }
.fp-search { width: 100%; }
.fp-list { max-height: 240px; overflow-y: auto; display: flex; flex-direction: column; }
.fp-item {
  display: flex; align-items: center; gap: 6px; padding: 3px 4px; border-radius: 5px;
  font-size: 12.8px; cursor: pointer;
}
.fp-item:hover { background: #f2f8f6; }
.fp-item input { accent-color: var(--accent); }
.fp-item em { margin-left: auto; color: var(--muted); font-style: normal; font-size: 11.5px; }
.fp-foot { display: flex; gap: 6px; align-items: center; border-top: 1px solid var(--line-2); padding-top: 6px; }
.fp-hint { font-size: 11.5px; color: var(--muted); background: #f3f7f6; border-radius: 5px; padding: 3px 6px; }
.contains-pop .fp-body { padding: 4px 2px; }
.contains-pop .fp-text { width: 100%; }

/* ---------------------------------------------------------------- 进度备注显示 */
.step-note { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; }
.step-note .step-dot { width: 6px; height: 6px; border-radius: 50%; background: #c3d0d3; flex: none; }
.step-note .step-dot.run { background: #2d6a9f; }
.step-note .step-dot.done { background: var(--accent); }
.muted-row { opacity: .72; }

/* ---------------------------------------------------------------- 侧栏收起 */
.nav-toggle { flex: none; }
body.nav-collapsed .shell { grid-template-columns: 64px 1fr; }
body.nav-collapsed .brand-text,
body.nav-collapsed .nav-item span,
body.nav-collapsed .user-chip .who,
body.nav-collapsed .nav-group { display: none; }
body.nav-collapsed .sidebar { padding-left: 8px; padding-right: 8px; align-items: center; }
body.nav-collapsed .brand { padding: 2px 0 14px; }
body.nav-collapsed .nav-item { justify-content: center; padding: 9px 0; }
body.nav-collapsed .user-chip { justify-content: center; padding: 6px 0; }

/* 财务快捷筛选 */
.seg { display: inline-flex; background: #eef3f3; border-radius: 20px; padding: 2px; }
.seg-btn {
  border: 0; background: transparent; padding: 4px 11px; border-radius: 18px; cursor: pointer;
  font-size: 12.5px; color: var(--ink-2);
}
.seg-btn.on { background: #fff; color: var(--accent); box-shadow: var(--shadow-1); font-weight: 600; }

/* 新建订单时的船头版快捷选择 */
.new-setup {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 9px 18px; background: #f2f8f6; border-bottom: 1px solid #dcebe5;
}
.new-setup .ns-label { font-size: 13px; color: var(--ink-2); }
.new-setup .ns-hint { margin-left: auto; }

/* 复制来的订单 */
.copy-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 9px 18px; background: #fff8e6; border-bottom: 1px solid #f0e0b8;
  font-size: 13px; color: #7a5b12;
}
.copy-bar .cb-text { flex: 1; min-width: 180px; }
.copy-mark {
  display: inline-block; margin-left: 2px; padding: 0 4px; border-radius: 4px;
  font-size: 10px; line-height: 15px; color: #8a6410;
  background: #fdf1cf; border: 1px solid #eeda9c; vertical-align: middle;
}

/* 工厂单号旁的「打开本地订单」图标 */
.file-dot {
  border: 0; background: transparent; cursor: pointer; padding: 0 1px;
  line-height: 1; color: #8ba0a5; vertical-align: -2px;
  transition: color .15s, transform .15s;
}
.file-dot:hover { color: var(--accent); transform: translateY(-1px); }
.file-dot svg { display: block; }
.row-actions button svg { display: block; }
.file-row { display: flex; gap: 6px; align-items: center; margin-top: 6px; flex-wrap: wrap; }
.file-row .file-tip { flex: 1 1 160px; }

/* 抽屉里的保存提示 */
.saved-hint { font-size: 12px; color: var(--muted); margin-left: 10px; transition: color .2s; }
.saved-hint.flash { color: var(--accent); font-weight: 600; }

/* ---------------------------------------------------------------- 响应式 */
@media (max-width: 1100px) {
  .shell { grid-template-columns: 176px 1fr; }
  .searchbox input { width: 160px; }
}
@media (max-width: 860px) {
  body { font-size: 14px; }
  .shell { grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
  .sidebar { display: none; }
  .topbar { min-height: 50px; padding: 8px 12px; }
  .topbar h2 { font-size: 15px; }
  .toolbar { padding: 8px 10px; gap: 6px; }
  .searchbox { flex: 1; }
  .searchbox input { width: 100%; }
  .summary-pill { display: none; }
  .mobile-nav {
    display: flex; background: var(--card); border-top: 1px solid var(--line);
    padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); z-index: 20;
  }
  .mobile-nav button {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px;
    border: 0; background: none; color: var(--muted); font-size: 10.5px; cursor: pointer; border-radius: 8px;
  }
  .mobile-nav button .ico { font-size: 17px; line-height: 1; }
  .mobile-nav button.active { color: var(--accent); background: var(--accent-soft); }
  .table-scroll { display: none; }
  .pager { display: none; }
  .drawer { width: 100vw; top: 0; border-radius: 0; }
  .kv { grid-template-columns: 84px 1fr; }
  .step-row { grid-template-columns: 84px 1fr; }
  .mobile-only { display: block; }
  .desktop-only { display: none !important; }
  .modal { width: 100vw; max-height: 92vh; border-radius: 14px 14px 0 0; }
  .modal-mask { align-items: end; padding: 0; }
  .page-scroll { padding: 10px; }
  .perm-table { font-size: 11.5px; }
  .perm-table th, .perm-table td { padding: 4px 5px; }
  .toast-host { bottom: calc(74px + env(safe-area-inset-bottom)); }
}
@media (min-width: 861px) {
  .card-list { display: none; }
}

/* ---------------------------------------------------------------- 多级排序 */
.sort-ind { display: inline-flex; align-items: center; gap: 1px; font-size: 10px; color: var(--accent); margin-left: 2px; }
.sort-ind .sort-n {
  font-style: normal; font-size: 9px; line-height: 1; padding: 0 2px; border-radius: 3px;
  background: var(--accent); color: #fff; margin-left: 1px;
}
.btn .n {
  font-style: normal; margin-left: 4px; padding: 0 5px; border-radius: 8px;
  background: var(--accent); color: #fff; font-size: 10px;
}
.sort-chips { display: inline-flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.sort-chip {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 6px;
  background: #eef4fb; border: 1px solid #cfe0f3; color: #2c5b8a; font-size: 12px;
}
.sort-chip .x { cursor: pointer; color: #7d97b5; }
.sort-chip .x:hover { color: var(--danger); }
.sort-row {
  display: flex; align-items: center; gap: 8px; padding: 7px 2px;
  border-bottom: 1px solid var(--line-2);
}
.sort-row .sort-idx {
  width: 18px; height: 18px; border-radius: 50%; background: var(--accent); color: #fff;
  font-size: 11px; font-style: normal; display: inline-flex; align-items: center; justify-content: center;
  flex: none;
}
.sort-row .sort-name { flex: 1; min-width: 90px; }

/* ---------------------------------------------------------------- 加总 */
.btn.on { background: var(--accent); color: #fff; border-color: var(--accent); }
td.cell-sum-sel { background: #d9ecff !important; box-shadow: inset 0 0 0 1px #7fb4e8; }
table.grid.sum-mode td[data-fk] { cursor: cell; user-select: none; }
.sum-bar {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 16px; z-index: 70;
  display: flex; align-items: center; gap: 12px; padding: 9px 14px; max-width: 92vw;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow-2); font-size: 13px;
}
.sum-bar[hidden] { display: none; }
.sum-bar .sum-count { color: var(--muted); }
.sum-bar .sum-item {
  padding: 2px 10px; border-radius: 7px; background: #f2f8f6; border: 1px solid #d9e8e3;
  color: #2b5a4d; font-variant-numeric: tabular-nums;
}
.sum-bar .sum-item b { color: var(--ink); }
/* 快捷列的临时小提示（点一下就变，不弹窗） */
.cell-tip {
  position: fixed; z-index: 90; padding: 3px 9px; border-radius: 6px;
  background: rgba(31, 111, 92, .94); color: #fff; font-size: 12px;
  pointer-events: none; white-space: nowrap;
}
td[data-cell][title] { cursor: pointer; }
