/* ===== 基础变量（浅色主题） ===== */
:root {
  --bg: #ffffff;
  --bg-soft: #f6f7f9;
  --text: #1a1d21;
  --text-muted: #6b7280;
  --accent: #2563eb;
  --border: #e5e7eb;
  --card: #ffffff;
}

/* ===== 深色主题 ===== */
[data-theme="dark"] {
  --bg: #101418;
  --bg-soft: #1a2028;
  --text: #e6e9ec;
  --text-muted: #9aa3ad;
  --accent: #60a5fa;
  --border: #2a323c;
  --card: #1a2028;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.75;
  transition: background 0.3s, color 0.3s;
}

.container { max-width: 760px; margin: 0 auto; padding: 0 20px; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===== 头部 ===== */
.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky; top: 0; z-index: 10;
}
.header-inner {
  display: flex; justify-content: space-between; align-items: center;
  height: 60px;
}
.logo { font-weight: 700; font-size: 1.15rem; color: var(--text); }
nav { display: flex; align-items: center; gap: 20px; }
nav a { color: var(--text-muted); font-size: 0.95rem; }
nav a:hover { color: var(--text); text-decoration: none; }
#theme-toggle {
  background: none; border: 1px solid var(--border); border-radius: 8px;
  padding: 4px 8px; cursor: pointer; font-size: 0.95rem;
}

/* ===== 首页 Hero ===== */
.hero { padding: 56px 0 32px; }
.hero h1 { font-size: 2rem; margin-bottom: 8px; }
.hero .accent { color: var(--accent); }
.hero p { color: var(--text-muted); }

/* ===== 文章列表 ===== */
.post-list h2 { font-size: 1.25rem; margin: 24px 0 16px; }
.post-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 16px;
  transition: transform 0.15s, box-shadow 0.15s;
}
.post-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0,0,0,0.08);
}
.post-card a { display: block; padding: 20px 24px; color: inherit; }
.post-card a:hover { text-decoration: none; }
.post-card h3 { margin-bottom: 4px; color: var(--text); }
.post-card time { color: var(--text-muted); font-size: 0.85rem; }
.post-card p { color: var(--text-muted); margin-top: 8px; font-size: 0.95rem; }

/* ===== 文章页 ===== */
.post, .page { padding: 40px 0 64px; }
.post h1, .page h1 { font-size: 1.8rem; margin-bottom: 8px; }
.post > time, .page > time { color: var(--text-muted); font-size: 0.9rem; display: block; margin-bottom: 32px; }
.post h2, .page h2 { font-size: 1.3rem; margin: 32px 0 12px; }
.post p, .page p { margin-bottom: 16px; }
.post ul, .post ol, .page ul, .page ol { margin: 0 0 16px 24px; }
.post li, .page li { margin-bottom: 6px; }
code {
  background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: 4px; padding: 1px 6px; font-size: 0.88em;
}
pre {
  background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: 10px; padding: 16px; overflow-x: auto; margin-bottom: 20px;
}
pre code { background: none; border: none; padding: 0; }

/* ===== 页脚 ===== */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 24px 0; margin-top: 40px;
  color: var(--text-muted); font-size: 0.9rem; text-align: center;
}

/* ===== 移动端适配 ===== */
@media (max-width: 600px) {
  .hero h1 { font-size: 1.5rem; }
  .post h1, .page h1 { font-size: 1.4rem; }
}
