/* ============================================================
   橡果文库 · Yohaku design system（tokens 照抄自
   github.com/Innei/Yohaku design-system/src/tokens.css 契约）
   铁律：中性三档(1-4面/5-7线/8-10字) · n-5永不作文字 ·
   accent≤5% · 中文标题只用500不用bold · 环形边框无硬阴影
   ============================================================ */

/* 朱雀仿宋 v0.212 — SIL OFL 1.1（版权与许可见 static/fonts/LICENSE.txt）；
   swap：先以后备宋体渲染，字体到后瞬换，免 FOIT 阻塞首屏 */
@font-face {
  font-family: "Zhuque Fangsong";
  src: url("/fonts/zhuque-fangsong.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --color-neutral-1:  #f9f8f5;
  --color-neutral-2:  #f0efeb;
  --color-neutral-3:  #e3e1db;
  --color-neutral-4:  #d0cec6;
  --color-neutral-5:  #a8a69f;
  --color-neutral-6:  #787670;
  --color-neutral-7:  #5c5a55;
  --color-neutral-8:  #403f3a;
  --color-neutral-9:  #24231f;
  --color-neutral-10: #141312;

  --color-accent:  #c56473; /* 梅 */
  --color-info:    #3d6896; /* 縹 */
  --color-success: #5e9f7e; /* 若竹 */
  --color-warning: #a87a3d; /* 朽葉 */
  --color-error:   #a64953; /* 蘇芳 */

  --color-paper:  #faf9f5;
  --color-border: rgba(24, 24, 27, 0.10);

  /* 次级正文（日期/出处/meta/页脚）：浅色下须够墨，深色下与 n-6 同 */
  --text-sub:     #55534d;

  --font-sans: -apple-system, "PingFang SC", "Microsoft YaHei",
               "Noto Sans SC", "Hiragino Sans GB", system-ui, sans-serif;
  --font-serif: "Noto Serif CJK SC", "Source Han Serif SC", "SongTi SC",
                STSong, Georgia, serif;
  /* 朱雀仿宋（OFL 开源，自托管）：专供「语不惊人」一言框，后备接宋体栈 */
  --font-fs: "Zhuque Fangsong", "Noto Serif CJK SC", "Source Han Serif SC",
             "SongTi SC", STSong, Georgia, serif;
  --font-mono: "JetBrains Mono", "Cascadia Code", "Fira Code", Consolas,
               Monaco, "Hannotate SC", monospace;

  /* 类型令牌（角色+px，禁 Tailwind 默认档） */
  --text-caption-10: 10px;  --lh-caption: 14px;
  --text-label-12:   12px;  --lh-label:   18px;
  --text-copy-13:    13px;  --lh-copy13:  20px;
  --text-copy-14:    14px;  --lh-copy14:  22px;
  --text-copy-15:    15px;  --lh-copy15:  24px;
  --text-copy-16:    16px;  --lh-copy16:  26px;
  --text-title-20:   20px;  --lh-title20: 28px;
  --text-title-24:   24px;  --lh-title24: 32px;
  --text-title-28:   28px;  --lh-title28: 36px;
  --text-display-36: 36px;  --lh-display: 44px;

  --r-chip: 4px;  --r-md: 6px;  --r-lg: 8px;  --r-xl: 12px;  --r-2xl: 16px;
}
[data-theme="dark"] {
  color-scheme: dark;
  --color-neutral-1:  #141414;
  --color-neutral-2:  #242424;
  --color-neutral-3:  #404040;
  --color-neutral-4:  #5c5c5c;
  --color-neutral-5:  #787878;
  --color-neutral-6:  #a8a8a8;
  --color-neutral-7:  #d0d0d0;
  --color-neutral-8:  #e3e3e3;
  --color-neutral-9:  #f0f0f0;
  --color-neutral-10: #f8f8f8;
  --color-paper:  #1a1814;
  --color-border: rgba(255, 255, 255, 0.10);
  --text-sub:     #a8a8a8;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; line-height: 1.5; letter-spacing: 0.01em; }
body {
  background: var(--color-paper);
  color: var(--color-neutral-9);
  font-family: var(--font-sans);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; transition: color .15s; }
a:hover { color: var(--color-accent); }
img { max-width: 100%; border-radius: var(--r-lg); }
mark { background: color-mix(in srgb, var(--color-accent) 22%, transparent); color: inherit; border-radius: 3px; }
.wrap { max-width: 860px; margin: 0 auto; padding: 0 24px; }
main { padding: 8px 0 72px; min-height: 72vh; }

/* ---------- 类型 ---------- */
.mono  { font-family: var(--font-mono); }
.serif { font-family: var(--font-serif); }
.caption { font-size: var(--text-caption-10); line-height: var(--lh-caption); text-transform: uppercase; letter-spacing: 1.5px; color: var(--text-sub); }
.muted { font-size: var(--text-label-12); color: var(--text-sub); }
.label   { font-size: var(--text-label-12);   line-height: var(--lh-label);   color: var(--color-neutral-7); }
.copy13  { font-size: var(--text-copy-13);    line-height: var(--lh-copy13); }
.copy15  { font-size: var(--text-copy-15);    line-height: var(--lh-copy15); }
.h1   { font-size: var(--text-title-28);  line-height: var(--lh-title28); font-weight: 500; color: var(--color-neutral-10); }
.h2   { font-size: var(--text-title-20);  line-height: var(--lh-title20); font-weight: 500; color: var(--color-neutral-9); }
.eyebrow { font-size: var(--text-label-12); line-height: var(--lh-label); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--color-accent); }

/* ---------- 顶栏 ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--color-paper) 80%, transparent);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); /* ultrathin */
  border-bottom: 1px solid var(--color-border);
}
.head-bar { display: flex; align-items: center; justify-content: space-between; height: 56px; }
.brand { display: inline-flex; align-items: center; gap: 7px; font-family: var(--font-serif); font-size: var(--text-copy-15); font-weight: 500; color: var(--color-neutral-10); letter-spacing: 0.04em; }
.brand-mark { color: var(--color-accent); flex-shrink: 0; }
.topnav { display: flex; align-items: center; gap: 2px; }
.topnav a {
  padding: 5px 12px; border-radius: var(--r-md);
  font-size: var(--text-copy-13); line-height: var(--lh-copy13);
  color: var(--color-neutral-7);
}
.topnav a:hover { background: var(--color-neutral-3); color: var(--color-neutral-10); }
.topnav a.on { background: var(--color-neutral-2); color: var(--color-neutral-10); }
.nav-theme {
  background: none; border: 1px solid var(--color-border); cursor: pointer;
  color: var(--color-neutral-7); font: inherit; font-size: var(--text-label-12);
  padding: 4px 10px; border-radius: var(--r-md);
}
.nav-theme:hover { background: var(--color-neutral-3); }
/* 文稿下拉：有悬停之器（鼠标）悬停展开；触屏则点按开关（.open 类，见 baseof JS） */
.nav-drop { position: relative; }
.nav-drop > a { display: flex; align-items: center; gap: 5px; }
.nav-drop .caret { opacity: 0.55; transition: transform 0.15s ease; }
.nav-drop.open .caret { transform: rotate(180deg); opacity: 1; }
.nav-drop .drop-menu {
  display: none; position: absolute; top: calc(100% + 8px); left: 50%; transform: translateX(-50%);
  min-width: 190px; max-width: calc(100vw - 24px); padding: 6px; z-index: 50;
  background: var(--color-paper); border: 1px solid var(--color-border);
  border-radius: var(--r-md); box-shadow: 0 12px 32px rgba(20, 19, 18, 0.12);
  flex-direction: column; gap: 2px;
}
/* 悬停桥接区：按钮→菜单间 8px 间隙不断开（仅悬停之器需要） */
@media (hover: hover) {
  .nav-drop::after {
    content: ""; position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
    width: 160px; height: 10px;
  }
  .nav-drop:hover .drop-menu { display: flex; }
}
.nav-drop.open .drop-menu { display: flex; }
.drop-menu a {
  display: flex; align-items: baseline; gap: 10px; padding: 7px 12px; border-radius: 10px;
  font-size: var(--text-copy-13); color: var(--color-neutral-8);
  white-space: nowrap; transition: background 0.12s, color 0.12s;
}
.drop-menu a:hover { background: var(--color-neutral-2); color: var(--color-accent); }
.drop-menu a .n { margin-left: auto; padding-left: 18px; font-family: var(--font-mono); font-size: var(--text-label-12); color: var(--text-sub); }
@media (max-width: 760px) {
  .drop-menu a { white-space: normal; }
}
@media (max-width: 640px) {
  .head-bar { flex-direction: column; height: auto; padding: 8px 0; gap: 6px; }
  .topnav { flex-wrap: wrap; justify-content: center; }
}

/* ---------- 页脚 ---------- */
.site-footer { border-top: 1px solid var(--color-border); padding: 18px 0 30px; }
.foot-bar { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: var(--text-label-12); color: var(--text-sub); }

/* ---------- Hero（首页） ---------- */
.hero { display: grid; gap: 24px; padding: 48px 0; }
.hero-h1 { font-family: var(--font-serif); font-size: var(--text-display-36); font-weight: 500; line-height: 1.2; color: var(--color-neutral-10); max-width: 22ch; }
.hero-desc { font-size: var(--text-copy-16); line-height: var(--lh-copy16); color: var(--color-neutral-7); max-width: 56ch; }
.hero-cta { display: flex; gap: 12px; padding-top: 8px; }
.btn {
  display: inline-block; border-radius: var(--r-md); padding: 10px 20px;
  font: inherit; font-size: var(--text-copy-14); font-weight: 500; cursor: pointer; border: none;
}
.btn-primary { background: var(--color-accent); color: #fff; }
.btn-primary:hover { color: #fff; opacity: .88; }
.btn-ghost { background: var(--color-neutral-2); color: var(--color-neutral-9); border: 1px solid var(--color-border); }
.btn-ghost:hover { background: var(--color-neutral-3); color: var(--color-neutral-10); }

/* 首页 hero：左列眉题+大标题，右列一言卡纵跨两行——卡片上端与眉题「会计·审计·…」齐平 */
.hero { grid-template-columns: minmax(0, 1fr) minmax(240px, 320px); align-items: start; }
.hero-eyebrow { grid-column: 1; }
/* 一言卡 */
.quote-card {
  grid-column: 2; grid-row: 1 / span 2;
  align-self: start; justify-self: end;
  background: var(--color-neutral-2); border: 1px solid var(--color-border);
  border-radius: var(--r-2xl); padding: 20px 22px; max-width: 320px;
}
.quote-card .tag { font-size: var(--text-caption-10); letter-spacing: .2em; color: var(--color-accent); font-weight: 600; }
.quote-text { font-family: var(--font-fs); font-size: var(--text-copy-15); line-height: var(--lh-copy15); color: var(--color-neutral-9); margin-top: 8px; min-height: 44px; }
.quote-from { margin-top: 8px; text-align: right; font-size: var(--text-label-12); color: var(--text-sub); }
@media (max-width: 640px) {
  .hero { grid-template-columns: 1fr; }
  .hero-eyebrow { grid-column: auto; }
  .quote-card { grid-column: auto; grid-row: auto; justify-self: stretch; max-width: none; width: 100%; }
}

/* ---------- 手机端（≤768px）浅色加深令 ----------
   手机屏小且亮、中文字渲染偏细，PC 下够墨之浅色在手机显淡；
   四档文字墨色各降一阶（仅浅色生效，深色模式分毫不动） */
@media (max-width: 768px) {
  :root:not([data-theme="dark"]) {
    --color-neutral-10: #0d0c0a; /* 标题：17.6 → 20+ :1 */
    --color-neutral-9:  #171613; /* 正文：14.9 → 19   :1 */
    --color-neutral-7:  #3d3c37; /* 副文/标签：6.5 → 10  :1 */
    --text-sub:         #3d3c37; /* 次级（日期/出处/meta/页脚） */
  }
}

/* ---------- 区块 ---------- */
.sec-head { display: flex; align-items: baseline; gap: 10px; margin: 40px 0 6px; }
.sec-head .h2 { font-family: var(--font-serif); }
.sec-head .label { margin-left: auto; }

/* 近期笔墨（list-card 契约：透明底+分隔线，悬停 n-2） */
.post-item {
  display: grid; grid-template-columns: minmax(0, 1fr) 104px; gap: 8px 24px;
  padding: 18px 12px; border-bottom: 1px solid var(--color-border);
  transition: background .15s ease;
}
.post-item .post-main { min-width: 0; }
.post-item:hover { background: var(--color-neutral-2); color: inherit; }
.post-item:hover .post-title { color: var(--color-accent); }
.post-title { font-size: var(--text-copy-15); font-weight: 500; line-height: 1.4; color: var(--color-neutral-10); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.post-meta { font-size: var(--text-label-12); color: var(--color-neutral-7); margin-top: 4px; }
.post-meta .cat { color: var(--color-accent); }
.post-date { font-family: var(--font-mono); font-size: var(--text-copy-13); color: var(--text-sub); white-space: nowrap; align-self: start; text-align: right; }
.post-num { display: none; }

/* 分区 chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.chip {
  display: inline-flex; align-items: baseline; gap: 7px;
  background: var(--color-neutral-2); border: 1px solid var(--color-border);
  border-radius: var(--r-chip); padding: 5px 12px;
  font-size: var(--text-copy-13); color: var(--color-neutral-9);
}
.chip:hover { background: var(--color-neutral-3); }
.chip .n { font-size: var(--text-label-12); color: var(--text-sub); }
.chip .n b { color: var(--color-accent); font-weight: 600; }

/* ---------- 文稿 / 归档 ---------- */
.page-head { padding: 36px 0 10px; }
.page-head .h1 { font-family: var(--font-serif); }
.page-head .label { margin-top: 8px; }
.arch-sec { margin-top: 34px; }
.arch-sec > h2 { font-family: var(--font-serif); font-size: var(--text-title-20); font-weight: 500; color: var(--color-neutral-10); display: flex; align-items: baseline; gap: 10px; padding-bottom: 8px; border-bottom: 1px solid var(--color-border); }
.arch-sec > h2 a:hover { color: var(--color-accent); }
.arch-sec > h2 .label { font-weight: 400; }
.arch-sec > h2 .arch-toggle { width: auto; padding: 3px; margin-left: -3px; border-radius: 6px; }
.arch-sec > h2 .arch-toggle .chev { color: var(--color-accent); }
.arch-sec.tl-closed > .arch-body { display: none; }
.arch-sub { margin-top: 12px; }
.arch-sub summary {
  cursor: pointer; list-style: none;
  font-size: var(--text-copy-14); font-weight: 500; color: var(--color-neutral-9);
  padding: 10px 4px; display: flex; align-items: baseline; gap: 10px;
  border-bottom: 1px solid var(--color-border);
}
.arch-sub summary::-webkit-details-marker { display: none; }
.arch-sub summary::before { content: "▸"; color: var(--color-accent); font-size: var(--text-label-12); display: inline-block; transition: transform .15s; }
.arch-sub[open] summary::before { transform: rotate(90deg); }
.arch-list { list-style: none; padding: 6px 0 10px; }
.arch-list li { display: flex; justify-content: space-between; gap: 14px; padding: 7px 4px; border-bottom: 1px dashed var(--color-border); font-size: var(--text-copy-14); }
.arch-list li:last-child { border-bottom: none; }
.arch-list .label { white-space: nowrap; }
/* 目录列表页 */
.grid { display: flex; flex-direction: column; margin-top: 14px; border-top: 1px solid var(--color-border); }
.item {
  display: flex; justify-content: space-between; align-items: center; gap: 14px;
  padding: 13px 8px; border-bottom: 1px solid var(--color-border);
  font-size: var(--text-copy-14); transition: background .15s;
}
.item:hover { background: var(--color-neutral-2); color: inherit; }
.item:hover .t { color: var(--color-accent); }
.item .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; color: var(--color-neutral-10); }
.item.dir .t::after { content: " ⌂"; opacity: .45; }
.item .label { white-space: nowrap; }
.crumbs { margin-top: 8px; font-size: var(--text-label-12); color: var(--text-sub); display: flex; align-items: center; gap: 14px; }

@media (max-width: 760px) {
  .post-item { grid-template-columns: minmax(0, 1fr) 86px; gap: 8px 12px; }
  .post-date { font-size: var(--text-label-12); }
}

/* ---------- 时光（时间轴） ---------- */
.tl-year { margin-top: 36px; }
.tl-year > h2 { font-family: var(--font-serif); font-size: var(--text-title-20); font-weight: 500; color: var(--color-accent); display: flex; align-items: center; gap: 14px; }
.tl-year > h2::after { content: ""; flex: 1; height: 1px; background: var(--color-border); }
/* 可折叠年/月标题：点按收放，chev 指示状态 */
.tl-toggle {
  display: flex; align-items: center; gap: 10px; width: 100%;
  background: none; border: 0; padding: 0; cursor: pointer; text-align: left;
  font: inherit; color: inherit;
}
.tl-toggle .chev { transition: transform .18s ease; color: var(--text-sub); flex-shrink: 0; }
.tl-toggle.closed .chev { transform: rotate(-90deg); }
.tl-month.tl-closed > .tl-items { display: none; }
.tl-year.tl-closed > .tl-months { display: none; }
.tl-months { list-style: none; margin: 0; padding: 0; }
.tl-month { margin-top: 16px; display: flex; gap: 14px; }
.tl-rail { width: 72px; flex-shrink: 0; text-align: right; }
.tl-rail > .tl-toggle { justify-content: flex-end; padding-top: 12px; }
.tl-rail > .tl-toggle span.m { font-family: var(--font-mono); font-size: var(--text-label-12); color: var(--text-sub); }
.tl-items { flex: 1; display: flex; flex-direction: column; gap: 6px; border-left: 1px solid var(--color-border); padding-left: 16px; }
.tl-item {
  position: relative; display: grid; grid-template-columns: 92px minmax(0, 1fr) auto; align-items: baseline; gap: 12px;
  padding: 8px 10px; border-radius: var(--r-md);
  font-size: var(--text-copy-14);
}
.tl-item:hover { background: var(--color-neutral-2); color: inherit; }
.tl-item::before {
  content: ""; position: absolute; left: -20px; top: 50%; transform: translateY(-50%);
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--color-accent); box-shadow: 0 0 0 3px var(--color-paper);
}
.tl-item .d { font-family: var(--font-mono); font-size: var(--text-label-12); color: var(--text-sub); }
.tl-item .t { min-width: 0; font-weight: 500; color: var(--color-neutral-10); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-item .t.q-text { font-family: var(--font-fs); }
.tl-item:hover .t { color: var(--color-accent); }
.tl-item .src { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* 语不惊人：引文可换行，出处居文下 */
.q-flat .tl-item { grid-template-columns: 92px minmax(0, 1fr); row-gap: 2px; }
.q-flat .tl-item .t { white-space: normal; font-family: var(--font-serif); }
.q-flat .tl-item .src { grid-column: 2; white-space: nowrap; }
@media (max-width: 760px) {
  .tl-item { grid-template-columns: 76px minmax(0, 1fr); }
  .tl-item .src { display: none; }
  .tl-rail { width: 52px; }
  .tl-rail > .tl-toggle { flex-direction: column-reverse; gap: 2px; justify-content: center; align-items: flex-end; }
}

/* ---------- 友链 ---------- */
.friend-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; margin-top: 16px; }
.friend-card {
  display: flex; gap: 12px; align-items: center;
  background: var(--color-neutral-2); border: 1px solid var(--color-border);
  border-radius: var(--r-lg); padding: 14px 16px;
  transition: background .15s;
}
.friend-card:hover { background: var(--color-neutral-3); color: inherit; }
.friend-ava {
  width: 40px; height: 40px; flex-shrink: 0; border-radius: var(--r-md);
  background: var(--color-neutral-3); border: 1px solid var(--color-border);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.friend-fav { width: 100%; height: 100%; object-fit: contain; padding: 3px; box-sizing: border-box; }
.friend-name { font-size: var(--text-copy-14); font-weight: 500; color: var(--color-neutral-10); }
.friend-desc { font-size: var(--text-label-12); color: var(--color-neutral-7); margin-top: 2px; }

/* ---------- 搜索 ---------- */
.search-bar { display: flex; gap: 10px; margin: 18px 0 6px; }
.search-bar input {
  flex: 1; background: var(--color-neutral-2); border: 1px solid var(--color-border);
  border-radius: var(--r-md); padding: 11px 16px;
  font: inherit; font-size: var(--text-copy-15); color: var(--color-neutral-10); outline: none;
}
.search-bar input:focus { border-color: var(--color-accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--color-accent) 25%, transparent); }
.search-bar button {
  background: var(--color-accent); color: #fff; border: none; cursor: pointer;
  border-radius: var(--r-md); padding: 11px 22px;
  font: inherit; font-size: var(--text-copy-14); font-weight: 500;
}
.search-bar button:hover { opacity: .88; }
.results { margin-top: 14px; border-top: 1px solid var(--color-border); }
.hit {
  display: block; padding: 14px 10px; border-bottom: 1px solid var(--color-border);
  transition: background .15s;
}
.hit:hover { background: var(--color-neutral-2); color: inherit; }
.hit:hover .t { color: var(--color-accent); }
.hit .t { font-size: var(--text-copy-15); font-weight: 500; color: var(--color-neutral-10); }
.hit .m { display: block; margin-top: 3px; font-size: var(--text-copy-13); color: var(--color-neutral-7); }

/* ---------- 登录 ---------- */
.login-wrap { max-width: 380px; margin: 10vh auto 0; text-align: center; }
.login-card {
  background: var(--color-neutral-2); border: 1px solid var(--color-border);
  border-radius: var(--r-2xl); padding: 40px 32px;
}
.login-ava {
  width: 64px; height: 64px; margin: 0 auto 18px; border-radius: var(--r-xl);
  background: var(--color-accent);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-serif); font-size: 26px; font-weight: 500; color: #fff;
}
.login-card h1 { font-family: var(--font-serif); font-size: var(--text-title-20); font-weight: 500; color: var(--color-neutral-10); }
.login-card .label { margin: 6px 0 22px; }
.login-card input {
  width: 100%; background: var(--color-neutral-1); border: 1px solid var(--color-border);
  border-radius: var(--r-md); padding: 11px 14px;
  font: inherit; font-size: var(--text-copy-14); color: var(--color-neutral-10); outline: none;
}
.login-card input:focus { border-color: var(--color-accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--color-accent) 25%, transparent); }
.login-btn {
  width: 100%; margin-top: 12px; background: var(--color-accent); color: #fff; border: none;
  border-radius: var(--r-md); padding: 11px; font: inherit; font-size: var(--text-copy-14); font-weight: 500; cursor: pointer;
}
.login-btn:hover { opacity: .88; color: #fff; }
.login-msg { margin-top: 12px; font-size: var(--text-label-12); min-height: 18px; color: var(--color-neutral-7); }
.login-msg.err { color: var(--color-error); }
.login-note { margin-top: 16px; font-size: var(--text-label-12); color: var(--text-sub); }
/* 登录/注册 页签式表单 */
.login-card .lv { text-align: left; }
.login-card .lv h1, .login-card .lv .label { text-align: center; }
.ltabs { display: flex; justify-content: center; gap: 4px; margin-bottom: 10px; background: var(--color-neutral-2); border-radius: 12px; padding: 4px; }
.ltab {
  flex: 1; border: 0; background: transparent; cursor: pointer;
  padding: 8px 18px; border-radius: 9px;
  font-size: var(--text-copy-14); color: var(--color-neutral-7);
  transition: background 0.15s, color 0.15s;
}
.ltab.on { background: var(--color-paper); color: var(--color-neutral-10); box-shadow: 0 1px 4px rgba(20,19,18,.10); }
.lt-title { margin-bottom: 18px; }
.lf {
  display: block; width: 100%; box-sizing: border-box;
  margin-bottom: 10px; padding: 10px 14px;
  background: var(--color-paper); border: 1px solid var(--color-border); border-radius: 12px;
  font-size: var(--text-copy-14); color: var(--color-neutral-10);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.lf:focus { outline: none; border-color: var(--color-accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--color-accent) 25%, transparent); }
.lpwdrule { margin: -4px 0 10px; font-size: var(--text-label-12); color: var(--text-sub); }
.lrow { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }
.lrow a { font-size: var(--text-label-12); color: var(--color-accent); text-decoration: none; }
.lrow a:hover { text-decoration: underline; }
.lback { display: inline-block; margin-top: 12px; font-size: var(--text-label-12); color: var(--color-neutral-7); text-decoration: none; }
.lback:hover { color: var(--color-accent); }

/* ---------- 文章页 ---------- */
.doc {
  background: var(--color-neutral-1);
  border: 1px solid var(--color-border);
  border-radius: var(--r-2xl);
  padding: 34px 36px;
}
.doc h1 { font-family: var(--font-serif); font-size: var(--text-title-28); line-height: var(--lh-title28); font-weight: 500; color: var(--color-neutral-10); margin-bottom: 14px; }
.doc-meta { display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: var(--text-label-12); color: var(--text-sub); border-bottom: 1px solid var(--color-border); padding-bottom: 14px; margin-bottom: 22px; }
.doc .content { font-size: var(--text-copy-15); line-height: 1.75; overflow-wrap: break-word; }
.doc .content h2 { font-family: var(--font-serif); font-size: var(--text-title-20); line-height: var(--lh-title20); font-weight: 500; color: var(--color-neutral-10); margin: 30px 0 12px; }
.doc .content h3 { font-size: var(--text-copy-16); font-weight: 500; color: var(--color-neutral-10); margin: 22px 0 10px; }
.doc .content h4, .doc .content h5, .doc .content h6 { font-size: var(--text-copy-15); font-weight: 500; color: var(--color-neutral-9); margin: 18px 0 8px; }
.doc .content p { margin: 12px 0; }
.doc .content ul, .doc .content ol { padding-left: 24px; margin: 12px 0; }
.doc .content li { margin: 5px 0; }
.doc .content table { border-collapse: collapse; margin: 14px 0; font-size: var(--text-copy-13); display: block; overflow-x: auto; max-width: 100%; }
.doc .content th, .doc .content td { border: 1px solid var(--color-border); padding: 6px 10px; }
.doc .content th { background: var(--color-neutral-2); }
.doc .content blockquote { border-left: 3px solid var(--color-accent); padding: 10px 16px; margin: 14px 0; color: var(--color-neutral-7); border-radius: 0 var(--r-md) var(--r-md) 0; background: var(--color-neutral-2); }
.doc .content code { background: var(--color-neutral-2); border-radius: var(--r-chip); padding: 1px 6px; font-family: var(--font-mono); font-size: var(--text-copy-13); }
.doc .content pre { background: var(--color-neutral-2); border: 1px solid var(--color-border); border-radius: var(--r-md); padding: 16px; overflow-x: auto; margin: 14px 0; }
.doc .content pre code { background: none; padding: 0; }
.doc .content a { color: var(--color-accent); text-decoration: underline; text-underline-offset: 3px; }
.doc .content img { margin: 14px 0; }
.doc .content iframe { max-width: 100%; }
@media (max-width: 640px) { .doc { padding: 24px 18px; } }
.doc-aside { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.badge { background: var(--color-neutral-2); border: 1px solid var(--color-border); border-radius: var(--r-chip); padding: 2px 10px; font-size: var(--text-label-12); color: var(--color-neutral-7); }

/* 404 */
.notfound { text-align: center; padding: 12vh 0; }
.notfound .big { font-family: var(--font-serif); font-size: 64px; font-weight: 500; color: var(--color-accent); }
