/* 文章页（产品文档、法务）：左侧目录 + 正文。依赖 base.css 的 token。 */

.a-head {
  padding: clamp(56px, 7vw, 96px) 0 clamp(32px, 4vw, 48px);
  border-bottom: 1px solid var(--line);
}
.a-head .lead {
  margin-top: 16px;
  max-width: 680px;
}
.a-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-top: 20px;
  font-size: 14px;
  color: var(--ink-2);
}
.draft {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 10px;
  border-radius: 999px;
  background: #fff1dc;
  color: #9a4a0b;
  font-weight: 600;
}

.a-body {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: clamp(32px, 6vw, 88px);
  padding-top: clamp(40px, 5vw, 64px);
  padding-bottom: var(--gap-section);
}
.a-body > * {
  min-width: 0;
}

/* 左侧目录 */
.toc-side {
  position: sticky;
  top: 88px;
  align-self: start;
  max-height: calc(100vh - 112px);
  overflow-y: auto;
  font-size: 14px;
}
.toc-side summary {
  display: none;
}
.toc-side h4 {
  margin: 20px 0 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--ink-2);
}
.toc-side h4:first-of-type {
  margin-top: 0;
}
.toc-side ul {
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 1px solid var(--line);
}
.toc-side a {
  display: block;
  margin-left: -1px;
  padding: 6px 12px;
  border-left: 2px solid transparent;
  color: var(--ink-2);
  line-height: 1.5;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.toc-side a:hover {
  color: var(--ink);
}
.toc-side a.is-current {
  color: var(--ink);
  font-weight: 600;
  border-left-color: var(--teal);
}

/* 正文 */
.prose {
  max-width: 760px;
  font-size: 17px;
  line-height: 1.8;
}
.prose > section {
  scroll-margin-top: 88px;
}
.prose > section + section {
  margin-top: 64px;
  padding-top: 48px;
  border-top: 1px solid var(--line);
}
.prose h2 {
  margin: 0;
  font-size: clamp(26px, 2.6vw, 32px);
  line-height: 1.3;
  letter-spacing: -0.01em;
  font-feature-settings: 'halt';
}
.prose h3 {
  margin: 40px 0 0;
  font-size: 20px;
  line-height: 1.4;
  scroll-margin-top: 88px;
}
.prose h2 + p,
.prose h3 + p {
  margin-top: 12px;
}
.prose p {
  margin: 16px 0 0;
}
.prose p,
.prose li,
.prose td {
  color: #2c4256;
}
.prose strong {
  color: var(--ink);
  font-weight: 600;
}
.prose a:not(.btn):not(.link-arrow) {
  color: var(--teal-ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.prose ul,
.prose ol {
  margin: 16px 0 0;
  padding-left: 1.4em;
}
.prose li + li {
  margin-top: 6px;
}
.prose ul li::marker {
  color: var(--teal);
}
.prose code,
.prose kbd {
  padding: 1px 6px;
  border-radius: 6px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.86em;
}
.prose table {
  width: 100%;
  margin-top: 20px;
  border-collapse: collapse;
  font-size: 15px;
  line-height: 1.6;
}
.prose th,
.prose td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.prose th {
  background: var(--bg-2);
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 600;
}
.prose td:first-child,
.prose th:first-child {
  white-space: nowrap;
}
.table-scroll {
  overflow-x: auto;
}

/* 提示框 */
.callout {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  padding: 16px 18px;
  border-radius: 16px;
  background: rgba(10, 183, 173, 0.08);
  font-size: 16px;
  line-height: 1.7;
}
.callout svg {
  width: 20px;
  height: 20px;
  flex: none;
  margin-top: 4px;
  color: var(--teal-ink);
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.callout--warn {
  background: #fff7ed;
}
.callout--warn svg {
  color: #9a4a0b;
}
.callout p {
  margin: 0;
}

/* 编号步骤 */
.steps-num {
  list-style: none;
  margin: 20px 0 0;
  padding: 0;
  counter-reset: st;
}
.steps-num > li {
  counter-increment: st;
  position: relative;
  padding: 0 0 20px 48px;
}
.steps-num > li::before {
  content: counter(st);
  position: absolute;
  left: 0;
  top: 2px;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
}
.steps-num > li::after {
  content: '';
  position: absolute;
  left: 14px;
  top: 36px;
  bottom: 4px;
  width: 2px;
  background: var(--line);
}
.steps-num > li:last-child::after {
  display: none;
}
.steps-num b {
  display: block;
  color: var(--ink);
}

/* 卡片网格（文档首页的入口） */
.doc-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 24px;
}
.doc-card {
  display: block;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  text-decoration: none !important;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}
.doc-card:hover {
  border-color: var(--navy);
  background: var(--bg-2);
}
.doc-card b {
  display: block;
  color: var(--ink);
  font-size: 17px;
}
.doc-card span {
  display: block;
  margin-top: 4px;
  color: var(--ink-2);
  font-size: 15px;
  line-height: 1.6;
}

.a-foot-nav {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 64px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  font-size: 15px;
}

@media (max-width: 960px) {
  .a-body {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .toc-side {
    position: static;
    max-height: none;
    padding: 4px 16px;
    border: 1px solid var(--line);
    border-radius: 14px;
  }
  .toc-side summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 48px;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
  }
  .toc-side summary::-webkit-details-marker {
    display: none;
  }
  .toc-side:not([open]) > :not(summary) {
    display: none;
  }
  .toc-side[open] {
    padding-bottom: 16px;
  }
  .doc-cards {
    grid-template-columns: 1fr;
  }
}
