/* 全局样式 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", Arial, sans-serif;
  margin: 0;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  min-height: 100vh;
  color: #333;
}

/* 头部样式 */
header {
  padding: 30px 20px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  text-align: center;
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

h1 {
  margin: 0 0 20px;
  font-size: 36px;
  color: #2c3e50;
  font-weight: 700;
  letter-spacing: 1px;
}

/* 过滤器样式 */
.filters {
  margin-top: 10px;
  display: inline-flex;
  gap: 15px;
  align-items: center;
}

select, button {
  padding: 12px 20px;
  font-size: 16px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  background: white;
  cursor: pointer;
  transition: all 0.3s ease;
}

select {
  min-width: 120px;
}

select:focus, button:focus {
  outline: none;
  border-color: #3498db;
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

button {
  background: linear-gradient(135deg, #3498db, #2980b9);
  color: white;
  border: none;
  font-weight: 500;
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

/* 画廊样式 */
#gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 25px;
  padding: 40px 20px;
  max-width: 1200px;
  margin: 0 auto;
}

#gallery img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 12px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  transition: all 0.4s ease;
  background: linear-gradient(45deg, #f0f0f0, #e0e0e0);
}

#gallery img:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
}

/* 错误信息样式 */
.error-message {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px 20px;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  color: #e74c3c;
  font-size: 18px;
  font-weight: 500;
}

/* 灯箱样式 */
.lightbox {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.95);
  overflow: auto;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.lightbox-content {
  margin: 5% auto;
  display: block;
  max-width: 90%;
  max-height: 80vh;
  border-radius: 8px;
  animation: zoomIn 0.3s ease;
}

@keyframes zoomIn {
  from { transform: scale(0.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.close {
  position: absolute;
  top: 30px;
  right: 40px;
  color: #fff;
  font-size: 48px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  line-height: 1;
}

.close:hover {
  color: #3498db;
  transform: rotate(90deg);
}

#caption {
  text-align: center;
  color: #fff;
  padding: 20px 0;
  font-size: 18px;
  font-weight: 500;
}

/* 响应式设计 */
@media (max-width: 768px) {
  header {
    padding: 20px 15px;
  }
  
  h1 {
    font-size: 28px;
  }
  
  .filters {
    flex-direction: column;
    gap: 10px;
  }
  
  select, button {
    width: 100%;
    max-width: 200px;
  }
  
  #gallery {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 15px;
    padding: 20px 15px;
  }
  
  #gallery img {
    height: 150px;
  }
  
  .lightbox-content {
    margin: 15% auto;
    max-width: 95%;
  }
  
  .close {
    top: 20px;
    right: 25px;
    font-size: 36px;
  }
}

@media (max-width: 480px) {
  #gallery {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  }
  
  #gallery img {
    height: 120px;
  }
}