/* ============================================================
   Support stack — 右下角浮动工具栏
   - 顶部：❤ 收藏 + ⌘ 扫码分享（白底圆按钮，叠在 FAB 上方）
   - 底部：在线客服 FAB（琥珀胶囊，原设计保留）
   ============================================================ */

.support-stack {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 90;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}

/* ----- 顶部小工具栏 ----- */
.support-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-right: 4px; /* 让两个圆图标的右边缘对齐 FAB 内边距 */
}

.support-tool {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #ffffff;
  border: 1px solid rgba(21, 33, 29, 0.10);
  box-shadow: 0 4px 12px rgba(8, 15, 13, 0.10);
  color: #4a5562;
  cursor: pointer;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.18s ease,
              border-color 0.18s ease,
              transform 0.18s ease,
              box-shadow 0.18s ease,
              background 0.18s ease;
}

.support-tool:hover {
  color: #15211d;
  border-color: rgba(21, 33, 29, 0.20);
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(8, 15, 13, 0.14);
}

.support-tool:active {
  transform: translateY(0);
}

.support-tool:focus-visible {
  outline: 2px solid rgba(21, 33, 29, 0.4);
  outline-offset: 3px;
}

.support-tool-icon {
  width: 18px;
  height: 18px;
  display: block;
}

/* 心形：默认 outline；favorited=true 切换为 filled + 玫红 */
.support-tool-favorite .support-tool-icon-filled {
  display: none;
}

.support-tool-favorite[data-favorited="true"] {
  color: #e0245e;
  border-color: rgba(224, 36, 94, 0.30);
}

.support-tool-favorite[data-favorited="true"]:hover {
  color: #c81d52;
  border-color: rgba(224, 36, 94, 0.50);
  background: rgba(224, 36, 94, 0.04);
}

.support-tool-favorite[data-favorited="true"] .support-tool-icon-outline {
  display: none;
}

.support-tool-favorite[data-favorited="true"] .support-tool-icon-filled {
  display: block;
}

/* ----- 扫码 popover：紧贴分享按钮，向上弹出，无遮罩 ----- */
.support-tool-wrap {
  position: relative;
}

.support-share-popover {
  position: absolute;
  bottom: calc(100% + 12px);
  right: 0;
  width: 240px;
  padding: 16px;
  background: #ffffff;
  border: 1px solid rgba(21, 33, 29, 0.10);
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(8, 15, 13, 0.16),
              0 4px 12px rgba(8, 15, 13, 0.08);
  opacity: 0;
  transform: translateY(8px) scale(0.96);
  transform-origin: bottom right;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.18s ease,
              transform 0.18s ease,
              visibility 0.18s ease;
  z-index: 91;
}

.support-share-popover.active {
  opacity: 1;
  transform: translateY(0) scale(1);
  visibility: visible;
  pointer-events: auto;
}

/* 小三角形指向触发器（视觉锚点）*/
.support-share-popover::after {
  content: '';
  position: absolute;
  bottom: -7px;
  right: 14px;
  width: 12px;
  height: 12px;
  background: #ffffff;
  border-right: 1px solid rgba(21, 33, 29, 0.10);
  border-bottom: 1px solid rgba(21, 33, 29, 0.10);
  transform: rotate(45deg);
}

.support-popover-qr {
  width: 100%;
  aspect-ratio: 1 / 1;
  padding: 8px;
  background: #ffffff;
  border: 1px solid rgba(21, 33, 29, 0.06);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.support-popover-qr svg {
  width: 100%;
  height: 100%;
  display: block;
}

.support-popover-loading {
  font-size: 12px;
  color: #888;
  text-align: center;
  line-height: 1.5;
}

.support-popover-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 6px 6px 10px;
  background: rgba(21, 33, 29, 0.04);
  border-radius: 6px;
  margin-bottom: 8px;
}

.support-popover-link-text {
  flex: 1;
  font-size: 11.5px;
  color: #4a5562;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  text-align: left;
}

.support-popover-copy {
  flex-shrink: 0;
  font-size: 11.5px;
  font-weight: 600;
  color: #15211d;
  background: #ffffff;
  border: 1px solid rgba(21, 33, 29, 0.14);
  border-radius: 5px;
  padding: 4px 8px;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.support-popover-copy:hover {
  border-color: #15211d;
}

.support-popover-copy:disabled {
  cursor: default;
  color: #2a8a4f;
  border-color: rgba(42, 138, 79, 0.4);
  background: rgba(42, 138, 79, 0.06);
}

.support-popover-tip {
  font-size: 11px;
  color: #888;
  line-height: 1.5;
  margin: 0;
  text-align: center;
}

/* ============================================================
   Support FAB — 在线客服浮动按钮
   暖色：琥珀 #f59e0b（占位态），原视觉保留
   ============================================================ */

.support-fab {
  display: inline-flex;
  align-items: center;
  gap: 8px;

  height: 52px;
  padding: 0 22px 0 18px;
  border: none;
  border-radius: 9999px;
  cursor: pointer;

  background: #f59e0b;
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;

  box-shadow: 0 10px 24px rgba(245, 158, 11, 0.30),
              0 2px 6px rgba(17, 17, 17, 0.12);
  transition: background-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.support-fab:hover {
  background: #d97706;
  transform: translateY(-2px);
  box-shadow: 0 16px 32px rgba(217, 119, 6, 0.36),
              0 2px 6px rgba(17, 17, 17, 0.14);
}

.support-fab:active {
  transform: translateY(0);
}

.support-fab:focus-visible {
  outline: 2px solid rgba(245, 158, 11, 0.6);
  outline-offset: 3px;
}

.support-fab-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
}

.support-fab-icon svg {
  width: 20px;
  height: 20px;
}

/* ============================================================
 * ❓ 关于 PlusGO popover
 * ============================================================
 * HTML 静态写在使用页（如 index.html `<aside id="entityInfoPopover">`），
 * 默认 hidden（HTML 属性）+ visibility:hidden + opacity:0 三层视觉藏住。
 * support-fab ❓ 按钮点击切换 .active class → fade-in 显示。
 *
 * GEO 价值保留：LLM 抓 HTML 源时这段文字始终在，不受 CSS 影响。
 *
 * 设计风格：与 .support-share-popover 同语言（白底 + 圆角 + 投影），但
 * 内容向（标题 + 多段 body 文字 + 关闭按钮），尺寸更大（容纳 ~250 字）。 */

.entity-info-popover {
  position: fixed;
  right: 24px;
  /* 锚到 support-fab tools 行上方：FAB(52) + tools(38) + gap(12*2) ≈ 112px */
  bottom: 116px;
  width: min(360px, calc(100vw - 48px));
  max-height: 60vh;
  overflow-y: auto;
  padding: 18px 20px 16px;
  background: #ffffff;
  border: 1px solid rgba(21, 33, 29, 0.10);
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(8, 15, 13, 0.16),
              0 4px 12px rgba(8, 15, 13, 0.08);
  opacity: 0;
  transform: translateY(8px) scale(0.98);
  transform-origin: bottom right;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease,
              transform 0.2s ease,
              visibility 0.2s ease;
  z-index: 91;
}

.entity-info-popover.active {
  opacity: 1;
  transform: translateY(0) scale(1);
  visibility: visible;
  pointer-events: auto;
}

/* HTML hidden 属性兜底（防止动画期间残影、保证关闭后真的不可点）*/
.entity-info-popover[hidden] {
  display: none !important;
}

.entity-info-popover-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(21, 33, 29, 0.06);
}

.entity-info-popover-title {
  font-size: 14px;
  font-weight: 700;
  margin: 0;
  color: #15211d;
  letter-spacing: -0.01em;
}

.entity-info-popover-close {
  width: 24px;
  height: 24px;
  border: none;
  background: transparent;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  color: rgba(21, 33, 29, 0.45);
  border-radius: 4px;
  transition: color 0.15s ease, background 0.15s ease;
  padding: 0;
}

.entity-info-popover-close:hover {
  color: #15211d;
  background: rgba(21, 33, 29, 0.06);
}

.entity-info-popover-close:focus-visible {
  outline: 2px solid rgba(21, 33, 29, 0.4);
  outline-offset: 2px;
}

.entity-info-popover-body p {
  font-size: 12.5px;
  color: #4a5562;
  line-height: 1.7;
  margin: 0 0 8px;
}

.entity-info-popover-body p:last-child {
  margin-bottom: 0;
}

/* ❓ 按钮专属 hover 色（与 ❤ favorited 玫红区分，用淡蓝调）*/
.support-tool-info:hover {
  color: #1a6fc4;
  border-color: rgba(26, 111, 196, 0.25);
}

/* 移动端：FAB 缩成纯图标圆 */
@media (max-width: 560px) {
  .support-fab {
    width: 52px;
    padding: 0;
    justify-content: center;
  }

  .support-fab-text {
    display: none;
  }

  /* 工具按钮稍微紧凑一点，但不缩太小（拇指要点得到）*/
  .support-tool {
    width: 40px;
    height: 40px;
  }

  .support-tools {
    padding-right: 6px;
  }

  /* popover 宽度按屏幕收一些 */
  .support-share-popover {
    width: min(240px, calc(100vw - 48px));
  }

  /* ❓ entity popover 在移动端微调：小屏 FAB 是 52 圆，tools 是 40 圆 */
  .entity-info-popover {
    bottom: 112px;
    width: min(320px, calc(100vw - 32px));
    right: 16px;
    padding: 16px 18px 14px;
  }

  .entity-info-popover-body p {
    font-size: 12px;
    line-height: 1.65;
  }
}
