*,*:before,*:after{box-sizing:border-box}body{margin:0;padding:0;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif}a{color:#3a6cc8;text-decoration:none}a:hover{text-decoration:underline}button{cursor:pointer;font-family:inherit}*,*:before,*:after{box-sizing:border-box;margin:0;padding:0}:root{--cp-dark: #1a2b4a;--cp-mid: #2c4a7c;--cp-accent: #3a6cc8;--cp-light: #e8f0fb;--cp-green: #2e7d4f;--bg: #f4f6fb;--surface: #ffffff;--border: #dde3ef;--text: #1a1f2e;--text-soft: #5a6480;--user-bg: #2c4a7c;--user-text: #ffffff;--bot-bg: #ffffff;--error-bg: #fff2f2;--error-text: #c0392b;--radius: 12px;--shadow: 0 2px 16px rgba(26, 43, 74, .1);font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif;font-size:15px;color:var(--text)}html,body,#root{height:100%}.app{display:flex;flex-direction:column;height:100vh;background:var(--bg);overflow:hidden}.app-content{display:flex;flex:1;overflow:hidden}.chat-section{display:flex;flex-direction:column;flex:1;min-width:0;border-right:1px solid var(--border)}.workbench-section{width:320px;background:var(--surface);display:flex;flex-direction:column;flex-shrink:0}.workbench-hdr{padding:16px;border-bottom:1px solid var(--border);background:var(--cp-light);font-weight:700;color:var(--cp-dark)}.workbench-body{flex:1;overflow-y:auto;padding:0}.workbench-body::-webkit-scrollbar{width:6px}.workbench-body::-webkit-scrollbar-track{background:transparent}.workbench-body::-webkit-scrollbar-thumb{background:var(--border);border-radius:3px}.az-group-header{background:var(--bg);padding:4px 16px;font-weight:800;font-size:13px;color:var(--cp-mid);position:sticky;top:0;border-bottom:1px solid var(--border);border-top:1px solid var(--border)}.az-group-header:first-child{border-top:none}.az-term{padding:10px 16px;font-size:14px;cursor:pointer;border-bottom:1px solid var(--bg);transition:background .15s;color:var(--text)}.az-term:hover{background:var(--cp-light);color:var(--cp-accent)}.az-term:last-child{border-bottom:none}.hdr{display:flex;align-items:center;justify-content:space-between;padding:12px 20px;background:var(--cp-dark);border-bottom:3px solid var(--cp-accent);flex-shrink:0;gap:12px}.hdr-left{display:flex;align-items:center;gap:12px}.cp-badge-sm{background:var(--cp-accent);color:#fff;font-weight:800;font-size:14px;letter-spacing:1px;padding:6px 10px;border-radius:8px;flex-shrink:0}.hdr-title{color:#fff;font-weight:700;font-size:16px;line-height:1.2}.hdr-sub{color:#ffffff8c;font-size:12px}.btn-ghost{display:flex;align-items:center;gap:4px;background:#ffffff14;border:1px solid rgba(255,255,255,.18);color:#fffc;padding:6px 12px;border-radius:6px;font-size:12px;cursor:pointer;transition:all .15s;flex-shrink:0}.btn-ghost:hover{background:#ffffff29;color:#fff}.msgs{flex:1;overflow-y:auto;padding:24px 16px 16px;display:flex;flex-direction:column;gap:16px;scroll-behavior:smooth}.msgs::-webkit-scrollbar{width:6px}.msgs::-webkit-scrollbar-track{background:transparent}.msgs::-webkit-scrollbar-thumb{background:var(--border);border-radius:3px}.msg-row{display:flex;align-items:flex-end;gap:10px;max-width:820px;width:100%}.msg-user{margin-left:auto;flex-direction:row-reverse}.msg-bot{margin-right:auto}.avatar{width:34px;height:34px;border-radius:50%;display:flex;align-items:center;justify-content:center;flex-shrink:0}.av-bot{background:var(--cp-mid);color:#fff}.av-user{background:var(--cp-accent);color:#fff}.avatar svg{width:18px;height:18px}.bubble{padding:12px 16px;border-radius:16px;max-width:min(640px,calc(100vw - 100px));line-height:1.6;box-shadow:var(--shadow);word-break:break-word}.b-bot{background:var(--surface);border:1px solid var(--border);border-bottom-left-radius:4px}.b-user{background:var(--user-bg);color:var(--user-text);border-bottom-right-radius:4px}.b-error{background:var(--error-bg);color:var(--error-text);border:1px solid #f5c6c6;border-bottom-left-radius:4px}.md-body p{margin-bottom:6px}.md-body p:last-child{margin-bottom:0}.md-body ul,.md-body ol{padding-left:20px;margin:6px 0}.md-body li{margin-bottom:3px}.md-body h2{font-size:16px;font-weight:700;margin:10px 0 4px;color:var(--cp-dark)}.md-body h3{font-size:15px;font-weight:700;margin:8px 0 4px;color:var(--cp-mid)}.md-body h4{font-size:14px;font-weight:600;margin:6px 0 3px}.md-body strong{font-weight:600;color:var(--cp-dark)}.md-body code{background:var(--cp-light);color:var(--cp-mid);padding:1px 5px;border-radius:4px;font-size:13px;font-family:monospace}.blink{animation:blink .8s step-end infinite}@keyframes blink{50%{opacity:0}}.chips{display:flex;flex-wrap:wrap;gap:8px;padding:0 16px 12px;flex-shrink:0}.chip{background:var(--surface);border:1.5px solid var(--cp-accent);color:var(--cp-accent);padding:6px 12px;border-radius:20px;font-size:13px;cursor:pointer;transition:all .15s;white-space:nowrap}.chip:hover:not(:disabled){background:var(--cp-light)}.chip:disabled{opacity:.5;cursor:not-allowed}.input-wrap{padding:12px 16px 16px;background:var(--surface);border-top:1px solid var(--border);flex-shrink:0;box-shadow:0 -4px 16px #1a2b4a0f}.input-row{display:flex;align-items:flex-end;gap:10px}.chat-ta{flex:1;border:1.5px solid var(--border);border-radius:12px;padding:10px 14px;font-size:15px;font-family:inherit;resize:none;outline:none;background:var(--bg);transition:border-color .15s;max-height:120px;line-height:1.5;color:var(--text)}.chat-ta:focus{border-color:var(--cp-accent);background:var(--surface)}.chat-ta:disabled{opacity:.6;cursor:not-allowed}.send-btn{width:42px;height:42px;flex-shrink:0;background:var(--cp-accent);color:#fff;border:none;border-radius:10px;display:flex;align-items:center;justify-content:center;cursor:pointer;transition:background .15s,opacity .15s}.send-btn svg{width:18px;height:18px}.send-btn:hover:not(:disabled){background:var(--cp-mid)}.send-btn:disabled{opacity:.4;cursor:not-allowed}.dot-spin{width:18px;height:18px;border:2px solid rgba(255,255,255,.3);border-top-color:#fff;border-radius:50%;animation:spin .7s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}.input-hint{margin-top:8px;font-size:12px;color:var(--text-soft);line-height:1.4}.input-hint kbd{display:inline-block;background:var(--bg);border:1px solid var(--border);border-radius:3px;padding:1px 5px;font-size:11px;font-family:monospace;margin:0 2px}.setup-wrap{min-height:100vh;display:flex;align-items:center;justify-content:center;background:linear-gradient(135deg,var(--cp-dark) 0%,var(--cp-mid) 100%);padding:24px}.setup-card{background:var(--surface);border-radius:20px;padding:40px 36px;max-width:500px;width:100%;box-shadow:0 20px 60px #00000040}.cp-logo-row{display:flex;align-items:center;gap:14px;margin-bottom:24px}.cp-badge{background:var(--cp-dark);color:#fff;font-weight:900;font-size:22px;letter-spacing:2px;width:60px;height:60px;border-radius:14px;display:flex;align-items:center;justify-content:center;flex-shrink:0}.cp-brand{font-size:20px;font-weight:800;color:var(--cp-dark)}.cp-tagline{font-size:14px;color:var(--text-soft)}.setup-body{font-size:14px;color:var(--text-soft);line-height:1.6;margin-bottom:12px}.setup-body b{color:var(--text)}.key-form{display:flex;flex-direction:column;gap:8px;margin:20px 0 16px}.key-form label{font-size:13px;font-weight:600;color:var(--text)}.key-form input{border:1.5px solid var(--border);border-radius:8px;padding:10px 14px;font-size:14px;font-family:inherit;outline:none;transition:border-color .15s;background:var(--bg)}.key-form input:focus{border-color:var(--cp-accent);background:var(--surface)}.key-err{font-size:13px;color:var(--error-text)}.btn-primary{background:var(--cp-accent);color:#fff;border:none;border-radius:8px;padding:11px 20px;font-size:15px;font-weight:600;cursor:pointer;transition:background .15s;margin-top:4px}.btn-primary:hover{background:var(--cp-mid)}.setup-hint{font-size:12px;color:var(--text-soft)}.setup-hint a{color:var(--cp-accent)}@media(max-width:768px){.app-content{flex-direction:column;overflow:auto}.chat-section{flex:none;height:60vh;border-right:none;border-bottom:2px solid var(--cp-accent)}.workbench-section{width:100%;flex:none;height:40vh}.bubble{max-width:calc(100vw - 60px)}.hdr{padding:8px 12px}.hdr-title{font-size:14px}.cp-badge-sm{padding:4px 8px;font-size:12px}.chips{gap:6px}.chip{font-size:12px;padding:5px 10px}.setup-card{padding:28px 20px}.input-wrap{padding:8px 12px 12px}.chat-ta{font-size:16px}}
