:root{--primary: #7c3aed;--primary-light: #a78bfa;--primary-dark: #6d28d9;--primary-bg: #f3f0ff;--primary-hover: #ede9fe;--bg: #f8f9fa;--bg-white: #ffffff;--border: #e5e7eb;--border-light: #f3f4f6;--text: #1f2937;--text-secondary: #6b7280;--text-muted: #9ca3af;--incoming-bg: #ffffff;--incoming-text: #1f2937;--danger-bg: #fef2f2;--notice-bg: #fffbeb;--notice-text: #92400e;--notice-border: #fde68a;--success: #10b981;--warning: #f59e0b;--danger: #ef4444;--radius: 8px;--radius-lg: 16px;--radius-full: 9999px;--shadow: 0 1px 3px rgba(0, 0, 0, .06);--shadow-lg: 0 8px 32px rgba(0, 0, 0, .12)}*{margin:0;padding:0;box-sizing:border-box}body{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif;font-size:14px;line-height:1.5;color:var(--text);background:transparent}.chat-fab{position:fixed;bottom:24px;right:24px;width:56px;height:56px;border-radius:var(--radius-full);background:var(--chat-theme-color, var(--primary));color:var(--chat-theme-text, white);border:1px solid var(--chat-theme-focus, var(--primary));cursor:pointer;display:flex;align-items:center;justify-content:center;box-shadow:var(--shadow-lg);transition:transform .2s,background .2s;z-index:9999}.chat-fab:hover{border-color:currentColor;transform:scale(1.08)}.chat-fab:focus-visible{outline:2px solid var(--chat-theme-focus, var(--primary));outline-offset:2px}.chat-container{position:fixed;bottom:24px;right:24px;width:380px;height:560px;background:var(--bg-white);border-radius:var(--radius-lg);box-shadow:var(--shadow-lg);display:flex;flex-direction:column;overflow:hidden;z-index:9999;border:1px solid var(--border)}.chat-header{background:var(--chat-theme-color, var(--primary));color:var(--chat-theme-text, white);padding:14px 16px;display:flex;justify-content:space-between;align-items:center;flex-shrink:0}.chat-header-info{display:flex;align-items:center;gap:8px}.chat-header-dot{width:8px;height:8px;border-radius:50%;background:#4ade80}.chat-header-title{font-weight:600;font-size:15px}.chat-header-status{font-size:12px;opacity:.8}.chat-header-close{background:none;border:none;color:inherit;cursor:pointer;padding:4px;opacity:.8;display:flex;align-items:center}.chat-header-close:hover{opacity:1}.chat-header-back{background:none;border:none;color:inherit;cursor:pointer;padding:4px;opacity:.8;display:flex;align-items:center;margin-right:4px}.chat-header-back:hover{opacity:1}.chat-header-back:focus-visible,.chat-header-close:focus-visible{outline:2px solid currentColor;outline-offset:2px}.chat-messages{flex:1;overflow-y:auto;padding:16px;display:flex;flex-direction:column;gap:12px;background:var(--bg)}.chat-messages::-webkit-scrollbar{width:4px}.chat-messages::-webkit-scrollbar-thumb{background:var(--border);border-radius:4px}.chat-error{background:var(--danger-bg);color:var(--danger);padding:8px 12px;border-radius:var(--radius);font-size:13px;text-align:center}.chat-welcome{display:flex;flex-direction:column;align-items:center;padding:24px 16px;text-align:center}.chat-welcome-icon{font-size:40px;margin-bottom:12px}.chat-welcome-text{color:var(--text);font-size:15px;margin-bottom:20px;line-height:1.6}.chat-quick-questions{display:flex;flex-direction:column;gap:8px;width:100%}.chat-quick-btn{background:var(--bg-white);border:1px solid var(--primary-light);color:var(--primary);padding:10px 16px;border-radius:var(--radius-full);font-size:13px;cursor:pointer;transition:all .2s;text-align:left}.chat-quick-btn:hover{background:var(--primary-bg);border-color:var(--primary)}.chat-bubble-wrapper{display:flex;width:100%;max-width:100%;align-items:flex-start}.chat-bubble-outgoing{justify-content:flex-end}.chat-bubble-incoming{justify-content:flex-start}.chat-bubble-user{flex-direction:row}.chat-system-row{display:flex;justify-content:center;width:100%}.chat-bubble-content{display:flex;flex-direction:column;gap:2px;max-width:min(78%,280px);min-width:0}.chat-bubble-outgoing .chat-bubble-content{align-items:flex-end}.chat-bubble-incoming .chat-bubble-content{align-items:flex-start}.chat-bubble{padding:10px 14px;border-radius:12px;font-size:14px;line-height:1.6;word-break:break-word;white-space:pre-wrap;max-width:100%}.chat-bubble-bg-user{background:var(--chat-theme-color, var(--primary));color:var(--chat-theme-text, white);border-bottom-right-radius:4px}.chat-bubble-bg-ai,.chat-bubble-bg-agent{background:var(--incoming-bg, #ffffff);color:var(--incoming-text, #1f2937);border:1px solid var(--border);border-bottom-left-radius:4px}.chat-bubble-bg-system{background:var(--notice-bg);color:var(--notice-text);border:1px solid var(--notice-border);border-radius:var(--radius);font-size:13px;text-align:center;max-width:90%}.chat-msg-failed{align-self:flex-end;display:inline-flex;align-items:center;gap:4px;margin-top:4px;padding:2px 4px;background:none;border:none;color:var(--danger);font-size:11px;cursor:pointer;font-family:inherit}.chat-msg-failed:hover{text-decoration:underline}.chat-msg-failed-icon{display:inline-flex;align-items:center;justify-content:center;width:14px;height:14px;border-radius:50%;background:var(--danger);color:var(--danger-on, white);font-size:11px;font-weight:700;line-height:1}.chat-cursor{display:inline-block;width:2px;height:14px;background:currentColor;margin-left:2px;vertical-align:text-bottom;animation:blink .8s infinite}@keyframes blink{0%,to{opacity:1}50%{opacity:0}}.chat-typing-dots{display:flex;gap:4px;padding:4px 0}.chat-typing-dots span{width:6px;height:6px;background:var(--text-muted);border-radius:50%;animation:bounce 1.2s infinite}.chat-typing-dots span:nth-child(2){animation-delay:.2s}.chat-typing-dots span:nth-child(3){animation-delay:.4s}@keyframes bounce{0%,80%,to{transform:translateY(0)}40%{transform:translateY(-6px)}}.chat-quick-bar{padding:8px 16px;display:flex;gap:6px;overflow-x:auto;background:var(--bg-white);border-top:1px solid var(--border-light);flex-shrink:0}.chat-quick-bar::-webkit-scrollbar{height:0}.chat-quick-btn-sm{background:var(--primary-bg);border:1px solid var(--primary-light);color:var(--primary);padding:4px 12px;border-radius:var(--radius-full);font-size:12px;cursor:pointer;white-space:nowrap;flex-shrink:0}.chat-quick-btn-sm:hover{background:var(--primary-hover)}.chat-input-area{padding:12px 16px;display:flex;gap:8px;align-items:flex-end;background:var(--bg-white);border-top:1px solid var(--border);flex-shrink:0}.chat-input{flex:1;background:var(--bg-white);color:var(--text);border:1px solid var(--border);border-radius:var(--radius-lg);padding:10px 14px;font-size:14px;resize:none;outline:none;max-height:80px;font-family:inherit;line-height:1.4;transition:border-color .2s}.chat-input:focus{border-color:var(--chat-theme-color, var(--primary));outline:2px solid var(--chat-theme-focus, var(--primary));outline-offset:1px}.chat-input:disabled{background:var(--bg);cursor:not-allowed}.chat-send-btn{width:38px;height:38px;border-radius:50%;background:var(--chat-theme-color, var(--primary));border:1px solid var(--chat-theme-focus, var(--primary));color:var(--chat-theme-text, white);cursor:pointer;display:flex;align-items:center;justify-content:center;flex-shrink:0;transition:border-color .2s}.chat-send-btn:hover:not(:disabled){border-color:var(--chat-theme-text, white)}.chat-send-btn:focus-visible{outline:2px solid var(--chat-theme-focus, var(--primary));outline-offset:2px}.chat-send-btn:disabled{background:var(--border);border-color:var(--border);color:var(--text-muted);cursor:not-allowed}.chat-attach-btn{position:relative;width:38px;height:38px;border-radius:50%;background:transparent;border:none;color:var(--text-muted);cursor:pointer;display:flex;align-items:center;justify-content:center;flex-shrink:0;transition:color .2s,background .2s;overflow:hidden}.chat-attach-btn:hover:not(.disabled){color:var(--primary);background:var(--primary-bg)}.chat-attach-btn.disabled{color:var(--border);cursor:not-allowed}.chat-file-input{position:absolute;top:0;right:0;bottom:0;left:0;width:100%;height:100%;opacity:0;cursor:pointer}.chat-file-input:disabled{cursor:not-allowed}.chat-bubble-attachments{display:flex;flex-direction:column;gap:4px;margin-bottom:4px}.chat-bubble-outgoing .chat-bubble-attachments{align-items:flex-end}.chat-bubble-incoming .chat-bubble-attachments{align-items:flex-start}.chat-bubble-image{max-width:200px;max-height:200px;width:auto;height:auto;border-radius:8px;cursor:zoom-in;display:block;background:var(--bg);object-fit:cover}.chat-pending-bar{padding:8px 16px;display:flex;gap:8px;overflow-x:auto;background:var(--bg-white);border-top:1px solid var(--border-light);flex-shrink:0}.chat-pending-item{position:relative;width:56px;height:56px;flex-shrink:0;border-radius:6px;overflow:hidden;background:var(--bg)}.chat-pending-thumb{width:100%;height:100%;object-fit:cover;display:block}.chat-pending-empty{display:flex;align-items:center;justify-content:center;color:var(--danger);font-weight:700;background:var(--danger-bg)}.chat-pending-overlay{position:absolute;top:0;right:0;bottom:0;left:0;background:#0000008c;color:#fff;font-size:10px;display:flex;align-items:center;justify-content:center;text-align:center;padding:2px 4px;line-height:1.2}.chat-pending-overlay-error{background:#dc2626c7}.chat-pending-remove{position:absolute;top:1px;right:1px;width:16px;height:16px;border-radius:50%;background:#0009;color:#fff;border:none;cursor:pointer;font-size:12px;line-height:1;display:flex;align-items:center;justify-content:center;padding:0}.chat-pending-remove:hover{background:#000000d9}.chat-drag-mask{position:absolute;top:0;right:0;bottom:0;left:0;background:var(--primary-bg);border:2px dashed var(--primary);border-radius:var(--radius-lg);display:flex;align-items:center;justify-content:center;pointer-events:none;z-index:100}.chat-drag-hint{background:var(--bg-white);color:var(--primary);padding:10px 18px;border-radius:var(--radius);font-size:14px;font-weight:600;box-shadow:var(--shadow)}.chat-lightbox{position:fixed;top:0;right:0;bottom:0;left:0;background:#000000d9;display:flex;align-items:center;justify-content:center;z-index:10000;cursor:zoom-out;padding:24px}.chat-lightbox-img{max-width:100%;max-height:100%;object-fit:contain;border-radius:var(--radius);box-shadow:var(--shadow-lg)}@media (max-width: 420px){.chat-container{bottom:0;right:0;width:100%;height:100%;border-radius:0}}.chat-container.embed{position:fixed;top:0;right:0;bottom:0;left:0;width:100%;height:100%;border-radius:0;border:none;box-shadow:none}.chat-input::placeholder,.hc-search-input::placeholder{color:var(--text-muted);opacity:1}.hc-container{display:flex;flex-direction:column;height:100%;background:var(--bg-white);overflow:hidden}.hc-header{display:flex;align-items:center;gap:8px;padding:14px 16px;border-bottom:1px solid var(--border-light);background:var(--chat-theme-color, var(--primary));color:var(--chat-theme-text, white);flex-shrink:0}.hc-back{background:none;border:none;color:inherit;cursor:pointer;padding:4px;display:flex;align-items:center;border-radius:var(--radius)}.hc-back:hover{outline:1px solid currentColor;outline-offset:2px}.hc-back:focus-visible{outline:2px solid currentColor;outline-offset:2px}.hc-title{font-size:16px;font-weight:600;margin:0;color:inherit}.hc-search-bar{position:relative;padding:12px 16px 8px;flex-shrink:0}.hc-search-icon{position:absolute;left:28px;top:50%;transform:translateY(-50%);color:var(--text-muted);display:flex}.hc-search-input{width:100%;padding:10px 14px 10px 36px;border:1px solid transparent;background:var(--bg);border-radius:var(--radius-full);font-size:14px;outline:none;font-family:inherit;color:var(--text);transition:border-color .2s,background .2s}.hc-search-input:focus{border-color:var(--chat-theme-color, var(--primary));outline:2px solid var(--chat-theme-focus, var(--primary));outline-offset:1px;background:var(--bg-white)}.hc-tabs{display:flex;gap:6px;padding:4px 16px 12px;overflow-x:auto;scrollbar-width:none;flex-shrink:0}.hc-tabs::-webkit-scrollbar{display:none}.hc-tab{flex-shrink:0;padding:6px 14px;border-radius:var(--radius-full);border:1px solid transparent;background:var(--bg);color:var(--text);font-size:13px;cursor:pointer;white-space:nowrap;font-family:inherit;transition:background .2s,color .2s}.hc-tab:hover:not(.active){background:var(--primary-bg);color:var(--primary)}.hc-tab:focus-visible{outline:2px solid var(--chat-theme-focus, var(--primary));outline-offset:-2px}.hc-tab.active{background:var(--chat-theme-color, var(--primary));color:var(--chat-theme-text, white);font-weight:500}.hc-tab.active:focus-visible{outline-color:var(--chat-theme-text, white)}.hc-list{flex:1;overflow-y:auto;padding:0 16px 16px;margin:0 0 4px}.hc-list::-webkit-scrollbar{width:4px}.hc-list::-webkit-scrollbar-thumb{background:var(--border);border-radius:4px}.hc-empty{text-align:center;color:var(--text-muted);font-size:13px;padding:32px 0}.hc-item{background:var(--bg-white);border:1px solid var(--border-light);border-radius:var(--radius);margin-bottom:8px;overflow:hidden}.hc-item.open{border-color:var(--primary-light)}.hc-item-q{width:100%;background:none;border:none;text-align:left;padding:14px;display:flex;align-items:center;gap:10px;cursor:pointer;font-family:inherit;font-size:14px;color:var(--text);font-weight:500}.hc-item-q:hover,.hc-item.open .hc-item-q{background:var(--primary-bg);color:var(--primary)}.hc-item-q:focus-visible{outline:2px solid var(--primary);outline-offset:-2px}.hc-item-chevron{color:var(--text-muted);display:flex;flex-shrink:0;transition:transform .15s}.hc-item.open .hc-item-chevron{color:var(--primary)}.hc-item-q-text{flex:1;word-break:break-word}.hc-item-a{padding:0 14px 14px 38px;font-size:13px;line-height:1.65;color:var(--text-secondary);white-space:pre-wrap;word-break:break-word}.hc-footer{padding:12px 16px 16px;border-top:1px solid var(--border-light);background:var(--bg-white);flex-shrink:0}.hc-chat-btn{width:100%;padding:12px;border:1px solid var(--chat-theme-focus, var(--primary));border-radius:var(--radius-full);background:var(--chat-theme-color, var(--primary));color:var(--chat-theme-text, white);font-size:14px;font-weight:600;cursor:pointer;display:flex;align-items:center;justify-content:center;gap:8px;font-family:inherit;transition:border-color .2s}.hc-chat-btn:hover{border-color:var(--chat-theme-text, white)}.hc-chat-btn:focus-visible{outline:2px solid var(--chat-theme-focus, var(--primary));outline-offset:2px}
