/* =======================================================
   resume.css —— 履历页专属样式
   设计延续主站日式电子书风格，新增：
     · 书籍封面 + 书脊侧边章节标
     · 时间线左竖线 + 章节卡
     · KPI 数字滚动
     · 章节侧边目录（吸右）
   ======================================================= */

/* ------- 1. 页面整体（履历专属底色） ------- */
.book--resume {
  background-color: var(--paper);
  background-image:
    radial-gradient(rgba(var(--ink-rgb),0.04) 1px, transparent 1px),
    repeating-linear-gradient(0deg, transparent 0 28px, rgba(var(--ink-rgb),0.025) 28px 29px);
  background-size: 5px 5px, 100% 29px;
}

/* 页面右侧"装订孔"装饰 */
.book--resume::before {
  content: ""; position: fixed;
  left: 18px; top: 90px; bottom: 90px;
  width: 1px;
  background: repeating-linear-gradient(180deg, var(--line) 0 8px, transparent 8px 22px);
  opacity: .5; pointer-events: none; z-index: 1;
}
.book--resume::after { display: none; }

/* ------- 2. 履历封面 ------- */
.resume-cover {
  position: relative;
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: var(--s-6);
  max-width: var(--container);
  margin: 0 auto;
  padding: var(--s-9) var(--s-6) var(--s-7);
  min-height: 80vh;
  align-items: center;
}

/* 书脊侧边 */
.resume-cover__sidebar {
  align-self: stretch;
  display: flex; flex-direction: column;
  justify-content: space-between; align-items: center;
  padding: var(--s-4) 0;
  border-right: 1px solid var(--line);
  font-family: var(--font-jp);
  writing-mode: vertical-rl;
}
.resume-cover__chapter {
  font-size: 11px; letter-spacing: .55em; color: var(--shu); font-weight: 600;
}
.resume-cover__page {
  font-size: 13px; letter-spacing: .35em; color: var(--ink-mute);
}

/* 封面正文 */
.resume-cover__inner { padding-right: var(--s-6); }
.resume-cover__eyebrow {
  font-family: var(--font-jp); font-size: 12px;
  letter-spacing: .55em; color: var(--shu);
  margin-bottom: 18px;
}
.resume-cover__title {
  font-family: var(--font-jp); font-weight: 800;
  font-size: clamp(64px, 10vw, 156px);
  line-height: 1; margin-bottom: var(--s-4);
}
.resume-cover__title .ink {
  display: inline-block; opacity: 0; filter: blur(8px);
  transform: translateY(20px);
  animation: inkBleed 1s var(--ease-out) forwards;
}
.resume-cover__title .ink:nth-child(1) { animation-delay: .1s; }
.resume-cover__title .ink:nth-child(2) { animation-delay: .35s; }
.resume-cover__title .ink:nth-child(3) { animation-delay: .55s; }
.resume-cover__title .ink--accent {
  color: var(--shu);
  font-family: var(--font-hand);
  font-size: .9em;
  margin: 0 .12em;
}
.resume-cover__sub {
  font-family: var(--font-serif);
  font-size: clamp(18px, 2vw, 24px);
  color: var(--ink-soft);
  line-height: 1.6;
  margin-bottom: var(--s-6);
  max-width: 560px;
}
.resume-cover__sub em {
  font-style: italic; color: var(--shu);
  font-family: var(--font-hand); font-size: 1.4em;
}

/* KPI 网格 */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--s-3);
  max-width: 720px;
  border-top: 1px solid var(--line);
  padding-top: var(--s-5);
}
.kpi {
  display: flex; flex-direction: column; gap: 4px;
}
.kpi strong {
  font-family: var(--font-jp); font-weight: 700;
  font-size: clamp(36px, 4vw, 56px);
  line-height: 1; color: var(--shu);
  font-variant-numeric: tabular-nums;
}
.kpi span {
  font-size: 12px; color: var(--ink-mute);
  letter-spacing: .12em;
}

/* ------- 3. 时间线主体 ------- */
.resume-timeline {
  position: relative;
  max-width: var(--container);
  margin: 0 auto;
  padding: var(--s-7) var(--s-6) var(--s-9);
}
/* 中央时间竖线 */
.resume-timeline::before {
  content: "";
  position: absolute;
  left: 60px; top: 0; bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, transparent 0, var(--line) 60px, var(--line) calc(100% - 60px), transparent 100%);
}

/* 单个章节（公司） */
.chap {
  position: relative;
  margin-bottom: var(--s-9);
  padding-left: 120px;
}
.chap:last-child { margin-bottom: var(--s-6); }

/* 章节圆点（位于竖线上） */
.chap::before {
  content: ""; position: absolute;
  left: 51px; top: 16px;
  width: 20px; height: 20px;
  background: var(--shu);
  border-radius: 50%;
  border: 4px solid var(--paper);
  box-shadow: 0 0 0 2px var(--shu), 0 4px 12px rgba(var(--shu-rgb),.3);
  z-index: 2;
  animation: dotPulse 3s var(--ease-out) infinite;
}
@keyframes dotPulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.18); }
}

.chap__header {
  margin-bottom: var(--s-5);
}
.chap__meta {
  display: flex; align-items: center; gap: var(--s-3);
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.chap__seq {
  font-family: var(--font-jp); font-weight: 700;
  font-size: 14px;
  color: #fff; background: var(--ink);
  padding: 4px 10px; border-radius: 4px;
  letter-spacing: .08em;
}
/* pixel: ink=#EAEAEA (浅灰) 上 #fff 文字对比不足 → 反转为深底 + 像素绿字
   washi=#1A1A2E + shu=#00C853 = 9.4:1 ✓ AAA */
[data-theme="pixel"] .chap__seq {
  color: var(--shu);
  background: var(--washi);
  border: 2px solid var(--shu);
  border-radius: 0;
  padding: 2px 8px;
}
/* terminal: ink=#00FF41 (亮绿) 上 #fff 文字对比不足 → 反色:深底 + 亮绿字
   washi=#0A0E0A + shu=#00FF41 = 13.2:1 ✓ AAA */
[data-theme="terminal"] .chap__seq {
  color: var(--shu);
  background: var(--washi);
  border: 1px solid var(--shu);
  border-radius: 0;
  padding: 2px 8px;
}
.chap__date {
  font-family: 'JetBrains Mono', var(--font-sans);
  font-size: 13px; color: var(--ink-mute);
  letter-spacing: .04em;
}
.chap__tags {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin-left: auto;
}
.tag {
  font-size: 12px; padding: 4px 10px;
  border-radius: 999px;
  background: var(--washi-2);
  color: var(--ink-soft);
  border: 1px solid var(--line);
  font-weight: 500;
}
.tag--shu    { color: var(--shu);    border-color: rgba(var(--shu-rgb),.3); background: rgba(var(--shu-rgb),.06); }
.tag--matcha { color: var(--matcha); border-color: rgba(var(--matcha-rgb),.35); background: rgba(var(--matcha-rgb),.08); }

.chap__company {
  display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap;
  font-family: var(--font-jp);
  font-weight: 800;
  font-size: clamp(32px, 4.5vw, 56px);
  line-height: 1.1;
  letter-spacing: -.01em;
}
.chap__company .ink {
  position: relative;
  display: inline-block;
}
.chap__company .ink::after {
  /* 公司名下浪线 */
  content: ""; position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 12px;
  background: linear-gradient(180deg, transparent 50%, rgba(var(--shu-rgb),.18) 50%);
  z-index: -1;
  transition: background-color .4s var(--ease-out);
}
.chap__company em {
  font-family: var(--font-hand);
  font-style: normal; font-weight: 600;
  font-size: .55em;
  color: var(--shu);
  letter-spacing: .04em;
}

/* ---- 故事列表（每段经历） ---- */
.story {
  display: flex; flex-direction: column;
  gap: var(--s-4);
  background: var(--washi);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: var(--s-5) var(--s-6);
  position: relative;
  transition: transform .5s var(--ease-out), box-shadow .5s var(--ease-out);
}
.story::before {
  /* 卡片左侧色带 */
  content: ""; position: absolute;
  left: 0; top: 24px; bottom: 24px;
  width: 3px;
  background: linear-gradient(180deg, var(--shu), var(--kincha));
  border-radius: 0 3px 3px 0;
}
.chap:hover .story {
  transform: translateY(-4px);
  box-shadow: var(--shadow-2);
}

.story__item {
  padding: 0 0 var(--s-3);
  border-bottom: 1px dashed var(--line);
}
.story__item:last-child { border-bottom: none; padding-bottom: 0; }

.story__title {
  font-family: var(--font-jp); font-weight: 700;
  font-size: 18px; color: var(--ink);
  margin-bottom: 8px;
  display: inline-flex; align-items: center; gap: 8px;
}
.story__title::before {
  content: "";
  width: 6px; height: 6px;
  background: var(--shu);
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.story p, .story__sublist li {
  font-size: 14.5px;
  line-height: 1.8;
  color: var(--ink-soft);
}
.story__sublist {
  margin-top: 6px;
  padding-left: 18px;
  display: flex; flex-direction: column; gap: 8px;
}
.story__sublist li {
  position: relative;
  padding-left: 12px;
}
.story__sublist li::before {
  content: ""; position: absolute;
  left: 0; top: 12px;
  width: 6px; height: 1px;
  background: var(--ink-mute);
}

/* 数据高亮 mark —— 朱砂高亮笔 */
.story mark {
  background: linear-gradient(180deg, transparent 55%, rgba(var(--shu-rgb),.22) 55%);
  color: var(--shu-deep);
  font-weight: 700;
  padding: 0 2px;
  border-radius: 2px;
  font-family: 'JetBrains Mono', var(--font-sans);
  font-size: .94em;
}
.story strong {
  color: var(--ink);
  background: linear-gradient(180deg, transparent 60%, rgba(var(--matcha-rgb),.25) 60%);
  padding: 0 2px;
}

/* ------- 4. 卷尾 ------- */
.resume-end {
  text-align: center;
  padding: var(--s-9) var(--s-6);
  background: var(--washi-2);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.resume-end__seal {
  display: inline-grid; place-items: center;
  width: 96px; height: 96px;
  font-family: var(--font-jp); font-weight: 700; font-size: 56px;
  color: #fff; background: var(--shu);
  border-radius: 8px;
  transform: rotate(-8deg);
  margin-bottom: var(--s-4);
  box-shadow: 0 12px 30px rgba(var(--shu-deep-rgb),.35);
  animation: stampDrop 1.4s var(--ease-out) both;
}
.resume-end h3 {
  font-family: var(--font-jp); font-weight: 700;
  font-size: 28px; margin-bottom: 8px;
  letter-spacing: .1em;
}
.resume-end p {
  color: var(--ink-mute);
  font-family: var(--font-hand);
  font-size: 22px;
  margin-bottom: var(--s-5);
}

/* ------- 5. 章节侧边目录（吸右） ------- */
.chap-toc {
  position: fixed; right: 32px; top: 50%; transform: translateY(-50%);
  display: flex; flex-direction: column; gap: 14px;
  z-index: 40;
}
.chap-toc a {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-jp); font-size: 12px;
  color: var(--ink-mute);
  transition: color .3s var(--ease-out), transform .3s var(--ease-out);
}
.chap-toc a::before {
  content: attr(data-chap);
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--paper);
  font-weight: 600;
  font-family: 'JetBrains Mono', var(--font-sans);
  font-size: 11px;
  transition: all .3s var(--ease-out);
}
.chap-toc a span {
  opacity: 0;
  transform: translateX(-8px);
  transition: opacity .3s var(--ease-out), transform .3s var(--ease-out);
  pointer-events: none;
}
.chap-toc a:hover, .chap-toc a.is-active {
  color: var(--shu);
  transform: translateX(-6px);
}
.chap-toc a:hover::before, .chap-toc a.is-active::before {
  background: var(--shu); color: #fff; border-color: var(--shu);
  box-shadow: 0 4px 14px rgba(var(--shu-rgb),.35);
}
.chap-toc a:hover span, .chap-toc a.is-active span {
  opacity: 1; transform: translateX(0);
}

/* ------- 6. 响应式 ------- */
@media (max-width: 960px) {
  .resume-cover { grid-template-columns: 60px 1fr; padding-top: var(--s-7); }
  .kpi-grid     { grid-template-columns: repeat(2, 1fr); }
  .resume-timeline::before { left: 32px; }
  .chap         { padding-left: 72px; }
  .chap::before { left: 23px; }
  .chap-toc     { display: none; }
}
@media (max-width: 640px) {
  .resume-cover { grid-template-columns: 1fr; padding: var(--s-6) var(--s-3); }
  .resume-cover__sidebar { display: none; }
  .resume-cover__inner   { padding-right: 0; }
  .kpi-grid              { grid-template-columns: repeat(2, 1fr); }
  .resume-timeline       { padding: var(--s-5) var(--s-3); }
  .resume-timeline::before { left: 20px; }
  .chap                  { padding-left: 48px; margin-bottom: var(--s-7); }
  .chap::before          { left: 11px; top: 12px; width: 16px; height: 16px; }
  .chap__tags            { margin-left: 0; width: 100%; }
  .story                 { padding: var(--s-4); }
}

/* ------- 6.5 移动端深度适配 (v18.4) ------- */
@media (max-width: 720px) {
  .resume-cover__title    { font-size: clamp(28px, 8vw, 40px); line-height: 1.2; }
  .resume-cover__subtitle { font-size: 14px; }
  .resume-cover__lede     { font-size: 14px; line-height: 1.7; }
  .chap__company          { font-size: clamp(20px, 5vw, 26px); }
  .chap__role             { font-size: 14px; }
  .story__title           { font-size: 15px; }
  .story__body            { font-size: 13px; line-height: 1.7; }
  .story__sublist li      { font-size: 13px; }
  .kpi__num               { font-size: 24px; }
  .kpi__label             { font-size: 11px; }
  .tag                    { font-size: 11px; padding: 3px 8px; }
}

@media (max-width: 480px) {
  .kpi-grid              { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi                   { padding: 12px 8px; }
  .resume-timeline       { padding: var(--s-4) 14px; }
  .resume-timeline::before { left: 14px; }
  .chap                  { padding-left: 38px; }
  .chap::before          { left: 6px; width: 14px; height: 14px; }
  .story                 { padding: 14px; }
  .story__title          { font-size: 14px; }
  .chap__meta            { gap: 6px; }
  .chap__date            { font-size: 11px; }
}

@media (pointer: coarse) {
  .chap-toc a,
  .tag,
  .story__cta { min-height: 40px; display: inline-flex; align-items: center; }
}

/* —— 中文版错位修复(履历页) —— */
body[data-lang="zh"] .chap__company {
  align-items: center;          /* baseline 在中英混排时偏移大,改用 center */
  line-height: 1.2;
}
body[data-lang="zh"] .chap__company em {
  /* 中文版自动使用 LXGW WenKai(由 --font-hand 提供),书卷气保留 */
  font-style: normal;
  font-size: .42em;
  letter-spacing: .04em;
  vertical-align: baseline;
  color: var(--ink-mute);
  font-weight: 500;
}
body[data-lang="zh"] .chap__seq,
body[data-lang="zh"] .chap__date,
body[data-lang="zh"] .tag {
  line-height: 1.5;
  vertical-align: middle;
}
body[data-lang="zh"] .chap__meta { align-items: center; row-gap: 8px; }
body[data-lang="zh"] .story__title { line-height: 1.45; }
body[data-lang="zh"] .story__sublist li { line-height: 1.7; }

/* KPI 中文标签 */
body[data-lang="zh"] .kpi span { line-height: 1.5; letter-spacing: .04em; }

/* TOC 章节侧边目录 */
body[data-lang="zh"] .chap-toc a { line-height: 1.5; }
