/* ============================================================
   Design tokens — Resume Dark (ui-ux-pro-max informed)
   Palette: dark navy + blue/green accents
   Typography: Outfit (heading) + Inter (body) + JetBrains Mono
============================================================ */
:root {
  /* surfaces */
  --bg:           #0B1120;
  --bg-1:         #0F172A;
  --bg-2:         #192134;
  --bg-3:         #1E293B;
  --bg-muted:     #101A34;

  /* text */
  --fg:           #F8FAFC;
  --fg-soft:      #CBD5E1;
  --fg-muted:     #94A3B8;
  --fg-dim:       #64748B;

  /* lines */
  --border:        rgba(255,255,255,0.08);
  --border-strong: rgba(255,255,255,0.14);

  /* brand */
  --primary:     #1E40AF;
  --primary-2:   #3B82F6;
  --primary-3:   #60A5FA;
  --accent:      #059669;
  --accent-2:    #10B981;
  --warn:        #F59E0B;
  --danger:      #DC2626;
  --ring:         rgba(96,165,250,0.45);

  /* radius */
  --r-sm: 8px;
  --r:    12px;
  --r-md: 16px;
  --r-lg: 20px;

  /* shadow */
  --shadow-card:
    0 1px 0 rgba(255,255,255,0.04) inset,
    0 14px 36px -20px rgba(0,0,0,0.6);

  /* typography */
  --f-head: 'Outfit', 'PingFang SC', 'Microsoft YaHei', -apple-system, sans-serif;
  --f-body: 'Inter', 'PingFang SC', 'Microsoft YaHei', -apple-system, sans-serif;
  --f-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* motion */
  --t-fast: 150ms cubic-bezier(.4,0,.2,1);
  --t-med:  250ms cubic-bezier(.4,0,.2,1);
  --t-slow: 400ms cubic-bezier(.4,0,.2,1);
}

/* ============================================================
   Light theme — 应用规则:
   - [data-theme="light"]   强制浅色
   - [data-theme="dark"]    强制深色 (默认)
   - [data-theme="auto"]    跟系统 (light 时套用浅色)
============================================================ */
:root[data-theme="light"],
:root[data-theme="auto"]:not([data-theme-applied]) { /* placeholder, real switch below */ }

@media (prefers-color-scheme: light) {
  :root[data-theme="auto"] { color-scheme: light; }
  :root[data-theme="auto"] {
    --bg:           #F8FAFC;
    --bg-1:         #FFFFFF;
    --bg-2:         #FFFFFF;
    --bg-3:         #F1F5F9;
    --bg-muted:     #F1F5F9;
    --fg:           #0F172A;
    --fg-soft:      #334155;
    --fg-muted:     #64748B;
    --fg-dim:       #94A3B8;
    --border:        rgba(15,23,42,0.08);
    --border-strong: rgba(15,23,42,0.14);
    --primary:     #1D4ED8;
    --primary-2:   #2563EB;
    --primary-3:   #1D4ED8;
    --accent:      #047857;
    --accent-2:    #059669;
    --ring:         rgba(37,99,235,0.40);
    --shadow-card:
      0 1px 0 rgba(15,23,42,0.04) inset,
      0 12px 32px -20px rgba(15,23,42,0.18);
  }
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg:           #F8FAFC;
  --bg-1:         #FFFFFF;
  --bg-2:         #FFFFFF;
  --bg-3:         #F1F5F9;
  --bg-muted:     #F1F5F9;
  --fg:           #0F172A;
  --fg-soft:      #334155;
  --fg-muted:     #64748B;
  --fg-dim:       #94A3B8;
  --border:        rgba(15,23,42,0.08);
  --border-strong: rgba(15,23,42,0.14);
  --primary:     #1D4ED8;
  --primary-2:   #2563EB;
  --primary-3:   #1D4ED8;
  --accent:      #047857;
  --accent-2:    #059669;
  --ring:         rgba(37,99,235,0.40);
  --shadow-card:
    0 1px 0 rgba(15,23,42,0.04) inset,
    0 12px 32px -20px rgba(15,23,42,0.18);
}

/* 浅色下 aurora 改成柔和的色斑,不刺眼 */
:root[data-theme="light"] .bg-aurora,
:root[data-theme="auto"] .bg-aurora {
  background:
    radial-gradient(60% 40% at 15% 0%, rgba(96,165,250,0.18), transparent 60%),
    radial-gradient(50% 40% at 95% 10%, rgba(16,185,129,0.12), transparent 60%),
    radial-gradient(60% 50% at 50% 100%, rgba(59,130,246,0.08), transparent 60%);
}
@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] .bg-aurora {
    background:
      radial-gradient(60% 40% at 15% 0%, rgba(30,64,175,0.30), transparent 60%),
      radial-gradient(50% 40% at 95% 10%, rgba(5,150,105,0.18), transparent 60%),
      radial-gradient(60% 50% at 50% 100%, rgba(59,130,246,0.10), transparent 60%);
  }
}

/* meta theme-color 跟随 (浏览器顶栏颜色) - 由 JS 同步,这里只做兜底 */

/* ============================================================
   Reset
============================================================ */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { color-scheme: dark; -webkit-text-size-adjust: 100%; }
body {
  min-height: 100dvh;
  font-family: var(--f-body);
  font-size: 15px;
  line-height: 1.6;
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  padding:
    max(env(safe-area-inset-top), 0px)
    max(env(safe-area-inset-right), 0px)
    max(env(safe-area-inset-bottom), 0px)
    max(env(safe-area-inset-left), 0px);
}
img, svg { display: block; max-width: 100%; }
ul, ol { padding: 0; margin: 0; list-style: none; }
button { font: inherit; cursor: pointer; }
a { color: inherit; }

/* ============================================================
   Background — subtle aurora
============================================================ */
.bg-aurora {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(60% 40% at 15% 0%, rgba(30,64,175,0.30), transparent 60%),
    radial-gradient(50% 40% at 95% 10%, rgba(5,150,105,0.18), transparent 60%),
    radial-gradient(60% 50% at 50% 100%, rgba(59,130,246,0.10), transparent 60%);
}

/* ============================================================
   Layout
============================================================ */
.container {
  max-width: 780px;
  margin: 0 auto;
  padding: 0 20px;
}
@media (min-width: 720px) {
  .container { padding: 0 32px; }
}

.main {
  padding: 16px 0 48px;
  display: flex; flex-direction: column; gap: 56px;
}

/* ============================================================
   Hero
============================================================ */
.hero {
  padding: 28px 0 24px;
}
.hero-inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  align-items: start;
}
@media (min-width: 720px) {
  .hero-inner {
    grid-template-columns: 1fr auto;
    gap: 40px;
  }
}

.eyebrow {
  margin: 0 0 10px;
  font-family: var(--f-mono);
  font-size: 11.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg-muted);
}

.hero-name {
  margin: 0 0 8px;
  font-family: var(--f-head);
  font-weight: 700;
  font-size: clamp(36px, 7vw, 56px);
  line-height: 1.05;
  letter-spacing: -0.025em;
  display: flex; align-items: baseline; flex-wrap: wrap; gap: 12px;
}
.hero-name-en {
  font-size: clamp(16px, 2.6vw, 20px);
  font-weight: 500;
  color: var(--fg-muted);
  letter-spacing: 0.04em;
  font-family: var(--f-body);
}

.hero-role {
  margin: 0 0 16px;
  font-family: var(--f-head);
  font-weight: 500;
  font-size: clamp(16px, 3.4vw, 19px);
  color: var(--primary-3);
  letter-spacing: -0.005em;
}

.hero-bio {
  margin: 0 0 20px;
  font-size: clamp(14.5px, 3.4vw, 16px);
  line-height: 1.65;
  color: var(--fg-soft);
  max-width: 56ch;
}

.hero-meta {
  display: flex; flex-wrap: wrap; gap: 8px 18px;
  margin: 0 0 24px;
  color: var(--fg-muted);
  font-size: 13.5px;
}
.hero-meta li { display: inline-flex; align-items: center; gap: 6px; }

.hero-actions {
  display: flex; flex-wrap: wrap; gap: 10px;
}

/* avatar */
.hero-right {
  display: flex; justify-content: flex-start;
}
@media (min-width: 720px) {
  .hero-right { justify-content: flex-end; padding-top: 8px; }
}
.avatar {
  width: 88px; height: 88px;
  display: grid; place-items: center;
  border-radius: 24px;
  background: linear-gradient(135deg, var(--primary), var(--primary-2) 55%, var(--accent));
  color: #fff;
  font-family: var(--f-head);
  font-weight: 700;
  font-size: 36px;
  letter-spacing: 0;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.18) inset,
    0 18px 40px -16px rgba(30,64,175,0.55);
  position: relative;
}
.avatar::after {
  content: '';
  position: absolute; inset: -2px;
  border-radius: 26px;
  border: 1px solid rgba(255,255,255,0.06);
  pointer-events: none;
}
@media (min-width: 720px) {
  .avatar { width: 104px; height: 104px; font-size: 42px; border-radius: 28px; }
  .avatar::after { border-radius: 30px; }
}

/* ============================================================
   Buttons
============================================================ */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px;
  border-radius: 999px;
  font-family: var(--f-body);
  font-weight: 500;
  font-size: 13.5px;
  text-decoration: none;
  border: 1px solid transparent;
  background: transparent;
  color: var(--fg);
  cursor: pointer;
  transition:
    background var(--t-fast),
    border-color var(--t-fast),
    color var(--t-fast),
    transform var(--t-fast);
  white-space: nowrap;
}
.btn .ico { width: 16px; height: 16px; fill: currentColor; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:focus-visible { outline: 2px solid var(--ring); outline-offset: 3px; }

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff;
  box-shadow: 0 8px 22px -10px rgba(30,64,175,0.7);
}
.btn-primary:hover { filter: brightness(1.08); }

.btn-secondary {
  background: var(--bg-2);
  border-color: var(--border);
  color: var(--fg);
}
.btn-secondary:hover { background: var(--bg-3); border-color: var(--border-strong); }

.btn-ghost {
  color: var(--fg-soft);
  border-color: var(--border);
}
.btn-ghost:hover { color: var(--fg); background: var(--bg-2); border-color: var(--border-strong); }

/* ============================================================
   Sections
============================================================ */
.section {
  display: flex; flex-direction: column; gap: 20px;
}
.section-head {
  display: flex; align-items: baseline; gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.section-num {
  font-family: var(--f-mono);
  font-size: 12px;
  color: var(--fg-dim);
  letter-spacing: 0.08em;
}
.section-title {
  margin: 0;
  font-family: var(--f-head);
  font-weight: 600;
  font-size: clamp(20px, 4.5vw, 24px);
  letter-spacing: -0.015em;
  color: var(--fg);
}

/* ============================================================
   Timeline (education / experience)
   - 一条全长连接线由 .timeline::before 绘制
   - dot 用 .t-period::before 渲染,top:50% + translateY(-50%) 永远跟时间文本垂直居中对齐
============================================================ */
.timeline {
  position: relative;
  display: flex; flex-direction: column; gap: 24px;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 5px;
  top: 8px;
  bottom: 14px;
  width: 1px;
  background: linear-gradient(180deg,
    var(--border-strong) 0%,
    var(--border) 80%,
    transparent 100%);
  pointer-events: none;
}
@media (min-width: 720px) {
  .timeline::before { left: 9px; }
}

.t-item {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px 24px;
  padding-left: 24px;
}

.t-period {
  position: relative;
  font-family: var(--f-mono);
  font-size: 12.5px;
  color: var(--fg-muted);
  letter-spacing: 0.02em;
  display: flex; align-items: center; gap: 6px;
  line-height: 1.4;
}
.t-period::before {
  content: '';
  position: absolute;
  left: -24px;
  top: 50%;
  transform: translateY(-50%);
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--bg-2);
  border: 2px solid var(--primary-2);
  /* 外层 shadow 用 page 背景色截断 timeline 连线,让 dot "浮"在线上 */
  box-shadow:
    0 0 0 3px var(--bg),
    0 0 0 6px rgba(59,130,246,0.12);
}
.t-item.is-current .t-period::before {
  background: var(--accent-2);
  border-color: var(--accent-2);
  box-shadow:
    0 0 0 3px var(--bg),
    0 0 0 6px rgba(16,185,129,0.20);
}
.t-sep { opacity: 0.45; }
.t-from, .t-to { white-space: nowrap; }

.t-body { min-width: 0; }
.t-head {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px;
  margin-bottom: 4px;
}
.t-title {
  margin: 0;
  font-family: var(--f-head);
  font-weight: 600;
  font-size: 16.5px;
  color: var(--fg);
  letter-spacing: -0.005em;
}
.t-meta {
  font-size: 13px;
  color: var(--primary-3);
}
.t-desc {
  margin: 0;
  font-size: 14px;
  color: var(--fg-soft);
  line-height: 1.65;
}
.t-desc em {
  font-style: normal;
  color: var(--fg);
  font-weight: 500;
}
.t-label {
  color: var(--fg);
  font-weight: 500;
}

/* tablet+: 2-col timeline */
@media (min-width: 720px) {
  .t-item {
    grid-template-columns: 110px 1fr;
    padding-left: 28px;
  }
  .t-item::before { left: 9px; }
  .t-item::after { left: 4px; }
}

/* ============================================================
   Skills grid
============================================================ */
.skill-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
@media (min-width: 520px) {
  .skill-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 820px) {
  .skill-grid { grid-template-columns: repeat(4, 1fr); }
}
.skill-card {
  padding: 16px;
  background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0)) , var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  transition: border-color var(--t-fast), transform var(--t-fast), background var(--t-fast);
}
.skill-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
}
.skill-head {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 6px;
}
.skill-ico {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border-radius: 9px;
  background: rgba(59,130,246,0.10);
  color: var(--primary-3);
  border: 1px solid rgba(59,130,246,0.18);
}
.skill-ico svg { width: 16px; height: 16px; fill: currentColor; }
.skill-card h3 {
  margin: 0;
  font-family: var(--f-head);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.005em;
}
.skill-card p {
  margin: 0;
  font-size: 13px;
  color: var(--fg-soft);
  line-height: 1.55;
}

/* ============================================================
   Projects
============================================================ */
.projects {
  display: flex; flex-direction: column; gap: 16px;
}
.project {
  padding: 22px;
  background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0)) , var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
  transition: border-color var(--t-fast);
}
.project:hover { border-color: var(--border-strong); }

.proj-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.proj-titles {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  min-width: 0;
}
.proj-name {
  margin: 0;
  font-family: var(--f-head);
  font-weight: 600;
  font-size: 17px;
  color: var(--fg);
  letter-spacing: -0.01em;
}
.proj-tag {
  display: inline-flex; align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11.5px;
  font-family: var(--f-mono);
  background: rgba(16,185,129,0.10);
  color: var(--accent-2);
  border: 1px solid rgba(16,185,129,0.22);
}
.proj-period {
  font-family: var(--f-mono);
  font-size: 12.5px;
  color: var(--fg-muted);
  white-space: nowrap;
}
.proj-desc {
  margin: 0 0 8px;
  font-size: 14px;
  color: var(--fg-soft);
  line-height: 1.65;
}
.proj-detail {
  margin: 0 0 12px;
  font-size: 13.5px;
  color: var(--fg-soft);
  line-height: 1.65;
}
.proj-detail strong { color: var(--fg); font-weight: 500; }
.proj-link { margin: 0 0 12px; font-size: 13px; }

/* stack chips */
.stack {
  display: flex; flex-wrap: wrap; gap: 6px;
}
.stack li {
  font-family: var(--f-mono);
  font-size: 11.5px;
  padding: 3px 9px;
  border-radius: 6px;
  color: var(--fg-soft);
  background: var(--bg-muted);
  border: 1px solid var(--border);
  letter-spacing: 0.01em;
}

/* link util */
.link {
  display: inline-flex; align-items: center; gap: 4px;
  color: var(--primary-3);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color var(--t-fast), color var(--t-fast);
}
.link .ico { width: 13px; height: 13px; fill: currentColor; }
.link:hover { color: #93C5FD; border-bottom-color: rgba(147,197,253,0.5); }
.link:focus-visible { outline: 2px solid var(--ring); outline-offset: 3px; border-radius: 3px; }

/* icon util in hero list */
.ico { width: 14px; height: 14px; fill: currentColor; flex: 0 0 auto; }

/* ============================================================
   Footer
============================================================ */
.footer {
  margin-top: 32px;
  padding: 28px 0 24px;
  border-top: 1px solid var(--border);
  background: linear-gradient(180deg, transparent, rgba(0,0,0,0.2));
}
.footer-inner {
  display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 18px;
  padding-bottom: 16px;
}
.footer-name {
  margin: 0 0 4px;
  font-family: var(--f-head);
  font-weight: 600;
  font-size: 16px;
}
.footer-sub {
  margin: 0;
  color: var(--fg-muted);
  font-size: 13px;
}
.footer-links {
  display: flex; flex-direction: column; gap: 4px;
  font-size: 13.5px;
  font-family: var(--f-mono);
}
.footer-copy {
  margin: 0;
  text-align: center;
  color: var(--fg-dim);
  font-size: 11.5px;
  font-family: var(--f-mono);
  letter-spacing: 0.05em;
}

/* ============================================================
   Theme toggle button — 固定在右上角,所有断点都可见
============================================================ */
.theme-toggle {
  position: fixed;
  top: max(env(safe-area-inset-top), 12px);
  right: max(env(safe-area-inset-right), 16px);
  z-index: 100;
  width: 44px;
  height: 44px;
  display: grid; place-items: center;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--fg-soft);
  cursor: pointer;
  transition:
    background var(--t-fast),
    color var(--t-fast),
    border-color var(--t-fast),
    transform var(--t-fast);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.04) inset,
    0 6px 18px -8px rgba(0,0,0,0.4);
}
.theme-toggle:hover {
  color: var(--fg);
  border-color: var(--border-strong);
  transform: translateY(-1px);
}
.theme-toggle:active { transform: translateY(0); }
.theme-toggle:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 3px;
}
.theme-toggle svg {
  width: 20px; height: 20px;
  fill: currentColor;
  transition: transform var(--t-med), opacity var(--t-fast);
}
/* 显示 sun / moon 根据当前 theme */
.theme-toggle .ico-sun,
.theme-toggle .ico-moon { grid-area: 1 / 1; }
:root[data-theme="light"] .theme-toggle .ico-moon,
:root[data-theme="auto"] .theme-toggle .ico-moon { display: block; }
:root[data-theme="light"] .theme-toggle .ico-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .ico-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .ico-moon { display: none; }
:root[data-theme="auto"] .theme-toggle .ico-sun { display: none; }

@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] .theme-toggle .ico-sun { display: block; }
  :root[data-theme="auto"] .theme-toggle .ico-moon { display: none; }
}

/* ============================================================
   Mobile-only refinements (≤ 720px)
   - 只在手机生效,桌面端不受影响
============================================================ */
@media (max-width: 720px) {
  /* 容器内边距优化:小屏给内容更多呼吸 */
  body { font-size: 15.5px; line-height: 1.65; }

  .container { padding: 0 18px; }
  .main { gap: 44px; padding: 12px 0 40px; }

  /* Hero: 名字+头像同行,头像稍小,左右贴合更紧凑 */
  .hero { padding: 64px 0 16px; } /* 顶部留出主题按钮空间 */
  .hero-inner { gap: 18px; }

  .hero-name {
    font-size: 34px;
    line-height: 1.1;
    gap: 8px;
  }
  .hero-name-en { font-size: 14px; }
  .hero-role { font-size: 16px; margin-bottom: 14px; }
  .hero-bio {
    font-size: 15.5px;
    line-height: 1.7;
    color: var(--fg-soft);
  }
  .hero-meta { gap: 6px 14px; font-size: 13px; margin-bottom: 20px; }

  /* 头像移到右上更小一些 */
  .hero-right { padding-top: 4px; }
  .avatar {
    width: 64px; height: 64px;
    font-size: 28px;
    border-radius: 18px;
  }
  .avatar::after { border-radius: 20px; }

  /* 按钮:触摸目标 ≥44px */
  .hero-actions { gap: 8px; }
  .btn {
    min-height: 44px;
    padding: 10px 16px;
    font-size: 14px;
  }
  /* 移动端按钮文字邮箱/电话太长会撑破布局,改成完整宽度堆叠 */
  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .btn {
    justify-content: center;
    width: 100%;
  }

  /* Section 标题尺寸缩 */
  .section { gap: 16px; }
  .section-head { padding-bottom: 8px; gap: 10px; }
  .section-title { font-size: 19px; }

  /* 时间线:窄屏让连接线和文字更舒服 */
  .timeline { gap: 22px; }
  .t-item {
    padding-left: 22px;
    gap: 4px 0;
  }
  .timeline::before { left: 4px; top: 6px; bottom: 12px; }
  .t-period::before {
    left: -22px;
    width: 10px; height: 10px;
  }
  .t-period { font-size: 12px; }
  .t-head { gap: 2px 10px; margin-bottom: 6px; }
  .t-title { font-size: 16px; }
  .t-meta { font-size: 12.5px; display: block; width: 100%; }
  .t-desc { font-size: 14px; line-height: 1.7; }

  /* 技能卡:单列时让内容呼吸 */
  .skill-grid { gap: 10px; }
  .skill-card { padding: 14px; min-height: 0; }
  .skill-head { gap: 10px; margin-bottom: 4px; }
  .skill-ico { width: 32px; height: 32px; }
  .skill-ico svg { width: 17px; height: 17px; }
  .skill-card h3 { font-size: 14.5px; }
  .skill-card p { font-size: 13.5px; line-height: 1.55; }

  /* 项目卡:padding 收一点,但内部行距/字号更舒服 */
  .project { padding: 18px 16px; border-radius: var(--r-md); }
  .proj-head { gap: 6px 12px; margin-bottom: 10px; }
  .proj-titles { gap: 6px 10px; }
  .proj-name { font-size: 16.5px; line-height: 1.3; }
  .proj-tag { font-size: 11px; padding: 2px 8px; }
  .proj-period { font-size: 12px; width: 100%; margin-top: 2px; }
  .proj-desc { font-size: 14px; line-height: 1.7; margin-bottom: 10px; }
  .proj-detail { font-size: 13.5px; line-height: 1.7; margin-bottom: 12px; }
  .stack { gap: 5px; }
  .stack li { font-size: 11px; padding: 3px 8px; }

  /* Footer */
  .footer { padding: 24px 0 max(24px, env(safe-area-inset-bottom)); }
  .footer-inner { flex-direction: column; align-items: flex-start; gap: 12px; padding-bottom: 14px; }
  .footer-links { font-size: 13px; }

  /* 链接最小触摸高度 (mailto/tel) */
  .footer-links a,
  .t-body a,
  .proj-link a { display: inline-flex; min-height: 32px; align-items: center; padding: 2px 0; }
}

/* 超小屏 (≤ 380px) 再压一档,避免单词溢出 */
@media (max-width: 380px) {
  .hero-name { font-size: 30px; }
  .hero-name-en { font-size: 13px; }
  .container { padding: 0 16px; }
  .project { padding: 16px 14px; }
}

/* ============================================================
   Motion preferences
============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
  }
}

/* ============================================================
   Print stylesheet — clean A4 PDF output
============================================================ */
@media print {
  :root {
    --bg: #fff;
    --bg-1: #fff; --bg-2: #fff; --bg-3: #fff; --bg-muted: #f7f7f8;
    --fg: #111; --fg-soft: #1f2937; --fg-muted: #475569; --fg-dim: #64748b;
    --border: #e5e7eb; --border-strong: #d1d5db;
    --primary-3: #1d4ed8;
    --accent-2: #047857;
    --shadow-card: none;
  }
  html { color-scheme: light; }
  body {
    background: #fff !important;
    color: #111 !important;
    font-size: 11pt;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    padding: 0;
  }
  .bg-aurora,
  .avatar,
  .hero-actions,
  .footer-copy { display: none !important; }

  .container { max-width: 100%; padding: 0 14mm; }
  .main { padding: 0; gap: 18pt; }
  .hero { padding: 8pt 0 4pt; }
  .hero-inner { grid-template-columns: 1fr; gap: 6pt; }
  .hero-name { font-size: 26pt; }
  .hero-name-en { font-size: 12pt; color: #555; }
  .hero-role { font-size: 13pt; color: #1d4ed8; }
  .hero-bio { font-size: 10.5pt; color: #1f2937; }

  .section { gap: 8pt; page-break-inside: avoid; }
  .section-title { font-size: 14pt; color: #111; }
  .section-num { color: #888; }
  .section-head { border-color: #d1d5db; }

  .t-item { page-break-inside: avoid; }
  .timeline::before { background: #d1d5db; }
  .t-period::before {
    background: #fff;
    border-color: #1d4ed8;
    box-shadow: 0 0 0 3px #fff;
  }
  .t-item.is-current .t-period::before {
    background: #047857;
    border-color: #047857;
    box-shadow: 0 0 0 3px #fff;
  }
  .t-title { color: #111; font-size: 11.5pt; }
  .t-meta { color: #1d4ed8; }
  .t-desc, .proj-desc, .proj-detail, .skill-card p { color: #1f2937; }
  .t-period, .proj-period { color: #555; }

  .skill-card,
  .project {
    border: 1px solid #e5e7eb !important;
    background: #fff !important;
    box-shadow: none !important;
    page-break-inside: avoid;
  }
  .stack li {
    background: #f3f4f6 !important;
    color: #1f2937 !important;
    border-color: #e5e7eb !important;
  }
  .proj-tag {
    background: #ecfdf5 !important;
    color: #047857 !important;
    border-color: #a7f3d0 !important;
  }
  .skill-ico {
    background: #eff6ff !important;
    color: #1d4ed8 !important;
    border-color: #bfdbfe !important;
  }
  .footer { border-color: #e5e7eb; background: none; padding: 6pt 0; margin-top: 8pt; }
  .footer-name { color: #111; }
  .footer-sub, .footer-links { color: #1f2937; }
  a, .link { color: #1d4ed8 !important; border: 0 !important; }
}
