/* =====================================================================
 * 通用分享模块样式：悬浮分享按钮 + 分享面板 + 微信登录弹窗
 * 主题自适应（跟随页面深浅色），响应式（桌面/平板/手机/微信端）
 * ===================================================================== */

/* ---- 悬浮分享按钮 ---- */
.gwd-share-fab {
  position: fixed;
  right: calc(18px + env(safe-area-inset-right, 0px));
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  z-index: 9990;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #07c160, #06ad56);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px rgba(7, 193, 96, .4);
  font-size: 24px;
  line-height: 1;
  transition: transform .2s, box-shadow .2s;
  -webkit-tap-highlight-color: transparent;
}
.gwd-share-fab:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(7, 193, 96, .5); }
.gwd-share-fab:active { transform: scale(.94); }
.gwd-share-fab svg { width: 26px; height: 26px; fill: #fff; }

/* ---- 遮罩 ---- */
.gwd-share-mask {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .55);
  z-index: 9995;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: gwdFade .2s;
}
@keyframes gwdFade { from { opacity: 0; } to { opacity: 1; } }

/* ---- 分享面板 ---- */
.gwd-share-panel {
  width: 340px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 60px);
  overflow-y: auto;
  background: #ffffff;
  color: #1a1a1a;
  border-radius: 18px;
  padding: 22px 20px 18px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .3);
  animation: gwdUp .28s cubic-bezier(.2, .9, .3, 1);
}
@keyframes gwdUp { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }

.gwd-share-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.gwd-avatar {
  width: 52px; height: 52px; border-radius: 50%;
  flex-shrink: 0; object-fit: cover;
  border: 2px solid #07c160;
  background: #07c160;
}
.gwd-avatar-fallback {
  width: 52px; height: 52px; border-radius: 50%;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 22px; font-weight: 700;
  background: linear-gradient(135deg, #07c160, #00b0b0);
  border: 2px solid #07c160;
}
.gwd-share-head .gwd-nick { font-size: 17px; font-weight: 700; }
.gwd-share-head .gwd-sub { font-size: 12px; color: #999; margin-top: 2px; }
.gwd-share-head .gwd-sub b { color: #07c160; }

.gwd-script-box {
  background: #f5f7f5;
  border: 1px solid #e5e8e5;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 14px;
  line-height: 1.75;
  color: #333;
  margin-bottom: 8px;
  position: relative;
}
.gwd-script-label {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12px; color: #999; margin-bottom: 12px;
}
.gwd-ai-btn {
  font-size: 12px; color: #07c160; background: none; border: 1px solid #07c160;
  border-radius: 12px; padding: 2px 10px; cursor: pointer;
}
.gwd-ai-btn:disabled { opacity: .5; cursor: wait; }

/* 二维码 */
.gwd-qr-wrap { display: flex; flex-direction: column; align-items: center; margin: 14px 0 6px; }
.gwd-qr-wrap canvas { width: 168px; height: 168px; border: 1px solid #eee; border-radius: 10px; padding: 6px; background: #fff; }
.gwd-qr-tip { font-size: 12px; color: #999; margin-top: 6px; }

/* 操作按钮 */
.gwd-actions { display: flex; gap: 10px; margin-top: 14px; }
.gwd-btn {
  flex: 1; padding: 11px 0; border-radius: 12px; font-size: 14px; font-weight: 700;
  cursor: pointer; border: none; text-align: center; -webkit-tap-highlight-color: transparent;
}
.gwd-btn.primary { background: linear-gradient(135deg, #07c160, #06ad56); color: #fff; }
.gwd-btn.ghost { background: #f0f2f0; color: #333; }
.gwd-btn.wx { background: #07c160; color: #fff; }

.gwd-close {
  position: absolute; top: 8px; right: 12px;
  background: none; border: none; color: #bbb; font-size: 22px; cursor: pointer;
}
.gwd-share-panel { position: relative; }

/* ---- 登录弹窗 ---- */
.gwd-login-box { text-align: center; }
.gwd-login-box .gwd-avatar, .gwd-login-box .gwd-avatar-fallback { margin: 0 auto 12px; }
.gwd-login-box h3 { font-size: 17px; margin-bottom: 6px; }
.gwd-login-box p { font-size: 13px; color: #888; margin-bottom: 18px; line-height: 1.6; }
.gwd-login-box .gwd-btn { width: 100%; display: block; margin-bottom: 10px; }

/* ---- 移动端（手机 / 微信内置浏览器）---- */
@media (max-width: 640px) {
  .gwd-share-panel {
    width: 100%;
    max-width: 100%;
    border-radius: 20px 20px 0 0;
    align-self: flex-end;
    max-height: 88vh;
  }
  .gwd-share-mask { align-items: flex-end; }
  .gwd-share-fab { right: calc(14px + env(safe-area-inset-right, 0px)); bottom: calc(16px + env(safe-area-inset-bottom, 0px)); width: 52px; height: 52px; }
}

/* ---- 桌面端可略大 ---- */
@media (min-width: 641px) {
  .gwd-share-panel { width: 360px; }
}
