/* 尚才办公 · 蓝白极简 · 多边形 */
:root {
  --blue-700: #1a3fb8;
  --blue-600: #1d4ed8;
  --blue-500: #2563eb;
  --blue-400: #4b83f0;
  --blue-100: #dbe7fe;
  --blue-50: #eff5ff;
  --ink: #0e1729;
  --ink-2: #33415c;
  --muted: #6b7a94;
  --line: #e3eaf5;
  --bg: #f5f8fe;
  --white: #ffffff;
  --danger: #d92d20;
  --danger-bg: #fef3f2;
  --ok: #067647;
  --ok-bg: #ecfdf3;
  --warn: #b54708;
  --warn-bg: #fffaeb;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow-1: 0 1px 2px rgba(14, 23, 41, 0.04), 0 10px 30px -18px rgba(14, 23, 41, 0.22);
  --shadow-2: 0 2px 6px rgba(14, 23, 41, 0.06), 0 20px 45px -24px rgba(14, 23, 41, 0.3);
  --sans: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", "Noto Sans CJK SC", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

/* 背景多边形装饰 */
.poly-layer {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}
.poly-layer i {
  position: absolute;
  display: block;
}
.poly-layer i:nth-child(1) {
  width: 520px; height: 520px;
  top: -220px; right: -140px;
  background: linear-gradient(140deg, var(--blue-100), rgba(219, 231, 254, 0));
  clip-path: polygon(50% 0%, 100% 38%, 82% 100%, 18% 100%, 0% 38%);
}
.poly-layer i:nth-child(2) {
  width: 320px; height: 320px;
  bottom: -140px; left: -90px;
  background: linear-gradient(320deg, rgba(75, 131, 240, 0.16), rgba(75, 131, 240, 0));
  clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
}
.poly-layer i:nth-child(3) {
  width: 180px; height: 180px;
  top: 42%; left: 6%;
  background: linear-gradient(200deg, rgba(37, 99, 235, 0.07), rgba(37, 99, 235, 0));
  clip-path: polygon(25% 3%, 75% 3%, 100% 50%, 75% 97%, 25% 97%, 0% 50%);
}

/* ---------- 布局 ---------- */
.wrap { position: relative; z-index: 1; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 22px;
  height: 60px;
  display: flex;
  align-items: center;
  gap: 26px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  /* 2026-09-25 无一：顶栏标签字号加大 25%（品牌 16→20、菜单 14→17.5、右侧账号 13→16.25）。
     顶栏是各页共用的，改这里全站生效；图标和 60px 的行高没动（字号变大后仍然放得下）。 */
  font-size: 20px;
  letter-spacing: 0.5px;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}
.brand .mark {
  width: 26px; height: 26px;
  background: linear-gradient(135deg, var(--blue-500), var(--blue-700));
  clip-path: polygon(50% 0%, 93% 25%, 93% 75%, 50% 100%, 7% 75%, 7% 25%);
}

.nav { display: flex; gap: 4px; flex: 1; }
.nav a {
  color: var(--ink-2);
  text-decoration: none;
  padding: 7px 13px;
  border-radius: 8px;
  font-size: 17.5px;
  transition: background 0.15s, color 0.15s;
}
.nav a:hover { background: var(--blue-50); color: var(--blue-600); }
.nav a.on { background: var(--blue-50); color: var(--blue-600); font-weight: 600; }

.who { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 16.25px; white-space: nowrap; }
.who .avatar {
  width: 28px; height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--blue-400), var(--blue-600));
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 600;
  font-size: 13px;
}

.page { max-width: 1180px; margin: 0 auto; padding: 26px 22px 70px; }
.page-head { margin-bottom: 20px; }
.page-head h1 { margin: 0 0 4px; font-size: 22px; letter-spacing: 0.3px; }
.page-head p { margin: 0; color: var(--muted); font-size: 13px; }

.grid { display: grid; gap: 18px; }
.grid.cols-2 { grid-template-columns: 1fr 1fr; }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 900px) { .grid.cols-2, .grid.cols-3 { grid-template-columns: 1fr; } }

/* ---------- 卡片 ---------- */
.card {
  position: relative;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
  padding: 20px;
  overflow: hidden;
}
.card.tight { padding: 16px; }
.card::after {
  content: "";
  position: absolute;
  top: 0; right: 0;
  width: 58px; height: 58px;
  background: linear-gradient(225deg, var(--blue-50), rgba(239, 245, 255, 0));
  clip-path: polygon(100% 0, 100% 100%, 0 0);
  pointer-events: none;
}
.card h2 {
  margin: 0 0 14px;
  font-size: 15px;
  font-weight: 650;
  display: flex;
  align-items: center;
  gap: 8px;
}
.card h2 .dot {
  width: 8px; height: 8px;
  background: var(--blue-500);
  clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
}
.hint { color: var(--muted); font-size: 12.5px; margin: 6px 0 0; }

/* ---------- 表单 ---------- */
/* 用 .field 而不是 label.field：选文稿那一块里面套着日期框和列表，
   再用 <label> 包着，点列表里的文稿会顺带把日期框点亮（label 会激活里面第一个表单控件） */
.field { display: block; margin-bottom: 14px; }
.field > span {
  display: block;
  font-size: 13px;
  color: var(--ink-2);
  margin-bottom: 6px;
  font-weight: 550;
}
input[type="text"], input[type="password"], input[type="number"], input[type="date"], textarea, select {
  width: 100%;
  font-family: inherit;
  font-size: 14px;
  color: var(--ink);
  background: #fbfdff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--blue-400);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(75, 131, 240, 0.14);
}
textarea { resize: vertical; min-height: 90px; line-height: 1.7; }
textarea.mono { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 13px; }
.row { display: flex; gap: 12px; }
.row > * { flex: 1; }
.row.narrow > * { flex: 0 0 auto; }

/* ---------- 筛选条 / 分页脚 ---------- */
/* 筛日期、筛账号这类小条件：一行放得下就一行，放不下自动换行 */
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.filters .f { display: flex; flex-direction: column; gap: 4px; }
.filters label { font-size: 12.5px; color: var(--muted); }
.filters .grow { flex: 1; min-width: 180px; }
/* 列表看完了要看下一段时，按钮居中放在列表底下（放在滚动区里面就得先滚到底才看得见） */
.page-foot { margin-top: 10px; text-align: center; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 550;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.15s, background 0.15s, opacity 0.15s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary {
  background: linear-gradient(135deg, var(--blue-500), var(--blue-700));
  color: #fff;
  box-shadow: 0 6px 16px -8px rgba(29, 78, 216, 0.7);
}
.btn-primary:hover:not(:disabled) { box-shadow: 0 10px 22px -10px rgba(29, 78, 216, 0.8); }
.btn-ghost { background: #fff; border-color: var(--line); color: var(--ink-2); }
.btn-ghost:hover:not(:disabled) { border-color: var(--blue-400); color: var(--blue-600); }
.btn-quiet { background: transparent; color: var(--muted); padding: 6px 10px; font-size: 13px; }
.btn-quiet:hover { color: var(--blue-600); background: var(--blue-50); }
.btn-danger { background: var(--danger-bg); color: var(--danger); border-color: #fecdca; }
.btn-danger:hover:not(:disabled) { background: #fee4e2; }
/* 破坏性操作的确认按钮：实心红。「删除」点下去找不回来，不能跟「保存」长成一个样 */
.btn-danger-solid { background: linear-gradient(135deg, #e5483d, var(--danger)); color: #fff; box-shadow: 0 6px 16px -8px rgba(217, 45, 32, 0.65); }
.btn-danger-solid:hover:not(:disabled) { box-shadow: 0 10px 22px -10px rgba(217, 45, 32, 0.8); }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-block { width: 100%; }

/* ---------- 上传区 ---------- */
.drop {
  border: 1.5px dashed #c5d7f5;
  border-radius: var(--radius);
  background: linear-gradient(180deg, #fbfdff, var(--blue-50));
  padding: 30px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.drop:hover, .drop.over { border-color: var(--blue-500); background: var(--blue-50); }
.drop .glyph {
  width: 44px; height: 44px;
  margin: 0 auto 10px;
  background: linear-gradient(135deg, var(--blue-400), var(--blue-600));
  clip-path: polygon(50% 0%, 93% 25%, 93% 75%, 50% 100%, 7% 75%, 7% 25%);
}
.drop b { display: block; font-size: 14.5px; margin-bottom: 3px; }
.drop small { color: var(--muted); font-size: 12.5px; }

/* ---------- 列表 ---------- */
.list { display: flex; flex-direction: column; gap: 10px; }
.item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 15px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.12s;
}
.item:hover { border-color: var(--blue-400); box-shadow: var(--shadow-1); }
.item.on { border-color: var(--blue-500); background: var(--blue-50); }
.item .idx {
  width: 30px; height: 30px;
  flex: 0 0 30px;
  border-radius: 8px;
  background: var(--blue-50);
  color: var(--blue-600);
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 600;
}
.item.on .idx { background: #fff; }
.item .body { flex: 1; min-width: 0; }
.item .body b { display: block; font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .body span { color: var(--muted); font-size: 12.5px; }
.item .acts { display: flex; gap: 6px; align-items: center; flex: 0 0 auto; }

.tag {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 550;
  line-height: 1.7;
}
.tag.ok { background: var(--ok-bg); color: var(--ok); }
.tag.warn { background: var(--warn-bg); color: var(--warn); }
.tag.bad { background: var(--danger-bg); color: var(--danger); }
.tag.gray { background: #f1f5f9; color: var(--muted); }
.tag.blue { background: var(--blue-50); color: var(--blue-600); }

/* ---------- 文案结果 ---------- */
.result {
  white-space: pre-wrap;
  word-break: break-word;
  background: linear-gradient(180deg, #fbfdff, var(--blue-50));
  border: 1px solid var(--blue-100);
  border-radius: var(--radius);
  padding: 18px;
  font-size: 15px;
  line-height: 1.9;
  min-height: 120px;
}
.result.empty { color: var(--muted); font-size: 13.5px; display: grid; place-items: center; text-align: center; }
.result.flagged { border-color: #fecdca; background: linear-gradient(180deg, #fffbfa, var(--danger-bg)); }
.meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; color: var(--muted); font-size: 12.5px; }

.spinner {
  width: 14px; height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.spinner.dark { border-color: var(--blue-100); border-top-color: var(--blue-500); }
@keyframes spin { to { transform: rotate(360deg); } }

.loading-box {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--blue-600);
  font-size: 13.5px;
  padding: 18px;
  background: var(--blue-50);
  border-radius: var(--radius);
}

/* ---------- 登录页 ---------- */
.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; position: relative; z-index: 1; }
.login-card {
  width: 100%;
  max-width: 400px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow-2);
  padding: 34px 30px 30px;
  position: relative;
  overflow: hidden;
}
.login-card::before {
  content: "";
  position: absolute;
  top: -70px; right: -70px;
  width: 190px; height: 190px;
  background: linear-gradient(140deg, var(--blue-100), rgba(219, 231, 254, 0));
  clip-path: polygon(50% 0%, 100% 38%, 82% 100%, 18% 100%, 0% 38%);
}
.login-card .mark {
  width: 42px; height: 42px;
  margin-bottom: 16px;
  background: linear-gradient(135deg, var(--blue-500), var(--blue-700));
  clip-path: polygon(50% 0%, 93% 25%, 93% 75%, 50% 100%, 7% 75%, 7% 25%);
}
.login-card h1 { margin: 0 0 4px; font-size: 20px; }
.login-card p.sub { margin: 0 0 22px; color: var(--muted); font-size: 13px; }

/* ---------- 表格 ---------- */
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.tbl th, table.tbl td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); }
table.tbl th { color: var(--muted); font-weight: 550; font-size: 12.5px; background: #fafcff; }
table.tbl tr:last-child td { border-bottom: none; }

/* ---------- toast / 提示 ---------- */
#toasts {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}
.toast {
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 13.5px;
  background: var(--ink);
  color: #fff;
  box-shadow: var(--shadow-2);
  animation: pop 0.2s ease-out;
  max-width: 80vw;
}
.toast.ok { background: #067647; }
.toast.bad { background: #b42318; }
@keyframes pop { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

.notice {
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 14px;
}
.notice.info { background: var(--blue-50); color: var(--blue-700); border: 1px solid var(--blue-100); }
.notice.warn { background: var(--warn-bg); color: var(--warn); border: 1px solid #fedf89; }
.notice.bad { background: var(--danger-bg); color: var(--danger); border: 1px solid #fecdca; }

.empty-tip { text-align: center; color: var(--muted); padding: 34px 16px; font-size: 13.5px; }

.sep { height: 1px; background: var(--line); margin: 20px 0; }

.mt8 { margin-top: 8px; } .mt14 { margin-top: 14px; } .mt20 { margin-top: 20px; }
.mb0 { margin-bottom: 0; }
.flex { display: flex; align-items: center; gap: 10px; }
.flex.between { justify-content: space-between; }
.flex.wrap { flex-wrap: wrap; }
.grow { flex: 1; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.right { text-align: right; }
.hidden { display: none !important; }

/* 备案号：工信部要求已备案网站在首页底部标注备案号并链接到备案系统。
   放在登录页（未登录时打开网站看到的就是它），绝对定位钉在底部，不影响卡片居中 */
.site-foot {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 18px;
  text-align: center;
  font-size: 12.5px;
  color: var(--muted);
  z-index: 1;
}
.site-foot a { color: var(--muted); text-decoration: none; }
.site-foot a:hover { text-decoration: underline; }

/* ============================================================
   后勤：组件规格集中定义，数据页与设置页仅通过变量表达尺寸差异
   四条原则：
     ① 格子就是格子 —— 值和编辑框占同一个盒，不要「圆角灰盒子」那种表单感
     ② 不露浏览器原生控件 —— 下拉箭头、文件选择框、滚动条、details 三角全部自绘
     ③ 状态用颜色说话 —— 下拉值渲染成彩色标签，一眼扫出「待发货」和「已签收」
     ④ 只作用在后勤两页 —— 站里其它页面（文稿库/生成文案/客户生日/设置/账号）外观一个字不动
   注意：写 `table.tbl td` 的重叠规则时选择器要够重，否则被基础表格样式压过去。
   ============================================================ */

.lg-page, .lg-dialog {
  /* 自绘的下拉箭头：内联 SVG，不引外部资源、不发外网请求 */
  --lg-caret: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' fill='none' stroke='%236b7a94' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  --lg-caret-on: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' fill='none' stroke='%232563eb' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

/* 原生下拉的灰盒子和系统箭头是最露怯的地方，后勤这两页统一换成自绘的 */
.lg-page select, .lg-dialog select {
  -webkit-appearance: none; appearance: none;
  background-image: var(--lg-caret);
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 10px 7px;
  padding-right: 30px;
}
.lg-page select:focus, .lg-dialog select:focus { background-image: var(--lg-caret-on); }

/* ---------- 页面骨架 ---------- */
.lg-page {
  max-width: 1500px;
  --lg-grid: #c9d8ec;
  --lg-frame: #aebfd8;
  --line: var(--lg-grid);
  --radius-sm: 8px;
  --lg-space-x: 24px;
}
.lg-rows {
  font-size: 16px;
  --lg-table-font: 18px;
  --lg-head-font: 17px;
  --lg-owner-width: 144px;
  --lg-cell-min: 200px;
  --lg-cell-max: 486px;
  --lg-cell-height: 52px;
  --lg-cell-pad: 12px 16px;
  --lg-head-pad: 12px 16px;
  --lg-textarea-height: 148px;
  --lg-chip-font: 16px;
  --lg-mini-font: 14px;
  --lg-check-width: 48px;
}
.lg-page .page-head { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.lg-page .page-head .back { text-decoration: none; }
/* 表格字号三档（2026-09-29 无一定的数）。中档＝上面 .lg-rows 里那四个值，就是线上原来的样子。
   ⚠️ 这两个块里只许出现字号变量。--lg-cell-min / --lg-cell-height / --lg-cell-pad /
   --lg-owner-width 都是照中档调好的；跟着一起放大就会重演 2026-09-26 那次
   「字大了，列宽内边距按钮弹窗也跟着大，表格从一屏刚好变成要横滑 243px」。
   字号只由 data-lg-font 这一个属性决定，改档位不写行内样式，好查也好测。 */
.lg-rows[data-lg-font="large"] { --lg-table-font: 21px; --lg-head-font: 19px; --lg-chip-font: 18px; --lg-mini-font: 16px; }
.lg-rows[data-lg-font="small"] { --lg-table-font: 14px; --lg-head-font: 13px; --lg-chip-font: 12px; --lg-mini-font: 12px; }
.lg-page .card::after { content: none; }
.lg-rows .btn { font-size: 16px; min-height: 40px; padding: 8px 16px; }
.lg-rows .lg-act { font-size: 16px; }
.lg-rows .lg-toolbar input, .lg-rows .lg-toolbar select {
  font-size: 16px; height: 40px; padding: 8px 16px;
}
.lg-rows .lg-toolbar select { padding-right: 32px; }
.lg-rows .card { padding: 0; overflow: visible; }
.lg-page .page-head .back { margin-left: auto; align-self: center; }
/* 字号选择器摆在页面最上面一排的右边，跟「后勤设置」同一组。
   控件自己不跟着表格字号走 —— 选了「小」连按钮一起缩，下次就点不准了。 */
.lg-page .page-head .lg-head-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.lg-page .page-head .lg-head-right .back { margin-left: 0; }
.lg-font-pick { display: inline-flex; border: 1px solid var(--lg-frame); border-radius: 10px; overflow: hidden; background: #fff; }
.lg-font-pick button { display: flex; align-items: center; justify-content: center; min-height: 40px; padding: 0 16px; border: 0; background: transparent; color: var(--ink-2); font: inherit; font-size: 15px; line-height: 1; cursor: pointer; }
.lg-font-pick button + button { border-left: 1px solid var(--lg-frame); }
.lg-font-pick button:hover:not(:disabled) { background: #eff5ff; color: #1d4ed8; }
.lg-font-pick button.on { background: #2563eb; color: #fff; }
.lg-font-pick button:focus-visible { outline: 2px solid var(--blue-500); outline-offset: -3px; }
.lg-font-pick button:disabled { color: var(--muted); background: #f7f9fc; cursor: not-allowed; }
.lg-font-pick button.on:disabled { background: #c7d7f2; color: #fff; }

/* ---------- 工具栏：左边筛选、右边操作，中间留白分开 ---------- */
.lg-toolbar {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 16px;
  padding: 16px var(--lg-space-x); border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #fbfdff, #fff);
}
.lg-tools { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.lg-tools.right { margin-left: auto; }
.lg-tools .f { display: flex; flex-direction: column; gap: 5px; }
.lg-tools label { font-size: 14px; color: var(--muted); letter-spacing: .2px; }
.lg-tools .search { min-width: 230px; }
.lg-divider { width: 1px; align-self: stretch; background: var(--line); margin: 2px 2px; }

/* 项目备注：贴在工具栏下面、表格上面，跟两边都分开 */
.lg-note {
  margin: 0; padding: 8px var(--lg-space-x); font-size: 14px; color: var(--ink-2);
  background: #f7faff; border-bottom: 1px solid var(--line);
}
.lg-note:empty { display: none; }

/* ---------- 表格 ---------- */
.lg-scroll { overflow: auto; max-height: 65vh; overscroll-behavior: contain; background: #fff; }
/* 滚动条也换成自绘的，浏览器默认那条灰杠在浅色页面上很突兀 */
.lg-scroll::-webkit-scrollbar { width: 11px; height: 11px; }
.lg-scroll::-webkit-scrollbar-track { background: #fff; }
.lg-scroll::-webkit-scrollbar-thumb { background: #cfdcf1; border: 3px solid #fff; border-radius: 8px; }
.lg-scroll::-webkit-scrollbar-thumb:hover { background: #aac1e6; }
.lg-scroll::-webkit-scrollbar-corner { background: #fff; }

/* 表格底栏：左边说到第几行了，右边是「看更多」 */
.lg-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px var(--lg-space-x); border-top: 1px solid var(--line); background: #fcfdff;
}
.lg-foot .muted { font-size: 14px; }
.lg-foot .muted:empty { display: none; }

table.lg-table { border-collapse: separate; border-spacing: 0; font-size: var(--lg-table-font, 13.5px); border: 1px solid var(--lg-frame); }
/* 主表随页面滚动；弹窗中的预览仍使用其原有的独立滚动区域。 */
.lg-page .lg-scroll { overflow: visible; max-height: none; overscroll-behavior: auto; }
/* ⚠️ 选择器必须带两层类（.lg-page .lg-table），否则压不过基础表格规则 `table.tbl th`：
   那条是「1 个类 + 2 个元素」，比 `.lg-table th` 更重，底色/字色/字重会被它盖掉。
   2026-09-24 用 Chrome 计算样式实测发现的 —— 光看代码看不出来，表头改了半天没生效。 */
.lg-page .lg-table th {
  position: sticky; top: var(--lg-header-top, 60px); z-index: 3; white-space: nowrap;
  background: #f1f6ff; color: var(--ink-2); font-weight: 600; font-size: var(--lg-head-font, 12.5px); padding: var(--lg-head-pad, 10px 12px);
  letter-spacing: .3px; border-bottom: 1px solid var(--lg-frame);
}
.lg-page .lg-table td { border-bottom: 1px solid var(--lg-grid); background: #fff; }
.lg-table th + th, .lg-table td + td { border-left: 1px solid var(--lg-grid); }
/* 行悬停：列一多横着看很容易串行，鼠标停在哪一行必须一眼看出来 */
.lg-setup .lg-table tbody tr:hover td { background: #f8fbff; }
/* 同一行的固定列和普通格读取同一底色；状态按优先级在后文覆盖。 */
.lg-rows .lg-table tbody tr { --lg-row-bg: #fff; }
.lg-rows .lg-table tbody tr:nth-child(even) { --lg-row-bg: #eef3fb; }
.lg-rows .lg-table tbody tr:hover { --lg-row-bg: #e3eefc; }
.lg-rows .lg-table tbody tr.lg-row-selected { --lg-row-bg: #d9e9ff; }
.lg-rows .lg-table tbody tr td { background: var(--lg-row-bg); }

/* 业务员列吸附在左边，横向滚动时不跟着跑掉 */
.lg-table .lg-owner {
  position: sticky; left: 0; z-index: 2; background: #fff; min-width: var(--lg-owner-width, 126px);
  font-weight: 550; color: var(--ink-2); padding: 0 10px;
}
.lg-table th.lg-owner { z-index: 4; background: #edf4ff; }
/* 管理员在业务员格里看到的代录下拉：做成悬停才显形的轻量控件，别像个灰盒子杵在那儿 */
.lg-table .lg-owner select {
  -webkit-appearance: none; appearance: none;
  width: 100%; margin: 0; padding: 5px 20px 5px 6px; border: 0; border-radius: 6px;
  background-color: transparent; background-image: var(--lg-caret);
  background-repeat: no-repeat; background-position: right 4px center; background-size: 9px 6px;
  font: inherit; color: inherit; cursor: pointer;
  transition: background-color .14s;
}
.lg-table .lg-owner select:hover { background-color: #dbe9ff; }

/* ---------- 单元格：值和平铺的编辑框占同一个盒 ---------- */
/* 选择器要压过 `table.tbl td`，所以带上 .lg-table */
.lg-table .lg-cell { padding: 0; min-width: var(--lg-cell-min, 165px); max-width: var(--lg-cell-max, 360px); position: relative; cursor: text; vertical-align: top; height: var(--lg-cell-height, 38px); }
.lg-cell .lg-value { display: block; padding: var(--lg-cell-pad, 9px 12px); line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
/* 蓝框只有一处来源：格子内那 2px 描边。格子自己不再画 outline —— 否则悬浮、选中、
   输入框聚焦三处各画各的，鼠标一点蓝框就换一个大小，看着像跳了一下。
   外圈 outline 只留给键盘用户（:focus-visible），鼠标点出来的焦点不画。 */
.lg-cell:focus { outline: none; }
.lg-cell:focus-visible { outline: 2px solid var(--blue-500); outline-offset: -2px; }
/* 编辑控件脱离表格布局；隐藏的原值保留原来的宽高，多行控件向下展开。 */
.lg-cell input, .lg-cell select, .lg-cell textarea {
  position: absolute; inset: 0; z-index: 2; box-sizing: border-box;
  display: block; width: 100%; min-width: 0; margin: 0; padding: var(--lg-cell-pad, 9px 12px); height: 100%;
  border: 0; border-radius: 0; background: #fff; color: var(--ink);
  font-family: inherit; font-size: var(--lg-table-font, 13.5px); outline: none;
  box-shadow: inset 0 0 0 2px var(--blue-500);
}
.lg-cell textarea { min-height: var(--lg-textarea-height, 110px); resize: vertical; line-height: 1.7; }
/* 单行文字列用的多行框：高度由脚本按内容算（Alt+Enter 换行要靠它），
   所以不吃上面那个 110px 的固定高度，也不给拖拽改大小的把手。 */
.lg-cell textarea.lg-cell-grow { min-height: 0; resize: none; overflow: hidden; line-height: 1.6; }
.lg-cell select { background-image: var(--lg-caret); background-repeat: no-repeat; background-position: right 10px center; background-size: 10px 7px; padding-right: 28px; }

/* 数字和金额右对齐 + 等宽数字：账目表比大小靠对齐，不靠眼睛量。
   表头也要跟着右对齐，否则表头字和数据错开，一眼看过去是歪的。 */
.lg-table th.lg-num { text-align: right; }
.lg-cell.lg-num .lg-value { text-align: right; font-variant-numeric: tabular-nums; }
.lg-cell.lg-num input { text-align: right; font-variant-numeric: tabular-nums; }

/* 操作列：靠右收窄，不跟数据列抢宽度 */
.lg-table th:last-child, .lg-table td:last-child { text-align: right; white-space: nowrap; width: 1%; }

/* 状态标签：让「待发货」和「已签收」不用逐字读 */
.lg-chip { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: var(--lg-chip-font, 12.5px); font-weight: 550; line-height: 1.7; white-space: nowrap; }
.lg-chip.ok { background: var(--ok-bg); color: var(--ok); box-shadow: inset 0 0 0 1px #abefc6; }
.lg-chip.warn { background: var(--warn-bg); color: var(--warn); box-shadow: inset 0 0 0 1px #fedf89; }
.lg-chip.bad { background: var(--danger-bg); color: var(--danger); box-shadow: inset 0 0 0 1px #fecdca; }
.lg-chip.info { background: var(--blue-50); color: var(--blue-600); box-shadow: inset 0 0 0 1px var(--blue-100); }
.lg-chip.mute { background: #f4f6fa; color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); }

/* 格子里的「复制 / 拨号」：平时淡出，鼠标停到这一行才出现，别让每个格子都挂个按钮 */
.lg-mini {
  border: 0; background: transparent; color: var(--muted); font: inherit; font-size: var(--lg-mini-font, 12px);
  padding: 2px 6px; border-radius: 6px; cursor: pointer;
  opacity: 0; transition: opacity .14s, background .14s, color .14s;
}
.lg-table tbody tr:hover .lg-mini, .lg-cell:focus-within .lg-mini { opacity: 1; }
.lg-mini:hover { background: var(--blue-50); color: var(--blue-600); }
@media (hover: none) { .lg-mini { opacity: 1; } }   /* 触摸屏没有悬停，一直显示 */

/* ---------- 单元格的保存状态 ---------- */
.lg-required { color: var(--danger); font-weight: 400; }
.lg-cell.lg-saving::after {
  content: ''; position: absolute; z-index: 3; right: 6px; top: 6px; width: 10px; height: 10px;
  border: 2px solid var(--blue-100); border-top-color: var(--blue-500);
  border-radius: 50%; animation: spin .7s linear infinite;
}
.lg-rows .lg-table tbody tr td.lg-saved { background: var(--ok-bg); transition: background .3s; }
.lg-cell.lg-error { box-shadow: inset 0 0 0 2px var(--danger); }

/* ---------- 空状态 ---------- */
.lg-empty { text-align: center; padding: 56px 24px 60px; }
.lg-empty .glyph { width: 54px; height: 54px; margin: 0 auto 16px; opacity: .26; }
.lg-empty h3 { margin: 0 0 8px; font-size: 16px; }
.lg-empty p { margin: 0 auto 20px; max-width: 440px; color: var(--muted); font-size: 13px; line-height: 1.8; }
/* 表格里的空状态（后台两页用） */
.lg-table td.lg-empty-cell { padding: 34px 16px; text-align: center; color: var(--muted); font-size: 13px; }

/* ---------- 后台设置页的操作列 ---------- */
/* 卡片头：标题在左、主操作按钮推到右边，跟表格用一条线分开 */
.lg-setup .card { padding: 0; overflow: visible; }
.lg-card-head {
  display: flex; align-items: center; gap: 12px; padding: 14px 18px;
  border-bottom: 1px solid var(--line); background: linear-gradient(180deg, #fbfdff, #fff);
}
.lg-card-head h2 { margin: 0; font-size: 15px; }
.lg-card-head .btn { margin-left: auto; }

.lg-acts { display: flex; gap: 4px; flex-wrap: nowrap; justify-content: flex-end; }
.lg-act {
  border: 0; background: transparent; font: inherit; font-size: 12.5px; font-weight: 550;
  color: var(--blue-600); padding: 4px 9px; border-radius: 6px; cursor: pointer; white-space: nowrap;
  transition: background .14s, color .14s;
}
.lg-act:hover:not(:disabled) { background: var(--blue-50); }
.lg-act.danger { color: var(--danger); }
.lg-act.danger:hover:not(:disabled) { background: var(--danger-bg); }
.lg-act.plain { color: var(--ink-2); }
.lg-act.plain:hover:not(:disabled) { background: #f2f5fa; }
.lg-act:disabled { color: #bec9db; cursor: not-allowed; }
/* 状态列的小标签 */
.lg-tag { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 550; }
.lg-tag.on { background: var(--ok-bg); color: var(--ok); box-shadow: inset 0 0 0 1px #abefc6; }
.lg-tag.off { background: #f4f6fa; color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); }
/* 排序格：数字后面跟上下移的小箭头 */
.lg-sort { display: inline-flex; align-items: center; gap: 1px; color: var(--muted); font-variant-numeric: tabular-nums; }
.lg-sort .lg-act { font-size: 13px; padding: 2px 7px; }

/* ---------- 弹窗 ---------- */
.lg-dialog {
  width: min(880px, 94vw); max-height: 90vh; overflow: auto; padding: 26px 28px;
  border: 0; border-radius: 18px; color: var(--ink); box-shadow: var(--shadow-2);
}
.lg-dialog::backdrop { background: rgb(14 23 41 / 42%); }
.lg-dialog h2 { margin: 0 0 6px; font-size: 18px; }
.lg-dialog > .hint { margin: 0 0 16px; }
/* 站内确认框（common.js 的 askConfirm）：比导入那种大弹窗小得多 —— 一行标题、一句话、两个按钮。
   按钮靠右，「取消」在左、「确认」在右。焦点默认落在「确认」上（2026-09-24 无一定：
   回车要等于确定，跟浏览器原生 confirm 一个手感；想反悔点「取消」或按 Esc） */
.lg-dialog.lg-confirm { width: min(420px, 92vw); padding: 22px 24px; border-radius: 16px; }
.lg-confirm h2 { margin: 0 0 6px; font-size: 17px; }
.lg-confirm-text { margin: 0; color: var(--ink-2); font-size: 13.5px; line-height: 1.7; }
.lg-confirm-text:empty { display: none; }
.lg-confirm-btns { display: flex; justify-content: flex-end; align-items: center; gap: 10px; margin-top: 20px; }
.lg-dialog .lg-scroll { max-height: 38vh; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.lg-dialog .tbl { font-size: 13px; }
.lg-warnings { max-height: 180px; overflow: auto; }
.lg-dialog input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--blue-500); cursor: pointer; }
.lg-dialog .flex label { display: flex; align-items: center; gap: 7px; font-size: 13.5px; color: var(--ink-2); cursor: pointer; }

/* 数据页弹窗只指定文字规格，不再以高优先级覆盖确认框的专属宽度。 */
body:has(.lg-page) .lg-dialog { --line: #c9d8ec; --radius-sm: 8px; }
body:has(.lg-rows) .lg-dialog { font-size: 16px; }
body:has(.lg-rows) .lg-dialog h2 { font-size: 20px; }
body:has(.lg-rows) .lg-dialog :is(.hint, .lg-confirm-text, label, .btn, input, select, .tbl) { font-size: 16px; }
body:has(.lg-rows) .lg-dialog .tbl th { font-size: 17px; }
body:has(.lg-rows) .lg-dialog :is(.btn, input:not([type="checkbox"]), select, .tbl th, .tbl td) { padding: 10px 16px; }

/* 文件选择框：浏览器原生那个按钮最露怯，整个换成虚线投放区 */
.lg-file {
  display: block; width: 100%; padding: 16px; margin: 4px 0 14px; cursor: pointer;
  border: 1.5px dashed #c6d8f6; border-radius: var(--radius-sm); background: #fbfdff;
  color: var(--muted); font-family: inherit; font-size: 13px;
  transition: border-color .15s, background .15s;
}
.lg-file:hover { border-color: var(--blue-400); background: var(--blue-50); }
.lg-file::file-selector-button {
  font-family: inherit; font-size: 13.5px; font-weight: 550; color: #fff; cursor: pointer;
  background: linear-gradient(135deg, var(--blue-500), var(--blue-700));
  border: 0; border-radius: var(--radius-sm); padding: 8px 16px; margin-right: 12px;
}
.lg-file::-webkit-file-upload-button {
  font-family: inherit; font-size: 13.5px; font-weight: 550; color: #fff; cursor: pointer;
  background: linear-gradient(135deg, var(--blue-500), var(--blue-700));
  border: 0; border-radius: var(--radius-sm); padding: 8px 16px; margin-right: 12px;
}

/* details 的原生三角也换掉 */
.lg-dialog details { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; }
.lg-dialog summary { display: flex; align-items: center; gap: 7px; cursor: pointer; list-style: none; font-size: 13px; font-weight: 550; color: var(--ink-2); }
.lg-dialog summary::-webkit-details-marker { display: none; }
.lg-dialog summary::before {
  content: ''; width: 0; height: 0; flex: none;
  border-left: 5px solid var(--muted); border-top: 4px solid transparent; border-bottom: 4px solid transparent;
  transition: transform .15s;
}
.lg-dialog details[open] summary::before { transform: rotate(90deg); }

/* 勾选列的那一行 */
.lg-column-choice { display: flex; align-items: center; gap: 8px; padding: 9px 4px; border-bottom: 1px solid var(--line); }
.lg-column-choice:last-child { border-bottom: 0; }
.lg-column-choice label { flex: 1; display: flex; align-items: center; gap: 9px; cursor: pointer; font-size: 13.5px; }
.lg-column-choice .dim { color: var(--muted); font-size: 12.5px; }

@media (max-width: 760px) {
  /* 导航新增一项后允许换行；不能把窄屏页面整体撑宽，只有数据表横向滚动。 */
  .topbar-inner { height: auto; min-height: 60px; padding: 10px 12px; gap: 8px; flex-wrap: wrap; }
  .topbar-inner .nav { order: 3; flex-basis: 100%; overflow-x: auto; white-space: nowrap; }
  .topbar-inner .who { margin-left: auto; }
  .nav a { padding: 6px 9px; }

}


/* 后勤页码和批量管理；规则限制在后勤数据页及其专用弹窗。 */
.lg-rows .lg-selection-tools { display:flex; flex-wrap:wrap; gap:8px; align-items:center; padding:12px var(--lg-space-x); font-size:14px; }
.lg-rows .lg-select-col { position:sticky; left:0; z-index:2; min-width:var(--lg-check-width); width:var(--lg-check-width); max-width:var(--lg-check-width); padding:10px; text-align:center; background:#f3f7fd; }
.lg-rows .lg-table th.lg-select-col { z-index:5; background:#edf4ff; }
.lg-rows .lg-table .lg-owner { left:var(--lg-check-width); }
.lg-rows .lg-check { appearance:none; -webkit-appearance:none; width:24px; height:24px; min-width:24px; padding:0; margin:0; border:1.5px solid #a7b8d1; border-radius:5px; background:#fff; vertical-align:middle; cursor:pointer; display:inline-grid; place-content:center; }
.lg-rows .lg-check:checked, .lg-rows .lg-check:indeterminate { background:#2563eb; border-color:#2563eb; }
.lg-rows .lg-check:checked::after { content:''; width:8px; height:4px; border-left:2px solid #fff; border-bottom:2px solid #fff; transform:rotate(-45deg) translateY(-1px); }
.lg-rows .lg-check:indeterminate::after { content:''; width:8px; border-bottom:2px solid #fff; }
.lg-rows .lg-check:focus-visible { outline:3px solid #93c5fd; outline-offset:2px; }
/* 按页面中的实际邻居隐藏内部网格和蓝线；保留边框宽度，选择时不触发布局变化。
   lg-edge-* 保留既有口径，lg-join-* 只负责相邻选中格的视觉合并。 */
.lg-rows .lg-table tbody tr td.lg-cell-selected {
  background:#dbeafe; box-shadow:none;
  --lg-outline-t: #3b82f6; --lg-outline-b: #3b82f6;
  --lg-outline-l: #3b82f6; --lg-outline-r: #3b82f6;
}
/* 覆盖 1px 的左/下表格边框区域，避免外圈在相邻格接缝处断开。 */
.lg-rows .lg-table tbody tr td.lg-cell-selected::before {
  content: ''; position: absolute; inset: 0 0 -1px -1px; pointer-events: none;
  box-shadow: inset 0 2px 0 0 var(--lg-outline-t), inset 0 -2px 0 0 var(--lg-outline-b),
    inset 2px 0 0 0 var(--lg-outline-l), inset -2px 0 0 0 var(--lg-outline-r);
}
.lg-rows .lg-table tbody tr td.lg-cell-selected.lg-join-t { border-top-color:transparent; --lg-outline-t: transparent; }
.lg-rows .lg-table tbody tr td.lg-cell-selected.lg-join-b { border-bottom-color:transparent; --lg-outline-b: transparent; }
.lg-rows .lg-table tbody tr td.lg-cell-selected.lg-join-l { border-left-color:transparent; --lg-outline-l: transparent; }
.lg-rows .lg-table tbody tr td.lg-cell-selected.lg-join-r { border-right-color:transparent; --lg-outline-r: transparent; }
/* 保存失败的格子底色转红，但选中时蓝框还在 —— 两个信号都要看得见 */
.lg-rows .lg-table tbody tr td.lg-error { background:#fee4e2; }
.lg-rows .lg-selecting, .lg-rows .lg-cell-mode { user-select:none; }
.lg-rows .lg-cell-mode .lg-cell, .lg-rows .lg-select-col { touch-action:none; }
.lg-rows .lg-cell-mode .lg-cell { cursor:crosshair; }
/* 拖选时鼠标是十字，正在拖的格子组也别选中文字 */
.lg-rows .lg-dragging, .lg-rows .lg-dragging .lg-cell { cursor:crosshair !important; user-select:none; }
.lg-rows [aria-pressed="true"] { background:#dbeafe; color:#1d4ed8; }
/* 批量操作条：跟着选区就近浮出来 —— 选区下沿优先，下面放不下就翻到上沿，
   横向跟着选区左缘。位置和可见范围全由 js 算（placeOverlayNear，视口坐标 + 固定定位）。
   2026-09-26 第十轮改回来的：9/26 晚第九轮定的是「永远待在表格框外面」，
   结果表格一长、选区在中间，条子被推到表格上边线或下边线，离选区老远，点不到。
   现在唯一不许压的是**选中的那些格子**；旁边没选的格子可以让条子压住。 */
#tableWrap { position:relative; }
.lg-rows .lg-batch-bar { position:fixed; z-index:7; left:0; top:0; right:auto; bottom:auto; box-sizing:border-box; width:max-content; max-width:calc(100vw - 16px); overflow:auto; padding:8px 12px; margin:0; display:flex; flex-wrap:wrap; align-items:center; gap:8px; border:1px solid var(--lg-grid); border-radius:12px; background:#fff; box-shadow:0 8px 24px #1e40af1f; }
/* 「标注」弹窗也从选中的格子旁边弹出，不再是屏幕正中那口大锅 */
.lg-dialog.lg-near { position:fixed; inset:auto; margin:0; width:max-content; min-width:0; max-height:90vh; overflow:auto; }
.lg-dialog.lg-near#markDialog { padding:20px 22px; }
.lg-rows .lg-batch-bar.hidden { display:none; }
.lg-rows .lg-batch-bar #selectionInfo { font-weight:600; white-space:nowrap; }
.lg-rows .lg-batch-bar .btn { padding:8px 16px; min-height:40px; font-size:16px; }
.lg-rows .lg-batch-bar .lg-divider { margin:0 2px; }
/* 批量面板里的标签、字段和替换弹窗：都按「标签在上、控件在下」排，
   别指望复用工具栏那套（作用域不一样，之前这里标签是贴在输入框上的）。 */
.lg-batch-bar .f, .lg-batch-dialog .f { display:flex; flex-direction:column; gap:5px; }
.lg-batch-bar .f label, .lg-batch-dialog .f label { font-size:12px; color:var(--muted); letter-spacing:.2px; }
.lg-rows .lg-foot { flex-wrap:wrap; gap:12px; }
.lg-rows .lg-pagination, .lg-rows .lg-page-jump { display:flex; align-items:center; gap:6px; }
.lg-rows .lg-page-btn { appearance:none; font:inherit; border:1px solid var(--lg-grid); border-radius:8px; background:#fff; color:#334155; min-width:40px; min-height:40px; padding:6px 12px; cursor:pointer; }
.lg-rows .lg-page-btn[aria-current="page"] { background:#2563eb; color:#fff; border-color:#2563eb; }
.lg-rows .lg-page-btn:disabled { opacity:.45; cursor:default; }
.lg-rows .lg-page-jump input { appearance:none; width:64px; height:40px; padding:8px; border:1px solid var(--lg-grid); border-radius:8px; font:inherit; }
.lg-batch-dialog input, .lg-batch-dialog select { background-image:var(--lg-caret); background-repeat:no-repeat; background-position:right 10px center; padding-right:32px; }
.lg-batch-dialog select { background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath d='m4 6 4 4 4-4' fill='none' stroke='%2364758b' stroke-width='1.5'/%3E%3C/svg%3E"); background-repeat:no-repeat; background-position:right 10px center; padding-right:32px; }
.lg-batch-dialog .f { margin-top:16px; }
@media (max-width:640px) {
  .lg-rows .lg-selection-tools { padding:10px; }
  .lg-rows .lg-batch-bar { padding:10px; }
  .lg-rows .lg-batch-bar #selectionInfo { flex-basis:100%; }
  .lg-rows .lg-pagination { flex-wrap:wrap; }
  .lg-rows .lg-page-btn { min-height:40px; }
}

/* 列标题同时是整列选择按钮，保留鼠标与键盘焦点样式。 */
.lg-rows .lg-table th[data-column] { cursor: pointer; padding: 0; }
.lg-rows .lg-column-select { display: block; width: 100%; padding: var(--lg-head-pad); border: 0; background: transparent; color: inherit; font: inherit; text-align: inherit; cursor: pointer; }
.lg-rows .lg-column-select:hover { background: #e8f0fe; color: #1d4ed8; }
.lg-rows .lg-column-select:focus-visible { outline: 2px solid #2563eb; outline-offset: -3px; }
.lg-rows .lg-table th.lg-column-selected { background: #dbeafe; color: #1d4ed8; }

@media (max-width: 760px) {
  .lg-page { padding: 16px 10px 40px; --lg-space-x: 12px; }
  .lg-setup .lg-table th { position: static; }
  .lg-rows .card { padding: 0; }
  .lg-toolbar { padding: 12px; gap: 9px; }
  .lg-tools { flex: 1 1 100%; }
  .lg-tools.right { margin-left: 0; }
  .lg-tools .f { flex: 1; min-width: 132px; }
  .lg-tools .search { min-width: 0; }
  /* 手机上没有悬停，业务员列窄一点、行内按钮大一点，手指点得中 */
  .lg-table .lg-owner { min-width: 96px; max-width: 130px; }
  .lg-mini { padding: 5px 9px; }
  .lg-dialog { padding: 18px; border-radius: 14px; }
  .lg-empty { padding: 40px 16px 44px; }
}

/* 后勤三功能：仅改变后勤主表和专用面板。 */
.lg-rows .lg-table tbody tr td.lg-cell { --lg-cell-bg: var(--lg-row-bg); background-color: var(--lg-cell-bg); isolation: isolate; transition: none; }
.lg-rows .lg-table tbody tr td.lg-cell:where([data-mark="red"]) { --lg-cell-bg: #fee2e2; }
.lg-rows .lg-table tbody tr td.lg-cell:where([data-mark="green"]) { --lg-cell-bg: #dcfce7; }
.lg-rows .lg-table tbody tr td.lg-cell:where([data-mark="blue"]) { --lg-cell-bg: #dbeafe; }
.lg-rows .lg-table tbody tr td.lg-cell:where([data-mark="orange"]) { --lg-cell-bg: #ffedd5; }
.lg-rows .lg-table tbody tr td.lg-cell:where([data-mark="yellow"]) { --lg-cell-bg: #fef9c3; }
.lg-rows .lg-table tbody tr td.lg-cell:where([data-mark="purple"]) { --lg-cell-bg: #f3e8ff; }
.lg-rows .lg-table tbody tr td.lg-cell:where([data-mark="cyan"]) { --lg-cell-bg: #cffafe; }
.lg-rows .lg-table tbody tr td.lg-cell:where(.lg-saved) { --lg-cell-bg: #ecfdf3; }
.lg-rows .lg-table tbody tr td.lg-cell:where(.lg-cell-selected) { --lg-cell-bg: #dbeafe; }
.lg-rows .lg-table tbody tr td.lg-cell:where(.lg-error) { --lg-cell-bg: #fee4e2; }
.lg-rows .lg-table tbody tr td.lg-cell > :is(input, select, textarea) { background-color: var(--lg-cell-bg); }
.lg-rows .lg-cell.lg-cell-selected::before { z-index: 3; pointer-events: none; }
.lg-rows .lg-cell.lg-saving::after { z-index: 4; }
.lg-rows .lg-bottom-add { display: flex; justify-content: space-between; margin-top: 4px; }
.lg-rows .lg-bottom-add button, .lg-rows #rowAddLayer button { width: 26px; height: 26px; padding: 0; border: 1px solid #93b4ef; border-radius: 5px; background: #fff; color: #2563eb; cursor: pointer; }
.lg-rows #rowAddLayer button { position: fixed; z-index: 6; }
.lg-rows #rowAddLayer button.lg-add-inset { width: 10px; height: 18px; font-size: 10px; }
.lg-rows #rowAddLayer button[hidden] { display: none; }
#markDialog #markColors, #expressDialog #expressProjects { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
#markDialog button[data-color="red"] { background-color: #fee2e2; }
#markDialog button[data-color="green"] { background-color: #dcfce7; }
#markDialog button[data-color="blue"] { background-color: #dbeafe; }
#markDialog button[data-color="orange"] { background-color: #ffedd5; }
#markDialog button[data-color="yellow"] { background-color: #fef9c3; }
#markDialog button[data-color="purple"] { background-color: #f3e8ff; }
#markDialog button[data-color="cyan"] { background-color: #cffafe; }

/* UI8: the visible frame owns scrolling; overlays do not take table columns. */
/* 表格左右留白：固定 56px，跟窗口宽窄无关（2026-09-29 无一指定）。
   ⚠️ 光改 padding 治不了「留白随窗口变」：`.lg-page` 上还挂着 max-width:1500px + `.page` 的 margin:0 auto，
   窗口一超过 1500px 整页就居中，眼睛看到的边距变成「(窗口宽−1500)/2 + padding」，跟着窗口一起涨。
   2026-09-29 真浏览器实测（改前 padding 16px、上限 1500px）：窗口 1425 → 左边距 17px、1600 → 60px、
   1920 → 220px、2560 → 540px。所以这里必须「去掉上限 + 固定 padding」两件一起做。
   只作用在 `.lg-rows`（后勤数据页）；后勤设置页是 `.lg-page.lg-setup`，仍保持 1500px 上限，外观不动。
   窄屏那份 `@media (max-width:760px) .lg-page{padding:16px 10px}` 压不过本规则（两个类 > 一个类），
   手机上也一样是 56px —— 这是「固定」的代价，真要给窄屏单独放宽再说。 */
.lg-page.lg-rows { --lg-table-gutter: 56px; max-width: none; padding-left: var(--lg-table-gutter); padding-right: var(--lg-table-gutter); min-width: 0; }
.lg-rows .card, .lg-rows #tableRegion { min-width: 0; max-width: 100%; position: relative; overflow-anchor: none; }
/* 表格可见区高度上限 65vh → 97.5vh（2026-09-29 无一要求「表格高度加 50%」）。
   ⚠️ 这个数只在「行数多到撑满」时才起作用：行少时表格高度由内容决定，改它看不出来
   （真项目一页 200 行，永远撑满；验收夹具只有 7 行，所以验这条必须自己灌够行数）。
   ⚠️ 97.5vh 一定超过窗口剩下的高度（表头 + 工具栏已占掉约 335px），也就是表格底边会落到窗口下沿
   以外、要看底部分页栏得滚整页。**滚整页时表头不会吸顶** —— th 的 sticky 是相对最近的滚动容器
   #tableWrap 算的，页面滚动时整个 #tableWrap 一起走。这个毛病改前就有（65vh 时表格底边已经出屏
   34px、整页可滚 231px），只是改后明显得多（出屏 326px、整页可滚 523px）—— 不是这次改出来的。
   真浏览器核对：tools/check-ui12-browser.js（灌 80 行再量；夹具行少时这个上限根本不起作用）。 */
.lg-rows #tableWrap { width: 100%; min-width: 0; overflow: auto; max-height: 97.5vh; overscroll-behavior: contain; overflow-anchor: none; }
/* 原来 11px 的浅蓝横条在浅色页面上不明显，顶栏加深了颜色方便发现和拖动。
   2026-09-29 无一在线上看过两轮：先嫌粗（条 20px→16px），再要更细（条 16px→10px、容器 20px→14px）。
   ⚠️ 容器高度必须比滚动条高度多几个像素：两者相等时内容盒高为 0，Chrome 判定没有可滚动区域 ——
   滚动条根本不画、scrollLeft 永远是 0（看着有条、实则拖不动）。
   真浏览器实测：容器 20px + 条 20px → clientHeight=0、scrollWidth=clientWidth、设 scrollLeft 无效；
   容器 20px + 条 16px、容器 24px + 条 20px、容器 14px + 条 10px → clientHeight=3、都能正常滚。
   改条高时容器要跟着调，别把这几像素的差抹掉。 */
.lg-rows .lg-top-scroll { overflow-x: auto; overflow-y: hidden; height: 14px; background: #e6edf8; border: 1px solid var(--lg-grid); border-bottom: 0; }
.lg-rows .lg-top-scroll::-webkit-scrollbar { height: 10px; }
.lg-rows .lg-top-scroll::-webkit-scrollbar-track { background: #e6edf8; }
.lg-rows .lg-top-scroll::-webkit-scrollbar-thumb { background: #6c86ad; border: 2px solid #e6edf8; border-radius: 8px; }
.lg-rows .lg-top-scroll::-webkit-scrollbar-thumb:hover { background: #4f6b96; }
/* 只隐藏底部横条，保留纵向滚动条及触控板、Shift 加滚轮的原生滚动。 */
.lg-rows #tableWrap::-webkit-scrollbar:horizontal { height: 0; display: none; }
.lg-rows #rowsTable { table-layout: fixed; box-sizing: border-box; }
.lg-rows #rowsTable th { top: 0; text-align: left; white-space: normal; overflow-wrap: anywhere; }
.lg-rows #rowsTable :is(th,td) { min-width: 0; max-width: none; box-sizing: border-box; }
.lg-rows #rowsTable .lg-index { position: sticky; left: 0; z-index: 2; width: 64px; padding: 10px; background: var(--lg-row-bg, #edf4ff); }
.lg-rows #rowsTable .lg-select-col { left: 64px; width: 48px; }
.lg-rows #rowsTable .lg-owner { left: 112px; }
.lg-rows #rowsTable th:is(.lg-index,.lg-select-col,.lg-owner) { z-index: 5; background: #edf4ff; }
.lg-rows #rowsTable .lg-filler { padding: 0; width: auto; border-left: 0; }
.lg-rows #rowsTable td.lg-actions { text-align: left; white-space: nowrap; }
.lg-rows #rowsTable .lg-chip, .lg-rows #rowsTable .lg-mini { white-space: normal; overflow-wrap: anywhere; max-width: 100%; box-sizing: border-box; }
.lg-rows #rowsTable .lg-owner select { min-width: 0; }
.lg-rows .lg-bottom-add { position: relative; width: 100%; height: 30px; margin-top: 4px; }
.lg-rows .lg-bottom-add button { position: absolute; top: 0; }
/* 行侧「＋」挂在这条 30px 空条的两端，靠 3px 的缝站到表格外沿（26px 按钮 + 3px 缝 = 29px）。
   这 3px 曾经被 UI10 的 16px 留白顶坏：留白装不下按钮，它只好往表格里压 10px。
   2026-09-29 留白改成固定 56px 后，29px 有地方站，重叠消失。
   下面那条 min() 夹取保留当保险：留白够（≥29px）时就是 3px；万一以后又把留白改小，
   它最差也是贴着表格外沿站，不会压到格子、也不会被顶出屏幕。 */
.lg-rows #addRowBottomLeft { right: calc(100% + min(3px, var(--lg-table-gutter, 32px) - 26px)); }
.lg-rows #addRowBottomRight { left: calc(100% + min(3px, var(--lg-table-gutter, 32px) - 26px)); }
.lg-rows .lg-batch-bar { position: fixed; width: max-content; box-sizing: border-box; overflow: auto; }
.lg-rows .lg-resize { position: absolute; right: 0; top: 0; bottom: 0; width: 9px; padding: 0; border: 0; background: transparent; cursor: col-resize; touch-action: none; z-index: 6; }
.lg-rows .lg-resize:hover, .lg-rows .lg-resize:focus-visible { background: #93b5ef; }
.lg-rows .lg-column-select { padding-right: 20px; }
@media (max-width: 600px) {
  .lg-rows .lg-tools, .lg-rows .lg-tools .f, .lg-rows .lg-tools input, .lg-rows .lg-tools select { min-width: 0; max-width: 100%; }
  .lg-rows .lg-tools .f { flex-basis: 100%; }
  .lg-rows .lg-batch-bar { max-width: calc(100vw - 64px); }
}
/* 弹性列布局 + 底部粘住的按钮条：视口不够高时（表头位置低、窗口矮、手机横屏），
   浮窗被 max-height 压扁，原来「应用/清除本列筛选/取消」会被自己的 overflow 裁到看不见，
   要滚动浮窗才够得着（2026-09-29 线上真机核验抓到）。改成：值清单自己滚，按钮永远贴在底部。 */
.lg-column-filter { position:fixed; z-index:20; width:380px; max-width:calc(100vw - 8px); box-sizing:border-box; display:flex; flex-direction:column; overflow:hidden; padding:16px; border:1px solid #c9d8ec; border-radius:12px; background:#fff; box-shadow:0 8px 24px #1e40af26; }
.lg-column-filter.hidden, .lg-filter-chips.hidden { display:none; }
.lg-column-filter h3 { margin:0; font-size:17px; }
.lg-column-filter p { margin:8px 0; }
.lg-column-filter .flex { flex-wrap:wrap; gap:6px; }
.lg-column-filter input[type="search"] { width:100%; box-sizing:border-box; margin:6px 0; padding:8px 10px; border:1px solid #c9d8ec; border-radius:8px; font:inherit; }
#columnFilterValues { flex:1 1 auto; min-height:60px; max-height:240px; overflow:auto; margin:8px 0; }
.lg-column-filter .lg-column-actions { flex:none; margin-top:auto; padding-top:8px; background:#fff; }
#columnFilterValues label { display:flex; align-items:center; gap:8px; padding:6px 0; }
#columnFilterValues input { flex:none; width:16px; height:16px; accent-color:#2563eb; }
#columnFilterValues label span:first-of-type { flex:1; white-space:pre-wrap; overflow-wrap:anywhere; }
#columnFilterValues label span:last-child { flex:none; color:var(--muted); }
.lg-filter-chips { display:flex; flex-wrap:wrap; gap:8px; margin:10px 0; }
.lg-filter-chip { max-width:100%; overflow-wrap:anywhere; border:1px solid #c9d8ec; border-radius:8px; padding:5px 10px; background:#eff6ff; }
.lg-filter-chip button { border:0; background:transparent; cursor:pointer; font-size:18px; }
.lg-dedupe-dialog { width:min(960px, 94vw); }
.lg-dedupe-fields { display:flex; gap:12px; flex-wrap:wrap; margin:14px 0; }
.lg-dedupe-fields label { display:flex; flex:1; min-width:150px; flex-direction:column; gap:6px; }
#dedupeView td { white-space:pre-wrap; overflow-wrap:anywhere; }
/* 结果复用主页格子样式，但没有勾选列、编辑与拖列入口。 */
#dedupeView .lg-table { table-layout:fixed; min-width:100%; box-sizing:border-box; }
#dedupeView .lg-table :is(th,td) { min-width:0; max-width:none; box-sizing:border-box; }
#dedupeView .lg-table th { top:0; white-space:normal; overflow-wrap:anywhere; }
#dedupeView .lg-table th[data-column] { padding:12px 16px; cursor:default; }
#dedupeView .lg-index { position:sticky; left:0; z-index:2; padding:10px; background:var(--lg-row-bg, #edf4ff); }
#dedupeView .lg-table .lg-owner { left:64px; }
#dedupeView .lg-table th:is(.lg-index,.lg-owner) { z-index:5; background:#edf4ff; }
#dedupeView .lg-table .lg-filler { padding:0; width:auto; border-left:0; }
#dedupeView .lg-chip, #dedupeView .lg-mini { white-space:normal; overflow-wrap:anywhere; max-width:100%; box-sizing:border-box; }
#dedupeView .lg-cell { cursor:default; }
/* 拖表头换列顺序的观感。这里**故意不写 touch-action:none**（左辅 2026-09-28 复核补注）：
   表头是吸顶的一整条，手机在仓库录单时要靠它横向滑表格；锁掉触摸滚动，手指从表头划过去
   就变成「拖列」而不是滚表，等于把录单的人堵住。所以拖拽只在鼠标/触控笔上生效
   （见 logistics-view.js 里 pointerType 的判断），手指保持原来的滚动行为。 */
.lg-rows #rowsHead th.lg-col-dragging { opacity: .55; cursor: grabbing; }
.lg-rows #rowsHead th.lg-col-drop-before { box-shadow: inset 3px 0 #2563eb; }

#dedupeBtn[aria-pressed="true"] { background:#dbeafe; color:#1d4ed8; border-color:#93c5fd; }
.lg-dedupe-head { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; }
#dedupeView { min-width:0; padding:12px var(--lg-space-x); scroll-margin-top:70px; }
#dedupeViewTitle { overflow-wrap:anywhere; min-width:0; }
/* 结果表的滚动框要自己限高。后勤页有一条 `.lg-page .lg-scroll { overflow:visible; max-height:none }`
   是给主表格用的（主表格的滚动在 #tableWrap 那层上），结果表没有那层，于是「300 行一张表」
   把整页撑到 13952px —— 2026-09-30 上线当天用真浏览器量几何才抓到，看截图看不出来。
   取视口 65% 与 640px 的小值，两块表各自滚，页面高度就稳在三四屏内。 */
.lg-page #dedupeView .lg-scroll { overflow:auto; max-width:100%; max-height:min(65vh, 640px); }
#dedupeMode { display:flex; gap:16px; flex-wrap:wrap; border:0; padding:0; }

/* ---------- 工具页 · 图片生成（2026-10-01 加） ---------- */
.mt14 { margin-top: 14px; }
.tool-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.tool-step { display: flex; gap: 12px; padding: 16px 0; border-top: 1px solid var(--line); }
.tool-step:first-of-type { border-top: 0; padding-top: 4px; }
.tool-no {
  flex: 0 0 26px; height: 26px; border-radius: 50%;
  background: linear-gradient(135deg, #4b83f0, #2563eb); color: #fff;
  font-size: 13px; font-weight: 600; display: flex; align-items: center; justify-content: center;
}
.tool-body { flex: 1; min-width: 0; }
.tool-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tool-size { display: flex; align-items: center; gap: 8px; }
.tool-size > span { font-size: 13px; color: var(--ink-2); font-weight: 550; white-space: nowrap; }
.tool-size select { width: auto; min-width: 138px; }
.tool-shot {
  margin-top: 14px; padding: 12px; border: 1px dashed var(--line);
  border-radius: var(--radius); background: #fbfdff;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.tool-shot img { max-width: 100%; max-height: 560px; border-radius: var(--radius-sm); display: block; }
.tool-shot .empty-tip { margin: 0; }
.tool-hist { display: grid; grid-template-columns: repeat(auto-fill, minmax(272px, 1fr)); gap: 14px; }
.tool-card { border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; overflow: hidden; display: flex; flex-direction: column; }
.tool-thumb { height: 150px; background: #f2f6fd; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.tool-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tool-card-main { padding: 10px 12px 0; flex: 1; min-width: 0; }
.tool-card-title {
  font-size: 13px; color: var(--ink-2); line-height: 1.6;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.tool-card-acts { display: flex; gap: 8px; padding: 10px 12px 12px; flex-wrap: wrap; }

/* 客户卡片：独立只读表，不继承后勤编辑页的固定边距。 */
.topbar .nav { min-width: 0; white-space: nowrap; overflow-x: auto; }
.lg-customers { min-width: 0; }
.lg-customers .customer-controls, .lg-customers .customer-pager { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin: 16px 0; }
.lg-customers .customer-controls input { max-width: 100%; }
.lg-customers .customer-pager input { width: 85px; }
.lg-customers [aria-pressed="true"] { background: #2563eb; color: white; }
.lg-customers .customer-card { margin: 16px 0; padding: 20px; min-width: 0; overflow-wrap: anywhere; }
.lg-customers .customer-card h2 { margin: 0 0 10px; }
.lg-customers .customer-fields { display: grid; grid-template-columns: minmax(60px,120px) minmax(0,1fr); gap: 8px; }
.lg-customers .customer-fields dd { margin: 0; white-space: pre-wrap; }
.lg-customers .customer-fields dt { font-weight: 600; }
.lg-customers .customer-project { min-width: 0; margin-top: 20px; }
/* 2026-10-21：客户详情这类只读表不再各自限高、不再自成竖向滚动区。
   以前每张表套一个 65vh 高的滚动框 + overscroll-behavior:contain：鼠标停在行上滚轮只滚这张表，
   滚到底也不传给外层，整个面板/弹窗不动（无一 2026-10-21 报的问题）。
   现在只保留横向滚动，纵向一次性展开，由面板/弹窗统一上下滚 —— 滚轮停在哪都能滚页面。
   注意 overscroll-behavior 必须改回 auto：基础 .lg-scroll 那条 contain 会拦住滚轮向外的传递，
   只去掉限高不够（2026-10-21 实测：表不再自己滚，但滚轮也被 contain 吃掉，面板纹丝不动）。 */
.lg-customers .lg-scroll { overflow-x: auto; overflow-y: hidden; max-height: none; width: 100%; overscroll-behavior: auto; }
.lg-customers .lg-table { table-layout: fixed; min-width: 0; }
.lg-customers .lg-table th { top: 0; touch-action: pan-x pan-y; }
.lg-customers .lg-table th[data-column] { padding: 10px 12px; }
.lg-customers .lg-table .lg-index { width: 64px; min-width: 64px; }
.lg-customers .lg-table .lg-owner { left: 64px; }
.lg-customers .lg-table td { white-space: pre-wrap; overflow-wrap: anywhere; cursor: default; }
.lg-customers .lg-table .lg-tail { background: transparent; }
/* 一键填入前置列（2026-10-21）：固定在表格最左边，横向滚到哪都在；原来在行尾格 */
.lg-customers .lg-table th.lg-lead, .lg-customers .lg-table td.lg-lead {
  position: sticky; left: 0; z-index: 2; width: 100px; min-width: 100px; padding: 6px 8px; text-align: center;
  background: var(--lg-row-bg, #fff);
}
.lg-customers .lg-table th.lg-lead { z-index: 6; background: #f1f6ff; white-space: nowrap; }
/* 行首换成按钮列后，序号/业务员两列的吸附位置整体右移 */
.lg-customers .lg-table.has-lead .lg-index { left: 100px; }
.lg-customers .lg-table.has-lead .lg-owner { left: 164px; }
/* 「最后一列右对齐、收窄」是给行尾操作列用的；带行首按钮列的表，最后一列是数据列，得还原 */
.lg-customers .lg-table.has-lead th:last-child, .lg-customers .lg-table.has-lead td:last-child { text-align: left; width: auto; white-space: pre-wrap; }
@media(max-width:600px) {
  .lg-customers .customer-card { padding: 12px; }
  .lg-customers .customer-controls > label { max-width: 100%; }
  /* 手机上抽屉最窄 340px：行首按钮列再吸附就把数据列挤没了，让它跟着横滚走。 */
  .lg-customers .lg-table th.lg-lead, .lg-customers .lg-table td.lg-lead { position: static; }
  .lg-customers .lg-table.has-lead .lg-index { left: 0; }
  .lg-customers .lg-table.has-lead .lg-owner { left: 64px; }
}
.lg-customers .lg-table .lg-index { position: sticky; left: 0; z-index: 2; padding: 10px; background: var(--lg-row-bg, #edf4ff); }
.lg-customers .lg-table th:is(.lg-index,.lg-owner) { z-index: 5; background: #edf4ff; }
.lg-customers .lg-table th { position: sticky; z-index: 3; white-space: nowrap; background: #f1f6ff; color: var(--ink-2); font-size: var(--lg-head-font); font-weight: 600; }
.lg-customers .lg-table th:is(.lg-index,.lg-owner) { z-index: 5; }
.lg-customers .lg-table td { border-bottom: 1px solid var(--lg-grid); }

/* 工具入口页（工具列表）—— 加工具只加 .tool-entry，不用动结构（2026-10-01 晚加） */
.tool-hub { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 12px; }
.tool-entry {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius);
  background: #fff; text-decoration: none; color: inherit;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.tool-entry:hover { border-color: var(--blue-400); box-shadow: 0 8px 22px -14px rgba(37, 99, 235, .55); transform: translateY(-1px); }
.tool-entry-icon { flex: 0 0 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 22px; background: #eef4ff; }
.tool-entry-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.tool-entry-title { font-size: 15.5px; font-weight: 600; color: var(--ink); }
.tool-entry-desc { font-size: 13px; color: var(--muted); line-height: 1.6; }
.tool-entry-go { flex: 0 0 auto; font-size: 13px; color: #2563eb; font-weight: 550; }
@media (max-width: 560px) {
  .tool-entry { flex-wrap: wrap; }
  .tool-entry-go { width: 100%; text-align: right; }
}

/* 客户卡片方案 A：人物同一行对应，所有布局仅作用于客户页。 */
.lg-customers .customer-card { margin: 10px 0; padding: 10px 18px; }
.lg-customers .customer-head, .lg-customers .customer-identity,
.lg-customers .customer-metadata, .lg-customers .customer-project-tags { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; min-width: 0; }
.lg-customers .customer-head { justify-content: space-between; gap: 4px 16px; }
.lg-customers .customer-card h2 { margin: 0; font-size: 16px; line-height: 24px; font-weight: 700; min-width: 0; }
.lg-customers .customer-recent { margin-left: auto; }
.lg-customers .customer-metadata { gap: 4px 20px; margin: 4px 0 6px; font-size: 13px; line-height: 20px; }
.lg-customers .customer-project-tags { gap: 5px; }
.lg-customers .customer-people { font-size: 13px; line-height: 20px; }
.lg-customers .customer-person-head, .lg-customers .customer-person { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr) minmax(0,1.5fr) 48px; gap: 12px; padding: 1px 8px; }
.lg-customers .customer-person-head { color: var(--muted); background: var(--blue-50); border-radius: 5px; font-size: 12px; }
.lg-customers .customer-person[hidden] { display: none; }
.lg-customers .customer-person > div { min-width: 0; white-space: pre-wrap; }
.lg-customers .customer-person-count { text-align: right; }
.lg-customers .customer-person-head > :last-child { text-align: right; }
.lg-customers .customer-person-label { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.lg-customers .customer-person-unit { display: none; }
.lg-customers .customer-people-toggle { padding: 2px 8px; margin-top: 2px; font-size: 12px; }
.lg-customers .customer-without-people { margin: 3px 0 0; font-size: 12px; }
.lg-customers .customer-actions { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-top: 6px; }
.lg-customers .customer-toggle { margin-left: auto; flex-shrink: 0; padding: 5px 12px; font-size: 12px; }
.lg-customers .customer-supplement { min-width: 0; flex: 1; font-size: 13px; }
.lg-customers .customer-supplement summary { cursor: pointer; width: fit-content; padding: 5px 8px; font-size: 12px; line-height: 16px; }
.lg-customers .customer-supplement p { margin: 8px 0; white-space: pre-wrap; }
.lg-customers .customer-fields { margin: 8px 0; }
.lg-customers .page-head { margin-bottom: 12px; }
.lg-customers .customer-controls { margin: 10px 0; }
.lg-customers .customer-controls > label { display: flex; align-items: center; gap: 5px; }
.lg-customers .customer-controls select { width: auto; }
.lg-customers .customer-pager { margin: 8px 0; }
.lg-customers #customerSummary { font-size: 13px; color: var(--muted); }
.lg-customers button:focus-visible, .lg-customers summary:focus-visible { outline: 2px solid var(--blue-500); outline-offset: 2px; }
@media (max-width: 600px) {
  .lg-customers .customer-card { padding: 12px; }
  .lg-customers .customer-head { display: block; }
  .lg-customers .customer-identity { align-items: flex-start; }
  .lg-customers .customer-identity h2 { flex: 1; }
  .lg-customers .customer-identity .tag { flex-shrink: 0; }
  .lg-customers .customer-recent { display: block; margin: 4px 0 0; }
  .lg-customers .customer-metadata { display: grid; gap: 6px; }
  .lg-customers .customer-person-head { display: none; }
  .lg-customers .customer-person { grid-template-columns: minmax(0,1fr) minmax(0,1.15fr); gap: 4px 8px; padding: 8px 0; border-bottom: 1px solid var(--line); }
  .lg-customers .customer-person-name { grid-column: 1; grid-row: 1; font-weight: 600; }
  .lg-customers .customer-person-count { grid-column: 2; grid-row: 1; color: var(--muted); }
  .lg-customers .customer-person-birthday { grid-column: 1; grid-row: 2; }
  .lg-customers .customer-person-phones { grid-column: 2; grid-row: 2; }
  .lg-customers .customer-person-birthday .customer-person-label,
  .lg-customers .customer-person-phones .customer-person-label { position: static; width: auto; height: auto; margin: 0; clip-path: none; color: var(--muted); }
  .lg-customers .customer-person-unit { display: inline; }
  .lg-customers button, .lg-customers summary { min-height: 44px; }
  .lg-customers .customer-supplement summary { display: flex; align-items: center; }
  .lg-customers .customer-actions { flex-wrap: wrap; }
  .lg-customers .customer-supplement[open] { flex-basis: 100%; }
}
.lg-customers .customer-card .meta { display: inline; margin-top: 0; }
.lg-customers .customer-card .customer-without-people { display: block; }
@media (max-width: 600px) {
  .lg-customers .customer-card .customer-recent { display: block; margin-top: 4px; }
}

@media (min-width: 1100px) {
  .lg-customers { padding-top: 18px; }
  .lg-customers .page-head { margin-bottom: 8px; }
  .lg-customers .customer-card { margin: 8px 0; }
  .lg-customers .customer-list-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
  .lg-customers .customer-list-meta .customer-pager { flex-shrink: 0; }
}

/* ---------- 工具页左右分栏（2026-10-01 晚，无一要求「加点左右的维度」）----------
   量出来的问题：改之前 1440×900 下整页 1785px、三步全是 1094px 通栏，
   「生成图片」按钮在第 751px、出图区在第 818px —— 首屏根本看不到出图的地方。
   现在：左栏写想法/改提示词，右栏就是出图区，两栏并排；窄屏（≤900px）自动落回一列。 */
.tool-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(340px, 430px); gap: 22px; align-items: start; }
.tool-col { min-width: 0; }
.tool-col > .tool-step:first-child { padding-top: 4px; }
/* 右栏的出图区：给它一个稳定的高度，图出来前后页面不跳 */
.tool-preview .tool-shot { min-height: 300px; }
.tool-preview .tool-shot img { max-height: 460px; }
@media (max-width: 900px) {
  .tool-layout { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .tool-preview .tool-shot { min-height: 0; }
  .tool-col > .tool-step:first-child { padding-top: 16px; border-top: 1px solid var(--line); }
}


/* 客户统计：桌面每页 48 张，固定六列；窄屏减少列数。 */
.lg-customers #customerCards { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; }
.lg-customers .customer-card { margin: 0; padding: 14px 8px; text-align: center; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.lg-customers .customer-card p { margin: 0; }
.customer-avatar { width: 72px; height: 72px; object-fit: cover; border-radius: 16px; }
.customer-overlay { position: fixed; inset: 0; background: #0008; z-index: 10000; display: flex; justify-content: center; align-items: center; padding: 20px; }
.customer-modal { background: #fff; color: #172033; padding: 20px; border-radius: 16px; width: min(1200px,95vw); max-height: 90vh; overflow: auto; }
.customer-modal > .btn { float: right; }
.customer-modal input, .customer-modal select { max-width: 100%; }
.customer-information { white-space: pre-wrap; }
.customer-crop { position: relative; width: fit-content; max-width: 100%; }
.customer-crop canvas { display: block; max-width: 100%; max-height: 65vh; touch-action: none; }
.customer-selection { position: absolute; border: 2px solid #2563eb; background: #2563eb33; pointer-events: none; box-sizing: border-box; }
@media (max-width: 1000px) { .lg-customers #customerCards { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 600px) { .lg-customers #customerCards { grid-template-columns: repeat(2, 1fr); } .customer-overlay { padding: 8px; } }

/* 透明遮罩保留页面原貌并承接外侧点击；100vw 避免解锁滚动条后滑出终点向左偏移。 */
.customer-drawer-overlay { position: fixed; inset: 0; width: 100vw; background: transparent; z-index: 10000; }
.customer-drawer { position: absolute; right: 0; top: 0; height: 100%; width: 60vw; box-sizing: border-box; min-width: min(340px, 100vw); background: #fff; color: #172033; padding: 20px; overflow: auto; box-shadow: -8px 0 28px #17203322; transform: translateX(100%); transition: transform 220ms ease; }
/* 桌面严格 3/5；窄屏被下限抬起是为了还能读，≥567px 时仍恰好为 60vw。 */
.customer-drawer-open .customer-drawer { transform: translateX(0); }
.customer-drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.customer-drawer-head h2 { min-width: 0; overflow-wrap: anywhere; }
.customer-drawer-body { min-width: 0; }
@media (prefers-reduced-motion: reduce) { .customer-drawer { transition: none; } }

.lg-undo-list { max-height:60vh; overflow:auto; }
.lg-undo-item { display:flex; justify-content:space-between; align-items:center; gap:16px; padding:14px 0; border-bottom:1px solid #e2e8f0; }
.lg-undo-item p { margin:5px 0 0; font-size:13px; }
.lg-undo-reason { color:#b45309; }
.lg-undo-disabled { opacity:.65; }
