:root {
  color-scheme: dark;
  --bg: #02040a;
  --ink: #e8e8ea;
  --muted: #a1a8b5;
  --line: #252c38;
  --panel: #080c14;
  --panel-2: #0d121c;
  --q: #70e0c2;
  --k: #f0c15a;
  --link: #d9b585;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.65 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
}

body {
  overflow-x: hidden;
}

button,
input {
  font: inherit;
}

.site-header {
  min-height: 56px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 22px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
}

.brand {
  color: #d9b585;
  font-weight: 700;
  text-decoration: none;
}

.page-shell {
  width: min(1040px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 42px 0 72px;
}

.intro {
  margin-bottom: 34px;
}

.eyebrow,
.section-kicker {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: 820px;
  margin-bottom: 0;
  color: var(--ink);
  font-size: clamp(2rem, 6.4vw, 4rem);
  line-height: 1.08;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 10px;
  font-size: 1.18rem;
  line-height: 1.25;
  letter-spacing: 0;
}

/* 主題的英文/中文 companion：小一號、次要色，永遠與主題同行不被埋沒 */
.topic-en,
.topic-zh {
  font-size: 0.5em;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.01em;
  white-space: nowrap;
}

/* aha 一句話：副標，重量介於 H1 與內文之間（specificity 蓋過 .intro p）*/
.intro .deck {
  max-width: 760px;
  margin: 16px 0 0;
  color: #d5deee;
  font-size: clamp(1.15rem, 3.2vw, 1.7rem);
  line-height: 1.32;
  font-weight: 400;
}

/* ---- 生活比喻入口（SPEC C7）---- */
.metaphor {
  max-width: 460px;
  margin: 22px 0 0;
}

.metaphor-art {
  display: block;
  width: 100%;
  height: auto;
}

.metaphor figcaption {
  margin-top: 6px;
  color: #ced8ea;
  font-size: 0.95rem;
  line-height: 1.55;
}

/* 你（發問的字）＝ q teal；被聽的聲音 ＝ k amber；線越粗＝注意力越多 */
.m-me { fill: none; stroke: var(--q); stroke-width: 2.5; }
.m-p { fill: var(--k); opacity: 0.85; }
.m-ray { stroke: var(--k); }
.m-ray.r1 { stroke-width: 1.5; opacity: 0.45; }
.m-ray.r2 { stroke-width: 5; opacity: 0.95; }
.m-ray.r3 { stroke-width: 1; opacity: 0.3; }

/* ---- 步驟鏈（SPEC C7）---- */
.step-no {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  margin-right: 8px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: #dce4f2;
}

/* ---- 三重對應色塊 + 圖例（SPEC C6）---- */
.chip {
  display: inline-block;
  width: 11px;
  height: 11px;
  margin-right: 8px;
  border-radius: 3px;
  vertical-align: -1px;
}

.chip-q { background: var(--q); }
.chip-k { background: var(--k); }
.chip-w { background: rgba(240, 193, 90, 0.45); border: 1px solid var(--k); }

.canvas-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin: 0 0 10px;
  color: #dce4f2;
  font-size: 0.95rem;
  font-weight: 600;
}

.legend-item { white-space: nowrap; }

/* ---- 熱圖格 hover 白話浮籤 ---- */
#attn-canvas { cursor: crosshair; }

.cell-tip {
  position: fixed;
  z-index: 41;
  max-width: 280px;
  padding: 6px 9px;
  border: 1px solid var(--line);
  background: #0a0f18;
  color: var(--ink);
  font-size: 0.85rem;
  line-height: 1.45;
  pointer-events: none;
}

.cell-tip[hidden] { display: none; }

/* ---- 公式預設收合（SPEC C7）---- */
.formal-details {
  border: 1px solid var(--line);
  background: var(--panel);
}

.formal-details summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  cursor: pointer;
  list-style: none;
}

.formal-details summary::-webkit-details-marker { display: none; }

.formal-details summary::before {
  content: '▸';
  color: var(--muted);
  font-size: 0.9rem;
  transition: transform 0.15s ease;
}

.formal-details[open] summary::before { transform: rotate(90deg); }

.formal-details summary h2 { margin: 0; }

.summary-hint {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.82rem;
  white-space: nowrap;
}

.details-body { padding: 0 16px 18px; }

@media (prefers-reduced-motion: reduce) {
  .formal-details summary::before { transition: none; }
}

.intro p {
  max-width: 760px;
  margin-top: 14px;
  color: #ced8ea;
}

.aside {
  max-width: 760px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.95rem;
}

.takeaway {
  max-width: 760px;
  margin-top: 18px;
  padding: 12px 16px;
  border-left: 3px solid var(--muted);
  background: rgba(238, 244, 255, 0.035);
  color: #dce4f2;
  font-size: 1.05rem;
  line-height: 1.6;
}

.how-to {
  max-width: 760px;
  margin: 0 0 14px;
  color: var(--muted);
}

.canvas-caption {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.4;
}

.canvas-caption b {
  color: var(--ink);
}

.lab-surface {
  padding: 22px;
  border: 1px solid var(--line);
  background: var(--panel);
}

.surface-copy {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: baseline;
  margin-bottom: 14px;
}

.interaction-layout {
  display: grid;
  grid-template-columns: minmax(230px, 0.72fr) minmax(0, 1.55fr);
  gap: 18px;
  align-items: start;
}

.interaction-controls,
.interaction-visual {
  min-width: 0;
}

.token-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.token-chip {
  min-height: 44px;
  min-width: 0;
  padding: 0 10px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--ink);
  font-size: 1rem;
  cursor: pointer;
  touch-action: manipulation;
}

.token-chip:hover {
  background: rgba(217, 181, 133, 0.08);
}

.token-chip.selected {
  border-color: var(--q);
  background: var(--q);
  color: #04211a;
  font-weight: 700;
}

.token-chip.is-cued {
  outline: 2px solid var(--q);
  outline-offset: 2px;
}

.canvas-wrap {
  width: 100%;
  aspect-ratio: 4 / 3;
  min-height: 0;
  border: 1px solid #2a3b55;
  background: #04070d;
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.readout {
  margin: 12px 0 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--ink);
  font-size: 1.05rem;
}

.readout.is-cued {
  border-color: var(--ink);
  outline: 1px solid var(--ink);
  outline-offset: -2px;
}

.control.is-cued {
  outline: 1px solid currentColor;
  outline-offset: -1px;
}

.controls {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-top: 12px;
}

.control {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 12px;
  align-items: center;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  background: var(--panel-2);
}

.control span,
.control output {
  min-width: 0;
  white-space: nowrap;
}

.control output {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.control input[type="range"] {
  grid-column: 1 / -1;
  width: 100%;
  min-height: 44px; /* 觸控目標 ≥44px */
  accent-color: currentColor;
  touch-action: manipulation;
  cursor: pointer;
}

.tasks,
.zoomout,
.usecases,
.formal,
.links {
  padding-top: 34px;
  margin-top: 34px;
  border-top: 1px solid var(--line);
}

/* 拉遠看：整座 Transformer 的方塊流程圖 */
.arch-art {
  display: block;
  width: 100%;
  max-width: 560px;
  height: auto;
  margin: 10px 0 4px;
}

.arch-box { fill: var(--panel-2); stroke: var(--line); }
.arch-box.hot { stroke: var(--q); stroke-width: 2; }
.arch-txt { fill: #dce4f2; font: 600 11px system-ui, sans-serif; }
.arch-txt.hot { fill: var(--q); }
.arch-txt.sub { font-size: 9px; fill: var(--muted); }
.arch-arrow { fill: var(--muted); }
.arch-loop { fill: none; stroke: var(--muted); stroke-dasharray: 4 4; }
.arch-n { fill: var(--muted); font: 700 12px system-ui, sans-serif; }
.arch-note { fill: var(--q); font: 600 10px system-ui, sans-serif; }

.arch-list,
.usecase-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 1.25rem;
  max-width: 820px;
  color: #ced8ea;
}

.arch-list b,
.usecase-list b {
  color: var(--ink);
}

.tasks ol {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 1.25rem;
  color: #d5deee;
}

.formula-block {
  margin: 12px 0 16px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.formula-line {
  margin: 0 0 12px;
  color: var(--ink);
  font-size: clamp(1.1rem, 3.4vw, 1.85rem);
  line-height: 1.4;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.formula-line:last-child {
  margin-bottom: 0;
}

.sym {
  font-weight: 700;
}

.sym.q {
  color: var(--q);
}

.sym.k,
.sym.w {
  color: var(--k);
}

.sym.out {
  color: var(--ink);
}

.sym.score,
.sym.sqrtd,
.sym.softmax,
.sym.v {
  color: var(--muted);
  font-weight: 600;
}

/* 公式符號＝只給指標（滑鼠／觸控）的提示，非鍵盤 tab 停點、非 role=button */
.formal .sym[data-sym] {
  padding: 0 2px;
  border-radius: 3px;
  cursor: pointer;
}

.formal .sym[data-sym].is-active {
  text-decoration: underline;
  outline: 1px solid currentColor;
}

/* 詞彙表＝鍵盤／輔助科技的正式互動圖例：8 個乾淨 tab 停點，觸控目標 ≥44px */
.symbol-gloss {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 14px;
  align-items: center;
  margin: 14px 0 0;
  padding: 0;
}

.symbol-gloss dt {
  margin: 0;
  white-space: nowrap;
}

.symbol-gloss dt[data-sym] {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 4px 6px;
  border-radius: 3px;
  cursor: pointer;
}

.symbol-gloss dt[data-sym].is-active {
  outline: 1px solid currentColor;
}

.symbol-gloss dt[data-sym]:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

.symbol-gloss dd {
  margin: 0;
  color: #ced8ea;
}

.sym-explainer {
  min-height: 1.6em;
  margin: 10px 0 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: #ced8ea;
  font-size: 0.92rem;
  line-height: 1.5;
}

.sym-tip {
  position: fixed;
  z-index: 40;
  max-width: 260px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  background: #0a0f18;
  color: var(--ink);
  font-size: 0.85rem;
  line-height: 1.45;
  pointer-events: none;
}

.sym-tip[hidden] {
  display: none;
}

.links p,
.formal > p {
  max-width: 820px;
  color: #ced8ea;
}

.graph-link {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  padding: 0 16px;
  border: 1px solid var(--link);
  color: var(--link);
  text-decoration: none;
}

.graph-link:hover {
  background: rgba(217, 181, 133, 0.08);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.001ms !important;
    animation-duration: 0.001ms !important;
  }
}

@media (max-width: 760px) {
  .page-shell {
    width: min(100vw - 24px, 640px);
    padding-top: 28px;
  }

  .site-header {
    padding: 0 14px;
  }

  .lab-surface {
    padding: 14px;
  }

  .surface-copy {
    display: block;
  }

  .interaction-layout {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .token-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .canvas-wrap {
    aspect-ratio: 1 / 1;
    min-height: 0;
  }

  .controls {
    grid-template-columns: 1fr;
  }

  .control span,
  .control output {
    white-space: normal;
  }
}

/* Minimal visual system: one dominant graphic, low-weight controls, no nested cards. */
body {
  background: var(--bg);
}

.site-header {
  border-bottom-color: var(--line);
  background: transparent;
  backdrop-filter: none;
}

.page-shell {
  width: min(1040px, calc(100vw - 32px));
  padding-top: 42px;
}

.intro {
  margin-bottom: 34px;
}

.intro h1 {
  max-width: 820px;
  font-size: clamp(2rem, 6.4vw, 4rem);
  letter-spacing: -0.025em;
}

.intro .topic-zh {
  display: inline;
  width: auto;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.5em;
  letter-spacing: 0.01em;
  vertical-align: baseline;
}

.intro .deck {
  margin-top: 16px;
}

.lab-surface {
  overflow: visible;
  padding: 28px 0 0;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.surface-copy {
  margin-bottom: 18px;
}

.surface-copy h2 {
  font-size: 1.35rem;
}

.interaction-layout {
  grid-template-columns: minmax(250px, 0.7fr) minmax(0, 1.55fr);
  gap: 32px;
}

.interaction-controls,
.interaction-visual {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.interaction-controls {
  padding-right: 28px;
  border-right: 1px solid var(--line);
}

.how-to {
  margin-bottom: 10px;
  color: var(--muted);
}

.token-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0 14px;
  margin-bottom: 14px;
}

.token-chip,
.token-chip:hover,
.token-chip.selected {
  flex: 1 1 68px;
  min-height: 44px;
  padding: 4px 0 2px;
  transform: none;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--ink);
}

.token-chip:hover {
  border-bottom-color: var(--q);
}

.token-chip.selected {
  border-bottom: 2px solid var(--q);
  color: var(--q);
}

.readout {
  margin-top: 14px;
  padding: 12px 0 0;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: #dce4f2;
}

.controls {
  margin-top: 16px;
}

.control {
  padding: 12px 0 0;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
}

.canvas-legend {
  margin-bottom: 6px;
  color: #b8c5d8;
  font-size: 0.82rem;
}

.canvas-caption {
  margin-bottom: 8px;
}

.canvas-wrap {
  aspect-ratio: 16 / 10;
  border-color: #2a3b55;
  border-radius: 0;
  box-shadow: none;
}

.intro.context {
  margin-top: 34px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

@media (max-width: 760px) {
  .page-shell {
    width: min(100vw - 24px, 640px);
    padding-top: 28px;
  }

  .intro h1 {
    font-size: clamp(2.35rem, 12vw, 3.5rem);
  }

  .intro .topic-zh {
    display: inline;
    margin: 0;
    padding: 0;
    font-size: 0.5em;
  }

  .lab-surface {
    padding: 26px 0 0;
    border-radius: 0;
  }

  .interaction-layout {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .interaction-controls {
    padding: 0 0 24px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .interaction-visual {
    padding: 0;
  }

  .canvas-wrap {
    aspect-ratio: 1 / 1;
  }
}

@media (max-width: 430px) {
  .token-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* 2026-07 visual refinement: make attention read as one focused instrument. */
body {
  background:
    radial-gradient(circle at 12% 6%, rgba(112, 224, 194, 0.08), transparent 30rem),
    radial-gradient(circle at 90% 22%, rgba(89, 126, 255, 0.08), transparent 32rem),
    var(--bg);
}

.site-header {
  border-bottom-color: rgba(122, 151, 193, 0.16);
  background: rgba(5, 7, 13, 0.72);
  backdrop-filter: blur(14px);
}

.page-shell {
  width: min(1120px, calc(100vw - 40px));
  padding-top: 34px;
}

.intro {
  margin-bottom: 28px;
}

.intro h1 {
  font-size: clamp(3rem, 5.6vw, 4.65rem);
  letter-spacing: -0.05em;
}

.intro .topic-zh {
  display: inline-flex;
  align-items: center;
  margin-left: 10px;
  padding: 6px 12px;
  border: 1px solid rgba(112, 224, 194, 0.25);
  border-radius: 999px;
  background: rgba(112, 224, 194, 0.06);
  color: #a8dccc;
  font-size: 0.31em;
  letter-spacing: 0.05em;
  vertical-align: 0.3em;
}

.intro .deck {
  margin-top: 10px;
  font-size: clamp(1.12rem, 2vw, 1.45rem);
}

.lab-surface {
  position: relative;
  overflow: hidden;
  padding: 26px;
  border-color: rgba(112, 224, 194, 0.2);
  border-radius: 28px;
  background:
    radial-gradient(circle at 82% 8%, rgba(240, 193, 90, 0.07), transparent 28rem),
    linear-gradient(155deg, rgba(14, 23, 37, 0.98), rgba(8, 13, 22, 0.98));
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.32), inset 0 1px rgba(255, 255, 255, 0.04);
}

.surface-copy {
  display: block;
  margin-bottom: 18px;
}

.surface-copy h2 {
  margin: 0;
  font-size: clamp(1.35rem, 2vw, 1.7rem);
}

.interaction-layout {
  grid-template-columns: minmax(280px, 0.74fr) minmax(0, 1.5fr);
  gap: 22px;
}

.interaction-controls,
.interaction-visual {
  padding: 16px;
  border: 1px solid rgba(80, 105, 142, 0.32);
  border-radius: 18px;
  background: rgba(4, 8, 15, 0.52);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.025);
}

.how-to {
  margin-bottom: 12px;
  color: #b9c6d8;
  font-size: 0.92rem;
}

.token-strip {
  gap: 9px;
}

.token-chip {
  border-color: rgba(80, 105, 142, 0.38);
  border-radius: 11px;
  background: linear-gradient(145deg, rgba(22, 34, 51, 0.96), rgba(13, 22, 36, 0.96));
  color: #dce6f5;
  transition: transform 130ms ease, border-color 130ms ease, background 130ms ease;
}

.token-chip:hover {
  transform: translateY(-1px);
  border-color: rgba(112, 224, 194, 0.5);
  background: rgba(24, 42, 61, 0.98);
}

.token-chip.selected {
  border-color: #8cebd1;
  background: linear-gradient(135deg, #78e2c5, #55cbb3);
  color: #031b17;
  box-shadow: 0 10px 26px rgba(54, 190, 158, 0.2);
}

.readout {
  padding: 12px 14px;
  border: 0;
  border-left: 2px solid var(--q);
  border-radius: 0 10px 10px 0;
  background: rgba(112, 224, 194, 0.065);
  color: #dce9e6;
  font-size: 0.98rem;
}

.controls {
  margin-top: 10px;
}

.control {
  padding: 13px 14px;
  border-color: rgba(80, 105, 142, 0.34);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(20, 31, 47, 0.92), rgba(13, 21, 34, 0.92));
}

.canvas-legend {
  gap: 7px 14px;
  margin-bottom: 8px;
  color: #bfcde0;
  font-size: 0.84rem;
}

.canvas-caption {
  margin-bottom: 10px;
  color: #899bb5;
}

.canvas-wrap {
  overflow: hidden;
  aspect-ratio: 16 / 10;
  border-color: rgba(92, 121, 163, 0.42);
  border-radius: 13px;
  background: #060b13;
  box-shadow: inset 0 0 36px rgba(0, 0, 0, 0.34);
}

.intro.context {
  margin-top: 34px;
  padding: 22px;
  border: 1px solid rgba(80, 105, 142, 0.22);
  border-radius: 20px;
  background: rgba(12, 20, 32, 0.56);
}

.formal-details {
  overflow: hidden;
  border-radius: 16px;
}

@media (max-width: 760px) {
  .page-shell {
    width: min(100vw - 24px, 640px);
  }

  .intro h1 {
    font-size: clamp(2.45rem, 13vw, 3.6rem);
  }

  .intro .topic-zh {
    display: flex;
    width: max-content;
    margin: 10px 0 0;
    padding: 4px 8px;
    font-size: 0.3em;
    vertical-align: initial;
  }

  .lab-surface {
    padding: 16px;
    border-radius: 20px;
  }

  .interaction-layout {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .interaction-controls,
  .interaction-visual {
    padding: 13px;
  }

  .canvas-wrap {
    aspect-ratio: 1 / 1;
  }
}

/* Final cascade: minimal Depth layout, shared in spirit with sine-wave. */
body { background: var(--bg); }
.site-header { border-bottom-color: var(--line); background: transparent; backdrop-filter: none; }
.page-shell { width: min(1040px, calc(100vw - 32px)); padding-top: 42px; }
.intro { margin-bottom: 34px; }
.intro h1 { max-width: 820px; font-size: clamp(2rem, 6.4vw, 4rem); letter-spacing: -0.025em; }
.intro .topic-zh {
  display: inline;
  width: auto;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.5em;
  letter-spacing: 0.01em;
  vertical-align: baseline;
}
.intro .deck { margin-top: 16px; }
.lab-surface {
  overflow: visible;
  padding: 28px 0 0;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.surface-copy { margin-bottom: 18px; }
.surface-copy h2 { font-size: 1.35rem; }
.interaction-layout { display: flex; flex-direction: column; align-items: stretch; gap: 20px; }
.interaction-controls,
.interaction-visual { padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.interaction-visual { order: 1; }
.interaction-controls {
  order: 2;
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(180px, 0.75fr) minmax(210px, 0.9fr);
  gap: 28px;
  padding: 0;
  border: 0;
}
.figure-note { min-width: 0; padding-top: 12px; border-top: 1px solid var(--line); }
.guide-label { margin: 0 0 6px; color: var(--muted); font-size: 0.78rem; letter-spacing: 0.04em; }
.how-to { margin-bottom: 10px; color: var(--muted); }
.temperature-copy { margin: 0; color: var(--muted); font-size: 0.9rem; line-height: 1.5; }
.token-strip { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; margin-bottom: 0; }
.token-chip,
.token-chip:hover,
.token-chip.selected {
  min-width: 0;
  min-height: 44px;
  padding: 4px 0 2px;
  transform: none;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--ink);
}
.token-chip:hover { border-bottom-color: var(--q); }
.token-chip.selected { border-bottom: 2px solid var(--q); color: var(--q); }
.readout {
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #dce4f2;
}
.controls { margin-top: 8px; }
.control { padding: 0; border: 0; border-radius: 0; background: transparent; }
.canvas-legend { margin-bottom: 6px; color: #b8c5d8; font-size: 0.82rem; }
.canvas-caption { margin-bottom: 8px; }
.canvas-wrap { aspect-ratio: 16 / 8.6; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.intro.context { margin-top: 34px; padding: 0; border: 0; border-radius: 0; background: transparent; }

@media (max-width: 760px) {
  .page-shell { width: min(100vw - 24px, 640px); padding-top: 28px; }
  .intro h1 { font-size: clamp(2.35rem, 12vw, 3.5rem); }
  .intro .topic-zh { display: inline; margin: 0; padding: 0; font-size: 0.5em; }
  .lab-surface { padding: 26px 0 0; border-radius: 0; }
  .interaction-layout { gap: 20px; }
  .interaction-controls { grid-template-columns: 1fr; gap: 18px; padding: 0; border: 0; }
  .interaction-visual { padding: 0; }
  .token-chip,
  .token-chip:hover,
  .token-chip.selected { min-height: 42px; }
  .token-strip { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  /* Retain the four-token normal row when shared reading styles load later.
     The ch minimum grows with enlarged text, allowing fewer readable columns. */
  .page-shell .interaction-controls .token-strip {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, max(6ch, calc((100% - 24px) / 4))), 1fr));
  }
  .canvas-wrap { aspect-ratio: 1 / 1; }
}

/* Quiet reading rhythm shared across Depth; diagrams retain their own scales. */
.site-header{padding-inline:max(24px,calc((100vw - 1040px)/2));gap:16px;border-bottom-color:rgba(161,168,181,.12)}
.brand{letter-spacing:.035em;font-size:.95rem}
.site-header>span{font-size:.75rem;letter-spacing:.1em;color:var(--muted)}
.page-shell,body>main{padding-top:52px}
h1{font-size:clamp(40px,7vw,75px);font-weight:650;text-wrap:balance}
.topic-en,.topic-zh{display:block;margin:12px 0 0;font-size:clamp(18px,2.2vw,25px);font-weight:400;line-height:1.4;white-space:normal}
h2{font-weight:600;line-height:1.45;text-wrap:balance}
p,li{line-height:1.8}
.deck{line-height:1.55;max-width:38em;color:#d8d9dd}
.intro{margin-bottom:40px}
.tasks,.usecases,.formal,.links{margin-top:48px;padding-top:32px}
.tasks ol,.usecase-list{gap:16px;max-width:70ch}
.details-body,.formal-body{max-width:78ch}
.formal-details{border-color:rgba(161,168,181,.18);background:var(--panel)}
.formal-details summary{min-height:60px;padding:16px 20px}
.formal-details summary:hover{background:rgba(217, 181, 133,.035)}
.canvas-wrap{border-color:rgba(161,168,181,.22)}
.control{padding:16px 12px 4px;background:var(--panel);border-top-color:rgba(161,168,181,.18)}
.control-row{padding:16px 18px 10px;background:var(--panel);border-top-color:rgba(161,168,181,.18)}
button:focus-visible,a:focus-visible,summary:focus-visible,input:focus-visible{outline:2px solid #d9b585;outline-offset:4px}
a{ text-underline-offset:.25em }
@media(max-width:760px){
 .site-header{padding-inline:20px}
 .page-shell,body>main{width:calc(100% - 40px);padding-top:32px}
 h1{overflow-wrap:break-word}
 .deck{font-size:1.12rem;line-height:1.65}
 .topic-en,.topic-zh{font-size:20px;line-height:1.4}
 .controls{display:grid;grid-template-columns:minmax(0,1fr);gap:12px;overflow:visible}
 .control{width:100%;min-width:0}
 .control input{min-width:0}
 .control{padding-inline:8px}
 .tasks,.usecases,.formal,.links{margin-top:36px;padding-top:28px}
 .summary-hint{white-space:normal;text-align:right}
}
