/* 使用说明 · CodeBuddy 风格文档布局 */
:root {
  --docs-accent: #0d9488;
  --docs-accent-soft: #e6f7f5;
  --docs-ink: #1f2329;
  --docs-ink-2: #4e5969;
  --docs-ink-3: #86909c;
  --docs-line: #e5e6eb;
  --docs-side: #f7f8fa;
  --docs-card: #ffffff;
  --docs-radius: 10px;
}

.docs-page {
  background: #fff;
  color: var(--docs-ink);
  font: 15px/1.75 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

/* CodeBuddy 风格产品顶栏 */
.docs-topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 200;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 20px;
  background: #fff;
  border-bottom: 1px solid var(--docs-line);
}
.docs-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--docs-ink);
  margin-right: 12px;
  flex-shrink: 0;
}
.docs-brand img {
  height: 28px;
  width: auto;
  display: block;
}
.docs-brand span {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .02em;
}
.docs-topnav {
  display: flex;
  align-items: stretch;
  gap: 2px;
  height: 100%;
  overflow-x: auto;
}
.docs-topnav a {
  display: flex;
  align-items: center;
  padding: 0 14px;
  font-size: 14px;
  color: var(--docs-ink-2);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  height: 100%;
  box-sizing: border-box;
}
.docs-topnav a:hover {
  color: var(--docs-accent);
  text-decoration: none;
}
.docs-topnav a.active {
  color: var(--docs-accent);
  font-weight: 600;
  border-bottom-color: var(--docs-accent);
}
.docs-search {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f2f3f5;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 6px 10px;
  min-width: 160px;
  max-width: 220px;
}
.docs-search:focus-within {
  background: #fff;
  border-color: var(--docs-accent);
}
.docs-search input {
  border: 0;
  outline: none;
  background: transparent;
  width: 100%;
  font-size: 13px;
  font-family: inherit;
  color: var(--docs-ink);
}
.docs-search kbd {
  font-size: 11px;
  color: var(--docs-ink-3);
  background: #fff;
  border: 1px solid var(--docs-line);
  border-radius: 4px;
  padding: 1px 5px;
  font-family: inherit;
  flex-shrink: 0;
}

.docs-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  max-width: 1280px;
  margin: 0 auto;
  min-height: calc(100vh - 56px);
  padding-top: 56px;
  align-items: start;
}

.docs-side {
  position: sticky;
  top: 56px;
  height: calc(100vh - 56px);
  overflow: auto;
  background: var(--docs-side);
  border-right: 1px solid var(--docs-line);
  padding: 20px 12px 32px;
}

.docs-side-brand {
  padding: 4px 12px 16px;
  border-bottom: 1px solid var(--docs-line);
  margin-bottom: 12px;
}
.docs-side-brand .label {
  font-size: 12px;
  color: var(--docs-ink-3);
  letter-spacing: .04em;
}
.docs-side-brand .title {
  margin-top: 4px;
  font-size: 15px;
  font-weight: 700;
  color: var(--docs-ink);
}

.docs-nav-group {
  margin: 8px 0 4px;
}
.docs-nav-group > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 700;
  color: var(--docs-ink);
  border-radius: 8px;
  user-select: none;
}
.docs-nav-group > summary::-webkit-details-marker { display: none; }
.docs-nav-group > summary::after {
  content: "";
  width: 8px; height: 8px;
  border-right: 1.5px solid var(--docs-ink-3);
  border-bottom: 1.5px solid var(--docs-ink-3);
  transform: rotate(45deg);
  transition: transform .15s;
  margin-right: 4px;
}
.docs-nav-group[open] > summary::after { transform: rotate(-135deg); margin-top: 4px; }
.docs-nav-group > summary:hover { background: rgba(0,0,0,.03); }

.docs-nav a {
  display: block;
  padding: 7px 12px 7px 20px;
  margin: 1px 0;
  font-size: 13.5px;
  color: var(--docs-ink-2);
  border-radius: 8px;
  text-decoration: none;
  border-left: 2px solid transparent;
}
.docs-nav a:hover {
  background: rgba(13,148,136,.08);
  color: var(--docs-accent);
  text-decoration: none;
}
.docs-nav a.active {
  background: var(--docs-accent-soft);
  color: var(--docs-accent);
  font-weight: 600;
  border-left-color: var(--docs-accent);
}
.docs-nav a.lv3 {
  padding-left: 32px;
  font-size: 12.5px;
  color: var(--docs-ink-3);
}

.docs-side-actions {
  margin-top: 16px;
  padding: 12px;
  border-top: 1px solid var(--docs-line);
}
.docs-side-actions button {
  width: 100%;
  cursor: pointer;
  border: 1px solid var(--docs-accent);
  background: var(--docs-accent);
  color: #fff;
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 13.5px;
  font-weight: 600;
  font-family: inherit;
}
.docs-side-actions button:hover { filter: brightness(1.05); }

.docs-main {
  min-width: 0;
  padding: 28px 40px 80px;
  max-width: 920px;
}

.docs-main a { color: var(--docs-accent); }
.docs-main a:hover { text-decoration: underline; }
.docs-main code {
  background: #f2f3f5;
  border: 1px solid var(--docs-line);
  border-radius: 4px;
  padding: .1em .35em;
  font-size: .9em;
  font-family: Consolas, "SFMono-Regular", Menlo, monospace;
}

.docs-cover {
  border: 1px solid var(--docs-line);
  border-radius: 14px;
  padding: 32px 34px;
  margin-bottom: 28px;
  background: linear-gradient(160deg, #fff 0%, #f3fbfa 100%);
}
.docs-cover .kicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--docs-accent);
  background: var(--docs-accent-soft);
  border: 1px solid #b8eae3;
  border-radius: 20px;
  padding: 4px 12px;
  margin-bottom: 14px;
}
.docs-cover h1 {
  margin: 0 0 10px;
  font-size: 28px;
  letter-spacing: .2px;
  color: var(--docs-ink);
  line-height: 1.35;
}
.docs-cover .sub {
  margin: 0;
  color: var(--docs-ink-2);
  font-size: 14.5px;
}
.docs-cover .meta {
  margin-top: 16px;
  display: flex;
  gap: 10px 22px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: var(--docs-ink-3);
  border-top: 1px dashed var(--docs-line);
  padding-top: 14px;
}
.docs-cover .meta b { color: var(--docs-ink-2); font-weight: 600; margin-right: 4px; }
.docs-cover-body { margin-top: 12px; color: var(--docs-ink-2); font-size: 14.5px; }
.docs-cover-body p { margin: 8px 0; }
.docs-main img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  border: 1px solid var(--docs-line);
  display: block;
  margin: 12px 0;
}
.docs-cover-actions { margin-top: 18px; display: flex; gap: 10px; flex-wrap: wrap; }
.docs-cover-actions button {
  cursor: pointer;
  border-radius: 8px;
  padding: 9px 18px;
  font-size: 14px;
  font-weight: 600;
  border: 1px solid var(--docs-accent);
  background: var(--docs-accent);
  color: #fff;
  font-family: inherit;
}
.docs-cover-actions button.ghost {
  background: #fff;
  color: var(--docs-accent);
}

.docs-section {
  scroll-margin-top: 88px;
  margin-bottom: 36px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--docs-line);
}
.docs-section:last-of-type { border-bottom: none; }
.docs-section > h2 {
  margin: 0 0 8px;
  font-size: 24px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--docs-ink);
}
.docs-section > h2 .no {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 30px;
  padding: 0 6px;
  border-radius: 8px;
  background: var(--docs-accent);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
}
.docs-section > .lead {
  color: var(--docs-ink-2);
  margin: 0 0 18px;
  font-size: 14.5px;
}
.docs-section h3 {
  font-size: 17px;
  margin: 26px 0 10px;
  padding-left: 12px;
  border-left: 3px solid var(--docs-accent);
  color: var(--docs-ink);
  scroll-margin-top: 88px;
}
.docs-section h4 {
  font-size: 14.5px;
  margin: 16px 0 8px;
}
.docs-section p { margin: 9px 0; }
.docs-section ul, .docs-section ol { margin: 9px 0; padding-left: 22px; }
.docs-section li { margin: 5px 0; }

.docs-tw {
  overflow: auto;
  margin: 12px 0;
  border: 1px solid var(--docs-line);
  border-radius: 10px;
}
.docs-tw table { border-collapse: collapse; width: 100%; font-size: 14px; }
.docs-tw th, .docs-tw td {
  border-bottom: 1px solid var(--docs-line);
  padding: 10px 13px;
  text-align: left;
  vertical-align: top;
}
.docs-tw thead th {
  background: #f7f8fa;
  font-weight: 600;
  white-space: nowrap;
  color: var(--docs-ink);
}
.docs-tw tbody tr:last-child td { border-bottom: none; }
.docs-tw tbody tr:hover { background: #fafbfc; }
.docs-tw td.k { white-space: nowrap; font-weight: 600; }

.docs-box {
  border-radius: 10px;
  padding: 12px 16px;
  margin: 14px 0;
  font-size: 14px;
  border: 1px solid;
}
.docs-box b { display: block; margin-bottom: 4px; }
.docs-tip { background: var(--docs-accent-soft); border-color: #b8eae3; color: #0f766e; }
.docs-ok { background: #f0fdf5; border-color: #b7ebc6; color: #0b6b3a; }
.docs-warn { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.docs-danger { background: #fff1f0; border-color: #ffccc7; color: #a8071a; }

.docs-steps { counter-reset: s; list-style: none; padding: 0; margin: 14px 0; }
.docs-steps > li {
  counter-increment: s;
  position: relative;
  padding: 0 0 16px 46px;
  margin: 0;
}
.docs-steps > li::before {
  content: counter(s);
  position: absolute;
  left: 0; top: 1px;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--docs-accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
}
.docs-steps > li:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 14.5px; top: 32px; bottom: 2px;
  width: 1px;
  background: var(--docs-line);
}
.docs-steps .t { font-weight: 600; }

.docs-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin: 14px 0;
}
.docs-card {
  border: 1px solid var(--docs-line);
  border-radius: 10px;
  padding: 14px 16px;
  background: #fafbfc;
}
.docs-card .h {
  font-weight: 600;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.docs-card .h em {
  font-style: normal;
  font-size: 12px;
  color: var(--docs-accent);
  background: var(--docs-accent-soft);
  border-radius: 999px;
  padding: 1px 9px;
}
.docs-card p { margin: 4px 0; font-size: 13.5px; color: var(--docs-ink-2); }

.docs-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin: 14px 0;
}
.docs-kpi {
  background: #f7f8fa;
  border: 1px solid var(--docs-line);
  border-radius: 10px;
  padding: 12px 14px;
  text-align: center;
}
.docs-kpi b { display: block; font-size: 18px; color: var(--docs-accent); line-height: 1.3; }
.docs-kpi span { font-size: 12.5px; color: var(--docs-ink-2); }

.docs-figs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
  margin: 16px 0 6px;
}
.docs-figs .fig {
  margin: 0;
  border: 1px solid var(--docs-line);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}
.docs-figs img { display: block; width: 100%; height: auto; }
.docs-figs figcaption {
  padding: 8px 12px;
  font-size: 12.5px;
  color: var(--docs-ink-2);
  background: #f7f8fa;
  border-top: 1px solid var(--docs-line);
}

.docs-figs img.docs-zoomable,
.docs-section img.docs-zoomable,
.docs-cover img.docs-zoomable {
  cursor: zoom-in;
}

body.docs-lightbox-open {
  overflow: hidden;
}

.docs-lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 20px 24px;
  box-sizing: border-box;
  background: rgba(15, 23, 42, .88);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}
.docs-lightbox.open {
  opacity: 1;
  pointer-events: auto;
}
.docs-lightbox-inner {
  margin: 0;
  max-width: min(96vw, 1400px);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.docs-lightbox-img {
  display: block;
  max-width: 100%;
  max-height: calc(92vh - 56px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, .45);
  background: #fff;
}
.docs-lightbox-cap {
  margin: 12px 0 0;
  max-width: 720px;
  text-align: center;
  font-size: 13px;
  line-height: 1.5;
  color: rgba(255, 255, 255, .88);
}
.docs-lightbox-close {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 201;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  font-size: 28px;
  line-height: 1;
  color: #fff;
  background: rgba(255, 255, 255, .12);
  transition: background .15s;
}
.docs-lightbox-close:hover {
  background: rgba(255, 255, 255, .22);
}

.docs-totop {
  position: fixed;
  right: 22px;
  bottom: 24px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  cursor: pointer;
  border: 1px solid var(--docs-line);
  background: #fff;
  color: var(--docs-accent);
  font-size: 18px;
  line-height: 1;
  box-shadow: 0 6px 18px rgba(15, 23, 42, .12);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
  z-index: 40;
}
.docs-totop.show { opacity: 1; pointer-events: auto; }

.docs-tag {
  display: inline-block;
  margin: 2px 6px 2px 0;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  background: var(--docs-accent-soft);
  color: var(--docs-accent);
  font-weight: 600;
}
.docs-tag.warn { background: #fff7ed; color: #c2410c; }
.docs-flow { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.docs-step .n {
  display: inline-flex;
  width: 26px; height: 26px;
  align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--docs-accent);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 8px;
}
.docs-step .t { font-weight: 600; margin-bottom: 4px; }
.docs-step .d { font-size: 12.5px; color: var(--docs-ink-2); }
.docs-section > h2 .no,
.docs-section > h2 .num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 30px;
  padding: 0 6px;
  border-radius: 8px;
  background: var(--docs-accent);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  margin-right: 4px;
}
.docs-figs { display: grid; gap: 14px; margin: 16px 0; }
.docs-figs .fig img { display: block; width: 100%; height: auto; border-radius: 8px 8px 0 0; }
.docs-figs figcaption,
.docs-figs .fig figcaption {
  padding: 8px 12px;
  font-size: 12.5px;
  color: var(--docs-ink-2);
  background: #f7f8fa;
  border: 1px solid var(--docs-line);
  border-top: 0;
  border-radius: 0 0 8px 8px;
}

/* 手机截图：按接近原像素宽度展示，避免拉满整栏发糊 */
[data-docs-product="miniprogram"] .docs-figs,
[data-docs-product="shuxin"] .docs-figs {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 20px;
  margin: 20px 0;
}
[data-docs-product="miniprogram"] .docs-figs .fig,
[data-docs-product="shuxin"] .docs-figs .fig {
  width: min(280px, 72vw);
  max-width: 280px;
  border: none;
  border-radius: 28px;
  background: #0f172a;
  padding: 10px 9px 12px;
  box-shadow:
    0 0 0 1px rgba(15, 23, 42, .12),
    0 18px 40px rgba(15, 23, 42, .16);
  overflow: hidden;
}
[data-docs-product="miniprogram"] .docs-figs .fig::before,
[data-docs-product="shuxin"] .docs-figs .fig::before {
  content: "";
  display: block;
  width: 84px;
  height: 7px;
  margin: 2px auto 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .18);
}
[data-docs-product="miniprogram"] .docs-figs .fig img,
[data-docs-product="shuxin"] .docs-figs .fig img {
  width: 100%;
  height: auto;
  margin: 0;
  border: 0;
  border-radius: 18px;
  image-rendering: -webkit-optimize-contrast;
}
[data-docs-product="miniprogram"] .docs-main > p > img,
[data-docs-product="shuxin"] .docs-main > p > img,
[data-docs-product="miniprogram"] .docs-section > p > img,
[data-docs-product="shuxin"] .docs-section > p > img {
  width: min(280px, 72vw);
  max-width: 280px;
  margin: 16px 0;
  border-radius: 18px;
  box-shadow: 0 14px 32px rgba(15, 23, 42, .14);
}

.docs-cover .ico { display: none; }
.docs-box .ico { display: none; }

@media (max-width: 980px) {
  .docs-shell { grid-template-columns: 1fr; padding-top: 56px; }
  .docs-side {
    position: static;
    height: auto;
    max-height: none;
    border-right: none;
    border-bottom: 1px solid var(--docs-line);
  }
  .docs-nav { max-height: 220px; overflow: auto; }
  .docs-main { padding: 20px 18px 60px; }
  .docs-search { display: none; }
  .docs-brand span { display: none; }
}

@media print {
  .docs-topbar, .docs-side, .docs-totop, .docs-cover-actions, .footer { display: none !important; }
  .docs-shell { display: block; padding: 0; }
  .docs-main { max-width: none; padding: 0; }
}
