:root {
  color-scheme: dark;
  --bg: #111318;
  --surface: #191c23;
  --raised: #20242d;
  --border: #303642;
  --text: #ebedf4;
  --muted: #a5adbd;
  --accent: #aebcff;
  --gold: #d8bc83;
  --positive: #73d2b5;
  --negative: #f29bac;
  --warning: #edc584;
  font: 14px/1.5 Inter, -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: var(--bg);
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
button, a, input, select, textarea { outline-offset: 4px; }
:focus-visible { outline: 2px solid var(--accent); }
button:disabled { cursor: not-allowed; opacity: .55; }
[hidden] { display: none !important; }
button, .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 7px 13px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
}
button:hover:not(:disabled), .button:hover { background: var(--raised); border-color: #596479; }
button.primary { color: #161a2b; border-color: var(--accent); background: var(--accent); font-weight: 650; }
button.primary:hover:not(:disabled) { background: #c6cefa; }
a { color: var(--accent); }
input, select, textarea {
  width: 100%;
  min-width: 0;
  min-height: 38px;
  padding: 7px 9px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #14171e;
  color: var(--text);
}
input[type="checkbox"] { width: auto; min-height: 0; accent-color: var(--accent); }
textarea { resize: vertical; }
label, fieldset { min-width: 0; }
label > span:first-child { display: block; margin-bottom: 5px; color: var(--muted); font-size: 12px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 18px; font-weight: 600; }
h2 { font-size: 17px; font-weight: 600; }
h3 { font-size: 14px; font-weight: 600; }
small, .muted { color: var(--muted); }
.positive { color: var(--positive) !important; }
.negative { color: var(--negative) !important; }
.warning { color: var(--warning); }
.page-header { border-bottom: 1px solid var(--border); }
.page-header > div, .page-main { width: min(100% - 48px, 1440px); margin: 0 auto; }
.page-header > div { min-height: 65px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand > b { font: 700 22px/1 Georgia, serif; letter-spacing: -1.5px; color: var(--gold); white-space: nowrap; }
.brand > b small { font: 600 13px/1 Inter, sans-serif; letter-spacing: 0; color: var(--text); margin-left: 5px; }
.brand > i { width: 1px; height: 22px; background: var(--border); }
.page-main { padding: 22px 0 30px; }
.panel { min-width: 0; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); }
.panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.panel-head p { color: var(--muted); margin-top: 4px; font-size: 12px; }
.empty { padding: 28px 16px; color: var(--muted); text-align: center; }
.notice { border: 1px solid #554937; background: #2a241d; color: #efd3a4; padding: 10px 12px; border-radius: 6px; }
.notice a { color: inherit; }
.badge { display: inline-block; padding: 2px 6px; border-radius: 4px; font-size: 11px; background: #252b37; color: #c5ccdf; white-space: nowrap; }
.badge.open { background: #203a34; color: #a0decb; }
.badge.review { background: #3b3021; color: var(--warning); }
.badge.short { color: #f2a4b3; background: #432733; }
.badge.long { color: #a0decb; background: #203a34; }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { border-bottom: 1px solid var(--border); text-align: left; padding: 10px 11px; }
th { color: var(--muted); font-size: 12px; font-weight: 500; }
td { font-variant-numeric: tabular-nums; }
td.amount, th.amount { text-align: right; white-space: nowrap; }
.record-button { border: 0; background: none; padding: 0; min-height: 30px; text-align: left; font-weight: 600; justify-content: flex-start; }
.record-button:hover:not(:disabled) { text-decoration: underline; background: none; }
.chart { min-width: 0; background: #151820; border: 1px solid var(--border); border-radius: 6px; height: 275px; }
.chart svg { display: block; width: 100%; height: 100%; }
.chart text { fill: var(--muted); font-size: 10px; }
.chart .gridline { stroke: #313744; stroke-width: .75; fill: none; }
.chart .candle-up { fill: #6aaf9b; stroke: #6aaf9b; stroke-width: 1; }
.chart .candle-down { fill: #c47e8d; stroke: #c47e8d; stroke-width: 1; }
.chart .price-line, .chart .trade-marker { stroke: #a2aff2; stroke-dasharray: 4 4; opacity: .8; fill: none; }
.chart .stop-track { stroke: #d6ba7d; stroke-width: 1.6; fill: none; }
.chart .chart-mark { fill: #c8d0ff; }
.chart .profit-fill { fill: #aebcff13; }
.chart .profit-line { fill: none; stroke: #aebcff; stroke-width: 2; stroke-linejoin: round; }
.chart .profit-point { fill: transparent; }
.chart .profit-point:hover { fill: #aebcff; }
.chart-empty { height: 100%; display: grid; place-items: center; }
.chart.is-selectable { cursor: crosshair; }
.events { list-style: none; margin: 12px 0 0; padding: 0; }
.events li { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 12px; }
.events li time { color: var(--muted); white-space: nowrap; }
.events li b { font-weight: 500; }
dialog {
  width: min(720px, calc(100% - 24px));
  max-height: calc(100dvh - 24px);
  padding: 20px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid #4a5366;
  border-radius: 10px;
}
dialog::backdrop { background: #0a0d15b8; }
.close { min-width: 40px; padding: 3px 9px; font-size: 22px; line-height: 1; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
@media (max-width: 600px) {
  .page-header > div, .page-main { width: calc(100% - 24px); }
  .page-header > div { min-height: 57px; gap: 9px; }
  .page-main { padding-top: 14px; }
  .brand { gap: 8px; }
  .brand > b { font-size: 18px; }
  .brand > b small { font-size: 11px; }
  h1 { font-size: 15px; }
  .chart { height: 230px; }
  dialog { padding: 14px; }
}
