/* ============================================================
   广告轮播组件（页面头部）—— 单张轮播
   图片在可视区内横向、纵向都居中，且完整显示（不裁切）
   配置见 js/carousel.js 顶部 MYRAG_ADS
   ============================================================ */
.ad-carousel {
  position: relative;
  max-width: 1200px;
  width: 100%;
  margin: 16px auto 0;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 6px 20px rgba(20, 80, 180, 0.12);
  background: #fff;
  /* 页面为 flex 布局时：独占整行，置于最上方 */
  flex: 0 0 100%;
  box-sizing: border-box;
}

.ad-track {
  display: flex;
  align-items: center;           /* 轨道内垂直居中 */
  transition: transform 0.5s ease;
}

/* 每次显示一张；给图片一个稳定的可视区，图片在内部横纵居中 */
.ad-slide {
  flex: 0 0 100%;
  width: 100%;
  height: clamp(150px, 26vh, 260px);   /* 随窗口自适应，控制在 260px 内，避免喧宾夺主 */
  display: flex;
  align-items: center;                 /* 垂直居中 */
  justify-content: center;             /* 水平居中 */
  overflow: hidden;
  background: #f6f8fb;
  text-decoration: none;
  position: relative;
}
.ad-slide img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;                 /* 完整显示，不裁切 */
  object-position: center center;      /* 横纵居中 */
  display: block;
}

/* 无真实图片时的占位样式 */
.ad-placeholder {
  width: 100%;
  height: 100%;
  min-height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.95);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 2px;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
}

/* 左右箭头 */
.ad-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.75);
  color: #334155;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.25s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}
.ad-carousel:hover .ad-arrow { opacity: 1; }
.ad-arrow:hover { background: #fff; color: #1677ff; }
.ad-prev { left: 10px; }
.ad-next { right: 10px; }

/* 指示点 */
.ad-dots {
  position: absolute;
  bottom: 10px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 8px;
  z-index: 2;
}
.ad-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  transition: all 0.25s ease;
}
.ad-dots span.active {
  background: #fff;
  width: 22px;
  border-radius: 6px;
}

/* 单张时不显示箭头/圆点 */
.ad-carousel.single .ad-arrow,
.ad-carousel.single .ad-dots { display: none; }

/* 手机适配 */
@media (max-width: 640px) {
  .ad-carousel { margin: 10px 8px 0; }
  .ad-slide { height: clamp(120px, 22vh, 180px); }
  .ad-placeholder { min-height: 100px; font-size: 15px; }
}
