:root {
  --c-ink: #08243f;
  --c-navy: #061a30;
  --c-blue: #0a69c7;
  --c-jade: #0b8069;
  --c-amber: #b66a19;
  --c-paper: #f5f8fb;
  --c-white: #fff;
  --c-line: #d8e3ed;
  --c-muted: #63788b;
  --c-display: "Source Han Serif SC", "Noto Serif CJK SC", "Songti SC", serif;
  --c-body: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}
* { box-sizing: border-box; }
body.community-page { margin: 0; color: var(--c-ink); background: var(--c-paper); font-family: var(--c-body); }
.community-page button, .community-page input, .community-page select, .community-page textarea { font: inherit; }
.community-shell { width: min(1140px, calc(100% - 40px)); margin: 0 auto; }
.community-button { display: inline-flex; min-height: 46px; align-items: center; justify-content: center; padding: 10px 18px; border: 1px solid transparent; border-radius: 10px; font-weight: 800; text-decoration: none; }
.community-button.primary { color: #fff; background: var(--c-blue); }
.community-button.secondary { color: var(--c-blue); border-color: #b9cddd; background: #fff; }
.community-feed-section { padding: 42px 0 72px; }
.community-index-head { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 22px; }
.community-index-head h1 { margin: 0; font-family: var(--c-display); font-size: 38px; letter-spacing: -.035em; }
.community-index-head p { margin: 7px 0 0; color: var(--c-muted); font-size: 13px; }
.community-index-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.community-index-actions .community-button { min-height: 40px; padding: 8px 15px; font-size: 13px; }
.community-filter-panel { position: sticky; z-index: 5; top: 58px; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px; align-items: center; margin-bottom: 14px; padding: 9px; border: 1px solid var(--c-line); border-radius: 12px; background: rgba(255,255,255,.96); backdrop-filter: blur(12px); }
.workflow-track { display: flex; min-width: 0; align-items: center; overflow-x: auto; scrollbar-width: thin; }
.workflow-track button { flex: 0 0 auto; padding: 9px 11px; border: 0; border-radius: 7px; color: #536c82; background: transparent; font-size: 12px; cursor: pointer; }
.workflow-track button.active { color: var(--c-blue); font-weight: 800; }
.workflow-track button.active { background: #edf5fc; }
.community-type-tabs { display: flex; gap: 4px; padding-right: 14px; border-right: 1px solid var(--c-line); }
.community-type-tabs button { padding: 9px 12px; border: 0; border-radius: 7px; color: #5b7286; background: transparent; font-size: 12px; cursor: pointer; }
.community-type-tabs button.active { color: #fff; background: var(--c-ink); }
.community-feed { display: grid; gap: 10px; }
.community-card { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 30px; padding: 18px 20px; border: 1px solid var(--c-line); border-radius: 12px; background: #fff; text-decoration: none; transition: border-color .18s ease, background-color .18s ease; }
.community-card:hover { border-color: #9bbfdc; background: #fbfdff; }
.community-card.featured { border-left: 4px solid var(--c-jade); }
.community-card-top, .community-card-meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 14px; }
.community-card-top { justify-content: flex-start; }
.community-kind, .community-stage, .community-badge { display: inline-flex; align-items: center; padding: 4px 8px; border-radius: 999px; font-size: 10px; font-weight: 800; }
.community-kind.article { color: #0a5dab; background: #eaf4fd; }
.community-kind.question { color: #9a5814; background: #fff3e3; }
.community-stage { color: #496378; background: #eef3f7; }
.community-card h3 { margin: 9px 0 5px; font-size: 17px; line-height: 1.55; }
.community-card > p { max-width: 780px; margin: 0; overflow: hidden; color: var(--c-muted); font-size: 12px; line-height: 1.7; text-overflow: ellipsis; white-space: nowrap; }
.community-card-meta { grid-column: 2; grid-row: 1 / span 3; align-self: center; flex-direction: column; align-items: flex-end; justify-content: center; color: #73879a; font-size: 11px; white-space: nowrap; }
.community-author { display: flex; align-items: center; gap: 8px; }
.community-avatar { display: grid; width: 30px; height: 30px; place-items: center; overflow: hidden; border-radius: 50%; color: #fff; background: #385d7b; font-size: 12px; font-weight: 800; }
.community-avatar img { width: 100%; height: 100%; object-fit: cover; }
.community-badge { padding: 3px 7px; color: var(--c-jade); background: #e8f6f1; }
.community-loading, .community-empty { grid-column: 1 / -1; padding: 50px 30px; border: 1px dashed #bdcbd7; border-radius: 18px; color: var(--c-muted); background: #fff; text-align: center; line-height: 1.8; }
.community-load-more { grid-column: 1 / -1; display: flex; justify-content: center; padding-top: 10px; }
.community-load-more button { padding: 11px 22px; border: 1px solid #abc3d5; border-radius: 999px; color: var(--c-blue); background: #fff; font-weight: 800; cursor: pointer; }
.community-load-more button:disabled { cursor: wait; opacity: .55; }
.community-empty strong { display: block; margin-bottom: 8px; color: var(--c-ink); font-family: var(--c-display); font-size: 23px; }
.community-empty a { color: var(--c-blue); font-weight: 800; text-decoration: none; }
.community-footer { padding: 34px 0; border-top: 1px solid var(--c-line); background: #fff; }
.community-footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.community-footer span { color: var(--c-muted); font-size: 12px; }
.community-footer-inner > div:last-child { display: flex; flex-wrap: wrap; gap: 18px; }
.community-footer a { color: #48647b; font-size: 13px; text-decoration: none; }

/* Detail */
.community-post-loading { padding: 100px 0; color: var(--c-muted); text-align: center; }
.post-hero { padding: 62px 0 48px; border-bottom: 1px solid var(--c-line); background: #fff; }
.post-breadcrumb { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 30px; color: #708499; font-size: 12px; }
.post-breadcrumb a { color: inherit; text-decoration: none; }
.post-labels { display: flex; flex-wrap: wrap; gap: 8px; }
.post-hero h1 { max-width: 900px; margin: 18px 0 15px; font-family: var(--c-display); font-size: clamp(36px, 5vw, 58px); line-height: 1.32; letter-spacing: -.04em; }
.post-author-line { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 28px; color: #667d91; font-size: 12px; }
.post-author-line .community-author { color: var(--c-ink); }
.post-layout { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 50px; align-items: start; padding: 56px 0 90px; }
.post-content { padding: 40px; border: 1px solid var(--c-line); border-radius: 18px; background: #fff; }
.post-body { color: #223e56; font-size: 16px; line-height: 2; white-space: pre-wrap; overflow-wrap: anywhere; }
.post-source { margin-top: 34px; padding: 18px; border-left: 3px solid var(--c-jade); color: #506b7f; background: #f0f7f5; font-size: 13px; }
.post-source a { color: var(--c-blue); overflow-wrap: anywhere; }
.post-disclaimer { margin-top: 34px; padding-top: 22px; border-top: 1px solid var(--c-line); color: #7b8ea0; font-size: 12px; line-height: 1.75; }
.post-side { position: sticky; top: 84px; display: grid; gap: 14px; }
.post-side-card { padding: 22px; border: 1px solid var(--c-line); border-radius: 16px; background: #fff; }
.post-side-card strong { display: block; margin-bottom: 9px; font-family: var(--c-display); font-size: 19px; }
.post-side-card p { margin: 0; color: var(--c-muted); font-size: 13px; line-height: 1.75; }
.post-side-card a { display: inline-flex; margin-top: 14px; color: var(--c-blue); font-size: 13px; font-weight: 800; text-decoration: none; }
.comments-section { grid-column: 1; margin-top: 6px; }
.comments-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.comments-head h2 { margin: 0; font-family: var(--c-display); font-size: 32px; }
.comments-head span { color: var(--c-muted); font-size: 12px; }
.comment-form, .comment-card { padding: 22px; border: 1px solid var(--c-line); border-radius: 16px; background: #fff; }
.comment-form { margin-bottom: 16px; }
.comment-form textarea { width: 100%; min-height: 100px; padding: 12px; border: 1px solid #c5d3df; border-radius: 10px; resize: vertical; }
.comment-form-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 10px; }
.comment-form-row span { color: var(--c-muted); font-size: 11px; }
.comment-form button { padding: 9px 16px; border: 0; border-radius: 9px; color: #fff; background: var(--c-blue); font-weight: 800; cursor: pointer; }
.comment-list { display: grid; gap: 12px; }
.comment-card.reply { margin-left: 44px; border-left: 3px solid #a9c8dd; }
.comment-card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; color: #788b9c; font-size: 11px; }
.comment-card-head strong { color: var(--c-ink); font-size: 13px; }
.comment-reply-to { margin-left: 8px; color: #6b8194; font-size: 11px; }
.comment-card p { margin: 13px 0 0; color: #354f65; font-size: 14px; line-height: 1.8; white-space: pre-wrap; }
.comment-actions { display: flex; gap: 14px; margin-top: 14px; }
.comment-actions button { padding: 0; border: 0; color: #6b8194; background: transparent; font-size: 11px; cursor: pointer; }
.comment-login { padding: 20px; border: 1px dashed #bdcbd7; border-radius: 14px; color: var(--c-muted); background: #fff; text-align: center; }
.comment-login a { color: var(--c-blue); font-weight: 800; }

/* Compose */
.compose-main { padding: 28px 0 64px; }
.compose-layout { max-width: 920px; }
.compose-editor { padding: 26px 30px 28px; border: 1px solid var(--m-line); border-radius: 16px; background: #fff; }
.compose-form { display: grid; gap: 14px; }
.compose-form-head { display: flex; align-items: baseline; justify-content: space-between; gap: 18px; padding-bottom: 15px; border-bottom: 1px solid var(--c-line); }
.compose-form-head strong { color: var(--c-ink); font-size: 19px; }
.compose-form-head span { color: var(--c-muted); font-size: 12px; }
.compose-form label { display: grid; gap: 8px; color: #29445b; font-size: 13px; font-weight: 800; }
.compose-form input, .compose-form select, .compose-form textarea { width: 100%; padding: 11px 12px; border: 1px solid #c5d4e0; border-radius: 10px; color: #17344d; background: #fff; }
.compose-form input, .compose-form select { min-height: 46px; }
.compose-form textarea { resize: vertical; line-height: 1.75; }
.compose-form small { color: #7a8da0; font-size: 11px; font-weight: 400; line-height: 1.6; }
.compose-grid.two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.compose-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding-top: 2px; }
.compose-actions > span { margin-left: 3px; color: var(--c-muted); font-size: 11px; }
.compose-status { min-height: 22px; margin: 0; color: var(--c-muted); font-size: 12px; }
.compose-status.success { color: var(--c-jade); }
.compose-status.error { color: #a72d25; }

/* Admin community */
.community-admin-list { display: grid; gap: 13px; }
.community-admin-card { padding: 18px; border: 1px solid var(--m-line); border-radius: 14px; background: #fbfdff; }
.community-admin-card h3 { margin: 9px 0; font-size: 16px; }
.community-admin-card p { margin: 0; color: var(--m-muted); font-size: 12px; line-height: 1.7; white-space: pre-wrap; }
.community-admin-meta, .community-admin-actions { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.community-admin-meta { color: #6a7f92; font-size: 11px; }
.community-admin-actions { margin-top: 14px; }
.community-admin-review, .community-admin-report { display: grid; gap: 8px; margin-top: 14px; padding: 14px; border: 1px solid #dbe5ed; border-radius: 11px; background: #fff; }
.community-admin-review > strong, .community-admin-report > strong { color: var(--m-ink); font-size: 12px; }
.community-admin-review-meta { display: flex; flex-wrap: wrap; gap: 8px 14px; color: #6a7f92; font-size: 11px; }
.community-admin-body { max-height: 420px; overflow: auto; padding: 12px; border-radius: 9px; color: #273f53 !important; background: #f5f8fb; font-size: 13px !important; line-height: 1.85 !important; }
.community-admin-source { display: grid; gap: 5px; min-width: 0; }
.community-admin-source a { color: var(--m-blue); overflow-wrap: anywhere; }
.community-admin-source span { color: var(--m-muted); }

@media (max-width: 900px) {
  .post-layout { grid-template-columns: 1fr; }
  .post-side { position: static; }
  .comments-section { grid-column: auto; }
}
@media (max-width: 700px) {
  .community-shell { width: min(100% - 26px, 1140px); }
  .community-feed-section { padding: 28px 0 52px; }
  .community-index-head { display: grid; align-items: start; }
  .community-index-head h1 { font-size: 32px; }
  .community-filter-panel { top: 56px; grid-template-columns: 1fr; gap: 6px; }
  .community-type-tabs { width: 100%; overflow-x: auto; padding: 0 0 7px; border-right: 0; border-bottom: 1px solid var(--c-line); }
  .community-card { grid-template-columns: 1fr; padding: 16px; }
  .community-card > p { white-space: normal; }
  .community-card > p { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
  .community-card-meta { grid-column: 1; grid-row: auto; margin-top: 13px; padding-top: 11px; border-top: 1px solid #edf1f4; flex-direction: row; align-items: center; justify-content: space-between; white-space: normal; }
  .community-footer-inner { display: grid; }
  .post-hero { padding: 42px 0 34px; }
  .post-layout { gap: 22px; padding: 28px 0 62px; }
  .post-content { padding: 24px 19px; }
  .post-body { font-size: 15px; }
  .comments-head { display: grid; }
  .comment-card.reply { margin-left: 20px; }
  .compose-main { padding: 18px 0 46px; }
  .compose-editor { padding: 24px 17px; }
  .compose-form-head { display: grid; gap: 4px; }
  .compose-grid.two { grid-template-columns: 1fr; }
}
@media (max-width: 420px) {
  .compose-page .member-shell { width: min(100% - 24px, 1180px); }
  .compose-page .member-topbar { padding: 12px 0; }
  .compose-page .member-brand img { height: 34px; }
  .compose-page .member-link { padding: 9px 11px; font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .community-card { transition: none; }
}
