/* 书的正文样式（来自 src/00_head.html，去掉了打印专用部分；屏幕上的调整见 site.css） */
:root { --main: #1e6b8f; --main-dk: #134a63; --accent: #e8743b; --ink: #15212c; --text: #24303b; --muted: #6b7987;
          --soft: #eef4f7; --line: #dbe4ea; --warn: #b9472f; --ok: #2e7d57; --code-bg: #f6f8fa; }
  * { box-sizing: border-box; }
  html, body { background: #fff; }
  body { font-family: "PingFang SC", "Hiragino Sans GB", sans-serif; color: var(--text);
         font-size: 10pt; line-height: 1.72; margin: 0; text-align: justify; }
  h1, h2, h3, h4, .serif { font-family: "Songti SC", "STSong", serif; }
  p { margin: 0 0 6pt; orphans: 2; widows: 2; }
  a { color: var(--main-dk); text-decoration: none; }
  b, strong { color: var(--ink); }
  code { font-family: "SF Mono", Menlo, monospace; font-size: 8.6pt; background: var(--code-bg); border: 1px solid #e3e8ed;
         border-radius: 3px; padding: 0 3pt; color: #8a2f4a; word-break: break-all; }
  .menu { font-size: 9pt; background: #f2efe8; border-radius: 3px; padding: 0 4pt; color: #5b4a2e; white-space: nowrap; }
  kbd { font: 8.5pt "SF Mono", Menlo, monospace; border: 1px solid #c9d2da; border-bottom-width: 2px; border-radius: 3px; padding: 0 3pt; }
  sup, sub { line-height: 0; }

  /* ---------- 章 ---------- */
  .chapter { page-break-before: always; }
  .chap-head { margin: 0 0 7mm; padding: 8mm 9mm 7mm; background: var(--ink); color: #fff; border-radius: 4px; position: relative; overflow: hidden; }
  .chap-head::after { content: ""; position: absolute; right: -14mm; top: -14mm; width: 52mm; height: 52mm; border-radius: 50%; border: 7mm solid rgba(232,116,59,.45); }
  .chap-head .num { font: 600 9pt "SF Mono", Menlo, monospace; color: #9fc3d6; letter-spacing: .25em; }
  .chap-head .num b { color: var(--accent); font-family: "Songti SC", serif; letter-spacing: .1em; margin-left: 6pt; font-size: 10pt; }
  .chap-head h2 { margin: 2mm 0 2mm; font-size: 23pt; line-height: 1.3; position: relative; z-index: 1; }
  .chap-head .lead { font-size: 9.6pt; color: #c9d9e3; margin: 0; position: relative; z-index: 1; max-width: 150mm; }
  .learn { display: grid; grid-template-columns: 1fr 1fr; gap: 2pt 8mm; margin: -2mm 0 6mm; padding: 6pt 10pt; background: var(--soft); border-radius: 4px; font-size: 9.2pt; break-inside: avoid; }
  .learn .h { grid-column: 1 / -1; font-weight: 700; color: var(--main-dk); font-family: "Songti SC", serif; font-size: 10.5pt; }
  .learn div:not(.h)::before { content: "✓ "; color: var(--ok); font-weight: 700; }

  h3 { font-size: 14pt; color: var(--ink); margin: 14pt 0 6pt; line-height: 1.4; break-after: avoid; }
  h3.sec { border-left: 4px solid var(--main); padding-left: 8pt; }
  h3.case { border-bottom: 2px solid var(--line); padding-bottom: 3pt; }
  h3.case .no { display: inline-block; font: 700 9.5pt "PingFang SC", sans-serif; color: #fff; background: var(--main); border-radius: 3px; padding: 1pt 7pt; margin-right: 6pt; vertical-align: 2pt; }
  h3.case .lv { float: right; font: 400 8.5pt "PingFang SC", sans-serif; color: var(--accent); border: 1px solid var(--accent); border-radius: 10px; padding: 0 7pt; margin-top: 5pt; }
  h4 { font-size: 11.3pt; color: var(--main-dk); margin: 10pt 0 4pt; break-after: avoid; }
  h4::before { content: "■ "; color: var(--accent); font-size: 8pt; vertical-align: 2pt; }
  ul, ol { margin: 2pt 0 6pt; padding-left: 16pt; }
  li { margin-bottom: 2pt; }
  ol.steps { counter-reset: st; list-style: none; padding-left: 0; }
  ol.steps > li { counter-increment: st; position: relative; padding-left: 20pt; margin-bottom: 3pt; }
  ol.steps > li::before { content: counter(st); position: absolute; left: 0; top: 1pt; width: 14pt; height: 14pt; border-radius: 50%; background: var(--main); color: #fff; font-size: 8pt; text-align: center; line-height: 14pt; font-weight: 700; }

  /* 代码 */
  .codebox { overflow: hidden; margin: 5pt 0 8pt; border: 1px solid #dfe5ea; border-left: 3px solid var(--main); border-radius: 3px; background: var(--code-bg); }
  .code-cap { font: 600 7.8pt "SF Mono", Menlo, monospace; color: var(--main-dk); background: #e8eff4; padding: 2pt 8pt; border-bottom: 1px solid #dfe5ea; break-after: avoid; }
  pre.code { margin: 0; padding: 5pt 8pt; font: 7.9pt/1.5 "SF Mono", Menlo, monospace; white-space: pre-wrap; word-break: break-all; color: #24292f; text-align: left; tab-size: 4; }
  pre.code .c, pre.code .c1, pre.code .cm, pre.code .cs { color: #6a737d; font-style: italic; }
  pre.code .cp, pre.code .cpf { color: #9a6700; }
  pre.code .k, pre.code .kd, pre.code .kn, pre.code .kr, pre.code .kc { color: #cf222e; }
  pre.code .kt { color: #0550ae; font-weight: 600; }
  pre.code .nf, pre.code .fm { color: #8250df; }
  pre.code .nb, pre.code .bp { color: #0a7f87; }
  pre.code .s, pre.code .s1, pre.code .s2, pre.code .sc { color: #0a3069; }
  pre.code .m, pre.code .mf, pre.code .mi, pre.code .mh { color: #0550ae; }
  pre.code .nc, pre.code .nn { color: #953800; }
  pre.code .o { color: #24292f; }

  /* 图 */
  section.chapter, .front, .toc { max-width: 100%; overflow-wrap: anywhere; }
  figure { margin: 8pt 0 10pt; text-align: center; break-inside: avoid; }
  figure img { max-width: 100%; border-radius: 3px; display: block; margin: 0 auto; }
  figure.shot img { box-shadow: 0 0 0 1px #dfe5ea; }
  figure svg { max-width: 100%; height: auto; display: block; margin: 0 auto; }
  figcaption { font-size: 8.6pt; color: var(--muted); margin-top: 4pt; text-align: center; line-height: 1.5; }
  figcaption b { color: var(--main-dk); margin-right: 4pt; }
  .panels { display: flex; justify-content: space-around; font-size: 8.4pt; color: var(--muted); margin-top: 2pt; }

  /* 提示框 */
  .note { margin: 6pt 0 8pt; padding: 5pt 10pt; background: #f4f8fb; border-left: 3px solid var(--main); font-size: 9.3pt; border-radius: 2px; break-inside: avoid; }
  .note > b:first-child { color: var(--main-dk); margin-right: 4pt; }
  .note.tip { background: #f1f8f4; border-left-color: var(--ok); } .note.tip > b:first-child { color: var(--ok); }
  .note.warn { background: #fcf2ef; border-left-color: var(--warn); } .note.warn > b:first-child { color: var(--warn); }
  .note.deep { background: #fbf6ee; border-left-color: var(--accent); } .note.deep > b:first-child { color: #b5531f; }
  .box { background: var(--soft); border: 1px solid var(--line); border-top: 4px solid var(--main); padding: 7pt 12pt 5pt; margin: 9pt 0; border-radius: 3px; break-inside: avoid; }
  .box h4 { margin: 0 0 4pt; } .box h4::before { content: "▍"; color: var(--main); }
  .box.accent { border-top-color: var(--accent); background: #fdf7f2; }
  .formula { overflow: hidden; text-align: center; margin: 6pt 0 8pt; padding: 6pt 8pt; background: #fafbfc; border: 1px dashed #d2dce4; border-radius: 4px; font-size: 11pt; break-inside: avoid; }
  math { font-size: 1.08em; }
  math[display="block"] { margin: 4pt 0; }

  /* 表格 */
  table { width: 100%; border-collapse: collapse; margin: 5pt 0 8pt; font-size: 8.9pt; line-height: 1.5; text-align: left; }
  tr { break-inside: avoid; }
  th { background: var(--ink); color: #fff; padding: 3.5pt 6pt; font-weight: 600; }
  td { padding: 3.5pt 6pt; border-bottom: 1px solid var(--line); vertical-align: top; }
  tr:nth-child(even) td { background: #f7fafb; }
  td code, th code { font-size: 8pt; }
  td.k { color: var(--main-dk); font-weight: 600; white-space: nowrap; }

  .two { display: grid; grid-template-columns: 1fr 1fr; gap: 0 6mm; }
  .cmp { display: grid; grid-template-columns: 1fr 1fr; gap: 0 5mm; margin: 6pt 0; }
  .cmp > div { border-radius: 4px; padding: 6pt 9pt; font-size: 9.2pt; break-inside: avoid; }
  .cmp .good { background: #f1f8f4; border: 1px solid #b9dcc8; } .cmp .bad { background: #fcf2ef; border: 1px solid #ecc5bb; }
  .cmp h5 { margin: 0 0 3pt; font-size: 10pt; }
  .summary { margin: 12pt 0 4pt; padding: 7pt 11pt; border: 1.5px solid var(--main); border-radius: 4px; break-inside: avoid; font-size: 9.4pt; }
  .summary h4 { margin: 0 0 3pt; } .summary ul { margin: 0; }
  .exercise { margin: 8pt 0; padding: 6pt 11pt; background: #fdf7f2; border-radius: 4px; font-size: 9.3pt; break-inside: avoid; }
  .exercise h4 { margin: 0 0 3pt; color: #b5531f; } .exercise h4::before { color: #b5531f; }
