:root{
  --fg:#1a1a1a; --bg:#fbfbf9; --muted:#5c5c5c; --rule:#d8d4cc;
  --accent:#7a1f1f; --box:#f3f0e9; --boxrule:#cdbf9e;
}
*{box-sizing:border-box}
html{font-size:18px}
body{
  margin:0; background:var(--bg); color:var(--fg);
  font-family:"Songti SC","STSong","Source Han Serif SC","Noto Serif CJK SC",Georgia,"Times New Roman",serif;
  line-height:1.85; text-rendering:optimizeLegibility;
}
article{max-width:820px; margin:0 auto; padding:4rem 1.5rem 8rem}
header.chap{border-bottom:2px solid var(--accent); margin-bottom:2.2rem; padding-bottom:1rem}
header.chap .kicker{color:var(--accent); font-size:.85rem; letter-spacing:.18em; text-transform:uppercase}
h1{font-size:1.9rem; line-height:1.3; margin:.4rem 0 .2rem; font-weight:700}
h1 .en{display:block; font-size:1rem; color:var(--muted); font-weight:400; font-style:italic; margin-top:.4rem}
h2{font-size:1.35rem; margin:2.6rem 0 1rem; padding-top:.4rem; border-top:1px solid var(--rule)}
h3{font-size:1.12rem; margin:1.8rem 0 .6rem}
p{margin:1rem 0; text-align:justify}
a{color:var(--accent)}
.muted{color:var(--muted)}
em,i{font-style:italic}
/* numbered display equations get a little breathing room */
mjx-container[display="true"]{margin:1.2rem 0 !important}
/* theorem-like boxes */
.thm,.lem,.cor,.def,.prop,.remark{
  background:var(--box); border:1px solid var(--boxrule); border-left:4px solid var(--accent);
  border-radius:4px; padding:.9rem 1.2rem; margin:1.4rem 0;
}
.thm .tag,.lem .tag,.cor .tag,.def .tag,.prop .tag,.remark .tag{
  font-weight:700; color:var(--accent); margin-right:.5em;
}
.thm,.lem,.cor,.prop{font-style:normal}
.proof{margin:1.1rem 0 1.6rem; padding-left:1rem; border-left:2px solid var(--rule)}
.proof .qed{float:right}
.proof .ptag{font-style:italic; color:var(--muted); margin-right:.4em}
figure{margin:1.8rem 0; text-align:center}
figure svg{max-width:100%; height:auto}
figcaption{color:var(--muted); font-size:.9rem; margin-top:.6rem}
.fn{font-size:.9rem; color:var(--muted)}
.footnotes{margin-top:3rem; border-top:1px solid var(--rule); padding-top:1rem; font-size:.92rem}
.footnotes ol{padding-left:1.4rem}
hr{border:none; border-top:1px solid var(--rule); margin:2rem 0}
.refs{font-size:.96rem}
.refs p{margin:.55rem 0; padding-left:2em; text-indent:-2em}
table{border-collapse:collapse; margin:1.4rem auto; font-size:.96rem}
th,td{border:1px solid var(--rule); padding:.4rem .8rem; text-align:center}
.note-zh{color:var(--muted); font-size:.92rem}
