:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --panel: #ffffff;
  --text: #1f2933;
  --muted: #6b7280;
  --line: #d9dee7;
  --accent: #2563eb;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans SC", Arial, sans-serif;
  line-height: 1.65;
}
.app {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  min-height: 100vh;
}
.app-single {
  display: block;
}
.app-single .content {
  width: min(100%, 1320px);
  margin: 0 auto;
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
  background: #111827;
  color: #e5e7eb;
  padding: 22px 18px;
  border-right: 1px solid #0b1220;
}
.brand {
  display: block;
  color: #fff;
  font-weight: 700;
  font-size: 20px;
  margin-bottom: 22px;
  text-decoration: none;
}
.sidebar h2 {
  color: #9ca3af;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .08em;
  margin: 22px 0 8px;
}
.sidebar ul { list-style: none; padding: 0; margin: 0; }
.sidebar li { margin: 2px 0; }
.sidebar a {
  color: #d1d5db;
  display: block;
  padding: 7px 8px;
  border-radius: 6px;
  text-decoration: none;
  font-size: 14px;
}
.sidebar a:hover, .sidebar a.active { background: #1f2937; color: #fff; }
.content {
  width: min(100%, 1480px);
  justify-self: center;
  padding: 34px clamp(28px, 4vw, 72px) 80px;
}
.doc, .index-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 28px 34px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}
.meta {
  color: var(--muted);
  font-size: 13px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
  margin-bottom: 22px;
}
h1 { font-size: 30px; line-height: 1.25; margin: 0 0 14px; }
h2 { font-size: 21px; margin-top: 30px; border-top: 1px solid var(--line); padding-top: 18px; }
h3 { font-size: 17px; margin-top: 24px; }
p { margin: 7px 0; }
code { background: #eef2f7; border-radius: 4px; padding: 1px 5px; }
.doc-image {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 18px auto;
  border: 1px solid #e6eaf0;
  border-radius: 6px;
  background: #ffffff;
}
pre {
  background: #0f172a;
  color: #e5e7eb;
  padding: 16px;
  border-radius: 8px;
  overflow: auto;
  white-space: pre-wrap;
}
.table-line {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: pre-wrap;
  font-size: 13px;
}
.doc-table {
  width: 100%;
  border-collapse: collapse;
  margin: 14px 0;
  font-size: 14px;
}
.doc-table th,
.doc-table td {
  border: 1px solid var(--line);
  padding: 6px 8px;
  vertical-align: top;
}
.doc-table th {
  background: #f3f6fb;
  font-weight: 600;
}
.doc-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
  margin-top: 20px;
}
.doc-card {
  display: block;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
  background: #fbfcfe;
}
.doc-card:hover { border-color: var(--accent); }
.doc-card span { display: block; color: var(--muted); font-size: 12px; margin-top: 5px; }
.lead {
  max-width: 780px;
  color: #374151;
}
.library-section {
  border-top: 1px solid var(--line);
  padding-top: 22px;
  margin-top: 28px;
}
.library-section:first-of-type {
  border-top: 0;
  padding-top: 8px;
}
.section-kicker {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 4px;
}
.section-desc {
  color: var(--muted);
  margin: 0 0 14px;
}
.library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 12px;
}
.library-card {
  display: block;
  min-height: 118px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
  background: #fbfcfe;
}
.library-card:hover { border-color: var(--accent); }
.library-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.library-card strong {
  font-size: 15px;
  line-height: 1.35;
}
.library-card p {
  color: var(--muted);
  font-size: 13px;
  margin-top: 8px;
}
.link-tag {
  flex: 0 0 auto;
  color: #1d4ed8;
  background: #e8f0ff;
  border: 1px solid #c7d7fe;
  border-radius: 999px;
  padding: 1px 7px;
  font-size: 11px;
  line-height: 18px;
}
.archive-section h2 {
  margin-top: 24px;
}
.archive-list {
  display: grid;
  gap: 7px;
}
.archive-row {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(260px, 1.2fr);
  gap: 18px;
  align-items: baseline;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
  background: #fbfcfe;
}
.archive-row:hover { border-color: var(--accent); }
.archive-row span {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}
@media (max-width: 880px) {
  .app { display: block; }
  .sidebar { position: static; height: auto; }
  .content { width: 100%; }
  .content { padding: 22px 16px 48px; }
  .doc, .index-panel { padding: 20px 18px; }
  .archive-row { grid-template-columns: 1fr; gap: 4px; }
}
@media print {
  body { background: #fff; }
  .app { display: block; }
  .sidebar { display: none; }
  .content { max-width: none; padding: 0; }
  .doc, .index-panel {
    border: 0;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
  }
  .meta { display: none; }
  a { color: inherit; text-decoration: none; }
  h1 { margin-top: 0; }
  pre { white-space: pre-wrap; }
}
