/* AI 智能客服聊天组件（类名前缀 c-cs-，与 rail.html 的 c-side- 系列同思路隔离全局样式） */
/* 入口按钮 #cCsBtn 由 rail.html 提供（c-side-btn 同款圆形按钮，与电话/微信/回顶部放在一起）；本文件只管聊天面板 */

/* rail 在线咨询按钮在线红点角标（按钮本体样式复用 rail 的 .c-side-btn） */
.c-side-btn--cs { position: relative; }
.c-side-btn--cs .c-cs-dot {
  position: absolute; top: -3px; right: -3px; width: 12px; height: 12px;
  border-radius: 50%; background: #E53935; border: 2px solid #fff;
  animation: cCsPulse 1.8s infinite;
}
@keyframes cCsPulse { 0% { box-shadow: 0 0 0 0 rgba(229,57,53,.45) } 70% { box-shadow: 0 0 0 8px rgba(229,57,53,0) } 100% { box-shadow: 0 0 0 0 rgba(229,57,53,0) } }

/* 聊天面板：挂在 rail 左侧（rail right:24px 宽 56px，留 16px 间距） */
.c-cs-panel {
  position: fixed; right: 96px; bottom: 100px; z-index: 2147483001;
  width: 380px; height: 560px; max-height: calc(100vh - 90px);
  display: none; flex-direction: column; overflow: hidden;
  background: #fff; border: 1px solid #E6EAF2; border-radius: 16px;
  box-shadow: 0 42px 90px rgba(10, 30, 69, .22);
  font-family: inherit;
}
.c-cs-panel.is-open { display: flex; animation: cCsPanelIn .3s cubic-bezier(.16, 1, .3, 1); }
@keyframes cCsPanelIn { from { opacity: 0; transform: translateY(14px) } to { opacity: 1; transform: translateY(0) } }

.c-cs-head {
  flex: none; display: flex; align-items: center; gap: 10px;
  padding: 14px 16px; background: linear-gradient(135deg, #15356F, #1E5AC8); color: #fff;
}
.c-cs-head__avatar {
  width: 36px; height: 36px; border-radius: 50%; background: rgba(255,255,255,.18);
  display: flex; align-items: center; justify-content: center; font-size: 18px;
}
.c-cs-head__title { font-size: 15px; font-weight: 800; }
.c-cs-head__sub { font-size: 11px; opacity: .8; margin-top: 2px; display: flex; align-items: center; gap: 5px; }
.c-cs-head__sub::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: #4ADE80; }
.c-cs-head__close {
  margin-left: auto; width: 28px; height: 28px; border: none; border-radius: 8px;
  background: rgba(255,255,255,.14); color: #fff; font-size: 16px; line-height: 1; cursor: pointer;
}

.c-cs-body { flex: 1; overflow-y: auto; padding: 14px 14px 8px; background: #F7F9FC; }
.c-cs-body::-webkit-scrollbar { width: 5px; }
.c-cs-body::-webkit-scrollbar-thumb { background: #D3DCEA; border-radius: 3px; }

.c-cs-msg { display: flex; margin-bottom: 10px; }
.c-cs-msg--user { justify-content: flex-end; }
.c-cs-msg__bubble {
  max-width: 82%; padding: 9px 13px; border-radius: 12px;
  font-size: 14px; line-height: 1.7; white-space: pre-wrap; word-break: break-word;
  background: #fff; color: #17233D; border: 1px solid #E6EAF2;
  border-top-left-radius: 4px;
}
.c-cs-msg--user .c-cs-msg__bubble {
  background: #15356F; color: #fff; border-color: #15356F; border-top-left-radius: 12px; border-top-right-radius: 4px;
}

/* 打字中三点 */
.c-cs-typing { display: inline-flex; gap: 4px; padding: 4px 2px; }
.c-cs-typing i { width: 6px; height: 6px; border-radius: 50%; background: #9DB2D6; animation: cCsBlink 1.2s infinite; }
.c-cs-typing i:nth-child(2) { animation-delay: .2s; }
.c-cs-typing i:nth-child(3) { animation-delay: .4s; }
@keyframes cCsBlink { 0%, 80%, 100% { opacity: .3 } 40% { opacity: 1 } }

/* 快捷问题 chips / 建议回复 chips */
.c-cs-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 2px 0 12px; }
.c-cs-chip {
  padding: 6px 12px; border-radius: 16px; border: 1px solid #C9D8EF;
  background: #fff; color: #15356F; font-size: 13px; cursor: pointer; transition: all .2s;
  font-family: inherit;
}
.c-cs-chip:hover { background: #15356F; color: #fff; }

/* 电话直拨条 */
.c-cs-phones { display: flex; flex-wrap: wrap; gap: 8px; margin: -2px 0 12px; }
.c-cs-phone {
  display: flex; flex-direction: column; padding: 8px 14px; border-radius: 10px;
  background: #FFF1F0; border: 1px solid #FFCCC7; color: #CF1322;
  text-decoration: none; font-family: inherit;
}
.c-cs-phone small { font-size: 11px; opacity: .75; }
.c-cs-phone b { font-size: 16px; letter-spacing: .5px; }
.c-cs-phone:hover { background: #FFCCC7; }

/* 推荐产品卡片（新窗口打开产品页，聊天窗保留） */
.c-cs-prods { display: flex; flex-direction: column; gap: 8px; margin: -2px 0 12px; }
.c-cs-prod {
  display: block; padding: 10px 12px; border-radius: 10px;
  background: #fff; border: 1px solid #C9D8EF; text-decoration: none; font-family: inherit;
  transition: border-color .2s, box-shadow .2s;
}
.c-cs-prod:hover { border-color: #15356F; box-shadow: 0 4px 14px rgba(21, 53, 111, .12); }
/* WD-257 产品主图（横图卡：左图右文） */
.c-cs-prod__pic { flex: none; width: 96px; height: 72px; border-radius: 8px; overflow: hidden; background: #F2F5FA; margin-right: 10px; }
.c-cs-prod__pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.c-cs-prod--pic { display: flex; align-items: center; }
.c-cs-prod--pic .c-cs-prod__main { flex: 1; min-width: 0; }
.c-cs-prod__name { font-size: 13px; font-weight: 700; color: #17233D; line-height: 1.5; }
.c-cs-prod__price { font-size: 12px; color: #E53935; font-weight: 700; margin-top: 3px; }
.c-cs-prod__go { font-size: 12px; color: #15356F; margin-top: 5px; font-weight: 600; }

/* WD-257 对比卡片：两款车参数逐项对比（参数服务端来自产品库 DB，建议句在回复文本里） */
.c-cs-cmp { margin: -2px 0 12px; padding: 12px; border-radius: 12px; background: #fff; border: 1px solid #C9D8EF; }
.c-cs-cmp__head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.c-cs-cmp__tag {
  flex: none; padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 700;
  background: #15356F; color: #fff;
}
.c-cs-cmp__name { font-size: 13px; font-weight: 700; color: #15356F; text-decoration: none; }
.c-cs-cmp__name:hover { text-decoration: underline; }
.c-cs-cmp__table { border-top: 1px solid #EEF2F8; }
.c-cs-cmp__row { display: flex; border-bottom: 1px solid #EEF2F8; font-size: 12px; line-height: 1.5; }
.c-cs-cmp__row:last-child { border-bottom: none; }
.c-cs-cmp__label { flex: none; width: 64px; padding: 7px 0; color: #9DB2D6; font-weight: 600; }
.c-cs-cmp__val { flex: 1; padding: 7px 0; color: #17233D; word-break: break-all; }
.c-cs-cmp__val + .c-cs-cmp__val { border-left: 1px solid #EEF2F8; padding-left: 8px; }

/* 留资卡片 */
.c-cs-lead {
  margin: 0 0 12px; padding: 14px; border-radius: 12px;
  background: #fff; border: 1px dashed #15356F;
}
.c-cs-lead__title { font-size: 14px; font-weight: 800; color: #15356F; margin-bottom: 10px; }
.c-cs-lead input, .c-cs-lead textarea {
  width: 100%; box-sizing: border-box; margin-bottom: 8px; padding: 9px 11px;
  border: 1px solid #D3DCEA; border-radius: 8px; font-size: 13px; font-family: inherit;
  background: #FAFBFD; outline: none;
}
.c-cs-lead input:focus, .c-cs-lead textarea:focus { border-color: #15356F; }
.c-cs-lead textarea { height: 58px; resize: none; }
.c-cs-lead__btn {
  width: 100%; padding: 10px; border: none; border-radius: 8px;
  background: #E53935; color: #fff; font-size: 14px; font-weight: 700; cursor: pointer; font-family: inherit;
}
.c-cs-lead__btn:disabled { background: #C0C4CC; cursor: not-allowed; }
.c-cs-lead__ok { text-align: center; color: #389E0D; font-size: 14px; font-weight: 700; padding: 10px 0; }

.c-cs-foot { flex: none; display: flex; gap: 8px; padding: 10px 12px; background: #fff; border-top: 1px solid #EEF2F8; }
.c-cs-foot input {
  flex: 1; padding: 10px 12px; border: 1px solid #D3DCEA; border-radius: 10px;
  font-size: 14px; outline: none; font-family: inherit; background: #FAFBFD;
}
.c-cs-foot input:focus { border-color: #15356F; }
.c-cs-foot button {
  flex: none; width: 42px; height: 42px; border: none; border-radius: 10px;
  background: #15356F; color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.c-cs-foot button:disabled { background: #C0C4CC; }
.c-cs-foot button svg { margin-right: 1px; }

/* 移动端：全屏面板（入口走 rail 按钮，无独立球） */
@media (max-width: 768px) {
  .c-cs-panel { right: 0; bottom: 0; width: 100%; height: 100%; max-height: 100%; border-radius: 0; border: none; }
}

/* WD-245 真人感：人工接管"对方正在输入…"提示（与三点动画同气泡） */
.c-cs-typing-label { font-size: 11px; color: #9DB2D6; margin-top: 2px; }
