/* 剪纸：整页像用彩纸剪出来、再一层层贴上去的（马蒂斯晚年剪纸那一路）。
   形状都是平涂的颜色，边缘带一点手剪的不规则；每片纸有一道很浅的投影，整页盖一层纸的颗粒。
   首屏是一幅不对称的拼贴：头像剪成一块圆石头贴在陶土色的拱形上，周围是剪出来的技术栈标志
   （Claude 像太阳一样垫在名字后面，GPT 贴在蓝纸上，C++、Vulkan 是大块，Unity、Unreal、Python、CMake 是小块）。
   往下：一排浪 → 深蓝的纸上斜放着四张小画 → 撕开的纸边 → 两条路（工作、学历）各串两块石头
   → 一张绿纸上一排可以横着拖的随笔封面（有正式随笔时才有）→ 太阳落在最后一张陶土色的纸后面。
   参考：Lynn Fisher（纸的质感、带引导点的目录）、Malika Favre（平涂的高饱和色，画纸斜着叠放）、
   Jessica Hische（敢用颜色，方形的作品图）、Josh Comeau（用起伏的形状从首屏过渡到正文）、
   草间弥生的网站（把人像放进色块的构图里）、Apple 官网的产品展示条（通栏、露出下一张、前后两个按钮）。 */

@font-face { font-family: "Inter"; src: url("/assets/fonts/inter-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/assets/fonts/inter-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/assets/fonts/inter-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }

:root {
  color-scheme: light;
  /* 颜料：小画里用的几张彩纸，明暗两套都不变（d 是同一种纸深一档，用来做暗面） */
  --p-terra: #c45c38; --p-terra-d: #a8452a; --p-umber: #7c3018;
  --p-mustard: #e2a93b; --p-mustard-d: #c48a22;
  --p-blue: #24467f; --p-blue-d: #18305c;
  --p-sage: #8ea888; --p-sage-d: #5f8263;
  --p-pink: #eeb4aa; --p-pink-d: #d98f86;
  --p-cream: #f9f1df;

  /* 页面：底纸、文字 */
  --paper: #f4ebd9;
  --ink: #1c2a4c; --ink-2: #4b5674; --ink-3: #636a84; --rule: rgba(28, 42, 76, 0.16); --dots: rgba(28, 42, 76, 0.34);
  --accent: var(--p-terra-d);
  /* 整片的纸：暗色里会换成浅一些的 */
  --terra: var(--p-terra); --mustard: var(--p-mustard); --blue: var(--p-blue); --sage: var(--p-sage); --pink: var(--p-pink); --cream: var(--p-cream);
  --name: var(--p-blue); --spark: var(--p-mustard); --py: var(--p-sage-d);
  --chip: #fdf7ea;
  --band: var(--p-blue); --band-2: #2c5191; --band-ink: #f8f0de; --sea-back: var(--p-sage); --torn-core: #fbf6ea;
  --sheet: #fdf7ea; --sheet-ink: #1c2a4c; --sheet-ink-2: #55607c; --sheet-accent: var(--p-terra-d);
  --stone: #fdf8ec; --road-1: var(--p-mustard); --road-2: var(--p-sage);
  --ground: #b04a2c; --ground-ink: #fff6e4; --dusk: var(--p-mustard);
  --label-1: #f9f1df; --label-1-on: var(--p-blue);
  --label-2: var(--p-terra); --label-2-on: #fff6e4;
  --label-3: var(--p-sage); --label-3-on: #1c2a4c;
  /* 纸的厚度：一道贴着边的硬影，加一道淡淡的软影（paste 是贴平在另一片纸上的，影子更薄） */
  --sh: 54, 32, 10;
  --cut: drop-shadow(0 1px 0.6px rgba(var(--sh), 0.24)) drop-shadow(1.5px 3px 4px rgba(var(--sh), 0.18));
  --cut-lg: drop-shadow(0 1px 1px rgba(var(--sh), 0.22)) drop-shadow(3px 7px 10px rgba(var(--sh), 0.2));
  --cut-xl: drop-shadow(0 1px 1px rgba(var(--sh), 0.2)) drop-shadow(6px 16px 22px rgba(var(--sh), 0.24));
  --paste: drop-shadow(0 0.6px 0.4px rgba(var(--sh), 0.3)) drop-shadow(0.6px 1.6px 1.4px rgba(var(--sh), 0.2));
  --grain: 0.26;

  --side: clamp(1.25rem, 6.5vw - 0.6rem, 6rem);          /* 版心两侧最少留这么多 */
  --gutter: max(var(--side), (100vw - 72rem) / 2);        /* 版心两侧实际的留白 */
  --serif: "Noto Serif SC", "Songti SC", "Source Han Serif SC", serif;
  --latin: "Cormorant Garamond", "Noto Serif SC", serif;   /* 现在只有页头的站名「LJYC」（.brand）还在用 */
  /* 年份、日期、编号（时间线的年份、经历的起止年月、随笔卡片的日期、内页的小节编号、目录编号、有序列表、图号、脚注号、翻页卡片上的日期）：
     思源宋体的正体、等高数字，和首屏的拼写、项目标题、板块标题是一家。他的原话：「不是很喜欢这种花体……（包括站内）」「其他地方也更换看看」。
     这些地方原来是斜体的 Cormorant Garamond（--latin）。那种字的数字又窄又矮，所以字号都设得大；思源宋体的数字宽四成、高一成半，
     同样的字号会又大又重。换的时候每一处：字号大约是原来的 0.8 倍，行高写成原来那一行的高度（rem），版面不跟着挪。
     这个变量日文版不覆盖，三种语言是同一种数字。用到它的每一条都带 font-feature-settings: "locl" 0：
     思源宋体会按页面的语言换字形，英文、日文页上的「1」比中文页上的宽，同一个日期三种语言不一样长；关掉以后都是中文页上的样子。 */
  --num: "Noto Serif SC", serif;
  --sans: "Inter", "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  /* 手剪的矩形：四条边都不是完全直的（a、b 给小纸条用，s1、s2 给大张的画用） */
  --clip-a: polygon(1.5% 9%, 34% 0%, 98.5% 5%, 100% 52%, 98% 96%, 60% 100%, 2.5% 93%, 0% 44%);
  --clip-b: polygon(0% 7%, 46% 2%, 99% 0%, 100% 48%, 97.5% 100%, 40% 96%, 1.5% 99%, 2% 50%);
  --clip-s1: polygon(0.5% 1.2%, 36% 0.1%, 99.6% 0.9%, 100% 47%, 99.2% 99.3%, 58% 100%, 0.9% 98.9%, 0% 52%);
  --clip-s2: polygon(1% 0.2%, 55% 1%, 99.2% 0%, 99.7% 58%, 100% 99%, 41% 99.6%, 0.2% 100%, 0.7% 38%);
}
/* 暗色：深蓝色的夜纸，上面是浅色的剪纸 */
[data-mode="dark"] {
  color-scheme: dark;
  --paper: #141e3f;
  --ink: #f4ebd8; --ink-2: #c5c9db; --ink-3: #9197b2; --rule: rgba(244, 235, 216, 0.18); --dots: rgba(244, 235, 216, 0.36);
  --accent: #f0a17c;
  --terra: #d4683f; --mustard: #ecbf57; --blue: #4a72bd; --sage: #a2bd9b; --pink: #f1bbb0; --cream: #f4ebd8;
  --name: #f4ebd8; --spark: #4a72bd; --py: #8fb392;
  --chip: #f4ebd8;
  --band: #0b1230; --band-2: #141f46; --band-ink: #f4ebd8; --sea-back: #33518f; --torn-core: #2a3a6b;
  --sheet: #23336a; --sheet-ink: #f4ebd8; --sheet-ink-2: #c0c6dd; --sheet-accent: #f0b592;
  --stone: #f4ebd8; --road-1: #3a5ca6; --road-2: #4f7d68;
  --ground: #a94727; --ground-ink: #fff3de; --dusk: #f4ebd8;
  --label-1: #f4ebd8; --label-1-on: #18305c;
  --label-2: #d4683f; --label-2-on: #fff6e4;
  --label-3: #a2bd9b; --label-3-on: #141e3f;
  --sh: 0, 0, 0;
  --cut: drop-shadow(0 1px 0.6px rgba(var(--sh), 0.4)) drop-shadow(1.5px 3px 4px rgba(var(--sh), 0.34));
  --cut-lg: drop-shadow(0 1px 1px rgba(var(--sh), 0.4)) drop-shadow(3px 7px 10px rgba(var(--sh), 0.4));
  --cut-xl: drop-shadow(0 1px 1px rgba(var(--sh), 0.4)) drop-shadow(6px 16px 22px rgba(var(--sh), 0.5));
  --paste: drop-shadow(0 0.6px 0.4px rgba(var(--sh), 0.4)) drop-shadow(0.6px 1.6px 1.4px rgba(var(--sh), 0.3));
  --grain: 0.3;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  position: relative; margin: 0; background: var(--paper); color: var(--ink);
  font: 400 1rem/1.8 var(--sans); line-break: strict; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
/* 纸的颗粒：一层深色的细点和一层浅色的细点，盖在所有东西上面，跟着页面一起滚 */
:root { --grain-img: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='a' x='0' y='0' width='100%25' height='100%25' color-interpolation-filters='sRGB'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' seed='4' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .2 0 0 0 0 .12 0 0 0 0 .05 0 0 0 2.2 -.98'/%3E%3C/filter%3E%3Cfilter id='b' x='0' y='0' width='100%25' height='100%25' color-interpolation-filters='sRGB'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='2' seed='11' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 .98 0 0 0 0 .93 0 0 0 1.9 -.9'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23a)'/%3E%3Crect width='240' height='240' filter='url(%23b)'/%3E%3C/svg%3E"); }   /* 颗粒那张图：内页里相纸自己的颗粒也用它 */
body::after {
  content: ""; position: absolute; inset: 0; z-index: 40; pointer-events: none; opacity: var(--grain);
  background: var(--grain-img) 0 0 / 240px 240px;
}
a { color: inherit; text-decoration: none; }
img, svg { display: block; }
p, h1, h2, h3, ul, ol, figure { margin: 0; padding: 0; }
ul, ol { list-style: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 3px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
.wrap { width: min(100% - 2 * var(--side), 72rem); margin-inline: auto; }
.defs { position: absolute; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* 颜色：f-* 用在整片的纸上，k* 是小画里的颜料 */
.f-terra { fill: var(--terra); } .f-mustard { fill: var(--mustard); } .f-blue { fill: var(--blue); }
.f-sage { fill: var(--sage); } .f-pink { fill: var(--pink); } .f-cream { fill: var(--cream); }
.kt { fill: var(--p-terra); } .ktd { fill: var(--p-terra-d); } .kumber { fill: var(--p-umber); }
.km { fill: var(--p-mustard); } .kmd { fill: var(--p-mustard-d); }
.kb { fill: var(--p-blue); } .kbd { fill: var(--p-blue-d); }
.ks { fill: var(--p-sage); } .ksd { fill: var(--p-sage-d); }
.kp { fill: var(--p-pink); } .kpd { fill: var(--p-pink-d); } .kc { fill: var(--p-cream); }

/* ── 一片纸 ──
   外层（.pc）管位置：--z 是它离底纸有多远，指针移动时越靠前的动得越多（--px、--py 由 cutout.js 写在 .hero 上）；
   里层（.cut）管角度（--r）、投影和缓慢的浮动（--t 周期，--bx/--by/--br 幅度）。
   .cut 可以是一张 <svg>，也可以是一个 <div>，里面先放底下的那片，再放贴在它上面的（.on）。 */
.pc { position: absolute; translate: calc(var(--px, 0) * var(--z, 0) * -0.55px) calc(var(--py, 0) * var(--z, 0) * -0.55px); animation: place 0.9s var(--ease) calc(var(--i, 0) * 70ms + 60ms) both; }
.pc > .cut { display: block; position: relative; width: 100%; height: auto; overflow: visible; rotate: var(--r, 0deg); filter: var(--cut); animation: bob var(--t, 9s) ease-in-out calc(var(--i, 0) * -1.7s) infinite alternate; transition: translate 0.35s var(--ease), filter 0.35s; }
.cut > svg { width: 100%; height: auto; overflow: visible; }
.cut > .on.mid { left: 50%; top: 50%; translate: -50% -50%; } /* 贴在底下那片的正中间 */
.cut > .on { position: absolute; left: var(--x, 0%); top: var(--y, 0%); width: var(--w, 100%); rotate: var(--r2, 0deg); filter: var(--paste); }
@keyframes place { from { opacity: 0; scale: 1.07; rotate: -3deg; } }
@keyframes bob { from { transform: translate3d(0, 0, 0) rotate(0deg); } to { transform: translate3d(var(--bx, 3px), var(--by, -6px), 0) rotate(var(--br, 1deg)); } }
.rest .pc > .cut { animation-play-state: paused; } /* 滚出视野就停 */
.shot .pc, .shot .pc > .cut { animation: none; }
@media (prefers-reduced-motion: reduce) { .pc, .pc > .cut { animation: none; } }

/* 技术栈的标志（.lg）：指针停上去时，旁边冒出一张写着名字的小纸签 */
.tip { position: absolute; left: 50%; bottom: calc(100% + 0.25rem); z-index: 3; width: max-content; translate: -50% 0.4rem; rotate: -3deg; scale: 0.9; opacity: 0; filter: var(--cut); pointer-events: none; transition: opacity 0.18s, translate 0.3s var(--ease), scale 0.3s var(--ease); }
.tip.dn { bottom: auto; top: calc(100% + 0.25rem); translate: -50% -0.4rem; rotate: 2.5deg; }
.tip b { display: block; padding: 0.2rem 0.75rem 0.26rem; background: var(--chip); color: #1c2a4c; font: 600 0.8rem/1.4 var(--sans); letter-spacing: 0.06em; clip-path: var(--clip-b); }
.tip.in { left: 27%; bottom: 76%; }
/* 技术栈的标志用各自原来的颜色，明暗两种模式都不变 */
.py-a { fill: #3776ab; } .py-b { fill: #ffd43b; }
.b-openai { fill: #0d0d0d; } .b-unity { fill: #111111; } .b-unreal { fill: #0e1128; } .b-white { fill: #ffffff; }
.b-cpp { fill: #00599c; } .b-vulkan { fill: #ac162c; }
.b-cm-blue { fill: #064f8c; } .b-cm-green { fill: #3eae2b; } .b-cm-red { fill: #dc3122; } .b-cm-gray { fill: #c3ccd6; }

/* ── 首屏 ── */
.hero { position: relative; isolation: isolate; display: flex; flex-direction: column; min-height: 92vh; min-height: max(38rem, min(92svh, 56rem)); overflow: hidden; } /* 首屏不占满一整屏：下面留一条给「项目」露个头 */
.top { position: relative; z-index: 5; display: flex; align-items: center; gap: 2rem; height: 4.75rem; flex: none; }
.brand { display: inline-flex; align-items: center; gap: 0.55rem; font: 700 1.3rem/1 var(--latin); letter-spacing: 0.16em; }
.brand svg { width: 1.7rem; height: auto; overflow: visible; filter: var(--cut); }
/* Logo：三片纸。最大的一块亮色模式是深蓝、暗色模式是奶白；另外两块一直是陶土色和芥黄（形状见 src/logo.mjs） */
.logo-mark .a { fill: var(--p-blue); } .logo-mark .b { fill: var(--p-terra); } .logo-mark .c { fill: var(--p-mustard); }
[data-mode="dark"] .logo-mark .a { fill: #f4ebd8; }
.top nav { display: flex; gap: 0.25rem; margin-left: auto; font-size: 0.95rem; font-weight: 500; }
.top nav a { position: relative; padding: 0.3rem 0.85rem; white-space: nowrap; }
.top nav a::before { content: ""; position: absolute; inset: 0.1rem; z-index: -1; background: var(--mustard); clip-path: var(--clip-a); opacity: 0; transform: rotate(-4deg) scale(0.86); transition: opacity 0.2s, transform 0.35s var(--ease); }
.top nav a:hover::before, .top nav a:focus-visible::before { opacity: 1; transform: rotate(-2deg) scale(1); } /* 指到哪个，哪个底下就垫一张芥黄的小纸片 */
[data-mode="dark"] .top nav a:hover, [data-mode="dark"] .top nav a:focus-visible { color: #141e3f; }
.tools { display: flex; align-items: center; gap: 0.9rem; color: var(--ink-2); font-size: 0.85rem; }
.lang { display: flex; gap: 0.8rem; }
.lang [aria-current] { color: var(--ink); font-weight: 600; }
.mode { all: unset; cursor: pointer; display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%; }
.mode:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.mode::before { content: ""; width: 1.05rem; height: 1.05rem; border-radius: 47% 53% 50% 50% / 52% 48% 52% 48%; background: linear-gradient(90deg, var(--p-mustard) 50%, var(--p-blue) 50%); filter: var(--cut); transition: transform 0.6s var(--ease); }
[data-mode="dark"] .mode::before { transform: rotate(180deg); background: linear-gradient(90deg, #f4ebd8 50%, var(--p-mustard) 50%); }

/* 星星只在夜里出来：宽屏撒在整个首屏上，窄屏跟着拼贴走（免得压到字） */
.sky { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.star { display: none; }
.star .cut { fill: var(--p-mustard); }
[data-mode="dark"] .sky .star { display: block; }

.stage { position: relative; flex: 1; display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr); align-items: center; padding-bottom: 8rem; }
.intro { position: relative; z-index: 1; }
.tag { width: max-content; margin-left: 0.1rem; filter: var(--cut); rotate: -2.5deg; }
.tag span { display: block; padding: 0.3rem 1rem 0.34rem; background: var(--pink); color: #1c2a4c; font-weight: 600; font-size: 0.84rem; letter-spacing: 0.18em; clip-path: var(--clip-b); }
/* 名字：四个字各自歪一点，像一个一个剪下来再贴上去的。
   外面套一层 .namebox，字号定在它上面，两片标志就能用 em 跟着名字一起缩放；标志不放进 <h1>，读屏软件读标题时只读名字。 */
.namebox { position: relative; z-index: 0; width: max-content; margin: 0.2em 0 0 -0.03em; font-size: clamp(4.4rem, 11.25vw, 9rem); }
.name { font: 900 1em/1.1 var(--serif); letter-spacing: 0.02em; color: var(--name); }
.glyphs { white-space: nowrap; }
.glyphs span { display: inline-block; text-shadow: 0 1px 0 rgba(var(--sh), 0.12), 0.012em 0.03em 0.035em rgba(var(--sh), 0.26); }
.glyphs span:nth-child(1) { transform: rotate(-1.8deg) translateY(0.015em); }
.glyphs span:nth-child(2) { transform: rotate(1.1deg) translateY(-0.02em); }
.glyphs span:nth-child(3) { transform: rotate(-0.7deg) translateY(0.012em); }
.glyphs span:nth-child(4) { transform: rotate(1.6deg) translateY(-0.012em); }
.nm-spark { left: 3.52em; top: -0.94em; width: 1.62em; z-index: -1; }   /* Claude：像太阳一样在名字后面，右下的几道光又被拱形压住 */
.nm-spark .cut { fill: #d97757; }   /* Claude 原来的橙色 */
.nm-gpt { left: 3.26em; top: 1.01em; width: 0.66em; z-index: -1; } /* ChatGPT：在「琛」字的正下方、拼音那一行的右边。这块地方在三种语言、各种宽度下都是空的：不压标签，不压正文，也不被名字挡住；和右上角 Claude 的太阳一上一下 */
.nm-gpt .cut { fill: #fffaf0; }                      /* ChatGPT：黑色的太抢眼，改成和底色接近的纸，像一片浮雕：浅底用白的（它本来就有白色版），深底用比底色亮一点的深蓝 */
[data-mode="dark"] .nm-gpt .cut { fill: #2b3a6e; }
.m-only { display: none; }
/* 首屏的拼写：思源宋体的拉丁字母，全大写、拉开字距（他的原话：「A3全大写」）。字体直接写死，不用 --latin（那是站名用的 Cormorant，日文版还另有覆盖），三种语言同一个样子。站内的年份、日期、编号用的 --num 也是思源宋体。
   行高按原来那一行（clamp(1.5rem, 2.5vw, 2.15rem) × 1.2）留：字小了，行的高度不变，开场白和下面的版面都不挪 */
.latin { margin-top: 0.5rem; font: 600 clamp(0.85rem, 1.2vw, 1.08rem) "Noto Serif SC", serif; line-height: calc(1.2 * clamp(1.5rem, 2.5vw, 2.15rem)); text-transform: uppercase; letter-spacing: 0.26em; color: var(--accent); }
/* 首屏唯一的一句话：Feynman 的引文（他的原话：「引文换Richard Feynman的 "What I cannot create, I do not understand."」），三种语言都是英文原句。
   字体写死成思源宋体（和上面的拼写一样）：日文版的 --serif 是系统的明朝体，不写死的话日文页上的拉丁字母会换一种样子。不用斜体。
   两行、断在逗号后面（text-wrap: balance）。左边是内页引用块用的那对剪出来的引号（--motto-quote 是 cutout-inner.css 里 --quote 的一份拷贝，
   那边由 src/make-inner.mjs 生成，首页不加载那个文件）；署名在下面，和正文对齐，破折号是样式加的（读屏软件不读）。 */
.motto { --motto-quote: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 52 38' width='52' height='38'%3E%3Cdefs%3E%3Cfilter id='cut' x='-20%25' y='-20%25' width='140%25' height='150%25' color-interpolation-filters='sRGB'%3E%3CfeDropShadow dx='0.8' dy='1.6' stdDeviation='1.1' flood-color='%232a1404' flood-opacity='0.34'/%3E%3C/filter%3E%3C/defs%3E%3Cg fill='%23c45c38' filter='url(%23cut)'%3E%3Cpath d='M21 5C21 5 15.3 7.2 13 9C10.7 10.8 8.3 13.5 7 16C5.8 18.5 5.2 21.5 5.5 24C5.8 26.5 7.3 29.6 9 31C10.8 32.4 13.8 33 16 32.5C18.2 32 20.9 29.9 22 28C23.1 26.1 23.2 22.8 22.5 21C21.8 19.3 19.4 18.2 18 17.5C16.6 16.8 14 17 14 17C14 17 14.8 13 16 11C17.2 9 21 5 21 5Z'/%3E%3Cpath d='M45 5C45 5 39.3 7.2 37 9C34.7 10.8 32.3 13.5 31 16C29.8 18.5 29.2 21.5 29.5 24C29.8 26.5 31.3 29.6 33 31C34.8 32.4 37.8 33 40 32.5C42.2 32 44.9 29.9 46 28C47.1 26.1 47.2 22.8 46.5 21C45.8 19.3 43.4 18.2 42 17.5C40.6 16.8 38 17 38 17C38 17 38.8 13 40 11C41.2 9 45 5 45 5Z'/%3E%3C/g%3E%3C/svg%3E");
  max-width: 26rem; margin: 1.5rem 0 0; padding-left: 2.9rem; background: var(--motto-quote) 0 0.3rem / 2.2rem auto no-repeat; }
.motto blockquote { margin: 0; font: 600 clamp(1.3rem, 1.85vw, 1.6rem)/1.42 "Noto Serif SC", serif; letter-spacing: 0.005em; color: var(--ink); text-wrap: balance; }
.motto figcaption { margin-top: 0.7rem; font: 500 0.86rem/1.4 var(--sans); letter-spacing: 0.08em; color: var(--ink-3); }
.motto figcaption::before { content: "— "; content: "— " / ""; }
.links { display: flex; flex-wrap: wrap; gap: 0.9rem; margin-top: 2rem; }
/* 按钮：一张手剪的小纸条。外层管投影和角度，里层才剪形状（剪过的元素自己留不住投影） */
.chip { display: inline-block; filter: var(--cut); rotate: 1.2deg; transition: translate 0.35s var(--ease), rotate 0.35s var(--ease), filter 0.35s; }
.chip:nth-child(3) { rotate: -0.8deg; }
.chip span { display: block; padding: 0.62rem 1.4rem 0.68rem; background: var(--chip); color: #1c2a4c; font-weight: 600; font-size: 0.98rem; letter-spacing: 0.08em; clip-path: var(--clip-a); }
.chip:nth-child(3) span { clip-path: var(--clip-b); }
.chip.fill { rotate: -1.6deg; }
.chip.fill span { background: #b44f2e; color: #fff6e4; }
/* 只有图标的按钮（GitHub、写信、文档）：不写字；图标的颜色跟着按钮的字色 */
.chip .ico { display: block; width: 1.42rem; height: 1.42rem; fill: currentColor; }
.chip.ic span { padding: 0.62rem 0.9rem 0.66rem; }
.chip .with-ic { display: flex; align-items: center; gap: 0.55rem; }
.chip .with-ic .ico { width: 1.05rem; height: 1.05rem; }
.chip.navy { rotate: -1.4deg; }
.chip.navy span { background: var(--p-blue); color: #f8f0de; }

/* 拼贴靠下放；屏幕矮的时候整幅拼贴跟着缩小，首屏仍然放得下。
   拼贴的框本身不接指针，只有纸片画出来的地方才接：这样指到的是最上面那片纸，标志的小纸签也不会被透明的边角触发。 */
.collage { position: relative; z-index: 2; justify-self: end; align-self: end; width: 100%; max-width: 35rem; max-width: min(35rem, max(21rem, (92svh - 13rem) * 0.9)); aspect-ratio: 560 / 620; }
.collage, .namebox .pc { pointer-events: none; }
.collage .cut :is(path, use, image), .namebox .cut :is(path, use) { pointer-events: auto; }
.portrait .mat { fill: var(--cream); }

.sea { position: absolute; left: 0; right: 0; bottom: -1px; z-index: 3; height: 8rem; pointer-events: none; }
.sea svg { position: absolute; left: -3rem; top: 0; width: calc(100% + 6rem); height: 100%; overflow: visible; filter: drop-shadow(0 -1px 2px rgba(var(--sh), 0.2)); }
.sea .back { fill: var(--sea-back); animation: drift 17s ease-in-out infinite alternate; }
.sea .front { fill: var(--band); animation: drift 23s ease-in-out -7s infinite alternate-reverse; }
@keyframes drift { from { transform: translateX(-1.3rem); } to { transform: translateX(1.3rem); } }
.rest .sea svg { animation-play-state: paused; }
.shot .sea svg { animation: none; }
@media (prefers-reduced-motion: reduce) { .sea svg { animation: none; } }

/* ── 板块标题：一张纸签（.label）；板块里再分组时用小一号的（.grp）── */
.label { display: flex; align-items: center; gap: 1.1rem; margin-bottom: 2.6rem; }
.label span { filter: var(--cut); rotate: var(--r, -2deg); }
.label b { display: block; padding: 0.28rem 1.05rem 0.36rem 1.4rem; background: var(--c); color: var(--on); font: 800 1.45rem/1.5 var(--serif); letter-spacing: 0.34em; clip-path: var(--clip-b); }
.label b.en { padding-left: 1.15rem; letter-spacing: 0.06em; }   /* 英文的标题不用拉那么开 */
.label small { font-size: 0.8rem; letter-spacing: 0.06em; color: var(--ink-3); }
.grp { display: flex; margin-bottom: 1.2rem; }
.grp span { filter: var(--cut); rotate: var(--r, 2deg); }
.grp b { display: block; padding: 0.12rem 0.6rem 0.18rem 0.9rem; background: var(--c); color: #1c2a4c; font: 700 0.98rem/1.5 var(--serif); letter-spacing: 0.3em; clip-path: var(--clip-a); }

/* ── 项目：一整张深蓝的纸，上面是一条横着的时间线。新的在左边，往右是更早的 ──
   滚动、拖动、吸附和随笔的封面是同一套（.reel，见下面「横向滚动条」）；这里只管每张画多宽、纸带和年份怎么放。 */
.band { position: relative; padding: 0.6rem 0 8rem; background: var(--band); color: var(--band-ink); overflow: hidden; scroll-margin-top: 7rem; } /* 跳过来时把上面那排浪也露出来 */
.band .wrap { position: relative; }
.deco { position: absolute; height: auto; fill: var(--band-2); pointer-events: none; } /* 蓝纸上同色系的两块影子：一个圆，一块石头 */
.deco.d1 { right: -6.5rem; top: 2.5rem; width: 19rem; }
.deco.d2 { left: -5.5rem; bottom: 3.5rem; width: 14rem; rotate: -18deg; }
.tl-head { display: flex; align-items: center; margin-bottom: 0.6rem; }
.tl-head .label { margin-bottom: 0; }
.tl-head .arrow:focus-visible { outline-color: var(--p-mustard); }
/* 手机上：每张封面一样高（--ph），宽度跟着封面的比例（--ar，make.mjs 算好写在每一格上）。桌面上每张一样宽，一页正好三张（见下面「横向滚动条」）。
   几张卡片也一样高：文字少的那张，纸往下多留一点。 */
.reel.tl { --gap: 2.8rem; --ph: 15rem; padding: 2rem 0 0.6rem; }
.reel.tl > li { position: relative; flex: 0 0 calc(var(--ph) * var(--ar, 1.2) + 1.7rem); display: flex; flex-direction: column; }
.sheet { flex: 1; display: flex; rotate: var(--r, 0deg); filter: var(--cut-lg); transition: rotate 0.5s var(--ease), translate 0.5s var(--ease), filter 0.5s; }
/* 纸带（手机上）：每一格画自己的那一段，往右多画一个间距，接起来就是一整条；头尾两段一直伸到屏幕外面。
   桌面上不画这一段，换成一条不动的纸带（.tl-win::before，见下面「横向滚动条」）。
   每段两头的高度一样，所以接缝对得上；投影只往下落、不发散，接缝处不会叠出深色。 */
.when { position: relative; flex: none; padding: 3.4rem 0 0 0.9rem; }
.when::before { content: ""; position: absolute; left: 0; right: calc(var(--gap) * -1); top: 2.05rem; height: 0.62rem; background: var(--road-1);
  clip-path: polygon(0% 18%, 22% 4%, 48% 20%, 76% 0%, 100% 18%, 100% 84%, 70% 100%, 41% 82%, 17% 98%, 0% 84%); filter: drop-shadow(0 2px 0 rgba(var(--sh), 0.3)); }
.reel.tl > li:first-child .when::before { left: calc(var(--pad) * -1); }
.reel.tl > li:last-child .when::before { right: calc(var(--pad) * -1); }
.when .dot { position: absolute; left: 1.1rem; top: 1.3rem; width: 2.1rem; height: auto; overflow: visible; fill: var(--stone); filter: var(--cut); rotate: var(--r, 0deg); }
.when .yr { display: block; padding-top: 0.9rem; font: 600 1.36rem/1.7rem var(--num); font-variant-numeric: lining-nums; font-feature-settings: "locl" 0; color: var(--p-mustard); white-space: nowrap; } /* 行高 1.7rem 是原来那一行的高度，见 :root 的 --num */
.sheet a { flex: 1; display: block; padding: 0.85rem 0.85rem 1.3rem; background: var(--sheet); color: var(--sheet-ink); clip-path: var(--clip-s1); }
li:nth-child(even) > .sheet a { clip-path: var(--clip-s2); }
.sheet a:focus-visible { outline-offset: -0.5rem; } /* 纸片是剪出来的，轮廓线画在外面会被剪掉 */
.sheet .pic { width: 100%; height: auto; overflow: visible; }
.cap { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.15rem 1rem; padding: 1rem 0.55rem 0; } /* 标题和年份一行放不下时，年份自己换到下一行 */
.cap h3 { font: 800 1.5rem/1.4 var(--serif); letter-spacing: 0.01em; }
.cap p { flex: 0 0 100%; font-size: 0.98rem; color: var(--sheet-ink-2); text-wrap: balance; }

/* ── 正文板块 ── */
.sec { position: relative; padding-top: 6.5rem; }
.sec.after-band { padding-top: 8.5rem; }
/* 蓝纸的下边是撕开的：露出一线纸芯 */
.torn { position: absolute; left: 0; top: -1px; z-index: 2; width: 100%; height: 2.75rem; overflow: visible; filter: drop-shadow(0 3px 3px rgba(var(--sh), 0.26)); }
.torn .core { fill: var(--torn-core); }
.torn .face { fill: var(--band); }

/* 经历：竖着排。工作一条路、学历一条路，上下放，各带一张小纸签；每块石头右边一行：名字、做什么、一排点、年份 */
.routes { display: grid; grid-template-columns: minmax(0, 1fr); gap: 3.4rem; }
.track { position: relative; }
.road { position: absolute; fill: var(--road); filter: var(--cut); }
.road.v { left: 0.95rem; top: -0.9rem; width: 3.5rem; height: calc(100% + 1.8rem); }
.path { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.5rem; }
.path li { display: grid; grid-template-columns: 5.4rem 15.5rem auto minmax(2rem, 1fr) auto; column-gap: 1.4rem; align-items: center; }
.stone { position: relative; display: grid; place-items: center; width: 5.4rem; aspect-ratio: 1; filter: var(--cut); transition: rotate 0.5s var(--ease), translate 0.5s var(--ease); }
.stone svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; fill: var(--stone); rotate: var(--r, 0deg); }
.stone img { position: relative; width: 44%; height: 44%; object-fit: contain; mix-blend-mode: multiply; } /* 图标像印在纸上，白底的图也不会露出白边 */
/* 每个图标放多大是量出来的（--iw 是图片宽度，--ix、--iy 把不在文件正中的图形挪回来）：看起来一样大，而不是框一样大。见 tools/measure-icons.mjs */
.stone img[style] { width: var(--iw); height: auto; object-fit: fill; translate: var(--ix, 0%) var(--iy, 0%); }
.path b { margin-left: 0.4rem; font: 700 1.3rem/1.5 var(--serif); }
.path .role { font-size: 0.98rem; color: var(--ink-2); }
.path .dots { height: 0; border-bottom: 2px dotted var(--dots); translate: 0 0.22rem; }
.path .yr { min-width: 7.2rem; text-align: right; font: 500 1.2rem/1.5rem var(--num); font-variant-numeric: lining-nums; font-feature-settings: "locl" 0; color: var(--accent); }

/* 横向滚动条（项目的时间线、随笔的封面）：卡片是一张张相纸。
   手机上是一条通栏的滚动条：第一张和版心的左边对齐，右边总露出下一张的一角（一屏放 --n 张再多三成）；滚到头时最后一张和版心的右边对齐。
   桌面上收进版心，一页正好 --n 张（见下面 min-width: 901px 那段）。
   宽度都用百分比算（相对滚动条自己的宽度），所以不受页面竖向滚动条的影响；溢出收在这条滚动条里，页面本身不会横向滚动。 */
.reel-head { display: flex; align-items: center; gap: 1.1rem; }
.reel-head .label { margin-bottom: 0; }
.reel-nav { display: flex; gap: 0.6rem; margin-left: auto; }
.arrow { all: unset; box-sizing: border-box; cursor: pointer; display: block; width: 2.9rem; height: 2.9rem; filter: var(--cut); transition: translate 0.3s var(--ease), filter 0.3s, opacity 0.25s; }
.arrow svg { width: 100%; height: 100%; overflow: visible; }
.arrow.prev svg { scale: -1 1; }
.arrow .disc { fill: var(--chip); }
.arrow .tri { fill: var(--p-blue); }
.arrow:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 50%; }
.arrow[aria-disabled="true"] { opacity: 0.36; cursor: default; }
.reel {
  --gap: 1.6rem; --n: 4; --pad: max(var(--side), (100% - 72rem) / 2); --w: calc((100% - var(--pad) - var(--n) * var(--gap)) / (var(--n) + 0.3));
  position: relative; display: flex; gap: var(--gap); padding: 1.6rem 0 3rem;
  overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scroll-padding-inline: var(--pad); overscroll-behavior-x: contain;
  scrollbar-width: none; cursor: grab; -webkit-user-select: none; user-select: none;
}
.reel::-webkit-scrollbar { display: none; }
.reel::after { content: ""; flex: 0 0 max(0px, var(--pad) - var(--gap)); } /* 末尾留出和开头一样的边距 */
.reel > li { flex: 0 0 var(--w); scroll-snap-align: start; }
.reel > li:first-child { margin-left: var(--pad); }
.reel > li:last-child { scroll-snap-align: end; }  /* 滚到头：最后一张靠右对齐 */
.reel > li.tail { scroll-snap-align: none; }        /* 最后一屏里的其余几张不单独停（cutout.js 标的） */
.reel.dragging, .reel.gliding { scroll-snap-type: none; } /* 拖的时候和松手后滑向最近一张的那一小段，先不吸附 */
.reel.dragging { cursor: grabbing; }
.reel:focus-visible { outline-offset: -0.4rem; }
.photo { rotate: var(--r, 0deg); translate: 0 var(--dy, 0px); filter: var(--cut-lg); transition: rotate 0.5s var(--ease), translate 0.5s var(--ease), filter 0.5s; }
.photo > div { padding: 0.7rem 0.7rem 0; background: var(--stone); clip-path: var(--clip-s1); }
li:nth-child(even) > .photo > div { clip-path: var(--clip-s2); }
.photo img { width: 100%; height: auto; }
.reel img { -webkit-user-drag: none; -webkit-touch-callout: none; } /* 封面是图片：拖动时间线和随笔时不要把图拖走，手机上长按也不要弹出存图的菜单 */
/* 随笔的卡片：一张相纸（.photo），上面是封面，下面是题目、日期和语言。封面一律裁成 4:5，原图不做别的处理 */
a.photo { display: block; }
.note img { display: block; aspect-ratio: 4 / 5; object-fit: cover; }
.note .nt { display: block; padding: 0.7rem 0.2rem 0.85rem; color: #1c2a4c; }
.note .nt b { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; min-height: 2.9em; font: 700 1.04rem/1.45 var(--serif); letter-spacing: 0.01em; text-wrap: balance; }
.note .nt .row { display: flex; align-items: baseline; justify-content: space-between; gap: 0.6rem; margin-top: 0.45rem; color: #55607c; }
.note .nt time { font: 500 0.86rem/1.08rem var(--num); font-variant-numeric: lining-nums; font-feature-settings: "locl" 0; }
.blog .reel { padding-bottom: 1.2rem; }
.blog .reel-head .arrow:focus-visible { outline-color: var(--p-blue); }
@media (max-width: 1200px) { .reel { --n: 3; } }
/* 桌面上（宽于 900px）两条都收进版心：滚动条是一个居中的「窗口」，比版心两边各宽出 --edge（间距的一半），
   那一点只是给转过角度的纸角和投影留的，卡片从窗口左边往里 --edge 处开始，所以第一张和最后一张都贴着版心的边。
   他的屏幕很宽，原来通栏的一排一路排到屏幕右边，页面别的内容都在中间 72rem 里，这一排歪到右边去了。
   一页正好放 --n 张、填满版心，不再露出下一张（时间线一页三张，随笔宽屏四张、窄一些三张）。手机上还是通栏、露出下一张。 */
@media (min-width: 901px) {
  .reel { --edge: calc(var(--gap) / 2); --pad: var(--edge); --w: calc((100% - 2 * var(--edge) - (var(--n) - 1) * var(--gap)) / var(--n));
    width: calc(min(100% - 2 * var(--side), 72rem) + 2 * var(--edge)); margin-inline: auto; }
  /* 末尾正好留 --edge：::after 那一格本来排在最后一张后面一个 gap 之外，把它往回挪一个 gap、贴着最后一张，宽度就是 --edge。
     这样滚到头的位置和最后一张靠右吸附的位置是同一个，不会停下来又被拉回去。
     （用一格真的东西撑着，不靠最后一张的右边距：边距算不算进滚动范围，各家浏览器不一样） */
  .reel::after { flex-basis: var(--edge); margin-left: calc(var(--gap) * -1); }
  .reel.tl { --gap: clamp(1.8rem, 3.3vw, 2.8rem); }
  .reel.tl > li { flex-basis: calc((100% - 2 * var(--edge) - 2 * var(--gap)) / 3); } /* 三张加两个间距正好是版心的宽度 */
  /* 纸带：收进窗口以后，每张卡片自己画的那一段会被窗口切断。改成一条不动的纸带横贯整张蓝纸，
     卡片和石头在它上面滑，像珠子串在一根带子上。它画在包着时间线的 .tl-win 上，和滚动条一起提到整页的颗粒上面（见文件末尾），
     不然纸带隔着一层颗粒，和卡片不是一个质感；它在滚动条前面，所以垫在卡片和石头下面。
     竖直位置和原来那一段一样：.when 在每张卡片的最下面、高 6rem（上边距 3.4rem + 年份 0.9rem + 1.7rem），
     那一段在 .when 里 2.05rem 处；滚动条底下还有 0.6rem 的 padding。从下往上量，卡片的字多几行也对得上。
     剪边的点比原来一段多得多（上下各二十个、间隔不匀，高低也不是一上一下地轮换），宽屏上拉长了仍然是手剪的；两端的高度和原来一样。 */
  .tl-win { position: relative; z-index: 41; }
  .tl-win::before { content: ""; position: absolute; left: 0; right: 0; bottom: calc(0.6rem + 6rem - 2.05rem - 0.62rem); height: 0.62rem; background: var(--road-1);
    clip-path: polygon(0% 18%, 3.5% 7%, 8% 13%, 12.5% 2%, 15.5% 10%, 21% 19%, 26% 6%, 29.5% 11%, 35% 0%, 41% 15%, 45.5% 8%, 48% 21%, 54% 4%, 60.5% 12%, 64% 1%, 69% 16%, 75.5% 9%, 79% 20%, 85% 5%, 91.5% 14%, 96% 3%, 100% 18%,
      100% 84%, 96.5% 95%, 92% 88%, 86.5% 99%, 83% 83%, 77.5% 91%, 71% 100%, 66.5% 86%, 62% 94%, 56% 81%, 50.5% 97%, 46% 89%, 43% 100%, 37.5% 85%, 31% 92%, 27.5% 80%, 22% 96%, 16.5% 87%, 11% 99%, 6% 90%, 2.5% 97%, 0% 84%);
    filter: drop-shadow(0 2px 0 rgba(var(--sh), 0.3)); }
  .when::before { content: none; }
}

/* ── 页面的结尾：一张陶土色的纸，太阳（夜里是月亮）落在它后面 ── */
.ground { position: relative; margin-top: 10.5rem; color: var(--ground-ink); }
.dusk { right: max(9%, 50% - 29rem); bottom: calc(100% - 4.4rem); width: 11.5rem; }
.dusk .cut { fill: var(--dusk); }
.swell { position: absolute; left: 0; bottom: calc(100% - 1px); width: 100%; height: 6rem; fill: var(--ground); filter: drop-shadow(0 -1px 2px rgba(var(--sh), 0.18)); }
.soil { position: relative; background: var(--ground); }
.bye { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.4rem 3rem; padding: 1.4rem 0 2.6rem; }
.bye .links { margin-top: 0; }

/* ── 悬停：纸片被拿起来一点，摆正 ── */
@media (hover: hover) {
  .chip:hover { translate: 0 -3px; rotate: 0deg; filter: var(--cut-lg); }
  .lg:hover > .cut { translate: 0 -3px; filter: var(--cut-lg); animation-play-state: paused; }
  .lg:hover > .tip { opacity: 1; translate: -50% 0; scale: 1; }
  .sheet:has(a[href]):hover { rotate: 0deg; translate: 0 -8px; filter: var(--cut-xl); z-index: 2; }
  .path li:hover .stone { rotate: -5deg; translate: 0 -4px; }
  .arrow:not([aria-disabled="true"]):hover { translate: 0 -2px; filter: var(--cut-lg); }
  .reel:not(.dragging) .photo:hover { rotate: 0deg; translate: 0 calc(var(--dy, 0px) - 6px); filter: var(--cut-xl); }
}

/* ── 往下滚的时候，纸片一张张放上来 ──
   cutout.js 给 <html> 加上 rv-on 之后才生效；没有脚本、截图（?shot）或系统要求减少动效时，内容一直都在。
   两条横向滚动条（项目的时间线、随笔的封面）是整条一起放上来，里面的卡片不单独入场：
   卡片各自入场的话，横着滑到后面几张时，它们要等露出来才升起，升起之前时间线在那里是断的。 */
.rv-on .rv { opacity: 0; }
.rv-on .rv.in { opacity: 1; animation: rise 0.8s var(--ease) calc(var(--k, 0) * 90ms) backwards; }
@keyframes rise { from { opacity: 0; translate: 0 26px; } }
.rv:nth-child(2) { --k: 1; } .rv:nth-child(3) { --k: 2; } .rv:nth-child(4) { --k: 3; } .rv:nth-child(5) { --k: 4; }
.label.rv, .grp.rv, .reel.rv, .reel-head.rv, .tl-head.rv { --k: 0; }
@media print { .rv-on .rv { opacity: 1; } }

/* ── 窄屏：拼贴放到名字上面，其余改成一栏 ── */
@media (max-width: 900px) {
  .top { gap: 0.6rem; height: 4.2rem; }
  .top nav { gap: 0; font-size: 0.92rem; }
  .top nav a { padding: 0.3rem 0.6rem; }
  [data-mode="dark"] .sky .star { display: none; }
  [data-mode="dark"] .collage .star { display: block; }
  .hero { min-height: 0; }
  .stage { grid-template-columns: minmax(0, 1fr); padding-bottom: 8rem; }
  .collage { order: -1; justify-self: center; width: min(100%, 28rem); max-width: none; margin: 0.4rem 0 1.6rem; }
  .namebox { font-size: clamp(4.2rem, 20.5vw, 7rem); }
  .nm-spark { left: 2.84em; top: -1.1em; width: 1.4em; } /* 太阳挪到「琛」字的右上角，整个留在屏幕里 */
  .nm-gpt { left: 3.22em; top: 1.03em; width: 0.7em; }       /* 窄屏：名字上方没有空，ChatGPT 挪到「琛」字的正下方、拼音那一行的右边，只有顶上一小截被字挡住 */
  .m-only { display: block; }
  .motto { padding-left: 2.5rem; background-size: 1.9rem auto; }
  .links { gap: 0.75rem; }
  .chip span { padding: 0.58rem 1.1rem 0.64rem; font-size: 0.95rem; }
  .sea { height: 6.5rem; }
  .label { margin-bottom: 2.1rem; }
  .band { padding: 0.6rem 0 5.5rem; scroll-margin-top: 6rem; }
  .reel.tl { --gap: 1.8rem; --ph: 12.5rem; padding-top: 1.4rem; }
  .cap h3 { font-size: 1.24rem; }
  .when .yr { font-size: 1.16rem; line-height: 1.45rem; }
  .sec { padding-top: 4.6rem; }
  .sec.after-band { padding-top: 6.4rem; }
  .routes { gap: 2.6rem; }
  .road.v { left: 0.55rem; top: -0.6rem; height: calc(100% + 1.2rem); }
  .path li { grid-template-columns: 4.6rem minmax(0, 1fr); column-gap: 1.1rem; }
  .stone { grid-row: 1 / span 3; width: 4.6rem; }
  .path b { align-self: end; margin-left: 0; font-size: 1.14rem; }
  .path .role { font-size: 0.92rem; }
  .path .dots { display: none; }
  .path .yr { min-width: 0; margin-top: 0.2rem; align-self: start; text-align: left; font-size: 1.14rem; line-height: 1.42rem; }
  .reel { --n: 2; --gap: 1.1rem; padding: 1.3rem 0 2.6rem; }
  .ground { margin-top: 7.5rem; }
  .dusk { right: 1.6rem; bottom: calc(100% - 3.1rem); width: 7.5rem; }
  .swell { height: 4rem; }
}
@media (max-width: 680px) {
  .deco { display: none; }
  .sheet { rotate: calc(var(--r, 0deg) * 0.6); }
  .cap h3 { font-size: 1.32rem; }
  .cap .yr { font-size: 1.42rem; }
}
@media (max-width: 480px) {
  .reel { --n: 1; }
}
@media (max-width: 380px) {
  .top { gap: 0.4rem; }
  .brand { gap: 0.4rem; font-size: 1.15rem; letter-spacing: 0.1em; }
  .top nav { font-size: 0.88rem; }
  .top nav a { padding: 0.3rem; }
  .mode { width: 1.7rem; }
  .chip span { padding: 0.55rem 0.85rem 0.6rem; }
}

/* ── 日文版和英文版（/ja/、/en/）：只换字体和字距，颜色、形状、版面都不变。下面的规则都只认 :lang(ja) / :lang(en)，中文版不受影响 ── */
.lang a { transition: color 0.2s; }
.lang a:hover { color: var(--ink); }
/* 日文：思源宋体的子集里有假名，但汉字是简体中文的字形（「写」「画」这类字和日文不一样），所以先用系统自带的日文字体，都没有时才回到思源宋体。
   名字（h1）和中文写的文章标题标了 lang="zh-CN"，仍用原来的字体。
   --latin 现在只管站名；年份、日期、编号用的 --num（思源宋体）这里故意不覆盖，三种语言的数字一个样子。 */
:root:lang(ja) {
  --serif: "Hiragino Mincho ProN", "Yu Mincho", "YuMincho", "Noto Serif JP", "Noto Serif SC", serif;
  --latin: "Cormorant Garamond", "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif SC", serif;
  --sans: "Inter", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", "YuGothic", "Noto Sans JP", system-ui, sans-serif;
}
:root:lang(ja) [lang|="zh"] {
  --serif: "Noto Serif SC", "Songti SC", "Source Han Serif SC", serif;
  --latin: "Cormorant Garamond", "Noto Serif SC", serif;
  --sans: "Inter", "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
}
/* 字距是给汉字设的：假名和拉丁字母收紧一些 */
.tag span:lang(ja) { letter-spacing: 0.12em; }
.tag span:lang(en) { letter-spacing: 0.08em; }
.label b:lang(ja):not(.en) { padding-left: 1.2rem; letter-spacing: 0.16em; }
.grp b:lang(ja) { letter-spacing: 0.16em; }
.grp b:lang(en) { padding-left: 0.7rem; letter-spacing: 0.06em; }
/* 英文的校名比中文长：「经历」里名字那一列放宽（窄屏本来就是两栏，不用改） */
@media (min-width: 901px) {
  .path li:lang(en) { grid-template-columns: 5.4rem 19.5rem auto minmax(2rem, 1fr) auto; }
}

/* ── Blog：单独的一个板块，自己一张鼠尾草绿的纸 ──
   顶上的剪边和页脚那张纸是同一种画法（.swell），画在上一板块留出的空当里；下面直接接页脚，太阳从绿纸前面升起来。
   纸上的字用深蓝（暗色模式换成深绿的纸、奶白的字）；这几个颜色变量只在这张纸里改。 */
.sec.blog { --blog: var(--p-sage); --ink-2: #2c3958; --ink-3: #3a4764; --dots: rgba(28, 42, 76, 0.5); --rule: rgba(28, 42, 76, 0.26); --accent: #7d2c13;
  margin-top: 9rem; padding: 1.4rem 0 10rem; background: var(--blog); color: var(--ink); }
[data-mode="dark"] .sec.blog { --blog: #2b4a40; --ink-2: #d9dfcd; --ink-3: #b6c4b2; --dots: rgba(244, 235, 216, 0.44); --rule: rgba(244, 235, 216, 0.24); --accent: #f3bd9c; }
.blog > .swell { fill: var(--blog); }
.blog + .ground { margin-top: 0; } /* 还没有随笔时首页没有这个板块，页脚照常用自己的上边距，和内页一样 */
@media (max-width: 900px) {
  .sec.blog { margin-top: 6rem; padding: 0.9rem 0 7.5rem; }
}

/* ── 手机上也能切换语言：窄屏时页头排成两行，上面是站名、语言和明暗，下面是导航 ── */
@media (max-width: 640px) {
  .top { flex-wrap: wrap; height: auto; padding-top: 0.95rem; row-gap: 0.25rem; }
  .top nav { order: 3; flex: 0 0 100%; margin-left: -0.6rem; }
  .tools { margin-left: auto; }
}

/* ── 触屏：没有「指针停上去」，换成两样 ──
   点一下技术栈的标志，名字的小纸签冒出来（.show 是 cutout.js 加的，过一会儿去掉）；
   手指按下去的时候，纸片有一点反应（和鼠标停上去时是同一种动作，幅度小一些）。 */
.lg.show > .cut { translate: 0 -3px; filter: var(--cut-lg); }
.lg.show > .tip { opacity: 1; translate: -50% 0; scale: 1; }
@media (hover: none) {
  a, button { -webkit-tap-highlight-color: transparent; }
  .chip:active { translate: 0 2px; rotate: 0deg; }
  .sheet:has(a[href]):active { rotate: 0deg; translate: 0 -4px; }
  .path li:active .stone { rotate: -5deg; translate: 0 -4px; }
  .arrow:not([aria-disabled="true"]):active { scale: 0.9; }
  .reel .photo:active { rotate: 0deg; }
  .lang a:active { color: var(--ink); }
}

/* ── 会横着滑动的两条（项目的时间线、随笔）不放在整页的颗粒下面 ──
   整页的纸纹颗粒（body::after，z-index 40）是不动的，卡片在它底下滑，看起来就像隔着一层纱。
   所以这两条整条提到颗粒上面；上面的画和照片是干净的，相纸自己再铺一层跟着它走的颗粒（垫在画的下面），纸还是纸。
   （为了能提上来，蓝纸、绿纸和页脚那张纸不再各自成一层，见各自的规则。） */
.reel { z-index: 41; }
.sheet a, .photo > div { position: relative; isolation: isolate; }
.sheet a::after, .photo > div::after { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: var(--grain); background: var(--grain-img) 0 0 / 240px 240px; }

/* 手指点下去时，浏览器默认会在被点的东西上盖一块半透明的矩形：关掉，纸片自己有按下去的反应 */
html { -webkit-tap-highlight-color: transparent; }


/* ── iPhone、iPad 上，横向滚动条里斜放的相纸会漏画文字 ──
   这两种相纸（项目的 .sheet、随笔的 .photo）同时带旋转和投影；iOS 的浏览器在这种情况下有时只画出纸和图，标题和说明是空的
   （2026-11-27 在 iPhone 横屏上见到：三张里往左歪的两张没有字）。让每张相纸自己成一层，文字就画得出来。
   只对 iOS 生效（只有它认 -webkit-touch-callout）：电脑上没有这个问题，单独成层反而会让斜着的字稍微发虚。
   试过没用的：换成 transform: rotate()、只留一道投影、去掉过渡、去掉剪裁、去掉相纸的颗粒、去掉入场动画。 */
@supports (-webkit-touch-callout: none) {
  .sheet, .photo { will-change: transform; }
}

/* ---------- 404 页（src/page-404.mjs）：一屏。纸上贴着 4、太阳、4，下面是和首页一样的地 ---------- */
.nf { position: relative; isolation: isolate; display: flex; flex-direction: column; min-height: 100vh; min-height: 100svh; overflow: hidden; }
.nf-stage { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 1.5rem 0 3.5rem; }
.nf-stage .tag { margin: 0 auto; }
.nf-num { position: relative; z-index: 2; display: flex; align-items: center; justify-content: center; gap: 0.05em; margin: 0.12em 0 0.1em; font: 900 clamp(7.5rem, 25vw, 17.5rem)/1 var(--serif); color: var(--name); }
.nf-num .d { display: block; filter: var(--cut-lg); }
.nf-num .d:first-child { rotate: -5deg; translate: 0 0.02em; }
.nf-num .d:last-child { rotate: 6deg; translate: 0 0.05em; }
.nf-num .o { display: block; width: 0.84em; height: auto; overflow: visible; rotate: 10deg; fill: var(--mustard); filter: var(--cut-lg); } /* 洞是用 mask 挖的，影子会落进洞里 */
.nf-line { position: relative; z-index: 2; font: 600 clamp(1.45rem, 2.6vw, 2rem)/1.4 var(--serif); color: var(--ink); }
.nf-sub { position: relative; z-index: 2; max-width: 30rem; margin-top: 0.7rem; font-size: 1rem; line-height: 1.7; color: var(--ink-2); text-wrap: balance; }
.nf-stage .links { position: relative; z-index: 2; display: flex; flex-wrap: wrap; justify-content: center; gap: 0.9rem; margin-top: 2.1rem; }
.nf-bits { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.nf-bits .leaf { left: calc(50% - min(44vw, 30rem)); top: 30%; width: clamp(6rem, 13vw, 10.5rem); }
.nf-bits .leaf .cut { fill: var(--sage); }
.nf-bits .peb { left: calc(50% + min(31vw, 21rem)); top: 18%; width: clamp(3.4rem, 7vw, 5.6rem); }
.nf-bits .peb .cut { fill: var(--terra); }
.nf-bits .peb2 { left: calc(50% + min(37vw, 26rem)); top: 58%; width: clamp(1.8rem, 3.4vw, 2.7rem); }
.nf-bits .peb2 .cut { fill: var(--pink); }
.nf .ground { margin-top: 5.5rem; }
.nf .bye { justify-content: flex-start; }
@media (max-width: 40rem) {
  .nf-stage { padding-top: 5.5rem; }
  .nf-sub { padding: 0 1.25rem; }
  .nf-bits .leaf { left: -0.6rem; top: 3%; width: 5.4rem; }
  .nf-bits .peb { left: auto; right: 0.2rem; top: 8%; }
  .nf-bits .peb2 { display: none; }
}
