/* ============================================================
   cChat Widget — 嵌入客服组件样式
   命名空间: .cchat- 前缀，防止污染宿主页面
   ============================================================ */
.cchat-root {
  --cchat-blue: #1168BA; --cchat-blue-l: #3792E0; --cchat-blue-s: #E0F3FF;
  --cchat-gold: #FFB300; --cchat-gold-d: #E09237; --cchat-orange: #FF6C1A;
  --cchat-bg: #FFFAF0; --cchat-card: #FFFFFF; --cchat-msg-user: #FFF3D6;
  --cchat-t: #1E293B; --cchat-tm: #64748B; --cchat-tl: #94A3B8;
}
.cchat-float {
  position:fixed;right:30px;bottom:30px;display:flex;align-items:center;gap:8px;
  background:var(--cchat-bg);color:var(--cchat-blue);border:none;
  padding:6px 18px 6px 7px;border-radius:30px;
  box-shadow:0 4px 16px rgba(0,0,0,.12);cursor:pointer;z-index:9999998;
  transition:all .25s ease;user-select:none;font-family:'PingFang SC','Microsoft YaHei',sans-serif;
}
.cchat-float:active{transform:scale(.92)}
.cchat-float-img{width:36px;height:36px;border-radius:50%;object-fit:cover;flex-shrink:0;border:2px solid rgba(255,255,255,.5)}
.cchat-float-txt{font-size:15px;font-weight:600;letter-spacing:.3px;white-space:nowrap;color:var(--cchat-blue)}
.cchat-float-badge{position:absolute;top:-4px;right:-4px;background:var(--cchat-orange);color:#fff;font-size:10px;font-weight:600;min-width:18px;height:18px;border-radius:20px;display:flex;align-items:center;justify-content:center;padding:0 5px;border:2px solid var(--cchat-bg)}

.cchat-overlay {
  position:fixed;right:30px;bottom:90px;width:420px;max-width:calc(100vw - 62px);
  height:520px;max-height:calc(100vh - 140px);background:var(--cchat-card);
  border-radius:18px;box-shadow:0 12px 48px rgba(0,0,0,.18);z-index:9999999;
  display:none;flex-direction:column;overflow:hidden;
  font-family:'PingFang SC','Microsoft YaHei',sans-serif;font-size:14px;color:var(--cchat-t);
  animation:cchat-slideUp .3s ease;transform-origin:bottom right;
}
.cchat-overlay.open{display:flex}
@keyframes cchat-slideUp{from{opacity:0;transform:scale(.92) translateY(20px)}to{opacity:1;transform:scale(1) translateY(0)}}

.cchat-hdr{position:relative;height:44px;flex-shrink:0;background:#fff url(bg.png) left 14px center/auto 28px no-repeat;display:flex;align-items:center;justify-content:flex-end;padding:0 14px;border-radius:18px 18px 0 0;border-bottom:1px solid #e8e8e8}
.cchat-hdr-close{width:26px;height:26px;border-radius:50%;background:rgba(0,0,0,.12);border:none;color:#444;font-size:14px;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:.2s;padding:0;font-family:inherit;line-height:1;margin-left:auto}
.cchat-hdr-close:active{background:rgba(0,0,0,.25)}
.cchat-hdr-brand{position:absolute;right:14px;top:50%;transform:translateY(-50%);color:rgba(0,0,0,.4);font-size:10px;letter-spacing:.3px;background:rgba(0,0,0,.04);padding:3px 12px;border-radius:20px;white-space:nowrap}

.cchat-msgs{flex:1;overflow-y:auto;padding:14px 16px;background:var(--cchat-bg);display:flex;flex-direction:column;gap:10px}
.cchat-msg{display:flex;align-items:flex-start;gap:8px;animation:cchat-msgIn .3s ease}
@keyframes cchat-msgIn{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:translateY(0)}}
.cchat-msg.bot{flex-direction:row}.cchat-msg.user{flex-direction:row-reverse}
.cchat-msg-avatar{width:30px;height:30px;border-radius:50%;flex-shrink:0;display:flex;align-items:center;justify-content:center;font-size:12px;font-weight:600;color:#fff;overflow:hidden;user-select:none}
.cchat-msg-avatar img{width:100%;height:100%;object-fit:cover}
.cchat-msg.bot .cchat-msg-avatar{background:var(--cchat-blue)}
.cchat-msg.user .cchat-msg-avatar{background:var(--cchat-blue-l)}
.cchat-msg-bubble{width:82%;max-width:82%;padding:10px 14px;border-radius:14px;font-size:13px;line-height:1.65;word-break:break-word;box-shadow:0 1px 2px rgba(0,0,0,.03)}
.cchat-msg.bot .cchat-msg-bubble{background:var(--cchat-card);border-radius:14px 14px 14px 4px;color:var(--cchat-t)}
.cchat-msg.user .cchat-msg-bubble{background:var(--cchat-msg-user);color:var(--cchat-t);border-radius:14px 14px 4px 14px}
.cchat-msg-bubble .cchat-sub{display:block;font-size:11px;color:var(--cchat-tl);margin-top:4px}
.cchat-msg.user .cchat-msg-bubble .cchat-sub{color:#B8960D}

.cchat-quick{display:flex;flex-wrap:wrap;gap:6px;margin-top:4px}
.cchat-quick-card{background:var(--cchat-blue-s);border:1px solid #B8D8F0;border-radius:18px;padding:6px 14px;font-size:12px;color:var(--cchat-blue);cursor:pointer;transition:all .15s;user-select:none;white-space:nowrap;font-weight:500}
.cchat-quick-card:active{background:#CDE5F8;transform:scale(.95)}
.cchat-faq-list{display:grid;grid-template-columns:1fr 1fr;gap:6px;margin-top:4px}
.cchat-faq-item{display:flex;align-items:center;justify-content:space-between;background:var(--cchat-blue-s);border:1px solid #B8D8F0;border-radius:10px;padding:9px 12px;font-size:12px;color:var(--cchat-t);cursor:pointer;transition:all .15s;overflow:hidden}
.cchat-faq-item:active{background:#CDE5F8;transform:scale(.98)}
.cchat-faq-item .cchat-arrow{color:var(--cchat-blue);font-size:16px;font-weight:600;flex-shrink:0}

.cchat-welcome{background:var(--cchat-card);border-radius:12px;overflow:hidden;margin-bottom:4px;box-shadow:0 1px 3px rgba(0,0,0,.04);width:100%}
.cchat-msg-bubble.cchat-welcome{max-width:100%;padding:0;background:transparent;box-shadow:none}
.cchat-slides{position:relative;overflow:hidden;height:50px;border-bottom:1px solid #e0dcd5}
.cchat-slides-track{display:flex;transition:transform .5s ease;height:100%}
.cchat-slides-track img{flex:0 0 100%;width:100%;height:100%;object-fit:cover}
.cchat-slides-dots{position:absolute;bottom:8px;left:50%;transform:translateX(-50%);display:flex;gap:4px}
.cchat-slides-dots span{width:6px;height:6px;border-radius:50%;background:rgba(255,255,255,.5);transition:.2s}
.cchat-slides-dots span.active{background:#fff;width:18px;border-radius:3px}
.cchat-welcome .cw-body{padding:12px 14px}
.cchat-welcome .cw-row{display:flex;align-items:center;justify-content:space-between;padding:8px 0}
.cchat-welcome .cw-row{border-bottom:1px solid #e8e4dd}
.cchat-welcome .cw-row:last-child{border-bottom:none}
.cchat-welcome .cw-title{font-size:14px;font-weight:600;color:var(--cchat-t)}
.cchat-welcome .cw-toggle{width:24px;height:24px;background:transparent;border:none;cursor:pointer;font-size:14px;color:#999;display:flex;align-items:center;justify-content:center;transition:.2s}
.cchat-welcome .cw-toggle.open{transform:rotate(180deg)}
.cchat-welcome .cw-detail{display:none;padding:4px 0 8px;font-size:12px;color:var(--cchat-tm);line-height:1.8}
.cchat-welcome .cw-detail.open{display:block}
.cchat-welcome .cw-link{font-size:13px;color:var(--cchat-t);cursor:pointer;transition:.15s;font-weight:500}
.cchat-welcome .cw-link:hover{color:var(--cchat-blue)}
.cchat-welcome .cw-link .cw-arrow{color:var(--cchat-blue);margin-left:4px}

.cchat-ftr{flex-shrink:0;padding:10px 14px 12px;background:var(--cchat-card);border-top:1px solid #EEF0F5;display:flex;align-items:center;gap:8px}
.cchat-ftr input{flex:1;border:1.5px solid #DCE0E8;border-radius:20px;padding:9px 16px;font-size:13px;outline:none;background:#F7F9FC;transition:.2s;color:var(--cchat-t);font-family:inherit}
.cchat-ftr input::placeholder{color:#B0B8C5;font-size:12px}
.cchat-ftr input:focus{border-color:var(--cchat-blue);background:var(--cchat-card)}
.cchat-ftr-send{background:var(--cchat-gold);color:#fff;border:none;border-radius:8px;padding:9px 16px;font-size:13px;font-weight:600;cursor:pointer;transition:all .2s;flex-shrink:0;display:none;box-shadow:0 2px 8px rgba(255,179,0,.35);font-family:inherit}
.cchat-ftr-send.show{display:block}
.cchat-ftr-send:active{transform:scale(.94);background:var(--cchat-gold-d)}

.cchat-typing{display:flex;gap:4px;padding:6px 14px}
.cchat-typing span{width:6px;height:6px;background:var(--cchat-tl);border-radius:50%;animation:cchat-bounce 1.4s infinite ease-in-out}
.cchat-typing span:nth-child(2){animation-delay:.16s}.cchat-typing span:nth-child(3){animation-delay:.32s}
@keyframes cchat-bounce{0%,80%,100%{transform:scale(.6);opacity:.4}40%{transform:scale(1);opacity:1}}

@media(max-width:680px){.cchat-overlay{right:16px;width:calc(100vw-32px);max-width:none;bottom:75px;height:calc(100vh-120px);border-radius:14px}.cchat-hdr{border-radius:14px 14px 0 0}}
@media(max-width:580px){.cchat-float{right:20px;padding:5px 12px 5px 5px}.cchat-float-txt{font-size:13px}.cchat-float-img{width:30px;height:30px}}
@media(max-width:420px){.cchat-float{right:12px;bottom:18px}.cchat-overlay{right:10px;bottom:68px;width:calc(100vw-20px);height:calc(100vh-110px)}}
