/* =============================
   CSS 变量 & 全局重置
   ============================= */
:root {
  --color-bg:        #ffffff;
  --color-surface:   #f7f7f5;
  --color-border:    #e8e8e4;
  --color-text:      #1a1a1a;
  --color-muted:     #6b6b6b;
  --color-accent:    #2d6be4;
  --color-accent-h:  #1a54cc;

  --font-sans: "Inter", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", "Fira Code", monospace;

  --radius:    8px;
  --radius-lg: 16px;
  --shadow:    0 1px 4px rgba(0,0,0,.06), 0 4px 16px rgba(0,0,0,.06);
  --shadow-lg: 0 8px 32px rgba(0,0,0,.10);

  --nav-height: 60px;
  --max-width:  1100px;
  --gap:        24px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

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

img { max-width: 100%; display: block; }

/* =============================
   导航栏（由 nav.js 注入）
   ============================= */
#site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-height);
  background: rgba(255,255,255,.90);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--gap);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--color-text);
  letter-spacing: -.02em;
}
.nav-logo:hover { color: var(--color-accent); }

.nav-links {
  display: flex;
  gap: 4px;
  list-style: none;
}

.nav-links a {
  padding: 6px 12px;
  border-radius: var(--radius);
  font-size: .9rem;
  color: var(--color-muted);
  transition: background .15s, color .15s;
}
.nav-links a:hover,
.nav-links a.active {
  background: var(--color-surface);
  color: var(--color-text);
}

/* 汉堡菜单（移动端） */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: var(--color-text);
}

/* =============================
   页面主体容器
   ============================= */
.page-wrapper {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 48px var(--gap) 80px;
}

/* =============================
   Hero 区块
   ============================= */
.hero {
  text-align: center;
  padding: 80px 0 64px;
}
.hero-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 20px;
  border: 3px solid var(--color-border);
}
.hero h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  letter-spacing: -.03em;
  line-height: 1.2;
}
.hero p {
  margin-top: 14px;
  font-size: 1.1rem;
  color: var(--color-muted);
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
}

/* =============================
   板块卡片网格
   ============================= */
.section-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--gap);
  margin-top: 48px;
}

.section-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 28px;
  transition: box-shadow .2s, transform .2s;
  cursor: pointer;
  display: block;
  color: var(--color-text);
}
.section-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
  color: var(--color-text);
}

.section-card .icon {
  font-size: 2rem;
  margin-bottom: 12px;
}
.section-card h2 {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 8px;
}
.section-card p {
  font-size: .9rem;
  color: var(--color-muted);
  line-height: 1.6;
}

/* =============================
   文章列表
   ============================= */
.post-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.post-list li a {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 16px 20px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  color: var(--color-text);
  transition: box-shadow .15s;
}
.post-list li a:hover { box-shadow: var(--shadow); }
.post-list .post-title { font-size: .95rem; }
.post-list .post-date  { font-size: .8rem; color: var(--color-muted); white-space: nowrap; margin-left: 16px; }

/* =============================
   页脚
   ============================= */
footer {
  text-align: center;
  padding: 32px var(--gap);
  font-size: .85rem;
  color: var(--color-muted);
  border-top: 1px solid var(--color-border);
}

/* =============================
   响应式
   ============================= */
@media (max-width: 640px) {
  .nav-links { display: none; flex-direction: column; position: absolute; top: var(--nav-height); left: 0; right: 0; background: var(--color-bg); border-bottom: 1px solid var(--color-border); padding: 12px; }
  .nav-links.open { display: flex; }
  .nav-toggle { display: block; }
  .hero { padding: 48px 0 40px; }
  .section-grid { grid-template-columns: 1fr; }
}
