.blog-list-page main,
.article-page main,
.blog-article-page main {
  min-width: 0;
}

.blog-index-hero {
  padding-block: 64px 48px;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border);
}

.blog-eyebrow {
  margin: 0 0 16px;
  color: var(--text-muted);
  font-size: 13px;
  letter-spacing: 0.06em;
}

.blog-index-hero h1 {
  margin: 0;
  max-width: 100%;
  color: var(--text);
  font-family: var(--font-display);
  font-size: clamp(28px, 3.5vw, 48px);
  font-weight: var(--weight-normal);
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.blog-index-lead {
  max-width: 44em;
  margin: 20px 0 0;
  color: var(--text-muted);
  font-size: 17px;
  line-height: 1.8;
}

.blog-list-section {
  padding-block: 32px var(--section-space);
}

.blog-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.blog-filter button {
  min-height: 44px;
  padding: 9px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--bg);
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: var(--weight-normal);
  line-height: 1.5;
  cursor: pointer;
  transition: border-color var(--duration) var(--ease),
    background-color var(--duration) var(--ease),
    color var(--duration) var(--ease);
}

.blog-filter button:hover {
  border-color: var(--border-strong);
  color: var(--accent-dark);
}

.blog-filter button[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.blog-filter button:focus-visible,
.blog-post-grid a:focus-visible,
#related-posts a:focus-visible,
#post-nav a:focus-visible,
nav.breadcrumb a:focus-visible,
nav.breadcrumbs a:focus-visible,
.blog-breadcrumb a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.blog-status {
  margin: 24px 0 20px;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.6;
}

.blog-post-grid,
.related-post-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.blog-post-grid > *,
.related-post-grid > * {
  min-width: 0;
}

.blog-post-grid .post-card,
#related-posts .post-card {
  display: flex;
  flex-direction: column;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color var(--duration) var(--ease);
}

.blog-post-grid .post-card:hover,
#related-posts .post-card:hover {
  border-color: var(--border-strong);
}

.blog-post-grid .post-card__meta,
#related-posts .post-card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin: 0 0 16px;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.6;
}

.blog-post-grid .post-card__meta .tag,
#related-posts .post-card__meta .tag {
  padding: 4px 9px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-panel);
  color: var(--text-muted);
  white-space: normal;
  overflow-wrap: anywhere;
}

.blog-post-grid .post-card h2,
#related-posts .post-card h3 {
  margin: 0;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: var(--weight-normal);
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.blog-post-grid .post-card h2 a,
#related-posts .post-card h3 a {
  color: var(--text);
  text-decoration: none;
}

.blog-post-grid .post-card h2 a:hover,
#related-posts .post-card h3 a:hover {
  color: var(--accent);
}

.blog-post-grid .post-card > p,
#related-posts .post-card > p {
  margin: 16px 0 24px;
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.8;
  overflow-wrap: anywhere;
}

.blog-post-grid .post-card__link,
#related-posts .post-card__link {
  align-self: flex-start;
  margin-top: auto;
  color: var(--accent);
  font-size: 14px;
  line-height: 1.6;
  text-decoration: none;
}

.blog-post-grid .post-card__link:hover,
#related-posts .post-card__link:hover {
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.blog-empty {
  grid-column: 1 / -1;
  margin: 0;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-panel);
  color: var(--text-muted);
  line-height: 1.8;
}

.blog-empty a {
  color: var(--accent);
}

.has-dl-fab main.reading {
  padding-top: 32px;
}

.has-dl-fab main.reading > nav:first-child {
  margin: 0 0 20px;
  min-width: 0;
}

.has-dl-fab main.reading > nav:first-child p {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  min-width: 0;
  font-size: 13px;
  white-space: nowrap;
}

.has-dl-fab main.reading > nav:first-child a {
  flex: 0 0 auto;
}

.has-dl-fab main.reading > nav:first-child [aria-current="page"] {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 30ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.has-dl-fab main.reading > article > header h1 {
  font-size: clamp(1.5rem, 1.1rem + 1.4vw, 2rem);
}

/* 文章路标保持单行，当前文章标题只作截断路标。 */
.blog-breadcrumb,
nav.breadcrumb,
nav.breadcrumbs {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0.5rem;
  min-width: 0;
  margin-top: 1.5rem;
  margin-bottom: 1.25rem;
  padding-block: 0;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 1.6;
  white-space: nowrap;
  overflow: hidden;
}

.blog-breadcrumb.section,
nav.breadcrumb.section,
nav.breadcrumbs.section {
  padding-top: 0;
  padding-bottom: 0;
}

.blog-breadcrumb a,
nav.breadcrumb a,
nav.breadcrumbs a {
  flex: 0 0 auto;
  color: var(--text-muted);
  text-decoration: none;
}

.blog-breadcrumb a:hover,
nav.breadcrumb a:hover,
nav.breadcrumbs a:hover {
  color: var(--accent);
}

.blog-breadcrumb > span:not([aria-current]),
nav.breadcrumb > span:not([aria-current]),
nav.breadcrumbs > span:not([aria-current]) {
  flex: 0 0 auto;
  color: var(--text-faint);
  opacity: 0.65;
}

.blog-breadcrumb [aria-current="page"],
nav.breadcrumb [aria-current="page"],
nav.breadcrumbs [aria-current="page"] {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 30ch;
  overflow: hidden;
  color: var(--text-muted);
  text-overflow: ellipsis;
}

.article-page main > .section:first-child,
.blog-article-page main > .section:first-child,
.has-dl-fab main > .section:first-child {
  padding-top: 24px;
  padding-bottom: 0;
}

.article-hero,
.article-hero.section {
  min-width: 0;
  padding-top: 8px;
  padding-bottom: 24px;
}

.article-meta,
.article-hero__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin: 0 0 1rem;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.6;
}

.article-hero h1 {
  max-width: 100%;
  margin: 1rem 0 1rem;
  color: var(--text);
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 1.1rem + 1.4vw, 2rem);
  font-weight: var(--weight-normal);
  line-height: 1.32;
  overflow-wrap: anywhere;
}

.article-lead,
.article-hero__lead,
.article-hero > p:not(.article-meta):not(.article-hero__meta) {
  margin: 1rem 0 0;
  color: var(--text-muted);
  font-size: clamp(0.9375rem, 0.85rem + 0.45vw, 1.125rem);
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.article-body,
.article-page .prose,
.blog-article-page .prose {
  min-width: 0;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.85;
  overflow-wrap: anywhere;
}

.article-body > :first-child,
.article-page .prose > :first-child,
.blog-article-page .prose > :first-child {
  margin-top: 0;
}

.article-body h2,
.article-page .prose h2,
.blog-article-page .prose h2 {
  margin: 32px 0 16px;
  color: var(--text);
  font-family: var(--font-display);
  font-size: clamp(21px, 2vw, 24px);
  font-weight: var(--weight-normal);
  line-height: 1.5;
}

.article-body > h2:first-of-type,
.article-body > section:first-of-type > h2:first-child,
.article-page .prose > h2:first-of-type,
.blog-article-page .prose > h2:first-of-type {
  margin-top: 0;
}

.article-body h3,
.article-page .prose h3,
.blog-article-page .prose h3 {
  margin: 24px 0 12px;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: var(--weight-normal);
  line-height: 1.5;
}

.article-body p,
.article-body ul,
.article-body ol,
.article-page .prose p,
.blog-article-page .prose p {
  margin-block: 16px;
}

.article-body ul,
.article-body ol {
  padding-left: 1.5em;
}

.article-body li + li {
  margin-top: 8px;
}

.article-body section,
.article-body section.section,
.article-page .prose section,
.blog-article-page .prose section {
  margin-block: 24px 0;
  padding-block: 0;
}

.article-body section > :first-child {
  margin-top: 0;
}

.article-body section > :last-child {
  margin-bottom: 0;
}

.article-body a:not([class*="btn"]):not([class*="button"]),
.prose a:not([class*="btn"]):not([class*="button"]) {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

.article-body blockquote {
  margin: 24px 0;
  padding: 16px 20px;
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  background: var(--bg-panel);
  color: var(--text-muted);
}

.article-body blockquote > :first-child {
  margin-top: 0;
}

.article-body blockquote > :last-child {
  margin-bottom: 0;
}

.article-body code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  overflow-wrap: anywhere;
}

.article-body :not(pre) > code {
  padding: 2px 5px;
  border-radius: var(--radius-sm);
  background: var(--bg-panel-2);
  color: var(--text);
}

.article-body pre {
  max-width: 100%;
  margin: 24px 0;
  padding: 20px;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-panel);
  color: var(--text);
  line-height: 1.7;
  tab-size: 2;
}

.article-body pre > code {
  display: block;
  padding: 0;
  white-space: pre;
  overflow-wrap: normal;
  word-break: normal;
}

.article-body .table-scroll {
  max-width: 100%;
  margin-block: 24px;
  overflow-x: auto;
}

.article-body table {
  display: block;
  max-width: 100%;
  margin-block: 24px;
  overflow-x: auto;
  border-collapse: collapse;
  font-size: 14px;
}

.article-body .table-scroll table {
  display: table;
  width: 100%;
  margin: 0;
}

.article-body th,
.article-body td {
  min-width: 7em;
  padding: 12px 16px;
  border: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.article-body th {
  background: var(--bg-panel);
  font-weight: var(--weight-medium);
}

.article-body img,
.article-body svg {
  max-width: 100%;
}

.article-download {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px 24px;
  margin: 32px 0;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-panel);
}

.article-download > div:first-child {
  flex: 1 1 260px;
  min-width: 0;
}

.article-download h2,
.article-body .article-download h2 {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: var(--weight-normal);
  line-height: 1.5;
}

.article-download p,
.article-body .article-download p {
  margin: 0;
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.8;
}

.article-download__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

#related-posts {
  min-width: 0;
  margin-top: 32px;
  padding-block: 0;
}

#related-posts > h2 {
  margin: 0 0 20px;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: var(--weight-normal);
  line-height: 1.5;
}

#related-posts .post-card h3 {
  font-size: 20px;
}

#post-nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  min-width: 0;
  margin-block: 24px 40px;
  padding: 0;
}

#post-nav .post-nav-card {
  display: block;
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-panel);
  color: var(--text);
  text-decoration: none;
  overflow-wrap: anywhere;
  transition: border-color var(--duration) var(--ease);
}

#post-nav .post-nav-card:hover {
  border-color: var(--border-strong);
}

.post-nav-card--next {
  grid-column: 2;
}

.post-nav-card__label {
  display: block;
  margin-bottom: 10px;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.6;
}

.post-nav-card__title {
  display: block;
  color: var(--text);
  font-size: 16px;
  line-height: 1.7;
}

#related-posts[hidden],
#post-nav[hidden] {
  display: none;
}

@media (max-width: 700px) {
  .blog-post-grid,
  .related-post-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .blog-post-grid .post-card,
  #related-posts .post-card {
    padding: 20px;
  }

  #post-nav {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }

  .post-nav-card--next {
    grid-column: auto;
  }
}

@media (max-width: 600px) {
  .blog-index-hero {
    padding-block: 40px 32px;
  }

  .blog-index-hero h1 {
    font-size: 28px;
  }

  .blog-index-lead {
    font-size: 16px;
  }

  .blog-list-section {
    padding-top: 24px;
  }

  .blog-filter button {
    padding-inline: 13px;
  }

  .article-hero h1 {
    font-size: 24px;
  }

  .article-hero,
  .article-hero.section {
    padding-top: 4px;
    padding-bottom: 24px;
  }

  .article-download {
    align-items: flex-start;
    padding: 20px;
  }

  .article-download__actions {
    width: 100%;
  }

  .article-body pre {
    padding: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .blog-filter button,
  .blog-post-grid .post-card,
  #related-posts .post-card,
  #post-nav .post-nav-card {
    transition: none;
  }
}