.qba-layer{position:fixed;inset:0;z-index:1900;background:#1a302b61;backdrop-filter:blur(3px);display:flex;justify-content:flex-end;font:14px/1.65 Inter,"PingFang SC","Microsoft YaHei",system-ui,sans-serif;color:#22312c}
.qba-layer *{box-sizing:border-box}.qba-layer [hidden]{display:none!important}
.qba-dialog{display:flex;flex-direction:column;width:min(490px,100%);height:100dvh;min-height:0;background:#f3f1ec;border-left:1px solid #d8dfcf;box-shadow:-12px 0 50px #213f3121;outline:none}
.qba-header{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:20px 22px 15px;background:#fffdf9;border-bottom:1px solid #e3ded2;flex:none}
.qba-header h2{margin:0;font-size:22px;line-height:1.4;letter-spacing:-.4px;color:#22312c}.qba-status{margin:4px 0 0;font-size:13px;color:#716b57}.qba-status.qba-ready{color:#0f766e}
.qba-layer button{font:inherit;cursor:pointer;transition:background-color .15s,border-color .15s,transform .12s;min-height:40px}.qba-layer button:disabled{opacity:.5;cursor:not-allowed}.qba-layer button:active:not(:disabled){transform:translateY(1px)}
.qba-close{width:40px;height:40px;min-width:40px;display:grid;place-items:center;font-size:25px!important;background:#ecf0e5;border:1px solid #dce2d1;border-radius:11px;color:#506154;padding:0}
.qba-layer :is(button,textarea,a):focus-visible{outline:3px solid #83bcaa;outline-offset:3px}.qba-close:hover{background:#dceade}
.qba-scope{margin:0;padding:13px 22px 7px;color:#526459;font-size:13px;line-height:1.75}
.qba-shortcuts{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;padding:8px 22px 15px;flex:none}
.qba-shortcut{min-height:40px;border:1px solid #d7e2d4;border-radius:10px;background:#fffdf9;padding:8px 10px;color:#0b5a54;text-align:left}.qba-shortcut:hover:not(:disabled){border-color:#9bc8b5;background:#e3f0ec}
.qba-messages{min-height:0;flex:1;overflow:auto;overscroll-behavior:contain;padding:6px 22px 18px;scrollbar-width:thin;display:flex;flex-direction:column;gap:14px}
.qba-empty{margin:auto 0;padding:24px 20px;border:1px dashed #c9d9c5;border-radius:16px;background:#edf3e9;color:#4b654f}.qba-empty strong{font-size:17px;color:#0b5a54}.qba-empty p{margin:10px 0 0;line-height:1.8;font-size:14px}
.qba-message{padding:14px 16px;border:1px solid #e3ded2;border-radius:15px;background:#fffdf9;box-shadow:0 2px 7px #253b2910;min-width:0;flex:none}
.qba-message.qba-user{margin-left:26px;background:#e4efe7;border-color:#c7ddcc}.qba-message.qba-assistant{margin-right:8px}
.qba-speaker{display:block;color:#0b5a54;font-size:13px;margin-bottom:6px}.qba-message-text{white-space:pre-wrap;overflow-wrap:anywhere;word-break:break-word;line-height:1.85;font-size:14px;color:#22312c}
.qba-sources{border-top:1px solid #e2e5d9;padding-top:10px;margin-top:12px;color:#5c6a63;font-size:12px}.qba-sources>strong{font-weight:600}.qba-sources p{margin:7px 0 0;display:flex;flex-wrap:wrap;column-gap:12px;row-gap:2px;font-size:12px}.qba-sources span{color:#486653}.qba-sources time{font-variant-numeric:tabular-nums}.qba-sources small{flex:1 0 100%;font-size:12px;overflow-wrap:anywhere}
.qba-thinking{padding:12px 0;font-size:14px;color:#526d5c;flex:none}.qba-thinking:before{content:"";display:inline-block;width:8px;height:8px;border-radius:50%;background:#0f766e;margin-right:8px;animation:qba-pulse 1.2s ease-in-out infinite}
.qba-footer{flex:none;padding:12px 22px 18px;border-top:1px solid #e3ded2;background:#fffdf9;max-height:52dvh;overflow:auto}.qba-feedback{margin:0 0 10px;font-size:14px;padding:10px 12px;background:#fdf0dc;color:#87500f;border:1px solid #ead1a7;border-radius:10px;line-height:1.7;overflow-wrap:anywhere}
.qba-recheck{border:1px solid #c5d8c7;border-radius:10px;background:#edf3e9;color:#0b5a54;padding:8px 12px;margin-bottom:10px}
.qba-input-label{display:block;font-size:14px;font-weight:600;margin:0 0 6px;color:#465c4d}.qba-input{width:100%;resize:vertical;min-height:82px;max-height:150px;padding:11px 12px;border:1px solid #cddbcc;border-radius:12px;background:#fff;color:#22312c;line-height:1.6;font:inherit;font-size:14px}.qba-input:disabled{background:#f1f2ea;color:#66765f;opacity:1}
.qba-actions{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-top:9px}.qba-count{font-size:12px;color:#62705f;white-space:nowrap;font-variant-numeric:tabular-nums}.qba-actions-right{display:flex;gap:7px;flex-wrap:wrap;justify-content:flex-end}
.qba-button{border-radius:10px;min-height:40px;padding:8px 13px;border:1px solid #d2dece;font-size:14px;white-space:nowrap}.qba-secondary{color:#52644f;background:#fff}.qba-secondary:hover:not(:disabled){background:#edf4e8}.qba-primary{color:#fff;background:#0f766e;border-color:#0f766e}.qba-primary:hover:not(:disabled){background:#0b5a54;border-color:#0b5a54}
.qba-note{font-size:12px;color:#64725f;line-height:1.6;margin:10px 0 0}
@keyframes qba-pulse{50%{opacity:.3}}
@media(max-width:600px){.qba-dialog{border-left:0;width:100%}.qba-header{padding:15px 16px 12px}.qba-header h2{font-size:20px}.qba-scope{padding:11px 16px 6px}.qba-shortcuts{padding:6px 16px 12px;gap:7px}.qba-messages{padding:6px 16px 14px}.qba-footer{padding:11px 16px max(12px,env(safe-area-inset-bottom))}.qba-message{padding:12px}.qba-message.qba-user{margin-left:15px}.qba-message.qba-assistant{margin-right:0}.qba-input{font-size:16px}.qba-status,.qba-scope,.qba-speaker,.qba-sources,.qba-sources p,.qba-sources small,.qba-count,.qba-note{font-size:14px}.qba-button{padding:8px 10px}.qba-header,.qba-shortcuts,.qba-footer{flex-shrink:0}.qba-actions{flex-wrap:wrap}.qba-actions-right{margin-left:auto}.qba-empty{padding:18px}.qba-footer{max-height:48dvh}}
@media(max-height:650px){.qba-scope{padding-top:6px;padding-bottom:3px}.qba-shortcuts{padding-top:3px;padding-bottom:7px}.qba-input{min-height:62px;max-height:90px}.qba-header{padding-top:10px;padding-bottom:9px}.qba-note{display:none}.qba-footer{max-height:50dvh}}
@media(prefers-reduced-motion:reduce){.qba-layer *,.qba-layer *::before{animation:none!important;transition:none!important;scroll-behavior:auto!important}}
