/* ============================================
   Social Media Bar - 社交媒体栏（蓝色渐变条）
   ============================================ */

.social-media-bar {
  width: 100%;
  margin: 0;
  padding: 0;
}

.social-media-bar__inner {
  background: linear-gradient(90deg, #000499 0%, #0055A4 40%, #0095D9 100%);
  max-width: 100%;
  margin: 0 auto;
  display: flex;
  align-items: stretch;
  min-height: 120px;
  padding: 0;
}

.social-media-bar__title {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  white-space: nowrap;
  margin: 0;
  padding: 20px;
}

.social-media-bar__icons {
  flex: 3;
  display: flex;
  align-items: stretch;
  gap: 0;
  margin: 0;
}

.social-media-bar__item {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.social-media-bar__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-height: 120px;
  background: none;
  border: none;
  cursor: pointer;
  transition: background 0.2s;
  position: relative;
  padding: 0;
}

.social-media-bar__btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* 分隔线：标题与第一个图标之间 + 图标互相之间 */
.social-media-bar__icons::before {
  content: '';
  width: 1px;
  align-self: center;
  height: 40%;
  background: rgba(255, 255, 255, 0.4);
}

.social-media-bar__item + .social-media-bar__item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 1px;
  height: 40%;
  background: rgba(255, 255, 255, 0.4);
}

/* 清理旧的按钮内部分隔线（由新的 item::before 接管） */
.social-media-bar__item + .social-media-bar__item .social-media-bar__btn::before {
  content: none;
}

/* 图标图片 */
.social-media-bar__icon-img {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: contain;
}

/* 旧版 CSS 伪元素图标（兼容降级） */
.social-media-bar__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
}

/* 微信公众号 - 绿色圆 */
.social-media-bar__icon--wechat {
  background: #07C160;
  position: relative;
}
.social-media-bar__icon--wechat::before,
.social-media-bar__icon--wechat::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  background: #fff;
}
.social-media-bar__icon--wechat::before {
  width: 14px;
  height: 12px;
  top: 8px;
  left: 6px;
}
.social-media-bar__icon--wechat::after {
  width: 12px;
  height: 10px;
  top: 14px;
  right: 6px;
}

/* 视频号 - 橙色圆 */
.social-media-bar__icon--wechat-video {
  background: linear-gradient(135deg, #FA6400, #FF8C38);
  position: relative;
}
.social-media-bar__icon--wechat-video::before {
  content: '';
  position: absolute;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 7px 0 7px 11px;
  border-color: transparent transparent transparent #fff;
  top: 50%;
  left: 55%;
  transform: translate(-50%, -50%);
}

/* 小红书 - 红色圆 */
.social-media-bar__icon--xiaohongshu {
  background: #FF2442;
  position: relative;
}
.social-media-bar__icon--xiaohongshu::before {
  content: '书';
  position: absolute;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

/* ---------- 二维码弹窗 ---------- */
.social-media-bar__qrcode-popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: sm-fade-in 0.2s ease;
}

@keyframes sm-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.social-media-bar__qrcode-content {
  background: #fff;
  border-radius: 12px;
  padding: 24px 20px 20px;
  text-align: center;
  position: relative;
  /* 宽度不再写死，跟随图片原始尺寸自适应；限制上限避免溢出屏幕 */
  max-width: min(92vw, 420px);
  max-height: 90vh;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: sm-pop-in 0.25s cubic-bezier(0.2, 0.9, 0.3, 1.2);
  overflow: hidden;
}

@keyframes sm-pop-in {
  from { transform: scale(0.85); opacity: 0; }
  to   { transform: scale(1);    opacity: 1; }
}

.social-media-bar__qrcode-content h4 {
  margin: 0 0 14px;
  font-size: 17px;
  font-weight: 600;
  color: #222;
  letter-spacing: 1px;
  /* 海报类图本身包含标题 -> 这里 h4 就的是后台配置的 name，依然保留，作为弹窗指引 */
}

.social-media-bar__qrcode-close {
  position: absolute;
  top: 8px;
  right: 12px;
  background: none;
  border: none;
  font-size: 26px;
  cursor: pointer;
  color: #bbb;
  line-height: 1;
  padding: 4px 8px;
  transition: color 0.2s, transform 0.2s;
}
.social-media-bar__qrcode-close:hover {
  color: #333;
  transform: rotate(90deg);
}

/* 二维码图片：不强制方形，按原图比例自适应，已带品牌背景的海报/名片数据无需再套外框 */
.social-media-bar__qrcode-img {
  display: block;
  margin: 0 auto;
  max-width: 100%;
  max-height: 70vh;
  width: auto;
  height: auto;
  /* 二维码保持锐利边缘，避免缩放模糊导致扫码失败 */
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
}

/* 纯方形二维码场景的兼容：限制宽度上限避免过大 */
.social-media-bar__qrcode-img[src*="qrcode"] {
  max-width: 340px;
}

.social-media-bar__qrcode-placeholder {
  width: 220px;
  height: 220px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #f5f5f5;
  border-radius: 8px;
  border: 2px dashed #ddd;
}
.social-media-bar__qrcode-placeholder p {
  margin: 4px 0;
  color: #666;
  font-size: 14px;
}
.social-media-bar__qrcode-hint {
  font-size: 12px !important;
  color: #999 !important;
}

/* ---------- 响应式 ---------- */
@media (max-width: 768px) {
  .social-media-bar__inner {
    flex-direction: column;
    padding: 15px 20px;
    gap: 10px;
  }
  .social-media-bar__title {
    margin-right: 0;
  }
  .social-media-bar__icons {
    margin-left: 0;
  }
}
