/* ============================================================
   contact-widget.css — 右侧悬浮「联系客服」组件
   全站统一引入：css/contact-widget.css
   ============================================================ */

/* ---------- 触发按钮：右侧中部竖向悬浮条 ---------- */
.cw-toggle {
  position: fixed;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 998;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 42px;
  padding: 14px 0;
  background: var(--accent, #533afd);
  color: #fff;
  font-size: 13px;
  line-height: 1.3;
  letter-spacing: 2px;
  cursor: pointer;
  border-radius: 10px 0 0 10px;
  box-shadow: var(--shadow-blue, 0 18px 36px -18px rgba(0,0,0,.25));
  transition: background .2s, width .2s;
  writing-mode: vertical-lr;
  user-select: none;
}
.cw-toggle:hover {
  background: var(--accent-dark, #4434d4);
  width: 46px;
}
.cw-toggle .cw-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4ef29b;
  box-shadow: 0 0 6px #4ef29b;
  animation: cwPulse 1.6s infinite;
  display: inline-block;
  flex: 0 0 auto;
}
/* 手机端展示的图标（桌面隐藏，文案用文字） */
.cw-toggle .cw-ico-svg {
  display: none;
}
@keyframes cwPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .35; }
}

/* ---------- 展开面板 ---------- */
.cw-panel {
  position: fixed;
  right: 54px;
  top: 50%;
  transform: translateY(-50%) scale(.92);
  transform-origin: right center;
  z-index: 998;
  width: 218px;
  background: #fff;
  border: 1px solid var(--border, #e5edf5);
  border-radius: var(--radius, 12px);
  box-shadow: var(--shadow-blue, 0 30px 45px -30px rgba(50,50,93,.25));
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease, visibility .18s;
  overflow: hidden;
}
.cw-panel.cw-show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(-50%) scale(1);
}
.cw-head {
  background: var(--accent, #533afd);
  color: #fff;
  padding: 12px 14px;
}
.cw-head .cw-title {
  font-size: 15px;
  font-weight: 600;
}
.cw-head .cw-sub {
  margin-top: 3px;
  font-size: 12px;
  opacity: .85;
}
.cw-rows { padding: 6px 0; }
.cw-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  color: var(--ink-soft, #273951);
  text-decoration: none;
  cursor: pointer;
  transition: background .15s;
  border: 0;
  width: 100%;
  box-sizing: border-box;
  background: transparent;
  text-align: left;
  font-family: inherit;
  font-size: 14px;
}
.cw-row:hover { background: var(--accent-soft, rgba(83,58,253,.06)); }
.cw-row + .cw-row { border-top: 1px solid var(--border, #e5edf5); }
.cw-ico {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  background: var(--surface, #f6f9fc);
}
.cw-ico.ico-wecom { background: rgba(9, 145, 70, .12); }
.cw-ico.ico-qr { background: rgba(83, 58, 253, .1); }
.cw-ico.ico-tel { background: rgba(240, 147, 43, .14); }
.cw-row .cw-txt { display: flex; flex-direction: column; gap: 2px; }
.cw-row .cw-txt b { font-weight: 600; color: var(--ink, #061b31); }
.cw-row .cw-txt span { font-size: 12px; color: var(--body-c, #64748d); }

/* ---------- 二维码弹层 ---------- */
.cw-mask {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: rgba(9, 16, 34, .45);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.cw-mask.cw-open { display: flex; }
.cw-modal {
  background: #fff;
  border-radius: 14px;
  padding: 20px 22px;
  max-width: 320px;
  text-align: center;
  position: relative;
  box-shadow: var(--shadow-blue, 0 30px 45px -30px rgba(50,50,93,.25));
}
.cw-modal .cw-close {
  position: absolute;
  top: 8px;
  right: 12px;
  border: 0;
  background: none;
  font-size: 20px;
  line-height: 1;
  color: var(--body-c, #64748d);
  cursor: pointer;
}
.cw-modal .cw-close:hover { color: var(--ink, #061b31); }
.cw-modal h4 { margin: 0 0 12px; font-size: 16px; color: var(--ink, #061b31); }
.cw-modal img {
  width: 200px;
  height: 200px;
  display: block;
  margin: 0 auto;
  border: 1px solid var(--border, #e5edf5);
  border-radius: 8px;
}
.cw-modal p { margin: 12px 0 0; font-size: 13px; color: var(--body-c, #64748d); }

@media (max-width: 720px) {
  .cw-toggle {
    top: auto;
    bottom: 24px;
    right: 14px;
    transform: none;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    padding: 0;
    writing-mode: horizontal-tb;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 0;
    letter-spacing: 0;
    font-size: 12px;
    line-height: 1.5;
    text-align: center;
    box-shadow: 0 10px 24px rgba(6, 27, 49, .28);
  }
  .cw-toggle:hover {
    width: 54px;
    height: 54px;
  }
  .cw-toggle .cw-dot { display: none; }
  .cw-toggle .cw-ico-svg { display: block; }
  .cw-toggle span { display: none; }
  .cw-panel {
    right: 14px;
    left: 14px;
    width: auto;
    transform: translateY(-50%) scale(.96);
  }
  .cw-panel.cw-show { transform: translateY(-50%) scale(1); }
  .cw-modal img {
    max-width: 100%;
    width: 200px;
    height: auto;
  }
}
