/* Shared Alaya palette over the two self-hosted reading styles. */
:root[data-theme=light] .markdown-body, :root[data-theme=dark] .markdown-body {
  color-scheme: inherit;
  --fgColor-default: var(--ink);
  --fgColor-muted: var(--muted);
  --fgColor-accent: var(--indigo);
  --bgColor-default: var(--paper);
  --bgColor-muted: var(--rail);
  --bgColor-neutral-muted: var(--subtle);
  --borderColor-default: var(--line-strong);
  --borderColor-muted: var(--line);
  background-color: transparent;
  font-family: var(--sans);
}
.ws-md.prose, :root[data-theme=dark] .ws-md.prose {
  --prose-body: var(--ink-strong);
  --prose-headings: var(--ink);
  --prose-links: var(--indigo);
  --prose-bold: var(--ink);
  --prose-quotes: var(--ink-strong);
  --prose-quote-borders: var(--line-strong);
  --prose-hr: var(--line);
  --prose-code: var(--ink);
  --prose-pre-bg: var(--subtle);
  --prose-pre-code: var(--ink);
  --prose-th-borders: var(--line-strong);
  --prose-td-borders: var(--line);
  max-width: none; color: var(--ink-strong); line-height: 1.72;
}
.ws-md.prose.prose-editorial {
  font-family: Georgia, "Iowan Old Style", "Palatino Linotype", "Songti SC", "Noto Serif CJK SC", serif;
  font-size: 1.04rem; line-height: 1.8;
}
:root[data-theme=dark] .ws-md.prose-editorial { line-height: 1.8; }
.ws-md { overflow-wrap: break-word; }
.ws-md > :first-child { margin-top: 0; }
.ws-md > :last-child { margin-bottom: 0; }
.ws-md :is(code,pre) { font-family: var(--mono); }
:lang(zh-CN) .ws-md :is(h1,h2,h3,h4) { font-family: inherit; line-height: 1.3; }
:lang(zh-CN) .ws-md h1 { font-size: 2em; }
:lang(zh-CN) .ws-md h2 { font-size: 1.5em; }
:lang(zh-CN) .ws-md h3 { font-size: 1.25em; }
:lang(zh-CN) .ws-md h4 { font-size: 1em; }

.ws-md .prose-table {
  width: 100%; overflow-x: auto; margin: 1.2em 0;
  border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--paper);
}
.ws-md .prose-table table {
  display: table; width: 100%; max-width: none; margin: 0; border-collapse: collapse;
  font: .875rem var(--sans); font-variant-numeric: tabular-nums;
}
.ws-md .prose-table :is(th,td) {
  padding: 9px 14px; text-align: start; border: 0; border-bottom: 1px solid var(--line); vertical-align: top;
}
.ws-md .prose-table thead th { background: var(--rail); color: var(--muted); font-size: .78rem; font-weight: 500; }
.ws-md .prose-table tr { border: 0; background: var(--paper); }
.ws-md .prose-table tbody tr:last-child td { border-bottom: 0; }
.ws-md .prose-table tbody tr:hover { background: var(--subtle); }

.ws-md ul.task-list { list-style: none; padding-inline-start: 0; }
.ws-md li ul.task-list { padding-inline-start: 1.5em; }
.ws-md li.task-list-item { list-style: none; position: relative; padding-inline-start: 1.6em; }
.ws-md li.task-list-item.is-checked { color: var(--muted); }
.ws-md li.task-list-item input[type=checkbox] {
  appearance: none; -webkit-appearance: none; display: inline-block; width: 15px; height: 15px;
  margin: 0 .55em 0 -1.6em; vertical-align: -.18em; position: relative;
  border: 1.5px solid var(--line-strong); border-radius: 4px; background: var(--paper); cursor: default; opacity: 1;
}
.ws-md li.task-list-item input:checked { background: var(--ink); border-color: var(--ink); }
.ws-md li.task-list-item input:checked::after {
  content: ""; position: absolute; left: 4px; top: 1px; width: 4px; height: 8px;
  border: solid var(--paper); border-width: 0 1.5px 1.5px 0; transform: rotate(45deg);
}
.ws-md :is(.ep,.ident) { vertical-align: baseline; font-family: var(--mono); }
.ws-md .kb-link, .ws-md .kb-unresolved { font: inherit; vertical-align: baseline; }
.ws-md .kb-link {
  appearance: none; -webkit-appearance: none; color: inherit;
  text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: .18em;
}
.ws-md .kb-link:is(:hover,:focus-visible) { color: var(--indigo); text-decoration-color: currentColor; }
