/* =========================================================
   个人主页 · 样式
   配色：墨黑 / 米白 / 青绿点缀，浅色 + 深色两套主题
   ========================================================= */

:root {
  --bg: #f6f4ef;
  --bg-soft: #efece5;
  --panel: #ffffff;
  --ink: #16181b;
  --ink-soft: #4b5057;
  --ink-faint: #8b9099;
  --line: rgba(22, 24, 27, 0.12);
  --accent: #0f766e;
  --accent-soft: rgba(15, 118, 110, 0.10);
  --accent-ink: #0b5b55;
  --shadow: 0 1px 2px rgba(16, 24, 32, .04), 0 12px 32px -12px rgba(16, 24, 32, .16);
  --radius: 14px;
  --wrap: 1080px;
  --ease: cubic-bezier(.22, .61, .36, 1);
}

html[data-theme="dark"] {
  --bg: #101214;
  --bg-soft: #15181b;
  --panel: #181b1f;
  --ink: #eceff2;
  --ink-soft: #a8b0b8;
  --ink-faint: #767e88;
  --line: rgba(236, 239, 242, 0.12);
  --accent: #4fd1c5;
  --accent-soft: rgba(79, 209, 197, 0.12);
  --accent-ink: #9ef0e7;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 18px 40px -18px rgba(0, 0, 0, .6);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.7;
  letter-spacing: .01em;
  -webkit-font-smoothing: antialiased;
  transition: background .35s var(--ease), color .35s var(--ease);
  overflow-x: hidden;
}

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

/* 背景：极淡的格线与光晕 */
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    radial-gradient(1200px 600px at 82% -8%, var(--accent-soft), transparent 62%),
    radial-gradient(900px 500px at 4% 8%, rgba(180, 150, 90, .07), transparent 60%);
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 28px;
  position: relative;
  z-index: 1;
}

/* ---------------- 导航 ---------------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 14px 28px;
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom: 1px solid transparent;
  transition: border-color .3s var(--ease), background .3s var(--ease);
}
.nav--scrolled { border-bottom-color: var(--line); }

.nav__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  letter-spacing: .02em;
}
.nav__mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--accent);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
}
.nav__name { font-size: 15px; color: var(--ink); }

.nav__links {
  display: flex;
  gap: 6px;
  margin-left: auto;
}
.nav__links a {
  position: relative;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 14px;
  color: var(--ink-soft);
  transition: color .25s, background .25s;
}
.nav__links a:hover { color: var(--ink); background: var(--accent-soft); }

.nav__toggle {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  color: var(--ink-soft);
  transition: color .2s, border-color .2s, transform .2s;
}
.nav__toggle:hover { color: var(--ink); border-color: var(--accent); }
.nav__toggle svg { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; }

/* ---------------- Hero ---------------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, .9fr);
  gap: 56px;
  align-items: center;
  padding: 96px 28px 84px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 18px;
  padding: 5px 12px 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12.5px;
  color: var(--ink-soft);
  background: color-mix(in srgb, var(--panel) 70%, transparent);
}
.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 var(--accent);
  animation: pulse 2.4s infinite;
}
.dot[data-off="1"] { background: var(--ink-faint); animation: none; box-shadow: none; }
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(15, 118, 110, .45); }
  70%  { box-shadow: 0 0 0 7px rgba(15, 118, 110, 0); }
  100% { box-shadow: 0 0 0 0 rgba(15, 118, 110, 0); }
}

.hero__title {
  margin: 0 0 14px;
  font-size: clamp(38px, 6vw, 62px);
  line-height: 1.05;
  letter-spacing: -.02em;
  font-weight: 700;
}
.hero__title em {
  display: block;
  margin-top: 6px;
  font-style: normal;
  font-size: .32em;
  font-weight: 500;
  letter-spacing: .28em;
  color: var(--ink-faint);
  text-transform: uppercase;
}

.hero__tagline {
  margin: 0 0 18px;
  font-size: 18px;
  color: var(--accent-ink);
  font-weight: 500;
}

.hero__intro {
  margin: 0 0 22px;
  max-width: 42em;
  color: var(--ink-soft);
  font-size: 15.5px;
}

.hero__meta {
  margin: 0 0 30px;
  font-size: 13.5px;
  color: var(--ink-faint);
}
.hero__meta a { border-bottom: 1px dashed var(--line); transition: color .2s, border-color .2s; }
.hero__meta a:hover { color: var(--accent); border-color: var(--accent); }
.sep { margin: 0 8px; opacity: .5; }

.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: 999px;
  font-size: 14.5px;
  font-weight: 500;
  border: 1px solid transparent;
  transition: transform .2s var(--ease), background .25s, box-shadow .25s, color .25s;
}
.btn--solid { background: var(--ink); color: var(--bg); }
.btn--solid:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.btn--ghost { border-color: var(--line); color: var(--ink); }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }

.hero__card {
  margin: 0;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: color-mix(in srgb, var(--panel) 88%, transparent);
  box-shadow: var(--shadow);
  text-align: center;
}

.avatar {
  aspect-ratio: 1 / 1.06;
  border-radius: 14px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    linear-gradient(150deg, rgba(15, 118, 110, .18), rgba(180, 150, 90, .14)),
    var(--bg-soft);
  border: 1px solid var(--line);
}
.avatar span {
  font-size: 68px;
  font-weight: 700;
  color: var(--accent-ink);
  letter-spacing: -.02em;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }

.hero__card figcaption {
  margin-top: 16px;
  text-align: left;
  display: grid;
  gap: 4px;
}
.hero__card-kicker {
  font-size: 11px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.hero__card-note { font-size: 14px; color: var(--ink-soft); }

/* ---------------- 通用 section ---------------- */

.section { padding: 78px 28px; border-top: 1px solid var(--line); }

.section__head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}
.section__idx {
  font-size: 12px;
  letter-spacing: .12em;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.section__head h2 {
  margin: 0;
  font-size: clamp(24px, 3.2vw, 32px);
  letter-spacing: -.01em;
  font-weight: 650;
}
.section__desc {
  margin: 0 0 0 auto;
  font-size: 14px;
  color: var(--ink-faint);
}

/* ---------------- 关于 ---------------- */

.about {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: 56px;
}

.about__prose p {
  margin: 0 0 18px;
  color: var(--ink-soft);
  font-size: 15.5px;
  max-width: 46em;
}
.about__prose p:first-child { color: var(--ink); }

.stats { margin: 0 0 34px; display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.stats div { padding: 16px 18px; border: 1px solid var(--line); border-radius: 12px; background: color-mix(in srgb, var(--panel) 70%, transparent); }
.stats dt { margin: 0; font-size: 12px; letter-spacing: .06em; color: var(--ink-faint); }
.stats dd { margin: 6px 0 0; font-size: 22px; font-weight: 650; letter-spacing: -.01em; }

.skills h3 {
  margin: 0 0 12px;
  font-size: 12px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink-faint);
  font-weight: 600;
}
.skills ul { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.skills li {
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 13px;
  color: var(--ink-soft);
}

.timeline {
  margin: 56px 0 0;
  padding: 0 0 0 22px;
  list-style: none;
  border-left: 1px solid var(--line);
}
.timeline li { position: relative; padding: 0 0 30px 26px; }
.timeline li::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 7px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
}
.timeline time {
  display: block;
  font-size: 12.5px;
  letter-spacing: .05em;
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
}
.timeline h4 { margin: 4px 0 4px; font-size: 16px; font-weight: 600; }
.timeline p { margin: 0; font-size: 14px; color: var(--ink-soft); }

/* ---------------- 项目 ---------------- */

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--panel) 84%, transparent);
  transition: transform .25s var(--ease), border-color .25s, box-shadow .25s;
  overflow: hidden;
}
.card:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  box-shadow: var(--shadow);
}
.card__top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.card h3 { margin: 0; font-size: 17px; font-weight: 620; letter-spacing: -.005em; }
.card__period { font-size: 12px; color: var(--ink-faint); white-space: nowrap; font-variant-numeric: tabular-nums; }
.card p { margin: 0; font-size: 14px; color: var(--ink-soft); }
.card__role {
  font-size: 12.5px;
  color: var(--accent-ink);
}
.card__tags { margin: auto 0 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 6px; }
.card__tags li {
  font-size: 11.5px;
  padding: 3px 9px;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent-ink);
}
.card__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--ink-soft);
  margin-top: 4px;
  transition: color .2s, gap .2s;
}
.card__link:hover { color: var(--accent); gap: 10px; }

/* ---------------- 笔记 ---------------- */

.notes { display: grid; gap: 0; }
.note {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) auto;
  gap: 24px;
  align-items: baseline;
  padding: 22px 4px;
  border-bottom: 1px solid var(--line);
  transition: background .25s, padding-left .25s;
}
.note:hover { padding-left: 10px; background: linear-gradient(90deg, var(--accent-soft), transparent 70%); }
.note time { font-size: 12.5px; color: var(--ink-faint); font-variant-numeric: tabular-nums; letter-spacing: .03em; }
.note__body h3 { margin: 0 0 3px; font-size: 16px; font-weight: 600; }
.note__body p { margin: 0; font-size: 14px; color: var(--ink-soft); }
.note__tag {
  font-size: 11.5px;
  padding: 3px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-faint);
  white-space: nowrap;
}

/* ---------------- 联系 ---------------- */

.contact__lead {
  margin: 0 0 34px;
  max-width: 40em;
  font-size: 15.5px;
  color: var(--ink-soft);
}

.links { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }

.link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--panel) 70%, transparent);
  transition: transform .22s var(--ease), border-color .22s, background .22s;
}
.link:hover { transform: translateY(-2px); border-color: var(--accent); }
.link__mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: none;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .02em;
}
.link__text { display: grid; min-width: 0; }
.link__text b { font-size: 14.5px; font-weight: 600; }
.link__text span { font-size: 12.5px; color: var(--ink-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link__arrow { margin-left: auto; color: var(--ink-faint); font-size: 16px; transition: transform .22s, color .22s; }
.link:hover .link__arrow { transform: translateX(3px); color: var(--accent); }

/* ---------------- footer ---------------- */

.footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 34px 28px 56px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--ink-faint);
}
.footer__hint code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11.5px;
  padding: 2px 6px;
  border-radius: 5px;
  background: var(--accent-soft);
  color: var(--accent-ink);
}

/* ---------------- toast ---------------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 20px);
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s, transform .25s var(--ease);
  z-index: 50;
}
.toast--show { opacity: 1; transform: translate(-50%, 0); }

/* ---------------- 进场动画 ---------------- */

.reveal { opacity: 0; transform: translateY(14px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal--in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .dot { animation: none; }
}

/* ---------------- 响应式 ---------------- */

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 40px; padding-top: 64px; padding-bottom: 60px; }
  .hero__card { max-width: 420px; }
  .about { grid-template-columns: 1fr; gap: 40px; }
  .section { padding: 60px 28px; }
}

@media (max-width: 620px) {
  .wrap { padding: 0 20px; }
  .nav { padding: 12px 20px; gap: 12px; }
  .nav__links { display: none; }
  .hero { padding: 52px 20px 48px; }
  .hero__title { font-size: 34px; }
  .hero__meta { font-size: 13px; }
  .hero__card { max-width: 300px; padding: 16px; }
  .hero__card .avatar span { font-size: 52px; }
  .section { padding: 52px 20px; }
  .section__desc { margin-left: 0; width: 100%; }
  .stats { grid-template-columns: 1fr 1fr; gap: 12px; }
  .note { grid-template-columns: 1fr; gap: 8px; }
  .note__tag { justify-self: start; }
  .footer { padding: 28px 20px 44px; }
  .cards { grid-template-columns: 1fr; }
}
