:root {
  --bg: #f6f7f9;
  --card: #ffffff;
  --text: #1f2328;
  --muted: #6b7280;
  --line: #e5e7eb;
  --accent: #2563eb;
  --danger: #dc2626;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.7 -apple-system, "Segoe UI", "Microsoft YaHei", system-ui, sans-serif;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}
.brand { font-weight: 700; text-decoration: none; color: var(--text); }
.site-header nav a { margin-left: 18px; color: var(--muted); text-decoration: none; }
.site-header nav a:hover { color: var(--accent); }

main { max-width: 760px; margin: 32px auto 64px; padding: 0 20px; }

.post, .comments {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
}
.post h1 { margin: 0 0 6px; font-size: 28px; line-height: 1.35; }
.post .meta { color: var(--muted); font-size: 14px; margin: 0 0 20px; }
.post p { margin: 0 0 14px; }

.comments { margin-top: 24px; }
.comments h2 { font-size: 20px; margin: 0 0 18px; display: flex; align-items: center; gap: 8px; }
.count {
  font-size: 13px;
  background: #eef2ff;
  color: var(--accent);
  padding: 1px 8px;
  border-radius: 999px;
}

.form { display: grid; gap: 12px; }
.form label { display: grid; gap: 6px; font-size: 14px; color: var(--muted); }
.form .row { display: grid; grid-template-columns: 1fr; }

input, textarea {
  width: 100%;
  font: inherit;
  color: var(--text);
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  resize: vertical;
}
input:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
  background: #fff;
}

.form-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.hint { font-size: 13px; color: var(--muted); }

/* 蜜罐字段：移出可视区域，真人看不到，但爬虫会填 */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

button {
  font: inherit;
  cursor: pointer;
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 9px 18px;
  background: var(--accent);
  color: #fff;
  transition: opacity 0.15s;
}
button:hover { opacity: 0.9; }
button:disabled { opacity: 0.55; cursor: not-allowed; }
button.link {
  background: none;
  color: var(--accent);
  border: none;
  padding: 0;
  font-size: 13px;
}
button.more {
  display: block;
  width: 100%;
  margin-top: 16px;
  background: #fff;
  color: var(--accent);
  border: 1px solid var(--line);
}

.error {
  margin: 0;
  color: var(--danger);
  font-size: 14px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: 8px 12px;
}

.reply-to {
  margin: 16px 0 0;
  font-size: 14px;
  color: var(--muted);
  background: #f3f4f6;
  border-radius: 8px;
  padding: 8px 12px;
  display: flex;
  gap: 10px;
  align-items: center;
}

.list { list-style: none; margin: 22px 0 0; padding: 0; display: grid; gap: 18px; }
.comment {
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.comment:first-child { border-top: none; padding-top: 0; }
.comment.is-reply { margin-left: 28px; padding-left: 16px; border-left: 2px solid #e0e7ff; border-top: none; }

.comment-head { display: flex; align-items: center; gap: 8px; }
.avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #e0e7ff;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  display: grid;
  place-items: center;
  flex: none;
}
.name { font-size: 15px; }
.time { font-size: 12px; color: var(--muted); margin-left: auto; }
.comment-body { margin: 8px 0 6px; white-space: pre-wrap; word-break: break-word; }
.comment-actions { display: flex; gap: 14px; }

.replies {
  list-style: none;
  margin: 14px 0 0;
  padding: 0 0 0 16px;
  border-left: 2px solid #e0e7ff;
  display: grid;
  gap: 14px;
}
.replies .comment { padding-top: 0; border-top: none; }

/* 父评论尚未加载的回复：加个标记，避免用户以为它没有上下文 */
.comment.is-orphan::before {
  content: "↳ 回复（原评论在更早的一页）";
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}

.empty { color: var(--muted); text-align: center; margin: 24px 0 0; font-size: 14px; }

.site-footer {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  padding: 24px 0 40px;
}

@media (max-width: 600px) {
  main { margin-top: 16px; }
  .post, .comments { padding: 20px; }
  .post h1 { font-size: 22px; }
  .comment.is-reply { margin-left: 12px; padding-left: 12px; }
}
