:root {
  --ink: #17201b;
  --muted: #69736d;
  --line: #dfe5df;
  --soft: #f4f6f1;
  --surface: #ffffff;
  --green: #159b67;
  --green-soft: #e4f4ec;
  --blue-soft: #ebf1ff;
  --coral-soft: #fff0eb;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--soft); color: var(--ink); font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif; letter-spacing: 0; }
a { color: inherit; }

.docs-header { position: sticky; z-index: 20; top: 0; display: flex; align-items: center; justify-content: space-between; height: 64px; padding: 0 30px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.96); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand span { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 7px; background: var(--ink); color: #fff; font-size: 14px; font-weight: 800; }
.brand strong { font-size: 15px; }
.view-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; width: 190px; padding: 4px; border: 1px solid var(--line); border-radius: 7px; }
.view-switch a { padding: 7px 9px; border-radius: 5px; color: var(--muted); font-size: 10px; font-weight: 700; text-align: center; text-decoration: none; }
.view-switch a.active { background: var(--ink); color: #fff; }

.docs-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); min-height: calc(100vh - 64px); }
.docs-nav { position: sticky; top: 64px; align-self: start; display: flex; flex-direction: column; height: calc(100vh - 64px); padding: 34px 24px; border-right: 1px solid var(--line); }
.nav-label { margin: 0 10px 11px; color: #929a95; font-size: 9px; font-weight: 800; }
.docs-nav > a { padding: 10px; border-radius: 6px; color: var(--muted); font-size: 12px; text-decoration: none; }
.docs-nav > a:hover { background: rgba(255,255,255,.65); }
.docs-nav > a.active { background: var(--surface); color: var(--ink); font-weight: 800; box-shadow: 0 4px 14px rgba(32,48,38,.05); }
.docs-status { margin-top: auto; padding: 15px; border-top: 1px solid var(--line); }
.docs-status span { color: #929a95; font-size: 9px; }
.docs-status strong { display: block; margin-top: 5px; color: var(--green); font-size: 11px; }
.docs-status p { margin: 7px 0 0; color: var(--muted); font-size: 9px; line-height: 1.6; }

.document-main { min-width: 0; }
.document-toolbar { display: flex; align-items: center; justify-content: flex-end; height: 48px; padding: 0 34px; border-bottom: 1px solid var(--line); color: #8b948e; font-size: 9px; }
.document-toolbar button { display: none; }
.markdown-body { width: min(840px, calc(100% - 64px)); margin: 0 auto; padding: 44px 0 100px; font-size: 14px; line-height: 1.8; }
.markdown-body h1 { margin: 0 0 30px; font-size: 32px; line-height: 1.3; }
.markdown-body h2 { margin: 42px 0 14px; padding-top: 8px; border-top: 1px solid var(--line); font-size: 20px; line-height: 1.4; }
.markdown-body h3 { margin: 28px 0 10px; font-size: 16px; }
.markdown-body p { margin: 10px 0; color: #4f5a53; }
.markdown-body strong { color: var(--ink); }
.markdown-body ul, .markdown-body ol { padding-left: 22px; color: #4f5a53; }
.markdown-body li { margin: 5px 0; }
.markdown-body blockquote { margin: 18px 0; padding: 12px 16px; border-left: 3px solid var(--green); background: var(--green-soft); color: #355a48; }
.markdown-body table { width: 100%; margin: 18px 0 26px; border-collapse: collapse; background: var(--surface); font-size: 12px; }
.markdown-body th, .markdown-body td { padding: 10px 12px; border: 1px solid var(--line); text-align: left; vertical-align: top; }
.markdown-body th { background: #edf1ed; }
.markdown-body code { padding: 2px 5px; border-radius: 4px; background: #e8ece8; color: #3d5548; font-family: "SFMono-Regular", Consolas, monospace; font-size: .9em; }
.markdown-body pre { overflow-x: auto; padding: 16px; border-radius: 7px; background: var(--ink); color: #eaf0ec; }
.markdown-body pre code { padding: 0; background: transparent; color: inherit; }
.markdown-body a { color: #0d7650; text-underline-offset: 3px; }
.markdown-body hr { margin: 32px 0; border: 0; border-top: 1px solid var(--line); }
.loading { color: var(--muted); }
.document-error { padding: 18px; border-left: 3px solid #f06b50; background: var(--coral-soft); }

@media (max-width: 720px) {
  .docs-header { height: auto; min-height: 98px; padding: 10px 14px; flex-wrap: wrap; gap: 8px; }
  .brand { width: 100%; }
  .view-switch { width: 100%; }
  .docs-layout { display: block; min-height: auto; }
  .docs-nav { position: fixed; z-index: 30; top: 98px; right: 0; bottom: 0; left: 0; display: none; height: auto; padding: 18px; border-right: 0; background: var(--soft); }
  .docs-nav.open { display: flex; }
  .document-toolbar { position: sticky; z-index: 10; top: 98px; justify-content: space-between; height: 44px; padding: 0 16px; background: rgba(244,246,241,.96); }
  .document-toolbar button { display: inline-flex; padding: 6px 9px; border: 1px solid var(--line); border-radius: 5px; background: #fff; font-size: 10px; }
  .markdown-body { width: auto; padding: 28px 18px 80px; font-size: 13px; }
  .markdown-body h1 { font-size: 25px; }
  .markdown-body h2 { margin-top: 34px; font-size: 18px; }
  .markdown-body table { display: block; overflow-x: auto; white-space: nowrap; }
}
