/* 微信咨询弹框 — 全站复用（首页 + cms-core 子页） */

.js-wechat-trigger {
  cursor: pointer;
}

.wechat-popup {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.22s ease, visibility 0.22s;
}

.wechat-popup.is-open {
  pointer-events: auto;
  opacity: 1;
  visibility: visible;
}

.wechat-popup__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 10, 10, 0.42);
  backdrop-filter: blur(2px);
}

.wechat-popup--anchored .wechat-popup__backdrop {
  background: transparent;
  backdrop-filter: none;
}

.wechat-popup__panel {
  position: fixed;
  width: min(300px, calc(100vw - 2rem));
  background: #fff;
  border-radius: 12px;
  box-shadow:
    0 24px 64px rgba(0, 0, 0, 0.18),
    0 0 0 1px rgba(0, 0, 0, 0.06);
  padding: 1.25rem 1.25rem 1.1rem;
  text-align: center;
  transform: scale(0.96) translateY(6px);
  transition: transform 0.22s ease, opacity 0.22s ease;
}

.wechat-popup.is-open .wechat-popup__panel {
  transform: scale(1) translateY(0);
}

.wechat-popup__close {
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
  width: 2rem;
  height: 2rem;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.05);
  color: #666;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s;
}

.wechat-popup__close:hover {
  background: rgba(0, 0, 0, 0.1);
  color: #1a1814;
}

.wechat-popup__title {
  font-family: var(--ff-body, 'PingFang SC', sans-serif);
  font-size: 1.05rem;
  font-weight: 700;
  color: #1a1814;
  margin: 0 1.5rem 0.35rem 0;
}

.wechat-popup__subtitle {
  font-size: 0.8125rem;
  color: #8a857c;
  margin: 0 0 0.75rem;
  line-height: 1.5;
}

.wechat-popup__remark {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #1a9e6a;
  background: rgba(26, 158, 106, 0.1);
  border: 1px solid rgba(26, 158, 106, 0.25);
  border-radius: 50px;
  padding: 0.35rem 0.85rem;
  margin-bottom: 0.85rem;
}

.wechat-popup__qr-wrap {
  position: relative;
  display: inline-block;
  margin-bottom: 0.75rem;
}

.wechat-popup__qr {
  display: block;
  width: 200px;
  height: 200px;
  max-width: 100%;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: #fff;
  object-fit: contain;
}

.wechat-popup__id {
  font-size: 0.875rem;
  color: #4a4540;
  margin: 0 0 0.85rem;
}

.wechat-popup__id strong {
  color: #1a1814;
  font-weight: 600;
}

.wechat-popup__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: 0.65rem;
}

.wechat-popup__btn {
  flex: 1;
  min-width: 7.5rem;
  padding: 0.65rem 0.85rem;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
  border: 1.5px solid transparent;
}

.wechat-popup__btn--copy {
  background: #1a1814;
  color: #fff;
  border-color: #1a1814;
}

.wechat-popup__btn--copy:hover {
  background: #2d2a24;
}

.wechat-popup__btn--copy.is-copied {
  background: #1a9e6a;
  border-color: #1a9e6a;
}

.wechat-popup__btn--wx {
  background: #fff;
  color: #1a9e6a;
  border-color: rgba(26, 158, 106, 0.45);
}

.wechat-popup__btn--wx:hover {
  background: rgba(26, 158, 106, 0.08);
}

.wechat-popup__tip {
  font-size: 0.8125rem;
  color: #8a857c;
  line-height: 1.55;
  margin: 0;
}

.wechat-popup__arrow {
  position: fixed;
  width: 12px;
  height: 12px;
  background: #fff;
  transform: rotate(45deg);
  box-shadow: -2px -2px 4px rgba(0, 0, 0, 0.04);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.22s;
}

.wechat-popup--anchored.is-open .wechat-popup__arrow {
  opacity: 1;
}

/* 移动端：底部抽屉式，便于拇指操作 */
@media (max-width: 768px) {
  .wechat-popup--mobile-sheet .wechat-popup__backdrop {
    background: rgba(10, 10, 10, 0.5);
    backdrop-filter: blur(3px);
  }

  .wechat-popup--mobile-sheet .wechat-popup__panel {
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    top: auto !important;
    width: 100%;
    max-width: none;
    border-radius: 16px 16px 0 0;
    padding: 1.35rem 1.25rem calc(1.25rem + env(safe-area-inset-bottom, 0px));
    transform: translateY(100%);
  }

  .wechat-popup--mobile-sheet.is-open .wechat-popup__panel {
    transform: translateY(0);
  }

  .wechat-popup--mobile-sheet .wechat-popup__arrow {
    display: none;
  }

  .wechat-popup--mobile-sheet .wechat-popup__qr {
    width: min(220px, 72vw);
    height: min(220px, 72vw);
  }
}
