/*!
 * Project: Heti
 * URL: https://github.com/sivan/heti
 * Author: Sivan [sun.sivan@gmail.com]
 */

:root {
  --text-font: 'TsangerJinKai02-W04', sans-serif;
  --code-text-font: 'TsangerJinKai02-W04', sans-serif;
  --markmap-height: 300px;
}

html {
  font-size: 15px;
  font-display: block;
  color: #262626;
  -webkit-font-smoothing: subpixel-antialiased;
}

body {
  padding: 0;
  margin: 0;
  background: #FFFFFF;
}

@media (prefers-color-scheme: dark) {
  .html {
    color: #ede6f5;
  }
}

img {
  max-width: 100%;
  height: auto;
  object-fit: cover;
}

.heti p > img {
  margin-top: 8px;
}

pre, video, iframe {
  max-width: 100%;
}

#write {
  margin: 0;
  max-width: 900px;
  padding: 0 28px 80px;
}

a,
.heti a heti-spacing {
  color: #0C6ADA;
  cursor: pointer;
}

.heti {
  font-weight: 400;
  line-height: 1.74;
  letter-spacing: 0.04em;
  overflow-wrap: break-word;
  word-wrap: break-word;
  hyphens: auto;
}

.heti::before,
.heti::after {
  content: '';
  display: table;
}

.heti::after {
  clear: both;
}

.heti > *:first-child,
.heti section > *:first-child,
.heti td > *:first-child {
  margin-block-start: 0 !important;
}

.heti > h1:first-child,
.heti > h2:first-child,
.heti > h3:first-child,
.heti > h4:first-child,
.heti > h5:first-child,
.heti > h6:first-child {
  margin-block-start: 10px !important;
}

.heti > ol:first-child {
  margin-block-start: 5px !important;
  padding-inline-start: calc(12px + 1em);
}

.heti > ul:first-child {
  margin-block-start: 5px !important;
  padding-inline-start: 20px;
}

.heti > *:last-child,
.heti section > *:last-child,
.heti td > *:last-child {
  margin-block-end: 0 !important;
}

.heti figure {
  display: block;
  text-align: center;
}

.heti figure > img {
  display: block;
  margin-inline-start: auto;
  margin-inline-end: auto;
}

.heti hr {
  width: 100%;
  height: 1px;
  margin-block-start: 1.6em;
  margin-block-end: 1.6em;
  margin-inline-start: auto;
  margin-inline-end: auto;
  border: 0;
  background-color: #e6e6e6;
}


.heti p {
  margin-block-start: 1.6em;
  margin-block-end: 1.6em;
  text-align: left;
}

.heti p[align='center'] {
  text-align: center;
}

.heti p[align='left'] {
  text-align: left;
}

.heti p[align='right'] {
  text-align: right;
}

.heti blockquote {
  margin: 0;
  margin-block-start: 0.8em;
  margin-block-end: 1.6em;
  padding: 0 15px;
  border-radius: 8px;
  color: #777;
  border-left: 4px solid #e6e6e6;
  line-height: 1;
  overflow: hidden;
  box-sizing: border-box;
  width: fit-content;
  max-width: 100%;
}

.heti blockquote p {
  margin-block-end: 0.4em;
  margin-block-start: 0.4em;
  line-height: 1.74;
}

blockquote blockquote {
  padding-right: 0;
}


.heti pre {
  margin-block-start: 0.8em;
  margin-block-end: 1.6em;
  margin-inline-start: 0;
  margin-inline-end: 0;
  padding-block-start: 12px;
  padding-block-end: 12px;
  padding-inline-start: 16px;
  padding-inline-end: 16px;
  overflow: auto;
  font-family: var(--text-font);
  white-space: pre;
  word-wrap: normal;
  border-radius: 8px;
  background-color: rgba(0, 0, 0, 0.03);
}


.heti pre code {
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background-color: transparent;
  color: inherit;
  white-space: pre-wrap;
}

.heti pre code span {
  line-break: anywhere;
}


.heti h1,
.heti h2,
.heti h3,
.heti h4,
.heti h5,
.heti h6 {
  position: relative;
  margin: 0;
  line-height: 1.8;
  margin-block-start: 1.6em;
  margin-block-end: 0.8em;
  font-weight: bold;
  -webkit-font-smoothing: antialiased;
}

.heti h1 {
  font-size: 2em;
}

.heti h2 {
  font-size: 1.5em;
}

.heti h3 {
  font-size: 1.25em;
}

.heti h3,
.heti h4,
.heti h5,
.heti h6 {
  margin-block-start: 0.6em;
  margin-block-end: 0.6em;
}

.heti h4,
.heti h5,
.heti h6 {
  font-size: 1em;
}

.heti h1,
.heti h2,
.heti h3 {
  letter-spacing: 0.05em;
}

.heti h1:not(:lang(zh)):not(:lang(ja)):not(:lang(kr)),
.heti h1:not(:lang(zh)),
.heti h2:not(:lang(zh)):not(:lang(ja)):not(:lang(kr)),
.heti h2:not(:lang(zh)),
.heti h3:not(:lang(zh)):not(:lang(ja)):not(:lang(kr)),
.heti h3:not(:lang(zh)) {
  letter-spacing: 0;
}

.heti h1 + h2,
.heti h2 + h3,
.heti h3 + h4,
.heti h4 + h5,
.heti h5 + h6 {
  margin-block-start: 0.8em;
}

.heti ul,
.heti ol,
.heti dl {
  margin-block-start: 0.8em;
  margin-block-end: 1.6em;
}

.heti ul {
  padding-inline-start: calc(24px + 0.5em);
}

.heti ol {
  padding-inline-start: calc(24px + 1em);
}

.heti ul ul,
.heti ul ol,
.heti ol ul,
.heti ol ol {
  margin-block-start: 0;
  margin-block-end: 0;
}

.heti ul {
  list-style-type: disc;
}

.heti ol {
  list-style-type: decimal;
}

.heti ul ul,
.heti ol ul {
  list-style-type: circle;
}

.heti ul ul ul,
.heti ul ol ul,
.heti ol ul ul,
.heti ol ol ul {
  list-style-type: square;
}

.heti li {
  list-style-type: unset;
}

.heti table {
  box-sizing: border-box;
  table-layout: fixed;
  margin-block-start: 0.8em;
  margin-block-end: 1.6em;
  margin-inline-start: auto;
  margin-inline-end: auto;
  border-collapse: collapse;
  border-width: 1px;
  border-style: solid;
  border-color: #e6e6e6;
  word-break: break-word;
}

.heti p > code,
.heti li > code {
  background-color: #eef1f2;
  padding: 2px;
  border-radius: 8px;
}


.heti table {
  margin-right: auto;
  margin-left: 0px;
}

.heti th,
.heti td {
  padding-block-start: 6px;
  padding-block-end: 6px;
  padding-inline-start: 8px;
  padding-inline-end: 8px;
  border-width: 1px;
  border-style: solid;
  border-color: #e6e6e6;
}


.heti caption {
  caption-side: bottom;
  margin-block-start: 2px;
  margin-block-end: -4px;
  font-size: 14px;
  line-height: 24px;
}

.heti a {
  text-decoration: none;
}

.heti a:hover {
  padding-block-end: 1px;
  border-block-end: 1px solid currentColor;
  text-decoration: none;
}

.heti abbr[title] {
  padding-block-end: 1px;
  border-block-end: 1px dotted;
  text-decoration: none;
  cursor: help;
}

.heti b,
.heti strong {
  font-weight: bold;
  -webkit-font-smoothing: antialiased;
}

.heti code {
  margin-inline-start: 0.25em;
  margin-inline-end: 0.25em;
  font-size: 1em;
  font-family: var(--text-font);
}

.heti pre code {
  font-family: var(--code-text-font);
}

.heti dfn {
  font-weight: bold;
  -webkit-font-smoothing: antialiased;
}

.heti dfn:not(:lang(zh)):not(:lang(ja)):not(:lang(kr)),
.heti dfn:not(:lang(zh)) {
  font-weight: 400;
}

.heti em {
  font-weight: bold;
  -webkit-font-smoothing: antialiased;
}

.heti > p > small{
  display: inherit;
  margin-top: -1.2em;
}

.heti figcaption {
  display: inline-block;
  vertical-align: top;
  font-size: 14px;
  text-align: start;
}

.heti i {
  font-style: italic;
}

.heti ins,
.heti u {
  padding-block-end: 1px;
  border-block-end: 1px solid;
  text-decoration: none;
}

.heti mark {
  padding-block-start: 2px;
  padding-block-end: 2px;
  padding-inline-start: 1px;
  padding-inline-end: 1px;
  margin-inline-start: 1px;
  margin-inline-end: 1px;
  background-color: rgba(255, 247, 0, 0.88);
  color: inherit;
}


.heti q {
  quotes: '「' '」' '『' '』';
}

.heti q:not(:lang(zh)):not(:lang(ja)):not(:lang(kr)),
.heti q:not(:lang(zh)) {
  quotes: initial;
  quotes: auto;
}

.heti rt {
  font-size: 0.875em;
  font-weight: 400;
}

.heti small {
  font-size: 0.875em;
}

.heti strong {
  font-weight: bold;
  -webkit-font-smoothing: antialiased;
}

.heti sub,
.heti sup {
  position: relative;
  margin-inline-start: 0.25em;
  margin-inline-end: 0.25em;
  font-size: 0.75em;
  font-family: var(--text-font);
  font-style: normal;
  line-height: 1;
  vertical-align: baseline;
}

.heti sub {
  bottom: -0.25em;
}

.heti sup {
  top: -0.5em;
}

.heti sup:target,
.heti sup a:target {
  background-color: #dbedff;
}


.heti summary {
  padding-inline-start: 1em;
  outline: 0;
  cursor: pointer;
}

.heti summary::-webkit-details-marker {
  width: 0.6em;
  margin-inline-end: 0.4em;
}

.heti u[title] {
  cursor: help;
  border-block-end-width: 3px;
  border-block-end-style: double;
  border-block-end-color: rgba(0, 0, 0, 0.54);
}


.heti address,
.heti cite,
.heti dfn,
.heti dt,
.heti em {
  font-style: normal;
}

.heti address:not(:lang(zh)):not(:lang(ja)):not(:lang(kr)),
.heti address:not(:lang(zh)),
.heti cite:not(:lang(zh)):not(:lang(ja)):not(:lang(kr)),
.heti cite:not(:lang(zh)),
.heti dfn:not(:lang(zh)):not(:lang(ja)):not(:lang(kr)),
.heti dfn:not(:lang(zh)),
.heti dt:not(:lang(zh)):not(:lang(ja)):not(:lang(kr)),
.heti dt:not(:lang(zh)),
.heti em:not(:lang(zh)):not(:lang(ja)):not(:lang(kr)),
.heti em:not(:lang(zh)) {
  font-style: italic;
}

.heti abbr[title],
.heti del,
.heti ins,
.heti s,
.heti u {
  margin-inline-start: 1px;
  margin-inline-end: 1px;
}

/* Unified font family declarations */
.heti,
.heti--sans,
.heti--serif,
.heti--classic,
.heti--hei,
.heti--song,
.heti--ancient,
.heti--poetry {
  font-family: var(--text-font);
}

.heti--classic h1,
.heti--classic h2,
.heti--classic h3,
.heti--classic h4,
.heti--classic h5,
.heti--classic h6 {
  font-weight: 800;
}


.heti--columns-1,
.heti--columns-2,
.heti--columns-3,
.heti--columns-4,
.heti--columns-16em,
.heti--columns-20em,
.heti--columns-24em,
.heti--columns-28em,
.heti--columns-32em,
.heti--columns-36em,
.heti--columns-40em,
.heti--columns-44em,
.heti--columns-48em,
.heti comma {
  max-width: none;
  column-gap: 2em;
}

.heti--columns-1 p,
.heti--columns-2 p,
.heti--columns-3 p,
.heti--columns-4 p,
.heti--columns-16em p,
.heti--columns-20em p,
.heti--columns-24em p,
.heti--columns-28em p,
.heti--columns-32em p,
.heti--columns-36em p,
.heti--columns-40em p,
.heti--columns-44em p,
.heti--columns-48em p,
.heti comma p {
  margin-block-start: 0.4em;
  margin-block-end: 0.8em;
  text-indent: 2em;
}

.heti--columns-1 {
  column-count: 1;
}

.heti--columns-2 {
  column-count: 2;
}

.heti--columns-3 {
  column-count: 3;
}

.heti--columns-4 {
  column-count: 4;
}

.heti--columns-16em {
  column-width: 16em;
}

.heti--columns-20em {
  column-width: 20em;
}

.heti--columns-24em {
  column-width: 24em;
}

.heti--columns-28em {
  column-width: 28em;
}

.heti--columns-32em {
  column-width: 32em;
}

.heti--columns-36em {
  column-width: 36em;
}

.heti--columns-40em {
  column-width: 40em;
}

.heti--columns-44em {
  column-width: 44em;
}

.heti--columns-48em {
  column-width: 48em;
}

.heti--vertical {
  max-width: none;
  max-height: 42em;
  writing-mode: vertical-rl;
  letter-spacing: 0.125em;
}

::marker {
  letter-spacing: -1px !important;
}

.heti--vertical h1,
.heti--vertical h2,
.heti--vertical h3,
.heti--vertical h4,
.heti--vertical h5,
.heti--vertical h6 {
  text-align: start;
}

.heti--vertical q {
  quotes: '「' '」' '『' '』';
}

.heti--ancient h1,
.heti--ancient h2,
.heti--ancient h3,
.heti--ancient h4,
.heti--ancient h5,
.heti--ancient h6,
.heti--poetry h1,
.heti--poetry h2,
.heti--poetry h3,
.heti--poetry h4,
.heti--poetry h5,
.heti--poetry h6 {
  font-weight: 800;
  text-align: center;
}

.heti--ancient h1 .heti-meta,
.heti--ancient h2 .heti-meta,
.heti--ancient h3 .heti-meta,
.heti--ancient h4 .heti-meta,
.heti--ancient h5 .heti-meta,
.heti--ancient h6 .heti-meta,
.heti--poetry h1 .heti-meta,
.heti--poetry h2 .heti-meta,
.heti--poetry h3 .heti-meta,
.heti--poetry h4 .heti-meta,
.heti--poetry h5 .heti-meta,
.heti--poetry h6 .heti-meta {
  font-weight: 400;
}

@media screen and (min-width: 640px) {
  .heti--ancient h1 .heti-meta,
  .heti--ancient h2 .heti-meta,
  .heti--ancient h3 .heti-meta,
  .heti--ancient h4 .heti-meta,
  .heti--ancient h5 .heti-meta,
  .heti--ancient h6 .heti-meta,
  .heti--poetry h1 .heti-meta,
  .heti--poetry h2 .heti-meta,
  .heti--poetry h3 .heti-meta,
  .heti--poetry h4 .heti-meta,
  .heti--poetry h5 .heti-meta,
  .heti--poetry h6 .heti-meta {
    position: absolute;
    line-height: inherit;
    text-indent: 0;
    display: inline;
    margin-block-start: 4px;
    margin-inline-start: 8px;
  }
}

.heti--ancient .heti-meta,
.heti--poetry .heti-meta {
  line-height: 24px;
  text-align: center;
  text-indent: 0;
}

.heti--ancient p {
  text-indent: 2em;
}

.heti--poetry p {
  text-align: center;
  text-indent: 0;
}

.heti--annotation p {
  margin-block-start: 0;
  margin-block-end: 0;
  line-height: 2.25;
  text-indent: 2em;
}

.heti--annotation em {
  -webkit-text-emphasis: filled circle;
  -webkit-text-emphasis-position: under;
  font-weight: 400;
}

.heti--annotation em:not(:lang(zh)):not(:lang(ja)):not(:lang(kr)),
.heti--annotation em:not(:lang(zh)) {
  -webkit-text-emphasis: none;
}

.heti--annotation .heti-meta {
  margin-block-start: 0.8em;
  margin-block-end: 1.6em;
}

.heti .heti-meta {
  display: block;
  text-indent: 0;
}

.heti .heti-verse {
  text-align: center;
  text-indent: 0;
}

.heti .heti-large {
  font-size: 18px;
  line-height: 24px;
}

.heti .heti-x-large {
  font-size: 20px;
  line-height: 30px;
  letter-spacing: 0.05em;
}

.heti .heti-small {
  font-size: 14px;
  line-height: 24px;
}

.heti .heti-x-small {
  font-size: 12px;
  line-height: 18px;
}

.heti .heti-list-latin {
  list-style-type: upper-latin;
}

.heti .heti-list-latin ol {
  list-style-type: lower-roman;
}

.heti .heti-list-latin ol ol {
  list-style-type: lower-latin;
}

.heti .heti-list-han {
  list-style-type: cjk-ideographic;
}

.heti .heti-list-han ol {
  list-style-type: decimal;
}

.heti .heti-list-han ol ol {
  list-style-type: decimal-leading-zero;
}

.heti .heti-fn {
  margin-block-start: 59px;
  border-block-start: 1px solid;
  border-block-start-color: #e6e6e6;
  font-size: 14px;
  font-family: var(--text-font);
  line-height: 24px;
}


.heti .heti-fn ol {
  margin-block-start: 0.8em;
  margin-block-end: 0;
}

.heti .heti-fn li:target {
  background-color: #dbedff;
}


.heti .heti-hang {
  position: absolute;
  line-height: inherit;
  text-indent: 0;
}

.heti .heti-em {
  -webkit-text-emphasis: filled circle;
  -webkit-text-emphasis-position: under;
}

.heti .heti-em:not(:lang(zh)):not(:lang(ja)):not(:lang(kr)),
.heti .heti-em:not(:lang(zh)) {
  -webkit-text-emphasis: none;
}

.heti .heti-ruby--inline {
  display: inline-flex;
  flex-direction: column-reverse;
  height: 1.5em;
}

.heti .heti-ruby--inline rt {
  display: inline;
  margin-bottom: -0.25em;
  line-height: 1;
  text-align: center;
}

.heti heti-spacing {
  display: inline;
}

.heti heti-spacing + sup,
.heti heti-spacing + sub {
  margin-inline-start: 0;
}

.heti .heti-spacing-start {
  margin-inline-end: 0.25em;
}

.heti .heti-spacing-end {
  margin-inline-start: 0.25em;
}

.heti heti-adjacent {
  display: inline;
}

.heti .heti-adjacent-half {
  margin-inline-end: -0.5em;
}

.heti .heti-adjacent-quarter {
  margin-inline-end: -0.25em;
}

.heti ul.cb {
  list-style-type: none;
  padding-inline-start: 12px;
}

.heti ul.cb ul.cb {
  padding-inline-start: 24px;
}

.heti ul.cb input[type='checkbox'] {
  position: relative;
  font-size: 1rem;
  width: 1rem;
  height: 1rem;
  top: 0.1rem;
  cursor: pointer;
}

.heti ul.cb input[type='checkbox']::before {
  content: '';
  position: absolute;
  top: -6px;
  bottom: -6px;
  left: -6px;
  right: -6px;
}

.hljs {
  background: #f8f8f8;
  color: #000;
}

.hljs-comment,
.hljs-quote,
.hljs-variable {
  color: #035c21;
}

.hljs-built_in,
.hljs-keyword,
.hljs-name,
.hljs-selector-tag,
.hljs-tag {
  color: #0a69d9;
}

.hljs-addition,
.hljs-attribute,
.hljs-literal,
.hljs-section,
.hljs-string,
.hljs-template-tag,
.hljs-template-variable,
.hljs-title,
.hljs-type {
  color: #bf3889;
}

.hljs-deletion,
.hljs-meta,
.hljs-selector-attr,
.hljs-selector-pseudo {
  color: #208bff;
}

.hljs-doctag {
  color: #6e7781;
}

.hljs-attr {
  color: #cf212e;
}

.hljs-bullet,
.hljs-link,
.hljs-symbol {
  color: #8250df;
}

.hljs-emphasis {
  font-style: italic;
}

.hljs-strong {
  font-weight: bold;
  -webkit-font-smoothing: antialiased;
}

code.language-mermaid {
  display: block;
  text-align: center;
}

code.language-mermaid .edgeLabel{
  display: inline-block;
}

.heti pre.plantuml-image-container {
  padding: 0;
  background: transparent;
  border-radius: 0;
}

.heti pre.plantuml-image-container .plantuml-image {
  border-radius: 8px;
}

.heti pre.mermaid-image-container {
  padding: 0;
  background: #f7f7f7;
}

.heti pre.markmap-image-container {
  padding: 0;
}

mjx-container[display='block'] {
  display: block;
  margin: 1em 0;
}

span.emoji {
  display: -moz-inline-box;
  -moz-box-orient: vertical;
  display: inline-block;
  vertical-align: baseline;
  *vertical-align: auto;
  *zoom: 1;
  *display: inline;
  width: 1em;
  height: 1em;
  background-size: 1em;
  background-repeat: no-repeat;
  text-indent: -9999px;
  background-position: 50%, 50%;
  background-size: contain;
}

span.emoji-sizer {
  line-height: 0.81em;
  font-size: 1em;
  margin: -2px 0;
}

span.emoji-outer {
  display: -moz-inline-box;
  display: inline-block;
  *display: inline;
  height: 1em;
  width: 1em;
}

span.emoji-inner {
  display: -moz-inline-box;
  display: inline-block;
  text-indent: -9999px;
  width: 100%;
  height: 100%;
  vertical-align: baseline;
  *vertical-align: auto;
  *zoom: 1;
}

img.emoji {
  width: 1em;
  height: 1em;
}

.language-markmap {
  visibility: hidden;
}

.markmap {
  visibility: visible;
  width: 100%;
  height: var(--markmap-height);
}

.markmap svg {
  background: transparent;
}


img[loading="lazy"] {
  background-color: #eef1f2;
  outline-color: #eef1f2;
}


#write>img, #write>p>img, #write>table>img {
  cursor: zoom-in;
}

img.border {
  border-width: 36px;
  border-style: solid;
  border-image-source: url(https://gw.alipayobjects.com/zos/k/y1/lpOIMY.png);
  border-image-slice: 30;
  border-image-repeat: stretch;
  border-radius: 8px;
  clip-path: inset(0 round 6px);
}


.markdown-body img,
.markdown-body video {
  border-radius: 8px;
}

/* Simple chart container styles - match code background */
.mermaid-image-container,
.markmap-image-container,
.plantuml-image-container,
pre:has(.language-mermaid) {
  background: #f7f7f7;
  border: none;
  border-radius: 6px;
  padding: 12px;
  margin: 8px 0;
  box-shadow: none;
}

/* Consolidated dark mode styles */
@media (prefers-color-scheme: dark) {
  .html {
    color: #ede6f5;
  }

  .heti hr {
    background-color: #343b43;
  }

  .heti blockquote {
    border-left: 4px solid #343b43;
  }

  .heti pre {
    background-color: rgba(255, 255, 255, 0.03);
  }

  .heti table,
  .heti th,
  .heti td {
    border-color: #343b43;
  }

  .heti p > code,
  .heti li > code {
    background-color: #343941;
    color: #e8e8eb;
  }

  .heti mark {
    background-color: rgba(77, 74, 0, 0.88);
  }

  .heti sup:target,
  .heti sup a:target,
  .heti .heti-fn li:target {
    background-color: #3a6188;
  }

  .heti u[title] {
    border-block-end-color: rgba(255, 255, 255, 0.54);
  }

  .heti .heti-fn {
    border-block-start-color: #343b43;
  }

  img[loading="lazy"] {
    background-color: #343941;
    outline-color: #343941;
  }

  .mermaid-image-container,
  .markmap-image-container,
  .plantuml-image-container,
  pre:has(.language-mermaid) {
    background: #282e33;
  }
}

/* Chart elements with rounded corners and left alignment */
.language-mermaid,
.language-markmap,
.language-plantuml {
  border-radius: 6px;
  overflow: hidden;
}

.language-mermaid svg,
.markmap svg,
.plantuml-image {
  border-radius: 6px;
}

/* Unified font for all diagram types */
.mermaid,
.mermaid *,
.markmap,
.markmap *,
.markmap .markmap-node text,
.language-mermaid,
.language-mermaid *,
.language-markmap,
.language-markmap *,
.plantuml-image,
.language-plantuml,
.mermaid text,
.mermaid tspan,
.mermaid foreignObject div,
.mermaid .nodeLabel,
.mermaid .edgeLabel,
.mermaid .label {
  font-family: var(--text-font), -apple-system, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB, Microsoft YaHei UI, Microsoft YaHei, Arial, sans-serif;
}
