/* 侧边智能客服：默认仅显示侧边入口，点击后展开 */
.zw-chat-tab{position:fixed;right:0;top:50%;transform:translateY(-50%);z-index:9998;width:46px;min-height:156px;border:0;border-radius:14px 0 0 14px;background:linear-gradient(135deg,#1667b3,#7048c8);color:#fff;box-shadow:0 8px 24px rgba(22,103,179,.28);cursor:pointer;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:9px;padding:14px 0;transition:width .18s ease,box-shadow .18s ease}
.zw-chat-tab:hover{width:52px;box-shadow:0 10px 30px rgba(22,103,179,.38)}
.zw-chat-tab .zw-chat-ico{width:24px;height:24px;border-radius:50%;background:rgba(255,255,255,.2);display:grid;place-items:center;font-size:14px;font-weight:700}
.zw-chat-tab .zw-chat-label{writing-mode:vertical-rl;letter-spacing:3px;font-size:14px;font-weight:600}
.zw-chat-tab .zw-chat-dot{position:absolute;top:12px;left:8px;width:8px;height:8px;border-radius:50%;background:#8ce6a8;box-shadow:0 0 0 3px rgba(140,230,168,.25)}

.zw-chat-panel{position:fixed;right:66px;bottom:22px;width:372px;max-width:calc(100vw - 86px);height:min(560px,calc(100vh - 44px));z-index:9999;background:#fff;border:1px solid #e3e9f0;border-radius:16px;box-shadow:0 18px 50px rgba(18,42,72,.22);display:none;flex-direction:column;overflow:hidden;animation:zwChatIn .18s ease-out}
.zw-chat-panel.open{display:flex}
@keyframes zwChatIn{from{opacity:0;transform:translateY(12px) scale(.98)}to{opacity:1;transform:none}}

.zw-chat-head{padding:15px 16px;background:linear-gradient(135deg,#1667b3,#7048c8);color:#fff;display:flex;align-items:center;justify-content:space-between}
.zw-chat-head b{display:block;font-size:15px}
.zw-chat-head small{display:block;opacity:.85;font-size:11px;margin-top:2px}
.zw-chat-close{border:0;background:rgba(255,255,255,.16);color:#fff;width:28px;height:28px;border-radius:8px;cursor:pointer;font-size:16px;line-height:1}
.zw-chat-close:hover{background:rgba(255,255,255,.28)}

.zw-chat-body{flex:1;overflow-y:auto;padding:14px;background:#f7f9fc;display:flex;flex-direction:column;gap:10px}
.zw-chat-msg{max-width:88%;padding:10px 12px;border-radius:12px;font-size:13px;line-height:1.65;white-space:pre-wrap;word-break:break-word}
.zw-chat-msg.bot{background:#fff;border:1px solid #e8edf3;align-self:flex-start;border-bottom-left-radius:4px;color:#263445}
.zw-chat-msg.user{background:#1667b3;color:#fff;align-self:flex-end;border-bottom-right-radius:4px}
.zw-chat-msg .zw-chat-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:9px}
.zw-chat-actions button{border:1px solid #1667b3;background:#eff6ff;color:#1667b3;border-radius:18px;padding:5px 11px;font-size:12px;cursor:pointer}
.zw-chat-actions button:hover{background:#1667b3;color:#fff}
.zw-chat-quick{display:flex;flex-wrap:wrap;gap:7px;margin:2px 0 4px}
.zw-chat-quick button{border:1px solid #d8e2ec;background:#fff;color:#4a5b6e;border-radius:16px;padding:5px 10px;font-size:12px;cursor:pointer}
.zw-chat-quick button:hover{border-color:#1667b3;color:#1667b3}
.zw-chat-typing{color:#8c99a8;font-size:12px;align-self:flex-start}

.zw-chat-foot{border-top:1px solid #edf1f6;padding:10px;display:flex;gap:8px;background:#fff}
.zw-chat-foot textarea{flex:1;resize:none;height:42px;border:1px solid #dfe6ee;border-radius:9px;padding:10px;font:13px/1.4 inherit;outline:none}
.zw-chat-foot textarea:focus{border-color:#1667b3;box-shadow:0 0 0 3px rgba(22,103,179,.08)}
.zw-chat-send{border:0;border-radius:9px;background:#1667b3;color:#fff;padding:0 16px;font-size:13px;font-weight:600;cursor:pointer}
.zw-chat-send:disabled{opacity:.55;cursor:not-allowed}
@media(max-width:600px){
  .zw-chat-panel{right:54px;width:calc(100vw - 66px);bottom:8px;height:min(72vh,560px)}
  .zw-chat-tab{top:auto;bottom:10px;transform:none;min-height:104px;width:40px;padding:10px 0;gap:6px;border-radius:12px 0 0 12px}
  .zw-chat-tab:hover{width:44px}
  .zw-chat-tab .zw-chat-ico{width:20px;height:20px;font-size:12px}
  /* 手机端只显示图标，文字竖排会显得按钮过长 */
  .zw-chat-tab .zw-chat-label{display:none}
  .zw-chat-tab{min-height:52px;width:38px;padding:8px 0;gap:0;border-radius:10px 0 0 10px}
}
