/* 触摸屏测试：铺满屏幕的测试层、退出按钮、结果小图；只用变量 */
.ts-result { margin: 10px 0 0; font: 13px/1.6 var(--sans); color: var(--ink-2); }
.ts-kv td { word-break: normal; overflow-wrap: anywhere; }
@media (max-width: 560px) { .ts-kv th { width: 40%; white-space: normal; } }
.ts-mini { display: block; width: min(100%, 240px); margin-top: 10px; border: 1px solid var(--rule); }

.ts-stage { position: fixed; inset: 0; z-index: 1000; background: var(--paper); touch-action: none; overflow: hidden; outline: none; user-select: none; -webkit-user-select: none; }
.ts-stage[hidden] { display: none; }
.ts-stage canvas { position: absolute; left: 0; top: 0; touch-action: none; }
html.stage-open, html.stage-open body { overflow: hidden; overscroll-behavior: none; }
.ts-hud { position: absolute; left: 12px; top: 12px; max-width: calc(100% - 140px); margin: 0; padding: 6px 10px; background: var(--paper); color: var(--ink); border: 1px solid var(--rule); font: 12px/1.5 var(--mono); pointer-events: none; }
.ts-hint {
  position: absolute; left: 50%; bottom: 24px; max-width: min(90vw, 640px); margin: 0;
  transform: translate(-50%, 8px); padding: 8px 12px;
  background: var(--paper); color: var(--ink); border: 1px solid var(--ink);
  font: 12px/1.5 var(--mono); text-align: center; opacity: 0; pointer-events: none;
  transition: opacity .2s var(--ease), transform .2s var(--ease);
}
.ts-hint.show { opacity: 1; transform: translate(-50%, 0); }
.ts-exit {
  position: absolute; top: 12px; right: 12px; z-index: 1; min-width: 44px; min-height: 44px; padding: 0 14px;
  background: var(--paper); color: var(--ink); border: 1px solid var(--ink); font: 600 13px/1 var(--mono); cursor: pointer;
}
.ts-exit:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.guide { max-width: 76ch; margin-top: clamp(48px, 8vh, 72px); padding-top: 8px; border-top: 2px solid var(--ink); }
.guide h2 { margin: 28px 0 10px; font: 600 15px/1.4 var(--mono); }
.guide p { margin: 0 0 10px; font: 14px/1.75 var(--sans); color: var(--ink); overflow-wrap: anywhere; }
@media (prefers-reduced-motion: reduce) { .ts-hint { transition: none; } }
