.iot-hmi-wrap {
  position: relative;
  width: 100%;
  background: #0d141b;
  overflow: hidden;
  font-family: "Microsoft YaHei", "PingFang SC", "SimHei", sans-serif;
  line-height: 1.2;
}

.iot-process-mode-shell {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.iot-process-mode-switch {
  display: flex;
  gap: 6px;
  align-items: center;
  padding: 6px 8px;
  background: #173e56;
  border-radius: 6px;
}

.iot-process-mode-button {
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 4px;
  padding: 7px 14px;
  color: #d9edf4;
  background: transparent;
  cursor: pointer;
  font: 600 13px "Microsoft YaHei", sans-serif;
}

.iot-process-mode-button.active,
.iot-process-mode-button:hover {
  color: #082031;
  background: #65e3df;
  border-color: #65e3df;
}

/* 组态 SVG 画布（16:9，随容器宽度缩放） */
.hmi-svg-host svg {
  display: block;
  width: 100%;
  height: auto;
}

.hmi-loading,
.hmi-load-error {
  padding: 48px 24px;
  color: #8899a6;
  font-size: 14px;
  text-align: center;
}

/* 工艺图需要完整的横向画布，告警助手浮层不应遮挡管线和仪表。 */
body:has([data-hmi-root]) #icepiAssistant {
  display: none !important;
}

/* ---- 左侧导航覆盖层（盖住 SVG 自带导航） ---- */
.hmi-nav-overlay {
  position: absolute;
  left: 0;
  top: 5%;           /* 54/1080，标题栏下方 */
  bottom: 4.63%;     /* 50/1080，状态栏上方 */
  width: 5.94%;      /* 114/1920 */
  background: #405a7e;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  padding: 3.2% 0 2% 0;
}

/* Unified top switcher. The source WinCC side menus are intentionally cropped. */
.hmi-nav-overlay.hmi-nav-top {
  position: relative;
  inset: auto;
  width: 100%;
  min-height: 42px;
  padding: 6px 12px;
  background: #173e56;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  overflow: hidden;
}

.hmi-nav-top .hmi-nav-title {
  flex: none;
  margin: 0;
  padding-right: 10px;
  font-size: 14px;
  font-weight: 700;
  border-right: 1px solid rgba(255, 255, 255, 0.28);
}

.hmi-nav-top .hmi-nav-list {
  flex: 1;
  flex-direction: row;
  gap: 5px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
}

.hmi-nav-top .hmi-nav-item {
  width: auto;
  flex: none;
  padding: 6px 12px;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 4px;
  font-size: 13px;
}

.hmi-nav-top .hmi-nav-item.active {
  border-color: #ffe916;
}

.hmi-nav-title {
  color: #fff;
  font-size: 13px;
  text-align: center;
  margin-bottom: 3%;
  white-space: nowrap;
  letter-spacing: 1px;
}

.hmi-nav-list {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.hmi-nav-item {
  display: block;
  width: 100%;
  background: none;
  border: none;
  color: #fff;
  font-size: 13px;
  text-align: center;
  padding: 6px 2px;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  transition: background 120ms linear, color 120ms linear;
}

.hmi-nav-item:hover {
  background: rgba(255, 255, 255, 0.14);
}

.hmi-nav-item.active {
  background: #ffe916;
  color: #14191e;
  font-weight: 700;
}

/* ---- 底部实时数据栏覆盖层（盖住 SVG 自带状态栏） ---- */
.hmi-status-overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 4.63%;
  background: #060807;
  color: #39ff1e;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 14px;
  box-sizing: border-box;
  font-family: Consolas, "Microsoft YaHei", monospace;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
}

.hmi-status-title {
  color: #39ff1e;
  font-weight: 700;
  font-size: 14px;
}

.hmi-status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #8899a6;
  flex: none;
}

.hmi-status-items {
  display: flex;
  gap: 16px;
  flex: 1;
  overflow: hidden;
}

.hmi-status-item {
  display: inline-flex;
  gap: 4px;
  align-items: baseline;
  white-space: nowrap;
}

.hmi-status-name {
  color: #39ff1e;
}

.hmi-status-value {
  color: #39ff1e;
  font-weight: 700;
  transition: color 200ms linear;
}

.hmi-status-unit {
  color: #6fbf77;
  font-size: 11px;
}

.hmi-status-time {
  color: #8899a6;
  font-size: 12px;
  flex: none;
}

.desktop-sidebar-collapse-button,
.desktop-sidebar-expand-button {
  display: none;
}

/* 桌面端侧栏可收起，收起后保留一个浮动展开按钮。 */
@media (min-width: 921px) {
  .desktop-cockpit .shell.sidebar-collapsed {
    grid-template-columns: 0 minmax(0, 1fr);
  }

  .desktop-cockpit .shell.sidebar-collapsed > .sidebar {
    width: 0;
    min-width: 0;
    padding-left: 0;
    padding-right: 0;
    gap: 0;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    border-right: 0;
  }

  .desktop-cockpit .desktop-sidebar-collapse-button,
  .desktop-cockpit .desktop-sidebar-expand-button {
    display: grid;
    width: 32px;
    height: 32px;
    min-height: 32px;
    place-items: center;
    padding: 0;
    border: 1px solid rgba(14, 116, 144, 0.25);
    border-radius: 8px;
    background: #edf8f6;
    color: #0f5f72;
    font-size: 25px;
    line-height: 1;
    cursor: pointer;
  }

  .desktop-cockpit .desktop-sidebar-collapse-button {
    align-self: flex-end;
    margin: -8px 0 0;
  }

  .desktop-cockpit .desktop-sidebar-expand-button {
    position: fixed;
    top: 16px;
    left: 10px;
    z-index: 1000;
    box-shadow: 0 6px 18px rgba(30, 48, 70, 0.16);
  }

  .desktop-cockpit .desktop-sidebar-collapse-button:hover,
  .desktop-cockpit .desktop-sidebar-expand-button:hover {
    background: #d8f2ef;
  }
}
