/* 离职知识库 · 站点样式（浅色克制风） */
:root {
  --bg: #ffffff;
  --bg-soft: #f7f8fa;
  --bg-code: #f6f8fa;
  --text: #24292f;
  --text-dim: #656d76;
  --line: #e5e7eb;
  --accent: #2563eb;
  --accent-soft: #eff4ff;
  --radius: 10px;
  --sidebar-w: 268px;
  --max: 820px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  font-size: 16px;
  line-height: 1.8;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  height: 56px; padding: 0 18px;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.brand { font-weight: 600; color: var(--text); font-size: 16px; }
.brand:hover { text-decoration: none; color: var(--accent); }
.menu-btn {
  display: none; border: 1px solid var(--line); background: #fff; color: var(--text);
  border-radius: 8px; padding: 5px 12px; font-size: 14px; cursor: pointer;
}

/* ---------- 布局 ---------- */
.shell { display: flex; align-items: flex-start; }
.sidebar {
  position: sticky; top: 56px;
  width: var(--sidebar-w); flex: 0 0 var(--sidebar-w);
  height: calc(100vh - 56px); overflow-y: auto;
  padding: 22px 14px 40px 20px;
  border-right: 1px solid var(--line);
  background: var(--bg-soft);
}
.side-title { font-size: 12px; letter-spacing: .08em; color: var(--text-dim); margin-bottom: 10px; }
.chapters { list-style: none; margin: 0; padding: 0; }
.chapters li a {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px; border-radius: 8px; color: var(--text); font-size: 14.5px;
}
.chapters li a:hover { background: #eceff3; text-decoration: none; }
.chapters li.active > a { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.chapters .num { font-variant-numeric: tabular-nums; color: var(--text-dim); font-size: 12px; }
.chapters .cnt { margin-left: auto; font-size: 12px; color: var(--text-dim); }
.side-foot { margin-top: 18px; padding-left: 10px; font-size: 13px; }

.main { flex: 1 1 auto; min-width: 0; padding: 32px 28px 80px; }
.main > * { max-width: var(--max); }

/* ---------- 首页 ---------- */
.hero { padding-bottom: 8px; border-bottom: 1px solid var(--line); margin-bottom: 26px; }
.hero h1 { font-size: 30px; margin: 0 0 10px; letter-spacing: -.01em; }
.lead { color: var(--text-dim); margin: 0 0 8px; }
.meta { color: var(--text-dim); font-size: 14px; margin: 0 0 18px; }
.search {
  width: 100%; padding: 10px 14px; font-size: 15px; margin-bottom: 20px;
  border: 1px solid var(--line); border-radius: var(--radius); background: #fff; color: var(--text);
  font-family: inherit;
}
.search:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }

.chapter { margin-bottom: 38px; scroll-margin-top: 70px; }
.chapter h2, .results h2 {
  display: flex; align-items: center; gap: 10px;
  font-size: 19px; margin: 0 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--line);
}
.ch-num { font-size: 13px; color: #fff; background: var(--accent); border-radius: 6px; padding: 1px 7px; font-weight: 600; }
.ch-count { margin-left: auto; font-size: 13px; font-weight: 400; color: var(--text-dim); }

.note-list, .rel-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.note-list a, .rel-list a {
  display: block; padding: 11px 14px; border: 1px solid var(--line);
  border-radius: var(--radius); background: #fff; color: var(--text);
}
.note-list a:hover, .rel-list a:hover { border-color: var(--accent); background: var(--accent-soft); text-decoration: none; }
.nt { display: block; font-weight: 600; font-size: 15px; }
.ns { display: block; color: var(--text-dim); font-size: 13.5px; line-height: 1.6; margin-top: 2px; }

/* ---------- 笔记页 ---------- */
.crumb { font-size: 13px; color: var(--text-dim); margin-bottom: 10px; }
.note > h1 { font-size: 28px; line-height: 1.45; margin: 0 0 22px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.prose { font-size: 16px; }
.prose h1 { font-size: 24px; }
.prose h2 { font-size: 21px; margin-top: 2em; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.prose h3 { font-size: 18px; margin-top: 1.8em; }
.prose h4, .prose h5, .prose h6 { font-size: 16px; margin-top: 1.6em; }
.prose h1, .prose h2, .prose h3, .prose h4 { line-height: 1.5; scroll-margin-top: 70px; }
.prose p { margin: 1em 0; }
.prose ul, .prose ol { padding-left: 1.5em; }
.prose li { margin: .35em 0; }
.prose img { max-width: 100%; height: auto; border-radius: 8px; }
.prose hr { border: none; border-top: 1px solid var(--line); margin: 2em 0; }
.prose blockquote {
  margin: 1.2em 0; padding: 2px 16px; color: var(--text-dim);
  border-left: 3px solid #d0d7de; background: var(--bg-soft); border-radius: 0 8px 8px 0;
}
.prose a.anchor { opacity: 0; margin-left: -1em; padding-right: .3em; color: var(--text-dim); font-weight: 400; }
.prose h1:hover .anchor, .prose h2:hover .anchor, .prose h3:hover .anchor, .prose h4:hover .anchor { opacity: 1; }
.prose code {
  background: var(--bg-code); border: 1px solid var(--line); border-radius: 5px;
  padding: .1em .35em; font-size: 87%;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}
.code-wrap { overflow-x: auto; background: var(--bg-code); border: 1px solid var(--line); border-radius: var(--radius); margin: 1.2em 0; }
.code-wrap pre { margin: 0; padding: 14px 16px; }
.code-wrap code {
  background: none; border: none; padding: 0; font-size: 13.5px; line-height: 1.65;
  display: block; white-space: pre;
}
.table-wrap { overflow-x: auto; margin: 1.2em 0; border: 1px solid var(--line); border-radius: var(--radius); }
.prose table { border-collapse: collapse; width: 100%; font-size: 14.5px; }
.prose th, .prose td { border: 1px solid var(--line); padding: 8px 12px; text-align: left; vertical-align: top; }
.prose th { background: var(--bg-soft); font-weight: 600; white-space: nowrap; }
.prose tr:nth-child(even) td { background: #fcfcfd; }
.prose a.xref { border-bottom: 1px dashed var(--accent); }

.related { margin-top: 48px; padding-top: 8px; border-top: 2px solid var(--line); }
.related h2 { font-size: 18px; margin: 18px 0 12px; }

/* ---------- 移动端 ---------- */
@media (max-width: 860px) {
  .menu-btn { display: block; }
  .sidebar {
    position: fixed; top: 56px; left: 0; z-index: 30;
    width: 82vw; max-width: 320px; height: calc(100vh - 56px);
    transform: translateX(-102%); transition: transform .22s ease;
    box-shadow: 0 8px 30px rgba(0, 0, 0, .12);
  }
  body.nav-open .sidebar { transform: translateX(0); }
  .main { padding: 22px 16px 64px; }
  .note > h1 { font-size: 23px; }
  .hero h1 { font-size: 25px; }
  body { font-size: 15.5px; }
}


/* --- highlight.js github 主题 --- */
pre code.hljs {
  display: block;
  overflow-x: auto;
  padding: 1em
}
code.hljs {
  padding: 3px 5px
}
/*!
  Theme: GitHub
  Description: Light theme as seen on github.com
  Author: github.com
  Maintainer: @Hirse
  Updated: 2021-05-15

  Outdated base version: https://github.com/primer/github-syntax-light
  Current colors taken from GitHub's CSS
*/
.hljs {
  color: #24292e;
  background: #ffffff
}
.hljs-doctag,
.hljs-keyword,
.hljs-meta .hljs-keyword,
.hljs-template-tag,
.hljs-template-variable,
.hljs-type,
.hljs-variable.language_ {
  /* prettylights-syntax-keyword */
  color: #d73a49
}
.hljs-title,
.hljs-title.class_,
.hljs-title.class_.inherited__,
.hljs-title.function_ {
  /* prettylights-syntax-entity */
  color: #6f42c1
}
.hljs-attr,
.hljs-attribute,
.hljs-literal,
.hljs-meta,
.hljs-number,
.hljs-operator,
.hljs-variable,
.hljs-selector-attr,
.hljs-selector-class,
.hljs-selector-id {
  /* prettylights-syntax-constant */
  color: #005cc5
}
.hljs-regexp,
.hljs-string,
.hljs-meta .hljs-string {
  /* prettylights-syntax-string */
  color: #032f62
}
.hljs-built_in,
.hljs-symbol {
  /* prettylights-syntax-variable */
  color: #e36209
}
.hljs-comment,
.hljs-code,
.hljs-formula {
  /* prettylights-syntax-comment */
  color: #6a737d
}
.hljs-name,
.hljs-quote,
.hljs-selector-tag,
.hljs-selector-pseudo {
  /* prettylights-syntax-entity-tag */
  color: #22863a
}
.hljs-subst {
  /* prettylights-syntax-storage-modifier-import */
  color: #24292e
}
.hljs-section {
  /* prettylights-syntax-markup-heading */
  color: #005cc5;
  font-weight: bold
}
.hljs-bullet {
  /* prettylights-syntax-markup-list */
  color: #735c0f
}
.hljs-emphasis {
  /* prettylights-syntax-markup-italic */
  color: #24292e;
  font-style: italic
}
.hljs-strong {
  /* prettylights-syntax-markup-bold */
  color: #24292e;
  font-weight: bold
}
.hljs-addition {
  /* prettylights-syntax-markup-inserted */
  color: #22863a;
  background-color: #f0fff4
}
.hljs-deletion {
  /* prettylights-syntax-markup-deleted */
  color: #b31d28;
  background-color: #ffeef0
}
.hljs-char.escape_,
.hljs-link,
.hljs-params,
.hljs-property,
.hljs-punctuation,
.hljs-tag {
  /* purposely ignored */
  
}