/* ==========================================================================
   Clash客户端 · 技术笔记（博客列表页 + 文章页）
   颜色 / 圆角 / 字体全部引用 base.css 的 :root 令牌，不写颜色字面量。
   文章页骨架约定：
     <section class="article-top">   面包屑（padding-top 0.5rem）
     <section class="article-hero">  meta 行 + H1 + 导语（紧凑节奏，无大留白）
     <section class="article-body">  <div class="prose"> 正文，阅读版心 820px
     <section class="article-tail">  .dl-cta 下载卡 + #related-posts + #post-nav
   ========================================================================== */

/* ---------------------------------------------------------------- 1 面包屑 */
.blog-breadcrumb,
nav.breadcrumb,
nav.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.25rem;
  margin-bottom: 1.25rem;
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 1.6;
  white-space: nowrap;
  overflow: hidden;
}

.blog-breadcrumb a,
nav.breadcrumb a,
nav.breadcrumbs a {
  color: var(--text-muted);
  opacity: 0.6;
  text-decoration: none;
  transition: color 0.18s ease, opacity 0.18s ease;
}

.blog-breadcrumb a:hover,
nav.breadcrumb a:hover,
nav.breadcrumbs a:hover {
  color: var(--cyan);
  opacity: 1;
}

.blog-breadcrumb .bc-sep,
.blog-breadcrumb .sep,
nav.breadcrumb .bc-sep,
nav.breadcrumb .sep,
nav.breadcrumbs .bc-sep,
nav.breadcrumbs .sep,
.blog-breadcrumb > span[aria-hidden="true"],
nav.breadcrumb > span[aria-hidden="true"],
nav.breadcrumbs > span[aria-hidden="true"] {
  flex-shrink: 0;
  color: var(--text-dim);
  opacity: 0.35;
}

.blog-breadcrumb .bc-current,
.blog-breadcrumb .current,
.blog-breadcrumb [aria-current="page"],
nav.breadcrumb .bc-current,
nav.breadcrumb .current,
nav.breadcrumb [aria-current="page"],
nav.breadcrumbs .bc-current,
nav.breadcrumbs .current,
nav.breadcrumbs [aria-current="page"] {
  display: block;
  flex: 0 1 auto;
  min-width: 0;
  max-width: 30ch;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-muted);
  opacity: 1;
}

/* ------------------------------------------------------- 2 列表页首屏区块 */
.blog-hero {
  position: relative;
  overflow-x: clip;
  padding-block: 0.5rem 2.25rem;
  background: var(--bg);
  color: var(--text);
}

.blog-hero::after {
  content: "";
  position: absolute;
  top: -42%;
  right: -8%;
  width: 560px;
  height: 440px;
  background: radial-gradient(closest-side, var(--stroke-accent), transparent 74%);
  opacity: 0.32;
  pointer-events: none;
  z-index: 0;
}

.blog-hero .wrap {
  position: relative;
  z-index: 1;
}

.blog-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.75rem;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--cyan);
}

.blog-eyebrow::before {
  content: "";
  flex-shrink: 0;
  width: 18px;
  height: 2px;
  border-radius: var(--r-pill);
  background: var(--grad-accent);
}

.blog-h1 {
  max-width: 100%;
  margin: 0 0 0.9rem;
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 1.15rem + 2.1vw, 3rem);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--text);
  overflow-wrap: break-word;
}

.blog-lede {
  max-width: 62ch;
  margin: 0;
  font-size: clamp(0.9375rem, 0.9rem + 0.3vw, 1.0625rem);
  line-height: 1.75;
  color: var(--text-muted);
}

/* ------------------------------------------------------- 3 列表页浅色分区 */
.blog-list-sec {
  padding-block: 2.25rem 3.5rem;
  background: var(--bg-panel-2);
  color: var(--ink);
}

.blog-list-title {
  margin: 0 0 1.25rem;
  font-family: var(--font-display);
  font-size: clamp(1.125rem, 1rem + 0.5vw, 1.375rem);
  font-weight: 800;
  line-height: 1.4;
  color: var(--ink);
}

/* 标签筛选按钮 */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.75rem;
}

.tag-btn {
  appearance: none;
  -webkit-appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0.3rem 0.9rem;
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
  color: var(--ink-muted);
  background: var(--bg-panel-2);
  border: 1px solid var(--line-light);
  border-radius: var(--r-pill);
  cursor: pointer;
  transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

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

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

/* --------------------------------------------------------- 4 文章卡片网格 */
.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
}

.post-card {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 1.35rem 1.4rem 1.25rem;
  background: var(--bg-panel-2);
  color: var(--ink);
  border: 1px solid var(--line-light);
  border-radius: var(--r-l);
  text-decoration: none;
  transition: border-color 0.18s ease, transform 0.18s ease;
}

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

.post-card .post-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.post-card .post-tag {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  overflow: hidden;
  padding: 0.15rem 0.6rem;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.6;
  letter-spacing: 0.02em;
  white-space: nowrap;
  color: var(--accent-dark);
  background: var(--bg-panel-2);
  border: 1px solid var(--line-light);
  border-radius: var(--r-pill);
}

.post-card .post-date,
.post-card time {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-muted);
}

.post-card .post-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.45;
  letter-spacing: -0.005em;
  color: var(--ink);
}

.post-card .post-sum {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.75;
  color: var(--ink-muted);
}

.post-card .post-more {
  margin-top: auto;
  padding-top: 0.4rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--accent-dark);
}

.post-empty {
  margin: 0;
  padding: 2rem 0;
  font-size: 0.9375rem;
  line-height: 1.7;
  text-align: center;
  color: var(--ink-muted);
}

/* --------------------------------------------------- 5 文章页页头紧凑节奏 */
.article-top,
.article-hero,
.article-head {
  padding-block: 0.5rem 1.5rem;
  background: var(--bg);
  color: var(--text);
}

.article-top {
  padding-block: 0.5rem 0.25rem;
}

.article-top.sec,
.article-hero.sec,
.article-head.sec {
  padding-block: 0.5rem 1.5rem;
}

.article-top.sec {
  padding-block: 0.5rem 0.25rem;
}

.article-hero .wrap,
.article-head .wrap,
.article-top .wrap {
  max-width: min(100%, calc(820px + var(--gutter) * 2));
}

.article-hero h1,
.article-head h1,
.post-hero h1 {
  max-width: 100%;
  margin-block: 0.875rem 0.75rem;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 1.1rem + 1.4vw, 2rem);
  font-weight: 800;
  line-height: 1.32;
  letter-spacing: -0.015em;
  color: var(--text);
  overflow-wrap: break-word;
}

/* 文章页头节奏：顶栏→面包屑 24px、面包屑→meta 20px、meta→H1 14px、H1→导语 12px */
nav.crumbs,
.post-crumbs {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0.5rem;
  min-width: 0;
  padding-top: 1.5rem;
  margin: 0 0 1.25rem;
  font-size: 0.8125rem;
  line-height: 1.6;
  white-space: nowrap;
  overflow: hidden;
}

nav.crumbs > .wrap {
  max-width: min(100%, calc(820px + var(--gutter) * 2));
  min-width: 0;
}

.crumbs-list {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0.5rem;
  min-width: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

nav.crumbs a,
.post-crumbs a {
  color: var(--text-muted);
  opacity: 0.6;
  text-decoration: none;
}

nav.crumbs a:hover,
.post-crumbs a:hover {
  color: var(--cyan);
  opacity: 1;
}

nav.crumbs [aria-hidden="true"],
.post-crumbs [aria-hidden="true"] {
  flex: none;
  opacity: 0.35;
}

nav.crumbs [aria-current="page"],
.post-crumbs [aria-current="page"] {
  display: block;
  flex: 0 1 auto;
  min-width: 0;
  max-width: min(100%, 36ch);
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-muted);
  opacity: 1;
}

.post-hero .wrap {
  max-width: min(100%, calc(820px + var(--gutter) * 2));
}

.post-hero .post-meta {
  margin-bottom: 0.875rem;
}

.post-hero .post-lede,
.post-hero .sec-lede {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.75;
  color: var(--text-muted);
}

.article-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  margin: 0 0 1rem;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-muted);
}

.article-meta time,
.article-meta .meta-item {
  color: var(--text-muted);
}

.article-meta .post-tag,
.article-meta .tag {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  overflow: hidden;
  padding: 0.15rem 0.6rem;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.6;
  white-space: nowrap;
  color: var(--cyan);
  background: var(--glass);
  border: 1px solid var(--stroke-cyan);
  border-radius: var(--r-pill);
}

.article-lead,
.article-hero .lede,
.article-head .lede {
 : 0;
  margin: 1rem 0 0;
  max-width: 100%;
  font-size: clamp(0.9375rem, 0.85rem + 0.45vw, 1.125rem);
  line-height: 1.7;
  color: var(--text-muted);
}

/* ------------------------------------------------------- 6 文章正文排版 */
.article-body {
  padding-block: 1.5rem 2.5rem;
  background: var(--bg);
  color: var(--text);
}

.article-body .prose {
  max-width: 820px;
  margin-inline: auto;
  color: var(--text);
  font-size: 1rem;
  line-height: 1.85;
}

/* 文章正文阅读列：正文与文末卡片统一 820px 版心，与 hero 左缘对齐 */
.post-hero ~ .wrap > .prose,
.post-hero ~ .wrap > .post-cta,
.post-hero ~ .wrap > .dl-cta,
.post-hero ~ .wrap > .article-cta,
.post-hero ~ .wrap > .callout,
.article-body .post-cta,
.article-body .dl-cta,
.article-body .article-cta,
.article-body .callout {
  max-width: 820px;
  margin-inline: auto;
}

/* 文章页头面包屑（顶层容器）：与 hero 同宽同左缘，顶栏下距 24px、面包屑下距 20px */
.post-breadcrumb {
  max-width: min(100%, calc(820px + var(--gutter) * 2));
  padding-top: 1.5rem;
  margin-bottom: 1.25rem;
}

.article-body .prose p,
.article-body .prose ul,
.article-body .prose ol {
  margin-block: 0 1.1rem;
  color: var(--text);
}

.article-body .prose ul,
.article-body .prose ol {
  padding-left: 1.25rem;
}

.article-body .prose li {
  margin-bottom: 0.4rem;
}

.article-body .prose li::marker {
  color: var(--cyan);
}

.article-body .prose h2 {
  margin-block: 0 0.9rem;
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 1.1rem + 0.5vw, 1.5rem);
  font-weight: 800;
  line-height: 1.4;
  letter-spacing: -0.01em;
  color: var(--text);
}

.article-body .prose > h2 ~ h2 {
  margin-top: 2.25rem;
}

.article-body .prose h3 {
  margin-block: 1.5rem 0.6rem;
  font-family: var(--font-display);
  font-size: clamp(1.0625rem, 1rem + 0.35vw, 1.25rem);
  font-weight: 700;
  line-height: 1.5;
  color: var(--text);
}

.article-body .prose pre {
  margin-block: 0.9rem 1.25rem;
  padding: 1rem 1.1rem;
  background: var(--bg-panel);
  color: var(--text);
  border: 1px solid var(--stroke-soft);
  border-radius: var(--r-m);
  font-family: var(--font-mono);
  font-size: 0.875rem;
  line-height: 1.75;
  overflow-x: auto;
}

.article-body .prose :not(pre) > code {
  padding: 0.1em 0.4em;
  font-family: var(--font-mono);
  font-size: 0.9em;
  color: var(--cyan);
  background: var(--glass);
  border: 1px solid var(--stroke-soft);
  border-radius: var(--r-s);
  overflow-wrap: anywhere;
}

.article-body .prose blockquote {
  margin: 1.25rem 0;
  padding: 0.9rem 1.1rem;
  background: var(--glass);
  color: var(--text-muted);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--r-m) var(--r-m) 0;
}

.article-body .prose .table-wrap {
  margin-block: 1.25rem;
}

.article-body .prose a:not([class*="btn"]):not([class*="button"]),
.article .prose a:not([class*="btn"]):not([class*="button"]) {
  color: var(--cyan);
  text-decoration: none;
  border-bottom: 1px solid var(--stroke-cyan);
}

.article-body .prose a:not([class*="btn"]):not([class*="button"]):hover,
.article .prose a:not([class*="btn"]):not([class*="button"]):hover {
  color: var(--success);
  border-bottom-color: var(--stroke-accent);
}

/* 正文若被切成多个 section，一律用紧凑节奏，禁止复用首页大节间距 */
.article-body .sec,
.article-body .sec-deep,
.article-body .sec-light {
  padding-block: 0;
  background: transparent;
  color: inherit;
}

.article-body section + section {
  margin-top: 2.5rem;
}

/* ------------------------------------------------- 7 文末下载引导卡片 */
.dl-cta,
.post-cta,
.article-cta {
  margin-block: 2rem 0;
  padding: 1.5rem 1.5rem 1.4rem;
  background: var(--bg-panel);
  color: var(--text);
  border: 1px solid var(--stroke-accent);
  border-radius: var(--r-l);
}

.dl-cta-title,
.post-cta-title,
.article-cta-title {
  margin: 0 0 0.6rem;
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 800;
  line-height: 1.45;
  color: var(--text);
}

.dl-cta-text,
.post-cta-text,
.article-cta-text {
  margin: 0 0 1.1rem;
  font-size: 0.9375rem;
  line-height: 1.75;
  color: var(--text-muted);
}

.dl-cta-actions,
.post-cta-actions,
.article-cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* --------------------------------------------- 8 延伸阅读（动态挂载点） */
#related-posts {
  max-width: 820px;
  margin-top: 2rem;
  margin-inline: auto;
  padding-block: 0.5rem;
  background: var(--bg);
  color: var(--text);
}

.related-h2 {
  margin: 0 0 1rem;
  font-family: var(--font-display);
  font-size: clamp(1.125rem, 1rem + 0.45vw, 1.375rem);
  font-weight: 800;
  line-height: 1.4;
  color: var(--text);
}

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

.related-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 0;
  padding: 1.1rem 1.15rem 1.15rem;
  background: var(--bg-panel);
  color: var(--text);
  border: 1px solid var(--stroke-soft);
  border-radius: var(--r-m);
  text-decoration: none;
  transition: border-color 0.18s ease;
}

.related-card:hover {
  border-color: var(--stroke-accent);
}

.related-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
}

.related-tag {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  overflow: hidden;
  padding: 0.1rem 0.55rem;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.6;
  white-space: nowrap;
  color: var(--cyan);
  background: var(--glass);
  border: 1px solid var(--stroke-cyan);
  border-radius: var(--r-pill);
}

.related-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.5;
  color: var(--text);
  overflow-wrap: anywhere;
}

.related-sum {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.7;
  color: var(--text-muted);
}

/* ------------------------------------------- 9 上一篇 / 下一篇（挂载点） */
#post-nav {
  display: block;
  max-width: 820px;
  margin-top: 2rem;
  margin-inline: auto;
  padding-block: 0.5rem;
  background: var(--bg);
  color: var(--text);
}

.post-nav-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.post-nav-link {
  flex: 1 1 260px;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-width: 0;
  padding: 1rem 1.15rem;
  background: var(--bg-panel);
  color: var(--text);
  border: 1px solid var(--stroke-soft);
  border-radius: var(--r-m);
  text-decoration: none;
  transition: border-color 0.18s ease;
}

.post-nav-link:hover {
  border-color: var(--stroke-accent);
}

.post-nav-dir {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--text-dim);
}

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

.post-nav-link.is-next {
  align-items: flex-end;
  text-align: right;
}

/* ------------------------------------------------- 10 文章尾部容器与窄屏 */
.article-tail {
  padding-block: 0 3rem;
  background: var(--bg);
  color: var(--text);
}

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

@media (max-width: 640px) {
  .blog-hero {
    padding-block: 0.4rem 1.75rem;
  }

  .blog-list-sec {
    padding-block: 1.75rem 2.75rem;
  }

  .post-card {
    padding: 1.15rem 1.15rem 1.1rem;
  }

  .article-body {
    padding-block: 1.25rem 2rem;
  }

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

  .article-body section + section {
    margin-top: 1.75rem;
  }

  .dl-cta,
  .post-cta,
  .article-cta {
    padding: 1.25rem 1.15rem 1.2rem;
  }

  .post-nav-link.is-next {
    text-align: left;
    align-items: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  .post-card,
  .tag-btn,
  .related-card,
  .post-nav-link,
  .blog-breadcrumb a,
  nav.breadcrumb a,
  nav.breadcrumbs a {
    transition: none;
  }

  .post-card:hover {
    transform: none;
  }
}