/* World Models Across the Embodied Loop: project page.
   Plain academic layout, light theme only. One accent (the paper's teal #138A8A); the paper's paradigm colours
   (sky I, violet II, teal III) appear only where they encode Paradigm I, II or III. */

:root {
  --text: #1b1b1b;
  --text-2: #4d4d4d;          /* secondary text, 8.5:1 on white */
  --text-3: #636363;          /* captions and notes, 6:1 on white */
  --rule: #e2e2e2;
  --rule-2: #c9c9c9;
  --soft: #f6f7f7;
  --accent: #138A8A;          /* the paper's teal: rules, marks, focus */
  --accent-ink: #0b6b6b;      /* teal for text and filled controls, 6.3:1 on white */
  --accent-soft: #e6f3f3;
  --p1: #4A9FE0; --p1-ink: #1d68a8; --p1-soft: #e3f0fb;
  --p2: #8C7AE6; --p2-ink: #5541b8; --p2-soft: #ece8fb;
  --p3: #2AB7B7; --p3-ink: #0b6b6b; --p3-soft: #ddf4f4;
  --serif: "Source Serif 4", "Source Serif Pro", Georgia, "Times New Roman", serif;
  --sans: "Source Sans 3", "Source Sans Pro", "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  --maxw: 1100px;
  --prose: 46rem;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: 16px; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: #fff; color: var(--text); font: 400 17px/1.6 var(--sans); overflow-wrap: break-word; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent-ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
sup { line-height: 0; }
i, em { font-style: italic; }
.sr-only { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 16px; top: -60px; background: var(--text); color: #fff; padding: 8px 14px; border-radius: 4px; z-index: 10; }
.skip:focus { top: 12px; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.prose { max-width: var(--prose); }

h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; color: var(--text); letter-spacing: 0; }
/* Source Serif 4 is loaded with its optical-size axis; pin the text cut so that large headings are not narrowed */
h1, h2, h3, h4, .rule-out .verdict, .checks dt { font-variation-settings: 'opsz' 18; }
h2 { font-size: 1.75rem; line-height: 1.25; margin: 0 0 .9rem; }
h3 { font-size: 1.3rem; line-height: 1.3; margin: 2.4rem 0 .6rem; }
h4 { font-size: 1.08rem; line-height: 1.35; margin: 1.6rem 0 .4rem; }
p { margin: 0 0 1rem; }
.small, .note { font-size: .94rem; color: var(--text-2); }

/* ------------------------------------------------------------------ header */
.masthead { padding: 56px 0 8px; text-align: center; }
.title { font-size: clamp(1.7rem, 3.4vw, 2.5rem); line-height: 1.22; margin: 0 auto 1.4rem; max-width: 26em; }
.title-sub { display: block; font-size: .64em; font-weight: 400; line-height: 1.35; margin-top: .45em; color: #2b2b2b; }
.authors { font-size: 1.08rem; line-height: 1.75; margin: 0 auto .5rem; max-width: 54rem; text-wrap: balance; }
.author { white-space: nowrap; }
.authors sup { font-size: .7em; margin-left: 1px; }
.affils { font-size: .98rem; line-height: 1.7; color: var(--text-2); margin: 0 auto .2rem; max-width: 54rem; text-wrap: balance; }
.affil { white-space: nowrap; margin: 0 .55em; display: inline-block; }
.affils sup { font-size: .72em; margin-right: 2px; }
.corr { font-size: .9rem; color: var(--text-3); margin: 0 0 1.5rem; }
.logos { list-style: none; margin: 0 auto 1.8rem; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 18px 30px; }
.logos li { display: flex; align-items: center; }
.logos img { height: 42px; width: auto; max-width: none; }
.logos img.logo-xiaomi { height: 32px; }
.logos img.logo-tongji { height: 46px; }
.logos img.logo-ntu { height: 46px; }
.logos img { flex: none; }
.buttons { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 0 0 1.2rem; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 8px 18px; border-radius: 999px; border: 1px solid #1f1f1f; background: #1f1f1f; color: #fff; font-size: .98rem; font-weight: 600; line-height: 1.3; text-decoration: none; }
.btn:hover { background: #3a3a3a; border-color: #3a3a3a; text-decoration: none; }
.btn svg { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.btn:disabled { background: #efefef; border-color: #dcdcdc; color: #575757; cursor: not-allowed; }
.toc { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 22px; font-size: .95rem; padding: 14px 0 0; border-top: 1px solid var(--rule); max-width: 60rem; margin: 0 auto; text-wrap: balance; }
.toc a { color: var(--text-2); text-decoration: none; padding: 2px 0; }
.toc a:hover { color: var(--accent-ink); text-decoration: underline; }

/* ------------------------------------------------------------------ sections, figures */
main { padding-bottom: 24px; }
.section { padding: 56px 0 0; }
.section > .container::before { content: ""; display: block; border-top: 1px solid var(--rule); margin-bottom: 28px; }
.abstract { text-align: left; hyphens: manual; }

.figure { margin: 28px 0 8px; }
.figure img { width: 100%; border: 0; }
.figure figcaption { max-width: var(--prose); margin: 14px 0 0; font-size: .95rem; line-height: 1.55; color: var(--text-2); }
.figure figcaption p { margin: 0 0 .5rem; }
.fig-note { font-size: .86rem; color: var(--text-3); }
.teaser { margin-top: 36px; }

.tex .katex { font-size: 1.04em; }
.formula { font-size: 1.12rem; margin: .4rem 0 .5rem; overflow-x: auto; overflow-y: hidden; padding: 2px 0; }

/* three paradigms */
.paradigms { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 28px; row-gap: 0; margin: 32px 0 12px; }
.paradigm { border-top: 3px solid var(--pc); padding-top: 14px; min-width: 0; }
/* heading, place, formula, gloss and list line up across the three columns */
@supports (grid-template-rows: subgrid) {
  .paradigms { grid-template-rows: repeat(5, auto); }
  .paradigm { display: grid; grid-row: span 5; grid-template-rows: subgrid; align-content: start; }
}
.paradigm.p1 { --pc: var(--p1); --pi: var(--p1-ink); --ps: var(--p1-soft); }
.paradigm.p2 { --pc: var(--p2); --pi: var(--p2-ink); --ps: var(--p2-soft); }
.paradigm.p3 { --pc: var(--p3); --pi: var(--p3-ink); --ps: var(--p3-soft); }
.paradigm h3 { margin: 0 0 .2rem; font-size: 1.18rem; }
.paradigm h3 .pbadge, .trunk h3 .pbadge { margin-right: .3em; vertical-align: .12em; }
.pbadge { display: inline-block; min-width: 2em; padding: 0 .4em; border-radius: 4px; font: 600 .82rem/1.6 var(--sans); text-align: center; color: var(--pi); background: var(--ps); border: 1px solid var(--pc); flex: none; }
.p1 .pbadge, .pbadge.p1 { --pc: var(--p1); --pi: var(--p1-ink); --ps: var(--p1-soft); }
.p2 .pbadge, .pbadge.p2 { --pc: var(--p2); --pi: var(--p2-ink); --ps: var(--p2-soft); }
.p3 .pbadge, .pbadge.p3 { --pc: var(--p3); --pi: var(--p3-ink); --ps: var(--p3-soft); }
.where { margin: 0 0 .2rem; color: var(--text-2); font-style: italic; }
.gloss { font-size: .9rem; color: var(--text-3); margin: 0 0 .6rem; }
.paradigm dl { margin: .6rem 0 0; }
.paradigm dt { font-weight: 600; font-size: .92rem; margin-top: .7rem; }
.paradigm dd { margin: .1rem 0 0; font-size: .97rem; }
.objective { margin: 22px 0 0; padding: 14px 18px; background: var(--soft); border-left: 3px solid var(--accent); }

/* assignment rule form */
.rule { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 28px; margin-top: 10px; align-items: start; }
.rule-questions { display: grid; gap: 12px; }
.rq { margin: 0; padding: 14px 18px 12px; border: 1px solid var(--rule-2); border-radius: 6px; min-width: 0; }
.rq legend { float: left; width: 100%; font-weight: 600; padding: 0; margin: 0 0 .3rem; line-height: 1.4; }
.rq legend + * { clear: both; }
.rq .hint { font-size: .92rem; color: var(--text-2); margin: 0 0 .4rem; }
.rq .options { display: flex; flex-direction: column; gap: 4px; }
.rq label { display: flex; gap: 10px; align-items: flex-start; padding: 3px 0; cursor: pointer; }
.rq input { margin: .32em 0 0; accent-color: var(--accent-ink); width: 16px; height: 16px; flex: none; }
.rq:disabled { color: #5f5f5f; border-color: var(--rule); background: #fafafa; }
.rq:disabled legend, .rq:disabled .hint { color: #595959; }
.rq:disabled label { cursor: default; }
.rule-side { display: grid; gap: 14px; justify-items: start; }
.rule-side > * { width: 100%; }
.rule-side > .btn-plain { width: auto; }
.nowrap { white-space: nowrap; }
.rule-out { display: block; min-height: 120px; padding: 14px 18px; border: 1px solid var(--rule-2); border-radius: 6px; background: var(--soft); }
.rule-out .verdict { display: flex; align-items: center; gap: 10px; font: 600 1.15rem/1.3 var(--serif); margin: 0 0 .3rem; }
.rule-out p { margin: .3rem 0 0; font-size: .95rem; color: var(--text-2); }
.rule-out .pending { color: var(--text-3); font-size: .95rem; margin: 0; }

/* fields */
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field-label { font-size: .88rem; font-weight: 600; color: var(--text-2); }
.field input, .field select { height: 40px; padding: 0 12px; border: 1px solid #8f8f8f; border-radius: 6px; background: #fff; font-size: 1rem; min-width: 0; width: 100%; }
.field select { padding-right: 32px; }
.field input::placeholder { color: #737373; }
.toolbar { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: flex-end; margin: 18px 0 12px; }
.toolbar .field { flex: 0 1 200px; }
.toolbar .field.grow { flex: 1 1 280px; }
.btn-plain { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 7px 16px; border: 1px solid #8f8f8f; border-radius: 6px; background: #fff; font-size: .95rem; font-weight: 600; color: var(--text); line-height: 1.3; }
.btn-plain:hover { background: var(--soft); border-color: #5c5c5c; }
.btn-small { padding: 3px 10px; font-size: .86rem; font-weight: 600; border: 1px solid #a3a3a3; border-radius: 4px; background: #fff; color: var(--text); text-decoration: none; line-height: 1.4; display: inline-block; }
a.btn-small { color: var(--accent-ink); }
.btn-small:hover { border-color: var(--accent); background: var(--accent-soft); text-decoration: none; }

/* ------------------------------------------------------------------ taxonomy */
.legend-line { font-size: .9rem; color: var(--text-2); margin: 0 0 14px; }
.mark { color: var(--text); font-weight: 600; }
.tag-mini { display: inline-block; font: 600 .74rem/1.3 var(--sans); padding: 0 4px; border: 1px solid #9a9a9a; border-radius: 3px; color: var(--text-2); vertical-align: 1px; }
.tax { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, .95fr); gap: 28px; }
.trunk { border-top: 3px solid var(--pc); padding-top: 10px; min-width: 0; }
.trunk.p1 { --pc: var(--p1); --pi: var(--p1-ink); --ps: var(--p1-soft); }
.trunk.p2 { --pc: var(--p2); --pi: var(--p2-ink); --ps: var(--p2-soft); }
.trunk.p3 { --pc: var(--p3); --pi: var(--p3-ink); --ps: var(--p3-soft); }
.trunk h3 { margin: 0; font-size: 1.12rem; }
.trunk .n { margin: .1rem 0 .3rem; font-size: .9rem; color: var(--text-3); }
.tax-count { min-height: 1.6em; margin: -4px 0 10px; font-size: .92rem; color: var(--text-2); }
.trunk h4 { font: 600 .95rem/1.35 var(--sans); margin: .9rem 0 .4rem; color: var(--text-2); display: flex; gap: 8px; align-items: baseline; }
.qbadge { display: inline-block; font: 600 .78rem/1.5 var(--sans); padding: 0 5px; border-radius: 3px; background: var(--accent-ink); color: #fff; flex: none; }
.leaves { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.leaf { display: inline-flex; align-items: baseline; gap: 5px; padding: 3px 9px; border: 1px solid #b9b9b9; border-radius: 4px; background: #fff; font-size: .93rem; line-height: 1.4; text-align: left; max-width: 100%; }
.leaf:hover { border-color: var(--pc); background: var(--ps); }
.leaf[aria-expanded="true"] { border-color: var(--pi); background: var(--ps); box-shadow: inset 0 0 0 1px var(--pi); }
.leaf.partner { border-color: var(--pi); box-shadow: inset 0 0 0 1px var(--pi); }
.leaf .yr { font-size: .8rem; color: var(--text-3); }
.leaf .lv, .leaf .ft { font: 600 .7rem/1.3 var(--sans); padding: 0 3px; border: 1px solid #9a9a9a; border-radius: 3px; color: var(--text-2); }
.leaf .sym { font-size: .82rem; color: var(--text); }
/* name filter: matches are marked, the others are drawn with a dashed border in grey text (still at least 4.5:1) */
.leaf.miss { color: #5f5f5f; border-color: #d4d4d4; border-style: dashed; }
.leaf.miss .yr, .leaf.miss .sym, .leaf.miss .lv, .leaf.miss .ft { color: #5f5f5f; }
.leaf.hit { border-color: var(--pi); background: var(--ps); box-shadow: inset 0 0 0 1px var(--pi); }
.detail { margin: 24px 0 0; padding: 16px 20px; border: 1px solid var(--rule-2); border-left: 3px solid var(--pc, var(--accent)); border-radius: 0 6px 6px 0; background: #fff; }
.detail.p1 { --pc: var(--p1); } .detail.p2 { --pc: var(--p2); } .detail.p3 { --pc: var(--p3); }
.detail h4 { margin: 0 0 .3rem; font-size: 1.15rem; }
.detail .facts { font-size: .92rem; color: var(--text-2); margin: 0 0 .5rem; }
.detail .ref { font-size: .95rem; margin: 0 0 .5rem; }
.detail .actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: .6rem; }
.detail:focus { outline: none; }
.detail:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ------------------------------------------------------------------ evidence map */
.filters { border: 0; margin: 6px 0 14px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 22px; }
.filters legend { font-size: .88rem; font-weight: 600; color: var(--text-2); padding: 0; margin-bottom: 4px; float: left; width: 100%; }
.filters label { display: inline-flex; gap: 8px; align-items: flex-start; font-size: .95rem; cursor: pointer; }
.filters label > span { min-width: 0; }
.filters input { margin: .3em 0 0; width: 16px; height: 16px; accent-color: var(--accent-ink); flex: none; }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
.evmap { border-collapse: separate; border-spacing: 4px; width: 100%; max-width: 860px; table-layout: fixed; }
.evmap col.c-row { width: 30%; }
.evmap col.c-tot { width: 9%; }
.evmap th, .evmap td { padding: 0; font-weight: 400; }
.evmap thead th { font-size: .9rem; line-height: 1.25; color: var(--text-2); text-align: center; vertical-align: bottom; padding: 0 2px 6px; }
.evmap thead th.wm { color: var(--accent-ink); font-weight: 600; }
.evmap tbody th, .evmap tfoot th { text-align: left; font-size: .95rem; line-height: 1.3; padding-right: 8px; }
.evmap .rowlab { display: flex; gap: 8px; align-items: baseline; }
.evmap td { text-align: center; vertical-align: middle; }
.evmap .cell { width: 100%; height: 52px; border: 1px solid transparent; border-radius: 4px; display: flex; flex-direction: column; align-items: center; justify-content: center; font: 600 1.12rem/1.1 var(--sans); }
.evmap .cell.empty { background: #f3f4f4; }
.evmap .cell small { font: 400 .78rem/1.2 var(--sans); }
.evmap button.cell:hover { border-color: #1b1b1b; }
.evmap button.cell[aria-pressed="true"] { border-color: #1b1b1b; box-shadow: inset 0 0 0 2px #1b1b1b; }
.evmap tbody td.wm .cell { box-shadow: inset 0 0 0 1.5px var(--accent); }
.evmap tbody td.wm button.cell[aria-pressed="true"] { box-shadow: inset 0 0 0 2px #1b1b1b; }
.evmap .tot { font-weight: 600; font-size: 1rem; }
.evmap tfoot th, .evmap tfoot td { border-top: 1px solid var(--rule-2); padding-top: 6px; }
.evmap tr.sep th, .evmap tr.sep td { border-top: 1px dashed var(--accent); padding-top: 4px; }
.evmap .short { display: none; }
.evkey, .scroll-hint { display: none; }
.evmap thead th .short { white-space: nowrap; }
.ev-list { margin-top: 18px; max-width: 860px; }
.ev-list h4 { margin: 0 0 .5rem; font-family: var(--sans); font-size: 1rem; display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; }
.ev-list h4 .count { font-weight: 400; color: var(--text-3); }
.ev-list ol { margin: 0; padding: 0 0 0 1.4em; }
.ev-list li { margin: 0 0 .6rem; padding-left: 2px; }
.ev-list .t { font-weight: 600; }
.ev-list .t a { color: var(--text); text-decoration-color: var(--accent); }
.ev-list .t a:hover { color: var(--accent-ink); }
.ev-list .m { display: block; font-size: .92rem; color: var(--text-2); }
.ev-list .tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 3px; align-items: center; }
.tag { font: 600 .76rem/1.4 var(--sans); padding: 0 5px; border: 1px solid #a3a3a3; border-radius: 3px; color: var(--text-2); }
.ev-list .linkbtn { font: 600 .82rem/1.4 var(--sans); background: none; border: 0; padding: 0; color: var(--accent-ink); text-decoration: underline; text-underline-offset: 2px; }

/* adaptation ladder */
.ladder { display: grid; grid-template-columns: minmax(0, 640px) minmax(0, 1fr); gap: 32px; align-items: start; }
.ladder-fig { margin-top: 6px; }
.ladder-fig figcaption { margin-left: 0; }
.rungs { margin: 6px 0 12px; }
.rungs > div { padding: 9px 0; border-bottom: 1px solid var(--rule); }
.rungs > div:first-child { padding-top: 0; }
.rungs dt { font-weight: 600; }
.rungs dt .lvl { display: inline-block; min-width: 2.2em; font: 600 .82rem/1.5 var(--sans); text-align: center; padding: 0 4px; margin-right: 8px; border-radius: 3px; border: 1px solid var(--accent); color: var(--accent-ink); }
.rungs dd { margin: .15rem 0 0; font-size: .96rem; color: var(--text-2); }
.rungs dd .ex { display: block; font-size: .9rem; color: var(--text-3); }
.sub { font-family: var(--sans); font-size: 1rem; margin: 28px 0 .2rem; }
.ladbars { max-width: 900px; display: grid; gap: 8px; margin-top: 8px; }
.ladrow { display: grid; grid-template-columns: 40px minmax(0, 1fr) 16rem; gap: 4px 12px; align-items: center; }
.ladrow .qbadge { justify-self: start; }
.ladbar { display: flex; height: 22px; border-radius: 3px; overflow: hidden; background: #f3f4f4; }
.ladfill { display: flex; height: 100%; }
.ladbar .seg { min-width: 0; }
.ladbar .seg + .seg { box-shadow: inset 1px 0 0 #fff; }
.ladnum { margin: 0; font-size: .92rem; color: var(--text-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ladnum b { display: inline-block; min-width: 1.4em; margin-right: 4px; text-align: right; color: var(--text); font-weight: 600; }
.ladkey { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: .88rem; color: var(--text-2); margin-top: 4px; padding-left: 52px; }
.ladkey i { display: inline-block; width: 12px; height: 12px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; border: 1px solid rgba(0, 0, 0, .15); }

/* ------------------------------------------------------------------ evaluators chart */
.chart-fig { margin-top: 18px; }
.chart-legend { list-style: none; margin: 0 0 6px; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 22px; font-size: .9rem; color: var(--text-2); }
.chart-legend li { display: inline-flex; align-items: center; gap: 7px; }
.chart-legend svg { width: 16px; height: 16px; flex: none; }
.lg-real { fill: #3a3a3a; }
.lg-sim { fill: #fff; stroke: #3a3a3a; stroke-width: 1.6; }
.lg-ring { fill: none; stroke: #3a3a3a; stroke-width: 1.4; stroke-dasharray: 3 2; }
.chart-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.chart { min-width: 640px; }               /* charts.js draws at least 640 px wide: no scaling on phones */
.chart svg { display: block; width: 100%; height: auto; }
.chart text { font-family: var(--sans); font-size: 13px; fill: var(--text-2); }
.chart .lbl { fill: var(--text); font-size: 14px; }
.chart .lbl-sub { fill: var(--text-3); font-size: 12.5px; }
.chart .axis path, .chart .axis line { stroke: #9a9a9a; }
.chart .axis text { font-size: 13px; fill: var(--text-2); }
.chart .grid line { stroke: #ececec; }
.chart .band { fill: #f3f4f4; }
.data-table { margin: 8px 0 0; }
.data-table summary { cursor: pointer; font-weight: 600; color: var(--accent-ink); padding: 4px 0; display: list-item; width: max-content; max-width: 100%; }
.data-table table { border-collapse: collapse; margin-top: 10px; font-size: .93rem; min-width: 640px; }
.data-table th, .data-table td { text-align: left; padding: 6px 12px 6px 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
.data-table th { font-weight: 600; color: var(--text-2); border-bottom-color: var(--rule-2); }
.data-table tbody th { color: var(--text); border-bottom-color: var(--rule); }
.data-table td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ------------------------------------------------------------------ protocol */
.checks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 36px; margin: 26px 0 8px; }
.checks > div { min-width: 0; }
.checks dt { font-family: var(--serif); font-weight: 600; font-size: 1.1rem; margin-bottom: .2rem; }
.checks dd { margin: 0; }

/* ------------------------------------------------------------------ library */
.lib-count { font-size: .93rem; color: var(--text-2); margin: 0 0 6px; }
.lib { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.lib li { padding: 11px 0; border-bottom: 1px solid var(--rule); display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1px 18px; }
.lib .t { font-weight: 600; line-height: 1.4; }
.lib .a { font-size: .95rem; color: var(--text-2); }
.lib .v { font-size: .93rem; color: var(--text-3); }
.lib .acts { grid-column: 2; grid-row: 1 / span 3; display: flex; gap: 6px; align-items: flex-start; }
.lib mark { background: #fff1b8; color: inherit; padding: 0 1px; }
.lib .empty { display: block; color: var(--text-2); }
#libMore { margin: 16px 0 0; }

/* ------------------------------------------------------------------ citation, footer */
.bib { border: 1px solid var(--rule-2); border-radius: 6px; background: var(--soft); }
.bib-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 12px 8px 20px; border-bottom: 1px solid var(--rule-2); font-size: .9rem; color: var(--text-2); font-weight: 600; }
/* the build script hard-wraps the entry at about 72 columns; narrow screens scroll it inside the box */
.bib pre { margin: 0; padding: 16px 20px 18px; font: 400 13.5px/1.65 var(--mono); white-space: pre; overflow-x: auto; }
.footer { margin-top: 56px; padding: 24px 0 40px; border-top: 1px solid var(--rule); font-size: .9rem; color: var(--text-3); }
.footer p { margin: 0 0 .4rem; }

/* tooltip, toast */
.tip { position: fixed; z-index: 20; pointer-events: none; max-width: 300px; background: #fff; border: 1px solid #9a9a9a; border-radius: 4px; padding: 8px 10px; font-size: .88rem; line-height: 1.45; box-shadow: 0 2px 8px rgba(0, 0, 0, .12); }
.tip b { font-weight: 600; }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: #1f1f1f; color: #fff; padding: 8px 16px; border-radius: 4px; font-size: .93rem; opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 30; }
.toast.on { opacity: 1; }

/* ------------------------------------------------------------------ responsive */
@media (max-width: 1100px) and (min-width: 901px) {
  .logos { gap: 16px 24px; }
  .logos img { height: 38px; }
  .logos img.logo-xiaomi { height: 29px; }
  .logos img.logo-tongji, .logos img.logo-ntu { height: 41px; }
}
@media (max-width: 900px) {
  .logos { display: grid; grid-template-columns: repeat(3, auto); justify-content: center; justify-items: center; }
  .paradigms { grid-template-columns: 1fr; grid-template-rows: none; row-gap: 24px; }
  .paradigm { display: block; grid-row: auto; }
  .rule { grid-template-columns: 1fr; }
  .tax { grid-template-columns: 1fr; gap: 24px; }
  .ladder { grid-template-columns: 1fr; }
  .checks { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  body { font-size: 16px; }
  .container { padding: 0 16px; }
  .masthead { padding-top: 32px; }
  .title { font-size: 1.55rem; }
  .authors { font-size: 1rem; }
  .affils { font-size: .92rem; }
  .affil { margin: 0 .4em; white-space: normal; }
  .logos { grid-template-columns: repeat(2, auto); gap: 14px 28px; }
  .logos img { height: 30px; }
  .logos img.logo-xiaomi { height: 25px; }
  .logos img.logo-tongji { height: 34px; }
  .logos img.logo-ntu { height: 33px; }
  .btn { padding: 7px 14px; font-size: .93rem; }
  .toc { gap: 2px 16px; font-size: .92rem; }
  h2 { font-size: 1.5rem; }
  .section { padding-top: 40px; }
  .evmap { border-spacing: 3px; }
  .evmap col.c-row { width: 27%; }
  .evmap col.c-tot { width: 11%; }
  .evmap .full { display: none; }
  .evmap .short { display: inline; }
  .evmap .short.sr-only { display: block; }
  .evkey, .scroll-hint { display: block; margin: 8px 0 0; }
  .scroll-hint { margin: 0 0 4px; }
  .evmap thead th { font-size: .8rem; }
  .evmap tbody th, .evmap tfoot th { font-size: .82rem; padding-right: 2px; }
  .evmap .rowlab { flex-direction: column; gap: 2px; }
  .evmap .cell { height: 44px; font-size: .98rem; }
  .evmap .cell small { font-size: .7rem; }
  .evmap .tot { font-size: .9rem; }
  .lib li { grid-template-columns: 1fr; }
  .lib .acts { grid-column: 1; grid-row: auto; flex-direction: row; flex-wrap: wrap; margin-top: 6px; }
  .bib pre { padding: 14px 14px 16px; font-size: 12.5px; }
  .ladkey { padding-left: 0; }
  .ladrow { grid-template-columns: 40px minmax(0, 1fr); }
  .ladnum { grid-column: 2; }
  .toolbar .field { flex: 1 1 140px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
@media print {
  .buttons, .toc, .toolbar, .filters, #libMore, .skip { display: none !important; }
  .section { break-inside: auto; }
}
