* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  background: transparent;
  font-family: system-ui, -apple-system, "PingFang TC", "Microsoft JhengHei", "Noto Sans TC", sans-serif;
  color: #2b2b2b;
}

#canvas-wrap {
  position: fixed;
  inset: 0;
}

#canvas-wrap canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

#topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  padding: 14px 18px 10px;
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(255,255,255,0.85), rgba(255,255,255,0));
}

#topbar h1 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
}

#topbar p {
  margin: 2px 0 0;
  font-size: 12px;
  color: #6b6b6b;
}

body.embed #topbar {
  display: none;
}

#view-controls {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 10;
  display: flex;
  gap: 6px;
  background: rgba(255,255,255,0.75);
  backdrop-filter: blur(8px);
  border-radius: 999px;
  padding: 4px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

body.embed #view-controls {
  top: 12px;
  right: 12px;
}

.view-btn {
  border: none;
  background: transparent;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: #555;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
  min-height: 36px;
}

.view-btn:hover {
  background: rgba(0,0,0,0.05);
}

.view-btn[data-view="skeleton"].active {
  background: #C9AE87;
  color: #fff;
}

.view-btn[data-view="muscle"].active {
  background: #B5432E;
  color: #fff;
}

.view-btn[data-view="both"].active {
  background: linear-gradient(135deg, #C9AE87, #B5432E);
  color: #fff;
}

#camera-controls {
  position: fixed;
  bottom: 16px;
  right: 16px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

#camera-controls button {
  border: none;
  background: rgba(255,255,255,0.75);
  backdrop-filter: blur(8px);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: #555;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  min-height: 34px;
}

#camera-controls button:hover {
  background: rgba(255,255,255,0.95);
}

#info-panel {
  position: fixed;
  left: 16px;
  bottom: 16px;
  z-index: 10;
  display: none;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(8px);
  border-radius: 14px;
  padding: 10px 16px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  max-width: min(60vw, 320px);
}

#info-panel.visible {
  display: flex;
}

#info-panel .badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  color: #fff;
  white-space: nowrap;
}

#info-panel .badge.skeleton {
  background: #C9AE87;
}

#info-panel .badge.muscle {
  background: #B5432E;
}

#info-label {
  font-size: 16px;
  font-weight: 700;
}

#hint {
  position: fixed;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  z-index: 9;
  font-size: 12px;
  color: #8a8a8a;
  pointer-events: none;
  transition: opacity 0.3s;
}

#info-panel.visible ~ #hint {
  opacity: 0;
}

body.embed #hint {
  bottom: 12px;
}
