/* lead-agent.css — 获客智能体悬浮组件样式 */

/* ── 悬浮入口按钮 ─────────────────────────── */
.lead-agent-float {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9998;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.lead-agent-bubble {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #151711, #586044);
  color: #fff;
  border: none;
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: 0 6px 28px rgba(21, 23, 17, 0.32);
  transition: transform 0.2s, box-shadow 0.2s;
  font-size: 24px;
  position: relative;
}

.lead-agent-bubble:hover {
  transform: scale(1.08);
  box-shadow: 0 10px 36px rgba(21, 23, 17, 0.4);
}

.lead-agent-bubble .badge-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #4caf50;
  border: 2px solid #fff;
}

.lead-agent-tooltip {
  background: #151711;
  color: #fff;
  padding: 8px 14px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: none;
}

.lead-agent-float:hover .lead-agent-tooltip {
  opacity: 1;
  transform: translateY(0);
}

.lead-agent-float.active .lead-agent-bubble {
  background: #b65b52;
}

/* ── 弹出面板 ─────────────────────────────── */
.lead-agent-panel {
  position: fixed;
  bottom: 96px;
  right: 24px;
  z-index: 9999;
  width: min(400px, calc(100vw - 32px));
  max-height: min(600px, calc(100vh - 130px));
  background: #fffdfa;
  border: 1px solid rgba(90, 84, 74, 0.18);
  border-radius: 18px;
  box-shadow: 0 20px 60px rgba(21, 23, 17, 0.2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: leadSlideUp 0.3s ease;
  display: none;
}

.lead-agent-panel.open {
  display: flex;
}

@keyframes leadSlideUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── 头部 ──────────────────────────────────── */
.lead-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 18px;
  border-bottom: 1px solid #eee8df;
  background: #faf8f3;
  flex-shrink: 0;
}

.lead-panel-head h3 {
  font-size: 16px;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.lead-panel-head h3 .icon {
  font-size: 20px;
}

.lead-panel-close {
  border: none;
  background: none;
  cursor: pointer;
  font-size: 20px;
  color: #8a8e86;
  padding: 4px 8px;
  border-radius: 8px;
  line-height: 1;
}

.lead-panel-close:hover {
  background: #eeece5;
  color: #151711;
}

/* ── 进度条 ────────────────────────────────── */
.lead-progress {
  padding: 8px 18px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.lead-progress-bar {
  flex: 1;
  height: 4px;
  background: #eee8df;
  border-radius: 4px;
  overflow: hidden;
}

.lead-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #586044, #4e6a3f);
  border-radius: 4px;
  transition: width 0.4s ease;
}

.lead-progress-text {
  font-size: 12px;
  color: #8a8e86;
  white-space: nowrap;
  min-width: 45px;
  text-align: right;
}

/* ── 主体内容 ──────────────────────────────── */
.lead-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ── 问题和选项 ────────────────────────────── */
.lead-question {
  font-size: 15px;
  font-weight: 800;
  color: #151711;
  line-height: 1.5;
}

.lead-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.lead-option {
  display: block;
  width: 100%;
  text-align: left;
  padding: 13px 15px;
  border: 1.5px solid #ddd8ce;
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  color: #151711;
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
}

.lead-option:hover {
  border-color: #4e6a3f;
  background: #f7faf4;
  transform: translateX(3px);
}

.lead-option:active {
  transform: scale(0.98);
}

.lead-option.selected {
  border-color: #4e6a3f;
  background: #e8f0e7;
}

/* ── 自由文本输入 ──────────────────────────── */
.lead-free-text-row {
  display: flex;
  gap: 8px;
}

.lead-free-text-row input {
  flex: 1;
  border: 1.5px solid #ddd8ce;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 14px;
  background: #fff;
  color: #151711;
}

.lead-free-text-row input:focus {
  outline: none;
  border-color: #4e6a3f;
  box-shadow: 0 0 0 3px rgba(78,106,63,.12);
}

.lead-free-text-row button {
  border: none;
  border-radius: 12px;
  padding: 12px 18px;
  background: #151711;
  color: #fff;
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
}

.lead-free-text-row button:disabled {
  background: #c7c3bb;
  cursor: not-allowed;
}

/* ── 联系方式输入 ──────────────────────────── */
.lead-contact-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.lead-contact-form label {
  display: block;
  font-size: 13px;
  color: #60675e;
  font-weight: 800;
  margin-bottom: 2px;
}

.lead-contact-form input {
  width: 100%;
  border: 1.5px solid #ddd8ce;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 14px;
  background: #fff;
}

.lead-contact-form input:focus {
  outline: none;
  border-color: #4e6a3f;
  box-shadow: 0 0 0 3px rgba(78,106,63,.12);
}

.lead-contact-submit {
  border: none;
  border-radius: 12px;
  padding: 13px 16px;
  background: #151711;
  color: #fff;
  font-weight: 800;
  font-size: 15px;
  cursor: pointer;
  margin-top: 4px;
}

.lead-contact-submit:disabled {
  background: #c7c3bb;
  cursor: not-allowed;
}

.lead-contact-hint {
  font-size: 12px;
  color: #8a8e86;
  line-height: 1.5;
}

/* ── 完成页 ────────────────────────────────── */
.lead-complete {
  text-align: center;
  padding: 10px 0;
}

.lead-complete-icon {
  font-size: 48px;
  margin-bottom: 10px;
}

.lead-complete h4 {
  font-size: 18px;
  margin: 0 0 6px;
}

.lead-complete p {
  font-size: 14px;
  color: #71776f;
  margin: 0 0 16px;
  line-height: 1.6;
}

.lead-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.lead-action-btn {
  display: block;
  width: 100%;
  text-align: center;
  padding: 13px 16px;
  border-radius: 12px;
  font-weight: 800;
  font-size: 14px;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: transform 0.15s;
}

.lead-action-btn:hover {
  transform: translateY(-1px);
}

.lead-action-btn.primary {
  background: #151711;
  color: #fff;
}

.lead-action-btn.secondary {
  background: #fff;
  color: #151711;
  border: 1.5px solid #151711;
}

.lead-action-btn.contact-highlight {
  background: linear-gradient(135deg, #4e6a3f, #586044);
  color: #fff;
  border: none;
}

.lead-score-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 8px;
}

.lead-score-badge.high {
  background: #ffe7e5;
  color: #ad3e34;
}

.lead-score-badge.medium {
  background: #fff1d6;
  color: #9a6600;
}

.lead-score-badge.low {
  background: #e4f0ff;
  color: #235eaa;
}

/* ── 优化4: 正在输入动画 ────────────────────── */
.lead-typing {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px 20px;
  gap: 14px;
}

.lead-typing-dots {
  display: flex;
  gap: 6px;
}

.lead-typing-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #c7c3bb;
  animation: leadDotBounce 1.2s infinite ease-in-out;
}

.lead-typing-dots span:nth-child(1) { animation-delay: 0s; }
.lead-typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.lead-typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes leadDotBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-8px); opacity: 1; background: #586044; }
}

.lead-typing-text {
  font-size: 13px;
  color: #8a8e86;
}

/* ── 优化1: 免费试用钩子 ────────────────────── */
.lead-trial-hook {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 18px 8px 10px;
  gap: 10px;
}

.lead-trial-icon {
  font-size: 44px;
}

.lead-trial-title {
  font-size: 16px;
  font-weight: 800;
  color: #151711;
  line-height: 1.4;
}

.lead-trial-title strong {
  color: #4e6a3f;
}

.lead-trial-desc {
  font-size: 14px;
  color: #71776f;
  line-height: 1.6;
}

.lead-trial-desc strong {
  color: #151711;
}

.lead-trial-skip {
  border: none;
  background: none;
  color: #8a8e86;
  font-size: 13px;
  cursor: pointer;
  padding: 8px 16px;
  margin-top: 4px;
}

.lead-trial-skip:hover {
  color: #151711;
}

/* ── 优化3: 预设推荐选项 ────────────────────── */
.lead-option.hinted {
  border-color: #4e6a3f;
  background: #f0f6ee;
  position: relative;
}

.hint-tag {
  display: inline-block;
  background: #4e6a3f;
  color: #fff;
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 999px;
  margin-right: 6px;
  font-weight: 800;
  vertical-align: middle;
}

/* ── 优化2: 微信快捷引导 ────────────────────── */
.lead-wechat-hint {
  background: #f0f9ea;
  border: 1px solid #c8e0b8;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  color: #3d5a30;
  line-height: 1.6;
}

.lead-wechat-hint strong {
  color: #151711;
}

/* ── AI 推荐语 ──────────────────────────────── */
.lead-ai-rec {
  background: #faf8f3;
  border: 1px solid #eee8df;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  color: #505961;
  line-height: 1.6;
  margin-bottom: 8px;
}

/* ── 移动端适配 ────────────────────────────── */
@media (max-width: 480px) {
  .lead-agent-panel {
    right: 8px;
    bottom: 80px;
    width: calc(100vw - 16px);
    max-height: calc(100vh - 100px);
    border-radius: 16px;
  }

  .lead-agent-float {
    bottom: 16px;
    right: 12px;
  }

  .lead-agent-bubble {
    width: 48px;
    height: 48px;
    font-size: 20px;
  }
}
