/* 基础与变量 */
:root {
  --bg: #fafaf9;
  --surface: #ffffff;
  --text: #1c1917;
  --text-muted: #57534e;
  --text-light: #a8a29e;
  --border: #e7e5e4;
  --accent: #b45309;
  --accent-hover: #92400e;
  --radius: 10px;
  --max-width: 720px;
}

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

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

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

a { color: inherit; text-decoration: none; }

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

/* 页头 */
.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.site-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--accent);
}

.site-nav { display: flex; gap: 28px; }

.site-nav a {
  font-size: 15px;
  color: var(--text-muted);
  padding: 4px 0;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}

.site-nav a:hover { color: var(--text); }

.site-nav a.is-active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* 主体 */
.site-main { min-height: 60vh; padding-top: 48px; padding-bottom: 72px; }

.hero { margin-bottom: 56px; }

.hero h1 {
  font-size: 34px;
  line-height: 1.3;
  margin: 0 0 14px;
  letter-spacing: -0.02em;
}

.hero p { margin: 0; color: var(--text-muted); font-size: 17px; }

/* 文章列表 */
.post-list { display: flex; flex-direction: column; gap: 16px; }

.post-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 32px;
  transition: border-color 0.15s, transform 0.15s;
}

.post-card:hover { border-color: #d6d3d1; transform: translateY(-2px); }

.post-meta { font-size: 13px; color: var(--text-light); }

.post-title {
  font-size: 22px;
  line-height: 1.4;
  margin: 8px 0 10px;
  letter-spacing: -0.01em;
}

.post-title a:hover { color: var(--accent); }

.post-excerpt {
  margin: 0 0 18px;
  color: var(--text-muted);
  font-size: 15px;
}

.read-more {
  font-size: 14px;
  color: var(--accent);
  font-weight: 500;
}

.read-more:hover { color: var(--accent-hover); }
.read-more span { display: inline-block; transition: transform 0.15s; }
.read-more:hover span { transform: translateX(3px); }

/* 文章详情 */
.post-detail-header {
  padding-bottom: 28px;
  margin-bottom: 36px;
  border-bottom: 1px solid var(--border);
}

.post-detail-header h1 {
  font-size: 32px;
  line-height: 1.35;
  margin: 0 0 12px;
  letter-spacing: -0.02em;
}

.back-link {
  display: inline-block;
  margin-bottom: 28px;
  font-size: 14px;
  color: var(--text-muted);
}

.back-link:hover { color: var(--accent); }

.post-body { font-size: 16px; }

.post-body p { margin: 0 0 22px; }

.post-body h2 {
  font-size: 21px;
  margin: 40px 0 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.post-body ul, .post-body ol { padding-left: 26px; margin: 0 0 22px; }
.post-body li { margin-bottom: 8px; }

.post-body blockquote {
  margin: 28px 0;
  padding: 4px 0 4px 22px;
  border-left: 3px solid var(--accent);
  color: var(--text-muted);
  font-style: italic;
}

.post-body blockquote p { margin: 0; }

.post-body code {
  background: #f5f5f4;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
}

.post-body pre {
  background: #f5f5f4;
  padding: 18px 20px;
  border-radius: var(--radius);
  overflow-x: auto;
  margin: 0 0 22px;
}

.post-body pre code { background: none; padding: 0; }

/* 关于 / 404 / 加载与错误态 */
.about h1, .not-found h1, .state-view h1 { font-size: 30px; margin: 0 0 24px; }
.about p, .not-found p, .state-view p { color: var(--text-muted); margin: 0 0 18px; }
.not-found .read-more { display: inline-block; margin-top: 12px; }

.state-view { padding: 40px 0; }
.state-view .state-hint { font-size: 14px; color: var(--text-light); }
.state-view code { background: #f5f5f4; padding: 2px 6px; border-radius: 4px; font-size: 0.9em; }
.md-fallback { white-space: pre-wrap; font-family: inherit; line-height: 1.75; }

.retry-button {
  margin-top: 8px;
  padding: 8px 20px;
  font: inherit;
  font-size: 14px;
  color: #fff;
  background: var(--accent);
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

.retry-button:hover { background: var(--accent-hover); }
.retry-button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* 页脚 */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 32px 0;
  text-align: center;
}

.site-footer p { margin: 0; font-size: 13px; color: var(--text-light); }

/* 移动端 */
@media (max-width: 600px) {
  .container { padding: 0 20px; }
  .site-main { padding-top: 36px; }
  .hero h1 { font-size: 28px; }
  .hero p { font-size: 16px; }
  .post-card { padding: 22px; }
  .post-title { font-size: 20px; }
  .post-detail-header h1 { font-size: 26px; }
}
