* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  /* §3.1 背景改成极浅渐变：半透明卡要靠"背景有层次"才透气（min-height 保证短页面也铺满） */
  background: var(--bg) no-repeat; min-height: 100vh;
  color: var(--ink); line-height: 1.6;
  padding-bottom: 40px;
}
/* 全局 header 已在浅色化第一轮移除（§一.7）：品牌收进侧栏 logo，用户区/登出下移侧栏底部 */
main { max-width: 760px; margin: 0 auto; padding: 14px; }
/* §3.1 半透明卡 = 半透明白 + 白描边 + 双层柔阴影（禁用 backdrop-filter 后的毛玻璃近似） */
.card {
  background: var(--card); border: 1px solid var(--card-bd); border-radius: var(--r-card);
  padding: 16px; margin-bottom: 14px; box-shadow: var(--shadow);
}
/* §3.1 列表类页面（客户 / 线索 / 待办）+ 所有列表行 → 不透明卡，防长列表掉帧；
   只有大区块（工作台卡片、详情页头部）保留半透明。 */
.item,
#view-clients .card,
#view-leads .card, #view-leads .lead-card,
#view-todo .wb-card,
.wb-todo, .wb-conv { background: var(--card-solid); border-color: var(--card-line-solid); }
.card h2 { font-size: 16px; margin-bottom: 12px; color: var(--ink); }
.tabs { display: flex; gap: 8px; margin-bottom: 12px; }
.tab {
  flex: 1; padding: 8px; border: 1px solid transparent; background: var(--slate-soft);
  border-radius: var(--r-pill); font-size: 13px; cursor: pointer; color: var(--mid);
}
.tab.active { background: var(--brand); color: var(--on-brand); border-color: var(--brand-solid); }
.tabpanel.hidden { display: none; }
.rec-controls { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.rec {
  background: var(--hot); color: var(--on-brand); border: none; border-radius: 8px;
  padding: 10px 18px; font-size: 14px; cursor: pointer;
}
.rec.recording { background: var(--hot-deep); animation: pulse 1.2s infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.6} }
.status { font-size: 13px; color: var(--mut); }
.hint { font-size: 12px; color: var(--mut); margin: 8px 0; }
label { display: block; font-size: 13px; color: var(--mid); margin: 10px 0 4px; }
textarea, input[type=text], input[type=password] {
  width: 100%; border: 1px solid var(--card-bd); border-radius: 8px;
  padding: 8px 10px; font-size: 13px; font-family: inherit; resize: vertical;
  background: var(--field-bg); color: var(--ink);
}
textarea:focus, input[type=text]:focus, input[type=password]:focus { outline: none; border-color: var(--brand-solid); }
input[type=file] { width: 100%; font-size: 13px; color: var(--mid); }
.mini {
  background: var(--field-bg); color: var(--mid); border: 1px solid var(--card-bd); border-radius: 7px;
  padding: 5px 10px; font-size: 12px; cursor: pointer; margin-top: 8px;
}
.mini:hover { background: var(--brand-soft); color: var(--brand-solid); border-color: var(--brand-solid); }
.primary {
  width: 100%; background: linear-gradient(135deg, var(--g1), var(--g2)); color: var(--on-brand); border: none;
  border-radius: 8px; padding: 12px; font-size: 14px; font-weight: 600; cursor: pointer; box-shadow: var(--sh-btn);
}
.primary:active { filter: brightness(.95); }
.modes label { display: block; margin: 6px 0; color: var(--ink); font-size: 14px; }
.check { font-size: 13px !important; color: var(--mid) !important; }
details { font-size: 13px; }
summary { cursor: pointer; color: var(--brand-solid); font-weight: 600; }
.report .placeholder { color: var(--mut); font-size: 14px; }
.report h3 { font-size: 15px; margin: 14px 0 6px; color: var(--brand-solid); }
.report ul { padding-left: 20px; margin: 4px 0; }
.report li { margin: 3px 0; }
.report table { width: 100%; border-collapse: collapse; margin: 6px 0; font-size: 13px; }
.report th, .report td { border: 1px solid var(--brand-line); padding: 6px 8px; text-align: left; }
.report th { background: var(--slate-soft); color: var(--mid); }
.report .warn { color: var(--warm); font-size: 13px; }
.report blockquote { border-left: 3px solid var(--brand-solid); padding-left: 10px; color: var(--mid); margin: 4px 0; }
.report p { color: var(--mid); }

/* ===== 左侧模块导航（竖排） ===== */
.app-shell { display: flex; align-items: stretch; gap: 0; }
.sidebar {
  flex: 0 0 212px; background: var(--card-solid); border-right: 1px solid var(--card-bd);
  padding: 14px 10px; min-height: calc(100vh - 110px);
  display: flex; flex-direction: column;   /* 让 .wb-user 的 margin-top:auto 生效，用户区贴底 */
}
.sb-menu { display: flex; flex-direction: column; gap: 6px; flex: 1 1 auto; }
.sb-item {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  height: 32px; padding: 0 10px; font-size: 13px; cursor: pointer; font-family: inherit;
  background: transparent; color: var(--ink); border: 1px solid transparent; border-radius: 7px;
}
.sb-item:hover { background: var(--slate-soft); color: var(--ink); }
/* §二.4：当前项 = 浅蓝药丸 + 蓝字（不再用左侧竖条 + 深色底） */
.sb-item.active { background: var(--brand-soft); color: var(--brand-solid); border-color: transparent; font-weight: 600; }
.sb-ico { width: 20px; height: 20px; flex: 0 0 20px; display: inline-flex;
  align-items: center; justify-content: center; color: var(--mid); }
.sb-item.active .sb-ico { color: var(--brand-solid); }
.sb-ico svg { display: block; }
.ui-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.sb-text { white-space: nowrap; flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }

/* ===== 电脑端折叠式导航（双端导航第 1 轮）=====
   ① 二级菜单挂在主菜单项**下方**、同一列内缩进显示——不新建独立二级侧栏；
   ② 主模块用淡蓝底（.active），二级模块只用更浅的文字色 + 左侧细线，不跟主模块抢主选中态；
   ③ 小迹是 console 型，没有 .sb-arrow / .sb-sub（DOM 里根本不生成）。 */
.sb-arrow { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
  width: 14px; height: 14px; color: var(--mid); transition: transform .16s ease; }
.sb-item.open .sb-arrow { transform: rotate(90deg); }
.sb-item.active .sb-arrow { color: var(--brand-solid); }
.sb-sub { display: flex; flex-direction: column; gap: 2px; margin: 2px 0 4px 0; padding: 2px 0 2px 22px; }
.sb-sub[hidden] { display: none; }
.sb-sub-item {
  display: flex; align-items: center; gap: 6px; width: 100%; text-align: left;
  height: 28px; padding: 0 8px; font-size: 12.5px; cursor: pointer; font-family: inherit;
  background: transparent; color: var(--mid); border: 1px solid transparent; border-radius: 6px;
}
.sb-sub-item:hover { background: var(--slate-soft); color: var(--ink); }
/* 二级选中：浅底 + 品牌文字色，权重低于主模块的淡蓝药丸 */
.sb-sub-item.active { background: var(--brand-line); color: var(--brand-solid); font-weight: 600; }
.sb-sub-text { white-space: nowrap; flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.sb-sub .sb-badge { margin-left: auto; }

/* 侧栏折成图标栏时，二级菜单与箭头一并收起（图标栏放不下文字，展开也没有意义） */
body.wb-sb-fold .sb-sub,
body.wb-dash.wb-sb-fold .sb-sub,
body.wb-sb-fold .sb-arrow,
body.wb-dash.wb-sb-fold .sb-arrow { display: none; }
.app-shell main { flex: 1 1 auto; min-width: 0; max-width: none; margin: 0; }

/* 窄屏：左侧保持竖排，仅显示图标（不变成顶部栏） */
@media (max-width: 640px) {
  .sidebar { flex: 0 0 60px; padding: 14px 6px; }
  .sb-item { justify-content: center; padding: 11px 0; gap: 0; }
  .sb-text { display: none; }
  /* 60px 图标栏放不下品牌块；但登出入口必须留着，故隐去 logo 与头像/名字、保留按钮 */
  .wb-logo { display: none; }
  .wb-user { padding: 8px 0 0; justify-content: center; border-top: 1px solid var(--brand-line); }
  .wb-user .wb-avatar, .wb-user .ub-name { display: none; }
  .userbar { justify-content: center; }
}

/* 个人中心 · 主页外观开关②：侧栏折叠为图标栏（桌面端生效）
   状态存 db.settings.sbFold，由 app.js 的 applyLook() 给 body 加 .wb-sb-fold；刷新后保持。
   ⚠️ 工作台激活时 body 还带 .wb-dash，下面那条 body.wb-dash .sidebar{flex:0 0 208px} 与本规则
      特异性相同（0,2,1）但位置更靠后，会把折叠顶掉。所以每条都补一个三类的 .wb-dash.wb-sb-fold 版本
      （特异性 0,3,1）压过去，否则折叠在「工作台」页失效、只在其它页生效。 */
body.wb-sb-fold .sidebar,
body.wb-dash.wb-sb-fold .sidebar { flex: 0 0 64px; padding: 14px 6px; }
body.wb-sb-fold .sb-item,
body.wb-dash.wb-sb-fold .sb-item { justify-content: center; padding: 11px 0; gap: 0; }
body.wb-sb-fold .sb-text,
body.wb-dash.wb-sb-fold .sb-text { display: none; }
body.wb-sb-fold .wb-logo { justify-content: center; }
body.wb-sb-fold .wb-logo-meta { display: none; }
body.wb-sb-fold .wb-user { justify-content: center; }
body.wb-sb-fold .wb-user .wb-avatar, body.wb-sb-fold .wb-user .ub-name, body.wb-sb-fold .wb-user .ub-role { display: none; }

/* ===== 首页（聚合入口页） ===== */
.home-search { width: 100%; border: 1px solid var(--brand-line); border-radius: 10px; padding: 9px 12px; background: var(--field-bg); color: var(--ink); font-size: 14px; font-family: inherit; margin: 10px 0 0; }
/* 「首页三张入口卡」已在客户稿对齐第一段移除：形态改为 问候→能量→待办→快捷 6 格→我的客户→右栏，
   入口卡降级为右栏三卡（小迹 / 记忆 / 智能产出），样式统一走 .wb-rail-card / .hm-* 。 */

/* ===== 🤖 AI 助手（独立页面） ===== */
.assistant-page { display: flex; flex-direction: column; }
#view-assistant .ap-msgs { flex: 1; height: auto; min-height: 0; }
#view-assistant .ap-head { border-radius: 12px 12px 0 0; }

/* AI 助手空态：居中新建对话 */
.ap-start { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 22px; text-align: center; overflow: auto; }
.ap-start.hidden { display: none; }
.ap-welcome-title { font-size: 30px; font-weight: 700; color: var(--ink); }
.ap-welcome-sub { font-size: 14px; color: var(--mid); max-width: 480px; line-height: 1.7; }
.ap-start-input { display: flex; gap: 10px; width: 100%; max-width: 560px; }
.ap-start-input textarea { flex: 1; resize: none; background: var(--field-bg); color: var(--ink); border: 1px solid var(--brand-line); border-radius: 12px; padding: 12px; font-size: 14px; font-family: inherit; line-height: 1.4; outline: none; box-shadow: var(--sh-sm); }
.ap-start-input textarea:focus { border-color: var(--brand-solid); }
.ap-start-input button { background: linear-gradient(135deg, var(--g1), var(--g2)); color: var(--on-brand); border: none; border-radius: 12px; padding: 0 18px; font-size: 14px; cursor: pointer; box-shadow: var(--sh-btn); }
.ap-start-input button:hover { filter: brightness(1.04); }
.ap-start-quick { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; max-width: 560px; }
.ap-start-quick button { font-size: 13px; padding: 6px 12px; border: 1px solid var(--brand-line); background: var(--card); color: var(--mid); border-radius: var(--r-pill); cursor: pointer; }
.ap-start-quick button:hover { color: var(--brand-solid); border-color: var(--brand-solid); }
/* 小迹总台三类入口：语音输入 / 文件与内容 / 智能动作（都跳现有真实页面） */
.ap-start-entries { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; max-width: 560px; }
.ap-entry { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; padding: 7px 13px;
  border: 1px dashed var(--brand-line); background: transparent; color: var(--mid);
  border-radius: var(--r-pill); cursor: pointer; font-family: inherit; }
.ap-entry:hover { color: var(--brand-solid); border-color: var(--brand-solid); border-style: solid; background: var(--brand-soft); }
.ap-entry svg { flex: 0 0 auto; }
.view.hidden { display: none; }

/* ===== 通用布局 ===== */
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.row input[type=text] { flex: 1 1 140px; }
select {
  width: 100%; border: 1px solid var(--brand-line); border-radius: 10px; padding: 9px;
  background: var(--field-bg); color: var(--ink); font-size: 14px; font-family: inherit;
}
hr { border: none; border-top: 1px solid var(--brand-line); margin: 12px 0; }
.primary.small { width: auto; padding: 9px 16px; font-size: 14px; }
/* 系统级根防：.hidden 是「隐藏」工具类，必须永远压过任何 display 声明。
   原写法 .hidden{display:none} 优先级仅 (0,1,0)，与 .ap-quick/.ap-input/.ap-msgs 等同级 display 平手时因位置靠后被盖掉，
   导致这些元素「该隐藏却显示」。改成 !important 一次性消灭这一类问题（代价：不能用 display 覆盖 .hidden，本来也不该这么写）。 */
.hidden { display: none !important; }
/* .card 也会被 JS 切 hidden（后台页面模式、卡片显隐），而本轮开始有规则给 .card 声明 display —— 
   按既有约定补一条配对，保证 .hidden 永远压得过那些 display 声明。 */
.card.hidden { display: none !important; }
/* 属性兜底（任务书 §一.8）：页面里还有若干元素是靠 HTML 的 hidden 属性隐藏的
   （#cloudTranscribeRecBtn / #mindmapBtn / #saveToClientBtn / 两个 audio）。.hidden 只管 class 写法，
   属性写法必须有这一条；否则将来给 .mini 之类补一个 display，就会重演「该隐藏却显示」。 */
[hidden] { display: none !important; }

/* ===== 列表（客户/知识库） ===== */
.list { margin-top: 10px; display: flex; flex-direction: column; gap: 10px; }
.item {
  background: var(--card); border: none; border-radius: 12px; padding: 12px; box-shadow: var(--sh-sm);
}
.item .item-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
/* 客户列表卡：阶段标签与意向分成组靠右，避免三段 space-between 把标签顶到中间 */
.item-top .item-right { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.item .item-title { font-size: 15px; font-weight: 600; color: var(--ink); }
.item .item-meta { font-size: 12px; color: var(--mut); margin-top: 4px; }
.tag { font-size: 11px; padding: 2px 8px; border-radius: 20px; background: var(--brand); color: var(--on-brand); }
.tag.s-warm { background: var(--warm); }
.tag.s-deal { background: var(--ok); }
.tag.s-hold { background: var(--slate); }
/* 渠道状态标签（KEJI-LEADS-01）：可用 / 已停用 / 未配置 必须一眼分得开，
   绝不能让"未配置"看起来和"可用"一个颜色。 */
.tag.ok { background: var(--ok); }
.tag.off { background: var(--slate); }
.tag.warn { background: var(--warm); }
.item-actions { display: flex; gap: 6px; margin-top: 8px; }
.item-actions button { font-size: 11px; padding: 4px 10px; border-radius: 6px; border: none; cursor: pointer; }
.btn-edit { background: var(--slate-soft); color: var(--mid); }
.btn-del { background: var(--warm-soft); color: var(--warm); }
.btn-open { background: var(--brand); color: var(--on-brand); }

/* ===== 客户 360 ===== */
.cd-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 10px 0; }
.cd-grid .fld { background: var(--slate-soft); border: none; border-radius: 10px; padding: 10px; }
.cd-grid .fld .k { font-size: 12px; color: var(--mut); }
.cd-grid .fld .v { font-size: 14px; color: var(--ink); margin-top: 2px; }
.conv-item { background: var(--slate-soft); border: none; border-radius: 10px; padding: 10px; margin: 8px 0; }
.conv-item .ci-time { font-size: 11px; color: var(--mut); }
.todo-item { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 4px 0; }
.todo-item.done span { text-decoration: line-through; color: var(--slate); }

/* ===== 分析后存档 / 报告操作 ===== */
.report-actions { display: flex; gap: 8px; margin-bottom: 8px; }
.savepanel { margin-top: 14px; border-top: 1px dashed var(--brand-line); padding-top: 12px; }
.savepanel h3 { font-size: 14px; color: var(--brand-solid); margin-bottom: 8px; }

/* ===== 思维导图 ===== */
.mindmap { margin-top: 12px; background: var(--card); border: 1px solid var(--card-bd); border-radius: 8px; padding: 8px; overflow: auto; box-shadow: none; }
.mindmap svg { display: block; }
.mindmap .mm-center { fill: var(--brand-solid); }
.mindmap .mm-branch { fill: var(--g1); }
.mindmap text { fill: var(--ink); font-size: 12px; font-family: inherit; }
.mindmap .edge { stroke: var(--brand-line); fill: none; }

/* ===== 🤖 内置 AI 助手 ===== */
#assistantPanel {  /* §3.1 固定浮层一律不透明：半透明会透出下面滚动的内容 */
  position: fixed; right: 18px; bottom: 84px; width: 360px; max-width: 92vw; height: 520px; max-height: 80vh;
  background: var(--card-solid); border: none; border-radius: 14px; display: flex; flex-direction: column;
  box-shadow: 0 10px 30px var(--shadow-modal); z-index: 51; overflow: hidden;
}
#assistantPanel.hidden { display: none; }
.ap-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; background: var(--brand-soft); border-bottom: none; }
.ap-head > span { font-weight: 700; color: var(--ink); font-size: 15px; }
.ap-close { background: none; border: none; color: var(--mid); font-size: 22px; cursor: pointer; line-height: 1; padding: 0 2px; }
.ap-close:hover { color: var(--ink); }
.ap-msgs { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.ap-msgs.hidden { display: none; }
.ap-msg { max-width: 86%; padding: 9px 12px; border-radius: 12px; font-size: 13px; white-space: pre-wrap; word-break: break-word; line-height: 1.55; }
.ap-msg.user { align-self: flex-end; background: var(--brand); color: var(--on-brand); border-bottom-right-radius: 3px; }
.ap-msg.ai { align-self: flex-start; background: var(--slate-soft); color: var(--ink); border: none; border-bottom-left-radius: 3px; }
.ap-quick { display: flex; gap: 6px; padding: 8px 10px; flex-wrap: wrap; border-top: 1px solid var(--brand-line); }
.ap-quick.hidden { display: none; }
.ap-quick button { font-size: 12px; padding: 5px 9px; border: 1px solid var(--brand-line); background: var(--card); color: var(--mid); border-radius: var(--r-pill); cursor: pointer; }
.ap-quick button:hover { color: var(--brand-solid); border-color: var(--brand-solid); }
.ap-input { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--brand-line); }
.ap-input.hidden { display: none; }
.ap-input textarea { flex: 1; resize: none; background: var(--field-bg); color: var(--ink); border: 1px solid var(--brand-line); border-radius: 10px; padding: 8px; font-size: 13px; font-family: inherit; max-height: 80px; line-height: 1.4; }
.ap-input textarea:focus { outline: none; border-color: var(--brand-solid); }
.ap-input button { background: var(--brand); color: var(--on-brand); border: none; border-radius: 10px; padding: 0 16px; cursor: pointer; font-size: 13px; }
.ap-input button:hover { filter: brightness(1.05); }

/* ===== 用户栏（登录后显示） ===== */
/* 用户区：已从全局 header 移到侧栏底部（§一.7），改为正常流，不再绝对定位 */
.userbar { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--mid); flex-wrap: wrap; }
.userbar .ub-name { font-weight: 600; color: var(--ink); }
.userbar .ub-role { font-size: 11px; color: var(--mut); }
/* 原 .userbar .mini（登出按钮样式）已随按钮一并删除：侧栏底部只留「头像 + 用户名 + 角色」，
   退出统一在个人中心 #pfLogout，不再有两处入口。 */

/* ===== 登录 / 初始化遮罩 ===== */
.login-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: var(--scrim); display: flex; align-items: center; justify-content: center; padding: 16px;
}
.login-overlay.hidden { display: none; }
.login-card { width: 360px; max-width: 92vw; background: var(--card-solid); border: 1px solid var(--card-bd); border-radius: var(--r-card); padding: 22px; box-shadow: var(--shadow-modal); }
.login-card h1 { font-size: 18px; color: var(--ink); text-align: center; margin-bottom: 14px; }
.login-card h2 { font-size: 16px; color: var(--ink); margin-bottom: 8px; }
.login-card .primary { margin-top: 14px; }
.login-card .warn { color: var(--warm); font-size: 13px; margin-top: 10px; text-align: center; }

/* ===== ⑧ 智能产出 ===== */
.prod-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-top: 12px; }
.prod-card {
  background: var(--card); border: 1px solid var(--card-bd); border-radius: var(--r-card); padding: 14px; box-shadow: none;
  display: flex; flex-direction: column; gap: 8px;
}
.prod-card h3 { font-size: 15px; color: var(--ink); margin-bottom: 2px; }
.prod-card .primary.small { width: 100%; margin-top: 4px; }
.prod-out { margin-top: 6px; min-height: 60px; background: var(--slate-soft); border: none; border-radius: 10px; padding: 10px; }
.prod-out .placeholder { color: var(--mut); font-size: 13px; }
.prod-dl { display: inline-block; margin-top: 8px; color: var(--brand-solid); text-decoration: none; font-size: 14px; }
.prod-dl:hover { text-decoration: underline; }
.eng-cfg { margin-top: 16px; border-top: 1px dashed var(--brand-line); padding-top: 12px; }
.eng-cfg summary { cursor: pointer; color: var(--brand-solid); font-weight: 600; }
.eng-cfg .row { margin-top: 6px; }

/* ===== ④ 获客线索池 / 跟进看板 ===== */
.lead-toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.lead-search { flex: 1 1 200px; }
.lead-pool { display: flex; flex-direction: column; gap: 10px; }
.lead-card { background: var(--card); border: 1px solid var(--card-bd); border-radius: 8px; padding: 12px; box-shadow: none; }
.lead-card.icp-hit { border-color: var(--warm); box-shadow: none; }
.lead-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.lead-name { font-size: 15px; font-weight: 600; color: var(--ink); word-break: break-all; }
/* 客户稿 §3.2：意向分做成环形进度（--p 是 0–100 的分值，不是颜色，所以可以内联传） */
.lead-ring {
  --p: 0; width: 46px; height: 46px; border-radius: 50%; flex: 0 0 auto;
  background: conic-gradient(var(--g1) calc(var(--p) * 1%), var(--slate-soft) 0);
  display: flex; align-items: center; justify-content: center;
}
.lead-ring-in {
  width: 36px; height: 36px; border-radius: 50%; background: var(--card-solid);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: var(--brand-solid); font-variant-numeric: tabular-nums;
}
.chip.chip-src { background: var(--info-soft); color: var(--info); border-color: var(--info); }
.lead-meta { font-size: 12px; color: var(--mut); margin: 6px 0; }
.lead-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.chip { font-size: 11px; padding: 2px 8px; border-radius: 20px; background: var(--slate-soft); color: var(--mid); border: 1px solid transparent; }
.chip.sig-高 { background: var(--brand); color: var(--on-brand); border-color: var(--brand-solid); }
.chip.sig-中 { background: var(--g1); color: var(--on-brand); border-color: var(--g1); }
.chip.sig-低 { background: var(--slate-soft); color: var(--mut); }
.chip.icp { background: var(--brand-soft); color: var(--brand-solid); }
.chip.icp.icp-hit { background: var(--warm); color: var(--on-brand); border-color: var(--warm); font-weight: 600; }
.lead-foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 12px; color: var(--mut); margin-bottom: 8px; }
.stage-badge { font-size: 11px; padding: 2px 8px; border-radius: var(--r-pill); background: var(--slate-soft); color: var(--mid); }
.stage-badge.st-新线索 { background: var(--slate-soft); }
.stage-badge.st-已联系 { background: var(--brand); color: var(--on-brand); }
.stage-badge.st-有意向 { background: var(--warm); color: var(--on-brand); }
.stage-badge.st-已转客户 { background: var(--ok); color: var(--on-brand); }
.stage-badge.st-已放弃 { background: var(--slate); color: var(--on-brand); }
.owner input { width: 92px; padding: 3px 6px; font-size: 12px; }
.lead-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.lead-actions .lead-stage-sel { width: auto; flex: 0 0 auto; padding: 5px 6px; font-size: 12px; }
.qcc-card { background: var(--card); border: 1px solid var(--card-bd); border-radius: 8px; padding: 12px; margin: 8px 0; box-shadow: none; }
.qcc-name { font-size: 15px; font-weight: 600; color: var(--ink); margin-bottom: 8px; }
.qcc-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px 10px; font-size: 12px; color: var(--mid); margin-bottom: 8px; }
.qcc-grid div span { color: var(--mut); margin-right: 4px; }
.modal { position: fixed; inset: 0; background: var(--scrim); display: flex; align-items: center; justify-content: center; z-index: 60; padding: 16px; }
.modal.hidden { display: none; }
.modal-box { position: relative; background: var(--card-solid); border: 1px solid var(--card-bd); border-radius: 10px; padding: 18px; max-width: 520px; width: 100%; max-height: 82vh; overflow: auto; box-shadow: var(--shadow-modal); }
.modal-close { position: absolute; top: 8px; right: 12px; background: none; border: none; color: var(--mid); font-size: 22px; cursor: pointer; line-height: 1; }
.modal-close:hover { color: var(--ink); }

/* ============ 小迹写操作确认弹层（预览 → 确认 → 真实写入）============
   不用 window.confirm：原生弹窗既展示不了字段表，也无法在手机上保证不溢出。
   规则：一次只允许一个待确认操作；确认按钮点击后立即禁用（防双击重复写入）。 */
.wcf-modal { z-index: 80; }
.wcf-box { max-width: 460px; padding: 18px 18px 14px; }
.wcf-title { margin: 0 0 4px; font-size: 17px; font-weight: 600; color: var(--ink); }
.wcf-sub { font-size: 12.5px; color: var(--mid); margin-bottom: 12px; }
.wcf-fields { width: 100%; border-collapse: collapse; border-top: 1px solid var(--card-bd); }
.wcf-fields th { width: 84px; text-align: left; font-weight: 400; color: var(--mid); font-size: 13px; padding: 7px 8px 7px 0; vertical-align: top; white-space: nowrap; }
.wcf-fields td { padding: 7px 0; font-size: 13.5px; color: var(--ink); word-break: break-word; }
.wcf-fields tr + tr th, .wcf-fields tr + tr td { border-top: 1px solid var(--card-line); }
.wcf-sec { margin-top: 12px; font-size: 13px; color: var(--ink); }
.wcf-sec b { display: block; font-size: 12.5px; font-weight: 600; color: var(--mid); margin-bottom: 3px; }
.wcf-sec ul { margin: 0; padding-left: 18px; }
.wcf-sec li { margin: 2px 0; }
.wcf-risk { margin-top: 10px; padding: 8px 10px; border-radius: 8px; background: var(--warm-soft); font-size: 12.5px; color: var(--ink); }
.wcf-risk b { display: block; color: var(--warm); font-size: 12.5px; margin-bottom: 3px; }
.wcf-risk ul { margin: 0; padding-left: 18px; }
.wcf-danger { margin-top: 10px; padding: 8px 10px; border-radius: 8px; background: var(--hot-wash); font-size: 12.5px; color: var(--ink); }
.wcf-danger b { display: block; color: var(--hot); font-size: 12.5px; margin-bottom: 3px; }
.wcf-check { display: flex; align-items: flex-start; gap: 8px; margin-top: 8px; cursor: pointer; }
.wcf-check input { margin-top: 2px; width: 16px; height: 16px; }
.wcf-btns { display: flex; gap: 10px; margin-top: 14px; }
.wcf-btns button { flex: 1; min-height: var(--tap-min); padding: 10px 12px; border-radius: 8px; font-size: 14px; cursor: pointer; }
.wcf-cancel { background: var(--card-solid); border: 1px solid var(--card-bd); color: var(--ink); }
.wcf-cancel:hover { background: var(--raise); }
.wcf-ok { background: var(--brand); border: none; color: var(--on-brand); font-weight: 500; }
.wcf-ok:hover { background: var(--brand-solid); }
.wcf-ok:disabled { opacity: .5; cursor: not-allowed; }
.wcf-cancel:disabled { opacity: .5; cursor: not-allowed; }
.code-block { background: var(--slate-soft); border: none; border-radius: 10px; padding: 10px; font-size: 12px; color: var(--mid); white-space: pre-wrap; overflow: auto; line-height: 1.5; }

/* ============================================================
   浅色化第一轮 · §二 视觉 token
   全局 token 供逐页替换硬编码色值使用；工作台沿用 --wb-* 命名但值改浅色，
   避免逐条改 100+ 条工作台规则。
   ============================================================ */
:root{
  /* ============================================================
     客户稿对齐 · 视觉基准（任务书 §3.1 · 毛玻璃**降级**版）
     ⛔ 禁止 backdrop-filter（低端安卓会翻车）：
        "毛玻璃感" = 半透明白 + 白描边 + 双层柔阴影 + 有层次的背景渐变。
     规则：所有颜色 / 圆角 / 阴影 / 字号只在这里改，页面里不得出现硬编码色值。
     ============================================================ */

  /* —— 背景：极浅渐变，半透明卡才"透气" ——
     §四.2 收口① 背景渐变加深：客户稿用的是 radial 顶光（radial-gradient(1200px 600px at 50% -10%,#eaf1ff,#eef2f9 60%)），
     比原来的线性 180deg #eef2ff→#f7f9ff 更有层次，半透明卡才有"浮起来"的对比。取客户稿两端色，做"顶光 + 竖向"叠加。 */
  --bg: #f5f6f7;
  --bg-flat: #f5f6f7;              /* 需要纯色底时（theme-color / 降级） */

  /* —— 卡片 —— */
  /* §四.2 收口② 卡片对比加强：客户稿是 .5 的透气卡，但那是"手机小屏 + 深背景"下的观感；
     搬到 PC 大屏会糊成一片、与背景分不开。提到 .72→.82 并把描边加实，换来"卡是卡、底是底"的清晰分层。 */
  --card: rgba(255, 255, 255, .82);
  --card-solid: #ffffff;
  --card-line: rgba(0,0,0,.07);
  --card-bd: rgba(0,0,0,.07);
  --card-line-solid: rgba(0,0,0,.07);
  --field-bg: #ffffff;             /* 输入框 / 下拉框底 */
  --raise: #fafbfc;                /* 卡内嵌块（比卡更浅一档） */

  /* —— 阴影：双层柔阴影 —— */
  --shadow: 0 1px 2px rgba(16,24,40,.04);
  --shadow-sm: 0 1px 2px rgba(16,24,40,.04);
  --shadow-btn: none;
  --shadow-modal: 0 16px 48px rgba(16,24,40,.16);
  --shadow-up: 0 -1px 0 rgba(0,0,0,.06);
  --scrim: rgba(15,23,42,.32);     /* 弹层 / 登录遮罩 */

  /* —— 品牌：偏紫渐变 —— */
  --g1:#007aff; --g2:#007aff;      /* 极简风：单色品牌蓝（旧渐变变量保留同名） */
  --brand: #007aff;
  --brand-solid:#007aff;
  --brand-soft:#eaf3ff;            /* 选中底 */
  --brand-line: rgba(0,0,0,.08);   /* 淡分隔线 */
  --chip-bg:#eaf3ff;               /* 信息药丸底 */
  --chip-ink:#0b57c2;              /* 信息药丸字 */
  --focus:#0b57c2;                 /* 聚焦 / 数据强调 */

  /* —— 文字 —— */
  --title:#1a1a1a;                 /* 区块标题 */
  --ink:#1a1a1a;                   /* 主文字 */
  --mid:#5f6672;                   /* 次文字 */
  --mut:#8c8c8c;                   /* 弱文字 */
  --faint:#b5b5b5;                 /* 最弱（仅非关键信息） */
  --on-brand:#ffffff;              /* 渐变 / 实色底上的文字 */

  /* —— 语义色 —— */
  --ok:#0a7f5a;   --ok-soft:#e8f6f0;             /* 成交 / 正向 */
  --warm:#e08a2b; --warm-soft:#fdf3e7;           /* 意向 / 逾期 */
  --hot:#d6455d;  --hot-soft:#fdeef1; --hot-deep:#b23a4e; --hot-wash:#fdf7f8;  /* 玫红：录音中 / 逾期 / 高风险 */
  --wash-0: rgba(245,246,247,0);    /* 渐变透明端（sticky 底bar 的渐隐起点，与 --bg 同色） */
  --info:#0ea5e9; --info-soft:#e8f4fd;           /* 天蓝：日程 / 中性提示 */
  --slate:#8c8c8c; --slate-soft:#f2f3f5;         /* 战败 / 次要标签 */

  /* —— 状态色补充（收口：页面里散落的硬编码已全部走这里，:root 外不得再出现色值）——
     ink=文字/图标 · wash=底色 · line=普通描边 · edge=强调描边（左侧色条）· strong=加重描边 */
  --ok-deep:#1f7a4d;    --ok-deep-wash:rgba(31,122,77,.1);    --ok-deep-line:rgba(31,122,77,.3);   /* 成功/已完成 */
  --warm-deep:#b7791f;  --warm-deep-wash:rgba(183,121,31,.1); --warm-deep-line:rgba(183,121,31,.3); /* 待办/警告 */
  --soon-ink:#8a6d00;   --soon-wash:rgba(138,109,0,.08);      --soon-line:rgba(138,109,0,.3);      /* 即将到期 */
  --err-ink:#c0392b;    --err-wash:rgba(192,57,43,.08);
                        --err-line:rgba(192,57,43,.3);        --err-line-strong:rgba(192,57,43,.35); /* 失败/错误 */
  --alert-ink:#c47c1c;  --alert-wash:rgba(196,124,28,.1);
                        --alert-line:rgba(196,124,28,.42);    --alert-edge:rgba(196,124,28,.9);     /* 需要处理的提醒 */
  --hot-line:rgba(214,69,93,.28); --hot-line-strong:rgba(214,69,93,.3);                               /* --hot 的描边档 */

  /* —— 圆角 / 触控 —— */
  --r-card:8px; --r-block:8px; --r-pill:999px;
  --tap-min:44px;                  /* §二.4 可点区域最小高度 */

  /* —— 兼容旧名（页面仍在用）：值统一指向新 token，避免在页面里散落硬编码 —— */
  --sh-card:var(--shadow); --sh-sm:var(--shadow-sm); --sh-btn:var(--shadow-btn);
  --wb-bg:var(--bg);
  --wb-surface:var(--card);
  --wb-raise:var(--raise);
  --wb-side:var(--card);
  --wb-line:var(--brand-line);
  --wb-ink:var(--ink);
  --wb-mid:var(--mid);
  --wb-mut:var(--mut);
  --wb-faint:var(--faint);
  --wb-acc:var(--brand-solid);
  --wb-acc-soft:var(--brand-soft);
  --wb-warn:var(--warm);
  --wb-warn-soft:var(--warm-soft);
  --wb-ok:var(--ok);
  --wb-ok-soft:var(--ok-soft);

  /* —— 双端导航第 2 轮 · 电脑端视觉定稿专用 token ——
     规矩不变：页面里不得出现硬编码色值，所以这里的颜色只在这一处定义，
     下面 @media(min-width:641px) 的规则全部用 var() 引用。 */
  --desk-bg:#f5f9fd;               /* 工作区底色（浅蓝灰） */
  --desk-field:#f6f9fd;            /* 顶栏搜索框底 / 菜单悬停底 */
  --desk-wash:#f4f9ff;             /* 二级选中 / 快捷药丸悬停底 */
  --desk-active-bd:rgba(0,122,255,.18);   /* 当前主模块描边 */
  --desk-sub-line:rgba(0,122,255,.24);    /* 二级菜单左侧细线 */
  --desk-ring:rgba(0,122,255,.09);        /* 总台输入框聚焦光环 */
  --desk-flash:rgba(0,122,255,.30);       /* 二级模块定位后的短暂高亮圈 */
}

/* —— 侧栏（仅工作台激活时改写；不影响其他页面） —— */
body.wb-dash { background: var(--wb-bg); }
body.wb-dash .sidebar { flex: 0 0 212px; background: var(--wb-side); border-right: 1px solid var(--wb-line); display: flex; flex-direction: column; }
body.wb-dash .sb-menu { flex: 1 1 auto; }
body.wb-dash .sb-item { color: var(--wb-ink); border-radius: 7px; }
body.wb-dash .sb-item:hover { background: var(--slate-soft); color: var(--wb-ink); }
/* §二.4：当前项 = 浅蓝药丸 + 蓝字，去掉原左侧竖条（inset box-shadow）与反白字 */
body.wb-dash .sb-item.active { background: var(--brand-soft); color: var(--brand-solid); border-color: transparent; box-shadow: none; font-weight: 600; }
body.wb-dash .sb-item.active .sb-ico { color: var(--brand-solid); }

/* 侧栏 logo + 底部用户区：默认隐藏，仅工作台显示 */
/* 品牌与登出入口：删掉全局 header 后改在侧栏，故全局可见（不再限 body.wb-dash） */
.wb-logo { display: flex; align-items: center; gap: 10px; padding: 4px 10px 14px; }
.wb-logo-meta { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
/* §二.3：渐变只给焦点（logo 方块 / 主按钮 / 小迹头像） */
.wb-logo-mark { width: 26px; height: 26px; border-radius: 7px; background: var(--brand-solid); color: var(--on-brand); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; flex: 0 0 auto; box-shadow: none; }
.wb-logo-text { font-size: 15px; font-weight: 700; color: var(--wb-ink); white-space: nowrap; }
.wb-logo-sub { font-size: 11px; color: var(--wb-mut); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wb-user { display: flex; align-items: center; gap: 10px; margin-top: auto; padding: 12px 10px 4px; border-top: 1px solid var(--wb-line); }
.wb-avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-solid); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; flex: 0 0 auto; }
.wb-user-meta { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; flex: 1 1 auto; }
/* 原 .wb-user-name / .wb-user-role 是无人使用的死样式（实际类名是 .ub-name / .ub-role），已清理 */

body.wb-dash main { padding: 22px 24px; max-width: none; }

/* —— 工作台主体布局：三栏（主区 + 右栏 300px） —— */
/* B) 作用域前缀：切走时 body 上的 wb-dash 被移除，display 整体失配，从结构上避免 ID 优先级压过 .hidden */
body.wb-dash #view-dashboard { display: grid; grid-template-columns: 1fr 300px; gap: 18px; align-items: start; }
/* A) 显式配对：优先级 (1,1,0) > (1,0,0)，确保 hidden 时必消失（无论 wb-dash 在不在） */
#view-dashboard.hidden { display: none; }
/* §三.1 顶栏：圆角搜索（白底 + 小阴影，无边框）+ 品牌渐变主按钮 */
.wb-topbar { grid-column: 1 / -1; display: flex; gap: 12px; align-items: center; }
.wb-search { flex: 1 1 auto; height: 36px; background: var(--wb-surface); color: var(--wb-ink); border: 1px solid var(--card-bd); border-radius: 8px; padding: 0 12px; font-size: 13px; font-family: inherit; outline: none; box-shadow: none; }
.wb-search::placeholder { color: var(--wb-mut); }
.wb-search:focus { border-color: var(--brand-solid); box-shadow: 0 0 0 3px var(--brand-soft); }
.wb-rec { flex: 0 0 auto; height: 36px; padding: 0 14px; background: var(--brand-solid); color: var(--on-brand); border: none; border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer; font-family: inherit; box-shadow: none; }
.wb-rec:hover { filter: brightness(1.04); }

.wb-main { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.wb-rail { display: flex; flex-direction: column; gap: 18px; min-width: 0; }

/* 问候区（§三.2：23px / 600） */
.wb-greet-block { padding: 2px 2px 0; }
.wb-greet { font-size: 23px; font-weight: 600; letter-spacing: -0.3px; color: var(--wb-ink); }
.wb-sub { font-size: 12.5px; color: var(--wb-mut); margin-top: 4px; }

/* 语义色成对：标签与数字同色（意向=橙 / 潜在=蓝 / 成交=绿 / 战败=灰） */
.wb-t-brand { color: var(--brand-solid); }
.wb-t-warm { color: var(--warm); }
.wb-t-ok { color: var(--ok); }
.wb-t-slate { color: var(--slate); }

/* —— §四.2 转化漏斗（工作台数据看板区块）——
   横条按"占阶段最大值"的比例画，不是占总数；右侧给真实家数与占比，让漏斗自己说明自己。 */
.wb-funnel-row { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.wb-funnel-row:last-child { margin-bottom: 0; }
.wb-funnel-k { flex: 0 0 72px; font-size: 12.5px; color: var(--mid); }
.wb-funnel-bar { flex: 1 1 auto; min-width: 0; height: 10px; border-radius: var(--r-pill); background: var(--slate-soft); overflow: hidden; }
.wb-funnel-fill { display: block; height: 100%; border-radius: var(--r-pill); min-width: 2px; }
.wb-f-brand { background: var(--brand); }
.wb-f-warm { background: var(--warm); }
.wb-f-ok { background: var(--ok); }
.wb-funnel-n { flex: 0 0 auto; font-size: 12.5px; color: var(--ink); font-variant-numeric: tabular-nums; }
.wb-funnel-n small { color: var(--mut); margin-left: 4px; }

/* —— §四.2 AI 用量 —— */
.wb-usage-sum { font-size: 13.5px; color: var(--ink); margin-bottom: 10px; }
.wb-usage-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--card-line-solid); font-size: 12.5px; }
.wb-usage-row:last-of-type { border-bottom: none; }
.wb-usage-k { flex: 1 1 auto; min-width: 0; color: var(--mid); }
.wb-usage-v { flex: 0 0 auto; color: var(--ink); font-variant-numeric: tabular-nums; }
.wb-usage-c { flex: 0 0 auto; color: var(--mut); font-variant-numeric: tabular-nums; }
.wb-usage-loading { font-size: 12.5px; color: var(--mut); margin: 0; }

/* §三.3 今日能量 */
/* §四.2 收口③ 今日能量卡改紧凑：客户稿给 energy 卡写死 min-height:170px + padding:12px 14px，
   那是因为它旁边没有别的卡；放我们首页第一屏会把"今天要做的事"顶到折叠线以下。
   收成：内距 18px→13px 14px、金句 15.5px→14.5px、行距 1.6→1.55、副句上间距 6→5px，整卡高度约降 1/3 仍可读。
   ⚠️ 必须用作用域前缀：#view-home .wb-energy 优先级 (1,1,0) > .wb-card (1,0,0)，
      否则会被下面第 484 行的 .wb-card{padding:18px} 按"同优先级后写者胜"压回去。 */
#view-home .wb-energy { padding: 13px 14px; }
.wb-head-actions { display: flex; align-items: center; gap: 6px; }
.wb-pill { font-size: 11.5px; color: var(--mut); background: var(--slate-soft); padding: 4px 10px; border-radius: var(--r-pill); white-space: nowrap; }
.wb-pill-btn { border: none; font-family: inherit; cursor: pointer; }
.wb-pill-btn:hover { background: var(--brand-soft); color: var(--brand-solid); }
.wb-energy .wb-sec-head { margin-bottom: 8px; }
.wb-energy-main { font-size: 14.5px; font-weight: 600; color: var(--ink); line-height: 1.55; }
.wb-energy-sub { font-size: 12.5px; color: var(--mut); line-height: 1.6; margin-top: 5px; }

/* §三.4 四个关键数字：27px / 600 / 等宽，下面挂一行变化提示 */
.wb-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.wb-kpi { background: var(--wb-surface); border: 1px solid var(--card-bd); border-radius: var(--r-card); padding: 14px 16px; box-shadow: none; }
.wb-kpi-num { font-size: 27px; font-weight: 600; color: var(--wb-ink); font-variant-numeric: tabular-nums; letter-spacing: -0.6px; line-height: 1.15; }
.wb-kpi-label { font-size: 12.5px; color: var(--wb-mid); margin-top: 2px; }
.wb-kpi-hint { font-size: 11.5px; color: var(--wb-mut); margin-top: 7px; }

/* 区块标题行 + 卡片（§二.1：不留 1px 边框，靠留白 + 柔和阴影分层） */
.wb-sec-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; gap: 10px; }
.wb-sec-title { font-size: 13px; font-weight: 600; color: var(--wb-ink); }
.wb-sec-link { font-size: 12px; color: var(--wb-acc); cursor: pointer; background: none; border: none; font-family: inherit; padding: 0; white-space: nowrap; }
.wb-sec-link:hover { text-decoration: underline; }
.wb-card { background: var(--wb-surface); border: 1px solid var(--card-bd); border-radius: var(--r-card); padding: 16px; box-shadow: none; }

/* §三.5 今天要做的事：语义色圆点 + 标题 + 元信息 +（可选）小迹提醒 + 行内动作 + 类型药丸 */
.wb-todo { display: flex; gap: 10px; align-items: flex-start; background: var(--wb-raise); border: none; border-radius: var(--r-block); padding: 13px 14px; margin-bottom: 8px; }
.wb-todo:last-child { margin-bottom: 0; }
/* dueTs 改造：首页待办行也标出逾期（玫红底 + 左侧色条），与待办页同一语义色 */
.wb-todo.is-overdue { background: var(--hot-wash); box-shadow: inset 3px 0 0 var(--hot); }
.wb-dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; margin-top: 6px; background: var(--slate); }
.wb-dot-brand .wb-dot { background: var(--brand); }
.wb-dot-warm .wb-dot { background: var(--warm); }
.wb-dot-ok .wb-dot { background: var(--ok); }
.wb-dot-slate .wb-dot { background: var(--slate); }
.wb-todo-body { flex: 1 1 auto; min-width: 0; }
.wb-todo-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.wb-todo-title { font-size: 13.5px; font-weight: 600; color: var(--wb-ink); flex: 1 1 auto; min-width: 0; }
.wb-type-pill { font-size: 11px; padding: 3px 9px; border-radius: var(--r-pill); white-space: nowrap; flex: 0 0 auto; }
.wb-pill-brand { background: var(--brand-soft); color: var(--brand-solid); }
.wb-pill-warm { background: var(--warm-soft); color: var(--warm); }
.wb-pill-ok { background: var(--ok-soft); color: var(--ok); }
.wb-pill-slate { background: var(--slate-soft); color: var(--slate); }
.wb-todo-meta { font-size: 12px; color: var(--wb-mut); margin-top: 3px; }
.wb-todo-note { font-size: 12px; color: var(--mid); background: var(--slate-soft); border-radius: 11px; padding: 8px 10px; margin-top: 9px; line-height: 1.65; }
.wb-note-tag { display: inline-block; color: var(--brand-solid); font-weight: 600; margin-right: 6px; }
.wb-todo-actions { display: flex; gap: 12px; margin-top: 11px; flex-wrap: wrap; align-items: center; }
.wb-btn { font-size: 12px; padding: 7px 14px; border-radius: var(--r-pill); cursor: pointer; font-family: inherit; border: 1px solid transparent; }
.wb-btn-primary { background: linear-gradient(135deg, var(--g1), var(--g2)); color: var(--on-brand); box-shadow: var(--sh-btn); }
.wb-btn-primary:hover { filter: brightness(1.04); }
.wb-btn:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }
.wb-link-btn { background: none; border: none; color: var(--mut); font-size: 12px; cursor: pointer; font-family: inherit; padding: 0; }
.wb-link-btn:hover { color: var(--brand-solid); }

/* §三.6 最近跟进记录：标题 + 时间与状态 + 信号药丸；右侧意向分（同色） */
.wb-conv { display: flex; flex-direction: column; gap: 4px; background: var(--wb-raise); border: none; border-radius: var(--r-block); padding: 13px 14px; margin-bottom: 8px; }
.wb-conv:last-child { margin-bottom: 0; }
.wb-conv-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.wb-conv-main { flex: 1 1 auto; min-width: 0; }
.wb-conv-title { font-size: 13.5px; font-weight: 600; color: var(--wb-ink); }
.wb-conv-meta { font-size: 12px; color: var(--wb-mut); margin-top: 2px; }
.wb-conv-score { font-size: 16px; font-weight: 700; white-space: nowrap; flex: 0 0 auto; }
.wb-conv-score small { font-size: 11px; color: var(--wb-mut); font-weight: 400; }
.wb-conv-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.wb-chip { font-size: 11px; padding: 3px 9px; border-radius: var(--r-pill); background: var(--brand-soft); color: var(--brand-solid); }
.wb-chip-ok { background: var(--ok-soft); color: var(--ok); }
.wb-chip-warm { background: var(--warm-soft); color: var(--warm); }

/* §三.7 右栏三卡 */
.wb-rail-card { background: var(--wb-surface); border: 1px solid var(--card-bd); border-radius: var(--r-card); padding: 16px; box-shadow: none; }
.wb-demo-tag { font-size: 11px; color: var(--mut); background: var(--slate-soft); padding: 2px 8px; border-radius: var(--r-pill); margin-left: 6px; font-weight: 400; }
.wb-qa-q { background: var(--brand-soft); color: var(--ink); border-radius: 12px 12px 12px 3px; padding: 10px 12px; font-size: 12.5px; line-height: 1.6; }
.wb-qa-a { background: var(--slate-soft); color: var(--mid); border-radius: 12px 3px 12px 12px; padding: 10px 12px; font-size: 12.5px; line-height: 1.6; margin-top: 8px; }
.wb-qa-src { border-top: none; margin-top: 10px; padding-top: 0; font-size: 11.5px; color: var(--mut); line-height: 1.6; }
.wb-continue { margin-top: 10px; background: none; border: none; color: var(--brand-solid); font-size: 12.5px; cursor: pointer; font-family: inherit; padding: 0; }
.wb-continue:hover { text-decoration: underline; }

.wb-lead-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--brand-line); }
.wb-lead-row:last-of-type { border-bottom: none; }
.wb-lead-main { flex: 1 1 auto; min-width: 0; }
.wb-lead-name { font-size: 13.5px; color: var(--wb-ink); font-weight: 600; word-break: break-all; }
.wb-lead-sub { font-size: 11.5px; color: var(--wb-mut); margin-top: 2px; }
.wb-lead-score { font-size: 16px; font-weight: 700; white-space: nowrap; flex: 0 0 auto; }
.wb-lead-score small { font-size: 11px; color: var(--wb-mut); font-weight: 400; }
.wb-rail-note { font-size: 11.5px; color: var(--wb-mut); margin-top: 10px; line-height: 1.6; }

.wb-rhythm-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 7px 0; }
.wb-rhythm-k { font-size: 12.5px; color: var(--wb-mut); }
.wb-rhythm-v { font-size: 13px; font-weight: 600; color: var(--wb-ink); white-space: nowrap; }

.wb-empty { font-size: 12.5px; color: var(--wb-mut); padding: 14px 0; text-align: center; line-height: 1.7; }

/* —— 响应式 —— */
/* 1024–1280：右栏下沉到主体下方，变一行两个卡横排 */
@media (max-width: 1280px) {
  /* ⚠️ 必须带 body.wb-dash 前缀，与基础规则同为 (1,1,0) 且位置更靠后才压得住；
     只写 #view-dashboard 是 (1,0,0)，会被 300px 第二列一直保留（窄屏文字竖排的根因）。 */
  #view-dashboard,
  body.wb-dash #view-dashboard { grid-template-columns: minmax(0, 1fr); }
  .wb-rail { flex-direction: row; }
  .wb-rail-card { flex: 1 1 0; }
}
/* 641–1024：KPI 两列；主区 padding 收到 18px */
@media (max-width: 1024px) {
  body.wb-dash main { padding: 18px; }
  .wb-kpis { grid-template-columns: repeat(2, 1fr); }
}
/* ≤640：沿用既有侧栏图标栏；KPI 两列；列表按钮换行堆叠 */
@media (max-width: 640px) {
  body.wb-dash .sidebar { flex: 0 0 60px; padding: 14px 6px; }
  body.wb-dash .sb-item { justify-content: center; padding: 11px 0; gap: 0; }
  body.wb-dash .sb-text { display: none; }
  /* 同上：窄屏隐去品牌块，但保留登出入口（只留按钮，隐去头像与名字） */
  body.wb-dash .wb-logo { display: none; }
  body.wb-dash .wb-user { padding: 8px 0 0; justify-content: center; }
  body.wb-dash .wb-user .wb-avatar, body.wb-dash .wb-user .ub-name { display: none; }
  .wb-rail { flex-direction: column; }
  .wb-todo-actions { flex-direction: column; align-items: stretch; }
  .wb-btn { width: 100%; text-align: center; }
}

/* ===== 移动端底部 tab（任务书 §五 · 第二段） =====
   ① ≤640px 隐藏侧栏（含折叠态 / 工作台作用域，特异性一并盖掉）
   ② 底部固定 tab 栏：首页 · 工作台 · AI（凸起圆钮） · 客户 · 我的
   ③ 当前项高亮 = 浅蓝底 + 品牌蓝图标（与侧栏同一套语义）
   ④ 主区底部留内边距，最后一块内容不被 tab 栏压住
   ⑤ 桌面端（>640px）不显示（.mtab 默认 display:none）
   层级 55：高于内容(51)，低于弹层(60) 与登录遮罩(100) */
.mtab { display: none; }

@media (max-width: 640px) {
  .sidebar,
  body.wb-dash .sidebar,
  body.wb-sb-fold .sidebar,
  body.wb-dash.wb-sb-fold .sidebar { display: none; }

  /* 双端导航第 1 轮 §七：≤640px 上一律不出现电脑端折叠菜单/箭头（手机端只有底部五项 tab） */
  .sb-sub, .sb-sub-item, .sb-arrow { display: none !important; }

  .mtab {
    display: flex; align-items: center; justify-content: space-between;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 55;
    height: 60px; padding: 0 6px; padding-bottom: env(safe-area-inset-bottom, 0px);
    background: var(--card-solid); border-top: 1px solid var(--brand-line);
    box-shadow: none;
  }
  .mtab-item {
    flex: 1 1 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    background: none; border: none; cursor: pointer; font-family: inherit;
    font-size: 11px; color: var(--mut); padding: 2px 0;
  }
  .mtab-item .mt-ico {
    display: flex; align-items: center; justify-content: center;
    width: 46px; height: 26px; border-radius: var(--r-pill); font-size: 18px; line-height: 1;
  }
  .mtab-item.active { color: var(--brand-solid); font-weight: 600; }
  .mtab-item.active .mt-ico { background: var(--brand-soft); color: var(--brand-solid); }

  /* 中间那颗：品牌渐变圆形按钮，比左右两项略大、略微上凸 */
  .mtab-ai {
    flex: 0 0 auto; width: 54px; height: 54px; border: none; border-radius: 50%; cursor: pointer;
    background: linear-gradient(135deg, var(--g1), var(--g2)); color: var(--on-brand);
    box-shadow: none; margin-bottom: 14px;
    display: flex; align-items: center; justify-content: center; font-size: 23px;
  }
  .mtab-ai .mt-ico { width: auto; height: auto; font-size: 23px; }
  .mtab-ai.active { box-shadow: 0 0 0 3px var(--brand-soft); }

  /* 底部内容不被 tab 栏遮挡 */
  main, body.wb-dash main { padding-bottom: 82px; }
}

/* 工作台窄屏修补（第二段暴露）：≤640 时三栏栅格必须彻底变一列。
   原来 1280 断点写的是 `#view-dashboard{grid-template-columns:1fr}`（特异性 1,0,0），
   而基础规则 `body.wb-dash #view-dashboard`（1,1,0）更高，所以栅格其实没被改成单列，
   主区被挤成一列窄条（文字竖排）。这里用 #view-dashboard 直接压掉 300px 第二列。
   同时给栅格子项补 min-width:0，避免长文本把列撑出横向溢出。 */
@media (max-width: 640px) {
  #view-dashboard,
  body.wb-dash #view-dashboard { grid-template-columns: minmax(0, 1fr); }
  .wb-topbar { flex-direction: column; align-items: stretch; gap: 8px; }
  .wb-search { width: 100%; }
  .wb-rec { width: 100%; }
  .wb-greet { font-size: 19px; }
  .wb-kpis { grid-template-columns: minmax(0, 1fr); }
  .wb-card, .wb-rail-card, .wb-kpi { padding: 14px; }
}

/* ============================================================
   客户稿对齐 · 第一段 · §3.2 形态对齐
   首页（=今天）/ 客户列表 / 客户详情 / 个人中心
   规矩：颜色 / 圆角 / 阴影 / 字号一律取自 :root，这里不出现任何硬编码色值。
   ============================================================ */

/* —— 首页栅格：主区 + 右栏 300px（与工作台同一套断点节奏）—— */
body.wb-home #view-home { display: grid; grid-template-columns: 1fr 300px; gap: 18px; align-items: start; }
.hm-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.hm-rail { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

/* 问候语 */
.hm-hello { padding: 2px 2px 0; }
.hm-hello-t { font-size: 23px; font-weight: 600; letter-spacing: -0.3px; color: var(--ink); }
.hm-hello-s { font-size: 12.5px; color: var(--mut); margin-top: 4px; }

/* 快捷功能 6 格 */
.hm-quick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.hm-q {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  min-height: var(--tap-min); padding: 12px 6px; cursor: pointer; font-family: inherit;
  font-size: 12.5px; color: var(--ink); text-align: center;
  background: var(--bg); border: 1px solid var(--brand-line); border-radius: var(--r-block);
}
.hm-q:active { background: var(--brand-soft); border-color: var(--brand-solid); }
.hm-q-ico { font-size: 20px; line-height: 1; display: inline-flex; align-items: center; justify-content: center; color: var(--brand-solid); }

/* 我的客户：首页第一屏最显眼的区块 */
.hm-clients .wb-sec-title { font-size: 15px; }
.hm-crow {
  display: flex; align-items: center; gap: 12px; padding: 12px; margin-bottom: 8px;
  background: var(--card-solid); border: 1px solid var(--card-line-solid);
  border-radius: var(--r-block); cursor: pointer;
}
.hm-crow:last-child { margin-bottom: 0; }
.hm-cav {
  width: 40px; height: 40px; border-radius: 50%; flex: 0 0 auto;
  background: linear-gradient(135deg, var(--g1), var(--g2)); color: var(--on-brand);
  display: flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 600;
}
.hm-cmain { flex: 1 1 auto; min-width: 0; }
.hm-cname { font-size: 14.5px; font-weight: 600; color: var(--ink); }
.hm-csub { font-size: 12px; color: var(--mut); margin-top: 2px; }
.hm-cscore { font-size: 17px; font-weight: 700; flex: 0 0 auto; white-space: nowrap; }
.hm-cscore small { font-size: 11px; color: var(--mut); font-weight: 400; }

/* —— 客户列表：分段筛选（全部 / 意向 / 潜在 / 成交 / ＋新建）—— */
.seg { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.seg-item {
  min-height: 34px; padding: 7px 14px; cursor: pointer; font-family: inherit; font-size: 13px;
  color: var(--mid); background: var(--field-bg); border: 1px solid var(--brand-line); border-radius: var(--r-pill);
}
.seg-item.active { background: var(--brand); color: var(--on-brand); border-color: var(--brand-solid); }
.seg-item.seg-new { background: var(--brand-soft); color: var(--brand-solid); font-weight: 600; }

/* —— 客户详情：头部 + 三动作 + 小迹洞察 + 跟进时间线 + 基本信息 —— */
.cd-head { display: flex; align-items: center; gap: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--card-line-solid); }
.cd-av {
  width: 52px; height: 52px; border-radius: 50%; flex: 0 0 auto;
  background: linear-gradient(135deg, var(--g1), var(--g2)); color: var(--on-brand);
  display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 600;
}
.cd-hmain { flex: 1 1 auto; min-width: 0; }
.cd-name { font-size: 17px; font-weight: 600; color: var(--ink); }
.cd-sub { font-size: 12.5px; color: var(--mut); margin-top: 3px; }
.cd-score { font-size: 22px; font-weight: 700; flex: 0 0 auto; white-space: nowrap; }
.cd-score small { font-size: 11px; color: var(--mut); font-weight: 400; }

.cd-acts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 14px 0; }
.cd-act {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  min-height: var(--tap-min); padding: 10px 4px; cursor: pointer; font-family: inherit;
  font-size: 12.5px; color: var(--brand-solid);
  background: var(--brand-soft); border: 1px solid var(--brand-line); border-radius: var(--r-block);
}
.cd-act:disabled { opacity: .5; cursor: not-allowed; }
.cd-act-ico { font-size: 18px; line-height: 1; }

.cd-sec { margin-top: 18px; }
.cd-sec-t { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--title); margin-bottom: 10px; }
.cd-insight { background: var(--brand-soft); border-radius: var(--r-block); padding: 12px 14px; font-size: 13px; color: var(--mid); line-height: 1.7; }
.cd-insight b { color: var(--ink); font-weight: 600; }
.cd-tl { position: relative; padding-left: 18px; }
.cd-tl::before { content: ''; position: absolute; left: 5px; top: 6px; bottom: 6px; width: 2px; background: var(--brand-line); }
.cd-tl-item { position: relative; padding-bottom: 14px; }
.cd-tl-item:last-child { padding-bottom: 0; }
.cd-tl-item::before {
  content: ''; position: absolute; left: -17px; top: 5px; width: 10px; height: 10px; border-radius: 50%;
  background: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft);
}
.cd-conv-list { margin-top: 10px; }
.cd-tl-time { font-size: 11.5px; color: var(--mut); }
.cd-tl-title { font-size: 13px; font-weight: 600; color: var(--ink); margin-top: 2px; }
.cd-tl-text { font-size: 12.5px; color: var(--mid); margin-top: 3px; line-height: 1.65; }

/* —— 个人中心：头像 / 职位区 + 菜单列表 —— */
.pf-hero { display: flex; align-items: center; gap: 14px; }
.pf-av {
  width: 54px; height: 54px; border-radius: 50%; flex: 0 0 auto;
  background: linear-gradient(135deg, var(--g1), var(--g2)); color: var(--on-brand);
  display: flex; align-items: center; justify-content: center; font-size: 21px; font-weight: 600;
}
.pf-hmain { flex: 1 1 auto; min-width: 0; }
.pf-name { font-size: 17px; font-weight: 600; color: var(--ink); }
.pf-role { font-size: 12.5px; color: var(--mut); margin-top: 3px; }
.pf-menu {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 13px 2px; font-family: inherit; font-size: 14px; color: var(--ink); cursor: pointer;
  background: none; border: none; border-bottom: 1px solid var(--card-line-solid);
}
.pf-menu:last-child { border-bottom: none; }
.pf-menu-ico { flex: 0 0 auto; width: 24px; height: 24px; display: inline-flex; align-items: center;
  justify-content: center; color: var(--brand-solid); line-height: 1; }
.pf-menu-txt { flex: 1 1 auto; min-width: 0; }
.pf-menu-sub { display: block; font-size: 11.5px; color: var(--mut); margin-top: 2px; line-height: 1.5; }
.pf-menu-go { flex: 0 0 auto; font-size: 15px; color: var(--faint); }

/* —— 响应式 —— */
@media (max-width: 1280px) {
  body.wb-home #view-home { grid-template-columns: minmax(0, 1fr); }
  .hm-rail { flex-direction: row; }
  .hm-rail > * { flex: 1 1 0; }
}
@media (max-width: 640px) {
  body.wb-home #view-home { grid-template-columns: minmax(0, 1fr); }
  .hm-rail { flex-direction: column; }
  .hm-rail > * { flex: 0 0 auto; }
  .hm-hello-t { font-size: 19px; }
  .cd-acts { gap: 8px; }
  .cd-act { font-size: 12px; }
}

/* ============================================================
   第二段 §四.1 · 待办独立页（形态照客户稿 v-todo：顶部条数统计 + 列表 + 底部固定「录一段」）
   列表类页面 → 一律不透明卡（--card-solid），防掉帧（任务书 §3.1）。
   ============================================================ */
.td-top { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.td-top-n { font-size: 26px; font-weight: 700; color: var(--ink); line-height: 1.1; }
.td-top-n small { font-size: 13px; font-weight: 500; color: var(--mut); margin-left: 3px; }
.td-top-s { font-size: 12.5px; color: var(--mut); }
.td-top-s b { font-weight: 600; }
.td-overdue b { color: var(--hot); }
.td-today b { color: var(--info); }
.td-snooze b { color: var(--warm); }
.td-later b { color: var(--brand-solid); }
.td-nodue b { color: var(--slate); }
.td-done b { color: var(--ok); }

/* 逾期 / 今天 / 已完成：三种到期状态各自成色，逾期用玫红（--hot），不用橙（橙已被"意向"占用） */
.td-row { display: flex; gap: 11px; align-items: flex-start; background: var(--card-solid);
  border: 1px solid var(--card-line-solid); border-radius: var(--r-block); padding: 13px 14px; margin-bottom: 9px; }
.td-row:last-child { margin-bottom: 0; }
.td-row.is-overdue { border-color: var(--hot-soft); background: var(--hot-wash); }
.td-row.is-done { opacity: .62; }
.td-check { flex: 0 0 auto; width: 22px; height: 22px; margin-top: 1px; border-radius: 50%;
  border: 1.5px solid var(--brand-line); background: var(--field-bg); cursor: pointer;
  display: flex; align-items: center; justify-content: center; padding: 0; }
.td-check:hover { border-color: var(--brand-solid); }
.td-check.on { background: var(--brand); border-color: var(--brand-solid); }
.td-check.on::after { content: ''; width: 10px; height: 6px; border: 2px solid var(--on-brand);
  border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); }
.td-body { flex: 1 1 auto; min-width: 0; }
.td-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.td-title { font-size: 13.5px; font-weight: 600; color: var(--ink); flex: 1 1 auto; min-width: 0; word-break: break-word; }
.td-row.is-done .td-title { text-decoration: line-through; }
.td-pill { font-size: 11px; padding: 3px 9px; border-radius: var(--r-pill); white-space: nowrap; flex: 0 0 auto; font-weight: 600; }
.td-pill-overdue { background: var(--hot-soft); color: var(--hot-deep); }
.td-pill-today { background: var(--info-soft); color: var(--info); }
.td-pill-soon { background: var(--warm-soft); color: var(--warm); }
.td-pill-open { background: var(--slate-soft); color: var(--slate); }
.td-pill-done { background: var(--ok-soft); color: var(--ok); }
/* dueTs 改造后新增两组：未到期（未来）/ 未设到期（无 dueTs，灰，不与"今天"混色） */
.td-pill-soon { background: var(--brand-soft); color: var(--brand-solid); }
.td-pill-nodue { background: var(--slate-soft); color: var(--slate); }
.td-pill-snoozed { background: var(--warm-soft); color: var(--warm); }
.td-meta { font-size: 12px; color: var(--mut); margin-top: 4px; }
.td-meta .td-due { font-weight: 600; }
.td-meta .td-due.overdue { color: var(--hot); }
.td-acts { display: flex; gap: 10px; margin-top: 10px; flex-wrap: wrap; align-items: center; }
/* 动作标签：一行里有两个日期选择器（到期 / 推后到），不加文字标签分不清谁是谁 */
.td-act-lb { font-size: 11.5px; color: var(--mut); flex: 0 0 auto; }

/* 新建待办：文本 + 可选到期日 + 添加按钮（到期日不填 = 未设到期，不猜） */
.td-new { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.td-new-txt { flex: 1 1 200px; min-width: 0; min-height: var(--tap-min); font-size: 13.5px; font-family: inherit;
  color: var(--ink); background: var(--field-bg); border: 1px solid var(--brand-line);
  border-radius: var(--r-block); padding: 8px 12px; }
.td-new-btn { flex: 0 0 auto; min-height: var(--tap-min); padding: 0 18px; border: none; border-radius: var(--r-block);
  background: var(--brand); color: var(--on-brand); font-size: 13.5px; font-weight: 600;
  font-family: inherit; cursor: pointer; box-shadow: var(--shadow-btn); }
.td-new-btn:hover { filter: brightness(1.04); }
.td-new-note { font-size: 11.5px; color: var(--mut); margin-top: 8px; line-height: 1.6; }
.td-date { font-size: 12px; font-family: inherit; color: var(--ink); background: var(--field-bg);
  border: 1px solid var(--brand-line); border-radius: var(--r-pill); padding: 5px 10px; min-height: 30px; }

/* 底部固定「录一段」：sticky 而非 fixed，避免和底部 tab / 侧栏打架 */
.td-foot { position: sticky; bottom: 0; margin-top: 14px; padding: 12px 0 4px;
  background: linear-gradient(180deg, var(--wash-0) 0%, var(--bg-flat) 42%); }
.td-rec { width: 100%; min-height: var(--tap-min); border: none; border-radius: var(--r-block);
  background: var(--brand); color: var(--on-brand); font-size: 14px; font-weight: 600;
  font-family: inherit; cursor: pointer; box-shadow: var(--shadow-btn); }
.td-rec:hover { filter: brightness(1.04); }
@media (max-width: 640px) { .td-top-n { font-size: 22px; } }

/* ============================================================
   第二段 §四.5 · 发现页骨架（形态照客户稿 .entry：圆角方块图标 + 标题 + 描述 + 箭头）
   只做"入口"，不复制任何已有页面的界面。
   ============================================================ */
.dc-head { padding: 4px 2px 14px; }
.dc-title { font-size: 22px; font-weight: 700; color: var(--ink); letter-spacing: -0.3px; }
.dc-sub { font-size: 12.5px; color: var(--mut); margin-top: 4px; line-height: 1.6; }

.dc-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.dc-card {
  display: flex; align-items: center; gap: 12px; text-align: left;
  background: var(--card-solid); border: 1px solid var(--card-line-solid);
  border-radius: var(--r-block); padding: 14px; cursor: pointer;
  font-family: inherit; box-shadow: var(--shadow-sm);
  min-height: var(--tap-min); transition: transform .16s, box-shadow .16s;
}
.dc-card:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.dc-card:active { background: var(--brand-soft); }
/* 图标：客户稿 .entry .ic 是品牌渐变方块 + 白色 emoji（46×46 / radius 14 是详情页头部那档，这里取列表档 42×42） */
.dc-ic { flex: 0 0 auto; width: 42px; height: 42px; border-radius: 12px; background: var(--brand-solid); color: var(--on-brand);
  color: var(--on-brand); font-size: 20px; display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-btn); }
.dc-meta { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.dc-nm { font-size: 14px; font-weight: 700; color: var(--ink); }
.dc-ds { font-size: 11.5px; color: var(--mut); line-height: 1.5; }
.dc-chev { flex: 0 0 auto; font-size: 18px; color: var(--faint); }
/* 「接入中」这类状态标签：不用箭头，避免暗示"点进去有内容" */
.dc-tag { flex: 0 0 auto; font-size: 11px; font-weight: 600; color: var(--slate);
  background: var(--slate-soft); padding: 3px 9px; border-radius: var(--r-pill); }

.dc-note { font-size: 11.5px; color: var(--mut); line-height: 1.65; margin-top: 14px;
  padding: 10px 12px; background: var(--raise); border-radius: var(--r-block); }

/* 全球动态空态：点卡片才展开，平时不占位 */
#dcFeedBox:empty { display: none; }
.dc-feed-empty { margin-top: 12px; padding: 16px; background: var(--card-solid);
  border: 1px solid var(--card-line-solid); border-radius: var(--r-block); box-shadow: var(--shadow-sm); }
.dc-feed-t { font-size: 14px; font-weight: 700; color: var(--ink); }
.dc-feed-s { font-size: 12.5px; color: var(--mid); line-height: 1.7; margin-top: 6px; }
.dc-feed-rule { font-size: 11.5px; color: var(--mut); line-height: 1.7; margin-top: 8px;
  padding-top: 8px; border-top: 1px dashed var(--brand-line); }
.dc-feed-rule b { color: var(--mid); }
/* 间距修饰类：避免在 JS 里写 style="margin-top:…"（样式一律集中在 CSS） */
.dc-mt { margin-top: 10px; }
.dc-mt-sm { margin-top: 8px; }

@media (max-width: 640px) { .dc-grid { grid-template-columns: minmax(0, 1fr); } }

/* ===== 客户字段扩展（2026-10-20）：两列表单 + 下次跟进/标签小件 =====
   只新增类，不改既有组件；390px 下自动回落单列。 */
.cform-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; margin-top: 4px; }
.cform-grid > div { min-width: 0; }
.cform-grid .full { grid-column: 1 / -1; }
.cform-grid label { margin-top: 10px; }
/* 基础样式只覆盖了 text/password；tel / number / date 必须补齐，否则会缩成默认小框 */
#clientForm input[type=tel], #clientForm input[type=number], #clientForm input[type=date] {
  width: 100%; border: 1px solid var(--brand-line); border-radius: 10px; padding: 10px;
  font-size: 14px; font-family: inherit; background: var(--field-bg); color: var(--ink); }
#clientForm input[type=tel]:focus, #clientForm input[type=number]:focus, #clientForm input[type=date]:focus {
  outline: none; border-color: var(--brand-solid); }
.cform-hint { margin: 10px 0; }
.cf-next { font-size: 11px; font-weight: 600; color: var(--info); background: var(--info-soft);
  padding: 2px 8px; border-radius: var(--r-pill); white-space: nowrap; }
.cf-next.over { color: var(--hot); background: var(--hot-wash); }
.cf-tag { display: inline-block; font-size: 11px; color: var(--mid); background: var(--slate-soft);
  padding: 2px 7px; border-radius: var(--r-pill); margin: 1px 2px 1px 0; }
@media (max-width: 640px) { .cform-grid { grid-template-columns: 1fr; } }

/* ===== 客户列表表格化（2026-10-21）：桌面 10 列表格 + 勾选批量条；手机回落卡片 ===== */
.ctools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 12px 0; }
.ctools .csearch { width: 260px; margin: 0; height: 36px; font-size: 13px; padding: 8px 12px; }
.ctools .seg { margin: 0; }
.ctools .cowner { width: auto; min-width: 132px; height: 36px; padding: 6px 10px;
  border: 1px solid var(--brand-line); border-radius: 10px; background: var(--field-bg);
  color: var(--ink); font-family: inherit; font-size: 13px; }
.ctable-wrap { margin-top: 10px; border: 1px solid var(--brand-line); border-radius: 12px;
  overflow: auto; background: var(--card-solid); }
/* 客户表：不再用 min-width 硬撑，改为「表头单行 + 数据格可换行」的自适应布局。
   1100px 视口下可用宽约 826px（侧栏 210 + 内边距），10 列必须全部落在容器内，
   不靠 overflow 裁切；换行只发生在客户名/公司/来源这类文本列，操作列始终可点。 */
.ctable { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.ctable th { position: sticky; top: 0; z-index: 1; background: var(--raise); color: var(--mut);
  font-weight: 500; font-size: 11.5px; text-align: left; padding: 9px 10px;
  border-bottom: 1px solid var(--brand-line); white-space: nowrap; }
.ctable td { padding: 8px 10px; border-bottom: 1px solid var(--brand-line); vertical-align: middle;
  white-space: normal; overflow-wrap: break-word; }
.ctable tbody tr:last-child td { border-bottom: 0; }
.ctable tbody tr { cursor: pointer; }
.ctable tbody tr:hover, .ctable tbody tr.sel { background: var(--brand-soft); }
.ctable .ccol-check { width: 34px; }
.ctable .ccol-op { width: 152px; }
/* 窄桌面（≤1240px）：收紧内边距与操作列，保证 10 列仍完整可见 */
@media (max-width: 1240px) {
  .ctable th, .ctable td { padding: 8px 6px; }
  .ctable .ccol-op { width: 138px; }
  .crow-acts button { padding: 2px 4px; }
}
.ctable input[type=checkbox] { width: 15px; height: 15px; accent-color: var(--brand-solid); cursor: pointer; }
.ccell-client { display: flex; align-items: center; gap: 8px; min-width: 0; }
.ccell-av { width: 26px; height: 26px; border-radius: 8px; background: var(--slate-soft); color: var(--mid);
  display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; flex: none; }
.ccell-name { font-weight: 600; color: var(--ink); }
.ccell-sub { font-size: 11px; color: var(--mut); margin-top: 1px; }
.cbar { display: inline-flex; align-items: center; gap: 6px; }
.cbar i { display: block; width: 44px; height: 4px; border-radius: 2px; background: var(--slate-soft);
  position: relative; font-style: normal; }
.cbar i b { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 2px; background: var(--brand-solid); }
.cbar span { font-size: 12px; font-weight: 600; }
.crow-acts { display: flex; gap: 2px; }
.crow-acts button { border: 0; background: transparent; color: var(--brand-solid); font-size: 12px;
  cursor: pointer; padding: 4px 6px; border-radius: 6px; }
.crow-acts button:hover { background: var(--brand-soft); }
.crow-acts .cdel { color: var(--hot); }
.cbulk { display: none; align-items: center; gap: 12px; flex-wrap: wrap; margin: 10px 0;
  padding: 10px 12px; background: var(--brand-soft); border: 1px solid var(--brand-line); border-radius: 10px; }
.cbulk.on { display: flex; }
.cbulk-n { font-size: 13px; font-weight: 600; color: var(--brand-solid); }
.cbulk-ops { display: flex; gap: 8px; flex-wrap: wrap; }
.linkbtn { border: 0; background: none; color: var(--brand-solid); font-size: 12px; cursor: pointer; margin-left: auto; }
.cbulk-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 8px 0;
  padding: 10px 12px; background: var(--raise); border: 1px solid var(--brand-line); border-radius: 10px; }
.cbulk-form.hidden { display: none; }
.cbulk-form select { width: auto; min-width: 96px; }
.cbulk-form input { flex: 1; min-width: 220px; margin: 0; }
.cpager { display: flex; justify-content: space-between; gap: 10px; margin-top: 10px;
  font-size: 12px; color: var(--mut); flex-wrap: wrap; }
.cmobile { display: none; }
@media (max-width: 640px) {
  .ctable-wrap { display: none; }
  .cmobile { display: flex; flex-direction: column; }
  .ctools .csearch { width: 100%; }
}

/* ===== 批量导入（2026-10-21）：四步流程 ===== */
.imp-crumb { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--mut); margin-bottom: 14px; }
.imp-back { border: 0; background: none; color: var(--brand-solid); cursor: pointer; font: inherit; padding: 0; }
.imp-slash { color: var(--mut); }
.imp-steps { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 0; margin: 2px 0 18px; }
.imp-step { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--mut); }
.imp-step i { width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--brand-line);
  display: flex; align-items: center; justify-content: center; font-style: normal; font-size: 11px;
  background: var(--card-solid); }
.imp-step.on { color: var(--brand-solid); font-weight: 600; }
.imp-step.on i { background: var(--brand-solid); border-color: var(--brand-solid); color: var(--on-brand); }
.imp-step.done { color: var(--ink); }
.imp-step.done i { background: var(--slate-soft); }
.imp-line { width: 32px; height: 1px; background: var(--brand-line); margin: 0 10px; }
.imp-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; }
.imp-drop { border: 1px dashed var(--brand-line); border-radius: 14px; padding: 34px 20px;
  text-align: center; cursor: pointer; background: var(--raise); transition: border-color .15s, background .15s; }
.imp-drop:hover, .imp-drop.over { border-color: var(--brand-solid); background: var(--brand-soft); }
.imp-drop-t { font-size: 15px; font-weight: 600; color: var(--ink); }
.imp-drop-d { font-size: 12px; color: var(--mut); margin-top: 8px; line-height: 1.7; }
.imp-note { font-size: 12px; color: var(--mut); margin: 12px 0; line-height: 1.7; }
.imp-sub { font-size: 13px; margin: 2px 0 10px; }
.imp-history { display: flex; flex-direction: column; gap: 8px; }
.imp-his { border: 1px solid var(--brand-line); border-radius: 10px; padding: 10px 12px; background: var(--card-solid); }
.imp-his .t { font-size: 12.5px; font-weight: 600; }
.imp-his .d { font-size: 11.5px; color: var(--mut); margin-top: 3px; line-height: 1.6; }
.imp-table-wrap { overflow: auto; max-height: 460px; border: 1px solid var(--brand-line); border-radius: 12px; background: var(--card-solid); }
.imp-table { width: 100%; border-collapse: collapse; font-size: 12.5px; min-width: 780px; }
.imp-table th { background: var(--raise); color: var(--mut); font-weight: 500; font-size: 11.5px;
  text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--brand-line); white-space: nowrap; }
.imp-table td { padding: 8px 10px; border-bottom: 1px solid var(--brand-line); vertical-align: middle; white-space: nowrap; }
.imp-table tr:last-child td { border-bottom: 0; }
.imp-table .wrap { white-space: normal; min-width: 160px; }
.imp-table input[type=checkbox] { width: 15px; height: 15px; accent-color: var(--brand-solid); cursor: pointer; }
.imp-badge { display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: var(--r-pill);
  background: var(--slate-soft); color: var(--mid); }
.imp-badge.ok { color: var(--ok); background: var(--raise); border: 1px solid var(--ok); }
.imp-badge.dup { color: var(--warm); background: var(--raise); border: 1px solid var(--warm); }
.imp-badge.bad { color: var(--hot); background: var(--raise); border: 1px solid var(--hot); }
.imp-badge.rule { color: var(--brand-solid); background: var(--brand-soft); }
.imp-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.imp-result { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.imp-stat { border: 1px solid var(--brand-line); border-radius: 12px; padding: 14px 16px; background: var(--card-solid); }
.imp-stat .n { font-size: 24px; font-weight: 700; color: var(--ink); }
.imp-stat .n small { font-size: 12px; color: var(--mut); font-weight: 500; margin-left: 4px; }
.imp-stat .l { font-size: 12px; color: var(--mut); margin-top: 4px; }
@media (max-width: 640px) {
  .imp-grid { grid-template-columns: 1fr; }
  .imp-line { width: 16px; margin: 0 6px; }
  .imp-result { grid-template-columns: 1fr; }
}

/* ============================================================
   分析内核接界面（C-1）：结构化报告 renderAnalysis
   规矩：颜色 / 圆角 / 阴影 / 字号一律取自 :root，不出现硬编码色值。
   ============================================================ */
.ana-summary { background: var(--brand-soft); border: 1px solid var(--brand-line); border-radius: var(--r-block); padding: 10px 12px; font-size: 13px; color: var(--mid); line-height: 1.65; margin-bottom: 12px; }
.ana-engine { font-size: 12px; color: var(--mut); margin-bottom: 10px; }
.ana-empty { background: var(--raise); border: 1px dashed var(--brand-line); border-radius: var(--r-block); padding: 18px; text-align: center; }
.ana-empty-title { font-size: 15px; font-weight: 600; color: var(--ink); margin-bottom: 6px; }
.ana-empty p { font-size: 12.5px; color: var(--mut); line-height: 1.7; margin: 0; }
.ana-block { margin-top: 14px; }
.ana-block-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.ana-block-head h3 { font-size: 15px; margin: 0; color: var(--brand-solid); }
.ana-count { font-size: 12px; color: var(--mut); background: var(--slate-soft); border-radius: var(--r-pill); padding: 1px 9px; }
.ana-none { font-size: 12.5px; color: var(--mut); margin: 0; }
.ana-list { display: flex; flex-direction: column; gap: 10px; }
.ana-card { background: var(--card-solid); border: 1px solid var(--card-bd); border-radius: var(--r-block); padding: 11px 12px; box-shadow: var(--shadow-sm); }
.ana-card-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.ana-badge { font-size: 11.5px; font-weight: 600; padding: 2px 9px; border-radius: var(--r-pill); background: var(--brand-soft); color: var(--brand-solid); }
.ana-badge.ana-type-异议 { background: var(--warm-soft); color: var(--warm); }
.ana-badge.ana-type-承诺 { background: var(--ok-soft); color: var(--ok); }
.ana-badge.ana-type-竞品 { background: var(--brand-soft); color: var(--brand-solid); }
.ana-badge.ana-type-采购信号 { background: var(--brand-soft); color: var(--brand-solid); }
.ana-badge.ana-type-需求 { background: var(--slate-soft); color: var(--mid); }
.ana-badge.ana-type-风险 { background: var(--warm-soft); color: var(--warm); }
.ana-badge.ana-type-未答 { background: var(--slate-soft); color: var(--slate); }
.ana-badge.ana-stage-tag { background: var(--brand); color: var(--on-brand); }
.ana-conf { font-size: 11px; padding: 2px 8px; border-radius: var(--r-pill); }
.ana-conf-ok { background: var(--ok-soft); color: var(--ok); }
.ana-conf-inf { background: var(--warm-soft); color: var(--warm); }
.ana-spk { font-size: 11px; color: var(--mut); background: var(--slate-soft); border-radius: var(--r-pill); padding: 1px 8px; }
.ana-sev { font-size: 11px; color: var(--mut); }
.ana-sev-high { color: var(--warm); font-weight: 600; }
.ana-card-body { font-size: 13.5px; color: var(--ink); line-height: 1.65; }
.ana-sub { font-size: 12px; color: var(--mut); margin-top: 5px; line-height: 1.6; }
.ana-mut { color: var(--mut); }
.ana-quote-btn { margin-top: 8px; }
.ana-quote { margin-top: 8px; background: var(--raise); border: 1px solid var(--brand-line); border-radius: var(--r-block); padding: 9px 11px; }
.ana-quote-meta { font-size: 11.5px; color: var(--mut); margin-bottom: 4px; }
.ana-quote-meta.ana-quote-inf { color: var(--warm); }
.ana-quote-text { font-size: 13px; color: var(--mid); line-height: 1.7; margin: 0; }
.ana-hl { background: var(--brand-soft); color: var(--brand-solid); padding: 0 2px; border-radius: 3px; font-weight: 600; }
.ana-stage { background: var(--card-solid); border: 1px solid var(--card-bd); border-radius: var(--r-block); padding: 11px 12px; }
.ana-actions { margin: 0; padding-left: 18px; }
.ana-actions li { font-size: 13px; color: var(--mid); line-height: 1.7; }

/* ===== 个人记账面板（第 2 轮）=====
   延续现有浅色 / 白卡 / 1px 边框 / 8px 圆角 / 主色（见 --brand）；
   只追加 .expense-* 专属样式，不引入新颜色体系、不改已有选择器。 */
.expense-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 10px 0; }
.expense-toolbar label { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--mut); }
.expense-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 10px 0; }
.expense-form label { font-size: 12.5px; color: var(--mut); }
.expense-form .row { grid-column: 1 / -1; display: flex; gap: 8px; flex-wrap: wrap; }
.expense-form #expFormMsg { grid-column: 1 / -1; }
.expense-sum { display: flex; gap: 18px; flex-wrap: wrap; margin: 8px 0; }
.expense-sum-item b { font-size: 16px; margin-left: 6px; }
.expense-sum-k { font-size: 12px; color: var(--mut); }
.expense-cats { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.expense-cat { font-size: 11.5px; color: var(--mut); background: var(--slate-soft); border-radius: var(--r-pill); padding: 2px 8px; }
.expense-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.expense-table th, .expense-table td { border-bottom: 1px solid var(--card-bd); padding: 7px 8px; text-align: left; }
.expense-table th { font-size: 12px; color: var(--mut); font-weight: 600; }
.expense-amt { text-align: right; font-variant-numeric: tabular-nums; }   /* 金额右对齐 */
.expense-ops { text-align: right; white-space: nowrap; }
.expense-empty { font-size: 13px; color: var(--mut); padding: 10px 2px; }
/* 移动端：表单单列、按钮不溢出 */
@media (max-width: 640px) {
  .expense-form { grid-template-columns: 1fr; }
  .expense-form .row { flex-direction: column; align-items: stretch; }
  .expense-table { font-size: 12.5px; }
  .expense-table th:nth-child(5), .expense-table td:nth-child(5) { display: none; }
}

/* ===== 移动端记账表格：不再隐藏「关联客户」，改为外层横向滚动 =====
   7 列在窄屏不硬挤，左右滑动即可看全；桌面端宽度足够，行为不变。
   （下面两条只做覆盖，不改动上面已有的选择器。） */
.expense-table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
@media (max-width: 640px) {
  .expense-table th:nth-child(5), .expense-table td:nth-child(5) { display: table-cell; }
  .expense-table { min-width: 560px; }   /* 撑出滚动宽度，避免列被压成一团 */
}

/* ===== 提醒闭环第 2 轮：小迹提醒中心 / 侧栏角标 / 待办定位高亮 =====
   只新增下面这些选择器，不改动上面任何已有规则；
   沿用白卡 + 1px 边框 + 8px 圆角 + 主色，不引入外部资源、动画库或新的阴影体系。 */
.reminder-center { padding-bottom: 14px; }

.reminder-summary {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px;
  padding: 10px 12px; margin: 4px 0 10px;
  border: 1px solid var(--card-line); border-radius: 8px; background: var(--raise);
  font-size: 13px; color: var(--mid);
}
.reminder-summary b { color: var(--ink); font-weight: 600; }
.reminder-sum-high b { color: var(--hot); }

.reminder-item {
  border: 1px solid var(--card-line); border-radius: 8px; background: var(--card);
  padding: 10px 12px; margin-bottom: 8px;
}
.reminder-item:last-of-type { margin-bottom: 0; }
.reminder-high { border-left: 3px solid var(--hot); }
.reminder-title { font-size: 14px; font-weight: 600; color: var(--ink); }
.reminder-detail { font-size: 13px; color: var(--mid); margin-top: 2px; word-break: break-word; }
.reminder-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
.reminder-sev {
  font-size: 12px; line-height: 18px; padding: 0 8px; border-radius: 9px;
  background: var(--slate-soft); color: var(--mid);
}
.reminder-sev.is-high { background: var(--hot-soft); color: var(--hot-deep); }

.reminder-action {
  font: inherit; font-size: 12.5px; line-height: 22px;
  padding: 0 10px; border-radius: 6px; cursor: pointer;
  border: 1px solid var(--brand-line); background: var(--field-bg); color: var(--brand);
}
.reminder-action:hover { background: var(--brand-soft); }

.reminder-empty {
  border: 1px dashed var(--card-line); border-radius: 8px; background: var(--raise);
  padding: 14px; text-align: center; color: var(--mut); font-size: 13px;
}
.reminder-tip { min-height: 16px; margin-top: 8px; font-size: 12.5px; color: var(--mut); }

.todo-locate-highlight { background: var(--brand-soft) !important; border-radius: 8px; }

.sb-badge {
  margin-left: auto; min-width: 18px; height: 18px; padding: 0 5px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 9px; font-size: 11px; font-weight: 600; line-height: 1;
  background: var(--brand-soft); color: var(--brand);
}
.sb-badge[hidden] { display: none; }
.sb-badge.is-high { background: var(--hot-soft); color: var(--hot-deep); }

/* 个人中心「小迹提醒设置」表单行 */
.reminder-prefs .reminder-pref-row { display: flex; align-items: center; gap: 8px; margin: 8px 0; font-size: 14px; color: var(--ink); }
.reminder-prefs .reminder-days { width: 96px; }
.reminder-prefs input[type="checkbox"] { width: 16px; height: 16px; }

@media (max-width: 640px) {
  .reminder-summary { flex-direction: column; align-items: flex-start; gap: 4px; }
  .reminder-meta { gap: 6px; }
}

/* ===== 正式空态页（二级模块尚未建设 · 双端导航第 1 轮）=====
   只做说明 + 回可用入口，不摆任何 KPI / 客户 / 订单占位数字，避免看起来像有数据。 */
#view-placeholder .ph-card { max-width: 720px; padding: 26px 24px; }
.ph-crumb { font-size: 12px; color: var(--mut); letter-spacing: .02em; margin-bottom: 10px; }
.ph-title { font-size: 18px; font-weight: 600; color: var(--ink); margin-bottom: 10px; }
.ph-desc { font-size: 13.5px; line-height: 1.75; color: var(--mid); }
.ph-back-t { margin-top: 18px; font-size: 12px; color: var(--mut); }
.ph-back { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.ph-back-btn { font-size: 13px; padding: 6px 12px; border: 1px solid var(--brand-line); background: var(--card);
  color: var(--mid); border-radius: var(--r-pill); cursor: pointer; font-family: inherit; }
.ph-back-btn:hover { color: var(--brand-solid); border-color: var(--brand-solid); }

@media (max-width: 640px) {
  #view-placeholder .ph-card { padding: 18px 14px; }
  .ph-title { font-size: 16px; }
}
/* ============================================================
   双端导航第 2 轮 · 电脑端视觉定稿
   红线：**所有新增视觉只在 @media (min-width:641px) 内生效**。
        ≤640px 只保留「桌面专属元素不占位」的基线声明（display:none），
        手机端底部五项、宽度、内边距、卡片形态一律沿用上一版。
   色板：底 var(--desk-bg) / 白卡 / 1px 浅边框 / 8–12px 圆角 / 客迹蓝 --brand-solid；
        不用紫渐变按钮、不用大阴影、不加装饰性渐变。
   ⚠️ 本段不写任何硬编码色值：颜色全部来自 :root 的 --desk-* / 既有 token
      （dom-smoke-clientdraft 会扫描 :root 之外是否出现硬编码色值，注释里写函数名也会被误判，故此处不写）。
   ============================================================ */

/* —— 基线（≤640px + 桌面未生效前）：桌面专属元素一律不占位 —— */
.desk-topbar { display: none; }
.ap-hero { display: none; }
.ap-tool-desc { display: none; }
.sb-desc { display: none; }
.sb-ai-tag { display: none; }
.sb-copy { min-width: 0; display: block; }
.ap-tool-ico { display: inline-flex; align-items: center; }
.ap-tool-copy { display: inline-flex; align-items: center; gap: 0; }
.ap-tool-title { display: inline; }

@media (min-width: 641px) {
  /* ---------- ① 底色（body.wb-dash 有同等命中，必须一起改，否则工作台还是旧灰底） ---------- */
  body, body.wb-dash { background: var(--desk-bg); }

  /* ---------- ② 侧栏 ---------- */
  .sidebar, body.wb-dash .sidebar {
    flex: 0 0 210px; gap: 12px; padding: 16px 12px 12px;
    background: var(--card-solid); border-right: 1px solid var(--card-bd);
  }
  body.wb-sb-fold .sidebar, body.wb-dash.wb-sb-fold .sidebar { flex: 0 0 64px; padding: 14px 6px; }

  .sb-menu { gap: 4px; }
  .sb-item, body.wb-dash .sb-item {
    display: grid; grid-template-columns: 28px minmax(0, 1fr) auto;
    align-items: center; gap: 9px; height: auto; padding: 8px;
    border: 1px solid transparent; border-radius: 9px; color: var(--ink);
  }
  .sb-item:hover, body.wb-dash .sb-item:hover { background: var(--desk-field); color: var(--ink); }
  .sb-item.active, body.wb-dash .sb-item.active {
    background: var(--brand-soft); border-color: var(--desk-active-bd);
    color: var(--focus); font-weight: 600;
  }
  .sb-ico, body.wb-dash .sb-ico {
    width: 28px; height: 28px; flex: none; border-radius: 8px;
    background: var(--slate-soft); color: var(--mid);
  }
  .sb-item.active .sb-ico, body.wb-dash .sb-item.active .sb-ico {
    background: var(--card-solid); color: var(--brand-solid);
  }
  .sb-text, body.wb-dash .sb-text {
    display: block; font-size: 12.5px; line-height: 1.25; font-weight: 500;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .sb-desc {
    display: block; margin-top: 2px; font-size: 10.5px; line-height: 1.2; color: var(--mut);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .sb-item.active .sb-desc { color: var(--focus); opacity: .72; }
  .sb-ai-tag {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 20px; height: 18px; padding: 0 5px; border-radius: 9px;
    background: var(--brand-solid); color: var(--on-brand);
    font-size: 10px; font-weight: 600; letter-spacing: .02em;
  }
  .sb-arrow { width: 14px; height: 14px; color: var(--mut); }
  .sb-item.open .sb-arrow { transform: rotate(90deg); }
  .sb-item.active .sb-arrow { color: var(--brand-solid); }

  /* 二级菜单：缩进 + 左侧细线，仍挂在该主菜单项下方（不是独立侧栏） */
  .sb-sub {
    gap: 2px; margin: 2px 0 6px 37px; padding: 2px 0 2px 10px;
    border-left: 1px solid var(--desk-sub-line);
  }
  .sb-sub-item { min-height: 30px; padding: 5px 8px; border-radius: 7px; font-size: 12px; color: var(--mid); }
  .sb-sub-item:hover { background: var(--desk-field); color: var(--ink); }
  .sb-sub-item.active { background: var(--desk-wash); color: var(--focus); font-weight: 600; }

  /* 品牌区 / 用户区对齐定稿 */
  .wb-logo { gap: 10px; padding: 0 6px; }
  .wb-logo-mark { width: 36px; height: 36px; border-radius: 11px; font-size: 16px; }
  .wb-logo-text { font-size: 14.5px; font-weight: 600; line-height: 1.2; }
  .wb-logo-sub { font-size: 10.5px; line-height: 1.2; color: var(--mut); }
  .wb-user { margin-top: auto; gap: 9px; padding: 11px 6px 2px; border-top: 1px solid var(--card-bd); }
  .wb-avatar { width: 30px; height: 30px; font-size: 12px; }
  .ub-name { font-size: 11.5px; font-weight: 600; }

  /* 折成图标栏时：副标题、AI 标识一并收起（图标栏放不下文字） */
  body.wb-sb-fold .sb-item, body.wb-dash.wb-sb-fold .sb-item {
    display: flex; justify-content: center; padding: 9px 0; gap: 0;
  }
  body.wb-sb-fold .sb-copy, body.wb-dash.wb-sb-fold .sb-copy { display: none; }
  body.wb-sb-fold .sb-desc, body.wb-dash.wb-sb-fold .sb-desc { display: none; }
  body.wb-sb-fold .sb-ai-tag, body.wb-dash.wb-sb-fold .sb-ai-tag { display: none; }

  /* ---------- ③ 桌面顶栏 ---------- */
  .desk-topbar {
    display: flex; align-items: center; justify-content: space-between; gap: 14px;
    height: 60px; padding: 0 18px;
    margin: -14px -14px 14px;          /* 抵消 main 的 14px 内边距，做成通栏 */
    background: var(--card-solid); border-bottom: 1px solid var(--card-bd);
  }
  body.wb-dash .desk-topbar { margin: -22px -24px 22px; }   /* 工作台 main 的内边距是 22/24 */

  .dt-search {
    display: flex; align-items: center; gap: 8px;
    width: min(380px, 60%); height: 34px; padding: 0 12px;
    border: 1px solid var(--card-bd); border-radius: 10px;
    background: var(--desk-field); color: var(--mut);
  }
  .dt-search > svg { flex: none; }
  .dt-search input {
    width: 100%; min-width: 0; border: 0; background: transparent; outline: none;
    font: inherit; font-size: 12.5px; line-height: 1; color: var(--ink);
  }
  .dt-search input::placeholder { color: var(--mut); }
  .dt-search input::-webkit-search-cancel-button { display: none; }

  .dt-actions { display: flex; align-items: center; gap: 9px; }
  .dt-icon {
    position: relative; display: grid; place-items: center;
    width: 34px; height: 34px; border: 1px solid var(--card-bd); border-radius: 9px;
    background: var(--card-solid); color: var(--mid); cursor: pointer;
  }
  .dt-icon:hover { color: var(--brand-solid); border-color: var(--brand-solid); }
  .dt-dot {
    position: absolute; top: 6px; right: 7px; width: 7px; height: 7px;
    border-radius: 50%; background: var(--hot); border: 1px solid var(--card-solid);
  }
  .dt-ai {
    display: inline-flex; align-items: center; gap: 6px;
    height: 34px; padding: 0 13px; border: 1px solid transparent; border-radius: 9px;
    background: var(--brand-solid); color: var(--on-brand);
    font-size: 12.5px; font-weight: 500; cursor: pointer;
  }
  .dt-ai:hover { background: var(--focus); }

  /* ---------- ④ 小迹总台：融入主工作区 ---------- */
  #view-assistant { padding: 0; }
  #view-assistant .card.assistant-page {
    background: transparent; border: 0; border-radius: 0; box-shadow: none;
    padding: 0; margin: 0;
  }
  /* 桌面端隐藏顶部蓝色「小迹」横栏 + 右上角「×」关闭按钮 */
  #view-assistant .ap-head { display: none; }
  #view-assistant .ap-start { min-height: calc(100vh - 200px); padding: 36px 24px 44px; gap: 13px; }

  .ap-hero {
    display: grid; place-items: center; width: 58px; height: 58px; margin-bottom: 3px;
    border-radius: 18px; background: var(--brand-soft); color: var(--brand-solid);
  }
  .ap-welcome-title { font-size: 27px; font-weight: 600; letter-spacing: -.03em; }
  .ap-welcome-sub { max-width: 550px; font-size: 12.5px; line-height: 1.75; color: var(--mid); }

  .ap-start-input { width: min(650px, 100%); gap: 9px; margin-top: 5px; }
  .ap-start-input textarea {
    height: 46px; padding: 13px 14px; font-size: 13px; border-radius: 10px;
    border: 1px solid var(--brand-solid); background: var(--card-solid);
    box-shadow: 0 0 0 3px var(--desk-ring);
  }
  .ap-start-input button {
    min-width: 74px; border-radius: 9px; font-size: 13px; font-weight: 600;
    background: var(--brand-solid); color: var(--on-brand); border: 0; box-shadow: none;
  }
  .ap-start-input button:hover { background: var(--focus); filter: none; }

  .ap-start-quick { width: min(650px, 100%); gap: 7px; margin-top: 1px; }
  .ap-start-quick button {
    min-height: 31px; padding: 0 11px; font-size: 12px; border-radius: var(--r-pill);
    background: var(--card-solid); color: var(--ink);
  }
  .ap-start-quick button:hover { background: var(--desk-wash); color: var(--focus); }

  /* 三张工具卡（原胶囊按钮升级，跳转目标完全不变） */
  #assistantEntries {
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px;
    width: min(650px, 100%); margin-top: 6px; text-align: left;
  }
  #assistantEntries .ap-entry {
    display: block; min-height: 84px; padding: 11px; text-align: left;
    border: 1px solid var(--card-bd); border-style: solid; border-radius: 10px;
    background: var(--card-solid); color: var(--ink);
  }
  #assistantEntries .ap-entry:hover {
    border-color: var(--brand-solid); background: var(--card-solid); color: var(--ink);
  }
  .ap-tool-ico {
    display: grid; place-items: center; width: 27px; height: 27px; margin-bottom: 8px;
    border-radius: 8px; background: var(--brand-soft); color: var(--brand-solid);
  }
  .ap-tool-copy { display: block; }
  .ap-tool-title { display: block; font-size: 12px; line-height: 1.3; font-weight: 600; }
  .ap-tool-desc { display: block; margin-top: 3px; font-size: 11px; line-height: 1.4; color: var(--mut); }
}

/* ============================================================
   电脑端二级模块定位 · 短暂高亮（内容映射修正）
   后台四个入口 / 会议纪要进页后，在目标卡片上闪一下，让用户知道"点对了、到这儿了"。
   · 只在 @media (min-width:641px) 内生效：手机端永远拿不到这个类，也拿不到这条规则；
   · 只动 box-shadow（不占布局、不改尺寸），1.6s 后由 JS 摘掉类；
   · 颜色走 :root 的 --desk-flash，不写硬编码色值。
   ============================================================ */
@media (min-width: 641px) {
  .desk-focus-flash {
    border-radius: 10px;
    animation: deskFocusFlash 1.6s ease-out 1;
  }
  @keyframes deskFocusFlash {
    0%   { box-shadow: 0 0 0 3px var(--desk-flash); }
    55%  { box-shadow: 0 0 0 3px var(--desk-flash); }
    100% { box-shadow: 0 0 0 0 transparent; }
  }
}

/* ============================================================
   后台管理二级 = 独立页面（第 3 轮）
   一个视图承载多个后台页：视图容器上打 #view-profile.adm-account / .adm-settings、
   #view-integ.adm-credits / .adm-members，桌面端只显示 data-admin-block 属于该页的卡片。
   · 卡片是同一份 DOM，没有复制、没有第二套渲染；
   · 手机端不套用这些模式类（进入个人中心仍是完整内容），所以下面这些规则只在 >640px 生效；
   · 仅新增 display 开关，不改任何尺寸 / 颜色 / 圆角。
   ============================================================ */
/* 后台页专属卡片（组织信息 / 套餐空态 / 存储空态 / 连接配置）：默认不出现，只在对应后台页打开 */
.adm-org, .adm-plan, .adm-storage, .adm-conn { display: none; }

@media (min-width: 641px) {
  /* ① 账户与套餐：账户资料 + 组织信息 + 套餐空态 */
  #view-profile.adm-account > .card { display: none; }
  #view-profile.adm-account > .card[data-admin-block="account"],
  #view-profile.adm-account > .card[data-admin-block="org"],
  #view-profile.adm-account > .card[data-admin-block="plan"] { display: block; }

  /* ② 存储与设置：存储空态 + 提醒设置 + 外观 + 密码 + 连接配置（仅管理员）+ 退出登录 */
  #view-profile.adm-settings > .card { display: none; }
  #view-profile.adm-settings > .card[data-admin-block="storage"],
  #view-profile.adm-settings > .card[data-admin-block="reminder"],
  #view-profile.adm-settings > .card[data-admin-block="pwd"],
  #view-profile.adm-settings > .card[data-admin-block="look"],
  #view-profile.adm-settings > .card[data-admin-block="logout"] { display: block; }
  #view-profile.adm-settings > .adm-conn { display: block; }
  #view-profile.adm-settings.adm-no-conn > .adm-conn { display: none; }

  /* ③ 积分与算力：只有用量与审计 */
  #view-integ.adm-credits > .card { display: none; }
  #view-integ.adm-credits > .card[data-admin-block="usage"] { display: block; }

  /* ④ 成员与权限：只有成员管理 */
  #view-integ.adm-members > .card { display: none; }
  #view-integ.adm-members > .card[data-admin-block="members"] { display: block; }
}

/* ===========================================================================
 * 经营概览（KEJI-UI-01）
 * 小迹总台从「一个空输入框」升级为「经营概览 + 小迹入口」，一级导航仍是五项。
 * 结构：① 问候与日期 ② 六项真实指标 ③ 小迹入口（原样）
 *       ④ 今日待办 ⑤ 应收/回款提醒 ⑥ 目标进度（正式空态）⑦ 快捷进入
 * 移动优先：390px 两列、任何长数字都换行不横向滚动；≥641px 六列指标 + 双栏面板。
 * =========================================================================== */

/* 总台改为顶部对齐（原来垂直居中，加了概览后在窄屏会把顶部内容顶出可视区） */
.ap-start.ho { justify-content: flex-start; align-items: stretch; text-align: left; }
/* 小迹自身那块仍保持居中（图标 / 欢迎语 / 输入框 / 快捷问题 / 三类入口） */
.ap-start.ho > .ap-hero,
.ap-start.ho > .ap-welcome-title,
.ap-start.ho > .ap-welcome-sub,
.ap-start.ho > .ap-start-input,
.ap-start.ho > .ap-start-quick,
.ap-start.ho > #assistantEntries { align-self: center; text-align: center; }

.ho-top { display: flex; flex-direction: column; gap: 10px; width: 100%; min-width: 0; }
.ho-greet { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.ho-greet-main { min-width: 0; }
.ho-hello { font-size: 16.5px; font-weight: 700; color: var(--ink); line-height: 1.4; overflow-wrap: anywhere; }
.ho-date { margin-top: 3px; font-size: 12px; color: var(--mid); }
.ho-greet-note { font-size: 11px; color: var(--mut); border: 1px solid var(--brand-line); border-radius: 999px; padding: 3px 9px; white-space: nowrap; }

.ho-kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; width: 100%; }
.ho-kpi { border: 1px solid var(--brand-line); border-radius: 14px; background: var(--card); padding: 10px 12px; min-width: 0; }
.ho-kpi-l { font-size: 11.5px; color: var(--mid); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ho-kpi-v { margin-top: 5px; font-size: 18px; font-weight: 700; color: var(--ink); line-height: 1.2; overflow-wrap: anywhere; }
.ho-kpi-sub { margin-top: 3px; font-size: 10.5px; color: var(--mut); line-height: 1.35; overflow-wrap: anywhere; }

.ho-cols { display: grid; grid-template-columns: 1fr; gap: 10px; width: 100%; min-width: 0; }
.ho-sec { border: 1px solid var(--brand-line); border-radius: 14px; background: var(--card); padding: 12px; text-align: left; width: 100%; min-width: 0; }
.ho-sec-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.ho-sec-title { font-size: 13px; font-weight: 700; color: var(--ink); }
.ho-sec-tag { font-size: 10.5px; color: var(--mut); border: 1px solid var(--brand-line); border-radius: 999px; padding: 2px 8px; white-space: nowrap; }
.ho-sec-link { border: none; background: none; color: var(--brand-solid); font-size: 11.5px; cursor: pointer; padding: 2px 0; font-family: inherit; }
.ho-sec-link:hover { text-decoration: underline; }

.ho-list { display: flex; flex-direction: column; min-width: 0; }
.ho-row { display: flex; align-items: center; gap: 9px; padding: 8px 0; border-top: 1px dashed var(--brand-line); min-width: 0; }
.ho-row:first-child { border-top: none; }
.ho-row-main { flex: 1 1 auto; min-width: 0; }
.ho-row-title { font-size: 12.5px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ho-row-meta { margin-top: 2px; font-size: 11px; color: var(--mut); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ho-row-btn { cursor: pointer; border-radius: 10px; }
.ho-row-btn:hover { background: var(--brand-soft); }
.ho-row-btn:hover .ho-row-title { color: var(--brand-solid); }
.ho-check { flex: 0 0 auto; width: 16px; height: 16px; border-radius: 5px; border: 1.5px solid var(--brand-line); background: transparent; cursor: pointer; padding: 0; }
.ho-check:hover { border-color: var(--brand-solid); background: var(--brand-soft); }
.ho-pill { flex: 0 0 auto; font-size: 10.5px; padding: 2px 7px; border-radius: 999px; border: 1px solid var(--brand-line); color: var(--mid); white-space: nowrap; }
.ho-pill.is-overdue { color: var(--err-ink); border-color: var(--err-line-strong); background: var(--err-wash); }
.ho-pill.is-today { color: var(--brand-solid); border-color: var(--brand-line); background: var(--brand-soft); }
.ho-pill.is-soon { color: var(--soon-ink); border-color: var(--soon-line); background: var(--soon-wash); }
.ho-empty { padding: 8px 2px; font-size: 12px; color: var(--mid); line-height: 1.65; }
.ho-empty-sub { font-size: 11px; color: var(--mut); }
.ho-more { margin-top: 6px; font-size: 11px; color: var(--mut); }

.ho-goals-empty { padding: 4px 2px 6px; }
.ho-goals-title { font-size: 12.5px; font-weight: 600; color: var(--ink); }
.ho-goals-desc { margin-top: 4px; font-size: 11.5px; color: var(--mut); line-height: 1.65; max-width: 640px; }

.ho-quickgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.ho-qbtn { display: flex; flex-direction: column; gap: 2px; align-items: flex-start; padding: 10px 12px;
  border: 1px solid var(--brand-line); border-radius: 12px; background: transparent; cursor: pointer;
  font-family: inherit; text-align: left; min-width: 0; }
.ho-qbtn:hover { border-color: var(--brand-solid); background: var(--brand-soft); }
.ho-qb-title { font-size: 12.5px; font-weight: 600; color: var(--ink); }
.ho-qb-desc { font-size: 10.5px; color: var(--mut); }

@media (min-width: 641px) {
  /* 覆盖 #view-assistant .ap-start 的居中留白（ID 选择器，需同权重才压得住） */
  #view-assistant .ap-start.ho { padding: 22px 24px 34px; gap: 14px; }
  .ho-top, .ho-cols, .ho-sec, #hoTodo, #hoRecv { width: min(980px, 100%); margin-left: auto; margin-right: auto; }
  .ho-hello { font-size: 19px; }
  .ho-date { font-size: 12.5px; }
  .ho-kpis { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
  .ho-kpi { padding: 12px 14px; }
  .ho-kpi-v { font-size: 20px; }
  .ho-kpi-l { font-size: 12px; }
  .ho-cols { grid-template-columns: 1fr 1fr; gap: 12px; align-items: start; }
  .ho-quickgrid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .ho-sec { padding: 14px; }
}

/* ===== 目标管理（KEJI-GOAL-01）=============================================
   只在 #view-goals 内生效；颜色全部走既有 token，不引入新主题变量。
   390px：KPI 两列、表单单列、卡片操作换行，确保无横向滚动。 */
#view-goals .gl-wrap { display: flex; flex-direction: column; gap: 12px; }
.gl-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.gl-title { font-size: 18px; color: var(--ink); }
.gl-sub { margin-top: 3px; font-size: 12px; color: var(--mut); line-height: 1.6; max-width: 520px; }

.gl-btn { border: 1px solid var(--brand-line); background: var(--card); color: var(--mid);
  border-radius: 10px; padding: 7px 12px; font-size: 12.5px; cursor: pointer; font-family: inherit; }
.gl-btn:hover { border-color: var(--brand-solid); color: var(--brand-solid); }
.gl-btn-primary { background: var(--brand-solid); border-color: transparent; color: var(--on-brand); font-weight: 600; }
.gl-btn-primary:hover { color: var(--on-brand); opacity: .92; }
.gl-btn-quiet { color: var(--mut); }

.gl-toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.gl-seg { display: inline-flex; border: 1px solid var(--brand-line); border-radius: 999px; overflow: hidden; background: var(--card); }
.gl-seg-btn { border: none; background: transparent; color: var(--mid); font-size: 12px;
  padding: 6px 12px; cursor: pointer; font-family: inherit; white-space: nowrap; }
.gl-seg-btn.is-on { background: var(--brand-soft); color: var(--brand-solid); font-weight: 600; }
.gl-select { border: 1px solid var(--brand-line); border-radius: 10px; padding: 6px 10px;
  background: var(--field-bg); color: var(--ink); font-size: 12.5px; font-family: inherit; }

.gl-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.gl-kpi { border: 1px solid var(--brand-line); border-radius: 14px; background: var(--card); padding: 10px 12px; min-width: 0; }
.gl-kpi-k { font-size: 11.5px; color: var(--mid); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gl-kpi-v { margin-top: 4px; font-size: 20px; font-weight: 700; color: var(--ink); line-height: 1.2; }

.gl-form { border: 1px solid var(--brand-line); border-radius: 14px; background: var(--card); padding: 14px; }
.gl-form-title { font-size: 14px; font-weight: 700; color: var(--ink); margin-bottom: 10px; }
.gl-form-err { margin-bottom: 8px; padding: 7px 10px; border-radius: 10px;
  background: var(--err-wash); color: var(--err-ink); font-size: 12px; line-height: 1.5; }
.gl-fgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.gl-field { display: flex; flex-direction: column; gap: 4px; margin: 0; }
.gl-field-wide { grid-column: 1 / -1; }
.gl-field > span { font-size: 11.5px; color: var(--mid); }
.gl-field input, .gl-field select { width: 100%; border: 1px solid var(--brand-line); border-radius: 10px;
  padding: 8px 10px; background: var(--field-bg); color: var(--ink); font-size: 13px; font-family: inherit; }
.gl-field input:disabled, .gl-field select:disabled { opacity: .7; }
.gl-form-hint { margin-top: 8px; font-size: 11px; color: var(--mut); line-height: 1.6; }
.gl-form-actions { display: flex; gap: 8px; margin-top: 12px; }

.gl-list { display: flex; flex-direction: column; gap: 10px; }
.gl-card { border: 1px solid var(--brand-line); border-radius: 14px; background: var(--card-solid); padding: 14px; }
.gl-card-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.gl-card-title { flex: 1 1 auto; min-width: 0; font-size: 14px; font-weight: 700; color: var(--ink); overflow-wrap: anywhere; }
.gl-badge { font-size: 10.5px; color: var(--mid); border: 1px solid var(--brand-line);
  border-radius: 999px; padding: 2px 8px; white-space: nowrap; }
.gl-pill { font-size: 10.5px; border-radius: 999px; padding: 2px 8px;
  border: 1px solid var(--brand-line); white-space: nowrap; }
.gl-pill-active { color: var(--brand-solid); background: var(--brand-soft); }
.gl-pill-completed { color: var(--ok-deep); background: var(--ok-deep-wash); border-color: var(--ok-deep-line); }
.gl-pill-archived { color: var(--mut); background: transparent; }
.gl-card-metric { margin-top: 6px; font-size: 11.5px; color: var(--mut); overflow-wrap: anywhere; }
.gl-card-nums { margin-top: 8px; display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.gl-cur { font-size: 20px; font-weight: 700; color: var(--ink); }
.gl-of { font-size: 12px; color: var(--mid); }
.gl-bar { margin-top: 8px; height: 7px; border-radius: 999px; background: var(--brand-soft); overflow: hidden; }
.gl-bar > i { display: block; height: 100%; background: var(--brand-solid); border-radius: 999px; }
.gl-card-foot { margin-top: 7px; display: flex; justify-content: space-between; gap: 10px;
  flex-wrap: wrap; font-size: 11.5px; color: var(--mid); }
.gl-card-foot b { color: var(--ink); }
.gl-actions { margin-top: 10px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.gl-readonly { font-size: 11px; color: var(--mut); }
.gl-empty { border: 1px dashed var(--brand-line); border-radius: 14px; padding: 22px 16px;
  text-align: center; font-size: 12.5px; color: var(--mid); line-height: 1.8; }
.gl-empty-sub { font-size: 11.5px; color: var(--mut); }

/* 首页目标卡里的细进度条（.ho-row 内） */
.ho-goalbar { margin-top: 6px; height: 6px; border-radius: 999px; background: var(--brand-soft); overflow: hidden; }
.ho-goalbar > i { display: block; height: 100%; background: var(--brand-solid); border-radius: 999px; }

@media (max-width: 520px) {
  .gl-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gl-fgrid { grid-template-columns: 1fr; }
  .gl-head { gap: 8px; }
  .gl-cur { font-size: 18px; }
  .gl-toolbar { gap: 6px; }
  .gl-seg-btn { padding: 6px 10px; }
}
/* 周期下拉在电脑端不拉满整行（手机上保持整行更好点按） */
@media (min-width: 521px) {
  .gl-select { flex: 0 0 auto; max-width: 220px; }
}

/* ===== 行业实时情报（KEJI-NEWS-01）=========================================
   只在 #view-news 内生效；颜色全部走既有 token，不引入新主题变量。
   390px：状态条换行、筛选按钮可横滑、卡片与表单单列，确保无横向滚动。 */
#view-news .nw-wrap { display: flex; flex-direction: column; gap: 12px; }
.nw-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.nw-head-copy { min-width: 0; }
.nw-title { font-size: 18px; color: var(--ink); }
.nw-sub { margin-top: 3px; font-size: 12px; color: var(--mut); line-height: 1.6; max-width: 560px; }
.nw-head-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.nw-btn { border: 1px solid var(--brand-line); background: var(--card); color: var(--mid);
  border-radius: 10px; padding: 7px 12px; font-size: 12.5px; cursor: pointer; font-family: inherit; }
.nw-btn:hover { border-color: var(--brand-solid); color: var(--brand-solid); }
.nw-btn:disabled { opacity: .6; cursor: default; }
.nw-btn-primary { background: var(--brand-solid); border-color: transparent; color: var(--on-brand); font-weight: 600; }
.nw-btn-primary:hover { color: var(--on-brand); opacity: .92; }
.nw-btn-quiet { color: var(--mut); }
.nw-readonly { font-size: 11.5px; color: var(--mut); }

/* 状态条：最近更新时间 + 抓取状态 + 来源与条目数 */
.nw-status { display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  border: 1px solid var(--brand-line); border-radius: 14px; background: var(--card); padding: 10px 12px; }
.nw-dot { width: 7px; height: 7px; border-radius: 50%; flex: 0 0 auto; background: var(--mut); }
.nw-dot-ok { background: var(--ok-deep); }
.nw-dot-warn { background: var(--warm-deep); }
.nw-dot-err { background: var(--err-ink); }
.nw-state { font-size: 12.5px; font-weight: 600; color: var(--ink); }
.nw-status-items { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 11.5px; color: var(--mid); }
.nw-status-items i { color: var(--mut); font-style: normal; }
.nw-err { flex: 1 1 100%; font-size: 11.5px; color: var(--err-ink); line-height: 1.6; overflow-wrap: anywhere; }
.nw-notice { border-radius: 12px; padding: 8px 12px; font-size: 12px; line-height: 1.6;
  background: var(--brand-soft); color: var(--brand-solid); }

/* 分类筛选 */
.nw-seg { display: flex; gap: 6px; flex-wrap: wrap; }
.nw-seg-btn { border: 1px solid var(--brand-line); background: var(--card); color: var(--mid);
  border-radius: 999px; padding: 6px 12px; font-size: 12px; cursor: pointer; font-family: inherit; white-space: nowrap; }
.nw-seg-btn.is-on { background: var(--brand-soft); border-color: transparent; color: var(--brand-solid); font-weight: 600; }

/* 发布 / 来源设置面板 */
.nw-panel { border: 1px solid var(--brand-line); border-radius: 14px; background: var(--card); padding: 14px; }
.nw-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.nw-panel-title { font-size: 14px; font-weight: 700; color: var(--ink); }
.nw-sec-title { margin: 12px 0 8px; font-size: 12px; font-weight: 600; color: var(--mid); }
.nw-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.nw-form-inline { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
.nw-field { display: flex; flex-direction: column; gap: 4px; margin: 0; min-width: 0; }
.nw-field-wide { grid-column: 1 / -1; }
.nw-field > span { font-size: 11.5px; color: var(--mid); }
.nw-field input, .nw-field select, .nw-field textarea { width: 100%; border: 1px solid var(--brand-line); border-radius: 10px;
  padding: 8px 10px; background: var(--field-bg); color: var(--ink); font-size: 13px; font-family: inherit; }
.nw-field textarea { resize: vertical; line-height: 1.6; }
.nw-form-hint { margin-top: 8px; font-size: 11px; color: var(--mut); line-height: 1.6; }
.nw-form-actions { display: flex; gap: 8px; margin-top: 12px; }

/* 来源列表 */
.nw-srcrow { display: flex; gap: 10px; align-items: flex-start; justify-content: space-between;
  border: 1px solid var(--brand-line); border-radius: 12px; padding: 10px 12px; background: var(--card-solid); }
.nw-srcrow + .nw-srcrow { margin-top: 8px; }
.nw-srcrow-main { min-width: 0; flex: 1 1 auto; }
.nw-srcrow-name { display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: 13px; font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.nw-srcrow-url { margin-top: 3px; font-size: 11px; color: var(--mut); overflow-wrap: anywhere; }
.nw-srcrow-meta { margin-top: 5px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  font-size: 11px; color: var(--mid); overflow-wrap: anywhere; }
.nw-srcrow-meta i { color: var(--mut); font-style: normal; }
.nw-err-inline { color: var(--err-ink); }

/* 资讯卡 */
.nw-list { display: flex; flex-direction: column; gap: 10px; }
.nw-card { border: 1px solid var(--brand-line); border-radius: 14px; background: var(--card-solid); padding: 14px; }
.nw-card-top { display: flex; align-items: flex-start; gap: 10px; }
.nw-card-title { flex: 1 1 auto; min-width: 0; font-size: 14px; font-weight: 700; color: var(--ink);
  line-height: 1.5; overflow-wrap: anywhere; }
.nw-pill { font-size: 10.5px; border-radius: 999px; padding: 2px 8px; white-space: nowrap;
  border: 1px solid var(--brand-line); color: var(--brand-solid); background: var(--brand-soft); }
.nw-pill-ok { color: var(--ok-deep); background: var(--ok-deep-wash); border-color: var(--ok-deep-line); }
.nw-pill-warn { color: var(--warm-deep); background: var(--warm-deep-wash); border-color: var(--warm-deep-line); }
.nw-pill-err { color: var(--err-ink); background: var(--err-wash); border-color: var(--err-line); }
.nw-card-sum { margin-top: 7px; font-size: 12.5px; color: var(--mid); line-height: 1.75; overflow-wrap: anywhere; }
.nw-card-meta { margin-top: 8px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  font-size: 11.5px; color: var(--mut); }
.nw-card-meta i { font-style: normal; }
.nw-src { color: var(--mid); }
.nw-kws { margin-top: 8px; display: flex; gap: 6px; flex-wrap: wrap; }
.nw-kw { font-size: 11px; border-radius: 999px; padding: 2px 8px;
  background: var(--brand-soft); color: var(--brand-solid); border: 1px solid transparent; }
.nw-card-foot { margin-top: 10px; display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.nw-link { font-size: 12px; color: var(--brand-solid); text-decoration: none; }
.nw-link:hover { text-decoration: underline; }

/* 关键词标签（来源设置里可停用） */
.nw-kws-wrap { margin-bottom: 10px; }
.nw-kw-item { display: inline-flex; align-items: center; gap: 6px; padding-right: 4px; }
.nw-kw-item i { font-style: normal; font-size: 10px; color: var(--mid); }
.nw-kw-item.is-off { opacity: .55; }
.nw-kw-x { border: none; background: transparent; color: var(--mut); font-size: 10.5px;
  cursor: pointer; font-family: inherit; padding: 2px 4px; }
.nw-kw-x:hover { color: var(--brand-solid); }

.nw-empty { border: 1px dashed var(--brand-line); border-radius: 14px; padding: 22px 16px;
  text-align: center; font-size: 12.5px; color: var(--mid); line-height: 1.8; }
.nw-empty-sm { padding: 14px 12px; font-size: 12px; }
.nw-empty-sub { font-size: 11.5px; color: var(--mut); }
.nw-more { padding: 8px 2px; font-size: 11.5px; color: var(--mut); text-align: center; }

@media (max-width: 520px) {
  .nw-head { gap: 8px; }
  .nw-form, .nw-form-inline { grid-template-columns: 1fr; }
  .nw-seg { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 2px; -webkit-overflow-scrolling: touch; }
  .nw-card-title { font-size: 13.5px; }
  .nw-srcrow { flex-direction: column; align-items: stretch; }
}

/* ===================== 定时任务（KEJI-CRON-01） =====================
   视觉语言与新闻/目标页一致：同样的卡边、圆角、pill 与空态。
   红线：所有块都允许换行 + overflow-wrap，390px 宽屏不得横向滚动。 */
#view-cron .cr-wrap { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.cr-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.cr-head-copy { min-width: 0; flex: 1 1 260px; }
.cr-title { font-size: 18px; color: var(--ink); }
.cr-sub { margin-top: 3px; font-size: 12px; color: var(--mut); line-height: 1.6; max-width: 620px; }
.cr-head-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.cr-readonly { font-size: 11.5px; color: var(--mut); }

.cr-btn { border: 1px solid var(--brand-line); background: var(--card); color: var(--mid);
  border-radius: 10px; padding: 7px 12px; font-size: 12.5px; cursor: pointer; font-family: inherit; white-space: nowrap; }
.cr-btn:hover { border-color: var(--brand-solid); color: var(--brand-solid); }
.cr-btn:disabled { opacity: .6; cursor: default; }
.cr-btn-primary { background: var(--brand-solid); border-color: transparent; color: var(--on-brand); font-weight: 600; }
.cr-btn-primary:hover { color: var(--on-brand); opacity: .92; }
.cr-btn-quiet { color: var(--mut); }

/* 调度状态条 */
.cr-status { display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  border: 1px solid var(--brand-line); border-radius: 14px; background: var(--card); padding: 10px 12px; }
.cr-dot { width: 7px; height: 7px; border-radius: 50%; flex: 0 0 auto; background: var(--mut); }
.cr-dot-ok { background: var(--ok-deep); }
.cr-dot-warn { background: var(--warm-deep); }
.cr-state { font-size: 12.5px; font-weight: 600; color: var(--ink); }
.cr-status-items { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 11.5px; color: var(--mid); min-width: 0; }
.cr-status-items i { color: var(--mut); font-style: normal; overflow-wrap: anywhere; }
.cr-status-hint { flex: 1 1 100%; font-size: 11px; color: var(--mut); }
.cr-notice { border-radius: 12px; padding: 8px 12px; font-size: 12px; line-height: 1.6;
  background: var(--brand-soft); color: var(--brand-solid); overflow-wrap: anywhere; }
.cr-error-text { color: var(--err-ink); font-size: 12px; line-height: 1.7; overflow-wrap: anywhere; }

/* 新建 / 编辑面板 */
.cr-panel { border: 1px solid var(--brand-line); border-radius: 14px; background: var(--card); padding: 14px; min-width: 0; }
.cr-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.cr-panel-title { font-size: 14px; font-weight: 700; color: var(--ink); }
.cr-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.cr-field { display: flex; flex-direction: column; gap: 4px; margin: 0; min-width: 0; }
.cr-field-wide { grid-column: 1 / -1; }
.cr-field > span { font-size: 11.5px; color: var(--mid); }
.cr-field input, .cr-field select { width: 100%; min-width: 0; border: 1px solid var(--brand-line); border-radius: 10px;
  padding: 8px 10px; background: var(--field-bg); color: var(--ink); font-size: 13px; font-family: inherit; }
.cr-form-hint { margin-top: 8px; font-size: 11px; color: var(--mut); line-height: 1.7; }
.cr-form-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }

/* 任务卡 */
.cr-list { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.cr-card { border: 1px solid var(--brand-line); border-radius: 14px; background: var(--card-solid); padding: 14px; min-width: 0; }
.cr-card-top { display: flex; align-items: flex-start; gap: 10px; flex-wrap: wrap; }
.cr-card-main { flex: 1 1 260px; min-width: 0; }
.cr-card-name { display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: 14px; font-weight: 700; color: var(--ink); overflow-wrap: anywhere; }
.cr-card-meta { margin-top: 6px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  font-size: 11.5px; color: var(--mid); }
.cr-card-meta i { font-style: normal; overflow-wrap: anywhere; }
.cr-card-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.cr-pill { font-size: 10.5px; border-radius: 999px; padding: 2px 8px; white-space: nowrap;
  border: 1px solid var(--brand-line); color: var(--brand-solid); background: var(--brand-soft); font-weight: 500; }
.cr-pill-ok { color: var(--ok-deep); background: var(--ok-deep-wash); border-color: var(--ok-deep-line); }
.cr-pill-warn { color: var(--warm-deep); background: var(--warm-deep-wash); border-color: var(--warm-deep-line); }
.cr-pill-err { color: var(--err-ink); background: var(--err-wash); border-color: var(--err-line); }
.cr-warn { margin-top: 6px; font-size: 11.5px; color: var(--warm-deep); line-height: 1.7; overflow-wrap: anywhere; }

/* 运行历史 */
.cr-runs { margin-top: 12px; border-top: 1px dashed var(--brand-line); padding-top: 10px; min-width: 0; }
.cr-runs-line { font-size: 12px; color: var(--mut); line-height: 1.7; }
.cr-run { display: flex; align-items: flex-start; gap: 8px; flex-wrap: wrap;
  padding: 6px 0; font-size: 11.5px; color: var(--mid); }
.cr-run + .cr-run { border-top: 1px solid var(--brand-line); }
.cr-run-time { color: var(--mut); white-space: nowrap; }
.cr-run-trigger { color: var(--mut); }
.cr-run-sum { flex: 1 1 160px; min-width: 0; overflow-wrap: anywhere; }
.cr-runs-hint { margin-top: 6px; font-size: 11px; color: var(--mut); }

/* 空态 */
.cr-empty { border: 1px dashed var(--brand-line); border-radius: 14px; padding: 22px 16px;
  text-align: center; font-size: 12.5px; color: var(--mid); line-height: 1.8; overflow-wrap: anywhere; }
.cr-empty-title { font-size: 13.5px; font-weight: 700; color: var(--ink); margin-bottom: 4px; }
.cr-empty-sub { font-size: 11.5px; color: var(--mut); }
.cr-empty-actions { margin-top: 12px; display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }

@media (max-width: 520px) {
  .cr-head { gap: 8px; }
  .cr-form { grid-template-columns: 1fr; }
  .cr-card-actions { width: 100%; }
  .cr-card-name { font-size: 13.5px; }
  .cr-run-time { white-space: normal; }
}

/* ===================== 客迹云盘（KEJI-DRIVE-01） =====================
   结构与目标管理页同源（.dv-wrap 对应 .gl-wrap），这里只补云盘特有的行、
   面包屑、容量条与确认条。全部尺寸用 min-width:0 + flex-wrap，
   保证 390px 下不横向溢出（行内动作按钮换行而不是撑出屏幕）。 */
.dv-wrap { display: flex; flex-direction: column; gap: 12px; }
.dv-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.dv-head-copy { min-width: 0; }
.dv-title { font-size: 18px; color: var(--ink); }
.dv-sub { margin-top: 3px; font-size: 12px; color: var(--mut); line-height: 1.6; max-width: 520px; }
.dv-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.dv-btn { border: 1px solid var(--brand-line); background: var(--card); color: var(--mid);
  border-radius: 10px; padding: 7px 12px; font-size: 12.5px; cursor: pointer; font-family: inherit; }
.dv-btn:hover { border-color: var(--brand-solid); color: var(--brand-solid); }
.dv-btn:disabled { opacity: .6; cursor: default; }
.dv-btn-primary { background: var(--brand-solid); border-color: transparent; color: var(--on-brand); font-weight: 600; }
.dv-btn-primary:hover { color: var(--on-brand); opacity: .92; }
.dv-btn-danger { background: var(--hot); border-color: transparent; color: var(--on-brand); font-weight: 600; }
.dv-btn-danger:hover { color: var(--on-brand); opacity: .92; }
/* 上传用的 file input 必须留在 DOM 里（点「上传文件」用 .click() 触发），但要视觉隐藏。
   注意：全局规则 input[type=file] { width:100% } 优先级更高，所以这里用「属性 + 类」双选择器，
   并用标准 clip 方案（不是 left:-9999px），否则 390px 下它会撑出横向滚动。 */
.dv-actions input[type=file].dv-file-input {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
  border: 0; opacity: 0; pointer-events: none;
}

.dv-notice { border: 1px solid var(--brand-line); border-radius: 12px; background: var(--brand-soft);
  color: var(--mid); font-size: 11.5px; line-height: 1.7; padding: 9px 11px; overflow-wrap: anywhere; }
.dv-notice b { color: var(--ink); }

/* 底层清理警告：持续可见（不是 toast），所以用高对比的警示色 + 左侧竖条 */
.dv-cleanup-warn { border: 1px solid var(--alert-line); border-left: 3px solid var(--alert-edge);
  border-radius: 12px; background: var(--alert-wash); color: var(--ink);
  font-size: 11.5px; line-height: 1.7; padding: 9px 11px; overflow-wrap: anywhere; }
.dv-flash { border-radius: 12px; font-size: 11.5px; line-height: 1.7; padding: 9px 11px; overflow-wrap: anywhere; }
.dv-flash.is-warn { border: 1px solid var(--alert-line); background: var(--alert-wash); color: var(--ink); }
.dv-flash.is-ok { border: 1px solid var(--brand-line); background: var(--brand-soft); color: var(--mid); }

.dv-quota { border: 1px solid var(--brand-line); border-radius: 12px; background: var(--card); padding: 9px 11px; }
.dv-quota-bar { height: 6px; border-radius: 999px; background: var(--slate-soft); overflow: hidden; }
.dv-quota-bar i { display: block; height: 100%; background: var(--brand-solid); border-radius: 999px; }
.dv-quota-text { margin-top: 6px; font-size: 11px; color: var(--mut); line-height: 1.7; overflow-wrap: anywhere; }
.dv-quota-text b { color: var(--ink); }

.dv-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.dv-tab { border: 1px solid var(--brand-line); background: var(--card); color: var(--mid);
  border-radius: 999px; padding: 6px 13px; font-size: 12px; cursor: pointer; font-family: inherit; }
.dv-tab.is-on { background: var(--brand-soft); color: var(--brand-solid); border-color: var(--brand-solid); font-weight: 600; }

.dv-crumbs { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; font-size: 12px; min-width: 0; }
.dv-crumb { border: none; background: transparent; color: var(--focus); font-size: 12px; cursor: pointer;
  padding: 2px 3px; font-family: inherit; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dv-crumb-sep { color: var(--faint); }

.dv-hint { font-size: 11.5px; color: var(--mid); }

.dv-list { display: flex; flex-direction: column; gap: 8px; }
.dv-row { border: 1px solid var(--brand-line); border-radius: 12px; background: var(--card-solid);
  padding: 10px 12px; display: flex; gap: 8px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; }
.dv-row-main { min-width: 0; flex: 1 1 200px; }
.dv-name { display: flex; align-items: center; gap: 7px; border: none; background: transparent;
  padding: 0; cursor: pointer; color: var(--ink); font-size: 13.5px; font-weight: 600;
  font-family: inherit; text-align: left; max-width: 100%; }
.dv-name-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dv-ico { display: inline-flex; color: var(--brand-solid); flex: 0 0 auto; }
.dv-ico.is-file { color: var(--mut); }
.dv-meta { margin-top: 3px; font-size: 11px; color: var(--mut); line-height: 1.6; overflow-wrap: anywhere; }

/* 客户标记（KEJI-DRIVE-02）：未关联 / 已关联 / 不可用 三态用颜色分开。
   不可用必须是"警告色"而不是"普通灰"，否则会被当成"没关联"而反复去重设。 */
.dv-client { display: inline-block; margin-top: 5px; max-width: 100%; padding: 2px 8px; border-radius: 999px;
  font-size: 11px; line-height: 1.7; border: 1px solid var(--brand-line); background: var(--brand-soft);
  color: var(--brand-solid); overflow-wrap: anywhere; }
.dv-client.is-none { border-style: dashed; background: transparent; color: var(--faint); }
.dv-client.is-warn { border-color: var(--alert-line); background: var(--alert-wash); color: var(--ink); }

/* 按客户筛选：下拉与清除按钮一行放不下就换行，390px 不撑破容器。 */
.dv-filter { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dv-filter-label { font-size: 11.5px; color: var(--mid); }
.dv-filter select { max-width: 100%; min-width: 0; flex: 1 1 160px; border: 1px solid var(--brand-line);
  border-radius: 10px; padding: 6px 9px; font-size: 12px; font-family: inherit;
  background: var(--field-bg); color: var(--ink); }

.dv-form-empty { font-size: 12.5px; font-weight: 600; color: var(--ink); line-height: 1.7; overflow-wrap: anywhere; }
.dv-form-hint { margin-top: 4px; font-size: 11.5px; color: var(--mut); line-height: 1.7; overflow-wrap: anywhere; }
.dv-row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.dv-act { border: 1px solid var(--brand-line); background: var(--card); color: var(--mid);
  border-radius: 8px; padding: 5px 9px; font-size: 11.5px; cursor: pointer; font-family: inherit; }
.dv-act:hover { border-color: var(--brand-solid); color: var(--brand-solid); }
.dv-act.is-danger { color: var(--hot); border-color: var(--hot-line); }
.dv-act.is-danger:hover { color: var(--on-brand); background: var(--hot); border-color: transparent; }

.dv-form { border: 1px solid var(--brand-line); border-radius: 12px; background: var(--card); padding: 12px; }
.dv-form-title { font-size: 13.5px; font-weight: 700; color: var(--ink); margin-bottom: 8px; }
.dv-form-err { margin-bottom: 8px; padding: 7px 10px; border-radius: 9px; background: var(--hot-soft);
  color: var(--hot-deep); font-size: 11.5px; line-height: 1.6; overflow-wrap: anywhere; }
.dv-field { display: flex; flex-direction: column; gap: 4px; margin: 0; }
.dv-field > span { font-size: 11.5px; color: var(--mid); }
.dv-field input, .dv-field select { width: 100%; border: 1px solid var(--brand-line); border-radius: 10px;
  padding: 8px 10px; font-size: 13px; font-family: inherit; background: var(--field-bg); color: var(--ink); }
.dv-form-actions { display: flex; gap: 8px; margin-top: 10px; }

.dv-confirm { border: 1px solid var(--brand-line); border-radius: 12px; background: var(--card); padding: 11px 12px; }
.dv-confirm.is-danger { border-color: var(--hot-line-strong); background: var(--hot-wash); }
.dv-confirm-text { font-size: 12px; color: var(--ink); line-height: 1.7; overflow-wrap: anywhere; }
.dv-confirm-actions { display: flex; gap: 8px; margin-top: 9px; flex-wrap: wrap; }

.dv-empty { border: 1px dashed var(--brand-line); border-radius: 12px; padding: 22px 14px;
  text-align: center; font-size: 12.5px; color: var(--mid); line-height: 1.8; overflow-wrap: anywhere; }
.dv-empty-sub { margin-top: 5px; font-size: 11.5px; color: var(--mut); }
.dv-error { border: 1px solid var(--hot-line-strong); border-radius: 12px; background: var(--hot-soft);
  padding: 12px; font-size: 12.5px; color: var(--hot-deep); line-height: 1.7; overflow-wrap: anywhere; }
.dv-error-actions { margin-top: 9px; display: flex; gap: 8px; flex-wrap: wrap; }

@media (max-width: 520px) {
  .dv-head { flex-direction: column; align-items: stretch; }
  .dv-actions { justify-content: flex-start; }
  .dv-row { padding: 10px; }
  .dv-row-actions { width: 100%; }
  .dv-name-text { white-space: normal; overflow-wrap: anywhere; }
  .dv-filter { align-items: stretch; }
  .dv-filter select { flex: 1 1 100%; }
}

/* ===================== 知识入库（KEJI-DRIVE-03） =====================
   云盘文件 → AI 知识库。三处新增：
     .dv-kb-tag   行内状态（已加入 / 条目不可用 / 内容已变化）
     .dv-kb-note  不支持格式的说明（只在可写但不支持的文件上出现，不给假按钮）
     .dv-kb-*     预览弹层（分类 / 标题 / 字符数 / 前 2000 字 / 共享范围 / 明确确认）
   弹层用 fixed + max-height + 内部滚动，390px 下不横向溢出、不顶出屏幕。 */
.dv-kb-tag { display: inline-block; margin-top: 5px; margin-left: 6px; padding: 2px 8px; border-radius: 999px;
  font-size: 11px; line-height: 1.7; border: 1px solid var(--brand-line); background: var(--brand-soft);
  color: var(--brand-solid); overflow-wrap: anywhere; }
.dv-kb-tag.is-warn { border-color: var(--alert-line); background: var(--alert-wash); color: var(--ink); }
.dv-kb-note { display: inline-block; font-size: 11px; color: var(--faint); line-height: 1.7;
  border: 1px dashed var(--brand-line); border-radius: 8px; padding: 5px 9px; overflow-wrap: anywhere; }

.dv-kb-mask { position: fixed; inset: 0; z-index: 70; background: var(--scrim);
  display: flex; align-items: center; justify-content: center; padding: 16px; }
.dv-kb { width: min(560px, 100%); max-height: 88vh; overflow-y: auto; overscroll-behavior: contain;
  background: var(--card-solid); border: 1px solid var(--brand-line); border-radius: 14px;
  padding: 14px; display: flex; flex-direction: column; gap: 10px; box-shadow: var(--shadow); }
.dv-kb-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.dv-kb-file { font-size: 12.5px; color: var(--ink); line-height: 1.7; overflow-wrap: anywhere; }
.dv-kb-file b { font-weight: 600; }
.dv-kb-count { font-size: 11.5px; color: var(--mut); line-height: 1.7; overflow-wrap: anywhere; }
/* 正文预览：保留换行与缩进（pre-wrap），但长行必须能断，否则 390px 直接横向溢出 */
.dv-kb-preview { margin: 0; padding: 10px; border: 1px solid var(--brand-line); border-radius: 10px;
  background: var(--field-bg); color: var(--ink); font-size: 12px; line-height: 1.75;
  font-family: inherit; white-space: pre-wrap; overflow-wrap: anywhere;
  max-height: 190px; overflow-y: auto; overscroll-behavior: contain; }
.dv-kb-notice { border: 1px solid var(--brand-line); border-radius: 10px; background: var(--brand-soft);
  color: var(--mid); font-size: 11.5px; line-height: 1.8; padding: 9px 11px; overflow-wrap: anywhere; }
.dv-kb-notice b { color: var(--ink); }
.dv-kb-state { font-size: 11.5px; line-height: 1.75; color: var(--mid); overflow-wrap: anywhere; }
.dv-kb-state.is-warn { border: 1px solid var(--alert-line); border-left: 3px solid var(--alert-edge);
  border-radius: 10px; background: var(--alert-wash); color: var(--ink); padding: 8px 11px; }
.dv-kb-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* 390px：弹层铺满可用宽度、预览区更矮，按钮可换行；不产生横向滚动 */
@media (max-width: 520px) {
  .dv-kb-mask { padding: 10px; }
  .dv-kb { width: 100%; max-height: 92vh; padding: 12px; }
  .dv-kb-preview { max-height: 34vh; }
  .dv-kb-actions .dv-btn { flex: 1 1 auto; }
}

/* ===========================================================================
 * KEJI-DRIVE-04：文件分享（云盘行内入口 + 分享弹层）
 *   .dv-sh-mask   与知识弹层同款遮罩（fixed + z-index 70 + var(--scrim)）
 *   .dv-sh-*      一次性链接结果、已有分享清单、状态标签
 * 弹层内部用 flex + 内部滚动，390px 下不横向溢出、不顶出屏幕。
 * =========================================================================== */
.dv-sh-mask { position: fixed; inset: 0; z-index: 70; background: var(--scrim);
  display: flex; align-items: center; justify-content: center; padding: 16px; }

/* 一次性链接：创建成功后才有，是这个弹层里最该被立刻复制走的东西 */
.dv-sh-created { border: 1px solid var(--brand-line); border-radius: 10px; padding: 10px 11px;
  background: var(--brand-soft); display: flex; flex-direction: column; gap: 8px; }
.dv-sh-created-title { font-size: 11.5px; color: var(--ink); line-height: 1.8; overflow-wrap: anywhere; }
.dv-sh-created-title b { color: var(--brand-solid); }
/* 链接可能很长：必须能断行，否则 390px 会把整个弹层撑出横向滚动 */
.dv-sh-url { width: 100%; border: 1px solid var(--brand-line); border-radius: 8px; padding: 8px 9px;
  background: var(--field-bg); color: var(--ink); font-size: 11.5px; line-height: 1.7;
  font-family: inherit; overflow-wrap: anywhere; word-break: break-all; }
.dv-sh-created-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.dv-sh-created-tip { font-size: 11px; color: var(--mut); line-height: 1.7; overflow-wrap: anywhere; }

/* 已有分享清单：只显示状态 / 次数 / 过期时间，不显示任何链接 */
.dv-sh-list { display: flex; flex-direction: column; gap: 8px; }
.dv-sh-item { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px;
  border: 1px solid var(--brand-line); border-radius: 10px; padding: 9px 11px; background: var(--field-bg); }
.dv-sh-item-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1 1 auto; }
.dv-sh-status { display: inline-block; align-self: flex-start; padding: 1px 8px; border-radius: 999px;
  font-size: 11px; line-height: 1.7; border: 1px solid var(--brand-line); background: var(--brand-soft);
  color: var(--brand-solid); overflow-wrap: anywhere; }
.dv-sh-status.is-warn { border-color: var(--alert-line); background: var(--alert-wash); color: var(--ink); }
.dv-sh-meta { font-size: 11px; color: var(--mut); line-height: 1.7; overflow-wrap: anywhere; }
.dv-sh-empty { border: 1px dashed var(--brand-line); border-radius: 10px; padding: 10px 11px;
  font-size: 11.5px; color: var(--mut); line-height: 1.8; overflow-wrap: anywhere; }

/* 390px */
@media (max-width: 520px) {
  .dv-sh-mask { padding: 10px; }
  .dv-sh-item { flex-direction: column; align-items: stretch; }
  .dv-sh-created-actions .dv-btn { flex: 1 1 auto; }
}

/* ===========================================================================
 * KEJI-LEADS-02：渠道转化漏斗（只读统计卡 #leadAnalyticsCard）
 *   .la-toolbar / .la-field  时间与渠道筛选
 *   .la-kpi                  总览指标（线索 / 客户 / 商机 / 成交 / 合同额 / 实收 / ROI）
 *   .la-table                渠道表格（外层 .la-table-wrap 承担横向滚动，页面本身不溢出）
 *   .la-funnel               漏斗五步，条宽以第一步为基准
 *   .la-unattr               未归因分组（不参与渠道归因的那部分，必须能看见）
 * 规矩：颜色一律取自 :root token，这里不写任何硬编码色值。
 * 390px：工具栏换行、KPI 两列、表格内部横向滚动，页面不出现横向溢出。
 * =========================================================================== */
.la-toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 0; }
/* 全局 label 有 display:block + margin:10px 0 4px，这里必须压掉，否则工具栏被撑成两行 */
.la-field { display: flex; flex-direction: column; gap: 3px; margin: 0; min-width: 0; max-width: 100%; flex: 0 1 auto; }
.la-field > span { font-size: 11px; color: var(--mut); line-height: 1.4; }
.la-field input[type=date], .la-field select {
  border: 1px solid var(--card-bd); border-radius: 7px; padding: 6px 8px;
  font-size: 12.5px; font-family: inherit; background: var(--field-bg); color: var(--ink);
  max-width: 100%;
}
.la-field input[type=date]:focus, .la-field select:focus { outline: none; border-color: var(--brand-solid); }
.la-quick { margin-top: 8px; }
.la-quick .mini { margin-top: 0; }

/* —— 总览指标 —— */
.la-kpi { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 8px; margin: 10px 0; }
.la-kpi-item { border: 1px solid var(--brand-line); border-radius: 8px; padding: 8px 9px;
  background: var(--raise); min-width: 0; }
.la-kpi-k { font-size: 11px; color: var(--mut); line-height: 1.5; }
.la-kpi-v { font-size: 15px; font-weight: 600; color: var(--ink); margin-top: 2px;
  line-height: 1.5; overflow-wrap: anywhere; }
.la-kpi-s { font-size: 10.5px; color: var(--mut); margin-top: 2px;
  line-height: 1.6; overflow-wrap: anywhere; }

/* —— 渠道表格：滚动发生在 .la-table-wrap 内部 —— */
.la-table-wrap { margin: 10px 0; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.la-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.la-table th, .la-table td { padding: 6px 8px; border-bottom: 1px solid var(--brand-line);
  text-align: left; white-space: nowrap; }
.la-table th { font-weight: 500; color: var(--mut); font-size: 11px; background: var(--raise); }
.la-table td.num, .la-table th.num { text-align: right; }
/* 渠道名可能很长（后台自定义），这一列允许换行，其它列保持单行好对齐 */
.la-table .la-ch { white-space: normal; min-width: 72px; }
.la-table tfoot td { font-weight: 600; color: var(--ink); border-top: 1px solid var(--card-bd);
  border-bottom: none; background: var(--raise); }
/* 正向 / 负向：沿用文件里 --ok=成交正向、--hot=高风险 的语义，不新造颜色 */
.la-pos { color: var(--ok); }
.la-neg { color: var(--hot); }
.la-tag { display: inline-block; margin-left: 4px; padding: 0 6px; border-radius: 999px;
  font-size: 10px; line-height: 1.7; border: 1px solid var(--warm); color: var(--warm); }

/* —— 漏斗 —— */
.la-sub { font-size: 14px; margin: 14px 0 4px; color: var(--ink); }
.la-funnel { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.la-step { border: 1px solid var(--brand-line); border-radius: 8px; padding: 8px 10px;
  background: var(--raise); min-width: 0; }
.la-step-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.la-step-name { font-size: 12.5px; color: var(--ink); }
.la-step-num { font-size: 14px; font-weight: 600; color: var(--brand-solid); }
.la-step-bar { height: 6px; border-radius: 999px; background: var(--slate-soft);
  margin: 6px 0 5px; overflow: hidden; }
.la-step-bar > i { display: block; height: 100%; border-radius: 999px; background: var(--brand); }
.la-step-sub { font-size: 10.5px; color: var(--mut); line-height: 1.7; overflow-wrap: anywhere; }

/* —— 未归因 —— */
.la-unattr-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px; margin-top: 6px; }
.la-unattr-item { border: 1px dashed var(--brand-line); border-radius: 8px; padding: 8px 9px;
  background: var(--card-solid); min-width: 0; }
.la-unattr-k { font-size: 11px; color: var(--mut); line-height: 1.5; }
.la-unattr-v { font-size: 14px; font-weight: 600; color: var(--warm); margin-top: 2px;
  line-height: 1.5; overflow-wrap: anywhere; }
.la-unattr-s { font-size: 10.5px; color: var(--mut); margin-top: 2px;
  line-height: 1.6; overflow-wrap: anywhere; }

/* 390px（≤520px 同档）：筛选换行、KPI 两列、未归因单列，表格在容器内滚动 */
@media (max-width: 520px) {
  .la-toolbar { gap: 6px; }
  .la-field { flex: 1 1 44%; }
  .la-field input[type=date], .la-field select { width: 100%; }
  .la-kpi { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .la-unattr-list { grid-template-columns: minmax(0, 1fr); }
  .la-table { font-size: 11.5px; }
  .la-table th, .la-table td { padding: 5px 6px; }
}

/* ============================================================
   存储与云盘配额（KEJI-DRIVE-05）· .adm-quota-*
   后台「存储与设置」页里的真实存储状态 + 管理员配额台账。
   红线：不隐藏真实数字、不放大到撑破容器、超限必须一眼看见。
   宽屏三列（成员 / 用量 / 编辑）；窄到放不下时**自动**折成一列 ——
   用 flex 的换行能力实现，而不是再加一个 @media 块：
   手机端 640px 媒体查询区是既有冻结区（dom-desktop-admin-pages 第 13 项逐字节比对），
   新增 UI 不该往里塞，否则那条快照断言就再也说明不了"移动端没被动过"。
   ============================================================ */
.adm-storage-status { margin-top: 10px; }
.adm-quota-status-row { margin-bottom: 8px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.adm-quota-tag { display: inline-block; font-size: 11.5px; line-height: 1.6; padding: 1px 8px;
  border-radius: 999px; background: var(--brand-line); color: var(--brand-solid); }
.adm-quota-tag.is-warn { background: var(--warm-soft); color: var(--warm); }
.adm-quota-note { font-size: 11.5px; color: var(--mut); overflow-wrap: anywhere; }
.adm-quota-bar { height: 7px; border-radius: 999px; background: var(--slate-soft); overflow: hidden; }
.adm-quota-bar > i { display: block; height: 100%; border-radius: 999px; background: var(--brand); }
.adm-quota-bar.is-over > i { background: var(--hot); }
.adm-quota-status-line { font-size: 12.5px; color: var(--ink); margin-top: 6px; overflow-wrap: anywhere; }
.adm-quota-status-line.is-sub { color: var(--mut); font-size: 11.5px; }
.adm-quota-warn { display: block; margin-top: 8px; padding: 7px 10px; border-radius: 8px;
  background: var(--hot-soft); color: var(--hot); font-size: 12.5px; line-height: 1.6;
  overflow-wrap: anywhere; }

.adm-quota { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--brand-line); }
.adm-quota.hidden { display: none; }
.adm-quota-head h3 { font-size: 14px; color: var(--ink); }
.adm-quota-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; margin-top: 8px; }
.adm-quota-row { display: flex; flex-wrap: wrap;
  gap: 10px; align-items: start; padding: 10px 11px; border: 1px solid var(--brand-line);
  border-radius: 10px; background: var(--card-solid); min-width: 0; }
.adm-quota-row.is-over { border-color: var(--hot-line); background: var(--hot-wash); }
.adm-quota-cell { flex: 1 1 200px; min-width: 0; }
.adm-quota-cell.is-flag { flex: 1 1 100%; }
.adm-quota-name { font-size: 13px; font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.adm-quota-sub { font-size: 11px; color: var(--mut); line-height: 1.7; margin-top: 3px; overflow-wrap: anywhere; }
.adm-quota-field { display: flex; align-items: center; gap: 6px; margin: 0; }
.adm-quota-field > span { font-size: 11px; color: var(--mut); white-space: nowrap; }
.adm-quota-input { width: 100%; min-width: 0; max-width: 140px; padding: 5px 7px; font-size: 12.5px;
  border: 1px solid var(--brand-line); border-radius: 7px; background: var(--raise); color: var(--ink); }
.adm-quota-actions { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.adm-quota-msgwrap { margin-top: 10px; }
.adm-quota-msg { display: inline-block; font-size: 12.5px; line-height: 1.7; overflow-wrap: anywhere; }
.adm-quota-msg.is-ok { color: var(--brand-solid); }
.adm-quota-msg.is-warn { color: var(--warm); }
.adm-quota-msg.is-err { color: var(--hot); }
