*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  background: #060b18;
  color: #e2e8f0;
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
}

.mn-root {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 100vh;
  min-height: 100dvh;
}

.mn-canvas-wrap {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 100vh;
  min-height: 100dvh;
}

#mnCanvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

.mn-hud {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: calc(8px + env(safe-area-inset-top, 0)) 12px 8px;
  pointer-events: none;
  z-index: 2;
}

.mn-hud-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  pointer-events: auto;
  flex-wrap: wrap;
}

.mn-mode-switch {
  display: inline-flex;
  background: rgba(15, 23, 42, 0.72);
  border-radius: 999px;
  padding: 2px;
  gap: 2px;
}

.mn-mode-btn {
  border: none;
  background: transparent;
  color: rgba(148, 163, 184, 0.95);
  font-size: 13px;
  font-weight: 600;
  padding: 5px 14px;
  border-radius: 999px;
  cursor: pointer;
}

.mn-mode-btn--on {
  background: rgba(59, 130, 246, 0.35);
  color: #e2e8f0;
}

.mn-back {
  border: none;
  background: rgba(15, 23, 42, 0.72);
  color: #93c5fd;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 14px;
  cursor: pointer;
}

.mn-stats {
  font-size: 12px;
  color: rgba(226, 232, 240, 0.82);
  background: rgba(15, 23, 42, 0.55);
  border-radius: 999px;
  padding: 4px 10px;
}

.mn-hint {
  margin-top: 6px;
  font-size: 11px;
  color: rgba(148, 163, 184, 0.88);
}

.mn-zoom {
  position: absolute;
  right: 10px;
  bottom: calc(72px + env(safe-area-inset-bottom, 0));
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 2;
  pointer-events: auto;
}

.mn-zoom button {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.78);
  color: #e2e8f0;
  font-size: 18px;
  cursor: pointer;
}

.mn-zoom-pct {
  text-align: center;
  font-size: 11px;
  color: rgba(148, 163, 184, 0.9);
}

.mn-panel {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom, 0));
  z-index: 3;
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid rgba(100, 116, 139, 0.35);
  border-radius: 14px;
  padding: 12px 14px;
  backdrop-filter: blur(8px);
}

.mn-panel-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mn-char {
  font-size: 36px;
  font-weight: 700;
  line-height: 1;
  color: #f8fafc;
}

.mn-meta {
  flex: 1;
  min-width: 0;
  font-size: 12px;
  color: rgba(203, 213, 225, 0.9);
}

.mn-meta strong { color: #93c5fd; }

.mn-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.mn-actions button {
  flex: 1;
  border: none;
  border-radius: 10px;
  padding: 10px 0;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.mn-btn-forget { background: rgba(239, 68, 68, 0.18); color: #fca5a5; }
.mn-btn-remember { background: rgba(34, 197, 94, 0.18); color: #86efac; }
.mn-btn-close {
  border: none;
  background: transparent;
  color: #94a3b8;
  font-size: 20px;
  line-height: 1;
  padding: 4px 8px;
  cursor: pointer;
}

.mn-loading, .mn-error {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  z-index: 5;
  background: #060b18;
  color: rgba(226, 232, 240, 0.92);
  font-size: 14px;
  line-height: 1.6;
}

.mn-error { color: #fca5a5; font-size: 14px; line-height: 1.6; }

.mn-empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  z-index: 4;
  pointer-events: none;
}

.mn-empty-title { font-size: 18px; font-weight: 600; margin-bottom: 8px; }
.mn-empty-desc { font-size: 13px; color: #94a3b8; max-width: 280px; }

.mn-toast {
  position: fixed;
  left: 50%;
  bottom: calc(96px + env(safe-area-inset-bottom, 0));
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.92);
  color: #e2e8f0;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px;
  z-index: 10;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}

.mn-toast.show { opacity: 1; }
