:root {
  --ink: #18201d;
  --muted: #64716b;
  --line: #dfe6df;
  --panel: #ffffff;
  --soft: #f4f7f2;
  --rail: #15201b;
  --green: #187a58;
  --amber: #b7791f;
  --red: #b63d3d;
  --shadow: 0 18px 44px rgba(24, 32, 29, .10);
}

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

.host-shell {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  min-height: 100vh;
}
.host-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 18px;
  background: var(--rail);
  color: #fff;
  padding: 18px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  text-decoration: none;
}
.brand span {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: #edf8f2;
  color: var(--green);
  font-weight: 950;
}
.host-nav {
  display: grid;
  align-content: start;
  gap: 8px;
}
.host-nav button {
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: rgba(255,255,255,.74);
  padding: 0 12px;
  text-align: left;
}
.host-nav-link {
  display: flex;
  align-items: center;
  min-height: 42px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 8px;
  background: rgba(255,255,255,.08);
  color: #fff;
  padding: 0 12px;
  text-decoration: none;
}
.host-nav button.active,
.host-nav button:hover {
  border-color: rgba(255,255,255,.16);
  background: rgba(255,255,255,.08);
  color: #fff;
}
.side-note {
  display: grid;
  gap: 8px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 8px;
  background: rgba(255,255,255,.07);
  padding: 14px;
}
.side-note span,
.host-hero span,
.kernel-card span,
.section-head span,
.agent-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0;
}
.side-note span { color: rgba(255,255,255,.58); }
.side-note b { font-size: 24px; }
.side-note p { margin: 0; color: rgba(255,255,255,.68); line-height: 1.5; }

.host-main {
  display: grid;
  gap: 16px;
  padding: 18px;
}
.host-hero,
.surface,
.kernel-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,.92);
  box-shadow: var(--shadow);
}
.host-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
  min-height: 220px;
  padding: 24px;
}
.host-hero h1 {
  max-width: 900px;
  margin: 6px 0 10px;
  font-size: clamp(30px, 4vw, 58px);
  line-height: 1.02;
  letter-spacing: 0;
}
.host-hero p {
  max-width: 780px;
  margin: 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.55;
}
.hero-stack {
  display: grid;
  gap: 10px;
}
.hero-stack article {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  padding: 14px;
}
.hero-stack b { font-size: 34px; }
.kernel-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 16px;
}
.kernel-card {
  display: grid;
  gap: 8px;
  min-height: 150px;
  padding: 16px;
}
.kernel-card.primary {
  background: #edf8f2;
  border-color: rgba(24, 122, 88, .22);
}
.kernel-card h2,
.section-head h2,
.agent-card h3 {
  margin: 0;
  letter-spacing: 0;
}
.kernel-card p,
.agent-card p,
.tool-list p,
.policy-list p,
.audit-list p,
.runbook p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}
.surface { overflow: hidden; }
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 66px;
  border-bottom: 1px solid var(--line);
  padding: 0 16px;
}
.section-head.compact { min-height: 58px; }
.section-head button {
  min-height: 38px;
  border: 1px solid #17211e;
  border-radius: 8px;
  background: #17211e;
  color: #fff;
  padding: 0 14px;
}
.agent-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 14px;
}
.agent-card {
  display: grid;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  padding: 14px;
}
.status {
  width: fit-content;
  border-radius: 999px;
  padding: 5px 9px;
  background: #e1f2eb;
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
}
.status.watch { background: #fff1d9; color: var(--amber); }
.status.danger { background: #ffe1df; color: var(--red); }
.agent-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.agent-meta small {
  color: var(--muted);
  font-weight: 800;
}
.split {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, .9fr);
}
.split > div:first-child { border-right: 1px solid var(--line); }
.tool-list,
.policy-list,
.runbook,
.audit-list {
  display: grid;
  gap: 10px;
  padding: 14px;
}
.tool-list article,
.policy-list article,
.runbook article,
.audit-list article {
  display: grid;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  padding: 12px;
}
.runbook article {
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
}
.runbook i {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--rail);
  color: #fff;
  font-style: normal;
  font-weight: 900;
}
.audit-list article {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
}
.audit-list time {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

@media (max-width: 1040px) {
  .host-shell { grid-template-columns: 1fr; }
  .host-sidebar {
    position: static;
    height: auto;
    grid-template-rows: auto auto;
  }
  .side-note { display: none; }
  .host-nav { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .host-hero,
  .kernel-grid,
  .split,
  .agent-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .host-main { padding: 12px; }
  .host-sidebar { padding: 12px; }
  .host-nav { grid-template-columns: 1fr 1fr; }
  .host-hero { padding: 18px; }
  .host-hero h1 { font-size: 32px; }
  .runbook article,
  .audit-list article { grid-template-columns: 1fr; }
}
