/* Reading styles injected into every converted library page (old Word-exported HTML). */
:root {
  --bdn-ink: #2a2230;
  --bdn-paper: #f7f6f1;
  --bdn-bar: #edefea;
  --bdn-rule: #c7ccc1;
  --bdn-link: #4a2d4d;
  --bdn-song: "Songti SC", "Source Han Serif SC", "Noto Serif CJK SC", "Noto Serif SC", "SimSun", "STSong", serif;
  --bdn-ui: -apple-system, "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", "Hiragino Sans GB", system-ui, sans-serif;
}
html { -webkit-text-size-adjust: 100%; color-scheme: light; }
body {
  margin: 0 !important;
  padding: 0 0 4rem !important;
  background: var(--bdn-paper) !important;
  color: var(--bdn-ink);
  line-height: 1.9;
}
/* the old pages hard-code fonts (MingLiU etc.) that most devices don't have */
body, body *:not([style*="Symbol"]):not([style*="Wingdings"]):not([style*="Webdings"]) {
  font-family: var(--bdn-song) !important;
}
body > *:not(.bdn-bar) {
  max-width: 46rem;
  margin-left: auto !important;
  margin-right: auto !important;
  padding-left: 1.1rem;
  padding-right: 1.1rem;
}
@media (min-width: 40rem) { body > *:not(.bdn-bar) { zoom: 1.12; } }
p { line-height: 1.95 !important; }
img, table { max-width: 100%; height: auto; }
a, a * { color: var(--bdn-link) !important; }
a:hover, a:hover * { text-decoration: underline; }

.bdn-bar {
  position: sticky; top: 0; z-index: 20;
  margin: 0 0 1.2rem !important;
  padding: .6rem max(1.1rem, calc((100vw - 46rem) / 2));
  background: var(--bdn-bar);
  border-bottom: 1px solid var(--bdn-rule);
  font: .92rem/1.5 var(--bdn-ui) !important;
}
.bdn-bar, .bdn-bar * { font-family: var(--bdn-ui) !important; }
@media (min-width: 40rem) {
  /* body text is zoomed 1.12, so the bar's inset has to match 46rem * 1.12 */
  .bdn-bar { padding-left: max(1.1rem, calc((100vw - 51.52rem) / 2)); padding-right: max(1.1rem, calc((100vw - 51.52rem) / 2)); }
}
.bdn-bar a { text-decoration: none; }
.bdn-bar span { margin: 0 .55rem; color: #8a8490 !important; }
