/*
Theme Name: 文渊阁
Theme URI: https://example.com/themes/wenyuange
Author: 文渊阁
Author URI: https://example.com
Description: CHM 电子书风格的 WordPress 主题（两栏 + 魔兽世界风）：深褐皮革目录树 + 羊皮纸阅读区 + 金色标题。左侧目录树只列出文章分类（一级 + 二级，叶子分类下直接列出文章标题），点击文章标题在右侧阅读区显示内容。顶部工具栏带站内搜索（联想下拉 + 关键词高亮，回车后左侧切换为搜索结果视图）。阅读区内容全宽强制满屏，适合教程站、知识库、软件手册与连载文档。响应式设计，移动端自动切换为单列布局（搜索 + 分类目录 + 正文同屏可见）。
Version: 1.3.1
Requires at least: 5.9
Tested up to: 6.8
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: wenyuange
Tags: documentation, knowledge-base, two-columns, custom-colors, custom-menu, translation-ready
*/

/* ── 设计令牌（魔兽世界：深褐皮革 + 羊皮纸 + 金） ── */
:root {
  --bg: #171310;
  --bg-deep: #1e1812;
  --surface: #241c14;
  --surface-2: #30261a;
  --ink: #e6d7b3;
  --ink-2: #c4b28b;
  --muted: #94805e;
  --border: #4a3a26;
  --border-strong: #6e5535;
  --accent: #c9a227;
  --accent-soft: rgba(201, 162, 39, 0.16);
  --accent-hover: #e3bf4a;
  --gold: #e8c75e;
  --gold-deep: #a8843c;
  --reader-bg: #e9dcc0;
  --reader-bg-2: #ddc9a3;
  --reader-surface: #f4ead2;
  --reader-ink: #2c2216;
  --reader-ink-2: #57452c;
  --reader-muted: #8a7552;
  --reader-border: #b3a077;
  --success: #4a7c59;
  --warn: #a8772a;
  --danger: #a8433f;
  --code-bg: #efe8d8;
  --code-border: #e0d6bf;
  --font-display: "Noto Serif SC", "Songti SC", "SimSun", serif;
  --font-body: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --focus-ring: 0 0 0 3px rgba(201, 162, 39, 0.3);
  --motion-fast: 150ms;
  --motion-base: 200ms;
  --ease-std: cubic-bezier(0.2, 0, 0, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { width: 100%; height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.65 var(--font-body);
  overflow: hidden;
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.05;
  z-index: 9999;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='0.6'/%3E%3C/svg%3E");
}
a { color: var(--accent); }
a:hover { color: var(--accent-hover); }
:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: 4px; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
img { max-width: 100%; height: auto; }
.screen-reader-text {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
  word-wrap: normal !important;
}
.skip-link { position: absolute; left: -9999px; top: 0; z-index: 10000; }
.skip-link:focus { left: 10px; top: 10px; background: var(--surface); padding: 8px 14px; border-radius: 6px; }

/* ── 顶部工具栏 ─────────────────────────── */
.toolbar {
  height: 52px;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 0 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(0, 0, 0, 0.2)), var(--surface);
  border-bottom: 2px solid var(--border-strong);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 2px 8px rgba(0, 0, 0, 0.35);
  position: relative;
  z-index: 60;
}
.toolbar .brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15.5px;
  letter-spacing: 0.01em;
  display: flex;
  align-items: center;
  gap: 9px;
  margin-right: 14px;
  white-space: nowrap;
}
.brand .seal {
  width: 26px;
  height: 26px;
  border-radius: 5px;
  background: linear-gradient(180deg, #e8c75e, #a8843c);
  color: #241c14;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.brand a { color: inherit; text-decoration: none; }
.brand .btext a {
  background: linear-gradient(180deg, #f0d78a 0%, var(--gold) 45%, var(--gold-deep) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--gold);
}
.toolbar .tbtn {
  width: 34px;
  height: 34px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-2);
  border: 1px solid transparent;
  transition: background var(--motion-fast) var(--ease-std), color var(--motion-fast) var(--ease-std);
}
.toolbar .tbtn:hover { background: var(--surface-2); }
.toolbar .tbtn:active { transform: translateY(1px); }
.toolbar .tbtn[disabled] { color: var(--border-strong); pointer-events: none; }
.toolbar .divider { width: 1px; height: 22px; background: var(--border-strong); margin: 0 8px; }

/* ── 搜索框 ─────────────────────────────── */
.search-wrap { margin-left: auto; position: relative; flex: 0 1 340px; min-width: 150px; }
.search-box {
  width: 100%;
  height: 36px;
  padding: 0 12px 0 36px;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: var(--bg);
  font: 14px var(--font-body);
  color: var(--ink);
  transition: border-color var(--motion-fast) var(--ease-std), box-shadow var(--motion-fast) var(--ease-std);
}
.search-box::placeholder { color: var(--muted); }
.search-box:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.25); }
.search-ico { position: absolute; left: 11px; top: 9px; color: var(--muted); pointer-events: none; }
.search-drop {
  position: absolute;
  top: 44px;
  left: 0;
  right: 0;
  z-index: 80;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(60, 48, 24, 0.16);
  overflow: hidden;
  display: none;
  max-height: 420px;
  overflow-y: auto;
}
.search-drop.open { display: block; }
.sd-group { padding: 10px 14px 6px; font-size: 11px; letter-spacing: 0.08em; color: var(--muted); }
.sd-item {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 8px 14px;
  cursor: pointer;
  color: var(--ink);
  border-top: 1px solid rgba(110, 85, 53, 0.4);
}
.sd-item:first-of-type { border-top: none; }
.sd-item:hover { background: var(--surface-2); }
.sd-item .t { font-size: 13.5px; }
.sd-item .path { font-size: 11.5px; color: var(--muted); white-space: nowrap; margin-left: auto; padding-left: 8px; }
.sd-item .t mark, .hl, .sv-item mark, .art-body mark.hl { background: #d9b04a; color: #241c14; border-radius: 2px; padding: 0 1px; }
.sd-empty { padding: 22px 14px; color: var(--muted); font-size: 13px; text-align: center; }
.sd-foot { padding: 8px 14px; border-top: 1px solid var(--border); font-size: 12px; color: var(--accent); cursor: pointer; }
.sd-foot:hover { background: var(--surface-2); }

/* ── 双栏骨架 ─────────────────────────── */
.chm { display: flex; height: calc(100vh - 52px); height: calc(100dvh - 52px); position: relative; }
body.admin-bar .chm { height: calc(100vh - 84px); height: calc(100dvh - 84px); }
.panel-tree {
  width: 360px;
  flex: none;
  background: var(--bg-deep);
  background-image: repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.015) 0 1px, transparent 1px 5px);
  border-right: 2px solid var(--border-strong);
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 30;
}
.tree-head {
  padding: 12px 16px 10px;
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.tree-scroll { flex: 1; overflow-y: auto; padding: 8px 8px 24px; }
.tnode { user-select: none; }
.trow {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  padding: 4px 8px 4px 4px;
  border-radius: 6px;
  cursor: pointer;
  position: relative;
  transition: background var(--motion-fast) var(--ease-std);
}
.trow:hover { background: rgba(230, 215, 179, 0.08); }
.trow.current { background: var(--accent-soft); }
.trow.current .t-label { color: var(--accent); font-weight: 600; }
.caret {
  width: 16px;
  height: 16px;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-2);
  transition: transform var(--motion-base) var(--ease-std);
  border-radius: 3px;
}
.caret:hover { background: rgba(230, 215, 179, 0.16); }
.trow.open > .caret { transform: rotate(90deg); }
.tico { flex: none; color: var(--muted); display: inline-flex; }
.trow.current .tico { color: var(--accent); }
.t-label { flex: 1; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); text-decoration: none; }
.t-count {
  font-size: 11px;
  color: var(--muted);
  background: rgba(230, 215, 179, 0.12);
  border-radius: 99px;
  padding: 0 7px;
  line-height: 16px;
  flex: none;
}
.trow.current .t-count { background: rgba(201, 162, 39, 0.22); color: var(--accent); }
.tkids { margin-left: 14px; padding-left: 9px; border-left: 1px solid var(--border); overflow: hidden; max-height: 0; transition: max-height var(--motion-base) var(--ease-std); }
.tkids.show { max-height: 2000px; }
.glabel { padding: 14px 10px 6px; font-size: 11px; letter-spacing: 0.1em; color: var(--muted); }
.tree-widgets { border-top: 1px solid var(--border); padding: 14px 10px; }
.tree-widgets .widget { margin-bottom: 16px; }
.tree-widgets .widget-title { font-size: 12px; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 6px; }
.tree-widgets ul { list-style: none; }
.tree-widgets li { padding: 3px 0; font-size: 13px; }
.tree-widgets li a { color: var(--ink); text-decoration: none; }
.tree-widgets li a:hover { color: var(--accent); }

.divider-v {
  width: 5px;
  flex: none;
  cursor: col-resize;
  background: var(--bg-deep);
  border-right: 1px solid var(--border-strong);
  position: relative;
  z-index: 40;
  transition: background var(--motion-fast) var(--ease-std);
}
.divider-v:hover, .divider-v.dragging { background: rgba(201, 162, 39, 0.4); }

/* ── 右侧阅读区（羊皮纸 + 金色标题）──────────────── */
.panel-reader {
  flex: 1;
  min-width: 0;
  background: var(--reader-bg);
  overflow-y: auto;
  position: relative;
  z-index: 10;
  background-image:
    radial-gradient(ellipse 120% 60% at 50% -10%, rgba(201, 162, 39, 0.07), transparent 60%),
    repeating-linear-gradient(0deg, rgba(139, 110, 62, 0.045) 0 1px, transparent 1px 4px),
    linear-gradient(180deg, var(--reader-bg) 0%, var(--reader-bg-2) 100%);
  /* 羊皮纸上的局部调色板（覆盖深色侧的亮金） */
  --gold: #8a6b28;
  --gold-deep: #6e5320;
  --accent: #8a5a2b;
  --accent-hover: #6d451e;
  --muted: #8a7552;
  --ink: #2c2216;
  --border: #cbb98f;
  --border-strong: #a8926a;
}
.reader-inner { max-width: none; margin: 0 auto; padding: 36px clamp(28px, 5vw, 72px) 88px; }
.crumbs { font-size: 12px; color: var(--reader-muted); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 18px; }
.crumbs a { color: var(--reader-muted); text-decoration: none; border-bottom: 1px solid transparent; }
.crumbs a:hover { color: var(--gold); border-bottom-color: var(--gold); }
.cr-sep { color: var(--reader-border); }
.art-kicker { font-size: 12px; letter-spacing: 0.1em; color: var(--gold); margin-bottom: 8px; }
.art-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 30px;
  line-height: 1.3;
  letter-spacing: -0.01em;
  margin: 0 0 14px;
  color: var(--gold);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5), 0 2px 8px rgba(110, 85, 40, 0.22);
}
.art-meta { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--reader-muted); margin-bottom: 6px; }
.art-meta .tag {
  border: 1px solid var(--reader-border);
  border-radius: 99px;
  padding: 0 9px;
  line-height: 19px;
  color: var(--reader-ink-2);
  font-size: 11.5px;
  text-decoration: none;
}
.art-meta .tag:hover { border-color: var(--gold); color: var(--gold); }
.art-rule {
  height: 1px;
  margin: 20px 0 30px;
  background: linear-gradient(90deg, var(--gold) 0%, var(--reader-border) 18%, transparent 90%);
  position: relative;
}
.art-rule::before {
  content: "";
  position: absolute;
  left: 0;
  top: -2.5px;
  width: 30px;
  height: 5px;
  background: linear-gradient(90deg, #d4af37, #8a6b28);
  border-radius: 2px;
  box-shadow: 0 0 8px rgba(138, 107, 40, 0.45);
}

/* ── 正文排版（深红底羊皮纸色文字 + 金色标题）──────────────── */
.art-body { font-size: 15.5px; line-height: 1.85; color: var(--reader-ink); }
.art-body p { margin: 0 0 16px; }
.art-body h2 {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.005em;
  margin: 38px 0 14px;
  padding-left: 14px;
  position: relative;
  color: var(--gold);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
}
.art-body h2::before { content: ""; position: absolute; left: 0; top: 0.24em; bottom: 0.24em; width: 3px; background: linear-gradient(180deg, #d4af37, #8a6b28); border-radius: 2px; box-shadow: 0 0 6px rgba(138, 107, 40, 0.4); }
.art-body h3 { font-family: var(--font-display); font-size: 17px; font-weight: 700; margin: 26px 0 10px; color: var(--gold); }
.art-body h4, .art-body h5, .art-body h6 { font-family: var(--font-display); font-weight: 700; margin: 22px 0 10px; color: var(--gold); }
.art-body a { color: var(--gold); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.art-body a:hover { color: #6d451e; }
.art-body ul, .art-body ol { margin: 0 0 16px; padding-left: 24px; }
.art-body li { margin-bottom: 7px; }
.art-body code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: rgba(138, 107, 40, 0.12);
  border: 1px solid #d3c197;
  border-radius: 4px;
  padding: 1px 5px;
  color: #7a5a1e;
}
.art-body pre {
  background: #241c13;
  border: 1px solid #6e5535;
  border-radius: 8px;
  padding: 14px 16px;
  overflow-x: auto;
  margin: 0 0 20px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.7;
  color: #e6d7b3;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04), 0 2px 8px rgba(60, 40, 15, 0.18);
}
.art-body pre code { background: none; border: none; padding: 0; font-size: 13px; color: #e6d7b3; }
.art-body kbd {
  font-family: var(--font-mono);
  font-size: 0.82em;
  background: var(--reader-surface);
  border: 1px solid var(--reader-border);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 1px 6px;
  color: var(--reader-ink);
}
.art-body blockquote {
  margin: 0 0 16px;
  padding: 8px 14px 8px 18px;
  border-left: 3px solid var(--gold);
  color: var(--reader-ink-2);
  font-family: var(--font-display);
  font-size: 15px;
  background: rgba(138, 107, 40, 0.07);
  border-radius: 0 6px 6px 0;
}
.art-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 20px;
  font-size: 13.5px;
  background: var(--reader-surface);
  border: 1px solid var(--reader-border);
  border-radius: 8px;
  overflow: hidden;
}
.art-body th {
  text-align: left;
  font-weight: 600;
  background: rgba(200, 162, 78, 0.13);
  color: var(--gold);
  padding: 9px 14px;
  border-bottom: 1px solid var(--reader-border);
  font-size: 12.5px;
  letter-spacing: 0.03em;
}
.art-body td { padding: 9px 14px; border-bottom: 1px solid rgba(179, 160, 119, 0.55); color: var(--reader-ink); }
.art-body tr:last-child td { border-bottom: none; }
.art-body img { border-radius: 8px; border: 1px solid var(--reader-border); display: block; margin: 0 auto 16px; }
.art-body figure { margin: 0 0 20px; text-align: center; }
.art-body figcaption, .art-body .wp-element-caption { font-size: 12px; color: var(--reader-muted); margin-top: 8px; }
.art-body .alignleft { float: left; margin: 4px 20px 12px 0; }
.art-body .alignright { float: right; margin: 4px 0 12px 20px; }
.art-body .aligncenter { margin-left: auto; margin-right: auto; }
.art-body .wp-block-image figcaption { font-size: 12px; color: var(--reader-muted); margin-top: 8px; }
.art-body hr { border: none; height: 1px; background: var(--reader-border); margin: 30px 0; }

/* 分页 */
.wp-pagination { margin-top: 40px; display: flex; gap: 10px; justify-content: center; }
.wp-pagination .page-numbers {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 34px; height: 34px; padding: 0 10px;
  border: 1px solid var(--border-strong); border-radius: 8px;
  color: var(--ink-2); text-decoration: none; font-size: 13px;
  background: var(--surface);
}
.wp-pagination .page-numbers.current { background: var(--accent); border-color: var(--accent); color: #241c14; }
.wp-pagination .page-numbers:hover:not(.current) { border-color: var(--accent); color: var(--accent); }

/* 上下一篇（深色适配） */
.pager { margin-top: 48px; padding-top: 22px; border-top: 1px solid var(--reader-border); display: flex; gap: 14px; }
.pager a {
  flex: 1;
  display: block;
  text-decoration: none;
  padding: 14px 16px;
  border-radius: 8px;
  border: 1px solid var(--reader-border);
  background: var(--reader-surface);
  min-width: 0;
  transition: border-color var(--motion-fast) var(--ease-std), background var(--motion-fast) var(--ease-std);
}
.pager a:hover { border-color: var(--gold); background: rgba(200, 162, 78, 0.1); }
.pager a.next { text-align: right; }
.pager .p-dir { font-size: 11px; letter-spacing: 0.08em; color: var(--reader-muted); }
.pager .p-t { font-family: var(--font-display); font-size: 14.5px; color: var(--reader-ink); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pager a:hover .p-t { color: var(--gold); }

/* ── 评论（深色适配）────────────────── */
.comments-area { margin-top: 48px; padding-top: 22px; border-top: 1px solid var(--reader-border); }
.comments-title { font-family: var(--font-display); font-size: 18px; font-weight: 700; margin-bottom: 16px; color: var(--gold); }
.comment-list { list-style: none; margin: 0; padding: 0; }
.comment-list li { margin-bottom: 16px; }
.comment-body { background: var(--reader-surface); border: 1px solid var(--reader-border); border-radius: 8px; padding: 14px 18px; }
.comment-meta { font-size: 12px; color: var(--reader-muted); margin-bottom: 8px; }
.comment-author { font-weight: 600; color: var(--reader-ink); }
.comment-content { font-size: 14px; color: var(--reader-ink); }
.comment-content p { margin: 0 0 8px; }
.comment-reply-link { font-size: 12px; color: var(--gold); }
.comment-respond { margin-top: 24px; }
.comment-form p { margin-bottom: 12px; }
.comment-form label { display: block; font-size: 13px; color: var(--reader-ink-2); margin-bottom: 4px; }
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--reader-border);
  border-radius: 8px;
  background: rgba(138, 107, 40, 0.08);
  font: inherit;
  color: var(--reader-ink);
}
.comment-form input:focus, .comment-form textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(200, 162, 78, 0.18); }
.comment-form .submit, .comment-form input[type="submit"] {
  background: linear-gradient(180deg, #e8c76a, var(--gold-deep));
  color: #241c14;
  border: 1px solid #8a6b28;
  border-radius: 8px;
  padding: 9px 22px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.comment-form .submit:hover { filter: brightness(1.08); }

/* ── 左侧搜索结果视图 ─────────────────────────── */
.search-view { padding: 12px 8px 24px; }
.sv-head { padding: 2px 8px 10px; display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.sv-title { font-family: var(--font-display); font-size: 15px; font-weight: 700; }
.sv-count { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.sv-back {
  display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--accent);
  border: 1px solid var(--border-strong); border-radius: 6px; padding: 3px 10px; background: var(--surface);
  cursor: pointer; text-decoration: none; flex: none; margin-top: 2px;
}
.sv-back:hover { background: var(--surface-2); }
.sv-item {
  display: flex; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 7px; cursor: pointer;
  border-top: 1px solid rgba(110, 85, 53, 0.4);
}
.sv-item:first-of-type { border-top: none; }
.sv-item:hover { background: rgba(230, 215, 179, 0.08); }
.sv-item .t { font-size: 13.5px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); text-decoration: none; }
.sv-item .path { font-size: 11px; color: var(--muted); white-space: nowrap; }
.sv-empty { padding: 30px 14px; color: var(--muted); font-size: 13px; text-align: center; }

/* ── 404 / 无结果 ─────────────────────────── */
.empty-state { text-align: center; padding: 60px 20px; color: var(--reader-muted); }
.empty-state h1 { font-family: var(--font-display); font-size: 26px; color: var(--reader-ink); margin-bottom: 10px; }
.empty-state p { margin-bottom: 6px; }

/* ── 移动端返回键（JS 注入）────────────────────────── */
.mback {
  display: none;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--accent);
  padding: 8px 4px 2px;
  cursor: pointer;
  background: none;
  border: none;
}

/* ── 移动端单列：搜索 + 分类目录 + 正文同屏 ─────────── */
@media (max-width: 860px) {
  html, body { height: auto; min-height: 100%; }
  body { overflow-y: auto; }
  .toolbar { position: sticky; top: 0; }
  .toolbar .brand .btext { display: none; }
  .toolbar .tbtn { width: 32px; height: 32px; }
  .toolbar .divider { display: none; }
  .chm { display: block; height: auto; }
  .panel-tree {
    position: static;
    width: 100%;
    max-height: 46vh;
    border-right: none;
    border-bottom: 2px solid var(--border-strong);
  }
  .divider-v { display: none; }
  .panel-reader { position: static; width: 100%; height: auto; overflow: visible; }
  .mback { display: inline-flex; }
  .reader-inner { padding: 22px 22px 64px; }
  .art-title { font-size: 24px; }
  .search-wrap { flex: 1; min-width: 0; }
}

@media (max-width: 480px) {
  #btnPrint { display: none; }
}

@media print {
  .toolbar, .panel-tree, .divider-v, .pager, .comments-area { display: none !important; }
  .chm, .panel-reader { display: block; height: auto; overflow: visible; }
  body { overflow: visible; background: #fff; }
  body::after { display: none; }
  .panel-reader { background: #fff; }
  .reader-inner { max-width: none; padding: 0; }
  .art-body, .art-body p, .art-body td, .art-title, .art-body h2, .art-body h3, .art-body li, .pager .p-t { color: #111 !important; text-shadow: none !important; }
  .art-body table { background: #fff; border-color: #999; }
  .art-body th { background: #eee; color: #333; }
  .art-body code, .art-body pre, .art-body kbd { background: #f5f5f5; color: #333; border-color: #ccc; }
  .art-body blockquote { color: #333; }
  .art-rule::before { background: #333; box-shadow: none; }
}
