/* ========== 基础 ========== */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --primary: #1a73e8;
  --primary-dark: #1557b0;
  --success: #34a853;
  --danger: #ea4335;
  --warn: #f29900;
  --text: #202124;
  --text-sub: #5f6368;
  --border: #dadce0;
  --bg: #f1f3f4;
  --card: #ffffff;
  --radius: 8px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

/* 移动端：使用动态视口高度，避免地址栏遮挡 */
@supports (height: 100dvh) {
  .login-view { min-height: 100dvh; }
  .app-view { min-height: 100dvh; }
}

[hidden] { display: none !important; }

/* ========== 按钮 ========== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  border-radius: 6px;
  padding: 7px 14px;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, box-shadow .15s, opacity .15s;
}
.btn:hover { background: #f8f9fa; }
.btn:active { background: #f1f3f4; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn.success { background: var(--success); border-color: var(--success); color: #fff; }
.btn.success:hover { opacity: .9; }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.danger:hover { opacity: .9; }
.btn.ghost { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.28); color: #fff; }
.btn.ghost:hover { background: rgba(255,255,255,.25); }
.btn.sm { padding: 5px 10px; font-size: 13px; }
.btn.block { width: 100%; padding: 10px; font-size: 15px; }
.btn.link { border: none; background: none; color: var(--primary); padding: 3px 6px; font-size: 13px; }
.btn.link:hover { background: rgba(26,115,232,.08); border-radius: 4px; }
.btn.link.danger { color: var(--danger); }
.btn.link.danger:hover { background: rgba(234,67,53,.08); }

/* ========== 表单 ========== */
.inp,
.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 7px 10px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: #fff;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.inp:focus,
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26,115,232,.12);
}
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 13px; color: var(--text-sub); margin-bottom: 4px; }
.field label em { color: var(--danger); font-style: normal; }
.field textarea { resize: vertical; }
select.inp { cursor: pointer; }

/* ========== 登录 ========== */
.login-view {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1a73e8 0%, #1557b0 55%, #0d3f80 100%);
  padding: 20px;
}
.login-card {
  background: #fff;
  border-radius: 12px;
  padding: 36px 32px 28px;
  width: 380px;
  max-width: 100%;
  box-shadow: 0 12px 48px rgba(0,0,0,.22);
}
.login-card h1 { font-size: 21px; text-align: center; margin-bottom: 6px; }
.login-sub { text-align: center; color: var(--text-sub); font-size: 13px; margin-bottom: 24px; }
.login-card .btn.block { margin-top: 8px; }
.login-msg { margin-top: 12px; font-size: 13px; color: var(--danger); text-align: center; min-height: 20px; }
/* 安全加固：登录页展示当前生效的密码策略 / 锁定提示 */
.login-policy { margin-top: 6px; font-size: 12px; line-height: 1.5; color: var(--text-sub); text-align: center; }

/* ========== 主视图 ========== */
.app-view { min-height: 100vh; display: flex; flex-direction: column; }

.topbar {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  padding: 0 20px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  box-shadow: 0 1px 6px rgba(0,0,0,.12);
  position: sticky;
  top: 0;
  z-index: 50;
}
.brand { font-size: 17px; font-weight: 600; letter-spacing: .5px; }
.topbar-left { display: flex; align-items: center; gap: 4px; min-width: 0; }
.topbar-right { display: flex; align-items: center; gap: 8px; }
/* 汉堡菜单按钮：默认隐藏（桌面端不用），移动端媒体查询中显示 */
.btn-drawer {
  display: none;
  appearance: none;
  border: none;
  background: transparent;
  color: #fff;
  padding: 6px;
  margin: 0 2px 0 -4px;
  border-radius: 10px;
  cursor: pointer;
  line-height: 0;
  flex-shrink: 0;
}
.btn-drawer:active { background: rgba(255,255,255,.18); }
.who { font-size: 13px; opacity: .95; margin-right: 4px; }
.who b { font-weight: 600; }
.who .role-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 8px;
  border-radius: 10px;
  background: rgba(255,255,255,.22);
  font-size: 12px;
}
.ver {
  display: inline-flex;
  align-items: center;
  margin-left: 7px;
  padding: 1px 7px;
  border-radius: 10px;
  background: rgba(255,255,255,.22);
  border: 1px solid rgba(255,255,255,.45);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .3px;
  line-height: 1.5;
  white-space: nowrap;
  vertical-align: middle;
  flex-shrink: 0;
}

/* 统计 */
.stats {
  display: flex;
  gap: 10px;
  padding: 14px 20px 0;
  flex-wrap: wrap;
}
.stat-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 10px 16px;
  min-width: 88px;
  flex: 1 1 88px;
  box-shadow: 0 1px 3px rgba(0,0,0,.07);
  border-left: 3px solid var(--primary);
}
/* 统计卡统一展示：名称在前、数字在后（如「客户总数 4」） */
.stat-card {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 6px;
}
.stat-card .t { font-size: 12px; color: var(--text-sub); order: 1; }
.stat-card .n { font-size: 20px; font-weight: 700; line-height: 1.25; order: 2; }
.stat-card.lv-A { border-left-color: #d93025; }
.stat-card.lv-B { border-left-color: #f29900; }
.stat-card.lv-C { border-left-color: #1a73e8; }
.stat-card.lv-D { border-left-color: #80868b; }
.stat-card.cat { border-left-color: #34a853; }
.stat-card.total { border-left-color: #202124; }
.stat-card.st { border-left-color: #a142f4; }

/* 工具栏 */
.toolbar {
  background: var(--card);
  margin: 14px 20px 0;
  border-radius: var(--radius);
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,.07);
}
.tb-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.tb-row .inp { width: auto; min-width: 130px; }
.tb-row #fKeyword { flex: 1 1 210px; min-width: 180px; }

/* 内容 */
.content { padding: 14px 20px 28px; flex: 1; }
.table-wrap {
  background: var(--card);
  border-radius: var(--radius);
  overflow-x: auto;
  box-shadow: 0 1px 3px rgba(0,0,0,.07);
}
.table-wrap.inner { box-shadow: none; border: 1px solid var(--border); }

table { width: 100%; border-collapse: collapse; min-width: 960px; }
.table-wrap.inner table { min-width: 520px; }
thead th {
  background: #fafafa;
  text-align: left;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-sub);
  padding: 11px 12px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid #f1f3f4;
  vertical-align: middle;
  font-size: 13.5px;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #f8fbff; }
.col-ops { width: 210px; }
td.ops { white-space: nowrap; }
.name-cell { font-weight: 600; }
.muted { color: #9aa0a6; }
.empty-row { text-align: center; color: var(--text-sub); padding: 46px 10px !important; }

/* 徽标 */
.tag {
  display: inline-block;
  padding: 1px 9px;
  border-radius: 11px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}
.tag.lv-A { background: #fce8e6; color: #c5221f; }
.tag.lv-B { background: #fef7e0; color: #b06000; }
.tag.lv-C { background: #e8f0fe; color: #1967d2; }
.tag.lv-D { background: #f1f3f4; color: #5f6368; }
.tag.st-潜在 { background: #e8f0fe; color: #1967d2; }
.tag.st-跟进中 { background: #fef7e0; color: #b06000; }
.tag.st-已成交 { background: #e6f4ea; color: #137333; }
.tag.st-已流失 { background: #fce8e6; color: #c5221f; }
.tag.cat { background: #e6f4ea; color: #137333; }
.tag.none { background: #f1f3f4; color: #80868b; }

/* 分页 */
.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 0 4px;
  font-size: 13px;
  color: var(--text-sub);
  flex-wrap: wrap;
}

/* ========== 弹窗 ========== */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(32,33,36,.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}
.modal-mask.show { display: flex; }
.modal {
  background: #fff;
  border-radius: 12px;
  width: 640px;
  max-width: 100%;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 16px 48px rgba(0,0,0,.24);
  animation: pop .16s ease-out;
}
.modal.small { width: 460px; }
@keyframes pop { from { transform: scale(.96); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-head {
  padding: 18px 22px 12px;
  border-bottom: 1px solid #f1f3f4;
}
/* 客户弹窗头部：标题 + 「📇 名片识别」入口同行（不新增布局排数） */
#custModalHead { display: flex; align-items: center; justify-content: space-between; }
#custModalHead .c-ocr-tools { display: flex; align-items: center; gap: 8px; }
.modal-head h2 { font-size: 17px; font-weight: 600; }
.modal-body { padding: 18px 22px; overflow-y: auto; flex: 1; }
.modal-foot {
  padding: 12px 22px 18px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  border-top: 1px solid #f1f3f4;
}
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.modal-msg { font-size: 13px; color: var(--danger); min-height: 18px; margin-top: 4px; }
.hint { font-size: 13px; color: var(--text-sub); margin-bottom: 12px; }
.hint.warn { color: #b06000; background: #fef7e0; padding: 9px 12px; border-radius: 6px; }

.panel { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 16px; }
.panel h3 { font-size: 14px; margin-bottom: 12px; color: var(--text-sub); font-weight: 600; }

.inline-add { display: flex; gap: 8px; margin-bottom: 14px; }

.cat-list { list-style: none; max-height: 260px; overflow-y: auto; }
.cat-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 4px;
  border-bottom: 1px solid #f1f3f4;
  font-size: 14px;
}
.cat-list li:last-child { border-bottom: none; }
.cat-list .cat-count { color: var(--text-sub); font-size: 12px; margin-left: 8px; }

.follow-list { max-height: 300px; overflow-y: auto; margin-bottom: 16px; }
.follow-item {
  padding: 10px 12px;
  background: #f8f9fa;
  border-radius: 6px;
  margin-bottom: 8px;
  border-left: 3px solid var(--primary);
}
.follow-item .meta { font-size: 12px; color: var(--text-sub); margin-bottom: 4px; }
.follow-item .txt { font-size: 13.5px; white-space: pre-wrap; word-break: break-word; }
.follow-empty { color: var(--text-sub); font-size: 13px; text-align: center; padding: 22px 0; }

/* Toast */
.toast-wrap { position: fixed; top: 18px; right: 18px; z-index: 2000; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: #323232;
  color: #fff;
  padding: 10px 16px;
  border-radius: 6px;
  font-size: 13.5px;
  box-shadow: 0 4px 16px rgba(0,0,0,.24);
  animation: slidein .2s ease-out;
  max-width: 340px;
  word-break: break-word;
}
.toast.ok { background: #137333; }
.toast.err { background: #c5221f; }
@keyframes slidein { from { transform: translateX(28px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ========== 响应式：平板 ========== */
@media (max-width: 900px) {
  .stats {
    padding: 12px 12px 0;
    gap: 8px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
  }
  .stat-card { padding: 9px 12px; min-width: 0; flex: none; }
  .stat-card .n { font-size: 18px; }
  .toolbar { margin: 12px 12px 0; padding: 12px; }
  .content { padding: 12px 12px 24px; }
  .tb-row .inp { min-width: 0; flex: 1 1 130px; }
  .tb-row .btn { flex: 1 1 auto; }
}

/* ========== 响应式：手机 / 窄屏（核心适配） ========== */
@media (max-width: 820px) {
  body { font-size: 14.5px; }

  /* ---------- 顶栏 ---------- */
  .topbar {
    height: auto;
    padding: calc(10px + env(safe-area-inset-top, 0px)) 12px 10px;
    gap: 8px;
  }
  .brand { font-size: 16px; }
  .brand .ver { font-size: 10.5px; margin-left: 6px; }
  .topbar-right { gap: 8px; }
  .who { font-size: 12.5px; margin-right: 0; }
  .who .role-tag { margin-left: 4px; font-size: 11px; }

  /* 移动端导航改造：顶部 Tab 条收进左侧抽屉，顶栏左侧显示汉堡按钮（保持单行，不新增排数）。
     注意：.viewtabs 隐藏规则必须放在文件后部基础 .viewtabs{display:flex} 之后才生效，见「响应式：地图 / 地址录入」段后的 820 覆盖块 */
  .btn-drawer { display: inline-flex; align-items: center; justify-content: center; }
  .topbar-left { gap: 2px; }
  .topbar-left .brand { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }

  /* ---------- 触摸友好 ---------- */
  .btn { min-height: 42px; padding: 10px 14px; }
  .btn.sm { min-height: 38px; padding: 8px 12px; font-size: 13px; }
  .btn.link { min-height: 38px; padding: 8px 10px; }
  input, select, textarea,
  .inp,
  .field input,
  .field select,
  .field textarea {
    font-size: 16px;   /* ≥16px 防止 iOS 聚焦自动放大 */
    min-height: 44px;  /* 保证手指点击区域 */
  }

  /* ---------- 统计卡 ---------- */
  .stats { grid-template-columns: repeat(auto-fit, minmax(80px, 1fr)); }
  .stat-card .n { font-size: 17px; }
  .stat-card .t { font-size: 11.5px; }

  /* ---------- 工具栏 ---------- */
  .toolbar { gap: 8px; }
  .tb-row { gap: 8px; }
  .tb-row #fKeyword { flex: 1 1 100%; min-width: 0; }
  .tb-row .inp { min-width: 0; flex: 1 1 calc(50% - 4px); }
  .tb-row .btn { flex: 1 1 calc(50% - 4px); }
  .tb-row #btnAdd { flex: 1 1 100%; }

  /* ---------- 表格 → 卡片 ---------- */
  .table-wrap,
  .table-wrap.inner {
    background: transparent;
    box-shadow: none;
    border: none;
    border-radius: 0;
    overflow-x: visible;
  }
  .table-wrap table,
  #custTable,
  .table-wrap.inner table {
    display: block;
    width: 100%;
    min-width: 0;
  }
  .table-wrap thead { display: none; }
  .table-wrap tbody { display: block; }
  .table-wrap tbody tr {
    display: block;
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: 0 1px 3px rgba(0,0,0,.07);
    padding: 12px 14px;
    margin-bottom: 10px;
  }
  .table-wrap tbody td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: auto;
    padding: 7px 0;
    border-bottom: 1px dashed #f1f3f4;
    font-size: 14px;
    text-align: right;
    word-break: break-word;
  }
  .table-wrap tbody td::before {
    content: attr(data-label);
    flex: 0 0 auto;
    color: var(--text-sub);
    font-size: 13px;
    text-align: left;
  }
  .table-wrap tbody tr:last-child td { border-bottom: none; }

  /* 卡片首行 = 姓名，作为标题 */
  #custBody td:first-child {
    font-size: 16.5px;
    font-weight: 600;
    padding: 0 0 9px;
    margin-bottom: 4px;
    border-bottom: 1px solid #f1f3f4;
    text-align: left;
  }
  #custBody td:first-child::before { content: none; }

  /* 操作区 */
  .table-wrap tbody td.ops {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
    white-space: normal;
    padding: 10px 0 0;
    margin-top: 6px;
    border-top: 1px solid #f1f3f4;
    border-bottom: none;
  }
  .table-wrap tbody td.ops::before { content: none; }
  .table-wrap tbody td.ops .btn.link {
    flex: 1 1 auto;
    justify-content: center;
    min-height: 38px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #fff;
  }
  .table-wrap tbody td.ops .btn.link.danger { border-color: #f3c2bd; }
  .table-wrap tbody td.ops .btn.link:active { background: #f1f3f4; }

  /* 弹窗内表格里的下拉框 */
  .table-wrap tbody td select.inp { width: auto; flex: 0 1 62%; min-width: 0; }

  /* 空状态 */
  .table-wrap tbody td.empty-row {
    display: block;
    text-align: center;
    border-bottom: none;
    padding: 34px 10px !important;
    margin-bottom: 0 !important;
  }
  .table-wrap tbody td.empty-row::before { content: none; }

  /* ---------- 弹窗：底部抽屉式 ---------- */
  .modal-mask { padding: 0; align-items: flex-end; }
  .modal {
    width: 100%;
    max-width: 100%;
    max-height: 92vh;
    max-height: 92dvh;
    border-radius: 16px 16px 0 0;
  }
  .modal-head { padding: 16px 16px 10px; }
  .modal-body { padding: 14px 16px; }
  .modal-foot {
    padding: 10px 16px calc(12px + env(safe-area-inset-bottom, 0px));
    background: #fff;
    box-shadow: 0 -1px 8px rgba(0,0,0,.07);
  }
  .modal-foot .btn { flex: 1 1 0; min-height: 46px; }
  .grid2 { grid-template-columns: 1fr; gap: 0; }
  .col-ops { width: auto; }
  .panel { padding: 12px 14px; }
  .inline-add { flex-wrap: wrap; }
  .inline-add .inp { flex: 1 1 auto; }
  .inline-add .btn { flex: 0 0 auto; }
  .cat-list { max-height: none; }
  .follow-list { max-height: 46vh; }
  .cat-list li { padding: 11px 4px; }

  /* ---------- 分页 ---------- */
  .pager { flex-direction: column; gap: 10px; padding: 14px 0 6px; }
  .pager .btn { width: 100%; min-height: 44px; font-size: 14px; }

  /* ---------- 提示 ---------- */
  .toast-wrap { top: 12px; left: 12px; right: 12px; }
  .toast { max-width: none; }

  /* ---------- 登录页 ---------- */
  .login-view { padding: 16px; }
  .login-card { width: 100%; padding: 28px 20px 22px; border-radius: 14px; }
  .login-card h1 { font-size: 19px; }
  .login-sub { font-size: 12.5px; margin-bottom: 20px; }
  .btn.block { min-height: 46px; }

  /* ---------- 触屏：消除 hover 残留 ---------- */
  tbody tr:hover { background: transparent; }
  .table-wrap tbody tr:hover { background: var(--card); }
}

/* ========== 响应式：小屏手机 ========== */
@media (max-width: 480px) {
  .stats { grid-template-columns: repeat(auto-fit, minmax(72px, 1fr)); gap: 6px; }
  .stat-card { padding: 8px 10px; }
  .stat-card .n { font-size: 16px; }
  .stat-card .t { font-size: 11px; }
  .brand { font-size: 15px; }
  .topbar-right { flex-wrap: nowrap; }
  .topbar-right .btn.sm { padding: 4px 8px; font-size: 12px; }
  .topbar-right .who { max-width: 42vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .toolbar { padding: 10px; }
  .table-wrap tbody tr { padding: 11px 12px; }
}

/* ============================================================
 * 客户地址 + 地图分布
 * ============================================================ */

/* hidden 属性必须优先于组件自身的 display，避免视图切换失效 */
#mapView[hidden],
#listView[hidden],
.unlocated-wrap[hidden],
#btnClearLoc[hidden] { display: none !important; }

/* ---------- 视图切换 ---------- */
.viewtabs {
  display: flex;
  gap: 6px;
  margin: 12px 22px 0;
  border-bottom: 1px solid var(--border);
}
.vtab {
  appearance: none;
  border: none;
  background: transparent;
  padding: 10px 16px;
  font-size: 14.5px;
  color: var(--text-sub);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.vtab:hover { color: var(--text); }
.vtab.active {
  color: var(--primary);
  font-weight: 600;
  border-bottom-color: var(--primary);
}

/* ---------- 移动端左侧抽屉导航（汉堡菜单，模仿 DeepSeek 手机端） ---------- */
.drawer-mask {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .45);
  z-index: 200;
}
.drawer-mask[hidden] { display: none !important; }
.drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 286px;
  max-width: 84vw;
  background: #fff;
  z-index: 201;
  box-shadow: 2px 0 18px rgba(0,0,0,.18);
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform .24s ease;
  visibility: hidden;
}
.drawer.open {
  transform: translateX(0);
  visibility: visible;
}
.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: calc(14px + env(safe-area-inset-top, 0px)) 14px 12px 18px;
  border-bottom: 1px solid #eef0f3;
}
.drawer-title { font-size: 16.5px; font-weight: 700; color: #1a2333; letter-spacing: .3px; }
.btn-drawer-close {
  appearance: none;
  border: none;
  background: transparent;
  color: #5b6776;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  cursor: pointer;
  line-height: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.btn-drawer-close:active { background: #f1f3f6; }
.drawer-menu {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 12px 10px 14px;
}
.d-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 13px 14px;
  margin-bottom: 5px;
  border: none;
  background: transparent;
  border-radius: 12px;
  font-size: 15.5px;
  font-weight: 700;
  color: #334155;
  text-align: left;
  cursor: pointer;
  line-height: 1.25;
}
.d-item svg { flex-shrink: 0; color: #64748b; }
.d-item span { flex: 1; min-width: 0; }
.d-item .badge-dot {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 19px;
  height: 19px;
  padding: 0 6px;
  border-radius: 10px;
  background: #e5484d;
  color: #fff;
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1;
}
.d-item .badge-dot[hidden] { display: none; }
.d-item:active { background: #f1f5fb; }
.d-item.active { background: #eef3fb; color: #1a73e8; }
.d-item.active svg { color: #1a73e8; }
.drawer-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 18px calc(14px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid #eef0f3;
}
.drawer-ver {
  font-size: 12px;
  font-weight: 600;
  color: #94a3b8;
  padding: 2px 9px;
  border-radius: 10px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
}
.drawer-copy { font-size: 11.5px; color: #b6c0cc; }

/* ---------- 分布地图 ---------- */
.map-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: 0 1px 3px rgba(0,0,0,.07);
  overflow: hidden;
}
.map-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px 14px;
  border-bottom: 1px solid #f1f3f4;
}
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: var(--text-sub); }
.legend .lg-item { display: inline-flex; align-items: center; gap: 5px; }
.legend .lg-item i {
  width: 11px; height: 11px;
  border-radius: 50%;
  display: inline-block;
  border: 1px solid rgba(0,0,0,.12);
}
.legend .lg-item b { color: var(--text); }
.map-actions { display: flex; gap: 8px; }

.map-box {
  height: clamp(360px, 56vh, 700px);
  width: 100%;
  background: #eef1f5;
}
.map-note {
  padding: 10px 14px;
  font-size: 12.5px;
  color: var(--text-sub);
  border-top: 1px solid #f1f3f4;
  line-height: 1.6;
}
.map-note b { color: var(--text); }
.map-note .warn-txt { color: #b06000; font-weight: 600; }

/* 未定位客户清单 */
.unlocated-wrap {
  border-top: 1px solid #f1f3f4;
  padding: 12px 14px 14px;
}
.u-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.u-head h3 { font-size: 14px; font-weight: 600; }
.u-cnt { color: #b06000; font-weight: 600; font-size: 13px; margin-left: 4px; }
.unlocated-wrap .hint { margin: 8px 0 10px; }
.unlocated-list { list-style: none; max-height: 240px; overflow-y: auto; }
.unlocated-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 4px;
  border-bottom: 1px solid #f1f3f4;
}
.unlocated-list li:last-child { border-bottom: none; }
.unlocated-list .u-main { min-width: 0; }
.unlocated-list .u-main b { font-size: 14px; }
.unlocated-list .u-addr {
  font-size: 12.5px;
  color: var(--text-sub);
  margin-top: 3px;
  word-break: break-word;
}
.unlocated-list .muted { color: #9aa0a6; }

/* 地图标记 */
.crm-pin { background: transparent; border: none; }
.crm-pin svg { display: block; filter: drop-shadow(0 2px 3px rgba(0,0,0,.3)); }
.crm-pin-pick svg { filter: drop-shadow(0 2px 5px rgba(0,0,0,.42)); }

/* 标记弹窗（客户摘要） */
.leaflet-popup-content { margin: 12px 14px; font-size: 13px; }
.cust-pop { min-width: 200px; }
.cust-pop .cp-name {
  font-size: 15px;
  font-weight: 600;
  padding-bottom: 7px;
  margin-bottom: 7px;
  border-bottom: 1px solid #f1f3f4;
}
.cust-pop .cp-row { display: flex; gap: 8px; line-height: 1.75; }
.cust-pop .cp-row .k { flex: 0 0 52px; color: var(--text-sub); }
.cust-pop .cp-row .v { flex: 1 1 auto; word-break: break-word; }
.cust-pop .cp-ops { margin-top: 8px; padding-top: 6px; border-top: 1px solid #f1f3f4; text-align: right; }
.leaflet-container { font-family: inherit; }

/* ---------- 客户表单：地址与选点地图 ---------- */
.addr-row { display: flex; gap: 8px; align-items: stretch; }
.addr-box { flex: 1 1 auto; min-width: 0; position: relative; }
.addr-box input { width: 100%; min-width: 0; }
.addr-row .btn { flex: 0 0 auto; white-space: nowrap; }
.lbl-sub { font-weight: 400; font-size: 12px; color: var(--text-sub); margin-left: 6px; }
.addr-hint-line { font-size: 12px; color: var(--text-sub); margin-top: 6px; line-height: 1.6; }

/* 地址联想下拉（支持键盘 / 鼠标 / 触摸） */
.addr-suggest {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 1300;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .14);
  max-height: 264px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.addr-suggest.drop-up { top: auto; bottom: calc(100% + 4px); }
.addr-suggest[hidden] { display: none; }
.addr-suggest .addr-item {
  padding: 9px 12px;
  cursor: pointer;
  border-bottom: 1px solid #f1f3f4;
  touch-action: manipulation;
}
.addr-suggest .addr-item:last-child { border-bottom: none; }
.addr-suggest .addr-item:hover,
.addr-suggest .addr-item.active { background: #eef3fd; }
.addr-suggest .addr-item .lbl { display: block; font-size: 13.5px; line-height: 1.5; word-break: break-word; }
.addr-suggest .addr-item .meta { display: block; font-size: 11.5px; color: var(--text-sub); margin-top: 2px; }
.addr-suggest .addr-hint { padding: 10px 12px; font-size: 12.5px; color: var(--text-sub); line-height: 1.6; }
.addr-suggest .addr-hint.warn { color: #b06000; background: #fef7e0; }
.addr-suggest .addr-hint.info { color: var(--text-sub); background: #f5f7fb; }

.pick-map {
  height: 250px;
  width: 100%;
  border-radius: 8px;
  border: 1px solid var(--border);
  overflow: hidden;
  z-index: 0;
}
.coord-row { display: flex; align-items: center; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.coord-row .coord { font-size: 12.5px; color: var(--text-sub); display: inline-flex; align-items: center; gap: 6px; }
.coord-row .coord input {
  width: 118px;
  min-width: 0;
  padding: 7px 9px;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.addr-tip { font-size: 12.5px; color: var(--text-sub); margin-top: 8px; line-height: 1.6; }
.addr-tip.warn { color: #b06000; background: #fef7e0; padding: 8px 10px; border-radius: 6px; }

/* 名片图片：弹窗预览与列表缩略图 */
.card-preview { margin: 6px 0 8px; }
.card-preview .card-preview-img {
  display: block;
  max-width: 100%;
  max-height: 240px;
  border-radius: 8px;
  border: 1px solid var(--border);
  cursor: zoom-in;
}
.lead-card-thumb {
  width: 42px;
  height: 42px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border);
  cursor: zoom-in;
  vertical-align: middle;
}

/* 列表里的地址列 */
.addr-cell { max-width: 220px; word-break: break-word; }
.addr-cell .tag.none { font-size: 11px; }

/* 移动端友好：电话拨号 / 地址导航（元素仅手机端渲染，样式不影响桌面端布局） */
.tel-link { color: #1a73e8; text-decoration: none; border-bottom: 1px dashed rgba(26,115,232,.4); font-weight: 600; }
.tel-link:active { opacity: .7; }
.addr-wrap { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; word-break: break-word; }
.nav-link { display: inline-flex; align-items: center; justify-content: center; color: #fff; background: #1a73e8; border: 1px solid #1557b0; border-radius: 6px; padding: 6px 14px; font-size: 16px; font-weight: 700; line-height: 1.4; text-decoration: none; white-space: nowrap; vertical-align: middle; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.nav-link:active { opacity: .8; }

/* Leaflet 容器样式劫持修复：地图弹窗位于 .leaflet-container 内，Leaflet 自带
   .leaflet-container a { color: rgb(0,120,168) }（特异性 0,1,1）会覆盖 .nav-link 白字
   与 .tel-link 品牌蓝（特异性 0,1,0），导致弹窗内按钮蓝底深蓝字、对比度低。
   此处提高特异性强制恢复弹窗内白字按钮与品牌蓝电话。 */
.leaflet-container a.nav-link { color: #fff; }
.leaflet-container a.nav-link:active { opacity: .8; }
.leaflet-container a.tel-link { color: #1a73e8; border-bottom-color: rgba(26,115,232,.4); }

/* ---------- 手机端：地图与地址录入 ---------- */
@media (max-width: 900px) {
  .viewtabs { margin: 10px 12px 0; }
  .vtab { flex: 1 1 0; text-align: center; padding: 10px 8px; font-size: 14px; }
}

/* 【导航改造覆盖块】必须位于基础 .viewtabs{display:flex} 之后（文档后部）才生效：
   窄屏（≤820px）隐藏中部 Tab 条，仅保留汉堡按钮 + 左侧抽屉导航 */
@media (max-width: 820px) {
  .viewtabs { display: none; }
}

@media (max-width: 820px) {
  /* 分布视图：地图占据主要高度，图例换行 */
  .map-bar { padding: 10px 12px; }
  .map-actions .btn { flex: 1 1 auto; }
  .map-box { height: clamp(300px, 48vh, 460px); min-height: 300px; }
  .map-note { padding: 10px 12px; font-size: 12px; }
  .unlocated-wrap { padding: 12px; }
  .unlocated-list { max-height: none; }
  .unlocated-list li { padding: 12px 4px; }
  .unlocated-list .btn { min-height: 38px; flex: 0 0 auto; }

  /* 弹窗内的选点地图：略矮，避免抽屉过高 */
  .pick-map { height: 210px; }
  .addr-row { flex-direction: column; align-items: stretch; }
  .addr-row .btn { min-height: 44px; }
  .coord-row { gap: 8px; }
  .coord-row .coord { flex: 1 1 calc(50% - 4px); }
  .coord-row .coord input { width: 100%; font-size: 16px; min-height: 44px; }
  .coord-row #btnClearLoc { flex: 1 1 100%; min-height: 40px; }
  .addr-tip { font-size: 12px; }

  /* 地址联想：触摸友好，限制高度避免被软键盘遮挡 */
  .addr-suggest { max-height: 46vh; }
  .addr-suggest .addr-item {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 44px;
    padding: 10px 12px;
  }
  .addr-suggest .addr-item .lbl { font-size: 15px; }

  /* 卡片化后地址独立成行 */
  .table-wrap tbody td.addr-cell { max-width: none; }
  .cust-pop { min-width: 0; }
  .leaflet-popup-content { margin: 12px; }
  .cust-pop .cp-row .k { flex: 0 0 46px; }
}

/* ========== 企业信息智能查询：公司名联想 + 企业档案 ========== */
.ent-box { position: relative; }
/* 公司名联想下拉：由脚本按输入框的视口坐标写入内联样式定位（不依赖父容器是否定位），
   下列重置值确保脚本未执行 / 旧版缓存 CSS 生效时也不会跑到页面底部 */
.ent-suggest {
  position: fixed;
  left: auto;
  right: auto;
  top: auto;
  bottom: auto;
  width: auto;
  max-height: 46vh;
}

.ent-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fafbfc;
  padding: 12px;
}
.ent-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.ent-head label { font-weight: 600; font-size: 13px; }
.ent-head .lbl-sub { font-weight: 400; color: var(--text-sub); font-size: 12px; }
.ent-actions { display: inline-flex; gap: 6px; }

/* 付款风险评级胶囊 */
.ent-risk { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.risk-pill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  background: #9aa0a6;
}
.risk-pill.low { background: var(--success); }
.risk-pill.mid { background: var(--warn); }
.risk-pill.high { background: var(--danger); }
.risk-pill.unknown { background: #9aa0a6; }
.risk-score { font-size: 12px; color: var(--text-sub); }
.risk-reasons { list-style: none; flex-basis: 100%; margin-top: 2px; }
.risk-reasons li {
  font-size: 12.5px;
  color: var(--text-sub);
  line-height: 1.7;
  padding-left: 12px;
  position: relative;
}
.risk-reasons li::before { content: '\00b7'; position: absolute; left: 3px; }

/* 工商字段网格 */
.ent-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.ent-cell {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 9px;
  min-width: 0;
}
.ent-cell.wide { grid-column: 1 / -1; }
.ent-k { display: block; font-size: 11.5px; color: var(--text-sub); }
.ent-v { display: block; font-size: 13px; word-break: break-word; }
.ent-kw { display: block; font-size: 11.5px; color: var(--text-sub); margin-top: 3px; }
.ent-src { font-size: 11.5px; color: var(--text-sub); }
.ent-note { margin-top: 8px; font-size: 11.5px; color: var(--text-sub); line-height: 1.6; }
.ent-msg { margin-top: 6px; font-size: 12.5px; line-height: 1.6; }
.ent-msg.warn { color: #b06000; background: #fef7e0; border-radius: 6px; padding: 6px 9px; }
.ent-msg.info { color: var(--text-sub); }

/* 风险标签（列表公司列 + 档案内线索） */
.tag.risk-hit { background: #fce8e6; color: #c5221f; }
.tag.risk-low { background: #e6f4ea; color: #137333; }
.tag.risk-mid { background: #fef7e0; color: #b06000; }
.tag.risk-high { background: #fce8e6; color: #c5221f; }
.tag.risk-unknown { background: #f1f3f4; color: var(--text-sub); }

/* 手机端：字段单列、候选行触摸友好、表单元素放大避免 iOS 自动缩放 */
@media (max-width: 640px) {
  .ent-grid { grid-template-columns: 1fr; }
  .ent-head { align-items: flex-start; }
  .ent-suggest .addr-item { min-height: 44px; padding: 10px 12px; }
  .ent-suggest .addr-item .lbl { font-size: 15px; }
  .ent-actions .btn { min-height: 36px; }
}


/* ============================================================
 * 线索池 / 一客多联系人 / 跟进记录时间线与提醒
 * ============================================================ */

/* ---------- 分段控件（视图内快速范围切换） ---------- */
.seg {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  max-width: 100%;
  flex-wrap: wrap;
}
.seg-btn {
  appearance: none;
  border: none;
  border-right: 1px solid var(--border);
  background: #fff;
  color: var(--text-sub);
  font-family: inherit;
  font-size: 13px;
  padding: 7px 12px;
  cursor: pointer;
  white-space: nowrap;
}
.seg-btn:last-child { border-right: none; }
.seg-btn:hover { background: #f8f9fa; }
.seg-btn.active { background: #e8f0fe; color: var(--primary); font-weight: 600; }

/* ---------- 复选标签 ---------- */
.chk {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-sub);
  cursor: pointer;
  margin-right: 14px;
}
.chk input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer; }

/* ---------- 线索 / 联系人 / 跟进 专用徽标 ---------- */
.tag.ld-未跟进 { background: #f1f3f4; color: #5f6368; }
.tag.ld-跟进中 { background: #fef7e0; color: #b06000; }
.tag.ld-已转化 { background: #e6f4ea; color: #137333; }
.tag.ld-无效 { background: #fce8e6; color: #c5221f; }
.tag.pool { background: #fef7e0; color: #b06000; }
.tag.owner { background: #e8f0fe; color: #1967d2; }
.tag.primary-contact { background: #e8f0fe; color: #1967d2; }
.tag.decision-contact { background: #e6f4ea; color: #137333; }
.tag.kind { background: #f1f3f4; color: #444b52; }
.tag.due-overdue { background: #fce8e6; color: #c5221f; }
.tag.due-today { background: #fef7e0; color: #b06000; }
.tag.due-soon { background: #e8f0fe; color: #1967d2; }
.tag.due-done { background: #e6f4ea; color: #137333; }
.tag.muted { background: #f1f3f4; color: #80868b; }
.tag-line { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ct-count { font-size: 12px; color: var(--text-sub); }

/* ---------- 下次跟进提醒中心 ---------- */
.remind-panel {
  background: var(--card);
  margin: 14px 20px 0;
  border-radius: var(--radius);
  padding: 12px 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,.07);
}
.remind-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.remind-head h3 { font-size: 15px; font-weight: 600; }
.remind-head .hint { margin: 0; flex: 1 1 auto; }
.remind-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.remind-col { border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; min-width: 0; }
.remind-col h4 { font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.remind-col .cnt { display: inline-block; margin-left: 6px; font-size: 12px; color: var(--text-sub); font-weight: 400; }
.remind-col.overdue { border-left: 3px solid var(--danger); }
.remind-col.overdue h4 { color: #c5221f; }
.remind-col.today { border-left: 3px solid var(--warn); }
.remind-col.today h4 { color: #b06000; }
.remind-col.soon { border-left: 3px solid var(--primary); }
.remind-col.soon h4 { color: #1967d2; }
.remind-item {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  background: #fafafa;
  border-radius: 6px;
  padding: 7px 9px;
  margin-bottom: 6px;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.5;
}
.remind-item:hover { background: #f1f3f4; }
.remind-item .r-cust { font-weight: 600; }
.remind-item .r-meta { display: block; font-size: 12px; color: var(--text-sub); }
.remind-item .r-note { display: block; font-size: 12px; color: var(--text-sub); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.remind-empty { font-size: 12.5px; color: var(--text-sub); padding: 6px 2px; }

/* ---------- 跟进时间线 ---------- */
.timeline {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: 0 1px 3px rgba(0,0,0,.07);
  padding: 14px 18px;
}
.timeline.mini { box-shadow: none; border: 1px solid var(--border); max-height: 300px; overflow-y: auto; margin-bottom: 16px; padding: 10px 12px; }
.tl-item { position: relative; padding: 0 0 16px 26px; border-left: 2px solid #e8eaed; }
.tl-item:last-child { border-left-color: transparent; padding-bottom: 4px; }
.tl-dot {
  position: absolute;
  left: -7px;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--primary);
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px #e8eaed;
}
.tl-item.due-overdue .tl-dot { background: var(--danger); }
.tl-item.due-today .tl-dot { background: var(--warn); }
.tl-item.done .tl-dot { background: var(--success); }
.tl-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tl-cust { font-weight: 600; font-size: 14px; }
.tl-meta { font-size: 12px; color: var(--text-sub); }
.tl-body { margin-top: 4px; font-size: 13.5px; white-space: pre-wrap; word-break: break-word; }
.tl-next { margin-top: 4px; font-size: 12.5px; color: var(--text-sub); }
.tl-next b { color: var(--text); font-weight: 600; }
.tl-ops { margin-top: 6px; display: flex; gap: 4px; flex-wrap: wrap; }

/* ---------- 线索批量导入：未导入明细 ---------- */
.imp-result { margin-top: 10px; border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; max-height: 200px; overflow: auto; background: #fafbfc; }
.imp-res-title { font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.imp-res-row { display: flex; gap: 8px; font-size: 12.5px; padding: 4px 0; border-bottom: 1px dashed var(--border); line-height: 1.5; }
.imp-res-row:last-child { border-bottom: 0; }
.imp-res-row .ln { color: var(--text-sub); white-space: nowrap; }
.imp-res-row .rs { color: var(--danger); white-space: nowrap; }
.imp-res-row .raw { color: var(--text-sub); flex: 1 1 auto; word-break: break-all; }
.imp-res-more { font-size: 12.5px; color: var(--text-sub); padding-top: 6px; text-align: center; }

/* ---------- 手机端适配 ---------- */
@media (max-width: 640px) {
  .remind-panel { margin: 12px 12px 0; }
  .remind-cols { grid-template-columns: 1fr; }
  .seg { flex: 1 1 100%; }
  .seg-btn { flex: 1 1 auto; text-align: center; min-height: 40px; }
  .timeline { padding: 12px 12px; }
}

/* ============================================================
 * P0 提效改造样式（追加块，无外部依赖）
 * P0-1 多视图/自定义列 · P0-2 概览与钻取 · P0-3 表单分组与查重
 * P0-4 行内写跟进与分区 · P0-5 通知按钮 · P0-7 导出弹窗
 * ============================================================ */

/* ---------- 通用：可点击统计卡片 ---------- */
/* 统计卡统一展示：名称在前、数字在后（如「客户总数 4」） */
.stat {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 6px;
  background: var(--card);
  border-radius: var(--radius);
  padding: 8px 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .07);
  border-left: 3px solid var(--primary);
  min-width: 0;
}
.stat .t { font-size: 12px; color: var(--text-sub); order: 1; }
.stat .n { font-size: 18px; font-weight: 700; line-height: 1.25; order: 2; }
.stat.total { border-left-color: #202124; }
.stat[data-drill] { cursor: pointer; transition: box-shadow .15s, transform .15s; }
.stat[data-drill]:hover { box-shadow: 0 2px 10px rgba(0, 0, 0, .12); transform: translateY(-1px); }
.stat[data-drill]::after { content: '›'; float: right; opacity: .35; }
.stats.in-panel { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 900px) {
  /* 手机/平板：统计卡压缩内边距，保证「名称 数字」尽量同行 */
  .stat { padding: 6px 9px; }
  .stat .t { font-size: 11.5px; }
  .stat .n { font-size: 17px; }
}
.p0-block-title { font-size: 13px; font-weight: 600; color: #555; margin: 12px 0 6px; }

/* ---------- P0-2 统计区分组美化（客户列表 #statsBar） ---------- */
/* statsBar 由横向平铺改为按组纵向堆叠：客户规模/等级分布/状态分布/来源分布 */
#statsBar { display: block; padding: 14px 20px 0; }
#statsBar .stat-group { margin-bottom: 4px; }
#statsBar .stat-group .p0-block-title { margin: 10px 0 8px; }
#statsBar .stats.in-panel { padding: 0; gap: 10px; }
#statsBar .stat {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 8px;
  background: var(--card);
  border-radius: var(--radius);
  padding: 9px 14px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .07);
  border-left: 3px solid var(--primary);
  min-width: 0;
}
#statsBar .stat .t { font-size: 12px; color: var(--text-sub); order: 1; }
#statsBar .stat .n {
  font-size: 22px; font-weight: 800; line-height: 1.2; order: 2;
  font-variant-numeric: tabular-nums; color: var(--text);
}
#statsBar .stat[data-drill] { cursor: pointer; transition: box-shadow .15s, transform .15s; }
#statsBar .stat[data-drill]:hover {
  box-shadow: 0 3px 12px rgba(0, 0, 0, .14);
  transform: translateY(-2px);
}
#statsBar .stat[data-drill]::after { content: '›'; float: right; opacity: .35; }
/* 色条柔和化：同组同色系，浅色描边衬托 */
#statsBar .stat { border-left-color: rgba(66, 133, 244, .55); }
#statsBar .stat.total { border-left-color: rgba(32, 33, 36, .75); }
#statsBar .stat.lv-A { border-left-color: rgba(217, 48, 37, .65); }
#statsBar .stat.lv-B { border-left-color: rgba(242, 153, 0, .7); }
#statsBar .stat.lv-C { border-left-color: rgba(26, 115, 232, .65); }
#statsBar .stat.lv-D { border-left-color: rgba(128, 134, 139, .75); }
#statsBar .stat.cat { border-left-color: rgba(52, 168, 83, .6); }
#statsBar .stat.st { border-left-color: rgba(161, 66, 244, .6); }
@media (max-width: 900px) {
  #statsBar { padding: 12px 12px 0; }
  #statsBar .stat-group .p0-block-title { margin: 8px 0 6px; }
  #statsBar .stats.in-panel { gap: 8px; }
  #statsBar .stat { padding: 7px 11px; }
  #statsBar .stat .t { font-size: 11.5px; }
  #statsBar .stat .n { font-size: 19px; }
}

/* ---------- P0-2 概览工作台 ---------- */
.ov-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.ov-head h2 { margin: 0; font-size: 18px; }
.ov-head .pipe-hint { font-size: 12px; }
.todo-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 10px; }
.todo-card { border: 1px solid #e6e8eb; border-radius: 8px; padding: 10px 12px; background: #fff; }
/* 「我的待办」分区卡片配色（截图1 下次跟进提醒样式：已逾期红 / 今日到期橙 / 未来7天蓝 / 超期未跟进灰） */
.todo-card .todo-hint { color: #8a929c; font-size: 11px; font-weight: 400; margin-left: 6px; }
.todo-card--overdue { background: #fff5f5; border-color: #f5c2c7; }
.todo-card--overdue .todo-name { color: #c53030; }
.todo-card--overdue .todo-count { background: #fed7d7; color: #c53030; }
.todo-card--today { background: #fffaf0; border-color: #fbd38d; }
.todo-card--today .todo-name { color: #c05621; }
.todo-card--today .todo-count { background: #feebc8; color: #c05621; }
.todo-card--soon { background: #f0f7ff; border-color: #bee3f8; }
.todo-card--soon .todo-name { color: #2b6cb0; }
.todo-card--soon .todo-count { background: #e2efff; color: #2b6cb0; }
.todo-card--late { background: #fafbfc; border-color: #d9dee4; }
.todo-card--late .todo-name { color: #4a5560; }
.todo-card--late .todo-count { background: #eef0f3; color: #6b7480; }
.todo-head { display: flex; align-items: center; justify-content: space-between; font-weight: 600; margin-bottom: 6px; }
.todo-count { background: #eef4ff; color: #2b6cb0; border-radius: 10px; padding: 1px 9px; font-size: 12px; }
.todo-list { margin: 0 0 6px; padding-left: 16px; }
.todo-list li { font-size: 13px; line-height: 1.7; }
.todo-title { display: inline-block; }
.todo-sub { color: #8a929c; font-size: 12px; margin-left: 6px; }
.todo-desc { display: block; color: #6b7480; font-size: 12px; line-height: 1.6; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.todo-more { margin-top: 2px; }
.p0-mini-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.p0-mini-item { background: #f6f7f9; border-radius: 6px; padding: 3px 9px; font-size: 12px; color: #4a5560; }

/* ---------- P0-1 列表多视图 / 自定义列 ---------- */
.list-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.list-tools .chk { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: #4a5560; }
#cvPageSize { width: auto; min-width: 96px; }
.colpicker { position: relative; }
.colpicker-panel { position: absolute; right: 0; top: 28px; z-index: 60; width: 290px; max-height: 340px; overflow: auto;
  background: #fff; border: 1px solid #dfe3e8; border-radius: 8px; box-shadow: 0 6px 20px rgba(0, 0, 0, .16); padding: 8px; }
.colpicker-row { display: flex; align-items: center; gap: 8px; padding: 3px 2px; font-size: 12.5px; }
.colpicker-row .cp-show { flex: 1 1 auto; display: flex; align-items: center; gap: 6px; }
.colpicker-row .cp-w { width: 68px; padding: 2px 6px; }
.colpicker-row .cp-lock { display: flex; align-items: center; gap: 4px; color: #6b7480; white-space: nowrap; }
table.p0-dense tbody td { padding: 3px 8px; font-size: 12.5px; }
table.p0-dense thead th { padding: 5px 8px; font-size: 12px; }
.p0-grip { display: inline-block; width: 8px; margin-left: 6px; height: 12px; cursor: col-resize; border-left: 1px dashed #c9cfd6; vertical-align: middle; }
.p0-lock { display: inline-block; margin-left: 6px; font-size: 10px; color: #98a1ab; }
.p0-cardbox { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); gap: 10px; padding: 8px 0; align-items: start; }
.p0-cardbox > .remind-empty { grid-column: 1 / -1; }
.p0-card { border: 1px solid #e6e8eb; border-radius: 8px; padding: 10px 12px; background: #fff; }
.p0-card-head { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; flex-wrap: wrap; }
.p0-card-line { font-size: 12.5px; color: #4a5560; line-height: 1.8; word-break: break-all; }
.p0-card-ops { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.primary-link { font-weight: 600; }

/* 手机窄屏：卡片强制单列铺满（桌面/平板由 auto-fill 网格自适应多列并铺满右侧） */
@media (max-width: 560px) {
  .p0-cardbox { grid-template-columns: 1fr; }
}

/* ---------- P0-3 客户表单分组 / 查重 ---------- */
.p0-groups { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 10px; }
.p0-chip { border: 1px solid #d8dde4; background: #f8f9fb; color: #46505c; border-radius: 14px;
  padding: 3px 11px; font-size: 12.5px; cursor: pointer; }
.p0-chip:hover { background: #eef2f7; }
.p0-chip.ghost { border-style: dashed; color: #7b848f; }
.p0-chip.dim { opacity: .55; }
.p0-group { border: 1px solid #e9ecf0; border-radius: 8px; padding: 8px 10px 4px; margin-bottom: 10px; }
.p0-group .p0-title { margin: 0 0 6px; font-size: 13.5px; color: #2f3a46; cursor: pointer; user-select: none; }
.p0-group .p0-title::before { content: '▾'; display: inline-block; width: 14px; color: #98a1ab; transition: transform .15s; }
.p0-group.collapsed .p0-title::before { transform: rotate(-90deg); }
.p0-group.collapsed > *:not(.p0-title) { display: none; }
.modal-body.p0-one-col .grid2 { grid-template-columns: 1fr; }
.dup-hint { border: 1px solid #ffe0a3; background: #fffaf0; color: #8a5a00; border-radius: 6px;
  padding: 6px 10px; font-size: 12.5px; margin-bottom: 8px; }
.dup-hint ul { margin: 4px 0 0; padding-left: 18px; }
/* ---------- 客户表单：联系人与决策人（可增删行） ---------- */
.ct-rows { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
/* 基本信息分组的收敛说明（姓名 / 职位 / 电话 / 邮箱已并入下方联系人分组） */
#custBasicHint { margin: 6px 0 0; font-size: 12px; line-height: 1.5; color: var(--muted); }
.ct-row { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; align-items: center;
  border: 1px dashed #e3e7ec; border-radius: 8px; padding: 8px; background: #fbfcfd; }
/* 一行联系人 = 6 个字段位：首行「姓名 / 职位 / 微信号」，次行「邮箱 / 电话 / 角色」，
   末行「决策人 / 移除」，桌面端固定 3 列 x 2 行，字段再多也不会互相挤压 */
.ct-row .ct-name, .ct-row .ct-position, .ct-row .ct-role { grid-column: span 2; }
.ct-row .ct-wechat, .ct-row .ct-email, .ct-row .ct-phone { grid-column: span 2; }
.ct-row .ct-dec { grid-column: span 3; }
.ct-row .ct-del { grid-column: span 3; justify-self: end; }
.ct-row .inp { min-width: 0; width: 100%; }
.ct-row .ct-dec { white-space: nowrap; font-size: 12.5px; display: inline-flex; align-items: center; gap: 4px; }
.ct-row .ct-del { white-space: nowrap; }
.ct-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 8px 0 4px; }
.ct-actions .muted { font-size: 12px; }
@media (max-width: 640px) {
  /* 手机窄屏：联系人行改为两列，姓名字段独占整行，避免多列挤压导致文字重叠 / 误触 */
  .ct-row { grid-template-columns: 1fr 1fr; gap: 6px; }
  .ct-row .ct-name, .ct-row .ct-position, .ct-row .ct-role, .ct-row .ct-wechat { grid-column: 1 / -1; }
  .ct-row .ct-email, .ct-row .ct-phone { grid-column: span 1; }
  .ct-row .ct-dec { grid-column: 1; justify-self: start; }
  .ct-row .ct-del { grid-column: 2; justify-self: end; }
  /* 分类补充说明在窄屏独占整行 */
  #cCategoryCustomWrap { grid-column: 1 / -1; }
  .ct-actions { gap: 8px; }
  .ct-actions .muted { flex: 1 1 100%; }
}

/* ---------- P0-4 跟进分区 / 时间线 ---------- */
.p0-split { margin: 8px 0; }
.p0-tabs { display: flex; gap: 6px; margin-bottom: 8px; }
.p0-tab { border: 1px solid #d8dde4; background: #fff; border-radius: 14px; padding: 3px 12px;
  font-size: 12.5px; cursor: pointer; color: #46505c; }
.p0-tab.active { background: #2b6cb0; border-color: #2b6cb0; color: #fff; }
.p0-tabbody { max-height: 320px; overflow: auto; }
.p0-tl-group { margin-bottom: 10px; }
.p0-tl-head { font-size: 12.5px; font-weight: 600; padding: 4px 8px; border-radius: 6px; background: #f2f4f7; color: #46505c; }
.p0-tl-head.overdue { background: #fdecec; color: #b42318; }
.p0-tl-head.today { background: #fff4e5; color: #b25e09; }
.p0-tl-head.future { background: #eef4ff; color: #2b6cb0; }
.p0-tl-count { float: right; }
.p0-tl-item { border-left: 3px solid #e6e8eb; padding: 6px 10px; margin: 6px 0 6px 4px; }
.p0-tl-meta { display: flex; gap: 8px; align-items: center; font-size: 12px; }
.p0-tl-body { font-size: 13px; line-height: 1.7; margin: 3px 0; word-break: break-word; }
.p0-tl-foot { font-size: 11.5px; }
.p0-chain-row { display: flex; justify-content: space-between; gap: 10px; padding: 6px 4px; border-bottom: 1px dashed #eceff2; }
.p0-chain-main { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.p0-chain-sub { color: #8a929c; font-size: 12px; }
.p0-chain-contact { color: #4a5560; font-size: 12.5px; white-space: nowrap; }
input.p0-flash, textarea.p0-flash { outline: 2px solid #2b6cb0; transition: outline .2s; }

/* ---------- 完成详情弹窗（标记完成确认） ---------- */
.fw-detail { border: 1px solid var(--border); border-radius: 8px; padding: 2px 14px; margin-bottom: 12px; background: #fafbfc; }
.fw-row { display: flex; gap: 12px; padding: 9px 0; border-bottom: 1px dashed var(--border); font-size: 14px; line-height: 1.55; }
.fw-row:last-child { border-bottom: none; }
.fw-k { flex: 0 0 74px; color: var(--text-sub); font-size: 13px; }
.fw-v { flex: 1 1 auto; min-width: 0; white-space: pre-wrap; word-break: break-word; }
.field .lbl-sub { font-size: 12px; color: #9aa2ad; font-weight: 400; }
@media (max-width: 480px) {
  .fw-k { flex-basis: 60px; }
  .fw-detail { padding: 2px 12px; }
}

/* ============================================================
 * 订单管理模块（orders tab）
 * ============================================================ */
.o-stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
/* 修复：orderStats 外层 .stats.in-panel 为 flex，内部 grid 被收缩为单列导致右侧空白 */
#orderStats { display: block; }
#orderStats .o-stats-grid { width: 100%; }
.o-stat { background: #f7f9fb; border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: row; align-items: baseline; justify-content: space-between; gap: 6px; }
.o-stat .o-stat-v { font-size: 19px; font-weight: 700; color: var(--text-main); line-height: 1.2; }
.o-stat .o-stat-k { font-size: 12px; color: var(--text-sub); }
.o-stat.warn .o-stat-v { color: var(--warn, #b26a00); }
.o-stat.danger .o-stat-v { color: var(--danger); }
.o-due-pill { margin-top: 10px; padding: 8px 12px; border-radius: 8px; background: #fff7e6; border: 1px solid #f5c76b; color: #8a5a00; font-size: 13px; }
.o-due-pill.has-overdue { background: #fdecea; border-color: #ef9a9a; color: #b3261e; }
.o-due-pill b { font-weight: 700; }

.o-badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 12px; line-height: 1.5; white-space: nowrap; }
.o-badge-open { background: #e8f0fe; color: #1a73e8; }
.o-badge-partial { background: #fef7e0; color: #b26a00; }
.o-badge-shipped { background: #e6f4ea; color: #188038; }

.o-due-soon { color: #b26a00; font-weight: 600; }
.o-due-overdue { color: #b3261e; font-weight: 700; }
.o-val-warn { color: #b3261e; }

.o-overdue-toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-main); cursor: pointer; white-space: nowrap; }
.o-overdue-toggle input { width: 16px; height: 16px; accent-color: var(--danger); }

.orders-cards { display: none; }

.o-card { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; box-shadow: 0 1px 2px rgba(0,0,0,.04); cursor: pointer; }
.o-card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; flex-wrap: wrap; gap: 6px; }
.o-card-head b { font-size: 15px; }
.o-card-ops { display: inline-flex; gap: 6px; margin-left: 8px; }
.o-card-ops .btn { padding: 2px 8px; font-size: 12px; }
.o-card-line { font-size: 13px; color: var(--text-main); line-height: 1.7; display: flex; flex-wrap: nowrap; gap: 8px; }
.o-card-line span { color: var(--text-sub); flex: 0 0 40px; }
.o-card-line.o-due-soon span, .o-card-line.o-due-overdue span { flex-basis: 40px; }
/* 废旧订单（作废视图） */
.o-row-void td { color: #9aa2ad; background: #fafbfc; }
.o-row-void td.o-void-cell, .o-row-void td.o-ops { background: #fafbfc; }
.o-card-void { opacity: .72; }
.o-void-cell { font-size: 12px; color: #9aa2ad; min-width: 180px; }
.o-void-info { color: #b26a00; }
.o-void-none { color: #d7dbe0; }
.o-void-line { color: #b26a00; }
.o-badge-void { background: #eef0f2; color: #6b7280; border: 1px solid #e2e6ea; }
#oShowVoid.on { border-color: var(--primary, #2f6fed); color: var(--primary, #2f6fed); background: rgba(47, 111, 237, .06); }

/* 订单列表操作列 */
#ordersTable .o-ops { white-space: nowrap; }
#ordersTable .o-ops .btn { padding: 2px 8px; font-size: 12px; }
#ordersTable .o-ops-na { color: var(--text-sub); }

/* 详情抽屉 */
.order-drawer { width: 760px; max-width: 100%; }
.order-drawer .modal-body { max-height: 78vh; overflow-y: auto; }
.order-drawer .btn.ghost { background: #f1f3f4; border-color: #d4d9de; color: #3c4043; }
.order-drawer .btn.ghost:hover { background: #e3e7ea; }
.od-block { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; margin-bottom: 12px; background: #fff; }
.od-block h4 { margin: 0 0 8px; font-size: 14px; display: inline-flex; align-items: center; gap: 8px; }
.od-block-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.od-block-head h4 { margin-bottom: 0; }
.od-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px 14px; font-size: 13.5px; }
.od-grid > div { line-height: 1.6; }
.od-grid span { color: var(--text-sub); margin-right: 6px; }
.od-summary { display: flex; flex-wrap: wrap; gap: 10px; }
.od-summary > div { flex: 1 1 130px; background: #f7f9fb; border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; display: flex; flex-direction: row; align-items: baseline; justify-content: space-between; gap: 6px; }
.od-summary span { font-size: 12px; color: var(--text-sub); }
.od-summary b { font-size: 16px; }
.od-hint { margin-top: 8px; font-size: 12px; color: var(--text-sub); }
.od-imgs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.od-img { width: 72px; height: 72px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border); background: #f1f3f4; }
.od-ship { border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; margin-bottom: 10px; background: #fafbfc; }
.od-ship-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13.5px; }
.od-ship-head b { font-size: 14px; }
.od-ship-date, .od-ship-prog { color: var(--text-sub); font-size: 12.5px; }
.od-ship-sub { font-size: 12.5px; color: var(--text-sub); margin: 4px 0; }
.od-receipts { margin: 6px 0; border-top: 1px dashed var(--border); padding-top: 6px; }
.od-receipt-line { display: flex; align-items: center; gap: 10px; font-size: 13px; padding: 4px 0; }
.od-receipt-date { color: var(--text-main); }
.od-receipt-amt { font-weight: 600; }
.od-receipt-rmk { flex: 1 1 auto; color: var(--text-sub); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.od-receipts-empty { font-size: 12.5px; color: #9aa2ad; padding: 4px 0; }

/* 弹窗通用（订单模块） */
.o-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.o-modal-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 14px; }
.o-cust-row { display: flex; gap: 8px; }
.o-cust-row .inp:first-child { flex: 0 0 200px; }
.o-cust-row .inp:last-child { flex: 1 1 auto; }
.o-cust-hint { margin: 6px 0 4px; font-size: 12.5px; color: #d93026; background: #fdecea; border: 1px solid #f5c6c1; border-radius: 6px; padding: 6px 10px; }
.o-ocr-tip { margin: 6px 0 10px; font-size: 12.5px; color: #6b7280; background: #f4f6f8; border-radius: 6px; padding: 6px 10px; }
.o-ocr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; margin-top: 4px; }
.o-ship-match { margin: 2px 0 12px; display: flex; flex-direction: column; gap: 8px; }
.o-ship-match-card { border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; background: #fafbfc; }
.o-ship-match-card.sel { border-color: #1a73e8; background: #eef4fd; box-shadow: 0 0 0 1px #1a73e8 inset; }
.o-ship-match-main { font-size: 14px; margin-bottom: 4px; }
.o-ship-match-line { font-size: 12.5px; color: var(--text-sub); margin: 2px 0; }
.o-ship-match-act { margin-top: 6px; }
.o-ship-nomatch { color: #d93025; }
.o-ocr-card { border: 1px solid #c9d2dc; border-radius: 10px; padding: 10px 12px; background: #fbfcfe; }
.o-ocr-head { font-weight: 600; font-size: 13px; margin-bottom: 8px; }
.o-ocr-file { color: var(--text-sub); font-weight: 400; font-size: 12px; }
.order-modal .modal { width: 780px; }
.order-modal .modal-body { max-height: 78vh; overflow-y: auto; }

@media (max-width: 640px) {
  .o-stats-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .o-stat .o-stat-v { font-size: 16px; }
  #ordersTableWrap { display: none; }
  .orders-cards { display: block; }
  .o-grid2 { grid-template-columns: 1fr; }
  .o-cust-row { flex-direction: column; }
  .o-cust-row .inp:first-child { flex: none; width: 100%; }
  .od-grid { grid-template-columns: 1fr 1fr; }
  .o-ocr-grid { grid-template-columns: 1fr; }
  #orderToolbar .tb-row { flex-wrap: nowrap; gap: 6px; }
  #orderToolbar .tb-row .btn { flex: 1 1 auto; min-width: 0; padding: 8px 8px; font-size: 12.5px; white-space: nowrap; }
  #orderToolbar .tb-row .inp { min-width: 0; }
}
/* 修复：820px 断点全局 .tb-row .btn 按 50% 换行导致订单按钮组挤压重叠，改为单行紧凑 */
@media (max-width: 820px) {
  #orderToolbar .tb-row { flex-wrap: nowrap; gap: 6px; }
  #orderToolbar .tb-row .btn { flex: 1 1 auto; min-width: 0; padding: 8px 10px; font-size: 13px; white-space: nowrap; }
  #orderToolbar .tb-row .inp { min-width: 0; }
}
@media (max-width: 480px) {
  #orderToolbar .tb-row { gap: 4px; }
  #orderToolbar .tb-row .btn { padding: 7px 7px; font-size: 12px; }
}


/* ===== 修复：删除按钮 ghost 白字白底在白色卡片/表格上完全隐形 ===== */
.o-card-ops .btn.ghost,
#ordersTable .o-ops .btn.ghost {
  background: #fff;
  border-color: #f3c2bd;
  color: #d93025;
}
.o-card-ops .btn.ghost:hover,
#ordersTable .o-ops .btn.ghost:hover {
  background: #fdecea;
}
