/*! hatex v1.11.2 — LaTeX to HTML in the browser. MIT License. Built from src/ by scripts/build.mjs. */
/* hatex — styles for the HTML that parseLatex() produces.
 *
 * Everything is scoped to an element with class "hatex" and coloured through
 * the --hx-* variables below, so a page can restyle it without touching the
 * rules. Dark mode: put data-theme="dark" on the .hatex element or any
 * ancestor, or data-theme="auto" to follow the system setting.
 *
 * KaTeX's own stylesheet (katex.min.css) is still needed for the maths. Do not
 * load a Prism theme: code tokens are coloured here from the same palette.
 */

/* ── Palette ──
   The default look is plain: black on white in a LaTeX-like serif. */
.hatex {
  --hx-ink: #000;             /* headings, rules, table text */
  --hx-text: #000;            /* paragraphs, lists, captions, table cells */
  --hx-muted: #666;           /* secondary: line numbers, comments, slide footers */
  --hx-accent: #000;          /* links, section numbers, inline code */
  --hx-accent-2: #555;        /* link hover */
  --hx-code-bg: #f6f6f6;      /* code blocks and inline code */
  --hx-border: #ccc;
  --hx-surface: #fff;         /* copy button */
  --hx-paper: #fff;           /* behind TikZ drawings, which are ink on paper */
  --hx-danger: #b3261e;       /* TikZ errors */
  --hx-cite: transparent;     /* frame around citation numbers, e.g. #3aa35b for hyperref's green box */
  --hx-flash: rgba(0, 0, 0, 0.08); /* a clicked \ref's target lights up */
  /* Code tokens (Prism): One Light here, One Dark below. */
  --hx-tok-comment: #a0a1a7;
  --hx-tok-command: #4078f2;
  --hx-tok-env: #a626a4;
  --hx-tok-math: #0184bc;
  --hx-tok-regex: #e45649;
  --hx-tok-punct: #383a42;
  --hx-tok-verbatim: #50a14f;
  --hx-font-body: KaTeX_Main, "Latin Modern Roman", "Times New Roman", serif;
  --hx-font-heading: var(--hx-font-body);
  --hx-font-sans: system-ui, -apple-system, "Segoe UI", sans-serif;
  --hx-font-mono: "JetBrains Mono", "Fira Code", ui-monospace, monospace;
  /* Set only by the dark palette. */
  --hx-color-keep: 100%;      /* how much of an author's \textcolor survives */
  --hx-slide-bg: #fff;
}

/* Dark: author colours are lifted towards white, text on author-chosen light
   backgrounds turns dark, and TikZ drawings (black ink) are inverted in
   lightness with their hues kept, so they sit on the page itself. */
.hatex[data-theme="dark"],
[data-theme="dark"] .hatex {
  --hx-ink: #eee;
  --hx-text: #e6e6e6;
  --hx-muted: #999;
  --hx-accent: #eee;
  --hx-accent-2: #bbb;
  --hx-code-bg: #222;
  --hx-border: #444;
  --hx-surface: #1e1e1e;
  --hx-paper: #fff;
  --hx-flash: rgba(255, 255, 255, 0.12);
  --hx-danger: #e4796f;
  --hx-tok-comment: #7f848e;
  --hx-tok-command: #61afef;
  --hx-tok-env: #c678dd;
  --hx-tok-math: #56b6c2;
  --hx-tok-regex: #e06c75;
  --hx-tok-punct: #abb2bf;
  --hx-tok-verbatim: #98c379;
  --hx-color-keep: 62%;
  --hx-slide-bg: #161616;
  --hx-on-highlight: #1d1b19;
  --hx-mark-bg: #e8d98a;
  --hx-tikz-filter: invert(0.9) hue-rotate(180deg);
}
@media (prefers-color-scheme: dark) {
  .hatex[data-theme="auto"],
  [data-theme="auto"] .hatex {
    --hx-ink: #eee;
    --hx-text: #e6e6e6;
    --hx-muted: #999;
    --hx-accent: #eee;
    --hx-accent-2: #bbb;
    --hx-code-bg: #222;
    --hx-border: #444;
    --hx-surface: #1e1e1e;
    --hx-paper: #fff;
    --hx-flash: rgba(255, 255, 255, 0.12);
    --hx-danger: #e4796f;
    --hx-tok-comment: #7f848e;
    --hx-tok-command: #61afef;
    --hx-tok-env: #c678dd;
    --hx-tok-math: #56b6c2;
    --hx-tok-regex: #e06c75;
    --hx-tok-punct: #abb2bf;
    --hx-tok-verbatim: #98c379;
    --hx-color-keep: 62%;
  --hx-slide-bg: #161616;
    --hx-on-highlight: #1d1b19;
    --hx-mark-bg: #e8d98a;
    --hx-tikz-filter: invert(0.9) hue-rotate(180deg);
  }
}

/* ── Text ── */
.hatex {
  font-family: var(--hx-font-body);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--hx-text);
  counter-reset: katexEqnNo mmlEqnNo;
}
.hatex h1,
.hatex h2,
.hatex h3,
.hatex h4 {
  font-family: var(--hx-font-heading);
  color: var(--hx-ink);
}
.hatex h1 {
  font-size: 1.8rem;
  margin-bottom: 1.5rem;
}
.hatex h2 {
  font-size: 1.4rem;
  margin: 2rem 0 0.9rem;
}
.hatex h3 {
  font-size: 1.15rem;
  margin: 1.5rem 0 0.8rem;
}
.hatex h4 {
  font-size: 1rem;
  margin: 1.2rem 0 0.6rem;
}
.hatex p {
  margin: 0 0 1rem;
  color: var(--hx-text);
}
.hatex a {
  color: var(--hx-accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.hatex a:hover {
  color: var(--hx-accent-2);
}
/* References inside the document are plain numbers, underlined on hover. */
.hatex a.latex-ref,
.hatex .latex-fn-ref a { text-decoration: none; }
.hatex a.latex-ref:hover,
.hatex .latex-fn-ref a:hover { text-decoration: underline; }
.hatex ul,
.hatex ol {
  margin: 1rem 0;
  padding-left: 1.5rem;
  color: var(--hx-text);
}
.hatex li {
  margin-bottom: 0.5rem;
}
.hatex blockquote {
  border-left: 3px solid var(--hx-accent);
  padding-left: 1.2rem;
  margin: 1.5rem 0;
  font-style: italic;
  color: var(--hx-text);
}
.hatex hr {
  border: none;
  border-top: 1px solid var(--hx-border);
  margin: 2rem 0;
}
/* A colour the author chose for text on paper is often too dark to read on a
   dark page; there it is mixed towards white. Light pages keep it as written. */
.hatex .latex-color {
  color: color-mix(in srgb, var(--author-color, currentColor) var(--hx-color-keep), #fff);
}
/* Author-chosen backgrounds (\rowcolor, \cellcolor, \colorbox, \hl) are light,
   so their text turns dark on a dark page. */
.hatex .latex-table [style*="background"],
.hatex .latex-table tr[style*="background"] > *,
.hatex .latex-colorbox,
.hatex mark {
  color: var(--hx-on-highlight, currentColor);
}
.hatex mark {
  background: var(--hx-mark-bg, Mark);
}
.hatex .latex-secnum {
  margin-right: 0.6em;
  color: var(--hx-accent);
  font-variant-numeric: tabular-nums;
}
.hatex .latex-center { text-align: center; }
.hatex .latex-right { text-align: right; }
.hatex .latex-paragraph { color: var(--hx-ink); }
.hatex .latex-sc { font-variant: small-caps; }
.hatex .latex-sf { font-family: var(--hx-font-sans); }
.hatex .latex-fbox {
  border: 1px solid currentColor;
  padding: 0 0.25em;
}
.hatex .latex-logo {
  font-family: "Times New Roman", Times, serif;
  white-space: nowrap;
}
.hatex .latex-logo .a {
  text-transform: uppercase;
  font-size: 0.75em;
  vertical-align: 0.25em;
  margin: 0 -0.15em 0 -0.36em;
}
.hatex .latex-logo .e {
  text-transform: uppercase;
  vertical-align: -0.5ex;
  margin: 0 -0.125em 0 -0.1667em;
}
/* The title block of a paper (\maketitle, ICML's \icmltitle): title,
   authors with their affiliations, and notes from \thanks. */
.hatex .hatex-titleblock {
  text-align: center;
  margin: 0.5rem 0 2rem;
}
.hatex .hatex-title {
  font-family: var(--hx-font-heading);
  font-size: 1.75em;
  font-weight: 700;
  line-height: 1.25;
  color: var(--hx-ink);
  margin: 0 auto 1.1rem;
  max-width: 42rem;
  text-wrap: balance;
}
.hatex .hatex-authors {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.8rem 2.2rem;
  margin-bottom: 0.8rem;
}
.hatex .hatex-authors-inline { display: block; }
.hatex .hatex-author-name { color: var(--hx-ink); font-weight: 600; }
.hatex .hatex-author-affil, .hatex .hatex-affiliations, .hatex .hatex-date {
  font-size: 0.88em;
  color: var(--hx-muted);
  line-height: 1.5;
}
.hatex .hatex-affiliations { margin-bottom: 0.6rem; }
.hatex .hatex-title-notes {
  font-size: 0.8em;
  color: var(--hx-muted);
  margin-top: 0.6rem;
}
.hatex .hatex-sym { margin-right: 0.15em; }
.hatex .latex-abstract {
  margin: 0 auto 2rem;
  max-width: 38rem;
  font-size: 0.9rem;
}
.hatex .latex-abstract-title {
  text-align: center;
  font-weight: 600;
  color: var(--hx-ink) !important;
  margin-bottom: 0.4rem !important;
}
.hatex .latex-list dt {
  font-weight: 600;
  color: var(--hx-ink);
}
.hatex .latex-list dd {
  margin: 0 0 0.6rem 1.5rem;
}
.hatex .latex-custom-label { list-style: none; }
.hatex .latex-item-label {
  margin-left: -1.2rem;
  margin-right: 0.4rem;
}

/* ── Code ── */
.hatex code {
  font-family: var(--hx-font-mono);
  font-size: 0.85em;
  background: var(--hx-code-bg);
  padding: 0.15rem 0.4rem;
  border-radius: 0.3rem;
  color: var(--hx-accent);
}
.hatex pre {
  position: relative;
  background: var(--hx-code-bg);
  border: 1px solid var(--hx-border);
  border-radius: 0.5rem;
  padding: 1.2rem;
  /* Long lines wrap instead of scrolling, as on a printed page. Only the
     display wraps: copying the block gives the lines as written. */
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  margin: 1.5rem 0;
}
.hatex pre code {
  background: transparent;
  padding: 0;
  color: var(--hx-ink);
}
/* One block per line (HaTeX.enhance): a wrapped part hangs under the line's
   own indentation, two characters further in. */
.hatex pre .hatex-code-line {
  display: block;
  padding-left: calc((var(--hx-indent) + 2) * 1ch);
  text-indent: calc((var(--hx-indent) + 2) * -1ch);
}
.hatex .token.comment, .hatex .token.prolog,
.hatex .token.doctype, .hatex .token.cdata { color: var(--hx-tok-comment); }
.hatex .token.comment { font-style: italic; }
.hatex .token.punctuation { color: var(--hx-tok-punct); }
.hatex .token.property, .hatex .token.tag, .hatex .token.boolean,
.hatex .token.number, .hatex .token.constant, .hatex .token.symbol,
.hatex .token.deleted { color: var(--hx-tok-math); }
.hatex .token.selector, .hatex .token.attr-name, .hatex .token.string,
.hatex .token.char, .hatex .token.builtin,
.hatex .token.inserted { color: var(--hx-tok-verbatim); }
.hatex .token.operator, .hatex .token.entity,
.hatex .token.url, .hatex .token.variable { color: var(--hx-ink); }
.hatex .token.atrule, .hatex .token.attr-value,
.hatex .token.keyword { color: var(--hx-tok-env); }
.hatex .token.function, .hatex .token.class-name { color: var(--hx-tok-command); }
.hatex .token.regex, .hatex .token.important { color: var(--hx-tok-regex); }
/* Added by HaTeX.enhance() to every code block. */
.hatex .hatex-copy {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  padding: 0.15rem 0.5rem;
  border: 1px solid var(--hx-border);
  border-radius: 0.3rem;
  background: var(--hx-surface);
  color: var(--hx-muted);
  font: 500 0.7rem var(--hx-font-sans);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s;
}
.hatex pre:hover .hatex-copy,
.hatex .hatex-copy:focus {
  opacity: 1;
}
.hatex .hatex-copy:hover {
  color: var(--hx-accent);
  border-color: var(--hx-accent);
}

/* ── Maths ── */
.hatex .katex {
  font-size: 1.05em;
}
.hatex .katex-display {
  /* Never a scrollbar: the runtime scales an equation too wide for its line
     down to fit (see fitDisplays), as a typeset page would. */
  overflow: visible;
  padding: 0.5rem 0;
}
/* \label in display maths leaves an empty marker in front of the equation. */
.hatex .latex-anchor {
  display: block;
  height: 0;
}
/* The target of a clicked \ref / \cite / footnote briefly lights up. */
@keyframes hatex-flash {
  from { background-color: var(--hx-flash); }
  to { background-color: transparent; }
}
.hatex .latex-flash {
  animation: hatex-flash 1.6s ease-out;
  border-radius: 0.3rem;
}

/* ── Theorems, proofs, algorithms ── */
.hatex .latex-theorem { margin: 1.4rem 0; }
.hatex .latex-theorem.latex-thm p {
  font-style: italic;
  color: var(--hx-ink);
}
.hatex .latex-thm-head {
  font-style: normal;
  font-weight: 600;
  color: var(--hx-ink);
}
.hatex .latex-proof .latex-thm-head {
  font-weight: normal;
  font-style: italic;
}
.hatex .latex-thm-note { font-weight: normal; }
.hatex .latex-qed {
  float: right;
  margin-left: 1rem;
  color: var(--hx-ink);
}
.hatex .latex-alg {
  margin: 0.6rem 0;
  padding: 0.6rem 0.2rem;
  border-top: 1.5px solid var(--hx-ink);
  border-bottom: 1.5px solid var(--hx-ink);
  font-size: 0.88rem;
  line-height: 1.75;
  text-align: left;
}
.hatex .latex-alg-line {
  display: flex;
  gap: 0.6rem;
  color: var(--hx-ink);
}
.hatex .latex-alg-num {
  flex-shrink: 0;
  width: 1.6em;
  text-align: right;
  color: var(--hx-muted);
  font-variant-numeric: tabular-nums;
  font-size: 0.85em;
}
/* Numbers stay in their own column while nested lines indent. */
.hatex .latex-alg.numbered .latex-alg-line { position: relative; }
.hatex .latex-alg.numbered .latex-alg-num { position: absolute; left: 0; }
.hatex .latex-alg.numbered .latex-alg-line > :last-child { margin-left: 2.2em; }
.hatex .latex-alg-kw { font-weight: 600; }
.hatex .latex-alg-comment {
  color: var(--hx-muted);
  font-style: italic;
}

/* ── Floats: figures, tables, algorithms ── */
.hatex .latex-float {
  margin: 2rem 0;
  text-align: center;
}
.hatex .latex-float figcaption {
  margin: 0.7rem auto;
  max-width: 42rem;
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--hx-text);
}
.hatex .latex-float-algorithm figcaption {
  margin: 0 auto 0.4rem;
  text-align: left;
}
.hatex .latex-cap-label {
  font-weight: 600;
  color: var(--hx-ink);
}
.hatex .latex-subfloat {
  display: inline-block;
  vertical-align: top;
  margin: 0 0.75% 0.5rem;
  text-align: center;
}
.hatex .latex-subfloat figcaption { margin-top: 0.3rem; }
.hatex .latex-subfloat .latex-img { width: 100%; }
.hatex .latex-minipage {
  display: inline-block;
  vertical-align: top;
  margin: 0 0.75%;
}
.hatex .latex-img {
  max-width: 100%;
  height: auto;
  border-radius: 0.4rem;
}

/* ── Tables ── */
.hatex table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.9rem;
}
.hatex th,
.hatex td {
  border: 1px solid var(--hx-border);
  padding: 0.75rem 1rem;
  text-align: left;
}
.hatex th {
  background: var(--hx-code-bg);
  font-weight: 500;
  color: var(--hx-ink);
}
.hatex td { color: var(--hx-text); }
.hatex .latex-table-wrap {
  overflow-x: auto;
  margin: 1.5rem 0;
}
.hatex .latex-float .latex-table-wrap { margin: 0.5rem 0; }
/* \resizebox{\linewidth}{!}{...}: shrunk to the column width by the runtime. */
.hatex .latex-fit { overflow-x: auto; }
.hatex .latex-fit .latex-table-wrap { overflow: visible; }
/* Booktabs-style tables: no grid, only the rules the source asks for. */
.hatex table.latex-table {
  width: auto;
  margin: 0 auto;
  font-variant-numeric: tabular-nums;
}
.hatex .latex-table th,
.hatex .latex-table td {
  border: none;
  padding: 0.45rem 1rem;
  text-align: left;
  vertical-align: middle;
  color: var(--hx-ink);
  background: transparent;
}
.hatex .latex-table th { font-weight: 600; }
.hatex .latex-table .a-center { text-align: center !important; }
.hatex .latex-table .a-right { text-align: right !important; }
.hatex .latex-table .vl { border-left: 1px solid var(--hx-ink) !important; }
.hatex .latex-table .vr { border-right: 1px solid var(--hx-ink) !important; }
.hatex .latex-table tr.rule-top > * { border-top: 1px solid var(--hx-ink) !important; }
.hatex .latex-table tr.rule-top.rule-heavy > * { border-top-width: 1.5px !important; }
.hatex .latex-table tr.rule-top.rule-double > * { border-top: 3px double var(--hx-ink) !important; }
.hatex .latex-table tr.rule-bottom > * { border-bottom: 1px solid var(--hx-ink) !important; }
.hatex .latex-table tr.rule-bottom.rule-heavy > * { border-bottom-width: 1.5px !important; }
.hatex .latex-table tr.rule-bottom.rule-double > * { border-bottom: 3px double var(--hx-ink) !important; }
/* \cline / \cmidrule: drawn as a background line so (l)/(r) trims leave gaps. */
.hatex .latex-table .cline {
  background-image: linear-gradient(var(--hx-ink), var(--hx-ink)) !important;
  background-repeat: no-repeat !important;
  background-size: 100% 0.8px !important;
  background-position: center top !important;
}
.hatex .latex-table .cline.cl-l { background-size: calc(100% - 0.5em) 0.8px !important; background-position: right top !important; }
.hatex .latex-table .cline.cl-r { background-size: calc(100% - 0.5em) 0.8px !important; background-position: left top !important; }
.hatex .latex-table .cline.cl-l.cl-r { background-size: calc(100% - 1em) 0.8px !important; background-position: center top !important; }

/* ── Citations and footnotes ── */
/* hyperref-style: a green frame around the cited number. */
.hatex .latex-cite { white-space: nowrap; }
.hatex .latex-cite-link {
  display: inline-block;
  padding: 0 0.2em;
  line-height: 1.25;
  border: 1px solid var(--hx-cite);
  border-radius: 2px;
  color: inherit !important;
  text-decoration: none !important;
}
/* Author-year citations are words in the sentence: no padding around the
   names, and a long (A, 2017; B, 2018) may wrap. */
.hatex .latex-cite-ay { white-space: normal; }
.hatex .latex-cite-ay .latex-cite-link { display: inline; padding: 0; }
.hatex .latex-cite-link:hover {
  background: color-mix(in srgb, var(--hx-cite) 12%, transparent);
  text-decoration: underline !important;
}
.hatex .latex-bib ol {
  list-style: none;
  padding-left: 0;
  font-size: 0.88rem;
}
.hatex .latex-bib li {
  position: relative;
  padding-left: 2.4rem;
}
/* Author-year references (natbib labels) have no numbers: a hanging indent. */
.hatex .latex-bib-ay li {
  padding-left: 1.6rem;
  text-indent: -1.6rem;
}
.hatex .latex-bib-num {
  position: absolute;
  left: 0;
  color: var(--hx-ink);
}
.hatex .latex-fn-ref a {
  text-decoration: none;
  font-size: 0.75em;
}
.hatex .latex-footnotes {
  margin-top: 2.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--hx-border);
  font-size: 0.85rem;
}
.hatex .latex-fn-back { text-decoration: none !important; }

/* ── TikZ ── */
.hatex .latex-tikz {
  margin: 1.2rem 0;
  text-align: center;
  overflow-x: auto;
}
.hatex .latex-tikz svg {
  box-sizing: border-box; /* the dark sheet's padding stays inside max-width */
  max-width: 100%;
  height: auto;
  overflow: visible;
  /* Dark mode inverts the drawing. To put it on a light sheet instead, set
     --hx-tikz-filter: none and --hx-tikz-sheet / --hx-tikz-sheet-pad. */
  filter: var(--hx-tikz-filter, none);
  background: var(--hx-tikz-sheet, transparent);
  padding: var(--hx-tikz-sheet-pad, 0);
  border-radius: 0.4rem;
}
/* TikZJax's fonts report a tiny ascent (see loadTikzFonts in runtime.js);
   an invisible stroke widens each label's paint area to the whole glyph, so
   no browser leaves the top of a label unpainted. */
.hatex .latex-tikz svg text { stroke: transparent; stroke-width: 1.4em; }
.hatex .latex-tikz-status {
  margin-top: 0.4rem;
  font-size: 0.75rem;
  color: var(--hx-muted);
  letter-spacing: 0.02em;
}
.hatex .latex-tikz-error {
  display: inline-block;
  max-width: 100%;
  padding: 0.6rem 0.9rem;
  border: 1px solid var(--hx-danger);
  border-radius: 0.4rem;
  background: color-mix(in srgb, var(--hx-danger) 6%, transparent);
  color: var(--hx-danger);
  font-family: var(--hx-font-mono);
  font-size: 0.78rem;
  text-align: left;
  white-space: pre-wrap;
}

/* ── Columns: \documentclass[twocolumn] and multicols ──
   The runtime cuts the flow into chunks at full-width items (headings, the
   abstract, figure* and table*) and shares each chunk out over side-by-side
   columns; without the runtime it is one column. Plain block layout, not CSS multi-column, which Safari gets
   wrong with KaTeX. */
.hatex .hatex-cols-flow > :first-child { margin-top: 0; }
.hatex .hatex-cols-chunk { display: flex; align-items: flex-start; }
.hatex .hatex-col { flex: 1 1 0; min-width: 0; position: relative; }
.hatex .hatex-col > :first-child { margin-top: 0; }
.hatex .hatex-colbreak { display: none; }
/* A paragraph, theorem or list split at a column break. */
.hatex .hatex-split-before { margin-bottom: 0 !important; }
.hatex .hatex-split-after { margin-top: 0 !important; }

/* ── Vertical Chinese text: guji and vertical ──
   guji is a page in the manner of a manuscript scroll (卷子本): columns
   read from right to left, --hx-guji-chars characters to a column (行款),
   ruled between the columns (烏絲欄) and above and below (天頭、地腳). When
   it is wider than its sheet, the runtime cuts it into leaves (.hatex-leaves):
   for guji, sheets of --hx-guji-aspect (width to height, 4/3 by default: a
   landscape page) set from right to left and wrapping onto the next row;
   for vertical, leaves as wide as the page. Without the runtime it
   scrolls sideways, starting at the right. */
.hatex .hatex-guji-wrap,
.hatex .hatex-vertical-wrap {
  writing-mode: vertical-rl;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  margin: 1.5rem 0;
}
.hatex .hatex-leaves {
  writing-mode: horizontal-tb;
  overflow: visible;
  display: flex;
  flex-flow: row-reverse wrap;   /* the first leaf at the right, as in a Chinese book */
  justify-content: center;
  align-items: flex-start;
  gap: 1.5rem 1.2rem;
}
/* A printed leaf stays on one page. */
@media print {
  .hatex .hatex-leaves > * { break-inside: avoid; }
}
.hatex .hatex-guji,
.hatex .hatex-vertical {
  --hx-guji-chars: 20;
  --hx-guji-aspect: 4/3;
  --hx-guji-pitch: 1.9em;
  writing-mode: vertical-rl;
  inline-size: calc(var(--hx-guji-chars) * 1em);
  line-height: var(--hx-guji-pitch);
  font-family: var(--hx-font-guji, "Songti TC", "Noto Serif CJK TC", "Source Han Serif TC", "Songti SC", "Noto Serif CJK SC", PMingLiU, STSong, serif);
  font-size: 1.3rem;
  color: var(--hx-ink);
  text-align: start;
}
.hatex .hatex-guji {
  padding-inline: 0.7em;
  padding-block: 0 0.5em;
  border: 3px double var(--hx-ink);
  background: var(--hx-guji-paper, transparent)
    linear-gradient(to left, var(--hx-guji-rule, color-mix(in srgb, var(--hx-ink) 45%, transparent)) 0 1px, transparent 1px)
    right top / var(--hx-guji-pitch) 100% repeat-x;
}
.hatex .hatex-guji p,
.hatex .hatex-vertical p {
  margin: 0;
  text-indent: 0;
  text-align: start;
  color: inherit;
}
.hatex .hatex-guji .latex-right,
.hatex .hatex-guji .latex-right p,
.hatex .hatex-vertical .latex-right,
.hatex .hatex-vertical .latex-right p { text-align: end; }
/* 句讀: a small circle (句) or dot (讀) beside the end of the character,
   taking no room in the column. The punctuation itself stays for copying. */
.hatex .hatex-ju,
.hatex .hatex-dou {
  display: inline-block;
  position: relative;
  inline-size: 0;
  block-size: 1em;
  vertical-align: middle;
  color: transparent;
  overflow: visible;
}
.hatex .hatex-ju::after,
.hatex .hatex-dou::after {
  content: "";
  position: absolute;
  box-sizing: border-box;
  inset-inline-start: -0.42em;
  inset-block-start: -0.02em;
  color: var(--hx-judou, var(--hx-ink));
}
.hatex .hatex-ju::after {
  inline-size: max(0.38em, 5px);
  block-size: max(0.38em, 5px);
  border: max(0.07em, 1px) solid;
  border-radius: 50%;
}
.hatex .hatex-dou::after {
  inline-size: max(0.24em, 3px);
  block-size: max(0.24em, 3px);
  border-radius: 50%;
  background: currentColor;
  inset-inline-start: -0.33em;
  inset-block-start: 0.04em;
}

/* \jiazhu: two small lines inside one line of text, in any direction. */
.hatex .hatex-jiazhu {
  display: inline-block;
  font-size: 0.5em;
  line-height: 1.02;
  inline-size: calc(var(--hx-jz, 4) * 1em + 0.02em);
  vertical-align: middle;
  white-space: normal;
  word-break: break-all;
  line-break: anywhere;
  text-align: start;
  text-indent: 0;
}

/* ── Blocks and columns (beamer's block / alertblock / exampleblock, columns) ── */
.hatex .hatex-block {
  margin: 1rem 0;
  border: 1px solid var(--hx-border);
  border-radius: 0.4rem;
  overflow: hidden;
}
.hatex .hatex-block-title {
  padding: 0.35em 0.8em;
  background: var(--hx-code-bg);
  font-weight: 700;
  color: var(--hx-ink);
}
.hatex .hatex-block.alert .hatex-block-title { color: var(--hx-danger); }
.hatex .hatex-block.example .hatex-block-title { color: var(--hx-example, #2e7d32); }
.hatex .hatex-block-body { padding: 0.5em 0.8em; }
.hatex .hatex-block-body > :last-child { margin-bottom: 0; }
.hatex .hatex-columns { display: flex; gap: 1.5em; align-items: center; }
.hatex .hatex-columns.top { align-items: flex-start; }
.hatex .hatex-column { flex: 1 1 0; min-width: 0; }

/* ── Slides (beamer) ──
   Each slide is laid out at beamer's size (960x540 for 16:9, 768x576 for
   4:3, …) and scaled to its frame by the runtime, so sizes below are in
   slide pixels. */
.hatex .hatex-deck-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 0 0 0.8rem;
  font-size: 0.85rem;
  color: var(--hx-muted);
}
.hatex .hatex-present {
  font: inherit;
  padding: 0.3rem 0.9rem;
  border: 1px solid var(--hx-ink);
  border-radius: 0.3rem;
  background: var(--hx-ink);
  color: var(--hx-slide-bg);
  cursor: pointer;
}
.hatex .hatex-slide-frame {
  position: relative;
  width: 100%;
  aspect-ratio: var(--hx-ratio, 16 / 9);
  overflow: hidden;
  margin: 0 auto 1.2rem;
  border: 1px solid var(--hx-border);
  border-radius: 0.3rem;
  background: var(--hx-slide-bg);
}
.hatex .hatex-slide {
  position: absolute;
  top: 0;
  left: 0;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  padding: 34px 52px 44px;
  transform-origin: 0 0;
  font-size: 24px;
  line-height: 1.45;
  color: var(--hx-ink);
}
.hatex .hatex-slide-title {
  margin: 0 0 18px;
  padding: 0;
  border: 0;
  font: 700 34px/1.2 var(--hx-font-heading);
}
.hatex .hatex-slide-title small {
  display: block;
  margin-top: 4px;
  font-size: 22px;
  font-weight: 400;
  color: var(--hx-muted);
}
.hatex .hatex-slide-body {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.hatex .hatex-slide.top .hatex-slide-body { justify-content: flex-start; }
.hatex .hatex-slide.bottom .hatex-slide-body { justify-content: flex-end; }
.hatex .hatex-slide-foot {
  margin: 0;
  padding: 0;
  border: 0;
  text-align: left;
  position: absolute;
  left: 52px;
  right: 52px;
  bottom: 12px;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  font-size: 14px;
  color: var(--hx-muted);
}
.hatex .hatex-slide p,
.hatex .hatex-slide li,
.hatex .hatex-slide td,
.hatex .hatex-slide .latex-float figcaption { color: var(--hx-ink); }
.hatex .hatex-slide p { margin: 0 0 0.55em; }
.hatex .hatex-slide ul,
.hatex .hatex-slide ol { margin: 0.2em 0 0.5em; padding-left: 1.2em; }
.hatex .hatex-slide li { margin-bottom: 0.3em; }
.hatex .hatex-slide .latex-float { margin: 12px 0; }
.hatex .hatex-slide .latex-float figcaption { font-size: 18px; margin: 8px auto 0; }
.hatex .hatex-slide table,
.hatex .hatex-slide .latex-alg { font-size: 20px; }
.hatex .hatex-slide pre { font-size: 17px; padding: 14px 18px; margin: 10px 0; }
.hatex .hatex-slide code { font-size: 0.8em; }
.hatex .hatex-slide .katex-display { margin: 0.4em 0; padding: 0.2em 0; }
.hatex .hatex-slide .latex-footnotes { font-size: 16px; }
.hatex .hatex-slide.titlepage .hatex-slide-body { text-align: center; }
.hatex .hatex-titlepage > div { margin: 0 0 8px; }
.hatex .hatex-titlepage .hatex-tp-title { margin: 0 0 12px; font: 700 46px/1.15 var(--hx-font-heading); color: var(--hx-ink); }
.hatex .hatex-tp-subtitle { font-size: 28px; color: var(--hx-muted); margin-bottom: 36px !important; }
.hatex .hatex-tp-author { font-size: 26px; }
.hatex .hatex-tp-institute,
.hatex .hatex-tp-date { font-size: 20px; color: var(--hx-muted); }
.hatex .hatex-toc { list-style: decimal; }
/* Presenting: one slide, full screen, letterboxed. */
.hatex .hatex-deck.hatex-presenting {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  cursor: none;
}
.hatex .hatex-presenting .hatex-deck-bar,
.hatex .hatex-presenting .hatex-slide-frame:not(.current) { display: none; }
.hatex .hatex-presenting .hatex-slide-frame.current {
  width: min(100vw, calc(100vh * var(--hx-ratio)));
  margin: 0;
  border: 0;
  border-radius: 0;
}

/* ── Click-to-zoom figures (HaTeX.enhance) ── */
.hatex .hatex-zoomable { cursor: zoom-in; }
.hatex-zoom {
  position: fixed;
  inset: 0;
  z-index: 4000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: rgba(20, 18, 16, 0.86);
  opacity: 0;
  transition: opacity 0.2s;
  cursor: zoom-out;
}
.hatex-zoom.open { opacity: 1; }
.hatex-zoom > * {
  max-width: 96vw;
  max-height: 92vh;
  width: auto;
  height: auto;
  border-radius: 0.4rem;
  background: var(--hx-paper, #fdfaf6);
  padding: 0.5rem;
}
/* Drawings carry a fixed pt size, so zooming scales them to the screen. */
.hatex-zoom > svg {
  width: min(92vw, 1100px);
  height: auto;
}
.hatex-zoom > img {
  min-width: min(60vw, 700px);
  object-fit: contain;
}

@media (prefers-reduced-motion: reduce) {
  .hatex .latex-flash { animation: none; }
  .hatex-zoom,
  .hatex .hatex-copy { transition: none; }
}
