/* 模型健康卡片 · 参考「模型状态」布局，独立于 v8 的深空工作台外壳 */
.model-health-board {
  padding: 22px;
  border: 1px solid #e2eee8;
  border-radius: 22px;
  background:
    radial-gradient(circle at 88% 8%, rgba(255, 255, 255, .9) 0, rgba(255, 255, 255, 0) 34%),
    linear-gradient(145deg, #f2fbf7 0%, #f7fcfa 48%, #edf9f3 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9);
}
.model-health-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.model-health-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 20px 20px 15px;
  border: 1px solid #e8f0eb;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 16px 36px rgba(38, 73, 58, .075);
}
.mh-top {
  display: flex;
  align-items: flex-start;
  gap: 11px
}
.mh-logo {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 43px;
  height: 43px;
  border-radius: 11px;
  background: #e9f8ef;
  color: #27a46e
}
.mh-logo .icon {
  width: 22px;
  height: 22px
}
.mh-logo.tone-deepseek {
  background: #e4f7f5;
  color: #1ba8a0
}
.mh-logo.tone-glm {
  background: #eeebff;
  color: #6f5bd4
}
.mh-logo.tone-kimi {
  background: #ffeaf3;
  color: #ed3c86
}
.mh-logo.tone-other {
  background: #f0eee5;
  color: #817861
}
.mh-title {
  flex: 1;
  min-width: 0
}
.mh-title h2 {
  margin: 0;
  color: #17231d;
  font-family: var(--v8-sans, "Inter", "PingFang SC", sans-serif);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -.04em;
  line-height: 1.1
}
.mh-model {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  margin-top: 7px
}
.mh-provider {
  flex: 0 0 auto;
  padding: 2px 6px;
  border-radius: 5px;
  background: #f0f8f4;
  color: #55a47f;
  font-size: 8px;
  font-weight: 600;
  line-height: 1.5
  }
.mh-model code, .mh-model-select {
  overflow: hidden;
  min-width: 0;
  color: #8a948e;
  font-family: var(--v8-mono, "SFMono-Regular", "Menlo", monospace);
  font-size: 9px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap
}
.mh-model-select {
  max-width: 168px;
  padding: 0 12px 0 0;
  border: 0;
  background: transparent;
  cursor: pointer
}
.mh-model-select:focus {
  outline: 1px solid #b9dfcb;
  outline-offset: 2px;
  border-radius: 3px
}
.mh-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: 0 0 auto;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 600;
  line-height: 1
}
.mh-status::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor
}
.mh-status.is-normal {
  background: #e8f8ef;
  color: #21ad77
}
.mh-status.is-unstable {
  background: #fff5dc;
  color: #b8871c
}
.mh-status.is-down {
  background: #fdecec;
  color: #d84e4e
}
.mh-status.is-unknown {
  background: #f1f2ee;
  color: #8f938b
}
.mh-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin-top: 18px
}
.mh-metric {
  min-width: 0;
  padding: 10px 11px 9px;
  border: 1px solid #f0f3f0;
  border-radius: 8px;
  background: #fafcfb
}
.mh-metric-label {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow: hidden;
  color: #909b94;
  font-size: 8.5px;
  text-overflow: ellipsis;
  white-space: nowrap
}
.mh-metric-label .icon {
  width: 12px;
  height: 12px;
  color: #b0b9b3
}
.mh-metric strong {
  display: block;
  margin-top: 6px;
  overflow: hidden;
  color: #1c2922;
  font-family: var(--v8-mono, "SFMono-Regular", "Menlo", monospace);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -.04em;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap
}
.mh-metric strong small {
  margin-left: 3px;
  color: #a6afa9;
  font-family: var(--v8-sans, "Inter", "PingFang SC", sans-serif);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0
}
.mh-availability {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  margin-top: 17px;
  padding-top: 14px;
  border-top: 1px solid #f0f3f0
}
.mh-availability span {
  display: block;
  color: #909b94;
  font-size: 9px
}
.mh-availability small {
  display: block;
  margin-top: 4px;
  color: #b2bbb5;
  font-size: 8px
}
.mh-availability strong {
  flex: 0 0 auto;
  color: #22b77e;
  font-family: var(--v8-mono, "SFMono-Regular", "Menlo", monospace);
  font-size: 35px;
  font-weight: 600;
  letter-spacing: -.07em;
  line-height: .9
}
.mh-availability strong small {
  display: inline;
  margin-left: 1px;
  color: #22b77e;
  font-size: 15px;
  letter-spacing: 0;
  white-space: nowrap
}
.mh-availability.is-warn strong,
.mh-availability.is-warn strong small {
  color: #d29a2b
}
.mh-availability.is-bad strong,
.mh-availability.is-bad strong small {
  color: #d95858
}
.mh-availability.is-empty strong,
.mh-availability.is-empty strong small {
  color: #b0b8b2
}
.mh-records {
  margin-top: 13px
}
.mh-records-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #a2aca5;
  font-size: 8px
}
.mh-records-head .mh-refresh {
  color: #b3bbb5;
  font-size: 8px
}
.mh-bars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 31px;
  margin-top: 7px;
  overflow: hidden
}
.mh-bar {
  flex: 1 1 0;
  min-width: 0;
  height: 100%;
  border-radius: 1.5px;
  background: #e9f0ec
}
.mh-bar.ok {
  background: #21c28a
}
.mh-bar.warn {
  background: #efb32d
}
.mh-bar.bad {
  background: #eb5b5b
}
.mh-bar.empty {
  background: #e8efeb
}
.mh-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 14px;
  padding-top: 11px;
  border-top: 1px solid #f0f3f0
}
.mh-price {
  min-width: 0;
  overflow: hidden;
  color: #9ba59f;
  font-size: 8.5px;
  text-overflow: ellipsis;
  white-space: nowrap
}
.mh-price code {
  color: #7f8c84;
  font-family: var(--v8-mono, "SFMono-Regular", "Menlo", monospace);
  font-size: 8px
}
.mh-actions {
  display: flex;
  align-items: center;
  gap: 3px;
  flex: 0 0 auto
}
.mh-action {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border: 1px solid #e8efeb;
  border-radius: 6px;
  background: #fbfdfb;
  color: #7c8981;
  cursor: pointer
}
.mh-action:hover {
  border-color: #cfe2d7;
  color: #299b70
}
.mh-action .icon {
  width: 13px;
  height: 13px
}
.mh-chat {
  padding: 0 9px;
  border: 1px solid #c9e6d8;
  border-radius: 6px;
  background: #f2fbf6;
  color: #26966c;
  font-size: 9px;
  font-weight: 600;
  line-height: 23px
}
.mh-chat:disabled {
  cursor: not-allowed;
  opacity: .5
}
.mh-chat:hover:not(:disabled) {
  background: #e6f8ee
}
.model-health-empty {
  padding: 46px 20px;
  text-align: center;
  color: #8e9a92
}
.model-health-empty .icon {
  width: 30px;
  height: 30px;
  margin-bottom: 10px;
  color: #b6c8bc
}
.model-health-empty strong {
  display: block;
  color: #4f5e55;
  font-size: 14px
}
.model-health-empty p {
  margin-top: 5px;
  font-size: 10px
}
@media (max-width: 1180px) {
  .model-health-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr))
  }
}
@media (max-width: 760px) {
  .model-health-board {
    padding: 12px;
    border-radius: 16px
  }
  .model-health-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px
  }
  .model-health-card {
    padding: 16px 15px 13px;
    border-radius: 13px
  }
  .mh-title h2 {
    font-size: 20px
  }
  .mh-metrics {
    margin-top: 14px
  }
  .mh-availability strong {
    font-size: 31px
  }
  .mh-bars {
    height: 28px
  }
}


/* 模型页整页淡薄荷底，卡片直接铺在渐变上，贴近参考图 */
body:has(.model-health-board) {
  background:
    radial-gradient(circle at 88% 6%, rgba(255, 255, 255, .92) 0, rgba(255, 255, 255, 0) 34%),
    linear-gradient(145deg, #f3fbf7 0%, #f8fcfa 46%, #edf9f3 100%);
  background-attachment: fixed;
}
body:has(.model-health-board) #main {
  background: transparent;
}
body:has(.model-health-board) #page {
  min-height: calc(100vh - 56px);
}
body:has(.model-health-board) .model-health-board {
  padding: 10px 0 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
