/* ==========================================================
   style.css —— Portfolio Cosmic（暗色为默认，支持亮色主题）
   ----------------------------------------------------------
   目录：
   1. 设计系统（暗色变量 + 亮色覆盖）
   2. 基础样式            3. 胶囊导航（含主题/语言切换按钮）
   4. 按钮体系            5. 通用排版
   6. Hero + 星空         7. 关于我 + 数字带
   8. 作品 bento 网格     9. 简历时间线
   10. 联系 + 跑马灯      11. 页脚
   12. 滚动显现 + 入场    13. 响应式
   ========================================================== */

/* ---------- 1. 设计系统 ---------- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Instrument+Serif:ital@0;1&display=swap');

:root {
  --bg: hsl(0 0% 4%);       /* 近黑底色 */
  --surface: hsl(0 0% 8%);  /* 卡片 */
  --text: hsl(0 0% 96%);    /* 主文字（近白） */
  --text-soft: hsl(0 0% 80%);/* 正文文字 */
  --muted: hsl(0 0% 53%);   /* 次要文字 */
  --stroke: hsl(0 0% 12%);  /* 描边 */
  /* 唯一的彩色：蓝灰渐变，两个主题共用 */
  --grad: linear-gradient(90deg, #89AACC 0%, #4E85BF 100%);

  /* 随主题翻转的部件色 */
  --nav-border: hsl(0 0% 100% / .1);
  --chip-bg: hsl(0 0% 12% / .5);
  --stroke-hover: hsl(0 0% 20%);
  --marquee-stroke: hsl(0 0% 96% / .16);
  --cover-grad: linear-gradient(135deg, hsl(210 30% 12%), hsl(210 40% 8%));
  --overlay: hsl(0 0% 4% / .7);
  --stars-opacity: .5;
  --glass-bg: hsl(0 0% 100% / .07);      /* 空状态玻璃卡 */
  --glass-outline: hsl(0 0% 100% / .22);

  --font-body: 'Inter', -apple-system, "Segoe UI", "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  /* 展示字体只有拉丁字形：中文名会回退到系统宋体 */
  --font-display: 'Instrument Serif', "STSong", "SimSun", serif;

  --container: 1200px;
  --radius-lg: 24px;
}

/* 亮色主题：只覆盖变量，所有组件自动换装 */
:root[data-theme="light"] {
  --bg: hsl(0 0% 97%);
  --surface: hsl(0 0% 100%);
  --text: hsl(0 0% 10%);
  --text-soft: hsl(0 0% 32%);
  --muted: hsl(0 0% 42%);
  --stroke: hsl(0 0% 88%);

  --nav-border: hsl(0 0% 10% / .08);
  --chip-bg: hsl(0 0% 10% / .06);
  --stroke-hover: hsl(0 0% 70%);
  --marquee-stroke: hsl(0 0% 10% / .12);
  --cover-grad: linear-gradient(135deg, hsl(210 30% 94%), hsl(210 45% 89%));
  --overlay: hsl(0 0% 10% / .55);
  --stars-opacity: 0;   /* 白天天上没有星星 */
  --glass-bg: hsl(0 0% 100% / .65);
  --glass-outline: hsl(0 0% 100% / .9);
}

/* ---------- 2. 基础样式 ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-weight: 300;
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  transition: background .3s ease, color .3s ease; /* 主题切换的平滑过渡 */
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { font-family: inherit; }

section[id] { scroll-margin-top: 90px; }

::selection { background: #4E85BF; color: #fff; }

/* ---------- 3. 胶囊导航 ---------- */
.site-header {
  position: fixed;
  top: 1rem;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  justify-content: center;
  padding: 0 1rem;
}
.nav-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid var(--nav-border);
  background: var(--surface);
  backdrop-filter: blur(12px);
  padding: .5rem;
  transition: box-shadow .3s ease, background .3s ease;
}
.site-header.scrolled .nav-pill { box-shadow: 0 10px 30px hsl(0 0% 0% / .35); }

.nav-logo {
  display: block;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--grad);      /* 渐变环 = 外层渐变 + 内层底色 */
  padding: 1.5px;
  transition: transform .3s ease;
}
.nav-logo:hover { transform: scale(1.1); }
.nav-logo-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--bg);
  font-family: var(--font-display);
  font-style: italic;
  font-size: 13px;
}
.nav-divider { width: 1px; height: 20px; background: var(--stroke); margin: 0 .25rem; }

.nav-links { display: flex; gap: .25rem; }
.nav-links a {
  display: block;
  padding: .5rem .9rem;
  border-radius: 999px;
  font-size: .85rem;
  color: var(--muted);
  transition: color .25s ease, background .25s ease;
}
.nav-links a:hover,
.nav-links a.active { color: var(--text); background: var(--chip-bg); }

/* 主题 / 语言切换按钮 */
.nav-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 600;
  cursor: pointer;
  transition: color .25s ease, background .25s ease;
}
.nav-toggle:hover { color: var(--text); background: var(--chip-bg); }
.nav-toggle svg { width: 16px; height: 16px; }
/* 太阳/月亮图标跟随主题切换显示 */
:root[data-theme="dark"] .icon-moon { display: none; }
:root[data-theme="light"] .icon-sun { display: none; }

.nav-cta { position: relative; display: block; }
.nav-cta::before {               /* 悬停时从背后浮现的渐变描边 */
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 999px;
  background: var(--grad);
  opacity: 0;
  transition: opacity .3s ease;
}
.nav-cta:hover::before { opacity: 1; }
.nav-cta-inner {
  position: relative;
  display: flex;
  align-items: center;
  gap: .25rem;
  padding: .5rem .9rem;
  border-radius: 999px;
  background: var(--surface);
  backdrop-filter: blur(12px);
  font-size: .85rem;
  transition: transform .3s ease;
}
.nav-cta:hover .nav-cta-inner { transform: scale(1.05); }
.nav-cta .arrow { font-size: .75rem; }

/* ---------- 4. 按钮体系 ---------- */
/* 渐变描边环：伪元素藏在按钮背后，悬停时浮现 2px */
.grad-ring { position: relative; }
.grad-ring::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 999px;
  background: var(--grad);
  opacity: 0;
  transition: opacity .3s ease;
  z-index: -1;
}
.grad-ring:hover::after { opacity: 1; }

.btn-solid {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .875rem 1.75rem;
  border-radius: 999px;
  font-size: .9rem;
  font-weight: 600;
  background: var(--text);
  color: var(--bg);
  transition: background .3s ease, color .3s ease, transform .3s ease;
}
.btn-solid:hover { background: var(--bg); color: var(--text); transform: scale(1.05); }

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .875rem 1.75rem;
  border-radius: 999px;
  font-size: .9rem;
  font-weight: 600;
  border: 2px solid var(--stroke);
  background: var(--bg);
  color: var(--text);
  transition: border-color .3s ease, transform .3s ease;
}
.btn-outline:hover { border-color: transparent; transform: scale(1.05); }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .5rem 1.1rem;
  border-radius: 999px;
  font-size: .85rem;
  font-weight: 500;
  border: 1px solid var(--stroke);
  background: var(--surface);
  color: var(--text);
  transition: border-color .3s ease, transform .3s ease;
}
.btn-ghost:hover { border-color: transparent; transform: scale(1.03); }
.btn-small { padding: .45rem 1rem; font-size: .8rem; }

/* 按钮降级态：目标文件（如简历 PDF）还不存在 */
.btn-disabled {
  opacity: .45;
  cursor: not-allowed;
  pointer-events: none; /* 连悬停效果一起关闭 */
}

/* ---------- 5. 通用排版 ---------- */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 1.5rem;
}
.section { padding: 6rem 0; position: relative; }

.eyebrow {
  display: flex;
  align-items: center;
  gap: .75rem;
  font-size: .72rem;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1.25rem;
}
.eyebrow-line { width: 2rem; height: 1px; background: var(--stroke); flex: none; }

.section-title {
  font-size: clamp(1.8rem, 4vw, 2.75rem);
  font-weight: 600;
  letter-spacing: -.02em;
  line-height: 1.2;
  margin-bottom: .75rem;
}
.section-title em {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
}
.section-sub { color: var(--muted); font-size: .95rem; }

.section-head { margin-bottom: 3rem; }
.section-head-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
}
.section-head-row .section-sub { margin-bottom: .25rem; }

/* ---------- 6. Hero + 星空 ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
}
.hero-content { position: relative; z-index: 10; text-align: center; }

/* 星云：多层径向渐变 + 缓慢漂移 */
.cosmos { position: absolute; inset: 0; }
.cosmos::before {
  content: "";
  position: absolute;
  inset: -20%;
  background:
    radial-gradient(600px 400px at 20% 30%, hsl(210 40% 40% / .18), transparent 70%),
    radial-gradient(500px 380px at 80% 20%, hsl(215 45% 35% / .15), transparent 70%),
    radial-gradient(700px 500px at 60% 80%, hsl(205 35% 30% / .12), transparent 70%);
  animation: nebula 16s ease-in-out infinite alternate;
}
/* 星星：一张用小圆点铺成的"贴纸"，平移一个贴纸周期 = 无限星空 */
.cosmos::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1px 1px at 20px 30px, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 90px 140px, hsl(210 30% 90%) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 160px 60px, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 230px 180px, #cfe0f4 50%, transparent 51%),
    radial-gradient(1px 1px at 300px 90px, #fff 50%, transparent 51%),
    radial-gradient(2px 2px at 40px 200px, hsl(0 0% 100% / .9) 50%, transparent 51%);
  background-size: 340px 340px;
  opacity: var(--stars-opacity);
  animation: drift 90s linear infinite;
}
@keyframes nebula {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(2%, -2%, 0) scale(1.06); }
}
@keyframes drift { to { background-position: 340px 340px; } }

/* 底部渐隐，让 Hero 无缝过渡到下个区块 */
.hero-fade {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 12rem;
  background: linear-gradient(to top, var(--bg), transparent);
  z-index: 5;
}

.hero-name {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(3rem, 9vw, 6.5rem);
  line-height: 1.05;
  letter-spacing: .04em;  /* 正字距：让名字呼吸感更强 */
  margin-bottom: 1.5rem;
}
.hero-role {
  font-size: 1.05rem;
  color: var(--muted);
  margin-bottom: 1rem;
}
.role-word {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.25em;
  color: var(--text);
  display: inline-block;
  margin: 0 .2em;
}
.hero-desc {
  font-size: .95rem;
  color: var(--muted);
  max-width: 28rem;
  margin: 0 auto 2.75rem;
}
.hero-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* 滚动提示：一条线里的渐变高光在向下流动 */
.scroll-hint {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .5rem;
  font-size: .68rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--muted);
}
.scroll-line {
  position: relative;
  width: 1px;
  height: 2.5rem;
  background: var(--stroke);
  overflow: hidden;
}
.scroll-line::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--grad);
  animation: scroll-down 1.5s ease-in-out infinite;
}
@keyframes scroll-down {
  0%   { transform: translateY(-100%); }
  100% { transform: translateY(200%); }
}

/* ---------- 7. 关于我 + 数字带 ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 2.5rem;
  align-items: start;
}
.about-text p { margin-bottom: 1rem; color: var(--text-soft); }

.skills {
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}
.skills-title { font-size: 1rem; font-weight: 600; margin-bottom: .9rem; }
.skill-list { display: flex; flex-wrap: wrap; gap: .5rem; }
.skill-list li {
  border: 1px solid var(--stroke);
  color: var(--text);
  font-size: .82rem;
  padding: .25rem .8rem;
  border-radius: 999px;
  transition: border-color .25s ease;
}
.skill-list li:hover { border-color: #4E85BF; }

.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--stroke);
}
.stat strong {
  display: block;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: 2.75rem;
  line-height: 1.1;
}
.stat strong span { color: #89AACC; }
.stat > span { color: var(--muted); font-size: .85rem; }

/* ---------- 7.5 正在学习 ---------- */
.learning-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}
.learning-card {
  display: grid;
  gap: .75rem;
  justify-items: start;
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  transition: border-color .3s ease, transform .3s ease;
}
.learning-card:hover { border-color: #4E85BF; transform: translateY(-3px); }
.learning-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--grad);   /* 渐变图标底座，全站唯一的彩色 */
  color: #fff;
}
.learning-icon svg { width: 20px; height: 20px; }
.learning-title { font-size: 1.05rem; font-weight: 600; }
.learning-desc { color: var(--muted); font-size: .9rem; }
.learning-chip {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  border: 1px solid var(--stroke);
  border-radius: 999px;
  padding: .15rem .7rem;
  font-size: .72rem;
  color: var(--muted);
}
.learning-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}
.learning-open {
  color: #89AACC;
  font-size: .82rem;
  font-weight: 600;
  transition: transform .25s ease;
}
a.learning-card:hover .learning-open { transform: translateX(4px); }

/* ---------- 14. 工具页（流程图 / 便签） ---------- */
.tool-shell { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem 3rem; }
.tool-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.tool-title { font-size: 1.6rem; font-weight: 600; }
.tool-title em { font-family: var(--font-display); font-style: italic; font-weight: 400; }
.tool-back { color: var(--muted); font-size: .85rem; transition: color .25s ease; }
.tool-back:hover { color: var(--text); }

.toolbar { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin-bottom: .75rem; }
.tool-btn {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  border: 1px solid var(--stroke);
  background: var(--surface);
  color: var(--text);
  border-radius: 999px;
  padding: .45rem 1rem;
  font-size: .82rem;
  cursor: pointer;
  transition: border-color .25s ease, background .25s ease, color .25s ease;
}
.tool-btn:hover { border-color: #4E85BF; }
.tool-btn.active { border-color: transparent; background: var(--grad); color: #fff; }
.tool-btn.danger:hover { border-color: #f87171; color: #f87171; }
.toolbar-sep { width: 1px; height: 18px; background: var(--stroke); margin: 0 .25rem; }
.tool-hint { color: var(--muted); font-size: .78rem; margin-bottom: .75rem; }

/* 流程图画布 */
.fc-wrap {
  height: 70vh;
  border: 1px solid var(--stroke);
  border-radius: var(--radius-lg);
  overflow: auto;
  background: var(--bg);
}
.fc-canvas {
  position: relative;
  width: 1600px;
  height: 1100px;
  background-image: radial-gradient(circle, var(--stroke) 1px, transparent 1px);
  background-size: 24px 24px;
}
#fcEdges { position: absolute; inset: 0; width: 100%; height: 100%; }
#fcEdges .edge-line { stroke: #89AACC; stroke-width: 2; }
#fcEdges .edge-hit { stroke: transparent; stroke-width: 16; cursor: pointer; }

.fc-node {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: .82rem;
  padding: .3rem .5rem;
  background: var(--surface);
  border: 1.5px solid var(--stroke);
  color: var(--text);
  border-radius: 10px;
  cursor: grab;
  user-select: none;
  box-shadow: var(--shadow);
}
.fc-node:active { cursor: grabbing; }
.fc-node.selected { border-color: #89AACC; box-shadow: 0 0 0 3px hsl(210 40% 60% / .25); }
.fc-node.connect-src { border-color: #4E85BF; border-style: dashed; }
.fc-node.pill { border-radius: 999px; }
.fc-node.diamond {
  border: none;
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
  filter: drop-shadow(0 4px 10px hsl(0 0% 0% / .3));
}
.fc-node.diamond .fc-text { font-size: .75rem; }
.fc-text { pointer-events: none; width: 100%; overflow: hidden; }
.fc-node.editing .fc-text {
  pointer-events: auto;
  user-select: text;
  outline: 1px dashed #89AACC;
}
body.connecting .fc-node { cursor: crosshair; }

/* 便签工具 */
.notes-grid {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 1.25rem;
  align-items: start;
}
.notes-list {
  display: grid;
  gap: .4rem;
  align-content: start;
  min-height: 55vh;
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-lg);
  padding: .75rem;
}
.note-item {
  padding: .6rem .8rem;
  border-radius: 12px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background .25s ease;
}
.note-item:hover { background: var(--chip-bg); }
.note-item.active { border-color: #4E85BF; }
.note-item h4 {
  font-size: .9rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.note-item time { font-size: .72rem; color: var(--muted); }
.notes-empty { color: var(--muted); font-size: .85rem; text-align: center; padding: 2rem 0; }

.notes-editor {
  display: grid;
  gap: .75rem;
  align-content: start;
  min-height: 55vh;
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
}
.note-title-input {
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--stroke);
  color: var(--text);
  font-size: 1.2rem;
  font-weight: 600;
  padding: .4rem .2rem;
  font-family: inherit;
}
.note-title-input:focus, .note-body-input:focus { outline: none; border-color: #4E85BF; }
.note-body-input {
  background: transparent;
  border: 1px solid var(--stroke);
  border-radius: 12px;
  color: var(--text);
  min-height: 40vh;
  padding: 1rem;
  resize: vertical;
  font-family: inherit;
  font-size: .95rem;
  line-height: 1.8;
}
.note-meta { color: var(--muted); font-size: .75rem; }

@media (max-width: 768px) {
  .notes-grid { grid-template-columns: 1fr; }
  .notes-list, .notes-editor { min-height: auto; }
  .note-body-input { min-height: 30vh; }
}

/* ---------- 15. 404 页 ---------- */
.nf-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.nf-main { padding: 2rem; }
.nf-code {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(6rem, 20vw, 12rem);
  line-height: 1;
}
.nf-text { color: var(--muted); margin: 1rem 0 2rem; }

/* ---------- 8. 作品 bento 网格 ---------- */
.works-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 1.25rem;
}
.work-card {
  grid-column: span 6;
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform .3s ease, border-color .3s ease;
}
.work-card:hover { transform: translateY(-4px); border-color: var(--stroke-hover); }
.work-card.wide { grid-column: span 7; }
.work-card.tall { grid-column: span 5; }

.work-cover {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: .85rem;
  background: var(--cover-grad);
  border-bottom: 1px dashed var(--stroke);
}
.work-card.wide .work-cover { aspect-ratio: 16 / 9; }
.work-card.tall .work-cover { aspect-ratio: 4 / 3.2; }

/* 半调网点：真实图片放进来后会更有"印刷感" */
.work-cover::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, #fff 1px, transparent 1px);
  background-size: 4px 4px;
  opacity: .04;
  pointer-events: none;
}

/* ---- 空状态：玻璃光斑卡 ----
   改编自 Uiverse.io 组件（MIT License）
   Component by dylanharriscameron:
   https://uiverse.io/dylanharriscameron/stupid-mole-90
   原理：彩色光斑在底层弹跳（filter:blur 把它晕成一团光），
   毛玻璃面板盖在上面，光透过来就有了"磨砂霓虹"效果。
   适配：固定尺寸 → inset 流体；红光斑 → 主题色双光斑；配色走主题变量。 */
.blob {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 50%;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background-color: #89AACC;
  filter: blur(12px);
  animation: blob-bounce 5s infinite ease;
}
.blob-b {
  background-color: #4E85BF;
  animation-delay: -2.5s; /* 负延迟 = 从动画中段开始，两个光斑错开 */
}
@keyframes blob-bounce {
  0%   { transform: translate(-100%, -100%) translate3d(0, 0, 0); }
  25%  { transform: translate(-100%, -100%) translate3d(100%, 0, 0); }
  50%  { transform: translate(-100%, -100%) translate3d(100%, 100%, 0); }
  75%  { transform: translate(-100%, -100%) translate3d(0, 100%, 0); }
  100% { transform: translate(-100%, -100%) translate3d(0, 0, 0); }
}
.blob-glass {
  position: absolute;
  inset: 5px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--glass-bg);
  backdrop-filter: blur(24px);
  border-radius: 10px;
  overflow: hidden;
  outline: 1px solid var(--glass-outline);
  color: var(--muted);
  font-size: .85rem;
  letter-spacing: .1em;
}

/* 悬停遮罩：变暗 + 毛玻璃 + 中央胶囊 */
.work-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--overlay);
  backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity .3s ease;
}
.work-card:hover .work-overlay { opacity: 1; }
.work-pill { border-radius: 999px; }
.work-pill-inner {
  display: block;
  background: var(--text);
  color: var(--bg);
  border-radius: 999px;
  padding: .6rem 1.25rem;
  font-size: .85rem;
  font-weight: 600;
  white-space: nowrap;
}
.work-pill-inner em {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
}

.work-body { padding: 1.25rem 1.5rem 1.5rem; display: grid; gap: .5rem; }
.work-title { font-size: 1.1rem; font-weight: 600; }
.work-desc { color: var(--muted); font-size: .88rem; }
.work-tags { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .25rem; }
.work-tags li {
  border: 1px solid var(--stroke);
  color: var(--muted);
  font-size: .72rem;
  padding: .1rem .7rem;
  border-radius: 999px;
}

/* ---------- 9. 简历时间线 ---------- */
.timeline {
  margin-left: 6px;
  padding-left: 1.75rem;
  border-left: 2px solid var(--stroke);
  display: grid;
  gap: 2.25rem;
  max-width: 46rem;
}
.timeline-item { position: relative; }
.timeline-dot {
  position: absolute;
  left: -2.2rem;
  top: .5rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--grad);
  border: 2px solid var(--bg);
}
.timeline-date { color: var(--muted); font-size: .8rem; margin-bottom: .15rem; }
.timeline-title { font-size: 1.05rem; font-weight: 600; margin-bottom: .2rem; }
.timeline-desc { color: var(--muted); font-size: .88rem; }

/* ---------- 9.5 简历纸（标准简历格式） ---------- */
.resume-sheet {
  display: grid;
  gap: 2rem;
  max-width: 52rem;
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2.75rem;
}
.resume-basics {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--stroke);
  padding-bottom: 1.5rem;
}
.resume-name {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: 2rem;
  line-height: 1.2;
}
.resume-intent { color: var(--muted); font-size: .9rem; margin-top: .25rem; }
.resume-contact {
  display: grid;
  gap: .3rem;
  align-content: center;
  font-size: .88rem;
  color: var(--text-soft);
}
.resume-contact a:hover { color: var(--text); }

/* 小节标题：前置渐变短线，呼应全站 eyebrow 语言 */
.resume-h2 {
  display: flex;
  align-items: center;
  gap: .75rem;
  font-size: 1.05rem;
  font-weight: 600;
}
.resume-h2::before {
  content: "";
  width: 1.25rem;
  height: 2px;
  border-radius: 2px;
  background: var(--grad);
}

.resume-entry { display: grid; gap: .4rem; margin-top: .25rem; }
.resume-entry-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.resume-entry-title { font-weight: 600; font-size: .98rem; }
.resume-entry-date { color: var(--muted); font-size: .82rem; }
.resume-entry-role { color: #89AACC; font-size: .85rem; font-weight: 500; }

.resume-bullets { display: grid; gap: .3rem; }
.resume-bullets li {
  position: relative;
  padding-left: 1.1rem;
  color: var(--text-soft);
  font-size: .9rem;
}
.resume-bullets li::before {
  content: "•";
  position: absolute;
  left: .2rem;
  color: #89AACC;
}
.resume-skills-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}
.resume-label { color: var(--muted); font-size: .82rem; margin-bottom: .6rem; }

/* ---------- 10. 联系 + 跑马灯 ---------- */
.contact-inner { text-align: center; }
.contact .eyebrow { justify-content: center; }
.contact-links {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: .5rem;
}

.marquee { overflow: hidden; padding-top: 4rem; user-select: none; }
.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee 40s linear infinite;
}
.marquee-seg {
  white-space: nowrap;
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(3rem, 8vw, 6.5rem);
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1px var(--marquee-stroke); /* 空心描边字 */
}
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- 11. 页脚 ---------- */
.site-footer { border-top: 1px solid var(--stroke); padding: 1.5rem 0; }
.footer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.footer-social { display: flex; gap: 1.25rem; }
.footer-social a {
  color: var(--muted);
  font-size: .85rem;
  transition: color .25s ease;
}
.footer-social a:hover { color: var(--text); }
.footer-status {
  display: flex;
  align-items: center;
  gap: .5rem;
  color: var(--muted);
  font-size: .85rem;
}
.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4ade80;
  animation: pulse 2s ease-out infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(74, 222, 128, .45); }
  70%  { box-shadow: 0 0 0 8px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}
.footer-copy { color: var(--muted); font-size: .85rem; }

/* ---------- 12. 滚动显现 + 入场 ---------- */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity .9s cubic-bezier(.25, .1, .25, 1),
              transform .9s cubic-bezier(.25, .1, .25, 1);
}
.reveal.visible { opacity: 1; transform: none; }

/* Hero 入场：页面加载后由 JS 给 body 加 .entered 触发 */
.name-reveal {
  opacity: 0;
  transform: translateY(50px);
  transition: opacity 1.2s cubic-bezier(.16, 1, .3, 1),
              transform 1.2s cubic-bezier(.16, 1, .3, 1);
}
.blur-in {
  opacity: 0;
  transform: translateY(20px);
  filter: blur(10px);
  transition: opacity 1s ease .35s, transform 1s ease .35s, filter 1s ease .35s;
}
body.entered .name-reveal,
body.entered .blur-in { opacity: 1; transform: none; filter: blur(0); }

/* 词轮换的淡入（身份词共用） */
.fade-pop { animation: fade-pop .4s ease-out; }
@keyframes fade-pop {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- 12.5 无障碍：尊重"减少动画"偏好 ---------- */
@media (prefers-reduced-motion: reduce) {
  .blob, .marquee-track, .scroll-line::after,
  .cosmos::before, .cosmos::after, .pulse-dot { animation: none; }
}

/* ---------- 13. 响应式 ---------- */
@media (max-width: 768px) {
  .section { padding: 4rem 0; }
  .nav-divider { display: none; }
  .about-grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .resume-sheet { padding: 1.5rem; }
  .resume-skills-grid { grid-template-columns: 1fr; }
  .learning-grid { grid-template-columns: 1fr; }
  .works-grid { gap: 1rem; }
  .work-card.wide, .work-card.tall { grid-column: span 12; }
  .work-card .work-cover { aspect-ratio: 16 / 9; }
  .view-all { display: none; }
  .stats-row { gap: .5rem; }
  .stat strong { font-size: 2rem; }
  .section-head-row { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 480px) {
  .nav-links a { padding: .4rem .6rem; font-size: .78rem; }
  .nav-toggle { width: 30px; height: 30px; }
  .nav-cta-inner { padding: .4rem .6rem; font-size: .78rem; }
  .footer-bar { justify-content: center; text-align: center; }
}
