/* 舞台尺寸与语义色沿用共享主题。 */
#stage { container-type: inline-size; }
/* 只有三维体积砖可拖动转视角；平面卡片让触摸滚动穿过画布。 */
.stage:not(.still) #cv { cursor: grab; touch-action: none; }
.stage:not(.still) #cv:active { cursor: grabbing; }
.stage.still #cv { cursor: default; touch-action: auto; }
.hud-tl .big, .hud-tl .sub, .tau, .tag { text-transform: none; }
.hud-tl .big { color: var(--sigma); }
:root:not([data-figure]):not([data-shot]):not([data-thumb-mode]) .lab .center > #stage { min-height: max(400px, var(--hud-min-height, 0px), var(--plot-min-height, 0px)); }
.hud-tl { max-width: calc(100% - 32px); }
.hud-bl { gap: 4px 14px; }
dl.ro .key dd { color: var(--violet); }
#stageLabels { position: absolute; inset: 0; pointer-events: none; }
#stageLabels .tag { position: absolute; transform: translate(-50%, -50%); white-space: nowrap; padding: 3px 7px; border: 1px solid var(--panel-edge); border-radius: 5px; background: var(--sheet); }
#stageLabels .violet { color: var(--violet); }
#stageLabels .magenta { color: var(--magenta); }
#stageLabels .cyan { color: var(--cyan); }
#stageLabels .slate { color: var(--dim); }
#stageLabels .amber { color: var(--amber); }
#angleHandle { position: absolute; z-index: 3; width: 32px; height: 32px; padding: 0; border: 2px solid var(--amber); border-radius: 50%; background: var(--sheet); color: var(--amber); text-transform: none; transform: translate(-50%, -50%); pointer-events: auto; cursor: ew-resize; touch-action: none; user-select: none; -webkit-user-select: none; }
#angleHandle[hidden] { display: none; }
#catalog { position: absolute; z-index: 2; font-family: var(--font-data); }
.catalog-title { text-align: center; font-size: 11px; color: var(--sigma); margin-bottom: 5px; }
#matrix { display: grid; gap: 2px; }
#matrix button, #matrix .cell { min-width: 0; height: var(--cell-height); display: flex; align-items: center; justify-content: center; padding: 0; font: inherit; font-size: 11px; border: 1px solid var(--panel-edge); background: var(--panel); color: var(--sigma); }
#matrix button { cursor: pointer; }
#matrix .diag { border-color: var(--amber); color: var(--amber); }
#matrix .escape { color: var(--magenta); }
#matrix .row-name { border: 0; background: transparent; color: var(--dim); }
#matrix .joined { color: var(--violet); }
.pair-list { max-height: 150px; overflow: auto; font-family: var(--font-data); overflow-wrap: anywhere; }
#readoutNote { overflow-wrap: anywhere; }
@container (max-width: 620px) {
  .hud-tl { left: 12px; max-width: calc(100% - 24px); }
  .hud-tl .big { font-size: 12px; }
  .hud-tl .sub { font-size: 10.5px; line-height: 1.35; }
  .hud-bl { left: 12px; right: 12px; bottom: 8px; font-size: 9px; gap: 3px 8px; }
  #stageLabels .tag { font-size: 10px; padding: 2px 5px; }
  #matrix button, #matrix .cell { font-size: 10px; }
}
@media (max-width: 520px) {
  :root:not([data-embed]):not([data-thumb-mode]):not([data-shot]) .lab .center { grid-template-rows: minmax(min-content, max(500px, 64vh)) auto auto; }
  .logo { font-size: clamp(16px, 5vw, 24px); }
}
