/* ═══════════════════════════════════════════════════════
   Home to 洗礼 — 博客模块
   文章卡片流 / 分类筛选 / 阅读页 / Markdown 编辑器
   ═══════════════════════════════════════════════════════ */

.blog-view { flex-direction: column; }

.blog-layout {
  flex: 1;
  width: 100%;
  max-width: 920px;
  margin: 0 auto;
  padding: clamp(20px, 4vh, 44px) clamp(16px, 4vw, 48px) 32px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

/* ── 头部 ── */
.blog-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.blog-header h2 {
  margin: 0;
  font-family: 'Playfair Display', 'Noto Sans SC', serif;
  font-size: clamp(22px, 2.6vw, 30px);
  color: var(--text-primary, #33302b);
}
.blog-header p {
  margin: 8px 0 0;
  font-size: 13.5px;
  font-weight: 300;
  letter-spacing: .05em;
  color: var(--text-secondary, #8a857c);
}
.btn-write-post {
  border: none;
  border-radius: 12px;
  padding: 10px 18px;
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: .08em;
  color: #fff;
  background: linear-gradient(135deg, #e07b6c, #c9a84c);
  cursor: pointer;
  box-shadow: 0 6px 16px -6px rgba(224, 123, 108, .6);
  transition: transform .2s, filter .2s;
  display: none;
}
.btn-write-post.visible { display: inline-block; }
.btn-write-post:hover { transform: translateY(-2px); filter: brightness(1.06); }

/* ── 分类筛选 ── */
.blog-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}
.blog-chip {
  border: 1.5px solid var(--line-color, #e3dccd);
  background: var(--bg-primary, #faf8f5);
  color: var(--text-secondary, #8a857c);
  border-radius: 999px;
  padding: 6px 15px;
  font-size: 12.5px;
  letter-spacing: .05em;
  cursor: pointer;
  transition: all .2s;
  font-family: inherit;
}
.blog-chip:hover { border-color: var(--accent-coral, #e07b6c); color: var(--accent-coral, #e07b6c); }
.blog-chip.active {
  background: var(--accent-coral, #e07b6c);
  border-color: var(--accent-coral, #e07b6c);
  color: #fff;
}

/* ── 文章卡片 ── */
.blog-list { display: flex; flex-direction: column; gap: 16px; }
.post-card {
  --cat-hue: #e07b6c;
  position: relative;
  display: flex;
  gap: 18px;
  padding: 20px 22px 20px 26px;
  border-radius: 16px;
  border: 1px solid var(--line-color, #e8e1d2);
  background: var(--bg-primary, #fffdf8);
  cursor: pointer;
  overflow: hidden;
  transition: transform .25s, box-shadow .25s, border-color .25s;
}
.post-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 5px;
  background: var(--cat-hue);
  opacity: .85;
}
.post-card:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--cat-hue) 45%, transparent);
  box-shadow: 0 12px 28px -12px color-mix(in srgb, var(--cat-hue) 40%, transparent);
}
.post-main { flex: 1; min-width: 0; }
.post-toprow {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.post-cat {
  font-size: 11px;
  letter-spacing: .1em;
  color: #fff;
  background: var(--cat-hue);
  border-radius: 999px;
  padding: 3px 11px;
}
.post-draft {
  font-size: 11px;
  letter-spacing: .1em;
  color: #8a6a2a;
  background: #f5e6bd;
  border-radius: 999px;
  padding: 3px 11px;
}
.post-date { font-size: 12px; color: var(--text-muted, #b0a898); font-family: 'Space Mono', monospace; }
.post-title {
  margin: 0 0 8px;
  font-size: 18.5px;
  font-weight: 700;
  color: var(--text-primary, #33302b);
  line-height: 1.4;
}
.post-summary {
  margin: 0 0 10px;
  font-size: 13.5px;
  font-weight: 300;
  line-height: 1.75;
  color: var(--text-secondary, #8a857c);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: var(--text-muted, #b0a898);
}
.post-meta .p-tag {
  background: var(--bg-secondary, #f2ede2);
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 11.5px;
}
.post-cover {
  align-self: center;
  font-size: 40px;
  width: 76px;
  height: 76px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 18px;
  background:
    radial-gradient(80% 100% at 20% 10%, color-mix(in srgb, var(--cat-hue) 22%, transparent), transparent 70%),
    var(--bg-secondary, #f4efe4);
}
.blog-empty {
  text-align: center;
  padding: 60px 0;
  color: var(--text-muted, #b0a898);
  font-size: 14px;
  letter-spacing: .08em;
}

/* ── 迁移提示条 ── */
.blog-migrate {
  margin-top: 18px;
  padding: 16px 18px;
  border-radius: 14px;
  border: 1.5px dashed #d9b96a;
  background: #fdf6e3;
  font-size: 13px;
  color: #7a6320;
  line-height: 1.7;
}
.blog-migrate button {
  margin-top: 10px;
  border: none;
  border-radius: 8px;
  background: #e9c46a;
  color: #5a4712;
  font-weight: 700;
  padding: 7px 14px;
  cursor: pointer;
  font-family: inherit;
}

/* ═══════════ 阅读页 ═══════════ */
.blog-back {
  align-self: flex-start;
  border: none;
  background: none;
  font-size: 13.5px;
  color: var(--text-secondary, #8a857c);
  cursor: pointer;
  padding: 4px 0;
  margin-bottom: 14px;
  font-family: inherit;
  letter-spacing: .05em;
}
.blog-back:hover { color: var(--accent-coral, #e07b6c); }

.blog-article {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  background: var(--bg-primary, #fffdf8);
  border: 1px solid var(--line-color, #e8e1d2);
  border-radius: 20px;
  padding: clamp(24px, 4vw, 44px);
}
.blog-article .a-toprow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.blog-article h1.a-title {
  margin: 0 0 10px;
  font-family: 'Playfair Display', 'Noto Sans SC', serif;
  font-size: clamp(24px, 3vw, 32px);
  line-height: 1.35;
  color: var(--text-primary, #33302b);
}
.blog-article .a-meta {
  font-size: 12.5px;
  color: var(--text-muted, #b0a898);
  padding-bottom: 18px;
  margin-bottom: 22px;
  border-bottom: 1px dashed var(--line-color, #e3dccd);
}

/* Markdown 渲染样式 */
.a-body { font-size: 15px; line-height: 1.95; color: var(--text-primary, #3c362e); word-break: break-word; }
.a-body h1, .a-body h2, .a-body h3, .a-body h4 {
  margin: 26px 0 12px;
  color: var(--text-primary, #33302b);
  line-height: 1.4;
}
.a-body h1 { font-size: 22px; }
.a-body h2 { font-size: 19px; padding-left: 12px; border-left: 4px solid var(--accent-coral, #e07b6c); }
.a-body h3 { font-size: 16.5px; }
.a-body p { margin: 12px 0; }
.a-body img { max-width: 100%; border-radius: 12px; margin: 8px 0; }
.a-body a { color: var(--accent-coral, #e07b6c); text-decoration: none; border-bottom: 1px dashed currentColor; }
.a-body blockquote {
  margin: 14px 0;
  padding: 10px 18px;
  border-left: 4px solid #c9a84c;
  background: var(--bg-secondary, #f7f2e6);
  border-radius: 0 10px 10px 0;
  color: var(--text-secondary, #7a7264);
}
.a-body code {
  font-family: 'Space Mono', monospace;
  font-size: .88em;
  background: var(--bg-secondary, #f2ede2);
  padding: 2px 7px;
  border-radius: 6px;
  color: #b0574b;
}
.a-body pre {
  background: #26232e;
  color: #e8e2f2;
  padding: 16px 18px;
  border-radius: 12px;
  overflow-x: auto;
  margin: 14px 0;
}
.a-body pre code { background: none; color: inherit; padding: 0; }
.a-body ul, .a-body ol { padding-left: 26px; margin: 12px 0; }
.a-body li { margin: 5px 0; }
.a-body hr { border: none; border-top: 1px dashed var(--line-color, #d8d0c0); margin: 24px 0; }

.blog-pager {
  width: 100%;
  max-width: 760px;
  margin: 18px auto 0;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.blog-pager button {
  flex: 1;
  border: 1px solid var(--line-color, #e3dccd);
  background: var(--bg-primary, #fffdf8);
  border-radius: 12px;
  padding: 12px 14px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-secondary, #7a7264);
  text-align: left;
  font-family: inherit;
  transition: border-color .2s, color .2s;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.blog-pager button.next { text-align: right; }
.blog-pager button:hover { border-color: var(--accent-coral, #e07b6c); color: var(--accent-coral, #e07b6c); }
.blog-pager button:disabled { opacity: .35; cursor: default; }

/* ═══════════ 编辑器 ═══════════ */
.blog-editor {
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
  background: var(--bg-primary, #fffdf8);
  border: 1px solid var(--line-color, #e8e1d2);
  border-radius: 20px;
  padding: clamp(20px, 3vw, 32px);
}
.blog-editor .ed-title {
  width: 100%;
  border: none;
  border-bottom: 2px solid var(--line-color, #e8e1d2);
  background: none;
  font-family: 'Playfair Display', 'Noto Sans SC', serif;
  font-size: 24px;
  font-weight: 700;
  padding: 6px 2px 12px;
  color: var(--text-primary, #33302b);
  outline: none;
}
.ed-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 16px 0;
}
.ed-fields select, .ed-fields input {
  border: 1.5px solid var(--line-color, #e0d8c8);
  border-radius: 10px;
  background: var(--bg-secondary, #f7f2e6);
  padding: 8px 12px;
  font-size: 13px;
  font-family: inherit;
  color: var(--text-primary, #3c362e);
  outline: none;
}
.ed-fields .ed-tags { flex: 1; min-width: 180px; }
.ed-body {
  width: 100%;
  min-height: 320px;
  box-sizing: border-box;
  border: 1.5px solid var(--line-color, #e0d8c8);
  border-radius: 14px;
  background: var(--bg-secondary, #fbf8f0);
  padding: 16px;
  font-size: 14px;
  line-height: 1.8;
  font-family: 'Noto Sans SC', monospace;
  color: var(--text-primary, #3c362e);
  resize: vertical;
  outline: none;
}
.ed-preview {
  border: 1.5px dashed var(--line-color, #d8d0c0);
  border-radius: 14px;
  padding: 18px;
  min-height: 320px;
  margin-top: 0;
}
.ed-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
}
.ed-toolbar .ed-left, .ed-toolbar .ed-right { display: flex; gap: 10px; }
.ed-btn {
  border: 1.5px solid var(--line-color, #e0d8c8);
  background: var(--bg-primary, #fffdf8);
  border-radius: 10px;
  padding: 9px 16px;
  font-size: 13px;
  cursor: pointer;
  color: var(--text-secondary, #7a7264);
  font-family: inherit;
  transition: all .2s;
}
.ed-btn:hover { border-color: var(--accent-coral, #e07b6c); color: var(--accent-coral, #e07b6c); }
.ed-btn.primary {
  border: none;
  color: #fff;
  font-weight: 700;
  background: linear-gradient(135deg, #e07b6c, #c9a84c);
}
.ed-btn.danger:hover { border-color: #c0504a; color: #c0504a; }
.ed-hint { font-size: 11.5px; color: var(--text-muted, #b0a898); width: 100%; }
