/* 评论共享模块，只作用于参与本次迭代的评论区域。 */
.community-comments,
.community-scope {
  --community-avatar-size: 48px;
  --community-author-gap: 12px;
  --community-gap-name-content: 8px;
  --community-gap-content-meta: 12px;
}
.community-comments {
  margin-top: 32px;
  --cg-green: #1abc9d;
  --cg-ease: cubic-bezier(0.22, 1, 0.36, 1);
  color: #f5f5f5;
  font-family: "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}
.community-comment-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}
.community-comment-heading h2 {
  color: var(--cg-green);
  font-size: 22px;
  line-height: 32px;
  font-weight: 500;
  margin: 0;
}
.comment-filters {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 6px;
  background: #ffffff06;
  overflow-x: auto;
  white-space: nowrap;
}
.comment-filters button {
  font: inherit;
  color: #bcbaba;
  border: 0;
  background: none;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 16px;
  cursor: pointer;
}
.comment-filters [aria-selected="true"] {
  color: var(--cg-green);
  background: #1abc9d12;
}
.community-comment-form {
  margin-bottom: 32px;
  padding: 20px;
  background: #ffffff0f;
  border-radius: 8px;
}
.community-comment-form textarea {
  display: block;
  width: 100%;
  min-height: 160px;
  resize: vertical;
  padding: 0;
  border: 0;
  background: none;
  color: #eee;
  font-family: inherit;
  font-size: 18px;
  line-height: 30px;
  outline: none;
}
.community-comment-form textarea::placeholder {
  color: #888;
}
.community-editor-actions {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-top: 12px;
}
.community-editor-actions > span {
  font-size: 12px;
  color: #969595;
}
.community-editor-actions [data-comment-counter] {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
}
.community-editor-actions .contribution-primary {
  font-size: 14px;
  min-height: 40px;
  padding: 8px 20px;
}
.community-reply-to {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #1abc9d;
  font-size: 14px;
  margin: 0 0 12px;
}
.community-reply-to button {
  border: 0;
  background: none;
  color: #aaa;
  font: inherit;
  cursor: pointer;
}
.community-thread {
  margin: 0 0 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid #ffffff0a;
}
.community-comment {
  display: flex;
  align-items: flex-start;
  gap: var(--community-author-gap);
}
.community-comment > .avatar {
  width: var(--community-avatar-size);
  height: var(--community-avatar-size);
  border-radius: 50%;
  object-fit: cover;
  flex: 0 0 var(--community-avatar-size);
}
.community-comment-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.community-comment-author {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
  line-height: 22px;
  color: #ddd;
}
.community-comment-content {
  margin: var(--community-gap-name-content) 0 var(--community-gap-content-meta);
  font-size: 14px;
  line-height: 24px;
  color: #ddd;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.comment-mention {
  color: #1abc9d;
}
.comment-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  padding: 0 6px;
  font-size: 11px;
  line-height: 20px;
  vertical-align: baseline;
  white-space: nowrap;
  margin-right: 6px;
  font-weight: 400;
}
.comment-badge.official {
  color: #dec89e;
  background: #75644a55;
}
.comment-badge.pinned {
  color: #dad2bd;
  background: #67625055;
}
.comment-badge.featured {
  color: #f1be79;
  background: #6b4d3055;
}
.community-comment-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 0;
  color: #969595;
  font-size: 12px;
  line-height: 18px;
}
.community-comment-meta time {
  font-variant-numeric: tabular-nums;
}
.community-comment-meta > button,
.comment-like {
  position: relative;
  display: inline-flex;
  gap: 6px;
  align-items: center;
  color: inherit;
  font: inherit;
  border: 0;
  background: none;
  padding: 0;
  cursor: pointer;
}
.comment-like.is-active,
.comment-like[aria-pressed="true"] {
  color: #ff3865;
}
.community-comment-meta > [data-community-reply] {
  color: #bcbaba;
}
.community-replies {
  /* 与父评论主栏左缘对齐 */
  margin: 12px 0 0 calc(var(--community-avatar-size) + var(--community-author-gap));
  padding: 12px;
  background: #ffffff06;
  border-radius: 8px;
}
.community-replies .community-comment {
  --community-avatar-size: 32px;
  --community-author-gap: 8px;
  --community-gap-name-content: 6px;
  --community-gap-content-meta: 8px;
  margin-bottom: 14px;
}
.community-replies .community-comment:last-of-type {
  margin-bottom: 0;
}
.community-replies .community-comment > .avatar {
  width: var(--community-avatar-size);
  height: var(--community-avatar-size);
  flex-basis: var(--community-avatar-size);
}
.community-replies-toggle {
  padding: 6px 0 0;
  margin: 4px 0 0;
  color: #a3afc0;
  font: inherit;
  font-size: 12px;
  border: 0;
  background: none;
  cursor: pointer;
}
.community-comments-empty {
  padding: 32px;
  text-align: center;
  color: #969595;
  font-size: 14px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.community-legacy > .community-comment-heading {
  justify-content: flex-end;
}
.community-legacy .comment-body[hidden] {
  display: none !important;
}
.community-legacy .comment-meta {
  display: flex !important;
  align-items: center;
  gap: 20px;
  margin-top: 12px;
  margin-left: 3.75rem;
  font-size: 18px !important;
}
.community-legacy .comment-reply {
  position: static !important;
  display: inline-flex !important;
  float: none !important;
  margin: 0 !important;
  padding: 0 !important;
  font-size: 18px !important;
}
.community-legacy .comment-reply a {
  margin: 0 !important;
  padding: 0 !important;
  color: #aaa !important;
  background: none !important;
}
.community-legacy .comment-children {
  padding: 20px;
  background: #ffffff06;
  border-radius: 8px;
}
.community-legacy .comment-children .comment-body {
  background: none !important;
}
.community-legacy .comment-content .comment-mention {
  color: #1abc9d;
}
.community-tabs {
  display: flex;
  border-bottom: 1px solid #ffffff14;
  gap: 32px;
  margin: 32px 0 24px;
}
.community-tabs button {
  font: inherit;
  font-size: 18px;
  color: #aaa;
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  padding: 12px 0;
  cursor: pointer;
}
.community-tabs [aria-selected="true"] {
  color: #1abc9d;
  border-bottom-color: #1abc9d;
}
.article-community-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  margin: 24px 0 16px;
  border-bottom: 1px solid #ffffff14;
}
.article-community-toolbar .community-tabs {
  gap: 0;
  margin: 0;
  min-width: 0;
  border-bottom: 0;
}
.article-community-toolbar .community-tabs button {
  padding: 12px 20px;
  white-space: nowrap;
}
.community-comment-total {
  margin-left: 4px;
  color: #f5f5f5;
  font-size: 0.9em;
}
.article-community-toolbar .community-comment-heading {
  display: block;
  margin: 0;
  min-width: 0;
}
.article-community-toolbar .comment-filters {
  height: 100%;
  box-sizing: border-box;
  align-items: center;
}
.article-community-toolbar .comment-filters button {
  padding: 10px 16px;
}
@media (max-width: 959px) {
  .article-community-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
    gap: 0;
    margin: 16px 0;
  }
  .article-community-toolbar .community-tabs button {
    flex: 1;
    padding: 8px 2px;
    font-size: 14px;
  }
  .article-community-toolbar .comment-filters {
    gap: 0;
    padding: 4px 2px;
  }
  .article-community-toolbar .comment-filters button {
    flex: 1;
    padding: 6px 4px;
    font-size: 12px;
  }
}
@media (max-width: 359px) {
  .article-community-toolbar .community-tabs button {
    font-size: 12px;
  }
  .article-community-toolbar .comment-filters button {
    font-size: 11px;
    padding-inline: 2px;
  }
}
.article-community-cta {
  position: relative;
  margin: 16px 0 12px;
}
/* 页码与跳转保持单行，左右翻页按钮保留独立点击区域。 */
#comments .article-comment-pagination:not([hidden]) {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 40px;
  align-items: center;
  gap: 8px;
  height: auto;
  min-height: 40px;
  line-height: 1.4;
  margin: 24px 0;
}
#comments .article-comment-pagination .contribution-page-jump {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;
}
#comments .article-comment-pagination span,
#comments .article-comment-pagination button {
  flex: 0 0 auto;
  white-space: nowrap;
  font-size: 14px;
}
#comments .article-comment-pagination input {
  flex: 0 1 48px;
  box-sizing: border-box;
  width: 48px;
  min-width: 32px;
  min-height: 36px;
  height: 36px;
  margin: 0;
  padding: 0 4px;
  text-align: center;
}
#comments .article-comment-pagination button {
  min-height: 36px;
  height: 36px;
  padding: 0 8px;
}
#comments .article-comment-pagination > button {
  justify-self: center;
  width: 36px;
  padding: 4px;
}
.article-community-cta picture,
.article-community-cta picture img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 16px;
}
.article-community-cta nav {
  display: flex;
  gap: 0;
  position: absolute;
  width: 58%;
  bottom: 0;
  left: 3%;
}
.article-community-cta nav a,
.article-community-cta nav a:last-child {
  display: block;
  flex: 1;
  min-width: 0;
  aspect-ratio: 762 / 279;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: url(/usr/themes/Mirages/images/contribution/comment-cta-request.png) center / contain no-repeat;
  font-size: 0;
  text-decoration: none;
}
.article-community-cta nav a:last-child {
  background-image: url(/usr/themes/Mirages/images/contribution/comment-cta-submit.png);
}
.article-community-cta[data-banner-panel="comments"] nav a {
  background-image: url(/usr/themes/Mirages/images/contribution/comment-cta-post.png);
}
.article-community-cta[data-banner-panel="comments"] nav a:last-child {
  background-image: url(/usr/themes/Mirages/images/contribution/comment-cta-eat.png);
}
.article-community-cta nav a:focus-visible {
  outline: 2px solid #fff;
  outline-offset: -12px;
}
.article-community-cta nav a::after {
  display: none;
}
.community-supplement .contribution-form {
  width: 100%;
}
.community-supplement .form-title {
  color: #eee;
}
.community-supplement .contribution-control {
  box-sizing: border-box;
}
.community-supplement .contribution-form-section input[type="text"] {
  width: 100%;
}
.community-supplement .source-article a {
  font-size: inherit !important;
}
.community-scope [hidden] {
  display: none !important;
}
@media (max-width: 767px) {
  .community-comments {
    margin-top: 24px;
  }
  .community-comment-heading {
    align-items: flex-start;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
  }
  .community-comment-heading h2 {
    font-size: 18px;
    line-height: 28px;
  }
  .comment-filters {
    gap: 0;
  }
  .comment-filters button {
    font-size: 12px;
    padding: 4px 8px;
  }
  .community-comment-form {
    padding: 16px;
    margin-bottom: 24px;
  }
  .community-comment-form textarea {
    font-size: 14px;
    line-height: 24px;
    min-height: 100px;
  }
  .community-editor-actions {
    gap: 8px;
    flex-wrap: wrap;
  }
  .community-editor-actions .contribution-primary {
    font-size: 12px;
    min-height: 32px;
    padding: 6px 12px;
  }
  .community-editor-actions > span {
    font-size: 10px;
  }
  .community-comments,
  .community-scope {
    --community-avatar-size: 32px;
    --community-author-gap: 8px;
    --community-gap-name-content: 6px;
    --community-gap-content-meta: 8px;
  }
  .community-comment-author {
    gap: 6px;
    font-size: 13px;
    line-height: 20px;
  }
  .community-comment > .avatar {
    width: var(--community-avatar-size);
    height: var(--community-avatar-size);
    flex-basis: var(--community-avatar-size);
  }
  .community-comment-content {
    margin: var(--community-gap-name-content) 0 var(--community-gap-content-meta);
    font-size: 13px;
    line-height: 22px;
  }
  .community-comment-meta {
    margin: 0;
    gap: 12px;
    font-size: 10px;
    line-height: 16px;
    flex-wrap: wrap;
  }
  .community-thread {
    margin-bottom: 16px;
    padding-bottom: 14px;
  }
  .community-replies {
    margin: 10px 0 0 calc(var(--community-avatar-size) + var(--community-author-gap));
    padding: 10px;
  }
  .community-replies .community-comment {
    --community-avatar-size: 24px;
    --community-author-gap: 8px;
    --community-gap-name-content: 4px;
    --community-gap-content-meta: 6px;
    margin-bottom: 12px;
  }
  .community-replies .community-comment > .avatar {
    width: var(--community-avatar-size);
    height: var(--community-avatar-size);
    flex-basis: var(--community-avatar-size);
  }
  .community-replies-toggle {
    margin-left: 0;
    font-size: 11px;
  }
  .comment-badge {
    font-size: 10px;
    line-height: 18px;
    padding: 0 4px;
  }
  .community-legacy .comment-meta {
    gap: 16px;
  }
  .community-legacy .comment-meta,
  .community-legacy .comment-reply {
    font-size: 12px !important;
  }
  .community-legacy .comment-children {
    padding: 12px;
  }
  .community-tabs {
    gap: 28px;
    margin: 24px 0 20px;
  }
  .community-tabs button {
    font-size: 16px;
  }
  .article-community-cta nav {
    width: 76%;
    left: 2%;
    bottom: 2%;
  }
  .article-community-cta picture,
  .article-community-cta picture img {
    border-radius: 12px;
  }
  .community-supplement .contribution-form {
    max-width: 100%;
    margin: 0;
  }
  .community-supplement .form-title {
    font-size: 20px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .community-scope * {
    animation: none !important;
    transition: none !important;
  }
}
/* 与文章主体隔离，沿用原页面宽度、播放器和页脚。 */
.community-supplement,
.community-supplement *,
.contribution-modal,
.contribution-modal * {
  box-sizing: border-box;
}
.community-supplement {
  padding: 0 0 24px;
  font-family: "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  color: #eee;
}
.community-supplement .contribution-control {
  font-family: inherit !important;
  background: #333131 !important;
  color: #eee !important;
  border: 1px solid #ffffff2e !important;
  box-shadow: none !important;
}
.community-supplement .contribution-primary {
  font-family: inherit;
  border: 0;
  cursor: pointer;
}
.post-contribution-actions {
  display: flex;
  gap: 16px;
  margin: 30px 0;
}
.post-content .post-contribution-actions a {
  --entry-color: #52ffe0;
  --entry-border: #35cfab;
  --entry-glow: 53, 207, 171;
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-width: 0;
  height: 70px;
  padding: 0 12px;
  border: 2px solid var(--entry-border);
  border-radius: 10px;
  background: linear-gradient(135deg, #17241e, #07130c);
  box-shadow: inset 0 0 16px rgba(var(--entry-glow), .16), 0 0 16px rgba(var(--entry-glow), .2);
  color: var(--entry-color) !important;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.4;
  text-shadow: 0 0 12px rgba(var(--entry-glow), .65);
  text-decoration: none;
}
.post-content .post-contribution-actions a[data-contribution-route] {
  border-color: var(--entry-border) !important;
}
.post-content .post-contribution-actions a::before {
  content: "";
  flex: 0 0 40px;
  height: 40px;
  margin-right: 2px;
  background: url(/usr/themes/Mirages/images/contribution/article-submit-icon.png) center / contain no-repeat;
}
.post-content .post-contribution-actions a[data-contribution-route="wall"] {
  --entry-color: #ffeb50;
  --entry-border: #d8b936;
  --entry-glow: 222, 190, 51;
  background: linear-gradient(135deg, #241e17, #130c07);
}
.post-content .post-contribution-actions a[data-contribution-route="wall"]::before {
  background-image: url(/usr/themes/Mirages/images/contribution/article-request-icon.png);
}
.post-content .post-contribution-actions a::after {
  display: none !important;
}
.post-content .post-contribution-actions a:focus-visible {
  outline: 2px solid var(--entry-color);
  outline-offset: 4px;
}
.community-legacy .comment-reply-author {
  color: #1abc9d !important;
}
.community-legacy .comment-content > .top {
  margin-right: 6px;
}
.community-tabs + div[hidden],
#article-supplement[hidden] {
  display: none !important;
}
.detail-media-item {
  width: 100%;
}
.detail-media-item > button:first-child {
  width: 100%;
}
.detail-media-item img,
.detail-media-item video {
  width: 100%;
  object-fit: contain;
}
.detail-media-item .media-retry {
  cursor: pointer;
  color: var(--cg-green);
  font: inherit;
}
.comment-badge {
  /* 固定基准，避免 PC 大字号把标签撑粗大；尺寸贴近 H5/静态演示 */
  font-size: 14px !important;
  color: transparent !important;
  padding: 0 !important;
  width: 3.2em;
  height: 1.15em;
  line-height: 1;
  overflow: hidden;
  background-size: contain !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
  vertical-align: middle;
}
.comment-badge.official {
  background-image: url(/usr/themes/Mirages/images/contribution/badge-official.png);
}
.comment-badge.pinned {
  background-image: url(/usr/themes/Mirages/images/contribution/badge-pinned.png);
}
.comment-badge.featured {
  background-image: url(/usr/themes/Mirages/images/contribution/badge-featured.png);
}
.comment-badges {
  display: inline-flex;
  align-items: center;
  vertical-align: baseline;
  gap: 4px 6px;
  margin-right: 6px;
}
/* 兼容线上评论直接输出标签和格式化正文的结构。 */
.community-comment-content:has(> .community-formatted):has(> .comment-badge:is(.pinned, .featured)) {
  display: block;
}
.comment-badges > .comment-badge,
.community-comment-content > .comment-badge:is(.pinned, .featured) {
  margin-right: 0;
}
.community-legacy .comment-content > p {
  display: inline;
  margin: 0;
}
/* 标签与正文同行：格式化正文外层/首段改为 inline，避免块级盒子把标签顶到上一行。 */
.community-comment-content:has(> .comment-badges) > .community-formatted > :first-child,
.community-comment-content:has(> .comment-badges) > .community-formatted p:first-of-type {
  display: inline;
  margin: 0;
}
/* 保留点赞按钮的点击高度，按端调整 3× 图标的显示尺寸。 */
.community-scope .comment-like {
  min-height: 18px;
}
.community-scope .comment-like > :is(img, .fa-thumbs-up) {
  display: none;
}
.community-scope .comment-like::before {
  --comment-like-icon-size: 16px;
  content: "";
  flex: 0 0 var(--comment-like-icon-size);
  width: var(--comment-like-icon-size);
  height: var(--comment-like-icon-size);
  background: url(/usr/themes/Mirages/images/contribution/comment-like.png) center / contain no-repeat;
}
.community-scope .comment-like:is(.is-active, [aria-pressed="true"])::before {
  background-image: url(/usr/themes/Mirages/images/contribution/comment-like-active.png);
}
.comment-like:is(.is-active, [aria-pressed="true"]) > :is([data-reaction-count], .reaction-count) {
  color: #ddd;
}
@media (max-width: 767px) {
  .community-scope .comment-like::before {
    --comment-like-icon-size: 12px;
  }
  .post-contribution-actions {
    gap: 8px;
    margin: 12px 0;
  }
  .post-content .post-contribution-actions a {
    height: 40px;
    padding: 0 4px;
    border-width: 1px;
    border-radius: 4px;
    font-size: 14px;
  }
  .post-content .post-contribution-actions a::before {
    flex-basis: 24px;
    height: 24px;
    margin-right: 0;
  }
}

@media (max-width: 610px) {
  .community-legacy .comment-meta {
    margin-left: 2.5rem;
  }
}
