/* ============================================================
   WP DeepSeek AI Support 前端聊天弹窗样式
   作用域均以 #wpdas-root 限定，避免与主题样式冲突
   ============================================================ */
#wpdas-root, #wpdas-root * { box-sizing: border-box; }

/* 右下角悬浮按钮 */
#wpdas-launcher{
  position: fixed; right: 20px; bottom: 20px; z-index: 99990;
  width: 56px; height: 56px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--wpdas-primary, #1273eb); color: #fff;
  box-shadow: 0 6px 20px rgba(0,0,0,.25);
  display: flex; align-items: center; justify-content: center;
}
#wpdas-launcher svg{ width: 28px; height: 28px; fill: #fff; }

/* 弹窗主体 */
#wpdas-panel{
  position: fixed; right: 20px; bottom: 86px; z-index: 99991;
  width: 360px; max-width: calc(100vw - 24px); height: 520px; max-height: calc(100vh - 110px);
  background: #fff; border-radius: 12px; overflow: hidden; display: none;
  flex-direction: column; box-shadow: 0 12px 40px rgba(0,0,0,.22);
  font-family: -apple-system, "Segoe UI", Roboto, Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
}
#wpdas-panel.is-open{ display: flex; }

#wpdas-head{
  background: var(--wpdas-primary, #1273eb); color: #fff;
  padding: 12px 14px; display: flex; align-items: center; gap: 8px;
}
#wpdas-head .wpdas-title{ font-weight: 700; font-size: 15px; flex: 1; }
#wpdas-head select{ font-size: 12px; border: 0; border-radius: 4px; padding: 2px 4px; }
#wpdas-close{ background: transparent; border: 0; color: #fff; font-size: 20px; cursor: pointer; }

/* 消息区 */
#wpdas-msgs{ flex: 1; overflow-y: auto; padding: 12px; background: #f6f8fb; }
.wpdas-msg-row{ margin: 0 0 10px; display: flex; }
.wpdas-msg-row.user{ justify-content: flex-end; }
.wpdas-bubble{
  max-width: 80%; padding: 8px 11px; border-radius: 10px; font-size: 13.5px; line-height: 1.5;
  word-break: break-word; white-space: pre-wrap;
}
.wpdas-msg-row.user .wpdas-bubble{ background: var(--wpdas-primary, #1273eb); color: #fff; border-bottom-right-radius: 2px; }
.wpdas-msg-row.ai .wpdas-bubble,
.wpdas-msg-row.system .wpdas-bubble{ background: #fff; color: #1f2937; border: 1px solid #e5e9ef; border-bottom-left-radius: 2px; }
.wpdas-bubble .wpdas-kb{ margin-bottom: 8px; }
.wpdas-bubble a{ color: var(--wpdas-primary, #1273eb); }

/* 人工卡片 */
.wpdas-human-card{
  background: #fff; border: 1px dashed var(--wpdas-primary, #1273eb);
  border-radius: 10px; padding: 12px; text-align: center;
}
.wpdas-human-card a{
  display: inline-block; margin-top: 8px; background: #25D366; color: #fff;
  padding: 9px 16px; border-radius: 8px; text-decoration: none; font-weight: 700; font-size: 13px;
}

/* 邮箱采集 */
#wpdas-email-gate{ padding: 14px; background: #fff; border-top: 1px solid #eef2f7; }
#wpdas-email-gate input{ width: 100%; height: 40px; border: 1px solid #c6d0da; border-radius: 6px; padding: 0 10px; font-size: 14px; }
#wpdas-email-gate button{ width: 100%; height: 40px; margin-top: 8px; border: 0; border-radius: 6px; background: var(--wpdas-primary, #1273eb); color: #fff; font-weight: 700; cursor: pointer; }
#wpdas-email-err{ color: #c0392b; font-size: 12px; margin-top: 6px; display: none; }

/* 输入区 */
#wpdas-input{ display: flex; gap: 6px; padding: 10px; border-top: 1px solid #eef2f7; background: #fff; }
#wpdas-input textarea{ flex: 1; resize: none; height: 40px; max-height: 90px; border: 1px solid #c6d0da; border-radius: 6px; padding: 9px 10px; font-size: 14px; }
#wpdas-input button{ flex: 0 0 auto; border: 0; border-radius: 6px; background: var(--wpdas-primary, #1273eb); color: #fff; font-weight: 700; padding: 0 14px; cursor: pointer; }
#wpdas-input .wpdas-cur{ flex: 0 0 auto; border: 1px solid #c6d0da; border-radius: 6px; font-size: 12px; }

.wpdas-typing{ font-size: 12px; color: #888; padding: 0 14px 8px; }

/* RTL（阿拉伯语） */
#wpdas-panel.wpdas-rtl{ direction: rtl; }
#wpdas-panel.wpdas-rtl .wpdas-msg-row.user{ justify-content: flex-start; }

/* 移动端 */
@media (max-width: 480px){
  #wpdas-panel{ right: 0; bottom: 0; width: 100vw; height: 100vh; max-height: 100vh; border-radius: 0; }
  #wpdas-launcher{ right: 14px; bottom: 14px; }
}

/* ===== 头部语言/币种下拉美化 ===== */
#wpdas-head select{
  appearance:none; -webkit-appearance:none;
  background:rgba(255,255,255,.18); color:#fff; border:1px solid rgba(255,255,255,.35);
  border-radius:14px; padding:3px 22px 3px 10px; font-size:12px; cursor:pointer; line-height:1.4;
  background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='10' fill='white'><path d='M0 2l5 6 5-6z'/></svg>");
  background-repeat:no-repeat; background-position:right 7px center;
}
#wpdas-head select:hover{ background-color:rgba(255,255,255,.28); }
#wpdas-head select option{ color:#1f2937; }

/* ===== 快捷问题选项 chips ===== */
.wpdas-quick{ display:flex; flex-wrap:wrap; gap:8px; margin:4px 2px 10px; }
.wpdas-chip{
  border:1px solid var(--wpdas-primary,#1273eb); color:var(--wpdas-primary,#1273eb);
  background:#fff; border-radius:18px; padding:7px 14px; font-size:13px; cursor:pointer; transition:.15s;
}
.wpdas-chip:hover{ background:var(--wpdas-primary,#1273eb); color:#fff; }

/* ===== 人工卡片 ===== */
.wpdas-human-title{ font-size:13.5px; color:#1f2937; margin-bottom:10px; }
.wpdas-wa-btn{
  display:inline-flex; align-items:center; justify-content:center; gap:4px;
  background:#25D366; color:#fff !important; padding:10px 18px; border-radius:8px;
  text-decoration:none; font-weight:700; font-size:13.5px;
}
.wpdas-wa-btn:hover{ background:#1ebe5b; }
.wpdas-wechat{ margin-top:12px; padding-top:12px; border-top:1px dashed #e5e9ef; }
.wpdas-wechat-label{ font-size:12.5px; color:#555; margin-bottom:8px; }
.wpdas-wechat-qr{ width:160px; max-width:80%; height:auto; border:1px solid #eee; border-radius:8px; }

/* 邮箱网关第二个输入框间距已内联，统一样式 */
#wpdas-email-gate input[type="text"]{ width:100%; height:40px; border:1px solid #c6d0da; border-radius:6px; padding:0 10px; font-size:14px; }