/* 「收藏本站 + 人工帮助」悬浮球。
   ------------------------------------------------------------------
   右侧中部竖排两枚大号霓虹圆牌：上面「收藏」，下面「客服」。
   要的是「一眼看见、想点」：高饱和渐变、外发光、扫光、呼吸、进场动画，
   点收藏时炸一圈小星星，第一次进页面还有一句话气泡把人叫住。

   颜色一律取 :root 的品牌 token（--cyan / --blue / --danger），
   不另外发明颜色。两张弹窗沿用 .aftersale-modal 白底外壳，
   卡内文字用深色（白底上不能用 var(--text)，那是给深色页面准备的）。

   只在引入了 site-float-dock.js 的页面出现，不做全站默认挂载。 */

.site-float-dock {
  position: fixed;
  right: 20px;
  top: 50%;
  z-index: 1200;
  transform: translateY(-50%);
  animation: dock-in 0.7s cubic-bezier(0.22, 1, 0.36, 1) backwards;
}

.site-float-dock__stack {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 16px;
  isolation: isolate;
  /* 慢慢上下浮动，像水面上的浮标；hover 的缩放做在按钮自己身上，互不打架 */
  animation: dock-bob 6.5s 1.6s ease-in-out infinite;
}

/* 两枚按钮背后的一团柔光：让它们在浅色页面上"浮"起来，而不是贴在上面 */
.site-float-dock__stack::before {
  content: "";
  position: absolute;
  inset: -26px -30px;
  z-index: -1;
  border-radius: 44px;
  background: radial-gradient(60% 55% at 70% 40%, rgba(86, 201, 255, 0.42), transparent 72%),
    radial-gradient(55% 50% at 80% 78%, rgba(255, 123, 157, 0.34), transparent 74%);
  filter: blur(14px);
  animation: dock-aura 6.5s ease-in-out infinite;
  pointer-events: none;
}

.site-float-dock__btn {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 82px;
  height: 92px;
  padding: 0;
  border: 0;
  border-radius: 26px;
  cursor: pointer;
  color: #041424;
  background-image: linear-gradient(152deg, #9bf7ff 0%, #56c9ff 42%, var(--blue) 100%);
  background-size: 170% 170%;
  background-position: 0% 0%;
  box-shadow:
    0 20px 38px -14px rgba(79, 124, 255, 0.65),
    0 6px 16px -6px rgba(3, 7, 18, 0.28),
    0 1px 0 rgba(255, 255, 255, 0.65) inset,
    0 -12px 20px -14px rgba(3, 7, 18, 0.45) inset,
    0 0 0 1px rgba(255, 255, 255, 0.28) inset;
  overflow: hidden;
  isolation: isolate;
  transform: translateZ(0);
  transition: transform 0.24s cubic-bezier(0.2, 0.9, 0.2, 1.2), box-shadow 0.24s ease;
  animation:
    dock-btn-in 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.12s backwards,
    dock-gradient 7s 1.2s ease-in-out infinite;
}

.site-float-dock__btn--help {
  color: #ffffff;
  background-image: linear-gradient(152deg, #6fa4ff 0%, #7c7cff 52%, var(--danger) 100%);
  box-shadow:
    0 20px 38px -14px rgba(124, 124, 255, 0.62),
    0 6px 16px -6px rgba(3, 7, 18, 0.28),
    0 1px 0 rgba(255, 255, 255, 0.5) inset,
    0 -12px 20px -14px rgba(3, 7, 18, 0.4) inset,
    0 0 0 1px rgba(255, 255, 255, 0.26) inset;
  animation: dock-btn-in 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.24s backwards,
    dock-gradient 7s 4.4s ease-in-out infinite reverse;
}

.site-float-dock__btn:hover,
.site-float-dock__btn:focus-visible {
  transform: translateY(-3px) scale(1.06);
  outline: none;
}

.site-float-dock__btn--bookmark:hover,
.site-float-dock__btn--bookmark:focus-visible {
  box-shadow:
    0 26px 46px -12px rgba(86, 201, 255, 0.8),
    0 8px 20px -6px rgba(3, 7, 18, 0.3),
    0 1px 0 rgba(255, 255, 255, 0.7) inset,
    0 0 0 1px rgba(255, 255, 255, 0.35) inset;
}

.site-float-dock__btn--help:hover,
.site-float-dock__btn--help:focus-visible {
  box-shadow:
    0 26px 46px -12px rgba(255, 123, 157, 0.6),
    0 8px 20px -6px rgba(3, 7, 18, 0.3),
    0 1px 0 rgba(255, 255, 255, 0.55) inset,
    0 0 0 1px rgba(255, 255, 255, 0.3) inset;
}

.site-float-dock__btn:active {
  transform: translateY(0) scale(0.94);
}

/* 客服按钮常驻一圈往外扩的呼吸光环：整排按钮里它最需要被注意到 */
.site-float-dock__btn--help::after {
  content: "";
  position: absolute;
  inset: -5px;
  border-radius: 28px;
  border: 2px solid rgba(255, 123, 157, 0.55);
  animation: dock-ring 2.8s ease-out infinite;
  pointer-events: none;
}

/* 顶部一抹高光：桌面图标那种玻璃反光，让色块看起来是凸的 */
.site-float-dock__btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.34) 0%, rgba(255, 255, 255, 0.05) 34%, transparent 58%);
  pointer-events: none;
}

.site-float-dock__icon {
  position: relative;
  display: flex;
  filter: drop-shadow(0 2px 3px rgba(3, 7, 18, 0.22));
}

.site-float-dock__glyph {
  width: 34px;
  height: 34px;
  display: block;
}

.site-float-dock__label {
  position: relative;
  font-size: 13px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: 0.06em;
}

/* 斜向扫光：每 4.6 秒扫一遍，让按钮看起来是"活的" */
.site-float-dock__shine {
  position: absolute;
  inset: -40% -80%;
  background: linear-gradient(112deg, transparent 38%, rgba(255, 255, 255, 0.62) 48%, transparent 58%);
  transform: translateX(-130%);
  animation: dock-shine 4.6s ease-in-out infinite;
  pointer-events: none;
  z-index: -1;
}

.site-float-dock__btn--help .site-float-dock__shine {
  animation-delay: 2.3s;
}

/* 点收藏炸开的小星星 */
.site-float-dock__spark {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 7px;
  height: 7px;
  margin: -3.5px 0 0 -3.5px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 0 10px rgba(155, 247, 255, 0.95);
  pointer-events: none;
  animation: dock-spark 0.7s cubic-bezier(0.2, 0.7, 0.3, 1) forwards;
}

/* 首次进页面的一句话气泡：只在每个会话里出现一次 */
.site-float-dock__hint {
  position: absolute;
  right: 4px;
  bottom: calc(100% + 18px);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 18px;
  border: 1px solid rgba(117, 243, 255, 0.38);
  border-radius: 999px;
  background: linear-gradient(135deg, #071a2e 0%, #0f3159 100%);
  color: #eaf8ff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 18px 34px -14px rgba(3, 7, 18, 0.7), 0 0 22px -6px rgba(117, 243, 255, 0.45);
  opacity: 0;
  transform: translateY(10px) scale(0.94);
  pointer-events: none;
  transition: opacity 0.35s ease, transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.site-float-dock__hint.is-visible {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.site-float-dock__hint::after {
  content: "";
  position: absolute;
  right: 30px;
  top: 100%;
  border: 8px solid transparent;
  border-top-color: #0f3159;
}

.site-float-dock__hint-text {
  display: flex;
  align-items: center;
  gap: 8px;
}

.site-float-dock__hint-text::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 10px var(--cyan);
  animation: dock-blink 1.3s ease-in-out infinite;
}

@keyframes dock-in {
  from { opacity: 0; transform: translate(30px, -50%) scale(0.9); }
  to { opacity: 1; transform: translate(0, -50%) scale(1); }
}

@keyframes dock-btn-in {
  from { opacity: 0; transform: translateX(26px) scale(0.86); }
  to { opacity: 1; transform: none; }
}

@keyframes dock-gradient {
  0%, 100% { background-position: 0% 0%; }
  50% { background-position: 100% 100%; }
}

@keyframes dock-aura {
  0%, 100% { opacity: 0.7; transform: scale(1); }
  50% { opacity: 0.92; transform: scale(1.06); }
}

@keyframes dock-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}

@keyframes dock-ring {
  0% { opacity: 0.8; transform: scale(0.94); }
  70% { opacity: 0; transform: scale(1.22); }
  100% { opacity: 0; transform: scale(1.22); }
}

@keyframes dock-shine {
  0%, 55% { transform: translateX(-130%); }
  85%, 100% { transform: translateX(130%); }
}

@keyframes dock-spark {
  from {
    opacity: 1;
    transform: rotate(calc(var(--spark-index) * 45deg)) translateY(-8px) scale(0.7);
  }
  to {
    opacity: 0;
    transform: rotate(calc(var(--spark-index) * 45deg)) translateY(-52px) scale(0.2);
  }
}

@keyframes dock-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.25; }
}

/* ---------- 收藏引导卡 ---------- */

.site-guide__panel {
  width: min(520px, 92vw);
}

.site-guide-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.site-guide-step {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

/* 步骤序号做得比正文大一号：手机上缩到 92vw 时还能一眼看到「第几步」 */
.site-guide-step__num {
  flex: none;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(152deg, rgba(155, 247, 255, 0.35), rgba(79, 124, 255, 0.16));
  border: 1px solid rgba(79, 124, 255, 0.32);
  color: #1d4ed8;
  font-size: 17px;
  font-weight: 800;
}

.site-guide-step__text {
  font-size: 17px;
  line-height: 1.55;
  color: #1e293b;
  padding-top: 5px;
}

.site-guide-tip {
  margin: 18px 0 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(148, 163, 184, 0.12);
  font-size: 13px;
  line-height: 1.6;
  color: #475569;
}

.site-guide-copy {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.site-guide-copy .small,
.site-float-modal .small[data-copy-tip] {
  margin: 0;
  color: #15803d;
}

/* ---------- 人工帮助卡 ---------- */

.site-help__panel {
  width: min(560px, 92vw);
}

.site-help-rows {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.site-help-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
}

.site-help-row__label {
  flex: none;
  font-size: 13px;
  color: #64748b;
}

.site-help-row__value {
  flex: 1;
  font-family: monospace;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: #1e293b;
  word-break: break-all;
}

.site-help-row__copy {
  flex: none;
}

/* 微信信息与二维码左右分栏：竖着排会在 700px 高的笔记本上把「提交工单」挤出视口 */
.site-help-body {
  display: flex;
  align-items: flex-start;
  gap: 24px;
}

.site-help-main {
  flex: 1 1 240px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.site-help-qr {
  flex: none;
  margin: 0;
  width: 176px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.site-help-qr__img {
  width: 176px;
  height: auto;
  border-radius: 12px;
  cursor: zoom-in;
  background: #f8fafc;
  transition: transform 0.2s ease;
}

.site-help-qr__img:hover {
  transform: scale(1.03);
}

.site-help-qr figcaption {
  margin: 0;
  text-align: center;
  line-height: 1.6;
  color: #64748b;
}

.site-help-tip {
  margin: 0;
  line-height: 1.6;
  color: #94a3b8;
}

/* 点二维码看大图（移动端二维码太小扫不出来；放大后长按更容易识别） */
.site-float-modal.site-help-qr--zoom::after {
  content: "";
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.72);
  z-index: 5000;
}

.site-float-modal.site-help-qr--zoom .site-help-qr__img {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(84vw, 460px);
  z-index: 5001;
  cursor: zoom-out;
  border-radius: 16px;
  box-shadow: 0 24px 70px rgba(2, 6, 23, 0.45);
}

/* ---------- 窄屏收敛，别挡住内容 ---------- */

@media (max-width: 560px) {
  .site-help-body {
    flex-direction: column;
    align-items: center;
  }
}

@media (max-width: 600px) {
  .site-float-dock {
    right: 12px;
  }

  .site-float-dock__stack {
    gap: 10px;
  }

  .site-float-dock__btn {
    width: 70px;
    height: 80px;
    border-radius: 23px;
  }

  .site-float-dock__glyph {
    width: 29px;
    height: 29px;
  }

  .site-float-dock__label {
    font-size: 12px;
  }

  .site-float-dock__hint {
    font-size: 12px;
    padding: 9px 14px;
  }

  .site-guide-step__text {
    font-size: 16px;
  }

  .site-help-row {
    flex-wrap: wrap;
  }

  .site-help-row__copy {
    width: 100%;
  }
}

/* 系统开了「减弱动态效果」就别折腾：动画全停，只保留静态样式 */
@media (prefers-reduced-motion: reduce) {
  .site-float-dock,
  .site-float-dock__stack,
  .site-float-dock__btn,
  .site-float-dock__btn--help::after,
  .site-float-dock__shine,
  .site-float-dock__spark,
  .site-float-dock__hint-text::before {
    animation: none !important;
    transition: none !important;
  }
}
