/* ===== 变量：想整体换配色，改这里就够了 ===== */
:root {
  --bg: #ffffff;
  --bg-alt: #f6f7f9;
  --text: #14161a;
  --text-soft: #5b6270;
  --line: #e5e7eb;
  --accent: #d97706;
  --accent-soft: rgba(217, 119, 6, 0.12);
  --card: #ffffff;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 12px 32px -12px rgba(16, 24, 40, .18);
  --radius: 14px;
  --maxw: 1040px;
}

html[data-theme="dark"] {
  --bg: #0d1117;
  --bg-alt: #131922;
  --text: #e8ecf1;
  --text-soft: #98a2b3;
  --line: #232b36;
  --accent: #f0a742;
  --accent-soft: rgba(240, 167, 66, .14);
  --card: #151c26;
  --shadow: 0 1px 2px rgba(0, 0, 0, .5), 0 18px 40px -18px rgba(0, 0, 0, .8);
}

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

html { scroll-behavior: smooth; scroll-padding-top: 84px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
               "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  transition: background-color .25s ease, color .25s ease;
}

img { max-width: 100%; display: block; }
ul, ol { margin: 0; padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { line-height: 1.25; margin: 0; letter-spacing: -0.01em; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .92em; }

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; z-index: 99; background: var(--card); padding: 10px 16px; border-radius: 10px; box-shadow: var(--shadow); }

/* ===== 导航 ===== */
.nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: saturate(180%) blur(14px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.nav.scrolled { border-bottom-color: var(--line); box-shadow: 0 6px 24px -18px rgba(0, 0, 0, .5); }
.nav-inner { display: flex; align-items: center; gap: 20px; height: 68px; }
.brand { font-weight: 700; font-size: 1.05rem; letter-spacing: .02em; }
.nav-links { display: flex; gap: 26px; margin-left: auto; }
.nav-links a { font-size: .93rem; color: var(--text-soft); transition: color .18s ease; position: relative; padding: 6px 0; }
.nav-links a:hover, .nav-links a.active { color: var(--text); }
.nav-links a.active::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--accent); border-radius: 2px; }
.nav-actions { display: flex; gap: 8px; margin-left: 4px; }
.icon-btn {
  display: grid; place-items: center; width: 38px; height: 38px;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--card); color: var(--text-soft); cursor: pointer;
  transition: color .18s ease, border-color .18s ease, transform .18s ease;
}
.icon-btn:hover { color: var(--text); border-color: var(--accent); }
.menu-btn { display: none; }

/* ===== 首屏 ===== */
.hero { position: relative; overflow: hidden; padding: 84px 0 72px; }
.hero-glow {
  position: absolute; inset: -40% 40% 40% -20%;
  background: radial-gradient(closest-side, var(--accent-soft), transparent 70%);
  pointer-events: none;
}
.hero-inner { position: relative; display: grid; grid-template-columns: 1.45fr .85fr; gap: 56px; align-items: center; }
.eyebrow { color: var(--accent); font-weight: 600; letter-spacing: .12em; text-transform: uppercase; font-size: .78rem; margin: 0 0 10px; }
.hero h1 { font-size: clamp(2.6rem, 6vw, 3.9rem); font-weight: 800; }
.tagline { font-size: clamp(1.05rem, 2.2vw, 1.3rem); font-weight: 600; margin: 14px 0 0; }
.pitch { color: var(--text-soft); margin: 16px 0 0; max-width: 46ch; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.hero-intent { margin-top: 18px; }
.hero-intent li { font-size: .8rem; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 22px; border-radius: 999px; font-weight: 600; font-size: .95rem;
  border: 1px solid transparent; cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease;
}
.btn.primary { background: var(--accent); color: #fff; box-shadow: 0 10px 24px -12px var(--accent); }
.btn.primary:hover { transform: translateY(-2px); }
.btn.ghost { border-color: var(--line); color: var(--text); background: var(--card); }
.btn.ghost:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }
.socials { display: flex; gap: 12px; margin-top: 30px; }
.socials a {
  display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px;
  background: var(--card); border: 1px solid var(--line); color: var(--text-soft);
  transition: all .18s ease;
}
.socials a:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-3px); box-shadow: var(--shadow); }
.hero-photo img {
  width: 100%; max-width: 300px; height: auto; aspect-ratio: 1; object-fit: cover;
  border-radius: 50%; margin-left: auto;
  border: 4px solid var(--card); box-shadow: var(--shadow);
  background: var(--bg-alt);
}

/* ===== 通用区块 ===== */
.section { padding: 76px 0; }
.section.alt { background: var(--bg-alt); }
.section-title { display: flex; align-items: baseline; gap: 14px; font-size: clamp(1.5rem, 3vw, 1.95rem); font-weight: 700; margin-bottom: 34px; }
.section-title .num { font-size: .85rem; font-weight: 700; color: var(--accent); letter-spacing: .1em; }
.prose p { margin: 0 0 1em; color: var(--text-soft); max-width: 68ch; }
.prose p:last-child { margin-bottom: 0; }

.facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 36px; }
.facts li { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.facts strong { display: block; font-size: 1.5rem; font-weight: 800; letter-spacing: -0.02em; }
.facts span { color: var(--text-soft); font-size: .86rem; }

/* ===== 时间线 ===== */
.timeline { position: relative; }
.tl-item { display: grid; grid-template-columns: 190px 1fr; gap: 28px; padding-bottom: 38px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-meta { position: relative; padding-top: 2px; }
.tl-date { font-size: .87rem; font-weight: 600; color: var(--text-soft); font-variant-numeric: tabular-nums; }
.tl-body { position: relative; padding-left: 28px; border-left: 1px solid var(--line); }
.tl-body::before {
  content: ""; position: absolute; left: -5px; top: 9px; width: 9px; height: 9px;
  border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--bg-alt);
}
.section:not(.alt) .tl-body::before { box-shadow: 0 0 0 3px var(--bg); }
.tl-body h3 { font-size: 1.1rem; font-weight: 700; }
.tl-body h3 em { font-style: normal; color: var(--text-soft); margin: 0 6px; }
.tl-body .org { color: var(--text-soft); font-weight: 500; }
.tl-body ul { margin-top: 12px; }
.tl-body li { position: relative; padding-left: 18px; color: var(--text-soft); margin-bottom: 6px; }
.tl-body li::before { content: ""; position: absolute; left: 2px; top: .72em; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); opacity: .7; }

/* ===== 项目卡片 ===== */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.card h3 { font-size: 1.08rem; }
.card p { color: var(--text-soft); font-size: .93rem; margin: 10px 0 16px; }
.card .note { font-size: .82rem; margin: -6px 0 14px; opacity: .78; }
.tl-body li.note { font-size: .86rem; opacity: .78; }
.toast { position: fixed; left: 50%; bottom: 30px; transform: translate(-50%, 10px); background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 999px; font-size: .86rem; opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .2s ease; z-index: 90; box-shadow: var(--shadow); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tags li {
  font-size: .78rem; font-weight: 600; padding: 4px 11px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent);
}

/* ===== 技能 ===== */
.skills { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 32px; }
.skill-group h3 { font-size: .95rem; font-weight: 700; margin-bottom: 14px; color: var(--text-soft); letter-spacing: .04em; }
.plain li { color: var(--text-soft); font-size: .93rem; margin-bottom: 8px; }
.plain strong { color: var(--text); }

/* ===== 联系 ===== */
.contact-list { display: grid; gap: 14px; margin-top: 28px; }
.contact-list li { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.contact-list span { width: 56px; color: var(--text-soft); font-size: .88rem; }
.contact-list a, .contact-list code { font-weight: 600; border-bottom: 1px solid transparent; transition: border-color .18s ease, color .18s ease; }
.contact-list a:hover { color: var(--accent); border-bottom-color: var(--accent); }

/* ===== 页脚 ===== */
.footer { border-top: 1px solid var(--line); padding: 32px 0; }
.footer p { margin: 0; font-size: .86rem; color: var(--text-soft); }
.footer .muted { opacity: .75; font-size: .8rem; }

/* ===== 滚动进场动画 ===== */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ===== 响应式 ===== */
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; gap: 36px; }
  .hero-photo { order: -1; }
  .hero-photo img { margin: 0; max-width: 180px; }
  .facts { grid-template-columns: repeat(2, 1fr); }
  .tl-item { grid-template-columns: 1fr; gap: 8px; }
  .tl-body { padding-left: 22px; }
}

@media (max-width: 720px) {
  .menu-btn { display: grid; }
  .nav-links {
    position: absolute; top: 68px; left: 0; right: 0;
    flex-direction: column; gap: 0; padding: 8px 24px 18px;
    background: var(--bg); border-bottom: 1px solid var(--line);
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px 0; border-bottom: 1px solid var(--line); }
  .nav-links a:last-child { border-bottom: 0; }
  .nav-links a.active::after { display: none; }
  .section { padding: 56px 0; }
  .hero { padding: 56px 0 48px; }
}

/* ===== 打印 / 存成 PDF：自动隐藏导航和按钮 ===== */
@page { margin: 12mm; }

@media (max-width: 720px) { .grid-2 { grid-template-columns: 1fr; } }
@media print {
  @page { margin: 10mm 12mm; }
  :root { --bg: #fff; --bg-alt: #fff; --text: #000; --text-soft: #333; --line: #ccc; --card: #fff; --accent: #000; --accent-soft: #eee; }
  html[data-theme="dark"] { --bg: #fff; --bg-alt: #fff; --text: #000; --text-soft: #333; --line: #ccc; --card: #fff; --accent: #000; }
  .nav, .hero-cta, .socials, .footer .muted, .hero-glow, .skip { display: none !important; }
  body { font-size: 9.3pt; line-height: 1.3; }
  .wrap { max-width: none; padding: 0; }
  .section { padding: 6px 0; }
  .section.alt { background: none; }
  .section-title { font-size: 12pt; margin-bottom: 8px; }
  .hero { padding: 0 0 4px; }
  .hero-inner { grid-template-columns: 1fr auto; gap: 20px; }
  .hero-photo { order: 0; }
  .hero h1 { font-size: 19pt; }
  .eyebrow { font-size: 9pt; margin-bottom: 2px; }
  .tagline { font-size: 10.5pt; margin-top: 4px; }
  .pitch { margin-top: 4px; font-size: 9.3pt; }
  .prose p { margin-bottom: .3em; }
  .hero-photo img { width: 76px; height: 76px; max-width: none; margin: 0; border: 0; box-shadow: none; }
  .card, .facts li { box-shadow: none; border-radius: 4px; }
  .card { padding: 8px 10px; }
  .card h3 { font-size: 10pt; }
  .card p { margin: 4px 0 6px; font-size: 8.7pt; }
  .tags { gap: 5px; }
  .tags li { font-size: 7.5pt; padding: 2px 8px; }
  .facts { margin-top: 8px; gap: 6px; grid-template-columns: repeat(4, 1fr); }
  .facts li { padding: 6px 9px; }
  .facts strong { font-size: 12pt; }
  .facts span { font-size: 7.8pt; }
  .tl-item { padding-bottom: 9px; grid-template-columns: 118px 1fr; gap: 12px; }
  .tl-date { font-size: 8.5pt; }
  .timeline { margin-top: 4px; }
  .tl-body { padding-left: 18px; }
  .tl-body h3 { font-size: 9.8pt; margin-bottom: 2px; }
  .tl-body ul { margin-top: 3px; }
  .tl-body li { font-size: 8.9pt; margin-bottom: 1.5px; }
  .skills { gap: 12px; grid-template-columns: repeat(3, 1fr); }
  .skill-group h3 { font-size: 8.8pt; margin-bottom: 7px; }
  .contact-list { margin-top: 8px; gap: 3px; }
  .contact-list li { font-size: 9.3pt; }
  .card:hover, .socials a:hover, .btn:hover { transform: none; box-shadow: none; }
  .reveal { opacity: 1 !important; transform: none !important; }
  .tl-item, .card, .facts li, .skill-group, .contact-list li { page-break-inside: avoid; }
  .section-title { page-break-after: avoid; }
  .hero-intent { margin-top: 6px; }
  .card .note, .tl-body li.note { font-size: 8.3pt; opacity: .85; }
  a { text-decoration: none; }
}
