/* Sketchfab-style Toolbar (vanilla) */
/* 放到你的样式里，容器本身需要是 position:relative 或者交给 JS 设置 */

.sf-toolbar {
  position: absolute;
  right: 16px;
  bottom: 16px;
  z-index: 50;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    Helvetica, Arial;
}
.sf-toolbar--fixed {
  position: fixed;
}

.sf-toolbar-row {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.sf-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(33, 33, 33, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  outline: none;
  transition: transform 0.15s ease, background 0.15s ease,
    border-color 0.15s ease;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}
/* 统一白色：对外链 <img src="*.svg"> 用滤镜转白色 */
.sf-btn img.sf-icon {
  display: block;
  filter: invert(1) grayscale(1) brightness(1.6);
}
/* 可分别控制两个图标的尺寸（默认 18px，可被 JS/内联样式覆盖） */
.sf-toolbar {
  --sf-360-size: 18px;
  --sf-rotate-size: 18px;
}
.sf-btn--360 .sf-icon {
  width: var(--sf-360-size);
  height: var(--sf-360-size);
}
.sf-btn--rotate .sf-icon {
  width: var(--sf-rotate-size);
  height: var(--sf-rotate-size);
}
.sf-btn:hover {
  transform: translateY(-1px);
  background: rgba(28, 28, 28, 0.95);
  border-color: rgba(255, 255, 255, 0.24);
}
.sf-btn:active {
  transform: translateY(0);
}
.sf-btn.is-active {
  background: #049ef4;
}

.sf-btn-wrap {
  position: relative;
}

.sf-anno-menu {
  position: absolute;
  right: 0px;
  bottom: 48px;
  min-width: 260px;
  max-width: 320px;
  background: rgba(16, 16, 16, 0.98);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.sf-insp-menu {
  position: absolute;
  right: 0px;
  bottom: 48px;
  min-width: 260px;
  max-width: 320px;
  background: rgba(16, 16, 16, 0.98);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}
.sf-insp-menu::after {
  content: "";
  position: absolute;
  /* 由 JS 计算并写入 --insp-caret-right；无值时回退到 143px */
  right: var(--insp-caret-right, 143px);
  bottom: -7px;
  width: 12px;
  height: 12px;
  background: inherit;
  border-right: 1px solid rgba(255, 255, 255, 0.12);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  transform: rotate(45deg);
}

.sf-anno-menu::after {
  content: "";
  position: absolute;
  right: 53px;
  bottom: -7px;
  width: 12px;
  height: 12px;
  background: inherit;
  border-right: 1px solid rgba(255, 255, 255, 0.12);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  transform: rotate(45deg);
}

.sf-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px;
  border-radius: 8px;
}
.sf-field:hover {
  background: rgba(255, 255, 255, 0.04);
}
.sf-field-title {
  font-size: 13px;
  opacity: 0.9;
}
.sf-field-ctrl {
  display: flex;
  align-items: center;
}

.sf-switch {
  position: relative;
  width: 46px;
  height: 26px;
  background: #3a3a3a;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  cursor: pointer;
  transition: background 0.15s ease;
}
.sf-switch::after {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  left: 3px;
  top: 50%;
  transform: translateY(-50%);
  background: #fff;
  border-radius: 9999px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  transition: left 0.15s ease;
}
.sf-switch.is-on {
  background: #049ef4;
}
.sf-switch.is-on::after {
  left: 23px;
}

.sf-select {
  background: #1f1f1f;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.12);
  height: 30px;
  border-radius: 8px;
  padding: 0 8px;
}
.sf-select:focus {
  outline: none;
  border-color: #0ea5b6;
  box-shadow: 0 0 0 3px rgba(14, 165, 182, 0.25);
}

.sf-hidden {
  display: none !important;
}
