.global-workspace-switcher {
  /* 独立设置导航密度，避免 compact-ui 的通用按钮规则覆盖响应式内边距。 */
  --csh-density-control-height: 32px;
  --csh-density-pad-y: 3px;
  --csh-density-pad-x: 8px;
  --csh-density-gap: 4px;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  height: 42px;
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: var(--csh-density-gap);
  padding: 4px 8px;
  border-bottom: 1px solid #425865;
  background: #0d171e;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  position: relative;
  flex: 0 0 42px;
  z-index: 80;
}

.global-workspace-switcher [hidden] {
  display: none !important;
}

.global-workspace-switcher button {
  box-sizing: border-box;
  /* 批TGWAPPDEV028：完整名称决定最小宽度，剩余空间均分，避免宽屏导航右侧留空。 */
  flex: 1 0 auto;
  min-width: max-content;
  min-height: var(--csh-density-control-height);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: var(--csh-density-pad-y) var(--csh-density-pad-x);
  border: 1px solid #5f7682;
  border-radius: 5px;
  background: #1a3039;
  color: #f1f6f7;
  font: 800 13px/1.15 "Microsoft YaHei", "PingFang SC", sans-serif;
  letter-spacing: 0;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.07);
}

.global-workspace-switcher button:hover,
.global-workspace-switcher button:focus-visible {
  border-color: #d6b64f;
  background: #294651;
  outline: none;
}

.global-workspace-switcher button[aria-current="page"] {
  border-color: #f4d265;
  background: #9d6410;
  color: #fff;
}

.global-workspace-switcher button[data-global-workspace-key="chat"] {
  border-color: #e2c660;
  background: #a82231;
}

.global-workspace-switcher button[data-global-workspace-key="materials"] {
  border-color: #45b67d;
  background: #145238;
}

.global-workspace-switcher__mark {
  color: #b8d1da;
  font-weight: 900;
}

body.has-global-workspace-switcher {
  min-height: 100vh;
}

body.has-global-workspace-switcher > .app,
body.has-global-workspace-switcher > #appShell,
body.has-global-workspace-switcher > .jc-app,
body.has-global-workspace-switcher > #root {
  height: calc(100vh - 42px);
  min-height: calc(100vh - 42px);
}

body.has-global-workspace-switcher > .app {
  grid-template-rows: 54px minmax(0, 1fr);
}

body.has-global-workspace-switcher > .app .workspace {
  grid-template-columns: minmax(0, 1fr);
}

body.has-global-workspace-switcher > .app .view {
  height: calc(100vh - 96px);
}

body.has-global-workspace-switcher > .app .sidebar {
  display: none !important;
}

body.has-global-workspace-switcher > #root .trend-app {
  height: 100%;
  min-height: 100%;
}

body.has-global-workspace-switcher .jc-watermarks {
  inset-block-start: 98px;
}

@media (min-width: 761px) and (max-width: 1399px) {
  .global-workspace-switcher {
    --csh-density-gap: 3px;
    --csh-density-pad-x: 5px;
    padding-inline: 6px;
  }

  .global-workspace-switcher button {
    gap: 3px;
    font-size: 12px;
  }
}

@media (min-width: 761px) and (max-width: 1279px) {
  .global-workspace-switcher {
    --csh-density-pad-x: 3px;
  }

  .global-workspace-switcher__mark {
    display: none;
  }
}

@media (max-width: 760px) {
  .global-workspace-switcher {
    --csh-density-control-height: 34px;
    --csh-density-pad-x: 6px;
    padding-inline: 5px;
  }

  .global-workspace-switcher button {
    min-width: 78px;
    font-size: 12px;
  }
}
