/* ============================================================
   JIERU — shared site styles (tokens, nav, cards, shell)
   used by index.html (home) and every sub page
   ============================================================ */

/* type scale — the whole site uses exactly these 9 sizes:
   12.5 / 14 / 15.5 / 17 / 20 / 23 / 27 / 33 / 50
   one font stack: system-ui, i.e. the OS default for both Latin and CJK */
:root{
  --page:#F4F7FB;
  --card:#FFFFFF;
  --ink:#122A3D;
  --sec:#2C4A66;
  --muted:#406888;
  --chip:#E3EDF8;
  --orange:#1E6BE6;
  --green:#1E6BE6;
  --dark:#122A3D;
  --hair:#E5EAF0;
  --pill:#FFFFFF;
  --on-dark:#FFFFFF;

  /* ===== UI 语义色板 · 天光蓝宝石（甲方定稿版）2026-11-10 =====
     色值集中在此；--hero-blue 已统一为主色蓝 #1E6BE6（2026-11-11），
     「小符号四色」按用户要求保持不变。 */
  --brand-primary:#1E6BE6;        /* 主色蓝：链接 / 导航 / Focus 环 */
  --brand-background:#F4F7FB;     /* 页面底 BG */
  --brand-card:#FFFFFF;           /* 卡片白 CARD */
  --brand-foreground:#122A3D;     /* 墨色：标题 / 正文 */
  --brand-muted-fg:#406888;       /* 次文字：Caption / Meta */
  --brand-tint-fg:#2C4A66;        /* Tint 前景：强调文字 */
  --brand-tint:#E3EDF8;           /* 浅蓝：次色块 / Tint 背景 */
  --brand-warm:#F8EBE3;           /* 糯米底：强调色块 */
  --brand-purple:#7F5FD9;         /* 紫晶辅助：项目标签 / 点缀 */
  --brand-border:#E5EAF0;         /* 边框 / 输入 / Divider */
  --brand-ring:#1E6BE6;           /* RING：Focus 高亮环 */
  --brand-shadow:rgba(18,42,61,.04); /* SHADOW：卡片投影 */
  /* 全站有 hover 的卡片统一使用这一套阴影（41 张，单一来源）。
     数值 = 静止态与原加深态的逐项中点，即加深幅度减半。 */
  --card-shadow-hover:0 1.5px 3.5px rgba(18,42,61,.0375), 0 16px 32px -19px rgba(18,42,61,.14);
  --hero-blue:#1E6BE6;            /* 首页 hero 蓝（已与主色蓝统一）：品牌文字 / CTA（index.html 内联同值） */
  --font:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;

  /* home-page layout baseline — every sub page derives card widths from these,
     so the 1440 stage + zoom fit keeps all pages on one grid */
  --side:76px;        /* 全站左右内距基准：导航栏 / 页脚 / 内容区 .wrap 共用，统一为 76px，
                         与首页双栏拼贴内容块（.b-* 的 left:76px）对齐，6 页两侧留白一致。
                         2026-11-12 由 52px 收敛到 76px（导航/页脚迁就内容区，构成同一对齐轴）。 */
  --content:1288px;   /* homepage content width (nav, footer, full-width cards) */
  --col-n:370px;      /* homepage narrow column */
  --col-w:901px;      /* homepage wide column: 370 + 17 + 901 = 1288 */
  --gutter:17px;      /* homepage gap between cards */
  --nav-h:56px;       /* nav height */
  --nav-gap:56px;     /* nav bottom -> page head */
  --hero-gap:34px;    /* page head -> first card */
}

*{box-sizing:border-box;margin:0;padding:0}
html{
  min-height:100%;overflow-x:hidden;overflow-y:auto;
  scroll-behavior:smooth;background:var(--page);
  -webkit-text-size-adjust:100%;
}
body{
  min-height:100%;background:var(--page);
  /* 导航上方 / 页面底部留白各 20px：都放在不缩放的 body 上，6 页在所有窗口宽度下
     恒为 20px。内页 .stage / 首页 .viewport 的 padding-top、padding-bottom 已归零，
     避免与 body 叠加。此前内页底部用 .stage 的 8px（被 zoom 缩放，约 5.7px@1440）、
     首页用 .viewport 的 28px（不缩放），两者机制不同、数值也不同，现已统一。 */
  padding:20px 0;
  font-family:var(--font);color:var(--ink);
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
  font-synthesis:none;font-optical-sizing:auto;
}
img{display:block;max-width:100%}
a{color:inherit;text-decoration:none}
button{font:inherit;color:inherit;background:none;border:0;cursor:pointer}
ul{list-style:none}
::selection{background:rgba(30,107,230,.18)}
[id]{scroll-margin-top:104px}

/* ---------------- shell ---------------- */
.stage{
  position:relative;
  width:1440px;margin:0 auto;
  /* 导航上方 20px、页面底部 20px 都已统一移到 body（不缩放），此处上下内距归零，
     避免与 body 叠加成 40px。首页 .stage 仍有内联 padding-top:0 覆盖顶部（底部同理归零）。 */
  padding:0;
}
.wrap{width:calc(100% - var(--side) - var(--side));margin:0 auto}

/* ---------------- site nav ----------------
   2026-11-11 同步：页眉样式统一为首页版（品牌蓝字无图标 + 17px 文字导航 +
   active/hover 下划线 + 底部细线），全部页面共用本段，index.html 内联覆盖已删除。 */
.nav{
  position:static;z-index:60;
  width:calc(100% - var(--side) - var(--side));height:var(--nav-h);
  margin:0 auto;
  display:flex;align-items:stretch;justify-content:space-between;
  gap:16px;
  border-bottom:1px solid rgba(18,42,61,.10);
}
.brand{
  display:flex;align-items:center;gap:10px;
  width:max-content;
  margin-left:25px;
}
.brand .mark{
  width:30px;height:30px;border-radius:9px;flex:none;
  overflow:hidden;background:var(--chip);
  display:none;
}
.brand .mark img{display:block;width:100%;height:100%;object-fit:cover}
.brand .who{display:flex;flex-direction:column;line-height:1.15}
/* 字号与导航项「首页」一致：全宽度 17px。窄屏媒体里 .navlink{font-size:14px} 因特异性不足未生效，
   实测窄屏导航项仍是 17px，故 jieru 也保持 17px；颜色 / 字重 / 字距不变。 */
.brand .name{font-size:17px;font-weight:650;letter-spacing:.06em;color:var(--hero-blue)}
.navlinks{
  display:flex;align-items:stretch;gap:2px;
}
.nav .navlinks .navlink{
  position:relative;
  display:inline-flex;align-items:center;justify-content:center;
  /* 撑满导航条高度，使导航项底边 = nav 底边：下划线 bottom:0 即落在分隔线上，
     首页 / 内页无论 nav 高度如何都重合。文字仍在项内垂直居中，位置不变。 */
  height:100%;padding:0 16px;
  /* 6 项等宽：4 个汉字 + 字距 + 左右 padding，用 em 随字号自适应 */
  min-width:calc(4em + 36px);
  border-radius:14px;white-space:nowrap;
  font-size:17px;font-weight:500;letter-spacing:1px;
  color:#4D6888;background:transparent;
  transition:color .25s ease, background .25s ease;
}
/* 只有两个字的「首页」：用 letter-spacing:1em 把字距撑开，视觉上与其余四字项等宽。
   关键：letter-spacing 会在「页」之后多留一段 = L 的空白，使「可见墨迹」比文字盒中心
   左移 L/2。要让墨迹严格居中，需令 padding-left − padding-right = L（即 padding-left = 16px + 1em，
   因基础 padding-right 为 16px、L = letter-spacing:1em）。公式：inkOffset = (pl−pr)/2 − L/2 = 0。
   下划线（::after）始终 left:0;right:0 满宽、与居中墨迹在常态 / hover / 选中三态严格同中心。 */
.nav .navlinks .navlink[href="index.html"]{
  justify-content:center;
  letter-spacing:1em;
  padding-left:calc(16px + 1em);
}
.nav .navlinks .navlink:hover{background:transparent;color:#1E6BE6}
.nav .navlinks .navlink:hover::after{
  content:"";position:absolute;bottom:0;left:0;right:0;margin:0;
  height:2px;background:#1E6BE6;border-radius:1px;
}
.nav .navlinks .navlink.active,.nav .navlinks .navlink.active:hover{
  background:transparent;color:#122A3D;font-weight:700;
}
.nav .navlinks .navlink.active::after{
  content:"";position:absolute;bottom:0;left:0;right:0;margin:0;
  height:2px;background:#122A3D;border-radius:1px;
}

/* ---------------- cards & chips ---------------- */
.card{
  position:relative;display:flex;flex-direction:column;
  height:100%;
  background:var(--card);
  border:1px solid var(--hair);
  border-radius:10px;
  padding:24px;
  box-shadow:0 1px 2px rgba(18,42,61,.03), 0 10px 24px -18px var(--brand-shadow);
  transition:transform .3s cubic-bezier(.22,1,.36,1), box-shadow .3s cubic-bezier(.22,1,.36,1);
}
/* 全站六页卡片统一 hover 动量：上浮 1px（设计像素）。
   之前是普通卡 -3px、flat 卡不动，现由下面两条统一定为 -1px。 */
/* hover 阴影全站同步：所有「有 hover」的卡片（含 flat 卡、首页普通卡、
   项目实录数据小卡）统一用 --card-shadow-hover；只有明确设为
   hover 完全静止的卡（首页两张透明卡、我的经历页 7 张）由各页覆盖压回静止态。
   变量值 = 静止态与原加深态的逐项中点，即加深幅度减半：
   静止 0 1px 2px/.03, 0 10px 24px -18px/.04
   原深 0 2px 5px/.045, 0 22px 40px -20px/.24
   现值 0 1.5px 3.5px/.0375, 0 16px 32px -19px/.14 */
.card:hover{
  transform:translateY(-1px);
  box-shadow:var(--card-shadow-hover);
}
.card.flat:hover{transform:translateY(-1px);box-shadow:var(--card-shadow-hover)}

.chip{
  display:inline-flex;align-items:center;gap:6px;
  height:28px;padding:0 11px 0 10px;
  border-radius:14px;background:var(--chip);
  color:#406888;font-size:14px;font-weight:500;
  letter-spacing:-.002em;white-space:nowrap;
  align-self:flex-start;flex:none;
  position:relative;z-index:3;
}
.chip svg{
  width:14px;height:14px;stroke:currentColor;fill:none;
  stroke-width:1.4;stroke-linecap:round;stroke-linejoin:round;flex:none;
}

/* ---------------- grids & section heads ---------------- */
.grid{display:grid;gap:var(--gutter)}
.g2{grid-template-columns:repeat(2,minmax(0,1fr))}
.g3{grid-template-columns:repeat(3,minmax(0,1fr))}
.g4{grid-template-columns:repeat(4,minmax(0,1fr))}
.row17{margin-top:17px}
.sec{margin-top:40px}

.sec-head{
  display:flex;align-items:flex-end;justify-content:space-between;
  gap:20px;margin-bottom:17px;
}
.sec-head h2{font-size:28px;line-height:31px;font-weight:520;letter-spacing:-.022em}
.sec-head .note{font-size:14px;color:var(--muted);letter-spacing:-.002em;padding-bottom:4px}

/* ---------------- page hero ---------------- */
/* page-head 底部留白：在 lede 与下方首块之间统一留出间距（2026-11-12）。
   用 padding（不触发 margin 合并），并把首块自带 margin-top 清零，
   使五页「描述→下方」的绝对间距都等于这里的 padding-bottom（当前 54px）。 */
.page-head{padding:var(--nav-gap) 0 54px}
/* 清零紧跟 page-head 的首块自带 margin-top：用 header.page-head + *（特异性 0,1,1）
   压过各页 .hero/.stats/.row17/.pf-grid 等的 0,1,0 规则，保证五页间距完全统一。 */
header.page-head + *{margin-top:0}
/* 页首大标题 + 17px 副标题左边缘对齐首页 bio 的「你好」：
   六页 stage 均由 fit() 按 窗口宽/1784 设定同一 zoom，故首页 blank-card 的
   26px 左内边距在任一桌面宽度下都等于内页所需的位移，直接统一右移 26px。
   窄屏 (<=820px) 各页 stage zoom=1 且 wrap 左同为 16px，天然对齐，不叠加。 */
@media (min-width:821px){.page-head{margin-left:26px}}
.page-head h1{
  font-size:52px;line-height:60px;font-weight:520;
  letter-spacing:-.023em;margin-top:18px;
}
.page-head h1 em{font-style:normal;color:var(--muted)}
.lede{
  /* 2026-11-12：解除 760px 限宽、强制单行显示（桌面）。窄屏在媒体查询里回落 normal 避免溢出。 */
  font-size:17px;line-height:28px;color:var(--sec);
  letter-spacing:-.008em;margin-top:18px;white-space:nowrap;
  text-align:justify;text-align-last:left;text-justify:inter-character;
}

/* ---------------- buttons ---------------- */
.btn{
  display:inline-flex;align-items:center;justify-content:center;gap:8px;
  height:46px;padding:0 22px;border-radius:14px;
  background:var(--dark);color:var(--on-dark);
  font-size:14px;letter-spacing:-.006em;
  transition:transform .22s cubic-bezier(.22,1,.36,1), background .22s;
}
.btn:hover{background:#122A3D;transform:translateY(-1px)}
.btn.ghost{background:transparent;border:1px solid rgba(18,42,61,.12);color:var(--ink)}
.btn.ghost:hover{background:rgba(18,42,61,.04)}
.btn svg{width:14px;height:14px;stroke:currentColor;fill:none;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}

/* ---------------- footer ---------------- */
.foot{
  width:calc(100% - var(--side) - var(--side));margin:44px auto 0;
  padding-top:20px;border-top:1px solid var(--hair);
  display:flex;align-items:center;justify-content:space-between;gap:16px;
  font-size:14px;color:var(--muted);letter-spacing:-.002em;
}
.foot-links{display:flex;flex-wrap:wrap;gap:18px}
.foot a{transition:color .2s}
.foot a:hover{color:var(--ink)}
.foot-top{font-weight:520;white-space:nowrap}
.foot a.foot-top:hover{color:var(--orange)}

/* ---------------- level bars ---------------- */
.lvl{position:relative;height:3px;border-radius:2px;background:#E3EDF8;overflow:hidden;flex:1}
.lvl span{
  display:block;height:100%;border-radius:2px;background:var(--brand-primary);
  transform-origin:left center;
  animation:lvlGrow .9s cubic-bezier(.22,1,.36,1) both;
  animation-delay:var(--d,0s);
}
@keyframes lvlGrow{from{transform:scaleX(0)}to{transform:scaleX(1)}}

/* ---------------- tags ---------------- */
.tags{display:flex;flex-wrap:wrap;gap:6px;margin-top:12px}
.tags li{
  font-size:12.5px;color:#406888;background:var(--chip);
  padding:4px 9px;border-radius:14px;letter-spacing:-.002em;
}

/* ---------------- responsive ---------------- */
@media (max-width:820px){
  .stage{width:100%!important;padding:0 16px 28px!important;zoom:1!important}
  .wrap,.nav,.foot{width:100%}
  .nav{position:static;height:auto;margin:16px 0 0;flex-direction:column;align-items:stretch;gap:12px}
  .navlinks{width:100%;overflow-x:auto;justify-content:flex-start;padding:4px}
  .navlink{height:34px;padding:0 7px;font-size:14px;flex:none;min-width:calc(4em + 18px)}
  /* 窄屏导航项实测仍为 17px，jieru 同步 */
  .nav .brand .name{font-size:17px}
  .g2,.g3,.g4{grid-template-columns:1fr}
  .page-head{padding:30px 0 0;margin-left:20px}
  .page-head h1{font-size:32px;line-height:42px;margin-top:14px}
  .lede{font-size:17px;line-height:28px;margin-top:14px;white-space:normal}
  .sec{margin-top:28px}
  .sec-head{flex-direction:column;align-items:flex-start;gap:6px}
  .card{padding:20px}
  .foot{margin-top:32px;flex-direction:column;align-items:flex-start;gap:10px}
}

@media (prefers-reduced-motion: reduce){
  *{animation-duration:.001ms!important;animation-delay:0s!important;transition-duration:.001ms!important}
  html{scroll-behavior:auto}
}
