/* 在线客服 widget(public/chat.js 注入)。零依赖,只用 style.css 已有的品牌色变量兜底。 */
#ecochat-btn { position: fixed; right: 18px; bottom: 18px; z-index: 9990; width: 56px; height: 56px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--brand, #0f9d58); color: #fff; box-shadow: 0 6px 20px rgba(0,0,0,.22); display: flex; align-items: center; justify-content: center; transition: transform .15s; }
#ecochat-btn:hover { transform: scale(1.06); }
#ecochat-btn svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2; }
#ecochat-btn .ecochat-dot { position: absolute; top: 2px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #e5484d; color: #fff; font: 700 11px/18px system-ui, sans-serif; display: none; }
#ecochat-btn.has-unread .ecochat-dot { display: block; }
#ecochat { position: fixed; right: 18px; bottom: 86px; z-index: 9991; width: 360px; max-width: calc(100vw - 24px); height: 520px; max-height: calc(100vh - 110px);
  background: #fff; border-radius: 16px; box-shadow: 0 12px 40px rgba(0,0,0,.25); display: none; flex-direction: column; overflow: hidden; font: 14px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif; color: #1a1a1a; }
#ecochat.open { display: flex; }
.ecochat-head { background: var(--brand, #0f9d58); color: #fff; padding: 12px 14px; display: flex; align-items: center; gap: 10px; }
.ecochat-head b { font-size: 15px; }
.ecochat-head small { display: block; font-size: 12px; opacity: .9; }
.ecochat-head .ecochat-x { margin-left: auto; background: transparent; border: 0; color: #fff; font-size: 22px; cursor: pointer; line-height: 1; }
.ecochat-status { width: 9px; height: 9px; border-radius: 50%; background: #9aa0a6; flex: none; }
.ecochat-status.on { background: #7cf29a; box-shadow: 0 0 0 3px rgba(124,242,154,.35); }
.ecochat-log { flex: 1; overflow: auto; padding: 14px 12px; background: #f6f7f9; display: flex; flex-direction: column; gap: 8px; }
.ecochat-msg { max-width: 82%; padding: 8px 12px; border-radius: 14px; white-space: pre-wrap; word-break: break-word; }
.ecochat-msg.customer { align-self: flex-end; background: var(--brand, #0f9d58); color: #fff; border-bottom-right-radius: 4px; }
.ecochat-msg.staff, .ecochat-msg.ai { align-self: flex-start; background: #fff; border: 1px solid #e3e6ea; border-bottom-left-radius: 4px; }
.ecochat-msg.system { align-self: center; background: #fff5d6; color: #5c4400; font-size: 12.5px; text-align: center; max-width: 92%; }
.ecochat-msg .ecochat-who { display: block; font-size: 11px; opacity: .7; margin-bottom: 2px; }
.ecochat-intro { text-align: center; color: #555; font-size: 13px; padding: 10px 6px; }
.ecochat-contact { background: #fff; border-top: 1px solid #e3e6ea; padding: 10px 12px; display: none; gap: 6px; flex-direction: column; }
.ecochat-contact.show { display: flex; }
.ecochat-contact p { margin: 0 0 2px; font-size: 12.5px; color: #444; }
.ecochat-contact .row { display: flex; gap: 6px; }
.ecochat-contact input { flex: 1; min-width: 0; padding: 8px 10px; border: 1px solid #cfd4da; border-radius: 8px; font: inherit; }
.ecochat-contact button, .ecochat-wa { padding: 8px 12px; border-radius: 8px; border: 0; font: inherit; font-weight: 600; cursor: pointer; }
.ecochat-contact button { background: var(--brand, #0f9d58); color: #fff; }
.ecochat-wa { display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: #25d366; color: #fff; text-decoration: none; }
.ecochat-wa svg { width: 18px; height: 18px; fill: currentColor; }
.ecochat-form { display: flex; gap: 6px; padding: 10px 12px; border-top: 1px solid #e3e6ea; background: #fff; }
.ecochat-form textarea { flex: 1; resize: none; border: 1px solid #cfd4da; border-radius: 10px; padding: 8px 10px; font: inherit; max-height: 90px; }
.ecochat-form button { width: 42px; border: 0; border-radius: 10px; background: var(--brand, #0f9d58); color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.ecochat-form button svg { width: 20px; height: 20px; fill: currentColor; }
.ecochat-foot { font-size: 11px; color: #888; text-align: center; padding: 4px 8px 8px; background: #fff; }
.ecochat-foot a { color: inherit; }
.ecochat-err { color: #c0392b; font-size: 12px; padding: 0 12px 6px; background: #fff; }
@media (max-width: 480px) {
  #ecochat { right: 0; bottom: 0; width: 100vw; max-width: 100vw; height: 100vh; max-height: 100vh; border-radius: 0; }
  #ecochat.open ~ #ecochat-btn { display: none; }
}
