/* ============================================================
   fonts.css — Offer引力 全站字体系统（客户画像适配版）
   用户画像：20-28 岁应往届求职者 · 高焦虑 · 高频短时访问
   设计目标：减压（圆润字形）/ 可信（稳定灰度）/ 高效扫描（清晰层级）

   字体清单（全部自托管，font-display: swap 保证首屏不空白）：
   - Plus Jakarta Sans 400/600/700 —— 西文 + 数字（几何圆润，数字默认表格对齐）
   - Source Han Sans VF（思源黑体可变字重 wght 100-900）—— 中文正文
     · CJK 常用字子集：GB2312 一级 3755 字 + ASCII + 常用标点，共 3909 字
     · 子集体积 1.05MB（< 2MB 目标达标）；子集外字符回退 PingFang SC/system-ui
   - JetBrains Mono 400 —— 岗位 ID / 简历编号 等宽场景

   2026-11-03
   ============================================================ */

/* ---------- 西文 + 数字：Plus Jakarta Sans ---------- */
@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/pjs-400.woff2") format("woff2");
}
@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/pjs-600.woff2") format("woff2");
}
@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/pjs-700.woff2") format("woff2");
}

/* ---------- 中文正文：思源黑体 VF（常用字子集） ---------- */
@font-face {
  font-family: "Source Han Sans VF";
  font-style: normal;
  font-weight: 100 900;   /* 可变字重区间 */
  font-display: swap;
  src: url("/fonts/SourceHanSansVF.woff2") format("woff2");
}

/* ---------- 代码 / ID：JetBrains Mono ---------- */
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/jbm-400.woff2") format("woff2");
}

/* ---------- 兼容别名：旧系统的 "Inter" 引用无缝升级为 Plus Jakarta Sans ----------
   历史代码中大量 font-family: Inter, ... 栈（workbench/atelier/各工具页），
   注册同文件别名后自动命中新字体，无需逐处修改。 */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/pjs-400.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/pjs-600.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/pjs-700.woff2") format("woff2");
}

/* ---------- 全局字体变量 + v3.0 排版系统（全站统一引用） ----------
   字体族保留自托管（决策已锁定）：西文数字 PJS / 中文思源黑体VF；
   "Inter" 为 PJS 的兼容别名，历史引用无缝命中。
   v3.0 新增：字号阶梯（Moderate Scale）/ 字重 / 行高（中文阅读优化）/
   字间距 / 主题色板 —— 解决中英混排拥挤、数字不对齐、行高过密阅读疲劳。 */
:root {
  /* 字体族（自托管） */
  --font-sans: "Plus Jakarta Sans", "Source Han Sans VF", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", "Fira Code", "Consolas", monospace;

  /* 字号阶梯 (Moderate Scale 1.25) */
  --text-xs: 0.75rem;    /* 12px - 辅助说明/标签 */
  --text-sm: 0.875rem;   /* 14px - 表格/次要正文 */
  --text-base: 1rem;     /* 16px - 默认正文 */
  --text-lg: 1.125rem;   /* 18px - 小标题/卡片标题 */
  --text-xl: 1.25rem;    /* 20px - 模块标题 */
  --text-2xl: 1.5rem;    /* 24px - 页面主标题 */
  --text-3xl: 1.875rem;  /* 30px - 核心数据展示 */

  /* 字重 */
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;

  /* 行高（中文阅读优化） */
  --leading-tight: 1.25;    /* 标题 */
  --leading-snug: 1.375;    /* 短文本/按钮 */
  --leading-normal: 1.5;    /* UI 控件 */
  --leading-relaxed: 1.75;  /* 长正文/简历内容（核心） */
  --leading-loose: 2;       /* 极简排版 */

  /* 字间距 */
  --tracking-tight: -0.02em;  /* 大标题 */
  --tracking-normal: 0;       /* 正文 */
  --tracking-wide: 0.02em;    /* 全大写标签/英文 */

  /* v3.0 主题色板 */
  --color-primary: #6366F1;
  --color-primary-hover: #4F46E5;
  --color-text-main: #1F2937;
  --color-text-muted: #6B7280;
  --color-border: #E5E7EB;
  --color-success-bg: #ECFDF5;
  --color-warning: #F59E0B;
  --color-warning-bg: #FFFBEB;
}

/* ---------- 全局正文（数字对齐 + v3.0 抗疲劳阅读） ---------- */
body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);   /* 全局默认行高 1.75 */
  color: #1F2937;                        /* 深灰代替纯黑，降低阅读疲劳 */
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* ---------- 标题统一规范 ---------- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-sans);
  font-weight: var(--font-weight-semibold);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  margin-bottom: 0.5em;
}

/* ---------- 数据与代码专用类（全局生效） ---------- */
.metric-value, .data-number, code, kbd, pre {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;   /* 等宽数字，表格对齐 */
  font-weight: var(--font-weight-medium);
  letter-spacing: var(--tracking-normal);
}
/* 核心数据展示：等宽 + 加粗 + 主色（指挥中心数据卡用） */
.metric-value {
  font-weight: var(--font-weight-bold);
  color: var(--color-primary);
}

/* ---------- 简历/长文本阅读区专用类 ---------- */
.prose-content, .resume-preview, .markdown-body {
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  letter-spacing: var(--tracking-normal);
}
.prose-content p, .resume-preview p, .markdown-body p { margin-bottom: 1em; }
/* A4 简历预览：保留打印级字号体系，仅升级行高/字距/段落间距（核心修改：缓解行高过密） */
.ro-sheet { line-height: var(--leading-relaxed); letter-spacing: var(--tracking-normal); }
.ro-sheet p { margin-bottom: 1em; }

/* ---------- 等宽场景工具类（岗位 ID / 简历编号 / 代码片段） ---------- */
.font-mono, .mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}

/* ---------- 工作台路线图步骤态（v3.0 指挥中心） ---------- */
.step-completed { opacity: 0.5; transform: scale(0.9); }
.step-stuck {
  border: 1px solid var(--color-warning, #F59E0B);
  background: var(--color-warning-bg, #FFFBEB);
  padding: 8px;
  border-radius: 8px;
}
.step-next {
  transform: scale(1.05);
  font-weight: var(--font-weight-bold, 700);
  color: var(--color-primary, #6366F1);
  animation: stepPulse 2s infinite;
}
@keyframes stepPulse {
  0% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4); }
  70% { box-shadow: 0 0 0 10px rgba(99, 102, 241, 0); }
  100% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0); }
}
