:root {
  color-scheme: light;
  --bg: #f6f8fb;
  --panel: #ffffff;
  --text: #172033;
  --muted: #667085;
  --line: #d9e0ea;
  --brand: #176b87;
  --brand-dark: #0f4c61;
  --danger: #b42318;
  --ok: #067647;
  --warn: #b54708;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
.layout { min-height: 100vh; display: grid; grid-template-columns: 220px 1fr; }
.sidebar { background: #10212b; color: #eaf2f6; padding: 22px 16px; }
.brand { font-weight: 700; font-size: 18px; margin-bottom: 24px; }
.nav { display: grid; gap: 6px; }
.nav a, .nav button {
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
  color: #eaf2f6;
  padding: 10px 12px;
  border-radius: 6px;
  text-align: left;
  font: inherit;
  cursor: pointer;
}
.nav a:hover, .nav button:hover { background: #183543; text-decoration: none; }
.main { padding: 26px; }
.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; gap: 16px; }
.title h1 { margin: 0; font-size: 26px; }
.title p { margin: 6px 0 0; color: var(--muted); }
.band, .table-wrap {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  margin-bottom: 18px;
}
.grid { display: grid; gap: 14px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.metric { background: #eef7f8; border: 1px solid #cde5ea; border-radius: 8px; padding: 14px; }
.metric b { display: block; font-size: 26px; margin-top: 6px; }
label { display: block; font-weight: 600; margin-bottom: 6px; }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 11px;
  font: inherit;
  background: #fff;
}
textarea { min-height: 110px; resize: vertical; }
.help { color: var(--muted); font-size: 13px; margin-top: 5px; }
.actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 14px; }
.btn, button {
  border: 1px solid var(--brand);
  background: var(--brand);
  color: #fff;
  border-radius: 6px;
  padding: 9px 12px;
  font: inherit;
  cursor: pointer;
  min-height: 38px;
}
.btn.secondary, button.secondary { background: #fff; color: var(--brand); }
.btn.danger, button.danger { background: var(--danger); border-color: var(--danger); }
.btn:hover { text-decoration: none; background: var(--brand-dark); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; border-bottom: 1px solid var(--line); padding: 10px 8px; vertical-align: top; }
th { color: var(--muted); font-weight: 700; background: #fbfcfe; }
.badge { display: inline-block; padding: 3px 8px; border-radius: 999px; background: #edf1f5; color: #334155; font-size: 13px; }
.badge.high { background: #fee4e2; color: var(--danger); }
.badge.medium { background: #fef0c7; color: var(--warn); }
.badge.low { background: #e7f7ef; color: var(--ok); }
.message { padding: 10px 12px; border-radius: 6px; margin-bottom: 14px; background: #ecfdf3; color: var(--ok); border: 1px solid #abefc6; }
.error { padding: 10px 12px; border-radius: 6px; margin-bottom: 14px; background: #fef3f2; color: var(--danger); border: 1px solid #fecdca; }
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-box { width: min(430px, 100%); background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 28px; }
.login-box h1 { margin-top: 0; }
.muted { color: var(--muted); }
pre.result { white-space: pre-wrap; background: #0f172a; color: #e2e8f0; padding: 14px; border-radius: 8px; overflow: auto; }
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .grid.two, .grid.four { grid-template-columns: 1fr; }
  .main { padding: 16px; }
}
