* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { width: 100%; height: 100%; overflow: hidden; background: #10141b;
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", monospace; }
#app { position: fixed; inset: 0; }
#scene canvas { display: block; image-rendering: pixelated; touch-action: none; }
button, a, input, select, textarea { touch-action: manipulation; }
html, body { overflow-x: hidden; }
#labels { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 5; }
.tag { position: absolute; transform: translate(-50%, -100%); pointer-events: none;
  font-size: 11px; line-height: 1.35; color: #f4ead2; text-align: center;
  background: rgba(12, 16, 24, 0.72); border: 1px solid rgba(244, 234, 210, 0.28);
  border-radius: 4px; padding: 2px 6px; white-space: nowrap; }
.tag small { display: block; color: #9fd0a8; font-size: 10px; }
.tag.ops { color: #ffd98a; font-size: 10px; }
.badge { position: absolute; transform: translate(-50%, -50%); pointer-events: auto; cursor: pointer;
  font-size: 11px; color: #10141b; background: #ffd34d; border: 2px solid #10141b;
  border-radius: 10px; padding: 1px 7px; font-weight: 700; }
.bubble { position: absolute; transform: translate(-50%, -130%); background: #fff;
  color: #222; border: 2px solid #222; border-radius: 8px; padding: 3px 8px;
  font-size: 13px; font-weight: 600; pointer-events: none; z-index: 6; max-width: 46vw; }
.panel { position: fixed; left: 14px; top: 14px; z-index: 10; width: 300px;
  max-width: calc(100vw - 28px); max-height: calc(100vh - 28px); max-height: calc(100dvh - 28px); overflow: auto;
  background: rgba(10, 15, 24, 0.86); border: 1px solid rgba(140, 190, 255, 0.25);
  border-radius: 12px; padding: 12px 14px; color: #dbeafe; backdrop-filter: blur(8px); }
.panel h1 { font-size: 15px; margin-bottom: 2px; }
.panel .sub { font-size: 11px; color: #8fa3bf; margin-bottom: 8px; }
.panel select { width: 100%; margin-bottom: 8px; background: #16202f; color: #dbeafe;
  border: 1px solid rgba(140,190,255,.3); border-radius: 6px; padding: 5px; }
.row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.btn { font-size: 11px; padding: 5px 10px; border-radius: 14px; cursor: pointer;
  border: 1px solid rgba(140,190,255,.35); background: transparent; color: #dbeafe;
  transition: background 0.2s ease, transform 0.12s ease; }
.btn:hover { background: rgba(90,150,255,.25); }
.btn:active { transform: scale(0.97); }
.btn.on { background: rgba(90,150,255,.25); }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid #8fd0ff; outline-offset: 2px; }
html { scroll-behavior: smooth; }
.btn.warn { border-color: rgba(255,180,120,.5); }
#info { font-size: 11px; color: #c9d8ee; background: rgba(255,255,255,.05);
  border-radius: 8px; padding: 8px; min-height: 60px; white-space: pre-wrap; }
#audit { margin-top: 8px; font-size: 10px; color: #8fa3bf; }
#audit div { border-top: 1px dashed rgba(140,190,255,.2); padding: 3px 0; }
.legend { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 8px; font-size: 10px;
  color: #9fb2cc; margin: 6px 0; }
.hint { position: fixed; right: 14px; bottom: 12px; z-index: 10; font-size: 11px;
  color: rgba(190,210,240,.75); background: rgba(10,16,26,.6); padding: 6px 12px;
  border-radius: 14px; border: 1px solid rgba(140,190,255,.2); }
@media (max-width: 640px) { .panel { width: calc(100vw - 28px); } .tag { font-size: 10px; } }
/* 全屏与面板隐藏 */
.panel.hidden { display: none; }
#panelShow { position: fixed; left: 14px; top: 14px; z-index: 11; display: none;
  font-size: 16px; padding: 8px 12px; border-radius: 50%; cursor: pointer;
  background: rgba(10, 16, 26, 0.8); color: #dbeafe;
  border: 1px solid rgba(140, 190, 255, 0.35); }
#panelShow:hover { background: rgba(90, 150, 255, 0.3); }
/* 全屏模式下提示条更收敛 */
:fullscreen .hint { opacity: 0.55; }
/* NPC 交谈挂件 */
#npcBox { margin-top: 8px; background: rgba(255,255,255,.05); border-radius: 8px; padding: 8px; }
#npcHint { font-size: 11px; color: #9fd0a8; margin-bottom: 6px; }
#npcOut { font-size: 12px; color: #e6eefc; line-height: 1.7; max-height: 150px;
  overflow-y: auto; white-space: pre-wrap; margin-bottom: 6px; }
#npcOut:empty { display: none; }
#npcOut .me { color: #9fd0a8; }
#npcOut .npc { color: #e6eefc; }
#npcOut .sys { color: #8fa3bf; font-size: 11px; }
#quests { font-size: 11px; line-height: 1.8; margin: 6px 0; }
#quests:empty { display: none; }
#quests .q b { color: #ffd34d; font-weight: 600; }
#quests .q.done b { color: #39d353; }
#quests .q span { color: #8fa3bf; margin-left: 6px; }
.npcRow { display: flex; gap: 6px; }
.npcRow input { flex: 1; min-width: 0; font-size: 16px; background: #101826; color: #dbeafe;
  border: 1px solid rgba(140,190,255,.3); border-radius: 8px; padding: 8px; }
.npcRow .btn { flex: none; }
#fade { position: fixed; inset: 0; background: #000; opacity: 0;
  transition: opacity 0.35s; pointer-events: none; z-index: 40; }
@media (max-width: 760px) { /* 窄屏触控：导航与按钮手指化 */
  #viewbar a { font-size: 13px; padding: 10px 14px; }
  .btn { font-size: 13px; padding: 10px 14px; min-height: 44px; }
  .panel select, .panel input { font-size: 16px; }
}
