/* FICS-AS 界面展示页 · 软件界面复刻（Zcode 式）
 * 逻辑基准 1920×1080，外层 transform:scale 自适应（ui-viewport）。
 * 还原度真相源：素材/架空案例界面截图.png。全部 CSS 复刻，不贴整图。 */

#ui-viewport {
  position: relative; flex: 1; min-height: 0; overflow: hidden;
  background: var(--fs-canvas, #fbf9f4); /* D2：弹窗内流式填充（demo-bar 下方） */
}
#ui-shell {
  position: absolute; left: 50%; top: 50%;
  width: 1920px; height: 1080px;
  transform-origin: center center;
  background: #f5f6f8;
  display: flex; flex-direction: column;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .45);
}

/* ── 标题栏 ── */
.ui-titlebar {
  flex: none; height: 40px;
  display: flex; align-items: center; gap: 10px; padding: 0 0 0 14px;
  background: #f5f6f8; border-bottom: 1px solid #e2e4e8;
  font-size: 13px; color: #3c4048;
}
.ui-titlebar .ui-appicon {
  width: 22px; height: 22px; border-radius: 5px; flex: none;
  background: linear-gradient(135deg, #2a78d6, #174a8f);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 13px;
}
.ui-titlebar .ui-title { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ui-titlebar .ui-winbtns { display: flex; height: 100%; flex: none; }
.ui-titlebar .ui-winbtns i {
  width: 46px; display: flex; align-items: center; justify-content: center;
  font-style: normal; font-size: 12px; color: #5a5f68; cursor: default;
}
.ui-titlebar .ui-winbtns i:hover { background: #e8eaee; }
.ui-titlebar .ui-winbtns i:last-child:hover { background: #d03b3b; color: #fff; }

/* ── 功能区页签 ── */
.ui-rtabs {
  flex: none; display: flex; align-items: stretch;
  padding: 6px 10px 0; background: #f5f6f8;
  border-bottom: 2px solid #2a78d6;
}
.ui-rtabs .rt {
  padding: 7px 16px 6px; font-size: 13.5px; color: #5a5f68;
  border: 1px solid transparent; border-bottom: none;
  border-radius: 7px 7px 0 0; cursor: pointer; user-select: none;
  white-space: nowrap;
}
.ui-rtabs .rt:hover { color: #2a78d6; background: #e9effa; }
.ui-rtabs .rt.act {
  background: #fff; color: #174a8f; font-weight: 700;
  border-color: #d8e2f0;
  box-shadow: 0 -2px 4px rgba(42, 120, 214, .10);
  position: relative;
}
.ui-rtabs .rt.act::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px;
  height: 3px; background: #2a78d6;
}

/* ── 功能区按钮区 ── */
.ui-ribbon {
  flex: none; height: 152px;
  display: flex; background: #fff;
  border-bottom: 1px solid #d8dce2;
}
.ui-ribbon-pages { flex: 1; min-width: 0; overflow-x: auto; overflow-y: hidden; }
.ui-page { display: none; height: 100%; padding: 10px 12px 6px; }
.ui-page.act { display: flex; align-items: stretch; gap: 0; }
.ui-group { display: flex; flex-direction: column; flex: none; padding: 0 10px; }
.ui-group + .ui-group { border-left: 1px solid #e6e9ee; }
.ui-group .g-btns { flex: 1; display: flex; align-items: center; gap: 2px; flex-wrap: wrap; }
.ui-group .g-name {
  flex: none; text-align: center; font-size: 11px; color: #8a9099;
  padding-top: 4px;
}
/* 大按钮（文件页/计算页） */
.ui-bbig {
  width: 88px; flex: none; display: flex; flex-direction: column; align-items: center; gap: 5px;
  border: none; background: none; cursor: pointer; padding: 4px 2px; border-radius: 7px;
  font: inherit;
}
.ui-bbig:hover { background: #eef4fc; }
.ui-bbig:active { background: #dbe8fa; }
.ui-bbig .ic {
  width: 46px; height: 46px; border-radius: 9px;
  background: #eef4fc; border: 1px solid #d8e2f0;
  display: flex; align-items: center; justify-content: center; font-size: 24px;
}
.ui-bbig .lb { font-size: 11.5px; color: #3c4048; line-height: 1.25; text-align: center; }
/* 小按钮 */
.ui-bsml {
  width: 62px; flex: none; display: flex; flex-direction: column; align-items: center; gap: 3px;
  border: none; background: none; cursor: pointer; padding: 3px 1px; border-radius: 6px;
  font: inherit;
}
.ui-bsml:hover { background: #eef4fc; }
.ui-bsml:active { background: #dbe8fa; }
.ui-bsml .ic {
  width: 28px; height: 28px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center; font-size: 16px;
  color: #2a78d6; background: #f4f7fb; border: 1px solid #e2e8f0;
}
.ui-bsml .lb { font-size: 10.5px; color: #3c4048; line-height: 1.2; text-align: center; }
/* 右侧标尺栏（比例尺快捷） */
.ui-ribbon-rail {
  flex: none; width: 76px; border-left: 1px solid #e6e9ee;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
}
.ui-ribbon-rail .ui-scalebox {
  width: 58px; text-align: center; font-size: 11.5px; color: #3c4048;
  border: 1px solid #d8dce2; border-radius: 5px; padding: 3px 0; background: #fafbfc;
}
.ui-railbtn {
  width: 30px; height: 26px; border: 1px solid #d8dce2; border-radius: 5px;
  background: #fafbfc; color: #2a78d6; font-size: 13px; cursor: pointer;
}
.ui-railbtn:hover { background: #eef4fc; }

/* ── 主区三栏 ── */
.ui-main { flex: 1; min-height: 0; display: flex; }

/* 左：图层树 */
.ui-tree {
  flex: none; width: 300px; background: #fff;
  border-right: 1px solid #d8dce2; display: flex; flex-direction: column;
}
.ui-tree-tabs {
  flex: none; display: flex; gap: 2px; padding: 8px 10px 0;
}
.ui-tree-tabs span {
  padding: 5px 16px; font-size: 12.5px; color: #8a9099;
  border: 1px solid #e2e4e8; border-bottom: none; border-radius: 6px 6px 0 0;
  background: #f2f3f5; cursor: pointer;
}
.ui-tree-tabs span.act { background: #fff; color: #174a8f; font-weight: 700; }
.ui-tree-search {
  flex: none; margin: 8px 10px; padding: 5px 10px;
  border: 1px solid #d8dce2; border-radius: 6px;
  font-size: 12px; color: #a0a5ad; background: #fafbfc;
}
.ui-tree-body { flex: 1; min-height: 0; overflow-y: auto; padding: 2px 6px 12px; font-size: 13px; }
.ui-row {
  display: flex; align-items: center; gap: 6px;
  padding: 4px 6px 4px 4px; border-radius: 5px; cursor: pointer; user-select: none;
  color: #3c4048; white-space: nowrap;
}
.ui-row:hover { background: #eef4fc; }
.ui-row .caret {
  width: 14px; flex: none; font-size: 9px; color: #8a9099; text-align: center;
}
.ui-row input[type=checkbox] { margin: 0; accent-color: #2a78d6; flex: none; }
.ui-row .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.ui-row .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.ui-row.grp { font-weight: 600; }
.ui-row.leaf { font-weight: 400; color: #4a4f57; }
.ui-kids.closed { display: none; }

/* 中：画布 */
.ui-canvas {
  flex: 1; min-width: 0; position: relative; overflow: hidden;
  background: #e9e9e4;
}
.ui-stack { position: absolute; }
.ui-stack img { position: absolute; inset: 0; width: 100%; height: 100%; }
.ui-scalebar {
  position: absolute; left: 14px; bottom: 12px;
  background: rgba(255, 255, 255, .88); border: 1px solid #d8dce2; border-radius: 5px;
  padding: 3px 10px; font-size: 11.5px; color: #4a4f57;
}
.ui-scalebar i {
  display: inline-block; width: 74px; height: 5px; vertical-align: 1px;
  border: 1.5px solid #4a4f57; border-top: none; margin-right: 7px;
}

/* 右：AI 助手面板 */
.ui-ai {
  flex: none; width: 340px; background: #fff;
  border-left: 1px solid #d8dce2; display: flex; flex-direction: column;
}
.ui-ai-head {
  flex: none; display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; border-bottom: 1px solid #eceef2;
  font-size: 13.5px; font-weight: 700; color: #174a8f;
}
.ui-ai-head .ops { font-size: 11.5px; font-weight: 400; color: #8a9099; }
.ui-ai-body { flex: 1; min-height: 0; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.ui-msg { border-radius: 9px; padding: 9px 12px; font-size: 12.5px; line-height: 1.7; }
.ui-msg.ai { background: #f2f6fb; border: 1px solid #e0e8f3; color: #33363c; }
.ui-msg.user { background: #2a78d6; color: #fff; align-self: flex-end; max-width: 88%; }
.ui-msg .who { display: block; font-size: 11px; font-weight: 700; color: #2a78d6; margin-bottom: 2px; }
.ui-msg.user .who { color: #cfe2f8; }
.ui-toolcard {
  border: 1px solid #d8e2f0; border-radius: 9px; padding: 10px 12px;
  background: #fff;
}
.ui-toolcard .tc-t { font-size: 12.5px; font-weight: 700; color: #174a8f; margin-bottom: 6px; }
.ui-toolcard .tc-code {
  font: 11px/1.6 Consolas, Menlo, monospace; color: #4a4f57;
  background: #f6f8fa; border: 1px solid #eceef2; border-radius: 6px;
  padding: 7px 9px; white-space: pre-wrap; margin-bottom: 8px;
}
.ui-toolcard .tc-ops { display: flex; gap: 8px; }
.ui-toolcard .tc-ops span {
  font-size: 11.5px; padding: 3px 14px; border-radius: 5px; cursor: pointer;
  border: 1px solid #d8e2f0; color: #2a78d6; background: #f7fafd;
}
.ui-toolcard .tc-ops span.pri { background: #2a78d6; color: #fff; border-color: #2a78d6; }
.ui-ai-input {
  flex: none; display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid #eceef2;
}
.ui-ai-input .ph {
  flex: 1; border: 1px solid #d8dce2; border-radius: 7px;
  padding: 8px 12px; font-size: 12px; color: #a0a5ad; background: #fafbfc;
  white-space: nowrap; overflow: hidden;
}
.ui-ai-input .send {
  flex: none; background: #2a78d6; color: #fff; border-radius: 7px;
  font-size: 12.5px; padding: 8px 18px;
}

/* ── 状态栏 ── */
.ui-status {
  flex: none; height: 30px;
  display: flex; align-items: center; gap: 14px; padding: 0 14px;
  background: #f2f3f5; border-top: 1px solid #d8dce2;
  font-size: 12px; color: #5a5f68; white-space: nowrap;
}
.ui-status .bdg {
  background: #22406e; color: #fff; font-size: 11px;
  border-radius: 4px; padding: 2px 9px;
}
.ui-status .coord { color: #4a4f57; }
.ui-status .prog {
  width: 130px; height: 8px; border-radius: 4px; overflow: hidden;
  background: #dde1e7; flex: none;
}
.ui-status .prog i { display: block; height: 100%; width: 100%; background: #2a78d6; }
.ui-status .ready { margin-left: auto; color: #0ca30c; }

body.demo-open #l1-report { display: none !important; }
