/* =========================================================
   牙齿小宇宙 · 3D 口腔沙盘视图样式
   仅作用于 .sbx- 前缀，不污染全局
   ========================================================= */

/* ---------------- 布局骨架 ---------------- */
.sbx-root {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 2px 0 18px;
  min-width: 0;
  /* 只做透明度入场：不能带 transform，否则会再次给 fixed 抽屉制造包含块 */
  animation: sbx-view-in .4s var(--ease-out) both;
}
@keyframes sbx-view-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ---------------- 顶部工具条 ---------------- */
.sbx-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.sbx-seg {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-1);
  flex-shrink: 0;
}
.sbx-seg-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 14px;
  border-radius: var(--radius-pill);
  font-size: 13.5px;
  font-weight: 800;
  color: var(--ink-soft);
  white-space: nowrap;
  transition: background .2s var(--ease-out), color .2s, box-shadow .2s, transform .2s var(--ease-spring);
  -webkit-tap-highlight-color: transparent;
}
.sbx-seg-btn:active { transform: scale(.96); }
.sbx-seg-btn.is-on {
  background: var(--coral);
  color: #fff;
  box-shadow: 0 6px 14px rgba(232, 92, 77, .28);
}
.sbx-seg-btn i {
  font-style: normal;
  font-size: 10.5px;
  font-weight: 800;
  line-height: 1.5;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--bg-soft);
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
}
.sbx-seg-btn.is-on i { background: rgba(255, 255, 255, .3); color: #fff; }
.sbx-set-desc {
  display: none;
  flex: 1;
  min-width: 0;
  margin: 0;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sbx-list-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  min-height: 44px;
  padding: 0 14px;
  border-radius: var(--radius-pill);
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-1);
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-soft);
  white-space: nowrap;
  transition: background .18s, color .18s, transform .18s var(--ease-spring);
}
.sbx-list-toggle:active { transform: scale(.95); }

/* ---------------- 牙齿侦探任务条 ---------------- */
.sbx-mission-wrap { position: relative; z-index: 20; min-width: 0; }
.sbx-mission {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 52px;
  padding: 4px 6px 4px 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow-1);
  transition: background .3s var(--ease-out), border-color .3s;
}
.sbx-mission.is-playing {
  background: linear-gradient(120deg, #FFF8EC, #FFEDE7);
  border-color: rgba(255, 122, 107, .26);
}
.sbx-mission.is-done {
  background: linear-gradient(120deg, #FFF7DE, #FFEDB8);
  border-color: rgba(224, 162, 30, .32);
}
.sbx-mission.is-disabled { opacity: .82; }
.sbx-mission-icon { flex-shrink: 0; font-size: 19px; line-height: 1; }
.sbx-mission-text {
  flex: 1;
  min-width: 0;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sbx-mission-dots {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 44px;
  min-height: 44px;
  padding: 0 4px;
  border-radius: 999px;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}
.sbx-mdot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(61, 48, 33, .16);
  transition: background .25s, transform .25s var(--ease-spring);
}
.sbx-mdot.is-done { background: var(--teal); }
.sbx-mdot.is-current { background: var(--coral); transform: scale(1.35); animation: sbx-pulse 1.4s ease-in-out infinite; }
.sbx-mission-actions { display: inline-flex; align-items: center; gap: 5px; flex-shrink: 0; }
.sbx-mission-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 14px;
  border-radius: var(--radius-pill);
  background: var(--coral);
  color: #fff;
  font-size: 12.5px;
  font-weight: 800;
  white-space: nowrap;
  box-shadow: 0 6px 14px rgba(232, 92, 77, .26);
  transition: background .18s, transform .18s var(--ease-spring);
  -webkit-tap-highlight-color: transparent;
}
.sbx-mission-btn:active { transform: scale(.95); }
.sbx-mission-btn--ghost {
  background: #fff;
  color: var(--ink-soft);
  border: 1px solid var(--line-strong);
  box-shadow: none;
}

/* 任务展开面板 */
.sbx-mission-panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 24;
  padding: 12px 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow-2);
  max-height: min(54dvh, 420px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  animation: sbx-pop .24s var(--ease-out) both;
}
.sbx-mpanel-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ink-soft);
}
.sbx-mpanel-head strong { font-family: var(--font-round); font-size: 14.5px; color: var(--ink); font-weight: 800; }
.sbx-mpanel-head > span { font-size: 11.5px; color: var(--ink-faint); font-weight: 700; font-variant-numeric: tabular-nums; }
.sbx-mpanel-close {
  margin-left: auto;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-soft);
  color: var(--ink-soft);
  font-size: 13px;
  display: grid;
  place-items: center;
}
.sbx-mpanel-list { display: grid; gap: 6px; margin-top: 6px; }
.sbx-mtask {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 8px 10px;
  border-radius: 13px;
  background: var(--bg);
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--ink-soft);
}
.sbx-mtask > i {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--ink-faint);
  font-style: normal;
  font-size: 10.5px;
  font-weight: 800;
  display: grid;
  place-items: center;
}
.sbx-mtask.is-active { background: var(--coral-soft); color: var(--ink); font-weight: 700; }
.sbx-mtask.is-active > i { background: var(--coral); border-color: var(--coral); color: #fff; }
.sbx-mtask.is-done { opacity: .72; }
.sbx-mtask.is-done > i { background: var(--teal); border-color: var(--teal); color: #fff; }
.sbx-mpanel-note { margin-top: 8px; font-size: 11.5px; line-height: 1.6; color: var(--ink-faint); }
.sbx-mpanel-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }

/* ---------------- 主体：3D 舞台 ---------------- */
.sbx-body { display: block; min-width: 0; }
.sbx-stage-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}
.sbx-stage {
  position: relative;
  height: clamp(272px, calc(100dvh - 444px), 400px);
  border-radius: 26px;
  overflow: hidden;
  background:
    radial-gradient(120% 92% at 50% 4%, #FFFEFA 0%, #FFF6EA 44%, #FFECDE 74%, #FFE5D7 100%);
  border: 1px solid rgba(61, 48, 33, .07);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .85), var(--shadow-1);
  isolation: isolate;
}
.sbx-stage::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .45);
  z-index: 3;
}
.sbx-canvas-host { position: absolute; inset: 0; z-index: 1; }
.sbx-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}
.sbx-hint {
  margin: 0;
  padding: 0 3px;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-faint);
  line-height: 1.5;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 浮动牙齿标签 */
.sbx-label {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 6;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px 5px 6px;
  background: rgba(45, 42, 38, .92);
  color: #FFF9F0;
  border-radius: 11px;
  box-shadow: 0 8px 18px rgba(45, 38, 28, .25);
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity .16s var(--ease-out);
  will-change: transform;
  max-width: 210px;
}
.sbx-label.is-on { opacity: 1; }
.sbx-label b {
  display: inline-grid;
  place-items: center;
  min-width: 26px;
  height: 20px;
  padding: 0 4px;
  border-radius: 6px;
  background: var(--coral);
  color: #fff;
  font-size: 10.5px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.sbx-label span { overflow: hidden; text-overflow: ellipsis; }

/* 加载 / 错误覆盖层 */
.sbx-overlay {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 26px 22px;
  text-align: center;
  background: radial-gradient(120% 92% at 50% 10%, #FFFEFA, #FFF1E2 72%, #FFE8DA);
}
.sbx-loading p { margin: 0; font-size: 13px; font-weight: 700; color: var(--ink-soft); }
.sbx-loading-tooth { font-size: 42px; line-height: 1; animation: sbx-bob 1.5s ease-in-out infinite; }
.sbx-error-icon { font-size: 38px; line-height: 1; }
.sbx-error-title {
  margin: 0;
  font-family: var(--font-round);
  font-size: 16px;
  font-weight: 800;
  color: var(--ink);
}
.sbx-error-text {
  margin: 0;
  max-width: 320px;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--ink-soft);
}
.sbx-retry {
  margin-top: 2px;
  min-height: 44px;
  padding: 0 22px;
  border-radius: var(--radius-pill);
  background: var(--coral);
  color: #fff;
  font-size: 13.5px;
  font-weight: 800;
  box-shadow: 0 8px 18px rgba(232, 92, 77, .26);
  transition: transform .18s var(--ease-spring);
}
.sbx-retry:active { transform: scale(.95); }
.sbx-no3d .sbx-hint,
.sbx-no3d .sbx-presets,
.sbx-no3d .sbx-label { display: none !important; }
.sbx-sheet-open .sbx-hint,
.sbx-sheet-open .sbx-inline-legend { visibility: hidden; }

/* 相机预设 */
.sbx-presets {
  display: flex;
  gap: 7px;
  padding: 2px 2px 4px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.sbx-presets::-webkit-scrollbar { display: none; }
.sbx-preset {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 0 16px;
  border-radius: var(--radius-pill);
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 3px 10px rgba(87, 62, 38, .05);
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-soft);
  transition: background .2s, color .2s, border-color .2s, transform .2s var(--ease-spring);
  -webkit-tap-highlight-color: transparent;
}
.sbx-preset.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: #FFF7EC;
}
.sbx-preset:active { transform: scale(.95); }

/* ---------------- 右侧信息栏 / 手机底部抽屉 ---------------- */
.sbx-side {
  position: fixed;
  left: 10px;
  right: 10px;
  bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + 10px);
  z-index: 75;
  max-height: 62dvh;
  max-height: 62vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  background: rgba(255, 251, 245, .985);
  border: 1px solid rgba(61, 48, 33, .08);
  border-radius: 26px;
  box-shadow: var(--shadow-3);
  padding: 4px 14px calc(16px + env(safe-area-inset-bottom, 0px));
  transform: translateY(calc(100% + 100px));
  visibility: hidden;
  overflow-x: hidden;
  transition: transform .38s var(--ease-out), visibility 0s linear .4s;
  will-change: transform;
}
.sbx-side.is-open {
  transform: none;
  visibility: visible;
  transition: transform .38s var(--ease-out), visibility 0s;
}
.sbx-grab {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 24px;
  margin: -2px 0 0;
  touch-action: none;
  cursor: grab;
}
.sbx-grab i {
  width: 44px;
  height: 5px;
  border-radius: 3px;
  background: rgba(61, 48, 33, .16);
}
.sbx-side-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 2px 10px;
  touch-action: none;
}
.sbx-side-head h2 {
  margin: 0;
  font-family: var(--font-round);
  font-size: 16px;
  font-weight: 800;
  color: var(--ink);
}
.sbx-sheet-close {
  min-height: 44px;
  padding: 0 12px;
  border-radius: var(--radius-pill);
  background: var(--bg-soft);
  color: var(--ink-soft);
  font-size: 12.5px;
  font-weight: 700;
}

/* ---------------- 牙齿档案卡 ---------------- */
.sbx-info { margin-bottom: 12px; }
.sbx-info-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow-1);
  padding: 15px 16px 14px;
  animation: sbx-fade .3s var(--ease-out) both;
}
.sbx-info-empty {
  background: #fff;
  border: 1px dashed rgba(61, 48, 33, .18);
  border-radius: 22px;
  padding: 20px 18px;
  text-align: center;
}
.sbx-info-empty-art { font-size: 38px; line-height: 1; animation: sbx-bob 3s ease-in-out infinite; }
.sbx-info-empty h3 {
  margin: 8px 0 6px;
  font-family: var(--font-round);
  font-size: 15.5px;
  font-weight: 800;
  color: var(--ink);
}
.sbx-info-empty p {
  margin: 0;
  font-size: 12px;
  line-height: 1.7;
  color: var(--ink-soft);
}
.sbx-info-head { display: flex; align-items: flex-start; gap: 11px; }
.sbx-info-fdi {
  flex: 0 0 auto;
  min-width: 46px;
  height: 46px;
  padding: 0 9px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--coral-soft);
  color: var(--coral-deep);
  font-size: 18px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}
.sbx-info-titles { flex: 1; min-width: 0; }
.sbx-info-name {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  margin: 0;
  font-family: var(--font-round);
  font-size: 17.5px;
  font-weight: 800;
  line-height: 1.3;
  color: var(--ink);
}
.sbx-info-nick {
  font-family: var(--font);
  font-size: 11px;
  font-weight: 700;
  color: var(--coral-deep);
  background: var(--coral-soft);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  line-height: 1.5;
}
.sbx-info-en {
  margin: 2px 0 0;
  font-size: 11px;
  color: var(--ink-faint);
  letter-spacing: .01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sbx-info-close {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  margin: -4px -6px 0 0;
  border-radius: 50%;
  background: var(--bg-soft);
  color: var(--ink-soft);
  font-size: 14px;
  display: grid;
  place-items: center;
  transition: background .18s, transform .2s var(--ease-spring);
}
.sbx-info-close:active { transform: scale(.92); }
.sbx-info-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.sbx-tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  background: var(--bg);
  border: 1px solid var(--line);
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ink-soft);
  line-height: 1.55;
}
.sbx-tag--kind { position: relative; padding-left: 22px; color: var(--ink); }
.sbx-tag--kind::before {
  content: "";
  position: absolute;
  left: 9px;
  top: 50%;
  width: 7px;
  height: 7px;
  margin-top: -3.5px;
  border-radius: 50%;
  background: var(--kc, var(--coral));
}
.sbx-tag--soft { background: var(--teal-soft); border-color: transparent; color: var(--teal-deep); }
.sbx-info-rows { display: grid; gap: 9px; margin: 13px 0 0; }
.sbx-info-row { display: grid; grid-template-columns: 54px minmax(0, 1fr); gap: 10px; align-items: start; }
.sbx-info-row dt {
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.7;
  color: var(--ink-faint);
  letter-spacing: .02em;
}
.sbx-info-row dd {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.7;
  color: #4A443C;
}
.sbx-info-tip {
  margin-top: 13px;
  padding: 10px 12px;
  border-radius: 15px;
  background: var(--teal-soft);
}
.sbx-info-tip-label {
  display: block;
  font-size: 11.5px;
  font-weight: 800;
  color: var(--teal-deep);
  letter-spacing: .02em;
}
.sbx-info-tip p {
  margin: 3px 0 0;
  font-size: 12px;
  line-height: 1.68;
  color: #2f5a52;
}
/* 上一颗/下一颗：抽屉内吸底，避免长期被 Tab 栏或滚动挡住 */
.sbx-info-nav {
  position: sticky;
  bottom: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 13px -16px -14px;
  padding: 10px 16px 6px;
  background: #fff;
  box-shadow: 0 -12px 16px #fff;
}
.sbx-nav-btn {
  min-height: 44px;
  padding: 0 14px;
  border-radius: var(--radius-pill);
  background: var(--bg);
  border: 1px solid var(--line);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink-soft);
  white-space: nowrap;
  transition: background .18s, transform .18s var(--ease-spring);
}
.sbx-nav-btn:active { transform: scale(.95); }
.sbx-info-count {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ---------------- 图例 / 清单面板 ---------------- */
.sbx-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow-1);
  padding: 13px 15px;
  margin-bottom: 12px;
  min-width: 0;
}
.sbx-panel:last-child { margin-bottom: 0; }
.sbx-panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.sbx-panel-title {
  margin: 0;
  font-family: var(--font-round);
  font-size: 14px;
  font-weight: 800;
  color: var(--ink);
}
.sbx-panel-sub {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-faint);
  white-space: nowrap;
}
.sbx-legend {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2px;
}
.sbx-legend-item {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  padding: 4px 6px;
  border-radius: 11px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-soft);
  text-align: left;
  transition: background .18s, opacity .2s;
  -webkit-tap-highlight-color: transparent;
}
.sbx-legend-item:hover { background: var(--bg); }
.sbx-legend-item.is-off { opacity: .4; }
.sbx-legend-dot {
  flex: 0 0 auto;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .9);
}
.sbx-legend-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* 手机/平板：舞台下方的横向图例（替代抽屉里的大图例） */
.sbx-inline-legend {
  display: flex;
  gap: 6px;
  padding: 0 2px 2px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.sbx-inline-legend::-webkit-scrollbar { display: none; }
.sbx-inline-legend .sbx-legend-item {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 0 11px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  box-shadow: 0 2px 8px rgba(87, 62, 38, .04);
  font-size: 12px;
  color: var(--ink-soft);
}
.sbx-inline-legend .sbx-legend-dot { width: 9px; height: 9px; }
.sbx-list { display: grid; gap: 9px; min-width: 0; }
.sbx-list-group { min-width: 0; }
.sbx-list-group-title {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 5px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .08em;
  color: var(--ink-faint);
}
.sbx-list-group-title span { font-size: 10px; }
.sbx-list-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.sbx-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 40px;
  padding: 0 10px 0 9px;
  border-radius: 12px;
  background: var(--bg);
  border: 1px solid var(--line);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-soft);
  flex-shrink: 0;
  transition: background .18s, color .18s, border-color .18s, transform .18s var(--ease-spring);
  -webkit-tap-highlight-color: transparent;
}
.sbx-chip::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--kc, var(--coral));
  flex: 0 0 auto;
}
.sbx-chip:active { transform: scale(.95); }
.sbx-chip b {
  font-size: 10.5px;
  font-weight: 800;
  line-height: 1.6;
  padding: 0 5px;
  border-radius: 6px;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
}
.sbx-chip-name { white-space: nowrap; }
.sbx-chip.is-on {
  background: var(--ink);
  border-color: var(--ink);
  color: #FFF7EC;
}
.sbx-chip.is-on::before { background: var(--kc, var(--coral)); }
.sbx-chip.is-on b {
  background: rgba(255, 255, 255, .16);
  border-color: transparent;
  color: #FFF7EC;
}

/* ---------------- 兜底 Toast ---------------- */
.sbx-mini-toast {
  position: absolute;
  top: 10px;
  left: 50%;
  z-index: 50;
  transform: translate(-50%, -10px);
  max-width: min(92%, 420px);
  padding: 10px 16px;
  border-radius: var(--radius-pill);
  background: rgba(45, 42, 38, .94);
  color: #FFF9F0;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  box-shadow: var(--shadow-2);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s var(--ease-out), transform .3s var(--ease-spring);
}
.sbx-mini-toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ---------------- 动画 ---------------- */
@keyframes sbx-bob {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-6px) rotate(2deg); }
}
@keyframes sbx-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 122, 107, .45); }
  50% { box-shadow: 0 0 0 4px rgba(255, 122, 107, 0); }
}
@keyframes sbx-fade {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}
@keyframes sbx-pop {
  from { opacity: 0; transform: translateY(-6px) scale(.985); }
  to { opacity: 1; transform: none; }
}

/* =========================================================
   响应式
   ========================================================= */

/* 平板竖屏 / 大手机 */
@media (min-width: 720px) {
  .sbx-stage { height: clamp(340px, calc(100dvh - 400px), 560px); }
  .sbx-mission-text { font-size: 13.5px; }
  .sbx-side { left: 18px; right: 18px; padding-left: 18px; padding-right: 18px; }
  .sbx-info-row { grid-template-columns: 62px minmax(0, 1fr); gap: 12px; }
  .sbx-info-row dd { font-size: 13px; }
  .sbx-legend { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .sbx-list-chips { gap: 7px; }
}

/* 平板横屏（无底部 Tab） */
@media (min-width: 900px) {
  .sbx-set-desc { display: block; }
  .sbx-stage { height: clamp(360px, calc(100dvh - 350px), 600px); }
  .sbx-side { bottom: 18px; }
  .sbx-info-row { grid-template-columns: 66px minmax(0, 1fr); }
  .sbx-toolbar { gap: 12px; }
}

/* 桌面：左右分栏，信息固定右侧栏 */
@media (min-width: 1024px) {
  .sbx-root { padding-bottom: 24px; }
  .sbx-stage { height: clamp(380px, calc(100dvh - 350px), 600px); }
  .sbx-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 356px;
    gap: 18px;
    align-items: start;
  }
  .sbx-side {
    position: sticky;
    top: calc(var(--header-h) + 14px);
    left: auto;
    right: auto;
    bottom: auto;
    z-index: 1;
    max-height: calc(100dvh - var(--header-h) - 30px);
    overflow-y: auto;
    padding: 2px 6px 8px 2px;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    transform: none;
    visibility: visible;
    transition: none;
    scrollbar-width: thin;
    scrollbar-color: rgba(61, 48, 33, .18) transparent;
  }
  .sbx-side::-webkit-scrollbar { width: 6px; }
  .sbx-side::-webkit-scrollbar-thumb { background: rgba(61, 48, 33, .16); border-radius: 4px; }
  .sbx-grab, .sbx-side-head { display: none; }
  .sbx-inline-legend { display: none; }
  .sbx-list-toggle { display: none; }
  .sbx-info-empty { padding: 22px 20px; }
  .sbx-info-empty-art { font-size: 42px; }
  .sbx-info-name { font-size: 18.5px; }
  .sbx-info-rows { gap: 10px; }
  .sbx-info-row dd { font-size: 13px; }
  .sbx-mission-text { font-size: 14px; }
  .sbx-mission { padding-left: 16px; }
  .sbx-panel { padding: 15px 17px; }
  .sbx-stage::after { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .5); }
}

@media (min-width: 1024px) and (max-width: 1219px) {
  .sbx-body { grid-template-columns: minmax(0, 1fr) 332px; gap: 16px; }
}

/* 宽屏：舞台与侧栏都更舒展 */
@media (min-width: 1280px) {
  .sbx-body { grid-template-columns: minmax(0, 1fr) 384px; }
  .sbx-stage { height: clamp(420px, calc(100dvh - 350px), 620px); }
}

/* 窄屏手机：清单横向滚动、图表压缩 */
@media (max-width: 719px) {
  .sbx-toolbar { gap: 8px; }
  .sbx-seg-btn { padding: 0 12px; font-size: 13px; }
  .sbx-mission { padding-left: 10px; gap: 4px; }
  .sbx-mission-icon { font-size: 17px; }
  .sbx-mission-text { font-size: 12px; }
  .sbx-mission-btn { padding: 0 12px; }
  .sbx-preset { padding: 0 13px; font-size: 12.5px; }
  .sbx-chip { min-height: 44px; }
  .sbx-list-chips {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
  }
  .sbx-list-chips::-webkit-scrollbar { display: none; }
  .sbx-info-row { grid-template-columns: 52px minmax(0, 1fr); gap: 9px; }
  .sbx-info-row dd { font-size: 12.5px; }
  .sbx-hint { font-size: 10.5px; }
}

@media (max-width: 1023px) {
  .sbx-legend-panel { display: none; }
}

/* 超窄屏 */
@media (max-width: 359px) {
  .sbx-seg-btn { padding: 0 10px; font-size: 12.5px; }
  .sbx-list-toggle { padding: 0 11px; }
  .sbx-list-toggle span { display: none; }
  .sbx-mission-text { font-size: 11.5px; }
}

/* 矮屏（手机横屏）：优先保证 3D 可见，压缩其他区域 */
@media (max-height: 700px) and (max-width: 719px) {
  .sbx-inline-legend { display: none; }
  .sbx-hint { display: none; }
  .sbx-stage { height: clamp(240px, calc(100dvh - 380px), 360px); }
}

@media (max-height: 640px) and (max-width: 1023px) {
  .sbx-stage { height: 250px; }
  .sbx-inline-legend { display: none; }
  .sbx-hint { display: none; }
  .sbx-root { gap: 8px; padding-bottom: 12px; }
  .sbx-mission { min-height: 48px; }
  .sbx-toolbar .sbx-seg-btn { min-height: 40px; }
  .sbx-list-toggle { min-height: 40px; }
}

/* 已获得奖章时的任务条点缀 */
.sbx-mission.is-done .sbx-mission-text { color: #7a5300; }
