/* ============================================================
   网站智能客服挂件样式（颜色沿用 style.css 的变量）
   ============================================================ */
.cw-launch{position:fixed;right:18px;bottom:18px;z-index:45;display:flex;align-items:center;gap:8px;background:var(--ink);color:#fff;border:0;border-radius:999px;padding:12px 18px 12px 14px;font:inherit;font-weight:700;cursor:pointer;box-shadow:0 8px 24px rgba(20,33,61,.28);min-height:48px}
.cw-launch svg{width:22px;height:22px;flex:none}
.cw-launch .dot{position:absolute;top:4px;right:6px;width:12px;height:12px;border-radius:50%;background:var(--tag);border:2px solid var(--ink);display:none}
.cw-launch.unread .dot{display:block}
body.has-chat .wa-float{bottom:80px}
.cw-teaser{position:fixed;right:18px;bottom:80px;z-index:45;max-width:260px;background:#fff;border:1px solid var(--line);border-radius:12px 12px 4px 12px;padding:12px 30px 12px 14px;font-size:.92rem;box-shadow:0 8px 24px rgba(20,33,61,.15);cursor:pointer}
.cw-teaser button{position:absolute;top:4px;right:4px;background:none;border:0;font-size:18px;line-height:1;cursor:pointer;color:var(--steel);width:28px;height:28px}
body.has-chat .cw-teaser{bottom:140px}

.cw-panel{position:fixed;right:18px;bottom:18px;z-index:60;width:380px;max-width:calc(100vw - 24px);height:min(620px,calc(100vh - 36px));background:#fff;border:1px solid var(--line);border-radius:14px;box-shadow:0 18px 48px rgba(20,33,61,.25);display:flex;flex-direction:column;overflow:hidden;font-size:15px}
.cw-panel[hidden]{display:none}
.cw-head{background:var(--ink);color:#fff;padding:14px 14px 12px 16px;display:flex;align-items:center;gap:10px}
.cw-head b{display:block;font-stretch:85%;font-size:1.05rem;line-height:1.2}
.cw-head small{color:#c9cfdb;font-size:.8rem}
.cw-head .sp{flex:1}
.cw-head a,.cw-head button{color:#fff;background:rgba(255,255,255,.12);border:0;border-radius:999px;height:36px;min-width:36px;padding:0 12px;display:inline-flex;align-items:center;justify-content:center;font:inherit;font-size:.85rem;font-weight:600;cursor:pointer;text-decoration:none}
.cw-head a.wa{background:var(--wa)}
.cw-body{flex:1;overflow-y:auto;padding:14px;display:flex;flex-direction:column;gap:8px;background:var(--paper);overscroll-behavior:contain}
.cw-msg{max-width:85%;padding:9px 12px;border-radius:14px;line-height:1.45;white-space:pre-wrap;word-break:break-word}
.cw-msg.visitor{align-self:flex-end;background:var(--ink);color:#fff;border-bottom-right-radius:4px}
.cw-msg.ai,.cw-msg.human{align-self:flex-start;background:#fff;border:1px solid var(--line);border-bottom-left-radius:4px}
.cw-msg.human{border-color:#bfe3cd;background:#f1faf4}
.cw-msg .who{display:block;font-size:.72rem;color:var(--steel);margin-bottom:2px;font-weight:600}
.cw-typing{align-self:flex-start;background:#fff;border:1px solid var(--line);border-radius:14px;padding:10px 14px;display:flex;gap:4px}
.cw-typing i{width:6px;height:6px;border-radius:50%;background:var(--steel);animation:cwb 1s infinite}
.cw-typing i:nth-child(2){animation-delay:.15s}.cw-typing i:nth-child(3){animation-delay:.3s}
@keyframes cwb{0%,60%,100%{opacity:.3;transform:none}30%{opacity:1;transform:translateY(-3px)}}
.cw-quick{display:flex;flex-wrap:wrap;gap:6px;margin-top:4px}
.cw-quick button{background:#fff;border:1px solid var(--line);border-radius:999px;padding:7px 12px;font:inherit;font-size:.85rem;cursor:pointer;color:var(--ink);min-height:36px}
.cw-quick button:hover{border-color:var(--ink)}
.cw-card{align-self:stretch;background:#fff;border:1px solid var(--tag);border-radius:12px;padding:12px;display:grid;gap:8px}
.cw-card p{margin:0;font-size:.9rem}
.cw-card input{min-height:42px;padding:9px 10px;font-size:16px}
.cw-card .row2{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.cw-card .btn{min-height:42px;padding:9px 14px}
.cw-card .skip{position:static;background:none;border:0;color:var(--steel);font-size:.82rem;cursor:pointer;justify-self:start;padding:0}
.cw-foot{border-top:1px solid var(--line);padding:10px;display:flex;gap:8px;align-items:flex-end;background:#fff}
.cw-foot textarea{flex:1;min-height:44px;max-height:120px;resize:none;padding:10px 12px;border-radius:22px;font-size:16px;line-height:1.35}
.cw-foot button{width:44px;height:44px;min-height:44px;border-radius:50%;padding:0;flex:none}
.cw-foot button svg{width:20px;height:20px}
.cw-note{font-size:.72rem;color:var(--steel);text-align:center;padding:0 10px 8px;background:#fff}

@media (max-width:760px){
  .cw-launch{right:14px;bottom:calc(76px + var(--safe-b));padding:0;width:54px;height:54px;justify-content:center}
  .cw-launch span{display:none}
  .cw-teaser{right:14px;bottom:calc(140px + var(--safe-b))}
  .cw-panel{inset:0;width:100%;max-width:none;height:100%;height:100dvh;border-radius:0;border:0}
  .cw-foot{padding-bottom:calc(10px + var(--safe-b))}
  body.cw-open{overflow:hidden}
  body.cw-open .mbar{display:none}
}
@media (prefers-reduced-motion:reduce){.cw-typing i{animation:none}}
