/* S.A.N.T 官网文档站样式（叠加在官网 styles.css 之上） */

/* 页脚钉底：内容不满一屏时页脚也贴住视口底部 */
.docs-body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--paper);
}

.docs-body .site-footer {
  margin-top: auto;
}

.nav-links a.nav-current {
  color: var(--ink);
  font-weight: 600;
}

/* 三栏整组居中：章节导航 · 正文 · 本页目录 紧凑相邻 */
.doc-shell {
  display: grid;
  grid-template-columns: 228px minmax(0, 780px) 200px;
  justify-content: center;
  gap: 48px;
  width: 100%;
  flex: 1 0 auto;
  margin: 0;
  padding: 36px 40px 72px;
}

.doc-main {
  width: 100%;
  min-width: 0;
}

/* 侧栏 */
.doc-side {
  position: sticky;
  top: 92px;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.doc-side a {
  display: block;
  padding: 8px 13px;
  border: 1px solid transparent;
  border-radius: 9px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
  transition: color 0.15s, background 0.15s;
}

.doc-side a:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.7);
}

.doc-side a.active {
  color: var(--ink);
  font-weight: 650;
  background: var(--white);
  border-color: var(--line);
  box-shadow: 0 6px 18px rgba(38, 35, 31, 0.06);
}

/* 本页内容目录（右栏） */
.doc-toc {
  position: sticky;
  top: 92px;
  align-self: start;
  max-height: calc(100vh - 130px);
  overflow-y: auto;
  font-size: 13px;
}

.doc-toc-title {
  margin-bottom: 8px;
  color: var(--soft);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.doc-toc a {
  display: block;
  padding: 4px 12px;
  border-left: 2px solid var(--line);
  color: var(--muted);
  line-height: 1.5;
  transition: color 0.15s, border-color 0.15s;
}

.doc-toc a.lv3 {
  padding-left: 24px;
}

.doc-toc a:hover {
  color: var(--ink);
}

.doc-toc a.active {
  border-left-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}

/* 锚点跳转时避开置顶导航 */
.doc-article h1,
.doc-article h2,
.doc-article h3 {
  scroll-margin-top: 88px;
}

/* 正文排版 */
.doc-article {
  min-width: 0;
  font-size: 15.5px;
  line-height: 1.8;
  color: var(--ink);
}

.doc-article h1 {
  margin: 0 0 14px;
  font-size: 30px;
  line-height: 1.3;
  letter-spacing: 0.2px;
}

.doc-article h2 {
  margin: 42px 0 14px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
  font-size: 21px;
  line-height: 1.35;
}

.doc-article h1 + p,
.doc-article h1 + hr + h2 {
  margin-top: 0;
}

.doc-article h3 {
  margin: 28px 0 10px;
  font-size: 16.5px;
}

.doc-article p {
  margin: 0 0 14px;
}

.doc-article ul,
.doc-article ol {
  margin: 0 0 16px;
  padding-left: 24px;
}

.doc-article li {
  margin: 5px 0;
}

.doc-article li > ul,
.doc-article li > ol {
  margin-bottom: 4px;
}

.doc-article hr {
  margin: 26px 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.doc-article a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: rgba(169, 87, 63, 0.35);
  text-underline-offset: 3px;
}

.doc-article a:hover {
  text-decoration-color: var(--accent);
}

.doc-article code {
  padding: 2px 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--white);
  font-family: "Cascadia Code", Consolas, "JetBrains Mono", monospace;
  font-size: 0.86em;
}

.doc-article pre {
  overflow-x: auto;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
}

.doc-article pre code {
  padding: 0;
  border: 0;
  background: none;
}

/* 提示框（💡/⚠️ 引用块） */
.doc-article blockquote {
  margin: 16px 0;
  padding: 11px 16px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 10px;
  background: var(--panel);
  color: var(--ink);
}

.doc-article blockquote p {
  margin: 0;
}

.doc-article blockquote p + p {
  margin-top: 8px;
}

/* 表格 */
.table-wrap {
  overflow-x: auto;
  margin: 16px 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
}

.doc-article table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14.5px;
}

.doc-article th,
.doc-article td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  line-height: 1.6;
}

.doc-article thead th {
  background: var(--panel);
  color: var(--muted);
  font-weight: 650;
  white-space: nowrap;
}

.doc-article tbody tr:last-child td {
  border-bottom: 0;
}

/* 概览页目录卡片 */
.doc-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0 10px;
}

.doc-article a.doc-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--white);
  text-decoration: none;
  transition: box-shadow 0.15s, transform 0.15s;
}

.doc-article a.doc-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.doc-card strong {
  color: var(--ink);
  font-size: 15.5px;
}

.doc-card span {
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.65;
}

/* 上一篇 / 下一篇 */
.doc-pager {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-top: 48px;
}

.pager-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 170px;
  padding: 13px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
  transition: box-shadow 0.15s, transform 0.15s;
}

.pager-card.next {
  margin-left: auto;
  text-align: right;
}

.pager-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.pager-card span {
  color: var(--soft);
  font-size: 12.5px;
}

.pager-card strong {
  color: var(--ink);
  font-size: 15px;
}

/* 窄屏：侧栏变横向胶囊条 */
/* 中屏：收起右侧本页目录，双栏仍整组居中 */
@media (max-width: 1200px) {
  .doc-shell {
    grid-template-columns: 228px minmax(0, 780px);
  }

  .doc-toc {
    display: none;
  }
}

@media (max-width: 880px) {
  .doc-shell {
    grid-template-columns: 1fr;
    gap: 22px;
    padding: 22px 20px 56px;
  }

  .doc-cards {
    grid-template-columns: 1fr;
  }

  .doc-side {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 7px;
  }

  .doc-side a {
    padding: 6px 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--white);
    font-size: 13px;
  }

  .doc-side a.active {
    border-color: var(--accent);
    color: var(--accent);
    box-shadow: none;
  }

  .doc-article h1 {
    font-size: 24px;
  }
}
