:root {
  --bg: #0e0f13;
  --surface: #16181f;
  --surface-2: #1e2129;
  --text: #e8e9ee;
  --muted: #9aa0ad;
  --accent: #7c8cff;
  --border: #2a2e39;
  --gap: 14px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", "Microsoft YaHei", sans-serif;
  padding: 0 clamp(14px, 4vw, 48px) 64px;
}

.site-header { padding: 40px 0 8px; }
.site-header h1 { margin: 0; font-size: clamp(24px, 5vw, 40px); letter-spacing: .5px; }
.tagline { margin: 6px 0 0; color: var(--muted); }

/* 相册筛选 */
.albums {
  position: sticky; top: 0; z-index: 5;
  display: flex; flex-wrap: wrap; gap: 8px;
  padding: 16px 0; margin-bottom: 4px;
  background: linear-gradient(var(--bg) 70%, transparent);
}
.pill {
  border: 1px solid var(--border); background: var(--surface);
  color: var(--muted); padding: 6px 14px; border-radius: 999px;
  cursor: pointer; font-size: 14px; white-space: nowrap;
  transition: color .15s, border-color .15s, background .15s;
}
.pill:hover { color: var(--text); border-color: var(--accent); }
.pill[aria-pressed="true"] { color: #fff; background: var(--accent); border-color: var(--accent); }

/* 瀑布流网格：CSS 多列，无需 JS 计算 */
.grid { column-gap: var(--gap); columns: 5 220px; }
.card {
  break-inside: avoid; margin-bottom: var(--gap);
  border-radius: 12px; overflow: hidden; background: var(--surface);
  border: 1px solid var(--border); cursor: zoom-in; display: block;
  transition: transform .18s ease, border-color .18s ease;
}
.card:hover { transform: translateY(-3px); border-color: var(--accent); }
.card img { display: block; width: 100%; height: auto; background: var(--surface-2); }
.card .cap {
  padding: 8px 10px; font-size: 12px; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.empty { color: var(--muted); text-align: center; padding: 60px 0; }
.empty code { background: var(--surface-2); padding: 2px 6px; border-radius: 5px; }
.site-footer { color: var(--muted); font-size: 13px; padding-top: 28px; }

/* 灯箱 */
.lightbox {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(6, 7, 10, .94);
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(4px);
}
.lb-stage { margin: 0; max-width: 94vw; max-height: 92vh; text-align: center; }
.lb-stage img {
  max-width: 94vw; max-height: 84vh; width: auto; height: auto;
  border-radius: 8px; box-shadow: 0 12px 48px rgba(0,0,0,.5);
}
#lbCap { color: var(--muted); margin-top: 12px; font-size: 14px; }
.lb-btn {
  position: absolute; background: rgba(255,255,255,.08); color: #fff;
  border: none; cursor: pointer; border-radius: 50%;
  width: 48px; height: 48px; font-size: 24px; line-height: 1;
  display: grid; place-items: center; transition: background .15s;
}
.lb-btn:hover { background: rgba(255,255,255,.18); }
.lb-close { top: 18px; right: 18px; }
.lb-prev { left: 18px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 18px; top: 50%; transform: translateY(-50%); }

@media (max-width: 600px) {
  .grid { columns: 2 140px; }
  .lb-prev { left: 8px; } .lb-next { right: 8px; }
  .lb-btn { width: 42px; height: 42px; }
}
@media (prefers-reduced-motion: reduce) {
  .card, .lb-btn { transition: none; }
}
