/*
 * 文字版：博客的排法。白底、黑色粗标题、编号小签、真组件按原大小摆、等宽字标库名。
 * 正文一栏居中；画面比正文宽，可以伸到 1120。手机上单栏。
 */
:root {
  --ink: #0a0a0a;
  --body: #262626;
  --sub: #525252;
  --muted: #737373;
  --faint: #a3a3a3;
  --line: #e5e5e5;
  --line2: #d4d4d4;
  --soft: #f5f5f5;
  --soft2: #fafafa;
  --hl: #fff3b0;
  --bad: #dc2626;
  --ok: #16a34a;
  --sans: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Helvetica Neue', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --col: 1000px;
  --wide: 1200px;
  --gut: 24px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 72px; }
body { margin: 0; background: #fff; color: var(--body); font: 18px/1.85 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: underline; text-decoration-color: var(--line2); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--ink); }
img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; cursor: pointer; }
code { font: 0.86em var(--mono); background: var(--soft); padding: 2px 6px; border-radius: 4px; color: var(--ink); white-space: nowrap; }
b, strong { color: var(--ink); font-weight: 600; }
p { margin: 0 0 1.1em; }
.mono { font-family: var(--mono); }

/* ───────── 顶栏 ───────── */
.bar { position: sticky; top: 0; z-index: 50; height: 56px; display: flex; align-items: center; gap: 16px; padding: 0 var(--gut); background: rgba(255, 255, 255, 0.92); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.bar .brand { font-weight: 700; color: var(--ink); text-decoration: none; white-space: nowrap; }
.bar .brand span { font-weight: 400; color: var(--muted); margin-left: 8px; }
.bar .me { flex: none; width: 32px; height: 32px; border-radius: 50%; margin-right: -4px; box-shadow: 0 0 0 1px var(--line); }
.bar .sp { flex: 1; }
/* 头像卡片：鼠标停在头像上（手机上点一下）出名字和微信号，点微信号复制。blog.js 把头像包进 .me-w */
.bar .me-w { position: relative; flex: none; margin-right: -4px; }
.bar .me-w .me { margin: 0; transition: box-shadow 0.15s; }
.me-b { display: block; padding: 0; border: 0; border-radius: 50%; background: none; }
.me-b:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.me-w.open .me { box-shadow: 0 0 0 1px var(--ink); }
.me-card { position: absolute; right: 0; top: calc(100% + 16px); z-index: 70; display: flex; flex-direction: column; gap: 4px; width: max-content; padding: 14px 16px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: 0 8px 28px rgba(0, 0, 0, 0.1); font: 14px/1.5 var(--sans); white-space: nowrap; visibility: hidden; opacity: 0; transform: translateY(-4px); transition: opacity 0.15s, transform 0.15s, visibility 0s 0.15s; }
/* 头像和卡片中间那道缝也算在卡片上：鼠标往下移到卡片的路上不收 */
.me-card::before { content: ''; position: absolute; left: 0; right: 0; bottom: 100%; height: 18px; }
.me-w.open .me-card { visibility: visible; opacity: 1; transform: none; transition-delay: 0s; }
.me-card b { font-size: 15px; font-weight: 700; color: var(--ink); }
.me-wx { display: flex; align-items: center; margin: 0 -8px; padding: 3px 8px; border: 0; border-radius: 6px; background: none; font: 13.5px/1.7 var(--sans); color: var(--sub); text-align: left; }
.me-wx span { font: 13.5px var(--mono); color: var(--ink); }
.me-wx i { min-width: 56px; margin-left: 14px; padding: 0 9px; border: 1px solid var(--line2); border-radius: 999px; font: normal 12px/20px var(--sans); color: var(--sub); text-align: center; }
@media (hover: hover) { .me-wx:hover { background: var(--soft); } .me-wx:hover i { border-color: var(--ink); color: var(--ink); } }
.me-wx:focus-visible { outline: 2px solid var(--ink); outline-offset: 0; }
.me-w.copied .me-wx i { background: var(--ink); border-color: var(--ink); color: #fff; }
/* 代码开关：顶栏正中 */
.code-tg { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 7px 0 13px; border: 1px solid var(--line2); border-radius: 999px; background: #fff; font: 13px var(--sans); color: var(--sub); cursor: pointer; }
.bar .code-tg { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); }
.code-tg:hover { border-color: var(--ink); color: var(--ink); }
.code-tg .sw2 { position: relative; width: 30px; height: 18px; border-radius: 999px; background: var(--line2); transition: background-color 0.15s; }
.code-tg .sw2::after { content: ''; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2); transition: transform 0.15s; }
.code-tg[aria-pressed="true"] .sw2 { background: var(--ink); }
.code-tg[aria-pressed="true"] .sw2::after { transform: translateX(12px); }
@media (max-width: 760px) { .bar .code-tg { position: static; transform: none; margin-left: auto; } .bar .code-tg + .sp { display: none; } }
@media (max-width: 480px) { .bar { gap: 10px; } .bar .brand span { display: none; } .bar .code-tg { padding: 0 5px 0 10px; gap: 6px; } }
body.code-off:not(.staging) main .code:not(.eg), body.code-off:not(.staging) main figure.code-only, body.code-off:not(.staging) main h3.code-h { display: none; }
body.code-off:not(.staging) main .code-mixed { grid-template-columns: minmax(0, 1fr); }
.bar .btn-toc { display: inline-flex; align-items: center; gap: 8px; height: 32px; margin-left: -10px; padding: 0 12px 0 10px; border: 1px solid var(--line2); border-radius: 999px; background: #fff; font-size: 14px; white-space: nowrap; cursor: pointer; }
.bar .btn-toc .hb { position: relative; width: 14px; height: 2px; background: var(--ink); border-radius: 1px; }
.bar .btn-toc .hb::before, .bar .btn-toc .hb::after { content: ''; position: absolute; left: 0; width: 14px; height: 2px; background: var(--ink); border-radius: 1px; }
.bar .btn-toc .hb::before { top: -5px; }
.bar .btn-toc .hb::after { top: 5px; }
body.toc-open .bar .btn-toc, body.toc-dock .bar .btn-toc { background: var(--ink); color: #fff; border-color: var(--ink); }
body.toc-open .bar .btn-toc .hb, body.toc-open .bar .btn-toc .hb::before, body.toc-open .bar .btn-toc .hb::after, body.toc-dock .bar .btn-toc .hb, body.toc-dock .bar .btn-toc .hb::before, body.toc-dock .bar .btn-toc .hb::after { background: #fff; }
.bar .btn-toc:hover { border-color: var(--ink); }
.bar .btn-toc kbd { font: 11px var(--mono); color: var(--muted); }
.progress { position: absolute; left: 0; bottom: -1px; height: 2px; width: 0; background: var(--ink); }

/* ───────── 本篇目录：宽屏常驻左侧（右边缘能拖宽窄，按钮能收起），窄屏抽屉 ───────── */
:root { --tocw: 288px; }
.toc { position: fixed; top: 56px; left: 0; bottom: 0; z-index: 60; width: min(86vw, var(--tocw)); padding: 22px 22px 48px 24px; overflow-y: auto; overscroll-behavior: contain; background: #fff; border-right: 1px solid var(--line); transform: translateX(-102%); transition: transform 0.22s ease; }
.toc.open { transform: none; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0.25); }
.toc h4 { margin: 0 0 4px; font-size: 12px; letter-spacing: 0.1em; color: var(--muted); font-weight: 500; }
.toc .art { margin: 0 0 14px; font-size: 15px; font-weight: 700; color: var(--ink); line-height: 1.45; }
.toc a { display: grid; grid-template-columns: 38px 1fr; gap: 6px; padding: 5px 8px; margin: 0 -8px; border-radius: 6px; font-size: 14px; line-height: 1.5; color: var(--sub); text-decoration: none; }
.toc a i { font: normal 12px/1.9 var(--mono); color: var(--faint); }
.toc a:hover { background: var(--soft); color: var(--ink); }
.toc a.on { color: var(--ink); font-weight: 600; background: var(--soft); }
.toc a.on i { color: var(--ink); }
.toc .grp { display: flex; align-items: center; gap: 6px; width: 100%; margin: 12px 0 4px; padding: 4px 0; border: 0; background: none; font: 500 12.5px/1.5 var(--sans); color: var(--muted); letter-spacing: 0.04em; text-align: left; cursor: pointer; }
.toc .grp::after { content: ''; width: 6px; height: 6px; margin-left: auto; margin-right: 4px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); transition: transform 0.15s; }
.toc .grp.shut::after { transform: rotate(-45deg); }
.toc .grp:hover { color: var(--ink); }
.toc .grp.shut + .gi { display: none; }
.toc .others { margin-top: 26px; padding-top: 16px; border-top: 1px solid var(--line); }
.toc .others a { grid-template-columns: 30px 1fr; }
.toc .others a.cur { color: var(--ink); font-weight: 600; }
/* 拖宽窄的把手：贴着目录右边缘，悬停出一条黑线 */
.toc-rs { position: fixed; top: 56px; bottom: 0; left: calc(var(--tocw) - 5px); z-index: 61; width: 10px; cursor: col-resize; display: none; touch-action: none; }
.toc-rs::after { content: ''; position: absolute; top: 0; bottom: 0; left: 4px; width: 2px; background: transparent; transition: background 0.15s; }
.toc-rs:hover::after, body.toc-drag .toc-rs::after { background: var(--ink); }
body.toc-drag, body.toc-drag * { cursor: col-resize !important; user-select: none !important; }
body.toc-drag iframe { pointer-events: none; }
body.toc-dock .toc { width: var(--tocw); transform: none; transition: none; }
body.toc-dock .toc.open { box-shadow: none; }
body.toc-dock .toc-rs { display: block; }
body.toc-dock .wrap { width: auto; max-width: none; margin-left: var(--tocw); margin-right: 0; padding-left: max(var(--gut), calc((100% - var(--tocw) - var(--col)) / 2)); padding-right: max(var(--gut), calc((100% - var(--tocw) - var(--col)) / 2)); }

/* ───────── 滚动条：细、灰、圆，不抢眼 ───────── */
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track, ::-webkit-scrollbar-corner { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0, 0, 0, 0.16) content-box; border: 3px solid transparent; border-radius: 12px; min-height: 40px; }
::-webkit-scrollbar-thumb:hover { background-color: rgba(0, 0, 0, 0.34); }
::-webkit-scrollbar-thumb:active { background-color: rgba(0, 0, 0, 0.5); }
.toc::-webkit-scrollbar { width: 8px; }
.toc::-webkit-scrollbar-thumb { border-width: 2px; background-color: transparent; }
.toc:hover::-webkit-scrollbar-thumb { background-color: rgba(0, 0, 0, 0.16); }
.cmd::-webkit-scrollbar-thumb { background-color: rgba(255, 255, 255, 0.22); }
.cmd::-webkit-scrollbar-thumb:hover { background-color: rgba(255, 255, 255, 0.4); }
@supports not selector(::-webkit-scrollbar) { * { scrollbar-width: thin; scrollbar-color: rgba(0, 0, 0, 0.22) transparent; } }

/* ───────── 文章头 ───────── */
.wrap { width: 100%; max-width: calc(var(--col) + var(--gut) * 2); margin: 0 auto; padding: 0 var(--gut); }
.head { padding: 72px 0 24px; }
.kick { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; font-size: 14px; color: var(--muted); }
.kick .no { font: 600 13px/1 var(--mono); color: #fff; background: var(--ink); padding: 5px 8px; border-radius: 4px; }
/* 编号旁的小字能链到别处（比如「要你说全」链到 01 篇讲三种情况的那一节）：下划线要看得见 */
.kick a { color: var(--sub); text-decoration-color: var(--faint); text-underline-offset: 4px; }
.kick a:hover { color: var(--ink); text-decoration-color: var(--ink); }
.head h1 { margin: 18px 0 18px; font-size: clamp(32px, 5vw, 50px); line-height: 1.18; letter-spacing: -0.025em; color: var(--ink); font-weight: 700; }
.head .lead { font-size: 20px; line-height: 1.75; color: var(--sub); }
.byline { display: flex; align-items: center; gap: 12px; margin-top: 26px; font-size: 14px; color: var(--muted); flex-wrap: wrap; }
.byline img { width: 30px; height: 30px; border-radius: 50%; }
.byline b { color: var(--ink); font-weight: 600; }
.byline .dot::before { content: '·'; margin-right: 12px; }
.byline span { text-wrap: pretty; }
/* 手机上第二段另起一行，行首不留分隔点 */
@media (max-width: 640px) { .byline .dot + .dot { flex-basis: 100%; } .byline .dot + .dot::before { content: none; } }
.series { display: flex; gap: 6px; margin-top: 30px; }
.series a { flex: 1; height: 6px; border-radius: 3px; background: var(--line); }
.series a.done { background: var(--line2); }
.series a.now { background: var(--ink); }
.series-l { display: flex; justify-content: space-between; margin-top: 8px; font: 12px var(--mono); color: var(--faint); }
.intoc { margin: 36px 0 0; padding: 18px 22px; border: 1px solid var(--line); border-radius: 12px; font-size: 15px; }
.intoc b { display: block; font-size: 13px; color: var(--muted); font-weight: 500; letter-spacing: 0.06em; margin-bottom: 8px; }
.intoc ol { margin: 0; padding: 0; list-style: none; columns: 2; column-gap: 28px; }
.intoc li { break-inside: avoid; padding: 3px 0; }
.intoc li a { text-decoration: none; color: var(--sub); }
.intoc li a:hover { color: var(--ink); }
.intoc li i { font: normal 12px var(--mono); color: var(--faint); display: inline-block; width: 36px; }
@media (max-width: 640px) { .intoc ol { columns: 1; } }
/* 节多的篇：「这一篇」按部分分组——组名一行，下面两列小节 */
.intoc.grouped > ol { columns: auto; }
.intoc.grouped > ol > li:not(.ig) { padding: 3px 0 6px; }
.intoc.grouped .ig + li:not(.ig) { margin-top: 14px; padding-top: 8px; border-top: 1px solid var(--line); }
.intoc.grouped .ig { padding: 0; break-inside: auto; }
.intoc.grouped .ig + .ig { margin-top: 14px; }
.intoc.grouped .ig-h { padding: 4px 0 6px; margin-bottom: 4px; border-bottom: 1px solid var(--line); font-size: 14px; font-weight: 600; color: var(--ink); }
.intoc.grouped .ig-h i { font-weight: 400; }
.intoc.grouped .ig > ol { columns: 2; column-gap: 28px; }
@media (max-width: 640px) { .intoc.grouped .ig > ol { columns: 1; } }

/* ───────── 一节 ───────── */
.sec { padding: 88px 0 8px; }
.sec + .sec { border-top: 1px solid var(--line); margin-top: 40px; }
.part { padding: 110px 0 10px; }
.part .kick .no { font-size: 15px; padding: 6px 10px; }
.part h2 { margin: 16px 0 8px; font-size: clamp(30px, 4vw, 44px); line-height: 1.2; letter-spacing: -0.02em; color: var(--ink); }
.part p { font-size: 18px; color: var(--sub); }
.sec h2 { margin: 16px 0 14px; font-size: clamp(26px, 3.4vw, 36px); line-height: 1.28; letter-spacing: -0.02em; color: var(--ink); font-weight: 700; }
.sec .lead { font-size: 19px; line-height: 1.8; color: var(--sub); }
.sec h3 { margin: 40px 0 10px; font-size: 21px; color: var(--ink); }
/* 悬浮解释：字后面一个小问号，鼠标停上去（手机上点一下）出黑色说明 */
.tipq { position: relative; display: inline-flex; align-items: center; gap: 4px; cursor: help; outline: none; }
.tipq > i { display: inline-grid; place-items: center; width: 14px; height: 14px; border-radius: 50%; background: var(--ink); color: #fff; font: normal 600 10px/1 var(--sans); }
.tipq::after { content: attr(data-tip); position: absolute; z-index: 30; left: 0; top: calc(100% + 8px); width: max-content; max-width: min(320px, 80vw); padding: 10px 14px 11px; border-radius: 10px; background: var(--ink); color: #fff; font: 400 13.5px/1.7 var(--sans); letter-spacing: 0; white-space: normal; box-shadow: 0 8px 28px rgba(0, 0, 0, 0.18); opacity: 0; pointer-events: none; transform: translateY(-4px); transition: opacity 0.15s, transform 0.15s; }
.tipq:hover::after, .tipq:focus::after { opacity: 1; transform: none; }
.tipq.tip-r::after { left: auto; right: 0; }
.src { margin: 6px 0 0; font-size: 13px; line-height: 1.65; color: var(--faint); }
.src::before { content: '出处　'; color: var(--muted); }
.src code { font-size: 12px; background: none; padding: 0; color: var(--muted); white-space: normal; }
.k { background: linear-gradient(transparent 58%, var(--hl) 58%); color: var(--ink); font-weight: 600; }

/* 画面：比正文宽 */
.fig { position: relative; margin: 34px 0 30px; }
/* 放大看：图右上角的小按钮，鼠标移到图上才出来 */
.fig-x { position: absolute; right: 0; bottom: 100%; z-index: 5; display: inline-flex; align-items: center; gap: 6px; height: 26px; margin-bottom: 4px; padding: 0 10px 0 8px; border: 1px solid var(--line2); border-radius: 999px; background: #fff; font-size: 12px; color: var(--sub); opacity: 0; transition: opacity 0.15s; }
.fig-x i { position: relative; width: 10px; height: 10px; border: 1.5px solid currentColor; border-radius: 2px; }
.fig-x i::after { content: ''; position: absolute; right: -4px; top: -4px; width: 5px; height: 5px; border-top: 1.5px solid currentColor; border-right: 1.5px solid currentColor; }
.fig:hover > .fig-x, .fig-x:focus-visible { opacity: 1; }
.fig-x:hover { color: var(--ink); border-color: var(--ink); }
@media (hover: none) { .fig-x { display: none; } }
body.staging { overflow: hidden; }
body.staging::before { content: ''; position: fixed; inset: 0; z-index: 900; background: #fff; }
.fig.staged { position: fixed; z-index: 901; left: 50%; top: 50%; margin: 0; transform: translate(-50%, -50%) scale(var(--k, 1)); transform-origin: center; }
.fig.staged > .fig-x, .fig.staged .live-tag { display: none; }
.stage-ui { position: fixed; z-index: 902; right: 18px; bottom: 18px; display: none; align-items: center; gap: 6px; padding: 6px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255, 255, 255, 0.94); font-size: 13px; transition: opacity 0.3s; }
body.staging .stage-ui { display: flex; }
.stage-ui .sn { padding: 0 8px 0 10px; font: 12px var(--mono); color: var(--muted); white-space: nowrap; }
.stage-ui button { height: 30px; min-width: 34px; padding: 0 12px; border: 1px solid var(--line2); border-radius: 999px; background: #fff; }
.stage-ui button:hover { border-color: var(--ink); }
.stage-ui.idle { opacity: 0; }
body.stage-idle, body.stage-idle * { cursor: none !important; }
.fig.wide { width: 100%; }
.fig figcaption, .cap { margin-top: 12px; font-size: 14px; line-height: 1.7; color: var(--muted); }
.cap b { color: var(--body); }
.lab { font: 12px/1.4 var(--mono); color: var(--muted); letter-spacing: 0.02em; }
.lab b { font-weight: 500; color: var(--body); }

/* 真组件 */
.live { position: relative; overflow: hidden; background: #fff; }
.live iframe { position: absolute; left: 0; top: 0; border: 0; transform-origin: 0 0; background: transparent; opacity: 0; transition: opacity 0.3s; }
.live.ready iframe { opacity: 1; }
.live .wait { position: absolute; inset: 0; display: grid; place-items: center; font: 13px var(--mono); color: var(--faint); }
.live.ready .wait { display: none; }
.live .fallback img { width: 100%; height: auto; }
.live .fallback p { margin: 8px 0 0; font-size: 12px; color: var(--faint); }
.frame { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; }
.frame .fh { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 14px; border-bottom: 1px solid var(--line); background: var(--soft2); }
.frame .fh .lab { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.frame .fh .live-tag { font: 12px var(--mono); color: var(--ok); white-space: nowrap; }
.frame .fh .live-tag::before { content: '● '; }
.frame .fh a { font: 12px var(--mono); color: var(--muted); text-decoration: none; white-space: nowrap; }
.frame .fh a:hover { color: var(--ink); }
.frame .fb { padding: 16px; }

/* 分段开关（黑底白字） */
.ctl { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin: 0 0 14px; }
.ctl .lb { font-size: 13px; color: var(--muted); }
.seg { display: inline-flex; flex-wrap: wrap; gap: 0; border: 1px solid var(--ink); border-radius: 999px; overflow: hidden; }
.seg button { border: 0; background: #fff; padding: 6px 14px; font-size: 13.5px; color: var(--ink); white-space: nowrap; }
.seg button + button { border-left: 1px solid var(--ink); }
.seg button.on { background: var(--ink); color: #fff; }
.seg button:hover:not(.on) { background: var(--soft); }
/* 同类高亮：别的类变淡；能点的格子显示手形 */
[data-hl] [data-k] { transition: opacity 0.15s; cursor: pointer; }
[data-hl] .hl-dim { opacity: 0.16; }
.hl-f button { display: inline-flex; align-items: center; gap: 7px; }
.hl-f button i { flex: none; width: 13px; height: 13px; border-radius: 3px; }
/* 同类高亮的筛选按钮：每个按钮前面一个小色块，画法和图里那一类一样 */
.hl-f i.sw-k { background: var(--soft); box-shadow: inset 0 0 0 1.5px var(--ink); }
.hl-f i.sw-d { background: var(--soft); outline: 1.5px dashed var(--faint); outline-offset: 1px; }
.hl-f i.sw-x { background: #fde2e2; box-shadow: inset 0 0 0 1.5px var(--bad); }
.hl-f i.sw-ok { background: #fff; box-shadow: inset 0 0 0 1.5px var(--ink); }
.hl-f i.m1 { background: #fff; box-shadow: inset 0 0 0 1.5px var(--ink); }
.hl-f i.m2 { background: #d9d9d9; }
.hl-f i.m3 { background: var(--ink); }
.hl-f i.m0 { background: #fff; outline: 1.5px dashed var(--line2); outline-offset: -1px; }
.hl-f button.on i.m3, .hl-f button.on i.sw-k, .hl-f button.on i.m1, .hl-f button.on i.sw-ok { box-shadow: 0 0 0 1px #fff; }
.hl-f button.on i.m1, .hl-f button.on i.sw-ok { background: #fff; }
.btn { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 14px; border: 1px solid var(--ink); border-radius: 999px; background: var(--ink); color: #fff; font-size: 13.5px; white-space: nowrap; }
.btn.ghost { background: #fff; color: var(--ink); }
.btn.on { box-shadow: 0 0 0 3px var(--hl); }
.pick { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.pick input[type='color'] { width: 30px; height: 30px; padding: 0; border: 1px solid var(--line2); border-radius: 6px; background: none; cursor: pointer; }
.pick input[type='color']::-webkit-color-swatch-wrapper { padding: 2px; }
.pick input[type='color']::-webkit-color-swatch { border: 0; border-radius: 4px; }
input[type='range'] { accent-color: var(--ink); }

/* 编号标注：黑点 + 测量结果 */
.side { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 28px; align-items: start; }
@media (max-width: 900px) { .side { grid-template-columns: 1fr; } }
.meas { display: flex; flex-direction: column; gap: 0; border-top: 1px solid var(--ink); }
.meas .m { display: grid; grid-template-columns: 26px 1fr auto; gap: 10px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.meas .m i { width: 22px; height: 22px; border-radius: 50%; background: var(--ink); color: #fff; font: normal 600 12px/22px var(--mono); text-align: center; }
.meas .m .v { font: 600 14px var(--mono); color: var(--ink); display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.meas .m .v.bad { color: var(--bad); }
.meas .m .v.ok { color: var(--ok); }
.meas .note { padding: 10px 0 0; font-size: 12.5px; color: var(--faint); line-height: 1.6; }
.sw { display: inline-block; width: 16px; height: 16px; border-radius: 4px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12); vertical-align: -3px; }

/* 五个库并排 */
.libs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.libs .lib .lab { margin-bottom: 6px; }
.libs .lib img { border: 1px solid var(--line); border-radius: 8px; background: #fff; }
/* 截图自己带边框的（blog.js 标 own-frame）：不再套外框。类名重复三次是为了压过各篇给截图加框的写法 */
img.own-frame.own-frame.own-frame { border-color: transparent; }
@media (max-width: 900px) { .libs { grid-template-columns: repeat(5, 64vw); overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; } .libs .lib { scroll-snap-align: start; } }

/* 代码面板：一句人话标题、文件和行号；关键行黑，其它行灰 */
.code { border: 1px solid var(--line2); border-radius: 10px; overflow: hidden; background: #fff; margin: 0; }
.code .tab { padding: 10px 14px 9px; border-bottom: 1px solid var(--line); background: var(--soft2); }
.code .tab .s { display: block; font-size: 14px; font-weight: 600; color: var(--ink); line-height: 1.5; }
.code .tab b { display: block; margin-top: 2px; font: 400 11.5px/1.5 var(--mono); color: var(--muted); overflow-wrap: anywhere; }
.code pre { margin: 0; padding: 10px 0 12px; font: 13px/1.75 var(--mono); color: #9a9a9a; overflow-x: auto; }
.code pre .l { display: grid; grid-template-columns: 52px 1fr; column-gap: 14px; padding-right: 14px; }
.code pre .l .ln { text-align: right; color: #cfcfcf; user-select: none; }
.code pre .l .tx { white-space: pre-wrap; word-break: break-word; }
.code pre .l.h { color: var(--ink); background: #f3f3f3; box-shadow: inset 3px 0 0 var(--ink); font-weight: 600; }
.code pre .l.h .ln { color: var(--muted); }
.code pre .l.gap .ln { color: var(--faint); }
.code pre.packed .l .tx { word-break: break-all; }
.code .say { padding: 10px 14px; border-top: 1px solid var(--line); font-size: 13.5px; line-height: 1.7; color: var(--sub); }
/* 标亮行的解释：标亮行左边一直有编号、右上角一直有「显示全部解释」（不然读者不知道能看解释）；鼠标停在行上出浮层，手机上点一下出 */
.code.has-notes { position: relative; }
.code pre .l.nt { position: relative; }
.code .nm { position: absolute; left: 6px; top: 3px; width: 17px; height: 17px; padding: 0; border: 0; border-radius: 50%; background: var(--ink); color: #fff; font: 600 10.5px/17px var(--sans); text-align: center; cursor: pointer; }
.code .nm::before, .cnote .cn-h i::before, .code .l.nr i::before { content: attr(data-n); }
.code .nm:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.code pre .l.nt.on { background: #e6e6e6; }
@media (hover: hover) { .code.has-notes pre .l.nt { cursor: help; } }
.code .nall { position: absolute; top: 8px; right: 10px; z-index: 2; height: 26px; padding: 0 11px; border: 1px solid var(--line2); border-radius: 999px; background: #fff; font: 12px/24px var(--sans); color: var(--sub); white-space: nowrap; cursor: pointer; }
.code .nall:hover { border-color: var(--ink); color: var(--ink); }
.code.has-notes .tab { padding-right: 104px; }
.code pre .l.nr { display: none; }
.code.notes-on pre .l.nr { display: grid; padding-top: 4px; padding-bottom: 10px; font: 400 13.5px/1.7 var(--sans); color: var(--ink); white-space: normal; }
.code pre .l.nr .tx { white-space: normal; }
.code .l.nr .ln { display: flex; justify-content: flex-end; padding-top: 2px; }
.code .l.nr i, .cnote .cn-h i { display: inline-block; width: 17px; height: 17px; border-radius: 50%; background: var(--ink); color: #fff; font: normal 600 10.5px/17px var(--sans); text-align: center; }
.cnote { pointer-events: none; position: fixed; z-index: 960; left: 0; top: 0; width: max-content; max-width: min(360px, calc(100vw - 24px)); padding: 10px 14px 11px; border-radius: 10px; background: var(--ink); color: #fff; font: 14px/1.7 var(--sans); box-shadow: 0 8px 28px rgba(0, 0, 0, 0.18); transform-origin: 0 0; }
.cnote[hidden] { display: none; }
.cnote.pinned { pointer-events: auto; }
.cnote .cn-h { display: flex; align-items: center; gap: 8px; margin-bottom: 3px; font: 12px/1.5 var(--mono); color: #a3a3a3; }
.cnote .cn-h i { background: #fff; color: var(--ink); }
.cnote p { margin: 0; text-wrap: pretty; }
.cnote .cn-all { display: block; margin: 6px 0 0; padding: 0; border: 0; background: none; font: 12.5px/1.6 var(--sans); color: #bdbdbd; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.cnote .cn-all:hover { color: #fff; }
.codes { display: grid; gap: 14px; grid-template-columns: repeat(var(--n, 2), minmax(0, 1fr)); align-items: start; }
@media (max-width: 900px) { .codes { grid-template-columns: 1fr; } }

/* 表 */
.tbl-wrap { overflow-x: auto; border-top: 1px solid var(--ink); }
.tbl { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.tbl th { text-align: left; padding: 10px 12px; font: 500 12px var(--mono); color: var(--muted); border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl td:first-child { font-weight: 600; color: var(--ink); white-space: nowrap; }
.tbl td.n { font: 13.5px var(--mono); white-space: nowrap; }
.tbl td .bad { color: var(--bad); font-weight: 600; }
.tbl tr.hi td { background: var(--soft); }
.tbl td.blk { background: var(--ink); color: #fff; }

/* 卡片（浅底） */
.cards { display: grid; gap: 14px; grid-template-columns: repeat(var(--n, 3), minmax(0, 1fr)); }
@media (max-width: 900px) { .cards { grid-template-columns: 1fr; } }
.card { border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; background: #fff; display: flex; flex-direction: column; gap: 10px; }
.card h4 { margin: 0; font-size: 18px; color: var(--ink); display: flex; align-items: center; gap: 10px; line-height: 1.35; }
.card h4 .n { width: 26px; height: 26px; flex: none; border-radius: 50%; background: var(--ink); color: #fff; font: 600 13px/26px var(--mono); text-align: center; }
.card p { margin: 0; font-size: 14.5px; line-height: 1.75; color: var(--sub); }
.card .who { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); font-size: 13.5px; line-height: 1.7; color: var(--muted); }
.card .who b { color: var(--ink); }
.card.dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.card.dark h4, .card.dark p, .card.dark b { color: #fff; }
.card.dark p { color: rgba(255, 255, 255, 0.78); }

/* 「变量面板」：像 Figma 右边那一栏 */
.vp { border: 1px solid var(--line2); border-radius: 10px; overflow: hidden; background: #fff; }
.vp .vh { padding: 9px 14px; border-bottom: 1px solid var(--line); background: var(--soft2); font-size: 13px; font-weight: 600; color: var(--ink); display: flex; justify-content: space-between; gap: 10px; }
.vp .vh span { font-weight: 400; color: var(--muted); }
.vp .vr { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px; min-height: 40px; padding: 0 14px; border-bottom: 1px solid var(--line); font: 13px var(--mono); color: var(--sub); }
.vp .vr:last-child { border-bottom: 0; }
.vp .vr .v { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); font-weight: 600; white-space: nowrap; }
.vp .vr .v.empty { color: var(--faint); font-weight: 400; font-style: italic; }
.vp .vr .v.empty .sw { background: repeating-linear-gradient(45deg, #fff 0 3px, #e5e5e5 3px 6px); }
.vp .vr.warn { background: #fff4f4; }
.vp .vr.warn .v { color: var(--bad); }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 4px; font: 12px var(--mono); background: var(--soft); color: var(--sub); white-space: nowrap; }
.chip.bound { background: #ede9fe; color: #5b21b6; }
.chip.none { background: #fff; color: var(--faint); box-shadow: inset 0 0 0 1px var(--line2); }

/* 流程：一格一格，点一格看说明 */
.flow { display: flex; align-items: stretch; gap: 0; overflow-x: auto; padding: 4px 2px 8px; }
.flow .node { flex: 1; min-width: 140px; padding: 14px 12px; border: 1px solid var(--line2); border-radius: 10px; background: #fff; text-align: center; cursor: pointer; transition: background 0.15s; }
.flow .node b { display: block; font-size: 17px; color: var(--ink); }
.flow .node small { display: block; margin-top: 4px; font: 11px var(--mono); color: var(--muted); word-break: break-all; }
.flow .node:hover { border-color: var(--ink); }
.flow .node.on { background: var(--ink); border-color: var(--ink); }
.flow .node.on b, .flow .node.on small { color: #fff; }
.flow .arr { flex: none; width: 28px; align-self: center; height: 1px; background: var(--line2); position: relative; }
.flow .arr::after { content: ''; position: absolute; right: 0; top: -4px; border: 4px solid transparent; border-left: 6px solid var(--line2); border-right: 0; }
.flow-detail { margin-top: 12px; padding: 18px 20px; border: 1px solid var(--line); border-radius: 12px; background: var(--soft2); min-height: 120px; }
.flow-detail h4 { margin: 0 0 6px; font-size: 17px; color: var(--ink); }
.flow-detail p { margin: 0; font-size: 15px; line-height: 1.8; color: var(--sub); }
.flow-detail .f { margin-top: 8px; font: 12px var(--mono); color: var(--muted); }

/* 梯子 */
.ladder { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--ink); counter-reset: r; }
.ladder li { display: grid; grid-template-columns: 34px 150px 1fr; gap: 14px; align-items: baseline; padding: 13px 0; border-bottom: 1px solid var(--line); font-size: 15px; color: var(--sub); }
.ladder li::before { counter-increment: r; content: counter(r); font: 600 13px var(--mono); color: var(--muted); }
.ladder li b { font-size: 16px; }
.ladder-ends { display: flex; justify-content: space-between; margin-top: 8px; font: 12px var(--mono); color: var(--faint); }
@media (max-width: 640px) { .ladder li { grid-template-columns: 26px 1fr; } .ladder li span { grid-column: 2; } }

/* 大数字 */
.nums { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border-top: 1px solid var(--ink); }
.nums > div { padding: 20px 18px 6px 0; }
.nums > div + div { padding-left: 18px; border-left: 1px solid var(--line); }
.nums .big { font: 700 clamp(36px, 6vw, 60px)/1 var(--sans); letter-spacing: -0.02em; color: var(--ink); }
.nums .big small { font-size: 0.45em; color: var(--muted); margin-left: 4px; font-weight: 500; }
.nums p { margin: 10px 0 0; font-size: 14px; line-height: 1.6; color: var(--muted); }
@media (max-width: 640px) { .nums { grid-template-columns: 1fr; } .nums > div + div { padding-left: 0; border-left: 0; border-top: 1px solid var(--line); } }

/* 引用官方原文 */
.quote { margin: 26px 0; padding: 16px 20px; border-left: 3px solid var(--ink); background: var(--soft2); font-size: 15.5px; line-height: 1.8; color: var(--body); }
.quote .from { display: block; margin-bottom: 4px; font: 12px var(--mono); color: var(--muted); }
.quote a { font: 12px var(--mono); color: var(--muted); }

/* 一句结论 */
.pull { margin: 40px 0 10px; padding: 28px 0; border-top: 2px solid var(--ink); border-bottom: 1px solid var(--line); }
.pull p { margin: 0; font-size: clamp(22px, 3vw, 28px); line-height: 1.5; font-weight: 700; color: var(--ink); letter-spacing: -0.01em; }
.pull p + p { margin-top: 8px; font-size: 18px; font-weight: 400; color: var(--sub); }

/* 末尾：三句话、交给 AI、下一篇 */
.three { display: grid; gap: 12px; grid-template-columns: 1fr; margin: 20px 0 30px; }
.three .card { flex-direction: row; gap: 16px; align-items: baseline; }
.three .card .n { font: 600 14px var(--mono); color: var(--faint); }
.ask { border: 1px solid var(--ink); border-radius: 12px; padding: 18px 20px; }
.ask .ah { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; font-size: 15px; font-weight: 600; color: var(--ink); }
.ask pre { margin: 0; padding: 14px 16px; border-radius: 8px; background: var(--soft); font: 15.5px/1.8 var(--sans); color: var(--ink); white-space: pre-wrap; }
.ask .small { margin: 10px 0 0; font-size: 13px; color: var(--muted); }
.copy.done { background: var(--ink); color: #fff; }
.next { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 40px; }
.next a { display: block; padding: 16px 18px; border: 1px solid var(--line); border-radius: 12px; text-decoration: none; }
.next a:hover { border-color: var(--ink); }
.next a span { display: block; font: 12px var(--mono); color: var(--muted); }
.next a b { display: block; margin-top: 4px; font-size: 16px; line-height: 1.5; }
.next a.r { text-align: right; }
@media (max-width: 640px) { .next { grid-template-columns: 1fr; } .next a.r { text-align: left; } }
.foot { margin-top: 70px; padding: 26px 0 60px; border-top: 1px solid var(--line); font-size: 13px; line-height: 1.75; color: var(--muted); }

/* 博客首页 */
.home-head { padding: 80px 0 34px; }
.home-head h1 { margin: 16px 0 16px; font-size: clamp(36px, 6vw, 60px); line-height: 1.12; letter-spacing: -0.03em; color: var(--ink); }
.home-head .lead { font-size: 20px; line-height: 1.75; color: var(--sub); max-width: 860px; }
.posts { display: flex; flex-direction: column; border-top: 1px solid var(--ink); }
.post { display: grid; grid-template-columns: 70px 1fr 150px; gap: 20px; padding: 26px 0; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; align-items: start; }
.post:hover h3 { text-decoration: underline; text-decoration-color: var(--ink); text-underline-offset: 5px; }
.post .no { font: 600 15px var(--mono); color: var(--ink); padding-top: 4px; }
.post h3 { margin: 0 0 6px; font-size: 22px; line-height: 1.4; color: var(--ink); }
.post p { margin: 0; font-size: 15px; line-height: 1.75; color: var(--muted); }
.post .meta { font: 12px/1.7 var(--mono); color: var(--faint); text-align: right; padding-top: 6px; }
.post .meta .ready { color: #fff; background: var(--ink); padding: 2px 8px; border-radius: 4px; }
.post.soon h3 { color: var(--sub); }
.post p.tags { margin-top: 8px; font: 12.5px/1.7 var(--mono); color: var(--faint); }
@media (max-width: 760px) { .post { grid-template-columns: 44px 1fr; } .post .meta { grid-column: 2; text-align: left; padding-top: 0; } }
.apx { display: grid; gap: 12px; grid-template-columns: repeat(2, 1fr); }
@media (max-width: 640px) { .apx { grid-template-columns: 1fr; } }
.apx a { display: block; padding: 16px 18px; border: 1px solid var(--line); border-radius: 12px; text-decoration: none; }
.apx a:hover { border-color: var(--ink); }
.apx b { display: block; font-size: 16px; color: var(--ink); }
.apx span { display: block; margin-top: 4px; font-size: 14px; line-height: 1.7; color: var(--muted); }
.h-sec { margin: 64px 0 16px; font-size: 14px; letter-spacing: 0.08em; color: var(--muted); font-weight: 500; }
/* 首页·阅读说明：代码开关、代码解释（左边说是什么、什么时候用，下面是能点、能悬停的样子） */
.howto { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 760px) { .howto { grid-template-columns: minmax(0, 1fr); } }
.howto .ht { display: flex; flex-direction: column; gap: 10px; padding: 20px; border: 1px solid var(--line); border-radius: 12px; }
.howto h3 { margin: 0; font-size: 18px; color: var(--ink); }
.howto p { margin: 0; font-size: 15px; line-height: 1.75; color: var(--sub); }
.howto p.when b { display: inline-block; margin-right: 10px; padding: 0 8px; border-radius: 4px; background: var(--soft); font-size: 12.5px; font-weight: 500; color: var(--ink); }
.howto .ht > :last-child { margin-top: auto; }
.howto .code { margin-top: 6px; }
.ht-page { margin-top: 6px; border: 1px solid var(--line2); border-radius: 10px; overflow: hidden; background: #fff; }
.ht-bar { position: relative; display: flex; align-items: center; height: 46px; padding: 0 14px; border-bottom: 1px solid var(--line); font-size: 13px; font-weight: 700; color: var(--ink); }
.ht-bar .code-tg { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); }
.ht-bar .av { margin-left: auto; width: 22px; height: 22px; border-radius: 50%; background: var(--line); }
.ht-body { display: flex; flex-direction: column; gap: 8px; padding: 14px; }
.ht-body .ln { display: block; height: 7px; border-radius: 4px; background: var(--line); }
.ht-body .fg { display: flex; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; }
.ht-body .fg i { flex: 1; height: 26px; border-radius: 5px; background: var(--ink); }
.ht-body .fg i:nth-child(2) { background: #333; } .ht-body .fg i:nth-child(3) { background: #ebebeb; } .ht-body .fg i:nth-child(4) { background: #fff; box-shadow: inset 0 0 0 1.5px var(--ink); }
.ht-body .cd { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border: 1px solid var(--line2); border-radius: 8px; }
.ht-body .cd i { display: block; height: 6px; border-radius: 3px; background: var(--line); }
.ht-body .cd i.h { background: var(--ink); }
body.code-off .ht-body .cd { display: none; }
.cmd { margin: 12px 0 16px; padding: 14px 16px; border-radius: 10px; background: var(--ink); color: #e5e5e5; font: 13.5px/1.8 var(--mono); overflow-x: auto; white-space: pre; }
.cmd .c { color: #8a8a8a; }
.cmd pre { margin: 0; font: inherit; white-space: pre-wrap; overflow-wrap: anywhere; }
.cmd .cl { display: block; }

/* 跟 AI 说一句：AI 工具的对话框（引用的文件夹、贴的链接、说的话），右边小字标出各是什么 */
.askai { max-width: 720px; border: 1px solid var(--line2); border-radius: 18px; background: #fff; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06); padding: 14px 16px 12px; }
.askai .r { display: flex; align-items: center; gap: 14px; min-height: 34px; }
.askai .r > :first-child { min-width: 0; }
.askai .r .h { margin-left: auto; flex: none; font: 12px var(--mono); color: var(--faint); white-space: nowrap; }
.askai .r .h::before { content: ''; display: inline-block; width: 18px; margin-right: 8px; vertical-align: middle; border-top: 1px dashed var(--line2); }
.askai .tools { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--sub); }
.askai .tools img { width: 22px; height: 22px; border-radius: 6px; }
.askai .tools img:not(:first-child) { margin-left: 8px; }
.askai .link { font: 14px/1.6 var(--mono); color: var(--sub); text-decoration: underline; text-decoration-color: var(--line2); text-underline-offset: 3px; overflow-wrap: anywhere; }
.askai .say { font-size: 17px; line-height: 1.6; color: var(--ink); }
.askai .say::after { content: ''; display: inline-block; width: 2px; height: 1.05em; margin-left: 2px; vertical-align: -0.15em; background: var(--ink); animation: askai-caret 1.1s steps(1) infinite; }
@keyframes askai-caret { 50% { opacity: 0; } }
.askai .ft { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.askai .ft i { display: grid; place-items: center; width: 28px; height: 28px; border: 1px solid var(--line); border-radius: 999px; font: normal 16px/1 var(--sans); color: var(--muted); }
.askai .ft b { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 999px; background: var(--ink); color: #fff; font: 600 16px/1 var(--sans); }
@media (max-width: 640px) { .askai .r { flex-wrap: wrap; gap: 2px 10px; margin-bottom: 8px; } .askai .r .h { margin-left: 0; flex-basis: 100%; order: 2; } .askai .r .h::before { display: none; } }
/* 手机上：行尾的注释挪到命令上面一行，长的地方折行，不用横着滑 */
@media (max-width: 760px) {
  .cmd { white-space: pre-wrap; overflow-wrap: break-word; }
  .cmd .cl.has-c { display: flex; flex-direction: column-reverse; }
  .cmd .cl + .cl.has-c { margin-top: 6px; }
}

/* 手机：分段开关折行时一个按钮一个胶囊；行内代码可以断行 */
@media (max-width: 640px) {
  .seg { border: 0; gap: 6px; overflow: visible; }
  .seg button, .seg button + button { border: 1px solid var(--ink); border-radius: 999px; }
  /* 行内代码整段挪到下一行；一行放不下才在中间断 */
  p code, .cap code, li code, .src code { display: inline-block; max-width: 100%; white-space: normal; overflow-wrap: anywhere; line-height: 1.5; }
  .sec { padding-top: 64px; }
}

/* 文件表、目录总览（「先认识这个仓库」） */
.tbl.ft td.f { font: 13px var(--mono); color: var(--ink); white-space: nowrap; }
.tbl.ft td { font-size: 14px; line-height: 1.65; }
.tbl.ft td.n { color: var(--muted); text-align: right; }
.tbl.ft th.n { text-align: right; }
.tree { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 16px; align-items: start; }
.tree-l { display: flex; flex-direction: column; gap: 6px; }
.tree-l button { display: block; text-align: left; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.tree-l button b { display: block; font: 600 14px var(--mono); color: var(--ink); }
.tree-l button span { display: block; font-size: 13px; color: var(--sub); }
.tree-l button small { display: block; font-size: 12px; color: var(--faint); line-height: 1.5; }
.tree-l button:hover { border-color: var(--ink); }
.tree-l button.on { background: var(--ink); border-color: var(--ink); }
.tree-l button.on b, .tree-l button.on span, .tree-l button.on small { color: #fff; }
.tree-r { border: 1px solid var(--ink); border-radius: 12px; padding: 14px 16px; min-height: 420px; }
.tree-r .tr-h { display: flex; justify-content: space-between; align-items: baseline; padding-bottom: 8px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.tree-r .tr-h b { font: 600 15px var(--mono); }
.tree-r .tr-h a { font-size: 13px; color: var(--muted); }
.tree-r .tr-f { display: grid; grid-template-columns: minmax(0, 300px) 1fr; gap: 12px; padding: 6px 0; border-bottom: 1px dashed var(--line); font-size: 13.5px; line-height: 1.6; color: var(--sub); }
.tree-r .tr-f code { background: none; padding: 0; white-space: normal; overflow-wrap: break-word; font-size: 12.5px; }
/* 手机上也是左右两栏：左边一列只放目录名，右边的文件清单跟着停在屏幕里 */
@media (max-width: 760px) {
  .tree { grid-template-columns: 116px minmax(0, 1fr); gap: 10px; }
  .tree-l { gap: 5px; }
  .tree-l button { padding: 8px 10px; border-radius: 8px; }
  .tree-l button b { font-size: 12.5px; overflow-wrap: anywhere; }
  .tree-l button span { font-size: 11.5px; line-height: 1.45; }
  .tree-l button span i { display: none; }
  .tree-l button small { display: none; }
  .tree-r { position: sticky; top: 66px; padding: 10px 12px; min-height: 0; }
  .tree-r .tr-h { flex-wrap: wrap; gap: 0 8px; }
  .tree-r .tr-f { grid-template-columns: 1fr; gap: 2px; font-size: 13px; }
}
.map3 td:first-child { white-space: normal; text-wrap: balance; }
.map3 td a { font-weight: 600; }

/* ── 几篇共用的小画面（03 篇以后） ── */
.tbl td.bad { color: var(--bad); font-weight: 600; }
.mono { font-family: var(--mono); }
.code[hidden] { display: none; }
/* 一排横着的四个实测数 */
.meas.row4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 18px; margin-top: 14px; }
.meas.row4 .m { grid-template-columns: 22px 1fr; grid-template-rows: auto auto; row-gap: 6px; align-items: start; }
.meas.row4 .m i { grid-row: 1 / 3; }
.meas.row4 .m .v { grid-column: 2; white-space: normal; flex-wrap: wrap; }
.meas.row4 .m .v small { font: 12px var(--mono); color: var(--bad); }
@media (max-width: 760px) { .meas.row4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* 一步一步 */
.stepline { display: grid; grid-template-columns: repeat(var(--n, 3), minmax(0, 1fr)); gap: 12px; }
.stepline.n3 { --n: 3; }
.stepline.n4 { --n: 4; }
.stepline .st { position: relative; padding: 16px 18px; border: 1px solid var(--line2); border-radius: 12px; background: #fff; display: flex; flex-direction: column; gap: 6px; font-size: 14.5px; line-height: 1.65; color: var(--sub); }
.stepline .st b { color: var(--ink); font-size: 15px; }
.stepline .st.dark { background: var(--ink); border-color: var(--ink); color: rgba(255, 255, 255, 0.8); }
.stepline .st.dark b { color: #fff; }
.stepline .st + .st::before { content: ''; position: absolute; left: -12px; top: 50%; width: 12px; height: 1px; background: var(--line2); }
@media (max-width: 760px) { .stepline { grid-template-columns: 1fr; } .stepline .st + .st::before { display: none; } }

/* 适配记录这类长表 */
.tbl.rec td { font-size: 14px; vertical-align: top; }
.tbl.rec td:first-child { white-space: nowrap; }
.tbl.rec td.src-l { font: 11.5px var(--mono); color: var(--faint); white-space: nowrap; }
/* 焦点记录 */
.log { margin: 10px 0 0; padding: 0 0 0 20px; font-size: 13px; line-height: 1.7; color: var(--sub); }
.log li::marker { font-family: var(--mono); color: var(--faint); }
/* 文末的出处 */
.sources { margin-top: 64px; border-top: 1px solid var(--line); padding-top: 18px; font-size: 13px; color: var(--muted); }
.sources summary { cursor: pointer; font-weight: 600; color: var(--sub); }
.sources ol { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 6px; }
.sources li { display: grid; grid-template-columns: 52px 1fr; gap: 10px; line-height: 1.65; }
.sources li i { font: normal 12px var(--mono); color: var(--faint); }
.sources code { font-size: 12px; background: none; padding: 0; color: var(--muted); white-space: normal; word-break: break-all; }
.sources + .foot { margin-top: 24px; }
/* 标题下面的「四层」 */
.lstrip { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 14px 0 18px; }
.lstrip .lb { font-size: 13px; color: var(--muted); margin-right: 4px; }
.lstrip .ls { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px 4px 5px; border-radius: 999px; box-shadow: inset 0 0 0 1px var(--line2); font-size: 14px; color: var(--faint); }
.lstrip .ls i { width: 20px; height: 20px; border-radius: 50%; background: var(--soft); color: var(--faint); font: normal 600 11px/20px var(--mono); text-align: center; }
.lstrip .ls.on { background: var(--ink); color: #fff; box-shadow: none; font-weight: 600; }
.lstrip .ls.on i { background: #fff; color: var(--ink); }
/* Figma 面板样的小画面（第 02–04 篇讲原理用，不用施工队比喻） */
.figs3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: start; }
@media (max-width: 760px) { .figs3 { grid-template-columns: 1fr; } }
.sw-sample { display: grid; place-items: center; height: 84px; border-bottom: 1px solid var(--line); background: repeating-conic-gradient(#fafafa 0 25%, #f3f3f3 0 50%) 0 0 / 14px 14px; }
.sw-sample i { position: relative; display: block; border-radius: 999px; background: #0a0a0a; }
.sw-sample i::after { content: ''; position: absolute; top: 50%; right: 2px; width: calc(100% - 50% - 4px); aspect-ratio: 1; border-radius: 50%; background: #fff; transform: translateY(-50%); }
.vp .vh .n3 { display: inline-grid; place-items: center; width: 20px; height: 20px; margin-right: 6px; border-radius: 50%; background: var(--ink); color: #fff; font: 600 11px var(--mono); }
.vp .vh { align-items: center; }
.vp .vh > span:last-child { margin-left: auto; }
.vp .vn { margin: 0; padding: 10px 14px 12px; font-size: 13px; line-height: 1.6; color: var(--muted); }
.ramp6 { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.ramp6 i { height: 30px; border-radius: 5px; box-shadow: inset 0 0 0 1px rgba(0,0,0,0.06); }
.btn-sample3 { display: grid; place-items: center; height: 84px; border-bottom: 1px solid var(--line); background: repeating-conic-gradient(#fafafa 0 25%, #f3f3f3 0 50%) 0 0 / 14px 14px; }
.btn-sample3 span { display: grid; place-items: center; width: 84px; height: 32px; border-radius: 6px; background: #0a0a0a; color: #fff; font-size: 14px; }

/* ───────── 自动演示：步骤条 + 真页面 + 假鼠标 ───────── */
.rp-steps { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; margin: 0 0 12px; padding: 0; list-style: none; }
.rp-steps li { padding: 10px 10px 9px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font-size: 12px; line-height: 1.45; color: var(--muted); transition: border-color 0.25s, background 0.25s, color 0.25s; }
.rp-steps li i { display: flex; align-items: center; justify-content: center; width: 20px; height: 20px; margin-bottom: 6px; border: 1.5px solid var(--line2); border-radius: 50%; font: normal 600 11px/1 var(--mono); color: var(--muted); }
.rp-steps li b { display: block; font-size: 14px; color: var(--sub); font-weight: 600; }
.rp-steps li span { display: block; margin-top: 1px; }
.rp-steps li.done b { color: var(--ink); }
.rp-steps li.done i { border-color: var(--ink); color: var(--ink); }
.rp-steps li.on { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); color: var(--sub); }
.rp-steps li.on i { background: var(--ink); border-color: var(--ink); color: #fff; }
.rp-steps li.on b { color: var(--ink); }
.rp-steps li.end.on { background: var(--ink); color: #d4d4d4; }
.rp-steps li.end.on b { color: #fff; }
.rp-steps li.end.on i { background: #fff; color: var(--ink); border-color: #fff; }
.rp-ctl { display: inline-flex; gap: 6px; }
.rp-ctl .btn { height: 28px; padding: 0 12px; font-size: 13px; }
.rp-ctl .btn:disabled { opacity: 0.35; cursor: default; }
.rp.playing .live iframe { pointer-events: none; }
.rp-legend { display: flex; flex-wrap: wrap; gap: 8px 10px; min-height: 34px; margin-top: 12px; }
.rp-legend span { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 14px 0 4px; border-radius: 16px; background: var(--ink); color: #fff; font-size: 14px; font-weight: 600; opacity: 0; transform: translateY(4px); transition: opacity 0.3s, transform 0.3s; }
.rp-legend span.on { opacity: 1; transform: none; }
.rp-legend span i { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; background: #fff; color: var(--ink); font: normal 700 13px/1 var(--mono); }
@media (max-width: 760px) { .rp-steps { grid-template-columns: repeat(4, minmax(0, 1fr)); } .rp-steps li span { display: none; } .frame .fh:has(.rp-ctl) { flex-wrap: wrap; } }

/* ───────── 00 篇：三样东西、浏览器框、四层分带 ───────── */
.tri { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.tri-c h4 { margin: 14px 0 4px; font-size: 17px; color: var(--ink); display: flex; align-items: center; gap: 8px; }
.tri-c p { margin: 0; font-size: 15px; line-height: 1.7; color: var(--sub); }
.tri-p { position: relative; aspect-ratio: 16 / 10; border: 1px solid var(--line2); border-radius: 12px; overflow: hidden; background: #fff; }
.tri-v { background: #0a0a0a; color: #fff; padding: 18px 20px; display: flex; flex-direction: column; }
.tri-v .vk { display: flex; align-items: baseline; gap: 10px; font-size: 12px; color: #a3a3a3; letter-spacing: 0.08em; }
.tri-v .vk b { font: 700 22px/1 var(--mono); color: #fff; letter-spacing: 0; }
.tri-v .vt { margin-top: auto; font-size: clamp(15px, 1.7vw, 19px); font-weight: 700; line-height: 1.4; }
.tri-v .vg { display: flex; gap: 4px; margin-top: 12px; }
.tri-v .vg i { flex: 1; height: 4px; border-radius: 2px; background: #404040; }
.tri-v .vg i.on { background: #fff; }
.tri-v .vplay { position: absolute; right: 18px; top: 16px; width: 34px; height: 34px; border-radius: 50%; border: 2px solid #fff; }
.tri-v .vplay::after { content: ''; position: absolute; left: 12px; top: 9px; border-left: 11px solid #fff; border-top: 7px solid transparent; border-bottom: 7px solid transparent; }
.tri-s img { width: 100%; height: 100%; object-fit: cover; object-position: left top; }
.tri-r { display: grid; grid-template-columns: 1fr 1fr; align-content: start; gap: 2px 12px; padding: 14px 16px; background: var(--soft2); font: 12.5px/1.75 var(--mono); color: var(--sub); }
.tri-r b { grid-column: 1 / -1; color: var(--ink); font-weight: 600; margin-bottom: 2px; }
.tri-r span::before { content: '▸ '; color: var(--faint); }
.tri-r span.f::before { content: '· '; }
@media (max-width: 760px) { .tri { grid-template-columns: 1fr; } }
.browser { border: 1px solid var(--line2); border-radius: 12px; overflow: hidden; background: #fff; }
.browser .bb { display: flex; align-items: center; gap: 7px; height: 38px; padding: 0 14px; border-bottom: 1px solid var(--line); background: var(--soft2); }
.browser .bb i { width: 11px; height: 11px; border-radius: 50%; background: var(--line2); }
.browser .bb span { margin-left: 12px; padding: 3px 14px; border-radius: 999px; background: #fff; border: 1px solid var(--line); font: 12px var(--mono); color: var(--muted); }
.bands { display: grid; gap: 12px; }
.band { position: relative; display: grid; grid-template-columns: 120px minmax(0, 1fr) minmax(0, 1.2fr) 56px; align-items: center; gap: 16px; padding: 16px 18px; border: 1px solid var(--line2); border-radius: 12px; background: #fff; text-decoration: none; color: var(--sub); font-size: 15px; line-height: 1.6; transition: border-color 0.15s; }
.band:hover { border-color: var(--ink); }
/* 没有对应文章的那一层（逻辑层）：不是链接，不变色 */
div.band:hover { border-color: var(--line2); }
.band .bl { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 700; color: var(--ink); }
.band .bl i { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid var(--ink); font: normal 600 13px/1 var(--mono); }
.band .bf { display: flex; flex-wrap: wrap; gap: 6px; }
.band .bf code { font-size: 12px; }
.band em { font: normal 12px var(--mono); color: var(--muted); text-align: right; }
.band.hot { background: var(--ink); border-color: var(--ink); color: #d4d4d4; }
.band.hot .bl { color: #fff; }
.band.hot .bl i { border-color: #fff; background: #fff; color: var(--ink); }
.band.hot .bf code { background: #262626; color: #fff; }
.band.hot em { color: #a3a3a3; }
.band .tag { position: absolute; right: 14px; top: -10px; padding: 2px 10px; border-radius: 999px; background: var(--hl); color: var(--ink); font-size: 12px; line-height: 16px; font-weight: 600; }
@media (max-width: 760px) { .band { grid-template-columns: 1fr; gap: 6px; } .band em { text-align: left; } }
.tri-c h4 .n { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; background: var(--ink); color: #fff; font: 600 12px/1 var(--mono); }
.tri-r { grid-auto-flow: column; grid-template-rows: auto repeat(5, auto); }

/* ───────── 视频分集：系列卡样子 ───────── */
.series6 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.s6 { display: flex; flex-direction: column; min-height: 210px; padding: 18px 20px 20px; border-radius: 14px; background: #0a0a0a; color: #a3a3a3; text-decoration: none; transition: transform 0.15s; }
.s6:hover { transform: translateY(-2px); }
.s6 .sk { font-size: 12px; letter-spacing: 0.08em; }
.s6 b { margin-top: 4px; font: 700 34px/1 var(--mono); color: #fff; }
.s6 .g { display: flex; gap: 3px; margin: 14px 0 16px; }
.s6 .g s { flex: 1; height: 4px; border-radius: 2px; background: #333; text-decoration: none; }
.s6 .g s.f { background: #fff; }
.s6 h4 { margin: 0 0 6px; font-size: 16px; line-height: 1.45; color: #fff; }
.s6 p { margin: 0; font-size: 13.5px; line-height: 1.65; }
.s6.on { box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--ink); }
@media (max-width: 900px) { .series6 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .series6 { grid-template-columns: 1fr; } }

/* 横条（02、05 篇共用） */
.hbars { border-top: 1px solid var(--ink); }
.hbars .r { display: grid; grid-template-columns: 130px 1fr 52px; gap: 14px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14.5px; }
.hbars .r i { display: block; height: 14px; border-radius: 3px; background: var(--ink); }
.hbars .r span { font: 600 14px var(--mono); text-align: right; color: var(--ink); }
.hbars .r i[style*="width:0"] { width: 3px !important; background: var(--line2); }

/* ───────── 值不值得：一个分叉 ───────── */
.fork { display: grid; justify-items: center; }
.fork .fq { position: relative; padding: 10px 20px; border: 1.5px solid var(--ink); border-radius: 999px; font-size: 15px; font-weight: 600; color: var(--ink); background: #fff; }
.fork .fb { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; width: 100%; margin-top: 34px; }
.fork .fb::before { content: ''; position: absolute; left: 25%; right: 25%; top: -18px; height: 18px; border: 1.5px solid var(--ink); border-bottom: 0; border-radius: 10px 10px 0 0; }
.fork .fb::after { content: ''; position: absolute; left: 50%; top: -34px; height: 16px; border-left: 1.5px solid var(--ink); }
.fork .fo { padding: 16px 18px; border: 1px solid var(--line2); border-radius: 12px; background: #fff; }
.fork .fo b { display: block; font-size: 16px; line-height: 1.5; color: var(--ink); }
.fork .fo p { margin: 6px 0 12px; font-size: 14px; color: var(--sub); line-height: 1.7; }
.fork .fo .ok { display: inline-block; padding: 3px 10px; border-radius: 999px; background: var(--soft); font-size: 12.5px; font-weight: 600; color: var(--ink); }
.fork .fo.dark { background: var(--ink); border-color: var(--ink); }
.fork .fo.dark b { color: #fff; }
.fork .fo.dark p { color: #d4d4d4; }
.fork .fo.dark .ok { background: var(--hl); }
@media (max-width: 640px) { .fork .fb { grid-template-columns: 1fr; } .fork .fb::before { display: none; } .fork .fb::after { height: 34px; } }

/* 首页文章列表：右边一张从文章里截的图 */
.post.has-th { grid-template-columns: 70px 1fr 240px; align-items: center; padding: 18px 0; }
.post .th { display: block; aspect-ratio: 16 / 9; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; transition: border-color 0.15s; }
.post .th img { width: 100%; height: 100%; object-fit: cover; object-position: center; }
.post .th img.flat { object-fit: contain; }
.post .th svg, .ask-th svg { display: block; width: 100%; height: 100%; }
svg.thumb text { font-family: var(--sans); }
svg.thumb text.m { font-family: var(--mono); }
.post:hover .th { border-color: var(--ink); }
@media (max-width: 760px) { .post.has-th { grid-template-columns: 44px 1fr; } .post.has-th .th { grid-column: 2; } }

.nb { font-style: normal; white-space: nowrap; }

/* ───────── 折行：标题两行差不多长，段落最后一行不单剩一个字 ───────── */
/* 标题只在标点、空格处换行（太长才在字中间断），两行差不多长 */
.head h1, .home-head h1, .sec h2, .part h2, .sec h3, .card h4, .post h3, .code .tab .s, .next a b, .flow-detail h4 { text-wrap: balance; }
p, li, figcaption, .cap, .tbl td, .card p, .code .say { text-wrap: pretty; }

/* 一排卡片里有代码块的：各张按自己的内容高，不跟着最高的那张拉长 */
.cards:has(> .card > .code) { align-items: start; }

/* ───────── 手机上横着滑：真组件、整页演示、插画、多列的表 ───────── */
.swipe-hint { display: flex; align-items: center; gap: 8px; margin: 8px 0 0; font-size: 12.5px; line-height: 1.5; color: var(--muted); }
.swipe-hint::before { content: '← →'; font: 600 11px var(--mono); letter-spacing: -0.04em; color: var(--ink); }
.swipe-hint[hidden] { display: none; }
.tbl-wrap + .swipe-hint, .swipe-hint + .tbl-wrap { margin-top: 0; }
p.swipe-hint:has(+ .tbl-wrap) { margin: 0 0 8px; }
.live.wide, .tbl-wrap.swipe, .ill.swipe { overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; }
.live.wide { overflow-x: auto; overflow-y: hidden; scroll-snap-type: x proximity; }
.live.wide.more, .tbl-wrap.swipe.more, .ill.swipe.more, .libs.more, .heights.more { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 36px), rgba(0, 0, 0, 0.15)); mask-image: linear-gradient(to right, #000 calc(100% - 36px), rgba(0, 0, 0, 0.15)); }
/* 几个库并排横着滑：每一格上面写库名 */
.live-kits { position: absolute; left: 0; top: 0; height: 26px; pointer-events: none; }
.live-kits span { position: absolute; top: 6px; padding-left: 2px; font: 600 12px/16px var(--mono); color: var(--ink); white-space: nowrap; scroll-snap-align: start; scroll-margin-left: 12px; }
@media (max-width: 640px) {
  /* 插画：按能看清字的宽度画，横着滑 */
  .ill { overflow-x: auto; border-radius: 14px; }
  .ill:not(.av) .ill-svg { min-width: 900px; }
  .ill + .swipe-hint { justify-content: center; }
  .ill + .swipe-hint + figcaption { text-align: center; }
}

/* ───────── 手机上的表 ───────── */
@media (max-width: 640px) {
  /* 第一列可以折行，说明那一列不被挤成一两个字 */
  .tbl td:first-child { white-space: normal; min-width: 5em; }
  .tbl td code { white-space: normal; overflow-wrap: break-word; }
  .tbl td code.nb { white-space: nowrap; }
  .tbl th { padding: 9px 10px; }
  .tbl td { padding: 10px; }
  /* 三列以上：按列数给够宽度，横着滑（上面有一行提示） */
  .tbl:has(tr > :nth-child(3)) { min-width: 560px; }
  .tbl:has(tr > :nth-child(5)) { min-width: 720px; }
  .tbl:has(tr > :nth-child(6)) { min-width: 840px; }
  .tbl:has(tr > :nth-child(7)) { min-width: 900px; }

  /* 一条一条的长表（适配记录、取舍记录、文件表、对照表）：每一行排成一块，不横着滑 */
  table.tbl.rec, table.tbl.ft, table.tbl.map3 { display: block; min-width: 0; }
  .tbl.rec tbody, .tbl.ft tbody, .tbl.map3 tbody { display: block; }
  .tbl.rec tr, .tbl.ft tr, .tbl.map3 tr { display: block; padding: 12px 0 13px; border-bottom: 1px solid var(--line); }
  .tbl.rec tr:has(> th), .tbl.ft tr:has(> th), .tbl.map3 tr:has(> th) { display: none; }
  .tbl.rec td, .tbl.ft td, .tbl.map3 td { display: block; padding: 1px 0; border: 0; min-width: 0; width: auto; white-space: normal; font-size: 14px; line-height: 1.7; background: none; }
  .tbl.rec tr.hi, .tbl.ft tr.hi, .tbl.map3 tr.hi { background: var(--soft); }
  /* 带列名的格子：列名在左边一小栏 */
  .tbl.rec td[data-th], .tbl.map3 td[data-c]:not([data-c="1"]) { position: relative; padding-left: 78px; }
  .tbl.rec td[data-th]::before, .tbl.map3 td[data-c]:not([data-c="1"])::before { content: attr(data-th); position: absolute; left: 0; top: 4px; width: 72px; font: 12px/1.6 var(--mono); color: var(--muted); }
  /* 适配记录、取舍记录：前两格连成一行当标题 */
  .tbl.rec td[data-c="1"], .tbl.rec td[data-c="2"] { display: inline; padding: 0; font-size: 15px; font-weight: 600; color: var(--ink); }
  .tbl.rec td[data-c="1"]::before, .tbl.rec td[data-c="2"]::before { content: none; }
  .tbl.rec td[data-c="2"]::after { content: ''; display: block; height: 4px; }
  .tbl.rec td[data-c="1"] + td[data-c="2"]::before { content: '·'; position: static; display: inline; margin: 0 8px; font: inherit; color: var(--faint); }
  /* 3.5 那种按套件分组的：套件名单独一行 */
  .tbl.rec td.kit { display: block; padding: 6px 0 2px; font-size: 16px; }
  table.tbl.rec td.kit b { display: inline; }
  .tbl.rec td.kit small { margin-left: 8px; font-weight: 400; }
  .tbl.rec td.kit + td[data-c="2"]::before { content: none; }
  .tbl.rec tr:has(> td.kit) { border-top: 1px solid var(--ink); }
  /* 每条的「哪一项」都当这一条的小标题，套件第一条和后面几条一个样子 */
  .tbl.rec td.asp { display: block; padding: 0; font-size: 15px; font-weight: 600; color: var(--ink); }
  .tbl.rec td.asp::before { content: none; }
  .tbl.rec td.src-l { white-space: normal; overflow-wrap: anywhere; }
  /* 文件表：文件名当标题，下面一句说明，再下面行数和哪一篇 */
  .tbl.ft td.f { font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
  .tbl.ft td[data-c="2"] { color: var(--sub); }
  .tbl.ft td[data-c="3"], .tbl.ft td[data-c="4"] { display: inline; font: 12px/1.7 var(--mono); color: var(--muted); text-align: left; }
  .tbl.ft td[data-c="3"]:not(:empty)::after { content: ' 行'; }
  .tbl.ft td[data-c="3"]:not(:empty) + td[data-c="4"]:not(:empty)::before { content: ' · '; color: var(--faint); }
  /* 00 篇对照表：视频那一格当标题 */
  .tbl.map3 td[data-c="1"] { margin-bottom: 4px; font-size: 15px; }
}

/* ───────── 几篇里的小画面，手机上 ───────── */
@media (max-width: 640px) {
  /* 02 篇的链条（2.11、2.36）：竖着排，箭头朝下 */
  .fig .chain, .fig .semantic { flex-direction: column; align-items: flex-start; flex-wrap: nowrap; }
  .fig .chain .to, .fig .semantic .to { display: block; margin-left: 22px; line-height: 1; transform: rotate(90deg); }
  /* 02 篇 2.15 四个变量面板：表头只留库名 */
  .four-fill .vp .vh { white-space: nowrap; }
  .four-fill .vp .vh > span:last-child { display: none; }
  /* 05 篇 5.20 的放大示意：一排放下两个复选框 */
  div.m20 { padding: 18px 10px 14px; }
  div.m20 .row { flex-wrap: nowrap; font-size: 12.5px; }
  div.m20 .row .cb { flex: none; width: 14px; height: 14px; }
  div.m20 .row .pd { flex: none; width: 18px; margin: 0 1px; font-size: 10px; }
  div.m20 .row .lb { white-space: nowrap; }
  /* 标题下面的「四层」：四个胶囊排在一行 */
  .lstrip { gap: 4px; }
  .lstrip .lb { font-size: 12px; margin-right: 2px; }
  .lstrip .ls { gap: 4px; padding: 3px 9px 3px 4px; font-size: 13px; }
  .lstrip .ls i { width: 18px; height: 18px; font-size: 10px; line-height: 18px; }
}
@media (max-width: 760px) {
  /* 04 篇 4.2 两列的户型图：标题一样占两行，下面的图顶边对齐 */
  .plans .plan > b { min-height: 2.9em; line-height: 1.45; }
}

.cmd .tk { white-space: nowrap; }

/* 两列的表在手机上用固定列宽：第一列三分之一，第二列放不下就在格子里换行，整张表不用横滑 */
@media (max-width: 640px) {
  .tbl:not(:has(tr > :nth-child(3))):not(.rec):not(.ft):not(.map3) { table-layout: fixed; width: 100%; min-width: 0; }
  .tbl:not(:has(tr > :nth-child(3))):not(.rec):not(.ft):not(.map3) tr > :first-child { width: 34%; }
  .tbl:not(:has(tr > :nth-child(3))):not(.rec):not(.ft):not(.map3) td { overflow-wrap: anywhere; }
}

/* 画出来的对照格：一行一项、一列一个库，最后一列规格（左边一道线）；不一样的字标红 */
.dg { border-top: 1px solid var(--ink); }
/* 一次看一行（MH.dgrid 的 pick）：格子上面一排「看哪一项」 */
.dg-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 0 14px; }
.dg-pick .lb { font-size: 13px; color: var(--muted); }
.dg .dr { display: grid; grid-template-columns: 110px repeat(var(--dgn, 6), minmax(0, 1fr)); gap: 0 10px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.dg .dh { padding: 10px 0; font: 12px var(--mono); color: var(--muted); }
.dg .dh .sp { color: var(--ink); font-weight: 600; }
.dg .dn b { display: block; font-size: 14.5px; color: var(--ink); }
.dg .dn span { display: block; margin-top: 2px; font-size: 12px; color: var(--muted); }
.dg .dc { min-width: 0; }
.dg .sp { padding-left: 12px; box-shadow: inset 1.5px 0 0 var(--ink); align-self: stretch; display: flex; flex-direction: column; justify-content: center; }
.dg .dh .sp { display: block; }
.dg .dd { display: flex; align-items: center; gap: 6px; min-height: 36px; margin-bottom: 4px; }
.dg .dl { font-size: 13px; line-height: 1.55; color: var(--sub); }
.dg .dl .x { color: var(--bad); font-weight: 600; }
@media (max-width: 760px) { .dg { overflow-x: auto; } .dg .dr { min-width: calc(110px + var(--dgn, 6) * 120px); } }
/* 对照格里的小画法（01、02 篇）：色块、菜单项、输入框、阴影、勾选的行 */
.dg .ch { display: inline-block; height: 22px; border-radius: 4px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06); }
.dg .mi1 { display: inline-flex; align-items: center; width: 110px; padding: 0 8px; border-radius: 4px; background: var(--soft); font: 12px var(--sans); font-style: normal; color: var(--sub); }
.dg .in1 { display: inline-flex; align-items: center; width: 120px; height: 26px; padding: 0 8px; border-radius: 4px; font: 12px var(--sans); font-style: normal; color: var(--faint); }
.dg .sh1 { display: inline-block; width: 72px; height: 24px; border-radius: 6px; background: #fff; border: 1px solid var(--line2); }
.dg .selrow { position: relative; display: block; width: 100%; height: 22px; border-radius: 3px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06); }
.dg .selrow b { position: absolute; left: 6px; top: 6px; width: 10px; height: 10px; border-radius: 2px; background: var(--ink); }
.dg .selrow.none { background: #fff; box-shadow: inset 0 0 0 1px var(--line2); }

/* 卡片排法：四层（01 篇）、三家（04-2 篇）、检查规则（05 篇） */
.four4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 860px) { .four4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.four4 .c4 { display: flex; flex-direction: column; gap: 6px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; }
.four4 .c4 > b { font-size: 20px; color: var(--ink); }
.four4 .c4 > em { font-style: normal; font-size: 13px; color: var(--muted); }
.four4 .c4 p { margin: 4px 0; font-size: 14px; line-height: 1.7; color: var(--sub); }
.four4 .c4 span { display: flex; flex-wrap: wrap; gap: 4px; }
.four4 .c4 code { font-size: 11.5px; white-space: normal; }
.four4 .c4 a { margin-top: auto; padding-top: 6px; font-size: 13px; }
.duo3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 760px) { .duo3 { grid-template-columns: minmax(0, 1fr); } }
.duo3 .d3 { display: flex; flex-direction: column; gap: 8px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; }
.duo3 .d3 > b { font-size: 16px; color: var(--ink); }
.duo3 .d3 p { margin: 0; font-size: 14px; line-height: 1.7; color: var(--sub); }
.duo3 .d3 p em { display: block; font-style: normal; font-size: 12px; color: var(--muted); }
.duo3 .d3 p + p { padding-top: 8px; border-top: 1px dashed var(--line2); color: var(--ink); }
.rules5 { display: flex; flex-direction: column; gap: 8px; }
.rules5 .r5 { display: grid; grid-template-columns: 28px minmax(0, 1fr) minmax(0, 1fr); gap: 4px 16px; align-items: start; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; }
.rules5 .r5 i { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--ink); color: #fff; font: 600 12px var(--mono); font-style: normal; }
.rules5 .r5 p { margin: 0; font-size: 14px; line-height: 1.7; }
.rules5 .r5 .why { color: var(--sub); }
.rules5 .r5 .why::before { content: '碰到了'; display: block; font-size: 12px; color: var(--muted); }
.rules5 .r5 .add { color: var(--ink); }
.rules5 .r5 .add::before { content: '就加一条规则'; display: block; font-size: 12px; color: var(--muted); }
@media (max-width: 640px) { .rules5 .r5 { grid-template-columns: 28px minmax(0, 1fr); } .rules5 .r5 .add { grid-column: 2; } }


/* ───────── 仓库、演示页入口（顶栏头像左边、真组件框的右上角） ───────── */
.bar .bar-l { flex: none; display: inline-flex; align-items: center; height: 32px; padding: 0 13px; border: 1px solid var(--line2); border-radius: 999px; background: #fff; font-size: 13px; color: var(--sub); text-decoration: none; white-space: nowrap; }
.bar .bar-l::after { content: '↗'; margin-left: 4px; font-size: 12px; color: var(--faint); }
.bar .bar-l:hover { border-color: var(--ink); color: var(--ink); }
@media (max-width: 640px) { .bar .bar-l { display: none; } }
.frame .fh .live-open { margin-left: 12px; font: 12px var(--sans); color: var(--sub); white-space: nowrap; text-decoration: none; }
.frame .fh .live-open::after { content: ' ↗'; color: var(--faint); }
.frame .fh .live-open:hover { color: var(--ink); text-decoration: underline; }

/* ───────── 公开版：课程里的小节（site/_tools/public.mjs 生成；完整版里没有） ───────── */
.sec[hidden], .part[hidden] { display: none; }
/* 锁：目录里课程才有的小节、只公开一部分的篇 */
.toc a.lk span::after, .toc .others a.pt span::after, .intoc a.lk::after { content: ''; display: inline-block; width: 11px; height: 11px; margin-left: 6px; vertical-align: -1px; background: var(--faint); -webkit-mask: var(--lock) center / contain no-repeat; mask: var(--lock) center / contain no-repeat; }
:root { --lock: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4.5 7V5a3.5 3.5 0 0 1 7 0v2h.5A1 1 0 0 1 13 8v6a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V8a1 1 0 0 1 1-1zm1.5 0h4V5a2 2 0 0 0-4 0z'/%3E%3C/svg%3E"); }
.toc a.lk, .intoc a.lk { color: var(--faint); }
/* 付费墙：公开部分末尾露出下一节的开头，白色渐变盖住；上面压着带锁的视频封面、介绍、三个购买入口 */
.teaser { max-height: 380px; overflow: hidden; }
.paywall { position: relative; z-index: 1; margin-top: -230px; padding: 200px 0 48px; text-align: center; background: linear-gradient(to bottom, rgba(255, 255, 255, 0) 0, rgba(255, 255, 255, 0.82) 120px, #fff 190px); }
.paywall.flat { margin-top: 32px; padding-top: 24px; background: none; }
.paywall h2 { margin: 28px 0 10px; font-size: clamp(24px, 3vw, 30px); line-height: 1.3; letter-spacing: -0.01em; color: var(--ink); }
.paywall p { max-width: 36em; margin: 0 auto 6px; font-size: 16px; line-height: 1.7; color: var(--sub); }
.paywall .pw-more { font-size: 14px; color: var(--muted); }
.pw-cv { position: relative; display: block; width: min(420px, 100%); aspect-ratio: 16 / 9; margin: 0 auto; border-radius: 14px; overflow: hidden; background: #171717; text-decoration: none; box-shadow: 0 12px 32px rgba(0, 0, 0, 0.14); }
.pw-cv img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: brightness(0.62); }
.pw-ep { position: absolute; left: 16px; bottom: 12px; font: 12px var(--mono); color: rgba(255, 255, 255, 0.72); }
.pw-lock { position: absolute; left: 50%; top: 50%; width: 64px; height: 64px; margin: -32px 0 0 -32px; border-radius: 50%; background: #fff; }
.pw-lock::after { content: ''; position: absolute; inset: 19px; background: var(--ink); -webkit-mask: var(--lock) center / contain no-repeat; mask: var(--lock) center / contain no-repeat; }
.pw-cv:hover .pw-lock { transform: scale(1.05); }
.pw-lock.solo { position: relative; display: block; left: auto; top: auto; margin: 0 auto; background: var(--ink); }
.pw-lock.solo::after { background: #fff; }
.paywall .buy { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 22px; }
.paywall .buy .btn { height: 40px; padding: 0 20px; font-size: 14px; text-decoration: none; }
.paywall .wxq { flex-basis: 100%; display: flex; flex-direction: column; align-items: center; gap: 8px; margin-top: 10px; font-size: 14px; color: var(--sub); }
.paywall .wxq[hidden] { display: none; }
.paywall .wxq img { width: 200px; height: auto; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.post.pt h3::after, .apx a.pt b::after { content: ''; display: inline-block; width: 13px; height: 13px; margin-left: 8px; vertical-align: -1px; background: var(--faint); -webkit-mask: var(--lock) center / contain no-repeat; mask: var(--lock) center / contain no-repeat; }
/* 导读「视频、文字版、仓库」：视频那一格是真封面，点了去小红书看 */
.tri-vi { display: block; background: #171717; }
.tri-vi img { width: 100%; height: 100%; object-fit: cover; object-position: center 45%; }
.tri-vi .vplay { position: absolute; right: 12px; bottom: 12px; width: 36px; height: 36px; border-radius: 50%; background: rgba(0, 0, 0, 0.6); border: 2px solid #fff; transition: transform 0.15s; }
.tri-vi .vplay::after { content: ''; position: absolute; left: 13px; top: 9px; border-left: 11px solid #fff; border-top: 7px solid transparent; border-bottom: 7px solid transparent; }
.tri-vi:hover .vplay { transform: scale(1.06); }
.tri-c h4 .tri-go { margin-left: auto; font-size: 13px; font-weight: 400; color: var(--sub); text-decoration: none; }
.tri-c h4 .tri-go::after { content: ' ↗'; color: var(--faint); }
.tri-c h4 .tri-go:hover { color: var(--ink); text-decoration: underline; }
