/* 页面整体 */
html, body {
  margin: 0;
  padding: 0;
  height: 100%; /* ✅ 保证 footer 能贴底 */
  font-family: Arial, sans-serif;
  background-color: #f9f9f9;
  color: #333;
  display: flex;
  flex-direction: column;
}

/* 主体内容区域 */
main {
  flex: 1; /* ✅ 自动撑开，footer 固定在底部 */
}

/* Hero 区域 */
.hero {
  text-align: center;
  padding: 40px 20px;
}

.hero h1 {
  font-size: 2.5em;
  margin-bottom: 30px;
  color: #003366; /* 深蓝色呼应航运主题 */
}

/* 分类选项条 */
.gallery-categories {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 15px;
  padding: 20px;
  background-color: #f0f4f8;
  border-bottom: 2px solid #ddd;
  text-align: center;
  margin: 60px 0 20px 0; /* ✅ 改：手机不会被顶上去 */
}

.gallery-categories button {
  padding: 10px 18px;
  border: none;
  border-radius: 20px;
  background-color: #003366;
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.gallery-categories button:hover {
  background-color: #0055aa;
}

.gallery-categories button.active {
  background-color: #ff9933; /* 高亮选中 */
}

/* 相册网格布局 */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr); /* ✅ 固定 3 列 */
  gap: 15px;
  padding: 0 20px 40px;
  max-width: 1200px;
  margin: 0 auto;
}

/* 相册图片样式 */
.gallery-grid img {
  width: 100%;
  height: 200px;        /* ✅ 统一高度 */
  object-fit: cover;    /* ✅ 保持清晰，裁剪填充 */
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
  display: block;
}

.gallery-grid img:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 15px rgba(0,0,0,0.2);
}

/* 页脚 */
footer {
  text-align: center;
  padding: 20px;
  background-color: #003366;
  color: #fff;
  font-size: 0.9em;
  line-height: 1.5;
  margin-top: auto; /* ✅ 保持在最底部 */
}

/* Gallery item 默认显示（修改） */
.gallery-item {
  display: block;
}

/* ===================== 响应式 ===================== */
@media (max-width: 900px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  /* 手机端 Hero 和按钮下移 */
  .hero {
    padding-top: 100px; /* ✅ 避免被 header 顶住 */
  }

  .gallery-categories {
    margin-top: 20px; /* ✅ 手机按钮不会被挤压 */
  }

  .gallery-categories button {
    font-size: 0.9rem;
    padding: 6px 10px;
  }

  .hero h1 {
    font-size: 2em;
  }
}

@media (max-width: 600px) {
  .gallery-grid {
    grid-template-columns: repeat(1, 1fr);
  }
}

@media (max-width: 480px) {
  .gallery-categories {
    margin-top: 15px;
  }

  .gallery-categories button {
    font-size: 0.8rem;
    padding: 5px 8px;
  }

  .hero h1 {
    font-size: 1.8em;
  }
}