:root {
  --bg: #f7f8fa;
  --card: #ffffff;
  --text: #1f2329;
  --muted: #8a8f99;
  --accent: #ff8a3d;
  --accent-2: #ffd166;
  --border: #ececf0;
  --code-bg: #f2f3f5;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.site-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px; background: var(--card); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
}
.brand { font-weight: 700; font-size: 18px; color: var(--text); }
.brand:hover { text-decoration: none; }
.site-header nav a { margin-left: 16px; color: var(--muted); font-size: 14px; }
.site-header nav a:hover { color: var(--accent); text-decoration: none; }

.container { max-width: 760px; margin: 0 auto; padding: 28px 20px 60px; }
.site-footer { text-align: center; color: var(--muted); font-size: 13px; padding: 30px 20px 50px; }

h1 { font-size: 26px; margin: 0 0 20px; }
h2 { font-size: 20px; }

.cards { display: flex; flex-direction: column; gap: 16px; }
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: 14px;
  padding: 18px 20px; transition: box-shadow .15s;
}
.card:hover { box-shadow: 0 6px 20px rgba(0,0,0,.06); }
.card-title { margin: 0 0 8px; font-size: 20px; }
.card-title a { color: var(--text); }
.card-title a:hover { color: var(--accent); text-decoration: none; }
.meta { color: var(--muted); font-size: 13px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.excerpt { color: #4a4f57; margin: 10px 0 0; font-size: 15px; }
.empty { color: var(--muted); }

.tag {
  display: inline-block; background: #fff3e9; color: var(--accent);
  border-radius: 999px; padding: 2px 10px; font-size: 12px; margin-right: 4px;
}
.tag:hover { text-decoration: none; background: #ffe6d2; }

.post .meta { margin-bottom: 18px; }
.markdown-body { font-size: 16px; }
.markdown-body h1, .markdown-body h2, .markdown-body h3 { margin: 1.4em 0 .6em; }
.markdown-body p { margin: .8em 0; }
.markdown-body pre {
  background: var(--code-bg); padding: 14px 16px; border-radius: 10px;
  overflow: auto; font-size: 14px;
}
.markdown-body code { background: var(--code-bg); padding: 2px 6px; border-radius: 5px; font-size: 14px; }
.markdown-body pre code { background: none; padding: 0; }
.markdown-body blockquote {
  margin: 1em 0; padding: 6px 16px; border-left: 4px solid var(--accent-2);
  color: #5a5f66; background: #fffaf0; border-radius: 0 8px 8px 0;
}
.markdown-body img { max-width: 100%; border-radius: 10px; }
.markdown-body hr { border: none; border-top: 1px solid var(--border); margin: 1.5em 0; }

/* 登录 */
.login-form { max-width: 320px; display: flex; gap: 10px; margin-top: 16px; }
.error { color: #e5484d; }

/* 后台 */
.editor { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 18px 20px; margin-bottom: 24px; }
.inp, .ta {
  width: 100%; border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 12px; font-size: 15px; font-family: inherit; margin-bottom: 12px;
  background: #fff; color: var(--text);
}
.inp:focus, .ta:focus { outline: none; border-color: var(--accent); }
.ta { min-height: 320px; resize: vertical; line-height: 1.6; }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
button {
  border: 1px solid var(--border); background: #fff; color: var(--text);
  border-radius: 10px; padding: 9px 18px; font-size: 14px; cursor: pointer; font-family: inherit;
}
button:hover { border-color: var(--accent); }
button.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
button.primary:hover { background: #f5772a; }
.preview {
  margin-top: 14px; border: 1px dashed var(--border); border-radius: 10px;
  padding: 14px 16px; min-height: 40px; display: none;
}
.preview.show { display: block; }

.list ul { list-style: none; padding: 0; margin: 0; }
.list li {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 0; border-bottom: 1px solid var(--border); gap: 12px;
}
.list li:last-child { border-bottom: none; }
.list .li-title { font-weight: 500; }
.list .li-status { font-size: 12px; color: var(--muted); margin-left: 8px; }
.list .li-actions a, .list .li-actions button { font-size: 13px; margin-left: 10px; padding: 4px 10px; }
.list .li-actions button.danger { color: #e5484d; border-color: #f3c2c4; }
.list .li-actions button.danger:hover { background: #fdeced; }
