/* =====================================================================
   正文排版（B「派派一家」，11-07）：技能、教程、项目、快讯详情和关于 / 投稿 / 隐私 / MCP 说明页的正文。
   照样稿 proto/brand/site/resource.css 的 .md 一段写（教程页的不同之处在 b/tutorial.css）。
   正文 HTML 是 app/web/mdx.py 排好的（.md 里面：h3 / h4、列表、.code 代码块 + .cp 复制、.tbl 表格、.fig 截图 + 图说、
   blockquote（.say 你只要说 / .got AI 回给你 / .note 说明）、.say-chip 带复制的一句话），技能详情的常见问题 .faq、效果案例 .cases
   是 services/pages.py 排的——类名都不改，这里只写样子。代码块分「发给 AI 的话」「在终端里执行」两种由 pp/js/reading.js 认出来加类（不开 JS 时都是深底）。
   只用 site.css 的变量。字号跟着外面的容器走（技能详情的白纸 16～18，其余 16）。
   ===================================================================== */
.md { font-size: inherit; line-height: 1.9; color: var(--ink); overflow-wrap: break-word; }
.md > :first-child { margin-top: 0; }
.md > :last-child { margin-bottom: 0; }
.md p { margin: 0 0 1em; }
.md h2 { margin: 2em 0 .7em; font: var(--display-w) 1.375em/1.4 var(--display); -webkit-text-stroke: var(--display-stroke) currentColor; letter-spacing: .01em; }   /* 说明页正文里的小节（关于、隐私、MCP） */
.md h3 { margin: 2em 0 .6em; font: 600 1.125em/1.5 var(--sans); }
.md h4 { margin: 1.6em 0 .5em; font: 600 1em/1.5 var(--sans); color: var(--ink-2); }
.md :is(h2, h3, h4, section, details) { scroll-margin-top: var(--space-lg); }
.md ul, .md ol { margin: 0 0 1em; padding-left: 1.5em; }
.md ul { list-style: disc; }
.md ol { list-style: decimal; }
.md li { margin: .35em 0; padding-left: .25em; }
.md li > p { margin: 0 0 .5em; }
.md li > ul, .md li > ol { margin: .35em 0; }
.md li::marker { color: var(--ink-3); }
.md ol > li::marker { font-weight: 600; color: var(--link); font-variant-numeric: tabular-nums; }
.md strong { font-weight: 600; }
.md a { padding-block: 4px; color: var(--link); text-decoration: underline; text-decoration-color: rgb(9 88 217 / .3); text-underline-offset: 3px; transition: text-decoration-color .2s; }
@media (hover: hover) { .md a:hover { text-decoration-color: currentColor; } }
.md code { padding: .1em .4em; border-radius: var(--r-sm); background: var(--sunk); box-shadow: inset 0 0 0 1px var(--line); font: 400 .875em/1.6 var(--mono); color: var(--ink); overflow-wrap: anywhere; }
.md mark { padding: 0 2px; border-radius: 3px; background: var(--blue-bg); color: inherit; }

/* 正文里「发这句话」那种（6 个汉字以上的行内代码）：浅蓝底 + 一个小复制 */
.md .say-chip { display: inline-flex; align-items: center; gap: var(--space-sm); max-width: 100%; padding: 2px 3px 2px 10px; border-radius: 10px; background: var(--blue-bg); box-shadow: inset 0 0 0 1px var(--blue-line); vertical-align: baseline; line-height: 1.6; }
.md .say-chip code { padding: 0; background: none; box-shadow: none; font-family: var(--sans); font-size: inherit; white-space: normal; }
.md .say-chip button { flex: none; display: inline-grid; place-items: center; height: 24px; padding: 0 8px; border: 0; border-radius: var(--r-pill); background: var(--paper); box-shadow: inset 0 0 0 1px var(--line-2);
  font-size: var(--fs-xs); font-weight: 600; line-height: 1; color: var(--ink); transition: color .2s, box-shadow .2s; }
@media (hover: hover) { .md .say-chip button:hover { color: var(--link); box-shadow: inset 0 0 0 1px var(--blue-line); } }

/* 复制按钮点了以后：「✓ 已复制」（ui.js 补的第二层字前面加一个对勾，绿字） */
:is(.md .cp, .md .say-chip button, .pd-say__cp) .pp-swap-b::before { content: ""; width: 12px; height: 12px; margin-right: -4px; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / contain no-repeat; }
.md .say-chip button.pp-done { color: var(--ok); }

/* 引用：「你只要说」浅灰蓝底，「AI 回给你」浅蓝底 + 浅蓝边，「说明」（测试环境、核对日期这类交代）浅灰蓝底小一号；前面一个白底小标签 */
.md blockquote { margin: 0 0 1em; padding: 12px 16px; border-radius: var(--r-md); background: var(--sunk); }
.md blockquote.got { background: var(--blue-bg); box-shadow: inset 0 0 0 1px var(--blue-line); }
.md blockquote.note { font-size: .875em; line-height: 1.8; color: var(--ink-2); }
.md blockquote .lbl { display: inline-flex; align-items: center; gap: 4px; margin-bottom: 6px; padding: 0 8px; border-radius: var(--r-sm); background: var(--paper); box-shadow: inset 0 0 0 1px var(--line); font-size: var(--fs-xs); font-weight: 600; line-height: 22px; color: var(--ink-2); }
.md blockquote .lbl svg { width: 14px; height: 14px; color: var(--blue); }
.md blockquote.say .lbl { color: var(--link); box-shadow: inset 0 0 0 1px var(--blue-line); }
.md blockquote > :last-child { margin-bottom: 0; }
.md blockquote code { background: var(--paper); }

/* 表格：细边圆角框，表头浅灰蓝底，太宽就横着滑 */
.md .tbl { margin: .25em 0 1.25em; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-md); scrollbar-width: thin; }
.md table { width: 100%; border-collapse: collapse; font-size: .875em; line-height: 1.7; }
.md th, .md td { min-width: 6em; padding: 10px 16px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.md th, .md thead td { background: var(--sunk); font-weight: 600; white-space: nowrap; }   /* thead td：表头空着的左上角格子（mdx.py 写成 td） */
.md tbody tr:last-child td { border-bottom: 0; }
.md tbody td:first-child { font-weight: 600; }
.md td code { white-space: nowrap; }
.md .tbl table:has(tr > :nth-child(4)) { min-width: 640px; }

/* 代码块：上面一行写清楚是哪种（reading.js 认：「发给 AI 的话」浅蓝底 / 「在终端里执行」墨色底，认不出的配置、代码照旧墨色底不写字），右上角复制（原地变「✓ 已复制」） */
.md .code { position: relative; margin: .25em 0 1.25em; border-radius: var(--r-md); background: var(--ink); color: var(--line); }
.md .code pre { margin: 0; padding: 44px 18px 16px; overflow-x: auto; font: 400 .875em/1.75 var(--mono); white-space: pre; tab-size: 2; scrollbar-width: thin; }
.md .code:not(.is-say):not(.is-term) pre { padding: 16px 92px 16px 18px; }   /* 认不出是哪种（配置、代码，或者没开 JS）：上面不留写字的那一行 */
.md .code pre:focus-visible { outline: 2px solid var(--line); outline-offset: -4px; border-radius: var(--r-md); }
.md .code code { padding: 0; border-radius: 0; background: none; box-shadow: none; font: inherit; color: inherit; overflow-wrap: normal; }
.md .code::before, .md .code::after { position: absolute; top: 0; height: 40px; pointer-events: none; }
.md .code.is-term::before, .md .code.is-say::before { content: ""; left: 16px; width: 14px; background: currentColor; }
.md .code.is-term::after, .md .code.is-say::after { left: 36px; display: flex; align-items: center; font-size: var(--fs-xs); line-height: 1; }
.md .code.is-term::before { color: var(--ph);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4.5' width='18' height='15' rx='2.5'/%3E%3Cpath d='M7 9.5l3 2.5-3 2.5M12.5 15h4.5'/%3E%3C/svg%3E") center / 14px no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4.5' width='18' height='15' rx='2.5'/%3E%3Cpath d='M7 9.5l3 2.5-3 2.5M12.5 15h4.5'/%3E%3C/svg%3E") center / 14px no-repeat; }
.md .code.is-term::after { content: "在终端里执行"; color: var(--ph); }   /* #8C8C8C 在墨色底上 5.6:1 */
.md .code.is-say { background: var(--blue-bg); box-shadow: inset 0 0 0 1px var(--blue-line); color: var(--ink); }
.md .code.is-say::before { color: var(--link);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4.5 6.5A2.5 2.5 0 0 1 7 4h10a2.5 2.5 0 0 1 2.5 2.5v7A2.5 2.5 0 0 1 17 16H11l-4.5 4v-4H7a2.5 2.5 0 0 1-2.5-2.5z'/%3E%3C/svg%3E") center / 14px no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4.5 6.5A2.5 2.5 0 0 1 7 4h10a2.5 2.5 0 0 1 2.5 2.5v7A2.5 2.5 0 0 1 17 16H11l-4.5 4v-4H7a2.5 2.5 0 0 1-2.5-2.5z'/%3E%3C/svg%3E") center / 14px no-repeat; }
.md .code.is-say::after { content: "发给 AI 的话"; color: var(--link); font-weight: 600; }
.md .code.is-say pre { white-space: pre-wrap; overflow-wrap: anywhere; font: 400 1em/1.8 var(--sans); }
.md .code.is-say pre:focus-visible { outline-color: var(--blue); }
.md .code .cp { position: absolute; top: 6px; right: 8px; display: inline-grid; place-items: center; height: 28px; padding: 0 12px; border: 0; border-radius: var(--r-pill);
  background: rgb(255 255 255 / .1); color: var(--paper); font-size: var(--fs-xs); font-weight: 600; line-height: 1; transition: background-color .2s, color .2s, box-shadow .2s; }
@media (hover: hover) { .md .code .cp:hover { background: rgb(255 255 255 / .18); } }
.md .code .cp:focus-visible { outline-color: var(--line); }
.md .code.is-say .cp { background: var(--paper); color: var(--ink); box-shadow: inset 0 0 0 1px var(--blue-line); }
@media (hover: hover) { .md .code.is-say .cp:hover { color: var(--link); background: var(--paper); } }
.md .code.is-say .cp:focus-visible { outline-color: var(--blue); }
.md .code.is-say .cp.pp-done { color: var(--ok); }
@media (pointer: coarse) { .md .code .cp::after, .md .say-chip button::after { content: ""; position: absolute; inset: -8px -4px; } .md .say-chip button { position: relative; } }

/* 截图：单独一行的大图 + 图说；细边勾出来，浅色截图不会融进白纸；能放大的（zoom.js 挑）光标是放大镜 */
.md .fig { margin: .5em 0 1.5em; }
.md .fig img, .md p img { display: block; max-width: 100%; height: auto; border-radius: var(--r-md); background: var(--sunk); box-shadow: 0 0 0 1px var(--line); }
.md .fig figcaption { margin-top: 10px; font-size: var(--fs-sm); line-height: 1.6; color: var(--ink-3); text-align: center; text-wrap: balance; }
.md video { display: block; max-width: 100%; border-radius: var(--r-md); background: var(--ink); }
.pp-zoomable { cursor: zoom-in; }
.pp-zoomable:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }

/* 常见问题（services/pages.py 的 .faq）：一问一行，左边蓝色「问」，点开看答案；技能详情右上角「全部展开」 */
.faq { border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.faq details + details { border-top: 1px solid var(--line); }
.faq summary { display: flex; align-items: center; gap: var(--space-ms); min-height: 56px; padding: 12px 20px; cursor: pointer; list-style: none; font-weight: 600; line-height: 1.6; transition: background-color .2s; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before { content: "问"; flex: none; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--blue-bg); color: var(--link); font: var(--display-w) 14px/1 var(--display); }
.faq summary::after { content: ""; flex: none; margin-left: auto; width: 8px; height: 8px; border-right: 1.6px solid var(--ink-3); border-bottom: 1.6px solid var(--ink-3); transform: translateY(-2px) rotate(45deg); transition: transform .25s var(--ease); }
.faq details[open] > summary::after { transform: translateY(2px) rotate(-135deg); }
@media (hover: hover) { .faq summary:hover { background: var(--sunk); } }
.faq summary:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
.faq .ans { padding: 0 20px 18px 58px; }

/* 效果案例 / 使用场景（services/pages.py 的 .cases）：用之前浅灰、用之后浅蓝、效果数字绿 */
.cases { display: grid; gap: var(--space-md); }
.case { padding: var(--space-md) var(--space-lg); border: 1px solid var(--line); border-radius: var(--r-md); }
.md .case h3 { margin: 0 0 var(--space-sm); font: 600 1em/1.5 var(--sans); }
.case .say, .case .got { margin: 0 0 var(--space-sm); padding: var(--space-sm) var(--space-md); border-radius: var(--r-md); line-height: 1.75; }
.case .say { background: var(--sunk); }
.case .got { background: var(--blue-bg); box-shadow: inset 0 0 0 1px var(--blue-line); }
.case i { margin-right: var(--space-sm); padding: 0 var(--space-sm); border-radius: var(--r-sm); background: var(--paper); box-shadow: inset 0 0 0 1px var(--line); font-style: normal; font-size: var(--fs-xs); color: var(--ink-2); }
.case .imgs { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-sm); margin: var(--space-xs) 0 var(--space-sm); }
.case .imgs figure { margin: 0; }
.case .imgs img { display: block; width: 100%; height: auto; border-radius: var(--r-md); box-shadow: 0 0 0 1px var(--line); }
.case .imgs figcaption { margin-top: var(--space-xs); font-size: var(--fs-xs); color: var(--ink-3); text-align: center; }
.case .metric { display: inline-block; margin: var(--space-xs) 0 0; padding: var(--space-xs) var(--space-ms); border-radius: var(--r-sm); background: var(--t-opensource-bg); color: var(--ok); font-size: var(--fs-sm); font-weight: 600; }

/* 「本站实测」一小节（技能、教程详情的模板把「### …实测…」到下一个小标题包成 .rd-lab）：浅灰蓝底一整块，标题前一个烧杯、后面「✓ 编辑部实测」 */
.rd-lab { margin: 2em 0 1.5em; padding: clamp(16px, 1.6vw, 28px) clamp(16px, 1.8vw, 32px) clamp(8px, .8vw, 16px); border-radius: var(--r-lg); background: var(--sunk); }
.rd-lab__head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-sm) var(--space-ms); margin-bottom: .8em; }
.md .rd-lab__head h3 { margin: 0; }
.rd-lab__ico { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--paper); color: var(--link); box-shadow: var(--sh); }
.rd-lab__ico svg { width: 18px; height: 18px; }
.rd-lab__badge { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 10px; border-radius: var(--r-sm); background: var(--paper); box-shadow: inset 0 0 0 1px var(--line); color: var(--ok); font-size: var(--fs-xs); font-weight: 600; }
.rd-lab__badge svg { width: 14px; height: 14px; }
.rd-lab code { background: var(--paper); }
.rd-lab .fig figcaption { color: var(--ink-2); }   /* 浅灰蓝底上灰二只有 4.4:1，用灰一 */
.rd-lab .fig img { box-shadow: 0 0 0 1px var(--line-2); }
.rd-lab blockquote { background: var(--paper); }

/* 很长的安装步骤：先露出一截，点「展开全部步骤」再看全 */
.md.is-fold { position: relative; max-height: 760px; overflow: hidden; }
.md.is-fold::after { content: ""; position: absolute; inset: auto 0 0; height: 160px; background: linear-gradient(rgb(255 255 255 / 0), var(--paper) 85%); pointer-events: none; }
.rd-unfold { width: 100%; margin-top: var(--space-sm); }
.rd-unfold svg { transition: none; }

/* 手机：表格横着滑（第一列别挤太窄），代码块字小一点 */
@media (max-width: 599px) {
  .md .tbl { margin-inline: 0; }
  .md th, .md td { padding: 8px 12px; }
  .md .code pre { padding-inline: 14px; }
  .faq summary { padding: 12px 14px; }
  .faq .ans { padding: 0 14px 16px; }
  .case { padding: var(--space-md); }
}


/* ---------- 详情页共用的小零件（技能、教程、项目详情；模板 pp/_doc.html）：后台预览提示条、「搜别的」小搜索框、头部封面 ---------- */
.dt-preview { margin: 0 0 var(--space-md); padding: var(--space-ms) var(--space-md); border-radius: var(--r-md); background: var(--blue-bg); box-shadow: inset 0 0 0 1px var(--blue-line); font-size: var(--fs-sm); }
.dt-find { flex: none; margin-left: auto; width: clamp(220px, 14vw, 320px); height: 40px; padding: 0 8px 0 14px; }
.dt-find .search__input { font-size: var(--fs-sm); }
.dt-kbd { flex: none; display: grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: var(--r-sm); box-shadow: inset 0 0 0 1px var(--line-2); font: 400 var(--fs-xs)/1 var(--mono); color: var(--ink-3); }
.dt-find:focus-within .dt-kbd { display: none; }
.dt-cover { position: relative; margin: 0; aspect-ratio: 3 / 2; border-radius: var(--r-md); overflow: hidden; background: var(--sunk); box-shadow: var(--sh); }
.dt-cover::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px rgb(31 45 61 / .07); pointer-events: none; }
.dt-cover img { display: block; width: 100%; height: 100%; object-fit: cover; }
.dt-cover:has(.pp-zoomable:focus-visible) { outline: 2px solid var(--blue); outline-offset: 2px; }   /* 外框 overflow: hidden，焦点框画在外框上 */
.dt-cover__ph, .dt-thumb__ph { display: grid; place-items: center; width: 100%; height: 100%; background: var(--tg-bg, var(--sunk)); color: var(--tg-fg, var(--ink-3)); font: var(--display-w) clamp(40px, 3vw, 64px)/1 var(--display); -webkit-text-stroke: var(--display-stroke) currentColor; }
.dt-thumb__ph { font-size: 22px; }
@media (pointer: coarse) { .dt-kbd { display: none; } }

/* 正文里单独一行的站内视频（reading.js 把「看本站实测成片」这类 mp4 链接换成播放器） */
.md .rd-video video { width: 100%; aspect-ratio: 16 / 9; box-shadow: 0 0 0 1px var(--line); }
.md .rd-video figcaption a { color: var(--link); }
