/* 开发文档 — 对照行业聚合支付 /doc 版式 */
.doc-wrap {
  --d-ink: #1f2a37;
  --d-muted: #6b7280;
  --d-line: #e5eaf0;
  --d-accent: #1677ff;
  --d-bg: #f5f7fb;
  --d-code: #0b1220;
  --d-radius: 12px;
}
.doc-wrap .doc-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}
.doc-wrap .doc-toc {
  position: sticky;
  top: 72px;
  background: #fff;
  border: 1px solid var(--d-line);
  border-radius: var(--d-radius);
  padding: 12px 10px 14px;
  max-height: calc(100vh - 96px);
  overflow: auto;
  box-shadow: 0 6px 20px rgba(15, 34, 58, .04);
}
.doc-wrap .doc-toc .t {
  font-size: 13px;
  font-weight: 700;
  color: #94a3b8;
  padding: 6px 10px 10px;
}
.doc-wrap .doc-toc .g {
  margin: 10px 10px 4px;
  font-size: 12px;
  font-weight: 700;
  color: #94a3b8;
  letter-spacing: .04em;
}
.doc-wrap .doc-toc a {
  display: block;
  padding: 7px 10px;
  border-radius: 8px;
  color: #334155;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 1px;
  text-decoration: none;
}
.doc-wrap .doc-toc a.sub {
  padding-left: 18px;
  font-size: 12.5px;
  color: #475569;
}
.doc-wrap .doc-toc a:hover,
.doc-wrap .doc-toc a.active {
  background: #eef5ff;
  color: var(--d-accent);
}
.doc-wrap .doc-main { min-width: 0; }
.doc-wrap .doc-sec {
  background: #fff;
  border: 1px solid var(--d-line);
  border-radius: var(--d-radius);
  padding: 22px 24px 20px;
  margin-bottom: 14px;
  box-shadow: 0 6px 20px rgba(15, 34, 58, .03);
  scroll-margin-top: 80px;
}
.doc-wrap .doc-sec h1 {
  margin: 0 0 14px;
  font-size: 22px;
  font-weight: 700;
  color: var(--d-ink);
  letter-spacing: -.02em;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--d-line);
}
.doc-wrap .doc-sec h3 {
  margin: 18px 0 10px;
  font-size: 16px;
  color: var(--d-ink);
}
.doc-wrap .doc-sec h4 {
  margin: 16px 0 8px;
  font-size: 14px;
  color: #334155;
  font-weight: 700;
}
.doc-wrap .doc-sec p {
  margin: 8px 0;
  line-height: 1.75;
  color: #334155;
  font-size: 14px;
}
.doc-wrap .doc-sec .muted { color: var(--d-muted); }
.doc-wrap .doc-sec code {
  background: #f1f5f9;
  padding: 2px 6px;
  border-radius: 5px;
  font-size: 12.5px;
  color: #0f172a;
}
.doc-wrap .doc-sec a { color: var(--d-accent); }
.doc-wrap .rule-list {
  margin: 8px 0 4px;
  padding-left: 1.2em;
  color: #334155;
  font-size: 14px;
  line-height: 1.9;
}
.doc-wrap .doc-sec table {
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0 4px;
  font-size: 13px;
  border: 1px solid var(--d-line);
  border-radius: 8px;
  overflow: hidden;
}
.doc-wrap .doc-sec th,
.doc-wrap .doc-sec td {
  border-bottom: 1px solid var(--d-line);
  border-right: 1px solid var(--d-line);
  padding: 10px 10px;
  text-align: left;
  vertical-align: top;
}
.doc-wrap .doc-sec th:last-child,
.doc-wrap .doc-sec td:last-child { border-right: 0; }
.doc-wrap .doc-sec tr:last-child td { border-bottom: 0; }
.doc-wrap .doc-sec th {
  background: #f8fafc;
  color: #64748b;
  font-weight: 600;
  white-space: nowrap;
}
.doc-wrap .step {
  display: flex; gap: 10px; align-items: flex-start;
  margin: 8px 0;
  font-size: 14px;
  color: #334155;
  line-height: 1.65;
}
.doc-wrap .step i {
  flex-shrink: 0;
  width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--d-accent); color: #fff;
  font-size: 12px; font-style: normal; font-weight: 700;
  margin-top: 2px;
}
.doc-wrap .codebox {
  position: relative;
  margin: 12px 0;
  border-radius: 10px;
  overflow: hidden;
  background: var(--d-code);
  border: 1px solid #1e293b;
}
.doc-wrap .codebox .bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px;
  background: #111827;
  color: #94a3b8;
  font-size: 12px;
}
.doc-wrap .codebox .copy {
  border: 0; background: #1f2937; color: #e2e8f0;
  border-radius: 6px; padding: 4px 10px; cursor: pointer; font-size: 12px;
}
.doc-wrap .codebox .copy:hover { background: #334155; }
.doc-wrap .codebox pre {
  margin: 0;
  padding: 14px 16px 16px;
  overflow: auto;
  color: #e2e8f0;
  font-size: 12.5px;
  line-height: 1.6;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: pre-wrap;
  word-break: break-word;
}
.doc-wrap .addr-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 12px 0;
}
.doc-wrap .addr-card {
  border: 1px solid var(--d-line);
  border-radius: 10px;
  padding: 14px;
  background: #f8fafc;
}
.doc-wrap .addr-card .k { font-size: 12px; color: var(--d-muted); margin-bottom: 6px; }
.doc-wrap .addr-card .v { font-size: 13px; font-weight: 600; word-break: break-all; }
.doc-wrap .type-row {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px;
}
.doc-wrap .type-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px; border-radius: 999px;
  background: #fff; border: 1px solid var(--d-line); font-size: 12px;
}
.doc-wrap .type-pill img { width: 18px; height: 18px; object-fit: contain; }

@media (max-width: 900px) {
  .doc-wrap .doc-layout { grid-template-columns: 1fr; }
  .doc-wrap .doc-toc {
    position: static;
    max-height: none;
    display: flex; flex-wrap: wrap; gap: 4px;
  }
  .doc-wrap .doc-toc .t,
  .doc-wrap .doc-toc .g { width: 100%; margin: 6px 0 2px; }
  .doc-wrap .doc-toc a { display: inline-block; margin: 0; }
  .doc-wrap .addr-grid { grid-template-columns: 1fr; }
  .doc-wrap .doc-sec { padding: 16px; }
  .doc-wrap .doc-sec table { display: block; overflow-x: auto; }
}

/* 公开文档壳层 */
.doc-shell { min-height: 100vh; background: var(--d-bg, #f5f7fb); }
.doc-shell .doc-top {
  height: 56px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 22px;
  color: #1f2a37;
  background: #fff;
  border-bottom: 1px solid #e5eaf0;
  box-shadow: 0 1px 0 rgba(15, 34, 58, .02);
  position: sticky;
  top: 0;
  z-index: 20;
}
.doc-shell .doc-top .brand {
  display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 15px;
}
.doc-shell .doc-top .brand .mark {
  width: 28px; height: 28px; border-radius: 8px;
  display: grid; place-items: center;
  background: #1677ff; color: #fff; font-size: 13px;
}
.doc-shell .doc-top .brand .sub {
  opacity: .65; font-weight: 500; font-size: 13px; margin-left: 2px;
}
.doc-shell .doc-top .links a {
  color: #475569; margin-left: 16px; font-size: 13px; text-decoration: none;
}
.doc-shell .doc-top .links a:hover { color: #1677ff; }
.doc-shell .doc-body {
  max-width: 1120px; margin: 0 auto; padding: 20px 18px 56px;
}
