/* ==========================================================================
   询盘 CRM - 样式表（浅色主题）
   ========================================================================== */

:root {
  --bg: #f4f5f7;
  --panel: #ffffff;
  --panel-soft: #fafbfc;
  --line: #e4e6ea;
  --line-strong: #d3d7dd;
  --text: #1f2328;
  --muted: #6b7280;
  --faint: #9aa1ab;
  --brand: #1a6dd4;
  --brand-dark: #14559f;
  --brand-soft: #e8f1fd;
  --ok: #2f8f43;
  --ok-soft: #e8f6ea;
  --warn: #b5790f;
  --warn-soft: #fdf3e0;
  --danger: #c0392b;
  --danger-soft: #fceceb;
  --radius: 10px;
  --radius-sm: 7px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .06);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei",
               "PingFang SC", "Hiragino Sans GB", Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

.ico { width: 18px; height: 18px; flex: none; }

/* ---------- 整体布局 ---------- */

.app { display: flex; min-height: 100vh; }

.sidebar {
  width: 220px;
  flex: none;
  background: var(--panel);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 18px;
  height: 60px;
  border-bottom: 1px solid var(--line);
  font-weight: 600;
  font-size: 14px;
}

.brand-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--brand);
  flex: none;
}

.brand-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav { padding: 10px 10px; flex: 1; overflow-y: auto; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  color: #3c4149;
  font-size: 13.5px;
  margin-bottom: 2px;
  transition: background .12s;
}

.nav-item:hover { background: var(--panel-soft); text-decoration: none; }

.nav-item.active {
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-weight: 600;
}

.nav-item span:first-of-type { flex: 1; }

.badge {
  font-size: 11.5px;
  padding: 1px 7px;
  border-radius: 20px;
  font-weight: 600;
  line-height: 1.6;
}

.badge-soft { background: #eef0f3; color: var(--muted); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }

.sidebar-foot { padding: 10px; border-top: 1px solid var(--line); }
.sidebar-foot .nav-item { color: var(--muted); font-size: 13px; }

/* ---------- 侧栏收起 / 展开（v1.2.7）---------- */
.side-toggle {
  margin-left: auto;
  flex: none;
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  border-radius: 6px;
  color: var(--muted);
  cursor: pointer;
}
.side-toggle:hover { background: var(--panel-soft); color: var(--text); }

.side-expand {
  display: none;
  flex: none;
  width: 30px;
  height: 30px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-strong);
  background: var(--panel);
  border-radius: var(--radius-sm);
  color: var(--text);
  cursor: pointer;
  margin-right: 4px;
}
.side-expand:hover { background: var(--panel-soft); }

/* 收起状态：侧栏整体移出，主区自动占满（.main 本来就是 flex:1） */
html.side-collapsed .sidebar { display: none; }
html.side-collapsed .side-expand { display: inline-flex; }

.topbar-left { display: flex; align-items: center; gap: 4px; min-width: 0; }
.topbar-left .page-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  height: 60px;
  flex: none;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 22px;
  position: sticky;
  top: 0;
  z-index: 20;
}

.page-title { font-size: 16px; font-weight: 600; margin: 0; }

.topbar-actions { display: flex; align-items: center; gap: 10px; }

.who {
  font-size: 13px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 7px;
}

.who b { color: var(--text); font-weight: 500; }

.role-tag {
  font-style: normal;
  font-size: 11.5px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 1px 8px;
  color: var(--muted);
}

.content { padding: 20px 22px 70px; width: 100%; }

/* ---------- 卡片 / 区块 ---------- */

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 18px;
  overflow: hidden;
}

.card-head {
  padding: 13px 18px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.card-head h2 { font-size: 14px; font-weight: 600; margin: 0; }
.card-head .sub { font-size: 12.5px; color: var(--muted); font-weight: 400; }
.card-body { padding: 18px; }
.card-body.tight { padding: 0; }

.sec-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  margin: 0 0 12px;
  letter-spacing: .02em;
}

/* ---------- 指标卡 ---------- */

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.stat {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 15px 17px;
}

.stat .label { font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
.stat .value { font-size: 26px; font-weight: 600; line-height: 1.25; letter-spacing: -.01em; }
.stat .hint { font-size: 12px; color: var(--faint); margin-top: 4px; }
.stat.is-danger .value { color: var(--danger); }
.stat.is-ok .value { color: var(--ok); }
.stat.is-warn .value { color: var(--warn); }
.stat a.value:hover { text-decoration: none; color: var(--brand); }

/* ---------- 按钮 ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font: inherit;
  font-size: 13.5px;
  line-height: 1;
  padding: 9px 15px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
  transition: background .12s, border-color .12s, opacity .12s;
}

.btn:hover { background: var(--panel-soft); border-color: #bfc4cc; text-decoration: none; }
.btn .ico { width: 16px; height: 16px; }

.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }

.btn-danger { background: #fff; border-color: #e6b8b3; color: var(--danger); }
.btn-danger:hover { background: var(--danger-soft); }

.btn-sm { padding: 6px 11px; font-size: 12.5px; }
.btn-sm .ico { width: 14px; height: 14px; }

.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- 表单 ---------- */

.field { margin-bottom: 15px; }
.field label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 6px; }
.field .req { color: var(--danger); margin-left: 2px; }
.field .tip { font-size: 12px; color: var(--faint); margin-top: 5px; }

input[type=text], input[type=password], input[type=email], input[type=number],
input[type=date], input[type=datetime-local], input[type=search], input[type=tel],
select, textarea {
  width: 100%;
  font: inherit;
  font-size: 13.5px;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 9px 11px;
  outline: none;
  transition: border-color .12s, box-shadow .12s;
}

textarea { resize: vertical; min-height: 92px; line-height: 1.65; }

input:focus, select:focus, textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(26, 109, 212, .12);
}

select { appearance: none; background-image: none; padding-right: 30px;
  background-image: linear-gradient(45deg, transparent 50%, #7b828c 50%),
                    linear-gradient(135deg, #7b828c 50%, transparent 50%);
  background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 0 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0 16px; }

.check { display: flex; align-items: flex-start; gap: 8px; font-size: 13.5px; }
.check input { width: auto; margin-top: 4px; flex: none; }

/* ---------- 筛选条 ---------- */

.filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  align-items: end;
}

.filters .field { margin-bottom: 0; }
.filters .f-act { display: flex; gap: 8px; }

/* ---------- 表格 ---------- */

/* v1.2.5 横向滚动闪动修复
   症状：拖动表格底部横向滚动条时页面剧烈闪动、拉不动。
   原因：横向滚动条出现 → 页面高度增加 → 纵向滚动条出现 → 可用宽度变窄
         → 表格列宽重算、行高变化 → 纵向滚动条又消失 → 无限循环振荡。
   对策：① 页面纵向滚动条常驻，可用宽度恒定；
         ② 表格外层只横向滚动，绝不自己产生纵向滚动条。

   v1.2.6 彻底消除横向滚动条
   症状：鼠标移入页面后，浏览器底部出现整页横向滚动条。
   原因：鼠标移入 → 系统「自动隐藏滚动条」把纵向滚动条淡入占位 →
         可用宽度瞬时变窄 → 视口级横向溢出。
   对策：① html 横向永不滚（overflow-x: hidden）——页面级横条物理上不可能出现；
         ② 表格改「流式宽度」：width:100% + 百分比列宽，
            常规窗口下表格恰好铺满容器，表格自己也不需要横向滚动。 */
html {
  overflow-x: hidden;   /* 视口级横向滚动条：永不允许 */
  overflow-y: scroll;   /* 纵向滚动条常驻，可用宽度恒定 */
}

.tbl-wrap {
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;   /* 表格滚到边界不再把滚动传递给页面 */
  max-width: 100%;
}

table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }

/* 宽表格（客户档案 / 供应商列表）：流式宽度 + 百分比列宽，
   常规窗口下表格恰好铺满容器，不需要横向滚动（v1.2.6）
   min-width 是极窄窗口的最后兜底，低于它才允许表格内部横滚 */
table.tbl.tbl-fixed { table-layout: fixed; width: 100%; }
table.tbl-cust { min-width: 880px; }
table.tbl-sup  { min-width: 820px; }

/* ---------- 列宽拖拽（v1.2.7，Excel 式）---------- */
/* 拖动表头右缘调整列宽：拖拽时相邻两列此消彼长，表格总宽不变（仍铺满容器，不会长出横向滚动条） */
table.tbl thead th { position: relative; }

.col-resizer {
  position: absolute;
  top: 0;
  right: -5px;
  width: 11px;
  height: 100%;
  cursor: col-resize;
  z-index: 6;
  touch-action: none;
}
.col-resizer::after {
  content: "";
  position: absolute;
  top: 25%;
  bottom: 25%;
  right: 4px;
  width: 2px;
  border-radius: 2px;
  background: transparent;
}
.col-resizer:hover::after,
th.col-dragging .col-resizer::after { background: var(--brand); opacity: 0.5; }

body.col-resizing { cursor: col-resize; user-select: none; }
table.tbl.tbl-fixed th,
table.tbl.tbl-fixed td {
  overflow-wrap: break-word;
  white-space: normal;   /* 固定列宽下允许折行：列再窄也不会把内容挤到列外 */
}
/* 覆盖上面的 td.nowrap（同特异性，需显式声明） */
table.tbl.tbl-fixed th.nowrap, table.tbl.tbl-fixed td.nowrap { white-space: normal; }
table.tbl.tbl-fixed th.w-lg, table.tbl.tbl-fixed td.w-lg,
table.tbl.tbl-fixed th.w-md, table.tbl.tbl-fixed td.w-md,
table.tbl.tbl-fixed th.w-follow, table.tbl.tbl-fixed td.w-follow {
  min-width: 0;
  max-width: none;
}

table.tbl th {
  text-align: left;
  font-weight: 600;
  font-size: 12.5px;
  color: var(--muted);
  background: var(--panel-soft);
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

table.tbl td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

table.tbl tr:last-child td { border-bottom: none; }
table.tbl tbody tr:hover { background: #fbfcfd; }
table.tbl td.nowrap, table.tbl th.nowrap { white-space: nowrap; }
table.tbl .col-num { text-align: right; font-variant-numeric: tabular-nums; }

/* 列表拆分列后的宽度保护（v1.2.2）：防止公司 / 产品列被挤成一字一行的窄条 */
table.tbl th.w-lg, table.tbl td.w-lg { min-width: 170px; }
table.tbl th.w-md, table.tbl td.w-md { min-width: 128px; }

/* 跟进记录列（v1.2.4）：跟进1 / 跟进2 / 跟进3 纵向列出 */
table.tbl th.w-follow, table.tbl td.w-follow { min-width: 340px; max-width: 460px; }
.fl + .fl { border-top: 1px dashed var(--line); margin-top: 7px; padding-top: 7px; }
.fl-hd { display: flex; align-items: center; gap: 7px; font-size: 12px; }
.fl-no { font-weight: 500; color: var(--text); }
.fl-date { color: var(--faint); }
.fl-type { font-size: 11.5px; padding: 0 5px; border-radius: 4px; background: var(--panel-soft); color: var(--muted); }
.fl-t-order { background: var(--ok-soft); color: var(--ok); }
.fl-t-quote { background: var(--warn-soft); color: var(--warn); }
.fl-t-sample { background: var(--brand-soft); color: var(--brand); }
.fl-txt { font-size: 12.5px; color: var(--text); line-height: 1.55; margin-top: 3px; overflow-wrap: anywhere; }
.fl-more { font-size: 12px; color: var(--muted); margin-top: 7px; }

.row-title { font-weight: 500; }
.row-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.cell-dim { color: var(--muted); font-size: 12.5px; }
.cell-strong { font-weight: 500; }

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

/* ---------- 状态标签 ---------- */

.st {
  display: inline-block;
  font-size: 12px;
  line-height: 1.7;
  padding: 1px 9px;
  border-radius: 20px;
  white-space: nowrap;
  font-weight: 500;
}

.st-new       { background: var(--brand-soft); color: var(--brand-dark); }
.st-following { background: #efeafd; color: #5a41c0; }
.st-quoted    { background: var(--warn-soft); color: #8f6007; }
.st-sampling  { background: #e2f5f1; color: #0b6f5f; }
.st-won       { background: var(--ok-soft); color: #226d33; }
.st-lost      { background: #eef0f2; color: #5b6270; }
.st-invalid   { background: var(--danger-soft); color: #9c2f24; }

/* 供应商合作状态 */
.sp-potential   { background: #eef0f2; color: #5b6270; }
.sp-contacting  { background: var(--brand-soft); color: var(--brand-dark); }
.sp-quoting     { background: var(--warn-soft); color: #8f6007; }
.sp-sampling    { background: #e2f5f1; color: #0b6f5f; }
.sp-cooperating { background: var(--ok-soft); color: #226d33; }
.sp-paused      { background: #efeafd; color: #5a41c0; }
.sp-blacklist   { background: var(--danger-soft); color: #9c2f24; }

/* 客户档案联系结果状态 */
.cus-new         { background: var(--brand-soft); color: var(--brand-dark); }
.cus-unreachable { background: var(--warn-soft); color: #8f6007; }
.cus-invalid     { background: var(--danger-soft); color: #9c2f24; }
.cus-wechat      { background: #e3f3e6; color: #1f7a43; }
.cus-refused     { background: #f6e6e3; color: #a1402f; }
.cus-pending     { background: #efeafd; color: #5a41c0; }
.cus-interested  { background: #e2f5f1; color: #0b6f5f; }
.cus-quoted      { background: #e8f1fd; color: #1a5fb4; }
.cus-won         { background: var(--ok-soft); color: #226d33; }
.cus-lost        { background: #eef0f2; color: #5b6270; }
.cus-paused      { background: #f3f0e6; color: #7a6a2f; }

/* 沉睡时长（存量客户有多"陈"）—— 这是信息，不是警报，所以不用满血红 */
.sleep-fresh { color: var(--muted); }
.sleep-mid   { color: #a06a12; }
.sleep-old   { color: #b4541f; }
.sleep-stale { color: #a3301f; font-weight: 600; }

/* 打捞进度迷你条 */
.pipe { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 14px; }
.pipe-item { flex: 1 1 148px; min-width: 148px; }
.pipe-head { display: flex; justify-content: space-between; align-items: baseline; font-size: 12.5px; color: var(--muted); margin-bottom: 5px; }
.pipe-head b { color: var(--text); font-weight: 600; }
.pipe-bar { height: 7px; border-radius: 4px; background: #eceff2; overflow: hidden; }
.pipe-bar i { display: block; height: 100%; background: var(--brand); border-radius: 4px; }
.pipe-bar.is-done i { background: var(--ok); }

/* 供应商等级徽标 */
.lv { display: inline-block; min-width: 20px; text-align: center; padding: 1px 6px; border-radius: 4px; font-size: 11.5px; font-weight: 700; }
.lv-A { background: #e8f6ec; color: #226d33; }
.lv-B { background: var(--brand-soft); color: var(--brand-dark); }
.lv-C { background: #eef0f2; color: #5b6270; }
.lv-D { background: #f3f0e6; color: #7a6a2f; }

/* 比价表 */
.price-num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.price-best { color: #1f7a34; font-weight: 700; }
.price-worst { color: #9c2f24; }
.price-na { color: var(--faint); }
.spread-pos { color: #9c2f24; }
.spread-neg { color: #1f7a34; }

.tag {
  display: inline-block;
  font-size: 12px;
  padding: 1px 8px;
  border-radius: 5px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  color: var(--muted);
  margin-right: 5px;
}

.tag-overdue { background: var(--danger-soft); border-color: #f0c9c5; color: var(--danger); font-weight: 600; }
.tag-soon { background: var(--warn-soft); border-color: #f0dcb0; color: var(--warn); }
.tag-pri { background: var(--warn-soft); border-color: #f0dcb0; color: var(--warn); }

/* ---------- 提示条 ---------- */

.flash {
  padding: 11px 15px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  font-size: 13.5px;
  border: 1px solid;
}

.flash-ok { background: var(--ok-soft); border-color: #bfe0c5; color: #226d33; }
.flash-err { background: var(--danger-soft); border-color: #f0c9c5; color: #9c2f24; }
.flash-warn { background: var(--warn-soft); border-color: #f0dcb0; color: #8f6007; }

.notice {
  background: var(--brand-soft);
  border: 1px solid #c3daf6;
  color: var(--brand-dark);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  font-size: 13px;
  margin-bottom: 16px;
}

/* ---------- 分页 ---------- */

.pager {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  padding: 13px 18px;
  border-top: 1px solid var(--line);
}

.pager-info { font-size: 12.5px; color: var(--muted); justify-self: start; }
.pager-btns { display: flex; gap: 5px; flex-wrap: wrap; justify-content: center; }

.pager-btns a {
  display: inline-block;
  min-width: 32px;
  text-align: center;
  padding: 5px 9px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  font-size: 13px;
  color: var(--text);
  background: #fff;
}

.pager-btns a:hover { background: var(--panel-soft); text-decoration: none; }
.pager-btns a.cur { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }

/* 跳转到指定页码（右侧） */
.pager-go {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--muted);
}
.pager-go .go-input {
  width: 62px;
  padding: 5px 6px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  font: inherit;
  font-size: 13px;
  text-align: center;
  color: var(--text);
  background: var(--panel);
}
.pager-go .go-input:focus { outline: none; border-color: var(--brand); }
.pager-go .btn { padding: 6px 12px; font-size: 12.5px; }

@media (max-width: 760px) {
  .pager { display: flex; flex-wrap: wrap; justify-content: center; }
  .pager-go { justify-self: center; }
}

/* ---------- 详情页 ---------- */

.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

@media (max-width: 980px) { .detail-grid { grid-template-columns: 1fr; } }

.dl { display: grid; grid-template-columns: 96px 1fr; gap: 9px 14px; font-size: 13.5px; }
.dl dt { color: var(--muted); font-size: 12.5px; }
.dl dd { margin: 0; word-break: break-word; }

.msg-box {
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 13px 15px;
  font-size: 13.5px;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.75;
}

/* ---------- 跟进时间线 ---------- */

.timeline { position: relative; padding-left: 22px; }

.timeline::before {
  content: '';
  position: absolute;
  left: 5px;
  top: 6px;
  bottom: 6px;
  width: 1px;
  background: var(--line);
}

.tl-item { position: relative; padding-bottom: 20px; }
.tl-item:last-child { padding-bottom: 0; }

.tl-item::before {
  content: '';
  position: absolute;
  left: -21px;
  top: 6px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--line-strong);
}

.tl-item.tl-active::before { border-color: var(--brand); background: var(--brand); }

.tl-head {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: var(--muted);
  margin-bottom: 5px;
}

.tl-head b { color: var(--text); font-weight: 500; font-size: 13px; }
.tl-body { font-size: 13.5px; white-space: pre-wrap; word-break: break-word; }

/* ---------- 登录页 ---------- */

.plain-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 24px;
}

.plain-wrap { width: 100%; max-width: 380px; }

.login-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 30px 28px;
  box-shadow: var(--shadow);
}

.login-card h1 { font-size: 18px; font-weight: 600; margin: 0 0 4px; }
.login-card .sub { font-size: 13px; color: var(--muted); margin: 0 0 22px; }
.login-foot { text-align: center; font-size: 12.5px; color: var(--faint); margin-top: 18px; }

/* ---------- 批量操作条 ---------- */

.bulkbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 18px;
  background: var(--brand-soft);
  border-bottom: 1px solid #c3daf6;
  font-size: 13px;
  color: var(--brand-dark);
}

.bulkbar select { width: auto; min-width: 130px; padding: 6px 28px 6px 10px; font-size: 13px; }

/* ---------- 前台表单（可嵌入） ---------- */

.form-page { max-width: 560px; margin: 0 auto; padding: 34px 20px 60px; }

.form-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 30px 28px;
  box-shadow: var(--shadow);
}

.form-card h1 { font-size: 19px; font-weight: 600; margin: 0 0 6px; }
.form-card .sub { font-size: 13px; color: var(--muted); margin: 0 0 24px; }

body.embed-mode { background: transparent; }
body.embed-mode .form-page { padding: 0; }
body.embed-mode .form-card { box-shadow: none; }

.hp-field { position: absolute; left: -9999px; top: -9999px; height: 0; overflow: hidden; }

.form-ok {
  background: var(--ok-soft);
  border: 1px solid #bfe0c5;
  color: #226d33;
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  font-size: 14px;
  text-align: center;
}

/* ---------- 响应式 ---------- */

/* v1.2.6 窄窗口按优先级收起次要列：
   保证核心列可读，同时让表格始终不超过容器宽度（不产生横向滚动条）。
   做法：col 与单元格宽度同时归 0 并裁剪内容，其余列在 table-layout:fixed 下自动放大补足。
   两个坑（都实测踩过）：
   × visibility:collapse —— Chrome 固定布局下列宽分配被打乱（公司列变 0 宽）；
   × display:none —— 单元格从行里消失导致后面单元格整体左移一列、与 colgroup 错位。
   列序（客户）：1勾选 2编号/批次 3公司 4联系人 5采购产品 6跟进记录 7状态/等级 8来源/负责人 9最后联系/沉睡 10下次联系 11操作 */
@media (max-width: 1500px) {
  table.tbl-cust th:nth-child(8), table.tbl-cust td:nth-child(8),
  table.tbl-sup  th:nth-child(8), table.tbl-sup  td:nth-child(8) {
    width: 0; padding: 0; border: none; overflow: hidden;
  }
  table.tbl-cust col:nth-child(8),
  table.tbl-sup  col:nth-child(8) { width: 0 !important; }
}
@media (max-width: 1320px) {
  table.tbl-cust th:nth-child(2), table.tbl-cust td:nth-child(2),
  table.tbl-sup  th:nth-child(2), table.tbl-sup  td:nth-child(2) {
    width: 0; padding: 0; border: none; overflow: hidden;
  }
  table.tbl-cust col:nth-child(2),
  table.tbl-sup  col:nth-child(2) { width: 0 !important; }
}

@media (max-width: 860px) {
  .app { flex-direction: column; }
  .sidebar {
    width: 100%;
    height: auto;
    position: static;
    border-right: none;
    border-bottom: 1px solid var(--line);
  }
  .nav { display: flex; gap: 6px; overflow-x: auto; padding: 8px 10px; }
  .nav-item { flex: none; margin-bottom: 0; white-space: nowrap; }
  .sidebar-foot { display: none; }
  .topbar { height: auto; padding: 12px 16px; flex-wrap: wrap; }
  .content { padding: 16px 16px 60px; }
  .dl { grid-template-columns: 1fr; gap: 3px 0; }
  .dl dd { margin-bottom: 9px; }
  .who { display: none; }
}

@media print {
  .sidebar, .topbar-actions, .bulkbar { display: none; }
  .app { display: block; }
}
