:root {
  --ink: #172631;
  --mute: #516572;
  --line: #ccd5d9;
  --paper: #f4f6f6;
  --gold: #916416;
  --cream: #f7ecd5;
  font:
    16px/1.55 "Source Sans 3",
    "Microsoft YaHei",
    "PingFang SC",
    sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-variant-numeric: tabular-nums;
}
* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
body {
  margin: 0;
}
button,
select,
input,
a {
  font: inherit;
  color: inherit;
}
.headerLink,
nav a {
  color: inherit;
  text-decoration: none;
}
.headerLink {
  font-size: 14px;
  color: #dec18d;
}
nav a,
nav span {
  padding: 10px 4px;
}
nav [aria-current="page"] {
  font-weight: 700;
  border-bottom: 3px solid var(--gold);
}
.settingsIntro {
  border-left: 3px solid var(--gold);
}
.settingsIntro p + p {
  margin-top: 8px;
}
.settingsFields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 16px;
  margin: 16px 0;
}
.settingsFields label small {
  color: var(--mute);
  font-weight: 400;
}
#modelForm > .panel label + label {
  margin-top: 12px;
}
.manualModel {
  margin-top: 12px;
}
.settingsActions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
#formStatus {
  min-height: 24px;
  margin-top: 8px;
}
button,
select,
input {
  min-height: 44px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 5px;
  padding: 6px 12px;
}
button {
  cursor: pointer;
}
button:hover:not(:disabled) {
  border-color: var(--gold);
}
button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
:focus-visible {
  outline: 3px solid #b07b20;
  outline-offset: 2px;
}
header {
  background: var(--ink);
  color: #edf1f1;
}
.bar,
main,
footer {
  max-width: 1180px;
  margin: auto;
  padding: 0 16px;
}
.bar,
.heading,
.sectionHead,
footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
header .bar {
  height: 60px;
}
header span {
  font-size: 12px;
  color: #cad5d9;
}
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 21px;
}
.brand i {
  background: #e4bb6e;
  color: var(--ink);
  width: 30px;
  height: 30px;
  text-align: center;
  font-size: 21px;
  border-radius: 5px;
}
.brand small,
.assets small,
.meta,
.muted,
footer {
  font-size: 13px;
  color: var(--mute);
}
.brand small {
  font:
    11px "IBM Plex Mono",
    monospace;
  letter-spacing: 0.1em;
  color: #dec18d;
}
nav {
  background: #fff;
  border-bottom: 1px solid var(--line);
}
nav .bar {
  justify-content: flex-start;
  gap: 14px;
}
nav button {
  border: 0;
  border-radius: 0;
  background: transparent;
  border-bottom: 3px solid transparent;
  padding: 8px 4px;
}
nav button[aria-pressed="true"] {
  border-bottom-color: var(--gold);
  font-weight: 700;
}
main {
  min-height: 72vh;
}
.heading {
  padding: 18px 0 12px;
}
h1,
h2,
p {
  margin: 0;
}
h1 {
  font-size: clamp(24px, 4vw, 34px);
  letter-spacing: -0.04em;
}
h2 {
  font-size: 18px;
  line-height: 1.4;
}
h2 small {
  font: 13px monospace;
  color: var(--mute);
}
.assets {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 14px;
  gap: 5px;
}
.assets button {
  text-align: left;
  padding: 10px 6px;
  background: transparent;
}
.assets b,
.assets small {
  display: block;
}
.assets b {
  font-size: 14px;
}
.assets small {
  font: 11px/1.8 monospace;
}
.assets button[aria-pressed="true"] {
  background: var(--ink);
  color: #f2f5f5;
  border-color: var(--ink);
}
.assets button[aria-pressed="true"] small {
  color: #dfc28e;
}
.panel {
  min-width: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 14px;
}
.value {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-top: 8px;
}
.value strong,
.balances strong {
  font-family: "IBM Plex Mono", Consolas, monospace;
}
.value strong {
  font-size: clamp(36px, 6vw, 54px);
  letter-spacing: -0.055em;
  line-height: 1.2;
}
.value span {
  color: var(--mute);
  font-size: 14px;
}
.seg {
  display: inline-flex;
  margin: 12px 0;
  border: 1px solid var(--line);
  border-radius: 5px;
  overflow: hidden;
}
.seg button {
  min-width: 44px;
  border: 0;
  border-radius: 0;
}
.seg button[aria-pressed="true"] {
  background: var(--cream);
  color: #60400a;
  font-weight: 700;
}
#plot {
  position: relative;
  height: 235px;
  touch-action: pan-y;
}
canvas {
  width: 100%;
  height: 100%;
  display: block;
}
#plotState {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  text-align: center;
  background: var(--paper);
  color: var(--mute);
  padding: 20px;
}
output {
  display: block;
  font-family: Consolas, "Microsoft YaHei", monospace;
  font-size: 14px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.meta,
.muted {
  margin-top: 8px;
  overflow-wrap: anywhere;
}
.sectionHead {
  margin-bottom: 8px;
}
.sectionHead button,
.heading button,
.textButton {
  font-size: 13px;
}
.textButton {
  color: #72500d;
  margin-top: 10px;
}
.alert:not(:empty) {
  padding: 10px;
  background: var(--cream);
  font-size: 14px;
  margin-top: 12px;
}
.item {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  overflow-wrap: anywhere;
}
.item:last-child {
  border: 0;
}
.item b {
  margin-right: 10px;
}
.item p {
  margin-top: 4px;
}
.item a {
  color: var(--ink);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}
.tag {
  color: var(--gold);
  font-size: 13px;
}
#report,
#evidence,
#recap {
  margin-top: 12px;
}
ul {
  padding-left: 20px;
}
.balances,
form {
  display: grid;
  gap: 12px;
  margin: 16px 0;
}
.balances {
  grid-template-columns: 1fr 1fr;
  color: var(--mute);
  font-size: 13px;
}
.balances strong {
  display: block;
  font-size: clamp(19px, 4vw, 30px);
  color: var(--ink);
}
label {
  display: grid;
  gap: 4px;
  font-size: 14px;
}
input,
select {
  min-width: 0;
  width: 100%;
}
.primary {
  background: var(--ink);
  color: white;
}
.bad {
  color: #93432e;
}
footer {
  border-top: 1px solid var(--line);
  padding-top: 18px;
  padding-bottom: 24px;
  margin-top: 24px;
}
#report {
  white-space: pre-line;
}
[aria-pressed="true"]#follow {
  background: var(--cream);
}
@media (min-width: 760px) {
  .bar,
  main,
  footer {
    padding-left: 32px;
    padding-right: 32px;
  }
  .layout {
    display: grid;
    grid-template-columns: minmax(0, 1.8fr) minmax(260px, 1fr);
    gap: 16px;
  }
  .panel {
    padding: 24px;
  }
  .assets {
    gap: 10px;
  }
  .assets button {
    padding: 12px 18px;
  }
  .heading {
    padding: 26px 0 18px;
  }
  #plot {
    height: 310px;
  }
  form {
    grid-template-columns: 2fr 1fr 1fr auto;
    align-items: end;
  }
}
