/* 第一阶段排版（work/prod-audit/LAYOUT-SPEC-stage1.md）：黑板最大、工具最少露出、一次只出现一个浮层。
   本文件最后加载，只改位置与显隐；功能入口一个不删（收起的入口在「更多」/「⋯」/属性面板里）。 */
:root {
  --s1-top: 56px;
  --s1-rail-w: 64px;
  --s1-bottom: calc(48px + var(--site-beian-height, 0px));
  --s1-shell: 0px;
  --s1-safe-t: env(safe-area-inset-top, 0px);
  --s1-safe-b: env(safe-area-inset-bottom, 0px);
  --s1-app-h: 100dvh;
}
html.app-shell-ready:not(.app-shell-mobile):not(.app-shell-open) { --s1-shell:52px; }
html.app-shell-open:not(.app-shell-mobile) { --s1-shell: var(--app-shell-w, 260px); }

/* ---------- 画板页锁视口（两端） ---------- */
html.s1, html.s1 body { height: 100%; overflow: hidden !important; overscroll-behavior: none; }
html.s1 body { position: fixed; inset: 0; width: 100%; max-width: 100vw; height: var(--s1-app-h); }
/* 画板视口必须立即定位；旧 transition-all 会在首笔/滚轮期间移动坐标原点。 */
html.s1 #workbenchWrapper { position: relative !important; inset: auto !important; flex: none !important; box-sizing: border-box !important; margin: var(--s1-top) 0 0 calc(var(--s1-rail-w) + var(--space-4)) !important; width: calc(100% - var(--s1-rail-w) - 16px) !important; height: calc(var(--s1-app-h) - var(--s1-top) - var(--s1-bottom)) !important; min-height: 0 !important; max-height: none !important; padding: var(--space-2) !important; overflow: hidden !important; overscroll-behavior: none; touch-action: none; transition: none !important; }
/* 打开场景时间线：画板让出时间线的高度（与 scene-timeline.css 同一条规则；本表后加载，同优先级会把它盖掉） */
html.s1[data-timeline-open] #workbenchWrapper { height: calc(var(--s1-app-h) - var(--s1-top) - var(--timeline-height, 230px) - var(--site-beian-height, 0px)) !important; }
html.s1.s1 body #topNavbar { position: fixed !important; top: 0; left: var(--s1-shell); right: 0; height: var(--s1-top); min-height: var(--s1-top); box-sizing: border-box; flex-wrap: nowrap !important; }

/* 营销首屏 / 功能手册 / 页脚：只在「使用手册」浮层里出现，不在画板下方渲染。 */
#s1GuideSheet { display: none; }
html.s1.s1-guide-open #s1GuideSheet { display: block; position: fixed; inset: 0; z-index: var(--layer-stack-100100); overflow: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; background: var(--surface); padding-top: calc(var(--s1-safe-t) + var(--space-2)); }
#s1GuideSheet .s1-sheet-close { position: sticky; top: 8px; float: right; margin: 0 var(--space-3) 0 0; z-index: var(--layer-stack-2); width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-size: 18px; cursor: pointer; }

/* ---------- 桌面（≥768px，按 1024 设计，平板沿用） ---------- */
@media (min-width: 768px) {
  /* ② 左工具栏：竖排图标 + 两字；插入 / 图层 / 特效 / PDF 收进「更多」 */
  html.s1 body #leftSidebar { position: fixed !important; left: calc(var(--s1-shell) + 8px) !important; top: calc(var(--s1-top) + 8px) !important; bottom: auto !important; width: var(--s1-rail-w) !important; max-height: calc(var(--s1-app-h) - var(--s1-top) - var(--s1-bottom) - 16px) !important; overflow-y: auto !important; overflow-x: hidden !important; scrollbar-width: none; z-index: var(--layer-stack-30) !important; }
  html.s1 body #leftSidebar :is(#btnToggleMediaMenu, #btnToggleLayers, #btnToggleFxPanel, #btnImportPdfDock) { display: none !important; }

  /* ⑥ 底栏 48px：页码 ‹ › 缩略图 ＋ │ 讲解 缩放 */
  #s1BottomBar { position: fixed; left: var(--s1-shell); right: 0; bottom: var(--site-beian-height, 0px); height: calc(var(--s1-bottom) - var(--site-beian-height, 0px)); z-index: var(--layer-stack-29); background: var(--surface); border-top: 1px solid var(--line); }
  html.s1 body #pageManagerDock { position: fixed !important; left: calc(var(--s1-shell) + var(--s1-rail-w) + 24px) !important; right: auto !important; bottom: calc(4px + var(--site-beian-height, 0px)) !important; top: auto !important; transform: none !important; height: 40px !important; min-height: 0 !important; padding: 0 var(--space-2) !important; max-width: calc(100vw - var(--s1-shell) - 420px) !important; background: transparent !important; border: 0 !important; box-shadow: none !important; z-index: var(--layer-stack-31) !important; backdrop-filter: none !important; }
  html.s1 body #pageManagerDock .page-strip { max-height: 40px; }
  html.s1 body #pageManagerDock .page-thumb-wrap, html.s1 body #pageManagerDock .page-thumb { height: 36px !important; min-height: 0 !important; }
  html.s1 body #pageManagerDock .page-thumb canvas { max-height: 26px !important; width: auto !important; }
  html.s1 body #pageManagerDock .page-thumb .page-thumb-placeholder { max-height: 26px !important; width: 46px !important; }
  html.s1 body #pageManagerDock #btnAddPage { height: 32px !important; width: 32px !important; padding: 0 !important; }
  html.s1 body #zoomDock { position: fixed !important; right: 12px !important; bottom: calc(8px + var(--site-beian-height, 0px)) !important; top: auto !important; left: auto !important; height: 32px; z-index: var(--layer-stack-31) !important; box-shadow: none !important; }
  html.s1 body #redesignPresent { position: fixed !important; right: 236px !important; bottom: calc(7px + var(--site-beian-height, 0px)) !important; top: auto !important; left: auto !important; height: 34px !important; z-index: var(--layer-stack-31) !important; box-shadow: none !important; }

  /* ⑤ 属性面板 260px：选中对象时才出现（3D 样式条、物体工具、标注导览都收在这里） */
  html.s1 body #redesignContext { position: fixed !important; top: calc(var(--s1-top) + 8px) !important; right: 8px !important; left: auto !important; bottom: auto !important; transform: none !important; width: 260px !important; max-width: 260px !important; height: auto !important; min-height: 0 !important; max-height: calc(var(--s1-app-h) - var(--s1-top) - var(--s1-bottom) - 72px) !important; overflow-y: auto !important; overflow-x: hidden !important; display: flex !important; flex-direction: row !important; flex-wrap: wrap !important; align-items: center !important; align-content: flex-start !important; gap: var(--space-2) !important; padding: var(--space-3) !important; border-radius: 14px !important; z-index: var(--layer-stack-36) !important; }
  html.s1 body #redesignContext.is-board { display: none !important; }
  html.s1 body #redesignContext > #redesignContextTitle { flex: 1 0 100%; font-weight: 700; }
  html.s1 body #redesignContext :is(.viewer-ux-bar, .object-context, #shapeInspector) { flex: 1 0 100% !important; display: flex !important; flex-wrap: wrap !important; gap: var(--space-2) !important; max-width: 100% !important; position: static !important; transform: none !important; }
  html.s1 body #redesignContext .viewer-ux-bar[hidden], html.s1 body #redesignContext #shapeInspector[hidden] { display: none !important; }
  html.s1 body #redesignContext .viewer-display-segmented { display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }
  html.s1 body #redesignContext .object-context > button, html.s1 body #redesignContext > button, html.s1 body #redesignContext > label, html.s1 body #redesignContext > select { flex: 1 1 calc(50% - 6px) !important; min-width: 0 !important; justify-content: flex-start; }

  /* AI 输入：黑板底部居中悬浮，宽 ≤ 640px */
  html.s1 body #ai-assistant-bar { bottom: calc(var(--s1-bottom) + 12px) !important; max-width: 640px !important; }
  html.s1 body #ai-assistant-reopen { bottom: calc(var(--s1-bottom) + 12px) !important; left: calc(var(--s1-shell) + (100vw - var(--s1-shell) + var(--s1-rail-w)) / 2) !important; }
  /* Cookie 卡片的位置在文件末尾，盖过旧横幅。 */

  /* 工具栏旁的面板：贴着工具栏右侧，上下都不压顶栏和底栏 */
  html.s1 body #panel3DTools { left: calc(var(--s1-shell) + var(--s1-rail-w) + 24px) !important; top: calc(var(--s1-top) + 8px) !important; bottom: calc(var(--s1-bottom) + 8px) !important; max-height: none !important; }
  html.s1 body :is(#shapePanel, #mediaMenu, #layersPanel, #fxPanel, #classroomToolsMenu, #brushStudioFlyout, #t1021ToolOpts, #moreToolsDrawer) { max-height: calc(var(--s1-app-h) - var(--s1-top) - var(--s1-bottom) - 96px) !important; overflow-y: auto !important; }

  /* 画笔小气泡 / 标注导览（桌面放在属性面板左侧） */
  /* 标注导览位置由 placePanel 按当前侧栏与应用栏计算。 */
  html.s1.s1-has-sel body .viewer-loading-state { right: 280px; }
}
@media (min-width: 768px) and (max-width: 1023.98px) {
  /* 窄屏一次只出一个浮层：工具面板开着时属性面板先收起，给正在操作的对象留出位置 */
  html.s1:not([data-s1-panel=""]) body #redesignContext { display: none !important; }
  /* 平板顶栏：Logo 只留图形，按钮只留图标（文字在 tooltip 里），不挤不叠 */
  html.s1 body #topNavbar #redesignSidebar .brand-wordmark, html.s1 body #topNavbar #redesignSidebar > svg:not(:first-of-type) { display: none !important; }
  html.s1 body #topNavbar #redesignWorkName { width: 112px !important; min-width: 0 !important; text-overflow: ellipsis; }
  html.s1 body #topNavbar :is(.nav-file-label, #btnShareChalk > span, #btnExport > span, #btnExercise > span) { display: none !important; }
  html.s1 body #topNavbar :is(#btnShareChalk, #btnExport, #btnExercise) { padding-left: var(--space-2) !important; padding-right: var(--space-2) !important; }
  html.s1 body #redesignPresent .pro-tool-label, html.s1 body #redesignPresent span:not(:has(svg)) { display: none; }
  html.s1 body #redesignPresent { right: 232px !important; width: 40px !important; padding: 0 !important; justify-content: center; }
}

/* 画笔小气泡 */
#brushQuickBubble { position: fixed; z-index: var(--layer-stack-960); display: flex; flex-direction: column; gap: var(--space-2); width: 236px; padding: var(--space-3); border-radius: 14px; background: var(--surface); color: var(--ink); border: 1px solid var(--line); box-shadow: var(--shadow-panel, 0 12px 32px var(--shadow-ink)); }
#brushQuickBubble[hidden] { display: none; }
#brushQuickBubble .s1-bubble-colors { display: grid; grid-template-columns: repeat(7, 1fr); gap: var(--space-2); }
#brushQuickBubble .s1-swatch { width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--line); background: var(--sw, transparent); cursor: pointer; padding: 0; font: 600 14px/1 system-ui; color: var(--ink); }
#brushQuickBubble .s1-swatch[aria-pressed="true"] { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
#brushQuickBubble .s1-bubble-sizes { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-2); }
#brushQuickBubble .s1-size { display: flex; align-items: center; justify-content: center; gap: var(--space-2); min-height: 32px; border-radius: 8px; border: 1px solid var(--line); background: transparent; color: inherit; cursor: pointer; font-size: 12px; }
#brushQuickBubble .s1-size i { display: inline-block; border-radius: 50%; background: currentColor; }
#brushQuickBubble .s1-size[aria-pressed="true"] { background: var(--state-active-bg); border-color: var(--state-active-border); }
#brushQuickBubble .s1-bubble-links { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2); }
#brushQuickBubble .s1-bubble-links button { min-height: 32px; border-radius: 8px; border: 1px solid var(--line); background: transparent; color: inherit; cursor: pointer; font-size: 13px; }

/* 提示条放在「输入文字」上方，不与底部控件相交 */
html.s1 body #creatorToast { bottom: calc(var(--s1-bottom) + 64px) !important; }
/* 删页撤销只留底部一条，让开页码条，也不盖顶部工具和画板对象 */
html.s1 body .page-undo { bottom: calc(var(--s1-bottom) + 8px); z-index: var(--layer-stack-40); }
html.s1.s1-has-sel body #creatorToast { bottom: calc(var(--s1-bottom) + 112px) !important; }
@media (min-width: 768px) { html.s1.s1-has-sel body #creatorToast { bottom: calc(var(--s1-bottom) + 64px) !important; } }

/* 顶栏「⋯」菜单（桌面顶栏已有文件/导出/账号/练习题，菜单里只留使用手册） */
@media (min-width: 768px) { #s1TopMenu button:not([data-for="s1GuideItem"]):not([data-for="btnExercise"]):not([data-for="redesignSettings"]) { display: none; } }
#s1TopMore { display: none; }
#s1TopMenu { box-sizing: border-box; overflow-y: auto; overscroll-behavior: contain; min-height: 0; position: fixed; z-index: var(--layer-stack-970); min-width: 160px; padding: var(--space-2); border-radius: 12px; background: var(--surface); color: var(--ink); border: 1px solid var(--line); box-shadow: var(--shadow-panel, 0 12px 32px var(--shadow-ink)); display: flex; flex-direction: column; }
#s1TopMenu[hidden] { display: none; }
#s1TopMenu button { flex: 0 0 auto; white-space: normal; overflow-wrap: anywhere; min-height: 40px; padding: 0 var(--space-3); text-align: left; border: 0; border-radius: 8px; background: transparent; color: inherit; font-size: 14px; cursor: pointer; }
#s1TopMenu button:hover, #s1TopMenu button:focus-visible { background: var(--state-active-bg); }

/* 笔模式：检测到笔后才出现，贴在黑板左上角，不进底部工具条，避免把「笔模式」三个字挤没。 */
#btnPenMode { position: fixed; z-index: var(--layer-stack-40); left: calc(var(--s1-shell, 0px) + var(--s1-rail-w, 64px) + 12px); top: calc(var(--s1-top, 56px) + 8px); height: 32px; padding: 0 var(--space-3); border-radius: 999px; border: 1px solid var(--btn-secondary-border); background: var(--btn-secondary-bg); color: var(--btn-secondary-fg); font: 600 13px/1 var(--font-ui, system-ui); cursor: pointer; }
#btnPenMode[hidden] { display: none !important; }
#btnPenMode[aria-pressed="true"] { background: var(--btn-primary-bg); color: var(--btn-primary-fg); border-color: var(--btn-primary-border); }
#btnPenMode:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }

/* 标注点导览：默认收进选中对象的属性里 */
html.s1:not(.s1-tour) body .annotation-tour-panel:not(.is-teaching) { display: none !important; }
#s1TourToggle, #s1DeleteSel { display: none; }
html.s1.s1-sel-3d :is(#s1TourToggle, #s1DeleteSel) { display: inline-flex; }
.s1-ctx-btn { align-items: center; justify-content: center; min-height: 28px; padding: 0 var(--space-2); border-radius: 8px; border: 1px solid var(--line); background: transparent; color: inherit; font: inherit; cursor: pointer; }
.s1-ctx-btn[aria-pressed="true"] { background: var(--state-active-bg); border-color: var(--state-active-border); }

/* X/Y/Z 并入右下角 3D 视图控件；旧的「回到默认视角 / 返回书写」浮钮由角落控件取代 */
html.s1 body [data-viewer-board-axis], html.s1 body [data-board-space-actions] { display: none !important; }
html.s1 [data-space-gizmo-mode] { width: max-content; white-space: nowrap; }

/* 函数图编辑只用现有对象工具条；通用选择条不重复出现。 */
html.s1.s1-sel-graph #redesignContext { display: none !important; }
html.s1.s1-sel-graph body .selection-action-pill { display: none !important; }
/* 函数图也由 ObjectToolbar 统一定位圆盘及手机子面板。 */
#s1SpaceTools, #s1SpaceReturn { position: fixed; z-index: var(--layer-stack-50); bottom: calc(var(--s1-safe-b, 0px) + 16px); min-height: 44px; border: 1px solid var(--line); border-radius: 12px; padding: 0 var(--space-4); color: var(--ink); background: var(--surface); font: 600 14px/1 var(--font-ui, system-ui); }
#s1SpaceTools { right: 12px; } #s1SpaceReturn { left: 12px; }
#s1SpaceTools[hidden], #s1SpaceReturn[hidden] { display: none; }
#s1SpaceDrawer { position: fixed; inset: auto 0 0; margin: 0; box-sizing: border-box; width: 100%; max-width: none; max-height: 60dvh; overflow: auto; padding: var(--space-5) var(--space-4) calc(var(--space-4) + env(safe-area-inset-bottom)); border: 1px solid var(--line); border-radius: 20px 20px 0 0; background: var(--surface); color: var(--ink); }
#s1SpaceDrawer::backdrop { background: var(--surface-hover); }
#s1SpaceDrawer h2 { margin: 0 var(--space-12) var(--space-4) 0; font-size: 16px; }
#s1SpaceDrawer .s1-space-close { position: absolute; right: 12px; top: 8px; width: 44px; height: 44px; background: transparent; color: inherit; border: 0; }
#s1SpaceDrawer [data-camera-space-actions], #s1SpaceDrawer #view3dControls, #s1SpaceDrawer [data-camera-joystick], #s1SpaceDrawer [data-camera-lift] { position: relative !important; inset: auto !important; margin: var(--space-3) 0; max-width: 100% !important; box-shadow: none; }
#s1SpaceDrawer #view3dControls { flex-direction: row; flex-wrap: wrap; justify-content: flex-start; border-radius: 12px; }
#s1SpaceDrawer [data-camera-space-actions] { gap: var(--space-2) !important; }
#s1SpaceDrawer [data-space-hint] { flex-basis: 100%; }
#s1SpaceDrawer [data-camera-joystick] span { white-space: nowrap; font-size: 10px !important; inset: 18px !important; }
html.s1.s1-mobile-space body :is(#leftSidebar, #pageManagerDock, #redesignContext, #ai-assistant-reopen, #ai-assistant-bar, #gbBottomTools, #gbAiRing, #gbColorRing, #gbAppRail, #subjectToolsPanel, #emptyHint, #rolesQuickStart, [data-board3d-toolbar], #objectToolbar, #objectToolbarPanel) { display: none !important; }

/* ---------- 手机（<768px，竖屏） ---------- */
@media (max-width: 767.98px) {
  :root { --s1-top: calc(44px + var(--s1-safe-t)); --s1-tools: 56px; --s1-pages: 28px; --s1-bottom: calc(var(--s1-tools) + var(--s1-pages) + var(--s1-safe-b) + var(--site-beian-height, 0px)); --s1-rail-w: 0px; --s1-shell: 0px; }
  html.s1 #workbenchWrapper { margin-left: 0 !important; width: 100% !important; padding: 0 !important; }

  /* ① 顶栏 44px：Logo 图标 课名… 分享 ⋯（状态栏安全区内不放任何东西） */
  html.s1.s1 body #topNavbar { left: 0 !important; right: 0 !important; height: var(--s1-top) !important; min-height: 0 !important; padding: var(--s1-safe-t) var(--space-2) 0 var(--space-2) !important; gap: var(--space-1) !important; align-items: center !important; justify-content: space-between !important; }
  html.s1 body #topNavbar > :not(.redesign-start):not(.redesign-end) { display: none !important; }
  html.s1 body #topNavbar .redesign-start { display: flex !important; flex: 1 1 auto; min-width: 0; align-items: center; gap: var(--space-1); }
  html.s1 body #topNavbar #redesignSidebar { flex: none; width: 44px !important; min-width: 44px !important; height: 44px !important; padding: 0 !important; justify-content: center; }
  html.s1 body #topNavbar #redesignSidebar > svg:not(:first-of-type), html.s1 body #topNavbar #redesignSidebar .brand-wordmark { display: none !important; }
  html.s1 body #topNavbar #redesignSidebar > svg:first-of-type { width: 26px !important; height: 26px !important; }
  html.s1 body #topNavbar #redesignWorkName { display: block !important; flex: 1 1 auto; min-width: 0; width: auto !important; max-width: none !important; height: 44px !important; min-height: 44px !important; padding: 0 var(--space-2) !important; text-overflow: ellipsis; white-space: nowrap; overflow: hidden; font-size: 16px !important; font-weight: 600; }
  html.s1 body #topNavbar #redesignFile, html.s1 body #topNavbar .redesign-end > :not(#btnShareChalk):not(#r4LessonToolbar):not(#s1TopMore):not(#topAccountButton), html.s1 body #topNavbar #btnExercise { display: none !important; }
  html.s1 body #topNavbar .redesign-end { display: flex !important; flex: none; gap: var(--space-1); align-items: center; }
  html.s1 body #topNavbar :is(#btnShareChalk, #s1TopMore, #r4LessonToolbar) { display: inline-flex !important; align-items: center; justify-content: center; min-width: 44px !important; height: 44px !important; min-height: 44px !important; padding: 0 var(--space-2) !important; }
  html.s1 body .app-shell-toggle { display: none !important; }

  /* ② 底部工具栏 56px：选择 画笔 橡皮 形状 公式 3D 语音 ⋯（文字 / 上课 / 插入 / 图层收进「更多」） */
  html.s1 body #leftSidebar { position: fixed !important; left: 0 !important; right: 0 !important; top: auto !important; bottom: var(--site-beian-height, 0px) !important; width: auto !important; max-width: none !important; height: calc(var(--s1-tools) + var(--s1-safe-b)) !important; min-height: 0 !important; padding: 0 var(--space-1) var(--s1-safe-b) !important; border-radius: 0 !important; border-width: 1px 0 0 !important; box-shadow: none !important; display: flex !important; flex-direction: row !important; flex-wrap: nowrap !important; justify-content: space-between !important; align-items: center !important; gap: 0 !important; overflow-x: auto !important; overflow-y: hidden !important; overscroll-behavior: contain; scrollbar-width: none; z-index: var(--layer-stack-85) !important; }
  html.s1 body #leftSidebar::-webkit-scrollbar { display: none; }
  html.s1 body #leftSidebar > .redesign-tool-group { display: contents !important; }
  html.s1 body #leftSidebar :is([data-tool="text"], #btnToggleMediaMenu, #btnToggleLayers, #btnToggleFxPanel, #btnImportPdfDock), html.s1 body #leftSidebar > .h-px, html.s1 body #leftSidebar .w-6.h-px { display: none !important; }
  html.s1 body #leftSidebar #lecture-toolbar-btn { display:none !important; }
  html.s1 body #leftSidebar button, html.s1 body #leftSidebar > button, html.s1 body #leftSidebar > .tb2-slot { flex: 1 0 44px !important; width: auto !important; min-width: 44px !important; max-width: 64px !important; height: 50px !important; min-height: 0 !important; padding: var(--space-1) 0 !important; }
  html.s1 body #leftSidebar.s1-scrollable:not(.s1-at-end) { -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); }

  /* ⑥ 页码条：工具栏上方 44px 触控条，不浮动 */
  html.s1 body #pageManagerDock { position: fixed !important; left: 0 !important; right: 0 !important; bottom: calc(var(--s1-tools) + var(--s1-safe-b) + var(--site-beian-height, 0px)) !important; top: auto !important; transform: none !important; width: auto !important; max-width: none !important; height: var(--s1-pages) !important; min-height: 0 !important; padding: 0 var(--space-2) !important; border-radius: 0 !important; border-width: 1px 0 0 !important; box-shadow: none !important; justify-content: center !important; gap: var(--space-2) !important; z-index: var(--layer-stack-84) !important; overflow: visible !important; backdrop-filter: none !important; }
  html.s1 body #pageManagerDock > button { height: 44px !important; min-height: 44px !important; min-width: 44px !important; padding: 0 !important; }
  html.s1 body #pageManagerDock #pageIndicator { line-height: 44px; }
  html.s1 body #pageManagerDock .page-strip { position: absolute !important; left: 8px; right: 8px; bottom: calc(100% + 6px); max-height: 80px; padding: var(--space-2); border-radius: 12px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-panel, 0 8px 24px var(--shadow-ink)); overflow-x: auto; }
  html.s1 body #pageManagerDock.collapsed .page-strip { display: none !important; }
  html.s1 body #pageManagerDock.collapsed #btnAddPage { display: inline-flex !important; }

  /* 选中对象：属性变成工具栏上方的小条（白色玻璃 / 颜色 / 尺寸 / 拉成立体 / 删除…） */
  html.s1 body #redesignContext { position: fixed !important; left: 0 !important; right: 0 !important; top: auto !important; bottom: var(--s1-bottom) !important; transform: none !important; width: auto !important; max-width: none !important; height: auto !important; min-height: 48px !important; max-height: 28dvh !important; padding: 6px 8px !important; border-radius: 0 !important; border-width: 1px 0 0 !important; display: flex !important; flex-wrap: wrap !important; align-items: center !important; gap: 6px !important; overflow-x: hidden !important; overflow-y: auto !important; scrollbar-width: thin; z-index: var(--layer-stack-83) !important; box-shadow: none !important; }
  html.s1 body #redesignContext::-webkit-scrollbar { display: none; }
  html.s1 body #redesignContext.is-board { display: none !important; }
  html.s1 body #redesignContext > * { flex: 0 1 auto !important; min-width: 0; max-width: 100%; }
  html.s1 body #redesignContext :is(.viewer-ux-bar, .object-context) { display: flex !important; flex: 1 1 100% !important; flex-wrap: wrap !important; gap: 6px !important; position: static !important; transform: none !important; }
  html.s1 body #redesignContext .viewer-ux-bar[hidden] { display: none !important; }
  html.s1 body #redesignContext .viewer-display-segmented { display: flex; flex-wrap: wrap; max-width: 100%; }
  html.s1 body #redesignContext button { white-space: nowrap; min-height: 34px; }

  /* AI 输入：「输入文字」小胶囊，点开才展开 */
  html.s1 body #ai-assistant-reopen { bottom: calc(var(--s1-bottom) + 12px) !important; }
  html.s1 body #ai-assistant-bar { bottom: calc(var(--s1-bottom) + 8px) !important; }
  html.s1.s1-has-sel body #ai-assistant-reopen { bottom: calc(var(--s1-bottom) + var(--s1-context-h, 48px) + 12px) !important; }
  html.s1.s1-has-sel body #ai-assistant-bar { bottom: calc(var(--s1-bottom) + var(--s1-context-h, 48px) + 8px) !important; }
  /* 手机 Cookie 细条见文件末尾。 */

  /* 面板（3D、公式、笔刷…）一律底部抽屉：默认半屏，上拉全屏、下拉关闭；打开时底部工具栏隐藏 */
  html.s1 body :is(#panel3DTools, #formulaModal, #brushStudioFlyout, #shapePanel, #mediaMenu, #layersPanel, #fxPanel, #classroomToolsMenu, #moreToolsDrawer, #t1021ToolOpts, #paletteFlyout):not(.hidden) { position: fixed !important; left: 0 !important; right: 0 !important; top: auto !important; bottom: var(--site-beian-height, 0px) !important; width: auto !important; max-width: none !important; height: min(55%, calc(var(--s1-app-h) * .55)) !important; max-height: calc(var(--s1-app-h) - var(--s1-top) - var(--site-beian-height, 0px)) !important; margin: 0 !important; border-radius: 16px 16px 0 0 !important; padding-top: var(--space-4) !important; padding-bottom: calc(var(--space-3) + var(--s1-safe-b)) !important; overflow-y: auto !important; overscroll-behavior: contain; transform: translateY(max(0px, var(--s1-drag, 0px))) !important; transition: transform var(--motion-panel) var(--motion-ease), opacity var(--motion-panel) var(--motion-ease); z-index: var(--layer-stack-950) !important; box-sizing: border-box !important; }
  html.s1.s1-drawer-full body :is(#panel3DTools, #formulaModal, #brushStudioFlyout, #shapePanel, #mediaMenu, #layersPanel, #fxPanel, #classroomToolsMenu, #moreToolsDrawer, #t1021ToolOpts, #paletteFlyout):not(.hidden) { height: calc(var(--s1-app-h) - var(--s1-top) - var(--site-beian-height, 0px)) !important; }
  html.s1.s1-drawer-open body :is(#leftSidebar, #pageManagerDock, #ai-assistant-reopen, #ai-assistant-bar, #view3dControls, #redesignContext, #brushQuickBubble) { visibility: hidden !important; pointer-events: none !important; }
  .s1-grip { position: sticky; top: -12px; z-index: var(--layer-stack-3); height: 8px; margin: -10px auto var(--space-2); width: 100%; display: flex; justify-content: center; cursor: grab; touch-action: none; }
  .s1-grip::before { content: ""; width: 40px; height: 5px; border-radius: 3px; background: var(--line-strong); }
  .s1-drawer-close { position: absolute; top: 8px; right: 10px; z-index: var(--layer-stack-4); width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--surface-hover); color: var(--ink); font-size: 16px; cursor: pointer; }
  html.s1 body #panel3DTools .u3d-head { position: sticky; top: -16px; z-index: var(--layer-stack-2); background: inherit; }
  /* 抽屉内「插入 / 放入画板」主按钮固定在抽屉底部 */
  html.s1 body #panel3DTools :is(.u3d-insert, [data-u3d-insert], .physics-kit-insert:not([disabled])), html.s1 body #formulaModal :is(#btnFormulaInsert, .formula-insert, [data-formula-insert]) { position: sticky !important; bottom: 0; z-index: var(--layer-stack-2); box-shadow: 0 -8px 16px var(--surface); }

  #brushQuickBubble { width: min(300px, calc(100vw - 16px)); }
  html.s1.s1-bubble-open body :is(#pageManagerDock, #ai-assistant-reopen, #ai-assistant-bar, #redesignContext, #view3dControls, #pullSolidHandle) { visibility: hidden !important; pointer-events: none !important; }
}
@media (prefers-reduced-motion: reduce) { html.s1 body :is(#panel3DTools, #formulaModal, #brushStudioFlyout) { transition: none !important; } }

/* 拉成立体：手柄 + 实时预览（白色细线，与几何风格一致） */
#pullSolidHandle { position: fixed; z-index: var(--layer-stack-40); display: inline-flex; align-items: center; gap: var(--space-2); height: 36px; padding: 0 var(--space-4) 0 var(--space-2); border-radius: 18px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: 600 13px/1 system-ui, "PingFang SC", sans-serif; box-shadow: var(--shadow-panel, 0 8px 24px var(--shadow-ink)); cursor: ns-resize; touch-action: none; user-select: none; -webkit-user-select: none; }
#pullSolidHandle[hidden] { display: none; }
#pullSolidHandle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
#pullSolidHandle.is-pulling { background: var(--state-active-bg); box-shadow: inset 0 0 0 1.5px var(--state-active-border); }
#pullSolidHandle:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
#pullSolidPreview .pull-preview-line { fill: none; stroke: var(--vt-ink); stroke-width: 2; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
#pullSolidPreview .pull-preview-text { fill: var(--vt-ink); font: 600 15px system-ui, "PingFang SC", sans-serif; paint-order: stroke; stroke: rgb(0 0 0 / .45); stroke-width: 3px; }
#shapePanel .pull-entry { width: 100%; margin-top: var(--space-2); font-weight: 600; }
@media (max-width: 767.98px) { #pullSolidHandle { height: 40px; border-radius: 20px; font-size: 14px; } }

/* 旧版「3D 操作」引导卡会叠在 3D 面板上：由角落控件的一句提示代替（一次只出一个浮层） */
html.s1 body .viewer-ux-guide { display: none !important; }
/* AI 输入（B5）：以黑板可视区水平居中（--s1-board-cx 由 stage1-layout.js 量 #workbenchWrapper 写入），
   宽 ≤ 640px，两侧至少留 12px；左工具栏、属性面板、页码条都不影响它的中心。 */
html.s1 body :is(#ai-assistant-bar, #ai-assistant-reopen, #ai-assistant-hist, #ai-assistant-cards, #ai-assistant-note) { left: var(--s1-board-cx, 50%) !important; right: auto !important; transform: translateX(-50%) !important; }
html.s1 body #ai-assistant-bar { width: min(640px, calc(var(--s1-board-w, 100vw) - 24px)) !important; max-width: calc(100vw - 24px) !important; box-sizing: border-box !important; }
html.s1 body #ai-assistant-bar #ai-assistant-input { min-width: 0; }
/* 「已登录 · 使用账户额度」/ 试用次数：收进输入框内的小字，不再是框外的白色胶囊；手机上只在聚焦时出现 */
html.s1 body #ai-assistant-bar #ai-trial-remaining { flex: 0 1 auto !important; min-width: 0; max-width: 132px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px !important; line-height: 1.2 !important; color: var(--ink) !important; background: none !important; border: 0 !important; padding: 0 !important; pointer-events: none; }
@media (max-width: 767.98px) {
  html.s1 body #ai-assistant-bar:not(:focus-within) #ai-trial-remaining { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
}
html.s1 body #ai-assistant-bar:focus-within #ai-trial-remaining { color: var(--ink) !important; }

/* 工具栏旁的面板打开时，「输入文字」小胶囊先让开 */
html.s1:not([data-s1-panel=""]) body #ai-assistant-reopen { visibility: hidden !important; pointer-events: none !important; }

/* 手写识别建议卡（assets/ink/recognize-client.js）：在「输入文字」上方，跟着底部分区走，不与底部控件相交 */
html.s1 body #ink-recognize-chip { bottom: calc(var(--s1-bottom) + 64px) !important; }
html.s1.s1-has-sel body #ink-recognize-chip { bottom: calc(var(--s1-bottom) + 112px) !important; }
@media (min-width: 768px) { html.s1.s1-has-sel body #ink-recognize-chip { bottom: calc(var(--s1-bottom) + 64px) !important; } }
@media (max-width: 767.98px) {
  html.s1:is(.s1-drawer-open, .s1-bubble-open) body #ink-recognize-chip { visibility: hidden !important; pointer-events: none !important; }
  /* 公式抽屉自带的把手与浮层管理器的拖拽条重复，只留一个 */
  html.s1 body #formulaModal .formula-sheet-handle { display: none !important; }
}
@media (max-width: 767.98px) {
  /* 右下角 3D 控件在时，识别卡往左让出 56px */
  html.s1.s1-v3d body #ink-recognize-chip { left: calc(50% - 28px) !important; max-width: calc(100vw - 72px) !important; }
}

/* 正在操作选中的立体或拉伸图形时，识别建议卡先让开（浮层不能盖住正在操作的对象） */
html.s1:is(.s1-sel-3d, .s1-pull-active) body #ink-recognize-chip { visibility: hidden !important; pointer-events: none !important; }

/* Cookie：桌面右下角小卡片（避开底栏和「输入文字」）；手机是底栏上方细条。 */
html.s1 body #cookieBanner.cookie-banner {
  position: fixed !important;
  z-index: var(--layer-stack-96) !important;
  left: auto !important;
  right: 12px !important;
  bottom: calc(var(--s1-bottom) + 72px) !important;
  width: min(340px, calc(100vw - 24px)) !important;
  max-width: 340px !important;
  max-height: 120px !important;
  padding: var(--space-2) var(--space-3) !important;
  border-radius: 14px !important;
  box-shadow: 0 8px 24px var(--shadow-ink) !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  gap: var(--space-1) !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
  pointer-events: none !important;
  background: var(--surface) !important;
  color: var(--ink) !important;
}
html.s1 body #cookieBanner.cookie-banner > div:first-child,
html.s1 body #cookieBanner.cookie-banner .privacy-actions,
html.s1 body #cookieBanner.cookie-banner a { pointer-events: auto !important; }
html.s1 body #cookieBanner.cookie-banner .privacy-actions { flex-wrap: nowrap !important; gap: var(--space-2) !important; margin: 0 !important; }
html.s1 body #cookieBanner.cookie-banner .privacy-actions button {
  min-height: 28px !important;
  padding: var(--space-1) var(--space-2) !important;
  font-size: 12px !important;
  line-height: 1.2 !important;
}
html.s1 body #cookieBanner.cookie-banner .cookie-settings-link {
  background: transparent !important;
  border-color: transparent !important;
  color: var(--muted) !important;
  text-decoration: underline !important;
  min-height: 0 !important;
  padding: var(--space-1) var(--space-1) !important;
  box-shadow: none !important;
}
html.s1 body #cookieBanner.cookie-banner.is-dot {
  width: 44px !important;
  height: 44px !important;
  max-width: 44px !important;
  max-height: 44px !important;
  min-height: 44px !important;
  padding: 0 !important;
  border-radius: 22px !important;
  right: 12px !important;
  bottom: calc(var(--s1-bottom) + 12px) !important;
  pointer-events: auto !important;
}
html.s1 body #cookieBanner.cookie-banner.is-out,
html.s1 body #cookieBanner.cookie-banner.is-out * { pointer-events: none !important; }
html.s1 body #cookieBanner.cookie-banner.is-out { opacity: 0 !important; }
@media (max-width: 767.98px) {
  html.s1 body #cookieBanner.cookie-banner {
    left: 12px !important;
    right: 12px !important;
    width: auto !important;
    max-width: none !important;
    bottom: calc(var(--s1-bottom) + 8px) !important;
    max-height: 72px !important;
    padding: var(--space-1) var(--space-2) !important;
    gap: var(--space-1) !important;
    border-radius: 14px !important;
  }
  html.s1 body #cookieBanner.cookie-banner p { font-size: 12px !important; line-height: 1.25 !important; margin: 0 !important; }
  html.s1 body #cookieBanner.cookie-banner .privacy-actions button { min-height: 26px !important; padding: var(--space-1) var(--space-2) !important; }
  html.s1 body:has(#cookieBanner.cookie-banner:not(.is-dot):not(.is-out)) :is(#ai-assistant-reopen, #ai-assistant-bar) {
    bottom: calc(var(--s1-bottom) + 84px) !important;
  }
}

/* ---------- 10-20 P0：常驻撤销 / 重做、应用栏收进「⋯」、浮层互不遮挡 ---------- */
/* 浮层管理器让开的低优先级浮层：只隐藏不改布局，挡它的浮层收起后自动回来 */
html.s1 body .s1-yield { visibility: hidden !important; pointer-events: none !important; }
#s1UndoBar { display: none; }
@media (max-width: 767.98px) {
  html.s1 body #s1UndoBar { position: fixed; z-index: var(--layer-stack-85); left: calc(var(--s1-vv-left, 0px) + 8px); display: flex; gap: 4px; padding: 0; }
  html.s1 body #s1UndoBar:not([style*="top"]) { display: none; }
  html.s1 body #s1UndoBar button { display: inline-grid; place-items: center; width: 38px; height: 26px; padding: 0; border-radius: 8px; border: 1px solid var(--line, #e4e4e7); background: var(--surface, #fff); color: var(--ink, #18181b); cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
  html.s1 body #s1UndoBar button:disabled { color: #a1a1aa; opacity: .55; cursor: default; }
  html.s1 body #s1UndoBar button:not(:disabled):active { background: var(--state-active-bg, #f4f4f5); }
  html.s1 body #s1UndoBar .s1-redo svg { transform: scaleX(-1); }
  html.s1:is(.s1-drawer-open, .s1-mobile-space, .s1-guide-open) body #s1UndoBar { display: none !important; }
  /* 课件 / 一键成课 / 智录 / 上课：手机收进顶栏「⋯」，不再整条压在黑板上沿 */
  html.s1 body #gbAppRail { display: none !important; }
}

/* R3: editor controls stay on the scene; advanced tools remain in the drawer. */
.space-editor { position:absolute; inset:0; z-index:38; pointer-events:none; color:#edf1f4; font:500 12px/1.4 var(--font-ui,system-ui); }
.space-editor[hidden] { display:none !important; }
.space-editor button { pointer-events:auto; touch-action:none; color:inherit; cursor:pointer; }
.space-viewcube { position:absolute; right:88px; top:14px; width:56px; height:56px; perspective:360px; pointer-events:none; }
.space-viewcube-body { width:36px; height:36px; position:absolute; left:11px; top:11px; transform-style:preserve-3d; }
.space-viewcube-body button { position:absolute; inset:0; padding:0; min-width:0; border:1px solid #7f8c98; border-radius:3px; backface-visibility:hidden; background:#384957; font-size:11px; }
.space-viewcube-body button:hover,.space-viewcube-body button:focus-visible { background:#526a7e; outline:2px solid #d8e7f3; outline-offset:-2px; }
[data-view-face="posZ"] { transform:translateZ(18px); }
[data-view-face="negZ"] { transform:rotateY(180deg) translateZ(18px); }
[data-view-face="posX"] { transform:rotateY(90deg) translateZ(18px); }
[data-view-face="negX"] { transform:rotateY(-90deg) translateZ(18px); }
[data-view-face="posY"] { transform:rotateX(90deg) translateZ(18px); background:#526373 !important; }
[data-view-face="negY"] { transform:rotateX(-90deg) translateZ(18px); }
.space-transform-modes { position:absolute; left:12px; top:100px; display:flex; gap:3px; padding:4px; border:1px solid #596671; border-radius:12px; background:#25313cee; box-shadow:0 4px 16px #0002; }
.space-transform-modes button { min-height:38px; padding:0 12px; border:0; border-radius:8px; background:transparent; white-space:nowrap; display:flex; gap:6px; align-items:center; }
.space-transform-modes button span { font-size:18px; }
.space-transform-modes button[aria-pressed="true"] { background:#edf1f4; color:#263440; }
.space-transform-modes button:focus-visible,.space-guide button:focus-visible { outline:2px solid var(--focus-ring); outline-offset:2px; }
.space-guide { position:absolute; bottom:20px; left:16px; max-width:calc(100% - 32px); }
.space-guide>button { display:flex; gap:8px; align-items:center; min-height:40px; padding:8px 12px; border:1px solid #65737f; border-radius:10px; background:#25313cf2; text-align:left; }
#spaceGestureGuide { position:absolute; bottom:calc(100% + 8px); left:0; width:320px; max-width:calc(100vw - 32px); box-sizing:border-box; border:1px solid #65737f; border-radius:12px; padding:12px; background:#25313cf5; box-shadow:0 8px 24px #0002; }
#spaceGestureGuide[hidden] { display:none; }
#spaceGestureGuide p { display:flex; align-items:center; gap:12px; margin:4px 0; min-height:32px; }
.space-gesture-demo { display:inline-block; width:26px; flex:none; text-align:center; font-size:20px; animation:space-gesture 1.3s ease-in-out 2; }
@keyframes space-gesture { 50% { transform:translateX(7px); } }
html.s1.s1-mobile-space body [data-space-view-helper] { display:block !important; }
@media(max-width:767.98px) {
 .space-transform-modes { max-width:calc(100% - 16px); }
 .space-transform-modes button { min-height:44px; padding:0 12px; }
 .space-viewcube { right:12px; top:12px; }
 .space-guide { bottom:76px; left:12px; max-width:calc(100% - 24px); font-size:11px; }
 #spaceGestureGuide { width:310px; }
}
.move-gizmo-once { position:absolute; left:12px; top:72px; max-width:min(440px,calc(100% - 24px)); margin:0; padding:8px 10px; border-radius:10px; background:#25313cf2; color:#f4f7fb; pointer-events:auto; display:flex; gap:8px; align-items:flex-start; line-height:1.45; }
.move-gizmo-once[hidden] { display:none !important; }
.move-gizmo-help-btn { min-height:44px; padding:0 12px; border:1px solid #71808d; border-radius:8px; background:#27333c; color:#f3f4f6; cursor:pointer; }
.move-gizmo-help { flex-basis:100%; max-width:320px; padding:8px 10px; border-radius:8px; background:#27333c; color:#f3f4f6; font-size:12px; line-height:1.5; }
.move-gizmo-help p { margin:4px 0; }
.move-gizmo-help[hidden] { display:none !important; }

@media(max-width:767.98px) { .move-gizmo-once { top:auto; bottom:128px; } }
.move-gizmo-once span { padding-top:2px; }
.move-gizmo-once button { flex:none; min-height:32px; min-width:32px; border:0; border-radius:8px; background:transparent; color:inherit; font-size:18px; line-height:1; cursor:pointer; }
@media(pointer:coarse) { .move-gizmo-once button { min-height:44px; min-width:44px; } }
.space-axis-tag { position:absolute; z-index:40; pointer-events:none; padding:2px 6px; border-radius:6px; background:#1c2830ee; color:#f4f7fb; font:600 12px/1.4 var(--font-ui,system-ui); white-space:nowrap; }
@media(prefers-reduced-motion:reduce) { .space-gesture-demo { animation:none; } }
html[data-board-space] [data-board3d-selection] { display:block; }
html[data-board-space] .object-rotate-handle { display:grid; }
html[data-board-space][data-space-gizmo=translate] .object-rotate-handle { display:none; }
@media(min-width:768px) { html.s1.s1-sel-3d[data-board-space] .space-viewcube { right:88px; } }

html[data-board-space] #view3dControls .v3d-cube { display:none; }
/* 圆弧菜单打开时（华哥 10-22）：右侧对象面板让位，画面上只有物体 + 一圈圆弧 */
html.s1.otb-open:not(.s1-sel-3d) body #redesignContext { display: none !important; }
/* 侧边栏「形状」「几何」合并为「图形」（华哥 10-22）：形状入口收进「图形」面板的「平面形状」 */
html.s1 body #btnToggleShapePanel:has(~ #btnGeometryLive) { display: none !important; }
/* 圆弧菜单必须压在画布之上可点（画布容器层级高于 62 时，弧看得见却点不到） */
html.s1 body #objectToolbar, html.s1 body #objectToolbarPanel { z-index: 960 !important; }

/* 第 3 条：3D 空间状态标识（左上角）+ 返回黑板；面板里的进出按钮 */
.space-state-badge { align-self:center; display:inline-flex; align-items:center; gap:6px; min-height:32px; padding:0 12px; border-radius:999px; background:#edf1f4; color:#1f2a33; font:700 13px/1 var(--font-ui,system-ui); }
.space-state-badge::before { content:''; width:8px; height:8px; border-radius:50%; background:#22c55e; }
.space-back-board { min-height:44px; padding:0 14px; border:1px solid #71808d; border-radius:8px; background:#27333c; color:#f3f4f6; cursor:pointer; font-weight:600; }
.space-back-board:focus-visible { outline:2px solid var(--focus-ring); outline-offset:2px; }
.space-view-switch { min-height:40px; padding:0 14px; border:1px solid var(--line); border-radius:10px; background:var(--surface); color:var(--ink); font-weight:600; cursor:pointer; }
.space-view-switch[aria-pressed="true"] { background:var(--state-active-bg); color:var(--state-active-fg); box-shadow:inset 0 0 0 1.5px var(--state-active-border); }

/* 空间工具行不参与父容器的高度拉伸；说明永远脱离工具行。 */
[data-camera-space-actions] { bottom:auto !important; flex-wrap:nowrap !important; align-items:center !important; height:40px; overflow-x:auto; scrollbar-width:thin; }
[data-camera-space-actions] button { flex:0 0 auto; height:40px !important; min-height:40px !important; max-height:40px; width:auto; white-space:nowrap; box-sizing:border-box; }
[data-camera-navigation] { flex:0 0 auto; align-items:center; flex-wrap:nowrap !important; }
[data-camera-space-actions] .space-state-badge { flex:none; white-space:nowrap; }
.space-transform-modes[hidden] { display:none !important; }
.space-guide>button { justify-content:center; width:36px; height:36px; min-height:36px; padding:0; border-radius:50%; font-size:18px; }
.space-guide>button [role=status] { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
html[data-board-space] #geoToolsDock { display:none; }
html[data-board-space] #view3dControls { flex-direction:row; bottom:calc(var(--s1-bottom,48px) + 12px); right:16px; }
html[data-board-space] #redesignContext { display:none !important; }
#s1SpaceDrawer [data-camera-space-actions] { height:auto !important; flex-wrap:wrap !important; overflow:visible; }
#s1SpaceDrawer [data-camera-navigation] { flex-wrap:wrap !important; }

.space-annotation-tools { display:flex; flex:none; align-items:center; gap:4px; }
.space-annotation-tools button { padding:0 10px; border:1px solid #71808d; border-radius:8px; color:#f3f4f6; background:#27333c; }
.space-annotation-tools button[aria-pressed=true] { color:#263440; background:#edf1f4; }
html[data-board-space] #canvasCard .selection-box { display:none !important; }
html[data-board-space] .geo-tb { flex-wrap:wrap; max-width:calc(100% - 24px); box-sizing:border-box; }
html[data-board-space] .geo-ink { visibility:hidden; }
html[data-board-space] #geoConstructLayer { background:transparent; }
@media(max-width:767.98px) {
 #s1SpaceDrawer .space-annotation-tools { flex-wrap:wrap; }
 html.s1.s1-mobile-space[data-space-annotating] body #leftSidebar { display:flex !important; }
 html.s1.s1-mobile-space[data-space-annotating] #s1SpaceTools,html.s1.s1-mobile-space[data-space-annotating] #s1SpaceReturn { bottom:calc(var(--s1-tools) + var(--s1-safe-b) + 12px); }
 /* 10-29 冒烟：手机 3D 空间右下的「回到默认视角 / 漫游」白色小条叠在「3D 空间 · 工具」按钮上。
    把它放到这颗按钮正上方（按钮底边 16px + 高 44px + 间距 10px）；标注模式下按钮整体上移，小条跟着上移。 */
 html.s1.s1-mobile-space body #space3dCameraControls { bottom:calc(var(--s1-safe-b, 0px) + 70px) !important; }
 html.s1.s1-mobile-space[data-space-annotating] body #space3dCameraControls { bottom:calc(var(--s1-tools) + var(--s1-safe-b) + 66px) !important; }
}

/* Keep the timeline above the .cn filing strip as well. */
html.s1.site-cn #sceneTimeline { bottom: calc(12px + var(--site-beian-height)); }
@media (max-width: 767.98px) { html.s1.site-cn #sceneTimeline { bottom: calc(6px + var(--s1-safe-b) + var(--site-beian-height)); } }
html.s1.site-cn.s1-guide-open #s1GuideSheet { bottom: var(--site-beian-height); }

/* 空间对象同样使用中心 AI 圆盘；精确手柄仅显式开启后显示。 */
html.s1.s1-mobile-space body #objectToolbar:not([hidden]),html.s1.s1-mobile-space body #objectToolbarPanel:not([hidden]){display:block!important}
html:not(.sel-move-on) [data-board3d-selection] .object-size-handle,html:not(.sel-move-on) .object-rotate-handle{visibility:hidden;pointer-events:none}

html.s1.s1-mobile-space body #ai-assistant-bar:not(.hidden){display:flex!important}
