/* 全局重置 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Microsoft YaHei", Arial, sans-serif;
}

/* 页面主体 */
body {
  background-color: #f5f7fa;
  color: #333;
  line-height: 1.6;
  background: url('images/bg.jpg') no-repeat fixed center/cover;
}

/* 导航栏 */
nav {
  background: rgba(44, 62, 80, 0.95);
  padding: 1rem;
  position: sticky;
  top: 0;
  z-index: 999;
}
nav ul {
  display: flex;
  list-style: none;
  gap: 2rem;
  justify-content: center;
}
nav a {
  color: white;
  text-decoration: none;
  font-size: 1.1rem;
  transition: color 0.3s;
}
nav a:hover {
  color: #3498db;
}

/* 容器居中 */
.container {
  width: 90%;
  max-width: 1100px;
  margin: 20px auto;
  padding: 2rem;
  background: rgba(255, 255, 255, 0.93);
  border-radius: 15px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
  overflow: hidden;
}

/* 标题 */
h1, h2 {
  color: #2c3e50;
  margin-bottom: 1rem;
}

/* 卡片布局 */
.card {
  padding: 1.5rem;
  margin: 1rem 0;
  border-left: 4px solid #3498db;
  background: #f8f9fa;
  border-radius: 8px;
}

/* 爱好列表 */
.hobby-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

/* 瀑布流摄影网格（核心：保留原始尺寸，不裁剪） */
.photo-grid {
  column-count: 3; /* 桌面端3列 */
  column-gap: 1.5rem;
  margin-top: 1rem;
}
.photo-grid img {
  width: 100%;
  height: auto; /* 高度随图片自然变化，不固定 */
  display: block;
  margin-bottom: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 3px 8px rgba(0,0,0,0.15);
  transition: transform 0.3s ease;
  break-inside: avoid; /* 防止图片被列分割 */
}
.photo-grid img:hover {
  transform: scale(1.03);
}

/* 响应式适配 */
@media (max-width: 900px) {
  .photo-grid {
    column-count: 2; /* 平板端2列 */
  }
}
@media (max-width: 600px) {
  nav ul {
    flex-direction: column;
    text-align: center;
    gap: 0.8rem;
  }
  .container {
    padding: 1rem;
  }
  .photo-grid {
    column-count: 1; /* 手机端单列 */
  }
}