/* ═══════════════════════════════════════════════════════════════════
   切片志 v2 · resume.kesixu.com
   连续变焦之旅(仪器→组织→纤维→核) → 明场图谱正文 → 履历报告。
   商务、严肃、优雅;单一明场主题;全素材自托管,授权见页脚 colophon。
   ═══════════════════════════════════════════════════════════════════ */
:root {
  --paper: #F6F2E9;      /* 象牙纸 */
  --paper-2: #FDFBF6;
  --ink: #262019;
  --muted: #6E6455;
  --line: #D9D1BF;
  --hema: #4E4290;       /* 苏木精,收敛后的紫 */
  --eosin: #B84A66;      /* 伊红,尘玫瑰 */
  --gold: #A98544;       /* 发丝金线 */
  --seal: #B4405E;
  --fs: clamp(15.5px, 1.4vw + 10px, 17px);
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  --serif: "LXGW WenKai R", "Kaiti SC", "STKaiti", "Noto Serif CJK SC", serif;
  --sans: -apple-system, "PingFang SC", "Hiragino Sans GB", "Noto Sans CJK SC", "Microsoft YaHei", system-ui, sans-serif;
}
@font-face {
  font-family: "LXGW WenKai R";
  src: url("../fonts/wenkai-resume.woff2?v=2") format("woff2");
  font-weight: 400 700; font-display: swap;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--fs);
  line-height: 1.9;
  overflow-x: hidden;
}
/* 纸纹:极轻噪点,一次性静态 */
body::before {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image: repeating-conic-gradient(rgba(38,32,25,.014) 0 25%, transparent 0 50%);
  background-size: 3px 3px;
}
::selection { background: var(--hema); color: #fff; }
a { color: var(--hema); text-underline-offset: 3px; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 3px; }

/* ═══ 倍率 HUD ═══ */
#hud {
  position: fixed; z-index: 50;
  top: max(14px, env(safe-area-inset-top));
  left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 12px;
  opacity: 0; pointer-events: none;
  transition: opacity .5s ease;
}
html.journeying #hud { opacity: 1; }
.hud-mag b {
  font-family: var(--mono); font-weight: 500; font-size: 15px;
  letter-spacing: .06em; color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.hud-track {
  width: 120px; height: 1px; background: var(--line); position: relative; display: block;
}
.hud-track i {
  position: absolute; left: 0; top: -0.5px; height: 2px; width: 0%;
  background: var(--gold); display: block;
}
.hud-word { font-family: var(--serif); font-size: 13px; color: var(--muted); letter-spacing: .3em; white-space: nowrap; }

/* ═══ 变焦旅程 ═══ */
#journey { position: relative; height: 100vh; height: 100svh; }
#stack, #overlays { position: absolute; inset: 0; overflow: hidden; }
#journey.pinned #stack, #journey.pinned #overlays { position: fixed; }

.layer {
  /* 画布向四周溢出 18%:层边界永远住在视口之外,入场缩小态不露矩形边 */
  position: absolute; inset: -18%;
  transform-origin: var(--ox, 50%) var(--oy, 50%);
  will-change: transform, opacity;
  opacity: 0; visibility: hidden;
}
.layer[data-l="0"] { opacity: 1; visibility: visible; }
/* 每层的下潜焦点(transform-origin/蒙版圆心)。CSP 禁内联 style,类承载 */
.layer[data-l="0"] { --ox: 56%; --oy: 34%; }
.layer[data-l="1"] { --ox: 33%; --oy: 50%; }
.layer[data-l="2"] { --ox: 57%; --oy: 30%; }
.layer[data-l="3"] { --ox: 46%; --oy: 56%; }
.layer[data-l="4"] { --ox: 50%; --oy: 50%; }
.layer img {
  width: 100%; height: 100%; object-fit: cover; object-position: var(--ox, 50%) var(--oy, 50%);
  display: block; user-select: none; -webkit-user-drag: none;
}
/* 入场羽化:缩小状态的新层以"镜心绽放"的圆场出现,不露矩形边。
   60%→104% 的羽区在原生尺寸时只余 ≈9% 的角部软化,肉眼不可察;
   缩小时则是柔和的圆形视野——正是换物镜时的光学感。 */
.layer:not([data-l="0"]) {
  -webkit-mask-image: radial-gradient(circle at var(--ox,50%) var(--oy,50%), #000 58%, transparent 92%);
          mask-image: radial-gradient(circle at var(--ox,50%) var(--oy,50%), #000 58%, transparent 92%);
}
/* 层罩:统一调进象牙色空间,避免照片"生" */
.layer-tint { position: absolute; inset: 0; background: rgba(246,242,233,.10); mix-blend-mode: lighten; }
.layer-tint.tint-paper { background: linear-gradient(rgba(246,242,233,.42), rgba(246,242,233,.24)); mix-blend-mode: normal; }
.layer-tint.tint-deep { background: radial-gradient(closest-side, transparent 40%, rgba(38,32,25,.24)); mix-blend-mode: normal; }
/* 页缘暗角:全程统一的"镜下视野"感,极轻 */
#stack::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(120% 120% at 50% 46%, transparent 62%, rgba(38,32,25,.14));
}

/* 覆层文本 */
.ov {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  text-align: center; padding: 0 26px;
  opacity: 0; visibility: hidden;
  transform: translateY(14px);
  will-change: transform, opacity;
}
.ov[data-l="0"] { opacity: 1; visibility: visible; transform: none; }
.ov-kicker {
  font-family: var(--mono); font-size: 11px; letter-spacing: .42em;
  color: var(--muted); margin: 0 0 14px;
}
.ov h1 {
  font-family: var(--serif); font-weight: 700;
  font-size: clamp(44px, 11vw, 84px); letter-spacing: .12em;
  margin: 0 0 8px; color: var(--ink);
}
.ov-motto { font-family: var(--serif); font-size: clamp(16px, 3.8vw, 21px); color: var(--eosin); margin: 0 0 14px; }
.ov-sub { color: var(--muted); font-size: clamp(13.5px, 3vw, 15.5px); margin: 0; line-height: 2; }
.ov-hint {
  margin-top: 7vh; color: var(--muted);
  font-family: var(--mono); font-size: 12px; letter-spacing: .3em;
}
.ov-arrow { display: block; width: 1px; height: 34px; margin: 12px auto 0; background: linear-gradient(var(--gold), transparent); }
html.fx .ov-hint { animation: hintdrift 2.8s ease-in-out infinite; }
@keyframes hintdrift { 50% { opacity: .4; transform: translateY(6px); } }

.ov-mag { font-family: var(--mono); font-size: 12px; letter-spacing: .3em; color: #8A6B2C; margin: 0 0 10px; }
.ov h2 {
  font-family: var(--serif); font-weight: 700;
  font-size: clamp(26px, 6.2vw, 44px); letter-spacing: .06em;
  margin: 0 0 14px; color: var(--ink); text-wrap: balance; max-width: 12em;
}
.ov-line {
  font-size: clamp(14.5px, 3.4vw, 17px); line-height: 2.1; color: var(--ink); margin: 0;
  max-width: 34em;
}
.ov-line b { color: var(--hema); }
/* 深层影像上的文字要有"座":磨砂象牙拓片 */
.ov[data-l="1"] .ov-inner, .ov .ov-line, .ov h2, .ov .ov-mag { text-shadow: 0 1px 0 rgba(246,242,233,.6); }
.ov::before {
  content: ""; position: absolute; z-index: -1;
  left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(620px, 92vw); height: min(46vh, 380px);
  background: radial-gradient(closest-side, rgba(246,242,233,.88), rgba(246,242,233,.55) 66%, transparent);
}
.ov[data-l="0"]::before { width: min(680px, 96vw); height: min(56vh, 460px); }

/* ═══ 图谱正文 ═══ */
#atlas { position: relative; z-index: 1; max-width: 720px; margin: 0 auto; padding: 8vh 24px 60px; }
#toc {
  display: flex; flex-wrap: wrap; gap: 4px 22px; justify-content: center;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  padding: 12px 4px; margin-bottom: 7vh;
  font-family: var(--serif); font-size: 14.5px; letter-spacing: .12em;
}
#toc a { color: var(--muted); text-decoration: none; padding: 6px 2px; min-height: 40px; display: inline-flex; align-items: center; }
#toc a:hover { color: var(--hema); }

#atlas section { margin-bottom: 9vh; }
#atlas h2 {
  font-family: var(--serif); font-weight: 700; font-size: clamp(24px, 4.6vw, 30px);
  letter-spacing: .1em; margin: 0 0 26px; display: flex; align-items: center; gap: 14px;
}
#atlas h2 i {
  font-style: normal; font-size: 13px; color: var(--gold); letter-spacing: .2em;
  border: 1px solid var(--gold); border-radius: 50%;
  width: 34px; height: 34px; flex: none;
  display: inline-grid; place-items: center;
}
#atlas h2::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.entry { border-left: 2px solid var(--line); padding: 2px 0 6px 20px; margin-bottom: 26px; position: relative; }
.entry::before {
  content: ""; position: absolute; left: -5px; top: 10px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--eosin); box-shadow: 0 0 0 3px var(--paper);
}
.entry header { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 14px; }
.entry h3 { font-family: var(--serif); font-size: 18px; margin: 0; }
.entry .when { font-family: var(--mono); font-size: 12px; color: var(--muted); letter-spacing: .05em; }
.entry-role { color: var(--eosin); font-size: 14px; margin: 2px 0 6px; }
.entry ul { margin: 4px 0 0; padding-left: 18px; }
.entry li { margin-bottom: 6px; }
.entry li::marker { color: var(--gold); }

/* 项目卡 */
.cells { display: grid; grid-template-columns: 1fr; gap: 12px; }
.cell { border: 1px solid var(--line); border-radius: 6px; background: var(--paper-2); overflow: hidden; }
.cell > button {
  display: flex; align-items: center; gap: 16px; width: 100%;
  padding: 15px 18px; min-height: 64px;
  background: none; border: none; color: inherit; font: inherit; text-align: left; cursor: pointer;
}
.cell-no {
  flex: none; font-family: var(--mono); font-size: 13px; color: var(--gold);
  border-bottom: 1px solid var(--gold); padding-bottom: 2px; letter-spacing: .1em;
}
.cell-title { flex: 1; }
.cell-title b { display: block; font-size: 15.5px; line-height: 1.6; font-weight: 600; }
.cell-title span { font-family: var(--mono); font-size: 11.5px; color: var(--muted); letter-spacing: .04em; }
.cell-x { flex: none; color: var(--muted); transition: transform .3s ease; font-family: var(--mono); }
.cell.open .cell-x { transform: rotate(45deg); color: var(--eosin); }
.cell-body { max-height: 0; overflow: hidden; transition: max-height .45s ease; }
.cell.open .cell-body { max-height: 420px; }
.cell-body ul { margin: 0; padding: 0 20px 16px 58px; }
.cell-body li { margin-bottom: 6px; }
.cell-body li::marker { color: var(--eosin); }

/* 论文 */
.pubs { list-style: none; margin: 0; padding: 0; }
.pubs li { border-top: 1px solid var(--line); padding: 14px 2px; }
.pubs li:last-child { border-bottom: 1px solid var(--line); }
.pub-venue { font-family: var(--mono); font-size: 11px; letter-spacing: .1em; color: var(--gold); display: inline-block; margin-bottom: 3px; }
.pubs .first .pub-venue { color: var(--hema); }
.pub-t { margin: 0; font-size: 15px; line-height: 1.75; }
.pubs .first .pub-t { border-left: 3px solid var(--eosin); padding-left: 12px; }
.pub-a { font-size: 12.5px; color: var(--muted); margin: 3px 0 0; }
.pub-a b { color: var(--eosin); font-weight: 600; }

/* 能力 */
.skilldl { display: grid; grid-template-columns: auto 1fr; gap: 10px 22px; margin: 0; }
.skilldl dt { font-family: var(--serif); color: var(--muted); letter-spacing: .06em; white-space: nowrap; }
.skilldl dd { margin: 0; }
@media (max-width: 560px) { .skilldl { grid-template-columns: 1fr; gap: 2px; } .skilldl dd { margin-bottom: 12px; } }

/* 报告 */
.report-sheet {
  background: var(--paper-2); border: 1px solid var(--line); border-radius: 6px;
  padding: 32px 28px;
  box-shadow: 0 26px 50px -30px rgba(78, 60, 30, .35);
}
.report-sheet header {
  display: flex; justify-content: space-between; align-items: baseline;
  border-bottom: 2.5px solid var(--ink); padding-bottom: 10px; margin-bottom: 18px;
}
.report-sheet header h3 { margin: 0; font-family: var(--serif); font-size: 21px; letter-spacing: .18em; }
.report-no { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.report-sheet dl { display: grid; grid-template-columns: auto 1fr; gap: 8px 18px; margin: 0 0 18px; font-size: 14.5px; }
.report-sheet dt { color: var(--muted); font-family: var(--serif); }
.report-sheet dd { margin: 0; }
.sig-row { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--line); padding-top: 14px; }
.sig { font-family: var(--serif); font-size: 22px; letter-spacing: .1em; }
.seal {
  width: 58px; height: 58px; border-radius: 50%;
  border: 2.5px solid var(--seal); color: var(--seal);
  display: grid; place-items: center; text-align: center;
  font-family: var(--serif); font-size: 11.5px; line-height: 1.3;
  transform: rotate(-9deg); opacity: .85;
}
.dl-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 12px 26px; border-radius: 3px;
  font-size: 15.5px; font-weight: 600; letter-spacing: .04em;
  text-decoration: none; cursor: pointer;
  border: 1.4px solid var(--ink); color: var(--ink); background: transparent;
  transition: transform .15s ease, background .2s ease, color .2s ease;
}
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--ink); color: var(--paper); }
.btn.primary:hover { background: var(--hema); border-color: var(--hema); }
.report-foot { color: var(--muted); font-size: 13.5px; margin-top: 22px; }

.colophon {
  border-top: 1px solid var(--line); margin-top: 8vh; padding: 18px 0 calc(12px + env(safe-area-inset-bottom));
  color: var(--muted); font-size: 12px; line-height: 1.9;
}
.colophon p:last-child { font-family: var(--mono); letter-spacing: .08em; text-align: center; }

/* ═══ 降级:无 JS / reduced-motion → 静态优雅 ═══ */
html.no-fx #journey { height: auto; min-height: 92svh; }
html.no-fx .layer:not([data-l="0"]) { display: none; }
html.no-fx .layer[data-l="0"] { position: absolute; }
html.no-fx .ov { position: relative; inset: auto; opacity: 1; visibility: visible; transform: none; padding: 9vh 26px; }
html.no-fx .ov:not([data-l="0"]) { display: none; }
html.no-fx #hud { display: none; }
@media (prefers-reduced-motion: reduce) {
  .ov-hint, html.fx .ov-hint { animation: none; }
}
