/* ===== 基础重置 & 全局 ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: #fce4ec;
  color: #4a4a4a;
  min-height: 100vh;
}

/* ===== 无障碍：减少动画 ===== */
@media (prefers-reduced-motion: reduce) {
  .masonry-item,
  .masonry-item .overlay,
  .lightbox .nav {
    transition: none;
  }
  .masonry-item:hover {
    transform: none;
  }
}

/* ===== 头部 ===== */
header {
  text-align: center;
  padding: 48px 20px 24px;
}

header h1 {
  font-size: 28px;
  font-weight: 700;
  color: #d81b60;
  letter-spacing: 2px;
}

header .subtitle {
  font-size: 14px;
  color: #f06292;
  margin-top: 8px;
}

/* ===== 瀑布流（CSS columns） ===== */
.masonry {
  column-count: 1;
  column-gap: 16px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px 48px;
}

@media (min-width: 600px) {
  .masonry { column-count: 2; }
}
@media (min-width: 900px) {
  .masonry { column-count: 3; }
}
@media (min-width: 1200px) {
  .masonry { column-count: 4; }
}

.masonry-item {
  break-inside: avoid;
  margin-bottom: 16px;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 2px 12px rgba(244, 143, 177, 0.15);
  cursor: pointer;
  position: relative;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.masonry-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(244, 143, 177, 0.25);
}

.masonry-item img {
  display: block;
  width: 100%;
  height: auto;
}

/* ===== 悬停遮罩 ===== */
.masonry-item .overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 40px 16px 16px;
  background: linear-gradient(transparent, rgba(216, 27, 96, 0.7));
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.masonry-item:hover .overlay {
  opacity: 1;
}

.masonry-item .overlay .title {
  display: block;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 2px;
}

.masonry-item .overlay .date {
  display: block;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.8);
}

.masonry-item .overlay .desc {
  display: block;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
  margin-top: 4px;
  line-height: 1.3;
}

/* ===== Lightbox ===== */
.lightbox {
  display: none;
  position: fixed;
  z-index: 999;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  justify-content: center;
  align-items: center;
  padding: 40px;
}

.lightbox.active {
  display: flex;
}

.lightbox .close {
  position: absolute;
  top: 20px;
  right: 28px;
  font-size: 32px;
  color: #fff;
  cursor: pointer;
  z-index: 10;
  line-height: 1;
}

.lightbox-content {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 8px;
}

.lightbox .caption {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  text-align: center;
  font-size: 14px;
  background: rgba(0, 0, 0, 0.5);
  padding: 8px 20px;
  border-radius: 20px;
  max-width: 80%;
}

.lightbox .nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 36px;
  color: #fff;
  cursor: pointer;
  padding: 16px;
  user-select: none;
  opacity: 0.7;
  transition: opacity 0.2s;
  line-height: 1;
}

.lightbox .nav:hover { opacity: 1; }
.lightbox .prev { left: 16px; }
.lightbox .next { right: 16px; }

/* ===== 页脚 ===== */
footer {
  text-align: center;
  padding: 24px;
  color: #f06292;
  font-size: 13px;
}
