/* Cr's Blog的博客 · 统一样式（S1 纸上实验）
   规则只有一条：红色 = 能动（能拖、能点、能换）。别的颜色只用来表达内容。 */

:root {
  --bg: #f6f3ea; --ink: #26231e; --ink2: #5b564c; --mute: #8b857a; --line: #e0d9c9; --panel: #fffdf7; --hand: #c92a2a;
  /* 图里的颜色（已过色盲和对比度校验）：ok = 结果/有效，ref = 参照（单位圆、基准），hand = 能动 */
  --fig-bg: #fffdf7; --fig-ink: #26231e; --fig-mute: #9a9385; --fig-grid: #f0eadd;
  --fig-ok: #0f8a6a; --fig-ref: #4c6ef5; --fig-hand: #c92a2a;
  --fig-font: 12px -apple-system, 'PingFang SC', sans-serif;
  --kai: 'LXGW WenKai Screen', 'Kaiti SC', serif;
  --sans: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB', sans-serif;
  --mono: 'SF Mono', 'JetBrains Mono', Menlo, 'PingFang SC', monospace;
  --measure: 36rem; --wide: 58rem; --page: 66rem;
}
* { box-sizing: border-box; }
html { background: var(--bg); color: var(--ink); }
body { margin: 0; font: 17px/1.85 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: underline 1px color-mix(in srgb, var(--hand) 55%, transparent); text-underline-offset: .22em; }
a:hover { color: var(--hand); }
::selection { background: color-mix(in srgb, var(--hand) 18%, transparent); }

/* ---------- 站点头尾 ---------- */
header.site, footer.site { max-width: var(--page); margin: 0 auto; padding: 1.4rem 1.5rem; display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; }
header.site .name { font-family: var(--kai); font-size: 1.35rem; letter-spacing: .08em; text-decoration: none; color: var(--ink); }
header.site nav { display: flex; gap: 1.2rem; }
header.site nav a { color: var(--mute); font-size: .92rem; text-decoration: none; }
header.site nav a[aria-current] { color: var(--ink); box-shadow: inset 0 -2px var(--hand); }
footer.site { color: var(--mute); font-size: .88rem; border-top: 1px dashed var(--line); margin-top: 2rem; }
footer.site a { color: var(--hand); text-decoration: none; }

/* ---------- 文章 ---------- */
.post { max-width: var(--measure); margin: 0 auto; padding: 2.5rem 1.5rem 3rem; position: relative; }
.kicker { display: flex; gap: .9em; flex-wrap: wrap; color: var(--mute); font-size: .85rem; }
.post h1 { font-family: var(--kai); font-weight: 400; font-size: 2.5rem; letter-spacing: .04em; line-height: 1.3; margin: .3rem 0 .4rem; }
.dek { font-family: var(--kai); font-size: 1.18rem; color: var(--ink2); margin: .4rem 0; }
.can { font-size: .86rem; color: var(--mute); margin: .6rem 0; }
.can b { font-weight: inherit; color: var(--hand); }
.hand-dot { display: inline-block; width: .55em; height: .55em; border-radius: 50%; background: var(--hand); margin-right: .55em; vertical-align: .05em; }
.post p { margin: .7em 0; }
.post h2 { font-family: var(--kai); font-weight: 400; font-size: 1.5rem; margin: 2.8rem 0 .5rem; line-height: 1.4; }
.post h2 .n { font: 600 .8rem/1 var(--sans); color: var(--mute); margin-right: .7em; vertical-align: .3em; }
.post h3 { font-size: 1.05rem; margin: 1.8rem 0 .3rem; }
.post ul, .post ol { padding-left: 1.4em; }
.post li { margin: .2em 0; }
.post hr { border: 0; border-top: 1px dashed var(--line); margin: 2rem 0; }
.post img { max-width: 100%; }
blockquote { margin: 1.4rem 0; padding: .1rem 0 .1rem 1.1rem; border-left: 3px solid var(--line); color: var(--ink2); }
blockquote.mine { border-left-color: var(--ink); color: var(--ink); }
blockquote.mine p { font-family: var(--kai); font-size: 1.16rem; line-height: 1.8; margin: .2rem 0; }
.who { font-size: .74rem; color: var(--mute); letter-spacing: .12em; }
code { font: .88em var(--mono); background: color-mix(in srgb, var(--ink) 6%, transparent); padding: .05em .3em; border-radius: 3px; }
pre { font: 13px/1.6 var(--mono); background: #efeadd; padding: .9rem 1rem; overflow: auto; border-radius: 6px; margin: 1rem 0; }
pre code { background: none; padding: 0; font-size: inherit; }
.src { margin-top: 3rem !important; font-size: .8rem; color: var(--mute); }
.katex-display { overflow-x: auto; overflow-y: hidden; padding: .15rem 0; }
.defs { font-size: .9em; text-align: center; margin-top: -.4em !important; color: var(--ink2); }
details summary { color: var(--hand); cursor: pointer; }

/* 表格：带 data-set 的行能点 */
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: .9rem; margin: .5rem 0; }
th { text-align: left; color: var(--mute); font-weight: 400; border-bottom: 1px solid var(--ink); padding: .35rem .7rem .35rem 0; white-space: nowrap; }
td { border-bottom: 1px solid var(--line); padding: .45rem .7rem .45rem 0; vertical-align: top; }
tr[data-set] { cursor: pointer; }
tr[data-set] td:first-child { padding-left: .5rem; box-shadow: inset 2px 0 transparent; }
tr[data-set]:hover td { background: color-mix(in srgb, var(--hand) 6%, transparent); }
tr[data-set]:hover td:first-child { box-shadow: inset 2px 0 var(--hand); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
s { text-decoration-color: var(--ink); color: var(--mute); }

/* 旁注：宽屏放页边，窄屏点“注”展开 */
.mn { display: none; font-family: var(--kai); font-size: .9rem; line-height: 1.65; color: #6d675c; }
.mn.open { display: block; margin: .4rem 0; }
.mn-mark { border: 0; background: none; padding: 0 .15em; vertical-align: super; font: .7em var(--sans); color: var(--hand); cursor: pointer; }
@media (min-width: 72rem) {
  .mn { display: block; float: right; clear: right; width: 13rem; margin-right: -15.5rem; margin-top: .2rem; }
  .mn-mark { display: none; }
}

/* ---------- 可交互的图 ---------- */
.wide { width: min(var(--wide), calc(100vw - 2rem)); margin-left: calc(50% - min(var(--wide), calc(100vw - 2rem)) / 2); }
figure.play { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 1rem 1.2rem 1.1rem; margin-top: 2.2rem; margin-bottom: 2.2rem; }
.fig-head { font-size: .8rem; color: var(--mute); margin-bottom: .7rem; }
.fig-no { color: var(--ink); font-weight: 600; margin-right: .7em; }
.fig-body { display: grid; grid-template-columns: minmax(0, 1fr) 16rem; gap: 1.4rem; align-items: start; }
.fig-body.stack { grid-template-columns: minmax(0, 1fr); }
.fig-main canvas, .fig-main svg { display: block; width: 100%; }
.fig-main canvas { touch-action: none; outline: none; }
figure.play figcaption { font-size: .8rem; color: var(--mute); margin-top: .8rem; line-height: 1.7; }
figure.flash .fig-main { animation: flash .7s ease-out; }
@keyframes flash { from { opacity: .55; } to { opacity: 1; } }
@media (max-width: 56rem) { .fig-body { grid-template-columns: minmax(0, 1fr); } }

/* 控件：全是红的 */
.ctl-label { font-size: .74rem; color: var(--mute); margin: .5rem 0 .4rem; letter-spacing: .1em; }
.ctl-label:first-child { margin-top: .1rem; }
.seg, .btns { display: flex; flex-wrap: wrap; gap: .3rem; }
.seg button, .btn, .stepper button, .toggle { font: .84rem/1.5 var(--sans); cursor: pointer; border: 1px solid color-mix(in srgb, var(--hand) 35%, transparent); background: transparent; color: var(--hand); border-radius: 999px; padding: .12rem .75rem; }
.seg button:hover, .btn:hover, .stepper button:hover, .toggle:hover { border-color: var(--hand); }
.seg button[aria-pressed="true"], .toggle[aria-pressed="true"] { background: var(--hand); border-color: var(--hand); color: #fff; }
.stepper { display: inline-flex; align-items: center; gap: .5rem; }
.stepper button { padding: 0; width: 1.7rem; height: 1.7rem; line-height: 1; }
.stepper output { min-width: 1.6em; text-align: center; font-variant-numeric: tabular-nums; font-weight: 600; }
.ctl { display: grid; grid-template-columns: 4.5rem 1fr 3.2rem; align-items: center; gap: .6rem; font-size: .88rem; margin: .25rem 0; }
.ctl output { text-align: right; font-variant-numeric: tabular-nums; }
input[type=range] { accent-color: var(--hand); width: 100%; }
input[type=text], input[type=number] { font: .9rem var(--mono); border: 1px solid color-mix(in srgb, var(--hand) 35%, transparent); background: #fff; color: var(--ink); border-radius: 6px; padding: .25rem .5rem; width: 100%; }
input[type=text]:focus, input[type=number]:focus { outline: 2px solid color-mix(in srgb, var(--hand) 30%, transparent); border-color: var(--hand); }

.readout { font-size: .9rem; margin: 1rem 0 0; padding-top: .8rem; border-top: 1px dashed var(--line); line-height: 1.75; }
.fig-side .readout:first-child { margin-top: 0; border-top: 0; padding-top: 0; }
.readout b { font-weight: 600; }
.readout b.ok { box-shadow: inset 0 -.42em color-mix(in srgb, var(--fig-ok) 26%, transparent); }
.readout b.bad { text-decoration: underline wavy color-mix(in srgb, var(--ink) 45%, transparent); text-underline-offset: .25em; }

.try { border: 0; background: none; color: var(--hand); padding: 0 0 0 .5em; font: .86em var(--sans); cursor: pointer; }
.try::before { content: '▸ '; }
.try:hover { text-decoration: underline; }

/* 能点的代码行 */
.codebox { font: 12.5px/1.65 var(--mono); background: #efeadd; border-radius: 6px; padding: .7rem 0; overflow-x: auto; margin: 0; }
.codebox .ln { display: block; padding: 0 1rem; white-space: pre; border-left: 2px solid transparent; }
.codebox .ln.click { cursor: pointer; }
.codebox .ln.click:hover { background: color-mix(in srgb, var(--hand) 7%, transparent); border-left-color: color-mix(in srgb, var(--hand) 50%, transparent); }
.codebox .ln.on { background: color-mix(in srgb, var(--fig-ok) 13%, transparent); border-left-color: var(--fig-ok); }

/* ---------- 随笔 ---------- */
.essay p { font-family: var(--kai); font-size: 18.5px; line-height: 1.95; }
.essay .aside { color: var(--mute); } .essay .aside::before { content: '（'; } .essay .aside::after { content: '）'; }
.essay ol, .essay ul { font-family: var(--kai); font-size: 18px; line-height: 1.9; }
.ph { margin: 1rem 0; }
.ph-img { background: repeating-linear-gradient(45deg, #ebe5d6 0 7px, #f0ebdf 7px 14px); display: grid; place-items: center; border-radius: 4px; }
.ph-img::after { content: '图 · 旧图床已失效'; color: var(--mute); font-size: .78rem; }
.ph figcaption { color: var(--mute); font: .75rem var(--mono); margin-top: .2rem; }
.photos { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }

/* ---------- 首页 ---------- */
.home { max-width: var(--page); margin: 0 auto; padding: 1.5rem 1.5rem 3rem; }
.home .intro { font-family: var(--kai); font-size: 1.2rem; color: var(--ink2); margin: .5rem 0 2.4rem; }
.home-grid { display: grid; grid-template-columns: minmax(0, 1fr) 21rem; gap: 3rem; align-items: start; }
.col-h { display: flex; justify-content: space-between; align-items: baseline; font-size: .8rem; color: var(--mute); letter-spacing: .15em; border-bottom: 1px solid var(--ink); padding-bottom: .35rem; margin-bottom: 1.2rem; }
.chips { display: flex; flex-wrap: wrap; gap: .3rem; margin: -.4rem 0 1.2rem; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(17rem, 100%), 1fr)); gap: 1.3rem; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: .7rem .7rem .9rem; display: flex; flex-direction: column; }
.card[hidden] { display: none; }
.card:hover { border-color: color-mix(in srgb, var(--ink) 25%, transparent); }
.card .mini { aspect-ratio: 16 / 10; border-radius: 6px; background: var(--fig-bg); overflow: hidden; position: relative; }
.card .mini canvas { display: block; width: 100%; height: 100%; touch-action: none; }
.card .mini .tag { position: absolute; left: .5rem; bottom: .35rem; font: 11px/1.4 var(--sans); color: var(--ink2); background: color-mix(in srgb, var(--fig-bg) 85%, transparent); padding: 0 .3rem; border-radius: 3px; pointer-events: none; }
.card .meta { font-size: .76rem; color: var(--mute); margin: .7rem .2rem 0; display: flex; gap: .8em; }
.card h3 { font-family: var(--kai); font-weight: 400; font-size: 1.28rem; margin: .1rem .2rem .2rem; line-height: 1.4; }
.card h3 a { text-decoration: none; }
.card h3 a:hover { color: var(--hand); }
.card .q { font-size: .86rem; color: var(--ink2); margin: 0 .2rem; line-height: 1.6; flex: 1; }
.card .act { font-size: .78rem; color: var(--hand); margin: .5rem .2rem 0; }
.card .act::before { content: '● '; font-size: .8em; }

.essays article { padding: 0 0 1.6rem; margin-bottom: 1.6rem; border-bottom: 1px dashed var(--line); }
.essays .d { font-size: .78rem; color: var(--mute); display: flex; gap: .8em; }
.essays .d time { color: var(--hand); font-variant-numeric: tabular-nums; }
.essays h3 { font-family: var(--kai); font-weight: 400; font-size: 1.25rem; margin: .1rem 0 .3rem; }
.essays h3 a { text-decoration: none; }
.essays .essay p { font-size: 16.5px; line-height: 1.9; margin: .4em 0; }
.essays .essay ol { font-size: 16px; padding-left: 1.2em; }
.essays .cut { color: var(--hand); font-size: .84rem; text-decoration: none; }
.essays .cut:hover { text-decoration: underline; }
.others { list-style: none; padding: 0; margin: 0; font-size: .9rem; }
.others li { display: flex; justify-content: space-between; gap: 1em; padding: .3rem 0; border-bottom: 1px dashed var(--line); }
.others li span { color: var(--mute); font-size: .8rem; white-space: nowrap; }
@media (max-width: 60rem) { .home-grid { grid-template-columns: minmax(0, 1fr); } }

/* 旧仓库里标了 ai: true 的文章 */
.ai { display: inline-block; font-size: .72rem; line-height: 1.5; padding: 0 .45em; border: 1px solid var(--line); border-radius: 4px; color: var(--mute); vertical-align: .1em; }

/* 首页：其余笔记（一行一篇） */
.docs h4 { font: 600 .8rem var(--sans); color: var(--mute); margin: 1.2rem 0 .3rem; }
.docs h4:first-child { margin-top: 0; }
.doc { display: grid; grid-template-columns: 3.2rem minmax(0, 1fr) auto; gap: .8rem; align-items: baseline; padding: .32rem 0; border-bottom: 1px dashed var(--line); text-decoration: none; }
.doc time { color: var(--mute); font-size: .8rem; font-variant-numeric: tabular-nums; }
.doc .t { font-family: var(--kai); font-size: 1.06rem; }
.doc:hover .t { color: var(--hand); }
.doc .k { font-size: .76rem; color: var(--mute); white-space: nowrap; }
@media (max-width: 34rem) { .doc { grid-template-columns: 2.8rem minmax(0, 1fr); } .doc .k { grid-column: 2; } }

/* 首页：小工具 */
.tools { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(13rem, 100%), 1fr)); gap: 1rem; }
.tool { display: block; text-decoration: none; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: .45rem .45rem .6rem; }
.tool:hover { border-color: var(--hand); }
.tool img { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: top; border-radius: 4px; background: var(--fig-bg); border: 1px solid var(--line); }
.tool span { display: block; font-size: .86rem; margin: .45rem .15rem 0; line-height: 1.45; }
.tool:hover span { color: var(--hand); }
.tool span::after { content: ' ↗'; color: var(--mute); }
.essay a, .essays a { word-break: break-all; }
.essays h4.older { font: 600 .8rem var(--sans); color: var(--mute); margin: 0 0 .3rem; letter-spacing: .15em; }
.essays .doc { grid-template-columns: 3.6rem minmax(0, 1fr) auto; }
#notes .tools { grid-template-columns: repeat(auto-fill, minmax(min(11.5rem, 100%), 1fr)); }
/* 列多的表：撑到图的宽度，每列至少 7em，再不够就横向滚 */
.table-wrap.wide th, .table-wrap.wide td { min-width: 7em; }
.table-wrap.wide th:first-child, .table-wrap.wide td:first-child { min-width: 5em; }
/* 行内公式太长时自己横向滚，不把整页撑宽 */
.post .math.inline { display: inline-block; max-width: 100%; overflow-x: auto; overflow-y: hidden; vertical-align: bottom; }
/* 正文里直接贴的长网址：需要时任意处折行 */
.post a { overflow-wrap: anywhere; }
.post code { overflow-wrap: anywhere; }
.post p, .post li, .post blockquote, .post td { overflow-wrap: anywhere; }

/* 正文列表里能点的项（比如整合包名） */
li[data-set] { cursor: pointer; border-radius: 4px; }
li[data-set]:hover { background: color-mix(in srgb, var(--hand) 6%, transparent); }
li[data-set] > strong:first-child { color: var(--hand); }

/* =================== 改版：正常博客的首页和栏目 =================== */
header.site nav { gap: 1.15rem; }
header.site nav a { transition: color .2s; }
header.site nav a:hover { color: var(--ink); }

.home { max-width: 60rem; }
.home .intro { margin: .4rem 0 1rem; }

/* 速查公告栏 */
.board { display: flex; align-items: center; gap: .7rem; border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: .2rem .45rem .2rem 1rem; margin: 0 0 2.8rem; font-size: .9rem; }
.board-label { color: var(--hand); font-size: .78rem; letter-spacing: .2em; white-space: nowrap; }
.board-label::before { content: ''; display: inline-block; width: .42em; height: .42em; border-radius: 50%; background: var(--hand); margin-right: .5em; vertical-align: .12em; }
.board-window { flex: 1; min-width: 0; height: 2.1rem; overflow: hidden; }
.board-list { list-style: none; margin: 0; padding: 0; transition: transform .6s cubic-bezier(.2, .7, .2, 1); }
.board-item { all: unset; box-sizing: border-box; display: flex; gap: .9em; align-items: center; height: 2.1rem; width: 100%; cursor: pointer; white-space: nowrap; overflow: hidden; }
.board-item b { font-weight: 500; flex: none; transition: color .2s; }
.board-item span { color: var(--mute); overflow: hidden; text-overflow: ellipsis; }
.board-item:hover b, .board-item:focus-visible b { color: var(--hand); }
.board-item:focus-visible { outline: 2px solid color-mix(in srgb, var(--hand) 35%, transparent); outline-offset: -2px; border-radius: 4px; }
.board-nav { display: flex; }
.board-nav button { all: unset; cursor: pointer; color: var(--mute); padding: 0 .35rem; font-size: 1.05rem; line-height: 1; transition: color .2s; }
.board-nav button:hover { color: var(--hand); }
.board-all { font-size: .78rem; color: var(--hand); text-decoration: none; white-space: nowrap; padding: 0 .55rem 0 .2rem; }
@media (max-width: 40rem) { .board-item span, .board-nav { display: none; } }

/* 速查弹窗：短的浮窗、长的右侧抽屉，手机上都是底部弹出 */
dialog.note-pop { border: 1px solid var(--line); background: var(--panel); color: var(--ink); padding: 0; border-radius: 12px; box-shadow: 0 22px 60px rgba(50, 38, 15, .2); overflow: auto; font: 16px/1.8 var(--sans); }
dialog.note-pop::backdrop { background: rgba(38, 35, 30, .14); }
dialog.note-pop.short { position: fixed; margin: 0; top: var(--top, 16vh); left: var(--left, calc(50% - 14rem)); width: min(28rem, calc(100vw - 24px)); max-height: min(72vh, 38rem); }
dialog.note-pop.long { position: fixed; margin: 0; inset: 0 0 0 auto; height: 100%; max-height: 100%; width: min(34rem, 100vw); border-radius: 14px 0 0 14px; border-right: 0; }
dialog.note-pop header { position: sticky; top: 0; z-index: 1; display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; padding: 1rem 1.3rem .6rem; background: var(--panel); border-bottom: 1px dashed var(--line); }
dialog.note-pop h2 { font-family: var(--kai); font-weight: 400; font-size: 1.35rem; margin: .1rem 0 0; line-height: 1.35; }
dialog.note-pop nav { display: flex; gap: .7rem; align-items: center; white-space: nowrap; font-size: .82rem; }
dialog.note-pop nav a { color: var(--hand); text-decoration: none; }
dialog.note-pop .close { all: unset; cursor: pointer; font-size: 1.35rem; line-height: 1; color: var(--mute); padding: 0 .2rem; }
dialog.note-pop .close:hover { color: var(--hand); }
.pop-body { padding: .6rem 1.3rem 1.4rem; }
.pop-body p { margin: .6em 0; } .pop-body ul, .pop-body ol { padding-left: 1.3em; }
.pop-body .loading { color: var(--mute); }
.pop-body figure.play { margin: 1rem 0; padding: .8rem; }
.pop-body .fig-body { grid-template-columns: minmax(0, 1fr); }
.pop-body .wide { width: auto; margin-left: 0; }
@media (max-width: 40rem) {
  dialog.note-pop.short, dialog.note-pop.long { inset: auto 0 0 0; top: auto; left: 0; width: 100%; max-height: 86vh; height: auto; border-radius: 14px 14px 0 0; border-right: 1px solid var(--line); }
}

/* 最近：一张大卡 + 两张小卡 */
.feature { display: grid; grid-template-columns: 1.45fr 1fr; gap: 1.2rem; }
.feature .card:first-child { grid-row: span 2; }
.feature .card:first-child .mini { aspect-ratio: 4 / 3; }
.feature .card:first-child h3 { font-size: 1.55rem; }
@media (max-width: 52rem) { .feature { grid-template-columns: minmax(0, 1fr); } .feature .card:first-child { grid-row: auto; } }
.card { transition: transform .3s cubic-bezier(.2, .7, .2, 1), border-color .3s, box-shadow .3s; }
.card:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(50, 38, 15, .07); }

/* 页签：原地切换 */
.more { margin-top: 3.2rem; }
.tabs { margin-bottom: 1.3rem; }
.tab-stage { overflow: hidden; }
.tab-foot { margin-top: 1.1rem; font-size: .88rem; }
.tab-foot a, .more-link { color: var(--hand); text-decoration: none; }
.tab-foot a:hover, .more-link:hover { text-decoration: underline; }
.doc .topic { color: var(--mute); font-size: .76rem; white-space: nowrap; }
.tool-card { display: grid; grid-template-columns: 15rem minmax(0, 1fr); gap: 1.2rem; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: .8rem; }
.tool-card .mini { aspect-ratio: 16 / 10; border-radius: 6px; background: var(--fig-bg); overflow: hidden; position: relative; }
.tool-card .mini canvas { display: block; width: 100%; height: 100%; touch-action: none; }
.tool-card h3 { font-family: var(--kai); font-weight: 400; font-size: 1.3rem; margin: 0 0 .2rem; }
.tool-card p { margin: 0 0 .5rem; font-size: .9rem; color: var(--ink2); }
@media (max-width: 40rem) { .tool-card { grid-template-columns: minmax(0, 1fr); } }

/* 小图：画布铺满容器（不靠 height:100% 反推高度） */
.mini { position: relative; }
.card .mini canvas, .tool-card .mini canvas { position: absolute; inset: 0; }

/* 栏目页 */
.section { max-width: 44rem; margin: 0 auto; padding: 2rem 1.5rem 3rem; }
.section h1 { font-family: var(--kai); font-weight: 400; font-size: 2.3rem; letter-spacing: .04em; margin: .2rem 0 .3rem; }
.section .dek { margin-bottom: 1.8rem; }
.section h2.group { font-size: .8rem; letter-spacing: .15em; color: var(--mute); font-weight: 400; margin: 2.2rem 0 .3rem; border-bottom: 1px solid var(--ink); padding-bottom: .3rem; display: flex; justify-content: space-between; }
.section .doc .d { display: block; grid-column: 2 / 4; color: var(--mute); font-size: .82rem; line-height: 1.5; margin-top: -.15rem; }
.note-row { all: unset; box-sizing: border-box; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .2rem 1rem; width: 100%; padding: .7rem 0; border-bottom: 1px dashed var(--line); cursor: pointer; }
.note-row b { font-family: var(--kai); font-weight: 400; font-size: 1.12rem; transition: color .2s; }
.note-row span { grid-column: 1; color: var(--mute); font-size: .86rem; }
.note-row i { grid-row: 1 / 3; grid-column: 2; align-self: center; font-style: normal; font-size: .76rem; color: var(--hand); }
.note-row:hover b { color: var(--hand); }
.archived { list-style: none; padding: 0; margin: 0; columns: 2; column-gap: 2rem; }
.archived li { padding: .3rem 0; break-inside: avoid; font-size: .92rem; }
.archived a { text-decoration: none; }
.archived a::after { content: ' ↗'; color: var(--mute); font-size: .8em; }
@media (max-width: 34rem) { .archived { columns: 1; } }

/* =================== 动画（都尊重 reduced-motion） =================== */
.post h1 { view-transition-name: post-title; }
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  ::view-transition-group(post-title) { animation-duration: .45s; animation-timing-function: cubic-bezier(.2, .7, .2, 1); }
  ::view-transition-old(root), ::view-transition-new(root) { animation-duration: .28s; }

  @keyframes rise { from { opacity: 0; transform: translateY(10px); } }
  .rise { animation: rise .6s cubic-bezier(.2, .7, .2, 1) both; animation-delay: calc(var(--i, 0) * 45ms); }
  .post > *, .section > * { animation: rise .55s cubic-bezier(.2, .7, .2, 1) both; }
  .post > :nth-child(2), .section > :nth-child(2) { animation-delay: 40ms; }
  .post > :nth-child(3), .section > :nth-child(3) { animation-delay: 80ms; }
  .post > :nth-child(4), .section > :nth-child(4) { animation-delay: 120ms; }
  .post > :nth-child(5), .section > :nth-child(5) { animation-delay: 160ms; }
  .post > :nth-child(n+6), .section > :nth-child(n+6) { animation-delay: 200ms; }

  .mini.hint::after { content: ''; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 2px var(--hand); opacity: 0; pointer-events: none; animation: hint 1.8s ease .5s 1; }
  @keyframes hint { 30% { opacity: .5; } 100% { opacity: 0; } }

  dialog.note-pop.short[open] { animation: pop-in .26s cubic-bezier(.2, .7, .2, 1); }
  dialog.note-pop.long[open] { animation: drawer-in .34s cubic-bezier(.2, .7, .2, 1); }
  dialog.note-pop.short.closing { animation: pop-out .2s ease-in forwards; }
  dialog.note-pop.long.closing { animation: drawer-out .22s ease-in forwards; }
  dialog.note-pop[open]::backdrop { animation: fade-in .3s ease; }
  @keyframes pop-in { from { opacity: 0; transform: translateY(-8px) scale(.985); } }
  @keyframes pop-out { to { opacity: 0; transform: translateY(-6px) scale(.985); } }
  @keyframes drawer-in { from { transform: translateX(100%); } }
  @keyframes drawer-out { to { transform: translateX(100%); } }
  @keyframes fade-in { from { opacity: 0; } }
  @media (max-width: 40rem) {
    dialog.note-pop.short[open], dialog.note-pop.long[open] { animation: sheet-in .32s cubic-bezier(.2, .7, .2, 1); }
    dialog.note-pop.short.closing, dialog.note-pop.long.closing { animation: sheet-out .22s ease-in forwards; }
    @keyframes sheet-in { from { transform: translateY(100%); } }
    @keyframes sheet-out { to { transform: translateY(100%); } }
  }
  a { transition: color .2s; }
}
/* 头尾和首页同宽；大卡片的小图填满卡片剩下的高度 */
:root { --page: 60rem; }
.feature .card:first-child .mini { aspect-ratio: auto; flex: 1; min-height: 17rem; }
.feature .card:first-child .q { flex: none; }
