:root {
  --blog-column: 56rem;
  --blog-gutter: max(1.5rem, var(--gutter));
  --blog-h1: clamp(1.8rem, 4.5vw, 2.6rem);
  --blog-list-h1: clamp(2rem, 5vw, 3rem);
  --blog-h2: clamp(1.3rem, 3vw, 1.6rem);
  --blog-h3: 1.3rem;
  --blog-body: 1rem;
  --blog-small: 0.875rem;
  --blog-caption: 0.8rem;
  --blog-stat: clamp(1.6rem, 4vw, 2.2rem);
  --blog-leading: 1.9;
  --blog-title-leading: 1.4;
  --blog-tracking: -0.015em;
  --blog-tint: color-mix(in srgb, var(--panel) 86%, var(--panel-2));
  --blog-rule-end: color-mix(in srgb, var(--accent) 42%, var(--panel));
  --blog-code-bg: var(--text);
  --blog-code-ink: var(--panel);
  --blog-shadow: 0 16px 40px var(--accent-a08);
  --blog-focus: 0 0 0 3px var(--accent-a22);
}

.blog-index,
.blog-article {
  font-family: var(--font-body);
  color: var(--text);
  background-color: var(--bg);
}

.blog-list-wrap {
  padding-bottom: 3rem;
}

.blog-list-wrap > *,
.reading-wrap > *,
.article-hero > *,
.related-grid > *,
.blog-post-grid > * {
  min-width: 0;
}

.blog-skip {
  position: absolute;
  top: 0.75rem;
  left: 1rem;
  z-index: 1000;
  padding: 0.75rem 1rem;
  border-radius: var(--r-sm);
  background: var(--panel);
  color: var(--text);
  transform: translateY(-200%);
}

.blog-skip:focus {
  transform: none;
}

.blog-index :focus-visible,
.blog-article :focus-visible,
.reading-wrap :focus-visible,
.article-hero :focus-visible {
  outline: 2px solid var(--accent-dark);
  outline-offset: 4px;
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem;
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
  color: var(--muted);
  font-size: var(--blog-small);
  line-height: 1.8;
  overflow-wrap: anywhere;
}

.breadcrumbs a {
  color: var(--text);
  text-decoration-color: var(--border-strong);
  text-underline-offset: 0.2em;
}

.breadcrumbs a:hover {
  text-decoration-thickness: 2px;
}

.blog-list-hero {
  padding-block: 1.5rem 2rem;
}

.blog-kicker {
  margin: 0 0 0.75rem;
  color: var(--muted);
  font-size: var(--blog-small);
  font-weight: var(--weight-semibold);
}

.blog-list-hero h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--blog-list-h1);
  font-weight: var(--weight-display);
  line-height: var(--blog-title-leading);
  letter-spacing: var(--blog-tracking);
  text-wrap: pretty;
}

.blog-intro {
  max-width: 44rem;
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: var(--blog-body);
  line-height: var(--blog-leading);
}

.blog-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.65rem;
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  background: var(--panel);
  box-shadow: inset 0 1px 0 var(--hi);
}

.blog-filter {
  min-height: 2.75rem;
  padding: 0.6rem 1.1rem;
  border: 1px solid var(--clear);
  border-radius: var(--r-pill);
  background: var(--clear);
  color: var(--muted);
  font-family: var(--font-body);
  font-size: var(--blog-small);
  font-weight: var(--weight-semibold);
  line-height: 1.5;
  cursor: pointer;
}

.blog-filter:hover {
  background: var(--panel-2);
  color: var(--text);
}

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

.blog-status {
  margin: 1rem 0;
  color: var(--muted);
  font-size: var(--blog-small);
  line-height: 1.8;
}

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

.article-card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: relative;
  min-width: 0;
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--panel);
  box-shadow: inset 0 1px 0 var(--hi), var(--blog-shadow);
  transition: border-color var(--speed) var(--ease-out),
    transform var(--speed) var(--ease-out);
}

.article-card:hover,
.article-card:focus-within {
  border-color: var(--accent);
  transform: translateY(-3px);
}

.article-card h2,
.article-card h3 {
  display: block;
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--blog-h3);
  font-weight: var(--weight-bold);
  line-height: 1.6;
  letter-spacing: var(--blog-tracking);
  text-wrap: pretty;
  overflow-wrap: anywhere;
}

.article-card h2 a,
.article-card h3 a {
  color: var(--text);
  text-decoration: none;
}

.article-card h2 a:hover,
.article-card h3 a:hover {
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.article-summary {
  margin: 0;
  color: var(--muted);
  font-size: var(--blog-body);
  line-height: var(--blog-leading);
}

.article-read-link {
  align-self: flex-start;
  margin-top: auto;
  color: var(--text);
  font-size: var(--blog-small);
  font-weight: var(--weight-semibold);
  text-decoration: underline;
  text-decoration-color: var(--border-strong);
  text-underline-offset: 0.3em;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-items: center;
  gap: 0.5rem;
  color: var(--muted);
  font-family: var(--font-body);
  font-size: var(--blog-caption);
  line-height: 1.7;
}

.article-meta > * {
  max-width: 100%;
}

.article-meta .badge,
.article-meta time,
.article-meta .read-time,
.article-meta .article-readtime,
.article-meta > span {
  padding: 0.3rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--panel);
  color: var(--muted);
  white-space: normal;
}

.article-meta .badge {
  border-color: var(--text);
  background: var(--text);
  color: var(--panel);
}

.blog-empty {
  grid-column: 1 / -1;
  margin: 0;
  padding: 2rem;
  border: 1px dashed var(--border-strong);
  border-radius: var(--r-lg);
  background: var(--panel-2);
  color: var(--muted);
  line-height: var(--blog-leading);
}

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

.reading-wrap,
.article-hero,
main > .breadcrumbs,
body > .breadcrumbs,
.article-breadcrumbs,
.blog-article .breadcrumbs {
  box-sizing: border-box;
  width: 100%;
  max-width: calc(var(--blog-column) + var(--blog-gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--blog-gutter);
}

.reading-wrap {
  padding-block: 1.5rem 2rem;
}

.reading-wrap .breadcrumbs,
.reading-wrap .article-breadcrumbs {
  width: auto;
  max-width: none;
  padding-inline: 0;
}

.article-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding-block: 2rem;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--blog-tint);
  box-shadow: inset 0 1px 0 var(--hi), var(--blog-shadow);
}

.article-hero::before {
  content: "";
  position: absolute;
  inset-block: 1.25rem;
  left: 0.6rem;
  width: 0.3rem;
  border-radius: var(--r-pill);
  background: linear-gradient(to bottom, var(--accent), var(--blog-rule-end));
  pointer-events: none;
}

.reading-wrap .article-hero {
  width: auto;
  max-width: none;
  margin-inline: calc(-1 * var(--blog-gutter));
  padding-inline: var(--blog-gutter);
}

.article-hero h1 {
  display: block;
  margin: 1rem 0;
  color: var(--text);
  font-family: var(--font-display);
  font-size: var(--blog-h1);
  font-weight: var(--weight-display);
  line-height: var(--blog-title-leading);
  letter-spacing: var(--blog-tracking);
  text-wrap: pretty;
  overflow-wrap: anywhere;
}

.article-hero > p,
.article-hero .article-summary,
.article-hero .article-lede {
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: var(--blog-body);
  line-height: var(--blog-leading);
}

.prose,
.article-body,
[data-article-body] {
  min-width: 0;
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--blog-body);
  line-height: var(--blog-leading);
  overflow-wrap: anywhere;
  counter-reset: blog-section;
}

.prose > :first-child,
.article-body > :first-child,
[data-article-body] > :first-child {
  margin-top: 0;
}

.prose h1,
.prose h2,
.prose h3,
.article-body h1,
.article-body h2,
.article-body h3,
[data-article-body] h1,
[data-article-body] h2,
[data-article-body] h3 {
  display: block;
  font-family: var(--font-display);
  letter-spacing: var(--blog-tracking);
  text-wrap: pretty;
}

.prose h2,
.article-body h2,
[data-article-body] h2 {
  counter-increment: blog-section;
  margin: 2.25rem 0 1rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--border);
  font-size: var(--blog-h2);
  font-weight: var(--weight-bold);
  line-height: 1.6;
  scroll-margin-top: var(--anchor-offset);
}

.prose h2::before,
.article-body h2::before,
[data-article-body] h2::before {
  content: counter(blog-section, decimal-leading-zero);
  display: inline-block;
  margin-right: 0.65rem;
  padding: 0.1rem 0.45rem;
  border: 1px solid var(--border);
  border-radius: var(--r-xs);
  background: var(--panel-2);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: var(--blog-small);
  font-weight: var(--weight-medium);
  vertical-align: middle;
}

.prose h3,
.article-body h3,
[data-article-body] h3 {
  margin: 1.75rem 0 0.75rem;
  font-size: var(--blog-h3);
  line-height: 1.65;
}

.prose p,
.article-body p,
[data-article-body] p {
  margin: 0 0 1.15rem;
}

.prose ul,
.prose ol,
.article-body ul,
.article-body ol,
[data-article-body] ul,
[data-article-body] ol {
  margin-block: 1rem 1.5rem;
  padding-left: 1.5rem;
}

.prose li,
.article-body li,
[data-article-body] li {
  margin-block: 0.5rem;
}

.prose a,
.article-body a,
[data-article-body] a {
  color: var(--text);
  text-decoration-color: var(--border-strong);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.25em;
}

.prose a:hover,
.article-body a:hover,
[data-article-body] a:hover {
  text-decoration-thickness: 2px;
}

.prose img,
.article-body img,
[data-article-body] img {
  max-width: 100%;
  height: auto;
  border-radius: var(--r-md);
}

.prose figure,
.article-body figure {
  margin: 1.5rem 0;
}

.prose figcaption,
.article-body figcaption {
  margin-top: 0.5rem;
  color: var(--muted);
  font-size: var(--blog-small);
}

.prose hr,
.article-body hr {
  margin-block: 2rem;
  border: 0;
  border-top: 1px solid var(--border);
}

.prose .table-scroll,
.article-body .table-scroll,
[data-article-body] .table-scroll {
  max-width: 100%;
  margin-block: 1.5rem;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--panel);
}

.prose table,
.article-body table,
[data-article-body] table {
  width: 100%;
  margin-block: 1.5rem;
  border-collapse: collapse;
  color: var(--text);
  font-size: var(--blog-small);
  line-height: 1.8;
}

.prose .table-scroll table,
.article-body .table-scroll table,
[data-article-body] .table-scroll table {
  min-width: 38rem;
  margin: 0;
}

.prose caption,
.article-body caption,
[data-article-body] caption {
  padding: 0.85rem 1rem;
  background: var(--panel-2);
  color: var(--text);
  text-align: left;
  font-weight: var(--weight-semibold);
}

.prose th,
.prose td,
.article-body th,
.article-body td,
[data-article-body] th,
[data-article-body] td {
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.prose thead th,
.article-body thead th,
[data-article-body] thead th {
  background: var(--text);
  color: var(--panel);
  font-weight: var(--weight-semibold);
}

.prose tbody tr:nth-child(even),
.article-body tbody tr:nth-child(even),
[data-article-body] tbody tr:nth-child(even) {
  background: var(--panel-2);
}

.prose tbody tr:nth-child(odd),
.article-body tbody tr:nth-child(odd),
[data-article-body] tbody tr:nth-child(odd) {
  background: var(--panel);
}

.prose tbody tr:hover,
.article-body tbody tr:hover,
[data-article-body] tbody tr:hover {
  background: var(--accent-tint);
}

.prose code,
.article-body code,
[data-article-body] code {
  padding: 0.15em 0.4em;
  border-radius: var(--r-xs);
  background: var(--panel-2);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: var(--blog-small);
}

.prose pre,
.article-body pre,
[data-article-body] pre {
  position: relative;
  max-width: 100%;
  margin-block: 1.5rem;
  padding: 2.75rem 1.25rem 1.25rem;
  overflow-x: auto;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  background: var(--blog-code-bg);
  color: var(--blog-code-ink);
  font-family: var(--font-mono);
  font-size: var(--blog-small);
  line-height: 1.8;
  white-space: pre;
  overflow-wrap: normal;
}

.prose pre::before,
.article-body pre::before,
[data-article-body] pre::before {
  content: "配置 / 参考";
  position: absolute;
  top: 0.65rem;
  left: 1.25rem;
  color: var(--blog-code-ink);
  font-family: var(--font-body);
  font-size: var(--blog-caption);
}

.prose pre code,
.article-body pre code,
[data-article-body] pre code {
  padding: 0;
  border-radius: 0;
  background: var(--clear);
  color: inherit;
  font-size: inherit;
}

.callout,
.prose blockquote,
.article-body blockquote {
  position: relative;
  margin: 1.5rem 0;
  padding: 1.2rem 1.25rem 1.2rem 3.25rem;
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--r-md);
  background: var(--blog-tint);
  color: var(--text);
}

.callout::before,
.prose blockquote::before,
.article-body blockquote::before {
  content: "i";
  position: absolute;
  top: 1.25rem;
  left: 1rem;
  width: 1.35rem;
  height: 1.35rem;
  border: 1px solid currentColor;
  border-radius: var(--r-round);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: var(--blog-small);
  font-weight: var(--weight-bold);
  line-height: 1.35rem;
  text-align: center;
}

.callout--warning,
.callout.warning {
  border-left-color: var(--warn);
  background: var(--amber-tint);
  color: var(--amber-ink);
}

.callout--warning::before,
.callout.warning::before {
  content: "!";
  color: var(--amber-ink);
}

.callout--success,
.callout.success {
  border-left-color: var(--accent);
  background: var(--accent-tint);
  color: var(--accent-dark);
}

.callout--success::before,
.callout.success::before {
  color: var(--accent-dark);
}

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

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-block: 1.5rem;
}

.stat-card {
  min-width: 0;
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-top: 4px solid var(--sky);
  border-radius: var(--r-md);
  background: var(--sky-tint);
  color: var(--sky-ink);
}

.stat-card:nth-child(even) {
  border-top-color: var(--warn);
  background: var(--amber-tint);
  color: var(--amber-ink);
}

.stat-num {
  display: block;
  margin-bottom: 0.35rem;
  font-family: var(--font-display);
  font-size: var(--blog-stat);
  font-weight: var(--weight-bold);
  line-height: 1.35;
}

.stat-label {
  display: block;
  font-size: var(--blog-small);
  line-height: 1.8;
}

.prose .check-list,
.article-body .check-list,
[data-article-body] .check-list {
  margin-block: 1.5rem;
  padding: 0;
  list-style: none;
}

.check-list li {
  padding: 1rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--panel);
  list-style: none;
}

.verdict {
  margin-block: 1.5rem;
  padding: 1.15rem 1.4rem;
  border-left: 4px solid var(--accent);
  border-radius: var(--r-sm);
  background: var(--accent-tint);
  color: var(--text);
}

.verdict > :last-child {
  margin-bottom: 0;
}

.verdict strong {
  font-weight: var(--weight-bold);
}

.promo-block {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  margin-block: 2rem;
  padding: 1.75rem;
  border: 1px solid var(--accent-dark);
  border-radius: var(--r-lg);
  background: linear-gradient(125deg, var(--accent-dark), var(--accent));
  color: var(--white);
  box-shadow: var(--blog-shadow);
}

.promo-block h2 {
  display: block;
  margin: 0 0 0.5rem;
  padding: 0;
  border: 0;
  color: var(--white);
  font-family: var(--font-display);
  font-size: var(--blog-h2);
  line-height: 1.6;
  letter-spacing: var(--blog-tracking);
  text-wrap: pretty;
}

.promo-block h2::before {
  content: none;
}

.promo-block p {
  margin: 0;
  color: var(--white);
  font-size: var(--blog-body);
  line-height: var(--blog-leading);
}

.promo-block .cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.promo-block .btn--go {
  border: 1px solid var(--white);
  background: var(--white);
  color: var(--accent-dark);
  text-decoration: none;
}

.promo-block .btn--go:hover {
  background: var(--panel-2);
  color: var(--accent-dark);
}

.promo-block .btn--ghost {
  border: 1px solid var(--white);
  background: var(--clear);
  color: var(--white);
  text-decoration: none;
}

.promo-block .btn--ghost:hover {
  background: var(--accent-dark);
}

.promo-block :focus-visible {
  outline-color: var(--white);
}

.blog-list-promo {
  margin-top: 2.5rem;
}

#related-posts,
#post-nav {
  margin-block: 0;
  padding-block: 1.25rem;
}

#related-posts:empty,
#post-nav:empty {
  display: none;
}

.related-heading {
  display: block;
  margin: 0 0 1rem;
  font-family: var(--font-display);
  font-size: var(--blog-h2);
  line-height: 1.6;
  letter-spacing: var(--blog-tracking);
  text-wrap: pretty;
}

.related-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.related-card {
  padding: 1.25rem;
}

.related-card h3 {
  font-size: var(--blog-body);
}

.related-card .article-summary {
  font-size: var(--blog-small);
}

#post-nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.post-nav-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  gap: 0.65rem;
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-top: 3px solid var(--border-strong);
  border-radius: var(--r-md);
  background: var(--panel);
  color: var(--text);
  text-decoration: none;
  transition: border-color var(--speed) var(--ease-out),
    transform var(--speed) var(--ease-out);
}

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

.post-nav-card:hover,
.post-nav-card:focus-visible {
  border-color: var(--accent);
  transform: translateY(-3px);
}

.post-nav-label,
.post-nav-date {
  color: var(--muted);
  font-size: var(--blog-small);
  line-height: 1.7;
}

.post-nav-title {
  font-size: var(--blog-body);
  font-weight: var(--weight-semibold);
  line-height: 1.8;
  overflow-wrap: anywhere;
}

.post-nav-date {
  margin-top: auto;
  font-family: var(--font-mono);
}

@media (max-width: 860px) {
  .prose table,
  .article-body table,
  [data-article-body] table {
    display: block;
    width: fit-content;
    max-width: 100%;
    overflow-x: auto;
  }

  .prose .table-scroll table,
  .article-body .table-scroll table,
  [data-article-body] .table-scroll table {
    display: table;
    width: 100%;
    max-width: none;
  }

  .related-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .related-card h3 {
    font-size: var(--blog-h3);
  }
}

@media (max-width: 640px) {
  .no-break {
    white-space: normal;
  }

  .blog-post-grid,
  .stat-grid,
  #post-nav {
    grid-template-columns: minmax(0, 1fr);
  }

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

  .blog-filters {
    gap: 0.35rem;
    border-radius: var(--r-lg);
  }

  .blog-filter {
    padding-inline: 0.85rem;
  }

  .article-card {
    padding: 1.25rem;
  }

  .article-hero {
    width: calc(100% - 1rem);
    padding-block: 1.5rem;
  }

  .reading-wrap .article-hero {
    width: auto;
  }

  .promo-block {
    padding: 1.5rem;
  }

  .promo-block .cta-row {
    width: 100%;
  }

  .callout,
  .prose blockquote,
  .article-body blockquote {
    padding-right: 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .article-card,
  .post-nav-card,
  .blog-filter,
  .blog-skip {
    transition: none;
    animation: none;
  }

  .article-card:hover,
  .article-card:focus-within,
  .post-nav-card:hover,
  .post-nav-card:focus-visible {
    transform: none;
  }
}