/* WIBCK 官网 AI 智能客服聊天窗样式 —— 官网橄榄绿体系（#668C0E / #4E6B12），无蓝色、无渐变阴影堆砌。
   所有类名带 wa- 前缀，避免污染官网现有样式。 */

.wa-fab {
  position: fixed;
  right: 18px;
  bottom: 86px; /* 按钮组顺序（2026-11-24 老板定）：回到顶部在最上（官网 .to-top bottom:154）、智能客服居中、提交需求在最下（bottom:18），同宽 104、同高 50、间距 18 */
  width: 104px;
  height: 50px;
  box-sizing: border-box;
  z-index: 9990;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 3px;
  border: none;
  border-radius: 999px;
  background: #668C0E;
  color: #fff;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(78, 107, 18, 0.35);
}
.wa-fab:hover { background: #4E6B12; }
.wa-fab.wa-hidden { display: none; }
.wa-fab-text { font-weight: 600; letter-spacing: 1px; }

.wa-panel {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 9991;
  width: 380px;
  max-width: calc(100vw - 24px);
  height: 560px;
  max-height: calc(100dvh - 36px);
  display: none;
  flex-direction: column;
  background: #fff;
  color-scheme: light;
  border: 1px solid #dfe5d2;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 10px 34px rgba(40, 54, 8, 0.22);
  font-family: inherit;
  color: #2b2b2b;
}
.wa-panel.wa-open { display: flex; }

.wa-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 14px;
  background: #668C0E;
  color: #fff;
}
.wa-avatar { width: 36px; height: 36px; flex: none; border-radius: 9px; }
.wa-head-main { flex: 1; }
.wa-head-main strong { display: block; font-size: 16px; letter-spacing: 0.5px; }
.wa-head-main span { display: block; margin-top: 3px; font-size: 12px; opacity: 0.88; font-weight: 300; }
.wa-close {
  border: none;
  background: transparent;
  color: #fff;
  font-size: 22px;
  line-height: 1;
  padding: 2px 6px;
  cursor: pointer;
}

.wa-msgs {
  flex: 1;
  overflow-y: auto;
  padding: 14px 12px;
  background: #f7f8f3;
}
.wa-row { display: flex; align-items: flex-start; margin-bottom: 10px; }
.wa-msg-avatar { width: 28px; height: 28px; flex: none; margin-right: 8px; border-radius: 7px; }
.wa-row-user { justify-content: flex-end; }
.wa-bubble {
  max-width: 82%;
  padding: 9px 12px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}
.wa-row-assistant .wa-bubble {
  background: #fff;
  border: 1px solid #e3e8d5;
  border-bottom-left-radius: 4px;
}
.wa-row-user .wa-bubble {
  background: #668C0E;
  color: #fff;
  border-bottom-right-radius: 4px;
}

/* 系统提示行：居中灰字 */
.wa-row-system {
  display: block;
  text-align: center;
  font-size: 12px;
  color: #8a927c;
  line-height: 1.5;
  padding: 2px 18px;
}

/* 技术顾问消息：与小威区分（徽标头像 + 名签 + 浅橄榄底） */
.wa-agent-avatar {
  flex: none;
  width: 28px;
  height: 28px;
  margin-right: 8px;
  border-radius: 7px;
  background: #4E6B12;
  color: #fff;
  font-size: 11px;
  line-height: 28px;
  text-align: center;
}
.wa-agent-wrap { max-width: 82%; }
.wa-agent-name { font-size: 11px; color: #7a7f72; margin-bottom: 3px; }
.wa-row-agent .wa-bubble {
  background: #eef3df;
  border: 1px solid #d3ddb8;
  border-bottom-left-radius: 4px;
}
/* 顾问照片头像：圆形裁切（.wa-agent-avatar 提供 28px 尺寸与间距） */
.wa-agent-avatar-img { object-fit: cover; border-radius: 50%; background: #e8edd9; }

/* 人工等待「正在输入...」：气泡间歇显隐（约 4 秒一轮：亮约 2.2 秒、隐约 1.8 秒），示意顾问在线 */
.wa-typing-bubble {
  color: #7a7f72;
  font-size: 13px;
  animation: wa-typing-blink 4s ease-in-out infinite;
}
@keyframes wa-typing-blink {
  0%, 55% { opacity: 1; }
  78%, 92% { opacity: 0.08; }
  100% { opacity: 1; }
}

.wa-lead {
  padding: 10px 12px;
  border-top: 1px solid #e3e8d5;
  background: #fbfcf7;
}
.wa-lead p { margin: 0 0 8px; font-size: 13px; color: #4E6B12; }

/* 留资表单头：标题 + 关闭按钮（v20261125h10） */
.wa-lead-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.wa-lead-head .wa-lead-tip { flex: 1; min-width: 0; margin: 0; }
.wa-lead-close {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: #4E6B12;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.wa-lead-close:hover { background: #e7efda; }
.wa-lead input {
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 8px;
  padding: 9px 10px;
  border: 1px solid #ccd6b4;
  border-radius: 8px;
  font-size: 14px;
  color: #222;
  -webkit-text-fill-color: #222;
  background: #fff;
}
.wa-lead-btn {
  width: 100%;
  padding: 9px 0;
  border: none;
  border-radius: 8px;
  background: #668C0E;
  color: #fff;
  font-size: 14px;
  cursor: pointer;
}
.wa-lead-btn:hover { background: #4E6B12; }

/* 短信验证码行（v20261125h9）：验证码输入框 + 获取验证码按钮并排 */
.wa-lead-code-row { display: flex; gap: 8px; margin-bottom: 8px; }
.wa-lead-code-row .wa-lead-code { flex: 1; min-width: 0; margin-bottom: 0; }
.wa-lead-code-btn {
  flex-shrink: 0;
  padding: 9px 12px;
  border: 1px solid #668C0E;
  border-radius: 8px;
  background: #fff;
  color: #4E6B12;
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
}
.wa-lead-code-btn:hover { background: #e7efda; }
.wa-lead-code-btn:disabled { border-color: #ccd6b4; color: #9aa58a; cursor: default; background: #f5f7f0; }

.wa-foot {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid #e3e8d5;
  background: #fff;
}
.wa-input {
  flex: 1;
  min-width: 0;
  padding: 10px 11px;
  border: 1px solid #ccd6b4;
  border-radius: 9px;
  font-size: 14px;
  color: #222;
  background: #fff;
  -webkit-text-fill-color: #222;
}
.wa-input::placeholder { color: #9aa58a; -webkit-text-fill-color: #9aa58a; }
.wa-input:focus, .wa-lead input:focus { outline: 2px solid #668C0E; outline-offset: 0; border-color: #668C0E; }
.wa-send {
  padding: 0 18px;
  border: none;
  border-radius: 9px;
  background: #668C0E;
  color: #fff;
  font-size: 14px;
  cursor: pointer;
}
.wa-send:hover { background: #4E6B12; }
.wa-send:disabled { background: #a9bd7d; cursor: default; }

.wa-tip {
  padding: 7px 12px 9px;
  font-size: 12px;
  color: #7a7f72;
  background: #fff;
  text-align: center;
}

/* 全站已有 button{color:inherit} 兜底规则，这里再显式声明一遍，防止 iOS 把按钮文字渲染成系统蓝 */
.wa-fab, .wa-close, .wa-send, .wa-lead-btn { color: #fff; }

@media (max-width: 560px) {
  .wa-fab { right: 18px; bottom: 86px; }
  .wa-panel {
    left: 12px;
    right: 12px;
    bottom: 12px;
    width: auto;
    max-width: none;
    height: 74dvh;
    max-height: 74dvh;
    border-radius: 14px;
  }
  /* 移动端输入框字号 <16px 会触发 iOS/安卓浏览器聚焦自动放大、页面拉伸，必须固定 16px（2026-11-24 已上线修复，勿删） */
  .wa-input, .wa-lead input { font-size: 16px; }
}

/* 提交需求入口（欢迎语与聊中触发消息共用）：橄榄绿加粗纯文字，无边框/背景/圆角/按钮内边距 */
.wa-lead-cta{display:inline;margin:0;padding:0;border:0;border-radius:0;background:none;color:#4e6b12;font-family:inherit;font-size:inherit;font-weight:700;line-height:inherit;cursor:pointer;vertical-align:baseline;text-decoration:none}
.wa-lead-cta:hover{background:none;color:#3f580e}
.wa-lead-cta:focus-visible{text-decoration:underline}
.wa-phone-link{color:#1a6fd4;font-weight:600;text-decoration:underline}
