:root {
  color-scheme: dark;
  --bg: #080e16;
  --panel: #101b28;
  --line: #283648;
  --dim: #9aabc0;
  --text: #eff5fc;
  --mint: #58e3cd;
  --blue: #89a6ff;
  --amber: #ffce78;
  --bad: #ff929d;
  --mono: Consolas, "SFMono-Regular", "Microsoft YaHei", monospace;
  font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: var(--bg);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(ellipse at 74% 0%, #122337 0, transparent 42%), var(--bg);
}
a {
  color: inherit;
  text-decoration: none;
}
h1,
h2,
h3,
p {
  margin: 0;
}
[hidden] {
  display: none !important;
}
.shell {
  width: min(1240px, calc(100% - 64px));
  margin: auto;
}
header {
  border-bottom: 1px solid var(--line);
  background: #0a121d;
}
.top,
.brand,
nav,
.heading,
.strip,
.panel-title,
.strategy-head,
.legend-row {
  display: flex;
  align-items: center;
}
.top {
  min-height: 64px;
  gap: 48px;
}
.brand {
  gap: 10px;
  font-weight: 750;
  font-size: 22px;
  letter-spacing: -0.04em;
}
.brand i {
  width: 27px;
  height: 27px;
  border: 1px solid #5ce2c9;
  border-radius: 7px;
  background: linear-gradient(135deg, #275f5c, #142735);
  display: grid;
  place-items: center;
}
.brand i:after {
  content: "";
  width: 14px;
  height: 13px;
  background: var(--mint);
  clip-path: polygon(
    0 86%,
    26% 46%,
    46% 65%,
    78% 13%,
    100% 13%,
    100% 35%,
    84% 35%,
    49% 91%,
    28% 72%,
    12% 100%
  );
}
nav {
  gap: 24px;
  color: var(--dim);
  font-size: 0.9rem;
}
nav a:hover,
nav a:focus-visible {
  color: var(--mint);
}
.mode {
  margin-left: auto;
  padding: 5px 11px;
  border: 1px solid #3b5265;
  border-radius: 5px;
  font-size: 0.82rem;
  color: #bed1df;
}
.heading {
  justify-content: space-between;
  gap: 24px;
  padding: 35px 0 24px;
}
.heading h1 {
  font-size: clamp(1.85rem, 3vw, 2.65rem);
  letter-spacing: -0.04em;
  line-height: 1.3;
}
.heading p,
.clock > span,
small,
.panel-title > span,
.strip,
.strategy-data span,
.legend-row small {
  color: var(--dim);
}
.heading p {
  margin-top: 7px;
}
.clock {
  text-align: right;
}
.clock > span,
.panel-title > span,
small {
  font-size: 0.85rem;
}
.clock time {
  display: block;
  font: 1.02rem var(--mono);
  margin-top: 7px;
}
.strip {
  gap: 20px;
  flex-wrap: wrap;
  background: #101d2a;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 0.85rem;
}
.strip strong {
  color: var(--mint);
}
.strip strong:before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  background: currentColor;
  border-radius: 50%;
  margin-right: 8px;
}
.strip time,
.strip b {
  font: inherit;
  color: #d9e4f1;
  margin-left: 4px;
}
.metrics,
.layout,
.checks {
  display: grid;
  gap: 15px;
}
.metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 18px 0;
}
.metrics article,
.panel {
  background: linear-gradient(125deg, #132030, #0d1723);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.metrics article {
  padding: 18px 21px;
}
.metrics h2 {
  font-size: 0.95rem;
  font-weight: 550;
  color: var(--dim);
}
.metrics strong {
  display: block;
  font: 600 clamp(1.5rem, 2.6vw, 2.2rem) var(--mono);
  letter-spacing: -0.05em;
  margin: 10px 0 7px;
  overflow-wrap: anywhere;
}
.good {
  color: var(--mint) !important;
}
.warn {
  color: var(--amber) !important;
}
.bad {
  color: var(--bad) !important;
}
.layout {
  grid-template-columns: minmax(0, 1.75fr) minmax(280px, 1fr);
  margin-bottom: 16px;
}
.panel {
  min-width: 0;
  padding: 20px 22px;
}
.panel-title {
  gap: 15px;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding-bottom: 13px;
}
.panel-title h2 {
  font-size: 1.18rem;
}
.rows > p {
  margin-top: 18px;
  color: var(--dim);
}
.strategy {
  padding: 16px 0;
}
.strategy:last-child {
  padding-bottom: 0;
}
.strategy + .strategy {
  border-top: 1px solid var(--line);
}
.strategy-head {
  gap: 10px;
  flex-wrap: wrap;
}
.key {
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 5px;
  min-width: 24px;
  padding: 2px 5px;
  text-align: center;
  font: 700 0.85rem var(--mono);
}
.strategy h3 {
  font-size: 1rem;
}
.code {
  font: 0.76rem var(--mono);
  color: var(--dim);
}
.state {
  margin-left: auto;
  background: #1b2a3b;
  border-radius: 5px;
  padding: 3px 8px;
  font-size: 0.81rem;
}
.strategy-data {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin: 14px 0;
  gap: 8px;
}
.strategy-data span {
  display: block;
  font-size: 0.82rem;
  margin-bottom: 4px;
}
.strategy-data b,
.legend-row b,
.amount {
  font: 500 1rem var(--mono);
}
.progress {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.83rem;
  color: var(--dim);
}
.segments {
  display: flex;
  gap: 4px;
  flex: 1;
}
.segments i {
  height: 5px;
  background: #2c3b4e;
  border-radius: 2px;
  flex: 1;
}
.segments .filled {
  background: var(--accent);
}
.allocation {
  padding-top: 20px;
}
.ring {
  width: min(158px, 55%);
  aspect-ratio: 1;
  border-radius: 50%;
  margin: 0 auto 14px;
  display: grid;
  place-items: center;
}
.ring-core {
  width: 80%;
  height: 80%;
  border-radius: 50%;
  background: #101c2a;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
}
.ring-core b {
  font: 600 1.5rem var(--mono);
}
.legend-row {
  display: grid;
  grid-template-columns: 10px 1fr auto auto;
  gap: 9px;
  padding: 7px 0;
  font-size: 0.9rem;
}
.legend-row i {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--accent);
}
.legend-row small {
  min-width: 4em;
  text-align: right;
}
.checks {
  grid-template-columns: repeat(4, 1fr);
  padding: 16px 0;
}
.check {
  display: grid;
  gap: 7px;
}
.check span {
  color: var(--dim);
  font-size: 0.85rem;
}
.check strong {
  font-weight: 550;
  font-size: 1rem;
}
#reconcile {
  border-top: 1px solid var(--line);
  padding-top: 10px;
  font-size: 0.88rem;
  color: #bfcede;
  line-height: 1.8;
}
#reconcile:empty {
  display: none;
}
#broker {
  margin-bottom: 32px;
}
#error {
  color: var(--amber);
  padding: 10px 0;
  overflow-wrap: anywhere;
}
@media (max-width: 900px) {
  .shell {
    width: calc(100% - 36px);
  }
  .layout {
    grid-template-columns: minmax(0, 1.55fr) minmax(220px, 1fr);
  }
  .panel {
    padding: 16px;
  }
  .strip {
    gap: 8px 14px;
  }
  .code {
    display: none;
  }
  .metrics article {
    padding: 14px;
  }
  .metrics {
    gap: 10px;
  }
}
@media (max-width: 700px) {
  .shell {
    width: calc(100% - 28px);
  }
  .top {
    min-height: 54px;
    gap: 16px;
  }
  nav {
    display: none;
  }
  .heading {
    padding: 24px 0 16px;
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
  }
  .clock {
    display: flex;
    align-items: center;
    gap: 10px;
    text-align: left;
  }
  .clock time {
    margin: 0;
    font-size: 0.92rem;
  }
  .strip {
    display: grid;
    gap: 7px;
  }
  .metrics,
  .checks {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .layout {
    grid-template-columns: 1fr;
  }
  .strategy-data {
    grid-template-columns: repeat(2, 1fr);
  }
  .checks {
    row-gap: 16px;
  }
  .legend-row small {
    min-width: 3.5em;
  }
}
.auth-wrap {
  display: grid;
  place-items: start center;
  padding: clamp(40px, 10vh, 110px) 16px;
}
.auth-panel { width: min(100%, 400px); padding: 30px; }
.auth-panel h1 { font-size: 1.65rem; }
.auth-note { color: var(--dim); line-height: 1.6; margin: 8px 0 20px; }
.auth-panel label { display: grid; gap: 7px; margin-bottom: 14px; }
.auth-panel input {
  width: 100%; font: inherit; color: var(--text); background: #0b1420;
  border: 1px solid #45566c; border-radius: 5px; padding: 10px;
}
.auth-panel input:read-only { color: var(--dim); }
.auth-panel input:focus-visible { outline: 2px solid var(--mint); outline-offset: 1px; }
.auth-panel .primary {
  font: inherit; font-weight: 650; color: #0a2725; background: var(--mint);
  border: 0; border-radius: 5px; width: 100%; margin: 4px 0 10px; padding: 10px; cursor: pointer;
}
.auth-message { color: var(--amber); margin: 12px 0; }
.auth-panel a { color: var(--mint); }
.account-actions { display: flex; gap: 12px; align-items: center; font-size: .88rem; white-space: nowrap; }
.account-actions button { background: transparent; color: var(--dim); font: inherit; border: 0; cursor: pointer; padding: 0; }
@media (max-width: 480px) { .top { flex-wrap: wrap; padding-block: 9px; } }
