/* 与正文白卡片同宽：铺满左栏（fq-min-pleft），不再单独限制 720px 居中 */
.fq-min-article-after section.qc-comment.comments-section,
.fq-min-article-comments section.qc-comment.comments-section {
  max-width: none !important;
  width: 100%;
  margin-left: 0 !important;
  margin-right: 0 !important;
  margin-top: 0 !important;
  box-sizing: border-box;
}

.qc-comment.comments-section {
  --qc-bd: #e2e8f0;
  --qc-bg: #f8fafc;
  width: 100%;
  max-width: none;
  margin: 0;
  background: #ffffff;
  /* 与主题 .fq-min-panel / 正文卡片一致 */
  border-radius: var(--fq-yd-radius, 10px) !important;
  box-shadow: var(--fq-yd-shadow-sm, 0 1px 2px rgba(0, 0, 0, 0.04)) !important;
  border: none !important;
  padding: 24px 28px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  transition: background 0.2s, box-shadow 0.2s;
}

.qc-comment-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* 头部 */
.comments-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 1.5px solid #f0f2f5;
}

.comments-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: #1e2a3a;
  margin: 0;
  letter-spacing: -0.3px;
}

.comment-count {
  font-weight: 500;
  color: #5b6e8c;
  font-size: 1.1rem;
}

.sort-options {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.sort-btn {
  background: transparent;
  border: none;
  padding: 6px 14px;
  font-size: 0.85rem;
  font-weight: 500;
  color: #5a687c;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.sort-btn:hover {
  background: #f1f5f9;
  color: #1e293b;
}

.sort-btn.is-active {
  background: #eef2ff;
  color: #2e7d32;
  font-weight: 600;
}

/* 提示 / 说明 */
.qc-comment-note {
  color: #6c7a91;
  font-size: 0.9rem;
  margin: 0 0 1rem;
  line-height: 1.5;
}

.qc-comment-note a {
  color: #2e7d32;
  font-weight: 600;
}

.qc-flash-success,
.qc-flash-error {
  font-size: 0.875rem;
  padding: 10px 14px;
  border-radius: var(--fq-yd-radius-sm, 6px);
  margin: 0 0 16px;
}

.qc-flash-success {
  background: #e8f5e9;
  color: #1b5e20;
  border: 1px solid #c8e6c9;
}

.qc-flash-error {
  background: #ffebee;
  color: #b71c1c;
  border: 1px solid #ffcdd2;
}

/* 当前用户 */
.current-user {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #f8fafc;
  padding: 12px 18px;
  border-radius: 999px;
  margin-bottom: 24px;
  width: fit-content;
  max-width: 100%;
  border: 1px solid #eef2f6;
  box-sizing: border-box;
}

.user-avatar {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  background: linear-gradient(135deg, #2e7d32, #1b5e20);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 600;
  font-size: 1.1rem;
  box-shadow: 0 2px 6px rgba(46, 125, 50, 0.2);
}

.user-info {
  font-size: 0.9rem;
  min-width: 0;
}

.user-label {
  color: #6c7a91;
}

.username {
  color: #1e2a3a;
  font-weight: 600;
}

/* 表单行（访客） */
.qc-comment-label {
  display: block;
  font-size: 0.8rem;
  color: #5a687c;
  margin: 0.35rem 0 0.2rem;
}

.qc-comment-input,
.qc-comment-textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1.5px solid var(--qc-bd);
  border-radius: var(--fq-yd-radius-sm, 6px);
  padding: 12px 16px;
  font-size: 0.95rem;
  font-family: inherit;
  background: #fff;
  color: #1e2a3a;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.qc-comment-textarea {
  min-height: 5.5rem;
  resize: vertical;
  border-radius: var(--fq-yd-radius, 10px);
  padding: 14px 18px;
}

.qc-comment-textarea:focus {
  border-color: #2e7d32;
  box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.15);
}

.qc-comment-textarea::placeholder {
  color: #9aaebf;
}

.qc-comment-row {
  display: grid;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

@media (min-width: 640px) {
  .qc-comment-row {
    grid-template-columns: 1fr 2fr;
  }
}

.comment-input-area {
  margin-bottom: 8px;
}

.input-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 14px;
}

.submit-btn.qc-comment-btn,
.qc-comment-btn.submit-btn {
  margin-top: 0;
  background: #2e7d32;
  color: #fff;
  border: none;
  padding: 10px 28px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  font-family: inherit;
}

.submit-btn.qc-comment-btn:hover,
.qc-comment-btn.submit-btn:hover {
  background: #1b5e20;
  filter: none;
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(46, 125, 50, 0.25);
}

.submit-btn.qc-comment-btn:active,
.qc-comment-btn.submit-btn:active {
  transform: translateY(1px);
}

/* 回复条 */
.qc-reply-tip {
  margin: 0 0 16px;
  font-size: 0.85rem;
  color: #1b5e20;
  background: #e8f5e9;
  border: 1px solid #c8e6c9;
  padding: 10px 14px;
  border-radius: var(--fq-yd-radius, 10px);
  display: none;
}

.qc-reply-tip strong {
  font-weight: 700;
}

.qc-reply-cancel {
  margin-left: 0.5rem;
  padding: 4px 10px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: #b71c1c;
  font-size: inherit;
  font-family: inherit;
  cursor: pointer;
  font-weight: 600;
}

.qc-reply-cancel:hover {
  background: rgba(183, 28, 28, 0.08);
}

/* 列表与空状态 */
.comments-list {
  margin-top: 8px;
}

.empty-state {
  text-align: center;
  padding: 48px 20px;
  background: #fbfdfe;
  border-radius: var(--fq-yd-radius-sm, 6px);
  border: 1px dashed #dce5ec;
}

.empty-state svg {
  display: block;
  margin: 0 auto 12px;
  opacity: 0.6;
}

.empty-state p {
  color: #7f8e9e;
  font-size: 0.95rem;
  margin: 0;
}

/* 评论线程 */
.qc-cmt {
  padding: 16px 0;
  border-bottom: 1px solid var(--qc-bd);
}

.qc-cmt:last-child {
  border-bottom: none;
}

.qc-cmt-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.qc-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 700;
  background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
  color: #1b5e20;
  flex: 0 0 40px;
  overflow: hidden;
  border: 1px solid #c8e6c9;
}

.qc-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.qc-cmt-main {
  min-width: 0;
  flex: 1 1 auto;
}

.qc-cmt-meta {
  font-size: 0.82rem;
  color: #6c7a91;
  margin: 0 0 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.qc-cmt-body {
  font-size: 0.95rem;
  color: #1e2a3a;
  line-height: 1.7;
  word-break: break-word;
}

.qc-cmt-actions {
  margin: 10px 0 0;
  display: flex;
  gap: 14px;
  align-items: center;
  font-size: 0.82rem;
}

.qc-cmt-actions button {
  border: 0;
  background: transparent;
  padding: 4px 0;
  color: #2e7d32;
  cursor: pointer;
  font-family: inherit;
  font-weight: 500;
}

.qc-cmt-actions button:hover {
  text-decoration: underline;
}

.qc-like-btn {
  position: relative;
  overflow: visible;
}

.qc-like-btn.is-liked {
  color: #c62828;
  font-weight: 700;
}

.qc-like-pop {
  position: absolute;
  left: 50%;
  top: -8px;
  transform: translate(-50%, 0) scale(0.9);
  font-size: 14px;
  line-height: 1;
  color: #e53935;
  pointer-events: none;
  opacity: 0;
  animation: qcLikePop 0.65s ease-out forwards;
}

@keyframes qcLikePop {
  0% {
    opacity: 0;
    transform: translate(-50%, 0) scale(0.9);
  }
  20% {
    opacity: 1;
    transform: translate(-50%, -6px) scale(1.08);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -18px) scale(1);
  }
}

.qc-children {
  margin-top: 12px;
  padding-left: 14px;
  border-left: 2px solid rgba(46, 125, 50, 0.15);
}

.qc-loadmore {
  display: flex;
  justify-content: center;
  margin: 20px 0 0;
}

.qc-loadmore button {
  padding: 10px 24px;
  border-radius: var(--fq-yd-radius, 10px);
  border: 1.5px solid var(--qc-bd);
  background: #fff;
  color: #5a687c;
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s, border-color 0.2s;
}

.qc-loadmore button:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.qc-pager {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin: 20px 0 0;
}

.qc-pager button {
  padding: 8px 18px;
  border-radius: var(--fq-yd-radius, 10px);
  border: 1.5px solid var(--qc-bd);
  background: #fff;
  color: #5a687c;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  font-family: inherit;
}

.qc-pager button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.qc-pager .qc-pager-ind {
  font-size: 0.85rem;
  color: #6c7a91;
  min-width: 4.5rem;
  text-align: center;
}

.qc-link {
  color: #1565a8;
  text-decoration: underline;
}

@media (prefers-color-scheme: dark) {
  .qc-comment.comments-section {
    background: #121826;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3) !important;
    border: 1px solid #2d3748 !important;
  }

  .comments-header {
    border-bottom-color: #2d3748;
  }

  .comments-title {
    color: #eef2ff;
  }

  .comment-count {
    color: #9aaebf;
  }

  .sort-btn {
    color: #9aaebf;
  }

  .sort-btn:hover {
    background: #1f2a36;
    color: #e2e8f0;
  }

  .sort-btn.is-active {
    background: #1e3a2c;
    color: #66bb6a;
  }

  .qc-comment-note {
    color: #9aaebf;
  }

  .qc-comment-note a {
    color: #66bb6a;
  }

  .current-user {
    background: #1a252f;
    border-color: #2d3a44;
  }

  .user-label {
    color: #9aaebf;
  }

  .username {
    color: #eef2ff;
  }

  .qc-comment-label {
    color: #9aaebf;
  }

  .qc-comment-input,
  .qc-comment-textarea {
    background: #0f151c;
    border-color: #2d3a44;
    color: #e2e8f0;
  }

  .qc-comment-textarea:focus {
    border-color: #4caf50;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.2);
  }

  .qc-comment-textarea::placeholder {
    color: #6b7c90;
  }

  .empty-state {
    background: #0f151c;
    border-color: #2d3a44;
  }

  .empty-state p {
    color: #8b9ab0;
  }

  .empty-state svg path {
    stroke: #5a6e88;
  }

  .qc-cmt {
    border-bottom-color: #2d3748;
  }

  .qc-cmt-body {
    color: #e2e8f0;
  }

  .qc-cmt-meta {
    color: #9aaebf;
  }

  .qc-avatar {
    background: #1e3a2c;
    color: #66bb6a;
    border-color: #2d4a3a;
  }

  .qc-reply-tip {
    background: #1e3a2c;
    border-color: #2d4a3a;
    color: #a5d6a7;
  }

  .qc-flash-success {
    background: #1e3a2c;
    color: #a5d6a7;
    border-color: #2d4a3a;
  }

  .qc-flash-error {
    background: #3e2723;
    color: #ffab91;
    border-color: #5d4037;
  }

  .qc-loadmore button,
  .qc-pager button {
    background: #0f151c;
    border-color: #2d3a44;
    color: #9aaebf;
  }

  .qc-loadmore button:hover {
    background: #1a252f;
  }

  .qc-pager .qc-pager-ind {
    color: #9aaebf;
  }
}

@media (max-width: 560px) {
  .fq-min-article-after section.qc-comment.comments-section,
  .fq-min-article-comments section.qc-comment.comments-section {
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  .qc-comment.comments-section {
    padding: 20px;
    margin: 0;
    max-width: none;
  }

  .comments-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .sort-options {
    width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 4px;
    flex-wrap: nowrap;
  }

  .current-user {
    width: 100%;
  }

  .submit-btn.qc-comment-btn,
  .qc-comment-btn.submit-btn {
    width: 100%;
    text-align: center;
  }
}
