:root {
  --ink: #16201c;
  --muted: #63716b;
  --line: #dce5df;
  --panel: #ffffff;
  --soft: #f4f7f3;
  --rail: #121b17;
  --green: #187a58;
  --amber: #b7791f;
  --red: #b63d3d;
  --shadow: 0 18px 42px rgba(18, 27, 23, .1);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: #eef2ed;
  color: var(--ink);
  font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
}
button,
input { font: inherit; }
button { cursor: pointer; }

.health-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}
.health-rail {
  position: sticky;
  top: 0;
  height: 100vh;
  display: grid;
  grid-template-rows: auto auto auto 1fr;
  gap: 18px;
  padding: 18px;
  background: var(--rail);
  color: #fff;
}
.brand,
.health-rail nav a {
  color: #fff;
  text-decoration: none;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand span {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: #edf8f2;
  color: var(--green);
  font-weight: 950;
}
.health-rail nav {
  display: grid;
  gap: 8px;
}
.health-rail nav a {
  min-height: 40px;
  display: flex;
  align-items: center;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 8px;
  padding: 0 12px;
  color: rgba(255,255,255,.76);
}
.health-rail nav a:hover {
  background: rgba(255,255,255,.08);
  color: #fff;
}
.rail-card {
  display: grid;
  gap: 10px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 8px;
  background: rgba(255,255,255,.07);
  padding: 14px;
}
.rail-card span {
  color: rgba(255,255,255,.66);
  font-size: 12px;
  font-weight: 850;
}
.rail-card input {
  width: 100%;
  min-height: 38px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 8px;
  background: rgba(255,255,255,.10);
  color: #fff;
  padding: 0 10px;
}
.rail-card button,
.section-head button {
  min-height: 38px;
  border: 1px solid #edf8f2;
  border-radius: 8px;
  background: #edf8f2;
  color: var(--rail);
  font-weight: 850;
}

.health-main {
  display: grid;
  gap: 16px;
  padding: 18px;
}
.hero,
.surface,
.probe-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,.94);
  box-shadow: var(--shadow);
}
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 18px;
  align-items: stretch;
  padding: 22px;
}
.hero span,
.score-card span,
.section-head span,
.probe-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0;
}
.hero h1 {
  margin: 6px 0 10px;
  font-size: clamp(30px, 4vw, 54px);
  line-height: 1;
  letter-spacing: 0;
}
.hero p {
  max-width: 780px;
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}
.score-card {
  display: grid;
  align-content: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  padding: 16px;
}
.score-card b {
  font-size: 42px;
}
.score-card small {
  color: var(--muted);
  font-weight: 800;
}
.probe-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.probe-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  min-height: 142px;
  padding: 14px;
}
.probe-card h2 {
  margin: 6px 0 8px;
  font-size: 18px;
}
.probe-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.probe-card b {
  align-self: start;
  border-radius: 999px;
  padding: 6px 10px;
  background: #e7f2ed;
  color: var(--green);
  font-size: 12px;
}
.probe-card.fail b {
  background: #fff1d9;
  color: var(--amber);
}
.history-list {
  display: grid;
  gap: 10px;
  padding: 14px;
}
.history-item,
.history-empty {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  padding: 12px;
}
.history-empty {
  grid-template-columns: 1fr;
  color: var(--muted);
  font-weight: 800;
}
.history-item span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}
.history-item b,
.history-item p {
  display: block;
  margin: 6px 0 0;
}
.history-item p {
  color: var(--muted);
}
.history-item strong {
  border-radius: 999px;
  padding: 6px 10px;
  background: #e7f2ed;
  color: var(--green);
  font-size: 12px;
}
.history-item.check strong {
  background: #fff1d9;
  color: var(--amber);
}
.split {
  display: grid;
  grid-template-columns: minmax(0, .95fr) minmax(360px, 1.05fr);
  overflow: hidden;
}
.split > div:first-child {
  border-right: 1px solid var(--line);
}
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 62px;
  border-bottom: 1px solid var(--line);
  padding: 0 16px;
}
.section-head h2 {
  margin: 0;
}
.script-list {
  display: grid;
  gap: 10px;
  padding: 14px;
}
.script-list article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  padding: 12px;
}
.script-list p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.45;
}
pre {
  min-height: 460px;
  max-height: 70vh;
  margin: 0;
  overflow: auto;
  padding: 14px;
  background: #101815;
  color: #d7f7e6;
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

@media (max-width: 1080px) {
  .health-shell { grid-template-columns: 1fr; }
  .health-rail {
    position: relative;
    height: auto;
  }
  .probe-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .hero,
  .split {
    grid-template-columns: 1fr;
  }
  .split > div:first-child {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 640px) {
  .health-main,
  .health-rail {
    padding: 12px;
  }
  .probe-grid {
    grid-template-columns: 1fr;
  }
  .probe-card {
    grid-template-columns: 1fr;
  }
}
