/* 在线客服聊天弹窗 */
.chat-widget{position:fixed;bottom:80px;right:30px;width:380px;height:520px;background:#fff;border-radius:12px;box-shadow:0 8px 32px rgba(0,0,0,.18);z-index:9999;display:none;flex-direction:column;overflow:hidden;animation:chatSlideUp .3s ease}
.chat-widget.show{display:flex}
@keyframes chatSlideUp{from{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}
.chat-wd-head{display:flex;align-items:center;justify-content:space-between;padding:14px 18px;background:linear-gradient(135deg,#2e7dff,#1a5fcc);color:#fff;flex-shrink:0}
.chat-wd-title{display:flex;align-items:center;gap:8px;font-size:16px;font-weight:600}
.chat-wd-status{display:inline-flex;align-items:center;gap:4px;font-size:12px;opacity:.85;margin-left:8px}
.chat-wd-status .dot{width:8px;height:8px;border-radius:50%;background:#4ade80}
.chat-wd-status.offline .dot{background:#94a3b8}
.chat-wd-close{cursor:pointer;opacity:.8;transition:opacity .2s;padding:4px}
.chat-wd-close:hover{opacity:1}
.chat-wd-body{flex:1;overflow-y:auto;padding:16px;background:#f5f7fa;display:flex;flex-direction:column;gap:12px}
.chat-wd-body::-webkit-scrollbar{width:6px}
.chat-wd-body::-webkit-scrollbar-thumb{background:#cbd5e1;border-radius:3px}
.chat-msg{display:flex;gap:8px;max-width:85%;animation:chatFadeIn .2s ease}
@keyframes chatFadeIn{from{opacity:0}to{opacity:1}}
.chat-msg.visitor{align-self:flex-end;flex-direction:row-reverse}
.chat-msg.agent{align-self:flex-start}
.chat-msg.system{align-self:center;max-width:90%}
.chat-msg-avatar{width:36px;height:36px;border-radius:50%;flex-shrink:0;display:flex;align-items:center;justify-content:center;font-size:14px;color:#fff}
.chat-msg.visitor .chat-msg-avatar{background:#6366f1}
.chat-msg.agent .chat-msg-avatar{background:#2e7dff}
.chat-msg.system .chat-msg-avatar{display:none}
.chat-msg-bubble{padding:10px 14px;border-radius:10px;font-size:14px;line-height:1.5;word-break:break-word;position:relative}
.chat-msg.visitor .chat-msg-bubble{background:#6366f1;color:#fff;border-top-right-radius:2px}
.chat-msg.agent .chat-msg-bubble{background:#fff;color:#1e293b;border-top-left-radius:2px;box-shadow:0 1px 3px rgba(0,0,0,.08)}
.chat-msg.system .chat-msg-bubble{background:#e2e8f0;color:#64748b;font-size:12px;padding:6px 12px;border-radius:6px}
.chat-msg-time{font-size:11px;color:#94a3b8;margin-top:4px}
.chat-msg.visitor .chat-msg-time{text-align:right}
.chat-wd-quick{display:flex;flex-wrap:wrap;gap:6px;padding:8px 16px;background:#f8fafc;border-top:1px solid #f1f5f9;flex-shrink:0}
.chat-quick-btn{padding:5px 12px;background:#fff;border:1px solid #e2e8f0;border-radius:16px;font-size:12px;color:#475569;cursor:pointer;transition:all .2s}
.chat-quick-btn:hover{background:#2e7dff;color:#fff;border-color:#2e7dff}
.chat-wd-foot{padding:12px 16px;background:#fff;border-top:1px solid #f1f5f9;flex-shrink:0}
.chat-wd-input-wrap{display:flex;gap:8px;align-items:flex-end}
.chat-wd-input{flex:1;padding:8px 12px;border:1px solid #e2e8f0;border-radius:8px;font-size:14px;resize:none;height:40px;max-height:80px;outline:none;transition:border-color .2s;font-family:inherit}
.chat-wd-input:focus{border-color:#2e7dff}
.chat-wd-send{padding:0 18px;height:40px;background:#2e7dff;color:#fff;border:none;border-radius:8px;font-size:14px;cursor:pointer;transition:background .2s;flex-shrink:0}
.chat-wd-send:hover{background:#1a5fcc}
.chat-wd-send:disabled{background:#94a3b8;cursor:not-allowed}
.chat-wd-empty{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;color:#94a3b8;gap:8px}
.chat-wd-empty svg{width:48px;height:48px;opacity:.4}
.chat-wd-rate{position:absolute;inset:0;background:rgba(255,255,255,.95);display:none;flex-direction:column;align-items:center;justify-content:center;gap:16px;z-index:10}
.chat-wd-rate.show{display:flex}
.chat-wd-rate h4{font-size:16px;color:#1e293b;margin:0}
.chat-wd-rate-stars{display:flex;gap:8px}
.chat-wd-rate-star{cursor:pointer;color:#cbd5e1;transition:color .2s;font-size:28px}
.chat-wd-rate-star.active{color:#fbbf24}
.chat-wd-rate textarea{width:280px;padding:8px 12px;border:1px solid #e2e8f0;border-radius:8px;font-size:13px;resize:none;outline:none;font-family:inherit}
.chat-wd-rate button{padding:8px 24px;background:#2e7dff;color:#fff;border:none;border-radius:8px;cursor:pointer;font-size:14px}
.chat-wd-notification{position:absolute;top:-8px;right:-8px;width:18px;height:18px;background:#ef4444;color:#fff;border-radius:50%;font-size:11px;display:flex;align-items:center;justify-content:center;border:2px solid #fff}