/* 3D 物体工具三处界面（设计稿 ⑨ + PRODUCT-UX-ARCH 第五、十二节深色 chrome）：
   三视图面板 .tv-panel · 尺寸面板 .sz-panel · 3D 空间顶部工具条 .space-toolbar 与视角立方体。
   颜色：底 #202124 · 抬起 #303134 · 线 rgb(255 255 255/.10) · 字 #E8EAED · 次字 #9AA0A6 · 主色 #4285F4。 */

/* ---------- 三视图 ---------- */
.tv-panel{position:fixed;z-index:var(--layer-stack-90,900);width:440px;max-width:calc(100vw - 16px);box-sizing:border-box;background:#202124;color:#E8EAED;border:1px solid rgb(255 255 255 / .10);border-radius:16px;box-shadow:0 2px 6px rgb(0 0 0 / .3);font:400 13px/1.5 var(--font-ui,system-ui,"PingFang SC",sans-serif)}
.tv-panel[hidden]{display:none}
.tv-head{position:relative;display:flex;align-items:center;gap:8px;height:48px;padding:0 8px 0 16px;cursor:grab;touch-action:none;user-select:none}
.tv-head:active{cursor:grabbing}
.tv-grip{display:none}
.tv-title{flex:1;margin:0;font-size:15px;font-weight:500;color:#E8EAED}
.tv-mode-toggle{display:inline-flex;gap:2px;padding:2px;border-radius:999px;background:#303134;margin-left:auto;margin-right:4px}
.tv-mode-toggle button{height:26px;min-height:26px;padding:0 8px;border:0;border-radius:999px;background:transparent;color:#9AA0A6;font:inherit;font-size:11px;font-weight:500;cursor:pointer;transition:background-color .15s ease,color .15s ease}
.tv-mode-toggle button[aria-pressed=true],.tv-mode-toggle button.is-active{background:#E8EAED;color:#202124;font-weight:600}
.tv-close{display:grid;place-items:center;width:36px;height:36px;border:0;border-radius:8px;background:transparent;color:#9AA0A6;cursor:pointer}
.tv-close:hover{background:#303134;color:#E8EAED}
.tv-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px;padding:0 12px 12px}
.tv-cell{margin:0;display:flex;flex-direction:column;gap:4px;padding:6px;border:1px solid rgb(255 255 255 / .08);border-radius:12px;background:#1B1D20}
.tv-cell figcaption{padding:0 2px;font-size:12px;font-weight:500;color:#E8EAED}
.tv-cell canvas{display:block;width:100%;aspect-ratio:1/1;border-radius:8px}
.tv-info{justify-content:center;gap:10px;padding:12px}
.tv-info dl{display:grid;grid-template-columns:auto 1fr;gap:6px 12px;margin:0}
.tv-info dt{color:#9AA0A6}
.tv-info dd{margin:0;font-variant-numeric:tabular-nums;color:#E8EAED}
.tv-hint{margin:0;font-size:12px;color:#9AA0A6}
.tv-legend{display:grid;grid-template-columns:24px 1fr;align-items:center;gap:4px 8px;margin:0;font-size:11px;color:#9AA0A6}
.tv-legend .tv-solid,.tv-legend .tv-dash{display:block;height:0;border-top:2px solid #E8EAED}
.tv-legend .tv-dash{border-top:2px dashed #9AA0A6}
@media (max-width:767.98px){
  .tv-panel{left:0!important;right:0!important;top:auto!important;bottom:0!important;width:auto;max-width:none;max-height:82dvh;overflow:auto;border-radius:20px 20px 0 0;border-bottom:0;padding-bottom:env(safe-area-inset-bottom)}
  .tv-head{cursor:default;padding-top:6px}
  .tv-grip{display:block;position:absolute;left:50%;top:6px;width:36px;height:4px;margin-left:-18px;border-radius:2px;background:#5F6368}
  .tv-grid{gap:6px;padding:0 10px 10px}
}

/* ---------- 尺寸：名称 · − · 数值 · + · 单位，一行一个；体积 / 表面积单独一行 ---------- */
.sz-panel.sz-panel{display:flex!important;flex-direction:column;gap:8px;min-width:300px;padding:12px!important;background:#202124!important;color:#E8EAED!important;border:1px solid rgb(255 255 255 / .10)!important;border-radius:16px!important;box-shadow:0 2px 6px rgb(0 0 0 / .3)!important;font:400 13px/1.4 var(--font-ui,system-ui,"PingFang SC",sans-serif)}
.sz-units{display:flex;gap:2px;padding:3px;border-radius:999px;background:#303134}
.sz-units button{flex:1;height:30px;min-height:30px;padding:0 8px;border:0;border-radius:999px;background:transparent;color:#9AA0A6;font:inherit;font-size:12px;cursor:pointer}
.sz-units button[aria-checked=true]{background:#E8EAED;color:#202124}
.sz-row{display:grid;grid-template-columns:minmax(64px,1fr) 36px 96px 36px 36px;align-items:center;gap:6px}
.sz-name{color:#E8EAED;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.sz-row input{box-sizing:border-box;width:100%;height:36px;padding:0 8px;border:1px solid #5F6368;border-radius:8px;background:#303134;color:#E8EAED;font:inherit;font-variant-numeric:tabular-nums;text-align:right;-moz-appearance:textfield}
.sz-row input::-webkit-inner-spin-button,.sz-row input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}
.sz-row input:focus{outline:2px solid #4285F4;outline-offset:0;border-color:#4285F4}
.sz-step{display:grid;place-items:center;width:36px;height:36px;padding:0;border:1px solid #5F6368;border-radius:8px;background:transparent;color:#E8EAED;cursor:pointer}
.sz-step:hover{background:#303134}
.sz-unit{color:#9AA0A6;font-size:12px}
.sz-metrics{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:2px;padding-top:10px;border-top:1px solid rgb(255 255 255 / .10)}
.sz-metrics span{display:flex;flex-direction:column;gap:2px}
.sz-metrics small{font-size:11px;color:#9AA0A6}
.sz-metrics b{font-weight:500;font-variant-numeric:tabular-nums;color:#E8EAED}
@media (max-width:767.98px),(pointer:coarse){
  .sz-panel.sz-panel{min-width:0}
  .sz-row{grid-template-columns:minmax(56px,1fr) 44px minmax(84px,108px) 44px 32px}
  .sz-row input{height:44px;font-size:16px}
  .sz-step{width:44px;height:44px}
  .sz-units button{height:36px;min-height:36px}
}

/* ---------- 3D 空间顶部工具条：页面层固定在顶栏下方，深色胶囊，一排不换行，放不下的进「更多」 ---------- */
body > .space-toolbar{position:fixed;top:calc(var(--s1-top,52px) + 8px);left:calc(var(--s1-shell,0px) + var(--s1-rail-w,0px) + 12px);z-index:var(--layer-stack-60,600);display:flex;flex-wrap:nowrap!important;align-items:center;gap:4px;height:auto!important;max-width:calc(100vw - var(--s1-shell,0px) - 120px);padding:4px;overflow:visible!important;background:#202124;border:1px solid rgb(255 255 255 / .10);border-radius:12px;box-shadow:0 2px 6px rgb(0 0 0 / .3)}
html.app-shell-open body > .space-toolbar{left:calc(var(--app-shell-w,260px) + 12px)}
body > .space-toolbar[hidden]{display:none!important}
.space-toolbar button,.space-toolbar .space-state-badge{flex:none;height:36px!important;min-height:36px!important;max-height:36px;padding:0 12px!important;border:0!important;border-radius:8px!important;background:transparent!important;color:#E8EAED!important;font:500 13px/36px var(--font-ui,system-ui,"PingFang SC",sans-serif)!important;white-space:nowrap;cursor:pointer;box-shadow:none!important}
.space-toolbar button:hover{background:#303134!important}
.space-toolbar button[aria-pressed=true],.space-toolbar button[aria-expanded=true]{background:#303134!important}
.space-toolbar .space-state-badge{display:inline-flex;align-items:center;gap:6px;cursor:default;color:#E8EAED!important}
.space-toolbar .space-state-badge::before{content:"";width:8px;height:8px;border-radius:50%;background:#34A853}
.space-toolbar .space-back-board{background:#4285F4!important;color:#FFFFFF!important}
.space-toolbar .space-back-board:hover{background:#3B78E7!important}
.space-more{position:relative;flex:none}
.space-more>[data-space-more]::after{content:"";display:inline-block;width:6px;height:6px;margin-left:8px;border-right:1.5px solid currentColor;border-bottom:1.5px solid currentColor;transform:translateY(-2px) rotate(45deg)}
.space-more-panel{position:absolute;top:calc(100% + 8px);right:0;min-width:200px;display:flex;flex-direction:column;gap:2px;padding:6px;background:#202124;border:1px solid rgb(255 255 255 / .10);border-radius:12px;box-shadow:0 2px 6px rgb(0 0 0 / .3)}
.space-more-panel[hidden]{display:none}
.space-more-panel>*{display:flex!important;flex-direction:column;gap:2px;flex-wrap:nowrap!important}
.space-more-panel button{width:100%;text-align:left;justify-content:flex-start}
.space-more-panel input[type=range]{width:100%;accent-color:#4285F4}
/* 手机：工具条在「3D 空间 · 工具」抽屉里，「更多」直接展开 */
#s1SpaceDrawer .space-toolbar{position:relative!important;inset:auto!important;flex-wrap:wrap!important;max-width:none;border:0;box-shadow:none;background:transparent}
#s1SpaceDrawer .space-more>[data-space-more]{display:none!important}
#s1SpaceDrawer .space-more-panel{position:static;display:flex!important;border:0;box-shadow:none;padding:0;background:transparent}

/* 进 3D 空间时右侧两条浮条让开，视角立方体贴右上角完整显示 */
html[data-board-space] :is(#gbAppRail,#geoToolsDock){display:none!important}
/* B-10: full dark ViewCube ~96px (ux-v2); faces sized so isometric shows 前/上/右. */
html.s1 .space-viewcube.space-viewcube,html[data-board-space] body > .space-viewcube.space-viewcube{right:16px!important;top:12px!important;width:96px;height:96px;border:1px solid rgb(255 255 255 / .10);border-radius:16px;background:rgb(32 33 36 / .72);pointer-events:auto;box-sizing:border-box}
html.s1 .space-viewcube .space-viewcube-body,html[data-board-space] body > .space-viewcube .space-viewcube-body{width:56px;height:56px;left:20px;top:20px;transform-style:preserve-3d}
html.s1 .space-viewcube-body button,html[data-board-space] body > .space-viewcube .space-viewcube-body button{border-color:#5F6368;background:#303134;color:#E8EAED;font-size:13px}
html.s1 .space-viewcube-body button:hover,html.s1 .space-viewcube-body button:focus-visible,html[data-board-space] body > .space-viewcube .space-viewcube-body button:hover,html[data-board-space] body > .space-viewcube .space-viewcube-body button:focus-visible{background:#4285F4;outline:none}
html.s1 .space-viewcube [data-view-face="posZ"],html[data-board-space] body > .space-viewcube [data-view-face="posZ"]{transform:translateZ(28px)}
html.s1 .space-viewcube [data-view-face="negZ"],html[data-board-space] body > .space-viewcube [data-view-face="negZ"]{transform:rotateY(180deg) translateZ(28px)}
html.s1 .space-viewcube [data-view-face="posX"],html[data-board-space] body > .space-viewcube [data-view-face="posX"]{transform:rotateY(90deg) translateZ(28px)}
html.s1 .space-viewcube [data-view-face="negX"],html[data-board-space] body > .space-viewcube [data-view-face="negX"]{transform:rotateY(-90deg) translateZ(28px)}
html.s1 .space-viewcube [data-view-face="posY"],html[data-board-space] body > .space-viewcube [data-view-face="posY"]{transform:rotateX(90deg) translateZ(28px);background:#3C4043!important}
html.s1 .space-viewcube [data-view-face="negY"],html[data-board-space] body > .space-viewcube [data-view-face="negY"]{transform:rotateX(-90deg) translateZ(28px)}

/* The contextual action host also has its own card; remove that second skin
   only while this action is mounted, so the size panel has no white rim. */
#objectToolbarPanel:has(.sz-panel){padding:0!important;background:#202124!important;color:#E8EAED!important;border-color:rgb(255 255 255 / .10)!important;box-shadow:0 2px 6px rgb(0 0 0 / .3)!important;min-width:0}
.sz-panel.sz-panel{box-sizing:border-box;width:340px;max-width:100%;min-width:0;border:0!important;box-shadow:none!important}
.sz-row{grid-template-columns:minmax(56px,1fr) 36px 86px 36px 30px}
.sz-units button[aria-checked=true]{background:#4285F4;color:#fff}
.space-more-panel{max-height:calc(100dvh - var(--s1-top,56px) - 90px);overflow-y:auto;overscroll-behavior:contain}
body > .space-toolbar{max-width:calc(100vw - var(--s1-shell,0px) - var(--s1-rail-w,0px) - 124px);box-sizing:border-box}
html.app-shell-open body > .space-toolbar{max-width:calc(100vw - var(--app-shell-w,260px) - 124px)}
html.s1 body > .space-viewcube.space-viewcube{position:fixed;top:calc(var(--s1-top,56px) + 12px)!important;z-index:var(--layer-stack-60,600);perspective:360px;font:500 12px/1.4 var(--font-ui,system-ui)}
body > .space-viewcube[hidden]{display:none!important}
body > .space-viewcube button{position:absolute;inset:0;padding:0;min-width:0;border:1px solid #5F6368;border-radius:3px;backface-visibility:hidden;pointer-events:auto;touch-action:none;cursor:pointer;color:#E8EAED}
@media (max-width:767.98px),(pointer:coarse){
  .sz-row{grid-template-columns:minmax(52px,1fr) 44px minmax(72px,1fr) 44px 30px}
  .sz-units button{height:44px;min-height:44px}
  .tv-close{width:44px;height:44px}
  #s1SpaceDrawer .space-toolbar{display:flex;flex-wrap:wrap;gap:6px}
  #s1SpaceDrawer .space-more{flex-basis:100%}
  #s1SpaceDrawer .space-toolbar button{min-height:44px!important;height:44px!important;line-height:44px!important}
}
/* B-10: keep one full cube in the upper viewport corner (do not require html.s1). */
html[data-board-space] body > .space-viewcube:not([hidden]){display:block!important;pointer-events:auto}
html[data-board-space] body :is(#view3dControls,#space3dCameraControls) .v3d-cube{display:none!important}
html.s1 body:has(.tv-panel:not([hidden])) :is(#brushQuickBubble,#t1021ToolOpts,#objectToolbarPanel,#redesignContext){visibility:hidden!important}
