/* 右侧悬浮联系工具 - 适配 haishunhang 金色到青绿导航风格 */
.hsh-floatbar {
  position: fixed;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 9990;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hsh-floatbar__item {
  position: relative;
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: linear-gradient(135deg, #b58451 0%, #397e82 100%);
  box-shadow: 0 4px 14px rgba(0, 23, 55, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  color: #fff;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  outline: none;
}

.hsh-floatbar__item:focus,
.hsh-floatbar__item:active {
  outline: none;
  transform: none;
  box-shadow: 0 4px 14px rgba(0, 23, 55, 0.18);
}

.hsh-floatbar__item img,
.hsh-floatbar__item picture img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  display: block;
}

.hsh-floatbar__icon {
  width: 24px;
  height: 24px;
  display: block;
  fill: currentColor;
  color: inherit;
  overflow: visible;
}

.hsh-floatbar__icon use {
  pointer-events: none;
}

.hsh-floatbar__qr {
  position: absolute;
  right: 58px;
  top: 50%;
  transform: translateY(-50%) translateX(8px);
  width: 150px;
  padding: 12px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 23, 55, 0.16);
  text-align: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: all 0.25s ease;
  color: #001737;
}

.hsh-floatbar__qr::after {
  content: "";
  position: absolute;
  right: -6px;
  top: 50%;
  margin-top: -6px;
  border: 6px solid transparent;
  border-left-color: #fff;
}

.hsh-floatbar__qr img {
  width: 110px;
  height: 110px;
  margin: 0 auto 8px;
  object-fit: contain;
}

.hsh-floatbar__qr p {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  color: #445;
}

.hsh-floatbar__qr strong,
.hsh-floatbar__hl {
  color: #e53935;
  font-weight: 700;
  word-break: break-all;
}

.hsh-floatbar__empty {
  display: none;
  font-size: 12px;
  color: #999;
  padding: 20px 0;
}

.hsh-floatbar__qr.is-empty > img {
  display: none !important;
}

.hsh-floatbar__qr.is-empty > p {
  display: none !important;
}

.hsh-floatbar__qr.is-empty .hsh-floatbar__empty {
  display: block;
}

/* 触屏：仅靠 is-open 展开，避免 sticky :hover 卡住二维码 */
.hsh-floatbar__item.has-qr.is-open .hsh-floatbar__qr {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(-50%) translateX(0);
}

.hsh-floatbar__item--top {
  background: #001737;
}

.hsh-floatbar__item--top:focus,
.hsh-floatbar__item--top:active,
.hsh-floatbar__item--top:hover {
  background: #001737;
  color: #fff;
  transform: none;
  box-shadow: 0 4px 14px rgba(0, 23, 55, 0.18);
}

/* 仅真正支持悬停的设备使用 hover */
@media (hover: hover) and (pointer: fine) {
  .hsh-floatbar__item:hover {
    transform: translateX(-4px);
    box-shadow: 0 6px 18px rgba(0, 23, 55, 0.28);
  }

  .hsh-floatbar__item.has-qr:hover .hsh-floatbar__qr {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(-50%) translateX(0);
  }

  .hsh-floatbar__item--top:hover {
    background: #001737;
    transform: translateX(-4px);
    box-shadow: 0 6px 18px rgba(0, 23, 55, 0.28);
  }
}

@media (max-width: 768px) {
  .hsh-floatbar {
    right: 8px;
    left: auto;
    top: 50%;
    bottom: auto;
    transform: translateY(-50%);
    flex-direction: column;
    justify-content: flex-start;
    gap: 6px;
    background: transparent;
    border: none;
    padding: 0;
    box-shadow: none;
  }

  .hsh-floatbar__item {
    width: 42px;
    height: 42px;
    border-radius: 8px;
  }

  .hsh-floatbar__item:hover,
  .hsh-floatbar__item:focus,
  .hsh-floatbar__item:active,
  .hsh-floatbar__item--top:hover,
  .hsh-floatbar__item--top:focus,
  .hsh-floatbar__item--top:active {
    transform: none;
    box-shadow: 0 4px 14px rgba(0, 23, 55, 0.18);
  }

  .hsh-floatbar__item--top {
    background: #001737;
  }

  /* 手机端禁用 hover 展码，只认点击 is-open */
  .hsh-floatbar__item.has-qr:hover .hsh-floatbar__qr {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-50%) translateX(8px);
  }

  .hsh-floatbar__item.has-qr.is-open .hsh-floatbar__qr {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(-50%) translateX(0);
  }

  .hsh-floatbar__qr {
    right: 50px;
    left: auto;
    top: 50%;
    bottom: auto;
    width: 140px;
  }

  .hsh-floatbar__qr::after {
    right: -6px;
    left: auto;
    top: 50%;
    bottom: auto;
    margin: -6px 0 0;
    border: 6px solid transparent;
    border-left-color: #fff;
  }
}
