/* ============================================================================
 * 姚明织带 SCRM —— 全站唯一样式表
 *
 * 以前是三份：management.css（6 个后台页）、style.css（侧边栏）、以及若干页
 * 完全没链样式表只靠内联。同一批类名在几处各写一遍，逐渐走偏 —— 最典型的是
 * `.kb-*` 这一族：kb.html / material.html 各自内联了一份，moment.html 里压根
 * 没定义，用到的按钮和输入框一直是裸的。合并成一份之后这类问题不会再发生。
 *
 * 三种「密度」共用同一套令牌，靠 body 上的作用域类区分：
 *   .ui-admin   后台桌面（/、/kb、/moment、/guide、/material、/login）—— 紧凑
 *   .ui-mobile  侧边栏 /-/sidebar 与员工端、对外分享页              —— 宽松
 * 令牌（颜色、圆角、阴影、字号、动效）两边完全一致，只有尺寸和留白不同。
 *
 * 暗色只覆盖令牌，组件一律用 var()，所以不再需要以前那几十条
 * `html[data-theme="dark"] .某个类 { 硬编码色 }` 的补丁。
 * ========================================================================== */

/* ==========================================================================
 * 1. 设计令牌
 * ======================================================================== */

:root {
  /* ---- 主色：靛蓝。以前是 Ant 默认蓝 #1677ff，放在一堆后台里没有任何辨识度，
     也和「企微」自带的蓝撞在一起分不清哪个是系统哪个是应用。 ---- */
  --primary: #4f46e5;
  --primary-hover: #6366f1;
  --primary-active: #4338ca;
  --primary-light: #eef0ff;   /* 选中项底色 */
  --primary-soft: #f7f8ff;    /* 悬停底色，比选中更淡 */
  --primary-border: #c9cdfb;
  /* 主按钮/激活页签的渐变面。单独做成令牌，暗色才能跟着换 */
  --primary-grad: linear-gradient(180deg, #5f56ef 0%, #4f46e5 100%);

  /* ---- 中性灰阶。组件不再直接写 #f0f0f0 这类散值，一律取这里的档位，
     改一处全局跟着走。 ---- */
  --gray-50: #f5f7fb;
  --gray-100: #eef1f7;
  --gray-200: #e7eaf1;
  --gray-300: #d6dbe5;
  --gray-400: #a7aebd;
  --gray-500: #7b8394;
  --gray-600: #5a6273;
  --gray-700: #3f4653;
  --gray-800: #272c36;
  --gray-900: #16191f;

  /* ---- 语义别名：组件只认这一层，不认上面的灰阶编号 ---- */
  --text: #1f2430;
  --text-sub: #6b7385;
  --text-mute: #9aa1b1;
  --bg: var(--gray-50);
  --bg-hover: var(--gray-100);
  --card: #ffffff;
  --border: #e9ecf3;
  --border-strong: #d8dde8;
  /* 页面背景那一层极淡的主色晕染。纯平灰看着像表格软件，加一层几乎看不见的
     光晕，白卡片才有「浮起来」的感觉 */
  --bg-glow: radial-gradient(1100px 380px at 100% -8%, rgba(79, 70, 229, .055), transparent 72%);

  /* ---- 状态色：**每档一对「底 / 字」**。这是干掉暗色补丁的关键 ——
     组件写 `background: var(--warn-bg); color: var(--warn-fg)` 一条规则
     就同时管亮暗两套，不像以前要在文件末尾为每个类各补一条深色规则。 ---- */
  --ok-bg: #e7f6f0;
  --ok-fg: #0f6e56;
  --warn-bg: #fff6e5;
  --warn-fg: #a35c00;
  --bad-bg: #fdecec;
  --bad-fg: #b3261e;
  --mute-bg: var(--gray-100);
  --mute-fg: #6b7385;

  --danger: #e5484d;
  --danger-hover: #d13b40;
  --success: #0f9d70;
  --warning: #d98800;
  --info: var(--primary);

  /* ---- 别名：几页内联各自起过一套短名字（my-material 的 --line/--sub/--ok、
     material-read 的 --accent/--accent-soft），语义和上面完全一样。
     留着这几个别名，那些页去掉自己的 :root 后不会有一堆 var() 变成空值。 ---- */
  --line: var(--border);
  --sub: var(--text-sub);
  --ok: var(--success);
  --accent: var(--primary);
  --accent-soft: var(--primary-light);

  /* ---- 形状。原来 3/5/6/8/9/12 六种圆角混着用，收敛成四档 ---- */
  --radius-xs: 7px;    /* 小徽标、chip */
  --radius-sm: 9px;    /* 按钮、输入框 */
  --radius: 14px;      /* 卡片 */
  --radius-lg: 18px;   /* 弹层 */
  --radius-full: 999px;

  /* ---- 阴影三阶：静止 / 悬停抬起 / 浮层。以前只有两阶且几乎看不见，
     卡片之间全靠描边分界，整页密密麻麻一片线。 ---- */
  --shadow-1: 0 1px 2px rgba(16, 24, 40, .035), 0 4px 12px -6px rgba(16, 24, 40, .08);
  --shadow-2: 0 6px 20px -6px rgba(16, 24, 40, .14), 0 2px 6px -2px rgba(16, 24, 40, .06);
  --shadow-3: 0 24px 56px -16px rgba(16, 24, 40, .26), 0 10px 22px -12px rgba(16, 24, 40, .14);

  /* 键盘焦点环。以前全站没有焦点态，用 Tab 走一遍完全看不出停在哪。 */
  --ring: 0 0 0 3px rgba(79, 70, 229, .20);

  /* ---- 字号阶梯。原来 11.5 / 12 / 12.5 / 13 / 13.5 / 16 / 22 七种，
     没有规律也没法复用。 ---- */
  --fs-xs: 12px;
  --fs-sm: 13px;
  --fs-base: 14px;
  --fs-md: 15px;
  --fs-lg: 16px;
  --fs-xl: 20px;
  --fs-2xl: 26px;

  /* ---- 动效：统一时长与缓动，全站过渡手感一致 ---- */
  --ease: cubic-bezier(.4, 0, .2, 1);
  --dur: .16s;
  --t: all var(--dur) var(--ease);

  /* 2026-10-27：中文统一用微软雅黑 —— 每台 Windows 自带，全公司一致，
     不依赖字体文件下载。Mac 走苹方，两者字形都接近，混用看不出。 */
  --font: "Microsoft YaHei", "PingFang SC", "Segoe UI",
          -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
}

/* 暗色只覆盖令牌。硬编码色一条都不留 —— 旧文件末尾那 30 多条
   `html[data-theme="dark"] .xxx` 补丁因此全部消失。 */
html[data-theme="dark"] {
  color-scheme: dark;

  --primary: #8b93ff;
  --primary-hover: #a3a9ff;
  --primary-active: #727aff;
  --primary-light: #1d2044;
  --primary-soft: #171a2e;
  --primary-border: #343a72;
  --primary-grad: linear-gradient(180deg, #9aa1ff 0%, #8b93ff 100%);
  --bg-glow: radial-gradient(1100px 380px at 100% -8%, rgba(139, 147, 255, .07), transparent 72%);

  --text: rgba(255, 255, 255, .92);
  --text-sub: rgba(255, 255, 255, .55);
  --text-mute: rgba(255, 255, 255, .36);
  --bg: #0d0f14;
  --bg-hover: #171a22;
  --card: #14171e;
  --border: #242935;
  --border-strong: #343b4a;

  --ok-bg: #10241c;
  --ok-fg: #4ecfa0;
  --warn-bg: #2a2110;
  --warn-fg: #f0b429;
  --bad-bg: #2a1618;
  --bad-fg: #ff8a87;
  --mute-bg: #1b1f28;
  --mute-fg: rgba(255, 255, 255, .5);

  --danger: #ff7b78;
  --danger-hover: #ff9491;
  --success: #4ecfa0;
  --warning: #f0b429;

  --shadow-1: 0 1px 2px rgba(0, 0, 0, .5);
  --shadow-2: 0 4px 16px -4px rgba(0, 0, 0, .6);
  --shadow-3: 0 24px 48px -16px rgba(0, 0, 0, .72);
  --ring: 0 0 0 3px rgba(139, 147, 255, .26);
}

/* ==========================================================================
 * 2. 基础
 * ======================================================================== */

*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  /* 移动端点击时浏览器会闪一层灰蓝高亮框，侧边栏里点什么都闪一下很脏。
     全局关掉，交互反馈全部交给 :active / :hover 自己做。 */
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font);
  font-size: var(--fs-base);
  line-height: 1.6;
  color: var(--text);
  background-color: var(--bg);
  background-image: var(--bg-glow);
  background-repeat: no-repeat;
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* 后台页整页不滚动，滚动交给 .pane；侧边栏和员工端则照常整页滚。
   以前这条写在 body 上，所以侧边栏页也被锁了高度 —— 现在按作用域分开。 */
body.ui-admin {
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

body.ui-mobile {
  min-height: 100vh;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  font-size: var(--fs-sm);
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  color: var(--primary-hover);
}

/* 键盘焦点：只有键盘操作才出环，鼠标点不出 —— 否则每个按钮点下去都留一圈。 */
:focus-visible {
  outline: none;
  box-shadow: var(--ring);
  border-radius: var(--radius-xs);
}

::selection {
  background: var(--primary-light);
  color: var(--primary-active);
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 5px;
  border: 2px solid transparent;
  background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-mute);
  border: 2px solid transparent;
  background-clip: content-box;
}

::-webkit-scrollbar-track {
  background: transparent;
}

.hidden {
  display: none !important;
}

.text-sub {
  color: var(--text-sub);
}

/* ==========================================================================
 * 3. 后台骨架
 * ======================================================================== */

/* 顶栏：比内容区略高一点，压一条极浅投影而不是硬边框 —— 滚动时内容和顶栏
   有层次，静止时不显脏。半透明 + 模糊，pane 滚到下面时边角会透一点色。 */
.topbar {
  background: var(--card);
  background: color-mix(in srgb, var(--card) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 2px rgba(16, 24, 40, .03);
  padding: 0 24px;
  height: 58px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

.topbar .logo {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: .01em;
  display: flex;
  align-items: center;
  gap: 9px;
}

/* 品牌圆点：纯装饰，给顶栏一个视线落点，不用图省一次请求 */
.topbar .logo::before {
  content: '';
  width: 24px;
  height: 24px;
  border-radius: 8px;
  background: linear-gradient(140deg, #6d63f2 0%, #4f46e5 55%, #7c5cf5 100%);
  box-shadow: 0 3px 8px -2px rgba(79, 70, 229, .5), inset 0 1px 0 rgba(255, 255, 255, .28);
}

.topbar .hint {
  font-size: var(--fs-xs);
  color: var(--text-sub);
}

.app-shell {
  flex: 1;
  display: flex;
  min-height: 0;
}

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

/* pane 隐藏必须彻底退出布局，否则两个 pane 的 flex:1 会各占一半高度 */
.pane {
  flex: 1;
  overflow: auto;
  min-height: 0;
  padding: 26px 30px 52px;
}

.pane.hidden {
  display: none;
}

/* ---------- 左侧菜单（由 nav.js 注入 .side-nav） ----------
   DOM 顺序是「内容在前、菜单在后」，靠 order:-1 把菜单翻到左边，
   这样不用动 DOM，也就不影响既有 JS 依赖的层级（.side-lv1 的父级必须是 .side-group）。 */
.side-nav {
  order: -1;
  width: 236px;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  background: var(--card);
  overflow-y: auto;
  padding: 12px 0;
}

.side-group {
  padding: 0;
}

/* 组之间一条极淡的分隔，比以前的实线轻，不割裂整列 */
.side-group + .side-group {
  border-top: 1px solid var(--border);
  margin-top: 6px;
  padding-top: 6px;
}

/* 一级：组标题。降一档字号、小写间距，和下面的条目拉开层级。
   2026-10-28 参照参考图「Finance」那种字：常规字重、字距收紧、字形干净，
   原来的 600 + .06em 在中文上被合成为粗体且散，看着笨重。
   拉丁字符先走 Segoe UI / Inter（与参考图同族），中文回退微软雅黑。 */
.side-lv1 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 11px 20px 6px;
  background: none;
  border: 0;
  cursor: pointer;
  font-family: "Inter", "Segoe UI", var(--font);
  /* 照参考图 Home / Messages / Integrations / Finance：字明显比子项大一号、
     中等偏粗、字距不散 —— 一级与子项的层级靠这两点拉开。 */
  font-size: var(--fs-lg);
  font-weight: 600;
  letter-spacing: 0;
  color: var(--text);
  text-align: left;
  line-height: 1.4;
  transition: color var(--dur) var(--ease);
}

.side-lv1:hover {
  color: var(--primary);
}

.side-lv1 .caret {
  font-size: 11px;
  transition: transform var(--dur) var(--ease);
}

.side-group.open .side-lv1 .caret {
  transform: rotate(180deg);
}

.side-sub {
  max-height: 0;
  overflow: hidden;
  transition: max-height .2s var(--ease);
}

.side-group.open .side-sub {
  max-height: 360px;
}

/* 条目：当前项给浅靛蓝底 + 左侧一条主色指示条。以前只有个浅蓝底，
   一屏里几个浅色块挨着，扫一眼分不出哪个是「当前位置」。 */
.side-sub a {
  position: relative;
  display: block;
  margin: 2px 10px;
  padding: 9px 12px 9px 26px;
  border-radius: var(--radius-sm);
  font-size: var(--fs-md);
  font-weight: 400;
  line-height: 1.5;
  color: var(--text-sub);
  text-decoration: none;
  cursor: pointer;
  transition: var(--t);
}

.side-sub a:hover {
  background: var(--bg-hover);
  color: var(--text);
}

.side-sub a.active {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}

.side-sub a.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 15px;
  border-radius: 0 3px 3px 0;
  background: var(--primary);
}

.side-sub .badge {
  float: right;
  min-width: 16px;
  text-align: center;
  padding: 0 5px;
  border-radius: var(--radius-full);
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
}

/* ==========================================================================
 * 4. 按钮
 *    两个别名：.btn（后台）与 .kb-btn（知识库/朋友圈那几页历史写法）。
 *    以前它们各定义各的，长得也不一样；现在共用同一套规则。
 * ======================================================================== */

.btn,
.kb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 35px;
  padding: 0 16px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--text);
  font-family: inherit;
  font-size: var(--fs-sm);
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 1px 1px rgba(16, 24, 40, .03);
  transition: var(--t);
}

.btn:hover,
.kb-btn:hover {
  border-color: var(--primary-border);
  background: var(--primary-soft);
  color: var(--primary);
}

.btn:active,
.kb-btn:active {
  transform: translateY(1px);
}

.btn:disabled,
.kb-btn:disabled {
  opacity: .45;
  cursor: not-allowed;
  transform: none;
}

.btn:disabled:hover,
.kb-btn:disabled:hover {
  border-color: var(--border-strong);
  background: var(--card);
  color: var(--text);
}

/* 主按钮：渐变面 + 内高光 + 主色投影，比纯色块有厚度，但还是一条规则管亮暗 */
.btn.primary,
.btn.btn-primary,
.kb-btn.primary {
  background: var(--primary-grad);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 2px 6px -2px rgba(79, 70, 229, .5), inset 0 1px 0 rgba(255, 255, 255, .18);
}

.btn.primary:hover,
.btn.btn-primary:hover,
.kb-btn.primary:hover {
  background: var(--primary-grad);
  background-image: linear-gradient(180deg, var(--primary-hover) 0%, var(--primary) 100%);
  border-color: var(--primary-hover);
  color: #fff;
  box-shadow: 0 4px 12px -3px rgba(79, 70, 229, .55), inset 0 1px 0 rgba(255, 255, 255, .2);
}

.btn.primary:disabled:hover,
.kb-btn.primary:disabled:hover {
  background: var(--primary-grad);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 2px 6px -2px rgba(79, 70, 229, .5);
}

/* 暗色里主色是浅靛蓝，白字对比度不够，改深色字 */
html[data-theme="dark"] .btn.primary,
html[data-theme="dark"] .btn.btn-primary,
html[data-theme="dark"] .kb-btn.primary,
html[data-theme="dark"] .kb-tab.active {
  color: #11142a;
}

.btn.danger {
  color: var(--danger);
  border-color: var(--border-strong);
}

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

.btn.danger:disabled:hover {
  background: var(--card);
  border-color: var(--border-strong);
  color: var(--danger);
}

/* 幽灵按钮：无边无底，只在悬停时浮出底色 —— 表格行内的次要动作用它，
   免得一行里三个描边按钮把表格搅乱。 */
.btn.ghost,
.kb-btn.ghost {
  border-color: transparent;
  background: none;
}

.btn.ghost:hover,
.kb-btn.ghost:hover {
  background: var(--bg-hover);
  border-color: transparent;
  color: var(--text);
}

.btn.sm,
.kb-btn.sm {
  height: 28px;
  padding: 0 11px;
  font-size: var(--fs-xs);
}

.btn.block {
  width: 100%;
}

/* ==========================================================================
 * 5. 表单控件
 * ======================================================================== */

.kb-input,
.kb-select,
.kb-textarea,
.input,
.select {
  height: 35px;
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--text);
  font-family: inherit;
  font-size: var(--fs-sm);
  outline: none;
  transition: var(--t);
}

.kb-textarea,
textarea.kb-textarea {
  width: 100%;
  height: auto;
  min-height: 92px;
  padding: 9px 12px;
  line-height: 1.6;
  resize: vertical;
}

.kb-select,
select.kb-select {
  padding-right: 32px;
  cursor: pointer;
  appearance: none;
  /* 自绘箭头，省掉一张图；原来用系统默认箭头，各浏览器长短不一 */
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5 6 8l3.5-3.5' fill='none' stroke='%237b8394' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
}

.kb-input:hover,
.kb-select:hover,
.kb-textarea:hover {
  border-color: var(--text-mute);
}

.kb-input:focus,
.kb-select:focus,
.kb-textarea:focus,
.input:focus,
.select:focus {
  border-color: var(--primary);
  box-shadow: var(--ring);
}

.kb-input::placeholder,
.kb-textarea::placeholder {
  color: var(--text-mute);
}

.kb-input:disabled,
.kb-select:disabled,
.kb-btn:disabled,
.btn:disabled {
  opacity: .5;
  cursor: not-allowed;
}

/* 弹窗内的原生控件（各页直接写 <input>/<select>，没有类） */
.modal input,
.modal select,
.modal textarea {
  width: 100%;
  height: 35px;
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--text);
  font-family: inherit;
  font-size: var(--fs-sm);
  outline: none;
  transition: var(--t);
}

.modal textarea {
  height: auto;
  min-height: 84px;
  padding: 9px 12px;
  line-height: 1.6;
  resize: vertical;
}

.modal input:focus,
.modal select:focus,
.modal textarea:focus {
  border-color: var(--primary);
  box-shadow: var(--ring);
}

/* ==========================================================================
 * 6. 卡片
 * ======================================================================== */

.kb-card,
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow-1);
  /* 卡片几乎总是竖着摞的，不靠各自的 margin 就会贴在一起 */
  margin-bottom: 16px;
}

/* 页头标题：左侧一道短主色竖条，给每页一个固定的视觉起点 */
.kb-h,
h2.kb-h {
  font-size: var(--fs-xl);
  font-weight: 700;
  letter-spacing: -.015em;
  line-height: 1.35;
  margin-bottom: 18px;
  padding-left: 13px;
  border-left: 3px solid var(--primary);
  border-radius: 2px;
  color: var(--text);
}

/* 工具条：搜索框 + 筛选 + 操作按钮排一行 */
.kb-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.kb-bar .spacer {
  flex: 1;
}

/* 指标数字条 */
.kb-metrics {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.kb-metric {
  flex: 1 1 132px;
  background: var(--card);
  border: 1px solid var(--border);
  border-top: 2px solid var(--primary-border);
  border-radius: var(--radius);
  padding: 15px 17px;
  box-shadow: var(--shadow-1);
  transition: var(--t);
}

.kb-metric:hover {
  border-color: var(--primary-border);
  box-shadow: var(--shadow-2);
  transform: translateY(-1px);
}

/* 页面里两种写法都用过：kb/moment 写 .v，早前那份写 .n，都认 */
.kb-metric .v,
.kb-metric .n {
  font-size: var(--fs-2xl);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
  margin-top: 2px;
}

.kb-metric .v small {
  font-size: var(--fs-sm);
  font-weight: 400;
  color: var(--text-sub);
}

.kb-metric .k {
  font-size: var(--fs-xs);
  color: var(--text-sub);
  margin-top: 4px;
}

/* ---------- 标签页 ---------- */
.kb-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.kb-tab {
  padding: 7px 16px;
  border: 1px solid transparent;
  border-radius: var(--radius-full);
  background: var(--bg-hover);
  color: var(--text-sub);
  font-family: inherit;
  font-size: var(--fs-sm);
  cursor: pointer;
  transition: var(--t);
}

.kb-tab:hover {
  border-color: var(--primary-border);
  background: var(--primary-soft);
  color: var(--primary);
}

.kb-tab.active {
  background: var(--primary-grad);
  border-color: var(--primary);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 6px -2px rgba(79, 70, 229, .5);
}

.kb-empty {
  color: var(--text-sub);
  font-size: var(--fs-base);
  padding: 32px 0;
  text-align: center;
}

/* 表格里几个语义列，各页都用同一套 */
table.kb-table td.num,
table.mm-table td.num {
  white-space: nowrap;
  color: var(--text-sub);
  font-variant-numeric: tabular-nums;
}

table.kb-table .cls,
table.mm-table td.nowrap {
  white-space: nowrap;
}

table.kb-table .ans {
  color: var(--text-sub);
  max-width: 380px;
}

table.mm-table td.sum {
  font-weight: 600;
}

.kb-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

/* ==========================================================================
 * 7. 表格
 * ======================================================================== */

table.mm-table,
table.kb-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  font-size: var(--fs-sm);
}

table.mm-table th,
table.kb-table th {
  text-align: left;
  font-weight: 600;
  font-size: var(--fs-xs);
  letter-spacing: .05em;
  color: var(--text-mute);
  background: var(--gray-50);
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  vertical-align: middle;
  line-height: 1.5;
}

html[data-theme="dark"] table.mm-table th,
html[data-theme="dark"] table.kb-table th {
  background: var(--bg-hover);
}

table.mm-table td,
table.kb-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  line-height: 1.6;
}

table.mm-table tbody tr:last-child td,
table.kb-table tbody tr:last-child td {
  border-bottom: 0;
}

table.mm-table tbody tr,
table.kb-table tbody tr {
  transition: background var(--dur) var(--ease);
}

table.mm-table tbody tr:hover td,
table.kb-table tbody tr:hover td {
  background: var(--primary-soft);
}

table.mm-table th.act,
table.mm-table td.act,
table.kb-table th.act,
table.kb-table td.act {
  text-align: right;
  white-space: nowrap;
}

/* 表格行内的操作按钮：表格本来就密，按钮跟着收一档，
   不然一行被按钮撑高，几行下来表就散了。 */
table.mm-table td.act .kb-btn,
table.mm-table td.act .btn,
table.kb-table td.act .kb-btn,
table.kb-table td.act .btn {
  height: 26px;
  padding: 0 9px;
  font-size: var(--fs-xs);
  margin: 2px 0 2px 6px;
}

/* ==========================================================================
 * 8. 徽标 / 胶囊 / 状态
 * ======================================================================== */

.tag-chip {
  display: inline-block;
  font-size: var(--fs-xs);
  line-height: 1.7;
  color: var(--primary);
  background: var(--primary-light);
  border-radius: var(--radius-xs);
  padding: 0 8px;
  margin: 2px 4px 2px 0;
}

.kb-tag {
  display: inline-block;
  font-size: var(--fs-xs);
  line-height: 1.7;
  padding: 0 7px;
  border-radius: var(--radius-xs);
  background: var(--mute-bg);
  color: var(--mute-fg);
  margin-right: 4px;
  white-space: nowrap;
}

.kb-tag.sim {
  background: var(--primary-light);
  color: var(--primary);
  cursor: pointer;
}

/* LLM 已核分徽标：走「成功」色系（沿用本页成功徽标的 --ok-bg/--ok-fg 一对），
   与 .kb-tag.sim 的紫底明显区分，观感稳定。不是可点元素，故不加 cursor:pointer，
   也不与危险红沾边。 */
.kb-tag.llm {
  background: var(--ok-bg);
  color: var(--ok-fg);
  font-weight: 600;
}

/* 「对比话术管理过滤」预览面板。原生 <details> 做折叠，零 JS 依赖 ——
   桶多的时候一屏放不下，默认全展开会让操作按钮被顶到屏幕外。 */
.al-bucket {
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  margin: 6px 0;
  padding: 0 10px;
}
.al-bucket > summary {
  cursor: pointer;
  padding: 7px 0;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-sm);
  list-style: none;
}
.al-bucket > summary::-webkit-details-marker { display: none; }
.al-bucket > summary::before {
  content: '▸';
  color: var(--text-sub);
  transition: transform .15s;
}
.al-bucket[open] > summary::before { transform: rotate(90deg); }
.al-count {
  font-weight: 600;
  color: var(--text);
}
.al-act {
  color: var(--text-sub);
  font-size: var(--fs-xs);
  margin-left: auto;
}
.al-sample {
  font-size: var(--fs-xs);
  color: var(--text-sub);
  padding: 4px 0 4px 18px;
  border-top: 1px dashed var(--border);
  overflow-wrap: anywhere;
}
.al-arrow {
  color: var(--primary);
  margin: 0 4px;
}

/* ==========================================================================
 * 批量审核。选中栏在筛选栏和列表之间，没选中时整条 hidden ——
 * 常驻一条灰条会让人以为「这里随时能点」，点了才发现没选东西。
 * ======================================================================== */

.kb-selbar {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--primary-soft);
  border: 1px solid var(--primary-border);
  border-radius: var(--radius-xs);
  padding: 6px 10px;
  margin: 8px 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .06);
}

.kb-sel-count {
  font-size: var(--fs-sm);
  color: var(--text);
}
.kb-sel-count strong {
  color: var(--primary);
  font-size: 1.05em;
  margin: 0 2px;
}

/* 复选框列：窄，表头那个也不能跟着排序抖动 */
table.kb-table th.ck,
table.kb-table td.ck {
  width: 28px;
  text-align: center;
  padding-left: 6px;
  padding-right: 0;
}
table.kb-table th.ck input,
table.kb-table td.ck input {
  cursor: pointer;
  accent-color: var(--primary);
  width: 15px;
  height: 15px;
  vertical-align: middle;
}

/* 已选中的行给个底色，翻页回来一眼能认出哪几条还勾着 */
table.kb-table tbody tr.crawl-on {
  background: var(--primary-light);
}
table.kb-table tbody tr.crawl-on:hover {
  background: var(--primary-light);
}

.kb-badge {
  display: inline-block;
  padding: 0 6px;
  margin-right: 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: var(--bg);
  font-size: var(--fs-xs);
  color: var(--text-sub);
}

/* 用量胶囊：0 就淡成灰，免得表格里排出一串没有意义的 0 */
.dept-pill {
  display: inline-block;
  min-width: 24px;
  padding: 1px 8px;
  border-radius: var(--radius-full);
  background: var(--mute-bg);
  color: var(--mute-fg);
  font-size: var(--fs-xs);
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.dept-pill.on {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}

.dept-none {
  color: var(--text-sub);
  font-size: var(--fs-xs);
}

/* 状态徽标：全部走令牌，亮暗两套共用一条规则。
   以前这里有 4 组 `html[data-theme="dark"] .st-xxx` 补丁。 */
.st-scheduled,
.st-pending {
  display: inline-block;
  padding: 2px 9px;
  border-radius: var(--radius-full);
  font-size: var(--fs-xs);
  font-weight: 600;
  background: var(--warn-bg);
  color: var(--warn-fg);
}

.st-sent,
.st-approved {
  display: inline-block;
  padding: 2px 9px;
  border-radius: var(--radius-full);
  font-size: var(--fs-xs);
  font-weight: 600;
  background: var(--ok-bg);
  color: var(--ok-fg);
}

.st-draft,
.st-unsent,
.st-stale {
  display: inline-block;
  padding: 2px 9px;
  border-radius: var(--radius-full);
  font-size: var(--fs-xs);
  font-weight: 600;
  background: var(--mute-bg);
  color: var(--mute-fg);
}

.st-void,
.st-invalid,
.st-rejected {
  display: inline-block;
  padding: 2px 9px;
  border-radius: var(--radius-full);
  font-size: var(--fs-xs);
  font-weight: 600;
  background: var(--bad-bg);
  color: var(--bad-fg);
}

/* ==========================================================================
 * 9. 提示条
 * ======================================================================== */

.notice {
  background: var(--warn-bg);
  border: 1px solid transparent;
  color: var(--warn-fg);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: var(--fs-sm);
  line-height: 1.7;
  margin-bottom: 14px;
}

.notice.ok {
  background: var(--ok-bg);
  color: var(--ok-fg);
}

.notice.err {
  background: var(--bad-bg);
  color: var(--bad-fg);
}

/* 侧边栏顶部的鉴权横幅（index.html） */
.banner {
  padding: 9px 14px;
  font-size: var(--fs-xs);
  background: var(--warn-bg);
  color: var(--warn-fg);
  border-bottom: 1px solid var(--border);
  display: none;
}

.banner.show {
  display: block;
}

.banner.ok {
  background: var(--ok-bg);
  color: var(--ok-fg);
}

.banner.err {
  background: var(--bad-bg);
  color: var(--bad-fg);
}

/* ==========================================================================
 * 10. 弹层 / 抽屉
 * ======================================================================== */

.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  animation: mask-in .18s var(--ease);
}

.modal {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 26px;
  width: 440px;
  max-width: 92vw;
  box-shadow: var(--shadow-3);
  animation: pop-in .2s var(--ease);
}

@keyframes mask-in {
  from { opacity: 0; }
}

@keyframes pop-in {
  from { opacity: 0; transform: translateY(8px) scale(.985); }
}

.modal h3 {
  font-size: var(--fs-lg);
  font-weight: 700;
  margin-bottom: 16px;
}

.modal .form-row {
  margin-bottom: 14px;
  font-size: var(--fs-sm);
  color: var(--text-sub);
  line-height: 1.8;
}

.modal .form-row label {
  display: block;
  font-size: var(--fs-sm);
  color: var(--text);
  font-weight: 500;
  margin-bottom: 6px;
}

.modal .modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

/* 并发编辑冲突提示（弹层内，kb-app.js / moment-app.js 共用）
   服务端用乐观锁拦下「别人已经改过」的保存，拒绝时把最新一行带回来。
   这块提示负责说清「被谁改过」，并把用户那份没存上的输入留在下面。 */
.cf-box {
  margin: 0 0 14px;
  padding: 13px 15px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--danger);
  border-radius: var(--radius-sm);
  background: var(--bad-bg);
}

.cf-box .cf-head {
  color: var(--bad-fg);
  font-size: var(--fs-sm);
  font-weight: 600;
  line-height: 1.45;
}

.cf-box .cf-sub {
  margin-top: 5px;
  color: var(--text-sub);
  font-size: var(--fs-xs);
  line-height: 1.55;
}

.cf-box .cf-list {
  margin-top: 10px;
  border-top: 1px dashed var(--border);
  padding-top: 4px;
}

.cf-box .cf-row {
  padding: 7px 0;
  font-size: var(--fs-xs);
  line-height: 1.6;
}

.cf-box .cf-row + .cf-row {
  border-top: 1px solid var(--border);
}

.cf-box .cf-row b {
  display: block;
  color: var(--text-sub);
  font-weight: 600;
  margin-bottom: 3px;
}

.cf-box .cf-mine,
.cf-box .cf-now {
  display: block;
  padding-left: 11px;
  position: relative;
  word-break: break-word;
}

.cf-box .cf-mine {
  color: var(--text-mute);
  text-decoration: line-through;
}

.cf-box .cf-now {
  color: var(--ok-fg);
}

.cf-box .cf-mine::before,
.cf-box .cf-now::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
}

/* ==========================================================================
 * 11. 空状态
 * ======================================================================== */

.empty,
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-sub);
  font-size: var(--fs-sm);
  line-height: 1.8;
}

.empty-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-full);
  background: var(--primary-soft);
  border: 1px dashed var(--primary-border);
  margin: 0 auto 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: var(--text-mute);
}

.empty p {
  margin-bottom: 4px;
}

.empty-sub {
  font-size: var(--fs-xs);
}

.empty-state .t {
  font-size: var(--fs-lg);
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.empty-state .d {
  font-size: var(--fs-sm);
  line-height: 1.8;
  color: var(--text-sub);
  max-width: 460px;
  margin: 0 auto 4px;
}

/* ==========================================================================
 * 12. Toast
 *    两套调用契约都要认：kb/moment 用 `#toast.show.ok`，transfer 用 `#toast.ok`。
 *
 *    注意：**不要给它加 `html[data-theme="dark"]` 规则** —— 那条特异性是
 *    id+attr+element，会压过 `#toast.show.ok`（id+class+class），把成功和失败
 *    的绿红一并刷成同一个深灰，状态色就没了。
 * ======================================================================== */

#toast {
  position: fixed;
  left: 50%;
  bottom: 44px;
  transform: translate(-50%, 14px);
  padding: 12px 22px;
  border-radius: var(--radius);
  background: var(--gray-900);
  color: #fff;
  font-size: var(--fs-sm);
  font-weight: 500;
  line-height: 1.6;
  text-align: center;
  max-width: 76vw;
  word-break: break-word;
  box-shadow: var(--shadow-3);
  opacity: 0;
  pointer-events: none;
  z-index: 300;
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}

#toast.show,
#toast.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

#toast.ok,
#toast.show.ok {
  background: var(--success);
}

#toast.err,
#toast.show.err {
  background: var(--danger);
}

/* ==========================================================================
 * 13. 遮罩 + 表单弹层（.ask-*）+ 人员挑选列表（.pick-*）
 *     知识库与朋友圈任务两页共用同一套，以前各自内联一份。
 * ======================================================================== */

.mask {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 200;
  animation: mask-in .18s var(--ease);
}

.mask.hidden {
  display: none;
}

/* 表单弹层。站里有两套结构，这里用 :has() 一次兼容：
     · kb.html 的简易版：.ask-box > h3 + .ask-row + .ask-actions，整块自己滚
     · moment.html 的长表单版：.ask-hd / .ask-bd / .ask-actions，头尾固定、中间滚
   基础规则写简易版（自带 padding、可滚），有 .ask-bd 时才升级成 flex 三段式。
   浏览器不支持 :has() 时退回简易版 —— 长表单不再固定头尾，但仍能正常填。 */
.ask-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-3);
  width: 100%;
  max-width: 560px;
  max-height: 88vh;
  overflow: auto;
  padding: 20px 24px;
  animation: pop-in .2s var(--ease);
}

.ask-box:has(> .ask-bd) {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
  max-width: 860px;
  max-height: calc(100vh - 24px);
}

.ask-hd {
  flex-shrink: 0;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  font-size: var(--fs-lg);
  font-weight: 700;
}

.ask-bd {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 18px 24px;
}

.ask-bd::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.ask-bd::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 4px;
}

.ask-bd::-webkit-scrollbar-track {
  background: transparent;
}

.ask-group + .ask-group {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.ask-group > h4 {
  margin: 0 0 10px;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text-sub);
}

.ask-row {
  margin-bottom: 14px;
}

/* 简易弹层（kb）：标签在上、控件在下，一行一块 */
.ask-row > label {
  display: block;
  margin-bottom: 6px;
  font-size: var(--fs-sm);
  color: var(--text-sub);
}

/* 长表单弹层（moment）：标签在左定宽右对齐、控件在右，两栏。
   注意 app.js 里有些行是裸文本节点拼的，grid 会把连续文本当成匿名栅格项排到
   第 1 列，所以那些行在 app.js 里已显式套了 <div>；这里再把非 label 子元素
   一律按到第 2 列，双保险。 */
.ask-box:has(> .ask-bd) .ask-row {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 6px 14px;
  align-items: start;
  margin-bottom: 0;
}

.ask-box:has(> .ask-bd) .ask-row + .ask-row {
  margin-top: 10px;
}

.ask-box:has(> .ask-bd) .ask-row > label {
  grid-column: 1;
  margin-bottom: 0;
  padding-top: 9px;
  text-align: right;
  line-height: 1.5;
}

.ask-box:has(> .ask-bd) .ask-row > *:not(label) {
  grid-column: 2;
  min-width: 0;
}

/* 独占一整行的勾选项（整块 label）：不要挤进 112px 的标签列，
   否则「显示没有会话存档权限的员工」会被折成竖排。 */
.ask-box:has(> .ask-bd) .ask-row.ask-row-span {
  grid-template-columns: 1fr;
  margin-top: 12px;
}
.ask-box:has(> .ask-bd) .ask-row.ask-row-span > label.ask-check {
  grid-column: 1;
  padding-top: 8px;
  text-align: left;
  cursor: pointer;
}

.ask-row .kb-input,
.ask-row .kb-select,
.ask-row textarea {
  width: 100%;
}

.ask-row textarea {
  font-family: inherit;
  font-size: var(--fs-base);
  line-height: 1.6;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  min-height: 84px;
  resize: vertical;
  background: var(--card);
  color: var(--text);
  outline: none;
  box-sizing: border-box;
  transition: var(--t);
}

.ask-row textarea:focus {
  border-color: var(--primary);
  box-shadow: var(--ring);
}

.ask-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 560px) {
  .ask-cols {
    grid-template-columns: 1fr;
  }
}

.ask-cols > div > label {
  display: block;
  margin-bottom: 5px;
  font-size: var(--fs-sm);
  color: var(--text-sub);
}

.ask-note,
.ask-tip {
  font-size: var(--fs-xs);
  color: var(--text-sub);
  line-height: 1.7;
}

.ask-count {
  font-size: var(--fs-xs);
  color: var(--text-sub);
  line-height: 1.6;
  text-align: right;
  margin-top: 4px;
}

.ask-actions {
  flex-shrink: 0;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
}

/* 长表单弹层里，按钮条是固定页脚：贴底、带分隔线和浅底 */
.ask-box:has(> .ask-bd) .ask-actions {
  margin-top: 0;
  padding: 12px 24px;
  border-top: 1px solid var(--border);
  background: var(--gray-50);
}

html[data-theme="dark"] .ask-box:has(> .ask-bd) .ask-actions {
  background: var(--bg-hover);
}

/* 人员挑选：勾选列表，选中行给浅底 + 主色勾 */
.pick-list {
  max-height: 340px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card);
  padding: 4px;
  margin-top: 8px;
}

.pick-list label {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 10px;
  border-radius: var(--radius-xs);
  font-size: var(--fs-sm);
  cursor: pointer;
  transition: background var(--dur) var(--ease);
}

.pick-list label:hover {
  background: var(--bg-hover);
}

.pick-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.pick-bar .grow {
  flex: 1;
  min-width: 0;
}

.pick-chk {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-sm);
  color: var(--text);
  cursor: pointer;
}

.pick-count {
  font-size: var(--fs-xs);
  color: var(--text-sub);
}

.pick-empty {
  padding: 26px 0;
  text-align: center;
  color: var(--text-sub);
  font-size: var(--fs-sm);
}

/* ==========================================================================
 * 14. 窄屏：竖排菜单退化成底部横向 chip 条
 * ======================================================================== */

@media (max-width: 640px) {
  .pane {
    padding: 16px 12px 32px;
  }

  .app-shell {
    flex-direction: column;
  }

  /* 窄屏是 column 布局，order:-1 会把它顶到最上面，必须显式改回 2 落到最底部。
     自身也改成 flex 横排：否则五个分组各自成行叠起来，这条 chip 条会有 200 多像素高，
     把内容顶掉半屏。 */
  .side-nav {
    order: 2;
    width: 100%;
    border-right: 0;
    border-top: 1px solid var(--border);
    padding: 0;
    display: flex;
    align-items: stretch;
    overflow-x: auto;
    overflow-y: hidden;
  }

  .side-group {
    padding: 0;
    flex: 0 0 auto;
  }

  /* 组间给一条竖分隔，否则几个分组横排后连成一串分不清。
     桌面那条 border-top 在这里要去掉，横排时它会把 chip 条顶出一道横线。 */
  .side-group + .side-group {
    border-top: 0;
    border-left: 1px solid var(--border);
    margin-top: 0;
    padding-top: 0;
  }

  /* 一级标题隐藏。单条目组必须照常渲染 .side-sub，否则该入口会彻底消失不可点 */
  .side-lv1 {
    display: none;
  }

  .side-sub {
    max-height: none;
    display: flex;
    overflow: hidden;
  }

  .side-sub a {
    margin: 0;
    padding: 12px 14px;
    border-radius: 0;
    border-bottom: 3px solid transparent;
    white-space: nowrap;
  }

  .side-sub a.active {
    background: none;
    border-bottom-color: var(--primary);
  }

  .side-sub a.active::before {
    display: none;
  }
}

/* ==========================================================================
 * 15. 移动端作用域 .ui-mobile
 *     侧边栏（/sidebar，企微里约 300px 宽）、员工端（/my-moments、/my-material）
 *     和对外分享页（/material-read）共用。令牌和后台完全一致，只是控件更大、
 *     留白更宽 —— 这几页都在手机上看，后台那套 34px 控件和 12px 字号按起来太挤。
 * ======================================================================== */

.ui-mobile .btn,
.ui-mobile .kb-btn {
  width: 100%;
  height: 42px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  font-size: var(--fs-base);
}

.ui-mobile .btn.ghost {
  width: auto;
}

/* 连字符别名。index.html（侧边栏）历史写法是 `btn btn-primary` / `btn btn-ghost` /
   `btn btn-block`，而 transfer.html 里另有一个同名的 `.btn-ghost`，两者语义不同，
   所以只能把这些别名圈在 .ui-mobile 里 —— 圈到全局会把离职继承页的幽灵按钮改坏。 */
.ui-mobile .btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 1px 2px rgba(79, 70, 229, .24);
}

.ui-mobile .btn-block {
  width: 100%;
}

.ui-mobile .btn-primary:disabled {
  background: var(--primary-border);
  border-color: var(--primary-border);
  cursor: not-allowed;
}

/* 按钮行：把主按钮撑开、图标按钮保持定宽（my-material 的「复制转发 👁 ☆」） */
.ui-mobile .acts > .btn {
  flex: 1;
}

/* 分享页（material-read）整页只有这一个动作，按钮是 JS 塞进 .card 里的
   （material-read.js 一路 appendChild 到 #body），给它一档高一点、字号大一点，
   在微信内置浏览器里更好点。
   用 .share-page 而不是 .ui-mobile .card —— my-material 的素材卡也是 .card，
   一起改会把「复制转发」和它旁边的两个图标按钮撑得不一样高。 */
.ui-mobile.share-page .btn.primary {
  height: 46px;
  font-size: var(--fs-lg);
  border-radius: var(--radius);
}

/* 头部：客户信息 + 标签页，整块吸顶 */
.ui-mobile .header {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.ui-mobile .customer-info {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 13px 14px;
}

.ui-mobile .avatar {
  width: 42px;
  height: 42px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--primary), #7c5cf5);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 600;
  flex-shrink: 0;
  overflow: hidden;
}

.ui-mobile .avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ui-mobile .customer-meta {
  flex: 1;
  min-width: 0;
}

.ui-mobile .customer-name {
  font-size: var(--fs-lg);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ui-mobile .customer-sub {
  font-size: var(--fs-xs);
  color: var(--text-sub);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ui-mobile .status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border-strong);
  flex-shrink: 0;
}

.ui-mobile .status-dot.ok {
  background: var(--success);
}

.ui-mobile .status-dot.err {
  background: var(--danger);
}

/* 标签页：底部 2px 主色条，不用背景块 —— 侧边栏很窄，色块会把内容压没 */
.ui-mobile .tab-bar {
  display: flex;
  border-top: 1px solid var(--border);
}

.ui-mobile .tab {
  flex: 1;
  padding: 10px 0;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  font-family: inherit;
  font-size: var(--fs-sm);
  color: var(--text-sub);
  cursor: pointer;
  transition: var(--t);
}

.ui-mobile .tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 600;
}

.ui-mobile .content {
  padding: 13px 14px 28px;
}

.ui-mobile .tab-panel {
  display: none;
}

.ui-mobile .tab-panel.active {
  display: block;
}

.ui-mobile .card,
.ui-mobile .kb-card {
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-1);
}

.ui-mobile .card-title {
  font-size: var(--fs-sm);
  font-weight: 600;
  margin-bottom: 11px;
  color: var(--text);
}

/* ---------- 客户画像 ---------- */
.ui-mobile .profile-title {
  font-size: var(--fs-base);
  font-weight: 600;
  color: var(--primary);
  padding-bottom: 9px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}

.ui-mobile .profile-row {
  display: flex;
  padding: 9px 0;
  border-bottom: 1px dashed var(--border);
  font-size: var(--fs-sm);
  line-height: 1.6;
}

.ui-mobile .profile-row:last-child {
  border-bottom: none;
}

.ui-mobile .profile-label {
  width: 78px;
  flex-shrink: 0;
  color: var(--text-sub);
}

.ui-mobile .profile-value {
  flex: 1;
  word-break: break-all;
}

.ui-mobile .value-green {
  color: var(--success);
  font-weight: 600;
}

.ui-mobile .value-red {
  color: var(--danger);
  font-weight: 600;
}

.ui-mobile .value-blue {
  color: var(--primary);
  font-weight: 600;
}

.ui-mobile .value-geekblue {
  color: var(--primary-active);
  font-weight: 600;
}

/* ---------- 侧边栏顶栏（/sidebar 自己那条） ---------- */
.ui-mobile .sb-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
}

.ui-mobile .sb-title {
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--text);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ui-mobile .sb-link {
  font-size: var(--fs-xs);
  color: var(--primary);
  flex-shrink: 0;
}

/* ---------- 并排按钮组 ---------- */
.ui-mobile .kb-report-actions,
.ui-mobile .kb-quick-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.ui-mobile .kb-report-actions .btn,
.ui-mobile .kb-quick-actions .btn {
  flex: 1;
  text-align: center;
  padding: 0 6px;
  white-space: nowrap;
}

.ui-mobile .kb-quick-actions #btnRecNow {
  flex: 1.15;
}

/* ---------- 话术 / 回复条目 ---------- */
.ui-mobile .reply-item {
  padding: 11px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  cursor: pointer;
  transition: var(--t);
}

.ui-mobile .reply-item:hover {
  border-color: var(--primary-border);
  background: var(--primary-soft);
}

.ui-mobile .reply-item:last-child {
  margin-bottom: 0;
}

.ui-mobile .reply-text {
  font-size: var(--fs-sm);
  line-height: 1.6;
}

.ui-mobile .textarea {
  width: 100%;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 11px 12px;
  font-size: var(--fs-sm);
  font-family: inherit;
  line-height: 1.6;
  resize: vertical;
  margin-bottom: 10px;
  outline: none;
  background: var(--card);
  color: var(--text);
  transition: var(--t);
}

.ui-mobile .textarea:focus {
  border-color: var(--primary);
  box-shadow: var(--ring);
}

/* ---------- 会话记录 ---------- */
.ui-mobile .session-list {
  font-size: var(--fs-sm);
  color: var(--text-sub);
  line-height: 1.8;
}

.ui-mobile .session-empty {
  text-align: center;
  padding: 22px 0;
}

.ui-mobile .session-summary {
  font-size: var(--fs-xs);
  color: var(--warn-fg);
  background: var(--warn-bg);
  border-radius: var(--radius-xs);
  padding: 5px 9px;
  margin-bottom: 8px;
  line-height: 1.55;
}

.ui-mobile .session-list-title {
  font-size: var(--fs-xs);
  color: var(--text-sub);
  padding: 4px 0 8px;
}

.ui-mobile .recent-chat-item,
.ui-mobile .conv-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--dur) var(--ease);
}

.ui-mobile .conv-item {
  border-bottom: 1px solid var(--border);
}

.ui-mobile .conv-item:last-child {
  border-bottom: none;
}

.ui-mobile .recent-chat-item:hover,
.ui-mobile .conv-item:hover {
  background: var(--primary-soft);
}

.ui-mobile .rc-avatar,
.ui-mobile .conv-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--primary-light);
  color: var(--primary);
  font-size: 15px;
  font-weight: 600;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ui-mobile .rc-avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ui-mobile .rc-meta,
.ui-mobile .conv-meta {
  flex: 1;
  min-width: 0;
}

.ui-mobile .rc-name,
.ui-mobile .conv-name {
  font-size: var(--fs-base);
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ui-mobile .rc-sub,
.ui-mobile .conv-sub {
  font-size: var(--fs-xs);
  color: var(--text-sub);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.ui-mobile .conv-dep {
  font-size: 11px;
  color: var(--text-sub);
  margin-left: 6px;
  font-weight: 400;
}

.ui-mobile .conv-right {
  flex-shrink: 0;
  text-align: right;
}

.ui-mobile .conv-time {
  font-size: 11px;
  color: var(--text-sub);
}

.ui-mobile .conv-count {
  font-size: 11px;
  color: var(--primary);
  margin-top: 2px;
}

.ui-mobile .back-btn {
  font-size: var(--fs-xs);
  color: var(--primary);
  padding: 6px 0 8px;
  cursor: pointer;
  user-select: none;
}

.ui-mobile .back-btn:active {
  opacity: .7;
}

/* ---------- 聊天气泡 ---------- */
.ui-mobile .msg-row {
  display: flex;
  margin-bottom: 10px;
}

.ui-mobile .msg-customer {
  justify-content: flex-start;
}

.ui-mobile .msg-staff {
  justify-content: flex-end;
}

.ui-mobile .msg-bubble {
  max-width: 82%;
  padding: 9px 11px;
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid var(--border);
}

/* 靠角切平，指明发言人 —— 两侧对称，比只有一边改色更清楚 */
.ui-mobile .msg-customer .msg-bubble {
  border-top-left-radius: 3px;
}

.ui-mobile .msg-staff .msg-bubble {
  background: var(--primary-light);
  border-color: var(--primary-border);
  border-top-right-radius: 3px;
}

.ui-mobile .msg-sender {
  font-size: 11px;
  color: var(--text-sub);
  margin-bottom: 3px;
}

.ui-mobile .msg-staff .msg-sender {
  text-align: right;
}

.ui-mobile .msg-content {
  color: var(--text);
  font-size: var(--fs-sm);
  line-height: 1.6;
  word-break: break-all;
}

.ui-mobile .msg-image {
  display: block;
  max-width: 200px;
  max-height: 200px;
  border-radius: var(--radius-xs);
  cursor: zoom-in;
}

.ui-mobile .msg-file {
  color: var(--primary);
  text-decoration: none;
  border-bottom: 1px solid var(--primary);
}

.ui-mobile .msg-time {
  font-size: 10px;
  color: var(--text-mute);
  margin-top: 3px;
}

.ui-mobile .msg-customer .msg-time {
  text-align: left;
}

.ui-mobile .msg-staff .msg-time {
  text-align: right;
}

/* ---------- 话术库检索结果 ---------- */
/* 侧边栏 webview 高度很小，结果区必须能自己滚，否则会撑破面板 */
.ui-mobile .reply-list {
  overflow: auto;
  min-height: 0;
}

.ui-mobile .kb-item {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-top: 8px;
  cursor: pointer;
  background: var(--card);
  transition: var(--t);
}

.ui-mobile .kb-item:hover {
  border-color: var(--primary-border);
  box-shadow: var(--shadow-2);
}

.ui-mobile .kb-item:active {
  background: var(--primary-soft);
}

.ui-mobile .kb-item-title {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.45;
}

.ui-mobile .kb-item-answer {
  font-size: var(--fs-sm);
  line-height: 1.65;
  color: var(--text-sub);
  margin-top: 5px;
  white-space: pre-wrap;
  word-break: break-word;
}

/* 答案默认截 3 行：侧边栏一屏放不下几条，「开票信息」那种一整块地址/税号/银行
   全铺出来，一条就把弹层占满。展开由 .is-clamped 类切换（见 app.js 的 toggleExpand）。
   -webkit-box + line-clamp 与 white-space:pre-wrap 并用，原文换行照旧生效。 */
.ui-mobile .kb-item-answer.is-clamped {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}

.ui-mobile .kb-expand {
  display: inline-block;
  width: auto;
  height: auto;
  margin-left: 8px;
  padding: 1px 9px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-full);
  background: var(--bg);
  color: var(--primary);
  font-size: var(--fs-xs);
  line-height: 18px;
  cursor: pointer;
}

.ui-mobile .kb-expand:active {
  opacity: .7;
}

.ui-mobile .kb-item-meta {
  font-size: var(--fs-xs);
  color: var(--text-sub);
  margin-top: 8px;
}

/* 会话记录区顶部：当前识别到的员工（认错员工时可被使用者发现） */
.ui-mobile .staff-who {
  font-size: var(--fs-xs);
  line-height: 1.6;
  color: var(--text-sub);
  background: var(--bg);
  border-radius: var(--radius-xs);
  padding: 7px 11px;
  margin: 0 0 8px;
}

.ui-mobile .staff-who.warn {
  color: var(--warn-fg);
  background: var(--warn-bg);
}

/* ---------- 推荐话术弹层 ---------- */
/* 盖住整屏，遮罩点一下即关。 */
.ui-mobile .rec-sheet {
  position: fixed;
  inset: 0;
  z-index: 9999;
}

.ui-mobile .rec-sheet-mask {
  position: absolute;
  inset: 0;
  background: rgba(16, 24, 40, .38);
}

.ui-mobile .rec-sheet-panel {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 8px;
  max-height: min(70vh, 420px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-3);
}

.ui-mobile .rec-sheet-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 13px;
  border-bottom: 1px solid var(--border);
  flex: 0 0 auto;
}

.ui-mobile .rec-sheet-title {
  font-size: 15px;
  font-weight: 700;
}

.ui-mobile .rec-sheet-sub {
  flex: 1;
  min-width: 0;
  font-size: var(--fs-xs);
  color: var(--text-sub);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ui-mobile .rec-sheet-btn {
  flex: 0 0 auto;
  width: auto;
  height: auto;
  padding: 5px 11px;
  font-size: var(--fs-xs);
  color: var(--primary);
  background: var(--primary-light);
  border: none;
  border-radius: var(--radius-xs);
  cursor: pointer;
}

.ui-mobile .rec-sheet-close {
  width: auto;
  height: auto;
  color: var(--text-sub);
  background: transparent;
  font-size: 18px;
  line-height: 1;
  padding: 2px 8px;
}

.ui-mobile .rec-sheet-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 10px 13px;
}

.ui-mobile .rec-sheet-body .kb-item:last-child {
  margin-bottom: 0;
}

/* 标签 chip：侧边栏里字号要再收一档 */
.ui-mobile .tag-chip {
  font-size: 11px;
  line-height: 1.7;
}

/* 无会话存档时话术区整体禁用：
   光把按钮 disable 掉只是变灰，看上去像「能点但没反应」。 */
.ui-mobile .btn:disabled,
.ui-mobile .kb-input:disabled {
  opacity: .5;
  cursor: not-allowed;
}

/* ==========================================================================
 * 16. 各页专属控件的暗色修正
 *     上面每一节都是「令牌驱动」的 —— 组件只写一次，浅色深色由 :root /
 *     html[data-theme="dark"] 的令牌切换。但使用指南和离职继承这两页里有一批
 *     只在单页出现的类（.gd-note / .url / .picker-item / .res-chip …），它们带着
 *     硬编码色，光靠令牌切不过去。这些是从原 management.css 原样搬过来的，
 *     集中放一处，免得散回各页内联里再也找不到。
 *     注意：.notice / .pick-list / .dept-pill 不在这里 —— 它们已经令牌化。
 * ======================================================================== */

/* 使用指南 */
html[data-theme="dark"] .gd-step code {
  background: #1c2029;
  color: #ff7875;
  border-color: var(--border);
}

html[data-theme="dark"] .gd-note {
  background: #241c0b;
  border-color: #59430f;
  color: #e8b339;
}

html[data-theme="dark"] .url {
  background: #12233d;
}

/* 离职继承 */
html[data-theme="dark"] .picker-item {
  background: var(--card);
  border-bottom-color: var(--border);
}

html[data-theme="dark"] .picker-selected {
  background: #1c2029;
}

html[data-theme="dark"] .step-card.done {
  background: #16210f;
  border-color: #2f5c1c;
}

/* 报告中心：状态徽标是深色饱和字配淡色底，翻到深色后正文看不清，换成提亮字色 */
html[data-theme="dark"] .rp-badge {
  background: rgba(59, 130, 246, .18);
  color: #79a8ff;
}
html[data-theme="dark"] .rp-badge.week,
html[data-theme="dark"] .rp-tag.on {
  background: rgba(16, 185, 129, .18);
  color: #34d399;
}
html[data-theme="dark"] .rp-badge.month {
  background: rgba(245, 158, 11, .18);
  color: #fbbf24;
}
html[data-theme="dark"] .rp-badge.company {
  background: rgba(147, 51, 234, .18);
  color: #c4a1ff;
}
html[data-theme="dark"] .rp-badge.failed,
html[data-theme="dark"] .rp-tag.off {
  background: rgba(220, 38, 38, .18);
  color: #f87171;
}
html[data-theme="dark"] .rp-badge.pending {
  background: rgba(107, 114, 128, .20);
  color: #b6bdc7;
}
html[data-theme="dark"] .rp-steps .ok { color: #34d399; }
html[data-theme="dark"] .rp-steps .no { color: #f87171; }

/* 活码页的状态标签同样是浅底，深色下换深底提亮字 */
html[data-theme="dark"] .lc-tag.on { background: #12281a; color: #46d47f; }
html[data-theme="dark"] .lc-tag.off { background: #1b2029; color: #98a2b3; }
html[data-theme="dark"] .lc-tag.kind { background: #12233d; color: #6ea8ff; }
html[data-theme="dark"] .lc-tag.kind.group { background: #241a3d; color: #b795ff; }

html[data-theme="dark"] .execute-card {
  background: linear-gradient(135deg, #12233d, #101c30);
  border-color: #1e4272;
}

html[data-theme="dark"] .execute-note {
  background: var(--card);
  color: var(--text);
}

html[data-theme="dark"] .history-item {
  border-bottom-color: var(--border);
}

html[data-theme="dark"] .res-chip.grp,
html[data-theme="dark"] .res-chip.mute {
  background: transparent;
}

html[data-theme="dark"] .result-fail {
  background: rgba(255, 120, 117, 0.12);
}

html[data-theme="dark"] .btn-refresh,
html[data-theme="dark"] .btn-ghost {
  background: var(--card);
}

/* ==========================================================================
 * 17. 登录页（moment-login.html）
 *     整页只有一张卡片，但它是用户对后台的第一眼，单独收拾一下。
 *     居中不在这里 —— 那是 <body> 上的（见 _theme_migrate.py 的 KEEP）。
 * ======================================================================== */

.login-box {
  width: 100%;
  max-width: 360px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 26px;
  box-shadow: var(--shadow-2);
}

.login-box label {
  display: block;
  font-size: var(--fs-sm);
  color: var(--text-sub);
  margin-bottom: 6px;
}

.login-box input {
  width: 100%;
  padding: 10px 12px;
  margin-bottom: 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--text);
  font-size: var(--fs-base);
  font-family: inherit;
  outline: none;
  transition: var(--t);
}

.login-box input:focus {
  border-color: var(--primary);
  box-shadow: var(--ring);
}

.login-box button {
  width: 100%;
  height: 42px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--primary-grad);
  color: #fff;
  box-shadow: 0 4px 12px -4px rgba(79, 70, 229, .55);
  font-size: var(--fs-lg);
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: var(--t);
}

.login-box button:hover:not(:disabled) {
  background: var(--primary-hover);
}

.login-box button:disabled {
  opacity: .6;
  cursor: not-allowed;
}

.login-box .err {
  color: var(--danger);
  font-size: var(--fs-sm);
  min-height: 18px;
  margin-bottom: 8px;
  line-height: 1.5;
}

/* ==========================================================================
 * 18. 各页自有控件别名归拢（2026-10-27）
 *     素材库 .mt-*、报告中心 .rp-*、活码系统 .lc-* 是各页自己起的前缀，语义与
 *     .kb-* 完全相同，但圆角/边框/按钮厚度各写各的，跟全站其他页始终差半档。
 *     这里只补「外观」，布局与行为仍归各页 —— 页面自己的排布不动。
 *     各页 <style> 在 <link> 之前，同特异度下这几条后写生效。
 * ======================================================================== */

/* 页头标题：与 .kb-h 同一道主色竖条 */
.mt-h,
.rp-h,
.lc-h {
  padding-left: 13px;
  border-left: 3px solid var(--primary);
  border-radius: 2px;
}

/* 卡片 */
.mt-card,
.rp-card,
.lc-card {
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
}

/* 按钮 */
.mt-btn,
.rp-btn,
.lc-btn {
  border-radius: var(--radius-sm);
  transition: var(--t);
}

.mt-btn.primary,
.rp-btn.primary,
.lc-btn.primary {
  background: var(--primary-grad);
  border-color: var(--primary);
  box-shadow: 0 2px 6px -2px rgba(79, 70, 229, .5);
}

.mt-btn.primary:hover,
.rp-btn.primary:hover,
.lc-btn.primary:hover {
  border-color: var(--primary-hover);
  box-shadow: 0 4px 12px -3px rgba(79, 70, 229, .55);
}

/* 输入框 / 下拉 */
.mt-input,
.mt-select,
.rp-input,
.rp-select,
.lc-input,
.lc-select,
.lc-textarea {
  border-radius: var(--radius-sm);
  border-color: var(--border-strong);
  transition: var(--t);
}

.mt-input:focus,
.mt-select:focus,
.rp-input:focus,
.rp-select:focus,
.lc-input:focus,
.lc-select:focus,
.lc-textarea:focus {
  border-color: var(--primary);
  box-shadow: var(--ring);
}

/* 报告中心的页签与 .kb-tab 统一成同一套胶囊 */
.rp-tab {
  border-radius: var(--radius-full);
  transition: var(--t);
}

.rp-tab.on {
  background: var(--primary-grad);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 2px 6px -2px rgba(79, 70, 229, .5);
}

html[data-theme="dark"] .rp-tab.on {
  color: #11142a;
}

/* 表格：和 .kb-table / .mm-table 一致的表头层级与行高 */
table.mt-table th,
table.lc-list th {
  font-size: var(--fs-xs);
  letter-spacing: .05em;
  color: var(--text-mute);
}

table.mt-table td,
table.lc-list td {
  border-bottom-color: var(--border);
}

/* ========================================================================
 * 19. 后台视觉增强 v2（2026-10-27 第二轮）
 *     第一轮只改了令牌（圆角/阴影/主色渐变），渲染出来跟改之前几乎看不出区别 ——
 *     使用方反馈「还是没有调整」。这一节做的是**看得见**的那一半：
 *     顶栏、页头标题、卡片、输入框、表格、滚动条。
 *     全部圈在 body.ui-admin 里，侧边栏插件页（index.html，无 body class）
 *     与员工端 .ui-mobile 一个像素都不受影响。
 * ======================================================================== */

body.ui-admin {
  /* 输入框 / 表头 / 行悬停各自的底色，浅深两套，避免再散写硬编码颜色 */
  --ui-field: #f6f8fc;
  --ui-head: #f7f9fc;
  --ui-row-hover: #f8faff;
  --ui-line: #eff2f8;
}

html[data-theme="dark"] body.ui-admin {
  --ui-field: #1a1e27;
  --ui-head: #191d26;
  --ui-row-hover: #1b2029;
  --ui-line: #20242e;
}

/* ---- 顶栏：白底 + 一道细阴影，不再半透明渐变 ---- */
body.ui-admin .topbar {
  height: 62px;
  padding: 0 28px;
  background: var(--card);
  backdrop-filter: none;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 2px rgba(16, 24, 40, .03), 0 12px 28px -26px rgba(16, 24, 40, .55);
}

body.ui-admin .topbar .logo {
  font-size: 15.5px;
  letter-spacing: .002em;
}

body.ui-admin .topbar .logo::before {
  width: 26px;
  height: 26px;
  border-radius: 9px;
  background: linear-gradient(140deg, #7a6cf7 0%, #4f46e5 58%, #6a4df0 100%);
  box-shadow: 0 4px 10px -3px rgba(79, 70, 229, .55), inset 0 1px 0 rgba(255, 255, 255, .3);
}

body.ui-admin .topbar .hint {
  color: var(--text-mute);
  letter-spacing: .005em;
}

/* ---- 内容区：留白更松；滚动条收细，不再是一根系统灰条 ---- */
body.ui-admin .pane {
  padding: 30px 34px 64px;
}

body.ui-admin .pane::-webkit-scrollbar {
  width: 10px;
}

body.ui-admin .pane::-webkit-scrollbar-thumb {
  background: #dfe3ec;
  border: 3px solid transparent;
  background-clip: content-box;
  border-radius: 10px;
}

body.ui-admin .pane::-webkit-scrollbar-thumb:hover {
  background: #c7cee0;
  background-clip: content-box;
}

html[data-theme="dark"] body.ui-admin .pane::-webkit-scrollbar-thumb {
  background: #2b313d;
  background-clip: content-box;
}

/* ---- 页头标题：字更重更大，竖条换成上下渐变的色块（比纯色更有一点质感） ---- */
body.ui-admin .kb-h,
body.ui-admin h2.kb-h,
body.ui-admin .mt-h,
body.ui-admin .rp-h,
body.ui-admin .lc-h {
  font-size: 22px;
  font-weight: 750;
  letter-spacing: -.02em;
  line-height: 1.3;
  margin-bottom: 20px;
  padding-left: 15px;
  border-left: 0;
  background-image: linear-gradient(180deg, #6d63f2, var(--primary));
  background-repeat: no-repeat;
  background-position: left center;
  background-size: 4px 100%;
}

/* ---- 卡片：圆角更大，边框更淡，阴影只留一点点浮起 ---- */
body.ui-admin .kb-card,
body.ui-admin .card,
body.ui-admin .mt-card,
body.ui-admin .rp-card,
body.ui-admin .lc-card,
body.ui-admin .ask-box {
  border-radius: 16px;
  border-color: var(--border);
  box-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 16px 32px -28px rgba(16, 24, 40, .55);
}

body.ui-admin .kb-card,
body.ui-admin .card {
  padding: 22px 24px;
}

/* ---- 输入框 / 下拉 / 文本域：浅底无重边，聚焦时变白 + 主色描边 + 光环 ---- */
body.ui-admin .kb-input,
body.ui-admin .kb-select,
body.ui-admin .kb-textarea,
body.ui-admin .mt-input,
body.ui-admin .mt-select,
body.ui-admin .mt-textarea,
body.ui-admin .rp-input,
body.ui-admin .rp-select,
body.ui-admin .lc-input,
body.ui-admin .lc-select,
body.ui-admin .lc-textarea,
body.ui-admin .modal input,
body.ui-admin .modal select,
body.ui-admin .modal textarea {
  background: var(--ui-field);
  border: 1px solid transparent;
  border-radius: 10px;
  box-shadow: inset 0 0 0 1px var(--border);
  transition: background .16s ease, box-shadow .16s ease, border-color .16s ease;
}

body.ui-admin .kb-input:hover,
body.ui-admin .kb-select:hover,
body.ui-admin .modal input:hover,
body.ui-admin .modal select:hover,
body.ui-admin .modal textarea:hover {
  background: var(--card);
  box-shadow: inset 0 0 0 1px var(--border-strong);
}

body.ui-admin .kb-input:focus,
body.ui-admin .kb-select:focus,
body.ui-admin .kb-textarea:focus,
body.ui-admin .mt-input:focus,
body.ui-admin .mt-select:focus,
body.ui-admin .mt-textarea:focus,
body.ui-admin .rp-input:focus,
body.ui-admin .rp-select:focus,
body.ui-admin .lc-input:focus,
body.ui-admin .lc-select:focus,
body.ui-admin .lc-textarea:focus,
body.ui-admin .modal input:focus,
body.ui-admin .modal select:focus,
body.ui-admin .modal textarea:focus {
  background: var(--card);
  border-color: var(--primary);
  box-shadow: inset 0 0 0 1px var(--primary), var(--ring);
  outline: none;
}

/* ---- 次要按钮：白底细边，悬停才染色；主按钮保留渐变 ---- */
body.ui-admin .btn:not(.primary):not(.btn-primary):not(.danger):not(.ghost),
body.ui-admin .kb-btn:not(.primary):not(.danger):not(.ghost),
body.ui-admin .mt-btn:not(.primary),
body.ui-admin .rp-btn:not(.primary),
body.ui-admin .lc-btn:not(.primary) {
  background: var(--card);
  border-color: var(--border);
  color: var(--text);
}

body.ui-admin .btn:not(.primary):not(.btn-primary):not(.danger):not(.ghost):hover,
body.ui-admin .kb-btn:not(.primary):not(.danger):not(.ghost):hover,
body.ui-admin .mt-btn:not(.primary):hover,
body.ui-admin .rp-btn:not(.primary):hover,
body.ui-admin .lc-btn:not(.primary):hover {
  background: var(--ui-field);
  border-color: var(--border-strong);
  color: var(--text);
}

body.ui-admin .btn.primary:active,
body.ui-admin .kb-btn.primary:active,
body.ui-admin .mt-btn.primary:active,
body.ui-admin .rp-btn.primary:active,
body.ui-admin .lc-btn.primary:active {
  transform: translateY(1px);
  box-shadow: 0 1px 2px -1px rgba(79, 70, 229, .5);
}

/* ---- 表格：表头浅底 + 粘顶，行悬停淡紫，分隔线更细 ---- */
body.ui-admin table.kb-table thead th,
body.ui-admin table.mm-table thead th,
body.ui-admin table.mt-table thead th,
body.ui-admin table.lc-list thead th {
  background: var(--ui-head);
  color: var(--text-sub);
  font-size: 12.5px;
  font-weight: 650;
  letter-spacing: .03em;
  position: sticky;
  top: 0;
  z-index: 1;
}

body.ui-admin table.kb-table td,
body.ui-admin table.mm-table td,
body.ui-admin table.mt-table td,
body.ui-admin table.lc-list td {
  border-bottom-color: var(--ui-line);
}

body.ui-admin table.kb-table tbody tr:hover td,
body.ui-admin table.mm-table tbody tr:hover td,
body.ui-admin table.mt-table tbody tr:hover td,
body.ui-admin table.lc-list tbody tr:hover td {
  background: var(--ui-row-hover);
}

body.ui-admin table td.num,
body.ui-admin .kb-metric b {
  font-variant-numeric: tabular-nums;
}

/* ---- 选择器列表：整行可点，悬停有反馈 ---- */
body.ui-admin .pick-list label {
  border-radius: 9px;
  padding: 7px 10px;
}

body.ui-admin .pick-list label:hover {
  background: var(--ui-row-hover);
}

/* ---- 空态图标：实心主色圆盘换成淡渐变方块，跟卡片圆角对得上 ---- */
body.ui-admin .empty-icon {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(79, 70, 229, .1), rgba(79, 70, 229, .04));
  border: 1px dashed rgba(79, 70, 229, .35);
}

/* ========================================================================
 * 20. 活泼数据风（2026-10-27 第三轮，使用方选定的方向）
 *     在主色渐变之外引入**第二组色相**：统计卡按序号分红/橙/绿/青/紫/靛，
 *     顶栏与页头也带一点渐变。只改观感，不动任何布局与交互。
 *     仍然全部圈在 body.ui-admin 内。
 * ======================================================================== */

/* 顶栏：白到极淡紫的渐变，避免纯白顶栏和大面积浅灰底之间那道生硬分界 */
body.ui-admin .topbar {
  background: linear-gradient(180deg, #ffffff 0%, #faf9ff 100%);
}

html[data-theme="dark"] body.ui-admin .topbar {
  background: linear-gradient(180deg, #171a24 0%, #13161f 100%);
}

/* ---- 页头标题：渐变字 + 左边一道渐变竖条（竖条改用伪元素，
      把 background-image 让给文字裁剪，两个渐变才能共存） ---- */
body.ui-admin .kb-h,
body.ui-admin h2.kb-h,
body.ui-admin .mt-h,
body.ui-admin .rp-h,
body.ui-admin .lc-h {
  position: relative;
  background-image: linear-gradient(92deg, #4f46e5 0%, #7c3aed 55%, #2563eb 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  background-repeat: repeat;
  background-position: 0 0;
  background-size: auto;
}

body.ui-admin .kb-h::before,
body.ui-admin h2.kb-h::before,
body.ui-admin .mt-h::before,
body.ui-admin .rp-h::before,
body.ui-admin .lc-h::before {
  content: '';
  position: absolute;
  left: 0;
  top: 3px;
  bottom: 3px;
  width: 4px;
  border-radius: 3px;
  background: linear-gradient(180deg, #6d63f2 0%, #a855f7 55%, #3b82f6 100%);
}

html[data-theme="dark"] body.ui-admin .kb-h,
html[data-theme="dark"] body.ui-admin h2.kb-h,
html[data-theme="dark"] body.ui-admin .mt-h,
html[data-theme="dark"] body.ui-admin .rp-h,
html[data-theme="dark"] body.ui-admin .lc-h {
  background-image: linear-gradient(92deg, #a3aaff 0%, #c9a8ff 55%, #8fc0ff 100%);
}

/* 色相令牌 + 表头底色：统一在这一层调，下面的规则只引用 */
body.ui-admin {
  --ui-head: #f6f5ff;
}

html[data-theme="dark"] body.ui-admin {
  --ui-head: #1a1b26;
}

/* ---- 统计卡：三种写法共用（.kb-metrics 里的 .kb-metric、组织管理页的指标条） ---- */
body.ui-admin .kb-metric {
  --hue: 79, 70, 229;
  position: relative;
  overflow: hidden;
  border-top: 1px solid var(--border);
  border-radius: 16px;
  padding: 17px 19px;
  background:
    linear-gradient(180deg, rgba(var(--hue), .075) 0%, rgba(var(--hue), 0) 62%),
    var(--card);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

body.ui-admin .kb-metric::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, rgba(var(--hue), .95) 0%, rgba(var(--hue), .3) 100%);
}

body.ui-admin .kb-metrics .kb-metric:nth-child(6n+1) { --hue: 79, 70, 229; }
body.ui-admin .kb-metrics .kb-metric:nth-child(6n+2) { --hue: 6, 148, 232; }
body.ui-admin .kb-metrics .kb-metric:nth-child(6n+3) { --hue: 139, 92, 246; }
body.ui-admin .kb-metrics .kb-metric:nth-child(6n+4) { --hue: 16, 185, 129; }
body.ui-admin .kb-metrics .kb-metric:nth-child(6n+5) { --hue: 234, 145, 12; }
body.ui-admin .kb-metrics .kb-metric:nth-child(6n+6) { --hue: 235, 74, 108; }

body.ui-admin .kb-metric:hover {
  transform: translateY(-2px);
  border-color: rgba(var(--hue), .45);
  box-shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 14px 26px -20px rgba(var(--hue), .8);
}

body.ui-admin .kb-metric .v,
body.ui-admin .kb-metric .n {
  font-size: 26px;
  font-weight: 750;
  letter-spacing: -.03em;
}

body.ui-admin .kb-metric .k {
  font-size: 12.5px;
  color: var(--text-sub);
}

html[data-theme="dark"] body.ui-admin .kb-metric {
  background:
    linear-gradient(180deg, rgba(var(--hue), .16) 0%, rgba(var(--hue), 0) 62%),
    var(--card);
}

/* ---- 胶囊页签：未选中也有主色淡底，选中保持渐变实心 ---- */
body.ui-admin .kb-tab {
  background: var(--ui-field);
  color: var(--text-sub);
}

body.ui-admin .kb-tab:hover {
  background: var(--primary-light);
  color: var(--primary);
}

body.ui-admin .kb-tab.active {
  color: #fff;
  box-shadow: 0 4px 12px -6px rgba(79, 70, 229, .9), inset 0 1px 0 rgba(255, 255, 255, .2);
}

html[data-theme="dark"] body.ui-admin .kb-tab.active {
  color: #11142a;
}

/* ---- 状态胶囊：软着色底，比灰底灰字更容易扫 ---- */
body.ui-admin .kb-badge {
  border-color: transparent;
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 999px;
}

/* 修正（2026-10-27）：上面 body.ui-admin .kb-tab 的底色特异度高于 .kb-tab.active，
   把选中页签的渐变底一起盖掉了，只剩白色字浮在浅底上 —— 看不见。
   选中态必须用同样的 body.ui-admin 前缀重新声明。 */
body.ui-admin .kb-tab.active,
body.ui-admin .kb-tab.active:hover {
  background: var(--primary-grad);
  color: #fff;
}

html[data-theme="dark"] body.ui-admin .kb-tab.active,
html[data-theme="dark"] body.ui-admin .kb-tab.active:hover {
  color: #11142a;
}

/* ========================================================================
 * 21. 去掉纯白（2026-10-27 第四轮）
 *     上一版画布是白卡片 + 浅灰底，整体仍是一片白。这一版改成
 *     **带色画布 + 微蓝白卡片**：画布用冷灰蓝并叠两团很淡的主色/青色光晕，
 *     卡片不再是 #fff，而是极淡的蓝白，卡片与画布之间靠色差和阴影分层。
 *     仍然只作用于 body.ui-admin，侧边栏插件页与员工端不受影响。
 * ======================================================================== */

body.ui-admin {
  /* 画布：冷灰蓝，不是纯白也不是死灰 */
  --bg: #edf0f8;
  --bg-glow:
    radial-gradient(900px 420px at 88% -12%, rgba(99, 102, 241, .13), transparent 70%),
    radial-gradient(760px 360px at -10% 108%, rgba(56, 189, 248, .11), transparent 72%);
  /* 卡片：微蓝白；输入框再压深一档，才不会和卡片糊在一起 */
  --ui-card: #fbfcff;
  --ui-field: #f1f4fb;
  --ui-head: #f4f6fd;
  --ui-row-hover: #f7f9ff;
  --ui-line: #e8ecf6;
}

html[data-theme="dark"] body.ui-admin {
  /* 2026-11-05：上面 body.ui-admin 又给 --bg / --bg-glow 赋了浅色画布，
     它与 html[data-theme="dark"] 特异度相同（都是 0,1,1），且写在后面 ——
     暗色模式下画布被它盖回浅灰蓝，只剩卡片是暗的，整页看着一片白。
     这里必须原样再声明一次，否则任何后台页（报告中心/知识库/素材库）都白底。 */
  --bg: #0d0f14;
  --bg-glow:
    radial-gradient(900px 420px at 88% -12%, rgba(139, 147, 255, .10), transparent 70%),
    radial-gradient(760px 360px at -10% 108%, rgba(56, 189, 248, .07), transparent 72%);
  --ui-card: #171b25;
  --ui-field: #1b202b;
  --ui-head: #1a1f2a;
  --ui-row-hover: #1c2230;
  --ui-line: #232936;
}

/* 卡片底色统一走 --ui-card */
body.ui-admin .kb-card,
body.ui-admin .card,
body.ui-admin .mt-card,
body.ui-admin .rp-card,
body.ui-admin .lc-card,
body.ui-admin .ask-box,
body.ui-admin .modal {
  background: var(--ui-card);
  border-color: #e2e8f4;
}

html[data-theme="dark"] body.ui-admin .kb-card,
html[data-theme="dark"] body.ui-admin .card,
html[data-theme="dark"] body.ui-admin .mt-card,
html[data-theme="dark"] body.ui-admin .rp-card,
html[data-theme="dark"] body.ui-admin .lc-card,
html[data-theme="dark"] body.ui-admin .ask-box,
html[data-theme="dark"] body.ui-admin .modal {
  border-color: var(--border);
}

/* 顶栏跟着画布走，别再是纯白一条 */
body.ui-admin .topbar {
  background: linear-gradient(180deg, #f7f9ff 0%, #f2f5fd 100%);
  border-bottom-color: #e1e7f3;
}

html[data-theme="dark"] body.ui-admin .topbar {
  background: linear-gradient(180deg, #171b26 0%, #141821 100%);
}

/* 统计卡：底色跟随卡片令牌，别再用 :root 的白 */
body.ui-admin .kb-metric {
  background:
    linear-gradient(180deg, rgba(var(--hue), .08) 0%, rgba(var(--hue), 0) 62%),
    var(--ui-card);
}

/* 表格：行底跟着卡片，表头单独一档 */
body.ui-admin table.kb-table thead th,
body.ui-admin table.mm-table thead th,
body.ui-admin table.mt-table thead th,
body.ui-admin table.lc-list thead th {
  background: var(--ui-head);
}

/* 卡片之间靠阴影分层的力度再加大一点点（画布有色，浅阴影会糊） */
body.ui-admin .kb-card,
body.ui-admin .card,
body.ui-admin .mt-card,
body.ui-admin .rp-card,
body.ui-admin .lc-card {
  box-shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 18px 36px -30px rgba(16, 24, 40, .6);
}

html[data-theme="dark"] body.ui-admin .kb-card,
html[data-theme="dark"] body.ui-admin .card,
html[data-theme="dark"] body.ui-admin .mt-card,
html[data-theme="dark"] body.ui-admin .rp-card,
html[data-theme="dark"] body.ui-admin .lc-card {
  box-shadow: 0 1px 2px rgba(0, 0, 0, .5);
}

