.wechat-support {
  position: fixed;
  z-index: 12;
  top: 52%;
  top: clamp(12px, 52vh, calc(100vh - 354px));
  right: 16px;
  line-height: 0;
}

.wechat-support[hidden],
.wechat-support-panel[hidden] {
  display: none;
}

.wechat-support-trigger {
  display: flex;
  width: 76px;
  min-height: 72px;
  box-sizing: border-box;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 4px;
  border: 0;
  border-radius: 10px;
  background: #2553b3;
  color: #fff;
  box-shadow: 0 3px 10px rgba(0, 0, 0, .2);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  cursor: pointer;
}

.wechat-support-trigger:hover,
.wechat-support-trigger[aria-expanded='true'] {
  background: #1b4191;
}

.wechat-support-trigger:focus-visible,
.wechat-support-phone:focus-visible {
  outline: 2px solid #2553b3;
  outline-offset: 3px;
}

.wechat-support-panel {
  position: absolute;
  top: var(--wechat-support-panel-top, 0px);
  right: 100%;
  width: 244px;
  width: min(244px, calc(100vw - 110px));
  padding-right: 12px;
  box-sizing: content-box;
}

.wechat-support-panel::after {
  content: '';
  position: absolute;
  top: var(--wechat-support-arrow-top, 50%);
  right: 6px;
  width: 12px;
  height: 12px;
  background: #fff;
  transform: translateY(-50%) rotate(45deg);
  box-shadow: 2px -2px 4px rgba(0, 0, 0, .04);
  pointer-events: none;
}

.wechat-support-card {
  max-height: calc(100vh - 24px);
  overflow: auto;
  padding: 16px 12px 13px;
  box-sizing: border-box;
  border-radius: 12px;
  background: #fff;
  color: #222;
  text-align: center;
  line-height: 1.45;
  box-shadow: 0 5px 20px rgba(0, 0, 0, .16);
}

.wechat-support-title {
  margin: 0 0 5px;
  font-size: 20px;
  line-height: 1.4;
}

.wechat-support-qr {
  display: block;
  width: 210px;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
}

.wechat-support-panel a.wechat-support-phone {
  display: inline-block;
  color: #c52e2e;
  font-size: 18px;
  font-weight: 600;
  white-space: nowrap;
}

.wechat-support-note {
  margin: 3px 0 0;
  color: #555;
  font-size: 13px;
  line-height: 1.45;
}

@media (max-width: 600px) {
  .wechat-support { right: 12px; }
  .wechat-support-trigger { width: 68px; min-height: 64px; }
}

@media (max-height: 360px) {
  .wechat-support-card { padding-top: 10px; padding-bottom: 10px; }
  .wechat-support-qr { width: min(186px, max(64px, calc(100vh - 130px))); }
}

@media (max-height: 350px) and (min-width: 480px) {
  .wechat-support { right: 156px; top: 12px; }
}
