/* ===================== 文章系统样式（基于平台令牌） ===================== */
.article-app { max-width: 760px; margin: 0 auto; padding: 28px 18px 40px; }

/* 顶部导航（全站通用） */
.topnav {
  display: flex; align-items: center; justify-content: space-between;
  max-width: 960px; margin: 0 auto; padding: 16px 18px;
  font-size: 14px;
}
.topnav .brand { font-weight: 800; color: var(--ink, #1D1D1F); text-decoration: none; font-size: 16px; letter-spacing: 1px; }
.topnav .links { display: flex; gap: 16px; flex-wrap: wrap; }
.topnav .links a { color: var(--ink-dim, #6E6E73); text-decoration: none; }
.topnav .links a:hover { color: var(--accent, #0071E3); }
@media (max-width: 560px) { .topnav .links { gap: 10px; font-size: 13px; } }

/* 文章页 */
.article-meta { color: var(--ink-faint, #A1A1A6); font-size: 13px; margin-bottom: 18px; }
.article-meta .cat { color: var(--accent, #0071E3); font-weight: 600; margin-right: 8px; }
.article-body { font-size: 15.5px; line-height: 2.0; color: #2b2b2e; }
.article-body h2 { font-size: 20px; margin: 30px 0 12px; line-height: 1.5; }
.article-body h3 { font-size: 16.5px; margin: 22px 0 8px; }
.article-body p { margin-bottom: 14px; }
.article-body ul, .article-body ol { margin: 0 0 14px 22px; }
.article-body li { margin-bottom: 6px; }
.article-body blockquote {
  border-left: 3px solid var(--accent, #0071E3);
  background: rgba(0, 113, 227, 0.05);
  padding: 12px 16px; margin: 16px 0;
  color: var(--ink-dim, #444); border-radius: 0 10px 10px 0;
  font-size: 14.5px;
}
.article-body strong { color: var(--ink, #1D1D1F); }
/* 阅读体验 · 无声的关心 */
.article-body a { color: var(--accent, #0071E3); text-underline-offset: 3px; }
.article-body a:hover { text-decoration-thickness: 2px; }
.article-body p, .article-body li { text-wrap: pretty; }   /* 避免孤字/孤词独占末行 */
.article-body { hanging-punctuation: first allow-end; }    /* 收尾标点可悬出对齐线外 */
@media (max-width: 560px) {
  .article-body { font-size: 16px; }   /* 手机端正文加大半号，长文不费力 */
}
.article-cta {
  margin-top: 30px; padding: 22px; text-align: center;
  background: linear-gradient(120deg, rgba(0, 113, 227, 0.06), rgba(66, 161, 255, 0.09));
  border-radius: 18px;
}
.article-cta p { font-size: 14px; color: var(--ink-dim, #6E6E73); margin-bottom: 14px; }
.article-nav { display: flex; justify-content: space-between; margin-top: 28px; font-size: 13.5px; flex-wrap: wrap; gap: 8px; }
.article-nav a { color: var(--ink-dim, #6E6E73); text-decoration: none; }
.article-nav a:hover { color: var(--accent, #0071E3); }

/* ---------- 交互打磨 · 入场 ---------- */
/* 正文整段轻微抬升入场：翻页瞬间内容「浮上来」而不是「砸下来」 */
.article-app { animation: screenIn 0.4s var(--ease, ease-out) both; }

/* 文章索引卡错峰入场 + 触屏按压反馈 */
.articles-grid .acard { animation: screenIn 0.45s var(--ease, ease-out) both; }
.articles-grid .acard:nth-child(2) { animation-delay: 0.05s; }
.articles-grid .acard:nth-child(3) { animation-delay: 0.10s; }
.articles-grid .acard:nth-child(4) { animation-delay: 0.15s; }
.articles-grid .acard:nth-child(5) { animation-delay: 0.20s; }
.articles-grid .acard:nth-child(6) { animation-delay: 0.25s; }
.articles-grid .acard:nth-child(n+7) { animation-delay: 0.30s; }
.acard:active { transform: scale(0.98); }
.cat-section { animation: screenIn 0.4s var(--ease, ease-out) both; }

/* 文章索引 */
.articles-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 720px) { .articles-grid { grid-template-columns: 1fr; } }
.acard {
  background: #fff; border-radius: 18px; padding: 20px 22px;
  box-shadow: 0 4px 6px rgba(0,0,0,.05); text-decoration: none; color: inherit;
  display: flex; flex-direction: column; gap: 6px;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.acard:hover { transform: scale(1.02); box-shadow: 0 12px 28px rgba(0,0,0,.09); }
.acard .cat { font-size: 12px; font-weight: 600; color: var(--cat, var(--accent, #0071E3)); }
.acard h2 { font-size: 16.5px; line-height: 1.5; }
.acard p { font-size: 13.5px; color: var(--ink-dim, #6E6E73); line-height: 1.6; }
.cat-section { margin: 30px 0 14px; font-size: 18px; font-weight: 700; }

/* ---------- 双语切换 ---------- */
html[lang="en"] .lang-zh { display: none !important; }
html:not([lang="en"]) .lang-en { display: none !important; }
.lang-toggle {
  border: 1px solid var(--line, #D2D2D7); background: transparent; cursor: pointer;
  font: inherit; font-size: 12px; padding: 3px 9px; border-radius: 999px;
  color: var(--ink-dim, #6E6E73);
}
.lang-toggle[aria-pressed="true"] { background: var(--accent, #0071E3); color: #fff; border-color: var(--accent, #0071E3); }
.lang-toggle-group { display: inline-flex; gap: 4px; align-items: center; }

/* ---------- 英文排版 ---------- */
/* 栏宽：760px 对英文约 95 词符，远超 45-75 的舒适区间 */
html[lang="en"] .article-app { max-width: 680px; }
html[lang="en"] .article-body { font-size: 16px; line-height: 1.7; }
html[lang="en"] .article-body p { margin-bottom: 1em; }
html[lang="en"] .article-body li { margin-bottom: .4em; line-height: 1.7; }
html[lang="en"] .article-body blockquote { font-size: 15px; line-height: 1.62; }
html[lang="en"] .article-body h2 { line-height: 1.28; letter-spacing: -0.01em; }
/* 文章 h1 带内联 line-height:1.4，需 !important 才能覆盖 */
html[lang="en"] .article-app h1 { line-height: 1.24 !important; }
html[lang="en"] .acard h2 { line-height: 1.3; }
html[lang="en"] .acard p { line-height: 1.55; }
html[lang="en"] .article-cta p { line-height: 1.6; }
html[lang="en"] .article-nav { line-height: 1.5; }

/* 「测评是怎么算的」卡片底部链接（双语共用） */
.cs-link { margin: 4px 0 0; }
.cs-link a { color: var(--accent, #0071E3); font-weight: 600; text-decoration: none; font-size: 13px; }
.cs-link a:hover { text-decoration: underline; }

/* ---------- 导航字号与语言切换位置 ----------
   1) 字号：14px→15px（移动 13px→14px）。中文 13px 偏小，英文更挤。
   2) 中/EN 切换胶囊推到导航栏最右，并用细分隔线与链接区隔开；
      窄屏下链接换行时，胶囊自动落到第二行最右。
   注意：index.html 还会加载 hub.css（在 article.css 之后），
   hub 的 .topnav .brand{font-size:17px} 会覆盖同优先级规则，
   因此品牌字号用 .topnav a.brand 提高一级优先级。 */
.topnav { font-size: 15px; flex-wrap: wrap; row-gap: 8px; column-gap: 24px; }
.topnav a.brand { font-size: 18px; letter-spacing: 0.02em; }
.topnav .links { flex: 1 1 auto; align-items: center; min-width: 0; gap: 18px; }
.topnav .links a { padding: 6px 2px; }   /* 触击热区加高，视觉不变 */
.topnav .links .lang-toggle-group {
  margin-left: auto;              /* 推到最右 */
  padding-left: 16px;
  border-left: 1px solid var(--line, #E5E5EA);
}
.lang-toggle { font-size: 12.5px; padding: 5px 12px; }   /* 加大点击热区 */
@media (max-width: 560px) {
  .topnav { font-size: 14px; position: relative; }
  .topnav a.brand { font-size: 16.5px; }
  /* 链接必须独占一行（flex-basis 100%），否则会与品牌同行换行、被绝对定位的胶囊盖住 */
  .topnav .links { flex-basis: 100%; gap: 14px; font-size: 14px; }
  /* 窄屏：切换胶囊改用绝对定位放到第一行最右（与品牌同行），
     链接独占第二行 —— 避免胶囊自己占一整行浪费纵向空间 */
  .topnav .links .lang-toggle-group {
    position: absolute;
    top: 16px;
    right: 18px;
    margin-left: 0;
    padding-left: 12px;
  }
}
