/* ============================================================
   NZVPN Blog CSS
   博客列表页与文章页专属样式
   所有颜色/字体/圆角均引用 base.css :root 设计令牌
   ============================================================ */

/* ---------- 列表页 Hero ---------- */
.blog-hero {
  text-align: center;
  padding: 4rem var(--gutter) 2.5rem;
  max-width: var(--wrap);
  margin-inline: auto;
}

.blog-hero .eyebrow {
  margin-bottom: 1rem;
}

.blog-hero h1 {
  font-size: clamp(1.8rem, 3vw, 3rem);
  font-weight: 900;
  color: var(--text);
  line-height: 1.3;
  margin-bottom: 1rem;
  letter-spacing: -0.01em;
  text-wrap: pretty;
}

.blog-hero .lead {
  color: var(--muted);
  max-width: 42rem;
  margin-inline: auto;
  font-size: 1rem;
  line-height: 1.7;
}

/* ---------- 标签筛选 ---------- */
.blog-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  padding: 0 var(--gutter) 2.5rem;
  max-width: var(--wrap);
  margin-inline: auto;
}

.filter-btn {
  padding: 0.5rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--bg);
  color: var(--muted);
  font-size: 0.875rem;
  font-family: var(--font-body);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}

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

.filter-btn.is-active {
  background: var(--accent-dark);
  color: #fff;
  border-color: var(--accent-dark);
  font-weight: 600;
}

/* ---------- 文章卡片网格 ---------- */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  max-width: var(--wrap);
  margin-inline: auto;
  padding: 0 var(--gutter) 4rem;
}

.blog-card {
  display: block;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 1.5rem;
  text-decoration: none;
  color: var(--text);
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.blog-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-soft);
  border-color: var(--accent);
}

.blog-card-body {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.blog-tag {
  align-self: flex-start;
  background: var(--tint);
  color: var(--accent-dark);
  padding: 0.25rem 0.75rem;
  border-radius: var(--r-pill);
  font-size: 0.75rem;
  font-weight: 600;
  font-family: var(--font-mono);
  margin-bottom: 1rem;
}

.blog-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.45;
  margin-bottom: 0.75rem;
  text-wrap: pretty;
}

.blog-card p {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.65;
  margin-bottom: 1.25rem;
  flex-grow: 1;
}

.blog-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--faint);
  font-size: 0.8rem;
  border-top: 1px solid var(--border);
  padding-top: 0.75rem;
  font-family: var(--font-mono);
}

/* ---------- 面包屑 ---------- */
.breadcrumb {
  max-width: calc(56rem + var(--gutter) * 2);
  margin: 1.5rem auto 0;
  padding: 0 var(--gutter);
  font-size: 0.875rem;
  color: var(--muted);
  font-family: var(--font-mono);
}

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

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

.breadcrumb .sep {
  margin: 0 0.5rem;
  color: var(--faint);
}

.breadcrumb .current {
  color: var(--text);
}

/* ---------- 文章 Hero(offset-block 版式) ---------- */
.article-hero {
  position: relative;
  max-width: calc(56rem + var(--gutter) * 2);
  margin: 0 auto;
  padding: 3rem var(--gutter) 2.5rem;
  overflow-x: clip;
}

.article-hero::before {
  content: '';
  position: absolute;
  top: 0.5rem;
  right: 0;
  width: 52%;
  height: 78%;
  background: color-mix(in srgb, var(--accent) 10%, #fff);
  border-radius: var(--r-md);
  z-index: 0;
}

.article-hero > * {
  position: relative;
  z-index: 1;
}

.article-hero .article-meta,
.article-hero .article-summary {
  margin-left: 2rem;
  max-width: calc(100% - 2rem);
}

.article-hero h1 {
  font-size: clamp(1.5rem, 3vw, 2.6rem);
  font-weight: 900;
  line-height: 1.35;
  color: var(--text);
  margin-bottom: 1rem;
  letter-spacing: -0.01em;
  text-wrap: pretty;
}

.article-summary {
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.75;
  margin-bottom: 1.5rem;
}

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

.article-meta .meta-item {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  padding: 0.25rem 0.75rem;
  font-size: 0.8rem;
  color: var(--muted);
  font-family: var(--font-mono);
}

.article-meta .meta-tag {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  font-weight: 600;
}

/* ---------- 正文阅读列 ---------- */
.reading-wrap {
  max-width: calc(56rem + var(--gutter) * 2);
  width: 100%;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ---------- 文章正文排版 ---------- */
.article-body {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--text);
  counter-reset: h2counter;
}

.article-body p {
  margin-bottom: 1.25em;
}

.article-body h2 {
  counter-increment: h2counter;
  font-size: clamp(1.2rem, 2vw, 1.6rem);
  font-weight: 800;
  line-height: 1.4;
  margin: 2.5em 0 1em;
  position: relative;
  padding-left: 2rem;
  letter-spacing: -0.01em;
  text-wrap: pretty;
}

.article-body h2::before {
  content: counter(h2counter, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 0.2em;
  font-family: var(--font-mono);
  font-size: 0.8em;
  color: var(--accent);
  font-weight: 700;
}

.article-body h3 {
  font-size: clamp(1.05rem, 1.5vw, 1.3rem);
  font-weight: 700;
  line-height: 1.4;
  margin: 2em 0 0.8em;
  letter-spacing: -0.01em;
  text-wrap: pretty;
}

.article-body ul,
.article-body ol {
  margin: 1.25em 0;
  padding-left: 1.5em;
}

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

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

.article-body blockquote {
  border-left: 4px solid var(--accent);
  background: var(--mist);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  padding: 1rem 1.5rem;
  margin: 1.5rem 0;
  color: var(--text);
  font-style: italic;
}

.article-body code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--bg-panel2);
  padding: 0.15em 0.4em;
  border-radius: var(--r-xs);
  overflow-wrap: anywhere;
}

.article-body pre {
  background: var(--text);
  color: #e8f0ed;
  border-radius: var(--r-md);
  padding: 1.5rem 1.5rem 1.25rem;
  overflow-x: auto;
  position: relative;
  margin: 1.5rem 0;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  line-height: 1.7;
}

.article-body pre::before {
  content: 'NZVPN';
  position: absolute;
  top: 0.5rem;
  right: 1rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--muted);
  letter-spacing: 0.05em;
}

.article-body pre code {
  background: none;
  padding: 0;
  font-size: inherit;
  overflow-wrap: normal;
}

/* ---------- 表格 ---------- */
.article-body table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  margin: 1.5rem 0;
  min-width: 640px;
}

.article-body thead th {
  background: var(--accent-dark);
  color: #fff;
  text-align: left;
  padding: 0.75rem 1rem;
  font-weight: 600;
  font-size: 0.875rem;
}

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

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

.article-body td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
}

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

/* ---------- 数据卡网格 ---------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin: 2rem 0;
}

.stat-card {
  background: var(--bg-panel);
  border-radius: var(--r-md);
  padding: 1.5rem 1.25rem;
  text-align: center;
  border-top: 3px solid var(--accent);
}

.stat-card:nth-child(2) {
  border-top-color: var(--accent-dark);
}

.stat-card:nth-child(3) {
  border-top-color: var(--success);
}

.stat-card:nth-child(4) {
  border-top-color: var(--warn);
}

.stat-num {
  font-size: 2rem;
  font-weight: 900;
  color: var(--text);
  font-family: var(--font-display);
  line-height: 1.2;
}

.stat-label {
  font-size: 0.875rem;
  color: var(--muted);
  margin-top: 0.25rem;
}

/* ---------- 勾叉清单(容器/行卡装饰,不注入语义标记) ---------- */
.check-list {
  list-style: none;
  padding-left: 0;
  margin: 1.5rem 0;
}

.check-list li {
  background: var(--bg-panel);
  border-radius: var(--r-sm);
  padding: 0.75rem 1rem;
  margin-bottom: 0.5rem;
  line-height: 1.6;
}

/* ---------- 结论块 ---------- */
.verdict {
  border-left: 4px solid var(--accent);
  background: var(--mist);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
}

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

/* ---------- 提示块 callout ---------- */
.callout {
  position: relative;
  background: var(--mist);
  border-left: 4px solid var(--accent);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  padding: 1rem 1.5rem 1rem 3rem;
  margin: 1.5rem 0;
}

.callout::before {
  content: '!';
  position: absolute;
  left: 1rem;
  top: 1rem;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
}

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

.callout-warn::before {
  background: var(--warn);
}

.callout-error {
  background: color-mix(in srgb, var(--error) 10%, #fff);
  border-left-color: var(--error);
}

.callout-error::before {
  background: var(--error);
}

/* ---------- 文末推广块 ---------- */
.promo-block {
  max-width: calc(56rem + var(--gutter) * 2);
  margin: 3rem auto 0;
  padding: 2.5rem var(--gutter);
  background: linear-gradient(135deg, var(--accent-dark), var(--accent-deep));
  border-radius: var(--r-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.promo-text h3 {
  color: #fff;
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  letter-spacing: -0.01em;
}

.promo-text p {
  color: rgba(255, 255, 255, 0.92);
  margin: 0;
  line-height: 1.6;
}

.promo-cta .btn-main {
  background: #fff;
  color: var(--accent-deep);
  border-color: #fff;
  white-space: nowrap;
}

.promo-cta .btn-main:hover {
  background: var(--tint);
}

/* ---------- 延伸阅读 ---------- */
#related-posts {
  max-width: calc(56rem + var(--gutter) * 2);
  margin: 0 auto;
  padding: 1rem var(--gutter) 2rem;
}

.related-title {
  font-size: 1.3rem;
  font-weight: 800;
  margin-bottom: 1.25rem;
  color: var(--text);
  letter-spacing: -0.01em;
}

.related-card {
  display: block;
  background: var(--bg-panel);
  border-radius: var(--r-md);
  padding: 1.25rem 1.5rem;
  text-decoration: none;
  color: var(--text);
  margin-bottom: 0.75rem;
  border: 1px solid transparent;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.related-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: var(--shadow-soft);
}

.related-tag {
  display: inline-block;
  background: var(--tint);
  color: var(--accent-dark);
  padding: 0.2rem 0.6rem;
  border-radius: var(--r-pill);
  font-size: 0.75rem;
  font-weight: 600;
  font-family: var(--font-mono);
  margin-bottom: 0.5rem;
}

.related-card h3 {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 0.4rem;
  text-wrap: pretty;
}

.related-date {
  font-size: 0.8rem;
  color: var(--faint);
  font-family: var(--font-mono);
}

/* ---------- 上一篇/下一篇 ---------- */
#post-nav {
  max-width: calc(56rem + var(--gutter) * 2);
  margin: 0 auto;
  padding: 0 var(--gutter) 2.5rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.post-nav-link {
  display: block;
  background: var(--bg-panel);
  border-radius: var(--r-md);
  padding: 1.25rem 1.5rem;
  text-decoration: none;
  color: var(--text);
  border-top: 3px solid var(--border);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.post-nav-link:hover {
  border-top-color: var(--accent);
  box-shadow: var(--shadow-soft);
}

.post-nav-prev {
  text-align: left;
}

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

.post-nav-label {
  display: block;
  font-size: 0.75rem;
  color: var(--faint);
  font-family: var(--font-mono);
  margin-bottom: 0.4rem;
}

.post-nav-title {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.4;
}

/* ---------- 注册引导弹窗 ---------- */
.signup-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 33, 29, 0.55);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: modal-fade-in 0.2s ease;
}

.signup-modal {
  background: var(--bg);
  border-radius: var(--r-lg);
  max-width: 440px;
  width: calc(100% - 2rem);
  padding: 2.25rem;
  position: relative;
  box-shadow: var(--shadow-lift);
  animation: modal-scale-in 0.25s ease;
}

.signup-modal-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 2rem;
  height: 2rem;
  border: none;
  background: var(--bg-panel);
  border-radius: 50%;
  cursor: pointer;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s;
}

.signup-modal-close:hover {
  background: var(--bg-panel2);
  color: var(--text);
}

.signup-modal-body h2 {
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  color: var(--text);
  letter-spacing: -0.01em;
}

.signup-modal-body p {
  color: var(--muted);
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.signup-modal-body .btn-main {
  display: inline-block;
}

@keyframes modal-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modal-scale-in {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .signup-modal-overlay,
  .signup-modal {
    animation: none;
  }
  .blog-card,
  .related-card,
  .post-nav-link {
    transition: none;
  }
}

/* ---------- 悬浮 CTA(文章页) ---------- */
.float-cta {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 100;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  background: var(--accent);
  color: #fff;
  border-radius: var(--r-pill);
  box-shadow: var(--shadow-btn);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  transition: background 0.2s, transform 0.2s;
}

.float-cta:hover {
  background: var(--accent-dark);
  transform: translateY(-2px);
}

.float-cta svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

@media (max-width: 640px) {
  .float-cta {
    bottom: 1rem;
    right: 1rem;
    padding: 0.65rem 1rem;
    font-size: 0.85rem;
  }
}

/* ---------- 窄屏适配 ---------- */
@media (max-width: 640px) {
  .article-hero .article-meta,
  .article-hero .article-summary {
    margin-left: 0;
    max-width: 100%;
  }

  .promo-block {
    flex-direction: column;
    text-align: center;
  }

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

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

  .blog-hero h1 .no-break {
    white-space: normal;
  }
}