/* zesen.me — layout modelled on jiaxuanli.me (classic academic header bar, research write-ups with captioned figures). */

:root {
  --brand: #005587;        /* UCLA darker blue: header bar, h2 */
  --brand-deep: #003b5c;
  --gold: #ffb81c;         /* UCLA darker gold: header rule, current nav item */
  --h3: #1f5fae;
  --h4: #007081;
  --ink: #161616;
  --ink-soft: #4a4a4a;
  --muted: #6b6b6b;
  --link: #0a67b0;
  --rule: #e6e6e6;
  --paper: #fdfdfd;
  --card: #ffffff;
  --cap: #f7f7f5;
  --sans: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --nav: "Avenir Next", "Avenir", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --serif: Palatino, "Palatino Linotype", "Book Antiqua", Georgia, serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 1rem; }
body, h1, h2, h3, h4, h5, h6, p, blockquote, pre, dl, dd, ol, ul, figure { margin: 0; padding: 0; }
body {
  font-family: var(--sans);
  font-size: 1.06rem;
  line-height: 1.62;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; vertical-align: middle; }
a { color: var(--link); text-decoration: none; }
a:hover { color: var(--ink); text-decoration: underline; }
a:focus-visible, summary:focus-visible, .menu-icon:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 2px; }
p, ul, ol, dl, figure, blockquote { margin-bottom: 15px; }
ul, ol { margin-left: 1.6rem; }
code { font-family: var(--mono); font-size: 0.88em; background: #f3f3f1; padding: 1px 5px; border-radius: 3px; }
sub, sup { font-size: 0.72em; line-height: 0; }
.skip-link { position: absolute; left: 1rem; top: -3rem; background: var(--brand-deep); color: #fff; padding: .5rem 1rem; z-index: 50; }
.skip-link:focus { top: 0; color: #fff; }

.wrapper { max-width: 990px; margin: 0 auto; padding: 0 30px; }
.wrapper::after { content: ""; display: table; clear: both; }

/* ---------- header bar ---------- */
.site-header {
  background: var(--brand);
  border-bottom: 4px solid var(--gold);
  min-height: 60px;
  position: relative;
  z-index: 20;
}
.site-header .wrapper { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 60px; }
.site-title {
  font-family: var(--serif);
  font-size: 25px;
  color: #fff;
  letter-spacing: 0;
  white-space: nowrap;
  padding: 10px 0;
}
.site-title:hover, .site-title:visited { color: #fff; text-decoration: none; }
.site-title .zh { font-size: 0.82em; opacity: .9; margin-left: .25em; }

.site-nav .menu {
  list-style: none; margin: 0; padding: 0;
  display: flex; gap: 15px; align-items: center;
  font-family: var(--nav); font-weight: 600; font-size: 14px;
  letter-spacing: .5px; text-transform: uppercase;
}
.site-nav .menu > li { position: relative; border-bottom: 3px solid transparent; padding: 2px 0; }
.site-nav .menu > li.current { border-bottom-color: var(--gold); }
.site-nav .menu > li > a { color: #fff; display: block; line-height: 1.6; }
.site-nav .menu > li > a:hover { text-decoration: none; color: #ffe7a8; }
.sub-menu {
  display: none; position: absolute; right: -12px; top: 100%;
  list-style: none; margin: 0; padding: 6px 0;
  min-width: 250px; background: #fff;
  border: 3px solid var(--brand); border-top: 0;
  box-shadow: 0 3px 8px rgba(0,0,0,.25);
  text-transform: none; letter-spacing: 0; font-weight: 500; font-size: 15px;
}
.sub-menu li { margin: 0; }
.sub-menu a { display: block; padding: 5px 14px; color: var(--brand); }
.sub-menu a:hover { background: #f2f6f9; text-decoration: none; color: var(--brand-deep); }
.site-nav .menu > li:hover > .sub-menu, .site-nav .menu > li:focus-within > .sub-menu { display: block; }

.nav-toggle { position: absolute; opacity: 0; pointer-events: none; }
.menu-icon { display: none; cursor: pointer; padding: 8px; border-radius: 4px; }
.menu-icon svg { width: 20px; height: 17px; display: block; }
.menu-icon path { fill: #fff; }

@media (max-width: 720px) {
  .wrapper { padding: 0 16px; }
  .site-title { font-size: 22px; }
}
/* below this the tabs no longer fit on one row beside the name; screen only, so print layout is unchanged */
@media screen and (max-width: 900px) {
  .site-nav { margin-left: auto; }
  .menu-icon { display: block; }
  .site-nav .menu {
    display: none; position: absolute; right: 16px; top: 58px;
    flex-direction: column; align-items: stretch; gap: 0;
    background: #fff; min-width: 230px; padding: 6px 0;
    border: 1px solid var(--rule); border-radius: 6px;
    box-shadow: 0 6px 18px rgba(0,0,0,.18);
  }
  .nav-toggle:checked ~ .menu { display: flex; }
  .site-nav .menu > li { border-bottom: 0; padding: 0; }
  .site-nav .menu > li > a { color: var(--brand); padding: 6px 16px; }
  .site-nav .menu > li.current > a { box-shadow: inset 3px 0 0 var(--gold); }
  .sub-menu { display: block; position: static; border: 0; box-shadow: none; min-width: 0; padding: 0 0 4px 12px; font-size: 14px; }
  .sub-menu a { padding: 3px 16px; color: var(--ink-soft); }
}

/* ---------- page ---------- */
.page-content { padding: 34px 0 30px; }
.post-header { margin-bottom: 24px; }
.post-title { font-weight: 300; font-size: 40px; line-height: 1.2; letter-spacing: -0.01em; }
.post-title .zh { font-size: .7em; color: var(--muted); margin-left: .3em; font-weight: 300; }
.lede { color: var(--ink-soft); font-size: 1.04rem; }

.post-content h2 {
  font-family: Georgia, "Times New Roman", serif;
  color: var(--brand); font-weight: 500; font-size: 30px; line-height: 1.25;
  margin: 46px 0 16px; padding-top: 18px; border-top: 1px solid var(--rule);
  clear: both;
}
.post-content h2:first-child { margin-top: 0; border-top: 0; padding-top: 0; }
.post-content h3 {
  font-weight: 500; font-size: 25px; line-height: 1.3; color: var(--h3);
  margin: 40px 0 14px; clear: both;
}
.post-content h3 .tag, .post-content h4 .tag {
  font-family: var(--nav); font-size: 11.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  color: var(--brand-deep); background: #fff3d1; border: 1px solid #f2d27c;
  padding: 2px 7px; border-radius: 3px; vertical-align: 4px; margin-left: 8px; white-space: nowrap;
}
.post-content h4 { font-family: var(--serif); color: var(--h4); font-size: 21px; font-weight: 600; margin: 26px 0 10px; }
.post-content h4.links { font-family: var(--sans); font-size: 17px; font-weight: 500; margin: 0 0 22px; }
.post-content h3 + .kicker { margin-top: -8px; }
.kicker { font-family: var(--nav); font-size: 12.5px; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); margin-bottom: 14px; }
.post-content strong { font-weight: 600; }
.spacer { clear: both; height: 6px; }

.linkrow { font-family: var(--nav); font-size: 14px; font-weight: 600; letter-spacing: .02em; display: flex; flex-wrap: wrap; gap: 6px 16px; margin: -2px 0 18px; }
.linkrow a::before { content: "→ "; color: var(--gold); }

.toc { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 30px; padding: 0; list-style: none; }
.toc li { margin: 0; }
.toc a { display: inline-block; font-family: var(--nav); font-size: 13.5px; font-weight: 600; letter-spacing: .03em; padding: 5px 12px; border: 1px solid #cfdbe5; border-radius: 999px; color: var(--brand); background: #fff; }
.toc a:hover { background: var(--brand); color: #fff; border-color: var(--brand); text-decoration: none; }

/* ---------- captioned figures (wp-caption style) ---------- */
.wp-caption {
  background: var(--card); text-align: center; border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0,0,0,.10), 0 0 0 1px rgba(0,0,0,.03);
  overflow: hidden; margin-bottom: 20px;
}
.wp-caption dt { margin: 0; }
.wp-caption img, .wp-caption svg { display: block; width: 100%; height: auto; margin: 0; }
.wp-caption dd {
  color: #555; background: var(--cap); font-size: .86rem; line-height: 1.45;
  padding: 10px 15px; margin: 0; text-align: left;
}
.aligncenter { display: block; margin-left: auto; margin-right: auto; }
.alignright { float: right; margin: 4px 0 15px 24px; }
.alignleft { float: left; margin: 4px 24px 15px 0; }
.fig-pad { padding: 14px 14px 6px; background: #fff; }
@media (max-width: 720px) {
  .alignright, .alignleft { float: none; width: auto !important; max-width: 280px; margin: 0 auto 18px; }
  .post-title { font-size: 32px; }
  .post-content h2 { font-size: 25px; }
  .post-content h3 { font-size: 21px; }
}
a.lightbox-trigger { display: block; cursor: zoom-in; }

#lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.86); display: flex; flex-direction: column; justify-content: center; align-items: center; z-index: 100; padding: 24px; opacity: 0; visibility: hidden; transition: opacity .2s ease, visibility .2s ease; }
#lightbox.active { opacity: 1; visibility: visible; }
#lightbox img { max-width: 100%; max-height: 80vh; background: #fff; border: 2px solid #fff; box-shadow: 0 0 20px rgba(0,0,0,.5); }
#lightbox p { color: #eee; max-width: 900px; margin-top: 14px; font-size: .92rem; text-align: center; }
#lightbox button { position: absolute; top: 14px; right: 20px; font-size: 32px; line-height: 1; color: #fff; background: none; border: 0; cursor: pointer; }
@media (prefers-reduced-motion: reduce) { #lightbox { transition: none; } }

/* ---------- about page ---------- */
.about-grid { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 40px; align-items: start; }
.about-side { border-left: 1px solid var(--rule); padding-left: 26px; font-size: .95rem; }
.about-side h4 { font-family: var(--nav); font-size: 12.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 0 0 8px; font-weight: 600; }
.about-side ul { list-style: none; margin: 0 0 22px; }
.about-side li { margin-bottom: 4px; }
.about-side .award { font-family: var(--serif); color: var(--brand-deep); }
@media (max-width: 820px) { .about-grid { grid-template-columns: 1fr; gap: 10px; } .about-side { border-left: 0; padding-left: 0; border-top: 1px solid var(--rule); padding-top: 20px; } }

.focus-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin: 4px 0 26px; }
.focus-card { display: block; background: var(--card); border-radius: 8px; overflow: hidden; box-shadow: 0 4px 6px rgba(0,0,0,.10), 0 0 0 1px rgba(0,0,0,.03); color: var(--ink); transition: transform .15s ease, box-shadow .15s ease; }
.focus-card:hover { text-decoration: none; color: var(--ink); transform: translateY(-2px); box-shadow: 0 8px 16px rgba(0,0,0,.12), 0 0 0 1px rgba(0,0,0,.04); }
.focus-card .thumb { aspect-ratio: 16 / 9; background: #fff; display: flex; align-items: center; justify-content: center; overflow: hidden; border-bottom: 1px solid var(--rule); }
.focus-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.focus-card .thumb img.contain { object-fit: contain; padding: 6px; }
.focus-card .thumb svg { width: 100%; height: 100%; }
.focus-card .body { padding: 12px 15px 14px; }
.focus-card h3 { font-size: 18px !important; margin: 0 0 4px !important; color: var(--h3); font-weight: 600 !important; }
.focus-card p { font-size: .9rem; color: var(--ink-soft); margin: 0; line-height: 1.45; }
@media (prefers-reduced-motion: reduce) { .focus-card { transition: none; } .focus-card:hover { transform: none; } }
@media (max-width: 560px) { .focus-grid { grid-template-columns: 1fr; } }

.news { list-style: none; margin: 0 0 20px; }
.news li { display: grid; grid-template-columns: 6.2rem minmax(0, 1fr); gap: 12px; padding: 7px 0; border-bottom: 1px dashed #e3e3e3; font-size: .97rem; }
.news li:last-child { border-bottom: 0; }
.news time { font-family: var(--mono); font-size: .82rem; color: var(--muted); padding-top: 2px; }

/* ---------- lists: publications, software ---------- */
.pubs { list-style: none; margin: 0 0 10px; counter-reset: pub; }
.pubs li { position: relative; padding: 9px 0 9px 3.1rem; border-bottom: 1px solid #f0f0f0; }
.pubs li::before { counter-increment: pub; content: counter(pub); position: absolute; left: 0; top: 10px; width: 2.3rem; text-align: right; font-family: var(--mono); font-size: .8rem; color: #9a9a9a; }
.pubs .ti { font-weight: 600; color: var(--ink); }
.pubs .au { color: var(--ink-soft); font-size: .95rem; }
.pubs .au b { color: var(--ink); font-weight: 600; }
.pubs .ve { font-size: .93rem; color: var(--muted); }
.pubs .ve em { color: var(--ink-soft); }
.pubs .yr { font-family: var(--mono); font-size: .8rem; color: var(--brand); margin-right: 6px; }

.sw { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 20px; padding: 20px 0; border-bottom: 1px solid var(--rule); }
.sw:last-of-type, .sw:has(+ h2) { border-bottom: 0; }
.sw .sw-thumb { border-radius: 6px; overflow: hidden; box-shadow: 0 2px 5px rgba(0,0,0,.12); background: #fff; aspect-ratio: 4 / 3; display: flex; align-items: center; justify-content: center; }
.sw .sw-thumb img { width: 100%; height: 100%; object-fit: cover; }
.sw .sw-thumb .glyph { font-family: var(--serif); font-size: 44px; color: var(--brand); }
.sw h3 { margin: 0 0 2px !important; font-size: 21px !important; }
.sw .role { font-family: var(--nav); font-size: 12.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.sw p { margin-bottom: 8px; }
@media (max-width: 620px) { .sw { grid-template-columns: 1fr; } .sw .sw-thumb { max-width: 260px; } }

.misc-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
@media (max-width: 620px) { .misc-grid { grid-template-columns: 1fr; } }
.misc-card { display: block; padding: 16px 18px; border: 1px solid var(--rule); border-top: 3px solid var(--brand); border-radius: 6px; background: #fff; color: var(--ink); }
.misc-card:hover { text-decoration: none; border-top-color: var(--gold); color: var(--ink); }
.misc-card .k { font-family: var(--nav); font-size: 12px; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
.misc-card h3 { margin: 4px 0 6px !important; font-size: 19px !important; }
.misc-card p { font-size: .93rem; color: var(--ink-soft); margin: 0; }

.support { font-size: .95rem; color: var(--ink-soft); }
.support li { margin-bottom: 4px; }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--rule); padding: 24px 0 34px; font-size: .88rem; color: var(--muted); }
.site-footer .wrapper { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; }
.site-footer a { color: var(--muted); text-decoration: underline; text-decoration-color: #ccc; text-underline-offset: 3px; }
.site-footer a:hover { color: var(--ink); }

@media print {
  .site-header { background: none; border-bottom: 2px solid #000; }
  .site-title, .site-nav .menu > li > a { color: #000; }
  .wp-caption, .focus-card { box-shadow: none; border: 1px solid #ddd; }
}
.wp-caption video { display: block; width: 100%; height: auto; background: #fff; }

/* ---------- breadcrumbs, topic overview ---------- */
.crumbs { font-family: var(--nav); font-size: 13px; letter-spacing: .04em; color: var(--muted); margin-bottom: 6px; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--brand); }
.topic { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 28px; align-items: start; padding: 26px 0; border-top: 1px solid var(--rule); }
.topic:first-of-type { border-top: 0; }
.topic h3 { margin-top: 0 !important; }
.topic h3 a { color: var(--h3); }
.topic .media { border-radius: 8px; overflow: hidden; box-shadow: 0 4px 10px rgba(0,0,0,.12), 0 0 0 1px rgba(0,0,0,.04); background: #fff; display: block; }
.topic .media img, .topic .media video { display: block; width: 100%; height: auto; }
.topic .media.dark { background: #05080f; }
.more { font-family: var(--nav); font-weight: 600; font-size: 14.5px; }
.more::after { content: " →"; }
@media (max-width: 820px) { .topic { grid-template-columns: 1fr; } .topic .media { order: -1; max-width: 520px; } }

/* ---------- stat tiles ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin: 6px 0 24px; }
.stat { background: #fff; border: 1px solid var(--rule); border-top: 3px solid var(--brand); border-radius: 6px; padding: 12px 14px 10px; }
.stat b { display: block; font-family: var(--nav); font-size: 28px; font-weight: 600; color: var(--brand-deep); line-height: 1.1; }
.stat span { font-size: .86rem; color: var(--ink-soft); line-height: 1.35; display: block; margin-top: 3px; }
.stat.gold { border-top-color: var(--gold); }

/* ---------- dark media panels (simulation movie, star map, explorer) ---------- */
.panel-dark { background: #05080f; border-radius: 8px 8px 0 0; position: relative; }

.ale-map { position: relative; background: #070f1b; border-radius: 8px 8px 0 0; }
.ale-map svg { display: block; width: 100%; height: auto; }
.ale-map .ale-ray { cursor: pointer; }
.ale-map .ale-area, .ale-map .ale-cat, .ale-map text { transition: opacity .25s ease; }
.ale-map g, .ale-map path { transition: opacity .25s ease; }
.ale-tip { position: absolute; z-index: 5; max-width: 270px; background: rgba(8,16,30,.95); color: #e8f0fb; border: 1px solid #2f4466; border-radius: 6px; padding: 9px 12px; font-size: 13px; line-height: 1.4; pointer-events: none; box-shadow: 0 6px 18px rgba(0,0,0,.4); text-align: left; }
.ale-tip b { display: block; font-size: 14px; color: #fff; }
.ale-tip .zh { display: block; color: #9fb4cc; font-size: 12.5px; }
.ale-tip .k { color: #9fb4cc; font-size: 12px; }
.ale-tip .n { margin-top: 3px; }
.ale-tip .n span { font-family: var(--mono); color: #fff; font-weight: 600; }
.ale-tip .n span.g { color: #ffe08a; }
.ale-legend { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px 14px 4px; background: #0c1320; justify-content: center; }
.ale-legend button { font-family: var(--nav); font-size: 13px; font-weight: 600; color: #dfe8f5; background: #142033; border: 1px solid #2a3c58; border-radius: 999px; padding: 4px 11px 4px 8px; cursor: pointer; }
.ale-legend button i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }
.ale-legend button[aria-pressed=true] { background: #f4f7fb; color: #0c1320; }
.ale-key { display: flex; flex-wrap: wrap; gap: 6px 18px; justify-content: center; padding: 6px 14px 12px; background: #0c1320; color: #9fb4cc; font-size: 12.5px; }
.ale-key i { display: inline-block; vertical-align: -1px; margin-right: 6px; }
.ale-key i.ray { width: 16px; height: 2px; background: #9fc3ff; vertical-align: 3px; }
.ale-key i.gold { width: 10px; height: 10px; background: #ffe08a; }
.ale-key i.pale { width: 10px; height: 10px; background: #7fa8ff; opacity: .5; }
.ale-key i.dot { width: 8px; height: 8px; border-radius: 50%; background: #fff; box-shadow: 0 0 6px #fff; }

.explorer-frame { display: block; width: 100%; aspect-ratio: 16 / 10; border: 0; background: #05080f; border-radius: 8px 8px 0 0; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 4px 0 20px; }
.btn { display: inline-block; font-family: var(--nav); font-weight: 600; font-size: 14px; letter-spacing: .02em; padding: 8px 16px; border-radius: 5px; background: var(--brand); color: #fff; }
.btn:hover { background: var(--brand-deep); color: #fff; text-decoration: none; }
.btn.ghost { background: #fff; color: var(--brand); border: 1px solid #b9cbd9; }
.btn.ghost:hover { background: #f2f6f9; color: var(--brand-deep); }

/* ---------- reading list on topic pages ---------- */
.reflist { list-style: none; margin: 0 0 18px; }
.reflist li { padding: 6px 0 6px 18px; position: relative; font-size: .97rem; }
.reflist li::before { content: ""; position: absolute; left: 2px; top: 14px; width: 7px; height: 7px; background: var(--gold); border-radius: 1px; }

/* ---------- CV ---------- */
.cv-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 14px 30px; align-items: flex-end; margin-bottom: 8px; }
.cv-head .fields { font-family: var(--serif); font-style: italic; color: var(--brand); font-size: 1.08rem; }
.cv h2 { font-family: var(--nav) !important; font-size: 14px !important; letter-spacing: .14em; text-transform: uppercase; color: var(--brand) !important; font-weight: 700 !important; border-top: 2px solid var(--brand) !important; padding-top: 10px !important; margin: 34px 0 12px !important; }
.cv-row { display: grid; grid-template-columns: 9.5rem minmax(0, 1fr); gap: 18px; padding: 5px 0; }
.cv-row .when { font-family: var(--nav); font-size: 13.5px; color: var(--muted); text-align: right; padding-top: 2px; }
.cv-row .what { font-size: .98rem; }
.cv-row .what .sub { color: var(--muted); font-style: italic; }
.cv h3.cvsub { font-family: var(--nav); font-size: 14px !important; font-weight: 700 !important; color: var(--brand-deep) !important; margin: 16px 0 4px !important; }
@media (max-width: 620px) { .cv-row { grid-template-columns: 1fr; gap: 0; } .cv-row .when { text-align: left; } }

@media print {
  .site-header, .site-footer, .skip-link, .no-print, #lightbox { display: none !important; }
  body { font-size: 10.5pt; background: #fff; }
  .page-content { padding: 0; }
  .wrapper { max-width: none; padding: 0; }
  .cv h2 { break-after: avoid; }
  .cv-row { break-inside: avoid; }
  a { color: #0a4f80; }
  @page { size: letter; margin: 0.55in 0.6in; }
}
.focus-card .thumb.dark { background: #05080f; }
.focus-card .thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.print-only { display: none; }
@media print {
  .print-only { display: block; }
  .cv-name { font-family: Georgia, serif; font-size: 26pt; letter-spacing: .12em; color: #003b5c; margin: 0 0 2pt; }
  .cv .post-title { font-size: 12pt; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: #6b6b6b; margin-bottom: 4pt; }
  .cv .pubs li { padding-top: 4pt; padding-bottom: 4pt; break-inside: avoid; }
  .cv h2 { margin-top: 18pt !important; }
}
@media print {
  html { font-size: 12.5px; }
  body { font-size: 9.6pt; line-height: 1.42; }
  .cv .lede { font-size: 9.4pt; }
  .cv .fields { font-size: 10.5pt; margin-bottom: 4pt; }
  .cv-row { padding: 2pt 0; grid-template-columns: 7.6rem minmax(0, 1fr); }
  .cv-row .what { font-size: 9.4pt; }
  .cv-row .when { font-size: 8.4pt; }
  .cv h2 { font-size: 9pt !important; margin: 14pt 0 6pt !important; padding-top: 5pt !important; }
  .cv h3.cvsub { font-size: 9pt !important; margin: 8pt 0 2pt !important; }
  .cv p { margin-bottom: 6pt; }
  .pubs li { padding: 3pt 0 3pt 2.6rem; font-size: 9pt; }
  .pubs li::before { top: 4pt; }
}
.explorer { position: relative; background: #fff; }
.explorer img { display: block; width: 100%; height: auto; }
.explorer-go { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); font-family: var(--nav); font-size: 16px; font-weight: 600; color: #fff; background: rgba(0, 85, 135, .94); border: 0; border-radius: 999px; padding: 13px 24px; cursor: pointer; box-shadow: 0 6px 20px rgba(0,0,0,.25); }
.explorer-go small { font-weight: 500; opacity: .8; font-size: 13px; }
.explorer-go:hover { background: var(--brand-deep); }
.explorer .explorer-frame { aspect-ratio: 3 / 2; background: #fff; border-radius: 0; }
.vtabs { display: flex; gap: 6px; padding: 10px 12px; background: #f2f5f8; border-bottom: 1px solid var(--rule); }
.vtabs button { font-family: var(--nav); font-size: 14px; font-weight: 600; padding: 6px 14px; border-radius: 999px; border: 1px solid #c4d3df; background: #fff; color: var(--brand); cursor: pointer; }
.vtabs button[aria-selected=true] { background: var(--brand); color: #fff; border-color: var(--brand); }
.wp-caption video { display: block; width: 100%; height: auto; }

/* =================== fancy layer (2026-11-01) =================== */
.hero { position: relative; overflow: hidden; background: radial-gradient(120% 140% at 15% 0%, #12365c 0%, #0a1f38 45%, #050d19 100%); color: #e8eef7; border-bottom: 1px solid #0c2742; }
.hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hero-inner { position: relative; z-index: 1; padding-top: 46px; padding-bottom: 40px; pointer-events: none; }
.hero-inner a, .hero-inner button { pointer-events: auto; }
.hero .post-title { color: #fff; font-weight: 300; font-size: 46px; letter-spacing: -0.015em; text-shadow: 0 2px 18px rgba(0,0,0,.35); }
.hero .post-title .zh { color: #ffcf6b; }
.hero .lede { color: #c5d3e6; font-size: 1.08rem; max-width: 46rem; margin-top: 8px; margin-bottom: 0; }
.hero .crumbs, .hero .crumbs a { color: #9fb6d4; }
.hero .crumbs a:hover { color: #ffcf6b; }
.hero .fields { color: #ffcf6b !important; }
.hero .cv-head { margin-bottom: 0; }
.hero .lede a { color: #ffd98a; }
.hero .btn { pointer-events: auto; }
.hero-hint { position: absolute; right: 18px; bottom: 10px; z-index: 1; font-family: var(--nav); font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: rgba(200,215,235,.55); pointer-events: none; }
@media (max-width: 720px) { .hero .post-title { font-size: 34px; } .hero-inner { padding-top: 32px; padding-bottom: 28px; } }
.page-content { padding-top: 30px; }

.reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s ease, transform .6s cubic-bezier(.2,.8,.2,1); }
.reveal.is-in { opacity: 1; transform: none; }

.topic .media { transition: transform .35s cubic-bezier(.2,.8,.2,1), box-shadow .35s ease; }
.topic .media:hover { transform: translateY(-3px) scale(1.012); box-shadow: 0 14px 30px rgba(0,30,60,.22), 0 0 0 1px rgba(0,0,0,.04); }
.wp-caption { transition: box-shadow .3s ease; }
.wp-caption:hover { box-shadow: 0 10px 24px rgba(0,30,60,.14), 0 0 0 1px rgba(0,0,0,.04); }
.stat { transition: transform .25s ease, box-shadow .25s ease; }
.stat:hover { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(0,30,60,.10); }
.sw, .misc-card { transition: transform .25s ease, box-shadow .25s ease; }
.misc-card:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(0,30,60,.12); }


/* ---------- publications filter ---------- */
.pub-filter { position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 12px 14px; margin: 0 0 22px; background: rgba(253,253,253,.92); backdrop-filter: blur(8px); border: 1px solid var(--rule); border-radius: 10px; box-shadow: 0 4px 14px rgba(0,30,60,.06); }
.pub-filter input { flex: 1 1 220px; font: inherit; font-size: 15px; padding: 8px 12px; border: 1px solid #c9d6e2; border-radius: 8px; outline: none; }
.pub-filter input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(0,85,135,.12); }
.pub-filter button { font-family: var(--nav); font-size: 13px; font-weight: 600; padding: 6px 12px; border-radius: 999px; border: 1px solid #c4d3df; background: #fff; color: var(--brand); cursor: pointer; }
.pub-filter button[aria-pressed=true] { background: var(--brand); color: #fff; border-color: var(--brand); }
.pf-count { font-family: var(--mono); font-size: 12.5px; color: var(--muted); margin-left: auto; }
.pubs li { transition: background .2s ease; border-radius: 6px; }
.pubs li:hover { background: #f4f8fb; }

/* ---------- CV section index ---------- */
.cv-toc { position: sticky; top: 0; z-index: 5; display: flex; gap: 6px; overflow-x: auto; padding: 10px 2px; margin: -6px 0 10px; background: rgba(253,253,253,.94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--rule); scrollbar-width: thin; }
.cv-toc a { flex: none; font-family: var(--nav); font-size: 12.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); padding: 5px 10px; border-radius: 999px; }
.cv-toc a:hover { color: var(--brand); background: #eef4f9; text-decoration: none; }
.cv-toc a.on { color: #fff; background: var(--brand); }
.cv-row { border-left: 2px solid transparent; transition: border-color .2s ease, background .2s ease; }
.cv-row:hover { border-left-color: var(--gold); background: #fbfcfd; }
@media print { .hero { background: none !important; color: #000; border: 0; } .hero-canvas { display: none; } .hero .post-title, .hero .lede, .hero .fields { color: #000 !important; text-shadow: none; } .cv-toc { display: none; } }
[hidden] { display: none !important; }
.hero-about .hero-inner { padding-top: 84px; padding-bottom: 70px; }
.hero-about .post-title { font-size: 64px; }
.hero-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0 0; }
.hero-tags a { pointer-events: auto; font-family: var(--nav); font-size: 13.5px; font-weight: 600; letter-spacing: .03em; color: #e7eef8; padding: 6px 13px; border-radius: 999px; background: rgba(255,255,255,.07); border: 1px solid rgba(160,190,230,.28); backdrop-filter: blur(4px); transition: background .2s ease, color .2s ease, border-color .2s ease; }
.hero-tags a:hover { background: #ffb81c; color: #1a1205; border-color: #ffb81c; text-decoration: none; }
.hero-btns { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0 0; }
.hero .btn { background: linear-gradient(135deg, #ffb81c, #ff8a3d); color: #1a1205; }
.hero .btn:hover { filter: brightness(1.06); color: #1a1205; }
.btn.ghost-dark { background: rgba(255,255,255,.06); color: #e7eef8; border: 1px solid rgba(160,190,230,.35); }
.btn.ghost-dark:hover { background: rgba(255,255,255,.14); color: #fff; }
@media (max-width: 720px) { .hero-about .post-title { font-size: 42px; } .hero-about .hero-inner { padding-top: 48px; padding-bottom: 44px; } }
@media (min-width: 760px) { .cv-toc { flex-wrap: wrap; overflow: visible; gap: 2px 4px; } .cv-toc a { padding: 4px 9px; font-size: 12px; } }
@media print { .reveal { opacity: 1 !important; transform: none !important; transition: none !important; } .hero a { color: #005587 !important; } .hero .btn { display: none; } }

/* ---------- Alfvénon field lines (js/alfvenon-lines.js) ---------- */
.afl { position: relative; margin: 26px 0 30px; border-radius: 14px; overflow: hidden; background: #05070d; box-shadow: 0 10px 30px rgba(0,20,50,.18); }
.afl-stage { position: relative; height: 480px; }
.afl-stage canvas { display: block; width: 100%; height: 100%; cursor: grab; touch-action: none; }
.afl-stage canvas:active { cursor: grabbing; }
.afl:fullscreen .afl-stage { height: calc(100vh - 90px); }
.afl-tools { position: absolute; top: 12px; right: 12px; z-index: 2; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.afl-tools button { font-family: var(--nav); font-size: 12.5px; font-weight: 600; color: #cfdbec; background: rgba(12,20,36,.72); border: 1px solid rgba(120,150,200,.28); border-radius: 999px; padding: 5px 11px; cursor: pointer; backdrop-filter: blur(8px); }
.afl-tools button[aria-pressed=true] { background: #e9f1fb; color: #0c1424; border-color: #e9f1fb; }
.afl-cbar { position: absolute; z-index: 2; left: 16px; top: 18px; height: 150px; width: 10px; border-radius: 5px; background: linear-gradient(to top, #5680cd, #7c62e6 22%, #cd46aa 45%, #fa803c 70%, #ffecbe); box-shadow: 0 0 0 1px rgba(255,255,255,.12); }
.afl-cbar span { position: absolute; left: 16px; font-family: var(--mono); font-size: 11.5px; color: #cfdbec; white-space: nowrap; }
.afl-cbar-max { top: -5px; } .afl-cbar-min { bottom: -5px; } .afl-cbar-lab { top: 50%; transform: translateY(-50%); color: #9fb4cc; }
.afl-hint { position: absolute; z-index: 2; left: 50%; transform: translateX(-50%); top: 446px; font-family: var(--nav); font-size: 12px; letter-spacing: .06em; color: rgba(200,215,235,.55); pointer-events: none; white-space: nowrap; }
.afl-load { position: absolute; left: 0; right: 0; top: 0; height: 480px; display: flex; align-items: center; justify-content: center; font-family: var(--nav); color: #9fb4cc; pointer-events: none; }
.afl-ready .afl-load { display: none; }
.afl figcaption { background: #fff; color: var(--muted, #555); font-size: 14px; line-height: 1.55; padding: 12px 16px 14px; border-top: 1px solid rgba(0,0,0,.06); }
.afl-nogl .afl-stage::after { content: "This 3D view needs WebGL 2. The full explorer is linked below."; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 20px; text-align: center; color: #9fb4cc; font-family: var(--nav); }
.afl-nogl .afl-tools, .afl-nogl .afl-cbar, .afl-nogl .afl-hint, .afl-nogl .afl-load { display: none; }
@media (max-width: 760px) { .afl-stage, .afl-load { height: 400px; } .afl-hint { top: 370px; } .afl-tools button { font-size: 11.5px; padding: 4px 9px; } }
@media print { .afl { display: none; } }
.afl-hint { left: auto; right: 16px; transform: none; top: auto; bottom: 14px; }
.afl figcaption { position: relative; }
.afl-hint { bottom: auto; top: 450px; }
@media (max-width: 760px) { .afl-hint { top: 372px; } }

.afl-cbar { top: 40px; height: 170px; background: linear-gradient(to top, #5680cd, #7c62e6 20%, #cd46aa 40%, #fa6e32 60%, #ffbe3c 80%, #fff096); }
.afl-cbar .afl-cbar-lab { top: -22px; left: -1px; transform: none; font-style: italic; }
.afl-cbar .afl-cbar-mid { bottom: 60%; transform: translateY(50%); color: #ffb48a; }

/* ---------- night-sky hero, gilt titles, seal, ink reveal (after lingtai.ai) ---------- */
:root { --gilt: linear-gradient(100deg, #b8913f 0%, #e2c682 22%, #fff3c8 42%, #e2c682 58%, #b8913f 80%, #d9b765 100%); --vermilion: #d0563d; }
.hero { background: radial-gradient(130% 120% at 50% 118%, #1d3264 0%, #0c1630 46%, #060c1c 100%); border-bottom: 0; }
.hero-inner { padding-bottom: 64px; }
.hero .post-title { font-family: "Cormorant Garamond", Georgia, "Times New Roman", serif; font-weight: 600; letter-spacing: 0; font-size: 52px; line-height: 1.08; text-shadow: none; }
.hero .post-title, .hero .post-title .gilt { background: var(--gilt); background-size: 220% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: gilt-sweep 3.2s cubic-bezier(.3,.6,.2,1) .5s both; }
.hero .post-title .zh { font-family: "Ma Shan Zheng", "Kaiti SC", KaiTi, STKaiti, serif; font-weight: 400; background: none; -webkit-background-clip: border-box; background-clip: border-box; color: #efe6cf; font-size: .78em; margin-left: .25em; animation: none; text-shadow: 0 0 22px rgba(226,198,130,.25); }
.hero-about .post-title { font-size: 76px; }
.hero .lede { font-family: "Cormorant Garamond", Georgia, serif; font-size: 1.32rem; font-weight: 500; color: #d9d2bd; letter-spacing: .01em; }
.hero .crumbs { font-family: "Cormorant Garamond", Georgia, serif; font-size: 1.02rem; letter-spacing: .04em; }
.seal { display: inline-block; width: 58px; height: 58px; margin-left: 18px; vertical-align: 6px; color: var(--vermilion); transform: rotate(-2.5deg); animation: seal-stamp .7s cubic-bezier(.3,1.4,.5,1) 1.9s both; filter: drop-shadow(0 2px 8px rgba(0,0,0,.35)); }
.seal svg { display: block; width: 100%; height: 100%; }
.hero-waves { position: absolute; left: 0; right: 0; bottom: -1px; width: 100%; height: 56px; z-index: 1; pointer-events: none; }
.hero-waves .w1 { fill: #13224a; opacity: .75; }
.hero-waves .w2 { fill: #0b1736; opacity: .9; }
.hero-waves .w3 { fill: var(--paper); }
.hero-hint { bottom: 60px; }
@keyframes gilt-sweep { 0% { background-position: 100% 0; } 100% { background-position: 0% 0; } }
@keyframes ink-reveal { 0% { opacity: 0; filter: blur(7px); transform: translateY(10px); } 100% { opacity: 1; filter: blur(0); transform: none; } }
@keyframes seal-stamp { 0% { opacity: 0; transform: rotate(-2.5deg) scale(1.6); } 55% { opacity: 1; } 100% { opacity: 1; transform: rotate(-2.5deg) scale(1); } }
.hero-inner > * { animation: ink-reveal 1.2s cubic-bezier(.2,.7,.2,1) both; }
.hero-inner > :nth-child(1) { animation-delay: .1s; } .hero-inner > :nth-child(2) { animation-delay: .35s; }
.hero-inner > :nth-child(3) { animation-delay: .6s; } .hero-inner > :nth-child(4) { animation-delay: .8s; } .hero-inner > :nth-child(5) { animation-delay: 1s; }
.hero-inner > .post-title { animation: ink-reveal 1.3s cubic-bezier(.2,.7,.2,1) .1s both, gilt-sweep 3.2s cubic-bezier(.3,.6,.2,1) .5s both; }
.hero-inner > .post-title:has(.gilt) { background: none; -webkit-background-clip: border-box; background-clip: border-box; color: #efe6cf; animation: ink-reveal 1.3s cubic-bezier(.2,.7,.2,1) .1s both; }
@media (max-width: 720px) { .hero .post-title { font-size: 40px; } .hero-about .post-title { font-size: 50px; } .seal { width: 44px; height: 44px; margin-left: 10px; } .hero-inner { padding-bottom: 54px; } }
@media (prefers-reduced-motion: reduce) { .hero-inner > *, .hero .post-title, .hero .post-title .gilt, .seal { animation: none !important; } }
@media print { .hero-waves, .seal { display: none; } .hero .post-title, .hero .post-title .gilt { background: none !important; color: #000 !important; -webkit-text-fill-color: #000; } }

/* ---------- 自述: classical self-account on paper, written top to bottom (after lingtai.ai) ---------- */
.zishu { display: grid; grid-template-columns: auto 1fr; gap: 0; margin: 30px 0 34px; border-radius: 12px; overflow: hidden; background: #efe7d5; color: #27232a; box-shadow: 0 8px 26px rgba(40,30,10,.12);
  background-image: radial-gradient(rgba(120,90,40,.10) 1px, transparent 1.2px), radial-gradient(rgba(120,90,40,.06) 1px, transparent 1.4px); background-size: 23px 19px, 37px 31px; background-position: 0 0, 11px 7px; }
.zishu-scroll { position: relative; writing-mode: vertical-rl; text-orientation: upright; height: 330px; padding: 26px 24px 26px 30px; border-right: 1px solid rgba(110,82,29,.22); font-family: "Noto Serif SC", "Songti SC", STSong, SimSun, serif; }
.zishu-scroll h2 { font-family: "Ma Shan Zheng", "Kaiti SC", KaiTi, STKaiti, serif; font-weight: 400; font-size: 30px; letter-spacing: .3em; color: #ad3824; margin: 0 0 0 18px; border: 0; padding: 0; }
.zishu-scroll p { font-size: 18px; line-height: 1.95; letter-spacing: .14em; margin: 0; color: #27232a; }
.zishu-seal { position: absolute; left: 14px; bottom: 14px; writing-mode: horizontal-tb; }
.zishu-seal .seal { width: 46px; height: 46px; margin: 0; vertical-align: 0; color: #ad3824; animation: none; filter: none; opacity: .92; }
.zishu-en { padding: 24px 26px; align-self: center; }
.zishu-en .k { font-family: "Cormorant Garamond", Georgia, serif; font-size: 13px; letter-spacing: .16em; text-transform: uppercase; color: #8a6a2a; margin-bottom: 8px; }
.zishu-en p { font-family: "Cormorant Garamond", Georgia, serif; font-size: 1.12rem; line-height: 1.6; color: #3a332c; margin: 0 0 10px; }
.zishu-en .src { font-family: var(--sans); font-size: 12.5px; color: #8b8171; margin: 0; }
.zishu-en .src a { color: #ad3824; }
@media (max-width: 760px) { .zishu { grid-template-columns: 1fr; } .zishu-scroll { height: 300px; border-right: 0; border-bottom: 1px solid rgba(110,82,29,.22); overflow-x: auto; } .zishu-scroll p { font-size: 16.5px; } }
@media print { .zishu { box-shadow: none; background: none; } }
.zishu { grid-template-columns: 1fr; }
.zishu-scroll { height: 372px; border-right: 0; border-bottom: 1px solid rgba(110,82,29,.22); overflow-x: auto; padding: 26px 26px 22px 26px; }
.zishu-scroll p { letter-spacing: .1em; line-height: 1.9; }
.zishu-en { padding: 18px 24px 20px; }
.hero .lede, .hero .crumbs { text-shadow: 0 0 14px #0b1530, 0 0 5px #0b1530, 0 0 2px #0b1530; }

/* ---------- language switch (EN | 文) and the 文言 pages under /wen/ ---------- */
.lang-switch { display: inline-flex; flex: none; border: 1px solid rgba(255,255,255,.4); border-radius: 4px; overflow: hidden; margin-left: 4px; }
.lang-switch a { font-family: "Cormorant Garamond", "Noto Serif SC", Georgia, serif; font-size: 15px; font-weight: 600; line-height: 1; color: #e8eef7; padding: 6px 9px; }
.lang-switch a:hover { text-decoration: none; background: rgba(255,255,255,.12); }
.lang-switch a[aria-current=true] { background: #ad3824; color: #fff; }
html[lang=lzh] body { font-family: "Noto Serif SC", "Songti SC", STSong, "Source Han Serif SC", SimSun, serif; line-height: 1.9; letter-spacing: .02em; }
html[lang=lzh] h1, html[lang=lzh] h2, html[lang=lzh] h3, html[lang=lzh] h4 { font-family: "Noto Serif SC", "Songti SC", STSong, serif; font-weight: 600; letter-spacing: .06em; }
html[lang=lzh] .site-nav .menu > li > a { font-family: "Noto Serif SC", "Songti SC", serif; letter-spacing: .18em; text-transform: none; font-size: 16px; }
html[lang=lzh] .site-title { font-family: "Ma Shan Zheng", "Kaiti SC", KaiTi, serif; letter-spacing: .06em; }
html[lang=lzh] .site-title .zh { font-family: "Cormorant Garamond", Georgia, serif; letter-spacing: 0; }
html[lang=lzh] .hero .post-title { font-family: "Cormorant Garamond", "Ma Shan Zheng", "Kaiti SC", KaiTi, serif; font-weight: 400; letter-spacing: .08em; }
html[lang=lzh] .hero .post-title .gilt { letter-spacing: .1em; }
html[lang=lzh] .hero .lede, html[lang=lzh] .hero .crumbs { font-family: "Noto Serif SC", "Songti SC", serif; font-size: 1.08rem; letter-spacing: .06em; }
html[lang=lzh] .hero-tags a, html[lang=lzh] .btn, html[lang=lzh] .afl-tools button, html[lang=lzh] .pub-filter button { font-family: "Noto Serif SC", "Songti SC", serif; letter-spacing: .08em; }
html[lang=lzh] .wp-caption dd, html[lang=lzh] figcaption { letter-spacing: .02em; line-height: 1.75; }
@media (max-width: 760px) { .lang-switch a { padding: 6px 7px; font-size: 14px; } }
html[lang=lzh] .hero .post-title .zh { font-family: "Cormorant Garamond", Georgia, serif; font-size: .5em; letter-spacing: .02em; margin-left: .5em; }
@media (max-width: 720px) { .hero-hint { display: none; } }
html[lang=lzh] .fields, html[lang=lzh] .hero .fields { font-style: normal; letter-spacing: .06em; }

/* ---------- Where I've Been (/travel/): the page is the night sky (js/travel.js, js/travel-sky.js). Plates are framed like atlas plates ---------- */
body.page-travel {
  --tv-night: #060c1c; --tv-gilt: #e2c682; --tv-pale: #fff3c8; --tv-parchment: #e0d9c5; --tv-ash: #a3b1c8;
  --ink: var(--tv-parchment); --ink-soft: var(--tv-parchment); --muted: var(--tv-ash); --link: #ecd491; --rule: rgba(226,198,130,.24); --paper: var(--tv-night); --card: transparent;
  color-scheme: dark; color: var(--ink);
  background: var(--tv-night) radial-gradient(120% 90% at 12% 22%, #12264d 0%, #0a1530 45%, #060c1c 100%) fixed;
}
#tv-sky { position: fixed; left: 0; top: 0; width: 100%; height: 100vh; height: 100lvh; z-index: -1; display: block; opacity: 0; transition: opacity 1.4s ease; pointer-events: none; }
#tv-sky.on { opacity: 1; }
.page-travel .site-header { background: rgba(6,12,28,.62); border-bottom: 1px solid rgba(226,198,130,.42); }
.page-travel .hero { background: none; border: 0; min-height: min(84vh, 840px); display: flex; align-items: center; overflow: visible; }
.page-travel .hero-canvas, .page-travel .hero-waves { display: none; }
.page-travel .hero-inner { width: 100%; padding-top: 36px; padding-bottom: 36px; }
.page-travel .post-title { font-size: clamp(60px, 7.6vw, 110px); line-height: .96; font-weight: 500; max-width: 5.2em; padding-bottom: .08em; filter: drop-shadow(0 0 22px rgba(6,12,28,.9)); }
html[lang=lzh] .page-travel .post-title { font-size: clamp(80px, 10vw, 138px); line-height: 1.05; letter-spacing: .04em; }
.page-travel .hero .lede { max-width: 25rem; margin-top: 22px; font-size: 1.42rem; line-height: 1.32; text-shadow: 0 0 16px #060c1c, 0 0 5px #060c1c; }
.page-travel .hero .lede b { font-weight: 600; color: var(--tv-pale); }
html[lang=lzh] .page-travel .hero .lede { font-size: 1.14rem; line-height: 1.75; }
.tv-hint, .tv-sky-note { display: none; }
.tv-sky-live .tv-hint, .tv-sky-on .tv-sky-note { display: block; }
.tv-hint { margin: 16px 0 0; max-width: 25rem; color: var(--tv-ash); font-size: .9rem; line-height: 1.45; text-shadow: 0 0 10px #060c1c; }
@media (hover: none) { .tv-hint-move { display: none; } }
.page-travel .page-content { padding-top: 0; }
.page-travel a:focus-visible, .tv-page select:focus-visible, .tv-page input:focus-visible { outline: 2px solid var(--tv-gilt); outline-offset: 2px; }

/* the totals are an inscription under the title, not a row of boxes */
.page-travel .stats { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0; margin: 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); background: linear-gradient(90deg, rgba(6,12,28,.72), rgba(6,12,28,.42)); }
.page-travel .stat { background: none; border: 0; border-left: 1px solid var(--rule); border-radius: 0; padding: 14px 14px 12px; transition: none; }
.page-travel .stat:first-child { border-left: 0; }
.page-travel .stat:hover { transform: none; box-shadow: none; }
.page-travel .stat b { font-family: "Cormorant Garamond", Georgia, serif; font-size: 40px; font-weight: 500; color: var(--tv-gilt); font-variant-numeric: lining-nums; line-height: 1; }
.page-travel .stat span { color: var(--tv-ash); font-size: .82rem; margin-top: 6px; }
.page-travel .reveal { opacity: 1; transform: none; transition: none; }
@media (max-width: 760px) {
  .page-travel .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .page-travel .stat:nth-child(3n + 1) { border-left: 0; }
  .page-travel .stat:nth-child(n + 4) { border-top: 1px solid var(--rule); }
  .page-travel .stat b { font-size: 31px; }
}

.tv-page { --tv-land: #15243f; --tv-line: rgba(163,177,200,.46); --tv-axis: rgba(170,190,220,.24); --tv-grid: rgba(226,198,130,.14); --tv-faded: rgba(226,198,130,.26); --tv-series: #f0c566; display: grid; gap: 26px; min-width: 0; }
.tv-page [hidden] { display: none !important; }
.tv-card { background: rgba(6,12,28,.88); border: 1px solid rgba(226,198,130,.38); outline: 1px solid rgba(226,198,130,.14); outline-offset: -6px; padding: 24px 26px; display: grid; gap: 12px; min-width: 0; }
.post-content .tv-card h2 { font-family: "Cormorant Garamond", Georgia, serif; color: var(--tv-gilt); font-size: 31px; font-weight: 500; line-height: 1.12; margin: 0; padding: 0; border: 0; }
html[lang=lzh] .post-content .tv-card h2 { font-family: "Noto Serif SC", "Songti SC", serif; font-size: 23px; font-weight: 600; }
.tv-note { color: var(--muted); font-size: .88rem; line-height: 1.5; margin: 0; max-width: 78ch; }
.tv-notes { display: grid; gap: 9px; padding: 18px 22px; background: rgba(6,12,28,.74); }
.tv-bar { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px; }
.tv-bar > div { min-width: 0; display: grid; gap: 6px; flex: 1 1 18rem; }
.tv-bar > .tv-controls { display: flex; flex-wrap: wrap; gap: 6px; flex: 0 1 auto; }
.tv-page select, .tv-page input { font: inherit; font-size: .84rem; color: var(--ink); background: rgba(255,255,255,.05); border: 1px solid var(--rule); border-radius: 2px; padding: 4px 8px; }
.tv-page input::placeholder { color: var(--muted); }
.tv-map, .tv-years { position: relative; min-width: 0; color: var(--muted); font-size: .9rem; }
.tv-map { min-height: 16rem; }
.tv-map:has(svg) { min-height: 0; }
.tv-years { min-height: 11rem; }
.tv-map svg { display: block; cursor: grab; touch-action: none; background: rgba(4,9,22,.6); }
.tv-map svg:active { cursor: grabbing; }
.tv-years svg { display: block; }
.tv-years rect.hit { cursor: pointer; }
.tv-tip { position: absolute; z-index: 2; pointer-events: none; background: #0b1730; color: var(--ink); border: 1px solid rgba(226,198,130,.5); box-shadow: 0 6px 22px rgba(0,0,0,.5); padding: 5px 9px; font-size: .82rem; line-height: 1.4; max-width: 16rem; }
.tv-tip div:first-child { color: var(--tv-gilt); font-weight: 600; }
.tv-tick { fill: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.tv-scale { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: .82rem; font-variant-numeric: tabular-nums; }
.tv-key { display: flex; flex-wrap: wrap; gap: 4px 16px; color: var(--muted); font-size: .82rem; margin: 0; padding: 0; list-style: none; }
.tv-key li { display: flex; align-items: center; gap: 6px; margin: 0; }
.tv-key i { display: block; width: 1.5rem; border-top: 1px solid var(--tv-line); }
.tv-key .tv-line-country { border-top-width: 2px; }
.tv-key .tv-line-adm2 { border-top-color: var(--tv-axis); }
.tv-key .tv-line-disputed { border-top: 2px dashed var(--muted); }
.tv-swatches { display: flex; gap: 2px; }
.tv-swatches i { display: block; width: 1.25rem; height: .625rem; }
.tv-two { display: grid; gap: 26px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 24rem), 1fr)); min-width: 0; }
.tv-scroll { max-height: 26rem; overflow: auto; }
.tv-page table { width: 100%; border-collapse: collapse; font-size: .84rem; line-height: 1.4; font-variant-numeric: tabular-nums lining-nums; }
.tv-page th { position: sticky; top: 0; background: #080f22; color: var(--tv-gilt); text-align: right; font-weight: 500; padding: 5px 8px; border-bottom: 1px solid rgba(226,198,130,.42); white-space: nowrap; }
.tv-page td { text-align: right; padding: 4px 8px; border-bottom: 1px solid rgba(226,198,130,.12); white-space: nowrap; }
.tv-page tbody tr:hover td { background: rgba(226,198,130,.07); }
.tv-page th:first-child, .tv-page td:first-child { text-align: left; white-space: normal; }
.tv-page th.tv-left, .tv-page td.tv-left { text-align: left; white-space: normal; }
#concentration table { min-width: 34rem; }
#concentration th { white-space: normal; vertical-align: bottom; }
.page-travel .site-footer { margin-top: 26px; background: rgba(6,12,28,.7); }
.page-travel .site-footer a { text-decoration-color: rgba(226,198,130,.4); }
@media screen and (max-width: 900px) {
  .page-travel .site-nav .menu { background: #0b1730; border-color: rgba(226,198,130,.42); }
  .page-travel .site-nav .menu > li > a { color: var(--tv-parchment); }
  .page-travel .sub-menu { background: none; }
  .page-travel .sub-menu a { color: var(--tv-ash); }
}
@media (max-width: 720px) {
  .page-travel .hero { min-height: 92vh; align-items: flex-start; }
  .page-travel .hero .lede { max-width: 19rem; font-size: 1.24rem; }
  .tv-hint { max-width: 18rem; }
  .tv-card { padding: 18px 14px; }
  .post-content .tv-card h2 { font-size: 27px; }
}
/* 3D mode: the globe takes the screen; controls sit on it as small plates */
.tv-3d-open { display: none; visibility: hidden; margin-top: 18px; pointer-events: auto; font: inherit; font-size: .98rem; font-weight: 500; color: var(--tv-night); background: var(--tv-gilt); border: 1px solid var(--tv-gilt); padding: 9px 20px; cursor: pointer; transition: background .2s ease, color .2s ease; }
.tv-sky-on .tv-3d-open { display: inline-block; }
.tv-sky-ready .tv-3d-open { visibility: visible; }
.tv-3d-open:hover { background: var(--tv-pale); }
.tv-3d-open:focus-visible { outline: 2px solid var(--tv-pale); outline-offset: 3px; }
.page-travel .site-header, .page-travel .hero-inner, .page-travel .page-content, .page-travel .site-footer { transition: opacity .28s ease; }
.tv-3d-fade .site-header, .tv-3d-fade .hero-inner, .tv-3d-fade .tv-page, .tv-3d-fade .site-footer { opacity: 0; }
html.tv-3d-lock, html.tv-3d-lock body { overflow: hidden; }
.tv-3d #tv-sky { z-index: 30; pointer-events: auto; cursor: grab; touch-action: none; }
.tv-3d-ui { position: fixed; inset: 0; z-index: 31; pointer-events: none; color: var(--tv-parchment); font-size: .88rem; line-height: 1.4; }
.tv-3d-ui[hidden], .tv-3d-card[hidden], .tv-3d-tip[hidden] { display: none; }
.tv-3d-ui button, .tv-3d-ui input, .tv-3d-ui label, .tv-3d-card, .tv-3d-layers { pointer-events: auto; }
.tv-3d-ui button { font: inherit; color: var(--tv-parchment); background: rgba(6,12,28,.72); border: 1px solid rgba(226,198,130,.45); padding: 6px 13px; cursor: pointer; }
.tv-3d-ui button:hover:not(:disabled) { color: var(--tv-night); background: var(--tv-gilt); }
.tv-3d-ui .tv-3d-all:disabled { display: none; }
.tv-3d-close { flex: none; white-space: nowrap; }
.tv-3d-ui :focus-visible { outline: 2px solid var(--tv-gilt); outline-offset: 2px; }
.tv-3d-head { position: absolute; top: 18px; left: 22px; right: 22px; display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.tv-3d-help { margin: 0; color: var(--tv-ash); max-width: 34rem; text-shadow: 0 0 10px #060c1c; }
.tv-3d-layers { position: absolute; left: 22px; bottom: 84px; margin: 0; padding: 10px 14px 12px; display: grid; gap: 4px; border: 1px solid rgba(226,198,130,.32); background: rgba(6,12,28,.66); }
.tv-3d-layers legend { padding: 0 6px; color: var(--tv-gilt); font-family: "Cormorant Garamond", Georgia, serif; font-size: 1.08rem; }
html[lang=lzh] .tv-3d-layers legend { font-family: "Noto Serif SC", "Songti SC", serif; font-size: .92rem; }
.tv-3d-layers label { display: flex; align-items: center; gap: 7px; cursor: pointer; }
.tv-3d-layers input { accent-color: var(--tv-gilt); margin: 0; }
.tv-3d-time { position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%); width: min(760px, calc(100% - 44px)); display: flex; align-items: center; gap: 12px; padding: 9px 12px; border: 1px solid rgba(226,198,130,.32); background: rgba(6,12,28,.72); }
.tv-3d-year { flex: 1 1 auto; min-width: 60px; accent-color: var(--tv-gilt); margin: 0; }
.tv-3d-now { flex: none; min-width: 9.5em; text-align: right; font-variant-numeric: tabular-nums lining-nums; color: var(--tv-pale); }
.tv-3d-card { position: absolute; right: 22px; top: 76px; width: 292px; max-width: calc(100% - 44px); padding: 16px 18px 12px; border: 1px solid rgba(226,198,130,.45); outline: 1px solid rgba(226,198,130,.14); outline-offset: -5px; background: rgba(6,12,28,.86); }
.tv-3d-card h2 { margin: 0 22px 6px 0; font-family: "Cormorant Garamond", Georgia, serif; font-size: 25px; font-weight: 500; line-height: 1.12; color: var(--tv-gilt); }
html[lang=lzh] .tv-3d-card h2 { font-family: "Noto Serif SC", "Songti SC", serif; font-size: 19px; }
.tv-3d-card p { margin: 0 0 3px; }
.tv-3d-block, .tv-3d-span { color: var(--tv-ash); font-size: .82rem; font-variant-numeric: lining-nums; }
.tv-3d-count { color: var(--tv-pale); }
.tv-3d-card svg { display: block; width: 100%; height: 60px; margin-top: 10px; overflow: visible; }
.tv-3d-card svg rect { cursor: pointer; }
.tv-3d-card svg .on { fill: rgba(240,197,102,.72); }
.tv-3d-card svg .off { fill: rgba(226,198,130,.2); }
.tv-3d-card svg .now { fill: var(--tv-pale); }
.tv-3d-axis { display: flex; justify-content: space-between; color: var(--tv-ash); font-size: .76rem; font-variant-numeric: lining-nums; }
.tv-3d-ui .tv-3d-card-x { position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; padding: 0; line-height: 1; font-size: 1.1rem; background: none; border-color: transparent; }
.tv-3d-tip { position: fixed; z-index: 32; pointer-events: none; background: #0b1730; border: 1px solid rgba(226,198,130,.5); padding: 5px 9px; font-size: .82rem; max-width: 17rem; box-shadow: 0 6px 22px rgba(0,0,0,.5); }
.tv-3d-tip div:first-child { color: var(--tv-gilt); font-weight: 600; }
@media (max-width: 720px) {
  .tv-3d-head { top: 10px; left: 12px; right: 12px; }
  .tv-3d-help { font-size: .78rem; }
  .tv-3d-ui button { padding: 5px 9px; }
  .tv-3d-layers { left: 12px; right: 12px; bottom: 112px; display: flex; flex-wrap: wrap; gap: 3px 12px; padding: 6px 10px 8px; font-size: .78rem; }
  .tv-3d-time { bottom: 12px; width: calc(100% - 24px); flex-wrap: wrap; gap: 6px 10px; }
  .tv-3d-year { order: 3; flex-basis: 100%; }
  .tv-3d-now { flex: 1 1 auto; min-width: 0; }
  .tv-3d-card { top: auto; right: 12px; left: 12px; bottom: 192px; width: auto; max-width: none; padding: 10px 12px 8px; }
  .tv-3d-card h2 { font-size: 20px; }
  .tv-3d-card svg { height: 34px; margin-top: 4px; }
}
@media print {
  #tv-sky { display: none; }
  body.page-travel { --ink: #161616; --ink-soft: #4a4a4a; --muted: #6b6b6b; --rule: #e6e6e6; --paper: #fff; --link: #0a67b0; background: #fff; color: #000; color-scheme: light; }
  .page-travel .hero { min-height: 0; }
  .page-travel .post-title { filter: none; font-size: 40px; }
  .tv-card, .tv-notes { background: none; outline: 0; }
  .post-content .tv-card h2, .page-travel .stat b, .tv-page th { color: #000; background: none; }
}

/* =================== per-page themes (js/hero-scene.js picks the scene from the body's theme-* class) ===================
   Everything is inside @media screen: printing a page, and with it cv/Zesen_Huang_CV.pdf, stays exactly as before.
   th-full: the scene is fixed behind the whole page; the text column sits on a scrim so its contrast does not depend on the scene. */
@media screen {
  html.scene-on .hero-canvas { opacity: 0; transition: opacity 1.1s ease; }
  html.scene-on .hero-canvas.on { opacity: 1; }
  .hero-hint { text-transform: none; letter-spacing: .01em; font-size: 12.5px; max-width: min(92%, 40rem); text-align: right; color: rgba(226,232,244,.86); background: rgba(6,12,28,.62); padding: 2px 8px 3px; border-radius: 3px; }
  .scene-label { position: absolute; z-index: 3; max-width: min(90vw, 28rem); padding: 3px 9px 4px; border-radius: 3px; background: rgba(5,10,24,.86); border: 1px solid rgba(226,198,130,.38); color: #f1e8cf; font-family: "Cormorant Garamond", "Noto Serif SC", Georgia, serif; font-size: 16px; line-height: 1.25; pointer-events: none; opacity: 0; transition: opacity .15s ease; }
  html[lang=lzh] .scene-label { font-family: "Noto Serif SC", "Songti SC", serif; font-size: 14px; letter-spacing: .06em; }

  /* ---------- pieces the scenes add or lean on ---------- */
  .theme-research .topic h3 a::before { content: ""; display: inline-block; width: .62em; height: .62em; margin-right: .42em; border-radius: 50%; vertical-align: .07em; background: var(--orb); }
  .theme-research .topic:nth-of-type(1) { --orb: radial-gradient(circle at 35% 30%, #cd46aa, #4b2fa8); }
  .theme-research .topic:nth-of-type(2) { --orb: radial-gradient(circle at 35% 30%, #efece4, #1c1b1f 72%); }
  .theme-research .topic:nth-of-type(3) { --orb: radial-gradient(circle at 35% 30%, #5f9fe6, #0d3b78); }
  .theme-research .topic:nth-of-type(4) { --orb: radial-gradient(circle at 35% 30%, #f2b64f, #0d5f64 62%); }
  .theme-research .topic:nth-of-type(5) { --orb: radial-gradient(circle at 35% 30%, #ffd98a, #d9540d); }
  .pub-years { position: absolute; left: 0; right: 0; bottom: 74px; z-index: 1; height: 1.2em; pointer-events: none; }
  .pub-years span { position: absolute; transform: translateX(-50%); font-family: "Cormorant Garamond", Georgia, serif; font-size: 17px; font-variant-numeric: lining-nums; letter-spacing: .04em; color: rgba(236,226,196,.86); text-shadow: 0 0 8px #050a18; }
  @keyframes pub-flash { 0% { background: rgba(226,198,130,.34); box-shadow: 0 0 0 2px #e2c682; } 100% { background: transparent; box-shadow: 0 0 0 2px transparent; } }
  .pub-flash { animation: pub-flash 2.2s ease-out; }

  /* ---------- full-page themes: tokens ---------- */
  .theme-about, .theme-research, .theme-publications { --th-night: #060c1c; --th-scrim: rgba(6,12,28,.86); --th-accent: #e2c682; --th-h3: #f3e0ae; --th-h4: #a9c3ea; --ink: #ece6d6; --ink-soft: #d4cfbf; --muted: #a3b1c8; --link: #ecd491; --rule: rgba(226,198,130,.24); --th-line: rgba(226,198,130,.34); --th-card: rgba(14,26,58,.62); --gold: #e2c682; }
  .theme-cv { --th-night: #081a30; --th-scrim: rgba(8,26,48,.88); --th-accent: #e2c682; --th-h3: #f3e0ae; --th-h4: #a9d0d6; --ink: #eee9dc; --ink-soft: #d5d3c8; --muted: #a6b8c8; --link: #ecd491; --rule: rgba(226,198,130,.24); --th-line: rgba(226,198,130,.36); --th-card: rgba(14,40,70,.6); --gold: #e2c682; }
  .theme-projects { --th-night: #0d141b; --th-scrim: rgba(13,20,27,.87); --th-accent: #ecc98a; --th-h3: #f2e2bd; --th-h4: #a9bdd0; --ink: #e9edf1; --ink-soft: #cdd6de; --muted: #9fb0bf; --link: #f0cf8f; --rule: rgba(185,199,214,.2); --th-line: rgba(185,199,214,.3); --th-card: rgba(24,34,44,.66); --gold: #ecc98a; }
  .theme-alfvenons { --th-night: #0a0519; --th-scrim: rgba(10,5,25,.87); --th-accent: #ffbe3c; --th-h3: #f0a6df; --th-h4: #b6a4f5; --ink: #efe9f8; --ink-soft: #cfc6e4; --muted: #ab9fc9; --link: #ffcf6b; --rule: rgba(205,70,170,.32); --th-line: rgba(200,160,240,.3); --th-card: rgba(25,12,56,.62); --gold: #ffbe3c; }
  .theme-scienceide { --th-night: #0a2a58; --th-scrim: rgba(9,38,82,.88); --th-accent: #ffffff; --th-h3: #dbe9ff; --th-h4: #b9d3f7; --ink: #f3f7ff; --ink-soft: #d6e3f8; --muted: #a9c3e6; --link: #ffe08a; --rule: rgba(226,238,255,.32); --th-line: rgba(226,238,255,.42); --th-card: rgba(8,36,80,.55); --gold: #ffe08a; }
  .theme-ale { --th-night: #030810; --th-scrim: rgba(3,8,16,.87); --th-accent: #f2b64f; --th-h3: #7fdcd4; --th-h4: #a8e8e0; --ink: #e9f0f2; --ink-soft: #c7d6da; --muted: #93a9b0; --link: #f6c674; --rule: rgba(127,220,212,.26); --th-line: rgba(127,220,212,.3); --th-card: rgba(6,22,30,.62); --gold: #f2b64f; }
  .theme-solar { --th-night: #0e0603; --th-scrim: rgba(14,6,3,.87); --th-accent: #ffb648; --th-h3: #ffd696; --th-h4: #ffc27a; --ink: #f6eadb; --ink-soft: #dcc8b2; --muted: #b89f88; --link: #ffc873; --rule: rgba(255,170,80,.26); --th-line: rgba(255,170,80,.34); --th-card: rgba(36,15,6,.62); --gold: #ffb648; }
  .theme-lingtai { --th-night: #e6e4dd; --th-scrim: rgba(230,228,221,.9); --th-accent: #1c1b1f; --th-h3: #2a2a2e; --th-h4: #8f2a1b; --ink: #1c1b1f; --ink-soft: #3b3b3f; --muted: #5d5c5c; --link: #92261a; --rule: rgba(28,27,31,.2); --th-line: rgba(28,27,31,.3); --th-card: rgba(240,238,232,.82); --gold: #ad3824; }

  /* ---------- full-page themes: structure ---------- */
  .th-full { background: var(--th-night); color: var(--ink); --paper: var(--th-night); --card: var(--th-card); --cap: transparent; }
  .th-dark { color-scheme: dark; }
  .th-full .hero { background: none; border: 0; overflow: visible; min-height: min(80vh, 760px); display: flex; align-items: center; }
  .th-full .hero-inner { width: 100%; padding-top: 40px; padding-bottom: 54px; }
  .th-full .hero-canvas { position: fixed; left: 0; top: 0; width: 100%; height: 100vh; height: 100lvh; z-index: -1; }
  .th-full .hero-waves { display: none; }
  .th-full .hero .post-title { font-size: clamp(50px, 6.2vw, 92px); line-height: 1.02; max-width: 10em; padding-bottom: .06em; filter: drop-shadow(0 0 20px var(--th-night)); }
  .th-full .hero .lede { max-width: 33rem; margin-top: 16px; text-shadow: 0 0 14px var(--th-night), 0 0 5px var(--th-night), 0 0 2px var(--th-night); }
  .th-full .hero .crumbs, .th-full .hero .crumbs a { color: var(--ink-soft); text-shadow: 0 0 8px var(--th-night), 0 0 3px var(--th-night); }
  .th-full .hero .crumbs a:hover { color: var(--th-accent); }
  .th-full .hero-hint { bottom: 12px; color: var(--ink-soft); background: color-mix(in srgb, var(--th-night) 72%, transparent); padding: 2px 8px 3px; border-radius: 3px; }
  html:not(.scene-on) .th-full .hero { min-height: 0; }
  .th-full .page-content { position: relative; isolation: isolate; padding-top: 62px; }
  .th-full .page-content::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, transparent, var(--th-scrim) max(0px, calc(50% - 556px)), var(--th-scrim) min(100%, calc(50% + 556px)), transparent); -webkit-mask-image: linear-gradient(transparent, #000 56px); mask-image: linear-gradient(transparent, #000 56px); }
  .th-full .site-footer { background: var(--th-scrim); border-top-color: var(--rule); }
  .th-full .site-footer a { text-decoration-color: var(--rule); }
  .th-full .site-header { background: color-mix(in srgb, var(--th-night) 64%, transparent); border-bottom: 1px solid var(--th-line); }
  .th-full .post-content h2 { color: var(--th-accent); border-top-color: var(--rule); font-family: "Cormorant Garamond", Georgia, serif; font-weight: 600; font-size: 34px; }
  html[lang=lzh] .th-full .post-content h2 { font-family: "Noto Serif SC", "Songti SC", serif; font-size: 28px; }
  .th-full .post-content h3 { color: var(--th-h3); }
  .th-full .post-content h4 { color: var(--th-h4); }
  .th-full .post-content h4.links { color: inherit; }
  .th-full .post-content h3 .tag { color: var(--th-night); background: var(--th-accent); border-color: var(--th-accent); }
  .th-full a:hover { color: var(--ink); }
  .th-full .btn { background: var(--th-accent); color: var(--th-night); }
  .th-full .btn:hover { background: var(--ink); color: var(--th-night); }
  .th-full .btn.ghost { background: transparent; color: var(--link); border: 1px solid var(--th-line); }
  .th-full .btn.ghost:hover { background: var(--th-card); color: var(--ink); }
  .th-full .hero .btn { background: var(--th-accent); }
  .th-full .hero .btn.ghost-dark { background: rgba(255,255,255,.06); color: var(--ink); border: 1px solid var(--th-line); }
  .th-full .hero .btn.ghost-dark:hover { background: rgba(255,255,255,.14); color: #fff; }
  .th-full .stat { background: var(--th-card); border-color: var(--rule); border-top: 2px solid var(--th-accent); border-radius: 2px; }
  .th-full .stat b { color: var(--th-accent); font-family: "Cormorant Garamond", Georgia, serif; font-size: 36px; font-weight: 500; font-variant-numeric: lining-nums; }
  .th-full .stat span { color: var(--ink-soft); }
  .th-full .stat.gold { border-top-color: var(--gold); }
  .th-full .stat:hover { box-shadow: none; }
  .th-full .linkrow a::before { color: var(--th-accent); }
  .th-full code { background: var(--th-card); color: var(--ink); }
  .th-full .reflist li::before { background: var(--th-accent); }
  .th-full .support { color: var(--ink-soft); }
  .th-full :focus-visible { outline-color: var(--th-accent); }

  /* no white on these pages. Data figures have dark versions on transparent paper with their data pixels untouched (picture.dark-fig, _src/make_dark_figures.py); schematics and screenshots are inverted with their hues kept and screened into the page. Click-to-enlarge and print show the originals */
  picture.dark-fig { display: contents; }
  .wp-caption img.movie-print { display: none; }
  .th-dark :is(img[src*="lingtai-network"], video:has(source[src*="lingtai-network"]), video[src*="lingtai-network"], img[src*="scienceide-overview"], img[src*="scienceide-pipeline"], img[src*="scienceide-thumb"], img[src*="spaw-constant"]), .th-dark .fig-pad > svg { filter: invert(1) hue-rotate(180deg); mix-blend-mode: screen; }
  .theme-lingtai :is(video:has(source[src*="lingtai-network"]), video[src*="lingtai-network"]), .theme-lingtai .fig-pad > svg { mix-blend-mode: multiply; }
  .th-full .fig-pad, .th-full .wp-caption video, .th-full .focus-card .thumb, .th-full .topic .media, .th-full .sw .sw-thumb, .th-full .explorer { background: transparent; }
  .th-full .reveal { opacity: 1; transform: none; transition: none; }
  .th-dark #lightbox { background: rgba(3,6,14,.95); }
  .th-dark #lightbox img { border-color: transparent; }

  /* every other light surface of the site's paper look, in the theme's colours */
  .th-dark .lede { color: var(--ink-soft); }
  .th-dark .sub-menu { background: var(--th-night); border-color: var(--th-line); }
  .th-dark .sub-menu a { color: var(--ink); }
  .th-dark .sub-menu a:hover { background: var(--th-card); color: var(--th-accent); }
  .th-dark .toc a { background: var(--th-card); border-color: var(--th-line); color: var(--link); }
  .th-dark .toc a:hover { background: var(--th-accent); border-color: var(--th-accent); color: var(--th-night); }
  .th-dark .about-side { border-left-color: var(--rule); border-top-color: var(--rule); }
  .th-dark .about-side h4 { color: var(--muted); }
  .th-dark .about-side .award { color: var(--th-accent); }
  .th-dark .focus-card { background: var(--th-card); color: var(--ink); box-shadow: 0 0 0 1px var(--th-line); }
  .th-dark .focus-card:hover { color: var(--ink); box-shadow: 0 0 0 1px var(--th-accent); }
  .th-dark .focus-card .thumb { border-bottom-color: var(--rule); }
  .th-dark .focus-card h3 { color: var(--th-h3); }
  .th-dark .focus-card p { color: var(--ink-soft); }
  .th-dark .news li { border-bottom-color: var(--rule); }
  .th-dark .topic { border-top-color: var(--rule); }
  .th-dark .topic h3 a { color: var(--th-h3); }
  .th-dark .topic .media { box-shadow: 0 0 0 1px var(--th-line); }
  .th-dark .topic .media:hover { box-shadow: 0 0 0 1px var(--th-accent); }
  .th-dark .pubs li { border-bottom-color: var(--rule); }
  .th-dark .pubs li:hover { background: var(--th-card); }
  .th-dark .pubs li::before { color: var(--muted); }
  .th-dark .pubs .yr { color: var(--th-accent); }
  .th-dark .pub-filter { background: color-mix(in srgb, var(--th-night) 90%, transparent); border-color: var(--th-line); box-shadow: none; }
  .th-dark .pub-filter input { background: var(--th-card); border-color: var(--th-line); color: var(--ink); }
  .th-dark .pub-filter input::placeholder { color: var(--muted); }
  .th-dark .pub-filter input:focus { border-color: var(--th-accent); box-shadow: 0 0 0 3px rgba(226,198,130,.16); }
  .th-dark .pub-filter button { background: transparent; border-color: var(--th-line); color: var(--link); }
  .th-dark .pub-filter button[aria-pressed=true] { background: var(--th-accent); border-color: var(--th-accent); color: var(--th-night); }
  .th-dark .sw { border-bottom-color: var(--rule); }
  .th-dark .sw .sw-thumb { box-shadow: 0 0 0 1px var(--th-line); }
  .th-dark .sw .sw-thumb .glyph { color: var(--th-accent); }
  .th-dark .misc-card { background: var(--th-card); border-color: var(--th-line); border-top-color: var(--th-accent); color: var(--ink); }
  .th-dark .misc-card:hover { color: var(--ink); border-top-color: var(--ink); box-shadow: 0 0 0 1px var(--th-line); }
  .th-dark .cv-toc { background: color-mix(in srgb, var(--th-night) 92%, transparent); border-bottom-color: var(--rule); }
  .th-dark .cv-toc a:hover { background: var(--th-card); color: var(--th-accent); }
  .th-dark .cv-toc a.on { background: var(--th-accent); color: var(--th-night); }
  .th-dark .cv-row:hover { background: var(--th-card); }
  body.th-dark .cv h2 { color: var(--th-accent) !important; border-top-color: var(--th-line) !important; }
  body.th-dark .cv h3.cvsub { color: var(--th-h3) !important; }
  .theme-cv .hero .post-title { font-size: clamp(44px, 5vw, 72px); }
  .theme-cv .hero .lede { max-width: min(44rem, 62vw); }

  /* the 自述 becomes gold on indigo paper, as sutras were written */
  .th-dark .zishu { background-color: #0a1536; background-image: radial-gradient(rgba(226,198,130,.13) 1px, transparent 1.2px), radial-gradient(rgba(226,198,130,.07) 1px, transparent 1.4px); color: #ecd491; box-shadow: 0 0 0 1px var(--th-line); }
  .th-dark .zishu-scroll { border-color: var(--rule); }
  .th-dark .zishu-scroll h2 { color: #f6dc97; }
  .th-dark .zishu-scroll p { color: #ead9a6; }
  .th-dark .zishu-en .k { color: #d6bd80; }
  .th-dark .zishu-en p { color: #ddd6c2; }
  .th-dark .zishu-en .src { color: #a9b6cb; }
  .th-dark .zishu-en .src a { color: #ecd491; }
  .th-dark .zishu-seal .seal { color: #d9553f; }

  /* Travel's menu too */
  .page-travel .sub-menu { background: #060c1c; border-color: rgba(226,198,130,.34); }
  .page-travel .sub-menu a { color: #e0d9c5; }
  .page-travel .sub-menu a:hover { background: rgba(226,198,130,.12); color: #ecd491; }

  /* the rest of a figure's frame */
  .th-full .wp-caption { background: transparent; border-radius: 3px; box-shadow: 0 0 0 1px var(--th-line), 0 14px 34px rgba(0,0,0,.34); }
  .th-full .wp-caption:hover { box-shadow: 0 0 0 1px var(--th-accent), 0 14px 34px rgba(0,0,0,.34); }
  .th-full .wp-caption dd { color: var(--ink-soft); background: var(--th-card); }
  .th-full .wp-caption dd a { color: var(--link); }
  .th-full .vtabs { background: var(--th-card); border-bottom-color: var(--rule); }
  .th-full .vtabs button { background: transparent; color: var(--link); border-color: var(--th-line); }
  .th-full .vtabs button[aria-selected=true] { background: var(--th-accent); color: var(--th-night); border-color: var(--th-accent); }
  .th-full .afl { box-shadow: 0 0 0 1px var(--th-line), 0 14px 34px rgba(0,0,0,.34); }
  .th-full .afl figcaption { background: var(--th-card); color: var(--ink-soft); }

  /* ---------- ScienceIDE: cyanotype, lettered like a drawing ---------- */
  .theme-scienceide .hero .post-title, .theme-scienceide .hero .post-title .gilt { background: none; -webkit-background-clip: border-box; background-clip: border-box; color: #fff; font-family: "B612 Mono", var(--mono); font-weight: 400; letter-spacing: -.02em; font-size: clamp(38px, 4.6vw, 66px); animation: ink-reveal 1.3s cubic-bezier(.2,.7,.2,1) .1s both; }
  .theme-scienceide .post-content h2 { font-family: "B612 Mono", var(--mono); font-weight: 400; font-size: 24px; letter-spacing: -.01em; border-top: 0; padding-top: 12px; background: linear-gradient(var(--th-line), var(--th-line)) 0 0 / 100% 1px no-repeat, linear-gradient(var(--th-line), var(--th-line)) 0 0 / 1px 8px no-repeat, linear-gradient(var(--th-line), var(--th-line)) 100% 0 / 1px 8px no-repeat; }
  html[lang=lzh] .theme-scienceide .post-content h2 { font-family: "Noto Serif SC", "Songti SC", serif; }
  .theme-scienceide .btn { background: #ffe08a; color: #0a2a58; }
  .theme-scienceide .btn:hover { background: #fff0c0; color: #0a2a58; }
  .theme-scienceide .btn.ghost { background: transparent; color: var(--link); }
  .theme-scienceide .btn.ghost:hover { background: var(--th-card); color: var(--ink); }
  .theme-scienceide .stat { border: 1px solid var(--th-line); border-top: 1px solid var(--th-line); background: rgba(8,36,80,.5); }
  .theme-scienceide .stat b { font-family: var(--nav); font-size: 27px; font-weight: 500; color: #fff; }
  .theme-scienceide .stats { gap: 0; }
  .theme-scienceide .stat { border-radius: 0; margin-left: -1px; }
  .theme-scienceide .wp-caption { outline: 1px solid var(--th-line); outline-offset: 4px; }
  .sci-readout { position: absolute; z-index: 2; font-family: var(--mono); font-size: 12px; line-height: 1.35; color: #dbe9ff; white-space: pre-wrap; max-width: 34rem; pointer-events: none; text-shadow: 0 0 6px #0a2a58; }
  .sci-readout.fail { color: #ffd36b; }

  /* ---------- LingTai: ink on moon-grey paper, one cinnabar seal colour ---------- */
  .theme-lingtai { color-scheme: light; }
  .theme-lingtai .hero .post-title, .theme-lingtai .hero .post-title .gilt { background: none; -webkit-background-clip: border-box; background-clip: border-box; color: #1c1b1f; filter: drop-shadow(0 0 16px #e6e4dd); animation: ink-reveal 1.3s cubic-bezier(.2,.7,.2,1) .1s both; }
  .theme-lingtai .hero .post-title .zh { color: #92261a; text-shadow: none; }
  .theme-lingtai .hero .lede { color: #2c2c30; text-shadow: 0 0 12px #e6e4dd, 0 0 5px #e6e4dd, 0 0 2px #e6e4dd; }
  .theme-lingtai .hero .crumbs, .theme-lingtai .hero .crumbs a { color: #4d4c4e; text-shadow: 0 0 8px #e6e4dd; }
  .theme-lingtai .site-header { background: rgba(28,27,31,.9); border-bottom: 1px solid rgba(28,27,31,.5); }
  .theme-lingtai .site-nav .menu > li.current { border-bottom-color: #d9553f; }
  .theme-lingtai .btn { background: #1c1b1f; color: #f0eee8; }
  .theme-lingtai .btn:hover { background: #92261a; color: #fff; }
  .theme-lingtai .btn.ghost { color: #1c1b1f; background: #e6e4dd; border-color: rgba(28,27,31,.45); }
  .theme-lingtai .btn.ghost:hover { background: #f0eee8; color: #92261a; }
  .theme-lingtai .wp-caption { box-shadow: 0 0 0 1px var(--th-line); }
  .theme-lingtai .wp-caption:hover { box-shadow: 0 0 0 1px #92261a; }
  .theme-lingtai .post-content h2 { font-family: "Noto Serif SC", "Songti SC", Georgia, serif; font-weight: 600; font-size: 28px; }

  /* the title stops short of the Sun */
  .theme-solar .hero .post-title { font-size: clamp(44px, 5vw, 74px); max-width: 8.4em; }
  html[lang=lzh] .theme-solar .hero .post-title { font-size: clamp(40px, 4.4vw, 64px); max-width: 7.2em; }

}
@media screen and (max-width: 900px) {
  .th-dark .site-nav .menu, .page-travel .site-nav .menu { background: #0a1224; border-color: rgba(226,198,130,.3); }
  .th-dark .site-nav .menu > li > a, .page-travel .site-nav .menu > li > a { color: #ece6d6; }
  .th-dark .sub-menu, .page-travel .sub-menu { background: transparent; }
  .th-dark .sub-menu a, .page-travel .sub-menu a { color: #c9c6ba; }
  .theme-lingtai .site-nav .menu > li > a { color: #005587; }
}
@media screen and (max-width: 720px) {
  .th-full .hero { min-height: min(74vh, 640px); align-items: flex-start; }
  .th-full .post-content h2 { font-size: 28px; }
}
@media screen and (prefers-reduced-motion: reduce) {
  html.scene-on .hero-canvas { transition: none; opacity: 1; }
  .pub-flash { animation: none; }
}
@media print { .pub-years, .scene-label, .sci-readout, .hero-hint { display: none !important; } }
@media print { .ale-ray { opacity: 1 !important; transform: none !important; } }
@media print { #small-collision-video { display: none !important; } }
