:root {
  --bg: #0c0c0e;
  --fg: #e8e6e3;
  --muted: #8a8880;
  --accent: #d4b06a;
  --card: #161618;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: "PingFang SC", "Microsoft YaHei", -apple-system, "Segoe UI", sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---------- 头部 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 28px 20px 18px;
  background: linear-gradient(to bottom, rgba(12,12,14,.96) 70%, rgba(12,12,14,0));
}

.logo {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: 12px;
  text-indent: 12px; /* 平衡字距 */
  color: var(--fg);
}

.nav { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }

.nav-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 15px;
  padding: 8px 18px;
  cursor: pointer;
  border-radius: 999px;
  transition: color .2s, background .2s;
}

.nav-btn:hover { color: var(--fg); }
.nav-btn.active { color: var(--bg); background: var(--accent); }

/* ---------- 瀑布流 ---------- */
main { flex: 1; padding: 8px 16px 40px; }

.masonry {
  columns: 4 260px;
  column-gap: 14px;
  max-width: 1600px;
  margin: 0 auto;
}

.card {
  break-inside: avoid;
  margin-bottom: 14px;
  position: relative;
  cursor: pointer;
  border-radius: 6px;
  overflow: hidden;
  background: var(--card);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .5s ease, transform .5s ease;
}

.card.visible { opacity: 1; transform: none; }

.card img {
  display: block;
  width: 100%;
  height: auto;
  transition: transform .4s ease, filter .4s ease;
}

.card:hover img { transform: scale(1.03); filter: brightness(1.08); }

.card-title {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 24px 12px 10px;
  font-size: 13px;
  color: #fff;
  background: linear-gradient(to top, rgba(0,0,0,.65), transparent);
  opacity: 0;
  transition: opacity .3s;
}

.card:hover .card-title { opacity: 1; }

.empty { text-align: center; color: var(--muted); padding: 80px 0; }

/* ---------- 灯箱 ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(6,6,8,.96);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 30px 60px;
}

.lightbox[hidden] { display: none; }

.lb-stage {
  max-width: calc(100vw - 160px);
  max-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.lb-stage img {
  max-width: 100%;
  max-height: calc(100vh - 120px);
  object-fit: contain;
  box-shadow: 0 20px 60px rgba(0,0,0,.6);
}

.lb-meta { color: var(--muted); font-size: 13px; text-align: center; }
.lb-meta .exif { color: var(--accent); margin-left: 10px; }

.lb-close {
  position: absolute;
  top: 18px; right: 22px;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 26px;
  cursor: pointer;
}
.lb-close:hover { color: #fff; }

.lb-arrow {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 56px;
  line-height: 1;
  cursor: pointer;
  padding: 10px 16px;
  user-select: none;
}
.lb-arrow:hover { color: #fff; }

/* ---------- 页脚 ---------- */
.site-footer {
  text-align: center;
  color: #555;
  font-size: 12px;
  padding: 24px 0 30px;
}

/* ---------- 移动端 ---------- */
@media (max-width: 640px) {
  .masonry { columns: 2 140px; column-gap: 8px; }
  .card { margin-bottom: 8px; }
  .lightbox { padding: 16px 8px; gap: 0; }
  .lb-stage { max-width: 100vw; }
  .lb-arrow { position: absolute; bottom: 10px; font-size: 40px; }
  .lb-prev { left: 10px; }
  .lb-next { right: 10px; }
  .lb-stage img { max-height: calc(100vh - 140px); }
}
