/* ============================================================
   VPNTd 博客系统样式(列表页 + 文章页)
   全部颜色 / 字体 / 圆角自 :root 设计令牌派生
   ============================================================ */

/* ---------- 通用 ---------- */
.no-break {
  white-space: nowrap;
}

/* ---------- 列表页 hero ---------- */
.blog-hero {
  text-align: center;
  padding-top: clamp(3rem, 7vw, 5rem);
  padding-bottom: clamp(1.5rem, 4vw, 2.5rem);
}

.blog-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  line-height: 1.22;
  letter-spacing: -0.01em;
  text-wrap: pretty;
  color: var(--text);
  margin: 0.9rem 0 1rem;
}

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

/* ---------- 标签筛选 ---------- */
.tag-filter {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
}

.tag-btn {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  color: var(--muted);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.5rem 1.1rem;
  min-height: 24px;
  cursor: pointer;
  transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.tag-btn:hover {
  color: var(--text);
  border-color: var(--accent-dark);
}

.tag-btn.is-active {
  color: var(--ink-on-accent);
  background: var(--accent-dark);
  border-color: var(--accent-dark);
}

/* ---------- 文章卡片(列表页) ---------- */
.blog-list-sec {
  padding-bottom: clamp(3rem, 7vw, 5rem);
}

.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr));
  gap: 1.25rem;
  margin-top: 2rem;
}

.post-card {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem 1.4rem 1.2rem;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.post-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent-dark);
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.76rem;
}

.post-tag {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 32%, transparent);
  border-radius: 999px;
  padding: 0.15rem 0.6rem;
  letter-spacing: 0.03em;
}

.post-date {
  color: var(--muted);
  letter-spacing: 0.04em;
}

.post-title {
  font-family: var(--font-display);
  font-size: 1.12rem;
  line-height: 1.45;
  font-weight: 700;
  text-wrap: pretty;
  margin: 0;
}

.post-title a {
  color: var(--text);
  text-decoration: none;
}

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

.post-summary {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.8;
  flex: 1;
}

.post-more {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  color: var(--accent);
  text-decoration: none;
}

.post-more:hover {
  text-decoration: underline;
}

.post-empty {
  text-align: center;
  color: var(--muted);
  font-size: 0.95rem;
  padding: 3rem 0;
}

/* ---------- 面包屑(与页头留呼吸间距) ---------- */
.breadcrumb {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
  padding: 1.5rem 0 0;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.03em;
  color: var(--muted);
}

.breadcrumb li {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
}

.breadcrumb li + li::before {
  content: "›";
  color: color-mix(in srgb, var(--muted) 55%, transparent);
}

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

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

.breadcrumb [aria-current="page"] {
  color: var(--text);
}

/* ---------- 阅读列(52~57rem,正文盒宽 = 列宽 + 2×gutter) ---------- */
.reading-wrap {
  width: min(100%, calc(56rem + 2 * var(--gutter)));
  max-width: calc(56rem + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.reading-wrap > * {
  max-width: 100%;
}

.reading-wrap .article-hero,
.reading-wrap .article-body {
  width: auto;
  margin-inline: 0;
}

/* ---------- 文章 hero:centered-formal 居中刊头 ---------- */
.article-hero {
  text-align: center;
  padding-top: clamp(2.2rem, 6vw, 3.6rem);
  padding-bottom: clamp(1.6rem, 4vw, 2.4rem);
}

.article-kicker {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.1rem;
}

.article-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 3.6vw, 2.6rem);
  font-weight: 800;
  line-height: 1.28;
  letter-spacing: -0.01em;
  text-wrap: pretty;
  color: var(--text);
  margin: 0 auto;
  max-width: 100%;
}

.hero-rule {
  width: 3.5em;
  height: 3px;
  border-radius: 999px;
  margin: 1.4rem auto 1.3rem;
  background: linear-gradient(90deg, var(--accent-dark), var(--accent));
  box-shadow: 0 0 12px var(--accent-glow-soft);
}

.article-hero .article-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.article-meta .meta-sep {
  color: color-mix(in srgb, var(--muted) 55%, transparent);
}

.article-hero .article-summary {
  max-width: 42rem;
  margin: 1.3rem auto 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.85;
}

/* ---------- 文章正文排版 ---------- */
.article-body {
  font-size: 1rem;
  line-height: 1.85;
  color: var(--text);
  counter-reset: vpntd-sec;
  padding-top: 0.5rem;
}

.article-body p {
  margin: 1.1rem 0;
}

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

.article-body a:hover {
  text-decoration-thickness: 2px;
}

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

.article-body h2 {
  counter-increment: vpntd-sec;
  font-family: var(--font-display);
  font-size: clamp(1.32rem, 2.4vw, 1.6rem);
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: -0.01em;
  text-wrap: pretty;
  color: var(--text);
  margin: 2.6rem 0 1rem;
}

.article-body h2::before {
  content: counter(vpntd-sec, decimal-leading-zero);
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.72em;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--accent);
  padding: 0.1em 0.5em;
  margin-right: 0.7em;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  border-radius: var(--radius-s);
  vertical-align: 0.12em;
}

.article-body h3 {
  font-family: var(--font-display);
  font-size: clamp(1.08rem, 1.8vw, 1.3rem);
  font-weight: 700;
  line-height: 1.45;
  letter-spacing: -0.005em;
  text-wrap: pretty;
  color: var(--text);
  margin: 2rem 0 0.8rem;
}

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

.article-body li {
  margin: 0.45rem 0;
  line-height: 1.8;
}

.article-body blockquote {
  margin: 1.6rem 0;
  padding: 1rem 1.3rem;
  border-left: 3px solid var(--accent-dark);
  border-radius: 0 var(--radius-s) var(--radius-s) 0;
  background: color-mix(in srgb, var(--panel) 70%, transparent);
  color: var(--muted);
}

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

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

/* 行内 code */
.article-body code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: color-mix(in srgb, var(--panel2) 80%, transparent);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 0.12em 0.4em;
  overflow-wrap: anywhere;
}

/* pre:终端窗(红黄绿灯) */
.article-body pre {
  position: relative;
  margin: 1.6rem 0;
  padding: 2.5rem 1.3rem 1.3rem;
  background: var(--panel2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-x: auto;
}

.article-body pre::before {
  content: "";
  position: absolute;
  top: 0.95rem;
  left: 1.1rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--error);
  box-shadow: 17px 0 0 var(--warn), 34px 0 0 var(--success);
}

.article-body pre code {
  display: block;
  background: none;
  border: 0;
  padding: 0;
  font-size: 0.85rem;
  line-height: 1.75;
  color: var(--text);
}

/* 表格:实色表头 + 斑马纹 + hover,窄屏可横滑 */
.article-body .table-scroll {
  overflow-x: auto;
  max-width: 100%;
  margin: 1.6rem 0;
}

.article-body table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  line-height: 1.6;
  border: 1px solid var(--border);
  border-radius: var(--radius-s);
  overflow: hidden;
}

.article-body th {
  background: var(--panel2);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  text-align: left;
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid var(--border);
}

.article-body td {
  padding: 0.65rem 0.9rem;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
  vertical-align: top;
}

.article-body tbody tr:nth-child(even) {
  background: color-mix(in srgb, var(--panel) 55%, transparent);
}

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

/* inline svg inside cells must never fall back to replaced-element
   default sizing (300x150-ish), which starves text of column width */
.article-body th svg,
.article-body td svg {
  width: 1em;
  height: 1em;
  flex: none;
  vertical-align: -0.125em;
}

@media (max-width: 860px) {
  /* keep the table a real table: it may exceed the column width and
     scroll horizontally inside .table-scroll; never force it back into
     the container (that squeezes cells to one glyph per line).
     min-width floor: with only min-width:100%, auto table layout
     shrinks columns toward min-content when preferred widths exceed
     the container — CJK min-content is a single glyph, which renders
     one character per line. A 36rem floor keeps columns wide enough
     to wrap normally and lets .table-scroll scroll instead. */
  .article-body table {
    width: auto;
    min-width: max(100%, 36rem);
  }
}

/* ---------- callout:左色条 + 图标徽 ---------- */
.callout {
  position: relative;
  margin: 1.6rem 0;
  padding: 1rem 1.2rem 1rem 3rem;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-s) var(--radius-s) 0;
  background: color-mix(in srgb, var(--accent) 6%, var(--panel));
  font-size: 0.95rem;
  line-height: 1.8;
}

.callout::before {
  content: "i";
  position: absolute;
  left: 0.85rem;
  top: 1.05rem;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 50%;
  background: var(--accent-dark);
  color: var(--ink-on-accent);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

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

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

.callout-success::before {
  content: "✓";
  background: var(--success);
}

/* ---------- 数据卡网格 ---------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 9.5rem), 1fr));
  gap: 0.9rem;
  margin: 1.6rem 0;
}

.stat-card {
  position: relative;
  min-width: 0;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1rem 1rem;
  overflow: hidden;
  text-align: center;
}

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

.stat-card.is-warn::before { background: var(--warn); }
.stat-card.is-success::before { background: var(--success); }
.stat-card.is-muted::before { background: var(--border); }

.stat-num {
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 800;
  line-height: 1.2;
  color: var(--accent);
}

.stat-card.is-warn .stat-num { color: var(--warn); }
.stat-card.is-success .stat-num { color: var(--success); }
.stat-card.is-muted .stat-num { color: var(--text); }

.stat-label {
  margin-top: 0.4rem;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.5;
}

/* ---------- 勾叉清单(✅/❌ 由 li 文本携带,样式只做行卡) ---------- */
.check-list {
  list-style: none;
  margin: 1.4rem 0;
  padding: 0;
  display: grid;
  gap: 0.6rem;
}

.check-list li {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-s);
  padding: 0.7rem 1rem;
  line-height: 1.75;
  font-size: 0.95rem;
}

/* ---------- 结论块 ---------- */
.verdict {
  margin: 1.8rem 0;
  padding: 1.1rem 1.3rem;
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-s) var(--radius-s) 0;
  background: color-mix(in srgb, var(--accent) 8%, var(--panel));
  font-size: 0.97rem;
  line-height: 1.8;
}

.verdict > strong {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-right: 0.5rem;
}

/* ---------- 文末推广卡(母题加框 + 点阵 PCB 底纹) ---------- */
.promo-block {
  position: relative;
  margin: clamp(2.5rem, 6vw, 4rem) 0 0;
  padding: 1.8rem 1.6rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.2rem;
  border: 1px solid color-mix(in srgb, var(--accent-dark) 45%, var(--border));
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 12% 0%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 55%),
    linear-gradient(135deg, var(--panel2), var(--panel));
  overflow: hidden;
}

.promo-block::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(var(--dot) 1px, transparent 1px);
  background-size: 18px 18px;
  opacity: 0.5;
  pointer-events: none;
}

.promo-copy {
  position: relative;
  min-width: 0;
}

.promo-brand {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: 0.02em;
  color: var(--accent);
  text-shadow: 0 0 18px var(--accent-glow-soft);
}

.promo-line {
  margin: 0.4rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.7;
}

.promo-block .btn-primary {
  position: relative;
  background: var(--accent);
  color: var(--ink-on-accent);
  border: 1px solid var(--accent);
  box-shadow: 0 0 22px var(--accent-glow);
}

/* ---------- 延伸阅读(垫距与上下篇之和控制) ---------- */
#related-posts {
  margin-top: clamp(2rem, 5vw, 3rem);
  padding-top: 1.25rem;
}

.related-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.005em;
  text-wrap: pretty;
  color: var(--text);
  margin: 0 0 1rem;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
  gap: 0.9rem;
}

.related-card {
  position: relative;
  min-width: 0;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.related-card::after {
  content: "";
  position: absolute;
  top: -1px;
  left: 1rem;
  width: 2.2rem;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.22s ease;
}

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

.related-card:hover::after {
  transform: scaleX(1);
}

.related-card-title {
  font-size: 0.98rem;
  font-weight: 600;
  line-height: 1.5;
  text-wrap: pretty;
  margin: 0.55rem 0 0;
}

.related-card-title a {
  color: var(--text);
  text-decoration: none;
}

.related-card-title a:hover {
  color: var(--accent);
}

/* ---------- 上一篇 / 下一篇 ---------- */
#post-nav {
  margin-top: clamp(2rem, 5vw, 3rem);
  padding-bottom: 1.25rem;
}

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

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

.post-nav-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  min-width: 0;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
  text-decoration: none;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.post-nav-card::after {
  content: "";
  position: absolute;
  top: -1px;
  left: 1rem;
  width: 2.2rem;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.22s ease;
}

.post-nav-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent-dark);
}

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

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

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

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

/* ---------- 文章页悬浮 CTA(列表页不使用) ---------- */
.float-cta {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 90;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.15rem;
  background: var(--panel);
  border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--border));
  border-radius: 999px;
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  box-shadow:
    0 6px 24px color-mix(in srgb, var(--bg) 60%, transparent),
    0 0 18px var(--accent-glow-soft);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

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

.float-cta svg {
  flex-shrink: 0;
  display: block;
}

@media (max-width: 640px) {
  .float-cta {
    right: 0.9rem;
    bottom: 0.9rem;
    padding: 0.55rem 0.95rem;
    font-size: 0.82rem;
  }
}

/* ---------- 文末注册引导弹窗 ---------- */
.signup-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: color-mix(in srgb, var(--bg) 74%, transparent);
  opacity: 0;
  transition: opacity 0.24s ease;
}

.signup-overlay.is-open {
  opacity: 1;
}

.signup-panel {
  position: relative;
  width: 100%;
  max-width: 25rem;
  background: var(--panel);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--border));
  border-radius: var(--radius);
  padding: 2.2rem 1.8rem 1.9rem;
  text-align: center;
  box-shadow:
    0 18px 60px color-mix(in srgb, var(--bg) 45%, transparent),
    0 0 40px var(--accent-glow-soft);
  transform: translateY(14px) scale(0.97);
  transition: transform 0.24s ease;
}

.signup-overlay.is-open .signup-panel {
  transform: none;
}

.signup-close {
  position: absolute;
  top: 0.7rem;
  right: 0.7rem;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--panel2);
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1;
  cursor: pointer;
  transition: color 0.18s ease, border-color 0.18s ease;
}

.signup-close:hover {
  color: var(--text);
  border-color: var(--accent-dark);
}

.signup-brand {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  color: var(--accent);
  text-shadow: 0 0 20px var(--accent-glow-soft);
}

.signup-line {
  margin: 0.8rem 0 1.4rem;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.75;
}

.signup-cta {
  display: inline-block;
  text-decoration: none;
}

/* ---------- 动效降级 ---------- */
@media (prefers-reduced-motion: reduce) {
  .tag-btn,
  .post-card,
  .related-card,
  .related-card::after,
  .post-nav-card,
  .post-nav-card::after,
  .float-cta,
  .signup-overlay,
  .signup-panel,
  .signup-close {
    transition: none;
  }

  .post-card:hover,
  .related-card:hover,
  .post-nav-card:hover,
  .float-cta:hover {
    transform: none;
  }
}