/* ============================================================
   DaiWAF 企业站 · 帖子详情页
   结构：面包屑 → 主帖 → env-box → 楼层 → 采纳 → 回复编辑器（双模式 + 富文本）
   徽章/分页公共样式见 common.css
   ============================================================ */

/* ---------------- 页面容器与面包屑 ---------------- */
.post-page { max-width: 1200px; margin: 0 auto; padding: 104px 24px 64px; }
.crumbs { font-size: 13px; color: var(--text-light); margin-bottom: 18px; }
.crumbs a { color: var(--text-light); }
.crumbs a:hover { color: var(--primary); }

/* 审核中横幅（帖主查看待审核帖子时展示） */
.audit-banner {
  margin-bottom: 18px; padding: 12px 16px; border: 1px solid #F1E3BC;
  background: #FFF9EC; border-radius: 10px; font-size: 13.5px; color: #8A6D1F;
}

/* ---------------- 主帖 ---------------- */
.thread-card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 32px; }
.thread-head h1 { font-size: 22px; line-height: 1.45; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.thread-meta {
  display: flex;
  gap: 18px;
  font-size: 13px;
  color: var(--text-light);
  margin-top: 16px;
  flex-wrap: wrap;
  align-items: center;
}
.thread-meta .mini-avatar {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2B6BFF, #22D3EE);
  color: #fff;
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}
.thread-body { margin-top: 24px; font-size: 14px; line-height: 1.9; display: grid; gap: 14px; }
.thread-card pre, .reply-text pre {
  overflow-x: auto;
  max-width: 100%;
  background: #0F172A;
  color: #DCE6FF;
  border-radius: 12px;
  padding: 16px 18px;
  font-size: 13px;
  font-family: ui-monospace, 'Cascadia Code', Consolas, monospace;
  line-height: 1.7;
}
.thread-body ul { padding-left: 20px; color: var(--text-sub); display: grid; gap: 6px; }
.thread-card img, .reply-text img { max-width: 100%; height: auto; }

/* env-box：extra_fields 条件渲染块（仅非空时由模板输出） */
.env-box { background: #F6F9FF; border: 1px solid #DCE7FB; border-radius: 10px; padding: 15px 18px; margin: 2px 0; }
.env-box h4 { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 700; color: #2B5FD9; margin-bottom: 6px; }
.env-box h4 svg { width: 14px; height: 14px; flex: none; }
.env-row { display: flex; gap: 14px; font-size: 13.5px; line-height: 1.9; }
.env-row span { flex: none; width: 62px; color: var(--text-light); }
.env-row b { font-weight: 600; color: var(--text); }

/* ---------------- 主帖操作 ---------------- */
.thread-actions {
  display: flex;
  gap: 12px;
  margin-top: 26px;
  padding-top: 20px;
  border-top: 1px dashed var(--line);
}
.act-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg);
  font-size: 13px;
  color: var(--text-sub);
  cursor: pointer;
  transition: all .2s;
}
.act-btn:hover { border-color: var(--primary); color: var(--primary); }
.act-btn.on { border-color: var(--primary); color: var(--primary); background: #EAF0FF; }
.act-btn.act-danger { color: #E5484D; }
.act-btn.act-danger:hover { border-color: #E5484D; color: #fff; background: #E5484D; }

/* ---------------- 楼层 ---------------- */
.reply-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin: 34px 0 14px;
}
.reply-head h2 { font-size: 17px; }
.reply-head span { font-size: 12px; color: var(--text-light); }
.reply-list { display: flex; flex-direction: column; gap: 12px; }
.reply {
  display: flex;
  gap: 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px;
  position: relative;
  scroll-margin-top: 90px;
}
.reply.accepted { border-color: #6EE7B7; background: linear-gradient(180deg, #F0FDF4 0%, #fff 90%); }
.accept-badge {
  position: absolute;
  top: -11px; right: 18px;
  background: #10B981;
  color: #fff;
  font-size: 11px;
  padding: 3px 12px;
  border-radius: 999px;
  font-weight: 600;
}
.reply-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 14px;
}
.ra-1 { background: linear-gradient(135deg, #2B6BFF, #6C8CFF); }
.ra-2 { background: linear-gradient(135deg, #7C5CFF, #B08CFF); }
.ra-3 { background: linear-gradient(135deg, #0891B2, #22D3EE); }
.reply-avatar.official { box-shadow: 0 0 0 2px #F59E0B; }
.reply-main { flex: 1; min-width: 0; }
.reply-user { font-size: 13px; font-weight: 700; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.reply-time { font-size: 12px; color: var(--text-light); font-weight: 400; }
.tag-official {
  font-size: 10px;
  background: #FFF7ED;
  color: #C2410C;
  border: 1px solid #FED7AA;
  padding: 1px 8px;
  border-radius: 999px;
}
.reply-floor { margin-left: auto; font-size: 12px; color: var(--text-light); font-weight: 400; }
.reply-text { font-size: 14px; line-height: 1.8; margin-top: 8px; }
.reply-ops { display: flex; gap: 18px; margin-top: 12px; }
.reply-ops button {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-light);
  font-size: 12px;
  display: flex;
  gap: 5px;
  align-items: center;
  padding: 0;
  transition: color .2s;
}
.reply-ops button:hover, .reply-ops button.on { color: var(--primary); }
.reply-ops button.js-adopt { color: #0E9F6E; }
.reply-ops button.js-adopt:hover { background: #E7F8F1; border-color: rgba(14, 159, 110, .4); border-radius: 999px; padding: 2px 10px; }
.reply.accepted .js-adopt { display: none; }

/* 引用块与编辑器引用预览 */
.quote-block {
  background: var(--bg);
  border-left: 3px solid #C7D6FF;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 12px;
  color: var(--text-light);
  margin-bottom: 10px;
  line-height: 1.7;
}
.quote-block b { color: var(--text-sub); }
.quote-preview { position: relative; margin-bottom: 12px; }
.quote-remove {
  margin-top: 8px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 12px;
  color: var(--text-light);
  padding: 0;
}
.quote-remove:hover { color: #B91C1C; }

/* ---------------- 回复编辑器（快速 / 高级双模式） ---------------- */
.reply-editor { margin-top: 26px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 24px; }
.reply-editor h3 { font-size: 15px; margin-bottom: 14px; }
.reply-editor textarea {
  width: 100%;
  min-height: 116px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  font-size: 14px;
  resize: vertical;
  font-family: inherit;
  background: var(--bg);
  color: var(--text);
}
.reply-editor textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(43, 107, 255, .12); background: #fff; }
.editor-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 14px;
  font-size: 12px;
  color: var(--text-light);
}
.mode-tabs { display: flex; gap: 8px; margin-bottom: 14px; }
.mode-tabs button {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 20px;
  padding: 6px 18px;
  font-size: 13px;
  color: var(--text-sub);
  cursor: pointer;
}
.mode-tabs button.on { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }

.ico { width: 14px; height: 14px; vertical-align: -2px; margin-right: 4px; }

/* forum-editor 表情包图片（正文/楼层内容渲染） */
.thread-body img.fe-emoji,
.reply-text img.fe-emoji { display: inline-block; width: 22px; height: 22px; margin: 0 2px; border-radius: 0; vertical-align: -5px; }

/* ---------------- 响应式 ---------------- */
@media (max-width: 1024px) {
  .post-page { padding-top: 92px; }
}
@media (max-width: 640px) {
  .post-page { padding: 96px 24px 48px; }
  .thread-card { padding: 20px 14px; }
  .thread-card h1 { font-size: 20px; line-height: 1.45; }
  .thread-meta { flex-wrap: wrap; gap: 4px 12px; }
  .reply { padding: 14px 12px; }
  .reply-editor { padding: 16px 12px; }
  .rte-bar { flex-wrap: wrap; gap: 3px; }
  .emoji-panel.open { grid-template-columns: repeat(6, 1fr); }
  .env-box { padding: 12px 14px; }
}
