:root {
  color-scheme: light dark;
  --bg: #f4f4f2;
  --card: #ffffff;
  --text: #1c1e22;
  --muted: #666c75;
  --line: #dddcd6;
  --accent: #33529e;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14161a;
    --card: #1e2126;
    --text: #e8e9ea;
    --muted: #9aa0a8;
    --line: #33373e;
    --accent: #8fb0ff;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Hiragino Kaku Gothic ProN", "Noto Sans JP", sans-serif;
  line-height: 1.7;
}

.site-header, main, .site-footer {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 16px;
}

.site-header { padding-top: 28px; }
.site-header h1 { font-size: 1.5rem; margin: 0 0 4px; }
.tagline { color: var(--muted); margin: 0 0 8px; font-size: 0.92rem; }

.status { color: var(--muted); font-size: 0.9rem; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 18px;
  margin: 0 0 12px;
}

.card h2 { font-size: 1.08rem; margin: 0 0 6px; line-height: 1.5; }
.card .body { margin: 0 0 10px; white-space: pre-wrap; }

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-items: center;
  color: var(--muted);
  font-size: 0.82rem;
  margin-bottom: 8px;
}

.tier {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 8px;
  font-size: 0.75rem;
}

.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
.tag {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 8px;
  font-size: 0.78rem;
  color: var(--muted);
}

.source a { color: var(--accent); word-break: break-all; }

.comments {
  border-top: 1px solid var(--line);
  margin-top: 12px;
  padding-top: 10px;
}

.comments-title {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0 0 8px;
  font-weight: 600;
}

.comment { margin: 0 0 10px; }
.comment:last-child { margin-bottom: 0; }

.comment-who { margin: 0 0 2px; font-size: 0.85rem; display: flex; align-items: center; gap: 8px; }
.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--line);
  flex: none;
  cursor: pointer;
}

.avatar-popup {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(0, 0, 0, 0.82);
  display: flex;
  align-items: center;
  justify-content: center;
}
.avatar-popup[hidden] { display: none; }
.avatar-popup-figure { margin: 0; padding: 16px; text-align: center; }
.avatar-popup-img {
  width: min(84vw, 440px);
  height: min(84vw, 440px);
  object-fit: cover;
  border-radius: 16px;
}
.avatar-popup-caption { margin-top: 12px; color: #fff; }
.avatar-popup-name { font-weight: 700; font-size: 1.05rem; }
.avatar-popup-role { margin-left: 8px; font-size: 0.85rem; opacity: 0.8; }
.avatar-popup-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  color: #fff;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
}
.comment-name { font-weight: 700; }
.comment-role { color: var(--muted); margin-left: 8px; font-size: 0.78rem; }
.comment-text { margin: 0; font-size: 0.92rem; white-space: pre-wrap; }

.empty {
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 28px 18px;
  text-align: center;
  color: var(--muted);
}

.site-footer {
  color: var(--muted);
  font-size: 0.82rem;
  padding-top: 8px;
  padding-bottom: 32px;
}
