/* PokiTavern 中文文档 — 以阅读为先的排版，沿用站点的酒馆配色。
   中文一律走系统字体，不加载任何 CJK Web 字体。 */
:root {
  --ink: #0e0b07;
  --ink-2: #17120b;
  --amber: #e8a33d;
  --amber-deep: #c9822a;
  --foam: #f6ecd8;
  --denim: #33507e;
  --stitch: #d9a552;
  --text: #ece3cf;
  --muted: #a3967d;
  --line: rgba(217, 165, 82, .18);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--ink);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
    'Helvetica Neue', Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji',
    'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
  font-size: 17px;
  line-height: 1.85;
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(900px 500px at 82% -10%, rgba(232,163,61,.09), transparent 60%),
    radial-gradient(800px 600px at -10% 42%, rgba(51,80,126,.13), transparent 55%);
}
.wrap { max-width: 780px; margin: 0 auto; padding: 0 24px; position: relative; z-index: 1; }

nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 0; border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 11px; color: var(--foam); text-decoration: none; }
.brand img { width: 32px; height: 32px; border-radius: 8px; }
.brand b { font-size: 19px; letter-spacing: .3px; }
nav .back { color: var(--muted); text-decoration: none; font-size: 15px; }
nav .back:hover { color: var(--amber); }

a { color: var(--amber); text-decoration: none; }
a:hover { text-decoration: underline; }

/* 面包屑 */
.crumbs { font-size: 14px; color: var(--muted); margin: 26px 0 0; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--amber); }

header.page { padding: 10px 0 30px; border-bottom: 1px solid var(--line); margin-bottom: 34px; }
header.page h1 {
  font-size: clamp(30px, 5vw, 40px); line-height: 1.28; font-weight: 800;
  color: var(--foam); margin: 12px 0 14px; letter-spacing: -.3px;
}
.meta { font-size: 14px; color: var(--muted); }
.meta span + span::before { content: "·"; margin: 0 9px; }

/* 非官方声明 —— 必须显眼 */
.disclaimer {
  border: 1px solid rgba(217,165,82,.34); border-left: 4px solid var(--amber);
  background: rgba(232,163,61,.07); border-radius: 10px;
  padding: 13px 18px; margin: 22px 0 0; font-size: 15px; color: var(--muted);
}
.disclaimer b { color: var(--foam); }

main h2 {
  font-size: 25px; line-height: 1.4; font-weight: 700; color: var(--foam);
  margin: 46px 0 4px; scroll-margin-top: 20px;
}
main h3 { font-size: 19px; font-weight: 700; color: var(--foam); margin: 30px 0 4px; }
main p { margin: 14px 0; }
main ul, main ol { margin: 14px 0 14px 22px; }
main li { margin: 7px 0; }
main strong { color: var(--foam); }

/* 答案先行块：每节开头的直接回答 */
.answer {
  background: rgba(51,80,126,.14); border-left: 3px solid var(--denim);
  border-radius: 0 10px 10px 0; padding: 13px 18px; margin: 16px 0 22px;
}
.answer p { margin: 0; }

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .89em; background: rgba(217,165,82,.11);
  border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px;
  color: var(--stitch);
}
pre {
  background: var(--ink-2); border: 1px solid var(--line); border-radius: 12px;
  padding: 16px 18px; overflow-x: auto; margin: 18px 0; line-height: 1.65;
}
pre code { background: none; border: none; padding: 0; color: var(--text); font-size: 13.5px; }

.tbl-scroll { overflow-x: auto; margin: 20px 0; }
table { border-collapse: collapse; width: 100%; font-size: 15.5px; min-width: 460px; }
th, td { text-align: left; padding: 10px 13px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--foam); font-weight: 700; white-space: nowrap; }
td code { white-space: nowrap; }

/* 文档索引卡片 */
.doc-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin: 28px 0; }
@media (max-width: 700px) { .doc-grid { grid-template-columns: 1fr; } }
.doc-card {
  border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px;
  background: rgba(23,18,11,.5); transition: border-color .2s, background .2s;
}
.doc-card:hover { border-color: rgba(217,165,82,.45); background: rgba(23,18,11,.8); }
.doc-card h3 { margin: 0 0 6px; font-size: 18px; }
.doc-card h3 a { text-decoration: none; }
.doc-card p { margin: 0; font-size: 15px; color: var(--muted); line-height: 1.65; }

/* 页尾的产品指引 —— 克制，一行 */
.cta {
  margin: 52px 0 0; padding: 16px 20px; border-radius: 12px;
  border: 1px dashed rgba(217,165,82,.36); background: rgba(232,163,61,.05);
  font-size: 15.5px; color: var(--muted);
}

footer {
  margin-top: 56px; padding: 22px 0 44px; border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; gap: 10px 18px; justify-content: space-between;
  font-size: 14px; color: var(--muted);
}

/* ── 文档目录（左侧树状导航）────────────────────────────────
   链接在构建时写进 HTML，不依赖 JS；移动端的收起由一个 CSS
   checkbox 控制显隐，而不是点击后才把内容插进 DOM，这样不执行
   脚本的爬虫一样能看到全部条目。 */
.dn-toggle { position: absolute; opacity: 0; pointer-events: none; }
.dn-open, .dn-close, .dn-scrim { display: none; }

/* 通用 nav 规则（flex / 内边距 / 下边框）是给页头那条导航的，
   这里显式复位，免得侧栏跟着变形。 */
.docnav {
  display: block; position: absolute; top: 0; left: 0; width: 208px;
  padding: 96px 0 40px; border-bottom: none;
}
.dn-inner { position: sticky; top: 24px; }
.dn-group {
  font-size: 12px; letter-spacing: 1.2px; text-transform: uppercase;
  color: var(--muted); opacity: .75; margin: 22px 0 8px; padding-left: 12px;
}
.dn-list { list-style: none; margin: 0; padding: 0; }
.dn-list li { margin: 0; }
.dn-list a {
  display: block; padding: 6px 12px; border-radius: 8px;
  font-size: 14.5px; line-height: 1.45; color: var(--muted);
  text-decoration: none; border-left: 2px solid transparent;
}
.dn-list a:hover { color: var(--foam); background: rgba(232,163,61,.06); text-decoration: none; }
.dn-list a.on {
  color: var(--amber); background: rgba(232,163,61,.10);
  border-left-color: var(--amber); font-weight: 600;
}
.dn-top a { font-weight: 600; color: var(--foam); }

/* 桌面端：给正文让出左栏 */
@media (min-width: 1100px) {
  body { --dn-w: 248px; }
  .wrap { max-width: calc(780px + var(--dn-w)); padding-left: calc(24px + var(--dn-w)); }
  .docnav { left: 24px; }
}

/* 窄屏：收进一个按钮，抽屉从左侧滑出 */
@media (max-width: 1099px) {
  .dn-open {
    display: inline-flex; align-items: center; gap: 6px;
    position: fixed; left: 16px; bottom: 18px; z-index: 60;
    padding: 9px 16px; border-radius: 999px; cursor: pointer;
    background: rgba(23,18,11,.94); color: var(--amber);
    border: 1px solid rgba(217,165,82,.42);
    font-size: 14px; font-weight: 700;
    box-shadow: 0 6px 20px rgba(0,0,0,.5);
  }
  .docnav {
    position: fixed; inset: 0 auto 0 0; width: 262px; z-index: 70;
    padding: 22px 12px 34px; overflow-y: auto;
    background: var(--ink-2); border-right: 1px solid var(--line);
    transform: translateX(-102%); transition: transform .22s ease;
  }
  .dn-inner { position: static; }
  .dn-close {
    display: block; position: absolute; top: 10px; right: 14px;
    font-size: 26px; line-height: 1; color: var(--muted); cursor: pointer;
  }
  #dn-toggle:checked ~ .docnav { transform: none; }
  #dn-toggle:checked ~ .dn-scrim {
    display: block; position: fixed; inset: 0; z-index: 65;
    background: rgba(0,0,0,.55);
  }
}

@media (prefers-reduced-motion: reduce) { .docnav { transition: none; } }
