/* ============================================================
   sign.red × 收藏夹
   风格真源：/Users/OneDark/Downloads/瞬知智能/瞬知-TailGrids样张/index.html
   —— 大留白 / 层级全靠 1px 边框 / 唯一强调色红只做极小点缀 / 吸顶元素半透模糊
   ============================================================ */

:root {
  color-scheme: light dark;

  --bg: #ffffff;
  --bg-soft: #f6f6f7;
  --fg: #17171a;
  --fg-soft: #3d3d44;
  --muted: #6c6c76;
  --faint: #9a9aa4;
  --line: #e7e7ea;
  --line-soft: #f0f0f2;

  --accent: #c8102e;
  --accent-soft: rgba(200, 16, 46, 0.07);

  --code-bg: #f5f5f7;
  --code-fg: #242430;

  --tok-string: #0a7b52;
  --tok-number: #9a5b00;
  --tok-func: #0b5cad;

  --r: 3px;
  /* 正文列宽 44rem → 48rem（用户反馈正文太窄） */
  --maxw: 48rem;
  /* 整页骨架宽度：回到收藏夹改造前的 60rem（改造时对齐真源放大到 100rem，用户反馈太宽） */
  --maxw-wide: 60rem;
  /* 左侧目录宽度：改成 fixed 后正文不再为它让宽；12rem → 10rem，
     最长标签「2026 年 10 月」够用，又不至于让文字和正文之间空一截 */
  --side-w: 10rem;
  /* 侧栏右缘与正文左缘的间距：1.25rem → 2.5rem（2026-10-12 用户要求加大呼吸感）。
     门槛 1220px 下 left = (1220-768)/2 - 160 - 40 = 26px，够宽，不会撞到 max(1rem,…) 下限。 */
  --side-gap: 2.5rem;
  --header-h: 3.5rem;

  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro SC", "SF Pro Text", "Segoe UI",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --font-brand: "Caveat", "Sacramento", var(--font-sans);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16171a;
    --bg-soft: #1c1d21;
    --fg: #ececf0;
    --fg-soft: #c9c9d1;
    --muted: #9b9ba6;
    --faint: #6e6e78;
    --line: #2a2b30;
    --line-soft: #232429;

    --accent: #ff5566;
    --accent-soft: rgba(255, 85, 102, 0.14);

    --code-bg: #1b1c20;
    --code-fg: #e4e4ea;

    --tok-string: #7fd6a8;
    --tok-number: #e5b567;
    --tok-func: #7cb7ff;
  }
}

/* 品牌签名用的手写体（仅 latin 子集，自托管，51KB） */
@font-face {
  font-family: "Caveat";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/assets/fonts/caveat-600-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215,
    U+FEFF, U+FFFD;
}

/* 品牌手写体换成 Sacramento（细连笔，贴合参考图），仅 latin 子集 23KB 自托管。
   Caveat 保留在上面做兜底（分享页/旧样式可能引用）。 */
@font-face {
  font-family: "Sacramento";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/sacramento-400-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215,
    U+FEFF, U+FFFD;
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 1.25rem);
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.78;
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
}

::selection { background: var(--accent); color: #fff; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

a { color: inherit; text-decoration: none; }

img,
video { max-width: 100%; height: auto; }

/* ---------------------------------------------------------- 排版基线 */

h1, h2, h3, h4 { line-height: 1.35; letter-spacing: -0.01em; }

h1 {
  margin: 0 0 0.6rem;
  font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.15rem);
  font-weight: 700;
}

h2 {
  margin: 2.6rem 0 0.9rem;
  font-size: 1.12rem;
  font-weight: 650;
  scroll-margin-top: calc(var(--header-h) + 1.25rem);
}

/* 二级标题前那根 3px 红竖线 —— 全站唯一的大一点的红 */
h2::before {
  content: "";
  display: inline-block;
  width: 3px;
  height: 0.86em;
  background: var(--accent);
  border-radius: 1px;
  margin-right: 0.5rem;
  vertical-align: -0.06em;
}

h3 { margin: 1.6rem 0 0.5rem; font-size: 0.95rem; font-weight: 650; }

p { margin: 0 0 1rem; color: var(--fg-soft); }

ul, ol { margin: 0 0 1rem; padding-left: 1.15rem; color: var(--fg-soft); }
li { margin: 0.3rem 0; }
li::marker { color: var(--faint); }

strong { color: var(--fg); font-weight: 650; }

code {
  font-family: var(--font-mono);
  font-size: 0.87em;
  background: var(--bg-soft);
  border: 1px solid var(--line-soft);
  border-radius: 2px;
  padding: 0.1em 0.35em;
  color: var(--fg-soft);
}

blockquote {
  margin: 0 0 1.2rem;
  padding: 0.1rem 0 0.1rem 1rem;
  border-left: 2px solid var(--accent);
  color: var(--muted);
  font-size: 0.9rem;
}

hr { border: 0; border-top: 1px solid var(--line-soft); margin: 2.4rem 0; }

/* ---------------------------------------------------------- 顶栏 */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(14px) saturate(1.8);
  -webkit-backdrop-filter: blur(14px) saturate(1.8);
  border-bottom: 1px solid var(--line-soft);
}

.site-header__inner {
  max-width: var(--maxw-wide);
  margin: 0 auto;
  padding: 0 clamp(1rem, 4vw, 2rem);
}

/* 2026-10-07：bar 与正文列同宽（--maxw）同居中 ⇒ LOGO 贴正文左缘、搜索框贴正文右缘，
   任何视口宽度下都跟 .content 的左右缘严格对齐（两者用同一套 max-width + padding 公式） */
.site-header__bar {
  height: var(--header-h);
  max-width: var(--maxw);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* 左上角品牌：手写体 Caveat（2026-10-12 由 Sacramento 换回——Sacramento 笔画过细、识别度低）。
   整词品牌红。Caveat 字重档位全、视觉比 Sacramento 饱满，故恢复 font-size 1.6rem、
   font-weight 600（Sacramento 时期为 1.9rem / 400）。 */
.brand {
  position: relative;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  flex: none;
  font-family: var(--font-brand);
  font-weight: 600;
  font-size: 1.6rem;
  line-height: 1;
  letter-spacing: 0.01em;
  color: var(--accent);
  padding-bottom: 0.22rem;
  border-radius: 2px;
}

/* 悬停：红色下划线自左向右展开（留言板时期保留的动效） */
.brand::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1.5px;
  border-radius: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform 0.3s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.brand:hover::after,
.brand:focus-visible::after { transform: scaleX(1); }

.brand__mark { font-weight: 400; }
.brand__dot { color: var(--accent); }
.brand:hover { color: var(--accent); }

.site-header__sp { flex: 1; }

.site-nav { display: flex; align-items: center; gap: 1rem; flex: none; }

.site-nav a {
  font-size: 0.82rem;
  color: var(--muted);
  white-space: nowrap;
  border-bottom: 1px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.site-nav a:hover { color: var(--fg); border-bottom-color: var(--accent); }
.site-nav a[aria-current="page"] { color: var(--fg); border-bottom-color: var(--accent); }

/* ---------------------------------------------------------- 顶栏搜索框 */

.search { position: relative; flex: 0 1 15rem; min-width: 0; }

.search__input {
  width: 100%;
  height: 2rem;
  padding: 0 2.6rem 0 2rem;
  font: inherit;
  font-size: 0.82rem;
  color: var(--fg);
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease;
  -webkit-appearance: none;
  appearance: none;
}

.search__input::placeholder { color: var(--faint); }
.search__input::-webkit-search-cancel-button { display: none; }

.search__input:focus,
.search__input:focus-visible {
  outline: none;
  background: var(--bg);
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.search__icon {
  position: absolute;
  left: 0.55rem;
  top: 50%;
  transform: translateY(-50%);
  width: 0.92rem;
  height: 0.92rem;
  color: var(--faint);
  pointer-events: none;
}

.search__kbd {
  position: absolute;
  right: 0.45rem;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-mono);
  font-size: 0.66rem;
  line-height: 1;
  color: var(--faint);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.18rem 0.3rem;
  pointer-events: none;
}

.search__input:not(:placeholder-shown) ~ .search__kbd,
.search__input:focus ~ .search__kbd { opacity: 0; }

/* ---------------------------------------------------------- 布局：左侧目录 + 正文 */

/* 2026-10-07：正文要在页面里几何居中。旧版 .side 从 flex 流里占掉 13.5rem，
   正文整块被推到偏右；现在侧栏脱离文档流（fixed 浮在左侧留白），正文靠 margin auto 居中。 */
.frame {
  flex: 1 0 auto;
  width: 100%;
  max-width: var(--maxw-wide);
  margin: 0 auto;
  padding: 0 clamp(1rem, 4vw, 2rem) 6rem;
  display: block;
}

.side {
  position: fixed;
  top: calc(var(--header-h) + 3rem);
  left: max(1rem, calc((100vw - var(--maxw)) / 2 - var(--side-w) - var(--side-gap)));
  width: var(--side-w);
  display: none;
  max-height: calc(100vh - var(--header-h) - 4rem);
  overflow-y: auto;
}

/* 条目：线性图标 + 文字 +（可选）条数。未选中灰、hover 转深、
   选中 = 深色加粗 + 左侧 2px 红竖线（参考图那根竖线，配色按本站红）。
   未选中不再画灰色导轨（参考图里只有选中项有竖线）。 */
.side a {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.83rem;
  line-height: 1.4;
  color: var(--muted);
  padding: 0.42rem 0 0.42rem 0.72rem;
  border-left: 2px solid transparent;
  white-space: nowrap;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.side a .side__icon {
  flex: none;
  width: 1.05rem;
  height: 1.05rem;
  color: var(--faint);
  transition: color 0.15s ease;
}

.side a .side__text { overflow: hidden; text-overflow: ellipsis; }

.side a:hover { color: var(--fg); }
.side a:hover .side__icon { color: var(--fg); }

.side a.on { color: var(--fg); font-weight: 600; border-left-color: var(--accent); }
.side a.on .side__icon { color: var(--fg); }

.side a i {
  font-style: normal;
  margin-left: auto;
  padding-left: 0.4rem;
  color: var(--faint);
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
}

.content {
  min-width: 0;
  max-width: var(--maxw);
  margin: 0 auto;
  padding-top: 2.6rem;
}

.content--wide { max-width: 58rem; }

/* 窄屏目录条：吸顶、半透模糊 */
.toc {
  position: sticky;
  top: var(--header-h);
  z-index: 19;
  margin: 0 0 1.5rem;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(14px) saturate(1.8);
  -webkit-backdrop-filter: blur(14px) saturate(1.8);
  border-bottom: 1px solid var(--line-soft);
  font-size: 0.85rem;
}

.toc summary {
  list-style: none;
  cursor: pointer;
  padding: 0.7rem 1rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.toc summary::-webkit-details-marker { display: none; }
.toc summary::after { content: "▾"; margin-left: auto; color: var(--faint); }
.toc[open] summary::after { content: "▴"; }

.toc__inner { max-height: 52vh; overflow: auto; padding: 0 1rem 0.9rem; }

.toc a {
  display: block;
  padding: 0.4rem 0;
  color: var(--muted);
  border-bottom: 1px solid var(--line-soft);
}

.toc a:last-child { border-bottom: 0; }
.toc a:hover { color: var(--accent); }

/* 侧栏改 fixed 后要「居中正文的左边留白」装得下它才显示：
   48rem 正文 + 2×(12rem 侧栏 + 2rem 间距) = 768 + 448 = 1216px，故门槛 1060 → 1220px。
   1060–1220px 这段落回窄屏的吸顶 <details> 目录条。 */
@media (min-width: 1220px) {
  .side { display: block; }
  .toc { display: none; }
  .content { padding-top: 3rem; }
}

/* ---------------------------------------------------------- 题头 */

/* 大标题「记录 × 收藏夹」里那个红色的 ×：左右留白，不与文字挤在一起 */
.title-x {
  color: var(--accent);
  margin: 0 0.22em;
  font-weight: 600;
}

.lede { font-size: 1rem; color: var(--muted); max-width: 42rem; margin-bottom: 1.8rem; }

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.55rem;
  margin: 0 0 2rem;
  padding: 0;
  list-style: none;
}

.meta li {
  font-size: 0.74rem;
  color: var(--muted);
  background: var(--bg-soft);
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  padding: 0.16rem 0.6rem;
}

.meta li[hidden] { display: none; }

/* 搜索命中数：唯一的「状态」色，跟红点缀一个色 */
#hit {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 25%, transparent);
  font-variant-numeric: tabular-nums;
}

/* ---------------------------------------------------------- 卡片 */

.card {
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 1.15rem 1.25rem;
  margin: 0 0 1rem;
  background: var(--bg);
}

.card.accent { border-left: 3px solid var(--accent); background: var(--accent-soft); }
.card h3 { margin-top: 0; }
.card .rt { font-size: 0.79rem; color: var(--muted); font-family: var(--font-mono); }

.card .go {
  display: inline-block;
  margin-top: 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}

.card .go:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------------------------------------------------------- 收藏条目 */

.entry {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 1.05rem 1.2rem;
  margin: 0 0 0.7rem;
  background: var(--bg);
  transition: border-color 0.15s ease;
}

.entry:hover { border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }

/* 整块可点：标题链接的伪元素铺满整张卡，不用 JS、不改变悬停红框。
   铺满层压到 z-index:0 —— 否则它会盖住卡内所有真链接，点备注/来源里的超链接
   也被它吃掉、整卡跳同一个地址（2026-10-07 用户报的 BUG）。 */
.entry__title a::after { content: ""; position: absolute; inset: 0; z-index: 0; }
/* 卡内除标题外的每个真链接都要浮在铺满层之上，各自独立可点。
   注意不能把 .entry__title a 自己抬起来：它一旦成为定位祖先，
   inset:0 的铺满层就只覆盖标题文字、整卡可点立刻失效。 */
.entry__src a,
.entry__note a,
.entry__summary a { position: relative; z-index: 1; }

.entry__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.85rem;
}

.entry__title {
  margin: 0;
  font-size: 0.99rem;
  font-weight: 650;
  line-height: 1.5;
  min-width: 0;
}

.entry__title a { border-bottom: 1px solid transparent; transition: border-color 0.15s ease, color 0.15s ease; }
.entry__title a:hover { color: var(--accent); border-bottom-color: var(--accent); }

.entry__date {
  flex: none;
  font-size: 0.76rem;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
  font-family: var(--font-mono);
}

.entry__src {
  margin: 0.3rem 0 0;
  font-size: 0.76rem;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.entry__src a { color: var(--accent); border-bottom: 1px solid transparent; }
.entry__src a:hover { border-bottom-color: var(--accent); }
.entry__src .dot { color: var(--faint); opacity: 0.7; }

.tag {
  color: var(--muted);
  background: var(--bg-soft);
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  padding: 0.05rem 0.5rem;
  font-size: 0.72rem;
}

.entry__summary { margin: 0.5rem 0 0; font-size: 0.88rem; color: var(--muted); line-height: 1.7; }

/* 首页每张卡最多显示 3 行备注，剩下的靠整卡点击进详情页读（2026-10-07）。
   用 max-height 而不是 -webkit-line-clamp：备注是多块 markdown（段落 + 列表），
   line-clamp 的 -webkit-box 会把列表项拍平、符号错位。
   13.2px(0.88rem) × 1.7 行高 ≈ 22.4px/行，3 行 ≈ 67px。 */
.entry__note {
  margin: 0.7rem 0 0;
  font-size: 0.88rem;
  color: var(--fg-soft);
  max-height: 67px;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 15px), transparent);
  mask-image: linear-gradient(to bottom, #000 calc(100% - 15px), transparent);
}
.entry__note > *:first-child { margin-top: 0; }
.entry__note > *:last-child { margin-bottom: 0; }
.entry__note p { margin: 0.5rem 0; }
.entry__note ul, .entry__note ol { margin: 0.5rem 0; }

.entry[hidden] { display: none; }

.group[hidden] { display: none; }

.empty {
  padding: 3rem 0 5rem;
  color: var(--faint);
  text-align: center;
}

.empty[hidden] { display: none; }

/* ---------------------------------------------------------- 正文（Markdown） */

.prose { font-size: 1rem; }
.prose > *:first-child { margin-top: 0; }

.prose h2, .prose h3, .prose h4 {
  line-height: 1.35;
  letter-spacing: -0.01em;
  scroll-margin-top: calc(var(--header-h) + 1.25rem);
}

.prose h2 { margin: 2.6rem 0 0.9rem; font-size: 1.12rem; font-weight: 650; }
.prose h3 { margin: 1.6rem 0 0.5rem; font-size: 0.95rem; font-weight: 650; }
.prose h4 { margin: 1.6rem 0 0.5rem; font-size: 0.9rem; font-weight: 650; color: var(--fg-soft); }

.prose p { margin: 0 0 1rem; }

.prose a {
  color: var(--accent);
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
}

.prose a:hover { border-bottom-color: var(--accent); }

.prose ul, .prose ol { margin: 0 0 1rem; padding-left: 1.15rem; }
.prose li > ul, .prose li > ol { margin: 0.3rem 0; }

.prose li.task {
  list-style: none;
  margin-left: -1.15rem;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.prose li.task input { margin-top: 0.45em; accent-color: var(--accent); }

.prose hr { margin: 2.4rem 0; border: 0; border-top: 1px solid var(--line-soft); }

.prose img { display: block; margin: 1.9rem auto; border-radius: var(--r); }

.prose code {
  font-family: var(--font-mono);
  font-size: 0.87em;
  background: var(--bg-soft);
  color: var(--code-fg);
  padding: 0.1em 0.35em;
  border-radius: 2px;
}

.code-block { position: relative; margin: 1.4rem 0; }

.code-lang {
  position: absolute;
  top: 0.5rem;
  right: 0.75rem;
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
  font-family: var(--font-mono);
  pointer-events: none;
}

.prose pre {
  margin: 0;
  padding: 1.1rem 1.15rem;
  background: var(--code-bg);
  border: 1px solid var(--line-soft);
  border-radius: var(--r);
  overflow-x: auto;
  font-size: 0.84rem;
  line-height: 1.7;
  -webkit-overflow-scrolling: touch;
}

.prose pre code { background: none; padding: 0; font-size: inherit; color: var(--code-fg); }

.prose .table-wrap { margin: 1.4rem 0; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); }

.prose table { width: 100%; border-collapse: collapse; font-size: 0.83rem; min-width: 32rem; }

.prose th, .prose td {
  padding: 0.6rem 0.8rem;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  vertical-align: top;
}

.prose th {
  background: var(--bg-soft);
  font-weight: 650;
  color: var(--fg);
  white-space: nowrap;
  font-size: 0.78rem;
}

.prose tbody tr:last-child td { border-bottom: 0; }
.prose td:first-child { font-weight: 600; color: var(--fg); white-space: nowrap; }
.prose td { color: var(--fg-soft); }

/* 语法高亮 —— 只上少量颜色 */
.tok-comment { color: var(--faint); font-style: italic; }
.tok-string { color: var(--tok-string); }
.tok-number { color: var(--tok-number); }
.tok-keyword { color: var(--accent); }
.tok-func { color: var(--tok-func); }
.tok-punct { color: var(--muted); }

/* ---------------------------------------------------------- 文章 */

.article { padding-bottom: 2rem; }

.article__title { margin-bottom: 0.9rem; }

.article__meta {
  margin: 0 0 2rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  color: var(--muted);
}

.article__meta .icon { width: 0.92rem; height: 0.92rem; flex: none; opacity: 0.85; }
.article__meta span { display: inline-flex; align-items: center; gap: 0.3rem; }

.article__footer {
  margin-top: 3rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--line-soft);
  font-size: 0.79rem;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
}

.article__footer a:hover { color: var(--accent); }

/* ---------------------------------------------------------- 页脚 */

.site-footer {
  flex: none;
  border-top: 1px solid var(--line-soft);
}

/* 版权行居中（要求6：去掉左右分栏，只留 © 年份 品牌，居中显示） */
.site-footer__inner {
  max-width: var(--maxw-wide);
  margin: 0 auto;
  padding: 1.4rem clamp(1rem, 4vw, 2rem) 2rem;
  font-size: 0.76rem;
  color: var(--faint);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  text-align: center;
}

.site-footer a:hover { color: var(--accent); }

/* ---------------------------------------------------------- 404 */

.message { padding: clamp(3rem, 12vh, 6rem) 0 4rem; }

.message__code {
  margin: 0;
  font-size: clamp(3rem, 12vw, 5rem);
  font-weight: 800;
  letter-spacing: -0.05em;
  line-height: 1;
  color: var(--fg);
  opacity: 0.12;
}

.message__title { margin: 1rem 0 0.5rem; font-size: 1.25rem; font-weight: 650; }
.message__text { margin: 0; color: var(--muted); font-size: 0.94rem; }
.message__actions { margin-top: 1.6rem; }

.button {
  display: inline-block;
  padding: 0.45rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.85rem;
}

.button:hover { border-color: var(--accent); color: var(--accent); }

/* ---------------------------------------------------------- 窄屏 */

@media (max-width: 720px) {
  /* 搜索框挪到第二行，顶栏变两行高 —— 同步把 --header-h 调高，
     否则 sticky 目录条和 scroll-padding 都会按 3.5rem 算、被顶栏盖住 */
  :root { --header-h: 5.25rem; }

  .site-header__inner {
    padding-top: 0.55rem;
    padding-bottom: 0.55rem;
  }

  .site-header__bar {
    height: auto;
    flex-wrap: wrap;
    row-gap: 0.5rem;
  }

  .site-header__sp { display: none; }
  .search { order: 3; flex: 1 0 100%; }
  .site-nav { margin-left: auto; }
}

@media (max-width: 420px) {
  body { font-size: 14.5px; }
  /* 手写体在小屏收一档，顶栏不至于挤（Sacramento 视觉偏窄，1.6rem 仍清楚） */
  .brand { font-size: 1.6rem; }
}

@media print {
  .site-header, .site-footer, .toc, .side, .article__footer { display: none !important; }
  body { background: #fff; color: #000; }
  .frame { display: block; padding: 0; max-width: none; }
  .content { max-width: none; padding-top: 0; }
  h2 { page-break-after: avoid; }
  .entry, .card { page-break-inside: avoid; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}