/* ==========================================================
 * 在线客服浮窗（自动弹出 / 一键拨打 / 需求问询）
 * ========================================================== */

.cs-wrap { position: fixed; right: 22px; bottom: 22px; z-index: 88; font-size: 13.5px; }

/* ---------- 悬浮按钮 ---------- */
.cs-launcher {
  display: flex; align-items: center; gap: 8px;
  height: 46px; padding: 0 18px 0 14px; border-radius: 23px;
  background: linear-gradient(135deg, #ff8a2b, #ff5a00); color: #fff;
  font-size: 14px; font-weight: 600; box-shadow: 0 8px 22px rgba(255, 106, 0, .34);
  cursor: pointer; border: none; transition: transform .18s, box-shadow .18s;
}
.cs-launcher:hover { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(255, 106, 0, .42); }
.cs-launcher .cs-ico { font-size: 17px; line-height: 1; }
.cs-launcher .cs-pulse {
  width: 7px; height: 7px; border-radius: 50%; background: #fff; margin-left: 2px;
  box-shadow: 0 0 0 0 rgba(255, 255, 255, .8); animation: csPulse 2s infinite;
}
@keyframes csPulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 255, 255, .75); }
  70% { box-shadow: 0 0 0 8px rgba(255, 255, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); }
}

/* ---------- 面板 ---------- */
.cs-panel {
  position: absolute; right: 0; bottom: 60px; width: 358px;
  background: #fff; border-radius: 14px; overflow: hidden;
  box-shadow: 0 18px 48px rgba(120, 74, 30, .22), 0 0 0 1px rgba(240, 229, 219, .9);
  display: none; flex-direction: column; max-height: 560px;
}
.cs-panel.show { display: flex; animation: csIn .28s cubic-bezier(.2, .8, .3, 1); }
@keyframes csIn {
  from { opacity: 0; transform: translateY(14px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.cs-head {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px;
  background: linear-gradient(135deg, #ff8a2b, #ff5a00); color: #fff;
}
.cs-ava {
  width: 36px; height: 36px; border-radius: 50%; background: rgba(255, 255, 255, .22);
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 15px;
  border: 1px solid rgba(255, 255, 255, .5); flex-shrink: 0;
}
.cs-who { flex: 1; line-height: 1.35; }
.cs-who b { font-size: 14px; display: block; }
.cs-who span { font-size: 11.5px; opacity: .92; display: flex; align-items: center; gap: 5px; }
.cs-who i { width: 6px; height: 6px; border-radius: 50%; background: #7dffb0; display: inline-block; }
.cs-close {
  width: 26px; height: 26px; border-radius: 50%; background: rgba(255, 255, 255, .18);
  color: #fff; font-size: 15px; line-height: 1; display: flex; align-items: center; justify-content: center;
  cursor: pointer; border: none;
}
.cs-close:hover { background: rgba(255, 255, 255, .32); }

/* ---------- 对话区 ---------- */
.cs-body {
  flex: 1; overflow-y: auto; padding: 14px 14px 6px; background: #fffaf5;
  min-height: 180px; scroll-behavior: smooth;
}
.cs-msg { display: flex; gap: 8px; margin-bottom: 12px; align-items: flex-end; }
.cs-msg .ava {
  width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0;
  background: var(--brand-soft, #fff2e6); color: var(--brand-dark, #c2540a);
  font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center;
}
.cs-bubble {
  max-width: 250px; padding: 9px 12px; border-radius: 12px 12px 12px 3px;
  background: #fff; color: var(--ink, #231a13); line-height: 1.62; font-size: 13px;
  box-shadow: 0 2px 10px rgba(120, 74, 30, .07); word-break: break-word;
}
.cs-msg.me { justify-content: flex-end; }
.cs-msg.me .cs-bubble {
  background: linear-gradient(135deg, #ff8a2b, #ff5a00); color: #fff;
  border-radius: 12px 12px 3px 12px; box-shadow: 0 4px 12px rgba(255, 106, 0, .22);
}
.cs-typing { display: flex; gap: 4px; padding: 4px 2px; }
.cs-typing i {
  width: 5px; height: 5px; border-radius: 50%; background: #d8c2ae; display: block;
  animation: csBlink 1.1s infinite;
}
.cs-typing i:nth-child(2) { animation-delay: .18s; }
.cs-typing i:nth-child(3) { animation-delay: .36s; }
@keyframes csBlink { 0%, 60%, 100% { opacity: .3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-2px); } }

/* 选项按钮 */
.cs-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 2px 0 14px 34px; }
.cs-chip {
  border: 1px solid #ffd2ae; background: #fff; color: var(--brand-dark, #c2540a);
  border-radius: 15px; padding: 6px 13px; font-size: 12.5px; cursor: pointer; transition: .16s;
}
.cs-chip:hover { background: var(--brand, #ff6a00); border-color: var(--brand, #ff6a00); color: #fff; }

/* 表单区 */
.cs-form { margin: 0 0 12px 34px; display: flex; gap: 8px; }
.cs-form input {
  flex: 1; height: 38px; border: 1px solid var(--line, #f1e8e0); border-radius: 8px;
  padding: 0 12px; font-size: 13.5px; outline: none; font-family: inherit; background: #fff;
}
.cs-form input:focus { border-color: var(--brand, #ff6a00); }
.cs-form button {
  height: 38px; padding: 0 16px; border-radius: 8px; background: var(--brand, #ff6a00);
  color: #fff; font-size: 13.5px; font-weight: 600; cursor: pointer; border: none; flex-shrink: 0;
}
.cs-form button:disabled { background: #d8c9bc; cursor: not-allowed; }
.cs-skip {
  margin: -6px 0 12px 34px; font-size: 12px; color: var(--muted, #8b7f75);
  background: none; border: none; padding: 0; cursor: pointer; text-decoration: underline;
}
.cs-done-acts { display: flex; gap: 8px; margin: 0 0 12px 34px; }
.cs-done-acts a, .cs-done-acts button {
  flex: 1; height: 36px; border-radius: 8px; font-size: 12.5px; font-weight: 600;
  display: flex; align-items: center; justify-content: center; gap: 5px; cursor: pointer; text-decoration: none;
}
.cs-done-acts .call { background: var(--brand, #ff6a00); color: #fff; border: none; }
.cs-done-acts .wx { background: #fff; color: var(--brand-dark, #c2540a); border: 1px solid #ffd2ae; }

/* ---------- 电话条 ---------- */
.cs-phone-bar {
  display: flex; align-items: center; gap: 8px; padding: 9px 12px;
  border-top: 1px solid var(--line, #f1e8e0); background: #fff;
}
.cs-call {
  flex: 1; height: 38px; border-radius: 9px; display: flex; align-items: center; justify-content: center; gap: 6px;
  background: linear-gradient(135deg, #ff8a2b, #ff5a00); color: #fff; font-size: 13.5px; font-weight: 700;
  text-decoration: none; box-shadow: 0 5px 14px rgba(255, 106, 0, .26);
}
.cs-call:hover { filter: brightness(1.04); }
.cs-copy-wx {
  height: 38px; padding: 0 12px; border-radius: 9px; background: #fff;
  border: 1px solid #ffd2ae; color: var(--brand-dark, #c2540a); font-size: 12.5px; font-weight: 600; cursor: pointer;
}
.cs-copy-wx:hover { background: var(--brand-soft, #fff2e6); }

/* ---------- 输入条 ---------- */
.cs-inputbar {
  display: none; align-items: center; gap: 8px; padding: 9px 12px 11px;
  border-top: 1px solid var(--line, #f1e8e0); background: #fff;
}
.cs-inputbar.show { display: flex; }
.cs-inputbar input {
  flex: 1; height: 36px; border: 1px solid var(--line, #f1e8e0); border-radius: 18px;
  padding: 0 14px; font-size: 13px; outline: none; font-family: inherit;
}
.cs-inputbar input:focus { border-color: var(--brand, #ff6a00); }
.cs-inputbar button {
  width: 36px; height: 36px; border-radius: 50%; background: var(--brand, #ff6a00); color: #fff;
  border: none; cursor: pointer; font-size: 14px; flex-shrink: 0;
}

/* ---------- 小屏适配 ---------- */
@media (max-width: 640px) {
  .cs-wrap { right: 12px; bottom: 12px; }
  .cs-panel { width: calc(100vw - 24px); max-height: 70vh; bottom: 58px; }
  .cs-launcher { height: 42px; padding: 0 14px 0 12px; font-size: 13px; }
  .cs-bubble { max-width: 210px; }
}

/* 系统提示（自动回复） */
.cs-msg.sys { justify-content: center; }
.cs-msg.sys span { font-size: 11.5px; color: #8b7f75; background: #f6f1ec; border-radius: 12px; padding: 4px 12px; line-height: 1.6; }
