/* human_plugin · 个人数字分身 — 钉钉式三栏 IA
   色彩系统：深空墨蓝中性族 + 电光蓝主色 + 每模块独立色相。
   所有滚动条按本品视觉语言绘制（宽度/轨道/滑块/悬停取自调色板）。 */

:root {
  /* 中性族（冷）：背景 / 表面 / 浮层 / 分隔 */
  --bg: #0c0f16;
  --surface: #121722;
  --surface-2: #18202f;
  --surface-3: #1f293b;
  --overlay: #232e42;
  --line: #232d40;
  --line-soft: #1b2434;

  /* 文本 */
  --text: #e7eaf2;
  --muted: #8b94a9;
  --faint: #5b6478;

  /* 主色与语义 */
  --accent: #3d7bff;
  --accent-soft: #3d7bff26;
  --ok: #34d399;
  --warn: #f5a623;
  --danger: #fb7185;
  --info: #38bdf8;

  /* 模块色相（rail 与列表面板随当前模块切换） */
  --mod: #3d7bff;
  --mod-soft: #3d7bff22;

  --radius: 12px;
  --radius-sm: 8px;
  --rail-w: 76px;
  --list-w: 312px;
  --topbar-h: 56px;
  --shadow: 0 12px 40px -12px rgba(0, 0, 0, 0.6);
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', Roboto, sans-serif;
  --mono: 'SF Mono', ui-monospace, 'JetBrains Mono', Menlo, Consolas, monospace;
}

.app[data-module='messages'] { --mod: #3d7bff; --mod-soft: #3d7bff22; }
.app[data-module='plan']      { --mod: #8b5cf6; --mod-soft: #8b5cf622; }
.app[data-module='contacts'] { --mod: #f472b6; --mod-soft: #f472b622; }
.app[data-module='avatar']   { --mod: #6366f1; --mod-soft: #6366f122; }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
#root { height: 100vh; height: 100dvh; }
button { font-family: inherit; }
::selection { background: var(--mod-soft); }

/* ── 滚动条（本品视觉语言） ───────────────────────────── */
* { scrollbar-width: thin; scrollbar-color: var(--surface-3) transparent; }
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: var(--surface-3);
  border-radius: 99px;
  border: 2px solid transparent;
  background-clip: content-box;
}
*::-webkit-scrollbar-thumb:hover { background: var(--mod); background-clip: content-box; }

/* ── 图标 ─────────────────────────────────────────────── */
.ico { display: inline-flex; width: 20px; height: 20px; flex: none; }
.ico svg { width: 100%; height: 100%; }

/* ── 应用骨架 ─────────────────────────────────────────── */
.app {
  display: grid;
  grid-template-columns: var(--rail-w) 1fr;
  grid-template-rows: minmax(0, 1fr);
  height: 100%;
  background:
    radial-gradient(1200px 600px at 80% -10%, var(--mod-soft), transparent 60%),
    var(--bg);
  transition: background 0.5s ease;
}

/* ── 一级 rail ────────────────────────────────────────── */
.rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 14px 0 12px;
  background: linear-gradient(180deg, #0e1320, #0a0d15);
  border-right: 1px solid var(--line-soft);
  gap: 6px;
  z-index: 20;
}
.rail-avatar { margin-bottom: 10px; cursor: pointer; position: relative; }
.rail-avatar .avatar { box-shadow: 0 0 0 2px var(--bg), 0 0 0 3px var(--mod); transition: box-shadow .3s; }
.rail-nav { display: flex; flex-direction: column; gap: 4px; flex: 1; width: 100%; align-items: center; }
.rail-item {
  width: 60px;
  padding: 9px 0 7px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: transparent;
  border: none;
  border-radius: 12px;
  color: var(--muted);
  cursor: pointer;
  position: relative;
  transition: color .18s, background .18s;
}
.rail-item .ico { width: 23px; height: 23px; }
.rail-item span.lbl { font-size: 11px; letter-spacing: .5px; }
.rail-item:hover { color: var(--text); background: #ffffff08; }
.rail-item.active { color: var(--mod); background: var(--mod-soft); }
.rail-item.active::before {
  content: '';
  position: absolute;
  left: -8px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 22px;
  border-radius: 99px;
  background: var(--mod);
}
.rail-badge {
  position: absolute; top: 4px; right: 8px;
  min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 99px; background: var(--danger); color: #fff;
  font-size: 10px; line-height: 16px; text-align: center; font-weight: 600;
}
.rail-foot { display: flex; flex-direction: column; gap: 4px; align-items: center; }
.rail-foot .rail-item { width: 48px; padding: 8px 0; }
.rail-foot .rail-item .ico { width: 20px; height: 20px; }

/* ── 工作区 ───────────────────────────────────────────── */
.workspace { display: flex; flex-direction: column; min-width: 0; height: 100%; }
.topbar {
  height: var(--topbar-h);
  flex: none;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line-soft);
  background: #0d1119cc;
  backdrop-filter: blur(8px);
  z-index: 15;
}
.space-switcher {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 12px; border-radius: 99px;
  background: var(--surface-2); border: 1px solid var(--line);
  cursor: pointer; color: var(--text); font-size: 13px; font-weight: 500;
  transition: border-color .18s;
}
.space-switcher:hover { border-color: var(--mod); }
.space-switcher .ico { width: 15px; height: 15px; color: var(--muted); }
.space-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--mod); }

.global-search {
  flex: 1; max-width: 460px; margin: 0 auto;
  display: flex; align-items: center; gap: 9px;
  padding: 8px 14px; border-radius: 99px;
  background: var(--surface-2); border: 1px solid var(--line);
  color: var(--muted); cursor: text; transition: border-color .18s, box-shadow .18s;
}
.global-search:focus-within { border-color: var(--mod); box-shadow: 0 0 0 3px var(--mod-soft); }
.global-search .ico { width: 16px; height: 16px; }
.global-search input {
  flex: 1; background: transparent; border: none; outline: none;
  color: var(--text); font-size: 13px;
}
.global-search input::placeholder { color: var(--faint); }
.global-search kbd {
  font-family: var(--font); font-size: 11px; color: var(--faint);
  border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px;
}
.topbar-right { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.conn-status { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); cursor: pointer; padding: 4px 8px; border-radius: 8px; transition: background .15s; user-select: none; }
.conn-status:hover { background: var(--surface-2, rgba(127,127,127,.08)); }
.conn-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 8px var(--ok); flex: none; }
.conn-status.off .conn-dot { background: var(--danger); box-shadow: 0 0 8px var(--danger); }
.conn-status.off { color: var(--danger); }
.conn-status.busy .conn-dot { background: var(--warn, #f5a623); box-shadow: 0 0 8px var(--warn, #f5a623); animation: conn-pulse 1s ease-in-out infinite; }
@keyframes conn-pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }

/* ── 同步中心（N-86 ~ N-90）───────────────────────────── */
.sync-center { display: flex; flex-direction: column; gap: 14px; }
.sync-state { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; background: var(--mod-soft, rgba(61,123,255,.1)); }
.sync-state svg { width: 22px; height: 22px; color: var(--ok); flex: none; }
.sync-state.off { background: rgba(244,114,182,.1); }
.sync-state.off svg { color: var(--danger); }
.sync-list { display: flex; flex-direction: column; gap: 8px; max-height: 340px; overflow-y: auto; }
.sync-op { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.sync-op.st-conflict { border-color: var(--warn, #f5a623); }
.sync-op.st-dead { border-color: var(--danger); }
.so-main { flex: 1; min-width: 0; }
.so-title { font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.so-status { font-size: 10px; padding: 1px 6px; }
.so-status.pending, .so-status.retry { background: rgba(61,123,255,.14); color: var(--mod, #3d7bff); }
.so-status.syncing { background: rgba(245,166,35,.16); color: var(--warn, #f5a623); }
.so-status.conflict { background: rgba(245,166,35,.16); color: var(--warn, #f5a623); }
.so-status.dead { background: rgba(244,114,182,.16); color: var(--danger); }
.so-sub { font-size: 11px; color: var(--muted); margin-top: 3px; word-break: break-all; }
.so-err { font-size: 11px; color: var(--danger); margin-top: 4px; }
.so-actions { display: flex; flex-direction: column; gap: 5px; flex: none; }
.so-btn { font-size: 11px; padding: 4px 9px; white-space: nowrap; }

/* ── 两栏 ─────────────────────────────────────────────── */
.columns { flex: 1; display: grid; grid-template-columns: var(--list-w) 1fr; grid-template-rows: minmax(0, 1fr); min-height: 0; }
.list-panel {
  border-right: 1px solid var(--line-soft);
  background: var(--surface);
  display: flex; flex-direction: column; min-height: 0;
}
.detail-panel { background: var(--bg); display: flex; flex-direction: column; min-height: 0; min-width: 0; position: relative; }

.panel-head {
  flex: none; padding: 16px 16px 12px;
  display: flex; align-items: center; gap: 10px;
}
.panel-head h2 { margin: 0; font-size: 17px; font-weight: 650; letter-spacing: .3px; }
.panel-head .spacer { flex: 1; }
.panel-search { padding: 0 14px 12px; }
.panel-search .field {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 9px; padding: 7px 11px; color: var(--muted);
}
.panel-search .field:focus-within { border-color: var(--mod); }
.panel-search .ico { width: 15px; height: 15px; }
.panel-search input { flex: 1; background: transparent; border: none; outline: none; color: var(--text); font-size: 13px; }
.panel-scroll { flex: 1; overflow-y: auto; min-height: 0; padding: 4px 8px 16px; }

/* ── 通用按钮 ─────────────────────────────────────────── */
button.primary, button.ghost, button.danger, button.soft {
  border: none; border-radius: 9px; padding: 9px 16px;
  font-size: 13px; font-weight: 550; cursor: pointer;
  display: inline-flex; align-items: center; gap: 7px; justify-content: center;
  transition: transform .12s, background .18s, box-shadow .18s, opacity .18s;
}
button.primary { background: var(--mod); color: #fff; box-shadow: 0 4px 14px -4px var(--mod); }
button.primary:hover { filter: brightness(1.08); transform: translateY(-1px); }
button.primary:active { transform: translateY(0); }
button.ghost { background: var(--surface-2); color: var(--text); border: 1px solid var(--line); }
button.ghost:hover { border-color: var(--mod); color: var(--mod); }
button.soft { background: var(--mod-soft); color: var(--mod); }
button.soft:hover { filter: brightness(1.15); }
button.danger { background: #fb718522; color: var(--danger); border: 1px solid #fb718540; }
button.danger:hover { background: #fb718535; }
button:disabled { opacity: .5; cursor: not-allowed; transform: none !important; }
.icon-btn {
  width: 34px; height: 34px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 9px; border: 1px solid transparent; background: transparent;
  color: var(--muted); cursor: pointer; transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn .ico { width: 18px; height: 18px; }
.icon-btn.accent { color: var(--mod); background: var(--mod-soft); }
.icon-btn.accent:hover { filter: brightness(1.2); }

/* ── 表单 ─────────────────────────────────────────────── */
label.fld { display: block; font-size: 12px; color: var(--muted); margin: 12px 0 5px; font-weight: 500; }
input.inp, textarea.inp, select.inp {
  width: 100%; background: var(--surface-2); color: var(--text);
  border: 1px solid var(--line); border-radius: 9px; padding: 9px 12px;
  font-size: 13px; font-family: inherit; outline: none; transition: border-color .15s, box-shadow .15s;
}
input.inp:focus, textarea.inp:focus, select.inp:focus { border-color: var(--mod); box-shadow: 0 0 0 3px var(--mod-soft); }
textarea.inp { resize: vertical; min-height: 80px; line-height: 1.6; }
select.inp { cursor: pointer; }
.field-row { display: flex; gap: 10px; }
.field-row > * { flex: 1; }
.hint-text { font-size: 12px; color: var(--faint); margin-top: 5px; }

/* ── 列表项 ───────────────────────────────────────────── */
.list-item {
  display: flex; gap: 11px; align-items: center;
  padding: 11px 12px; border-radius: 11px; cursor: pointer;
  transition: background .14s; position: relative; margin-bottom: 2px;
}
.list-item:hover { background: var(--surface-2); }
.list-item.active { background: var(--mod-soft); }
.list-item.active::after {
  content: ''; position: absolute; left: 0; top: 12px; bottom: 12px;
  width: 3px; border-radius: 99px; background: var(--mod);
}
.list-item .li-body { flex: 1; min-width: 0; }
.list-item .li-title { font-size: 14px; font-weight: 550; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-item .li-sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.list-item .li-meta { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }
.list-item .li-time { font-size: 11px; color: var(--faint); }
.li-badge { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--danger); color: #fff; font-size: 11px; line-height: 18px; text-align: center; }

.avatar { display: inline-flex; align-items: center; justify-content: center; font-weight: 650; flex: none; user-select: none; }

/* 分组标题 */
.group-label {
  font-size: 11px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase;
  color: var(--faint); padding: 14px 12px 6px; display: flex; align-items: center; gap: 7px;
}
.group-label .count { background: var(--surface-3); border-radius: 99px; padding: 0 7px; font-size: 10px; color: var(--muted); }

/* 二级 tab（消息：单聊/数字人/群聊） */
.seg-tabs { display: flex; gap: 4px; padding: 0 14px 12px; }
.seg-tab {
  flex: 1; padding: 7px 0; border-radius: 8px; border: none; cursor: pointer;
  background: transparent; color: var(--muted); font-size: 12.5px; font-weight: 550;
  transition: background .15s, color .15s;
}
.seg-tab:hover { color: var(--text); }
.seg-tab.active { background: var(--mod-soft); color: var(--mod); }

/* ── 状态块 ───────────────────────────────────────────── */
.empty { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 48px 28px; height: 100%; gap: 6px; }
.empty-ico { width: 64px; height: 64px; border-radius: 20px; background: var(--mod-soft); color: var(--mod); display: flex; align-items: center; justify-content: center; margin-bottom: 10px; }
.empty-ico .ico, .empty-ico svg { width: 30px; height: 30px; }
.empty-title { font-size: 15px; font-weight: 600; color: var(--text); }
.empty-hint { font-size: 13px; color: var(--muted); max-width: 320px; line-height: 1.6; }
.empty .primary, .empty .ghost { margin-top: 14px; }
.loading { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 40px; color: var(--muted); font-size: 13px; }
.spin { width: 18px; height: 18px; border: 2px solid var(--line); border-top-color: var(--mod); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.err-block { padding: 28px; text-align: center; }
.err-msg { color: var(--danger); font-size: 13px; margin-bottom: 12px; }

/* ── toast ────────────────────────────────────────────── */
.toasts { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 1000; align-items: center; }
.toast {
  padding: 10px 18px; border-radius: 10px; font-size: 13px; font-weight: 500;
  background: var(--overlay); color: var(--text); border: 1px solid var(--line);
  box-shadow: var(--shadow); opacity: 0; transform: translateY(12px); transition: opacity .25s, transform .25s;
  max-width: 90vw;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast-error { border-color: #fb718550; color: #ffd7dd; background: #2a1620; }
.toast-success { border-color: #34d39950; color: #d3f5e6; background: #10241c; }
.toast-info { border-color: var(--mod); }

/* ── modal ────────────────────────────────────────────── */
.overlay {
  position: fixed; inset: 0; background: #05070ccc; backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; z-index: 900;
  opacity: 0; transition: opacity .18s; padding: 20px;
}
.overlay.show { opacity: 1; }
.modal {
  width: 100%; background: var(--surface); border: 1px solid var(--line);
  border-radius: 16px; box-shadow: var(--shadow); transform: scale(.96) translateY(8px);
  transition: transform .18s; max-height: 88vh; display: flex; flex-direction: column;
}
.overlay.show .modal { transform: scale(1) translateY(0); }
.modal-head { display: flex; align-items: center; padding: 18px 20px 12px; }
.modal-head h3 { margin: 0; font-size: 16px; font-weight: 650; flex: 1; }
.modal-body { padding: 4px 20px 8px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px 18px; }
.confirm-msg { color: var(--muted); font-size: 13.5px; line-height: 1.7; margin: 6px 0 10px; }

/* ── 认证页 ───────────────────────────────────────────── */
.auth-wrap {
  height: 100%; display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(900px 500px at 15% 10%, #3d7bff18, transparent 55%),
    radial-gradient(800px 500px at 85% 90%, #8b5cf618, transparent 55%),
    var(--bg);
  padding: 24px; overflow-y: auto;
}
.auth-card {
  width: 100%; max-width: 400px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 20px; padding: 34px 32px;
  box-shadow: var(--shadow); animation: rise .5s cubic-bezier(.2,.8,.2,1);
}
@keyframes rise { from { opacity: 0; transform: translateY(18px); } }
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.auth-logo { width: 46px; height: 46px; border-radius: 14px; background: linear-gradient(135deg, #3d7bff, #8b5cf6); display: flex; align-items: center; justify-content: center; color: #fff; box-shadow: 0 8px 24px -8px #3d7bff; }
.auth-logo .ico { width: 26px; height: 26px; }
.auth-brand h1 { margin: 0; font-size: 20px; font-weight: 700; }
.auth-brand .tag { font-size: 11px; color: var(--mod); border: 1px solid var(--mod); border-radius: 99px; padding: 1px 8px; }
.auth-sub { color: var(--muted); font-size: 13px; margin: 0 0 22px; }
.auth-tabs { display: flex; gap: 6px; margin-bottom: 18px; background: var(--surface-2); padding: 4px; border-radius: 10px; }
.auth-tab { flex: 1; padding: 8px; border: none; border-radius: 7px; background: transparent; color: var(--muted); font-size: 13px; font-weight: 550; cursor: pointer; }
.auth-tab.active { background: var(--mod); color: #fff; }
.auth-card .primary { width: 100%; margin-top: 20px; padding: 11px; }
.auth-err { color: var(--danger); font-size: 12.5px; margin-top: 12px; min-height: 16px; }
.auth-adv { margin-top: 16px; border-top: 1px solid var(--line-soft); padding-top: 12px; }
.auth-adv summary { cursor: pointer; font-size: 12px; color: var(--faint); }

/* ── 服务器选择（官方 / 自定义） ─────────────────────────
   官方地址不上界面：它是默认值，不是让用户填的东西。想换服务器才展开自定义。 */
.srv-pick { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.srv-opt {
  position: relative; display: flex; align-items: center; gap: 9px;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface-2); cursor: pointer; font-size: 13px; color: var(--text);
  transition: border-color .15s, background .15s;
}
.srv-opt:hover { border-color: var(--surface-3); }
.srv-opt.on { border-color: var(--mod); background: var(--mod-soft); }
.srv-opt input { position: absolute; width: 0; height: 0; opacity: 0; pointer-events: none; }
.srv-dot {
  width: 15px; height: 15px; border-radius: 50%; flex: none; position: relative;
  border: 1.5px solid var(--faint); transition: border-color .15s;
}
.srv-opt.on .srv-dot { border-color: var(--mod); }
.srv-opt.on .srv-dot::after {
  content: ''; position: absolute; inset: 3px; border-radius: 50%; background: var(--mod);
}
.srv-opt input:focus-visible + .srv-dot { box-shadow: 0 0 0 3px var(--mod-soft); }
.srv-txt { display: flex; align-items: center; }
.srv-opt em {
  font-style: normal; font-size: 10.5px; color: var(--mod); line-height: 1.7;
  border: 1px solid var(--mod); border-radius: 99px; padding: 0 6px; margin-left: 7px;
}
.srv-custom { display: flex; flex-direction: column; gap: 6px; }
.srv-custom[hidden] { display: none; }

/* ── 详情面板通用 ─────────────────────────────────────── */
.detail-head {
  flex: none; display: flex; align-items: center; gap: 12px;
  padding: 14px 20px; border-bottom: 1px solid var(--line-soft); background: #0d1119aa;
}
.detail-head .dh-title { font-size: 15px; font-weight: 650; }
.detail-head .dh-sub { font-size: 12px; color: var(--muted); }
.detail-head .spacer { flex: 1; }
.detail-body { flex: 1; overflow-y: auto; min-height: 0; }
.detail-scroll { padding: 24px; max-width: 860px; margin: 0 auto; width: 100%; }

/* 标签 / 徽章 */
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; padding: 3px 9px; border-radius: 99px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.chip.mod { background: var(--mod-soft); color: var(--mod); border-color: transparent; }
.chip.ok { background: #34d39918; color: var(--ok); border-color: transparent; }
.chip.warn { background: #f5a62318; color: var(--warn); border-color: transparent; }
.chip.danger { background: #fb718518; color: var(--danger); border-color: transparent; }
.chip .ico { width: 12px; height: 12px; }

.card { background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; }
.card h4 { margin: 0 0 8px; font-size: 14px; font-weight: 600; }
.section-title { font-size: 12px; font-weight: 600; letter-spacing: .8px; text-transform: uppercase; color: var(--faint); margin: 22px 0 10px; }

/* 移动端返回按钮（桌面隐藏） */
.mobile-back { display: none; }

/* ── 响应式：移动端 rail 变底部 tab，两栏堆叠 ─────────── */
@media (max-width: 860px) {
  :root { --list-w: 100%; }
  .app { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) auto; }
  .rail {
    grid-row: 2; flex-direction: row; width: 100%; height: 60px;
    padding: 0 6px; border-right: none; border-top: 1px solid var(--line-soft);
    justify-content: space-around; gap: 0;
  }
  .rail-avatar, .rail-foot { display: none; }
  .rail-nav { flex-direction: row; flex: 1; justify-content: space-around; }
  .rail-item { width: auto; flex: 1; padding: 6px 0; }
  .rail-item.active::before { display: none; }
  .rail-item .ico { width: 21px; height: 21px; }
  .rail-item span.lbl { font-size: 10px; }
  .workspace { grid-row: 1; }
  .columns { grid-template-columns: 1fr; }
  .list-panel { border-right: none; }
  .detail-panel { position: absolute; inset: 0; z-index: 30; transform: translateX(100%); transition: transform .25s ease; }
  .app.detail-open .detail-panel { transform: translateX(0); }
  .app.detail-open .list-panel { visibility: hidden; }
  .mobile-back { display: inline-flex; }
  .global-search { max-width: none; }
  .global-search kbd { display: none; }
  .topbar { padding: 0 12px; gap: 10px; }
  .conn-status span.txt { display: none; }
}
@media (max-width: 520px) {
  .space-switcher .space-name { max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .detail-scroll { padding: 16px; }
}

/* ════════════════════════════════════════════════════════════
   视图专属样式
   ════════════════════════════════════════════════════════════ */

/* 通用：列表图标座 / 诚实边界横幅 */
.note-ico {
  width: 38px; height: 38px; flex: none; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--mod-soft); color: var(--mod);
}
.note-ico .ico { width: 19px; height: 19px; }
.reply-banner {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 16px; border-radius: var(--radius);
  background: #f5a62312; border: 1px solid #f5a62330; color: var(--text);
}
.reply-banner > .ico { width: 20px; height: 20px; color: var(--warn); flex: none; margin-top: 1px; }
.reply-banner b { font-size: 13.5px; font-weight: 600; }
.reply-banner .hint-text { margin-top: 3px; }

/* ── 消息 / 聊天 ─────────────────────────────────────── */
.chat-thread { flex: 1; overflow-y: auto; min-height: 0; padding: 20px 22px; display: flex; flex-direction: column; gap: 14px; }
.chat-daysep { align-self: center; font-size: 11px; color: var(--faint); background: var(--surface-2); border: 1px solid var(--line-soft); padding: 3px 12px; border-radius: 99px; }
.msg-row { display: flex; gap: 10px; align-items: flex-start; max-width: 100%; }
.msg-row.me { flex-direction: row-reverse; }
.msg-col { display: flex; flex-direction: column; gap: 4px; max-width: min(72%, 560px); min-width: 0; }
.msg-row.me .msg-col { align-items: flex-end; }
.msg-sender { font-size: 11.5px; color: var(--muted); padding-left: 2px; }
.msg-bubble {
  padding: 10px 14px; border-radius: 14px; border-top-left-radius: 4px;
  background: var(--surface-2); border: 1px solid var(--line-soft);
  font-size: 14px; line-height: 1.6; word-break: break-word; white-space: pre-wrap;
}
.msg-bubble.agent { border-left: 3px solid var(--mod); background: var(--surface); }
.msg-row.me .msg-bubble {
  border-top-left-radius: 14px; border-top-right-radius: 4px;
  background: linear-gradient(135deg, var(--mod), color-mix(in srgb, var(--mod) 70%, #000));
  border-color: transparent; color: #fff;
}
.msg-bubble.thinking { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-style: italic; }
.msg-foot { display: flex; align-items: center; gap: 8px; padding: 0 2px; }
.msg-time { font-size: 10.5px; color: var(--faint); }
.msg-recall { width: 22px; height: 22px; border: none; background: transparent; color: var(--faint); cursor: pointer; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; opacity: 0; transition: opacity .15s, color .15s; }
.msg-recall .ico { width: 13px; height: 13px; }
.msg-row:hover .msg-recall { opacity: 1; }
.msg-recall:hover { color: var(--danger); background: #fb718515; }
.msg-card { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; min-width: 180px; }
.msg-card .card-title { font-weight: 600; font-size: 13.5px; margin-bottom: 4px; }
.composer { flex: none; display: flex; gap: 10px; align-items: flex-end; padding: 14px 18px; border-top: 1px solid var(--line-soft); background: #0d1119aa; }
.composer textarea {
  flex: 1; resize: none; background: var(--surface-2); color: var(--text);
  border: 1px solid var(--line); border-radius: 12px; padding: 11px 14px;
  font-family: inherit; font-size: 14px; line-height: 1.5; outline: none; max-height: 140px;
  transition: border-color .15s, box-shadow .15s;
}
.composer textarea:focus { border-color: var(--mod); box-shadow: 0 0 0 3px var(--mod-soft); }
.composer .primary { width: 44px; height: 44px; padding: 0; border-radius: 12px; flex: none; }
.composer .primary .ico { width: 19px; height: 19px; }

/* ── 分身：进入即对话 + 顶部入口 + 二级页面 ─────────── */
.av-topbar { display: flex; gap: 6px; flex: none; }
.av-top { display: inline-flex; align-items: center; gap: 5px; padding: 6px 11px; font-size: 12px; white-space: nowrap; }
.av-top .ico { width: 14px; height: 14px; }
.av-reply { flex: none; padding: 8px 11px; font-size: 12px; white-space: nowrap; }
.av-reply .ico { width: 15px; height: 15px; }
.av-profile { margin-bottom: 4px; }
.av-profile-hint { margin-top: 12px; line-height: 1.6; }
.av-entry { cursor: pointer; }
.av-sub-mount { flex: 1; display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.av-sub-head { flex: none; }
@media (max-width: 720px) {
  .av-head { flex-wrap: wrap; height: auto; padding: 8px 12px; gap: 6px; }
  .av-topbar { width: 100%; order: 3; }
  .av-top { flex: 1; justify-content: center; padding: 7px 4px; }
  .av-reply { padding: 8px; }
  .av-reply span, .av-reply .lbl { display: none; }
}

/* ── 知识：分区 tab / 目录树 ─────────────────────────── */
.zone-tabs { display: flex; gap: 4px; padding: 0 14px 12px; }
.zone-tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 9px 0; border-radius: 10px; border: 1px solid transparent; cursor: pointer;
  background: transparent; color: var(--muted); font-size: 11.5px; font-weight: 550;
  transition: background .15s, color .15s;
}
.zone-tab .ico { width: 18px; height: 18px; }
.zone-tab:hover { color: var(--text); background: var(--surface-2); }
.zone-tab.active { background: var(--mod-soft); color: var(--mod); }
.dir-tree { border-bottom: 1px solid var(--line-soft); padding: 4px 8px 10px; max-height: 240px; overflow-y: auto; }
.dir-tree .group-label { padding: 8px 8px 6px; }
.tree-clear { margin-left: auto; background: transparent; border: none; color: var(--mod); font-size: 11px; cursor: pointer; padding: 2px 6px; border-radius: 6px; }
.tree-clear:hover { background: var(--mod-soft); }
.tree-nodes { display: flex; flex-direction: column; }
.tree-node {
  display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-radius: 8px;
  cursor: pointer; color: var(--muted); font-size: 13px; transition: background .13s, color .13s;
}
.tree-node:hover { background: var(--surface-2); color: var(--text); }
.tree-node.active { background: var(--mod-soft); color: var(--mod); }
.tree-node > .ico { width: 15px; height: 15px; flex: none; }
.tree-twist { width: 16px; height: 16px; flex: none; display: inline-flex; align-items: center; justify-content: center; color: var(--faint); transition: transform .15s; }
.tree-twist .ico { width: 13px; height: 13px; }
.tree-twist.open { transform: rotate(90deg); }
.tree-twist.leaf { visibility: hidden; }
.tree-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tree-count { font-size: 10.5px; color: var(--faint); background: var(--surface-3); border-radius: 99px; padding: 0 6px; }
.tree-kids { display: flex; flex-direction: column; }

/* ── 知识：笔记详情 / 双模式编辑 ─────────────────────── */
.note-tags { flex: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 20px 0; }
.note-tags:empty { display: none; }
.note-body { flex: 1; overflow-y: auto; min-height: 0; display: flex; flex-direction: column; }
.note-view { max-width: 760px; margin: 0 auto; width: 100%; padding: 24px 28px 60px; }
.mode-toggle { display: flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 9px; padding: 3px; gap: 2px; }
.mode-toggle button { display: inline-flex; align-items: center; gap: 5px; border: none; background: transparent; color: var(--muted); font-size: 12.5px; font-weight: 550; padding: 5px 11px; border-radius: 7px; cursor: pointer; transition: background .15s, color .15s; }
.mode-toggle button .ico { width: 14px; height: 14px; }
.mode-toggle button.active { background: var(--mod); color: #fff; }
.editor-split { flex: 1; display: grid; grid-template-columns: 1fr 1fr; min-height: 0; }
.editor-pane { display: flex; flex-direction: column; min-height: 0; min-width: 0; border-right: 1px solid var(--line-soft); }
.editor-pane:last-child { border-right: none; }
.pane-label { flex: none; display: flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600; letter-spacing: .5px; color: var(--faint); padding: 10px 16px; border-bottom: 1px solid var(--line-soft); text-transform: uppercase; }
.pane-label .ico { width: 14px; height: 14px; }
.editor-src {
  flex: 1; resize: none; border: none; outline: none; background: var(--bg); color: var(--text);
  font-family: var(--mono); font-size: 13px; line-height: 1.7; padding: 16px 18px; tab-size: 2;
}
.editor-preview { flex: 1; overflow-y: auto; padding: 16px 20px; background: var(--surface); }
.editor-bar { flex: none; display: flex; align-items: center; gap: 12px; padding: 11px 18px; border-top: 1px solid var(--line-soft); background: #0d1119aa; }
.editor-bar .spacer { flex: 1; }
.snapshot { max-height: 60vh; overflow-y: auto; }

/* ── Git 式冲突消解器（N-92） ─────────────────────────── */
.merge-resolver { display: flex; flex-direction: column; gap: 12px; padding: 6px 0 4px; }
.merge-banner { display: flex; align-items: flex-start; gap: 10px; padding: 11px 14px; border-radius: 10px; background: var(--accent-soft); border: 1px solid #3d7bff33; font-size: 13px; }
.merge-banner .ico { width: 18px; height: 18px; color: var(--accent); flex: none; margin-top: 1px; }
.merge-banner b { font-weight: 600; }
.merge-banner .hint-text { margin-top: 3px; }
.merge-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.merge-toolbar .spacer { flex: 1; }
.merge-toolbar button { font-size: 12px; padding: 6px 11px; display: inline-flex; align-items: center; gap: 6px; }
.merge-toolbar button .ico { width: 14px; height: 14px; }
.merge-toolbar button.active { background: var(--accent-soft); color: var(--accent); border-color: #3d7bff40; }
.merge-status { display: flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 550; padding: 8px 12px; border-radius: 8px; background: var(--surface-2); color: var(--muted); }
.merge-status .ico { width: 15px; height: 15px; flex: none; }
.merge-status.ok { color: var(--ok); background: #34d39914; }
.merge-status.bad { color: var(--warn); background: #f5a62314; }
.merge-base-pane { border: 1px solid var(--line-soft); border-radius: 10px; overflow: hidden; }
.merge-base-text { margin: 0; padding: 12px 14px; background: #0a0d15; font-family: var(--mono); font-size: 12px; line-height: 1.6; color: var(--muted); white-space: pre-wrap; word-break: break-word; max-height: 220px; overflow-y: auto; }
.merge-cards { display: flex; flex-direction: column; gap: 10px; max-height: 42vh; overflow-y: auto; }
.merge-clean { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ok); padding: 12px 14px; border-radius: 10px; background: #34d39910; border: 1px solid #34d39926; }
.merge-clean .ico { width: 16px; height: 16px; flex: none; }
.merge-card { border: 1px solid #f5a62340; border-radius: 12px; background: var(--surface); overflow: hidden; }
.mc-head { display: flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 600; color: var(--warn); padding: 9px 13px; background: #f5a62310; border-bottom: 1px solid var(--line-soft); }
.mc-head .ico { width: 15px; height: 15px; }
.mc-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line-soft); }
.mc-col { background: var(--surface); padding: 10px 12px; min-width: 0; }
.mc-label { display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; letter-spacing: .3px; margin-bottom: 7px; }
.mc-label .ico { width: 13px; height: 13px; }
.mc-col.local .mc-label { color: var(--accent); }
.mc-col.server .mc-label { color: var(--warn); }
.mc-col pre { margin: 0; padding: 9px 11px; background: #0a0d15; border-radius: 8px; font-family: var(--mono); font-size: 12px; line-height: 1.6; color: var(--text); white-space: pre-wrap; word-break: break-word; max-height: 200px; overflow-y: auto; }
.mc-base { display: flex; align-items: flex-start; gap: 8px; padding: 8px 13px; border-top: 1px solid var(--line-soft); background: #ffffff04; }
.mc-base-label { font-size: 11px; color: var(--faint); flex: none; padding-top: 2px; }
.mc-base pre { margin: 0; font-family: var(--mono); font-size: 11.5px; line-height: 1.55; color: var(--muted); white-space: pre-wrap; word-break: break-word; }
.mc-actions { display: flex; gap: 8px; padding: 10px 13px; border-top: 1px solid var(--line-soft); }
.mc-actions button { font-size: 12px; padding: 6px 12px; }
.merge-editor { border: 1px solid var(--line-soft); border-radius: 10px; overflow: hidden; }
.merge-text { display: block; width: 100%; min-height: 200px; resize: vertical; border: none; outline: none; background: var(--bg); color: var(--text); font-family: var(--mono); font-size: 12.5px; line-height: 1.65; padding: 12px 14px; tab-size: 2; }
.merge-fallbacks { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding-top: 2px; }
.merge-fallbacks .hint-text { margin-right: 2px; }
.merge-fallbacks button { font-size: 12px; padding: 6px 11px; display: inline-flex; align-items: center; gap: 6px; }
.merge-fallbacks button .ico { width: 14px; height: 14px; }
.merge-fallbacks button.danger-ghost { color: var(--danger); border-color: #fb718540; }
.merge-err { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--danger); padding: 9px 12px; border-radius: 8px; background: #fb718512; border: 1px solid #fb718530; }
.merge-err:empty { display: none; }
.merge-err .ico { width: 15px; height: 15px; flex: none; }

/* ── Markdown 渲染（DSL 查看模式 / 预览，安全 HTML） ─── */
.markdown { font-size: 14.5px; line-height: 1.75; color: var(--text); word-wrap: break-word; }
.markdown > *:first-child { margin-top: 0; }
.markdown h1, .markdown h2, .markdown h3, .markdown h4, .markdown h5, .markdown h6 { font-weight: 650; line-height: 1.35; margin: 1.5em 0 .6em; }
.markdown h1 { font-size: 1.7em; border-bottom: 1px solid var(--line-soft); padding-bottom: .3em; }
.markdown h2 { font-size: 1.4em; border-bottom: 1px solid var(--line-soft); padding-bottom: .25em; }
.markdown h3 { font-size: 1.2em; }
.markdown h4 { font-size: 1.05em; }
.markdown h5, .markdown h6 { font-size: 1em; color: var(--muted); }
.markdown p { margin: .7em 0; }
.markdown a { color: var(--mod); text-decoration: none; }
.markdown a:hover { text-decoration: underline; }
.markdown strong { font-weight: 650; }
.markdown mark { background: #f5a62340; color: var(--text); padding: 0 3px; border-radius: 3px; }
.markdown del { color: var(--faint); }
.markdown ul, .markdown ol { margin: .6em 0; padding-left: 1.6em; }
.markdown li { margin: .3em 0; }
.markdown li > input[type='checkbox'] { margin-right: 7px; accent-color: var(--mod); }
.markdown blockquote { margin: .9em 0; padding: .4em 1.1em; border-left: 3px solid var(--mod); background: var(--mod-soft); border-radius: 0 8px 8px 0; color: var(--muted); }
.markdown blockquote > *:first-child { margin-top: 0; }
.markdown blockquote > *:last-child { margin-bottom: 0; }
.markdown code { font-family: var(--mono); font-size: .88em; background: var(--surface-3); padding: .15em .4em; border-radius: 5px; color: #ffd7dd; }
.markdown pre { margin: .9em 0; padding: 14px 16px; background: #0a0d15; border: 1px solid var(--line-soft); border-radius: 10px; overflow-x: auto; }
.markdown pre code { background: transparent; padding: 0; color: var(--text); font-size: 12.5px; line-height: 1.6; }
.markdown hr { border: none; border-top: 1px solid var(--line); margin: 1.6em 0; }
.markdown img { max-width: 100%; border-radius: 10px; }
.markdown table { border-collapse: collapse; width: 100%; margin: 1em 0; font-size: 13.5px; display: block; overflow-x: auto; }
.markdown th, .markdown td { border: 1px solid var(--line); padding: 8px 12px; text-align: left; }
.markdown th { background: var(--surface-2); font-weight: 600; }
.markdown tbody tr:nth-child(even) { background: #ffffff04; }
.markdown .tag { color: var(--mod); background: var(--mod-soft); padding: 1px 7px; border-radius: 99px; font-size: .88em; }
.markdown .wiki-link { color: var(--mod); cursor: pointer; border-bottom: 1px dashed var(--mod); text-decoration: none; }
.markdown .wiki-link:hover { background: var(--mod-soft); }
.markdown .wiki-embed { color: var(--info); background: #38bdf815; padding: 1px 7px; border-radius: 6px; font-size: .9em; }
.markdown .math-block { font-family: var(--mono); background: #0a0d15; border: 1px solid var(--line-soft); border-radius: 10px; padding: 12px 16px; overflow-x: auto; color: var(--info); }
.markdown .math-inline { font-family: var(--mono); color: var(--info); background: #38bdf812; }
.markdown .raw-html, .markdown [class^='raw-'] { color: var(--faint); font-size: 12px; }
/* 标注框（callout）：按类型着色 */
.markdown .callout { margin: 1em 0; border-radius: 10px; border: 1px solid var(--line); border-left: 4px solid var(--info); background: var(--surface-2); overflow: hidden; }
.markdown .callout-title { font-weight: 650; font-size: 13.5px; padding: 9px 14px; background: #ffffff06; text-transform: capitalize; }
.markdown .callout-content { padding: 10px 14px; }
.markdown .callout-content > *:first-child { margin-top: 0; }
.markdown .callout-content > *:last-child { margin-bottom: 0; }
.markdown .callout-note, .markdown .callout-info { border-left-color: var(--info); }
.markdown .callout-note .callout-title, .markdown .callout-info .callout-title { color: var(--info); }
.markdown .callout-tip, .markdown .callout-success { border-left-color: var(--ok); }
.markdown .callout-tip .callout-title, .markdown .callout-success .callout-title { color: var(--ok); }
.markdown .callout-warning, .markdown .callout-warn, .markdown .callout-caution { border-left-color: var(--warn); }
.markdown .callout-warning .callout-title, .markdown .callout-warn .callout-title, .markdown .callout-caution .callout-title { color: var(--warn); }
.markdown .callout-danger, .markdown .callout-error, .markdown .callout-bug { border-left-color: var(--danger); }
.markdown .callout-danger .callout-title, .markdown .callout-error .callout-title, .markdown .callout-bug .callout-title { color: var(--danger); }
.markdown .callout-quote { border-left-color: var(--faint); }

/* ── 日历 ────────────────────────────────────────────── */
.cal-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.cal-month-label { font-size: 14px; font-weight: 650; min-width: 110px; text-align: center; }
.cal-weekdays { flex: none; display: grid; grid-template-columns: repeat(7, 1fr); padding: 10px 16px 6px; gap: 6px; }
.cal-weekdays span { text-align: center; font-size: 11.5px; font-weight: 600; color: var(--faint); letter-spacing: 1px; }
.cal-grid { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(7, 1fr); grid-auto-rows: 1fr; gap: 6px; padding: 0 16px 16px; overflow-y: auto; }
.cal-cell { background: var(--surface); border: 1px solid var(--line-soft); border-radius: 10px; padding: 6px 7px; min-height: 84px; cursor: pointer; display: flex; flex-direction: column; gap: 4px; transition: border-color .14s, background .14s; overflow: hidden; }
.cal-cell:hover { border-color: var(--mod); }
.cal-cell.outside { opacity: .4; }
.cal-cell.today { border-color: var(--mod); background: var(--mod-soft); }
.cal-daynum { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.cal-cell.today .cal-daynum { color: var(--mod); }
.cal-events { display: flex; flex-direction: column; gap: 3px; min-height: 0; }
.cal-event { font-size: 11.5px; line-height: 1.35; padding: 2px 6px; border-radius: 5px; background: var(--surface-2); border-left: 3px solid var(--mod); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; transition: background .13s; }
.cal-event:hover { background: var(--surface-3); }
.cal-event-time { color: var(--faint); margin-right: 5px; font-variant-numeric: tabular-nums; }
.cal-more { font-size: 10.5px; color: var(--faint); padding-left: 6px; }
.color-pick { display: flex; gap: 8px; flex-wrap: wrap; }
.color-dot { width: 26px; height: 26px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; transition: transform .12s, box-shadow .12s; }
.color-dot:hover { transform: scale(1.12); }
.color-dot.active { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px currentColor; border-color: #fff3; }
.vis-btn.active { border-color: var(--mod); color: var(--mod); background: var(--mod-soft); }
.pub-active { display: flex; align-items: center; gap: 9px; padding: 11px 14px; border-radius: 10px; background: #34d39912; border: 1px solid #34d39930; color: var(--ok); font-size: 13px; font-weight: 550; }
.pub-active .ico { width: 17px; height: 17px; }
.pub-active .ghost { margin-left: auto; padding: 5px 12px; }
.ics-link { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.ics-link .inp { flex: 1; font-family: var(--mono); font-size: 12px; }
.member-role { flex: none; }

/* ── 通讯录 / 资料卡 ─────────────────────────────────── */
.profile-card { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 28px 20px; background: var(--surface); border: 1px solid var(--line-soft); border-radius: 16px; gap: 6px; }
.profile-name { font-size: 19px; font-weight: 700; margin-top: 10px; }
.profile-sub { font-size: 13px; color: var(--muted); }
.profile-badges { display: flex; flex-wrap: wrap; gap: 7px; justify-content: center; margin-top: 10px; }
.tag-row { display: flex; flex-wrap: wrap; gap: 7px; }
.kv-row { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; border-bottom: 1px solid var(--line-soft); font-size: 13.5px; }
.kv-row:last-child { border-bottom: none; }
.kv-k { color: var(--muted); flex: none; }
.kv-v { color: var(--text); text-align: right; word-break: break-word; }

/* ── 计划（合并「任务」+「日历」，C32）───────────────── */
/* 标题栏由计划壳统一渲染：左边视图切换，右边留给子视图的操作按钮 */
.plan-head { gap: 8px; padding-right: 12px; }
.plan-seg { display: flex; gap: 4px; flex: 1; min-width: 0; }
.plan-tab {
  flex: 1; min-width: 0;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 7px 6px; border-radius: 9px; border: 1px solid transparent; cursor: pointer;
  background: transparent; color: var(--muted); font-size: 12.5px; font-weight: 550;
  white-space: nowrap; transition: background .15s, color .15s, border-color .15s;
}
.plan-tab .ico { width: 16px; height: 16px; }
.plan-tab span { overflow: hidden; text-overflow: ellipsis; }
.plan-tab:hover { color: var(--text); background: var(--surface-2); }
.plan-tab.active { background: var(--mod-soft); color: var(--mod); border-color: var(--mod-soft); }
.plan-actions { display: flex; gap: 6px; flex: none; }
.plan-mount { flex: 1; min-height: 0; display: flex; flex-direction: column; }

/* ── 待办 ────────────────────────────────────────────── */
.proj-tabs { padding: 0; margin-top: 4px; }
.proj-tabs .seg-tab { padding: 9px 0; }

/* ── 任务（统一域：我的 / 数字人 / 周期，C30 / N-97） ─────── */
#taskTabs .zone-tab { position: relative; flex-direction: column; gap: 5px; font-size: 11px; padding: 9px 2px 8px; }
#taskTabs .zone-tab .ico { width: 17px; height: 17px; }
#taskTabs .zone-tab > span:not(.tab-count) { white-space: nowrap; }
#taskTabs .tab-count { position: absolute; top: 5px; right: 7px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 99px; background: var(--surface-3); color: var(--muted); font-size: 9.5px; line-height: 16px; text-align: center; }
#taskTabs .zone-tab.active .tab-count { background: var(--mod); color: #fff; }

.task-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 0 14px 10px; }
.task-toolbar .task-status { flex: 1 1 100%; order: 1; padding: 0; gap: 4px; }
.task-toolbar .task-status .seg-tab { padding: 6px 0; font-size: 12px; white-space: nowrap; }
.task-toolbar .task-kind, .task-sort { flex: 1; width: auto; min-width: 0; padding: 6px 9px; font-size: 12px; }
.task-toolbar .task-kind { order: 2; }
.task-sort { order: 3; }
.task-toolbar #viewsBtn { order: 4; }
.gl-open { margin-left: auto; font-size: 10.5px; color: var(--mod); letter-spacing: .3px; text-transform: none; }

/* 任务列表项 */
.task-item { gap: 9px; }
.task-item.done .li-title { text-decoration: line-through; color: var(--muted); }
.task-item.done { opacity: .68; }
.task-item.checked { background: var(--mod-soft); }
.task-check {
  width: 22px; height: 22px; flex: none; border-radius: 50%; cursor: pointer;
  border: 2px solid var(--line); background: transparent; color: #fff;
  display: inline-flex; align-items: center; justify-content: center; padding: 0;
  transition: border-color .15s, background .15s, transform .12s;
}
.task-check:hover { border-color: var(--mod); transform: scale(1.08); }
.task-check.on { background: var(--ok); border-color: var(--ok); }
.task-check .ico { width: 13px; height: 13px; }
.task-check .ico svg { stroke-width: 3; }
.task-prio { width: 7px; height: 7px; border-radius: 50%; flex: none; background: var(--surface-3); }
.task-prio.pr-1 { background: var(--danger); box-shadow: 0 0 0 3px #fb718522; }
.task-prio.pr-2 { background: var(--warn); }
.task-prio.pr-3 { background: var(--info); }
.task-prio.pr-4 { background: var(--ok); }
.t-badges { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 3px; }
.t-badge { font-size: 10.5px; padding: 2px 7px; }
.t-badge .ico { width: 11px; height: 11px; }
/* 归属徽标：人（蓝）/ 数字人（紫）——与周期徽标（青）三色区分，扫一眼分清谁在办 */
.t-owner { font-size: 10.5px; padding: 2px 7px; gap: 4px; max-width: 132px; }
.t-owner .ico { width: 11px; height: 11px; flex: none; }
.t-owner .to-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t-owner.mine { background: #38bdf818; color: var(--info); border-color: transparent; }
.t-owner.agent { background: var(--mod-soft); color: var(--mod); border-color: transparent; }
.t-recur { background: #2dd4bf18; color: #2dd4bf; border-color: transparent; }
.t-once { background: transparent; color: var(--faint); border-color: var(--line-soft); }
.t-pct { font-size: 10.5px; color: var(--mod); font-weight: 600; }
.t-desc { font-size: 11.5px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 180px; }
.task-select { width: 15px; height: 15px; accent-color: var(--mod); cursor: pointer; flex: none; }
.chip.overdue { background: #fb718518; color: var(--danger); border-color: transparent; }
.chip.today { background: #f5a62318; color: var(--warn); border-color: transparent; }
.chip.soon { background: #38bdf818; color: var(--info); border-color: transparent; }
.chip.future { background: var(--surface-2); color: var(--muted); }
.chip.none { background: transparent; color: var(--faint); border-color: var(--line-soft); }

/* 批量条 / 撤销条 */
.bulk-bar { display: flex; align-items: center; gap: 8px; padding: 8px 14px; margin: 0 8px 6px; border-radius: 10px; background: var(--mod-soft); border: 1px solid var(--mod); }
.bulk-bar .bulk-n { font-size: 12.5px; font-weight: 600; color: var(--mod); }
.bulk-bar button { padding: 5px 11px; font-size: 12px; }
.bulk-bar .spacer { flex: 1; }
.undo-bar { display: flex; align-items: center; gap: 12px; padding: 10px 16px; margin: 8px; border-radius: 10px; background: var(--overlay); border: 1px solid var(--line); box-shadow: var(--shadow); font-size: 13px; }
.undo-bar span { display: flex; align-items: center; gap: 8px; color: var(--text); }
.undo-bar .ico { width: 15px; height: 15px; color: var(--danger); }
.undo-bar button { margin-left: auto; padding: 5px 14px; }

/* 任务表单 / 详情 */
.task-form .field-row > div { flex: 1; min-width: 0; }
.task-form output { color: var(--mod); font-weight: 600; }
.task-range { width: 100%; accent-color: var(--mod); cursor: pointer; height: 22px; }
.form-cat { padding: 0; gap: 4px; }
.form-cat .seg-tab { display: inline-flex; align-items: center; justify-content: center; gap: 5px; padding: 8px 0; }
.form-cat .seg-tab .ico { width: 14px; height: 14px; }
.task-actions { display: flex; gap: 10px; margin-top: 18px; }
.task-actions button { flex: 1; }
.task-meta { margin-top: 16px; }
.tm-row { display: flex; justify-content: space-between; gap: 16px; padding: 7px 0; border-bottom: 1px solid var(--line-soft); font-size: 12.5px; }
.tm-row:last-child { border-bottom: none; }
.tm-row span { color: var(--muted); }
.tm-row b { color: var(--text); font-weight: 550; }

/* 周期编辑器（常驻 live 控件 + 即时预览） */
.rec-editor { margin-top: 8px; padding: 14px; border: 1px solid var(--line-soft); border-radius: var(--radius); background: var(--surface-2); }
.rec-grid { display: flex; gap: 12px; }
.rec-grid > div { flex: 1; min-width: 0; }
.rec-stepper { display: flex; align-items: center; gap: 6px; }
.rec-stepper .inp { text-align: center; }
.rec-stepper .icon-btn { width: 32px; height: 38px; flex: none; border: 1px solid var(--line); font-size: 18px; background: var(--surface); }
.rec-days { display: flex; gap: 5px; }
.rec-day { flex: 1; padding: 7px 0; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: 12.5px; cursor: pointer; transition: background .13s, color .13s, border-color .13s; }
.rec-day:hover:not(:disabled) { border-color: var(--mod); color: var(--mod); }
.rec-day.on { background: var(--mod); border-color: var(--mod); color: #fff; font-weight: 600; }
.rec-days.disabled { opacity: .4; }
.rec-day:disabled { cursor: not-allowed; }
.rec-foot { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
.rec-foot .spacer { flex: 1; }
.rec-foot button { padding: 6px 12px; font-size: 12px; }
.rec-desc { font-size: 12.5px; color: var(--mod); font-weight: 600; }
.rec-desc.bad { color: var(--danger); }
.rec-preview { display: flex; align-items: center; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }
.rp-label { font-size: 11px; color: var(--faint); flex: none; }
.rp-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.rp-chip { font-size: 11px; font-family: var(--mono); }
.rp-none { font-size: 11.5px; color: var(--faint); }

/* 保存的视图 */
.vw-row { cursor: default; }
.vw-row .vw-apply { padding: 6px 12px; font-size: 12px; }

/* 任务订阅宽模态（复用 todos 两栏） */
.sub-modal { display: grid; grid-template-columns: 300px 1fr; gap: 0; height: min(66vh, 560px); border: 1px solid var(--line-soft); border-radius: var(--radius); overflow: hidden; }
.sub-modal .sub-list { border-right: 1px solid var(--line-soft); display: flex; flex-direction: column; min-height: 0; background: var(--surface); }
.sub-modal .sub-detail { display: flex; flex-direction: column; min-height: 0; min-width: 0; background: var(--bg); }
.sub-modal .panel-scroll { flex: 1; overflow-y: auto; }
.sub-modal .detail-body { flex: 1; overflow-y: auto; }
.sub-modal .empty { padding: 32px 20px; }

/* ── 全局搜索（命令面板） ────────────────────────────── */
.search-overlay { align-items: flex-start; padding-top: 9vh; }
.search-palette { display: flex; flex-direction: column; gap: 12px; }
.search-input-row { display: flex; align-items: center; gap: 11px; padding: 4px 6px 12px; border-bottom: 1px solid var(--line-soft); color: var(--muted); }
.search-input-row .ico { width: 20px; height: 20px; }
.search-input-row input { flex: 1; background: transparent; border: none; outline: none; color: var(--text); font-size: 17px; }
.search-input-row input::placeholder { color: var(--faint); }
.search-input-row kbd { font-family: var(--font); font-size: 11px; color: var(--faint); border: 1px solid var(--line); border-radius: 5px; padding: 1px 7px; }
.search-filters { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.search-filters .seg-tabs { padding: 0; flex: none; }
.search-filters .seg-tab { padding: 6px 13px; }
.sp-type { width: auto; flex: none; padding: 6px 10px; }
.sp-archive { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); cursor: pointer; margin-left: auto; }
.sp-archive input { accent-color: var(--mod); }
.search-status { display: flex; align-items: center; gap: 12px; font-size: 12px; color: var(--muted); min-height: 18px; flex-wrap: wrap; }
.sp-count { color: var(--faint); }
.search-results { max-height: 52vh; overflow-y: auto; display: flex; flex-direction: column; gap: 3px; margin: 0 -6px; }
.search-result { display: flex; gap: 12px; align-items: flex-start; padding: 11px 12px; border-radius: 11px; cursor: pointer; transition: background .13s; }
.search-result:hover { background: var(--surface-2); }
.sr-body { flex: 1; min-width: 0; }
.sr-title { font-size: 14px; font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sr-snippet { font-size: 12.5px; color: var(--muted); margin-top: 3px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sr-meta { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }
.sr-kind { font-size: 10.5px; color: var(--faint); }
.search-hint { text-align: center; color: var(--faint); font-size: 13px; padding: 32px 20px; }

/* ── 数字人配置 + 我的权益（agentconfig，N-80~N-84） ─────── */
.ac-config { max-width: 720px; }
.check-row {
  display: flex; align-items: center; gap: 9px; padding: 8px 10px;
  border-radius: var(--radius-sm); font-size: 13.5px; color: var(--text);
  cursor: pointer; transition: background .13s;
}
.check-row:hover { background: var(--surface-2); }
.check-row input { accent-color: var(--mod); width: 16px; height: 16px; flex: none; cursor: pointer; }
.scope-pick {
  margin: 6px 0 4px; padding: 6px 8px; max-height: 320px; overflow-y: auto;
  border: 1px solid var(--line-soft); border-radius: var(--radius); background: var(--surface);
}
.scope-pick .group-label { margin: 8px 4px 4px; }
.ac-honest {
  display: flex; align-items: flex-start; gap: 8px; margin-top: 14px; padding: 10px 12px;
  background: #f5a62310; border: 1px solid #f5a62326; border-radius: var(--radius-sm);
  color: var(--muted); line-height: 1.6;
}
.ac-honest .ico { width: 15px; height: 15px; color: var(--warn); flex: none; margin-top: 2px; }
.ac-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.ac-meta > div > div { font-size: 14px; margin-top: 3px; }

/* 单一分身身份卡（列表面板，C31/N-98） */
.avatar-card { padding: 16px; cursor: pointer; transition: border-color .14s, box-shadow .14s; border-color: var(--line-soft); }
.avatar-card:hover { border-color: var(--mod); box-shadow: 0 4px 18px -10px var(--mod); }
.ac-hero { display: flex; align-items: center; gap: 12px; }
.ac-hero-body { flex: 1; min-width: 0; }
.ac-hero-name { font-size: 15.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ac-hero-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.ac-agent-chip { flex: none; font-size: 10px; }
.ac-skill-summary { margin-top: 14px; padding-top: 13px; border-top: 1px solid var(--line-soft); }
.ac-skill-line { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--muted); }
.ac-skill-line .ico { width: 15px; height: 15px; color: var(--mod); flex: none; }
.ac-skill-line b { color: var(--mod); font-weight: 700; }
.ac-skill-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 9px; }
.ac-skill-chips .chip { font-size: 10.5px; padding: 2px 8px; display: inline-flex; align-items: center; gap: 4px; }
.ac-skill-chips .chip .ico { width: 12px; height: 12px; }
.ac-hero-actions { display: flex; gap: 8px; margin-top: 15px; }
.ac-hero-actions button { flex: 1; justify-content: center; }

/* 分身 hero（详情面板） */
.ac-hero-card { background: linear-gradient(165deg, var(--mod-soft), var(--surface) 58%); border-color: var(--mod-soft); }
.ac-hero-card .profile-sub { color: var(--muted); }

/* 技能面板（≥7 常驻 live 控件，即时保存） */
.section-title:has(.skill-quick) { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.skill-quick { margin-left: auto; display: inline-flex; gap: 4px; }
.skill-quick .ghost { padding: 3px 9px; font-size: 11px; font-weight: 550; }
.skill-panel { margin-top: 10px; border: 1px solid var(--line-soft); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.skill-group + .skill-group { border-top: 1px solid var(--line-soft); }
.skill-group .group-label { margin: 0; padding: 11px 14px 7px; }
.skill-row { display: flex; align-items: center; gap: 12px; padding: 11px 14px; transition: background .13s; }
.skill-row:hover { background: var(--surface-2); }
.skill-row + .skill-row { border-top: 1px solid var(--line-soft); }
.skill-ico { flex: none; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: var(--surface-3); color: var(--muted); transition: background .15s, color .15s; }
.skill-ico .ico { width: 18px; height: 18px; }
.skill-row.on .skill-ico { background: var(--mod-soft); color: var(--mod); }
.skill-body { flex: 1; min-width: 0; }
.skill-name { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: 13.5px; font-weight: 600; color: var(--text); }
.skill-mod { font-family: var(--mono); font-size: 9.5px; font-weight: 600; letter-spacing: .3px; color: var(--faint); background: var(--surface-3); border-radius: 5px; padding: 1px 5px; }
.skill-name .chip { display: inline-flex; align-items: center; gap: 3px; }
.skill-name .chip .ico { width: 11px; height: 11px; }
.skill-desc { font-size: 12px; color: var(--muted); line-height: 1.55; margin-top: 3px; }
.skill-row.locked .skill-desc { color: var(--faint); }
.skill-toggle { flex: none; position: relative; width: 42px; height: 24px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface-3); cursor: pointer; padding: 0; transition: background .18s, border-color .18s; }
.skill-toggle .skill-knob { position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.28); transition: transform .18s cubic-bezier(.4,0,.2,1); }
.skill-toggle.on { background: var(--mod); border-color: var(--mod); }
.skill-toggle.on .skill-knob { transform: translateX(18px); }
.skill-toggle:hover:not(:disabled) { border-color: var(--mod); }
.skill-toggle:focus-visible { outline: 2px solid var(--mod); outline-offset: 2px; }
.skill-toggle:disabled { cursor: not-allowed; opacity: .85; }
.skill-row.locked .skill-toggle.on { background: var(--ok); border-color: var(--ok); }

/* 任务固定指派分身（C31） */
.task-agent-fixed { display: flex; align-items: center; gap: 9px; padding: 11px 13px; border: 1px solid var(--line-soft); border-radius: var(--radius-sm); background: var(--surface-2); font-size: 13.5px; color: var(--text); }
.task-agent-fixed .ico { width: 18px; height: 18px; color: var(--mod); flex: none; }
.task-agent-fixed b { color: var(--mod); font-weight: 650; }

.benefit-item { display: flex; align-items: center; gap: 12px; padding: 13px 15px; }
.bi-main { flex: 1; min-width: 0; }
.bi-title { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; font-size: 14px; font-weight: 550; }
.bi-actions { display: flex; align-items: center; gap: 4px; flex: none; }
.bi-toggle { white-space: nowrap; }

.match-card { cursor: pointer; transition: border-color .13s, background .13s; }
.match-card:hover { border-color: var(--mod); background: var(--surface-2); }
.match-card .bi-title { margin-bottom: 8px; }
.match-item {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 7px 0; border-top: 1px solid var(--line-soft); font-size: 13px;
}
.match-item:first-of-type { border-top: none; }

.scenario-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 4px; }
.scenario-chips .chip { cursor: pointer; transition: background .13s, color .13s; }
.scenario-chips .chip:hover { background: var(--mod-soft); color: var(--mod); border-color: transparent; }

/* ── 视图响应式 ──────────────────────────────────────── */
@media (max-width: 860px) {
  .editor-split { grid-template-columns: 1fr; grid-template-rows: 1fr 1fr; }
  .editor-pane { border-right: none; border-bottom: 1px solid var(--line-soft); }
  .mc-cols { grid-template-columns: 1fr; }
  .merge-cards { max-height: none; }
  .msg-col { max-width: 82%; }
  .cal-cell { min-height: 64px; }
  .cal-event { font-size: 10.5px; }
  .task-actions { flex-wrap: wrap; }
  .task-actions button { flex: 1 1 40%; }
  .sub-modal { grid-template-columns: 1fr; height: min(70vh, 600px); }
  .sub-modal .sub-list { border-right: none; }
  .sub-modal .sub-detail { position: absolute; inset: 0; z-index: 5; transform: translateX(100%); transition: transform .22s ease; }
  .sub-modal.sub-detail-open .sub-detail { transform: translateX(0); }
  .sub-modal { position: relative; }
  .search-overlay { padding-top: 4vh; }
  .sp-archive { margin-left: 0; }
}
@media (max-width: 520px) {
  .cal-weekdays, .cal-grid { padding-left: 8px; padding-right: 8px; gap: 3px; }
  .cal-cell { min-height: 52px; padding: 4px; border-radius: 7px; }
  .cal-event-time { display: none; }
  .note-view { padding: 18px 16px 50px; }
  .chat-thread { padding: 16px 14px; }
  .ac-meta { grid-template-columns: 1fr; gap: 10px; }
  .benefit-item { flex-wrap: wrap; }
  .bi-actions { width: 100%; justify-content: flex-end; }
  .t-desc { max-width: 120px; }
  .task-toolbar { flex-wrap: wrap; }
  .task-toolbar .task-status { flex: 1 1 100%; }
  .task-sort { flex: 1; }
  .rec-grid { flex-wrap: wrap; }
  .rec-grid > div { flex: 1 1 100%; }
}

/* ════════════════════════════════════════════════════════════
   保险箱 · 零知识密码管理（N-94 ~ N-96）
   专属色相：黄铜金 + 紫罗兰，区别于知识分区的天蓝，呼应「保险箱」语义。
   ════════════════════════════════════════════════════════════ */
:root {
  --vault: #e8b64c;
  --vault-soft: #e8b64c1f;
  --vault-2: #a78bfa;
  --vault-line: #e8b64c33;
}
.zone-tab[data-z='vault'].active { background: var(--vault-soft); color: var(--vault); }

/* 强度配色（条 /  chip 共用） */
.s0 { --sc: var(--danger); }
.s1 { --sc: var(--warn); }
.s2 { --sc: var(--info); }
.s3 { --sc: var(--ok); }
.s4 { --sc: #2dd4bf; }
.chip.s0 { background: #fb718518; color: var(--danger); border-color: transparent; }
.chip.s1 { background: #f5a62318; color: var(--warn); border-color: transparent; }
.chip.s2 { background: #38bdf818; color: var(--info); border-color: transparent; }
.chip.s3 { background: #34d39918; color: var(--ok); border-color: transparent; }
.chip.s4 { background: #2dd4bf18; color: #2dd4bf; border-color: transparent; }

/* ── 锁定 / 未初始化：列表迷你态 ───────────────────────── */
.vault-locked-mini { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 40px 22px; }
.vlm-ico { width: 64px; height: 64px; border-radius: 20px; display: flex; align-items: center; justify-content: center; background: var(--vault-soft); color: var(--vault); margin-bottom: 6px; }
.vlm-ico .ico { width: 30px; height: 30px; }
.vlm-title { font-size: 15px; font-weight: 650; }
.vlm-hint { font-size: 12.5px; color: var(--muted); line-height: 1.6; max-width: 240px; }
.vault-locked-mini .primary { margin-top: 12px; background: var(--vault); color: #1a1408; box-shadow: 0 4px 14px -4px var(--vault); }

/* ── 设置 / 解锁闸门 ───────────────────────────────────── */
.vault-gate { flex: 1; overflow-y: auto; min-height: 0; display: flex; align-items: flex-start; justify-content: center; padding: 40px 20px 60px;
  background: radial-gradient(900px 420px at 50% -8%, var(--vault-soft), transparent 62%); }
.vault-gate-card { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 30px 28px 26px; box-shadow: var(--shadow); }
.vg-badge { width: 66px; height: 66px; border-radius: 20px; display: flex; align-items: center; justify-content: center; margin: 0 auto 16px;
  background: linear-gradient(145deg, var(--vault), #c8912f); color: #1a1408; box-shadow: 0 10px 30px -10px var(--vault); }
.vg-badge.locked { background: linear-gradient(145deg, var(--surface-3), var(--surface-2)); color: var(--vault); box-shadow: none; border: 1px solid var(--vault-line); }
.vg-badge .ico { width: 32px; height: 32px; }
.vault-gate-card h2 { margin: 0 0 8px; text-align: center; font-size: 20px; font-weight: 700; }
.vg-sub { text-align: center; font-size: 13px; color: var(--muted); line-height: 1.65; margin: 0 0 18px; }
.vg-sub b { color: var(--vault); font-weight: 650; }
.vg-submit { width: 100%; margin-top: 16px; background: var(--vault); color: #1a1408; box-shadow: 0 6px 18px -6px var(--vault); font-weight: 650; padding: 11px; }
.vg-submit:hover { filter: brightness(1.06); }
.vg-foot { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 16px; font-size: 11.5px; color: var(--faint); }
.vg-foot .ico { width: 14px; height: 14px; color: var(--vault); }
.vault-warn { display: flex; gap: 10px; align-items: flex-start; margin-top: 16px; padding: 11px 13px; border-radius: 11px; background: #f5a62312; border: 1px solid #f5a62330; font-size: 12.5px; line-height: 1.6; color: var(--text); }
.vault-warn .ico { width: 17px; height: 17px; color: var(--warn); flex: none; margin-top: 1px; }
.vault-warn b { color: var(--warn); }
.vault-offline { display: flex; align-items: center; gap: 7px; margin-top: 14px; font-size: 12px; color: var(--warn); }
.vault-offline .ico { width: 15px; height: 15px; }

/* ── 密码输入 + 眼睛 / 生成按钮 ───────────────────────── */
.pw-wrap { display: flex; gap: 6px; align-items: center; }
.pw-wrap .inp { flex: 1; min-width: 0; }
.pw-eye, .pw-gen { width: 38px; height: 38px; flex: none; display: inline-flex; align-items: center; justify-content: center; border-radius: 9px; border: 1px solid var(--line); background: var(--surface-2); color: var(--muted); cursor: pointer; transition: color .15s, border-color .15s, background .15s; }
.pw-eye:hover, .pw-gen:hover { color: var(--vault); border-color: var(--vault-line); }
.pw-eye.on { color: var(--vault); background: var(--vault-soft); border-color: transparent; }
.pw-gen { color: var(--vault); }
.pw-eye .ico, .pw-gen .ico { width: 17px; height: 17px; }

/* ── 强度条 ───────────────────────────────────────────── */
.strength { margin-top: 8px; }
.strength-bar { display: flex; gap: 4px; height: 5px; }
.sseg { flex: 1; border-radius: 99px; background: var(--surface-3); transition: background .2s; }
.sseg.on { background: var(--sc); }
.strength-label { font-size: 11px; color: var(--faint); margin-top: 5px; }

/* ── 列表：健康条 / 筛选 / 排序 ───────────────────────── */
.vault-healthbar { display: flex; align-items: center; gap: 11px; width: calc(100% - 28px); margin: 0 14px 12px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; text-align: left; transition: border-color .15s, background .15s; }
.vault-healthbar:hover { border-color: var(--vault-line); background: var(--surface-2); }
.vault-healthbar > .ico { width: 16px; height: 16px; color: var(--faint); margin-left: auto; }
.vh-text { display: flex; flex-direction: column; min-width: 0; }
.vh-text b { font-size: 13px; font-weight: 600; }
.vh-text .hint-text { margin-top: 1px; }
.vh-ring { position: relative; width: 40px; height: 40px; flex: none; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: conic-gradient(var(--rc) calc(var(--pct) * 3.6deg), var(--surface-3) 0); }
.vh-ring::before { content: ''; position: absolute; inset: 4px; border-radius: 50%; background: var(--surface); }
.vh-ring b { position: relative; z-index: 1; font-size: 12px; font-weight: 700; }
.vh-ring.ok, .vo-ring.ok { --rc: var(--ok); }
.vh-ring.warn, .vo-ring.warn { --rc: var(--warn); }
.vh-ring.danger, .vo-ring.danger { --rc: var(--danger); }

.vault-filters { display: flex; flex-wrap: wrap; gap: 5px; padding: 0 14px 10px; }
.vfilter { display: inline-flex; align-items: center; gap: 5px; padding: 5px 9px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: 11.5px; font-weight: 550; cursor: pointer; transition: all .14s; }
.vfilter .ico { width: 13px; height: 13px; }
.vfilter:hover { color: var(--text); border-color: var(--vault-line); }
.vfilter.active { background: var(--vault-soft); color: var(--vault); border-color: transparent; }
.vf-n { font-size: 10px; opacity: .75; background: #ffffff12; border-radius: 99px; padding: 0 5px; min-width: 16px; text-align: center; }
.vfilter.active .vf-n { background: #00000022; }
.vault-sortrow { display: flex; align-items: center; gap: 6px; padding: 0 16px 8px; }
.vault-sortrow .spacer { flex: 1; }
.vault-sortrow > .ico { width: 14px; height: 14px; color: var(--faint); }
.vault-sort { background: transparent; border: none; color: var(--muted); font-size: 12px; font-family: inherit; cursor: pointer; outline: none; padding: 2px 4px; }
.vault-sort:hover { color: var(--vault); }
.vault-sort option { background: var(--surface-2); color: var(--text); }

/* ── 凭据列表项 ───────────────────────────────────────── */
.vault-item .avatar { border-radius: 11px; }
.vi-fav { display: inline-flex; margin-left: 5px; color: var(--vault); vertical-align: middle; }
.vi-fav .ico { width: 13px; height: 13px; }
.vi-fav .ico svg { fill: var(--vault); }
.vi-badge, .vi-pend { padding: 3px; border-radius: 7px; }
.vi-badge .ico, .vi-pend .ico { width: 13px; height: 13px; }
.icon-btn.fav-on { color: var(--vault); background: var(--vault-soft); }
.icon-btn.fav-on .ico svg { fill: var(--vault); }

/* ── 概览仪表盘 ───────────────────────────────────────── */
.vault-overview { flex: 1; overflow-y: auto; min-height: 0; padding: 22px 26px 50px; }
.vo-hero { display: flex; gap: 22px; align-items: center; padding: 22px; border-radius: 16px; border: 1px solid var(--vault-line);
  background: linear-gradient(135deg, var(--vault-soft), transparent 70%), var(--surface); margin-bottom: 18px; }
.vo-ring { position: relative; width: 104px; height: 104px; flex: none; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: conic-gradient(var(--rc) calc(var(--pct) * 3.6deg), var(--surface-3) 0); }
.vo-ring::before { content: ''; position: absolute; inset: 9px; border-radius: 50%; background: var(--surface); }
.vo-ring b { position: relative; z-index: 1; font-size: 30px; font-weight: 750; line-height: 1; }
.vo-ring span { position: relative; z-index: 1; font-size: 10.5px; color: var(--muted); margin-top: 3px; }
.vo-hero-text { min-width: 0; }
.vo-hero-text h2 { display: flex; align-items: center; gap: 8px; margin: 0 0 5px; font-size: 18px; font-weight: 700; }
.vo-hero-text h2 .ico { width: 21px; height: 21px; color: var(--vault); }
.vo-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.vo-actions .primary { background: var(--vault); color: #1a1408; box-shadow: 0 4px 14px -4px var(--vault); }
.vo-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.vo-card { text-align: left; padding: 15px 16px; border-radius: 13px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; transition: border-color .15s, transform .12s; }
.vo-card:hover { transform: translateY(-2px); border-color: var(--vault-line); }
.vc-n { font-size: 26px; font-weight: 750; line-height: 1; color: var(--muted); }
.vo-card.has.warn .vc-n { color: var(--warn); }
.vo-card.has.danger .vc-n { color: var(--danger); }
.vo-card.has.info .vc-n { color: var(--info); }
.vo-card.has.muted .vc-n { color: var(--vault-2); }
.vc-label { font-size: 13px; font-weight: 600; margin-top: 7px; }
.vc-hint { font-size: 11.5px; color: var(--faint); margin-top: 3px; line-height: 1.5; }
.vo-recent { display: flex; flex-direction: column; gap: 2px; }
.vault-zk-foot { display: flex; gap: 9px; align-items: flex-start; margin-top: 22px; padding: 13px 15px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line-soft); font-size: 12px; color: var(--muted); line-height: 1.65; }
.vault-zk-foot .ico { width: 16px; height: 16px; color: var(--vault); flex: none; margin-top: 1px; }

/* ── 凭据详情 ─────────────────────────────────────────── */
.vault-detail { flex: 1; overflow-y: auto; min-height: 0; padding: 20px 26px 50px; max-width: 720px; width: 100%; margin: 0 auto; }
.vault-pending-banner { display: flex; align-items: center; gap: 8px; padding: 9px 13px; border-radius: 10px; background: #f5a62312; border: 1px solid #f5a62330; color: var(--warn); font-size: 12.5px; margin-bottom: 16px; }
.vault-pending-banner .ico { width: 15px; height: 15px; }
.vd-field { margin-bottom: 16px; }
.vd-label { display: flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600; letter-spacing: .4px; text-transform: uppercase; color: var(--faint); margin-bottom: 6px; }
.vd-label .ico { width: 14px; height: 14px; }
.vd-strength { margin-left: auto; text-transform: none; letter-spacing: 0; }
.vd-row { display: flex; align-items: center; gap: 6px; padding: 9px 12px; border-radius: 11px; background: var(--surface-2); border: 1px solid var(--line); }
.vd-val { flex: 1; min-width: 0; font-size: 14px; word-break: break-all; }
.vd-val.mono { font-family: var(--mono); }
.vd-val.masked { letter-spacing: 2px; color: var(--muted); }
.vd-url { color: var(--info); }
.vd-row .icon-btn { width: 30px; height: 30px; }
.vd-row .icon-btn .ico { width: 16px; height: 16px; }
.vd-notes { padding: 11px 13px; border-radius: 11px; background: var(--surface-2); border: 1px solid var(--line); font-size: 13px; line-height: 1.7; white-space: pre-wrap; word-break: break-word; }
.vd-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.vd-meta { font-size: 11.5px; color: var(--faint); margin: 18px 0; }

/* TOTP */
.totp-code { font-size: 24px; font-weight: 650; letter-spacing: 3px; color: var(--vault); }
.totp-ring { position: relative; width: 34px; height: 34px; flex: none; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: conic-gradient(var(--vault) calc(var(--pct, 100) * 3.6deg), var(--surface-3) 0); }
.totp-ring::before { content: ''; position: absolute; inset: 3px; border-radius: 50%; background: var(--surface-2); }
.totp-secs { position: relative; z-index: 1; font-size: 11px; font-weight: 650; color: var(--muted); }
.totp-bar { height: 3px; border-radius: 99px; background: var(--surface-3); margin-top: 8px; overflow: hidden; }
.totp-bar span { display: block; height: 100%; background: var(--vault); border-radius: 99px; transition: width 1s linear; }
.totp-bar span.urgent { background: var(--danger); }

/* iOS 填充卡 */
.vault-fill-card { margin-top: 22px; padding: 16px 18px; border-radius: 14px; border: 1px solid var(--vault-line); background: linear-gradient(135deg, var(--vault-soft), transparent 75%), var(--surface); }
.vf-head { display: flex; align-items: center; gap: 8px; font-size: 14px; margin-bottom: 7px; }
.vf-head .ico { width: 19px; height: 19px; color: var(--vault); }
.vf-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

/* ── 编辑器 ───────────────────────────────────────────── */
.vault-editor { flex: 1; overflow-y: auto; min-height: 0; padding: 18px 26px 50px; max-width: 640px; width: 100%; margin: 0 auto; }
.vd-textarea { min-height: 76px; }
.vault-check { display: flex; align-items: center; gap: 8px; margin-top: 16px; font-size: 13px; cursor: pointer; color: var(--text); }
.vault-check input { width: 16px; height: 16px; accent-color: var(--vault); cursor: pointer; }
.vault-check .ico { width: 15px; height: 15px; color: var(--vault); }
.req { color: var(--danger); }

/* ── 密码生成器 ───────────────────────────────────────── */
.gen { display: flex; flex-direction: column; gap: 16px; }
.gen-preview { padding: 16px; border-radius: 13px; background: var(--surface-2); border: 1px solid var(--vault-line); }
.gen-pw { font-size: 19px; font-weight: 600; letter-spacing: .5px; word-break: break-all; line-height: 1.5; color: var(--text); user-select: all; }
.gen-meta { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.gen-controls { display: flex; flex-direction: column; gap: 14px; }
.gen-row { display: flex; flex-direction: column; gap: 8px; }
.gen-len-label { font-size: 12.5px; color: var(--muted); }
.gen-len-label b { color: var(--vault); font-size: 14px; }
.gen-slider { -webkit-appearance: none; appearance: none; width: 100%; height: 6px; border-radius: 99px; background: var(--surface-3); outline: none; cursor: pointer; }
.gen-slider::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 18px; height: 18px; border-radius: 50%; background: var(--vault); cursor: pointer; box-shadow: 0 0 0 4px var(--vault-soft); transition: box-shadow .15s; }
.gen-slider::-webkit-slider-thumb:hover { box-shadow: 0 0 0 6px var(--vault-soft); }
.gen-slider::-moz-range-thumb { width: 18px; height: 18px; border: none; border-radius: 50%; background: var(--vault); cursor: pointer; box-shadow: 0 0 0 4px var(--vault-soft); }
.gen-toggles { display: grid; grid-template-columns: 1fr 1fr; gap: 11px 16px; }
.gen-toggle { display: flex; align-items: center; gap: 9px; cursor: pointer; }
.gen-toggle input { display: none; }
.gt-track { width: 36px; height: 20px; flex: none; border-radius: 99px; background: var(--surface-3); position: relative; transition: background .15s; }
.gt-track::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--muted); transition: transform .16s, background .16s; }
.gen-toggle input:checked + .gt-track { background: var(--vault-soft); }
.gen-toggle input:checked + .gt-track::after { transform: translateX(16px); background: var(--vault); }
.gt-label { font-size: 12.5px; color: var(--text); }
.gen-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.gen-actions .primary { background: var(--vault); color: #1a1408; box-shadow: 0 4px 14px -4px var(--vault); margin-left: auto; }

/* ── 安全健康报告 ─────────────────────────────────────── */
.vault-health { flex: 1; overflow-y: auto; min-height: 0; padding: 22px 26px 50px; max-width: 720px; width: 100%; margin: 0 auto; }
.vh-hero { display: flex; gap: 20px; align-items: center; margin-bottom: 22px; }
.vh-hero h2 { margin: 0 0 5px; font-size: 18px; font-weight: 700; }
.vh-sec { margin-bottom: 18px; }
.vh-sec-head { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 650; padding: 8px 0; }
.vh-sec-head .ico { width: 16px; height: 16px; }
.vh-sec-head .chip { margin-left: auto; }
.vh-sec-head.ok { color: var(--ok); }
.vh-sec-head.warn { color: var(--warn); }
.vh-sec-head.danger { color: var(--danger); }
.vh-sec-head.info { color: var(--info); }
.vh-sec-head.muted { color: var(--vault-2); }
.vh-sec-hint { margin: 0 0 8px; }
.vault-health .list-item { padding: 9px 11px; }
.vault-health .list-item > .ico { width: 15px; height: 15px; color: var(--faint); margin-left: auto; }

/* ── 导出 ─────────────────────────────────────────────── */
.vault-export .section-title { margin-top: 18px; }
.vault-export .primary { background: var(--vault); color: #1a1408; box-shadow: 0 4px 14px -4px var(--vault); }

/* ── 撤销 toast ───────────────────────────────────────── */
.toast-undo { display: flex; align-items: center; gap: 14px; }
.undo-btn { background: transparent; border: none; color: var(--vault); font-weight: 650; font-size: 13px; cursor: pointer; padding: 2px 6px; border-radius: 6px; }
.undo-btn:hover { background: var(--vault-soft); }

/* ── 保险箱响应式 ─────────────────────────────────────── */
@media (max-width: 860px) {
  .vo-hero { flex-direction: column; text-align: center; gap: 16px; }
  .vo-actions { justify-content: center; }
  .vault-overview, .vault-detail, .vault-editor, .vault-health { padding-left: 18px; padding-right: 18px; }
  .vh-hero { flex-direction: column; text-align: center; gap: 14px; }
}
@media (max-width: 520px) {
  .vault-gate { padding: 24px 14px 48px; }
  .vault-gate-card { padding: 24px 20px; }
  .vo-cards { grid-template-columns: 1fr; }
  .gen-toggles { grid-template-columns: 1fr; }
  .totp-code { font-size: 21px; }
  .vf-actions .ghost, .vo-actions .ghost, .vo-actions .primary { flex: 1; }
}

/* ── 数字人二级功能配置入口列表（C32-a / N-99）────────────── */
.ac-menu-item .li-sub { white-space: normal; }
.ac-menu-item .li-sub .chip { vertical-align: middle; margin-right: 4px; }

/* ── 权益自动生成配置视图（C32 / N-99 / PRD §4.10）────────── */
.bg-config { max-width: 720px; }
.bg-plan { display: flex; flex-direction: column; gap: 14px; }
.bg-toggle-row { display: flex; align-items: center; gap: 12px; }
.bg-toggle-row.compact { gap: 9px; }
.bg-toggle-body { flex: 1; min-width: 0; }
.bg-toggle-label { font-size: 13.5px; font-weight: 600; color: var(--text); }
.bg-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px 14px; }
.bg-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.bg-field .fld { margin: 0; }
.bg-stepper { display: flex; align-items: center; gap: 6px; }
.bg-stepper .inp { flex: 1; min-width: 0; text-align: center; }
.bg-stepper .icon-btn { flex: none; width: 30px; height: 30px; }
.bg-stepper .icon-btn .ico { width: 15px; height: 15px; }
.bg-unit { flex: none; font-size: 12px; color: var(--muted); }
.bg-dedupe-field { justify-content: flex-end; }
.bg-ctx-row { display: flex; flex-direction: column; gap: 7px; }
.bg-ctx-row .fld { margin: 0; }
.bg-weekday { display: flex; flex-wrap: wrap; gap: 6px; }
.bg-wd { cursor: pointer; border: 1px solid var(--line); background: var(--surface-2); color: var(--muted); font-size: 12px; padding: 5px 11px; }
.bg-wd.on { background: var(--mod-soft); color: var(--mod); border-color: transparent; font-weight: 650; }
.bg-monthday { max-width: 140px; }
.bg-preview { background: linear-gradient(165deg, var(--mod-soft), var(--surface) 60%); border-color: var(--mod-soft); display: flex; flex-direction: column; gap: 8px; }
.bg-desc { font-size: 15px; font-weight: 700; color: var(--text); }
.bg-next { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--muted); }
.bg-next .ico { width: 15px; height: 15px; color: var(--mod); flex: none; }
.bg-next b { color: var(--mod); font-weight: 700; }
.bg-next.off { color: var(--warn); }
.bg-next.off .ico { color: var(--warn); }
.bg-actions { margin-top: 4px; }
.bg-run { width: 100%; justify-content: center; margin-top: 8px; }
.section-title:has(.bg-refresh) { display: flex; align-items: center; gap: 8px; }
.bg-refresh { margin-left: auto; padding: 3px 9px; font-size: 11px; }
.bg-refresh .ico { width: 14px; height: 14px; }
.bg-run-row { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border: 1px solid var(--line-soft); border-radius: var(--radius); background: var(--surface); margin-bottom: 8px; }
.bg-run-row .chip { flex: none; }
.bg-run-body { flex: 1; min-width: 0; }
.bg-run-line { font-size: 13px; color: var(--text); }
.bg-err { color: var(--danger); }
.bg-empty { padding: 14px 0; }
.bg-prop-filter { display: inline-flex; gap: 5px; margin-left: 8px; }
.bg-prop-filter .chip { cursor: pointer; font-size: 11px; padding: 2px 9px; }
.bg-prop { padding: 14px; }
.bg-prop.applied { border-color: #34d39955; }
.bg-prop.dismissed { opacity: .62; }
.bg-prop-head { display: flex; align-items: center; gap: 10px; }
.bg-prop-head .note-ico { flex: none; }
.bg-prop-title { font-size: 14px; font-weight: 650; color: var(--text); display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.bg-pitems { margin: 11px 0; display: flex; flex-direction: column; gap: 7px; }
.bg-pitem { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 7px 10px; background: var(--surface-2); border-radius: 8px; }
.bg-pname { font-size: 13px; font-weight: 550; color: var(--text); }
.bg-pitem .hint-text { margin: 0 0 0 auto; }
.bg-prop-actions { display: flex; gap: 8px; }
.bg-prop-actions .primary, .bg-prop-actions .ghost { flex: 1; justify-content: center; padding: 7px 12px; }
@media (max-width: 520px) {
  .bg-grid { grid-template-columns: 1fr; }
  .bg-prop-actions { flex-direction: column; }
}