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

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

.blog-index h1,
.blog-index h2,
.blog-index h3,
.article-hero h1,
.reading-wrap h1,
.reading-wrap h2,
.reading-wrap h3,
#related-posts h2,
#related-posts h3 {
  display: block;
  font-family: var(--font-display);
  font-weight: var(--weight-display);
  letter-spacing: -0.015em;
  text-wrap: pretty;
  overflow-wrap: anywhere;
}

.no-break {
  white-space: nowrap;
}

.breadcrumbs {
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.8;
}

.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.7rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.breadcrumbs li {
  min-width: 0;
  overflow-wrap: anywhere;
}

.breadcrumbs li + li::before {
  content: "/";
  margin-inline-end: 0.7rem;
  color: var(--muted);
}

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

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

.blog-list-hero .kicker {
  color: var(--accent);
  font-size: 0.875rem;
  font-weight: var(--weight-bold);
}

.blog-list-hero h1 {
  margin: 0.75rem 0 1rem;
  color: var(--accent);
  font-size: clamp(2rem, 4.5vw, 3rem);
  line-height: 1.3;
}

.blog-list-hero > p:last-child {
  max-width: 46rem;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.9;
}

.blog-library {
  padding-block: 0 2rem;
}

.blog-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  padding-block: 0.5rem 0.75rem;
}

.blog-filter {
  min-height: 2.75rem;
  padding: 0.6rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--panel);
  color: var(--accent);
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: var(--weight-semibold);
  line-height: 1.4;
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease),
    border-color var(--duration-fast) var(--ease),
    color var(--duration-fast) var(--ease);
}

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

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

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

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

.article-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  background: var(--panel);
  box-shadow: var(--shadow-card);
  transition: transform var(--duration-fast) var(--ease),
    border-color var(--duration-fast) var(--ease);
}

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

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

.article-meta .badge {
  padding: 0.3rem 0.75rem;
  border: 1px solid var(--accent);
  border-radius: var(--r-pill);
  background: var(--accent);
  color: var(--panel);
  font-weight: var(--weight-semibold);
}

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

.article-meta time {
  font-family: var(--font-mono);
}

.article-card h2,
.article-card h3 {
  margin: 1.15rem 0 0.8rem;
  color: var(--accent-dark);
  font-size: 1.25rem;
  line-height: 1.65;
}

.article-card h2 a,
.article-card h3 a {
  color: inherit;
  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 0 1.25rem;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.9;
  overflow-wrap: anywhere;
}

.article-read-link {
  align-self: flex-start;
  margin-top: auto;
  color: var(--accent);
  font-size: 0.9375rem;
  font-weight: var(--weight-bold);
  text-decoration: underline;
  text-underline-offset: 0.25em;
}

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

.blog-empty h2 {
  margin-top: 0;
  color: var(--accent);
  font-size: 1.25rem;
}

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

.blog-service-note {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.5rem;
  padding-block: 1rem 3rem;
  color: var(--muted);
  font-size: 0.9375rem;
  line-height: 1.8;
}

.blog-service-note p {
  margin: 0;
}

.blog-service-note a {
  color: var(--accent);
  text-underline-offset: 0.25em;
}

/* All article regions share the same content edge, including padded hero cards. */
.reading-wrap,
.article-hero,
.article-breadcrumbs,
.article-column {
  width: 100%;
  max-width: calc(56rem + 2 * max(1.5rem, var(--gutter)));
  margin-inline: auto;
  padding-inline: max(1.5rem, var(--gutter));
}

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

.article-hero {
  position: relative;
  isolation: isolate;
  margin-block: 0 1.75rem;
  padding-block: 2rem;
  border: 1px solid var(--border);
  border-radius: var(--r-stage);
  background: var(--panel-2);
  box-shadow: inset 0 1px 0 var(--hi);
}

.article-hero .article-meta,
.article-hero h1,
.article-hero > p {
  position: relative;
  z-index: 1;
  max-width: calc(100% - 8rem);
}

.article-hero h1 {
  margin: 1.25rem 0 1rem;
  color: var(--accent);
  font-size: clamp(1.8rem, 3.2vw, 2.6rem);
  line-height: 1.45;
}

.article-hero > p,
.article-hero .article-deck {
  margin-block: 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.9;
}

.article-stamp {
  position: absolute;
  top: 2rem;
  right: max(1.5rem, var(--gutter));
  display: grid;
  place-items: center;
  width: 6.5rem;
  height: 6.5rem;
  padding: 0.75rem;
  border: 1px solid var(--accent);
  border-radius: var(--r-circle);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 1.125rem;
  font-weight: var(--weight-bold);
  line-height: 1.4;
  text-align: center;
  transform: rotate(-11deg);
}

.article-stamp::before {
  content: "";
  position: absolute;
  inset: 0.3rem;
  border: 1px solid var(--accent);
  border-radius: inherit;
  pointer-events: none;
}

.article-stamp:empty::after {
  content: "VPN32";
}

.reading-wrap.prose,
.reading-wrap .prose,
[data-article-body] {
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.9;
  overflow-wrap: anywhere;
  counter-reset: blog-section;
}

.reading-wrap.prose,
.reading-wrap[data-article-body] {
  padding-block: 0 1rem;
}

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

.prose h2,
[data-article-body] h2 {
  display: block;
  position: relative;
  margin-block: 2.25rem 1rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--border);
  color: var(--accent);
  font-size: clamp(1.3rem, 2.2vw, 1.6rem);
  font-weight: var(--weight-display);
  line-height: 1.6;
  letter-spacing: -0.015em;
  text-wrap: pretty;
  counter-increment: blog-section;
  scroll-margin-top: var(--anchor-offset);
}

.prose h2::before,
[data-article-body] h2::before {
  content: counter(blog-section, decimal-leading-zero);
  display: inline-block;
  margin-inline-end: 0.65rem;
  padding: 0.12rem 0.45rem;
  border-radius: var(--r-small);
  background: var(--panel-2);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.75em;
  font-weight: var(--weight-bold);
  vertical-align: 0.1em;
}

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

.prose h3,
[data-article-body] h3 {
  display: block;
  margin-block: 1.6rem 0.75rem;
  color: var(--accent-dark);
  font-size: clamp(1.1rem, 2vw, 1.3rem);
  font-weight: var(--weight-bold);
  line-height: 1.65;
  letter-spacing: -0.01em;
  text-wrap: pretty;
}

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

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

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

.prose strong,
[data-article-body] strong {
  color: var(--accent-dark);
  font-weight: var(--weight-bold);
}

.prose code,
[data-article-body] code {
  padding: 0.15em 0.35em;
  border-radius: var(--r-small);
  background: var(--panel-2);
  color: var(--accent-dark);
  font-family: var(--font-mono);
  font-size: 0.875em;
  overflow-wrap: anywhere;
}

.prose pre,
[data-article-body] pre {
  position: relative;
  max-width: 100%;
  margin-block: 1.5rem;
  padding: 3rem 1.25rem 1.25rem;
  overflow-x: auto;
  border: 1px solid var(--accent);
  border-radius: var(--r-card);
  background: var(--accent-dark);
  color: var(--panel);
  line-height: 1.8;
  tab-size: 2;
}

.prose pre::before,
[data-article-body] pre::before {
  content: "VPN32 / 配置笔记";
  position: absolute;
  top: 0.75rem;
  left: 1.25rem;
  color: var(--panel);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  opacity: 0.85;
}

.prose pre code,
[data-article-body] pre code {
  padding: 0;
  background: var(--transparent);
  color: inherit;
  white-space: pre;
  overflow-wrap: normal;
}

.prose .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-menu);
}

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

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

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

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

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

.prose tbody tr:hover,
[data-article-body] tbody tr:hover {
  background: color-mix(in srgb, var(--accent) 12%, var(--panel));
}

.prose blockquote,
[data-article-body] blockquote,
.callout {
  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(--r-menu);
  background: var(--panel-2);
  color: var(--text);
}

.prose blockquote::before,
[data-article-body] blockquote::before,
.callout::before {
  content: "i";
  position: absolute;
  top: 1.3rem;
  left: 1rem;
  display: inline-grid;
  place-items: center;
  width: 1.5rem;
  height: 1.5rem;
  border: 1px solid currentColor;
  border-radius: var(--r-circle);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.875rem;
  font-weight: var(--weight-bold);
  line-height: 1;
}

.callout.warning,
.callout--warning,
.callout.is-warning {
  border-inline-start-color: var(--warn);
  background: color-mix(in srgb, var(--warn) 12%, var(--panel));
}

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

.callout.success,
.callout--success,
.callout.is-success {
  border-inline-start-color: var(--success);
  background: color-mix(in srgb, var(--success) 10%, var(--panel));
}

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

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

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr));
  gap: 1rem;
  margin-block: 1.5rem;
}

.stat-card {
  min-width: 0;
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-top: 3px solid var(--accent);
  border-radius: var(--r-card);
  background: var(--panel-2);
}

.stat-card:nth-child(even) {
  border-top-color: var(--success);
  background: color-mix(in srgb, var(--success) 8%, var(--panel));
}

.stat-num {
  display: block;
  margin-bottom: 0.4rem;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: var(--weight-bold);
  line-height: 1.5;
  overflow-wrap: anywhere;
}

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

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

.check-list li,
.prose .check-list li,
[data-article-body] .check-list li {
  margin: 0;
  padding: 1rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--r-menu);
  background: var(--panel);
  list-style: none;
}

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

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

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

.promo-block > div {
  flex: 1 1 18rem;
  min-width: 0;
}

.promo-block p {
  margin-block: 0 0.4rem;
  color: var(--panel);
  font-size: 1rem;
  line-height: 1.8;
}

.promo-block .promo-brand {
  color: var(--panel);
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: var(--weight-display);
}

.promo-block .btn-primary,
.prose .promo-block .btn-primary {
  flex-shrink: 0;
  border: 1px solid var(--panel);
  border-radius: var(--r-pill);
  background: var(--panel);
  color: var(--accent-dark);
  text-decoration: none;
}

.promo-block .btn-ghost,
.promo-block .btn-secondary {
  border: 1px solid var(--panel);
  background: var(--transparent);
  color: var(--panel);
}

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

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

#related-posts > h2 {
  margin-block: 0 1rem;
  color: var(--accent);
  font-size: 1.5rem;
  line-height: 1.6;
}

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

.related-card {
  padding: 1.25rem;
  box-shadow: none;
}

.related-card h3 {
  font-size: 1.125rem;
}

.related-card .article-summary {
  font-size: 0.9375rem;
}

.related-card .article-meta {
  gap: 0.4rem;
  font-size: 0.75rem;
}

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

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

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

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

.post-nav-label,
.post-nav-card time {
  color: var(--muted);
  font-size: 0.8125rem;
  line-height: 1.6;
}

.post-nav-title {
  color: var(--accent-dark);
  font-size: 1rem;
  font-weight: var(--weight-bold);
  line-height: 1.8;
  overflow-wrap: anywhere;
}

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

.float-cta {
  position: fixed;
  z-index: 30;
  right: max(1.25rem, env(safe-area-inset-right));
  bottom: max(1.25rem, env(safe-area-inset-bottom));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  max-width: calc(100vw - 2.5rem);
  min-height: 3rem;
  padding: 0.8rem 1.3rem;
  border: 1px solid var(--accent);
  border-radius: var(--r-pill);
  background: linear-gradient(115deg, var(--accent), var(--sky));
  color: var(--panel);
  box-shadow: var(--shadow-card);
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: var(--weight-bold);
  line-height: 1.5;
  text-decoration: none;
}

.float-cta svg {
  flex: 0 0 auto;
  width: 1.25rem;
  height: 1.25rem;
}

.blog-filter:focus-visible,
.article-card a:focus-visible,
.post-nav-card:focus-visible,
.breadcrumbs a:focus-visible,
.promo-block a:focus-visible,
.float-cta:focus-visible,
.table-scroll:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
}

.promo-block a:focus-visible,
.float-cta:focus-visible {
  outline-color: var(--panel);
  box-shadow: 0 0 0 6px var(--accent-dark);
}

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

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

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

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

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

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

  .article-card {
    padding: 1.25rem;
  }

  .article-hero {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding-block: 1.5rem;
  }

  .article-hero .article-meta,
  .article-hero h1,
  .article-hero > p {
    max-width: 100%;
  }

  .article-stamp {
    position: relative;
    top: auto;
    right: auto;
    align-self: flex-end;
    width: 4.5rem;
    height: 4.5rem;
    margin-block: 0.5rem;
    font-size: 0.8125rem;
  }

  .article-hero h1 {
    font-size: clamp(1.6rem, 6vw, 2.1rem);
  }

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

  .promo-block {
    padding: 1.5rem;
  }

  .float-cta {
    position: static;
    display: flex;
    width: fit-content;
    max-width: calc(100% - 3rem);
    margin: 1.5rem auto;
  }
}

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

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

/* fab-guard:start */
@supports (animation-timeline:scroll()){
  .float-cta{animation:fab-guard-in linear both;animation-timeline:scroll(root);animation-range:0 60vh}
}
@keyframes fab-guard-in{0%,40%{opacity:0;visibility:hidden}100%{opacity:1;visibility:visible}}
body:has(.float-cta) > footer:last-of-type{padding-bottom:calc(88px + env(safe-area-inset-bottom,0px))!important}
body:has(.float-cta):not(:has(> footer)){padding-bottom:calc(88px + env(safe-area-inset-bottom,0px))!important}
/* fab-guard:end */
