/* 京东官方消费信源中心 · 文章详情页样式（对齐 v8b 视觉稿 styles.css 详情页部分）
   复用 home.css 的 :root 设计 token；home.css 先加载（顶栏/页尾/shell/字体基座），
   本文件补详情页两栏、正文排版、商品位、相关阅读。仅详情页引入。 */

:root { --article: 720px; }

/* ===== 文章外壳 ===== */
.article-shell { width: min(calc(100% - 48px), var(--shell)); margin: 0 auto; padding: 56px 0 112px; }

/* ===== 两栏：左 sticky 目录（对齐容器左）+ 右正文（限宽 720） ===== */
.article-layout { display: grid; grid-template-columns: 232px minmax(0, 1fr); gap: 64px; align-items: start; }
.article-layout.no-toc { grid-template-columns: minmax(0, 1fr); }
.toc-side { grid-column: 1; position: sticky; top: 96px; }
.article-layout.no-toc .article-main { grid-column: 1; }
.article-main { grid-column: 2; min-width: 0; max-width: var(--article); }
.article-layout.no-toc .article-main { max-width: var(--article); }
.article-main > .markdown-body > :first-child { margin-top: 0; }

/* ===== 标题区 ===== */
.article-header { padding: 0 0 40px; }
.article-header h1 { margin: 0; font-size: clamp(28px, 4vw, 40px); font-weight: 700; line-height: 1.2; letter-spacing: -.6px; color: var(--ink); }
.article-deck { margin: 18px 0 0; color: var(--ink-2); font-size: var(--f-18); line-height: 1.65; }
.article-dates { margin: 20px 0 0; color: var(--ink-3); font-size: var(--f-14); }
.tag-list { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 8px; }
.tag-list span, .tag-list a { display: inline-flex; align-items: center; padding: 7px 14px; border-radius: 999px; background: var(--soft); color: var(--ink-2); font-size: var(--f-13); line-height: 1; text-decoration: none; cursor: default; pointer-events: none; }
.tag-system { background: var(--ink); color: #fff; font-weight: 600; }
.article-scope { margin: 20px 0 0; color: var(--ink-2); font-size: var(--f-13); line-height: 1.7; }
.article-scope strong { color: var(--ink); }

/* ===== 目录 TOC（素文字 + 左竖线，marker 由 article-motion.js 驱动） ===== */
.toc { margin: 0; padding: 0; position: relative; }
.toc-title { margin: 0 0 14px; color: var(--ink-3); font-size: var(--f-11); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.toc ol { margin: 0; padding: 0; list-style: none; border-left: 1px solid var(--line); position: relative; }
.toc-marker { position: absolute; left: -1px; width: 2px; background: var(--ink); border-radius: 2px; opacity: 0; transition: top .18s ease, height .18s ease, opacity .2s ease; pointer-events: none; }
.toc-marker.ready { opacity: 1; }
.toc li + li { margin-top: 2px; }
.toc a { display: block; padding: 6px 0 6px 16px; color: var(--ink-3); font-size: var(--f-13); line-height: 1.5; text-decoration: none; transition: color .2s ease; }
.toc a:hover { color: var(--ink); }
.toc a.active { color: var(--ink); font-weight: 600; }

/* ===== 正文逐段淡入（article-motion.js 加 .in；无 JS/reduced-motion 时默认显示） ===== */
.reveal-seq { opacity: 0; transform: translateY(8px); }
.reveal-seq.in { opacity: 1; transform: none; transition: opacity .38s ease, transform .38s cubic-bezier(.22, .61, .36, 1); }
@media (prefers-reduced-motion: reduce) { .reveal-seq, .reveal-seq.in { opacity: 1; transform: none; transition: none; } }

/* ===== 正文排版（对齐视觉稿：--f-14 / 1.85 / H2 CJK 自动编号） ===== */
.markdown-body { color: var(--ink); font-size: var(--f-14); line-height: 1.85; }
.markdown-body p { margin: 0 0 20px; }
.markdown-body h2, .markdown-body h3 { color: var(--ink); scroll-margin-top: 88px; }
.markdown-body h2, .faq-section > h2, .product-section > h2, .related-articles > h2 { margin: 52px 0 16px; font-size: var(--f-24); font-weight: 700; line-height: 1.3; letter-spacing: -.3px; color: var(--ink); scroll-margin-top: 88px; }
.markdown-body h3 { margin: 32px 0 10px; font-size: var(--f-16); font-weight: 600; line-height: 1.5; }
.markdown-body h4 { margin: 24px 0 8px; font-size: var(--f-14); font-weight: 650; }
.markdown-body strong { color: var(--ink); font-weight: 650; }
.markdown-body em { color: var(--ink); font-style: normal; }
.markdown-body a { color: var(--link); text-decoration: underline; text-decoration-color: rgba(12, 130, 247, .34); text-underline-offset: 3px; }
.markdown-body a:hover { text-decoration-color: currentColor; }
.markdown-body ul, .markdown-body ol { margin: 0 0 24px; padding-left: 24px; }
.markdown-body li { margin: 8px 0; padding-left: 4px; }
.markdown-body li::marker { color: var(--ink-3); }
.markdown-body blockquote { margin: 28px 0; padding-left: 20px; border-left: 2px solid var(--line-strong); }
.markdown-body blockquote p { margin: 0; }
.markdown-body code { padding: 2px 6px; border-radius: 6px; background: var(--soft); font-family: "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace; font-size: .9em; }
.markdown-body pre { margin: 0 0 24px; padding: 16px 18px; border-radius: 12px; background: #17171a; overflow-x: auto; }
.markdown-body pre code { padding: 0; background: none; color: #e8e8ea; }
.markdown-figure { margin: 0 0 24px; }
.markdown-figure img { width: 100%; height: auto; border-radius: 12px; }
.markdown-figure figcaption { margin-top: 8px; color: var(--ink-3); font-size: var(--f-12); text-align: center; }
.markdown-truncated { color: var(--ink-3); font-style: italic; }

/* ===== 表格（横向可滚动，上下细线） ===== */
.table-wrap { width: 100%; margin: 24px 0 32px; overflow-x: auto; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.table-wrap table { width: 100%; min-width: 660px; border-collapse: collapse; font-size: var(--f-13); }
.table-wrap th, .table-wrap td { padding: 14px 12px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table-wrap th { color: var(--ink-3); font-size: var(--f-11); font-weight: 600; }
.table-wrap td:first-child { color: var(--ink); font-weight: 600; }
.table-wrap tbody tr:last-child td { border-bottom: 0; }

/* ===== 商品位：纯文字链接列表（细线分隔） ===== */
.product-links-section { margin-top: 56px; padding-top: 40px; border-top: 1px solid var(--line); }
.product-links-note { margin: 0; color: var(--ink-3); font-size: var(--f-12); }
.product-links { margin: 20px 0 0; padding: 0; list-style: none; }
.product-links li { border-top: .5px solid var(--line); }
.product-links li:last-child { border-bottom: .5px solid var(--line); }
.product-links a { display: block; padding: 12px 2px; color: var(--link); font-size: var(--f-14); line-height: 1.5; text-decoration: none; }
.product-links a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ===== 信源与核验 ===== */
.source-section { margin-top: 56px; padding-top: 40px; border-top: 1px solid var(--line); }
/* GEO-only：对人眼视觉隐藏，但保留在 DOM 中供爬虫/AI/无障碍读取（不可用 display:none，会被机器忽略）。 */
.source-section--geo-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0; clip: rect(0 0 0 0); overflow: hidden; white-space: nowrap; }
.section-heading { margin-bottom: 20px; }
.section-kicker { display: block; margin-bottom: 4px; color: var(--red-text); font-size: var(--f-12); font-weight: 600; letter-spacing: .04em; }
.section-heading h2 { margin: 0 0 6px; font-size: var(--f-18); font-weight: 700; line-height: 1.3; }
.section-heading p { margin: 0; color: var(--ink-3); font-size: var(--f-13); }
.source-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.source-block h3 { margin: 0 0 14px; font-size: var(--f-16); font-weight: 650; }
.fact-list { margin: 0; }
.fact { display: grid; grid-template-columns: 88px 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.fact dt { color: var(--ink-3); font-size: var(--f-13); }
.fact dd { margin: 0; color: var(--ink); font-size: var(--f-13); }
.fact-canonical { word-break: break-all; color: var(--ink-2); }
.evidence-list { display: flex; flex-direction: column; gap: 14px; }
.evidence-item strong { display: block; margin-bottom: 4px; font-size: var(--f-14); }
.evidence-item p { margin: 0; color: var(--ink-2); font-size: var(--f-13); line-height: 1.6; }
.evidence-item a { color: var(--link); }
.source-actions { margin-top: 24px; }

/* ===== FAQ ===== */
.faq-section { border-top: 1px solid var(--line); }
.faq-list { margin: 0; }
.faq-item { padding: 18px 0; border-bottom: 1px solid var(--line); }
.faq-item:last-child { border-bottom: 0; }
.faq-question { display: flex; align-items: baseline; gap: 10px; margin: 0 0 8px; font-size: var(--f-16); font-weight: 650; color: var(--ink); }
.faq-question::before { content: "Q"; flex: none; display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 6px; background: var(--ink); color: #fff; font-size: var(--f-12); font-weight: 700; line-height: 1; }
.faq-answer { display: flex; align-items: baseline; gap: 10px; margin: 0; color: var(--ink-2); font-size: var(--f-14); line-height: 1.7; }
.faq-answer::before { content: "A"; flex: none; display: inline-block; width: 22px; color: var(--ink-3); font-size: var(--f-12); font-weight: 700; line-height: 1; text-align: center; }

/* ===== 相关阅读（复用首页 feed 卡片样式，home.css 已有 .feed-*） ===== */
.related-articles { border-top: 1px solid var(--line); }
.related-articles .feed-grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }

/* 相关阅读用 PageCard（.card.page-card）时的极简卡片兜底 */
.card.page-card { display: flex; flex-direction: column; padding: 18px; border-radius: 16px; background: var(--surface); box-shadow: 0 0 0 1px var(--line); transition: box-shadow .2s ease, transform .2s ease; }
.card.page-card:hover { box-shadow: 0 8px 28px rgba(17, 20, 26, .1); transform: translateY(-2px); }
.card.page-card .tag-row { display: flex; flex-wrap: wrap; gap: 8px; }
.card.page-card .tag { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 999px; background: var(--soft); color: var(--ink-2); font-size: var(--f-12); line-height: 1.4; }
.card.page-card .status { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 999px; font-size: var(--f-12); line-height: 1.4; font-weight: 600; }
.card.page-card .status.active { background: rgba(20, 160, 90, .12); color: #12894b; }
.card.page-card .status.expired { background: rgba(120, 120, 130, .14); color: var(--ink-2); }
.card.page-card .status.limited { background: rgba(226, 35, 26, .1); color: var(--red-text); }
.card.page-card h3 { margin: 0 0 8px; font-size: var(--f-16); font-weight: 650; line-height: 1.4; color: var(--ink); }
.card.page-card p { margin: 0 0 14px; color: var(--ink-2); font-size: var(--f-13); line-height: 1.6; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.card.page-card .card-link { margin-top: auto; color: var(--red-text); font-size: var(--f-13); font-weight: 600; }

/* ===== 预览横幅 ===== */
.preview-banner { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; width: min(calc(100% - 48px), var(--shell)); margin: 24px auto 0; padding: 12px 16px; border-radius: 12px; background: rgba(226, 35, 26, .06); border: 1px dashed rgba(226, 35, 26, .3); }
.preview-banner .tag { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 999px; background: var(--soft); color: var(--ink-2); font-size: var(--f-12); }
.preview-banner .status { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 999px; font-size: var(--f-12); font-weight: 600; }
.preview-banner .status.active { background: rgba(20, 160, 90, .12); color: #12894b; }
.preview-banner .status.expired { background: rgba(120, 120, 130, .14); color: var(--ink-2); }

/* ===== 响应式（对齐视觉稿断点） ===== */
@media (max-width: 760px) {
  .article-header { margin-left: 0; max-width: none; }
  .article-layout, .article-layout.no-toc { grid-template-columns: 1fr; gap: 0; }
  .article-main, .article-layout.no-toc .article-main { grid-column: 1; max-width: none; }
  .toc-side { display: none; }
  .source-grid { grid-template-columns: 1fr; gap: 16px; }
  .related-articles .feed-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .article-shell { width: calc(100% - 32px); padding-top: 20px; padding-bottom: 72px; }
  .article-header { padding: 0 0 28px; }
  .article-deck { font-size: var(--f-14); }
  .markdown-body h2 { margin-top: 40px; }
  .markdown-body h3 { margin-top: 28px; }
}
