/* ============================================
   AI智能客服样式 - 独立CSS文件避免模板解析冲突
   ============================================ */

/* === 浮动按钮 === */
.ai-fab { position:fixed !important; right:20px; bottom:30px; z-index:99999 !important; display:flex; flex-direction:column; align-items:center; gap:3px; width:56px; height:56px; border-radius:50%; background:linear-gradient(135deg,#1565c0,#42a5f5); color:#fff; cursor:pointer; box-shadow:0 4px 20px rgba(21,101,192,.35); transition:.3s; justify-content:center; }
.ai-fab:hover { transform:scale(1.1); box-shadow:0 6px 28px rgba(21,101,192,.45); }
.ai-fab:active { transform:scale(.9); }
.ai-fab i { font-size:24px; }
.ai-fab span { font-size:9px; font-weight:600; letter-spacing:1px; line-height:1; }

/* === 遮罩 === */
.ai-mask { display:none; position:fixed; inset:0; background:rgba(0,0,0,.25); z-index:99998 !important; backdrop-filter:blur(2px); }
.ai-mask.show { display:block; }

/* === 抽屉(studcenter) === */
.ai-drawer { position:fixed !important; right:-420px; top:0; width:400px; height:100vh; background:#fff; z-index:99999 !important; display:flex; flex-direction:column; box-shadow:-6px 0 32px rgba(0,0,0,.12); transition:right .35s cubic-bezier(.4,0,.2,1); }
.ai-drawer.open { right:0; }
.ai-drawer-header { display:flex; justify-content:space-between; align-items:center; padding:18px 20px; background:linear-gradient(135deg,#0d47a1,#1565c0 50%,#1e88e5); color:#fff; flex-shrink:0; }
.ai-header-left { display:flex; align-items:center; gap:12px; }
.ai-header-icon { width:42px; height:42px; border-radius:12px; background:rgba(255,255,255,.15); display:flex; align-items:center; justify-content:center; font-size:22px; backdrop-filter:blur(4px); }
.ai-header-title { font-size:17px; font-weight:700; letter-spacing:1px; }
.ai-header-sub { font-size:11px; opacity:.8; margin-top:2px; }
.ai-header-actions { display:flex; gap:6px; }
.ai-act-btn { width:30px; height:30px; border:none; border-radius:8px; background:rgba(255,255,255,.15); color:#fff; cursor:pointer; font-size:16px; display:flex; align-items:center; justify-content:center; transition:.2s; }
.ai-act-btn:hover { background:rgba(255,255,255,.25); }
.ai-drawer-body { flex:1; overflow-y:auto; padding:20px; background:linear-gradient(180deg,#f0f4fa 0%,#f8fafd 100%); }
.ai-drawer-footer { display:flex; gap:8px; padding:14px 16px; border-top:1px solid #e8edf2; background:#fff; flex-shrink:0; }

/* === 聊天弹窗(layer.open) === */
.ai-chat-box { display:flex; flex-direction:column; height:480px; background:#fff; }
.ai-chat-header { display:flex; justify-content:space-between; align-items:center; padding:12px 16px; border-bottom:1px solid #e8edf2; background:linear-gradient(135deg,#1565c0,#42a5f5); color:#fff; }
.ai-chat-title { font-size:15px; font-weight:600; }
.ai-chat-actions button { background:rgba(255,255,255,.2); border:none; color:#fff; width:28px; height:28px; border-radius:50%; cursor:pointer; font-size:16px; }
.ai-chat-actions button:hover { background:rgba(255,255,255,.3); }
.ai-chat-messages { flex:1; overflow-y:auto; padding:16px; background:#f5f7fa; }

/* === 欢迎区 === */
.ai-welcome { text-align:center; padding:30px 10px; }
.ai-welcome-icon { width:64px; height:64px; border-radius:20px; background:linear-gradient(135deg,#1565c0,#42a5f5); display:flex; align-items:center; justify-content:center; margin:0 auto 16px; font-size:30px; color:#fff; box-shadow:0 8px 24px rgba(21,101,192,.2); }
.ai-welcome-title { font-size:18px; font-weight:700; color:#1a237e; margin-bottom:8px; }
.ai-welcome-desc { font-size:13px; color:#78909c; line-height:1.7; margin-bottom:20px; }
.ai-quick-tags { display:flex; flex-wrap:wrap; justify-content:center; gap:8px; }
.ai-quick-tag { display:inline-block; padding:7px 14px; background:#fff; border:1px solid #d9e0e8; border-radius:20px; font-size:12px; color:#1565c0; cursor:pointer; transition:.2s; }
.ai-quick-tag:hover { background:#e3f2fd; border-color:#90caf9; }

/* === 消息气泡 === */
.ai-msg { margin-bottom:14px; display:flex; align-items:flex-start; }
.ai-msg-user { justify-content:flex-end; }
.ai-msg-assistant { justify-content:flex-start; }
.ai-msg-system { justify-content:center; }
.ai-msg-avatar { width:34px; height:34px; border-radius:10px; display:flex; align-items:center; justify-content:center; font-size:13px; font-weight:700; flex-shrink:0; }
.ai-msg-user .ai-msg-avatar { background:linear-gradient(135deg,#1565c0,#1e88e5); color:#fff; margin-left:10px; }
.ai-msg-assistant .ai-msg-avatar { background:linear-gradient(135deg,#0d47a1,#1565c0); color:#fff; margin-right:10px; }
.ai-msg-content { max-width:75%; padding:11px 15px; border-radius:14px; font-size:14px; line-height:1.7; word-break:break-word; }
.ai-msg-user .ai-msg-content { background:linear-gradient(135deg,#1565c0,#1e88e5); color:#fff; border-bottom-right-radius:4px; }
.ai-msg-assistant .ai-msg-content { background:#fff; color:#333; border-bottom-left-radius:4px; box-shadow:0 2px 8px rgba(0,0,0,.06); }
.ai-msg-system .ai-msg-content { background:#e3f2fd; color:#1565c0; font-size:13px; padding:8px 16px; border-radius:20px; }

/* === AI回复Markdown样式 === */
.ai-msg-content p { margin:0 0 6px; }
.ai-msg-content p:last-child { margin-bottom:0; }
.ai-msg-content strong { font-weight:700; }
.ai-msg-content ul, .ai-msg-content ol { margin:4px 0; padding-left:20px; }
.ai-msg-content li { margin-bottom:3px; }
.ai-msg-content h1,.ai-msg-content h2,.ai-msg-content h3,.ai-msg-content h4 { font-size:14px; font-weight:700; margin:6px 0 4px; }

/* === 输入区 === */
.ai-chat-input { display:flex; padding:12px; border-top:1px solid #e8edf2; background:#fff; gap:8px; }
.ai-input { flex:1; height:42px; border:1.5px solid #d9e0e8; border-radius:10px; padding:0 14px; font-size:14px; outline:none; transition:.2s; }
.ai-input:focus { border-color:#42a5f5; box-shadow:0 0 0 3px rgba(66,165,245,.12); }
.ai-send-btn { width:42px; height:42px; border:none; border-radius:10px; background:linear-gradient(135deg,#1565c0,#1e88e5); color:#fff; cursor:pointer; font-size:20px; display:flex; align-items:center; justify-content:center; transition:.2s; flex-shrink:0; }
.ai-send-btn:hover { transform:scale(1.05); background:linear-gradient(135deg,#1565c0,#1e88e5); }
.ai-send-btn:disabled { background:#b0bec5; cursor:not-allowed; transform:none; }

/* === typing指示器 === */
.ai-typing { display:inline-block; color:#1565c0; font-style:italic; }
.ai-cursor { display:inline-block; width:2px; height:1em; background:#1565c0; margin-left:2px; vertical-align:text-bottom; animation:ai-blink .7s infinite; }
@keyframes ai-blink { 0%,100%{opacity:1;} 50%{opacity:0;} }

/* === 响应式 === */
@media(max-width:480px){
    .ai-drawer { width:100%; right:-100%; }
    .ai-fab { right:12px; bottom:20px; width:48px; height:48px; }
    .ai-fab span { display:none; }
    .ai-chat-box { height:70vh; }
    .ai-chat-messages { padding:14px; }
    .ai-msg { margin-bottom:10px; }
    .ai-msg-avatar { width:30px; height:30px; font-size:12px; }
    .ai-msg-content { max-width:78%; padding:9px 12px; }
    .ai-chat-input { padding:10px; }
    .ai-input { height:36px; border:1px solid #d9e0e8; border-radius:6px; padding:0 12px; }
    .ai-send-btn { width:50px; height:36px; border-radius:6px; font-size:18px; }
}
