/* ============ Agent Factory · shadcn 风格设计系统 ============
   借鉴 shadcn/ui 设计语言（纯 CSS 复刻，零外部依赖）：
   - zinc 中性色阶、细边框、小圆角、轻阴影、focus ring
   - 克制排版：少渐变、少重阴影，以留白与层级取胜
   品牌主色保留 indigo（纯色，无渐变）。
*/
:root {
  --background: #fafafa;
  --panel: #ffffff;
  --panel-2: #f4f4f5;
  --border: #e4e4e7;
  --border-strong: #d4d4d8;
  --text: #18181b;
  --muted: #71717a;
  --muted-2: #a1a1aa;
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-soft: #eef2ff;
  --primary-border: #c7d2fe;
  --ok: #16a34a;
  --err: #dc2626;
  --warn: #d97706;
  --sidebar-bg: #09090b;
  --sidebar-text: #a1a1aa;
  --radius: 10px;
  --radius-sm: 8px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .04);
  --shadow: 0 1px 3px rgba(0, 0, 0, .05), 0 4px 14px rgba(0, 0, 0, .05);
  --shadow-lg: 0 10px 32px rgba(0, 0, 0, .14);
  --ring: 0 0 0 3px rgba(79, 70, 229, .16);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", system-ui, sans-serif;
  background: var(--background);
  color: var(--text);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

svg { width: 16px; height: 16px; flex: none; }
button { font-family: inherit; }
code {
  font-family: "Cascadia Code", Consolas, "Courier New", monospace;
  font-size: 12px; background: var(--panel-2); border: 1px solid var(--border);
  border-radius: 5px; padding: 1px 6px;
}

/* 通用隐藏工具类（.tool-strip.hidden / .proposal-panel.hidden 等都依赖它） */
.hidden { display: none !important; }

/* ============ 布局 ============ */
.app { display: flex; height: 100vh; overflow: hidden; }

/* ---------- 侧边栏（zinc-950，shadcn docs 风） ---------- */
.sidebar {
  width: 232px; flex: none;
  background: var(--sidebar-bg);
  display: flex; flex-direction: column;
  padding: 18px 12px 14px;
  border-right: 1px solid rgba(255, 255, 255, .06);
}
.logo { display: flex; align-items: center; gap: 10px; padding: 0 8px 20px; }
.logo-icon {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
}
.logo-icon svg { width: 17px; height: 17px; }
.logo-text { font-size: 14px; font-weight: 600; color: #fafafa; line-height: 1.3; letter-spacing: -.2px; }
.logo-text span { display: block; font-size: 11px; font-weight: 400; color: var(--sidebar-text); }

.menu { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.menu-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 8px 10px;
  background: transparent; border: none; border-radius: 7px;
  color: var(--sidebar-text); font-size: 13.5px; font-weight: 500;
  cursor: pointer; text-align: left; transition: all .15s ease;
}
.menu-item:hover { color: #fafafa; background: rgba(255, 255, 255, .07); }
.menu-item.active {
  color: #09090b; background: #fafafa;
  box-shadow: var(--shadow-sm);
}
.menu-item.active svg { color: var(--primary); }

.sidebar-foot { display: flex; flex-direction: column; gap: 10px; padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, .08); }
.key-chip {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255, 255, 255, .06); color: var(--sidebar-text);
  border: 1px solid rgba(255, 255, 255, .10); border-radius: 7px;
  padding: 7px 10px; font-size: 12.5px; cursor: pointer; transition: all .15s;
}
.key-chip:hover { background: rgba(255, 255, 255, .10); color: #fafafa; }
.key-chip.set { color: #86efac; border-color: rgba(74, 222, 128, .3); }
.key-chip.set svg { color: var(--ok); }
.version { font-size: 11px; color: rgba(161, 161, 170, .5); text-align: center; }

/* ---------- 主内容 ---------- */
.content { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.content-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 28px 14px; flex-wrap: wrap; gap: 10px;
}
.head-title h1 { font-size: 18px; font-weight: 600; letter-spacing: -.3px; }
.head-title p { font-size: 12.5px; color: var(--muted); margin-top: 2px; }

.tab { display: none; flex: 1; overflow: hidden; padding: 0 28px 20px; }
.tab.active { display: flex; flex-direction: column; }
.scroll-area { flex: 1; overflow-y: auto; padding-right: 4px; }

/* ============ 通用组件（shadcn 风） ============ */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--border-strong); background: var(--panel); color: var(--text);
  padding: 7px 14px; border-radius: var(--radius-sm); cursor: pointer;
  font-size: 13px; font-weight: 500; transition: all .15s ease;
  box-shadow: var(--shadow-sm);
}
.btn:hover { background: var(--panel-2); }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn.primary {
  background: var(--primary); border-color: var(--primary); color: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .2);
}
.btn.primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn.accent {
  background: var(--primary-soft); border-color: var(--primary-border); color: var(--primary);
  box-shadow: none;
}
.btn.accent:hover { background: #e0e7ff; }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--muted); }
.btn.ghost:hover { background: var(--panel-2); color: var(--text); }
.btn.danger { color: var(--err); }
.btn.danger:hover { background: #fef2f2; border-color: #fecaca; color: var(--err); }
.btn.sm { padding: 5px 10px; font-size: 12.5px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.dot.ok { background: var(--ok); }
.dot.err { background: var(--err); }
.dot.warn { background: var(--warn); }

.toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.toolbar-note { font-size: 12.5px; color: var(--muted); display: inline-flex; align-items: center; gap: 8px; }

.select {
  appearance: none; padding: 7px 32px 7px 11px; font-size: 13px; color: var(--text);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--panel) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2371717a' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>") no-repeat right 10px center;
  cursor: pointer; max-width: 340px; outline: none; box-shadow: var(--shadow-sm);
}
.select:focus-visible { border-color: var(--primary); box-shadow: var(--ring); }

.empty {
  color: var(--muted); text-align: center; padding: 60px 20px; font-size: 13.5px;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.empty .empty-icon { font-size: 38px; opacity: .7; }

/* ============ 聊天区 ============ */
.chat-layout { flex: 1; display: flex; gap: 16px; min-height: 0; }

/* 会话面板 */
.session-panel { width: 210px; flex: none; display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.session-panel .btn.full { width: 100%; justify-content: center; }
.session-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; padding-right: 2px; }
.session-item {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 9px; border-radius: 7px;
  cursor: pointer; transition: background .15s; border: 1px solid transparent;
}
.session-item:hover { background: var(--panel); border-color: var(--border); }
.session-item.active { background: var(--panel); border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.session-item .s-title {
  flex: 1; font-size: 12.5px; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.session-item.active .s-title { font-weight: 600; color: var(--primary); }
.session-item .s-del {
  border: none; background: transparent; color: var(--muted-2);
  cursor: pointer; font-size: 13px; padding: 2px 4px; border-radius: 5px;
  opacity: 0; transition: all .15s; line-height: 1;
}
.session-item:hover .s-del { opacity: 1; }
.session-item .s-del:hover { color: var(--err); background: #fef2f2; }

.chat-wrap { flex: 1; display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.chat-messages {
  flex: 1; overflow-y: auto; padding: 4px 4px 12px;
  display: flex; flex-direction: column; gap: 14px;
}
.msg { display: flex; gap: 10px; max-width: 84%; }
.msg.user { align-self: flex-end; flex-direction: row-reverse; }
.avatar {
  width: 30px; height: 30px; border-radius: 8px; flex: none;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; user-select: none;
}
.msg.user .avatar { background: var(--primary); color: #fff; }
.msg.assistant .avatar { background: var(--sidebar-bg); color: #a5b4fc; }
.bubble {
  padding: 9px 13px; border-radius: var(--radius);
  font-size: 14px; line-height: 1.7;
  white-space: pre-wrap; word-break: break-word;
}
.msg.user .bubble {
  background: var(--primary); color: #fff;
  border-bottom-right-radius: 4px;
}
.msg.assistant .bubble {
  background: var(--panel); border: 1px solid var(--border);
  border-bottom-left-radius: 4px; box-shadow: var(--shadow-sm);
}
.msg .meta { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.msg.assistant .meta-name { font-size: 12px; font-weight: 600; color: var(--primary); }
.msg.user .meta-name { font-size: 12px; font-weight: 600; color: rgba(255, 255, 255, .85); }
.msg.system { align-self: center; }
.msg.system .bubble { background: #fffbeb; border-color: #fde68a; color: #92600a; font-size: 12.5px; }

/* 流式打字光标 */
.typing::after { content: "▍"; color: var(--primary); animation: blink 1s step-end infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* 消息淡入 */
@keyframes msgIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
.msg { animation: msgIn .22s ease; }

/* ---------- 输入栏 ---------- */
.chat-input-bar {
  border: 1px solid var(--border-strong); border-radius: 12px;
  background: var(--panel); padding: 9px 12px 11px;
  box-shadow: var(--shadow-sm); transition: box-shadow .2s, border-color .2s;
}
.chat-input-bar:focus-within { border-color: var(--primary); box-shadow: var(--ring); }
.chat-input-bar textarea {
  width: 100%; border: none; outline: none; resize: none;
  font-size: 14px; font-family: inherit; line-height: 1.6; color: var(--text);
  background: transparent; max-height: 140px;
}
.chat-input-bar textarea::placeholder { color: var(--muted-2); }
.chat-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px; }

/* ---------- 构建方案面板 ---------- */
.proposal-panel {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow);
  margin: 12px 0; padding: 16px 18px;
  max-height: 46%; overflow-y: auto;
  animation: msgIn .3s ease;
}
.prop-head { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.prop-head .prop-badge {
  background: var(--primary); color: #fff; font-size: 11px; font-weight: 600;
  padding: 3px 10px; border-radius: 6px; letter-spacing: .3px;
}
.prop-name { font-size: 16px; font-weight: 600; letter-spacing: -.2px; }
.prop-summary { color: var(--muted); font-size: 13px; margin: 4px 0 12px; }
.proposal-panel details { margin: 10px 0; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; background: var(--panel); }
.proposal-panel summary {
  cursor: pointer; font-size: 13px; font-weight: 500; color: var(--text);
  padding: 9px 12px; background: var(--panel-2); list-style: none;
  display: flex; align-items: center; gap: 8px; user-select: none;
}
.proposal-panel summary::before { content: "▸"; color: var(--muted); transition: transform .2s; font-size: 11px; }
.proposal-panel details[open] summary::before { transform: rotate(90deg); }
.proposal-panel details[open] summary { border-bottom: 1px solid var(--border); }
.proposal-panel .detail-body { padding: 10px 12px; }
.proposal-panel ul { margin-left: 18px; font-size: 13px; line-height: 1.9; }
.proposal-panel pre {
  background: #0c0c0f; color: #e4e4e7; border-radius: 7px;
  padding: 11px; font-size: 12px; line-height: 1.6;
  white-space: pre-wrap; word-break: break-word; max-height: 220px; overflow-y: auto;
  font-family: "Cascadia Code", Consolas, monospace;
}
.prop-actions { display: flex; gap: 10px; margin-top: 14px; }

/* ============ Agent 卡片（shadcn 卡片风） ============ */
.agent-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(296px, 1fr));
  gap: 12px; padding-bottom: 24px;
}
.agent-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: box-shadow .18s ease, border-color .18s ease, transform .18s ease;
  display: flex; flex-direction: column;
}
.agent-card:hover { box-shadow: var(--shadow); border-color: var(--border-strong); transform: translateY(-1px); }
.agent-card .card-body { padding: 14px 16px 10px; flex: 1; }
.agent-card .card-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.agent-name { font-size: 14.5px; font-weight: 600; letter-spacing: -.2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agent-id { font-size: 11.5px; color: var(--muted); font-family: Consolas, monospace; margin-top: 2px; }
.agent-tags { display: flex; gap: 6px; margin-top: 9px; flex-wrap: wrap; }
.tag {
  font-size: 11px; padding: 2px 9px; border-radius: 6px; font-weight: 500;
  background: var(--primary-soft); color: var(--primary);
}
.tag.gray { background: var(--panel-2); color: var(--muted); border: 1px solid var(--border); }
.tag.green { background: #f0fdf4; color: #15803d; }
.agent-card .card-foot {
  display: flex; gap: 8px; padding: 9px 16px;
  border-top: 1px solid var(--border); background: var(--panel-2);
  border-radius: 0 0 var(--radius) var(--radius);
}
.agent-card .card-foot .btn { flex: 1; justify-content: center; padding: 5px 8px; font-size: 12.5px; box-shadow: none; }

/* ============ 运行列表 ============ */
.run-list { display: flex; flex-direction: column; gap: 8px; padding-bottom: 24px; }
.run-item {
  display: flex; align-items: center; gap: 13px;
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 11px 15px; cursor: pointer; transition: all .16s ease;
  box-shadow: var(--shadow-sm);
}
.run-item:hover { border-color: var(--primary-border); box-shadow: var(--shadow); }
.run-status-icon { width: 30px; height: 30px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 14px; flex: none; }
.run-item.success .run-status-icon { background: #f0fdf4; }
.run-item.failed .run-status-icon { background: #fef2f2; }
.run-item.running .run-status-icon { background: #fffbeb; }
.run-body { flex: 1; min-width: 0; }
.run-row1 { display: flex; align-items: center; gap: 10px; }
.run-time { font-size: 12.5px; color: var(--muted); }
.run-steps-chip { font-size: 11px; background: var(--panel-2); border: 1px solid var(--border); border-radius: 6px; padding: 1px 8px; color: var(--muted); }
.run-answer {
  font-size: 13px; color: var(--text); margin-top: 3px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.run-item.failed .run-answer { color: var(--err); }
.run-arrow { color: var(--border-strong); }

/* ============ 模态（shadcn dialog 风） ============ */
.modal {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(9, 9, 11, .5);
  backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center;
  animation: fadeIn .15s ease;
}
.modal.hidden { display: none; }
@keyframes fadeIn { from { opacity: 0; } }
.modal-content {
  background: var(--panel); border-radius: var(--radius-lg);
  width: min(720px, 94vw); max-height: 86vh; overflow-y: auto;
  box-shadow: var(--shadow-lg); padding: 20px 22px;
  animation: modalIn .2s cubic-bezier(.16, 1, .3, 1);
  border: 1px solid var(--border);
}
@keyframes modalIn { from { opacity: 0; transform: translateY(10px) scale(.97); } }
.modal-content h3 { font-size: 15.5px; font-weight: 600; margin-bottom: 8px; display: flex; align-items: center; gap: 8px; letter-spacing: -.2px; }
.modal-content h4 {
  font-size: 12px; margin: 16px 0 7px; color: var(--muted);
  text-transform: uppercase; letter-spacing: .6px; font-weight: 600;
}
.modal-content pre {
  background: var(--panel-2); border: 1px solid var(--border); border-radius: 8px;
  padding: 11px; font-size: 12.5px; line-height: 1.6;
  white-space: pre-wrap; word-break: break-word; max-height: 280px; overflow-y: auto;
}
.modal-content .dark-pre { background: #0c0c0f; color: #e4e4e7; border-color: transparent; }
.modal-close {
  float: right; border: none; background: transparent; font-size: 16px; cursor: pointer;
  color: var(--muted); width: 28px; height: 28px; border-radius: 7px; transition: all .15s;
}
.modal-close:hover { background: var(--panel-2); color: var(--text); }

/* 步骤时间线 */
.step-timeline { position: relative; padding-left: 22px; display: flex; flex-direction: column; gap: 12px; }
.step-timeline::before {
  content: ""; position: absolute; left: 7px; top: 8px; bottom: 8px; width: 2px;
  background: var(--border);
}
.step { position: relative; }
.step::before {
  content: ""; position: absolute; left: -22px; top: 6px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--panel); border: 2px solid var(--primary);
}
.step.ok::before { border-color: var(--ok); background: #fff; }
.step.error::before { border-color: var(--err); background: #fff; }
.step .step-head { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; flex-wrap: wrap; }
.step .step-time { font-size: 11px; color: var(--muted); font-weight: 400; margin-left: auto; }
.step pre { margin-top: 6px; font-size: 11.5px; max-height: 150px; }

/* 信息卡 */
.info-card { background: var(--panel-2); border: 1px dashed var(--border-strong); border-radius: 10px; padding: 13px 15px; font-size: 13px; }
.info-card .kv { display: flex; align-items: baseline; gap: 10px; margin: 6px 0; }
.info-card .kv b { color: var(--muted); min-width: 96px; font-weight: 500; font-size: 12.5px; }
.info-card .kv code { word-break: break-all; }
.copy-btn { margin-top: 10px; }

/* 成功横幅 */
.success-banner {
  display: flex; align-items: center; gap: 12px;
  background: #f0fdf4; border: 1px solid #bbf7d0;
  border-radius: 10px; padding: 13px 15px; margin-bottom: 14px;
}
.success-banner .big { font-size: 24px; }

/* ============ Toast（shadcn 风：白底细边框） ============ */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%);
  background: var(--panel); color: var(--text);
  border: 1px solid var(--border-strong);
  padding: 9px 18px; border-radius: 9px;
  font-size: 13px; font-weight: 500;
  box-shadow: var(--shadow-lg); z-index: 200;
  display: flex; align-items: center; gap: 8px;
  animation: toastIn .25s cubic-bezier(.16, 1, .3, 1);
}
.toast.hidden { display: none; }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 10px); } }
.toast.err { color: var(--err); border-color: #fecaca; }

/* ============ 测试 Agent 页 ============ */
.test-layout { flex: 1; display: flex; gap: 16px; min-height: 0; }
.test-side { width: 220px; flex: none; display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.test-side-head { font-size: 12.5px; color: var(--muted); font-weight: 600; letter-spacing: .3px; }
.test-agent-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; padding-right: 2px; }
.test-agent-item {
  border: 1px solid var(--border); background: var(--panel);
  border-radius: 8px; padding: 9px 11px; cursor: pointer;
  transition: all .15s; box-shadow: var(--shadow-sm);
}
.test-agent-item:hover { border-color: var(--primary-border); }
.test-agent-item.active { border-color: var(--primary); background: var(--primary-soft); }
.test-agent-item .t-name { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.test-agent-item .t-id { font-size: 11px; color: var(--muted); font-family: Consolas, monospace; margin-top: 1px; }
.test-agent-item .t-tags { font-size: 11px; color: var(--primary); margin-top: 3px; }

.test-main { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
/* 单条回复的工具调用条（显示在本轮回复上方） */
.tool-strip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--primary-soft); border: 1px solid var(--primary-border);
  color: var(--primary); font-size: 11.5px; font-weight: 500;
  border-radius: 6px; padding: 3px 9px; margin-bottom: 7px;
  cursor: pointer; transition: all .15s; user-select: none;
}
.tool-strip:hover { background: #e0e7ff; }
.tool-strip .chev { transition: transform .2s; width: 12px; height: 12px; }
.tool-strip.open .chev { transform: rotate(90deg); }
.tool-detail {
  display: none; margin-bottom: 7px; padding: 9px 11px;
  background: var(--panel-2); border: 1px solid var(--border);
  border-radius: 8px; max-height: 220px; overflow-y: auto;
}
.tool-detail.open { display: block; }
.tool-detail .step-timeline { padding-left: 20px; gap: 9px; }
.tool-detail .step-timeline::before { left: 6px; }
.tool-detail .step::before { left: -20px; width: 14px; height: 14px; top: 5px; }
.tool-detail .step pre { font-size: 11px; max-height: 110px; margin-top: 4px; }

.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); animation: livePulse 1.2s ease infinite; }
@keyframes livePulse { 50% { opacity: .35; } }

/* ============ 滚动条 ============ */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #d4d4d8; border-radius: 4px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #a1a1aa; background-clip: content-box; border: 2px solid transparent; }
::-webkit-scrollbar-track { background: transparent; }

/* 小屏适配 */
@media (max-width: 760px) {
  .sidebar { width: 60px; padding: 14px 8px; }
  .logo-text, .menu-item span, .version { display: none; }
  .menu-item { justify-content: center; padding: 8px; }
  .key-chip { justify-content: center; }
  .key-chip span { display: none; }
  .msg { max-width: 92%; }
  .session-panel { width: 150px; }
}

/* ---- Hub 路由测试 ---- */
.hub-layout { display: flex; flex-direction: column; gap: 10px; height: 100%; min-height: 0; padding: 12px; }
.hub-banner { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 10px;
  background: var(--accent, #6c5ce7); color: #fff; font-size: 14px; flex: 0 0 auto; }
.hub-state-label { opacity: .85; }
.hub-active { font-weight: 600; }
.hub-targets { flex: 0 0 auto; }
.hub-targets-head { font-size: 12px; color: var(--muted, #888); margin-bottom: 6px; }
.hub-target-list { display: flex; flex-wrap: wrap; gap: 8px; }
.hub-target { display: flex; flex-direction: column; gap: 2px; text-align: left; padding: 6px 10px;
  border: 1px solid var(--border, #333); border-radius: 8px; background: transparent; color: inherit;
  cursor: pointer; max-width: 220px; }
.hub-target:hover { border-color: var(--accent, #6c5ce7); }
.ht-name { font-weight: 600; font-size: 13px; }
.ht-sum { font-size: 11px; opacity: .7; }
.hub-chat { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
#hubMessages { flex: 1 1 auto; }
