/* AI生成 */
/* ═ PaaS 平台 · 全局设计系统（规范表 · 全局唯一一份）══════════════════════
    workbuddy 风格：清爽浅色 + 柔和蓝紫 + 大圆角 + 柔和阴影；系统黑体 + 等宽数据。
    两类消费者：
    - 平台渲染页（base.html 族模板）经 /static/fde.css 直接引用（登录前可达）；
    - view/ SPA 经 view/lib/styles.css 的一行 @import 别名引用。
    文件末段为「平台渲染页组件层」，裸元素样式以 .pf 作用域隔离，不波及 SPA。 */

:root {
  --ink: #0f172a;            /* 深蓝黑 */
  --ink-2: #334155;
  --canvas: #f8fafc;         /* 极浅灰蓝 */
  --card: #ffffff;
  --line: #e2e8f0;
  --fg: #0f172a;             /* 文字主色 · 深蓝黑 */
  --muted: #64748b;           /* 文字次要色 · slate灰 */
  --prime: #FF6B35;          /* 活力橙主色 */
  --prime-soft: #FFF1EB;     /* 橙色 · 浅底 */
  --ink-soft: #1e293b;       /* 深蓝灰 · 顶栏/品牌墙渐变亮端 */
  --amber-deep: #D44915;     /* 深橙 · 深一档 */
  --ease: cubic-bezier(.22, .9, .36, 1);
  --accent: var(--prime);    /* 旧平台页变量别名（users.html 等沿用） */          /* 主操作 · 橙色 */
  --prime-deep: #D44915;
  --amber: #FF6B35;          /* 高亮 · 橙色 */
  --amber-soft: #FFF1EB;
  --shadow: 0 1px 3px rgba(0, 0, 0, .06), 0 4px 12px -4px rgba(0, 0, 0, .1);
  --mono: ui-monospace, "Cascadia Code", "JetBrains Mono", Consolas, monospace;
  --sans: -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", Roboto, sans-serif;

  /* ── SPEC 能力挂载模块 Token（WCAG AA · 浅色）── */
  --brand-50: #FFF3E8;
  --brand-100: #FFE0CC;
  --brand-500: #F2690C;
  --brand-600: #D2550A;
  --n-0: #FFFFFF;
  --n-50: #F7F8FA;
  --n-200: #E6E8EC;
  --n-300: #D5D8DE;
  --n-500: #7A808C;
  --n-900: #1A1D23;
  --warn-500: #D98A08;
  --ok-500: #12A05C;
  --info-500: #2C6BD4;
  --err-50: #FEF2F2;
}

/* ── SPEC 能力挂载模块 Token · 深色 ── */
@media (prefers-color-scheme: dark) {
  :root {
    --brand-50: #3A1F08;
    --brand-100: #5A2F0C;
    --brand-500: #FF8A3D;
    --brand-600: #FFA257;
    --n-0: #14161A;
    --n-50: #1F232A;
    --n-200: #31363F;
    --n-300: #414853;
    --n-500: #8B929E;
    --n-900: #F2F4F7;
    --warn-500: #F0A93B;
    --ok-500: #2ECC80;
    --info-500: #5B95E8;
    --err-50: #2A1414;
  }
}

* { box-sizing: border-box; }
[x-cloak] { display: none !important; }
html, body { margin: 0; height: 100%; }
body {
  font: 14px/1.65 var(--sans); color: var(--fg); background: var(--canvas);
  display: flex; height: 100vh; overflow: hidden;
}

/* ── 环境底纹：简洁浅色 ─────────────────────────────────── */
.stage {
  flex: 1; min-width: 0; display: flex; flex-direction: column; overflow: hidden;
  background: var(--canvas);
}

/* ── 侧栏（深色图标栏 · 56px）──────────────────────────── */
aside.rail {
  width: 56px; flex: none; background: #1E2A38;
  border-right: 1px solid rgba(0,0,0,.2);
  color: #E5EAF0; padding: 14px 8px 12px; display: flex; flex-direction: column; gap: 2px;
  position: sticky; top: 0; height: 100vh; align-items: center;
}
.rail .back-home { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px;
  padding: 0 0 8px; font-size: 0; color: #8B98A8; text-decoration: none; transition: color .15s; }
.rail .back-home::before { content: "←"; font-size: 16px; }
.rail .back-home:hover { color: var(--prime); }
.brand { width: 100%; padding: 2px 0 12px; border-bottom: 1px solid rgba(255,255,255,.08); margin-bottom: 10px;
  display: flex; flex-direction: column; align-items: center; }
.brand .brand-ic { width: 28px; height: 28px; color: var(--prime); margin: 0; display: block; }
.brand .name, .brand .sub { display: none; }
/* 菜单区可滚动：brand/foot 固定，菜单超长时内部滚动 */
.rail-menu { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; display: flex; flex-direction: column; gap: 2px; width: 100%; }
.nav-item {
  display: flex; align-items: center; justify-content: center; gap: 0; padding: 10px 0; border-radius: 10px;
  color: #A9B4C2; font-size: 13.5px; cursor: pointer; user-select: none;
  transition: background .15s, color .15s; width: 40px; margin: 0 auto;
}
.nav-item .ic { width: 20px; height: 20px; text-align: center; font-size: 18px; opacity: .9; flex: none; }
.nav-item .ic.svg-ic { width: 20px; height: 20px; opacity: .9; }
.nav-item .nav-label { display: none; }
.nav-item:hover { background: rgba(255,107,53,.14); color: var(--prime); }
.nav-item.on { background: rgba(255,107,53,.2); color: var(--prime); font-weight: 700; }
.nav-item.main { font-weight: 700; color: #E5EAF0; }
.rail .foot { margin-top: auto; width: 100%; display: flex; flex-direction: column; align-items: center;
  padding: 10px 0 0; border-top: 1px solid rgba(255,255,255,.08); }
.rail .foot .foot-tag { display: none; }
/* 侧边栏底部用户信息区（仅头像） */
.rail-user { display: flex; align-items: center; justify-content: center; margin-top: 10px; padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,.08); width: 100%; }
.rail-user .ava { width: 30px; height: 30px; border-radius: 50%; background: var(--prime); color: #fff;
  display: grid; place-items: center; font-size: 13px; font-weight: 700; flex: none; }
.rail-user-info, .rail-user a { display: none; }
/* 品牌标识图标（AI管家 · 餐盖） */
.ptop .logo-ic { width: 24px; height: 24px; vertical-align: -5px; margin-right: 6px; color: var(--prime); }
.bw-logo .bw-logo-ic { width: 48px; height: 48px; vertical-align: -12px; margin-right: 10px; color: var(--prime); }
.livedot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #34d399;
  margin-right: 5px; animation: pulse 2s infinite; vertical-align: 1px; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(52,211,153,.55);} 60% { box-shadow: 0 0 0 6px rgba(52,211,153,0);} }

/* ── 顶栏 ──────────────────────────────────────────────── */
header.top {
  display: flex; align-items: center; gap: 14px; padding: 14px 26px 12px;
  border-bottom: 1px solid var(--line); background: rgba(255,255,255,.55);
  backdrop-filter: blur(6px); position: sticky; top: 0; z-index: 20;
}
header.top h1 { margin: 0; font-size: 20px; font-weight: 800; letter-spacing: .02em; }
header.top .crumb { font-size: 12px; color: var(--muted); }
.uchip { margin-left: auto; display: flex; align-items: center; gap: 8px; font-size: 12.5px;
  background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px 4px 6px;
  box-shadow: var(--shadow); }
.uchip .ava { width: 22px; height: 22px; border-radius: 50%; background: var(--prime); color: #fff;
  display: grid; place-items: center; font-size: 11px; font-weight: 700; }
.uchip a { color: var(--muted); text-decoration: none; } .uchip a:hover { color: var(--amber); }

/* ── Agent 右栏（壳层常驻，全页面可见）────────────────────── */
.agent-toggle {
  border: 1px solid var(--line); background: #fff; border-radius: 999px;
  padding: 4px 12px; font-size: 12.5px; cursor: pointer; color: var(--fg);
  white-space: nowrap;
}
.agent-toggle:hover { border-color: var(--prime); color: var(--prime); }
.agent-toggle.on { background: var(--prime); color: #fff; border-color: var(--prime); }
.agent-toggle.on:hover { color: #fff; }
/* 首页 toggle：fixed 右上角，展开时右移到 rail 左侧（rail 宽 380px + 16px 间距） */
.home-agent-toggle { position: fixed; top: 66px; right: 16px; z-index: 102;
  box-shadow: var(--shadow); transition: right .2s var(--ease); }
.home-agent-toggle.on { right: 416px; }

aside.agent-rail {
  width: var(--agent-rail-w, 400px); flex: none; background: #F4F6FA; border-left: 1px solid #dde3eb;
  position: sticky; top: 0; height: 100vh; display: flex;
  transition: width .16s var(--ease);
}
/* 拖拽调节宽度手柄（悬停在右栏左缘） */
.agent-rail-resizer { position: absolute; left: -3px; top: 0; bottom: 0; width: 7px; cursor: col-resize; z-index: 10; }
.agent-rail-resizer:hover, .agent-rail-resizer.dragging { background: rgba(255,107,53,.28); }
/* 首页（.pf 是 block 布局，非应用页 flex）：右侧固定栏浮在视口右侧，置于顶栏(100)之上 */
.pf .agent-rail { position: fixed; top: 0; right: 0; height: 100vh; z-index: 101; }
/* 扩展态：全屏覆盖主区域（左到菜单栏 56px 右侧，右到屏幕右缘，盖住顶栏） */
aside.agent-rail.is-expanded {
  position: fixed; top: 0; right: 0; bottom: 0; left: 56px; width: auto; z-index: 120;
}
/* 首页无侧栏：扩展为全屏 */
.pf aside.agent-rail.is-expanded { left: 0; }
/* 收起态：窄条 40px */
aside.agent-rail.is-collapsed { width: 40px; }
aside.agent-rail > div { flex: 1; min-width: 0; min-height: 0; display: flex; }
.agent-rail-inner { flex: 1; min-height: 0; display: flex; flex-direction: column;
  gap: 6px; padding: 10px 12px; }
.agent-rail-body { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 6px; }
/* 收起窄条（40px 竖向展开按钮） */
.agent-rail-collapsed { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; padding: 10px 0; gap: 10px; }
.agent-rail-collapsed button { border: none; background: #fff; border: 1px solid var(--line); border-radius: 8px;
  width: 28px; cursor: pointer; color: var(--muted); font-size: 11px; padding: 9px 0; line-height: 1;
  writing-mode: vertical-rl; text-orientation: upright; letter-spacing: 2px; }
.agent-rail-collapsed button:hover { color: var(--prime); border-color: var(--prime); }

/* 头部：Agent 头像 + 名称 + 在线状态灯 */
.agent-rail-hd { display: flex; align-items: center; gap: 10px; }
.agent-rail-avatar { width: 16px; height: 16px; border-radius: 50%; background: var(--prime); color: #fff;
  display: grid; place-items: center; font-size: 9px; flex: none; position: relative; }
.agent-rail-avatar::after { content: ""; position: absolute; right: -1px; bottom: -1px; width: 5px; height: 5px;
  border-radius: 50%; background: #34d399; border: 1px solid #F4F6FA; }
.agent-rail-title { flex: 1; min-width: 0; }
.agent-rail-title .name { font-size: 14px; font-weight: 700; color: #1e2a3a; }
.agent-rail-title .status { font-size: 11px; color: #2a9d6e; display: flex; align-items: center; gap: 4px; }

.agent-rail-sel { width: 100%; }
.agent-rail-chat { flex: 1; height: auto; min-height: 200px; }

/* 输入框卡片 */
.agent-rail-input { display: flex; flex-direction: column; gap: 6px; }
.agent-rail-input-card { border: 1.5px solid var(--prime); border-radius: 12px; background: #fff;
  padding: 8px 10px; display: flex; flex-direction: column; gap: 6px; transition: box-shadow .15s; }
.agent-rail-input-card:focus-within { box-shadow: 0 0 0 3px rgba(255,107,53,.15); }
.agent-rail-input textarea { width: 100%; border: none; outline: none; resize: none; min-height: 56px;
  max-height: 240px; line-height: 1.5; font: 13.5px var(--sans); background: transparent; color: #2a3a4e; padding: 0; }
.agent-rail-input-bar { display: flex; align-items: center; gap: 6px; }
.agent-rail-toolbtn { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--line);
  background: #fff; border-radius: 8px; padding: 4px 9px; font-size: 12px; color: #5a6b7e; cursor: pointer; transition: all .14s; }
.agent-rail-toolbtn:hover { border-color: var(--prime); color: var(--prime); }
.agent-rail-send { margin-left: auto; display: inline-flex; align-items: center; gap: 5px; background: var(--prime);
  color: #fff; border: none; border-radius: 8px; padding: 6px 14px; font: 600 13px var(--sans); cursor: pointer; transition: background .14s, transform .1s; }
.agent-rail-send:hover { background: var(--prime-deep); }
.agent-rail-send:disabled { opacity: .45; cursor: not-allowed; }
.agent-rail-send:active { transform: scale(.97); }
.agent-rail-send.stop { background: #64748b; }
.agent-rail-send.stop:hover { background: #475569; }
.agent-rail-hint { font-size: 11px; color: #9aa7b5; text-align: center; }

/* ── Agent 右栏 · 浅色主题 ────────────────────────────── */
.agent-rail .overline { color: #6b7a8f; }
.agent-rail .b-ghost { background: #fff; border-color: #cdd5de; color: #3a4a5e; }
.agent-rail .b-ghost:hover { border-color: var(--prime); color: var(--prime); }
.agent-rail select { background: #fff; border-color: #cdd5de; color: #2a3a4e; }
.agent-rail .chatbox {
  background: transparent; border: none; border-radius: 0; padding: 2px 2px 8px;
}
/* 气泡式消息：头像 + 白底/实心 */
.agent-rail .msg { display: flex; gap: 6px; align-items: flex-start; max-width: 100%; }
.agent-rail .msg .msg-ava { width: 12px; height: 12px; border-radius: 50%; flex: none; display: grid;
  place-items: center; font-size: 7px; background: var(--prime); color: #fff; }
.agent-rail .msg.ai .msg-ava { background: var(--prime); }
.agent-rail .msg .msg-body { flex: 1; min-width: 0; }
.agent-rail .msg.me .msg-body { display: flex; flex-direction: column; align-items: flex-end; }
.agent-rail .msg .who { color: #8896a8; font-size: 10.5px; margin: 0 2px 3px; }
.agent-rail .msg .b { box-shadow: 0 1px 3px rgba(0,0,0,.06); padding: 8px 12px; border-radius: 12px;
  font-size: 13px; line-height: 1.55; }
.agent-rail .msg.ai .b { background: #fff; border: 1px solid #e4e9f0; color: #2a3a4e; border-top-left-radius: 4px; }
.agent-rail .msg.me { justify-content: flex-end; }
.agent-rail .msg.me .b { background: var(--prime); color: #fff; border-top-right-radius: 4px; }
.agent-rail .empty, .agent-rail .muted { color: #8896a8; }
.agent-rail .tcall { background: #e8f4f2; color: #2a7a6e; }

/* ── Agent 右栏 · 文件面板 ─────────────────────────────── */
.fp { border: 1px solid #dde3eb; border-radius: 8px; background: #fff; overflow: hidden; }
.fp-hd { width: 100%; display: flex; align-items: center; justify-content: space-between;
  padding: 8px 10px; border: none; background: #f0f2f5; cursor: pointer; font-size: 13px; color: #3a4a5e; }
.fp-hd:hover { background: #e8ebef; }
.fp-arrow { transition: transform .2s; font-size: 11px; color: #8896a8; }
.fp-arrow.open { transform: rotate(180deg); }
.fp-body { max-height: 220px; overflow-y: auto; }
.fp-empty, .fp-empty-sm { padding: 12px 10px; font-size: 12px; color: #8896a8; text-align: center; }
.fp-empty-sm { padding: 6px 10px; }
.fp-sections { display: flex; flex-direction: column; }
.fp-sec { border-bottom: 1px solid #eef0f3; }
.fp-sec:last-child { border-bottom: none; }
.fp-sec-hd { display: flex; align-items: center; justify-content: space-between;
  padding: 6px 10px; background: #f8f9fb; font-size: 12px; }
.fp-sec-title { font-weight: 600; color: #3a4a5e; }
.fp-upload-btn { font-size: 11px; color: var(--prime); cursor: pointer; padding: 2px 8px;
  border: 1px solid var(--prime); border-radius: 4px; background: transparent; }
.fp-upload-btn:hover { background: var(--prime); color: #fff; }
.fp-row { display: flex; align-items: center; gap: 6px; padding: 4px 10px; font-size: 12px; }
.fp-row:hover { background: #f8f9fb; }
.fp-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: #2a3a4e; }
.fp-meta { flex: none; color: #8896a8; font-size: 11px; white-space: nowrap; }
.fp-act { flex: none; font-size: 13px; color: #6b7a8f; text-decoration: none; cursor: pointer;
  background: none; border: none; padding: 0 2px; line-height: 1; }
.fp-act:hover { color: var(--prime); }

/* ═══════════════════════════════════════════════════════════════════
   SPEC 能力挂载模块（WCAG 2.1 AA · 品牌色只表语义 · 主操作唯一）
   ═══════════════════════════════════════════════════════════════════ */

/* ── 输入区 chip 回显 ── */
.mount-chip {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--brand-50); border: 1px solid var(--brand-100); color: var(--brand-500);
  border-radius: 999px; padding: 2px 10px; font: 500 12px var(--sans); cursor: pointer;
  transition: all 180ms cubic-bezier(.2,0,.2,1); white-space: nowrap; line-height: 1.4;
  animation: mount-chip-in 180ms cubic-bezier(.2,0,.2,1);
}
.mount-chip:hover { background: var(--brand-500); color: var(--n-0); border-color: var(--brand-500); }
.mount-chip-x { font-size: 14px; opacity: .55; line-height: 1; }
.mount-chip:hover .mount-chip-x { opacity: 1; }
@keyframes mount-chip-in { from { transform: scale(.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* ── 「能力」按钮：次级幽灵胶囊（非主操作） ── */
.agent-rail-toolbtn.mount-active {
  border-color: var(--brand-500); color: var(--brand-500); background: var(--brand-50);
}

/* ── 挂载面板容器 ── */
.mount-panel {
  border: 1px solid var(--n-300); border-radius: 12px; background: var(--n-0);
  box-shadow: 0 8px 28px rgba(26,29,35,.12); overflow: hidden; width: 100%; max-width: 560px;
  transform-origin: bottom left;
  animation: mount-panel-in 260ms cubic-bezier(.2,0,.2,1);
}
@keyframes mount-panel-in { from { transform: scale(.92); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .mount-panel, .mount-chip { animation: none; } }

/* ── 面板头部（48px）── */
.mount-panel-hd {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px; height: 48px; background: var(--n-50); border-bottom: 1px solid var(--n-200);
  font: 500 14px var(--sans); color: var(--n-900);
}
.mount-panel-hd .mount-scope-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font: 400 11px var(--sans); color: var(--n-500);
  background: var(--n-0); border: 1px solid var(--n-200); border-radius: 999px; padding: 2px 8px;
}

/* ── 搜索框（36px）── */
.mount-search {
  display: flex; align-items: center; gap: 6px; padding: 0 16px; height: 36px;
  border-bottom: 1px solid var(--n-200); background: var(--n-0);
}
.mount-search input {
  flex: 1; border: none; outline: none; background: transparent;
  font: 400 13px var(--sans); color: var(--n-900); padding: 4px 0;
}
.mount-search input::placeholder { color: var(--n-500); }
.mount-search .mount-search-kbd {
  font: 400 11px var(--mono); color: var(--n-500);
  border: 1px solid var(--n-200); border-radius: 4px; padding: 1px 5px; line-height: 1.4;
}

/* ── Tab 组（40px）── */
.mount-tabs {
  display: flex; height: 40px; border-bottom: 1px solid var(--n-200); background: var(--n-0);
}
.mount-tabs button {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: none; background: transparent; cursor: pointer;
  font: 400 13px var(--sans); color: var(--n-500);
  border-bottom: 2px solid transparent; transition: all 120ms cubic-bezier(.2,0,.2,1);
}
.mount-tabs button svg { width: 15px; height: 15px; stroke-width: 1.7; }
.mount-tabs button:hover { color: var(--brand-500); }
.mount-tabs button.active { color: var(--brand-500); border-bottom-color: var(--brand-500); font-weight: 500; }
.mount-tabs button .mount-tab-count {
  font: 400 11px var(--sans); color: var(--n-500);
  background: var(--n-50); border-radius: 999px; padding: 0 6px; line-height: 1.6;
}
.mount-tabs button.active .mount-tab-count { background: var(--brand-50); color: var(--brand-500); }

/* ── 面板主体 ── */
.mount-panel-body { max-height: 288px; overflow-y: auto; }
.mount-panel-body::-webkit-scrollbar { width: 6px; }
.mount-panel-body::-webkit-scrollbar-thumb { background: var(--n-300); border-radius: 3px; }
.mount-panel-body::-webkit-scrollbar-track { background: transparent; }

/* ── 列表项（56px 行高，勾选框右侧 18×18px）── */
.mount-list { display: flex; flex-direction: column; }
.mount-item {
  display: flex; align-items: center; gap: 12px; height: 56px; padding: 0 16px;
  cursor: pointer; transition: background 120ms cubic-bezier(.2,0,.2,1);
  border-bottom: 1px solid var(--n-200);
}
.mount-item:last-child { border-bottom: none; }
.mount-item:hover { background: var(--n-50); }
.mount-item .mount-item-icon {
  flex: none; width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center;
  background: var(--n-50); color: var(--n-500);
}
.mount-item .mount-item-icon svg { width: 16px; height: 16px; stroke-width: 1.7; }
.mount-item .mount-item-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.mount-item .mount-item-name { font: 500 13px var(--sans); color: var(--n-900); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mount-item .mount-item-desc { font: 400 11px var(--sans); color: var(--n-500); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mount-item .mount-item-tags { flex: none; display: inline-flex; gap: 4px; }
.mount-item .mount-tag {
  font: 400 10px var(--sans); border-radius: 999px; padding: 1px 7px; line-height: 1.5; white-space: nowrap;
}
.mount-item .mount-tag.need-auth { background: var(--err-50); color: var(--warn-500); border: 1px solid var(--warn-500); }
.mount-item .mount-tag.local { background: var(--n-50); color: var(--ok-500); border: 1px solid var(--ok-500); }
.mount-item .mount-tag.cloud { background: var(--n-50); color: var(--info-500); border: 1px solid var(--info-500); }
.mount-item input[type="checkbox"] {
  flex: none; width: 18px; height: 18px; margin: 0; accent-color: var(--brand-500); cursor: pointer;
}
.mount-item input[type="checkbox"]:checked { animation: mount-check 120ms cubic-bezier(.2,0,.2,1); }
@keyframes mount-check { from { transform: scale(.6); } to { transform: scale(1); } }

/* ── 空状态 ── */
.mount-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 32px 16px; }
.mount-empty svg { width: 40px; height: 40px; color: var(--n-300); stroke-width: 1.5; }
.mount-empty .mount-empty-title { font: 500 13px var(--sans); color: var(--n-500); }
.mount-empty .mount-empty-sub { font: 400 11px var(--sans); color: var(--n-500); text-align: center; }

/* ── 骨架屏 ── */
.mount-skel { display: flex; flex-direction: column; }
.mount-skel-row { display: flex; align-items: center; gap: 12px; height: 56px; padding: 0 16px; }
.mount-skel-bar { height: 10px; border-radius: 5px; background: var(--n-200); animation: mount-pulse 1.4s ease-in-out infinite; }
.mount-skel-bar.icon { width: 32px; height: 32px; border-radius: 8px; flex: none; }
.mount-skel-bar.name { width: 40%; }
.mount-skel-bar.desc { width: 30%; }
@keyframes mount-pulse { 0%,100% { opacity: 1; } 50% { opacity: .4; } }

/* ── 底栏计数（48px）── */
.mount-panel-ft {
  display: flex; align-items: center; justify-content: space-between; height: 48px; padding: 0 16px;
  border-top: 1px solid var(--n-200); background: var(--n-50);
  font: 400 12px var(--sans); color: var(--n-500);
}
.mount-panel-ft .mount-ft-count { font-weight: 500; color: var(--brand-500); }
.mount-panel-ft button { font: 500 12px var(--sans); color: var(--n-500); background: transparent; border: none; cursor: pointer; }
.mount-panel-ft button:hover { color: var(--brand-500); }

/* ── 响应式 ── */
@media (max-width: 767px) {
  .mount-panel { max-width: 100%; border-radius: 12px 12px 0 0; }
}
@media (max-width: 480px) {
  .mount-tabs button { font-size: 12px; gap: 4px; }
  .mount-tabs button .mount-tab-count { display: none; }
}

/* 智能体总览页 */
.role-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.role-card { border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; background: #fff; }
.role-hd { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.role-name { font-size: 16px; font-weight: 700; color: #1e2a3a; }
.role-type { font-size: 13px; color: var(--muted); font-family: monospace; margin-top: 4px; }
.role-desc { font-size: 14px; color: #3a4a5e; line-height: 1.6; margin-top: 10px; }
.role-bind { font-size: 13px; color: #6b7a8f; margin-top: 10px; line-height: 1.6; word-break: break-all; }
.runtime-stats { display: flex; gap: 28px; margin: 14px 0; }
.runtime-stats .stat { font-size: 14px; color: #5a6b7e; display: flex; align-items: baseline; gap: 5px; }
.runtime-stats .stat b { font-size: 22px; color: #1e2a3a; }
.team-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.team-leader { font-size: 14px; font-weight: 600; color: #3a4a5e; flex: none; }
.team-members { display: flex; flex-wrap: wrap; gap: 8px; }

/* 列表页占满屏幕：不设 max-width 上限（平台控制台页另有 .pf main 覆盖，不受影响） */
main { padding: 18px 24px 36px; width: 100%; margin: 0 auto; flex: 1; min-height: 0; overflow-y: auto; }

/* ── 路由切换动效 ──────────────────────────────────────── */
.page-in { animation: pagein .28s cubic-bezier(.22, .9, .36, 1); }
@keyframes pagein { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.rv { animation: rise .34s cubic-bezier(.22, .9, .36, 1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ── 卡片 / 区块 ───────────────────────────────────────── */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: var(--shadow); margin-bottom: 18px; }
.card > .hd { display: flex; align-items: center; gap: 10px; padding: 12px 16px;
  border-bottom: 1px solid var(--line); }
.card > .hd h3 { margin: 0; font-size: 14px; font-weight: 800; letter-spacing: .03em; }
.card > .hd .hint { font-size: 12px; color: var(--muted); }
.card > .bd { padding: 14px 16px; }
.overline { font-size: 11px; font-weight: 700; letter-spacing: .18em; color: var(--muted);
  margin: 22px 0 10px; }

/* ── KPI 指标带 ────────────────────────────────────────── */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 12px 16px;
  box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s; position: relative; overflow: hidden; }
.kpi::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: var(--kc, var(--prime)); opacity: .85; }
.kpi:hover { transform: translateY(-2px); box-shadow: 0 10px 24px -10px rgba(14,27,42,.25); }
.kpi .v { font: 700 26px/1.2 var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.kpi .k { font-size: 11.5px; color: var(--muted); margin-top: 2px; }

/* ── 管道看板 ──────────────────────────────────────────── */
.pipe { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.pipe-col { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
  transition: transform .15s, box-shadow .15s; }
.pipe-col:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.pipe-col h4 { margin: 0 0 8px; font-size: 12.5px; font-weight: 800; display: flex; align-items: center; gap: 6px; }
.pipe-col h4 .idx { font: 700 10px var(--mono); color: #fff; background: var(--prime); border-radius: 4px;
  padding: 1px 5px; }
.sline { display: flex; justify-content: space-between; font-size: 12px; padding: 3px 0; color: var(--muted); }
.sline b { font-family: var(--mono); font-variant-numeric: tabular-nums; color: var(--fg); }

/* ── 表格 ──────────────────────────────────────────────── */
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th { text-align: left; font-size: 12px; font-weight: 700; letter-spacing: .08em; color: var(--muted);
  padding: 8px 10px; border-bottom: 2px solid var(--line); white-space: nowrap; }
.tbl td { padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr.data { transition: background .12s; }
.tbl tr.data:hover { background: var(--prime-soft); }
.tbl tr.data:hover .rowact { opacity: 1; }
.rowact { opacity: .35; transition: opacity .15s; white-space: nowrap; }
.mono { font-family: var(--mono); font-size: 13px; font-variant-numeric: tabular-nums; }
.num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.expandrow td { background: var(--prime-soft); border-bottom: 2px solid var(--line); padding: 14px 18px; }

/* ── 状态徽章 ──────────────────────────────────────────── */
.st { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600;
  border-radius: 999px; padding: 2px 10px; border: 1px solid transparent; white-space: nowrap; }
.st::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.st-slate  { color: #475569; background: #eef2f6; border-color: #d7e0e9; }
.st-blue   { color: #D44915; background: #FFF1EB; border-color: #FFD4BD; }
.st-teal   { color: #0f766e; background: #e4f4f2; border-color: #bfe5e0; }
.st-green  { color: #15803d; background: #e6f5ec; border-color: #c2e8d2; }
.st-amber  { color: #b45309; background: var(--amber-soft); border-color: #f2ddb4; }
.st-amber::before { animation: pulse 1.6s infinite; }
.st-red    { color: #b91c1c; background: #fdecec; border-color: #f5c6c6; }
.st-live::before { animation: pulse 1.6s infinite; }

/* ── 表单 ──────────────────────────────────────────────── */
label.f { display: block; font-size: 12.5px; font-weight: 700; color: var(--muted); margin: 0 0 6px; }
label.f .req { color: #dc2626; }
input, select, textarea { width: 100%; padding: 6px 9px; border: 1px solid var(--line); border-radius: 7px;
  font: 13.5px var(--sans); background: #fff; color: var(--fg); transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--prime);
  box-shadow: 0 0 0 3px rgba(255, 107, 53, .15); }
input[type=number] { font-family: var(--mono); }
/* 表单字段布局：浅色字段块成卡 + 固定两列节奏（单字段半宽，避免 auto-fit 撑满留白），
   标签/控件/提示三层分层清晰 */
.frow { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; }
@media (max-width: 640px) { .frow { grid-template-columns: 1fr; } }
.frow + .frow { margin-top: 10px; }
.frow > div { min-width: 0; background: #f8fafc; border: 1px solid var(--line); border-radius: 8px;
  padding: 10px 12px 11px; }
/* 控件下方提示：换行间距统一 */
.frow .muted { margin-top: 6px !important; line-height: 1.5; }

/* ── 按钮 ──────────────────────────────────────────────── */
button, .btn { font: 600 12.5px var(--sans); border: 1px solid transparent; border-radius: 7px;
  padding: 6px 13px; cursor: pointer; transition: all .14s; background: #e7ebe5; color: var(--fg); }
button:hover { filter: brightness(.97); }
button:active { transform: scale(.97); }
button:disabled { opacity: .45; cursor: not-allowed; }
.b-pri { background: var(--prime); color: #fff; } .b-pri:hover { background: var(--prime-deep); filter: none; }
.b-amb { background: var(--amber); color: #fff; } .b-amb:hover { background: #D44915; filter: none; }
.b-ghost { background: #fff; border-color: var(--line); } .b-ghost:hover { border-color: var(--prime); color: var(--prime); filter: none; }
.b-dng { background: #fff; border-color: #f0c9c9; color: #b91c1c; } .b-dng:hover { background: #fdf1f1; filter: none; }
.b-sm { padding: 3px 9px; font-size: 11.5px; border-radius: 6px; }
.b-link { background: none; border: none; color: var(--prime-deep); padding: 2px 4px; font-weight: 700; }
.b-link:hover { color: var(--prime); text-decoration: underline; filter: none; }

/* ── 折叠表单面板 ──────────────────────────────────────── */
.collapse { overflow: hidden; max-height: 0; transition: max-height .3s ease; }
.collapse.open { max-height: 2000px; }

/* ── 过滤 chips ────────────────────────────────────────── */
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.fchip { font-size: 12px; padding: 3px 12px; border-radius: 999px; border: 1px solid var(--line);
  background: #fff; cursor: pointer; transition: all .13s; color: var(--muted); }
.fchip:hover { border-color: var(--prime); color: var(--prime); }
.fchip.on { background: var(--prime); color: #fff; border-color: var(--prime); font-weight: 700; }

/* ── 对话（Agent）────────────────────────────────────── */
.chatbox { height: 440px; overflow-y: auto; padding: 14px 16px; background:
  linear-gradient(180deg, #f8fafc, #f1f5f9); border-radius: 0 0 16px 16px; }
/* 主区全宽后气泡限绝对宽度，防超宽屏拉伸 */
.msg { max-width: min(82%, 860px); margin-bottom: 12px; animation: rise .25s both; }
.msg .b { padding: 8px 12px; border-radius: 10px; font-size: 13px; white-space: pre-wrap;
  word-break: break-word; box-shadow: 0 1px 2px rgba(14,27,42,.06); }
.msg.me { margin-left: auto; } .msg.me .b { background: var(--prime); color: #fff; border-bottom-right-radius: 3px; }
.msg.ai .b { background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 3px; }
.msg .who { font-size: 10.5px; color: var(--muted); margin: 0 2px 3px; }
.tcall { font: 11px var(--mono); background: var(--prime-soft); color: var(--prime); border-radius: 6px;
  padding: 4px 8px; margin-top: 5px; display: inline-block; }
.typing::after { content: "▍"; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ── Toast ─────────────────────────────────────────────── */
.toasts { position: fixed; right: 18px; bottom: 18px; z-index: 99; display: flex;
  flex-direction: column; gap: 8px; }
.toast { background: #fff; color: var(--fg); border-radius: 10px; padding: 9px 16px; font-size: 12.5px;
  box-shadow: 0 10px 30px -8px rgba(14,27,42,.18); animation: toastin .28s cubic-bezier(.22,.9,.36,1);
  border-left: 4px solid var(--prime); max-width: 360px; }
.toast.err { border-left-color: #ef4444; }
.toast.warn { border-left-color: var(--amber); }
@keyframes toastin { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }

/* ── 单据详情模态面板 ──────────────────────────────────── */
.modal-mask { position: fixed; inset: 0; z-index: 60; background: rgba(10, 20, 32, .48);
  backdrop-filter: blur(3px); display: flex; align-items: flex-start; justify-content: center;
  padding: 4.5vh 20px 24px; overflow-y: auto; animation: maskin .18s ease; }
@keyframes maskin { from { opacity: 0; } }
.modal { width: min(900px, 100%); background: var(--card); border-radius: 16px;
  border: 1px solid var(--line); box-shadow: 0 34px 90px -22px rgba(10, 20, 32, .55);
  animation: modalin .24s cubic-bezier(.22, .9, .36, 1); overflow: hidden; }
@keyframes modalin { from { opacity: 0; transform: translateY(16px) scale(.975); } }
.modal-hd { background: var(--prime-soft); color: var(--ink);
  border-bottom: 1px solid var(--line);
  padding: 15px 22px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
/* 模态标题统一无衬线（Segoe UI + 微软雅黑），避免等宽西文配雅黑中文的混排割裂 */
.modal-hd .docno { font: 700 21px/1.2 var(--sans); letter-spacing: .01em; color: var(--ink); }
.modal-hd .sub { font-size: 13px; color: var(--muted); }
.modal-hd .x { margin-left: auto; background: rgba(255,107,53,.1); border: none; color: var(--prime);
  width: 30px; height: 30px; padding: 0; border-radius: 8px; font-size: 14px; line-height: 1;
  transition: background .16s, transform .22s; }
.modal-hd .x:hover { background: rgba(255,107,53,.2); transform: rotate(90deg); filter: none; }
.modal-bd { padding: 18px 22px 22px; max-height: 68vh; overflow-y: auto; }
.modal-ft { border-top: 1px solid var(--line); padding: 12px 22px; background: #f8fafc;
  display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
/* KV 字段布局：列宽放大 + 每字段独立白色卡片，字段名/值/注释纵向分层，不再裹挟 */
.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px 12px;
  background: #f8fafc; border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
.kv > div { display: flex; flex-direction: column; gap: 3px; min-width: 0;
  background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px 10px; }
.kv .k { font-size: 12px; letter-spacing: .1em; color: var(--muted); font-weight: 700; }
.kv .v { font-size: 14.5px; font-weight: 600; word-break: break-all; }
/* 模态正文内的浅色注释/提示（含应用行内 11px 注释）统一放大 */
.modal-bd .muted { font-size: 12.5px !important; }
/* 值后注释：强制独占一行（覆盖行内 margin-left），与值明确分层 */
.kv .v .muted { display: block; margin: 2px 0 0 !important; line-height: 1.5; }
.kv .v.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.modal .sec { font-size: 12.5px; font-weight: 700; letter-spacing: .16em; color: var(--muted);
  margin: 18px 0 8px; }
.modal details.raw > summary { cursor: pointer; font-size: 13px; color: var(--muted);
  margin-top: 16px; user-select: none; }
.modal details.raw > summary:hover { color: var(--prime); }
.loadbox { text-align: center; padding: 42px 0; color: var(--muted); font-size: 13px; }
.loadbox .spin { font-size: 20px; display: inline-block; margin-bottom: 8px; color: var(--prime); }
/* 宽表格横向滚动（列表 + 模态通用；右栏 Agent 常驻后，表体须在自己的容器内横向滚动，勿溢出覆盖右栏） */
.scroll-x { overflow-x: auto; }
.tbl.tight th, .tbl.tight td { padding: 6px 10px; font-size: 13px; }
.chipline { display: flex; gap: 6px; flex-wrap: wrap; }
.chipline .chip { margin: 0; }
.badge-grade { display: inline-block; min-width: 24px; text-align: center; background: #FFF1EB;
  color: #D44915; border: 1px solid #FFD4BD; border-radius: 6px; padding: 1px 7px;
  font: 700 11.5px var(--mono); }

/* ── 杂项 ──────────────────────────────────────────────── */
.muted { color: var(--muted); }
.mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mb0 { margin-bottom: 0; }
.right { margin-left: auto; }
pre.json { background: #f1f5f9; color: var(--ink); border-radius: 10px; padding: 12px 14px; font: 12.5px/1.7 var(--mono);
  overflow: auto; max-height: 300px; white-space: pre-wrap; word-break: break-all; }
.empty { text-align: center; color: var(--muted); padding: 26px 0 !important; font-size: 12.5px; }
.spin { display: inline-block; animation: rot 1s linear infinite; }
@keyframes rot { to { transform: rotate(360deg); } }
hr.sep { border: none; border-top: 1px dashed var(--line); margin: 12px 0; }
.tagline { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ════════════════════════════════════════════════════════════
   平台渲染页组件层（base.html 族模板；body 带 .pf 类）
   裸元素与会话类样式均 .pf 作用域，不波及 view/ SPA。
   ════════════════════════════════════════════════════════════ */

/* ── 画布底纹：简洁浅色 ── */
.pf {
  display: block;   /* 覆盖 SPA 的 body{display:flex}（侧栏横向布局）——平台页是顶栏 + 纵向堆叠 */
  height: auto; overflow: visible;   /* 覆盖 SPA 的 body{height:100vh;overflow:hidden}——平台页随内容自然滚动 */
  margin: 0; color: var(--fg); font: 14px/1.65 var(--sans); min-height: 100vh;
  background: var(--canvas);
}
.pf ::selection { background: rgba(255,107,53,.18); }

/* ── 控制台顶栏（workbuddy 浅色）── */
.ptop { position: sticky; top: 0; z-index: 100; color: var(--fg);
  background: #fff;
  border-bottom: 1px solid var(--line);
  padding: 15px 28px 13px; box-shadow: 0 1px 3px rgba(0,0,0,.04); }
.ptop .inner { max-width: 1280px; margin: 0 auto; display: flex; align-items: baseline;
  gap: 14px; flex-wrap: wrap; }
.ptop .logo { font-size: 21px; font-weight: 900; letter-spacing: .01em; color: var(--ink); }
.ptop .logo em { font-style: normal; color: var(--prime); padding: 0 3px; }
.ptop .ver { font: 600 10px var(--mono); letter-spacing: .16em; color: var(--muted);
  border: 1px solid var(--line); padding: 1px 7px; border-radius: 4px; }
.ptop .tag { color: var(--muted); font-size: 12px; letter-spacing: .06em; }
.ptop nav { margin-left: auto; display: flex; gap: 4px; }
.ptop nav a { color: var(--muted); font-size: 13px; padding: 5px 13px; border-radius: 6px;
  transition: color .16s var(--ease), background .16s var(--ease); }
.ptop nav a:hover { color: var(--prime); background: var(--prime-soft); }
.ptop nav a.on { color: var(--prime); background: var(--prime-soft); font-weight: 700; }
.pf main { max-width: 1280px; margin: 0 auto; padding: 22px 28px 70px; }
.pf main:has(> .login-wrap) { padding: 0 0 44px; }  /* 登录页自带居中边距，main 不再叠加 */
.pf .crumb-line { margin: 0 0 16px; font-size: 12.5px; }
.pf .crumb-line a { color: var(--prime); font-weight: 600; }
.pf .crumb-line a:hover { color: var(--amber); }

/* ── 章节标题（琥珀刻线 + 800 字重）── */
.pf .section-title { display: flex; align-items: center; gap: 9px; margin: 28px 0 12px;
  font-size: 12.5px; font-weight: 800; letter-spacing: .14em; color: var(--ink); }
.pf .section-title::before { content: ""; width: 4px; height: 15px; border-radius: 1px;
  background: var(--prime); }

/* ── 裸元素（仅 .pf，作用域限定在平台页「正文内容」，须排除全局共享的 Agent 右栏）──
   背景：Agent 右栏（.agent-rail）是平台级共享组件，既出现在组 SPA 也出现在平台页
   （index.html 把它嵌在 <main> 内）。若这些裸元素规则命中右栏内的 button/input 等，
   会与右栏自身样式同特异性并因位置靠后而胜出，使平台页右栏与组 SPA（如 meal）里的
   右栏观感不一致。故统一以 :not(.agent-rail *) 排除右栏子树。 */
.pf a:not(.agent-rail *) { color: var(--prime-deep); transition: color .15s; }
.pf a:not(.agent-rail *):hover { color: var(--prime); }
.pf label:not(.agent-rail *) { display: block; margin: 10px 0 3px; font-size: 11.5px; font-weight: 700;
  letter-spacing: .05em; color: var(--muted); }
.pf input:not(.agent-rail *), .pf select:not(.agent-rail *), .pf textarea:not(.agent-rail *) {
  width: 100%; box-sizing: border-box; padding: 7px 10px;
  border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--fg);
  font: 13.5px var(--sans); transition: border-color .15s, box-shadow .15s; }
.pf input:not(.agent-rail *):focus, .pf select:not(.agent-rail *):focus, .pf textarea:not(.agent-rail *):focus {
  outline: none; border-color: var(--prime); box-shadow: 0 0 0 3px rgba(255,107,53,.15); }
.pf button:not(.agent-rail *) { background: var(--prime); color: #fff; border: 0; border-radius: 6px;
  padding: 8px 17px; margin-top: 10px; font: 600 13px var(--sans); cursor: pointer;
  transition: background .16s var(--ease), transform .1s var(--ease); }
.pf button:not(.agent-rail *):hover { background: var(--prime-deep); }
.pf button:not(.agent-rail *):active { transform: scale(.97); }
.pf button.ghost { background: #e7ebe6; color: var(--ink); }
.pf button.ghost:hover { background: #dce2db; }
.pf button.danger, .pf .btn-danger { background: #fff; color: #b91c1c; border: 1px solid #f1c8c4; }
.pf button.danger:hover, .pf .btn-danger:hover { background: #fdf3f2; }
.pf code { background: #f1f5f9; padding: 1px 5px; border-radius: 4px; font-size: 12px;
  font-family: var(--mono); }
.pf pre { background: #f1f5f9; color: var(--ink); padding: 12px 14px; border-radius: 8px;
  overflow: auto; font: 12px/1.6 var(--mono); white-space: pre-wrap; word-break: break-all; }
.pf .req { color: #dc2626; }
.pf div.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 0 16px; }
/* 注意：users.html 的表格行用 <tr class="row">，绝不能命中网格规则，否则表格行被压成 grid 错乱 */
.pf .inline { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pf .inline button, .pf .inline .btn-mini { margin-top: 0; }  /* 行内表单按钮不与输入错位 */
.pf .inline select { width: auto; flex: 1 1 150px; }          /* 行内下拉弹性伸缩，按钮不被挤到换行 */
.pf .checks label { display: inline-flex; align-items: center; gap: 5px; margin: 2px 12px 2px 0;
  font-size: 13px; font-weight: 400; letter-spacing: 0; color: var(--fg); }
.pf .checks input { width: auto; }

/* ── 提示条 ── */
.pf .flash { padding: 9px 14px; border: 1px solid; border-radius: 8px; margin-bottom: 12px;
  font-size: 13px; animation: flashin .28s var(--ease); }
.pf .flash.ok { background: #ecf5f0; color: #115e4f; border-color: #c2ded3; }
.pf .flash.error { background: #fdf0ee; color: #991b1b; border-color: #f2cbc7; }
@keyframes flashin { from { opacity: 0; transform: translateY(-6px); } }

/* ── 平台卡片容器 ──
   共享 .card（SPA 规则）无内边距（SPA 用 .hd/.bd 子结构）；平台页直接当容器用，
   必须补 padding，否则内容贴边。 */
.pf .card { padding: 16px 18px; }
.pf .card h3 { margin: 0 0 6px; font-size: 15.5px; font-weight: 800; letter-spacing: .02em; }
.pf .card h3 .muted { font-weight: 400; }

/* ── 网格与磁贴（首页 / 组页）── */
.group-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.group-card { display: block; margin: 0; color: var(--fg);
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), border-color .18s var(--ease); }
.group-card:hover { border-color: var(--prime); transform: translateY(-2px);
  box-shadow: 0 10px 26px -8px rgba(14,27,42,.22); color: var(--fg); }
.pf .chip { display: inline-block; margin: 2px 4px 2px 0; padding: 2px 9px;
  border: 1px solid #dde3eb; border-radius: 5px; background: #f1f5f9; color: #33414f;
  font: 500 11.5px var(--mono); transition: border-color .15s, color .15s; }
.group-card:hover .chip { border-color: rgba(255,107,53,.45); color: var(--prime-deep); }
.group-card .wl-chips { min-height: 30px; }
.group-card .enter-btn {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 14px; padding: 8px 16px;
  background: var(--prime); color: #fff; border-radius: 7px;
  font: 600 13px var(--sans); text-decoration: none;
  transition: background .16s var(--ease), transform .1s var(--ease);
}
.group-card .enter-btn:hover { background: var(--prime-deep); color: #fff; transform: translateX(2px); }

/* ── 登录页：品牌墙 + 登录卡（workbuddy 浅色）── */
.login-wrap { box-sizing: border-box; max-width: 1060px; min-height: calc(100vh - 64px);
  margin: 0 auto; padding: 52px 28px; display: grid;
  grid-template-columns: 1.12fr .88fr; gap: 30px; align-items: center; }
.brand-wall { position: relative; overflow: hidden; border-radius: 16px; padding: 46px 42px;
  color: var(--fg); background: linear-gradient(158deg, #FFF1EB, #f8fafc 52%, #f1f5f9);
  border: 1px solid var(--line);
  box-shadow: 0 20px 50px -12px rgba(30,41,59,.12); }
.brand-wall::before { content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(rgba(255,107,53,.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,107,53,.06) 1px, transparent 1px);
  background-size: 26px 26px; }
.brand-wall::after { content: ""; position: absolute; top: -150px; right: -150px;
  width: 440px; height: 440px; pointer-events: none;
  background: radial-gradient(circle, rgba(255,107,53,.15), transparent 64%); }
.bw-logo { font-size: 58px; font-weight: 900; line-height: 1; color: var(--ink); }
.bw-logo em { font-style: normal; color: var(--prime); }
.bw-sub { margin-top: 12px; font: 600 11px var(--mono); letter-spacing: .36em;
  color: var(--muted); }
.bw-desc { margin-top: 24px; max-width: 33em; font-size: 13.5px; line-height: 1.95;
  color: var(--ink-2); }
.bw-stats { position: relative; margin-top: 32px; display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.bw-stat { padding: 11px 14px; border: 1px solid var(--line); border-radius: 10px;
  background: rgba(255,255,255,.7); }
.bw-stat .n { font: 700 21px var(--mono); color: var(--ink); font-variant-numeric: tabular-nums; }
.bw-stat .l { margin-top: 2px; font-size: 10.5px; letter-spacing: .16em;
  color: var(--muted); }
.bw-live { margin-top: 28px; display: flex; align-items: center; gap: 9px;
  font: 500 12px var(--mono); color: var(--ink-2); }
.dot-live { width: 8px; height: 8px; border-radius: 50%; background: #34d399;
  box-shadow: 0 0 0 0 rgba(52,211,153,.6); animation: dotpulse 2.2s infinite; }
@keyframes dotpulse {
  70% { box-shadow: 0 0 0 9px rgba(52,211,153,0); }
  100% { box-shadow: 0 0 0 0 rgba(52,211,153,0); }
}
.pf .login-card { margin: 0; padding: 26px 28px; }  /* .pf 前缀确保盖过 .pf .card 的通用内边距 */
.pf .login-card h3 { margin: 0 0 4px; font-size: 17px; font-weight: 800; }
@media (max-width: 880px) {
  .login-wrap { grid-template-columns: 1fr; padding: 26px 16px; }
  .bw-logo { font-size: 42px; }
}

/* 协议勾选行（登录卡内）*/
.pf .login-agree { display: flex; align-items: flex-start; gap: 8px; margin: 14px 0 2px;
  font-size: 12.5px; font-weight: 400; letter-spacing: normal; color: var(--muted); line-height: 1.6; }
.pf .login-agree input[type="checkbox"] { width: auto; margin: 2px 0 0; flex: none;
  accent-color: var(--prime); cursor: pointer; }
.pf .login-agree a { color: var(--prime-deep); }
.pf .login-agree a:hover { color: var(--prime); }

/* 移动端专用品牌 Logo（桌面端隐藏，改由左侧品牌墙承担）*/
.login-brand-mobile { display: none; align-items: center; justify-content: center; gap: 12px;
  margin: 2px 0 20px; }
.login-brand-mobile .lbm-ic { width: 56px; height: 56px; color: var(--prime); flex: none; }
.login-brand-mobile .lbm-ic svg { width: 100%; height: 100%; display: block; }
.login-brand-mobile .lbm-name { font: 900 30px/1 var(--sans); color: var(--ink); letter-spacing: -.01em; }
.login-brand-mobile .lbm-name em { font-style: normal; color: var(--prime); }

/* ── 移动端登录：移除左侧品牌墙，仅留登录卡；品牌以「大 Logo」置于输入区上方 ── */
@media (max-width: 768px) {
  .login-wrap { grid-template-columns: 1fr; padding: 18px 16px 30px; min-height: 0; }
  .brand-wall { display: none; }
  .login-brand-mobile { display: flex; }
  .pf .login-card { padding: 22px 18px; }
}
@media (max-width: 380px) {
  .login-brand-mobile { gap: 9px; margin-bottom: 16px; }
  .login-brand-mobile .lbm-ic { width: 46px; height: 46px; }
  .login-brand-mobile .lbm-name { font-size: 23px; }
}

/* ── 法务长文页（服务协议 / 隐私政策）── */
.legal { max-width: 820px; margin: 0 auto; padding: 8px 0 44px; line-height: 1.9;
  font-size: 14px; color: var(--ink-2); }
.legal h1 { font-size: 24px; font-weight: 800; color: var(--ink); margin: 0 0 6px; }
.legal h2 { font-size: 15.5px; font-weight: 700; color: var(--ink); margin: 26px 0 8px; }
.legal p { margin: 8px 0; }
.legal-meta { color: var(--muted); font-size: 12.5px; }
.legal-back { margin-top: 30px; }
.legal-back a { color: var(--prime-deep); }

/* ── 「退出」入口（平台顶栏 .ui-logout + 组 SPA 侧栏 .rail-logout）──
   背景：UI 改版后 .pf 页顶栏只剩头像（且管理员头像指向用户权限），组 SPA 的
   退出又被 `.rail-user a { display:none }` 隐藏 ⇒ 登录后无处可退。此处补回显式入口。 */
.ui-logout { display: inline-flex; align-items: center; padding: 5px 12px; border-radius: 999px;
  border: 1px solid var(--border); background: #fff; color: var(--text-2); font-size: 12.5px;
  text-decoration: none; line-height: 1.2; transition: color .15s, border-color .15s; }
.ui-logout:hover { color: var(--brand-text); border-color: var(--brand); }
.rail-logout { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px;
  margin: 8px auto 0; border-radius: 10px; color: #A9B4C2; text-decoration: none;
  transition: background .15s, color .15s; }
.rail-logout:hover { background: rgba(255,107,53,.14); color: var(--prime); }
.rail-logout svg { width: 20px; height: 20px; display: block; }

/* ── 导航内页统一版式（对齐首页标题规范）────────────────────────────
   首页以 .home-sec-title/.ui-sec-head 作标题；内页此前风格不一（有的 .wrap>h1、
   有的面包屑 + .section-title）。统一为：面包屑 .crumb-line + <h1> + 副标题 .muted。 */
.pf main h1 { font-size: 21px; font-weight: 700; letter-spacing: .2px; color: var(--text-1);
  margin: 6px 0 4px; }
.pf main h1 + .muted { margin: 2px 0 16px; }
.pf .wrap { max-width: 1180px; margin: 0 auto; }

/* ── Agent 右栏 · ✨ 优化提示词 ── */
.agent-rail-toolbtn.opt-on { border-color: var(--brand-500); color: var(--brand-500); background: var(--brand-50); }
.agent-rail-toolbtn.opt-mode { font-size: 11px; padding: 4px 7px; color: var(--n-500); }
.opt-diff { margin-top: 6px; border: 1px solid var(--line); border-radius: 10px; background: #fff; overflow: hidden; }
.opt-diff-hd { display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 6px 10px; font-size: 12px; color: var(--ink-2); cursor: pointer; background: #f7f9fc; }
.opt-diff-hd:hover { background: #f1f5f9; }
.opt-diff-bd { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); }
.opt-diff-bd > div { padding: 8px 10px; min-width: 0; }
.opt-diff-bd > div + div { border-left: 1px solid var(--line); }
.opt-diff-bd b { display: block; font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.opt-diff-bd pre { margin: 0; font: 12px/1.5 var(--sans); white-space: pre-wrap; word-break: break-word;
  max-height: 160px; overflow: auto; color: var(--fg); }
@media (max-width: 520px) {
  .opt-diff-bd { grid-template-columns: 1fr; }
  .opt-diff-bd > div + div { border-left: 0; border-top: 1px solid var(--line); }
}

/* ── 服务调用卡（应用详情）── */
.svc { margin-bottom: 12px; padding: 14px 18px; border: 1px solid var(--line);
  border-radius: 10px; background: var(--card); transition: border-color .18s; }
.svc:hover { border-color: var(--prime); }
.svc .name { font: 700 13.5px var(--mono); color: var(--ink); }

/* ── 表格增强（列排序；与 SPA .tbl 共享）──
   由平台 watchSortableTables() 自动装饰（view/lib/shell.js）：
   可解析列 → th[data-sort] + .arr 指示器；点击三态 升→降→默认序 */
/* ── 自定义显示列控件（平台注入，per-user 持久化；并入工具栏右侧）── */
.colctl { position: relative; display: inline-flex; }
.colctl-btn { display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 6px; border: 1px solid var(--line);
  background: #fff; color: var(--muted); cursor: pointer; padding: 0; }
.colctl-btn:hover { color: var(--prime); border-color: var(--prime); }
.colctl-pop { display: none; position: absolute; right: 0; top: 30px; z-index: 40; min-width: 170px;
  max-height: 300px; overflow-y: auto; background: #fff; border: 1px solid var(--line);
  border-radius: 9px; box-shadow: 0 12px 32px -8px rgba(10,20,32,.25); padding: 8px; }
.colctl-pop.open { display: block; }
.colctl-item { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--fg);
  padding: 4px 6px; border-radius: 6px; cursor: pointer; white-space: nowrap; }
.colctl-item:hover { background: var(--prime-soft); }
.colctl-item input { width: auto; }
.tbl th[data-sort] { cursor: pointer; user-select: none; }
.tbl th[data-sort]:hover { color: var(--ink); }
.tbl th .arr { font-size: 10px; color: var(--prime); margin-left: 3px; opacity: .4; }
.tbl th[data-sort]:hover .arr { opacity: .9; }
.tbl th[data-sort].sorted { color: var(--ink); }
.tbl th[data-sort].sorted .arr { opacity: 1; }
.num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* ── README 渲染主题 ── */
.readme { font-size: 13.5px; line-height: 1.75; }
.readme h1 { font-size: 19px; margin: 6px 0; }
.readme h2 { font-size: 15.5px; margin: 18px 0 6px; padding-bottom: 3px; border-bottom: 1px solid var(--line); }
.readme h3 { font-size: 14px; margin: 12px 0 2px; }
.readme table { border-collapse: collapse; margin: 8px 0; font-size: 12.5px; }
.readme th, .readme td { border: 1px solid var(--line); padding: 4px 9px; text-align: left; vertical-align: top; }
.readme th { background: #f1f5f9; }
.readme code { background: #f1f5f9; padding: 1px 4px; border-radius: 4px; font-size: 12px; font-family: var(--mono); }
.readme pre { background: #f1f5f9; color: var(--ink); padding: 10px 12px; border-radius: 6px; overflow: auto; }
.readme blockquote { margin: 8px 0; padding: 2px 12px; border-left: 3px solid var(--prime);
  background: var(--prime-soft); color: var(--muted); }
.readme-pre { padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--card);
  color: var(--fg); font: 12px/1.6 var(--mono); white-space: pre-wrap; word-break: break-word; }

/* ── 会话组件（平台渲染页用；SPA 有自有聊天样式，故 .pf 作用域）── */
.pf .msg { margin-bottom: 10px; }
.pf .msg .who { font: 500 10.5px var(--mono); letter-spacing: .1em; color: var(--muted); }
.pf .bubble { display: inline-block; max-width: 100%; padding: 7px 11px; border-radius: 9px;
  font-size: 13px; line-height: 1.65; white-space: pre-wrap; word-break: break-word; }
.pf .msg.user .bubble { background: var(--prime-soft); border: 1px solid #c7ded4; }
.pf .msg.bot .bubble { background: #fff; border: 1px solid var(--line); }
.pf .tools-log { margin-top: 4px; font: 11px var(--mono); color: var(--muted); }
.pf .chat-input { display: flex; gap: 8px; margin-top: 10px; }
.pf .chat-input input { flex: 1; margin: 0; }
.pf .chat-input button { margin: 0; }
.pf #chat { border: 1px solid var(--line); border-radius: 8px; padding: 12px; height: 300px;
  overflow: auto; background: #f8fafc; }

/* ── 滚动渐显（base.html 的 IntersectionObserver 补 .in）── */
.reveal { opacity: 0; transform: translateY(12px);
  transition: opacity .45s var(--ease), transform .45s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* 兜底可达清单（亮色） */
.wiring-list { margin-top: 4px; }
.wiring-search { width: 100%; max-width: 360px; margin-bottom: 14px; }
.wl-group { margin-bottom: 14px; }
.wl-group > b { font-size: 12px; }
.wl-chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 7px; }
.wl-chips a.chip { text-decoration: none; }
.wl-chips a.chip:hover { border-color: var(--prime); color: var(--prime-deep); background: var(--prime-soft); }
details.scan-detail > summary { cursor: pointer; color: var(--prime); font-size: 13px;
  margin: 18px 0 8px; user-select: none; font-weight: 700; }

/* ── 首页：内容居中在 1280 可读列 ── */
.pf.home-bleed main { max-width: none; padding-left: 0; padding-right: 380px; padding-top: 0; }
.pf.home-bleed .col { max-width: 1280px; margin: 0 auto; padding: 0 28px; }
/* 首页右侧常驻 Agent 栏：顶栏整体让位（宽度减 380px），背景不再占满右侧 */
.pf.home-bleed .ptop { margin-right: 380px; }

/* ── 清单芯片：视图(主) + 详情 拼接双入口 ── */
.wl-chip { display: inline-flex; align-items: stretch; vertical-align: top; }
.wl-chip .chip { margin: 0; border-top-right-radius: 0; border-bottom-right-radius: 0; }
.wl-chip .chip-det { display: inline-flex; align-items: center; padding: 2px 9px;
  font: 600 10.5px var(--sans); color: var(--muted); text-decoration: none;
  background: #f1f5f9; border: 1px solid var(--line); border-left: 0;
  border-radius: 0 5px 5px 0; transition: color .15s, background .15s, border-color .15s; }
.wl-chip .chip-det:hover { color: var(--prime-deep); background: var(--prime-soft); border-color: var(--prime); }

/* ── 流程编排：拖拽画布 ─────────────────────────────────── */
.b-ghost.on { border-color: var(--prime); color: var(--prime); background: var(--prime-soft); }
.flow-canvas { position: relative; margin-top: 8px; height: 560px; overflow: auto;
  border: 1px solid var(--line); border-radius: 10px; background-color: #f8fafc;
  background-image: radial-gradient(circle, #cbd5e1 1px, transparent 1px);
  background-size: 20px 20px; }
.fc-content { position: relative; width: 2000px; height: 1600px; }
.fc-edges { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.fc-edges path { fill: none; stroke: #8a94a6; stroke-width: 2; pointer-events: stroke; cursor: pointer; }
.fc-edges path.on { stroke: var(--amber); stroke-width: 3; }
.fc-edges path.fc-pending { stroke: var(--prime); stroke-dasharray: 5 4; pointer-events: none; }
.fc-node { position: absolute; width: 200px; min-height: 60px; background: #fff;
  border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 1px 3px rgba(14,27,42,.06);
  display: flex; align-items: center; cursor: move; user-select: none; }
.fc-node.sel { border-color: var(--prime); box-shadow: 0 0 0 2px var(--prime-soft); }
.fc-node-body { flex: 1; padding: 8px 10px; min-width: 0; }
.fc-role { font-size: 13px; font-weight: 700; color: var(--prime); }
.fc-id { font-size: 11px; font-family: var(--mono); color: var(--muted); margin-top: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fc-port { width: 12px; height: 12px; border-radius: 50%; background: #fff;
  border: 2px solid var(--prime); flex: none; }
.fc-port.in { margin-left: -7px; }
.fc-port.out { margin-right: -7px; cursor: crosshair; }
.fc-hint { position: absolute; left: 50%; top: 16px; transform: translateX(-50%);
  color: var(--muted); font-size: 12px; white-space: nowrap; }
.fc-sidebar { margin-top: 12px; border: 1px solid var(--line); border-radius: 10px;
  padding: 12px; background: #fff; }

/* ═══════════════════════════════════════════════════════════════════
   修复：能力挂载面板不撑破右栏宽度（长名/长描述走省略号）  方案 A + D
   背景：.mount-panel 原 max-width:560px ＞ 右栏 400px，且父链缺 min-width:0，
        面板被长文本 min-content 撑宽 → 顶宽右栏 → 页面左移。
   解决：宽度硬限制在右栏内 + 截断父链可收缩，令既有 ellipsis 生效；D 由模板补
        :title 提供全名悬浮提示。
   ═══════════════════════════════════════════════════════════════════ */
aside.agent-rail { min-width: 0; }
.agent-rail-input, .agent-rail-input-card { min-width: 0; }
.mount-panel { max-width: 100%; min-width: 0; }
.mount-panel-body { overflow-x: hidden; }
.mount-list, .mount-item { min-width: 0; }
.mount-item-name, .mount-item-desc { max-width: 100%; }

/* ═══════════════════════════════════════════════════════════════════
   右栏防溢出基线（长效）：固定宽容器内，flex 子项可收缩、成排控件可换行、
   长文本可截断——新增控件自动受益，不再逐个救火。
   ═══════════════════════════════════════════════════════════════════ */
.agent-rail-inner, .agent-rail-body,
.agent-rail-input, .agent-rail-input-card { min-width: 0; }

/* 输入框底部那排控件：满了就换行，绝不撑宽右栏 */
.agent-rail-input-bar { flex-wrap: wrap; min-width: 0; }

/* 已挂载 chip：可收缩 + 超长省略号（文字截断、× 保留；title 已提供全名） */
.mount-chip { flex: 0 1 auto; min-width: 0; max-width: 100%; }
.mount-chip > span:first-child {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* 右栏兜底：任意长串（ID/URL 等）可断行 */
.agent-rail-inner { overflow-wrap: anywhere; }

/* ── 平台通用工具类（约定：截断 / 断行，新 UI 直接复用）─────────────
   .truncate       单行省略号（需父容器可收缩，常配 min-width:0）
   .wrap-anywhere  任意长串强制断行（不改变换行语义以外的布局） */
.truncate { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wrap-anywhere { overflow-wrap: anywhere; word-break: break-word; }

/* ── Agent 右栏 · 语音输入（仅移动端入口展示）─────────────────────────
   移动端页面 body 带 .mbody（见 fde_platform/templates/mobile.html），借此把
   「语音」按钮限制在移动端；PC 右栏不出现，避免改动桌面 UI。 */
.agent-rail-voice { display: none; }
.mbody .agent-rail-voice { display: inline-flex; }
.mbody .agent-rail-voice.voice-on {
  border-color: var(--prime); color: var(--prime); background: rgba(255,107,53,.12);
  animation: voice-pulse 1.1s ease-in-out infinite;
}
@keyframes voice-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }

/* ── Agent 右栏 · 全屏双栏（左导航+会话列表 / 右消息+输入）───────────────
   仅当 aside.agent-rail.is-expanded 时生效；非全屏沿用上方单列纵向布局。
   .agent-rail-main 包裹原有「头部/会话选择/消息/文件/输入」，非全屏时即原布局。 */
.agent-rail-main { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; gap: 6px; }

.agent-rail.is-expanded .agent-rail-inner { padding: 0; gap: 0; }
.agent-rail.is-expanded .agent-rail-body { flex-direction: row; gap: 0; }
.agent-rail.is-expanded .agent-rail-main { padding: 10px 16px; }

/* 左侧栏本体（模板 x-show="expanded" 控制显隐，非全屏不渲染） */
.agent-rail-side {
  display: flex; flex-direction: column; width: 264px; flex: none;
  padding: 12px 10px; gap: 8px; background: #F7F9FC; border-right: 1px solid #dde3eb;
  min-height: 0; overflow-y: auto;
}

/* 新建任务 */
.agent-rail-side .ars-new { display: flex; align-items: center; gap: 8px; width: 100%;
  border: 1px solid var(--prime); background: var(--prime); color: #fff; border-radius: 10px;
  padding: 9px 12px; font: 600 13px var(--sans); cursor: pointer; transition: background .14s; }
.agent-rail-side .ars-new:hover { background: var(--prime-deep); }
.agent-rail-side .ars-new svg { width: 15px; height: 15px; flex: none; }

/* 功能导航 */
.agent-rail-side .ars-nav { display: flex; flex-direction: column; gap: 2px; }
.agent-rail-side .ars-nav-item { display: flex; align-items: center; gap: 8px; width: 100%;
  border: none; background: transparent; color: #3a4a5e; border-radius: 8px; padding: 8px 10px;
  font: 13px var(--sans); text-align: left; cursor: pointer; }
.agent-rail-side .ars-nav-item:hover { background: #fff; color: var(--prime); }
.agent-rail-side .ars-nav-item svg { width: 15px; height: 15px; flex: none; opacity: .85; }

/* 任务（会话）列表 */
.agent-rail-side .ars-tasks { margin-top: 4px; display: flex; flex-direction: column; gap: 2px; min-height: 0; }
.agent-rail-side .ars-tasks-hd { font-size: 11px; color: #8896a8; padding: 4px 10px 2px; letter-spacing: .04em; }
.agent-rail-side .ars-task { display: flex; align-items: center; gap: 8px; width: 100%; border: none;
  background: transparent; color: #3a4a5e; border-radius: 8px; padding: 7px 10px;
  font: 12.5px var(--sans); text-align: left; cursor: pointer; }
.agent-rail-side .ars-task:hover { background: #fff; }
.agent-rail-side .ars-task.active { background: #fff; color: var(--prime); font-weight: 600;
  box-shadow: 0 1px 2px rgba(0,0,0,.05); }
.agent-rail-side .ars-task-t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 会话气泡：运行中旋转 */
.agent-rail-side .ars-bubble { width: 16px; height: 16px; flex: none; border-radius: 50%;
  display: grid; place-items: center; background: #e7edf5; color: #5a6b7e; }
.agent-rail-side .ars-bubble svg { width: 11px; height: 11px; }
.agent-rail-side .ars-bubble.running { background: var(--prime); color: #fff;
  animation: ars-spin 1s linear infinite; }
@keyframes ars-spin { from { transform: rotate(0); } to { transform: rotate(360deg); } }
/* 查看更多 */
.agent-rail-side .ars-more { border: none; background: transparent; color: var(--prime);
  font-size: 12px; padding: 4px 10px; cursor: pointer; text-align: left; }
.agent-rail-side .ars-more:hover { text-decoration: underline; }

/* 底部账号 / 配置 */
.agent-rail-side .ars-foot { margin-top: auto; display: flex; align-items: center; gap: 8px;
  padding: 8px 8px 2px; border-top: 1px solid #e3e9f1; font-size: 12px; color: #5a6b7e; }
.agent-rail-side .ars-user-ava { width: 22px; height: 22px; border-radius: 50%; background: var(--prime);
  color: #fff; display: grid; place-items: center; font-size: 11px; font-weight: 700; flex: none; }
.agent-rail-side .ars-user-name { flex: 1; min-width: 0; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.agent-rail-side .ars-foot-link { color: #8896a8; text-decoration: none; }
.agent-rail-side .ars-foot-link:hover { color: var(--prime); }

/* 全屏：对话（消息记录）区底色略深，增强与左侧栏的层次对比 */
.agent-rail.is-expanded .chatbox.agent-rail-chat {
  background: #E9EDF4; border-radius: 10px; padding: 8px 10px 10px;
}

/* 新建任务/空会话：在对话框上方的空白区居中展示系统 Logo（放大）+ 品牌名 */
.agent-rail .agent-rail-empty { display: flex; flex-direction: column; align-items: center;
  justify-content: center; min-height: 100%; padding: 28px 12px !important; }
.agent-rail .agent-rail-empty-logo { width: 88px; height: 88px; color: var(--prime); margin-bottom: 10px;
  filter: drop-shadow(0 8px 20px rgba(255,107,53,.18)); }
.agent-rail .agent-rail-empty-logo svg { width: 100%; height: 100%; display: block; }
.agent-rail .agent-rail-empty-brand { font: 700 12px var(--sans); letter-spacing: .18em;
  color: #8896a8; margin-bottom: 14px; text-transform: uppercase; }

/* 全屏左栏：任务列表独立滚动（展开「查看更多」也不与底部账号信息重叠）；
   侧栏本体不再整体滚动，滚动条仅在鼠标悬停任务列时出现（业界常见做法）。 */
.agent-rail-side { overflow: hidden; }
.agent-rail-side .ars-tasks { flex: 1 1 auto; min-height: 0; overflow-y: auto;
  scrollbar-width: thin; scrollbar-color: transparent transparent; }
.agent-rail-side .ars-tasks:hover { scrollbar-color: #c3ccd8 transparent; }
.agent-rail-side .ars-tasks::-webkit-scrollbar { width: 8px; }
.agent-rail-side .ars-tasks::-webkit-scrollbar-track { background: transparent; }
.agent-rail-side .ars-tasks::-webkit-scrollbar-thumb { background: transparent; border-radius: 4px; }
.agent-rail-side .ars-tasks:hover::-webkit-scrollbar-thumb { background: #c3ccd8; }
.agent-rail-side .ars-foot { margin-top: 0; flex: none; }

/* ── Agent 全屏右侧栏：交付件（可关闭；实时列出阶段产出 + 产物文件）──
   全屏态 body 由「左导航 | 会话」扩为三栏：左导航 | 会话 | 交付件。 */
.agent-rail.is-expanded .agent-rail-artifacts {
  display: flex; flex-direction: column; width: 300px; flex: none; min-height: 0;
  border-left: 1px solid #dde3eb; background: #FBFCFE;
}
.agent-rail-artifacts .ara-hd { display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; border-bottom: 1px solid #e6ebf2; }
.agent-rail-artifacts .ara-title { flex: 1; font-weight: 700; font-size: 13px; color: #1e2a3a; }
.agent-rail-artifacts .ara-close { border: none; background: transparent; color: #8896a8;
  cursor: pointer; font-size: 13px; line-height: 1; padding: 2px 6px; border-radius: 6px; }
.agent-rail-artifacts .ara-close:hover { background: #eef2f7; color: var(--prime); }
.agent-rail-artifacts .ara-body { flex: 1; min-height: 0; overflow-y: auto;
  padding: 8px 10px 14px; scrollbar-width: thin; }
.agent-rail-artifacts .ara-run { display: flex; align-items: center; gap: 6px; font-size: 11.5px;
  color: #5a6b7e; background: #fff; border: 1px solid #e6ebf2; border-radius: 8px;
  padding: 6px 8px; margin-bottom: 8px; }
.agent-rail-artifacts .ara-run-dot { width: 7px; height: 7px; border-radius: 50%;
  background: #94a3b8; flex: none; }
.agent-rail-artifacts .ara-run.running .ara-run-dot { background: var(--prime);
  animation: ars-spin 1s linear infinite; }
.agent-rail-artifacts .ara-sec-title { font-size: 11px; color: #8896a8; letter-spacing: .04em;
  margin: 8px 2px 4px; }
.agent-rail-artifacts .ara-stage { margin-bottom: 2px; }
.agent-rail-artifacts .ara-stage-hd { display: flex; align-items: center; gap: 6px; width: 100%;
  border: none; background: transparent; cursor: pointer; text-align: left;
  padding: 6px; border-radius: 8px; font-size: 12.5px; color: #3a4a5e; }
.agent-rail-artifacts .ara-stage-hd:hover { background: #fff; }
.agent-rail-artifacts .ara-stage.done .ara-stage-name { color: #1e2a3a; font-weight: 600; }
.agent-rail-artifacts .ara-stage-ic { width: 14px; flex: none; color: #16a34a; }
.agent-rail-artifacts .ara-stage:not(.done) .ara-stage-ic { color: #c3ccd8; }
.agent-rail-artifacts .ara-stage-name { flex: 1; min-width: 0; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.agent-rail-artifacts .ara-stage-more { flex: none; color: #a9b6c6; font-size: 11px; }
.agent-rail-artifacts .ara-stage-val { margin: 2px 0 6px 20px; padding: 7px 9px;
  background: #f6f8fb; border: 1px dashed #dbe3ec; border-radius: 8px; font-size: 11.5px;
  color: #5a6b7e; white-space: pre-wrap; word-break: break-word; max-height: 220px;
  overflow: auto; font-family: var(--mono); }
.agent-rail-artifacts .ara-empty { font-size: 11.5px; color: #a9b6c6; padding: 6px 4px; }
.agent-rail-artifacts .ara-file { display: flex; align-items: center; gap: 6px; padding: 5px 6px;
  border-radius: 8px; }
.agent-rail-artifacts .ara-file:hover { background: #fff; }
.agent-rail-artifacts .ara-file-ic { width: 16px; flex: none; text-align: center; font-size: 11px; }
.agent-rail-artifacts .ara-file-name { flex: 1; min-width: 0; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; font-size: 12px; color: var(--prime);
  text-decoration: none; }
.agent-rail-artifacts .ara-file-name:hover { text-decoration: underline; }
.agent-rail-artifacts .ara-file-meta { flex: none; color: #a9b6c6; font-size: 10.5px; }

/* ── Agent 活体看板：真实进度状态行 + 情境 tip（空闲时出现）── */
.agent-rail .rail-live-line { display: flex; align-items: center; gap: 6px; margin: 4px 0 2px;
  font-size: 11.5px; color: #2a7a6e; }
.agent-rail .rail-live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--prime);
  flex: none; animation: ars-spin 1.2s linear infinite; }
.agent-rail .rail-tip-line { margin: 2px 0 4px; padding: 5px 9px; font-size: 11.5px; color: #6b7a8f;
  background: #f4f7fb; border-left: 2px solid #cfd8e3; border-radius: 0 8px 8px 0; }

/* 任务执行中：常驻状态 + 转圈图标（直到本轮结束） */
.agent-rail .rail-runline { display: flex; align-items: center; gap: 6px; margin: 4px 0 2px;
  font-size: 12px; font-weight: 600; color: #2a7a6e; }
.agent-rail .rail-spin { width: 12px; height: 12px; border-radius: 50%; flex: none;
  border: 2px solid #cfe3dd; border-top-color: var(--prime);
  animation: rail-spin .8s linear infinite; }
@keyframes rail-spin { to { transform: rotate(360deg); } }

/* 执行过程折叠（业界：工具调用打包、默认收起、需要时展开） */
.agent-rail .rail-steps-fold { margin: 2px 0 6px; }
.agent-rail .rail-steps-fold > summary { cursor: pointer; font-size: 11.5px; color: #7b8798;
  list-style: none; user-select: none; }
.agent-rail .rail-steps-fold > summary::-webkit-details-marker { display: none; }
.agent-rail .rail-steps-fold > summary::before { content: "▸ "; color: #a9b6c6; }
.agent-rail .rail-steps-fold[open] > summary::before { content: "▾ "; }
.agent-rail .rail-steps-fold > summary:hover { color: var(--prime); }
.agent-rail .rail-steps-fold[open] > summary { margin-bottom: 4px; }

/* 任务列表标题栏：标题 + 右侧「筛选 / 查找」图标（全屏左栏） */
.agent-rail-side .ars-tasks-hd { display: flex; align-items: center; justify-content: space-between;
  font-size: 11px; color: #8896a8; padding: 4px 6px 2px 10px; letter-spacing: .04em; }
.agent-rail-side .ars-tasks-title { flex: 1; min-width: 0; }
.agent-rail-side .ars-tasks-acts { display: flex; align-items: center; gap: 2px; flex: none; }
.agent-rail-side .ars-icon-btn { width: 22px; height: 22px; border: none; background: transparent;
  color: #8896a8; border-radius: 6px; display: grid; place-items: center; cursor: pointer; padding: 0; }
.agent-rail-side .ars-icon-btn svg { width: 14px; height: 14px; }
.agent-rail-side .ars-icon-btn:hover { background: #fff; color: var(--prime); }
.agent-rail-side .ars-icon-btn.on { background: #fff; color: var(--prime); }
/* 「查找」搜索框：点击图标后在任务列表下方弹出，占位符「搜索任务」 */
.agent-rail-side .ars-tasks-search { display: flex; align-items: center; gap: 6px; margin: 2px 6px 4px;
  padding: 5px 8px; background: #fff; border: 1px solid #dbe3ec; border-radius: 8px; }
.agent-rail-side .ars-tasks-search svg { width: 13px; height: 13px; color: #8896a8; flex: none; }
.agent-rail-side .ars-tasks-search input { flex: 1; min-width: 0; border: none; outline: none;
  background: transparent; font: 12.5px var(--sans); color: #2a3a4e; padding: 0; }
.agent-rail-side .ars-tasks-search input::placeholder { color: #a9b6c6; }

/* ── Agent 执行过程面板：思考 + 步骤时间线 + 结论（方案 B）── */
.agent-rail .rail-proc { margin: 4px 0 8px; border-left: 2px solid #e3e9f1; padding-left: 8px; }
.agent-rail .rail-think { margin: 0 0 6px; }
.agent-rail .rail-think > summary { cursor: pointer; font-size: 11.5px; color: #7b8798; list-style: none; user-select: none; }
.agent-rail .rail-think > summary::-webkit-details-marker { display: none; }
.agent-rail .rail-think > summary:hover { color: var(--prime); }
.agent-rail .rail-think-hint { color: #a9b6c6; font-size: 10.5px; margin-left: 4px; }
.agent-rail .rail-think-bd { margin-top: 4px; padding: 7px 9px; background: #f6f8fb; border: 1px dashed #dbe3ec;
  border-radius: 8px; font-size: 12px; color: #5a6b7e; white-space: pre-wrap; word-break: break-word;
  max-height: 220px; overflow: auto; }
.agent-rail .rail-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.agent-rail .rail-step { display: grid; grid-template-columns: 16px auto 1fr; gap: 6px; align-items: baseline;
  font-size: 12px; color: #3a4a5e; padding: 3px 0; }
.agent-rail .rail-step-ic { text-align: center; color: #9aa7b8; }
.agent-rail .rail-step.running .rail-step-ic { color: var(--prime); animation: ars-spin 1s linear infinite; }
.agent-rail .rail-step.ok .rail-step-ic { color: #16a34a; }
.agent-rail .rail-step.error .rail-step-ic { color: #dc2626; }
.agent-rail .rail-step-name { font-weight: 500; word-break: break-all; }
.agent-rail .rail-step-meta { color: #9aa7b8; font-size: 11px; text-align: right; white-space: nowrap; }
.agent-rail .rail-step-sum { grid-column: 2 / 4; color: #7b8798; font-size: 11px; white-space: pre-wrap;
  word-break: break-word; max-height: 96px; overflow: auto; background: #f9fafc; border-radius: 6px;
  padding: 3px 6px; margin-top: 2px; }
.agent-rail .rail-concl-hd { font-size: 11px; color: #16a34a; font-weight: 600; margin: 2px 0 4px; }

/* ── HITL 审批卡（替换浏览器原生 confirm）── */
.agent-rail .rail-approval { margin: 6px 8px; padding: 10px 12px; background: #fff7ed;
  border: 1px solid #fed7aa; border-radius: 10px; }
.agent-rail .rail-approval-hd { font-size: 12.5px; font-weight: 600; color: #b45309; margin-bottom: 6px; }
.agent-rail .rail-approval-list { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.agent-rail .rail-approval-name { font-size: 12.5px; font-weight: 600; color: #7c2d12; word-break: break-all; }
.agent-rail .rail-approval-args { font-size: 11.5px; color: #92400e; white-space: pre-wrap; word-break: break-word; }
.agent-rail .rail-approval-btns { display: flex; gap: 8px; }
