/* ANSYS Workbench 2022 R1 web clone — measured layout (Chinese UI).
 * Reference: /data/dev/ansys2202r1-work/shots/workbench-max.png
 *   PrintWindow 1936x1048 incl. 8px frame -> client 1920x1032 (client = abs - 8 on both axes).
 * Vertical bands (client px, measured):
 *   0..22     title bar #F3F3F3 ("未保存的项目 - Workbench", sys buttons)
 *   23..44    menu bar #F0F0F0 (文件 查看 工具 单位 扩展 任务 帮助)
 *   45..46    2px light separator
 *   47..68    toolbar row 1 (16px icons)
 *   69..97    toolbar row 2 (24px icon buttons + 「项目」tab)
 *   98..120   toolbar row 3 (导入 / 重新连接 / 刷新项目 / 更新项目 / ACT 开始页面)
 *   121..123  3px light separator
 *   124..142  dock title bars (19px: 工具箱 grey gradient, 项目原理图 blue gradient)
 *   143..1007 dock content (tree white / schematic white)
 *   1008..1031 status bar
 * Horizontal: left dock 0..249 | splitter 250..254 | right dock 255..1919
 */
:root {
  --wb-bg: #F0F0F0;
  --wb-menu-bg: #F0F0F0;
  --wb-dock-left: linear-gradient(90deg, #808080 0%, #D3D3D3 100%);
  --wb-dock-active: linear-gradient(90deg, #000080 0%, #ADD8E7 100%);
  --wb-line: #C8C8C8;
  --wb-line-strong: #A2A2A2;
  --wb-select: #CCE4F7;
  --wb-text: #000000;
  --wb-text-disabled: #969696;
  --wb-link: #1E51BC;
  --wb-font: "Microsoft YaHei", "Noto Sans CJK SC", "Noto Sans SC", "Rubik", "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; width: 100%; height: 100%; overflow: hidden; background: var(--wb-bg); }
body { font-family: var(--wb-font); font-size: 12px; color: var(--wb-text); user-select: none; -webkit-font-smoothing: antialiased; }
img { -webkit-user-drag: none; }
.win { position: relative; width: 100%; height: 100%; min-width: 1280px; display: flex; flex-direction: column; overflow: hidden; background: var(--wb-bg); }

/* ---------------- title bar ---------------- */
.titlebar { position: relative; flex: 0 0 23px; height: 23px; background: #F3F3F3; display: flex; align-items: center; padding-left: 2px; }
.titlebar .appicon { width: 17px; height: 17px; display: block; }
.titlebar .title { margin-left: 6px; font-size: 12px; color: #8F8F8F; white-space: nowrap; position: relative; top: -1px; }
.titlebar .sysbtns { position: absolute; right: 0; top: 0; height: 23px; display: flex; }
.titlebar .sysbtn { width: 46px; height: 23px; display: grid; place-items: center; color: #1B1B1B; font-size: 12px; line-height: 1; }
.titlebar .sysbtn:hover { background: #E5E5E5; }
.titlebar .sysbtn.close:hover { background: #E81123; color: #FFFFFF; }
.titlebar .sysbtn .g-min { width: 10px; height: 1px; background: currentColor; display: block; }
.titlebar .sysbtn .g-max { width: 9px; height: 9px; border: 1px solid currentColor; display: block; }
.titlebar .sysbtn .g-close { font-size: 13px; line-height: 1; }

/* ---------------- menu bar ---------------- */
.menubar { position: relative; flex: 0 0 22px; height: 22px; background: var(--wb-menu-bg); }
.menubar .m { position: absolute; top: 1px; height: 21px; line-height: 21px; padding: 0 0; font-size: 12px; color: #000; cursor: default; white-space: nowrap; }
.menubar .m:hover, .menubar .m.open { background: var(--wb-select); }
.menuline { flex: 0 0 2px; height: 2px; background: linear-gradient(to bottom, #F4F7FC 0 1px, #FFFFFF 1px 2px); }

/* ---------------- toolbar rows ---------------- */
.toolbar { position: relative; background: var(--wb-bg); }
.toolbar.small { flex: 0 0 22px; height: 22px; }
.toolbar.main { flex: 0 0 29px; height: 29px; border-bottom: 1px solid var(--wb-line-strong); }
.toolbar.commands { flex: 0 0 23px; height: 23px; }
.toolhandle { position: absolute; top: 4px; bottom: 4px; width: 1px;
  background: repeating-linear-gradient(to bottom, #B4B4B4 0 2px, transparent 2px 4px); }
.toolbar .tb-btn { position: absolute; display: flex; align-items: center; justify-content: center; cursor: default; }
.toolbar.small .tb-btn { top: 3px; height: 16px; }
.toolbar.small .tb-btn:hover { background: var(--wb-select); }
.toolbar.main .tb-btn { top: 4px; width: 24px; height: 24px; }
.toolbar.main .tb-btn:hover { background: var(--wb-select); }
.toolbar.main .tb-btn.disabled img, .toolbar.commands .cmd.disabled img { opacity: .45; }
.toolbar.main .tb-btn.disabled:hover { background: none; }
.tb-btn img { display: block; }

/* 「项目」 tab (Qt tab bar tab, white, sits on toolbar row 2 bottom line) */
.projecttab { position: absolute; left: 108px; top: 0; width: 78px; height: 29px; z-index: 3;
  background: #FDFDFD; border: 1px solid #A8A8A8; border-bottom: 1px solid #FDFDFD;
  border-radius: 6px 6px 0 0; display: flex; align-items: center; padding-left: 10px; cursor: default; }
.projecttab:hover { background: #FFFFFF; }
.projecttab img { display: block; width: 19px; height: 19px; }
.projecttab .lbl { margin-left: 7px; font-size: 13px; color: #000; line-height: 1; }

/* toolbar row 3 commands */
.toolbar.commands .cmd { position: absolute; top: 0; height: 23px; display: flex; align-items: center; cursor: default; white-space: nowrap; }
.toolbar.commands .cmd:hover { background: var(--wb-select); }
.toolbar.commands .cmd img { display: block; }
.toolbar.commands .cmd.disabled { color: var(--wb-text-disabled); }
.toolbar.commands .cmd.disabled:hover { background: none; }
.toolbar.commands .cmd .accent { color: #0A4FA8; }
.toolbar.commands .cmdsep { position: absolute; top: 3px; height: 17px; width: 1px; background: var(--wb-line); }
.toolbar.commands .cmd { padding-right: 6px; }

.toolbottom { flex: 0 0 3px; height: 3px; background: linear-gradient(to bottom, #F4F7FC 0 1px, #FFFFFF 1px 2px, #F0F0F0 2px 3px); }

/* ---------------- body / docks ---------------- */
.body { position: relative; flex: 1 1 auto; display: flex; min-height: 0; }
.leftdock { position: relative; flex: 0 0 250px; width: 250px; background: var(--wb-bg); min-height: 0; }
.splitter { flex: 0 0 5px; width: 5px; background: #F0F0F0; border-left: 1px solid #FFFFFF; border-right: 1px solid #707070; cursor: col-resize; }
.rightdock { position: relative; flex: 1 1 auto; display: flex; flex-direction: column; min-width: 0; min-height: 0; background: #FFFFFF; border-left: 1px solid #707070; margin-left: -1px; }

/* dock title bars */
.dockhead { position: relative; flex: 0 0 19px; height: 19px; border-top: 1px solid #707070; display: flex; align-items: center; padding-left: 5px; color: #FFFFFF; font-size: 12px; }
.dockhead.inactive { background: var(--wb-dock-left); }
.dockhead.active { background: var(--wb-dock-active); }
.dockhead .lbl { white-space: nowrap; position: relative; top: -1px; }
.dockhead .btns { margin-left: auto; display: flex; align-items: center; gap: 7px; padding-right: 6px; }
.dockhead .hbtn { width: 12px; height: 14px; display: grid; place-items: center; color: #000; cursor: default; }
.dockhead .hbtn svg { display: block; }
.dockhead .hbtn.arrow svg { fill: #1B1B1B; }
.dockhead .hbtn.pin svg, .dockhead .hbtn.x svg { fill: #000; }
.dockhead .hbtn:hover { background: rgba(255,255,255,.35); }

/* toolbox tree */
.treewrap { position: absolute; left: 3px; top: 20px; right: 5px; bottom: 29px; background: #FFFFFF; overflow: hidden; }
.treebox { position: absolute; inset: 0; overflow-y: auto; overflow-x: hidden; background: #FFFFFF; padding-top: 1px; }
.treebox::-webkit-scrollbar { width: 12px; }
.treebox::-webkit-scrollbar-track { background: #F0F0F0; }
.treebox::-webkit-scrollbar-thumb { background: linear-gradient(90deg, #FDFDFD, #C8C8C8); border: 1px solid #A8A8A8; }
.treebox .trow { position: relative; height: 18px; display: flex; align-items: center; padding-left: 8px; cursor: default; }
.treebox .trow .ico { width: 15px; height: 15px; display: block; flex: 0 0 15px; }
.treebox .trow .lbl { margin-left: 8px; font-size: 12px; line-height: 18px; color: #000; white-space: nowrap; }
.treebox .trow.sel { background: #0078D7; }
.treebox .trow.sel .lbl { color: #FFFFFF; }
.treebox .trow:hover { background: #E5F1FB; }
.treebox .trow.sel:hover { background: #0078D7; }
.treebox .theader { position: relative; margin: 0 1px 1px 1px; height: 22px; border: 1px solid #808080;
  background: linear-gradient(to bottom, #FAFAFA 0%, #D2D2D2 100%); display: flex; align-items: center; padding-left: 4px; cursor: default; }
.treebox .theader .ico { width: 15px; height: 15px; display: block; }
.treebox .theader .lbl { margin-left: 3px; font-size: 12px; font-weight: 700; color: #000; }
.treebox .theader .tw { position: absolute; left: 2px; top: 7px; width: 7px; height: 7px; display: none; }
.treebox .tgroup { margin: 0 1px 0 1px; height: 21px; border: 1px solid #808080;
  background: linear-gradient(to bottom, #FAFAFA 0%, #D2D2D2 100%); display: flex; align-items: center; padding-left: 6px; cursor: default; }
.treebox .tgroup + .tgroup { margin-top: 0; }
.treebox .tgroup .ico { width: 15px; height: 16px; display: block; }
.treebox .tgroup .lbl { margin-left: 7px; font-size: 12px; color: #000; }
.treebox .tgroup:hover { background: linear-gradient(to bottom, #FFFFFF 0%, #DDEBF7 100%); }

/* toolbox footer: funnel button + 查看所有/自定义...... */
.treefoot { position: absolute; left: 4px; right: 6px; bottom: 4px; height: 22px; border: 1px solid #646464; background: #F7F7F7; display: flex; }
.treefoot .filter { width: 42px; display: flex; align-items: center; justify-content: flex-start; padding-left: 7px; border-right: 1px solid #C0C0C0; cursor: default; }
.treefoot .filter:hover { background: #E5F1FB; }
.treefoot .all { flex: 1 1 auto; display: flex; align-items: center; justify-content: flex-end; padding-right: 10px; cursor: default; color: var(--wb-link); font-size: 12px; }
.treefoot .all:hover { background: #E5F1FB; }

/* schematic canvas */
.canvas { position: relative; flex: 1 1 auto; background: #FFFFFF; overflow: hidden; }

/* ---------------- status bar ---------------- */
.statusbar { position: relative; flex: 0 0 24px; height: 24px; background: var(--wb-bg); border-top: 1px solid #D7D7D7; }
.statusbar .ready { position: absolute; left: 6px; top: 0; height: 23px; display: flex; align-items: center; gap: 6px; font-size: 12px; color: #000; }
.statusbar .dot { width: 8px; height: 8px; border-radius: 50%; background: radial-gradient(circle at 35% 32%, #9DF09D 0%, #37B637 55%, #1B761B 100%); border: 1px solid #7FAE7F; }
.statusbar .widgets { position: absolute; right: 16px; top: 1px; height: 21px; display: flex; gap: 2px; }
.statusbar .wid { display: flex; align-items: center; gap: 4px; height: 21px; padding: 0 5px; background: #FDFDFD; border: 1px solid #D7D7D7; border-bottom-color: #BABABA; font-size: 12px; color: #000; cursor: default; white-space: nowrap; }
.statusbar .wid .link { color: var(--wb-link); }
.statusbar .wid:hover { background: #E5F1FB; }
.statusbar .wid img { display: block; height: 16px; width: auto; }
.statusbar .wid.msgs img { height: 20px; }
.statusbar .wid .icon-slot { height: 20px; display: flex; align-items: center; }

/* ---------------- Qt menu popup (overrides shared qt.css) ---------------- */
.qtmenu { position: fixed; z-index: 10000; background: #F0F0F0; border: 2px solid #F9F9F9; box-shadow: 2px 2px 4px rgba(0,0,0,.28); padding: 2px 0; min-width: 120px; font-family: var(--wb-font); font-size: 12px; }
.qtmenu .mi { position: relative; height: 22px; line-height: 22px; padding: 0 26px 0 10px; font-size: 12px; color: #000; white-space: nowrap; }
.qtmenu .mi:hover { background: var(--wb-select); }
.qtmenu .mi.disabled { color: #9A9A9A; }
.qtmenu .mi .icon { width: 16px; height: 16px; margin-right: 6px; vertical-align: middle; object-fit: contain; }
.qtmenu .mi .arrow { position: absolute; right: 8px; top: 0; line-height: 22px; font-size: 12px; color: #000; padding: 0; margin: 0; }
.qtmenu .mi .accel { position: absolute; right: 14px; top: 0; line-height: 22px; font-size: 12px; color: #000; }
.qtmenu .sep { height: 9px; border-top: 1px solid #D8DDE2; margin: 0 4px; }
#boot-error { position: fixed; left: 4px; bottom: 4px; z-index: 99999; background: #fff; color: #b00;
  font: 12px/1.4 monospace; padding: 4px 8px; border: 1px solid #b00; white-space: pre-wrap; max-width: 1400px; }
