/* 广告管理 - 前台广告位样式（顶部横幅 / 首页幻灯片 / 首页弹窗） */

/* ---------- 各页面顶部横幅 ---------- */
/* 默认：左右 12px（与常见卡片内边距一致）、上下各 12px；各页面容器内边距不同，见下方按上下文微调 */
.sq-ad-top {
  margin: 12px 12px;
}
/* 容器本身已带左右内边距时，避免二次缩进导致与相邻卡片不对齐 */
.tk-body > .sq-ad-top,
.mc-body > .sq-ad-top { margin-left: 0; margin-right: 0; }
/* 资讯页 / 社群页：相邻卡片统一是 14px 边距 */
.nc-page > .sq-ad-top,
.page > .sq-ad-top { margin-left: 14px; margin-right: 14px; }
.sq-ad-top .sq-ad-link {
  display: block;
  margin-bottom: 8px;
  border-radius: 8px;
  overflow: hidden;
  background: #f2f3f7;
}
.sq-ad-top .sq-ad-link:last-child { margin-bottom: 0; }
.sq-ad-top .sq-ad-img {
  display: block;
  width: 100%;
  height: auto;
}

/* ---------- 首页幻灯片（轮播） ---------- */
.sq-ad-slideshow {
  position: relative;
  width: 100%;
  aspect-ratio: 75 / 36;
  height: auto;
  border-radius: 8px;
  overflow: hidden;
  background: #eef0f4;
}
.sq-ad-slides { position: absolute; inset: 0; }
.sq-ad-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity .5s ease;
  pointer-events: none;
}
.sq-ad-slide.on { opacity: 1; pointer-events: auto; }
.sq-ad-slide a, .sq-ad-slide { display: block; width: 100%; height: 100%; }
.sq-ad-slide-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.sq-ad-dots {
  position: absolute;
  right: 10px;
  bottom: 8px;
  display: flex;
  gap: 5px;
  z-index: 2;
}
.sq-ad-dots i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .55);
  transition: all .2s ease;
}
.sq-ad-dots i.on {
  width: 16px;
  border-radius: 4px;
  background: #fff;
}

/* ---------- 首页弹窗 ---------- */
.sq-ad-popup-mask {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, .55);
  display: flex;
  align-items: center;
  justify-content: center;
}
.sq-ad-popup-card {
  position: relative;
  width: 78%;
  max-width: 360px;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}
.sq-ad-popup-card a,
.sq-ad-popup-card { display: block; }
.sq-ad-popup-img {
  display: block;
  width: 100%;
  height: auto;
}
.sq-ad-popup-close {
  position: absolute;
  top: 6px;
  right: 8px;
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, .4);
  color: #fff;
  font-size: 18px;
  line-height: 26px;
  text-align: center;
  cursor: pointer;
}
