/* 文章、求瓜页和异步评论共用；按钮与点赞图标直接使用需求提供的独立素材。 */
#comments .comment-separator {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
}
#comments .comment-sort { display: flex; flex-shrink: 0; align-items: center; }
#comments .comment-sort-button {
  appearance: none;
  background: none;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  color: #999;
  cursor: pointer;
  font: inherit;
  font-size: .875rem;
  line-height: 1.3;
  padding: 0 .625rem;
}
#comments .comment-sort-button + .comment-sort-button { border-left: 1px solid #555; }
#comments .comment-sort-button:last-child { padding-right: 0; }
#comments .comment-sort-button[aria-pressed="true"] { color: #1abc9c; }
#comments .comment-body > .comment-reply {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}
#comments .comment-like {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .375rem;
  padding: .125rem 0;
  margin: 0;
  min-height: 1.25rem;
  background: none;
  border: 0;
  box-shadow: none;
  color: #aaa;
  cursor: pointer;
  font: inherit;
  font-weight: 400;
  line-height: 1;
}
#comments .comment-like[aria-pressed="true"] { color: #df9900; }
#comments .comment-like:disabled { cursor: wait; }
#comments .comment-like-icon {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  background: url("images/like.png") center / contain no-repeat;
}
#comments .comment-like[aria-pressed="true"] .comment-like-icon { background-image: url("images/like-active.png"); }
#comments .comment-sort-button:focus-visible,
#comments .comment-like:focus-visible { outline: 2px solid #1abc9c; outline-offset: 3px; }
#comments .comment-badges { display: inline; margin-right: .375rem; white-space: nowrap; }
#comments .comment-content .comment-badge {
  display: inline-block !important;
  width: 3.25rem !important;
  height: 1.125rem !important;
  margin: 0 .375rem 0 0;
  vertical-align: text-bottom;
}
#comments .comment-content .comment-badge:last-child { margin-right: 0; }
#comments .comment-author .comment-official {
  display: inline-block;
  margin-left: .375rem;
  padding: 0 .2rem;
  border: 1px solid #a25eab;
  border-radius: .2rem;
  color: #c27fcb;
  font-size: .625rem;
  line-height: 1.1;
  vertical-align: middle;
}
.comment-status {
  position: fixed;
  z-index: 999999;
  left: 50%;
  bottom: 20%;
  transform: translateX(-50%);
  padding: .75rem 1.25rem;
  border-radius: .375rem;
  background: rgba(0,0,0,.85);
  color: #fff;
}
.comment-login-dialog {
  width: min(620px, 94vw);
  max-width: 94vw;
  padding: 0;
  background: #262626;
  color: #eee;
  border: 1px solid #555;
  border-radius: .5rem;
}
.comment-login-dialog::backdrop { background: rgba(0,0,0,.7); }
.comment-login-title { font-size: 1rem; padding: 1rem; margin: 0; }
.comment-login-close { position: absolute; right: .5rem; top: .25rem; border: 0; background: none; color: #eee; cursor: pointer; font-size: 1.75rem; }
.comment-login-frame { display: block; border: 0; width: 100%; height: min(700px, 75dvh); }
@media (max-width: 767px) {
  #comments .comment-sort-button { font-size: .75rem; padding: .25rem .5rem; }
  #comments .comment-body > .comment-reply { gap: 1rem; }
}
@media (max-width: 359px) {
  #comments .comment-separator { gap: .25rem; }
  #comments .comment-num { font-size: 1rem; }
  #comments .comment-sort-button { padding-left: .375rem; padding-right: .375rem; }
}

/* 仅增强共用评论组件，正文、推荐、导航等区域继续沿用主题。 */
#comments.comment-enhanced { --comment-avatar: 48px; --comment-gap: 12px; }
#comments.comment-enhanced [hidden] { display: none !important; }
#comments.comment-enhanced > .comment-separator { margin: 0 0 10px; line-height: 1.4; }
#comments.comment-enhanced .comment-num { color: #1abc9c; font-size: 20px; font-weight: 600; }
#comments.comment-enhanced .comment-sort { gap: 7px; }
#comments.comment-enhanced .comment-sort-button {
  padding: 3px 12px;
  border: 0;
  border-radius: 3px;
  background: #4d3b25;
  color: #ddd;
  font-size: 14px;
  line-height: 1.3;
}
#comments.comment-enhanced .comment-sort-button[aria-pressed="true"] { color: #171717; background: #ff9800; }
#comments.comment-enhanced .comment-page-title { margin: 0 0 12px; color: #ddd; font-size: 15px; line-height: 1.6; overflow-wrap: anywhere; }
#comments.comment-enhanced .comment-list { list-style: none; padding: 0; margin: 0; }
#comments.comment-enhanced > .comment-list { margin-top: 22px; }
#comments.comment-enhanced .comment-body {
  position: relative;
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  column-gap: 8px;
  row-gap: 4px;
  margin: 0;
  padding: 0 0 0 calc(var(--comment-avatar) + var(--comment-gap));
  min-width: 0;
  background: transparent;
}
#comments.comment-enhanced > .comment-list > .comment-body { margin-top: 20px; padding-bottom: 20px; border-bottom: 1px solid #383838; }
#comments.comment-enhanced .comment-body > .comment-author {
  grid-column: 1;
  display: inline-flex;
  align-items: baseline;
  max-width: min(360px, 45vw);
  margin: 0;
  min-width: 0;
  color: #1abc9c;
  font-size: 15px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
#comments.comment-enhanced .comment-author .avatar {
  position: absolute;
  left: 0;
  top: 0;
  float: none;
  display: block;
  width: var(--comment-avatar);
  height: var(--comment-avatar);
  margin: 0;
  border-radius: 50%;
  object-fit: cover;
  background: #333;
}
#comments.comment-enhanced .comment-author cite { font: inherit; }
#comments.comment-enhanced .comment-body > .comment-meta { grid-column: 2; align-self: baseline; margin: 0; color: #999; font-size: 12px; line-height: 1.8; }
#comments.comment-enhanced .comment-meta a,
#comments.comment-enhanced .comment-meta time { color: #999 !important; font: inherit; }
#comments.comment-enhanced .comment-content {
  grid-column: 1 / -1;
  padding: 0;
  min-width: 0;
  overflow: visible;
  color: #ddd;
  font-size: 15px;
  line-height: 1.6;
  overflow-wrap: anywhere;
  word-break: break-word;
}
/* 模板 HTML 含排版缩进；仅本地发布的纯文本评论按用户输入保留换行。 */
#comments.comment-enhanced .comment-content > p { display: block; padding: 0; margin: 0; white-space: normal; }
#comments.comment-enhanced [data-local-comment="1"] > .comment-content > p { white-space: pre-wrap; }
#comments.comment-enhanced .comment-reply-author { color: #f39a00; font-weight: 400; }
#comments.comment-enhanced .comment-body > .comment-reply {
  grid-column: 1 / -1;
  float: none;
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
}
#comments.comment-enhanced .comment-reply > a,
#comments.comment-enhanced .comment-reply > button:not(.comment-like) { background: none; border: 0; padding: 0; margin: 0; color: #1abc9c; font: inherit; cursor: pointer; }
#comments.comment-enhanced .comment-like { gap: 4px; color: #aaa; font: inherit; }
#comments.comment-enhanced .comment-like[aria-pressed="true"] { color: #df9900; }
#comments.comment-enhanced .comment-like-icon { width: 14px; height: 14px; }
#comments.comment-enhanced .comment-images { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; width: 100%; max-width: 440px; margin: 5px 0; }
#comments.comment-enhanced .comment-image-open { display: block; width: 100%; aspect-ratio: 1; padding: 0; border: 0; border-radius: 7px; overflow: hidden; background: #333; cursor: zoom-in; }
#comments.comment-enhanced .comment-image-open > img { display: block !important; width: 100%; height: 100%; max-width: 100%; max-height: none; margin: 0; object-fit: cover; }
#comments.comment-enhanced .comment-children { grid-column: 1 / -1; padding: 0; margin: 14px 0 0; min-width: 0; }
#comments.comment-enhanced > .comment-list > .comment-body > .comment-children { padding-left: 0; }
#comments.comment-enhanced .comment-children > .comment-list { padding: 0; margin: 0; border: 0; }
#comments.comment-enhanced > .comment-list > .comment-body > .comment-children > .comment-list { padding: 0; border: 0; }
#comments.comment-enhanced .comment-children .comment-body { margin-top: 20px; }
#comments.comment-enhanced .comment-children .comment-body:first-child { margin-top: 0; }
#comments.comment-enhanced .comment-replies-toggle {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 9px;
  margin: 16px 0 0 calc(var(--comment-avatar) + var(--comment-gap));
  padding: 0;
  border: 0;
  background: none;
  color: #999;
  font: inherit;
  font-size: 14px;
  line-height: 1.5;
  cursor: pointer;
}
#comments.comment-enhanced .comment-replies-toggle::before { content: ""; width: 28px; height: 1px; background: #555; }
#comments.comment-enhanced .comment-replies-toggle::after { content: ""; display: block; width: 11px; height: 11px; background: url("/usr/themes/Mirages/images/down.png") center / contain no-repeat; }
#comments.comment-enhanced .comment-replies-toggle[aria-expanded="true"]::after { transform: rotate(180deg); }
#comments.comment-enhanced .comment-awaiting-moderation { grid-column: 1 / -1; margin: 0; color: #d8a44d; font-size: 12px; }
#comments.comment-enhanced .comment-composer {
  margin: 0 !important;
  padding: 14px;
  border: 1px solid #3c3c3c;
  border-radius: 9px;
  background: #2e2e2e;
}
#comments.comment-enhanced .comment-composer > .widget-title { display: none; }
#comments.comment-enhanced .comment-composer .cancel-comment-reply { float: none; margin: 0; }
#comments.comment-enhanced .comment-composer-heading { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; color: #ccc; font-size: 15px; line-height: 1.4; }
#comments.comment-enhanced .comment-composer-participant { display: inline-flex; align-items: center; gap: 8px; }
#comments.comment-enhanced .comment-composer-heading img { display: block; width: 30px; height: 30px; border-radius: 50%; object-fit: cover; }
#comments.comment-enhanced .comment-moderation-note,
#comments.comment-enhanced .comment-moderation-hint { margin-left: auto; color: #999; font-size: 13px; white-space: nowrap; }
#comments.comment-enhanced .comment-composer #comment-form { padding: 0; margin: 0; white-space: normal; }
#comments.comment-enhanced .comment-composer #comment-form > p { margin: 0; }
#comments.comment-enhanced .comment-editor { position: relative; min-width: 0; }
#comments.comment-enhanced .comment-composer .comment-editor textarea {
  display: block;
  box-sizing: border-box;
  width: 100%;
  min-height: 112px;
  height: 112px;
  padding: 12px 14px 44px;
  border: 1px solid #666;
  border-radius: 6px;
  background: transparent;
  color: #ddd;
  font: inherit;
  font-size: 14px;
  line-height: 1.5;
  resize: vertical;
}
#comments.comment-enhanced .comment-editor #submit {
  position: absolute;
  right: 10px;
  bottom: 10px;
  display: block;
  width: auto;
  min-width: 62px;
  height: 30px;
  padding: 0 14px;
  margin: 0;
  border: 0;
  border-radius: 4px;
  background: linear-gradient(100deg, #00e8ee, #ec7ddf);
  color: #111;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  line-height: 30px;
  cursor: pointer;
}
#comments.comment-enhanced .comment-editor #submit:disabled { opacity: .55; cursor: wait; }
#comments.comment-enhanced .comment-upload-list { display: flex; align-items: flex-start; flex-wrap: wrap; gap: 12px; margin: 18px 0 14px; }
#comments.comment-enhanced .comment-upload-preview,
#comments.comment-enhanced .comment-upload { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; width: 80px; height: 80px; flex: 0 0 80px; margin: 0; border: 1px solid #666; border-radius: 7px; background: transparent; color: #999; font-size: 12px; line-height: 1.2; text-align: center; }
#comments.comment-enhanced .comment-upload { cursor: pointer; overflow: hidden; }
#comments.comment-enhanced .comment-upload i { font-size: 25px; }
#comments.comment-enhanced .comment-upload input[type="file"] { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; min-width: 0; margin: 0; padding: 0; cursor: pointer; }
#comments.comment-enhanced .comment-upload-preview > img { display: block; width: 100%; height: 100%; border-radius: 6px; object-fit: cover; }
#comments.comment-enhanced .comment-image-remove,
#comments.comment-enhanced .comment-upload-remove { position: absolute; z-index: 1; top: -8px; right: -8px; display: flex; align-items: center; justify-content: center; width: 20px; height: 20px; min-width: 0; margin: 0; padding: 0; border: 0; border-radius: 50%; background: #505050; color: #bbb; font: inherit; font-size: 16px; line-height: 1; cursor: pointer; }
#comments.comment-enhanced .comment-composer-tools { position: relative; display: flex; align-items: center; gap: 14px; margin-top: 12px; }
#comments.comment-enhanced .comment-composer-tools > p { margin: 0 !important; }
/* 面板的 max-width: 100% 以整行工具栏为参照，避免被 flex 中的按钮宽度压缩。 */
#comments.comment-enhanced .comment-composer-tools .OwO { position: static; display: block; flex: 0 0 auto; margin-top: 0; }
#comments.comment-enhanced .comment-composer-tools .OwO-body { box-sizing: border-box; left: 0; top: calc(100% - 1px); }
#comments.comment-enhanced .comment-composer-tools .OwO-up .OwO-body { top: auto; bottom: calc(100% - 1px); }
#comments.comment-enhanced .comment-composer-tools .OwO-logo { display: flex; align-items: center; justify-content: center; width: 42px; height: 30px; margin: 0; padding: 0; border: 1px solid #666; border-radius: 4px; color: #ddd; background: transparent; font-size: 12px; }
#comments.comment-enhanced .comment-composer-tools #author { display: block; box-sizing: border-box; flex: 0 1 230px; width: 230px; min-width: 0; height: 30px; padding: 4px 12px; margin: 0; border: 1px solid #666; border-radius: 4px; color: #ddd; background: transparent; font-size: 13px; line-height: 20px; }
#comments.comment-enhanced .comment-reply-target { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; color: #f39a00; font-size: 13px; line-height: 1.5; }
#comments.comment-enhanced .comment-reply-target button { padding: 0; border: 0; background: none; color: #999; font: inherit; cursor: pointer; }
#comments.comment-enhanced .comment-body > .comment-composer { grid-column: 1 / -1; margin: 14px 0 0 !important; }
#comments.comment-enhanced .comment-composer.is-reply { border: 0; border-radius: 0; background: transparent; padding: 0; }
#comments.comment-enhanced .comment-composer.is-reply .comment-composer-heading { display: none; }
#comments.comment-enhanced .comment-composer.is-reply .comment-editor textarea { height: 58px; min-height: 58px; padding: 9px 86px 9px 12px; }
#comments.comment-enhanced .comment-composer.is-reply .comment-composer-tools { margin-top: 10px; }
#comments.comment-enhanced .page-navigator { margin: 24px 0 0 !important; height: auto; text-align: center; }
#comments.comment-enhanced .page-navigator .next_more { display: inline-block; padding: 9px 38px; border: 0; border-radius: 28px; background: linear-gradient(100deg, #f6c64f, #fa982b); color: #4a3415 !important; font-size: 14px; line-height: 1.5; text-decoration: none !important; }
#comments.comment-enhanced .next_more > span::after { display: none; }
#comments.comment-enhanced button:focus-visible,
#comments.comment-enhanced .comment-upload:focus-within,
#comments.comment-enhanced .comment-editor textarea:focus-visible,
#comments.comment-enhanced .comment-composer-tools #author:focus-visible { outline: 2px solid #1abc9c !important; outline-offset: 3px; }
.comment-image-dialog { box-sizing: border-box; position: fixed; max-width: 96vw; max-height: 94dvh; padding: 38px 12px 12px; border: 1px solid #555; border-radius: 8px; background: #202020; color: #fff; }
.comment-image-dialog::backdrop { background: rgba(0, 0, 0, .85); }
.comment-image-dialog img { display: block; max-width: min(1200px, 90vw); max-height: calc(90dvh - 50px); width: auto; height: auto; object-fit: contain; }
.comment-image-close { position: absolute; top: 5px; right: 8px; width: 30px; height: 30px; border: 0; background: none; color: #fff; font-size: 24px; cursor: pointer; }
@media (max-width: 767px) {
  #comments.comment-enhanced { --comment-avatar: 30px; --comment-gap: 10px; }
  #comments.comment-enhanced .comment-num { font-size: 17px; }
  #comments.comment-enhanced .comment-sort-button { font-size: 12px; padding: 3px 9px; }
  #comments.comment-enhanced .comment-page-title { font-size: 14px; line-height: 1.5; }
  #comments.comment-enhanced > .comment-list { margin-top: 18px; }
  #comments.comment-enhanced > .comment-list > .comment-body { margin-top: 18px; padding-bottom: 15px; }
  #comments.comment-enhanced .comment-body { column-gap: 6px; row-gap: 3px; }
  #comments.comment-enhanced .comment-body > .comment-author { font-size: 14px; }
  #comments.comment-enhanced .comment-body > .comment-meta { font-size: 11px; }
  #comments.comment-enhanced .comment-content { font-size: 14px; }
  #comments.comment-enhanced .comment-body > .comment-reply { font-size: 13px; gap: 15px; }
  #comments.comment-enhanced .comment-images { gap: 7px; max-width: 100%; }
  #comments.comment-enhanced .comment-image-open { border-radius: 5px; }
  #comments.comment-enhanced .comment-children { margin-top: 13px; }
  #comments.comment-enhanced .comment-children .comment-body { margin-top: 17px; }
  #comments.comment-enhanced .comment-replies-toggle { margin-top: 16px; font-size: 12px; }
  #comments.comment-enhanced .comment-composer { padding: 11px; border-radius: 7px; }
  #comments.comment-enhanced .comment-composer-heading { margin-bottom: 14px; gap: 6px; font-size: 13px; }
  #comments.comment-enhanced .comment-composer-heading img { width: 23px; height: 23px; }
  #comments.comment-enhanced .comment-moderation-note,
  #comments.comment-enhanced .comment-moderation-hint { font-size: 12px; }
  #comments.comment-enhanced .comment-editor textarea { height: 100px; min-height: 100px; padding: 10px 11px 40px; font-size: 12px; }
  #comments.comment-enhanced .comment-editor #submit { min-width: 48px; height: 25px; right: 8px; bottom: 8px; padding: 0 11px; font-size: 12px; line-height: 25px; }
  #comments.comment-enhanced .comment-upload-list { margin: 17px 0 12px; gap: 10px; }
  #comments.comment-enhanced .comment-upload-preview,
  #comments.comment-enhanced .comment-upload { width: 64px; height: 64px; flex-basis: 64px; font-size: 11px; }
  #comments.comment-enhanced .comment-upload i { font-size: 22px; }
  #comments.comment-enhanced .comment-composer-tools { gap: 12px; margin-top: 11px; }
  #comments.comment-enhanced .comment-composer-tools #author { flex-basis: 175px; width: 175px; height: 27px; font-size: 12px; }
  #comments.comment-enhanced .comment-composer-tools .OwO-logo { width: 36px; height: 27px; }
  #comments.comment-enhanced .comment-composer.is-reply .comment-editor textarea { min-height: 48px; height: 48px; padding-right: 72px; }
  #comments.comment-enhanced .page-navigator .next_more { padding: 9px 37px; font-size: 13px; }
}
@media (max-width: 359px) {
  #comments.comment-enhanced { --comment-avatar: 28px; --comment-gap: 8px; }
  #comments.comment-enhanced .comment-body > .comment-author { max-width: 43vw; font-size: 13px; }
  #comments.comment-enhanced .comment-sort { gap: 5px; }
  #comments.comment-enhanced .comment-sort-button { padding: 3px 7px; }
  #comments.comment-enhanced .comment-images { gap: 5px; }
}
