:root {
  color-scheme: light;
  font-family: "Segoe UI", "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  color: #102b32;
  background: #eef3f2;
  --accent: #056657;
  --muted: #506a6e;
  --line: #d6e3e0;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
.header { background: #11313a; color: #f0f8f5; }
.header-inner, main { max-width: 1280px; margin: auto; padding-inline: clamp(16px, 4vw, 48px); }
.header-inner { height: 66px; display: flex; justify-content: space-between; align-items: center; }
.header small { color: #afc8c7; }
.brand { font-weight: 750; letter-spacing: .08em; }
.brand span { color: #9befc5; font-size: 1.6rem; vertical-align: -.12em; }
main { padding-bottom: 48px; }
.intro { margin-block: 35px 26px; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(1.9rem, 3.6vw, 2.8rem); letter-spacing: -.045em; }
h2 { font-size: 1.2rem; }
.intro p, #status { margin-top: 10px; color: var(--muted); }
.workspace { display: grid; grid-template-columns: minmax(300px, 370px) minmax(0, 1fr); gap: 22px; align-items: start; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 24px; box-shadow: 0 8px 26px #17332f08; }
fieldset { margin: 0 0 20px; padding: 12px 0 0; border: 0; min-width: 0; }
fieldset + fieldset { border-top: 1px solid var(--line); }
legend { padding: 0 8px 0 0; font-size: .99rem; font-weight: 720; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.parameters { margin-top: 11px; }
.parameters:empty { display: none; }
label { display: grid; gap: 6px; color: #405961; font-size: .81rem; font-weight: 640; min-width: 0; }
input, select, button { font: inherit; }
input, select { width: 100%; min-width: 0; min-height: 39px; color: #102b32; background: #f8fbfa; border: 1px solid #cbdbd8; border-radius: 7px; padding: 7px 9px; }
:focus-visible { outline: 3px solid #50aa90; outline-offset: 1px; }
details { margin-top: 12px; color: var(--muted); font-size: .8rem; }
summary { cursor: pointer; }
.upload { margin-top: 8px; }
.hint { color: var(--muted); font-size: .8rem; line-height: 1.5; margin: 7px 0; }
button { min-height: 45px; color: #fff; width: 100%; background: var(--accent); border: 0; border-radius: 9px; font-weight: 700; padding: 10px 14px; text-align: left; cursor: pointer; }
button span { float: right; }
button:hover { background: #084f46; }
button:disabled { opacity: .65; cursor: wait; }
.result { display: grid; gap: 20px; }
.chart-panel { min-width: 0; }
#status { font-size: .87rem; line-height: 1.5; }
#status.error, .negative { color: #a13536; }
.positive { color: var(--accent); }
.empty { min-height: 300px; margin-block: 20px; border: 1px dashed #b9d1ca; border-radius: 12px; display: grid; place-content: center; text-align: center; color: var(--muted); background: #f7fbf9; font-size: .9rem; }
.empty span { font-size: 4rem; line-height: 1.1; color: #459482; }
.method { color: var(--muted); font-size: .78rem; line-height: 1.65; padding-top: 12px; border-top: 1px solid var(--line); }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-block: 18px; }
.metrics div { border-radius: 9px; background: #eef6f3; padding: 10px; }
.metrics span { display: block; color: var(--muted); font-size: .75rem; }
.metrics strong { display: block; font-size: clamp(.96rem, 1.65vw, 1.35rem); font-variant-numeric: tabular-nums; margin-top: 4px; overflow-wrap: anywhere; }
.legend { display: flex; gap: 16px; color: var(--muted); font-size: .8rem; }
.legend span::before { content: ""; display: inline-block; width: 16px; border-top: 3px solid #16826d; margin-right: 6px; vertical-align: middle; }
.legend span + span::before { border-top: 2px dashed #697caa; }
canvas { display: block; width: 100%; height: 270px; margin-top: 5px; }
#point { min-height: 1.2em; }
.order-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
#trade-count { color: var(--muted); font-size: .83rem; }
.table-scroll { overflow: auto; max-height: 350px; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: .84rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
th, td { border-bottom: 1px solid var(--line); padding: 8px; }
th { position: sticky; top: 0; background: #eef6f3; }
@media (max-width: 820px) {
  .workspace { grid-template-columns: minmax(0, 1fr); }
  .panel { padding: 17px; }
  .intro { margin-block: 24px 18px; }
}
@media (max-width: 490px) {
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
