/* ==========================================================================
   39VPN 博客系统样式(列表页 + 文章页)
   阅读列 56rem(896px,52~57rem 区间),全部颜色引用 base.css 设计令牌
   ========================================================================== */

:root {
  --blog-col: 56rem;
}

/* --------------------------------------------------------------------------
   1. 共用阅读列:面包屑 / hero / 正文 / 上下篇 / 延伸阅读 同一条列并居中
   正文盒宽 = 阅读列 + 2×gutter,内衬与 hero 同值(对齐 h2 左缘)
   -------------------------------------------------------------------------- */

.blog-col,
.reading-wrap,
.article-hero,
.breadcrumb,
#post-nav,
#related-posts {
  width: min(100%, calc(var(--blog-col) + 2 * var(--gutter)));
  max-width: calc(var(--blog-col) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
  box-sizing: border-box;
}

/* --------------------------------------------------------------------------
   2. 面包屑(与页头留呼吸间距,不紧贴 header 底边)
   -------------------------------------------------------------------------- */

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin-top: clamp(1.5rem, 4vw, 2.5rem);
  margin-bottom: 1.25rem;
  font-size: 0.88rem;
  color: var(--muted);
}

.breadcrumb a {
  color: var(--muted);
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--accent-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.breadcrumb .crumb-sep {
  color: var(--border-strong);
}

.breadcrumb .crumb-current {
  color: var(--text);
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   3. 窗口栏卡片(window-chrome 母题:红黄绿灯 + 等宽伪文件名)
   -------------------------------------------------------------------------- */

.win-card {
  position: relative;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-win);
  overflow: hidden;
}

.win-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem 1.25rem;
  background: linear-gradient(180deg, var(--bg-panel) 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--border);
}

.win-bar::before {
  content: "";
  flex: none;
  width: 44px;
  height: 12px;
  background-image:
    radial-gradient(circle at 7px 6px, var(--err) 0 5px, transparent 5.6px),
    radial-gradient(circle at 22px 6px, var(--warn) 0 5px, transparent 5.6px),
    radial-gradient(circle at 37px 6px, var(--ok) 0 5px, transparent 5.6px);
}

.win-file {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  color: var(--muted);
}

.win-card-body {
  padding: clamp(1.6rem, 4vw, 2.6rem) clamp(1.5rem, 4vw, 2.4rem);
}

/* --------------------------------------------------------------------------
   4. 列表页 hero(H1 ≤3rem)+ 筛选工具条 + 文章卡网格
   -------------------------------------------------------------------------- */

.blog-hero {
  position: relative;
  padding: clamp(2.5rem, 6vw, 4.5rem) 0 clamp(1.5rem, 4vw, 2rem);
  background-image:
    radial-gradient(38rem 18rem at 12% 0%, color-mix(in srgb, var(--gold) 14%, transparent), transparent 70%),
    radial-gradient(42rem 20rem at 88% 10%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 70%),
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: auto, auto, 34px 34px, 34px 34px;
}

.blog-hero h1 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.75rem, 4.5vw, 3rem);
  line-height: 1.18;
  letter-spacing: -0.01em;
  color: var(--text);
  margin: 0 0 0.8rem;
  text-wrap: pretty;
}

.grad-text {
  background: linear-gradient(92deg, var(--gold), var(--pink) 48%, var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.blog-hero-sub {
  font-size: 1.02rem;
  line-height: 1.8;
  color: var(--muted);
  margin: 0;
  max-width: 46rem;
}

.blog-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  padding-top: 0.4rem;
  padding-bottom: 1.6rem;
}

.blog-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.filter-btn {
  appearance: none;
  font-family: var(--font-body);
  font-size: 0.9rem;
  padding: 0.45rem 1.15rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--bg);
  color: var(--muted);
  cursor: pointer;
  transition: color 0.18s, border-color 0.18s, background 0.18s;
}

.filter-btn:hover {
  color: var(--text);
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
}

.filter-btn.on {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
  font-weight: 600;
}

.blog-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--gutter);
  padding-bottom: clamp(3rem, 7vw, 4.5rem);
}

.blog-empty {
  grid-column: 1 / -1;
  padding: 2.5rem 1.5rem;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--bg-panel);
}

/* 文章卡(列表页与延伸阅读共用,动态渲染节点不带淡入类) */

.article-card {
  display: flex;
  flex-direction: column;
  transition: transform 0.22s, border-color 0.22s, box-shadow 0.22s;
}

.article-card .article-summary {
  flex: 1;
}

.article-card .article-title {
  text-wrap: pretty;
  letter-spacing: -0.01em;
}

.article-card:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
  box-shadow: var(--shadow-card);
}

.article-more {
  margin-top: 1rem;
  color: var(--accent-dark);
  font-weight: 600;
  font-size: 0.9rem;
}

.article-card:hover .article-more {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* --------------------------------------------------------------------------
   5. 文章页 hero(window-chrome:窗口栏 → meta 胶囊行 → H1 → 摘要)
   hero 是带边框卡片:容器向两侧加宽(边框+内衬的量),让卡片内衬吃掉扩宽,
   H1 与正文列左缘对齐(2026-08-08 单列式拍板;严禁清零 win-card-body 内衬)
   -------------------------------------------------------------------------- */

.article-hero {
  width: min(100%, calc(var(--blog-col) + 2 * (var(--gutter) + 2.4rem + 1px)));
  max-width: calc(var(--blog-col) + 2 * (var(--gutter) + 2.4rem + 1px));
  margin-bottom: clamp(1.4rem, 4vw, 2.2rem);
}

.article-hero .win-card-body {
  padding-top: clamp(1.4rem, 3.5vw, 2rem);
}

.article-hero-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.1rem;
}

.meta-tag {
  display: inline-flex;
  align-items: center;
  background: var(--accent);
  color: var(--bg);
  border-radius: var(--radius-pill);
  padding: 0.28rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 600;
}

.meta-pill {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: var(--radius-pill);
  padding: 0.26rem 0.8rem;
  font-size: 0.8rem;
  font-family: var(--font-mono);
}

.article-hero h1 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.65rem, 4vw, 2.6rem);
  line-height: 1.22;
  letter-spacing: -0.01em;
  color: var(--text);
  margin: 0 0 1rem;
  text-wrap: pretty;
}

.article-lead {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--muted);
  margin: 0;
}

/* --------------------------------------------------------------------------
   6. 正文排版(1rem / 1.85 行高,H2 ≤1.6rem 带编号徽,H3 ≤1.3rem)
   -------------------------------------------------------------------------- */

.article-body {
  counter-reset: blog-h2;
  font-size: 1rem;
  line-height: 1.85;
  color: var(--text);
}

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

.article-body p,
.article-body ul,
.article-body ol {
  margin: 0 0 1.15em;
}

.article-body ul,
.article-body ol {
  padding-left: 1.4em;
}

.article-body li {
  margin-bottom: 0.45em;
}

.article-body a {
  color: var(--accent-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.article-body h2,
.article-body h3 {
  font-family: var(--font-display);
  color: var(--text);
  letter-spacing: -0.01em;
  text-wrap: pretty;
}

.article-body h2 {
  counter-increment: blog-h2;
  position: relative;
  font-size: clamp(1.3rem, 3vw, 1.6rem);
  font-weight: 800;
  line-height: 1.35;
  margin: 2.6rem 0 1rem;
  padding-left: 2.9rem;
}

.article-body h2::before {
  content: counter(blog-h2, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 0.15em;
  font-family: var(--font-mono);
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, var(--bg));
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border));
  border-radius: var(--radius-md);
  padding: 0.18rem 0.5rem;
}

.article-body h3 {
  font-size: clamp(1.1rem, 2.4vw, 1.3rem);
  font-weight: 700;
  line-height: 1.4;
  margin: 1.9rem 0 0.8rem;
}

.article-body hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2.4rem 0;
}

.article-body img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-md);
}

.article-body figure {
  margin: 1.8rem 0;
}

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

.article-body blockquote {
  margin: 1.6rem 0;
  padding: 0.9rem 1.3rem;
  border-left: 4px solid var(--accent);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  background: color-mix(in srgb, var(--accent) 5%, var(--bg));
  color: var(--muted);
}

.article-body blockquote p {
  margin: 0;
}

/* --------------------------------------------------------------------------
   7. 正文表格:实色表头 + 斑马纹 + hover 行,窄屏整体可横滑
   -------------------------------------------------------------------------- */

.article-body table {
  width: 100%;
  margin: 1.8rem 0;
  border-collapse: collapse;
  font-size: 0.92rem;
  line-height: 1.6;
}

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

.article-body thead th {
  background: var(--bg-deep);
  color: var(--deep-text);
  border-color: var(--deep-line);
  font-weight: 700;
  white-space: nowrap;
}

.article-body tbody tr:nth-child(even) {
  background: color-mix(in srgb, var(--accent) 4%, var(--bg));
}

.article-body tbody tr:hover {
  background: color-mix(in srgb, var(--accent) 9%, var(--bg));
}

@media (max-width: 860px) {
  .article-body table {
    display: block;
    width: fit-content;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* --------------------------------------------------------------------------
   8. 代码块:深底终端窗(红黄绿灯角签),行内代码浅蓝 tint
   -------------------------------------------------------------------------- */

.article-body pre {
  position: relative;
  margin: 1.8rem 0;
  padding: 2.5rem 1.3rem 1.2rem;
  background: var(--bg-deep);
  border: 1px solid var(--deep-line);
  border-radius: var(--radius-md);
  color: var(--deep-text);
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.87rem;
  line-height: 1.75;
}

.article-body pre::before {
  content: "";
  position: absolute;
  top: 0.85rem;
  left: 1.1rem;
  width: 44px;
  height: 12px;
  background-image:
    radial-gradient(circle at 7px 6px, var(--err) 0 5px, transparent 5.6px),
    radial-gradient(circle at 22px 6px, var(--warn) 0 5px, transparent 5.6px),
    radial-gradient(circle at 37px 6px, var(--ok) 0 5px, transparent 5.6px);
}

.article-body pre code {
  background: none;
  border: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
}

.article-body code {
  font-family: var(--font-mono);
}

.article-body p > code,
.article-body li > code,
.article-body td > code {
  font-size: 0.88em;
  padding: 0.12em 0.4em;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: color-mix(in srgb, var(--accent) 8%, var(--bg));
  color: var(--accent-dark);
}

/* --------------------------------------------------------------------------
   9. callout:左色条 + 圆形图标徽,info / warn / ok 三变体配 tint 底
   -------------------------------------------------------------------------- */

.article-body .callout {
  position: relative;
  margin: 1.8rem 0;
  padding: 1.05rem 1.25rem 1.05rem 3.1rem;
  border: 1px solid color-mix(in srgb, var(--accent) 25%, var(--border));
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--accent) 6%, var(--bg));
}

.article-body .callout::before {
  content: "i";
  position: absolute;
  left: 0.95rem;
  top: 1.05rem;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 50%;
  background: var(--accent);
  color: var(--bg);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.85rem;
  line-height: 1.35rem;
  text-align: center;
}

.article-body .callout p {
  margin: 0;
}

.article-body .callout p + p {
  margin-top: 0.6em;
}

.article-body .callout.callout-warn {
  border-color: color-mix(in srgb, var(--warn) 30%, var(--border));
  border-left-color: var(--warn);
  background: color-mix(in srgb, var(--warn) 8%, var(--bg));
}

.article-body .callout.callout-warn::before {
  content: "!";
  background: var(--warn);
}

.article-body .callout.callout-ok {
  border-color: color-mix(in srgb, var(--ok) 30%, var(--border));
  border-left-color: var(--ok);
  background: color-mix(in srgb, var(--ok) 7%, var(--bg));
}

.article-body .callout.callout-ok::before {
  content: "✓";
  background: var(--ok);
  font-size: 0.8rem;
}

/* --------------------------------------------------------------------------
   10. stat-grid 数据卡(顶部色条多档变化)与 check-list 行卡
   check-list 只做容器装饰,勾叉语义由 li 文本开头携带,不注入标记
   -------------------------------------------------------------------------- */

.article-body .stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.9rem;
  margin: 1.8rem 0;
}

.article-body .stat-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-panel);
  padding: 1.2rem 1.15rem 1rem;
}

.article-body .stat-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--accent);
}

.article-body .stat-card.tint-gold::before {
  background: linear-gradient(90deg, var(--gold), var(--pink));
}

.article-body .stat-card.tint-pink::before {
  background: var(--pink);
}

.article-body .stat-card.tint-ok::before {
  background: var(--ok);
}

.article-body .stat-num {
  display: block;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.65rem;
  line-height: 1.2;
  color: var(--accent-dark);
  margin-bottom: 0.3rem;
}

.article-body .stat-card.tint-gold .stat-num {
  color: color-mix(in srgb, var(--gold) 65%, var(--text));
}

.article-body .stat-card.tint-pink .stat-num {
  color: color-mix(in srgb, var(--pink) 75%, var(--text));
}

.article-body .stat-card.tint-ok .stat-num {
  color: color-mix(in srgb, var(--ok) 80%, var(--text));
}

.article-body .stat-label {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.5;
}

.article-body .check-list {
  list-style: none;
  margin: 1.6rem 0;
  padding: 0;
  display: grid;
  gap: 0.6rem;
}

.article-body .check-list li {
  list-style: none;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.75rem 1.05rem;
  line-height: 1.7;
}

/* --------------------------------------------------------------------------
   11. verdict 结论块(accent 左边条,粗体开头当标签)
   -------------------------------------------------------------------------- */

.article-body .verdict {
  margin: 2rem 0;
  padding: 1.1rem 1.35rem;
  border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--border));
  border-left: 5px solid var(--accent);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--accent) 7%, var(--bg));
}

.article-body .verdict > strong:first-child {
  color: var(--accent-dark);
}

.article-body .verdict p {
  margin: 0.2em 0 0;
}

/* --------------------------------------------------------------------------
   12. 文末推广卡(唯一推广块):品牌渐变暗底,白底实心主按钮 + 描边次按钮
   -------------------------------------------------------------------------- */

.article-body .promo-block,
.article-promo {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.2rem 2rem;
  margin: 2.8rem 0 0;
  padding: clamp(1.5rem, 4vw, 2.2rem);
  border: 1px solid var(--deep-line);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(130% 170% at 0% 0%, color-mix(in srgb, var(--accent) 30%, var(--bg-deep)) 0%, transparent 58%),
    radial-gradient(130% 170% at 100% 100%, color-mix(in srgb, var(--pink) 22%, var(--bg-deep)) 0%, transparent 55%),
    var(--bg-deep);
  color: var(--deep-text);
}

.article-body .promo-block strong,
.article-promo strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--bg);
  margin-bottom: 0.35rem;
}

.article-body .promo-block p,
.article-promo p {
  margin: 0;
  color: var(--deep-muted);
  font-size: 0.95rem;
  line-height: 1.7;
}

.promo-actions {
  flex: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.7rem;
}

.article-body .promo-block .promo-cta,
.article-promo .promo-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--bg);
  color: var(--accent-dark);
  border: 1px solid var(--bg);
  border-radius: var(--radius-pill);
  padding: 0.65rem 1.5rem;
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  box-shadow: var(--shadow-btn);
  transition: transform 0.2s;
}

.article-body .promo-block .promo-cta:hover,
.article-promo .promo-cta:hover {
  transform: translateY(-2px);
}

.article-body .promo-block .promo-sub,
.article-promo .promo-sub {
  display: inline-flex;
  align-items: center;
  background: transparent;
  color: var(--deep-text);
  border: 1px solid var(--deep-line);
  border-radius: var(--radius-pill);
  padding: 0.65rem 1.4rem;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  transition: border-color 0.2s;
}

.article-body .promo-block .promo-sub:hover,
.article-promo .promo-sub:hover {
  border-color: color-mix(in srgb, var(--accent) 60%, var(--deep-line));
}

/* --------------------------------------------------------------------------
   13. 上一篇 / 下一篇 + 延伸阅读(相邻垫距之和 ≤5rem,防叠出空洞)
   -------------------------------------------------------------------------- */

#post-nav {
  padding-bottom: 1.6rem;
}

#related-posts {
  padding-top: 1.6rem;
  padding-bottom: clamp(3rem, 7vw, 4.5rem);
}

.post-nav-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

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

@media (max-width: 720px) {
  .post-nav-grid {
    grid-template-columns: 1fr;
  }
}

.post-nav-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 1.05rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg);
  text-decoration: none;
  overflow: hidden;
  transition: border-color 0.22s, transform 0.22s, box-shadow 0.22s;
}

.post-nav-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--gold), var(--pink), var(--accent));
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.25s;
}

.post-nav-card.next {
  text-align: right;
}

.post-nav-card.next::before {
  transform-origin: right center;
}

.post-nav-card:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
}

.post-nav-card:hover::before {
  transform: scaleX(1);
}

.post-nav-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.post-nav-title {
  font-weight: 700;
  font-size: 0.98rem;
  line-height: 1.55;
  color: var(--text);
  text-wrap: pretty;
}

.post-nav-card:hover .post-nav-title {
  color: var(--accent-dark);
}

.related-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.25rem, 3vw, 1.5rem);
  letter-spacing: -0.01em;
  color: var(--text);
  margin: 0 0 1.2rem;
  text-wrap: pretty;
}

.related-title::after {
  content: "";
  display: block;
  width: 3.2rem;
  height: 4px;
  margin-top: 0.55rem;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--gold), var(--pink), var(--accent));
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: var(--gutter);
}

/* --------------------------------------------------------------------------
   14. 动效降级
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  .article-card,
  .post-nav-card,
  .filter-btn,
  .article-body .promo-block .promo-cta,
  .article-promo .promo-cta,
  .article-body .promo-block .promo-sub,
  .article-promo .promo-sub {
    transition: none;
  }

  .article-card:hover,
  .post-nav-card:hover,
  .article-body .promo-block .promo-cta:hover,
  .article-promo .promo-cta:hover {
    transform: none;
  }
}