/* ===== 全站智能体浮窗 ===== */
#ma-chat-root{position:fixed;right:18px;bottom:18px;z-index:99999;font-family:-apple-system,"PingFang SC","Microsoft YaHei",sans-serif}
#ma-chat-root *{box-sizing:border-box}
.ma-fab{width:56px;height:56px;border-radius:50%;background:linear-gradient(135deg,#4d6bfe,#7c5cff);color:#fff;border:none;cursor:pointer;box-shadow:0 6px 20px rgba(77,107,254,.4);display:flex;align-items:center;justify-content:center;font-size:24px;transition:transform .2s,box-shadow .2s}
.ma-fab:hover{transform:scale(1.06);box-shadow:0 8px 28px rgba(77,107,254,.55)}
.ma-fab .ma-dot{position:absolute;top:2px;right:2px;width:10px;height:10px;border-radius:50%;background:#22c55e;border:2px solid #fff}
.ma-panel{position:absolute;right:0;bottom:70px;width:360px;max-width:calc(100vw - 36px);height:520px;max-height:calc(100vh - 120px);background:#fff;border-radius:16px;box-shadow:0 12px 48px rgba(0,0,0,.18);display:flex;flex-direction:column;overflow:hidden;transform-origin:bottom right;animation:ma-pop .2s ease-out}
@keyframes ma-pop{from{transform:scale(.9);opacity:0}to{transform:scale(1);opacity:1}}
.ma-head{display:flex;align-items:center;gap:10px;padding:14px 16px;background:linear-gradient(135deg,#4d6bfe,#7c5cff);color:#fff}
.ma-avatar{width:34px;height:34px;border-radius:50%;background:rgba(255,255,255,.25);display:flex;align-items:center;justify-content:center;font-size:18px;flex-shrink:0}
.ma-head-text{flex:1;min-width:0}
.ma-head-title{font-size:14px;font-weight:600}
.ma-head-sub{font-size:11px;opacity:.85}
.ma-close{background:none;border:none;color:#fff;font-size:20px;cursor:pointer;padding:0 4px;line-height:1}
.ma-body{flex:1;overflow-y:auto;padding:14px;display:flex;flex-direction:column;gap:10px;background:#f7f8fc}
.ma-msg{max-width:82%;padding:9px 13px;border-radius:12px;font-size:13.5px;line-height:1.6;word-break:break-word;white-space:pre-wrap}
.ma-msg.ma-user{align-self:flex-end;background:#4d6bfe;color:#fff;border-bottom-right-radius:4px}
.ma-msg.ma-bot{align-self:flex-start;background:#fff;color:#1f2328;border:1px solid #ececec;border-bottom-left-radius:4px}
.ma-msg.ma-bot code{background:#f3f4f6;padding:1px 5px;border-radius:4px;font-size:12px}
.ma-typing{align-self:flex-start;display:flex;gap:4px;padding:10px 14px;background:#fff;border:1px solid #ececec;border-radius:12px;border-bottom-left-radius:4px}
.ma-typing span{width:6px;height:6px;border-radius:50%;background:#b8bdd1;animation:ma-bounce 1.2s infinite}
.ma-typing span:nth-child(2){animation-delay:.15s}
.ma-typing span:nth-child(3){animation-delay:.3s}
@keyframes ma-bounce{0%,60%,100%{transform:translateY(0)}30%{transform:translateY(-5px)}}
.ma-input{display:flex;gap:8px;padding:10px 12px;border-top:1px solid #ececec;background:#fff}
.ma-input input{flex:1;border:1px solid #e0e0e0;border-radius:10px;padding:9px 12px;font-size:13.5px;outline:none;font-family:inherit}
.ma-input input:focus{border-color:#4d6bfe}
.ma-send{background:#4d6bfe;color:#fff;border:none;border-radius:10px;padding:0 16px;cursor:pointer;font-size:13px;font-family:inherit}
.ma-send:disabled{background:#c8c8e8;cursor:not-allowed}
.ma-foot{padding:6px 14px 10px;font-size:11px;color:#9aa0b4;text-align:center;background:#f7f8fc}
.ma-hidden{display:none!important}
@media(max-width:480px){.ma-panel{width:calc(100vw - 24px);right:-6px;height:70vh}}
