* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: -apple-system, "PingFang SC", "Helvetica Neue", sans-serif;
}

#scene { display: block; width: 100%; height: 100%; }

/* 顶部工具栏 */
#toolbar {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 14px;
  z-index: 10;
}

#toolbar button {
  width: 52px;
  height: 52px;
  border: none;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s, background 0.3s;
}

#toolbar button:hover { transform: scale(1.08); }
#toolbar button.active { background: #ffd66b; }

#toolbar svg {
  width: 24px;
  height: 24px;
  fill: #444;
}

/* 加载条 */
#loading {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #e9e7e3;
  z-index: 20;
  transition: opacity 0.4s;
}
#loading.hidden { opacity: 0; pointer-events: none; }
#loading .bar {
  width: 220px;
  height: 4px;
  background: #d4d1cb;
  border-radius: 2px;
  overflow: hidden;
}
#loading .fill {
  width: 0%;
  height: 100%;
  background: #666;
  transition: width 0.2s;
}

/* 物件列表面板 */
#panel {
  position: fixed;
  top: 0;
  right: -280px;
  width: 280px;
  height: 100%;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: -2px 0 12px rgba(0, 0, 0, 0.1);
  padding: 80px 20px 20px;
  transition: right 0.3s;
  z-index: 9;
  overflow-y: auto;
}
#panel.open { right: 0; }
#panel h2 { font-size: 15px; color: #333; margin-bottom: 12px; }
#panel ul { list-style: none; }
#panel li {
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 13px;
  color: #555;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#panel li:hover { background: #f0ede8; color: #111; }

/* 夜间模式 */
body.night #panel { background: rgba(30, 30, 34, 0.96); }
body.night #panel h2 { color: #ddd; }
body.night #panel li { color: #aaa; }
body.night #panel li:hover { background: #2c2c31; color: #fff; }
body.night #toolbar button { background: #2c2c31; }
body.night #toolbar svg { fill: #ccc; }
body.night #toolbar button.active { background: #5a5230; }
