:root { color-scheme: dark; font-family: Arial, "Microsoft YaHei", sans-serif; background: #0c0f0d; color: #eef2ed; }
* { box-sizing: border-box; }
html, body, #viewport { width: 100%; height: 100%; margin: 0; overflow: hidden; touch-action: none; }
canvas { display: block; width: 100%; height: 100%; outline: none; }
.toolbar { position: fixed; top: 12px; left: 50%; z-index: 5; width: min(660px, calc(100% - 24px)); min-height: 52px; display: flex; align-items: center; gap: 8px; padding: 8px; transform: translateX(-50%); border: 1px solid #343b36; border-radius: 7px; background: #171b18e8; backdrop-filter: blur(12px); }
.toolbar label { flex: 1; display: grid; grid-template-columns: auto auto; gap: 2px 10px; color: #a8b0a9; font-size: 10px; }
.toolbar output { justify-self: end; color: #d8f45a; font: 700 10px monospace; }
.toolbar input { grid-column: 1 / -1; width: 100%; accent-color: #d8f45a; }
.toolbar button, .toolbar a { min-height: 34px; padding: 0 11px; display: grid; place-items: center; border: 1px solid #3b433d; border-radius: 4px; background: #222824; color: #eef2ed; text-decoration: none; font-size: 11px; white-space: nowrap; cursor: pointer; }
.toolbar button.active { border-color: #d8f45a; color: #d8f45a; }
.status { position: fixed; left: 12px; bottom: 12px; z-index: 4; display: flex; align-items: baseline; gap: 6px; padding: 8px 10px; border: 1px solid #303631; border-radius: 5px; background: #171b18da; color: #929b94; font-size: 10px; }
.status strong { color: #d8f45a; font: 700 14px monospace; }
.interaction-hint { position: fixed; left: 50%; bottom: 14px; z-index: 4; max-width: calc(100% - 210px); padding: 8px 11px; transform: translateX(-50%); border: 1px solid #303631; border-radius: 5px; background: #171b18da; color: #bec6bf; font-size: 10px; text-align: center; pointer-events: none; }
.center-pulse { position: fixed; z-index: 6; width: 14px; height: 14px; margin: -7px 0 0 -7px; border: 2px solid #d8f45a; border-radius: 50%; opacity: 0; pointer-events: none; }
.center-pulse::before, .center-pulse::after { content: ''; position: absolute; left: 50%; top: 50%; background: #d8f45a; transform: translate(-50%, -50%); }
.center-pulse::before { width: 22px; height: 1px; }
.center-pulse::after { width: 1px; height: 22px; }
.center-pulse.show { animation: center-picked .7s ease-out; }
@keyframes center-picked { 0% { opacity: 1; transform: scale(.55); } 65% { opacity: 1; } 100% { opacity: 0; transform: scale(2); } }
.loading, .error { position: fixed; inset: 0; z-index: 10; display: grid; place-items: center; padding: 24px; background: #0c0f0d; color: #d8f45a; font-size: 12px; text-align: center; }
.loading-card { width: min(360px, calc(100vw - 48px)); display: grid; gap: 14px; }
.loading-card strong { font: 700 12px/1.4 Arial, "Microsoft YaHei", sans-serif; }
.loading-track { width: 100%; height: 6px; overflow: hidden; border: 1px solid #343b36; border-radius: 999px; background: #171b18; }
.loading-track i { display: block; width: 0; height: 100%; border-radius: inherit; background: #d8f45a; transition: width .2s ease; }
.error { color: #f2a879; }
.hidden { display: none; }
@media (max-width: 560px) {
  .toolbar { top: 8px; width: calc(100% - 16px); flex-wrap: wrap; }
  .toolbar label { flex-basis: 100%; }
  .toolbar button, .toolbar a { flex: 1; }
  .interaction-hint { bottom: 54px; max-width: calc(100% - 24px); }
}
