/* 笔记页样式：版式参考 StartBootstrap Clean Blog (MIT)，改写为无依赖实现 */
:root {
  --bg: #fbfaf8;
  --text: #1f2124;
  --muted: #7d7f84;
  --line: #e5e1da;
  --accent: #1f4e79;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Songti SC",
    "Noto Serif CJK SC", "Source Han Serif SC", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.75 var(--sans);
  -webkit-font-smoothing: antialiased;
}

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

/* ---------- 报头 ---------- */
.masthead {
  padding: clamp(48px, 9vw, 92px) 20px clamp(34px, 5vw, 52px);
  text-align: center;
  border-bottom: 1px solid var(--line);
}
.masthead-inner { max-width: 720px; margin: 0 auto; }

.avatar-link {
  display: inline-flex;
  width: 84px; height: 84px;
  border-radius: 50%;
  overflow: hidden;
  background: #eceae5;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
}
.avatar-link img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-fallback { display: none; font-family: var(--serif); font-size: 34px; color: #9b968c; }
.avatar-link.is-fallback img { display: none; }
.avatar-link.is-fallback .avatar-fallback { display: block; }

.site-title {
  margin: 20px 0 6px;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(30px, 5vw, 42px);
  letter-spacing: 0.01em;
}
.site-sub {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.masthead-nav {
  margin-top: 22px;
  display: flex;
  gap: 22px;
  justify-content: center;
  font-size: 14px;
  color: var(--muted);
}
.masthead-nav a { padding-bottom: 2px; border-bottom: 1px solid transparent; }
.masthead-nav a:hover { color: var(--text); }
.masthead-nav a.active { color: var(--text); border-bottom-color: var(--text); }

/* ---------- 容器 ---------- */
.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 20px 72px;
}

/* ---------- 工具条 ---------- */
.list-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 26px 0 8px;
  border-bottom: 1px solid var(--line);
}
.search {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 200px;
  border-bottom: 1px solid var(--line);
  padding: 4px 0;
}
.search svg {
  width: 16px; height: 16px; flex: none;
  fill: none; stroke: #a8a49c; stroke-width: 2; stroke-linecap: round;
}
.search input {
  flex: 1; min-width: 0;
  border: 0; background: none; outline: none;
  font: inherit; font-size: 15px; color: var(--text);
  padding: 4px 0;
}
.search input::placeholder { color: #b4b0a8; }
.tagbar { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.tagbar::-webkit-scrollbar { display: none; }
.tagbar button {
  flex: none;
  padding: 3px 10px;
  font: inherit; font-size: 13px;
  color: var(--muted);
  background: none;
  border: 1px solid var(--line);
  border-radius: 3px;
  cursor: pointer;
}
.tagbar button:hover { color: var(--text); border-color: #cfc9bf; }
.tagbar button.active { color: #fff; background: var(--text); border-color: var(--text); }
.count { margin: 0 0 0 auto; font-size: 13px; color: var(--muted); }
.count strong { color: var(--text); font-weight: 600; }
.count span { display: none; }

.list-tools.is-empty { display: none; }

/* ---------- 列表（Clean Blog 风格：无边框，靠留白分隔） ---------- */
.post-list { display: block; }
.post-list .card {
  display: block;
  width: 100%;
  text-align: left;
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 34px 0;
  cursor: pointer;
  transition: opacity 0.2s;
}
.post-list .card:hover h2 { color: var(--accent); }
.card-date {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.post-list .card h2 {
  margin: 0 0 8px;
  font-family: var(--serif);
  font-size: clamp(24px, 3.6vw, 32px);
  font-weight: 600;
  line-height: 1.35;
  transition: color 0.2s;
}
.post-list .card p {
  margin: 0;
  color: #5c5f66;
  font-size: 16px;
  line-height: 1.7;
}
.card-tags { margin-top: 10px; display: flex; gap: 8px; flex-wrap: wrap; }
.card-tags i {
  font-style: normal;
  font-size: 12px;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  padding-bottom: 1px;
}

/* ---------- 阅读页 ---------- */
.reader { display: none; }
body[data-view="post"] .list-tools,
body[data-view="post"] .post-list { display: none; }
body[data-view="post"] .reader { display: block; }

.back {
  display: inline-block;
  margin: 28px 0 0;
  padding: 0;
  font: inherit;
  font-size: 14px;
  color: var(--muted);
  background: none;
  border: 0;
  cursor: pointer;
}
.back:hover { color: var(--text); }

.post-head {
  padding: 26px 0 28px;
  border-bottom: 1px solid var(--line);
}
.post-date {
  margin: 0 0 10px;
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.post-head h1 {
  margin: 0 0 12px;
  font-family: var(--serif);
  font-size: clamp(28px, 4.6vw, 42px);
  font-weight: 600;
  line-height: 1.28;
}
.post-summary {
  margin: 0 0 14px;
  color: #5c5f66;
  font-size: 17px;
}
.post-tags { display: flex; gap: 8px; flex-wrap: wrap; }
.post-tags span { font-size: 13px; color: var(--muted); border-bottom: 1px solid var(--line); }

.post-body {
  padding-top: 30px;
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.9;
  color: #24262a;
}
.post-body h2, .post-body h3, .post-body h4 {
  margin: 1.8em 0 0.6em;
  font-weight: 600;
  line-height: 1.4;
}
.post-body h2 { font-size: 26px; }
.post-body h3 { font-size: 22px; }
.post-body h4 { font-size: 19px; }
.post-body p { margin: 0 0 1.2em; }
.post-body a { color: var(--accent); border-bottom: 1px solid rgba(31, 78, 121, 0.3); }
.post-body ul { margin: 0 0 1.2em; padding-left: 1.3em; }
.post-body li { margin: 0.3em 0; }
.post-body blockquote {
  margin: 1.6em 0;
  padding-left: 18px;
  border-left: 3px solid var(--line);
  color: #55585e;
  font-style: italic;
}
.post-body code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.85em;
  background: #f1eee8;
  padding: 2px 6px;
  border-radius: 3px;
}
.post-body pre {
  margin: 1.6em 0;
  padding: 18px 20px;
  overflow-x: auto;
  background: #f3f0ea;
  border-radius: 4px;
  line-height: 1.6;
}
.post-body pre code { background: none; padding: 0; font-size: 14px; }

/* ---------- 空状态 ---------- */
.empty {
  padding: 64px 20px;
  text-align: center;
  color: var(--muted);
  font-family: var(--serif);
  font-size: 17px;
}

/* ---------- 页脚 ---------- */
.foot {
  border-top: 1px solid var(--line);
  padding: 26px 20px 40px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}
.foot p { margin: 4px 0; }
.foot a:hover { color: var(--text); }

@media (max-width: 520px) {
  .masthead-nav { gap: 16px; font-size: 13px; }
  .post-body { font-size: 17px; }
}
