:root {
  --bg: #f4f5f7; --panel: #ffffff; --text: #1f2328; --muted: #656d76;
  --line: #d0d7de; --accent: #0b5cad; --accent-bg: #e7f0fb;
  --head: #1f3b5a; --head-text: #ffffff; --danger: #b42318; --ok: #1a7f37;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1419; --panel: #161b22; --text: #e6edf3; --muted: #8b949e;
    --line: #30363d; --accent: #58a6ff; --accent-bg: #1c2a3a;
    --head: #1f3b5a; --head-text: #ffffff; --danger: #ff7b72; --ok: #3fb950;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 16px; }
header.site { background: var(--head); color: var(--head-text); }
header.site .wrap { display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 8px; padding: 12px 16px; }
header.site a { color: var(--head-text); }
header.site .brand { font-size: 1.3em; font-weight: 700; }
header.site nav a { margin-left: 14px; }
.crumbs { margin: 14px 0; color: var(--muted); font-size: .95em; }
.crumbs > * + *::before { content: " › "; color: var(--muted); }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 6px;
  margin-bottom: 18px; overflow: hidden; }
.panel h2 { margin: 0; padding: 10px 14px; background: var(--accent-bg);
  font-size: 1.05em; border-bottom: 1px solid var(--line); }
table.list { width: 100%; border-collapse: collapse; }
table.list th, table.list td { padding: 10px 14px; border-bottom: 1px solid var(--line);
  text-align: left; vertical-align: top; }
table.list tr:last-child td { border-bottom: 0; }
table.list th { font-size: .85em; color: var(--muted); font-weight: 600; }
.num { text-align: center; white-space: nowrap; width: 80px; }
.last { width: 220px; font-size: .9em; }
.muted { color: var(--muted); font-size: .9em; }
.desc { color: var(--muted); font-size: .9em; }
.tag { display: inline-block; font-size: .75em; padding: 1px 6px; border-radius: 3px;
  background: var(--accent-bg); color: var(--accent); margin-right: 4px; vertical-align: middle; }
.tag.lock { background: #fde8e8; color: var(--danger); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 10px 0 18px; }
.actions form { display: inline; }
.btn { display: inline-block; padding: 6px 12px; border: 1px solid var(--accent);
  border-radius: 4px; background: var(--accent); color: #fff; cursor: pointer;
  font: inherit; font-size: .9em; }
.btn.secondary { background: transparent; color: var(--accent); }
.btn.danger { background: transparent; color: var(--danger); border-color: var(--danger); }
.btn.small { padding: 2px 8px; font-size: .8em; }
.post { display: grid; grid-template-columns: 170px 1fr; border-bottom: 1px solid var(--line); }
.post:last-child { border-bottom: 0; }
.post .author { padding: 12px 14px; background: var(--accent-bg); font-size: .9em; }
.post .author .name { font-weight: 700; font-size: 1.05em; }
.post .content { padding: 12px 14px; min-width: 0; }
.post .meta { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap;
  color: var(--muted); font-size: .85em; border-bottom: 1px solid var(--line);
  padding-bottom: 6px; margin-bottom: 8px; }
.post .meta .tools { display: flex; gap: 6px; }
.post-body { overflow-wrap: anywhere; }
.post-body blockquote { margin: 8px 0; padding: 6px 12px; border-left: 3px solid var(--accent);
  background: var(--accent-bg); }
.post-body pre { background: var(--bg); padding: 10px; overflow-x: auto; border-radius: 4px; }
.post-body code { background: var(--bg); padding: 1px 4px; border-radius: 3px; }
.post.deleted .content { color: var(--muted); font-style: italic; }
@media (max-width: 640px) { .post { grid-template-columns: 1fr; }
  .last, th.num:nth-child(n+3), td.num:nth-child(n+3) { display: none; } }
form.stack { padding: 14px; display: grid; gap: 10px; max-width: 760px; }
form.stack label { display: grid; gap: 4px; font-size: .9em; }
input[type=text], input[type=number], textarea, select {
  width: 100%; padding: 8px; border: 1px solid var(--line); border-radius: 4px;
  background: var(--panel); color: var(--text); font: inherit; }
textarea { min-height: 180px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.inline { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.inline select { width: auto; max-width: 220px; }
.pager { display: flex; gap: 4px; flex-wrap: wrap; margin: 10px 0; }
.pager a, .pager span { padding: 3px 9px; border: 1px solid var(--line); border-radius: 3px; }
.pager span.cur { background: var(--accent); color: #fff; border-color: var(--accent); }
.flash { padding: 10px 14px; border-radius: 4px; margin-bottom: 14px; background: var(--accent-bg); }
.flash.error { background: #fde8e8; color: var(--danger); }
.error-page { text-align: center; padding: 60px 0; }
footer.site { color: var(--muted); font-size: .85em; text-align: center; padding: 20px 0; }
.help { font-size: .85em; color: var(--muted); }
.page-title { font-size: 1.4em; margin: 0 0 6px; }
.page-title.grow { margin: 0; flex: 1; }
textarea.short { min-height: 120px; }
.pad { padding: 14px; }
.inline-form { display: inline; }
.btn.on-dark { color: #fff; border-color: #fff; }
.w-xs { width: 80px !important; } .w-s { width: 100px; } .w-m { width: 200px !important; }
.w-l { width: 260px !important; } .w-xl { width: 300px !important; }
.row-form { padding: 10px 14px; border-bottom: 1px solid var(--line); }
.row-form.tight { padding: 6px 14px; }
@media (max-width: 640px) { .w-m, .w-l, .w-xl { width: 100% !important; } }
