/* ==========================================================================
   TechLog Pro — GEOcms 专业科技博客主题（独立主题）

   设计语言参考 Bootstrap：中性底色 + 主色强调、清晰边框、克制阴影。
   中文阅读优化：正文 17px+ / 1.8 行高 / ≈40 字每行。

   ① 设计令牌 → ② 基础 → ③ 布局 → ④ 区块（导航/Hero/列表/正文/评论/页脚）
   → ⑤ 响应式 → ⑥ 打印。

   暗色实现：颜色令牌一律 light-dark() 单份声明（依赖 color-scheme），
   不再为 [data-theme=dark] 与 prefers-color-scheme 各抄一份（旧版两份会漂移）。
   不支持 light-dark() 的浏览器丢弃第二条声明，回落到亮色值。
   强调色五档同理：一个 [data-accent] 块同时给出亮/暗两值。
   ========================================================================== */

/* ---------- ① 设计令牌 ---------- */
:root {
  color-scheme: light dark;

  /* 字体 */
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial,
               "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Source Han Sans SC",
               "Noto Sans SC", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "JetBrains Mono", "Cascadia Code", Menlo,
               Consolas, "Courier New", monospace;

  /* 中性色：白画布 + 导航/页脚灰带（--band），靠底色与边框分层 */
  --bg: #ffffff;                                   --bg: light-dark(#ffffff, #16191d);
  --bg-soft: #eef1f5;                              --bg-soft: light-dark(#eef1f5, #1b2026);
  --band: #edf0f4;                                 --band: light-dark(#edf0f4, #1c2129);
  --surface: #ffffff;                              --surface: light-dark(#ffffff, #1d232a);
  --surface-2: #f6f8fa;                            --surface-2: light-dark(#f6f8fa, #21272f);
  --text: #1b1f24;                                 --text: light-dark(#1b1f24, #e9ecef);
  --text-2: #495057;                               --text-2: light-dark(#495057, #c2c8cf);
  --muted: #5f6878;                                --muted: light-dark(#5f6878, #99a0a8);
  --border: #dfe4ea;                               --border: light-dark(#dfe4ea, #2b323a);
  --border-strong: #ced4da;                        --border-strong: light-dark(#ced4da, #3a434d);

  /* 强调（科技蓝，可被 data-accent 覆盖） */
  --accent: #0d6efd;                               --accent: light-dark(#0d6efd, #4c8dff);
  --accent-ink: #0a58ca;                           --accent-ink: light-dark(#0a58ca, #8ab9ff);
  --accent-soft: #e7f1ff;                          --accent-soft: light-dark(#e7f1ff, #17273f);
  /* 暗色下强调色会变亮（#4c8dff），白字对比只剩 3.16:1（不达 AA）：
     实色按钮/徽章的字色改用深墨，与 ink-v3 同口径。 */
  --on-accent: #ffffff;                            --on-accent: light-dark(#ffffff, #08243f);

  /* 状态 */
  --ok-bg: #d1e7dd;   --ok-bg: light-dark(#d1e7dd, #12291d);
  --ok-fg: #0f5132;   --ok-fg: light-dark(#0f5132, #67c98d);
  --ok-bd: #a3cfbb;   --ok-bd: light-dark(#a3cfbb, #235c33);
  --err-bg: #f8d7da;  --err-bg: light-dark(#f8d7da, #2c1417);
  --err-fg: #b02a37;  --err-fg: light-dark(#b02a37, #f28b82);
  --err-bd: #f1aeb5;  --err-bd: light-dark(#f1aeb5, #5c2a2e);
  --warn-bg: #fff3cd; --warn-bg: light-dark(#fff3cd, #2c2314);
  --warn-fg: #664d03; --warn-fg: light-dark(#664d03, #d9b45c);
  --warn-bd: #ffe69c; --warn-bd: light-dark(#ffe69c, #5c4d1e);

  /* 语法 token */
  --tok-kw: #0b5ed7;  --tok-kw: light-dark(#0b5ed7, #79a8ff);
  --tok-str: #b02a37; --tok-str: light-dark(#b02a37, #ff8f8f);
  --tok-com: #6c757d; --tok-com: light-dark(#6c757d, #99a0a8);
  --tok-num: #b45309; --tok-num: light-dark(#b45309, #e0a458);
  --tok-fn: #6610f2;  --tok-fn: light-dark(#6610f2, #c3a6ff);
  --tok-tag: #0f766e; --tok-tag: light-dark(#0f766e, #4dd0c2);
  --code-bg: #f1f4f8; --code-bg: light-dark(#f1f4f8, #1b2026);

  /* 阴影 / 圆角 / 间距 */
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .06);
  --shadow-sm: light-dark(0 1px 2px rgba(16, 24, 40, .06), 0 1px 2px rgba(0, 0, 0, .35));
  --shadow-pop: 0 10px 28px rgba(16, 24, 40, .12);
  --shadow-pop: light-dark(0 10px 28px rgba(16, 24, 40, .12), 0 10px 28px rgba(0, 0, 0, .5));
  --radius-xs: 6px; --radius-sm: 8px; --radius: 12px; --radius-lg: 16px; --radius-pill: 999px;
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px;
  --sp-5: 24px; --sp-6: 32px; --sp-7: 48px; --sp-8: 64px;

  /* 字号 11 级（标题流体） */
  --fs-2xs: .8125rem; --fs-xs: .8125rem; --fs-sm: .875rem;
  --fs-md: 1rem; --fs-lg: 1.0625rem;
  --fs-h4: clamp(1rem, .97rem + .16vw, 1.125rem);
  --fs-h3: clamp(1.125rem, 1.08rem + .26vw, 1.25rem);
  --fs-h2: clamp(1.25rem, 1.17rem + .42vw, 1.5rem);
  --fs-h1: clamp(1.625rem, 1.42rem + 1vw, 2.125rem);
  --fs-hero: clamp(2rem, 1.5rem + 2.6vw, 3.25rem);
  --lh-tight: 1.3; --lh-body: 1.8;
  --fs-label: .8125rem; --ls-label: .08em;

  /* 布局 */
  --wrap-wide: 1200px;
  --gutter: 24px;
  --side-w: 300px; --side-w-art: 288px;
  --gap-col: 44px; --gap-col-art: 48px;
  --measure-list: 780px; --measure-prose: 700px;
  --prose-fs: clamp(1.0625rem, 1rem + .22vw, 1.125rem);
  --prose-lh: 1.8;
  --head-h: 68px;
  --anchor-offset: calc(var(--head-h) + 16px);
  --hero-glow: color-mix(in srgb, var(--accent) 16%, transparent);

  /* 动效 */
  --ease: cubic-bezier(.22, .61, .36, 1);
  --dur: .18s;
}

/* 手动切换优先于系统偏好 */
html[data-theme="dark"] { color-scheme: dark; }
html[data-theme="light"] { color-scheme: light; }

/* ---------- 强调色五档（亮/暗一次给全） ----------
   --on-accent 逐档给实色按钮的字色：取与当档暗色强调对比更高的那个
   （indigo 暗色 #6d67f0 下白字 4.4:1 优于深墨 3.8:1，故保留白色）。 */
html[data-accent="indigo"] {
  --accent: #4f46e5; --accent: light-dark(#4f46e5, #6d67f0);
  --accent-ink: #4338ca; --accent-ink: light-dark(#4338ca, #a5b4fc);
  --accent-soft: #eef2ff; --accent-soft: light-dark(#eef2ff, #20214a);
  --on-accent: #ffffff; --on-accent: light-dark(#ffffff, #ffffff);
}
html[data-accent="violet"] {
  --accent: #a855f7; --accent: light-dark(#a855f7, #b875f9);
  --accent-ink: #9333ea; --accent-ink: light-dark(#9333ea, #d8b4fe);
  --accent-soft: #faf5ff; --accent-soft: light-dark(#faf5ff, #291c40);
  --on-accent: #ffffff; --on-accent: light-dark(#ffffff, #2b1b45);
}
html[data-accent="teal"] {
  --accent: #0d9488; --accent: light-dark(#0d9488, #2dd4bf);
  --accent-ink: #0f766e; --accent-ink: light-dark(#0f766e, #5eead4);
  --accent-soft: #f0fdfa; --accent-soft: light-dark(#f0fdfa, #0e2f2b);
  --on-accent: #ffffff; --on-accent: light-dark(#ffffff, #042f2b);
}
html[data-accent="green"] {
  --accent: #16a34a; --accent: light-dark(#16a34a, #3fbf68);
  --accent-ink: #15803d; --accent-ink: light-dark(#15803d, #86efac);
  --accent-soft: #f0fdf4; --accent-soft: light-dark(#f0fdf4, #12291b);
  --on-accent: #ffffff; --on-accent: light-dark(#ffffff, #052e16);
}

/* ---------- ② 基础 ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--fs-md);
  line-height: var(--lh-body);
  color: var(--text);
  background: var(--bg);
  letter-spacing: .01em;
  font-feature-settings: "kern" 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4, h5, h6 {
  line-height: var(--lh-tight); letter-spacing: -.012em; font-weight: 700;
  text-wrap: balance; margin: 0 0 .5em;
}
h1 { font-size: var(--fs-h1); } h2 { font-size: var(--fs-h2); } h3 { font-size: var(--fs-h3); }
h4 { font-size: var(--fs-h4); }
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
img { max-width: 100%; height: auto; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--radius-xs); }
::selection { background: color-mix(in srgb, var(--accent) 22%, transparent); }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; left: -999px; top: 0; z-index: 100;
  background: var(--accent); color: var(--on-accent);
  padding: 10px 18px; border-radius: 0 0 var(--radius-sm) 0;
}
.skip:focus { left: 0; }

/* ---------- ③ 布局 ---------- */
.wrap { max-width: var(--wrap-wide); margin: 0 auto; padding: 0 var(--gutter); }
.wrap-narrow { max-width: 560px; margin: 0 auto; padding: 0 var(--gutter); }
.list-main, .single-main { min-width: 0; }
.list-layout.is-solo .list-main { max-width: var(--measure-list); margin: 0 auto; }
.single-layout.is-solo .single-main { max-width: var(--measure-prose); margin: 0 auto; }

.list-layout, .single-layout {
  display: grid; grid-template-columns: minmax(0, 1fr) var(--side-w);
  gap: var(--gap-col); align-items: start;
}
.single-layout { grid-template-columns: minmax(0, 1fr) var(--side-w-art); gap: var(--gap-col-art); }
.list-layout.is-solo, .single-layout.is-solo { grid-template-columns: minmax(0, 1fr); justify-items: center; }
.list-layout.is-solo > *, .single-layout.is-solo > * { width: 100%; }
/* 主列左右竖线 + 侧栏右线：[线]主列[线]侧栏[线] 的三栏框 */
.list-layout:not(.is-solo) .list-main {
  border-left: 1px solid var(--border); border-right: 1px solid var(--border);
  margin-left: calc(var(--gap-col) / -2 + 1px); margin-right: calc(var(--gap-col) / -2 + 1px);
  padding-left: calc(var(--gap-col) / 2 - 1px); padding-right: calc(var(--gap-col) / 2 - 1px);
}
.single-layout:not(.is-solo) .single-main {
  border-left: 1px solid var(--border); border-right: 1px solid var(--border);
  margin-left: calc(var(--gap-col-art) / -2 + 1px); margin-right: calc(var(--gap-col-art) / -2 + 1px);
  padding-left: calc(var(--gap-col-art) / 2 - 1px); padding-right: calc(var(--gap-col-art) / 2 - 1px);
}
/* 侧栏线用容器伪元素：.site-side 是 sticky + 限高，自身边框只会画到视口高度 */
.list-layout:not(.is-solo), .single-layout:not(.is-solo) { position: relative; }
.list-layout:not(.is-solo)::after,
.single-layout:not(.is-solo)::after {
  content: ""; position: absolute; top: 0; bottom: 0; width: 1px;
  background: var(--border); pointer-events: none;
}
.list-layout:not(.is-solo)::after { right: calc(var(--gap-col) / -2 + 1px); }
.single-layout:not(.is-solo)::after { right: calc(var(--gap-col-art) / -2 + 1px); }

.site-main { min-height: 55vh; padding: 0 0 var(--sp-7); animation: geo-rise .38s var(--ease) both; }
@keyframes geo-rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* 按设备可见性（::: hide-* / only-* 容器） */
.only-mobile { display: none !important; }
/* 见 ink-v3 同名规则：桌面限定块在移动端必须隐藏 */
.only-desktop { display: none !important; }
@media (max-width: 760px) {
  .hide-mobile { display: none !important; }
  .only-mobile { display: revert !important; }
  .hide-desktop { display: revert !important; }
}
@media (min-width: 761px) {
  .hide-desktop { display: none !important; }
  .only-desktop { display: revert !important; }
}

/* ---------- ④-1 导航 ---------- */
.site-head {
  position: sticky; top: 0; z-index: 50; height: var(--head-h);
  background: color-mix(in srgb, var(--band) 86%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--border-strong);
}
.head-inner {
  max-width: var(--wrap-wide); margin: 0 auto; padding: 0 var(--gutter);
  height: 100%; display: flex; align-items: center; gap: var(--sp-3);
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-mark {
  flex: none; width: 32px; height: 32px; border-radius: 9px;
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-ink));
  color: var(--on-accent); font-weight: 800; font-size: 1rem; line-height: 1; letter-spacing: 0;
  box-shadow: var(--shadow-sm);
}
.brand-text { display: flex; flex-direction: row; align-items: baseline; gap: var(--sp-2); min-width: 0; line-height: 1.25; }
.brand-title { font-weight: 750; font-size: var(--fs-h3); letter-spacing: -.012em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-slogan { font-size: var(--fs-xs); color: var(--muted); white-space: nowrap; }

.site-nav { margin-left: auto; min-width: 0; }
.nav-list { display: flex; align-items: center; gap: 2px; list-style: none; margin: 0; padding: 0; flex-wrap: nowrap; }
/* ⚠ 菜单项较多时（901–1120px 区间最明显）不能把 sticky 头部撑宽：
   让导航内部横向滚动，页面本身不产生横向滚动条。 */
@media (min-width: 901px) {
  .nav-list { overflow-x: auto; scrollbar-width: none; -ms-overflow-style: none; }
  .nav-list::-webkit-scrollbar { display: none; }
  .nav-item { flex: none; }
}
.nav-item { position: relative; }
.nav-item > a {
  display: inline-block; padding: 8px 14px; border-radius: var(--radius-pill);
  font-size: var(--fs-sm); font-weight: 500; color: var(--text-2);
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.nav-item > a:hover { background: var(--bg-soft); color: var(--text); text-decoration: none; }
.nav-item > a[aria-current="page"] { color: var(--accent-ink); background: var(--accent-soft); font-weight: 600; }
/* 站内搜索：区别于普通导航文字——accent 描边胶囊 + 放大镜图标 */
.nav-item.nav-search { margin-left: var(--sp-2); }
.nav-item.nav-search > a {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--accent-ink); font-weight: 600;
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  background: var(--accent-soft);
}
.nav-item.nav-search > a:hover {
  background: var(--accent); border-color: var(--accent); color: #fff; text-decoration: none;
}
.nav-search-icon { flex: none; }
.nav-item.has-sub { display: flex; align-items: center; }
.sub-toggle {
  border: 0; background: none; color: var(--muted); padding: 6px; margin-left: -6px;
  cursor: pointer; display: inline-flex; transition: transform var(--dur) var(--ease);
}
.nav-item.is-open .sub-toggle { transform: rotate(180deg); }
.nav-sub {
  display: none; position: absolute; top: calc(100% + 8px); right: 0; min-width: 190px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-pop); list-style: none; margin: 0; padding: 6px; z-index: 60;
}
.nav-item.is-open .nav-sub { display: block; }
.nav-sub a { display: block; padding: 8px 12px; border-radius: var(--radius-sm); font-size: var(--fs-sm); color: var(--text-2); }
.nav-sub a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
@media (hover: hover) { .nav-item.has-sub:hover .nav-sub { display: block; } }

.theme-toggle {
  width: 36px; height: 36px; flex: none;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-2);
  border-radius: var(--radius-pill); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease), background-color var(--dur) var(--ease);
}
.theme-toggle:hover { color: var(--accent-ink); border-color: var(--accent); background: var(--accent-soft); }
.icon-sun { display: none; }
html[data-theme="dark"] .icon-moon { display: none; }
html[data-theme="dark"] .icon-sun { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-moon { display: none; }
  :root:not([data-theme="light"]) .icon-sun { display: block; }
}
.nav-toggle {
  display: none; position: relative; width: 38px; height: 38px; flex: none;
  border: 1px solid var(--border-strong); background: var(--surface);
  border-radius: var(--radius-sm); cursor: pointer; margin-left: auto;
}
.nav-toggle-bar, .nav-toggle-bar::before, .nav-toggle-bar::after {
  position: absolute; left: 9px; width: 18px; height: 2px; border-radius: 2px;
  background: var(--text-2); transition: transform .2s var(--ease);
}
.nav-toggle-bar { top: 17px; }
.nav-toggle-bar::before, .nav-toggle-bar::after { content: ""; left: 0; }
.nav-toggle-bar::before { top: -6px; } .nav-toggle-bar::after { top: 6px; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar { transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar::before { transform: translateY(6px) rotate(-90deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar::after { opacity: 0; }

/* ---------- ④-2 Centered Hero ---------- */
.hero-center { position: relative; border-bottom: 1px solid var(--border); text-align: center; overflow: hidden; }
.hero-center-inner { position: relative; z-index: 1; padding: clamp(48px, 7vw, 84px) var(--gutter) clamp(44px, 6vw, 68px); max-width: 880px; margin: 0 auto; }
.hero-display {
  font-size: var(--fs-hero); font-weight: 800; letter-spacing: -.022em;
  line-height: 1.14; margin: 0 0 var(--sp-4); text-wrap: balance;
}
.hero-lead {
  color: var(--text-2); font-size: var(--fs-lg); line-height: 1.75;
  max-width: 42em; margin: 0 auto var(--sp-5); text-wrap: pretty;
}
.hero-actions { display: flex; gap: var(--sp-3); justify-content: center; flex-wrap: wrap; }

/* 风格：渐变（默认）——主色辉光 + 网格点阵 */
.hero-center.is-gradient { background: var(--bg-soft); }
.hero-center.is-gradient::before {
  content: ""; position: absolute; inset: 0; z-index: 0;
  background:
    radial-gradient(620px 340px at 50% -10%, var(--hero-glow), transparent 70%),
    radial-gradient(420px 240px at 85% 110%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 70%);
}
.hero-center.is-gradient::after {
  content: ""; position: absolute; inset: 0; z-index: 0;
  background-image: radial-gradient(color-mix(in srgb, var(--muted) 26%, transparent) 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, .5), transparent 72%);
  -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, .5), transparent 72%);
}
/* 风格：背景图 —— 深色纵深蒙版 + 白字，任意照片都压得住 */
.hero-center.is-image { background-size: cover; background-position: center; }
.hero-center.is-image:not(.has-bg) { background: var(--surface); }
.hero-center.is-image.has-bg { background-color: #0c1322; }
.hero-center.is-image.has-bg::before {
  content: ""; position: absolute; inset: 0; z-index: 0;
  background: linear-gradient(180deg, rgba(8, 12, 24, .40) 0%, rgba(8, 12, 24, .60) 52%, rgba(8, 12, 24, .80) 100%);
}
.hero-center.is-image.has-bg .hero-center-inner { padding: clamp(72px, 11vw, 112px) var(--gutter) clamp(64px, 10vw, 100px); }
.hero-center.is-image.has-bg .hero-display { color: #fff; text-shadow: 0 2px 24px rgba(0, 0, 0, .45); }
.hero-center.is-image.has-bg .hero-lead { color: rgba(255, 255, 255, .88); }
.hero-center.is-image.has-bg .btn-outline {
  color: #fff; border-color: rgba(255, 255, 255, .62); background: rgba(255, 255, 255, .10);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.hero-center.is-image.has-bg .btn-outline:hover { background: #fff; border-color: #fff; color: #10182a; }
.hero-center.is-image.has-bg .btn-primary { box-shadow: 0 10px 28px color-mix(in srgb, var(--accent) 42%, transparent); }
/* 风格：纯色极简 */
.hero-center.is-plain { background: var(--surface); }

/* ---------- ④-3 按钮 / 徽标 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 20px; border-radius: var(--radius-sm);
  font-size: var(--fs-sm); font-weight: 550; line-height: 1.5;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  cursor: pointer; text-decoration: none;
  transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease),
              color var(--dur) var(--ease), transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.btn:hover { border-color: var(--accent); color: var(--accent-ink); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--accent-ink); border-color: var(--accent-ink); color: var(--on-accent); transform: translateY(-1px); }
.btn-outline { background: transparent; border-color: color-mix(in srgb, var(--accent) 55%, var(--border-strong)); color: var(--accent-ink); }
.btn-outline:hover { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--accent-ink); }
.btn-ghost:hover { background: var(--accent-soft); border-color: transparent; }
.btn-lg { padding: 12px 28px; font-size: var(--fs-md); border-radius: 10px; }
.btn-sm { padding: 5px 13px; font-size: var(--fs-xs); }
.link-btn { border: 0; background: none; color: var(--accent-ink); cursor: pointer; padding: 0; font-size: inherit; }
.link-btn:hover { text-decoration: underline; }

.chip {
  display: inline-block; font-size: var(--fs-xs); font-weight: 500; line-height: 1.6;
  padding: 2px 11px; border-radius: var(--radius-pill);
  background: var(--bg-soft); color: var(--text-2); border: 1px solid var(--border);
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease), background-color var(--dur) var(--ease);
}
a.chip:hover { text-decoration: none; color: var(--accent-ink); border-color: var(--accent); background: var(--accent-soft); }
.chip-cat { background: var(--accent-soft); color: var(--accent-ink); border-color: color-mix(in srgb, var(--accent) 22%, transparent); }
.side-chips-sub { margin-top: 6px; padding-left: 10px; border-left: 1px solid var(--border); gap: 4px; }
.chip-sub { font-size: var(--fs-2xs); }
.chip-tag { background: var(--bg-soft); }
.chip-count { color: var(--muted); font-size: var(--fs-2xs); font-weight: 400; font-variant-numeric: tabular-nums; }

/* ---------- ④-4 列表 ---------- */
.section-label { font-size: var(--fs-h3); font-weight: 700; margin: var(--sp-6) 0 var(--sp-5); }
.list-head {
  display: flex; align-items: baseline; gap: var(--sp-3);
  margin: var(--sp-6) 0 var(--sp-1); padding-bottom: var(--sp-3);
  border-bottom: 1px solid var(--border);
}
.list-title { font-size: var(--fs-h3); font-weight: 750; margin: 0; letter-spacing: -.012em; }
.list-count { color: var(--muted); font-size: var(--fs-xs); font-variant-numeric: tabular-nums; }

/* 文章行：不画卡片边框，相邻文章用分割线区隔（末行不画尾线） */
.post-row {
  position: relative; padding: var(--sp-5) 2px;
  border-bottom: 1px solid var(--border);
}
.post-row:last-of-type { border-bottom: 0; }
.post-row::before {
  content: ""; position: absolute; left: -14px; top: var(--sp-5); bottom: var(--sp-5);
  width: 3px; border-radius: 2px; background: var(--accent);
  opacity: 0; transition: opacity var(--dur) var(--ease);
}
.post-row-title { font-size: clamp(1.0625rem, 1rem + .4vw, 1.25rem); font-weight: 700; line-height: 1.4; margin: 0 0 7px; letter-spacing: -.008em; }
.post-row-title a { color: var(--text); }
.post-row-title a:hover { color: var(--accent-ink); text-decoration: none; }
.post-row-meta { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; font-size: var(--fs-xs); color: var(--muted); margin-bottom: var(--sp-2); }
.post-row-meta time { font-variant-numeric: tabular-nums; }
.post-row-meta .dot { opacity: .5; }
.post-row-excerpt {
  color: var(--text-2); font-size: var(--fs-sm); line-height: 1.78; margin: 0;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; text-wrap: pretty;
}
@media (hover: hover) {
  .post-row { transition: background-color var(--dur) var(--ease); }
  .post-row:hover { background: color-mix(in srgb, var(--bg-soft) 55%, transparent); }
  .post-row:hover::before { opacity: 1; }
}

/* 卡片（归档/搜索复用的旧形态，保留兼容） */
.card {
  position: relative; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); margin-bottom: var(--sp-4); overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease), transform var(--dur) var(--ease);
}
@media (hover: hover) {
  .card:hover { box-shadow: var(--shadow-pop); border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); transform: translateY(-2px); }
}
.card-body { padding: var(--sp-5) 26px; }
.card-title { font-size: clamp(1.0625rem, 1rem + .4vw, 1.25rem); font-weight: 700; line-height: 1.4; margin: 0 0 var(--sp-2); }
.card-title a { color: var(--text); }
.card-title a:hover { color: var(--accent-ink); text-decoration: none; }
.card-meta { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; font-size: var(--fs-xs); color: var(--muted); margin-bottom: var(--sp-2); }
.card-meta time { font-variant-numeric: tabular-nums; }
.card-excerpt {
  color: var(--text-2); font-size: var(--fs-sm); line-height: 1.78; margin: 0;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.empty-state {
  text-align: center; color: var(--muted); padding: var(--sp-8) var(--sp-4);
  border: 1px dashed var(--border-strong); border-radius: var(--radius-lg); background: var(--surface-2);
}
.empty-icon { display: block; font-size: 1.5rem; line-height: 1; opacity: .55; margin-bottom: var(--sp-3); }
.empty-state p { margin: 0; }
/* 加载态：异步区块（评论表单/验证码刷新）统一用骨架占位，避免操作无反馈 */
.is-loading { position: relative; pointer-events: none; opacity: .6; }
.is-loading::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--surface) 60%, transparent), transparent);
  animation: geo-shimmer 1.2s linear infinite;
}
@keyframes geo-shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
/* 归档/搜索/作者页复用：与首页 .post-row 同款扁平分割行 */
.post-card.is-compact { background: transparent; border: 0; border-bottom: 1px solid var(--border); border-radius: 0; box-shadow: none; margin-bottom: 0; }
.post-card.is-compact .card-body { padding: var(--sp-5) 2px; }
.post-card.is-compact .card-title { font-size: clamp(1.0625rem, 1rem + .4vw, 1.25rem); }
.post-card.is-compact .card-excerpt { -webkit-line-clamp: 2; }
@media (hover: hover) {
  .post-card.is-compact { transition: background-color var(--dur) var(--ease); }
  .post-card.is-compact:hover { background: color-mix(in srgb, var(--bg-soft) 55%, transparent); box-shadow: none; transform: none; }
}

/* ---------- ④-5 阅读辅助 ---------- */
.reading-bar {
  position: fixed; top: 0; left: 0; height: 2px; width: 0; z-index: 60;
  background: linear-gradient(90deg, var(--accent), var(--accent-ink));
  pointer-events: none; transition: width .08s linear;
}
.to-top {
  position: fixed; right: var(--sp-5); bottom: var(--sp-5);
  width: 42px; height: 42px; border-radius: var(--radius-pill);
  border: 1px solid var(--border); background: var(--surface); color: var(--text-2);
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-pop); opacity: 0; visibility: hidden; transform: translateY(8px);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease),
              visibility var(--dur) var(--ease), color var(--dur) var(--ease), border-color var(--dur) var(--ease);
  z-index: 45;
}
.to-top.is-on { opacity: 1; visibility: visible; transform: translateY(0); }
.to-top:hover { color: var(--accent-ink); border-color: var(--accent); }
.side-contact {
  position: fixed; right: var(--sp-5); bottom: calc(var(--sp-5) + 52px);
  width: 42px; height: 42px; border-radius: var(--radius-pill);
  border: 1px solid var(--border); background: var(--surface); color: var(--text-2);
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-pop); z-index: 45;
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.side-contact:hover { color: var(--accent-ink); border-color: var(--accent); }

/* ---------- ④-6 侧栏 ---------- */
.site-side {
  position: sticky; top: calc(var(--head-h) + 16px);
  max-height: calc(100vh - var(--head-h) - 32px); overflow-y: auto;
  scrollbar-width: thin; overscroll-behavior: contain;
}
/* 列表页：侧栏顶部下移，与主列 .list-head 对齐 */
.list-layout .site-side { margin-top: var(--sp-6); }
.side-box { background: none; border: 0; border-radius: 0; padding: 0; margin: 0; }
.side-box + .side-box { border-top: 1px solid var(--border); margin-top: var(--sp-4); padding-top: var(--sp-4); }
.side-title {
  font-size: var(--fs-sm); font-weight: 700; letter-spacing: .02em; color: var(--text);
  margin: 0 0 var(--sp-3); padding-left: 10px; border-left: 3px solid var(--accent); line-height: 1.35;
}
.side-list { list-style: none; margin: 0; padding: 0; }
.side-list li {
  display: flex; gap: var(--sp-2); align-items: baseline;
  padding: 7px 0; border-bottom: 1px solid var(--border); font-size: var(--fs-sm);
}
.side-list li:last-child { border-bottom: 0; }
.side-list li a { color: var(--text-2); }
.side-list li a:hover { color: var(--accent-ink); text-decoration: none; }
.side-rank {
  flex: none; width: 20px; height: 20px; border-radius: var(--radius-xs);
  background: var(--bg-soft); color: var(--muted); font-size: var(--fs-2xs); font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center; font-variant-numeric: tabular-nums;
}
.side-rank.is-top { background: var(--accent); color: var(--on-accent); }
.side-meta { margin-left: auto; color: var(--muted); font-size: var(--fs-2xs); flex: none; }
.side-chips { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.side-tags { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- ④-7 单篇 ---------- */
.breadcrumb { font-size: var(--fs-xs); color: var(--muted); margin: var(--sp-5) 0 var(--sp-2); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--accent-ink); }
.breadcrumb-sep { opacity: .55; }
.single-head { margin-bottom: var(--sp-5); padding-bottom: var(--sp-4); border-bottom: 1px solid var(--border); }
.single-title { overflow-wrap: anywhere; font-size: clamp(1.375rem, 1.2rem + 1.05vw, 1.875rem); line-height: 1.3; letter-spacing: -.02em; font-weight: 800; }
.single-meta { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-3); align-items: center; font-size: var(--fs-xs); color: var(--muted); }
.single-meta time { font-variant-numeric: tabular-nums; }
.single-updated { color: var(--warn-fg); }
.single-author { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); font-weight: 550; }
.single-author::before {
  content: ""; width: 18px; height: 18px; border-radius: 50%;
  background: var(--accent-soft); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent);
}
.single-author:hover { color: var(--accent-ink); }
.single-tags { margin-top: var(--sp-3); display: flex; flex-wrap: wrap; gap: 6px; }
.single-cover { margin: 0 0 var(--sp-5); border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--border); }
.single-cover .cover-img { width: 100%; aspect-ratio: 16 / 8; object-fit: cover; display: block; }

.keypoints {
  background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
  border-radius: var(--radius); padding: var(--sp-4) 22px; margin: 0 0 var(--sp-5);
}
.keypoints h2 { font-size: var(--fs-sm); color: var(--accent-ink); margin: 0 0 var(--sp-2); letter-spacing: .02em; }
.keypoints ul { margin: 0; padding-left: 1.2em; }
.keypoints li { font-size: var(--fs-sm); margin: 4px 0; text-wrap: pretty; }

/* TOC */
.toc { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--sp-4) 20px; margin: 0 0 var(--sp-5); font-size: var(--fs-sm); }
.toc-title { font-size: var(--fs-label); font-weight: 650; letter-spacing: var(--ls-label); text-transform: uppercase; color: var(--muted); margin: 0 0 var(--sp-2); }
.toc ol { margin: 0; padding-left: 0; list-style: none; }
.toc li { margin: 3px 0; }
.toc li > a { color: var(--text-2); }
.toc li > a.is-active { color: var(--accent-ink); font-weight: 600; }
.toc-sub { padding-left: 1.4em; font-size: var(--fs-xs); }
.side-box .toc { background: none; border: 0; border-radius: 0; padding: 0; margin: 0; }
.side-box .toc ol { border-left: 2px solid var(--border); }
.side-box .toc li { margin: 0; }
.side-box .toc li > a {
  display: block; padding: 5px 0 5px 12px; margin-left: -2px;
  border-left: 2px solid transparent; color: var(--text-2); line-height: 1.5;
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.side-box .toc li > a:hover { color: var(--text); }
.side-box .toc li > a.is-active { color: var(--accent-ink); border-left-color: var(--accent); font-weight: 600; }
.toc-box:empty, .single-toc-slot:empty { display: none; }
/* JS 把目录搬到窄屏正文槽位后给空壳加 hidden：display:none 不能让 .side-box + .side-box
   相邻选择器失效（它按 DOM 相邻判定），必须显式摘掉残留的分割线/间距 */
.toc-box[hidden] + .side-box { border-top: 0; margin-top: 0; padding-top: 0; }

/* ---------- ④-8 正文 ----------
   中文可读性：17px+ / 1.8，单行 ≈40 字 */
.prose { font-size: var(--prose-fs); line-height: var(--prose-lh); color: var(--text); scroll-margin-top: var(--anchor-offset); }
.prose > :first-child { margin-top: 0; }
.prose h2, .prose h3, .prose h4, .prose h5 { scroll-margin-top: var(--anchor-offset); position: relative; }
.prose h2 { font-size: clamp(1.25rem, 1.15rem + .5vw, 1.5rem); font-weight: 700; margin: 2.2em 0 .7em; padding-bottom: .4em; border-bottom: 1px solid var(--border); }
.prose h3 { font-size: clamp(1.0625rem, 1rem + .3vw, 1.1875rem); font-weight: 650; margin: 1.9em 0 .55em; }
.prose h4 { font-size: var(--fs-lg); font-weight: 650; margin: 1.7em 0 .5em; color: var(--text-2); }
/* 标题锚点由 theme.js 插入，绝对定位到左外侧，不占行内空间 */
.heading-anchor {
  position: absolute; left: -.85em; top: 0;
  color: var(--muted); font-weight: 400; text-decoration: none;
  opacity: 0; transition: opacity var(--dur) var(--ease), color var(--dur) var(--ease);
}
.prose h2:hover > .heading-anchor, .prose h3:hover > .heading-anchor, .prose h4:hover > .heading-anchor,
.heading-anchor:focus-visible { opacity: .75; }
.heading-anchor:hover { color: var(--accent-ink); opacity: 1; text-decoration: none; }
.prose p { text-wrap: pretty; margin: 0 0 1.25em; }
.prose ul, .prose ol { margin: 0 0 1.25em; padding-left: 1.5em; }
.prose li { margin: .3em 0; }
.prose li::marker { color: var(--muted); }
.prose strong { font-weight: 650; color: var(--text); }
.prose a {
  text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px;
  text-decoration-color: color-mix(in srgb, var(--accent) 45%, transparent);
}
.prose a:hover { text-decoration-color: var(--accent); }
.prose blockquote {
  margin: 1.5em 0; padding: 12px 20px; border-left: 3px solid var(--accent);
  background: var(--surface-2); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; color: var(--text-2);
}
.prose blockquote > :last-child { margin-bottom: 0; }
.prose img { border-radius: var(--radius-sm); border: 1px solid var(--border); }
.prose figure { margin: 1.6em 0; }
.prose figcaption { margin-top: .5em; font-size: var(--fs-xs); color: var(--muted); text-align: center; }
.prose hr { border: 0; border-top: 1px solid var(--border); margin: 2.4em 0; }
.prose .ta-c { text-align: center; } .prose .ta-r { text-align: right; } .prose .ta-l { text-align: left; }
.prose table { width: max-content; min-width: 100%; border-collapse: collapse; margin: 1.5em 0; font-size: var(--fs-sm); display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--border); padding: 9px 12px; text-align: left; }
.prose th { background: var(--surface-2); font-weight: 600; }
.prose tbody tr:nth-child(2n) { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }

/* ---------- ④-9 代码 ---------- */
.prose code { font-family: var(--font-mono); font-size: .88em; }
.prose :not(pre) > code { background: var(--code-bg); border: 1px solid var(--border); padding: .12em .4em; border-radius: var(--radius-xs); cursor: pointer; }
.prose :not(pre) > code::after { content: attr(data-msg); margin-left: 6px; font-size: var(--fs-2xs); color: var(--accent-ink); }
.prose pre {
  background: var(--code-bg); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 14px 16px; overflow-x: auto; font-size: var(--fs-sm); line-height: 1.7;
  margin: 0; tab-size: 2; scrollbar-width: thin;
}
.code-block { position: relative; margin: 1.5em 0; }
.code-block::before {
  content: attr(data-lang); position: absolute; top: 0; left: 12px; transform: translateY(-50%);
  font-family: var(--font-mono); font-size: var(--fs-2xs); letter-spacing: .04em;
  color: var(--muted); background: var(--bg); border: 1px solid var(--border);
  padding: 0 6px; border-radius: var(--radius-pill); z-index: 2;
}
.code-block:not([data-lang])::before { display: none; }
.code-copy {
  position: absolute; top: 8px; right: 8px; z-index: 3;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--muted);
  border-radius: var(--radius-xs); font-size: var(--fs-2xs); padding: 3px 10px; cursor: pointer;
  opacity: 0; transition: opacity var(--dur) var(--ease), color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.code-block:hover .code-copy, .code-copy:focus-visible, .code-copy.is-done, .code-copy.is-fail { opacity: 1; }
.code-copy.is-done { color: var(--ok-fg); border-color: var(--ok-bd); }
.code-copy.is-fail { color: var(--err-fg); border-color: var(--err-bd); }
@media (hover: none) { .code-copy { opacity: 1; } }
.tok-kw { color: var(--tok-kw); font-weight: 600; } .tok-str { color: var(--tok-str); }
.tok-com { color: var(--tok-com); font-style: italic; } .tok-num { color: var(--tok-num); }
.tok-fn { color: var(--tok-fn); } .tok-tag { color: var(--tok-tag); }

/* ---------- ④-10 容器（FAQ / :::） ---------- */
.faq { margin: 1.2em 0; }
.faq-item { border: 1px solid var(--border); border-radius: var(--radius-sm); margin: var(--sp-2) 0; background: var(--surface); overflow: hidden; }
.faq-item summary { cursor: pointer; padding: 11px 14px; font-weight: 600; font-size: var(--fs-sm); }
.faq-item summary:hover { background: var(--surface-2); }
.faq-answer { padding: 0 14px 12px; font-size: var(--fs-sm); color: var(--text-2); }
.ctx { margin: 1.2em 0; }
.ctx-tabs { border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; margin: 1.2em 0; }
.ctx-tabs-bar { display: flex; flex-wrap: wrap; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.ctx-tab {
  border: 0; background: none; padding: 9px 16px; font-size: var(--fs-sm);
  color: var(--text-2); cursor: pointer; border-bottom: 2px solid transparent;
  transition: color var(--dur) var(--ease), background-color var(--dur) var(--ease);
}
.ctx-tab:hover { color: var(--text); }
.ctx-tab.is-active { color: var(--accent-ink); border-bottom-color: var(--accent); background: var(--surface); }
.ctx-panel { padding: 4px 16px 12px; background: var(--surface); }
.ctx-details { border: 1px solid var(--border); border-radius: var(--radius-sm); margin: 1em 0; background: var(--surface); overflow: hidden; }
.ctx-details summary { cursor: pointer; padding: 11px 14px; font-weight: 600; font-size: var(--fs-sm); }
.ctx-details summary:hover { background: var(--surface-2); }
.ctx-details > *:not(summary) { padding: 0 14px; }

/* ---------- ④-11 上下篇 / 相关 ---------- */
.single-foot { display: flex; gap: var(--sp-2); margin: var(--sp-6) 0 var(--sp-2); padding-top: var(--sp-5); border-top: 1px solid var(--border); flex-wrap: wrap; }
.single-foot .btn { border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font-size: var(--fs-xs); padding: 7px 16px; border-radius: var(--radius-pill); }
.single-foot .btn:hover { border-color: var(--accent); color: var(--accent-ink); background: var(--accent-soft); }
.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-3); margin: var(--sp-4) 0 var(--sp-6); }
.post-nav-link {
  display: flex; flex-direction: column; gap: 6px; padding: var(--sp-4) 20px;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
  transition: border-color var(--dur) var(--ease), transform var(--dur) var(--ease),
              box-shadow var(--dur) var(--ease), background-color var(--dur) var(--ease);
}
.post-nav-link.is-next { text-align: right; }
.post-nav-link:hover { text-decoration: none; border-color: var(--accent); background: var(--accent-soft); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.post-nav-label { font-size: var(--fs-2xs); color: var(--muted); letter-spacing: .02em; }
.post-nav-link[rel="prev"] .post-nav-label::before { content: "← "; }
.post-nav-link.is-next .post-nav-label::after { content: " →"; }
.post-nav-title { font-size: var(--fs-sm); font-weight: 550; color: var(--text); }
.post-nav-link.is-empty { visibility: hidden; }
.related { margin: var(--sp-5) 0; padding-top: var(--sp-5); border-top: 1px solid var(--border); }
.related-list { list-style: none; margin: 0; padding: 0; }
.related-list li { border-bottom: 1px solid var(--border); }
.related-list a { display: flex; justify-content: space-between; gap: var(--sp-3); padding: 11px 2px; align-items: baseline; }
.related-list a:hover { text-decoration: none; }
.related-title { color: var(--text); font-size: var(--fs-sm); }
.related-list a:hover .related-title { color: var(--accent-ink); }
.related-meta { color: var(--muted); font-size: var(--fs-2xs); flex: none; }

/* ---------- ④-12 评论 / 表单 ---------- */
.comments { margin: var(--sp-7) 0 0; padding-top: var(--sp-6); border-top: 1px solid var(--border); }
.comments-title { font-size: var(--fs-h3); font-weight: 700; }
.comment-list, .comment-children { list-style: none; margin: 0; padding: 0; }
.comment-children { margin-left: 28px; border-left: 2px solid var(--border); padding-left: var(--sp-4); }
.comment { padding: var(--sp-3) 0; border-bottom: 1px solid var(--border); }
.comment-head { display: flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-xs); }
.comment-avatar {
  width: 28px; height: 28px; border-radius: var(--radius-pill);
  background: var(--accent-soft); color: var(--accent-ink);
  display: inline-flex; align-items: center; justify-content: center; font-weight: 700; flex: none;
}
.comment-author { font-weight: 600; }
.comment-time { color: var(--muted); font-variant-numeric: tabular-nums; }
.comment-reply { margin-left: auto; font-size: var(--fs-2xs); }
.comment-body { margin-top: 6px; font-size: var(--fs-sm); color: var(--text-2); overflow-wrap: anywhere; text-wrap: pretty; }

.comment-form, .contact-form {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 20px 22px; margin-top: var(--sp-4);
  box-shadow: var(--shadow-sm);
}
.comment-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-3); }
.comment-form label, .contact-form label { display: block; font-size: var(--fs-xs); color: var(--muted); margin-bottom: 5px; }
.comment-form input, .comment-form textarea, .contact-form input, .contact-form textarea,
.search-form input, .pw-card input {
  width: 100%; padding: 10px 12px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--bg); color: var(--text); font-family: inherit; font-size: var(--fs-sm);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.comment-form textarea, .contact-form textarea { resize: vertical; line-height: 1.7; }
.comment-form input:focus, .comment-form textarea:focus,
.contact-form input:focus, .contact-form textarea:focus,
.search-form input:focus, .pw-card input:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent);
}
.comment-form p, .contact-form p { margin: 0 0 var(--sp-3); }
.replying { background: var(--accent-soft); border-radius: var(--radius-sm); padding: 6px 10px; font-size: var(--fs-xs); }
/* 验证码行：图片本身就是「换一张」（JS 在位就地换 token，无 JS 时是 ?c=refresh 链接） */
.captcha-row { display: flex; align-items: center; gap: 10px; margin-bottom: var(--sp-3); flex-wrap: wrap; }
.captcha-refresh { position: relative; display: inline-flex; flex: none; border-radius: var(--radius-sm); line-height: 0; }
.captcha-img { border-radius: var(--radius-sm); border: 1px solid var(--border); display: block; max-width: 100%; height: auto; }
.captcha-q { font-family: var(--font-mono); background: var(--bg-soft); padding: 6px 12px; border-radius: var(--radius-sm); letter-spacing: .1em; font-size: var(--fs-lg); line-height: 1.4; }
.captcha-badge {
  position: absolute; left: 8px; bottom: 8px; padding: 2px 8px; border-radius: 999px;
  font-size: var(--fs-xs); font-weight: 600; line-height: 1.6; letter-spacing: 0;
  background: var(--accent); color: var(--on-accent);
  opacity: 0; transform: translateY(3px); pointer-events: none;
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.captcha-refresh:hover .captcha-badge, .captcha-refresh:focus-visible .captcha-badge { opacity: 1; transform: none; }
/* 触屏没有 hover：角标常驻，否则「图片可点」这件事没人知道 */
@media (hover: none) { .captcha-badge { opacity: .92; transform: none; } }
.captcha-refresh.is-busy { opacity: .55; pointer-events: none; }
.captcha-hint { flex: 1 1 100%; font-size: var(--fs-xs); color: var(--muted); line-height: 1.6; }
.captcha-row input { max-width: 140px; }
.hp { position: absolute; left: -9999px; height: 1px; overflow: hidden; }
.notice { padding: 10px 14px; border-radius: var(--radius-sm); font-size: var(--fs-sm); margin: var(--sp-3) 0; }
.notice-success { background: var(--ok-bg); color: var(--ok-fg); border: 1px solid var(--ok-bd); }
.notice-error { background: var(--err-bg); color: var(--err-fg); border: 1px solid var(--err-bd); }
.notice-info { background: var(--accent-soft); color: var(--accent-ink); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); }

/* ---------- ④-13 归档 / 作者 / 时间线 ---------- */
/* 头部两行式（分类/标签/归档共用）：上方不再画分割线，保留下方分割线作为列表上缘分隔 */
.archive-head { margin: var(--sp-6) 0 0; padding: var(--sp-4) 2px var(--sp-4); border-bottom: 1px solid var(--border); }
.author-head { margin: var(--sp-6) 0 var(--sp-5); display: flex; flex-direction: column; align-items: center; text-align: center; }
.eyebrow { font-size: var(--fs-label); font-weight: 600; letter-spacing: var(--ls-label); text-transform: uppercase; color: var(--accent-ink); margin: 0 0 6px; }
.archive-title { font-size: var(--fs-h1); font-weight: 800; margin: 0 0 var(--sp-2); }
.archive-count { color: var(--muted); font-size: var(--fs-xs); margin: 0 0 var(--sp-3); font-variant-numeric: tabular-nums; }
/* 头部两行式：第一行「标题 + 眉标」、第二行「共 N 篇 + Markdown 索引」，各占一行 */
.archive-title-row { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin: 0 0 var(--sp-2); }
.archive-title-row .archive-title, .archive-title-row .eyebrow { margin: 0; }
.archive-meta-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.archive-meta-row .archive-count { margin: 0; }
.author-avatar {
  width: 68px; height: 68px; border-radius: var(--radius-pill);
  background: var(--accent-soft); color: var(--accent-ink); font-size: 1.7rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center; margin-bottom: var(--sp-3);
}
.author-bio { color: var(--text-2); font-size: var(--fs-sm); max-width: 36em; }
.timeline-year { margin: var(--sp-6) 0; }
.timeline-year-label { font-size: var(--fs-h2); font-weight: 800; color: var(--accent-ink); margin-bottom: 10px; }
.timeline-label { font-size: var(--fs-sm); color: var(--muted); margin: var(--sp-4) 0 6px; }
.timeline-list { list-style: none; margin: 0; padding: 0; }
.timeline-list li { display: flex; gap: 14px; padding: 6px 0; border-bottom: 1px solid var(--border); font-size: var(--fs-sm); }
.timeline-list time { color: var(--muted); font-variant-numeric: tabular-nums; flex: none; }
.timeline-list a:hover { text-decoration: none; color: var(--accent-ink); }

/* ---------- ④-14 搜索 / 留言 ---------- */
.search-form { display: flex; gap: var(--sp-2); margin: var(--sp-4) 0 var(--sp-3); }
.search-form input { flex: 1; }
.engine-picker { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin: var(--sp-2) 0 var(--sp-4); }
/* 胶囊是 <button form="geo-search-form" name="engine">：无 JS 也能切换引擎 */
.engine-pill {
  padding: 5px 14px; background: none;
  border: 1px solid var(--border-strong); border-radius: var(--radius-pill);
  font: inherit; font-size: var(--fs-xs); line-height: 1.6; color: var(--text-2); cursor: pointer;
  transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.engine-pill:hover { border-color: var(--accent); color: var(--accent-ink); }
.engine-pill.is-active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.engine-pill:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.results-line { color: var(--muted); font-size: var(--fs-xs); margin: var(--sp-2) 0 var(--sp-4); }
.fallback-line { color: var(--text-2); font-size: var(--fs-sm); }

/* ---------- ④-15 口令 / 404 ---------- */
.pw-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: var(--sp-6); margin: var(--sp-7) auto; box-shadow: var(--shadow-sm); }
.pw-card input { max-width: 280px; }
.pw-hint { color: var(--text-2); font-size: var(--fs-sm); }
.not-found { padding: var(--sp-8) 0; }
.nf-code {
  font-size: clamp(3.5rem, 2.5rem + 5vw, 5rem); font-weight: 800; line-height: 1; margin: 0; letter-spacing: -.04em;
  background: linear-gradient(135deg, var(--accent), var(--accent-ink));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: var(--accent); /* 不支持背景裁剪时回落纯色 */
}
.nf-links { display: flex; gap: var(--sp-2); justify-content: center; margin-top: var(--sp-4); flex-wrap: wrap; }

/* ---------- ④-16 分页 ---------- */
.pager { display: flex; justify-content: center; align-items: center; gap: var(--sp-2); margin: var(--sp-6) 0; font-size: var(--fs-sm); }
.pager-link {
  padding: 8px 18px; border: 1px solid var(--border-strong); border-radius: var(--radius-pill);
  background: var(--surface); color: var(--text); font-weight: 550;
  transition: border-color var(--dur) var(--ease), color var(--dur) var(--ease),
              background-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.pager-link:hover { border-color: var(--accent); color: var(--accent-ink); text-decoration: none; background: var(--accent-soft); }
.pager-cur { color: var(--muted); font-variant-numeric: tabular-nums; padding: 0 var(--sp-2); }

/* ---------- ④-17 页脚 ---------- */
.site-foot { border-top: 1px solid var(--border-strong); background: var(--band); margin-top: var(--sp-8); }
.foot-top { padding: var(--sp-7) 0 var(--sp-6); display: grid; grid-template-columns: minmax(240px, 1.2fr) 2fr; gap: var(--sp-6); }
.foot-title { font-weight: 750; font-size: var(--fs-lg); margin: 0 0 var(--sp-2); }
.foot-about { color: var(--text-2); font-size: var(--fs-sm); line-height: 1.75; margin: 0; max-width: 34em; text-wrap: pretty; }
.foot-brand-text { color: var(--text-2); font-size: var(--fs-sm); line-height: 1.75; }
/* 子主题继承父主题的 footer.php 会用到这些类，techlog 只加载自身 style.css，必须自带 */
.foot-brand { display: flex; flex-direction: column; gap: 6px; }
.pw-hint-ttl { color: var(--muted); font-size: 0.82rem; }
.timeline-month { margin: 0 0 12px; }
.foot-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.foot-col-title { font-size: var(--fs-xs); font-weight: 650; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; }
.foot-col ul { list-style: none; margin: 0; padding: 0; }
.foot-col a { font-size: var(--fs-sm); color: var(--text-2); display: inline-block; padding: 3px 0; }
.foot-col a:hover { color: var(--accent-ink); }
.foot-bottom {
  border-top: 1px solid var(--border); padding: var(--sp-4) 0 var(--sp-5);
  display: flex; justify-content: space-between; align-items: center; gap: var(--sp-4); flex-wrap: wrap;
}
.foot-slot { text-align: right; }
.foot-slot .copyright { margin: 0; color: var(--muted); font-size: var(--fs-xs); }
.foot-credit { font-size: var(--fs-xs); color: var(--muted); display: flex; flex-direction: column; gap: 4px; }
.foot-credit a { color: var(--muted); }
.foot-credit a:hover { color: var(--accent-ink); }
.foot-bottom > .foot-credit { margin-left: auto; text-align: right; }
.foot-credit-custom { color: var(--muted); }

/* ---------- ⑤ 响应式 ---------- */
@media (max-width: 1120px) {
  .list-layout, .single-layout { grid-template-columns: 1fr; }
  .list-layout:not(.is-solo) .list-main, .single-layout:not(.is-solo) .single-main {
    border-right: 0; border-left: 0; margin-right: 0; margin-left: 0; padding-right: 0; padding-left: 0;
  }
  .list-layout:not(.is-solo)::after, .single-layout:not(.is-solo)::after { content: none; }
  .site-side { position: static; max-height: none; margin-top: var(--sp-6); }
  .list-layout.is-solo .list-main, .single-layout.is-solo .single-main { max-width: none; margin: 0; }
}
@media (max-width: 900px) {
  .brand-slogan { display: none; }
  /* ⚠ 汉堡入口与断点必须一致（与父主题 ink-v3 同步）：原先 ≤900px 改横向滚动、
     汉堡却 ≤760px 才出现 ⇒ 761–900px 区间菜单溢出且不可达。整套抽屉上移到 900px。 */
  .nav-toggle { display: block; }
  .site-nav {
    display: none; position: absolute; top: var(--head-h); left: 0; right: 0;
    background: var(--surface); border-bottom: 1px solid var(--border);
    margin: 0; box-shadow: var(--shadow-pop);
  }
  .site-nav.is-open { display: block; animation: geo-drop .18s var(--ease); }
  @keyframes geo-drop { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
  .nav-list { flex-direction: column; align-items: stretch; padding: var(--sp-2); gap: 2px; }
  .nav-item > a { display: block; border-radius: var(--radius-sm); }
    .nav-item.nav-search { margin-left: 0; }
  .nav-sub { position: static; box-shadow: none; border: 0; background: none; display: none; padding-left: var(--sp-4); }
  .nav-item.is-open .nav-sub { display: block; }
  .foot-top { grid-template-columns: 1fr; gap: var(--sp-5); }
  /* 三列在 531–900px 会把中长分类名压进 ~150px 列宽，塌成两列更早更稳 */
  .foot-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  :root { --head-h: 62px; --gutter: 20px; }
  .hero-center-inner { padding: var(--sp-7) var(--gutter) var(--sp-6); }
  .hero-center.is-image.has-bg .hero-center-inner { padding: var(--sp-8) var(--gutter) var(--sp-7); }
  .hero-display { font-size: clamp(1.75rem, 7vw, 2.4rem); }
  .hero-lead { font-size: var(--fs-md); }
  .hero-actions .btn { width: 100%; }
  .post-row { padding: var(--sp-4) 0; }
  .post-row::before { left: -12px; }
  .card-body { padding: var(--sp-4) 20px; }
  .foot-bottom { flex-direction: column; align-items: flex-start; }
  .foot-bottom > .foot-credit { margin-left: 0; text-align: left; }
  .foot-slot { text-align: left; }
  /* 防 iOS 聚焦缩放：必须覆盖 textarea —— 评论/留言正文区是最主要的输入控件 */
  .comment-form input, .comment-form textarea,
  .contact-form input, .contact-form textarea { font-size: 16px; }
}
@media (max-width: 530px) {
  .post-nav { grid-template-columns: 1fr; }
  .post-nav-link.is-empty { display: none; }
  .comment-grid { grid-template-columns: 1fr; }
  .foot-cols { grid-template-columns: 1fr; }
}

/* 尊重系统的「减少动效」偏好：一次性关掉全部过渡与动画 */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* ---------- ⑥ 打印 ---------- */
@media print {
  .site-head, .site-foot, .toc, .single-foot, .related, .pager, .skip, .site-side,
  .post-nav, .comments, .theme-toggle, .nav-toggle, .code-copy, .hero-center,
  .breadcrumb, .reading-bar, .to-top, .side-contact, .heading-anchor, .single-toc-slot { display: none !important; }
  body { font-size: 12pt; color: #000; background: #fff; }
  .prose { font-size: inherit; }
  .prose a { color: #000; text-decoration: underline; }
  .prose pre, .prose blockquote { border: 1px solid #999; background: #fff; }
  .single-layout, .list-layout { display: block; }
  .card { border: 1px solid #999; box-shadow: none; break-inside: avoid; }
}


/* ---------- Windows 高对比度（forced-colors）----------
   按钮/卡片/侧栏盒/提示条的表意主要靠底色与 1px 边框，强制配色会把
   background / border-color 全部丢弃 ⇒ 块与块糊成一片。这里补回系统色边框。 */
@media (forced-colors: active) {
  .btn, .chip, .card, .side-box, .notice, .toc, .keypoints, .post-row { border: 1px solid CanvasText; }
  .btn-primary { background: ButtonFace; border-color: ButtonText; color: ButtonText; }
  .btn-ghost { background: transparent; }
  .side-rank, .side-rank.is-top { background: Canvas; color: CanvasText; border: 1px solid CanvasText; }
  a { text-decoration: underline; }
}