/* 3D 实体活课本 · 应用内弹层（handoff E）。入口：左侧 3D(space) → #tb3dTeachHost「3D 教学」，不进实验室。 */
#textbook3dOverlay.tb3d-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--layer-publication);
  display: flex;
  flex-direction: column;
  background: var(--surface, #0b1220);
  color: var(--ink, #e8eee9);
}
#textbook3dOverlay.tb3d-overlay.hidden {
  display: none !important;
}
.tb3d-bar {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3, 12px);
  padding: 10px 14px;
  padding-top: calc(10px + env(safe-area-inset-top, 0px));
  border-bottom: 1px solid var(--line, rgb(255 255 255 / .12));
  background: var(--surface-soft, rgb(17 24 39 / .92));
}
.tb3d-titles {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.tb3d-titles strong {
  font: 600 15px/1.3 var(--font-ui, system-ui, sans-serif);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tb3d-sub {
  font: 12px/1.3 var(--font-ui, system-ui, sans-serif);
  color: var(--muted, #94a3b8);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tb3d-tools {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-left: auto;
  margin-right: 8px;
  flex: none;
}
.tb3d-tool {
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line, rgb(255 255 255 / .16));
  border-radius: 999px;
  background: transparent;
  color: inherit;
  font: 12px/1 var(--font-ui, system-ui, sans-serif);
  cursor: pointer;
}
.tb3d-tool[aria-pressed="true"], 
.tb3d-tool.is-active {
  background: var(--surface-hover, rgb(255 255 255 / .12));
}
.tb3d-close {
  flex: none;
  min-width: 40px;
  min-height: 40px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: inherit;
  font-size: 18px;
  cursor: pointer;
}
.tb3d-close:hover { background: var(--surface-hover, rgb(255 255 255 / .08)); }
.tb3d-close:focus-visible { outline: 2px solid var(--focus-ring, #60a5fa); outline-offset: 2px; }
.tb3d-stage {
  flex: 1;
  min-height: 0;
  position: relative;
  background: #b9b0a2;
}
.tb3d-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: #b9b0a2;
  z-index: 1;
}
.tb3d-annotate {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
  touch-action: none;
}
.tb3d-annotate.is-active {
  pointer-events: auto;
  cursor: crosshair;
}
.tb3d-note {
  flex: none;
  margin: 0;
  padding: 8px 14px;
  font: 12px/1.4 var(--font-ui, system-ui, sans-serif);
  color: var(--muted, #94a3b8);
  border-top: 1px solid var(--line, rgb(255 255 255 / .12));
}

/* 实验室入口（在 #panel3DTools 内，面板默认 hidden，不占首屏） */
.tb3d-entry-intro {
  margin: 8px 0 10px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted, #94a3b8);
}
.tb3d-entry-list {
  display: grid;
  gap: 8px;
}
.tb3d-entry-btn {
  display: flex !important;
  flex-direction: column;
  align-items: flex-start !important;
  gap: 2px;
  text-align: left;
  width: 100%;
  padding: 10px 12px !important;
}
.tb3d-entry-btn strong {
  font-size: 13px;
  font-weight: 600;
}
.tb3d-entry-btn span {
  font-size: 11px;
  opacity: .75;
  font-weight: 400;
}


/* 课目录在侧栏不挡圆盘；弹层打开时抬高圆盘，保持可点 */
body:has(#textbook3dOverlay.tb3d-overlay:not(.hidden)) #gbBottomTools {
  z-index: calc(var(--layer-publication) + 1);
  pointer-events: auto;
}
#tb3dTeachHost {
  flex: none;
  padding: 0 0 8px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--as-line, var(--line, #e5e5e7));
}
#tb3dTeachHost .tb3d-entry { margin: 0; }
#tb3dTeachHost .tb3d-entry-btn {
  width: 100%;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px;
  border: 1px solid var(--as-line, var(--line, #e5e5e7));
  border-radius: 10px;
  background: var(--as-bg, var(--surface, #fff));
  color: inherit;
  cursor: pointer;
}
