/* ============================================================
   Résumé — standalone stylesheet (fixed light, no dark mode)
   Design: contrast (single solid accent), repetition (one entry
   pattern), alignment (strict left / right edges), proximity
   (tight groups, generous sections).
   ============================================================ */

@font-face {
  font-family: "Geist Sans";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/fonts/geist/geist-sans.woff2") format("woff2");
}

@font-face {
  font-family: "Geist Mono";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/fonts/geist/geist-mono.woff2") format("woff2");
}

:root {
  --bg: #fdfdf7;
  --ink: #21201d;
  --text: #3e3e3e;
  --muted: #85847e;
  --accent: #c25203;
  --accent-deep: #a2440a;
  --divider: rgba(62, 62, 62, 0.14);
  --sans: "Geist Sans", "PingFang SC", "Microsoft YaHei", sans-serif;
  --serif: "Times New Roman", "SimSun", "STSong", serif;
  --mono: "Geist Mono", Consolas, "SF Mono", monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
}

html:lang(zh) {
  text-autospace: normal;
}

body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.75;
  color: var(--text);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

img {
  display: block;
}

/* 隐藏滚动条（滚动功能保留）：页面在任何环境下都不出现视觉滚动条 */
html {
  scrollbar-width: none;
}

::-webkit-scrollbar {
  display: none;
}

/* ============================== Layout ============================== */

.layout {
  max-width: 1136px;
  margin: 0 auto;
  padding: 48px 20px 80px;
  /* 抬到花瓣层（z-index: 0）之上，保证正文可读性 */
  position: relative;
  z-index: 1;
}

/* 单栏模式下，折叠成头部的侧栏与正文之间留出章节级间距；
   桌面端由 grid gap 接管，归零。 */
.layout > main {
  margin-top: 56px;
}

/* ============================== Sidebar ============================== */




.name {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 2rem;
  line-height: 1.25;
  color: var(--ink);
}

.name-en {
  margin-top: 3px;
  font-family: var(--serif);
  font-size: 1.125rem;
  color: var(--muted);
}

/* 学校条目：图标 + 主行 + 从属两行；一行一个事实，不再用分隔符串句 */
.school {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 16px;
}

.school svg {
  width: 17px;
  height: 17px;
  flex: none;
  margin-top: 3px;
  color: var(--muted);
}

.school-name {
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.45;
  color: var(--ink);
}

.school-meta {
  margin-top: 2px;
  font-size: 0.925rem;
  line-height: 1.45;
  color: var(--muted);
}

.contact {
  list-style: none;
  margin-top: 12px;
}

.contact li + li {
  margin-top: 8px;
}


.contact a {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.925rem;
  line-height: 1.4;
  color: var(--text);
}

.contact a:hover {
  color: var(--accent);
}

.contact svg {
  width: 17px;
  height: 17px;
  flex: none;
  color: var(--muted);
  transition: color 0.2s ease;
}

.contact a:hover svg {
  color: var(--accent);
}

.sidebar-divider {
  border: none;
  border-top: 1px solid var(--divider);
  margin: 28px 0;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* 技术栈：描边圆角矩形 + 品牌彩色 LOGO + 标签（与按钮同圆角语言，不用实底 badge） */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border: 1px solid var(--divider);
  border-radius: 10px;
  font-size: 0.8125rem;
  line-height: 1;
  color: var(--text);
  white-space: nowrap;
}

.tag img {
  width: 15px;
  height: 15px;
  flex: none;
}

/* Codex 图标是 currentColor 单色（默认继承深灰，看起来一团黑）：
   反白处理——墨色圆角底 + 米色图形，与旁边的彩色 logo 同框不突兀 */
.tag img[src$="codex.svg"] {
  box-sizing: border-box;
  padding: 1.5px;
  border-radius: 4px;
  background-color: var(--ink);
  color: var(--bg);
}

.btn-pdf {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-top: 0;
  padding: 9px 14px;
  border-radius: 10px;
  background-color: var(--accent);
  color: #fff;
  font-size: 0.875rem;
  line-height: 1.5;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: background-color 0.2s ease;
}

.btn-pdf:hover {
  background-color: var(--accent-deep);
  color: #fff;
}

.btn-pdf svg {
  width: 16px;
  height: 16px;
  flex: none;
}

/* 底部动作簇：下载主按钮 + 一行次级按钮
   桌面端钉在左栏底部；移动端整簇落在正文之后（页面底部） */
.sidebar-foot {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 56px;
  font-size: 0.875rem;
}

.foot-row {
  display: flex;
  gap: 8px;
}

/* 次级按钮（切语言 / 回博客）：与下载按钮同几何，描边弱化以保住主按钮层级 */
.lang-swap,
.home {
  display: inline-flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 10px;
  border: 1px solid var(--divider);
  border-radius: 10px;
  color: var(--muted);
  font-size: 0.8125rem;
  line-height: 1.5;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
  transition:
    color 0.2s ease,
    border-color 0.2s ease;
}

.lang-swap svg,
.home svg {
  width: 14px;
  height: 14px;
  flex: none;
}

.lang-swap:hover,
.home:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ============================== Content ============================== */

.section + .section {
  margin-top: 40px;
}

.section-title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.5rem;
  line-height: 1.3;
  color: var(--ink);
}

/* 缩进层级：章节标题(0) → 条目标题/描述(1) → 条目内要点(2) */
.entry {
  margin-top: 20px;
  padding-left: 24px;
}

.entry-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 2px 24px;
}

.entry-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--ink);
  min-width: 0;
}

.entry-title a:hover {
  color: var(--accent);
}

/* 标题文字右侧的外链图标：紧随文字、暗调静置，悬停转琥珀。
   vertical-align 用负长度把 17px 的图标盒相对基线微降，
   让图标视觉中心与大写字高中心齐平（middle 会偏低约 2px）。 */
.entry-link {
  display: inline-flex;
  align-items: center;
  vertical-align: -0.1em;
  margin-left: 7px;
  color: var(--muted);
  transition: color 0.2s ease;
}

.entry-link svg {
  width: 0.9em;
  height: 0.9em;
}

.entry-link:hover {
  color: var(--accent);
}

/* GitHub 星标统计：标题行最右侧的暗调小徽标；未抓到数字（hidden）时整体不显示 */
.entry-stat {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  align-self: center;
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  white-space: nowrap;
}

.entry-stat[hidden] {
  display: none;
}

.entry-stat svg {
  width: 15px;
  height: 15px;
}

.entry-meta {
  font-family: var(--serif);
  font-size: 1.125rem;
  font-weight: 400;
  color: var(--muted);
  white-space: nowrap;
}

.entry-sub {
  margin-top: 5px;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--ink);
}

.entry-desc {
  margin-top: 14px;
}

.bullets {
  list-style: none;
  margin-top: 12px;
}

.bullets li {
  position: relative;
  padding-left: 20px;
  margin-top: 10px;
}

.bullets li::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 0.72em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background-color: var(--accent);
}

.bullets strong {
  font-weight: 600;
  color: var(--ink);
}

/* 技能列表：沿用条目要点的列表语言（圆点 + 缩进），单条为「标题 / 正文」上下两行 */
.skill-list {
  margin-top: 20px;
  padding-left: 24px;
}

.skill-list li + li {
  margin-top: 14px;
}

.skill-list p {
  margin-top: 3px;
  font-size: 0.925rem;
  color: var(--text);
}

/* ============================== Tablet ≥640px ============================== */

@media (min-width: 640px) {
  .layout {
    padding: 56px 32px 96px;
  }
}

/* ============================== Desktop ≥1024px ============================== */

@media (min-width: 1024px) {
  .layout {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 112px;
    align-items: start;
    /* 底部内边距 == 动作簇 sticky 的 bottom 偏移：
       两者一致时钉住位置与自然位置重合，滚动到底也零位移 */
    padding: 64px 32px;
  }

  /* 左栏上块（身份/联系/技能）钉顶，下块（动作簇）钉底；
     两者共享同一网格行（行高由右侧正文撑满），各自 sticky 于滚动中保持可见 */
  .sidebar {
    grid-column: 1;
    grid-row: 1;
    position: sticky;
    top: 64px;
  }

  .layout > main {
    grid-column: 2;
    grid-row: 1;
    margin-top: 0;
  }

  .name {
    font-size: 2.5rem;
  }

  .school {
    margin-top: 12px;
  }

  .sidebar-foot {
    grid-column: 1;
    grid-row: 1;
    align-self: end;
    position: sticky;
    bottom: 64px;
    margin-top: 0;
  }

  .section + .section {
    margin-top: 56px;
  }
}

/* ============================== Print ============================== */

/* 打印/PDF：A4 双栏（左窄栏身份+联系+技能，右正文），紧凑字号保证 1–2 页；
   动作簇与花瓣隐藏，交互元素无意义。 */

@page {
  size: a4;
  margin: 10mm 12mm;
}

@media print {
  body {
    font-size: 10.5px;
    line-height: 1.45;
  }

  .layout {
    display: grid;
    grid-template-columns: 170px minmax(0, 1fr);
    gap: 22px;
    align-items: start;
    max-width: none;
    padding: 0;
  }

  .layout > main {
    grid-column: 2;
    margin-top: 0;
  }

  .sidebar {
    grid-column: 1;
    position: static;
  }

  .name {
    font-size: 1.35rem;
  }

  .school {
    margin-top: 8px;
  }

  .contact {
    margin-top: 8px;
  }

  .contact li + li {
    margin-top: 5px;
  }

  .contact a {
    gap: 6px;
    font-size: 10.5px;
  }

  .contact svg {
    width: 12px;
    height: 12px;
  }

  .sidebar-divider {
    margin: 12px 0;
  }

  .tags {
    gap: 5px;
  }

  .tag {
    gap: 5px;
    padding: 3px 8px;
    border-radius: 7px;
    font-size: 10px;
  }

  .tag img {
    width: 12px;
    height: 12px;
  }

  .section + .section {
    margin-top: 16px;
  }

  .section-title {
    font-size: 1.1rem;
  }

  .entry {
    margin-top: 10px;
    padding-left: 16px;
  }

  .entry-title {
    font-size: 0.95rem;
  }

  .entry-meta {
    font-size: 0.85rem;
  }

  .entry-sub {
    margin-top: 3px;
    font-size: 0.8rem;
  }

  .entry-desc {
    margin-top: 8px;
  }

  .bullets {
    margin-top: 6px;
  }

  .bullets li {
    margin-top: 4px;
    padding-left: 14px;
  }

  .skill-list {
    margin-top: 10px;
    padding-left: 16px;
  }

  .skill-list li + li {
    margin-top: 6px;
  }

  .entry-link svg {
    width: 0.8em;
    height: 0.8em;
  }

  .btn-pdf,
  .sidebar-foot,
  .petals {
    display: none;
  }
}

/* ============================== 飘落花瓣（纯装饰） ============================== */

/* 双层结构：外层 .petal 管下落 + 横向漂移（风向），
   内层 ::before 管左右摆动 + 翻滚；两层动画各自独立，互不打断。
   每片花瓣的随机参数（位置/时长/大小/摆幅/透明度）由内联 CSS 变量给出，
   负的 --delay 让页面打开时花瓣已经洒满半空。 */

.petals {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.petal {
  position: absolute;
  top: -6vh;
  left: var(--x);
  width: calc(18px * var(--s));
  height: calc(18px * var(--s));
  opacity: 0;
  animation: petal-fall var(--d) linear var(--delay) infinite;
}

.petal::before {
  content: "";
  position: absolute;
  inset: 0;
  background-color: var(--c, #f3c6d3);
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 21C7 18.8 4.2 14.8 4.6 10.4 4.9 7.2 6.8 5.2 9 5.8 10 4.6 11 5.6 12 6.4 13 5.6 14 4.6 15 5.8 17.2 5.2 19.1 7.2 19.4 10.4 19.8 14.8 17 18.8 12 21Z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 21C7 18.8 4.2 14.8 4.6 10.4 4.9 7.2 6.8 5.2 9 5.8 10 4.6 11 5.6 12 6.4 13 5.6 14 4.6 15 5.8 17.2 5.2 19.1 7.2 19.4 10.4 19.8 14.8 17 18.8 12 21Z'/%3E%3C/svg%3E");
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  animation: petal-sway var(--sway-d, 4s) ease-in-out var(--delay) infinite alternate;
}

.petal--pink {
  --c: #f3c6d3;
}

.petal--peach {
  --c: #f6d3b0;
}

.petal--amber {
  --c: #eddfbe;
}

.petal--apricot {
  --c: #f2c1a6;
}

/* 下落：整体向一侧漂移，营造风势 */
@keyframes petal-fall {
  0% {
    transform: translate3d(0, 0, 0);
    opacity: 0;
  }

  6% {
    opacity: var(--o, 0.5);
  }

  88% {
    opacity: var(--o, 0.5);
  }

  100% {
    transform: translate3d(var(--drift, 60px), 112vh, 0);
    opacity: 0;
  }
}

/* 摆动：横向摇曳 + 翻滚 */
@keyframes petal-sway {
  from {
    transform: translateX(calc(-1 * var(--sway, 30px))) rotate(calc(-1 * var(--r, 150deg)));
  }

  to {
    transform: translateX(var(--sway, 30px)) rotate(var(--r, 150deg));
  }
}

/* 小屏减少花瓣数量，聚焦内容 */
@media (max-width: 639px) {
  .petal:nth-child(n + 9) {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .petals {
    display: none;
  }
}
