/* ============================================================
   现代极简 · 个人主页样式
   主题通过 body.dark 切换，颜色统一用 CSS 变量管理
   ============================================================ */

:root {
  --bg: #ffffff;
  --bg-soft: #f6f7f9;
  --text: #1a1a1a;
  --text-soft: #5b6470;
  --border: #e6e8eb;
  --accent: #2563eb;
  --accent-soft: rgba(37, 99, 235, 0.1);
  --card: #ffffff;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 8px 24px rgba(0, 0, 0, 0.04);
  --radius: 14px;
  --maxw: 880px;
}

body.dark {
  --bg: #0f1115;
  --bg-soft: #161a21;
  --text: #e8eaed;
  --text-soft: #a0a8b4;
  --border: #262b34;
  --accent: #5b8cff;
  --accent-soft: rgba(91, 140, 255, 0.14);
  --card: #161a21;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.3);
}

* { box-sizing: border-box; }

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

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

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- 导航 ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}
.nav__brand {
  font-weight: 700;
  font-size: 18px;
  color: var(--text);
}
.nav__brand:hover { text-decoration: none; }
.nav__links { display: flex; gap: 22px; }
.nav__links a {
  color: var(--text-soft);
  font-size: 15px;
  transition: color 0.2s;
}
.nav__links a:hover { color: var(--text); text-decoration: none; }

.theme-toggle {
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text);
  width: 38px;
  height: 38px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  display: grid;
  place-items: center;
  transition: background 0.2s, border-color 0.2s;
}
.theme-toggle:hover { border-color: var(--accent); }

/* ---------- Hero ---------- */
.hero { padding: 96px 24px 72px; text-align: center; }
.hero__hello { color: var(--text-soft); margin: 0 0 8px; letter-spacing: 0.04em; }
.hero__name {
  font-size: clamp(40px, 8vw, 68px);
  margin: 0;
  line-height: 1.05;
  letter-spacing: -0.02em;
}
.hero__role { font-size: clamp(18px, 3vw, 22px); color: var(--accent); margin: 14px 0 0; font-weight: 600; }
.hero__tagline {
  color: var(--text-soft);
  max-width: 620px;
  margin: 18px auto 0;
  font-size: 17px;
}
.hero__actions { display: flex; gap: 14px; justify-content: center; margin-top: 32px; flex-wrap: wrap; }
.hero__socials { display: flex; gap: 18px; justify-content: center; margin-top: 34px; }
.hero__socials a {
  color: var(--text-soft);
  width: 42px; height: 42px;
  border: 1px solid var(--border);
  border-radius: 12px;
  display: grid; place-items: center;
  transition: color 0.2s, border-color 0.2s, transform 0.2s;
}
.hero__socials a:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-2px); text-decoration: none; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-block;
  padding: 11px 22px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.15s, background 0.2s, border-color 0.2s, color 0.2s;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: color-mix(in srgb, var(--accent) 88%, #000); }
.btn--ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn--sm { padding: 7px 14px; font-size: 13px; }

/* ---------- 通用 section ---------- */
.section { padding: 64px 0; }
.section__title {
  font-size: 26px;
  margin: 0 0 28px;
  position: relative;
  padding-left: 14px;
}
.section__title::before {
  content: "";
  position: absolute;
  left: 0; top: 6px; bottom: 6px;
  width: 4px; border-radius: 2px;
  background: var(--accent);
}
.prose p { color: var(--text-soft); margin: 0 0 16px; font-size: 17px; }

/* ---------- 技能栈 ---------- */
.skills { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
.skills__group h3 { margin: 0 0 12px; font-size: 16px; color: var(--text); }
.tags { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.tags li {
  background: var(--accent-soft);
  color: var(--accent);
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
}
.tags--sm li { font-size: 12px; padding: 3px 10px; }

/* ---------- 项目卡片 ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 20px; }
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  transition: transform 0.2s, border-color 0.2s;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.card:hover { transform: translateY(-4px); border-color: var(--accent); }
.card__title { margin: 0; font-size: 18px; }
.card__desc { margin: 0; color: var(--text-soft); font-size: 15px; flex: 1; }
.card__links { display: flex; gap: 16px; margin-top: 4px; font-size: 14px; font-weight: 600; }

/* ---------- 时间线 ---------- */
.timeline { list-style: none; padding: 0; margin: 0; position: relative; }
.timeline::before {
  content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px;
  width: 2px; background: var(--border);
}
.timeline__item { position: relative; padding: 0 0 28px 32px; }
.timeline__item::before {
  content: ""; position: absolute; left: 0; top: 6px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--accent); border: 3px solid var(--bg);
}
.timeline__date { color: var(--text-soft); font-size: 13px; font-weight: 600; letter-spacing: 0.03em; }
.timeline__item h3 { margin: 4px 0 6px; font-size: 17px; }
.timeline__item p { margin: 0; color: var(--text-soft); font-size: 15px; }

/* ---------- 联系 ---------- */
.contact { text-align: center; }
.contact p { color: var(--text-soft); }
.contact__email { display: flex; gap: 14px; justify-content: center; align-items: center; flex-wrap: wrap; margin-top: 18px; }
.contact__email a { font-size: 18px; font-weight: 600; }

/* ---------- 页脚 ---------- */
.footer { border-top: 1px solid var(--border); padding: 28px 0; text-align: center; color: var(--text-soft); font-size: 14px; }

/* ---------- 响应式 ---------- */
@media (max-width: 640px) {
  .nav__links { display: none; }
  .skills { grid-template-columns: 1fr; }
  .hero { padding: 72px 24px 56px; }
  .section { padding: 48px 0; }
}
