/* 博客使用基础设计令牌；阅读列统一为 56rem。 */
.blog-page {
  color: var(--text);
  background: var(--bg);
  font-family: var(--font-body);
}

.blog-page *,
.blog-page *::before,
.blog-page *::after {
  box-sizing: border-box;
}

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

.blog-page [hidden] {
  display: none !important;
}

.blog-list-width {
  width: 100%;
  max-width: calc(72rem + 2 * max(1.5rem, var(--gutter)));
  margin-inline: auto;
  padding-inline: max(1.5rem, var(--gutter));
}

/* 不依赖 base.css 的阅读列宽度，面包屑、标题、正文共用左缘。 */
.reading-wrap,
.article-hero,
.breadcrumbs:not(.blog-list-width),
#related-posts,
#post-nav {
  box-sizing: border-box;
  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,
.reading-wrap .breadcrumbs,
.reading-wrap #related-posts,
.reading-wrap #post-nav {
  width: 100%;
  max-width: 100%;
  padding-inline: 0;
}

.blog-skip-link {
  position: fixed;
  z-index: 100;
  top: 1rem;
  left: 1rem;
  padding: 0.75rem 1.25rem;
  color: var(--on-dark);
  background: var(--accent-dark);
  border-radius: var(--r-pill);
  transform: translateY(-200%);
}

.blog-skip-link:focus {
  transform: translateY(0);
}

.blog-page a:focus-visible,
.blog-page button:focus-visible,
.article-body a:focus-visible,
.prose a:focus-visible,
#post-nav a:focus-visible,
#related-posts a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.breadcrumbs {
  padding-top: 1.5rem;
  padding-bottom: 1.25rem;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.8;
  overflow-wrap: anywhere;
}

.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.65rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

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

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

.blog-list-hero,
.article-hero {
  position: relative;
  isolation: isolate;
  padding-block: 2.5rem 2rem;
}

/* 大色块留在容器边界内，标题叠在其右下方，形成错位构图。 */
.blog-list-hero::before,
.article-hero::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: 0.5rem;
  right: 20%;
  bottom: 2.5rem;
  left: max(0.5rem, calc(var(--gutter) - 1rem));
  background: var(--navy-06);
  border-radius: var(--r-panel);
  pointer-events: none;
}

.blog-list-hero::after,
.article-hero::after {
  content: "";
  position: absolute;
  z-index: -1;
  top: 1.25rem;
  right: max(1.5rem, var(--gutter));
  width: 5.5rem;
  height: 0.5rem;
  background: linear-gradient(90deg, var(--accent), var(--cobalt));
  border-radius: var(--r-pill);
  pointer-events: none;
}

.blog-eyebrow {
  margin: 0 0 1rem;
  color: var(--accent);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.blog-list-hero h1,
.article-hero h1,
.article-card h2,
.article-card h3,
.reading-wrap h2,
.reading-wrap h3,
.article-body h2,
.article-body h3,
.prose h2,
.prose h3,
#related-posts h2 {
  display: block;
  font-family: var(--font-display);
  text-wrap: pretty;
  letter-spacing: -0.015em;
  overflow-wrap: break-word;
  word-break: normal;
}

.blog-list-hero h1 {
  margin: 0;
  max-width: 48rem;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 900;
  line-height: 1.18;
}

.blog-title-accent {
  color: var(--poppy);
}

.blog-hero-summary {
  max-width: 44rem;
  margin: 1.25rem 0 1.25rem 1rem;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.9;
}

.blog-fact-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-left: 1rem;
}

.blog-catalog {
  padding-top: 2rem;
  padding-bottom: 4rem;
}

.blog-catalog-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin-bottom: 1rem;
}

.blog-catalog-heading h2 {
  display: block;
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.3rem;
  line-height: 1.5;
  text-wrap: pretty;
  letter-spacing: normal;
}

#blog-list-status {
  margin: 0;
  color: var(--muted);
  font-size: 0.875rem;
}

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

.blog-filter {
  max-width: 100%;
  min-height: 2.75rem;
  padding: 0.6rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  color: var(--muted);
  background: var(--panel);
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.4;
  cursor: pointer;
  transition: border-color var(--fast) var(--ease), background var(--fast) var(--ease), color var(--fast) var(--ease);
}

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

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

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

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

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

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

.article-meta .tag {
  display: inline-block;
  max-width: 100%;
  padding: 0.25rem 0.75rem;
  border-radius: var(--r-pill);
  color: var(--on-dark);
  background: var(--accent);
  overflow-wrap: anywhere;
}

.article-meta time {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
}

.article-card h2,
.article-card h3 {
  margin: 1rem 0 0.75rem;
  font-size: 1.2rem;
  font-weight: 750;
  line-height: 1.65;
}

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

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

.article-card > p {
  margin: 0 0 1.25rem;
  color: var(--muted);
  font-size: 0.9375rem;
  line-height: 1.85;
  overflow-wrap: anywhere;
}

.article-read-link {
  align-self: flex-start;
  margin-top: auto;
  padding-block: 0.35rem;
  color: var(--accent);
  font-size: 0.875rem;
  font-weight: 700;
  text-decoration: none;
  text-underline-offset: 0.25em;
}

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

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

/* 文章标题沿用错位色块；摘要与元信息相对标题缩进。 */
.article-hero {
  padding-block: 2.25rem 1.75rem;
}

.article-hero h1 {
  margin: 1rem 0;
  color: var(--text);
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  font-weight: 850;
  line-height: 1.35;
}

.article-hero .article-meta,
.article-hero .article-summary,
.article-hero .article-lead,
.article-hero > p:not(.blog-eyebrow) {
  margin-left: 1rem;
}

.article-hero .article-meta {
  justify-content: flex-start;
}

.article-hero .article-meta time,
.article-hero .article-meta .read-time,
.article-hero .article-meta .reading-time,
.article-hero .article-meta > span:not(.tag) {
  display: inline-block;
  padding: 0.3rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  color: var(--muted);
  background: var(--panel);
  font-size: 0.8125rem;
}

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

.reading-wrap.section {
  padding-block: 0.5rem 1.75rem;
}

.article-body,
.prose {
  min-width: 0;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.9;
  overflow-wrap: break-word;
  counter-reset: blog-section;
}

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

.article-body p,
.prose p {
  margin-block: 1rem;
}

.article-body h2,
.prose h2 {
  position: relative;
  margin: 2.25rem 0 1rem;
  color: var(--text);
  font-size: clamp(1.3rem, 2.5vw, 1.6rem);
  font-weight: 800;
  line-height: 1.5;
  scroll-margin-top: var(--anchor-offset);
}

.article-body h2::before,
.prose h2::before {
  content: "";
  display: inline-block;
  width: 1.4rem;
  height: 0.25rem;
  margin-right: 0.6rem;
  border-radius: var(--r-pill);
  background: linear-gradient(90deg, var(--accent), var(--cobalt));
  vertical-align: 0.25em;
}

.article-body h3,
.prose h3 {
  margin: 1.75rem 0 0.75rem;
  font-size: clamp(1.1rem, 2vw, 1.3rem);
  font-weight: 750;
  line-height: 1.6;
}

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

.article-body li,
.prose li {
  margin-block: 0.5rem;
  padding-left: 0.15rem;
}

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

.article-body strong,
.prose strong {
  color: var(--text);
  font-weight: 750;
}

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

.article-body img,
.prose img {
  display: block;
  height: auto;
  margin-block: 1.5rem;
  border-radius: var(--r-mini);
}

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

.article-body figcaption,
.prose figcaption {
  margin-top: 0.6rem;
  color: var(--muted);
  font-size: 0.875rem;
  text-align: center;
}

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

.article-body :not(pre) > code,
.prose :not(pre) > code {
  padding: 0.15em 0.4em;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-small);
  color: var(--accent-dark);
  background: var(--panel-2);
  font-family: var(--font-mono);
  font-size: 0.875em;
  overflow-wrap: anywhere;
}

.article-body pre,
.prose pre {
  position: relative;
  max-width: 100%;
  margin-block: 1.5rem;
  padding: 2.75rem 1.25rem 1.25rem;
  overflow-x: auto;
  border: 1px solid var(--on-dark-line);
  border-radius: var(--r-mini);
  color: var(--on-dark);
  background: var(--accent-dark);
  font-family: var(--font-mono);
  font-size: 0.875rem;
  line-height: 1.8;
  tab-size: 2;
}

.article-body pre::before,
.prose pre::before {
  content: "VPNTie / 配置示例";
  position: absolute;
  top: 0.7rem;
  left: 1.25rem;
  color: var(--on-dark-muted);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.06em;
}

.article-body pre code,
.prose pre code {
  padding: 0;
  border: 0;
  color: inherit;
  background: none;
  font-family: inherit;
  font-size: inherit;
  white-space: pre;
  overflow-wrap: normal;
}

.article-body .table-scroll,
.prose .table-scroll {
  max-width: 100%;
  margin-block: 1.5rem;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  border: 1px solid var(--border);
  border-radius: var(--r-mini);
}

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

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

.article-body caption,
.prose caption {
  padding: 0.75rem 1rem;
  color: var(--muted);
  font-size: 0.875rem;
  text-align: left;
}

.article-body th,
.article-body td,
.prose th,
.prose td {
  min-width: 8rem;
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

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

.article-body tbody tr:nth-child(even),
.prose tbody tr:nth-child(even) {
  background: var(--navy-04);
}

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

.article-body tbody tr:last-child > *,
.prose tbody tr:last-child > * {
  border-bottom: 0;
}

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

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

.callout.warning,
.callout--warning {
  border-left-color: var(--warn);
  background: color-mix(in srgb, var(--warn) 10%, var(--panel));
}

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

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

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

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

.callout > :last-child,
.article-body blockquote > :last-child,
.prose 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.75rem;
}

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

.stat-card:nth-child(even) {
  border-color: color-mix(in srgb, var(--poppy) 20%, var(--border));
  border-top-color: var(--poppy);
  background: var(--poppy-tint);
}

.stat-num {
  display: block;
  color: var(--accent);
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 850;
  line-height: 1.35;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.stat-card:nth-child(even) .stat-num {
  color: var(--accent-dark);
}

.stat-label {
  display: block;
  margin-top: 0.5rem;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.75;
}

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

.article-body .check-list li,
.prose .check-list li,
.check-list li {
  margin-block: 0.65rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--r-tile);
  background: var(--panel);
  list-style: none;
}

.verdict {
  margin-block: 1.5rem;
  padding: 1.1rem 1.25rem;
  border-left: 4px solid var(--accent);
  border-radius: var(--r-small);
  color: var(--text);
  background: var(--navy-08);
  line-height: 1.9;
}

.verdict > :first-child {
  margin-top: 0;
}

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

.verdict strong:first-child {
  color: var(--accent);
}

/* 文末唯一推广区，深色丝带渐变与白色按钮。 */
.promo-block {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  width: calc(100% - 2 * max(1.5rem, var(--gutter)));
  max-width: 56rem;
  margin: 1.75rem auto;
  padding: 1.75rem;
  overflow: hidden;
  border: 1px solid var(--on-dark-line);
  border-radius: var(--r-card);
  color: var(--on-dark);
  background: linear-gradient(115deg, var(--accent-dark), var(--accent));
  box-shadow: var(--shadow-card);
}

.reading-wrap .promo-block,
.article-body .promo-block,
.prose .promo-block {
  width: 100%;
  max-width: 100%;
}

.promo-block::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: 1rem;
  right: 1rem;
  width: 6rem;
  height: 6rem;
  border: 1rem solid var(--white-18);
  border-radius: var(--r-round);
  pointer-events: none;
}

.promo-block h2 {
  display: block;
  margin: 0 0 0.5rem;
  color: var(--on-dark);
  font-family: var(--font-display);
  font-size: 1.5rem;
  line-height: 1.5;
  text-wrap: pretty;
  letter-spacing: normal;
}

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

.promo-block p {
  margin: 0;
  color: var(--on-dark-muted);
  font-size: 0.9375rem;
  line-height: 1.85;
}

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

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

.promo-block .btn-line {
  color: var(--on-dark);
  border-color: var(--on-dark-line);
  background: none;
}

.promo-block .btn-line:hover {
  color: var(--on-dark);
  background: var(--white-18);
}

.promo-block a:focus-visible {
  outline-color: var(--on-dark);
}

#related-posts {
  padding-top: 1.5rem;
  padding-bottom: 1.5rem;
}

#related-posts > h2 {
  margin: 0 0 1.25rem;
  color: var(--text);
  font-size: 1.5rem;
  line-height: 1.5;
}

#related-posts > h2::before {
  content: none;
}

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

.related-card {
  padding: 1.25rem;
}

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

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

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

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

.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 {
  color: var(--accent);
  font-size: 0.8125rem;
  font-weight: 700;
}

.post-nav-card strong {
  color: var(--text);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.75;
  overflow-wrap: break-word;
}

.post-nav-card time {
  margin-top: auto;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

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

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

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

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

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

  .blog-list-hero,
  .article-hero {
    padding-block: 1.75rem 1.25rem;
  }

  .blog-list-hero::before,
  .article-hero::before {
    right: 12%;
    bottom: 1.5rem;
  }

  .blog-list-hero::after,
  .article-hero::after {
    width: 3rem;
    top: 0.75rem;
  }

  .blog-hero-summary,
  .blog-fact-row,
  .article-hero .article-meta,
  .article-hero .article-summary,
  .article-hero .article-lead,
  .article-hero > p:not(.blog-eyebrow) {
    margin-left: 0.5rem;
  }

  .blog-catalog {
    padding-top: 1.25rem;
    padding-bottom: 2.5rem;
  }

  .article-card {
    padding: 1.25rem;
  }

  .article-body h2,
  .prose h2 {
    margin-top: 1.75rem;
  }

  .promo-block {
    padding: 1.5rem;
  }

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

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

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

  .article-body blockquote::before,
  .prose blockquote::before,
  .callout::before {
    left: 0.75rem;
  }
}

@media (min-width: 641px) {
  .no-break {
    white-space: nowrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  .blog-page *,
  .blog-page *::before,
  .blog-page *::after,
  .article-card,
  .post-nav-card {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }

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