/* ============================================================
   知夏官网子页 · 文档 / 更新日志（v5 暖白延续）
   ============================================================ */

/* ---------- 页头 ---------- */

.docs-head {
  max-width: 860px;
  margin: 0 auto;
  padding: 140px var(--gutter, 24px) 40px;
}

.docs-head h1 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(32px, 4.5vw, 46px);
  line-height: 1.25;
  margin-bottom: 12px;
}

.docs-head p { color: var(--ink-2); font-size: 17px; }

/* ---------- 文档布局：左目录 + 右内容（学 ZCode 文档：导航下直接进内容，无大标题横幅） ---------- */

.docs-layout {
  max-width: 1080px;
  margin: 0 auto;
  padding: 100px var(--gutter, 24px) 96px;
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 56px;
  align-items: start;
}

.docs-toc {
  position: sticky;
  top: 88px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  border-left: 2px solid var(--line);
}

.docs-toc a {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 13.5px;
  color: var(--ink-2);
  text-decoration: none;
  padding: 5px 0 5px 14px;
  border-left: 2px solid transparent;
  margin-left: -2px;
  transition: color 0.2s ease, border-color 0.2s ease;
}

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

.docs-toc a.cur { color: var(--amber-deep); border-left-color: var(--amber); }

.docs-toc a i {
  font-style: normal;
  font-size: 11px;
  color: #b3a888;
  min-width: 18px;
  font-variant-numeric: tabular-nums;
}

/* ---------- 帮助内容排版 ---------- */

.doc-sec {
  border-top: 1px solid var(--line);
  padding: 32px 0 44px;
  scroll-margin-top: 84px;
}

.doc-sec:first-child { border-top: none; padding-top: 4px; }

.doc-sec h2 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 24px;
  line-height: 1.3;
  margin-bottom: 8px;
}

.doc-sec > p:first-of-type { color: var(--ink-2); margin-bottom: 16px; }

.doc-sec h3 {
  font-size: 16px;
  font-weight: 700;
  margin: 22px 0 8px;
}

.doc-sec p { margin: 7px 0; line-height: 1.85; }

.doc-sec ul, .doc-sec ol { margin: 7px 0 11px; padding-left: 22px; }

.doc-sec li { margin: 4px 0; line-height: 1.75; }

.doc-sec ul ul { margin: 4px 0; }

.doc-sec table {
  border-collapse: collapse;
  margin: 12px 0 16px;
  width: 100%;
  font-size: 14.5px;
}

.doc-sec th, .doc-sec td {
  border: 1px solid var(--line);
  padding: 8px 12px;
  text-align: left;
  vertical-align: top;
}

.doc-sec th { background: var(--bg-alt); font-weight: 600; }

.doc-sec kbd {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 12.5px;
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 1px 6px;
}

/* 帮助内容里的代码块/宽表格：自己滚，不撑破页面 */
.doc-sec pre {
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
  overflow-x: auto;
  max-width: 100%;
  font-size: 13px;
  line-height: 1.7;
}

.doc-sec pre code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }

.doc-sec table { display: block; overflow-x: auto; max-width: 100%; }

/* ---------- 更新日志 ---------- */

.logs { padding-bottom: 96px; }

.log-list {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 var(--gutter, 24px);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.log-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 32px 26px;
}

.log-latest { border-color: rgba(180, 95, 31, 0.5); }

.log-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.log-head h2 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 22px;
}

.log-head time { font-size: 14px; color: var(--ink-2); }

.log-badge {
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  background: var(--amber);
  border-radius: 999px;
  padding: 2px 12px;
}

.log-body { list-style: none; }

.log-body li {
  display: flex;
  gap: 14px;
  padding: 10px 0;
  border-top: 1px dashed var(--line);
  line-height: 1.8;
}

.log-body li:first-child { border-top: none; padding-top: 0; }

.log-body b {
  flex: none;
  width: 132px;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--ink);
}

.log-body span { font-size: 14.5px; color: var(--ink-2); }

/* ---------- 响应式 ---------- */

@media (max-width: 900px) {
  .docs-layout { grid-template-columns: 1fr; gap: 24px; min-width: 0; }
  .docs-layout > * { min-width: 0; }
  .docs-toc {
    position: static;
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    border-left: none;
    border-bottom: 2px solid var(--line);
    padding-bottom: 8px;
    max-height: none;
    gap: 6px;
    width: 100%;
  }
  .docs-toc a { border-left: none; padding: 4px 12px; white-space: nowrap; border-radius: 999px; }
  .docs-toc a.cur { border-left: none; background: rgba(180, 95, 31, 0.12); }
  .doc-sec { padding: 32px 0 40px; }
  .log-card { padding: 22px 20px; }
  .log-body li { flex-direction: column; gap: 2px; }
  .log-body b { width: auto; }
}
