:root {
  --blog-reading: 56rem;
  --blog-gutter: max(1.5rem, var(--gutter));
  --blog-title-list: clamp(2rem, 4.6vw, 3rem);
  --blog-title-article: clamp(1.8rem, 3.6vw, 2.6rem);
  --blog-title-section: clamp(1.3rem, 2.5vw, 1.6rem);
  --blog-title-small: 1.3rem;
  --blog-body-size: 1rem;
  --blog-small-size: 0.875rem;
  --blog-line-height: 1.85;
  --blog-heading-spacing: -0.015em;
  --blog-tint: color-mix(in srgb, var(--accent) 12%, var(--bg-panel));
  --blog-success-tint: color-mix(in srgb, var(--success) 9%, var(--bg-panel));
  --blog-warning-tint: color-mix(in srgb, var(--warn) 12%, var(--bg-panel));
  --blog-line: color-mix(in srgb, var(--border) 75%, var(--bg-panel));
  --blog-promo-start: var(--text);
  --blog-promo-end: color-mix(in srgb, var(--text) 80%, var(--accent));
  --blog-focus: 0 0 0 3px var(--accent-soft);
  --blog-shadow: 0 12px 36px var(--accent-10);
  --blog-motion: 180ms ease;
}

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

.blog-index *,
.blog-article * {
  box-sizing: border-box;
}

.blog-index main,
.blog-article main,
.blog-card-grid > *,
.related-grid > *,
#post-nav > * {
  min-width: 0;
}

.blog-index h1,
.blog-index h2,
.blog-index h3,
.blog-article h1,
.blog-article h2,
.blog-article h3,
.article-hero h1,
.article-body h2,
.article-body h3 {
  display: block;
  font-family: var(--font-display);
  font-weight: var(--weight-regular);
  letter-spacing: var(--blog-heading-spacing);
  text-wrap: pretty;
  overflow-wrap: anywhere;
}

.blog-skip {
  position: absolute;
  z-index: 100;
  inset-inline-start: 1rem;
  top: -6rem;
  padding: 0.75rem 1.25rem;
  color: var(--on-dark);
  background: var(--text);
  border-radius: var(--radius-pill);
}

.blog-skip:focus {
  top: 1rem;
}

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

.breadcrumbs a,
.breadcrumb a {
  color: var(--text-muted);
  text-underline-offset: 0.25em;
}

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

.blog-list-hero {
  position: relative;
  isolation: isolate;
  padding: 2.5rem 2rem 3rem;
  margin-block: 0 2rem;
}

.blog-list-hero::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 1rem 0 1rem 23%;
  border-radius: var(--radius-tray);
  background: var(--blog-tint);
}

.blog-eyebrow {
  margin: 0 0 1rem;
  color: var(--text-muted);
  font-size: var(--blog-small-size);
  font-weight: var(--weight-medium);
}

.blog-list-hero h1 {
  margin: 0 0 1.25rem;
  font-size: var(--blog-title-list);
  line-height: 1.25;
}

.blog-lead {
  max-width: 38rem;
  margin-block: 0 1.25rem;
  color: var(--text-muted);
  font-size: var(--blog-body-size);
  line-height: var(--blog-line-height);
}

.blog-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.blog-filter {
  max-width: 100%;
  min-height: 2.75rem;
  padding: 0.6rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  color: var(--text-muted);
  background: var(--bg-panel);
  font: inherit;
  font-size: var(--blog-small-size);
  line-height: 1.5;
  white-space: normal;
  cursor: pointer;
  transition: border-color var(--blog-motion), background var(--blog-motion);
}

.blog-filter::before {
  content: "";
  display: inline-block;
  width: 0.4rem;
  height: 0.4rem;
  margin-inline-end: 0.5rem;
  border-radius: var(--radius-round);
  background: var(--border);
  vertical-align: middle;
}

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

.blog-filter[aria-pressed="true"]::before {
  background: var(--accent);
}

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

.blog-result-status {
  margin-block: 1.25rem;
  color: var(--text-muted);
  font-size: var(--blog-small-size);
  line-height: 1.8;
}

.blog-card-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;
  min-width: 0;
  padding: 1.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-tray);
  background: var(--bg-panel);
  box-shadow: inset 0 1px 0 var(--hi-line);
  transition: border-color var(--blog-motion), box-shadow var(--blog-motion);
}

.article-card:hover,
.article-card:focus-within {
  border-color: var(--accent);
  box-shadow: var(--blog-shadow);
}

.article-meta {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
  color: var(--text-muted);
  font-size: var(--blog-small-size);
  line-height: 1.6;
}

.article-meta .tag {
  display: inline-block;
  max-width: 100%;
  height: auto;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-pill);
  background: var(--text);
  color: var(--on-dark);
  white-space: normal;
}

.article-meta time,
.article-meta .read-time,
.article-meta .reading-time {
  padding: 0.3rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
}

.article-card h3 {
  margin: 0;
  font-size: var(--blog-title-small);
  line-height: 1.6;
}

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

.article-card h3 a:hover {
  color: var(--accent-dark);
}

.article-card > p {
  margin: 0;
  color: var(--text-muted);
  font-size: var(--blog-body-size);
  line-height: var(--blog-line-height);
  overflow-wrap: anywhere;
}

.article-link {
  align-self: flex-start;
  margin-top: auto;
  color: var(--accent-dark);
  font-size: var(--blog-small-size);
  font-weight: var(--weight-medium);
  text-decoration: none;
  text-underline-offset: 0.25em;
}

.article-link:hover {
  text-decoration: underline;
}

.blog-empty {
  grid-column: 1 / -1;
  padding: 2rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius-tray);
  background: var(--bg-panel-2);
  color: var(--text-muted);
  line-height: var(--blog-line-height);
}

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

.reading-wrap .reading-wrap {
  max-width: 100%;
  padding-inline: 0;
}

.article-hero {
  position: relative;
  isolation: isolate;
  padding-block: 2rem 2.25rem;
  margin-block: 0 1rem;
}

.article-hero::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: 0.75rem;
  right: var(--blog-gutter);
  bottom: 0.75rem;
  left: 22%;
  border: 1px solid var(--accent-14);
  border-radius: var(--radius-tray);
  background: var(--blog-tint);
  box-shadow: inset 0 1px 0 var(--hi-line);
  pointer-events: none;
}

.article-hero::after {
  content: "";
  position: absolute;
  z-index: -1;
  top: 1.5rem;
  right: calc(var(--blog-gutter) + 1rem);
  width: 3rem;
  height: 3rem;
  border-radius: var(--radius-round);
  border: 1px solid var(--accent-22);
  background: radial-gradient(circle at 30% 25%, var(--bg-panel), var(--accent-soft));
  pointer-events: none;
}

.article-hero h1 {
  position: relative;
  margin-block: 1.1rem;
  font-size: var(--blog-title-article);
  line-height: 1.45;
}

.article-hero .article-meta,
.article-hero .article-summary,
.article-hero .article-deck,
.article-hero > p {
  margin-inline-start: clamp(0rem, 2vw, 1.5rem);
}

.article-hero .article-meta {
  position: relative;
  max-width: calc(100% - 3rem);
}

.article-summary,
.article-deck,
.article-hero > p {
  margin-block: 1rem 0;
  color: var(--text-muted);
  font-size: var(--blog-body-size);
  line-height: var(--blog-line-height);
  overflow-wrap: anywhere;
}

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

.article-body h2,
.blog-article .prose h2,
[data-blog-body] h2 {
  margin-block: 2.25rem 1rem;
  font-size: var(--blog-title-section);
  line-height: 1.6;
  scroll-margin-top: var(--anchor-offset);
}

.article-body h2::before,
.blog-article .prose h2::before,
[data-blog-body] h2::before {
  counter-increment: blog-section;
  content: counter(blog-section, decimal-leading-zero);
  display: inline-block;
  margin-inline-end: 0.7rem;
  padding: 0.1rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--bg-panel-2);
  color: var(--accent-dark);
  font-family: var(--font-mono);
  font-size: var(--blog-small-size);
  font-weight: var(--weight-medium);
  vertical-align: 0.15em;
}

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

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

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

.article-body ul,
.article-body ol,
.blog-article .prose ul,
.blog-article .prose ol {
  padding-inline-start: 1.5rem;
  margin-block: 1rem 1.5rem;
}

.article-body li,
.blog-article .prose li {
  margin-block: 0.45rem;
}

.article-body a,
.blog-article .prose a {
  color: var(--accent-dark);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
}

.article-body strong,
.blog-article .prose strong {
  font-weight: var(--weight-bold);
}

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

.article-body :not(pre) > code,
.blog-article .prose :not(pre) > code {
  padding: 0.12rem 0.35rem;
  border-radius: var(--radius-line);
  background: var(--bg-panel-2);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: var(--blog-small-size);
  white-space: normal;
  overflow-wrap: anywhere;
}

.article-body pre,
.blog-article .prose pre {
  position: relative;
  max-width: 100%;
  margin-block: 1.5rem;
  padding: 2.8rem 1.25rem 1.25rem;
  overflow-x: auto;
  border: 1px solid var(--text-muted);
  border-radius: var(--radius-cell);
  background: var(--text);
  color: var(--on-dark);
  line-height: 1.8;
  tab-size: 2;
}

.article-body pre::before,
.blog-article .prose pre::before {
  content: "配置参考";
  position: absolute;
  top: 0.65rem;
  left: 1.25rem;
  color: var(--on-dark);
  font-family: var(--font-body);
  font-size: var(--blog-small-size);
}

.article-body pre code,
.blog-article .prose pre code {
  padding: 0;
  border: 0;
  background: var(--transparent);
  color: inherit;
  font-family: var(--font-mono);
  font-size: var(--blog-small-size);
  white-space: pre;
  overflow-wrap: normal;
}

.article-body .table-scroll,
.blog-article .prose .table-scroll {
  width: 100%;
  max-width: 100%;
  margin-block: 1.5rem;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-cell);
}

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

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

.article-body th,
.article-body td,
.blog-article .prose th,
.blog-article .prose td {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--border);
  text-align: start;
  vertical-align: top;
}

.article-body thead th,
.blog-article .prose thead th {
  background: var(--text);
  color: var(--on-dark);
  font-weight: var(--weight-medium);
}

.article-body tbody tr,
.blog-article .prose tbody tr {
  background: var(--bg-panel);
}

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

.article-body tbody tr:hover,
.blog-article .prose tbody tr:hover {
  background: var(--blog-tint);
}

.callout,
.article-body blockquote,
.blog-article .prose blockquote {
  position: relative;
  margin: 1.5rem 0;
  padding: 1.25rem 1.25rem 1.25rem 3.5rem;
  border: 1px solid var(--border);
  border-inline-start: 4px solid var(--accent);
  border-radius: var(--radius-cell);
  background: var(--blog-tint);
  color: var(--text);
}

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

.callout--warning,
.callout.warning {
  border-inline-start-color: var(--warn);
  background: var(--blog-warning-tint);
}

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

.callout--success,
.callout.success {
  border-inline-start-color: var(--success);
  background: var(--blog-success-tint);
}

.callout--success::before,
.callout.success::before {
  content: "i";
  color: var(--success);
}

.callout > :last-child,
.article-body blockquote > :last-child,
.blog-article .prose 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.5rem;
  border: 1px solid var(--border);
  border-top: 3px solid var(--accent);
  border-radius: var(--radius-cell);
  background: var(--blog-tint);
}

.stat-card:nth-child(even) {
  border-top-color: var(--text-muted);
  background: var(--bg-panel-2);
}

.stat-num {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: var(--blog-title-section);
  line-height: 1.5;
  overflow-wrap: anywhere;
}

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

.article-body .check-list,
.blog-article .prose .check-list,
.check-list {
  display: grid;
  gap: 0.7rem;
  padding: 0;
  margin-block: 1.5rem;
  list-style: none;
}

.check-list > li {
  margin: 0;
  padding: 0.9rem 1.1rem;
  border: 1px solid var(--blog-line);
  border-radius: var(--radius-cell);
  background: var(--bg-panel);
  list-style: none;
}

.verdict {
  margin-block: 1.5rem;
  padding: 1.1rem 1.25rem;
  border-inline-start: 4px solid var(--accent);
  border-radius: var(--radius-cell);
  background: var(--bg-panel-2);
  color: var(--text);
}

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

.blog-promo,
.blog-article .promo-block {
  position: relative;
  isolation: isolate;
  display: block;
  overflow: hidden;
  margin-block: 2.5rem 2rem;
  padding: 2rem;
  border: 1px solid var(--text-muted);
  border-radius: var(--radius-tray);
  background: linear-gradient(120deg, var(--blog-promo-start), var(--blog-promo-end));
  color: var(--on-dark);
}

.blog-promo::before,
.blog-article .promo-block::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0.55rem;
  border: 1px solid var(--hi-soft);
  border-radius: var(--radius-tray);
  pointer-events: none;
}

.blog-promo h2,
.blog-article .promo-block h2 {
  margin: 0 0 0.75rem;
  color: var(--on-dark);
  font-size: var(--blog-title-section);
  line-height: 1.6;
}

.blog-promo p,
.blog-article .promo-block p {
  max-width: 44rem;
  margin: 0 0 1.5rem;
  color: var(--on-dark);
  font-size: var(--blog-body-size);
  line-height: var(--blog-line-height);
}

.blog-promo .cta-pair,
.blog-article .promo-block .cta-pair {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.blog-promo .btn,
.blog-article .promo-block .btn {
  border: 1px solid var(--bg-panel);
  border-radius: var(--radius-pill);
  background: var(--bg-panel);
  color: var(--text);
}

.blog-promo .btn-secondary,
.blog-article .promo-block .btn-secondary {
  background: var(--transparent);
  color: var(--on-dark);
}

.blog-promo .btn:hover,
.blog-article .promo-block .btn:hover {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--text);
}

#related-posts {
  padding-block: 1.5rem 1rem;
}

#related-posts > h2 {
  margin-block: 0 1rem;
  font-size: var(--blog-title-section);
  line-height: 1.6;
}

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

.related-card {
  padding: 1.25rem;
  border-radius: var(--radius-cell);
}

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

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

.post-nav-card {
  display: block;
  min-width: 0;
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-top: 3px solid var(--border);
  border-radius: var(--radius-cell);
  background: var(--bg-panel);
  color: var(--text);
  text-decoration: none;
  overflow-wrap: anywhere;
  transition: border-color var(--blog-motion), background var(--blog-motion);
}

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

.post-nav-card:hover,
.post-nav-card:focus-visible {
  border-color: var(--accent);
  background: var(--blog-tint);
}

.post-nav-caption,
.post-nav-card time {
  display: block;
  color: var(--text-muted);
  font-size: var(--blog-small-size);
  line-height: 1.7;
}

.post-nav-card strong {
  display: block;
  margin-block: 0.65rem;
  font-size: var(--blog-body-size);
  font-weight: var(--weight-medium);
  line-height: 1.8;
}

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

.float-cta {
  position: fixed;
  z-index: 40;
  right: max(1.5rem, env(safe-area-inset-right));
  bottom: max(1.5rem, env(safe-area-inset-bottom));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  max-width: calc(100vw - 3rem);
  min-height: 3rem;
  padding: 0.85rem 1.3rem;
  border: 1px solid var(--bg-panel);
  border-radius: var(--radius-pill);
  background: var(--text);
  color: var(--on-dark);
  box-shadow: var(--blog-shadow);
  font-family: var(--font-body);
  font-size: var(--blog-small-size);
  font-weight: var(--weight-medium);
  line-height: 1.5;
  text-decoration: none;
  transition: background var(--blog-motion);
}

.float-cta svg {
  flex: 0 0 auto;
  width: 1.1rem;
  height: 1.1rem;
  fill: none;
  stroke: currentColor;
}

.float-cta:hover {
  background: var(--accent-dark);
}

.blog-index a:focus-visible,
.blog-article a:focus-visible,
.blog-filter:focus-visible,
.table-scroll:focus-visible {
  outline: 2px solid var(--accent-dark);
  outline-offset: 4px;
}

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

  .article-body th,
  .article-body td,
  .blog-article .prose th,
  .blog-article .prose td {
    min-width: 9rem;
  }

  .related-grid {
    grid-template-columns: 1fr;
  }
}

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

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

  .blog-list-hero::before {
    left: 16%;
  }

  .blog-card-grid,
  .stat-grid,
  #post-nav {
    grid-template-columns: 1fr;
  }

  .article-card {
    padding: 1.25rem;
  }

  .article-hero {
    padding-block: 1.5rem;
  }

  .article-hero::before {
    left: 15%;
  }

  .article-hero .article-meta {
    max-width: 100%;
    padding-inline-end: 1.75rem;
  }

  .article-hero .article-meta,
  .article-hero .article-summary,
  .article-hero .article-deck,
  .article-hero > p {
    margin-inline-start: 0;
  }

  .article-hero::after {
    width: 1.5rem;
    height: 1.5rem;
    right: calc(var(--blog-gutter) + 0.25rem);
  }

  .blog-promo,
  .blog-article .promo-block {
    padding: 1.5rem;
  }

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

  .float-cta {
    right: max(1rem, env(safe-area-inset-right));
    bottom: max(0.75rem, env(safe-area-inset-bottom));
    max-width: calc(100vw - 2rem);
    min-height: 2.75rem;
    padding: 0.7rem 1rem;
  }

  .blog-article:has(.float-cta) {
    padding-bottom: calc(5rem + env(safe-area-inset-bottom));
    scroll-padding-bottom: 5rem;
  }

  .callout,
  .article-body blockquote,
  .blog-article .prose blockquote {
    padding-inline-end: 1rem;
  }
}

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