:root{--chat-primary-angle:135deg;--chat-primary-start:#4562bb;--chat-primary-end:#02f17c;--chat-primary:linear-gradient(var(--chat-primary-angle),var(--chat-primary-start),var(--chat-primary-end));--chat-primary-solid:var(--chat-primary-start);--chat-placeholder-highlight:var(--chat-primary);--chat-placeholder-highlight-solid:var(--chat-primary-start);--chat-header-text:#fff}.chat-toggle,.plugin-chat-toggle{align-items:center;background:var(--chat-primary);border:none;border-radius:50%;bottom:20px;box-shadow:0 4px 12px rgba(0,0,0,.25);color:#fff;cursor:pointer;display:flex;font-size:26px;height:60px;justify-content:center;position:fixed;right:20px;transition:transform .2s ease,box-shadow .3s ease;width:60px;z-index:1000}.chat-toggle:hover,.plugin-chat-toggle:hover{transform:scale(1.05)}.chat-toggle .icon,.chat-toggle .plugin-icon,.plugin-chat-toggle .icon,.plugin-chat-toggle .plugin-icon{display:block;height:24px;width:24px}.chat-toggle.is-active,.plugin-chat-toggle.plugin-is-active{box-shadow:0 6px 16px rgba(0,0,0,.28);transform:scale(1.05)}.chat-panel,.plugin-chat-panel{background:#fff;border-radius:16px;bottom:90px;box-shadow:0 8px 24px rgba(0,0,0,.2);display:flex;flex-direction:column;font-family:Segoe UI,sans-serif;height:min(600px,calc(100vh - 140px));max-height:calc(100vh - 140px);max-width:calc(100vw - 40px);opacity:0;overflow:hidden;pointer-events:none;position:fixed;right:20px;transform:translateY(12px) scale(.98);transition:opacity .18s ease-out,transform .18s ease-out;visibility:hidden;width:min(450px,calc(100vw - 40px));z-index:1000}.chat-panel.is-open,.plugin-chat-panel.plugin-is-open{opacity:1;pointer-events:auto;transform:translateY(0) scale(1);visibility:visible}.chat-header,.plugin-chat-header{align-items:center;background:var(--chat-primary);color:var(--chat-header-text);display:flex;font-size:16px;font-weight:600;justify-content:space-between;padding:14px}.chat-header-left,.plugin-chat-header-left{align-items:flex-start;display:flex;flex-direction:column;gap:4px}.chat-title,.plugin-chat-title{font-size:16px;font-weight:600}.context-indicator{background:hsla(0,0%,100%,.1);border-radius:12px;font-size:12px;font-weight:400;opacity:.8;padding:2px 8px}.chat-header-right,.plugin-chat-header-right{align-items:center;display:flex;gap:8px}.chat-header-right [data-tooltip],.chat-header-right button[data-tooltip],.plugin-chat-header-right [data-tooltip],.plugin-chat-header-right button[data-tooltip]{position:relative}.chat-header-right [data-tooltip]:after,.chat-header-right button[data-tooltip]:after,.plugin-chat-header-right [data-tooltip]:after,.plugin-chat-header-right button[data-tooltip]:after{background:#fff;border:1px solid rgba(17,24,39,.12);border-radius:6px;box-shadow:0 6px 18px rgba(15,23,42,.18);color:#111827;content:attr(data-tooltip);font-size:12px;left:50%;opacity:0;padding:6px 10px;pointer-events:none;position:absolute;top:calc(100% + 8px);transform:translate(-50%,-6px) scale(.95);transition:opacity .18s ease,transform .18s ease;white-space:nowrap;z-index:10}.chat-header-right [data-tooltip]:focus-visible:after,.chat-header-right [data-tooltip]:hover:after,.chat-header-right button[data-tooltip]:focus-visible:after,.chat-header-right button[data-tooltip]:hover:after,.plugin-chat-header-right [data-tooltip]:focus-visible:after,.plugin-chat-header-right [data-tooltip]:hover:after,.plugin-chat-header-right button[data-tooltip]:focus-visible:after,.plugin-chat-header-right button[data-tooltip]:hover:after{opacity:1;transform:translate(-50%) scale(1)}.chat-brand,.plugin-chat-brand{align-items:center;display:flex;gap:10px}.chat-logo,.plugin-chat-logo{height:24px;object-fit:contain;width:24px}.bot-avatar,.plugin-bot-avatar{height:18px;object-fit:contain;width:18px}.chat-global-logo,.plugin-chat-global-logo{height:28px;margin-right:8px;object-fit:contain;vertical-align:middle;width:28px}button{margin:0;padding:0}.icon.icon-close,.icon.icon-refresh{background:var(--chat-primary);display:block;height:18px;-webkit-mask-size:contain;mask-size:contain;width:18px}.icon-refresh{-webkit-mask-image:url(${CONFIG.ui.iconsBaseUrl}/refresh.svg);mask-image:url(${CONFIG.ui.iconsBaseUrl}/refresh.svg)}.icon-close{-webkit-mask-image:url(${CONFIG.ui.iconsBaseUrl}/close.svg);mask-image:url(${CONFIG.ui.iconsBaseUrl}/close.svg)}.chat-close,.new-chat-btn{align-items:center;background:#fff;border:1px solid rgba(17,24,39,.12);border-radius:10px;cursor:pointer;display:flex;height:40px;justify-content:center;transition:background-color .2s ease,transform .1s ease,border-color .2s ease;width:40px}.chat-close:focus-visible,.new-chat-btn:focus-visible{outline:3px solid rgba(17,24,39,.2);outline-offset:2px}.chat-header-right .icon,.plugin-chat-header-right .icon{background-image:var(--chat-primary);background-repeat:no-repeat;background-size:100% 100%;display:block;height:18px;-webkit-mask-image:var(--icon-url);mask-image:var(--icon-url);-webkit-mask-position:center;mask-position:center;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:contain;mask-size:contain;width:18px}.new-chat-btn.is-cooldown{background:rgba(17,24,39,.08);border-color:rgba(17,24,39,.2);cursor:not-allowed;opacity:.6;transform:none}.new-chat-btn.is-cooldown .icon{opacity:.5}.chat-header-right .chat-close:hover,.chat-header-right .new-chat-btn:hover,.chat-header-right button:hover:not(:disabled),.plugin-chat-header-right .chat-close:hover,.plugin-chat-header-right .new-chat-btn:hover,.plugin-chat-header-right button:hover:not(:disabled){transform:translateY(-1px)}.chat-box{background:#f9fafb;flex:1;overflow-y:auto;padding:12px}.chat-empty{bottom:64px;gap:10px;left:0;right:0;top:64px}.chat-empty .empty-logo{height:56px;object-fit:contain;width:56px}.chat-empty .empty-title{font-weight:600}.chat-empty .empty-subtitle{color:#6b7280;max-width:80%;text-align:center}.chat-empty{align-items:center;color:#111827;display:flex;flex-direction:column;gap:14px;inset:64px 0 64px 0;justify-content:center;pointer-events:none;position:absolute}.empty-logo{height:56px;object-fit:contain;width:56px}.empty-title{font-size:18px;font-weight:600}.empty-subtitle{color:#4b5563;font-size:14px;max-width:80%;text-align:center}.msg{word-wrap:break-word;align-items:flex-start;border-radius:10px;display:flex;gap:8px;line-height:1.6;margin:8px 0;max-width:90%;padding:12px}.msg.user{background:var(--chat-primary);color:#fff;flex-direction:row-reverse;margin-left:auto;max-width:80%}.msg.bot{background:#e5e7eb;color:#111;margin-right:auto;max-width:95%}.msg-avatar{display:none}.msg-content{flex:1;min-width:0}.msg.bot.error{background:#fee2e2;border:1px solid #fecaca;color:#dc2626}.msg.bot.welcome{background:#dbeafe;border:1px solid #bfdbfe;color:#1e40af}.msg.bot .msg-content{display:flex;flex-direction:column;gap:12px}.msg.bot .source-section-title{color:#1f2937;display:block;font-size:14px;font-weight:600;margin-bottom:8px;margin-top:16px}.msg.bot .sources-container{display:flex;flex-wrap:wrap;gap:8px;margin-top:8px}.msg.bot .source-download{align-items:center;background:#fff;border:1px solid rgba(17,24,39,.15);border-radius:8px;box-shadow:0 1px 3px rgba(0,0,0,.08);color:#1f2937;cursor:pointer;display:inline-flex;font-size:13px;font-weight:500;gap:6px;margin:2px 4px 2px 0;padding:8px 12px;transition:all .2s ease}.msg.bot .source-download:before{font-size:14px;line-height:1}.msg.bot .source-download:hover{background:linear-gradient(135deg,rgba(69,98,187,.1),rgba(2,241,124,.1));border-color:rgba(69,98,187,.3);box-shadow:0 3px 8px rgba(69,98,187,.15);transform:translateY(-1px)}.msg.bot .source-download:active{box-shadow:0 1px 3px rgba(0,0,0,.1);transform:translateY(0)}.msg.bot .source-download.is-loading{cursor:wait;opacity:.7;pointer-events:none}.msg.bot .source-download.is-loading:before{content:"⏳"}.msg.bot .source-download.download-error{background:#fee2e2;border-color:#dc2626;color:#dc2626}.msg.bot .msg-body{display:flex;flex-direction:column;gap:8px}.msg.bot .msg-source{align-self:flex-end;color:#4b5563;font-size:12px;margin-top:auto;opacity:.85;text-align:right}.msg.bot .source-label{margin-right:4px}.msg.bot .source-label,.msg.bot strong{color:#1f2937;font-weight:600}.msg.bot br{margin:2px 0}.msg.bot{white-space:pre-line}.msg.bot div{margin:8px 0 4px}.msg.bot span{display:inline}.msg.bot div{line-height:1.5}.msg.bot div[style*="margin: 4px 0"]{padding-left:8px;text-indent:-8px}.text-sm{font-size:14px;line-height:1.6}.max-w-none{max-width:none}.prose{color:#111827;line-height:1.7}.prose strong{color:#111827;font-weight:600}.prose br,.prose div,.prose p{margin:5.6px 0}.prose-sm{font-size:14px}.prose-sm strong{font-weight:600}.msg.bot div[style*="font-weight: bold"]{background:rgba(37,99,235,.05);border-left:3px solid var(--chat-primary-solid);border-radius:4px;padding-left:8px}.msg.bot table.chat-table,.plugin-msg table.plugin-table{background:#fff;border-collapse:collapse;margin:8px 0 4px;width:100%}.msg.bot table.chat-table td,.msg.bot table.chat-table th,.plugin-msg table.plugin-table td,.plugin-msg table.plugin-table th{border:1px solid rgba(17,24,39,.12);padding:8px 10px;text-align:left;vertical-align:top}.msg.bot table.chat-table thead th,.plugin-msg table.plugin-table thead th{background:rgba(37,99,235,.06);color:#1f2937;font-weight:600}.msg-heading{background:rgba(37,99,235,.05);border-left:3px solid var(--chat-primary-solid);border-radius:4px;color:#1f2937;font-weight:600;margin:16px 0 8px;padding:10px 12px}.msg-heading.heading-1{font-size:18px}.msg-heading.heading-2{font-size:17px}.msg-heading.heading-3{font-size:16px}.typing-dots{align-items:center;display:flex;gap:4px;justify-content:center}.typing-dots span{animation:typing 1.4s ease-in-out infinite;background-color:#6b7280;border-radius:50%;height:6px;width:6px}.typing-dots span:first-child{animation-delay:-.32s}.typing-dots span:nth-child(2){animation-delay:-.16s}@keyframes typing{0%,80%,to{opacity:.5;transform:scale(.8)}40%{opacity:1;transform:scale(1)}}.chat-input{background:#f8fafc;border-top:1px solid #ddd;display:flex;padding:8px}.chat-input-field{flex:1;position:relative}.chat-input-field input{width:100%}.custom-placeholder{color:#9ca3af;left:16px;overflow:hidden;pointer-events:none;position:absolute;text-overflow:ellipsis;top:50%;transform:translateY(-50%);transition:opacity .2s ease,visibility .2s ease;white-space:nowrap}.custom-placeholder-highlight{color:var(--chat-placeholder-highlight-solid,#007bff);font-weight:600}.chat-input-field.has-value .custom-placeholder,.chat-input-field.is-focused .custom-placeholder{opacity:0;visibility:hidden}.chat-input input{background:#fff;border:1px solid #d1d5db;border-radius:8px;flex:1;min-height:20px;outline:none;padding:16px;transition:border-color .2s ease,box-shadow .2s ease}.chat-input input:focus{border-color:#2563eb;box-shadow:0 0 0 3px rgba(37,99,235,.1)}.chat-input input:disabled{background-color:#f3f4f6;color:#6b7280}.chat-input button{align-items:center;background:#fff;background-clip:padding-box,border-box;background-image:linear-gradient(#fff,#fff),var(--chat-primary);background-origin:border-box;border:2px solid transparent;border-radius:8px;box-shadow:0 1px 2px rgba(17,24,39,.08);color:#111827;cursor:pointer;display:flex;font-size:16px;justify-content:center;margin-left:8px;min-width:52px;padding:14px 18px;transition:box-shadow .2s ease,transform .1s ease}#chat-stop{min-width:44px}#chat-stop .icon{background-image:var(--chat-primary);background-repeat:no-repeat;background-size:100% 100%;display:block;height:18px;-webkit-mask-image:var(--icon-url);mask-image:var(--icon-url);-webkit-mask-position:center;mask-position:center;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:contain;mask-size:contain;width:18px}.chat-input button:hover:not(:disabled){box-shadow:0 6px 14px rgba(69,98,187,.25);transform:translateY(-1px)}.chat-input button:disabled{background-image:linear-gradient(#f3f4f6,#f3f4f6),linear-gradient(135deg,#d1d5db,#9ca3af);box-shadow:none;color:#9ca3af;cursor:not-allowed}.chat-input button .icon{background-color:var(--chat-primary);display:block;height:18px;width:18px}@media (max-width:768px){.chat-panel,.plugin-chat-panel{bottom:80px;height:min(80vh,600px);right:12px;width:min(92vw,420px)}.chat-input input{font-size:14px;padding:14px}.chat-input button{font-size:15px;min-width:44px;padding:14px 16px}}@media (max-width:480px){.chat-toggle,.plugin-chat-toggle{bottom:max(12px,env(safe-area-inset-bottom));font-size:24px;height:56px;right:12px;width:56px}.chat-panel,.plugin-chat-panel{border-radius:12px;bottom:max(72px,calc(env(safe-area-inset-bottom) + 56px));height:calc(100vh - 120px);left:8px;max-height:85vh;right:8px;width:auto}.chat-header,.plugin-chat-header{font-size:15px;padding:12px}.chat-title,.plugin-chat-title{font-size:15px}.chat-global-logo,.plugin-chat-global-logo{height:24px;width:24px}.chat-box{padding:10px}.msg{gap:6px;max-width:95%}}@media (max-width:360px){.chat-panel,.plugin-chat-panel{border-radius:10px;bottom:max(68px,calc(env(safe-area-inset-bottom) + 52px));height:calc(100vh - 110px);left:6px;max-height:88vh;right:6px}.chat-input input{font-size:14px;padding:12px}.chat-input button{font-size:14px;min-width:42px;padding:12px 14px}}.ai-disclaimer,.plugin-ai-disclaimer{background-color:#f9fafb;border-top:1px solid #e5e7eb;color:#6b7280;font-size:11px;font-style:italic;opacity:.8;padding:4px 8px;text-align:center}@media (max-width:768px){.ai-disclaimer,.plugin-ai-disclaimer{font-size:10px;padding:3px 6px}}