.contact-sidebar {
  position: fixed;
  right: 18px;
  bottom: 282px;
  z-index: 10020;
  display: grid;
  width: 58px;
  color: #eaf7ff;
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  filter: drop-shadow(0 12px 28px rgba(0, 0, 0, 0.32));
  isolation: isolate;
}

.contact-sidebar__item {
  position: relative;
}

.contact-sidebar__button {
  box-sizing: border-box;
  width: 58px;
  min-height: 56px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px 3px;
  border: 1px solid rgba(82, 174, 226, 0.34);
  background: rgba(7, 25, 39, 0.94);
  color: #d7edf9;
  font: inherit;
  font-size: 11px;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  backdrop-filter: blur(14px) saturate(135%);
  transition: color 160ms ease, border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.contact-sidebar__item--phone .contact-sidebar__button {
  border-radius: 8px 8px 0 0;
}

.contact-sidebar__item--wechat .contact-sidebar__button {
  margin-top: -1px;
  border-radius: 0 0 8px 8px;
}

.contact-sidebar__button:hover,
.contact-sidebar__button:focus-visible,
.contact-sidebar__item.is-open .contact-sidebar__button {
  z-index: 1;
  border-color: rgba(89, 196, 255, 0.82);
  outline: none;
  background: linear-gradient(145deg, rgba(18, 149, 221, 0.97), rgba(11, 105, 176, 0.97));
  color: #fff;
  transform: translateX(-1px);
}

.contact-sidebar__button:focus-visible {
  box-shadow: 0 0 0 3px rgba(73, 187, 248, 0.24);
}

.contact-sidebar__icon {
  width: 21px;
  height: 21px;
  display: grid;
  place-items: center;
}

.contact-sidebar__icon svg {
  width: 100%;
  height: 100%;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.contact-sidebar__icon .contact-sidebar__icon-eye {
  fill: currentColor;
  stroke: none;
}

.contact-sidebar__popover {
  position: absolute;
  right: calc(100% + 12px);
  top: 50%;
  box-sizing: border-box;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate(8px, -50%);
  transform-origin: right center;
  transition: opacity 160ms ease, visibility 160ms ease, transform 160ms ease;
}

.contact-sidebar__popover::after {
  content: "";
  position: absolute;
  left: 100%;
  top: 50%;
  width: 9px;
  height: 9px;
  border-top: 1px solid rgba(82, 174, 226, 0.4);
  border-right: 1px solid rgba(82, 174, 226, 0.4);
  background: rgba(7, 25, 39, 0.97);
  transform: translate(-4px, -50%) rotate(45deg);
}

.contact-sidebar__item:focus-within .contact-sidebar__popover,
.contact-sidebar__item.is-open .contact-sidebar__popover {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translate(0, -50%);
}

@media (hover: hover) and (pointer: fine) {
  .contact-sidebar__item:hover .contact-sidebar__popover {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translate(0, -50%);
  }
}

.contact-sidebar__phone-card,
.contact-sidebar__qr-card {
  border: 1px solid rgba(82, 174, 226, 0.4);
  border-radius: 8px;
  background: rgba(7, 25, 39, 0.97);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.38);
  backdrop-filter: blur(16px) saturate(135%);
}

.contact-sidebar__phone-card {
  width: 170px;
  padding: 14px 16px;
}

.contact-sidebar__phone-card span {
  display: block;
  margin-bottom: 5px;
  color: #9db7c8;
  font-size: 12px;
}

.contact-sidebar__phone-card strong {
  display: block;
  color: #fff;
  font-size: 20px;
  line-height: 1.25;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.contact-sidebar__qr-card {
  width: 184px;
  padding: 9px 9px 11px;
  text-align: center;
}

.contact-sidebar__qr-card img {
  width: 164px;
  height: 164px;
  display: block;
  border-radius: 5px;
  background: #fff;
}

.contact-sidebar__qr-card span {
  display: block;
  margin-top: 8px;
  color: #c7dde9;
  font-size: 12px;
}

@media (max-width: 680px), (hover: none) and (pointer: coarse) {
  .contact-sidebar {
    right: max(12px, env(safe-area-inset-right, 0px));
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    width: 50px;
  }

  .contact-sidebar__button {
    width: 50px;
    min-height: 50px;
    gap: 2px;
    font-size: 10px;
  }

  .contact-sidebar__icon {
    width: 19px;
    height: 19px;
  }

  .contact-sidebar__popover {
    right: calc(100% + 10px);
  }

  .contact-sidebar__phone-card {
    width: 158px;
    padding: 12px 14px;
  }

  .contact-sidebar__phone-card strong {
    font-size: 18px;
  }

  .contact-sidebar__qr-card {
    width: 170px;
  }

  .contact-sidebar__qr-card img {
    width: 150px;
    height: 150px;
  }

  .contact-sidebar__item--wechat .contact-sidebar__popover {
    top: auto;
    bottom: 0;
    transform: translateX(8px);
  }

  .contact-sidebar__item--wechat:focus-within .contact-sidebar__popover,
  .contact-sidebar__item--wechat.is-open .contact-sidebar__popover,
  .contact-sidebar__item--wechat:hover .contact-sidebar__popover {
    transform: translateX(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .contact-sidebar__button,
  .contact-sidebar__popover {
    transition-duration: 0.01ms;
  }
}
