:root {
  --bg: #0a1424;
  --panel: rgba(12, 22, 40, 0.84);
  --line: rgba(56, 189, 248, 0.25);
  --text: #e2e8f0;
  --muted: #94a3b8;
  --accent: #38bdf8;
}

* { box-sizing: border-box; }

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

#scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

#labels {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.tag {
  position: absolute;
  left: 0;
  top: 0;
  pointer-events: auto;
  cursor: pointer;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(10, 20, 36, 0.82);
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  white-space: nowrap;
  transition: opacity 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.tag.hot { color: #fff; border-color: var(--accent); box-shadow: 0 0 12px rgba(56, 189, 248, 0.5); }
.tag.sel { border-color: #fde68a; color: #fde68a; }
.tag.dim { opacity: 0.35; }

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 64px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(180deg, rgba(10, 20, 36, 0.95), rgba(10, 20, 36, 0.4));
  border-bottom: 1px solid var(--line);
}
.topbar h1 { margin: 0; font-size: 18px; letter-spacing: 1px; }
.topbar p { margin: 2px 0 0; color: var(--muted); font-size: 12px; font-family: ui-monospace, Menlo, monospace; }
.actions { display: flex; gap: 12px; align-items: center; }
.check { color: var(--muted); display: flex; gap: 6px; align-items: center; }

button {
  font: inherit;
  color: var(--text);
  background: rgba(30, 58, 95, 0.55);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 12px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
button:hover { background: rgba(37, 99, 235, 0.45); border-color: var(--accent); }
button.on { background: rgba(14, 165, 233, 0.45); border-color: var(--accent); box-shadow: 0 0 10px rgba(56, 189, 248, 0.4); }

.panel {
  position: fixed;
  top: 84px;
  bottom: 96px;
  width: 300px;
  padding: 14px 16px;
  overflow-y: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  backdrop-filter: blur(6px);
}
.panel.left { left: 16px; width: 230px; }
.panel.right { right: 16px; }

h2 {
  margin: 4px 0 10px;
  font-size: 14px;
  color: var(--accent);
  letter-spacing: 0.5px;
}
.panel section + section { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }

.module-list { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 6px; }
.module-list button { width: 100%; text-align: left; padding: 6px 10px; }
.module-list button.sel { border-color: #fde68a; color: #fde68a; }

.log { list-style: none; margin: 0; padding: 0; font-size: 12px; color: var(--muted); }
.log li { padding: 4px 0; border-bottom: 1px dashed rgba(148, 163, 184, 0.15); }
.log time { display: inline-block; margin-right: 8px; color: #64748b; font-family: ui-monospace, Menlo, monospace; }

.desc { color: var(--muted); line-height: 1.6; margin: 0 0 10px; }
.specs { margin: 0 0 12px; padding-left: 18px; color: var(--text); line-height: 1.7; }
.principle {
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(56, 189, 248, 0.08);
  border-left: 3px solid var(--accent);
  line-height: 1.6;
  color: #cbd5e1;
}
.principle:empty { display: none; }

.steps h4 { margin: 10px 0 6px; font-size: 13px; }
.steps ol { margin: 0; padding-left: 20px; line-height: 1.8; color: #cbd5e1; }
.steps .hint { color: var(--muted); line-height: 1.6; }

.toolbar {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 10px 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  backdrop-filter: blur(6px);
  white-space: nowrap;
}
.toolbar .group { display: flex; gap: 6px; align-items: center; }
.toolbar .group + .group { padding-left: 14px; border-left: 1px solid var(--line); }
.slider { color: var(--muted); display: flex; gap: 8px; align-items: center; }
.slider input { width: 130px; accent-color: var(--accent); }

@media (max-width: 1100px) {
  .panel.left { display: none; }
  .toolbar { transform: translateX(-50%) scale(0.9); }
}
@media (max-width: 860px) {
  .panel.right { display: none; }
  .toolbar { flex-wrap: wrap; justify-content: center; max-width: 95vw; }
}
