#community-detail { max-width: 1056px; margin-inline: auto; }

.community-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  margin: -5px 0 21px;
  padding: 4px 8px 4px 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #675385;
  font-size: 13px;
  font-weight: 630;
}

.community-back > span { font-size: 17px; line-height: 1; }
.community-back:hover { color: var(--accent); }

.community-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(216px, 26%);
  grid-template-areas: "article support" "comments support";
  gap: 30px clamp(26px, 4vw, 54px);
  align-items: start;
}

.community-article, .community-comments { min-width: 0; overflow-wrap: anywhere; }
.community-article { grid-area: article; }

.community-article-title {
  max-width: 21em;
  margin: 9px 0 14px;
  color: var(--ink);
  font: 750 clamp(24px, 2.6vw, 38px)/1.27 "Songti SC", "Noto Serif CJK SC", serif;
  letter-spacing: -.018em;
  text-wrap: balance;
}

.community-article-deck {
  max-width: 45em;
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.75;
}

.community-author {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.community-author .community-avatar { width: 36px; height: 36px; font-size: 13px; }
.community-author-info { display: grid; gap: 1px; min-width: 0; }
.community-author strong, .community-reply strong { color: var(--ink); font-weight: 680; }
.community-author strong { font-size: 13px; }

.community-article-image {
  width: 100%;
  max-height: 340px;
  aspect-ratio: 2.25;
  margin-top: 21px;
  overflow: hidden;
  border-radius: 14px;
  background: #f2edf5;
}

.community-article-image img { width: 100%; height: 100%; object-fit: cover; }

.community-article-body {
  display: grid;
  gap: 22px;
  max-width: 44em;
  margin-top: 21px;
  color: var(--label);
  font-size: 14px;
  line-height: 1.95;
}

.community-article-body h3 {
  margin: 0 0 5px;
  color: var(--ink);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.6;
}

.community-article-body p, .community-reply p { white-space: pre-wrap; }
.community-article-body p + p { margin-top: 10px; }

.community-support {
  grid-area: support;
  position: sticky;
  top: 22px;
  display: grid;
  justify-items: start;
  gap: 7px;
  min-width: 0;
  padding: clamp(16px, 2vw, 23px);
  border: 1px solid #eee4d7;
  border-radius: 16px;
  background: linear-gradient(140deg, #fbf4eb, #fdfbf7);
  color: #49362b;
}

.community-support .community-token { margin-bottom: 3px; }
.community-support h2 { font-size: 16px; font-weight: 700; }
.community-support p { color: #6f6158; font-size: 13px; }

.community-tip-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 41px;
  padding: 8px 13px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: #674935;
  color: #fff;
  font-weight: 640;
  text-align: center;
}

.community-tip-button:hover { background: #52382a; }
.community-tip-button:disabled { opacity: .55; cursor: default; }
.community-support .community-tip-button { width: 100%; margin-top: 6px; }
.community-support .community-tip-count { justify-self: center; color: #746452; font-size: 12px; }

.community-comments {
  grid-area: comments;
  padding-top: 21px;
  border-top: 1px solid var(--line);
}

.community-comments .community-section-header { margin-bottom: 4px; }
.community-replies { display: grid; }
.community-reply {
  display: flex;
  gap: 11px;
  min-width: 0;
  padding: 11px 0;
  color: var(--label);
  font-size: 13px;
  line-height: 1.7;
}

.community-reply + .community-reply { border-top: 1px solid #f0edf4; }
.community-reply p { margin-top: 3px; }
.community-empty { padding: 9px 0; color: var(--muted); font-size: 13px; }

.community-reply-form {
  display: grid;
  gap: 8px;
  margin-top: 11px;
  padding: 14px;
  border: 1px solid #eee8f2;
  border-radius: 12px;
  background: #faf8fc;
}

.community-reply-form label, .community-compose-form label {
  color: var(--ink);
  font-size: 13px;
  font-weight: 650;
}

.community-reply-form textarea,
.community-compose-form :is(input, textarea, select) {
  display: block;
  width: 100%;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid #e4ddea;
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}

.community-reply-form textarea, .community-compose-form textarea { resize: vertical; }
.community-compose-form :is(input, select):focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.community-reply-action { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; }
.community-reply-action > span, .community-form-note { color: var(--muted); font-size: 12px; }

.community-dialog {
  width: min(490px, calc(100% - 24px));
  max-height: calc(100% - 24px);
  padding: 0;
  border: 1px solid #e8e1ef;
  border-radius: 17px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 16px 48px #2f233b2b;
}

.community-dialog::backdrop { background: #271e3b62; }
.community-tip-dialog { width: min(408px, calc(100% - 24px)); border-color: #ede2d5; }

.community-dialog-header {
  position: sticky;
  z-index: 1;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 15px 20px;
  border-bottom: 1px solid #f0eaf4;
  background: var(--surface);
}

.community-tip-dialog .community-dialog-header { border-color: #f0e6da; background: #fcf8f2; }
.community-dialog-header h2 { font-size: 19px; font-weight: 710; }
.community-dialog-body { display: grid; gap: 14px; padding: 20px; }
.community-dialog-text { color: var(--label); }
.community-dialog-text strong { color: var(--ink); }
.community-amounts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; min-width: 0; margin: 0; padding: 0; border: 0; }
.community-amounts legend { padding: 0; margin-bottom: 7px; font-size: 12px; font-weight: 650; }
.community-amounts label { position: relative; min-width: 0; }
.community-amounts input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.community-amounts label span {
  display: block;
  padding: 10px 4px;
  border: 1px solid #eee5d9;
  border-radius: 9px;
  background: #fdfaf6;
  color: #61493b;
  font-size: 16px;
  font-weight: 690;
  font-variant-numeric: tabular-nums;
  text-align: center;
  cursor: pointer;
}

.community-amounts label:hover span { border-color: #d0b295; }
.community-amounts input:checked + span { border-color: #b78863; background: #f8ebdb; color: #513728; }
.community-amounts input:focus-visible + span { outline: 2px solid #986743; outline-offset: 2px; }
.community-tip-result { justify-items: center; text-align: center; }
.community-tip-result h3 { margin: 0; font-size: 18px; }
.community-tip-result .community-token { background: #e8f4ec; color: #34734a; }
.community-compose-form { gap: 7px; }
.community-compose-form label:not(:first-child), .community-compose-form .community-reply-action { margin-top: 5px; }

@media (max-width: 810px) {
  .community-detail-grid {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "article" "support" "comments";
    gap: 23px;
  }

  .community-support { position: static; }
}

@media (max-width: 460px) {
  .community-back { margin-bottom: 14px; }
  .community-article-title { margin-bottom: 11px; }
  .community-article-image { aspect-ratio: 16 / 10; margin-top: 15px; border-radius: 10px; }
  .community-article-body { margin-top: 16px; gap: 17px; }
  .community-reply-form { padding: 11px; }
  .community-dialog-header, .community-dialog-body { padding-inline: 15px; }
}
.community-live-body { white-space: pre-wrap; overflow-wrap: anywhere; }
.community-gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 145px), 1fr)); gap: 8px; margin-top: 14px; }
.community-gallery a { min-width: 0; display: block; }
.community-gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 9px; }
.community-gallery video { width: 100%; max-height: 460px; border-radius: 9px; background: #191324; }
.community-live-comment-author { display: flex; align-items: baseline; flex-wrap: wrap; gap: 7px; }
.community-attachments, .community-pay-amount { display: grid; gap: 6px; }
.community-attachments { padding: 10px; border: 1px solid var(--line); border-radius: 9px; background: #faf8fd; }
.community-attachments input { width: 100%; color: var(--muted); font: inherit; }
.community-attachments input::file-selector-button { padding: 6px 9px; margin-inline-end: 7px; border: 1px solid #ded2f6; border-radius: 7px; background: #f2ebff; color: #543ba2; cursor: pointer; }
.community-attachments small { color: var(--muted); overflow-wrap: anywhere; }
.community-pay-amount input { min-height: 41px; width: 100%; padding: 8px 10px; border: 1px solid #dcd3ef; border-radius: 8px; font: inherit; }
.community-tip-qr { margin: 5px auto; max-width: 100%; height: auto; padding: 6px; border: 1px solid #e6dff0; border-radius: 10px; background: #fff; }
.community-message-list { display: grid; gap: 7px; margin: 0; }
.community-message-item { display: flex; align-items: start; justify-content: space-between; gap: 10px; padding: 10px; border: 1px solid #eee8f4; border-radius: 9px; }
.community-message-item p { margin: 2px 0; overflow-wrap: anywhere; }
.community-message-amount { flex: none; color: #6344aa; }
.community-message-item .community-popular-link { display: block; width: auto; padding: 3px 0; color: #6241b0; }
