/* =========================================================
   星环设计 - 首页轮播大图 + 站长轮播管理页样式
   变量全部取自 common.css，明亮/暗色自动适配
   ========================================================= */

/* ---------- 首页轮播 ---------- */
.banner-carousel {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  margin-bottom: 16px;
  background: var(--bg-card);
  box-shadow: var(--shadow-lg);
  /* 🔴 必须显式写 width: 100%：块级元素只给 aspect-ratio + max-height 时，
     Chrome 会「按比例把宽度也缩掉」来满足 max-height（1366x768 实测掉到 1018px、右边留白 162px）。
     写死 100% 后宽度永远铺满容器，高度才由 max-height 单独收。 */
  width: 100%;
  aspect-ratio: 16 / 7;   /* 整宽大图比例 */
  /* 高度上限：宽屏放行到 540px（原来死卡 400px，容器加宽到 1180 后图被裁得很扁、显得小），
     同时用 58vh 兜住矮屏/小笔记本，免得一张图吃掉半屏。
     1920/1440 上实际生效的是 16:7 → 约 516px；1366x768 这类矮屏收在 ~445px；手机走 16:10。 */
  max-height: min(58vh, 540px);
}

.banner-track {
  display: flex;
  height: 100%;
  transition: transform 0.55s cubic-bezier(0.4, 0, 0.2, 1);
}

.banner-slide { flex: 0 0 100%; height: 100%; }

.banner-slide img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;      /* 裁切填满，不拉伸变形 */
  background: var(--bg-hover);
}

/* 左右箭头：平时半透明，鼠标移上去变清楚 */
.banner-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.32);
  color: #fff;
  font-size: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  opacity: 0;
  transition: opacity 0.25s, background 0.2s;
}
.banner-carousel:hover .banner-arrow { opacity: 1; }
.banner-arrow:hover { background: rgba(0, 0, 0, 0.6); }
.banner-arrow:active { transform: translateY(-50%) scale(0.94); }
.banner-prev { left: 12px; }
.banner-next { right: 12px; }

/* 触摸设备没有 hover，箭头常显 */
@media (hover: none) {
  .banner-arrow { opacity: 0.8; }
}

/* 底部圆点：当前页变长条 */
.banner-dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 10px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  z-index: 2;
}
.banner-dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.6);
  box-shadow: 0 0 3px rgba(0, 0, 0, 0.45);
  transition: width 0.25s, background 0.25s;
}
.banner-dot.active { width: 20px; border-radius: 4px; background: #fff; }

/* 窄屏：比例更高一点，箭头缩小 */
@media (max-width: 640px) {
  .banner-carousel { aspect-ratio: 16 / 10; border-radius: 12px; }
  .banner-arrow { width: 34px; height: 34px; font-size: 14px; }
  .banner-prev { left: 8px; }
  .banner-next { right: 8px; }
}

/* ---------- 站长：轮播图管理页 ---------- */
.banner-pick-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

/* 待上传预览 */
.banner-pending {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
  margin: 10px 0;
}
.banner-pending-item {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.banner-pending-item img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 7;
  object-fit: cover;
}

/* 已上传列表 */
.banner-admin-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin-top: 12px;
}
.banner-admin-item {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-card);
}
.banner-admin-item img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 7;
  object-fit: cover;
  background: var(--bg-hover);
}
.banner-admin-ops {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px;
  border-top: 1px solid var(--border);
}
.banner-admin-ops .order-tip {
  margin-left: auto;
  font-size: 12px;
  color: var(--text-2);
}
.banner-admin-empty { color: var(--text-2); font-size: 13px; padding: 10px 0; }

/* 小按钮（管理页上移/下移/删除） */
.banner-mini-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  font-size: 13px;
  color: var(--text-2);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: color 0.2s, border-color 0.2s;
}
.banner-mini-btn:hover { color: var(--primary); border-color: var(--primary); }
.banner-mini-btn.c-del:hover { color: var(--danger); border-color: var(--danger); }
.banner-mini-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.banner-hint { font-size: 13px; color: var(--text-2); line-height: 1.7; }
