/* ===== BPM Agent 工作台 - 三栏布局（左/右待办，中间 AI） ===== */

/* ===== 三列总布局 ===== */
.wb-3col { display: flex; flex-direction: column; gap: 10px; flex: 1; min-height: 0; overflow: hidden; }

/* 指标条（置于右列顶部） */
.wb-metrics-bar { flex-shrink: 0; background: #fff; }
.wb-col .wb-metrics-bar { border-bottom: 1px solid var(--border, #eee); }
.wb-metrics-head { display: flex; align-items: center; justify-content: space-between; padding: 6px 14px; border-bottom: 1px solid var(--surface-2, #f0f0f0); }
.wb-metrics-title { font-size: 12px; font-weight: 700; color: var(--muted, #536477); }
.wb-metrics-toggle { border: none; background: transparent; cursor: pointer; font-size: 13px; color: var(--muted, #536477); padding: 2px 6px; border-radius: 4px; }
.wb-metrics-toggle:hover { background: var(--surface-2, #f5f7fa); }
.wb-metrics-scroll { padding: 8px 12px; overflow: hidden; }
.wb-metrics-scroll.wb-metrics-collapsed { display: none; }
.wb-metrics-scroll .workbench-metrics-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.workbench-metric-card {
  background: #fff; border: 1px solid var(--border, #d8e0e8); border-radius: 8px;
  padding: 6px 8px; display: flex; flex-direction: column; gap: 1px; min-width: 0;
}
.workbench-metric-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.workbench-metric-card .label { font-size: 10px; color: var(--muted, #536477); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.workbench-metric-card .value { font-size: 15px; font-weight: 700; line-height: 1.2; }
.workbench-metric-card.tone-green .value { color: #1f9d55; }
.workbench-metric-card.tone-amber .value { color: #C77A11; }
.workbench-metric-card.tone-red .value { color: #d9534f; }
.workbench-metric-card.tone-accent .value { color: var(--accent, #ef7d22); }

/* 三列主体 */
.wb-cols { display: flex; gap: 12px; flex: 1; min-height: 0; overflow: hidden; }
.wb-col { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--border, #d8e0e8); border-radius: 10px; overflow: hidden; }
.wb-col-governance, .wb-col-personal { flex: 0 0 280px; min-width: 0; }
.wb-col-mid { flex: 1 1 0; min-width: 0; }
.wb-col-mid .wb-chat-wrap { flex: 1; min-height: 0; }
.wb-col-inner { display: flex; flex-direction: column; flex: 1; min-height: 0; }

/* 列头 */
.wb-col-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-bottom: 1px solid var(--border, #eee); flex-shrink: 0; }
.wb-col-title { display: flex; align-items: center; gap: 6px; }
.wb-col-title-icon { font-size: 14px; }
.wb-col-head h3 { margin: 0; font-size: 14px; font-weight: 700; }
.wb-col-count, .wb-todo-count { font-size: 11px; padding: 2px 10px; border-radius: 10px; background: var(--surface-2, #f5f7fa); color: var(--muted, #536477); white-space: nowrap; }
.wb-col-body { flex: 1; overflow-y: auto; padding: 12px; }
.wb-col-body::-webkit-scrollbar { width: 5px; }
.wb-col-body::-webkit-scrollbar-thumb { background: rgba(0,0,0,.14); border-radius: 3px; }

/* 待办分组：每组独立卡片 + 彩色分组标题 */
.wb-todo-group {
  margin-bottom: 10px; border: 1px solid var(--border, #e8ecf2); border-radius: 10px;
  overflow: hidden; background: #fff; box-shadow: 0 1px 3px rgba(15,23,42,.05);
}
.wb-todo-group:last-child { margin-bottom: 0; }
.wb-todo-group-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px; font-size: 12px; font-weight: 700;
  background: linear-gradient(180deg, #fff, #f8fafc); border-bottom: 1px solid #eef2f6;
  position: sticky; top: 0; z-index: 1;
}
.wb-todo-group-label { color: var(--accent, #ef7d22); white-space: nowrap; }

/* 待办条目（精简：单行标题 + 箭头，无图标无装饰条） */
.wb-todo-item {
  display: flex; align-items: center; gap: 8px; padding: 9px 12px;
  border-bottom: 1px solid #f7f7f7; cursor: pointer; transition: background 0.15s;
}
.wb-todo-item:last-child { border-bottom: none; }
.wb-todo-item:hover { background: var(--surface-2, #f5f7fa); }
.wb-todo-title { flex: 1; min-width: 0; font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wb-todo-status { flex-shrink: 0; font-size: 11px; line-height: 1; padding: 3px 7px 4px; border-radius: 8px; font-weight: 600; }
.wb-todo-status.c-amber { background: rgba(245,158,11,.14); color: #b45309; }
.wb-todo-status.c-blue { background: rgba(59,130,246,.12); color: #1d4ed8; }
.wb-todo-status.c-purple { background: rgba(139,92,246,.12); color: #6d28d9; }
.wb-todo-status.c-red { background: rgba(220,38,38,.1); color: #b91c1c; }
.wb-todo-status.c-orange { background: rgba(249,115,22,.14); color: #c2410c; }
.wb-todo-status.c-teal { background: rgba(13,148,136,.12); color: #0f766e; }
.wb-todo-status.c-indigo { background: rgba(79,70,229,.12); color: #4338ca; }
.wb-todo-status.c-slate { background: rgba(100,116,139,.12); color: #475569; }
.wb-todo-status.c-green { background: rgba(34,197,94,.13); color: #15803d; }
.wb-todo-chevron { color: var(--muted, #ccc); font-size: 15px; }
.wb-todo-empty { padding: 40px 20px; text-align: center; color: var(--muted, #94a3b8); font-size: 13px; }

/* ===== 待办详情居中弹窗 ===== */
.todo-modal-backdrop {
  position: fixed; inset: 0; z-index: 200; background: rgba(15, 23, 42, 0.45);
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.todo-modal {
  width: min(1100px, 100%); max-height: calc(100vh - 48px); display: flex; flex-direction: column;
  background: #fff; border-radius: 12px; box-shadow: 0 20px 60px rgba(0,0,0,.28); overflow: hidden;
}
.todo-modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border, #eee); flex-shrink: 0; }
.todo-modal-head h3 { margin: 0; font-size: 16px; font-weight: 700; }
.todo-modal-head p { margin: 4px 0 0; font-size: 13px; color: var(--muted, #536477); }
.todo-modal-head-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.todo-modal-body { flex: 1; min-height: 200px; display: flex; overflow: hidden; padding: 0; }
.todo-modal-left { flex: 0 0 300px; border-right: 1px solid var(--border, #eee); display: flex; flex-direction: column; overflow: hidden; }
.todo-modal-left-head { padding: 12px 16px; font-size: 13px; font-weight: 600; color: #4a90d9; border-bottom: 1px solid var(--border, #eee); background: #f5f8ff; flex-shrink: 0; }
.todo-modal-left-body { padding: 12px 16px; font-size: 13px; line-height: 1.6; flex: 1; overflow-y: auto; white-space: pre-wrap; color: #333; }
.todo-modal-ai-loading { color: var(--muted, #94a3b8); font-style: italic; }
.todo-modal-right { flex: 1; overflow-y: auto; padding: 16px 20px; }
.todo-modal-right::-webkit-scrollbar { width: 6px; }
.todo-modal-right::-webkit-scrollbar-thumb { background: rgba(0,0,0,.16); border-radius: 3px; }
.todo-modal-body::-webkit-scrollbar { width: 6px; }
.todo-modal-body::-webkit-scrollbar-thumb { background: rgba(0,0,0,.16); border-radius: 3px; }
.todo-modal-actions {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 12px 20px; border-top: 1px solid var(--border, #eee); flex-shrink: 0; background: #fafbfc;
}

/* ===== 待办详情 Tab ===== */
.todo-detail-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border, #eee); margin-bottom: 16px; }
.todo-detail-tab { padding: 8px 16px; border: none; background: transparent; cursor: pointer; font-size: 13px; color: var(--muted, #536477); border-bottom: 2px solid transparent; }
.todo-detail-tab.active { color: var(--accent, #ef7d22); border-bottom-color: var(--accent, #ef7d22); font-weight: 600; }
.todo-detail-tab:hover { color: var(--accent, #ef7d22); }
.todo-detail-panel { min-height: 200px; }

/* 详情面板 */
.detail-section { margin-bottom: 16px; }
.detail-section h4 { margin: 0 0 8px; font-size: 13px; font-weight: 700; color: var(--text, #18324a); }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.detail-grid > div { padding: 4px 0; }
.detail-grid .label { font-size: 11px; color: var(--muted, #94a3b8); display: block; }
.detail-grid .value { font-size: 13px; font-weight: 500; }
.detail-feedback { background: var(--surface-2, #f5f7fa); border-radius: 8px; padding: 10px 14px; font-size: 13px; line-height: 1.6; }

/* AI 结果卡片 */
.ai-result-card { background: linear-gradient(135deg, #f0f7ff, #f5f0ff); border: 1px solid #d0e0f0; border-radius: 10px; padding: 14px 16px; }
.ai-result-label { font-size: 12px; font-weight: 600; color: #5566cc; margin-bottom: 6px; }
.ai-result-content { font-size: 13px; line-height: 1.7; white-space: pre-wrap; }
.ai-result-loading { font-size: 13px; color: var(--muted, #94a3b8); padding: 24px; text-align: center; }

/* 操作记录时间线 */
.detail-timeline { padding-left: 8px; }
.timeline-item { display: flex; gap: 12px; padding: 8px 0; border-bottom: 1px solid #f5f5f5; }
.timeline-item:last-child { border-bottom: none; }
.timeline-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent, #ef7d22); margin-top: 5px; flex-shrink: 0; }
.timeline-dot.rejected, .timeline-dot.reject { background: #d9534f; }
.timeline-dot.approved, .timeline-dot.approve { background: #1f9d55; }
.timeline-content { flex: 1; }
.timeline-content strong { font-size: 13px; }
.timeline-action { font-size: 12px; color: var(--muted, #536477); margin-left: 6px; }
.timeline-comment { font-size: 13px; margin-top: 4px; color: var(--text, #333); }
.timeline-time { font-size: 11px; color: var(--muted, #aaa); margin-top: 2px; }

/* ===== 右栏/中栏：AI 对话 ===== */
.wb-chat-wrap { display: flex; flex-direction: column; height: 100%; background: #fff; border: 1px solid var(--border, #d8e0e8); border-radius: 10px; overflow: hidden; }
.wb-chat-head { display: flex; align-items: center; padding: 6px 10px; border-bottom: 1px solid var(--border, #eee); flex-shrink: 0; }
.wb-session-tabs { display: flex; align-items: center; gap: 4px; flex: 1; min-width: 0; overflow-x: auto; }
.wb-session-tabs::-webkit-scrollbar { height: 0; }
.wb-session-tab { display: flex; align-items: center; gap: 4px; padding: 2px 8px; border: none; border-radius: 0; background: transparent; cursor: pointer; font-size: 11px; color: var(--muted, #536477); max-width: 130px; overflow: hidden; white-space: nowrap; }
.wb-session-tab-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wb-session-tab-close { font-size: 14px; line-height: 1; opacity: 0; transition: opacity 0.15s; flex-shrink: 0; }
.wb-session-tab:hover .wb-session-tab-close { opacity: 0.6; }
.wb-session-tab-close:hover { opacity: 1 !important; color: #d9534f; }
.wb-session-tab:hover { color: var(--muted, #536477); }
.wb-session-tab.active { background: transparent; border: none; color: var(--muted, #536477); font-weight: 600; }
.wb-session-tab.active .wb-session-tab-close { opacity: 0.6; }
.wb-chat-head-actions { display: flex; align-items: center; gap: 2px; padding: 0 6px; flex-shrink: 0; border-left: 1px solid var(--border, #eee); }
.wb-tab-btn { padding: 2px 6px; border: none; background: transparent; cursor: pointer; font-size: 14px; border-radius: 4px; }
.wb-tab-btn:hover { color: var(--accent, #ef7d22); background: rgba(91,141,239,.10); }
.wb-tab-btn[id$="-new"], .wb-tab-btn[id$="-new"]:hover { background: transparent !important; }

.wb-chat-wrap #wb-hist { flex: 1; overflow-y: auto; padding: 12px 14px; min-height: 0; }
.wb-chat-wrap #wb-hist::-webkit-scrollbar { width: 5px; }
.wb-chat-wrap #wb-hist::-webkit-scrollbar-thumb { background: rgba(0,0,0,.14); border-radius: 3px; }

/* 消息气泡 */
.wb-msg-user { text-align: right; margin: 5px 0; }
.wb-msg-ai { margin: 5px 0; display: flex; align-items: flex-start; gap: 4px; }
.wb-bubble-user { display: inline-block; background: var(--accent, #ef7d22); color: #fff; padding: 6px 12px; border-radius: 12px 12px 2px 12px; font-size: 13px; max-width: 85%; word-break: break-word; }
.wb-bubble-ai { display: inline-block; background: var(--surface-2, #f5f7fa); padding: 6px 12px; border-radius: 12px 12px 12px 2px; font-size: 13px; max-width: 85%; word-break: break-word; }

/* 空状态 */
.wb-empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 100%; text-align: center; padding: 20px 10px; }
.wb-empty-icon { font-size: 36px; }
.wb-empty-title { font-size: 15px; font-weight: 600; color: var(--text, #18324a); margin-top: 6px; }
.wb-empty-hint { font-size: 12px; color: var(--muted, #94a3b8); margin-top: 4px; }
.wb-starter-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; max-width: 440px; margin: 14px auto 0; }
.wb-starter-card { border: 1px solid var(--border, #e8e8e8); border-radius: 8px; padding: 9px 8px; cursor: pointer; text-align: center; transition: all 0.15s; }
.wb-starter-card:hover { border-color: var(--accent, #ef7d22); background: rgba(239,125,34,.04); }
.wb-starter-card .wb-starter-icon { font-size: 16px; margin-bottom: 3px; }
.wb-starter-card .wb-starter-text { font-size: 11px; color: var(--text, #18324a); line-height: 1.25; }
@media(min-width:1280px){ .wb-starter-grid{gap:10px!important; max-width:480px!important} .wb-starter-card{padding:11px 10px!important} }

/* 输入区 */
.wb-chat-input { padding: 8px 14px; border-top: 1px solid var(--border, #eee); flex-shrink: 0; }
.wb-input-chips { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 4px; }
.wb-input-wrap { position: relative; }
.wb-input-wrap textarea {
  width: 100%; border: 1px solid var(--border, #d8e0e8); border-radius: 8px;
  padding: 8px 110px 20px 10px; font-size: 13px; resize: none; min-height: 52px;
  font-family: inherit;
}
.wb-input-wrap textarea:focus { outline: none; border-color: var(--accent, #ef7d22); }
.wb-input-tools-left { position: absolute; left: 4px; bottom: 8px; display: flex; gap: 2px; align-items: center; }
.wb-input-tools-right { position: absolute; right: 4px; bottom: 8px; display: flex; gap: 2px; align-items: center; }
.wb-tool-btn { padding: 2px 6px; border: 1px solid var(--border, #d8e0e8); border-radius: 4px; background: #fff; cursor: pointer; font-size: 11px; color: var(--muted, #536477); white-space: nowrap; }
.wb-tool-btn:hover { border-color: var(--accent, #ef7d22); color: var(--accent, #ef7d22); background: rgba(91,141,239,.04); }
.wb-input-tools-right .wb-tab-btn { padding: 4px; border: 1px solid var(--border, #d8e0e8); border-radius: 4px; background: #fff; cursor: pointer; font-size: 14px; display: flex; align-items: center; }
.wb-input-tools-right .wb-tab-btn:hover { color: var(--accent, #ef7d22); background: rgba(91,141,239,.10); }
.wb-mic-btn { padding: 4px; border: 1px solid var(--border, #d8e0e8); border-radius: 4px; background: #fff; cursor: pointer; color: var(--muted, #536477); display: flex; align-items: center; }
.wb-mic-btn:hover { color: var(--accent, #ef7d22); background: rgba(91,141,239,.10); }
.wb-send-btn { padding: 4px 14px; border: none; border-radius: 4px; background: var(--accent, #ef7d22); color: #fff; cursor: pointer; font-size: 12px; font-weight: 600; }
.wb-send-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.wb-abort-btn { padding: 4px 10px; border: 1px solid #d9534f; border-radius: 4px; background: #fff; color: #d9534f; cursor: pointer; font-size: 12px; }

/* 拟执行操作 */
.aic-actions { padding: 6px 10px; border-top: 1px solid var(--border, #eee); }
.aic-action-item { display: flex; justify-content: space-between; align-items: center; padding: 4px 0; font-size: 12px; }
.aic-action-btns { display: flex; gap: 4px; }
.aic-action-confirm { padding: 2px 10px; background: #1f9d55; color: #fff; border: none; border-radius: 4px; cursor: pointer; font-size: 11px; }
.aic-action-reject { padding: 2px 10px; background: #d9534f; color: #fff; border: none; border-radius: 4px; cursor: pointer; font-size: 11px; }

/* 思考卡片 */
.wb-thinking-card { margin: 4px 0; border: 1px solid #e0d4f0; border-radius: 8px; overflow: hidden; width: fit-content; max-width: 100%; }
.wb-thinking-card.collapsed { width: fit-content; max-width: 100%; }
.wb-thinking-header { display: flex; align-items: center; gap: 4px; padding: 4px 10px; cursor: pointer; background: rgba(124,92,174,.04); }
.wb-thinking-header:hover { background: rgba(124,92,174,.06); }
.wb-thinking-icon { font-size: 14px; }
.wb-thinking-title { font-weight: 600; flex: 1; font-size: 12px; color: #7c5cae; }
.wb-thinking-caret { font-size: 12px; }
.wb-thinking-body { padding: 6px 10px; font-size: 12px; color: var(--muted, #666); line-height: 1.6; }
.wb-thinking-card.collapsed .wb-thinking-body { display: none; }

/* Markdown 渲染（AI 回复 / 思考内容） */
.wb-md-p { margin: 0 0 6px; }
.wb-md-p:last-child { margin-bottom: 0; }
.wb-md-h { font-size: 13px; font-weight: 700; color: var(--text, #18324a); margin: 4px 0; }
.wb-bubble-ai .wb-md-h:first-child, .wb-thinking-body .wb-md-h:first-child { margin-top: 0; }
.wb-md-li { padding-left: 2px; }
.wb-md-code { display: block; background: rgba(15,23,42,.92); color: #e2e8f0; border-radius: 6px; padding: 8px 10px; margin: 6px 0; font-size: 11px; line-height: 1.55; overflow-x: auto; white-space: pre-wrap; word-break: break-word; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.wb-md-inline { background: rgba(91,141,239,.1); color: #4a6cf7; border-radius: 3px; padding: 0 4px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11.5px; }

/* 工具调用卡片 */
.wb-tool-card { margin: 4px 0; border: 1px solid var(--border, #e0e0e0); border-radius: 8px; overflow: hidden; cursor: pointer; transition: background .15s; }
.wb-tool-card:hover { background: var(--surface-2, #f5f7fa); }
.wb-tool-card.collapsed .wb-tool-args, .wb-tool-card.collapsed .wb-tool-result { display: none; }
/* 折叠时宽度自适应内容 */
.wb-tool-card.collapsed { width: fit-content; max-width: 100%; }
.wb-tool-header { padding: 4px 10px; font-size: 12px; font-weight: 600; background: var(--surface-2, #f5f7fa); display: flex; align-items: center; justify-content: space-between; }
.wb-tool-status { font-size: 10px; }
.wb-tool-args { padding: 6px 10px; font-size: 11px; }
.wb-tool-args pre { margin: 0; white-space: pre-wrap; word-break: break-all; color: #555; max-height: 300px; overflow-y: auto; }
.wb-tool-result { padding: 4px 10px 8px; font-size: 12px; color: #333; border-top: 1px solid #e0e0e0; white-space: pre-wrap; word-break: break-word; line-height: 1.6; max-height: 500px; overflow-y: auto; }

/* 下拉菜单 */
.wb-dropdown { position: fixed; background: #fff; border: 1px solid var(--border, #d8e0e8); border-radius: 8px; box-shadow: 0 4px 16px rgba(0,0,0,.12); z-index: 1000; max-height: 240px; overflow-y: auto; }
.wb-dropdown-item { padding: 6px 12px; cursor: pointer; font-size: 12px; }
.wb-dropdown-item:hover { background: var(--surface-2, #f5f7fa); color: var(--accent, #ef7d22); }

/* 加载/错误状态 */
.workbench-error-col, .workbench-loading { padding: 20px; text-align: center; color: var(--muted, #94a3b8); font-size: 13px; }
.wb-col-empty { padding: 30px 16px; text-align: center; color: var(--muted, #94a3b8); font-size: 13px; }

/* 响应式：窄屏纵向堆叠 */
@media(max-width:1280px){
  .wb-col-governance, .wb-col-personal { flex: 0 0 260px; }
}
@media(max-width:1100px){
  .wb-cols { flex-direction: column; overflow-y: auto; }
  .wb-col { flex: 1 1 auto !important; width: auto; max-height: 420px; }
  .wb-col-mid { order: -1; }
}
@media(max-width:800px){
  .wb-col { flex: 1 1 auto !important; max-height: 380px; }
  .detail-grid { grid-template-columns: 1fr; }
  .todo-modal-backdrop { padding: 12px; }
}
.wb-chat-input.wb-drag-over { outline: 2px dashed var(--accent, #2563eb); outline-offset: 2px; background: rgba(37, 99, 235, 0.06); }
.wb-drag-over .wb-input-wrap::after { content: "↩ 松开上传签核配置表"; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-weight: 600; color: var(--accent, #2563eb); background: rgba(255,255,255,0.9); border-radius: 10px; pointer-events: none; }

/* 悬浮上拉：附件工具栏 */
.wb-attach-tools { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.wb-attach-btn { padding: 3px 10px; border: 1px solid var(--border, #d8e0e8); border-radius: 4px; background: #fff; cursor: pointer; font-size: 12px; color: var(--muted, #536477); white-space: nowrap; }
.wb-attach-btn:hover { border-color: var(--accent, #ef7d22); color: var(--accent, #ef7d22); }
.wb-attach-hint { font-size: 10px; color: var(--muted, #94a3b8); margin-left: 2px; }

/* 附件 chips */
.wb-chip { display: inline-flex; align-items: center; gap: 2px; background: var(--surface-2, #f5f7fa); border: 1px solid var(--border, #d8e0e8); border-radius: 4px; padding: 1px 6px; font-size: 11px; color: var(--text, #18324a); }
.wb-chip-x { color: #d9534f; cursor: pointer; padding: 0 2px; font-weight: 600; }
.wb-chip-x:hover { color: #ff0000; }

/* 语音输入进行中 */
.wb-mic-active { color: var(--accent, #ef7d22) !important; border-color: #ef7d22 !important; background: rgba(239,125,34,.15) !important; }
.wb-mic-processing { animation: wbMicPulse 0.9s ease-in-out infinite; }
@keyframes wbMicPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(239,125,34,.35); } 50% { box-shadow: 0 0 0 5px rgba(239,125,34,0); } }

/* 会话列表下拉 */
.wb-sessions-head { padding: 6px 10px; font-size: 12px; font-weight: 600; border-bottom: 1px solid var(--border, #eee); }
.wb-session-item { padding: 6px 10px; cursor: pointer; }
.wb-session-item:hover { background: var(--surface-2, #f5f7fa); }
.wb-session-q { font-size: 12px; color: var(--text, #18324a); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wb-session-meta { font-size: 11px; color: var(--muted, #94a3b8); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wb-sessions-foot { padding: 6px 10px; font-size: 11px; color: var(--muted, #536477); border-top: 1px solid var(--border, #eee); cursor: pointer; text-align: center; }
.wb-sessions-foot:hover { color: #d9534f; background: rgba(217,83,79,.05); }

/* ===== 处理记录页 ===== */
.wbr-page { padding: 16px 20px; }
.wbr-title { font-size: 16px; font-weight: 700; margin-right: auto; }
.wbr-refresh { margin-left: auto; padding: 4px 12px; border: 1px solid var(--border, #d8e0e8); border-radius: 14px; background: #fff; cursor: pointer; font-size: 12px; color: var(--muted, #536477); white-space: nowrap; }
.wbr-refresh:hover { border-color: var(--accent, #ef7d22); color: var(--accent, #ef7d22); }
.wbr-empty { padding: 40px; text-align: center; color: var(--muted, #94a3b8); font-size: 13px; }
.wbr-table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--border, #e8e8e8); border-radius: 8px; overflow: hidden; font-size: 13px; }
.wbr-table th { text-align: left; padding: 8px 10px; background: var(--surface-2, #f5f7fa); color: var(--muted, #536477); font-size: 12px; border-bottom: 1px solid var(--border, #e8e8e8); }
.wbr-table td { padding: 8px 10px; border-bottom: 1px solid var(--border, #f0f0f0); vertical-align: top; }
.wbr-table tbody tr { cursor: pointer; }
.wbr-table tr:hover td { background: rgba(91,141,239,.03); }
.wbr-td-time { white-space: nowrap; color: var(--muted, #536477); font-size: 12px; }
.wbr-td-obj { white-space: nowrap; }
.wbr-td-id { display: inline-block; margin-left: 6px; color: var(--muted, #94a3b8); font-size: 11px; }
.wbr-td-detail { color: var(--text, #333); max-width: 420px; word-break: break-word; }

/* ===== 处理记录：分类筛选 + 详情弹窗 ===== */
.wbr-cats { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.wbr-cat { padding: 4px 12px; border: 1px solid var(--border, #d8e0e8); border-radius: 14px; background: #fff; cursor: pointer; font-size: 12px; color: var(--muted, #536477); white-space: nowrap; }
.wbr-cat:hover { border-color: var(--accent, #ef7d22); color: var(--accent, #ef7d22); }
.wbr-cat.active { background: var(--accent, #ef7d22); border-color: var(--accent, #ef7d22); color: #fff; font-weight: 600; }
.wbr-cat-n { margin-left: 4px; font-size: 11px; opacity: 0.85; }
.wbr-detail-backdrop { position: fixed; inset: 0; z-index: 300; background: rgba(15, 23, 42, 0.45); display: flex; align-items: center; justify-content: center; padding: 24px; }
.wbr-detail-modal { width: min(760px, 100%); max-height: calc(100vh - 48px); display: flex; flex-direction: column; background: #fff; border-radius: 12px; box-shadow: 0 20px 60px rgba(0,0,0,.28); overflow: hidden; }
.wbr-detail-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--border, #eee); flex-shrink: 0; }
.wbr-detail-head h3 { margin: 0; font-size: 15px; font-weight: 700; }
.wbr-detail-head p { margin: 4px 0 0; font-size: 12px; color: var(--muted, #536477); }
.wbr-detail-close { padding: 4px 12px; border: 1px solid var(--border, #d8e0e8); border-radius: 6px; background: #fff; cursor: pointer; font-size: 12px; color: var(--text, #18324a); flex-shrink: 0; }
.wbr-detail-desc { max-height: 140px; overflow: auto; color: var(--text, #333); font-size: 13px; }
.wbr-fields { display: flex; flex-direction: column; gap: 8px; }
.wbr-field { display: flex; gap: 16px; font-size: 13px; }
.wbr-field-label { flex: 0 0 140px; color: var(--muted, #536477); }
.wbr-field-value { color: var(--text, #333); word-break: break-word; }
.wbr-detail-raw { background: var(--surface-2, #f5f7fa); border-radius: 8px; padding: 8px 14px; }
.wbr-detail-raw summary { cursor: pointer; font-size: 12px; color: var(--accent, #ef7d22); }
.wbr-detail-close:hover { border-color: var(--accent, #ef7d22); color: var(--accent, #ef7d22); }
.wbr-detail-body { flex: 1; overflow-y: auto; padding: 16px 20px; }
.wbr-detail-section { margin-top: 14px; }
.wbr-detail-section h4 { margin: 0 0 6px; font-size: 13px; font-weight: 700; color: var(--text, #18324a); }
.wbr-detail-json { margin: 0; background: rgba(15,23,42,.92); color: #e2e8f0; border-radius: 8px; padding: 12px 14px; font-size: 12px; line-height: 1.55; overflow-x: auto; white-space: pre-wrap; word-break: break-word; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

/* 待办行布局（含AI建议时） */
.todo-item-row { display: flex; align-items: center; gap: 6px; }
.todo-item .ai-bubble { margin-top: 4px; }

.wb-todo-item-main { display: flex; align-items: center; gap: 6px; }
.wb-todo-ai { margin-top: 4px; padding: 4px 8px; font-size: 11px; color: #5f6368; background: #f0f4ff; border-radius: 6px; border-left: 3px solid #4a90d9; line-height: 1.5; }

/* 权限请求卡片 */
.wb-perm-card { margin: 6px 0; border: 1px solid #f0d8a0; border-radius: 8px; background: #fffbe6; overflow: hidden; }
.wb-perm-header { padding: 6px 10px; font-size: 12px; font-weight: 600; color: #b8860b; background: rgba(184,134,11,.06); }
.wb-perm-question { padding: 8px 10px 4px; font-size: 13px; line-height: 1.6; color: #333; }
.wb-perm-question:not(:first-of-type) { border-top: 1px dashed #e8d8a0; margin-top: 4px; }
.wb-perm-options { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 10px 6px; }
.wb-perm-option { padding: 4px 12px; border: 1px solid #d4a017; border-radius: 16px; background: #fff; color: #b8860b; cursor: pointer; font-size: 12px; transition: all .12s; }
.wb-perm-option:hover { background: #fff8e0; border-color: #b8860b; }
.wb-perm-option:active { transform: scale(.96); }
.wb-perm-input-row { display: flex; gap: 6px; padding: 0 10px 8px; }
.wb-perm-input { flex: 1; padding: 4px 8px; border: 1px solid #ddd; border-radius: 6px; font-size: 12px; }
.wb-perm-submit { display: block; width: 100%; padding: 6px 14px; border: none; border-radius: 6px; background: #b8860b; color: #fff; cursor: pointer; font-size: 12px; font-weight: 600; }
.wb-perm-submit:hover { background: #a0760a; }
.wb-perm-submit:disabled { opacity: 0.5; cursor: not-allowed; }
