/* TCE 能碳板块 · 皮肤② 能碳管理平台外壳（侧边菜单 / 面包屑 / iframe stage） */
/* TCE 能碳板块 · 皮肤② 能碳管理平台外壳（侧边菜单 / 面包屑 / iframe stage） */
/* 能碳管理平台外壳，报告平台继续使用各自的头部样式。 */
html,
body {
  height: 100%;
  margin: 0;
  overflow: hidden;
}
body {
  background: #091a2c;
  color: #edf4ff;
  font-family: 'Microsoft YaHei', 'Segoe UI', sans-serif;
}
.app,
.app * {
  box-sizing: border-box;
}
.app {
  --shell-bg: #0c182a;
  --shell-edge: #113450;
  --shell-text: #edf4ff;
  --shell-muted: #a8bfd6;
  --shell-accent: #00e9f4;
  --shell-topbar-height: 50px;
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  background: var(--shell-bg);
}
.shell-workspace {
  position: relative;
  display: flex;
  flex: 1;
  min-height: 0;
  min-width: 0;
}
.sidebar {
  z-index: 5;
  display: flex;
  flex: none;
  flex-direction: column;
  width: 234px;
  overflow: hidden;
  background: var(--shell-bg);
  border-inline-end: 1px solid var(--shell-edge);
  transition: width 0.22s ease;
}
.shell-brand {
  display: flex;
  align-items: center;
  flex: none;
  min-height: 50px;
  gap: 10px;
  padding: 6px 14px;
  border-bottom: 1px solid var(--shell-edge);
}
.shell-brand-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 38px;
  height: 38px;
  border: 1px solid #196072;
  border-radius: 9px;
  background: linear-gradient(135deg, #123b49, #103d39);
  font-size: 20px;
}
.shell-brand-text {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.shell-brand-text strong {
  font-size: 15px;
  white-space: nowrap;
  color: var(--shell-accent);
}
.shell-brand-text span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #8ab4d8;
  font-size: 10px;
}
.app.collapsed .shell-brand {
  justify-content: center;
  padding-inline: 0;
}
.app.collapsed .shell-brand-text {
  display: none;
}
.nav {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden auto;
  padding: 12px 13px 16px;
  overscroll-behavior: contain;
}
.shell-return {
  display: flex;
  flex: none;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  margin-block-end: 18px;
  padding: 6px 12px;
  border: 1px solid #16a8b9;
  border-radius: 7px;
  background: #0b2638;
  color: var(--shell-text);
  font-size: 15px;
  line-height: 1.4;
  text-decoration: none;
  white-space: nowrap;
}
.shell-return svg {
  flex: none;
  width: 22px;
  height: 22px;
  color: var(--shell-accent);
}
.shell-return:hover {
  background: #103b51;
  border-color: var(--shell-accent);
}
/* 让所有菜单项共享剩余高度，同时保留模板中的分组顺序。 */
.nav-group {
  display: contents;
}
.nav-group + .nav-group .nav-group-title {
  margin-block-start: 14px;
}
.nav-group:first-of-type + .nav-group .nav-group-title {
  margin-block-start: 16px;
}
.nav-group-title {
  display: flex;
  flex: none;
  align-items: center;
  gap: 10px;
  padding: 0 0 5px 14px;
  color: var(--shell-muted);
  font-size: 14px;
  line-height: 21px;
  letter-spacing: 1px;
  white-space: nowrap;
}
.nav-group:nth-child(n+3) .nav-group-title {
  padding-bottom: 0;
}
.nav-group + .nav-group .nav-group-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #10304a;
}
.nav-item {
  display: flex;
  flex: 1 0 auto;
  align-items: center;
  gap: 9px;
  min-height: 35px;
  padding: 5px 6px 5px 12px;
  border-radius: 7px;
  color: var(--shell-text);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}
.nav-group:first-of-type .nav-item {
  min-height: 39px;
}
.nav-item .nm,
.crumb .cur,
#crumbGroup {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nav-item:hover {
  background: #112d44;
}
.nav-item.active {
  background: #063e55;
  font-weight: 700;
}
.nav-item .ico {
  color: #dce9f9;
}
.nav-item.active .ico {
  color: var(--shell-accent);
}
.side-foot {
  flex: none;
  min-height: 68px;
  padding: 14px 16px 14px 31px;
  border-top: 1px solid var(--shell-edge);
  color: var(--shell-muted);
  font-size: 14px;
  line-height: 20px;
  letter-spacing: 0.5px;
  white-space: nowrap;
}
.app.collapsed .sidebar {
  width: 56px;
}
.app.collapsed .nav {
  padding-inline: 6px;
}
.app.collapsed :is(.nav-item, .shell-return) {
  justify-content: center;
  padding-inline: 0;
}
.app.collapsed :is(.nav-group-title, .side-foot) {
  display: none;
}
.app.collapsed :is(.nav-item, .shell-return) .nm {
  position: absolute;
  width: 1px;
  height: 1px;
  clip-path: inset(50%);
}
.main {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}
.topbar {
  z-index: 6;
  display: flex;
  align-items: center;
  flex: none;
  height: var(--shell-topbar-height);
  justify-content: space-between;
  gap: 12px;
  padding: 0 16px 0 12px;
  border-bottom: 1px solid var(--shell-edge);
  background: var(--shell-bg);
}
.topbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.toggle-btn {
  display: grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--shell-text);
  cursor: pointer;
  --shell-icon: url('../iconfont/shell/menu-2.svg');
}
.toggle-btn:hover {
  background: #112d44;
  color: var(--shell-accent);
}
.crumb {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--shell-text);
  font-size: 13px;
  white-space: nowrap;
}
.crumb .sep {
  color: #657f99;
}
.crumb-root,
.crumb-desc {
  color: #8ab4d8;
}
.crumb-desc {
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 11px;
}
.crumb-desc:empty {
  display: none;
}
.crumb .cur {
  color: var(--shell-accent);
  font-weight: 700;
}
.shell-icon {
  display: block;
  flex: none;
  width: 23px;
  height: 23px;
  background: currentColor;
  -webkit-mask: var(--shell-icon) center / contain no-repeat;
  mask: var(--shell-icon) center / contain no-repeat;
  forced-color-adjust: none;
}
/* 图标按模块编码取用；菜单名、排序及显示权限仍由现有配置提供。 */
.nav-item[data-page='index'] {
  --shell-icon: url('../iconfont/shell/layout-grid.svg');
}
.nav-item:is([data-page='index1'], [data-page='page2']) {
  --shell-icon: url('../iconfont/shell/chart-bar.svg');
}
.nav-item[data-page='monitor'] {
  --shell-icon: url('../iconfont/shell/trending-up.svg');
}
.nav-item[data-page='page1'] {
  --shell-icon: url('../iconfont/shell/bolt.svg');
}
.nav-item[data-page='page3'] {
  --shell-icon: url('../iconfont/shell/file-analytics.svg');
}
.nav-item[data-page='page4'] {
  --shell-icon: url('../iconfont/shell/target-arrow.svg');
}
.nav-item[data-page='page5'] {
  --shell-icon: url('../iconfont/shell/stack-2.svg');
}
.nav-item[data-page='page6'] {
  --shell-icon: url('../iconfont/shell/settings.svg');
}
.nav-item[data-page='page7'] {
  --shell-icon: url('../iconfont/shell/clipboard-text.svg');
}
.nav-item[data-page='page8'] {
  --shell-icon: url('../iconfont/shell/arrow-right.svg');
}
.nav-item[data-page='page9'] {
  --shell-icon: url('../iconfont/shell/plant-2.svg');
}
.nav-item[data-page='page10'] {
  --shell-icon: url('../iconfont/shell/link.svg');
}
.nav-item[data-page='page11'] {
  --shell-icon: url('../iconfont/shell/search.svg');
}
.nav-item[data-page='page12'] {
  --shell-icon: url('../iconfont/shell/diamond.svg');
}
.nav-item:focus-visible,
.shell-return:focus-visible,
.toggle-btn:focus-visible,
.top-btn:focus-visible {
  outline: 2px solid var(--shell-accent);
  outline-offset: -2px;
}
.shell-scrim {
  display: none;
}
.stage {
  flex: 1;
  min-height: 0;
  position: relative;
  background: var(--shell-bg);
}
.stage iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}
.stage-mask {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: var(--shell-bg);
  transition: opacity 0.3s, visibility 0.3s;
}
.stage-mask.hide {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.spinner {
  width: 34px;
  height: 34px;
  border: 3px solid #15344d;
  border-top-color: var(--shell-accent);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.stage-mask .txt {
  font-size: 13px;
  color: var(--shell-muted);
}
.stage-mask.failed .txt {
  max-width: 90%;
  text-align: center;
  line-height: 1.7;
}
.top-btn {
  padding: 6px 12px;
  border: 1px solid #285673;
  border-radius: 6px;
  background: #112d44;
  color: var(--shell-text);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.top-btn:hover {
  background: #063e55;
}
.app [hidden] {
  display: none !important;
}
@media (max-width: 1080px) {
  .crumb-desc {
    display: none;
  }
}
@media (max-width: 960px) {
  .crumb .crumb-root {
    display: none;
  }
  .app {
    --shell-topbar-height: 82px;
  }
  .topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: 40px minmax(0, 1fr);
    gap: 0 8px;
  }
  .topbar > .tce-top-tools {
    display: contents;
  }
  .top-clock {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
  }
  .topbar-actions {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: flex-end;
    min-width: 0;
  }
}
@media (max-width: 600px) {
  .sidebar {
    position: absolute;
    inset: var(--shell-topbar-height) auto 0 0;
    width: min(234px, 88vw);
    box-shadow: 10px 0 26px #0006;
  }
  .app.collapsed .sidebar {
    width: 0;
    visibility: hidden;
    border: 0;
    box-shadow: none;
  }
  .nav {
    padding-top: 16px;
  }
  .app:not(.collapsed) .shell-scrim {
    display: block;
    position: absolute;
    inset: var(--shell-topbar-height) 0 0;
    z-index: 4;
    background: #0007;
  }
  .topbar-left {
    gap: 12px;
  }
  .crumb {
    gap: 8px;
    font-size: 14px;
  }
}
@media (max-width: 400px) {
  .topbar {
    padding-inline: 4px 8px;
  }
  .topbar-left {
    gap: 6px;
  }
  .crumb #crumbGroup,
  .crumb #crumbGroup + .sep {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .sidebar,
  .nav-item,
  .stage-mask {
    transition: none;
  }
  .spinner {
    animation: none;
  }
}
