/* ==========================================================================
   聚师集团 · 分享气泡样式
   ========================================================================== */

.share-widget {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 900;
  font-family: inherit;
}

/* ---------- 圆形触发按钮 ---------- */
.share-fab {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, var(--brand-600), var(--brand-800));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(10, 37, 71, .22);
  transition: transform .25s ease, box-shadow .25s ease, opacity .2s ease;
  -webkit-tap-highlight-color: transparent;
}
.share-fab svg { width: 22px; height: 22px; }
.share-fab:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 10px 26px rgba(10, 37, 71, .3);
}
.share-fab:active { transform: translateY(0) scale(.97); }
.share-fab:focus-visible {
  outline: 2px solid var(--gold-500);
  outline-offset: 3px;
}

/* ---------- 气泡本体 ---------- */
.share-bubble {
  position: absolute;
  right: 0;
  bottom: 62px;
  width: 320px;
  max-width: calc(100vw - 32px);
  background: #fff;
  border-radius: 16px;
  border: 1px solid var(--line);
  box-shadow: 0 18px 48px rgba(10, 37, 71, .18);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px) scale(.96);
  transform-origin: bottom right;
  transition: opacity .22s ease, transform .22s ease, visibility .22s;
  overflow: hidden;
}
.share-widget.open .share-bubble {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* 气泡尖角 */
.share-bubble::after {
  content: "";
  position: absolute;
  right: 18px;
  bottom: -7px;
  width: 14px;
  height: 14px;
  background: #fff;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  transform: rotate(45deg);
}

/* ---------- 头部 ---------- */
.share-bubble-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 16px;
  background: linear-gradient(135deg, var(--brand-700), var(--brand-600));
  color: #fff;
}
.share-bubble-title {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .5px;
}
.share-close {
  width: 24px;
  height: 24px;
  border: none;
  background: rgba(255, 255, 255, .16);
  color: #fff;
  border-radius: 6px;
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s ease;
}
.share-close:hover { background: rgba(255, 255, 255, .3); }

/* ---------- 内容卡片 ---------- */
.share-card { padding: 16px; }

/* ---------- 分享预览卡（标题+摘要+配图）---------- */
.share-preview {
  display: flex;
  gap: 12px;
  padding: 12px;
  background: var(--brand-50);
  border-radius: 11px;
  margin-bottom: 13px;
}
.share-preview-img {
  width: 84px;
  height: 84px;
  flex-shrink: 0;
  /* 用 contain 而不是 cover —— 正方形缩略图放进正方形框里完整显示，
     用 cover 会把上下切掉一截，logo 和标题看不全 */
  object-fit: contain;
  border-radius: 8px;
  background: var(--brand-100);
  box-shadow: 0 2px 8px rgba(10, 37, 71, .12);
}
.share-preview-info {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.share-card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-900);
  line-height: 1.5;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.share-card-desc {
  font-size: 12px;
  color: var(--ink-500);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.share-card-row {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 13px;
  background: var(--brand-50);
  border-radius: 11px;
  margin-bottom: 14px;
}
.share-qr {
  width: 84px;
  height: 84px;
  flex-shrink: 0;
  background: #fff;
  border-radius: 8px;
  padding: 5px;
  box-shadow: 0 2px 8px rgba(10, 37, 71, .1);
  display: flex;
  align-items: center;
  justify-content: center;
}
.share-qr svg { display: block; width: 100%; height: 100%; }
.share-qr-fallback {
  font-size: 11px;
  color: var(--ink-400);
  text-align: center;
  line-height: 1.4;
}
.share-link-box { min-width: 0; flex: 1; }
.share-link-label {
  font-size: 11px;
  color: var(--ink-400);
  margin-bottom: 4px;
  letter-spacing: .3px;
}
.share-link-text {
  font-size: 12.5px;
  color: var(--brand-700);
  font-weight: 600;
  word-break: break-all;
  line-height: 1.5;
}

/* ---------- 操作按钮 ---------- */
.share-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
}
.share-act {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 4px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  font-size: 12px;
  color: var(--ink-700);
  cursor: pointer;
  font-family: inherit;
  transition: all .2s ease;
  -webkit-tap-highlight-color: transparent;
}
.share-act svg { width: 17px; height: 17px; color: var(--brand-600); }
.share-act:hover {
  border-color: var(--brand-400);
  background: var(--brand-50);
  color: var(--brand-700);
}
.share-act.done {
  border-color: var(--gold-500);
  background: var(--gold-100, #FBF6EC);
  color: var(--brand-700);
  font-weight: 600;
}
.share-act.done svg { display: none; }

/* ---------- 分享到微信的指引 ---------- */
.share-tip {
  margin: 13px 0 0;
  padding: 11px 12px;
  background: #FBF6EC;
  border-left: 3px solid var(--gold-500);
  border-radius: 0 8px 8px 0;
  font-size: 11.5px;
  line-height: 1.75;
  color: var(--ink-600);
}
.share-tip b { color: var(--brand-700); font-weight: 700; }

/* ---------- 移动端 ---------- */
@media (max-width: 820px) {
  .share-widget {
    right: 14px;
    bottom: 14px;
  }
  .share-fab {
    width: 44px;
    height: 44px;
  }
  .share-fab svg { width: 19px; height: 19px; }
  .share-bubble {
    width: calc(100vw - 28px);
    bottom: 54px;
    right: 0;
  }
  .share-bubble::after { right: 14px; }
}

/* ---------- 打印时隐藏 ---------- */
@media print {
  .share-widget { display: none !important; }
}
