/* 官网留资窗 · 右下角在线客服对话组件（微盟风格） */
#llbcLeadRoot {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 9999;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}

/* 悬浮气泡 */
.llbc-lead-bubble {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0066FF 0%, #1a3b85 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0, 102, 255, .35);
  position: relative;
  transition: transform .2s ease;
}
.llbc-lead-bubble:hover { transform: scale(1.06); }
.llbc-lead-bubble .llbc-lead-bubble-tip {
  position: absolute;
  top: -6px; right: -6px;
  background: #ff3b30;
  color: #fff;
  font-size: 11px;
  line-height: 1;
  padding: 3px 6px;
  border-radius: 10px;
}

/* 面板 */
.llbc-lead-panel {
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: 340px;
  max-width: calc(100vw - 36px);
  height: 520px;
  max-height: calc(100vh - 40px);
  background: #f5f7fa;
  border: 0.5px solid #e4e9f0;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 16px 40px rgba(26, 59, 133, .22);
  display: flex;
  flex-direction: column;
}
.llbc-lead-panel[hidden] { display: none; }

/* 顶部品牌头栏 */
.llbc-lead-head {
  background: linear-gradient(135deg, #1a3b85 0%, #0066FF 100%);
  color: #fff;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.llbc-lead-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: rgba(255,255,255,.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 600; flex-shrink: 0;
}
.llbc-lead-head-main { flex: 1; min-width: 0; }
.llbc-lead-title { font-size: 15px; font-weight: 600; line-height: 1.2; }
.llbc-lead-status { font-size: 12px; opacity: .9; margin-top: 3px; display: flex; align-items: center; gap: 5px; }
.llbc-lead-status .dot {
  width: 7px; height: 7px; border-radius: 50%; background: #2bd47a;
  box-shadow: 0 0 0 2px rgba(43,212,122,.25);
}
.llbc-lead-close {
  background: transparent; border: none; color: rgba(255,255,255,.9);
  font-size: 20px; line-height: 1; cursor: pointer; padding: 0 2px; flex-shrink: 0;
}
.llbc-lead-close:hover { color: #fff; }

/* 对话区域 */
.llbc-lead-chat {
  flex: 1;
  overflow-y: auto;
  padding: 14px 14px 6px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.llbc-msg { display: flex; gap: 8px; align-items: flex-start; }
.llbc-msg-service .llbc-msg-avatar {
  width: 32px; height: 32px; border-radius: 8px; flex-shrink: 0;
  background: #1a3b85; color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 600;
}
.llbc-msg-visitor { flex-direction: row-reverse; }
.llbc-msg-visitor .llbc-msg-avatar {
  width: 32px; height: 32px; border-radius: 8px; flex-shrink: 0;
  background: #0066FF; color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 600;
}
.llbc-bubble {
  max-width: 78%;
  padding: 9px 12px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.55;
  word-break: break-word;
}
.llbc-msg-service .llbc-bubble {
  background: #fff;
  color: #1f2937;
  border-top-left-radius: 2px;
  box-shadow: 0 1px 2px rgba(0,0,0,.06);
}
.llbc-msg-visitor .llbc-bubble {
  background: #0066FF;
  color: #fff;
  border-top-right-radius: 2px;
}
.llbc-msg-time { font-size: 11px; color: #9aa4b2; margin-top: 4px; }

/* 表单卡片（嵌入对话流） */
.llbc-lead-card {
  background: #fff;
  border: 1px solid #e4e9fA;
  border-radius: 12px;
  padding: 12px;
  width: 100%;
  box-shadow: 0 1px 2px rgba(0,0,0,.06);
}
.llbc-lead-card-title { font-size: 13px; font-weight: 600; color: #1a3b85; margin-bottom: 10px; }
.llbc-lead-form input,
.llbc-lead-form select,
.llbc-lead-form textarea {
  width: 100%; box-sizing: border-box;
  padding: 9px 10px; margin-bottom: 9px;
  border: 1px solid #d9e1ee; border-radius: 8px;
  font-size: 13px; color: #333; background: #fff;
  font-family: inherit;
}
.llbc-lead-form textarea { resize: vertical; min-height: 52px; }
.llbc-lead-form input:focus,
.llbc-lead-form select:focus,
.llbc-lead-form textarea:focus {
  outline: none; border-color: #0066FF; box-shadow: 0 0 0 3px rgba(0,102,255,.12);
}
.llbc-lead-submit {
  width: 100%; background: #0066FF; color: #fff; border: none;
  border-radius: 8px; padding: 11px; font-size: 14px; font-weight: 600;
  cursor: pointer; margin-top: 2px;
}
.llbc-lead-submit:disabled { opacity: .6; cursor: default; }
.llbc-lead-privacy { font-size: 11px; color: #9aa4b2; text-align: center; margin-top: 8px; }
.llbc-lead-err { font-size: 12px; color: #e24b4a; margin: -4px 0 8px; min-height: 14px; }

/* 底部输入栏 */
.llbc-lead-foot {
  flex-shrink: 0;
  background: #fff;
  border-top: 1px solid #e4e9f0;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.llbc-lead-foot .llbc-emoji { font-size: 20px; cursor: pointer; user-select: none; flex-shrink: 0; }
.llbc-lead-foot input {
  flex: 1;
  border: 1px solid #e1e6ee;
  border-radius: 18px;
  padding: 8px 12px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
}
.llbc-lead-foot input:focus { border-color: #0066FF; }
.llbc-lead-send {
  background: #0066FF; color: #fff; border: none; border-radius: 18px;
  padding: 8px 16px; font-size: 13px; font-weight: 600; cursor: pointer; flex-shrink: 0;
}
.llbc-lead-send:disabled { opacity: .5; cursor: default; }

/* 成功态 */
.llbc-lead-success { text-align: center; padding: 8px 0; }
.llbc-lead-success .ok-icon {
  width: 40px; height: 40px; border-radius: 50%; background: #eaf3de;
  display: flex; align-items: center; justify-content: center; margin: 0 auto 8px;
}

/* 深色主题适配 */
[data-theme="dark"] .llbc-lead-panel { background: #161e29; border-color: #2a3543; }
[data-theme="dark"] .llbc-lead-chat { background: #161e29; }
[data-theme="dark"] .llbc-msg-service .llbc-bubble { background: #22304a; color: #e6ebf2; }
[data-theme="dark"] .llbc-lead-card { background: #1f2937; border-color: #2a3543; }
[data-theme="dark"] .llbc-lead-card-title { color: #6ea8ff; }
[data-theme="dark"] .llbc-lead-form input,
[data-theme="dark"] .llbc-lead-form select,
[data-theme="dark"] .llbc-lead-form textarea { background: #111820; border-color: #2a3543; color: #e6ebf2; }
[data-theme="dark"] .llbc-lead-foot { background: #1f2937; border-color: #2a3543; }
[data-theme="dark"] .llbc-lead-foot input { background: #111820; border-color: #2a3543; color: #e6ebf2; }
[data-theme="dark"] .llbc-lead-privacy,
[data-theme="dark"] .llbc-msg-time { color: #8a96a8; }

/* 移动端：底部全宽抽屉（PC 端保持右下角弹窗） */
@media (max-width: 768px) {
  .llbc-lead-bubble {
    right: 16px;
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  }
  .llbc-lead-panel {
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    width: 100%;
    max-width: 100%;
    height: 88vh;
    max-height: 88vh;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -8px 40px rgba(26, 59, 133, .25);
  }
  .llbc-lead-head { padding: 14px; }
  .llbc-lead-chat { padding: 14px 12px 8px; }
  .llbc-bubble { max-width: 84%; }
  .llbc-lead-foot {
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
  }
}
