:root {
  --bg: #f6f4f0;
  --card: #ffffff;
  --text: #1f1d1a;
  --muted: #6f6a62;
  --accent: #d9572b;
  --accent-soft: #fbe7de;
  --line: #e7e2da;
  --radius: 14px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  -webkit-text-size-adjust: 100%;
}

main {
  max-width: 720px;
  margin: 0 auto;
  padding: 20px 16px calc(32px + env(safe-area-inset-bottom));
}

.top h1 { margin: 8px 0 4px; font-size: 24px; letter-spacing: .02em; }
.top .sub { margin: 0 0 16px; color: var(--muted); font-size: 14px; }

.banner {
  margin: 0 0 16px;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--accent-soft);
  color: #8a3216;
  font-size: 14px;
  line-height: 1.5;
}

.loading, .empty {
  margin: 48px 0;
  text-align: center;
  color: var(--muted);
  line-height: 1.8;
}

.group { margin: 0 0 28px; }
.group-title {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0 0 10px;
  font-size: 18px;
}
.group-title .count { color: var(--muted); font-size: 13px; font-weight: normal; }

.session {
  margin: 0 0 14px;
  padding: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.session-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 13px;
}
.chip {
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  white-space: nowrap;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
@media (min-width: 560px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
}
.thumb {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 10px;
  overflow: hidden;
  background: var(--line);
  cursor: pointer;
}
.thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 3 / 4;
  border-radius: 10px;
  background: repeating-linear-gradient(45deg, #efebe4, #efebe4 10px, #f6f3ee 10px, #f6f3ee 20px);
  color: var(--muted);
  font-size: 13px;
}

/* 全螢幕看照片 */
.viewer {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 9, 8, .96);
  touch-action: pan-y;
}
.viewer[hidden] { display: none; }
.viewer-img {
  max-width: 100%;
  max-height: calc(100% - 140px);
  object-fit: contain;
  -webkit-touch-callout: default;
}
.viewer-close, .viewer-nav {
  position: absolute;
  border: 0;
  background: rgba(255, 255, 255, .12);
  color: #fff;
  border-radius: 999px;
  cursor: pointer;
}
.viewer-close {
  top: calc(12px + env(safe-area-inset-top));
  right: 12px;
  width: 44px;
  height: 44px;
  font-size: 20px;
}
.viewer-nav {
  top: 50%;
  width: 44px;
  height: 64px;
  margin-top: -32px;
  font-size: 32px;
}
.viewer-nav.prev { left: 8px; }
.viewer-nav.next { right: 8px; }
.viewer-nav:disabled { opacity: .2; }
.viewer-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(20px + env(safe-area-inset-bottom));
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
}
.viewer-count { color: #cfc9bf; font-size: 14px; }
.viewer-download {
  padding: 12px 28px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 16px;
  text-decoration: none;
}
.viewer-hint {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: calc(76px + env(safe-area-inset-bottom));
  margin: 0;
  text-align: center;
  color: #cfc9bf;
  font-size: 13px;
}
