/* ===== 右侧悬浮快捷联系 ===== */
.float-sidebar {
  position: fixed;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 72px;
  padding: 8px 0;
  background: #fff;
  border-radius: 36px;
  box-shadow: 0 4px 24px rgba(15, 23, 42, 0.12);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.float-sidebar-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 14px 8px;
  text-decoration: none;
  color: #374151;
  background: none;
  border: none;
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
  position: relative;
}

.float-sidebar-item:not(:last-child)::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 1px;
  background: #f0f0f0;
}

.float-sidebar-item:hover {
  color: #10b981;
}

.float-sidebar-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.float-sidebar-icon svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.float-sidebar-label {
  font-size: 12px;
  font-weight: 400;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
}

/* 微信二维码浮层 */
.float-sidebar-wechat .float-wechat-popup {
  position: absolute;
  right: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%) scale(0.95);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  width: 140px;
  padding: 12px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.15);
  transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
  text-align: center;
}

.float-sidebar-wechat .float-wechat-popup::after {
  content: '';
  position: absolute;
  right: -6px;
  top: 50%;
  transform: translateY(-50%);
  border: 6px solid transparent;
  border-left-color: #fff;
}

.float-wechat-qr {
  width: 116px;
  height: 116px;
  margin: 0 auto 8px;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
  overflow: hidden;
}

.float-wechat-qr img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.float-wechat-popup p {
  margin: 0;
  font-size: 12px;
  color: #64748b;
}

.float-sidebar-wechat:hover .float-wechat-popup,
.float-sidebar-wechat:focus-within .float-wechat-popup {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(-50%) scale(1);
}

@media (max-width: 768px) {
  .float-sidebar {
    right: max(8px, env(safe-area-inset-right, 0px));
    width: 56px;
    border-radius: 28px;
    padding: 4px 0;
    z-index: 10050;
  }

  .float-sidebar-item {
    padding: 10px 4px;
    gap: 2px;
  }

  .float-sidebar-label {
    font-size: 10px;
    white-space: normal;
    line-height: 1.15;
    max-width: 48px;
  }

  .float-sidebar-wechat .float-wechat-popup {
    right: calc(100% + 6px);
    width: 112px;
    padding: 8px;
  }

  .float-wechat-qr {
    width: 96px;
    height: 96px;
  }
}

@media (max-width: 480px) {
  .float-sidebar {
    top: auto;
    bottom: 80px;
    transform: none;
    right: max(6px, env(safe-area-inset-right, 0px));
    width: 52px;
  }

  .float-sidebar-label {
    font-size: 9px;
    max-width: 44px;
  }
}
