:root {
  --bg: #ffffff;
  --text: #1f2933;
  --muted: #5b6573;
  --line: #e3e7ec;
  --soft: #f5f7f9;
  --accent: #2457c5;
  --note-bg: #eef3fd;
  --warn-bg: #fff4e5;
  --warn-line: #f0a020;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14181d;
    --text: #e6e9ed;
    --muted: #9aa4b1;
    --line: #2a3139;
    --soft: #1b2027;
    --accent: #7ea6ff;
    --note-bg: #1a2436;
    --warn-bg: #2e2414;
    --warn-line: #d08a16;
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.6;
}

a { color: var(--accent); }

.site-header {
  border-bottom: 1px solid var(--line);
  padding: 14px 16px;
}

.brand {
  color: var(--text);
  font-weight: 700;
  font-size: 18px;
  text-decoration: none;
}
.brand span { color: var(--muted); font-weight: 400; }

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

.side ul { list-style: none; margin: 0; padding: 0; position: sticky; top: 16px; }
.side li { margin: 0; }
.side a {
  display: block;
  padding: 6px 10px;
  border-radius: 6px;
  color: var(--text);
  text-decoration: none;
  font-size: 15px;
}
.side a:hover { background: var(--soft); }
.side a[aria-current="page"] { background: var(--note-bg); color: var(--accent); font-weight: 600; }

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

h1 { font-size: 32px; line-height: 1.2; margin: 0 0 8px; }
h2 { font-size: 21px; margin: 32px 0 8px; }
h3 { font-size: 17px; margin: 24px 0 4px; }
.lead { font-size: 18px; color: var(--muted); margin-top: 0; }
.meta { color: var(--muted); font-size: 14px; }

ul, ol { padding-left: 22px; }
li { margin: 4px 0; }

.note {
  background: var(--note-bg);
  border-left: 4px solid var(--accent);
  border-radius: 6px;
  padding: 2px 16px;
  margin: 24px 0;
}
.note.warn { background: var(--warn-bg); border-left-color: var(--warn-line); }
.note.draft p { font-size: 17px; }

.share {
  background: var(--soft);
  border: 1px dashed var(--line);
  border-radius: 6px;
  padding: 10px 14px;
  color: var(--muted);
  font-size: 15px;
}

table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 15px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--soft); }

.site-footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  padding: 16px;
  text-align: center;
}

@media (max-width: 760px) {
  .layout { grid-template-columns: 1fr; gap: 16px; padding-top: 12px; }
  .side ul { position: static; display: flex; flex-wrap: wrap; gap: 4px; }
  .side a { padding: 4px 8px; font-size: 14px; background: var(--soft); }
  h1 { font-size: 26px; }
}
