/* forum.css — 论坛列表 + 帖子详情 */
.forumview{flex:1;overflow-y:auto;padding:0 16px}
.forum-hd{padding:24px 0 14px}
.forum-title{
  margin:0;display:flex;align-items:center;gap:8px;
  font-size:20px;font-weight:700;color:hsl(var(--text-main));letter-spacing:-.01em;
}
.forum-title .ic{color:hsl(var(--primary))}
.forum-sub{font-size:12.5px;color:hsl(var(--text-secondary));margin-top:5px}

.forum-main{display:grid;grid-template-columns:1fr;gap:14px;align-items:start}
@media(min-width:860px){.forum-main{grid-template-columns:200px 1fr}}

/* 板块导航 */
.fsecs{display:flex;flex-direction:column;gap:2px;position:sticky;top:14px}
@media(max-width:859px){
  .fsecs{flex-direction:row;overflow-x:auto;position:static;gap:6px;padding-bottom:4px;scrollbar-width:none}
  .fsecs::-webkit-scrollbar{display:none}
}
.fsec{
  display:flex;flex-direction:column;gap:2px;padding:8px 11px;border-radius:9px;
  transition:background .15s,color .15s;flex:none;
}
.fsec:hover{background:hsl(var(--secondary))}
.fsec.on{background:hsl(var(--primary)/.10)}
.fsec.on .fsec-n{color:hsl(var(--primary));font-weight:600}
.fsec-n{font-size:13px;color:hsl(var(--text-main));white-space:nowrap}
.fsec-d{font-size:10.5px;color:hsl(var(--text-secondary));line-height:1.4;
  overflow:hidden;display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical}
@media(max-width:859px){.fsec-d{display:none}}

/* 帖子列表 */
.postlist{display:flex;flex-direction:column;gap:8px;min-width:0}
.postrow{
  display:flex;gap:12px;align-items:flex-start;
  padding:14px;border-radius:12px;border:1px solid hsl(var(--border));
  background:hsl(var(--card));transition:border-color .15s,transform .15s;
}
.postrow:hover{border-color:hsl(var(--primary)/.45);transform:translateY(-1px)}
.pr-main{flex:1;min-width:0;display:flex;flex-direction:column;gap:6px}
.pr-title{
  font-size:14px;font-weight:600;line-height:1.45;color:hsl(var(--text-main));
  display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;
}
.pr-pin{
  display:inline-flex;align-items:center;gap:2px;height:16px;padding:0 5px;
  border-radius:4px;background:hsl(var(--warning)/.16);color:hsl(var(--warning));
  font-size:10px;font-weight:600;margin-right:6px;vertical-align:1px;
}
.pr-desc{
  font-size:12px;color:hsl(var(--text-secondary));line-height:1.55;
  display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;
}
.pr-meta{
  display:flex;align-items:center;gap:10px;flex-wrap:wrap;
  font-size:11px;color:hsl(var(--text-secondary));margin-top:2px;
}
.pr-meta span{display:inline-flex;align-items:center;gap:3px}
.pr-av{display:inline-flex;align-items:center;gap:5px;color:hsl(var(--text-secondary))}
.pr-av .ph{
  width:16px;height:16px;border-radius:999px;background:hsl(var(--secondary));
  display:flex;align-items:center;justify-content:center;
  font-size:9px;font-weight:700;color:hsl(var(--text-secondary));flex:none;
}
.pr-cover{
  width:76px;height:76px;border-radius:9px;overflow:hidden;flex:none;
  background:hsl(var(--secondary));
}
.pr-cover img{width:100%;height:100%;object-fit:cover}

.pager{display:flex;align-items:center;justify-content:center;gap:10px;padding:18px 0;
  font-size:12px;color:hsl(var(--text-secondary))}

/* ═══════ 帖子详情 ═══════ */
.postview{flex:1;overflow-y:auto;padding:0 16px}
.backlink{
  display:inline-flex;align-items:center;gap:4px;padding:14px 0 10px;
  font-size:12.5px;color:hsl(var(--text-secondary));
}
.backlink:hover{color:hsl(var(--primary))}

.postcard{
  border:1px solid hsl(var(--border));border-radius:14px;
  background:hsl(var(--card));padding:22px;margin-bottom:16px;
  max-width:820px;
}
.post-title{
  margin:0 0 12px;font-size:21px;font-weight:700;line-height:1.4;
  color:hsl(var(--text-main));letter-spacing:-.01em;
}
.post-meta{
  display:flex;align-items:center;gap:10px;flex-wrap:wrap;
  font-size:11.5px;color:hsl(var(--text-secondary));
  padding-bottom:14px;border-bottom:1px dashed hsl(var(--border));
}
.post-meta span{display:inline-flex;align-items:center;gap:3px}
.post-cover{margin:16px 0;border-radius:10px;overflow:hidden}
.post-cover img{width:100%;display:block}
.post-body{
  padding:16px 0;font-size:14px;line-height:1.92;color:hsl(var(--text-main));
  white-space:pre-wrap;word-break:break-word;
}
/* 帖子正文是完整 HTML 文档时（原站作者上传了富文本/整页），恢复正常排版 */
.post-body.html{white-space:normal}
.post-body.html img{max-width:100%;height:auto;border-radius:8px;display:block;margin:10px auto}
.post-body.html h1,.post-body.html h2,.post-body.html h3{
  font-size:17px;font-weight:700;margin:18px 0 8px;line-height:1.4;
}
.post-body.html h1{font-size:20px}
.post-body.html h2{font-size:18px}
.post-body.html p{margin:8px 0}
.post-body.html ul,.post-body.html ol{padding-left:22px;margin:8px 0}
.post-body.html li{margin:3px 0}
.post-body.html blockquote{
  border-left:3px solid hsl(var(--primary)/.5);padding:6px 12px;margin:10px 0;
  color:hsl(var(--text-secondary));background:hsl(var(--muted)/.6);border-radius:0 8px 8px 0;
}
.post-body.html a{color:hsl(var(--primary));text-decoration:none}
.post-body.html a:hover{text-decoration:underline}
.post-body.html table{border-collapse:collapse;width:100%;margin:10px 0;font-size:13px}
.post-body.html th,.post-body.html td{border:1px solid hsl(var(--border));padding:6px 8px}
.post-body.html hr{border:0;border-top:1px dashed hsl(var(--border));margin:16px 0}
.post-body.html div{margin:2px 0}
.post-body.html span{white-space:pre-wrap}

.vote{
  border:1px solid hsl(var(--warning)/.35);border-radius:10px;
  background:hsl(var(--warning)/.06);padding:14px;margin:8px 0 16px;
}
.vote-hd{display:flex;align-items:center;gap:6px;font-size:13px;font-weight:600;
  color:hsl(var(--warning));margin-bottom:10px}
.vote-opts{display:flex;flex-direction:column;gap:6px}
.vote-opt{
  display:flex;align-items:center;justify-content:space-between;
  padding:8px 11px;border-radius:8px;background:hsl(var(--background));
  font-size:12.5px;color:hsl(var(--text-main));
}
.vote-opt b{color:hsl(var(--warning));font-variant-numeric:tabular-nums}

.post-actions{display:flex;gap:8px;flex-wrap:wrap;padding-top:14px;
  border-top:1px dashed hsl(var(--border));margin-top:8px}

.post-reply{max-width:820px}
.reply-box{
  border:1px solid hsl(var(--border));border-radius:12px;
  background:hsl(var(--card));padding:12px;
}
.reply-box textarea{
  width:100%;border:none;outline:none;resize:vertical;min-height:66px;
  background:transparent;color:hsl(var(--text-main));font:inherit;font-size:13px;
  line-height:1.7;
}
.reply-box textarea::placeholder{color:hsl(var(--input-placeholder))}
.reply-foot{display:flex;align-items:center;justify-content:space-between;
  padding-top:8px;border-top:1px solid hsl(var(--border));margin-top:6px}
.hint{font-size:11px;color:hsl(var(--text-secondary))}

/* ── 评论列表 ─────────────────────────── */
.cmtlist{display:flex;flex-direction:column;gap:2px;margin-top:12px}
.cmt{
  display:flex;gap:10px;padding:12px 4px;
  border-bottom:1px solid hsl(var(--border));
}
.cmt:last-child{border-bottom:none}
.cmt-av{flex:none;overflow:hidden}
.cmt-av .ph{width:100%;height:100%;display:grid;place-items:center;
  background:hsl(var(--primary)/.12);color:hsl(var(--primary));font-size:12px;font-weight:600}
.cmt-main{flex:1;min-width:0}
.cmt-hd{display:flex;align-items:baseline;gap:8px;margin-bottom:3px}
.cmt-hd b{font-size:12.5px;font-weight:600;color:hsl(var(--text-main))}
.cmt-hd span{font-size:11px;color:hsl(var(--text-secondary))}
.cmt-bd{font-size:13px;line-height:1.75;color:hsl(var(--text-main));
  white-space:pre-wrap;word-break:break-word}
.cmt-empty{
  padding:22px 0;text-align:center;font-size:12.5px;
  color:hsl(var(--text-secondary));
}

/* 已点赞 / 已收藏态 */
.post-actions .btn.on{
  border-color:hsl(var(--primary)/.55);
  color:hsl(var(--primary));
  background:hsl(var(--primary)/.10);
}
.post-actions .btn b{font-variant-numeric:tabular-nums;margin-left:2px;font-weight:600}

/* ── 论坛头部发帖按钮 ─────────────────── */
.forum-hd{position:relative}
.forum-act{position:absolute;right:0;top:0;display:flex;gap:8px}
@media(max-width:640px){
  .forum-act{position:static;margin-top:8px}
}

/* ── 发帖页 ───────────────────────────── */
.newpost{max-width:820px}
.np-card{
  border:1px solid hsl(var(--border));border-radius:12px;
  background:hsl(var(--card));padding:16px;
  display:flex;flex-direction:column;gap:14px;
}
.np-card .fld{display:flex;flex-direction:column;gap:6px}
.np-card .fld>span{font-size:12px;color:hsl(var(--text-secondary))}
.np-card input,.np-card select,.np-card textarea{
  width:100%;box-sizing:border-box;padding:9px 11px;border-radius:9px;
  border:1px solid hsl(var(--input));background:hsl(var(--background));
  color:hsl(var(--text-main));font:inherit;font-size:13px;outline:none;
}
.np-card textarea{resize:vertical;line-height:1.8;min-height:220px}
.np-card input:focus,.np-card select:focus,.np-card textarea:focus{
  border-color:hsl(var(--primary));box-shadow:0 0 0 3px hsl(var(--primary)/.12);
}
.np-foot{display:flex;align-items:center;justify-content:space-between;
  padding-top:12px;border-top:1px dashed hsl(var(--border))}

/* ── 帖子排序条 ───────────────────────── */
.fsort{display:flex;gap:6px;flex-wrap:wrap;margin-bottom:10px}

/* 带图帖角标：列表上标出这一帖里有几张图，6044 篇里只有 456 篇带图 */
.pr-media{display:inline-flex;align-items:center;gap:3px;height:18px;padding:0 6px;margin-right:6px;border-radius:5px;background:hsl(var(--primary)/.12);color:hsl(var(--primary));font-size:11px;font-weight:600;vertical-align:1px}
.pr-media svg{width:11px;height:11px}
