/* 在线客服浮窗 */
.tw-root{position:fixed;right:24px;bottom:24px;z-index:9998;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Microsoft YaHei",sans-serif}
.tw-btn{
  width:56px;height:56px;border-radius:50%;border:0;cursor:pointer;
  background:linear-gradient(140deg,#1b3ce0,#2f5cff 60%,#00b8a3);
  color:#fff;display:flex;align-items:center;justify-content:center;
  box-shadow:0 12px 28px -8px rgba(47,92,255,.65),0 4px 10px rgba(7,13,27,.15);
  transition:transform .22s cubic-bezier(.22,.61,.36,1),box-shadow .22s;
  position:relative;
}
.tw-btn:hover{transform:translateY(-3px) scale(1.04);box-shadow:0 18px 34px -8px rgba(47,92,255,.75)}
.tw-btn svg{width:26px;height:26px}
.tw-dot{
  position:absolute;top:1px;right:1px;min-width:18px;height:18px;border-radius:9px;
  background:#e5484d;color:#fff;font-size:11px;line-height:18px;text-align:center;
  padding:0 5px;border:2px solid #fff;display:none;
}
.tw-dot.on{display:block}

.tw-panel{
  position:fixed;right:24px;bottom:92px;width:364px;height:540px;max-height:calc(100vh - 130px);
  background:#fff;border-radius:18px;overflow:hidden;display:none;flex-direction:column;
  box-shadow:0 30px 70px -20px rgba(7,13,27,.45),0 8px 24px -12px rgba(7,13,27,.25);
  border:1px solid #e6eaf2;
  animation:twIn .24s cubic-bezier(.22,.61,.36,1);
}
.tw-panel.open{display:flex}
@keyframes twIn{from{opacity:0;transform:translateY(12px) scale(.98)}to{opacity:1;transform:none}}

.tw-head{
  background:linear-gradient(115deg,#0d1526,#1b3ce0 85%);
  color:#fff;padding:16px 18px;display:flex;align-items:center;gap:12px;flex:0 0 auto;
}
.tw-avatar{
  width:38px;height:38px;border-radius:12px;background:rgba(255,255,255,.14);
  border:1px solid rgba(255,255,255,.25);display:flex;align-items:center;justify-content:center;flex:0 0 auto;
}
.tw-avatar svg{width:20px;height:20px}
.tw-title{font-size:15px;font-weight:700;line-height:1.3}
.tw-status{font-size:12px;color:rgba(255,255,255,.9);display:flex;align-items:center;gap:6px;margin-top:3px}
.tw-status i{width:6px;height:6px;border-radius:50%;background:#5c6b8a;display:inline-block}
.tw-status i.on{background:#2ee07a;box-shadow:0 0 8px #2ee07a}
.tw-close{margin-left:auto;background:transparent;border:0;color:rgba(255,255,255,.8);cursor:pointer;padding:4px;line-height:0}
.tw-close:hover{color:#fff}
.tw-close svg{width:18px;height:18px}

.tw-body{flex:1;overflow-y:auto;padding:16px;background:#f6f8fc;display:flex;flex-direction:column;gap:10px}
.tw-tip{
  font-size:12.5px;color:#5d6683;background:#fff;border:1px solid #e6eaf2;border-radius:10px;
  padding:9px 12px;line-height:1.7;text-align:center;
}
.tw-msg{max-width:80%;padding:9px 13px;border-radius:13px;font-size:14px;line-height:1.65;word-break:break-word;white-space:pre-wrap}
.tw-msg.visitor{align-self:flex-end;background:#2f5cff;color:#fff;border-bottom-right-radius:4px}
.tw-msg.agent{align-self:flex-start;background:#fff;color:#0d1526;border:1px solid #e6eaf2;border-bottom-left-radius:4px}
.tw-time{display:block;font-size:10px;margin-top:4px;opacity:.5}

.tw-foot{flex:0 0 auto;border-top:1px solid #e6eaf2;padding:10px 12px 12px;background:#fff}
.tw-input{
  width:100%;border:1px solid #e6eaf2;border-radius:11px;padding:10px 12px;resize:none;
  font-size:14px;line-height:1.6;min-height:62px;max-height:120px;outline:none;background:#fbfcfe;
  font-family:inherit;color:#0d1526;
}
.tw-input:focus{border-color:#2f5cff;background:#fff;box-shadow:0 0 0 3px rgba(47,92,255,.12)}
.tw-actions{display:flex;align-items:center;gap:10px;margin-top:8px}
.tw-note{font-size:11.5px;color:#5d6683;line-height:1.5}
.tw-send{
  margin-left:auto;border:0;border-radius:10px;background:#2f5cff;color:#fff;
  padding:8px 18px;font-size:13.5px;font-weight:600;cursor:pointer;transition:background .2s;
}
.tw-send:hover{background:#1b3ce0}
.tw-send:disabled{opacity:.5;cursor:not-allowed}

@media (max-width:560px){
  .tw-root{right:16px;bottom:16px}
  .tw-panel{right:0;bottom:0;width:100vw;height:100dvh;max-height:none;border-radius:0;border:0}
  .tw-panel.open{border-radius:0}
  .tw-btn{width:52px;height:52px}
}
