* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: #fff;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  overflow: hidden;
}

/* 管理面板：默认隐藏，连点 5 次或 ?edit 才出现 */
.admin {
  position: fixed;
  inset: 0;
  margin: 0;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: rgba(255, 255, 255, .97);
  color: #111;
  font-family: system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 15px;
}

.admin[hidden] { display: none; }

textarea,
input {
  width: 100%;
  font: inherit;
  padding: 10px 12px;
  border: 1px solid #ccc;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  outline: none;
}

textarea {
  flex: 1;
  resize: none;
  min-height: 40vh;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 14px;
  line-height: 1.6;
}

textarea:focus,
input:focus { border-color: #888; }

.actions { display: flex; gap: 8px; }

button {
  font: inherit;
  padding: 10px 16px;
  border: 1px solid #ccc;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

button:active { opacity: .6; }

#msg {
  margin: 0;
  min-height: 1.2em;
  font-size: 13px;
  color: #666;
}

@media (prefers-color-scheme: dark) {
  html, body { background: #000; }

  .admin {
    background: rgba(0, 0, 0, .97);
    color: #eee;
  }

  textarea, input, button { border-color: #444; }
  #msg { color: #999; }
}
