:root {
  --bg: #fafafa;
  --card: #ffffff;
  --text: #1a1a1a;
  --muted: #6b7280;
  --border: #e5e7eb;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
}

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

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.7;
  -webkit-font-smoothing: antialiased;
}

.container { max-width: 760px; margin: 0 auto; padding: 0 20px; }

/* 顶部导航 */
.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--card);
  position: sticky;
  top: 0;
  z-index: 10;
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.site-title { font-size: 20px; font-weight: 700; color: var(--text); text-decoration: none; }
.site-nav a { color: var(--muted); text-decoration: none; margin-left: 20px; font-size: 15px; }
.site-nav a:hover { color: var(--accent); }

/* 文章列表 */
.post-list { padding: 40px 0; display: flex; flex-direction: column; gap: 20px; }
.post-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  text-decoration: none;
  color: inherit;
  display: block;
}
.post-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08); }
.post-card .cover { width: 100%; height: 200px; object-fit: cover; display: block; background: #f0f0f0; }
.post-card .body { padding: 20px 24px; }
.post-card h2 { font-size: 20px; margin-bottom: 8px; }
.post-card .excerpt { color: var(--muted); font-size: 15px; }
.post-card .meta { color: var(--muted); font-size: 13px; margin-top: 12px; }

/* 文章详情 */
.article { background: var(--card); border-radius: var(--radius); padding: 40px; margin: 40px 0; box-shadow: var(--shadow); border: 1px solid var(--border); }
.article h1 { font-size: 32px; margin-bottom: 12px; line-height: 1.3; }
.article .meta { color: var(--muted); font-size: 14px; margin-bottom: 28px; }
.article .cover { width: 100%; border-radius: 8px; margin-bottom: 28px; }
.content { font-size: 17px; }
.content h1, .content h2, .content h3 { margin: 28px 0 14px; line-height: 1.3; }
.content p { margin: 16px 0; }
.content img { max-width: 100%; border-radius: 8px; margin: 16px 0; }
.content pre { background: #1e1e1e; color: #f8f8f2; padding: 16px; border-radius: 8px; overflow-x: auto; margin: 16px 0; }
.content code { background: #f3f4f6; padding: 2px 6px; border-radius: 4px; font-size: 0.9em; }
.content pre code { background: none; padding: 0; }
.content blockquote { border-left: 4px solid var(--accent); padding-left: 16px; color: var(--muted); margin: 16px 0; }
.content ul, .content ol { padding-left: 24px; margin: 16px 0; }
.content a { color: var(--accent); }

/* 通用 */
.empty { text-align: center; color: var(--muted); padding: 80px 0; }
.loading { text-align: center; color: var(--muted); padding: 60px 0; }
.back-link { display: inline-block; color: var(--accent); text-decoration: none; margin: 24px 0; font-size: 15px; }
.back-link:hover { text-decoration: underline; }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent); color: #fff; border: none;
  padding: 10px 18px; border-radius: 8px; font-size: 15px;
  cursor: pointer; text-decoration: none; transition: background 0.15s;
}
.btn:hover { background: var(--accent-hover); }
.btn.secondary { background: #f3f4f6; color: var(--text); }
.btn.secondary:hover { background: #e5e7eb; }
.btn.danger { background: #dc2626; }
.btn.danger:hover { background: #b91c1c; }

/* 表单 */
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.field input, .field textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: 8px; font-size: 15px; font-family: inherit; background: #fff;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--accent); }
.field textarea { resize: vertical; min-height: 300px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; line-height: 1.6; }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: #1a1a1a; color: #fff; padding: 12px 20px; border-radius: 8px; font-size: 14px; opacity: 0; transition: opacity 0.2s; pointer-events: none; z-index: 100; }
.toast.show { opacity: 1; }
