/* ============================================================
   XHS Card Generator — Claude Design Language v2
   ============================================================
   设计系统标准：
   - 字体：标题 LXGW WenKai SC / Noto Serif SC，正文 Inter + Noto Sans SC
         引用 Noto Serif SC，代码 JetBrains Mono
   - 嵌入块统一基类 .glass（毛玻璃 + 渐变 + 阴影）
   - 色彩修饰符 .glass-accent / .glass-sage
   ============================================================ */

/* ---- RESET ---- */
* { margin: 0; padding: 0; box-sizing: border-box; }

/* ============================================================
   GLASS — 所有嵌入块的统一基类
   ============================================================
   用法：tweet-embed、blockquote、table、compare-card、formula-block
        formula-cell、core-takeaway、stat-card 全部继承此基类视觉
   修改这里 = 同时改所有嵌入块
   ============================================================ */
.glass {
  background: linear-gradient(145deg,
    rgba(var(--accent-rgb),0.18) 0%,
    rgba(var(--accent-rgb),0.08) 50%,
    rgba(var(--surface-rgb),0.55) 100%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: none;
  border-radius: var(--radius);
  box-shadow:
    0 2px 16px rgba(0,0,0,0.04),
    inset 0 1px 0 rgba(255,255,255,var(--sheen-a));
}

/* 珊瑚色强调 — 光晕更浓 */
.glass-accent {
  background: linear-gradient(100deg,
    rgba(var(--accent-rgb),0.26) 0%,
    rgba(var(--accent-rgb),0.12) 60%,
    rgba(var(--surface-rgb),0.55) 100%);
}

/* 绿色强调 */
.glass-sage {
  background: linear-gradient(145deg,
    rgba(var(--sage-rgb),0.24) 0%,
    rgba(var(--sage-rgb),0.10) 55%,
    rgba(var(--surface-rgb),0.55) 100%);
}

/* 渐变光条 — 通用 ::before / ::after */
.glass-bar-left {
  position: relative;
  overflow: hidden;
}
.glass-bar-left::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 5px;
  background: linear-gradient(180deg, var(--accent) 0%, rgba(var(--accent-rgb),0.15) 100%);
  border-radius: var(--radius) 0 0 var(--radius);
}

/* ---- CARD SHELL ---- */
.card {
  width: var(--card-w);
  height: var(--card-h);
  background: var(--card-bg);
  padding: var(--pad);
  padding-top: 40px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  font-family: "Inter", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  color: var(--text);
}

/* ---- HEADER ---- */
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-shrink: 0;
}

.author {
  display: flex;
  align-items: center;
  gap: 16px;
}

.avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
  object-fit: cover;
}

.avatar-img {
  width: 132px;
  height: 132px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

.header-mascot {
  height: 240px;
  width: auto;
  image-rendering: pixelated;
  margin: -50px -28px -50px 0;
}

/* 品牌标记（codex / kimi 这类主题用官方 logo 代替像素吉祥物）：
   logo 是平滑矢量风、不是像素画 —— 必须关掉 pixelated，否则边缘全是锯齿；
   尺寸也收到和头像同档（132px），不占用像素吉祥物那种夸张的出血负边距。 */
.header-mascot[src*="assets/brands/"] {
  height: 132px;
  image-rendering: auto;
  margin: 0;
  border-radius: 24px;
}

.author-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.author-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.name {
  font-family: "LXGW WenKai SC", "Noto Sans SC", "PingFang SC", sans-serif;
  font-size: 46px;
  font-weight: 700;
  color: var(--text);
}

/* 认证徽章 — 图片 + 珊瑚色滤镜 */
.verified {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  flex-shrink: 0;
}
.verified img {
  width: 100%;
  height: 100%;
  /* 图片已是珊瑚色，无需 filter */
}

.handle {
  font-size: 34px;
  color: var(--text-secondary);
  font-weight: 400;
}

.date {
  font-size: 32px;
  color: var(--text-secondary);
  flex-shrink: 0;
  font-weight: 500;
}

/* 封面右上角 PNN 序号徽标（只看封面就能认出是哪一篇 · 2026-07-05） */
.date-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
}
.post-id-badge {
  font-size: 38px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--text-secondary);
  opacity: 0.72;
  font-variant-numeric: tabular-nums;
}

/* ---- CARD BODY ---- */
.card-body {
  flex: 1;
  overflow: hidden;
}

/* ============================================================
   TYPOGRAPHY — 字体标准
   ============================================================
   h1/h2:  LXGW WenKai SC → Noto Serif SC（衬线）
   h3:     Noto Sans SC（无衬线加粗）
   正文 p: Inter + Noto Sans SC（无衬线）
   引用:   Noto Serif SC（宋体）
   代码:   JetBrains Mono
   ============================================================ */

.card h1 {
  font-family: "LXGW WenKai SC", "Noto Serif SC", "Source Han Serif SC", Georgia, serif;
  font-size: 90px;
  font-weight: 900;
  line-height: 1.2;
  color: var(--text);
  margin-bottom: 36px;
  letter-spacing: -0.5px;
}

.card h2 {
  font-family: "LXGW WenKai SC", "Noto Serif SC", "Source Han Serif SC", Georgia, serif;
  font-size: 48px;
  font-weight: 700;
  color: var(--text);
  margin: 44px 0 28px;
  line-height: 1.6;
  display: block;
}
.card h2 .h2-inner {
  background: linear-gradient(transparent 50%, rgba(var(--accent-rgb),0.18) 50%, rgba(var(--accent-rgb),0.18) 80%, transparent 80%);
  padding: 0 4px;
  display: inline;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
.card h2:first-child { margin-top: 0; }

.card h3 {
  font-family: "Noto Sans SC", "PingFang SC", sans-serif;
  font-size: 34px;
  font-weight: 700;
  color: var(--text);
  margin: 36px 0 20px;
}

.card p {
  font-size: 32px;
  line-height: 1.85;
  color: var(--text);
  margin-bottom: 28px;
}
.card p:last-child { margin-bottom: 0; }
.card-body > *:last-child { margin-bottom: 0 !important; }

.accent,
.card strong {
  color: var(--accent);
  font-weight: 700;
}

/* ============================================================
   BLOCKQUOTE — 引用块（继承 .glass-accent）
   ============================================================ */
.card blockquote:not(.highlight) {
  /* 继承 glass 基类视觉 */
  background: linear-gradient(100deg,
    rgba(var(--accent-rgb),0.26) 0%,
    rgba(var(--accent-rgb),0.12) 60%,
    rgba(var(--surface-rgb),0.55) 100%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: none;
  border-radius: var(--radius);
  box-shadow:
    0 2px 16px rgba(0,0,0,0.04),
    inset 0 1px 0 rgba(255,255,255,var(--sheen-a));
  /* 自有样式 */
  padding: 28px 32px;
  margin: 32px 0;
  font-style: normal;
  font-family: "Noto Serif SC", "Source Han Serif SC", Georgia, serif;
  color: var(--text);
  font-size: 32px;
  line-height: 1.85;
  position: relative;
  overflow: hidden;
}
.card blockquote:not(.highlight)::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 5px;
  background: linear-gradient(180deg, var(--accent) 0%, rgba(var(--accent-rgb),0.15) 100%);
  border-radius: var(--radius) 0 0 var(--radius);
}

/* 奇偶交替 */
.card blockquote:not(.highlight):nth-of-type(even) {
  background: linear-gradient(260deg,
    rgba(var(--accent-rgb),0.26) 0%,
    rgba(var(--accent-rgb),0.12) 60%,
    rgba(var(--surface-rgb),0.55) 100%);
  padding: 28px 32px;
}
.card blockquote:not(.highlight):nth-of-type(even)::before {
  left: auto; right: 0;
  border-radius: 0 var(--radius) var(--radius) 0;
}

/* HIGHLIGHT */
.card .highlight,
.card blockquote.highlight {
  background: linear-gradient(100deg,
    rgba(var(--accent-rgb),0.28) 0%,
    rgba(var(--accent-rgb),0.14) 60%,
    rgba(var(--surface-rgb),0.55) 100%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: none;
  border-radius: var(--radius);
  box-shadow:
    0 2px 16px rgba(0,0,0,0.04),
    inset 0 1px 0 rgba(255,255,255,var(--sheen-a));
  padding: 28px 32px;
  margin: 32px 0;
  position: relative;
  font-style: normal;
  font-family: "Noto Serif SC", "Source Han Serif SC", Georgia, serif;
  overflow: hidden;
}
.card .highlight::before,
.card blockquote.highlight::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 5px;
  background: linear-gradient(180deg, var(--accent) 0%, rgba(var(--accent-rgb),0.15) 100%);
  border-radius: var(--radius) 0 0 var(--radius);
}
.card .highlight p,
.card blockquote.highlight p {
  margin-bottom: 0;
  font-style: normal;
  color: var(--text);
}

/* ---- LISTS ---- */
.card ul {
  margin: 28px 0;
  padding-left: 30px;
  list-style: none;
}
.card ul li {
  font-size: 32px;
  line-height: 1.9;
  color: var(--text);
  margin-bottom: 14px;
  position: relative;
  padding-left: 8px;
}
.card ul li::before {
  content: '';
  position: absolute;
  left: -22px; top: 14px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

/* ol · 简化为 ul 同档朴素样式（round 6 删卡片底色 + 橙圆数字渲染 · 改 default decimal 阿拉伯数字 · round 7 加 list-style-position: inside 防数字左边被卡片 padding 裁切） */
.card ol {
  margin: 16px 0 16px 0;
  padding-left: 0;
  list-style: decimal;
  list-style-position: inside;
}
.card ol li {
  font-size: 32px;
  line-height: 1.85;
  color: var(--text);
  margin-bottom: 12px;
  padding-left: 0;
  text-indent: 0;
}
.card ol li::marker {
  font-weight: 700;
  color: var(--accent);
}

/* ============================================================
   TABLE — 继承 .glass 基类
   ============================================================ */
.card .styled-table,
.card table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 32px 0;
  font-size: 24px;
  border-radius: var(--radius);
  overflow: hidden;
  border: none;
  /* glass 基类 */
  background: linear-gradient(145deg,
    rgba(var(--accent-rgb),0.18) 0%,
    rgba(var(--accent-rgb),0.08) 50%,
    rgba(var(--surface-rgb),0.55) 100%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow:
    0 2px 16px rgba(0,0,0,0.04),
    inset 0 1px 0 rgba(255,255,255,var(--sheen-a));
}

.card table th {
  background: linear-gradient(135deg, rgba(var(--accent-rgb),0.25) 0%, rgba(var(--accent-rgb),0.12) 100%);
  color: var(--text);
  padding: 20px 28px;
  text-align: center;
  font-weight: 700;
  font-family: "Noto Serif SC", "LXGW WenKai SC", "Source Han Serif SC", Georgia, serif;
  font-size: 36px;
  letter-spacing: 0.5px;
  border-bottom: 1px solid rgba(var(--hairline-rgb),0.05);
}

.card table td {
  padding: 18px 28px;
  border-bottom: 1px solid rgba(var(--hairline-rgb),0.03);
  color: var(--text);
  font-family: "Noto Sans SC", sans-serif;
  font-size: 32px;
  line-height: 1.7;
  text-align: center;
}

.card table tr:last-child td { border-bottom: none; }
.card table tr:nth-child(even) td { background: rgba(var(--accent-rgb),0.03); }

/* ---- CODE BLOCK ---- */
.card pre {
  background: var(--code-bg);
  color: var(--code-text);
  padding: 24px 28px;
  border-radius: var(--radius);
  font-family: "JetBrains Mono", "Cascadia Code", "Fira Code", monospace;
  font-size: 22px;
  line-height: 1.65;
  margin: 24px 0;
  white-space: pre-wrap;
  word-break: break-all;
  overflow: hidden;
}

.card code {
  font-family: "JetBrains Mono", "Cascadia Code", monospace;
  font-size: 20px;
  background: var(--accent-light);
  padding: 2px 8px;
  border-radius: 6px;
  color: var(--accent);
}

.card pre code {
  background: none;
  padding: 0;
  border-radius: 0;
  color: inherit;
  font-size: inherit;
}

/* ---- IMAGE EMBED ---- */
.img-embed {
  width: 100%;
  border-radius: var(--radius);
  overflow: hidden;
  margin: 24px 0;
  background: var(--img-placeholder);
}
/* height:auto 必须显式写 — 否则 <img height="N"> 属性会当字面 px 高度用（UA 样式），会压扁图 */
/* object-position:top 是全局默认 — 内联图默认按自然比例完整流式显示（无 object-fit:cover，v6.x 退役 cover 压缩）。
   data-crop 仍可让作者手动覆盖锚点（极少用）。 */
.img-embed img { width: 100%; height: auto; display: block; object-position: top; }
.img-embed[data-crop="center"] img { object-position: center; }
.img-embed[data-crop="bottom"] img { object-position: bottom; }
/* 专属整卡（v6.x · 图绝不裁）：超高图（主要是 AI 竖图）等比缩放到完整显示，居中、保留 header，永不裁切。
   max-height 由 paginator 按「USABLE_H − caption」内联注入到 <img> 的 style；这里兜底锚定 contain + 居中。 */
.img-embed.img-contain { background: transparent; margin: 10px 0; }
.img-embed.img-contain img { width: auto; max-width: 100%; height: auto; object-fit: contain; margin: 0 auto; }
.img-caption {
  /* v0.8 改 · 用户要求图下灰色小字 caption · 一行 · 说明谁/事件/场景 */
  display: block;
  text-align: center;
  font-size: 17px;
  color: var(--text-muted);
  margin-top: 10px;
  margin-bottom: 8px;
  line-height: 1.45;
  padding: 0 12px;
  font-style: italic;
}

/* ---- HR ---- */
.card hr {
  border: none;
  border-top: 1.5px solid var(--border);
  margin: 40px 0;
}

/* ---- CAPTION / SMALL ---- */
.caption {
  font-size: 20px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ---- GLOSS: 上角标 + 卡底脚注 ---- */
/* 用法：md 里写 SemiAnalysis <span class="gloss">硅谷最权威的...</span> 发布报告
   parser.js 会把它转成 <sup class="gloss-ref" data-gloss="...">[N]</sup>
   client-paginate.js 会把每页出现的 gloss 聚合到该页底部 .card-footnotes */
.gloss-ref {
  font-size: 16px;
  vertical-align: super;
  line-height: 0;
  color: var(--accent);
  font-weight: 600;
  margin-left: 2px;
  cursor: default;
  font-family: "Inter", sans-serif;
}

/* 脚注区：完全独立于 .card-body 之外，用 absolute 定位"沉到"卡片底部 margin 区域
   （即 .card 原本 padding-bottom 那一片留白）。正文无论占几行，脚注都稳定锚在底部。 */
.card-footnotes {
  position: absolute;
  bottom: 20px;
  left: var(--pad);
  right: 180px;  /* 给右下角的 page-num 让位 */
  padding-top: 10px;
  border-top: 1.5px solid var(--rule-color);
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 2;  /* 确保在 .card-body 可能的 overflow 上方 */
}
.card-footnotes .footnote {
  font-size: 19px;
  color: var(--footnote-color);
  line-height: 1.45;
  letter-spacing: 0.01em;
}
.card-footnotes .fn-num {
  color: var(--accent);
  font-weight: 600;
  margin-right: 6px;
  font-family: "Inter", sans-serif;
}

/* ---- PAGE NUMBER ---- */
.page-num {
  position: absolute;
  bottom: 32px;
  right: var(--pad);
  font-size: 20px;
  color: var(--text-secondary);
  font-weight: 500;
  font-family: "Inter", sans-serif;
}

/* ============================================================
   HERO CARD — 两种模式：光斑+插画 / 纯色渐变(向后兼容)
   ============================================================ */

/* --- 默认 hero（纯色渐变，向后兼容无 hero_image 的帖子）--- */
/* hero（无图版）— 底色与普通卡片一致，只保留居中布局 + 大标题字号 */
.card.hero {
  background: var(--bg-card);
  justify-content: center;
  align-items: center;
  text-align: center;
}
.card.hero .card-header {
  position: absolute;
  top: var(--pad);
  left: var(--pad);
  right: var(--pad);
}
.card.hero .hero-content {
  padding: 0 20px; max-width: 100%;
  z-index: 1; position: relative;
}
.card.hero .hero-title {
  font-family: "Noto Serif SC", "Source Han Serif SC", Georgia, serif;
  font-size: 90px;
  font-weight: 900;
  line-height: 1.2;
  color: var(--text);
  margin-bottom: 28px;
  letter-spacing: -0.5px;
}
.card.hero .hero-subtitle {
  font-size: 34px;
  color: var(--text-secondary);
  line-height: 1.55;
  font-weight: 400;
}

/* --- 带插画的 hero — 完全复用普通卡片布局 --- */
/* 核心思路：hero-with-image 就是一张普通 .card，
   把 .card.hero 的特殊布局全部重置回去 */
.card.hero.hero-with-image {
  background: var(--bg-card);
  justify-content: flex-start;
  align-items: stretch;
  text-align: left;
  overflow: hidden;
}

/* ---- 9:15 封面 · 原生 3:4 内容区 + 上下同源模糊延展 ----
   输出画布默认 1080×1800，但 Header、标题与 hero 图仍按 1080×1440 构图。
   上下各 180px 不是死白，也不把内容拉长：paginator 克隆整张封面两份，
   一份贴顶、一份贴底；中间 1440px 再盖回不透明纸面，只露出两条轻模糊 band。 */
/* ── 封面上下模糊带（9:15 / 9:16 的余量）─────────────────────────────
   ⚠️ 旧做法是「模糊层 inset:0 铺满整卡 + ::after 盖一块不透明补丁遮住中间 3:4」。
   那是【事后遮】：补丁边界差一两像素、blur 往外洇、或平台裁窗取整误差，
   模糊就会从缝里漏进 3:4 —— 小红书把 9:15 对半截回 3:4 时会当场露馅。
   （2026-07-29 tb24-xhs-autopilot 在 xhs-card-gen 踩完整轮坑后同步过来的结论。）

   现做法：上下各一个 band 容器，overflow:hidden 把克隆【物理关在里面】，
   filter 加在克隆上（这样 blur 往外洇的部分也被 band 裁掉），
   band 再离 3:4 边界留 6px 安全距 → 模糊够不着中间那块，不是遮住了，是进不去。 */
.card.hero.cover-extended > .cover-blur-layer {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.card.hero.cover-extended > .cover-blur-layer > .cover-band {
  position: absolute;
  left: 0;
  right: 0;
  overflow: hidden;          /* ← 关键：把克隆和它往外洇的 blur 一起裁死在带内 */
}
.card.hero.cover-extended > .cover-blur-layer > .cover-band.is-top {
  top: 0;
  height: max(0px, calc(var(--cover-band-top, 180px) - 6px));
}
.card.hero.cover-extended > .cover-blur-layer > .cover-band.is-bottom {
  bottom: 0;
  height: max(0px, calc(var(--cover-band-bottom, 180px) - 6px));
}

/* 克隆体复原原生 3:4 内容区的布局上下文。禁止 scale/scaleY：
   前者会横向裁掉 Header，后者会把人物和字体压变形。
   blur 加在【克隆】上而不是外层 layer 上 —— 外层加的话洇出的部分不受 band 裁剪。 */
.card.hero.cover-extended .cover-blur-inner {
  position: absolute;
  left: 72px;
  width: 936px;
  height: 1328px;
  display: flex;
  flex-direction: column;
  filter: blur(10px) saturate(1.03);
}
.card.hero.cover-extended .cover-band.is-top    > .cover-blur-inner { top: 0; }
.card.hero.cover-extended .cover-band.is-bottom > .cover-blur-inner { bottom: 0; }

/* 光斑背景层 — 已禁用，纯底色 */
/* 重置 header 为正常流布局（跟内容页一模一样） */
.card.hero.hero-with-image .card-header {
  position: relative;
  top: auto; left: auto; right: auto;
  z-index: 1;
}
/* 重置文字颜色为深色 */
.card.hero.hero-with-image .name { color: var(--text); }
.card.hero.hero-with-image .handle { color: var(--text-secondary); }
.card.hero.hero-with-image .date { color: var(--text-secondary); }
/* hero-with-image verified 统一 */
.card.hero.hero-with-image .page-num { color: var(--text-secondary); }
/* hero-content 当作 card-body，用 flex:1 填满剩余空间 */
.card.hero.hero-with-image .hero-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 24px;
  z-index: 1;
  position: relative;
  min-height: 0;
}
/* 标题 — 与无图 hero 保持同一字号，才有视觉冲击 */
.card.hero.hero-with-image .hero-title {
  color: var(--text);
  font-size: 90px;
  margin-bottom: 0;
  line-height: 1.15;
  text-align: left;
  letter-spacing: -1px;
}
.card.hero.hero-with-image .hero-subtitle {
  color: var(--text-secondary);
  font-size: 34px;
  line-height: 1.55;
  text-align: left;
}
/* hero-body — 只设对齐，样式继承 .card ol li */
.card.hero .hero-body {
  width: 100%;
  text-align: left;
  margin-top: 8px;
}
/* 图片 — flex:1 自适应填剩余空间（text 撑完剩多少就多高）
   img 内部 object-fit: cover 吸收长宽比差异
   底部 72px padding 由 .card 统一管，不再硬算 aspect-ratio */
.card.hero .hero-image {
  flex: 1 1 0;
  min-height: 0;
  margin-bottom: 0;
  border-radius: 20px;
  overflow: hidden;
  box-shadow:
    0 4px 24px rgba(0,0,0,0.08);
}

/* hero 卡专属底部精简：删页码 + 压底 padding，让 hero-image 向下吃满 */
.card.hero { padding-bottom: 16px; }
.card.hero .page-num { display: none; }
.card.hero .hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 24% top;
  display: block;
}

/* ============================================================
   QUOTE CARD — 金句居中
   ============================================================ */
.card.quote { justify-content: center; align-items: center; text-align: center; }
.card.quote .card-header {
  position: absolute;
  top: var(--pad); left: var(--pad); right: var(--pad);
}
.card.quote .quote-content { padding: 0 24px; max-width: 100%; }
.card.quote .quote-mark {
  font-family: "Noto Serif SC", Georgia, serif;
  font-size: 90px; line-height: 0.6;
  color: var(--accent); opacity: 0.2;
  margin-bottom: 16px;
}
.card.quote .quote-text {
  font-family: "Noto Serif SC", "Source Han Serif SC", Georgia, serif;
  font-size: 36px; font-weight: 700; line-height: 1.6;
  color: var(--text); margin-bottom: 24px;
}
.card.quote .quote-attribution {
  font-size: 20px; color: var(--text-secondary); font-weight: 400;
}

/* ============================================================
   CORE TAKEAWAY — 独立标签标题
   ============================================================ */
.core-takeaway-label {
  font-family: "Inter", sans-serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--accent);
  margin: 36px 0 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid rgba(var(--accent-rgb),0.2);
}

/* ============================================================
   TWEET EMBED — 继承 .glass 基类
   ============================================================ */
.tweet-embed {
  /* glass 基类 */
  background: linear-gradient(145deg,
    rgba(var(--accent-rgb),0.18) 0%,
    rgba(var(--accent-rgb),0.08) 50%,
    rgba(var(--surface-rgb),0.55) 100%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: none;
  border-radius: var(--radius);
  box-shadow:
    0 2px 16px rgba(0,0,0,0.04),
    inset 0 1px 0 rgba(255,255,255,var(--sheen-a));
  /* L0-L5 自适应压缩由 CSS variable 驱动，paginator 按需注入 inline style */
  padding: var(--tw-pad-y, 22px) var(--tw-pad-x, 28px);
  margin: var(--tw-mar, 22px) 0;
}
.tweet-embed.tweet-error {
  color: var(--text-secondary);
  font-style: italic;
  text-align: center;
  padding: 40px;
}
.tweet-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(var(--hairline-rgb),0.06);
}
.tweet-author { display: flex; align-items: center; gap: 12px; }
.tweet-avatar {
  width: 44px; height: 44px;
  border-radius: 50%; object-fit: cover;
  flex-shrink: 0; background: var(--border);
}
.tweet-author-info { display: flex; flex-direction: column; gap: 1px; }
.tweet-name-row { display: flex; align-items: center; gap: 6px; }
.tweet-name { font-size: 22px; font-weight: 700; color: var(--text); }
.tweet-verified {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px;
  background: #1D9BF0; border-radius: 50%;
  color: white; font-size: 10px; font-weight: 700; flex-shrink: 0;
}
.tweet-handle { font-size: 17px; color: var(--text-secondary); }
.tweet-x-logo { color: var(--text-secondary); flex-shrink: 0; opacity: 0.5; }
.tweet-text {
  font-size: var(--tw-font, 25px);
  line-height: var(--tw-line, 1.6);
  color: var(--text); margin-bottom: 14px; word-wrap: break-word;
}
.tweet-image {
  width: 100%; border-radius: var(--radius);
  overflow: hidden; margin-bottom: 14px;
  max-height: var(--tw-img-max, none);
}
.tweet-image img {
  width: 100%; height: auto; display: block;
  object-fit: cover; object-position: center top;
  max-height: var(--tw-img-max, none);
}
.tweet-meta {
  display: flex; align-items: center; gap: 8px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(var(--hairline-rgb),0.06);
  margin-bottom: 12px;
}
.tweet-date { font-size: 16px; color: var(--text-secondary); }
.tweet-metrics { display: flex; gap: 20px; font-size: 16px; color: var(--text-secondary); }
.tweet-metric strong { color: var(--text); font-weight: 700; }

/* Tweet 仅图片模式 */
.tweet-image-only { padding-bottom: 20px; }
.tweet-image-only .tweet-image-full { margin-bottom: 0; }
.tweet-image-only .tweet-image-full img {
  width: 100%; height: auto; display: block;
  object-fit: contain; border-radius: var(--radius);
}

/* ---- Tweet 自适应压缩（L0-L5）：CSS variables 由 paginator 按"最小压缩量"注入 ----
   L3 起 meta 区（date/likes/views）隐藏；文字/图片/padding/margin/font 全走 var()，无固定档位 */
.tweet-embed[data-hide-meta="1"] .tweet-meta,
.tweet-embed[data-hide-meta="1"] .tweet-metrics {
  display: none;
}

/* ============================================================
   TWEET GRID — 2x2 精简推文网格
   ============================================================ */
.tweet-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 32px 0;
}
.tweet-grid .tweet-embed {
  padding: 20px 22px;
  margin: 0;
}
.tweet-grid .tweet-embed .tweet-header {
  margin-bottom: 12px;
  padding-bottom: 10px;
}
.tweet-grid .tweet-embed .tweet-avatar {
  width: 36px; height: 36px;
}
.tweet-grid .tweet-embed .tweet-name { font-size: 17px; }
.tweet-grid .tweet-embed .tweet-handle { font-size: 13px; }
.tweet-grid .tweet-embed .tweet-x-logo { width: 16px; height: 16px; }
.tweet-grid .tweet-embed .tweet-text {
  font-size: 19px;
  line-height: 1.55;
  margin-bottom: 0;
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.tweet-grid .tweet-embed .tweet-image { display: none; }
.tweet-grid .tweet-embed .tweet-metrics { display: none; }
.tweet-grid .tweet-embed .tweet-meta { display: none; }

/* ============================================================
   STAT CARD — 继承 .glass 基类
   ============================================================ */
.stat-row { display: flex; gap: 20px; margin: 24px 0; }
.stat-card {
  flex: 1;
  /* glass 基类 */
  background: linear-gradient(145deg,
    rgba(var(--accent-rgb),0.18) 0%,
    rgba(var(--accent-rgb),0.08) 50%,
    rgba(var(--surface-rgb),0.55) 100%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: none;
  border-radius: var(--radius);
  box-shadow:
    0 2px 16px rgba(0,0,0,0.04),
    inset 0 1px 0 rgba(255,255,255,var(--sheen-a));
  padding: 28px;
}
.stat-value {
  font-family: "Inter", sans-serif;
  font-size: 42px; font-weight: 800;
  color: var(--text); line-height: 1.1; margin-bottom: 6px;
}
.stat-delta { font-size: 16px; font-weight: 600; margin-left: 8px; }
.stat-delta.up { color: #16A34A; }
.stat-delta.down { color: #DC2626; }
.stat-label { font-size: 18px; color: var(--text-secondary); font-weight: 400; }

/* ============================================================
   FORMULA BLOCK — 继承 .glass-accent
   ============================================================ */
.formula-block {
  /* glass-accent */
  background: linear-gradient(135deg,
    rgba(var(--accent-rgb),0.26) 0%,
    rgba(var(--accent-rgb),0.12) 55%,
    rgba(var(--surface-rgb),0.55) 100%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: var(--radius);
  padding: 40px 36px;
  margin: 32px 0;
  text-align: center;
  position: relative;
  border: none;
  box-shadow:
    0 2px 16px rgba(0,0,0,0.04),
    inset 0 1px 0 rgba(255,255,255,var(--sheen-a));
}
.formula-block::before {
  content: '\201C';
  position: absolute; top: 10px; left: 24px;
  font-family: "Noto Serif SC", Georgia, serif;
  font-size: 56px; color: var(--accent); opacity: 0.15; line-height: 1;
}
.formula-block::after {
  content: '\201D';
  position: absolute; bottom: 6px; right: 24px;
  font-family: "Noto Serif SC", Georgia, serif;
  font-size: 56px; color: var(--accent); opacity: 0.15; line-height: 1;
}
.formula {
  font-family: "Inter", "Noto Sans SC", sans-serif;
  font-size: 36px; font-weight: 800;
  color: var(--text); line-height: 1.5;
}
.formula .highlight-var { color: var(--accent); }
.formula .dim { color: var(--text-secondary); font-weight: 400; font-size: 24px; }

/* Formula row — 对比数字 */
.formula-row { display: flex; gap: 16px; margin: 32px 0; }
.formula-cell {
  flex: 1;
  padding: 32px 24px;
  text-align: center;
  border-radius: var(--radius);
  border: none;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: relative;
  overflow: hidden;
  box-shadow:
    0 2px 16px rgba(0,0,0,0.04),
    inset 0 1px 0 rgba(255,255,255,var(--sheen-a));
}
.formula-cell:first-child {
  /* glass-accent */
  background: linear-gradient(145deg,
    rgba(var(--accent-rgb),0.26) 0%,
    rgba(var(--accent-rgb),0.12) 55%,
    rgba(var(--surface-rgb),0.55) 100%);
}
.formula-cell:first-child::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 5px;
  background: linear-gradient(180deg, var(--accent) 0%, rgba(var(--accent-rgb),0.15) 100%);
  border-radius: var(--radius) 0 0 var(--radius);
}
.formula-cell:last-child {
  /* glass-sage */
  background: linear-gradient(145deg,
    rgba(var(--sage-rgb),0.24) 0%,
    rgba(var(--sage-rgb),0.10) 55%,
    rgba(var(--surface-rgb),0.55) 100%);
}
.formula-cell:last-child::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 5px;
  background: linear-gradient(180deg, var(--sage) 0%, rgba(var(--sage-rgb),0.15) 100%);
  border-radius: var(--radius) 0 0 var(--radius);
}
.formula-cell .formula-big {
  font-family: "Noto Serif SC", "Inter", serif;
  font-size: 52px; font-weight: 900; line-height: 1.2;
}
.formula-cell:first-child .formula-big { color: var(--accent); }
.formula-cell:last-child .formula-big { color: var(--sage); }
.formula-cell .formula-desc {
  font-size: 26px; color: var(--text-secondary);
  margin-top: 10px; font-weight: 500;
}

/* ============================================================
   COMPARISON BLOCK — 继承 .glass-accent / .glass-sage
   ============================================================ */
.compare-row { display: flex; gap: 16px; margin: 32px 0; }
.compare-card {
  flex: 1;
  border-radius: var(--radius);
  padding: 28px;
  position: relative;
  border: none;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  overflow: hidden;
  box-shadow:
    0 2px 16px rgba(0,0,0,0.04),
    inset 0 1px 0 rgba(255,255,255,var(--sheen-a));
}
.compare-card.bad {
  /* glass-accent */
  background: linear-gradient(145deg,
    rgba(var(--accent-rgb),0.26) 0%,
    rgba(var(--accent-rgb),0.12) 55%,
    rgba(var(--surface-rgb),0.55) 100%);
}
.compare-card.bad::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 5px;
  background: linear-gradient(180deg, var(--accent) 0%, rgba(var(--accent-rgb),0.15) 100%);
  border-radius: var(--radius) 0 0 var(--radius);
}
.compare-card.good {
  /* glass-sage */
  background: linear-gradient(145deg,
    rgba(var(--sage-rgb),0.24) 0%,
    rgba(var(--sage-rgb),0.10) 55%,
    rgba(var(--surface-rgb),0.55) 100%);
}
.compare-card.good::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 5px;
  background: linear-gradient(180deg, var(--sage) 0%, rgba(var(--sage-rgb),0.15) 100%);
  border-radius: var(--radius) 0 0 var(--radius);
}
.compare-label {
  font-family: "LXGW WenKai SC", "Noto Serif SC", Georgia, serif;
  font-size: 28px; font-weight: 700;
  margin-bottom: 18px; padding-bottom: 14px;
  border-bottom: 1px solid rgba(var(--hairline-rgb),0.06);
}
.compare-card.bad .compare-label { color: var(--accent); }
.compare-card.good .compare-label { color: var(--sage); }
.compare-card p {
  font-size: 32px; line-height: 1.75; margin-bottom: 12px;
  font-family: "Noto Sans SC", sans-serif;
}

/* ============================================================
   CHART — 数字比例可视化（替代 formula-row）
   两种布局：horizontal（横向）/ vertical（纵向）
   用法：
     <div class="chart chart-h">
       <div class="chart-row" style="--bar-pct: 0.26;">
         <span class="chart-row-label">旧方法</span>
         <div class="chart-row-track"><div class="chart-row-fill chart-row-fill--accent"></div></div>
         <span class="chart-row-value">26K</span>
       </div>
       <div class="chart-row" style="--bar-pct: 100;">...</div>
       <div class="chart-badge">×400 tokens / step</div>
     </div>
   ============================================================ */

.chart {
  margin: 32px 0;
  padding: 40px 36px;
  background: linear-gradient(180deg,
    rgba(var(--surface-rgb),0.55) 0%,
    rgba(var(--surface-rgb),0.25) 100%);
  border-radius: var(--radius);
  border: 1px solid rgba(var(--hairline-rgb),0.04);
}

/* --- 横向比例条 --- */
.chart-h .chart-row {
  display: grid;
  grid-template-columns: 180px 1fr auto;
  align-items: center;
  gap: 20px;
  margin-bottom: 22px;
}
.chart-h .chart-row:last-of-type { margin-bottom: 0; }
.chart-h .chart-row-label {
  font-family: "Noto Sans SC", sans-serif;
  font-size: 22px;
  color: var(--text-secondary);
  font-weight: 500;
  text-align: right;
}
.chart-h .chart-row-track {
  position: relative;
  height: 44px;
  background: rgba(var(--hairline-rgb),0.04);
  border-radius: 6px;
  overflow: hidden;
}
.chart-h .chart-row-fill {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: calc(var(--bar-pct, 50) * 1%);
  border-radius: 6px;
  min-width: 4px; /* 极小比例也至少画出一根线 */
}
.chart-h .chart-row-fill--accent { background: linear-gradient(90deg, var(--accent), rgba(var(--accent-rgb),0.65)); }
.chart-h .chart-row-fill--sage   { background: linear-gradient(90deg, var(--sage),   rgba(var(--sage-rgb),0.70)); }
.chart-h .chart-row-fill--gray   { background: linear-gradient(90deg, var(--chart-gray-a), var(--chart-gray-b)); }
.chart-h .chart-row-value {
  font-family: "Noto Serif SC", serif;
  font-size: 38px;
  font-weight: 900;
  line-height: 1;
  min-width: 110px;
}
.chart-h .chart-row:nth-of-type(1) .chart-row-value { color: var(--accent); }
.chart-h .chart-row:nth-of-type(2) .chart-row-value { color: var(--sage); }

/* --- 纵向柱状图 ---
   关键：chart-bar 给固定高度，柱子 height: X% 才解析得出来 */
.chart-v {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 110px;
  padding: 90px 40px 100px;
  position: relative;
}
.chart-v .chart-bar {
  width: 150px;
  height: 320px;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.chart-v .chart-bar-fill {
  width: 100%;
  height: calc(var(--bar-pct, 50) * 1%);
  min-height: 10px;
  border-radius: 6px 6px 0 0;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.08);
}
.chart-v .chart-bar--accent .chart-bar-fill { background: linear-gradient(180deg, var(--accent), rgba(var(--accent-rgb),0.7)); }
.chart-v .chart-bar--sage   .chart-bar-fill { background: linear-gradient(180deg, var(--sage),   rgba(var(--sage-rgb),0.75)); }
/* 数字浮在柱子正上方（跟柱高联动） */
.chart-v .chart-bar-value {
  position: absolute;
  left: 0; right: 0;
  bottom: calc(var(--bar-pct, 50) * 1% + 14px);
  text-align: center;
  font-family: "Noto Serif SC", serif;
  font-size: 52px;
  font-weight: 900;
  line-height: 1;
}
.chart-v .chart-bar--accent .chart-bar-value { color: var(--accent); }
.chart-v .chart-bar--sage   .chart-bar-value { color: var(--sage); }
/* 标签在柱子下方 */
.chart-v .chart-bar-label {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: -72px;
  font-family: "Noto Sans SC", sans-serif;
  font-size: 20px;
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.45;
  width: 220px;
}

/* --- 倍数徽标（通用） --- */
.chart-badge {
  display: inline-block;
  margin-top: 28px;
  padding: 8px 20px;
  border-radius: 999px;
  background: rgba(var(--hairline-rgb),0.04);
  color: var(--text);
  font-family: "Noto Serif SC", serif;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.chart-v .chart-badge {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  margin-top: 0;
}
.chart-h .chart-badge {
  display: block;
  text-align: center;
  margin-top: 24px;
  background: none;
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 20px;
  letter-spacing: 0.12em;
}

/* ============================================================
   EDITORIAL-COMPARE — 杂志风 before / after 对照
   用法：
     <div class="editorial-compare">
       <div class="editorial-side">
         <div class="editorial-eyebrow">BEFORE</div>
         <h4 class="editorial-title">旧优化框架的假设</h4>
         <ul class="editorial-list"><li>...</li></ul>
       </div>
       <div class="editorial-rule"></div>
       <div class="editorial-side editorial-side--after">
         <div class="editorial-eyebrow">AFTER</div>
         ...
       </div>
     </div>
   ============================================================ */
.editorial-compare {
  display: grid;
  grid-template-columns: 1fr 1px 1fr;
  gap: 44px;
  margin: 36px 0;
  padding: 8px 4px;
}
.editorial-rule {
  background: rgba(var(--hairline-rgb),0.12);
  align-self: stretch;
}
.editorial-side {
  min-width: 0;
}
.editorial-eyebrow {
  font-family: Georgia, "Noto Serif SC", serif;
  font-size: 26px;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--text-secondary);
  font-weight: 700;
  padding-bottom: 12px;
  position: relative;
  margin-bottom: 18px;
}
.editorial-eyebrow::after {
  content: '';
  position: absolute;
  left: 0; bottom: 0;
  width: 36px; height: 2px;
  background: var(--text-secondary);
}
.editorial-side--after .editorial-eyebrow { color: var(--accent); }
.editorial-side--after .editorial-eyebrow::after { background: var(--accent); }
.editorial-title {
  font-family: "Noto Serif SC", "LXGW WenKai SC", Georgia, serif;
  font-size: 32px;
  font-weight: 900;
  line-height: 1.35;
  color: var(--text);
  margin: 0 0 22px;
}
.editorial-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.editorial-list li {
  font-family: "Noto Sans SC", sans-serif;
  font-size: 24px;
  line-height: 1.6;
  color: var(--text);
  position: relative;
  padding-left: 26px;
  margin-bottom: 10px;
}
.editorial-list li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--text-secondary);
  font-weight: 600;
}
.editorial-side--after .editorial-list li::before { color: var(--accent); }

/* ============================================================
   MASCOT
   ============================================================ */
.mascot { display: block; margin: 12px auto 20px; height: 120px; width: auto; image-rendering: pixelated; }
.mascot-sm { height: 80px; }
.mascot-lg { height: 160px; }

/* ============================================================
   TAG BAR
   ============================================================ */
.tag-bar {
  position: absolute;
  bottom: 28px; left: var(--pad);
  display: flex; gap: 8px; flex-wrap: wrap;
}
.tag {
  font-size: 14px; color: var(--accent);
  background: var(--accent-light);
  padding: 4px 12px; border-radius: 100px; font-weight: 500;
}
