:root{--xhe-ink:#0b1f36;--xhe-accent:#2563eb;--xhe-bg:#0f172a;--xhe-panel:#111b2e;--xhe-line:rgba(255,255,255,.12)}
.xhe-ai *{box-sizing:border-box}
.xhe-ai-fab{position:fixed;right:24px;bottom:24px;z-index:9998;width:58px;height:58px;border-radius:50%;border:none;cursor:pointer;background:linear-gradient(135deg,#2563eb,#1d4ed8);color:#fff;display:flex;align-items:center;justify-content:center;box-shadow:0 8px 24px rgba(37,99,235,.45);transition:transform .2s ease}
.xhe-ai-fab:hover{transform:scale(1.06)}
.xhe-ai-panel{position:fixed;right:24px;bottom:96px;z-index:9999;width:min(380px,calc(100vw - 32px));height:min(560px,calc(100vh - 140px));display:flex;flex-direction:column;border-radius:16px;overflow:hidden;background:var(--xhe-panel);color:#e2e8f0;border:1px solid var(--xhe-line);box-shadow:0 24px 60px rgba(2,8,23,.55);font-family:inherit}
.xhe-ai-panel[hidden]{display:none}
.xhe-ai-head{padding:16px 18px;background:linear-gradient(135deg,#0b1f36,#111b2e);border-bottom:1px solid var(--xhe-line);display:flex;align-items:center;gap:12px}
.xhe-ai-avatar{width:40px;height:40px;border-radius:50%;background:linear-gradient(135deg,#2563eb,#1d4ed8);display:flex;align-items:center;justify-content:center;flex:0 0 auto;color:#fff}
.xhe-ai-head-t{flex:1;min-width:0}
.xhe-ai-title{font-size:15px;font-weight:700;color:#f8fafc;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.xhe-ai-subtitle{font-size:12px;color:#94a3b8;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.xhe-ai-close{background:none;border:none;color:#94a3b8;cursor:pointer;font-size:20px;line-height:1;padding:4px}
.xhe-ai-close:hover{color:#fff}
.xhe-ai-body{flex:1;overflow-y:auto;padding:16px 14px;display:flex;flex-direction:column;gap:10px;background:#0d1728}
.xhe-ai-msg{max-width:86%;padding:10px 13px;border-radius:14px;font-size:13.5px;line-height:1.55;white-space:pre-wrap;word-break:break-word}
.xhe-ai-msg.user{align-self:flex-end;background:linear-gradient(135deg,#2563eb,#1d4ed8);color:#fff;border-bottom-right-radius:4px}
.xhe-ai-msg.assistant{align-self:flex-start;background:#1e293b;color:#e2e8f0;border-bottom-left-radius:4px}
.xhe-ai-msg a{color:#93c5fd;word-break:break-all}
.xhe-ai-typing{align-self:flex-start;background:#1e293b;border-radius:14px;border-bottom-left-radius:4px;padding:12px 14px;display:inline-flex;gap:5px}
.xhe-ai-typing span{width:7px;height:7px;border-radius:50%;background:#94a3b8;animation:xhe-blink 1.2s infinite}
.xhe-ai-typing span:nth-child(2){animation-delay:.18s}
.xhe-ai-typing span:nth-child(3){animation-delay:.36s}
@keyframes xhe-blink{0%,80%,100%{opacity:.25}40%{opacity:1}}
.xhe-ai-foot{border-top:1px solid var(--xhe-line);padding:10px 12px;background:#0f172a;display:flex;gap:8px;align-items:center}
.xhe-ai-input{flex:1;background:#1e293b;border:1px solid var(--xhe-line);border-radius:10px;color:#e2e8f0;padding:10px 12px;font-size:13.5px;outline:none;resize:none}
.xhe-ai-input:focus{border-color:#3b82f6}
.xhe-ai-send{background:linear-gradient(135deg,#2563eb,#1d4ed8);border:none;border-radius:10px;color:#fff;width:44px;height:42px;cursor:pointer;display:flex;align-items:center;justify-content:center;flex:0 0 auto}
.xhe-ai-send:disabled{opacity:.5;cursor:not-allowed}
.xhe-ai-hint{padding:8px 12px 12px;font-size:11.5px;color:#64748b;display:flex;justify-content:space-between;gap:8px;background:#0f172a;border-top:1px solid rgba(255,255,255,.05)}
.xhe-ai-hint a{color:#93c5fd;text-decoration:none}
.xhe-ai-hint a:hover{text-decoration:underline}
.xhe-ai-rtl.xhe-ai-fab{right:auto;left:24px}
.xhe-ai-rtl.xhe-ai-panel{right:auto;left:24px}
@media (max-width:520px){.xhe-ai-fab{right:14px;bottom:14px}.xhe-ai-panel{right:8px;left:8px;bottom:84px;width:auto}}
