/* gallery.css */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 20px;
  margin: 20px 0;
}

.gallery-item {
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 3px 10px rgba(0,0,0,0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  background: white;
  cursor: pointer;
}

.gallery-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.gallery-item img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  display: block;
}

.caption {
  padding: 12px 10px;
  background: white;
  font-size: 14px;
  color: #333;
  text-align: center;
  border-top: 1px solid #f0f0f0;
  min-height: 20px;
  transition: background-color 0.2s ease;
}

.gallery-item:hover .caption {
  background-color: #f8f9fa;
}

/* 模态框样式 */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.75);
  animation: fadeIn 0.3s;
  overflow: auto;
}

.modal-content-container {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100%;
  padding: 40px 20px;
}

.modal-content {
  max-width: 90%;
  max-height: 80vh;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
  object-fit: contain;
}

.close {
  position: fixed;
  top: 20px;
  right: 35px;
  color: #f1f1f1;
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
  transition: color 0.3s;
  z-index: 1001;
}

.close:hover {
  color: #bbb;
}

@keyframes fadeIn {
  from {opacity: 0;}
  to {opacity: 1;}
}

/* 大图描述样式 */
.modal-caption {
  margin-top: 15px;
  text-align: center;
  color: white;
  font-size: 16px;
  padding: 10px 15px;
  background: rgba(0,0,0,0.6);
  border-radius: 4px;
  max-width: 80%;
}