/* ==========================================================
   Qservice 右侧悬浮客服条 - 绿色扁平风格
   仅作用于 .qsvc-* 命名空间，不污染站点既有样式
   v1.2.0：外层 widget 只做定位，内层 qsvc-items 承担圆角与裁剪，
   首尾项悬停色圆角完美贴合；面板加大一档
   ========================================================== */
.qsvc-widget {
  position: fixed;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 99990;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
}

.qsvc-items {
  display: flex;
  flex-direction: column;
  width: 76px;
  background: #ffffff;
  border: 1px solid #e3efe6;
  border-radius: 15px;
  box-shadow: 0 6px 20px rgba(35, 133, 74, .16);
  overflow: visible;
}

/* 圆角由首尾项承担：外径 15px - 1px 边框 = 内曲线 14px，精确贴合不留白边 */
.qsvc-items > .qsvc-item:first-child { border-radius: 14px 14px 0 0; }
.qsvc-items > .qsvc-item:last-child  { border-radius: 0 0 14px 14px; }
.qsvc-items > .qsvc-item:only-child  { border-radius: 14px; }

.qsvc-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 72px;
  padding: 7px 2px;
  color: #2e9e5b;
  background: #ffffff;
  text-decoration: none !important;
  cursor: pointer;
  transition: background .18s ease, color .18s ease;
}

.qsvc-item + .qsvc-item { border-top: 1px solid #eef5f0; }

.qsvc-item:hover,
.qsvc-item:focus {
  background: #2e9e5b;
  color: #ffffff;
  text-decoration: none !important;
}

.qsvc-ic { width: 26px; height: 26px; display: block; flex-shrink: 0; }

.qsvc-txt {
  font-size: 12px;
  line-height: 1.2;
  letter-spacing: .5px;
  color: inherit;
  white-space: nowrap;
}

/* ---------- 左侧滑出号码气泡（QQ / 电话）：与二维码面板同一套卡片样式 ---------- */
.qsvc-pop {
  position: absolute;
  right: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%) translateX(8px);
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 14px;
  background: #ffffff;
  border: 1px solid #dcebe1;
  border-radius: 12px;
  box-shadow: 0 12px 36px rgba(17, 34, 24, .22);
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  user-select: text;
  -webkit-user-select: text;
  transition: opacity .18s ease, transform .18s ease, visibility .18s;
}

/* 指向控件的小箭头（与面板同尺寸） */
.qsvc-pop::after,
.qsvc-panel::after {
  content: "";
  position: absolute;
  left: 100%;
  top: 50%;
  transform: translateY(-50%);
  border: 7px solid transparent;
  border-left-color: #ffffff;
}

.qsvc-item:hover .qsvc-pop,
.qsvc-pop.qsvc-show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(-50%) translateX(0);
}

.qsvc-pop b {
  font-size: 12px;
  font-weight: 500;
  color: #6b7f71;
  user-select: none;
}

.qsvc-pop i {
  font-style: normal;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: .4px;
  color: #2e9e5b;
}

/* 「复制」小按钮：点一下写入剪贴板，不触发 QQ/拨号 */
.qsvc-copy {
  flex-shrink: 0;
  padding: 2px 8px;
  font-style: normal;
  font-size: 11px;
  line-height: 1.6;
  color: #6b7f71;
  background: #f6faf7;
  border: 1px solid #dcebe1;
  border-radius: 6px;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  transition: color .18s ease, border-color .18s ease, background .18s ease;
}
.qsvc-copy:hover {
  color: #2e9e5b;
  border-color: #b7d8c4;
  background: #eef8f1;
}

/* ---------- 左侧滑出微信二维码面板（点击开关，内容可长按保存） ---------- */
.qsvc-panel {
  position: absolute;
  right: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%) translateX(10px);
  width: 228px;
  background: #ffffff;
  border: 1px solid #dcebe1;
  border-radius: 12px;
  box-shadow: 0 12px 36px rgba(17, 34, 24, .22);
  overflow: visible;
  opacity: 0;
  visibility: hidden;
  transition: opacity .18s ease, transform .18s ease, visibility .18s;
}

.qsvc-panel.qsvc-show {
  opacity: 1;
  visibility: visible;
  transform: translateY(-50%) translateX(0);
}

/* 标题行：绿色、居中；关闭钮绝对定位到右侧，不干扰标题居中 */
.qsvc-panel-head {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 13px 34px 0;
  color: #2e9e5b;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: .6px;
  text-align: center;
}

.qsvc-close {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #c2cdc7;
  font-size: 18px;
  line-height: 1;
  text-decoration: none !important;
  transition: color .18s ease;
}
.qsvc-close:hover { color: #2e9e5b; }

.qsvc-panel-body {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px 2px;
}
.qsvc-panel-body img {
  display: block;
  max-width: 168px;
  max-height: 168px;
  width: 100%;
}

.qsvc-panel-wxid {
  margin: 0;
  padding: 4px 14px 0;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .3px;
  color: #2e9e5b;
  word-break: break-all;
}

.qsvc-panel-tip {
  margin: 0;
  padding: 4px 14px 12px;
  text-align: center;
  font-size: 12px;
  color: #6b7f71;
}

/* 移动端：压缩为窄条，贴右下角 */
@media screen and (max-width: 768px) {
  .qsvc-widget {
    top: auto;
    bottom: 84px;
    right: 8px;
    transform: none;
  }
  .qsvc-items {
    width: 58px;
    border-radius: 13px;
  }
  .qsvc-items > .qsvc-item:first-child { border-radius: 12px 12px 0 0; }
  .qsvc-items > .qsvc-item:last-child  { border-radius: 0 0 12px 12px; }
  .qsvc-items > .qsvc-item:only-child  { border-radius: 12px; }
  .qsvc-item { height: 58px; padding: 6px 2px; gap: 5px; }
  .qsvc-ic   { width: 21px; height: 21px; }
  .qsvc-txt  { font-size: 11px; letter-spacing: 0; }

  .qsvc-pop { right: calc(100% + 10px); padding: 7px 12px; }
  .qsvc-pop i { font-size: 14px; }

  .qsvc-panel {
    right: calc(100% + 10px);
    width: 204px;
  }
  .qsvc-panel-body img { max-width: 150px; max-height: 150px; }
}
