feat: 完成 issue #133 对话助手增强版(引用溯源/路由分级/DLP 拦截,直连推理服务)

This commit is contained in:
2026-08-05 09:57:53 +08:00
parent 19c832b244
commit faddf24d11
6 changed files with 602 additions and 0 deletions
+63
View File
@@ -0,0 +1,63 @@
/* iAOP 对话助手增强版样式(issue #133)。深色主题,与 chat_widget.html / cockpit 一致。 */
:root {
--bg: #0f172a; --surface: #111c33; --surface-2: #1e293b;
--fg: #e2e8f0; --fg-muted: #94a3b8; --accent: #38bdf8; --warn: #f5a623;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
background: var(--bg); color: var(--fg); }
#app { max-width: 860px; margin: 0 auto; padding: 16px; }
#topbar { display: flex; align-items: center; justify-content: space-between; }
h1 { font-size: 18px; color: var(--accent); margin: 0; }
h1 .sub { font-size: 12px; color: var(--fg-muted); font-weight: 400; }
.hint { font-size: 11px; color: #64748b; }
.dot { font-size: 13px; }
.dot.ok { color: #2ecc71; }
.dot.down { color: #ff3b30; }
#messages { height: 480px; overflow-y: auto; border: 1px solid var(--surface-2);
border-radius: 8px; padding: 12px; background: var(--surface); margin-top: 10px; }
.msg { margin: 10px 0; }
.msg .who { font-size: 12px; color: var(--fg-muted); }
.msg .text { display: inline-block; max-width: 88%; padding: 8px 12px; border-radius: 8px;
white-space: pre-wrap; font-size: 14px; line-height: 1.6; }
.user .text { background: #1d4ed8; }
.bot .text { background: var(--surface-2); }
.meta { font-size: 11px; color: #64748b; margin-top: 3px; display: flex; gap: 8px;
flex-wrap: wrap; align-items: center; }
/* 路由分级标签(本地/云端/拦截) */
.route-tag { padding: 1px 8px; border-radius: 10px; font-size: 11px; }
.route-local { background: rgba(46,204,113,.15); color: #2ecc71; }
.route-cloud { background: rgba(56,189,248,.15); color: var(--accent); }
.route-block { background: rgba(255,59,48,.15); color: #ff3b30; }
.human-tag { background: rgba(245,166,35,.15); color: var(--warn);
padding: 1px 8px; border-radius: 10px; font-size: 11px; }
/* RAG 引用溯源(PRD 5.4 强制) */
.citations { margin-top: 6px; font-size: 12px; border-left: 3px solid var(--accent);
padding: 4px 10px; background: rgba(56,189,248,.06); border-radius: 0 6px 6px 0; }
.citations .cite-title { color: var(--accent); font-size: 11px; margin-bottom: 2px; }
.citations .cite-item { color: var(--fg-muted); margin: 2px 0; }
.no-citation { margin-top: 6px; font-size: 11px; color: #64748b; }
/* 场景输入区 */
.scenario-inputs { display: flex; gap: 8px; margin-top: 10px; align-items: center; }
.scenario-inputs input { flex: 1; }
/* DLP 拦截反馈条 */
#dlp-banner { margin-top: 10px; padding: 10px 12px; border-radius: 8px; font-size: 13px;
background: rgba(255,59,48,.10); border: 1px solid #ff3b30; color: #ffb4ad; }
#dlp-banner button { margin-left: 8px; padding: 4px 10px; font-size: 12px; border: none;
border-radius: 5px; cursor: pointer; background: var(--surface-2);
color: var(--fg); }
#panel { margin-top: 10px; display: flex; gap: 8px; }
select, input { padding: 8px; border-radius: 6px; border: 1px solid #334155;
background: #0b1526; color: var(--fg); }
input { flex: 1; }
button#send { padding: 8px 16px; border: none; border-radius: 6px; background: #0ea5e9;
color: #fff; cursor: pointer; }
button#send:disabled { opacity: .5; }
#footer-hint { margin-top: 8px; }