/* =========================================================================
   主页 · 网络状态面板
   -------------------------------------------------------------------------
   复用 brutal.css 的设计令牌（--paper / --ink / --edge / 硬阴影），
   只新增面板自有类名，不改动其他页面的样式。
   ========================================================================= */

.netstatus { margin-top: var(--s6); }

.netstatus__grid {
  display: grid;
  grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr);
  gap: var(--s4);
  align-items: stretch;
}

/* ---------- 总体状态卡 ---------- */
.netstatus__summary {
  display: flex;
  flex-direction: column;
  gap: var(--s2);
  padding: var(--s4);
  background: var(--paper);
  border: var(--edge) solid var(--ink);
  box-shadow: 5px 5px 0 var(--ink);
  transition: background-color .2s ease;
}
.netstatus__summary[data-state="up"] { background: #eaf9dd; }
.netstatus__summary[data-state="degraded"] { background: #fff4d6; }
.netstatus__summary[data-state="down"] { background: #ffe2dd; }

.netstatus__top { display: flex; align-items: center; gap: var(--s2); }
.netstatus__lamp {
  width: 14px;
  height: 14px;
  flex: none;
  background: #d9d9d9;
  border: 2px solid var(--ink);
}
.netstatus__summary[data-state="up"] .netstatus__lamp { background: #23b26d; }
.netstatus__summary[data-state="degraded"] .netstatus__lamp { background: #ffb020; }
.netstatus__summary[data-state="down"] .netstatus__lamp { background: #e0392b; }

.netstatus__state {
  font-size: 20px;
  font-weight: 900;
  letter-spacing: -.01em;
  line-height: 1.2;
}
.netstatus__sub {
  margin: 0;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.55;
}

.netstatus__uptime { margin-top: auto; padding-top: var(--s3); }
.netstatus__uptime b {
  display: block;
  font-family: var(--mono);
  font-size: 36px;
  font-weight: 900;
  letter-spacing: -.03em;
  line-height: 1;
}
.netstatus__uptime span {
  display: block;
  margin-top: 4px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .04em;
}

/* 近 90 天事件 */
.netstatus__inc { margin-top: var(--s2); }
.netstatus__inc-h {
  display: block;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.netstatus__inc-list {
  margin: var(--s2) 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 4px;
}
.netstatus__inc-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
}
.netstatus__inc-dot {
  width: 8px;
  height: 8px;
  flex: none;
  background: #e0392b;
  border: 2px solid var(--ink);
}
.netstatus__inc-item[data-state="resolved"] .netstatus__inc-dot { background: #23b26d; }
.netstatus__inc-item[data-state="active"] .netstatus__inc-dot { background: #ffb020; }
.netstatus__inc-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.netstatus__inc-time {
  margin-left: auto;
  flex: none;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 700;
}
.netstatus__inc-empty {
  font-size: 12px;
  font-weight: 600;
}

.netstatus__foot {
  margin: var(--s2) 0 0;
  padding-top: var(--s2);
  border-top: 2px solid var(--ink);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.5;
}

/* ---------- 监控项列表 ---------- */
.netstatus__list {
  margin: 0;
  padding: 0 var(--s4);
  list-style: none;
  background: var(--paper);
  border: var(--edge) solid var(--ink);
  box-shadow: 5px 5px 0 var(--ink);
}

.netmon { padding: var(--s3) 0; border-top: 2px solid var(--ink); }
.netmon:first-child { border-top: 0; }

.netmon__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s3);
}
.netmon__name {
  min-width: 0;
  font-size: 14.5px;
  font-weight: 800;
  line-height: 1.35;
}
.netmon__name small {
  display: block;
  margin-top: 1px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.45;
  word-break: break-word;
}

.netmon__stat {
  flex: none;
  padding: 1px 7px;
  background: var(--paper);
  border: 2px solid var(--ink);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}
.netmon[data-state="up"] .netmon__stat { background: #d8f5c8; color: var(--ok); }
.netmon[data-state="degraded"] .netmon__stat { background: #ffeec4; color: var(--warn); }
.netmon[data-state="down"] .netmon__stat { background: #ffd9d3; color: var(--bad); }

/* 一分钟一格 */
.netmon__bars {
  display: flex;
  gap: 2px;
  height: 16px;
  margin-top: var(--s2);
  padding: 2px;
  background: var(--paper);
  border: 2px solid var(--ink);
}
.netmon__bar {
  flex: 1 1 0;
  min-width: 0;
  background: #e6e6e6;
}
.netmon__bar[data-state="up"] { background: #23b26d; }
.netmon__bar[data-state="degraded"] { background: #ffb020; }
.netmon__bar[data-state="down"] { background: #e0392b; }
.netmon__bar:hover { outline: 2px solid var(--ink); outline-offset: 1px; }

.netmon__nobars {
  padding: 0 4px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  color: #555;
}

.netmon__meta {
  display: flex;
  justify-content: space-between;
  gap: var(--s3);
  margin-top: 6px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
}

.netmon__empty {
  padding: var(--s4) 0;
  font-size: 14px;
  font-weight: 700;
}

/* ---------- 底部说明 ---------- */
.netstatus__note {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px var(--s2);
  margin: var(--s2) 0 0;
  font-size: 12.5px;
  font-weight: 500;
}
.netstatus__head-right {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
}
.netstatus__refresh {
  min-height: 26px;
  padding: 0 8px;
  background: var(--paper);
  border: 2px solid var(--ink);
  font-size: 11px;
  font-weight: 800;
  transition: background-color .12s ease, transform .12s ease;
}
.netstatus__refresh:hover { background: var(--bg); transform: translate(-1px, -1px); }
.netstatus__refresh:active { transform: translate(1px, 1px); }

.netstatus__hint {
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 700;
  color: var(--bad);
}
.netstatus__hint:empty { display: none; }

/* ---------- 响应式 ---------- */
@media (max-width: 880px) {
  .netstatus__grid { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .netstatus { margin-top: var(--s5); }
  .netstatus__summary { padding: var(--s3); }
  .netstatus__uptime b { font-size: 30px; }
  .netstatus__list { padding: 0 var(--s3); }
  .netmon__meta { flex-wrap: wrap; }
}
