* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: #14181d;
  color: #dde3ea;
}

#app { display: flex; flex-direction: column; height: 100vh; }

header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 10px 16px;
  background: #1b2129;
  border-bottom: 1px solid #2a323d;
}
header h1 { font-size: 16px; margin: 0; font-weight: 600; }
header .sub { font-size: 12px; color: #8b98a8; }

#nav-toggle {
  background: #232b34;
  border: 1px solid #323c48;
  border-radius: 6px;
  color: #cfd8e3;
  font-size: 16px;
  line-height: 1;
  padding: 6px 10px;
  cursor: pointer;
}
#nav-toggle:hover { background: #2b3540; }

#main { display: flex; flex: 1; min-height: 0; }

#sidebar {
  width: 280px;
  flex-shrink: 0;
  overflow-y: auto;
  padding: 12px;
  background: #171c22;
  border-right: 1px solid #2a323d;
}
#sidebar.collapsed { display: none; }

@media (max-width: 768px) {
  header .sub { display: none; }
}
#sidebar h2 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #8b98a8;
  margin: 16px 0 8px;
}
#sidebar section:first-child h2 { margin-top: 4px; }

#sample-list { list-style: none; margin: 0; padding: 0; }
#sample-list li { margin: 4px 0; }
#sample-list a {
  display: block;
  padding: 8px 10px;
  border-radius: 6px;
  background: #1f2730;
  color: #9fc7ff;
  text-decoration: none;
  font-size: 13px;
}
#sample-list a:hover { background: #26303c; }
#sample-list a.active { background: #2b3b52; color: #cfe4ff; }

.btn-list { list-style: none; margin: 0; padding: 0; }
.btn-list li { margin: 4px 0; }
.btn-list button {
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid #2c3641;
  background: #1f2730;
  color: #9fc7ff;
  font-size: 13px;
  cursor: pointer;
}
.btn-list button:hover { background: #26303c; }

#scene-list { list-style: none; margin: 0; padding: 0; }
#scene-list li {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 4px 0;
}
#scene-list .item-name {
  flex: 1;
  padding: 8px 10px;
  border-radius: 6px;
  background: #1f2730;
  color: #cfd8e3;
  font-size: 13px;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#scene-list .item-name:hover { background: #26303c; }
#scene-list li.selected .item-name { background: #2b3b52; color: #cfe4ff; }
#scene-list .item-del {
  flex-shrink: 0;
  padding: 7px 10px;
  border-radius: 6px;
  border: 1px solid #453039;
  background: #2c1f24;
  color: #ff9fa8;
  font-size: 13px;
  cursor: pointer;
}
#scene-list .item-del:hover { background: #3d2a30; }

.hint { font-size: 12px; color: #68737f; margin: 4px 0 0; }

#dropzone {
  border: 1.5px dashed #3a4654;
  border-radius: 8px;
  padding: 14px 10px;
  text-align: center;
  font-size: 12.5px;
  color: #aeb9c6;
  transition: border-color .15s, background .15s;
}
#dropzone.dragover { border-color: #5aa2ff; background: #1c2635; }
#dropzone p { margin: 6px 0; }
#dropzone .or { color: #5c6875; }
#file-input { font-size: 12px; max-width: 100%; }

#model-info pre {
  font-size: 12px;
  background: #10141a;
  border: 1px solid #232b34;
  border-radius: 6px;
  padding: 8px;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
}

#viewport { position: relative; flex: 1; min-width: 0; }
#canvas { display: block; width: 100%; height: 100%; touch-action: none; }

#overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(16, 20, 26, .82);
  font-size: 14px;
  color: #cfd8e3;
  pointer-events: none;
  transition: opacity .2s;
}
#overlay.hidden { opacity: 0; }

#toolbar {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  z-index: 10;
}
#toolbar button {
  padding: 8px 14px;
  border-radius: 6px;
  border: 1px solid #323c48;
  background: rgba(27, 33, 41, .92);
  color: #cfd8e3;
  font-size: 13px;
  cursor: pointer;
}
#toolbar button:hover { background: #26303c; }
#toolbar button.active { background: #2b3b52; color: #cfe4ff; border-color: #4a6a9a; }
#toolbar button:disabled { opacity: .4; cursor: default; }

#toolbar-hint {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11.5px;
  color: #8b98a8;
  background: rgba(20, 24, 29, .75);
  padding: 5px 12px;
  border-radius: 12px;
  pointer-events: none;
  white-space: nowrap;
}
@media (max-width: 768px) {
  #toolbar-hint { display: none; }
}
