/* ============================================================
   base.css —— 变量 / 重置 / 外壳 / 通用组件
   ------------------------------------------------------------
   设计约束（来自实际使用场景）：
     · 必须能在手机浏览器与微信内置浏览器里正常用 → 移动端优先，
       所有横向布局都要能换行，触控目标不小于 32px
     · 公式密集 → KaTeX 独立公式必须能横向滚动，不能撑破页面
     · 题干是用户输入 → 长串数字/英文要能断行，不能溢出卡片
   主题：浅色。全站只有这一套配色，不再跟着系统暗色走
   （题库是白天刷题的场景，暗色反而看不清公式细节）。
   ============================================================ */

:root {
  /* 底色与面板 */
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #f0f2f5;
  --surface-3: #e8ebf0;
  --border: #e2e5ea;
  --border-strong: #cdd3db;

  /* 文字 */
  --text: #1e2229;
  --text-2: #566072;
  --text-3: #8b94a3;

  /* 品牌与语义色 */
  --brand: #2f6fed;
  --brand-dark: #2459c4;
  --brand-weak: #e9f0ff;
  --ok: #12996b;
  --ok-weak: #e4f6ef;
  --bad: #dc4046;
  --bad-weak: #fdeaeb;
  --warn: #c97a12;
  --warn-weak: #fdf2e0;
  --purple: #7a5af5;
  --purple-weak: #efecff;
  --teal: #0f9393;
  --teal-weak: #e2f5f5;

  /* 尺寸 */
  --radius: 10px;
  --radius-lg: 14px;
  --radius-sm: 7px;
  --shadow-1: 0 1px 2px rgba(20, 28, 45, .06), 0 1px 3px rgba(20, 28, 45, .04);
  --shadow-2: 0 2px 8px rgba(20, 28, 45, .08), 0 8px 24px rgba(20, 28, 45, .06);
  --shadow-3: 0 12px 40px rgba(20, 28, 45, .18);

  --topbar-h: 58px;
  --page-max: 1080px;
  --page-max-admin: 1180px;   /* 后台加宽：见下面 body.is-admin 的说明 */

  /* 插图高度上限。**列表页 / 详情页（.content-img）与编辑区（.ue-inode）
     必须引用同一个值** —— 两处各写一个数就是"同一张图两个大小"的来源。
     图片自身尺寸由 media.width/height（px）决定，这里只是超长图的兜底。 */
  --img-max-h: 340px;

  --font: system-ui, -apple-system, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
          "Microsoft YaHei", "Source Han Sans SC", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono",
          "Courier New", monospace;
}

/* ---------------- 重置 ---------------- */

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}

h1, h2, h3, h4, p, figure, blockquote, ol, ul, dl, dd { margin: 0; }
ol, ul { padding: 0; list-style: none; }
img { max-width: 100%; height: auto; border: 0; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
code, pre, kbd { font-family: var(--mono); font-size: .92em; }
code {
  background: var(--surface-2);
  border-radius: 4px;
  padding: 1px 5px;
  color: var(--text-2);
}
pre { margin: 0; overflow-x: auto; }
hr { border: 0; border-top: 1px solid var(--border); margin: 16px 0; }
summary { cursor: pointer; }
summary::-webkit-details-marker { display: none; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
::selection { background: #cfe0ff; }

/* 滚动条：桌面端细一点，不抢视线 */
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 9px;
  border: 2px solid transparent;
  background-clip: content-box;
}
*::-webkit-scrollbar-thumb:hover { background: #b6bec9; background-clip: content-box; }

/* ---------------- 顶部栏 ---------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  max-width: var(--page-max);
  margin: 0 auto;
  min-height: var(--topbar-h);
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand { display: flex; align-items: center; gap: 10px; color: var(--text); flex: 0 0 auto; }
.brand-mark {
  width: 34px; height: 34px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--brand), #5b8ef7);
  color: #fff;
  font-size: 19px;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(47, 111, 237, .3);
}
/* 配了 Logo 就用图片铺满方块（图片自带底色，去掉蓝底与阴影更干净） */
.brand-mark.has-logo { background: #fff; box-shadow: none; overflow: hidden; }
.brand-mark.has-logo img { width: 100%; height: 100%; object-fit: contain; display: block; }

.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 15.5px; font-weight: 650; letter-spacing: .2px; }
.brand-text em {
  font-style: normal;
  font-size: 11.5px;
  color: var(--text-3);
  letter-spacing: .3px;
}

.nav { display: flex; align-items: center; gap: 2px; flex: 1 1 auto; }
.nav a {
  position: relative;
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  font-size: 14.5px;
  white-space: nowrap;
  transition: background .16s, color .16s;
}
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a.is-active { color: var(--brand); background: var(--brand-weak); font-weight: 600; }

.topbar-right { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; }
.who {
  font-size: 13.5px;
  color: var(--text-2);
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  white-space: nowrap;
}
.who:hover { background: var(--surface-3); color: var(--text); }

.menu-btn {
  display: none;
  width: 38px; height: 38px;
  flex: 0 0 auto;
  margin-left: auto;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 0;
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.menu-btn span {
  display: block;
  width: 16px; height: 2px;
  border-radius: 2px;
  background: var(--text-2);
  transition: transform .2s, opacity .2s;
}
.menu-btn[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.menu-btn[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-btn[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ---------------- 主区 ---------------- */

.app {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 22px 16px 40px;
  min-height: calc(100vh - var(--topbar-h) - 96px);
}

/* ---------------- 后台加宽（body.is-admin） ----------------
   后台是"横向大版块"布局：左侧知识树 + 右侧列表同屏，1080px 太挤，放宽到 1180px。

   为什么写在 body 上而不是 .app 上：`--page-max` 同时被 `.topbar-inner` 与 `.app`
   读取，而 **var 在各自声明处解析**，所以在 body 上改写一次，两处一起生效；
   只改 .app 会让顶栏与内容区左右边缘错位，一眼就看出问题。

   由 shell.js 的 setWideAdmin() 开关，生命周期挂在路由的 cleanup 上
   （离开后台自动复位，不会把首页也撑宽）。 */
body.is-admin { --page-max: var(--page-max-admin); }

/* ---------------- 组卷工作台加宽（body.is-workbench） ----------------
   三栏（左导航 262 + 中题池 + 右试题篮 342）在默认 1080px 下会把中栏挤到 450px 左右，
   题干一到"设 $a>0$，则…"这种长度就折成四五行。
   写法与 is-admin 同款、理由也同款：`--page-max` 同时被 `.topbar-inner` 与 `.app` 读，
   所以必须写在 body 上 —— 改一处，顶栏与内容区一起变宽，不会错位。 */
body.is-workbench { --page-max: 1320px; }

.site-foot {
  border-top: 1px solid var(--border);
  padding: 18px 16px 26px;
  text-align: center;
  color: var(--text-3);
  font-size: 12.5px;
}
.foot-line { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 4px; }
/* 第二行（联系方式 / 备案 / 版权）比站名那行再淡一点，视觉上分出主次 */
.foot-meta { margin-top: 6px; gap: 10px; color: var(--text-3); opacity: .92; }
.foot-meta > span:empty { display: none; }
.foot-sep { margin: 0 6px; }

.noscript {
  margin: 24px auto;
  max-width: 560px;
  padding: 14px 18px;
  border-radius: var(--radius);
  background: var(--warn-weak);
  border: 1px solid #f0dcb8;
  color: #7a4d06;
}

.topwarn {
  background: var(--warn-weak);
  border-bottom: 1px solid #f0dcb8;
  color: #7a4d06;
  font-size: 13px;
  padding: 7px 16px;
  text-align: center;
}

/* ---------------- 按钮 ---------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 7px 15px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-size: 14.5px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background .16s, border-color .16s, color .16s, box-shadow .16s, transform .08s;
}
.btn:hover { background: var(--surface-2); border-color: #bfc7d2; }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[disabled] {
  opacity: .5;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  box-shadow: 0 1px 2px rgba(47, 111, 237, .28);
}
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }

.btn-ghost { background: transparent; border-color: var(--border-strong); color: var(--text-2); }
.btn-ghost:hover { background: var(--surface); color: var(--text); }

.btn-danger { background: var(--surface); border-color: #eeb4b6; color: var(--bad); }
.btn-danger:hover { background: var(--bad-weak); border-color: #e19396; }

.btn-sm { min-height: 30px; padding: 4px 10px; font-size: 13px; border-radius: 6px; }
.btn-lg { min-height: 44px; padding: 10px 24px; font-size: 15.5px; font-weight: 600; }

.link-btn {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  border: 0;
  background: none;
  padding: 0;
  color: var(--brand);
  font-size: 13.5px;
  cursor: pointer;
  white-space: nowrap;
}
.link-btn:hover { text-decoration: underline; }
.link-btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------------- 徽章 / 标签 / 芯片 ---------------- */

.badge {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 5px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}
.badge-score { background: var(--brand-weak); border-color: #c9dcff; color: var(--brand-dark); }
.badge-ok { background: var(--ok-weak); border-color: #b7e6d4; color: var(--ok); }
.badge-bad { background: var(--bad-weak); border-color: #f3c3c5; color: var(--bad); }
.badge-warn { background: var(--warn-weak); border-color: #f0dcb8; color: var(--warn); }
.badge-muted { background: var(--surface-2); color: var(--text-3); }
/* 「已停用」：刻意用"灰底虚线边"而不是红色 —— 它不是错误状态，
   只是一个可逆的开关。用红色会让人以为出了问题、急着去"修"它。 */
.badge-off {
  background: var(--surface-2);
  border: 1px dashed var(--border-strong);
  color: var(--text-3);
  letter-spacing: .3px;
}

/* 难度 1~6 由浅到深 */
.badge-diff.d1 { background: #ecf7f0; border-color: #c6e5d4; color: #2c7a53; }
.badge-diff.d2 { background: #e9f4fb; border-color: #c2dcee; color: #2a6b95; }
.badge-diff.d3 { background: #f1f0fb; border-color: #d5d2f0; color: #5a51a8; }
.badge-diff.d4 { background: #fdf1e6; border-color: #f0d6bb; color: #a3651f; }
.badge-diff.d5 { background: #fdeaeb; border-color: #f1c6c8; color: #b83a40; }
.badge-diff.d6 { background: #f7e6ef; border-color: #e5bdd4; color: #8e2f66; }

.tagrow { display: flex; flex-wrap: wrap; gap: 5px; }
.tag {
  display: inline-flex;
  align-items: center;
  height: 21px;
  padding: 0 7px;
  border-radius: 5px;
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 11.5px;
  border: 1px solid var(--border);
  white-space: nowrap;
}
.tag-thought { background: var(--purple-weak); border-color: #d9d2ff; color: #5b45c9; }
.tag-quality { background: var(--teal-weak); border-color: #bfe6e6; color: #0a7676; }
.tag-topicClass { background: var(--brand-weak); border-color: #c9dcff; color: var(--brand-dark); }
.tag-province { background: var(--warn-weak); border-color: #f0dcb8; color: var(--warn); }
.tag-source { background: var(--surface-2); color: var(--text-2); }
/* 知识点 chip（列表卡 foot / 详情页侧栏共用） */
.tag-kn { background: var(--ok-weak); border-color: #b7e6d4; color: var(--ok); }

.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text-2);
  font-size: 13.5px;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.chip:hover { background: var(--surface-2); color: var(--text); }
.chip.is-on {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  font-weight: 500;
}
.chip.is-static { cursor: default; background: var(--surface-2); border-color: var(--border); font-size: 12.5px; }
.chip.is-static:hover { background: var(--surface-2); color: var(--text-2); }

.picked-chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.picked-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 27px;
  padding: 0 5px 0 10px;
  border-radius: 999px;
  background: var(--brand-weak);
  border: 1px solid #c9dcff;
  color: var(--brand-dark);
  font-size: 12.5px;
}
.chip-x {
  border: 0;
  background: rgba(47, 111, 237, .13);
  color: var(--brand-dark);
  width: 18px; height: 18px;
  border-radius: 50%;
  line-height: 1;
  font-size: 13px;
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
}
.chip-x:hover { background: var(--brand); color: #fff; }
.picked-count {
  margin-left: 8px;
  font-size: 12.5px;
  color: var(--brand);
  font-weight: 500;
}

/* ---------------- 表单字段 ---------------- */

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field-label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.field-input {
  width: 100%;
  min-height: 38px;
  padding: 8px 11px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 14.5px;
  transition: border-color .16s, box-shadow .16s;
  min-width: 0;
}
.field-input:hover { border-color: #bfc7d2; }
.field-input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(47, 111, 237, .14);
}
select.field-input {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238b94a3' d='M2.2 4.4h7.6L6 8.8z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
}
textarea.field-input { min-height: 0; resize: vertical; line-height: 1.6; }
.field-num { width: 92px; }

.field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
}
.field-inline { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }

input[type="search"]::-webkit-search-cancel-button { cursor: pointer; }

/* ---------------- 提示 / 空态 / 骨架 / 错误 ---------------- */

.notice {
  padding: 10px 13px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  font-size: 13.5px;
  line-height: 1.65;
}
.notice-ok { background: var(--ok-weak); border-color: #b7e6d4; color: #0d7a55; }
.notice-warn { background: var(--warn-weak); border-color: #f0dcb8; color: #8a5a10; }
.notice-bad { background: var(--bad-weak); border-color: #f3c3c5; color: #b8383d; }

.muted-text { color: var(--text-3); font-size: 13.5px; }
.empty { padding: 46px 20px; text-align: center; }
.empty-title { font-size: 15px; font-weight: 600; color: var(--text-2); }
.empty-sub { margin-top: 6px; font-size: 13.5px; color: var(--text-3); }

.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 30px 16px;
  color: var(--text-3);
  font-size: 13.5px;
}
.loading-dot {
  width: 15px; height: 15px;
  border-radius: 50%;
  border: 2px solid var(--border-strong);
  border-top-color: var(--brand);
  animation: tk-spin .7s linear infinite;
}
@keyframes tk-spin { to { transform: rotate(360deg); } }

.skeleton-list { display: flex; flex-direction: column; gap: 12px; }
.skeleton-card {
  height: 92px;
  border-radius: var(--radius-lg);
  background: linear-gradient(100deg, var(--surface) 28%, var(--surface-2) 46%, var(--surface) 64%);
  background-size: 260% 100%;
  border: 1px solid var(--border);
  animation: tk-shimmer 1.25s ease-in-out infinite;
}
@keyframes tk-shimmer {
  from { background-position: 160% 0; }
  to { background-position: -60% 0; }
}

.error-box {
  padding: 16px 18px;
  border-radius: var(--radius);
  border: 1px solid #f3c3c5;
  background: var(--bad-weak);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}
.error-title { font-weight: 650; color: #a83036; font-size: 14.5px; }
.error-msg { color: #8f383d; font-size: 13.5px; }
.error-detail {
  width: 100%;
  margin: 0;
  padding: 9px 11px;
  background: rgba(255, 255, 255, .7);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: #7d3136;
  max-height: 220px;
}

/* ---------------- Toast ---------------- */

.toast-host {
  position: fixed;
  top: 14px;
  left: 0;
  right: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  padding: 0 14px;
}
.toast {
  max-width: min(92vw, 460px);
  padding: 9px 15px;
  border-radius: 999px;
  background: #232a35;
  color: #fff;
  font-size: 13.5px;
  box-shadow: var(--shadow-2);
  opacity: 0;
  transform: translateY(-10px) scale(.97);
  transition: opacity .22s, transform .22s;
}
.toast.is-in { opacity: 1; transform: none; }
.toast-ok { background: #10835b; }
.toast-bad { background: #c33a40; }
.toast-warn { background: #b8760f; }

/* ---------------- 模态确认框 ---------------- */

.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(18, 24, 36, .46);
  backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity .18s;
}
.modal-mask.is-in { opacity: 1; }
.modal {
  width: min(420px, 100%);
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-3);
  transform: translateY(8px) scale(.98);
  transition: transform .18s;
}
.modal-mask.is-in .modal { transform: none; }
.modal-title { font-size: 16px; font-weight: 650; }
.modal-body { margin-top: 9px; color: var(--text-2); font-size: 14px; line-height: 1.7; }
.modal-foot { margin-top: 20px; display: flex; justify-content: flex-end; gap: 9px; }

/* ---------------- 分页器 ---------------- */

.pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.pager-info { font-size: 13px; color: var(--text-3); }
.pager-btns { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin-left: auto; }
.page-btn {
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text-2);
  font-size: 13.5px;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.page-btn:hover:not(:disabled) { background: var(--surface-2); color: var(--text); }
.page-btn:disabled { opacity: .42; cursor: not-allowed; }
.page-btn.is-current {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  font-weight: 600;
}
.page-gap { color: var(--text-3); padding: 0 2px; user-select: none; }
.pager-jump { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-3); }
.page-jump {
  width: 66px;
  height: 34px;
  padding: 0 9px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 13.5px;
}
.page-jump:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(47, 111, 237, .14); }

/* ---------------- 内容渲染（与编辑器同一套 token） ---------------- */

.content {
  font-size: 15.5px;
  line-height: 1.85;
  overflow-x: auto;
  overflow-y: hidden;
}
.content.is-empty { color: var(--text-3); font-style: italic; }
.content-plain {
  font-size: 14.5px;
  line-height: 1.8;
  color: var(--text-2);
  white-space: pre-wrap;
}

/* 公式：行内不换行，独立公式居中且可横向滚动 */
.mf { white-space: nowrap; }
.mf-display { display: block; }
.mf-display > .katex-display { margin: 12px 0; }
.content .katex-display {
  overflow-x: auto;
  overflow-y: hidden;
  padding: 2px 2px 6px;
  margin: 12px 0;
}
.content .katex { font-size: 1.06em; }
.mf-raw {
  font-family: var(--mono);
  font-size: .9em;
  background: var(--warn-weak);
  border-radius: 4px;
  padding: 0 4px;
  color: #8a5a10;
}

/* 图片：题干里可能很宽，限制高度避免一张图占满一屏 */
.content-img {
  display: inline-block;
  vertical-align: middle;
  margin: 6px 4px;
}
/* 图片高度上限：**列表页 / 详情页 / 编辑区引用同一个变量**。
   三处尺寸不统一有一半是这里造成的 —— 阅读态有 340px 的上限、
   编辑区没有，于是同一张 Word 里 400px 高的图在编辑区显示 400px、
   到列表页被压成 340px，看起来就是"编辑页的图更大"。
   统一到一处定义之后，要么一起压、要么一起不压。 */
.content-img img {
  max-height: var(--img-max-h);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
}
/* 尺寸图注：只有核对场景才加（ctx.imgSizeNote）——
   平时浏览题库不需要看到"Word 尺寸 240×150"这行字。
   图片在 Word 里被拖小过的时候，图注会补上原图尺寸，
   省得老师以为是导入把图改糊了。 */
.content-img-cap {
  display: block; margin-top: 2px;
  font-size: 10.5px; line-height: 1.5; color: var(--text-3);
  font-family: var(--mono);
}
/* 被「自由」模式拉过宽高比的图（渲染器打上的 is-sized）：宽高都已固定，
   max-height 只会截高度不截宽度 ⇒ 压扁。所以把上限摘掉。
   编辑区 .ue-input .ue-inode.is-sized img 是同一条规则，两处必须一起改。 */
.content-img.is-sized img { max-height: none; }

.content-img.is-missing,
.content-img.is-broken {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 9px;
  border-radius: 5px;
  background: var(--warn-weak);
  border: 1px dashed #e0c79a;
  color: #93641a;
  font-family: var(--mono);
  font-size: 12px;
}
.content-img.is-broken::after { content: "（加载失败）"; }

.content-table {
  border-collapse: collapse;
  margin: 12px 0;
  max-width: 100%;
  font-size: 14px;
  background: var(--surface);
}
.content-table th,
.content-table td {
  border: 1px solid var(--border-strong);
  padding: 5px 11px;
  text-align: center;
  vertical-align: middle;
  min-width: 42px;
}
.content-table th {
  background: var(--surface-2);
  font-weight: 600;
  color: var(--text-2);
}
.content-table tbody tr:nth-child(even) td { background: #fafbfc; }

/* ---------------- 面包屑 / 序号 / 分隔 ---------------- */

.crumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
  font-size: 13px;
  color: var(--text-3);
}
.crumbs a { color: var(--text-2); }
.crumbs a:hover { color: var(--brand); }
.crumb-sep { color: var(--text-3); }

.qidx {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 22px;
  padding: 0 6px;
  border-radius: 5px;
  background: #2b3444;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.dot-sep, .foot-sep { color: var(--text-3); }

/* ---------------- 响应式：移动端 ---------------- */

@media (max-width: 860px) {
  .menu-btn { display: flex; }

  .nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 8px 12px 12px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-2);
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height .24s ease, opacity .18s, padding .24s;
    padding-top: 0;
    padding-bottom: 0;
  }
  .nav.is-open { max-height: 380px; opacity: 1; padding-top: 8px; padding-bottom: 12px; }
  .nav a { padding: 10px 12px; font-size: 15px; }

  .brand-text em { display: none; }
  .brand-text strong { font-size: 15px; }
}

@media (max-width: 560px) {
  body { font-size: 14.5px; }
  .app { padding: 16px 12px 32px; }
  .topbar-inner { padding: 0 12px; gap: 10px; }
  .content { font-size: 15px; }
  /* 窄屏收紧插图高度；覆盖同一个变量，编辑区一并跟着收紧（口径必须一致） */
  :root { --img-max-h: 260px; }
  .btn { min-height: 34px; padding: 6px 13px; font-size: 14px; }
  .btn-lg { min-height: 42px; font-size: 15px; }
  .pager-info { width: 100%; }
  .pager-btns { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* 打印：把答案与解析完整打出来，去掉导航与按钮 */
@media print {
  .topbar, .site-foot, .pickbar, .exam-bar, .exam-nav,
  .result-actions, .detail-actions, .pager, .filters, .toast-host { display: none !important; }
  body { background: #fff; }
  .app { max-width: none; padding: 0; }
  .qcard, .qitem { break-inside: avoid; box-shadow: none; }
}
