/* ============================================================
   右下角悬浮咨询窗 + 微信二维码弹窗
   ============================================================ */

/* ---------- 悬浮窗容器 ---------- */
.fw-container {
  position: fixed;
  right: 24px;
  bottom: 40px;
  width: 76px;
  background: #e8f0fe;
  border-radius: 20px;
  box-shadow: 0 8px 24px rgba(59, 110, 246, 0.15);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  overflow: hidden;
  user-select: none;
}

.fw-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: background 0.2s;
  background: transparent;
  border: none;
  padding: 0;
  font-family: inherit;
  color: #333;
  width: 100%;
}
.fw-btn:hover {
  background: #d8e4fd;
}
.fw-btn svg {
  width: 28px !important;
  height: 28px !important;
  flex-shrink: 0;
  max-width: none;
  display: inline-block;
}
.fw-btn-text {
  font-size: 14px;
  line-height: 1.2;
  color: #333;
  font-weight: 500;
}

/* 微信按钮 */
.fw-btn-wechat {
  padding: 16px 8px 14px;
  border-radius: 20px 20px 0 0;
}

/* 分隔线 */
.fw-divider {
  height: 1px;
  background: #d5e0f5;
  margin: 0 12px;
}

/* 电话按钮 */
.fw-btn-phone {
  padding: 14px 8px 16px;
  border-radius: 0 0 20px 20px;
}

/* ---------- 微信弹窗（桌面端气泡 + 移动端模态） ---------- */

/* 桌面端气泡容器 */
.fw-wechat-pop {
  position: fixed;
  right: 112px;
  bottom: 40px;
  width: 320px;
  background: #fff;
  border-radius: 16px;
  padding: 32px 28px;
  box-sizing: border-box;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18);
  z-index: 99998;
  opacity: 0;
  visibility: hidden;
  transform: translateX(10px);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
}
.fw-wechat-pop.fw-show {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
}

/* 气泡右侧小三角 */
.fw-wechat-pop::after {
  content: '';
  position: absolute;
  right: -8px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-top: 10px solid transparent;
  border-bottom: 10px solid transparent;
  border-left: 10px solid #fff;
  filter: drop-shadow(2px 0 2px rgba(0, 0, 0, 0.04));
}

/* 移动端遮罩 */
.fw-wechat-mask {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 99997;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.fw-wechat-mask.fw-show {
  display: block;
}

/* 关闭按钮 */
.fw-close-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  cursor: pointer;
  color: #999;
  border-radius: 8px;
  transition: background 0.2s, color 0.2s;
  padding: 0;
}
.fw-close-btn:hover {
  background: #f5f5f5;
  color: #333;
}
.fw-close-btn svg {
  width: 18px !important;
  height: 18px !important;
  flex-shrink: 0;
  max-width: none;
  display: inline-block;
}

.fw-wechat-title {
  font-size: 24px;
  font-weight: 700;
  color: #333;
  text-align: center;
  margin: 0 0 8px 0;
  line-height: 1.3;
}
.fw-wechat-subtitle {
  font-size: 15px;
  color: #666;
  text-align: center;
  margin: 0 0 24px 0;
  line-height: 1.5;
}

/* 二维码区域 */
.fw-qr-wrap {
  width: 220px;
  height: 220px;
  margin: 0 auto 20px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.fw-qr-wrap img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  position: relative;
  z-index: 1;
}
.fw-qr-placeholder {
  width: 220px;
  height: 220px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border-radius: 12px;
  padding: 8px;
  box-sizing: border-box;
}
.fw-qr-placeholder .fw-qr-img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  border-radius: 8px;
}

/* 二维码放射状装饰 */
.fw-qr-decoration {
  position: absolute;
  inset: -10px;
  z-index: 0;
  opacity: 0.08;
}

/* 中心红色圆 */
.fw-qr-center {
  position: absolute;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #e63946;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  z-index: 2;
  box-shadow: 0 4px 16px rgba(230, 57, 70, 0.3);
}
.fw-qr-center svg {
  width: 32px !important;
  height: 32px !important;
  flex-shrink: 0;
  max-width: none;
  display: inline-block;
}

/* 右下角绿色小程序标识 */
.fw-qr-mini {
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #07c160;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  z-index: 3;
  border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(7, 193, 96, 0.3);
}
.fw-qr-mini svg {
  width: 20px !important;
  height: 20px !important;
  flex-shrink: 0;
  max-width: none;
  display: inline-block;
}

.fw-qr-tip {
  font-size: 16px;
  color: #555;
  text-align: center;
  line-height: 1.5;
  margin: 0;
}

/* ---------- 移动端适配 ---------- */
@media (max-width: 767px) {
  .fw-container {
    right: 16px;
    bottom: 24px;
    width: 64px;
    border-radius: 16px;
  }
  .fw-btn svg {
    width: 24px !important;
    height: 24px !important;
  }
  .fw-btn-text {
    font-size: 12px;
  }
  .fw-btn-wechat {
    padding: 14px 6px 12px;
    border-radius: 16px 16px 0 0;
  }
  .fw-btn-phone {
    padding: 12px 6px 14px;
    border-radius: 0 0 16px 16px;
  }
  .fw-divider {
    margin: 0 10px;
  }

  /* 移动端：微信弹窗居中模态 */
  .fw-wechat-mask.fw-show {
    opacity: 1;
  }
  .fw-wechat-pop {
    position: fixed;
    left: 50%;
    top: 50%;
    right: auto;
    bottom: auto;
    transform: translate(-50%, -45%);
    width: 85vw;
    max-width: 320px;
    padding: 28px 20px;
    z-index: 99999;
  }
  .fw-wechat-pop.fw-show {
    transform: translate(-50%, -50%);
  }
  .fw-wechat-pop::after {
    display: none; /* 移动端不显示小三角 */
  }
  .fw-qr-wrap,
  .fw-qr-placeholder {
    width: 200px;
    height: 200px;
  }
  .fw-wechat-title {
    font-size: 22px;
  }
  .fw-wechat-subtitle {
    font-size: 14px;
    margin-bottom: 20px;
  }
}
