/* ============ 老陈·运营搭子 · 极简商务风 ============ */
:root {
  --blue: #2f6feb;
  --blue-dark: #1f56c4;
  --blue-light: #eaf1fd;
  --blue-line: #cfe0fb;
  --gray-bg: #f5f7fa;
  --gray-line: #e6eaf0;
  --text: #1f2733;
  --text-2: #5b6675;
  --text-3: #8b95a3;
  --green: #17a673;
  --orange: #e8892b;
  --red: #d9534f;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(31, 39, 51, .06), 0 6px 20px rgba(31, 39, 51, .05);
}

* { box-sizing: border-box; }

/* 必须放在所有 display 规则之前生效：
   .modal-mask / .loading / .btn 都设了 display，会覆盖 hidden 属性的默认 display:none，
   导致弹层和加载动画永远隐藏不掉，所以这里强制兜底 */
[hidden] { display: none !important; }

/* 后台站（独立入口进来）：右栏那些用户端的东西（目录、猜你想问）不显示 */
body.admin-site .rightbar { display: none; }

/* 管理员专属内容：未登录管理后台时一律隐藏（侧边栏/顶栏用 data-admin 标记，其余用 .admin-only 类） */
body:not(.is-admin) .admin-only { display: none !important; }
body:not(.is-admin) .side-item[data-admin],
body:not(.is-admin) .topnav a[data-admin] { display: none !important; }

html, body {
  margin: 0; padding: 0;
  background: var(--gray-bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.7;
}

/* 滚动条槽位常驻：条目筛选后页面变短、滚动条一消失，可用宽度就从 1425 跳到 1440，
   整页横向移 15px —— 这就是"左右抖"。留好槽位，宽度恒定，任何时候都不横移
   （顺带把弹窗打开时 body 锁滚动导致的抖也一起解决了） */
html { overflow-y: scroll; scrollbar-gutter: stable; }
/* 手机上是覆盖式滚动条，本来就不占宽度，没必要留槽（留了反而右边空一条） */
@media (max-width: 860px) {
  html { overflow-y: auto; scrollbar-gutter: auto; }
}

a { text-decoration: none; color: inherit; }
button { font-family: inherit; }
h1, h2, h3 { margin: 0; font-weight: 600; }

/* ---------- 顶部导航 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 60;
  height: 58px; background: #fff;
  border-bottom: 1px solid var(--gray-line);
  display: flex; align-items: center; gap: 24px;
  padding: 0 20px;
}
.brand { display: flex; align-items: center; gap: 9px; }
.brand-mark {
  width: 28px; height: 28px; border-radius: 7px;
  background: var(--blue); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 600;
}
.brand-name { font-size: 16px; font-weight: 600; letter-spacing: .3px; }
.brand-text { display: flex; flex-direction: column; justify-content: center; line-height: 1.22; white-space: nowrap; }
.brand-sub { font-size: 11px; color: var(--text-3); font-weight: 400; margin-top: 1px; white-space: nowrap; }
.btn-admin { background: #fff; border: 1px solid var(--blue-line); color: var(--blue); }
.btn-admin:hover { background: var(--blue-light); }
.btn-admin.on { background: var(--blue); color: #fff; border-color: var(--blue); }
.btn-admin.on:hover { background: var(--blue-dark); }

/* 退出账号：登录了才显示，平时是低调的描边按钮，hover 才变红提示危险操作 */
.btn-logout { background: #fff; border: 1px solid var(--gray-line); color: var(--text-2); }
.btn-logout:hover { background: #fff1f0; border-color: #ffccc7; color: var(--red); }
.btn-logout.on { border-color: #ffccc7; color: var(--red); }

.topnav { display: flex; gap: 4px; flex: 1; }
.topnav a {
  padding: 7px 14px; border-radius: 7px; color: var(--text-2);
  font-size: 14px; transition: .15s;
}
.topnav a:hover { background: var(--gray-bg); color: var(--text); }
.topnav a.active { background: var(--blue-light); color: var(--blue); font-weight: 500; }

.top-right { display: flex; align-items: center; gap: 12px; }
.kb-status {
  display: flex; align-items: center; gap: 6px;
  font-size: 12.5px; color: var(--text-2);
  background: var(--gray-bg); padding: 5px 11px; border-radius: 20px;
  white-space: nowrap;
}
.kb-status .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.kb-status.off .dot { background: var(--red); }

/* 知识库同步页：给非技术同学看的「说明 / 流程」块 */
.kb-explain {
  margin-top: 16px; padding: 14px 16px;
  background: var(--gray-bg); border-radius: 10px;
  border: 1px solid var(--border);
}
.kbe-t {
  font-size: 13.5px; font-weight: 600; color: var(--text);
  margin: 14px 0 8px; padding-left: 9px;
  border-left: 3px solid var(--blue);
}
.kb-explain .kbe-t:first-child { margin-top: 0; }
.kbe-list { margin: 0; padding-left: 18px; }
.kbe-list li { font-size: 13px; line-height: 1.85; color: var(--text-2); margin-bottom: 5px; }
.kbe-list li b, .kb-flow li b { color: var(--text); font-weight: 600; }
.kbe-p { font-size: 13px; line-height: 1.85; color: var(--text-2); margin: 0; }
.kbe-note {
  display: block; font-size: 12.5px; color: var(--text-3);
  line-height: 1.7; margin-top: 3px;
}
/* 步骤流程：带序号的圆圈 */
.kb-flow { margin: 8px 0 0; padding: 0; list-style: none; counter-reset: kbf; }
.kb-flow li {
  counter-increment: kbf; position: relative;
  padding: 0 0 14px 34px; font-size: 13px; line-height: 1.85; color: var(--text-2);
}
.kb-flow li::before {
  content: counter(kbf);
  position: absolute; left: 0; top: 2px;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--blue); color: #fff;
  font-size: 12px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
}
.kb-flow li::after {
  content: ""; position: absolute; left: 10.5px; top: 26px; bottom: 2px;
  width: 1px; background: var(--border);
}
.kb-flow li:last-child { padding-bottom: 0; }
.kb-flow li:last-child::after { display: none; }
.kb-flow code, .kb-explain code {
  display: inline-block; margin: 4px 0 2px;
  background: #fff; border: 1px solid var(--border); border-radius: 6px;
  padding: 5px 9px; font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 12.5px; color: var(--blue-dark); word-break: break-all;
}
@media (max-width: 860px) {
  .kb-explain { padding: 12px 12px; }
  .kb-flow li { padding-left: 30px; }
}
.device-tip { font-size: 12px; color: var(--text-3); }

.btn {
  border: 1px solid transparent; border-radius: 7px;
  padding: 8px 16px; font-size: 13.5px; cursor: pointer;
  transition: .15s; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 6px;
}
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-dark); }
.btn-outline { background: #fff; border-color: var(--blue-line); color: var(--blue); }
.btn-outline:hover { background: var(--blue-light); }
.btn-ghost { background: var(--gray-bg); color: var(--text-2); }
.btn-ghost:hover { background: #e9edf3; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-sync {
  background: linear-gradient(135deg, #3a7bfd, #2f6feb);
  color: #fff; box-shadow: 0 2px 8px rgba(47, 111, 235, .28);
}
.btn-sync:hover { filter: brightness(1.06); }
.btn-sync .sync-icon { display: inline-block; font-size: 14px; }
.btn-sync.busy .sync-icon { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 布局 ---------- */
.layout {
  display: grid;
  grid-template-columns: 208px minmax(0, 1fr) 288px;
  gap: 16px; padding: 16px 20px; align-items: start;
  max-width: 1560px; margin: 0 auto;
}

/* ---------- 左侧菜单 ---------- */
.sidebar {
  background: #fff; border: 1px solid var(--gray-line);
  border-radius: var(--radius); padding: 12px 10px;
  position: sticky; top: 74px;
}
.side-title { font-size: 12px; color: var(--text-3); padding: 4px 10px 8px; }
.side-item {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 10px; border-radius: 8px;
  color: var(--text-2); font-size: 13.5px; margin-bottom: 2px;
  transition: .15s; position: relative;
}
.side-item:hover { background: var(--gray-bg); color: var(--text); }
.side-item.active { background: var(--blue-light); color: var(--blue); font-weight: 500; }
.side-item .ico { font-size: 15px; }
.badge {
  margin-left: auto; background: var(--gray-bg); color: var(--text-3);
  font-size: 11px; font-style: normal; padding: 1px 7px; border-radius: 10px;
}
.side-item.active .badge { background: #fff; color: var(--blue); }

/* 侧边栏底部「退出账号」（按钮形态，复用 .side-item 的排版） */
.side-logout { margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--gray-line); }
.side-item-btn {
  width: 100%; display: flex; align-items: center; gap: 9px;
  padding: 9px 10px; border: none; background: none; border-radius: 8px;
  color: var(--text-2); font-size: 13.5px; font-family: inherit;
  cursor: pointer; text-align: left; transition: .15s;
}
.side-item-btn:hover { background: #fff1f0; color: var(--red); }

/* ---------- 主区 ---------- */
.main { min-width: 0; }
.view-head { margin-bottom: 14px; }
.view-head h1 { font-size: 20px; }
.view-head .sub { margin: 4px 0 0; color: var(--text-2); font-size: 13.5px; }

.card {
  background: #fff; border: 1px solid var(--gray-line);
  border-radius: var(--radius); padding: 18px; margin-bottom: 14px;
  box-shadow: var(--shadow);
}
.card-title {
  font-size: 15px; font-weight: 600; margin-bottom: 14px;
  display: flex; align-items: center; gap: 10px;
}

/* 每日信息差（首页每日一条运营知识点） */
.dt-card { border-left: 3px solid var(--blue); background: linear-gradient(180deg, #f6f9ff, #fff); }
.dt-date { font-size: 12px; font-weight: 400; color: var(--text-3); }
.dt-flag { font-size: 11px; font-weight: 500; padding: 1px 8px; border-radius: 20px; margin-left: auto; }
.dt-flag.auto { color: var(--text-3); background: var(--gray-bg); }
.dt-flag.manual { color: var(--green); background: #eaf7f1; }
.dt-title { font-size: 16px; font-weight: 600; color: var(--text); margin-bottom: 8px; line-height: 1.5; }
.dt-content { font-size: 14px; line-height: 1.85; color: var(--text-2); }
.dt-foot { margin-top: 10px; font-size: 12px; color: var(--text-3); }
.dt-foot a { color: var(--blue); }

/* 累积信息差：按年 / 月 / 周 + 类别归档 */
.tip-filter { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.tip-search { flex: 1; min-width: 180px; max-width: 320px; }
.tip-month { min-width: 150px; max-width: 190px; }
.tip-cats { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.tip-cat-chip {
  font-size: 12.5px; padding: 4px 12px; border-radius: 20px;
  border: 1px solid var(--border); background: #fff; color: var(--text-2);
  cursor: pointer; transition: all .15s;
}
.tip-cat-chip:hover { border-color: var(--blue); color: var(--blue); }
.tip-cat-chip.active { background: var(--blue); border-color: var(--blue); color: #fff; }
.tip-archive { display: flex; flex-direction: column; gap: 18px; }
.tip-lock { text-align: center; padding: 38px 20px; background: linear-gradient(180deg, #f6f9ff, #fff); border: 1px dashed var(--border); border-radius: 12px; }
.tip-lock-ico { font-size: 34px; margin-bottom: 8px; }
.tip-lock-title { font-size: 15px; font-weight: 600; color: var(--text); margin: 0 0 6px; }
.tip-lock-sub { font-size: 13px; color: var(--text-3); margin: 0 0 16px; line-height: 1.7; }
.tip-group-h { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.tip-group-n { font-size: 12px; font-weight: 400; color: var(--text-3); background: var(--gray-bg); border-radius: 20px; padding: 1px 8px; }
.tip-item {
  border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; margin-bottom: 10px;
  background: #fff;
}
.tip-item.today { border-color: var(--blue); background: linear-gradient(180deg, #f6f9ff, #fff); }
.tip-item-h { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.tip-date { font-size: 12px; color: var(--text-3); }
.tip-item-title { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 6px; line-height: 1.5; }
.tip-item-content { font-size: 13.5px; line-height: 1.8; color: var(--text-2); }
.tip-item-content p { margin: 0 0 6px; }
.tip-item-content:last-child, .tip-item-content p:last-child { margin-bottom: 0; }
.tip-item-foot { margin-top: 8px; font-size: 12px; color: var(--text-3); }
.tip-item-foot a { color: var(--blue); }
.tag {
  font-size: 11.5px; font-weight: 400; padding: 2px 9px;
  border-radius: 20px; background: #eaf7f1; color: var(--green);
}
.hint { font-size: 12.5px; color: var(--text-3); margin: 8px 0 0; line-height: 1.7; }
.hint.inline { margin-left: 10px; }
.hint code { background: var(--gray-bg); padding: 1px 5px; border-radius: 4px; }

/* 输入区 */
.q-input {
  width: 100%; min-height: 128px; resize: vertical;
  border: 1px solid var(--gray-line); border-radius: 8px;
  padding: 14px; font-size: 14.5px; line-height: 1.8;
  font-family: inherit; color: var(--text); outline: none; transition: .15s;
}
.q-input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(47, 111, 235, .1); }
.q-input::placeholder { color: #b6bfcb; }
.q-actions { display: flex; align-items: center; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.q-actions.no-margin { margin-top: 0; }
.q-meta { font-size: 12.5px; color: var(--text-3); margin-left: auto; }

.quick-ask { margin-top: 12px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.quick-label { font-size: 12.5px; color: var(--text-3); }
.quick-chips { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
/* 问过多次的问题标一下次数，让"大家常问"真的是大家常问的 */
.chip-n {
  display: inline-block; margin-left: 5px; padding: 0 5px; border-radius: 8px;
  background: var(--blue); color: #fff; font-size: 10.5px; font-style: normal; font-weight: 600;
}
.chip {
  position: relative;
  border: 1px solid var(--gray-line); background: #fff;
  border-radius: 20px; padding: 4px 12px; font-size: 12.5px;
  color: var(--text-2); cursor: pointer; transition: .15s;
}
.chip:hover { border-color: var(--blue); color: var(--blue); background: var(--blue-light); }

/* 空态 / 加载 */
.empty { text-align: center; padding: 44px 20px; color: var(--text-3); }
.empty-ico, .fb-ico { font-size: 32px; margin-bottom: 8px; }
.empty p { margin: 0; font-size: 13.5px; }
.loading { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 44px; color: var(--text-2); }
.spinner {
  width: 18px; height: 18px; border: 2px solid var(--blue-line);
  border-top-color: var(--blue); border-radius: 50%;
  animation: spin .8s linear infinite;
}

/* 解答 */
/* 接近匹配的提示条 */
.notice {
  border-radius: 8px; padding: 11px 14px; margin-bottom: 14px;
  font-size: 13.5px; line-height: 1.75;
  background: #fff8ec; border: 1px solid #f2dfba; color: #8a5b16;
}
.notice b { color: #a8660d; }
.notice.warn { background: #fff8ec; border-color: #f2dfba; }
/* 正文命中的说明条：蓝色，和"仅供参考"的黄色警告区分开 */
.notice.info { background: var(--blue-light); border-color: var(--blue-line); color: #24487f; }
.notice.info b { color: var(--blue-dark); }

.answer-block { margin-bottom: 18px; }
/* 解答区顶部的模块目录（从正文里提出来的，长文先看目录再往下读） */
#answerToc { margin: 0 0 16px; }
.block-head {
  display: flex; align-items: center; gap: 8px;
  font-size: 14px; font-weight: 600; margin-bottom: 8px; color: var(--text);
}
.block-no {
  font-size: 11px; color: var(--blue); background: var(--blue-light);
  padding: 1px 7px; border-radius: 4px; font-weight: 600;
}
.block-body {
  background: #fbfcfe; border: 1px solid var(--gray-line);
  border-radius: 8px; padding: 14px 16px; font-size: 14px; line-height: 1.9;
  white-space: pre-wrap; color: var(--text);
}
.block-body.plain { background: #fbfdfb; border-color: #d9efe4; }
/* 02 老陈建议：视觉上更突出 */
.block-head.advise { color: var(--blue); }
.block-head.advise .block-no { color: #fff; background: var(--blue); }
.block-body.plain { border-left: 3px solid var(--blue); }
/* 配图区 */
.block-pics {
  display: flex; flex-wrap: wrap; gap: 12px; margin-top: 12px;
}
.block-img {
  max-width: 100%; max-height: 320px; border-radius: 8px;
  border: 1px solid var(--gray-line); background: #fff; cursor: zoom-in;
}
/* 正文内联图 */
.inline-img {
  display: block; max-width: 100%; max-height: 440px; margin: 10px 0;
  border-radius: 8px; border: 1px solid var(--gray-line); cursor: zoom-in;
}
/* ===== 老陈建议正文：结构化排版（大小标题 / 重点 / 要点 / 图注） ===== */
/* 正文改由块元素控制间距，纯文本回退时再保留原换行 */
#plainText { white-space: normal; }
.p-plain { white-space: pre-wrap; }
.p-p { margin: 7px 0; }
/* ===== 模块化色块：正文按标题切成卡片，颜色按"这段在讲什么"自动匹配 ===== */
/* 导语：第一个模块之前的话，单独一块，别和正文混在一起 */
.p-intro {
  margin: 0 0 12px; padding: 11px 13px;
  background: linear-gradient(180deg, #f7f9fc, #fbfcfe);
  border: 1px solid var(--gray-line); border-radius: var(--radius);
  font-size: 13.8px; color: var(--text-2);
}
.p-intro > :first-child { margin-top: 0; }
.p-intro > :last-child { margin-bottom: 0; }

/* 顶部模块导航：长文先给目录，别让人一进来就撞上一堵字墙 */
.p-toc {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
  margin: 0 0 12px; padding: 10px 12px;
  background: var(--gray-bg); border: 1px dashed var(--gray-line); border-radius: var(--radius);
}
.p-toc-t { width: 100%; font-size: 12px; color: var(--text-3); margin-bottom: 2px; }
.p-toc-i {
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px 4px 4px;
  border-radius: 20px; background: #fff; border: 1px solid var(--gray-line);
  font-size: 12.5px; color: var(--text-2); cursor: pointer; transition: all .15s;
}
.p-toc-i b {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; border-radius: 50%; font-size: 11px; font-weight: 700; color: #fff;
}
.p-toc-i:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.p-toc-def b { background: #5b6675; }
.p-toc-why b { background: #2f6feb; }
.p-toc-do b { background: #17a673; }
.p-toc-case b { background: #e8892b; }
.p-toc-warn b { background: #d9534f; }
.p-toc-sum b { background: #7a5af8; }

/* 卡片本体 */
.p-mod {
  margin: 0 0 12px; border: 1px solid var(--gray-line); border-left: 3px solid var(--gray-line);
  border-radius: var(--radius); background: #fff; overflow: hidden;
}
.p-mod:last-child { margin-bottom: 0; }
.p-mod-h {
  display: flex; align-items: center; gap: 9px; padding: 9px 13px;
  border-bottom: 1px solid var(--gray-line); background: var(--gray-bg);
}
.p-mod-no {
  flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 6px;
  font-size: 12px; font-weight: 800; color: #fff; background: #5b6675;
}
.p-mod-t { flex: 1; margin: 0; font-size: 14.8px; font-weight: 700; line-height: 1.45; color: var(--text); }
.p-mod-tag { flex: 0 0 auto; padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 700; }
.p-mod-b { padding: 12px 14px 14px; }
.p-mod-b > :first-child { margin-top: 0; }
.p-mod-b > :last-child { margin-bottom: 0; }
.p-mod-b:empty { padding: 0; }

/* 语义配色：蓝=为什么 绿=怎么做 橙=案例 红=避坑 紫=总结 */
.p-mod-why { border-color: #cfe0fb; border-left-color: #2f6feb; }
.p-mod-why .p-mod-h { background: #eaf1fd; border-bottom-color: #cfe0fb; }
.p-mod-why .p-mod-no { background: #2f6feb; }
.p-mod-why .p-mod-t { color: #1f56c4; }
.p-mod-why .p-mod-tag { background: #fff; color: #1f56c4; }

.p-mod-do { border-color: #bfe9d8; border-left-color: #17a673; }
.p-mod-do .p-mod-h { background: #e8f8f2; border-bottom-color: #bfe9d8; }
.p-mod-do .p-mod-no { background: #17a673; }
.p-mod-do .p-mod-t { color: #0f7d56; }
.p-mod-do .p-mod-tag { background: #fff; color: #0f7d56; }

.p-mod-case { border-color: #f7dcb9; border-left-color: #e8892b; }
.p-mod-case .p-mod-h { background: #fdf2e6; border-bottom-color: #f7dcb9; }
.p-mod-case .p-mod-no { background: #e8892b; }
.p-mod-case .p-mod-t { color: #b9651a; }
.p-mod-case .p-mod-tag { background: #fff; color: #b9651a; }

.p-mod-warn { border-color: #f6ccc9; border-left-color: #d9534f; }
.p-mod-warn .p-mod-h { background: #fdeceb; border-bottom-color: #f6ccc9; }
.p-mod-warn .p-mod-no { background: #d9534f; }
.p-mod-warn .p-mod-t { color: #b5342f; }
.p-mod-warn .p-mod-tag { background: #fff; color: #b5342f; }

.p-mod-sum { border-color: #ddd4fb; border-left-color: #7a5af8; }
.p-mod-sum .p-mod-h { background: #f1edfe; border-bottom-color: #ddd4fb; }
.p-mod-sum .p-mod-no { background: #7a5af8; }
.p-mod-sum .p-mod-t { color: #5b3fd1; }
.p-mod-sum .p-mod-tag { background: #fff; color: #5b3fd1; }

.p-mod-def .p-mod-tag { background: #fff; color: var(--text-2); }

@media (max-width: 640px) {
  .p-mod-h { padding: 8px 11px; gap: 7px; }
  .p-mod-t { font-size: 14px; }
  .p-mod-b { padding: 10px 11px 12px; }
  .p-toc-i { font-size: 12px; }
}

/* 大标题：一级分节 */
.p-h {
  margin: 18px 0 9px; padding: 6px 0 6px 11px;
  font-size: 15.5px; font-weight: 700; color: var(--text); line-height: 1.5;
  border-left: 3px solid var(--blue); background: linear-gradient(90deg, var(--blue-light), transparent 70%);
  border-radius: 0 6px 6px 0;
}
.p-h:first-child { margin-top: 2px; }
/* 小标题：步骤 / 要点名 */
.p-sh {
  margin: 13px 0 6px; padding-left: 15px; position: relative;
  font-size: 14.2px; font-weight: 600; color: var(--blue-dark); line-height: 1.55;
}
.p-sh::before {
  content: ""; position: absolute; left: 3px; top: 9px;
  width: 5px; height: 5px; border-radius: 50%; background: var(--blue);
}
/* 重点块：核心逻辑 / 结论 */
.p-key {
  margin: 11px 0; padding: 10px 13px;
  background: var(--blue-light); border-left: 3px solid var(--blue);
  border-radius: 0 8px 8px 0; font-size: 14px; line-height: 1.85;
  color: var(--text); font-weight: 600;
}
/* 正文表格（如定价参考）：窄屏可横向滚动 */
.p-table-wrap { margin: 12px 0; overflow-x: auto; }
.p-table {
  width: 100%; border-collapse: collapse; font-size: 13.5px; background: #fff;
}
.p-table th, .p-table td {
  border: 1px solid var(--gray-line); padding: 7px 10px; text-align: left; line-height: 1.7;
}
.p-table th { background: var(--blue-light); font-weight: 600; color: var(--text); white-space: nowrap; }
.p-table tr:nth-child(even) td { background: #fcfdff; }
/* 要点列表 */
.p-ul { margin: 8px 0; padding-left: 22px; }
.p-ul li { margin-bottom: 5px; font-size: 14px; line-height: 1.85; }
/* 正文中内联的单张配图 + 图注 */
.p-fig { margin: 14px 0; }
.p-fig .inline-img { margin: 0 auto; }
.p-fig figcaption {
  margin-top: 7px; text-align: center; font-size: 12px; color: var(--text-3);
}
.action-list { margin: 0; padding-left: 20px; color: var(--text-2); }

/* 图片灯箱 */
.lightbox-img {
  max-width: 92vw; max-height: 90vh; border-radius: 10px;
  box-shadow: 0 10px 40px rgba(0,0,0,.3); background: #fff;
}
#imgLightbox { cursor: zoom-out; }
.action-list li { margin-bottom: 5px; font-size: 13.5px; }
.answer-meta {
  display: flex; gap: 18px; flex-wrap: wrap; font-size: 12.5px;
  color: var(--text-3); padding: 10px 0; border-top: 1px dashed var(--gray-line);
}
.answer-meta b { color: var(--blue); font-weight: 500; }
.answer-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.fallback {
  text-align: center; padding: 34px 20px;
  background: #fffaf3; border: 1px dashed #f0d9bd; border-radius: 8px;
}
.fb-actions { display: flex; gap: 10px; justify-content: center; margin-top: 16px; flex-wrap: wrap; }
.cat-suggest {
  margin-top: 16px; padding-top: 14px; border-top: 1px dashed #f0d9bd; text-align: left;
}
.cs-title { font-size: 13px; color: var(--text-2); margin-bottom: 8px; font-weight: 600; }
.cat-suggest .related-item:hover { border-color: var(--orange); background: #fff4e6; }

/* 待补充数量角标 */
.badge.warn { background: #fdf1ec; color: var(--orange); font-weight: 600; }
.side-item.active .badge.warn { background: #fff; color: var(--orange); }

/* 跳转到清单时的高亮提示 */
@keyframes flashCard {
  0% { box-shadow: 0 0 0 0 rgba(232, 137, 43, .45); }
  50% { box-shadow: 0 0 0 6px rgba(232, 137, 43, .16); }
  100% { box-shadow: 0 0 0 0 rgba(232, 137, 43, 0); }
}
.flash { animation: flashCard 1.5s ease; }

.rb-link { float: right; font-size: 12px; color: var(--blue); font-weight: 400; }
.rb-link:hover { text-decoration: underline; }

.record-cat.near { background: #fff4e6; color: var(--orange); }
.fb-text { font-size: 14.5px; color: var(--text); margin: 0 0 6px; font-weight: 500; }
.fb-sub { font-size: 12.5px; color: var(--text-3); margin: 0; }

.related { margin-top: 16px; border-top: 1px dashed var(--gray-line); padding-top: 14px; }
.related-title { font-size: 13px; color: var(--text-2); margin-bottom: 8px; font-weight: 600; }
.related-item {
  padding: 8px 12px; border: 1px solid var(--gray-line); border-radius: 7px;
  margin-bottom: 7px; cursor: pointer; font-size: 13px; transition: .15s;
  display: flex; align-items: center; gap: 8px;
}
.related-item:hover { border-color: var(--blue); background: var(--blue-light); }
.related-item .ri-cat { color: var(--text-3); font-size: 12px; margin-left: auto; }

/* 文末「猜你想问」关联框 */
.guess { margin-top: 16px; border-top: 1px dashed var(--gray-line); padding-top: 14px; }
.guess-title {
  font-size: 13px; color: var(--text-2); margin-bottom: 10px; font-weight: 600;
  display: flex; align-items: center; gap: 6px;
}
.guess-title::before { content: "💡"; font-size: 14px; }
.guess-list { display: flex; flex-direction: column; gap: 8px; }
.guess-item {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 13px; border: 1px solid var(--gray-line); border-radius: 8px;
  font-size: 13.5px; background: #fff; transition: .15s;
}
.guess-item .gi-dot { font-size: 14px; flex: none; }
.guess-item .gi-t { color: var(--text); }
.guess-item.linked { cursor: pointer; }
.guess-item.linked:hover { border-color: var(--blue); background: var(--blue-light); transform: translateX(2px); }
.guess-item.linked .gi-t { color: var(--blue-dark); font-weight: 500; }
.guess-item.pending { background: #fafbfc; cursor: default; }
.guess-item .gi-tag {
  margin-left: auto; flex: none; font-size: 11px; color: var(--text-3);
  border: 1px solid var(--gray-line); border-radius: 20px; padding: 1px 9px;
}
.guess-item.pending .gi-tag { color: var(--orange); border-color: #f3d9b8; background: #fff7ec; }

/* 工具条 */
.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.input {
  border: 1px solid var(--gray-line); border-radius: 7px;
  padding: 7px 11px; font-size: 13.5px; font-family: inherit;
  outline: none; color: var(--text); background: #fff;
}
.input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(47, 111, 235, .1); }
.input[type="search"] { min-width: 240px; }
.toolbar-stat { font-size: 12.5px; color: var(--text-3); margin-left: auto; }

.seg { display: inline-flex; background: var(--gray-bg); border-radius: 7px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg-btn {
  border: none; background: transparent; padding: 5px 13px;
  border-radius: 5px; font-size: 13px; color: var(--text-2); cursor: pointer; transition: .15s;
}
.seg-btn.active { background: #fff; color: var(--blue); font-weight: 500; box-shadow: 0 1px 2px rgba(0,0,0,.06); }
/* 切换按钮上挂的小计数 */
.seg-num {
  font-size: 12px; font-weight: 500; opacity: .8; margin-left: 4px;
}
.seg-btn.active .seg-num { opacity: 1; }

/* 分页条：一页放不下时翻页看 */
.pager {
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap;
  gap: 6px; margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line, #e9edf3);
}
.pager:empty { display: none; }
.pager-btn {
  min-width: 32px; height: 30px; padding: 0 9px; border-radius: 7px; cursor: pointer;
  border: 1px solid var(--line, #e5e7eb); background: #fff; color: var(--text-2, #5b6472);
  font-size: 13px; transition: .15s;
}
.pager-btn:hover { border-color: var(--blue-line, #c9d8fb); color: var(--blue, #3a7bfd); }
.pager-btn.active {
  background: var(--blue, #3a7bfd); border-color: var(--blue, #3a7bfd); color: #fff; font-weight: 600;
}
.pager-btn[disabled] { opacity: .45; cursor: not-allowed; }
.pager-info { font-size: 12.5px; color: var(--text-3, #8a93a3); margin-left: 6px; }
.pager-dots { color: var(--text-3, #8a93a3); padding: 0 2px; }

/* 记录列表 */
.record-list { display: flex; flex-direction: column; gap: 10px; }
.record {
  border: 1px solid var(--gray-line); border-radius: 8px; padding: 13px 15px;
  transition: .15s;
}
.record:hover { border-color: var(--blue-line); }
.record-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.record-time { font-size: 12px; color: var(--text-3); }
.record-cat {
  font-size: 11.5px; background: var(--blue-light); color: var(--blue);
  padding: 1px 8px; border-radius: 4px;
}
.record-cat.miss { background: #fdf1ec; color: var(--orange); }
.record-save { font-size: 11.5px; color: var(--green); margin-left: auto; }
.record-save.no { color: var(--text-3); }
.record-q { font-size: 14px; font-weight: 500; margin-bottom: 5px; }
.record-a { font-size: 13px; color: var(--text-2); line-height: 1.75; }
.record-ops { display: flex; gap: 8px; margin-top: 9px; }
.link-btn {
  border: none; background: none; color: var(--blue);
  font-size: 12.5px; cursor: pointer; padding: 0;
}
.link-btn:hover { text-decoration: underline; }
.link-btn.danger { color: var(--red); }

/* 文件库 */
.file-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.file-card {
  border: 1px solid var(--gray-line); border-radius: 8px; padding: 13px;
  transition: .15s; background: #fff;
}
.file-card:hover { border-color: var(--blue-line); box-shadow: 0 2px 10px rgba(31,39,51,.06); }
.file-top { display: flex; align-items: center; gap: 9px; margin-bottom: 8px; }
.file-ico {
  width: 32px; height: 32px; border-radius: 6px; background: var(--blue-light);
  color: var(--blue); display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600; flex-shrink: 0;
}
.file-name { font-size: 13.5px; font-weight: 500; word-break: break-all; line-height: 1.4; }
.file-meta { font-size: 12px; color: var(--text-3); margin-bottom: 9px; }
.file-tags { display: flex; gap: 6px; margin-bottom: 9px; flex-wrap: wrap; }
.ftag { font-size: 11px; padding: 1px 7px; border-radius: 4px; background: var(--gray-bg); color: var(--text-2); }
.ftag.ok { background: #eaf7f1; color: var(--green); }
.file-ops { display: flex; gap: 8px; flex-wrap: wrap; }

/* 统计块 */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 14px; }
.stat {
  background: var(--gray-bg); border-radius: 8px; padding: 12px 14px;
  display: flex; flex-direction: column; gap: 2px;
}
.stat-label { font-size: 12px; color: var(--text-3); }
.stat b { font-size: 14px; font-weight: 500; word-break: break-all; }

.log-list { display: flex; flex-direction: column; gap: 8px; }
.log-item {
  display: flex; gap: 10px; align-items: baseline;
  font-size: 13px; padding: 9px 12px;
  background: var(--gray-bg); border-radius: 7px;
}
.log-time { font-size: 12px; color: var(--text-3); flex-shrink: 0; }
.log-text { color: var(--text-2); }
.log-empty { font-size: 13px; color: var(--text-3); }

/* 表单 */
.form-row {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 12px; flex-wrap: wrap;
}
.form-row label { width: 118px; font-size: 13.5px; color: var(--text-2); flex-shrink: 0; }
.form-row .input { flex: 1; min-width: 220px; }
.form-val {
  flex: 1; font-size: 13.5px; color: var(--text);
  background: var(--gray-bg); padding: 7px 11px; border-radius: 7px;
}
.desc-list { margin: 0; padding-left: 20px; color: var(--text-2); }
.desc-list li { margin-bottom: 7px; font-size: 13.5px; line-height: 1.75; }

/* ---------- 右侧栏 ---------- */
.rightbar { position: sticky; top: 74px; display: flex; flex-direction: column; gap: 12px; }
.rb-card { background: #fff; border: 1px solid var(--gray-line); border-radius: var(--radius); padding: 13px 15px; }
.rb-title { font-size: 13.5px; font-weight: 600; margin-bottom: 10px; }
.rb-body { display: flex; flex-direction: column; gap: 9px; }
.rb-empty { margin: 0; font-size: 12.5px; color: var(--text-3); }
.rb-item { font-size: 12.5px; color: var(--text-2); line-height: 1.6; }
.rb-item .rb-t { font-size: 11.5px; color: var(--text-3); display: block; }
.rb-item.ok { color: var(--green); }
.rb-item.err { color: var(--red); }

/* ---------- 弹层 / 提示 ---------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(31, 39, 51, .38);
  display: flex; align-items: center; justify-content: center; z-index: 200;
}
.modal {
  background: #fff; border-radius: 12px; padding: 22px;
  width: 420px; max-width: calc(100vw - 40px); box-shadow: 0 12px 40px rgba(0,0,0,.18);
}
.modal-lg { width: 720px; }
.modal-title { font-size: 15.5px; font-weight: 600; margin-bottom: 16px; }
.progress { height: 6px; background: var(--gray-bg); border-radius: 4px; overflow: hidden; }
.progress-bar {
  height: 100%; width: 0; border-radius: 4px;
  background: linear-gradient(90deg, #3a7bfd, #2f6feb); transition: width .25s;
}
.modal-stage { font-size: 13px; color: var(--text-2); margin-top: 10px; }
.modal-foot { display: flex; align-items: center; gap: 10px; margin-top: 16px; }
.modal-count { font-size: 12.5px; color: var(--text-3); margin-right: auto; }
.preview-body {
  max-height: 55vh; overflow: auto; background: var(--gray-bg);
  border-radius: 8px; padding: 14px; font-size: 13px; line-height: 1.8;
  white-space: pre-wrap; word-break: break-word; margin: 0;
  font-family: inherit;
}

.toast-wrap {
  position: fixed; top: 72px; right: 20px; z-index: 300;
  display: flex; flex-direction: column; gap: 8px;
}
.toast {
  background: #fff; border: 1px solid var(--gray-line);
  border-left: 3px solid var(--blue);
  border-radius: 8px; padding: 10px 16px; font-size: 13.5px;
  box-shadow: 0 6px 24px rgba(31,39,51,.12);
  animation: slideIn .22s ease; max-width: 340px;
}
.toast.ok { border-left-color: var(--green); }
.toast.err { border-left-color: var(--red); }
@keyframes slideIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }

/* ---------- 响应式：平板 ---------- */
@media (max-width: 1240px) {
  .layout { grid-template-columns: 190px minmax(0, 1fr); }
  /* 右栏不隐藏，改成整行落到正文下方，目录始终能点 */
  .rightbar {
    grid-column: 1 / -1; position: static; margin-top: 2px;
    flex-direction: row; flex-wrap: wrap; align-items: stretch;
  }
  .rb-card { flex: 1 1 280px; }
}

/* 手机端悬浮按钮：默认电脑上完全不出现 */
.mnav-fab { display: none; }

/* ---------- 响应式：手机 / H5 ---------- */
@media (max-width: 860px) {
  /* 单列布局，底部固定导航，给导航留出空间 */
  /* 底部留白按导航胶囊的实际高度算（--mnav-h 由 JS 量出来），内容不会被胶囊挡住 */
  .layout { display: block; padding: 12px 12px calc(var(--mnav-h, 76px) + 30px); max-width: 100%; }
  /* 收起后只剩右下角那个圆按钮，留白可以少一点 */
  body.mnav-min .layout { padding-bottom: calc(var(--mnav-h, 76px) + 4px); }
  .topbar { gap: 10px; padding: 0 12px; flex-wrap: wrap; }
  .brand { min-width: 0; }
  .brand-text { min-width: 0; overflow: hidden; }
  .brand-name { font-size: 14px; }
  .brand-mark { flex: 0 0 auto; }
  .top-right { gap: 8px; flex-wrap: wrap; justify-content: flex-end; min-width: 0; }
  .top-right .btn { padding: 7px 11px; font-size: 12.5px; flex: 0 0 auto; }
  .brand-sub { display: none; }
  .brand-name { font-size: 15px; }
  .brand { flex-shrink: 0; }
  .topnav { display: none; }
  .device-tip { display: none; }
  .kb-status { display: none; } /* 移动端顶栏空间有限，知识库状态在管理后台「知识库更新同步」页可查 */

  /* 侧边栏 → 底部「悬浮胶囊 + 可横向滑动」导航：
     条目多也不挤，左右滑能翻，右下角按钮一按就缩成小圆点，看内容更敞亮 */
  .sidebar {
    position: fixed; left: 10px; right: 10px; bottom: 10px; top: auto; z-index: 80;
    display: flex; flex-direction: row; align-items: stretch; gap: 2px;
    border-radius: 20px; border: 1px solid var(--gray-line, #e8ebf0);
    background: rgba(255, 255, 255, .97);
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    box-shadow: 0 6px 24px rgba(31, 39, 51, .14);
    overflow-x: auto; overflow-y: hidden;
    -webkit-overflow-scrolling: touch; scrollbar-width: none;
    scroll-behavior: smooth;
    transition: transform .26s ease, opacity .2s ease;
  }
  .sidebar::-webkit-scrollbar { display: none; }
  /* 改版后用户菜单项包在 #sideMenuUser 一层里（桌面无所谓），手机上必须让它自己横向排，
     否则这层 div 竖着堆，会把底部胶囊撑成一根大柱子挡住整个正文 */
  #sideMenuUser { display: flex; flex-direction: row; flex: 0 0 auto; gap: 2px; min-width: 0; }
  .side-title { display: none; }
  .side-logout { display: none; }  /* 手机端底部标签栏空间有限，退出走顶栏那个「退出账号」按钮 */
  .side-item {
    flex: 0 0 auto; min-width: 68px; max-width: 96px;
    flex-direction: column; gap: 3px; justify-content: center;
    padding: 6px 4px; margin: 0; text-align: center; border-radius: 12px;
  }
  .side-item .ico { font-size: 19px; }
  .side-item span:not(.ico):not(.badge) {
    font-size: 11px; line-height: 1.25;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .side-item .badge {
    position: absolute; top: 0; right: 14%; margin: 0;
    padding: 0 6px; min-width: 16px;
  }
  /* 管理员那几个入口前面加道浅浅的竖线，跟用户功能分开 */
  .side-item[data-admin] { position: relative; }
  .side-item[data-admin]::before {
    content: ""; position: absolute; left: -1px; top: 22%; bottom: 22%;
    width: 1px; background: var(--gray-line, #e8ebf0);
  }

  /* 右下角悬浮按钮：点一下收起导航（只剩它），再点一下展开
     展开时它要坐在导航胶囊「上方」，不然会压住最右边那几个入口 */
  .mnav-fab {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    position: fixed; right: 12px;
    bottom: calc(var(--mnav-h, 76px) + 18px + env(safe-area-inset-bottom));
    z-index: 90; width: 54px; height: 54px; border-radius: 50%;
    border: none; background: var(--blue, #3a7bfd); color: #fff; cursor: pointer;
    box-shadow: 0 6px 18px rgba(58, 123, 253, .38);
    font-size: 11px; line-height: 1.1; gap: 1px; padding: 0;
    transition: transform .2s ease, opacity .2s ease, bottom .26s ease;
  }
  .mnav-fab .mnav-fab-ico { font-size: 18px; line-height: 1; }
  .mnav-fab:active { transform: scale(.94); }
  /* 收起状态：胶囊滑下去藏起来，浮标落回右下角 */
  body.mnav-min .sidebar {
    transform: translateY(calc(100% + 24px)); opacity: 0; pointer-events: none;
  }
  body.mnav-min .mnav-fab {
    background: #fff; color: var(--blue, #3a7bfd);
    bottom: calc(14px + env(safe-area-inset-bottom));
  }
  body.mnav-min .mnav-fab .mnav-fab-ico { transform: rotate(0deg); }

  /* 手机端：右栏落到正文下面，普通用户只保留目录，管理员照旧全显示
     （min-width:0 很重要：目录标题是不换行的，不加这个会把整页撑宽、手机上整页被缩小） */
  .rightbar { display: flex; margin-top: 4px; min-width: 0; max-width: 100%; }
  .rb-card { flex: 1 1 100%; min-width: 0; max-width: 100%; overflow: hidden; }
  .rb-body { min-width: 0; }
  .rb-cat { min-width: 0; }
  body:not(.is-admin) .rb-card:not(.cat-card) { display: none; }

  .card { padding: 15px 13px; margin-bottom: 12px; }
  .view-head h1 { font-size: 18px; }
  .q-input { min-height: 112px; font-size: 16px; }   /* 16px 避免 iOS 自动放大 */
  .answer-meta { gap: 10px; }
  .q-actions .q-meta { margin-left: 0; }
  .modal { width: calc(100vw - 28px); }
  .modal-lg { width: calc(100vw - 28px); }
  .toast-wrap { right: 12px; left: 12px; top: 64px; }
  .toast { max-width: none; }
  .file-grid { grid-template-columns: 1fr; }
}

/* ---------- 响应式：小屏手机 ---------- */
@media (max-width: 480px) {
  .mnav-fab { width: 48px; height: 48px; font-size: 10px; }
  .mnav-fab .mnav-fab-ico { font-size: 16px; }
  .btn-sync .sync-label { display: none; }
  .btn { padding: 8px 12px; font-size: 13px; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .top-right { gap: 8px; }
}

/* ===== 商品介绍 ===== */
.card-title { display: flex; align-items: center; }
.card-title-btn { margin-left: auto; }
.goods-grid {
  display: grid; grid-template-columns: 1fr; gap: 16px;
}
.goods-card {
  display: flex; flex-direction: column;
  border: 1px solid var(--gray-line); border-radius: var(--radius);
  background: #fff; overflow: hidden; transition: box-shadow .18s, transform .18s;
}
.goods-card:hover { box-shadow: 0 4px 16px rgba(31, 39, 51, .09); transform: translateY(-2px); }
.gc-cover {
  height: 150px; background: var(--gray-bg);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.gc-cover img { width: 100%; height: auto; display: block; }
.gc-noimg { font-size: 40px; opacity: .35; }
.gc-body { padding: 12px 13px 13px; display: flex; flex-direction: column; flex: 1; }
.gc-name { margin: 0 0 5px; font-size: 15px; font-weight: 700; line-height: 1.45; color: var(--text); }
.gc-sub { margin: 0 0 8px; font-size: 12.8px; color: var(--text-2); line-height: 1.65; }
.gc-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 9px; }
.gc-tags span {
  padding: 2px 8px; border-radius: 20px; font-size: 11.5px;
  background: var(--blue-light); color: var(--blue-dark);
}
.gc-foot {
  display: flex; align-items: center; gap: 10px; margin-top: auto; padding-top: 4px;
}
.gc-price { font-size: 15px; color: #d9534f; font-weight: 700; }
.gc-foot .btn { margin-left: auto; }
.gc-more {
  margin-top: 10px; padding: 6px 0; border: none; background: none;
  color: var(--blue); font-size: 12.8px; cursor: pointer; text-align: left; font-family: inherit;
}
.gc-intro {
  margin-top: 6px; padding: 10px 12px; background: var(--gray-bg);
  border-radius: 8px; font-size: 13px; color: var(--text-2); line-height: 1.8;
}
.gc-intro p { margin: 0 0 7px; }
.gc-intro p:last-child { margin-bottom: 0; }
.gc-admin {
  display: flex; gap: 8px; padding: 9px 13px;
  border-top: 1px solid var(--gray-line); background: #fafbfc;
}

/* 弹窗里的表单 */
.form-body { padding: 4px 0 8px; max-height: 62vh; overflow-y: auto; }
.form-body .form-row label { width: 116px; }
.form-body textarea.input { width: 100%; min-height: 110px; resize: vertical; line-height: 1.7; }

@media (max-width: 640px) {
  .form-body .form-row label { width: 100%; }
}

/* ===== 右侧栏知识库目录 + 目录弹层 ===== */
.rb-cat {
  display: block; text-decoration: none; padding: 7px 9px; margin: 0 0 6px;
  border: 1px solid transparent; border-radius: 8px; background: var(--gray-bg);
  transition: .15s;
}
.rb-cat:hover { border-color: var(--blue-line); background: var(--blue-light); }
.rb-cat-t {
  display: block; font-size: 12.8px; color: var(--text); font-weight: 500;
  line-height: 1.5; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.rb-cat:hover .rb-cat-t { color: var(--blue-dark); }
.rb-cat-m { display: block; margin-top: 3px; font-size: 11px; color: var(--text-3); }
.rb-cat.hot .rb-cat-m { color: var(--blue); }

.cat-list { max-height: 62vh; overflow-y: auto; padding: 4px 2px 10px; }
.cat-group { margin-bottom: 14px; }
.cat-gt {
  font-size: 13px; font-weight: 700; color: var(--text);
  padding: 5px 0 7px; border-bottom: 1px solid var(--gray-line); margin-bottom: 7px;
}
.cat-gt i { font-style: normal; font-weight: 400; font-size: 11.5px; color: var(--text-3); }
.cat-i {
  display: flex; align-items: center; gap: 8px; padding: 6px 9px; border-radius: 7px;
  font-size: 13px; color: var(--text-2); text-decoration: none; cursor: pointer;
}
.cat-i:hover { background: var(--blue-light); color: var(--blue-dark); }
.cat-i span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-hot {
  flex: 0 0 auto; font-style: normal; font-size: 11px;
  color: var(--blue); background: var(--blue-light); padding: 1px 7px; border-radius: 10px;
}

/* ---------- 首屏资料墙 ---------- */
.feed { margin-top: 4px; }
.feed-head {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--gray-line);
}
.feed-title { font-size: 14px; font-weight: 600; }
.feed-count { font-size: 12px; color: var(--text-3); }
.feed-head .rb-link { margin-left: auto; }
.feed-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.feed-card {
  display: block; background: var(--gray-bg); border: 1px solid var(--gray-line);
  border-radius: 10px; padding: 12px 13px; text-decoration: none; color: inherit;
  transition: border-color .15s, background .15s;
}
.feed-card:hover { border-color: var(--blue-line); background: var(--blue-light); }
.feed-top { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; }
.feed-cat {
  font-size: 11px; color: var(--blue-dark); background: var(--blue-light);
  padding: 1px 8px; border-radius: 10px;
}
.feed-hot { font-size: 11px; color: var(--text-3); }
.feed-name { font-size: 14px; font-weight: 600; line-height: 1.45; margin-bottom: 5px; }
.feed-sum { font-size: 12.5px; color: var(--text-2); line-height: 1.65; }

@media (max-width: 860px) {
  .feed-grid { grid-template-columns: 1fr; }
}

/* ---------- 知识库管理页 ---------- */
.adm-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border: 1px solid var(--gray-line);
  border-radius: 10px; margin-bottom: 8px; background: #fff;
}
.adm-row:hover { border-color: var(--blue-line); background: var(--blue-light); }
.adm-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.adm-main b { font-size: 14px; line-height: 1.45; word-break: break-all; }
.adm-meta { font-size: 12px; color: var(--text-3); }
.adm-ops { display: flex; gap: 6px; flex-shrink: 0; }
.adm-check { flex: 0 0 auto; display: flex; align-items: center; padding: 0 2px; }
.adm-check input { width: 16px; height: 16px; cursor: pointer; }
.kb-bulk-bar .spacer { flex: 1; }
.kb-bulk-bar #kbBulkDel:disabled { opacity: .5; cursor: not-allowed; }
.form-body { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.fld { display: flex; flex-direction: column; gap: 4px; }
.fld > span { font-size: 12px; color: var(--text-2); }
.fld-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.modal-lg { width: min(760px, 94vw); max-height: 90vh; overflow: auto; }
@media (max-width: 640px) {
  .adm-row { flex-direction: column; align-items: stretch; }
  .adm-ops { justify-content: flex-end; }
  .fld-row { grid-template-columns: 1fr; }
}

/* ---------- 给老陈提建议 ---------- */
/* 后台：建议原文可能很长，整段换行显示，别挤成一行 */
.sg-row .adm-main b {
  font-weight: 400; white-space: pre-wrap; word-break: break-word; line-height: 1.7;
}
.sg-row.is-new { border-color: var(--blue-line); background: var(--blue-light); }
.sg-row .q-tag { flex: none; margin-right: 4px; vertical-align: 1px; }
/* 前台「我提过的」：联系方式淡一点 */
.li-contact { font-style: normal; color: var(--text-3); }

/* ---------- 搜索记录页 ---------- */
.q-tag {
  font-style: normal; font-size: 11.5px; padding: 2px 8px; border-radius: 10px;
  align-self: center; white-space: nowrap;
}
.q-tag.ok { background: var(--green-bg, #e8f7ee); color: #1a7f43; }
.q-tag.near { background: #fff4e5; color: #b36500; }
.q-tag.miss { background: #fdeaea; color: var(--red); }
.q-tag.open { background: var(--blue-light); color: var(--blue-dark); }

/* ---------- 会员 / 激活码 ---------- */
.btn-user {
  background: linear-gradient(135deg, #ff9f43, #ff7a1a);
  border: none; color: #fff; font-weight: 500;
}
.btn-user:hover { filter: brightness(1.06); }
.btn-user.on { background: #fff; border: 1px solid #ffd6a8; color: #b36500; }
.quota-meta { color: #b36500; }
.code-str { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .5px; }
.stat-grid .stat b { font-size: 22px; }
.hint.ok, .hint.inline.ok { color: #1a7f43; font-weight: 500; }
.hint.err, .hint.inline.err { color: var(--red); font-weight: 500; }

/* ---------- 搜索记录：按时间筛选 ---------- */
.date-filter {
  align-items: center; flex-wrap: wrap; gap: 6px;
  margin-top: -4px; padding: 8px 10px;
  background: var(--gray-light, #f7f8fa); border-radius: 10px;
}
.df-label { font-size: 13px; color: var(--gray, #888); white-space: nowrap; }
.date-filter .input { padding: 6px 10px; font-size: 13px; min-height: 0; }
.date-filter select.input { cursor: pointer; }
@media (max-width: 640px) {
  .date-filter .input { max-width: none !important; flex: 1 1 30%; }
}

/* ---------- 商品：上传图片 / 二维码 ---------- */
.up-wrap { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.up-preview {
  width: 96px; height: 96px; border-radius: 10px; background-color: var(--gray-bg);
  background-size: contain; background-repeat: no-repeat; background-position: center;
  border: 1px dashed var(--gray-line); flex: 0 0 auto;
}
.up-preview.has { border-style: solid; }
.up-preview.qr { width: 84px; height: 84px; }
.up-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* 商品卡：图片按设定宽度显示 */
.gc-cover { height: auto; padding: 10px; cursor: default; }
.gc-cover.has-qr { cursor: pointer; }
.gc-cover-img { display: block; height: auto; border-radius: 8px; margin: 0 auto; }
.gc-cover.has-qr:hover { background: var(--gray-bg); }
.gc-scan {
  position: absolute; right: 10px; bottom: 10px;
  background: var(--blue); color: #fff; font-size: 11px;
  padding: 3px 8px; border-radius: 12px; pointer-events: none;
}
.gc-cover { position: relative; }

.goods-qr-img {
  width: 240px; height: 240px; object-fit: contain; margin: 6px auto 0;
  border-radius: 10px; background: #fff; border: 1px solid var(--gray-line);
}

/* 内联提问记录：点「提问记录」按钮后在答疑卡片里展开 */
.hist-inline { margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--gray-line); }
.hi-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.hi-title { font-size: 14.5px; font-weight: 600; }
.hi-stat { font-size: 12.5px; color: var(--text-3); }
.hi-search { flex: 1; min-width: 140px; max-width: 260px; }

/* 正文里的附件下载卡片（管理员在编辑时插入的文件，访客点一下就下载） */
.file-dl {
  display: inline-flex; align-items: center; gap: 8px;
  margin: 6px 0; padding: 8px 13px;
  background: var(--blue-light); border: 1px solid var(--blue-line);
  border-radius: 8px; color: var(--blue); font-size: 13.5px;
  text-decoration: none; transition: .15s;
}
.file-dl:hover { background: #dce8fd; border-color: var(--blue); }
.fd-ico { font-size: 15px; }
.fd-name {
  font-weight: 500; max-width: 340px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.fd-go { font-size: 12px; color: var(--blue-dark); }

/* ---------- 提问后弹出的「关联文档」清单 ---------- */
.rel-doc-bar { margin-top: 14px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
/* 关联文档弹窗：加宽、不限制内部高度，几篇就撑多高，不再冒内部滚动条 */
#relDocModal { align-items: flex-start; padding: 26px 16px; overflow: auto; }
/* 居中：用 margin:auto 而不是 align-items:center —— 内容比屏幕高时也不会把顶部裁掉 */
#relDocModal .modal { margin: auto; }
#relDocModal .modal-lg { width: min(760px, calc(100vw - 40px)); }
.rd-list { display: flex; flex-direction: column; gap: 10px; }
.rd-item {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 16px; border: 1px solid var(--gray-line); border-radius: 10px;
  background: #fff; cursor: pointer; transition: .15s;
}
.rd-item:hover { border-color: var(--blue); background: var(--blue-light); transform: translateX(2px); }
.rd-tag {
  flex: none; font-size: 11.5px; padding: 2px 8px; border-radius: 20px;
  border: 1px solid var(--gray-line); color: var(--text-3); background: var(--gray-bg);
}
.rd-tag.is-admin { color: var(--orange); border-color: #f3d9b8; background: #fff7ec; }
.rd-tag.is-auto { color: var(--blue); border-color: var(--blue-line); background: var(--blue-light); }
.rd-t { font-size: 14px; color: var(--text); flex: 1; min-width: 0; }
.rd-cat { flex: none; font-size: 12px; color: var(--text-3); }
.rd-go { flex: none; font-size: 12.5px; color: var(--blue); }
.rd-del { flex: none; padding: 2px 9px !important; }
.rd-del:hover { color: var(--red) !important; border-color: var(--red) !important; }

/* ---------- 后台编辑：给一篇钉关联文档 ---------- */
.rd-edit {
  margin-top: 4px; padding: 11px 13px;
  background: var(--gray-bg); border: 1px dashed var(--gray-line); border-radius: 10px;
}
.rd-cur { display: flex; flex-wrap: wrap; gap: 7px; margin: 8px 0; }
.rd-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 9px; border-radius: 20px; font-size: 12.5px;
  background: #fff7ec; border: 1px solid #f3d9b8; color: var(--orange);
}
.rd-chip.off { background: var(--gray-bg); border-color: var(--gray-line); color: var(--text-3); }
.rd-x { cursor: pointer; font-style: normal; font-size: 12px; opacity: .65; }
.rd-x:hover { opacity: 1; color: var(--red); }
.rd-add { display: flex; align-items: center; gap: 8px; }
.rd-pick { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; max-height: 200px; overflow: auto; }
.rd-pick-i {
  display: flex; align-items: center; gap: 8px; cursor: pointer;
  padding: 7px 10px; background: #fff; border: 1px solid var(--gray-line); border-radius: 8px;
  font-size: 13px; transition: .15s;
}
.rd-pick-i span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rd-pick-i b { flex: none; font-size: 12px; color: var(--blue); font-weight: 500; }
.rd-pick-i:hover { border-color: var(--blue); background: var(--blue-light); }
.rd-pick-i.has { cursor: default; opacity: .6; }
.rd-pick-i.has b { color: var(--text-3); }

/* ---------- 提交提问：不闪眼 ---------- */
/* 检索中不再清空内容，只是压暗一点；结果回来直接淡入替换 */
#answerCard > * { transition: opacity .22s ease; }
#answerCard.is-searching > *:not(.card-title):not(.search-progress) { opacity: .5; }
/* 进度条贴着卡片顶边走，不占布局，避免出现时把内容顶下去一截 */
#answerCard { position: relative; }
.search-progress {
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  border-radius: 12px 12px 0 0; background: rgba(0, 0, 0, .05); overflow: hidden;
}
.search-progress i {
  display: block; height: 100%; width: 34%; border-radius: 3px;
  background: linear-gradient(90deg, #3a7bfd, #2f6feb);
  animation: spSlide 1s ease-in-out infinite;
}
@keyframes spSlide { from { margin-left: -34%; } to { margin-left: 100%; } }
/* 内容替换用淡入，别硬切 */
.fade-in { animation: fadeIn .26s ease both; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
/* 关联文档弹窗淡入，别"啪"地蹦出来 */
#relDocModal { animation: maskIn .12s ease both; }
#relDocModal .modal { animation: popIn .24s cubic-bezier(.2, .8, .3, 1) both; }
@keyframes maskIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { from { opacity: 0; transform: translateY(8px) scale(.985); } to { opacity: 1; transform: none; } }

/* ================= 优质笔记拆解 ================= */
.nb-cats { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 18px; }
.nb-cat {
  border: 1px solid var(--line, #e5e7eb); background: #fff; color: #333;
  padding: 7px 16px; border-radius: 999px; cursor: pointer; font-size: 14px;
  transition: all .15s ease;
}
.nb-cat:hover { border-color: #3a7bfd; color: #3a7bfd; }
.nb-cat.on { background: #3a7bfd; border-color: #3a7bfd; color: #fff; }

#noteGrid { min-height: 220px; transition: min-height .34s ease; }
.nb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.nb-card {
  border: 1px solid var(--line, #e5e7eb); border-radius: 14px; overflow: hidden;
  background: #fff; cursor: pointer; transition: transform .15s ease, box-shadow .15s ease;
}
.nb-card:hover { transform: translateY(-3px); box-shadow: 0 8px 22px rgba(0,0,0,.08); }
.nb-cover {
  aspect-ratio: 3 / 4; height: auto; width: 100%;
  background-size: cover; background-position: center; background-color: #f1f3f7;
}
.nb-cover.nb-nopic { display: flex; align-items: center; justify-content: center; font-size: 40px; }
.nb-info { padding: 12px 14px 14px; }
.nb-title { font-weight: 700; font-size: 15px; line-height: 1.4; margin-bottom: 8px; }
.nb-meta { font-size: 12px; color: #888; display: flex; align-items: center; gap: 6px; }
.nb-tag { font-size: 11px; padding: 1px 8px; border-radius: 999px; font-style: normal; }
.nb-tag.free { background: #e6f7ec; color: #1a9e54; }
.nb-tag.vip { background: #fff3e0; color: #d98300; }

/* 笔记详情弹窗 */
.nb-detail { padding: 4px 2px 8px; }
.nb-pics { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.nb-pic { width: 100%; border-radius: 12px; border: 1px solid #eee; }
.nb-source { font-size: 13px; color: #666; margin-bottom: 12px; }
.nb-source a { color: #3a7bfd; }
.nb-sec { margin-bottom: 16px; padding: 12px 14px; border-radius: 12px; }
.nb-sec-t {
  font-weight: 700; font-size: 15px; color: #1f2d3d; margin-bottom: 6px;
  padding-left: 10px; border-left: 3px solid #3a7bfd;
}
.nb-sec-b { font-size: 14px; line-height: 1.7; color: #3a4452; white-space: normal; }
/* 四块底色区分：① 粉 ② 蓝 ③ 绿 ④ 黄（前台详情和后台编辑同一套色，好认） */
.nb-sec.s1 { background: #fff5f8; }
.nb-sec.s1 .nb-sec-t { border-left-color: #ff6b9d; }
.nb-sec.s2 { background: #f2f7ff; }
.nb-sec.s2 .nb-sec-t { border-left-color: #3a7bfd; }
.nb-sec.s3 { background: #f0fdf4; }
.nb-sec.s3 .nb-sec-t { border-left-color: #22a35a; }
.nb-sec.s4 { background: #fffbeb; }
.nb-sec.s4 .nb-sec-t { border-left-color: #f0a020; }
/* 插入的图片默认居中 */
.nb-sec-b img { display: block; max-width: 100%; max-height: 260px; width: auto; margin: 10px auto; border-radius: 10px; border: 1px solid #eee; }
.nb-lock {
  text-align: center; background: #f7f9fc; border: 1px dashed #d7deea;
  border-radius: 12px; padding: 22px 16px; margin-top: 6px;
}
.nb-lock-ico { font-size: 30px; margin-bottom: 6px; }
.nb-lock p { color: #667; font-size: 14px; margin: 0 0 14px; }

/* ---------- 选题延伸思路 ---------- */
/* 切筛选时条目会变少，给列表兜个底高，页面不会一下缩到很短（配合 keepAnchor 用） */
#topicGrid { min-height: 220px; transition: min-height .34s ease; }
.tp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.tp-card {
  border: 1px solid var(--gray-line); border-radius: var(--radius);
  background: #fff; padding: 14px 15px; cursor: pointer;
  transition: box-shadow .18s, transform .18s;
}
.tp-card:hover { transform: translateY(-3px); box-shadow: 0 8px 22px rgba(0,0,0,.08); }
.tp-head { display: flex; align-items: flex-start; gap: 10px; }
.tp-title { font-size: 15px; font-weight: 600; line-height: 1.5; flex: 1; }
.tp-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 8px; }
.tp-tag {
  font-size: 11.5px; padding: 2px 9px; border-radius: 999px;
  background: var(--gray-bg); color: var(--text-2);
}
.tp-tag.ind { background: #eaf2ff; color: #2f6feb; }
.tp-tag.sty { background: #fff1e8; color: #d9660a; }
.tp-subs { list-style: none; margin: 0; padding: 0; }
.tp-subs li {
  font-size: 13px; color: var(--text-2); line-height: 1.6;
  padding: 3px 0; display: flex; gap: 7px; align-items: flex-start;
}
.tp-subs li em { font-style: normal; color: var(--blue); flex: none; }
.tp-subs li.tp-more { color: var(--text-3); font-size: 12px; }
.tp-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
/* 按标题公式套标题（选题延伸思路页顶部的小工具） */
.tp-gen-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 10px 0 12px; }
.tp-gen-row .input { flex: 1 1 220px; min-width: 0; }
.tp-gen-row .btn { flex: none; }
.tp-gen-out { margin-top: 4px; }
.tp-gen-head { font-size: 12.5px; color: var(--text-3); margin: 10px 0 8px; }
.tp-gen-item {
  border: 1px solid var(--gray-line); border-radius: var(--radius); background: #fff;
  padding: 10px 12px; margin-bottom: 8px; cursor: pointer;
  transition: border-color .15s, background .15s;
}
.tp-gen-item:hover { border-color: var(--blue); background: #f7faff; }
.tp-gen-t { font-size: 14.5px; font-weight: 600; line-height: 1.55; color: var(--text-1); }
.tp-gen-m { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 7px; }
.tp-gen-s { font-size: 11.5px; color: var(--text-3); }
.tp-gen-copy { margin-left: auto; font-size: 12px; color: var(--blue); }
.card .sub code { background: var(--gray-bg); padding: 1px 5px; border-radius: 4px; font-size: 12px; }
/* 详情：延伸标题列表 */
.tp-list { margin: 0; padding-left: 20px; }
.tp-list li { margin-bottom: 10px; line-height: 1.7; }
.tp-list li b { display: block; font-size: 14.5px; }
.tp-d { color: var(--text-2); font-size: 13.5px; margin-top: 2px; }
/* 后台表单：延伸标题小块 */
.tp-sub {
  border: 1px solid var(--gray-line); border-radius: 10px;
  padding: 10px 12px; margin-bottom: 10px; background: #fbfcfe;
}
.tp-sub-h { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.tp-sub-h em { font-style: normal; color: var(--blue); font-size: 14px; }
.tp-sub-del {
  margin-left: auto; border: none; background: none; cursor: pointer;
  color: var(--text-3); font-size: 12.5px; padding: 2px 4px;
}
.tp-sub-del:hover { color: var(--red); }
.tp-sub-t { width: 100%; margin-bottom: 6px; }
.tp-sub-d { width: 100%; }

/* 后台编辑：①②③④ 四块同样用底色区分，每块都能插图 */
.nb-blk { padding: 12px 14px; border-radius: 12px; margin-bottom: 14px; }
.nb-blk.s1 { background: #fff5f8; }
.nb-blk.s2 { background: #f2f7ff; }
.nb-blk.s3 { background: #f0fdf4; }
.nb-blk.s4 { background: #fffbeb; }
.nb-blk-t {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  font-weight: 700; font-size: 14px; color: #1f2d3d; margin-bottom: 8px;
}
.nb-img-btn {
  font-size: 12px; padding: 3px 10px; border-radius: 999px; cursor: pointer;
  border: 1px solid #c9d4e4; background: #fff; color: #3a7bfd; font-weight: 600;
}
.nb-img-btn:hover { background: #3a7bfd; border-color: #3a7bfd; color: #fff; }
.nb-ed {
  background: #fff; border: 1px solid #dfe6f0; border-radius: 10px;
  padding: 10px 12px; min-height: 60px; outline: none;
  font-size: 14px; line-height: 1.7; color: #2c3542;
}
.nb-ed:focus { border-color: #3a7bfd; box-shadow: 0 0 0 3px rgba(58,123,253,.12); }
.nb-ed img { display: inline-block; vertical-align: middle; max-width: 100%; max-height: 220px; width: auto; margin: 10px auto; border-radius: 10px; border: 1px solid #eee; }
/* 单张（这块里只有它一个元素）照旧独占一行居中；两张挨在一起就并排 —— 对应「删掉中间的换行就一行两张」 */
.nb-ed img:only-child { display: block; }
.nb-inline-img { margin: 10px auto; }

/* 后台：块的小标题可以直接改，子标题能加能删 */
.nb-blk-t { flex-wrap: wrap; }
.nb-blk-title {
  flex: 1; min-width: 140px; font-size: 14px; font-weight: 700; color: #1f2d3d;
  border: 1px solid transparent; background: transparent; border-radius: 8px;
  padding: 4px 8px; outline: none; font-family: inherit;
}
.nb-blk-title:hover { border-color: #e3e8f0; background: rgba(255, 255, 255, .65); }
.nb-blk-title:focus { border-color: #3a7bfd; background: #fff; }
.nb-blk-ops { display: flex; gap: 6px; flex: none; align-items: center; flex-wrap: wrap; }
.nb-sub-add, .nb-blk-del {
  font-size: 12px; padding: 3px 10px; border-radius: 999px; cursor: pointer;
  border: 1px solid #c9d4e4; background: #fff; color: #5a6b82; font-weight: 600;
}
.nb-sub-add:hover { background: #3a7bfd; border-color: #3a7bfd; color: #fff; }
.nb-blk-del { color: #c0392b; border-color: #f0c8c2; }
.nb-blk-del:hover { background: #c0392b; border-color: #c0392b; color: #fff; }
.nb-sub {
  margin-top: 10px; padding: 8px 10px; border-radius: 10px;
  background: rgba(255, 255, 255, .7); border: 1px solid #e8edf5;
}
.nb-sub-t { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.nb-sub-title {
  flex: 1; min-width: 0; font-size: 13px; font-weight: 600; color: #2c3542;
  border: 1px solid transparent; background: transparent; border-radius: 6px;
  padding: 3px 6px; outline: none; font-family: inherit;
}
.nb-sub-title:hover { border-color: #e3e8f0; background: #fff; }
.nb-sub-title:focus { border-color: #3a7bfd; background: #fff; }
.nb-sub-del {
  flex: none; width: 22px; height: 22px; border-radius: 50%; line-height: 1;
  border: 1px solid #e3e8f0; background: #fff; color: #98a4b5; cursor: pointer;
}
.nb-sub-del:hover { background: #c0392b; border-color: #c0392b; color: #fff; }

/* 前台：子标题那一行 */
.nb-sub-b { margin-top: 8px; }
.nb-sub-b b { color: #1f2d3d; }

/* 笔记类弹窗：标题左、关闭按钮固定右上角；内容区自己滚，× 不会跟着滚走 */
.nb-modal { padding: 22px; }
.nb-modal .modal {
  max-height: calc(100vh - 44px); display: flex; flex-direction: column;
  padding: 0; overflow: hidden;
}
.nb-modal .modal-head {
  flex: none; display: flex; align-items: center; justify-content: space-between; gap: 14px;
  margin: 0; padding: 15px 22px 12px; background: #fff;
  border-bottom: 1px solid #eef1f6;
}
.nb-modal .modal-head .modal-title { margin-bottom: 0; font-size: 16px; }
.nb-modal .modal-body {
  flex: 1; overflow: auto; padding: 16px 22px 20px;
}
/* 内容详情弹窗（笔记拆解 / 内容创作思路 / 选题延伸）：标题居中，
   × 绝对定位到右上角，不占位置，否则标题会被挤偏半个按钮 */
.nb-modal .modal-head, #topicModal .modal-head {
  position: relative; justify-content: center; min-height: 54px;
}
.nb-modal .modal-head .modal-title, #topicModal .modal-head .modal-title {
  flex: 1; margin: 0; text-align: center; padding: 0 56px; line-height: 1.5;
}
.nb-modal .modal-head > .modal-x, #topicModal .modal-head > .modal-x {
  position: absolute; right: 22px; top: 50%; transform: translateY(-50%);
}
/* 关闭按钮：右上角圆形，看得见、点得到 */
.modal-x {
  flex: none; width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid #e3e8f0; background: #fff; color: #7a869a;
  font-size: 17px; line-height: 1; cursor: pointer; transition: all .15s;
}
.modal-x:hover { background: #f2f4f8; color: #222; border-color: #ccd4e0; }

/* ---------- 运营模板库 ---------- */
/* 列表切分类时高度会变，钉个下限 + 过渡，页面不会被浏览器往上一拽 */
#tplGrid { min-height: 340px; transition: min-height .34s ease; }
.tpl-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px;
}
.tpl-card {
  border: 1px solid var(--line, #e5e7eb); border-radius: 14px; background: #fff;
  padding: 13px 14px 13px; cursor: pointer; display: flex; flex-direction: column; gap: 10px;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.tpl-card:hover {
  transform: translateY(-3px); box-shadow: 0 8px 22px rgba(0,0,0,.08); border-color: var(--blue-line, #c9d8fb);
}
/* 封面：传了图就铺满，没传就用类型图标居中占位 —— 高度写死，卡片不会参差不齐 */
.tpl-cover {
  position: relative; width: 100%; aspect-ratio: 16 / 10; border-radius: 11px; overflow: hidden;
  background: var(--bg-soft, #f4f6f9); border: 1px solid var(--line-soft, #eef1f5);
  display: flex; align-items: center; justify-content: center;
}
.tpl-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tpl-cover.is-ph .tpl-badge { width: 56px; height: 56px; border-radius: 15px; font-size: 14px; }
/* 有封面时，类型小标压在左下角 */
.tpl-cover-badge {
  position: absolute; left: 8px; bottom: 8px; width: auto !important; height: auto !important;
  padding: 3px 8px; border-radius: 7px; font-size: 11px;
  box-shadow: 0 2px 8px rgba(0,0,0,.18); background: rgba(255,255,255,.94) !important;
}
.tpl-head { min-width: 0; }
.tpl-title { font-weight: 700; font-size: 15.5px; line-height: 1.45; word-break: break-word; }
.tpl-intro { font-size: 12.5px; color: var(--text-3, #8a93a3); line-height: 1.55; margin-top: 3px; }
/* 左上角那个小方标：一眼看出是表格、文档、压缩包还是软件 */
.tpl-badge {
  flex: none; width: 38px; height: 38px; border-radius: 9px; display: flex;
  align-items: center; justify-content: center; font-size: 11.5px; font-weight: 700; letter-spacing: .2px;
}
.tpl-badge.xls  { background: #e7f6ed; color: #1a9e54; }
.tpl-badge.doc  { background: #e5eefc; color: #2f6fe0; }
.tpl-badge.ppt  { background: #fdeee4; color: #d97b2c; }
.tpl-badge.pdf  { background: #fdeaea; color: #d94a4a; }
.tpl-badge.zip  { background: #fdf3e0; color: #b8801c; }
.tpl-badge.soft { background: #eeebf8; color: #6b57c7; }
.tpl-badge.link { background: #e5f4f8; color: #2a8fa8; font-size: 15px; }
.tpl-meta {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  font-size: 12px; color: var(--text-3, #8a93a3);
}
.tpl-foot {
  font-size: 12.5px; color: var(--blue, #3a7bfd); border-top: 1px dashed var(--line, #e9edf3);
  padding-top: 9px; margin-top: auto;
}
/* 详情弹窗里的封面：居中，原比例，不裁不改形 */
.tpl-view { display: flex; justify-content: center; margin: 0 auto 16px; }
.tpl-view-img {
  max-width: min(100%, 540px); max-height: 360px; width: auto; object-fit: contain;
  border-radius: 12px; border: 1px solid var(--line, #eee); background: #fafbfc;
}
/* 详情弹窗里的下载区 */
.tpl-dlbox { margin-top: 14px; text-align: center; }
.tpl-dlbox .btn { min-width: 240px; }
.tpl-dlnote { font-size: 12px; color: var(--text-3, #8a93a3); margin: 8px 0 0; }
.tpl-dlnote .tpl-link { color: var(--blue, #3a7bfd); text-decoration: none; word-break: break-all; }
.tpl-dlnote .tpl-link:hover { text-decoration: underline; }
/* 锁定态露出的下载地址：官网 / 网盘链接本来就公开，样式跟提示行保持一致 */
.tpl-dlbox-lock {
  margin-top: 12px; font-size: 12px; color: var(--text-3, #8a93a3); text-align: center;
}
.tpl-dlbox-lock .tpl-link { color: var(--blue, #3a7bfd); text-decoration: none; word-break: break-all; }
.tpl-dlbox-lock .tpl-link:hover { text-decoration: underline; }
/* 后台上传表单：选文件那一行 */
.tp-file-row { display: flex; align-items: center; gap: 10px; }
.tp-file-name {
  flex: 1; min-width: 0; font-size: 13px; color: var(--text-3, #8a93a3);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* 封面图上传后的小预览 */
.tp-cover-prev {
  width: 56px; height: 38px; object-fit: cover; border-radius: 6px;
  border: 1px solid var(--line, #e5e7eb); flex: none;
}
/* 通用弹窗头部：标题在左、× 固定在右上角（表单弹窗不让点空白处关闭，× 必须显眼） */
.modal > .modal-head {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  margin: 0 0 12px; padding: 0;
}
.modal > .modal-head .modal-title { margin-bottom: 0; }
/* 点空白处不再关闭，抖一下提示：请点右上角 × 或下面的保存 / 取消 */
@keyframes modal-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-7px); }
  40% { transform: translateX(7px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}
.modal.shake { animation: modal-shake .4s ease; }

/* 原笔记预览图：一行 2 张，点一下放大看 */
.nb-modal .nb-pics { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 14px; }
.nb-modal .nb-pic {
  width: 100%; aspect-ratio: 3 / 4; object-fit: cover;
  border-radius: 10px; border: 1px solid #eee; cursor: zoom-in;
}
/* 后台缩略图同样一行 2 张 */
#nfPics { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
#nfPics .nb-pic-item { position: relative; width: auto; }
#nfPics .nb-pic-item img {
  width: 100%; aspect-ratio: 3 / 4; object-fit: cover;
  border-radius: 8px; border: 1px solid #eee; cursor: zoom-in;
}
/* 看大图 */
.nb-viewer { background: rgba(0, 0, 0, .82); cursor: zoom-out; z-index: 400; padding: 26px; }
.nb-viewer img {
  max-width: 100%; max-height: 100%; object-fit: contain;
  border-radius: 8px; box-shadow: 0 10px 40px rgba(0, 0, 0, .4);
}

/* 后台编辑表单 */
.fld { display: block; margin-bottom: 14px; }
.fld > span { display: block; font-size: 13px; color: #555; margin-bottom: 6px; font-weight: 600; }
.fld.sub { margin-bottom: 10px; }
.fld.sub > span { font-size: 12px; color: #777; font-weight: 500; }
.fld-row { display: flex; gap: 14px; }
.fld-row .fld { flex: 1; }
.fld.inline { display: flex; flex-direction: row; align-items: center; gap: 8px; }
.fld.inline > span { margin: 0; font-weight: 500; }
.input, .ta, select.input {
  width: 100%; border: 1px solid var(--line, #e5e7eb); border-radius: 8px;
  padding: 9px 11px; font-size: 14px; font-family: inherit; background: #fff; color: #222;
}
.ta { resize: vertical; line-height: 1.6; }
.fld.inline .input { width: auto; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 8px; }
.nb-pic-actions { display: flex; gap: 8px; align-items: center; margin-top: 8px; flex-wrap: wrap; }
.nb-pic-actions .input { flex: 1; min-width: 160px; }
.nb-pic-item { position: relative; width: 92px; }
.nb-pic-item img { width: 92px; height: 92px; object-fit: cover; border-radius: 8px; border: 1px solid #eee; }
.nb-pic-del {
  position: absolute; top: -7px; right: -7px; width: 22px; height: 22px; border-radius: 50%;
  border: none; background: #ff4d4f; color: #fff; cursor: pointer; font-size: 13px; line-height: 1;
}

/* ============ 数据分析（后台） ============ */
.an-root { padding: 4px 0 40px; }
.an-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 14px 0 18px; }
.an-kpi { background: #fff; border: 1px solid #eef1f6; border-radius: 12px; padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; }
.an-kpi b { font-size: 26px; color: #1f2d3d; font-weight: 700; line-height: 1.1; }
.an-kpi span { font-size: 13px; color: #8a94a6; }
.an-kpi.live b { color: #22b07d; }
.an-card { background: #fff; border: 1px solid #eef1f6; border-radius: 12px; padding: 16px 18px; margin-bottom: 16px; }
.an-card-h { font-size: 16px; font-weight: 600; color: #1f2d3d; margin-bottom: 12px; }
.an-sub2 { font-size: 13px; color: #8a94a6; margin-bottom: 8px; }
.an-trend { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.an-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.chart-svg { width: 100%; height: 240px; display: block; }
.chart-axis { font-size: 11px; fill: #9aa4b5; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 8px; font-size: 12px; color: #5b6675; }
.lg-item { display: inline-flex; align-items: center; gap: 6px; }
.lg-item i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.hbar { display: flex; flex-direction: column; gap: 7px; }
.hbar-row { display: grid; grid-template-columns: minmax(90px, 38%) 1fr auto; gap: 10px; align-items: center; font-size: 13px; }
.hbar-label { color: #3a4658; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hbar-bar { background: #f1f4f9; border-radius: 6px; height: 14px; overflow: hidden; }
.hbar-bar i { display: block; height: 100%; border-radius: 6px; }
.hbar-val { color: #1f2d3d; font-weight: 600; min-width: 40px; text-align: right; }
.chart-donut { width: 150px; height: 150px; display: block; margin: 0 auto; }
.donut-num { font-size: 26px; font-weight: 700; fill: #1f2d3d; }
.donut-cap { font-size: 12px; fill: #9aa4b5; }
.an-tbl { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 6px; }
.an-tbl th, .an-tbl td { text-align: left; padding: 8px 10px; border-bottom: 1px solid #f1f4f9; }
.an-tbl th { color: #8a94a6; font-weight: 600; background: #fafbfc; }
.an-tbl td { color: #3a4658; }
.an-tbl tr:hover td { background: #fafbfe; }
@media (max-width: 880px) {
  .an-kpis { grid-template-columns: repeat(2, 1fr); }
  .an-trend, .an-2col { grid-template-columns: 1fr; }
}

/* ===== 块编辑器：正文格式工具条 + 重点色块 ===== */
.nb-ed-bar { display: flex; gap: 4px; margin: 6px 0 4px; flex-wrap: wrap; align-items: center; }
.nb-fmt {
  min-width: 26px; height: 26px; padding: 0 7px; border: 1px solid #d6deea; background: #fff;
  border-radius: 6px; cursor: pointer; font-size: 13px; line-height: 1; color: #2c3542;
}
.nb-fmt:hover { border-color: #3a7bfd; background: #f3f7ff; }
.nb-fmt b { font-weight: 800; }
/* 重点色块：编辑区与前台通用（颜色名受控，杜绝任意样式注入） */
.hl-red { color: #e63946 !important; }
.hl-orange { color: #f3722c !important; }
.hl-green { color: #1b9c6b !important; }
.hl-blue { color: #1d6fb8 !important; }
.hl-yellow { background: #fff1a8 !important; border-radius: 3px; padding: 0 2px; box-shadow: 0 0 0 1px #ffe27a; }
.nb-ed .hl-yellow { color: #5a4500 !important; }

/* ===== 块编辑器：正文图片排版（等比缩放 / 一行多图 / 对齐） ===== */
/* 只有排过版的图（figure 上带 inline width）才撑满；没动过的图保持原来的「原尺寸居中」，不影响老内容 */
.p-fig[style*="width"] > .inline-img { width: 100%; height: auto; max-height: none; }
/* 对齐：默认就是居中（沿用 .p-fig 的 margin auto），排过版才需要往左 / 往右推 */
.p-fig-l { margin-left: 0; margin-right: auto; }
.p-fig-c { margin-left: auto; margin-right: auto; }
.p-fig-r { margin-left: auto; margin-right: 0; }
.p-fig-l figcaption { text-align: left; }
.p-fig-r figcaption { text-align: right; }
/* 一行多图：连续几张列数相同的图并成网格 */
.p-figs { display: grid; gap: 10px; margin: 14px 0; align-items: start; }
.p-figs-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.p-figs-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.p-figs-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.p-figs .p-fig { margin: 0; width: 100% !important; }
.p-figs .inline-img { width: 100%; height: auto; max-height: 260px; object-fit: contain; }
@media (max-width: 700px) {
  .p-figs-3, .p-figs-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* 编辑区：图片设置条（点中图片才冒出来） */
.nb-imgset {
  display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
  margin: 6px 0 8px; padding: 7px 10px; font-size: 12px;
  background: #f6f9fe; border: 1px solid #e2eaf6; border-radius: 8px;
}
.nb-imgset[hidden] { display: none; }
.nis-t { font-weight: 700; color: #2c3542; }
.nis-g { display: inline-flex; align-items: center; gap: 4px; }
.nis-g > b { font-weight: 600; color: #6b7684; margin-right: 2px; }
.nis-val {
  min-width: 40px; text-align: center; font-weight: 700; color: #3a7bfd;
  font-variant-numeric: tabular-nums;
}
.nis-btn.on { border-color: #3a7bfd; background: #e8f1ff; color: #3a7bfd; font-weight: 700; }
.nis-x {
  margin-left: auto; cursor: pointer; color: #98a4b3;
  font-size: 15px; line-height: 1; padding: 2px 6px; border-radius: 5px;
}
.nis-x:hover { background: #e8eef7; color: #2c3542; }
/* 编辑区里的图片：可点选 + 对齐即时可见 */
.nb-inline-img { cursor: pointer; }
.nb-inline-img.sel { outline: 2px solid #3a7bfd; outline-offset: 2px; }
.nb-a-l { margin-left: 0 !important; margin-right: auto !important; }
.nb-a-c { margin-left: auto !important; margin-right: auto !important; }
.nb-a-r { margin-left: auto !important; margin-right: 0 !important; }

/* ===== 正文图片：WPS 式拖拽缩放 + 一行多图 ===== */
/* 选中图片后右下角的拖拽圆点 */
.nb-img-handle {
  /* 必须高过 .modal-mask(200)，否则手柄被遮罩挡住按不动；低于 toast(300) */
  position: absolute; z-index: 250; width: 14px; height: 14px; box-sizing: border-box;
  background: #3a7bfd; border: 2px solid #fff; border-radius: 50%;
  cursor: nwse-resize; box-shadow: 0 1px 5px rgba(0, 0, 0, .3);
}
.nb-img-handle:hover { background: #1c5fd8; }
/* 一行多图（同一行里用空格隔开放了好几张）→ 并排；窄屏自动折行 */
.p-figs-inline { display: flex; gap: 10px; margin: 14px 0; flex-wrap: wrap; }
.p-figs-inline .p-fig { flex: 1 1 0; min-width: 0; margin: 0; }
.p-figs-inline .inline-img { width: 100%; height: auto; max-height: 300px; object-fit: contain; }
@media (max-width: 560px) { .p-figs-inline .p-fig { flex: 1 1 100%; } }

/* ===== 笔记拆解：内容块跟知识库正文同一套排版能力 ===== */
/* 手动/拖拽设了宽度 → 高度必须 auto，否则被 max-height 压扁变形 */
.nb-ed img[style*="width"], .nb-sec-b img[style*="width"] { height: auto; max-height: none; }
/* 一行几张：编辑器里直接按比例并排（跟「删掉中间换行就一行两张」一个效果） */
.nb-ed img[data-cols] { margin: 10px 0.5%; }
.nb-ed img[data-cols="1"] { width: 100%; margin: 10px auto; display: block; }
.nb-ed img[data-cols="2"] { width: 49%; }
.nb-ed img[data-cols="3"] { width: 32%; }
.nb-ed img[data-cols="4"] { width: 24%; }
/* 前台：连续几张同参数的图会被包成网格，这里只管铺满格子 */
.nb-sec-b .p-figs { margin: 12px 0; }
.nb-sec-b .p-figs img { width: 100%; display: block; margin: 0; max-height: none; }
/* 重点色块在笔记前台也照样生效（和知识库正文同一套类名） */
.nb-sec-b .hl-yellow { color: #5a4500; }

/* ===== 站点与菜单：网站名 / SEO / 功能菜单改名隐藏 ===== */
.menu-edit { margin: 14px 0 6px; border-top: 1px dashed #e6eaf0; padding-top: 12px; }
.menu-edit-h { font-weight: 600; color: #2c3542; margin-bottom: 8px; }
.menu-list { display: flex; flex-direction: column; gap: 8px; }
.menu-row { display: flex; align-items: center; gap: 8px; }
.menu-ico { width: 22px; text-align: center; flex: none; font-size: 15px; }
.menu-row .menu-name { flex: 1; min-width: 0; }
.menu-toggle { display: inline-flex; align-items: center; gap: 4px; margin: 0; white-space: nowrap; color: #6b7684; cursor: pointer; }

/* ================= 站点 Logo（后台「项目同步设置 → 站点与菜单」） ================= */
.logo-row { display: flex; align-items: flex-start; gap: 14px; flex-wrap: wrap; }
.logo-box {
  width: 58px; height: 58px; border-radius: 12px; overflow: hidden; flex: none;
  background: var(--blue); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 700;
}
.logo-box img { width: 100%; height: 100%; object-fit: contain; }
.logo-ops { flex: 1 1 240px; min-width: 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.logo-ops .hint { flex: 1 1 100%; margin: 0; }
/* 顶栏标识：换成 Logo 图后去掉蓝底，让透明底图片正常显示 */
.brand-mark.has-logo { background: transparent; }
.brand-mark.has-logo img { width: 100%; height: 100%; object-fit: contain; }

/* ================= 后台卡片里的操作条（导入 / 下载模板） ================= */
.adm-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 10px 0 12px; }
.adm-bar .hint { margin: 0; }

/* ================= 前台「按标题公式套标题」：左右布局 ================= */
.tp-gen-wrap { display: flex; gap: 18px; align-items: flex-start; margin-top: 10px; }
.tp-gen-left { flex: 0 0 320px; max-width: 100%; }
.tp-gen-left .sub { margin: 0 0 10px; }
.tp-gen-left .input { width: 100%; }
.tp-gen-btns { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.tp-gen-right { flex: 1 1 0; min-width: 0; }
.tp-gen-right .tp-gen-out { margin-top: 0; }
.tp-gen-head { display: flex; align-items: center; gap: 10px; }
.tp-gen-copyall { margin-left: auto; font-size: 12px; color: var(--blue); cursor: pointer; }
.tp-gen-copyall:hover { text-decoration: underline; }
@media (max-width: 860px) {
  .tp-gen-wrap { flex-direction: column; }
  .tp-gen-left { flex: none; width: 100%; }
}

/* ================= 标题公式：文档导入预览弹窗 ================= */
.tfi-sum { font-size: 13.5px; color: var(--text-2); margin-bottom: 10px; }
.tfi-sum b { color: var(--blue); font-size: 15px; }
.tfi-sum b.warn { color: var(--red); }
.tfi-list { max-height: 240px; overflow: auto; border: 1px solid var(--gray-line); border-radius: 8px; }
.tfi-row { display: flex; gap: 8px; align-items: baseline; padding: 7px 10px; border-bottom: 1px solid var(--gray-line); font-size: 13px; }
.tfi-row:last-child { border-bottom: 0; }
.tfi-n { flex: none; width: 88px; font-weight: 600; color: var(--text); }
.tfi-s { flex: none; font-size: 12px; color: var(--text-3); }
.tfi-t { flex: 1 1 auto; min-width: 0; color: var(--text-2); word-break: break-all; }
.tfi-mode { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text); margin: 8px 0; cursor: pointer; }
.tfi-bad { margin-top: 12px; border: 1px solid var(--gray-line); border-radius: 8px; padding: 8px 10px; background: #fff8f6; }
.tfi-bad-h { font-size: 12.5px; font-weight: 600; color: var(--red); margin-bottom: 6px; }
.tfi-bad-row { display: flex; gap: 8px; align-items: baseline; font-size: 12px; color: var(--text-2); padding: 3px 0; }
.tfi-bad-row em { flex: none; font-style: normal; color: var(--text-3); }
.tfi-bad-row span { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tfi-bad-row i { flex: none; font-style: normal; color: var(--red); }

/* ================= 前台「按标题公式套标题」新版（hero + 卡片网格） ================= */
.tp-hero { text-align: center; padding: 6px 0 4px; }
.tp-hero-badge {
  display: inline-block; font-size: 12px; font-weight: 600; letter-spacing: .5px;
  color: #fff; background: linear-gradient(135deg, #2f6feb, #6a8dff);
  padding: 3px 12px; border-radius: 999px; margin-bottom: 10px;
}
.tp-hero-title { font-size: 22px; font-weight: 700; margin: 0 0 6px; color: var(--text); }
.tp-hero-sub { font-size: 14px; color: var(--text-2); margin: 0 0 4px; }
.tp-bar { display: flex; gap: 10px; align-items: stretch; margin: 16px auto 8px; max-width: 720px; flex-wrap: wrap; }
.tp-input-wrap { flex: 1 1 320px; position: relative; display: flex; align-items: center; }
.tp-input-ic { position: absolute; left: 14px; font-size: 15px; pointer-events: none; }
.tp-input { width: 100%; padding-left: 38px !important; height: 46px; border-radius: 12px; font-size: 15px; }
.tp-go { height: 46px; padding: 0 26px; border-radius: 12px; font-size: 15px; font-weight: 600; }
.tp-more { height: 46px; padding: 0 20px; border-radius: 12px; font-size: 15px; }
.tp-meta { text-align: center; font-size: 13px; color: var(--text-2); margin: 4px 0 14px; }
.tp-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.tp-grid-head { grid-column: 1 / -1; display: flex; align-items: center; font-size: 13.5px; color: var(--text-2); font-weight: 600; }
.tp-grid-copy { margin-left: auto; color: var(--blue); cursor: pointer; font-weight: 500; }
/* 「这批标题按什么气质挑的」小说明：权重压低，别跟复制按钮抢视线 */
.tp-kind-tip { font-weight: 400; color: var(--text-3); font-size: 12.5px; }
.tp-grid-copy:hover { text-decoration: underline; }
.tp-card {
  position: relative; background: #fff; border: 1px solid var(--gray-line);
  border-radius: 12px; padding: 14px 14px 14px; cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
  min-height: 78px; display: flex; flex-direction: column; gap: 8px;
}
.tp-card:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(31,45,61,.10); border-color: #bcd0ff; }
.tp-card .tp-tag { align-self: flex-start; }
.tp-card-t { font-size: 15px; line-height: 1.5; color: var(--text); font-weight: 500; word-break: break-word; }
.tp-card-copy {
  position: absolute; right: 12px; bottom: 12px; font-size: 12px; color: var(--blue);
  background: #eef4ff; border: none; border-radius: 8px; padding: 4px 10px; cursor: pointer; opacity: 0;
  transition: opacity .12s ease;
}
.tp-card:hover .tp-card-copy { opacity: 1; }
.tp-card-copy:hover { background: #dce8ff; }
@media (max-width: 720px) {
  .tp-grid { grid-template-columns: 1fr; }
  .tp-hero-title { font-size: 19px; }
}

/* ================= 前台「数据分析 / 笔记诊断」 ================= */
/* 上面填数据的卡、下面出结果的卡，宽度统一（880 居中）。改这一个数两边一起动 */
#view-analysis { --an-w: 880px; }
.analysis-card { max-width: var(--an-w); margin: 0 auto; }
#anOut { max-width: var(--an-w); margin: 0 auto; }
.analysis-card .fld { display: block; margin-bottom: 12px; }
.analysis-card .fld > span { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 6px; font-weight: 600; }
.analysis-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 4px;
}
.analysis-grid .fld { margin-bottom: 0; }
.analysis-btns { display: flex; align-items: center; gap: 10px; margin: 14px 0 8px; }
.analysis-btns .hint { margin: 0; }

/* 诊断结果：标题 + 结论标 */
.an-result-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.an-result-title { font-size: 17px; font-weight: 700; color: var(--text); margin: 0; flex: 1 1 auto; }
.an-badge { font-size: 13px; font-weight: 700; padding: 4px 10px; border-radius: 999px; flex: none; }
.an-badge.good { background: #e7f6ec; color: #1a7f37; }
.an-badge.bad { background: #fdeaea; color: #c0392b; }
.an-result-copy {
  font-size: 12.5px; color: var(--blue); background: #eef4ff; cursor: pointer;
  border-radius: 8px; padding: 4px 10px; flex: none; user-select: none;
}
.an-result-copy:hover { background: #dce8ff; }

/* 指标明细表 */
.an-table { border: 1px solid var(--gray-line); border-radius: 10px; overflow: hidden; }
.an-tr {
  display: grid; grid-template-columns: 1.5fr 1fr 1fr .8fr;
  align-items: center; gap: 8px; padding: 10px 14px; font-size: 14px;
  border-top: 1px solid var(--gray-line); background: #fff;
}
.an-tr:first-child { border-top: none; }
.an-th { background: #f7f9fc; font-weight: 700; color: var(--text-2); font-size: 13px; }
.an-td-label { display: flex; flex-direction: column; gap: 2px; }
.an-td-label b { color: var(--text); font-weight: 700; }
.an-calc { font-style: normal; font-size: 12px; color: var(--text-3); }
.an-st { font-weight: 700; text-align: right; }
.an-st.ok { color: #1a7f37; }
.an-st.bad { color: #c0392b; }
.an-st.nodata { color: var(--text-3); font-weight: 400; }

/* 问题 & 建议：跟诊断结果同属一张卡，中间隔一条线区分 */
.an-probs { margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--gray-line); }
.an-probs-h { font-size: 15px; font-weight: 700; color: var(--text); margin: 0 0 10px; }
.an-result-tip { margin: 14px 0 0; }
.an-prob {
  background: #fff; border: 1px solid var(--gray-line); border-radius: 12px;
  padding: 14px 16px; margin-bottom: 10px; cursor: pointer; border-left: 3px solid #c0392b;
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
.an-prob:hover { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(31,45,61,.10); }
.an-prob-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.an-prob-n {
  width: 20px; height: 20px; border-radius: 50%; background: #c0392b; color: #fff;
  font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex: none;
}
.an-prob-top b { font-size: 15px; color: var(--text); }
.an-prob-v { font-size: 13px; color: var(--text-2); }
.an-prob-v i { font-style: normal; color: var(--text-3); }
.an-prob-copy {
  margin-left: auto; font-size: 12px; color: var(--blue); background: #eef4ff;
  border: none; border-radius: 8px; padding: 4px 10px; cursor: pointer; opacity: 0;
  transition: opacity .12s ease;
}
.an-prob:hover .an-prob-copy { opacity: 1; }
.an-prob-copy:hover { background: #dce8ff; }
.an-prob-body {
  font-size: 14px; line-height: 1.75; color: var(--text-2);
  white-space: pre-wrap; word-break: break-word;
}

@media (max-width: 900px) {
  .analysis-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .analysis-grid { grid-template-columns: 1fr; }
  .an-tr { grid-template-columns: 1.3fr 1fr 1fr .8fr; font-size: 13px; padding: 9px 10px; }
  .an-doc { flex-wrap: wrap; }
  .an-doc-go { margin-left: 0; }
}

/* 诊断结果下方的「相关文档」 */
.an-docs { margin-top: 14px; }
.an-docs-h {
  font-size: 15px; font-weight: 700; color: var(--text);
  margin: 0 0 10px; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
}
.an-docs-h span { font-size: 12.5px; font-weight: 400; color: var(--text-3); }
.an-docs-list { display: flex; flex-direction: column; gap: 8px; }
.an-doc {
  display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit;
  border: 1px solid var(--gray-line); border-radius: 10px; padding: 11px 14px; background: #fff;
  transition: border-color .12s ease, box-shadow .12s ease, transform .12s ease;
}
.an-doc:hover:not(.nolink) { border-color: var(--blue); box-shadow: 0 6px 18px rgba(47,111,235,.10); transform: translateY(-1px); }
.an-doc.nolink { cursor: default; color: var(--text-3); }
.an-doc.nolink .an-doc-kind, .an-doc.nolink .an-doc-t { color: var(--text-3); }
.an-doc-kind {
  flex: none; font-size: 12px; color: var(--blue); background: #eef4ff;
  border-radius: 999px; padding: 3px 9px; font-weight: 600;
}
.an-doc-t { flex: 1 1 auto; font-size: 14px; color: var(--text); font-weight: 600; min-width: 0; }
.an-doc-why { font-style: normal; font-size: 12px; color: #c0392b; font-weight: 400; margin-left: 6px; }
.an-doc-go { flex: none; font-size: 12.5px; color: var(--blue); margin-left: auto; }
.an-doc:hover .an-doc-go { text-decoration: underline; }

/* 后台「添加关联文档」弹窗：搜索 + 候选列表 + 手填一行 */
.input-auto { width: auto; min-width: 190px; }
.adp-search { margin-bottom: 10px; }
.adp-list { max-height: 320px; overflow-y: auto; border: 1px solid var(--gray-line); border-radius: 10px; }
.adp-row {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px;
  border-bottom: 1px solid #f1f4f9; cursor: pointer;
}
.adp-row:last-child { border-bottom: none; }
.adp-row:hover { background: #f7f9fc; }
.adp-row.added { opacity: .5; cursor: default; }
.adp-kind { flex: none; font-size: 12px; color: var(--blue); background: #eef4ff; border-radius: 999px; padding: 2px 8px; }
.adp-t { flex: 1 1 auto; font-size: 13.5px; color: var(--text); min-width: 0; }
.adp-t .adp-x { font-style: normal; font-size: 12px; color: var(--text-3); margin-left: 6px; }
.adp-act { flex: none; font-size: 12.5px; color: var(--blue); }
.adp-custom { margin-top: 14px; border-top: 1px dashed var(--gray-line); padding-top: 12px; }
.adp-custom-h { font-size: 13px; font-weight: 700; color: var(--text-2); margin-bottom: 8px; }
.adp-custom-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.adp-custom-row .input:first-child { flex: 1 1 200px; width: auto; }
.adp-custom-row .input:nth-child(2) { flex: 2 1 260px; width: auto; }
/* 深链跳到某条信息差时，让它闪一下（不用全局 .flash，那是后台清单的橙色高亮） */
.tip-item.flash { animation: flashHL 1.6s ease; }
@keyframes flashHL {
  0% { box-shadow: 0 0 0 0 rgba(47,111,235,.45); background: #eef4ff; }
  100% { box-shadow: 0 0 0 0 rgba(47,111,235,0); background: transparent; }
}

/* ====================================================================
   方案 A · 工具启动台（2026-10-02 改版）
   结构：顶栏横向导航 + 首页「工具箱」大卡片网格 + 信息差/热门资料双栏
   用户态隐藏左侧栏（导航交给顶栏）；后台态保留左侧栏
   ==================================================================== */

/* 圆角、投影整体调柔一点，呼应 A 的轻盈感 */
:root { --radius: 14px; }
.layout { gap: 18px; }

/* —— 用户态：左侧栏收起，主区占满（顶栏承担导航） —— */
body:not(.is-admin) .sidebar { display: none; }
body:not(.is-admin) .layout { grid-template-columns: minmax(0, 1fr) 288px; }
/* 首页（工具启动台）要整屏宽，连右侧辅助栏也收起 */
body[data-view="ask"] .rightbar { display: none; }
body[data-view="ask"] .layout { grid-template-columns: minmax(0, 1fr); }

/* 顶栏：品牌标识换成渐变方块，更跳 */
.brand-mark { background: linear-gradient(135deg, #3a7bfd, #2f6feb); }
.topnav a { border-radius: 9px; }
.topnav a.active { background: var(--blue); color: #fff; font-weight: 600; box-shadow: 0 4px 12px rgba(47,111,235,.28); }

/* —— 首页整体包一层，控制最大宽度，别拉太开 —— */
.home-wrap { max-width: 1180px; margin: 0 auto; }

/* —— Hero 提问横幅 —— */
.home-hero {
  background: linear-gradient(120deg, #2f6df0, #5b8bff);
  border-radius: 20px; padding: 30px 30px 32px; color: #fff;
  box-shadow: 0 16px 40px rgba(47,109,240,.26);
  margin-bottom: 26px;
}
.home-hero h1 { font-size: 24px; line-height: 1.35; margin-bottom: 6px; }
.home-hero .home-hero-sub { font-size: 14px; opacity: .92; margin-bottom: 18px; }
.home-ask {
  background: #fff; border-radius: 16px; padding: 10px 10px 10px 16px;
  display: flex; flex-direction: column; gap: 10px;
}
.home-ask-input {
  border: 0; outline: 0; resize: none; width: 100%;
  font-size: 15px; line-height: 1.6; color: var(--text);
  font-family: inherit; min-height: 46px; max-height: 140px; padding: 6px 2px;
  background: transparent;
}
.home-ask-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.home-ask-actions .btn-primary { background: var(--blue); border-radius: 11px; padding: 11px 24px; font-size: 15px; font-weight: 700; }
.home-ask-actions .q-meta { color: var(--text-3); font-size: 12.5px; margin-left: auto; }

/* —— 区块标题 —— */
.home-sec { margin: 8px 0 4px; }
.home-sec-h { display: flex; align-items: baseline; gap: 10px; margin: 6px 2px 14px; }
.home-sec-h b { font-size: 18px; font-weight: 700; color: var(--text); }
.home-sec-h span { font-size: 13px; color: var(--text-3); }

/* —— 工具箱网格 —— */
.tool-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.tool-card {
  background: #fff; border: 1px solid var(--gray-line); border-radius: 16px;
  padding: 18px; cursor: pointer; transition: .16s; text-decoration: none; color: inherit;
  display: block;
}
.tool-card:hover { transform: translateY(-4px); box-shadow: 0 14px 30px rgba(31,39,51,.10); border-color: var(--blue-line); }
.tool-card .ic {
  width: 46px; height: 46px; border-radius: 13px;
  background: var(--blue-light); color: var(--blue);
  display: grid; place-items: center; font-size: 22px; margin-bottom: 12px;
}
.tool-card h3 { font-size: 15.5px; margin-bottom: 5px; font-weight: 600; }
.tool-card p { font-size: 12.5px; color: var(--text-3); line-height: 1.55; }

/* —— 信息差 + 热门资料 双栏 —— */
.home-duo { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 26px; }
.home-panel { background: #fff; border: 1px solid var(--gray-line); border-radius: 16px; padding: 18px; }
.home-panel .ph { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.home-panel .ph b { font-size: 15px; font-weight: 700; }
.home-panel .ph a { font-size: 12.5px; color: var(--blue); text-decoration: none; }
.home-tip { background: var(--blue-light); border-radius: 12px; padding: 14px; }
.home-tip .td { font-size: 12px; color: var(--blue); font-weight: 700; margin-bottom: 6px; }
.home-tip h4 { font-size: 14.5px; margin-bottom: 6px; font-weight: 600; line-height: 1.5; }
.home-tip p { font-size: 12.5px; color: var(--text-2); line-height: 1.65; }
.home-feed-row { padding: 11px 0; border-bottom: 1px solid var(--gray-line); display: flex; align-items: center; gap: 8px; }
.home-feed-row:last-child { border-bottom: 0; }
.home-feed-row .cat { font-size: 11px; color: var(--blue); background: var(--blue-light); padding: 2px 8px; border-radius: 6px; white-space: nowrap; }
.home-feed-row .t { font-size: 13.5px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 首页答案卡也走 A 的圆角卡片风（沿用 .card 基础，这里只微调间距） */
body[data-view="ask"] .card { margin-top: 4px; }

/* —— 响应式 —— */
@media (max-width: 1040px) {
  .tool-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 860px) {
  .layout { grid-template-columns: minmax(0, 1fr); padding: 12px; }
  body:not(.is-admin) .layout { grid-template-columns: minmax(0, 1fr); }
  .topnav { overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .topnav::-webkit-scrollbar { display: none; }
  .topnav a { white-space: nowrap; }
  .tool-grid { grid-template-columns: repeat(2, 1fr); }
  .home-duo { grid-template-columns: 1fr; }
  .home-wrap { padding: 0; }
  /* 用户态没有侧栏，移动端那个悬浮菜单按钮就没意义了 */
  body:not(.is-admin) .mnav-fab { display: none; }
}
@media (max-width: 520px) {
  .tool-grid { grid-template-columns: 1fr; }
  .home-hero { padding: 22px 18px 24px; border-radius: 16px; }
  .home-hero h1 { font-size: 20px; }
}

/* 首页「热门资料」面板：复用资料墙数据，但渲染成单行列表（避免双标题、挤成两列） */
.home-panel .feed { display: block; }
.home-panel .feed-grid { display: block; }
.home-panel .feed-card {
  display: flex; align-items: center; gap: 8px;
  padding: 11px 0; border-bottom: 1px solid var(--gray-line);
  border-radius: 0; box-shadow: none; background: none; cursor: pointer;
}
.home-panel .feed-card:last-child { border-bottom: 0; }
.home-panel .feed-top { display: contents; }
.home-panel .feed-cat {
  font-size: 11px; color: var(--blue); background: var(--blue-light);
  padding: 2px 8px; border-radius: 6px; white-space: nowrap;
}
.home-panel .feed-hot { font-size: 11px; color: var(--text-3); white-space: nowrap; }
.home-panel .feed-name { font-size: 13.5px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-panel .feed-sum { display: none; }

/* 顶栏导航修正：条目多（11+2），不许换行竖排，超宽横向滚 */
.topnav { min-width: 0; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.topnav::-webkit-scrollbar { display: none; }
.topnav a { white-space: nowrap; flex: none; }
/* 窄屏时品牌副标题先让位 */
@media (max-width: 1500px) { .brand-sub { display: none; } }

/* 修正：管理员在首页时不能把侧栏排进单列（会整块垫在正文上面），保持两列 */
body[data-view="ask"]:not(.is-admin) .layout { grid-template-columns: minmax(0, 1fr); }
body[data-view="ask"].is-admin .layout { grid-template-columns: 208px minmax(0, 1fr); }

/* 移动端：用户态导航走顶栏横向滚动（旧规则 801 行把 topnav 藏了，这里按形态放开） */
@media (max-width: 860px) {
  body:not(.is-admin) .topnav { display: flex; order: 3; flex-basis: 100%; }
  .topbar { flex-wrap: wrap; height: auto; padding: 10px 14px; row-gap: 8px; }
}

/* ========== 阅读弹窗：提问答案 / 点开的文章统一在弹窗里看 ========== */
.modal-reader {
  width: min(880px, 94vw);
  max-height: 88vh;
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.modal-reader .reader-head {
  margin: 0;
  padding: 14px 18px;
  border-bottom: 1px solid var(--gray-line);
  flex: none;
  background: #fff;
}
.reader-head-main { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.reader-t {
  font-size: 16.5px; font-weight: 700; margin: 0; color: var(--text);
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.reader-cat {
  flex: none; font-size: 11.5px; font-weight: 600; color: var(--blue-dark);
  background: var(--blue-light); border-radius: 20px; padding: 3px 10px;
}
.modal-reader .reader-body {
  flex: 1; min-height: 160px;
  overflow-y: auto;
  padding: 18px 22px 22px;
  -webkit-overflow-scrolling: touch;
}
.reader-foot {
  flex: none;
  display: flex; align-items: center; justify-content: flex-end; gap: 10px;
  padding: 11px 18px;
  border-top: 1px solid var(--gray-line);
  background: #fafbfc;
}
/* 弹窗里正文别太挤 */
.reader-doc { line-height: 1.85; }
@media (max-width: 640px) {
  .modal-reader { max-height: 92vh; }
  .modal-reader .reader-body { padding: 14px 14px 18px; }
}

/* ========== §79：答案卡下架 ========== */
/* 答案改在阅读弹窗里展示，首页这张「老陈的运营建议」卡不再出现（DOM 留着给 JS 渲染存档） */
#answerCard { display: none; }
/* 提问记录面板从答案卡里搬出来后，独立成一块白卡（盖掉原来依赖卡片的虚线分隔样式） */
#histInline {
  margin: 0 0 18px;
  padding: 16px 18px;
  background: #fff;
  border: 1px solid var(--gray-line);
  border-radius: var(--radius);
}

/* ========== §80 管理后台 · 方案A 左轨控制台 ========== */
/* 只在最宽的屏幕上加宽左轨；窄屏沿用原来的 190px / 单列规则，不动响应式 */
@media (min-width: 1241px) {
  .layout { grid-template-columns: 240px minmax(0, 1fr) 288px; }
  body[data-view="ask"].is-admin .layout { grid-template-columns: 240px minmax(0, 1fr); }
}

/* 左轨：分组更清楚、激活项更明显 */
.sidebar {
  border-radius: 16px; padding: 12px 10px 14px;
  box-shadow: 0 1px 2px rgba(16,24,40,.04), 0 6px 20px rgba(16,24,40,.06);
}
.rail-head {
  display: flex; align-items: center; gap: 10px;
  padding: 4px 8px 12px; margin-bottom: 6px;
  border-bottom: 1px solid var(--gray-line);
}
.rail-logo {
  width: 34px; height: 34px; border-radius: 10px; flex: none;
  background: linear-gradient(135deg, var(--blue), #5b8bff); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 700;
}
.rail-txt { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.rail-name { font-size: 14.5px; font-weight: 700; color: var(--text); }
.rail-sub { font-size: 11px; color: var(--text-3); }
.sidebar .side-title {
  font-size: 11px; font-weight: 700; color: var(--text-3);
  letter-spacing: .06em; padding: 12px 10px 6px;
}
.sidebar .side-item { border-radius: 10px; }
.sidebar .side-item.active { background: var(--blue-light); color: var(--blue); font-weight: 600; }
.sidebar .badge.warn { background: var(--orange); color: #fff; border-radius: 20px; font-weight: 600; }
.sidebar .side-item.active .badge.warn { background: #fff; color: var(--orange); }

/* 顶栏面包屑：只在后台页出现（当前所在位置） */
.crumbs { font-size: 13px; color: var(--text-3); white-space: nowrap; }
.crumbs b { color: var(--text); font-weight: 600; }

/* 后台主区：标题更有层次、卡片更整（前台不受影响） */
body.admin-view .view-head { margin-bottom: 16px; }
body.admin-view .view-head h1 { font-size: 22px; letter-spacing: -.2px; }
body.admin-view .card { border-radius: 16px; }

/* 概览驾驶舱 */
.hm-duo { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.hm-bars { display: flex; align-items: flex-end; gap: 8px; height: 150px; padding-top: 6px; }
.hm-col {
  flex: 1; min-width: 0; height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 5px;
}
.hm-col i {
  width: 100%; max-width: 28px; min-height: 2px; border-radius: 6px 6px 0 0;
  background: linear-gradient(180deg, var(--blue), #7aa5ff);
}
.hm-col span { font-size: 10.5px; color: var(--text-3); white-space: nowrap; }
.hm-list { display: flex; flex-direction: column; gap: 8px; }
.hm-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 9px; background: var(--gray-bg); font-size: 13px;
}
.hm-no {
  width: 20px; height: 20px; border-radius: 6px; flex: none;
  background: var(--blue-light); color: var(--blue);
  font-size: 11.5px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
}
.hm-t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hm-n { flex: none; font-size: 12.5px; color: var(--text-3); }
@media (max-width: 860px) { .hm-duo { grid-template-columns: 1fr; } }

/* ================= §82 阅读弹窗图片合集（小红书式：左图右文，左右滑动，点图放大） ================= */
/* 有图：左栏图片合集 + 右栏标题正文；没图：左栏不占位，弹窗回纯文宽度。后台编辑里给每篇传（最多 10 张） */
.modal-reader {
  display: flex;
  flex-direction: row;                /* 小红书式：左图右文 */
  width: min(1060px, 96vw);           /* 有图时加宽，右栏正文舒展 */
  max-height: 88vh;
}
.modal-reader.no-gal { width: min(880px, 94vw); }   /* 没图词条：回纯文宽度 */
.rd-gallery {
  flex: none;
  position: relative;
  width: 47%;
  min-width: 340px;
  margin: 0;
  border: none;
  border-right: 1px solid var(--gray-line);
  border-radius: 0;
  background: #f7f8fa;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.reader-main {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
/* head 不再是 .modal 直接子代，补回「标题在左、× 在右」的布局 */
.reader-main .reader-head {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
}
.rdg-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
}
.rdg-strip {
  flex: 1;
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;              /* Firefox 藏滚动条，滑动照常 */
  min-width: 0;
}
.rdg-strip::-webkit-scrollbar { display: none; }
.rdg-cell {
  flex: 0 0 100%;
  scroll-snap-align: center;
  display: flex; align-items: center; justify-content: center;
  min-height: 0;
  padding: 18px 14px;
}
/* 统一 3:4 竖版（小红书那种比例）：框固定比例、图片铺满；点开看的是完整原图，不会被裁掉信息 */
.rdg-cell img {
  display: block;
  width: auto; height: auto;
  max-width: 100%;
  max-height: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  object-position: center;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 2px 14px rgba(31, 39, 51, 0.08);
  cursor: zoom-in;
  user-select: none;
  -webkit-user-drag: none;
}
/* 左右箭头：悬在图片两侧，滚到头自动藏 */
.rdg-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 32px; height: 32px; border-radius: 50%;
  border: 1px solid var(--line); background: rgba(255, 255, 255, 0.92);
  color: var(--text); font-size: 18px; line-height: 1;
  cursor: pointer; z-index: 2;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}
.rdg-nav:hover { background: #fff; }
.rdg-prev { left: 10px; }
.rdg-next { right: 10px; }
/* 左栏底部：计数 + 圆点指示 + 提示 */
.rdg-foot {
  flex: none;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 8px 0 10px;
}
.rdg-count { font-size: 12px; color: var(--text-3); min-width: 34px; text-align: center; }
.rdg-dots { display: flex; gap: 5px; }
.rdg-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--line); transition: all 0.2s; }
.rdg-dot.on { background: var(--blue); width: 16px; border-radius: 3px; }
.rdg-tip { font-size: 11px; color: var(--text-3); opacity: 0.85; }
/* 右栏正文里的图（正文插图 / 文末配图）：点一下可放大看原图 */
.reader-body img { cursor: zoom-in; }
@media (max-width: 860px) {
  /* 手机：退回上下布局（图在上、文在下） */
  .modal-reader { flex-direction: column; width: 94vw; }
  .modal-reader.no-gal { width: 94vw; }
  .rd-gallery { width: 100%; min-width: 0; border-right: none; border-bottom: 1px solid var(--gray-line); }
  .rdg-stage { flex: none; }
  .rdg-cell { padding: 10px 0; }
  .rdg-cell img { max-height: min(44vh, 300px); }
}

/* ===== 后台编辑表单：图片合集管理（缩略图 + 删除 + 左右移 + 上传） ===== */
.gal-edit {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start;
  border: 1px dashed var(--line); border-radius: 10px;
  padding: 10px; background: #fafbfc; min-height: 46px;
}
.gal-cell { position: relative; width: 86px; }
.gal-cell img {
  width: 86px; height: 64px; object-fit: cover; display: block;
  border-radius: 8px; border: 1px solid var(--line); background: #fff;
}
.gal-del {
  position: absolute; top: -6px; right: -6px;
  width: 20px; height: 20px; border-radius: 50%;
  border: none; background: var(--red); color: #fff;
  font-size: 13px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.gal-ops { display: flex; gap: 4px; margin-top: 4px; justify-content: center; }
.gal-ops button {
  border: 1px solid var(--line); background: #fff; border-radius: 6px;
  font-size: 12px; padding: 1px 7px; cursor: pointer; color: var(--text-2);
}
.gal-ops button:disabled { opacity: 0.35; cursor: default; }
.gal-empty { font-size: 12.5px; color: var(--text-3); padding: 8px 2px; }

/* 页脚备案号（备案合规，轻量一行，不破坏现有设计） */
.site-foot {
  margin-top: 32px;
  padding: 16px 18px;
  border-top: 1px solid var(--gray-line);
  background: #fafbfc;
  text-align: center;
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-3);
}
.site-foot-in {
  display: flex;
  gap: 8px 16px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
}
.site-foot .sf-copy { color: var(--text-3); }
.site-foot a.sf-beian {
  color: var(--text-3);
  text-decoration: none;
  transition: color .15s;
}
.site-foot a.sf-beian:hover {
  color: var(--blue);
  text-decoration: underline;
}
@media (max-width: 560px) {
  .site-foot { margin-top: 24px; padding: 14px 14px; font-size: 11.5px; }
}
