/* =====================================================================
   主应用布局 v2：深墨蓝顶栏 + 白色侧栏 + 浅灰内容区
   ---------------------------------------------------------------------
   改版只动这一层与 theme.css，不改任何页面 JS 的类名——
   页面结构保持不变，换皮肤的风险才可控。
   ===================================================================== */

/* 内容区背景加两团极淡的光，避免大片纯灰显得平板；
   固定附着，滚动时不跟着跑，否则表格滚动会出现色带。 */
body {
  background:
    radial-gradient(900px 420px at 88% -8%, rgba(44, 127, 196, .08), transparent 68%),
    radial-gradient(760px 400px at 6% -12%, rgba(180, 132, 47, .06), transparent 70%),
    var(--bg);
  background-attachment: fixed;
}

/* ------------------------------------------------------------ 顶栏 */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 60px;
  padding: 0 20px 0 12px;
  color: #dbe7f3;
  background: linear-gradient(180deg, #12263d 0%, #0f1b2b 100%);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .05), 0 8px 24px -16px rgba(10, 22, 38, .6);
}
/* 顶栏下沿一道极细的品牌色，替代粗重的分隔线 */
.topbar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(44, 127, 196, .55) 22%, rgba(44, 127, 196, .15) 60%, transparent);
}

.collapse-btn {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  color: #94aec7;
  background: none;
  border: none;
  border-radius: var(--r);
  cursor: pointer;
  transition: background .15s, color .15s;
}
.collapse-btn:hover { background: rgba(255, 255, 255, .09); color: #fff; }

.logo { display: flex; align-items: center; gap: 11px; min-width: 0; }
.logo-mark {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  border-radius: 9px;
  background: linear-gradient(145deg, #2c7fc4 0%, #15507f 100%);
  box-shadow: 0 6px 14px -6px rgba(44, 127, 196, .8), inset 0 1px 0 rgba(255, 255, 255, .25);
}
.logo-txt { min-width: 0; }
.logo-txt b {
  display: block;
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: .02em;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.logo-txt span { font-size: 11px; color: #8aa6c1; letter-spacing: .12em; }

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }

.env-tag {
  padding: 3px 10px;
  font-size: 11.5px;
  color: #ffd79a;
  background: rgba(180, 132, 47, .16);
  border: 1px solid rgba(180, 132, 47, .38);
  border-radius: var(--r-full);
  white-space: nowrap;
}

/* 用户菜单 */
.user { position: relative; }
.user-btn {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 4px 9px 4px 5px;
  font-family: inherit;
  color: inherit;
  background: none;
  border: 1px solid transparent;
  border-radius: var(--r);
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.user-btn:hover { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .12); }

.avatar {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  font-size: 12.5px;
  font-weight: 600;
  color: #12324f;
  background: linear-gradient(145deg, #d8e8f6, #b9d3ea);
  border-radius: 50%;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6);
}
.user-txt { display: flex; flex-direction: column; line-height: 1.32; text-align: left; }
.user-txt b { font-size: 12.5px; font-weight: 600; color: #fff; }
.user-txt i { font-size: 11px; font-style: normal; color: #8aa6c1; }
.caret { color: #8aa6c1; }

.user-pop {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 600;
  width: 274px;
  padding: 6px;
  background: #fff;
  border: 1px solid var(--bd);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-l);
  display: none;
}
.user-pop.open { display: block; animation: rise .16s ease; }

.pop-hd { padding: 11px 12px 8px; }
.pop-hd b { display: block; font-size: 14px; color: var(--t-1); }
.pop-hd span { font-size: 12px; color: var(--t-3); }

.pop-info {
  margin: 0 8px;
  padding: 9px 11px;
  font-size: 12px;
  line-height: 1.85;
  color: var(--t-2);
  background: var(--bg-2);
  border: 1px solid var(--bd-l);
  border-radius: var(--r);
}
.pop-info .k { color: var(--t-3); display: inline-block; min-width: 58px; }

.pop-sep { height: 1px; margin: 6px 4px; background: var(--bd-l); }
.pop-item {
  display: block;
  width: 100%;
  padding: 9px 12px;
  font-size: 13px;
  font-family: inherit;
  text-align: left;
  color: var(--t-1);
  background: none;
  border: none;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: background .13s, color .13s;
}
.pop-item:hover { background: var(--c-brand-soft); color: var(--c-brand); }
.pop-item.danger { color: var(--c-err); }
.pop-item.danger:hover { background: var(--c-err-bg); }

/* ------------------------------------------------------------ 布局 */
.layout {
  display: flex;
  min-height: 100vh;
  padding-top: 60px;
}

.sidebar {
  position: fixed;
  top: 60px;
  bottom: 0;
  left: 0;
  z-index: 400;
  display: flex;
  flex-direction: column;
  width: 232px;
  background: linear-gradient(180deg, #ffffff 0%, #fcfdff 100%);
  border-right: 1px solid var(--bd);
  transition: width .2s cubic-bezier(.4, 0, .2, 1);
  overflow: hidden;
}

.nav { flex: 1; padding: 14px 12px; overflow-y: auto; overflow-x: hidden; }

/* 分组小标题：只有一行字，却能让 8 个入口看起来是「一组」而不是一长串 */
.nav::before {
  content: "功能导航";
  display: block;
  padding: 0 11px 9px;
  font-size: 11px;
  letter-spacing: .16em;
  color: var(--t-4);
}
body.collapsed .nav::before { content: ""; padding: 0; }

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  height: 40px;
  padding: 0 11px;
  margin-bottom: 3px;
  font-size: 13.5px;
  color: var(--t-2);
  border-radius: 10px;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, color .15s;
}
.nav-item:hover { background: #f2f6fb; color: var(--c-brand); }
.nav-item.on {
  color: var(--c-brand);
  background: linear-gradient(90deg, rgba(21, 80, 127, .1) 0%, rgba(21, 80, 127, .03) 100%);
  font-weight: 600;
}
.nav-item.on::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 3px;
  height: 18px;
  margin-top: -9px;
  background: linear-gradient(180deg, var(--c-brand-l), var(--c-brand));
  border-radius: var(--r-full);
}
.nav-item svg { flex: 0 0 auto; opacity: .78; }
.nav-item.on svg { opacity: 1; }

.nav-group > .nav-item { justify-content: flex-start; }
/* 只认直接子级的箭头：可点标题里的箭头在 .nav-caret 按钮内，规则另写 */
.nav-group > .nav-item > .arrow { margin-left: auto; transition: transform .2s; opacity: .45; }
.nav-group.open > .nav-item > .arrow { transform: rotate(90deg); }

/* 可点标题 + 独立展开箭头：标题跳自己的页面，箭头只管展开，两个热区互不干扰 */
.nav-caret {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  padding: 2px;
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
  border-radius: 4px;
}
.nav-caret:hover { background: rgba(21, 80, 127, .1); }
.nav-caret .arrow { margin-left: 0; transition: transform .2s; opacity: .45; }
.nav-group.open .nav-caret .arrow { transform: rotate(90deg); }

.nav-sub { display: none; padding: 3px 0 6px; }
.nav-group.open .nav-sub { display: block; }
.nav-sub .nav-item {
  height: 36px;
  padding-left: 42px;
  font-size: 13px;
}
.nav-sub .nav-item.on::before { height: 15px; margin-top: -7.5px; }

.sidebar-foot {
  padding: 13px 18px 16px;
  border-top: 1px solid var(--bd-l);
  font-size: 11.5px;
  color: var(--t-4);
  line-height: 1.75;
  white-space: nowrap;
}
.sidebar-foot .ver { color: var(--t-3); }

/* 收起态 */
body.collapsed .sidebar { width: 64px; }
body.collapsed .nav { padding: 14px 10px; }
body.collapsed .nav-item span,
body.collapsed .nav-item .arrow,
body.collapsed .nav-caret,
body.collapsed .sidebar-foot { display: none; }
body.collapsed .nav-item { justify-content: center; padding: 0; }
body.collapsed .nav-sub { display: none !important; }
body.collapsed .main { margin-left: 64px; }

/* ------------------------------------------------------------ 主区 */
.main {
  flex: 1;
  min-width: 0;
  margin-left: 232px;
  padding: 0 26px 56px;
  transition: margin-left .2s cubic-bezier(.4, 0, .2, 1);
}

.crumb {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 18px 0 14px;
  font-size: 12.5px;
  color: var(--t-3);
}
.crumb .cur { color: var(--t-1); font-weight: 600; font-size: 13px; }
.crumb svg { color: var(--t-4); }

.view { min-height: 320px; }

/* 页面头 */
.page-hd {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.page-hd h2 {
  margin: 0;
  font-size: 21px;
  font-weight: 600;
  letter-spacing: .02em;
}
.page-hd .desc {
  margin-top: 7px;
  font-size: 12.5px;
  color: var(--t-3);
  line-height: 1.75;
  max-width: 820px;
}

/* KPI 卡片 */
.kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(162px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.kpi {
  position: relative;
  padding: 16px 18px;
  background: #fff;
  border: 1px solid var(--bd);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-xs);
  transition: box-shadow .18s, transform .18s, border-color .18s;
  overflow: hidden;
}
.kpi::after {
  content: "";
  position: absolute;
  right: -18px;
  top: -18px;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(44, 127, 196, .09), transparent 70%);
}
.kpi:hover { box-shadow: var(--shadow); transform: translateY(-1px); border-color: #d8e2ee; }
.kpi .k {
  font-size: 12px;
  color: var(--t-3);
  display: flex;
  align-items: center;
  gap: 5px;
}
.kpi .v {
  margin-top: 7px;
  font-size: 26px;
  font-weight: 600;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
  color: var(--t-1);
  line-height: 1.15;
}
.kpi .v small {
  display: block;
  margin-top: 4px;
  font-family: var(--sans);
  font-size: 11.5px;
  font-weight: 400;
  color: var(--t-3);
  letter-spacing: 0;
}
.kpi.warn .v { color: var(--c-warn); }
.kpi.ok .v { color: var(--c-ok); }
.kpi.err .v { color: var(--c-err); }

/* 条件栏 */
.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
  padding: 13px 16px;
  background: #fff;
  border: 1px solid var(--bd);
  border-bottom: none;
  border-radius: var(--r-lg) var(--r-lg) 0 0;
}
.filters .input, .filters .select { width: auto; min-width: 150px; height: 34px; }
.filters .grow-in { width: 220px; }
/* 筛选栏单独出现时（表格另起卡片）需要完整圆角 */
.filters.standalone { border-bottom: 1px solid var(--bd); border-radius: var(--r-lg); }

/* 平铺表格卡片（与筛选栏连用） */
.card.flat { border-radius: 0 0 var(--r-lg) var(--r-lg); }

/* Tabs */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--bd);
  margin-bottom: 0;
}
.tab {
  position: relative;
  padding: 11px 16px;
  font-size: 13.5px;
  font-family: inherit;
  color: var(--t-2);
  background: none;
  border: none;
  border-radius: var(--r) var(--r) 0 0;
  cursor: pointer;
  white-space: nowrap;
  transition: color .15s, background .15s;
}
.tab:hover { color: var(--c-brand); background: rgba(21, 80, 127, .04); }
.tab.on { color: var(--c-brand); font-weight: 600; }
.tab.on::after {
  content: "";
  position: absolute;
  left: 13px;
  right: 13px;
  bottom: -1px;
  height: 2px;
  background: linear-gradient(90deg, var(--c-brand-l), var(--c-brand));
  border-radius: var(--r-full);
}
.tab .cnt {
  margin-left: 6px;
  padding: 1px 7px;
  font-size: 11px;
  font-weight: 500;
  color: var(--t-3);
  background: #eef2f7;
  border-radius: var(--r-full);
}
.tab.on .cnt { color: var(--c-brand); background: var(--c-brand-bg); }

.tab-body { padding-top: 18px; }

/* 详情栅格 */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 1100px) {
  .grid2, .grid3 { grid-template-columns: 1fr; }
}

.kv-list { display: grid; grid-template-columns: 100px 1fr; gap: 11px 14px; font-size: 13px; }
.kv-list dt { color: var(--t-3); }
.kv-list dd { margin: 0; color: var(--t-1); line-height: 1.72; word-break: break-word; }

/* 进度条 */
.bar {
  position: relative;
  height: 6px;
  background: #eef2f7;
  border-radius: var(--r-full);
  overflow: hidden;
}
.bar > i {
  position: absolute;
  inset: 0 auto 0 0;
  background: linear-gradient(90deg, var(--c-brand-l), var(--c-brand));
  border-radius: var(--r-full);
  transition: width .35s ease;
}
.bar.ok > i { background: linear-gradient(90deg, #2f9e6b, var(--c-ok)); }
.bar.warn > i { background: linear-gradient(90deg, #d8a24a, var(--c-accent)); }
.bar.err > i { background: linear-gradient(90deg, #cf5b5b, var(--c-err)); }

/* 加载态 */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 64px 0;
  color: var(--t-3);
  font-size: 13px;
}
.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid #e2e9f1;
  border-top-color: var(--c-brand-l);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* 代码/字段名 */
.code {
  font-family: var(--mono);
  font-size: 12.5px;
  padding: 1px 6px;
  color: #17456e;
  background: #eff5fb;
  border-radius: var(--r-sm);
}

/* 三选一卡片（字段使用方式） */
.ways { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.way {
  padding: 13px 14px;
  text-align: left;
  font-family: inherit;
  background: #fff;
  border: 1px solid var(--bd);
  border-radius: var(--r-lg);
  cursor: pointer;
  transition: all .16s;
}
.way:hover { border-color: #bed3e7; box-shadow: var(--shadow-xs); }
.way.on {
  border-color: var(--c-brand);
  background: #f6fafd;
  box-shadow: inset 0 0 0 1px var(--c-brand), var(--shadow-xs);
}
.way b { display: block; font-size: 13px; color: var(--t-1); margin-bottom: 5px; }
.way span { display: block; font-size: 11.5px; line-height: 1.6; color: var(--t-3); }
.way.on b { color: var(--c-brand); }

/* 权限矩阵 */
.matrix th.rot { text-align: center; font-size: 11.5px; }
.matrix td.chk { text-align: center; }
.matrix .grp td {
  background: var(--bg-2);
  font-weight: 600;
  font-size: 12px;
  color: var(--t-2);
}

/* ------------------------------------------------------------ 工作台：待办与条形 */
.todo-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--bd-l);
  transition: background .14s;
}
.todo-item:last-child { border-bottom: none; }
.todo-item:hover { background: #f7fafd; }
.todo-dot {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  margin-top: 7px;
  border-radius: 50%;
  background: var(--c-info);
  box-shadow: 0 0 0 3px rgba(44, 127, 196, .12);
}
.todo-dot.err { background: var(--c-err); box-shadow: 0 0 0 3px rgba(166, 43, 43, .12); }
.todo-dot.warn { background: var(--c-accent); box-shadow: 0 0 0 3px rgba(180, 132, 47, .14); }
.todo-dot.ok { background: var(--c-ok); box-shadow: 0 0 0 3px rgba(28, 122, 78, .12); }
.todo-t { font-size: 13.5px; font-weight: 600; }
.todo-d { font-size: 12.5px; color: var(--t-2); margin-top: 3px; line-height: 1.6; }
.todo-h { font-size: 12px; color: var(--t-3); margin-top: 4px; }
.todo-arrow { color: var(--t-4); margin-top: 4px; flex: 0 0 auto; }

.bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 11px; font-size: 12.5px; }
.bar-name { width: 86px; flex: 0 0 auto; color: var(--t-2); text-align: right; white-space: nowrap; }
.bar-track { flex: 1; height: 8px; background: #eef2f7; border-radius: var(--r-full); overflow: hidden; }
.bar-track > i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--c-brand-l), var(--c-brand));
  border-radius: var(--r-full);
  transition: width .4s ease;
}
.bar-track > i.ok { background: linear-gradient(90deg, #2f9e6b, var(--c-ok)); }
.bar-track > i.warn { background: linear-gradient(90deg, #d8a24a, var(--c-accent)); }
.bar-track > i.gray { background: #b9c6d4; }
.bar-num { width: 32px; flex: 0 0 auto; font-family: var(--mono); color: var(--t-2); }

/* ------------------------------------------------------------ 角色卡片 */
.role-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}
.role-card {
  padding: 15px 17px;
  background: #fff;
  border: 1px solid var(--bd);
  border-left: 3px solid var(--c-brand-l);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-xs);
}
.role-card.lv-err { border-left-color: var(--c-err); }
.role-card.lv-warn { border-left-color: var(--c-accent); }
.role-card.lv-gray { border-left-color: #c3ccd6; }
.rc-hd { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.rc-hd b { font-size: 14px; }
.rc-d { margin: 7px 0 11px; font-size: 12px; line-height: 1.65; color: var(--t-3); min-height: 40px; }
.rc-f {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--bd-l);
  font-size: 11.5px;
  color: var(--t-3);
}

/* ------------------------------------------------------------ 权限分组 */
.perm-groups { display: flex; flex-direction: column; gap: 12px; }
.perm-group {
  border: 1px solid var(--bd);
  border-radius: var(--r-lg);
  overflow: hidden;
  background: #fff;
}
.perm-group.touched { border-color: #bcd2e6; }
.perm-group.full { border-color: #a9d3bd; }
.pg-hd {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 13px;
  background: var(--bg-2);
  border-bottom: 1px solid var(--bd-l);
  font-size: 13px;
}
.pg-sub {
  padding: 8px 13px 3px;
  font-size: 11.5px;
  color: var(--t-3);
  letter-spacing: .05em;
}
.pg-items {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(198px, 1fr));
  gap: 2px;
  padding: 0 8px 10px;
}
.perm-item {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 9px;
  font-size: 12.5px;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: background .13s;
}
.perm-item:hover { background: #f4f8fc; }
.perm-item.on { background: #eef5fc; }
.perm-item span { flex: 0 0 auto; }
.perm-item em {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 10.5px;
  font-style: normal;
  color: var(--t-4);
  white-space: nowrap;
}
.perm-item input { flex: 0 0 auto; }

/* ------------------------------------------------------------ 勾选清单 */
.chk-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 9px 10px;
  background: var(--bg-2);
  border: 1px solid var(--bd);
  border-radius: var(--r);
  max-height: 240px;
  overflow-y: auto;
}
.chk-row {
  display: grid;
  grid-template-columns: 18px 132px 1fr;
  gap: 8px;
  align-items: baseline;
  padding: 7px 5px;
  border-radius: var(--r-sm);
  cursor: pointer;
}
.chk-row:hover { background: #eef5fc; }
.chk-t { font-size: 13px; font-weight: 600; }
.chk-d { font-size: 11.5px; color: var(--t-3); }

/* ------------------------------------------------------------ 校验清单行 */
.chk-line {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--bd-l);
}
.chk-line:last-child { border-bottom: none; }
.chk-ico {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  border-radius: 50%;
  margin-top: 1px;
}
.chk-ico.ok { background: var(--c-ok); }
.chk-ico.err { background: var(--c-err); }

/* ------------------------------------------------------------ 数据集卡片 */
.ds-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(292px, 1fr));
  gap: 12px;
}
.ds-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(232px, 1fr));
  gap: 10px;
}
.ds-card {
  padding: 15px 17px;
  background: #fff;
  border: 1px solid var(--bd);
  border-radius: var(--r-lg);
  transition: border-color .16s, box-shadow .16s, transform .16s;
}
.ds-card:hover { border-color: #bed3e7; box-shadow: var(--shadow); transform: translateY(-1px); }
.ds-card b { font-size: 13.5px; }

/* ------------------------------------------------------------ 绑定行 */
.bind-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 15px;
  border: 1px solid var(--bd);
  border-radius: var(--r-lg);
  margin-bottom: 8px;
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.bind-row:hover { border-color: #bed3e7; box-shadow: var(--shadow-xs); }

/* ------------------------------------------------------------ 底部保存条 */
.save-bar {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translate(-50%, 160%);
  z-index: 700;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 460px;
  max-width: calc(100vw - 80px);
  padding: 12px 18px;
  font-size: 13px;
  color: #e9f0f7;
  background: #16283a;
  border-radius: var(--r-lg);
  box-shadow: 0 18px 44px -18px rgba(10, 22, 38, .6);
  transition: transform .24s cubic-bezier(.22, .68, .32, 1), opacity .24s;
  opacity: 0;
}
.save-bar.show { transform: translate(-50%, 0); opacity: 1; }
.save-bar b { color: #ffd08a; }

/* =====================================================================
   模型中心 / 技能库 / 知识中心
   Markdown 正文、键值清单、分步条、上传区、三项校验卡
   ===================================================================== */

/* Markdown 渲染：技能声明与生成的文档都在这里显示 */
.md { font-size: 13.5px; line-height: 1.88; color: var(--t-1); }
.md .md-h { font-size: 14.5px; font-weight: 600; margin: 20px 0 9px; color: var(--t-1); }
.md .md-h:first-child { margin-top: 0; }
.md .md-p { margin: 0 0 11px; }
.md ul { margin: 5px 0 13px; padding-left: 20px; }
.md li { margin-bottom: 5px; }
.md code {
  font-family: var(--mono);
  font-size: 12.5px; background: #f2f5f9; border: 1px solid var(--bd);
  border-radius: var(--r-sm); padding: 1px 6px; color: #26405c;
}
.md .md-code {
  background: #f8fafc; border: 1px solid var(--bd); border-radius: 10px;
  padding: 13px 15px; overflow-x: auto; margin: 9px 0 15px;
}
.md .md-code code { background: none; border: none; padding: 0; font-size: 12.5px; line-height: 1.72; }
.md .md-quote {
  margin: 9px 0 15px; padding: 9px 14px; border-left: 3px solid var(--c-brand);
  background: #f6f9fc; color: var(--t-2); font-size: 13px; border-radius: 0 var(--r-sm) var(--r-sm) 0;
}

/* 图表：模型只给规格（JSON），画成什么样由平台定——
   让模型直接出图，它会给你一段 base64 或者一个编造的图片地址，两种都不能用 */
.md-chart {
  position: relative;
  /* 底部留 28px 给「存为图片」——它原来是右上角浮层，正好压在「单位：元/500克」上 */
  margin: 10px 0 16px; padding: 10px 12px 30px;
  background: #fff; border: 1px solid var(--bd); border-radius: 10px;
}
.md-chart svg { display: block; }
.md-chart-save {
  /* 放在图下方的留白里，不压任何图内文字 */
  position: absolute; bottom: 5px; right: 10px;
  font-size: 11.5px; padding: 3px 9px; cursor: pointer;
  color: var(--t-3); background: #fff; border: 1px solid var(--bd);
  border-radius: 6px;
  /* 常显：藏到 hover 才出现，没人知道这张图能存下来 */
  opacity: .72; transition: opacity .15s, color .15s, border-color .15s;
}
.md-chart:hover .md-chart-save { opacity: 1; }
.md-chart-save:hover { color: var(--c-brand); border-color: var(--c-brand-l); }
.md-chart-err {
  padding: 12px 14px; font-size: 12.5px; color: var(--c-err);
  background: var(--c-err-bg); border-radius: 8px;
}
/* 空数据和渲染失败是两件事：前者是模型没给数，标红会让人以为平台坏了 */
.md-chart-empty {
  padding: 14px; font-size: 12.5px; color: var(--t-3);
  background: #f7f9fc; border: 1px dashed var(--bd); border-radius: 8px;
}

/* 键值清单 */
.kv { display: grid; grid-template-columns: 112px 1fr; gap: 10px 14px; font-size: 13px; margin: 0; }
.kv dt { color: var(--t-3); }
.kv dd { margin: 0; color: var(--t-1); line-height: 1.72; word-break: break-word; }

/* 分步条：把「走到哪一步」显式化，避免使用者对着一堆标签猜 */
.steps { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 4px 0 20px; }
.steps .step { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--t-3); }
.steps .step .dot {
  width: 21px; height: 21px; border-radius: 50%; display: inline-flex;
  align-items: center; justify-content: center; font-size: 11.5px;
  background: #eef2f7; color: var(--t-3); flex: 0 0 auto;
}
.steps .step.done .dot { background: var(--c-ok-bg); color: var(--c-ok); }
.steps .step.active .dot {
  background: linear-gradient(180deg, #1b5f95, var(--c-brand)); color: #fff;
  box-shadow: var(--shadow-brand);
}
.steps .step.active .tx { color: var(--t-1); font-weight: 600; }
.steps .line { flex: 0 0 24px; height: 1px; background: var(--bd); }

/* 三项校验卡片：商业 API 的密级 / 裁剪 / 配额 */
.tri { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 980px) { .tri { grid-template-columns: 1fr; } }
.tri .cell {
  border: 1px solid var(--bd); border-radius: 12px; padding: 13px 15px; background: #fff;
}
.tri .cell.ok { border-color: #b7ddc6; background: #f7fbf8; }
.tri .cell.no { border-color: #f0c9c9; background: #fdf8f8; }
.tri .cell .h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 7px; }
.tri .cell .h b { font-size: 13px; }
.tri .cell .hint { font-size: 12px; color: var(--t-2); line-height: 1.65; }

/* 上传区 */
.drop {
  border: 1.5px dashed var(--bd-strong); border-radius: 14px;
  padding: 30px 18px; text-align: center; background: var(--bg-2); cursor: pointer;
  transition: border-color .18s, background .18s;
}
.drop:hover, .drop.over { border-color: var(--c-brand); background: #f4f8fc; }
.drop .big { font-size: 14px; color: var(--t-1); margin-bottom: 7px; }
.drop .small { font-size: 12.5px; }
.drop.picked { border-style: solid; border-color: var(--c-brand); background: #f4f8fc; }

/* 质量指标条 */
.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
@media (max-width: 980px) { .metrics { grid-template-columns: repeat(2, 1fr); } }
.metrics .m { border: 1px solid var(--bd); border-radius: 12px; padding: 12px 14px; background: #fff; }
.metrics .m .k { font-size: 12px; color: var(--t-3); margin-bottom: 5px; }
.metrics .m .v { font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; }
.metrics .m.bad .v { color: var(--c-err); }
.metrics .m.good .v { color: var(--c-ok); }

/* 两栏：左列表右详情，知识与技能详情都这么摆 */
.split { display: grid; grid-template-columns: 324px 1fr; gap: 16px; align-items: start; }
@media (max-width: 1100px) { .split { grid-template-columns: 1fr; } }
.side-card { border: 1px solid var(--bd); border-radius: var(--r-lg); background: #fff; overflow: hidden; }
.side-card .hd { padding: 13px 15px; border-bottom: 1px solid var(--bd-l); font-size: 13px; font-weight: 600; }
.side-card .bd { max-height: 560px; overflow-y: auto; }
.side-item {
  padding: 12px 15px; border-bottom: 1px solid var(--bd-l);
  cursor: pointer; font-size: 13px; transition: background .13s;
}
.side-item:hover { background: #f7fafd; }
.side-item.on { background: #f2f7fc; border-left: 3px solid var(--c-brand); padding-left: 12px; }
.side-item .t { color: var(--t-1); margin-bottom: 4px; line-height: 1.5; }
.side-item .s { font-size: 12px; color: var(--t-3); }

/* 检索命中 */
.hit { border: 1px solid var(--bd); border-radius: 12px; padding: 13px 15px; margin-bottom: 10px; background: #fff; }
.hit .hh { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 7px; font-size: 12.5px; }
.hit .hh .path { color: var(--t-3); }
.hit .cc { font-size: 13px; line-height: 1.8; color: var(--t-1); }

/* 类型徽标（知识四类） */
.kt {
  display: inline-block; font-size: 11.5px; padding: 1px 8px;
  border-radius: var(--r-full); line-height: 19px;
  white-space: nowrap;   /* 不加就会被列宽挤成每行一个字 */
}
.kt-FACT { background: #eaf2fb; color: #1c5f9e; }
.kt-CALIBER { background: #fdf1e6; color: #9a5b12; }
.kt-PARADIGM { background: #eef0fb; color: #3f4a9e; }
.kt-STYLE { background: #f0f7ee; color: #3d7a2c; }

/* =====================================================================
   数据中心（第 7 章）：连接 / 表映射 / 数据集 / 口径 / 授权矩阵 / 取数审计
   ===================================================================== */

/* 页头右侧动作区 */
.page-hd-act { display: flex; align-items: center; gap: 8px; }

/* 卡片头部右侧动作区：按钮与筛选器统一右对齐 */
.card-act { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.card-hd { display: flex; align-items: flex-start; gap: 12px; }

/* 等宽字体：编号、SQL、字段名一律用它，避免 0/O、1/l 看混 */
.mono { font-family: var(--mono); }

/* 行内操作按钮组 */
.ops { display: flex; flex-wrap: wrap; gap: 6px; }
/* 表格里不折行：折行会让行高翻倍，而且四个按钮拆成两行很难扫读。
   不折行时单元格的最小宽度等于按钮总宽，表格会自动从别的列挪空间过来。 */
table.tb .ops { flex-wrap: nowrap; }
table.tb .ops .btn { padding: 0 10px; }

.mt16 { margin-top: 16px; }

/* 表单里的并排字段：桌面两列、三列，窄屏自动回落单列 */
.row2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.row3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 960px) {
  .row2, .row3 { grid-template-columns: minmax(0, 1fr); }
}

/* 表单分组：一组一件事，分组标题用浅底条，避免一长串平铺 */
.form-sec { margin-bottom: 16px; }
.form-sec-hd {
  margin: 0 0 12px; padding: 0 0 0 10px;
  font-size: 13px; font-weight: 600; color: var(--t-1);
  border-left: 3px solid var(--c-brand-l);
  line-height: 1.3;
}

/* 危险动作按钮：停用、退回、撤销一律用它，与主按钮拉开距离 */
.btn-danger { color: #fff; background: var(--c-err); border-color: var(--c-err); }
.btn-danger:hover { background: #8f2323; border-color: #8f2323; color: #fff; }

/* 字段勾选网格：一屏能看全十几个字段，不用在长列表里滚。
   列数按容器宽度自动排：48 列的上报表在 3 列固定布局下要滚 16 行，
   而弹窗有 1000px 宽，空着的横向空间比纵向更可惜。 */
.chk-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 6px 14px; margin-top: 8px;
  max-height: 300px; overflow: auto;
  padding: 10px 12px; border: 1px solid var(--bd); border-radius: var(--r);
  background: var(--bg-2);
}
.chk-item {
  display: flex; align-items: flex-start; gap: 6px;
  font-size: 12.5px; line-height: 1.5; cursor: pointer;
}
.chk-item input { margin-top: 3px; flex: none; }
.chk-item > span { min-width: 0; word-break: break-word; }

/* 勾选区的批量操作条：与网格同一个视觉块，所以贴着网格顶部、圆角只留上沿。
   三十多列的报表一列一列点，既慢又容易漏——漏一列不会报错，取数时只是少一列。 */
.chk-bar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-top: 8px; padding: 8px 12px;
  background: #fff; border: 1px solid var(--bd);
  border-bottom: none; border-radius: var(--r) var(--r) 0 0;
  font-size: 12.5px;
}
.chk-bar + .chk-grid { margin-top: 0; border-radius: 0 0 var(--r) var(--r); }
.chk-bar .chk-item { font-weight: 600; color: var(--t-1); }
.chk-bar .chk-item input { margin-top: 2px; }
.chk-bar .ck {
  width: 14px; height: 14px; cursor: pointer; accent-color: var(--c-brand);
}
.chk-bar-act { margin-left: auto; display: flex; gap: 8px; }
.chk-bar .cnt { padding-left: 12px; border-left: 1px solid var(--bd); }
.chk-bar .cnt b { color: var(--c-brand); }

/* 按区划裁列：一行是「一个区划 → 它能看哪几列」。左边窄、右边宽，
   因为区划前缀最长 6 位，而列清单可能十几个 */
.col-map-row {
  display: grid; grid-template-columns: 150px minmax(0, 1fr) auto;
  gap: 8px; align-items: center; margin-bottom: 6px;
}
.col-map-row .input { width: 100%; }
.col-map-row [data-delcol] { white-space: nowrap; color: var(--c-danger, #c0392b); }

/* 授权矩阵：已授权格可点，未授权格「—」且不可勾选 */
.matrix { width: 100%; border-collapse: collapse; }
.matrix th, .matrix td {
  padding: 9px 11px; text-align: left; vertical-align: top;
  border-bottom: 1px solid var(--bd-l); border-right: 1px solid var(--bd-l);
}
.matrix th { font-size: 11.5px; font-weight: 600; color: var(--t-3); background: var(--bg-2); letter-spacing: .04em; }
.matrix td.cell-on { background: var(--c-ok-bg); cursor: pointer; }
.matrix td.cell-on:hover { outline: 2px solid var(--c-ok); outline-offset: -2px; }
.matrix td.cell-off { background: #fbfcfd; color: var(--t-3); cursor: pointer; }
.matrix td.cell-off:hover { background: #f2f5f9; }

/* 代码块：生成的 SQL 与技能声明共用 */
.md-pre {
  margin: 0; padding: 13px 15px; overflow-x: auto;
  font-family: var(--mono);
  font-size: 12px; line-height: 1.72; color: #22405c;
  background: #f8fafc; border: 1px solid var(--bd-l); border-radius: 10px;
  white-space: pre-wrap; word-break: break-all;
}

/* =====================================================================
   技能模板库：网格卡片
   ===================================================================== */
.tpl-filter {
  border: 1px solid var(--bd);
  border-radius: 12px;
  margin-bottom: 16px;
  padding: 11px 13px;
}
.tpl-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 12px;
}
.tpl-card {
  display: flex;
  flex-direction: column;
  padding: 15px 17px 13px;
  background: #fff;
  border: 1px solid var(--bd);
  border-radius: var(--r-lg);
  transition: border-color .16s, box-shadow .16s, transform .16s;
}
.tpl-card:hover { border-color: #bed3e7; box-shadow: var(--shadow); transform: translateY(-1px); }
.tpl-hd { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.tpl-hd b { font-size: 14px; font-weight: 600; }
.tpl-sum { font-size: 12.5px; color: var(--t-2); line-height: 1.65; min-height: 40px; }
.tpl-scene {
  margin-top: 8px;
  padding: 8px 10px;
  font-size: 12px;
  color: var(--t-3);
  line-height: 1.6;
  background: var(--bg-2);
  border-radius: var(--r);
}
.tpl-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  font-size: 11.5px;
  color: var(--t-3);
}
.tpl-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.tpl-tags i {
  font-style: normal;
  font-size: 11px;
  color: var(--c-brand);
  background: var(--c-brand-bg);
  padding: 1px 8px;
  border-radius: var(--r-full);
}
.tpl-ft {
  display: flex;
  justify-content: flex-end;
  margin-top: auto;
  padding-top: 12px;
}

/* =====================================================================
   模型快速接入（三字段）
   ---------------------------------------------------------------------
   表单只有三行，所以视觉上要「短」：留白够、层次少、结果区紧贴输入。
   连接结果不是一句 toast——它要能停留、能重试、能继续配置，
   因此用带状态色的块，而不是一闪而过的提示。
   ===================================================================== */
.q-lead {
  background: var(--c-brand-bg); border-radius: var(--r);
  padding: 11px 13px; margin-bottom: 14px;
  font-size: 12.5px; line-height: 1.7; color: var(--c-brand-d);
}
.q-lead b { font-weight: 600; }

.q-adv {
  margin-top: 14px; border: 1px solid var(--bd); border-radius: var(--r);
  background: var(--bg-2); padding: 0 13px;
}
.q-adv > summary {
  cursor: pointer; padding: 10px 0; font-size: 12.5px; font-weight: 600; color: var(--t-2);
  list-style: none; display: flex; align-items: center; gap: 6px;
}
.q-adv > summary::-webkit-details-marker { display: none; }
.q-adv > summary::before {
  content: '+'; display: inline-flex; align-items: center; justify-content: center;
  width: 15px; height: 15px; border-radius: var(--r-sm);
  background: var(--bg-card); border: 1px solid var(--bd-strong);
  font-size: 11px; line-height: 1; color: var(--t-3);
}
.q-adv[open] > summary::before { content: '−'; }
.q-adv > summary:hover { color: var(--c-brand); }
.q-adv-bd { padding: 2px 0 12px; border-top: 1px dashed var(--bd); }

.q-res {
  margin-top: 14px; border-radius: var(--r); padding: 12px 14px;
  border-left: 3px solid var(--bd-strong); background: var(--bg-2);
  font-size: 12.5px; line-height: 1.75;
}
.q-res.wait { color: var(--t-2); display: flex; align-items: center; gap: 8px; }
.q-res.ok { border-left-color: var(--c-ok); background: var(--c-ok-bg); color: #11583a; }
.q-res.bad { border-left-color: var(--c-err); background: var(--c-err-bg); color: #7c1c1c; }
.q-res-t {
  font-size: 13.5px; font-weight: 700; margin-bottom: 4px;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.q-res-badge {
  font-size: 11px; font-weight: 500; padding: 1px 7px; border-radius: var(--r-full);
  background: rgba(255, 255, 255, .72); color: var(--t-2); white-space: nowrap;
}
.q-res-line { word-break: break-word; }
.q-res-reply {
  margin-top: 6px; padding: 6px 9px; border-radius: var(--r-sm);
  background: rgba(255, 255, 255, .78); color: var(--t-1);
  font-family: var(--f-mono, ui-monospace, monospace); font-size: 12px;
}
.q-res-kv {
  margin-top: 7px; display: flex; flex-wrap: wrap; gap: 4px 14px;
  font-size: 12px; color: var(--t-2);
}
.q-res-kv b { color: var(--t-1); font-weight: 600; }
.q-res-kv .mono { font-size: 11.5px; word-break: break-all; }
.q-res-tips {
  margin-top: 8px; padding-top: 8px; border-top: 1px dashed rgba(0, 0, 0, .1);
  font-size: 12px; line-height: 1.7; color: var(--t-2);
}
/* 实际生效的 JDBC 地址：拼错的地址只能靠「平台到底连的是哪个」才看出来 */
.q-res-url {
  margin-top: 7px; padding: 5px 8px; border-radius: var(--r-sm);
  background: rgba(255, 255, 255, .7); font-size: 11.5px;
  word-break: break-all; line-height: 1.6; color: var(--t-2);
}
/* 自检入口：一句话说明 + 按钮，不要占掉一整行的高度 */
.ds-self-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ds-self-row > span { flex: 1 1 auto; min-width: 240px; }
.ds-self-row .btn { flex: 0 0 auto; }
.ds-self-tip { margin-top: 8px; line-height: 1.75; }
.ds-sql {
  margin: 6px 0 0; padding: 8px 10px; border-radius: var(--r-sm);
  background: var(--bg-3, #f4f5f7); font-size: 11.5px; line-height: 1.7;
  white-space: pre-wrap; word-break: break-all; color: var(--t-1);
}

/* 模型名称输入 + 拉取清单：输入框吃掉剩余宽度，按钮不换行 */
.q-pick { display: flex; gap: 6px; align-items: stretch; }
.q-pick .input { flex: 1 1 auto; min-width: 0; }
.q-pick .btn { flex: 0 0 auto; white-space: nowrap; }

/* 编辑模型的顶部状态条：三个状态标签一行，提示语单独一行。
   不并排放是因为「已启用 + 被 3 个智能体绑定」的后果说明动辄两行，
   和一排标签挤在同行会把标签挤成竖排。 */
.m-status {
  margin-bottom: 14px; padding: 10px 12px;
  border: 1px solid var(--bd); border-left: 3px solid var(--c-warn, #b8860b);
  border-radius: var(--r-sm); background: var(--bg-2, #fafbfc);
}
.m-status-row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.m-status-hint {
  margin-top: 7px; font-size: 11.5px; line-height: 1.7; color: var(--t-2);
}
/* 密钥下方的清除勾选：一行放下，不与输入框抢宽度 */
.m-chk {
  display: flex; align-items: center; gap: 6px;
  margin-top: 7px; font-size: 11.5px; color: var(--t-2); cursor: pointer;
}
.m-chk input { margin: 0; }

/* 候选模型：名字是一长串，用等宽小字横向铺开，超出高度滚动，
   46 个模型全展开会把「保存并连接」按钮挤出视口的做法必须避免 */
.q-models-tip {
  margin-top: 6px; font-size: 11.5px; line-height: 1.6; color: var(--t-2);
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.q-models-tip.bad { color: #7c1c1c; }
.q-models-tip b { color: var(--c-err); font-weight: 600; }
.q-models {
  margin-top: 6px; max-height: 152px; overflow-y: auto;
  display: flex; flex-wrap: wrap; gap: 5px;
  padding: 7px; border: 1px solid var(--bd); border-radius: 6px; background: var(--bg-2);
}
.q-model {
  font: inherit; font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 11.5px; line-height: 1.5; padding: 3px 8px;
  border: 1px solid var(--bd); border-radius: 5px;
  background: var(--bg-card); color: var(--t-1); cursor: pointer;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  transition: border-color .12s, background .12s, color .12s;
}
.q-model:hover { border-color: var(--c-brand); color: var(--c-brand); background: var(--c-brand-bg); }
.q-model.on, .q-model.hit {
  border-color: var(--c-brand); color: var(--c-brand); background: var(--c-brand-bg); font-weight: 600;
}
.q-model:disabled { opacity: .55; cursor: default; }

/* =====================================================================
   智能体工作台 v3（运行态 · 对话主界面）
   ---------------------------------------------------------------------
   设计意图：这里不是「配置页加个输入框」，而是平台里唯一一个天天要用的
   工作界面。因此放弃「三张卡片并排」的后台写法，改成应用窗口式布局：

     ┌ 工具条 ─────────────────────────────────┐
     │ 智能体身份 · 模型 · 动作                 │
     ├────────┬──────────────────┬─────────────┤
     │ 智能体  │  对话（吃掉全部）  │ 本次组装     │
     │ 列表    │  ────────────    │ （可收起）   │
     │        │  输入区            │             │
     └────────┴──────────────────┴─────────────┘

   三条硬规矩：
   1. 对话区是主角，其余都是配角——左右两栏不抢宽度，中栏不给上限。
   2. 高度不写死 calc 猜像素，由 JS 量出容器顶边后赋值，窗口缩放跟着变。
   3. 状态色只用在「必须马上看见」的地方（能不能跑、失败），
      其余全部交给留白与描边，避免整屏跳色。
   ===================================================================== */
.wb {
  --wb-side: 246px;
  --wb-ctx: 306px;
  display: grid;
  grid-template-columns: var(--wb-side) minmax(0, 1fr) var(--wb-ctx);
  background: var(--bg-card);
  border: 1px solid var(--bd);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
  height: 620px;            /* 兜底值，实际由 JS 按视口算 */
  min-height: 520px;
  /* .main 底部有 56px 内边距，负回来 40px，页面正好填满视口、不多出一条滚动条。
     JS 已按「顶边到视口底 - 16」算好高度，这里再补一刀。 */
  margin-bottom: -40px;
}
.wb.no-ctx { grid-template-columns: var(--wb-side) minmax(0, 1fr); }
.wb.no-ctx .wb-ctx { display: none; }

/* ------------------------------------------------------------ 顶部工具条 */
.wb-bar {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 58px;
  padding: 0 14px 0 16px;
  border-bottom: 1px solid var(--bd);
  background: linear-gradient(180deg, #fcfdfe, #f7f9fc);
}
.wb-bar-id { display: flex; align-items: center; gap: 11px; min-width: 0; }
.wb-ava {
  flex: none;
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 10px;
  font-size: 14px; font-weight: 700; color: #fff;
  background: linear-gradient(145deg, #2c7fc4, #15507f);
  box-shadow: 0 6px 14px -8px rgba(21, 80, 127, .9), inset 0 1px 0 rgba(255, 255, 255, .28);
}
.wb-ava.lg { width: 54px; height: 54px; border-radius: 15px; font-size: 21px; }
.wb-bar-t { min-width: 0; }
.wb-bar-t b {
  display: block; font-size: 14.5px; font-weight: 600; line-height: 1.35;
  color: var(--t-1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.wb-bar-t span { font-size: 11.5px; color: var(--t-3); }
.wb-bar-mid { display: flex; align-items: center; gap: 6px; margin-left: 6px; flex-wrap: wrap; }
.wb-bar-r { margin-left: auto; display: flex; align-items: center; gap: 7px; }

/* 状态与模型 chip：小、扁、不抢注意力 */
.wb-pill {
  display: inline-flex; align-items: center; gap: 5px;
  height: 23px; padding: 0 9px;
  border-radius: var(--r-full);
  font-size: 11.5px; color: var(--t-2);
  background: var(--bg-card); border: 1px solid var(--bd);
  white-space: nowrap;
}
.wb-pill .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--t-4); }
.wb-pill.ok { color: var(--c-ok); background: var(--c-ok-bg); border-color: rgba(28, 122, 78, .18); }
.wb-pill.ok .dot { background: var(--c-ok); }
.wb-pill.warn { color: var(--c-warn); background: var(--c-warn-bg); border-color: rgba(169, 105, 15, .2); }
.wb-pill.warn .dot { background: var(--c-warn); }
.wb-pill.bad { color: var(--c-err); background: var(--c-err-bg); border-color: rgba(166, 43, 43, .2); }
.wb-pill.bad .dot { background: var(--c-err); }
.wb-pill .mono { font-size: 11px; }
/* 「本会话基于旧版配置」可点：点它等于开新对话。
   做成胶囊而不是横幅，是因为它只在这一个会话里成立，换会话就该消失；
   横幅容易被当成全局通告，反而让人以为整个平台配置有问题。 */
.wb-pill.wb-ver { cursor: pointer; }
.wb-pill.wb-ver:hover { border-color: var(--c-warn); box-shadow: var(--shadow-xs); }

/* ------------------------------------------------------------ 左：智能体列表 */
.wb-side {
  display: flex; flex-direction: column; min-height: 0;
  border-right: 1px solid var(--bd);
  background: #f8fafc;
}
.wb-side-hd {
  display: flex; align-items: center; gap: 7px;
  padding: 12px 14px 8px;
  font-size: 11.5px; font-weight: 600; letter-spacing: .06em;
  color: var(--t-3); text-transform: none;
}
.wb-side-hd .n {
  margin-left: auto; font-weight: 500; letter-spacing: 0;
  color: var(--t-4); font-size: 11px;
}
.wb-agents { flex: 1; min-height: 0; overflow: auto; padding: 0 9px 12px; }
.wb-grp {
  padding: 9px 6px 5px; font-size: 11px; color: var(--t-4);
  display: flex; align-items: center; gap: 6px;
}
.wb-grp::after { content: ""; flex: 1; height: 1px; background: var(--bd-l); }

.wb-agent {
  position: relative;
  display: flex; align-items: flex-start; gap: 9px;
  padding: 9px 10px;
  margin-bottom: 2px;
  border-radius: 10px;
  cursor: pointer;
  transition: background .14s, box-shadow .14s;
}
.wb-agent:hover { background: #eef3f9; }
.wb-agent.on {
  background: var(--bg-card);
  box-shadow: 0 1px 2px rgba(16, 27, 43, .05), 0 6px 16px -12px rgba(16, 27, 43, .4);
}
/* 选中态左侧一道 3px 品牌条：比整块变色克制，但一眼能定位 */
.wb-agent.on::before {
  content: ""; position: absolute; left: 0; top: 9px; bottom: 9px; width: 3px;
  border-radius: 0 3px 3px 0;
  background: linear-gradient(180deg, #2c7fc4, #15507f);
}
.wb-agent.dim { opacity: .58; }
.wb-agent.dim:hover { opacity: .9; }

.wb-agent-ic {
  flex: none; width: 30px; height: 30px; border-radius: 9px;
  display: grid; place-items: center;
  font-size: 12px; font-weight: 700; color: #fff;
  background: linear-gradient(145deg, #7f9db9, #5b7691);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25);
}
.wb-agent.on .wb-agent-ic { background: linear-gradient(145deg, #2c7fc4, #15507f); }
.wb-agent-ic.mute { background: linear-gradient(145deg, #ccd6e2, #b4c1d0); color: #fff; }
.wb-agent-bd { min-width: 0; flex: 1; }
.wb-agent-nm {
  display: flex; align-items: center; gap: 5px;
  font-size: 13px; font-weight: 600; color: var(--t-1);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.wb-agent-sub {
  margin-top: 2px; font-size: 11.5px; color: var(--t-3);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.wb-agent-ft { margin-top: 5px; display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--t-4); }
.wb-agent-ft .sep { width: 1px; height: 9px; background: var(--bd-strong); }
.wb-agent-why {
  margin-top: 5px; padding: 4px 7px; border-radius: var(--r-sm);
  background: var(--c-warn-bg); color: #8a5709;
  font-size: 11px; line-height: 1.5;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.wb-dot { flex: none; width: 6px; height: 6px; border-radius: 50%; }
.wb-dot.ok { background: var(--c-ok); }
.wb-dot.no { background: #c3ccd8; }

/* ------------------------------------------------------------ 中：对话 */
.wb-main {
  display: flex; flex-direction: column; min-width: 0; min-height: 0;
  background: var(--bg-card);
}
.wb-chat {
  flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden;
  padding: 22px 0 10px;
  scroll-behavior: smooth;
  display: flex;
  flex-direction: column;
  /* 上下一小段渐隐：滚动时文字在边缘是「淡出」而不是被硬切一条线 */
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 9px,
                      #000 calc(100% - 12px), transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 9px,
              #000 calc(100% - 12px), transparent 100%);
}
/* 空态：内容上下各分一半空白。不加这句，内容会贴在顶部，
   底下空出两百多像素，看起来是「没做完」而不是「留白」。 */
.wb-chat > .wb-hello { margin-top: auto; margin-bottom: auto; }
.wb-flow { width: 100%; }
/* 对话内容统一收在一个「阅读栏」里，超宽屏不会把一行拉到 1600px */
.wb-flow { max-width: 780px; margin: 0 auto; padding: 0 24px; }

/* 预检条：只在有阻断/提醒时出现，通过时收成一行细条，不占视觉重量 */
.wb-pf {
  margin: 0 auto 4px; max-width: 780px; padding: 0 24px;
  width: 100%;
}
.wb-pf-in {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 11px; border-radius: var(--r);
  font-size: 12px; line-height: 1.6;
}
.wb-pf.ok .wb-pf-in { background: #f2f8f5; color: #1b6b47; }
.wb-pf.warn .wb-pf-in { background: var(--c-warn-bg); color: #8a5709; }
.wb-pf.bad .wb-pf-in { background: var(--c-err-bg); color: #8f2626; }
.wb-pf-in b { font-weight: 600; }
.wb-pf-in .tail { margin-left: auto; flex: none; }
.wb-pf-link {
  color: inherit; text-decoration: none; font-size: 11.5px;
  border-bottom: 1px dashed currentColor; opacity: .8; cursor: pointer;
}
.wb-pf-bd { margin-top: 6px; padding: 8px 11px; border-radius: var(--r); background: var(--bg-2); border: 1px solid var(--bd-l); }
.wb-pf-item { display: flex; gap: 8px; padding: 4px 0; font-size: 12px; }
.wb-pf-k { flex: none; width: 13px; font-weight: 700; }
.wb-pf-item.ok .wb-pf-k { color: var(--c-ok); }
.wb-pf-item.warn .wb-pf-k { color: var(--c-warn); }
.wb-pf-item.bad .wb-pf-k { color: var(--c-err); }
.wb-pf-item b { font-weight: 600; color: var(--t-1); }
.wb-pf-item .small { display: block; color: var(--t-3); margin-top: 1px; }

/* 空态：这是第一印象，必须有信息量——说明这个智能体能干什么、怎么开始 */
.wb-hello { max-width: 780px; margin: 0 auto; padding: 18px 24px 8px; }
.wb-hello-hd { display: flex; align-items: center; gap: 14px; }
.wb-hello-t { font-size: 20px; font-weight: 650; letter-spacing: .01em; color: var(--t-1); }
.wb-hello-t em { font-style: normal; color: var(--c-brand); }
.wb-hello-d { margin-top: 9px; font-size: 13px; line-height: 1.85; color: var(--t-2); }
.wb-hello-sub { margin: 22px 0 9px; font-size: 11.5px; font-weight: 600; letter-spacing: .06em; color: var(--t-3); }
.wb-egs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.wb-eg {
  padding: 11px 12px; border: 1px solid var(--bd); border-radius: 11px;
  background: var(--bg-card); cursor: pointer;
  transition: border-color .14s, box-shadow .14s, transform .14s;
}
.wb-eg:hover {
  border-color: rgba(21, 80, 127, .3);
  box-shadow: 0 8px 20px -16px rgba(16, 27, 43, .5);
  transform: translateY(-1px);
}
.wb-eg-t { font-size: 12.5px; font-weight: 600; color: var(--t-1); }
.wb-eg-d {
  margin-top: 3px; font-size: 11.5px; color: var(--t-3); line-height: 1.6;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.wb-hello-cap { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 6px; }

/* 消息 */
.wb-msg { display: flex; margin-bottom: 20px; }
.wb-msg.me { justify-content: flex-end; }
.wb-msg-bd { min-width: 0; max-width: 100%; }
.wb-msg.me .wb-msg-bd { max-width: 78%; }

.wb-bubble-me {
  padding: 10px 14px; border-radius: 14px 14px 4px 14px;
  background: linear-gradient(145deg, #2b6f9f, #15507f);
  color: #fff; font-size: 13.5px; line-height: 1.78;
  box-shadow: 0 8px 18px -14px rgba(21, 80, 127, .9);
  white-space: pre-wrap; word-break: break-word;
}
.wb-ai-hd { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.wb-ai-ic {
  flex: none; width: 24px; height: 24px; border-radius: 7px;
  display: grid; place-items: center; font-size: 10.5px; font-weight: 700; color: #fff;
  background: linear-gradient(145deg, #2c7fc4, #15507f);
}
.wb-ai-hd b { font-size: 12.5px; font-weight: 600; color: var(--t-1); }
.wb-ai-meta { font-size: 11px; color: var(--t-4); display: flex; gap: 8px; }
.wb-ai-body { font-size: 13.5px; line-height: 1.9; color: var(--t-1); }
.wb-ai-body .md > *:first-child { margin-top: 0; }
.wb-ai-body .md > *:last-child { margin-bottom: 0; }
.wb-ai-ft {
  margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
  font-size: 11px; color: var(--t-3);
}
.wb-skill-tag {
  padding: 1px 7px; border-radius: var(--r-full);
  background: var(--c-brand-bg); color: var(--c-brand-d); font-size: 11px;
}
.wb-copy {
  margin-left: auto; font-size: 11px; color: var(--t-4);
  cursor: pointer; text-decoration: none; border: none; background: none;
}
.wb-copy:hover { color: var(--c-brand); }

/* 失败与演练：不伪装成正常回答 */
.wb-fail {
  border: 1px solid rgba(166, 43, 43, .22); border-radius: 12px;
  background: #fffafa; padding: 12px 14px;
}
.wb-fail-hd { display: flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600; color: #8f2626; }
.wb-fail-txt { margin-top: 7px; font-size: 12.5px; line-height: 1.8; color: #5d2323; word-break: break-word; }
.wb-fail-tip { margin-top: 9px; padding-top: 8px; border-top: 1px dashed rgba(166, 43, 43, .18); font-size: 11.5px; color: var(--t-3); line-height: 1.7; }
.wb-dry {
  border: 1px solid rgba(44, 127, 196, .22); border-radius: 12px;
  background: #f7fbff; padding: 12px 14px;
}
.wb-dry-hd { display: flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600; color: var(--c-brand-d); }
.wb-dry-txt { margin-top: 7px; font-size: 12.5px; line-height: 1.85; color: var(--t-2); }

/* 打字中：三个点，比整条「加载中」轻 */
.wb-typing { display: flex; align-items: center; gap: 8px; padding: 4px 0; }
.wb-typing .t { font-size: 12px; color: var(--t-3); }
.wb-typing .d { display: flex; gap: 3px; }
.wb-typing .d i {
  width: 5px; height: 5px; border-radius: 50%; background: var(--c-brand-l);
  animation: wb-bounce 1.15s infinite ease-in-out;
}
.wb-typing .d i:nth-child(2) { animation-delay: .14s; }
.wb-typing .d i:nth-child(3) { animation-delay: .28s; }
@keyframes wb-bounce {
  0%, 62%, 100% { transform: translateY(0); opacity: .45; }
  30% { transform: translateY(-4px); opacity: 1; }
}

/* ------------------------------------------------------------ 输入区 */
.wb-composer { padding: 4px 24px 14px; }
.wb-composer-in { max-width: 780px; margin: 0 auto; }

/* 待发送队列：浮在输入框上沿，不占地（空队列 display:none）。
   没有它的话，运行中的几十秒里用户只能干等——想追问一句就得掐着时机再打。 */
.wb-queue { display: none; }
.wb-queue.on {
  display: block;
  margin-bottom: 8px;
  padding: 7px 9px 8px;
  border: 1px solid var(--bd);
  border-radius: 12px;
  background: var(--bg-2);
  box-shadow: 0 10px 26px -24px rgba(16, 27, 43, .7);
  /* 排十几条的时候不能把输入框顶到屏幕外，超出就自己滚 */
  max-height: 172px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.wb-q-hd {
  display: flex; align-items: center; gap: 6px;
  padding: 0 2px 6px;
  font-size: 11.5px; color: var(--t-3);
}
.wb-q-hd b { color: var(--c-brand-d); font-weight: 600; }
.wb-q-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: #d9a13c; flex: none;
}
.wb-q-tip { margin-left: auto; color: var(--t-4); font-size: 11px; }
.wb-q-item {
  display: flex; align-items: center; gap: 8px;
  margin-top: 5px; padding: 5px 7px;
  border: 1px solid var(--bd); border-radius: 8px;
  background: var(--bg-card);
}
.wb-q-no {
  flex: none; width: 18px; height: 18px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 10.5px; font-variant-numeric: tabular-nums;
  color: #fff; background: var(--c-brand); opacity: .85;
}
.wb-q-tx {
  flex: 1; min-width: 0;
  font-size: 12.5px; color: var(--t-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.wb-q-del {
  flex: none; width: 20px; height: 20px;
  display: grid; place-items: center;
  border: none; border-radius: 6px; background: transparent;
  color: var(--t-4); font-size: 11px; line-height: 1; cursor: pointer;
  transition: background .13s, color .13s;
}
.wb-q-del:hover { background: rgba(198, 74, 74, .1); color: #c64a4a; }
/* 窄屏让位给问题本身，那行说明文字在这里只会挤掉正文 */
@media (max-width: 760px) {
  .wb-q-tip { display: none; }
  .wb-queue.on { max-height: 132px; }
}
.wb-box {
  border: 1px solid var(--bd-strong);
  border-radius: 16px;
  background: var(--bg-card);
  box-shadow: 0 1px 2px rgba(16, 27, 43, .04), 0 14px 34px -26px rgba(16, 27, 43, .55);
  transition: border-color .15s, box-shadow .15s;
}
.wb-box:focus-within {
  border-color: rgba(21, 80, 127, .42);
  box-shadow: 0 1px 2px rgba(16, 27, 43, .04), 0 0 0 3px rgba(21, 80, 127, .09),
              0 16px 36px -26px rgba(16, 27, 43, .6);
}
.wb-ta {
  display: block; width: 100%;
  min-height: 92px; max-height: 220px;
  padding: 13px 15px 4px;
  border: none; outline: none; resize: none;
  font-family: var(--sans); font-size: 13.5px; line-height: 1.78; color: var(--t-1);
  background: transparent;
}
.wb-ta::placeholder { color: var(--t-4); }
.wb-tools {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 9px 8px 12px;
}
.wb-chips {
  display: flex; align-items: center; gap: 5px;
  flex: 1; min-width: 0; overflow-x: auto; padding-bottom: 1px;
  scrollbar-width: none;
}
.wb-chips::-webkit-scrollbar { height: 0; }
.wb-chips-lb { flex: none; font-size: 11px; color: var(--t-4); margin-right: 2px; }
.wb-chip {
  flex: none;
  padding: 2px 9px; border-radius: var(--r-full);
  border: 1px solid var(--bd); background: var(--bg-card);
  font-size: 11.5px; color: var(--t-2);
  cursor: pointer; user-select: none;
  transition: all .13s;
}
.wb-chip:hover { border-color: rgba(21, 80, 127, .35); color: var(--c-brand); }
.wb-chip.on {
  background: var(--c-brand-bg); border-color: rgba(21, 80, 127, .3);
  color: var(--c-brand-d); font-weight: 600;
}
.wb-chip.off { color: var(--t-4); background: var(--bg-2); cursor: not-allowed; text-decoration: line-through; }
.wb-acts { flex: none; display: flex; align-items: center; gap: 9px; }
.wb-dry-lb {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; color: var(--t-3); cursor: pointer; user-select: none;
}
.wb-dry-lb input { width: 13px; height: 13px; }
.wb-send {
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center;
  border: none; cursor: pointer; color: #fff;
  background: linear-gradient(145deg, #2c7fc4, #15507f);
  box-shadow: 0 8px 18px -10px rgba(21, 80, 127, .85);
  transition: transform .13s, box-shadow .13s, opacity .13s;
}
.wb-send:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 10px 22px -10px rgba(21, 80, 127, .95); }
.wb-send:disabled { opacity: .5; cursor: default; box-shadow: none; }
.wb-send svg { width: 16px; height: 16px; }
.wb-foot {
  max-width: 780px; margin: 7px auto 0;
  font-size: 11px; color: var(--t-4); text-align: center;
}

/* ------------------------------------------------------------ 右：本次组装 */
.wb-ctx {
  display: flex; flex-direction: column; min-height: 0;
  border-left: 1px solid var(--bd);
  background: #f8fafc;
}
.wb-ctx-hd {
  display: flex; align-items: center; gap: 7px;
  padding: 12px 12px 8px 14px;
  font-size: 11.5px; font-weight: 600; letter-spacing: .06em; color: var(--t-3);
}
.wb-ctx-hd .close {
  margin-left: auto; width: 22px; height: 22px; border: none; border-radius: var(--r-sm);
  background: transparent; color: var(--t-4); cursor: pointer; display: grid; place-items: center;
}
.wb-ctx-hd .close:hover { background: #e9eef5; color: var(--t-2); }
.wb-tabs { display: flex; gap: 2px; padding: 0 12px 8px; }
.wb-tab {
  padding: 4px 10px; border-radius: var(--r-sm);
  font-size: 11.5px; color: var(--t-3); cursor: pointer;
}
.wb-tab.on { background: var(--bg-card); color: var(--t-1); font-weight: 600; box-shadow: var(--shadow-xs); }
.wb-ctx-bd { flex: 1; min-height: 0; overflow: auto; padding: 0 12px 14px; }
.wb-ctx-empty { padding: 8px 2px; font-size: 12px; line-height: 1.85; color: var(--t-3); }

/* 未运行时的摘要：右栏空着不如把「这次会用上什么」先摆出来 */
.wb-sum { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin-bottom: 12px; }
.wb-sum-i {
  padding: 8px 10px; border-radius: var(--r); background: var(--bg-card);
  border: 1px solid var(--bd-l);
}
.wb-sum-k { font-size: 10.5px; color: var(--t-4); letter-spacing: .04em; }
.wb-sum-v { margin-top: 2px; font-size: 15px; font-weight: 650; color: var(--t-1); line-height: 1.3; }
.wb-sum-v small { font-size: 11px; font-weight: 400; color: var(--t-3); margin-left: 2px; }

/* 说明文字也是 span，原来的 `> span` 会把它也按 62px 宽处理，
   结果「≈1683 tk / 上限 8192」被挤成三行。只给第一个（标签）限宽。 */
.wb-trace-row {
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
  padding: 6px 0; border-bottom: 1px solid var(--bd-l); font-size: 12px;
}
.wb-trace-row > span:first-child { flex: none; width: 62px; color: var(--t-3); }
.wb-trace-row > b { color: var(--t-1); font-weight: 600; word-break: break-word; }
.wb-trace-row > .small { flex: 1 1 auto; min-width: 0; line-height: 1.6; }
.wb-trace-row .code { font-size: 11px; }
.wb-sec { margin-top: 13px; }
.wb-sec-hd {
  display: flex; align-items: center; gap: 6px;
  font-size: 11.5px; font-weight: 600; color: var(--t-2); margin-bottom: 5px;
}
.wb-li {
  padding: 4px 0; font-size: 12px; color: var(--t-1);
  border-bottom: 1px dashed var(--bd-l); line-height: 1.6;
}
.wb-li:last-child { border-bottom: none; }
.wb-link { font-size: 11px; color: var(--c-brand); text-decoration: none; margin-left: auto; }
.wb-link:hover { text-decoration: underline; }
.wb-pre {
  max-height: 260px; overflow: auto; margin: 6px 0 0;
  padding: 9px 10px; border-radius: var(--r);
  background: #0f1b2b; color: #c8d6e5;
  font-family: var(--mono); font-size: 11px; line-height: 1.72;
  white-space: pre-wrap; word-break: break-word;
}
.wb-kv { display: flex; gap: 8px; padding: 3px 0; font-size: 12px; }
.wb-kv > span { flex: none; width: 52px; color: var(--t-3); }
.wb-kv > b { font-weight: 500; color: var(--t-1); word-break: break-all; }

/* 运行记录弹窗里的行 */
.wb-sess {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border: 1px solid var(--bd); border-radius: var(--r);
  margin-bottom: 7px; cursor: pointer; background: var(--bg-card);
  transition: border-color .13s, box-shadow .13s;
}
.wb-sess:hover { border-color: rgba(21, 80, 127, .3); box-shadow: var(--shadow-xs); }
.wb-sess-l { min-width: 0; flex: 1; }
.wb-sess-l b { font-size: 13px; font-weight: 600; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wb-sess-r { flex: none; display: flex; align-items: center; gap: 10px; }
/* 「清掉」平时压得很轻：整行是「点开继续问」的主操作，
   删除是偶发动作，不该跟主操作抢注意力，但也不能藏到看不见 */
.wb-sess-r .btn-ghost { color: var(--t-3); }
.wb-sess:hover .wb-sess-r .btn-ghost { color: var(--c-err); }

/* 收起右栏后中栏会变宽，这点交给 grid；不额外放悬浮按钮——
   工具条上的那个按钮改个文字就够了，页面上出现两个同名按钮会让人以为点哪个不一样。 */
.wb-main { position: relative; }

/* 窄屏：右栏下沉为抽屉（默认收起），保证对话宽度 */
@media (min-width: 1700px) {
  .wb { --wb-side: 268px; --wb-ctx: 336px; }
  .wb-flow, .wb-composer-in, .wb-foot, .wb-pf { max-width: 820px; }
  .wb-hello { max-width: 820px; }
}
@media (max-width: 1400px) {
  .wb { --wb-side: 232px; --wb-ctx: 286px; }
}
@media (max-width: 1200px) {
  /* 窄屏不砍掉组装面板，改成覆盖式抽屉：
     砍掉的话「这次到底用了什么」就看不到了，而那正是这页存在的理由。 */
  .wb { grid-template-columns: var(--wb-side) minmax(0, 1fr); position: relative; }
  .wb-ctx {
    position: absolute; top: 58px; right: 0; bottom: 0; width: 336px; z-index: 20;
    box-shadow: -20px 0 44px -30px rgba(16, 27, 43, .65);
  }
  .wb.no-ctx .wb-ctx { display: none; }
  .wb-bar { padding-right: 10px; }
}
@media (max-width: 900px) {
  .wb { grid-template-columns: minmax(0, 1fr); }
  .wb-side { display: none; }
  .wb-egs { grid-template-columns: minmax(0, 1fr); }
}

/* =====================================================================
   视觉打磨 v3（全站）
   ---------------------------------------------------------------------
   这一层只做「手感」，不动任何页面结构：结构与类名一旦改，页面 JS 全要跟，
   风险远大于收益。这里改的都是同一选择器的后置覆盖。

   三件事：
   1. 滚动条收细——浏览器默认滚动条又宽又亮，是「廉价感」最大的来源之一。
   2. 表头吸顶 + 行悬停分层——长表格滚动时列名还在，扫读成本直接降一半。
   3. 主按钮由纯色改为同色系微渐变，配合更短的投影，看起来是「按得下去」的。
   ===================================================================== */

/* 细滚动条：宽度 8px，轨道透明，滑块用中性灰，悬停才加深 */
* { scrollbar-width: thin; scrollbar-color: #c9d3df transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: #ccd6e2; border-radius: 99px;
  border: 2px solid transparent; background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: #b3c1d1; background-clip: content-box; }
::-webkit-scrollbar-corner { background: transparent; }

/* 选中文字用品牌淡色，默认的系统蓝在深蓝界面里是冲突的 */
::selection { background: rgba(44, 127, 196, .2); }

/* ------------------------------------------------------------ 页头 */
.page-hd { margin-bottom: 16px; }
.page-hd h2 {
  font-size: 20px; font-weight: 650; letter-spacing: .015em; line-height: 1.35;
}
.page-hd .desc { margin-top: 6px; max-width: 760px; font-size: 12.5px; color: var(--t-3); }

/* ------------------------------------------------------------ 表格 */
table.tb thead th {
  position: sticky; top: 0; z-index: 2;
  background: #f6f8fb;
  font-size: 12px; font-weight: 600; color: var(--t-2);
  letter-spacing: .02em;
  border-bottom: 1px solid var(--bd-strong);
}
/* 表格第一列与最后一列各留一点内边距，贴边看着像没做完 */
table.tb thead th:first-child, table.tb tbody td:first-child { padding-left: 18px; }
table.tb thead th:last-child, table.tb tbody td:last-child { padding-right: 18px; }
table.tb tbody tr:hover td { background: #f7fafd; }
/* 分组标题行（如「私有化部署」） */
table.tb tbody tr.grp td {
  background: #f6f8fb; font-size: 12px; font-weight: 600; color: var(--t-2);
}

/* ------------------------------------------------------------ 卡片 */
.card { transition: box-shadow .16s, border-color .16s; }
.card-hd h3 { letter-spacing: .01em; }
/* 只给「列表里的可点卡片」加浮起，静态面板浮起来反而显乱 */
.card.hoverable:hover { border-color: var(--bd-strong); box-shadow: var(--shadow-l); }

/* ------------------------------------------------------------ 按钮 */
.btn-primary {
  background: linear-gradient(180deg, #1c5f92, #15507f);
  border-color: #12456c;
  box-shadow: 0 1px 2px rgba(16, 27, 43, .14), 0 8px 18px -12px rgba(21, 80, 127, .9);
}
.btn-primary:hover {
  background: linear-gradient(180deg, #22699e, #17567f);
  border-color: #12456c;
}
.btn-primary:active { box-shadow: none; }
.btn { font-weight: 500; letter-spacing: .01em; }

/* ------------------------------------------------------------ 表单 */
.input:focus, .select:focus, .textarea:focus {
  box-shadow: 0 0 0 3px rgba(21, 80, 127, .09);
}

/* ------------------------------------------------------------ 标签 */
.tag { font-weight: 500; letter-spacing: .01em; }

/* ------------------------------------------------------------ 弹窗 */
.modal { box-shadow: 0 2px 8px rgba(10, 22, 38, .1), 0 40px 80px -40px rgba(10, 22, 38, .55); }
.modal-hd { border-bottom: 1px solid var(--bd-l); }
.modal-ft { border-top: 1px solid var(--bd-l); }

/* ------------------------------------------------------------ 对话里的 Markdown */
/* 回答正文里的表格：有边框、有斑马纹、表头浅底。
   正文表格和列表页表格不是一回事——后者一眼扫行，前者要能「读懂一格」，
   所以这里把格子框起来，且不让表头吸顶（消息里的表滚走就该滚走）。 */
.wb-ai-body table.tb {
  border: 1px solid var(--bd); border-radius: var(--r); overflow: hidden;
  margin: 10px 0 14px; font-size: 12.5px;
}
.wb-ai-body table.tb thead th {
  position: static; background: #f3f6fa; color: var(--t-2);
  font-size: 12px; font-weight: 600; padding: 7px 12px;
  border-bottom: 1px solid var(--bd);
}
.wb-ai-body table.tb tbody td { padding: 7px 12px; border-bottom: 1px solid var(--bd-l); }
.wb-ai-body table.tb thead th:first-child,
.wb-ai-body table.tb tbody td:first-child { padding-left: 12px; }
.wb-ai-body table.tb thead th:last-child,
.wb-ai-body table.tb tbody td:last-child { padding-right: 12px; }
.wb-ai-body table.tb tbody tr:nth-child(even) td { background: #fbfcfe; }
.wb-ai-body table.tb tbody tr:last-child td { border-bottom: none; }
.wb-ai-body table.tb tbody tr:hover td { background: #f5f9fd; }

/* 小标题：正文里的 ### 与页面标题不同级，加一条细线分隔，长回答才好定位 */
.wb-ai-body .md .md-h {
  margin: 20px 0 8px; padding-bottom: 6px;
  font-size: 14px; font-weight: 600; color: var(--t-1);
  border-bottom: 1px solid var(--bd-l);
}
.wb-ai-body .md .md-h:first-child { border-bottom: none; padding-bottom: 0; }
.wb-ai-body .md strong { font-weight: 650; color: #0b1626; }
.wb-ai-body .md ul, .wb-ai-body .md ol { margin: 6px 0 13px; padding-left: 21px; }
.wb-ai-body .md li { margin-bottom: 5px; }
.wb-ai-body .md .md-quote { font-size: 12.5px; }

/* ------------------------------------------------------------ 矮屏适配 */
/* 900 高的笔记本（可用约 800）里，欢迎区那四张示例卡加上标题会顶到输入框上沿。
   空态是「第一眼」，不能一进来就要滚动；所以矮屏只压留白与字号，不删内容。 */
@media (max-height: 880px) {
  .wb-hello { padding-top: 4px; padding-bottom: 0; }
  .wb-hello-t { font-size: 18px; }
  .wb-hello-d { margin-top: 6px; font-size: 12.5px; line-height: 1.75; }
  .wb-hello-sub { margin: 13px 0 7px; }
  .wb-eg { padding: 9px 11px; }
  .wb-eg-d { -webkit-line-clamp: 1; }
  .wb-hello-cap { margin-top: 10px; }
  .wb-chat { padding-top: 14px; }
  .wb-ta { min-height: 76px; }
}

/* ------------------------------------------------------------------ 快捷对话 */
/* 工作台：开聊后常驻输入框上方的一排快捷问法，点一下即发。
   内容来自智能体配置页「① 基础信息 → 快捷对话」，不在前端写死。 */
.wb-quick {
  display: flex; align-items: center; gap: 6px;
  margin-bottom: 8px; padding: 0 2px;
  overflow-x: auto; scrollbar-width: none;
}
.wb-quick[hidden] { display: none; }
.wb-quick::-webkit-scrollbar { height: 0; }
.wb-quick-hd { flex: none; font-size: 11px; color: var(--t-4); margin-right: 2px; }
.wb-quick-btn {
  flex: none; height: 26px; padding: 0 10px;
  border: 1px solid var(--bd); border-radius: 999px;
  background: var(--bg-card); color: var(--t-2);
  font-size: 12px; white-space: nowrap; cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
}
.wb-quick-btn:hover { border-color: var(--c-brand); color: var(--c-brand-d); background: var(--bg-2); }

/* 配置页 · 快捷对话：标题一行、问题一行，右侧上移/下移/删除 */
.q-row {
  display: grid; grid-template-columns: 220px 1fr 132px;
  gap: 8px; align-items: start;
  padding: 9px 10px; margin-bottom: 8px;
  border: 1px solid var(--bd); border-radius: 10px; background: var(--bg-2);
}
.q-row .q-q { min-height: 60px; resize: vertical; }
.q-ops { display: flex; gap: 4px; justify-content: flex-end; }
@media (max-width: 900px) {
  .q-row { grid-template-columns: 1fr; }
  .q-ops { justify-content: flex-start; }
}

/* 字段映射弹窗底部：按钮与提示同一行，窄屏自动折行 */
.fld-add { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* =====================================================================
   字段说明「?」与 Markdown 输入（提示模板 / 技能正文 / 长文本字段共用）
   ---------------------------------------------------------------------
   「?」做成 14px 的小圆：它是辅助入口，不该和必填星号抢注意力。
   点开是一张弹窗而不是 tooltip——四条要求 hover 读不完，示例还得能复制。
   ===================================================================== */
.help-q {
  display: inline-flex; align-items: center; justify-content: center;
  width: 14px; height: 14px; margin-left: 6px;
  border: 1px solid var(--bd-strong); border-radius: var(--r-full);
  background: #fff; color: var(--t-3);
  font-size: 10.5px; font-weight: 600; line-height: 1;
  vertical-align: 1px; cursor: pointer; user-select: none;
}
.help-q:hover, .help-q:focus-visible {
  border-color: var(--c-brand-l); color: var(--c-brand); background: var(--c-brand-bg); outline: none;
}

.help-wrap { font-size: 13px; line-height: 1.78; color: var(--t-1); }
.help-lead {
  padding: 10px 12px; margin-bottom: 14px;
  background: var(--c-brand-bg); border-radius: var(--r); color: var(--t-1);
}
.help-sec { margin-bottom: 14px; }
.help-sec:last-child { margin-bottom: 0; }
.help-t {
  font-size: 12.5px; font-weight: 600; color: var(--t-2);
  letter-spacing: .02em; margin-bottom: 6px;
}
.help-ul { margin: 0; padding-left: 19px; }
.help-ul li { margin-bottom: 5px; color: var(--t-1); }
.help-ul li b { color: var(--t-1); }
.help-eg {
  margin: 0; padding: 10px 12px;
  background: var(--bg-2); border: 1px solid var(--bd-l); border-radius: var(--r);
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 12px; line-height: 1.72; color: var(--t-2);
  white-space: pre-wrap; word-break: break-word;
}

/* --- Markdown 编辑器 --- */
.md-ed {
  border: 1px solid var(--bd); border-radius: var(--r); background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.md-ed:focus-within { border-color: var(--c-brand-l); box-shadow: 0 0 0 3px var(--c-brand-soft); }
.md-ed.md-drag { border-style: dashed; border-color: var(--c-brand-l); background: var(--c-brand-bg); }
.md-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 4px 6px 4px 8px;
  border-bottom: 1px solid var(--bd-l); background: var(--bg-2);
  border-radius: var(--r) var(--r) 0 0;
}
.md-tools, .md-acts { display: flex; align-items: center; gap: 2px; }
.md-tool {
  height: 22px; min-width: 22px; padding: 0 6px;
  border: 1px solid transparent; border-radius: var(--r-sm);
  background: none; color: var(--t-3);
  font-size: 12px; font-family: inherit; line-height: 1; cursor: pointer;
}
.md-tool:hover { background: #fff; border-color: var(--bd); color: var(--t-1); }
.md-tab {
  height: 22px; padding: 0 9px;
  border: 1px solid transparent; border-radius: var(--r-sm);
  background: none; color: var(--t-3);
  font-size: 12px; font-family: inherit; cursor: pointer;
}
.md-tab:hover { color: var(--t-1); }
.md-tab.on { background: #fff; border-color: var(--bd); color: var(--t-1); font-weight: 600; }
.md-count { margin-left: 6px; font-size: 11.5px; color: var(--t-4); min-width: 42px; text-align: right; }
.md-ta {
  border: none !important; border-radius: 0 0 var(--r) var(--r) !important;
  padding: 9px 11px; line-height: 1.72; resize: vertical; min-height: 62px;
  box-shadow: none !important;
}
.md-view { padding: 10px 12px; max-height: 420px; overflow: auto; }
.md-view .md { font-size: 13px; }

/* 放大编辑：左写右看 */
.md-big { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; height: 62vh; }
.md-big-ta {
  height: 100%; resize: none; padding: 12px;
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 12.5px; line-height: 1.8;
}
.md-big-pv {
  height: 100%; overflow: auto; padding: 12px 14px;
  border: 1px solid var(--bd); border-radius: var(--r); background: var(--bg-2);
}
@media (max-width: 900px) {
  .md-big { grid-template-columns: 1fr; grid-template-rows: 1fr 1fr; height: 70vh; }
}
/* 必填星号手写在「?」前面：::after 的星号会跑到问号后面，读起来是「名称 ? *」 */
.field .req-star { margin-left: 3px; color: var(--c-err); }

/* =====================================================================
   字段批量配置：勾选列、选中条、参数对照表
   ---------------------------------------------------------------------
   勾选列压到 38px：它是操作入口，不该和字段名抢宽度。
   选中后不另开页签、不弹二级面板，只在本步骤条下面浮一条，
   因为「选了哪些」和「能做什么」得在同一视野里。
   ===================================================================== */
.tb th.ck-col, .tb td.ck-col { width: 38px; padding-left: 12px; padding-right: 0; }
.tb .ck, .sel-bar .ck { width: 14px; height: 14px; cursor: pointer; accent-color: var(--c-brand); }
.tb tr.on td { background: #f6fafd; }

.sel-bar {
  display: flex; align-items: center; gap: 10px;
  margin-top: 10px; padding: 9px 14px;
  background: var(--c-brand-bg); border: 1px solid var(--c-brand-soft);
  border-radius: var(--r);
  font-size: 13px; color: var(--t-1);
}
.sel-bar.hidden { display: none; }
.sel-bar b { color: var(--c-brand); }

/* 对照表：一行一个字段，参数名就在这里定。表格里塞输入框，所以行高放大到 42px */
.pt-map td { padding-top: 6px; padding-bottom: 6px; }
.pt-map .input { height: 28px; font-size: 12.5px; }
.pt-map .input.bad { border-color: var(--c-err); background: #fff8f8; }
.pt-para {
  padding: 9px 12px; margin-bottom: 10px;
  background: var(--bg-2); border: 1px solid var(--bd-l); border-radius: var(--r-sm);
  font-size: 12px; line-height: 1.7; color: var(--t-2);
}
.pt-para .code { margin-right: 6px; }
.pt-hd {
  display: flex; align-items: center; gap: 10px;
  margin: 14px 0 8px; font-size: 12.5px; color: var(--t-2);
}

/* 对照表自己滚，不撑高弹窗：字段可能几十个，撑高之后底部的按钮和表格尾部一起被推出视野，
   看起来就像「只有三行」。表头跟着 sticky，滚下去还知道每列是什么。 */
/* 对照表吃掉弹窗剩余高度并自己滚：字段几十个时按钮始终在视野内，
   字段只有三四个时也不会被外层裁掉最后一行——截断比滚动更糟，它让人以为就这么多。 */
.m-batch .modal-bd { display: flex; flex-direction: column; }
.m-batch #bw-a:not(.hidden), .m-batch #bw-b:not(.hidden) {
  display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0;
}
.m-batch #bw-map, .m-batch #bw-skill-tb {
  flex: 1 1 auto; min-height: 96px; overflow-y: auto; border-radius: var(--r-sm);
}
.pt-map thead th {
  position: sticky; top: 0; z-index: 1;
  background: var(--bg-2);
}

/* 滚动条要看得见：对照表里藏着一行和一段空白，观感上分不清。
   这是唯一一处「内容超出必须让人知道」的容器。 */
.m-batch #bw-map::-webkit-scrollbar, .m-batch #bw-skill-tb::-webkit-scrollbar { width: 8px; }
.m-batch #bw-map::-webkit-scrollbar-thumb, .m-batch #bw-skill-tb::-webkit-scrollbar-thumb {
  background: #cfd8e3; border-radius: 4px;
}
.m-batch #bw-map::-webkit-scrollbar-thumb:hover, .m-batch #bw-skill-tb::-webkit-scrollbar-thumb:hover {
  background: #b6c3d2;
}
.m-batch #bw-map, .m-batch #bw-skill-tb { scrollbar-width: thin; }

/* 批量弹窗里的方式卡片收一档：三张卡片的说明是背景信息，不该把对照表挤到要滚才能看全 */
.m-batch .way { padding: 10px 12px; }
.m-batch .way b { margin-bottom: 3px; }
.m-batch .way span { font-size: 11px; line-height: 1.5; }

/* ---------------------------------------------------------------- 三层闸门横幅 */
/* 被挡住时整页都设不了，原因要放在表格上面先说一句：
   让人逐行找「为什么这个按钮是灰的」，比直接告诉他卡在哪一层慢得多 */
.gate {
  padding: 12px 14px;
  border-radius: 6px;
  border: 1px solid var(--bd);
  background: #f7f9fb;
  line-height: 1.7;
}
.gate-on { border-color: #cfe3d6; background: #f6fbf7; }
.gate-off { border-color: #f0c9c9; background: #fff7f7; }
.gate-off b { color: #b4362f; }
.gate .btn { flex: none; margin-left: 12px; }

/* ---------------------------------------------------------------- 报告文件卡片
   与「下载 Word」并排出现，所以视觉上要和按钮区分开：那一个是把这段回答排版，
   这一个是平台按取数结果重新统计的成品。做成横条而不是小按钮，是因为它值得被看见——
   用户问「报告能不能下载」问了很多次，说明按钮藏在角落就等于没有。 */
.wb-files { margin: 8px 0 4px; display: flex; flex-direction: column; gap: 8px; }
.wb-file {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 10px 14px; border: 1px solid #cfe0ff; border-radius: 10px;
  background: linear-gradient(180deg, #f7faff, #eef4ff); cursor: pointer;
  font: inherit; color: inherit; transition: border-color .15s, box-shadow .15s;
}
.wb-file:hover { border-color: var(--blue, #2f6bea); box-shadow: 0 2px 10px rgba(47, 107, 234, .12); }
.wb-file:disabled { opacity: .6; cursor: default; }
/* 加图按钮上线后，.wb-file 从 button 变成 div（button 不能嵌套 button）。
   内层 .wb-file-main 承接原来的点击区域，视觉上仍是同一张卡片。 */
.wb-file { padding: 0; cursor: default; }
.wb-file-main {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px;
  padding: 10px 4px 10px 14px; background: transparent; border: 0;
  font: inherit; color: inherit; text-align: left; cursor: pointer;
}
.wb-file-acts { flex: none; display: flex; gap: 6px; padding-right: 12px; }
.wb-file-acts .wb-file-go { cursor: pointer; }
.wb-file-acts .wb-file-go:hover { background: var(--blue, #2f6bea); color: #fff; border-color: var(--blue, #2f6bea); }
.wb-file-ic {
  flex: none; width: 38px; height: 46px; border-radius: 6px; background: var(--blue, #2f6bea);
  color: #fff; font-size: 11px; font-weight: 700; letter-spacing: .5px;
  display: flex; align-items: center; justify-content: center;
}
.wb-file-tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.wb-file-tx b { font-size: 13.5px; font-weight: 600; color: var(--navy, #1e4e8c); }
.wb-file-tx .small { font-size: 12px; }
.wb-file-go {
  flex: none; font-size: 12.5px; color: var(--blue, #2f6bea); font-weight: 600;
  padding: 4px 10px; border: 1px solid #cfe0ff; border-radius: 999px; background: #fff;
}
.wb-file-err {
  margin: 8px 0 4px; padding: 8px 12px; border-radius: 8px;
  background: #fff7f7; border: 1px solid #f0c9c9; color: #b4362f; font-size: 12.5px;
}
/* 会话级报告条：贴在正文顶上，刷新或载入历史会话后下载入口还在。
   加一条左侧色带，与消息里的那份（同一轮刚生成的）区分开，不然会以为重复了。 */
.wb-files-top {
  /* 与对话正文同宽：正文是 780 - 左右各 24 的阅读栏，报告条不跟着收窄
     就会比正文宽出两截，看着像贴错了地方 */
  width: calc(100% - 48px); max-width: 732px; margin: 0 auto 12px;
  padding: 10px 12px 12px; border-radius: 10px;
  background: #f6f9ff; border: 1px solid #e3ecff; border-left: 3px solid var(--blue, #2f6bea);
}
.wb-files-top .wb-files-cap {
  font-size: 12.5px; font-weight: 600; color: var(--navy, #1e4e8c); margin-bottom: 8px;
}
.wb-files-top .wb-file { background: #fff; }

/* ------------------------------------------------------------------ 流式输出
   为什么需要这几条：模型一个字 70 毫秒，一次周报九十秒。等全量返回的话这九十秒
   界面上什么都不会动，用户分不清「在算」和「已经死了」。流式之后气泡是边写边长的，
   但光有字还不够——得有一个「还在写」的光标，和一行说明当前在干什么。 */
.wb-caret {
  display: inline-block; width: 2px; height: 1.05em; margin-left: 2px;
  background: var(--blue, #2f6bea); vertical-align: -0.16em;
  animation: wbCaret 1s steps(2, start) infinite;
}
@keyframes wbCaret { 0%, 50% { opacity: 1; } 51%, 100% { opacity: 0; } }

/* 阶段行。比正文小一号、颜色更浅：它是过程播报，不是结论，不该和正文抢注意力 */
.wb-stage {
  font-size: 12px; color: var(--t-3, #7a8699); line-height: 1.6;
  padding: 2px 0 4px; display: flex; align-items: center; gap: 6px;
}
.wb-stage::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--blue, #2f6bea); flex: none;
  animation: wbPulse 1.4s ease-in-out infinite;
}
@keyframes wbPulse { 0%, 100% { opacity: .35; transform: scale(.85); } 50% { opacity: 1; transform: scale(1); } }

/* 减少动效偏好：闪烁和脉冲都停掉，字照样在长 */
@media (prefers-reduced-motion: reduce) {
  .wb-caret { animation: none; }
  .wb-stage::before { animation: none; }
}

/* 思考过程。模型在写正文前会先写一大段推理，实测一次单品查询是 2482 字、
   占掉八成时间。以前这段既不显示也不记录，界面上就是「干等半分钟」。
   现在摊在正文上方、正文一开始就自动折起——它是过程，不该盖过结论。 */
.wb-think {
  margin: 4px 0 10px; padding: 2px 0 2px 10px;
  border-left: 2px solid #d8e3f5; background: #fafbfe; border-radius: 0 6px 6px 0;
}
.wb-think > summary {
  cursor: pointer; font-size: 12px; color: var(--t-3, #7a8699);
  list-style: none; user-select: none; padding: 3px 0;
}
.wb-think > summary::-webkit-details-marker { display: none; }
.wb-think > summary::before {
  content: "▸"; display: inline-block; width: 12px; margin-right: 3px;
  transition: transform .15s; color: #9fb0c9;
}
.wb-think[open] > summary::before { transform: rotate(90deg); }
.wb-think-bd {
  font-size: 12px; line-height: 1.75; color: var(--t-3, #7a8699);
  white-space: pre-wrap; max-height: 220px; overflow: auto; padding: 2px 4px 6px 0;
}
