/* 生活记录 · 技术博客样式。系统字体 + 等宽点缀；浅色/深色由 data-theme 切换 */
:root {
  --bg: #fafaf9; --bg2: #f3f3f1; --card: #ffffff; --line: #e6e5e1; --line2: #d6d4cf;
  --text: #1c1b19; --text2: #57534e; --text3: #8a857e;
  --accent: #0f766e; --accent2: #0d9488; --accent-bg: #e6f4f1; --warn: #b45309;
  --code-bg: #f6f6f4; --code-bar: #eeeeeb;
  --tk-k: #9333ea; --tk-s: #15803d; --tk-c: #8a857e; --tk-n: #c2410c; --tk-f: #1d4ed8;
  --heat0: #ebebe8; --heat1: #a7dccf; --heat2: #4fb3a0; --heat3: #0f766e;
  --shadow: 0 1px 2px rgba(28, 27, 25, .04), 0 4px 16px rgba(28, 27, 25, .05);
  --sans: system-ui, -apple-system, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --mono: "JetBrains Mono", "Cascadia Code", "SF Mono", "Fira Code", Consolas, Menlo, "Microsoft YaHei", monospace;
  --radius: 12px; --w: 1120px;
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #0e1013; --bg2: #14171b; --card: #161a1f; --line: #252a31; --line2: #323842;
  --text: #e7e9ec; --text2: #a9b0ba; --text3: #6f7783;
  --accent: #2dd4bf; --accent2: #5eead4; --accent-bg: rgba(45, 212, 191, .1); --warn: #fbbf24;
  --code-bg: #12151a; --code-bar: #1a1e24;
  --tk-k: #c792ea; --tk-s: #a5d6a7; --tk-c: #6f7783; --tk-n: #f78c6c; --tk-f: #82aaff;
  --heat0: #1d2228; --heat1: #134e48; --heat2: #14857a; --heat3: #2dd4bf;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 80px; }
body { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; margin: 0; background: var(--bg); color: var(--text); font: 16px/1.75 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; cursor: pointer; }
kbd { font: 11px/1 var(--mono); padding: 3px 5px; border: 1px solid var(--line2); border-bottom-width: 2px; border-radius: 5px; color: var(--text3); background: var(--card); }
::selection { background: var(--accent); color: var(--bg); }
.wrap { max-width: var(--w); margin: 0 auto; padding: 0 24px; }
.muted { color: var(--text3); }
.skip { position: absolute; left: -999px; top: 8px; z-index: 99; background: var(--accent); color: #fff; padding: 6px 12px; border-radius: 6px; }
.skip:focus { left: 8px; }
main { flex: 1; }
.icon { width: 18px; height: 18px; flex: none; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
[hidden] { display: none !important; }

/* ---------- 顶栏（半透明 + 模糊） */
.nav { position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--bg) 78%, transparent); backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px); border-bottom: 1px solid transparent; transition: border-color .2s; }
.nav.scrolled { border-bottom-color: var(--line); }
.nav-inner { max-width: var(--w); margin: 0 auto; padding: 0 24px; height: 60px; display: flex; align-items: center; gap: 28px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: .02em; }
.brand img { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line); }
.nav-links { display: flex; gap: 4px; }
.nav-links a { padding: 6px 12px; border-radius: 8px; color: var(--text2); font-size: 15px; transition: color .15s, background .15s; }
.nav-links a:hover { color: var(--text); background: var(--bg2); }
.nav-links a.active { color: var(--text); font-weight: 600; }
.nav-links a.active::before { content: "~/"; font-family: var(--mono); font-size: 12px; color: var(--accent); margin-right: 1px; }
.nav-tools { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.search-btn { display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 8px 0 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--card); color: var(--text3); font-size: 14px; min-width: 190px; transition: border-color .15s; }
.search-btn:hover { border-color: var(--line2); }
.search-btn kbd { margin-left: auto; }
.icon-btn { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid transparent; border-radius: 9px; background: none; color: var(--text2); }
.icon-btn:hover { background: var(--bg2); color: var(--text); }
.theme-btn .i-moon, [data-theme="dark"] .theme-btn .i-sun { display: none; }
[data-theme="dark"] .theme-btn .i-moon { display: block; }
.menu-btn { display: none; }
.progress { position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 50; background: var(--accent); transform: scaleX(0); transform-origin: 0 50%; }

/* ---------- 按钮、标签 */
.btn { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--line2); background: var(--card); font-size: 15px; font-weight: 500; transition: border-color .15s, background .15s, transform .15s; }
.btn:hover { border-color: var(--text3); }
.btn .icon { width: 16px; height: 16px; }
.btn.primary { background: var(--text); color: var(--bg); border-color: var(--text); }
.btn.primary:hover { transform: translateY(-1px); }
.btn.small { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.tag { display: inline-flex; align-items: center; gap: 4px; font: 12.5px/1 var(--mono); color: var(--text2); padding: 5px 8px; border-radius: 6px; background: var(--bg2); transition: color .15s, background .15s; }
.tag::before { content: "#"; color: var(--text3); }
.tag:hover { color: var(--accent); background: var(--accent-bg); }
.tag em { font-style: normal; color: var(--text3); margin-left: 2px; }
.cat { display: inline-flex; align-items: center; font-size: 12.5px; line-height: 1; padding: 5px 8px; border-radius: 6px; color: var(--accent); background: var(--accent-bg); font-weight: 600; }

/* ---------- 首页：开场 */
.hero { display: grid; grid-template-columns: 1.05fr 1fr; gap: 48px; align-items: center; padding-top: 72px; padding-bottom: 40px; }
.hello { margin: 0; font: 14px var(--mono); color: var(--accent); }
.hello::before { content: "> "; color: var(--text3); }
.hero h1 { margin: 6px 0 14px; font-size: clamp(40px, 6vw, 60px); line-height: 1.1; letter-spacing: -.02em; }
.lead { margin: 0; color: var(--text2); font-size: 18px; max-width: 34em; }
.lead b { color: var(--text); font-weight: 600; }
.hero-stats { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 24px 0 28px; font-size: 14px; color: var(--text3); }
.hero-stats b { font: 600 20px var(--mono); color: var(--text); margin-right: 4px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.term { overflow: hidden; box-shadow: var(--shadow); }
.term-bar { display: flex; align-items: center; gap: 7px; padding: 11px 14px; border-bottom: 1px solid var(--line); background: var(--bg2); }
.term-bar i { width: 11px; height: 11px; border-radius: 50%; background: #ef4444; opacity: .8; }
.term-bar i:nth-child(2) { background: #f59e0b; }
.term-bar i:nth-child(3) { background: #22c55e; }
.term-bar span { margin-left: 8px; font: 12px var(--mono); color: var(--text3); }
.term pre { margin: 0; padding: 18px 20px 20px; font: 13.5px/1.85 var(--mono); color: var(--text2); white-space: pre-wrap; word-break: break-word; }
.term .p { color: var(--accent); user-select: none; }
.term b { color: var(--text); font-weight: 600; }
.cursor { display: inline-block; width: 8px; height: 16px; vertical-align: -3px; background: var(--accent); animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ---------- 区块 */
.section { padding-top: 56px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 18px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.section-head h2 { margin: 0; font-size: 22px; letter-spacing: -.01em; }
.section-head h2 span { font-family: var(--mono); color: var(--accent); font-weight: 500; margin-right: 4px; }
.section-desc { margin: -6px 0 20px; color: var(--text2); }
.more { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; color: var(--text2); }
.more .icon { width: 15px; height: 15px; transition: transform .15s; }
.more:hover { color: var(--accent); }
.more:hover .icon { transform: translateX(3px); }

/* ---------- 开源推荐卡片 */
.pick { display: flex; flex-direction: column; overflow: hidden; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); transition: border-color .2s, box-shadow .2s, transform .2s; }
.pick:hover { border-color: var(--line2); box-shadow: var(--shadow); transform: translateY(-2px); }
.pick-cover { display: block; aspect-ratio: 16 / 9; overflow: hidden; background: var(--bg2); border-bottom: 1px solid var(--line); }
.pick-cover img { width: 100%; height: 100%; object-fit: cover; object-position: top; transition: transform .4s; }
.pick:hover .pick-cover img { transform: scale(1.03); }
.pick-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.pick-meta { display: flex; align-items: center; gap: 10px; font: 12.5px var(--mono); color: var(--text3); }
.issue { color: var(--accent); font-weight: 600; }
.pick h3 { margin: 0; font-size: 20px; line-height: 1.3; }
.pick h3 a:hover { color: var(--accent); }
.pick p { margin: 0; color: var(--text2); font-size: 15px; }
.pick-facts { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-top: auto; padding-top: 6px; font: 12.5px var(--mono); color: var(--text3); }
.pick-facts span { display: inline-flex; align-items: center; gap: 4px; }
.pick-facts .icon { width: 14px; height: 14px; color: var(--warn); }
.pick-facts .cat { font-family: var(--sans); }
.pick-big { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
.pick-big .pick-cover { aspect-ratio: 16 / 10; border-bottom: 0; border-right: 1px solid var(--line); }
.pick-big .pick-body { padding: 26px 28px; justify-content: center; gap: 12px; }
.pick-big .pick-facts { margin-top: 4px; }
.pick-cmd { display: block; min-width: 0; margin-top: 6px; padding: 9px 12px; border-radius: 8px; background: var(--code-bg); border: 1px solid var(--line); font: 13px var(--mono); color: var(--text); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.pick-cmd::before { content: "$"; color: var(--accent); margin-right: 8px; }
.pick-go { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; font-weight: 600; color: var(--accent); }
.pick-go .icon { width: 15px; height: 15px; transition: transform .15s; }
.pick-go:hover .icon { transform: translateX(3px); }
.pick-big h3 { font-size: 28px; }
.pick-big p { font-size: 16px; }
.pick-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 18px; }

/* ---------- 文章列表 */
.rows { list-style: none; margin: 0; padding: 0; }
.row { display: grid; grid-template-columns: 104px 1fr 72px; gap: 20px; padding: 18px 0; border-bottom: 1px dashed var(--line); }
.row:last-child { border-bottom: 0; }
.row time { font: 13.5px/1.9 var(--mono); color: var(--text3); }
.row-title { font-size: 18px; font-weight: 600; line-height: 1.5; transition: color .15s; }
.row-title:hover { color: var(--accent); }
.row-main p { margin: 4px 0 10px; color: var(--text2); font-size: 15px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.row-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.row-meta { font: 12.5px/1.8 var(--mono); color: var(--text3); text-align: right; }

/* ---------- 专栏 */
.col-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.col-card { padding: 18px; display: flex; flex-direction: column; gap: 6px; transition: border-color .2s, transform .2s; }
.col-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.col-card b { font-size: 17px; }
.col-card span { color: var(--text2); font-size: 14px; flex: 1; }
.col-card em { font: normal 12.5px var(--mono); color: var(--accent); }
.oss-col { background: linear-gradient(135deg, var(--accent-bg), var(--card) 70%); }

/* ---------- 写作热力 */
.heat { padding: 18px 20px 14px; overflow-x: auto; }
.heat-months { display: grid; grid-template-columns: repeat(52, minmax(10px, 1fr)); gap: 3px; font: normal 11px var(--mono); color: var(--text3); margin-bottom: 6px; min-width: 670px; }
.heat-months em { font-style: normal; white-space: nowrap; }
.heat-grid { display: grid; grid-template-columns: repeat(52, minmax(10px, 1fr)); gap: 3px; min-width: 670px; }
.heat-grid span { display: grid; gap: 3px; }
.heat i { display: block; aspect-ratio: 1; border-radius: 3px; background: var(--heat0); }
.heat i.l1 { background: var(--heat1); } .heat i.l2 { background: var(--heat2); } .heat i.l3 { background: var(--heat3); }
.heat i.f { opacity: .35; }
.heat-legend { display: flex; align-items: center; justify-content: flex-end; gap: 4px; margin-top: 10px; font-size: 12px; color: var(--text3); }
.heat-legend i { width: 11px; height: 11px; aspect-ratio: auto; }

/* ---------- 页头（列表页） */
.page-head { padding-top: 56px; padding-bottom: 12px; }
.page-head h1 { margin: 0 0 8px; font-size: clamp(32px, 5vw, 42px); letter-spacing: -.02em; }
.page-head h1::before { content: "~/"; font: 500 .55em var(--mono); color: var(--accent); margin-right: 4px; vertical-align: .25em; }
.page-head p { margin: 0; color: var(--text2); max-width: 44em; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.chip { height: 32px; padding: 0 14px; display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 99px; background: var(--card); font-size: 14px; color: var(--text2); transition: all .15s; }
.chip:hover { border-color: var(--line2); color: var(--text); }
.chip.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.oss-list { margin-top: 8px; }
.cat-block { padding-top: 32px; }
.cat-block h2 { margin: 0; font-size: 22px; }
.cat-block h2 em, .tag-block h2 em { font: normal 13px var(--mono); color: var(--text3); margin-left: 6px; }
.cat-block > p { margin: 2px 0 6px; }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.tag-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; padding-top: 24px; }
.tag-block { padding: 16px 20px; }
.tag-block h2 { margin: 0 0 6px; font: 600 16px var(--mono); color: var(--accent); }
.tag-block ul { list-style: none; margin: 0; padding: 0; }
.tag-block li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-top: 1px dashed var(--line); font-size: 15px; }
.tag-block li:first-child { border-top: 0; }
.tag-block li a:hover { color: var(--accent); }
.tag-block time, .tag-block .issue-no { font: 12.5px/2 var(--mono); color: var(--text3); flex: none; }

/* ---------- 文章页 */
.article-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 56px; padding-top: 48px; }
.article-wrap.single { grid-template-columns: minmax(0, 760px); justify-content: center; }
.article { min-width: 0; width: 100%; max-width: 760px; justify-self: start; }
.article-head { padding-bottom: 22px; margin-bottom: 28px; border-bottom: 1px solid var(--line); }
.article-head h1 { text-wrap: balance; margin: 14px 0 10px; font-size: clamp(28px, 4.4vw, 38px); line-height: 1.25; letter-spacing: -.015em; }
.article-sum { margin: 0 0 14px; color: var(--text2); font-size: 17px; }
.article-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; font: 13px var(--mono); color: var(--text3); }
.article-side { position: relative; }
.toc { position: sticky; top: 88px; font-size: 14px; max-height: calc(100vh - 120px); overflow: auto; }
.toc b { display: block; font: 600 12px var(--mono); letter-spacing: .08em; color: var(--text3); margin-bottom: 10px; }
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.toc a { display: block; padding: 4px 0 4px 14px; margin-left: -1px; border-left: 2px solid transparent; color: var(--text3); line-height: 1.5; transition: color .15s; }
.toc .lv3 a { padding-left: 26px; font-size: 13px; }
.toc .lv4 a { padding-left: 38px; font-size: 13px; }
.toc a:hover { color: var(--text); }
.toc a.active { color: var(--accent); border-left-color: var(--accent); }
.article-foot { margin-top: 48px; padding-top: 22px; border-top: 1px solid var(--line); }
.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 24px; }
.pn { padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); transition: border-color .15s; }
.pn:hover { border-color: var(--accent); }
.pn small { display: block; font: 12px var(--mono); color: var(--text3); }
.pn b { font-weight: 600; }
.pn.next { text-align: right; grid-column: 2; }

/* ---------- 正文排版 */
.prose { font-size: 16.5px; line-height: 1.85; }
.prose > :first-child { margin-top: 0; }
.prose h2, .prose h3, .prose h4 { position: relative; text-wrap: pretty; line-height: 1.4; letter-spacing: -.01em; }
.prose h2 { margin: 2.2em 0 .7em; font-size: 24px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.prose h3 { margin: 1.8em 0 .5em; font-size: 19px; }
.prose h4 { margin: 1.5em 0 .4em; font-size: 17px; }
.anchor { position: absolute; left: -1em; width: 1em; color: var(--accent); opacity: 0; font-family: var(--mono); font-weight: 400; transition: opacity .15s; }
.prose h2:hover .anchor, .prose h3:hover .anchor, .prose h4:hover .anchor { opacity: 1; }
.prose p { margin: 0 0 1.1em; }
.prose a { color: var(--accent); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--accent) 35%, transparent); text-underline-offset: 3px; word-break: break-word; }
.prose a:hover { text-decoration-color: var(--accent); }
.prose a.anchor { text-decoration: none; }
.prose strong { font-weight: 650; color: var(--text); }
.prose ul, .prose ol { margin: 0 0 1.1em; padding-left: 1.4em; }
.prose li { margin: .3em 0; }
.prose li::marker { color: var(--text3); }
.prose blockquote { margin: 1.2em 0; padding: 10px 18px; border-left: 3px solid var(--accent); background: var(--accent-bg); border-radius: 0 10px 10px 0; color: var(--text2); }
.prose blockquote p { margin: .3em 0; }
.prose hr { border: 0; border-top: 1px dashed var(--line2); margin: 2.4em 0; }
.prose figure { margin: 1.6em 0; }
.prose figure img, .prose p img { border-radius: 10px; border: 1px solid var(--line); }
.prose figcaption { margin-top: 8px; text-align: center; font-size: 13.5px; color: var(--text3); }
.prose :not(pre) > code { font: .88em var(--mono); padding: .15em .4em; border-radius: 5px; background: var(--bg2); border: 1px solid var(--line); word-break: break-word; }
.table { margin: 1.4em 0; overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
.prose table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.6; }
.prose th, .prose td { padding: 10px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.prose th { background: var(--bg2); font-weight: 600; white-space: nowrap; }
.prose tr:last-child td { border-bottom: 0; }

/* ---------- 代码块 */
.code { margin: 1.4em 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--code-bg); }
.code-bar { display: flex; align-items: center; justify-content: space-between; padding: 0 8px 0 14px; height: 34px; background: var(--code-bar); border-bottom: 1px solid var(--line); font: 12px var(--mono); color: var(--text3); }
.copy { border: 1px solid transparent; background: none; padding: 3px 8px; border-radius: 6px; font: 12px var(--sans); color: var(--text3); }
.copy:hover { background: var(--bg); border-color: var(--line); color: var(--text); }
.copy.done { color: var(--accent); }
.code pre { margin: 0; padding: 14px 16px; overflow-x: auto; font: 13.5px/1.7 var(--mono); tab-size: 4; }
.code code { font: inherit; color: var(--text); }
.tk-k { color: var(--tk-k); } .tk-s { color: var(--tk-s); } .tk-c { color: var(--tk-c); font-style: italic; } .tk-n { color: var(--tk-n); } .tk-f { color: var(--tk-f); }

/* ---------- 开源推荐详情 */
.oss-hero { border-bottom: 1px solid var(--line); background: radial-gradient(900px 300px at 85% 0%, var(--accent-bg), transparent 70%), var(--bg2); }
.oss-hero-inner { display: grid; grid-template-columns: 1fr 1.05fr; gap: 44px; align-items: center; padding-top: 48px; padding-bottom: 48px; }
.oss-hero-text h1 { text-wrap: balance; margin: 12px 0 10px; font-size: clamp(30px, 4.6vw, 44px); line-height: 1.15; letter-spacing: -.02em; }
.oss-hero-text .lead { font-size: 17px; }
.oss-hero-text .pick-facts { margin: 16px 0 22px; }
.oss-hero .issue:hover { text-decoration: underline; }
.oss-cover { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow); background: var(--card); }
.facts { display: grid; grid-template-columns: 1fr 1fr; margin: 0 0 8px; overflow: hidden; }
.facts div { display: flex; gap: 14px; padding: 11px 16px; border-bottom: 1px solid var(--line); }
.facts div:nth-child(odd) { border-right: 1px solid var(--line); }
.facts div:nth-last-child(-n+2):nth-child(odd), .facts div:last-child { border-bottom: 0; }
.facts dt { flex: none; width: 64px; font: 12.5px/1.9 var(--mono); color: var(--text3); }
.facts dd { margin: 0; font-weight: 600; font-size: 14.5px; line-height: 1.65; word-break: break-word; min-width: 0; }
.facts-note { margin: 0 0 32px; font-size: 13px; color: var(--text3); }
.stack span { display: inline-block; font: 12px var(--mono); padding: 2px 7px; margin: 2px 4px 2px 0; border: 1px solid var(--line); border-radius: 5px; color: var(--text2); }
.gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; margin-top: 6px; }
.demo { margin: 0; display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.demo-shot { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: var(--bg2); border-bottom: 1px solid var(--line); }
.demo-shot img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.demo-type { position: absolute; left: 10px; top: 10px; font: 600 11.5px/1 var(--sans); padding: 5px 8px; border-radius: 6px; background: rgba(15, 23, 32, .72); color: #fff; backdrop-filter: blur(6px); }
.demo figcaption { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.demo b { font-size: 16.5px; }
.demo p { margin: 0; font-size: 14.5px; color: var(--text2); line-height: 1.7; flex: 1; }
.demo-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }

/* ---------- 页内预览 */
.viewer { position: fixed; inset: 0; z-index: 70; display: none; flex-direction: column; background: rgba(8, 10, 13, .72); backdrop-filter: blur(6px); padding: 24px; }
.viewer.open { display: flex; }
.viewer-bar { display: flex; align-items: center; gap: 14px; max-width: 1280px; width: 100%; margin: 0 auto; padding: 10px 14px; background: var(--card); border: 1px solid var(--line); border-bottom: 0; border-radius: 12px 12px 0 0; }
.viewer-bar b { flex: 1; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viewer-bar a { display: inline-flex; align-items: center; gap: 4px; font-size: 13.5px; color: var(--accent); }
.viewer-bar a .icon { width: 15px; height: 15px; }
.viewer-bar button { width: 30px; height: 30px; border: 0; border-radius: 8px; background: var(--bg2); }
.viewer iframe { flex: 1; width: 100%; max-width: 1280px; margin: 0 auto; border: 1px solid var(--line); border-radius: 0 0 12px 12px; background: #fff; }

/* ---------- 搜索面板 */
.search { position: fixed; inset: 0; z-index: 60; display: none; align-items: flex-start; justify-content: center; padding: 12vh 16px 16px; background: rgba(8, 10, 13, .45); backdrop-filter: blur(4px); }
.search.open { display: flex; }
.search-box { width: 100%; max-width: 640px; background: var(--card); border: 1px solid var(--line2); border-radius: 14px; box-shadow: 0 24px 60px rgba(0, 0, 0, .25); overflow: hidden; }
.search-box label { display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid var(--line); color: var(--text3); }
.search-box input::-webkit-search-cancel-button { display: none; }
.search-box input { flex: 1; height: 54px; border: 0; outline: 0; background: none; color: var(--text); font: 16px var(--sans); }
.search-results { max-height: 52vh; overflow: auto; padding: 8px; }
.search-results a { display: block; padding: 10px 12px; border-radius: 9px; }
.search-results a.sel, .search-results a:hover { background: var(--bg2); }
.search-results em { float: right; font: normal 11.5px var(--mono); color: var(--accent); margin-left: 8px; }
.search-results b { display: block; font-weight: 600; }
.search-results span { display: block; font-size: 13px; color: var(--text3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-results mark { background: var(--accent-bg); color: var(--accent); border-radius: 3px; padding: 0 1px; }
.search-empty { padding: 28px; text-align: center; color: var(--text3); }
.search-foot { display: flex; gap: 18px; padding: 10px 16px; border-top: 1px solid var(--line); font-size: 12px; color: var(--text3); background: var(--bg2); }
.search-foot kbd { margin-right: 3px; }

/* ---------- 页脚、回到顶部、404 */
.footer { margin-top: 88px; border-top: 1px solid var(--line); background: var(--bg2); }
.footer-inner { display: grid; grid-template-columns: 1fr auto; gap: 12px 24px; padding-top: 28px; padding-bottom: 28px; font-size: 14px; color: var(--text3); }
.footer-brand b { color: var(--text); margin-right: 10px; }
.footer-links { display: flex; gap: 18px; }
.footer-links a { display: inline-flex; align-items: center; gap: 4px; }
.footer-links a:hover, .beian a:hover { color: var(--accent); }
.footer-links .icon { width: 15px; height: 15px; }
.beian { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; font-size: 13px; }
.beian a { display: inline-flex; align-items: center; gap: 4px; }
.beian img { width: 16px; height: 16px; }
.to-top { position: fixed; right: 22px; bottom: 22px; z-index: 30; width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: var(--card); color: var(--text2); box-shadow: var(--shadow); opacity: 0; pointer-events: none; transform: translateY(8px); transition: all .2s; }
.to-top.show { opacity: 1; pointer-events: auto; transform: none; }
.notfound { text-align: center; padding-top: 96px; }
.notfound h1::before { display: none; }
.notfound h1 { font: 700 72px var(--mono); margin: 12px 0 4px; }
.notfound p { margin: 0 auto 18px; }
.term-404 { display: inline-block; text-align: left; margin: 0; padding: 14px 20px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); font: 14px/1.8 var(--mono); color: var(--text2); }

/* ---------- 响应式 */
@media (max-width: 1020px) {
  .article-wrap { grid-template-columns: minmax(0, 1fr); }
  .article-side { display: none; }
  .article { justify-self: center; }
  .col-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
  .nav-inner { gap: 12px; }
  .menu-btn { display: grid; }
  .nav-links { display: none; position: absolute; top: 60px; left: 0; right: 0; flex-direction: column; padding: 10px 16px 16px; background: var(--bg); border-bottom: 1px solid var(--line); }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 10px 12px; }
  .search-btn { min-width: 0; width: 36px; padding: 0; justify-content: center; border-color: transparent; background: none; }
  .search-btn span, .search-btn kbd { display: none; }
  .hero { grid-template-columns: 1fr; gap: 32px; padding-top: 44px; }
  .pick-big { grid-template-columns: 1fr; }
  .pick-big .pick-cover { border-right: 0; border-bottom: 1px solid var(--line); min-height: 0; aspect-ratio: 16 / 9; }
  .pick-big .pick-body { padding: 18px 20px 20px; }
  .pick-big h3 { font-size: 23px; }
  .pick-grid { grid-template-columns: repeat(2, 1fr); }
  .oss-hero-inner { grid-template-columns: 1fr; gap: 28px; padding-top: 36px; padding-bottom: 36px; }
  .tag-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  body { font-size: 15.5px; }
  .wrap, .nav-inner { padding-left: 16px; padding-right: 16px; }
  .brand span { font-size: 15px; }
  .row { grid-template-columns: 1fr; gap: 4px; padding: 16px 0; }
  .row-meta { display: none; }
  .row time { line-height: 1.4; }
  .pick-grid, .gallery, .col-grid { grid-template-columns: 1fr; }
  .facts { grid-template-columns: 1fr; }
  .facts div:nth-child(odd) { border-right: 0; }
  .facts div:nth-last-child(-n+2):nth-child(odd) { border-bottom: 1px solid var(--line); }
  .post-nav { grid-template-columns: 1fr; }
  .pn.next { grid-column: auto; }
  .prose { font-size: 16px; }
  .code pre { font-size: 12.5px; }
  .anchor { display: none; }
  .footer-inner { grid-template-columns: 1fr; }
  .viewer { padding: 0; }
  .viewer-bar, .viewer iframe { border-radius: 0; }
  .search { padding-top: 8vh; }
  .search-foot { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
