* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Arial, sans-serif;
  background: linear-gradient(135deg, #f0f2f5, #e3e6ea);
  color: #2c3e50;
}

.container {
  max-width: 95vw;
  margin: 0 auto;
  padding: 20px;
}

h1 {
  text-align: center;
  margin-bottom: 30px;
  font-size: 2.8em;
  color: #2c3e50;
}

.timeline {
  position: relative;
  padding-left: 40px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 15px;
  top: 0;
  bottom: 0;
  width: 6px;
  background: #3498db;
  border-radius: 3px;
}

.month-marker {
  position: relative;
  margin: 40px 0; /* 上下间距 */
  padding-left: 20px;
  padding-bottom: 50px; /* 使用 padding-bottom 代替 margin-bottom */
}

.month-marker h2 {
  font-size: 1.6em;
  color: #fff;
  background: #3498db;
  padding: 10px 20px;
  border-radius: 25px;
  display: inline-block;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 400px));
  gap: 50px;
  margin-top: 0; /* 避免默认外边距 */
  margin-bottom: 50px;
  justify-content: space-evenly;
}

.photo-item {
  overflow: hidden;
  border-radius: 8px;
  cursor: pointer;
  max-width: 400px;
  justify-self: center;
}

.photo-item img {
  width: 100%;
  max-width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
}

.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  min-height: 100vh;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
}

.modal-content {
  max-width: 90%;
  max-height: 80vh;
  margin: auto;
  display: block;
  object-fit: contain;
  box-sizing: border-box;
}

.modal-close {
  position: absolute;
  top: 20px;
  right: 30px;
  color: #fff;
  font-size: 2em;
  cursor: pointer;
}

@media (max-width: 768px) {
  .container {
    padding: 10px;
  }
  .timeline {
    padding-left: 30px;
  }
  .timeline::before {
    left: 10px;
  }
  .photo-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 400px));
    gap: 30px;
    margin-bottom: 40px;
  }
  .month-marker {
    margin: 30px 0;
    padding-bottom: 30px; /* 移动端调整 */
  }
  .month-marker h2 {
    font-size: 1.4em;
    padding: 8px 16px;
  }
}