:root { --workbench-right-tab-center: clamp(54px, 50dvh, calc(100dvh - 160px)); }

.humidity-chart {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 845;
  color: #183750;
  font: 14px/1.5 "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
}

.humidity-chart [hidden], body.v3-away .humidity-chart { display: none !important; }

.humidity-chart-button {
  padding: 6px 12px;
  min-height: 33px;
  border: 1px solid #b9cddd;
  border-radius: 6px;
  color: #234e71;
  background: #fff;
  font: inherit;
  cursor: pointer;
}

.humidity-chart-button:hover { background: #eaf3fc; }
.humidity-chart-button:focus-visible { outline: 2px solid #1f6bae; outline-offset: 2px; }

#szcTab, .humidity-chart-launch {
  top: var(--workbench-right-tab-center);
  box-sizing: border-box;
  width: 34px;
  height: 94px;
  padding: 0;
  justify-content: center;
  align-items: center;
}

.humidity-chart-launch {
  position: fixed;
  right: 0;
  display: flex;
  transform: translateY(-50%);
  writing-mode: vertical-rl;
  letter-spacing: 2px;
  font-size: 11.5px;
  font-weight: 600;
  background: #fff;
  color: #2563eb;
  border: 1px solid rgba(16, 24, 40, .08);
  border-right: 0;
  border-radius: 10px 0 0 10px;
  box-shadow: -6px 0 18px rgba(16, 24, 40, .08);
}
.humidity-chart-v3 .humidity-chart-launch { top: calc(var(--workbench-right-tab-center) + 104px); }
.humidity-chart-launch:hover, .humidity-chart-launch[aria-expanded="true"] {
  background: #eff4ff;
  color: #1d4ed8;
  border-color: #c7d7fe;
}
.humidity-chart-launch:focus-visible { outline-offset: -3px; }

.humidity-chart-panel {
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 50%;
  right: 46px;
  transform: translateY(-50%);
  width: min(610px, calc(100vw - 58px));
  max-height: calc(100dvh - 32px);
  box-sizing: border-box;
  overflow: hidden;
  border: 1px solid #b8cbdc;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 10px 34px #102d4633;
}

.humidity-chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  border-bottom: 1px solid #dce6ef;
  background: #f4f8fc;
}
.humidity-chart-header h2 { margin: 0; font-size: 16px; line-height: 1.3; }
.humidity-chart-content { min-height: 0; overflow: auto; padding: 12px; }
.humidity-chart-status { margin: 0; color: #475b6c; font-size: 13px; }
.humidity-chart-viewport { overflow-x: auto; }
.humidity-chart img {
  display: block;
  width: 100%;
  height: auto;
  margin-top: 10px;
  box-sizing: border-box;
  border: 1px solid #dce6ef;
  border-radius: 5px;
}
.humidity-chart-download { margin-top: 10px; }

@media (min-width: 1050px) {
  body:not(.szc-min) .humidity-chart-v3 .humidity-chart-panel { right: 409px; }
}

@media (max-width: 520px) {
  .humidity-chart img { min-width: 480px; }
}

@media (prefers-reduced-motion: no-preference) {
  .humidity-chart-panel:not([hidden]) { animation: humidity-chart-enter .22s ease-out; }
  @keyframes humidity-chart-enter {
    from { opacity: 0; transform: translate(14px, -50%); }
    to { opacity: 1; transform: translateY(-50%); }
  }
}
