/* 博客系统专属样式:列表页 + 文章页,全部颜色引用设计令牌 */

/* ---------- 列表页 Hero ---------- */
.blog-hero {
  padding-top: calc(var(--head-h) + 3.4rem);
  padding-bottom: 2.6rem;
  border-bottom: 1px solid var(--border);
}
.blog-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0.9rem 0 0.8rem;
}
.blog-hero .lede {
  max-width: 46rem;
}

/* ---------- 列表页主体与筛选 ---------- */
.blog-body {
  padding-top: 2.4rem;
  padding-bottom: var(--sec-y);
}
.blog-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 2.2rem;
}
.bf-btn {
  appearance: none;
  background: transparent;
  border: 1px solid var(--border);
  padding: 0.62rem 1.05rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  max-width: 100%;
  overflow: hidden;
  transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}
.bf-btn::before {
  content: "";
  width: 6px;
  height: 6px;
  flex: none;
  background: transparent;
  border: 1px solid var(--border);
}
.bf-btn:hover {
  color: var(--text);
  background: var(--bg-panel);
}
.bf-btn.on {
  color: var(--text);
  background: var(--bg-panel2);
  border-color: var(--text-muted);
}
.bf-btn.on::before {
  background: var(--text);
  border-color: var(--text);
}
.blog-empty {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  margin: 1rem 0 0;
}

/* ---------- 文章卡片(列表页 + 延伸阅读共用 meta/tag) ---------- */
.post-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem;
}
.post-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  padding: 1.5rem 1.6rem 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  min-width: 0;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.post-card:hover {
  border-color: var(--text-muted);
  background: var(--bg-panel2);
}
.post-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.9rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}
.post-meta time {
  flex: none;
}
.post-tag {
  border: 1px solid var(--border);
  padding: 0.12rem 0.5rem;
  font-size: 0.72rem;
  color: var(--text-muted);
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.post-card h3 {
  font-family: var(--font-display);
  font-size: 1.12rem;
  line-height: 1.5;
  margin: 0;
}
.post-card h3 a {
  color: var(--text);
  text-decoration: none;
}
.post-card h3 a:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}
.post-card p {
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.75;
  margin: 0;
}
.post-more {
  margin-top: auto;
  align-self: flex-start;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
  padding-bottom: 2px;
  transition: border-color 0.2s ease;
}
.post-more:hover {
  border-bottom-color: var(--text);
}

/* ---------- 文章页:面包屑 + 页头 ---------- */
.post-main {
  padding-bottom: var(--sec-y);
}
.crumbs {
  padding-top: calc(var(--head-h) + 1.6rem);
  margin-bottom: 2.4rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}
.crumbs a {
  color: var(--text-muted);
  text-decoration: none;
}
.crumbs a:hover {
  color: var(--text);
}
.crumbs .sep {
  color: rgba(var(--rgb-text), 0.35);
  flex: none;
}
.crumbs span:last-child {
  color: var(--text);
}
.post-head {
  margin-bottom: 2.6rem;
}
.post-head .post-meta {
  margin-bottom: 1rem;
}
.post-head h1 {
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 3.6vw, 2.6rem);
  line-height: 1.35;
  letter-spacing: -0.01em;
  margin: 0 0 1rem;
  max-width: 54rem;
}
.post-head .lede {
  max-width: 46rem;
}

/* ---------- 文章页:正文排版 ---------- */
.prose {
  max-width: 46rem;
  color: var(--text);
  font-size: 0.98rem;
  line-height: 1.85;
}
.prose h2 {
  font-family: var(--font-display);
  font-size: 1.45rem;
  line-height: 1.4;
  margin: 3rem 0 1.1rem;
  padding-top: 1.6rem;
  border-top: 1px solid var(--border);
}
.prose h2:first-child {
  border-top: 0;
  padding-top: 0;
  margin-top: 0;
}
.prose h3 {
  font-family: var(--font-display);
  font-size: 1.12rem;
  line-height: 1.5;
  margin: 2.2rem 0 0.9rem;
}
.prose p {
  margin: 0 0 1.2rem;
}
.prose ul {
  margin: 0 0 1.4rem;
  padding-left: 1.4rem;
}
.prose ul li {
  margin-bottom: 0.5rem;
}
.prose ol {
  margin: 0 0 1.4rem;
  padding-left: 0;
  list-style: none;
  counter-reset: oli;
}
.prose ol li {
  counter-increment: oli;
  position: relative;
  padding-left: 2.2rem;
  margin-bottom: 0.6rem;
}
.prose ol li::before {
  content: counter(oli, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 0.32em;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 0.05rem 0.3rem;
}
.prose a {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(var(--rgb-text), 0.35);
}
.prose a:hover {
  text-decoration-color: var(--text);
}
.prose code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--bg-panel2);
  border: 1px solid var(--border);
  padding: 0.1em 0.35em;
}
.prose pre {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  padding: 1.1rem 1.2rem;
  overflow-x: auto;
  margin: 0 0 1.4rem;
}
.prose pre code {
  background: transparent;
  border: 0;
  padding: 0;
 font-size: 0.85rem;
  line-height: 1.7;
  color: var(--text);
}
.prose blockquote {
  margin: 0 0 1.4rem;
  padding: 0.9rem 1.2rem;
  border-left: 2px solid var(--text-muted);
  background: var(--bg-panel);
  color: var(--text-muted);
}
.prose blockquote p:last-child {
  margin-bottom: 0;
}
.prose .table-wrap,
.prose .callout,
.prose .cmdbox {
  margin: 0 0 1.4rem;
}
.prose p,
.prose li {
  overflow-wrap: break-word;
}
.prose strong {
  color: var(--text);
}

/* ---------- 文末下载引导卡 ---------- */
.dl-guide {
  margin-top: 3.2rem;
  background: var(--bg-panel2);
  border: 1px solid var(--border);
  padding: 2rem 2.2rem;
}
.dl-guide .g-kicker {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  color: var(--text-muted);
  margin: 0 0 0.7rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.dl-guide .g-kicker::before {
  content: "";
  width: 6px;
  height: 6px;
  flex: none;
  border: 1px solid var(--text-muted);
}
.dl-guide h3 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  margin: 0 0 0.7rem;
}
.dl-guide p {
  color: var(--text-muted);
  line-height: 1.75;
  margin: 0 0 1.4rem;
  max-width: 40rem;
}

/* ---------- 延伸阅读 ---------- */
#related-posts {
  margin-top: 3.4rem;
  padding-top: 2.2rem;
  border-top: 1px solid var(--border);
}
.rel-title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  margin: 0 0 1.4rem;
}
.rel-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.2rem;
}
.rel-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  padding: 1.3rem 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  min-width: 0;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.rel-card:hover {
  border-color: var(--text-muted);
  background: var(--bg-panel2);
}
.rel-card h3 {
  font-family: var(--font-display);
  font-size: 1rem;
  line-height: 1.55;
  margin: 0;
}
.rel-card h3 a {
  color: var(--text);
  text-decoration: none;
}
.rel-card h3 a:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}
.rel-card p {
  color: var(--text-muted);
  font-size: 0.86rem;
  line-height: 1.7;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---------- 上一篇 / 下一篇 ---------- */
#post-nav {
  margin-top: 2.6rem;
}
.pn-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem;
}
.pn-grid.single .pn-next {
  grid-column: 2;
}
.pn-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  padding: 1.2rem 1.4rem;
  text-decoration: none;
  min-width: 0;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.pn-card:hover {
  border-color: var(--text-muted);
  background: var(--bg-panel2);
}
.pn-next {
  text-align: right;
  align-items: flex-end;
}
.pn-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}
.pn-title {
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.55;
}
.pn-date {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  .post-list {
    grid-template-columns: 1fr;
  }
  .rel-grid {
    grid-template-columns: 1fr;
  }
  .pn-grid {
    grid-template-columns: 1fr;
  }
  .pn-grid.single .pn-next {
    grid-column: auto;
  }
  .pn-next {
    text-align: left;
    align-items: flex-start;
  }
  .dl-guide {
    padding: 1.6rem 1.4rem;
  }
  .blog-hero {
    padding-top: calc(var(--head-h) + 2.4rem);
  }
}