/* ===== 横幅轮播样式 — Swiper 驱动 + 3D 移动端效果 ===== */

/* ---------- 通用容器 ---------- */
#banner-container {
  position: relative;
  width: 100%;
  overflow: hidden;
}

/* Swiper 容器 */
#banner-container .swiper {
  width: 100%;
  position: relative;
  overflow: hidden;
  list-style: none;
  padding: 0;
  margin: 0;
  z-index: 1;
}

/* 幻灯片 */
#banner-container .swiper-slide {
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #0ea5e9, #38bdf8);
  text-align: center;
  font-size: 18px;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%;
}

#banner-container .swiper-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.banner-slide-link {
  display: block;
  text-decoration: none;
  color: inherit;
  width: 100%;
  height: 100%;
}

/* 文字叠加层 */
#banner-container .banner-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 24px 32px;
  z-index: 5;
  background: linear-gradient(transparent, rgba(0,0,0,0.55));
}

#banner-container .banner-title {
  color: #fff;
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 4px 0;
  text-shadow: 0 1px 4px rgba(0,0,0,0.3);
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#banner-container .banner-subtitle {
  color: rgba(255,255,255,0.85);
  font-size: 0.9rem;
  margin: 0;
  text-shadow: 0 1px 3px rgba(0,0,0,0.2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Swiper 分页器（圆点） */
#banner-container .swiper-pagination {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  width: auto;
  z-index: 10;
}

#banner-container .swiper-pagination-bullet {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255,255,255,0.5);
  border: 2px solid rgba(255,255,255,0.8);
  cursor: pointer;
  transition: all 0.3s ease;
  opacity: 1;
}

#banner-container .swiper-pagination-bullet-active {
  background: #fff;
  width: 28px;
  border-radius: 5px;
  border-color: #fff;
}

/* Swiper 导航箭头 */
#banner-container .swiper-button-prev,
#banner-container .swiper-button-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255,255,255,0.3);
  color: #fff;
  z-index: 10;
  opacity: 0;
  transition: opacity 0.3s ease, background 0.3s ease;
}

#banner-container:hover .swiper-button-prev,
#banner-container:hover .swiper-button-next {
  opacity: 1;
}

#banner-container .swiper-button-prev:hover,
#banner-container .swiper-button-next:hover {
  background: rgba(255,255,255,0.35);
}

#banner-container .swiper-button-prev::after,
#banner-container .swiper-button-next::after {
  font-size: 16px;
}

#banner-container .swiper-button-prev { left: 16px; }
#banner-container .swiper-button-next { right: 16px; }


/* =========================================================
   风格 1：首页 Hero — PC端
   ========================================================= */
.banner-hero {
  height: 320px;
  width: 100%;
  margin-top: 0;
  margin-bottom: 0;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.banner-hero .banner-title {
  font-size: 1.75rem;
}

.banner-hero .banner-subtitle {
  font-size: 1rem;
}

.banner-hero .swiper-pagination-bullet {
  background: rgba(255,255,255,0.5);
  border-color: rgba(255,255,255,0.8);
}

.banner-hero .swiper-pagination-bullet-active {
  background: #fff;
  border-color: #fff;
}

/* =========================================================
   风格 2：资源服务 — PC端卡片式
   ========================================================= */
.banner-card {
  height: 220px;
  margin-top: 16px;
  border-radius: 16px;
  box-shadow: 0 8px 30px rgba(22, 119, 255, 0.08);
  background: linear-gradient(135deg, #f0f7ff 0%, #e8f4fd 100%);
  border: 1px solid rgba(22, 119, 255, 0.1);
}

.banner-card .swiper-slide {
  border-radius: 16px;
  overflow: hidden;
}

.banner-card .banner-overlay {
  background: linear-gradient(transparent 30%, rgba(0,0,0,0.45));
  border-radius: 0 0 16px 16px;
  padding: 20px 28px;
}

.banner-card .banner-title {
  font-size: 1.3rem;
  font-weight: 600;
}

.banner-card .swiper-pagination-bullet {
  background: rgba(22, 119, 255, 0.25);
  border-color: rgba(22, 119, 255, 0.4);
}

.banner-card .swiper-pagination-bullet-active {
  background: #1677ff;
  border-color: #1677ff;
}

.banner-card .swiper-button-prev,
.banner-card .swiper-button-next {
  background: rgba(22, 119, 255, 0.12);
  border-color: rgba(22, 119, 255, 0.2);
  color: #1677ff;
}

/* =========================================================
   风格 3：活动中心 — PC端渐变背景
   ========================================================= */
.banner-gradient {
  height: 240px;
  margin-top: 16px;
  border-radius: 14px;
  position: relative;
  background: linear-gradient(135deg, #fff7ed, #fef3c7, #ecfdf5, #ede9fe);
  background-size: 300% 300%;
  animation: gradientShift 8s ease infinite;
  padding: 3px;
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.banner-gradient .swiper-slide {
  border-radius: 12px;
  overflow: hidden;
}

.banner-gradient .banner-overlay {
  background: linear-gradient(transparent 40%, rgba(0,0,0,0.5));
  border-radius: 0 0 12px 12px;
  padding: 20px 28px;
}

.banner-gradient .banner-title {
  font-size: 1.35rem;
  font-weight: 700;
}

.banner-gradient .swiper-pagination-bullet {
  background: rgba(251, 191, 36, 0.4);
  border-color: rgba(251, 191, 36, 0.6);
}

.banner-gradient .swiper-pagination-bullet-active {
  background: #f59e0b;
  border-color: #f59e0b;
}

.banner-gradient .swiper-button-prev,
.banner-gradient .swiper-button-next {
  background: rgba(251, 191, 36, 0.15);
  border-color: rgba(251, 191, 36, 0.3);
  color: #d97706;
}


/* =========================================================
   空状态（无横幅时不显示）
   ========================================================= */
.banner-empty {
  display: none;
}

/* 横幅容器初始状态：不占空间 */
#banner-container[style*="display:none"],
#banner-container[style*="display: none"] {
  height: 0;
  overflow: hidden;
  margin: 0;
  border: none;
  box-shadow: none;
}

/* 移动端：底部导航不需要顶部间距 */
@media (max-width: 1023px) {
  #navbar-spacer { height: 0 !important; }
}


/* =========================================================
   PC端响应式 (769px+)
   ========================================================= */
@media (min-width: 769px) {
  .banner-hero { height: 320px; }
  .banner-card { height: 220px; }
  .banner-gradient { height: 240px; }

  /* Swiper 容器需要继承父容器高度 */
  #banner-container .swiper {
    height: 100%;
  }
}

/* =========================================================
   平板端响应式 (769px - 1024px)
   ========================================================= */
@media (min-width: 769px) and (max-width: 1024px) {
  .banner-hero { height: 260px; }
  .banner-card { height: 190px; }
  .banner-gradient { height: 200px; }
}


/* =========================================================
   移动端 3D Coverflow 效果 — 非首页 Hero 页面使用
   ========================================================= */
@media (max-width: 768px) {
  /* 隐藏PC端样式 */
  #banner-container.banner-hero {
    height: auto !important;
    min-height: 200px;
    max-height: 260px;
    border-radius: 0;
    margin: 0;
    box-shadow: none;
    background: transparent;
    overflow: visible;
  }

  /* Swiper 容器 */
  #banner-container .swiper {
    width: 100%;
    height: 220px;
    padding: 10px 0 40px 0;
    overflow: visible;
  }

  /* 3D Coverflow 幻灯片 */
  #banner-container .swiper-slide {
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    transition: transform 0.5s ease, box-shadow 0.5s ease;
    background: #fff;
    width: 85%;
    max-width: 340px;
  }

  #banner-container .swiper-slide-active {
    box-shadow: 0 16px 48px rgba(14, 165, 233, 0.25);
  }

  #banner-container .swiper-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 16px;
  }

  /* 移动端文字叠加层 — 增强可读性 */
  #banner-container .banner-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px 16px 14px;
    background: linear-gradient(rgba(0,0,0,0) 0%, rgba(0,0,0,0.5) 35%, rgba(0,0,0,0.78) 100%);
    border-radius: 0 0 16px 16px;
    z-index: 5;
  }

  #banner-container .banner-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #fff;
    margin: 0 0 4px 0;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5), 0 0 8px rgba(0,0,0,0.2);
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  #banner-container .banner-subtitle {
    font-size: 0.78rem;
    font-weight: 500;
    color: rgba(255,255,255,0.92);
    margin: 0;
    text-shadow: 0 1px 3px rgba(0,0,0,0.45), 0 0 6px rgba(0,0,0,0.15);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    letter-spacing: 0.02em;
  }

  /* 移动端分页器 */
  #banner-container .swiper-pagination {
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
  }

  #banner-container .swiper-pagination-bullet {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,0.45);
    border: 1.5px solid rgba(255,255,255,0.7);
    opacity: 1;
    transition: all 0.3s ease;
  }

  #banner-container .swiper-pagination-bullet-active {
    background: #fff;
    width: 22px;
    border-radius: 4px;
    border-color: #fff;
  }

  /* 移动端箭头 — 隐藏 */
  #banner-container .swiper-button-prev,
  #banner-container .swiper-button-next {
    display: none !important;
  }

  /* 其他页面横幅样式 */
  #banner-container.banner-card {
    height: auto !important;
    min-height: 160px;
    max-height: 200px;
    border-radius: 12px;
    margin: 12px 16px;
    box-shadow: 0 4px 16px rgba(22, 119, 255, 0.1);
  }

  #banner-container.banner-card .swiper {
    height: 170px;
  }

  #banner-container.banner-card .swiper-slide {
    border-radius: 12px;
    width: 88%;
  }

  #banner-container.banner-card .banner-title {
    font-size: 0.95rem;
  }

  #banner-container.banner-gradient {
    height: auto !important;
    min-height: 170px;
    max-height: 210px;
    border-radius: 12px;
    margin: 12px 16px;
    background: linear-gradient(135deg, #fff7ed, #fef3c7, #ecfdf5, #ede9fe);
    background-size: 300% 300%;
    padding: 3px;
  }

  #banner-container.banner-gradient .swiper {
    height: 180px;
  }

  #banner-container.banner-gradient .swiper-slide {
    border-radius: 10px;
    width: 88%;
  }

  #banner-container.banner-gradient .banner-title {
    font-size: 0.95rem;
  }
}


/* =========================================================
   移动端 3D 折扇（Fan-fold）— 首页 Hero 专用
   段间无缝拼接，折扇式左右摇摆，完整展示2:1长图
   ========================================================= */
@media (max-width: 768px) {
  #banner-container.banner-ribbon-mode {
    height: auto !important;
    min-height: 200px;
    max-height: 280px;
    border-radius: 0;
    margin: 0;
    box-shadow: none;
    background: transparent;
    overflow: visible;
    padding: 16px 0 10px;
    perspective: 800px;
    perspective-origin: 50% 50%;
    touch-action: pan-y;
    -webkit-user-select: none;
    user-select: none;
    position: relative;
  }

  /* 底部光晕 */
  #banner-container.banner-ribbon-mode::after {
    content: '';
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 70%;
    height: 40px;
    background: radial-gradient(ellipse, rgba(56,189,248,0.10) 0%, transparent 70%);
    filter: blur(12px);
    pointer-events: none;
    z-index: 0;
  }

  /* 折带容器 — 折扇风格：段间紧密拼接 */
  .ribbon-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    transform-style: preserve-3d;
    transform: rotateX(4deg) rotateY(0deg);
    transition: transform 0.5s cubic-bezier(0.23,1,0.32,1);
    z-index: 1;
    /* 微弱底部阴影增强立体感 */
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.12));
  }

  /* 自动旋转动画 — 缓慢左右摇摆 */
  #banner-container.banner-ribbon-mode .ribbon-wrap {
    animation: ribbonRock 8s ease-in-out infinite;
  }

  #banner-container.banner-ribbon-mode.ribbon-user-control .ribbon-wrap {
    animation: none !important;
    transition: transform 0.35s cubic-bezier(0.23,1,0.32,1);
  }

  @keyframes ribbonRock {
    0%, 100% { transform: rotateX(4deg)  rotateY(-12deg); }
    25%       { transform: rotateX(5deg)  rotateY(2deg); }
    50%       { transform: rotateX(4deg)  rotateY(12deg); }
    75%       { transform: rotateX(3deg)  rotateY(2deg); }
  }

  /* 折带段 — 无缝拼接 */
  .ribbon-seg {
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
    transform-style: preserve-3d;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    will-change: transform;
    background-repeat: no-repeat;
    background-size: var(--ribbon-tw) auto;
    background-position: var(--ribbon-bgx) center;
    /* 负 margin 补偿旋转间隙 — 实现折扇紧密拼接 */
    margin-right: -3px;
  }

  /* 折叠阴影 — 内折面（暗） */
  .ribbon-seg.seg-fold-in::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 2;
    background: linear-gradient(105deg,
      rgba(0,0,0,0.35) 0%, rgba(0,0,0,0.12) 18%, transparent 45%);
  }

  /* 折叠高光 — 外折面（亮） */
  .ribbon-seg.seg-fold-out::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 2;
    background: linear-gradient(255deg,
      rgba(255,255,255,0.18) 0%, rgba(255,255,255,0.06) 18%, transparent 45%);
  }

  /* 折痕线 — 段间连接处的细微光线 */
  .ribbon-seg::before {
    content: '';
    position: absolute;
    right: -1px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom,
      rgba(56,189,248,0.3), rgba(56,189,248,0.1), transparent 70%);
    z-index: 3;
    box-shadow: 0 0 4px rgba(56,189,248,0.15);
  }
  .ribbon-seg:last-child::before {
    display: none;
  }

  /* 链接覆盖层 */
  .ribbon-link {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: block;
  }

  /* 标题叠加层 */
  .ribbon-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 18px 14px 10px;
    background: linear-gradient(rgba(0,0,0,0) 0%, rgba(0,0,0,0.55) 50%, rgba(0,0,0,0.75) 100%);
    z-index: 4;
    pointer-events: none;
  }

  .ribbon-title {
    font-size: 0.92rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 1px 4px rgba(0,0,0,0.7), 0 0 12px rgba(0,0,0,0.3);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
  }

  .ribbon-subtitle {
    font-size: 0.68rem;
    color: rgba(255,255,255,0.82);
    margin-top: 3px;
    text-shadow: 0 1px 3px rgba(0,0,0,0.6);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: 0.02em;
  }

  /* 分页圆点 */
  .ribbon-dots {
    display: flex;
    justify-content: center;
    gap: 7px;
    margin-top: 16px;
    position: relative;
    z-index: 5;
  }

  .ribbon-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255,255,255,0.25);
    border: 1px solid rgba(255,255,255,0.4);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.23,1,0.32,1);
  }

  .ribbon-dot.active {
    background: #38bdf8;
    border-color: #38bdf8;
    width: 24px;
    border-radius: 3px;
    box-shadow: 0 0 8px rgba(56,189,248,0.5);
  }
}

/* 小屏适配 */
@media (max-width: 360px) and (max-width: 768px) {
  .ribbon-title { font-size: 0.82rem; }
  .ribbon-subtitle { font-size: 0.6rem; }
  .ribbon-overlay { padding: 14px 10px 8px; }
}


/* =========================================================
   移动端横屏优化
   ========================================================= */
@media (max-width: 1024px) and (orientation: landscape) {
  #banner-container .swiper {
    height: 160px;
    padding: 6px 0 36px 0;
  }

  #banner-container .swiper-slide {
    border-radius: 12px;
    width: 70%;
    max-width: 280px;
  }

  #banner-container .banner-title {
    font-size: 0.85rem;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
  }

  #banner-container .banner-subtitle {
    font-size: 0.65rem;
    text-shadow: 0 1px 2px rgba(0,0,0,0.4);
  }

  #banner-container .banner-overlay {
    padding: 10px 14px;
  }
}
