.jx-comments { margin-top: 20px; }
.jx-comments .card-header { border-bottom: 1px solid var(--border); }

.jx-comment-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.jx-comment-list .children {
  list-style: none;
  margin: 0;
  padding: 12px 0 0 10px;
  border-left: 2px solid var(--border);
  margin-left: 2px;
}
.jx-comment {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  list-style: none;
}
.jx-comment:last-child { border-bottom: none; }
.jx-comment.bypostauthor > .jx-comment-body .jx-comment-author::after {
  content: attr(data-author-badge);
}

.jx-comment-body {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 12px;
  align-items: start;
}
.jx-comment-avatar img {
  width: 40px; height: 40px;
  border-radius: 50%;
  display: block;
}
.jx-comment-main { min-width: 0; }
.jx-comment-head {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: baseline;
  margin-bottom: 6px;
  font-size: 13px;
  color: var(--text-muted);
}
.jx-comment-author { font-weight: 600; color: var(--text); }
.jx-comment-author a { color: inherit; text-decoration: none; }
.jx-comment-author a:hover { color: var(--primary); }
.jx-comment-time a { color: var(--text-muted); text-decoration: none; }
.jx-comment-time a:hover { color: var(--primary); }
.jx-comment-edit a { color: var(--primary); font-size: 12px; text-decoration: none; }

.jx-comment-content {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text);
  word-wrap: break-word;
}
.jx-comment-content p { margin: 0 0 8px; }
.jx-comment-content p:last-child { margin-bottom: 0; }
.jx-comment-content pre {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 10px 12px;
  overflow-x: auto;
  font-size: 12px;
}
.jx-comment-content code {
  background: var(--bg);
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 12px;
}
.jx-comment-content blockquote {
  margin: 8px 0;
  padding: 6px 12px;
  border-left: 3px solid var(--primary);
  background: rgba(59,130,246,.05);
  color: var(--text-muted);
}

.jx-comment-actions {
  margin-top: 8px;
  font-size: 12px;
}
.jx-comment-actions .comment-reply-link {
  color: var(--text-muted);
  text-decoration: none;
  padding: 4px 8px;
  border-radius: 4px;
  transition: background .15s, color .15s;
}
.jx-comment-actions .comment-reply-link:hover {
  color: var(--primary);
  background: rgba(59,130,246,.08);
}

.jx-comment-pending {
  margin: 6px 0;
  padding: 6px 10px;
  background: rgba(245,158,11,.1);
  border-left: 3px solid #f59e0b;
  color: #b45309;
  font-size: 12px;
  border-radius: 3px;
}

.jx-comment-pagination { padding: 16px 20px; }
.jx-comment-closed {
  padding: 16px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  border-top: 1px solid var(--border);
}

/* 评论表单：复用 .reply-box 皮 */
.jx-comments #respond {
  margin: 20px;
}
.jx-comments #reply-title {
  margin: 0 0 12px;
  font-size: 14px;
  color: var(--text);
  display: flex; align-items: center; gap: 8px;
}
.jx-comments #reply-title small { margin-left: auto; font-size: 12px; font-weight: 400; }
.jx-comments #reply-title small a { color: var(--accent-red, #ef4444); text-decoration: none; }

.jx-comments .comment-form.reply-box .comment-form-comment { margin: 0; }
.jx-comments .comment-form.reply-box .comment-form-comment label.screen-reader-text {
  position: absolute; left: -9999px;
}
.jx-comments .comment-form.reply-box textarea { margin: 0; }

.jx-comments .comment-form.reply-box .comment-form-author,
.jx-comments .comment-form.reply-box .comment-form-email,
.jx-comments .comment-form.reply-box .comment-form-url {
  margin: 10px 0 0;
}
.jx-comments .comment-form.reply-box .comment-form-author input,
.jx-comments .comment-form.reply-box .comment-form-email input,
.jx-comments .comment-form.reply-box .comment-form-url input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm, 6px);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  box-sizing: border-box;
}
.jx-comments .comment-form.reply-box .comment-form-author input:focus,
.jx-comments .comment-form.reply-box .comment-form-email input:focus,
.jx-comments .comment-form.reply-box .comment-form-url input:focus {
  border-color: var(--primary);
  outline: none;
}
.jx-comments .comment-form.reply-box label {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.jx-comments .comment-form.reply-box .comment-form-cookies-consent {
  display: flex; gap: 6px; align-items: flex-start;
  font-size: 12px; color: var(--text-muted); margin-top: 10px;
}
.jx-comments .comment-form.reply-box .comment-form-cookies-consent label {
  display: inline; margin: 0;
}
.jx-comments .comment-form.reply-box .form-submit { margin: 0; }
.jx-comments .comment-form.reply-box .form-submit .submit {
  padding: 8px 20px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark, #2563eb));
  color: #fff;
  border: none;
  border-radius: var(--radius-sm, 6px);
  font-weight: 600;
  cursor: pointer;
  font-size: 14px;
}
.jx-comments .comment-form.reply-box .form-submit .submit:hover { filter: brightness(1.05); }
.jx-comments .logged-in-as { font-size: 12px; color: var(--text-muted); margin: 0 0 10px; }
.jx-comments .logged-in-as a { color: var(--primary); text-decoration: none; }

@media (max-width: 900px) {
  .jx-comment { padding: 14px 12px; }
  .jx-comments #respond { margin: 14px 12px; }
  .jx-comments .comment-form.reply-box .comment-form-author input,
  .jx-comments .comment-form.reply-box .comment-form-email input,
  .jx-comments .comment-form.reply-box .comment-form-url input { font-size: 16px; }
  .jx-comment-pagination { padding: 14px 12px; }
  .jx-comment-content { overflow-wrap: anywhere; }
  .jx-comment-content table { display: block; max-width: 100%; overflow-x: auto; }
}
@media (max-width: 600px) {
  /* 深层嵌套时每级缩进都会吃掉正文宽度，窄屏必须压到最小 */
  .jx-comment-list .children { padding-left: 6px; margin-left: 0; }
  .jx-comment-body { grid-template-columns: 32px 1fr; gap: 10px; }
  .jx-comment-avatar img { width: 32px; height: 32px; }
  .jx-comment { padding: 12px 10px; }
  .jx-comments #respond { margin: 12px 10px; }
  .jx-comment-head { gap: 4px 8px; }
}
