/* ==========================================
   基础重置样式（Reset）
   清除浏览器默认边距，防止各浏览器显示不一致
   ========================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box; /* 保证元素的宽度包含内边距和边框 */
}

body {
  font-family: "Microsoft YaHei", Arial, sans-serif;
  background: linear-gradient(135deg, #eef5f0 0%, #faf8f5 50%, #f6f3ed 100%);
  background-attachment: fixed; /* 固定渐变底色，滚动时保持稳定 */
  color: #333333; /* 文字主色 */
  line-height: 1.6;
}

/* 链接基础样式 */
a {
  text-decoration: none;
  color: inherit;
}

/* 列表基础样式 */
ul, li {
  list-style: none;
}

/* ==========================================
   公共头部导航栏（Flex 布局）
   ========================================== */
.header {
  background-color: #ffffff;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05); /* 底部细阴影 */
  position: sticky; /* 粘性定位，固定在顶部 */
  top: 0;
  z-index: 100;
}

.nav-bar {
  max-width: 1200px;
  margin: 0 auto;
  padding: 15px 20px;
  display: flex;
  justify-content: space-between; /* 左右两端分布 */
  align-items: center; /* 垂直居中 */
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.3rem;
  font-weight: bold;
  color: #2d6c46; /* 主色：森林绿 */
}

/* 后代选择器控制塞罕坝松树Logo图片 */
.logo img {
  width: 32px;
  height: 32px;
}

.nav-list {
  display: flex;
  gap: 30px; /* 菜单项之间的距离 */
}

/* 导航链接基本样式与 Hover 效果 */
.nav-link {
  font-size: 1rem;
  font-weight: bold;
  padding: 5px 0;
}

.nav-link:hover,
.nav-link.active {
  color: #2d6c46; /* 悬浮或激活时变绿 */
  text-decoration: underline; /* 鼠标悬停时直接显示底划线 */
}

/* ==========================================
   公共页脚样式
   ========================================== */
.footer {
  background-color: #2d6c46;
  color: #eaf5ee;
  text-align: center;
  padding: 30px 20px;
  margin-top: 60px;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
}

.footer p {
  font-size: 0.9rem;
  margin-bottom: 5px;
}

/* ==========================================
   通用按钮与工具类
   ========================================== */
.btn {
  display: inline-block;
  background-color: #2d6c46;
  color: #ffffff;
  padding: 10px 24px;
  border-radius: 20px; /* 圆角按钮 */
  border: none;
  font-size: 1rem;
  cursor: pointer;
}

.btn:hover {
  background-color: #1e4b30; /* 悬停时颜色变深 */
}



/* ==========================================
   首页 (index.html) 样式
   ========================================== */
/* 大图海报区 */
.hero {
  height: 450px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  color: #ffffff;
  padding: 20px;
}

/* 首页大背景 */
.index-hero {
  background: linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.4)), url('../images/gif2.gif') no-repeat center center/cover;
}

/* 过去大背景 */
.history-hero {
  background: linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.4)), url('../images/gif1.gif') no-repeat center center/cover;
}

/* 现在大背景 */
.science-hero {
  background: linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.4)), url('../images/gif3.gif') no-repeat center center/cover;
}

.hero h1 {
  font-size: 2.8rem;
  margin-bottom: 15px;
}

.hero p {
  font-size: 1.1rem;
  margin-bottom: 25px;
  max-width: 600px;
}

/* 故事介绍区 */
.story-box {
  max-width: 1200px;
  margin: 60px auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 40px;
}

/* 后代选择器直接控制图片宽度和圆角 */
.story-box img {
  flex: 1;
  width: 50%;
  max-width: 50%;
  border-radius: 10px;
  transition: transform 0.3s ease; /* 平滑过渡效果 */
}

/* 鼠标悬停放大 1.03 倍 */
.story-box img:hover {
  transform: scale(1.03);
}

.story-content {
  flex: 1;
}

.story-content h2 {
  font-size: 2rem;
  color: #2d6c46;
  margin-bottom: 15px;
}

.story-content p {
  margin-bottom: 15px;
  color: #555555;
}

/* 塞罕坝生态卡片展示流 */
.gallery-section {
  max-width: 1200px;
  margin: 60px auto;
  padding: 0 20px;
}

.gallery-section h2 {
  text-align: center;
  font-size: 2rem;
  color: #2d6c46;
  margin-bottom: 30px;
}

.card-box {
  display: flex;
  flex-wrap: wrap; /* 允许卡片自动换行 */
  justify-content: center; /* 居中分布，防止换行时过度松散 */
  gap: 30px; /* 固定间距 */
}

.card-item {
  background: linear-gradient(180deg, #ffffff 0%, #fcfbf9 100%);
  border: 1px solid #e2ece6; /* 绿灰边框 */
  border-radius: 12px;
  overflow: hidden;
  width: calc((100% - 60px) / 3); /* 三列精确比例，扣除 gap */
  min-width: 200px; /* 调小最小宽度，确保在 768px~900px 之间依然稳固并排 */
  box-shadow: 0 4px 15px rgba(45, 108, 70, 0.04); /* 微绿阴影 */
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease; /* 过渡动效 */
}

.index-card {
  width: calc((100% - 30px) / 2);
  min-width: 280px;
}

.card-item:hover {
  transform: translateY(-5px); /* 上浮 5 像素 */
  box-shadow: 0 8px 25px rgba(45, 108, 70, 0.1); /* 投影变重 */
  border-color: #2d6c46; /* 悬浮时边框变主色绿 */
}

.card-item img {
  width: 100%;
  height: 220px;
  object-fit: cover;
}

.card-info {
  padding: 15px;
}

.card-info h3 {
  font-size: 1.1rem;
  margin-bottom: 8px;
}

.card-info p {
  color: #666666;
  font-size: 0.9rem;
  margin-bottom: 15px;
}

/* ==========================================
   生态数据表格样式
   ========================================== */
.info-table {
  width: 100%;
  border-collapse: collapse; /* 边框合并为单线 */
  margin-bottom: 25px;
}

.info-table th, .info-table td {
  padding: 10px 12px;
  text-align: left;
  border: 1px solid #dddddd; /* 使用普通网格线 */
}

.info-table th {
  background-color: #eaf5ee; /* 森林绿浅底色表头 */
  color: #2d6c46;
  font-weight: bold;
}

/* ==========================================
   响应式媒体查询 (自适应宽度调整)
   ========================================== */
@media (max-width: 768px) {
  /* 导航栏变为垂直排列 */
  .nav-bar {
    flex-direction: column;
    gap: 15px;
  }
  
  .nav-list {
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 8px;
    width: 100%;
  }

  .nav-link {
    font-size: 0.95rem;
  }

  .hero h1 {
    font-size: 1.55rem;
    line-height: 1.25;
    width: 100%;
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  .hero p {
    width: 100%;
    max-width: 100%;
    overflow-wrap: anywhere;
  }
  
  /* 首页介绍区折行 */
  .story-box {
    flex-direction: column !important;
    gap: 20px;
  }

  .story-box img {
    width: 100%;
    max-width: 100%;
    flex: none;
  }

  .story-content h2,
  .gallery-section h2,
  .card-info h3 {
    overflow-wrap: anywhere;
  }

  .story-content h2,
  .gallery-section h2 {
    font-size: 1.7rem;
    line-height: 1.3;
  }

  /* 首页卡片修改为单列铺满 */
  .card-item {
    width: 100%;
    min-width: 0;
  }
}
