/* ========================================
   2026年世界献血者日 - 主样式文件
   ======================================== */

/* --- 覆盖 CMS head.css 的 min-width:1200px，允许手机端响应式生效 --- */
html, body {
  min-width: 0 !important;
}

/* --- 基础重置 --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  min-height: 100vh;
  font-family: "Microsoft YaHei", "微软雅黑", "PingFang SC", Arial, sans-serif;
  background: url('../images/bg.png') center top / cover repeat-y;
  color: #333;
}

a {
  text-decoration: none;
  color: inherit;
}

/* ========================================
   顶部 Banner 区域
   ======================================== */
.site-banner {
  width: 100%;
  height: 780px;
  background: transparent;
  position: relative;
  overflow: hidden;
  display: block;
  padding: 0;
}

/* 头部背景图片铺满 */
.banner-bg-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
  z-index: 0;
}

.site-banner::before {
  content: none;
}

.banner-text {
  text-align: center;
  position: relative;
  z-index: 2;
}

.banner-text h1 {
  font-size: 3rem;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 2px 12px rgba(0,0,0,0.4);
  letter-spacing: 4px;
  line-height: 1.2;
}

.banner-text h1 span {
  color: #ffd700;
}

.banner-text p {
  font-size: 1.2rem;
  color: rgba(255,255,255,0.88);
  margin-top: 12px;
  letter-spacing: 2px;
}

/* ========================================
   通用容器
   ======================================== */
.section-wrapper {
  max-width: 1100px;
  margin: 0 auto;
  padding: 50px 20px;
}

/* 防止三个 section 在手机端横向溢出 */
.swiper-section,
.video-section,
.news-section {
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
}

/* ========================================
   第一部分：Swiper 图片轮播
   ======================================== */
.swiper-section {
  background: url('../images/picbgs.png') center bottom / auto no-repeat;
  padding: 40px 0 20px;
  margin-top: -280px;
  position: relative;
  z-index: 1;
}

.swiper-section .section-wrapper {
  max-width: 1200px;
  padding-top: 0;
  padding-bottom: 0;
}

/* 轮播容器 */
.swiper-scroll-container {
  position: relative;
  padding: 30px 70px;
}

.swiper-scroll-container::before,
.swiper-scroll-container::after {
  content: none;
}

/* Swiper 主体 — 固定宽度 3×280 + 2×24 间距 = 888px，居中 */
.swiper-main {
  overflow: hidden;
  border-radius: 6px;
  width: 888px;
  max-width: 100%;
  margin: 0 auto;
}

/* track：每次移动一整"组"(3张) */
.swiper-track {
  display: flex;
  align-items: flex-start;
  transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  will-change: transform;
}

/* 每张图片固定 280×505，间距 24px */
.swiper-slide {
  width: 280px;
  height: 505px;
  flex-shrink: 0;
  margin-right: 24px;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 6px 24px rgba(0,0,0,0.40);
  background: #1a0000;
}

.swiper-slide:last-child {
  margin-right: 0;
}

.swiper-slide img {
  width: 280px;
  height: 505px;
  object-fit: cover;
  display: block;
  background: linear-gradient(135deg, #c0392b 0%, #e8733a 100%);
}

/* 左右导航按钮 — 居于图片视觉中心 */
.swiper-btn {
  position: absolute;
  top: calc(30px + 252px); /* padding-top + 图片高度一半 */
  transform: translateY(-50%);
  width: 56px;
  height: 56px;
  background: none;
  border: none;
  border-radius: 0;
  padding: 0;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  outline: none;
  user-select: none;
  transition: transform 0.2s, opacity 0.2s;
}

.swiper-btn img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  pointer-events: none;
}

.swiper-btn:hover {
  transform: translateY(-50%) scale(1.12);
  opacity: 0.85;
}

.swiper-btn-prev {
  left: 12px;
}

.swiper-btn-next {
  right: 12px;
}

/* 分页点 */
.swiper-dots {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 16px;
}

.swiper-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255,255,255,0.45);
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
  border: none;
  outline: none;
}

.swiper-dot.active {
  background: #ffd700;
  transform: scale(1.3);
}

/* ========================================
   第二部分：视频切换区域
   ======================================== */
.video-section {
  padding: 10px 0 50px;
}

.video-scroll-container {
  position: relative;
  background: linear-gradient(180deg, #7b1a1a 0%, #a83232 15%, #c94040 50%, #a83232 85%, #7b1a1a 100%);
  border-radius: 12px;
  padding: 28px 80px;
  box-shadow: 0 8px 40px rgba(100,0,0,0.45), inset 0 2px 8px rgba(255,200,180,0.15);
}

.video-scroll-container::before,
.video-scroll-container::after {
  content: "";
  position: absolute;
  left: -10px;
  right: -10px;
  height: 28px;
  background: linear-gradient(180deg, #8b2020 0%, #c44 40%, #8b2020 100%);
  border-radius: 14px;
  box-shadow: 0 4px 12px rgba(80,0,0,0.5);
  z-index: 3;
}

.video-scroll-container::before {
  top: -8px;
}

.video-scroll-container::after {
  bottom: -8px;
}

/* 视频播放器框架 */
.video-frame {
  position: relative;
  width: 100%;
  background: #111;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 6px 30px rgba(0,0,0,0.6);
  border: 3px solid #333;
  aspect-ratio: 16 / 9;
}

.video-slide {
  display: none;
  width: 100%;
  height: 100%;
}

.video-slide.active {
  display: block;
}

.video-slide video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* 视频占位图 */
.video-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  min-height: 380px;
  cursor: pointer;
}

.video-placeholder img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  inset: 0;
  border-radius: 6px;
}

.video-play-btn {
  width: 70px;
  height: 70px;
  background: rgba(255,255,255,0.88);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 5;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  transition: transform 0.2s;
}

.video-play-btn:hover {
  transform: scale(1.12);
}

.video-play-btn::after {
  content: "";
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 16px 0 16px 28px;
  border-color: transparent transparent transparent #c0392b;
  margin-left: 5px;
}

/* 视频左右按钮 */
.video-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 56px;
  height: 56px;
  background: none;
  border: none;
  border-radius: 0;
  padding: 0;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  outline: none;
  user-select: none;
  transition: transform 0.2s, opacity 0.2s;
}

.video-btn img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  pointer-events: none;
}

.video-btn:hover {
  transform: translateY(-50%) scale(1.12);
  opacity: 0.85;
}

.video-btn-prev {
  left: 14px;
}

.video-btn-next {
  right: 14px;
}

/* 视频底部导航点 */
.video-nav {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-top: 20px;
}

.video-nav-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255,255,255,0.4);
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
  border: 2px solid rgba(255,255,255,0.6);
  outline: none;
}

.video-nav-dot.active {
  background: #ffd700;
  border-color: #ffd700;
  transform: scale(1.35);
}

/* ========================================
   第三部分：文字列表区域
   ======================================== */
.news-section {
  padding: 10px 0 60px;
  background: url('../images/xwbg.png') center center / auto no-repeat;
}

.news-section .section-wrapper {
  max-width: 1200px;
}

.news-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  grid-template-rows: auto auto; /* 两行等高，内容自然撑高 */
  align-items: stretch;
}

.news-card {
  background: rgba(255,255,255,0.92);
  border: 2px solid #f0c0a0;
  border-radius: 8px;
  padding: 24px 26px;
  cursor: pointer;
  transition: background 0.25s, border-color 0.25s, transform 0.2s, box-shadow 0.25s;
  box-shadow: 0 2px 12px rgba(180,60,0,0.10);
  overflow: hidden;
}

.news-card:hover {
  background: linear-gradient(135deg, #fff0e0 0%, #ffd8b0 100%);
  border-color: #e05a20;
  transform: translateY(-3px);
  box-shadow: 0 8px 28px rgba(180,60,0,0.22);
}

.news-card .news-title {
  font-size: 22px;
  font-weight: 700;
  color: #a0320a;
  margin-bottom: 12px;
  line-height: 1.5;
  transition: color 0.25s;
}

.news-card:hover .news-title {
  color: #c0392b;
}

.news-card .news-summary {
  font-size: 18px;
  color: #555;
  line-height: 1.75;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 第一张卡片特殊高亮（橙色调） */
.news-card--highlight {
  background: linear-gradient(135deg, #fff8e8 0%, #ffedd0 100%);
  border-color: #e06010;
}

.news-card--highlight .news-title {
  color: #c0390a;
}

.news-card--highlight:hover {
  background: linear-gradient(135deg, #ffecd0 0%, #ffcf90 100%);
  border-color: #c0390a;
}

/* 更多链接 */
.news-more {
  text-align: right;
  margin-top: 18px;
}

.news-more a {
  font-size: 0.9rem;
  color: #c0392b;
  font-weight: 600;
  transition: color 0.2s;
}

.news-more a:hover {
  color: #8b0000;
}

/* ========================================
   底部 Footer
   ======================================== */
.site-footer {
  background: #2c2c2c;
  color: #aaa;
  padding: 28px 20px;
  text-align: center;
  font-size: 0.82rem;
  line-height: 2;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.footer-links a {
  color: #bbb;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: #fff;
}

.footer-info {
  display: flex;
  justify-content: center;
  gap: 30px;
  flex-wrap: wrap;
  margin-top: 8px;
  font-size: 0.8rem;
  color: #888;
}

/* ========================================
   响应式适配
   ======================================== */
/* ========================================
   响应式适配
   ======================================== */

/* 平板 ≤ 1024px */
@media (max-width: 1024px) {
  .swiper-section .section-wrapper,
  .video-section .section-wrapper,
  .news-section .section-wrapper {
    max-width: 100%;
    padding-left: 16px;
    padding-right: 16px;
  }

  /* 轮播：三张缩放适配 */
  .swiper-main {
    width: 100%;
  }

  .swiper-slide {
    width: calc((100vw - 32px - 140px) / 3 - 16px);
    height: auto;
    aspect-ratio: 280 / 505;
  }

  .swiper-slide img {
    width: 100%;
    height: 100%;
  }
}

/* 手机 ≤ 768px */
@media (max-width: 768px) {
  /* 手机端隐藏本地预览用底部（CMS线上有自己的底部） */
  .site-footer {
    display: none;
  }

  /* 头部：让图片完整显示，自然撑开高度 */
  .site-banner {
    height: auto;
    min-height: unset;
  }

  .banner-bg-img {
    position: static;
    width: 100%;
    height: auto;
    object-fit: unset;
  }

  /* 第一部分取消负margin，正常流排列 */
  .swiper-section {
    margin-top: 0;
    padding: 24px 0 16px;
    background-size: 100% auto;
    background-position: center bottom;
  }

  .swiper-section .section-wrapper,
  .video-section .section-wrapper,
  .news-section .section-wrapper {
    max-width: 100%;
    padding-left: 12px;
    padding-right: 12px;
  }

  /* 轮播：单张展示，高度适中 */
  .swiper-main {
    width: 100%;
  }

  .swiper-slide {
    width: calc(100vw - 24px - 96px);
    height: auto;
    aspect-ratio: 280 / 380;  /* 手机端比桌面端矮一些 */
    margin-right: 12px;
  }

  .swiper-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .swiper-scroll-container {
    padding: 16px 48px;
  }

  .swiper-btn {
    width: 36px;
    height: 36px;
    top: 50%;
  }

  .swiper-btn-prev { left: 4px; }
  .swiper-btn-next { right: 4px; }

  /* 视频区 */
  .video-scroll-container {
    padding: 20px 44px;
  }

  .video-btn {
    width: 36px;
    height: 36px;
  }

  .video-btn-prev { left: 4px; }
  .video-btn-next { right: 4px; }

  .video-placeholder {
    min-height: 200px;
  }

  /* 新闻列表：单列 */
  .news-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .news-section {
    background-size: cover;
  }

  /* Footer */
  .footer-links {
    gap: 12px;
  }

  .footer-info {
    flex-direction: column;
    gap: 4px;
  }
}

/* 小屏手机 ≤ 480px */
@media (max-width: 480px) {
  .swiper-scroll-container {
    padding: 12px 40px;
  }

  .swiper-slide {
    width: calc(100vw - 16px - 80px);
  }

  .news-card {
    padding: 14px 16px;
  }

  .news-card .news-title {
    font-size: 0.95rem;
  }

  .news-card .news-summary {
    font-size: 0.82rem;
  }
}

