/* ========================================
   寰俊鎮诞浜岀淮鐮佺粍浠
   ======================================== */

/* 澶栧眰瀹瑰櫒锛氬浐瀹氬湪鍙充晶鍨傜洿灞呬腑 */
.wx-float {
  position: fixed;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 9999;
  display: flex;
  align-items: center;
  /* 闈㈡澘榛樿钘忓湪灞忓箷鍙充晶澶 */
  flex-direction: row;
}

/* 瑙﹀彂鏍囩鏉★紙濮嬬粓鍙鐨勫皬鏉★級 */
.wx-tab {
  flex-shrink: 0;
  width: 44px;
  height: 180px;
  background: #07c160;
  color: #fff;
  cursor: pointer;
  border-radius: 8px 0 0 8px;
  box-shadow: -2px 2px 12px rgba(0, 0, 0, 0.15);
  transition: background 0.3s ease, border-radius 0.3s ease;
  user-select: none;
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.wx-tab:hover {
  background: #06ad56;
}

.wx-tab .wx-tab-icon {
  font-size: 22px;
  line-height: 1;
}

.wx-tab .wx-tab-text {
  writing-mode: vertical-rl;
  text-orientation: upright;
  font-size: 14px;
  letter-spacing: 4px;
  font-weight: 600;
}

/* 浜岀淮鐮侀潰鏉 */
.wx-panel {
  flex-shrink: 0;
  width: 0;
  overflow: hidden;
  background: #fff;
  border-radius: 12px 0 0 12px;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.12);
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0;
  opacity: 0;
}

/* ---- PC绔細hover 灞曞紑 ---- */
@media (hover: hover) and (pointer: fine) {
  .wx-float:hover .wx-panel {
    width: 240px;
    padding: 24px 20px;
    opacity: 1;
  }

  .wx-float:hover .wx-tab {
    border-radius: 0 0 0 0;
  }
}

/* ---- 瑙﹀睆绔細鐐瑰嚮灞曞紑锛圝S 鎺у埗 .active 绫伙級 ---- */
@media (hover: none), (pointer: coarse) {
  .wx-float.active .wx-panel {
    width: 240px;
    padding: 24px 20px;
    opacity: 1;
  }
}

/* 闈㈡澘鍐呴儴鍐呭 */
.wx-panel-inner {
  width: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.wx-panel-title {
  font-size: 15px;
  font-weight: 600;
  color: #333;
  margin-bottom: 4px;
}

.wx-panel-subtitle {
  font-size: 12px;
  color: #999;
  margin-bottom: 16px;
}

.wx-qr-wrap {
  width: 180px;
  height: 180px;
  border: 1px solid #e8e8e8;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fafafa;
}

.wx-qr-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.wx-scan-tip {
  margin-top: 14px;
  font-size: 12px;
  color: #07c160;
  display: flex;
  align-items: center;
  gap: 4px;
}

.wx-scan-tip::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #07c160;
  animation: wx-blink 1.5s infinite;
}

@keyframes wx-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.wx-wechat-id {
  margin-top: 10px;
  font-size: 13px;
  color: #666;
  display: flex;
  align-items: center;
  gap: 4px;
}
.wx-wechat-id .wx-id-value {
  color: #07c160;
  font-weight: 500;
  cursor: pointer;
  padding: 2px 8px;
  border: 1px dashed #ccc;
  border-radius: 4px;
  transition: background 0.2s, border-color 0.2s;
  position: relative;
}
.wx-wechat-id .wx-id-value:hover {
  background: #e8f5e9;
  border-color: #07c160;
}
.wx-wechat-id .wx-copy-icon {
  font-size: 12px;
  opacity: 0.5;
  flex-shrink: 0;
}
/* 澶嶅埗鎴愬姛鎻愮ず toast */
.wx-toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  background: rgba(0, 0, 0, 0.78);
  color: #fff;
  padding: 12px 28px;
  border-radius: 24px;
  font-size: 14px;
  z-index: 99999;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s, transform 0.25s;
  white-space: nowrap;
}
.wx-toast.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

/* ====== 骞虫澘 & 鎵嬫満绔井璋 ====== */
@media (max-width: 768px) {
  .wx-tab {
    width: 38px;
    height: 150px;
  }
  .wx-tab .wx-tab-icon {
    font-size: 18px;
  }
  .wx-tab .wx-tab-text {
    font-size: 13px;
    letter-spacing: 3px;
  }
  .wx-float.active .wx-panel {
    width: 220px;
    padding: 20px 16px;
  }
  .wx-panel-inner {
    width: 180px;
  }
  .wx-qr-wrap {
    width: 160px;
    height: 160px;
  }
}

@media (max-width: 380px) {
  .wx-float.active .wx-panel {
    width: 200px;
    padding: 16px 12px;
  }
  .wx-panel-inner {
    width: 168px;
  }
  .wx-qr-wrap {
    width: 148px;
    height: 148px;
  }
}