/* AI 悬浮球 */
.ai-fab{position:fixed;right:24px;bottom:24px;width:56px;height:56px;border-radius:50%;background:radial-gradient(circle at 30% 20%,#8b9cff 0%,#667eea 34%,#5536a7 100%);color:#fff;display:flex;align-items:center;justify-content:center;cursor:pointer;z-index:9999;box-shadow:0 4px 20px rgba(102,126,234,.4);font-weight:bold;font-size:14px;user-select:none;transition:transform .2s,box-shadow .2s}
.ai-fab:hover{transform:scale(1.08);box-shadow:0 6px 28px rgba(102,126,234,.55)}
.ai-fab.dragging{transition:none;cursor:grabbing}
.ai-fab.edge-hidden{right:-36px;width:72px;opacity:.5}
.ai-fab.edge-hidden:hover{right:24px;width:56px;opacity:1}
.ai-fab.edge-left{left:-36px;right:auto;width:72px;opacity:.5}
.ai-fab.edge-left:hover{left:24px;right:auto;width:56px;opacity:1}
.ai-fab-pulse{position:absolute;inset:-4px;border-radius:50%;border:2px solid rgba(102,126,234,.6);animation:aiPulse 2s ease-out infinite}
@keyframes aiPulse{0%{transform:scale(.9);opacity:.8}100%{transform:scale(1.4);opacity:0}}
/* AI 对话面板 */
.ai-panel{position:fixed;right:24px;bottom:92px;width:400px;height:600px;max-height:calc(100vh - 120px);background:#fff;border-radius:16px;box-shadow:0 12px 48px rgba(0,0,0,.18);z-index:9998;display:flex;flex-direction:column;overflow:hidden;border:1px solid #eee}
.ai-panel-header{padding:14px 16px;background:radial-gradient(circle at 30% 20%,#8b9cff 0%,#667eea 34%,#5536a7 100%);color:#fff;display:flex;align-items:center;justify-content:space-between;flex-shrink:0}
.ai-panel-title{display:flex;align-items:center;gap:10px;font-weight:600;font-size:15px}
.ai-panel-title .dot{width:8px;height:8px;border-radius:50%;background:#4ade80;box-shadow:0 0 8px #4ade80}
.ai-panel-close{width:28px;height:28px;border-radius:50%;background:rgba(255,255,255,.2);border:0;color:#fff;cursor:pointer;font-size:16px;display:flex;align-items:center;justify-content:center}
.ai-panel-close:hover{background:rgba(255,255,255,.3)}
.ai-messages{flex:1;overflow-y:auto;padding:16px;background:#f8f9fc;display:flex;flex-direction:column;gap:12px}
.ai-msg{display:flex;gap:8px;max-width:85%;animation:aiMsgIn .25s ease}
.ai-msg.user{align-self:flex-end;flex-direction:row-reverse}
.ai-msg-avatar{width:32px;height:32px;border-radius:50%;flex-shrink:0;display:flex;align-items:center;justify-content:center;font-size:14px;font-weight:bold;color:#fff}
.ai-msg.assistant .ai-msg-avatar{background:linear-gradient(135deg,#667eea,#764ba2)}
.ai-msg.user .ai-msg-avatar{background:#4b5563}
.ai-msg-bubble{padding:10px 14px;border-radius:12px;font-size:14px;line-height:1.6;white-space:pre-wrap;word-break:break-word}
.ai-msg.assistant .ai-msg-bubble{background:#fff;border:1px solid #e5e7eb;border-top-left-radius:4px}
.ai-msg.user .ai-msg-bubble{background:linear-gradient(135deg,#667eea,#764ba2);color:#fff;border-top-right-radius:4px}
.ai-msg.typing .ai-msg-bubble{color:#999;font-style:italic}
.ai-input-area{padding:12px;border-top:1px solid #eee;background:#fff;flex-shrink:0}
.ai-input-row{display:flex;gap:8px;align-items:flex-end}
.ai-input{flex:1;border:1px solid #e5e7eb;border-radius:10px;padding:10px 12px;font-size:14px;resize:none;min-height:40px;max-height:120px;font-family:inherit;outline:none;transition:border-color .2s}
.ai-input:focus{border-color:#667eea}
.ai-send-btn{height:40px;padding:0 16px;border:0;border-radius:10px;background:linear-gradient(135deg,#667eea,#764ba2);color:#fff;font-size:14px;cursor:pointer;font-weight:500;white-space:nowrap}
.ai-send-btn:disabled{opacity:.5;cursor:not-allowed}
.ai-toolbar{display:flex;gap:6px;margin-bottom:8px}
.ai-tool-btn{padding:4px 10px;border:1px solid #e5e7eb;border-radius:6px;background:#fff;font-size:12px;color:#666;cursor:pointer;display:flex;align-items:center;gap:4px}
.ai-tool-btn:hover{border-color:#667eea;color:#667eea}
.ai-quota{font-size:11px;color:#999;padding:0 4px}
.ai-file-preview{position:relative;display:inline-block;margin-right:8px;margin-bottom:4px}
.ai-file-preview img{width:60px;height:60px;object-fit:cover;border-radius:6px;border:1px solid #e5e7eb}
.ai-file-remove{position:absolute;top:-6px;right:-6px;width:18px;height:18px;border-radius:50%;background:#ef4444;color:#fff;border:0;font-size:12px;cursor:pointer;display:flex;align-items:center;justify-content:center;line-height:1}
@media (max-width:768px){.ai-panel{right:0;bottom:0;width:100%;height:100%;max-height:none;border-radius:0}}

/* 边缘提示（靠边隐藏后的小突起） */
.ai-edge-hint{position:fixed;top:50%;transform:translateY(-50%);width:24px;height:60px;background:radial-gradient(circle at 30% 20%,#8b9cff 0%,#667eea 34%,#5536a7 100%);color:#fff;display:flex;align-items:center;justify-content:center;cursor:pointer;z-index:9999;font-size:12px;font-weight:bold;border-radius:6px 0 0 6px;box-shadow:0 2px 12px rgba(102,126,234,.35);transition:all .2s}
.ai-edge-hint:hover{width:28px}
.ai-edge-left{left:0;border-radius:0 6px 6px 0}
.ai-edge-right{right:0;border-radius:6px 0 0 6px}

/* 面板淡入淡出 */
.ai-fade-enter-active,.ai-fade-leave-active{transition:all .25s ease}
.ai-fade-enter-from,.ai-fade-leave-to{opacity:0;transform:translateY(10px) scale(.95)}

/* 错误消息 */
.ai-msg-bubble.error{color:#ef4444;background:#fef2f2;border-color:#fecaca}

.ai-fab-mark{display:flex;width:38px;height:38px;align-items:center;justify-content:center;filter:drop-shadow(0 2px 4px rgba(20,10,70,.25))}
.ai-fab-mark svg{width:100%;height:100%;overflow:visible}
.ai-fab-mark svg>path:first-child{fill:rgba(255,255,255,.97)}
.ai-fab-face{fill:none;stroke:#6553c7;stroke-width:2.4;stroke-linecap:round}
.ai-fab-eye{fill:#6553c7}
.ai-fab-star{fill:#ffe074;stroke:#fff;stroke-width:.8}
.ai-edge-hint .ai-fab-mark{width:28px;height:28px}
