/* 鍵盤測試 */
.kb-mobile { display: none; }
@media (max-width: 700px), (pointer: coarse) { .kb-mobile { display: block; } }
.kb-stage { position: relative; border: 2px solid var(--line); border-radius: 12px; background: var(--soft); padding: 10px; cursor: pointer; }
.kb-stage:focus { outline: none; }
.kb-stage.on { border-color: var(--brand); box-shadow: 0 0 0 3px #bcd0ff; }
.kb-hint { font-size: .95rem; color: var(--muted); margin-bottom: 8px; text-align: center; }
.kb-stage.on .kb-hint { color: var(--brand-dark); font-weight: 600; }
.kb-scroll { overflow-x: auto; }
.kb-board { --kh: 38px; display: flex; gap: 10px; min-width: 640px; font-size: .68rem; user-select: none; }
.kb-blk { display: grid; grid-template-rows: var(--kh) calc(var(--kh) * .4) repeat(5, var(--kh)); row-gap: 4px; }
.kb-main { flex: 15; }
.kb-nav { flex: 3; grid-template-columns: repeat(3, 1fr); column-gap: 4px; }
.kb-pad { flex: 4; grid-template-columns: repeat(4, 1fr); column-gap: 4px; }
.kb-row { display: flex; gap: 3px; min-width: 0; }
.kb-gap { flex: 0 0 auto; }
.kb-key { position: relative; flex: 1 1 0; min-width: 0; display: flex; align-items: center; justify-content: center; border: 1px solid #aeb4bd; border-bottom-width: 3px; border-radius: 6px; background: #fff; color: var(--fg); overflow: hidden; text-align: center; line-height: 1.1; padding: 0 1px; }
.kb-key.tested { background: #d1fae5; border-color: #34a37a; color: #064e3b; }
.kb-key.down { background: var(--brand); border-color: var(--brand-dark); color: #fff; transform: translateY(2px); }
.kb-key.chat { background: #fee2e2; border-color: var(--bad); color: #7f1d1d; }
.kb-key.down.chat { background: var(--bad); color: #fff; }
.kb-key .kb-c { position: absolute; top: 1px; right: 3px; font-size: .62rem; font-weight: 700; opacity: .85; }
.kb-key .kb-ok { position: absolute; bottom: 0; left: 2px; right: 0; font-size: .55rem; line-height: 1; padding-bottom: 1px; opacity: .8; }
.kb-nokey { display: inline-block; border: 1px dashed #aeb4bd; border-radius: 6px; padding: 0 8px; margin-right: 6px; color: var(--muted); background: repeating-linear-gradient(45deg, #fff, #fff 4px, #f3f5f8 4px, #f3f5f8 8px); }
.kb-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 10px 0; }
.kb-stat { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; background: #fff; min-width: 0; }
.kb-stat span { display: block; font-size: .9rem; color: var(--muted); }
.kb-stat strong { display: block; font-size: 1.5rem; line-height: 1.3; color: var(--brand-dark); overflow-wrap: anywhere; }
.kb-stat small { color: var(--muted); font-size: .85rem; }
.kb-th select { min-height: 44px; }
.kb-h3 { font-size: 1.05rem; margin: 1rem 0 .4rem; }
.kb-log { margin: 0; padding-left: 1.4rem; font-size: .95rem; max-height: 220px; overflow: auto; }
ul.kb-log { list-style: disc; }
.kb-log li { margin: 2px 0; overflow-wrap: anywhere; }
.kb-log .kb-empty { color: var(--muted); list-style: none; margin-left: -1.4rem; }
.kb-log code { background: var(--soft); border-radius: 4px; padding: 0 4px; }
@media (max-width: 480px) { .kb-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
