/* 功能：沿用桌面的蓝灰配色，控件尺寸、间距和交互外观使用常规网页样式。 */
:root {
  font-family:"Segoe UI","Microsoft YaHei",sans-serif;
  font-size:14px;
  font-synthesis:none;
  color:var(--ink);
  background:var(--chrome);
  --ink:#202831;
  --muted:#5f6876;
  --accent:#1f5ea8;
  /* 功能：网页线框图标沿用桌面图标主色，原始 PNG 不重绘或改色。 */
  --icon-color:#4a76c6;
  --selection:#00557f;
  --hover:#e7eff9;
  --paper:#ffffff;
  --chrome:#eef1f5;
  --toolbar-bg:#f2f4f7;
  --line:#cfd6df;
  --frame:#b9c2cf;
  --grid:#d7dde4;
  --alternate:#f7f9fb;
  --header-height:52px;
  --document-height:64px;
  --toolbar-height:144px;
}
* { box-sizing:border-box; }
body { margin:0; }
button,input,select,textarea { font:inherit; }
button,.button {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:7px;
  min-height:38px;
  padding:8px 12px;
  border:1px solid var(--line);
  border-radius:7px;
  background:var(--paper);
  color:var(--ink);
  cursor:pointer;
  white-space:nowrap;
  text-decoration:none;
}
button:hover,.button:hover { background:var(--hover); border-color:#9eb7d2; }
button:active,.button:active { background:#d3dae4; border-color:#9faab8; }
button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible,a:focus-visible,summary:focus-visible {
  outline:2px solid var(--accent);
  outline-offset:1px;
}
button:disabled { opacity:.45; cursor:not-allowed; }
button.primary,.button.primary { background:var(--accent); border-color:var(--accent); color:white; }
button.primary:hover,.button.primary:hover { background:#174c8a; }
button.quiet { border-color:transparent; background:transparent; color:var(--muted); }
button.quiet:hover { background:var(--hover); border-color:var(--line); }
.small { min-height:36px; font-size:13px; padding:6px 9px; }
input,select,textarea {
  min-width:0;
  min-height:38px;
  padding:8px 10px;
  border:1px solid var(--line);
  border-radius:6px;
  background:var(--paper);
  color:var(--ink);
}
input[type=range] { width:100%; min-height:24px; padding:0; accent-color:var(--accent); }
input[type=color] { width:52px; height:36px; min-height:36px; padding:3px; }
input[type=checkbox] { min-height:auto; accent-color:var(--accent); }
label { display:grid; gap:7px; color:var(--ink); font-size:13px; }
h1,h2,h3,p { margin-top:0; }
h2,h3 { font-size:15px; }
small { line-height:1.5; }
.muted,.empty { color:var(--muted); font-size:13px; }
.empty { padding:18px 8px; line-height:1.7; text-align:center; }
.error { color:#a12626; font-size:13px; line-height:1.6; }
.app-logo { display:block; width:26px; height:26px; object-fit:contain; }
.tool-icon { display:block; width:20px; height:20px; object-fit:contain; flex-shrink:0; }
.sr-only {
  position:absolute;
  width:1px;
  height:1px;
  padding:0;
  margin:-1px;
  overflow:hidden;
  clip:rect(0,0,0,0);
  white-space:nowrap;
  border:0;
}
[hidden] { display:none!important; }
.mobile-only { display:none; }

/* 功能：账号登录与待审核注册共用居中表单，保留桌面标识和蓝灰主题。 */
.login-screen {
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:20px;
  min-height:100dvh;
  padding:24px;
  background:var(--chrome);
}
.login-brand { display:flex; align-items:center; gap:10px; font-size:21px; color:var(--ink); }
.login-brand .app-logo { width:36px; height:36px; }
.login-layout { width:min(400px,100%); }
.login-card {
  width:100%;
  padding:28px;
  border:1px solid var(--line);
  border-radius:8px;
  background:var(--paper);
  box-shadow:0 3px 12px #18283b12;
}
.login-card h2 { margin:0 0 12px; font-size:20px; font-weight:600; }
.login-card>p { margin-bottom:20px; color:var(--muted); font-size:13px; line-height:1.6; }
.login-card label { margin:16px 0; }
.login-card input { min-height:40px; }
.login-card button { width:100%; margin:8px 0 16px; min-height:40px; }
.login-card small { color:var(--muted); font-size:12px; }
.login-card .auth-switch { margin:0 0 12px; }
.login-card .error { color:#a12626; }
.login-card .error:empty { display:none; }
/* 功能：注册和审核结果在当前表单内显示，弹窗打开时也能看到成功与失败状态。 */
.auth-status,.login-card>.auth-status { margin:0 0 16px; padding:10px 12px; border:1px solid #b6d2bf; border-radius:6px; background:#f0f8f2; color:#245d36; font-size:13px; line-height:1.6; overflow-wrap:anywhere; }
.login-screen footer { display:flex; justify-content:space-between; gap:12px; width:min(400px,100%); color:var(--muted); font-size:12px; }

/* 功能：网页顶部区分账号、当前文档和视图工具，使用可触控的常规控件尺寸。 */
.workspace { display:flex; flex-direction:column; height:100dvh; overflow:hidden; }
.app-header {
  display:flex;
  align-items:center;
  gap:16px;
  height:var(--header-height);
  flex-shrink:0;
  padding:0 16px;
  border-bottom:1px solid var(--line);
  background:var(--chrome);
}
.brand { display:flex; align-items:center; gap:8px; white-space:nowrap; }
.brand strong { font-size:16px; font-weight:600; }
.header-divider { width:1px; height:22px; background:var(--line); }
.enterprise-name { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:var(--muted); font-size:13px; }
.local-badge { display:flex; align-items:center; gap:6px; color:var(--muted); font-size:12px; white-space:nowrap; }
.status-dot { display:inline-block; width:5px; height:5px; background:var(--accent); }
.header-actions { display:flex; align-items:center; gap:10px; margin-left:auto; font-size:13px; white-space:nowrap; }
.header-actions button { min-height:36px; padding:6px 10px; }
.document-bar {
  display:flex;
  align-items:center;
  gap:12px;
  height:var(--document-height);
  flex-shrink:0;
  padding:8px 16px;
  border-bottom:1px solid var(--line);
  background:var(--paper);
}
.document-title { min-width:0; flex:1; }
.document-title small { display:block; color:var(--muted); font-size:12px; line-height:1.3; }
.document-title h1 { overflow:hidden; max-width:44vw; margin:4px 0 0; font-size:16px; font-weight:600; text-overflow:ellipsis; white-space:nowrap; }
.document-actions { display:flex; align-items:center; flex-shrink:0; gap:8px; margin-left:auto; }
.document-actions>span { max-width:28vw; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:12px; }

/* 功能：常用视图操作分为两行独立横向滚动，保留模型区域并防止窄屏页面被撑宽。 */
.view-tools { display:flex; flex-direction:column; width:100%; min-width:0; height:var(--toolbar-height); flex-shrink:0; border-bottom:1px solid var(--line); background:var(--toolbar-bg); }
/* 功能：功能组按标题与单排控件排列，分隔线明确边界，不改变工具栏总高度。 */
.view-toolbar {
  display:flex;
  align-items:stretch;
  flex:1;
  gap:0;
  min-height:0;
  min-width:0;
  max-width:100%;
  padding:6px 10px;
  overflow-x:auto;
  overflow-y:hidden;
  scrollbar-width:thin;
}
.view-toolbar-secondary { border-top:1px solid var(--line); }
.toolbar-group { display:flex; flex-direction:column; align-items:flex-start; justify-content:center; gap:4px; flex-shrink:0; padding:0 12px; border-right:1px solid var(--line); }
.toolbar-group:first-child { padding-left:0; }
.toolbar-group:last-child { border-right:0; padding-right:0; }
.toolbar-title { color:var(--muted); font-size:11px; line-height:14px; white-space:nowrap; }
.toolbar-controls { display:flex; align-items:center; gap:5px; }
.toolbar-controls button,.view-settings summary { min-height:32px; padding:5px 8px; font-size:12px; white-space:nowrap; }
.toolbar-controls select { width:auto; max-width:160px; min-height:32px; padding:5px 7px; font-size:12px; }
.standard-views { gap:3px; }
.standard-views button { min-width:32px; padding-inline:7px; }
/* 功能：首排高频按钮适配1366宽度，保留原有点击高度与分组顺序。 */
.view-toolbar:not(.view-toolbar-secondary) .toolbar-controls button { padding-inline:6px; gap:5px; }

.toolbar-controls label { display:flex; align-items:center; flex-shrink:0; gap:4px; margin:0; font-size:12px; white-space:nowrap; }
.toolbar-controls .check-label { min-height:32px; }
.toolbar-controls input[type="checkbox"] { width:15px; height:15px; margin:0; flex-shrink:0; }
.toolbar-controls input[type="range"] { width:72px; min-width:72px; margin:0; padding:0; }
.toolbar-controls input[type="color"] { width:30px; min-width:30px; height:28px; min-height:28px; padding:2px; }
/* 功能：低频参数保留一个详细设置面板，固定在两行工具栏下方且不参与横向滚动裁剪。 */
.view-settings { position:relative; }
.view-settings>details { border:0; background:transparent; }
.view-settings summary { display:flex; align-items:center; gap:7px; border:1px solid var(--line); border-radius:7px; background:var(--paper); cursor:pointer; list-style:none; }
.view-settings summary::-webkit-details-marker { display:none; }
.view-settings summary::after { content:'▾'; color:var(--muted); font-size:11px; }
.view-settings summary:hover,.view-settings details[open]>summary { border-color:#9eb7d2; background:var(--hover); }
.control-body {
  position:fixed;
  z-index:25;
  top:calc(var(--header-height) + var(--document-height) + var(--toolbar-height) + 8px);
  right:12px;
  display:grid;
  gap:12px;
  width:340px;
  max-width:calc(100vw - 24px);
  max-height:calc(100dvh - var(--header-height) - var(--document-height) - var(--toolbar-height) - 20px);
  overflow:auto;
  padding:14px;
  border:1px solid var(--line);
  border-radius:8px;
  background:var(--paper);
  box-shadow:0 3px 10px #18283b24;
}
.control-body label { font-size:13px; }
.control-body small { color:var(--muted); font-size:12px; line-height:1.5; }
/* 功能：三栏网页工作台保留白色侧栏；移动端抽屉以工作区定位，避免顶部高度变化造成错位。 */
.workbench { position:relative; display:grid; grid-template-columns:280px minmax(0,1fr) 340px; min-height:0; flex:1; overflow:hidden; }
.library,.inspector { display:flex; flex-direction:column; min-width:0; min-height:0; overflow:hidden; background:var(--paper); }
.library { position:relative; padding:0 14px; border-right:1px solid var(--line); }
.inspector { border-left:1px solid var(--line); }
.panel-heading { display:flex; align-items:center; justify-content:space-between; min-height:44px; flex-shrink:0; padding:9px 12px; border-bottom:1px solid var(--line); background:var(--paper); }
.panel-heading h2 { margin:0; font-size:14px; font-weight:600; }
.library>.panel-close { position:absolute; z-index:1; top:6px; right:8px; }
/* 功能：原生折叠区无需脚本；限定模型列表高度，结构树始终使用独立的剩余空间。 */
.project-panel { flex-shrink:0; margin:0 -14px; border-bottom:1px solid var(--line); }
.project-panel>summary { display:flex; align-items:center; justify-content:space-between; gap:12px; min-height:48px; padding:12px 14px; cursor:pointer; list-style:none; }
.project-panel>summary::-webkit-details-marker { display:none; }
.project-panel>summary:hover { background:var(--alternate); }
.project-panel h2 { margin:0; font-size:14px; font-weight:600; }
.project-toggle-hint { color:var(--muted); font-size:12px; }
.project-toggle-hint::after { content:'展开 ▾'; }
.project-panel[open] .project-toggle-hint::after { content:'收起 ▴'; }
.project-content { display:flex; flex-direction:column; gap:10px; padding:0 14px 14px; }
.project-content>select { flex-shrink:0; min-height:38px; font-size:13px; }
.library-tools { display:flex; flex-wrap:wrap; justify-content:space-between; flex-shrink:0; gap:8px; }
.model-list { max-height:min(128px,18dvh); min-height:0; overflow:auto; scrollbar-gutter:stable; }
.model-card { justify-content:flex-start; width:100%; min-height:38px; margin-bottom:3px; padding:7px 8px; border:1px solid transparent; border-radius:6px; font-size:13px; text-align:left; white-space:normal; }
.model-card::before { content:'◇'; color:var(--accent); font-size:15px; }
.model-card.active { background:var(--hover); color:var(--selection); border-color:#c2d6ee; }
.model-card.active::before { color:var(--selection); }
/* 功能：模型打开和删除分为独立点击区域，回收列表沿用相同行高与滚动边界。 */
.model-row { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center; gap:4px; }
.model-row .model-card { min-width:0; overflow-wrap:anywhere; }
.model-action { min-height:30px; padding:4px 7px; font-size:12px; }
/* 功能：回收站恢复和彻底删除并列显示，项目删除沿用相同的危险操作颜色。 */
.model-actions { display:flex; align-items:center; gap:4px; }
.model-delete,button.quiet.model-delete { color:#a33434; }
.model-trash>summary { padding:6px 0; color:var(--muted); font-size:12px; cursor:pointer; }
.model-trash>summary span { margin-left:5px; }
.deleted-model-row { padding:6px 0; border-bottom:1px solid var(--line); }
.deleted-model-info { display:flex; flex-direction:column; min-width:0; gap:3px; overflow-wrap:anywhere; font-size:12px; }
.deleted-model-info small { color:var(--muted); font-size:11px; }
.structure-panel { display:flex; flex-direction:column; flex:1; min-height:0; padding-top:16px; }
.structure-heading { display:flex; align-items:center; justify-content:space-between; flex-shrink:0; margin-bottom:12px; }
.structure-heading h2 { margin:0; font-size:14px; font-weight:600; }
.structure-heading span { color:var(--muted); font-size:12px; }
.structure-panel>input { flex-shrink:0; margin-bottom:12px; padding:8px 10px; font-size:13px; }
.tree { flex:1; min-height:0; overflow:auto; padding:2px 0 10px; scrollbar-gutter:stable; }
.tree details>summary { display:flex; align-items:center; min-height:34px; list-style:none; cursor:pointer; }
.tree summary::before { content:'▸'; flex-shrink:0; width:11px; color:var(--muted); font-size:10px; }
.tree details[open]>summary::before { content:'▾'; }
.tree .tree-children { margin-left:4px; padding-left:10px; border-left:1px solid var(--grid); }
.tree-row { justify-content:flex-start; gap:6px; width:100%; min-height:34px; padding:6px; border:1px solid transparent; border-radius:6px; background:transparent; font-size:13px; text-align:left; white-space:normal; }
.tree-row span { overflow:hidden; overflow-wrap:anywhere; text-overflow:ellipsis; }
.tree-row:hover { background:var(--hover); border-color:transparent; }
.tree-row.selected { background:var(--hover); color:var(--selection); border-color:#c2d6ee; }
.tree-row .node-marker { flex-shrink:0; width:5px; height:5px; background:#aab4c1; }
.tree-row.loaded .node-marker { background:var(--accent); }
.tree-row.selected .node-marker { background:var(--selection); }
.library-footer { display:flex; align-items:center; flex-shrink:0; gap:6px; padding:10px 0; border-top:1px solid var(--line); color:var(--muted); font-size:12px; }

/* 功能：桌面 DefaultStyle.ini 默认的白到青色纵向渐变，底部状态栏独立保持对比度。 */
.stage { position:relative; min-width:0; min-height:0; overflow:hidden; background:linear-gradient(to bottom,var(--viewer-background-top,#ffffff),var(--viewer-background-bottom,#33cccc)); }
.viewport { position:absolute; inset:0 0 24px; }
.viewport canvas { display:block; width:100%; height:100%; touch-action:none; }
.stage-empty { position:absolute; top:45%; left:50%; width:90%; transform:translate(-50%,-50%); color:#42576a; text-align:center; pointer-events:none; }
.stage-empty h2 { margin:0 0 8px; font-size:17px; font-weight:500; }
.stage-empty p { font-size:12px; line-height:1.7; }
.stage-empty>span { color:#536777; font-size:11px; }
.empty-model-icon { margin-bottom:10px; color:var(--selection); font-size:42px; line-height:1; }
.stage-footer { position:absolute; right:0; bottom:0; left:0; display:flex; align-items:center; justify-content:space-between; gap:8px; height:24px; padding:2px 10px; border-top:1px solid var(--line); background:var(--toolbar-bg); color:var(--muted); font-size:12px; pointer-events:none; }
.scene-progress { position:absolute; bottom:36px; left:12px; display:flex; align-items:center; flex-wrap:wrap; gap:8px; max-width:calc(100% - 24px); padding:9px 12px; border:1px solid var(--line); border-radius:7px; background:#fffffff0; font-size:13px; }
#scene-failures { flex-basis:100%; max-height:180px; overflow:auto; overflow-wrap:anywhere; }
#scene-failures summary { color:var(--accent); cursor:pointer; }
.measurement-result { position:absolute; top:12px; left:12px; max-width:min(310px,calc(100% - 24px)); padding:10px 12px; border:1px solid #92b4d6; border-radius:7px; background:#eff6fff2; color:#174c8a; font-size:13px; line-height:1.6; pointer-events:none; }
.viewer-measure-label { position:absolute; transform:translate(-50%,-140%); padding:6px 9px; border:1px solid #92b4d6; border-radius:6px; background:#eff6ff; color:#174c8a; font-size:12px; white-space:nowrap; pointer-events:none; }

/* 功能：五个独立网页页签使用蓝色下划线；数据维持名称/内容两列，输入控件有清晰边界。 */
.selection-card { margin:12px; padding:10px 12px; border:1px solid var(--line); border-radius:7px; background:var(--alternate); }
.selection-card small { color:var(--muted); font-size:12px; }
.selection-card h3 { margin:6px 0; font-size:14px; font-weight:600; overflow-wrap:anywhere; }
.selection-card span { color:var(--muted); font-size:12px; }
/* 功能：外观操作跟随当前选择展示，两行布局为窄屏保留完整标签与可拖动滑块。 */
.selection-appearance { display:grid; flex-shrink:0; gap:8px; margin:0 12px 12px; }
.selection-appearance label { display:flex; align-items:center; gap:10px; margin:0; font-size:13px; white-space:nowrap; }
.appearance-color { display:flex; align-items:center; gap:12px; }
.appearance-color input[type="color"] { width:52px; min-width:52px; height:32px; min-height:32px; padding:2px; }
.appearance-opacity input[type="range"] { flex:1; width:0; margin:0; padding:0; }
/* 功能：自动保存状态仅在存在结果或未保存外观时占位，失败保留重试入口。 */
.appearance-save { display:flex; align-items:center; gap:8px; color:var(--muted); font-size:12px; line-height:1.5; }
.appearance-save:has(> span[hidden]):has(> button[hidden]) { display:none; }
/* 功能：多选值不一致时显示混合状态，色块不伪装为任一模型的实际颜色。 */
.appearance-state { color:var(--muted); font-size:12px; }
.appearance-color input[data-mixed="true"]::-webkit-color-swatch { background:repeating-linear-gradient(135deg,#d1d8e2 0 6px,#ffffff 6px 12px)!important; }
.appearance-color input[data-mixed="true"]::-moz-color-swatch { background:repeating-linear-gradient(135deg,#d1d8e2 0 6px,#ffffff 6px 12px)!important; }
.panel-note { margin:0 0 12px; color:var(--muted); font-size:12px; line-height:1.6; }
.data-edit-status { margin:0 12px 10px; }
.tabs { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); flex-shrink:0; gap:0; padding:0 6px; border-bottom:1px solid var(--line); background:var(--paper); }
.tabs button { min-width:0; min-height:38px; padding:7px 2px; border:0; border-bottom:2px solid transparent; border-radius:0; background:transparent; color:var(--muted); font-size:12px; white-space:nowrap; }
.tabs button:hover { background:var(--alternate); color:var(--accent); }
.tabs button[aria-selected=true] { border-bottom-color:var(--accent); color:var(--accent); font-weight:600; }
.tab-panel { min-height:0; flex:1; overflow:auto; padding:12px; }
.data-section { margin-bottom:16px; }
.data-section h4 { display:flex; justify-content:space-between; margin:0 0 8px; color:var(--ink); font-size:13px; font-weight:600; }
.data-table { width:100%; border:1px solid var(--line); border-collapse:collapse; table-layout:fixed; font-size:13px; }
.data-table th,.data-table td { padding:8px; border:1px solid var(--grid); vertical-align:top; text-align:left; overflow-wrap:anywhere; }
.data-table th { border-bottom-color:#c5ccd5; background:#f1f3f6; color:var(--ink); font-weight:400; }
.data-table td:first-child { width:42%; }
.data-table tbody tr:nth-child(even)>td { background:var(--alternate); }
.custom-table th:first-child { width:44%; }
.custom-table td:first-child { width:auto; }
.custom-table td { padding:6px 4px; }
.custom-table td.empty { padding:16px 8px; color:var(--muted); text-align:center; }
.custom-field input,.custom-field textarea { display:block; width:100%; min-height:38px; padding:8px 6px; border-color:var(--line); border-radius:6px; background:var(--paper); font-size:13px; line-height:1.6; }
.custom-field input:focus,.custom-field textarea:focus { border-color:var(--accent); background:var(--paper); }
.custom-field .field-label-cell { position:relative; }
.custom-field .field-name { padding-right:34px; }
/* 功能：长值优先按内容增长，也允许手动调高和滚动，旧浏览器不支持 field-sizing 时仍可读全内容。 */
.custom-field .field-value { field-sizing:content; min-height:60px; resize:vertical; overflow:auto; white-space:pre-wrap; overflow-wrap:anywhere; }
.custom-field .field-label-cell button { position:absolute; top:10px; right:8px; width:28px; min-height:30px; padding:0; }

.custom-field input:disabled,.custom-field textarea:disabled { opacity:1; color:var(--ink); background:var(--alternate); }
.field-actions { display:flex; flex-wrap:wrap; gap:8px; margin-top:12px; }
.field-actions button { font-size:13px; }
.asset-heading { display:flex; align-items:center; justify-content:space-between; gap:8px; margin-bottom:12px; color:var(--muted); font-size:13px; }
.asset-card { padding:12px 6px; border-bottom:1px solid var(--grid); }
.asset-card:nth-child(even) { background:var(--alternate); }
.asset-card strong { display:block; font-size:13px; font-weight:500; overflow-wrap:anywhere; }
.asset-card small { color:var(--muted); font-size:12px; }
.asset-actions { display:flex; flex-wrap:wrap; gap:6px; margin-top:8px; }
.asset-actions button,.asset-actions a { min-height:36px; padding:6px 9px; font-size:12px; }
.version-card { margin-bottom:10px; padding:12px; border:1px solid var(--line); border-left:3px solid var(--line); border-radius:6px; }
.version-card.active { border-left-color:var(--accent); background:var(--alternate); }
.version-card strong { display:block; font-size:13px; font-weight:600; }
.version-card p { margin:7px 0; color:var(--muted); font-size:12px; line-height:1.6; white-space:pre-line; }
.version-card button { margin-right:6px; min-height:36px; padding:6px 9px; font-size:12px; }
.diagnostics { max-height:150px; overflow:auto; padding:7px; border-top:1px solid #d7c89d; background:#fff9e8; font-size:11px; }
.diagnostics summary { color:#775d1b; cursor:pointer; }
.diagnostics p { margin:6px 0 0; color:#6a5d3e; line-height:1.6; }

/* 功能：资料预览及账号管理使用网页弹窗，保留错误提示、翻页和输入状态。 */
.toast { position:fixed; z-index:40; bottom:30px; left:50%; max-width:85vw; transform:translateX(-50%); padding:10px 16px; border:1px solid #89a9cb; border-radius:7px; background:#edf5ff; color:#174c8a; box-shadow:0 3px 12px #18283b20; font-size:13px; line-height:1.6; }
.toast.error { border-color:#c78d8d; background:#fff1f1; color:#8f2727; }
dialog { width:720px; max-width:min(960px,94vw); max-height:90dvh; padding:20px; border:1px solid var(--line); border-radius:8px; background:var(--paper); color:var(--ink); box-shadow:0 8px 32px #18283b40; }
dialog::backdrop { background:#25314266; }
.dialog-heading { display:flex; align-items:center; justify-content:space-between; gap:10px; margin:0 0 16px; padding-bottom:12px; border-bottom:1px solid var(--line); }
.dialog-heading h2 { margin:0; font-size:17px; overflow-wrap:anywhere; }
/* ???????????????????????????? */
#unsaved-changes-dialog { width:min(440px,94vw); }
.dialog-heading button { min-width:36px; min-height:36px; padding:0 7px; border-color:transparent; background:transparent; font-size:22px; }
#preview-content { display:flex; justify-content:center; min-height:60px; margin-bottom:14px; padding:12px; border:1px solid var(--line); border-radius:6px; background:var(--alternate); }
#preview-content img,#preview-content video { max-width:100%; max-height:60dvh; object-fit:contain; }
#preview-content audio { width:100%; }
.pdf-preview { width:100%; max-height:62dvh; overflow:auto; }
.pdf-toolbar { position:sticky; top:0; display:flex; align-items:center; justify-content:space-between; gap:8px; padding:5px 0; background:var(--alternate); font-size:12px; }
.pdf-preview canvas { display:block; max-width:100%; height:auto; margin:8px auto; background:var(--paper); }
/* 功能：管理窗口分成员和项目两类，各类表单双列排列并在窄屏自然换行。 */
.admin-tabs { grid-template-columns:repeat(2,minmax(0,1fr)); margin-bottom:20px; padding:0; }
.admin-tabs button { font-size:14px; }
.admin-project-controls { display:flex; align-items:end; flex-wrap:wrap; gap:12px; margin-bottom:20px; }
.admin-project-controls label { flex:1; min-width:min(220px,100%); }
.admin-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:20px; }
/* 功能：成员账号列表独占一行，项目页只保留单列项目操作。 */
.admin-grid>#user-admin { grid-column:1/-1; }
#admin-projects .admin-grid { grid-template-columns:1fr; }
.admin-grid form { display:grid; gap:10px; margin-bottom:20px; }
.admin-grid input,.admin-grid select,.admin-grid button { font-size:13px; }
.admin-grid h3 { font-size:14px; }
.admin-grid .member-card { padding:10px 0; border-bottom:1px solid var(--grid); font-size:13px; line-height:1.7; }
.member-card button { margin:4px 4px 0 0; min-height:36px; padding:6px 8px; font-size:12px; }
/* 功能：待审申请置于现有成员管理上方，长姓名换行，列表独立滚动并适应窄屏。 */
.registration-admin { margin-bottom:20px; padding-bottom:18px; border-bottom:1px solid var(--line); }
.registration-heading { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:10px; }
.registration-heading h3 { margin:0; }
.registration-heading h3 span { margin-left:6px; font-weight:400; }
.registration-list { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(240px,100%),1fr)); gap:12px; max-height:260px; overflow:auto; }
.registration-list>.empty { grid-column:1/-1; margin:0; }
.registration-card { min-width:0; padding:12px; border:1px solid var(--line); border-radius:6px; background:var(--alternate); overflow-wrap:anywhere; line-height:1.6; }
.registration-card strong { display:block; font-size:13px; }
.registration-card>div,.registration-card>small { color:var(--muted); font-size:12px; }
.registration-actions { display:flex; flex-wrap:wrap; gap:8px; margin-top:10px; }

/* 功能：窄屏仅在工具栏内部滚动，小屏数据/模型面板使用既有抽屉动作。 */
@media(min-width:1500px) {
  .workbench { grid-template-columns:310px minmax(0,1fr) 360px; }
}
@media(max-width:1100px) {
  .workbench { grid-template-columns:240px minmax(0,1fr) 300px; }
  .local-badge { display:none; }
}
@media(max-width:900px) {
  .workbench { grid-template-columns:240px minmax(0,1fr); }
  .inspector { position:absolute; z-index:15; top:0; right:0; bottom:0; width:340px; transform:translateX(110%); transition:transform .15s; box-shadow:-3px 0 12px #18283b24; }
  .inspector.open { transform:translateX(0); }
  #toggle-inspector,.inspector .mobile-only { display:inline-flex; }
  .stage-footer span:last-child,.document-actions>span { display:none; }
  .header-actions { gap:4px; }
  .admin-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media(max-width:620px) {
  .mobile-only { display:inline-flex; }
  .app-header { gap:8px; padding:0 10px; }
  .header-divider,.enterprise-name,.header-actions>span { display:none; }
  .header-actions button { padding:6px; font-size:12px; }
  .document-bar { gap:6px; padding:8px 10px; }
  .document-title h1 { max-width:100%; font-size:14px; }
  .document-title small { font-size:11px; }
  .document-actions { gap:4px; }
  .document-actions button { min-height:36px; padding:6px; font-size:12px; }
  #download-button { white-space:nowrap; }
  .workbench { display:block; }
  .stage { height:100%; }
  .library { position:absolute; z-index:15; top:0; bottom:0; left:0; width:320px; max-width:90vw; transform:translateX(-110%); transition:transform .15s; box-shadow:3px 0 12px #18283b24; }
  .library.open { transform:translateX(0); }
  .project-panel>summary { padding-right:52px; }
  .inspector { max-width:90vw; }
  .panel-close { min-height:36px; min-width:36px; padding:0 6px; border-color:transparent; background:transparent; font-size:22px; }
  .stage-empty h2 { font-size:15px; }
  .stage-empty p,.scene-progress { font-size:12px; }
  .stage-footer { font-size:11px; }
  .measurement-result { font-size:12px; }
  .admin-grid { grid-template-columns:1fr; }
  .login-screen { padding:16px; }
  .login-card { padding:24px; }
  .login-screen footer { font-size:11px; }
}
@media(prefers-reduced-motion:reduce) {
  .library,.inspector { transition:none; }
}

/* 功能：详细设置按用途分组，相关颜色、数值和动作同排，保持窄面板内的阅读顺序。 */
.control-body fieldset { display:grid; gap:10px; min-width:0; border:1px solid var(--line); padding:10px; margin:0; border-radius:6px; }
.control-body legend { padding:0 4px; font-size:13px; font-weight:600; }
.control-body label { min-width:0; }
.settings-inline { grid-template-columns:84px minmax(0,1fr); align-items:center; }
.settings-inline input[type=color] { justify-self:end; }
.settings-stack,.settings-subsection { display:grid; gap:10px; }
.settings-row { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
.settings-row input,.settings-rotation-row select { width:100%; }
.settings-color-controls { display:flex; align-items:flex-end; gap:10px; }
.settings-color-controls label { flex:1; }
.settings-color-controls input[type=color] { width:100%; }
.settings-color-controls button { flex:none; min-height:36px; }
.settings-caption { font-size:12px; color:var(--muted); }
.settings-subsection { border-top:1px solid var(--line); padding-top:10px; }
.settings-angle-row { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:end; gap:8px; }
.settings-angle-row button { min-height:38px; padding:6px 8px; font-size:12px; }
.settings-rotation-row { display:grid; grid-template-columns:74px minmax(0,1fr); align-items:end; gap:12px; }
.settings-rotation-row input[type=range] { min-height:38px; margin:0; }
.view-button-row { display:flex; flex-wrap:wrap; gap:6px; margin:8px 0; }
.angle-inputs { display:flex; gap:6px; }
.angle-inputs label { min-width:0; flex:1; }
.angle-inputs input { width:100%; min-width:0; padding-inline:5px; }
/* 功能：立方体固定在视口右上方，透明留白不拦截模型拖动，面/棱/角支持鼠标和键盘。 */
.view-navigation { position:absolute; top:12px; right:12px; width:136px; height:148px; z-index:3; pointer-events:none; user-select:none; }
.view-cube { display:block; width:100%; height:100%; overflow:visible; }
.view-cube-region { cursor:pointer; pointer-events:auto; outline:none; }
.view-cube-region polygon { stroke:#84a3c1; stroke-width:1.1; stroke-linejoin:round; }
.view-cube-region text { font-family:SimHei,"Microsoft YaHei",sans-serif; font-size:14px; fill:#243b52; pointer-events:none; }
.view-cube-region:hover polygon,.view-cube-region:focus-visible polygon { fill:#badfff !important; stroke:#2168ac; stroke-width:2; }
.view-cube-region[aria-pressed="true"] polygon { stroke:#397fb9; stroke-width:1.5; }
.view-cube-axis { pointer-events:none; }
.view-cube-axis line { stroke:currentColor; stroke-width:1.7; }
.view-cube-axis text { fill:currentColor; font:600 10px Arial,sans-serif; }
.view-navigation .view-cube-home { position:absolute; right:6px; bottom:4px; min-height:26px; padding:2px 7px; font-size:11px; background:#ffffffc9; pointer-events:auto; }
@media(max-width:700px) { .view-navigation { top:8px; right:8px; width:122px; height:133px; } }
#import-dialog { width:min(620px,92vw); }
#import-dialog input[type=file] { width:100%; max-width:230px; }
#import-status { overflow-wrap:anywhere; }
.engineering-label { position:absolute; pointer-events:none; transform:translate(-50%,-50%); padding:2px 5px; border-radius:3px; border:1px solid #d2b5a0; background:#fff9e9e8; color:#753d23; font-size:12px; white-space:nowrap; z-index:2; }
#engineering-diagnostics { max-height:180px; overflow:auto; font-size:12px; overflow-wrap:anywhere; }
.stage-footer { flex-wrap:wrap; }
#cursor-coordinates { font-variant-numeric:tabular-nums; }


/* 功能：用户字段中的媒体草稿紧随文本，窄侧栏自动换行；隐藏输入不受表格输入样式影响。 */
.user-field-media { min-width:0; margin-top:8px; }
.user-field-media input[hidden] { display:none; }
.field-media-actions { display:flex; flex-wrap:wrap; gap:5px; }
.field-media-actions button { min-height:32px; padding:5px 7px; font-size:12px; }
.field-media-list { display:grid; gap:8px; margin-top:8px; }
.field-media-list[hidden] { display:none; }
.field-media-card { min-width:0; overflow:hidden; padding:5px; border:1px solid var(--line); border-radius:6px; background:var(--paper); }
.field-media-photo { display:flex; width:100%; min-width:0; height:112px; padding:0; overflow:hidden; background:var(--alternate); }
.field-media-photo img { display:block; width:100%; height:100%; object-fit:contain; }
.field-media-card video,.field-media-card audio { display:block; width:100%; max-width:100%; min-width:0; }
.field-media-card video { max-height:180px; background:#111; }
.field-media-card audio { height:40px; }
.field-media-caption { display:flex; align-items:center; flex-wrap:wrap; gap:4px; margin-top:5px; }
.field-media-name { flex:1 1 72px; min-width:0; overflow-wrap:anywhere; font-size:11px; color:var(--muted); }
.field-media-caption button { flex:0 0 auto; min-height:28px; padding:3px 5px; color:#945353; font-size:11px; }
.field-media-status,.field-media-error { margin:6px 0 0; overflow-wrap:anywhere; font-size:12px; line-height:1.5; }
.field-media-status { color:var(--accent); }
.field-media-error { color:#a32c2c; }


/* 功能：照片明确提示可点击放大，文件名独占一行，避免被下载/移除按钮挤断。 */
.field-media-photo { position:relative; }
.field-photo-hint { position:absolute; right:6px; bottom:6px; padding:3px 6px; border-radius:4px; background:#172b42c9; color:#fff; font-size:12px; pointer-events:none; }
.field-media-name { flex:1 0 100%; font-size:13px; color:var(--ink); }
.field-media-caption .button { padding:5px 8px; font-size:12px; }
/* 功能：预览内容单独滚动，关闭和下载保持可见；图片使用更大的可用屏幕空间。 */
#preview-dialog { width:min(1100px,calc(100vw - 32px)); max-height:calc(100dvh - 32px); }
#preview-dialog[open] { display:flex; flex-direction:column; }
#preview-dialog .dialog-heading,.preview-footer { flex-shrink:0; }
#preview-dialog #preview-content { min-height:0; overflow:auto; }
#preview-dialog #preview-content img,#preview-dialog #preview-content video { max-height:70dvh; flex-shrink:0; }
.preview-footer .muted { margin:0 0 10px; font-size:12px; }
/* 功能：手机与触屏按名称/内容上下排列，播放器获得完整宽度，操作触点不小于 44 像素。 */
@media(max-width:620px),(pointer:coarse) {
  #tab-custom .custom-table,#tab-custom .custom-table tbody,#tab-custom .custom-table tr,#tab-custom .custom-table td { display:block; width:100%; }
  #tab-custom .custom-table thead { display:none; }
  #tab-custom .custom-table td { padding:6px 8px; border:0; }
  #tab-custom .custom-field { padding:6px 0; border-bottom:1px solid var(--line); }
  #tab-custom .custom-field:last-child { border-bottom:0; }
  #tab-custom .field-name,#tab-custom .field-value { min-height:44px; font-size:16px; }
  #tab-custom .field-name { padding-right:52px; }
  #tab-custom .remove-field { min-width:44px; min-height:44px; top:6px; right:8px; }
  .field-media-actions button,.field-media-caption button,.field-media-caption .button,#tab-custom .field-actions button,#tab-custom .asset-actions button,#tab-custom .asset-actions .button {
    min-height:44px; min-width:44px; padding:9px 12px; font-size:14px; touch-action:manipulation;
  }
  .field-media-actions,.field-media-caption { gap:8px; }
  .field-media-photo { height:160px; }
  .field-media-card audio { height:54px; }
  .field-media-card video { max-height:280px; }
  #preview-dialog .dialog-heading button { min-width:44px; min-height:44px; }
  #preview-download { min-height:44px; }
}
/* 功能：小屏预览接近全屏，安全区域保留关闭和下载入口，横屏时内容仍可独立滚动。 */
@media(max-width:620px) {
  #preview-dialog { width:calc(100vw - 16px); max-width:calc(100vw - 16px); max-height:calc(100dvh - 16px); padding:12px; }
  #preview-dialog .dialog-heading { margin-bottom:10px; padding-bottom:8px; }
  #preview-dialog .dialog-heading h2 { font-size:15px; }
  #preview-dialog #preview-content { padding:4px; margin-bottom:10px; }
  #preview-dialog #preview-content img,#preview-dialog #preview-content video { max-height:calc(100dvh - 180px); }
  #preview-download { display:flex; justify-content:center; width:100%; }
}


/* 功能：文件、拍照、录像和录音仅显示图标；四项同排，手机保留 44 像素触控范围。 */
.field-media-actions { flex-wrap:nowrap; gap:4px; }
.field-media-actions .media-action { display:inline-flex; align-items:center; justify-content:center; flex:1 1 32px; width:32px; min-width:28px; max-width:36px; height:32px; padding:0; }
.media-action svg { display:block; width:20px; height:20px; pointer-events:none; }
.field-media-actions .media-action[aria-pressed="true"] { color:#b43434; border-color:#c57c7c; background:#fff0f0; }
@media(max-width:620px),(pointer:coarse) {
  .field-media-actions { gap:8px; }
  .field-media-actions .media-action { flex:0 0 44px; width:44px; min-width:44px; max-width:44px; min-height:44px; height:44px; padding:0; }
  .media-action svg { width:22px; height:22px; }
}


/* 功能：文件卡片下载和移除共用图标尺寸；文件名仍完整显示，手机保留 44 像素触点。 */
.field-media-caption .media-action { display:inline-flex; align-items:center; justify-content:center; flex:0 0 32px; width:32px; min-width:32px; height:32px; min-height:32px; padding:0; }
@media(max-width:620px),(pointer:coarse) {
  .field-media-caption .media-action { flex-basis:44px; width:44px; min-width:44px; height:44px; min-height:44px; padding:0; }
}

/* 功能：操作图标统一点击面积，保留原选中色与危险操作色；触屏使用更大的点击目标。 */
button.action-icon,a.action-icon,label.action-icon,summary.action-icon,
.view-toolbar .toolbar-controls button.action-icon,
:is(.document-actions,.header-actions,.library-tools,.field-actions,.asset-actions,.member-card,.version-card,.dialog-heading,.settings-color-controls,.settings-angle-row,.admin-grid,.field-label-cell) :is(button,a,label).action-icon {
  display:inline-flex; align-items:center; justify-content:center; flex:0 0 36px;
  width:36px; min-width:36px; max-width:36px; height:36px; min-height:36px;
  padding:0; gap:0; vertical-align:middle;
}
.action-icon svg { display:block; width:20px; height:20px; flex:none; pointer-events:none; }
.action-icon .tool-icon { width:20px; height:20px; pointer-events:none; }
/* 功能：统一图标按钮边框、圆角和浅色底，桌面原图与网页图标均保留清晰对比。 */
:is(button,a,label,summary).action-icon { border:1px solid var(--line); border-radius:6px; background:var(--paper); }
:is(button,a).primary.action-icon { border-color:#9cb7dd; background:#edf3fc; }
:is(button,a,label,summary).action-icon:hover { border-color:#9eb7d2; background:var(--hover); }
:is(button,a,label,summary).action-icon:active { border-color:#78a3d8; background:#dceafa; }
/* 功能：视角、显示和开关共用按下反馈，悬停或按住时仍保持选中外观。 */
.standard-views button.action-icon[aria-pressed="true"],.display-modes button.action-icon[aria-pressed="true"],#face-normal.action-icon[aria-pressed="true"],button.action-icon[data-toggle][aria-pressed="true"] { color:#145baa; border-color:#78a3d8; background:#dceafa; box-shadow:inset 0 1px 3px #245d9b30; }
/* 功能：所有网页图标使用同一蓝色线条，删除和录音状态分别保留清晰的语义色。 */
.action-icon > svg { color:var(--icon-color); }
.action-icon:is([data-action-icon="remove"],[data-action-icon="purge"],[data-action-icon="userRemove"],[data-action-icon="reject"]) > svg { color:#a33434; }
.field-media-actions .media-action[aria-pressed="true"] > svg { color:#b43434; }
label.action-icon:has(input[type="file"]:disabled) { opacity:.45; cursor:not-allowed; }

.action-icon input[type="file"] { display:none; }
label.action-icon:focus-visible { outline:2px solid var(--accent); outline-offset:1px; }
.view-settings summary.action-icon::after { content:none; }
.view-navigation .view-cube-home.action-icon { right:2px; bottom:0; }
.field-media-actions .media-action.action-icon { flex:0 0 36px; width:36px; min-width:36px; max-width:36px; height:36px; min-height:36px; }
.field-media-caption .media-action.action-icon { flex-basis:36px; width:36px; min-width:36px; height:36px; min-height:36px; }
@media (max-width:900px), (pointer:coarse) {
  button.action-icon,a.action-icon,label.action-icon,summary.action-icon,
.view-toolbar .toolbar-controls button.action-icon,
:is(.document-actions,.header-actions,.library-tools,.field-actions,.asset-actions,.member-card,.version-card,.dialog-heading,.settings-color-controls,.settings-angle-row,.admin-grid,.field-label-cell) :is(button,a,label).action-icon {
    flex-basis:44px; width:44px; min-width:44px; max-width:44px; height:44px; min-height:44px; padding:0;
  }
  .action-icon svg,.action-icon .tool-icon { width:22px; height:22px; }
  .field-media-actions .media-action.action-icon { flex:0 0 44px; width:44px; min-width:44px; max-width:44px; height:44px; min-height:44px; }
  .field-media-caption .media-action.action-icon { flex-basis:44px; width:44px; min-width:44px; height:44px; min-height:44px; }
}

/* 功能：需要直接辨认的操作可显示图标和文字，复用既有桌面/触屏高度及交互状态。 */
:is(button,a,label,summary).action-icon[data-action-text] { flex:0 0 auto; width:auto; min-width:0; max-width:100%; padding:0 12px; gap:7px; color:var(--ink); font-size:13px; }
.action-icon[data-action-text] > .action-text { min-width:0; white-space:normal; line-height:1.4; }

/* 功能：保留移动面板入口的原断点，不因图标 display 样式在桌面误显示。 */
@media (min-width:621px) { #toggle-library.action-icon,.library .panel-close.action-icon { display:none; } }
@media (min-width:901px) { #toggle-inspector.action-icon,.inspector .panel-close.action-icon { display:none; } }

/* 功能：触屏长按由共享提示处理，避免浏览器文字选择或图片菜单覆盖功能名称。 */
.action-icon, .action-icon svg, .action-icon img { -webkit-touch-callout:none; -webkit-user-select:none; user-select:none; }
.action-icon { touch-action:manipulation; }
.action-icon-hint { position:fixed; z-index:10000; max-width:calc(100vw - 16px); box-sizing:border-box; padding:7px 11px; border:1px solid #294a70; border-radius:6px; color:#fff; background:#173652; box-shadow:0 3px 12px #0003; font-size:13px; line-height:1.4; overflow-wrap:anywhere; pointer-events:none; }
/* 功能：持续开关保留按下位移和键盘焦点，选中色由共享图标样式统一管理。 */

button[data-toggle]:active { transform:translateY(1px); }
button[data-toggle]:focus-visible { outline:2px solid var(--accent); outline-offset:1px; }

/* 功能：批量导入在同一清单展示各模型结果，手机端保留完整文件名和错误。 */
.import-file-list { margin:12px 0; padding:0; list-style:none; max-height:240px; overflow:auto; border:1px solid var(--line); border-radius:6px; }
.import-file-list li { display:flex; flex-wrap:wrap; justify-content:space-between; gap:6px 16px; padding:9px 12px; border-bottom:1px solid var(--line); }
.import-file-list li:last-child { border-bottom:0; }
.import-file-name { min-width:0; overflow-wrap:anywhere; }
.import-file-result { color:var(--muted); font-size:12px; overflow-wrap:anywhere; }
.import-file-list [data-state="success"] .import-file-result { color:#28713d; }
.import-file-list [data-state="error"] .import-file-result { color:#a12626; }

.import-file-list [data-state="uncertain"] .import-file-result { color:#895c18; }
