/* ============================================================
   Photo Album — 极简黑白瀑布流
   ============================================================ */
* { margin: 0; padding: 0; box-sizing: border-box; }

html { -webkit-tap-highlight-color: transparent; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI",
               "PingFang SC", "Microsoft YaHei", "Helvetica Neue",
               Helvetica, Arial, sans-serif;
  background: #fff;
  color: #1a1a1a;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Header ---------- */
.header {
  text-align: center;
  padding: 60px 40px 40px;
}
.logo {
  font-size: 2.4rem;
  font-weight: 300;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #111;
}
.subtitle {
  margin-top: 12px;
  font-size: 0.95rem;
  color: #999;
  letter-spacing: 0.2em;
}

/* ---------- Gallery: CSS Columns 瀑布流 ---------- */
.gallery {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px 40px;
  column-count: 4;
  column-gap: 20px;
}

.gallery-item {
  break-inside: avoid;
  margin-bottom: 20px;
  overflow: hidden;
  cursor: pointer;
  background: #f4f4f4;
  border-radius: 2px;
  line-height: 0;
}

.gallery-item img {
  display: block;
  width: 100%;
  height: auto;
  /* 淡入动画在图片加载完成后由 JS 触发 */
  opacity: 0;
  transition: opacity 0.5s ease;
}

.gallery-item img.visible {
  opacity: 1;
}

.gallery-item:hover img {
  transform: scale(1.03);
  transition: transform 0.4s ease;
}

/* ---------- Empty ---------- */
.empty-state {
  column-span: all;
  text-align: center;
  padding: 100px 20px;
  color: #bbb;
  line-height: 1.8;
}

/* ---------- Footer ---------- */
.footer {
  text-align: center;
  padding: 40px 20px 60px;
  border-top: 1px solid #eee;
}
.footer-text {
  font-size: 0.8rem;
  color: #ccc;
  letter-spacing: 0.1em;
}

/* ============================================================
   Lightbox
   ============================================================ */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.lightbox.active {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-bg {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.94);
  cursor: pointer;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 24px;
  z-index: 10;
  width: 44px;
  height: 44px;
  border: none;
  background: transparent;
  color: #fff;
  font-size: 28px;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.2s;
  line-height: 44px;
  text-align: center;
}
.lightbox-close:hover { opacity: 1; }

.lightbox-img-wrap {
  position: relative;
  z-index: 5;
}

.lightbox-img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 2px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  user-select: none;
  -webkit-user-drag: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.lightbox-img.show { opacity: 1; }

.lightbox-nav {
  position: absolute;
  top: 50%;
  z-index: 10;
  transform: translateY(-50%);
  width: 56px;
  height: 56px;
  border: none;
  background: transparent;
  color: #fff;
  font-size: 48px;
  cursor: pointer;
  opacity: 0.4;
  transition: opacity 0.2s;
  line-height: 56px;
  text-align: center;
  font-weight: 200;
}
.lightbox-nav:hover { opacity: 1; }
.lightbox-prev { left: 12px; }
.lightbox-next { right: 12px; }

.lightbox-counter {
  position: absolute;
  bottom: 28px;
  left: 50%;
  z-index: 10;
  transform: translateX(-50%);
  color: rgba(255,255,255,0.55);
  font-size: 0.85rem;
  letter-spacing: 0.15em;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1024px) {
  .gallery { column-count: 3; column-gap: 16px; padding: 0 16px 36px; }
  .gallery-item { margin-bottom: 16px; }
  .logo { font-size: 2rem; }
}

@media (max-width: 640px) {
  .gallery { column-count: 2; column-gap: 10px; padding: 0 10px 32px; }
  .gallery-item { margin-bottom: 10px; }
  .header { padding: 40px 20px 28px; }
  .logo { font-size: 1.6rem; }
  .subtitle { font-size: 0.85rem; }
  .lightbox-close { top: 12px; right: 16px; }
  .lightbox-prev { left: 2px; }
  .lightbox-next { right: 2px; }
  .lightbox-nav { width: 42px; height: 42px; font-size: 36px; line-height: 42px; }
  .lightbox-counter { bottom: 18px; font-size: 0.75rem; }
}

@media (max-width: 380px) {
  .gallery { column-count: 2; column-gap: 8px; padding: 0 8px 28px; }
  .gallery-item { margin-bottom: 8px; }
}
