:root {
  --brand: #2563eb;
  --brand-dark: #1d4ed8;
  --brand-soft: #eff6ff;
  --text: #1f2937;
  --muted: #6b7280;
  --line: #e5e7eb;
  --bg: #f6f7f9;
  --card: #ffffff;
  --radius: 14px;
  /* 容器与侧栏宽度：PC 双栏用 */
  --container: 1160px;
  --side: 300px;
}

/* 教程中心：视频与文章独立浏览，分类在两种内容间保留。 */
.learn-intro { padding: 32px 0 36px; max-width: 700px; }
.library-header .nav { margin-left: auto; }
.eyebrow { color: var(--brand); font-weight: 600; font-size: 13px; }
.learn-intro h1 { margin: 8px 0 10px; font-size: 32px; letter-spacing: -.8px; line-height: 1.4; }
.learn-intro p { color: var(--muted); margin: 0 0 22px; font-size: 15px; }
.learn-intro .sbox { max-width: 560px; }
.learn-intro .sbox input, .learn-intro .sbox button { height: 46px; }
.library-layout { display: grid; grid-template-columns: 200px minmax(0,1fr); gap: 32px; align-items: start; }
.library-categories { position: sticky; top: 100px; padding: 16px 10px; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.library-categories h2 { font-size: 13px; color: var(--muted); font-weight: 500; margin: 0 12px 12px; }
.library-categories a { display: flex; justify-content: space-between; gap: 10px; padding: 10px 12px; margin-top: 3px; border-radius: 7px; color: var(--text); font-size: 14px; overflow-wrap: anywhere; }
.library-categories a span { color: #9ca3af; }
.library-categories a.selected, .library-categories a:hover { background: var(--brand-soft); color: var(--brand); }
.library-main { min-width: 0; }
.content-tabs { display: flex; gap: 28px; border-bottom: 1px solid var(--line); }
.content-tabs a { padding: 0 2px 13px; color: var(--muted); font-size: 18px; font-weight: 600; border-bottom: 3px solid transparent; }
.content-tabs a.active { color: var(--brand); border-color: var(--brand); }
.library-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 24px 0 18px; }
.library-heading h2 { font-size: 18px; margin: 0 0 3px; }
.library-heading p, .library-heading > span { font-size: 13px; color: var(--muted); margin: 0; }
.library-heading > span { white-space: nowrap; }
.video-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 20px 16px; }
.video-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; color: var(--text); transition: box-shadow .2s, transform .2s; }
.video-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px #1e40af12; }
.video-cover { aspect-ratio: 16/9; position: relative; background: #e7effa; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.video-cover img { width: 100%; height: 100%; object-fit: cover; }
.cover-label { position: absolute; top: 12px; left: 12px; font-size: 11px; color: #54739e; }
.play-symbol { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: #fffef5; color: var(--brand); position: absolute; font-size: 16px; padding-left: 3px; box-shadow: 0 2px 12px #1e40af12; }
.video-duration { position: absolute; bottom: 8px; right: 8px; background: #142238b3; color: white; padding: 0 5px; border-radius: 4px; font-size: 11px; }
.video-info { padding: 13px 14px; }
.video-info h3, .reading-item h3 { font-size: 15px; line-height: 1.55; margin: 0; color: var(--text); }
.video-info h3, .video-info p, .reading-item p { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; }
.video-info p, .reading-item p { font-size: 13px; color: var(--muted); margin: 5px 0 10px; line-height: 1.6; }
.content-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; color: #8691a1; font-size: 12px; margin-top: 9px; }
.reading-list { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 0 20px; }
.reading-item { display: flex; align-items: flex-start; gap: 16px; color: var(--text); padding: 21px 0; border-bottom: 1px solid var(--line); }
.reading-item:last-child { border-bottom: 0; }
.reading-item > div { flex: 1; min-width: 0; }
.reading-item:hover h3 { color: var(--brand); }
.article-symbol { flex: 0 0 38px; height: 42px; display: grid; place-items: center; background: var(--brand-soft); border-radius: 8px; color: var(--brand); font-size: 26px; line-height: 1; }
.reading-arrow { color: #9ca3af; align-self: center; font-size: 22px; }
.library-empty { background: #fff; border: 1px solid var(--line); border-radius: 12px; text-align: center; padding: 60px 24px; }
.library-empty > span { font-size: 36px; color: #9eb7da; line-height: 1; }
.library-empty h3 { font-size: 16px; margin: 16px 0 6px; font-weight: 500; }
.library-empty p { font-size: 13px; color: var(--muted); margin: 0; }
a:focus-visible, button:focus-visible { outline: 3px solid #93b4f5; outline-offset: 3px; }
.sbox input { min-width: 0; }
@media (max-width: 999px) {
  .library-layout { grid-template-columns: 160px minmax(0,1fr); gap: 22px; }
  .video-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 720px) {
  .hdr .library-header { flex-wrap: nowrap; }
  .library-header .nav { width: auto; font-size: 13px; gap: 14px; }
  .learn-intro { padding: 8px 0 24px; }
  .learn-intro h1 { font-size: 25px; }
  .learn-intro p { font-size: 14px; }
  .library-layout { display: flex; flex-direction: column; gap: 20px; }
  .library-categories { position: static; width: 100%; display: flex; overflow-x: auto; gap: 8px; padding: 0 0 4px; border: 0; background: none; }
  .library-categories h2 { display: none; }
  .library-categories a { flex: 0 0 auto; margin: 0; padding: 6px 14px; border: 1px solid var(--line); background: #fff; border-radius: 20px; }
  .library-categories a.selected { border-color: #bdd0f7; }
  .library-categories a span { display: none; }
  .library-main { width: 100%; }
  .library-heading { margin: 20px 0 14px; }
  .library-heading h2 { font-size: 16px; }
  .library-heading p { font-size: 12px; }
  .content-tabs a { font-size: 17px; }
  .video-grid { gap: 14px 10px; }
  .video-info { padding: 10px; }
  .video-info h3 { font-size: 14px; }
  .video-info p { display: none; }
  .video-info .content-meta { font-size: 11px; gap: 3px 8px; }
  .cover-label { font-size: 9px; top: 7px; left: 7px; }
  .play-symbol { width: 34px; height: 34px; font-size: 13px; }
  .reading-list { padding: 0 14px; }
  .reading-item { gap: 12px; padding: 18px 0; }
}

* { box-sizing: border-box; }

html {
  margin: 0;
  padding: 0;
}

body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  /* 粘底布局：内容再少，页脚也停在视口底部 */
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-dark); }
img, video { max-width: 100%; }

/* width:100% 必须有：body 是 flex 容器，wrap 作为 flex item 时
   水平 auto margin 会让它收缩成内容宽度（内容少的页面两边大片留白） */
.wrap { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 20px; }
/* flex:1 吃掉剩余高度，把页脚顶到底部；
   min-height 是兜底，即使 flex 环境异常也能撑到接近一屏 */
.main {
  flex: 1 0 auto;
  min-height: calc(100vh - 180px);
  padding: 28px 20px 72px;
}

/* ---------- header ---------- */
.hdr {
  position: sticky; top: 0; z-index: 20;
  background: rgba(255,255,255,.92);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.hdr-in { display: flex; align-items: center; gap: 18px; min-height: 70px; }
.logo { font-size: 18px; font-weight: 700; color: var(--text); white-space: nowrap; }
.logo:hover { color: var(--brand); }

.sbox { display: flex; flex: 1; max-width: 460px; }
.sbox input {
  flex: 1; height: 38px; padding: 0 14px;
  border: 1px solid var(--line); border-right: 0;
  border-radius: 10px 0 0 10px; background: #fff; font-size: 14px; outline: none;
}
.sbox input:focus { border-color: var(--brand); }
.sbox button {
  height: 38px; padding: 0 18px; border: 0;
  border-radius: 0 10px 10px 0; background: var(--brand); color: #fff;
  font-size: 14px; cursor: pointer;
}
.sbox button:hover { background: var(--brand-dark); }

.nav { display: flex; gap: 16px; font-size: 14px; overflow-x: auto; }
.nav a { color: var(--muted); white-space: nowrap; }
.nav a:hover { color: var(--brand); }

/* ---------- hero ---------- */
.hero {
  background: linear-gradient(135deg, #2563eb 0%, #3b82f6 55%, #60a5fa 100%);
  color: #fff; border-radius: var(--radius); padding: 44px 28px; text-align: center;
}
.hero h1 { margin: 0 0 8px; font-size: 28px; font-weight: 700; }
.hero-sub { margin: 0 0 22px; opacity: .92; font-size: 15px; }
/* hero 搜索框：白色胶囊外壳 + 内嵌输入框 + 蓝色圆角按钮 */
.hero .sbox {
  max-width: 520px; margin: 0 auto;
  background: #fff; border-radius: 14px; padding: 5px;
  box-shadow: 0 6px 18px rgba(15, 23, 42, .18);
}
.hero .sbox:focus-within { box-shadow: 0 0 0 3px rgba(255,255,255,.35), 0 6px 18px rgba(15,23,42,.18); }
.hero .sbox input {
  height: 42px; border: 0; background: transparent;
  border-radius: 10px 0 0 10px; font-size: 15px; padding: 0 14px;
}
.hero .sbox button { height: 42px; border-radius: 10px; padding: 0 24px; }

/* ---------- 分类 ---------- */
h2.sec-title { font-size: 18px; margin: 34px 0 14px; font-weight: 700; }

.cat-grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
}
.cat-card {
  display: flex; flex-direction: column; gap: 4px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.cat-card:hover {
  transform: translateY(-2px); border-color: #bfdbfe;
  box-shadow: 0 8px 24px rgba(37,99,235,.10); color: inherit;
}
.cat-ico { font-size: 22px; }
.cat-name { font-weight: 600; color: var(--text); font-size: 15px; }
.cat-desc { color: var(--muted); font-size: 13px; line-height: 1.5; min-height: 20px; }
.cat-num { color: var(--brand); font-size: 12px; margin-top: 2px; }

/* ---------- 列表 ---------- */
.list-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
}
.item {
  display: block; padding: 15px 18px; border-bottom: 1px solid var(--line);
  color: inherit;
}
.item:last-child { border-bottom: 0; }
.item:hover { background: #f9fafb; color: inherit; }
.item-t { font-weight: 600; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.item-s { color: var(--muted); font-size: 13px; margin-top: 3px; }
.item-m { color: #9ca3af; font-size: 12px; margin-top: 6px; display: flex; gap: 12px; }

.badge {
  display: inline-block; font-size: 11px; padding: 1px 7px; border-radius: 6px;
  background: var(--brand-soft); color: var(--brand); font-weight: 500;
}
.badge.gray { background: #f3f4f6; color: #6b7280; }

/* ---------- 面包屑 ---------- */
.crumb { font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.crumb a { color: var(--muted); }
.crumb span { margin: 0 6px; color: #d1d5db; }

/* ---------- 详情 ---------- */
.doc {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 30px 32px;
}
.doc h1 { font-size: 25px; margin: 0 0 10px; line-height: 1.4; }
.doc-meta { color: #9ca3af; font-size: 13px; display: flex; gap: 14px; margin-bottom: 18px; }

.tl-dr {
  background: var(--brand-soft); border-left: 3px solid var(--brand);
  border-radius: 0 10px 10px 0; padding: 12px 16px; margin-bottom: 20px;
  font-size: 15px;
}
.tl-dr b { color: var(--brand); margin-right: 6px; }
.tl-dr p { margin: 0; }

.player { width: 100%; border-radius: 10px; background: #000; margin-bottom: 18px; }

.ts {
  background: #f9fafb; border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 16px; margin-bottom: 18px; font-size: 14px;
}
.ts summary { cursor: pointer; color: var(--muted); }
.ts > div { margin-top: 10px; white-space: pre-wrap; color: #374151; }

/* 正文排版 */
.body { font-size: 16px; overflow-wrap: break-word; }
.body h1, .body h2, .body h3, .body h4 { margin: 26px 0 12px; line-height: 1.4; }
.body h2 { font-size: 20px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.body h3 { font-size: 17px; }
.body p { margin: 12px 0; }
.body ul, .body ol { padding-left: 22px; }
.body li { margin: 6px 0; }
.body blockquote {
  margin: 14px 0; padding: 8px 16px; border-left: 3px solid var(--brand);
  background: #f9fafb; color: #4b5563;
}
.body code {
  background: #f3f4f6; padding: 2px 6px; border-radius: 5px;
  font-size: 14px; font-family: "SFMono-Regular", Consolas, monospace;
}
.body pre {
  background: #1f2937; color: #e5e7eb; padding: 14px 16px; border-radius: 10px;
  overflow-x: auto; line-height: 1.6;
}
.body pre code { background: none; color: inherit; padding: 0; }
.body table { width: 100%; border-collapse: collapse; margin: 14px 0; font-size: 14px; }
.body th, .body td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; }
.body th { background: #f9fafb; }
.body hr { border: 0; border-top: 1px solid var(--line); margin: 24px 0; }
.body img { border-radius: 10px; }
.body img[role="button"] { cursor: zoom-in; }
.body img[role="button"]:focus-visible { outline:3px solid #93b4f5;outline-offset:4px; }
.image-viewer { width:100vw;height:100vh;height:100dvh;max-width:none;max-height:none;margin:0;padding:0;border:0;background:rgba(10,16,28,.97);color:#fff; }
.image-viewer::backdrop { background:#0a101c; }
.image-viewer-toolbar { height:64px;display:flex;align-items:center;gap:12px;padding:12px max(16px,env(safe-area-inset-right)) 12px max(16px,env(safe-area-inset-left));border-bottom:1px solid #ffffff26; }
.image-viewer-toolbar span { margin-right:auto;font-size:14px; }
.image-viewer-toolbar button { border:1px solid #ffffff40;border-radius:7px;background:#ffffff15;color:white;font:inherit;font-size:13px;padding:7px 12px;cursor:pointer; }
.image-viewer-stage { height:calc(100% - 64px);overflow:auto;overscroll-behavior:contain;display:flex;align-items:center;justify-content:center;padding:20px 16px max(20px,env(safe-area-inset-bottom)); }
.image-viewer-stage img { display:block;flex:0 0 auto;max-width:100%;max-height:100%;object-fit:contain;touch-action:pan-x pan-y pinch-zoom; }
.image-viewer-stage.is-zoomed { display:block;text-align:center; }
.image-viewer-stage.is-zoomed img { max-width:none;max-height:none;margin:0 auto; }

/* ---------- 反馈 ---------- */
.fb {
  margin-top: 30px; padding-top: 20px; border-top: 1px solid var(--line);
  text-align: center; color: var(--muted); font-size: 14px;
}
.fb button {
  margin: 0 6px; padding: 7px 18px; border-radius: 20px; cursor: pointer;
  border: 1px solid var(--line); background: #fff; color: #374151; font-size: 14px;
}
.fb button:hover { border-color: var(--brand); color: var(--brand); }
.fb .done { color: var(--brand); }

/* ---------- 搜索结果 ---------- */
.result-hd { color: var(--muted); font-size: 14px; margin-bottom: 14px; }
mark { background: #fef08a; color: inherit; padding: 0 2px; border-radius: 3px; }
.empty {
  background: var(--card); border: 1px dashed var(--line); border-radius: var(--radius);
  padding: 40px 20px; text-align: center; color: var(--muted);
}
.snippet { color: var(--muted); font-size: 13px; margin-top: 4px; }

/* ---------- 相关 ---------- */
.rel { margin-top: 26px; }
.rel-list { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }

/* ---------- footer ---------- */
.ftr {
  flex: 0 0 auto;              /* 不被压缩，始终在最底部 */
  border-top: 1px solid var(--line);
  background: #fff;
  padding: 28px 0;
  margin-top: 8px;
}
.ftr .wrap {
  color: var(--muted); font-size: 13px; text-align: center; line-height: 2;
}
.ftr a { color: var(--muted); margin: 0 4px; }
.ftr a:hover { color: var(--brand); }

/* ---------- 移动端 ---------- */
@media (max-width: 720px) {
  /* 注意：.wrap 必须写在 .hdr .hdr-in 之前，
     且后者用两级选择器抬高优先级，否则 header 的纵向 padding 会被 .wrap 覆盖掉 */
  .wrap { padding: 0 16px; }
  .hdr .hdr-in { flex-wrap: wrap; min-height: 0; height: auto; padding: 12px 16px 14px; gap: 10px; }
  .sbox { order: 3; max-width: none; width: 100%; }
  .nav { order: 2; width: 100%; }
  .main { padding: 18px 16px 48px; min-height: calc(100vh - 240px); }
  .ftr { padding: 22px 0; }
  .hero { padding: 32px 20px; }
  .hero h1 { font-size: 22px; }
  .doc { padding: 22px 18px; }
  .doc h1 { font-size: 21px; }
  .cat-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}

/* ==========================================================
   大屏自适应（PC）
   思路：手机端保持原来的单列阅读体验；≥1000px 切换为
        「主内容 + 右侧栏」双栏，同时放大容器、字号与留白。
        所有双栏在窄屏都退化成 block，按 DOM 顺序自然堆叠。
   ========================================================== */

/* 锚点跳转留出 sticky header 的高度 */
.body h1, .body h2, .body h3, .body h4 { scroll-margin-top: 96px; }
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

/* ---------- 双栏骨架（窄屏即单列） ---------- */
.page-grid, .home-grid { display: block; }
.page-main, .home-main, .page-side, .home-side { min-width: 0; }
.page-side, .home-side { margin-top: 20px; }

/* ---------- 侧栏卡片 ---------- */
.side-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px 16px 14px; margin-bottom: 14px;
}
.side-card:last-child { margin-bottom: 0; }
.side-title {
  display: flex; align-items: center; gap: 8px;
  margin: 0 0 10px; font-size: 14px; font-weight: 700; color: var(--text);
}
.side-title::before {
  content: ""; flex: 0 0 auto; width: 3px; height: 14px;
  border-radius: 2px; background: var(--brand);
}
.side-text { margin: 0; color: var(--muted); font-size: 13.5px; line-height: 1.7; }

.side-list { display: flex; flex-direction: column; gap: 2px; }
.side-item { display: block; padding: 8px 10px; border-radius: 9px; color: #374151; font-size: 14px; line-height: 1.5; }
.side-item:hover { background: var(--brand-soft); color: var(--brand); }
.side-meta { display: block; margin-top: 3px; color: #9ca3af; font-size: 12px; }

.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-nav a { display: block; padding: 8px 10px; border-radius: 9px; color: #374151; font-size: 14px; }
.side-nav a:hover { background: var(--brand-soft); color: var(--brand); }
.side-nav a.is-active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }

/* 相关问题 */
.rel-list { display: flex; flex-direction: column; gap: 2px; }
.rel-item { display: block; padding: 8px 10px; border-radius: 9px; color: #374151; font-size: 14px; line-height: 1.55; }
.rel-item:hover { background: var(--brand-soft); color: var(--brand); }

/* 正文目录 / 侧栏分类导航：窄屏隐藏（手机用头部导航即可） */
.toc-card, .side-cat { display: none; }
.toc-list { display: flex; flex-direction: column; }
.toc-list a {
  padding: 6px 10px; font-size: 13.5px; line-height: 1.5;
  color: var(--muted); border-left: 2px solid var(--line);
}
.toc-list a.lv3 { padding-left: 22px; font-size: 13px; }
.toc-list a:hover { color: var(--brand); }
.toc-list a.is-active {
  color: var(--brand); font-weight: 600;
  border-left-color: var(--brand); background: var(--brand-soft);
}

/* 分页 */
.pager {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  margin-top: 18px; font-size: 14px; color: var(--muted);
}
.pager a {
  padding: 6px 14px; border: 1px solid var(--line); border-radius: 9px;
  background: #fff; color: var(--text);
}
.pager a:hover { border-color: var(--brand); color: var(--brand); }

/* ---------- PC ---------- */
@media (min-width: 1000px) {
  /* 头部：一行排布，导航靠右 */
  .hdr-in { min-height: 74px; gap: 28px; }
  .logo { font-size: 20px; letter-spacing: -.2px; }
  .sbox { max-width: 430px; }
  .nav {
    margin-left: auto; gap: 4px; min-width: 0;
    overflow-x: auto; scrollbar-width: none;
  }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { padding: 6px 12px; border-radius: 9px; }
  .nav a:hover { background: var(--brand-soft); }

  .main { padding: 34px 20px 96px; }

  /* 首页 hero：下面要留出与双栏的间距，否则右栏「最近更新」会贴着搜索框 */
  .hero { position: relative; overflow: hidden; padding: 64px 40px; border-radius: 18px; margin-bottom: 34px; }
  .hero::after {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background:
      radial-gradient(560px 220px at 12% 0%, rgba(255,255,255,.28), transparent 70%),
      radial-gradient(520px 260px at 92% 110%, rgba(255,255,255,.16), transparent 70%);
  }
  .hero > * { position: relative; z-index: 1; }
  .hero h1 { font-size: 38px; letter-spacing: -.6px; }
  .hero-sub { font-size: 16px; margin-bottom: 26px; }
  .hero .sbox { max-width: 620px; padding: 6px; }

  /* 区块标题：左侧品牌竖条 */
  .sec-title { display: flex; align-items: center; gap: 10px; font-size: 20px; margin: 40px 0 16px; }
  .sec-title::before {
    content: ""; flex: 0 0 auto; width: 4px; height: 18px;
    border-radius: 2px; background: var(--brand);
  }

  /* 分类卡片 */
  .cat-grid { gap: 16px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
  .cat-card { padding: 20px; gap: 6px; }
  .cat-ico { font-size: 26px; line-height: 1.2; }
  .cat-name { font-size: 15.5px; }

  .list-card { border-radius: 16px; }
  .item { padding: 16px 20px; }

  /* 首页：左分类/热门 + 右最近更新 */
  .home-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 34px; align-items: start; }
  .home-side { margin-top: 0; }
  /* 两栏都从 hero 下方 34px 开始，标题不再额外顶开 */
  .home-main > .sec-title:first-child { margin-top: 0; }

  /* 通用双栏：分类页 / 搜索页 / 详情页 */
  .page-grid { display: grid; grid-template-columns: minmax(0, 1fr) var(--side); gap: 34px; align-items: start; }
  .page-side {
    margin-top: 0; position: sticky; top: 92px;
    max-height: calc(100vh - 112px); overflow-y: auto;
    overscroll-behavior: contain; scrollbar-width: thin;
    padding-bottom: 2px;
  }

  /* 详情正文：PC 稍放大字号，行宽控制在 ~780px */
  .doc { padding: 40px 44px 44px; }
  .doc h1 { font-size: 30px; }
  .body { font-size: 16.5px; }
  .body h2 { font-size: 22px; margin-top: 34px; }
  .body h3 { font-size: 18px; }

  .toc-card, .side-cat { display: block; }
}

/* 1000–1200 之间主内容偏窄，收一点留白，避免正文被挤成一条 */
@media (min-width: 1000px) and (max-width: 1199px) {
  .doc { padding: 30px 30px 36px; }
  .home-grid { grid-template-columns: minmax(0, 1fr) 300px; gap: 26px; }
  .page-grid { gap: 26px; }
}

@media (max-width: 720px) {
  .hdr .library-header { justify-content: space-between; gap: 20px; }
  .hdr .library-header .logo { font-size: 16px; flex: 0 0 auto; }
  .hdr .library-header .nav { flex: 0 0 auto; width: auto; margin-left: auto; gap: 16px; font-size: 13px; }
}
