/* 屏幕坏点测试：色块按钮、全屏层、闪烁方块；测试色由 app.js 用 el.style 设置（DESIGN.md §1 例外），这里只用变量 */
.bar-note { font: 12px/1.5 var(--mono); color: var(--ink-2); }

.swatches { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.sw {
  display: flex; align-items: center; gap: 8px; min-width: 0; min-height: 40px; padding: 6px 10px;
  border: 1px solid var(--rule); background: var(--paper); color: var(--ink);
  font: 13px/1.3 var(--sans); text-align: left; cursor: pointer;
  transition: border-color .15s var(--ease);
}
.sw:hover { border-color: var(--ink); }
.sw:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sw .chip { flex: none; width: 22px; height: 22px; border: 1px solid var(--field-line); }

.custom { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; }
.custom label { font: 12px/1.5 var(--mono); color: var(--ink-2); }
.custom .field { flex: 1 1 160px; min-width: 0; }
.custom input[type=color] { width: 40px; height: 34px; padding: 2px; border: 1px solid var(--field-line); background: var(--paper); cursor: pointer; }

.flash-box { margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--rule); max-width: 76ch; }
.flash-box h2 { margin: 0 0 6px; font: 600 15px/1.4 var(--mono); }
.flash-box p { margin: 0 0 12px; font: 14px/1.7 var(--sans); color: var(--ink); }
.flash-warn { margin-top: 12px; padding: 12px 14px; border: 1px solid var(--accent); }
.flash-warn .warn { color: var(--accent); }
.flash-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }

/* 全屏层：盖住页面和 build 注入的 .topbar（z-index 20） */
.stage { position: fixed; inset: 0; z-index: 1000; outline: none; cursor: crosshair; overflow: hidden; }
.stage[hidden] { display: none; }
.stage.idle, .stage.idle .flash { cursor: none; }
html.stage-open, html.stage-open body { overflow: hidden; }
.stage-hint {
  position: absolute; left: 50%; bottom: 24px; max-width: min(90vw, 640px);
  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);
}
.stage-hint.show { opacity: 1; transform: translate(-50%, 0); }
.stage-exit {
  position: absolute; top: 12px; right: 12px; z-index: 1; min-height: 40px; padding: 0 14px;
  background: var(--paper); color: var(--ink); border: 1px solid var(--ink); font: 600 13px/1 var(--mono); cursor: pointer;
  transition: opacity .2s var(--ease);
}
.stage-exit:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.stage.idle .stage-exit { opacity: 0; pointer-events: none; }
.flash { position: absolute; left: 0; top: 0; touch-action: none; cursor: grab; }
.flash:active { cursor: grabbing; }

.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 (max-width: 560px) {
  .swatches { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bar-note { flex-basis: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .sw, .stage-hint, .stage-exit { transition: none; }
}
