/* ---------- 文档导航条 ---------- */
.dc-bar { position: sticky; top: var(--header-h); z-index: 60; height: 52px; border-bottom: 1px solid var(--line); background: var(--white); }
.dc-bar-in { display: flex; align-items: center; gap: 32px; height: 100%; padding: 0 var(--wrap-x); }
.dc-bar-title { display: flex; flex: none; align-items: center; gap: 8px; font-size: 16px; font-weight: 600; color: var(--title); }
.dc-bar-nav { display: flex; flex: 1; gap: 28px; min-width: 0; }
.dc-bar-nav a { font-size: 14px; color: var(--text); white-space: nowrap; transition: color var(--dur-1); }
.dc-bar-nav a:hover { color: var(--brand-500); }
.dc-bar-search { display: flex; flex: none; align-items: center; width: 300px; height: 34px; border: 1px solid var(--line-strong); border-radius: var(--r-xs); transition: border-color var(--dur-1), box-shadow var(--dur-1); }
.dc-bar-search:focus-within { border-color: var(--brand-400); box-shadow: var(--ring); }
.dc-bar-search input { flex: 1; min-width: 0; height: 100%; padding: 0 12px; border: 0; background: none; font-size: 14px; }
.dc-bar-search button { display: flex; align-items: center; justify-content: center; width: 40px; height: 100%; background: var(--brand-500); color: var(--white); }
.dc-bar-search svg, .dc-side-search svg, .dch-search > svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
body[data-section="docs"] { background: var(--white); }

/* ---------- 布局：左目录 / 正文 / 本页目录 ---------- */
/* 随 #main 撑到转化条，不用 100vh：否则短页正文和页脚之间留白 */
.dc-layout {
  display: grid;
  grid-template-columns: 272px minmax(0, 1fr);
  margin: 0 var(--wrap-x);
  flex: 1 1 auto;
  align-content: stretch;
  background: linear-gradient(var(--fill-1), var(--fill-1)) 0 0 / 272px 100% no-repeat;
}
.dc-layout--article { grid-template-columns: 272px minmax(0, 1fr) 240px; }
.dc-side {
  position: sticky;
  top: calc(var(--header-h) + 52px);
  align-self: start;
  box-sizing: border-box;
  min-height: 100%;
  max-height: calc(100vh - var(--header-h) - 52px);
  max-height: calc(100dvh - var(--header-h) - 52px);
  overflow-y: auto;
  padding: 16px 12px 40px;
  border-right: 1px solid var(--line);
  background: var(--fill-1);
  overscroll-behavior: contain;
}
.dc-side-head { display: flex; align-items: center; gap: 8px; padding: 6px 8px 14px; font-size: 16px; font-weight: 600; line-height: 24px; color: var(--title); }
.dc-side-head svg { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
.dc-side-search { display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 10px; border: 1px solid var(--line); border-radius: var(--r-xs); background: var(--white); color: var(--muted); transition: border-color var(--dur-1); }
.dc-side-search:focus-within { border-color: var(--brand-400); }
.dc-side-search input { flex: 1; min-width: 0; height: 100%; border: 0; background: none; font-size: 14px; color: var(--title); }
.dc-tree { margin-top: 12px; }
.dc-tree-link { position: relative; display: block; padding: 7px 12px 7px 24px; border-radius: var(--r-xs); font-size: 14px; line-height: 22px; color: var(--text); transition: background var(--dur-1), color var(--dur-1); }
.dc-tree > .dc-tree-link { padding-left: 12px; font-weight: 500; color: var(--title); }
.dc-tree-link:hover { color: var(--brand-500); }
.dc-tree-link.is-current { background: var(--fill-2); color: var(--brand-500); font-weight: 500; }
.dc-tree-link.is-current::before { content: ""; position: absolute; top: 8px; bottom: 8px; left: 0; width: 2px; border-radius: 2px; background: var(--brand-500); }
.dc-tree-group > summary { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; border-radius: var(--r-xs); font-size: 14px; font-weight: 500; line-height: 22px; color: var(--title); cursor: pointer; list-style: none; }
.dc-tree-group > summary::-webkit-details-marker { display: none; }
.dc-tree-group > summary:hover { color: var(--brand-500); }
.dc-tree-group[open] > summary .caret { transform: rotate(180deg); }
.dc-tree-empty { padding: 16px 12px; font-size: 14px; color: var(--muted); }

.dc-main { min-width: 0; max-width: 960px; padding: 28px 48px 72px; }
.dc-crumb { margin-bottom: 16px; }
.dc-title { font-size: 24px; font-weight: 600; line-height: 34px; color: var(--title); }
.dc-meta { display: flex; flex-wrap: wrap; gap: 4px 20px; margin-top: 8px; font-size: 12px; line-height: 18px; color: var(--muted); }
.dc-summary { margin-top: 20px; padding: 12px 16px; border-left: 3px solid var(--brand-200); border-radius: 0 var(--r-xs) var(--r-xs) 0; background: var(--fill-1); font-size: 14px; line-height: 24px; color: var(--sub); }

/* 正文 */
.dc-body { margin-top: 8px; font-size: 16px; line-height: 28px; color: var(--text); }
.dc-body h2 { margin: 36px 0 12px; padding-top: 4px; font-size: 20px; font-weight: 600; line-height: 30px; color: var(--title); scroll-margin-top: calc(var(--header-h) + 72px); }
.dc-body h3 { margin: 24px 0 8px; font-size: 16px; font-weight: 600; color: var(--title); }
.dc-body p { margin: 12px 0; }
.dc-body ul { margin: 12px 0; }
.dc-body ul li { position: relative; margin-top: 8px; padding-left: 20px; }
.dc-body ul li::before { content: ""; position: absolute; top: 12px; left: 6px; width: 5px; height: 5px; border-radius: 50%; background: var(--brand-400); }
/* 文档中心后台编辑器（Markdown）生成的正文 */
.dc-body ol:not(.dc-steps) { margin: 12px 0; padding-left: 24px; list-style: decimal; }
.dc-body ol:not(.dc-steps) li { margin-top: 8px; }
.dc-body a { color: var(--brand-500); }
.dc-body a:hover { text-decoration: underline; }
.dc-body img { max-width: 100%; height: auto; margin: 12px 0; border-radius: var(--r-xs); }
.dc-body blockquote { margin: 16px 0; padding: 12px 16px; border-left: 3px solid var(--brand-200); background: var(--fill-1); font-size: 14px; line-height: 24px; color: var(--sub); }
.dc-body pre { margin: 16px 0; padding: 12px 16px; overflow-x: auto; border-radius: var(--r-sm); background: var(--fill-1); font-size: 14px; line-height: 22px; }
.dc-body code { font-family: Consolas, Menlo, monospace; font-size: 14px; }
.dc-steps { display: grid; gap: 12px; margin: 16px 0; counter-reset: s; }
.dc-steps li { position: relative; display: grid; gap: 2px; padding: 14px 16px 14px 56px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--white); counter-increment: s; }
.dc-steps li::before { content: counter(s); position: absolute; top: 15px; left: 16px; display: flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; background: var(--brand-500); color: var(--white); font-size: 14px; font-weight: 600; }
.dc-steps b { font-size: 16px; font-weight: 600; line-height: 26px; color: var(--title); }
.dc-steps span { font-size: 14px; line-height: 22px; color: var(--sub); }
.dc-table { margin: 16px 0; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-sm); }
.dc-table table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 22px; }
.dc-table th { padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--fill-1); font-weight: 600; color: var(--title); text-align: left; white-space: nowrap; }
.dc-table td { padding: 10px 16px; border-bottom: 1px solid var(--line-soft); color: var(--text); vertical-align: top; }
.dc-table tr:last-child td { border-bottom: 0; }
.dc-note { display: flex; gap: 12px; margin: 16px 0; padding: 12px 16px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--fill-1); font-size: 14px; line-height: 24px; }
.dc-note b { flex: none; color: var(--brand-600); }
.dc-note p { margin: 0; color: var(--text); }
.dc-note.is-warn { border-color: var(--accent-200); background: var(--accent-50); }
.dc-note.is-warn b { color: var(--accent-600); }

.dc-feedback { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--line); font-size: 14px; color: var(--sub); }
.dc-feedback button { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 16px; border: 1px solid var(--line-strong); border-radius: var(--r-xs); font-size: 14px; color: var(--text); transition: border-color var(--dur-1), color var(--dur-1), background var(--dur-1); }
.dc-feedback button:hover, .dc-feedback button.is-on { border-color: var(--brand-400); background: var(--white); color: var(--brand-500); }
.dc-pager { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 24px; }
.dc-pager a { display: flex; flex-direction: column; gap: 4px; padding: 16px 20px; border: 1px solid var(--line); border-radius: var(--r-sm); transition: border-color var(--dur-1); }
.dc-pager a:hover { border-color: var(--brand-300); }
.dc-pager a.is-next { text-align: right; }
.dc-pager small { font-size: 12px; color: var(--muted); }
.dc-pager b { font-size: 16px; font-weight: 500; color: var(--title); }
.dc-pager a:hover b { color: var(--brand-500); }
.dc-related { margin-top: 40px; }
.dc-related h2 { font-size: 18px; font-weight: 600; line-height: 26px; color: var(--title); }
.dc-related ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 24px; margin-top: 12px; }
.dc-related a { display: block; padding: 6px 0; font-size: 14px; color: var(--brand-500); }
.dc-related a:hover { color: var(--brand-600); text-decoration: underline; }

.dc-toc { position: sticky; top: calc(var(--header-h) + 52px); align-self: start; padding: 32px 24px 0 0; }
.dc-toc > p { margin-bottom: 10px; font-size: 14px; font-weight: 600; color: var(--title); }
.dc-toc nav { border-left: 1px solid var(--line); }
.dc-toc nav a { position: relative; display: block; padding: 5px 0 5px 14px; font-size: 14px; line-height: 20px; color: var(--sub); transition: color var(--dur-1); }
.dc-toc nav a:hover { color: var(--brand-500); }
.dc-toc nav a.is-active { color: var(--brand-600); font-weight: 500; }
.dc-toc nav a.is-active::before { content: ""; position: absolute; top: 5px; bottom: 5px; left: -1px; width: 2px; background: var(--brand-500); }
.dc-toc-help { display: grid; gap: 6px; margin-top: 28px; padding: 16px; border-radius: var(--r-sm); background: var(--fill-1); font-size: 14px; }
.dc-toc-help b { color: var(--title); font-weight: 600; }
.dc-toc-help a { color: var(--brand-500); }

/* ---------- 产品文档首页 ---------- */
.dc-home { padding-top: 36px; }
.dc-home-head { display: flex; align-items: flex-start; gap: 20px; }
.dc-home-head h1 { font-size: 24px; font-weight: 600; line-height: 34px; color: var(--title); }
.dc-home-ico { display: flex; flex: none; align-items: center; justify-content: center; width: 64px; height: 64px; border-radius: var(--r-card); background: var(--grad-brand); }
.dc-lead { max-width: 760px; margin-top: 8px; font-size: 14px; line-height: 24px; color: var(--sub); }
.dc-home-btns { display: flex; flex-wrap: wrap; gap: 12px; padding: 24px 0 32px; border-bottom: 1px solid var(--line); }
.dc-home-btns .btn { border-radius: var(--r-xs); }
.dc-row { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 24px; padding: 32px 0; border-bottom: 1px dashed var(--line); }
.dc-row h2 { display: flex; align-items: center; gap: 10px; align-self: start; font-size: 18px; font-weight: 600; line-height: 26px; color: var(--title); }
.dc-row-body { display: grid; gap: 20px; min-width: 0; }
.dc-row-group h3 { font-size: 16px; font-weight: 600; line-height: 24px; color: var(--title); }
.dc-row-group ul { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px 24px; margin-top: 8px; }
.dc-row-group a, .dc-hot a { font-size: 14px; line-height: 24px; color: var(--sub); transition: color var(--dur-1); }
.dc-row-group a:hover, .dc-hot a:hover { color: var(--brand-500); }
.dc-quick { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.dc-quick a { display: block; height: 100%; padding: 16px; border: 1px solid var(--line); border-radius: var(--r-sm); transition: border-color var(--dur-1), box-shadow var(--dur-1); }
.dc-quick a:hover { border-color: var(--brand-300); box-shadow: var(--sh-1); }
.dc-quick b { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 600; line-height: 24px; color: var(--title); }
.dc-quick i { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border: 1.5px solid var(--brand-500); border-radius: 50%; color: var(--brand-500); font-size: 12px; font-style: normal; }
.dc-quick small { display: block; margin-top: 6px; font-size: 14px; line-height: 22px; color: var(--sub); }
.dc-hot { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 24px; }
.dc-hot li { position: relative; padding-left: 14px; }
.dc-hot li::before { content: ""; position: absolute; top: 10px; left: 0; width: 5px; height: 5px; border-radius: 50%; background: var(--brand-300); }
.dc-count { margin-top: 24px; font-size: 12px; color: var(--muted); }
.dc-home-cat { margin-bottom: 2px; font-size: 12px; line-height: 18px; color: var(--muted); }
/* 适用产品：书绑定的商品 */
.dc-apply { padding-top: 32px; }
.dc-apply h2 { font-size: 18px; font-weight: 600; line-height: 26px; color: var(--title); }
.dc-apply-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
.dc-apply-card { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--white); transition: border-color var(--dur-2), box-shadow var(--dur-2); }
.dc-apply-card:hover { border-color: var(--brand-200); box-shadow: var(--sh-1); }
.dc-apply-card > span:not(.logo-tile) { flex: 1; min-width: 0; }
.dc-apply-card b { display: block; font-size: 14px; font-weight: 600; line-height: 22px; color: var(--title); }
.dc-apply-card small { display: block; font-size: 12px; line-height: 18px; color: var(--muted); }
.dc-apply-card .arrow-r { width: 6px; height: 6px; color: var(--muted); }
.dc-toc-apply { margin-top: 24px; font-size: 14px; }
.dc-toc-apply p { margin-bottom: 6px; font-weight: 600; color: var(--title); }
.dc-toc-apply a { display: flex; align-items: center; gap: 8px; padding: 5px 0; color: var(--text); transition: color var(--dur-1); }
.dc-toc-apply a:hover { color: var(--brand-500); }

/* ---------- 文档首页：页头、搜索框、四格条、区块头用 components.css 的 ds-*；白区块用浅灰卡 ---------- */
.dch-hot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-top: 12px; font-size: 14px; color: var(--muted); }
.dch-hot a { color: var(--text); transition: color var(--dur-1); }
.dch-hot a:hover { color: var(--brand-500); }
.ds-strip-band + .dch-main { padding-top: 56px; }
.dch-results { margin-bottom: 48px; padding: 24px 28px; border-radius: var(--r-card); background: var(--fill-1); scroll-margin-top: calc(var(--header-h) + 16px); }
.dch-results-head { display: flex; align-items: baseline; gap: 16px; }
.dch-results-head h2 { font-size: 20px; font-weight: 600; color: var(--title); }
.dch-results-head p { flex: 1; font-size: 14px; color: var(--sub); }
.dch-results-head button { font-size: 14px; color: var(--brand-500); }
.dch-results ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 24px; margin-top: 12px; }
.dch-results li a { display: flex; flex-direction: column; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.dch-results li b { font-size: 14px; font-weight: 500; color: var(--title); }
.dch-results li a:hover b { color: var(--brand-500); }
.dch-results li small { font-size: 12px; color: var(--muted); }
.dch-none { font-size: 14px; color: var(--sub); }
.dch-none a { color: var(--brand-500); }
.dch-grid { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 40px; }
.dch-side { position: sticky; top: calc(var(--header-h) + 16px); align-self: start; }
.dch-side-title { margin-bottom: 12px; font-size: 16px; font-weight: 600; color: var(--title); }
.dch-side-nav { display: grid; gap: 2px; margin-top: 12px; }
.dch-side-nav a { position: relative; display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: var(--r-xs); font-size: 14px; color: var(--text); transition: background var(--dur-1), color var(--dur-1); }
.dch-side-nav a:hover { color: var(--brand-500); }
.dch-side-nav a.is-active { background: var(--fill-2); color: var(--brand-500); font-weight: 500; }
.dch-side-nav a.is-active::before { content: ""; position: absolute; top: 8px; bottom: 8px; left: 0; width: 2px; background: var(--brand-500); }
.dch-cat { margin-bottom: 48px; scroll-margin-top: calc(var(--header-h) + 16px); }
.dch-cat:last-of-type { margin-bottom: 0; }
.dch-cat-title { font-size: 24px; font-weight: 600; line-height: 34px; color: var(--title); }
.dch-cat-title small { margin-left: 12px; font-size: 14px; font-weight: 400; color: var(--muted); }
/* 文档卡：图标格 / 书名 / 简介（M54：分类下面是一本本文档） */
.dch-books { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 20px; }
.dch-book { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 16px 20px; border-radius: var(--r-card); background: var(--fill-1); transition: transform var(--dur-3) var(--ease-out), box-shadow var(--dur-3), background var(--dur-3); }
.dch-book:hover { transform: translateY(-4px); background: var(--white); box-shadow: var(--sh-2); }
.dch-book .logo-tile--mark { background: var(--white); }
.dch-book > span { min-width: 0; }
.dch-book b { display: block; font-size: 18px; font-weight: 600; line-height: 26px; color: var(--title); }
.dch-book small { display: block; margin-top: 2px; font-size: 14px; line-height: 22px; color: var(--sub); }
.dch-books:has(> :only-child) { grid-template-columns: 1fr; }
.dch-side-group > summary { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: var(--r-xs); font-size: 14px; font-weight: 500; line-height: 22px; color: var(--title); cursor: pointer; list-style: none; }
.dch-side-group > summary::-webkit-details-marker { display: none; }
.dch-side-group > summary .caret { width: 10px; height: 6px; margin-left: auto; fill: none; stroke: currentColor; stroke-width: 1.6; transition: transform var(--dur-2); }
.dch-side-group[open] > summary .caret { transform: rotate(180deg); }
.dch-side-group > a { padding-left: 40px; }
.dch-empty { padding: 40px 0; font-size: 14px; color: var(--muted); text-align: center; }
.dch-path-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.dch-path-grid article { padding: 24px; border-radius: var(--r-card); background: var(--white); box-shadow: var(--sh-1); }
.dch-path-grid h3 { font-size: 18px; font-weight: 600; line-height: 26px; color: var(--title); }
.dch-path-grid p { margin-top: 4px; font-size: 14px; color: var(--sub); }
.dch-path-grid ol { margin-top: 14px; counter-reset: p; }
.dch-path-grid li { position: relative; padding: 6px 0 6px 28px; counter-increment: p; }
.dch-path-grid li::before { content: counter(p); position: absolute; top: 8px; left: 0; display: flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 50%; background: var(--fill-2); color: var(--brand-500); font-size: 12px; }
.dch-path-grid a { font-size: 14px; color: var(--text); transition: color var(--dur-1); }
.dch-path-grid a:hover { color: var(--brand-500); }

@media (max-width: 1240px) {
  .dc-layout--article { grid-template-columns: 252px minmax(0, 1fr); }
  .dc-toc { display: none; }
  .dc-bar-nav { display: none; }
}

@media (max-width: 900px) {
  .dc-bar { position: relative; top: 0; height: auto; }
  .dc-bar-in { flex-wrap: wrap; gap: 8px 16px; padding: 10px var(--pad-x); }
  .dc-bar-search { width: 100%; }
  .dc-layout, .dc-layout--article { grid-template-columns: 1fr; margin-left: 0; margin-right: 0; background: none; }
  .dc-side { position: static; height: auto; min-height: 0; max-height: none; padding: 12px var(--pad-x); border-right: 0; border-bottom: 1px solid var(--line); }
  .dc-tree { display: none; }
  .dc-side:focus-within .dc-tree { display: block; }
  .dc-main { padding: 20px var(--pad-x) 48px; }
  .dch-hot a, .dc-bar-nav a, .dch-path-grid a { display: inline-flex; align-items: center; min-height: 40px; }
  .dc-body { font-size: 14px; line-height: 26px; }
  .dc-body h2 { font-size: 18px; line-height: 28px; }
  .dc-steps li { padding-left: 48px; }
  .dc-steps li::before { left: 12px; }
  .dc-pager, .dc-related ul { grid-template-columns: 1fr; }
  .dc-home-head { gap: 14px; }
  .dc-row { grid-template-columns: 1fr; gap: 12px; padding: 24px 0; }
  .dc-row-group ul, .dc-quick, .dc-hot { grid-template-columns: 1fr; }
  .ds-strip-band + .dch-main { padding-top: 32px; }
  .dch-results ul { grid-template-columns: 1fr; }
  .dch-grid { grid-template-columns: 1fr; gap: 16px; }
  .dch-side { position: static; }
  .dch-side-nav { display: none; }
  .dch-books, .dc-apply-list { grid-template-columns: 1fr; }
  .dch-path-grid { grid-template-columns: 1fr; }
}
