/* =========================================================================
 * content.css — 内容页（/compare/* · /guides/*）
 *
 * 与 legal.css 平级：法务页引 style.css + legal.css，内容页引
 * style.css + content.css。两者都复用 style.css 的变量与 .btn/.topbar/.footer，
 * 本文件只放内容页才有的东西（对比表、要点卡、章节锚点）。
 *
 * 为什么不把这套规则塞进 style.css：应用首页是前端渲染的整屏交互，
 * 内容页只有文字和表格，混在一起会让两边都背负对方用不到的规则。
 * ========================================================================= */

.content { padding: 34px 0 76px; }

/* ------------------------------------------------------------- 面包屑 */
.c-crumb {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 14px;
}
/* 面包屑用普通选择器即可 —— 因为下面那条通用链接规则被 :where() 压到了 0,1,0，
   比这里的 0,1,1 低，不会再抢走颜色。 */
.c-crumb a { color: var(--muted); }
.c-crumb a:hover { color: var(--accent); }
.c-crumb span { opacity: .55; margin: 0 6px; }

/* --------------------------------------------------------------- 头部 */
.content h1 {
  font-size: 36px;
  line-height: 1.16;
  letter-spacing: -.025em;
  margin: 0 0 12px;
}
.c-lede {
  font-size: 17.5px;
  line-height: 1.62;
  color: var(--text-2);
  margin: 0 0 20px;
  max-width: 68ch;
}
.c-updated {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 22px;
}

.c-btnrow { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 8px; }

@media (max-width: 640px) {
  .content h1 { font-size: 28px; }
  .c-lede { font-size: 16px; }
}

/* ------------------------------------------------------------- 章节 */
.content h2 {
  font-size: 22px;
  letter-spacing: -.015em;
  margin: 44px 0 12px;
  scroll-margin-top: 78px;
}
.content h3 {
  font-size: 16.5px;
  font-weight: 650;
  margin: 26px 0 8px;
  scroll-margin-top: 78px;
}
.content p {
  font-size: 15.5px;
  line-height: 1.74;
  color: var(--text-2);
  margin: 0 0 14px;
  max-width: 72ch;
}
.content p.c-sub {
  font-size: 15px;
  color: var(--muted);
  margin: -6px 0 14px;
}
.content ul.c-ul,
.content ol.c-ol {
  font-size: 15.5px;
  line-height: 1.72;
  color: var(--text-2);
  margin: 0 0 16px;
  padding-left: 21px;
  max-width: 72ch;
}
.content ul.c-ul li,
.content ol.c-ol li { margin: 0 0 7px; }
.content strong { color: var(--text); }
/* 正文里的链接上色。两个约束缺一不可：
 *
 * ① `:not(.btn)` —— `.content a`（0,1,1）会压过 `.btn-primary` 的
 *    `color:#fff`（0,1,0）。2026-10-20 线上就是这个原因：主按钮变成一块
 *    没有文字的蓝色圆角块（蓝底蓝字）。这条不排除按钮，事故就会复现。
 *
 * ② `:where()` —— 把整条选择器的权重压到 0,1,0（只剩 `.content`）。
 *    不压的话它是 0,2,1，会把 `.c-crumb a`（0,1,1）这类更具体的小规则
 *    一起盖掉，面包屑被刷成链接蓝。压到底之后，谁更具体谁说了算，
 *    不再依赖「哪个文件后加载」这种看不见的顺序。
 *
 * 不要为了修这个加 !important —— 那只是把问题往后推一层。
 */
.content :where(a:not(.btn)) { color: var(--accent); }

/* --------------------------------------------------- 对比表（可横滚） */
.c-tw {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  margin: 0 0 16px;
}
.c-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14.5px;
  min-width: 640px;
}

/* 短列表格（单元格是个位数或一个短词）：手机上换行，**不要横滚**。
   横滚看起来只是「不太好看」，真实代价是右边那列根本没人知道它存在 ——
   权重表如果横滚，读者看到的是规则名，看不到权重，而这一页讲的就是权重。
   对比表相反：三列都是整句，换行会挤成竖条，所以那边保持横滚。 */
.c-tw.is-fluid .c-table { min-width: 0; }
@media (max-width: 640px) {
  .c-tw.is-fluid .c-table { font-size: 13.6px; }
  .c-tw.is-fluid .c-table th,
  .c-tw.is-fluid .c-table td { padding: 9px 10px; }
  .c-tw.is-fluid .c-table thead th { white-space: normal; }
}
.c-table th,
.c-table td {
  text-align: left;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  line-height: 1.55;
}
.c-table thead th {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
  font-weight: 600;
  background: var(--surface-2);
  white-space: nowrap;
}
/* 本列是本网站：用强调色标出，别让表格变成「三家中立」的假象 */
.c-table th.is-self,
.c-table td.is-self { background: var(--accent-soft); }
.c-table th.is-self { color: var(--accent-2); }
.c-table tbody tr:last-child th,
.c-table tbody tr:last-child td { border-bottom: 0; }
.c-table tbody th {
  font-weight: 600;
  font-size: 14.5px;
  color: var(--text);
  white-space: nowrap;
}
.c-table td { color: var(--text-2); }

.c-y { color: var(--ok); font-weight: 600; }
.c-n { color: var(--muted); }
.c-big { font-size: 16px; font-weight: 700; color: var(--text); }
.c-once { display: block; font-size: 12.5px; font-weight: 500; color: var(--ok); }

/* --------------------------------------------------------- 提示 / 卡片 */
.c-note {
  border: 1px solid var(--border);
  border-left: 3px solid var(--warn);
  background: var(--warn-soft);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin: 0 0 18px;
  font-size: 14.5px;
  line-height: 1.66;
  color: var(--text-2);
  max-width: 74ch;
}
.c-note strong { color: var(--text); }
.c-note p:last-child { margin-bottom: 0; }

.c-box {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin: 0 0 18px;
  max-width: 74ch;
}
.c-box p:last-child,
.c-box ul:last-child { margin-bottom: 0; }

/* --------------------------------------------- 21 项检查（五组网格） */
.c-checks {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
  gap: 12px;
  margin: 0 0 18px;
}
.c-checks section {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
}
.c-checks h3 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted);
  margin: 0 0 9px;
  font-weight: 650;
}
.c-checks ul {
  margin: 0;
  padding-left: 17px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-2);
}
.c-checks li { margin: 0 0 5px; }

/* ------------------------------------------------------------- 问答 */
.c-qa { margin: 0 0 18px; }
.c-qa dt {
  font-weight: 650;
  font-size: 15.5px;
  color: var(--text);
  margin: 16px 0 5px;
}
.c-qa dd {
  margin: 0;
  font-size: 15px;
  line-height: 1.72;
  color: var(--text-2);
  max-width: 72ch;
}

/* ------------------------------------------------------------- 结尾 CTA */
.c-cta {
  margin: 40px 0 0;
  padding: 26px 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  text-align: center;
}
.c-cta h2 {
  margin: 0 0 8px;
  font-size: 21px;
}
.c-cta p {
  margin: 0 auto 18px;
  color: var(--muted);
  max-width: 54ch;
}
.c-cta .c-btnrow { justify-content: center; }

/* ----------------------------------------------------------- 商标声明 */
.c-tm {
  font-size: 13px;
  color: var(--muted);
  margin: 34px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  max-width: 74ch;
}

/* ------------------------------------------------------- 锚点定位
 * 顶栏是 sticky 的。不加 scroll-margin-top 的话，从目录点 #parsing
 * 跳过去，目标标题会被顶栏压住 —— 看起来像「点了没反应」。
 * 这是内容页的通病，不是 guides 专有，所以写在通用层。 */
.content h2[id],
.content h3[id] { scroll-margin-top: 78px; }

/* --------------------------------------------------------- 页内目录
 * 长文页（guides/…）才有。作用有两个：让读者一眼看到要滚多久，
 * 以及给爬虫一张章节地图。窄屏退成一列，否则两列的链接会折行折断。 */
.c-toc {
  margin: 0 0 34px;
  padding: 15px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
}
.c-toc p {
  margin: 0 0 9px;
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  font-weight: 650;
}
.c-toc ol {
  margin: 0;
  padding-left: 18px;
  font-size: 14.5px;
  line-height: 1.8;
  color: var(--text-2);
  columns: 2;
  column-gap: 30px;
}
.c-toc li { margin: 0 0 2px; }
@media (max-width: 640px) {
  .c-toc ol { columns: 1; }
}

/* ------------------------------------------------- 单条规则的「怎么修」
 * 21 条规则如果每条都套一个 .c-box，页面会变成 21 个方块摞在一起，
 * 读到第十条就想关掉。左绿边 + 无边框更轻，视线能一路滑下去。 */
.c-fix {
  margin: -6px 0 26px;
  padding: 9px 14px;
  border-left: 3px solid var(--ok);
  background: var(--surface);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 14.5px;
  line-height: 1.68;
  color: var(--text-2);
  max-width: 74ch;
}
.c-fix strong { color: var(--text); }

/* ------------------------------------------------------------ 语言切换
 * 只在**页脚**出现，且只在「这一页已经有好几门语言」时由构建注入
 * （tools/render-content.mjs 的 langSwitcher）。
 * 顶栏不放：顶栏是 brand + 一个按钮，390px 下再加三个词会横向溢出，
 * 而这个站已经为横向溢出修过两次。
 * 不进 style.css：首页的语言切换是另一套（app.js + <select>），别混。 */
.langnav {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  margin-right: 10px;
}
.langnav a,
.langnav-cur {
  font-size: 13px;
  line-height: 1;
  padding: 4px 7px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  white-space: nowrap;
}
.langnav a { color: var(--muted); }
.langnav a:hover { color: var(--accent); background: var(--surface-2); }
/* 当前语言：给个能看出来的底，但不要做成按钮，因为它点不动 */
.langnav-cur {
  color: var(--text);
  font-weight: 600;
  background: var(--surface-2);
}
.langnav-sep { color: var(--muted); opacity: .5; font-size: 12px; }
