/* ============ Design tokens ============ */
:root {
  --bg: #f5f2ea;
  --bg2: #efeadf;
  --surface: #fffdf8;
  --surface2: #faf7f0;
  --ink: #1f1c16;
  --ink2: #3b372e;
  --muted: #6f685a;
  --faint: #9a9284;
  --line: #e2dbcc;
  --line2: #d3cab8;
  --shadow: 0 1px 2px rgba(60, 48, 20, .05), 0 6px 24px rgba(60, 48, 20, .06);
  --shadow-lg: 0 2px 6px rgba(60, 48, 20, .06), 0 18px 48px rgba(60, 48, 20, .10);

  /* roles: 你 / 机器 / AI */
  --you: #c2410c;
  --you-soft: #fbe7da;
  --mach: #3f5f7a;
  --mach-soft: #e3ebf2;
  --ai: #5b4fd6;
  --ai-soft: #e9e6fb;

  --accent: var(--you);
  --code-bg: #f3efe5;
  --code-ink: #2a2620;
  --tk-key: #a3360b;
  --tk-str: #3f7a3a;
  --tk-com: #9a917f;
  --tk-num: #7a4fb0;
  --tk-type: #23608f;

  /* aspects */
  --a-mem: #c27a0e;
  --a-type: #2563eb;
  --a-err: #d4234a;
  --a-state: #9333ea;
  --a-conc: #0891b2;
  --a-expl: #5f8f12;
  --a-arch: #0f8a74;
  --a-tool: #c2378a;
  --a-ai: #3b3833;

  --serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", serif;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", "SF Mono", "Cascadia Code", Consolas, "Liberation Mono", monospace;

  --nav-w: 232px;
  --radius: 14px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #12110e; --bg2: #181712; --surface: #1b1a15; --surface2: #211f19;
    --ink: #ece6d6; --ink2: #d4cdbb; --muted: #a39b88; --faint: #7a7364;
    --line: #2d2a22; --line2: #3a362c;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 24px rgba(0,0,0,.25);
    --shadow-lg: 0 2px 6px rgba(0,0,0,.35), 0 18px 48px rgba(0,0,0,.4);
    --you: #f08a4b; --you-soft: #3a2316; --mach: #8fb3d1; --mach-soft: #1d2a35; --ai: #a59bff; --ai-soft: #25213f;
    --code-bg: #1f1d17; --code-ink: #e6dfcd;
    --tk-key: #f39a6b; --tk-str: #9ccc8a; --tk-com: #7d7564; --tk-num: #c5a3f0; --tk-type: #7fb8e6;
    --a-mem: #f0a53a; --a-type: #6b9cff; --a-err: #ff6b8a; --a-state: #c58bff; --a-conc: #3cc8e6;
    --a-expl: #a4d14a; --a-arch: #3fd0b0; --a-tool: #f079bd; --a-ai: #d9d2c2;
  }
}
:root[data-theme="dark"] {
  --bg: #12110e; --bg2: #181712; --surface: #1b1a15; --surface2: #211f19;
  --ink: #ece6d6; --ink2: #d4cdbb; --muted: #a39b88; --faint: #7a7364;
  --line: #2d2a22; --line2: #3a362c;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 24px rgba(0,0,0,.25);
  --shadow-lg: 0 2px 6px rgba(0,0,0,.35), 0 18px 48px rgba(0,0,0,.4);
  --you: #f08a4b; --you-soft: #3a2316; --mach: #8fb3d1; --mach-soft: #1d2a35; --ai: #a59bff; --ai-soft: #25213f;
  --code-bg: #1f1d17; --code-ink: #e6dfcd;
  --tk-key: #f39a6b; --tk-str: #9ccc8a; --tk-com: #7d7564; --tk-num: #c5a3f0; --tk-type: #7fb8e6;
  --a-mem: #f0a53a; --a-type: #6b9cff; --a-err: #ff6b8a; --a-state: #c58bff; --a-conc: #3cc8e6;
  --a-expl: #a4d14a; --a-arch: #3fd0b0; --a-tool: #f079bd; --a-ai: #d9d2c2;
}

/* ============ Base ============ */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 24px; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--sans); font-size: 17px; line-height: 1.78;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  min-width: 1180px;
}
a { color: inherit; text-decoration-color: var(--line2); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--accent); }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 700; letter-spacing: .01em; line-height: 1.35; margin: 0; }
p { margin: 0 0 .9em; }
code, kbd { font-family: var(--mono); font-size: .86em; background: var(--code-bg); padding: .1em .38em; border-radius: 5px; }
strong { font-weight: 650; }
em { font-style: normal; color: var(--you); font-weight: 600; }
::selection { background: var(--you-soft); }
button { font: inherit; color: inherit; cursor: pointer; }

/* ============ Left nav ============ */
#nav {
  position: fixed; inset: 0 auto 0 0; width: var(--nav-w); padding: 28px 18px 20px 26px;
  border-right: 1px solid var(--line); background: var(--bg); z-index: 30;
  display: flex; flex-direction: column; gap: 6px;
}
#nav .brand { font-family: var(--serif); font-size: 17px; font-weight: 700; line-height: 1.4; margin-bottom: 18px; }
#nav .brand small { display: block; font-family: var(--sans); font-weight: 400; font-size: 12px; color: var(--muted); margin-top: 4px; letter-spacing: .02em; }
#nav ol { list-style: none; margin: 0; padding: 0; counter-reset: s; }
#nav li a {
  display: flex; align-items: baseline; gap: 10px; padding: 6px 10px; margin-left: -10px; border-radius: 9px;
  text-decoration: none; color: var(--muted); font-size: 14.5px; line-height: 1.45; transition: background .15s, color .15s;
}
#nav li a .n { font-family: var(--mono); font-size: 11px; color: var(--faint); min-width: 18px; }
#nav li a:hover { background: var(--bg2); color: var(--ink); }
#nav li a.active { color: var(--ink); background: var(--surface); box-shadow: inset 2px 0 0 var(--you); }
#nav .spacer { flex: 1; }
#nav .progress { height: 3px; background: var(--line); border-radius: 3px; overflow: hidden; margin: 10px 0 12px; }
#nav .progress i { display: block; height: 100%; width: 0; background: var(--you); transition: width .1s linear; }
#nav .tools { display: flex; gap: 8px; }
.pill-btn {
  border: 1px solid var(--line2); background: var(--surface); border-radius: 999px; padding: 4px 12px; font-size: 13px; color: var(--muted);
}
.pill-btn:hover { color: var(--ink); border-color: var(--muted); }

/* ============ Main ============ */
main { margin-left: var(--nav-w); }
section.sec { padding: 96px 64px 40px; max-width: 1240px; margin: 0 auto; }
.prose { max-width: 760px; }
.sec-head { margin-bottom: 36px; max-width: 1000px; }
.sec-head .lede { max-width: 860px; }
.sec-head .kicker { font-size: 13px; letter-spacing: .14em; color: var(--you); font-weight: 600; margin-bottom: 10px; }
.sec-head h2 { font-size: 38px; margin-bottom: 14px; }
.sec-head .lede { font-size: 19px; color: var(--ink2); line-height: 1.75; }
.divider { height: 1px; background: var(--line); margin: 0 64px; max-width: 1112px; }

/* ============ Hero ============ */
#hero { padding-top: 72px; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 56px; align-items: start; }
.hero-kicker { font-size: 13px; letter-spacing: .16em; color: var(--muted); margin-bottom: 18px; }
.hero-title { font-size: 64px; line-height: 1.12; letter-spacing: .02em; margin-bottom: 18px; }
.hero-title .u { box-shadow: inset 0 -.16em 0 var(--you-soft); }
.hero-sub { font-size: 20px; color: var(--ink2); line-height: 1.65; margin-bottom: 30px; }
.question {
  border-left: 3px solid var(--you); padding: 6px 0 6px 20px; margin: 0 0 30px; font-family: var(--serif);
  font-size: 21px; line-height: 1.7; color: var(--ink);
}
.answer3 { counter-reset: a; display: grid; gap: 16px; margin-bottom: 30px; }
.answer3 > div { position: relative; padding-left: 44px; font-size: 16.5px; color: var(--ink2); }
.answer3 > div::before {
  counter-increment: a; content: counter(a); position: absolute; left: 0; top: 2px; width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center; font-family: var(--mono); font-size: 13px; color: var(--you); border: 1.5px solid var(--you);
}
.formula {
  font-family: var(--serif); font-size: 22px; line-height: 1.6; padding: 22px 26px; border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow); margin-bottom: 26px;
}
.formula b { font-weight: 700; }
.formula .r-you { color: var(--you); } .formula .r-mach { color: var(--mach); } .formula .r-ai { color: var(--ai); }
.hero-links { display: flex; gap: 12px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 999px; text-decoration: none; font-size: 15px;
  border: 1px solid var(--line2); background: var(--surface); transition: transform .15s, box-shadow .15s;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.btn.primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* line diagram (hero + section) */
.stack { background: var(--surface); border-radius: 20px; box-shadow: var(--shadow-lg); padding: 26px 26px 20px; position: sticky; top: 28px; }
.stack h4 { font-family: var(--sans); font-size: 13px; letter-spacing: .12em; color: var(--muted); font-weight: 600; margin-bottom: 14px; }
.stack .row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 12px; margin-bottom: 8px; }
.stack .row .t { font-weight: 600; font-size: 16px; }
.stack .row .d { font-size: 13.5px; color: var(--muted); line-height: 1.55; }
.stack .row .who { justify-self: end; display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.stack .row.you { background: var(--you-soft); }
.stack .row.ai { background: var(--ai-soft); }
.tag-role { font-size: 12px; padding: 2px 9px; border-radius: 999px; font-weight: 600; white-space: nowrap; }
.tag-role.you { color: var(--you); background: var(--surface); border: 1px solid var(--you); }
.tag-role.ai { color: var(--ai); background: var(--surface); border: 1px solid var(--ai); }
.tag-role.mach { color: var(--mach); background: var(--surface); border: 1px solid var(--mach); }
.the-line { position: relative; height: 26px; margin: 4px 0 12px; }
.the-line::before { content: ""; position: absolute; left: 0; right: 0; top: 12px; height: 3px; background: var(--you); border-radius: 3px; }
.the-line span {
  position: absolute; left: 50%; top: 0; transform: translateX(-50%); background: var(--surface); padding: 0 12px;
  font-size: 13px; font-weight: 700; color: var(--you); letter-spacing: .1em;
}
.stack .mach-bar {
  margin: 10px 0 0; padding: 10px 14px; border-radius: 12px; border: 1.5px dashed var(--mach); color: var(--mach); font-size: 13.5px; line-height: 1.6;
}
.stack .foot { font-size: 12.5px; color: var(--faint); margin-top: 12px; }

/* ============ Ladder (section 1) ============ */
.ladder { display: grid; gap: 10px; margin: 8px 0 40px; }
.rung {
  display: grid; grid-template-columns: 92px minmax(0, 1fr) minmax(0, 1fr); gap: 22px; align-items: center;
  background: var(--surface); border-radius: 14px; padding: 16px 22px; box-shadow: var(--shadow); position: relative;
}
.rung .yr { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.rung .gave { font-size: 16px; } .rung .gave b { font-family: var(--serif); }
.rung .by { font-size: 15px; color: var(--ink2); }
.rung .by .k { font-size: 12px; color: var(--mach); letter-spacing: .08em; display: block; font-weight: 600; }
.rung.q { border: 2px dashed var(--you); background: var(--you-soft); box-shadow: none; }
.rung.q .by .k { color: var(--you); }
.rung.q .by b { color: var(--you); font-size: 20px; }
.compare { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--surface); border-radius: 16px; overflow: hidden; box-shadow: var(--shadow); margin-bottom: 28px; }
.compare th, .compare td { padding: 13px 20px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); font-size: 15.5px; }
.compare th { font-family: var(--serif); font-size: 16px; background: var(--surface2); }
.compare td:first-child { color: var(--muted); width: 140px; font-size: 14px; }
.compare tr:last-child td { border-bottom: 0; }
.compare .ai-col { color: var(--ai); }
.callout {
  border-radius: var(--radius); padding: 22px 26px; background: var(--surface); box-shadow: var(--shadow); border-left: 4px solid var(--you);
  font-size: 17px; line-height: 1.8;
}
.callout .big { font-family: var(--serif); font-size: 21px; display: block; margin-bottom: 8px; }

/* ============ Timeline ============ */
.tl-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 36px; align-items: start; }
.tl-howto { font-size: 15px; color: var(--muted); background: var(--surface2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; margin-bottom: 26px; }
.tl-controls { display: flex; gap: 10px; margin-bottom: 18px; align-items: center; }
.era { margin: 46px 0 16px; display: flex; align-items: baseline; gap: 16px; position: sticky; top: 0; z-index: 5; background: var(--bg); padding: 12px 0 10px; }
.era:first-child { margin-top: 0; }
.era .yrs { font-family: var(--mono); font-size: 13px; color: var(--you); letter-spacing: .06em; }
.era h3 { font-size: 24px; }
.era .sub { font-size: 14px; color: var(--muted); }
.era-intro { font-size: 15.5px; color: var(--ink2); margin: -4px 0 18px; max-width: 720px; }

.tl { position: relative; padding-left: 34px; }
.tl::before { content: ""; position: absolute; left: 10px; top: 0; bottom: 0; width: 2px; background: var(--line); }
.card {
  position: relative; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 14px;
  transition: opacity .25s, transform .25s, box-shadow .25s; border: 1px solid transparent;
}
.card::before {
  content: ""; position: absolute; left: -29px; top: 22px; width: 12px; height: 12px; border-radius: 50%; background: var(--bg);
  border: 2px solid var(--line2); transition: all .2s;
}
.card.lit::before { background: var(--hl, var(--you)); border-color: var(--hl, var(--you)); transform: scale(1.25); }
.card.lit { border-color: var(--hl, var(--you)); }
.card.dim { opacity: .3; }
.card.dim:hover { opacity: .75; }
.card.flash { animation: flash 1.4s ease; }
@keyframes flash { 0%, 100% { box-shadow: var(--shadow); } 20% { box-shadow: 0 0 0 4px var(--you-soft), var(--shadow-lg); } }
.card-h { padding: 16px 20px 14px; cursor: pointer; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; }
.card-h .yrs { font-family: var(--mono); font-size: 12.5px; color: var(--muted); margin-bottom: 2px; }
.card-h h4 { font-size: 19px; margin-bottom: 4px; }
.card-h .one { font-size: 15px; color: var(--ink2); line-height: 1.65; margin: 0; }
.card-h .meta { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.dots { display: flex; gap: 5px; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.chev { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; color: var(--faint); transition: transform .25s; font-size: 13px; border: 1px solid var(--line); }
.card.open .chev { transform: rotate(180deg); color: var(--you); border-color: var(--you); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.chip {
  font-size: 12px; padding: 2px 9px; border-radius: 999px; border: 1px solid var(--line2); color: var(--muted); background: var(--surface);
  white-space: nowrap; line-height: 1.6;
}
button.chip:hover { color: var(--ink); border-color: var(--muted); }
.chip.p { border-color: var(--you); color: var(--you); }
.chip.lang { border-style: dashed; }
.card-b { display: none; padding: 2px 20px 20px; border-top: 1px solid var(--line); }
.card.open .card-b { display: block; }
.blk { margin-top: 16px; }
.blk > .lbl { font-size: 12.5px; letter-spacing: .12em; font-weight: 700; color: var(--muted); margin-bottom: 6px; display: flex; align-items: center; gap: 8px; }
.blk > .lbl::before { content: ""; width: 14px; height: 2px; background: currentColor; border-radius: 2px; }
.blk.why > .lbl { color: var(--a-err); }
.blk.show > .lbl { color: var(--a-type); }
.blk.cost > .lbl { color: var(--a-mem); }
.blk.law > .lbl { color: var(--you); }
.blk.ai > .lbl { color: var(--ai); }
.blk p, .blk li { font-size: 15.5px; line-height: 1.75; color: var(--ink2); }
.blk ul { margin: 0; padding-left: 1.2em; }
.show-grid { display: grid; grid-template-columns: 1fr; gap: 8px; }
.show-row { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 12px; font-size: 15px; line-height: 1.7; color: var(--ink2); }
.show-row .k { font-size: 12.5px; color: var(--muted); padding-top: 3px; font-weight: 600; }
.law-box { background: var(--you-soft); border-radius: 10px; padding: 10px 14px; font-size: 15.5px; color: var(--ink); }
.ai-box { background: var(--ai-soft); border-radius: 10px; padding: 10px 14px; font-size: 15.5px; color: var(--ink); }
.next-links { margin-top: 8px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; font-size: 13.5px; color: var(--muted); }
.next-links button { border: 1px solid var(--line2); background: var(--surface); padding: 2px 10px; border-radius: 999px; color: var(--mach); font-size: 13px; }
.next-links button:hover { border-color: var(--mach); }
.quote { margin: 16px 0 0; padding: 12px 16px; border-left: 3px solid var(--line2); color: var(--muted); font-size: 14.5px; line-height: 1.7; }
.quote .en { font-family: Georgia, "Times New Roman", serif; font-style: italic; color: var(--ink2); display: block; }
.quote .who { font-size: 12.5px; display: block; margin-top: 4px; }

/* code compare */
.codes { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; margin-top: 16px; }
.code { background: var(--code-bg); border-radius: 10px; overflow: hidden; border: 1px solid var(--line); }
.code .cap { font-size: 12px; color: var(--muted); padding: 6px 12px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 8px; font-weight: 600; }
.code pre { margin: 0; padding: 12px 14px; font-family: var(--mono); font-size: 13px; line-height: 1.6; color: var(--code-ink); overflow-x: auto; white-space: pre; }
.tk-k { color: var(--tk-key); font-weight: 600; } .tk-s { color: var(--tk-str); } .tk-c { color: var(--tk-com); font-style: italic; } .tk-n { color: var(--tk-num); } .tk-t { color: var(--tk-type); }

/* side panel */
.side { position: sticky; top: 20px; max-height: calc(100vh - 40px); overflow-y: auto; padding-right: 4px; scrollbar-width: thin; }
.panel { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 16px 14px; margin-bottom: 14px; }
.panel h5 { font-family: var(--sans); font-size: 12.5px; letter-spacing: .14em; color: var(--muted); margin: 0 0 10px; font-weight: 700; display: flex; justify-content: space-between; align-items: center; }
.panel h5 button { font-size: 12px; letter-spacing: 0; border: 0; background: none; color: var(--faint); padding: 0; font-weight: 400; }
.panel h5 button:hover { color: var(--you); }
.aspect-list { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.asp {
  display: flex; align-items: center; gap: 8px; padding: 6px 9px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface);
  font-size: 13.5px; text-align: left; transition: all .15s;
}
.asp .dot { flex: none; }
.asp .c { margin-left: auto; font-family: var(--mono); font-size: 11px; color: var(--faint); }
.asp:hover { border-color: var(--line2); background: var(--surface2); }
.asp.on { border-color: var(--hl); background: color-mix(in srgb, var(--hl) 12%, var(--surface)); font-weight: 600; }
.prin-list { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.prin {
  display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 6px; text-align: left; border: 1px solid transparent; background: none;
  padding: 6px 8px; border-radius: 9px; font-size: 13.5px; line-height: 1.5; color: var(--ink2);
}
.prin .n { font-family: var(--mono); font-size: 11.5px; color: var(--you); padding-top: 2px; }
.prin:hover { background: var(--surface2); }
.prin.on { border-color: var(--you); background: var(--you-soft); color: var(--ink); font-weight: 600; }
.thread { font-size: 14px; line-height: 1.7; color: var(--ink2); }
.thread .ttl { font-family: var(--serif); font-size: 16px; font-weight: 700; margin-bottom: 6px; display: flex; align-items: center; gap: 8px; }
.thread .chain { margin: 10px 0 0; padding: 0; list-style: none; border-left: 2px solid var(--hl, var(--you)); }
.thread .chain li { padding: 3px 0 3px 12px; position: relative; }
.thread .chain li::before { content: ""; position: absolute; left: -6px; top: 11px; width: 10px; height: 10px; border-radius: 50%; background: var(--surface); border: 2px solid var(--hl, var(--you)); }
.thread .chain button { border: 0; background: none; padding: 0; text-align: left; font-size: 13.5px; color: var(--ink2); }
.thread .chain button:hover { color: var(--you); }
.thread .chain .y { font-family: var(--mono); font-size: 11px; color: var(--faint); margin-right: 6px; }
.thread + .thread { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.thread .forai { margin-top: 8px; background: var(--ai-soft); border-radius: 8px; padding: 8px 10px; font-size: 13.5px; }
.empty-hint { font-size: 13.5px; color: var(--faint); line-height: 1.7; }
.era-mini { display: grid; gap: 2px; }
.era-mini button { border: 0; background: none; text-align: left; padding: 3px 8px; border-radius: 7px; font-size: 13px; color: var(--muted); display: flex; gap: 8px; }
.era-mini button .y { font-family: var(--mono); font-size: 11px; color: var(--faint); min-width: 74px; }
.era-mini button.cur { color: var(--ink); background: var(--surface2); font-weight: 600; }

/* principles summary */
.laws { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 10px; }
.law {
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 22px; position: relative;
}
.law .num { font-family: var(--mono); font-size: 12px; color: var(--you); letter-spacing: .1em; }
.law h4 { font-size: 20px; margin: 4px 0 8px; }
.law .st { font-family: var(--serif); font-size: 16.5px; color: var(--ink); margin-bottom: 8px; line-height: 1.7; }
.law .ex { font-size: 14.5px; color: var(--ink2); }
.law .fy { margin-top: 10px; font-size: 14.5px; background: var(--ai-soft); border-radius: 9px; padding: 9px 12px; }
.law .ev { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px; }

/* ============ Generic cards / grids ============ */
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.box { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 22px; }
.box h4 { font-size: 18px; margin-bottom: 8px; }
.box p, .box li { font-size: 15px; color: var(--ink2); line-height: 1.75; }
.sub-h { font-size: 26px; margin: 56px 0 10px; }
.sub-lede { font-size: 16.5px; color: var(--ink2); max-width: 780px; margin-bottom: 24px; }

/* cost inversion */
.costcmp { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.costcmp .box h4 { display: flex; justify-content: space-between; align-items: baseline; }
.costcmp .box h4 small { font-family: var(--sans); font-size: 13px; color: var(--muted); font-weight: 400; }
.bar-row { display: grid; grid-template-columns: 98px minmax(0, 1fr); gap: 12px; align-items: center; margin: 10px 0; font-size: 14px; color: var(--muted); }
.bar { height: 18px; border-radius: 6px; background: var(--bg2); position: relative; overflow: hidden; }
.bar i { position: absolute; inset: 0 auto 0 0; border-radius: 6px; }
.bar i.w { background: var(--mach); } .bar i.r { background: var(--you); }

/* failures */
.fail { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 14px; }
.fail .ic { width: 36px; height: 36px; border-radius: 10px; background: var(--ai-soft); color: var(--ai); display: grid; place-items: center; font-family: var(--mono); font-size: 13px; font-weight: 700; }
.fail h4 { font-size: 17px; margin-bottom: 4px; }
.fail .why { font-size: 14.5px; color: var(--ink2); line-height: 1.7; margin-bottom: 6px; }
.fail .stop { font-size: 13.5px; color: var(--muted); }
.fail .stop b { color: var(--you); font-weight: 600; }

/* practices (critique) */
.prac { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 12px; overflow: hidden; }
.prac-h { padding: 18px 22px; cursor: pointer; display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 14px; align-items: center; }
.prac-h .no { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.prac-h h4 { font-size: 19px; margin-bottom: 2px; }
.prac-h .v { font-size: 14.5px; color: var(--ink2); }
.prac-h .verdict { font-size: 12.5px; padding: 3px 10px; border-radius: 999px; background: var(--you-soft); color: var(--you); font-weight: 600; white-space: nowrap; }
.prac-b { display: none; padding: 0 22px 20px 80px; }
.prac.open .prac-b { display: block; }
.prac-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.prac-cols > div { border-radius: 11px; padding: 12px 14px; font-size: 14.5px; line-height: 1.75; color: var(--ink2); }
.prac-cols .k { font-size: 12px; font-weight: 700; letter-spacing: .12em; display: block; margin-bottom: 4px; }
.prac-cols .looks { background: var(--surface2); } .prac-cols .looks .k { color: var(--muted); }
.prac-cols .wrong { background: var(--you-soft); } .prac-cols .wrong .k { color: var(--you); }
.prac-cols .better { background: var(--mach-soft); } .prac-cols .better .k { color: var(--mach); }
.prac .who-said { margin-top: 10px; font-size: 13px; color: var(--faint); }

/* ============ The line (answer 1) ============ */
.line-ui { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 28px; align-items: start; }
.lg { background: var(--surface); border-radius: 20px; box-shadow: var(--shadow-lg); padding: 22px 24px; }
.lg-head, .lg-row { display: grid; grid-template-columns: 170px minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.lg-head { font-size: 13px; color: var(--muted); font-weight: 700; letter-spacing: .08em; padding: 0 0 10px; }
.lg-head div:not(:first-child) { padding-left: 12px; }
.lg-head .zt { font-family: var(--serif); font-size: 17px; color: var(--ink); letter-spacing: 0; display: block; }
.lg-head .zd { font-weight: 400; letter-spacing: 0; font-size: 12.5px; }
.lg-row { margin-bottom: 8px; }
.lg-row .ln { padding: 12px 4px; }
.lg-row .ln b { font-family: var(--serif); font-size: 16px; display: block; }
.lg-row .ln span { font-size: 12.5px; color: var(--muted); line-height: 1.5; display: block; }
.cell { border-radius: 12px; padding: 11px 13px; font-size: 13.5px; line-height: 1.6; color: var(--ink2); transition: background .3s, border-color .3s; border: 1.5px solid transparent; position: relative; }
.cell .own { font-size: 12px; font-weight: 700; display: block; margin-bottom: 3px; letter-spacing: .04em; }
.cell.you { background: var(--you-soft); } .cell.you .own { color: var(--you); }
.cell.mix { background: color-mix(in srgb, var(--you-soft) 50%, var(--ai-soft)); } .cell.mix .own { color: var(--ink); }
.cell.ai { background: var(--ai-soft); } .cell.ai .own { color: var(--ai); }
.cell.cut { border-top: 3px solid var(--you); }
.lg-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin-top: 14px; align-items: center; }
.lg-legend .sw { width: 14px; height: 14px; border-radius: 4px; display: inline-block; vertical-align: -2px; margin-right: 5px; }
.knobs .panel { margin-bottom: 14px; }
.seg { display: grid; gap: 6px; }
.seg button { text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 8px 11px; font-size: 13.5px; line-height: 1.5; }
.seg button small { display: block; color: var(--faint); font-size: 12px; }
.seg button.on { border-color: var(--you); background: var(--you-soft); }
.knob-note { font-size: 13.5px; color: var(--ink2); line-height: 1.7; margin-top: 10px; }
.quiz { display: grid; gap: 10px; }
.qz { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; align-items: center; background: var(--surface); border-radius: 12px; padding: 12px 16px; box-shadow: var(--shadow); }
.qz .q { font-size: 15.5px; } .qz .q small { display: block; font-size: 13px; color: var(--muted); }
.yn { display: flex; border: 1px solid var(--line2); border-radius: 999px; overflow: hidden; }
.yn button { border: 0; background: var(--surface); padding: 5px 14px; font-size: 13.5px; }
.yn button.on { background: var(--ink); color: var(--bg); }
.verdict-box { margin-top: 14px; border-radius: 14px; padding: 16px 20px; font-size: 15.5px; line-height: 1.75; border: 2px solid var(--line2); background: var(--surface); }
.verdict-box.core { border-color: var(--you); background: var(--you-soft); }
.verdict-box.edge { border-color: var(--ai); background: var(--ai-soft); }
.verdict-box b.t { font-family: var(--serif); font-size: 18px; display: block; margin-bottom: 4px; }
.tabs { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.tabs button { border: 1px solid var(--line2); background: var(--surface); border-radius: 999px; padding: 6px 15px; font-size: 14px; }
.tabs button.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.proj { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--surface); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); }
.proj td, .proj th { padding: 11px 16px; border-bottom: 1px solid var(--line); font-size: 14.5px; text-align: left; vertical-align: top; line-height: 1.65; }
.proj th { font-size: 13px; color: var(--muted); background: var(--surface2); font-weight: 700; }
.proj tr:last-child td { border-bottom: 0; }
.zone { font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
.zone.core { color: var(--you); background: var(--you-soft); }
.zone.edge { color: var(--ai); background: var(--ai-soft); }
.zone.mid { color: var(--ink2); background: var(--bg2); }
.moves { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }

/* ============ Workflow ============ */
.wf { position: relative; padding-left: 64px; }
.wf::before { content: ""; position: absolute; left: 22px; top: 10px; bottom: 10px; width: 2px; background: linear-gradient(var(--you), var(--ai)); opacity: .5; }
.step { position: relative; background: var(--surface); border-radius: 16px; box-shadow: var(--shadow); margin-bottom: 14px; }
.step .nb {
  position: absolute; left: -64px; top: 16px; width: 46px; height: 46px; border-radius: 50%; background: var(--surface); border: 2px solid var(--you);
  display: grid; place-items: center; font-family: var(--serif); font-size: 20px; font-weight: 700; color: var(--you);
}
.step-h { padding: 18px 22px; cursor: pointer; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; align-items: center; }
.step-h h4 { font-size: 21px; } .step-h h4 small { font-family: var(--sans); font-size: 14px; color: var(--muted); font-weight: 400; margin-left: 10px; }
.step-h .one { font-size: 15.5px; color: var(--ink2); margin: 4px 0 0; }
.step-h .att { font-size: 12.5px; color: var(--muted); text-align: right; white-space: nowrap; }
.step-h .att b { display: block; font-size: 14px; color: var(--you); }
.step-b { display: none; padding: 0 22px 22px; }
.step.open .step-b { display: block; }
.roles3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.roles3 > div { border-radius: 12px; padding: 12px 14px; font-size: 14.5px; line-height: 1.75; color: var(--ink2); }
.roles3 .k { display: block; font-size: 12px; font-weight: 700; letter-spacing: .12em; margin-bottom: 4px; }
.roles3 .r-you { background: var(--you-soft); } .roles3 .r-you .k { color: var(--you); }
.roles3 .r-ai { background: var(--ai-soft); } .roles3 .r-ai .k { color: var(--ai); }
.roles3 .r-mach { background: var(--mach-soft); } .roles3 .r-mach .k { color: var(--mach); }
.roles3 ul, .step-extra ul { margin: 0; padding-left: 1.1em; }
.step-extra { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
.step-extra > div { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; font-size: 14px; line-height: 1.7; color: var(--ink2); }
.step-extra .k { display: block; font-size: 12px; font-weight: 700; letter-spacing: .12em; color: var(--muted); margin-bottom: 4px; }
.step-extra .cc .k { color: var(--ai); }
.step-why { margin-top: 12px; font-size: 14px; color: var(--muted); }
.step-why .chip { margin-left: 4px; }
.loop-note { margin: 18px 0 0 64px; font-size: 15px; color: var(--ink2); background: var(--surface2); border: 1px dashed var(--line2); border-radius: 12px; padding: 12px 16px; }

/* demo */
.demo { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 20px; align-items: start; }
.demo-nav { display: grid; gap: 4px; position: sticky; top: 20px; }
.demo-nav button { text-align: left; border: 1px solid transparent; background: none; border-radius: 10px; padding: 8px 12px; font-size: 14px; color: var(--muted); display: flex; gap: 10px; }
.demo-nav button .n { font-family: var(--mono); font-size: 12px; color: var(--faint); }
.demo-nav button.on { background: var(--surface); border-color: var(--line2); color: var(--ink); font-weight: 600; box-shadow: var(--shadow); }
.demo-pane { background: var(--surface); border-radius: 16px; box-shadow: var(--shadow); padding: 22px 24px; min-height: 420px; }
.demo-pane h4 { font-size: 20px; margin-bottom: 6px; }
.demo-pane .ctx { font-size: 15px; color: var(--ink2); margin-bottom: 14px; }
.demo-pane .who { font-size: 12.5px; font-weight: 700; letter-spacing: .1em; margin: 14px 0 6px; }
.demo-pane .who.you { color: var(--you); } .demo-pane .who.ai { color: var(--ai); } .demo-pane .who.mach { color: var(--mach); }
.demo-pane .note { font-size: 14.5px; color: var(--muted); margin-top: 12px; border-top: 1px dashed var(--line2); padding-top: 10px; }

/* templates */
.tpl { background: var(--surface); border-radius: 14px; box-shadow: var(--shadow); margin-bottom: 14px; overflow: hidden; }
.tpl-h { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 12px; padding: 14px 20px; align-items: center; cursor: pointer; }
.tpl-h h4 { font-size: 17px; } .tpl-h p { font-size: 14px; color: var(--muted); margin: 2px 0 0; }
.tpl-h .file { font-family: var(--mono); font-size: 12px; color: var(--faint); }
.copy { border: 1px solid var(--line2); background: var(--surface); border-radius: 8px; padding: 4px 12px; font-size: 13px; }
.copy.ok { color: var(--mach); border-color: var(--mach); }
.tpl-b { display: none; border-top: 1px solid var(--line); }
.tpl.open .tpl-b { display: block; }
.tpl-b pre { margin: 0; padding: 16px 20px; background: var(--code-bg); font-family: var(--mono); font-size: 13px; line-height: 1.65; overflow-x: auto; max-height: 560px; color: var(--code-ink); }

/* languages */
.langs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.lc { background: var(--surface); border-radius: 16px; box-shadow: var(--shadow); padding: 20px 22px; display: flex; flex-direction: column; }
.lc-h { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 4px; }
.lc-h h4 { font-size: 22px; }
.lc .tagline { font-size: 14.5px; color: var(--muted); margin-bottom: 12px; }
.meter { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.meter .bars { display: flex; gap: 3px; }
.meter .bars i { width: 14px; height: 8px; border-radius: 2px; background: var(--line); }
.meter .bars i.on { background: var(--mach); }
.lc dl { margin: 0; display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 8px 12px; font-size: 14.5px; line-height: 1.7; }
.lc dt { font-size: 12.5px; font-weight: 700; color: var(--muted); padding-top: 2px; }
.lc dd { margin: 0; color: var(--ink2); }
.lc dt.ai { color: var(--ai); } .lc dt.mv { color: var(--you); }
.lc details { margin-top: 12px; }
.lc summary { cursor: pointer; font-size: 13.5px; color: var(--mach); font-weight: 600; }
.lc details .code { margin-top: 8px; }

/* books */
.shelf { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; }
.shelf h3 { font-size: 22px; margin-bottom: 4px; }
.shelf .sd { font-size: 14.5px; color: var(--muted); margin-bottom: 14px; }
.book { display: grid; grid-template-columns: 54px minmax(0, 1fr); gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.book .ty { font-size: 11.5px; font-weight: 700; color: var(--muted); border: 1px solid var(--line2); border-radius: 6px; text-align: center; padding: 1px 0; height: fit-content; margin-top: 3px; }
.book .bt { font-size: 15.5px; font-weight: 600; line-height: 1.5; }
.book .bt a { text-decoration: none; } .book .bt a:hover { text-decoration: underline; }
.book .ba { font-size: 13px; color: var(--faint); font-weight: 400; margin-left: 6px; }
.book .bw { font-size: 14px; color: var(--ink2); line-height: 1.65; margin-top: 2px; }

/* glossary tooltips */
abbr[title] { text-decoration: underline dotted var(--faint); text-underline-offset: 4px; cursor: help; }
.tip { position: fixed; z-index: 100; max-width: 320px; background: var(--ink); color: var(--bg); font-size: 13.5px; line-height: 1.6; padding: 9px 12px; border-radius: 9px; pointer-events: none; box-shadow: var(--shadow-lg); opacity: 0; transition: opacity .12s; }
.tip.show { opacity: 1; }

footer { margin-left: var(--nav-w); padding: 60px 64px 80px; color: var(--faint); font-size: 13.5px; }
footer .fin { max-width: 760px; font-family: var(--serif); font-size: 20px; color: var(--ink); line-height: 1.75; margin-bottom: 24px; }

.cut-under { border-top: 3px solid var(--you); font-size: 12.5px; color: var(--you); font-weight: 600; padding-top: 6px; letter-spacing: .04em; }
.box ul { margin: 0; padding-left: 1.15em; }
.box li { margin-bottom: 6px; }

/* polish */
code, pre, kbd, .tpl-b pre, .code pre { font-variant-ligatures: none; font-feature-settings: "liga" 0, "calt" 0; }
.code pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.cell.cut { margin-top: 12px; }
.cell.cut::before { content: "分界线"; position: absolute; left: -2px; right: -2px; top: -12px; height: 3px; background: var(--you); border-radius: 3px;
  font-size: 0; }
.cell.cut::after { content: "分界线"; position: absolute; right: 10px; top: -21px; font-size: 11px; font-weight: 700; color: var(--you); background: var(--surface); padding: 0 6px; letter-spacing: .1em; }
.prac-h .chev { margin-left: 10px; }
.prac.open .chev { transform: rotate(180deg); color: var(--you); border-color: var(--you); }
.law .more { border-style: solid; border-color: var(--you); color: var(--you); }

/* ===== affordances: make hover / click visible ===== */
abbr { text-decoration: none; cursor: help; color: inherit; border-bottom: 1.5px dashed var(--mach);
  background: color-mix(in srgb, var(--mach) 10%, transparent); border-radius: 3px; padding: 0 2px; transition: background .15s; }
abbr::after { content: "?"; display: inline-block; font-family: var(--sans); font-size: 10px; font-weight: 700; line-height: 13px; width: 13px; height: 13px;
  text-align: center; border-radius: 50%; background: var(--mach); color: var(--surface); margin-left: 3px; vertical-align: 2px; }
abbr:hover { background: color-mix(in srgb, var(--mach) 22%, transparent); }
.chip.asp-tag { display: inline-flex; align-items: center; gap: 5px; border-color: transparent; background: var(--surface2); color: var(--ink2); }
.chip.asp-tag i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.chip.p { cursor: pointer; }
.chip.p::before { content: "◎ "; font-size: 10px; }
.card-h:hover .chev, .step-h:hover .chev, .tpl-h:hover .chev, .prac-h:hover .chev { border-color: var(--you); color: var(--you); }
.step .chev, .tpl .chev { margin-left: 10px; }
.step.open .chev, .tpl.open .chev { transform: rotate(180deg); color: var(--you); border-color: var(--you); }
.card-h::after { content: none; }
.hint-open { font-size: 11px; color: var(--faint); text-align: center; margin-top: 4px; }
.card.open .hint-open { display: none; }
#legend { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-top: 18px; font-size: 12.5px; color: var(--muted); line-height: 1.6; background: var(--surface); }
#legend b { display: block; font-size: 12px; letter-spacing: .1em; color: var(--ink2); margin-bottom: 6px; }
#legend .lg-item { display: flex; align-items: center; gap: 8px; margin: 5px 0; }
#legend .lg-item > span:first-child { flex: none; }
#legend .chev { width: 20px; height: 20px; font-size: 11px; display: inline-grid; }
.mini-chip { font-size: 11px; padding: 0 7px; border-radius: 999px; border: 1px solid var(--line2); white-space: nowrap; }
.mini-chip.p { border-color: var(--you); color: var(--you); }
