.blog-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 24px 0 32px;
}

.filter-btn {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.02em;
  padding: 8px 18px;
  border: 1px solid var(--border);
  background: var(--bg-panel);
  color: var(--text-muted);
  border-radius: var(--radius);
  cursor: pointer;
}

.filter-btn:hover {
  border-color: var(--text-muted);
  color: var(--text);
}

.filter-btn.is-active {
  border-color: var(--accent);
  color: var(--accent-dark);
  background: var(--bg-panel2);
}

.post-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

@media (max-width: 980px) {
  .post-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .post-grid {
    grid-template-columns: 1fr;
  }
}

.post-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 24px;
  border: 1px solid var(--border);
  background: var(--bg-panel);
  text-decoration: none;
  color: var(--text);
  min-width: 0;
}

.post-card:hover {
  border-color: var(--accent);
}

.post-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
}

.post-tag {
  border: 1px solid var(--border);
  padding: 2px 10px;
  color: var(--text-muted);
}

.post-title {
  font-family: var(--font-display);
  font-size: 18px;
  line-height: 1.5;
  margin: 0;
}

.post-sum {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-muted);
  margin: 0;
  flex: 1;
}

.post-more {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent-dark);
}

.crumbs {
  margin-top: 1.4rem;
  padding-top: 0.2rem;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.crumbs a {
  color: var(--text-muted);
  text-decoration: none;
}

.crumbs a:hover {
  color: var(--accent-dark);
}

.crumbs-sep {
  color: var(--border);
}

.crumbs-now {
  color: var(--text);
}

.article-head {
  padding: 32px 0 40px;
  border-bottom: 1px solid var(--hairline);
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 18px;
}

.article-meta .post-tag {
  border: 1px solid var(--border);
  padding: 2px 10px;
}

.article-h1 {
  font-family: var(--font-display);
  font-size: 34px;
  line-height: 1.35;
  margin: 0 0 16px;
  max-width: 880px;
}

.article-summary {
  font-size: 16px;
  line-height: 1.75;
  color: var(--text-muted);
  max-width: 760px;
  margin: 0;
}

.prose {
  max-width: 760px;
  margin: 40px auto;
  font-size: 15px;
  line-height: 1.85;
  color: var(--text);
}

.prose h2 {
  font-family: var(--font-display);
  font-size: 22px;
  margin: 40px 0 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--hairline);
}

.prose h3 {
  font-family: var(--font-display);
  font-size: 18px;
  margin: 28px 0 12px;
}

.prose p {
  margin: 0 0 16px;
}

.prose ul, .prose ol {
  margin: 0 0 16px;
  padding-left: 22px;
}

.prose li {
  margin-bottom: 8px;
}

.prose code {
  font-family: var(--font-mono);
  font-size: 13px;
  background: var(--bg-panel2);
  padding: 2px 6px;
  overflow-wrap: anywhere;
}

.prose pre {
  background: var(--bg-panel2);
  border: 1px solid var(--border);
  padding: 16px;
  overflow-x: auto;
  margin: 0 0 20px;
}

.prose pre code {
  background: none;
  padding: 0;
}

.prose blockquote {
  border-left: 2px solid var(--accent);
  margin: 0 0 20px;
  padding: 4px 0 4px 18px;
  color: var(--text-muted);
}

.endcard {
  max-width: 760px;
  margin: 48px auto 40px;
  padding: 32px;
  border: 1px solid var(--border);
  background: var(--bg-panel);
  text-align: center;
}

.endcard-title {
  font-family: var(--font-display);
  font-size: 22px;
  margin: 0 0 12px;
}

.endcard-desc {
  color: var(--text-muted);
  margin: 0 0 24px;
  font-size: 14px;
}

.endcard-actions {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

#related-posts {
  max-width: 1080px;
  margin: 48px auto;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 20px;
}

@media (max-width: 980px) {
  .related-grid {
    grid-template-columns: 1fr;
  }
}

#post-nav {
  max-width: 760px;
  margin: 0 auto 60px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
}

.nav-card {
  flex: 1;
  border: 1px solid var(--border);
  background: var(--bg-panel);
  padding: 18px 20px;
  text-decoration: none;
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.nav-card:hover {
  border-color: var(--accent);
}

.nav-card--next {
  text-align: right;
}

.nav-card-dir {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
}

.nav-card-title {
  font-size: 14px;
  line-height: 1.5;
}

.dl-fab {
  position: fixed;
  right: 24px;
  bottom: 24px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: var(--accent);
  color: var(--on-accent);
  border: 1px solid var(--accent-dark);
  text-decoration: none;
  font-size: 14px;
  font-family: var(--font-body);
  z-index: 100;
}

.dl-fab:hover {
  background: var(--accent-dark);
}

.dl-fab svg {
  width: 14px;
  height: 14px;
}

@media (max-width: 640px) {
  .article-h1 {
    font-size: 26px;
  }

  .endcard {
    padding: 24px 20px;
  }

  #post-nav {
    flex-direction: column;
  }

  .nav-card--next {
    text-align: left;
  }
}