:root {
  --bg: #0d0f12;
  --panel: #16191e;
  --line: #2a2f37;
  --text: #e8e6e1;
  --muted: #9aa0a8;
  --accent: #c8a96a;      /* ROOTS 金 */
  --accent-2: #6f8f7d;    /* 青瓷绿 */
}

[hidden] { display: none !important; }

* { box-sizing: border-box; }
html, body {
  margin: 0; height: 100%;
  background: var(--bg); color: var(--text);
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  overflow: hidden;
}

#topbar {
  position: fixed; top: 0; left: 0; right: 0; height: 56px; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 18px; background: rgba(13,15,18,.72);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: baseline; gap: 10px; }
.brand-mark { font-weight: 700; letter-spacing: 3px; color: var(--accent); font-size: 18px; }
.brand-sub { color: var(--muted); font-size: 13px; letter-spacing: 1px; }
.actions { display: flex; gap: 8px; }

.btn {
  background: var(--accent); color: #1a1407; border: 0; border-radius: 8px;
  padding: 8px 14px; font-size: 13px; font-weight: 600; cursor: pointer;
  transition: opacity .15s;
}
.btn:hover { opacity: .88; }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.filebtn { display: inline-block; text-align: center; }

#stage { position: fixed; inset: 56px 0 28px 0; }
#stage canvas { display: block; width: 100%; height: 100%; }

.overlay {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(13,15,18,.86); z-index: 5;
}
.dropcard, .errcard {
  text-align: center; max-width: 460px; padding: 28px 32px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
}
.dropcard .icon { font-size: 46px; color: var(--accent-2); }
.dropcard h2, .errcard h2 { margin: 10px 0 6px; font-weight: 600; }
.dropcard p, .errcard p { color: var(--muted); font-size: 13px; line-height: 1.6; }
.dropcard .hint { margin-top: 14px; font-size: 11px; opacity: .7; }

#stage.dragover .dropcard { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(200,169,106,.25); }

.spinner {
  width: 38px; height: 38px; border-radius: 50%;
  border: 3px solid var(--line); border-top-color: var(--accent);
  animation: spin 1s linear infinite; margin-bottom: 14px;
}
@keyframes spin { to { transform: rotate(360deg); } }

#statusbar {
  position: fixed; bottom: 0; left: 0; right: 0; height: 28px; z-index: 10;
  display: flex; align-items: center; padding: 0 16px;
  background: rgba(13,15,18,.72); border-top: 1px solid var(--line);
  color: var(--muted); font-size: 12px;
}

/* ---------- 密码弹窗 ---------- */
.field { display: block; margin: 14px 0 10px; }
.field input {
  width: 100%; padding: 10px 12px; border-radius: 8px;
  background: #0f1216; border: 1px solid var(--line); color: var(--text);
  font-size: 14px; outline: none;
}
.field input:focus { border-color: var(--accent); }

/* ---------- 漫游模式 ---------- */
.btn.active { background: var(--accent-2); color: #06120c; }

#crosshair {
  position: absolute; left: 50%; top: 50%; width: 18px; height: 18px;
  margin: -9px 0 0 -9px; z-index: 6; pointer-events: none;
}
#crosshair::before, #crosshair::after {
  content: ''; position: absolute; background: rgba(255,255,255,.75);
}
#crosshair::before { left: 8px; top: 0; width: 2px; height: 18px; }
#crosshair::after  { top: 8px; left: 0; height: 2px; width: 18px; }

#walkHud.overlay {
  background: none; align-items: flex-end; justify-content: center;
  padding-bottom: 46px; pointer-events: none;
}
#walkHud .walkkeys {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 10px 18px; border-radius: 999px;
  background: rgba(13,15,18,.78); border: 1px solid var(--line);
  backdrop-filter: blur(8px); font-size: 12px; color: var(--muted);
}
#walkHud .walkkeys b { color: var(--accent); font-weight: 700; letter-spacing: 1px; }
#walkHud .walkkeys span { display: inline-flex; align-items: center; gap: 4px; }
kbd {
  display: inline-block; min-width: 20px; padding: 2px 6px; margin: 0 1px;
  border-radius: 5px; background: #232830; border: 1px solid #333a44;
  color: var(--text); font-size: 11px; font-family: ui-monospace, monospace; text-align: center;
}

/* ---------- 尺度面板 ---------- */
#scalePanel {
  position: absolute; left: 14px; bottom: 14px; z-index: 6;
  min-width: 300px; max-width: 440px; padding: 11px 14px;
  border-radius: var(--border-radius-lg, 12px);
  background: rgba(13,15,18,.78); border: 1px solid var(--line);
  backdrop-filter: blur(8px); font-size: 12px; color: var(--muted);
}
#scalePanel .scale-row { display: flex; align-items: center; gap: 10px; }
#scalePanel .scale-label { flex: 0 0 auto; color: var(--accent); letter-spacing: .5px; }
#scalePanel input[type="range"] { flex: 1; min-width: 120px; accent-color: var(--accent); }
#scalePanel .scale-val { flex: 0 0 auto; min-width: 46px; text-align: right; color: var(--text); }
#scalePanel .scale-info { margin-top: 7px; line-height: 1.6; font-size: 11.5px; }
#scalePanel .scale-info b { color: var(--text); font-weight: 500; }
.btn.off { opacity: .45; }
