:root {
  --ink: #1f2937;
  --muted: #6b7280;
  --line: #e5e7eb;
  --brand: #30567f;        /* Server酱 钢蓝主色，对齐 sct.ftqq.com */
  --brand-dark: #24425f;
  --brand-soft: #eef3f9;   /* 浅蓝底，用于提示框 */
  --link: #1a5fa0;
  --bg-soft: #f8f9fa;
  --code-bg: #f3f4f6;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--ink);
  font: 16px/1.75 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

.site-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.7rem 1.2rem; border-bottom: 1px solid var(--line);
}
.brand { font-weight: 700; font-size: 1.1rem; color: var(--ink); display: inline-flex; align-items: center; }
.brand span {
  margin-left: 0.45rem; font-size: 0.68rem; font-weight: 600; letter-spacing: 0.02em;
  color: #fff; background: var(--brand); padding: 0.12rem 0.42rem; border-radius: 4px;
}
.top-links a { margin-left: 1rem; color: var(--muted); font-size: 0.9rem; }
.top-links a:hover { color: var(--brand); text-decoration: none; }

.wrap { display: flex; max-width: 1100px; margin: 0 auto; }
.sidebar {
  width: 230px; flex: none; padding: 1.2rem 1rem;
  border-right: 1px solid var(--line); font-size: 0.92rem;
  position: sticky; top: 0; max-height: 100vh; overflow-y: auto;
  scrollbar-width: thin;
}
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--line); border-radius: 3px; }
.sidebar .nav-home { display: block; margin-bottom: 0.6rem; color: var(--ink); font-weight: 600; }
.sidebar details { margin: 0.2rem 0; }
.sidebar summary {
  padding: 0.35rem 0; font-size: 0.85rem; font-weight: 600; color: var(--muted);
  cursor: pointer; user-select: none; list-style: none; display: flex; align-items: center;
}
.sidebar summary::before {
  content: "▸"; margin-right: 0.4rem; font-size: 0.7rem; transition: transform 0.15s;
}
.sidebar details[open] > summary::before { transform: rotate(90deg); }
.sidebar summary::-webkit-details-marker { display: none; }
.sidebar ul { margin: 0 0 0.4rem; padding: 0 0 0 0.9rem; list-style: none; }
.sidebar li a { display: block; padding: 0.18rem 0; color: var(--ink); }
.sidebar li a[aria-current="page"] { color: var(--brand); font-weight: 600; }

.content { flex: 1; min-width: 0; padding: 1.5rem 2rem 3rem; }
.content h1 { font-size: 1.7rem; line-height: 1.4; margin: 0.5rem 0 1rem; }
.content h2 { font-size: 1.25rem; margin-top: 2.2rem; padding-bottom: 0.3rem; border-bottom: 1px solid var(--line); }
.content blockquote {
  margin: 1rem 0; padding: 0.5rem 1rem; border-left: 3px solid var(--brand);
  background: var(--bg-soft); color: var(--muted);
}
.content code { background: var(--code-bg); padding: 0.1em 0.35em; border-radius: 4px; font-size: 0.9em; }
.content pre { background: var(--code-bg); padding: 1rem; border-radius: 8px; overflow-x: auto; }
.content pre code { background: none; padding: 0; }
.content table { border-collapse: collapse; width: 100%; display: block; overflow-x: auto; }
.content th, .content td { border: 1px solid var(--line); padding: 0.45rem 0.7rem; text-align: left; }
.content th { background: var(--bg-soft); }
.content img { max-width: 100%; }

.agent-prompt {
  margin-top: 2.5rem; padding: 1rem 1.2rem; border: 1px solid var(--brand);
  border-radius: 10px; background: var(--brand-soft);
}
.agent-prompt h2 { margin-top: 0; border-bottom: none; font-size: 1.1rem; color: var(--brand-dark); }
.agent-prompt pre { white-space: pre-wrap; word-break: break-word; }

/* 相关集成：由 client/scripts/build-docs-seo.js 注入 */
.related { margin-top: 2.5rem; padding-top: 1.2rem; border-top: 1px solid var(--line); }
.related h2 { margin: 0 0 0.4rem; border-bottom: none; font-size: 1.1rem; color: var(--brand-dark); }
.related > p { margin: 0.3rem 0 0.6rem; color: var(--muted); font-size: 0.9rem; }
.related ul {
  display: flex; flex-wrap: wrap; gap: 0.5rem;
  list-style: none; margin: 0; padding: 0;
}
.related li a {
  display: inline-block; padding: 0.28rem 0.7rem; font-size: 0.9rem;
  border: 1px solid var(--line); border-radius: 999px; background: var(--bg-soft);
}
.related li a:hover { border-color: var(--brand); background: var(--brand-soft); text-decoration: none; }
.related-more { margin-top: 0.9rem !important; }

.page-footer { margin-top: 3rem; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.85rem; }
.site-footer { border-top: 1px solid var(--line); text-align: center; color: var(--muted); font-size: 0.85rem; padding: 1rem; }

@media (max-width: 760px) {
  .wrap { flex-direction: column; }
  .sidebar { width: auto; border-right: none; border-bottom: 1px solid var(--line); }
  .content { padding: 1rem 1.2rem 2.5rem; }
}
