/* ==========================================================================
   个人站点样式表
   纯静态、无依赖、无外部 CDN（备案审核期间避免境外资源加载失败）

   字体：Inter（OFL）+ Noto Sans SC（OFL），均已本地化裁剪
   图标：Lucide（ISC），本地 SVG sprite
   纹理：内联 SVG 噪点（data URI，不是外部请求）

   组织顺序：设计变量 → 色板 → 基础 → 布局 → 组件 → 动效 → 响应式 → 打印
   ========================================================================== */

/* ---------- 字体 ---------- */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/inter-latin-400.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+2074, U+20AC, U+2122, U+2191,
    U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/inter-latin-500.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+2074, U+20AC, U+2122, U+2191,
    U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/inter-latin-600.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+2074, U+20AC, U+2122, U+2191,
    U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/inter-latin-700.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+2074, U+20AC, U+2122, U+2191,
    U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Noto Sans SC';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/noto-sans-sc-400.subset.woff2') format('woff2');
}

/* 中文只保留 400 / 700 两档字重；500 与 600 由浏览器就近匹配，省下一份 500KB 字体 */
@font-face {
  font-family: 'Noto Sans SC';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/noto-sans-sc-700.subset.woff2') format('woff2');
}

/* ==========================================================================
   设计变量
   ========================================================================== */
:root {
  --font-sans: 'Inter', 'Noto Sans SC', system-ui, -apple-system, 'Segoe UI',
    'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, 'JetBrains Mono', Consolas,
    'Liberation Mono', 'Noto Sans SC', monospace;

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --radius-xl: 26px;

  --measure: 66ch;
  --wrap: 1120px;
  --gutter: 1.25rem;
  --section-y: clamp(3rem, 2.2rem + 3vw, 5.5rem);

  /* 移动端最小可点击尺寸 */
  --tap: 44px;

  /* 动效：时长与缓动统一在这里取，别在组件里写魔法数字 */
  --dur-fast: 0.16s;
  --dur: 0.24s;
  --dur-slow: 0.5s;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  /* 换配色时「大色块淡过去」的那条过渡，和交互反馈用的时长分开：
     0.35s 要能盖住整页的纸色变化，太快会看成闪一下。
     只过渡底色与描边，颜色（文字）必须立刻到位，不能 0.35s 才看清。 */
  --theme-fade: background-color 0.35s ease, border-color 0.35s ease;

  /* 内联噪点：给大面积色块一点纸的颗粒感，避免「纯色塑料感」 */
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* --------------------------------------------------------------------------
   配色主题：2 套色板 + 自动（跟随系统）
   生效顺序：<html data-theme="x"> 显式选择 > @media (prefers-color-scheme: dark)。
   没有 data-theme 时即「自动」，所以纯 CSS 也能跟随系统；JS 只负责改这个属性。
   新增主题两步：① 这里补一套 [data-theme='新值']；② site.config.js 的 theme.options 加一项。

   约束：每套色板都独立给全所有颜色 token，不要依赖继承另一套——
   否则某一套漏改一个 token 就会串色。
   -------------------------------------------------------------------------- */

/* 浅色模式（mobai）：纸白 + 墨绿，默认配色 */
:root,
[data-theme='mobai'] {
  color-scheme: light;
  --ink: #12161a;
  --ink-soft: #3f4a52;
  --ink-faint: #5c6873;
  --paper: #fcfcfa;
  --surface: #f4f5f2;
  --line: rgb(18 26 33 / 0.14);
  --hairline: rgb(18 26 33 / 0.085);
  --accent: #0f5f57;
  --accent-ink: #0a4640;
  --accent-soft: #e7f0ed;
  --on-accent: #ffffff;
  --glow-rgb: 15 95 87;
  --btn-hi: rgb(255 255 255 / 0.18);
  --header-bg: rgb(252 252 250 / 0.72);
  --veil-rgb: 252 252 250;
  /* 分段控件滑块底色：必须比轨道（--surface）更「亮」一层，
     浅色主题里是纸白，深色主题里是提亮的表面色 */
  --seg-chip: #ffffff;
  --hero-photo-opacity: 0.92;
  --hero-photo-filter: none;
  --grain-opacity: 0.05;
  --grain-blend: multiply;
  --shadow-1: 0 1px 2px rgb(16 24 32 / 0.05), 0 1px 1px rgb(16 24 32 / 0.03);
  --shadow-2: 0 2px 4px rgb(16 24 32 / 0.05), 0 14px 32px -14px rgb(16 24 32 / 0.22);
  --shadow-3: 0 4px 8px rgb(16 24 32 / 0.06), 0 28px 60px -24px rgb(16 24 32 / 0.3);
}

/* 深色模式（yedu）：中性暗色 + 薄荷绿，系统深色时默认 */
[data-theme='yedu'] {
  color-scheme: dark;
  --ink: #e8ecee;
  --ink-soft: #aeb9c2;
  --ink-faint: #85939f;
  --paper: #101316;
  --surface: #171b1f;
  --line: rgb(255 255 255 / 0.14);
  --hairline: rgb(255 255 255 / 0.075);
  --accent: #6ecab9;
  --accent-ink: #96ded1;
  --accent-soft: #14302b;
  --on-accent: #071d1a;
  --glow-rgb: 110 202 185;
  --btn-hi: rgb(255 255 255 / 0.1);
  --header-bg: rgb(16 19 22 / 0.7);
  --veil-rgb: 16 19 22;
  --seg-chip: #262d32;
  --hero-photo-opacity: 0.34;
  --hero-photo-filter: saturate(0.5) brightness(0.8);
  --grain-opacity: 0.07;
  --grain-blend: screen;
  --shadow-1: 0 1px 2px rgb(0 0 0 / 0.5);
  --shadow-2: 0 2px 6px rgb(0 0 0 / 0.45), 0 18px 40px -18px rgb(0 0 0 / 0.75);
  --shadow-3: 0 6px 14px rgb(0 0 0 / 0.5), 0 36px 70px -30px rgb(0 0 0 / 0.85);
}

/* 自动：用户没选过主题时跟随系统。
   :not([data-theme]) 保证显式选择永远优先。
   ⚠️ 以下色值必须与上面 [data-theme='yedu'] 保持一致。 */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --ink: #e8ecee;
    --ink-soft: #aeb9c2;
    --ink-faint: #85939f;
    --paper: #101316;
    --surface: #171b1f;
    --line: rgb(255 255 255 / 0.14);
    --hairline: rgb(255 255 255 / 0.075);
    --accent: #6ecab9;
    --accent-ink: #96ded1;
    --accent-soft: #14302b;
    --on-accent: #071d1a;
    --glow-rgb: 110 202 185;
    --btn-hi: rgb(255 255 255 / 0.1);
    --header-bg: rgb(16 19 22 / 0.7);
    --veil-rgb: 16 19 22;
    --seg-chip: #262d32;
    --hero-photo-opacity: 0.34;
    --hero-photo-filter: saturate(0.5) brightness(0.8);
    --grain-opacity: 0.07;
    --grain-blend: screen;
    --shadow-1: 0 1px 2px rgb(0 0 0 / 0.5);
    --shadow-2: 0 2px 6px rgb(0 0 0 / 0.45), 0 18px 40px -18px rgb(0 0 0 / 0.75);
    --shadow-3: 0 6px 14px rgb(0 0 0 / 0.5), 0 36px 70px -30px rgb(0 0 0 / 0.85);
  }
}

/* ==========================================================================
   基础
   ========================================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* 避免锚点跳转被吸顶导航挡住 */
  scroll-padding-top: 88px;
  /* 橡皮筋滚动（iOS overscroll）露出的也应该是纸色，不是白条 */
  background: var(--paper);
  transition: background-color 0.35s ease;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.78;
  letter-spacing: 0.008em;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
  transition: background-color 0.35s ease, color 0.35s ease;
}

::selection {
  background: var(--accent-soft);
  color: var(--accent-ink);
}

/* 只给读屏用的文本 */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

h1,
h2,
h3,
h4 {
  margin: 0 0 0.5em;
  line-height: 1.3;
  letter-spacing: -0.012em;
  font-weight: 700;
  /* 短标题避免最后一行只剩一两个字（不支持时按默认断行） */
  text-wrap: balance;
}

/* 大字号需要更紧的字距才「立」得住，小字号反而要放松一点 */
h1 {
  font-size: clamp(2.05rem, 1.35rem + 2.4vw, 3rem);
  line-height: 1.16;
  letter-spacing: -0.024em;
}

h2 {
  font-size: clamp(1.32rem, 1.12rem + 0.62vw, 1.62rem);
  line-height: 1.3;
  letter-spacing: -0.016em;
}

h3 {
  font-size: 1.04rem;
  line-height: 1.5;
  letter-spacing: -0.006em;
}

p {
  margin: 0 0 1.1em;
  /* 中文段落末行只剩两三个字的时候尤其难看；支持时让浏览器回退一个词 */
  text-wrap: pretty;
}

a {
  color: var(--accent);
  text-decoration: none;
  text-underline-offset: 3px;
  transition: color var(--dur-fast) ease;
}

a:hover,
a:focus-visible {
  color: var(--accent-ink);
  text-decoration: underline;
}

/* 正文里的链接不能只靠颜色区分：--accent 与 --ink 的对比不到 3:1，
   色弱或黑白打印时几乎看不出是链接（WCAG 1.4.1）。
   给一条淡到下划线里去的实线，hover 时再连同颜色一起加深。 */
.lede a,
.article a,
.note-item__excerpt a,
.contact-item__value a {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: rgb(var(--glow-rgb) / 0.45);
}

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

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* 浏览器默认的 [hidden] 只是 display:none 的弱规则，
   任何作者样式里的 display 都会把它盖掉（比如 .contact-item 的 flex）。
   这里兜底，保证 JS 用 setAttribute('hidden') 真的能藏住元素。 */
[hidden] {
  display: none !important;
}

ul,
ol { padding-left: 1.3em; }

li { margin-bottom: 0.25em; }

hr {
  border: 0;
  border-top: 1px solid var(--hairline);
  margin: 2.75rem 0;
}

code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 5px;
  padding: 0.12em 0.4em;
  transition: var(--theme-fade);
}

pre {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.86rem;
  line-height: 1.68;
  box-shadow: var(--shadow-1);
  transition: var(--theme-fade);
}

pre code {
  background: none;
  border: 0;
  padding: 0;
  font-size: inherit;
}

blockquote {
  margin: 1.75rem 0;
  padding: 0.25rem 0 0.25rem 1.15rem;
  border-left: 2px solid var(--accent);
  color: var(--ink-soft);
  font-size: 1.02rem;
}

/* ---------- 图标 ---------- */
.icon {
  width: 1em;
  height: 1em;
  stroke-width: 1.9;
  flex: none;
  vertical-align: -0.125em;
}

.icon--sm {
  width: 0.9em;
  height: 0.9em;
}

.icon--lg {
  width: 1.25em;
  height: 1.25em;
}

/* ==========================================================================
   布局
   ========================================================================== */
.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  /* 页面声明了 viewport-fit=cover：横屏时内容会伸到刘海/圆角下面，
     左右内边距取「正常留白」与「安全区」的较大值，别让文字贴进缺口里 */
  padding-left: max(var(--gutter), env(safe-area-inset-left));
  padding-right: max(var(--gutter), env(safe-area-inset-right));
}

/* 少量一次性间距：别在 HTML 里写行内 style */
.mt-sm { margin-top: 1rem; }
.mt-md { margin-top: 1.75rem; }
.mt-lg { margin-top: 2.5rem; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: var(--on-accent);
  padding: 0.6rem 1rem;
  border-radius: 0 0 var(--radius) 0;
  z-index: 200;
}

.skip-link:focus {
  left: 0;
  color: var(--on-accent);
}

.section {
  padding: var(--section-y) 0;
}

.section + .section {
  border-top: 1px solid var(--hairline);
}

.section__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
  padding-bottom: 1.05rem;
  border-bottom: 1px solid var(--hairline);
}

.section__head h2 { margin: 0; }

.section__more {
  font-size: 0.875rem;
  color: var(--ink-faint);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  transition: color var(--dur-fast) ease;
}

.section__more .icon {
  transition: transform var(--dur) var(--ease);
}

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

/* 只动箭头的位移：改 gap 会让每帧都重新排版 */
.section__more:hover .icon {
  transform: translateX(3px);
}

/* 眉标：前面带一小段细线，像书页上的批注标记 */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.85rem;
}

.eyebrow::before {
  content: '';
  width: 18px;
  height: 1px;
  background: currentColor;
  opacity: 0.5;
}

.lede {
  font-size: 1.03rem;
  line-height: 1.85;
  color: var(--ink-soft);
  max-width: var(--measure);
}

/* ==========================================================================
   顶栏
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--header-bg);
  backdrop-filter: saturate(1.7) blur(14px);
  -webkit-backdrop-filter: saturate(1.7) blur(14px);
  border-bottom: 1px solid var(--hairline);
  transition: background-color 0.35s ease, border-color 0.35s ease;
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 66px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  color: var(--ink);
  font-size: 0.96rem;
  letter-spacing: -0.01em;
  min-width: 0;
}

.brand:hover {
  text-decoration: none;
  color: var(--ink);
}

.brand__text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand__mark {
  width: 27px;
  height: 27px;
  border-radius: 8px;
  background-color: var(--accent);
  background-image: linear-gradient(150deg, var(--btn-hi), transparent 60%);
  color: var(--on-accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.22),
    0 4px 12px -6px rgb(var(--glow-rgb) / 0.7);
}

.brand__mark svg {
  width: 15px;
  height: 15px;
  display: block;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  min-width: 0;
}

.site-nav ul {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav a {
  position: relative;
  display: block;
  padding: 0.42rem 0.68rem 0.5rem;
  border-radius: var(--radius-sm);
  color: var(--ink-soft);
  font-size: 0.9rem;
  transition: color var(--dur-fast) ease, background-color var(--dur-fast) ease;
}

.site-nav a:hover {
  color: var(--ink);
  background: var(--surface);
  text-decoration: none;
}

/* 当前页：只加一条细下划线，不用一整块色块，安静一些 */
.site-nav a[aria-current='page'] {
  color: var(--accent);
  font-weight: 600;
  background: transparent;
}

.site-nav a[aria-current='page']::after {
  content: '';
  position: absolute;
  left: 0.68rem;
  right: 0.68rem;
  bottom: 0.12rem;
  height: 1.5px;
  border-radius: 2px;
  background: currentColor;
  opacity: 0.9;
}

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: var(--tap);
  /* 和 --tap 对齐：移动端唯一的菜单入口，别比 44px 矮 */
  height: var(--tap);
  border: 1px solid var(--hairline);
  border-radius: 10px;
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
  padding: 0;
  /* 底色跟着换主题淡过去；描边留给 hover，快一点才跟手 */
  transition: background-color 0.35s ease, border-color var(--dur-fast) ease;
}

.nav-toggle:hover { border-color: var(--line); }

.nav-toggle span {
  display: block;
  width: 15px;
  height: 1.5px;
  background: currentColor;
  position: relative;
  transition: background-color var(--dur-fast) ease;
}

.nav-toggle span::before,
.nav-toggle span::after {
  content: '';
  position: absolute;
  left: 0;
  width: 15px;
  height: 1.5px;
  background: currentColor;
  transition: transform var(--dur) var(--ease);
}

.nav-toggle span::before { top: -5px; }
.nav-toggle span::after { top: 5px; }

/* 展开时收成叉号 */
.nav-toggle[aria-expanded='true'] span { background: transparent; }
.nav-toggle[aria-expanded='true'] span::before { transform: translateY(5px) rotate(45deg); }
.nav-toggle[aria-expanded='true'] span::after { transform: translateY(-5px) rotate(-45deg); }

/* ==========================================================================
   配色切换器：收起成一个圆点，悬停/聚焦/点开展开菜单
   ========================================================================== */
.theme-switch {
  position: relative;
  display: flex;
  align-items: center;
  flex: none;
}

/* 没有 JS 时容器是空的，整块隐藏 */
.theme-switch:empty { display: none; }

.theme-switch__trigger {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 999px;
  border: 1px solid var(--hairline);
  background: var(--paper);
  cursor: pointer;
  transition: background-color 0.35s ease, border-color var(--dur-fast) ease,
    box-shadow var(--dur-fast) ease, transform var(--dur-fast) ease;
}

.theme-switch__trigger:hover,
.theme-switch:focus-within .theme-switch__trigger,
.theme-switch.is-open .theme-switch__trigger {
  border-color: var(--line);
  box-shadow: var(--shadow-1);
}

.theme-switch__trigger:active { transform: scale(0.95); }

.theme-switch__dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  /* 斜切双色：左上取纸色、右下取主色，一眼看出这套配色长什么样 */
  background: linear-gradient(
    135deg,
    var(--sw-paper) 0 50%,
    var(--sw-accent) 50% 100%
  );
  box-shadow: inset 0 0 0 1px rgb(0 0 0 / 0.18);
}

.theme-switch__panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 60;
  min-width: 158px;
  padding: 6px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  /* 用 surface 而不是 paper：菜单浮在页面上时要和背景差开一层，
     深色主题里这一点点提亮就是「有厚度」和「糊成一片」的区别 */
  background: var(--surface);
  /* 顶部一道极细高光：深色主题里这点反光是「浮起来」还是「糊住了」的分界 */
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.06), var(--shadow-3);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px) scale(0.98);
  transform-origin: top right;
  /* 底色/描边跟着换主题走，opacity 与位移留给展开动画 */
  transition: opacity var(--dur) var(--ease-out),
    transform var(--dur) var(--ease-out), visibility var(--dur) linear,
    var(--theme-fade);
}

/* 鼠标从触发器移到菜单要跨过 8px 空隙，铺一层透明桥接，避免中途收起 */
.theme-switch__panel::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: -10px;
  height: 10px;
}

.theme-switch:hover .theme-switch__panel,
.theme-switch:focus-within .theme-switch__panel,
.theme-switch.is-open .theme-switch__panel {
  opacity: 1;
  visibility: visible;
  transform: none;
}

/* 刚选完主题：指针还停在菜单上，但菜单应该立刻收起，不要赖着不走。
   JS 会在「指针移出且焦点不在切换器里」、或「焦点离开切换器」时摘掉这个类。 */
.theme-switch.is-collapsing .theme-switch__panel {
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px) scale(0.98);
}

.theme-switch__opt {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  min-height: 36px;
  padding: 0.34rem 0.55rem;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ink-soft);
  font-family: inherit;
  font-size: 0.84rem;
  text-align: left;
  cursor: pointer;
  transition: background-color var(--dur-fast) ease, color var(--dur-fast) ease;
}

.theme-switch__opt:hover {
  background: var(--surface);
  color: var(--ink);
}

.theme-switch__opt[aria-pressed='true'] {
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-weight: 600;
}

/* 选中项右侧补一个小圆点：不只靠底色区分（色弱也能看出来） */
.theme-switch__opt[aria-pressed='true']::after {
  content: '';
  width: 5px;
  height: 5px;
  margin-left: auto;
  border-radius: 50%;
  background: currentColor;
}

/* 分组标题只在手机端出现 */
.theme-switch__caption {
  display: none;
}

/* ==========================================================================
   首页 Hero
   ========================================================================== */
.hero {
  position: relative;
  overflow: hidden;
  padding: clamp(3.5rem, 2rem + 6vw, 7rem) 0 clamp(3rem, 2rem + 4vw, 5.5rem);
  border-bottom: 1px solid var(--hairline);
  isolation: isolate;
}

/* 背景图：按屏幕宽度挑选合适尺寸；底部用遮罩淡出，避免一条生硬的图片下边缘 */
.hero__bg {
  position: absolute;
  inset: 0;
  z-index: -3;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: right center;
  /* 深色主题下照片要退到背景里去，否则一块亮图会顶穿整个版面 */
  opacity: var(--hero-photo-opacity);
  filter: var(--hero-photo-filter);
  mask-image: linear-gradient(to bottom, #000 0 56%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, #000 0 56%, transparent 100%);
}

/* 纸面细颗粒：压在纱层之上、文字之下 */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: var(--grain);
  background-size: 160px 160px;
  opacity: var(--grain-opacity);
  mix-blend-mode: var(--grain-blend);
  pointer-events: none;
}

/* 左侧压一层纸色渐变，保证标题对比度；渐变色取 --veil-rgb，深浅主题共用一套梯度 */
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(
      100deg,
      rgb(var(--veil-rgb) / 0.96) 0%,
      rgb(var(--veil-rgb) / 0.88) 34%,
      rgb(var(--veil-rgb) / 0.4) 62%,
      rgb(var(--veil-rgb) / 0.12) 100%
    ),
    radial-gradient(
      120% 100% at 78% 30%,
      rgb(var(--veil-rgb) / 0) 0%,
      rgb(var(--veil-rgb) / 0.35) 100%
    );
}

.hero__inner {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(2rem, 1rem + 4vw, 4.5rem);
}

.hero__title {
  margin-bottom: 0.45rem;
}

.hero__title em {
  font-style: normal;
  color: var(--accent);
}

.hero__tagline {
  font-size: 1.04rem;
  line-height: 1.8;
  color: var(--ink-soft);
  margin-bottom: 1.75rem;
  max-width: var(--measure);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-bottom: 2rem;
}

.hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.5rem;
  font-size: 0.85rem;
  color: var(--ink-faint);
}

.hero__meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.hero__meta .icon { opacity: 0.75; }

/* 装饰性印章：微微倾斜，像随手按在纸上的那一枚 */
.hero__portrait {
  position: relative;
  width: 168px;
  height: 168px;
  border-radius: var(--radius-xl);
  display: grid;
  place-items: center;
  color: var(--accent);
  font-size: 3.2rem;
  font-weight: 700;
  line-height: 1;
  flex: none;
  background-color: var(--surface);
  background-image: radial-gradient(
    120% 120% at 22% 0%,
    var(--accent-soft),
    transparent 68%
  );
  border: 1px solid var(--line);
  box-shadow: var(--shadow-2), inset 0 1px 0 rgb(255 255 255 / 0.14);
  transform: rotate(-2.5deg);
  /* 悬停是「扶正」而不是搬动它，0.24s 跟手；入场动画另算 0.5s */
  transition: transform var(--dur) var(--ease-out), var(--theme-fade);
}

/* 内圈细线，做出「印面」的双层边 */
.hero__portrait::after {
  content: '';
  position: absolute;
  inset: 9px;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius-xl) - 9px);
  opacity: 0.55;
  pointer-events: none;
}

.hero__portrait:hover {
  transform: rotate(0deg) scale(1.02);
}

/* ==========================================================================
   按钮
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: var(--tap);
  padding: 0.62rem 1.25rem;
  border-radius: 11px;
  border: 1px solid var(--accent);
  background-color: var(--accent);
  /* 顶部一层极淡的高光，让实心按钮有轻微的体积感 */
  background-image: linear-gradient(180deg, var(--btn-hi), transparent 70%);
  color: var(--on-accent);
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 8px 20px -12px rgb(var(--glow-rgb) / 0.9);
  transition: transform var(--dur-fast) var(--ease),
    box-shadow var(--dur) var(--ease), background-color var(--dur-fast) ease,
    border-color var(--dur-fast) ease;
}

.btn:hover {
  background-color: var(--accent-ink);
  border-color: var(--accent-ink);
  color: var(--on-accent);
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 16px 30px -14px rgb(var(--glow-rgb) / 0.95);
}

/* 按下时立刻回到原位，给出「已经点到了」的反馈 */
.btn:active {
  transform: translateY(0);
  box-shadow: 0 6px 14px -10px rgb(var(--glow-rgb) / 0.8);
}

.btn--ghost {
  background-color: transparent;
  background-image: none;
  color: var(--ink);
  border-color: var(--line);
  box-shadow: none;
}

.btn--ghost:hover {
  background-color: var(--surface);
  border-color: var(--ink-faint);
  color: var(--ink);
  box-shadow: none;
}

/* ==========================================================================
   卡片
   ========================================================================== */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(228px, 1fr));
  gap: 0.9rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.card {
  position: relative;
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--hairline);
  box-shadow: var(--shadow-1);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease),
    border-color var(--dur) var(--ease), background-color 0.35s ease;
}

@media (hover: hover) {
  .card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-2);
    border-color: var(--line);
  }
}

.card h3 {
  margin-bottom: 0.45rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1rem;
}

.card p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.92rem;
  line-height: 1.75;
}

.card__icon {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--accent-soft);
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.92rem;
  flex: none;
  box-shadow: inset 0 0 0 1px var(--hairline);
  transition: transform var(--dur) var(--ease), var(--theme-fade);
}

.card:hover .card__icon {
  transform: translateY(-1px) scale(1.04);
}

/* ==========================================================================
   笔记列表
   ========================================================================== */
.notes {
  list-style: none;
  margin: 0;
  padding: 0;
}

.note-item {
  position: relative;
  /* 自成一个层叠上下文：悬停底色用 z-index:-1 的伪元素，才不会掉到页面背景后面去 */
  isolation: isolate;
  padding: 1.35rem 0;
  border-bottom: 1px solid var(--hairline);
}

.note-item:last-child { border-bottom: 0; }

/* 悬停时整行浮起一层纸色，用伪元素做背景，不动布局 */
.note-item::before {
  content: '';
  position: absolute;
  inset: 0.35rem -1rem;
  z-index: -1;
  border-radius: var(--radius);
  background: var(--surface);
  opacity: 0;
  transition: opacity var(--dur) var(--ease);
}

@media (hover: hover) {
  .note-item:hover::before { opacity: 1; }
}

.note-item__meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.55rem;
  font-size: 0.79rem;
  letter-spacing: 0.02em;
  color: var(--ink-faint);
  margin-bottom: 0.35rem;
}

.note-item__meta time {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.note-item__title {
  margin: 0 0 0.35rem;
  font-size: 1.02rem;
  line-height: 1.55;
}

.note-item__title a {
  color: var(--ink);
  transition: color var(--dur-fast) ease;
}

/* 标题链接用伪元素铺满整行：手机上点摘要或日期也能进文章，不必瞄准标题 */
.note-item__title a::after {
  content: '';
  position: absolute;
  inset: 0;
}

@media (hover: hover) {
  .note-item:hover .note-item__title a { color: var(--accent); }
}

.note-item__excerpt {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.92rem;
  line-height: 1.75;
  max-width: var(--measure);
}

/* 标签：只留一圈细线，不用实心色块，安静 */
.tag {
  display: inline-block;
  padding: 0.05rem 0.5rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--accent-ink);
  font-size: 0.73rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: var(--theme-fade);
}

/* ==========================================================================
   两栏
   ========================================================================== */
.split {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: clamp(1.75rem, 1rem + 3vw, 3rem);
  align-items: start;
}

.side-block {
  padding: 1.35rem 1.45rem;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--hairline);
  box-shadow: var(--shadow-1);
  transition: var(--theme-fade);
}

/* 放在两栏里当「列表」用的那种：去掉表面色，只留一圈细线，
   免得和旁边的卡片抢层级 */
.side-block--paper { background: var(--paper); }

.side-block h3 {
  margin-top: 0;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.side-block ul {
  margin: 0;
  padding-left: 1.05em;
  color: var(--ink-soft);
  font-size: 0.91rem;
}

.side-block li { margin-bottom: 0.4rem; }

/* ==========================================================================
   信息表
   ========================================================================== */
.info-list {
  margin: 0;
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.6rem 1.75rem;
  font-size: 0.94rem;
}

.info-list dt {
  color: var(--ink-faint);
  font-size: 0.86rem;
}

.info-list dd {
  margin: 0;
  color: var(--ink);
}

/* ==========================================================================
   文章
   ========================================================================== */
.article {
  max-width: var(--measure);
  margin: 0 auto;
}

/* 关于页把正文放进两栏，不需要再按 --measure 收窄 */
.article--flush { max-width: none; }

.article__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem 0.9rem;
  font-size: 0.83rem;
  color: var(--ink-faint);
  margin-bottom: 2rem;
  padding-bottom: 1.35rem;
  border-bottom: 1px solid var(--hairline);
}

.article h2 { margin-top: 2.5rem; }
.article h3 { margin-top: 1.9rem; }

/* 正文第一块不要顶部外边距：两栏布局里它会比右侧卡片低 40px，看着像没对齐 */
.article > :first-child { margin-top: 0; }

.article ul,
.article ol { color: var(--ink-soft); }

.article strong { color: var(--ink); }

/* 回链要和正文栏左边缘对齐：.article 是 max-width + auto 居中，
   这里用同样的偏移量，别让小字孤零零贴在最左边。
   ⚠️ font-size 必须保持 1rem —— --measure 是 ch 单位，字号一变 66ch 就算出另一个宽度，
      对齐会差 40px 左右。要弱化它请改颜色，别看它字号。 */
.back-link {
  display: flex;
  width: fit-content;
  align-items: center;
  gap: 0.35rem;
  margin: 0 0 1.75rem max(0px, calc((100% - var(--measure)) / 2));
  color: var(--ink-faint);
  font-size: 1rem;
}

.back-link:hover { color: var(--accent); }

.article__nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 3.25rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--hairline);
  font-size: 0.9rem;
  max-width: var(--measure);
  margin-left: auto;
  margin-right: auto;
}

.article__nav a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  max-width: 46%;
}

/* ==========================================================================
   联系方式
   ========================================================================== */
.contact-item {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--hairline);
}

.contact-item:last-child { border-bottom: 0; }

.contact-item__icon {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--accent-soft);
  color: var(--accent);
  display: grid;
  place-items: center;
  font-size: 1rem;
  flex: none;
  box-shadow: inset 0 0 0 1px var(--hairline);
  transition: var(--theme-fade);
}

.contact-item__label {
  font-size: 0.79rem;
  letter-spacing: 0.04em;
  color: var(--ink-faint);
  display: block;
  margin-bottom: 0.1rem;
}

.contact-item__value {
  font-size: 0.97rem;
  word-break: break-word;
}

/* ==========================================================================
   页脚
   ========================================================================== */
.site-footer {
  border-top: 1px solid var(--hairline);
  background: var(--surface);
  margin-top: clamp(2.5rem, 2rem + 3vw, 4.5rem);
  padding: 2.5rem 0 3rem;
  font-size: 0.84rem;
  color: var(--ink-faint);
  transition: background-color 0.35s ease, border-color 0.35s ease;
}

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem 2rem;
}

.site-footer p { margin: 0 0 0.4rem; }

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
  align-content: flex-start;
}

.footer-links a {
  color: var(--ink-soft);
  transition: color var(--dur-fast) ease;
}

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

/* 备案号按工信部要求：必须展示且可点击跳转 */
.beian {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.beian .icon {
  width: 14px;
  height: 14px;
}

/* ==========================================================================
   动效
   原则：只动 transform / opacity，1-2 个元素，尊重 prefers-reduced-motion。
   ========================================================================== */
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* 印章自带 -2.5deg 的固有倾斜，关键帧必须把这个角度写进终点，
   否则动画填充会把它抹平（fill 只写 backwards，播完就交回基础样式）。 */
@keyframes rise-seal {
  from {
    opacity: 0;
    transform: rotate(-2.5deg) translateY(16px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: rotate(-2.5deg) scale(1);
  }
}

@keyframes fade-in {
  from { opacity: 0.001; }
  to { opacity: 1; }
}

@media (prefers-reduced-motion: no-preference) {
  /* 首屏：文字块按层级依次落位，间隔 70ms，不要拖沓 */
  .hero__inner > div > * {
    animation: rise var(--dur-slow) var(--ease-out) backwards;
  }

  .hero__inner > div > *:nth-child(2) { animation-delay: 0.05s; }
  .hero__inner > div > *:nth-child(3) { animation-delay: 0.1s; }
  .hero__inner > div > *:nth-child(4) { animation-delay: 0.15s; }
  .hero__inner > div > *:nth-child(5) { animation-delay: 0.2s; }

  .hero__portrait {
    animation: rise-seal var(--dur-slow) var(--ease-out) 0.1s backwards;
  }

  /* 滚动进入视口时淡入。
     用 scroll-driven animation 而不是 IntersectionObserver：
     纯 CSS、无 JS 闪动、不支持该特性的浏览器直接不进入这段规则（见 @supports）。
     只动 opacity，避免和 hover 的 transform 打架。 */
  @supports (animation-timeline: view()) {
    .card,
    .note-item,
    .side-block {
      animation: fade-in linear backwards;
      animation-timeline: view();
      /* 只跟着「进入视口」这一段走：完全进来就正好不透明，
         不依赖元素高度，也不会出现半透明挂在页面中间的状态 */
      animation-range: entry 0% entry 100%;
    }
  }
}

/* ==========================================================================
   响应式：移动优先，逐级放大
   断点：380 / 760 / 768 / 980 / 1024
   （图片的 <source media> 另有 640 / 1024 / 1600，写在 HTML 里）
   ========================================================================== */

/* 极窄屏（<=380px）：进一步压缩间距 */
@media (max-width: 380px) {
  :root {
    --gutter: 1rem;
  }
  body { font-size: 15px; }
}

/* 手机横屏 */
@media (max-width: 760px) and (orientation: landscape) {
  .hero { padding: 2.75rem 0 2.5rem; }
  .hero__inner { grid-template-columns: 1fr; gap: 1.5rem; }
}

/* 平板竖屏 / 小笔记本 */
@media (min-width: 768px) {
  :root { --gutter: 1.5rem; }
}

/* 窄于桌面时，Hero 与两栏布局都要收成单栏，否则文字被挤成竖条 */
@media (max-width: 980px) {
  .hero__inner {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  /* 单栏之后印章会落在正文下方、右侧留一大片空白，直接收起来 */
  .hero__portrait {
    display: none;
  }
  .split {
    grid-template-columns: 1fr;
    gap: 1.75rem;
  }
}

/* 桌面 */
@media (min-width: 1024px) {
  :root { --gutter: 2rem; }
}

/* 大屏不再单独收窄 .hero__inner：
   max-width 加在 border-box 上会比 .wrap 少一圈，首屏标题就和下面几栏错开 40px。
   行长早就由 --measure（66ch）管住了，这里不需要再缩。 */

/* 移动端导航折叠（无 JS 时保持展开） */
@media (max-width: 760px) {
  .js .nav-toggle { display: inline-flex; }
  .site-nav {
    display: none;
    position: absolute;
    top: 66px;
    left: 0;
    right: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--hairline);
    /* 面板是通栏的，左右内边距同样要让开安全区 */
    padding: 0.6rem max(var(--gutter), env(safe-area-inset-right)) 1rem
      max(var(--gutter), env(safe-area-inset-left));
    box-shadow: var(--shadow-2);
    /* 面板内部纵向排布 */
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }
  .site-nav.is-open {
    display: flex;
    animation: rise 0.28s var(--ease-out) both;
  }
  html:not(.js) .site-nav {
    display: block;
    position: static;
    border: 0;
    box-shadow: none;
    padding: 0;
  }
  .site-nav ul {
    flex-direction: column;
    align-items: stretch;
    gap: 0.1rem;
  }
  .site-nav a { padding: 0.62rem 0.7rem; }

  /* 移动端链接是整行宽，下划线如果不收窄就会变成一条分隔线 */
  .site-nav a[aria-current='page']::after {
    right: auto;
    width: 22px;
  }

  /* 折叠面板里没有 hover：切换器直接摊开成两列，
     点一下就是一次选择，比藏在浮层里更快 */
  .theme-switch {
    margin-top: 0.15rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--hairline);
    flex-direction: column;
    align-items: stretch;
  }
  .theme-switch__trigger { display: none; }
  /* ---- 手机端：三段式分段控件（浅色 / 深色 / 跟随系统） ----
     比一排卡片更贴本站的语言：一条细线、一层纸色、一个会滑动的选中块。 */
  .theme-switch__panel {
    position: relative;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
    min-width: 0;
    padding: 3px;
    border: 1px solid var(--hairline);
    border-radius: 13px;
    background: var(--surface);
    box-shadow: none;
    opacity: 1;
    visibility: visible;
    transform: none;
  }
  .theme-switch__panel::before { display: none; }

  /* 选中块：纸色滑块按序号平移，比逐项换底色更连贯，也能看出「从哪来到哪去」 */
  .theme-switch__panel::after {
    content: '';
    position: absolute;
    top: 3px;
    bottom: 3px;
    left: 3px;
    width: calc((100% - 6px) / 3);
    border-radius: 10px;
    background: var(--seg-chip);
    box-shadow: var(--shadow-1), 0 0 0 1px var(--hairline);
    transform: translateX(calc(var(--sw-index, 0) * 100%));
    /* 位移用 --dur 跟手；换主题时滑块自己也要淡过去，否则底下轨道在渐变、它硬切 */
    transition: transform var(--dur) var(--ease-out), background-color 0.35s ease;
    pointer-events: none;
  }

  /* 折叠面板里的菜单是常驻的，任何「收起」状态都不该作用到它 */
  .theme-switch.is-collapsing .theme-switch__panel {
    opacity: 1;
    visibility: visible;
    transform: none;
  }

  .theme-switch__caption {
    display: block;
    font-size: 0.7rem;
    letter-spacing: 0.14em;
    color: var(--ink-faint);
    padding: 0 0.1rem;
    margin-bottom: 0.5rem;
  }

  .theme-switch__opt {
    position: relative;
    z-index: 1;
    justify-content: center;
    gap: 0.4rem;
    min-height: 44px;
    padding: 0 0.2rem;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--ink-faint);
    font-size: 0.8rem;
  }

  .theme-switch__opt .theme-switch__dot {
    display: block;
    width: 12px;
    height: 12px;
  }

  .theme-switch__opt:hover {
    background: transparent;
    color: var(--ink-soft);
  }

  /* 选中：文字加深加粗，滑块在下面托着——不靠颜色单独表达状态 */
  .theme-switch__opt[aria-pressed='true'] {
    background: transparent;
    color: var(--ink);
    font-weight: 600;
  }

  .theme-switch__opt[aria-pressed='true']::after { display: none; }

  .info-list {
    grid-template-columns: 1fr;
    gap: 0.15rem;
  }
  .info-list dd { margin-bottom: 0.75rem; }
  .article__nav { flex-direction: column; }
  .article__nav a { max-width: 100%; }
}

/* 触屏设备：加大可点区域 */
@media (pointer: coarse) {
  .site-nav a {
    display: flex;
    align-items: center;
    min-height: var(--tap);
  }
  /* 页脚链接和备案号也是可点的，触屏上一并补到 44px。
     用 pointer 而不是宽度判断：窄窗口配鼠标时不需要这么高。 */
  .footer-links a {
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0;
    min-height: var(--tap);
  }
  .beian { min-height: var(--tap); }
}

/* ==========================================================================
   无障碍：降低动效
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ==========================================================================
   打印：不论当前是哪套主题，一律回到黑纸白字。
   选择器要同时压过 [data-theme='x'] 与 :root:not([data-theme])，别删分支。
   ========================================================================== */
@media print {
  :root,
  :root[data-theme],
  :root:not([data-theme]) {
    color-scheme: light;
    --ink: #000000;
    --ink-soft: #333333;
    --ink-faint: #555555;
    --paper: #ffffff;
    --surface: #f5f5f5;
    --line: #cccccc;
    --hairline: #dddddd;
    --accent: #000000;
    --accent-ink: #000000;
    --accent-soft: #eeeeee;
    --on-accent: #ffffff;
    --header-bg: #ffffff;
    --shadow-1: none;
    --shadow-2: none;
    --shadow-3: none;
  }
  .site-header,
  .site-footer,
  .article__nav,
  .back-link,
  .hero__bg,
  .hero::before,
  .hero::after,
  .theme-switch,
  .nav-toggle { display: none !important; }
  body { font-size: 12pt; background: #fff; color: #000; }
  .section { padding: 1rem 0; }
  a { color: #000; text-decoration: underline; }
}
