/* ==========================================================================
   谢泓铎 · 个人站 —— 新中式水墨 / 等高线即山水
   tokens → base → atmosphere → 组件 → 章节 → 动效 → 响应式 → 降级
   ========================================================================== */

/* ==========================================================================
   1. 设计令牌
   方向：新中式水墨（Editorial + Organic）。宣纸底 / 浓墨字 / 朱砂单一强调色。
   字体：Noto Serif SC（中文展示）+ Noto Sans SC（正文）+ JetBrains Mono（数据）
        + Cormorant Garamond（拉丁展示，压住英文名的书卷气）
   ========================================================================== */
:root {
  /* —— 语义色（日间：宣纸） —— */
  --paper:        #F5F2EA;   /* 宣纸底 */
  --surface:      rgba(255, 255, 255, 0.46);
  --surface-2:    #ECE7DA;   /* 章节交替底 */
  --ink:          #26231E;   /* 浓墨 */
  --ink-rgb:      #26231E;   /* SVG 渐变用 */
  --ink-mid:      #635D54;   /* 中墨 · 5.8:1 */
  --ink-faint:    #746D61;   /* 淡墨 · 4.6:1（已校验，可作小字） */
  --accent:       #B5442D;   /* 朱砂 · 4.9:1 */
  --accent-soft:  rgba(181, 68, 45, 0.14);
  --hairline:        rgba(38, 35, 30, 0.14);
  --hairline-strong: rgba(38, 35, 30, 0.32);

  /* —— 反白（印章 / 主推卡片） —— */
  --seal-bg: #26231E;
  --seal-fg: #F5F2EA;
  --seal-shadow: 0 4px 18px rgba(181, 68, 45, 0.28);

  /* —— 阴影三级（带环境色，非纯黑） —— */
  --shadow-1: 0 2px 8px  rgba(38, 35, 30, 0.08);
  --shadow-2: 0 8px 26px rgba(38, 35, 30, 0.10);
  --shadow-3: 0 24px 60px rgba(38, 35, 30, 0.14);

  /* —— 字体 —— */
  --serif: "Noto Serif SC", "Songti SC", "SimSun", serif;
  --sans:  "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono:  "JetBrains Mono", "Cascadia Mono", Consolas, monospace;
  --latin: "Cormorant Garamond", "Noto Serif SC", Georgia, serif;

  /* —— 字阶（1.25 模块） —— */
  --fs-xs: 11.5px; --fs-sm: 13.5px; --fs-base: 16.5px;
  --fs-md: 19px;   --fs-lg: 25px;   --fs-xl: 42px;  --fs-2xl: 118px;

  /* —— 间距梯度 —— */
  --space-1: 4px;  --space-2: 8px;  --space-3: 16px; --space-4: 24px;
  --space-5: 40px; --space-6: 64px; --space-7: 96px; --space-8: 140px;

  /* —— 圆角 / 动效 —— */
  --radius-sm: 3px; --radius-md: 6px; --radius-lg: 999px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-fast: 180ms; --dur-base: 340ms; --dur-slow: 800ms;

  --maxw: 1080px;
}

/* —— 夜间：夜山（同一套语义令牌，组件代码不动） —— */
html[data-theme="dark"] {
  --paper:        #101215;
  --surface:      rgba(255, 255, 255, 0.035);
  --surface-2:    #181B20;
  --ink:          #E8E3D8;
  --ink-rgb:      #E8E3D8;
  --ink-mid:      #A8A29A;   /* 7.4:1 */
  --ink-faint:    #8B857C;   /* 5.1:1 */
  --accent:       #E0644A;   /* 5.4:1 */
  --accent-soft:  rgba(224, 100, 74, 0.16);
  --hairline:        rgba(232, 227, 216, 0.14);
  --hairline-strong: rgba(232, 227, 216, 0.30);

  --seal-bg: #E8E3D8;
  --seal-fg: #101215;
  --seal-shadow: 0 4px 18px rgba(224, 100, 74, 0.28);

  --shadow-1: 0 2px 8px  rgba(0, 0, 0, 0.40);
  --shadow-2: 0 8px 26px rgba(0, 0, 0, 0.46);
  --shadow-3: 0 24px 60px rgba(0, 0, 0, 0.55);
}

/* ==========================================================================
   2. 基础
   ========================================================================== */
* { margin: 0; padding: 0; box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 300;
  font-size: var(--fs-base);
  line-height: 1.9;
  letter-spacing: 0.01em;
  overflow-x: hidden;
  transition: background var(--dur-base) var(--ease-out), color var(--dur-base) var(--ease-out);
}

.mono {
  font-family: var(--mono);
  font-size: 0.78em;
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
}

em { font-style: normal; color: var(--accent); font-weight: 500; }
a  { color: inherit; }

/* 焦点圈：键盘可见，鼠标不打扰 */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

.skip-link {
  position: fixed; top: -100px; left: 16px; z-index: 200;
  background: var(--ink); color: var(--paper);
  padding: 10px 18px; text-decoration: none; font-size: 14px;
  transition: top var(--dur-fast) var(--ease-out);
}
.skip-link:focus { top: 16px; }

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

.wrap { max-width: var(--maxw); margin: 0 auto; }

/* ==========================================================================
   3. 氛围层：渐变网格 + 宣纸颗粒
   ========================================================================== */
.ink-veil {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(1200px 520px at 86% -6%,  var(--accent-soft), transparent 62%),
    radial-gradient(900px 420px  at -8% 28%,  rgba(38, 35, 30, 0.05), transparent 60%),
    radial-gradient(700px 700px  at 50% 118%, var(--accent-soft), transparent 65%);
}
.grain {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  opacity: 0.05; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23n)'/%3E%3C/svg%3E");
}
html[data-theme="dark"] .grain { opacity: 0.07; }

/* ==========================================================================
   4. 阅读进度 + 主题切换
   ========================================================================== */
.read-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 2px;
  z-index: 120; background: transparent; pointer-events: none;
}
.read-progress i {
  display: block; height: 100%; width: 100%;
  background: linear-gradient(90deg, var(--accent), var(--ink-mid));
  transform: scaleX(0); transform-origin: 0 50%;
  will-change: transform;
}

.theme-toggle {
  position: fixed; top: 22px; right: 22px; z-index: 130;
  width: 44px; height: 44px;
  display: grid; place-items: center;
  background: var(--surface);
  backdrop-filter: blur(8px);
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius-md);
  color: var(--ink); cursor: pointer;
  overflow: hidden;
  box-shadow: var(--shadow-1);
  transition: transform var(--dur-fast) var(--ease-out), border-color var(--dur-fast);
}
.theme-toggle:hover { transform: translateY(-2px); border-color: var(--accent); }
.theme-toggle:active { transform: translateY(0) scale(0.96); }
.tt-face {
  grid-area: 1 / 1;
  font-family: var(--serif); font-weight: 900; font-size: 17px; line-height: 1;
  transition: opacity var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out);
}
.tt-night { opacity: 0; transform: translateY(120%) rotate(-20deg); }
html[data-theme="dark"] .tt-day   { opacity: 0; transform: translateY(-120%) rotate(20deg); }
html[data-theme="dark"] .tt-night { opacity: 1; transform: none; color: var(--accent); }

/* ==========================================================================
   5. 导航：桌面竖排 / 移动底部
   ========================================================================== */
.side-nav {
  position: fixed; left: 26px; top: 50%; transform: translateY(-50%);
  z-index: 50;
  display: flex; flex-direction: column; align-items: center; gap: 18px;
}
.side-nav a {
  text-decoration: none; color: var(--ink-faint);
  display: grid; place-items: center;
  width: 34px; height: 34px;
  border-radius: 50%;
  transition: color var(--dur-fast), transform var(--dur-fast) var(--ease-out);
}
.side-nav a:hover { color: var(--ink); transform: translateX(3px); }
.side-nav a.active { color: var(--accent); }
.side-nav a.active::after {
  content: ""; position: absolute; left: -10px;
  width: 5px; height: 5px; border-radius: 50%; background: var(--accent);
}
.side-nav a { position: relative; }
.nav-vert {
  writing-mode: vertical-rl; text-orientation: upright;
  font-family: var(--serif); font-weight: 600; font-size: 14px;
  letter-spacing: 0.1em;
}
.nav-seal {
  font-family: var(--serif); font-weight: 900; font-size: 15px;
  color: var(--seal-fg) !important;
  background: var(--accent);
  border-radius: var(--radius-md) !important;
  box-shadow: var(--seal-shadow);
}
.nav-seal:hover { transform: translateY(-2px); }

.mobile-nav { display: none; }

/* ==========================================================================
   6. 卷首 Hero
   ========================================================================== */
.hero {
  position: relative; z-index: 2;
  min-height: 100vh;
  display: flex; align-items: flex-start;
  padding: 15vh 6vw 0;
  overflow: hidden;
}
.hero-inner { position: relative; z-index: 3; }

.hero-eyebrow {
  font-family: var(--mono); font-size: 12.5px; letter-spacing: 0.32em;
  color: var(--ink-mid); margin-bottom: 28px;
}
.hero-eyebrow::before {
  content: ""; display: inline-block; width: 34px; height: 1px;
  background: var(--accent); vertical-align: middle; margin-right: 14px;
}

.hero-title { display: flex; align-items: flex-start; gap: 22px; margin-bottom: 30px; }
.name-zh {
  font-family: var(--serif); font-weight: 900;
  font-size: clamp(64px, 9vw, var(--fs-2xl));
  line-height: 1.04; letter-spacing: 0.04em;
}
.name-en {
  writing-mode: vertical-rl;
  font-family: var(--latin); font-weight: 600;
  font-size: 15px; letter-spacing: 0.34em;
  color: var(--ink-faint);
  border-left: 1px solid var(--hairline);
  padding-left: 16px; margin-top: 14px;
  height: 5.6em;
}

.hero-thesis {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(19px, 2.2vw, var(--fs-lg));
  line-height: 2.05; color: var(--ink);
  margin-bottom: 18px;
  max-width: 30ch;
}
.hero-sub { color: var(--ink-mid); font-size: 14.5px; margin-bottom: 22px; }

.hero-coord {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  color: var(--ink-faint); margin-bottom: 40px;
  font-size: 12px; letter-spacing: 0.16em;
}
.hero-coord i { width: 1px; height: 10px; background: var(--hairline-strong); font-style: normal; }

.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; }
.btn {
  display: inline-block; text-decoration: none;
  font-family: var(--sans); font-weight: 400; font-size: 14.5px;
  letter-spacing: 0.22em; text-indent: 0.22em;
  padding: 11px 30px;
  border: 1px solid var(--ink);
  transition: background var(--dur-base) var(--ease-out),
              color var(--dur-base) var(--ease-out),
              transform var(--dur-fast) var(--ease-out),
              letter-spacing var(--dur-base) var(--ease-out);
}
.btn:hover { transform: translateY(-2px); letter-spacing: 0.28em; text-indent: 0.28em; }
.btn:active { transform: translateY(0); }
.btn-ink { background: var(--seal-bg); color: var(--seal-fg); border-color: var(--seal-bg); }
.btn-ink:hover { background: var(--accent); border-color: var(--accent); }
.btn-ghost { color: var(--ink); background: transparent; }
.btn-ghost:hover { background: var(--accent-soft); }

/* —— 签名：等高线山峦（JS 生成） —— */
.contour-stage {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 1;
  height: 54vh; min-height: 340px;
  pointer-events: none;
}
.contour-svg { width: 100%; height: 100%; display: block; }
.contour-lines path {
  fill: none; stroke: var(--ink); stroke-width: 1;
  opacity: 0;
}
.contour-lines path.on {
  animation: drawline 2.4s var(--ease-out) forwards, fadein 1.4s ease forwards;
}
@keyframes drawline { from { stroke-dashoffset: 100; } to { stroke-dashoffset: 0; } }
@keyframes fadein   { to { opacity: var(--target, 0.4); } }
#contourFill path {
  fill: url(#inkGrad);
  opacity: 0;
  transition: opacity 1.8s ease;
}
#contourFill path.on { opacity: var(--layer-o, 0.12); }

.contour-caption {
  position: absolute; right: 6vw; bottom: 18px;
  color: var(--ink-faint); font-size: 11.5px; letter-spacing: 0.12em;
}

/* 朱砂闲章 */
.hero-seal {
  position: absolute; z-index: 3;
  right: 7vw; top: 15vh;
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 2px; padding: 6px;
  background: var(--accent);
  border-radius: var(--radius-md);
  box-shadow: var(--seal-shadow);
  transform: rotate(2deg);
}
.hero-seal span {
  font-family: var(--serif); font-weight: 900;
  color: var(--paper);
  width: 30px; height: 30px;
  display: grid; place-items: center;
  font-size: 15px;
}

/* 向下提示 */
.scroll-hint {
  position: absolute; left: 50%; bottom: 22px; z-index: 4;
  transform: translateX(-50%);
  display: grid; justify-items: center; gap: 8px;
  text-decoration: none; color: var(--ink-faint);
  font-size: 10.5px; letter-spacing: 0.3em;
}
.scroll-hint i {
  display: block; width: 1px; height: 40px;
  background: linear-gradient(var(--ink-faint), transparent);
  animation: drop 2.2s var(--ease-out) infinite;
  transform-origin: top;
}
@keyframes drop {
  0%   { transform: scaleY(0); opacity: 0; }
  40%  { transform: scaleY(1); opacity: 1; }
  100% { transform: scaleY(1) translateY(40px); opacity: 0; }
}

/* ==========================================================================
   7. 关键词跑马灯
   ========================================================================== */
.marquee {
  position: relative; z-index: 2;
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  background: var(--surface-2);
  overflow: hidden;
  padding: 12px 0;
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.marquee-track {
  display: flex; align-items: center; gap: 26px;
  width: max-content;
  animation: slide 34s linear infinite;
}
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-track span {
  font-family: var(--mono); font-size: 12.5px; letter-spacing: 0.2em;
  color: var(--ink-mid); white-space: nowrap;
}
.marquee-track i { color: var(--accent); font-style: normal; font-size: 11px; }
@keyframes slide { to { transform: translateX(-50%); } }

/* ==========================================================================
   8. 章节骨架
   ========================================================================== */
main { position: relative; z-index: 2; }
.chapter { position: relative; padding: var(--space-8) 24px var(--space-7); }
.chapter-alt { background: var(--surface-2); }
.chapter { scroll-margin-top: 24px; }

.chapter-head {
  display: flex; align-items: baseline; gap: 22px;
  margin-bottom: var(--space-6);
}
.chapter-index { color: var(--accent); font-size: 13px; letter-spacing: 0.2em; }
.chapter-title {
  font-family: var(--serif); font-weight: 900;
  font-size: clamp(30px, 4vw, var(--fs-xl));
  letter-spacing: 0.06em;
  display: flex; align-items: center; gap: 16px;
}
.vert-glyph {
  writing-mode: vertical-rl; text-orientation: upright;
  font-size: 0.62em; font-weight: 600;
  color: var(--seal-fg);
  background: var(--seal-bg);
  padding: 10px 6px;
  line-height: 1;
  border-radius: var(--radius-sm);
}
.chapter-rule { flex: 1; height: 1px; background: var(--hairline-strong); opacity: 0.5; }

/* —— 识 · about —— */
.about-grid {
  display: grid; grid-template-columns: 1.6fr 1fr; gap: var(--space-6);
  margin-bottom: 72px;
}
.lede {
  font-family: var(--serif); font-weight: 600;
  font-size: 21px; line-height: 2; margin-bottom: 22px;
}
.about-lede p { margin-bottom: 16px; color: var(--ink); max-width: 62ch; }
.about-lede p + p { color: var(--ink-mid); }

.about-facts {
  display: grid; gap: 1px;
  background: var(--hairline);
  border: 1px solid var(--hairline);
  align-content: start;
}
.fact {
  background: var(--paper);
  padding: 18px 20px;
  display: flex; align-items: baseline; gap: 14px;
  transition: background var(--dur-fast);
}
.fact:hover { background: var(--accent-soft); }
.fact b {
  font-family: var(--mono); font-weight: 500;
  font-size: 24px; color: var(--accent); min-width: 64px;
}
.fact span { font-size: var(--fs-sm); color: var(--ink-mid); line-height: 1.6; }

.skill-title {
  font-family: var(--serif); font-weight: 600; font-size: var(--fs-md);
  margin-bottom: 26px; letter-spacing: 0.08em;
}
.skill-title .mono { color: var(--ink-faint); font-weight: 400; }
.ink-bars { display: grid; gap: 20px; }
.ink-bar {
  display: grid; grid-template-columns: 200px 1fr;
  column-gap: 26px; row-gap: 6px;
  align-items: center;
  position: relative;
}
.ib-label { font-weight: 400; font-size: 15px; }
.ib-note  { grid-column: 2; color: var(--ink-faint); font-size: var(--fs-xs); }
.ink-bar i {
  grid-column: 2; grid-row: 1;
  height: 12px; width: var(--w, 50%);
  background: linear-gradient(90deg, var(--ink) 0%, var(--ink-mid) 100%);
  border-radius: 6px 2px 2px 6px;
  position: relative; margin-top: 2px;
}
.ink-bar i::after {
  content: ""; position: absolute; right: -4px; top: 50%;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent);
  transform: translateY(-50%);
  opacity: 0.85;
}

/* —— 究 · research —— */
.research-card {
  border: 1px solid var(--hairline-strong);
  background: var(--paper);
  padding: 54px 56px 44px;
  position: relative;
}
.research-card::before {
  content: ""; position: absolute; inset: 8px;
  border: 1px solid var(--hairline);
  pointer-events: none;
}
.research-tag { color: var(--accent); letter-spacing: 0.3em; margin-bottom: 14px; font-size: 12px; }
.research-title {
  font-family: var(--serif); font-weight: 900;
  font-size: clamp(24px, 3vw, 32px);
  letter-spacing: 0.04em; margin-bottom: 14px;
}
.research-thesis {
  font-family: var(--serif); font-size: 17.5px;
  color: var(--ink-mid); margin-bottom: 38px; max-width: 52ch;
}
.research-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 34px;
  margin-bottom: var(--space-5);
}
.r-item h4 {
  font-family: var(--serif); font-weight: 600; font-size: 15.5px;
  color: var(--accent); letter-spacing: 0.3em; margin-bottom: 10px;
}
.r-item h4::after {
  content: ""; display: block; width: 22px; height: 2px;
  background: var(--accent); margin-top: 8px; opacity: 0.5;
}
.r-item p { font-size: 13.8px; color: var(--ink-mid); line-height: 1.85; }

.research-roadmap {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  padding-top: 26px;
  border-top: 1px solid var(--hairline);
}
.rm-node {
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.06em;
  padding: 6px 14px;
  border: 1px solid var(--hairline-strong);
  color: var(--ink-faint);
  border-radius: var(--radius-lg);
}
.rm-node.done { color: var(--ink); border-color: var(--ink-mid); background: var(--accent-soft); }
.rm-node.done::before { content: "✓ "; color: var(--accent); }
.rm-node.now {
  color: var(--paper); background: var(--accent); border-color: var(--accent);
  box-shadow: 0 3px 12px var(--accent-soft);
}

/* —— 品 · works —— */
.works-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px;
}
.work-card {
  border: 1px solid var(--hairline);
  background: var(--surface);
  padding: 30px 28px 26px;
  display: flex; flex-direction: column; gap: 12px;
  position: relative;
  transition: transform var(--dur-base) var(--ease-out),
              box-shadow var(--dur-base) var(--ease-out),
              border-color var(--dur-base) var(--ease-out);
}
.work-card:hover {
  transform: translateY(-5px);
  border-color: var(--hairline-strong);
  box-shadow: var(--shadow-2);
}
.work-hero {
  grid-row: span 2;
  background: var(--seal-bg); color: var(--seal-fg); border-color: var(--seal-bg);
}
.work-hero .work-meta { color: var(--seal-fg); opacity: 0.62; }
.work-hero p { color: var(--seal-fg); opacity: 0.84; }
.work-hero .work-tags span { border-color: currentColor; opacity: 0.55; color: var(--seal-fg); }
.work-hero .work-status { color: var(--paper); background: var(--accent); border-color: var(--accent); opacity: 1; }
.work-meta { color: var(--ink-faint); font-size: var(--fs-xs); letter-spacing: 0.18em; }
.work-card h3 {
  font-family: var(--serif); font-weight: 900; font-size: 20px;
  letter-spacing: 0.03em; line-height: 1.5;
}
.work-card p { font-size: 13.8px; color: var(--ink-mid); flex: 1; }
.work-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.work-tags span {
  font-family: var(--mono); font-size: 11px;
  border: 1px solid var(--hairline);
  padding: 3px 10px; border-radius: var(--radius-lg); color: var(--ink-mid);
}
.work-status {
  align-self: flex-start;
  font-size: var(--fs-xs); letter-spacing: 0.14em;
  color: var(--accent);
  border: 1px solid currentColor;
  padding: 3px 12px; border-radius: var(--radius-lg);
}
.work-more { justify-content: center; text-align: center; background: transparent; border-style: dashed; }
.work-more h3 { font-size: 18px; }
.work-more .btn { align-self: center; margin-top: 8px; font-size: 13px; padding: 9px 22px; }

/* —— 今 · timeline —— */
.timeline { list-style: none; position: relative; padding-left: 24px; }
.timeline::before {
  content: ""; position: absolute; left: 0; top: 6px; bottom: 6px;
  width: 1px; background: var(--hairline-strong);
}
.tl-item {
  position: relative;
  display: grid; grid-template-columns: 110px 1fr; gap: 30px;
  padding: 0 0 44px 28px;
}
.tl-item::before {
  content: ""; position: absolute; left: -28px; top: 12px;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--paper); border: 2px solid var(--ink-mid);
}
.tl-item:last-child { padding-bottom: 0; }
.tl-next::before {
  border-color: var(--accent); background: var(--accent);
  box-shadow: 0 0 0 5px var(--accent-soft);
}
.tl-item time { font-family: var(--mono); font-size: 14px; color: var(--ink-faint); padding-top: 4px; }
.tl-body h3 {
  font-family: var(--serif); font-weight: 600; font-size: 18px;
  margin-bottom: 6px; letter-spacing: 0.04em;
}
.tl-body p { font-size: 14px; color: var(--ink-mid); max-width: 620px; }

/* —— 络 · reach —— */
.reach-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px;
  margin-bottom: var(--space-7);
}
.reach-card {
  text-decoration: none;
  border: 1px solid var(--hairline-strong);
  padding: 34px 36px;
  background: var(--surface);
  display: flex; flex-direction: column; gap: 8px;
  position: relative;
  transition: transform var(--dur-base) var(--ease-out),
              box-shadow var(--dur-base) var(--ease-out),
              border-color var(--dur-base) var(--ease-out);
}
.reach-card:hover {
  transform: translateY(-5px);
  border-color: var(--accent);
  box-shadow: var(--shadow-2);
}
.reach-static { border-style: dashed; }
.reach-static:hover { transform: none; box-shadow: none; border-color: var(--hairline-strong); }
.reach-card b {
  font-family: var(--serif); font-weight: 900; font-size: 22px; letter-spacing: 0.06em;
}
.reach-card .mono { color: var(--accent); font-size: 13px; }
.reach-card p { color: var(--ink-mid); font-size: var(--fs-sm); }
.reach-arrow {
  position: absolute; top: 26px; right: 26px;
  font-size: 16px; color: var(--ink-faint);
  transition: transform var(--dur-base) var(--ease-out), color var(--dur-base);
}
.reach-card:hover .reach-arrow { transform: translate(3px, -3px); color: var(--accent); }

.site-foot {
  display: flex; align-items: center; gap: 18px;
  padding-top: 28px;
  border-top: 1px solid var(--hairline);
}
.foot-seal {
  font-family: var(--serif); font-weight: 900;
  color: var(--paper); background: var(--accent);
  width: 34px; height: 34px; display: grid; place-items: center;
  border-radius: var(--radius-md); font-size: 16px;
  transform: rotate(-2deg); flex: none;
}
.site-foot p { color: var(--ink-faint); font-size: 12px; }
.foot-top {
  margin-left: auto; text-decoration: none;
  color: var(--ink-mid); font-size: 11.5px; letter-spacing: 0.14em;
  padding: 8px 4px;
  transition: color var(--dur-fast);
}
.foot-top:hover { color: var(--accent); }

/* ==========================================================================
   9. 动效：入场序列 + 滚动浮现
   ========================================================================== */
.reveal {
  opacity: 0; transform: translateY(24px);
  animation: rise var(--dur-slow) var(--ease-out) forwards;
}
.reveal:nth-child(1) { animation-delay: 80ms; }
.reveal:nth-child(2) { animation-delay: 200ms; }
.reveal:nth-child(3) { animation-delay: 320ms; }
.reveal:nth-child(4) { animation-delay: 440ms; }
.reveal:nth-child(5) { animation-delay: 560ms; }
.reveal:nth-child(6) { animation-delay: 660ms; }
@keyframes rise { to { opacity: 1; transform: none; } }

.io {
  opacity: 0; transform: translateY(26px);
  transition: opacity var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out);
}
.io.in { opacity: 1; transform: none; }

/* ==========================================================================
   10. 响应式
   ========================================================================== */
@media (max-width: 1080px) {
  .reach-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 960px) {
  .about-grid { grid-template-columns: 1fr; gap: var(--space-5); }
  .research-grid { grid-template-columns: repeat(2, 1fr); }
  .works-grid { grid-template-columns: repeat(2, 1fr); }
  .work-hero { grid-row: auto; grid-column: span 2; }
}
@media (max-width: 720px) {
  .side-nav { display: none; }
  .theme-toggle { top: 14px; right: 14px; width: 40px; height: 40px; }
  .hero { padding-top: 13vh; }
  .hero-seal { top: 8vh; right: 6vw; transform: rotate(2deg) scale(0.82); }
  .hero-thesis { max-width: none; }
  .about-grid, .works-grid, .reach-grid { grid-template-columns: 1fr; }
  .work-hero { grid-column: auto; }
  .research-grid { grid-template-columns: 1fr; }
  .research-card { padding: 34px 26px; }
  .ink-bar { grid-template-columns: 1fr; }
  .ink-bar i, .ib-note { grid-column: 1; }
  .tl-item { grid-template-columns: 1fr; gap: 6px; }
  .contour-caption, .scroll-hint { display: none; }
  .chapter { padding: var(--space-7) 20px var(--space-6); }
  .site-foot { flex-wrap: wrap; }
  .foot-top { margin-left: 0; }

  /* 移动端底部导航 */
  .mobile-nav {
    display: grid; grid-template-columns: repeat(5, 1fr);
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 110;
    background: var(--paper); /* 兜底：不支持 color-mix 的浏览器 */
    background: color-mix(in srgb, var(--paper) 88%, transparent);
    backdrop-filter: blur(14px);
    border-top: 1px solid var(--hairline);
    padding-bottom: env(safe-area-inset-bottom, 0);
  }
  .mobile-nav a {
    display: grid; place-items: center;
    min-height: 52px; text-decoration: none;
    color: var(--ink-faint);
    font-family: var(--serif); font-weight: 600; font-size: 15px;
    transition: color var(--dur-fast), background var(--dur-fast);
  }
  .mobile-nav a.active { color: var(--accent); background: var(--accent-soft); }
  body { padding-bottom: 56px; }
}

/* ==========================================================================
   11. 降级：减少动态偏好
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .reveal { opacity: 1; transform: none; }
  .io { opacity: 1; transform: none; }
  .contour-lines path {
    animation: none !important;
    opacity: var(--target, 0.4) !important;
    stroke-dashoffset: 0 !important;
  }
  #contourFill path { opacity: var(--layer-o, 0.12); }
  .btn:hover, .work-card:hover, .reach-card:hover, .fact:hover { transform: none; }
  .scroll-hint i { display: none; }
  .marquee-track { animation: none; }
}

/* ==========================================================================
   12. 打印
   ========================================================================== */
@media print {
  .ink-veil, .grain, .side-nav, .mobile-nav, .theme-toggle,
  .read-progress, .scroll-hint, .contour-stage, .marquee { display: none !important; }
  body { background: #fff; color: #000; }
  .chapter { padding: 24px 0; break-inside: avoid; }
}
