/* ==========================================================================
   浮动组件：收藏本站 + 社群入口
   参考 steamdownload.cn 的交互，适配本站深色主题
   ========================================================================== */

/* ---------- 右侧折叠栏 ---------- */
.gh-float-aside {
  position: fixed;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 55;
  display: flex;
  align-items: flex-start;
}

.gh-float-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  width: 34px;
  padding: 14px 0;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-right: none;
  border-radius: 10px 0 0 10px;
  color: var(--text);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .04em;
  cursor: pointer;
  box-shadow: -4px 4px 0 rgba(0, 0, 0, .5);
  transition: background .15s, color .15s, transform .15s;
}
.gh-float-tab b {
  writing-mode: vertical-rl;
  font-size: 12px;
  letter-spacing: .16em;
}
.gh-float-tab > span { font-size: 16px; line-height: 1; }
.gh-float-tab:hover {
  background: var(--accent);
  color: #0d0d12;
  transform: translateX(-2px);
}

/* ---------- 展开卡片 ---------- */
.gh-float-card {
  width: 186px;
  margin-right: 12px;
  padding: 18px 14px 14px;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: 12px;
  box-shadow: 5px 5px 0 rgba(0, 0, 0, .55);
  position: relative;
  opacity: 0;
  visibility: hidden;
  transform: translateX(12px) scale(.96);
  transition: opacity .2s ease, transform .2s ease, visibility .2s;
}
.gh-float-aside.is-open .gh-float-card {
  opacity: 1;
  visibility: visible;
  transform: translateX(0) scale(1);
}

.gh-float-close {
  position: absolute;
  top: -11px;
  right: -11px;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-elev);
  border: 2px solid var(--border);
  border-radius: 50%;
  color: var(--text);
  font-size: 16px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.gh-float-close:hover { background: var(--accent); color: #0d0d12; }

.gh-float-star {
  font-size: 26px;
  text-align: center;
  line-height: 1;
  margin-bottom: 8px;
}
.gh-float-title {
  display: block;
  text-align: center;
  font-size: 15px;
  font-weight: 900;
  color: var(--text);
  margin-bottom: 6px;
}
.gh-float-text {
  text-align: center;
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.7;
  color: var(--text-dim);
  margin: 0 0 12px;
}
.gh-float-text kbd {
  display: inline-block;
  padding: 1px 6px;
  background: var(--bg-input);
  border: 1px solid var(--border-soft);
  border-radius: 4px;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 10.5px;
  color: var(--accent);
}

/* ---------- 按钮 ---------- */
.gh-float-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 8px 10px;
  margin-bottom: 8px;
  background: var(--bg-elev);
  border: 2px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 12.5px;
  font-weight: 800;
  line-height: 1.3;
  cursor: pointer;
  box-shadow: 3px 3px 0 rgba(0, 0, 0, .5);
  transition: background .15s, color .15s, transform .1s, box-shadow .1s;
}
.gh-float-btn:last-of-type { margin-bottom: 0; }
.gh-float-btn:hover { background: var(--accent); color: #0d0d12; }
.gh-float-btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 rgba(0, 0, 0, .5); }

.gh-float-btn.is-main {
  background: var(--accent);
  color: #0d0d12;
}
.gh-float-btn.is-main:hover { filter: brightness(1.1); }

.gh-float-url {
  margin-top: 12px;
  text-align: center;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .03em;
  color: var(--text-mute);
  word-break: break-all;
}

/* ---------- 右下角社群按钮 ---------- */
.gh-social-dock {
  position: fixed;
  right: 20px;
  bottom: 28px;
  z-index: 54;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.gh-social-btn {
  position: relative;
  width: 54px;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: 14px;
  color: var(--text);
  font-size: 22px;
  cursor: pointer;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, .55);
  transition: transform .15s, box-shadow .1s, background .15s, color .15s;
}
.gh-social-btn:hover {
  background: var(--accent);
  color: #0d0d12;
  transform: translateY(-3px);
}
.gh-social-btn:active {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 rgba(0, 0, 0, .55);
}

.gh-social-tag {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-3);
  border: 2px solid var(--border);
  border-radius: 10px;
  color: #14140f;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
}

/* 悬浮气泡提示 */
.gh-social-tip {
  position: absolute;
  right: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%) translateX(6px);
  padding: 7px 11px;
  background: var(--bg-elev);
  border: 2px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .15s, transform .15s, visibility .15s;
}
.gh-social-tip::after {
  content: "";
  position: absolute;
  left: 100%;
  top: 50%;
  margin-top: -5px;
  border: 5px solid transparent;
  border-left-color: var(--border);
}
.gh-social-btn:hover .gh-social-tip {
  opacity: 1;
  visibility: visible;
  transform: translateY(-50%) translateX(0);
}

/* ---------- 移动端适配 ---------- */
@media (max-width: 900px) {
  .gh-float-aside { display: none; }
  .gh-social-dock { right: 12px; bottom: 74px; gap: 8px; }
  .gh-social-btn { width: 46px; height: 46px; font-size: 19px; border-radius: 12px; }
  .gh-social-tip { display: none; }
}

@media (max-width: 640px) {
  .gh-social-dock { right: 10px; bottom: 66px; }
  .gh-social-btn { width: 42px; height: 42px; font-size: 17px; }
}





/* ==========================================================================
   帮忙宣传弹窗
   ========================================================================== */
.gh-promo-mask {
  position: fixed;
  inset: 0;
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, .72);
  backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity .2s ease;
}
.gh-promo-mask.is-open { opacity: 1; }
.gh-promo-mask[hidden] { display: none; }

body.gh-promo-lock { overflow: hidden; }

.gh-promo-modal {
  width: min(920px, 100%);
  max-height: min(88vh, 820px);
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: 14px;
  box-shadow: 8px 8px 0 rgba(0, 0, 0, .6);
  transform: translateY(14px) scale(.98);
  transition: transform .22s cubic-bezier(.34, 1.3, .64, 1);
  overflow: hidden;
}
.gh-promo-mask.is-open .gh-promo-modal {
  transform: translateY(0) scale(1);
}

/* 头部 */
.gh-promo-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: var(--accent);
  border-bottom: 2px solid var(--border);
  color: #0d0d12;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: .02em;
  flex: none;
}
.gh-promo-close {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(13, 13, 18, .12);
  border: 2px solid #0d0d12;
  border-radius: 8px;
  color: #0d0d12;
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.gh-promo-close:hover { background: #0d0d12; color: var(--accent); }

/* 主体 */
.gh-promo-body {
  padding: 20px 22px 18px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.gh-promo-lead {
  margin: 0 0 20px;
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.85;
  color: var(--text);
}
.gh-promo-lead span {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-dim);
}

/* 步骤网格 */
.gh-promo-steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: none;
}

.gh-promo-step {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 26px 14px 14px;
  background: var(--bg-elev);
  border: 2px solid var(--border-soft);
  border-radius: 11px;
  transition: border-color .15s, transform .15s;
}
.gh-promo-step:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.gh-promo-num {
  position: absolute;
  top: -12px;
  left: 14px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  border: 2px solid var(--border);
  border-radius: 50%;
  color: #0d0d12;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
}

.gh-promo-ico {
  font-size: 30px;
  line-height: 1;
  text-align: center;
  margin-bottom: 10px;
}

.gh-promo-step h4 {
  margin: 0 0 6px;
  font-size: 13.5px;
  font-weight: 900;
  line-height: 1.45;
  color: var(--text);
}
.gh-promo-step p {
  margin: 0 0 12px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.75;
  color: var(--text-dim);
  flex: 1;
}

.gh-promo-act {
  display: block;
  width: 100%;
  margin-top: auto;
  padding: 7px 10px;
  background: var(--bg-input);
  border: 2px solid var(--border);
  border-radius: 7px;
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: background .15s, color .15s, transform .1s;
}
.gh-promo-act:hover { background: var(--accent); color: #0d0d12; }
.gh-promo-act:active { transform: scale(.97); }

/* 第 5 步：二维码 */
.gh-promo-step--qr {
  grid-column: span 4;
  flex-direction: row;
  align-items: center;
  gap: 20px;
  padding: 18px 20px 18px 26px;
}
.gh-promo-step--qr .gh-promo-ico {
  font-size: 26px;
  margin: 0;
}
.gh-promo-step--qr h4 { margin-bottom: 4px; }
.gh-promo-step--qr p { margin-bottom: 0; flex: 1; }
.gh-promo-step--qr .gh-promo-act { width: auto; margin: 0; white-space: nowrap; }

.gh-promo-qr {
  flex: none;
  width: 132px;
  height: 132px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 2px solid var(--border);
  border-radius: 9px;
  overflow: hidden;
}
.gh-promo-qr img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.gh-promo-qr-ph {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 100%;
  height: 100%;
  background:
    repeating-linear-gradient(45deg, #e8e8ec 0 8px, #f4f4f7 8px 16px);
  color: #8a8a94;
}
.gh-promo-qr-ph span { font-size: 13px; font-weight: 900; }
.gh-promo-qr-ph em { font-size: 10.5px; font-style: normal; font-weight: 700; }

.gh-promo-foot {
  margin: 20px 0 0;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-mute);
}

/* ==========================================================================
   二维码浮层
   ========================================================================== */
.gh-qr-mask {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, .78);
  opacity: 0;
  visibility: hidden;
  transition: opacity .18s, visibility .18s;
}
.gh-qr-mask.is-open { opacity: 1; visibility: visible; }

.gh-qr-box {
  position: relative;
  padding: 22px;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: 13px;
  box-shadow: 6px 6px 0 rgba(0, 0, 0, .6);
  text-align: center;
}
.gh-qr-box img {
  display: block;
  width: 220px;
  height: 220px;
  object-fit: contain;
  background: #fff;
  border-radius: 8px;
}
.gh-qr-box p {
  margin: 12px 0 0;
  font-size: 13px;
  font-weight: 800;
  color: var(--text);
}
.gh-qr-close {
  position: absolute;
  top: -12px;
  right: -12px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-elev);
  border: 2px solid var(--border);
  border-radius: 50%;
  color: var(--text);
  font-size: 17px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
}
.gh-qr-close:hover { background: var(--accent); color: #0d0d12; }

/* ==========================================================================
   响应式
   ========================================================================== */
@media (max-width: 860px) {
  .gh-promo-steps { grid-template-columns: repeat(2, 1fr); }
  .gh-promo-step--qr { grid-column: span 2; }
}

@media (max-width: 640px) {
  .gh-promo-mask { padding: 10px; }
  .gh-promo-modal { max-height: 92vh; border-radius: 12px; }
  .gh-promo-head { padding: 11px 14px; font-size: 14px; }
  .gh-promo-body { padding: 14px 13px 16px; }
  .gh-promo-lead { font-size: 12.5px; margin-bottom: 16px; }
  .gh-promo-steps { grid-template-columns: 1fr; gap: 12px; }
  .gh-promo-step { padding: 24px 12px 12px; }
  .gh-promo-step--qr {
    grid-column: span 1;
    flex-direction: column;
    gap: 12px;
    padding: 24px 12px 14px;
  }
  .gh-promo-step--qr .gh-promo-act { width: 100%; }
  .gh-promo-qr { width: 160px; height: 160px; }
  .gh-qr-box img { width: 180px; height: 180px; }
}

/* ---------- 按钮旁的小提示 ---------- */
.gh-float-btn { position: relative; }

.gh-float-btn-hint {
  position: absolute;
  right: -6px;
  top: -9px;
  padding: 1px 6px;
  background: var(--accent-3);
  border: 2px solid var(--border);
  border-radius: 8px;
  color: #14140f;
  font-size: 9.5px;
  font-weight: 900;
  line-height: 1.5;
  letter-spacing: .02em;
  pointer-events: none;
  animation: gh-hint-bounce 2.4s ease-in-out infinite;
}

@keyframes gh-hint-bounce {
  0%, 72%, 100% { transform: translateY(0); }
  78%           { transform: translateY(-3px); }
  84%           { transform: translateY(0); }
  90%           { transform: translateY(-2px); }
  96%           { transform: translateY(0); }
}

/* 提示在 hover 时收起，避免干扰 */
.gh-float-btn--promo:hover .gh-float-btn-hint {
  animation: none;
  opacity: .55;
}

@media (max-width: 900px) {
  .gh-float-btn-hint { display: none; }
}

/* ---------- 跟随式轻提示 ---------- */
.gh-float-toast {
  position: fixed;
  z-index: 10000;
  max-width: 240px;
  padding: 8px 13px;
  background: var(--accent);
  border: 2px solid var(--border);
  border-radius: 8px;
  color: #0d0d12;
  font-size: 12.5px;
  font-weight: 800;
  line-height: 1.5;
  box-shadow: 3px 3px 0 rgba(0, 0, 0, .55);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity .16s, transform .16s, visibility .16s;
}
.gh-float-toast.is-show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
/* 左侧模式：right 定位，内容向左展开 */


/* 小三角 */
.gh-float-toast::before {
  content: "";
  position: absolute;
  top: 50%;
  margin-top: -6px;
  border: 6px solid transparent;
}
.gh-float-toast::after {
  content: "";
  position: absolute;
  left: 100%;
  top: 50%;
  margin-top: -6px;
  border: 6px solid transparent;
  border-left-color: var(--border);
}

/* ==========================================================================
   QQ 群卡片（点击按钮展开）
   ========================================================================== */
.gh-social-qq-wrap {
  position: relative;
}

.gh-qq-card {
  position: absolute;
  right: calc(100% + 14px);
  bottom: 0;
  width: 232px;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: 13px;
  box-shadow: 6px 6px 0 rgba(0, 0, 0, .6);
  opacity: 0;
  visibility: hidden;
  transform: translateX(10px) scale(.96);
  transform-origin: right bottom;
  transition: opacity .2s cubic-bezier(.34, 1.3, .64, 1),
              transform .2s cubic-bezier(.34, 1.3, .64, 1),
              visibility .2s;
  overflow: hidden;
  pointer-events: none;
}
.gh-social-qq-wrap.is-open .gh-qq-card {
  opacity: 1;
  visibility: visible;
  transform: translateX(0) scale(1);
  pointer-events: auto;
}

.gh-qq-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 14px;
  background: var(--accent);
  border-bottom: 2px solid var(--border);
  color: #0d0d12;
  font-size: 13.5px;
  font-weight: 900;
}
.gh-qq-close {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(13, 13, 18, .13);
  border: 2px solid #0d0d12;
  border-radius: 6px;
  color: #0d0d12;
  font-size: 15px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.gh-qq-close:hover { background: #0d0d12; color: var(--accent); }

.gh-qq-body {
  padding: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.gh-qq-img {
  display: block;
  width: 176px;
  height: 176px;
  object-fit: contain;
  background: #fff;
  border: 2px solid var(--border);
  border-radius: 9px;
  padding: 4px;
}
.gh-qq-img--ph {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  background: repeating-linear-gradient(45deg, #22222c 0 9px, #1a1a23 9px 18px);
  color: var(--text-mute);
  font-style: normal;
}
.gh-qq-img--ph span { font-size: 13px; font-weight: 900; }
.gh-qq-img--ph em { font-size: 10.5px; font-style: normal; font-weight: 700; }

.gh-qq-no {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-dim);
}
.gh-qq-no span { color: var(--text); font-weight: 900; }
.gh-qq-no--ph { color: var(--text-mute); }

.gh-qq-copy {
  padding: 3px 8px;
  background: var(--bg-input);
  border: 1.5px solid var(--border-soft);
  border-radius: 5px;
  color: var(--text);
  font-size: 10.5px;
  font-weight: 800;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.gh-qq-copy:hover { background: var(--accent); color: #0d0d12; border-color: var(--border); }

.gh-qq-tip {
  margin: 0;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.6;
  color: var(--text-mute);
}

/* QQ 按钮展开时高亮 */
.gh-social-qq-wrap.is-open .gh-social-qq {
  background: var(--accent);
  color: #0d0d12;
}

@media (max-width: 900px) {
  .gh-qq-card {
    position: fixed;
    right: 12px;
    bottom: 128px;
    transform-origin: right bottom;
  }
}
