/**
 * HormLab Portal · 科普文章详情页样式
 * 依赖 tokens.css / main.css
 */

/* 文章头（深色 hero） */
.article-page { min-height: 60vh; }
.article-hero {
  background: var(--space-dark);
  background-image: var(--gradient-glow);
  padding: calc(var(--nav-h) + 56px) 0 44px;
  color: #fff;
}
.article-back {
  display: inline-block; font-size: 13.5px; color: var(--text-white-soft);
  text-decoration: none; margin-bottom: 20px; padding: 6px 14px;
  border: 1px solid rgba(255,255,255,.2); border-radius: var(--r-pill);
  transition: all .2s ease;
}
.article-back:hover { color: var(--accent-teal); border-color: rgba(91,108,255,.5); }
.article-cat {
  display: inline-block; font-size: 12.5px; font-weight: 600;
  color: var(--accent-teal); background: rgba(91,108,255,.12);
  border: 1px solid rgba(91,108,255,.35);
  padding: 4px 14px; border-radius: var(--r-pill); margin-bottom: 16px;
}
.article-hero h1 {
  font-size: clamp(24px, 3.6vw, 36px); font-weight: 800; line-height: 1.35;
  letter-spacing: -0.5px; max-width: 820px;
}
.article-meta {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  margin-top: 18px; font-size: 13px; color: var(--text-white-muted);
}

/* 封面图 */
.article-cover { max-width: 820px; margin: 36px auto 0; padding: 0 20px; }
.article-cover img {
  width: 100%; border-radius: var(--r-lg); display: block;
  box-shadow: var(--shadow-lg);
}

/* 正文 */
.article-body {
  max-width: 820px; padding-top: 48px; padding-bottom: 64px;
}
.article-body h1, .article-body h2 {
  font-size: 22px; font-weight: 700;
  margin: 48px 0 18px; line-height: 1.4;
  padding-left: 14px;
  border-left: 4px solid var(--primary-blue);
}
.article-body h3, .article-body h4 {
  font-size: 18px; font-weight: 700;
  margin: 32px 0 14px;
  padding-left: 12px;
  border-left: 3px solid var(--primary-purple);
}
.article-body p { font-size: 16px; line-height: 1.85; color: var(--text-dark); margin-bottom: 18px; }
.article-body img { max-width: 100%; border-radius: var(--r-md); margin: 24px 0; display: block; }
.article-body figure { margin: 24px 0; }
.article-body figcaption { font-size: 13px; color: var(--text-mid); text-align: center; margin-top: 8px; }
.article-body blockquote {
  border-left: 3px solid var(--primary-blue); background: var(--bg-light);
  padding: 14px 18px; border-radius: 0 var(--r-md) var(--r-md) 0;
  margin: 18px 0; color: var(--text-mid); font-size: 15px;
}
.article-body ul, .article-body ol { padding-left: 24px; margin-bottom: 16px; }
.article-body li { font-size: 15.5px; line-height: 1.85; color: var(--text-dark); margin-bottom: 6px; }
.article-body a { color: var(--primary-blue); }
.article-body a:hover { text-decoration: underline; }
.article-body table { width: 100%; border-collapse: collapse; margin: 18px 0; font-size: 14px; }
.article-body th, .article-body td { border: 1px solid var(--border-light); padding: 10px 12px; text-align: left; }
.article-body th { background: var(--bg-light); }
.article-body code {
  background: var(--bg-light); padding: 2px 6px; border-radius: var(--r-xs); font-size: 13px;
}
.article-body hr { border: none; border-top: 1px dashed var(--border-light); margin: 30px 0; }

/* 文章页脚 */
.article-footer {
  background: var(--bg-card); border-top: 1px solid var(--border-light);
  padding: 40px 0; text-align: center;
}
.article-footer p { font-size: 13px; color: var(--text-light); margin-bottom: 20px; }

/* 响应式 */
@media (max-width: 768px) {
  .article-hero { padding-top: calc(var(--nav-h) + 32px); }
  .article-body p, .article-body li { font-size: 15px; }
}

/* ============ 真实文献引用（JS 注入到 #articleExtra） ============ */
.article-refs {
  background: linear-gradient(180deg, #FAFBFE 0%, #fff 100%);
  padding: 60px 0;
  border-top: 1px solid var(--border-light);
  margin-top: 40px;
}
.ar-head { text-align: center; margin-bottom: 32px; }
.ar-eyebrow {
  display: inline-block;
  font-size: 12px; font-weight: 700; letter-spacing: 1.5px;
  color: var(--primary-blue);
  background: rgba(91,108,255,0.08);
  border: 1px solid rgba(91,108,255,0.2);
  padding: 4px 12px; border-radius: 999px;
  margin-bottom: 14px;
}
.ar-title {
  font-size: clamp(20px, 2.4vw, 26px);
  font-weight: 800; line-height: 1.3;
  color: var(--text-dark);
  margin-bottom: 10px;
}
.ar-lead {
  font-size: 14.5px; line-height: 1.7;
  color: var(--text-mid);
  max-width: 720px; margin: 0 auto;
}

.ar-list {
  display: flex; flex-direction: column; gap: 14px;
  max-width: 880px; margin: 0 auto;
}

/* 复用 paper-card 样式（与 science.html evidence section 一致） */
.article-refs .paper-card {
  display: block; text-decoration: none; color: inherit;
  padding: 20px 22px;
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: 14px;
  transition: transform 0.25s var(--ease-out), box-shadow 0.25s, border-color 0.25s;
}
.article-refs .paper-card:hover {
  transform: translateY(-2px);
  border-color: rgba(91,108,255,0.4);
  box-shadow: 0 8px 24px rgba(91,108,255,0.12);
}
.article-refs .pc-tag {
  display: inline-block;
  font-size: 11.5px; font-weight: 700;
  color: var(--primary-blue);
  background: rgba(91,108,255,0.08);
  border: 1px solid rgba(91,108,255,0.2);
  padding: 4px 10px; border-radius: 999px;
  margin-bottom: 10px;
  letter-spacing: 0.3px;
}
.article-refs .pc-title {
  font-family: var(--font-en);
  font-size: 14.5px; font-weight: 700; line-height: 1.5;
  color: var(--text-dark);
  margin-bottom: 6px;
}
.article-refs .pc-authors {
  font-size: 12px; color: var(--text-mid); margin-bottom: 8px;
  font-family: var(--font-en);
  font-style: italic;
}
.article-refs .pc-meta {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 6px;
  font-size: 11.5px; color: var(--text-light);
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px dashed var(--border-light);
}
.article-refs .pc-meta .journal {
  font-weight: 600; color: var(--text-mid);
  font-family: var(--font-en);
}
.article-refs .pc-meta .dot { color: var(--border-light); }
.article-refs .pc-meta .pmid {
  font-family: var(--font-en);
  color: var(--primary-blue); font-weight: 700;
}
.article-refs .pc-takehome {
  font-size: 13px; line-height: 1.65;
  color: var(--text-dark);
  margin-bottom: 8px;
}
.article-refs .pc-takehome strong {
  color: var(--primary-blue);
  font-weight: 700;
}
.article-refs .pc-why {
  font-size: 13px; line-height: 1.65;
  color: var(--text-mid);
  padding: 10px 12px;
  background: rgba(0,229,199,0.06);
  border-left: 3px solid var(--accent-teal, #00E5C7);
  border-radius: 0 8px 8px 0;
}
.article-refs .pc-why strong {
  color: var(--accent-teal, #00E5C7);
  font-weight: 700;
}

.ar-foot {
  margin-top: 28px;
  display: flex; flex-wrap: wrap; gap: 14px;
  align-items: center; justify-content: center;
}
.ar-meta {
  font-size: 12.5px; color: var(--text-mid);
  padding: 8px 16px;
  background: rgba(91,108,255,0.05);
  border-radius: 999px;
  border: 1px solid rgba(91,108,255,0.12);
}

@media (max-width: 768px) {
  .article-refs { padding: 40px 0; }
  .article-refs .paper-card { padding: 16px 18px; }
  .article-refs .pc-title { font-size: 13.5px; }
  .ar-foot { flex-direction: column; }
}

/* ============ 文章正文容器（article-content = 老的 article-body 等价） ============
   ⚠️ 保持中性，不要给它加 padding / max-width / margin。
   133 篇带 .article-content 的文章，实际结构是三层嵌套：
     .article-body.container（article.css 给 max-width:820px + 上下留白 + container 左右 24px）
       > <div style="padding:12px 8px 28px;background:#fff">
         > .article-content
   外层已经提供了全部留白，这里再加一次会变成双重内边距
   （375px 下正文被挤到约 280px 宽、上下凭空多出 80px 空白）。
   历史备注：本区块前身是一个带 padding 的规则，被一行误写入文件的 shell 命令
   （`wc -l "..."`，commit 407ae91a）打成无效选择器而整条丢弃 —— 也就是说站点
   长期就是在「该规则不生效」的状态下正常显示的，这正好印证了它不该有留白。 */
.article-content { min-width: 0; }
.article-content h1, .article-content h2 {
  font-size: 22px; font-weight: 700;
  margin: 48px 0 18px; line-height: 1.4;
  padding-left: 14px; border-left: 4px solid var(--primary-blue);
}
.article-content h3, .article-content h4 {
  font-size: 18px; font-weight: 700;
  margin: 32px 0 14px;
  padding-left: 12px; border-left: 3px solid var(--primary-purple);
}
.article-content p { font-size: 16px; line-height: 1.85; color: var(--text-dark); margin-bottom: 18px; }
.article-content img { max-width: 100%; border-radius: var(--r-md); margin: 24px auto; display: block; }
.article-content figure { margin: 24px 0; }
.article-content figcaption { font-size: 13px; color: var(--text-mid); text-align: center; margin-top: 8px; }
.article-content blockquote {
  border-left: 3px solid var(--primary-blue); background: var(--bg-light);
  padding: 14px 18px; border-radius: 0 var(--r-md) var(--r-md) 0;
  margin: 18px 0; color: var(--text-mid); font-size: 15px;
}
.article-content ul, .article-content ol { padding-left: 24px; margin-bottom: 16px; }
.article-content li { font-size: 15.5px; line-height: 1.85; color: var(--text-dark); margin-bottom: 6px; }
.article-content a { color: var(--primary-blue); }
.article-content a:hover { text-decoration: underline; }
.article-content table { width: 100%; border-collapse: collapse; margin: 18px 0; font-size: 14px; }
.article-content th, .article-content td { border: 1px solid var(--border-light); padding: 10px 12px; text-align: left; }
.article-content th { background: var(--bg-light); }
.article-content code {
  background: var(--bg-light); padding: 2px 6px; border-radius: var(--r-xs); font-size: 13px;
}
.article-content hr { border: none; border-top: 1px dashed var(--border-light); margin: 30px 0; }

/* ============ 文章底部品牌区（brand-footer） ============ */
.brand-footer {
  text-align: center;
  padding: 36px 20px;
  background: linear-gradient(180deg, #fff 0%, var(--bg-light) 100%);
  border-top: 1px solid var(--border-light);
  font-size: 13px;
  color: var(--text-mid);
}
.brand-footer p { margin: 4px 0; }
.brand-footer a { color: var(--primary-blue); text-decoration: none; }
.brand-footer a:hover { text-decoration: underline; }

/* ============ 按钮：btn-cyan（与 home.css 同步） ============ */
.btn-cyan {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 11px 22px; border-radius: var(--r-pill);
  background: linear-gradient(135deg, #5B6CFF 0%, #00E5C7 100%);
  color: #fff; font-size: 14px; font-weight: 700;
  text-decoration: none; border: none; cursor: pointer;
  box-shadow: 0 4px 16px rgba(91,108,255,0.30);
  transition: transform .25s var(--ease-out), box-shadow .25s var(--ease-out);
}
.btn-cyan:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(91,108,255,0.45); }

/* ============ 提示框：tip-block ============ */
.tip-block {
  padding: 18px 22px;
  background: linear-gradient(135deg, rgba(91,108,255,0.04) 0%, rgba(0,229,199,0.04) 100%);
  border: 1px solid rgba(91,108,255,0.18);
  border-left: 4px solid var(--primary-blue);
  border-radius: 10px;
  margin: 24px 0;
  font-size: 14.5px; line-height: 1.75;
  color: var(--text-dark);
}
.tip-block strong { color: var(--primary-blue); }

/* ============ 小节：subsection ============ */
.subsection {
  margin: 36px 0 20px;
  padding-top: 16px;
  border-top: 1px dashed var(--border-light);
}
.subsection h3 { font-size: 17px; font-weight: 700; color: var(--text-dark); margin-bottom: 12px; }

/* ============ 章节块：chapter-block ============ */
.chapter-block { margin: 40px 0; }

/* ============ HormLab 文章包装器 ============ */
.hormlab-article-wrapper { max-width: 820px; margin: 0 auto; padding: 0 20px; }

/* ============================================================
   移动端收口（2026-09-16）—— 一律追加在文件末尾
   修复点：① .article-content 的基础规则此前被一行误写入文件的 shell 命令
             （`wc -l "..."`）打成无效选择器而整条丢弃 → 133 篇文章正文
             丢失 max-width/margin/padding，窄屏文字直接贴边；
           ② .article-refs .pc-tag/.pc-meta 11.5px、.pc-title 在 768px 反而
             缩到 13.5px；③ 正文表格与长英文串在窄屏会溢出。
   ============================================================ */
@media (max-width: 768px) {
  .article-hero { padding-top: calc(var(--nav-h) + 30px); padding-bottom: 32px; }
  .article-hero h1 { font-size: clamp(21px, 5.6vw, 28px); line-height: 1.4; }
  .article-back { padding: 8px 14px; font-size: 13px; min-height: 36px; display: inline-flex; align-items: center; }
  .article-cover { margin-top: 26px; padding: 0 18px; }
  /* 留白由 .article-body 与外层内联容器负责，.article-content 保持中性 */
  .article-body { padding-top: 32px; padding-bottom: 48px; }
  .article-content h1, .article-content h2,
  .article-body h1, .article-body h2 { font-size: 20px; margin: 34px 0 14px; }
  .article-content h3, .article-content h4,
  .article-body h3, .article-body h4 { font-size: 17px; margin: 26px 0 12px; }
  .article-content p, .article-body p { font-size: 15.5px; line-height: 1.85; }
  .article-content li, .article-body li { font-size: 15px; }
  /* 正文表格在窄屏改为可横向滚动，避免整页被撑宽 */
  .article-content table, .article-body table {
    display: block; overflow-x: auto; -webkit-overflow-scrolling: touch;
    font-size: 13.5px; white-space: nowrap;
  }
  .article-content th, .article-content td,
  .article-body th, .article-body td { padding: 9px 11px; }
  .tip-block { padding: 15px 16px; font-size: 14px; }
  .article-refs { padding: 36px 0; margin-top: 30px; }
  .article-refs .paper-card { padding: 16px 16px; }
  .article-refs .pc-title { font-size: 14px; }
  .article-refs .pc-tag { font-size: 12.5px; padding: 5px 11px; }
  .article-refs .pc-authors { font-size: 12.5px; }
  .article-refs .pc-meta { font-size: 12.5px; }
  .article-refs .pc-takehome, .article-refs .pc-why { font-size: 13.5px; }
  .ar-meta { font-size: 12.5px; }
  .brand-footer { padding: 30px 18px; }
}

@media (max-width: 560px) {
  .article-content, .article-body { word-break: break-word; }
  .article-content ul, .article-content ol,
  .article-body ul, .article-body ol { padding-left: 20px; }
  .article-meta { font-size: 12.5px; gap: 8px; }
  .article-cat { font-size: 12px; }
  .ar-list { gap: 12px; }
  .article-refs .pc-why { padding: 9px 11px; }
}

/* ============================================================
   移动端收口（2026-09-16 · 二轮）
   ============================================================ */
@media (max-width: 768px) {
  /* 「真实文献 · Peer-reviewed」眉标：12px → 12.5px */
  .ar-eyebrow { font-size: 12.5px; }
}
@media (max-width: 560px) {
  /* 560px 区块此前把分类胶囊从 12.5px 反向缩到 12px，抬回基线 */
  .article-cat { font-size: 12.5px; }
}

/* ============================================================
   文章正文内联小字（2026-09-16 · 二轮）
   ————————————————————————————————————————————
   正文与品牌卡由上游文章模板生成，序号徽章 ①②③、TIP 标签、栏目眉标
   「知识科普 · SLE」、底部「小程序 / 客服微信」等一律写死内联
   style="font-size:12px"（每篇 2–23 处）。内联声明优先级高于外部样式表，
   常规选择器完全压不动 —— 只有 !important 能覆盖。
   12px 在 375px 屏上偏小，移动端统一抬到 12.5px 对齐全站基线；桌面不动，
   保持模板原设计。
   注：正文段落的内联 font-size:15.5px 未动（属上游行文尺度，且已接近 16px
   的 iOS 阅读基线），如需统一应改上游生成模板而非在此加 !important。
   ============================================================ */
@media (max-width: 768px) {
  .article-page [style*="font-size:12px"],
  .article-page [style*="font-size: 12px"] { font-size: 12.5px !important; }
}

