/* ==========================================================================
   Home Right Floating Actions (Global)
   ========================================================================== */

.home-floating-tools {
  position: fixed;
  right: 24px;
  bottom: 60px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.home-floating-tools__panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.home-floating-tools__item {
  position: relative;
}

.home-floating-tools__action {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #ffffff;
  color: #333333;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  transition: all 0.3s ease;
  border: 1px solid #f0f0f0;
}

.home-floating-tools__action:hover {
  background: var(--color-red, #d9001b);
  color: #ffffff;
  border-color: var(--color-red, #d9001b);
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(217, 0, 27, 0.24);
}

.home-floating-tools__action svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.home-floating-tools__action--mail img {
  width: 20px;
  height: 20px;
}

.home-floating-tools__phone-card {
  position: absolute;
  right: calc(100% + 16px);
  bottom: 0;
  width: 260px;
  padding: 24px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.12);
  opacity: 0;
  visibility: hidden;
  transform: translateX(10px);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

.home-floating-tools__phone-card::after {
  content: '';
  position: absolute;
  right: -6px;
  bottom: 22px;
  width: 12px;
  height: 12px;
  background: #ffffff;
  transform: rotate(45deg);
}

.home-floating-tools__item:hover .home-floating-tools__phone-card {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
  pointer-events: auto;
}

.home-floating-tools__phone-card strong {
  display: block;
  font-size: 16px;
  color: #333333;
  margin-bottom: 8px;
}

.home-floating-tools__phone-card a {
  display: block;
  font-size: 24px;
  font-weight: bold;
  color: var(--color-red, #d9001b);
  margin-bottom: 8px;
  text-decoration: none;
}

.home-floating-tools__phone-card span {
  display: block;
  font-size: 12px;
  color: #999999;
}

/* 移动端适配 */
@media (max-width: 768px) {
  .home-floating-tools {
    right: 16px;
    bottom: 30px;
    transform: scale(0.85);
    transform-origin: bottom right;
  }
}

/* 覆盖第三方在线咨询组件位置 (爱番番等) */
#aff-im-root .embed-icon {
  top: 50% !important;
  transform: translateY(-50%) !important;
  bottom: auto !important;
  /*
   * 通过 JS 将真实滚动条宽度写入 --page-scrollbar-offset。
   * Windows 下可避开右侧滚动条，macOS overlay 滚动条时该值通常为 0。
   */
  right: calc(var(--page-scrollbar-offset, 0px) + 2px) !important;
}
