:root {
  color-scheme: dark;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #e5eceb;
  background: #101517;
  --panel: #161e20;
  --line: #2b383a;
  --muted: #a1b1b0;
  --mint: #7ae3bb;
  --blue: #81baf0;
  --amber: #eeb888;
  --mono: "SF Mono", Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  min-width: 290px;
  min-height: 100vh;
  background: radial-gradient(ellipse at 15% 0, #1c302b 0, #101517 460px);
}
button { font: inherit; color: inherit; }
button:focus-visible { outline: 2px solid var(--mint); outline-offset: 3px; }
p, h1, h2 { margin: 0; }
.shell { max-width: 1160px; padding: 46px 32px 24px; margin: auto; }
.masthead, .brand, .masthead-actions, .section-heading, .history-head, .history-toolbar {
  display: flex;
  align-items: center;
}
.masthead, .section-heading, .history-head, .history-toolbar { justify-content: space-between; gap: 16px; }
.brand { gap: 15px; }
.masthead-actions { gap: 10px; }
h1 { font-size: 32px; letter-spacing: -.04em; line-height: 1.12; }
.brand p { color: var(--muted); margin-top: 7px; font-size: 13px; }
.mark {
  display: flex;
  height: 49px;
  width: 49px;
  gap: 4px;
  align-items: end;
  justify-content: center;
  padding-bottom: 12px;
  background: #23453c;
  border: 1px solid #3e6458;
  border-radius: 14px;
}
.mark i { width: 4px; height: 9px; border-radius: 2px; background: var(--mint); }
.mark i:nth-child(2) { height: 16px; }
.mark i:nth-child(3) { height: 23px; }
.connection, .refresh {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 9px;
  min-height: 38px;
}
.connection { padding: 0 12px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.connection i, .badge::before {
  width: 7px;
  height: 7px;
  border-radius: 100%;
  background: currentColor;
  flex: none;
}
.connection[data-state="online"] { color: var(--mint); }
.connection[data-state="failed"] { color: var(--amber); }
.refresh { width: 38px; justify-content: center; font-size: 23px; line-height: 1; cursor: pointer; }
.refresh:hover { background: #233430; }
.refresh:disabled { opacity: .55; cursor: wait; }

.summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--line);
  background: #172021;
  border-radius: 14px;
  margin-top: 30px;
}
.summary > div { padding: 17px 21px 18px; }
.summary > div + div { border-left: 1px solid var(--line); }
.summary p { color: var(--muted); font-size: 12px; margin-bottom: 7px; }
.summary strong { font: 600 27px/1.15 var(--mono); }
.summary > div:first-child strong { color: var(--mint); }
.summary span { color: var(--muted); font: 12px var(--mono); }

.servers { margin-top: 26px; }
h2 { font-size: 18px; letter-spacing: -.025em; line-height: 1.3; }
.section-heading { margin-bottom: 12px; }
.section-heading p, .history-head p { font-size: 12px; color: var(--muted); }
.section-heading p { text-align: right; }
.server-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.server-card {
  display: flex;
  flex-direction: column;
  padding: 16px;
  min-width: 0;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--panel);
  cursor: pointer;
}
.server-card:hover { border-color: #517367; }
.server-card[aria-pressed="true"] { border-color: #629b87; background: #192624; }
.card-header { display: flex; align-items: center; gap: 10px; min-height: 39px; }
.machine-icon {
  display: grid;
  align-content: center;
  gap: 4px;
  width: 36px;
  height: 36px;
  padding: 8px;
  flex: none;
  border: 1px solid #384946;
  background: #24312f;
  border-radius: 9px;
}
.machine-icon i {
  display: block;
  height: 6px;
  border: 1px solid #a3c6bb;
  border-radius: 2px;
  position: relative;
}
.machine-icon i::after { content: ""; position: absolute; width: 2px; height: 2px; top: 1px; left: 2px; background: var(--mint); }
.card-title { display: flex; flex-direction: column; flex: 1; min-width: 0; gap: 3px; }
.card-title strong { font-size: 16px; overflow-wrap: anywhere; }
.card-title > span { font-size: 11px; color: var(--muted); }
.card-title > span:empty { display: none; }
.badge { display: inline-flex; align-items: center; gap: 5px; border-radius: 20px; padding: 4px 7px; font-size: 11px; color: var(--muted); background: #283433; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; }
.server-card[data-state="online"] .badge { color: var(--mint); background: #244239; }
.server-card[data-state="failed"] .badge { color: var(--amber); background: #43352d; }
.server-card[data-state="failed"] .card-meters,
.server-card[data-state="waiting"] .card-meters { opacity: .72; }
.card-meters { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 19px 0 16px; }
.meter { display: flex; min-width: 0; flex-direction: column; gap: 6px; }
.meter-label { display: flex; justify-content: space-between; align-items: baseline; gap: 2px; font-size: 11px; color: var(--muted); }
.meter-label span:nth-child(2) { font-family: var(--mono); color: #e3ecea; font-size: 10px; }
.meter-track { display: block; height: 4px; border-radius: 8px; overflow: hidden; background: #354342; }
.meter-track > span { display: block; height: 100%; background: var(--mint); border-radius: inherit; width: 0; }
.meter-track [data-bar="memory"] { background: var(--blue); }
.meter-track [data-bar="disk"] { background: var(--amber); }
.meter-detail { color: var(--muted); font: 10px/1.3 var(--mono); overflow-wrap: anywhere; }
.card-network, .card-footer { display: flex; align-items: baseline; gap: 10px; }
.card-network { font: 11px var(--mono); gap: 16px; margin-bottom: 13px; }
.download { color: var(--mint); }
.upload { color: var(--blue); }
.card-footer {
  margin-top: auto;
  padding-top: 11px;
  border-top: 1px solid var(--line);
  width: 100%;
  justify-content: space-between;
  flex-wrap: wrap;
  font-size: 11px;
  color: var(--muted);
}

.history { margin-top: 19px; padding: 18px 20px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); }
.history-head p { margin-top: 4px; }
.history-toolbar { margin-top: 14px; }
.segmented { display: inline-flex; padding: 3px; gap: 2px; background: #101719; border: 1px solid var(--line); border-radius: 8px; }
.segmented button { padding: 5px 9px; font-size: 11px; white-space: nowrap; border: 0; border-radius: 5px; background: transparent; color: var(--muted); cursor: pointer; }
.segmented button:hover { color: #f0f8f5; }
.segmented button[aria-pressed="true"] { background: #293c36; color: #e2fff3; }
#chart-value { color: var(--muted); text-align: right; font: 11px/1.4 var(--mono); min-width: 0; }
.chart { position: relative; height: 174px; margin: 10px 0 0; }
.chart canvas { display: block; width: 100%; height: 100%; }
.chart-empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 13px; pointer-events: none; padding: 12px; text-align: center; }
footer { padding: 13px 0 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.public-current { display: grid; justify-items: end; gap: 7px; }
.public-current p { font: 11px var(--mono); color: var(--muted); }
.public-summary { background: linear-gradient(105deg, #1c2d29, #171f21 68%); }
.public-key { display: flex; align-items: center; gap: 11px; color: var(--muted); font-size: 11px; }
.public-key span { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.public-key i { width: 7px; height: 7px; border-radius: 2px; }
.public-card { cursor: default; }
.public-card:hover { border-color: var(--line); }
.public-card[data-selected="true"] { border-color: #629b87; background: #192624; }
.public-card .card-meters { margin-bottom: 12px; }
.public-meta, .public-uptime-label { display: flex; align-items: baseline; justify-content: space-between; gap: 7px; }
.public-meta { min-height: 28px; flex-wrap: wrap; color: var(--muted); font-size: 11px; }
.public-meta .traffic { font-family: var(--mono); color: #a8c9c2; white-space: nowrap; }
.public-uptime { width: 100%; margin: 0 0 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.public-uptime-label { margin-bottom: 7px; color: var(--muted); font-size: 11px; }
.public-uptime-label .success-rate { color: #d7ebe5; font-family: var(--mono); }
.public-hours { display: grid; grid-template-columns: repeat(24, minmax(0, 1fr)); gap: 3px; }
.public-hours span { height: 12px; border-radius: 2px; }
.public-hours span:hover { filter: brightness(1.35); }
.public-key [data-state="ok"], .public-hours [data-state="ok"] { background: #60bd9c; }
.public-key [data-state="mixed"], .public-hours [data-state="mixed"] { background: #d79b61; }
.public-key [data-state="none"], .public-hours [data-state="none"] { background: #354342; }
.public-view { margin-top: auto; width: 100%; display: flex; justify-content: space-between; border: 1px solid var(--line); background: #172020; padding: 7px 9px; border-radius: 7px; color: #c7d9d4; cursor: pointer; font-size: 11px; }
.public-view:hover, .public-view[aria-pressed="true"] { background: #284139; border-color: #45685d; color: #e2fff3; }
.public-chart { height: 202px; }
#chart-label { color: var(--muted); font: 11px/1.4 var(--mono); text-align: right; }

@media (max-width: 840px) {
  .shell { padding: 32px 24px 20px; }
  .server-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 550px) {
  .shell { padding: 22px 15px 17px; }
  .brand { gap: 10px; }
  h1 { font-size: 24px; }
  .brand p { font-size: 11px; }
  .mark { width: 37px; height: 37px; padding-bottom: 6px; border-radius: 9px; }
  .masthead { gap: 8px; }
  .masthead-actions { gap: 5px; }
  .connection { gap: 5px; padding-inline: 7px; font-size: 10px; min-height: 33px; }
  .refresh { min-height: 33px; width: 33px; }
  .summary { margin-top: 20px; }
  .summary > div { padding: 10px 8px; }
  .summary p { font-size: 10px; }
  .summary strong { font-size: 19px; }
  .summary span { font-size: 9px; }
  .servers { margin-top: 19px; }
  .server-grid { grid-template-columns: 1fr; }
  .history { padding: 13px 10px 8px; }
  .history-head, .history-toolbar { gap: 6px; }
  .segmented button { padding: 5px 7px; }
  #chart-value { font-size: 10px; }
  .public-current p { font-size: 9px; }
  .public-hours { gap: 2px; }
  .public-chart { height: 172px; }
  #chart-label { font-size: 9px; }
}
