/* 聊天气泡内嵌内容：表格 / KB 徽标 / 操作表单
   铁律 10.12：自 shared-chat.css 拆出；base.html 中紧跟 shared-chat.css 引入。 */

/* 聊天气泡内嵌表格（版本对比等） */
.wd-chat-message .bubble table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  margin: 6px 0;
}
.wd-chat-message .bubble table th,
.wd-chat-message .bubble table td {
  padding: 4px 6px;
  border: 1px solid rgba(255,255,255,0.15);
  text-align: left;
  white-space: nowrap;
}
.wd-chat-message .bubble table th {
  background: rgba(255,255,255,0.08);
  font-weight: 600;
}
.wd-chat-message.user .bubble table th {
  background: rgba(0,0,0,0.08);
}
.wd-chat-message.user .bubble table th,
.wd-chat-message.user .bubble table td {
  border-color: rgba(0,0,0,0.1);
}
/* 客服气泡内 KB 答案徽标：`.badge-yes` 生产库实测有 4 处命中（scripts/import_qa_*.py 产出、
   由 kb_service 入库）。KB 为**运行期可编辑数据**，故 `badge-no` / `badge-limit` 即使当前
   零命中**也整体保留** —— 它们与 `badge-yes` 同属一张对照表的三个状态，删掉会在管理员
   或后续导入写入该状态时留下无样式文本（2026-09-21 W-2 审计人工判定） */
.wd-chat-message .bubble .badge-yes {
  color: var(--wd-green-500);
  font-weight: 600;
}
.wd-chat-message .bubble .badge-no {
  color: var(--wd-red-500);
}
.wd-chat-message .bubble .badge-limit {
  color: #f59e0b;
}

/* ═══ 聊天气泡内操作表单 ═══ */
.chat-action-card {
  background: var(--wd-light);
  border: 1px solid var(--wd-border);
  border-radius: 10px;
  padding: 14px;
  margin-top: 6px;
  max-width: 360px;
}
.chat-action-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--wd-off-black);
  margin-bottom: 4px;
}
.chat-action-desc {
  font-size: 12px;
  color: var(--wd-slate-light);
  margin-bottom: 10px;
}
.chat-action-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.chat-action-input {
  width: 100%;
  padding: 8px 10px;
  font-size: 13px;
  border: 1px solid var(--wd-border);
  border-radius: 6px;
  background: var(--wd-white);
  color: var(--wd-slate-700);
  outline: none;
  box-sizing: border-box;
  font-family: inherit;
  resize: vertical;
  transition: border-color 0.15s;
}
.chat-action-input:focus {
  border-color: var(--wd-chat-green);
  box-shadow: 0 0 0 2px rgba(45,106,79,0.12);
}
.chat-action-input::placeholder {
  color: var(--wd-slate-300);
}
.chat-action-btn {
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  background: linear-gradient(135deg, var(--wd-chat-green-deep), var(--wd-chat-green));
  color: var(--wd-white);
  align-self: flex-start;
  transition: opacity 0.15s;
}
.chat-action-btn:hover {
  opacity: 0.9;
}
.chat-action-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.chat-action-result {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 13px;
  line-height: 1.5;
}
.chat-action-success {
  background: var(--wd-success-light);
  border: 1px solid var(--wd-green-200);
}
.chat-action-error {
  background: var(--wd-danger-light);
  border: 1px solid var(--wd-red-200);
  color: var(--wd-danger);
}
