/* ============================================================================
   solidworks2026 · web/css/app.css
   SOLIDWORKS 2026 风格浅色工作台：Windows 11 级细边框、CommandManager、
   FeatureManager、蓝灰渐变图形区、任务窗格与状态栏。无外链字体/图片。
   ========================================================================== */
:root {
  --title-h: 38px;
  --menu-h: 25px;
  --ribbon-h: 116px;
  --status-h: 25px;
  --left-w: 286px;
  --right-w: 278px;
  --sw-red: #c8102e;
  --sw-red-2: #a50d25;
  --accent: #1f5f9e;
  --accent-2: #2d77bd;
  --accent-soft: #e7f1fb;
  --accent-softer: #f2f7fc;
  --chrome: #eef1f5;
  --chrome-2: #e3e8ee;
  --panel: #f7f9fb;
  --panel-2: #ffffff;
  --line: #c3cbd5;
  --line-2: #d8dee6;
  --line-3: #e6eaef;
  --ink: #1e2a36;
  --ink-2: #586777;
  --ink-3: #8995a3;
  --ok: #1f7a44;
  --warn: #a66200;
  --bad: #b42318;
  --viewport-1: #b5cfe8;
  --viewport-2: #d5e5f3;
  --viewport-3: #f3f8fc;
  --shadow: 0 8px 30px rgba(22, 36, 52, .18);
  --shadow-sm: 0 1px 3px rgba(22, 36, 52, .12);
  --font: "Segoe UI", "Noto Sans SC", "Microsoft YaHei", "PingFang SC", system-ui, -apple-system, sans-serif;
  --mono: "Cascadia Code", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --radius: 3px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0;
  font: 12px/1.4 var(--font);
  color: var(--ink);
  background: #dce3ea;
  overflow: hidden;
  user-select: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
input, select, textarea { user-select: text; }
::selection { background: #b9d8f6; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #b8c3cf; border: 2px solid var(--panel); border-radius: 7px; }
::-webkit-scrollbar-thumb:hover { background: #98a7b7; }
:focus-visible { outline: 2px solid #6ba5dc; outline-offset: -1px; }
.hidden { display: none !important; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: pre; border: 0; }
.mono { font-family: var(--mono); }
.spacer { flex: 1 1 auto; }
.icon { display: block; flex: none; }
.sw-icon { display: block; flex: none; filter: drop-shadow(0 1px 0 rgba(255, 255, 255, .65)); }
button { border: 0; background: none; padding: 0; }

#app {
  height: 100vh;
  min-width: 960px;
  display: grid;
  grid-template-rows: var(--title-h) var(--menu-h) var(--ribbon-h) minmax(0, 1fr) var(--status-h);
  background: var(--chrome);
  overflow: hidden;
}

/* ------------------------------------------------------------------ 标题栏 */
.titlebar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px 0 10px;
  background: linear-gradient(180deg, #fbfcfd 0%, #eef3f8 58%, #e7edf4 100%);
  border-bottom: 1px solid #b9c3ce;
  box-shadow: inset 0 1px 0 #fff;
  position: relative;
  z-index: 70;
}
.brand { display: flex; align-items: center; gap: 7px; min-width: 0; user-select: none; }
.brand .brand-word { font-size: 14px; font-weight: 800; letter-spacing: 1.1px; color: #303b46; white-space: nowrap; }
.brand .brand-year { font-size: 13px; font-weight: 700; color: var(--sw-red); margin-left: 2px; letter-spacing: .4px; }
.brand .brand-sub { font-size: 9px; color: var(--ink-3); border-left: 1px solid var(--line); padding-left: 7px; margin-left: 2px; white-space: nowrap; letter-spacing: .4px; }
.title-doc {
  display: flex; align-items: center; gap: 6px; min-width: 0; max-width: 34vw;
  padding: 2px 10px; border-left: 1px solid var(--line); height: 25px; color: var(--ink-2);
}
.title-doc .doc-name { color: var(--ink); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.title-doc .doc-dirty { color: var(--sw-red); font-size: 15px; line-height: 1; }
.title-doc .doc-type { color: var(--ink-3); font-size: 10px; white-space: nowrap; }
.title-search { margin-left: auto; display: flex; align-items: center; gap: 6px; width: 240px; height: 25px; padding: 0 8px; border: 1px solid #c9d1db; border-radius: 4px; background: #fff; color: var(--ink-3); }
.title-search input { border: 0; outline: 0; background: transparent; width: 100%; height: 21px; font-size: 11.5px; color: var(--ink); }
.title-search kbd { font: 10px var(--mono); color: #7b8794; border: 1px solid #d0d7df; border-radius: 3px; padding: 0 4px; background: #f7f9fb; white-space: nowrap; }
.title-actions { display: flex; align-items: center; gap: 1px; }
.title-btn { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 3px; color: #4a5867; }
.title-btn:hover { background: #d8e5f2; color: var(--accent); }
.title-btn:disabled { opacity: .35; }
.edition-chip { font-size: 9.5px; font-weight: 700; letter-spacing: .7px; text-transform: uppercase; padding: 2px 7px; border-radius: 3px; background: #e3efe5; color: #276a3d; border: 1px solid #bfdcc8; white-space: nowrap; }
.edition-chip.dev { background: #e7eefc; color: #28579e; border-color: #c4d4f2; }
.unofficial-chip { font-size: 9px; color: #8a5a00; background: #fff5df; border: 1px solid #ecd59f; padding: 2px 6px; border-radius: 3px; white-space: nowrap; }
.title-avatar { width: 24px; height: 24px; border-radius: 50%; background: linear-gradient(160deg, #4a7eae, #234668); color: #fff; font-size: 9px; font-weight: 700; display: grid; place-items: center; border: 1px solid #17324a; margin-left: 4px; }

/* ------------------------------------------------------------------ 菜单栏 */
.menubar {
  display: flex; align-items: stretch; gap: 0; padding: 0 4px;
  background: #f4f7fa; border-bottom: 1px solid var(--line); position: relative; z-index: 60;
}
.menu { position: relative; display: flex; align-items: stretch; }
.menu > button { padding: 0 10px; color: #26323e; border-radius: 3px; margin: 2px 0; font-size: 12px; white-space: nowrap; }
.menu > button:hover, .menu.open > button { background: #dfeaf5; }
.menu-popup {
  position: absolute; top: 23px; left: 0; min-width: 260px; max-height: calc(100vh - 100px); overflow-y: auto;
  padding: 5px; background: #fff; border: 1px solid #aeb9c6; border-radius: 4px; box-shadow: 0 10px 28px rgba(20, 32, 45, .24);
  z-index: 900; display: none;
}
.menu.open .menu-popup { display: block; }
.menu-item { display: flex; align-items: center; gap: 9px; width: 100%; padding: 6px 10px; border-radius: 3px; color: var(--ink); text-align: left; white-space: nowrap; }
.menu-item:hover:not(:disabled) { background: #cfe4f7; }
.menu-item:disabled { color: #9aa5b1; }
.menu-item .mi-icon { width: 16px; display: flex; justify-content: center; color: #4f6f8e; }
.menu-item .mi-label { flex: 1; }
.menu-item .mi-key { font: 10px var(--mono); color: #8492a0; padding-left: 20px; }
.menu-sep { height: 1px; background: var(--line-2); margin: 4px 6px; }
.menu-caption { font-size: 10px; color: var(--ink-3); padding: 4px 10px 2px; letter-spacing: .3px; }
.menu-item .sub-arrow { color: #7b8894; font-size: 11px; }
.menubar .menu-right { margin-left: auto; display: flex; align-items: center; gap: 8px; padding: 0 6px; color: var(--ink-3); font-size: 10.5px; }
.menubar .menu-right b { color: var(--ink-2); font-weight: 600; }
.menu-badge { display: inline-flex; align-items: center; gap: 4px; padding: 1px 6px; border: 1px solid #d5dde6; border-radius: 999px; background: #fbfcfd; font-size: 9.5px; }
.menu-badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: #36a05c; }

/* ------------------------------------------------------------------ CommandManager */
.commandmanager { display: flex; flex-direction: column; background: #f5f8fb; border-bottom: 1px solid #aeb9c6; position: relative; z-index: 50; }
.cm-tabs { height: 28px; flex: none; display: flex; align-items: flex-end; gap: 1px; padding: 3px 8px 0; background: #e8edf3; border-bottom: 1px solid #b9c4d0; overflow: hidden; }
.cm-tab { height: 25px; padding: 0 15px; border: 1px solid transparent; border-bottom: 0; border-radius: 3px 3px 0 0; color: #40505f; font-size: 11.5px; white-space: nowrap; }
.cm-tab:hover { background: #f1f6fb; color: var(--accent); }
.cm-tab.active { background: #f8fafc; border-color: #b9c4d0; color: var(--accent); font-weight: 600; position: relative; top: 1px; }
.cm-tab.active::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: -1px; height: 2px; background: #f8fafc; }
.cm-tabs .cm-tabs-right { margin-left: auto; display: flex; align-items: center; gap: 4px; height: 25px; padding: 0 3px; color: #596878; }
.cm-tabs-right button { width: 22px; height: 20px; border-radius: 3px; display: grid; place-items: center; }
.cm-tabs-right button:hover { background: #dce8f4; }
.ribbon { height: 87px; flex: none; display: flex; align-items: stretch; gap: 0; padding: 3px 5px 2px; background: linear-gradient(180deg, #fbfcfd, #f1f5f9); overflow: hidden; }
.ribbon-group { display: flex; flex-direction: column; height: 100%; padding: 0 5px; position: relative; }
.ribbon-group + .ribbon-group { border-left: 1px solid #d5dce5; }
.rg-body { display: flex; align-items: flex-start; gap: 1px; flex: 1; min-height: 0; flex-wrap: wrap; align-content: flex-start; }
.rg-title { flex: none; text-align: center; font-size: 9.5px; line-height: 14px; color: #7f8c99; letter-spacing: .2px; border-top: 1px solid #e0e5eb; padding-top: 1px; margin-top: 1px; white-space: nowrap; }
.cmd-btn { min-width: 56px; max-width: 78px; height: 69px; padding: 2px 4px 1px; border: 1px solid transparent; border-radius: 3px; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 1px; color: #26323e; position: relative; }
.cmd-btn:hover:not(:disabled) { background: #dceaf7; border-color: #a9c6e2; }
.cmd-btn:active:not(:disabled) { background: #c8dff3; }
.cmd-btn.active { background: #c7def3; border-color: #7fa9d2; }
.cmd-btn:disabled { opacity: .42; filter: saturate(.55); }
.cmd-btn .cmd-icon { width: 32px; height: 32px; margin-top: 1px; }
.cmd-btn .cmd-label { font-size: 10px; line-height: 1.12; text-align: center; max-height: 24px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.cmd-btn .cmd-arrow { position: absolute; right: 1px; bottom: 2px; font-size: 8px; color: #6d7b88; }
.cmd-btn.small { min-width: 38px; width: 38px; height: 34px; padding: 1px; }
.cmd-btn.small .cmd-icon { width: 24px; height: 24px; }
.cmd-btn.small .cmd-label { display: none; }
.cmd-btn.wide { min-width: 82px; }
.cmd-btn.hero { min-width: 76px; }
.cmd-btn.hero .cmd-icon { width: 38px; height: 38px; }
.cmd-btn.hero .cmd-label { font-size: 10.5px; font-weight: 600; }
.rg-body .stack { display: flex; flex-direction: column; gap: 1px; padding-top: 1px; }
.rg-body .stack .cmd-btn.small { height: 33px; }
.ribbon-scroll { display: flex; overflow-x: auto; overflow-y: hidden; height: 100%; }
.ribbon-scroll::-webkit-scrollbar { height: 4px; }

/* ------------------------------------------------------------------ 工作区 */
.workspace { display: grid; grid-template-columns: var(--left-w) minmax(360px, 1fr) var(--right-w); min-height: 0; overflow: hidden; background: #ced7e1; }
.left-panel { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: #f8fafc; border-right: 1px solid #aeb9c6; position: relative; z-index: 20; }
.fm-tabs { height: 30px; flex: none; display: flex; align-items: stretch; padding: 2px 4px 0; background: #e8edf3; border-bottom: 1px solid #bcc6d1; gap: 1px; overflow: hidden; }
.fm-tab { width: 30px; height: 27px; display: grid; place-items: center; border: 1px solid transparent; border-bottom: 0; border-radius: 3px 3px 0 0; color: #566575; position: relative; }
.fm-tab:hover { background: #f2f7fc; color: var(--accent); }
.fm-tab.active { background: #f8fafc; border-color: #bcc6d1; color: var(--accent); top: 1px; }
.fm-tab .icon { width: 15px; height: 15px; }
.fm-tab.overflow { margin-left: auto; }
.fm-tabs .fm-tab-label { width: auto; padding: 0 8px; font-size: 10.5px; display: flex; align-items: center; gap: 4px; }
.fm-head { height: 31px; flex: none; display: flex; align-items: center; gap: 5px; padding: 0 7px; border-bottom: 1px solid #d5dce5; background: #f4f7fa; }
.fm-head .part-icon { width: 17px; height: 17px; }
.fm-head .fm-title { font-weight: 600; font-size: 12px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fm-head .fm-sub { color: var(--ink-3); font-size: 10px; }
.fm-head button { width: 23px; height: 23px; border-radius: 3px; display: grid; place-items: center; color: #617181; }
.fm-head button:hover { background: #dceae8; color: var(--accent); }
.fm-search { flex: none; padding: 4px 6px; border-bottom: 1px solid #e2e7ed; background: #fbfcfd; display: none; }
.fm-search.on { display: flex; gap: 4px; align-items: center; }
.fm-search input { flex: 1; height: 22px; border: 1px solid #c9d1db; border-radius: 3px; padding: 0 6px; outline: none; font-size: 11px; background: #fff; }
.fm-body { flex: 1; min-height: 0; overflow: auto; background: #f8fafc; }
.tree { padding: 3px 0 16px; min-height: 100%; }
.tree-row { height: 23px; display: flex; align-items: center; gap: 3px; padding: 0 5px 0 4px; margin: 0 2px; border-radius: 3px; white-space: nowrap; position: relative; color: #26323e; }
.tree-row:hover { background: #e9f2fb; }
.tree-row.selected { background: #cfe4f8; color: #103c66; }
.tree-row.selected::before { content: ""; position: absolute; left: 0; top: 3px; bottom: 3px; width: 2px; background: var(--accent-2); }
.tree-row.dim { color: #8b97a4; }
.tree-row .twisty { width: 12px; height: 18px; display: grid; place-items: center; color: #687888; flex: none; }
.tree-row .twisty .icon { width: 11px; height: 11px; }
.tree-row .tree-icon { width: 16px; height: 16px; display: grid; place-items: center; color: #5c7893; flex: none; }
.tree-row .tree-icon .icon { width: 15px; height: 15px; }
.tree-row .tree-label { overflow: hidden; text-overflow: ellipsis; flex: 1; font-size: 11.5px; }
.tree-row .tree-suffix { color: #8b97a4; font-size: 10px; margin-left: 3px; }
.tree-row .tree-eye { width: 18px; height: 18px; display: none; place-items: center; color: #6d7d8d; }
.tree-row:hover .tree-eye { display: grid; }
.tree-row .tree-eye:hover { background: #c9def2; border-radius: 3px; }
.tree-row .tree-eye .icon { width: 13px; height: 13px; }
.tree-row .health-dot { width: 6px; height: 6px; border-radius: 50%; background: #d0d8e0; margin-right: 1px; }
.tree-row .health-dot.ok { background: #3ba263; }
.tree-row .health-dot.warn { background: #d18a18; }
.tree-row .health-dot.bad { background: #c1392b; }
.tree-row .name-edit { flex: 1; height: 19px; border: 1px solid #6fa4d4; border-radius: 2px; padding: 0 4px; font-size: 11.5px; }
.tree-row .badge { font-size: 9px; color: #5d6b78; border: 1px solid #d2d9e1; border-radius: 8px; padding: 0 5px; background: #fff; }
.tree-sep { height: 1px; background: #dfe5eb; margin: 4px 8px; }
.tree-group-row { font-size: 10px; color: #8a96a3; padding: 6px 10px 2px 24px; letter-spacing: .3px; }
.tree-empty { padding: 18px 14px; color: #8b97a4; font-size: 11px; line-height: 1.6; }
.rollback-bar { flex: none; height: 21px; display: flex; align-items: center; gap: 6px; padding: 0 8px; background: #edf2f7; border-top: 1px solid #cbd4de; font-size: 10px; color: #6e7c8b; }
.rollback-bar .bar { flex: 1; height: 6px; border-radius: 3px; background: #dbe2ea; position: relative; }
.rollback-bar .bar i { position: absolute; top: -2px; right: 0; width: 10px; height: 10px; border-radius: 50%; background: #7c8a99; border: 1px solid #5f6d7c; }
.left-foot { flex: none; height: 24px; display: flex; align-items: center; padding: 0 8px; border-top: 1px solid #cbd4de; background: #eef3f8; color: #6e7c8b; font-size: 10px; }
.left-foot .spacer { flex: 1; }

/* PropertyManager */
.pm { display: flex; flex-direction: column; height: 100%; min-height: 0; background: #f8fafc; }
.pm-head { flex: none; display: flex; align-items: center; gap: 7px; padding: 6px 7px; background: linear-gradient(180deg, #f8fbfe, #e9f1f9); border-bottom: 1px solid #b9c6d4; }
.pm-head .pm-feature-icon { width: 25px; height: 25px; }
.pm-head .pm-title { flex: 1; min-width: 0; }
.pm-head .pm-title b { display: block; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pm-head .pm-title span { display: block; color: #6b7b8b; font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pm-head .pm-actions { display: flex; gap: 2px; }
.pm-head button { width: 24px; height: 24px; border-radius: 3px; display: grid; place-items: center; color: #356b48; }
.pm-head button:hover { background: #d9ecdF; }
.pm-head button.cancel { color: #9b3434; }
.pm-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 6px; }
.pm-message { background: #e8f1fb; border: 1px solid #c7dcf0; border-left: 3px solid #4a86bd; border-radius: 3px; padding: 7px 9px; color: #244b70; font-size: 10.8px; line-height: 1.5; margin-bottom: 7px; }
.pm-message.warn { background: #fff6e6; border-color: #ecd6a8; border-left-color: #c98a1b; color: #6f4a08; }
.pm-message.bad { background: #fff0ef; border-color: #f0cbc8; border-left-color: #bd3f34; color: #7a211b; }
.pm-group { border: 1px solid #cfd8e2; border-radius: 3px; margin-bottom: 7px; background: #fff; }
.pm-group-head { min-height: 25px; display: flex; align-items: center; gap: 5px; padding: 3px 7px; background: linear-gradient(180deg, #f6f9fc, #edf2f7); border-bottom: 1px solid #d9e0e8; color: #354758; font-size: 11px; font-weight: 600; cursor: pointer; }
.pm-group-head .icon { width: 12px; height: 12px; color: #6c7d8e; }
.pm-group-head .spacer { flex: 1; }
.pm-group-body { padding: 7px; }
.pm-group.collapsed .pm-group-body { display: none; }
.pm-row { display: flex; align-items: center; gap: 7px; margin: 5px 0; }
.pm-row > label, .pm-row .pm-label { width: 88px; flex: none; color: #4f5f6f; font-size: 10.8px; line-height: 1.25; }
.pm-row .pm-control { flex: 1; display: flex; align-items: center; gap: 4px; min-width: 0; }
.pm-input, .pm-select { height: 24px; border: 1px solid #bfc9d4; border-radius: 3px; background: #fff; padding: 0 6px; font-size: 11.5px; color: #1f2b37; min-width: 0; }
.pm-input { width: 100%; }
.pm-input:focus, .pm-select:focus { outline: none; border-color: #5d96c8; box-shadow: 0 0 0 2px rgba(70, 138, 199, .13); }
.pm-input.num { width: 82px; text-align: right; font-family: var(--mono); }
.pm-unit { color: #6f7d8b; font-size: 10px; width: 30px; }
.pm-select { width: 100%; }
.pm-check { display: inline-flex; align-items: center; gap: 5px; color: #3d4c5c; font-size: 10.8px; }
.pm-check input { width: 13px; height: 13px; accent-color: var(--accent); }
.pm-radio-row { display: flex; gap: 9px; flex-wrap: wrap; }
.pm-radio { display: inline-flex; align-items: center; gap: 4px; font-size: 10.8px; }
.pm-radio input { accent-color: var(--accent); }
.pm-selection { min-height: 42px; border: 1px dashed #a9bacb; border-radius: 3px; background: #fbfdff; padding: 4px; display: flex; flex-wrap: wrap; gap: 3px; align-content: flex-start; }
.pm-chip { display: inline-flex; align-items: center; gap: 3px; padding: 2px 5px; border: 1px solid #b9d3ea; background: #e9f3fc; border-radius: 3px; color: #28557d; font-size: 10px; max-width: 100%; }
.pm-chip b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.pm-chip button { color: #547a9b; width: 12px; height: 12px; display: grid; place-items: center; }
.pm-empty { color: #93a0ad; font-size: 10.5px; font-style: italic; }
.pm-preview-note { color: #6f7e8c; font-size: 10px; padding-top: 4px; }
.pm-result { margin: 6px 0; border: 1px solid #cdd7e2; background: #f8fbfd; border-radius: 3px; padding: 7px; font-size: 10.8px; }
.pm-result .k { color: #6d7b8a; }
.pm-result .v { float: right; color: #233443; font-family: var(--mono); font-weight: 600; }
.pm-footer { flex: none; padding: 6px; border-top: 1px solid #cbd4de; background: #eef3f8; display: flex; gap: 6px; align-items: center; }
.btn { height: 27px; padding: 0 12px; border: 1px solid #aebac7; border-radius: 3px; background: linear-gradient(#fff, #eef2f6); color: #263442; font-size: 11.5px; display: inline-flex; align-items: center; justify-content: center; gap: 5px; }
.btn:hover { border-color: #7e9db9; background: #f2f8fe; }
.btn.primary { background: linear-gradient(#3f83bd, #285f91); border-color: #1f4f78; color: #fff; font-weight: 600; }
.btn.primary:hover { background: linear-gradient(#4a91cd, #2d6da3); }
.btn.danger { color: #9a271f; border-color: #d3a6a2; background: #fff7f6; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn:disabled { opacity: .45; }
.pm-footer .spacer { flex: 1; }

/* ------------------------------------------------------------------ 图形区 */
.viewport-shell { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: #d8e5f2; }
.doc-tabs { flex: none; height: 28px; display: flex; align-items: flex-end; gap: 1px; padding: 0 6px; background: #dfe7ef; border-bottom: 1px solid #aebbc8; overflow: hidden; }
.doc-tab { height: 24px; display: flex; align-items: center; gap: 5px; padding: 0 10px; border: 1px solid transparent; border-bottom: 0; border-radius: 3px 3px 0 0; color: #4e5f70; font-size: 11px; white-space: nowrap; }
.doc-tab:hover { background: #edf4fa; }
.doc-tab.active { background: #f6fafe; border-color: #adbac7; color: #1d3f5f; font-weight: 600; }
.doc-tab .icon { width: 13px; height: 13px; }
.doc-tab.close { margin-left: auto; width: 22px; padding: 0; justify-content: center; border: 0; }
.doc-tab.close:hover { background: #cfdde9; }
.viewport { position: relative; flex: 1; min-height: 0; overflow: hidden; background: radial-gradient(120% 100% at 50% 12%, #c9ddf0 0%, #c1d7eb 28%, #d9e7f4 68%, #f5f9fd 100%); outline: none; }
.viewport::after { content: ""; position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 72px rgba(87, 114, 143, .13); }
#viewport-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.sketch-overlay { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: hidden; z-index: 5; }
.grid-overlay { position: absolute; inset: 0; pointer-events: none; z-index: 2; opacity: .5; }
.heads-up {
  position: absolute; top: 8px; left: 50%; transform: translateX(-50%); z-index: 18;
  height: 33px; display: flex; align-items: center; gap: 1px; padding: 2px 7px;
  background: rgba(255, 255, 255, .91); border: 1px solid rgba(136, 158, 181, .7); border-radius: 6px;
  box-shadow: 0 2px 8px rgba(36, 57, 78, .15); backdrop-filter: blur(8px);
}
.heads-up button { width: 27px; height: 25px; border-radius: 3px; display: grid; place-items: center; color: #40566b; position: relative; }
.heads-up button:hover { background: #d9e9f7; color: #1b4f7d; }
.heads-up button.active { background: #c8dff3; color: #164a76; }
.heads-up .hu-sep { width: 1px; height: 18px; background: #d5dee7; margin: 0 3px; }
.heads-up .icon { width: 16px; height: 16px; }
.viewcube { position: absolute; top: 13px; right: 13px; width: 82px; height: 82px; z-index: 16; cursor: pointer; filter: drop-shadow(0 2px 4px rgba(20, 40, 60, .16)); }
.viewcube svg { width: 100%; height: 100%; display: block; }
.viewcube .vc-compass { position: absolute; inset: -7px; border: 1px solid rgba(91, 118, 145, .3); border-radius: 50%; pointer-events: none; }
.viewcube .vc-n { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); font: 8px var(--font); color: #4e6276; letter-spacing: 1px; }
.viewcube .vc-face { cursor: pointer; transition: filter .12s; }
.viewcube .vc-face:hover { filter: brightness(1.1); }
.nav-tools { position: absolute; right: 13px; bottom: 12px; z-index: 15; display: flex; gap: 3px; padding: 3px; background: rgba(255, 255, 255, .82); border: 1px solid rgba(136, 158, 181, .65); border-radius: 5px; box-shadow: 0 1px 4px rgba(20, 40, 60, .12); }
.nav-tools button { width: 25px; height: 25px; border-radius: 3px; display: grid; place-items: center; color: #496073; }
.nav-tools button:hover { background: #dceaf7; }
.nav-tools .icon { width: 15px; height: 15px; }
.triad { position: absolute; left: 12px; bottom: 11px; width: 92px; height: 92px; z-index: 14; pointer-events: none; opacity: .95; }
.triad svg { width: 100%; height: 100%; overflow: visible; }
.viewport-hud { position: absolute; left: 13px; top: 10px; z-index: 13; display: flex; align-items: center; gap: 6px; padding: 3px 7px; border-radius: 4px; background: rgba(255, 255, 255, .58); color: #4e6275; font-size: 10.5px; pointer-events: none; }
.viewport-hud b { color: #263c50; font-weight: 600; }
.selection-tip { position: absolute; z-index: 30; min-width: 130px; max-width: 270px; padding: 6px 9px; background: #2a3c4e; color: #eaf2f8; border-radius: 4px; box-shadow: 0 5px 18px rgba(8, 24, 40, .28); font-size: 10.5px; pointer-events: none; line-height: 1.5; }
.selection-tip b { color: #fff; }
.sketch-toolbar { position: absolute; left: 11px; top: 51px; z-index: 21; width: 36px; padding: 3px; display: flex; flex-direction: column; gap: 2px; background: rgba(255, 255, 255, .94); border: 1px solid #9fb1c3; border-radius: 5px; box-shadow: 0 3px 12px rgba(20, 40, 60, .22); }
.sketch-toolbar button { width: 30px; height: 30px; border-radius: 3px; display: grid; place-items: center; color: #3f5a72; }
.sketch-toolbar button:hover { background: #d9eaf8; }
.sketch-toolbar button.active { background: #c5ddf2; border: 1px solid #7fa9d0; }
.sketch-toolbar .sep { height: 1px; background: #d4dde6; margin: 2px 3px; }
.context-menu { position: absolute; z-index: 80; min-width: 190px; padding: 4px; background: #fff; border: 1px solid #aeb9c6; border-radius: 4px; box-shadow: 0 8px 26px rgba(20, 32, 45, .26); }
.context-menu button { width: 100%; text-align: left; padding: 5px 8px; border-radius: 3px; display: flex; align-items: center; gap: 7px; font-size: 11px; }
.context-menu button:hover:not(:disabled) { background: #d4e7f8; }
.context-menu button:disabled { color: #9aa5b1; }
.context-menu .ctx-sep { height: 1px; background: #e0e6ec; margin: 3px 4px; }
.crosshair { position: absolute; inset: 0; z-index: 6; pointer-events: none; }
.crosshair::before { content: ""; position: absolute; left: var(--cx, 50%); top: 0; bottom: 0; width: 1px; background: rgba(41, 78, 112, .18); }
.crosshair::after { content: ""; position: absolute; top: var(--cy, 50%); left: 0; right: 0; height: 1px; background: rgba(41, 78, 112, .18); }
.measure-overlay { position: absolute; z-index: 22; bottom: 42px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 8px; padding: 6px 10px; background: rgba(28, 45, 62, .91); color: #fff; border-radius: 4px; font-size: 11px; box-shadow: var(--shadow); }
.measure-overlay b { font-family: var(--mono); color: #9dd0ff; }
.empty-hint { position: absolute; inset: 0; z-index: 4; display: grid; place-items: center; pointer-events: none; }
.empty-hint .card { text-align: center; color: #4f6d89; background: rgba(255, 255, 255, .45); border: 1px dashed rgba(73, 111, 147, .5); padding: 22px 28px; border-radius: 8px; }
.empty-hint .card b { display: block; font-size: 14px; color: #284e70; margin-bottom: 4px; }

/* ------------------------------------------------------------------ 任务窗格 */
.taskpane { display: flex; min-width: 0; min-height: 0; background: #f7f9fb; border-left: 1px solid #aeb9c6; }
.tp-rail { width: 30px; flex: none; background: #e6ebf1; border-right: 1px solid #c6cfd9; display: flex; flex-direction: column; align-items: stretch; padding-top: 3px; gap: 1px; }
.tp-tab { height: 82px; display: flex; flex-direction: column; align-items: center; gap: 4px; color: #667888; border-left: 2px solid transparent; padding-top: 7px; }
.tp-tab .icon { width: 15px; height: 15px; }
.tp-tab span { writing-mode: vertical-rl; text-orientation: mixed; font-size: 9.5px; letter-spacing: .5px; }
.tp-tab:hover { background: #dce9f5; color: var(--accent); }
.tp-tab.active { background: #f7f9fb; color: var(--accent); border-left-color: var(--accent-2); }
.tp-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.tp-head { flex: none; height: 32px; display: flex; align-items: center; gap: 6px; padding: 0 8px; border-bottom: 1px solid #d8e0e8; background: #f1f5f9; }
.tp-head b { font-size: 11.5px; color: #2b3b4b; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tp-head button { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 3px; color: #5b6d7e; }
.tp-head button:hover { background: #dce8f4; }
.tp-content { flex: 1; min-height: 0; overflow: auto; padding: 7px; background: #f7f9fb; }
.tp-search { display: flex; align-items: center; gap: 5px; height: 23px; padding: 0 6px; border: 1px solid #c4ced9; border-radius: 3px; background: #fff; margin-bottom: 7px; color: var(--ink-3); }
.tp-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 10.5px; }
.tp-section { margin-bottom: 8px; border: 1px solid #d3dbe4; border-radius: 3px; background: #fff; overflow: hidden; }
.tp-section > .tp-sec-head { height: 25px; display: flex; align-items: center; gap: 5px; padding: 0 7px; background: #f1f5f9; border-bottom: 1px solid #dfe5eb; font-weight: 600; color: #3b4b5a; font-size: 10.5px; }
.tp-section > .tp-sec-head .icon { width: 12px; height: 12px; color: #6b7b8b; }
.tp-section > .tp-sec-body { padding: 5px; }
.tp-item { display: flex; align-items: center; gap: 6px; padding: 4px 5px; border-radius: 3px; font-size: 10.8px; color: #354554; white-space: nowrap; }
.tp-item:hover { background: #e8f2fb; }
.tp-item .icon { width: 14px; height: 14px; color: #617c96; }
.tp-item .sub { color: #8b97a4; font-size: 9.5px; margin-left: auto; }
.tp-thumb-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
.tp-thumb { border: 1px solid #d2dae3; border-radius: 3px; background: #fff; padding: 4px; text-align: center; font-size: 9.5px; color: #546575; }
.tp-thumb .mat { height: 42px; border-radius: 2px; margin-bottom: 3px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.25); }
.tp-thumb:hover { border-color: #6b9cc6; background: #f3f9ff; }
.tp-muted { color: #8b97a4; font-size: 10px; line-height: 1.55; padding: 4px; }
.tp-kv { display: flex; justify-content: space-between; gap: 8px; font-size: 10.5px; padding: 3px 4px; color: #566777; }
.tp-kv b { color: #263847; font-weight: 600; font-family: var(--mono); font-size: 10px; }

/* ------------------------------------------------------------------ 状态栏 */
.statusbar { display: flex; align-items: center; min-width: 0; background: linear-gradient(180deg, #eef2f7, #e4eaf1); border-top: 1px solid #b9c4d0; color: #4d5d6d; font-size: 10.5px; padding: 0 7px; gap: 0; overflow: hidden; }
.status-cell { height: 100%; display: flex; align-items: center; gap: 5px; padding: 0 9px; border-right: 1px solid #d1d9e2; white-space: nowrap; }
.status-cell:first-child { padding-left: 4px; }
.status-cell .dot { width: 7px; height: 7px; border-radius: 50%; background: #36a05c; box-shadow: 0 0 0 2px rgba(54,160,92,.13); }
.status-cell .dot.warn { background: #d18a18; box-shadow: 0 0 0 2px rgba(209,138,24,.13); }
.status-cell .dot.bad { background: #c1392b; box-shadow: 0 0 0 2px rgba(193,57,43,.13); }
.status-cell b { font-weight: 600; color: #273849; }
.status-cell .coord { font-family: var(--mono); font-size: 9.5px; color: #3d5165; }
.status-cell.right { margin-left: auto; border-right: 0; border-left: 1px solid #d1d9e2; }
.status-cell.soft { color: #71808f; }
.statusbar .spacer { flex: 1; }

/* ------------------------------------------------------------------ 模态框 / 提示 */
.modal-root { position: fixed; inset: 0; z-index: 1000; pointer-events: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(18, 29, 40, .42); display: grid; place-items: center; pointer-events: auto; padding: 20px; }
.dialog { width: min(560px, 94vw); max-height: 88vh; overflow: hidden; display: flex; flex-direction: column; background: #f9fbfd; border: 1px solid #8fa2b5; border-radius: 6px; box-shadow: 0 24px 70px rgba(8, 18, 30, .38); }
.dialog.wide { width: min(760px, 94vw); }
.dialog.narrow { width: min(420px, 94vw); }
.dialog-head { flex: none; height: 37px; display: flex; align-items: center; gap: 7px; padding: 0 10px; background: linear-gradient(180deg, #f7fafd, #e9eff6); border-bottom: 1px solid #c5cfda; }
.dialog-head .icon { width: 16px; height: 16px; color: #3e5d7a; }
.dialog-head b { font-size: 12px; flex: 1; }
.dialog-head .dlg-x { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 3px; color: #5e6f7f; }
.dialog-head .dlg-x:hover { background: #e3d9d9; color: #9a2b24; }
.dialog-body { flex: 1; min-height: 0; overflow: auto; padding: 12px 14px; font-size: 11.5px; color: #2b3a49; }
.dialog-foot { flex: none; display: flex; align-items: center; justify-content: flex-end; gap: 7px; padding: 8px 12px; border-top: 1px solid #d0d8e2; background: #eef3f8; }
.dialog-foot .spacer { flex: 1; }
.form-grid { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 8px 10px; align-items: center; }
.form-grid label { color: #526273; text-align: right; }
.form-grid .wide { grid-column: 2 / 3; }
.form-note { color: #8b97a4; font-size: 10px; line-height: 1.55; }
.dialog-section { margin: 11px 0 8px; padding-bottom: 5px; border-bottom: 1px solid #d9e0e8; font-size: 10px; letter-spacing: .4px; color: #7b8895; text-transform: uppercase; }
.doc-list { border: 1px solid #c9d3de; border-radius: 3px; max-height: 280px; overflow: auto; background: #fff; }
.doc-row { display: flex; align-items: center; gap: 7px; padding: 6px 8px; border-bottom: 1px solid #e7ecf1; font-size: 10.8px; }
.doc-row:last-child { border-bottom: 0; }
.doc-row:hover { background: #eaf3fc; }
.doc-row .doc-meta { margin-left: auto; color: #8b97a4; font-size: 9.5px; white-space: nowrap; }
.doc-row .icon { color: #50708e; }
.shortcut-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px 18px; }
.shortcut { display: flex; align-items: center; justify-content: space-between; gap: 8px; border-bottom: 1px dotted #dbe2e9; padding: 4px 0; font-size: 10.8px; }
.shortcut kbd { font: 10px var(--mono); background: #eef2f6; border: 1px solid #ccd5df; border-bottom-width: 2px; border-radius: 3px; padding: 1px 5px; color: #3d4d5c; }
.toast { position: fixed; left: 50%; bottom: 42px; transform: translate(-50%, 20px); z-index: 1200; min-width: 220px; max-width: min(620px, 86vw); padding: 8px 14px; border-radius: 4px; background: rgba(30, 44, 58, .94); color: #f1f6fa; font-size: 11.5px; box-shadow: 0 8px 28px rgba(8, 18, 30, .28); opacity: 0; pointer-events: none; transition: opacity .18s, transform .18s; text-align: center; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.toast.bad { background: rgba(143, 38, 31, .96); }
.toast.ok { background: rgba(28, 103, 58, .96); }
.noscript { position: fixed; inset: 0; display: grid; place-items: center; background: #eef3f8; color: #233; font: 16px var(--font); z-index: 2000; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: pre; border: 0; }

/* ------------------------------------------------------------------ 启动层 */
.boot { position: fixed; inset: 0; z-index: 3000; display: grid; place-items: center; background: radial-gradient(120% 100% at 50% 0%, #f5f9fd, #dfe9f3 55%, #cbd9e7); transition: opacity .28s ease; }
.boot.hide { opacity: 0; pointer-events: none; }
.boot-card { width: min(430px, 86vw); padding: 30px 34px; border-radius: 10px; background: rgba(255, 255, 255, .78); border: 1px solid rgba(128, 151, 174, .45); box-shadow: 0 24px 70px rgba(33, 55, 77, .2); text-align: center; backdrop-filter: blur(8px); }
.boot-brand { display: flex; align-items: center; justify-content: center; gap: 13px; text-align: left; }
.boot-word { font-size: 22px; font-weight: 800; letter-spacing: 1.5px; color: #2a3540; line-height: 1.1; }
.boot-word span { color: var(--sw-red); margin-left: 4px; }
.boot-sub { color: #71808f; font-size: 11px; margin-top: 4px; letter-spacing: .3px; }
.boot-status { margin: 24px 0 8px; color: #5f7080; font-size: 10.5px; }
.boot-bar { height: 4px; border-radius: 2px; background: #ccd8e4; overflow: hidden; }
.boot-bar i { display: block; height: 100%; width: 36%; background: linear-gradient(90deg, #b5121b, #e5363f); border-radius: 2px; animation: boot 1.2s ease-in-out infinite; }
@keyframes boot { 0% { transform: translateX(-110%); } 100% { transform: translateX(330%); } }
.boot-foot { margin-top: 18px; color: #8b97a4; font-size: 9.5px; }

/* ------------------------------------------------------------------ 草图 SVG */
.sk-line { stroke: #1d5c94; stroke-width: 1.5; fill: none; vector-effect: non-scaling-stroke; }
.sk-line.construction { stroke: #74879a; stroke-dasharray: 5 4; stroke-width: 1.2; }
.sk-line.selected { stroke: #0d7fd0; stroke-width: 2.4; }
.sk-line.preview { stroke: #248bd6; stroke-width: 1.2; stroke-dasharray: 4 3; opacity: .8; }
.sk-point { fill: #1d5c94; stroke: #fff; stroke-width: 1.1; }
.sk-point.origin { fill: #d13b32; }
.sk-dim { stroke: #b36b12; stroke-width: .9; fill: none; vector-effect: non-scaling-stroke; }
.sk-dim-ext { stroke: #c98b3a; stroke-width: .8; stroke-dasharray: 2 2; }
.sk-dim-text { fill: #8e590d; font: 10px var(--font); paint-order: stroke; stroke: #f4f8fc; stroke-width: 3px; stroke-linejoin: round; }
.sk-constraint { fill: #fff; stroke: #3e7e37; stroke-width: 1; }
.sk-constraint-text { fill: #3e7e37; font: 9px var(--mono); }
.sk-origin { stroke: #b22a22; stroke-width: 1.3; }
.sk-grid-line { stroke: #9fb4c8; stroke-width: .5; opacity: .38; }
.sk-plane-label { fill: #416480; font: 10px var(--font); }

/* ------------------------------------------------------------------ 公用小件 */
.tooltip { position: fixed; z-index: 2000; max-width: 280px; padding: 4px 8px; border-radius: 3px; background: rgba(32, 44, 56, .95); color: #edf5fb; font-size: 10.5px; pointer-events: none; box-shadow: 0 3px 12px rgba(0,0,0,.2); }
.tooltip b { font-weight: 600; color: #fff; }
.kbd { font: 9.5px var(--mono); background: #f0f4f8; border: 1px solid #ccd5df; border-bottom-width: 2px; border-radius: 3px; padding: 0 4px; color: #48596a; }
.loading-dots::after { content: "…"; }
.badge-pill { display: inline-flex; align-items: center; gap: 4px; border-radius: 999px; padding: 1px 7px; font-size: 9px; background: #eaf2fa; color: #315d85; border: 1px solid #c8dcee; }

/* 右侧选中材质样例 */
.mat-steel { background: linear-gradient(135deg, #dfe5ea, #8e9ba8 48%, #c8d1d8); }
.mat-stainless { background: linear-gradient(135deg, #f4f7f9, #a7b2bc 50%, #d8dfe5); }
.mat-aluminum { background: linear-gradient(135deg, #f7f9fa, #bcc6cf 50%, #e2e7eb); }
.mat-brass { background: linear-gradient(135deg, #f6e8ba, #b98e3e 50%, #d9b86b); }
.mat-abs { background: linear-gradient(135deg, #eee, #b8bcc1 50%, #dedfe2); }

/* ------------------------------------------------------------------ 自适应 */
@media (max-width: 1440px) {
  :root { --left-w: 268px; --right-w: 254px; }
  .cmd-btn { min-width: 52px; max-width: 70px; }
}
@media (max-width: 1180px) {
  :root { --right-w: 0px; --left-w: 250px; }
  .taskpane { display: none; }
  .title-search { width: 180px; }
  .heads-up { transform: translateX(-50%) scale(.94); }
}
@media (max-width: 980px) {
  :root { --left-w: 224px; }
  .title-search, .unofficial-chip { display: none; }
  .brand .brand-sub { display: none; }
  .doc-tabs .doc-tab.close { display: none; }
}
@media (max-height: 760px) {
  :root { --ribbon-h: 108px; }
  .cmd-btn { height: 64px; }
  .cmd-btn .cmd-icon { width: 30px; height: 30px; }
}
@media print {
  .titlebar, .menubar, .commandmanager, .left-panel, .taskpane, .statusbar, .doc-tabs, .heads-up, .viewcube, .nav-tools, .triad, .sketch-toolbar, .toast, .modal-root, .boot { display: none !important; }
  #app { display: block; height: auto; }
  .workspace { display: block; }
  .viewport { height: 90vh; }
}