:root {
  --bg: #fbfaf8;
  --fg: #24211d;
  --muted: #6b6660;
  --line: #e6e2db;
  --card: #ffffff;
  --accent: #b4552d;
  --hero-h: 400px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1c1c1e;
    --fg: #e8e6e3;
    --muted: #9a958f;
    --line: #2e2e31;
    --card: #242426;
    --accent: #e0a06a;
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, "Segoe UI", "Microsoft YaHei UI", "PingFang SC", "Hiragino Sans GB", sans-serif;
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

/* ============================================================
   头图区域
   - 背景图 + 兜底渐变（图没加载出来也能看）
   - 底部渐隐到主题背景色，滚动时自然过渡
   ============================================================ */
.hero {
  position: relative;
  min-height: var(--hero-h);
  display: flex;
  align-items: flex-end;
  padding: 0 24px 88px;

  background-image:
    url("assets/hero.jpg"),
    linear-gradient(135deg, #2a2a2f 0%, #3a3236 55%, #4a3a32 100%);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* 上层遮罩：顶部压暗保证文字可读，底部融化为主题背景色 */
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.42) 0%,
    rgba(0, 0, 0, 0.18) 45%,
    rgba(0, 0, 0, 0.05) 70%,
    var(--bg) 100%
  );
}

.hero-inner {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
}

.hero h1 {
  margin: 0;
  font-size: 2.4rem;
  font-weight: 650;
  letter-spacing: 0.02em;
}

.hero .tagline {
  margin: 0.5em 0 0;
  color: rgba(255, 255, 255, 0.88);
}

/* ---------- 正文容器 ---------- */
main {
  max-width: 720px;
  margin: 0 auto;
  padding: 8px 24px 96px;
}

section { margin-top: 56px; }

h2 {
  margin: 0 0 20px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- 项目卡片 ---------- */
.cards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 14px;
}

.card {
  display: block;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  color: inherit;
  text-decoration: none;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.card:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.card h3 {
  margin: 0 0 6px;
  font-size: 1.05rem;
  font-weight: 600;
}

.card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.94rem;
}

.badge {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--muted);
  vertical-align: middle;
}

.badge.muted { opacity: 0.65; }

/* ---------- 链接 ---------- */
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

.links { margin-top: 12px; }

/* ---------- 页脚 ---------- */
footer {
  margin-top: 80px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.85rem;
}

footer p { margin: 0; }

/* ---------- 移动端 ---------- */
@media (max-width: 520px) {
  :root { --hero-h: 300px; }
  .hero { padding: 0 18px 64px; }
  .hero h1 { font-size: 1.8rem; }
  main { padding: 4px 18px 72px; }
  section { margin-top: 42px; }
}
