/* ============================================================
   一合元商操作台 · 视觉层（蓝灰现代简约风）
   类名保持与渲染器契约一致；仅升级观感：圆角 / 阴影 / 留白。
   ============================================================ */

:root{
  --brand:#1e3a8a; --brand2:#2563eb; --brand-soft:#eff6ff;
  --bg:#f4f6fb; --side:#f8fafc; --text:#0f172a; --muted:#475569;
  --faint:#94a3b8; --border:#e2e8f0; --line:#eef2f7;
  --danger:#dc2626; --danger-soft:#fef2f2;
  --ok:#16a34a; --ok-soft:#f0fdf4; --warn:#d97706; --warn-soft:#fffbeb;
  --radius:12px;
}
*{ box-sizing:border-box; }
html,body{ margin:0; height:100%; }
body{
  font-family:"Microsoft YaHei","PingFang SC",system-ui,-apple-system,sans-serif;
  background:var(--bg); color:var(--text); font-size:14px;
  -webkit-font-smoothing:antialiased;
}
.app{ display:flex; flex-direction:column; height:100vh; }

/* ---------- 顶栏 ---------- */
.topbar{
  height:56px; flex:0 0 56px; background:#fff;
  border-bottom:1px solid var(--border);
  display:flex; align-items:center; justify-content:space-between; padding:0 20px;
}
.topbar-left{ display:flex; align-items:center; gap:12px; }
.brand{ display:flex; align-items:center; gap:10px; }
.brand-logo{
  width:32px; height:32px; border-radius:10px;
  background:linear-gradient(135deg,#3b82f6,#1e3a8a); color:#fff;
  display:flex; align-items:center; justify-content:center; font-weight:700; font-size:16px;
  box-shadow:0 4px 10px rgba(37,99,235,.28);
}
.brand-name{ font-size:17px; font-weight:700; color:var(--brand); letter-spacing:.5px; }
.brand-sub{ font-size:12px; color:var(--faint); border-left:1px solid var(--border); padding-left:10px; }
.topbar-right{ display:flex; align-items:center; gap:8px; }
.operator{ color:var(--muted); font-size:13px; margin-left:6px; }
.dot{
  font-size:11px; color:var(--faint); background:#f1f5f9;
  border-radius:999px; padding:3px 10px; border:1px solid var(--border); font-weight:500;
}
.dot.ok{ color:var(--ok); border-color:#bbf7d0; background:var(--ok-soft); }
.dot.bad{ color:var(--danger); border-color:#fecaca; background:var(--danger-soft); }
.icon-btn{
  background:none; border:none; cursor:pointer; font-size:17px; color:var(--muted);
  border-radius:10px; width:34px; height:34px; transition:background .15s ease,color .15s ease;
}
.icon-btn:hover{ background:var(--brand-soft); color:var(--brand2); }

/* ---------- 布局骨架 ---------- */
.body{ flex:1; display:flex; min-height:0; }
.sidebar{
  width:244px; flex:0 0 244px; background:var(--side);
  border-right:1px solid var(--border); padding:14px 10px;
  overflow-y:auto; transition:width .18s ease;
}
.side-label{ font-size:11px; color:var(--faint); padding:8px 12px 6px; letter-spacing:1.5px; font-weight:600; }
.side-sep{ height:1px; background:var(--border); margin:12px 10px; }
.sidebar nav{ display:flex; flex-direction:column; gap:3px; }
.side-btn{
  display:flex; align-items:center; gap:11px; width:100%; text-align:left;
  background:none; border:none; cursor:pointer; padding:10px 12px;
  border-radius:10px; color:var(--muted); font-size:14px; position:relative;
  transition:background .15s ease,color .15s ease;
}
.side-btn:hover{ background:#e8effc; color:var(--brand); }
.side-btn.active{ background:#fff; color:var(--brand); font-weight:600; box-shadow:0 1px 3px rgba(15,23,42,.10); }
.sb-icon{ width:20px; text-align:center; font-size:15px; }
.badge{
  margin-left:auto; min-width:19px; height:19px; line-height:19px; padding:0 6px;
  border-radius:999px; background:var(--danger); color:#fff; font-size:11px;
  font-weight:700; text-align:center;
}
.app.collapsed .sidebar{ width:60px; flex-basis:60px; }
.app.collapsed .sb-text,.app.collapsed .side-label,.app.collapsed .history-list,.app.collapsed .brand-sub{ display:none; }
.app.collapsed .side-btn{ justify-content:center; }
.app.collapsed .badge{ position:absolute; top:3px; right:3px; margin:0; }

/* ---------- 历史任务 ---------- */
.history-list{ padding:0 4px; }
.history-item{
  font-size:12.5px; color:var(--muted); padding:8px 10px; border-radius:9px;
  cursor:pointer; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.history-item:hover{ background:#e8effc; }
.history-item.active{ background:#fff; color:var(--text); box-shadow:0 1px 3px rgba(15,23,42,.08); font-weight:500; }
.history-empty{ font-size:12px; color:var(--faint); padding:8px 12px; }

/* ---------- 主区域 / 通用卡片 ---------- */
.main{ flex:1; overflow-y:auto; padding:24px; min-width:0; }
.view-card{
  background:#fff; border:1px solid var(--border);
  border-radius:16px; box-shadow:0 1px 3px rgba(15,23,42,.06);
  padding:22px; margin-bottom:18px;
}
.view-head{ display:flex; align-items:center; gap:12px; margin-bottom:16px; }
.view-head h2{ margin:0; font-size:18px; font-weight:700; }
.hint{ color:var(--faint); font-size:13px; }

/* ---------- 按钮 ---------- */
.btn{
  border:none; border-radius:10px; padding:8px 16px; cursor:pointer;
  font-size:13px; font-weight:500; transition:background .15s ease,box-shadow .15s ease,transform .05s ease;
}
.btn:active{ transform:translateY(1px); }
.btn-primary{ background:var(--brand2); color:#fff; box-shadow:0 1px 2px rgba(37,99,235,.25); }
.btn-primary:hover{ background:var(--brand); }
.btn-secondary{ background:#f1f5f9; color:#334155; border:1px solid var(--border); }
.btn-secondary:hover{ background:#e2e8f0; }
.btn-ghost{ background:#fff; color:var(--brand2); border:1px solid var(--border); padding:6px 12px; }
.btn-ghost:hover{ background:var(--brand-soft); border-color:#bfdbfe; }
.btn:disabled{ opacity:.5; cursor:not-allowed; }
.btn-sm{ padding:4px 12px; font-size:12px; border-radius:8px; }
.btn-link{ background:transparent; border:none; color:#64748b; cursor:pointer; font-size:13px; padding:2px 6px; }
.btn-link:hover{ color:var(--brand2); text-decoration:underline; }
.topbar-right .operator{ white-space:nowrap; }

/* ---------- 工具条 ---------- */
.toolbar{ display:flex; gap:10px; flex-wrap:wrap; align-items:center; margin-bottom:16px; }
.toolbar input,.toolbar select{
  padding:8px 12px; border:1px solid var(--border); border-radius:10px;
  font-size:13px; background:#fff; outline:none; transition:border-color .15s ease,box-shadow .15s ease;
}
.toolbar input:focus,.toolbar select:focus{ border-color:#93c5fd; box-shadow:0 0 0 3px rgba(59,130,246,.12); }
.grow{ flex:1; min-width:160px; }

/* ---------- 数据表格 ---------- */
.tbl{ width:100%; border-collapse:separate; border-spacing:0; font-size:13px; }
.tbl th{
  text-align:left; background:#f8fafc; color:var(--muted); font-weight:600;
  padding:10px 14px; border-bottom:1px solid var(--border); white-space:nowrap;
}
.tbl th:first-child{ border-top-left-radius:12px; }
.tbl th:last-child{ border-top-right-radius:12px; }
.tbl td{ padding:10px 14px; border-bottom:1px solid var(--line); }
.tbl tbody tr{ transition:background .12s ease; }
.tbl tbody tr:nth-child(even){ background:#fbfcfe; }
.tbl tbody tr:hover{ background:var(--brand-soft); cursor:pointer; }
.tags{ display:flex; gap:4px; flex-wrap:wrap; }
.tag{ background:var(--brand-soft); color:var(--brand); border-radius:999px; padding:2px 10px; font-size:11px; font-weight:500; }
.tag.warn{ background:var(--warn-soft); color:#92400e; }
.tag.gray{ background:#f1f5f9; color:#64748b; }
.tag.green{ background:#dcfce7; color:#166534; }
.tag.red{ background:#fee2e2; color:#991b1b; }
/* ============================================================
   对话视图（重点）
   ============================================================ */
.chat-wrap{ display:flex; flex-direction:column; height:calc(100vh - 56px - 48px); }
.chat-scroll{ flex:1; overflow-y:auto; padding:12px 8px 20px; }

/* 欢迎区 */
.welcome{ text-align:center; padding:48px 20px 24px; max-width:760px; margin:0 auto; }
.welcome-logo{
  font-size:40px; width:72px; height:72px; line-height:72px; margin:0 auto 14px;
  border-radius:22px; background:#fff; box-shadow:0 8px 24px rgba(37,99,235,.12);
}
.welcome h2{ color:var(--brand); margin:12px 0 6px; font-size:24px; }
.welcome-sub{ color:var(--muted); font-size:14px; line-height:1.7; }
.stat-cards{ display:grid; grid-template-columns:repeat(4,minmax(120px,1fr)); gap:14px; max-width:640px; margin:26px auto 0; }
.mini-stat{
  background:#fff; border:1px solid var(--border); border-radius:16px;
  padding:16px 18px; cursor:pointer; text-align:left;
  box-shadow:0 1px 3px rgba(15,23,42,.05);
  transition:box-shadow .18s ease,transform .18s ease,border-color .18s ease;
}
.mini-stat:hover{ box-shadow:0 12px 28px rgba(15,23,42,.10); transform:translateY(-2px); border-color:#bfdbfe; }
.ms-num{ font-size:26px; font-weight:700; color:var(--brand); line-height:1.2; }
.ms-label{ font-size:12px; color:var(--faint); margin-top:2px; }
.suggestions{ display:flex; gap:10px; justify-content:center; flex-wrap:wrap; margin:22px auto 0; max-width:680px; }
.suggestion{
  background:#fff; border:1px solid var(--border); border-radius:999px;
  padding:9px 18px; font-size:13px; color:var(--muted); cursor:pointer;
  transition:border-color .15s ease,color .15s ease,box-shadow .15s ease;
  box-shadow:0 1px 2px rgba(15,23,42,.04);
}
.suggestion:hover{ border-color:#93c5fd; color:var(--brand2); box-shadow:0 4px 12px rgba(37,99,235,.10); }

/* 消息气泡 */
.messages{ max-width:860px; margin:0 auto; display:flex; flex-direction:column; gap:16px; padding:8px 12px; }
.msg{
  max-width:76%; padding:12px 16px; border-radius:20px;
  line-height:1.7; white-space:pre-wrap; word-break:break-word;
  font-size:14px; box-shadow:0 1px 2px rgba(15,23,42,.05);
}
.msg.user{ align-self:flex-end; background:linear-gradient(135deg,#3b82f6,#2563eb); color:#fff; border-bottom-right-radius:7px; }
.msg.bot{ align-self:flex-start; background:#fff; color:var(--text); border:1px solid var(--border); border-bottom-left-radius:7px; }
.msg-meta{ display:block; font-size:11px; opacity:.75; margin-top:8px; }

/* 对话内业务卡片 */
.biz-card{
  margin-top:12px; border-top:1px solid var(--line);
  padding:12px 14px; text-align:left;
  background:rgba(248,250,252,.7); border-radius:12px;
}
.msg.user .biz-card{ background:rgba(255,255,255,.14); border-top-color:rgba(255,255,255,.28); }
.biz-card-title{ font-weight:700; margin-bottom:8px; font-size:13.5px; }
.biz-row{ display:flex; justify-content:space-between; gap:12px; font-size:13px; padding:4px 0; }
.biz-card .btn{ margin-top:10px; }

/* 输入区：悬浮卡片 */
.composer{
  display:flex; gap:10px; align-items:center;
  background:#fff; border:1px solid var(--border); border-radius:16px;
  padding:10px 14px; margin:14px auto 0; max-width:860px; width:100%;
  box-shadow:0 8px 28px rgba(15,23,42,.10);
}
.chat-input{ flex:1; border:none; outline:none; font-size:14px; background:transparent; color:var(--text); resize:none; max-height:120px; line-height:1.5; font-family:inherit; padding:6px 0; }
textarea.chat-input{ display:block; }
.chat-input::placeholder{ color:#aab4c2; }
.file-hint{ font-size:12px; color:var(--brand2); white-space:nowrap; max-width:160px; overflow:hidden; text-overflow:ellipsis; }

/* ---------- 功能中心：竖版开关列表 ---------- */
.plugin-list{ display:flex; flex-direction:column; gap:12px; max-height:calc(100vh - 240px); overflow-y:auto; padding-right:4px; }
.plugin-row{
  display:flex; align-items:center; gap:16px; width:100%;
  background:#fff; border:1px solid var(--border); border-radius:14px;
  padding:14px 18px; box-shadow:0 1px 3px rgba(15,23,42,.04);
  transition:box-shadow .18s ease,border-color .18s ease,transform .18s ease;
}
.plugin-row:hover{ box-shadow:0 10px 24px rgba(15,23,42,.08); border-color:#cbd5e1; transform:translateY(-1px); }
.plugin-row__icon{
  font-size:20px; flex:0 0 auto; width:42px; height:42px; line-height:42px; text-align:center;
  border-radius:12px; background:var(--brand-soft);
}
.plugin-row__name{ font-weight:600; font-size:14px; flex:0 0 130px; white-space:nowrap; }
.plugin-row__desc{ flex:1; min-width:0; color:var(--faint); font-size:12.5px; line-height:1.5; }
.plugin-row__toggle{ flex:0 0 auto; display:flex; align-items:center; gap:10px; }
.switch-label{ font-size:12px; color:var(--faint); min-width:42px; }
.switch{ position:relative; display:inline-block; width:42px; height:24px; border-radius:999px; background:#cbd5e1; transition:background .18s ease; cursor:default; }
.switch__knob{ position:absolute; top:3px; left:3px; width:18px; height:18px; border-radius:50%; background:#fff; box-shadow:0 1px 3px rgba(0,0,0,.3); transition:left .18s ease; }
.switch.is-on{ background:var(--ok); }
.switch.is-on .switch__knob{ left:21px; }

/* ---------- 原始数据展示 ---------- */
.out-json{
  background:#f8fafc; border:1px solid var(--border); border-radius:12px;
  padding:12px; font-size:12.5px; white-space:pre-wrap; word-break:break-word;
  max-height:340px; overflow:auto; font-family:ui-monospace,Consolas,monospace;
}

/* ---------- 审核工作台 ---------- */
.review-tabs{ display:flex; gap:8px; margin-bottom:16px; }
.rtab{ padding:8px 18px; border-radius:999px; border:1px solid var(--border); background:#fff; cursor:pointer; font-size:13px; color:var(--muted); transition:all .15s ease; }
.rtab:hover{ border-color:#93c5fd; color:var(--brand2); }
.rtab.active{ background:var(--brand2); color:#fff; border-color:var(--brand2); }
.rs-cards{ display:grid; grid-template-columns:repeat(auto-fit,minmax(150px,1fr)); gap:12px; margin-bottom:18px; }
.rs-pill{ background:#fff; border:1px solid var(--border); border-radius:14px; padding:12px 16px; font-size:13px; color:var(--muted); box-shadow:0 1px 2px rgba(15,23,42,.04); }
.rs-pill b{ font-size:22px; display:block; color:var(--brand); margin-top:2px; }
.review-item{ border:1px solid var(--border); border-radius:14px; padding:16px 18px; margin-bottom:12px; background:#fff; box-shadow:0 1px 2px rgba(15,23,42,.04); transition:box-shadow .15s ease; }
.review-item:hover{ box-shadow:0 6px 18px rgba(15,23,42,.07); }
.ri-head{ display:flex; justify-content:space-between; gap:10px; font-size:12px; color:var(--faint); margin-bottom:8px; }
.ri-title{ font-weight:600; margin-bottom:6px; }
.ri-desc{ color:var(--muted); font-size:13px; margin-bottom:12px; line-height:1.6; }
.ri-actions{ display:flex; gap:8px; flex-wrap:wrap; }

/* ---------- 详情抽屉 ---------- */
.drawer{
  position:fixed; top:56px; right:0; bottom:0; width:460px; max-width:92vw;
  background:#fff; z-index:40; box-shadow:-8px 0 32px rgba(15,23,42,.14);
  transform:translateX(100%); transition:transform .22s ease;
  display:flex; flex-direction:column;
}
.drawer.open{ transform:translateX(0); }
.drawer-head{ display:flex; justify-content:space-between; align-items:center; padding:18px 20px; border-bottom:1px solid var(--border); }
.drawer-head h3{ margin:0; font-size:16px; }
.drawer-body{ padding:20px; overflow-y:auto; }
.drawer-mask{ position:fixed; inset:56px 0 0 0; background:rgba(15,23,42,.28); z-index:39; backdrop-filter:blur(1px); }
.d-section{ margin-bottom:20px; }
.d-section h4{ margin:0 0 10px; font-size:14px; }
.kv{ display:flex; justify-content:space-between; gap:14px; padding:8px 0; border-bottom:1px solid var(--line); font-size:13px; }
.kv span:first-child{ color:var(--faint); white-space:nowrap; }
.kv span:last-child{ text-align:right; word-break:break-word; }
.kv input{ padding:6px 10px; border:1px solid var(--border); border-radius:8px; font-size:13px; outline:none; }
.kv input:focus{ border-color:#93c5fd; box-shadow:0 0 0 3px rgba(59,130,246,.12); }
iframe.pdf{ width:100%; height:60vh; border:1px solid var(--border); border-radius:12px; }

/* ---------- 弹窗 ---------- */
.modal-mask{ position:fixed; inset:0; background:rgba(15,23,42,.45); z-index:60; display:flex; align-items:center; justify-content:center; backdrop-filter:blur(2px); }
.modal{ background:#fff; border-radius:18px; width:380px; max-width:90vw; padding:24px; box-shadow:0 24px 60px rgba(15,23,42,.25); }
.modal-title{ font-size:16px; font-weight:700; margin-bottom:12px; }
.modal-body{ color:var(--muted); font-size:13.5px; margin-bottom:20px; white-space:pre-wrap; line-height:1.6; }
.modal-actions{ display:flex; justify-content:flex-end; gap:10px; }
.toast{ position:fixed; top:22px; left:50%; transform:translateX(-50%); z-index:80; padding:11px 22px; border-radius:12px; color:#fff; font-size:13.5px; box-shadow:0 10px 30px rgba(15,23,42,.22); }
.toast.ok{ background:var(--ok); } .toast.err{ background:var(--danger); }
.hidden{ display:none !important; }
/* ============================================================
   助手对话面板（功能中心内嵌）
   ============================================================ */
.ag-chat{ display:flex; flex-direction:column; gap:10px; padding:14px; border:1px solid var(--border); border-radius:14px; background:#fff; }
.ag-msg{ padding:10px 14px; border-radius:16px; max-width:92%; white-space:normal; word-break:break-word; line-height:1.7; font-size:13.5px; font-family:inherit; }
.ag-user{align-self:flex-end;background:linear-gradient(135deg,#3b82f6,#2563eb);color:#fff;border-bottom-right-radius:6px;}
.ag-bot{align-self:flex-start;background:#f6f8fb;color:var(--text);border:1px solid var(--border);border-bottom-left-radius:6px;}
.ag-tool{ margin-top:8px; padding:9px 12px; border-radius:10px; background:var(--brand-soft); border-left:3px solid var(--brand2); font-size:12px; line-height:1.6; }
.ag-tool.ag-err{ background:var(--danger-soft); border-left-color:var(--danger); }
.ag-tool.ag-skip{ background:#f5f3ff; border-left-color:#8b5cf6; }
.ag-tool.ag-ok{ background:var(--brand-soft); }
.ag-quick{ display:flex; flex-wrap:wrap; gap:8px; margin:10px 0; }
.ag-analysis{ margin-bottom:10px; padding:10px 12px; border-radius:12px; background:var(--warn-soft); border-left:3px solid var(--warn); font-size:13px; line-height:1.6; }
.ag-chat-panel{ max-height:48vh; overflow:auto; }
.ag-step-line{ margin:8px 0; }
.ag-final{ margin-top:8px; line-height:1.7; }

/* ============================================================
   通用媒体 / 记录卡片（聊天卡 / 列表卡 / 推荐卡 统一观感）
   ============================================================ */
.record-card-list{ margin-top:10px; display:flex; flex-direction:column; gap:8px; }
.record-card{
  display:flex; align-items:center; gap:14px; padding:12px 14px;
  border:1px solid var(--border); border-radius:14px; margin-bottom:0;
  background:#fff; box-shadow:0 1px 2px rgba(15,23,42,.04);
  transition:box-shadow .15s ease,border-color .15s ease;
}
.record-card:hover{ box-shadow:0 8px 22px rgba(15,23,42,.08); border-color:#cbd5e1; }
.record-card__body{ flex:1; min-width:0; }
.record-card__title{ font-weight:600; margin-bottom:4px; overflow:hidden; text-overflow:ellipsis; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; line-height:1.45; }
.record-card__headline{ color:var(--danger); font-weight:700; }
.record-card__platform{ font-size:12px; color:var(--faint); font-weight:400; margin-left:8px; }
.record-card__meta{ font-size:12px; color:#64748b; margin-top:4px; }
.media-thumb{ width:64px; height:64px; object-fit:cover; border-radius:12px; flex:0 0 64px; background:#f1f5f9; }
.media-thumb--lg{ width:72px; height:72px; flex-basis:72px; }
.media-thumb--row{ width:44px; height:44px; flex:0 0 44px; border-radius:10px; background:#f1f5f9; vertical-align:middle; }
.cell-title{ max-width:340px; }
.card-actions{ margin-top:8px; }

/* 百分比徽标（由后端 tone 驱动） */
.badge-percentage{ display:inline-block; margin-right:6px; padding:2px 8px; border-radius:999px; background:var(--danger); color:#fff; font-size:11px; font-weight:600; vertical-align:middle; }
.badge-neutral{ display:inline-block; margin-right:6px; padding:2px 8px; border-radius:999px; background:#e2e8f0; color:#475569; font-size:11px; font-weight:600; vertical-align:middle; }

/* 迷你走势 */
.cell-interactive{ cursor:pointer; white-space:nowrap; display:inline-block; }
.sparkline{ display:inline-flex; align-items:center; gap:5px; font-size:12px; }
.sparkline b{ font-weight:600; }
.sparkline__bars{ display:inline-flex; align-items:flex-end; gap:2px; height:22px; }
.sparkline .chart-bar{ width:4px; background:#94a3b8; border-radius:1px; display:inline-block; }
.is-down{ color:var(--danger); } .is-down .chart-bar{ background:#fca5a5; }
.is-up{ color:var(--ok); } .is-up .chart-bar{ background:#86efac; }
.is-flat{ color:#64748b; }

/* 详情弹窗 + 柱状图（level 驱动） */
.detail-modal{ width:720px; max-width:92vw; max-height:86vh; overflow:auto; background:#fff; border-radius:18px; padding:22px 24px; box-shadow:0 24px 60px rgba(15,23,42,.25); }
.detail-modal__head{ display:flex; justify-content:space-between; align-items:center; margin-bottom:14px; }
.detail-modal__head h3{ margin:0; font-size:16px; }
.detail-modal__subject{ display:flex; gap:14px; align-items:flex-start; padding-bottom:14px; border-bottom:1px solid var(--line); margin-bottom:16px; }
.detail-modal__stats{ display:flex; gap:20px; flex-wrap:wrap; margin-top:8px; font-size:13px; color:var(--muted); }
.detail-modal__stats b{ color:var(--text); }
.detail-modal__stats small{ color:var(--faint); }
.detail-modal__foot{ margin-top:16px; text-align:right; }
.barchart{ display:flex; align-items:flex-end; gap:12px; min-height:190px; padding:16px 8px 0; overflow-x:auto; border-bottom:1px solid var(--line); }
.barchart__col{ display:flex; flex-direction:column; align-items:center; gap:5px; min-width:46px; }
.barchart .chart-bar{ width:26px; background:linear-gradient(180deg,#60a5fa,#2563eb); border-radius:6px 6px 0 0; display:inline-block; }
.chart-bar--extreme{ background:linear-gradient(180deg,#f87171,#dc2626) !important; }
.chart-bar--current{ outline:2px solid var(--warn); outline-offset:1px; }
.chart-bar__value{ font-size:11px; color:#334155; }
.chart-bar__label{ font-size:10px; color:#94a3b8; }

/* 迷你走势离散层级（高度由类名固定） */
.sparkline .chart-bar--l0{ height:4px; }
.sparkline .chart-bar--l1{ height:8px; }
.sparkline .chart-bar--l2{ height:12px; }
.sparkline .chart-bar--l3{ height:17px; }
.sparkline .chart-bar--l4{ height:22px; }

/* 弹窗柱状图离散层级 */
.barchart .chart-bar--l0{ height:30px; }
.barchart .chart-bar--l1{ height:52px; }
.barchart .chart-bar--l2{ height:74px; }
.barchart .chart-bar--l3{ height:96px; }
.barchart .chart-bar--l4{ height:118px; }
.barchart .chart-bar--l5{ height:140px; }

/* ---------- 语义化工具类（替代内联 style） ---------- */
.mt-2{ margin-top:8px; } .mt-3{ margin-top:12px; } .mt-4{ margin-top:16px; }
.w-sm{ width:90px; } .w-md{ width:120px; } .w-lg{ width:160px; }
.text-warn{ color:var(--warn); }
.text-danger{ color:#991b1b; }
.cursor-default{ cursor:default; }
/* ---------- 响应式 ---------- */
@media(max-width:768px){
  .sidebar{ width:60px; flex-basis:60px; padding:12px 6px; }
  .sb-text,.side-label,.history-list,.brand-sub{ display:none; }
  .side-btn{ justify-content:center; padding:10px; }
  .badge{ position:absolute; top:3px; right:3px; margin:0; }
  .main{ padding:14px; }
  .drawer{ width:100%; max-width:100%; }
  .msg{ max-width:88%; }
  .stat-cards{ grid-template-columns:repeat(2,1fr); }
  .plugin-row__name{ flex-basis:96px; }
  .plugin-row__desc{ display:none; }
}
/* Automation console external nav entry (static link to standalone page). */
.nav-external .side-btn { width: 100%; text-decoration: none; color: inherit; text-align: left; }
.nav-external .side-btn:hover { color: inherit; }
/* ===== Chat-driven automation cards ===== */
.chat-card {
  margin-top: 10px; border: 1px solid #e8ecf1; border-radius: 14px;
  overflow: hidden; background: #fff; box-shadow: 0 1px 3px rgba(15,23,42,.06);
  max-width: 420px;
}
.chat-card .card-header {
  padding: 10px 14px; font-weight: 600; font-size: 13px;
  background: #f5f8ff; color: #1d4ed8; border-bottom: 1px solid #eef2f8;
}
.chat-card .card-body { padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.ac-field { display: flex; gap: 10px; font-size: 13px; line-height: 1.5; }
.ac-k { color: #7a8699; min-width: 64px; flex-shrink: 0; }
.ac-v { color: #1f2733; word-break: break-word; }
.chat-card .card-actions {
  display: flex; gap: 8px; padding: 12px 14px; border-top: 1px solid #eef2f8;
}
.chat-card .card-actions .btn { flex: 0 0 auto; }
.btn-ghost {
  background: #fff; border: 1px solid #d9dfe8; color: #475569;
}
.btn-ghost:hover { border-color: #1890ff; color: #1890ff; }
.ac-error { margin: 10px 14px 0; color: #cf1318; font-size: 12.5px; }
.ac-open { display: inline-block; margin: 10px 14px 12px; font-size: 12.5px; color: #1890ff; text-decoration: none; }

.progress-steps { padding: 12px 14px 4px; display: flex; flex-direction: column; gap: 8px; }
.progress-step { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #9aa4b2; }
.progress-step .ps-icon { width: 18px; display: inline-flex; justify-content: center; }
.progress-step.completed { color: #2b8a0e; }
.progress-step.active { color: #096dd9; font-weight: 600; }
.progress-step.active .ps-icon { animation: ac-spin 1.1s linear infinite; display: inline-flex; }
@keyframes ac-spin { to { transform: rotate(360deg); } }

.quick-replies {
  display: flex; gap: 8px; flex-wrap: wrap; padding: 10px 16px 0;
  max-width: 860px; margin: 0 auto;
}
.qr-chip {
  border: 1px solid #bcdcff; background: #f0f8ff; color: #096dd9;
  border-radius: 999px; padding: 6px 14px; font-size: 12.5px; cursor: pointer;
  transition: background .15s ease;
}
.qr-chip:hover { background: #dcefff; }

/* Recommendation preview card (double confirm before job creation) */
.proposal-preview-card .pp-meta {
  font-size: 12.5px; color: var(--muted, #64748b); margin-bottom: 8px;
}
.proposal-preview-card .pp-items { display: flex; flex-direction: column; gap: 8px; }
.proposal-preview-card .pp-item {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 10px;
  padding: 8px 10px; border: 1px solid #eef2f7; border-radius: 12px; background: #f8fafc;
}
.proposal-preview-card .pp-item.ext { background: #fffbeb; border-color: #fde68a; }
.proposal-preview-card .pp-item-main { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
.proposal-preview-card .pp-cat { font-size: 12px; color: #64748b; }
.proposal-preview-card .pp-name { font-size: 13.5px; color: #0f172a; }
.proposal-preview-card .pp-src {
  font-size: 11px; padding: 1px 8px; border-radius: 999px; white-space: nowrap;
}
.proposal-preview-card .pp-src-in { background: #dcfce7; color: #166534; }
.proposal-preview-card .pp-src-ext { background: #fef3c7; color: #b45309; }
.proposal-preview-card .pp-link { font-size: 12px; color: #2563eb; text-decoration: none; }
.proposal-preview-card .pp-link:hover { text-decoration: underline; }
.proposal-preview-card .pp-item-right { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; white-space: nowrap; }
.proposal-preview-card .pp-qty { font-size: 12px; color: #64748b; }
.proposal-preview-card .pp-price { font-size: 13.5px; font-weight: 600; color: #0f172a; }
.proposal-preview-card .pp-missing-box { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.proposal-preview-card .pp-missing {
  font-size: 12px; padding: 3px 10px; border-radius: 999px; background: #fee2e2; color: #b91c1c;
}
.proposal-preview-card .pp-total {
  display: flex; align-items: center; gap: 8px; margin-top: 12px;
  padding-top: 10px; border-top: 1px dashed #e2e8f0; font-size: 14px; color: #0f172a;
}
.proposal-preview-card .pp-total b { font-size: 16px; }
.proposal-preview-card .pp-over { color: #dc2626; font-size: 12.5px; }
.proposal-preview-card .pp-hint { margin-left: auto; font-size: 11.5px; color: #94a3b8; }
