/* ==========================================================================
   拾光笔记 · 极简博客样式
   纯前端静态站点，无框架、无外部依赖，移动端优先
   ========================================================================== */

:root {
  --bg: #fbfbfa;
  --surface: #ffffff;
  --text: #1f2328;
  --text-soft: #6b7280;
  --accent: #2563eb;
  --accent-soft: #eff4ff;
  --border: #e6e8eb;
  --radius: 10px;
  --container: 44rem;
  --font: system-ui, -apple-system, "Segoe UI", "PingFang SC",
           "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; }

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

/* ---------- 顶部导航 ---------- */

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

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

.site-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  letter-spacing: 0.02em;
}

.site-name:hover { color: var(--accent); }

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

.site-nav a {
  color: var(--text-soft);
  text-decoration: none;
  font-size: 14px;
  padding: 6px 12px;
  border-radius: 8px;
  transition: background 0.15s ease, color 0.15s ease;
}

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

.site-nav a.active {
  color: var(--accent);
  background: var(--accent-soft);
  font-weight: 600;
}

/* ---------- 首页：页眉与文章列表 ---------- */

.hero { padding: 56px 0 8px; }

.hero h1 {
  margin: 0 0 12px;
  font-size: clamp(26px, 5vw, 34px);
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.hero p {
  margin: 0;
  color: var(--text-soft);
  font-size: 15px;
  max-width: 34rem;
}

.list-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 44px 0 6px;
}

.list-head h2 { margin: 0; font-size: 16px; letter-spacing: 0.04em; }

.list-head .count { color: var(--text-soft); font-size: 13px; }

.post-list { list-style: none; margin: 0; padding: 0; }

.post-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin: 14px 0;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.post-card:hover {
  border-color: #c9cdd3;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
}

.post-card h3 { margin: 0 0 6px; font-size: 19px; line-height: 1.4; }

.post-card h3 a {
  color: var(--text);
  text-decoration: none;
}

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

.post-meta {
  margin: 0 0 8px;
  color: var(--text-soft);
  font-size: 13px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.tag {
  display: inline-block;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  line-height: 1;
  padding: 4px 8px;
  border-radius: 999px;
}

.post-excerpt {
  margin: 0;
  color: var(--text-soft);
  font-size: 14px;
}

/* ---------- 文章详情页 ---------- */

.post {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-top: 28px;
  padding: clamp(24px, 5vw, 44px);
}

.post-header { margin-bottom: 28px; padding-bottom: 20px; border-bottom: 1px solid var(--border); }

.post-header h1 { margin: 0 0 12px; font-size: clamp(24px, 4.5vw, 30px); line-height: 1.35; }

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

.post-body h2 { font-size: 22px; margin: 36px 0 14px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }

.post-body h3 { font-size: 18px; margin: 28px 0 10px; }

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

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

.post-body ul, .post-body ol { padding-left: 24px; margin: 14px 0; }

.post-body li { margin: 6px 0; }

.post-body blockquote {
  margin: 18px 0;
  padding: 10px 18px;
  border-left: 3px solid var(--accent);
  background: #f8fafc;
  color: var(--text-soft);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.post-body code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace;
  font-size: 0.9em;
  background: #f3f4f6;
  padding: 2px 6px;
  border-radius: 5px;
}

.post-body pre {
  background: #1f2328;
  color: #e5e7eb;
  padding: 16px 18px;
  border-radius: var(--radius);
  overflow-x: auto;
  line-height: 1.6;
  margin: 18px 0;
}

.post-body pre code { background: none; color: inherit; padding: 0; font-size: 13.5px; }

.post-body hr { border: none; border-top: 1px solid var(--border); margin: 32px 0; }

.post-nav { margin-top: 28px; }

.post-nav a {
  color: var(--accent);
  text-decoration: none;
  font-size: 14px;
}

.post-nav a:hover { text-decoration: underline; }

/* ---------- 关于页 ---------- */

.page { margin-top: 28px; }

.page-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: clamp(24px, 5vw, 44px);
}

.page-card h1 { margin: 0 0 20px; font-size: clamp(24px, 4.5vw, 30px); }

/* ---------- 404 ---------- */

.notfound { text-align: center; padding: 90px 20px; }

.notfound .code { font-size: 64px; font-weight: 700; color: #d1d5db; margin: 0; line-height: 1; }

.notfound h1 { margin: 16px 0 10px; font-size: 24px; }

.notfound p { color: var(--text-soft); margin: 0 0 24px; }

.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  padding: 9px 18px;
  border-radius: 8px;
  font-size: 14px;
}

.btn:hover { background: #1d4ed8; }

/* ---------- 页脚 ---------- */

.site-footer {
  margin-top: 56px;
  padding: 28px 0 40px;
  border-top: 1px solid var(--border);
  color: var(--text-soft);
  font-size: 13px;
}

.site-footer p { margin: 0; }

/* ---------- 响应式：小屏 ---------- */

@media (max-width: 560px) {
  body { font-size: 15px; }
  .container { padding: 0 16px; }
  .hero { padding-top: 40px; }
  .post-card { padding: 18px 18px; }
  .post-card h3 { font-size: 17px; }
  .site-footer { margin-top: 40px; }
}

/* ---------- 建设中提示横幅 ---------- */

.build-banner {
  background: #fff8e6;
  border-bottom: 1px solid #f0dfae;
  color: #8a6d1a;
  font-size: 13px;
}

.build-banner .container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding-top: 6px;
  padding-bottom: 6px;
  text-align: center;
}

.build-banner .badge {
  flex-shrink: 0;
  background: #f2c14e;
  color: #5b4307;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  padding: 4px 7px;
  border-radius: 4px;
  letter-spacing: 0.04em;
}

@media (max-width: 560px) {
  .build-banner .container { font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
