/* 使用手册：沿用首页的颜色、字体、导航和页脚（../styles.css），这里只管文档排版 */
.m-wrap { max-width: 1180px; margin: 0 auto; padding: 116px 32px 120px; }

.m-head { max-width: 760px; margin: 0 0 64px calc(220px + 56px); }
.m-head h1 { font-size: clamp(38px, 5vw, 60px); font-weight: 700; line-height: 1.1; margin: 12px 0 18px; }
.m-head .lede { font-size: 18px; color: var(--ink-2); text-wrap: pretty; }
.m-facts { display: flex; flex-wrap: wrap; gap: 8px; margin: 22px 0 0; padding: 0; list-style: none; }
.m-facts li { padding: 5px 12px; border-radius: 999px; font-size: 13.5px; font-weight: 600; color: var(--ink-2); background: var(--glass); box-shadow: inset 0 0 0 1px var(--glass-edge); }
.m-note { margin-top: 18px; font-size: 13.5px; color: var(--ink-3); }

.m-grid { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 56px; align-items: start; }

/* 目录：桌面端固定在左边跟着滚动，当前节高亮 */
.toc { position: sticky; top: 88px; max-height: calc(100vh - 108px); overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.toc summary { display: none; }
.toc ol { list-style: none; margin: 0; padding: 0 0 0 2px; display: grid; gap: 1px; }
.toc a { display: block; padding: 6px 12px; border-radius: 10px; font-size: 14px; line-height: 1.45; color: var(--ink-2); text-decoration: none; transition: background .2s, color .2s; }
.toc a:hover { color: var(--ink); background: var(--glass); }
.toc a[aria-current="true"] { color: var(--brand); font-weight: 600; background: var(--glass-strong); box-shadow: inset 0 0 0 1px var(--glass-edge); }
.toc .group { margin: 12px 12px 4px; font-size: 12px; font-weight: 600; letter-spacing: .06em; color: var(--ink-3); }

/* 正文 */
.m-body { min-width: 0; max-width: 860px; }
.m-body section { padding: 0; margin: 0 0 96px; scroll-margin-top: 92px; }
.m-body .num { font-size: 13px; font-weight: 600; letter-spacing: .08em; color: var(--brand); }
.m-body h2 { font-size: clamp(28px, 3.2vw, 36px); font-weight: 700; line-height: 1.2; margin: 6px 0 14px; }
.m-body h3 { font-size: 19px; font-weight: 650; margin: 34px 0 10px; }
.m-body p { font-size: 16.5px; line-height: 1.8; color: var(--ink-2); text-wrap: pretty; }
.m-body p + p { margin-top: 10px; }
.m-body p b, .m-body li b { color: var(--ink); font-weight: 600; }
.m-body a { color: var(--brand); text-underline-offset: 3px; }
.m-body ul, .m-body ol { margin: 12px 0; padding-left: 1.3em; color: var(--ink-2); font-size: 16.5px; line-height: 1.8; }
.m-body li + li { margin-top: 6px; }

/* 步骤：带序号的圆点 */
.m-body ol.steps { list-style: none; padding: 0; counter-reset: step; }
.m-body ol.steps > li { position: relative; padding-left: 40px; counter-increment: step; }
.m-body ol.steps > li::before {
  content: counter(step); position: absolute; left: 0; top: 2px;
  width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 13px; font-weight: 700; color: #fff;
  background: linear-gradient(180deg, #4a78e6, var(--brand));
}

/* 提示 */
.tip { margin: 20px 0 0; padding: 14px 18px; border-radius: 16px; background: var(--glass); box-shadow: inset 0 0 0 1px var(--glass-edge); }
.m-body .tip { font-size: 15px; line-height: 1.75; }
.tip::before { content: "提示"; display: inline-block; margin-right: 8px; padding: 1px 8px; border-radius: 6px; font-size: 12.5px; font-weight: 700; color: var(--brand); background: rgba(47, 95, 208, .1); }
.tip.warn::before { content: "注意"; color: #b4521b; background: rgba(255, 140, 60, .16); }

/* 截图：Retina 图按一半像素宽显示，窄的面板不拉大 */
figure { margin: 26px 0; }
figure img { width: 100%; height: auto; border-radius: 14px; background: #f5f7fb; box-shadow: 0 0 0 1px rgba(21, 35, 61, .08), 0 18px 44px -20px rgba(37, 72, 150, .35); }
figure.fit img { width: var(--w); max-width: 100%; margin: 0 auto; }
figure.flat img { border-radius: 10px; box-shadow: 0 0 0 1px rgba(21, 35, 61, .08), 0 10px 24px -16px rgba(37, 72, 150, .35); }
figcaption { margin-top: 12px; font-size: 14px; line-height: 1.6; color: var(--ink-3); text-align: center; text-wrap: pretty; }
.figs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin: 26px 0; align-items: start; }
.figs figure { margin: 0; }

kbd {
  display: inline-block; min-width: 1.7em; padding: 0 .45em; margin: 0 1px;
  border-radius: 6px; font: 600 .86em/1.7 var(--sans); text-align: center; color: var(--ink);
  background: #fff; box-shadow: inset 0 -1px 0 rgba(21, 35, 61, .18), 0 0 0 1px rgba(21, 35, 61, .12);
  white-space: nowrap;
}
.path { white-space: nowrap; font-weight: 600; color: var(--ink); }
.m-body code { padding: 1px 6px; border-radius: 6px; font: .9em/1.6 ui-monospace, "SF Mono", Menlo, monospace; color: var(--ink); background: rgba(255, 255, 255, .7); box-shadow: inset 0 0 0 1px rgba(21, 35, 61, .08); overflow-wrap: anywhere; }
.nav nav a[aria-current="page"] { color: var(--ink); font-weight: 600; }

/* 快捷键表 */
.keys { width: 100%; margin: 20px 0; border-collapse: separate; border-spacing: 0; font-size: 15px; border-radius: 16px; overflow: hidden; background: var(--glass); box-shadow: inset 0 0 0 1px var(--glass-edge); }
.keys th, .keys td { padding: 11px 16px; text-align: left; vertical-align: top; line-height: 1.6; }
.keys th { font-size: 13px; font-weight: 600; color: var(--ink-3); background: rgba(255, 255, 255, .45); }
.keys td { color: var(--ink-2); border-top: 1px solid rgba(21, 35, 61, .06); }
.keys td:first-child { width: 9.5em; color: var(--ink); }
.keys tr.sub td { padding-top: 16px; font-size: 13px; font-weight: 600; letter-spacing: .04em; color: var(--brand); background: rgba(255, 255, 255, .3); }

/* 常见问题：沿用首页的 .qa 折叠项 */
.m-body .qa-list { margin: 20px 0 0; max-width: none; }
.m-body .qa p { font-size: 15.5px; }

.m-end { margin-top: 24px; display: flex; flex-wrap: wrap; gap: 12px; }

@media (max-width: 980px) {
  .m-wrap { padding: 104px 24px 96px; }
  .m-head { margin: 0 0 28px; }
  .m-grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .m-body { max-width: none; }

  /* 手机、平板：目录折叠成导航下面的一条，展开后列表自己滚动 */
  .toc {
    top: 70px; z-index: 5; margin: 0 0 40px; max-height: none; overflow: visible;
    border-radius: 16px; background: var(--glass-strong);
    backdrop-filter: blur(22px) saturate(1.6); -webkit-backdrop-filter: blur(22px) saturate(1.6);
    box-shadow: inset 0 0 0 1px var(--glass-edge), 0 10px 30px -14px rgba(37, 72, 150, .3);
  }
  .toc summary {
    display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 18px;
    cursor: pointer; list-style: none; font-size: 15px; font-weight: 600;
  }
  .toc summary::-webkit-details-marker { display: none; }
  .toc summary::after {
    content: ""; flex: none; margin-left: auto; width: 8px; height: 8px; margin-top: -4px;
    border: solid var(--ink-2); border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); transition: transform .25s, margin .25s;
  }
  .toc[open] summary::after { transform: rotate(225deg); margin-top: 4px; }
  /* 目录条贴到顶上以后（.stuck），和导航之间垫一层天色，正文不从两条之间的缝里露出来 */
  .toc::before {
    content: ""; position: absolute; z-index: -1; left: -40px; right: -40px; top: -72px; height: 76px; pointer-events: none;
    background: linear-gradient(180deg, rgba(243, 247, 255, .97) 0%, rgba(243, 247, 255, .94) 82%, rgba(243, 247, 255, 0));
  }
  .toc:not(.stuck)::before { opacity: 0; }
  .toc summary .now { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; color: var(--brand); }
  .toc ol { max-height: min(60vh, 520px); overflow: auto; padding: 0 8px 10px; }
  .m-body section { margin-bottom: 72px; scroll-margin-top: 136px; }
}

@media (max-width: 640px) {
  .m-wrap { padding: 92px 16px 80px; }
  .m-head .lede { font-size: 16.5px; }
  .m-body p, .m-body ul, .m-body ol { font-size: 16px; }
  .figs { grid-template-columns: minmax(0, 1fr); }
  figure img { border-radius: 10px; }
  .keys { font-size: 14px; }
  .keys th, .keys td { padding: 10px 12px; }
  .keys td:first-child { width: 7.2em; }
  .tip { padding: 12px 14px; }
}
