/* ============================================================
   外部群管理系统 · 设计规范（Design Tokens）
   —— 字体：微软雅黑 light/regular/bold + Arial
   —— 字号：24 大标题 / 18 中标题 / 16 小标题 / 14 正常 / 12 提示标签
   —— 主色：4F46E5 / 0F172A（云擎 YunQing 靛蓝 · 品牌·导航·强文字）
   —— 语义色：8B5CF6 / 10B981 / 0EA5E9 / EF4444 / F59E0B（accent·success·info·danger·warning，对齐 YunQing）
   —— 中性色：F8FAFC / F1F5F9 / E2E8F0（bg·card·line，对齐 YunQing slate 体系）
   ============================================================ */

:root {
  /* ---------- 字体规范（保持原规范） ---------- */
  --font-zh: "Microsoft YaHei", "微软雅黑", "HarmonyOS Sans SC", "PingFang SC", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-en: Arial, "Microsoft YaHei", "HarmonyOS Sans SC", sans-serif;
  --font-base: "Microsoft YaHei", "微软雅黑", "HarmonyOS Sans SC", "PingFang SC", Arial, sans-serif;
  --fw-light: 300;
  --fw-regular: 400;
  --fw-bold: 700;

  /* 字号阶梯（保持原规范） */
  --fs-24: 24px;
  --fs-18: 18px;
  --fs-16: 16px;
  --fs-14: 14px;
  --fs-13: 13px;
  --fs-12: 12px;

  /* ---------- 主色调（对齐云擎系统 YunQing 设计令牌） ---------- */
  --primary: #4F46E5;                 /* 品牌靛蓝 primary */
  --primary-dark: #0F172A;           /* 标题/强文字 textStrong */
  --primary-soft: rgba(79,70,229,.10);
  --primary-soft-2: rgba(79,70,229,.16);
  /* 兼容别名（既有选择器沿用） */
  --blue: #4F46E5;
  --blue-d: #0F172A;
  --blue-soft: rgba(79,70,229,.10);

  /* ---------- 辅助色（图标 / 操作按钮，对齐 YunQing 语义色） ---------- */
  --c-accent: #8B5CF6;   /* 操作强调 · 对齐设计 accent 紫 */
  --c-success: #10B981;  /* 成功 · 对齐设计 success */
  --c-info: #0EA5E9;     /* 信息 · 对齐设计 info 蓝 */
  --c-gray: #94A3B8;     /* 次要 · 对齐设计 textMuted */
  --c-danger: #EF4444;   /* 危险 · 对齐设计 danger */
  --c-warning: #F59E0B;  /* 提醒 · 对齐设计 warning */
  --danger: #EF4444;
  --danger-soft: rgba(239,68,68,.10);

  /* ---------- 其他色（边框 / 背景，对齐 YunQing slate 体系） ---------- */
  --bg: #F8FAFC;
  --bg-list: #F1F5F9;
  --card: #FFFFFF;
  --card-2: #F1F5F9;
  --text: #1E293B;       /* 正文 slate-800 */
  --muted: #64748B;      /* 次要文字 slate-500 */
  --line: #E2E8F0;
  --line-strong: #CBD5E1;
  --field-bg: #F8FAFC;
  --field-border: #CBD5E1;
  --field-hint: #64748B;
  --chip: #F1F5F9;
  --chip-text: #1E293B;
  --track: #E2E8F0;

  /* 形状 & 阴影（对齐 YunQing radius 8/6/12） */
  --radius: 8px;
  --radius-sm: 6px;
  --radius-lg: 12px;
  --shadow: 0 1px 2px rgba(15,23,42,.04), 0 4px 16px rgba(15,23,42,.05);
  --shadow-hover: 0 8px 28px rgba(15,23,42,.10);
  --ring: 0 0 0 3px rgba(79,70,229,.18);

  /* 侧栏 & 顶栏（侧栏暂保持浅色；是否改深色见说明） */
  --side-bg: #111827;
  --header-bg: rgba(255,255,255,.72);
  --header-border: rgba(255,255,255,.55);
}

/* ---------- 深色主题（主色保持品牌） ---------- */
[data-theme="dark"] {
  --bg: #0B1430;
  --bg-list: #101B3D;
  --card: #12204A;
  --card-2: #0F1A3D;
  --text: #E8ECFF;
  --muted: #8893B8;
  --line: #233160;
  --line-strong: #2C3C70;
  --field-bg: #0C173A;
  --field-border: #2C3E6E; /* 暗色下输入框边框 */
  --chip: #1A2A57;
  --chip-text: #C9D2F5;
  --track: #1A2A57;
  --primary-soft: rgba(79,70,229,.20);
  --primary-soft-2: rgba(79,70,229,.28);
  --danger-soft: rgba(255,0,0,.16);
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.35);
  --shadow-hover: 0 12px 34px rgba(0,0,0,.55);
  --ring: 0 0 0 3px rgba(79,70,229,.30);
  --side-bg: #111827;
  --header-bg: rgba(34,49,95,.66);
  --header-border: rgba(255,255,255,.08);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }

body {
  font-family: var(--font-base);
  font-weight: var(--fw-regular);
  background-color: var(--bg);
  color: var(--text);
  font-size: var(--fs-14);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color .35s ease, color .35s ease;
}
a { color: inherit; text-decoration: none; }

/* 主题切换平滑过渡 */
.app-sidebar, .card, .filter-box, .stat, .login-card, .group-card, .field-item,
input[type=text], input[type=number], input[type=password], input[type=url], input[type=date],
select, textarea, .tag, .chip, .chk, .badge, .rel-type, .btn, .nav-item,
.timeline .tl-item::after {
  transition: background-color .35s ease, border-color .35s ease, color .35s ease, box-shadow .25s ease, transform .2s cubic-bezier(.16,1,.3,1);
}

/* ============================================================
   布局：左侧固定导航（品牌色）+ 右侧内容
   ============================================================ */
.app-shell { min-height: 100vh; }

.app-sidebar {
  position: fixed; top: 60px; bottom: 0; left: 0; width: 180px;
  background: var(--side-bg); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 20px 16px 16px; z-index: 30;
}
.side-nav { display: flex; flex-direction: column; gap: 10px; flex: 1; overflow-y: auto; overflow-x: hidden; scrollbar-width: thin; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  min-height: 35px; box-sizing: border-box; padding: 0 14px; line-height: 1.2;
  border-radius: 0; color: var(--muted);
  font-size: var(--fs-14); white-space: nowrap; font-weight: var(--fw-regular); position: relative;
}
.nav-item svg { flex-shrink: 0; }
.side-nav .nav-item > svg, .side-nav .nav-group > svg:not(.nav-caret) { width: 16px; height: 16px; }
.nav-item:hover { background: var(--primary-soft); color: var(--primary-dark); }
.nav-item.active { background: var(--primary-soft); color: var(--primary); font-weight: var(--fw-bold); }
.nav-item.active::before {
  content: ''; position: absolute; left: 0; top: 9px; bottom: 9px;
  width: 3px; border-radius: 3px; background: var(--primary);
}

/* 二级导航父级（企微客群）与可折叠子项 */
.nav-group {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 8px 12px; border-radius: 0; color: var(--muted);
  font-size: var(--fs-14); white-space: nowrap; font-weight: var(--fw-regular);
  background: none; border: none; cursor: pointer; font-family: inherit; text-align: left; position: relative;
}
.nav-group:hover { background: var(--primary-soft); color: var(--primary-dark); }
.nav-group.active { background: var(--primary-soft); color: var(--primary); font-weight: var(--fw-bold); }
.nav-group.active::before {
  content: ''; position: absolute; left: 0; top: 9px; bottom: 9px;
  width: 3px; border-radius: 3px; background: var(--primary);
}
.nav-group .nav-caret { margin-left: auto; transition: transform .2s; flex-shrink: 0; width: 12px; height: 12px; }
.nav-group.collapsed .nav-caret { transform: rotate(90deg); }
.nav-sub { display: flex; flex-direction: column; gap: 10px; margin: 2px 0; padding-left: 16px; border-left: 1px solid var(--line); }
.nav-sub.hide { display: none; }
.nav-sub .nav-item { font-size: var(--fs-13); padding: 9px 12px; min-height: 35px; box-sizing: border-box; }
  /* 展开态：二级菜单不重复显示父级标题（父级 nav-group 已显示），仅折叠态飞出面板保留 */
  .nav-sub-head, .nav-sub-rule { display: none; }
.side-bottom {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  border-top: 1px solid var(--line); padding-top: 12px; font-size: var(--fs-12);
}
.side-bottom .side-user { color: var(--text); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-bottom .side-logout { color: var(--muted); }
.side-bottom .side-logout:hover { color: var(--c-danger); }

.side-theme {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--line); background: var(--card); color: var(--text);
  padding: 0; transition: transform .2s, background-color .35s, border-color .35s, box-shadow .2s;
}
.side-theme:hover { transform: translateY(-1px); box-shadow: var(--shadow); border-color: var(--line-strong); }
.side-theme:active { transform: scale(.94); }
.side-theme svg { width: 17px; height: 17px; }
.side-theme .i-moon { display: none; }
[data-theme="dark"] .side-theme .i-sun { display: none; }
[data-theme="dark"] .side-theme .i-moon { display: block; }

.app-content { margin-left: 180px; margin-top: 0; padding-top: 60px; min-height: calc(100vh - 60px); display: flex; flex-direction: column; min-width: 0; }
.app-main { width: 100%; margin: 0; padding: 22px 24px 24px; flex: 1; box-sizing: border-box; min-width: 0; max-width: 100%; overflow-x: clip; }

.app-scrim { display: none; }

/* 移动端顶栏（默认隐藏） */
.mobile-bar { display: none; }

/* ============================================================
   左导航折叠（仅图标态，桌面端生效）
   ============================================================ */
@media (min-width: 861px) {
  .app-sidebar { transition: width .25s cubic-bezier(.16,1,.3,1), background-color .35s, border-color .35s; }
  html.sidebar-collapsed .app-sidebar { width: 72px; padding: 16px 8px; }
  html.sidebar-collapsed .app-content { margin-left: 72px; }
  html.sidebar-collapsed .tb-brand { display: none; }            /* 折叠态隐藏"云擎系统"文字，仅留 Logo */
  html.sidebar-collapsed .tb-left { width: 72px; }               /* 左区收窄，与折叠导航同宽 */
  html.sidebar-collapsed .tb-divider { left: 72px; }             /* 分割线对齐折叠后导航右侧 */
  html.sidebar-collapsed .side-nav { overflow: visible; }
  html.sidebar-collapsed .nav-item { justify-content: center; padding: 8px 0; }
  html.sidebar-collapsed .nav-item span { display: none; }
  html.sidebar-collapsed .nav-group { justify-content: center; padding: 8px 0; }
  html.sidebar-collapsed .nav-group > span,
  html.sidebar-collapsed .nav-group .nav-caret { display: none; }
  html.sidebar-collapsed .side-bottom { justify-content: center; }
  html.sidebar-collapsed .side-bottom .side-user,
  html.sidebar-collapsed .side-bottom .side-logout { display: none; }
  /* 折叠态：分组 hover 飞出二级菜单面板（对齐设计 26:315「Flyout · 客群管理」） */
  html.sidebar-collapsed .nav-sub {
    display: none; position: absolute;
    width: 130px;                   /* 设计面板宽 130 */
    flex-direction: column; gap: 0; margin: 0; padding: 8px;   /* 设计 padding 8 */
    z-index: 1000;
    background: #1E293B;            /* 设计 Flyout 面板色（非 #111827） */
    border: 1px solid #334155; border-radius: 8px;             /* 设计边框 / 圆角 8 */
    box-shadow: 0 12px 30px rgba(0,0,0,.35);
  }
  html.sidebar-collapsed .nav-sub.open { display: flex; }
  /* 面板内：父级标题 + 分隔线（仅折叠态显示，对齐设计 Parent Header / Divider） */
  html.sidebar-collapsed .nav-sub-head {
    display: flex; align-items: center; height: 30px; padding: 0 6px 8px;
    color: #F1F5F9; font-size: 13px; font-weight: 500; white-space: nowrap;
  }
  html.sidebar-collapsed .nav-sub-rule { display: block; height: 1px; background: #334155; margin: 0 0 4px; }
  /* 子项（对齐设计 Sub Item：高 32、圆角 6、slate-400，hover 填 #334155 变近白） */
  html.sidebar-collapsed .nav-sub .nav-item {
    justify-content: flex-start; padding: 0 8px; height: 32px; min-height: 32px;
    border-radius: 0; color: #94A3B8; font-size: 13px; gap: 8px;
  }
  html.sidebar-collapsed .nav-sub .nav-item span { display: inline; }
  html.sidebar-collapsed .nav-sub .nav-item svg { display: none; }   /* 面板内仅文字，对齐设计 */
  html.sidebar-collapsed .nav-sub .nav-item:hover { background: #334155; color: #F1F5F9; }
  html.sidebar-collapsed .nav-sub .nav-item.active { background: #334155; color: #F1F5F9; font-weight: 500; }
  /* 单 item 标签 tooltip（对齐设计 8px 间距，面板同色 #1E293B） */
  html.sidebar-collapsed .side-nav > .nav-item:hover::after {
    content: attr(data-tip); position: absolute; left: calc(100% + 8px); top: 50%; transform: translateY(-50%);
    background: #1E293B; color: #F1F5F9; font-size: 13px; padding: 6px 10px; border-radius: 6px;
    white-space: nowrap; box-shadow: 0 8px 20px rgba(0,0,0,.3); z-index: 1000; pointer-events: none;
  }
}

/* 左导航折叠按钮 */
.side-collapse {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 6px; cursor: pointer;
  border: none; background: #1E293B; color: #94A3B8; padding: 0;
  transition: background-color .2s, color .2s, transform .2s;
}
.side-collapse:hover { transform: translateY(-1px); box-shadow: var(--shadow); border-color: var(--line-strong); }
.side-collapse:active { transform: scale(.94); }
.side-collapse svg { width: 16px; height: 16px; }

/* ============ 全局顶栏（对齐 YunQing Topbar 设计） ============ */
.app-topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  height: 60px; flex-shrink: 0;
  background: #FFFFFF; border-bottom: 1px solid #E2E8F0;
  display: flex; align-items: center;
  padding: 0 24px;
}
.tb-left { display: flex; align-items: center; gap: 8px; width: 156px; flex-shrink: 0; min-width: 0; }
.tb-logo { width: 28px; height: 28px; flex-shrink: 0; display: block; object-fit: contain; }
.tb-brand { font-size: 16px; font-weight: 700; color: #0F172A; white-space: nowrap; }
.tb-divider { position: absolute; left: 180px; top: 18px; width: 1px; height: 24px; background: #E2E8F0; flex-shrink: 0; }
.tb-head { display: inline-flex; align-items: flex-end; margin-left: 16px; min-width: 0; }
.tb-title { font-size: 16px; font-weight: 600; color: #0F172A; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-meta { font-size: 12px; color: #94A3B8; margin-left: 8px; white-space: nowrap; flex-shrink: 0; line-height: 1.4; }
/* 顶栏操作插槽：紧跟页面标题（如月度报表的年月选择+查看），覆盖全局 .filter-bar 默认样式以适配顶栏紧凑视觉 */
.tb-ops { display: inline-flex; align-items: center; margin-left: 16px; gap: 8px; min-width: 0; }
.tb-ops form { display: inline-flex; align-items: center; gap: 8px; margin: 0; padding: 0; background: transparent; border: none; box-shadow: none; }
.tb-ops input[type=month] { height: 32px; box-sizing: border-box; padding: 0 10px; border: 1px solid #E2E8F0; border-radius: 6px; background: #fff; color: #0F172A; font-size: 13px; font-family: inherit; outline: none; transition: border-color .12s ease; }
.tb-ops input[type=month]:focus { border-color: #4F46E5; box-shadow: 0 0 0 3px rgba(79,70,229,.15); }
.tb-ops button { height: 32px; box-sizing: border-box; padding: 0 14px; border: none; border-radius: 6px; background: #4F46E5; color: #fff; font-size: 13px; font-weight: 600; cursor: pointer; transition: background-color .12s ease; }
.tb-ops button:hover { background: #4338CA; }
.tb-right { display: flex; align-items: center; gap: 12px; flex-shrink: 0; margin-left: auto; }
.tb-notif {
  width: 32px; height: 32px; border-radius: 8px; background: #F1F5F9; border: none; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; color: #64748B;
  transition: background-color .15s, color .15s;
}
.tb-notif:hover { background: #E2E8F0; color: #0F172A; }
.tb-avatar {
  width: 32px; height: 32px; border-radius: 999px; background: #4F46E5; color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; flex-shrink: 0;
}
/* 企微登录后展示真实头像（img 复用 .tb-avatar 的尺寸与圆角） */
.tb-avatar--img { object-fit: cover; background: #F1F5F9; border: 1px solid var(--line); }
.tb-user { font-size: 13px; font-weight: 500; color: #0F172A; white-space: nowrap; }
.tb-logout { font-size: 13px; color: #64748B; text-decoration: none; margin-left: 4px; padding-left: 12px; border-left: 1px solid #E2E8F0; transition: color .15s; }
.tb-logout:hover { color: #EF4444; }
.mobile-logout { margin-left: auto; font-size: 13px; color: #64748B; text-decoration: none; }
.mobile-logout:hover { color: #EF4444; }
@media (max-width: 860px) { .app-topbar { display: none; } }

/* ============================================================
   通用按钮（主色实心 / 危险 / 幽灵）
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 16px; border: 1px solid var(--line); border-radius: 10px; font-size: var(--fs-14); cursor: pointer;
  background: var(--chip); color: var(--text); font-family: inherit; font-weight: var(--fw-regular);
  transition: background-color .15s ease, border-color .15s ease, transform .12s ease, box-shadow .15s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.btn:active { transform: translateY(0) scale(.98); }
.btn-primary { background: var(--primary); color: #fff; border-color: transparent; box-shadow: 0 4px 14px rgba(79,70,229,.28); }
.btn-primary:hover { background: #4338CA; box-shadow: 0 6px 18px rgba(79,70,229,.34); }
.btn-ghost { background: var(--card); border-color: var(--line-strong); color: var(--text); }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }
.btn-danger { background: var(--c-danger); color: #fff; border-color: transparent; box-shadow: 0 4px 14px rgba(255,0,0,.24); }
.btn-danger:hover { filter: brightness(.96); }
.btn-block { width: 100%; padding: 12px; font-size: var(--fs-16); }

/* ---------- 提示（成功绿 / 错误红） ---------- */
.alert { padding: 11px 15px; border-radius: 10px; margin-bottom: 14px; font-size: var(--fs-14); border: 1px solid transparent; }
.alert-error { background: var(--danger-soft); color: var(--c-danger); border-color: rgba(255,0,0,.2); }
.field-error { color: var(--c-danger); font-size: var(--fs-12); margin-top: 4px; line-height: 1.4; }
.alert-ok { background: rgba(81,187,111,.12); color: var(--c-success); border-color: rgba(81,187,111,.25); }

/* ---------- 页面头 ---------- */
/* 字段设置齿轮按钮（对齐设计系统 Gear Button：32×32 / #F1F5F9 / 圆角 8 / 靛蓝齿轮） */
.gear-btn {
  width: 32px; height: 32px; border-radius: 8px; background: #F1F5F9;
  border: none; cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: background-color .15s;
}
.gear-btn:hover { background: #E2E8F0; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; min-width: 0; }
.page-head h1 { font-size: var(--fs-24); margin: 0; letter-spacing: .2px; font-weight: var(--fw-bold); color: var(--primary-dark); flex-shrink: 0; white-space: nowrap; }
/* 全局隐藏内容区页面大标题（2026-08-28 用户指定）：顶栏已有同名标题，内容区重复。
   覆盖 .page-head / .fm-head；详情页 .detail-head 的动态实体名（客户名/群名，顶栏没有）保留不隐藏。
   ph-ops 操作按钮组不受影响（margin-left:auto 自动靠右）。 */
.page-head h1, .fm-head h1 { display: none; }
.count { color: var(--muted); font-size: var(--fs-14); font-weight: var(--fw-regular); }
.muted { color: var(--muted); font-size: var(--fs-12); }
.hint { color: var(--muted); font-size: var(--fs-12); }
.req { color: var(--c-danger); }

/* ---------- 卡片 ---------- */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px; margin-bottom: 10px; box-shadow: var(--shadow);
}
.card h2 { font-size: var(--fs-16); margin: 0 0 8px; font-weight: var(--fw-bold); color: var(--primary-dark); }
.card h3 { font-size: var(--fs-12); color: var(--muted); margin: 16px 0 8px; font-weight: var(--fw-regular); }

/* ---------- 筛选 ---------- */
.filter-box { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; margin-bottom: 14px; box-shadow: var(--shadow); }
.filter-box summary { cursor: pointer; font-weight: var(--fw-bold); font-size: var(--fs-14); list-style: none; display: flex; align-items: center; gap: 6px; }
.filter-box summary::-webkit-details-marker { display: none; }
.filter-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; margin-top: 12px; }
.fg { display: flex; flex-direction: column; gap: 4px; }
.fg label { font-size: var(--fs-12); color: var(--muted); }
.filter-actions { display: flex; gap: 8px; margin-top: 12px; }

/* ---------- 表单 ---------- */
.edit-form h2, .field-form h2 { font-size: var(--fs-16); margin: 18px 0 10px; border-left: 3px solid var(--primary); padding-left: 8px; font-weight: var(--fw-bold); }
.form-row { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.form-row label { font-size: var(--fs-12); color: var(--muted); }
.form-row.two-col { flex-direction: row; gap: 16px; align-items: flex-start; }
.form-row.two-col > .form-row { flex: 1 1 0; min-width: 0; }
.form-row-inline { flex-direction: row; align-items: center; gap: 12px; }
.form-row-inline label { margin: 0; }
/* 水平表单行：标签右对齐、输入框左对齐（新增资产等 iframe 弹框） */
.form-row-h { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.form-row-h > label { flex: 0 0 70px; text-align: right; font-size: var(--fs-13); color: var(--muted); font-weight: 500; }
.form-row-h > input, .form-row-h > select, .form-row-h > textarea { flex: 1 1 auto; min-width: 0; }
.form-row-h > .hint { flex: 0 0 auto; font-size: var(--fs-12); color: var(--muted); }
.form-row-h .switch { flex: 0 0 auto; }
/* 关联发票下拉：每条发票强制独占一行（flex 容器），防止动态内容里的特殊字符击穿行内 style 导致整片并排 */
.inv-dd-item { display: flex !important; align-items: center; gap: 8px; padding: 10px 12px; cursor: pointer; border-bottom: 1px solid var(--line); margin: 0; font-size: 14px; line-height: 1.5; }
.inv-dd-item:hover { background: var(--bg); }
.inv-dd-item .invChk { flex-shrink: 0; }
.inv-dd-item > span { flex: 1; min-width: 0; }
/* ============ 可搜索下拉（public/js/search-select.js —— 渐进增强 select[data-search-select]） ============ */
.ss-wrap { position: relative; }
/* 用 .ss-wrap .ss-input 提高特异性：全局 input[type=text] 的 padding 为 (0,1,1)，会压过单类选择器 */
.ss-wrap .ss-input { width: 100%; padding: 10px 34px 10px 12px; border: 1px solid var(--field-border); border-radius: 10px; font-size: var(--fs-14); background: var(--card); color: var(--text); font-family: inherit; cursor: pointer; transition: border-color .15s ease, box-shadow .15s ease; }
.ss-wrap .ss-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.ss-wrap.invalid .ss-input { border-color: #D93025; box-shadow: 0 0 0 3px rgba(217,48,37,.12); }
.ss-caret { position: absolute; top: 50%; right: 10px; transform: translateY(-50%); display: flex; color: var(--muted); pointer-events: none; transition: transform .18s ease, color .18s ease; }
.ss-wrap.open .ss-caret { transform: translateY(-50%) rotate(180deg); color: var(--primary); }
.ss-list { position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 60; max-height: 260px; overflow: auto; padding: 4px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px rgba(15,23,42,.12); }
.ss-item { padding: 9px 12px; border-radius: 8px; font-size: var(--fs-13); color: var(--text); cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ss-item.hover, .ss-item:hover { background: var(--primary-soft); color: var(--primary); }
.ss-item.active { color: var(--primary); font-weight: 600; }
.ss-empty { padding: 10px 12px; font-size: var(--fs-12); color: var(--muted); text-align: center; }
.ss-error { margin-top: 4px; font-size: var(--fs-12); color: #D93025; }
.form-actions { display: flex; gap: 10px; margin-top: 20px; justify-content: flex-end; }
/* 微客户关联：两个动作按钮左右分布 */
.form-actions.two-btn { justify-content: space-between; }
/* 联系人多电话：可增删的行 */
.phone-row { display: flex; gap: 6px; align-items: center; margin-bottom: 6px; }
.phone-row input[type="text"] { flex: 1; }
.phone-row .phone-del { flex: 0 0 auto; line-height: 1; padding: 5px 9px; }
#addPhone { margin-top: 2px; }

input[type=text], input[type=number], input[type=password], input[type=url], input[type=date],
input[type=datetime-local], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--field-border); border-radius: 10px;
  font-size: var(--fs-14); background: var(--card); color: var(--text); font-family: inherit;
  transition: border-color .15s ease, box-shadow .15s ease;
}
input[type=text]:focus, input[type=number]:focus, input[type=password]:focus, input[type=url]:focus,
input[type=date]:focus, input[type=datetime-local]:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft);
}
textarea { resize: vertical; }
input::placeholder, textarea::placeholder { color: var(--field-hint); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: var(--ring); background: var(--card); }
.checks { display: flex; flex-wrap: wrap; gap: 8px; }
.chk { display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-14); background: var(--chip); padding: 6px 10px; border-radius: 8px; }
/* 子页面 tab（如 产品 / 成本设置） */
.sub-tabs { display: flex; gap: 4px; margin: 2px 0 14px; border-bottom: 1px solid var(--line); }
.sub-tab { padding: 8px 16px; font-size: var(--fs-14); color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.sub-tab:hover { color: var(--text); }
.sub-tab.active { color: var(--accent, #2563EB); border-bottom-color: var(--accent, #2563EB); font-weight: 600; }
/* 多选（multi-select）：chip 勾选组，如「关联产品类型」 */
.multi-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.multi-chips .chk { cursor: pointer; user-select: none; transition: background .15s, color .15s; }
.multi-chips .chk:hover { background: rgba(59, 130, 246, .08); }
.multi-chips .chk:has(input:checked) { background: rgba(59, 130, 246, .14); color: #1D4ED8; }
.multi-chips .chk input { margin: 0; }

/* 关联字段：可搜索下拉多选（合同·关联订单等），局部作用域避免影响其它控件 */
.ss-multi { position: relative; }
.ss-multi .ss-control {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 38px; padding: 0 12px; border: 1px solid #E2E8F0; border-radius: 8px;
  background: #fff; cursor: pointer; color: #475569; font-size: 14px;
}
.ss-multi .ss-control:focus { outline: none; border-color: #4F8CFF; box-shadow: 0 0 0 3px rgba(79,140,255,.12); }
.ss-multi .ss-arrow { color: #94A3B8; font-size: 12px; }
.ss-multi .ss-panel {
  position: absolute; z-index: 20; top: calc(100% + 4px); left: 0; right: 0;
  background: #fff; border: 1px solid #E2E8F0; border-radius: 10px;
  box-shadow: 0 8px 24px rgba(15,23,42,.12); padding: 8px; max-height: 260px; overflow: auto;
}
.ss-multi .ss-search {
  width: 100%; box-sizing: border-box; padding: 7px 10px; margin-bottom: 6px;
  border: 1px solid #E2E8F0; border-radius: 8px; font-size: 13px;
}
.ss-multi .ss-opts { display: flex; flex-direction: column; gap: 2px; }
.ss-multi .ss-opt { display: flex; flex-direction: row; align-items: flex-start; gap: 8px; padding: 8px 10px; border-radius: 6px; cursor: pointer; font-size: 13px; }
.ss-multi .ss-opt:hover { background: rgba(59,130,246,.06); }
.ss-multi .ss-opt.on { background: rgba(79,140,255,.12); color: #1D4ED8; }
.ss-multi .ss-opt input { margin: 2px 0 0 0; flex: 0 0 auto; }
.ss-multi .ss-opt-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ss-multi .ss-opt-main { font-size: 13px; font-weight: 500; color: #1F2937; }
.ss-multi .ss-opt-sub { font-size: 12px; color: #6B7280; }
/* ---------- 可搜索单选（search-select）：客户字段 ---------- */
.ss-single { position: relative; }
.ss-single .ss-control { display: flex; align-items: center; justify-content: space-between; gap: 8px; border: 1px solid #E2E8F0; border-radius: 10px; padding: 10px 12px; background: #fff; cursor: pointer; font-size: 13px; }
.ss-single .ss-control:focus { outline: none; border-color: #4F8CFF; box-shadow: 0 0 0 3px rgba(79,140,255,.12); }
.ss-single .ss-arrow { color: #94A3B8; font-size: 12px; }
.ss-single .ss-panel { position: absolute; z-index: 60; left: 0; right: 0; top: calc(100% + 4px); background: #fff; border: 1px solid #E2E8F0; border-radius: 10px; box-shadow: 0 10px 28px rgba(15,30,70,.14); padding: 8px; }
.ss-single .ss-search { width: 100%; box-sizing: border-box; padding: 7px 10px; margin-bottom: 6px; border: 1px solid #E2E8F0; border-radius: 8px; font-size: 13px; }
.ss-single .ss-opts { display: flex; flex-direction: column; gap: 2px; max-height: 240px; overflow: auto; }
.ss-single .ss-opt { display: flex; flex-direction: row; align-items: flex-start; gap: 8px; padding: 8px 10px; border-radius: 6px; cursor: pointer; font-size: 13px; }
.ss-single .ss-opt:hover { background: rgba(59,130,246,.06); }
.ss-single .ss-opt.on { background: rgba(79,140,255,.12); color: #1D4ED8; }
.ss-single .ss-opt-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ss-single .ss-opt-main { font-size: 13px; font-weight: 500; color: #1F2937; }
.ss-single .ss-opt-sub { font-size: 12px; color: #6B7280; }
.cascade { display: flex; gap: 6px; flex-wrap: wrap; }
.cascade select { flex: 1; min-width: 90px; }
.rel-select { min-height: 90px; }

/* ---------- 关联企微客户：可搜索下拉 ---------- */
.wecom-picker { position: relative; }
.wecom-box { display: flex; align-items: center; gap: 6px; border: 1px solid var(--field-border); border-radius: 10px; background: var(--card); padding: 0 12px; transition: border-color .15s ease, box-shadow .15s ease; }
.wecom-box:focus-within { border-color: var(--primary); box-shadow: var(--ring); }
.wecom-box .wecom-search,
.wecom-box .wecom-search:focus { flex: 1; width: auto; border: none !important; outline: none !important; box-shadow: none !important; padding: 10px 0; font-size: var(--fs-14); background: transparent; color: var(--text); }
.wecom-box .wecom-search::placeholder { color: var(--field-hint); }
.wecom-caret { color: var(--field-hint); pointer-events: none; }
.wecom-list { position: absolute; z-index: 60; left: 0; right: 0; top: calc(100% + 4px); max-height: 250px; overflow-y: auto; background: var(--card); border: 1px solid var(--field-border); border-radius: 10px; box-shadow: 0 10px 28px rgba(15,30,70,.14); }
.wecom-opt { padding: 9px 12px; cursor: pointer; font-size: var(--fs-14); border-bottom: 1px solid var(--line); }
.wecom-opt:last-child { border-bottom: none; }
.wecom-opt:hover { background: var(--chip); }
.wecom-opt.sel { background: var(--primary-soft); }
.wecom-opt.linked { color: #B45309; }
.wecom-badge { font-size: var(--fs-12); color: #B45309; background: #FEF3C7; border-radius: 6px; padding: 1px 6px; margin-left: 6px; }
.wecom-opt--clear { color: var(--muted); }
.wecom-opt--empty { color: var(--field-hint); cursor: default; }
.wecom-selected { margin-top: 6px; min-height: 4px; }
.wecom-tag { display: inline-block; padding: 3px 10px; border-radius: 999px; background: var(--primary-soft); color: var(--primary); font-size: var(--fs-13); }
.wecom-tag--none { background: var(--chip); color: var(--muted); }

/* ---------- 群列表（卡片视图，保留） ---------- */
.group-list { display: flex; flex-direction: column; gap: 10px; }
.group-card {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow);
}
.group-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); border-color: var(--line-strong); }
.gc-main { min-width: 0; }
.gc-title { font-size: var(--fs-16); font-weight: var(--fw-bold); margin-bottom: 6px; }
.gc-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.tag { background: var(--chip); color: var(--chip-text); font-size: var(--fs-12); padding: 2px 8px; border-radius: 6px; }
.gc-resp { font-size: var(--fs-12); color: var(--muted); }
.gc-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; white-space: nowrap; flex-shrink: 0; }
.badge { background: var(--primary-soft); color: var(--primary-dark); font-size: var(--fs-12); padding: 3px 9px; border-radius: 20px; font-weight: var(--fw-regular); }
.gc-time { font-size: 11px; color: var(--muted); }
.empty { text-align: center; color: var(--muted); padding: 48px 0; }
.empty .empty-ico { font-size: 30px; opacity: .5; }

/* ---------- 详情 ---------- */
.detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.detail-head h1 { font-size: var(--fs-24); margin: 0 0 6px; font-weight: var(--fw-bold); color: var(--primary-dark); }
.dh-main { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.dh-main h1 { margin-bottom: 0; }
.detail-head .sub { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.detail-actions { display: flex; gap: 8px; flex-shrink: 0; }
/* 编辑客户按钮：与「关联群」(ghost) 颜色区分，用琥珀色实心 */
.btn-edit-cust { background: #f59e0b; color: #fff; box-shadow: 0 4px 14px rgba(245,158,11,.28); }
.btn-edit-cust:hover { background: #e08a00; filter: brightness(.98); }

/* 客户列表页：页头操作区 + 客户名称可点击打开详情 */
.page-head .ph-ops { display: flex; gap: 8px; align-items: center; margin-left: auto; min-width: 0; }
.page-head .ph-ops .btn, .page-head .ph-ops select { white-space: nowrap; flex-shrink: 0; }
.customer-table .g-name .cust-name-link { color: var(--primary-dark); font-weight: var(--fw-bold); text-decoration: none; cursor: pointer; }
.customer-table .g-name .cust-name-link:hover { color: var(--primary); text-decoration: underline; }

/* 列表字段设置面板（显隐 + 拖动排序） */
.col-setting-panel { position: fixed; top: 64px; right: 18px; width: 360px; max-width: calc(100vw - 36px); background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 4px 16px rgba(15,23,42,.10); z-index: 70; display: none; overflow: hidden; }
.col-setting-panel .csp-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 16px 12px; border-bottom: 1px solid var(--line); }
.col-setting-panel .csp-title { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; color: #0F172A; }
.col-setting-panel .csp-gear { flex-shrink: 0; }
.col-setting-panel .csp-close { border: none; background: transparent; font-size: 20px; line-height: 1; cursor: pointer; color: var(--muted); }
.col-setting-panel .csp-close:hover { color: var(--primary); }
.col-setting-panel .csp-hint { padding: 8px 14px; font-size: var(--fs-12); color: var(--muted); line-height: 1.5; }
.col-setting-panel .csp-list { list-style: none; margin: 0; padding: 6px 8px 8px; max-height: 50vh; overflow-y: auto; }
.col-setting-panel .csp-item { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px; background: var(--field-bg); margin-bottom: 6px; cursor: grab; }
.col-setting-panel .csp-item.dragging { opacity: 1; box-shadow: 0 4px 12px rgba(15,23,42,.12); }
/* 拖拽占位符：被拖行脱离后留下的空位（虚线框） */
.col-setting-panel .csp-placeholder {
  border: 1.5px dashed var(--primary);
  border-radius: 8px;
  background: rgba(79,70,229,.08);
  opacity: .55; margin-bottom: 6px;
}


.col-setting-panel .csp-handle { color: var(--muted); cursor: grab; font-size: 16px; line-height: 1; }
.col-setting-panel .csp-name { flex: 1; font-size: var(--fs-14); color: var(--text); }
.col-setting-panel .csp-toggle { display: inline-flex; align-items: center; cursor: pointer; }
.col-setting-panel .csp-toggle input[type="checkbox"] { margin: 0; accent-color: var(--primary); width: 16px; height: 16px; cursor: pointer; }
.col-setting-panel .csp-item.csp-locked { cursor: default; opacity: .95; background: var(--bg-list, var(--field-bg)); }
.col-setting-panel .csp-item.csp-locked .csp-handle { color: var(--muted); cursor: not-allowed; }
.col-setting-panel .csp-lock { margin-left: 6px; font-size: 11px; color: #B45309; background: #FEF3C7; border-radius: 6px; padding: 1px 6px; white-space: nowrap; }
.col-setting-panel .csp-foot { display: flex; justify-content: space-between; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line); }
.col-setting-panel .csp-foot .btn { width: 96px; padding: 8px 16px; font-size: 13px; font-weight: 500; }
.col-setting-panel .csp-empty { padding: 14px; font-size: var(--fs-13); color: var(--muted); text-align: center; }

/* 级联字段值选择器：与「维护选项」弹框样式保持一致（复用 .casc-columns/.casc-col/.casc-row） */
.casc-edit, .casc-tree { padding: 2px; }
.casc-row-cb { margin: 0; accent-color: var(--primary); flex-shrink: 0; }
/* 表单/详情页内列卡片略矮一些，避免过高 */
.casc-tree .casc-col, .casc-edit .casc-col { max-height: 300px; }

/* 级联字段编辑：独立弹窗（详情页双击打开，规避浮层被卡片裁剪导致无法编辑） */
.casc-modal { position: fixed; inset: 0; z-index: 60; display: none; align-items: center; justify-content: center; padding: 16px; }
.casc-modal.open { display: flex; }
.casc-modal-mask { position: absolute; inset: 0; background: rgba(15,23,42,.45); }
.casc-modal-panel { position: relative; width: min(720px, 96vw); max-height: 86vh; display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 24px 60px rgba(0,0,0,.3); overflow: hidden; }
.casc-modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line); font-weight: var(--fw-bold); font-size: var(--fs-16); color: var(--primary-dark); flex-shrink: 0; }
.casc-modal-x { border: none; background: transparent; font-size: 22px; line-height: 1; cursor: pointer; color: var(--muted); padding: 0 4px; }
.casc-modal-x:hover { color: var(--text); }
.casc-modal-body { padding: 16px 18px; overflow: auto; }
.casc-modal-body .casc-columns { overflow-x: auto; }
.casc-modal-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 18px 10px; }
.casc-modal-actions { display: flex; gap: 10px; justify-content: flex-end; padding: 12px 18px 16px; border-top: 1px solid var(--line); flex-shrink: 0; }

/* 级联字段：列表单元格内联编辑的下拉式弹层（无遮罩，锚定在单元格下方，宽度随列数自增） */
.casc-pop {
  z-index: 120;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(15,23,42,.18);
  padding: 8px;
  min-width: 220px;
  max-width: calc(100vw - 16px);
}
.casc-pop .casc-columns { overflow-x: auto; }

/* 单选/多选/标签 字段：列表内联编辑选项弹层（无遮罩，fixed 锚定单元格下方，min-width 保证不被窄列挤扁） */
.opt-pop {
  z-index: 120;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(15,23,42,.18);
  padding: 6px;
  min-width: 220px;
  max-width: 380px;
}
.opt-pop-body { max-height: 300px; overflow-y: auto; padding: 2px; }
.opt-row {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 10px; border-radius: 8px; cursor: pointer;
  font-size: var(--fs-14); color: var(--text); user-select: none;
}
.opt-row:hover { background: var(--primary-soft); }
.opt-row.sel { background: var(--primary-soft-2); color: var(--primary); font-weight: var(--fw-bold); }
.opt-row .opt-check { margin: 0; accent-color: var(--primary); flex-shrink: 0; width: 16px; height: 16px; }
.opt-row .opt-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.opt-add { display: flex; gap: 6px; padding: 8px 6px 2px; border-top: 1px solid var(--line); margin-top: 4px; }
.opt-add-input { flex: 1; min-width: 0; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; font-size: var(--fs-13); background: var(--field-bg); color: var(--text); }
.opt-add-input:focus { outline: none; border-color: var(--primary); }
.opt-pop-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 8px 6px 2px; border-top: 1px solid var(--line); margin-top: 4px; }
.opt-cancel { background: var(--card-2); border: 1px solid var(--line); color: var(--muted); }

.field-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.field-item { background: var(--card-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.fi-label { font-size: var(--fs-12); color: var(--muted); margin-bottom: 4px; display: flex; align-items: center; gap: 6px; }
.fi-badge { background: var(--primary-soft); color: var(--primary-dark); font-size: 10px; padding: 1px 6px; border-radius: 4px; font-weight: var(--fw-bold); }
.fi-value { font-size: var(--fs-14); word-break: break-all; }

/* ---------- 客户详情：基本字段表格（铅笔内联编辑） ---------- */
.field-table { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.ft-row { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.ft-row:last-child { border-bottom: none; }
.ft-head { background: var(--bg-list); font-size: var(--fs-12); color: var(--muted); font-weight: var(--fw-bold); }
.ft-name { flex: 0 0 140px; color: var(--primary-dark); font-size: var(--fs-14); }
.ft-val { flex: 1; font-size: var(--fs-14); word-break: break-all; min-height: 20px; }
.ft-act { flex: 0 0 36px; text-align: right; }
.pencil { border: 1px solid var(--line); background: var(--card-2); color: var(--primary); width: 28px; height: 28px; border-radius: 8px; cursor: pointer; font-size: 14px; line-height: 1; transition: all .15s ease; }
.pencil:hover { background: var(--primary-soft); border-color: var(--primary); transform: translateY(-1px); }
.ft-editor { display: none; position: absolute; top: calc(100% + 4px); left: 0; right: 0; min-width: 240px; z-index: 6; background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 30px rgba(0,0,0,.18); padding: 10px; }
.ft-editor .ed-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.ft-editor .ed-inner > select, .ft-editor .ed-inner > input { min-width: 160px; flex: 1; }
.ft-editor .casc-edit { flex-basis: 100%; }
.ft-editor .ed-actions { display: flex; gap: 8px; }

/* 基本字段：双列紧凑列表，值可就地编辑 */
.field-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 20px; }
.fg-item { position: relative; display: flex; align-items: baseline; gap: 8px; padding: 5px 0; border-bottom: 1px dashed var(--line); }
.fg-label { flex: 0 0 auto; min-width: 60px; color: var(--muted); font-size: var(--fs-14); }
.fg-val { flex: 1; min-width: 0; font-size: var(--fs-14); color: var(--primary-dark); cursor: pointer; min-height: 20px; word-break: break-all; border-radius: 5px; padding: 1px 3px; transition: background .12s; }
.fg-val:hover { background: var(--primary-soft); }
.fg-val.fg-readonly { cursor: default; color: var(--text); }
.fg-val.fg-readonly:hover { background: none; }
.fg-val.editing { background: none; cursor: text; padding: 0; }
.fg-val input, .fg-val select { width: 100%; font-size: var(--fs-14); padding: 4px 6px; border: 1px solid var(--primary); border-radius: 6px; box-sizing: border-box; }

/* 关联群：仅群名称 + 修改 */
.grp-list { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.grp-chip { background: var(--bg-list); border: 1px solid var(--line); color: var(--primary-dark); font-size: var(--fs-12); padding: 3px 10px; border-radius: 14px; }
/* 客户详情：三类关联标签（外部群-橙 / 客户群-绿 / 企微客户-蓝），标签旁字符徽标区分 */
.rel-chip { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-12); padding: 3px 10px 3px 4px; border-radius: 14px; border: 1px solid; line-height: 1.2; }
.rel-badge { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 50%; color: #fff; font-size: 11px; font-weight: 600; flex-shrink: 0; }
.rel-chip--external { background: #FFF7ED; border-color: #FDBA74; color: #B45309; }
.rel-chip--external .rel-badge { background: #F97316; }
.rel-chip--cgroup { background: #ECFDF5; border-color: #6EE7B7; color: #047857; }
/* 续费/服务费清单：父订单树形展开折叠（父行 + 缩进子行） */
.fee-toggle { display: inline-flex; align-items: center; gap: 3px; padding: 1px 5px 1px 3px; margin-right: 4px; background: var(--bg-list); border: 1px solid var(--line); border-radius: 10px; color: var(--muted); cursor: pointer; line-height: 1; vertical-align: middle; }
.fee-toggle:hover { color: var(--primary); border-color: var(--primary); }
.fee-toggle svg { transition: transform .15s ease; }
.fee-toggle.is-open svg { transform: rotate(90deg); }
.fee-kidcount { font-size: 11px; font-weight: 600; }
.fee-child { background: #FAFBFC; }
.fee-child .fee-branch { color: #B9C2CE; margin-right: 4px; }
/* 清单页：到期状态标签（已到期-红 / 即将到期-橙 / 未到期-绿） */
.exp-chip { display: inline-flex; align-items: center; font-size: 12px; padding: 2px 8px; border-radius: 11px; border: 1px solid; line-height: 1.4; white-space: nowrap; }
.exp-expired { background: #FDECEA; border-color: #F5C2C0; color: #C5221F; }
.exp-soon { background: #FFF4E5; border-color: #FBD9A0; color: #B45309; }
.exp-active { background: #E9F9EF; border-color: #A7E8C0; color: #12805C; }
.rel-chip--cgroup .rel-badge { background: #10B981; }
.rel-chip--wecom { background: #EFF6FF; border-color: #93C5FD; color: #1D4ED8; }
.rel-chip--wecom .rel-badge { background: #3B82F6; }
/* 续费/服务费清单列排序标识：对齐客户管理 .cust-app .sort-ind（SVG 细双三角，hover 加深、asc/desc 靛蓝高亮） */
.deal-app .data-table th { position: relative; }
.deal-app .sort-ind {
  position: absolute; top: 50%; right: 10px; transform: translateY(-50%);
  display: inline-flex; flex-direction: column; align-items: center;
  gap: 1.33px; cursor: pointer; user-select: none; color: #B9BFCE; font-size: 10px; line-height: 1;
}
.deal-app .sort-ind .si-up, .deal-app .sort-ind .si-down { display: flex; line-height: 0; }
.deal-app .sort-ind .si-up svg, .deal-app .sort-ind .si-down svg { width: 10px; height: 6px; display: block; }
.deal-app .data-table th:hover .sort-ind { color: #7C87A0; }
.deal-app .sort-ind.asc .si-up { color: var(--primary); }
.deal-app .sort-ind.desc .si-down { color: var(--primary); }
/* 联系人卡片上的「企微客户」关联标记（button 化，保持 chip 外观） */
button.rel-chip { cursor: pointer; font: inherit; line-height: 1.2; padding: 3px 10px 3px 4px; }
button.rel-chip:hover { filter: brightness(0.96); }
/* 微客户弹框：当前已关联提示 + 解除关联 */
.current-link { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; padding: 8px 10px; margin: 2px 0 12px; background: #F8FAFF; border: 1px solid #DBEAFE; border-radius: 8px; }
.current-link .hint { margin: 0; }
.current-link b { color: #1D4ED8; }
button.rel-chip:active { transform: translateY(1px); }
/* 只读字段（编辑页「所属客户」等，反向关联不可编辑） */
.ro-text { font-size: var(--fs-14); color: var(--text); padding: 6px 0; display: inline-block; }
.link-edit { background: none; border: none; color: var(--primary); cursor: pointer; font-size: var(--fs-13); padding: 2px 0; }
.link-edit:hover { text-decoration: underline; }

/* 关联群弹框：搜索筛选 */
.ms { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.ms-search { width: 100%; border: none; border-bottom: 1px solid var(--line); padding: 9px 10px; font-size: var(--fs-14); box-sizing: border-box; outline: none; background: var(--card); }
.ms-list { max-height: 260px; overflow-y: auto; padding: 6px; display: flex; flex-direction: column; gap: 2px; }
.ms-opt { padding: 6px 8px; border-radius: 6px; font-size: var(--fs-14); }
.ms-opt:hover { background: var(--card-2); }
/* 关联企微客户：勾选后内嵌「选择当前客户联系人」 */
.ms-opt-wrap { padding: 6px 8px; border-radius: 6px; font-size: var(--fs-14); }
.ms-opt-wrap:hover { background: var(--card-2); }
.wecom-contact-picker { margin: 4px 0 2px 26px; padding: 8px 10px; background: var(--card-2); border: 1px dashed var(--line); border-radius: 8px; display: flex; flex-direction: column; gap: 6px; }
.mini-label { font-size: var(--fs-13); color: var(--text); display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.wecom-contact-select { font-size: var(--fs-13); padding: 5px 8px; border: 1px solid var(--line); border-radius: 7px; background: var(--card); color: var(--text); }
.wecom-auto { color: var(--muted); }
/* 详情页：企微客户标签内显示已关联联系人 */
.rel-sub { font-size: var(--fs-11); color: var(--muted); font-weight: var(--fw-regular); }
@media (max-width: 560px) { .field-grid2 { grid-template-columns: 1fr; } }
.ci-ops { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.ci-edit { border: 1px solid var(--line); background: var(--card-2); color: var(--primary); width: 26px; height: 26px; border-radius: 7px; cursor: pointer; font-size: 13px; line-height: 1; }
.ci-edit:hover { background: var(--primary-soft); border-color: var(--primary); }
.ci-name { font-weight: var(--fw-bold); font-size: var(--fs-14); }
.ci-title { font-size: var(--fs-12); color: var(--muted); background: var(--bg-list); padding: 1px 7px; border-radius: 6px; }
.ci-phone { font-size: var(--fs-12); color: var(--muted); }

/* 联系人双列网格（与基本字段同样紧凑） */
.contact-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
.contact-card { display: flex; flex-direction: column; gap: 6px; background: var(--card-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.contact-card.is-primary { border-color: var(--primary); background: var(--primary-soft); }
.cc-top { display: flex; align-items: center; flex-wrap: nowrap; gap: 8px; overflow: hidden; }
.primary-badge { background: var(--primary); color: #fff; font-size: 10px; padding: 1px 8px; border-radius: 10px; font-weight: var(--fw-bold); letter-spacing: .5px; white-space: nowrap; }
.cc-ops { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 2px; }
.set-primary { border: 1px solid var(--primary); background: var(--card); color: var(--primary); font-size: var(--fs-12); padding: 3px 9px; border-radius: 7px; cursor: pointer; transition: all .15s ease; }
.set-primary:hover { background: var(--primary); color: #fff; }
@media (max-width: 640px) { .contact-grid { grid-template-columns: 1fr; } }

/* 选项值标签（单选 / 多选 / 级联 / 标签，统一品牌主色，红色保留给删除/警告） */
.opt-tag { display: inline-block; font-size: var(--fs-12); padding: 1px 8px; border-radius: 6px; margin: 1px 4px 1px 0; line-height: 1.6; font-weight: var(--fw-regular); }
.opt-primary { background: var(--primary-soft); color: var(--primary); }

/* 链接字段「点击查看」按钮（详情/列表通用） */
.link-view-btn {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: var(--fs-12); line-height: 1.5;
  color: #fff; background: var(--primary);
  padding: 3px 12px; border-radius: 999px;
  text-decoration: none; font-weight: var(--fw-medium);
  box-shadow: 0 4px 14px rgba(79,70,229,.28);
  transition: background .15s, box-shadow .15s;
}
.link-view-btn:hover { background: #4338CA; box-shadow: 0 6px 18px rgba(79,70,229,.34); }
.link-view-btn:active { transform: translateY(1px); }

/* 列表：主联系人列 */
.pc-name { font-weight: var(--fw-bold); font-size: var(--fs-13); color: var(--primary-dark); }
.pc-phone { font-size: var(--fs-12); color: var(--muted); }
/* 主联系人列：姓名与电话同一行显示（不换行），过长由单元格省略号裁切，hover 气泡看全文 */
.cust-app .data-table tbody td[data-col="sys-primary"] { white-space: nowrap; }
.cust-app .pc-name, .cust-app .pc-phone { display: inline; }
.cust-app .pc-sep { color: var(--muted); margin: 0 4px; }

/* ---------- 负责人 ---------- */
.resp-list { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.resp-chip { display: inline-flex; align-items: center; gap: 4px; background: rgba(35,216,194,.14); color: #13a895; padding: 5px 10px; border-radius: 20px; font-size: var(--fs-12); }
.chip-x { border: none; background: none; color: #13a895; cursor: pointer; font-size: 15px; line-height: 1; padding: 0; }
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.inline-form select, .inline-form input { width: auto; flex: 1; min-width: 120px; }

/* ---------- 时间线 ---------- */
.timeline { position: relative; padding-left: 20px; }
.tl-item { position: relative; padding-bottom: 16px; }
.tl-item::before { content: ''; position: absolute; left: -15px; top: 6px; width: 9px; height: 9px; background: var(--primary); border-radius: 50%; box-shadow: 0 0 0 3px var(--primary-soft); }
.tl-item::after { content: ''; position: absolute; left: -11px; top: 16px; bottom: 0; width: 1px; background: var(--line); }
.tl-item:last-child::after { display: none; }
.tl-head { display: flex; align-items: center; gap: 8px; font-size: var(--fs-12); }
.tl-user { font-weight: var(--fw-bold); }
.tl-time { color: var(--muted); font-size: var(--fs-12); }
.tl-content { margin: 4px 0; font-size: var(--fs-14); white-space: pre-wrap; }
.tl-result, .tl-next { font-size: var(--fs-12); color: var(--muted); }
.tl-del { font-size: var(--fs-12); color: var(--c-danger); margin-left: 8px; }
.fu-form { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.fu-row { display: flex; gap: 8px; }
.fu-row select, .fu-row input { flex: 1; }

/* ---------- 绑定关系 ---------- */
.rel-block { margin-bottom: 12px; }
.rel-item { display: flex; align-items: center; gap: 8px; padding: 6px 0; font-size: var(--fs-14); flex-wrap: wrap; }
.rel-type { background: var(--chip); color: var(--chip-text); font-size: var(--fs-12); padding: 2px 8px; border-radius: 6px; }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; }
.data-table, .log-table { width: 100%; border-collapse: collapse; font-size: var(--fs-14); }
.data-table th, .data-table td, .log-table th, .log-table td { padding: 9px 11px; text-align: left; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.data-table th, .log-table th { color: var(--muted); font-weight: var(--fw-regular); background: var(--card-2); font-size: var(--fs-14); }
.nowrap { white-space: nowrap; }
.log-table .old { color: var(--c-danger); }
.log-table .new { color: var(--primary-dark); }
.ops { display: flex; gap: 10px; }
.link-btn { color: var(--primary-dark); font-size: var(--fs-12); padding: 3px 7px; border-radius: 6px; transition: background-color .15s ease, color .15s ease; border: none; background: none; font-family: inherit; cursor: pointer; }
.link-btn:hover { text-decoration: none; background: var(--primary-soft); }
.link-btn.danger { color: var(--c-danger); }
.link-btn.danger:hover { background: var(--danger-soft); }
.link-btn.warn { color: #B45309; }
.link-btn.warn:hover { color: #D97706; background: rgba(249,115,22,.10); text-decoration: none; }

/* ---------- 统计卡 ---------- */
.stat-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 16px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 10px; text-align: center; box-shadow: var(--shadow); }
.stat-num { font-size: 26px; font-weight: var(--fw-light); color: var(--primary); letter-spacing: .5px; }
.stat.warn .stat-num { color: var(--c-warning); }
.stat-label { font-size: var(--fs-12); color: var(--muted); margin-top: 4px; }

/* ---------- 条形图（辅助色轮替） ---------- */
.bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.bar-label { width: 84px; font-size: var(--fs-12); color: var(--muted); flex-shrink: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { flex: 1; background: var(--track); border-radius: 6px; height: 18px; overflow: hidden; }
.bar-fill { height: 100%; background: linear-gradient(90deg, #9aa3ff, var(--primary)); border-radius: 6px; transition: width .6s cubic-bezier(.16,1,.3,1); }
.bar-fill.ok { background: linear-gradient(90deg, #8fe3ab, var(--c-success)); }
.bar-fill.info { background: linear-gradient(90deg, #82f1e8, var(--c-info)); }
.bar-fill.accent { background: linear-gradient(90deg, #ff9a85, var(--c-accent)); }
.bar-fill.warn { background: linear-gradient(90deg, #ffc187, var(--c-warning)); }
.bar-fill.danger { background: linear-gradient(90deg, #ff8585, var(--c-danger)); }
.bar-val { font-size: var(--fs-12); color: var(--muted); width: 28px; text-align: right; }

/* ---------- 趋势 ---------- */
.trend { display: flex; align-items: flex-end; gap: 8px; height: 140px; padding-top: 10px; }
.trend-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.trend-bar { width: 60%; max-width: 32px; background: linear-gradient(180deg, #9aa3ff, var(--primary)); border-radius: 6px 6px 0 0; min-height: 4px; transition: height .6s cubic-bezier(.16,1,.3,1); }
.trend-val { font-size: var(--fs-12); color: var(--text); margin-top: 4px; }
.trend-label { font-size: 11px; color: var(--muted); }

/* ---------- 登录 ---------- */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: linear-gradient(160deg, var(--primary), var(--primary-dark)); padding: 16px; }
.login-card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 32px 26px; width: 88%; max-width: 360px; box-shadow: 0 18px 50px rgba(0,0,0,.18); }
.login-logo { font-size: 22px; font-weight: var(--fw-bold); text-align: center; color: var(--primary); }
.login-sub { text-align: center; color: var(--muted); font-size: var(--fs-12); margin: 4px 0 22px; }
.login-form { display: flex; flex-direction: column; gap: 6px; }
.login-form label { font-size: var(--fs-12); color: var(--muted); margin-top: 8px; }
.login-tip { text-align: center; color: var(--muted); font-size: var(--fs-12); margin-top: 16px; }
.login-theme { position: absolute; top: 16px; right: 16px; }

/* ---------- 字段管理 ---------- */
.field-item { border: 1px solid var(--line); border-radius: 10px; margin-bottom: 10px; background: var(--card); }
.field-item summary { padding: 12px 14px; cursor: pointer; display: flex; align-items: center; gap: 8px; list-style: none; }
.field-item summary::-webkit-details-marker { display: none; }
.fi-name { font-weight: var(--fw-bold); }
.field-form { padding: 0 14px 14px; }
.ff-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; align-items: center; }
.ff-row input, .ff-row select { flex: 1; min-width: 120px; }
.ff-row textarea { flex: 1 1 100%; }
.ff-actions { display: flex; gap: 12px; align-items: center; }
.ff-scopes { align-items: center; }
.ff-scopes .ff-label { color: var(--c-gray); font-size: var(--fs-12); }
.ff-scopes .chk { margin-right: 4px; }
.tag-scope { background: var(--primary); color: #fff; }
.amount-wrap { flex: 1; min-width: 200px; }
.amount-cn { font-size: var(--fs-12); color: var(--c-gray); margin-top: 4px; min-height: 16px; }
/* 通用实体模块：金额输入框前缀 */
.amount-pre { color: var(--muted); font-size: var(--fs-14); align-self: center; padding: 0 6px 0 2px; }
.amount-wrap .amount-input { width: 100%; }

/* ---------- 通用业务实体模块（公海/成交/产品/财务/供应商） ---------- */
.entity-name-link { color: var(--primary-dark); font-weight: var(--fw-bold); text-decoration: none; }
.entity-name-link:hover { color: var(--primary); text-decoration: underline; }
.data-table .sum-row td { background: var(--card-2); font-weight: var(--fw-bold); color: var(--primary-dark); border-top: 2px solid var(--line); }
.btn.danger, .btn-ghost.danger { color: var(--c-danger); }
.btn-ghost.danger:hover { background: rgba(229,57,53,.1); }

/* 详情页字段网格 */
.detail-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 24px; }
.detail-item { padding: 12px 0; border-bottom: 1px solid var(--line); }
.detail-item .di-label { font-size: var(--fs-12); color: var(--muted); margin-bottom: 4px; }
.detail-item .di-value { font-size: var(--fs-15); color: var(--text); word-break: break-word; }
.detail-meta { display: flex; gap: 20px; margin-top: 16px; font-size: var(--fs-12); color: var(--muted); flex-wrap: wrap; }
@media (max-width: 640px) { .detail-grid { grid-template-columns: 1fr; } }
.user-form { display: flex; gap: 8px; flex-wrap: wrap; }
.user-form input, .user-form select { flex: 1; min-width: 120px; }
.inline { display: inline; }

/* ---------- 字段管理 v2：表格布局 ---------- */
.fm-page { display: flex; flex-direction: column; gap: 14px; }
.fm-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.fm-head h1 { font-size: var(--fs-24); margin: 0; font-weight: var(--fw-bold); color: var(--primary-dark); }

.fm-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); }
.fm-tab {
  padding: 10px 18px; font-size: var(--fs-14); color: var(--muted);
  border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer;
  background: none; border: none; border-bottom: 2px solid transparent; font-family: inherit;
  transition: color .2s, border-color .2s;
}
.fm-tab:hover { color: var(--primary-dark); }
.fm-tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: var(--fw-bold); }

.fm-toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px;
}
.fm-filters { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.fm-filters input, .fm-filters select {
  width: auto; min-width: 130px; padding: 8px 11px; font-size: var(--fs-14);
}
.fm-search { min-width: 200px !important; }
.fm-actions { display: flex; gap: 8px; }

.fm-table-wrap { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow-x: auto; }
.fm-table { width: 100%; border-collapse: collapse; font-size: var(--fs-14); }
.fm-table th, .fm-table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.fm-table th { background: var(--card-2); color: var(--muted); font-weight: var(--fw-regular); font-size: var(--fs-13); }
.fm-table tbody tr:hover { background: var(--bg-list); }
.fm-table tbody tr:last-child td { border-bottom: none; }
.fm-table .col-num { width: 48px; text-align: center; color: var(--muted); }
.fm-table .col-type { width: 130px; white-space: nowrap; }
.fm-table .col-scope { width: 150px; }
.fm-table .col-default { width: 120px; }
.fm-table .col-required { width: 56px; text-align: center; }
.fm-table .col-status { width: 72px; text-align: center; }
.fm-table .col-ops { width: 150px; text-align: right; white-space: nowrap; }
.fm-table .col-name { width: 150px; }
.fm-table .col-check { width: 44px; text-align: center; }
.fm-table .col-check input[type="checkbox"] { width: 16px; height: 16px; cursor: pointer; accent-color: var(--primary); }

/* 批量操作栏 */
.fm-bulkbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 12px 0; padding: 10px 14px; background: var(--chip, var(--bg-list)); border: 1px solid var(--line); border-radius: var(--radius); }
.fm-bulkbar[hidden] { display: none; }
.fm-bulkbar .bulk-count { font-size: var(--fs-14); font-weight: var(--fw-medium); color: var(--text); }
.fm-bulkbar .bulk-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.fm-name { font-weight: var(--fw-bold); color: var(--primary-dark); max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fm-scopes { display: flex; flex-wrap: wrap; gap: 4px; }
.fm-scope-tag { font-size: 11px; padding: 1px 7px; border-radius: 10px; background: var(--primary-soft); color: var(--primary-dark); }
.fm-scope-tag.customer { background: rgba(81,187,111,.14); color: #2e8f46; }
.fm-scope-tag.wecom { background: rgba(255,152,47,.14); color: #c46a0f; }
.fm-required { color: var(--c-danger); font-weight: var(--fw-bold); }
.fm-hint { color: var(--muted); font-size: var(--fs-12); }

/* 状态开关 */
.switch { position: relative; display: inline-block; width: 40px; height: 22px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute; cursor: pointer; inset: 0; background: var(--line-strong); border-radius: 22px;
  transition: background .25s;
}
.slider::before {
  content: ''; position: absolute; height: 16px; width: 16px; left: 3px; bottom: 3px;
  background: #fff; border-radius: 50%; transition: transform .25s; box-shadow: 0 1px 3px rgba(0,0,0,.18);
}
.switch input:checked + .slider { background: var(--primary); }
.switch input:checked + .slider::before { transform: translateX(18px); }

.fm-ops { display: inline-flex; align-items: center; gap: 6px; }
.fm-ops .btn-xs { padding: 4px 9px; font-size: var(--fs-12); }
.fm-ops .link-btn { padding: 4px 6px; }

.fm-empty { text-align: center; color: var(--muted); padding: 48px 0; }

/* 字段管理弹框 */
.fm-modal-scrim {
  position: fixed; inset: 0; background: rgba(8,12,20,.45); z-index: 60;
  display: none; opacity: 0; transition: opacity .2s;
}
.fm-modal-scrim.show { display: block; opacity: 1; }
.fm-modal {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, -48%);
  width: min(640px, 94vw); max-height: 90vh; overflow: auto;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  z-index: 70; display: flex; flex-direction: column; box-shadow: 0 24px 60px rgba(0,0,0,.28);
  opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .2s cubic-bezier(.16,1,.3,1);
}
.fm-modal.open { opacity: 1; pointer-events: auto; transform: translate(-50%, -50%); }
.fm-modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line); flex-shrink: 0; }
.fm-modal-title { font-weight: var(--fw-bold); font-size: var(--fs-16); color: var(--primary-dark); }
.fm-modal-close { border: none; background: var(--chip); width: 32px; height: 32px; border-radius: 9px; cursor: pointer; font-size: 18px; color: var(--text); line-height: 1; }
.fm-modal-close:hover { background: var(--danger-soft); color: var(--c-danger); }
.fm-modal-body { padding: 18px; overflow-y: auto; }
.fm-form-row { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.fm-form-row > .form-row { flex: 1; min-width: 180px; margin-bottom: 0; }
.fm-form-row.full > .form-row { flex-basis: 100%; }
.fm-form-row .checks { margin-top: 6px; }
.fm-scope-group { display: flex; flex-wrap: wrap; gap: 8px; }
.fm-scope-group .chk { margin: 0; }
.fm-form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 6px; }

/* 动态选项行（单选/多选/标签） */
.option-list { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.option-line { display: flex; align-items: center; gap: 8px; }
.option-line .opt-input { flex: 1; min-width: 0; padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; font-size: var(--fs-14); }
.option-line .opt-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft); }
.option-line .opt-minus, .option-line .opt-plus { flex: 0 0 auto; width: 28px; height: 28px; padding: 0; border-radius: 6px; font-size: 18px; line-height: 1; }
.option-line .opt-minus { color: var(--c-danger); }
.option-line .opt-plus { color: #fff; }

/* 级联选择：维护选项弹框 */
.casc-modal-scrim { z-index: 80; }
.casc-modal { z-index: 90; width: min(780px, 96vw); max-height: 86vh; }
.casc-columns { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; -webkit-overflow-scrolling: touch; }
.casc-col { flex: 1 1 150px; min-width: 150px; max-width: 260px; border: 1px solid var(--line); border-radius: 10px; background: var(--field-bg); display: flex; flex-direction: column; max-height: 460px; }
.casc-col-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); font-weight: var(--fw-bold); font-size: var(--fs-14); color: var(--primary-dark); flex-shrink: 0; }
.casc-col-head .casc-add { color: var(--primary); font-weight: var(--fw-bold); padding: 4px 8px; flex-shrink: 0; }
.casc-level-name { flex: 1; min-width: 0; border: 1px solid transparent; background: transparent; font: inherit; color: inherit; font-weight: var(--fw-bold); padding: 2px 4px; border-radius: 6px; }
.casc-level-name:hover { border-color: var(--line); }
.casc-level-name:focus { outline: none; border-color: var(--primary); background: var(--field-bg); }
.casc-col-body { flex: 1; overflow-y: auto; padding: 6px; }
.casc-empty { padding: 24px 8px; text-align: center; color: var(--muted); font-size: var(--fs-12); }
.casc-row { border-radius: 8px; margin-bottom: 4px; cursor: pointer; position: relative; }
.casc-row:hover { background: var(--primary-soft); }
.casc-row.selected { background: var(--primary-soft-2); }
.casc-row-main { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px; gap: 6px; }
.casc-row-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-14); color: var(--text); }
.casc-row.selected .casc-row-label { color: var(--primary); font-weight: var(--fw-bold); }
.casc-row-arrow { color: var(--muted); font-size: 18px; line-height: 1; transform: scaleY(1.4); }
.casc-row.selected .casc-row-arrow { color: var(--primary); }
/* 级联单选：已选叶子高亮 + 勾选标记 + 未选择提示 */
.casc-row.sel { background: var(--primary-soft-2); }
.casc-row.sel .casc-row-label { color: var(--primary); font-weight: var(--fw-bold); }
.casc-row-mark { color: var(--primary); font-weight: var(--fw-bold); flex-shrink: 0; min-width: 12px; text-align: center; }
.casc-empty-hint { color: var(--muted); font-size: var(--fs-12); padding: 2px 4px; }
.casc-row-actions { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); }
.casc-row-menu-btn { border: none; background: transparent; color: var(--muted); cursor: pointer; font-size: 16px; line-height: 1; padding: 2px 6px; border-radius: 4px; }
.casc-row:hover .casc-row-menu-btn { background: var(--card); }
.casc-row-menu-btn:hover { color: var(--primary); }
.casc-row-menu { position: absolute; right: 0; top: 100%; background: var(--card); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow-hover); z-index: 20; min-width: 96px; display: none; overflow: hidden; }
.casc-row-menu.show { display: block; }
.casc-row-menu button { display: block; width: 100%; text-align: left; border: none; background: none; padding: 8px 12px; font-size: var(--fs-14); color: var(--text); cursor: pointer; }
.casc-row-menu button:hover { background: var(--primary-soft); color: var(--primary); }
.casc-row-menu button:last-child { color: var(--c-danger); }
.casc-row-menu button:last-child:hover { background: var(--danger-soft); }
.casc-edit-input { width: 100%; padding: 4px 6px; border: 1px solid var(--primary); border-radius: 6px; font-size: var(--fs-14); outline: none; box-shadow: 0 0 0 2px var(--primary-soft); }
#cascadeOptionsWrap .btn { display: inline-flex; align-items: center; }

/* 公式字段：公式编辑器弹框 */
.formula-modal-scrim { z-index: 85; }
.formula-modal { z-index: 95; width: min(820px, 96vw); max-height: 88vh; }
.formula-editor { display: flex; gap: 16px; min-height: 360px; }
.formula-var-panel { width: 220px; flex-shrink: 0; border: 1px solid var(--line); border-radius: 10px; background: var(--field-bg); display: flex; flex-direction: column; }
.formula-var-head { padding: 12px 14px; border-bottom: 1px solid var(--line); font-weight: var(--fw-bold); font-size: var(--fs-14); color: var(--primary-dark); }
.formula-var-search { padding: 10px 12px; border-bottom: 1px solid var(--line); }
.formula-var-search input { width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; font-size: var(--fs-13); background: var(--card); }
.formula-var-search input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft); }
.formula-var-list { flex: 1; overflow-y: auto; padding: 6px; }
.formula-var-empty { padding: 24px 8px; text-align: center; color: var(--muted); font-size: var(--fs-12); }
.formula-var-item { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px; cursor: pointer; font-size: var(--fs-14); color: var(--text); }
.formula-var-item:hover { background: var(--primary-soft); color: var(--primary); }
.formula-var-icon { width: 22px; height: 22px; display: flex; align-items: center; justify-content: center; border-radius: 5px; background: var(--primary-soft); color: var(--primary); font-size: var(--fs-12); font-weight: var(--fw-bold); }
.formula-edit-panel { flex: 1; display: flex; flex-direction: column; gap: 10px; }
.formula-edit-label { font-weight: var(--fw-bold); font-size: var(--fs-15); color: var(--text); }
.formula-edit-example { color: var(--muted); font-size: var(--fs-13); }
.formula-edit-area { width: 100%; padding: 12px; border: 1px solid var(--border); border-radius: 10px; font-size: var(--fs-14); line-height: 1.9; min-height: 120px; background: var(--card); overflow-y: auto; max-height: 220px; }
.formula-edit-area:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft); }
.formula-edit-area:empty:before { content: attr(data-placeholder); color: var(--muted); }
.formula-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; margin: 0 2px; border-radius: 999px; background: var(--primary-soft); color: var(--primary); font-size: var(--fs-13); font-weight: var(--fw-bold); border: 1px solid var(--primary-soft-2, var(--primary-soft)); vertical-align: middle; user-select: none; cursor: default; white-space: nowrap; }
.formula-chip-x { font-style: normal; font-size: 12px; line-height: 1; cursor: pointer; opacity: 0.65; }
.formula-chip-x:hover { opacity: 1; color: var(--c-danger); }
.formula-edit-actions { display: flex; justify-content: flex-end; }
.formula-fn-dropdown { position: relative; }
.formula-fn-menu { position: absolute; right: 0; top: 100%; margin-top: 6px; background: var(--card); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow-hover); z-index: 20; min-width: 110px; display: none; overflow: hidden; }
.formula-fn-menu.show { display: block; }
.formula-fn-menu button { display: block; width: 100%; text-align: left; border: none; background: none; padding: 8px 12px; font-size: var(--fs-14); color: var(--text); cursor: pointer; }
.formula-fn-menu button:hover { background: var(--primary-soft); color: var(--primary); }
.formula-edit-help { color: var(--muted); font-size: var(--fs-12); line-height: 1.7; margin-top: auto; padding-top: 10px; }
.formula-modal-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 14px 18px; border-top: 1px solid var(--line); }
#formulaOptionsWrap .btn { display: inline-flex; align-items: center; }

/* 字段弹框：必填 / 仅企业微信打开 并排 */
#switchRow { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
#switchRow > .form-row-inline { flex: 0 0 auto; min-width: 120px; margin-bottom: 0; }

/* 默认值编辑器 */
.default-input { width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; font-size: var(--fs-14); background: var(--card); }
.default-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft); }

/* 选项列表里的默认选择器 */
.option-line { align-items: center; }
.opt-default { margin-right: 6px; cursor: pointer; width: 16px; height: 16px; accent-color: var(--primary); }
.opt-default-wrap { display: inline-flex; align-items: center; gap: 2px; margin-left: 8px; padding: 2px 8px; border: 1px solid var(--line); border-radius: 999px; cursor: pointer; background: var(--field-bg); user-select: none; }
.opt-default-wrap:hover { border-color: var(--primary); }
.opt-default-label { font-size: var(--fs-12); color: var(--muted); }

/* 复选框 / 百分数 / 进度 字段展示与编辑 */
.cb-display { display: inline-flex; align-items: center; gap: 6px; color: var(--text); font-size: var(--fs-14); }
.cb-box { width: 16px; height: 16px; border: 2px solid var(--border); border-radius: 4px; display: inline-block; }
.cb-display.checked .cb-box { background: var(--primary); border-color: var(--primary); position: relative; }
.cb-display.checked .cb-box:after { content: ''; position: absolute; left: 4px; top: 1px; width: 5px; height: 9px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.percent-wrap, .progress-edit { display: flex; align-items: center; gap: 8px; }
.percent-wrap input { flex: 1; }
.progress-edit input[type="number"] { width: 120px; }
.percent-suffix { color: var(--muted); font-weight: var(--fw-bold); }
.progress-display { display: flex; align-items: center; gap: 10px; }
.progress-bar { flex: 1; height: 10px; background: var(--field-bg); border-radius: 999px; overflow: hidden; border: 1px solid var(--line); }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--primary), #7c8cf5); border-radius: 999px; transition: width .2s ease; }
.progress-text { font-size: var(--fs-13); color: var(--muted); min-width: 40px; text-align: right; }
.progress-val { min-width: 42px; text-align: right; font-size: var(--fs-13); color: var(--muted); }

/* 公式函数下拉：项数增多，允许滚动 */
.formula-fn-menu { max-height: 260px; overflow-y: auto; }

@media (max-width: 640px) {
  .fm-toolbar { flex-direction: column; align-items: stretch; }
  .fm-filters { width: 100%; }
  .fm-filters input, .fm-filters select { flex: 1; min-width: 0; }
  .fm-actions { width: 100%; }
  .fm-actions .btn { flex: 1; }
  .fm-table .col-default, .fm-table .col-hint { display: none; }
}

/* ============================================================
   响应式：移动端左侧导航变抽屉
   ============================================================ */
@media (max-width: 860px) {
  .app-sidebar {
    transform: translateX(-100%);
    transition: transform .28s cubic-bezier(.16,1,.3,1);
    box-shadow: 0 0 40px rgba(0,0,0,.25);
  }
  .app-sidebar.open { transform: translateX(0); }
  .app-content { margin-left: 0; margin-top: 0; padding-top: 0; }
  .app-sidebar { top: 0; }
  .app-scrim.show { display: block; position: fixed; inset: 0; background: rgba(8,12,20,.45); z-index: 25; }
  .mobile-bar {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 14px; background: var(--header-bg);
    -webkit-backdrop-filter: saturate(180%) blur(18px); backdrop-filter: saturate(180%) blur(18px);
    border-bottom: 1px solid var(--header-border); position: sticky; top: 0; z-index: 20;
  }
  .menu-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 38px; height: 38px; border-radius: 10px; cursor: pointer;
    border: 1px solid var(--line); background: var(--card); color: var(--text); padding: 0;
  }
  .mobile-title { font-weight: var(--fw-bold); font-size: var(--fs-16); color: var(--primary); }
  .app-main { padding: 16px 14px 40px; }
}

/* 手机窄屏微调 */
@media (max-width: 560px) {
  .stat-cards { grid-template-columns: repeat(2, 1fr); }
  .detail-head { flex-direction: column; }
  .detail-actions { width: 100%; }
  .detail-actions .btn { flex: 1; }
  .field-grid { grid-template-columns: 1fr; }
  .page-head h1 { font-size: 20px; }
}

/* ============================================================
   商务简洁微调（收紧间距、收敛圆角）
   ============================================================ */
.card { padding: 14px; margin-bottom: 12px; }
.app-main { padding: 18px 20px 40px; }
.page-head { margin-bottom: 12px; }
.btn { padding: 8px 14px; border-radius: 9px; }
.detail-head h1 { font-size: var(--fs-18); }
.btn-xs { padding: 5px 10px; font-size: var(--fs-12); border-radius: 8px; }

/* ============================================================
   群列表：左侧客户面板 + 右侧表格
   ============================================================ */
/* 底部逻辑：对齐客户管理（.app-main:has(.cust-app) 同款链条）
   .app-main 撑满「视口 - 顶栏」→ .list-layout 吃满剩余高度 → .group-area 再吃满 →
   .group-table-shell flex:1 占满，.table-wrap 内部滚动，分页条 sticky 恒贴底部。
   效果：浏览器高度变化时表格跟着变高变矮，分页条始终贴底不跑位（取代原 max-height 写死值）。
   作用域仅含 .group-area 的 3 个模板（覆盖客群管理 5 个 tab），不影响其它模块。 */
.app-main:has(.group-area) {
  display: flex;
  flex-direction: column;
  padding-bottom: 0;
  flex: 1;
  height: auto;
  min-height: calc(100vh - 60px);
  max-height: calc(100vh - 60px);
}
.list-layout { display: flex; gap: 14px; align-items: stretch; flex: 1 1 auto; min-height: 0; }
.group-area { flex: 1 1 auto; min-width: 0; min-height: 0; display: flex; flex-direction: column; }

.customer-panel {
  width: 248px; flex-shrink: 0;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px; position: sticky; top: 16px; max-height: calc(100vh - 36px); overflow: auto;
}
.cp-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.cp-title { font-weight: var(--fw-bold); font-size: var(--fs-16); color: var(--primary-dark); }
.cp-all { display: block; padding: 7px 10px; border-radius: 8px; color: var(--muted); margin-bottom: 8px; font-size: var(--fs-12); }
.cp-all.active { background: var(--primary-soft); color: var(--primary); font-weight: var(--fw-bold); }
.cp-list { display: flex; flex-direction: column; gap: 4px; }
.cp-item { display: flex; align-items: center; gap: 4px; border-radius: 8px; }
.cp-item.active { background: var(--primary-soft); }
.cp-link { flex: 1; display: flex; flex-direction: column; gap: 3px; padding: 7px 9px; border-radius: 8px; min-width: 0; }
.cp-item.active .cp-link { color: var(--primary); }
.cp-name { font-size: var(--fs-14); font-weight: var(--fw-bold); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cp-badges { display: flex; gap: 6px; }
.cp-badge { font-size: var(--fs-12); color: var(--muted); background: var(--bg-list); padding: 1px 6px; border-radius: 6px; flex-shrink: 0; }
.cp-manage { font-size: var(--fs-12); color: var(--primary-dark); padding: 0 6px; flex-shrink: 0; }
.cp-manage:hover { text-decoration: underline; }
.cp-empty { font-size: var(--fs-12); color: var(--muted); padding: 8px; }

.filter-bar {
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px;
}
.filter-bar input, .filter-bar select { width: auto; min-width: 110px; flex: 0 1 auto; }
/* 日期/月份选择器：同上，需显式覆盖全局 input[type=date]/select 的 width:100%（line 384-389） */
.filter-bar input[type="date"],
.filter-bar input[type="month"],
.filter-bar select { width: auto; min-width: 90px; flex: 0 1 auto; }
.gh-actions { display: flex; gap: 8px; }

.group-table .g-name { font-weight: var(--fw-bold); }
.group-table .op-col { width: 1%; white-space: nowrap; }
.group-table .num { text-align: right; }
.tag-cust { background: var(--primary-soft); color: var(--primary-dark); }

/* ============================================================
   客群管理列表：对齐客户管理（冻结首列 + 统一分页条 + 表头吸顶）
   作用域限定 .group-area，避免污染其它模块
   ============================================================ */
/* 筛选行：规格对齐「客户管理 - .cust-bulkbar 搜索行」/「成交管理 .deal-filterbar」
   （客群管理 5 个 tab 共用 .group-area .filter-bar：企微客户 / 企微客群 / 企微外群 / 微信客户 / 微信客群）
   对齐项：
     框架 —— 透明裸行（无卡片底、无描边、无阴影、无内距），取消原白底卡片
     间距 —— 行上 16px / 行下 12px（到表格卡片净间距 12px，同客户管理 .cust-search → .cust-table-shell）
     元素 —— 间距 10px；输入 13px 字 + 8px/12px 内距 + 10px 圆角 + 35px 高
     按钮 —— 查询/重置统一 30px 高、12px 字、8px 圆角（原查询 37px / 重置 40px 不等高）
     聚焦 —— 靛蓝描边 + 3px 外发光
   冻结 —— 页面整体不滚动（表格由 .table-wrap 内部滚动），本行恒可见；
           额外加 sticky 兜底：将来页面变长或视口压缩产生纵向滚动时，
           行吸附在 tab 栏（顶栏 60 + tab 56 = 116px）正下方不跟随滚走。
           背景取页面底色 var(--bg)，视觉上仍是无卡片裸行，但能遮挡下方滚过的内容。 */
.group-area .filter-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 16px 0 0; padding: 0;   /* 下边距归 0：与表格壳的间距由 .group-table-shell 的 margin-top:12px 提供（同客户管理结构），避免 12+12 叠加成 24px */
  background: var(--bg); border: none; border-radius: 0; box-shadow: none;
  position: sticky; top: 116px; z-index: 30;
}
.group-area .filter-bar input,
.group-area .filter-bar select {
  width: auto; min-width: 120px; max-width: 200px; flex: 0 1 auto;
  height: 35px; box-sizing: border-box;
  padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--card); font-size: 13px; color: var(--primary-dark);
}
.group-area .filter-bar input:focus,
.group-area .filter-bar select:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,70,229,.15);
}
/* 查询 / 重置按钮统一 30px 高（同客户管理 .cust-search、成交管理 .deal-filterbar）。
   inline-flex + line-height:1 修正 <a> 重置按钮被行高撑高的问题 */
.group-area .filter-bar .btn {
  height: 30px; box-sizing: border-box;
  display: inline-flex; align-items: center; line-height: 1;
  padding: 5px 10px; font-size: 12px; border-radius: 8px;
}

/* 列内容徽标/标签字号统一 13px（2026-08-29 用户指定）：
   关联状态徽标(.rel-status)、客户状态徽标(.badge)、字段值标签(.opt-tag)、企微标签(.wc-tag)、
   次要文字(.muted) 原为 12px，与单元格正文 13px 不一致。
   .muted 全局定义为 12px：td.muted 会被 td 的 13px 规则（特异性更高）覆盖，
   但 span.muted / div.muted 不会——导致同一列内两种字号混排，故必须显式覆盖。
   注意：.rel-status / .badge / .opt-tag / .muted 是全局类（记账管理等模块同样使用），
   必须限定在 .group-area 作用域内，避免波及其他模块；特异性 (0,3,0) 高于全局定义 (0,1,0)。
   操作列按钮（详情/跟进/编辑/删除/点击查看）保持 12px——与客户管理范本操作列一致。 */
.group-area .data-table .rel-status,
.group-area .data-table .badge,
.group-area .data-table .opt-tag,
.group-area .data-table .wc-tag,
.group-area .data-table .muted { font-size: 13px; }

/* 列内容文字不加粗（2026-08-29 用户指定）：
   群名称/昵称列(.g-name)原为 --fw-bold、关联状态徽标(.rel-status)原为 600，均改为常规字重。
   对齐客户管理范本——客户管理名称列 .cust-name-link 实际为 font-weight:400（2112 行）。
   表头(.g-name 同名 th 无关，thead th 700)不属于列内容，保持加粗不变。
   .rel-status 为全局类，仍限定 .group-area 作用域，不影响记账管理。 */
.group-area .data-table .g-name,
.group-area .data-table .rel-status { font-weight: 400; }

/* 名称/头像可点击打开详情抽屉（2026-08-29 用户指定）：
   企微客户/微信客户 → 昵称 + 头像；企微客群/企微外群/微信客群 → 群名称。
   文字观感对齐客户管理名称链接：主色、常规字重；hover 仅文字变色（冻结列背景在 td 上，
   不能用 opacity——会让冻结底色变透明露出滚过内容）。头像 hover 用图标自身反馈。 */
.group-area .data-table td.g-name.name-link { color: var(--primary); cursor: pointer; }
.group-area .data-table td.g-name.name-link:hover { color: #4338CA; }
.group-area .data-table td.avatar-col.clickable { cursor: pointer; }
.group-area .data-table td.avatar-col.clickable:hover .wc-avatar { opacity: .8; box-shadow: 0 0 0 3px rgba(79,70,229,.15); }

/* 昵称客户类型后缀（2026-08-29 用户指定）：
   微信用户 →「@微信」绿色 #1EBD43；企业微信用户 →「@企业」橙色 #FC7D28。
   字号固定 12px（用户点名，列内容 13px 规则的显式例外），紧跟昵称、留 3px 缓冲。
   取色与企微官方 @ 提及色一致。 */
.group-area .data-table .name-suffix { font-size: 12px; margin-left: 3px; white-space: nowrap; }
.group-area .data-table .name-suffix.s-wechat { color: #1EBD43; }
.group-area .data-table .name-suffix.s-wecom { color: #FC7D28; }

/* 表格外壳（.group-table-shell）：逐属性对齐客户管理 .cust-table-shell
   —— 白底卡片、1px 描边、直角、柔和投影、内部裁剪；flex:1 吃满 .group-area 剩余高度，
      浏览器高度变化时表格跟着变高，分页条恒贴底部（取代原 max-height: calc(100vh - 300px) 写死高度） */
.group-area .group-table-shell {
  flex: 1 1 0%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 0;
  box-shadow: 0 6px 24px rgba(12,36,93,.06);
  overflow: hidden;
  margin-top: 12px;
}
/* 表格滚动区：占满 shell 剩余空间，超出才出现滚动条（同客户管理 .cust-app .table-wrap） */
.group-area .table-wrap {
  flex: 1 1 0%;
  min-height: 0;
  overflow: auto;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  max-height: none;
}
.group-area .data-table { border-collapse: separate; border-spacing: 0; table-layout: fixed; width: auto; min-width: 100%; }
.group-area .data-table thead th {
  background: #eef1f5; color: #111; font-weight: 700; font-size: 13px; letter-spacing: .3px;
  padding: 15px 16px; border-bottom: 0.5px solid var(--line);
  position: sticky; top: 0; z-index: 5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.group-area .data-table tbody td {
  padding: 14px 16px; border-bottom: 0.5px solid var(--line); color: var(--text); font-size: 13px; vertical-align: middle;
  position: relative; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap;   /* 全列单行省略（对齐客户管理观感）：原长字段值换行把行高撑到 71px，客户管理恒 52px 单行 */
}
.group-area .data-table th,
.group-area .data-table td { border-right: 0.5px solid var(--line); width: 150px; }
.group-area .data-table th:last-child,
.group-area .data-table td:last-child { border-right: none; }
.group-area .data-table th.rel-status-col,
.group-area .data-table td.rel-status-col { width: 103px; white-space: nowrap; }
.group-area .data-table th.op-col,
.group-area .data-table td.op-col { width: 1%; white-space: nowrap; }
.group-area .data-table tbody tr:hover { background: var(--card-2); }
.group-area .data-table tbody tr:last-child td { border-bottom: none; }

/* 冻结首两列：关联状态(left:0) + 名称(left:103px)，横向滚动时保持可见 */
.group-area .data-table th.rel-status-col,
.group-area .data-table td.rel-status-col,
.group-area .data-table th[data-col="sys-name"],
.group-area .data-table td.g-name {
  position: sticky; z-index: 3; background: var(--card-2);
}
.group-area .data-table thead th.rel-status-col,
.group-area .data-table thead th[data-col="sys-name"] { z-index: 6; }
.group-area .data-table th.rel-status-col,
.group-area .data-table td.rel-status-col { left: 0; border-right: 1px solid var(--line); }
.group-area .data-table th[data-col="sys-name"],
.group-area .data-table td.g-name { left: 103px; border-right: 1px solid var(--line); box-shadow: 3px 0 5px -3px rgba(12,36,93,.18); }
.group-area .data-table tbody td.rel-status-col,
.group-area .data-table tbody td.g-name { background: var(--bg); }

/* 企微客户 tab 专属冻结（2026-08-29 用户指定）：第二冻结列 = 客户名字（头像+备注名+@后缀 复合列），
   昵称退出冻结；备注名列还原为纯备注名。
   作用域 .group-area--wecom（仅 wecom-customers 模板挂此类），群列表/微信客户的「昵称冻结」不受影响。
   冻结列必须从左连续：客户名字列在模板中位于关联状态之后（第 2 列），昵称紧随其后为滚动区首列。
   覆盖项：客户名字 sticky left:103（=关联状态宽）；昵称 position 还原 static、去阴影；
   昵称表头背景还原 #eef1f5（通用冻结规则把 th 背景改成了 card-2）、表体背景还原透明。 */
.group-area--wecom .data-table th[data-col="sys-cust_name"],
.group-area--wecom .data-table td[data-col="sys-cust_name"] {
  position: sticky; z-index: 3; left: 103px;
  border-right: 1px solid var(--line); box-shadow: 3px 0 5px -3px rgba(12,36,93,.18);
}
.group-area--wecom .data-table thead th[data-col="sys-cust_name"] { z-index: 6; }
.group-area--wecom .data-table tbody td[data-col="sys-cust_name"] { background: var(--bg); }
.group-area--wecom .data-table th[data-col="sys-name"],
.group-area--wecom .data-table td.g-name { position: static; left: auto; box-shadow: none; }
.group-area--wecom .data-table thead th[data-col="sys-name"] { background: #eef1f5; }
.group-area--wecom .data-table tbody td.g-name { background: transparent; }

/* 客户名字列内部布局：头像(36px 圆) + 文字（备注名+@后缀）横排，文字超长省略。
   注意：display:flex 必须放在 td 内部的 .cn-wrap 包裹层上——直接改 td 的 display
   会破坏 table-cell 布局模型，导致该列宽度计算异常（右侧撑出大块空白）。
   td 保持默认 table-cell + vertical-align:middle 垂直居中。 */
.group-area--wecom .data-table td[data-col="sys-cust_name"] .cn-wrap {
  display: flex; align-items: center; gap: 8px; min-width: 0;
}
.group-area--wecom .data-table td[data-col="sys-cust_name"] .cn-text {
  flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.wc-avatar--empty { display: inline-block; background: #E2E8F0; }

/* 统一分页条（对齐客户管理 .cust-pager）：
   已随 .group-table-shell 移入表格壳内部，去掉独立卡片的描边/圆角/阴影，
   sticky bottom:0 恒贴表格底部；浅灰紫底 --card-2 与客户管理同色 */
.group-area .cust-pager {
  position: sticky;
  bottom: 0;
  z-index: 5;
  display: flex; align-items: center; flex-wrap: wrap; gap: 14px;
  padding: 12px 16px; margin-top: 0; background: var(--card-2);
  border: none; border-radius: 0; box-shadow: none;
}
.group-area .pg-total { color: var(--muted); font-size: 13px; white-space: nowrap; }
.group-area .pg-nav { display: flex; align-items: center; gap: 6px; }
.group-area .pg-btn, .group-area .pg-num {
  min-width: 30px; height: 30px; padding: 0 8px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--text);
  font-size: 13px; text-decoration: none; cursor: pointer; transition: all .15s ease;
}
.group-area .pg-num:hover, .group-area .pg-btn:hover { border-color: var(--primary); color: var(--primary); }
.group-area .pg-num.is-active { background: var(--primary); border-color: var(--primary); color: #fff; }
.group-area .pg-btn.is-disabled { color: var(--muted); opacity: .45; pointer-events: none; cursor: not-allowed; }
.group-area .pg-gap { color: var(--muted); padding: 0 2px; }
.group-area .pg-size, .group-area .pg-jump { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; white-space: nowrap; margin-left: auto; }
.group-area .pg-jump { margin-left: 0; }
.group-area .pg-size label, .group-area .pg-jump label { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.group-area .pg-size select, .group-area .pg-input {
  height: 30px; border: 1px solid var(--line); border-radius: 8px; background: var(--card);
  color: var(--text); padding: 0 8px; font-size: 13px;
}
.group-area .pg-size select { width: 72px; }
.group-area .pg-input { width: 64px; }
.group-area .pg-size select:focus, .group-area .pg-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px rgba(12,36,93,.12); }
.group-area .pg-jump .btn { border-radius: 4px; padding: 5px 16px; font-size: 13px; }

/* 列宽拖拽手柄（与 .cust-app .col-resizer 同规格：右侧 9px 命中区，hover/拖拽时靛蓝高亮）。
   客群管理 5 个 tab 表格默认开启列宽拖拽，宽度按 storeKey 持久化到 localStorage */
.group-area .col-resizer {
  position: absolute; top: 0; right: 0;
  width: 9px; height: 100%;
  cursor: col-resize; z-index: 6;
  background: transparent;
  -webkit-user-select: none; user-select: none;
  transition: background-color .12s ease;
}
.group-area .col-resizer:hover { background: var(--primary); opacity: .28; }
.group-area .col-resizer.is-dragging { background: var(--primary); opacity: .5; }
.group-area .col-resizing, .group-area .col-resizing * { cursor: col-resize !important; user-select: none !important; }

/* ============================================================
   详情抽屉（右侧滑出，内嵌 iframe）
   ============================================================ */
.detail-scrim { position: fixed; inset: 0; background: rgba(8,12,20,.45); z-index: 55; display: none; }
.detail-scrim.show { display: block; }
.detail-drawer {
  position: fixed; top: 0; bottom: 0; right: 0; width: 75%;
  background: var(--card); z-index: 60; transform: translateX(100%);
  transition: transform .28s cubic-bezier(.16,1,.3,1);
  display: flex; flex-direction: column; box-shadow: -4px 0 24px rgba(15,23,42,.12);
}
.detail-drawer.open { transform: translateX(0); }
/* 抽屉头部由详情体自身 Page Header（公司名称行）承载，不再额外固定「客户详情」标题条 */
.dd-frame { flex: 1; width: 100%; border: none; background: var(--bg); }

/* ---------- 通用弹框（编辑 / 跟进 / 关联群，非全屏） ---------- */
.modal-scrim { position: fixed; inset: 0; background: rgba(8,12,20,.45); z-index: 60; display: none; }
.modal-scrim.show { display: block; }
.modal {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, -48%);
  width: min(720px, 94vw); max-height: 90vh; overflow: auto;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  z-index: 70; display: flex; flex-direction: column; box-shadow: 0 24px 60px rgba(0,0,0,.28);
  opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .2s cubic-bezier(.16,1,.3,1);
}
.modal.open { opacity: 1; pointer-events: auto; transform: translate(-50%, -50%); }
.modal--narrow { width: min(560px, 94vw); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 11px 14px; border-bottom: 1px solid var(--line); flex-shrink: 0; }
.modal-title { font-weight: var(--fw-bold); font-size: var(--fs-16); color: var(--primary-dark); }
.modal-close { border: none; background: var(--chip); width: 30px; height: 30px; border-radius: 50%; cursor: pointer; font-size: 16px; color: var(--text); line-height: 1; display: inline-flex; align-items: center; justify-content: center; transition: background-color .15s ease, color .15s ease; }
.modal-close:hover { background: var(--danger-soft); color: var(--c-danger); }
.modal-frame { width: 100%; min-height: 260px; border: none; background: var(--bg); border-radius: 0 0 14px 14px; }

/* embed 详情页（iframe 内，无侧栏） */
.embed-body { background: var(--bg); }
.embed-shell { min-height: 100vh; padding: 14px 16px 24px; max-width: none; }
.embed-shell .app-main { padding: 0; max-width: none; }

/* 弹框内表单（iframe 嵌入 modal）：去除内层卡片边框、铺满弹框，消除大块空白与"框中框" */
.modal-embed .embed-shell { padding: 0; min-height: 0; }
/* 编辑订单（iframe 弹窗）：操作按钮吸底常驻，与「添加订单」弹窗 .to-foot 一致，无需滚到最底部才出现。
   负 margin 抵消 .edit-form 在 embed 下的 16px 左右内边距，让按钮条铺满弹框宽度。 */
.modal-embed .edit-form > .form-actions.oe-actions {
  position: sticky; bottom: 0; z-index: 6;
  margin: 14px -16px 0; padding: 12px 16px 14px;
  background: var(--card); border-top: 1px solid var(--line);
}
.modal-embed .edit-form { margin-bottom: 0; }
.modal-form { padding: 18px 20px 20px; }
.modal-form .inv-ro, .edit-form .inv-ro { color: var(--muted); background: var(--bg); cursor: not-allowed; }
/* 发票录入可搜索下拉（combobox）：输入即过滤，点选即填 hidden */
.inv-combo { position: relative; }
.inv-combo > input { width: 100%; }
.inv-combo-list {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 60;
  max-height: 220px; overflow-y: auto;
  background: var(--card-2); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 8px 24px rgba(12,36,93,.14);
  display: none;
}
.inv-combo-list.open { display: block; }
.inv-combo-item { padding: 8px 12px; font-size: 13px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inv-combo-item:hover, .inv-combo-item.active { background: var(--primary-soft); }
.inv-combo-empty { padding: 8px 12px; font-size: 12px; color: var(--muted); }
/* 发票号链接（台账/销项/进项列表，点击打开编辑详情） */
.inv-no-link { color: var(--primary); font-weight: 600; text-decoration: none; cursor: pointer; }
.inv-no-link:hover { text-decoration: underline; }
/* 发票状态标签（操作列：已作废/已锁定） */
.inv-status { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.inv-status--cancelled { background: rgba(217,48,37,.12); color: #D93025; }
.inv-status--locked { background: rgba(230,140,20,.14); color: #E68C14; }
/* 作废发票整行：灰色 + 作废横线划过（td 相对定位，线穿过行高中心） */
tr.inv-row-cancelled { opacity: .55; }
tr.inv-row-cancelled td { position: relative; color: #9aa0b0; }
tr.inv-row-cancelled td::after {
  content: ''; position: absolute; left: 8px; right: 8px; top: 50%;
  border-top: 1.5px solid #b6bcc9; pointer-events: none;
}
/* 发票附件列表 */
.inv-attach-row {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg); border: 1px solid var(--line); border-radius: 8px;
  padding: 5px 10px; font-size: 12px;
}
.inv-attach-row a { color: var(--primary); text-decoration: none; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inv-attach-row a:hover { text-decoration: underline; }
.inv-attach-del { flex-shrink: 0; border: none; background: none; cursor: pointer; font-size: 12px; color: #D93025; }
.inv-attach-badge { display: inline-block; margin-left: 4px; padding: 0 6px; border-radius: 999px; background: rgba(79,70,229,.12); color: var(--primary); font-size: 11px; font-weight: 600; }
/* 进项票多选流水：已选列表（每笔：文本 + 金额输入 + 移除） */
.inv-entry-sel {
  display: flex; align-items: center; gap: 8px;
  background: var(--primary-soft); border: 1px solid rgba(79,70,229,.25);
  border-radius: 8px; padding: 4px 8px; font-size: 12px;
}
.inv-entry-sel-lbl { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.inv-entry-sel-amt { width: 110px; flex-shrink: 0; padding: 3px 8px !important; font-size: 12px !important; border-radius: 6px !important; }
.inv-entry-sel-del {
  flex-shrink: 0; border: none; background: none; cursor: pointer; font-size: 14px; line-height: 1; color: var(--muted);
}
.inv-entry-sel-del:hover { color: #D93025; }
/* 发票录入弹窗：行距与 label-input 间隙对齐「记一笔」弹窗（.form-row-h：gap 12px / 行距 14px / label 70px 右对齐 fs-13），不污染通用 .edit-form.compact */
.inv-form.edit-form.compact { gap: 4px 18px; }
.inv-form.edit-form.compact .form-row { gap: 12px; margin-bottom: 14px; align-items: center; }
.inv-form.edit-form.compact .form-row > label { width: 70px; min-width: 70px; flex-shrink: 0; text-align: right; font-size: var(--fs-13); color: var(--muted); font-weight: 500; white-space: nowrap; padding-top: 0; line-height: 1.2; }
.inv-form .inv-tax-row { gap: 14px; margin-bottom: 14px; }.modal-form > h2 { font-size: var(--fs-16); margin: 0 0 10px; font-weight: var(--fw-bold); color: var(--primary-dark); }

/* 详情内部分割：上方客户信息整宽；下方 左列(联系人/关联客群/成交订单) + 右列(跟进记录) */
.detail-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.detail-cols .card { margin-bottom: 0; }
@media (max-width: 640px) { .detail-cols { grid-template-columns: 1fr; } }
.detail-split { display: grid; grid-template-columns: 1.08fr 1fr; gap: 12px; align-items: start; margin-top: 14px; }
.ds-left { min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.ds-right { min-width: 0; }

/* 右列「跟进记录」卡片内部滚动（合并 跟进记录 + 操作日志） */
.cust-detail .detail-split .card { margin-bottom: 0; }
.detail-split #followupCard { max-height: 74vh; display: flex; flex-direction: column; overflow: hidden; }
.detail-split #followupCard > h2 { flex-shrink: 0; }
.detail-split #followupCard > .feed-filter { flex-shrink: 0; }
.detail-split #followupCard > .chrono { overflow-y: auto; flex: 1; min-height: 0; padding-right: 4px; }
.feed-filter { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.feed-filter input, .feed-filter select { flex: 1 1 90px; min-width: 0; padding: 6px 8px; font-size: var(--fs-12); }
.feed-filter .feed-f-clear { flex: 0 0 auto; padding: 6px 12px; font-size: var(--fs-12); border: 1px solid var(--line); background: var(--field-bg); color: var(--muted); border-radius: 8px; cursor: pointer; align-self: stretch; }
.feed-filter .feed-f-clear:hover { color: var(--primary); border-color: var(--primary); }
.feed-filter .feed-f-btn { flex: 0 0 auto; padding: 6px 14px; font-size: var(--fs-12); border: 1px solid var(--primary); background: var(--primary); color: #fff; border-radius: 8px; cursor: pointer; align-self: stretch; }
.feed-filter .feed-f-btn:hover { filter: brightness(1.05); }
.cust-detail .fu-inline { flex-shrink: 0; display: flex; flex-direction: column; gap: 12px; margin-bottom: 14px; }
.cust-detail .fu-row { display: flex; gap: 12px; }
.cust-detail .fu-date, .cust-detail .fu-method { flex: 1 1 0; min-width: 0; height: 36px; background: #F1F5F9; border: 1px solid var(--line); border-radius: 8px; padding: 0 12px; font-size: 13px; box-sizing: border-box; color: var(--primary-dark); }
.cust-detail .fu-method { cursor: pointer; }
.cust-detail .fu-content { width: 100%; height: 56px; background: #F1F5F9; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; font-size: 13px; box-sizing: border-box; resize: vertical; color: var(--primary-dark); font-family: inherit; }
.cust-detail .fu-line { display: flex; gap: 12px; align-items: stretch; }
.cust-detail .fu-line .fu-content { width: auto; flex: 1 1 auto; }
.cust-detail .fu-actions { flex-shrink: 0; display: flex; align-items: flex-end; }
.cust-detail .fu-divider { flex-shrink: 0; height: 1px; border: none; background: var(--line); margin: 0 0 14px; }
.cust-detail .rel-pills { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.cust-detail .rel-pill { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 10px 0 12px; border-radius: 11px; font-size: 13px; font-weight: 500; color: #fff; line-height: 1; }
.cust-detail .rel-pill--cgroup { background: #FF991A; }
.cust-detail .rel-pill--wechat-group { background: #07C15F; }
.cust-detail .rel-pill--external { background: #2691F0; }
.cust-detail .rel-pill-x { border: none; background: transparent; color: rgba(255,255,255,.85); cursor: pointer; font-size: 13px; line-height: 1; padding: 0 2px; }
.cust-detail .rel-pill-x:hover { color: #fff; }
.fu-filter, .log-filter { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.fu-filter input, .fu-filter select, .log-filter input, .log-filter select { flex: 1 1 110px; min-width: 0; padding: 6px 8px; font-size: var(--fs-12); }

/* 操作日志（竖状时间线） */
.log-list { display: flex; flex-direction: column; }
.log-row { display: flex; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.log-row:last-child { border-bottom: none; }
.log-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); margin-top: 5px; flex-shrink: 0; box-shadow: 0 0 0 3px var(--primary-soft); }
.log-body { flex: 1; min-width: 0; }
.log-head { display: flex; justify-content: space-between; font-size: var(--fs-12); }
.log-field { font-weight: var(--fw-bold); }
.log-time { color: var(--muted); font-size: 11px; }
.log-change { font-size: var(--fs-14); margin-top: 2px; }
.log-change .old { color: var(--c-danger); }
.log-change .new { color: var(--primary-dark); }
.log-change .arrow { color: var(--muted); margin: 0 4px; }
.log-user { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* ---------- 日期分组时间轴（跟进记录 / 操作日志） ---------- */
.chrono { position: relative; padding-left: 28px; }
.chrono::before { content: ''; position: absolute; left: 9px; top: 4px; bottom: 4px; width: 1px; background: var(--line); }
.chrono-group { position: relative; margin-bottom: 18px; }
.chrono-group:last-child { margin-bottom: 0; }
.chrono-date { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; position: relative; }
.cd-dot {
  width: 20px; height: 20px; border-radius: 50%; background: var(--muted);
  color: #fff; display: inline-flex; align-items: center; justify-content: center;
  position: absolute; left: -28px; top: 1px;
}
[data-theme="dark"] .cd-dot { color: var(--text); }
.cd-dot svg { width: 12px; height: 12px; }
.cd-label { font-weight: var(--fw-bold); font-size: var(--fs-14); color: var(--text); }
.chrono-list { display: flex; flex-direction: column; gap: 10px; }
.chrono-item { display: flex; gap: 10px; position: relative; }
.ci-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--primary);
  position: absolute; left: -23px; top: 11px; box-shadow: 0 0 0 3px var(--primary-soft);
}
.ci-card { flex: 1; background: var(--card-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.ci-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: var(--fs-12); margin-bottom: 4px; }
.ci-user { font-weight: var(--fw-bold); color: var(--primary-dark); }
.ci-field { font-weight: var(--fw-bold); color: var(--primary); }
.ci-tag { background: var(--primary-soft); color: var(--primary-dark); padding: 1px 7px; border-radius: 6px; font-size: 11px; }
.ci-time { color: var(--muted); margin-left: auto; font-size: 11px; }
.ci-body { font-size: var(--fs-14); white-space: pre-wrap; line-height: 1.5; }
.ci-change { font-size: var(--fs-14); margin-top: 2px; }
.ci-change .old { color: var(--c-danger); }
.ci-change .new { color: var(--c-success); }
.ci-change .arrow { color: var(--muted); margin: 0 5px; }
.ci-meta { font-size: var(--fs-12); color: var(--muted); margin-top: 3px; }
.ci-meta-user { font-size: var(--fs-12); color: var(--muted); margin-top: 3px; }
.ci-del { font-size: var(--fs-12); color: var(--c-danger); margin-top: 6px; display: inline-block; }

/* ============================================================
   级联选择器 chips / 关联客户选择器 / 联系人
   ============================================================ */
.casc-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.casc-chips .chip { display: inline-flex; align-items: center; gap: 4px; background: var(--primary-soft); color: var(--primary-dark); padding: 3px 8px; border-radius: 20px; font-size: var(--fs-12); }

.contact-list { display: flex; flex-direction: column; gap: 8px; }
.contact-item { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; }
.contact-name { font-weight: var(--fw-bold); font-size: var(--fs-14); }
.contact-meta { display: flex; gap: 6px; align-items: center; margin-top: 2px; }

/* 移动端：客户面板与分割堆叠（桌面端保持左右并排，仅窄屏堆叠） */
@media (max-width: 760px) {
  .list-layout { flex-direction: column; }
  .customer-panel { width: auto; position: static; max-height: none; }
  .detail-split { flex-direction: column; }
  .detail-drawer { width: 100vw; }
}

/* 导航 App-tile 风格图标（卡片：圆角方块底 + 图形）—— 默认未选，active 选中（对齐 YunQing） */
.nav-tile .tile-bg { fill: #1E293B; }
.nav-tile .tile-house { fill: #94A3B8; }
.nav-tile .tile-door { fill: #94A3B8; }
.nav-item.active .nav-tile .tile-bg { fill: #4F46E5; }
.nav-item.active .nav-tile .tile-house { fill: #FFFFFF; }
.nav-item.active .nav-tile .tile-door { fill: #FFFFFF; }

/* 客户导航：房子线条图标（无背景）—— 未选中灰，选中靛蓝（nav-item 与 nav-group 通用） */

/* 导航栏：深色固定（对齐云擎 YunQing 设计系统 Sidebar #111827） */
/* ============ 导航栏视觉（深色固定，对齐 YunQing） ============ */
.app-sidebar { background: #111827 !important; border-right-color: #1F2937 !important; }
.side-nav { gap: 8; }
/* 一级项：颜色分三层：未选 / 悬停 / 选中（对齐 YunQing slate-400 / #1E293B / 近白） */
.side-nav .nav-item, .nav-group { color: #94A3B8; font-weight: 500; padding: 0 14px; min-height: 35px; gap: 10px; transition: background-color .16s ease, color .16s ease; }
.side-nav .nav-item:hover, .nav-group:hover { background: #1E293B; color: #F1F5F9; }
.side-nav .nav-item.active, .nav-group.active { background: #1E293B; color: #F1F5F9; font-weight: 500; }
.side-nav .nav-item.active::before, .nav-group.active::before { background: #4F46E5; width: 3px; border-radius: 3px; }
.nav-group .nav-caret { color: #94A3B8; }
.nav-group:hover .nav-caret, .nav-group.active .nav-caret { color: #F1F5F9; }
/* 一级图标：线条略细，与文字视觉重量一致 */
/* 二级：弱化层级 —— 更小图标、更细线、更柔颜色 */
.nav-sub { border-left-color: #334155; padding-left: 18px; }
.nav-sub .nav-item { color: #94A3B8; font-weight: 400; font-size: var(--fs-13); padding: 8px 12px; }
.nav-sub .nav-item:hover { color: #F1F5F9; background: #1E293B; }
.nav-sub .nav-item.active { color: #F1F5F9; font-weight: 500; }
/* 子项无图标（对齐设计系统 Sub Item 纯文字） */
/* 底部用户区 */
.side-bottom { border-top-color: #334155; }
.side-bottom .side-user { color: #F1F5F9; }
.side-bottom .side-logout { color: #94A3B8; }
.side-bottom .side-logout:hover { color: #EF4444; }
.side-bottom .side-collapse { color: #94A3B8; }
.side-bottom .side-collapse:hover { background: #1E293B; color: #F1F5F9; }

/* 企微客户编辑表单：紧凑双列卡片布局（弹框 iframe 内友好） */
.edit-form.compact { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 22px; align-items: start; }
.edit-form.compact h2 { grid-column: 1 / -1; margin: 16px 0 8px; }
.edit-form.compact h2:first-of-type { margin-top: 0; }
.edit-form.compact .form-row { flex-direction: row; align-items: flex-start; gap: 10px; margin-bottom: 10px; min-width: 0; }
.edit-form.compact .form-row > label { width: 100px; flex-shrink: 0; padding-top: 7px; line-height: 1.4; margin: 0; }
.edit-form.compact .form-row > *:not(label) { flex: 1; min-width: 0; }
.edit-form.compact .form-row input[type="text"], .edit-form.compact .form-row input[type="number"], .edit-form.compact .form-row select, .edit-form.compact .form-row textarea { width: 100%; }
.edit-form.compact .phones-block { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.edit-form.compact .phones-block #wecomPhoneList { display: flex; flex-wrap: wrap; gap: 8px; width: 100%; }
.edit-form.compact .phone-row { display: flex; gap: 6px; align-items: center; flex: 1 1 46%; min-width: 190px; }
.edit-form.compact .phone-row input { flex: 1; min-width: 0; }
.edit-form.compact .rel-picker { display: flex; flex-wrap: wrap; gap: 6px; width: 100%; }
.edit-form.compact .rel-picker select { flex: 1 1 44%; min-width: 120px; }
.edit-form.compact .form-actions, .edit-form.compact .alert { grid-column: 1 / -1; }

/* 企微客户列表：关联联系人电话小字 */
.rel-phone { font-size: 11px; margin-top: 2px; }

/* 电话来源标注（企微客户 / 联系人编辑页：对侧录入只读展示） */
.rel-phones-ro { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); background: var(--field-bg); border: 1px dashed var(--line); border-radius: 6px; padding: 5px 10px; }
.rel-phones-label { flex-shrink: 0; }
.rel-phones-list { font-weight: var(--fw-bold); color: var(--text); }

/* 内联确认框（iframe 内避免原生 confirm 跑到主窗口） */
.inline-confirm { display: inline-flex; align-items: center; gap: 8px; margin-left: 10px; padding: 6px 10px; background: var(--danger-soft, #FDE8E8); border: 1px solid #F5C6C6; border-radius: 8px; }
.inline-confirm-txt { font-size: 13px; color: var(--c-danger, #D93025); }

/* 内联确认框：长文案时按钮换行对齐 */
.inline-confirm { flex-wrap: wrap; }
.inline-confirm-txt { flex: 1 1 100%; }

/* 对侧录入电话：灰色锁定（disabled 输入框） */
.phones-ro { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.phones-ro .phone-row { flex: 1 1 46%; min-width: 190px; }
.phones-ro input[disabled] { background: var(--field-bg); color: var(--muted); cursor: not-allowed; }

/* 详情页内二级弹框：左侧推出（关联对象） */
.rel2-mask { position: fixed; inset: 0; background: rgba(12,36,93,.28); z-index: 90; }
.rel2-panel { position: fixed; top: 0; left: 0; bottom: 0; width: min(520px, 88%); background: var(--card); border-right: 1px solid var(--line); box-shadow: 8px 0 30px rgba(0,0,0,.18); z-index: 91; display: flex; flex-direction: column; transform: translateX(-100%); transition: transform .25s cubic-bezier(.16,1,.3,1); }
.rel2-panel.open { transform: translateX(0); }
.rel2-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.rel2-title { font-weight: var(--fw-bold); font-size: var(--fs-16); color: var(--primary-dark); }
.rel2-close { border: none; background: var(--chip); width: 30px; height: 30px; border-radius: 8px; cursor: pointer; font-size: 18px; color: var(--text); line-height: 1; }
.rel2-close:hover { background: var(--danger-soft); color: var(--c-danger); }
.rel2-frame { flex: 1; border: none; background: var(--bg); }

/* 列表关联状态列：已关联（绿）/ 未关联（灰），明显区分，固定首列 */
.rel-status-col { width: 103px; white-space: nowrap; }
.rel-status { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 2px 10px; border-radius: 999px; line-height: 1.6; }
.rel-status::before { content: ''; width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.rel-status.st-linked { background: rgba(45, 188, 0, 0.12); color: #1E9E00; }
.rel-status.st-linked::before { background: #2DBC00; }
.rel-status.st-unlinked { background: rgba(140, 145, 165, 0.14); color: #8C91A5; }
.rel-status.st-unlinked::before { background: #A7ADBF; }
.rel-status.st-split { background: rgba(109, 121, 255, 0.12); color: var(--primary); }
.rel-status.st-split::before { background: var(--primary); }

/* 跟进记录来源标注：带过来的显示「来自 xxx」，本页记录显示「本记录」 */
.fu-src { display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: 999px; font-size: 11px; line-height: 1.7; background: rgba(139, 92, 246, 0.1); color: #8B5CF6; vertical-align: middle; white-space: nowrap; }
.fu-src-self { background: rgba(140, 145, 165, 0.12); color: #8C91A5; }

/* 字段管理：微信客户 scope 标签（微信绿） */
.fm-scope-tag.wechat { background: rgba(45, 188, 0, 0.14); color: #1E9E00; }

/* 微信客户关联 chip（微信绿） */
.rel-chip--wechat { background: #ECFDF5; border-color: #6EE7B7; color: #047857; }
.rel-chip--wechat .rel-badge { background: #2DBC00; }

/* 微信客群关联 chip（紫色，与微信客户绿区分） */
.rel-chip--wechat-group { background: #F5F3FF; border-color: #C4B5FD; color: #6D28D9; }
.rel-chip--wechat-group .rel-badge { background: #8B5CF6; }
/* 字段管理：微信客群 scope 标签（紫） */
.fm-scope-tag.wechat-group { background: rgba(139, 92, 246, 0.14); color: #7C3AED; }

/* 字段管理：系统字段（只读展示） */
.fm-sys-badge { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 11px; background: rgba(140,145,165,.16); color: #8C91A5; vertical-align: middle; }
.fm-sys-dot { display: inline-block; width: 14px; height: 14px; border-radius: 50%; border: 2px solid #C7CBD9; vertical-align: middle; }
.fm-name .fm-sys-badge { margin-left: 6px; }

/* 客户详情：人员区块（负责人 + 协作人） */
.personnel-row { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.personnel-item { display: flex; align-items: center; gap: 6px; }
.personnel-label { font-size: 12px; color: var(--muted); flex-shrink: 0; }
.resp-chip--owner { background: rgba(139, 92, 246, 0.12); border-color: #8B5CF6; color: #8B5CF6; font-weight: 600; }

/* 客户公海：批量操作栏 + 分配选择器 + 转公海链接 */
.sea-batch-bar { display: flex; align-items: center; gap: 12px; margin: 10px 0; padding: 8px 14px; background: rgba(139,92,246,.06); border: 1px dashed rgba(139,92,246,.35); border-radius: 8px; }
.sea-assign-select { max-width: 140px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--card); color: var(--text); flex-shrink: 0; }
/* 资金流水聚合页：tab 导航 —— 规格对齐客户管理 .cust-tabbar
   （白底通栏、56px 高 tab 贴底、14px 字、active 靛蓝 600、滑动指示器、下方阴影、吸顶冻结） */
.app-main.cash-full { padding-top: 0; }   /* tab 栏与固定顶栏无缝贴合（同 .cust-full / .deal-full） */
.cash-tabbar {
  background: #fff; height: 56px; box-sizing: border-box;
  display: flex; align-items: flex-end; justify-content: space-between;
  padding: 0 24px; margin: 0 -24px;          /* 通栏：抵消 .app-main 左右 24px 内距 */
  box-shadow: 0 3px 6px rgba(0,0,0,.08);     /* tab 栏下方阴影（同客户管理） */
  position: sticky; top: 60px; z-index: 40;  /* 吸顶冻结：固定顶栏 60px 之下 */
  flex-shrink: 0;   /* 锁高容器(flex column + max-height)空间不足时不被压缩：发票台账页实测被压到 42px（2026-08-29） */
}
.cash-tabs { display: flex; align-items: flex-end; gap: 28px; position: relative; }
.cash-tab {
  font-size: 14px; color: #64748B;
  padding-bottom: 8px; cursor: pointer; user-select: none; white-space: nowrap;
}
.cash-tab:hover { color: #4F46E5; }
.cash-tab.active { color: #4F46E5; font-weight: 600; }
/* 滑动指示器：独立滑块（同客户管理 .cust-tab-ind），切换时平滑滑过 */
.cash-tab-ind {
  position: absolute; bottom: 0; left: 0; width: 24px; height: 2px;
  border-radius: 2px; background: #4F46E5; pointer-events: none;
  transition: left .28s cubic-bezier(.4,0,.2,1), width .28s cubic-bezier(.4,0,.2,1);
}
@media (max-width: 860px) {
  .cash-tabbar { margin: 0; padding: 0 14px; top: 0; }
}
.cash-pane { min-width: 0; }

/* ===== 记账管理 3 个 tab 筛选行：规格对齐「客户管理 - 搜索行」（2026-08-29 用户指定） =====
   对齐项（同 .group-area .filter-bar / .deal-filterbar）：
   框架 —— 透明裸行（取消白底卡片），行上 16px / 行下 12px
   文字 —— 输入/下拉 13px 字 + 8px/12px 内距 + 10px 圆角 + 35px 高，聚焦靛蓝描边
   按钮 —— 查询/重置统一 30px 高、12px 字、8px 圆角；
           颜色对齐客户管理主次色：查询 = 靛蓝实底白字（btn-primary 观感），重置 = 描边灰字（btn-ghost 观感）
           （原两枚都是灰白胶囊 btn-icon，无主次区分）
   冻结 —— sticky top:116px（顶栏 60 + tab 56），背景页面底色，滚动时恒贴 tab 栏下方
   作用域 .cash-pane 仅记账管理 3 tab，发票管理等同用 .filter-bar/.btn-icon 的页面不受影响 */
.cash-pane .filter-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 16px 0 12px; padding: 0;
  background: transparent; border: none; border-radius: 0; box-shadow: none;
  position: sticky; top: 116px; z-index: 30;
}
.cash-pane .filter-bar input,
.cash-pane .filter-bar select {
  width: auto; min-width: 110px; max-width: 200px; flex: 0 1 auto;
  height: 35px; box-sizing: border-box;
  padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--card); font-size: 13px; color: var(--primary-dark);
}
.cash-pane .filter-bar input:focus,
.cash-pane .filter-bar select:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,70,229,.15);
}
.cash-pane .filter-bar .btn-icon {
  height: 30px; box-sizing: border-box;
  display: inline-flex; align-items: center; line-height: 1;
  padding: 5px 10px; font-size: 12px; border-radius: 8px;
}
/* 查询（button）= 靛蓝实底；重置（a）= 描边灰 */
.cash-pane .filter-bar button.btn-icon {
  background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: none;
}
.cash-pane .filter-bar button.btn-icon:hover { background: #4338CA; border-color: #4338CA; color: #fff; }
.cash-pane .filter-bar a.btn-icon { background: var(--card); }
.cash-pane .filter-bar a.btn-icon:hover { border-color: var(--primary); color: var(--primary); background: var(--card); }

/* 记账管理分页条贴底视觉：对齐客户管理 .cust-pager（浅灰紫底横条 + 12px/16px 内距）。
   fin-pager 已有 flex-shrink:0 贴底布局（pane flex 列末尾），仅补视觉底色与内距。 */
.cash-pane .fin-pager { background: var(--card-2); padding: 12px 16px; }

/* ===== 发票管理 5 个 tab 筛选行：规格对齐「客户管理 - 搜索行」（2026-08-29 用户指定） =====
   与记账管理 .cash-pane .filter-bar 同一套规格：透明裸行、13px/35px 输入、查询=靛蓝实底、
   重置=描边、sticky top:116 贴 tab 栏下。作用域 .inv-app 仅发票管理 5 个 panel。 */
.inv-app .filter-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 16px 0 12px; padding: 0;
  background: transparent; border: none; border-radius: 0; box-shadow: none;
  position: sticky; top: 116px; z-index: 30;
}
.inv-app .filter-bar input,
.inv-app .filter-bar select {
  width: auto; min-width: 110px; max-width: 200px; flex: 0 1 auto;
  height: 35px; box-sizing: border-box;
  padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--card); font-size: 13px; color: var(--primary-dark);
}
.inv-app .filter-bar input:focus,
.inv-app .filter-bar select:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,70,229,.15);
}
.inv-app .filter-bar .btn-icon {
  height: 30px; box-sizing: border-box;
  display: inline-flex; align-items: center; line-height: 1;
  padding: 5px 10px; font-size: 12px; border-radius: 8px;
}
.inv-app .filter-bar button.btn-icon {
  background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: none;
}
.inv-app .filter-bar button.btn-icon:hover { background: #4338CA; border-color: #4338CA; color: #fff; }
.inv-app .filter-bar a.btn-icon { background: var(--card); }
.inv-app .filter-bar a.btn-icon:hover { border-color: var(--primary); color: var(--primary); background: var(--card); }

/* ===== 发票管理 4 个同步面板（台账/销项票/确认无票/未知票）表格：逐属性对齐客户管理 .cust-app（2026-08-29 用户指定）
   进项票 tab（data-panel="in"，未加 inv-sync 类）不参与同步、保持原样。 ===== */
/* 表格外壳 .inv-table-shell：白底卡 + 1px 描边 + 直角 + 柔和投影（同 .cust-table-shell），
   内含 table-wrap（滚动）+ fin-pager（贴底），flex:1 吃满面板剩余高度 */
.inv-sync .inv-table-shell {
  flex: 1 1 0%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 0;
  box-shadow: 0 6px 24px rgba(12,36,93,.06);
  overflow: hidden;
}
/* 台账/销项的 inv-toolbar 包裹不再贡献下边距：筛选行→表格净间距 12px 全由 filter-bar margin-bottom 提供（同客户管理） */
.inv-sync .inv-toolbar { margin-bottom: 0; }
/* 表格滚动区：透明、无框、flex:1 内部滚动（同 .cust-app .table-wrap），覆盖内联 .inv-scroll 的圆角卡样式 */
.inv-sync .table-wrap.inv-scroll {
  flex: 1 1 0%;
  min-height: 0;
  overflow: auto;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  max-height: none;
}
.inv-sync .data-table { border-collapse: separate; border-spacing: 0; table-layout: fixed; width: auto; min-width: 100%; }
/* 表头：#eef1f5 底 + 700 + 13px + 15/16 内距 + 吸顶（同 .cust-app .data-table thead th） */
.inv-sync .data-table thead th {
  background: #eef1f5;
  color: #111;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: .3px;
  text-transform: none;
  padding: 15px 16px;
  border-bottom: 0.5px solid var(--line);
  position: sticky; top: 0; z-index: 5;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* 表体：13px + 14/16 内距 + 行 hover + 末行无下边框（同 .cust-app） */
.inv-sync .data-table tbody td {
  padding: 14px 16px;
  border-bottom: 0.5px solid var(--line);
  color: var(--text);
  font-size: 13px;
  vertical-align: middle;
  position: relative;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.inv-sync .data-table tbody tr:hover { background: var(--card-2); }
.inv-sync .data-table tbody tr:last-child td { border-bottom: none; }
/* 列宽：fixed 布局默认 150px（含拖拽内联宽度渲染），列总宽超出容器时 .inv-scroll 横向滚动 */
.inv-sync .data-table th, .inv-sync .data-table td { width: 150px; }
/* td 内子元素字号统一 13px（发票号/金额/标签/徽章/流水号），对齐客群管理同款处理 */
.inv-sync .data-table td .muted,
.inv-sync .data-table td .inv-no-link,
.inv-sync .data-table td .fu-src,
.inv-sync .data-table td .rel-chip,
.inv-sync .data-table td .inv-status,
.inv-sync .data-table td .inv-attach-badge,
.inv-sync .data-table td .link-btn,
.inv-sync .data-table td .btn-ghost { font-size: 13px; }
/* 列宽拖拽手柄（同 .cust-app .col-resizer）：贴列右边界竖线，hover 靛蓝半透明 */
.inv-sync .col-resizer {
  position: absolute; top: 0; right: 0;
  width: 9px; height: 100%;
  cursor: col-resize; z-index: 6;
  background: transparent;
  -webkit-user-select: none; user-select: none;
  transition: background-color .12s ease;
}
.inv-sync .col-resizer:hover { background: var(--primary); opacity: .28; }
.inv-sync .col-resizer.is-dragging { background: var(--primary); opacity: .5; }
.inv-sync .col-resizing, .inv-sync .col-resizing * { cursor: col-resize !important; user-select: none !important; }
/* 分页条：移入壳内贴底（浅灰紫底横条 + 12/16 内距，同 .cust-pager / 记账 .cash-pane .fin-pager） */
.inv-sync .fin-pager { flex-shrink: 0; margin: 0; background: var(--card-2); padding: 12px 16px; }

/* ===== 进项票·厂商票况视图（vendor-inv-box 内三张子表）保持原样：不被 .inv-sync 13px 规格影响 =====
   进项票面板已加 inv-sync（普通列表同步客户管理 13px），但厂商票况视图里的三张子表
   （已收票/未收票/确认无票清单）是 12px 原样设计，这里用更高特异性全部还原 */
.inv-sync .vendor-inv-box .data-table { border-collapse: collapse; table-layout: auto; width: 100%; min-width: 0; }
.inv-sync .vendor-inv-box .data-table thead th {
  background: var(--card-2); color: var(--muted); font-weight: var(--fw-regular);
  font-size: 12px; letter-spacing: 0; text-transform: none;
  padding: 9px 11px; border-bottom: 1px solid var(--line);
  position: static; overflow: visible; text-overflow: clip; white-space: normal;
}
.inv-sync .vendor-inv-box .data-table tbody td {
  padding: 9px 11px; border-bottom: 1px solid var(--line); color: var(--text);
  font-size: 12px; vertical-align: middle; position: static;
  overflow: visible; text-overflow: clip; white-space: normal;
}
.inv-sync .vendor-inv-box .data-table tbody tr:hover { background: var(--bg-list); }
.inv-sync .vendor-inv-box .data-table tbody tr:last-child td { border-bottom: 1px solid var(--line); }
.inv-sync .vendor-inv-box .data-table th, .inv-sync .vendor-inv-box .data-table td { width: auto; }
.inv-sync .vendor-inv-box .data-table td .muted,
.inv-sync .vendor-inv-box .data-table td .inv-no-link,
.inv-sync .vendor-inv-box .data-table td .rel-chip,
.inv-sync .vendor-inv-box .data-table td .inv-status,
.inv-sync .vendor-inv-box .data-table td .link-btn,
.inv-sync .vendor-inv-box .data-table td .btn-ghost { font-size: 12px; }

/* 记账管理列排序标识：对齐客户管理 .cust-app .sort-ind（SVG 细双三角，hover 加深、asc/desc 靛蓝高亮） */
.cash-pane .sort-ind { cursor: pointer; user-select: none; color: #b9bfce; font-size: 10px; line-height: 1; margin-left: 4px; }
.cash-pane .sort-ind .si-up, .cash-pane .sort-ind .si-down { display: flex; line-height: 0; }
.cash-pane .sort-ind .si-up svg, .cash-pane .sort-ind .si-down svg { width: 10px; height: 6px; display: block; }
.cash-pane .sort-ind:hover { color: #7c87a0; }
.cash-pane .sort-ind.asc .si-up { color: var(--primary); }
.cash-pane .sort-ind.desc .si-down { color: var(--primary); }

/* 成交列表：+ 展开订单子项 */
.deal-expand { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; padding: 0; margin-right: 6px; border: 1px solid var(--line); border-radius: 5px; background: var(--card); color: var(--primary); font-size: 15px; line-height: 1; cursor: pointer; vertical-align: middle; }
.deal-expand:hover { background: var(--primary-soft); border-color: var(--primary); }
.deal-sub-row > td { padding: 10px 14px 10px 35px; background: transparent; }
.deal-sub-wrap { background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); padding: 10px 12px; overflow-x: auto; }
.deal-sub-table { margin: 0; font-size: var(--fs-13); }
.deal-sub-table th { font-weight: var(--fw-bold); color: var(--primary-dark); white-space: nowrap; }
.deal-sub-table td { padding: 5px 10px; white-space: nowrap; }
.col-check { width: 36px; text-align: center; }

/* 产品类型管理弹窗：纯居中面板，带遮罩 + 淡入动画 */
.to-modal { position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 90; display: none; align-items: center; justify-content: center; padding: 16px; background: rgba(8,12,20,.45); }
.to-modal.open { display: flex; }
.to-panel { width: min(460px, 92vw); max-height: 80vh; display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 8px 30px rgba(0,0,0,.12); overflow: hidden; opacity: 0; transform: translateY(10px) scale(.98); transition: opacity .18s ease, transform .2s cubic-bezier(.16,1,.3,1); }
.to-modal.open .to-panel { opacity: 1; transform: none; }
.to-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line); font-weight: var(--fw-bold); font-size: var(--fs-15); color: var(--primary-dark); flex-shrink: 0; }
.to-close { border: none; background: var(--chip); width: 28px; height: 28px; border-radius: 50%; font-size: 16px; line-height: 1; cursor: pointer; color: var(--text); padding: 0; display: inline-flex; align-items: center; justify-content: center; transition: background-color .15s ease, color .15s ease; }
.to-close:hover { background: var(--danger-soft); color: var(--c-danger); }
.to-body { padding: 16px 18px 18px; overflow: auto; }
.to-body .edit-form .form-row { margin-bottom: 14px; }
.to-body .edit-form label { font-weight: 500; }

/* 全局确认弹窗（替代浏览器原生 confirm） */
.gc-wrap { display: flex; gap: 14px; align-items: flex-start; }
.gc-icon {
  flex: 0 0 40px; width: 40px; height: 40px; border-radius: 50%;
  background: var(--c-danger); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(220,38,38,.35);
}
.gc-icon svg { width: 20px; height: 20px; }
.gc-icon--info { background: var(--primary-soft); color: var(--primary); box-shadow: none; }
.gc-msg { flex: 1 1 auto; min-width: 0; font-size: var(--fs-14); line-height: 1.7; color: var(--text); white-space: pre-wrap; word-break: break-word; }
.gc-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

/* 自定义日期选择器（替代浏览器原生 date picker） */
.dp-popup {
  position: fixed; z-index: 999; width: 360px;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow-hover); padding: 10px; display: none;
  font-family: inherit;
}
.dp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.dp-title { display: inline-flex; align-items: center; gap: 2px; font-size: 15px; font-weight: var(--fw-bold); color: var(--primary-dark); }
.dp-title-btn { border: none; background: transparent; font: inherit; font-size: 15px; font-weight: var(--fw-bold); color: var(--primary-dark); cursor: pointer; padding: 2px 8px; border-radius: 8px; transition: background-color .12s ease, color .12s ease; }
.dp-title-btn:hover { background: var(--primary-soft); color: var(--primary); }
.dp-nav { width: 30px; height: 30px; border: none; background: var(--chip); border-radius: 8px; cursor: pointer; color: var(--text); font-size: 17px; line-height: 1; display: inline-flex; align-items: center; justify-content: center; }
.dp-nav:hover { background: var(--primary-soft); color: var(--primary); }
.dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.dp-grid--ym { grid-template-columns: repeat(4, 1fr); gap: 3px; }
.dp-dow { text-align: center; font-size: 12px; color: var(--muted); padding: 3px 0; }
.dp-cell { text-align: center; padding: 6px 0; font-size: 14px; border-radius: 8px; cursor: pointer; color: var(--text); transition: background-color .12s ease; }
.dp-cell:hover { background: var(--primary-soft); }
.dp-cell.dp-y, .dp-cell.dp-m { padding: 9px 0; font-size: 14px; }
.dp-cell.dp-sel { background: var(--primary); color: #fff; font-weight: var(--fw-bold); }
.dp-cell.dp-today-mark { box-shadow: inset 0 0 0 1.5px var(--primary); }
.dp-empty { pointer-events: none; }
.dp-foot { display: flex; justify-content: space-between; margin-top: 8px; }
.dp-today, .dp-close { border: none; background: var(--chip); padding: 5px 14px; border-radius: 8px; cursor: pointer; font-size: 12px; color: var(--text); font-family: inherit; }
.dp-today:hover { background: var(--primary-soft); color: var(--primary); }
.dp-close:hover { background: var(--danger-soft); color: var(--c-danger); }

/* 状态胶囊（统一状态标识：在用/维修/报废/已结清等） */
.st-cap { display: inline-flex; align-items: center; gap: 5px; font-size: var(--fs-12); font-weight: 600; padding: 2px 10px; border-radius: 999px; line-height: 1.6; white-space: nowrap; }
.st-cap::before { content: ''; width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.st-cap--ok { background: rgba(45,188,0,.12); color: #1E9E00; }
.st-cap--ok::before { background: #2DBC00; }
.st-cap--warn { background: rgba(250,238,218,.9); color: #BA7517; }
.st-cap--warn::before { background: #FF982F; }
.st-cap--danger { background: rgba(252,235,235,.9); color: #A32D2D; }
.st-cap--danger::before { background: #FF0000; }
.st-cap--muted { background: rgba(140,145,165,.14); color: #8C91A5; }
.st-cap--muted::before { background: #959AB0; }
.st-cap--info { background: rgba(139,92,246,.10); color: #8B5CF6; }
.st-cap--info::before { background: #8B5CF6; }

/* ============ 轻 SaaS 风格组件（参考 CRM 客户列表） ============ */
/* 胶囊图标按钮（顶栏操作） */
.btn-icon { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--text); font-size: var(--fs-13); cursor: pointer; font-family: inherit; transition: background-color .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease; }
.btn-icon svg { width: 15px; height: 15px; flex-shrink: 0; }
.btn-icon:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.btn-icon--primary { background: var(--primary); border-color: transparent; color: #fff; box-shadow: 0 4px 14px rgba(79,70,229,.28); }
.btn-icon--primary:hover { background: #4338CA; border-color: transparent; color: #fff; }
.btn-icon--danger { color: #D93025; }
.btn-icon--danger:hover { border-color: rgba(217,48,37,.4); color: var(--c-danger); background: var(--danger-soft); }

/* 图标+文字 操作列（跟进蓝 / 编辑蓝 / 删除红） */
.op-icon { display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; border-radius: 8px; border: none; background: none; cursor: pointer; color: var(--muted); font-size: var(--fs-12); font-family: inherit; transition: background-color .15s ease, color .15s ease; }
.op-icon svg { width: 14px; height: 14px; flex-shrink: 0; }
.op-icon:hover { background: var(--primary-soft); color: var(--primary); }
.op-icon--danger { color: #D93025; }
.op-icon--danger:hover { background: var(--danger-soft); color: var(--c-danger); }
.op-icon--ok { color: #1E9E00; }
.op-icon--ok:hover { background: rgba(45,188,0,.12); color: #1E9E00; }
.op-icon + .op-icon { margin-left: 2px; }

/* 卡片化筛选区 */
.filter-card { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 12px; box-shadow: var(--shadow); }
.filter-card .fc-item { display: inline-flex; align-items: center; gap: 6px; }
.filter-card input[type="text"], .filter-card select { width: auto; min-width: 150px; padding: 8px 12px; border-radius: 8px; font-size: var(--fs-13); }
.fc-search { position: relative; }
.fc-search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 14px; height: 14px; color: var(--muted); pointer-events: none; }
.fc-search input { padding-left: 30px !important; min-width: 200px !important; }

/* 表格行 hover（轻） */
.data-table tbody tr:hover, .fm-table tbody tr:hover { background: var(--bg-list); }

/* 分页器 */
.pager { display: flex; align-items: center; justify-content: flex-end; gap: 6px; margin-top: 12px; flex-wrap: wrap; font-size: var(--fs-13); color: var(--muted); }
.pager button { min-width: 28px; height: 28px; padding: 0 8px; border: 1px solid var(--line); border-radius: 7px; background: var(--card); color: var(--text); cursor: pointer; font-family: inherit; font-size: var(--fs-13); transition: border-color .15s ease, color .15s ease, background-color .15s ease; }
.pager button:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.pager button.active { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: var(--fw-bold); }
.pager button:disabled { opacity: .45; cursor: not-allowed; }
.pager .pager-info { margin-right: auto; }
.pager select, .pager input[type="number"] { width: auto; padding: 5px 8px; border: 1px solid var(--line); border-radius: 7px; font-size: var(--fs-13); background: var(--card); color: var(--text); }

/* 财务：月度报表统计卡 + 页签 */
.fin-summary { display: flex; gap: 14px; margin-bottom: 16px; flex-wrap: wrap; }
.fs-box { flex: 1 1 180px; padding: 16px 18px; border-radius: 12px; border: 1px solid var(--line); }
.fs-label { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.fs-value { font-size: 22px; font-weight: 500; }
.fs-income { background: rgba(45,188,0,.07); border-color: rgba(45,188,0,.25); }
.fs-income .fs-value { color: #1E9E00; }
.fs-cost { background: rgba(224,49,49,.06); border-color: rgba(224,49,49,.22); }
.fs-cost .fs-value { color: #D93025; }
.fs-profit { background: rgba(139,92,246,.07); border-color: rgba(139,92,246,.25); }
.fs-profit .fs-value { color: #8B5CF6; }
.tab-row { display: flex; gap: 6px; margin-bottom: 14px; }
.tab-btn { padding: 6px 18px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--muted); cursor: pointer; font-size: 13px; }
.tab-btn.active { background: #8B5CF6; border-color: #8B5CF6; color: #fff; }

/* ============================================================
   客户管理页专属视觉（scoped: .cust-app / .cust-detail）
   —— 仅作用于客户管理列表页与详情抽屉（iframe 内），
      不改任何全局类名，其它模块保持原样。
   —— 设计目标：留白、柔和阴影、克制配色、精致排版，营造高端感。
   ============================================================ */

/* ---------- 列表页作用域 ---------- */
/* 客户页 Tab 行（对齐设计系统客户管理页：白底贴顶贴左右、高 56、Tab 文字贴底+居中横条、操作组居中、底部阴影） */
.app-main.cust-full { padding-top: 0; }
.cust-tabbar {
  background: #fff; height: 56px; box-sizing: border-box;
  display: flex; align-items: flex-end; justify-content: space-between;
  padding: 0 24px; margin: 0 -24px;
  box-shadow: 0 3px 6px rgba(0,0,0,.08);
  position: sticky; top: 60px; z-index: 40;   /* 吸顶冻结（客户管理页面锁高不滚动无副作用；信息/客群管理等长页面滚动时 tab 恒贴顶栏下） */
}
/* 含 cust-tabbar 的页面（信息/客群管理）：顶部内距归零，tab 栏与固定顶栏无缝贴合（消除 tab 上方灰缝，同 .cust-full/.cash-full） */
.app-main:has(.cust-tabbar) { padding-top: 0; }
/* 信息管理 seg-tabbar：右侧无 ops 操作组时，.cust-tabbar 会回落到固定 56px；
   而客户管理页有 37px 按钮撑开、实测高 53px —— 导致其下方「筛选行距顶」比客户管理多 3px。
   这里把高度锁死为 53px，让信息管理 6 个 tab 的筛选行与客户管理像素级对齐（无论有无 ops）。 */
.cust-tabbar.seg-tabbar { height: 53px; }
.cust-tabs { display: flex; align-items: flex-end; gap: 28px; position: relative; }
.cust-tab {
  font-size: 14px; color: #64748B;
  padding-bottom: 8px; cursor: pointer; user-select: none; white-space: nowrap;
}
.cust-tab.active { color: #4F46E5; font-weight: 600; }
/* 客户管理页 tab 字号回归全局标准 14px（2026-08-28 用户指定，撤回此前临时调整的 16px） */
.cust-page-tabbar .cust-tab { font-size: 14px; }
/* 滑动指示器：独立滑块（替代 per-tab ::after），Tab 切换时平滑滑过 */
.cust-tab-ind {
  position: absolute; bottom: 0; left: 0; width: 24px; height: 2px;
  border-radius: 2px; background: #4F46E5; pointer-events: none;
  transition: left .28s cubic-bezier(.4,0,.2,1), width .28s cubic-bezier(.4,0,.2,1);
}
.cust-ops { display: flex; align-items: center; gap: 12px; align-self: center; }
/* tab 栏操作区的 <a> 按钮（如批量导入/导出）：显式等高 37px 修正行高撑高（同 button 37px，2026-08-28） */
.cust-tabbar .cust-ops a.btn,
.cash-tabbar .cust-ops a.btn { height: 37px; box-sizing: border-box; display: inline-flex; align-items: center; line-height: 1; }
/* 记账管理 tab 栏右侧按钮组：随 tab 切换显隐（JS 控制 display），默认 flex 排列 */
.cash-ops-set { display: flex; gap: 8px; align-items: center; }
/* 发票管理 tab 栏右侧：未知开票/未知收票 sub-tab 对齐按钮规格 37px（原在筛选行，随录入按钮移入 ops 区） */
.cash-tabbar .unk-sub-btns { margin-left: 0; }
.cash-tabbar .unk-sub-btns .sub-tab { height: 37px; box-sizing: border-box; display: inline-flex; align-items: center; }
@media (max-width: 860px) {
  .cust-tabbar { margin: 0; padding: 0 14px; }
  .cust-ops { gap: 8px; }
}
.cust-app {
  --cust-gap: 18px;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;                   /* 撑满 .app-main 的内容区（客户页下 .app-main 为 flex column），精确贴底 */
  min-height: 0;
}
/* 客户页：让 .app-main 成为 flex 列容器，.cust-app 才能占满视口、分页栏贴浏览器底部。
   仅当 .app-main 内含 .cust-app 时生效，其他模块页面（block 布局）不受影响。 */
.app-main:has(.cust-app) {
  display: flex;
  flex-direction: column;
  padding-bottom: 0;
  flex: 1;                 /* 吃 .app-content 剩余高度（其 min-height: calc(100vh-60px) 已含顶栏），不再固定 100vh 造成溢出 */
  height: auto;
  min-height: calc(100vh - 60px);   /* 撑满视口-顶栏：数据少时 main 也占满，分页行恒贴视口底部（app-content padding-top 60 在 border-box 内，min-height 必须含它才不矮 60px） */
  max-height: calc(100vh - 60px);   /* 约束最大高度：表格超高由内部滚动，分页行冻结视口底部 */
}

/* 页头：更舒展的留白与字距 */
.cust-app .page-head { align-items: flex-end; margin-bottom: 22px; }
.cust-app .page-head h1 { font-size: 28px; letter-spacing: .4px; font-weight: 700; }
.cust-app .page-head .count { font-size: 15px; }
.cust-app .ph-ops { gap: 10px; }

/* 筛选条：卡片化、更柔和的内边距与圆角 */
.cust-app .filter-bar {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 18px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
  gap: 10px;
}
.cust-app .filter-bar input,
.cust-app .filter-bar select { border-radius: 10px; padding: 9px 12px; }

/* 公海批量操作栏：精致浅紫底 + 实线描边 */
.cust-app .sea-batch-bar {
  background: linear-gradient(90deg, rgba(79,70,229,.08), rgba(79,70,229,.03));
  border: 1px solid rgba(79,70,229,.25);
  border-radius: 12px;
  padding: 12px 16px;
  margin: 14px 0 18px;
  box-shadow: var(--shadow);
}
.cust-app .sea-batch-bar .btn { box-shadow: none; }

/* 表格外壳：占满客户页剩余空间，分页栏始终贴在底部 */
.cust-app .cust-table-shell {
  flex: 1 1 0%;               /* 占满 .cust-app 剩余空间，不被自身内容撑开 */
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 0;
  box-shadow: 0 6px 24px rgba(12,36,93,.06);
  overflow: hidden;
  margin-top: 12px;
}
/* 表格区：独立滚动，表头吸顶 */
.cust-app .table-wrap {
  flex: 1 1 0%;               /* 占满 shell 剩余空间，超出才出现滚动条 */
  min-height: 0;
  overflow: auto;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  max-height: none;
}
.cust-app .data-table { border-collapse: separate; border-spacing: 0; table-layout: fixed; width: auto; min-width: 100%; }
/* 表头与末行圆角：贴合 table-wrap 容器，消除边缘白边 */
.cust-app .data-table thead th:first-child { border-top-left-radius: 0; }
.cust-app .data-table thead th:last-child { border-top-right-radius: 0; }
.cust-app .data-table tbody tr:last-child td:first-child { border-bottom-left-radius: 0; }
.cust-app .data-table tbody tr:last-child td:last-child { border-bottom-right-radius: 0; }
.cust-app .data-table thead th {
  background: #eef1f5;
  color: #111;
  font-weight: 700;
  font-size: 13px;                       /* 列名称 13px（2026-08-28 用户指定，原 12px） */
  letter-spacing: .3px;
  text-transform: none;
  padding: 15px 16px;
  border-bottom: 0.5px solid var(--line);
  position: sticky; top: 0; z-index: 5;   /* 列名称一行固定吸顶 */
  overflow: hidden; text-overflow: ellipsis;
}
.cust-app .data-table tbody td {
  padding: 14px 16px;
  border-bottom: 0.5px solid var(--line);
  color: var(--text);
  font-size: 13px;                       /* 列内容 13px（2026-08-28 用户指定，原 12px） */
  vertical-align: middle;
}
/* 列间竖向分割线：颜色与横向分割线一致，发丝级 0.5px */
.cust-app .data-table th,
.cust-app .data-table td { border-right: 0.5px solid var(--line); }
.cust-app .data-table th:last-child,
.cust-app .data-table td:last-child { border-right: none; }
/* 列宽拖拽手柄：贴在每列右边界（竖向分割线）上，悬停变 col-resize 光标，拖动改列宽 */
.cust-app .col-resizer {
  position: absolute; top: 0; right: 0;
  width: 9px; height: 100%;
  cursor: col-resize; z-index: 6;
  background: transparent;
  -webkit-user-select: none; user-select: none;
  transition: background-color .12s ease;
}
.cust-app .col-resizer:hover { background: var(--primary); opacity: .28; }
.cust-app .col-resizer.is-dragging { background: var(--primary); opacity: .5; }
.cust-app .col-resizing, .cust-app .col-resizing * { cursor: col-resize !important; user-select: none !important; }
.cust-app .data-table tbody tr { transition: background-color .15s ease; }
.cust-app .data-table tbody tr:hover { background: var(--card-2); }
.cust-app .data-table tbody tr:last-child td { border-bottom: none; }
/* 行内 hover 编辑：鼠标放到单元格内容上时，末尾出现编辑标识（圆形描边铅笔图标）。
   所有内容列都显示标识：可编辑列（名称/备注/简单字段）原地编辑；不可编辑列（负责人/关联对象/主联系人/复杂字段）点击打开编辑页。
   原地编辑后：点击页面任意非输入框区域自动保存（取代“鼠标移开自动保存”）。 */
.cust-app .data-table tbody td { position: relative; overflow: hidden; text-overflow: ellipsis; }
/* 列宽：fixed 布局下严格按设定宽度（含拖拽内联宽度）渲染；列总宽超过容器时外层 .table-wrap 横向滚动；列少时 min-width:100% 撑满容器；内容溢出由 td 的 overflow:hidden+ellipsis 裁剪，绝不侵入邻列 */
.cust-app .data-table th, .cust-app .data-table td { width: 150px; }
.cust-app .data-table th.col-check, .cust-app .data-table td.col-check { width: 48px; max-width: 48px; padding: 0; text-align: center; }
.cust-app .data-table td.g-name, .cust-app .data-table th[data-col="sys-name"] { white-space: nowrap; }
/* 冻结列：选择框 + 客户名称 固定左侧，横向滚动时保持可见（仅客户表 .cust-app 内） */
.cust-app .data-table th.col-check,
.cust-app .data-table td.col-check,
.cust-app .data-table th[data-col="sys-name"],
.cust-app .data-table td.g-name {
  position: sticky;
  z-index: 2;
  background: var(--card-2);
}
.cust-app .data-table tbody td.col-check,
.cust-app .data-table tbody td.g-name {
  background: var(--bg);   /* 表体行透明，冻结单元格用页面底色挡住横向滚动内容 */
}
.cust-app .data-table thead th.col-check,
.cust-app .data-table thead th[data-col="sys-name"] {
  z-index: 6;              /* 必须高于吸顶表头(thead th 的 z-index:5)，否则横向滚动时右侧表头会盖住冻结列 */
}
.cust-app .data-table th.col-check,
.cust-app .data-table td.col-check {
  left: 0;
  border-right: 1px solid var(--line);
}
.cust-app .data-table th[data-col="sys-name"],
.cust-app .data-table td.g-name {
  left: 48px;              /* 紧贴复选列（列宽 48px，全局 box-sizing:border-box） */
  border-right: 1px solid var(--line);
  box-shadow: 3px 0 5px -3px rgba(12,36,93,.18);  /* 冻结区与滚动区的分界阴影 */
}
.cust-app .data-table tbody td.cell-editable { padding-right: 28px; }
.cust-app .cell-edit {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%) scale(.85);
  width: 22px; height: 22px; display: flex; align-items: center; justify-content: center;
  border-radius: 50%; cursor: pointer; z-index: 3; line-height: 0;
  color: var(--primary, #2f6fed);
  background: #fff; border: 1px solid var(--border, #e3e8f0);
  box-shadow: 0 1px 2px rgba(15,23,42,.10);
  opacity: 0;
  transition: opacity .12s ease, transform .12s ease, background .12s ease, color .12s ease, box-shadow .12s ease;
}
.cust-app .data-table tbody td.cell-editable:hover .cell-edit { opacity: 1; transform: translateY(-50%) scale(1); }
.cust-app .cell-edit:hover {
  background: var(--primary, #2f6fed); color: #fff; border-color: var(--primary, #2f6fed);
  box-shadow: 0 2px 6px rgba(47,111,237,.30);
}
.cust-app .cell-edit svg { display: block; }
.cust-app td.editing { background: #fffbe6; }
.cust-app td.editing .cell-edit { display: none; }
.cust-app .cell-input {
  width: 100%; box-sizing: border-box; font: inherit; color: var(--text, #1a2233);
  border: 1px solid var(--primary, #2f6fed); border-radius: 6px; padding: 5px 7px;
  background: #fff; outline: none;
}
.cust-app td.editing .cell-input { width: calc(100% - 4px); }

/* 单元格内容被截断时的 hover 提示（类似截图的气泡） */
.cust-app .cell-tooltip {
  position: fixed;
  z-index: 100;
  background: #fff;
  color: var(--text, #1a2233);
  border: 1px solid var(--line, #e3e8f0);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  line-height: 1.4;
  box-shadow: 0 4px 16px rgba(15,23,42,.15);
  max-width: 320px;
  word-break: break-all;
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity .12s ease, transform .12s ease;
}
.cust-app .cell-tooltip.show { opacity: 1; transform: translateY(0); }

/* 轻提示 toast（非阻断，自动消失）：批量操作成功反馈，取代原生 alert 弹窗 */
.toast-wrap { position: fixed; right: 18px; bottom: 18px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast {
  pointer-events: auto; min-width: 210px; max-width: 360px;
  background: #fff; color: var(--text, #1a2233);
  border: 1px solid var(--line, #e3e8f0); border-left: 3px solid var(--primary, #2f6fed);
  border-radius: 10px; padding: 10px 14px; font-size: 13px; line-height: 1.5;
  box-shadow: 0 10px 30px rgba(15,30,70,.18);
  display: flex; align-items: center; gap: 8px;
  opacity: 0; transform: translateY(8px); transition: opacity .2s ease, transform .2s ease;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.toast-ok { border-left-color: #1faa59; }
.toast.toast-err { border-left-color: #e03e3e; }
.toast .t-ico { width: 16px; height: 16px; flex: none; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; }
.toast.toast-ok .t-ico { color: #1faa59; }
.toast.toast-err .t-ico { color: #e03e3e; }
/* 首列（名称/复选）左留白，末列（操作）右留白 */
.cust-app .data-table th:first-child,
.cust-app .data-table td:first-child { padding-left: 20px; }
.cust-app .data-table th:last-child,
.cust-app .data-table td:last-child { padding-right: 20px; }

/* 表头与关键列不换行：列多时走横向滚动，避免表头/名称被挤成两行 */
.cust-app .data-table thead th { white-space: nowrap; }
.cust-app .data-table th.col-check,
.cust-app .data-table td.col-check,
.cust-app .data-table td.g-name { white-space: nowrap; }
/* 字段值与系统文本列不换行；备注列超长用省略号，避免撑爆表格 */
.cust-app .data-table tbody td.muted { white-space: nowrap; }
.cust-app .data-table tbody td[data-col="sys-note"] { max-width: 240px; overflow: hidden; text-overflow: ellipsis; }
/* 关联对象列：chips 横向单行紧凑，超长截断，避免整行被撑高 */
.cust-app .data-table tbody td[data-col="sys-rel"] { white-space: nowrap; max-width: 220px; overflow: hidden; }
.cust-app .data-table tbody td[data-col="sys-rel"] .rel-chip {
  display: inline-flex; align-items: center; vertical-align: middle;
  max-width: 150px; overflow: hidden;
}

/* 客户名称链接：作为可点击文字而非链接观感——不加粗、默认 var(--primary)、鼠标触碰不变色不加下划线。
   字号 13px（2026-08-28 用户指定，与表格 th/td 一致；原 12px 是客户名称仍显示 12 的原因——此规则单独覆盖了单元格字号） */
.cust-app .customer-table .g-name .cust-name-link { font-size: 13px; font-weight: 400; color: var(--primary); text-decoration: none; cursor: pointer; }

/* 分页栏：左「共X页·X条」，中翻页数字，右每页条数 + 跳页；始终贴在浏览器底部 */
.cust-app .cust-pager {
  position: sticky;
  bottom: 0;
  z-index: 5;       /* 不再 sticky，由 flex 布局自然压到底部 */
  display: flex; align-items: center; flex-wrap: wrap; gap: 14px;
  padding: 12px 16px; margin-top: 0;
  background: var(--card-2);
  
}
.cust-app .pg-total { color: var(--muted); font-size: 13px; white-space: nowrap; }
.cust-app .pg-nav { display: flex; align-items: center; gap: 6px; }
.cust-app .pg-btn, .cust-app .pg-num {
  min-width: 30px; height: 30px; padding: 0 8px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: 8px; background: var(--card);
  color: var(--text); font-size: 13px; text-decoration: none; cursor: pointer;
  transition: all .15s ease;
}
.cust-app .pg-num:hover, .cust-app .pg-btn:hover { border-color: var(--primary); color: var(--primary); }
.cust-app .pg-num.is-active { background: var(--primary); border-color: var(--primary); color: #fff; }
.cust-app .pg-btn.is-disabled { color: var(--muted); opacity: .45; pointer-events: none; cursor: not-allowed; }
.cust-app .pg-gap { color: var(--muted); padding: 0 2px; }
.cust-app .pg-size, .cust-app .pg-jump { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; white-space: nowrap; margin-left: auto; }
.cust-app .pg-jump { margin-left: 0; }
.cust-app .pg-size label, .cust-app .pg-jump label { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.cust-app .pg-size select, .cust-app .pg-input {
  height: 30px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--card); color: var(--text); padding: 0 8px; font-size: 13px;
}
.cust-app .pg-size select { width: 72px; }
.cust-app .pg-input { width: 64px; }
.cust-app .pg-size select:focus, .cust-app .pg-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px rgba(12,36,93,.12); }
/* 跳页确定按钮（对齐设计系统 Pagination：靛蓝实心、圆角 4） */
.cust-app .pg-jump .btn { border-radius: 4px; padding: 5px 16px; font-size: 13px; }

.cust-app .customer-table .g-name .cust-name-link:hover,
.cust-app .customer-table .g-name .cust-name-link:active { color: var(--primary); text-decoration: none; }

/* 字段设置面板：加宽、更精致卡片 */
.cust-app .col-setting-panel { width: 360px; border-radius: 12px; box-shadow: 0 4px 16px rgba(15,23,42,.10); }
.cust-app .col-setting-panel .csp-item { padding: 10px 12px; border-radius: 10px; box-shadow: none; }

/* ---------- 详情抽屉作用域（iframe 内） ---------- */
/* 客户详情嵌入页：去除 iframe 外壳内边距，由详情体自身控制边界 */
.cdetail-embed .embed-shell { padding: 0; }
.cdetail-embed .cust-detail { padding: 0 16px; }

.cust-detail { padding: 4px 16px; }

/* 详情头部：单一白卡（页头 + 分隔线 + 负责人行） */
.cust-detail .detail-head {
  background: var(--card);
  border-radius: 0;
  box-shadow: none;
  padding: 0;
  margin: 0 -16px 1px;
  overflow: hidden;
  display: block;
}
/* 负责人行：独立通栏白卡，与上页头 0 间距，底部投影（对齐设计系统 131:3 分组阴影） */
.cust-detail .detail-owner {
  background: var(--card);
  border-radius: 0;
  box-shadow: 0 2px 8px rgba(15,23,42,.06);
  padding: 0;
  margin: 0 -16px 14px;
  overflow: hidden;
}
.cust-detail .dh-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 60px; padding: 5px 16px; box-sizing: border-box; }
.cust-detail .dh-left { display: flex; align-items: center; gap: 12px; flex: 1 1 auto; min-width: 0; }
.cust-detail .cust-name-top { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cust-detail .detail-actions { display: flex; gap: 8px; flex-shrink: 0; margin-left: auto; justify-content: flex-end; }
.cust-detail .dh-back { width: 24px; height: 24px; border: none; background: transparent; color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; border-radius: 6px; padding: 0; }
.cust-detail .dh-back:hover { background: var(--card-2); }
.cust-detail .dh-titlewrap { display: flex; align-items: center; gap: 10px; min-width: 0; overflow: hidden; }
.cust-detail .dh-badge { display: inline-flex; align-items: center; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; line-height: 1.4; white-space: nowrap; }
.cust-detail .dh-badge--deal { background: #ECFDF5; color: #047857; }
.cust-detail .dh-badge--sea { background: #F1F5F9; color: #64748B; }
.cust-detail .dh-owner-row { display: flex; align-items: center; gap: 16px; flex-wrap: nowrap; padding: 0 16px 0 52px; height: 55px; box-sizing: border-box; font-size: 13px; color: #334155; }
.cust-detail .dh-owner-item b { font-weight: 600; color: var(--primary-dark); }
.cust-detail .dh-owner-item.dh-subs { color: var(--muted); }
.cust-detail .dh-edit { font-size: 12px; color: var(--muted); background: transparent; border: none; cursor: pointer; padding: 3px 7px; border-radius: 6px; line-height: 1.4; white-space: nowrap; }
.cust-detail .dh-edit:hover { color: var(--primary); background: var(--card-2); }
.cust-detail .cust-name-top { font-size: 18px; font-weight: 700; color: var(--primary-dark); line-height: 1.2; }

/* 详情主操作按钮：更圆润、柔和阴影 */
.cust-detail .detail-actions .btn {
  border-radius: 8px;
  padding: 6px 12px;
  box-shadow: none;
  font-weight: 500;
  font-size: 12px;
}
/* 操作组按钮对齐设计系统 74:16：+分/子公司/+商机/转公海 为白底浅边框、字 #475569 */
.cust-detail .detail-actions .btn-ghost { border-color: #E2E8F0; color: #475569; }
.cust-detail .detail-actions .btn-ghost:hover { background: var(--card-2); border-color: #E2E8F0; color: #475569; box-shadow: none; }
/* 第 6 个：返回X（关闭）按钮 —— 白底无边框、16×16 灰色 X 图标，对齐设计系统 133:15 */
.cust-detail .detail-actions .btn-x-close { background: var(--card); border-color: transparent; color: #475569; padding: 8px; box-shadow: none; }
.cust-detail .detail-actions .btn-x-close:hover { background: var(--card-2); }
.cust-detail .btn-edit-cust {
  border-radius: 8px;
  background: var(--primary);
  box-shadow: none;
}

/* 卡片：更柔和留白与圆角 */
.cust-detail .card {
  border-radius: 0;
  padding: 20px;
  margin-bottom: 14px;
  box-shadow: 0 2px 8px rgba(15,23,42,.06);
}
.cust-detail .card h2 { font-size: 14px; font-weight: 600; margin: 0 0 12px; }
.cust-detail .card h2::before {
  content: none;
}
.cust-detail .card h2.has-viewall { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.cust-detail .card h2.has-viewall .h2-title { display: inline-flex; align-items: baseline; }
.cust-detail .view-all { font-size: 12px; font-weight: 500; color: var(--primary); text-decoration: none; white-space: nowrap; margin-left: auto; }
.cust-detail .view-all:hover { text-decoration: underline; }

/* 字段双列网格：更精致的行分隔 */
.cust-detail .field-grid2 { grid-template-columns: repeat(3, 1fr); gap: 12px 16px; }
.cust-detail .fg-item { padding: 9px 0; border-bottom: 1px solid var(--line); }
.cust-detail .fg-label { min-width: 72px; font-size: 12px; color: var(--muted); }
.cust-detail .fg-val { font-size: 14px; color: #334155; }
.cust-detail .fg-val:hover { background: var(--primary-soft); border-radius: 6px; }

/* 联系人：紧凑行（无卡片框/阴影，行间轻分隔线） */
.cust-detail .contact-grid { gap: 0; }
.cust-detail .contact-card {
  flex-direction: row;
  align-items: center;
  gap: 10px;
  border: none;
  border-bottom: 1px dashed var(--line);
  border-radius: 0;
  background: transparent;
  padding: 8px 4px;
  box-shadow: none;
  transition: background-color .15s ease;
}
.cust-detail .contact-card:last-child { border-bottom: none; }
.cust-detail .contact-card:hover { background: var(--bg-list); box-shadow: none; transform: none; }
.cust-detail .contact-card.is-primary { background: transparent; border-color: transparent; }
.cust-detail .contact-card.is-primary:hover { background: var(--bg-list); }
.cust-detail .cc-avatar {
  flex: 0 0 auto;
  width: 40px; height: 40px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--primary), #4F46E5);
  color: #fff; font-size: 16px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 12px rgba(79,70,229,.28);
}
.cust-detail .contact-card.is-primary .cc-avatar { background: linear-gradient(135deg, #4F46E5, #3730A3); }
.cust-detail .contact-card .cc-top { flex: 1; min-width: 0; display: flex; flex-wrap: nowrap; align-items: center; gap: 4px 10px; overflow: hidden; }
.cust-detail .ci-name, .cust-detail .ci-title, .cust-detail .ci-phone { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.cust-detail .ci-name { font-weight: 600; }
.cust-detail .ci-edit, .cust-detail .set-primary {
  transition: all .15s ease;
}
.cust-detail .ci-name { font-size: 15px; }
.cust-detail .cc-ops { align-self: center; margin-left: auto; }

/* 人员区 */
.cust-detail .personnel-row { gap: 22px; }

/* 时间线卡片精修 */
.cust-detail .detail-split .card { box-shadow: 0 6px 24px rgba(12,36,93,.06); }
.cust-detail .ci-card { border-radius: 12px; }
.cust-detail .ci-dot { box-shadow: 0 0 0 3px var(--primary-soft); }
.cust-detail .ci-kind { display: inline-block; font-size: 11px; line-height: 1; padding: 3px 7px; border-radius: 6px; font-weight: 600; margin-right: 6px; }
.cust-detail .ci-kind--fu { background: #E0E7FF; color: #4338CA; }
.cust-detail .ci-kind--log { background: #FEF3C7; color: #B45309; }

/* 关联标签：保持原有配色，仅圆角更精致 */
.cust-detail .rel-chip { border-radius: 999px; }

/* 移动端适配：详情头部纵向堆叠 */
@media (max-width: 640px) {
  .cust-detail .dh-top { flex-direction: column; align-items: flex-start; height: auto; padding: 12px 16px; }
  .cust-detail .detail-actions { width: 100%; flex-wrap: wrap; }
}

/* ===== 客户详情 Tab 框架（基本信息 / 动态 / 联系人 / 操作日志）===== */
.cust-detail .cust-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 4px 0 14px; }
.cust-detail .cust-tab {
  appearance: none; border: none; background: transparent; cursor: pointer;
  padding: 10px 16px; font-size: 14px; color: var(--muted); font-weight: 500;
  border-bottom: 2px solid transparent; margin-bottom: -1px; border-radius: 6px 6px 0 0;
  transition: color .15s, border-color .15s, background .15s;
}
.cust-detail .cust-tab:hover { color: var(--primary-dark); background: var(--card-2); }
.cust-detail .cust-tab.is-active { color: var(--primary); border-bottom-color: var(--primary); }
.cust-detail .cust-tab-panel { display: none; }
.cust-detail .cust-tab-panel.is-active { display: block; animation: custFade .18s ease; }
@keyframes custFade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
/* Tab 内卡片：沿用原 detail-split 的内部滚动行为（动态/操作日志） */
.cust-detail .cust-tab-panel .card { max-height: 60vh; display: flex; flex-direction: column; margin-bottom: 10px; }
.cust-detail .cust-tab-panel .card > h2 { flex-shrink: 0; }
.cust-detail .cust-tab-panel .card > .fu-filter, .cust-detail .cust-tab-panel .card > .log-filter { flex-shrink: 0; }
.cust-detail .cust-tab-panel .card > .chrono { overflow-y: auto; flex: 1; min-height: 0; padding-right: 4px; }

/* ===== 列表：复选框列 + 批量操作栏 + 统一搜索框 ===== */
.cust-app table.data-table th.col-check,
.cust-app table.data-table td.col-check { width: 48px; text-align: center; padding: 0; }
/* 删除所选：红字红边框（对齐设计系统 Bulk 组 danger 按钮），hover/触发保持红色加深 */
.cust-app .cust-bulkbar .link-btn-danger {
  color: #DC2626; border-color: #FCA5A5; background: #fff;
}
.cust-app .cust-bulkbar .link-btn-danger:hover {
  color: #B91C1C; border-color: #F87171; background: rgba(220,38,38,.06);
}
.cust-app .cust-bulkbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: transparent; border: none; border-radius: 0;
  padding: 0;
  margin: 16px 0 0;
  box-shadow: none;
}
.cust-app .cust-bulkbar .bb-sep { width: 1px; height: 18px; background: var(--line); }
.cust-app .cust-bulkbar .btn { white-space: nowrap; }
.cust-app .cust-bulkbar .btn:disabled { opacity: .45; cursor: not-allowed; pointer-events: none; }
.cust-app .cust-bulkbar .chk { user-select: none; }
.cust-app .cust-bulkbar .chk-list { display: flex; flex-direction: column; gap: 6px; max-height: 190px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; min-width: 230px; background: #fff; }
.cust-app .cust-bulkbar .chk-list .chk { display: flex; align-items: center; gap: 6px; font-weight: 400; }
.cust-app .cust-bulkbar .chk-list .chk input { margin: 0; }

/* 批量栏：转移下拉菜单 */
.cust-app .cust-dropdown { position: relative; display: inline-block; }
.cust-app .cust-dropdown .caret { font-size: 10px; margin-left: 4px; opacity: .7; }
.cust-app .cust-dropdown-menu {
  position: absolute; top: 100%; left: 0; margin-top: 6px;
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 8px 24px rgba(12,36,93,.12); min-width: 150px; z-index: 100;
  display: none; flex-direction: column; padding: 6px; gap: 2px;
}
.cust-app .cust-dropdown-menu.open { display: flex; }
.cust-app .cust-dropdown-item {
  display: block; width: 100%; text-align: left;
  padding: 8px 12px; border: none; border-radius: 8px;
  background: transparent; color: var(--text); font-size: 13px; cursor: pointer;
  white-space: nowrap;
}
.cust-app .cust-dropdown-item:hover { background: var(--card-2); }
.cust-app .cust-dropdown-item:disabled { opacity: .45; cursor: not-allowed; pointer-events: none; }

.cust-app .cust-search { display: flex; gap: 8px; align-items: center; flex-wrap: nowrap; margin: 0; }
/* 查询/重置按钮统一 30px 高（对齐成交管理筛选行标准，2026-08-28 用户指定）。
   inline-flex + line-height:1 修正 <a> 重置按钮被行高撑高、与 button 高度不一致的问题 */
.cust-app .cust-search .btn {
  height: 30px; box-sizing: border-box;
  display: inline-flex; align-items: center; line-height: 1;
}
.cust-app .cust-search .cs-field {
  padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--card);
  font-size: 13px; color: var(--primary-dark); min-width: 120px;
}
.cust-app .cust-search .cs-input {
  flex: 1 1 240px; min-width: 180px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--card); font-size: 13px; color: var(--primary-dark);
}
.cust-app .cust-search .cs-input:focus, .cust-app .cust-search .cs-field:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,70,229,.15);
}
.cust-app .cust-search .cs-input::-webkit-search-cancel-button,
.cust-app .cust-search .cs-input::-ms-clear { display: none; }
.cust-app .cust-search .cs-clear {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--card); color: var(--muted); text-decoration: none;
  transition: border-color .15s ease, color .15s ease, background .15s ease;
}
.cust-app .cust-search .cs-clear:hover {
  border-color: var(--primary); color: var(--primary); background: #fff;
}
.cust-app .cust-search .cs-clear svg { width: 16px; height: 16px; }

/* 列排序箭头（仅客户页，作用于可排序列表头：客户名称/负责人/文本/金额/数字/多级连选字段） */
.cust-app .data-table thead th .th-label {
  display: inline-block; max-width: calc(100% - 34px);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle;
}
.cust-app .sort-ind {
  position: absolute; top: 50%; right: 12px; transform: translateY(-50%);
  display: inline-flex; flex-direction: column; align-items: center;
  gap: 1.33px;   /* 上下箭头中间间隙缩小 1/3（原 2px → 1.33px） */
  cursor: pointer; user-select: none; color: #b9bfce; font-size: 10px; line-height: 1;
}
.cust-app .sort-ind .si-up, .cust-app .sort-ind .si-down {
  display: flex; line-height: 0;
}
.cust-app .sort-ind .si-up svg, .cust-app .sort-ind .si-down svg {
  width: 10px; height: 6px; display: block;
}
.cust-app .sort-ind:hover { color: #7c87a0; }
.cust-app .sort-ind.asc .si-up { color: var(--primary); }
.cust-app .sort-ind.desc .si-down { color: var(--primary); }

/* ===== 记账管理企行户余额卡片（2026-08-08，查询行上方展示企行户最新余额） ===== */
.fin-bal-cards { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; flex-shrink: 0; }
.bal-card {
  flex: 1 1 180px; min-width: 180px; max-width: 260px;
  padding: 12px 16px;
  background: var(--card-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  display: flex; flex-direction: column; gap: 6px;
  position: relative;
}
.bal-card-name { font-size: 12px; color: var(--muted); }
.bal-card-amt { font-size: 18px; font-weight: 600; color: var(--primary); font-variant-numeric: tabular-nums; line-height: 1.2; }
/* 卡片顺序调整小按钮（前移/后移） */
.bal-card-move { position: absolute; top: 6px; right: 8px; display: flex; gap: 2px; }
.bal-card-move button {
  width: 18px; height: 18px; padding: 0; border: none; background: transparent;
  color: var(--muted); font-size: 9px; line-height: 1; cursor: pointer; border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
}
.bal-card-move button:hover { background: rgba(79,70,229,.12); color: var(--primary); }
.bal-card-move button.is-disabled { opacity: .3; cursor: not-allowed; }
.bal-card-move button.is-disabled:hover { background: transparent; color: var(--muted); }

/* ===== 记账管理列表页列排序箭头（2026-08-08，与客户管理一致：日期/账户列） ===== */
/* 所有列文字统一 12px（与「分类」列 .muted 一致），颜色保持各列原有设计 */
.fin-app .data-table td { font-size: 12px; }
/* 账户转账 / 厂商充值列表：所有列统一 12px（与备注列 .muted 一致），颜色保持各列原有设计 */
#pane-transfers .data-table td,
#pane-vendors .data-table td { font-size: 12px; }
/* 账户转账 / 厂商充值列表：表头吸顶（滚动时列名不消失，背景 var(--card-2) 遮挡内容） */
#pane-transfers .data-table thead th,
#pane-vendors .data-table thead th { position: sticky; top: 0; z-index: 5; }
.fin-app .data-table thead th { position: relative; }
.fin-app .data-table thead th .th-label {
  display: inline-block; max-width: calc(100% - 34px);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle;
}
.fin-app .sort-ind {
  position: absolute; top: 50%; right: 12px; transform: translateY(-50%);
  display: inline-flex; flex-direction: column; align-items: center;
  gap: 1.33px;
  cursor: pointer; user-select: none; color: #b9bfce; font-size: 10px; line-height: 1;
}
.fin-app .sort-ind .si-up, .fin-app .sort-ind .si-down {
  display: block; font-style: normal; line-height: 1; font-size: 10px;
}
.fin-app .sort-ind:hover { color: #7c87a0; }
.fin-app .sort-ind.asc .si-up { color: var(--primary); }
.fin-app .sort-ind.desc .si-down { color: var(--primary); }

/* ===== 记账管理列表页表格（2026-08-08，与客户管理一致：竖线/列宽拖拽/冻结列/双向滚动/分页/详情） ===== */
/* 满屏：含记账表格的页面让 .app-main 变 flex 列容器并固定视口高，表格区撑满剩余空间（同客户管理） */
.app-main:has(.fin-app) {
  display: flex;
  flex-direction: column;
  padding-bottom: 0;
  flex: 1;
  height: auto;
  min-height: calc(100vh - 60px);
  max-height: calc(100vh - 60px);   /* 扣除顶栏 60px：原 100vh 未扣顶栏，底部溢出 60px 把分页条推出视口外（对齐客户管理写法） */
}
.table-wrap.fin-app {
  overflow: auto;
  flex: 1 1 0%;
  min-height: 0;
  max-height: none;
  background: var(--card);   /* 白底（对齐客户管理 .cust-table-shell，2026-08-29 用户指定） */
  border: 1px solid var(--line);
  border-radius: 0;          /* 直角（对齐客户管理） */
  box-shadow: 0 6px 24px rgba(12,36,93,.06);   /* 柔和投影（对齐客户管理） */
}
/* 记账管理聚合页：entries pane 撑满（tab 切换时 display:none 由 inline style 控制，优先） */
#pane-entries { display: flex; flex-direction: column; flex: 1 1 0%; min-height: 0; }
#pane-entries .fin-pager { flex-shrink: 0; }
/* 账户转账 / 厂商充值 pane 同样满屏：表格区撑满、内部滚动、分页条贴底 */
#pane-transfers, #pane-vendors { display: flex; flex-direction: column; flex: 1 1 0%; min-height: 0; }
/* 去掉 card 内边距：表格贴满卡片（表头吸顶贴顶无白边，与记账管理 .table-wrap.fin-app 风格一致） */
#pane-transfers .card, #pane-vendors .card { flex: 1 1 0%; min-height: 0; display: flex; flex-direction: column; overflow: hidden; padding: 0; border-radius: 0; box-shadow: 0 6px 24px rgba(12,36,93,.06); }
#pane-transfers .card .fin-tbl-scroll, #pane-vendors .card .fin-tbl-scroll { flex: 1 1 0%; min-height: 0; overflow: auto; }
#pane-transfers .fin-pager { flex-shrink: 0; }
.fin-app .data-table { border-collapse: separate; border-spacing: 0; table-layout: fixed; width: auto; min-width: 100%; }
.fin-app .data-table thead th {
  background: var(--card-2);
  color: var(--text);
  font-weight: var(--fw-bold);
  position: sticky; top: 0; z-index: 5;   /* 列名称一行固定吸顶 */
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  border-bottom: 1px solid var(--line);
}
.fin-app .data-table tbody td {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
/* 列间竖向分割线：颜色与横向分割线一致，发丝级 0.5px */
.fin-app .data-table th,
.fin-app .data-table td { border-right: 0.5px solid var(--line); }
.fin-app .data-table th:last-child,
.fin-app .data-table td:last-child { border-right: none; }
/* 列宽拖拽手柄：贴在每列右边界，悬停变 col-resize 光标，拖动改列宽 */
.fin-app .col-resizer {
  position: absolute; top: 0; right: 0;
  width: 9px; height: 100%;
  cursor: col-resize; z-index: 6;
  background: transparent;
  -webkit-user-select: none; user-select: none;
  transition: background-color .12s ease;
}
.fin-app .col-resizer:hover { background: var(--primary); opacity: .28; }
.fin-app .col-resizer.is-dragging { background: var(--primary); opacity: .5; }
.fin-app .col-resizing, .fin-app .col-resizing * { cursor: col-resize !important; user-select: none !important; }
/* 冻结列：编号(left:0) + 账户(left:96px)，横向滚动时保持可见（日期列不冻结） */
.fin-app .data-table th.col-no, .fin-app .data-table td.col-no,
.fin-app .data-table th.col-acc, .fin-app .data-table td.col-acc {
  position: sticky; z-index: 2;
  background: var(--card-2);
  border-right: 1px solid var(--line);
  box-shadow: 3px 0 5px -3px rgba(12,36,93,.18);
}
.fin-app .data-table th.col-no, .fin-app .data-table td.col-no { left: 0; }
.fin-app .data-table th.col-acc, .fin-app .data-table td.col-acc { left: 96px; }
.fin-app .data-table tbody td.col-no,
.fin-app .data-table tbody td.col-acc { background: var(--bg); }
.fin-app .data-table thead th.col-no,
.fin-app .data-table thead th.col-acc { z-index: 6; }  /* 高于吸顶表头，横向滚动时右侧表头不盖冻结列 */
.fin-app .entry-no-link { color: var(--primary); text-decoration: none; cursor: pointer; }
.fin-app .entry-no-link:hover { text-decoration: underline; }
.fin-app .entry-no { color: var(--primary-dark); text-decoration: none; cursor: default; }
.fin-app .mono { font-variant-numeric: tabular-nums; }
.fin-app .data-table tbody tr:hover { background: var(--card-2); }
.fin-app .data-table tbody tr:last-child td { border-bottom: none; }

/* 记账管理分页条（复刻客户管理 .cust-pager） */
.fin-pager { display: flex; align-items: center; gap: 16px; padding: 14px 4px; flex-wrap: wrap; }
.fin-pager .pg-total { color: var(--muted); font-size: 13px; white-space: nowrap; }
.fin-pager .pg-nav { display: flex; align-items: center; gap: 6px; }
.fin-pager .pg-btn, .fin-pager .pg-num {
  min-width: 30px; height: 30px; padding: 0 8px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: 8px; background: var(--card);
  color: var(--text); font-size: 13px; text-decoration: none;
}
.fin-pager .pg-num:hover, .fin-pager .pg-btn:hover { border-color: var(--primary); color: var(--primary); }
.fin-pager .pg-num.is-active { background: var(--primary); border-color: var(--primary); color: #fff; }
.fin-pager .pg-btn.is-disabled { color: var(--muted); opacity: .45; pointer-events: none; cursor: not-allowed; }
.fin-pager .pg-gap { color: var(--muted); padding: 0 2px; }
.fin-pager .pg-size, .fin-pager .pg-jump { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; white-space: nowrap; margin-left: auto; }
.fin-pager .pg-jump { margin-left: 0; }
.fin-pager .pg-size label, .fin-pager .pg-jump label { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.fin-pager .pg-size select, .fin-pager .pg-input { padding: 5px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--text); font-size: 13px; }
.fin-pager .pg-size select { width: 72px; }
.fin-pager .pg-input { width: 64px; }
.fin-pager .pg-size select:focus, .fin-pager .pg-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px rgba(12,36,93,.12); }

/* 成交管理分页条（服务端分页，复刻客户管理 .cust-pager / 记账 .fin-pager 一致结构） */
.deal-pager { display: flex; align-items: center; gap: 16px; padding: 14px 4px; flex-wrap: wrap; }
.deal-pager .pg-total { color: var(--muted); font-size: 13px; white-space: nowrap; }
.deal-pager .pg-nav { display: flex; align-items: center; gap: 6px; }
.deal-pager .pg-btn, .deal-pager .pg-num {
  min-width: 30px; height: 30px; padding: 0 8px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: 8px; background: var(--card);
  color: var(--text); font-size: 13px; text-decoration: none;
}
.deal-pager .pg-num:hover, .deal-pager .pg-btn:hover { border-color: var(--primary); color: var(--primary); }
.deal-pager .pg-num.is-active { background: var(--primary); border-color: var(--primary); color: #fff; }
.deal-pager .pg-btn.is-disabled { color: var(--muted); opacity: .45; pointer-events: none; cursor: not-allowed; }
.deal-pager .pg-gap { color: var(--muted); padding: 0 2px; }
.deal-pager .pg-size, .deal-pager .pg-jump { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; white-space: nowrap; margin-left: auto; }
.deal-pager .pg-jump { margin-left: 0; }
.deal-pager .pg-size label, .deal-pager .pg-jump label { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.deal-pager .pg-size select, .deal-pager .pg-input { padding: 5px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--text); font-size: 13px; }
.deal-pager .pg-size select { width: 72px; }
.deal-pager .pg-input { width: 64px; }
.deal-pager .pg-size select:focus, .deal-pager .pg-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px rgba(12,36,93,.12); }

/* 导入记账结果 */
.imp-ok { color: #1E9E00; font-size: 13px; margin-bottom: 6px; }
.imp-err { color: #D93025; font-size: 13px; }
.imp-err ul { margin: 4px 0 0; padding-left: 18px; }
.imp-err li { margin-bottom: 2px; }

/* 记账详情页 */
.detail-view { display: flex; flex-direction: column; }
.dv-row { display: flex; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; align-items: flex-start; }
.dv-row:last-child { border-bottom: none; }
.dv-label { flex: 0 0 130px; color: var(--muted); font-size: 13px; }
.dv-value { flex: 1; color: var(--text); word-break: break-all; }

/* ===== 分类管理弹窗（2×2：归属公司/归属个人 × 收入/支出） ===== */
.to-panel.cat-panel { width: min(720px, 94vw); }/* 弹窗内容超高时由 to-body 统一滚动：min-height:0 允许 flex 收缩，避免内容被 max-height 裁剪。
   ⚠️ 勿把 to-body 设 display:flex 或 cat-grid 设 overflow:auto——滚动容器内 flex 子项 min-height:auto 归零会被压扁，scrollHeight 不增长、滚动条不出现（已实测踩坑）。 */
.to-panel.cat-panel .to-body { min-height: 0; overflow-y: auto; }
.to-panel.cat-panel .to-body::-webkit-scrollbar { width: 8px; }
.to-panel.cat-panel .to-body::-webkit-scrollbar-thumb { background: #c3c9d6; border-radius: 4px; }
.to-panel.cat-panel .to-body::-webkit-scrollbar-thumb:hover { background: #a8b0c2; }
.to-panel.cat-panel .cat-grid { max-height: none; overflow: visible; }
.cat-addbar { display: flex; gap: 8px; margin-bottom: 12px; }
.cat-addbar .cat-sel {
  flex: 0 0 auto; height: 34px; padding: 0 8px; border: 1px solid var(--line);
  border-radius: 8px; background: var(--card); font-size: 13px; color: var(--text);
}
.cat-addbar select.cat-sel:first-child { flex: 0 0 92px; }
.cat-addbar select.cat-sel:nth-child(2) { flex: 0 0 70px; }
.cat-addbar input#catName {
  flex: 1; min-width: 0; height: 34px; padding: 0 10px; border: 1px solid var(--line);
  border-radius: 8px; background: var(--card); font-size: 13px; color: var(--text);
}
.cat-addbar input#catName:focus, .cat-addbar .cat-sel:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,70,229,.15);
}
.cat-grid { display: flex; flex-direction: column; gap: 12px; max-height: 56vh; overflow: auto; padding-right: 2px; }
.cat-sec { border: 1px solid var(--line); border-radius: 10px; background: var(--card); overflow: hidden; }
.cat-sec-head {
  padding: 8px 12px; font-weight: var(--fw-bold); font-size: var(--fs-14); color: var(--primary-dark);
  background: var(--chip); border-bottom: 1px solid var(--line);
}
.cat-sec-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 10px 12px 12px; }
.cat-col-head {
  margin-bottom: 6px; font-size: 12px; font-weight: 600; color: var(--muted);
  display: flex; align-items: center; gap: 6px;
}
.cat-col-head::before {
  content: ''; width: 3px; height: 12px; border-radius: 2px; background: var(--primary); flex-shrink: 0;
}
.cat-row {
  display: flex; align-items: center; gap: 8px; padding: 4px 6px 4px 10px; margin-bottom: 5px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--card);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.cat-row:hover { border-color: var(--primary); box-shadow: 0 1px 6px rgba(79,70,229,.12); }
.cat-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; color: var(--text); }
.cat-empty { padding: 8px 6px; font-size: 12px; color: var(--muted); border: 1px dashed var(--line); border-radius: 8px; text-align: center; }
@media (max-width: 640px) {
  .cat-addbar { flex-wrap: wrap; }
  .cat-addbar input#catName { flex: 1 1 100%; }
  .cat-sec-grid { grid-template-columns: 1fr; }
}

/* ============ 销售人员多选选择器（添加/编辑订单弹窗共用） ============ */
.sp-picker { position: relative; }
.sp-trigger {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  width: 100%; height: 38px; padding: 0 12px; box-sizing: border-box;
  border: 1px solid var(--field-border); border-radius: 10px; background: var(--card);
  color: var(--text); font-size: var(--fs-14); font-family: inherit; line-height: 1;
  cursor: pointer; text-align: left;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.sp-trigger:hover, .sp-picker.open .sp-trigger { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.sp-trigger-text { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-trigger-text.empty { color: var(--field-hint); }
.sp-trigger-text .sp-count { color: var(--primary); font-weight: 500; }
.sp-caret { flex-shrink: 0; width: 14px; height: 14px; color: var(--muted); transition: transform .18s ease; }
.sp-picker.open .sp-caret { transform: rotate(180deg); }
/* fixed 定位 + JS 计算坐标：脱离弹窗滚动区裁剪，空间不足时向上展开 */
.sp-menu {
  position: fixed; top: -9999px; left: -9999px; z-index: 1200;
  width: 260px; max-width: 92vw; overflow: auto;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 12px 32px rgba(12,36,93,.16); padding: 8px; box-sizing: border-box;
}
.sp-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.sp-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--card); color: var(--text); font-size: var(--fs-13); line-height: 1.4;
  cursor: pointer; user-select: none; white-space: nowrap;
  transition: background-color .12s ease, border-color .12s ease, color .12s ease;
}
.sp-chip input[type="checkbox"] { display: none; }
.sp-chip:hover { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-dark); }
.sp-chip.is-on { background: var(--primary); border-color: var(--primary); color: #fff; }
.sp-menu[hidden] { display: none; }
.sp-menu-item { padding: 2px; }
.sp-chk {
  display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 10px;
  border-radius: 8px; cursor: pointer; font-size: var(--fs-14); color: var(--text);
  box-sizing: border-box; transition: background-color .12s ease;
}
.sp-chk:hover { background: var(--bg); }
.sp-chk input[type="checkbox"] { margin: 0; accent-color: var(--primary); width: 15px; height: 15px; flex-shrink: 0; }
.sp-chk .sp-name { flex: 1; }
.sp-menu-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 8px 6px 4px; border-top: 1px solid var(--line); margin-top: 4px; }
.sp-menu-empty { padding: 14px 10px; text-align: center; color: var(--muted); font-size: var(--fs-13); }
/* 选中行 */
.sp-selected { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.sp-sel-row {
  display: flex; align-items: center; gap: 8px; padding: 7px 10px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--bg);
}
.sp-sel-row .sp-name { flex: 0 0 76px; font-weight: 500; font-size: var(--fs-13); color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-sel-row .sp-ratio-label { color: var(--muted); font-size: 12px; flex: 0 0 auto; }
.sp-sel-row .sp-ratio { flex: 0 0 93px; min-width: 0; }
.sp-sel-row .sp-profit { flex: 1; min-width: 0; font-size: 12px; color: var(--primary); font-weight: 500; text-align: right; }
.sp-sel-row .sp-remove {
  flex: 0 0 auto; width: 22px; height: 22px; border: none; border-radius: 50%;
  background: transparent; color: var(--muted); font-size: 15px; line-height: 1; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; padding: 0;
  transition: background-color .12s ease, color .12s ease;
}
.sp-sel-row .sp-remove:hover { background: var(--danger-soft); color: var(--danger); }
/* 已选销售人员：2 张卡片占满一行（卡片式：上=姓名+移除，下=比例+分润）
   原规则限定在 #orderModal 下，导致其余订单弹窗（加工号/续费/关联/退款/编辑）退化成单行横排，现改为全局。 */
.sp-selected { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.sp-sel-row {
  width: auto; max-width: none; box-sizing: border-box; min-width: 0;
  flex-direction: column; align-items: stretch; gap: 6px; padding: 8px 10px;
}
.sp-sel-top { display: flex; align-items: center; gap: 6px; }
.sp-sel-top .sp-name { flex: 1 1 auto; min-width: 0; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-sel-bot { display: flex; align-items: center; gap: 6px; }
.sp-sel-bot .sp-ratio { flex: 1 1 48px; min-width: 0; height: 26px; font-size: 12px; }
.sp-sel-bot .sp-profit { flex: 0 1 auto; min-width: 0; font-size: 11px; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ============================================================
   控制台首页（对齐设计系统「控制台首页 V2」：统计卡/图表卡/最近成交）
   ============================================================ */
.dash-app { padding: 0; }

/* 统计卡行 */
.dash-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
/* 统计卡：可点击，焦点（hero）渐变背景通过伪元素 opacity 平滑切换 */
.dash-stat {
  position: relative; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 20px; min-height: 125px;
  display: flex; flex-direction: column; justify-content: space-between; gap: 8px;
  box-shadow: 0 1px 2px rgba(15,23,42,.04);
  cursor: pointer; overflow: hidden;
  transition: box-shadow .25s ease, border-color .25s ease, transform .2s ease;
}
.dash-stat::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(135deg, rgba(79,70,229,.95), rgba(79,70,229,.75));
  opacity: 0; transition: opacity .25s ease;
}
.dash-stat:hover { box-shadow: 0 4px 14px rgba(79,70,229,.14); transform: translateY(-1px); }
.dash-stat-hero { border-color: transparent; box-shadow: 0 8px 20px rgba(79,70,229,.22); }
.dash-stat-hero::before { opacity: 1; }
.dash-stat-hero:hover { transform: none; box-shadow: 0 8px 20px rgba(79,70,229,.22); }
.dash-stat .ds-label, .dash-stat .ds-value, .dash-stat .ds-trend { position: relative; z-index: 1; }
.ds-label { font-size: 13px; color: var(--muted); }
.dash-stat-hero .ds-label { color: rgba(255,255,255,.85); }
.ds-value { font-size: 22px; font-weight: 700; color: var(--text); line-height: 1.25; white-space: nowrap; }
.dash-stat-hero .ds-value { color: #fff; }
.ds-trend { display: flex; align-items: center; gap: 6px; }
.ds-trend .ds-dot { width: 6px; height: 6px; border-radius: 50%; background: #64748B; flex-shrink: 0; }
.ds-trend .ds-trend-text { font-size: 12px; color: var(--muted); }
.dash-stat-hero .ds-trend { background: rgba(255,255,255,.2); border-radius: 6px; padding: 2px 8px; align-self: flex-start; }
.dash-stat-hero .ds-trend .ds-dot { background: #fff; }
.dash-stat-hero .ds-trend .ds-trend-text { color: #fff; }
.ds-trend-primary .ds-dot { background: var(--primary); }
.ds-trend-primary .ds-trend-text { color: var(--primary-dark); }
.ds-trend-danger .ds-dot { background: #EF4444; }
.ds-trend-danger .ds-trend-text { color: #DC2626; }
.ds-trend-success .ds-dot { background: #10B981; }
.ds-trend-success .ds-trend-text { color: #059669; }

/* 卡片通用 */
.dash-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 20px;
  box-shadow: 0 1px 2px rgba(15,23,42,.04);
}

/* 图表卡 */
.dash-chart-card { margin-top: 16px; }
.dc-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.dc-tabs { display: flex; gap: 24px; }
.dc-tab {
  font-size: 16px; color: var(--muted); padding-bottom: 4px; cursor: pointer;
  border-bottom: 2px solid transparent;
}
.dc-tab-active { color: var(--primary); font-weight: 600; border-bottom-color: var(--primary); }
.dc-filters { display: flex; align-items: center; gap: 12px; }
.dc-seg {
  display: flex; background: var(--card-2); border-radius: 6px; padding: 2px; gap: 2px;
}
.dc-seg-item {
  font-size: 12px; color: var(--muted); padding: 5px 10px; border-radius: 5px; cursor: pointer;
}
.dc-seg-active { background: #fff; color: var(--text); font-weight: 500; box-shadow: 0 1px 2px rgba(15,23,42,.08); }
/* 日期区间选择器（对齐设计系统 Date Picker：日历图标 + 起止日期） */
/* 日期区间选择器：无边框（对齐设计系统 Date Picker 62:36） */
.dc-date {
  display: flex; align-items: center; gap: 6px;
  color: #475569;
}
.dc-cal-icon { width: 14px; height: 14px; color: #64748B; flex-shrink: 0; }
.dc-date .dc-date-input {
  border: none; outline: none; background: transparent;
  font-size: 12px; line-height: 1.2; color: #475569; font-family: inherit;
  width: 108px; height: auto; min-width: 0; padding: 0; flex: none;
}
.dc-date-input::-webkit-calendar-picker-indicator { cursor: pointer; opacity: .6; }
.dc-date-input::-webkit-calendar-picker-indicator:hover { opacity: 1; }
.dc-date .dc-date-sep { font-size: 12px; line-height: 1.2; color: #94A3B8; }
.dc-empty {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 13px; color: var(--muted);
}
/* Y 轴刻度列 + 图表区（网格线 + 柱子），对齐设计系统 Chart Plot */
.dc-plot { display: flex; flex-direction: column; margin-top: 16px; }
.dc-plot-main { display: flex; gap: 12px; height: 255px; align-items: stretch; }
.dc-yaxis { position: relative; width: 44px; flex-shrink: 0; }
.dc-yaxis span {
  position: absolute; right: 8px; transform: translateY(50%);
  font-size: 11px; color: #94A3B8; white-space: nowrap;
}
.dc-grid { position: relative; flex: 1; }
.dc-gridline { position: absolute; left: 0; right: 0; height: 1px; background: #E2E8F0; }
.dc-cols { position: absolute; inset: 0; display: flex; align-items: flex-end; gap: 8px; }
.dc-col { flex: 1; height: 100%; }
.dc-bar-wrap { width: 100%; height: 100%; display: flex; align-items: flex-end; justify-content: center; }
.dc-bar {
  position: relative; width: 60%; max-width: 28px; min-width: 8px;
  background: var(--primary); border-radius: 4px 4px 0 0;
  transition: background-color .2s, transform .2s;
}
.dc-bar:hover { background: #4338CA; }
.dc-bar.bar-max { background: #F59E0B; }
.dc-bar.bar-min { background: #C7D2FE; }
.dc-bar:hover.bar-max { background: #D97706; }
.dc-bar:hover.bar-min { background: #A5B4FC; }
/* 悬停数值浮层 */
.dc-tip {
  position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%);
  background: #0F172A; color: #F1F5F9; font-size: 12px; line-height: 1.5;
  padding: 6px 10px; border-radius: 6px; white-space: nowrap; text-align: center;
  box-shadow: 0 8px 20px rgba(15,23,42,.25); z-index: 20;
  opacity: 0; pointer-events: none; transition: opacity .15s;
}
.dc-bar:hover .dc-tip { opacity: 1; }
.dc-xaxis-row { display: flex; margin-top: 6px; }
.dc-xaxis-spacer { width: 56px; flex-shrink: 0; }
.dc-xaxis { flex: 1; display: flex; gap: 8px; }
.dc-x { flex: 1; text-align: center; font-size: 11px; color: var(--muted); white-space: nowrap; }

/* 最近成交 */
.dash-recent { margin-top: 16px; }
/* 数据中心满屏弹性布局（JS 加 .dash-full 类触发，不依赖 :has）：统计卡/最近订单固定、图表卡弹性伸缩、最近订单贴底 */
.app-main.dash-full { display: flex; flex-direction: column; min-height: 0; padding-bottom: 0; }
.app-main.dash-full .dash-app { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.app-main.dash-full .dash-stats { flex: none; }
.app-main.dash-full .dash-chart-card { flex: 1 1 auto; min-height: 320px; display: flex; flex-direction: column; }
.app-main.dash-full .dc-plot { flex: 1; min-height: 0; }
.app-main.dash-full .dc-plot-main { flex: 1; height: auto; min-height: 220px; align-items: stretch; }
.app-main.dash-full .dash-recent { flex: none; }
.dr-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.dr-title { font-size: 16px; font-weight: 600; color: var(--text); margin: 0; }
.dr-more { font-size: 13px; color: var(--primary); text-decoration: none; }
.dr-more:hover { text-decoration: underline; }
.dash-table { width: 100%; border-collapse: collapse; }
.dash-table th {
  text-align: left; font-size: 12px; font-weight: 600; color: var(--muted);
  padding: 12px 20px; border-bottom: 1px solid var(--line); background: var(--card-2);
}
.dash-table td {
  font-size: 12px; color: var(--text); padding: 13px 20px; border-bottom: 1px solid var(--line);
}
.dash-table tr:last-child td { border-bottom: none; }
.dt-cust { color: var(--primary); }
.dt-amt { font-weight: 500; }
.dt-date { color: var(--muted); }
.dt-empty { text-align: center; color: var(--muted); padding: 32px 0; }
.badge-success { background: var(--success-soft, rgba(16,185,129,.12)); color: var(--success, #059669); }
.badge-info { background: var(--info-soft, rgba(59,130,246,.12)); color: var(--info, #2563EB); }
.badge-warning { background: rgba(245,158,11,.12); color: #D97706; }

/* 分页 */
.dash-pager { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; }
.dp-info { font-size: 13px; color: var(--muted); }
.dp-btns { display: flex; align-items: center; gap: 8px; }
.dp-btn {
  font-size: 13px; color: var(--muted); background: var(--card); border: 1px solid var(--line);
  border-radius: 6px; padding: 6px 12px; cursor: pointer;
}
.dp-btn:disabled { opacity: .5; cursor: not-allowed; }
.dp-page {
  font-size: 13px; color: var(--primary); background: var(--primary-soft);
  border-radius: 6px; padding: 5px 10px; font-weight: 500; min-width: 28px; text-align: center;
}

@media (max-width: 1100px) {
  .dash-stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .dash-stats { grid-template-columns: 1fr; }
  .dc-head { flex-direction: column; align-items: flex-start; }
}

/* ===================== 新建客户 · 对齐设计系统 Modal/Medium ===================== */
/* 设计系统令牌：标题17/Bold、副标12、Label13/Medium(#334155)、输入12(#94A3B8)、
   输入高38、底色#F1F5F9、描边#E2E8F0、圆角6、Label-Input间距6、行间距12、卡宽560、圆角12、确定靛蓝#4F46E5 */
.nc-card {
  max-width: 560px; margin: 24px auto; background: var(--card);
  border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
}
.nc-header { display: flex; align-items: flex-start; justify-content: space-between; padding: 20px 24px; }
.nc-header__text { display: flex; flex-direction: column; gap: 4px; }
.nc-title { font-family: 'Noto Sans SC', sans-serif; font-size: 17px; font-weight: 700; color: var(--primary-dark); }
.nc-subtitle { font-family: 'Noto Sans SC', sans-serif; font-size: 12px; color: var(--muted); }
.nc-divider { height: 1px; background: var(--line); border: 0; margin: 0; }

.nc-body { padding: 20px 24px; display: flex; flex-direction: column; gap: 12px; }
.nc-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.nc-label { font-family: 'Noto Sans SC', sans-serif; font-size: 13px; font-weight: 500; color: #334155; }
.nc-label .req { color: #EF4444; margin-left: 2px; }
.nc-row { display: flex; gap: 16px; }
.nc-row > .nc-field { flex: 1 1 0; min-width: 0; }
.nc-region { display: flex; flex-direction: column; gap: 6px; }

.nc-input,
input[type=text].nc-input,
input[type=date].nc-input,
input[type=number].nc-input,
input[type=password].nc-input,
select.nc-input,
textarea.nc-input {
  width: 100%; height: 38px; padding: 0 12px; box-sizing: border-box;
  font-family: 'Noto Sans SC', sans-serif; font-size: 13px !important; color: #334155;
  background: #F1F5F9; border: 1px solid var(--line); border-radius: 6px; outline: none;
}
.nc-body textarea.nc-input { height: 80px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.nc-input::placeholder { color: var(--muted); opacity: 1; }
.nc-input:focus { border-color: var(--primary); background: #fff; }

/* 级联选择（注册地址）覆盖内联白底，统一为设计系统底色 */
.nc-body .casc-input.nc-input { background: #F1F5F9 !important; }
.nc-body input[name^="field_address_"] { background: #F1F5F9; }

/* 负责人 / 协作人 区块对齐设计系统 */
.nc-personnel { display: block; }
.nc-personnel .form-row { margin-bottom: 0; gap: 6px; }
.nc-personnel .form-row > label { font-family: 'Noto Sans SC', sans-serif; font-size: 13px; font-weight: 500; color: #334155; }
.nc-personnel .wecom-search {
  height: 38px !important; font-family: 'Noto Sans SC', sans-serif; font-size: 13px !important; color: #334155 !important;
  background: #F1F5F9 !important; border: 1px solid var(--line) !important; border-radius: 6px !important; outline: none;
}

/* 底部操作区 */
.nc-footer { display: flex; justify-content: flex-end; align-items: center; gap: 12px; padding: 16px 24px; }
.nc-btn {
  font-family: 'Noto Sans SC', sans-serif; font-size: 14px; font-weight: 500;
  padding: 8px 18px; border-radius: 8px; cursor: pointer; border: 1px solid transparent;
  text-decoration: none; display: inline-flex; align-items: center; justify-content: center; line-height: 1.2;
}
.nc-btn--cancel { background: #fff; border-color: var(--line); color: #334155; }
.nc-btn--cancel:hover { border-color: var(--primary); color: var(--primary); }
.nc-btn--ok { background: var(--primary); color: #fff; }
.nc-btn--ok:hover { background: #4338CA; }

/* 嵌入弹框（iframe）时复用同款排版，但不加外层卡片描边。
   弹框标题+分割线由父弹框 .modal-head 提供，故抵消共享 .modal-form 的 18px 内边距，
   仅保留 .nc-body 的 20px/24px（对齐设计系统 Modal/Medium：分割线到首字段=20px） */
.modal-form.nc-embed, .nc-embed { background: var(--card); padding: 0; }

/* 「添加订单」弹窗：整体复用新建客户弹窗的 nc-* 表单样式（标题/分割线/字段/按钮一致），
   仅补充弹窗头部与「销售成本」分区的本页专属规则。 */
.to-panel .nc-head { padding: 20px 24px; font-family: 'Noto Sans SC', sans-serif; font-size: 17px; font-weight: 700; color: var(--primary-dark); }
.nc-fields { display: flex; flex-direction: column; gap: 12px; }
.nc-fields > .nc-row { gap: 16px; }
#orderModal .nc-input[readonly] { background: var(--bg); color: var(--text); }
#orderModal .nc-input[readonly]:focus { border-color: var(--line); background: var(--bg); }
#orderModal .om-sep { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 4px; }
#orderModal .om-sep > span { font-family: 'Noto Sans SC', sans-serif; font-size: 13px; font-weight: 600; color: var(--primary-dark); }
#orderModal .om-sep .switch { margin: 0; }
/* —— 订单表单统一框架：编辑订单 / 加工号 / 续费 / 关联 / 退款 均复用「添加订单」弹窗的 nc-* 排版 —— */
.nc-input[readonly] { background: var(--bg); color: var(--text); }
.nc-input[readonly]:focus { border-color: var(--line); background: var(--bg); }
.of-sep { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 4px; }
.of-sep > span { font-family: 'Noto Sans SC', sans-serif; font-size: 13px; font-weight: 600; color: var(--primary-dark); }
.of-sep .switch { margin: 0; }
.of-hint { font-size: 12px; color: var(--muted); line-height: 1.5; }
.of-body { padding: 20px 24px; display: flex; flex-direction: column; gap: 12px; }
.of-footer {
  display: flex; justify-content: flex-end; align-items: center; gap: 12px; padding: 16px 24px;
  border-top: 1px solid var(--line); border-radius: 0 0 14px 14px;
}
/* 嵌入弹框（iframe）时底部操作条吸底常驻，与「添加订单」弹窗一致：
   内容再长、销售成本区展开/收起，取消与确认始终可见，不会沉到滚动区末尾。 */
.modal-embed .of-footer {
  position: sticky; bottom: 0; z-index: 6;
  background: var(--card);
  box-shadow: 0 -6px 16px rgba(12,36,93,.08);
}
.of-btn { height: 34px; padding: 0 16px; border-radius: 8px; border: 1px solid var(--line); background: #fff; font-size: 13px; font-weight: 500; cursor: pointer; }
.of-btn--cancel { color: #334155; }
.of-btn--cancel:hover { border-color: var(--primary); color: var(--primary); }
.of-btn--ok { background: var(--primary); border-color: var(--primary); color: #fff; }
.of-btn--ok:hover { background: #4338CA; }
.of-btn--danger { background: #D93025; border-color: #D93025; color: #fff; }
.of-btn--danger:hover { background: #B91C1C; }
/* 只读金额（返润/成本/毛利）：与添加订单弹窗一致，强调不可手填 */
.nc-input.of-readonly { background: var(--bg); color: var(--text); cursor: not-allowed; }
#orderModal .sp-trigger { border-radius: 6px; background: #F1F5F9; }
/* 输入框内右侧单位后缀（如成本时长「3 | 年」）：单位贴在框内，不再单独占一行 */
.nc-affix { position: relative; display: block; }
.nc-affix > .nc-input { padding-right: 36px; }
.nc-affix__unit { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-family: 'Noto Sans SC', sans-serif; font-size: 13px; color: var(--muted); pointer-events: none; }
.nc-affix__unit:empty { display: none; }

/* ===== 成交管理 tab 栏：对齐「客户管理 - 全部客户」tab（白底/56px/阴影/滑动横线/吸顶冻结） ===== */

/* 吸顶前提（关键）：
   .app-main 默认 overflow-x: clip，按 CSS Overflow 规范 clip + visible 组合会把
   overflow-y 计算成 hidden，从而「创建滚动容器」——position: sticky 只会在最近的
   滚动容器内吸附，而该容器自身不滚动，于是吸顶彻底失效。
   故成交页单独放开（表格本身由 .table-wrap overflow-x:auto 兜底，不会产生横向溢出）。
   同时 padding-top 归零，让 tab 栏与固定顶栏无缝贴合（对齐客户管理 .cust-full）。 */
.app-main.deal-full { padding-top: 0; overflow: visible; }
.app-main.deal-full > .alert { margin-top: 12px; }          /* 提示条出现时不贴顶栏 */

.deal-tabbar {
  background: #fff; height: 56px; box-sizing: border-box;
  display: flex; align-items: flex-end; justify-content: space-between;
  padding: 0 20px; margin: 0 -20px 12px;     /* 负边距取 .app-main 实际横向内边距 20px，避免撑出横向滚动 */
  max-width: 100vw;
  box-shadow: 0 3px 6px rgba(0,0,0,.08);
  position: sticky; top: 60px; z-index: 40;   /* 冻结：吸附在固定顶栏（60px / z-index 50）正下方 */
}
.deal-tabs { display: flex; align-items: flex-end; gap: 28px; position: relative; }
.deal-tab {
  font-size: 14px; color: #64748B; line-height: 20px;
  padding-bottom: 8px; cursor: pointer; user-select: none; white-space: nowrap; text-decoration: none;
}
.deal-tab:hover { color: var(--text); }
.deal-tab.active { color: #4F46E5; font-weight: 600; }
/* 右侧操作位（可选）：与 .cust-ops 同款，页面未传则整行仅剩 Tab，不产生空档 */
.deal-ops { display: flex; align-items: center; gap: 12px; align-self: center; }
/* 滑动指示器：独立滑块，Tab 切换时平滑滑过 */
.deal-tab-ind {
  position: absolute; bottom: 0; left: 0; width: 24px; height: 2px;
  border-radius: 2px; background: #4F46E5; pointer-events: none;
  transition: left .28s cubic-bezier(.4,0,.2,1), width .28s cubic-bezier(.4,0,.2,1);
}
@media (max-width: 860px) {
  .app-main.deal-full { padding-top: 0; }
  .deal-tabbar { margin: 0 0 12px; padding: 0 14px; top: 0; }   /* 移动端顶栏隐藏，贴视口顶 */
}

/* ===== 成交管理筛选行：规格对齐「客户管理 - 批量操作 + 搜索」行 =====
   对齐项：行间距 16px 上 / 12px 下、元素间距 10px、输入 13px 字 + 8px/12px 内距 + 10px 圆角、
   聚焦靛蓝描边、按钮统一 btn-xs（12px 字 / 8px 圆角）。 */
.deal-filterbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  /* 下边距交给 .deal-table-shell 的 margin-top:12px，筛选行与表格卡片净间距 12px（同客户管理 .cust-search → .cust-table-shell） */
  margin: 0 0 0; padding: 0;
  background: transparent; border: none; border-radius: 0; box-shadow: none;
}
.deal-filterbar input,
.deal-filterbar select {
  width: auto; min-width: 0; max-width: 200px; flex: 0 1 auto;
  padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--card); font-size: 13px; color: var(--primary-dark);
  /* 搜索框/下拉框统一 35px 高（用户指定标准，2026-08-28）。
     同时限制 max-width:200px，防止日历弹出面板过宽。 */
  height: 35px; box-sizing: border-box;
}
/* 搜索框固定宽度、不参与拉伸——成交页筛选项少，flex:1 会把它撑到整行宽（实测 1108px） */
.deal-filterbar input[name="q"] { flex: 0 0 220px; width: 220px; min-width: 0; max-width: none; }
/* 日期/月份选择器：全局 input[type=date]/select 会加 width:100%（line 384），必须覆盖回 auto，否则被外层 flex 容器撑开成「一条横线」 */
.deal-filterbar input[type="date"],
.deal-filterbar input[type="month"],
.deal-filterbar select { width: auto; min-width: 90px; flex: 0 1 auto; }
.deal-filterbar input:focus,
.deal-filterbar select:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,70,229,.15);
}
/* 筛选行按钮统一 30px 高（搜索框保持 35px，2026-08-28 用户指定）。
   inline-flex + line-height:1 修正 <a> 重置按钮因行高被撑高的问题（button/a 默认高度不一致） */
.deal-filterbar .btn {
  white-space: nowrap;
  height: 30px; box-sizing: border-box;
  display: inline-flex; align-items: center; line-height: 1;
}
/* 按钮沿用 .btn-xs 原始规格（12px 字 / 5px 10px 内距），与客户管理搜索行按钮逐像素一致 */
.deal-filterbar .muted { font-size: 13px; flex: none; }
@media (max-width: 860px) {
  .deal-filterbar { gap: 8px; margin: 0 0 0; }
  .deal-filterbar input[name="q"] { flex: 1 1 100%; }
}

/* ============================================================
   成交管理表格：规格 + 布局对齐「客户管理 .cust-app」
   —— 内容区占满视口、表格区独立滚动、表头吸顶、分页栏恒贴视口底部
   —— 文字 12px、单元格内距 14px 16px、列宽可拖拽（.col-resizer）
   ============================================================ */

/* 让 .app-main 成为 flex 列容器，.deal-app 才能占满视口、分页栏贴底（同客户管理） */
.app-main.deal-full:has(.deal-app) {
  display: flex;
  flex-direction: column;
  padding-bottom: 0;
  flex: 1;
  height: auto;
  min-height: calc(100vh - 60px);
  max-height: calc(100vh - 60px);   /* 表格超高由内部滚动，分页行冻结视口底部 */
}
.deal-app {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}
/* 表格外壳：白色卡片（1px 描边 + 柔和阴影），把「表格区 + 分页条」整体包成一张卡，
   与客户管理 .cust-table-shell 逐属性一致——客户页表格的白底正是来自这一层，而非单元格 */
.deal-app .deal-table-shell {
  flex: 1 1 0%;               /* 占满 .deal-app 剩余空间，不被自身内容撑开 */
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 0;
  box-shadow: 0 6px 24px rgba(12, 36, 93, .06);
  overflow: hidden;
  margin-top: 12px;
}
/* 表格区：独立滚动，表头吸顶；白底由外层 shell 提供，此处保持透明（同客户管理） */
.deal-app .table-wrap {
  flex: 1 1 0%;
  min-height: 0;
  overflow: auto;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  max-height: none;
}
.deal-app .data-table { border-collapse: separate; border-spacing: 0; table-layout: fixed; width: auto; min-width: 100%; }
.deal-app .data-table thead th:first-child { border-top-left-radius: 0; }
.deal-app .data-table thead th:last-child { border-top-right-radius: 0; }
.deal-app .data-table tbody tr:last-child td:first-child { border-bottom-left-radius: 0; }
.deal-app .data-table tbody tr:last-child td:last-child { border-bottom-right-radius: 0; }
.deal-app .data-table thead th {
  background: #eef1f5;
  color: #111;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: .3px;
  text-transform: none;
  padding: 15px 16px;
  border-bottom: 0.5px solid var(--line);
  position: sticky; top: 0; z-index: 5;   /* 列名称一行固定吸顶 */
  overflow: hidden; text-overflow: ellipsis;
}
.deal-app .data-table tbody td {
  padding: 14px 16px;
  border-bottom: 0.5px solid var(--line);
  color: var(--text);
  font-size: 12px;
  vertical-align: middle;
}
/* 列间竖向分割线：颜色与横向分割线一致，发丝级 0.5px */
.deal-app .data-table th,
.deal-app .data-table td { border-right: 0.5px solid var(--line); }
.deal-app .data-table th:last-child,
.deal-app .data-table td:last-child { border-right: none; }
/* 单元格：内容溢出省略、垂直居中（同客户管理） */
.deal-app .data-table tbody td {
  position: relative; overflow: hidden; text-overflow: ellipsis; vertical-align: middle;
}
.deal-app .data-table td.g-name { white-space: nowrap; }
/* 订单详情 tab（orders-table）：12 列预设宽度——防止初始化按内容读宽导致表格溢出视口、操作列不可见；
   width:100% 让 table-layout:fixed 真正生效（width:auto 时 Chromium 按内容自动布局，列宽被内容撑乱）；
   操作列 .op-col 为弹性列（initColResize flexCol），吸收剩余空间 */
.deal-app .orders-table { width: 100%; }
.deal-app .orders-table th[data-col="code"] { width: 100px; }
.deal-app .orders-table th[data-col="customer"] { width: 145px; }
.deal-app .orders-table th[data-col="date"] { width: 82px; }
.deal-app .orders-table th[data-col="type"] { width: 90px; }
.deal-app .orders-table th[data-col="product"] { width: 135px; }
.deal-app .orders-table th[data-col="qty"] { width: 48px; }
.deal-app .orders-table th[data-col="price"] { width: 70px; }
.deal-app .orders-table th[data-col="amount"] { width: 80px; }
.deal-app .orders-table th[data-col="paid"] { width: 80px; }
.deal-app .orders-table th[data-col="start_date"] { width: 84px; }
.deal-app .orders-table th[data-col="expire_date"] { width: 84px; }
.deal-app .orders-table th[data-col="op"].op-col { width: 220px; }
.deal-app .data-table tbody tr { transition: background-color .15s ease; }
.deal-app .data-table tbody tr:hover { background: var(--card-2); }
.deal-app .data-table tbody tr:last-child td { border-bottom: none; }

/* 冻结首列（客户 / 成交编号等主列）：横向滚动时常驻左侧，
   对应客户管理的「选择框 + 客户名称」冻结区（成交页无复选列，故只冻结第一列，left: 0） */
.deal-app .data-table th:first-child,
.deal-app .data-table td:first-child {
  position: sticky; left: 0; z-index: 2;
  background: var(--card-2);
  border-right: 1px solid var(--line);
  box-shadow: 3px 0 5px -3px rgba(12, 36, 93, .18);   /* 冻结区与滚动区的分界阴影 */
}
/* 必须高于吸顶表头（thead th 的 z-index: 5），否则横向滚动时右侧表头会盖住冻结列 */
.deal-app .data-table thead th:first-child { z-index: 6; }
/* 冻结单元格：用页面底色（--bg）挡住横向滚动内容，与客户管理 .cust-app 冻结列（td.g-name / td.col-check）同色 */
.deal-app .data-table tbody td:first-child { background: var(--bg); }
.deal-app .data-table tbody tr:hover td:first-child { background: var(--bg); }

/* 表格内链接：鼠标悬停不出现下划线（5 个 tab 统一）。
   注意只写 text-decoration —— 不在此处设 color/font-weight，否则会波及操作列的「详情」按钮（它也是 <a>） */
.deal-app .data-table a,
.deal-app .data-table a:hover,
.deal-app .data-table a:focus { text-decoration: none; }

/* 客户名称 / 成交编号 / 订单号：品牌靛蓝 #4F46E5（= --primary），常规字重不加粗。
   覆盖全局 .entity-name-link 的 --primary-dark(#0F172A) + fw-bold(700)。
   成交列表用 .entity-name-link；订单 / 销售毛利 / 返润 / 公司毛利 4 个 tab 的名称列是 td.g-name 里的裸 <a>，一并覆盖。
   限定 td.g-name 是为避开操作列（td.op-col）里的「详情」按钮 */
.deal-app .data-table .entity-name-link,
.deal-app .data-table td.g-name a {
  color: #4F46E5;
  font-weight: 400;
}
.deal-app .data-table .entity-name-link:hover,
.deal-app .data-table .entity-name-link:focus,
.deal-app .data-table td.g-name a:hover,
.deal-app .data-table td.g-name a:focus {
  color: #4338CA;          /* indigo-700，hover 略深一档作为反馈，仍无下划线 */
  text-decoration: none;
}

/* 列宽拖拽手柄（与 .cust-app .col-resizer 同规格） */
.deal-app .col-resizer {
  position: absolute; top: 0; right: 0;
  width: 9px; height: 100%;
  cursor: col-resize; z-index: 6;
  background: transparent;
  -webkit-user-select: none; user-select: none;
  transition: background-color .12s ease;
}
.deal-app .col-resizer:hover { background: var(--primary); opacity: .28; }
.deal-app .col-resizer.is-dragging { background: var(--primary); opacity: .5; }
.deal-app .col-resizing,
.deal-app .col-resizing * { cursor: col-resize !important; user-select: none !important; }

/* 分页条：贴底 + 浅灰紫底纹（--card-2），与客户管理 .cust-pager 同色 */
.deal-app .deal-pager {
  position: sticky;
  bottom: 0;
  z-index: 5;
  flex: none;
  display: flex; align-items: center; flex-wrap: wrap; gap: 14px;
  padding: 12px 16px; margin: 0;
  background: var(--card-2);
}
@media (max-width: 860px) {
  .app-main.deal-full:has(.deal-app) { min-height: auto; max-height: none; }
  .deal-app { min-height: 0; }
  .deal-app .table-wrap { max-height: none; }
}

/* ============================================================
   数据中心 · 销售毛利区块
   —— 卡片由成交管理「销售毛利」页迁入，口径与数据完全一致
   ============================================================ */
.dash-profit { flex: none; }          /* 固定高度，不参与图表卡的弹性分配 */
/* 单行横向滚动：销售人员多时也不换行堆叠，避免把数据中心撑到需要滚动。
   类名 dash-profit-grid：不能用 .dp-grid —— 与日历组件（DatePicker）的 .dp-grid（7 列网格）冲突，
   曾导致全站日期选择器日历被覆盖成横向 flex + 滚动条（2026-08-28 用户反馈修复） */
.dash-profit-grid { display: flex; gap: 10px; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
.dash-profit-grid::-webkit-scrollbar { height: 6px; }
.dash-profit-grid::-webkit-scrollbar-thumb { background: #c3c9d6; border-radius: 3px; }
.dash-profit-grid::-webkit-scrollbar-thumb:hover { background: #a8b0c2; }
.dp-card {
  flex: 0 0 190px; min-width: 190px;
  background: var(--card-2); border: 1px solid var(--line);
  border-radius: 12px; padding: 10px 12px;
}
.dp-card-hero {
  flex: 0 0 220px; min-width: 220px;
  background: linear-gradient(135deg, #1D4ED8, #3B82F6);
  color: #fff; border: none; padding: 12px 14px;
  box-shadow: 0 4px 14px rgba(29, 78, 216, .18);
}
.dp-label { font-size: 12px; opacity: .85; margin-bottom: 6px; }
.dp-card-hero .dp-value { font-size: 22px; font-weight: 700; }
.dp-name { font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.dp-value { font-size: 20px; font-weight: 700; color: #1D4ED8; }
.dp-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }
.dp-total { font-size: 12px; color: var(--muted); margin-top: 4px; }
.dp-total strong { color: var(--text); }
@media (max-width: 860px) {
  .dp-card { flex: 0 0 160px; min-width: 160px; }
  .dp-card-hero { flex: 0 0 180px; min-width: 180px; }
}


/* === 记账管理 · 流水关联订单分配进度条 === */
.entry-deal-row { display: flex; flex-direction: column; gap: 3px; min-width: 120px; }
.entry-deal-head { font-weight: 600; color: var(--text); }
.entry-deal-customer { font-size: 12px; color: var(--muted); }
.entry-deal-order { font-size: 12px; color: var(--muted); }
.entry-alloc-bar { position: relative; height: 18px; background: var(--line); border-radius: 4px; overflow: hidden; margin-top: 4px; }
.entry-alloc-fill { position: absolute; top: 0; left: 0; height: 100%; background: #1E9E00; border-radius: 4px 0 0 4px; transition: width .2s ease; }
.entry-alloc-label { position: absolute; inset: 0; display: flex; align-items: center; justify-content: space-between; padding: 0 6px; font-size: 11px; line-height: 1; white-space: nowrap; }
.ala-paid { color: #1E9E00; }
.ala-paid strong { font-weight: 700; }
.ala-remain { color: #D93025; }
.ala-remain strong { font-weight: 700; }


/* === 记账管理 · 本笔关联 / 订单剩余 列 === */
td[data-col="entry_alloc"] { width: 90px; text-align: right; font-variant-numeric: tabular-nums; }
td[data-col="order_remaining"] { width: 90px; text-align: right; font-variant-numeric: tabular-nums; }

/* === 客户查重弹窗（搜索式：客户名称 / 分·子公司 / 手机号）· 版本 2026091001 === */
.dup-search { display: flex; gap: 8px; margin-bottom: 12px; }
.dup-search .nc-input { flex: 1; }
.dup-search .btn { white-space: nowrap; padding: 0 18px; }
.dup-group { border: 1px solid var(--line); border-radius: 8px; margin-bottom: 10px; overflow: hidden; }
.dup-gt { padding: 8px 12px; background: var(--card-2); font-size: 13px; font-weight: 600; color: var(--text); display: flex; align-items: center; gap: 6px; }
.dup-row { padding: 8px 12px; font-size: 13px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.dup-row.exact { background: #FEF2F2; }
.dup-row.exact > span:first-child { color: #D93025; font-weight: 600; }
.dup-tag { display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 4px; background: #D93025; color: #fff; font-size: 11px; font-weight: 600; line-height: 16px; vertical-align: middle; }

/* 客户查重弹窗 · 客户名称可点击链接（对齐客户表格 .cust-name-link 规范）· 版本 2026091002 */
.dup-name-link { color: var(--primary); font-weight: 400; text-decoration: none; cursor: pointer; }
.dup-name-link:hover { color: var(--primary-dark); text-decoration: underline; }
.dup-row.exact .dup-name-link { color: #D93025; }
.dup-row.exact .dup-name-link:hover { color: #B3241B; }

/* === 信息管理 · 企查查 tab（列表卡片 + 工商详情）· 版本 2026091003 === */
/* 列表态已由 .info-list 统一接管内距（.app-main 已提供 24px 左右内距、筛选行 margin-top 16px），
   此处不可再叠加页面级 padding —— 否则筛选行距顶、表格距左右都会比客户管理多出一截。
   详情抽屉内的 .qcc-detail 走独立内距，不受影响。 */
.qcc-page.info-list { padding: 0; }

/* ============================================================
   信息管理 6 个子 tab 列表页统一规格（字段信息 / 发票信息 / 账户管理 / 产品 / 厂商 / 企查查快照）
   作用域 .info-list（各页最外层容器挂此类），严格对齐「客户管理列表页」实测值。
   对齐项：
     筛选行 —— 裸行无卡片（transparent/无描边/无圆角/无内距）、margin:16px 0 0、gap:10px
     计数   —— 行首（最左），12px 灰、nowrap、右侧留 4px 与搜索框拉开
     搜索框 —— 固定 260px 宽、35px 高 / 13px 字 / 8px 12px 内距 / 10px 圆角
     下拉   —— 同输入规格（min-width:120px）
     按钮   —— 查询·重置·刷新统一 30px 高 / 12px 字 / 8px 圆角 / padding:5px 10px
     聚焦   —— 靛蓝描边 + 3px 外发光
   冻结   —— 表格壳 .info-table-shell 约束高度，表头吸顶 + 首列冻结 + 分页贴底
   ============================================================ */

.info-list .filter-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 16px 0 0; padding: 0;
  background: transparent; border: none; border-radius: 0; box-shadow: none;
}
/* 计数：行首，与搜索框拉开 4px */
.info-list .filter-bar .info-count {
  font-size: 12px; color: #94A3B8; white-space: nowrap;
  line-height: 1.4; margin-right: 4px;
}
/* 覆盖全局 .filter-bar input/select 的 min-width 与全局 input/select 的 width:100% */
.info-list .filter-bar input,
.info-list .filter-bar select {
  width: auto; flex: 0 1 auto;
  height: 35px; box-sizing: border-box;
  padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--card); font-size: 13px; color: var(--primary-dark);
}
/* 搜索框固定 260px（用户指定，不吸收剩余空间） */
.info-list .filter-bar input.cs-input { flex: 0 0 260px; width: 260px; min-width: 0; }
.info-list .filter-bar select.cs-field { min-width: 120px; }
.info-list .filter-bar input:focus,
.info-list .filter-bar select:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,70,229,.15);
}
/* 查询 / 重置 / 刷新按钮统一 30px 高（inline-flex + line-height:1 修正 <a> 被行高撑高） */
.info-list .filter-bar .btn {
  height: 30px; box-sizing: border-box;
  display: inline-flex; align-items: center; line-height: 1;
  padding: 5px 10px; font-size: 12px; border-radius: 8px;
  white-space: nowrap;
}
/* 行尾动作按钮（如「更新数据」「管理账户类型」）贴最右 */
.info-list .filter-bar .bar-end { margin-left: auto; }

/* —— 表格壳：逐属性对齐客户管理 .cust-table-shell（flex:1 1 0% / 直角 / 柔和投影 / margin-top 12px）—— */
.info-list { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
.info-list .info-table-shell {
  display: flex; flex-direction: column;
  flex: 1 1 0%; min-height: 0;
  margin-top: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 0;                                    /* 同客户页：直角，贴合容器 */
  box-shadow: 0 6px 24px rgba(12,36,93,.06);           /* 同客户页：柔和投影 */
  overflow: hidden;
}
/* 表格区：独立滚动，表头吸顶（flex:1 1 0% 占满 shell 剩余空间，超出才出滚动条） */
.info-list .info-table-shell .table-wrap {
  flex: 1 1 0%; min-height: 0; overflow: auto;
  max-height: none; border: none; border-radius: 0;
  box-shadow: none; margin: 0; background: transparent;
}

/* —— 表格本体：fixed 布局 + 列宽由 col-resize.js 接管（同客户页 table-layout:fixed）—— */
.info-list .data-table,
.info-list .fm-table {
  border-collapse: separate; border-spacing: 0;
  table-layout: fixed; width: auto; min-width: 100%;
}

/* —— 表头：13px / 700 / #111 / #eef1f5 底（同客户管理实测值）/ 15px 16px 内距 / 吸顶 z-index:5 —— */
.info-list .data-table thead th,
.info-list .fm-table thead th {
  background: #eef1f5; color: #111;
  font-weight: 700; font-size: 13px; letter-spacing: .3px;
  padding: 15px 16px;
  border-bottom: 0.5px solid var(--line);
  position: sticky; top: 0; z-index: 5;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;   /* 列标题一行，不换行 */
}
/* —— 表体：13px / var(--text) / 14px 16px 内距 / 内容一律不换行（超出省略号裁剪）—— */
.info-list .data-table tbody td,
.info-list .fm-table tbody td {
  padding: 14px 16px;
  border-bottom: 0.5px solid var(--line);
  color: var(--text); font-size: 13px; vertical-align: middle;
  position: relative;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;   /* 列内容不换行，绝不侵入邻列 */
}
/* 末行去掉横线，贴合壳底 */
.info-list .data-table tbody tr:last-child td,
.info-list .fm-table tbody tr:last-child td { border-bottom: none; }

/* —— 列间竖线：0.5px 发丝级（同客户管理）—— */
.info-list .data-table th,
.info-list .data-table td,
.info-list .fm-table th,
.info-list .fm-table td { border-right: 0.5px solid var(--line); }
.info-list .data-table th:last-child,
.info-list .data-table td:last-child,
.info-list .fm-table th:last-child,
.info-list .fm-table td:last-child { border-right: none; }

/* —— 冻结列（同客户页）：复选列 sticky left:0(48px)；名称列紧贴其后 left:48px；无复选列时名称列 left:0 ——
   表头冻结格 z-index:6 必须高于吸顶表头(5)，否则横向滚动时右侧表头会盖住冻结列 */
.info-list .data-table th.col-check,
.info-list .data-table td.col-check,
.info-list .fm-table th.col-check,
.info-list .fm-table td.col-check {
  position: sticky; left: 0; z-index: 2;
  width: 48px; max-width: 48px; padding: 0; text-align: center;
  background: #eef1f5;
  border-right: 1px solid var(--line);
}
.info-list .data-table tbody td.col-check,
.info-list .fm-table tbody td.col-check { background: var(--bg); }
.info-list .data-table thead th.col-check,
.info-list .fm-table thead th.col-check { z-index: 6; }

/* 名称列（冻结）：默认贴最左；若前面有复选列则右移 48px 紧贴其后 */
.info-list .data-table th[data-col="sys-name"],
.info-list .data-table td.g-name,
.info-list .fm-table th[data-col="sys-name"],
.info-list .fm-table td.g-name {
  position: sticky; left: 0; z-index: 2;
  background: #eef1f5;
  border-right: 1px solid var(--line);
  box-shadow: 3px 0 5px -3px rgba(12,36,93,.18);   /* 冻结区与滚动区的分界阴影 */
}
.info-list .data-table tbody td.g-name,
.info-list .fm-table tbody td.g-name { background: var(--bg); }
.info-list .data-table thead th[data-col="sys-name"],
.info-list .fm-table thead th[data-col="sys-name"] { z-index: 6; }
.info-list .data-table th.col-check + th[data-col="sys-name"],
.info-list .data-table td.col-check + td.g-name,
.info-list .fm-table th.col-check + th[data-col="sys-name"],
.info-list .fm-table td.col-check + td.g-name { left: 48px; }

/* 发票信息页：前两列（对象类型 / 客户名称）同为冻结区，客户名称右移 96px 紧贴对象类型之后。
   仅在无复选列的前缀结构下成立，故用「相邻兄弟」选择器精确命中，不影响其他页 */
.info-list .data-table th[data-col="sys-object-type"],
.info-list .data-table td[data-col="sys-object-type"],
.info-list .fm-table th[data-col="sys-object-type"],
.info-list .fm-table td[data-col="sys-object-type"] {
  position: sticky; left: 0; z-index: 2;
  width: 96px;
  background: #eef1f5;
  border-right: 1px solid var(--line);
}
.info-list .data-table tbody td[data-col="sys-object-type"],
.info-list .fm-table tbody td[data-col="sys-object-type"] { background: var(--bg); }
.info-list .data-table thead th[data-col="sys-object-type"],
.info-list .fm-table thead th[data-col="sys-object-type"] { z-index: 6; }
.info-list .data-table th[data-col="sys-object-name"],
.info-list .data-table td[data-col="sys-object-name"],
.info-list .fm-table th[data-col="sys-object-name"],
.info-list .fm-table td[data-col="sys-object-name"] {
  position: sticky; left: 96px; z-index: 2;
  background: #eef1f5;
  border-right: 1px solid var(--line);
  box-shadow: 3px 0 5px -3px rgba(12,36,93,.18);
}
.info-list .data-table tbody td[data-col="sys-object-name"],
.info-list .fm-table tbody td[data-col="sys-object-name"] { background: var(--bg); }
.info-list .data-table thead th[data-col="sys-object-name"],
.info-list .fm-table thead th[data-col="sys-object-name"] { z-index: 6; }

/* 字段信息页：冻结区 = 复选列(48) + 序号列(52) + 字段名称列（左移 100px 紧贴序号列）。
   该页无 .g-name / sys-name 命名，用 fm-* 键与 col-* 类名对接 */
.info-list .fm-table th.col-num,
.info-list .fm-table td.col-num {
  position: sticky; left: 48px; z-index: 2;
  width: 52px; text-align: center;
  background: #eef1f5;
  border-right: 1px solid var(--line);
}
.info-list .fm-table tbody td.col-num { background: var(--bg); }
.info-list .fm-table thead th.col-num { z-index: 6; }
.info-list .fm-table th[data-col="fm-name"],
.info-list .fm-table td.col-name {
  position: sticky; left: 100px; z-index: 2;
  background: #eef1f5;
  border-right: 1px solid var(--line);
  box-shadow: 3px 0 5px -3px rgba(12,36,93,.18);
}
.info-list .fm-table tbody td.col-name { background: var(--bg); }
.info-list .fm-table thead th[data-col="fm-name"] { z-index: 6; }

.info-list .data-table tbody tr,
.info-list .fm-table tbody tr { transition: background-color .15s ease; }
.info-list .data-table tbody tr:hover,
.info-list .fm-table tbody tr:hover { background: var(--card-2); }
/* 列宽拖拽手柄（配合 /js/col-resize.js） */
.info-list .col-resizer {
  position: absolute; top: 0; right: 0; width: 9px; height: 100%;
  cursor: col-resize; z-index: 6; background: transparent;
  -webkit-user-select: none; user-select: none;
  transition: background-color .12s ease;
}
.info-list .col-resizer:hover { background: var(--primary); opacity: .28; }
.info-list .col-resizer.is-dragging { background: var(--primary); opacity: .5; }
.info-list .col-resizing, .info-list .col-resizing * { cursor: col-resize !important; user-select: none !important; }

/* —— 分页条：贴壳底（浅灰底纹 12px 16px 内距，同客户管理 .cust-pager；无上边框）
   置底机制与客户管理一致：壳为 flex 纵向、表格区 flex:1 内部滚动，分页条 sticky bottom:0
   恒贴视口底部；数据少时由 flex 布局自然压到壳底 —— 两者共同保证「分页恒在底部」—— */
.info-list .cust-pager {
  position: sticky; bottom: 0; z-index: 5;
  display: flex; align-items: center; flex-wrap: wrap; gap: 14px; flex: none;
  padding: 12px 16px; margin: 0;
  background: var(--card-2); border-top: none;
}
.info-list .pg-total { color: var(--muted); font-size: 13px; white-space: nowrap; }
.info-list .pg-nav { display: flex; align-items: center; gap: 6px; }
.info-list .pg-btn, .info-list .pg-num {
  min-width: 30px; height: 30px; padding: 0 8px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: 8px; background: var(--card);
  color: var(--text); font-size: 13px; text-decoration: none; cursor: pointer;
  transition: all .15s ease;
}
.info-list .pg-num:hover, .info-list .pg-btn:hover { border-color: var(--primary); color: var(--primary); }
.info-list .pg-num.is-active { background: var(--primary); border-color: var(--primary); color: #fff; }
.info-list .pg-btn.is-disabled { color: var(--muted); opacity: .45; pointer-events: none; cursor: not-allowed; }
.info-list .pg-gap { color: var(--muted); padding: 0 2px; }
.info-list .pg-size, .info-list .pg-jump {
  display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px;
  white-space: nowrap; margin-left: auto;
}
.info-list .pg-jump { margin-left: 0; }
.info-list .pg-size label, .info-list .pg-jump label { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.info-list .pg-size select, .info-list .pg-input {
  width: auto; height: 30px; box-sizing: border-box;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--card); color: var(--text); padding: 0 8px; font-size: 13px;
}
.info-list .pg-size select { width: 72px; }
.info-list .pg-input { width: 62px; text-align: center; }

/* 允许 .app-main 变成 flex 列容器（同 .cust-app），使表格壳吃满视口、分页贴底 */
.app-main:has(.info-list) {
  display: flex; flex-direction: column;
  padding-bottom: 0; flex: 1; height: auto;
  min-height: calc(100vh - 60px);
  max-height: calc(100vh - 60px);
}

/* —— 企查查快照页：复用 .info-list 规格后，仅保留本页专属差异 —— */
.qcc-page .filter-bar .qcc-refresh { margin-left: auto; }

/* —— 字段信息页：接入 .info-list 后需收口的页面级差异 ——
   1) 原 .fm-page 外层已由 .info-list 接管（.fm-head 标题块已删除，页面标题由 Topbar 承载）
   2) 原 .fm-table 的硬编码列宽会与 table-layout:fixed 打架（变成硬约束），
      故在 .info-list 作用域内重置，改由 col-resize.js 统一接管列宽
   3) .fm-table-wrap 已同时挂 .table-wrap，滚动交给壳，这里只清掉自身描边避免双层 */
.info-list .fm-table-wrap { overflow: visible; border: none; border-radius: 0; background: transparent; }
.info-list .fm-table th, .info-list .fm-table td { text-align: left; }
/* 重置页面级的硬编码列宽（交由 col-resize.js 的 fixedCols / 拖拽结果决定）。
   注意：不重置 white-space —— 沿用 .info-list 的「内容不换行 + 省略号」统一规格 */
.info-list .fm-table .col-num,
.info-list .fm-table .col-type,
.info-list .fm-table .col-scope,
.info-list .fm-table .col-default,
.info-list .fm-table .col-required,
.info-list .fm-table .col-status,
.info-list .fm-table .col-ops,
.info-list .fm-table .col-name { width: auto; }
.info-list .fm-table .col-required { text-align: center; }
.info-list .fm-bulkbar { margin: 12px 0 0; flex: none; }

/* —— 操作列：行内不换行，按钮组水平排列（详情/编辑/删除、改类型/编辑/删除 等） —— */
.info-list .data-table .op-col,
.info-list .fm-table .col-ops {
  white-space: nowrap;
  text-align: right;
}
.info-list .data-table .op-col .btn,
.info-list .data-table .op-col .link-btn,
.info-list .data-table .op-col .op-icon { white-space: nowrap; }
.info-list .data-table .op-col > * + * { margin-left: 8px; }

.qcc-filters { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.qcc-search { flex: 1; min-width: 260px; height: 34px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; outline: none; }
.qcc-search:focus { border-color: var(--primary); }
.qcc-filters select { height: 34px; padding: 0 8px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; background: #fff; }
.qcc-empty { padding: 40px; text-align: center; color: var(--muted); font-size: 13px; }
.qcc-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 12px; }
.qcc-card { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; cursor: pointer; transition: box-shadow .16s, transform .16s; }
.qcc-card:hover, .qcc-card:focus { box-shadow: 0 4px 16px rgba(15, 23, 42, .10); transform: translateY(-1px); outline: none; border-color: var(--primary); }
.qcc-card-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.qcc-name { font-size: 15px; font-weight: 600; color: var(--text); }
.qcc-status { font-size: 12px; padding: 1px 8px; border-radius: 10px; background: var(--card-2); color: var(--muted); }
.qcc-status.ok { background: #E8F5E9; color: #1E9E00; }
.qcc-chip { font-size: 11px; padding: 1px 7px; border-radius: 4px; background: #EAF0FF; color: var(--primary); }
.qcc-score { margin-left: auto; font-size: 13px; font-weight: 700; color: var(--primary); }
.qcc-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px 12px; }
.qcc-grid > div { min-width: 0; }
.qcc-grid label { display: block; font-size: 11px; color: var(--muted); margin-bottom: 2px; }
.qcc-grid span { font-size: 13px; color: var(--text); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qcc-grid .qcc-full { grid-column: 1 / -1; }

/* 详情（iframe 内） */
.qcc-detail { padding: 18px 20px 28px; }
.qcc-detail.embed { padding: 14px 16px 22px; }
.qcc-d-head { display: flex; align-items: flex-start; gap: 12px; justify-content: space-between; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.qcc-d-title h1 { font-size: 17px; font-weight: 600; margin: 0 0 6px; }
.qcc-d-score { text-align: center; flex-shrink: 0; }
.qcc-d-score label { display: block; font-size: 11px; color: var(--muted); }
.qcc-d-score strong { font-size: 22px; color: var(--primary); }
.qcc-sec { margin-top: 16px; }
.qcc-sec-hd { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 8px; padding-left: 8px; border-left: 3px solid var(--primary); }
/* 注意：原 `.qcc-table th/td` 通用规则已删除（2026-09-10）。
   它是企查查详情页早期版本遗留，未加作用域，会污染「企查查快照」列表页的表格规格
   （把表头变成 400/灰字/7px 10px 内距，把表体变成 break-all 换行）。
   详情页现用 .qcc-biz / .qcc-tb，二者均有独立样式，不依赖这一条。 */
.qcc-scope { font-size: 13px; line-height: 1.7; color: var(--text); background: var(--card-2); padding: 10px 12px; border-radius: 8px; max-height: 220px; overflow: auto; }

/* === 企查查详情 v2（还原企查查截图布局）· 版本 2026091004 === */
.qcc-hero { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; }
.qcc-hero-top { display: flex; align-items: flex-start; gap: 12px; }
.qcc-logo { width: 44px; height: 44px; border-radius: 50%; color: #fff; font-size: 20px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.qcc-logo.sm { width: 32px; height: 32px; font-size: 14px; }
.qcc-hero-title { flex: 1; min-width: 0; }
.qcc-hero-name { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.qcc-hero-name h1 { font-size: 18px; font-weight: 600; margin: 0; }
.qcc-hero-sub { margin-top: 6px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.qcc-hero-sub .qcc-chip-line { margin-top: 0; margin-right: 0; }
/* 企查查快照 · 列表（表格形态，与产品/厂商等 tab 一致） */
/* 企业名称列：可拖拽调宽（与其他列一致）。初始 260px 由 col-resize.js 的
   fixedCols 声明，避免 fixed 布局下被按比例拉伸导致不同容器宽下列宽不一致。 */
.qcc-table .col-name { min-width: 190px; }
.qcc-table .w80 { width: 80px; } .qcc-table .w90 { width: 90px; }
.qcc-table .w100 { width: 100px; } .qcc-table .w110 { width: 110px; }
.qcc-table .w120 { width: 120px; } .qcc-table .w180 { width: 200px; }
.qcc-row { cursor: pointer; }
.qcc-table .qcc-row:hover { background: var(--bg-list); }
/* 企业名称文字：13px / 不加粗 / #4f46e5（对齐客户管理名称列的视觉规格，色值按用户指定） */
.qcc-name-link { font-size: 13px; font-weight: 400; color: #4f46e5; text-decoration: none; cursor: pointer; }
.qcc-name-link:hover { color: #4338CA; text-decoration: none; }
.qcc-table .qcc-chip { margin-left: 6px; }
/* 地址列现为表格最右列（操作列已移除，改由它吸收剩余宽度），
   故不再限制 max-width；超长地址仍以省略号截断，完整值在 title 里。 */
.qcc-addr { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qcc-score-cell { color: var(--primary); font-weight: 600; }
/* 列表表格内「所有」文字统一 13px（用户要求：列内容文字大小应一致）。
   .qcc-status / .qcc-chip 全局是 12px / 11px（详情抽屉里合适，但列表里与其余单元格不齐），
   故仅在 .qcc-table 作用域内提到 13px —— 详情抽屉（.qcc-detail）不受影响。 */
.qcc-table .qcc-status,
.qcc-table .qcc-chip,
.qcc-table .qcc-name-link { font-size: 13px; }
/* 客户详情 · 匹配库数据（企查查快照库）弹窗 */
.mq-modal { width: min(680px, 94vw); max-height: 86vh; display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.mq-modal .modal-form { overflow: auto; flex: 1 1 auto; padding: 14px 16px; }
.mq-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 10px 16px; border-top: 1px solid var(--line); background: var(--card-2, #f8fafc); flex: none; }
.mq-loading, .mq-empty { padding: 26px 10px; text-align: center; color: var(--muted); font-size: 13px; line-height: 1.7; }
.mq-tip { font-size: 12px; color: var(--muted); }
.mq-hint { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.mq-hint b { color: var(--text); }
.mq-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.mq-item { display: grid; grid-template-columns: 16px 1fr auto; grid-template-areas: "r n s" ". m m"; gap: 2px 8px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; font-size: 13px; background: #fff; transition: border-color .15s, background .15s; }
.mq-item:hover { border-color: var(--primary); }
.mq-item.is-on { border-color: var(--primary); background: rgba(79, 70, 229, .06); }
.mq-item input { grid-area: r; }
.mq-item .mq-name { grid-area: n; font-weight: 600; color: var(--text); }
.mq-item .qcc-status { grid-area: s; }
.mq-item .mq-sub { grid-area: m; font-size: 12px; color: var(--muted); }
.mq-ptitle { font-size: 13px; font-weight: 600; color: var(--text); margin: 4px 0 8px; padding-left: 8px; border-left: 3px solid var(--primary); }
.mq-tb { width: 100%; border-collapse: collapse; font-size: 13px; table-layout: fixed; }
.mq-tb th { text-align: left; color: var(--muted); font-weight: 400; padding: 7px 8px; border-bottom: 1px solid var(--line); background: var(--card-2, #f8fafc); }
.mq-tb td { padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: top; word-break: break-all; }
.mq-tb .mq-k { width: 88px; color: var(--muted); }
.mq-tb .mq-old { color: var(--muted); }
.mq-tb .mq-arrow { width: 18px; text-align: center; color: var(--muted); }
.mq-tb .mq-new { color: var(--text); }
.mq-tb .mq-new.is-chg { color: var(--primary); font-weight: 600; }
.mq-none { color: #b7bfcc; }
.qcc-out-link { display: inline-flex; align-items: center; gap: 5px; color: var(--primary); text-decoration: none; }
.qcc-out-link:hover { text-decoration: underline; }
.qcc-out-link svg { display: block; opacity: .8; flex: none; }
.qcc-refresh { display: inline-flex; align-items: center; gap: 5px; margin-left: auto; }
.qcc-refresh svg { display: block; }
.qcc-refresh:disabled { opacity: .65; cursor: default; }
.qcc-spin { width: 13px; height: 13px; border: 2px solid var(--line); border-top-color: var(--primary); border-radius: 50%; display: inline-block; animation: qccspin .7s linear infinite; }
@keyframes qccspin { to { transform: rotate(360deg); } }
.qcc-upd { display: inline-flex; align-items: center; gap: 4px; margin-right: 6px; font-size: 12px; color: var(--muted); cursor: default; }
.qcc-upd svg { display: block; opacity: .85; }
.qcc-upd em { font-style: normal; color: var(--text); font-weight: 600; }
.qcc-hero-right { flex-shrink: 0; display: flex; flex-direction: row; align-items: center; gap: 14px; }
.qcc-gobtn { display: inline-flex; align-items: center; gap: 5px; padding: 6px 12px; font-size: 13px; line-height: 1.4; color: var(--primary); border: 1px solid var(--primary); border-radius: 6px; background: #fff; text-decoration: none; white-space: nowrap; transition: background .15s, color .15s; }
.qcc-gobtn:hover { background: var(--primary); color: #fff; }
.qcc-gobtn svg { display: block; }
.qcc-score-box { font-size: 13px; color: var(--muted); }
.qs-val { font-size: 18px; color: var(--primary); margin-left: 2px; }
.qcc-hero-info { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px 24px; margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line); }
.qcc-hi-item { font-size: 14px; line-height: 1.6; display: flex; gap: 2px; min-width: 0; }
.qcc-hi-item label { color: #86909C; white-space: nowrap; flex-shrink: 0; }
.qcc-hi-item span { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qcc-detail.embed .qcc-hi-item span { white-space: normal; word-break: break-all; }
.qcc-sec { margin-top: 18px; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; }
.qcc-sec-hd { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 10px; padding-left: 8px; border-left: 3px solid var(--primary); }
.qcc-sec-n { color: var(--primary); font-weight: 700; }
.qcc-biz { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 14px; border-top: 1px solid var(--line); }
.qcc-biz th.qcc-bk { text-align: left; font-weight: 400; color: #86909C; padding: 12px 12px; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); background: var(--card-2); vertical-align: top; white-space: nowrap; }
.qcc-biz td { padding: 12px 10px; border-bottom: 1px solid var(--line); color: var(--text); word-break: break-all; line-height: 1.6; }
.qcc-biz tr:last-child .qcc-bk, .qcc-biz tr:last-child td { border-bottom: none; }
.qcc-biz .qcc-scope { background: transparent; border: none; padding: 0; max-height: none; font-size: 14px; }
.qcc-tb { width: 100%; border-collapse: collapse; font-size: 13px; }
.qcc-tb thead th { background: var(--card-2); color: var(--muted); font-weight: 500; padding: 8px 10px; border: 1px solid var(--line); text-align: left; }
.qcc-tb tbody td { padding: 9px 10px; border: 1px solid var(--line); color: var(--text); vertical-align: middle; }
.qcc-tb .tx { color: var(--muted); }
.qcc-tb .rt { text-align: right; }
.qcc-tb .ct { text-align: center; }
.qcc-tb .w50 { width: 50px; } .qcc-tb .w70 { width: 70px; } .qcc-tb .w90 { width: 90px; }
.qcc-tb .w100 { width: 100px; } .qcc-tb .w110 { width: 110px; } .qcc-tb .w120 { width: 120px; } .qcc-tb .w200 { width: 200px; }
.qcc-person { display: flex; align-items: center; gap: 10px; }
.qcc-pname { font-weight: 600; margin-bottom: 2px; }
.qcc-chip.gold { background: #FBF3E0; color: #B8860B; margin-right: 4px; }
.qcc-linkcell { color: var(--primary); }

/* === 客户详情 ·「企查查快照」按钮 + 快照弹窗 · 版本 202609101300 === */
/* 按钮位于负责人行最右侧（不是紧跟负责人文字，故脱离 owner-item 间距） */
.cust-detail .dh-owner-row .dh-qcc-btn {
  margin-left: auto;
  display: inline-flex; align-items: center; gap: 5px;
  height: 26px; padding: 0 10px; font-size: 12px; line-height: 1;
  color: var(--primary); border-color: var(--primary-soft, #E0E7FF); background: var(--primary-soft, #EEF2FF);
}
.cust-detail .dh-owner-row .dh-qcc-btn:hover { background: var(--primary); border-color: var(--primary); color: #fff; }
.cust-detail .dh-owner-row .dh-qcc-btn svg { flex-shrink: 0; }

.qcc-snap-modal { width: min(1080px, 94vw); max-height: 92vh; overflow: hidden; }
.qcc-snap-body { flex: 1 1 auto; min-height: 0; display: flex; }
.qcc-snap-frame { width: 100%; height: 78vh; min-height: 320px; border: none; background: var(--bg); border-radius: 0 0 14px 14px; }
