/* ========================================
   手机 & iPad 底漂广告（纯图片版）
   无文字，只显示 GIF 广告图，自适应不变形
   ======================================== */

.bottom-float-ad {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  z-index: 9999;
  pointer-events: none;
}

/* 广告卡片 —— 左右铺满，无圆角，底部无间隔 */
.ad-card {
  position: relative;            /* 为关闭按钮/页码提供定位上下文 */
  pointer-events: auto;
  margin: 0;                    /* 移除所有外边距，左右铺满、底部无间隔 */
  width: 100%;                  /* 完全铺满宽度 */
  border-radius: 0;             /* 去掉圆弧 */
  box-shadow: 0 -2px 20px rgba(0, 0, 0, 0.1), 0 8px 20px rgba(0, 0, 0, 0.12);
  overflow: hidden;             /* 保留裁剪（无圆角时不影响） */
  cursor: pointer;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0.05);
  transition: transform 0.2s;
  background: #ffffff;          /* 图片加载时的背景 */
  display: flex;
  align-items: center;
  justify-content: center;
}

.ad-card:active {
  transform: scale(0.99);
}

/* 广告图片 —— 宽度铺满，高度自动，不变形 */
.ad-image {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;          /* 完整显示图片，不裁剪不变形 */
  background: #f5f7fa;          /* 占位背景色 */
}

/* 关闭按钮 —— 悬浮在图片右上角 */
.ad-close {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #ffffff;
  cursor: pointer;
  transition: all 0.15s;
  border: 0.5px solid rgba(255, 255, 255, 0.2);
  flex-shrink: 0;
  font-weight: 300;
  line-height: 1;
  -webkit-tap-highlight-color: transparent;
  z-index: 10;
}

.ad-close:active {
  background: rgba(0, 0, 0, 0.7);
  transform: scale(0.9);
}

/* 页码指示器（可选） */
.ad-pager {
  position: absolute;
  bottom: 8px;
  left: 8px;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  color: white;
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 40px;
  font-weight: 500;
  z-index: 10;
  border: 0.5px solid rgba(255, 255, 255, 0.2);
}

/* ---------- 显示逻辑：手机 + iPad (≤1024px) ---------- */
@media screen and (max-width: 1024px) {
  .bottom-float-ad {
    display: block;
  }
}

/* 小屏微调（保持左右铺满，无间隔） */
@media (max-width: 380px) {
  .ad-card {
    margin: 0;                 /* 覆盖原有外边距，确保铺满 */
    width: 100%;
  }
  .ad-close {
    width: 28px;
    height: 28px;
    font-size: 18px;
    top: 6px;
    right: 6px;
  }
  .ad-pager {
    font-size: 10px;
    padding: 2px 8px;
    bottom: 6px;
    left: 6px;
  }
}

/* 横屏时适当控制最大高度（避免图片过高） */
@media (orientation: landscape) {
  .ad-image {
    max-height: 120px;
    object-fit: contain;
  }
}