/* Academic article and sidebar typography. */
.l_body[type="tech"] article.md-text.content {
  font-family: "Latin Modern Roman", "STIX Two Text", "Times New Roman",
    "Songti SC", "Noto Serif CJK SC", "Source Han Serif SC", SimSun, serif;
  font-size: 18px;
  line-height: 1.72;
  letter-spacing: 0;
  max-width: 880px;
  margin-inline: auto;
  padding: 22px 26px 40px;
  color: var(--text);
  text-rendering: optimizeLegibility;
}
.l_body[type="tech"] article.content p {
  font-size: inherit;
  line-height: inherit;
  margin: .5em 0;
  text-align: justify;
  overflow-wrap: break-word;
}
.l_body[type="tech"] article.content :is(h1,h2,h3,h4) {
  font-family: inherit;
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: 0;
  border: 0;
  padding: 0;
  margin: 1.4em 0 .55em;
}
.l_body[type="tech"] article.content h2 { font-size: 1.35em; }
.l_body[type="tech"] article.content h3 { font-size: 1.13em; }
.l_body[type="tech"] article.content :is(h2,h3,h4) > a:first-child {
  background: transparent;
  padding: 0;
  margin: 0;
}
.l_body[type="tech"] article.content :is(h2,h3,h4) > a:first-child::before,
.l_body[type="tech"] article.content :is(h2,h3,h4) > a:first-child::after { content: none; }
.l_body[type="tech"] article.content .mathjax-display {
  margin: .65em 0;
  padding: .1em 0;
  overflow-x: auto;
  overflow-y: hidden;
  text-align: center;
}
.l_body[type="tech"] article.content table {
  font-size: .9em;
  line-height: 1.6;
  border-collapse: collapse;
  border-top: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  margin: 1em auto;
}
.l_body[type="tech"] article.content :is(th,td) {
  border: 0;
  padding: .45em .7em;
  background: transparent;
}
.l_body[type="tech"] article.content thead { border-bottom: 1px solid currentColor; }
.l_body[type="tech"] article.content tr { background: transparent; border: 0; }
.l_body[type="tech"] article.content pre,
.l_body[type="tech"] article.content code,
.l_body[type="tech"] article.content .highlight {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 14px;
  line-height: 1.65;
  letter-spacing: 0;
  text-align: left;
}
.l_body[type="tech"] article.content .highlight table { border: 0; margin: 0; }
.l_body[type="tech"] article.content li { margin: .25em 0; line-height: 1.72; }
.l_body[type="tech"] .article.banner .title {
  font-family: "Times New Roman", "Songti SC", "Noto Serif CJK SC", serif;
  font-weight: 700;
  font-size: 31px;
  line-height: 1.5;
}

/* MathJax supplies its own display margins; avoid stacking both spacings. */
.l_body[type="tech"] article.content .mathjax-display mjx-container[display="true"] {
  margin: 0 !important;
}
.l_body[type="tech"] article.content .mathjax-display .MathJax_Display {
  margin: 0 !important;
}
.l_body[type="tech"] :is(.l_left, .l_right) {
  font-family: "Times New Roman", "Songti SC", "Noto Serif CJK SC", SimSun, serif;
  line-height: 1.55;
  --theme: #56695f;
  --accent: #3d5649;
}
.l_body[type="tech"] :is(.l_left, .l_right) :is(.title, .name, .cap, input, .toc-link) {
  font-family: inherit;
  letter-spacing: 0;
}
.l_body[type="tech"] :is(.l_left, .l_right) .widget-header {
  border-bottom: 1px solid var(--block-border);
  padding-bottom: .4rem;
  margin-bottom: .4rem;
  font-size: 15px;
  font-weight: 700;
}
.l_body[type="tech"] :is(.l_left, .l_right) .widget-wrapper {
  background: transparent;
  box-shadow: none;
  border-radius: 0;
}
.l_body[type="tech"] .l_left .sidebg { background: var(--site-bg); }
.l_body[type="tech"] .l_left .logo-wrap .main { font-size: 25px; font-weight: 700; }
.l_body[type="tech"] .l_left .logo-wrap .sub { font-size: 13px; }
.l_body[type="tech"] .l_left .nav-item {
  color: var(--text-p2) !important;
  border-radius: 3px;
}
.l_body[type="tech"] .l_left .nav-item.active {
  color: var(--theme) !important;
  background: var(--block);
  box-shadow: inset 0 -2px var(--theme);
}
.l_body[type="tech"] .l_left .search-form {
  border: 1px solid var(--block-border);
  border-radius: 3px;
  background: transparent;
}
.l_body[type="tech"] .l_left .widget-body .item {
  font-size: 14px;
  line-height: 1.55;
  padding-top: .35rem;
  padding-bottom: .35rem;
  border-radius: 0;
}
.l_body[type="tech"] .l_right .toc-link {
  font-size: 14px;
  line-height: 1.5;
  padding: .3rem .65rem;
  border-radius: 0;
  border-left: 1px solid var(--block-border);
  color: var(--text-p2);
}
.l_body[type="tech"] .l_right .toc-link:is(.active, :hover) {
  color: var(--text);
  border-left: 2px solid var(--theme);
  background: var(--block);
}
.l_body[type="tech"] .l_right .toc-child { margin-left: .65rem; }

@media (max-width: 640px) {
  .l_body[type="tech"] article.md-text.content { font-size: 17px; padding: 22px 18px 36px; }
  .l_body[type="tech"] article.content p { text-align: left; }
  .l_body[type="tech"] .article.banner .title { font-size: 25px; }
}
@media print {
  .l_left, .l_right, #comments, .article-footer, .read-next, .related-wrap { display: none !important; }
  .l_body, .l_main { display: block !important; width: auto !important; margin: 0 !important; }
  .l_body[type="tech"] article.md-text.content { max-width: none; padding: 0; color: #000; font-size: 11pt; line-height: 1.65; }
  .mathjax-display, table, figure, img { break-inside: avoid; }
  h2, h3, h4 { break-after: avoid; }
  @page { size: A4; margin: 22mm; }
}

.academic-nav-toggle { display: none; }
@media screen and (min-width: 1181px) {
  .l_body[type="tech"].academic-ready {
    grid-template-columns: minmax(0, 900px) 250px;
    gap: 32px;
    max-width: 1182px;
    padding: 0 32px 0 60px;
    box-sizing: content-box;
    justify-content: center;
  }
  .l_body[type="tech"].academic-ready .l_main { width: 100%; max-width: none; min-width: 0; grid-column: 1; }
  .l_body[type="tech"].academic-ready .l_right { grid-column: 2; width: 250px; }
  .l_body[type="tech"].academic-ready .l_left {
    position: fixed;
    width: 288px;
    left: 0;
    top: 0;
    height: 100dvh;
    max-height: 100dvh;
    margin: 0;
    transform: translateX(-100%);
    visibility: hidden;
    transition: transform .18s ease, visibility .18s;
    z-index: 30;
    background: var(--background, #fafaf8);
    border-right: 1px solid var(--block-border);
    box-shadow: 4px 0 18px #00000010;
  }
  .l_body[type="tech"].academic-ready .l_left .leftbar-container { height: 100%; overflow-y: auto; padding-top: 48px; box-sizing: border-box; }
  .l_body[type="tech"].academic-ready.academic-nav-open .l_left { transform: translateX(0); visibility: visible; }
  .l_body[type="tech"].academic-ready .academic-nav-toggle {
    display: block;
    position: fixed;
    top: 22px;
    left: 8px;
    z-index: 31;
    padding: 8px 10px;
    border: 1px solid var(--block-border);
    border-radius: 3px;
    font: 14px "Songti SC", serif;
    color: var(--text-p2);
    background: var(--background, #fafaf8);
    cursor: pointer;
  }
  .academic-nav-toggle:focus-visible { outline: 2px solid #56695f; outline-offset: 3px; }
}
@media (prefers-reduced-motion: reduce) {
  .l_body[type="tech"].academic-ready .l_left { transition: none; }
}
@media print { .academic-nav-toggle { display: none !important; } }
