:root {
  --bg: #f3f6f4;
  --bg-alt: #eaefec;
  --surface: rgba(255, 255, 255, 0.8);
  --surface-solid: #ffffff;
  --text: #111a15;
  --muted: #5b6b62;
  --border: #e1e7e3;
  --border-strong: #cdd7d1;
  --input: #eef2f0;
  --primary: #2b8552;
  --primary-hover: #24724a;
  --primary-soft: #e3f1e8;
  --primary-ring: rgba(83, 189, 129, 0.4);
  --primary-shadow: rgba(63, 165, 107, 0.8);
  --grid-line: rgba(43, 133, 82, 0.06);
  --terminal: #0d120f;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", "Noto Sans CJK SC", "Source Han Sans SC", sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
  --radius: 16px;
  --radius-sm: 8px;
}

[data-theme="dark"] {
  --bg: #0e1411;
  --bg-alt: #121a16;
  --surface: rgba(24, 33, 28, 0.8);
  --surface-solid: #18211c;
  --text: #e6eee9;
  --muted: #94a59b;
  --border: #243029;
  --border-strong: #2f3d35;
  --input: #1c2620;
  --primary: #3fa56b;
  --primary-hover: #53bd81;
  --primary-soft: rgba(63, 165, 107, 0.15);
  --grid-line: rgba(83, 189, 129, 0.05);
  --terminal: #070a08;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.2s, color 0.2s;
}

a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }

.container { width: min(1120px, 100% - 48px); margin: 0 auto; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.center { text-align: center; }
.link { color: var(--primary); font-weight: 500; }
.link:hover { text-decoration: underline; }

/* 顶栏 */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in oklab, var(--bg) 80%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.brand-logo {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: #fff;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 6px 16px -6px var(--primary-shadow);
}
.nav { display: flex; gap: 32px; }
.nav a { color: var(--muted); font-size: 14px; transition: color 0.15s; }
.nav a:hover { color: var(--text); }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.icon-btn {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.icon-btn:hover { background: var(--input); color: var(--text); }

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 20px;
  border-radius: var(--radius-sm);
  font: 500 15px var(--font);
  cursor: pointer;
  transition: background-color 0.15s, transform 0.15s;
}
.btn:active { transform: translateY(1px); }
.btn-sm { height: 34px; padding: 0 14px; font-size: 14px; }
.btn-primary {
  border: 0;
  background: var(--primary);
  color: #fff;
  box-shadow: 0 0 0 1px var(--primary-ring), 0 8px 24px -12px var(--primary-shadow);
}
.btn-primary:hover { background: var(--primary-hover); }
.btn-ghost {
  border: 1px solid var(--border-strong);
  background: var(--surface-solid);
  color: var(--text);
}
.btn-ghost:hover { background: var(--input); }

/* 首屏 */
.hero {
  position: relative;
  overflow: hidden;
  padding: 96px 0 104px;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 40px 40px;
}
.hero-glow {
  position: absolute;
  top: -160px;
  left: 50%;
  width: 900px;
  height: 420px;
  transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(63, 165, 107, 0.18), transparent);
  pointer-events: none;
}
.hero-inner { position: relative; display: grid; grid-template-columns: 1.05fr 1fr; gap: 48px; align-items: center; }
.eyebrow { font-family: var(--mono); font-size: 12px; letter-spacing: 0.2em; color: var(--primary); font-weight: 600; }
.hero h1 { margin-top: 14px; font-size: 44px; line-height: 1.2; font-weight: 700; letter-spacing: -0.01em; }
.hero-sub { margin-top: 12px; font-size: 24px; line-height: 1.45; color: var(--muted); }
.hero-desc { margin-top: 24px; max-width: 520px; color: var(--muted); }
.hero-cta { display: flex; gap: 12px; margin-top: 32px; }

.terminal {
  border-radius: var(--radius);
  background: var(--terminal);
  box-shadow: 0 30px 80px -30px rgba(43, 133, 82, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.04);
  overflow: hidden;
}
.terminal-bar { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid rgba(255, 255, 255, 0.06); }
.dot { width: 12px; height: 12px; border-radius: 50%; }
.dot-red { background: #ff5f57; }
.dot-yellow { background: #febc2e; }
.dot-green { background: #28c840; }
.terminal-title { margin-left: 10px; font-family: var(--mono); font-size: 12px; color: #8a978f; }
.terminal-body {
  margin: 0;
  min-height: 300px;
  padding: 20px;
  font: 13px/1.8 var(--mono);
  color: #d5e2da;
  white-space: pre-wrap;
}
.terminal-body .prompt { color: #53bd81; }
.terminal-body .key { color: #8fd3a8; }
.cursor { display: inline-block; width: 8px; height: 16px; vertical-align: -3px; background: #53bd81; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* 技能条 */
.strip { background: var(--bg-alt); border-block: 1px solid var(--border); padding: 40px 0; }
.strip-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px; }
.strip-icon { width: 20px; height: 20px; color: var(--primary); }
.strip-item h3 { margin-top: 12px; font-size: 15px; font-weight: 600; }
.strip-item p { margin-top: 6px; font-size: 13px; color: var(--muted); }

/* 通用区块 */
.section { padding: 96px 0; }
.section-alt { background: var(--bg-alt); border-block: 1px solid var(--border); }
.kicker { font-size: 13px; font-weight: 600; color: var(--primary); }
.section-title { margin-top: 8px; font-size: 30px; font-weight: 700; line-height: 1.3; }

/* 项目卡片 */
/* 一排三张，最后一排不满时居中 */
.card-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 20px; margin-top: 40px; }
.card-grid > .card { flex: 0 0 calc((100% - 40px) / 3); }
.card {
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.card:hover { transform: translateY(-3px); border-color: var(--border-strong); box-shadow: 0 16px 40px -24px rgba(43, 133, 82, 0.5); }
.card-head { display: flex; justify-content: space-between; align-items: center; }
.card-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--primary-soft);
  color: var(--primary);
  border: 1px solid var(--border);
}
.card-icon svg { width: 20px; height: 20px; }
.card-num { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.card h3 { margin-top: 20px; font-size: 17px; font-weight: 600; }
.card p { margin-top: 8px; font-size: 14px; color: var(--muted); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.tags span, .badge {
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--primary-ring);
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 12px;
}

/* 时间线 */
.timeline { list-style: none; margin: 40px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.timeline-item { padding: 24px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.timeline-meta { display: flex; align-items: center; gap: 10px; }
.timeline-item h3 { margin-top: 10px; font-size: 16px; font-weight: 600; }
.timeline-item p { margin-top: 4px; font-size: 14px; color: var(--muted); }

/* 联系 */
.contact-card {
  padding: 56px 32px;
  text-align: center;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: radial-gradient(ellipse at top, var(--primary-soft), transparent 70%), var(--surface);
}
.contact-card h2 { font-size: 28px; font-weight: 700; }
.contact-card .muted { margin-top: 8px; }
.contact-actions { display: flex; justify-content: center; gap: 12px; margin-top: 28px; }

/* 页脚 */
.footer { border-top: 1px solid var(--border); padding: 28px 0; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; }

/* 响应式 */
@media (max-width: 1100px) {
  .card-grid > .card { flex-basis: calc((100% - 20px) / 2); }
}
@media (max-width: 900px) {
  .nav { display: none; }
  .hero { padding: 64px 0; }
  .hero-inner { grid-template-columns: 1fr; }
  .hero h1 { font-size: 34px; }
  .hero-sub { font-size: 20px; }
  .strip-grid { grid-template-columns: repeat(2, 1fr); }
  .card-grid > .card { flex-basis: 100%; }
  .timeline { grid-template-columns: 1fr; }
  .section { padding: 64px 0; }
}
@media (max-width: 520px) {
  .strip-grid { grid-template-columns: 1fr; }
  .footer-inner { flex-direction: column; gap: 12px; }
}
