body {
  background: #111;
  color: white;
  font-family: Georgia, serif;
  margin: 0;
  padding: 0;
}

header {
  text-align: center;
  padding: 40px 20px 10px;
}

header h1 {
  font-size: 48px;
  margin-bottom: 5px;
}

.subtitle {
  font-size: 18px;
  color: #ccc;
}

.section {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 40px;
  align-items: center;
  justify-content: center; /* ✅ 居中整块内容 */
}

.category {
  width: 90%;
  max-width: 1100px;
  margin: 0 auto;  /* ✅ 整个 category 居中 */
}

.category h2 {
  font-size: 28px;
  margin-bottom: 10px;
  border-bottom: 1px solid #333;
  padding-bottom: 5px;
}

.gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.thumb {
  width: 30%;
  border-radius: 8px;
  box-shadow: 0 0 8px #000;
  transition: transform 0.3s ease;
}

.thumb:hover {
  transform: scale(1.03);
}

.view-more {
  margin-top: 10px;
  text-align: center;
}

.view-more a {
  color: #aaa;
  text-decoration: none;
  font-size: 16px;
}

/* --------------------------------------------------
   ✅ 新增：图片详情页主图自动居中
   规则命中结构：<h1>标题</h1> 后面紧跟的第一张 <img>
   不会影响首页/分类页的缩略图
---------------------------------------------------*/
h1 + img {
  display: block;
  margin: 0 auto;
  max-width: 100%;
  height: auto;
}

/* 可选备用：如果某些页想显式加类名，也会居中
   <img class="main-photo" ...>
*/
.main-photo {
  display: block;
  margin: 0 auto;
  max-width: 100%;
  height: auto;
}
