.blog-hero {
  padding: 42px 0 18px;
}

.blog-hero-inner {
  max-width: 760px;
}

.blog-hero .eyebrow {
  margin: 0 0 18px;
  color: var(--green);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.blog-hero h1 {
  margin: 0;
  font-size: var(--text-brand);
  line-height: 1.12;
  letter-spacing: -0.032em;
  text-wrap: balance;
}

.blog-hero-lead {
  max-width: 620px;
  margin: 22px 0 0;
  color: var(--muted);
  font-family: var(--sans);
  font-size: var(--text-lead);
  line-height: 1.8;
}

.blog-content {
  padding: 0 0 72px;
}

.blog-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 30px;
  padding-bottom: 26px;
}

.blog-filter {
  padding: 7px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  cursor: pointer;
  transition: color 160ms ease, border-color 160ms ease, background-color 160ms ease;
}

.blog-filter:hover {
  border-color: var(--line-strong);
  color: var(--charcoal);
}

.blog-filter.is-active {
  border-color: var(--charcoal);
  background: var(--charcoal);
  color: var(--cream);
}

.blog-timeline {
  padding-top: 10px;
}

.blog-month {
  margin: 18px 0 4px;
  padding-left: 0;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  line-height: 1.5;
}

.blog-entry {
  position: relative;
}

.blog-entry-dot {
  display: none;
}

.blog-entry-body {
  padding: 18px 0 26px;
}

.blog-entry-meta {
  margin: 0 0 10px;
}

.blog-tag {
  display: inline-block;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  background: #f1f7f3;
  color: var(--green);
  font-family: var(--sans);
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.5;
}

.blog-entry h3 {
  margin: 0;
  font-size: 19px;
  font-weight: 600;
  line-height: 1.45;
  letter-spacing: -0.015em;
}

.blog-entry h3 a {
  color: var(--charcoal);
  transition: color 160ms ease;
}

.blog-entry h3 a::after {
  position: absolute;
  inset: 0;
  content: "";
}

.blog-entry:hover h3 a {
  color: var(--green);
}

.blog-entry-summary {
  max-width: 780px;
  margin: 10px 0 0;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 14.5px;
  line-height: 1.8;
}

.blog-entry-more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
  transition: color 160ms ease;
}

.blog-entry-more span {
  transition: transform 160ms ease;
}

.blog-entry:hover .blog-entry-more {
  color: var(--green);
}

.blog-entry:hover .blog-entry-more span {
  transform: translateX(3px);
}

.blog-entry.is-hidden {
  display: none;
}

@media (max-width: 720px) {
  .blog-content {
    padding-bottom: 80px;
  }


  .blog-entry h3 {
    font-size: 17px;
  }

  .blog-entry-summary {
    font-size: 14px;
  }
}

/* 生成器产出的博客页面：正文列宽与页脚 CTA */
.blog-body {
  max-width: 100%;
  margin-top: 46px;
  overflow-x: hidden;
}

.blog-body .section-body {
  max-width: 100%;
  overflow-wrap: anywhere;
}

.blog-body .legal-section {
  max-width: 720px;
}

/* The index is a reader: the directory stays visible while the selected article scrolls independently. */
.blog-reader-shell {
  display: grid;
  grid-template-columns: clamp(300px, 28vw, 340px) minmax(0, 1fr);
  column-gap: 68px;
  row-gap: 24px;
  align-items: start;
  margin-top: 0;
}

.blog-reader-nav {
  position: sticky;
  top: 112px;
  grid-column: 1;
  grid-row: 1;
  align-self: start;
  z-index: 10;
  width: auto;
  margin-top: 16px;
  height: calc(100vh - 132px);
  overflow-y: auto;
  padding: 0 8px 24px 0;
  scrollbar-width: none;
}

.blog-reader-nav::-webkit-scrollbar {
  display: none;
}

.blog-index .blog-hero {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.blog-index > .blog-content > .blog-body {
  margin-top: 24px;
  overflow: visible;
}

.blog-index .blog-content {
  padding-top: 0;
}

.blog-reader-nav .blog-filters {
  margin-top: 0;
  padding-bottom: 12px;
}

.blog-reader-nav .blog-timeline {
  padding-top: 0;
}

.blog-reader-nav .blog-entry-body {
  margin: 0 -10px;
  padding: 8px 10px;
  border-radius: 8px;
  transition: background-color 160ms ease;
}

.blog-reader-nav .blog-entry:hover .blog-entry-body {
  background: rgba(30, 26, 20, 0.04);
}

.blog-reader-nav .blog-entry.is-active .blog-entry-body {
  background: rgba(25, 162, 106, 0.09);
}

.blog-reader-nav .blog-entry h3 {
  overflow: hidden;
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.blog-reader-nav,
.blog-reader-nav .blog-filter,
.blog-reader-nav .blog-month {
  /* 目录用中文字体优先的单一字体，避免拉丁与中文两种字形混排。 */
  font-family: "PingFang SC", "HarmonyOS Sans SC", "MiSans", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}

.blog-reader-nav .blog-month {
  font-weight: 500;
  letter-spacing: 0.06em;
}

.blog-reader-nav .blog-entry.is-active h3 a {
  font-weight: 500;
}

.blog-reader-nav .blog-entry-summary,
.blog-reader-nav .blog-entry-more {
  display: none;
}

.blog-reader-nav .blog-entry.is-active h3 a {
  color: var(--green);
}

.blog-reader-nav .blog-entry.is-active .blog-entry-dot {
  box-shadow: 0 0 0 4px rgba(25, 162, 106, 0.14);
}

.blog-reader-panel {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  min-height: 420px;
  margin-left: 0;
  padding: 0 0 24px;
}

.blog-reader-panel > [data-reader-content] {
  max-width: 720px;
}

.blog-reader-panel > [data-reader-content] > h1 {
  margin: 0;
  color: var(--charcoal);
  font-size: clamp(24px, 2.4vw, 30px);
  line-height: 1.24;
  letter-spacing: -0.02em;
  text-wrap: pretty;
}

.blog-reader-panel > [data-reader-content] > .updated {
  margin: 16px 0 0;
}

.blog-reader-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 16px 0 0;
}

.blog-reader-meta > .updated {
  margin: 0;
}

.blog-reader-immersive {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 6px;
  padding: 6px 13px 6px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: #fff;
  color: var(--charcoal);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  cursor: pointer;
  transition: color 160ms ease, border-color 160ms ease;
}

.blog-reader-immersive:hover {
  border-color: var(--green);
  color: var(--green);
}

.blog-reader-immersive:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

.blog-reader-immersive svg {
  flex: none;
}

/* 沉浸阅读：目录与固定标题让位，正文单列居中，整页覆盖站点导航。 */
.blog-reader-shell.is-immersive {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: block;
  overflow-y: auto;
  padding: 0 24px;
  background: #fff;
}

.blog-reader-shell.is-immersive .blog-reader-nav {
  display: none;
}

.blog-reader-shell.is-immersive .blog-reader-panel {
  max-width: 720px;
  margin: 0 auto;
  padding: 88px 0 140px;
}

.blog-reader-shell.is-immersive .blog-reader-tools {
  position: fixed;
  top: 24px;
  right: 40px;
  z-index: 70;
}

.blog-reader-shell.is-immersive .blog-reader-immersive {
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(6px);
}

/* 全屏阅读时锁住页面滚动，避免背景跟随滚动。 */
html.blog-immersive {
  overflow: hidden;
}

.blog-reader-panel > [data-reader-content] > .blog-hero-lead {
  margin: 20px 0 0;
}

.blog-reader-article {
  margin-top: 38px;
}

.blog-reader-article .legal-section {
  max-width: 720px;
}

.blog-reader-status {
  min-height: 1.5em;
  margin: 0 0 4px;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 13px;
}

/* 切换文章时保持旧内容可见，用一条细进度条提示，不占用布局高度。 */
.blog-reader-panel {
  position: relative;
}

.blog-reader-panel.is-loading::before {
  position: absolute;
  top: -6px;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--green), transparent) no-repeat;
  background-size: 40% 100%;
  content: "";
  animation: blog-reader-loading 900ms ease-in-out infinite;
}

@keyframes blog-reader-loading {
  from {
    background-position: -40% 0;
  }

  to {
    background-position: 140% 0;
  }
}

.blog-reader-back {
  display: none;
}

@media (max-width: 900px) {
  .blog-reader-shell {
    grid-template-columns: 280px minmax(0, 1fr);
    column-gap: 30px;
  }

  .blog-reader-nav {
    width: auto;
  }

  .blog-reader-panel {
    margin-left: 0;
  }
}

@media (max-width: 720px) {
  .blog-reader-shell {
    display: block;
    margin-top: 32px;
  }

  .blog-reader-nav {
    position: static;
    width: auto;
    height: auto;
    max-height: none;
    padding-right: 0;
    overflow: visible;
  }


  .blog-index .blog-content {
    padding-top: 32px;
  }

  .blog-reader-panel {
    display: none;
    margin-left: 0;
    padding-top: 0;
  }

  .blog-reader-tools {
    display: none;
  }

  .blog-reader-shell.is-reading .blog-reader-nav {
    display: none;
  }

  .blog-reader-shell.is-reading .blog-reader-panel {
    display: block;
  }

  .blog-reader-back {
    display: inline-flex;
    margin: 0 0 28px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--green);
    font-family: var(--sans);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
  }

  .blog-reader-nav .blog-entry-summary,
  .blog-reader-nav .blog-entry-more {
    display: none;
  }

  .blog-reader-nav .blog-entry h3 {
    font-size: 16px;
  }
}

.blog-body .legal-section + .legal-section {
  margin-top: 34px;
}

.blog-hero .updated {
  margin: 14px 0 0;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 13px;
}

.closing-inner--compact {
  justify-content: space-between;
  gap: 32px;
}

@media (max-width: 720px) {
  .closing-inner--compact {
    flex-direction: column;
    align-items: flex-start;
    gap: 22px;
  }
}

/* 文章内配图 */
.section-body figure {
  margin: 26px 0;
}

.section-body img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-2);
}

.section-body figcaption {
  margin-top: 9px;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 12.5px;
  line-height: 1.6;
}

/* 文章内表格 */
.section-body table {
  width: 100%;
  max-width: 100%;
  table-layout: fixed;
  word-break: break-word;
  margin: 22px 0;
  border-collapse: collapse;
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.65;
}

.section-body th,
.section-body td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.section-body th {
  background: var(--surface-2);
  color: var(--charcoal);
  font-weight: 600;
}

.section-body td {
  color: var(--muted);
}

.section-body tr:last-child td {
  border-bottom: 0;
}

/* 文章内的提示词 / 代码块：必须换行，否则长提示词会撑破版面 */
.section-body pre {
  margin: 22px 0;
  padding: 18px 20px;
  max-width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  color: var(--charcoal);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.75;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.section-body code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92em;
}

/* 文章页：标题与正文整体居中，左上角返回入口 */
.blog-back-bar {
  padding-top: 22px;
}

.blog-back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.5;
  transition: color 160ms ease;
}

.blog-back-link:hover {
  color: var(--charcoal);
}

main.blog-post .blog-back-bar + .blog-hero {
  padding-top: 26px;
}

main.blog-post .blog-hero-inner {
  max-width: 780px;
  margin-inline: auto;
  text-align: center;
}

main.blog-post .blog-hero-lead {
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

main.blog-post .blog-hero .updated {
  text-align: center;
}

main.blog-post .blog-body {
  max-width: 760px;
  margin-inline: auto;
}

@media (max-width: 720px) {
  /* 窄屏表格：缩小字号与内边距，避免四列表格被挤成竖条 */
  .section-body table {
    font-size: 13px;
  }

  .section-body th,
  .section-body td {
    padding: 8px;
  }
}
