/* ─────────────────────────────────────────────
   01. 设计变量
   ───────────────────────────────────────────── */
:root {
  --paper: #f4f0e7;
  --paper-2: #ece6d9;
  --ink: #1b1a17;
  --muted: #6f695d;
  --line: #d8d1c2;
  --accent: #a8342a;
  --accent-2: #c85545;
  --ghost: rgba(27, 26, 23, 0.07);
  --ghost-stroke: rgba(27, 26, 23, 0.14);
  --star-gold: #b08a4f;
  --planet-teal: #3f8f7a;
  --planet-blue: #4f7fc4;
  --planet-indigo: #6b6fb5;
  --planet-cyan: #4f9fb5;
  --planet-green: #5f9e5f;

  /* 霞鹜文楷（LXGW WenKai）作为主字体，跨平台一致；系统楷体/仿宋/思源宋体依次兜底。 */
  --serif: "LXGW WenKai", "LXGW WenKai Screen", "Kaiti SC", "STKaiti", "KaiTi", "楷体", "FangSong", "仿宋", "STFangsong", "华文仿宋", "Noto Serif CJK SC", "Source Han Serif SC", "Songti SC", Georgia, "Times New Roman", serif;
  --display: "LXGW WenKai", "LXGW WenKai Screen", "Kaiti SC", "STKaiti", "KaiTi", "楷体", "Noto Serif CJK SC", "Source Han Serif SC", "Songti SC", Georgia, serif;
  --sans: "Inter", "Helvetica Neue", "Noto Sans CJK SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: "JetBrains Mono", "SFMono-Regular", "Cascadia Code", "Roboto Mono", Menlo, Consolas, "LXGW WenKai", monospace;

  --max: 1400px;
  --pad: clamp(1.25rem, 5vw, 3.5rem);
  --header-h: 64px;
}

html[data-theme="dark"] {
  --paper: #141311;
  --paper-2: #191814;
  --ink: #e8e2d4;
  --muted: #9b9384;
  --line: #302c25;
  --accent: #d5604e;
  --accent-2: #e07a68;
  --ghost: rgba(232, 226, 212, 0.06);
  --ghost-stroke: rgba(232, 226, 212, 0.12);
  --star-gold: #e2bc7c;
  --planet-teal: #7fc7b2;
  --planet-blue: #8fb3e8;
  --planet-indigo: #a3a6e0;
  --planet-cyan: #8fd0df;
  --planet-green: #8fc78f;
}

/* 无 JS 时跟随系统 */
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) {
    --paper: #141311;
    --paper-2: #191814;
    --ink: #e8e2d4;
    --muted: #9b9384;
    --line: #302c25;
    --accent: #d5604e;
    --accent-2: #e07a68;
    --ghost: rgba(232, 226, 212, 0.06);
    --ghost-stroke: rgba(232, 226, 212, 0.12);
    --star-gold: #e2bc7c;
    --planet-teal: #7fc7b2;
    --planet-blue: #8fb3e8;
    --planet-indigo: #a3a6e0;
    --planet-cyan: #8fd0df;
    --planet-green: #8fc78f;
  }
}

/* ─────────────────────────────────────────────
   02. 基础
   ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html {
  /* 根字号随视口持续增长：窗口变宽时，正文、标题与控件一起放大。
     16px 是可读下限，22px 是超宽屏上限。 */
  font-size: clamp(1rem, 0.65vw + 0.6rem, 1.375rem);
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 1.5rem);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='.16'/%3E%3C/svg%3E"),
    radial-gradient(80rem 42rem at 78% -12%, var(--paper-2), transparent 62%);
  background-repeat: repeat, no-repeat;
  background-size: 180px 180px, auto;
  font-family: var(--serif);
  font-size: clamp(1.04rem, 0.98rem + 0.3vw, 1.12rem);
  font-synthesis: none;
  line-height: 1.95;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

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

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

a { color: inherit; }

.mono {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.wrap {
  width: 100%;
  max-width: min(var(--max), 84vw);
  /* 两侧各留 8vw；超过最大宽度时保持左对齐，不被居中推远 */
  margin-left: clamp(1.5rem, 8vw, 8rem);
  margin-right: auto;
  padding-inline: var(--pad);
}

.skip {
  position: fixed;
  left: 1rem;
  top: -6rem;
  z-index: 120;
  padding: 0.65rem 1rem;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-decoration: none;
  transition: top 0.2s ease;
}
.skip:focus { top: 1rem; }

/* ─────────────────────────────────────────────
   03. 顶部：阅读进度、固定导航
   ───────────────────────────────────────────── */
.progress {
  position: fixed;
  inset: 0 auto auto 0;
  z-index: 110;
  width: 100%;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: 0 50%;
  will-change: transform;
}

.top {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 1rem;
  height: var(--header-h);
  padding-inline: var(--pad);
  background: var(--paper);
  background: color-mix(in srgb, var(--paper) 84%, transparent);
  backdrop-filter: blur(14px) saturate(1.1);
  -webkit-backdrop-filter: blur(14px) saturate(1.1);
  border-bottom: 1px solid transparent;
  transition: border-color 0.35s ease;
}
.top.is-scrolled { border-bottom-color: var(--line); }

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 0.15rem;
  font-family: var(--display);
  font-size: 1rem;
  font-weight: 400;
  letter-spacing: 0.05em;
  text-decoration: none;
  white-space: nowrap;
}
.brand-latin {
  font-family: var(--mono);
  font-size: 0.58rem;
  font-weight: 400;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.topnav {
  display: flex;
  gap: 1.5rem;
  margin-left: auto;
}
.topnav a {
  position: relative;
  padding: 0.3rem 0;
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.25s ease;
}
.topnav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
.topnav a:hover { color: var(--ink); }
.topnav a:hover::after { transform: scaleX(1); }

.theme {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: 1.25rem;
  padding: 0.38rem 0.72rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 0.25s ease, border-color 0.25s ease;
}
.theme:hover { color: var(--accent); border-color: var(--accent); }
html:not(.js) .theme,
html:not(.js) .progress { display: none; }
.theme-dot {
  width: 0.68rem;
  height: 0.68rem;
  border-radius: 50%;
  border: 1px solid currentColor;
  background: linear-gradient(90deg, currentColor 50%, transparent 50%);
}

/* 左侧章节索引 */
.rail {
  position: fixed;
  left: clamp(1rem, 2.2vw, 2.25rem);
  top: 50%;
  z-index: 60;
  display: none;
  transform: translateY(-50%);
}
.rail ol {
  display: grid;
  gap: 1.3rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.rail a {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-decoration: none;
  transition: color 0.25s ease;
}
.rail-num { width: 1.3rem; }
.rail-label {
  opacity: 0.55;
  transition: opacity 0.25s ease;
}
.rail .tick {
  width: 1.05rem;
  height: 1px;
  background: currentColor;
  transition: width 0.35s cubic-bezier(0.22, 1, 0.36, 1), background 0.25s ease;
}
.rail a:hover,
.rail a.is-active { color: var(--accent-2); }
.rail a:hover .rail-label,
.rail a.is-active .rail-label { opacity: 1; }
.rail a.is-active .tick { width: 2.25rem; background: var(--accent-2); }

@media (min-width: 1280px) {
  .rail { display: block; }
}

/* ─────────────────────────────────────────────
   04. Hero
   ───────────────────────────────────────────── */
.hero {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 100vh;
  min-height: 100svh;
  padding-top: var(--header-h);
  overflow: hidden;
}
.hero .wrap {
  position: relative;
  z-index: 1;
  /* 首屏保持原来的居中版式，不跟随下方章节左对齐 */
  margin-inline: auto;
  padding-block: clamp(4rem, 11vh, 8rem);
}
/* 首屏背景：圆形轨道线 + 淡墨 01 */
.hero-contours {
  position: absolute;
  top: 8%;
  right: -16%;
  z-index: 0;
  /* 星系整体随视口缩放，不再被 70rem 固定上限卡住 */
  width: min(86vw, 130vh);
  height: 110%;
  color: var(--ghost-stroke);
  opacity: 0.58;
  pointer-events: none;
  -webkit-mask-image: radial-gradient(60% 65% at 50% 50%, #000 10%, transparent 72%);
  mask-image: radial-gradient(60% 65% at 50% 50%, #000 10%, transparent 72%);
  animation: hero-drift 32s ease-in-out infinite;
  will-change: transform;
}
@keyframes hero-drift {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(0deg); }
  50% { transform: translate3d(-1.8%, 1.2%, 0) rotate(1.2deg); }
}
/* 中心恒星的光晕 */
.star-stop-1 { stop-color: var(--accent); stop-opacity: 0.28; }
.star-stop-2 { stop-color: var(--star-gold); stop-opacity: 0.15; }
.star-stop-3 { stop-color: var(--star-gold); stop-opacity: 0; }
/* 行星点缀：冷色系，大小与公转速度各不相同 */
.planet-a { fill: var(--planet-teal); }
.planet-b { fill: var(--planet-blue); }
.planet-c { fill: var(--planet-indigo); }
.planet-d { fill: var(--planet-cyan); }
.planet-e { fill: var(--planet-green); }
/* 暗色背景上把恒星光晕提亮，避免只剩一个小红点 */
html[data-theme="dark"] .hero-contours { opacity: 0.7; }
html[data-theme="dark"] .star-stop-1 { stop-opacity: 0.7; }
html[data-theme="dark"] .star-stop-2 { stop-opacity: 0.38; }
html[data-theme="dark"] .hero-star {
  filter: drop-shadow(0 0 20px rgba(226, 188, 124, 0.62));
}
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) .hero-contours { opacity: 0.7; }
  html:not([data-theme="light"]) .star-stop-1 { stop-opacity: 0.7; }
  html:not([data-theme="light"]) .star-stop-2 { stop-opacity: 0.38; }
  html:not([data-theme="light"]) .hero-star {
    filter: drop-shadow(0 0 20px rgba(226, 188, 124, 0.62));
  }
}
.hero-mark {
  position: absolute;
  right: clamp(-3rem, -1vw, 1rem);
  bottom: clamp(1rem, 7vh, 5rem);
  z-index: 0;
  font-family: var(--display);
  font-size: clamp(18rem, 32vw, 32rem);
  font-weight: 400;
  line-height: 0.8;
  color: var(--ghost);
  -webkit-text-stroke: 1px var(--ghost-stroke);
  opacity: 0.72;
  user-select: none;
  pointer-events: none;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0;
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}
.eyebrow .dot {
  width: 2rem;
  height: 1px;
  border-radius: 0;
  background: var(--accent);
}
.eyebrow .sep { color: var(--line); }

.hero h1 {
  display: flex;
  align-items: flex-start;
  gap: clamp(0.9rem, 2.5vw, 2.2rem);
  margin: 0.55rem 0 0;
  font-family: var(--display);
  font-size: clamp(3.4rem, 14.5vw, 10.5rem);
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0.03em;
}

.seal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: clamp(2.2rem, 4.2vw, 3.3rem);
  height: clamp(2.2rem, 4.2vw, 3.3rem);
  margin-top: clamp(0.35rem, 1.4vw, 0.9rem);
  border-radius: 2px;
  background: var(--accent);
  color: #f6efe3;
  font-family: var(--display);
  font-size: clamp(1.45rem, 2.9vw, 2.25rem);
  font-weight: 400;
  line-height: 1;
  transform: rotate(4deg);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16), 0 1px 0 rgba(0, 0, 0, 0.12);
  user-select: none;
}

.latin {
  margin: 1rem 0 0;
  font-family: var(--mono);
  font-size: clamp(0.58rem, 0.9vw, 0.72rem);
  letter-spacing: 0.52em;
  text-transform: uppercase;
  color: var(--muted);
}

.tagline {
  margin: 1.5rem 0 0;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.lede {
  max-width: 30em;
  margin: 2.2rem 0 0;
  font-size: clamp(1.12rem, 0.98rem + 0.6vw, 1.4rem);
  line-height: 1.85;
  letter-spacing: 0.01em;
}
.lede-main { display: block; }
.lede-sub {
  display: block;
  margin-top: 0.6em;
  font-size: 0.86em;
  line-height: 1.9;
  color: var(--muted);
}

.hero-foot {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem 2rem;
  max-width: 46rem;
  margin-top: clamp(2.5rem, 6vh, 4.5rem);
  padding-top: 1.1rem;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.vertical {
  position: absolute;
  top: 50%;
  right: clamp(1rem, 3vw, 2.5rem);
  margin: 0;
  transform: translateY(-50%);
  writing-mode: vertical-rl;
  font-family: var(--mono);
  font-size: 0.56rem;
  letter-spacing: 0.38em;
  text-transform: uppercase;
  color: var(--muted);
  opacity: 0.75;
}

/* Hero 入场 */
.hero .eyebrow,
.hero h1,
.hero .latin,
.hero .tagline,
.hero .lede,
.hero .hero-foot {
  animation: rise 0.9s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.hero h1 { animation-delay: 0.06s; }
.hero .latin { animation-delay: 0.12s; }
.hero .tagline { animation-delay: 0.18s; }
.hero .lede { animation-delay: 0.24s; }
.hero .hero-foot { animation-delay: 0.32s; }

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

/* ─────────────────────────────────────────────
   05. 章节骨架
   ───────────────────────────────────────────── */
.section {
  position: relative;
  /* 标题靠近顶部分界线，但仍留出一段呼吸空间 */
  padding-block: clamp(1.75rem, 3vw, 2.5rem) clamp(4.5rem, 10vw, 8rem);
  border-top: 1px solid var(--line);
}
/* 每节右上角的巨型淡墨编号 */
.section::before {
  content: attr(data-num);
  position: absolute;
  top: clamp(0.75rem, 3vw, 2.5rem);
  right: clamp(0.5rem, 3vw, 3rem);
  z-index: 0;
  font-family: var(--display);
  font-size: clamp(7rem, 16vw, 15rem);
  font-weight: 400;
  line-height: 0.8;
  color: var(--ink);
  opacity: 0.05;
  user-select: none;
  pointer-events: none;
}
.section > .wrap {
  position: relative;
  z-index: 1;
}
.sec-grid {
  display: grid;
  /* 标题列按标题实际宽度收窄，正文随之靠近，避免中间空出一大段 */
  grid-template-columns: max-content minmax(0, 1fr);
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: start;
}
.sec-head {
  position: sticky;
  top: calc(var(--header-h) + 2rem);
}
.sec-head::after {
  content: "";
  display: block;
  width: 2.75rem;
  height: 1px;
  margin-top: 1.1rem;
  background: var(--accent);
  opacity: 0.75;
}
.sec-num {
  display: block;
  font-family: var(--mono);
  font-size: 0.82rem;
  letter-spacing: 0.16em;
  color: var(--accent);
}
.sec-head h2 {
  position: relative;
  margin: 0.55rem 0 0.3rem;
  padding-left: 0.75rem;
  font-family: var(--display);
  font-size: clamp(2.4rem, 1.1rem + 3.2vw, 3.7rem);
  font-weight: 400;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.sec-head h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.18em;
  bottom: 0.18em;
  width: 2px;
  background: var(--accent);
}
.sec-en {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--muted);
}

/* 滚动显现 */
html.js .reveal {
  opacity: 0;
  transform: translateY(16px);
  transition:
    opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}
html.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* ─────────────────────────────────────────────
   06. 关于
   ───────────────────────────────────────────── */
.prose {
  max-width: 60ch;
  /* 正文阅读字号单独放大，不再跟首屏标题一起缩放 */
  font-size: clamp(1.12rem, 0.98rem + 0.6vw, 1.3rem);
}
.prose p { margin: 0 0 1.5em; }
.prose p:last-child { margin-bottom: 0; }
.prose p:first-child { font-size: 1.08em; }
.prose p:first-child::first-letter {
  float: left;
  margin: 0.04em 0.12em 0 0;
  font-family: var(--display);
  font-size: 3.2em;
  font-weight: 400;
  line-height: 0.9;
  color: var(--accent);
}
.prose em {
  font-style: normal;
  font-family: var(--mono);
  font-size: 0.86em;
  letter-spacing: 0.03em;
  color: var(--accent);
}

.facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: clamp(1.5rem, 4vw, 3rem);
  margin: 2.75rem 0 0;
  padding: 0;
  border-top: 1px solid var(--line);
}
.fact {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0.08em;
}
.fact dt { color: var(--muted); }
.fact dd { margin: 0; text-align: right; }

/* 技能条 */
.skills {
  margin-top: clamp(2.5rem, 5vw, 3.5rem);
  padding-top: clamp(1.5rem, 3vw, 2rem);
  border-top: 1px solid var(--line);
}
.skills-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.6rem;
}
.skills-title {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 400;
  letter-spacing: 0.2em;
  color: var(--muted);
}
.skills-note {
  font-size: 0.88rem;
  color: var(--muted);
}
.skill-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.15rem clamp(1.75rem, 4vw, 3rem);
  max-width: 56rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.skill {
  display: grid;
  grid-template-columns: 6.5rem minmax(0, 1fr) 2.6rem;
  align-items: center;
  gap: 0.9rem;
}
.skill-name {
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0.08em;
  white-space: nowrap;
}
.skill-track {
  position: relative;
  height: 2px;
  background: var(--line);
}
.skill-fill {
  position: absolute;
  inset: 0 auto 0 0;
  display: block;
  width: 0;
  opacity: 0;
  border-radius: 2px;
  background: var(--accent);
  transition: width 1.1s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.3s ease;
}
.skill-fill::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 0;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  transform: translate(50%, -50%);
}
.reveal.is-visible .skill-fill,
html:not(.js) .skill-fill {
  width: var(--level);
  opacity: 1;
}
.skill:nth-child(2) .skill-fill { transition-delay: 0.08s; }
.skill:nth-child(3) .skill-fill { transition-delay: 0.16s; }
.skill:nth-child(4) .skill-fill { transition-delay: 0.24s; }
.skill:nth-child(5) .skill-fill { transition-delay: 0.32s; }
.skill:nth-child(6) .skill-fill { transition-delay: 0.4s; }
.skill:nth-child(7) .skill-fill { transition-delay: 0.48s; }
.skill:nth-child(8) .skill-fill { transition-delay: 0.56s; }
.skill-value {
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.06em;
  color: var(--muted);
  text-align: right;
}

/* ─────────────────────────────────────────────
   07. 作品
   ───────────────────────────────────────────── */
.projects { margin-top: 0.5rem; }
.project {
  display: grid;
  grid-template-columns: 3rem minmax(0, 1fr);
  gap: 1.25rem;
  padding: clamp(1.9rem, 3.5vw, 2.8rem) 0;
  border-top: 1px solid var(--line);
}
.project:last-child { border-bottom: 1px solid var(--line); }
.project-index {
  padding-top: 0.5rem;
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0.1em;
  color: var(--muted);
}
.kicker {
  margin: 0 0 0.55rem;
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.project h3 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(1.65rem, 1.2rem + 1.4vw, 2.4rem);
  font-weight: 400;
  line-height: 1.25;
  letter-spacing: 0.02em;
}
.project h3 a {
  display: inline-flex;
  align-items: baseline;
  gap: 0.5rem;
  text-decoration: none;
  transition: color 0.25s ease;
}
.project h3 a:hover { color: var(--accent); }
.arrow {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.56em;
  color: var(--muted);
  transform: translateY(-0.1em);
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), color 0.25s ease;
}
a:hover > .arrow,
.project h3 a:hover .arrow {
  color: var(--accent);
  transform: translate(0.16em, -0.26em);
}

.desc {
  max-width: 56ch;
  margin: 0.95rem 0 0;
  font-size: 0.96rem;
  line-height: 1.9;
  color: var(--muted);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 1.15rem 0 0;
  padding: 0;
  list-style: none;
}
.tags li {
  padding: 0.22rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 0.56rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.project-links { margin: 1.2rem 0 0; }
.project-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.6rem 1rem;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--paper-2);
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink);
  transition: color 0.25s ease, background-color 0.25s ease, border-color 0.25s ease;
}
.store-mark {
  display: inline-grid;
  grid-template-columns: repeat(2, 4px);
  grid-template-rows: repeat(2, 4px);
  gap: 2px;
}
.store-mark i { background: currentColor; }
.project-links a:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--paper);
}
.project-links a .arrow { color: inherit; }

.project-video { margin: clamp(1.4rem, 3vw, 2rem) 0 0; }
.project-video video {
  display: block;
  width: 100%;
  height: auto;
  max-width: 50rem;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: #000;
}
.project-video figcaption {
  margin-top: 0.65rem;
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.more {
  margin: 1.9rem 0 0;
  text-align: right;
}
.more a {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
  padding-bottom: 0.15rem;
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-decoration: none;
  color: var(--muted);
  transition: color 0.25s ease, border-color 0.25s ease;
}
.more a:hover { color: var(--accent); border-color: var(--accent); }

/* ─────────────────────────────────────────────
   08. 爱好
   ───────────────────────────────────────────── */
.rows {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}
.rows li {
  display: grid;
  grid-template-columns: 7rem minmax(0, 1fr);
  gap: 1.5rem;
  align-items: baseline;
  padding: 1.35rem 0;
  border-bottom: 1px solid var(--line);
}
.rows .label {
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}
.rows .value {
  font-size: 1.02rem;
  line-height: 1.8;
}

/* ─────────────────────────────────────────────
   09. 格言
   ───────────────────────────────────────────── */
.quote {
  margin: 0;
  padding-left: clamp(1.25rem, 2.5vw, 2rem);
  border-left: 1px solid var(--line);
  font-family: var(--display);
  font-size: clamp(1.65rem, 1.2rem + 2vw, 2.7rem);
  font-weight: 400;
  line-height: 1.7;
  letter-spacing: 0.02em;
  text-wrap: pretty;
}
.quote p { margin: 0; }
.quote cite {
  display: block;
  margin-top: 1.5rem;
  font-family: var(--mono);
  font-size: 0.68rem;
  font-style: normal;
  letter-spacing: 0.16em;
  color: var(--muted);
}
.mottos {
  display: grid;
  gap: 0.55rem;
  max-width: 36rem;
  margin-top: clamp(2rem, 4vw, 3rem);
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.98rem;
}
.mottos p { margin: 0; }
.mottos .mono {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  color: var(--ink);
}

/* ─────────────────────────────────────────────
   10. 友链
   ───────────────────────────────────────────── */
.links-lede {
  max-width: 40ch;
  margin: 0 0 2rem;
  font-size: 1.02rem;
  color: var(--muted);
}
.friend-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
  gap: clamp(0.9rem, 2vw, 1.35rem);
  max-width: 56rem;
}
.friend-card {
  position: relative;
  display: block;
  border-radius: 6px;
  color: var(--ink);
  text-decoration: none;
}
.friend-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: clamp(5.5rem, 9vw, 7rem);
  padding: 1rem clamp(1.25rem, 3vw, 2rem);
  overflow: hidden;
  border-radius: 6px;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.35s ease;
}
.friend-bg {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--friend-color, #5b9bd5);
  transition: height 0.45s cubic-bezier(0.22, 1, 0.36, 1), border-radius 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}
.friend-card:hover .friend-visual {
  transform: translateY(-0.25rem);
  box-shadow: 0 0.85rem 2rem rgba(27, 26, 23, 0.14);
}
.friend-card:hover .friend-bg {
  height: 100%;
  border-radius: 6px;
}
.friend-inner {
  position: relative;
  display: flex;
  align-items: baseline;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  text-align: center;
  transition: color 0.3s ease;
}
.friend-name {
  font-family: var(--display);
  font-size: clamp(1.45rem, 1.15rem + 0.9vw, 1.9rem);
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: 0.14em;
}
.friend-sep {
  color: rgba(27, 26, 23, 0.32);
  transition: color 0.3s ease;
}
.friend-url {
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  color: rgba(27, 26, 23, 0.55);
  transition: color 0.3s ease;
}
.friend-card:hover .friend-sep { color: rgba(27, 26, 23, 0.55); }
.friend-card:hover .friend-url { color: var(--ink); }

/* ─────────────────────────────────────────────
   11. 联系
   ───────────────────────────────────────────── */
.contact-lede {
  max-width: 40ch;
  margin: 0 0 2.25rem;
  font-size: 1.02rem;
  color: var(--muted);
}
.contact {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}
.contact a {
  display: grid;
  grid-template-columns: 8.5rem minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: baseline;
  padding: 1.45rem 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
  transition: color 0.25s ease, padding-left 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
.contact a:hover {
  padding-left: 0.6rem;
  color: var(--accent);
}
.contact .network {
  font-family: var(--mono);
  font-size: 0.85rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.contact .handle {
  font-size: clamp(1.15rem, 1rem + 0.55vw, 1.45rem);
  letter-spacing: 0.01em;
  overflow-wrap: anywhere;
}
.contact .arrow { font-size: 0.85rem; }

/* ─────────────────────────────────────────────
   12. 页脚
   ───────────────────────────────────────────── */
.footer {
  padding-block: 2.75rem 3rem;
  border-top: 1px solid var(--line);
}
.footer-grid {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.5rem 3rem;
}
.footer-name {
  margin: 0;
  font-family: var(--display);
  font-size: 1.3rem;
  font-weight: 400;
  letter-spacing: 0.05em;
}
.footer-handle {
  margin: 0.35rem 0 0;
  font-size: 0.56rem;
  letter-spacing: 0.2em;
  color: var(--muted);
}
.colophon {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.58rem;
  line-height: 2;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: right;
}
.colophon a {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
  transition: color 0.25s ease;
}
.colophon a:hover { color: var(--accent); }
.copy {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  margin-top: 2.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 0.56rem;
  letter-spacing: 0.08em;
  color: var(--muted);
}

/* ─────────────────────────────────────────────
   13. 响应式
   ───────────────────────────────────────────── */
@media (max-width: 900px) {
  .vertical { display: none; }
  .hero-contours {
    right: -52%;
    width: 130%;
    opacity: 0.32;
  }
  .hero-mark {
    right: -6rem;
    font-size: 22rem;
    opacity: 0.45;
  }
}

@media (max-width: 760px) {
  .topnav { display: none; }
  .theme { margin-left: auto; }
  .hero-contours,
  .hero-mark { display: none; }

  .sec-grid { grid-template-columns: 1fr; gap: 1.6rem; }
  .sec-head {
    position: static;
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.4rem 0.75rem;
  }
  .sec-head h2 { margin: 0; }
  .sec-en { margin-left: auto; }

  .facts { grid-template-columns: 1fr; }
  .skill-grid { grid-template-columns: 1fr; }
  .project { grid-template-columns: 1fr; gap: 0.4rem; }
  .project-index { padding-top: 0; }
  .rows li { grid-template-columns: 1fr; gap: 0.35rem; }
  .more { text-align: left; }

  .sec-head::after { display: none; }
  .quote { padding-left: 1.1rem; }
}

@media (max-width: 600px) {
  .brand-latin { display: none; }
  .contact a { grid-template-columns: 1fr auto; }
  .contact .network { grid-column: 1 / -1; margin-bottom: 0.15rem; }
  .contact a:hover { padding-left: 0.25rem; }
  .colophon { text-align: left; }
}

/* ─────────────────────────────────────────────
   14. 动效偏好 / 打印
   ───────────────────────────────────────────── */
@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;
  }
  html.js .reveal { opacity: 1; transform: none; }
  .hero-contours { animation: none; }
  .hero-planets { display: none; }
}

@media print {
  .top, .rail, .progress, .vertical, .skip, .theme { display: none !important; }
  body {
    background: #fff;
    color: #000;
    font-size: 11pt;
  }
  .hero-contours, .hero-mark { display: none !important; }
  .skill-fill { width: var(--level) !important; opacity: 1 !important; }
  a { text-decoration: none; }
}
