/* ============================================================
   安全快答 · 安全社区论坛 - 专属样式
   设计系统复用 style.css 的 CSS 变量（安全深蓝 + 警示红 + 警示黄）
   板块列表采用 Discuz 经典模式：板块卡片 / 主题列表行 / 侧栏
   ============================================================ */

/* ---------- 论坛通用 ---------- */
.forum-wrap { background: var(--bg-light); }
.forum-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px; margin-bottom: 20px;
}
.forum-toolbar .ft-left { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.forum-toolbar .ft-count { font-size: 13px; color: var(--gray); }
.forum-toolbar .ft-count b { color: var(--primary); }

.avatar {
  width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 17px;
}
.avatar--sm { width: 30px; height: 30px; font-size: 13px; }
.rank-badge {
  display: inline-block; padding: 1px 8px; border-radius: 3px;
  font-size: 11px; font-weight: 600; color: #fff; letter-spacing: .5px;
}

/* 帖子标记标签：置顶 / 精华 */
.t-mark {
  display: inline-block; padding: 1px 7px; border-radius: 3px;
  font-size: 11px; font-weight: 700; line-height: 1.6; margin-right: 6px;
}
.t-mark--sticky { background: var(--amber); color: #5a3a00; }
.t-mark--essence { background: #FBEBEC; color: var(--accent); border: 1px solid #F3C3C9; }

/* ---------- 论坛首页：板块总览 ---------- */
.board-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px;
}
.board-card {
  display: flex; align-items: center; gap: 16px;
  background: #fff; border: 1px solid var(--line); border-radius: 8px;
  padding: 20px 22px; box-shadow: var(--shadow);
  transition: box-shadow .25s ease, transform .2s ease, border-color .2s ease;
}
.board-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-3px); border-color: var(--primary-light); }
.board-ico {
  width: 54px; height: 54px; flex-shrink: 0; border-radius: 12px;
  display: flex; align-items: center; justify-content: center; font-size: 26px;
  background: var(--sky); border: 1px solid #C9DDF0;
}
.board-main { flex: 1; min-width: 0; }
.board-name { font-size: 17px; font-weight: 700; color: var(--primary-dark); display: flex; align-items: baseline; gap: 8px; }
.board-name .board-en { font-size: 12px; font-weight: 600; color: var(--gray-light); letter-spacing: 1px; }
.board-desc {
  font-size: 13px; color: var(--gray); margin: 5px 0 8px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.board-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.board-stat { display: flex; gap: 18px; flex-shrink: 0; text-align: center; }
.board-stat div { display: flex; flex-direction: column; }
.board-stat b { font-size: 18px; color: var(--primary); line-height: 1.1; }
.board-stat span { font-size: 12px; color: var(--gray-light); }

/* ---------- 列表布局：主内容 + 侧栏 ---------- */
.forum-layout { display: grid; grid-template-columns: 1fr 320px; gap: 28px; align-items: start; }

/* 主题列表行 */
.thread-list { background: #fff; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; box-shadow: var(--shadow); }
.thread-head {
  display: grid; grid-template-columns: 1fr 190px 150px;
  gap: 12px; padding: 12px 20px; background: var(--bg-light);
  border-bottom: 1px solid var(--line); font-size: 12px; color: var(--gray); font-weight: 600;
}
.thread-item {
  display: grid; grid-template-columns: 1fr 190px 150px;
  gap: 12px; padding: 16px 20px; border-bottom: 1px dashed var(--line);
  align-items: center; transition: background .15s ease;
}
.thread-cols { display: flex; }
.thread-cols .thread-col { flex: 1; }
.thread-item:last-child { border-bottom: none; }
.thread-item:hover { background: var(--sky); }
.thread-main { min-width: 0; }
.thread-title {
  font-size: 15.5px; font-weight: 600; color: var(--primary-dark);
  display: block; margin-bottom: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.thread-title:hover { color: var(--accent); }
.thread-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 12.5px; color: var(--gray-light); }
.thread-meta .author { color: var(--primary); font-weight: 600; }
.thread-meta .tags { display: flex; gap: 5px; }
.thread-meta .tags .tag { padding: 1px 8px; font-size: 11px; }
.thread-col { text-align: center; font-size: 13px; color: var(--gray); }
.thread-col b { display: block; font-size: 16px; color: var(--primary); line-height: 1.2; }
.thread-col span { font-size: 11px; color: var(--gray-light); }
.thread-last { text-align: right; font-size: 12.5px; color: var(--gray); min-width: 0; }
.thread-last .who { color: var(--primary); font-weight: 600; }
.thread-last .time { color: var(--gray-light); display: block; margin-top: 2px; }

/* 列表为空 */
.thread-empty { padding: 60px 20px; text-align: center; color: var(--gray-light); }

/* ---------- 筛选栏 ---------- */
.filter-bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.filter-btn {
  padding: 7px 18px; border: 1px solid var(--line); border-radius: 999px;
  background: #fff; font-size: 13.5px; font-weight: 600; color: var(--gray); cursor: pointer;
  transition: all .2s ease;
}
.filter-btn:hover { border-color: var(--primary); color: var(--primary); }
.filter-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.filter-sep { width: 1px; height: 22px; background: var(--line); margin: 0 4px; }
.filter-tags { display: flex; gap: 8px; flex-wrap: wrap; }
.tag-chip {
  padding: 5px 14px; border: 1px solid var(--line); border-radius: 999px;
  background: #fff; font-size: 12.5px; color: var(--gray); cursor: pointer; transition: all .2s ease;
}
.tag-chip:hover { border-color: var(--primary); color: var(--primary); }
.tag-chip.active { background: var(--sky); border-color: var(--primary-light); color: var(--primary); font-weight: 600; }
.forum-search {
  margin-left: auto; display: flex; align-items: center; gap: 8px;
  border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; background: #fff;
}
.forum-search input { border: none; outline: none; font-size: 13.5px; width: 180px; font-family: inherit; background: transparent; }
.forum-search button { border: none; background: transparent; cursor: pointer; color: var(--primary); font-size: 15px; }

/* ---------- 板块头 ---------- */
.board-hero {
  display: flex; align-items: center; gap: 18px;
  background: #fff; border: 1px solid var(--line); border-radius: 8px;
  padding: 22px 24px; box-shadow: var(--shadow); margin-bottom: 18px;
}
.board-hero .board-ico { width: 60px; height: 60px; font-size: 30px; }
.board-hero-main { flex: 1; min-width: 0; }
.board-hero-main h2 { font-size: 22px; margin-bottom: 4px; }
.board-hero-main p { font-size: 13.5px; color: var(--gray); }
.board-hero-stats { display: flex; gap: 26px; flex-shrink: 0; text-align: center; }
.board-hero-stats div b { display: block; font-size: 22px; color: var(--primary); }
.board-hero-stats div span { font-size: 12px; color: var(--gray-light); }

/* ---------- 侧栏组件 ---------- */
.forum-side { display: flex; flex-direction: column; gap: 18px; }
.side-widget {
  background: #fff; border: 1px solid var(--line); border-radius: 8px;
  box-shadow: var(--shadow); overflow: hidden;
}
.side-widget h3 {
  font-size: 15px; padding: 14px 18px; margin: 0; color: #fff;
  background: linear-gradient(120deg, var(--primary-deep), var(--primary));
  display: flex; align-items: center; gap: 8px;
}
.side-widget h3::before { content: ""; width: 4px; height: 16px; background: var(--amber); border-radius: 2px; }
.side-widget .side-body { padding: 16px 18px; }
.side-body .side-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 13.5px; color: var(--gray);
}
.side-body .side-row:last-child { border-bottom: none; }
.side-body .side-row b { color: var(--primary); font-size: 16px; }
.side-body .side-row .lab { display: flex; align-items: center; gap: 8px; }

/* 社区数据小卡 */
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line); border-radius: 8px; overflow: hidden; }
.stat-grid .s-cell { background: #fff; padding: 16px 12px; text-align: center; }
.stat-grid .s-cell b { display: block; font-size: 22px; color: var(--primary); line-height: 1.2; }
.stat-grid .s-cell span { font-size: 12px; color: var(--gray-light); }

/* 热门标签云 */
.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-cloud a {
  padding: 5px 13px; border-radius: 999px; background: var(--bg-light);
  border: 1px solid var(--line); font-size: 13px; color: var(--gray); transition: all .2s ease;
}
.tag-cloud a:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

/* 侧栏热帖 */
.hot-item { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.hot-item:last-child { border-bottom: none; }
.hot-rank { width: 22px; height: 22px; flex-shrink: 0; border-radius: 4px; background: var(--bg-light); color: var(--gray); font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.hot-item:nth-child(1) .hot-rank { background: var(--accent); color: #fff; }
.hot-item:nth-child(2) .hot-rank { background: var(--amber); color: #5a3a00; }
.hot-item:nth-child(3) .hot-rank { background: var(--primary); color: #fff; }
.hot-item a { font-size: 13.5px; color: var(--ink); line-height: 1.4; }
.hot-item a:hover { color: var(--accent); }

/* 登录卡 */
.login-card { text-align: center; }
.login-card p { font-size: 13px; color: var(--gray); margin-bottom: 14px; }
.login-card .btn { width: 100%; margin-bottom: 10px; }
.login-card .login-tip { font-size: 12px; color: var(--gray-light); margin: 0; }

/* 板块公告 */
.notice-list li { position: relative; padding-left: 18px; font-size: 13px; color: var(--gray); margin-bottom: 10px; line-height: 1.6; }
.notice-list li::before { content: "📌"; position: absolute; left: 0; top: 0; }

/* 面板容器（首页主区列表） */
.panel { background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); overflow: hidden; margin-bottom: 22px; }
.panel-head {
  font-size: 15px; padding: 14px 18px; margin: 0; color: #fff;
  background: linear-gradient(120deg, var(--primary-deep), var(--primary));
  display: flex; align-items: center; gap: 8px;
}
.panel-head::before { content: ""; width: 4px; height: 16px; background: var(--amber); border-radius: 2px; }
.thread-list.flush { border: none; border-radius: 0; box-shadow: none; }

/* ---------- Toast 提示（演示模块占位） ---------- */
.toast {
  position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%) translateY(20px);
  background: var(--primary-deep); color: #fff; padding: 12px 22px; border-radius: 8px;
  font-size: 14px; box-shadow: var(--shadow-lg); z-index: 300; opacity: 0;
  transition: all .25s ease; pointer-events: none; max-width: 90vw;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- 响应式 ---------- */
@media (max-width: 1024px) {
  .forum-layout { grid-template-columns: 1fr; }
  .forum-side { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
  .board-hero-stats { gap: 18px; }
}
@media (max-width: 768px) {
  .board-grid { grid-template-columns: 1fr; }
  .forum-side { grid-template-columns: 1fr; }
  .thread-head { display: none; }
  .thread-item { grid-template-columns: 1fr auto; grid-template-areas: "main last" "cols cols"; gap: 8px 12px; }
  .thread-main { grid-area: main; }
  .thread-last { grid-area: last; text-align: right; }
  .thread-cols { grid-area: cols; display: flex; gap: 18px; }
  .thread-cols .thread-col { text-align: left; }
  .thread-cols .thread-col b { display: inline; font-size: 14px; }
  .board-hero { flex-wrap: wrap; }
  .board-hero-stats { width: 100%; justify-content: space-around; }
  .forum-search { margin-left: 0; width: 100%; }
  .forum-search input { width: 100%; }
}
@media (max-width: 480px) {
  .board-card { flex-wrap: wrap; }
  .board-stat { width: 100%; justify-content: flex-start; }
}

/* ============================================================
   主题详情页 / 楼层 / 回复框 / 404
   ============================================================ */
.thread-detail {
  background: #fff; border: 1px solid var(--line); border-radius: 8px;
  box-shadow: var(--shadow); overflow: hidden;
}
.thread-detail #threadHead { padding: 24px 26px 16px; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, var(--sky), #fff); }
.thread-detail-title { font-size: 23px; line-height: 1.4; margin-bottom: 12px; color: var(--primary-dark); }
.thread-detail-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; font-size: 13px; color: var(--gray); }
.thread-detail-meta .td-author { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--primary); }
.thread-detail-meta .td-board a { color: var(--primary); }
.thread-detail-meta .td-stat { color: var(--gray-light); }
.thread-detail-meta .td-tags { display: inline-flex; gap: 6px; }

/* 楼层 */
.floor { display: grid; grid-template-columns: 160px 1fr; gap: 18px; padding: 22px 26px; border-bottom: 1px dashed var(--line); }
.floor:last-child { border-bottom: none; }
.floor[data-op="1"] { background: #FCFDFF; }
.floor-side { text-align: center; border-right: 1px solid var(--line); padding-right: 16px; }
.floor-side .avatar { margin: 0 auto 8px; }
.floor-name { font-size: 14px; font-weight: 700; color: var(--primary-dark); margin-bottom: 6px; word-break: break-all; }
.floor-side .rank-badge { margin-bottom: 8px; }
.floor-no { font-size: 12px; color: var(--gray-light); }
.floor-main { min-width: 0; }
.floor-content { font-size: 15px; color: var(--ink); line-height: 1.85; }
.floor-content p { margin-bottom: 10px; color: var(--ink); }
.floor-content p:last-child { margin-bottom: 0; }
.block-h { font-size: 16px; color: var(--primary-dark); margin: 16px 0 8px; padding-left: 10px; border-left: 4px solid var(--accent); }
.block-h:first-child { margin-top: 0; }
.block-ul { margin: 0 0 10px; }
.block-ul li { position: relative; padding-left: 20px; margin-bottom: 6px; color: var(--gray); font-size: 14.5px; }
.block-ul li::before { content: "▸"; position: absolute; left: 2px; color: var(--primary); font-weight: 700; }
.floor-quote {
  background: var(--bg-light); border-left: 3px solid var(--primary-light);
  padding: 10px 14px; margin-bottom: 12px; font-size: 13.5px; color: var(--gray);
  border-radius: 0 4px 4px 0;
}
.floor-foot { margin-top: 14px; display: flex; align-items: center; justify-content: space-between; font-size: 12.5px; color: var(--gray-light); }
.floor-foot .floor-ops a { color: var(--primary); font-weight: 600; }
.floor-foot .floor-ops a:hover { color: var(--accent); }

/* 加载更多 */
.load-more { text-align: center; padding: 18px; border-top: 1px solid var(--line); }
.floor-sentinel { height: 1px; }

/* 回复框 */
.reply-box { padding: 22px 26px; border-top: 3px solid var(--sky); background: var(--bg-light); }
.reply-head { font-size: 15px; font-weight: 700; color: var(--primary-dark); margin-bottom: 12px; }
.quote-hint { font-size: 13px; color: var(--gray); background: #fff; border: 1px dashed var(--line); border-radius: 6px; padding: 8px 12px; margin-bottom: 10px; }
.quote-hint a { color: var(--accent); margin-left: 8px; }
.reply-actions { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; gap: 12px; }
.reply-tip { font-size: 12.5px; color: var(--gray-light); }

/* 详情 404 兜底 */
.thread-404 { max-width: 560px; margin: 60px auto; text-align: center; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); padding: 48px 30px; }
.thread-404 .t404-icon { font-size: 46px; margin-bottom: 12px; }
.thread-404 h2 { font-size: 22px; margin-bottom: 10px; }
.thread-404 p { color: var(--gray); margin-bottom: 22px; }
.thread-404 .t404-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

@media (max-width: 768px) {
  .floor { grid-template-columns: 1fr; gap: 12px; padding: 18px; }
  .floor-side { display: flex; align-items: center; gap: 10px; text-align: left; border-right: none; border-bottom: 1px solid var(--line); padding: 0 0 10px; }
  .floor-side .avatar { margin: 0; }
  .floor-name { margin: 0; }
  .floor-no { margin-left: auto; }
  .thread-detail #threadHead { padding: 18px; }
  .thread-detail-title { font-size: 19px; }
  .reply-box { padding: 18px; }
  .reply-actions { flex-direction: column; align-items: stretch; }
  .reply-actions .btn { width: 100%; }
}
