/* ============================================================================
 * HBG 发帖控件 · 唯一样式源（v25.46s+60）
 * ----------------------------------------------------------------------------
 * 四处共用同一套控件（改这里 = 四处同时生效）：
 *   1) 学员端 PC 发帖      /publish/pc        static/publish-pc.html
 *   2) 学员端手机端发帖     /publish/mobile    static/publish-mobile.html
 *   3) 管理端以官方发帖     admin 发布页       admin/js/admin-publish.js
 *   4) 管理端编辑帖子       admin 全屏页       admin/js/admin-posts.js
 *
 * 主题：data-theme="dark"（学员端，黑底）| "light"（管理端，白底）
 * 布局：
 *   .layout-pc    PC 两栏 —— 左「发布设置」固定 380px + 右「文章内容」自适应
 *   .layout-stack 单列卡片（手机端 / 备用）—— 用 display:contents 拆列后以 order
 *                 还原「标题 → 正文 → 设置」的阅读顺序（DOM 顺序是给 PC 两栏用的）
 * 变量统一 --hp-* 前缀，避免与宿主页面 :root 冲突。
 *
 * 另有**两个挂到 body 上的浮层**（v25.46s+60，见文件末尾）：
 *   .hbg-pv     学员端预览层（固定深色，不跟随 data-theme）
 *   .hbg-pv-lb  图片放大查看器（封面图 / 长廊图 / 正文图共用）
 * 它们不在 .hbg-pub 内，故用独立前缀 .hbg-pv* 隔离。
 * ========================================================================== */

.hbg-pub{
  --hp-red:#E5342B;
  --hp-green:#0FA47F;

  --hp-bg:#000000;
  --hp-card:#17171A;
  --hp-card2:#1F1F23;
  --hp-text:#FFFFFF;
  --hp-text2:#A0A0A6;
  --hp-text3:#6B6B72;
  --hp-line:#26262B;
  --hp-line2:#2E2E34;
  --hp-input-bg:#17171A;

  color:var(--hp-text);
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Microsoft YaHei",sans-serif;
  line-height:1.6;
  box-sizing:border-box;
}
.hbg-pub[data-theme="dark"]{ }
.hbg-pub[data-theme="light"]{
  --hp-bg:#f5f6fa;
  --hp-card:#ffffff;
  --hp-card2:#fafbfc;
  --hp-text:#222222;
  --hp-text2:#555555;
  --hp-text3:#888888;
  --hp-line:#e5e7eb;
  --hp-line2:#e5e7eb;
  --hp-input-bg:#ffffff;
}
.hbg-pub *,.hbg-pub *::before,.hbg-pub *::after{box-sizing:border-box}
.hbg-pub input,.hbg-pub select,.hbg-pub textarea{font-family:inherit;outline:none}
.hbg-pub ::placeholder{color:var(--hp-text3)}
.hbg-pub button{font-family:inherit;cursor:pointer;border:none;background:none;color:inherit}

/* 分组标题的双形态：PC 用页面级 heading，stack 用卡片标题（DOM 同一份，CSS 切换） */
.hbg-pub.layout-pc .hp-only-stack{display:none !important}
.hbg-pub.layout-stack .hp-only-pc{display:none !important}

/* ---------- 骨架：两栏 / 单列 ---------- */
.hbg-pub__main{display:flex;min-height:0}
.hbg-pub__col{min-width:0}
.hbg-pub__sec{margin-bottom:18px}
.hbg-pub__sec:last-child{margin-bottom:0}
.hbg-pub__sec-h{
  font-size:13px;font-weight:800;color:var(--hp-text2);
  margin:0 0 10px;letter-spacing:.3px;
}
.hbg-pub__sec-h em{color:var(--hp-red);font-style:normal;margin-left:2px}
.hbg-pub__sec-hint{font-size:11px;font-weight:400;color:var(--hp-text3);margin-left:6px}

/* PC 两栏（v25.46s+59 左右调换）：左「发布设置」固定 380px，右「文章内容」自适应 */
.hbg-pub.layout-pc{display:flex;flex-direction:column;min-height:0}
.hbg-pub.layout-pc .hbg-pub__main{flex:1;min-height:0}
.hbg-pub.layout-pc .hbg-pub__col--left{
  width:380px;flex-shrink:0;padding:24px 28px;overflow-y:auto;
  background:var(--hp-card);border-right:1px solid var(--hp-line);
}
.hbg-pub.layout-pc .hbg-pub__col--right{
  flex:1;min-width:0;padding:24px 32px;overflow-y:auto;
}
/* 列级标题（仅 PC）：比字段 label 重一档，下面留白稍大 */
.hbg-pub .hbg-pub__colhead{font-size:14px;margin:0 0 18px}

/* 单列（手机端）：每个分组是一张卡片，标题用 section-title 风格 */
.hbg-pub.layout-stack{display:flex;flex-direction:column}
.hbg-pub.layout-stack .hbg-pub__main{
  flex-direction:column;gap:16px;padding:16px 14px 24px;
}
/* v25.46s+59：DOM 顺序是「设置 → 正文」（PC 两栏要的左设置右正文），
   手机上把两列用 display:contents 拆平，再用 order 还原原有的
   「标题 → 正文 → 封面图 → 频道 → 链接 → 附件」阅读顺序。 */
.hbg-pub.layout-stack .hbg-pub__col{display:contents}
.hbg-pub.layout-stack .hp-sec-title{order:1}
.hbg-pub.layout-stack .hp-sec-body{order:2}
.hbg-pub.layout-stack .hp-sec-cover{order:3}
.hbg-pub.layout-stack .hp-sec-cat{order:4}
.hbg-pub.layout-stack .hp-sec-link{order:5}
.hbg-pub.layout-stack .hp-sec-att{order:6}
.hbg-pub.layout-stack .hbg-pub__sec{
  background:var(--hp-card);border:1px solid var(--hp-line);border-radius:14px;padding:16px;margin-bottom:0;
}
.hbg-pub.layout-stack .hbg-pub__sec-h{
  font-size:12px;margin-bottom:12px;display:flex;align-items:center;gap:6px;
}
/* 弹窗内单列：不加卡片边框（弹窗本身已是卡片），且不留外内边距 */
.hbg-pub.layout-stack.no-card .hbg-pub__sec{
  background:transparent;border:none;border-radius:0;padding:0;margin-bottom:16px;
}
.hbg-pub.layout-stack.no-card .hbg-pub__main{padding:0}

/* ---------- 表单元素 ---------- */
.hbg-pub .hp-label{
  font-size:13px;font-weight:700;color:var(--hp-text2);
  margin-bottom:8px;display:block;letter-spacing:.2px;
}
.hbg-pub .hp-label em{color:var(--hp-red);font-style:normal;margin-left:2px}
.hbg-pub .hp-input{
  width:100%;padding:12px 16px;font-size:16px;
  color:var(--hp-text);background:var(--hp-input-bg);
  border:1px solid var(--hp-line2);border-radius:12px;
  transition:border-color .2s;
}
.hbg-pub .hp-input:focus{border-color:var(--hp-red)}
.hbg-pub textarea.hp-input{min-height:120px;resize:vertical;line-height:1.6}
.hbg-pub select.hp-input{
  cursor:pointer;appearance:none;-webkit-appearance:none;
  background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='%23A0A0A6'><path d='M6 9l6 6 6-6'/></svg>");
  background-repeat:no-repeat;background-position:right 14px center;padding-right:36px;
}
.hbg-pub .hp-row2{display:grid;grid-template-columns:1fr 1fr;gap:12px}

/* ---------- 正文混排：「插入内容模块」（v25.46s+59 由「插入网页」「插入 PDF」合并为一个）---------- */
.hbg-pub .hp-embed-bar{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-bottom:8px}
.hbg-pub .hp-embed-btn{
  padding:6px 12px;border-radius:999px;border:1px solid var(--hp-line2);
  background:var(--hp-card);color:var(--hp-text2);
  font-size:12px;font-weight:700;transition:border-color .2s,color .2s,background .2s;
}
.hbg-pub .hp-embed-btn:hover{border-color:var(--hp-red);color:var(--hp-red)}
/* 唯一入口：描边主色胶囊，比旧的两个小圆角按钮更醒目 */
.hbg-pub .hp-embed-btn--main{
  padding:8px 16px;border-radius:10px;font-size:13px;
  border-color:var(--hp-red);color:var(--hp-red);background:transparent;
}
.hbg-pub .hp-embed-btn--main:hover{background:var(--hp-red);color:#fff}
.hbg-pub .hp-embed-hint{font-size:11px;color:var(--hp-text3);flex:1 1 220px;min-width:0}
/* 窄屏（手机端）：提示文字整体换到按钮下方一行，避免被压成三行 */
@media (max-width:520px){
  .hbg-pub .hp-embed-hint{flex:1 1 100%}
}

/* ---------- wangEditor 容器 ---------- */
.hbg-pub .hp-editor{
  border:1px solid var(--hp-line2);border-radius:0 0 12px 12px;
  overflow:hidden;background:#fff;
}
.hbg-pub .hp-editor .w-e-toolbar{border-bottom:1px solid var(--hp-line2)}
.hbg-pub .hp-editor .w-e-text-container,.hbg-pub .hp-editor .w-e-scroll{height:480px}
.hbg-pub .hp-editor .w-e-text-container{color:#333}
.hbg-pub .hp-editor .w-e-bar{color:#595959}
/* 复用的旧样式名兜底（引用方页面残留 id 时不影响） */
.hbg-pub .editor-wrap{border:1px solid var(--hp-line2);border-radius:0 0 12px 12px;overflow:hidden;background:#fff}

/* 单列（手机 / 弹窗）：编辑器自动撑开，不锁 480px */
.hbg-pub.layout-stack .hp-editor .w-e-text-container,
.hbg-pub.layout-stack .hp-editor .w-e-scroll{height:auto;min-height:280px}
.hbg-pub.layout-stack .hp-editor [data-slate-editor]{min-height:240px}

/* ---------- 封面图网格 ---------- */
.hbg-pub .hp-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:10px;margin-top:10px}
.hbg-pub .hp-cell{
  position:relative;aspect-ratio:3/4;border-radius:10px;overflow:hidden;
  background:var(--hp-card2);border:1px dashed var(--hp-line2);
  display:flex;align-items:center;justify-content:center;color:var(--hp-text3);font-size:24px;
}
.hbg-pub .hp-cell.has-img{border:none}
.hbg-pub .hp-cell.has-img img{width:100%;height:100%;object-fit:cover;display:block;cursor:zoom-in}
.hbg-pub .hp-cell .del{
  position:absolute;top:4px;right:4px;width:22px;height:22px;border-radius:50%;
  background:rgba(0,0,0,.7);color:#fff;display:flex;align-items:center;justify-content:center;
  font-size:14px;font-weight:800;cursor:pointer;z-index:2;
}

/* ---------- 附件上传区 ---------- */
.hbg-pub .hp-upload{
  border:1.5px dashed var(--hp-line2);border-radius:12px;padding:18px;text-align:center;
  color:var(--hp-text2);cursor:pointer;transition:border-color .2s,background .2s;
}
.hbg-pub .hp-upload:hover{border-color:var(--hp-red);background:rgba(229,52,43,.04)}
.hbg-pub .hp-upload svg{display:block;margin:0 auto 6px}
.hbg-pub .hp-upload-hint{font-size:11px;color:var(--hp-text3);margin-top:4px}
.hbg-pub .hp-files{margin-top:10px;display:flex;flex-direction:column;gap:8px}
.hbg-pub .hp-file{
  display:flex;align-items:center;gap:10px;background:var(--hp-card);
  border:1px solid var(--hp-line2);border-radius:10px;padding:10px 12px;
}
.hbg-pub .hp-file .ic{
  width:32px;height:32px;border-radius:8px;display:flex;align-items:center;justify-content:center;
  color:#fff;font-size:10px;font-weight:800;flex-shrink:0;
}
.hbg-pub .hp-file .info{flex:1;min-width:0}
.hbg-pub .hp-file .nm{font-size:13px;font-weight:700;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.hbg-pub .hp-file .sz{font-size:11px;color:var(--hp-text3)}
.hbg-pub .hp-file .dl{
  color:var(--hp-red);font-size:12px;font-weight:700;cursor:pointer;padding:4px 10px;border-radius:8px;
}
.hbg-pub .hp-file .dl:hover{background:rgba(229,52,43,.1)}

/* ---------- 底部操作区 ---------- */
.hbg-pub__footer{
  display:flex;gap:12px;justify-content:flex-end;
  padding:14px 24px;border-top:1px solid var(--hp-line);background:var(--hp-card);
}
.hbg-pub__footer.is-fixed{
  position:fixed;left:0;right:0;bottom:0;z-index:20;
  padding:12px 14px calc(12px + env(safe-area-inset-bottom));
  background:rgba(12,12,14,.96);backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px);
}
/* 学员端 PC：底部条与页面底色一致（沿用原有观感） */
.hbg-pub.layout-pc[data-theme="dark"] .hbg-pub__footer{background:#0D0D0F}
.hbg-pub .hp-btn-cancel{
  padding:10px 22px;border-radius:10px;background:var(--hp-card);color:var(--hp-text2);
  font-weight:700;font-size:14px;border:1px solid var(--hp-line2);
}
.hbg-pub .hp-btn-cancel:hover{color:var(--hp-text)}
/* v25.46s+60：「预览全文」——次级按钮，描边走主色，视觉上不跟「发布」抢焦点 */
.hbg-pub .hp-btn-preview{
  padding:10px 20px;border-radius:10px;background:transparent;color:var(--hp-text2);
  font-weight:700;font-size:14px;border:1px solid var(--hp-line2);
}
.hbg-pub .hp-btn-preview:hover{border-color:var(--hp-red);color:var(--hp-red)}
.hbg-pub .hp-btn-submit{
  padding:10px 28px;border-radius:10px;background:var(--hp-red);color:#fff;
  font-weight:800;font-size:14px;
}
.hbg-pub .hp-btn-submit:hover{background:#C4221A}
.hbg-pub .hp-btn-submit:disabled{background:#444;color:#888;cursor:not-allowed}

/* 单列（手机）底部按钮：撑满、字号加大 */
.hbg-pub.layout-stack .hbg-pub__footer{padding:0;border:none;background:transparent}
.hbg-pub.layout-stack .hbg-pub__footer .hp-btn-cancel{flex:0 0 76px;padding:14px 0;border-radius:12px;font-size:14px;text-align:center}
.hbg-pub.layout-stack .hbg-pub__footer .hp-btn-preview{flex:0 0 auto;padding:14px 12px;border-radius:12px;font-size:14px}
.hbg-pub.layout-stack .hbg-pub__footer .hp-btn-submit{flex:1;padding:14px 0;border-radius:12px;font-size:15px}
/* 单列但非固定（admin 弹窗）：按钮右对齐、恢复常规尺寸 */
.hbg-pub.layout-stack:not(.footer-fixed) .hbg-pub__footer{
  padding:14px 0 0;border-top:1px solid var(--hp-line);justify-content:flex-end;margin-top:16px;
}
.hbg-pub.layout-stack:not(.footer-fixed) .hbg-pub__footer .hp-btn-cancel{flex:0 0 auto;padding:8px 18px;font-size:13px;border-radius:8px}
.hbg-pub.layout-stack:not(.footer-fixed) .hbg-pub__footer .hp-btn-preview{flex:0 0 auto;padding:8px 16px;font-size:13px;border-radius:8px}
.hbg-pub.layout-stack:not(.footer-fixed) .hbg-pub__footer .hp-btn-submit{flex:0 0 auto;padding:8px 22px;font-size:13px;border-radius:8px}

/* ---------- 手机端窄屏适配 ---------- */
@media (max-width:820px){
  .hbg-pub.layout-stack .hp-grid{grid-template-columns:repeat(3,1fr);gap:8px}
}

/* ============================================================================
 * 学员端预览层 + 图片放大查看器（v25.46s+60）
 * ----------------------------------------------------------------------------
 * 这两个浮层由 hbg-publish.js 挂到 document.body 上（在 .hbg-pub 之外），
 * 所以样式不加 .hbg-pub 前缀，改用独立前缀 .hbg-pv / .hbg-pv-lb 隔离。
 *
 * ⚠️ 配色**固定为学员端深色**，刻意不跟随 data-theme：
 *    预览的目的就是让作者看见「学员看到的」，管理端浅色后台里也必须呈现深色。
 *    这里的变量值与 static/hbg-v24.html 的 :root 一致，改主站配色时请同步。
 *
 * 层级：预览层 1500（> 管理端全屏层 #pubFs 的 1400），查看器 1600（在预览层之上）。
 * ========================================================================== */
.hbg-pv-lb,
.hbg-pv{
  --pv-red:#E5342B;
  --pv-card:#17171A;
  --pv-card2:#1F1F23;
  --pv-text:#FFFFFF;
  --pv-text2:#A0A0A6;
  --pv-text3:#6B6B72;
  --pv-line:#26262B;
  --pv-line2:#2E2E34;
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Microsoft YaHei",sans-serif;
  line-height:1.6;
}
.hbg-pv *,.hbg-pv *::before,.hbg-pv *::after,
.hbg-pv-lb *,.hbg-pv-lb *::before,.hbg-pv-lb *::after{box-sizing:border-box}
.hbg-pv button,.hbg-pv-lb button{font-family:inherit;cursor:pointer;border:none;background:none;color:inherit}
.hbg-pv a{color:inherit;text-decoration:none}
.hbg-pv img,.hbg-pv-lb img{display:block;max-width:100%}

/* ---------- 预览层骨架 ---------- */
.hbg-pv{
  position:fixed;inset:0;z-index:1500;display:flex;flex-direction:column;
  background:#0D0D0F;color:var(--pv-text);
  animation:hbgPvIn .18s ease-out;
}
@keyframes hbgPvIn{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:none}}

/* 顶栏 */
.hbg-pv__bar{
  flex-shrink:0;display:flex;align-items:center;gap:10px;height:52px;padding:0 16px;
  background:rgba(0,0,0,.9);backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px);
  border-bottom:1px solid var(--pv-line);
}
.hbg-pv__tag{font-size:13px;font-weight:800;white-space:nowrap}
.hbg-pv__hint{flex:1;min-width:0;font-size:11px;color:var(--pv-text3);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.hbg-pv__close{
  flex-shrink:0;width:34px;height:34px;border-radius:50%;font-size:22px;line-height:1;
  display:flex;align-items:center;justify-content:center;color:var(--pv-text2);
}
.hbg-pv__close:hover{background:rgba(255,255,255,.1);color:#fff}

/* 滚动区 */
.hbg-pv__scroll{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch}
.hbg-pv__sheet{max-width:920px;margin:0 auto;padding:22px 20px 40px}

/* 标题 + 作者行 */
.hbg-pv__title{font-size:20px;font-weight:800;line-height:1.35;margin:0 0 10px;word-break:break-word;overflow-wrap:anywhere}
.hbg-pv__ph{color:var(--pv-text3);font-weight:400}
.hbg-pv__author{display:flex;align-items:center;gap:8px;font-size:12px;color:var(--pv-text2);margin-bottom:16px;flex-wrap:wrap}
.hbg-pv__avatar{
  flex-shrink:0;width:24px;height:24px;border-radius:50%;color:#fff;
  display:flex;align-items:center;justify-content:center;font-size:11px;font-weight:800;
}
.hbg-pv__dot{color:var(--pv-text3)}
.hbg-pv__badge{
  font-size:10px;font-weight:700;color:#D9A441;background:rgba(217,164,65,.14);
  border:1px solid rgba(217,164,65,.3);padding:1px 7px;border-radius:999px;
}
.hbg-pv__cat{
  margin-left:auto;font-size:10px;font-weight:700;color:var(--pv-red);
  background:rgba(229,52,43,.12);padding:2px 8px;border-radius:999px;
}

/* 图片长廊（与学员端一致：正文无图时整块不渲染）*/
.hbg-pv__media{margin-bottom:18px}
.hbg-pv__media--one img{
  width:100%;max-height:62vh;object-fit:contain;background:#000;border-radius:12px;cursor:zoom-in;
}
.hbg-pv__media--multi{position:relative}
.hbg-pv__strip{
  display:flex;gap:8px;overflow-x:auto;scroll-snap-type:x mandatory;-webkit-overflow-scrolling:touch;
  border-radius:12px;
}
.hbg-pv__strip::-webkit-scrollbar{height:3px}
.hbg-pv__strip::-webkit-scrollbar-thumb{background:#333;border-radius:3px}
.hbg-pv__strip img{
  flex:0 0 100%;width:100%;max-height:62vh;object-fit:contain;background:#000;
  border-radius:12px;scroll-snap-align:center;cursor:zoom-in;
}
.hbg-pv__count{
  position:absolute;right:10px;bottom:10px;pointer-events:none;
  font-size:11px;font-weight:700;color:#fff;background:rgba(0,0,0,.66);padding:2px 9px;border-radius:999px;
}

/* 正文 */
.hbg-pv__body{font-size:15px;line-height:1.8;word-break:break-word;overflow-wrap:anywhere}
.hbg-pv__body p{margin:0 0 14px}
.hbg-pv__body h1,.hbg-pv__body h2,.hbg-pv__body h3,.hbg-pv__body h4{margin:18px 0 10px;line-height:1.35}
.hbg-pv__body img{border-radius:10px;margin:10px 0;cursor:zoom-in}
.hbg-pv__body a{color:var(--pv-red);text-decoration:underline}
.hbg-pv__body ul,.hbg-pv__body ol{margin:0 0 14px;padding-left:22px}
.hbg-pv__body blockquote{
  margin:12px 0;padding:8px 14px;border-left:3px solid var(--pv-red);
  background:rgba(255,255,255,.04);border-radius:0 8px 8px 0;
}
.hbg-pv__body pre{background:#000;border:1px solid var(--pv-line2);border-radius:10px;padding:12px;overflow:auto;font-size:13px}
.hbg-pv__body code{background:rgba(255,255,255,.08);border-radius:4px;padding:1px 5px;font-size:13px}
.hbg-pv__body table{width:100%;border-collapse:collapse;margin:12px 0}
.hbg-pv__body td,.hbg-pv__body th{border:1px solid var(--pv-line2);padding:8px 10px;font-size:13px}
.hbg-pv__empty{color:var(--pv-text3);font-size:13px;margin:0}

/* 正文内嵌 HTML / PDF 卡片（与 detail.js 的 .hbg-embed 同形态，配色走 --pv-*）*/
.hbg-pv-embed{margin:18px 0;border:1px solid var(--pv-line2);border-radius:14px;overflow:hidden;background:var(--pv-card)}
.hbg-pv-embed-bar{display:flex;align-items:center;gap:8px;padding:8px 12px;background:var(--pv-card2);border-bottom:1px solid var(--pv-line2)}
.hbg-pv-embed-kind{font-size:12px;font-weight:800;white-space:nowrap;flex-shrink:0}
.hbg-pv-embed-name{flex:1;min-width:0;font-size:12px;color:var(--pv-text2);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.hbg-pv-embed-btn{
  flex-shrink:0;display:inline-flex;align-items:center;padding:4px 10px;
  border:1px solid var(--pv-line2);border-radius:999px;color:var(--pv-text2);
  font-size:11px;font-weight:700;line-height:1.5;
}
.hbg-pv-embed-btn:hover{border-color:var(--pv-red);color:var(--pv-red)}
.hbg-pv-embed-frame{width:100%;height:600px;background:#fff}
.hbg-pv-embed.pdf .hbg-pv-embed-frame{background:#525659}
.hbg-pv-embed-frame iframe{display:block;width:100%;height:100%;border:0}
/* v25.46s+66: 微信/移动端预览走 pdf.js 渲染（canvas 需要可滚动容器 + 页码位） */
.hbg-pv-embed-pager{flex-shrink:0;font-size:11px;font-weight:700;color:var(--pv-text2);white-space:nowrap}
.hbg-pv-embed--pdfjs .hbg-pv-embed-frame{overflow:auto;-webkit-overflow-scrolling:touch;padding:10px 8px}

/* 外链 / 附件 / 点赞收藏条 */
.hbg-pv__links{margin-top:18px}
.hbg-pv__links a{
  display:inline-flex;align-items:center;gap:6px;padding:8px 16px;
  border:1px solid var(--pv-line2);border-radius:10px;font-size:13px;font-weight:700;color:var(--pv-text2);
}
.hbg-pv__links a:hover{border-color:var(--pv-red);color:var(--pv-red)}
.hbg-pv__atts{margin-top:18px;padding-top:14px;border-top:1px solid var(--pv-line)}
.hbg-pv__atts-h{font-size:13px;font-weight:800;margin-bottom:10px}
.hbg-pv__atts-h span{color:var(--pv-text3);font-weight:400;font-size:11px}
.hbg-pv-att{display:flex;align-items:center;gap:10px;background:var(--pv-card);border:1px solid var(--pv-line2);border-radius:10px;padding:9px 12px;margin-bottom:8px}
.hbg-pv-att-ic{width:34px;height:34px;border-radius:8px;display:flex;align-items:center;justify-content:center;color:#fff;font-size:10px;font-weight:800;flex-shrink:0}
.hbg-pv-att-info{flex:1;min-width:0}
.hbg-pv-att-nm{font-size:13px;font-weight:700;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.hbg-pv-att-sz{font-size:11px;color:var(--pv-text3)}
.hbg-pv-att-dl{flex-shrink:0;font-size:12px;font-weight:700;color:var(--pv-red);padding:4px 10px;border-radius:8px}
.hbg-pv-att-dl:hover{background:rgba(229,52,43,.1)}
.hbg-pv__divider{height:1px;background:var(--pv-line);margin:20px 0 0}
.hbg-pv__acts{display:flex;gap:10px;margin-top:14px}
.hbg-pv-act{padding:8px 16px;border:1px solid var(--pv-line2);border-radius:10px;font-size:13px;font-weight:700;color:var(--pv-text2);opacity:.75}

/* 底部操作区：返回编辑 / 直接发布 */
.hbg-pv__foot{
  flex-shrink:0;display:flex;gap:12px;justify-content:flex-end;align-items:center;
  padding:12px 20px calc(12px + env(safe-area-inset-bottom));
  background:rgba(12,12,14,.96);backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px);
  border-top:1px solid var(--pv-line);
}
.hbg-pv__foot-note{margin-right:auto;font-size:11px;color:var(--pv-text3)}
.hbg-pv-btn{
  padding:11px 24px;border-radius:10px;font-size:14px;font-weight:800;
  border:1px solid var(--pv-line2);color:var(--pv-text2);background:transparent;
}
.hbg-pv-btn:hover{border-color:var(--pv-text2);color:#fff}
.hbg-pv-btn--primary{background:var(--pv-red);border-color:var(--pv-red);color:#fff}
.hbg-pv-btn--primary:hover{background:#C4221A;border-color:#C4221A;color:#fff}

/* ---------- 图片放大查看器（封面图 / 长廊图 / 正文图共用）---------- */
.hbg-pv-lb{
  position:fixed;inset:0;z-index:1600;display:flex;align-items:center;justify-content:center;
  background:rgba(0,0,0,.94);animation:hbgPvIn .15s ease-out;
}
.hbg-pv-lb-img{max-width:94vw;max-height:92vh;object-fit:contain;border-radius:6px}
.hbg-pv-lb-close{
  position:absolute;top:14px;right:16px;width:40px;height:40px;border-radius:50%;
  display:flex;align-items:center;justify-content:center;font-size:26px;line-height:1;
  color:#fff;background:rgba(255,255,255,.12);
}
.hbg-pv-lb-close:hover{background:rgba(255,255,255,.24)}
.hbg-pv-lb-nav{
  position:absolute;top:50%;transform:translateY(-50%);width:44px;height:44px;border-radius:50%;
  display:flex;align-items:center;justify-content:center;font-size:28px;line-height:1;
  color:#fff;background:rgba(255,255,255,.12);
}
.hbg-pv-lb-nav:hover{background:rgba(255,255,255,.24)}
.hbg-pv-lb-prev{left:14px}
.hbg-pv-lb-next{right:14px}
.hbg-pv-lb-count{
  position:absolute;bottom:20px;left:50%;transform:translateX(-50%);
  font-size:12px;font-weight:700;color:#fff;background:rgba(255,255,255,.14);
  padding:4px 12px;border-radius:999px;
}

/* ---------- 预览层窄屏适配（手机端发帖 / 后台窄窗）---------- */
@media (max-width:820px){
  .hbg-pv__bar{height:46px;padding:0 12px}
  .hbg-pv__hint{display:none}
  .hbg-pv__sheet{padding:16px 14px 32px}
  .hbg-pv__title{font-size:18px}
  .hbg-pv-embed{margin:14px 0;border-radius:12px}
  .hbg-pv-embed-bar{flex-wrap:wrap;gap:6px}
  .hbg-pv-embed-name{flex:1 1 100%;order:3;white-space:normal;line-height:1.4}
  .hbg-pv-embed-frame{height:62vh;min-height:320px}
  .hbg-pv__media--one img,.hbg-pv__strip img{max-height:52vh}
}
@media (max-width:520px){
  .hbg-pv__foot{padding:10px 12px calc(10px + env(safe-area-inset-bottom));gap:8px}
  .hbg-pv__foot-note{display:none}
  .hbg-pv-btn{flex:1;padding:13px 0;text-align:center}
  .hbg-pv-lb-nav{width:38px;height:38px;font-size:24px}
  .hbg-pv-lb-prev{left:8px}
  .hbg-pv-lb-next{right:8px}
}
