/* 评论区：轻量、无依赖、可离线工作。
   数据层目前用 localStorage，后端就绪后只需替换 STORE 里的四个方法即可。 */
.comments {
  margin: 48px 0 0;
  padding: 24px 0 0;
  border-top: 1px solid var(--border);
}
.comments h2 { margin-top: 0; }
.comments .cm-count { color: var(--muted); font-weight: 400; font-size: 0.8em; }
.cm-form { margin: 18px 0 8px; }
.cm-form input[type="text"],
.cm-form textarea {
  width: 100%;
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 10px;
  resize: vertical;
}
.cm-form textarea { min-height: 92px; }
.cm-form input:focus, .cm-form textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.cm-form .row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.cm-form .hint { color: var(--muted); font-size: 0.8em; }
.cm-submit {
  font: inherit;
  font-weight: 500;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  border-radius: 10px;
  padding: 8px 20px;
  cursor: pointer;
}
.cm-submit:hover { opacity: .9; }
.cm-submit:disabled { opacity: .5; cursor: default; }

.cm-list { margin: 22px 0 0; padding: 0; list-style: none; }
.cm-item {
  display: flex;
  gap: 12px;
  padding: 16px 0;
  border-top: 1px solid var(--border);
}
.cm-item:first-child { border-top: 0; }
.cm-avatar {
  flex: 0 0 38px;
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-weight: 500;
  font-size: 15px;
  user-select: none;
}
.cm-body { flex: 1 1 auto; min-width: 0; }
.cm-meta {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  margin-bottom: 4px;
}
.cm-name { font-weight: 500; }
.cm-time { color: var(--muted); font-size: 0.78em; }
.cm-text { margin: 0; white-space: pre-wrap; word-break: break-word; }
.cm-actions { margin-top: 6px; }
.cm-actions button {
  font: inherit; font-size: 0.8em;
  border: 0; background: none; color: var(--muted);
  cursor: pointer; padding: 0;
}
.cm-actions button:hover { color: var(--accent); text-decoration: underline; }
.cm-replies {
  margin: 12px 0 0;
  padding: 0 0 0 14px;
  list-style: none;
  border-left: 2px solid var(--border);
}
.cm-empty { color: var(--muted); padding: 14px 0; }
.cm-note {
  margin-top: 18px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--muted);
  font-size: 0.82em;
}
.cm-replybox { margin-top: 10px; }
.cm-replybox textarea { min-height: 64px; }

/* 窄屏：头像与内容上下排，避免正文被压窄 */
@media (max-width: 560px) {
  .cm-avatar { flex-basis: 32px; width: 32px; height: 32px; font-size: 13px; }
  .cm-item { gap: 10px; }
}
