/* ==========================================================================
   bbs.css —— 社区前台样式（只在 BBS 页面加载，见 templates/header.html 的条件引入）
   视觉真源：docs/design/bbs/01-list.html（列表）、02-thread.html（主题页）
   约定：主色 #0B6B45、页面底色 #FBFAF6、卡片描边 #E3DED0、列表分隔线 #EFECE4；
        圆角照导出 HTML：卡片 3px、chip/按钮/徽章/分页 2px、头像与圆点 50%。
   所有类名统一 bbs- 前缀，避免与 skin.css 撞车。
   ========================================================================== */

/* 0 字体栈（不加载外部字体：与全站一致，只做本地回退） ------------------ */
/* 两个根节点都要声明：列表页根是 .bbs-body，主题页根是 .bbs-thread
   （主题页的 Crumbs / Page Head 在 .bbs-body 之外，只写在 .bbs-body 上会让
   var(--bbs-serif) 在页头失效 —— 34px 大标题会掉回默认无衬线字体）。 */
.bbs-body,
.bbs-thread {
  --bbs-mono: "IBM Plex Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --bbs-serif: "Noto Serif SC", "Songti SC", "STSong", "SimSun", serif;
}

.bbs-body {
  display: flex;
  align-items: flex-start;
  gap: 56px;              /* 设计稿 Body gap */
  padding-top: 36px;      /* 设计稿 Body padding: 36,140,88,140 */
  padding-bottom: 88px;
}

/* 1 两栏骨架 ------------------------------------------------------------ */
.bbs-main {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 44px;              /* 设计稿 Main Col gap */
}

.bbs-rail {
  flex: 0 0 320px;
  width: 320px;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  gap: 24px;              /* 设计稿 Rail gap */
}

/* 2 版块说明条（Section Intro 版块说明） -------------------------------- */
.bbs-intro {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  padding: 18px 24px;
  background: #F4F1E7;
  border-left: 3px solid #0B6B45;   /* 设计稿左侧 3px 绿条 */
  border-radius: 3px;                /* 卡片：Section Intro 版块说明 */
}

.bbs-intro-eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.bbs-dot {
  flex: 0 0 auto;
  width: 5px;
  height: 5px;
  background: #0B6B45;
  border-radius: 50%;     /* 装饰圆点（Eyebrow Dot / Meta Dot） */
}

.bbs-eyebrow-label {
  color: #0B6B45;
  font-family: var(--bbs-mono);
  font-size: 10px;
  letter-spacing: 2px;
  white-space: nowrap;
}

.bbs-eyebrow-rule {
  flex: 1 1 0;
  height: 1px;
  background: #DCD5C4;
}

.bbs-intro-lead {
  color: #1C1C1C;
  font-size: 14px;
  line-height: 25px;
}

.bbs-intro-sub {
  color: #565C56;
  font-size: 12.5px;
  line-height: 22px;
}

/* 3 筛选与排序（Section Head） ------------------------------------------ */
.bbs-section {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
}

.bbs-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  padding-bottom: 14px;
  border-bottom: 1px solid #1C1C1C;
}

.bbs-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

/* 版块 chip：未选白底细描边，选中深绿底白字 */
.bbs-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  color: #565C56;
  font-size: 11.5px;
  line-height: 1.2;
  white-space: nowrap;
  background: #FFFFFF;
  border: 1px solid #E6E1D6;
  border-radius: 2px;      /* chip */
}
.bbs-chip:hover {
  color: #0B6B45;
  border-color: #0B6B45;
}
.bbs-chip.is-on,
.bbs-chip.is-on:hover {
  color: #FFFFFF;
  background: #0B6B45;
  border-color: #0B6B45;
}

.bbs-sort {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 12px;
}

.bbs-sort-caption {
  color: #7A8078;
  font-family: var(--bbs-mono);
  font-size: 10px;
  letter-spacing: 2px;
  white-space: nowrap;
}

.bbs-sort-chips {
  display: flex;
  align-items: center;
  gap: 20px;
}

/* 排序项：选中项深绿文字 + 2px 绿色下划线（设计稿 Sort 最新回复） */
.bbs-sort-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  padding: 4px 0 7px;
  color: #7A8078;
  font-size: 12.5px;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  border-radius: 2px;      /* 排序 chip */
}
.bbs-sort-link:hover {
  color: #0B6B45;
}
.bbs-sort-link.is-on,
.bbs-sort-link.is-on:hover {
  color: #0B6B45;
  font-weight: 600;
  border-bottom-color: #0B6B45;
}

/* 4 主题列表行（Thread Row） -------------------------------------------- */
.bbs-list {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.bbs-row {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  padding: 18px 0;
  border-bottom: 1px solid #EFECE4;
}

/* 头像：36×36 正圆（50%）+ 首字 —— 与设计稿一致（导出 HTML 里是 18px on 36px 盒子） */
.bbs-avatar {
  display: flex;
  flex: 0 0 36px;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  color: #0B6B45;
  font-family: var(--bbs-serif);
  font-size: 14px;
  font-weight: 600;
  background: #E4DFCF;
  border-radius: 50%;      /* 头像：正圆（36px 盒子即 18px） */
}

.bbs-row-body {
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}

.bbs-row-titleline {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-width: 0;
}

.bbs-pin {
  flex: 0 0 auto;
  padding: 3px 7px;
  color: #FFFFFF;
  font-size: 10px;
  line-height: 1.2;
  white-space: nowrap;
  background: #0B6B45;
  border-radius: 2px;      /* 置顶徽章 */
}

.bbs-row-title {
  flex: 1 1 0;
  min-width: 0;
  overflow: hidden;
  color: #1D1F1C;
  font-size: 14.5px;
  font-weight: 500;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.bbs-row:hover .bbs-row-title {
  color: #0B6B45;
}

.bbs-row-excerpt {
  width: 100%;
  overflow: hidden;
  color: #7A8078;
  font-size: 12.5px;
  line-height: 21px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.bbs-row-meta {
  display: flex;
  align-items: center;
  gap: 9px;
  width: fit-content;
}

.bbs-row-author {
  color: #565C56;
  font-size: 11.5px;
  white-space: nowrap;
}

.bbs-meta-dot {
  flex: 0 0 auto;
  width: 3px;
  height: 3px;
  background: #D9D4C6;
  border-radius: 50%;
}

.bbs-row-time {
  color: #A6A196;
  font-family: var(--bbs-mono);
  font-size: 10.5px;
  white-space: nowrap;
}

.bbs-row-stats {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 22px;
}

.bbs-stat {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  width: 46px;
  text-align: right;
}

.bbs-stat-value {
  width: 100%;
  color: #1D1F1C;
  font-family: var(--bbs-mono);
  font-size: 13px;
  text-align: right;
}

.bbs-stat-label {
  width: 100%;
  color: #C2BDB2;
  font-size: 10px;
  text-align: right;
}

.bbs-empty {
  padding: 56px 0;
  color: #7A8078;
  font-size: 13px;
  text-align: center;
  border-bottom: 1px solid #EFECE4;
}
.bbs-empty a {
  color: #0B6B45;
}

/* 5 分页（Pagination Wrap） --------------------------------------------- */
.bbs-pager-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  padding-top: 24px;
}

.bbs-pager-info {
  color: #A6A196;
  font-family: var(--bbs-mono);
  font-size: 10.5px;
  white-space: nowrap;
}

.bbs-pager {
  display: flex;
  align-items: center;
  gap: 6px;
}

.bbs-page {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  color: #565C56;
  font-family: var(--bbs-mono);
  font-size: 11px;
  border: 1px solid transparent;
  border-radius: 2px;      /* 分页（当前页 / 其它页 / 上一页 / 下一页 / …） */
}
.bbs-page:hover {
  color: #0B6B45;
  border-color: #0B6B45;
}
.bbs-page.is-on,
.bbs-page.is-on:hover {
  color: #FBFAF6;
  background: #1D1F1C;
  border-color: #1D1F1C;
}

.bbs-page-arrow {
  border-color: #D9D4C6;
}
.bbs-page-arrow.is-prev {
  color: #A6A196;
  border-color: #E0DBCC;
}
.bbs-page-arrow.is-disabled {
  color: #C2BDB2;
  pointer-events: none;
}

.bbs-page-icon {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.bbs-page-dots {
  color: #565C56;
  border-color: transparent;
}

/* 6 右栏卡片 ------------------------------------------------------------ */
.bbs-notice {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  padding: 14px 16px;
  background: #F4F1E7;
  border: 1px solid #E7E4DB;
  border-radius: 3px;      /* 卡片：Notice Card */
}

.bbs-notice-eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
}

.bbs-notice-label {
  color: #8C887E;
  font-family: var(--bbs-mono);
  font-size: 10px;
  letter-spacing: 2px;
  white-space: nowrap;
}

.bbs-notice-text {
  color: #565C56;
  font-size: 11.5px;
  line-height: 20px;
}

/* 发帖 CTA：深色卡 + 深绿按钮（设计稿 Post CTA） */
.bbs-cta {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  padding: 22px 20px;
  background: #242838;
  border-radius: 3px;      /* 卡片：Post CTA */
}

.bbs-cta-eyebrow {
  color: #9BA6B8;
  font-family: var(--bbs-mono);
  font-size: 10px;
  letter-spacing: 2px;
  white-space: nowrap;
}

.bbs-cta-title {
  color: #FFFFFF;
  font-family: var(--bbs-serif);
  font-size: 21px;
  font-weight: 600;
  white-space: nowrap;
}

.bbs-cta-desc {
  color: #B9C0CE;
  font-size: 12px;
  line-height: 21px;
}

.bbs-cta-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 40px;
  color: #FFFFFF;
  font-size: 13px;
  font-weight: 500;
  background: #0B6B45;
  border-radius: 2px;      /* 主按钮 */
}
.bbs-cta-btn:hover {
  color: #FFFFFF;
  background: #094E33;
}

.bbs-cta-arrow {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* 热帖卡 */
.bbs-hot {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  padding: 22px;
  background: #FFFCF7;
  border: 1px solid #E3DED0;
  border-radius: 3px;      /* 卡片：Hot Card */
}

.bbs-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.bbs-card-title {
  color: #7A8078;
  font-size: 11px;
  letter-spacing: 2px;
  white-space: nowrap;
}

.bbs-card-meta {
  color: #C2BDB2;
  font-family: var(--bbs-mono);
  font-size: 10px;
  white-space: nowrap;
}

.bbs-hot-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  padding-bottom: 12px;
  border-bottom: 1px solid #F0EDE5;
}

.bbs-hot-rank {
  flex: 0 0 auto;
  color: #C2BDB2;
  font-family: var(--bbs-mono);
  font-size: 10px;
}

.bbs-hot-title {
  flex: 1 1 0;
  min-width: 0;
  overflow: hidden;
  color: #1D1F1C;
  font-size: 12.5px;
  line-height: 19px;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.bbs-hot-row:hover .bbs-hot-title {
  color: #0B6B45;
}

.bbs-hot-replies {
  flex: 0 0 auto;
  color: #8C887E;
  font-family: var(--bbs-mono);
  font-size: 10.5px;
}

.bbs-hot-empty {
  color: #8C887E;
  font-size: 11.5px;
  line-height: 19px;
}

/* 版规卡 */
.bbs-rules {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  padding: 22px;
  background: #F4F1E7;
  border-radius: 3px;      /* 卡片：Rules Card */
}

.bbs-rule {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  width: 100%;
}

.bbs-rule-num {
  flex: 0 0 auto;
  color: #C2BDB2;
  font-family: var(--bbs-mono);
  font-size: 10px;
}

.bbs-rule-text {
  flex: 1 1 0;
  color: #565C56;
  font-size: 11.5px;
  line-height: 19px;
}

.bbs-rules-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  color: #0B6B45;
  font-size: 11.5px;
}
.bbs-rules-link:hover {
  color: #094E33;
}

.bbs-rules-icon {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* 7 窄屏：右栏下沉（设计稿只有桌面稿，这里只做不破版的最小适配） ------ */
@media (max-width: 1080px) {
  .bbs-body {
    flex-direction: column;
    gap: 40px;
    padding-top: 24px;
    padding-bottom: 56px;
  }
  .bbs-main,
  .bbs-rail {
    width: 100%;
    flex: 0 0 auto;
    
  }
}

@media (max-width: 760px) {
  .bbs-rail {display: none;}
  .bbs-section-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }
  .bbs-intro {
    padding: 16px 18px;
    display: none;
  }
  .bbs-row-stats {
    display: none;
  }
  .bbs-pager-wrap {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ==========================================================================
   8 主题页（设计参照 docs/design/bbs/02-thread.html，frame「社区-内容」）
   ========================================================================== */
.bbs-thread {
  width: 100%;
}

/* 8.1 Crumbs（高 54、底部分隔线 #E7E4DB） -------------------------------- */
.bbs-crumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 53.5px;
  overflow: hidden;
  border-bottom: 1px solid #E7E4DB;
}

.bbs-crumb {
  color: #7A8078;
  font-size: 12px;
  white-space: nowrap;
}
.bbs-crumb:hover {
  color: #0B6B45;
}
.bbs-crumb.is-current {
  min-width: 0;
  overflow: hidden;
  color: #1D1F1C;
  text-overflow: ellipsis;
}

.bbs-crumb-sep {
  flex: 0 0 auto;
  width: 12px;
  height: 12px;
  fill: none;
  stroke: #C4C0B6;
  stroke-width: 1.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* 8.2 Page Head --------------------------------------------------------- */
.bbs-page-head {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding-top: 34px;
}

.bbs-head-eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* 主题页的 eyebrow 是 #8C887E（列表页才是深绿），作用域限定在这里 */
.bbs-page-head .bbs-eyebrow-label {
  color: #8C887E;
}

.bbs-head-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 48px;
}

.bbs-head-left {
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.bbs-thread-title {
  color: #1D1F1C;
  font-family: var(--bbs-serif);
  font-size: 34px;
  font-weight: 700;
  line-height: 46px;
  overflow-wrap: anywhere;
}

.bbs-poster-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.bbs-poster-meta-name {
  max-width: 40%;
  overflow: hidden;
  color: #1D1F1C;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.bbs-mono-muted {
  color: #A6A196;
  font-family: var(--bbs-mono);
  font-size: 10.5px;
  white-space: nowrap;
}

.bbs-head-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 10px;
}

/* 8.3 头像尺寸（设计稿：Page Head 26 / 主楼 40 / 回复 34 / 作者卡 44） --- */
.bbs-avatar--xs {
  flex: 0 0 26px;
  width: 26px;
  height: 26px;
  font-size: 11px;
}
.bbs-avatar--sm {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  font-size: 13px;
}
.bbs-avatar--md {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  font-size: 15px;
}
.bbs-avatar--lg {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  font-size: 16px;
}
.bbs-avatar--muted {
  color: #C2BDB2;
  background: #EFECE4;
}

/* 上传过头像时头像框里放图片：撑满正圆并裁切，首字版（无图）不受影响 */
.bbs-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

/* 8.4 按钮与图标（主按钮深绿、次按钮 1px 发丝描边） ---------------------- */
.bbs-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 38px;
  padding: 0 16px;
  font-family: inherit;
  font-size: 12.5px;
  white-space: nowrap;
  cursor: pointer;
  background: transparent;
  border: 0;
  border-radius: 2px;      /* 按钮 */
}
.bbs-btn--ghost {
  color: #565C56;
  box-shadow: inset 0 0 0 1px #D9D4C6;
}
.bbs-btn--ghost:hover {
  color: #0B6B45;
  box-shadow: inset 0 0 0 1px #0B6B45;
}
.bbs-btn--primary {
  padding: 0 20px;
  color: #FFFFFF;
  font-weight: 500;
  background: #0B6B45;
}
.bbs-btn--primary:hover {
  color: #FFFFFF;
  background: #094E33;
}
.bbs-btn.is-disabled {
  cursor: default;
  opacity: 0.6;
}

.bbs-icon {
  flex: 0 0 auto;
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* 8.5 主楼卡片（Post Card） --------------------------------------------- */
.bbs-main--thread {
  gap: 36px;              /* 设计稿内容页 Main Col gap */
}

.bbs-post-card {
  display: flex;
  flex-direction: column;
  gap: 22px;
  width: 100%;
  padding: 26px 30px;
  background: #FFFCF7;
  border: 1px solid #E3DED0;
  border-radius: 3px;      /* 卡片：Post Card */
}

.bbs-poster-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.bbs-poster {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.bbs-poster-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.bbs-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.bbs-poster-name {
  min-width: 0;
  overflow: hidden;
  color: #1D1F1C;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.bbs-poster-sub {
  color: #A6A196;
  font-family: var(--bbs-mono);
  font-size: 10.5px;
}

.bbs-floor {
  flex: 0 0 auto;
  color: #C2BDB2;
  font-family: var(--bbs-mono);
  font-size: 10.5px;
  white-space: nowrap;
}

.bbs-divider {
  width: 100%;
  height: 1px;
  background: #EFECE4;
}

.bbs-post-body {
  color: #3A3F3A;
  font-size: 14.5px;
  line-height: 28px;
  white-space: pre-wrap;   /* 正文是纯文本，换行原样保留（render_body 的输出） */
  overflow-wrap: anywhere;
}

.bbs-post-body a,
.bbs-reply-body a,
.bbs-quote-text a {
  color: #0B6B45;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* 游客视角的「登录后可见」遮罩（utils/bbs/render.py 输出的 span） */
.bbs-locked {
  padding: 0 4px;
  color: #8C887E;
  background: #F6F3EC;
  border-radius: 2px;
}

.bbs-post-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 16px;
  border-top: 1px solid #EFECE4;
}

.bbs-post-actions {
  display: flex;
  align-items: center;
  gap: 20px;
}

.bbs-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  color: #8C887E;
  font-family: inherit;
  font-size: 12px;
  white-space: nowrap;
  cursor: pointer;
  background: none;
  border: 0;
}
.bbs-action:hover {
  color: #0B6B45;
}
.bbs-action.is-on {
  color: #0B6B45;
}
/* 删除：与「有用/举报/编辑」并列，但用警示色区分（只在本人或管理员时渲染） */
.bbs-action--danger:hover {
  color: #B4472F;
}

/* 「我的帖子」行：右侧多一个删除按钮。
   按钮不能放进 <a>（非法嵌套 + 点删除会跳转），所以由外层 .bbs-my-row
   负责分隔线，内层 .bbs-row 只保留内容布局。 */
.bbs-my-row {
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid #EFECE4;
}

.bbs-my-row > .bbs-row {
  flex: 1 1 0;
  width: auto;
  min-width: 0;
  border-bottom: 0;
}

.bbs-row-del {
  flex: 0 0 auto;
  padding: 6px 10px;
  color: #7A8078;
  font-family: inherit;
  font-size: 11.5px;
  line-height: 1.2;
  white-space: nowrap;
  background: transparent;
  border: 1px solid #E0DBCC;
  border-radius: 2px;      /* chip */
  cursor: pointer;
  transition: color .18s, border-color .18s, background-color .18s;
}

.bbs-row-del:hover {
  color: #B4472F;
  background: #FDF6F2;
  border-color: #DDBBAE;
}

.bbs-row-del:focus-visible {
  outline: 2px solid #0B6B45;
  outline-offset: 2px;
}

.bbs-edit-note {
  color: #C2BDB2;
  font-family: var(--bbs-mono);
  font-size: 10.5px;
  white-space: nowrap;
}

/* 8.6 徽章（楼主 / 管理员 / 已采纳） ------------------------------------ */
.bbs-badge {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  padding: 2px 7px;
  font-size: 10px;
  line-height: 1.2;
  white-space: nowrap;
  border-radius: 2px;      /* 徽章 */
}
.bbs-badge--op,
.bbs-badge--solved {
  color: #0B6B45;
  background: #E4EFE8;
}
.bbs-badge--admin {
  padding: 2px 6px;
  color: #2F3B52;
  font-size: 9.5px;
  background: #E8ECF2;
}

/* 8.7 回复列表（Replies Section） --------------------------------------- */
.bbs-replies {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.bbs-replies-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid #1D1F1C;
}

.bbs-replies-title {
  color: #7A8078;
  font-size: 11px;
  letter-spacing: 2px;
  white-space: nowrap;
}

.bbs-reply-chips {
  display: flex;
  align-items: center;
  gap: 8px;
}

.bbs-reply-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  font-size: 11.5px;
  line-height: 1.2;
  white-space: nowrap;
  border-radius: 2px;      /* chip */
  cursor: pointer;         /* 三个 chip 都是可点链接（正序 / 最新 / 只看楼主） */
}
.bbs-reply-chip.is-on {
  color: #FBFAF6;
  background: #1D1F1C;
}
.bbs-reply-chip.is-off {
  color: #7A8078;
  background: #FFFCF7;
  box-shadow: inset 0 0 0 1px #E0DBCC;
}

.bbs-reply {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  width: 100%;
  padding: 20px 0;
  border-bottom: 1px solid #EFECE4;
}

.bbs-reply-main {
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.bbs-reply-head {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-width: 0;
}

.bbs-reply-author {
  min-width: 0;
  overflow: hidden;
  color: #1D1F1C;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.bbs-reply-author.is-muted {
  color: #A6A196;
  font-weight: 400;
}

.bbs-spacer {
  flex: 1 1 0;
  height: 2px;
}

.bbs-reply-body {
  color: #3A3F3A;
  font-size: 13.5px;
  line-height: 25px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* 引用块：底色 paper、左侧 2px 绿条（导出 HTML 实测 2px） */
.bbs-quote {
  display: flex;
  margin-left: -1px;
  padding: 10px 14px;
  background: #F6F3EC;
  border-left: 2px solid #0B6B45;
}

.bbs-quote-text {
  color: #7A8078;
  font-size: 12.5px;
  line-height: 22px;
  overflow-wrap: anywhere;
}

.bbs-reply-actions {
  display: flex;
  align-items: center;
  gap: 18px;
}

.bbs-reply--deleted .bbs-reply-main {
  gap: 0;
}

.bbs-replies-empty {
  padding: 40px 0;
  color: #A6A196;
  font-size: 12.5px;
  text-align: center;
  border-bottom: 1px solid #EFECE4;
}

.bbs-load-more-wrap {
  display: flex;
  justify-content: center;
  padding-top: 24px;
}

.bbs-load-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 26px;
  color: #565C56;
  font-size: 13px;
  border-radius: 2px;      /* 加载更多 */
  box-shadow: inset 0 0 0 1px #D9D4C6;
}
.bbs-load-more:hover {
  color: #0B6B45;
  box-shadow: inset 0 0 0 1px #0B6B45;
}
.bbs-load-more .bbs-icon {
  width: 14px;
  height: 14px;
}

/* 8.8 回复框（Reply Composer） ------------------------------------------ */
.bbs-composer {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  padding: 24px 26px;
  background: #FFFCF7;
  border: 1px solid #E3DED0;
  border-radius: 3px;      /* 卡片：Reply Composer */
}

.bbs-composer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.bbs-composer-title {
  color: #7A8078;
  font-size: 11px;
  letter-spacing: 2px;
  white-space: nowrap;
}

.bbs-composer-user {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  color: #A6A196;
  font-size: 11.5px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.bbs-editor {
  display: flex;
  flex-direction: column;
  width: 100%;
  background: #FFFCF7;
  border: 1px solid #D9D4C6;
  border-radius: 2px;      /* 编辑器 */
}

.bbs-editor-input {
  width: 100%;
  min-height: 112px;
  padding: 14px 16px;
  color: #1D1F1C;
  font-family: inherit;
  font-size: 13.5px;
  line-height: 25px;
  resize: vertical;
  background: transparent;
  border: 0;
}
.bbs-editor-input::placeholder {
  color: #A6A196;
}
.bbs-editor-input:focus {
  outline: none;
}

.bbs-composer-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.bbs-composer-buttons {
  display: flex;
  align-items: center;
  gap: 12px;
}
.bbs-composer-buttons .bbs-btn {
  height: 44px;
  padding: 0 26px;
  font-size: 14px;
}
.bbs-composer-buttons .bbs-btn--ghost {
  padding: 0 20px;
  color: #7A8078;
  font-size: 13px;
}

.bbs-composer-note {
  color: #A6A196;
  font-size: 11.5px;
}

.bbs-composer--notice {
  gap: 12px;
}

.bbs-composer-hint {
  color: #7A8078;
  font-size: 12.5px;
  line-height: 22px;
}

.bbs-composer-login {
  color: #0B6B45;
  font-size: 12.5px;
}

/* 8.9 右栏：作者卡 / 本贴数据 / 相似主题 / 站内相关资源 ------------------ */
.bbs-author-card,
.bbs-data-card,
.bbs-similar {
  display: flex;
  flex-direction: column;
  width: 100%;
  padding: 22px;
  background: #FFFCF7;
  border: 1px solid #E3DED0;
  border-radius: 3px;
}

.bbs-author-card {
  gap: 16px;
}

.bbs-author-top {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.bbs-author-info {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.bbs-author-name {
  overflow: hidden;
  color: #1D1F1C;
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.bbs-author-join {
  color: #A6A196;
  font-family: var(--bbs-mono);
  font-size: 10.5px;
}

.bbs-author-stats {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  width: 100%;
}

.bbs-rail-stat {
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  gap: 4px;
}

.bbs-rail-stat-value {
  color: #1D1F1C;
  font-family: var(--bbs-mono);
  font-size: 15px;
  font-weight: 500;
}

.bbs-rail-stat-label {
  color: #C2BDB2;
  font-size: 10px;
}

.bbs-data-card {
  gap: 14px;
}

.bbs-data-title {
  color: #7A8078;
  font-size: 11px;
  letter-spacing: 2px;
}

.bbs-data-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  width: 100%;
}

.bbs-data-item {
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  gap: 4px;
}

.bbs-data-value {
  color: #1D1F1C;
  font-family: var(--bbs-mono);
  font-size: 16px;
  font-weight: 500;
}

.bbs-data-label {
  color: #C2BDB2;
  font-size: 10px;
}

.bbs-similar {
  gap: 14px;
}

.bbs-similar-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  padding-bottom: 12px;
  border-bottom: 1px solid #F0EDE5;
}
.bbs-similar-row:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.bbs-similar-title {
  display: -webkit-box;
  flex: 1 1 0;
  min-width: 0;
  overflow: hidden;
  color: #1D1F1C;
  font-size: 12.5px;
  line-height: 19px;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.bbs-similar-row:hover .bbs-similar-title {
  color: #0B6B45;
}

.bbs-similar-replies {
  flex: 0 0 auto;
  color: #8C887E;
  font-family: var(--bbs-mono);
  font-size: 10.5px;
}

.bbs-related {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  padding: 22px;
  background: #F4F1E7;
  border-radius: 3px;      /* 卡片：Related Card（无描边） */
}

.bbs-related-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.bbs-related-name {
  flex: 1 1 0;
  min-width: 0;
  overflow: hidden;
  color: #1D1F1C;
  font-size: 12.5px;
  line-height: 19px;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.bbs-related-row:hover .bbs-related-name {
  color: #0B6B45;
}

.bbs-related-meta {
  flex: 0 0 auto;
  color: #8C887E;
  font-family: var(--bbs-mono);
  font-size: 10.5px;
}

.bbs-related .bbs-icon {
  width: 12px;
  height: 12px;
  color: #A6A196;
}

.bbs-related-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  color: #0B6B45;
  font-size: 11.5px;
}
.bbs-related-link:hover {
  color: #094E33;
}
.bbs-related-link .bbs-icon {
  color: #0B6B45;
}

.bbs-rail-empty {
  color: #8C887E;
  font-size: 11.5px;
  line-height: 19px;
}

/* 8.10 主题页窄屏 ------------------------------------------------------- */
@media (max-width: 900px) {
  .bbs-head-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
  }
  .bbs-thread-title {
    font-size: 18px;
    line-height: 38px;
  }
  .bbs-post-card,
  .bbs-composer {
    padding: 20px;
  }
  .bbs-reply-chips {
    display: none;
  }
  .bbs-post-footer {
    flex-wrap: wrap;
  }
}


/* ==========================================================================
   9 发帖页 / 编辑页 / 我的社区（设计参照 03-new.html、04-edit.html）
   这些页面的 Page Head 是 48px 大标题（.bbs-page-title-lg），与主题页的 34px 区分开。
   ========================================================================== */

/* 9.1 Page Head 的文字尺寸 ----------------------------------------------- */
.bbs-page-title-lg {
  color: #1D1F1C;
  font-family: var(--bbs-serif);
  font-size: 48px;
  font-weight: 700;
  line-height: 58px;
}

.bbs-page-title {
  color: #1D1F1C;
  font-family: var(--bbs-serif);
  font-size: 34px;
  font-weight: 700;
  line-height: 46px;
}

.bbs-page-lead {
  width: 100%;
  color: #565C56;
  font-size: 15px;
  line-height: 29px;
}

/* 9.2 主栏间距：发帖 32 / 编辑 28（与导出 HTML 的 Main Col gap 一致） ------ */
.bbs-main--form {
  gap: 32px;
}
.bbs-main--edit {
  gap: 28px;
}
.bbs-main--my {
  gap: 32px;
}

/* 9.3 Form Card：32 内边距、#FFFCF7 底、#E3DED0 描边、3px 圆角 ---------- */
.bbs-form-card {
  display: flex;
  flex-direction: column;
  gap: 26px;
  width: 100%;
  padding: 32px;
  background: #FFFCF7;
  border: 1px solid #E3DED0;
  border-radius: 3px;      /* 卡片：Form Card */
}

.bbs-form-notice {
  padding: 12px 14px;
  color: #7A8078;
  font-size: 12.5px;
  line-height: 20px;
  background: #F4F1E7;
  border-radius: 2px;
}

/* 9.4 表单字段 ----------------------------------------------------------- */
.bbs-field {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.bbs-field-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
}

.bbs-field-label {
  color: #7A8078;
  font-size: 11px;
  letter-spacing: 2px;
  white-space: nowrap;
}

/* 字数计数器：只做显示（真正的长度校验在服务端） */
.bbs-counter {
  color: #C2BDB2;
  font-family: var(--bbs-mono);
  font-size: 10.5px;
  white-space: nowrap;
}

.bbs-field-hint {
  color: #A6A196;
  font-size: 11.5px;
  line-height: 19px;
}

.bbs-input {
  width: 100%;
  height: 46px;
  padding: 0 16px;
  color: #1D1F1C;
  font-family: inherit;
  font-size: 14px;
  background: #FFFCF7;
  border: 1px solid #D9D4C6;
  border-radius: 2px;      /* 输入框 */
}
.bbs-input::placeholder {
  color: #A6A196;
  font-size: 13.5px;
}
.bbs-input:focus {
  outline: none;
  border-color: #0B6B45;
}

/* 版块下拉：去掉原生外观，用 12×12 的 chevron 做箭头（与设计稿图标同风格） */
.bbs-select {
  padding-right: 38px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.6 6 7.6l3-3' fill='none' stroke='%237A8078' stroke-width='1.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 12px 12px;
}

/* 发帖/编辑页的正文框高 300（设计稿 Editor Body 高度），比回复框高 */
.bbs-editor-input--lg {
  min-height: 300px;
}

/* 9.5 提交行 ------------------------------------------------------------- */
.bbs-submit-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
}

.bbs-submit-buttons {
  display: flex;
  align-items: center;
  gap: 12px;
}

.bbs-submit-note {
  color: #A6A196;
  font-size: 11.5px;
}
.bbs-submit-note a {
  color: #0B6B45;
}

/* 大按钮：发帖页「发布主题」/ 编辑页「保存修改」都是 50 高、左右 28 */
.bbs-btn--lg {
  height: 50px;
  padding: 0 28px;
  font-size: 14px;
}
.bbs-btn--ghost.bbs-btn--lg {
  padding: 0 16px;
}

/* 编辑页的「取消」在设计稿里是无描边的纯文字按钮（04-edit.html 的 Cancel） */
.bbs-btn--plain {
  padding: 0 16px;
  color: #7A8078;
}
.bbs-btn--plain:hover {
  color: #0B6B45;
}

/* 9.6 编辑页右上「已发布 · 上次编辑 …」 ---------------------------------- */
.bbs-edit-note-badge {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 9px;
  color: #A6A196;
  font-family: var(--bbs-mono);
  font-size: 10.5px;
  white-space: nowrap;
}

/* 9.7 编辑页右栏：帖子状态卡 / 修改须知卡 -------------------------------- */
.bbs-status-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  padding: 22px;
  background: #FFFCF7;
  border: 1px solid #E3DED0;
  border-radius: 3px;      /* 卡片：Status Card */
}

.bbs-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding-bottom: 10px;
  border-bottom: 1px solid #F0EDE5;
}
.bbs-status-row--last {
  padding-bottom: 0;
  border-bottom: 0;
}

.bbs-status-label {
  color: #7A8078;
  font-size: 11.5px;
  white-space: nowrap;
}

.bbs-status-value {
  color: #1D1F1C;
  font-family: var(--bbs-mono);
  font-size: 11.5px;
  text-align: right;
}
.bbs-status-value--green {
  color: #0B6B45;
}

.bbs-tips-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  padding: 22px;
  background: #F4F1E7;
  border-radius: 3px;      /* 卡片：Tips Card（与版规卡同底色，无描边） */
}

/* 9.8 发帖页右栏「列表预览」卡 ------------------------------------------ */
.bbs-preview-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  padding: 22px;
  background: #FFFCF7;
  border: 1px solid #E3DED0;
  border-radius: 3px;      /* 卡片：Preview Card */
}

.bbs-preview-desc {
  color: #8C887E;
  font-size: 11.5px;
  line-height: 20px;
}

.bbs-preview-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 16px;
  background: #F6F3EC;
  border-radius: 2px;      /* 预览行 */
}

.bbs-preview-avatar {
  display: flex;
  flex: 0 0 30px;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  color: #0B6B45;
  font-family: var(--bbs-serif);
  font-size: 12px;
  font-weight: 600;
  background: #E4DFCF;
  border-radius: 50%;      /* 头像：正圆 */
  overflow: hidden;        /* 上传过头像时图片裁在圆内 */
}

.bbs-preview-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.bbs-preview-body {
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.bbs-preview-title {
  width: 100%;
  overflow: hidden;
  color: #1D1F1C;
  font-size: 13px;
  line-height: 20px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.bbs-preview-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.bbs-preview-author {
  color: #A6A196;
  font-size: 10.5px;
  white-space: nowrap;
}

.bbs-preview-time {
  color: #A6A196;
  font-family: var(--bbs-mono);
  font-size: 10px;
  white-space: nowrap;
}

/* 9.9 我的社区：工具条上的「共 N 条」 ------------------------------------ */
.bbs-my-total {
  flex: 0 0 auto;
  color: #A6A196;
  font-family: var(--bbs-mono);
  font-size: 10.5px;
  white-space: nowrap;
}

/* 9.10 窄屏 -------------------------------------------------------------- */
@media (max-width: 900px) {
  .bbs-page-title-lg {
    font-size: 32px;
    line-height: 42px;
  }
  .bbs-page-title {
    font-size: 27px;
    line-height: 38px;
  }
  .bbs-page-lead {
    font-size: 14px;
    line-height: 25px;
  }
  .bbs-form-card {
    padding: 20px;
    gap: 22px;
  }
  .bbs-editor-input--lg {
    min-height: 220px;
  }
  .bbs-submit-row {
    flex-direction: column;
    align-items: flex-start;
  }
}


/* ==========================================================================
   10 移动端浮动发帖按钮（只在 /bbs/ 列表页与 /bbs/t/{id} 主题页出现）

   设计要点：
   - **只在窄屏显示**（≤900px，与主题页断点一致）：桌面端右栏已有「发布新帖」CTA
     卡片，再加一个浮动按钮是重复入口。
   - 位置要让开「返回顶部」（.to-top，right 24 / bottom 28）：两者都固定在右下角，
     叠在一起会互相遮挡。发帖按钮放在它上面，间距 12px。
   - `env(safe-area-inset-*)` 兜住 iPhone 的刘海/home 条。
   - 高度 48px 是移动端最小可点尺寸（低于 44 会点不准）。
   - 主题页**不做吸底**：回复框在页面里，浮动按钮不会挡住它。
   ========================================================================== */
.bbs-fab {
  position: fixed;
  right: 16px;
  /* 返回顶部按钮占 42px + 底部 28px，这里再往上让 12px，两者不重叠 */
  bottom: calc(28px + 42px + 12px + env(safe-area-inset-bottom, 0px));
  z-index: 190;                     /* 低于 .to-top(200)，避免盖住它 */
  display: none;                    /* 桌面端不显示，见下面的媒体查询 */
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  padding: 0;
  color: #FFFFFF;
  background: #0B6B45;
  border: 0;
  border-radius: 50%;
  box-shadow: 0 8px 22px rgba(11, 107, 69, .28);
  cursor: pointer;
  /* 触屏没有 hover，用按下态给反馈 */
  transition: transform .12s ease, background-color .18s ease;
  -webkit-tap-highlight-color: transparent;
}

.bbs-fab:active {
  background: #094E33;
  transform: scale(.94);
}

.bbs-fab:focus-visible {
  outline: 2px solid #0B6B45;
  outline-offset: 3px;
}

.bbs-fab-icon {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* 只在移动端出现（与主题页的 900px 断点保持一致） */
@media (max-width: 900px) {
  .bbs-fab {
    display: flex;
  }
  .bbs-intro{display: none;}
}
