/* 浮动在线客服组件样式 · 售前咨询工作台风格（配合 assets/js/chat-widget.js） */
.cw-launcher {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 9998;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  border: none;
  border-radius: 999px;
  background: var(--accent, #ff6a00);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(255, 106, 0, .38);
  transition: transform .15s ease, box-shadow .15s ease;
}
.cw-launcher:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(255, 106, 0, .45); }
.cw-launcher-ico { font-size: 18px; }
/* 未读红点：客服回复后面板收起时提醒 */
.cw-launcher-dot {
  position: absolute;
  top: -3px;
  right: -3px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #e5484d;
  border: 2px solid #fff;
  box-shadow: 0 0 0 3px rgba(229, 72, 77, .25);
  animation: cw-dot-pulse 1.2s ease-in-out infinite;
}
@keyframes cw-dot-pulse { 50% { transform: scale(1.3); } }

.cw-panel {
  position: fixed;
  right: 18px;
  bottom: 84px;
  z-index: 9999;
  width: 380px;
  max-width: calc(100vw - 36px);
  height: 560px;
  max-height: min(80vh, 640px);
  display: none;
  flex-direction: column;
  background: #f2f3f7;
  border-radius: 12px;
  box-shadow: 0 18px 48px rgba(15, 30, 60, .25);
  overflow: hidden;
}
.cw-panel.cw-open { display: flex; }
.cw-panel.cw-wide { width: 560px; height: min(78vh, 700px); }

/* ---------- 头部 ---------- */
.cw-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: var(--brand, #1e5fce);
  color: #fff;
  flex: none;
}
.cw-head-l { display: flex; align-items: center; gap: 9px; }
.cw-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .25);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700;
}
.cw-head-title { font-size: 15px; font-weight: 700; letter-spacing: .5px; }
.cw-head-r { display: flex; align-items: center; gap: 2px; }
.cw-hbtn {
  border: none; background: transparent; color: #fff;
  width: 30px; height: 30px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.cw-hbtn:hover { background: rgba(255, 255, 255, .18); }
.cw-hico { font-size: 17px; line-height: 1; }

/* ---------- 消息区 ---------- */
.cw-body { flex: 1; display: flex; flex-direction: column; min-height: 0; position: relative; }
.cw-msgs {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex; flex-direction: column; gap: 10px;
  padding: 12px 14px 8px;
}
.cw-more-tip { text-align: center; font-size: 11.5px; color: #a0a8bb; padding: 4px 0 2px; }
.cw-sys-tip {
  align-self: center;
  margin: 2px auto;
  padding: 4px 12px;
  background: rgba(255, 106, 0, .12);
  color: #d65a00;
  font-size: 12px;
  border-radius: 20px;
}
.cw-time-sep { text-align: center; font-size: 11.5px; color: #a0a8bb; }
.cw-bubble {
  max-width: 78%;
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 13.5px;
  line-height: 1.6;
  word-break: break-word;
  box-shadow: 0 1px 2px rgba(15, 30, 60, .05);
}
.cw-me { align-self: flex-end; background: var(--brand, #1e5fce); color: #fff; border-top-right-radius: 3px; }
.cw-other { align-self: flex-start; background: #fff; color: #2a3242; border-top-left-radius: 3px; }

/* ---------- 新客留资卡 ---------- */
.cw-intro {
  display: none;
  grid-template-columns: 1fr;
  gap: 8px;
  margin: 4px 14px 10px;
  padding: 12px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(15, 30, 60, .05);
}
.cw-intro .cw-input {
  width: 100%;
  box-sizing: border-box;
  padding: 9px 11px;
  border: 1px solid #d7deea;
  border-radius: 8px;
  font-size: 16px;
  background: #fff;
}
.cw-intro .cw-input:focus { outline: 2px solid rgba(30, 95, 206, .22); border-color: var(--brand, #1e5fce); }
.cw-hint { margin: 0; font-size: 12.5px; min-height: 16px; line-height: 1.4; }
.cw-intro.cw-flash { animation: cw-flash-bg 1.6s ease; }
@keyframes cw-flash-bg {
  0%, 100% { box-shadow: 0 1px 2px rgba(15, 30, 60, .05); }
  30% { box-shadow: 0 0 0 3px rgba(255, 106, 0, .55); }
}
.cw-submit {
  padding: 10px;
  border: none;
  border-radius: 8px;
  background: var(--brand, #1e5fce);
  color: #fff;
  font-size: 14.5px;
  font-weight: 700;
  cursor: pointer;
}
.cw-submit:disabled { opacity: .6; cursor: default; }

/* ---------- 工具行 ---------- */
.cw-toolbar {
  display: flex; align-items: center; gap: 4px;
  padding: 6px 10px 2px;
  flex: none;
  position: relative;
  z-index: 2;
}
.cw-tool {
  border: none; background: transparent;
  width: 32px; height: 32px;
  border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: #5a6678;
  text-decoration: none;
}
.cw-tool:hover { background: rgba(30, 95, 206, .08); }
.cw-tool-ico { font-size: 18px; line-height: 1; }

.cw-addwx {
  display: inline-flex; align-items: center; gap: 5px;
  margin-left: auto;
  padding: 5px 12px;
  border: none; border-radius: 999px;
  background: #07c160; color: #fff;
  font-size: 13px; font-weight: 700; cursor: pointer;
}
.cw-addwx:hover { background: #06ad56; }
.cw-addwx-ico { font-size: 14px; line-height: 1; }

/* 添加微信浮层 */
.cw-wx-ov {
  position: fixed; inset: 0; z-index: 10001;
  background: rgba(10, 20, 40, .7);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.cw-wx-card {
  position: relative;
  width: 280px; max-width: 86vw;
  background: #fff; border-radius: 16px;
  padding: 20px 18px 16px;
  text-align: center;
  box-shadow: 0 24px 64px rgba(0, 0, 0, .35);
}
.cw-wx-qr { width: 196px; height: 196px; border-radius: 10px; background: #fff; padding: 6px; box-sizing: border-box; cursor: zoom-in; }

/* 二维码全屏放大灯箱（点二维码打开，点任意处关闭） */
.cw-qr-zoom {
  position: fixed; inset: 0; z-index: 10002;
  background: rgba(255, 255, 255, .96);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 18px; padding: 24px; cursor: zoom-out;
}
.cw-qr-zoom-img {
  width: min(86vw, 86vh - 90px, 560px); height: auto; max-height: 80vh;
  border-radius: 14px; box-shadow: 0 12px 48px rgba(10, 30, 80, .18);
  background: #fff;
}
.cw-qr-zoom-tip { font-size: 14px; color: #5a6678; text-align: center; line-height: 1.6; }
.cw-wx-title { margin-top: 12px; font-size: 16px; font-weight: 700; color: #1c2437; }
.cw-wx-idrow { display: flex; gap: 8px; margin-top: 10px; }
.cw-wx-input {
  flex: 1; min-width: 0;
  padding: 8px 10px;
  border: 1px solid #d7deea; border-radius: 8px;
  font-size: 14px; text-align: center; color: #1c2437;
  background: #f7f9fc;
}
.cw-wx-copy {
  flex: none; padding: 0 14px;
  border: none; border-radius: 8px;
  background: #eef3fb; color: var(--brand, #1e5fce);
  font-size: 14px; font-weight: 700; cursor: pointer;
}
.cw-wx-copy:hover { background: #e2ebf8; }
.cw-wx-tip { margin-top: 8px; font-size: 12px; color: #8a93a8; line-height: 1.5; }
.cw-wx-close {
  position: absolute; top: 8px; right: 10px;
  border: none; background: transparent; color: #9aa3b5;
  font-size: 22px; line-height: 1; cursor: pointer;
}

.cw-emo-panel {
  display: none;
  position: absolute;
  left: 8px; bottom: 104px;
  z-index: 3;
  width: 224px;
  padding: 8px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 10px 28px rgba(15, 30, 60, .2);
  grid-template-columns: repeat(6, 1fr);
  gap: 2px;
}
.cw-emo-panel.cw-show { display: grid; }
.cw-emo-item {
  border: none; background: transparent;
  width: 32px; height: 32px;
  border-radius: 6px;
  font-size: 18px;
  cursor: pointer;
}
.cw-emo-item:hover { background: #eef3fb; }

/* ---------- 输入区 ---------- */
.cw-hint-chat { padding: 0 14px 2px; color: #8a93a8; flex: none; }
.cw-input-row {
  display: flex; align-items: flex-end; gap: 8px;
  padding: 4px 12px 8px;
  flex: none;
}
.cw-chat-input {
  flex: 1; min-width: 0;
  padding: 10px 12px;
  border: 1px solid #d7deea;
  border-radius: 9px;
  font-size: 16px;
  line-height: 1.5;
  resize: none;
  background: #fff;
  font-family: inherit;
  height: 40px;
}
.cw-chat-input:focus { outline: 2px solid rgba(30, 95, 206, .22); border-color: var(--brand, #1e5fce); }
.cw-send {
  width: 42px; height: 40px;
  border: none; border-radius: 9px;
  background: var(--brand, #1e5fce);
  color: #fff;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex: none;
}
.cw-send:hover { background: #1849a8; }
.cw-send:disabled { opacity: .55; cursor: default; }
.cw-send-ico { font-size: 17px; line-height: 1; }

.cw-foot {
  padding: 6px 16px;
  background: #fff;
  border-top: 1px solid #eef1f6;
  font-size: 11px;
  color: #a0a8bb;
  text-align: center;
  flex: none;
}

@media (max-width: 480px) {
  .cw-launcher { right: 12px; bottom: 12px; padding: 11px 15px; }
  .cw-launcher.cw-hide-txt .cw-launcher-txt { display: none; }
  .cw-panel { right: 8px; left: 8px; width: auto; bottom: 72px; height: min(76vh, 620px); }
  .cw-panel.cw-wide { width: auto; }
  .cw-send { min-width: 44px; }
}
