/* =========================================================
   文章页通用样式 article.css
   轻量、使用系统字体，不依赖首页的 style.css
   PC 正文 ≥16px，次要文字 ≥14px（符合可读性要求）
   以后所有 /guide/ 下的文章页都复用这一个文件
   ========================================================= */

:root {
  --ink: #1a1a1a;
  --ink-soft: #555;
  --line: #e5e5e5;
  --bg: #ffffff;
  --accent: #0b64f0;
  --maxw: 760px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
  font-size: 17px;
  line-height: 1.75;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* 顶栏 */
.site-bar {
  border-bottom: 1px solid var(--line);
}
.site-bar .wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.site-bar .brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--ink);
  font-size: 17px;
}
.site-bar .brand img { width: 28px; height: 28px; border-radius: 7px; }
.site-bar .brand:hover { text-decoration: none; }
.site-bar nav { display: flex; gap: 18px; margin-left: 8px; }
.site-bar nav a { color: var(--ink-soft); font-size: 15px; }
.site-bar nav a[aria-current] { color: var(--ink); font-weight: 500; }
.bar-download {
  margin-left: auto;
  padding: 7px 16px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: 14px;
  white-space: nowrap;
}
.bar-download:hover { text-decoration: none; opacity: 0.88; }

/* 下载按钮 */
.dl-buttons { display: flex; flex-wrap: wrap; gap: 12px; margin: 8px 0 4px; }
.dl-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: 16px;
}
.dl-button.is-secondary { background: #fff; color: var(--ink); border: 1px solid #cfd0d6; }
.dl-button:hover { text-decoration: none; opacity: 0.88; }
.dl-button[aria-disabled="true"] { color: #8a8b92; border-color: #e2e3e8; cursor: default; pointer-events: none; }
.dl-button[aria-disabled="true"] img { opacity: 0.45; }
.dl-button img { width: 18px; height: 18px; }
.dl-button:not(.is-secondary) img { filter: invert(1); }

/* 步骤卡 */
.steps { list-style: none; padding: 0; counter-reset: step; }
.steps > li {
  counter-increment: step;
  position: relative;
  padding: 4px 0 4px 46px;
  margin: 0 0 18px;
}
.steps > li::before {
  content: counter(step, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 4px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #eef0f6;
  font-size: 14px;
  font-weight: 600;
  line-height: 32px;
  text-align: center;
}
.steps strong { display: block; font-size: 17px; }

.todo { color: #a15c00; background: #fff6e5; padding: 1px 6px; border-radius: 4px; font-size: 15px; }

/* 容器 */
.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 24px 20px 64px;
}

/* 面包屑 */
.breadcrumb {
  font-size: 14px;
  color: var(--ink-soft);
  margin: 8px 0 24px;
}
.breadcrumb a { color: var(--ink-soft); }
.breadcrumb span[aria-current] { color: var(--ink); }

/* 文章排版 */
article h1 {
  font-size: 30px;
  line-height: 1.3;
  margin: 0 0 8px;
}
.article-meta { color: var(--ink-soft); font-size: 14px; margin-bottom: 28px; }

article h2 {
  font-size: 22px;
  margin: 40px 0 12px;
  padding-top: 8px;
}
article h3 { font-size: 18px; margin: 28px 0 8px; }
article p { margin: 0 0 16px; }
article ul, article ol { margin: 0 0 16px; padding-left: 22px; }
article li { margin: 6px 0; }

article img { max-width: 100%; height: auto; border-radius: 8px; }

.callout {
  border-left: 3px solid var(--accent);
  background: #f5f8ff;
  padding: 12px 16px;
  border-radius: 6px;
  margin: 20px 0;
  font-size: 16px;
}

pre, code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
pre {
  background: #f6f6f6;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 16px;
  overflow-x: auto;
  font-size: 16px;
  line-height: 1.6;
}
code { background: #f0f0f0; padding: 2px 6px; border-radius: 4px; font-size: 0.9em; }
pre code { background: none; padding: 0; font-size: inherit; }

/* 相关链接 / 页脚 */
.related {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
.related h2 { font-size: 18px; margin: 0 0 12px; }
.site-foot {
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 14px;
  text-align: center;
  padding: 28px 20px 32px;
}
.site-foot p { margin: 6px 0 0; }
.foot-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 18px;
  margin-bottom: 10px;
}
.foot-links a { color: var(--ink-soft); }

@media (max-width: 600px) {
  body { font-size: 16px; }
  article h1 { font-size: 25px; }
  article h2 { font-size: 20px; }
}

/* 表格（下载入口、对比表） */
.table-wrap { overflow-x: auto; margin: 8px 0 20px; }
article table { width: 100%; border-collapse: collapse; font-size: 16px; line-height: 1.6; }
article th, article td { border: 1px solid var(--line); padding: 10px 12px; text-align: left; vertical-align: top; }
article th { background: #f6f7fa; font-weight: 600; white-space: nowrap; }
article td code { word-break: break-all; }

/* 报错条目 */
.issue { border: 1px solid var(--line); border-radius: 10px; padding: 4px 18px 6px; margin: 0 0 16px; }
.issue h3 { margin-top: 16px; }
.issue p { margin: 0 0 10px; }

/* 提问示例 */
.prompt {
  background: #f7f7f2;
  border: 1px solid #e8e8dd;
  border-radius: 8px;
  padding: 12px 16px;
  margin: 0 0 16px;
  font-size: 16px;
}
.lead { font-size: 18px; color: #333; }
.pkg-table td:nth-child(2) code, .pkg-table td:nth-child(3) { white-space: nowrap; word-break: normal; }

/* 教程列表与多一项导航后的窄屏换行 */
article .blog-list { list-style: none; padding: 0; margin-top: 24px; }
.blog-list > li { border-top: 1px solid var(--line); margin: 0; padding: 16px 0; }
.blog-list h2 { font-size: 20px; margin: 0 0 6px; padding: 0; }
.blog-list p { margin: 0 0 6px; }
.blog-list .article-meta { margin: 0; }
.site-bar nav { flex-wrap: wrap; }
.site-bar nav a { white-space: nowrap; }
@media (max-width: 700px) {
  .site-bar .wrap { flex-wrap: wrap; gap: 10px 12px; }
  .site-bar nav { order: 3; width: 100%; margin-left: 0; gap: 6px 16px; }
}

/* 上线前未填的“待填”不显示；填好后删掉 span.todo，并去掉对应元素上的 data-pending */
.todo, [data-pending] { display: none !important; }

/* 顶栏比正文宽：6 个导航 + 站名 + 下载按钮放得下，站名不断行 */
.site-bar .wrap { max-width: 1080px; }
.site-bar .brand, .site-bar nav a, .bar-download { white-space: nowrap; }
@media (max-width: 600px) {
  .site-bar nav { flex-wrap: wrap; row-gap: 6px; }
}
/* 行内代码（长路径、长命令）在窄屏可断行，避免撑宽页面；代码块仍横向滚动 */
article :not(pre) > code { overflow-wrap: anywhere; }
