:root {
  --ink: #16181c;
  --ink-2: #3d434c;
  --ink-3: #6b7280;
  --line: #e5e7eb;
  --line-soft: #f0f1f3;
  --bg: #ffffff;
  --bg-soft: #f7f8fa;
  --brand: #1f5eff;
  --brand-soft: #eef3ff;
  --warn-bg: #fff8e8;
  --warn-line: #f2d59a;
  --radius: 10px;
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", sans-serif;
  font-size: 15px;
  line-height: 1.78;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

.site-header {
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
}

.site-header .inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 600;
  letter-spacing: 0.01em;
}

.brand .mark {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: var(--brand);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand small {
  display: block;
  font-weight: 400;
  font-size: 12px;
  color: var(--ink-3);
  letter-spacing: 0.02em;
}

.doc-switch {
  margin-left: auto;
  display: flex;
  gap: 4px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px;
}

.doc-switch a {
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 13px;
  color: var(--ink-3);
}

.doc-switch a:hover { text-decoration: none; color: var(--ink); }

.doc-switch a[aria-current="page"] {
  background: #fff;
  color: var(--ink);
  font-weight: 500;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.08);
}

.layout {
  max-width: 1080px;
  margin: 0 auto;
  padding: 40px 24px 72px;
  display: grid;
  grid-template-columns: 216px minmax(0, 1fr);
  gap: 48px;
  align-items: start;
}

.layout.single {
  grid-template-columns: minmax(0, 760px);
  justify-content: center;
}

.toc {
  position: sticky;
  top: 28px;
  font-size: 13px;
  border-left: 1px solid var(--line);
  padding-left: 16px;
}

.toc strong {
  display: block;
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--ink-3);
  font-weight: 500;
  margin-bottom: 10px;
}

.toc ol {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: toc;
}

.toc li { margin: 0 0 7px; counter-increment: toc; }

.toc li a {
  color: var(--ink-2);
  display: block;
  padding: 1px 0;
}

.toc li a::before {
  content: counter(toc) ". ";
  color: var(--ink-3);
}

.toc li a:hover { color: var(--brand); text-decoration: none; }

article { min-width: 0; max-width: 720px; }

.doc-head { margin-bottom: 32px; }

.doc-head h1 {
  font-size: 30px;
  line-height: 1.3;
  margin: 0 0 10px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.doc-head .meta {
  color: var(--ink-3);
  font-size: 13px;
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

h2 {
  font-size: 19px;
  font-weight: 600;
  margin: 44px 0 12px;
  padding-top: 4px;
  scroll-margin-top: 24px;
}

h3 {
  font-size: 15px;
  font-weight: 600;
  margin: 24px 0 8px;
}

p { margin: 0 0 12px; color: var(--ink-2); }

ul, ol { margin: 0 0 14px; padding-left: 22px; color: var(--ink-2); }
li { margin-bottom: 6px; }

strong { color: var(--ink); font-weight: 600; }

.lead {
  font-size: 15px;
  color: var(--ink-2);
  padding: 16px 18px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 8px;
}

.callout {
  border: 1px solid var(--warn-line);
  background: var(--warn-bg);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin: 16px 0;
  font-size: 14px;
  color: #5c4310;
}

.callout strong { color: #3f2d08; }

.table-wrap {
  overflow-x: auto;
  margin: 14px 0 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

table {
  border-collapse: collapse;
  width: 100%;
  font-size: 13.5px;
  min-width: 520px;
}

th, td {
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: top;
  color: var(--ink-2);
}

thead th {
  background: var(--bg-soft);
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  font-size: 13px;
}

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

td code, p code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12.5px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1px 5px;
}

.contact-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  background: var(--bg);
  margin: 14px 0;
}

.contact-card dl {
  margin: 0;
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: 6px 12px;
  font-size: 14px;
}

.contact-card dt { color: var(--ink-3); }
.contact-card dd { margin: 0; color: var(--ink-2); }

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--bg-soft);
  font-size: 12.5px;
  color: var(--ink-3);
}

.site-footer .inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 22px 24px;
  display: flex;
  gap: 8px 20px;
  flex-wrap: wrap;
}

.site-footer a { color: var(--ink-3); }
.site-footer a:hover { color: var(--brand); }

.index-list {
  display: grid;
  gap: 14px;
  margin: 24px 0 8px;
}

.doc-card {
  display: block;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px;
  color: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.doc-card:hover {
  text-decoration: none;
  border-color: #c9d5f5;
  box-shadow: 0 2px 10px rgba(31, 94, 255, 0.07);
}

.doc-card h3 { margin: 0 0 4px; font-size: 16px; }
.doc-card p { margin: 0; font-size: 13.5px; color: var(--ink-3); }
.doc-card .arrow { float: right; color: var(--brand); }

@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; gap: 24px; padding-top: 24px; }
  .toc {
    position: static;
    border-left: 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    padding: 14px 0;
    order: -1;
  }
  .toc ol { columns: 2; column-gap: 20px; }
  .doc-head h1 { font-size: 24px; }
}

@media print {
  .site-header, .toc, .site-footer, .doc-switch { display: none; }
  .layout { display: block; padding: 0; max-width: none; }
  body { font-size: 11.5pt; }
  h2 { page-break-after: avoid; }
  .table-wrap { overflow: visible; }
  table { min-width: 0; font-size: 9.5pt; }
}
