.auto-toc:empty { display: none; }

:root {
  --bg: rgba(15, 17, 19);
  --fg: rgba(235,219,178,1);
  --link: rgba(200,219,178,1);
  color-scheme: dark;
}
/* light: the main site's default palette (ds-index css/style.css) */
html[data-theme="light"] {
  --bg: #ffffff;
  --fg: #000;
  --link: #194560;
  color-scheme: light;
}
html[data-theme="light"] a:hover { color: #1a7fbb; }
html,body {
    background: var(--bg);
    color: var(--fg);
    font-family: var(--font-serif-g);
}
h2 {
  font-family: var(--font-serif-rome);
}
h3,h4 {
  text-transform: capitalize;
  font-family: var(--font-serif-rome);
}
h2,h3 {
  text-align: center;
}
h4 {
  padding-left: 0.3em;
}
a {
  color: var(--link);
  margin: 1.5px;
  text-decoration: none;
}
a:hover{
  text-decoration: underline;
}
p::first-letter,li::first-letter {
  text-transform: uppercase;
}
li {
    list-style: disclosure-closed;
    /* display: flow-root list-item; */
}
/* BLOCKQUOTE */
blockquote {
  text-align: justify;
  hyphens: auto;
  border-left: 1px solid color-mix(in srgb, var(--fg) 70%, transparent);
  padding: 0 10px 0 10px;
}

/* LEFT MENU */
#container {
    margin: 0 auto;
}
#flex {
    display: flex;
}

aside {
    background: var(--bg);
    border-right: 1px solid beige;
    padding: 15px;
}
aside h2 {
	color: var(--fg-light);
}

aside pre code {
    overflow-x: scroll !important;
    max-width: 210px !important;
}

aside#leftSidebar{
    width: 300px;
}
main {
    flex: 1;
    order: 2;
    padding: 15px;
    column-count: 2;
}

main li {
    list-style: square;
}

#leftSidebar {
    order: 1;
}

.post-right-list {
  display: flex;
  float: right;
}
.hidden {
  display: none;
}

/* FOOTNOTE (Cobalt.rs / pulldown-cmark) */
section.footnotes,
.footnotes {
  column-count: 1;
  break-before: column;
  margin-top: 0.6em;
  line-height: 1.35;
}
.footnotes ol {
  list-style: decimal;
  padding-left: 1.25em;
  margin: 0.25em 0 0;
}
.footnotes li {
  list-style: inherit;
  margin-bottom: 0.15em;
}
.footnote-definition {
  font-size: 0.8em;
  display: flex;
  align-items: baseline;
  gap: 0.2em;
  margin: 0;
}
.footnote-definition-label {
  flex-shrink: 0;
  font-size: 1em;
  vertical-align: sub;
  font-variant-position: sub;
}
.footnote-definition-label::after {
  content: ".";
}
sup.footnote-ref a {
  text-decoration: none;
}
sup.footnote-ref a:hover {
  text-decoration: underline;
}

/* 脚注选中态 — Swiss：中性、克制 */
.footnotes :target,
.footnotes li:target,
.footnote-definition:target {
  scroll-margin-top: 15vh;
  background: color-mix(in srgb, var(--fg) 6%, transparent);
  border-left: 1px solid color-mix(in srgb, var(--fg) 20%, transparent);
  padding-left: 0.5em;
  margin-left: -0.5em;
}

code span {
    color: var(--fg) !important;
    font-family: var(--font-serif-g);
}
pre {
    background-color: var(--bg) !important;
}
pre code {
    overflow-x: auto;
    white-space: pre-wrap;
}
hr,.notes-header {
    border-bottom: 1px solid color-mix(in srgb, var(--fg) 70%, transparent);
}
hr {
  width:40%;
}

main img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0.6em auto;
  break-inside: avoid;
}

figure.paper-fig {
  break-inside: avoid;
  margin: 0.8em 0;
  text-align: center;
}
figure.paper-fig img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}
figure.paper-fig figcaption {
  font-size: 0.85em;
  color: color-mix(in srgb, var(--fg) 85%, transparent);
  margin-top: 0.4em;
  line-height: 1.35;
  text-align: center;
}
figure.paper-fig .fig-missing {
  margin: 0.3em 0 0;
  font-size: 0.85em;
  color: color-mix(in srgb, var(--fg) 55%, transparent);
}

.mjx-chtml .mjx-noError {
	color: beige !important;
  border: none !important;
}

/* ── TOC ── */
.auto-toc ul { list-style: none; padding: 0; margin: 0.5em 0; }
.auto-toc > ul { border-left: 1px solid color-mix(in srgb, var(--fg) 15%, transparent); padding-left: 0.5em; }
.auto-toc ul ul { padding-left: 0.8em; margin: 0; }
.auto-toc li { margin: 0.2em 0; list-style: none; display: grid; grid-template-columns: auto 1fr; column-gap: 0.4em; align-items: baseline; }
.auto-toc li > ul { grid-column: 1 / -1; }
.auto-toc .toc-prefix { font-size: 0.82em; color: color-mix(in srgb, var(--fg) 40%, transparent); }
.auto-toc ul ul .toc-prefix { font-size: 0.76em; }
.auto-toc li::before { content: none; }
.auto-toc a { display: block; font-size: 0.82em; color: color-mix(in srgb, var(--fg) 60%, transparent); text-decoration: none; padding: 1px 0; }
.auto-toc a:hover { color: var(--link); }
.auto-toc a.active { color: var(--fg); }
.auto-toc ul ul a { font-size: 0.76em; color: color-mix(in srgb, var(--fg) 45%, transparent); }
.auto-toc ul ul a:hover { color: var(--link); }

/* ── Bird photos (Avibase illustrations) ── */
figure.bird-photo {
  break-inside: avoid;
  margin: 0.8em 0;
  text-align: center;
}
figure.bird-photo img {
  width: 320px;
  max-width: 100%;
  height: auto;
  border: 1px solid color-mix(in srgb, var(--fg) 15%, transparent);
}
figure.bird-photo figcaption {
  font-size: 0.78em;
  color: color-mix(in srgb, var(--fg) 60%, transparent);
  margin-top: 0.3em;
  line-height: 1.3;
}
table.bird-photos {
  break-inside: avoid;
  width: 100%;
  margin: 1em 0;
  border-collapse: separate;
  border-spacing: 10px 6px;
}
table.bird-photos td {
  width: 50%;
  vertical-align: top;
  text-align: center;
  font-size: 0.78em;
  color: color-mix(in srgb, var(--fg) 60%, transparent);
  line-height: 1.3;
}
table.bird-photos img {
  width: 100%;
  max-width: 230px;
  height: auto;
  display: block;
  margin: 0 auto 0.3em;
  border: 1px solid color-mix(in srgb, var(--fg) 15%, transparent);
}
table.bird-photos em { color: color-mix(in srgb, var(--fg) 80%, transparent); }

@media only screen and (max-width: 800px) {
  #flex {
    flex-direction: column;
  }
  main {
    order: 1;
    column-count: 1;
    padding: 10px;
  }
  aside#leftSidebar {
    order: 2;
    width: 100%;
    border-right: none;
    border-top: 1px solid beige;
    padding: 10px;
  }
}
