/* ── 知微通用 AI 对话框 v1.0 ──
 * 所有专题页引用:
 * <link rel="stylesheet" href="/ai-docs/css/ai-chat.css">
 * <script src="/ai-docs/js/ai-chat.js"></script>
 * 配置: window.wikiChatConfig = { topicId, welcomeHTML, sections }
 */
#bz-btn{position:fixed;bottom:24px;right:24px;z-index:9999;width:52px;height:52px;border-radius:50%;background:linear-gradient(135deg,#2563eb,#3b82f6);color:#fff;border:none;cursor:pointer;box-shadow:0 4px 16px rgba(37,99,235,0.25);font-size:22px;display:flex;align-items:center;justify-content:center}
#bz-btn:active{transform:scale(0.94)}
#bz-p{position:fixed;bottom:88px;right:24px;z-index:9998;width:400px;height:580px;background:#fff;border-radius:14px;box-shadow:0 8px 40px rgba(0,0,0,0.1);border:1px solid rgba(0,0,0,0.06);display:none;flex-direction:column;overflow:hidden}
#bz-p.s{display:flex}
#bz-p .zh{height:36px;display:flex;align-items:center;justify-content:space-between;padding:0 10px 0 14px;border-bottom:1px solid #f0f0f0;flex-shrink:0;background:#fff}
#bz-p .zh .zt{font-size:12px;font-weight:600;color:#1e293b}
#bz-p .zh .zm{font-size:10px;color:#94a3b8;cursor:pointer;padding:2px 7px;border-radius:8px;background:#f1f5f9}
#bz-p .zh .zm:hover{background:#e2e8f0}
#bz-p .zh .zx{background:none;border:none;color:#94a3b8;cursor:pointer;font-size:15px;padding:2px 4px}
#bz-p .zh .zx:hover{color:#475569}
#bzSt{display:none;align-items:center;gap:4px;font-size:10px;color:#2563eb;margin-left:8px}
#bzSt .sd{width:6px;height:6px;border-radius:50%;background:#2563eb;animation:bS 1s infinite}
@keyframes bS{0%{opacity:0.3}50%{opacity:1}100%{opacity:0.3}}
#bz-ms{flex:1;overflow-y:auto;padding:8px 12px;background:#f5f6f8;scrollbar-width:thin}
#bz-ms::-webkit-scrollbar{width:3px}#bz-ms::-webkit-scrollbar-thumb{background:#d1d5db;border-radius:2px}
#bz-w{padding:18px 14px;background:#fff;border-radius:10px;box-shadow:0 1px 3px rgba(0,0,0,0.04);margin:8px 0;font-size:13px;line-height:1.7;color:#1e293b}
#bz-ms .g{margin-bottom:10px;display:flex;align-items:flex-start;gap:6px}
#bz-ms .g.ar{flex-direction:row-reverse}
#bz-ms .g .av{width:26px;height:26px;border-radius:50%;flex-shrink:0;display:flex;align-items:center;justify-content:center;font-size:11px;margin-top:2px}
#bz-ms .g .av.a{border:1px solid #e2e8f0;background:#fff;color:#2563eb}
#bz-ms .g .av.u{background:#2563eb;color:#fff;font-size:10px}
#bz-ms .g .bb{max-width:88%;padding:8px 12px;border-radius:12px;font-size:13px;line-height:1.6;word-wrap:break-word}
#bz-ms .g .bb.a{background:#fff;box-shadow:0 1px 2px rgba(0,0,0,0.04);color:#1e293b;border-bottom-left-radius:4px}
#bz-ms .g .bb.u{background:#2563eb;color:#fff;border-bottom-right-radius:4px;font-size:13px}
#bz-ms .g .bb.a code{background:#f1f5f9;padding:1px 4px;border-radius:3px;font-size:11px}
#bz-ms .g .bb.a a{color:#2563eb}
#bz-ms .g .bb.a.ty::after{content:'▍';animation:bl 0.8s step-end infinite;color:#2563eb}
@keyframes bl{50%{opacity:0}}
#bz-ms .g .bb.a .bt{display:inline-block;margin:2px;padding:3px 9px;border-radius:10px;font-size:10px;background:#eff6ff;color:#2563eb;border:1px solid #bfdbfe;cursor:pointer}
#bz-ms .g .bb.a .bt:hover{background:#2563eb;color:#fff}
#bz-ms .g .bb.a .dd{display:flex;gap:4px;padding:3px 0}
#bz-ms .g .bb.a .dd span{width:6px;height:6px;border-radius:50%;background:#cbd5e1;animation:db 1.2s infinite}
#bz-ms .g .bb.a .dd span:nth-child(2){animation-delay:.2s}#bz-ms .g .bb.a .dd span:nth-child(3){animation-delay:.4s}
@keyframes db{0%,60%,100%{transform:translateY(0)}30%{transform:translateY(-5px)}}
#bz-in{display:flex;padding:8px 10px;border-top:1px solid #f0f0f0;background:#fff;gap:6px;flex-shrink:0}
#bz-in input{flex:1;border:1px solid #e2e8f0;border-radius:20px;padding:7px 12px;font-size:12px;outline:none;background:#f8fafc}
#bz-in input:focus{border-color:#2563eb;background:#fff}
#bz-in button{width:30px;height:30px;border-radius:50%;background:#2563eb;color:#fff;border:none;cursor:pointer;font-size:12px;display:flex;align-items:center;justify-content:center;flex-shrink:0}
#bz-in button:disabled{opacity:0.4}
@media(max-width:500px){#bz-p{width:calc(100vw - 32px);right:16px;height:64vh}}
