:root {
  color-scheme: dark;
  --bg: #101217;
  --panel: #191c23;
  --line: #2c3038;
  --muted: #9ba4b1;
  --buy: #36c49b;
  --sell: #f57581;
  --accent: #f6c75d;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: #eff1f5;
  font-variant-numeric: tabular-nums;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
header,
main {
  padding: 0 clamp(12px, 2.2vw, 40px);
}
header {
  height: 62px;
  display: flex;
  align-items: center;
  gap: 44px;
  border-bottom: 1px solid var(--line);
}
a {
  color: inherit;
  text-decoration: none;
}
.brand {
  font-weight: 720;
  font-size: 19px;
  white-space: nowrap;
}
.brandmark {
  font-size: 28px;
  color: var(--accent);
  vertical-align: -2px;
}
nav {
  display: flex;
  gap: 18px;
  align-items: center;
}
header nav a {
  color: var(--muted);
}
nav a[aria-current],
nav a:hover {
  color: var(--accent);
}
#connection {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
}
main {
  max-width: 1880px;
  margin: auto;
}
.summary {
  display: flex;
  align-items: center;
  gap: clamp(18px, 4vw, 80px);
  padding: 22px 0;
  overflow-x: auto;
}
.summary > div {
  flex-shrink: 0;
}
.summary small,
.summary label {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 6px;
}
.summary b {
  font-size: 15px;
  font-weight: 580;
}
.summary strong {
  font-size: 23px;
}
.summary select {
  background: transparent;
  border: 0;
  font-size: 19px;
  font-weight: 650;
  padding: 0;
  max-width: 250px;
}
.desk {
  display: grid;
  grid-template-columns: minmax(300px, 1fr) minmax(185px, 0.38fr) minmax(
      225px,
      0.43fr
    );
  gap: 8px;
  padding-bottom: 20px;
}
.panel {
  background: var(--panel);
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 15px;
}
.panelhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 13px;
}
h1,
h2 {
  font-size: 16px;
  line-height: 1.4;
  margin: 0;
}
button,
select,
input {
  font: inherit;
  color: inherit;
}
button,
select {
  cursor: pointer;
}
button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
select,
input {
  background: #11141a;
  border: 1px solid var(--line);
  padding: 8px;
  border-radius: 4px;
}
option {
  background: #16191e;
  color: white;
}
.detail,
output {
  font-size: 12px;
  color: var(--muted);
}
#ohlc {
  min-height: 28px;
}
#chart {
  display: block;
  width: 100%;
  height: 330px;
}
#frame {
  font-size: 12px;
}
.columns,
.level {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.columns,
th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}
.level {
  background: transparent;
  width: 100%;
  border: 0;
  border-radius: 0;
  padding: 3px 1px;
  line-height: 1.25;
  font-size: 13px;
}
.level:hover {
  background: var(--line);
}
.up,
#buy[aria-pressed="true"] {
  color: var(--buy);
}
.down,
#sell[aria-pressed="true"] {
  color: var(--sell);
}
#mid {
  display: block;
  padding: 9px 0;
  margin: 5px 0;
  border-block: 1px solid var(--line);
  font-size: 19px;
}
.switch {
  display: flex;
  background: var(--bg);
  padding: 3px;
  border-radius: 6px;
}
.switch button {
  flex: 1;
}
button {
  background: transparent;
  border: 0;
  border-radius: 4px;
  color: var(--muted);
  padding: 6px 9px;
}
button[aria-pressed="true"] {
  background: #303641;
  color: white;
}
.ticket label {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-top: 12px;
}
.ticket label span {
  float: right;
}
.ticket select,
.ticket input:not([type="checkbox"]) {
  width: 100%;
  display: block;
  margin-top: 5px;
}
.check input {
  vertical-align: middle;
}
#submit {
  margin-top: 16px;
  width: 100%;
  padding: 10px;
  background: var(--buy);
  color: #0d241d;
  font-weight: 700;
}
#submit.sell {
  background: var(--sell);
}
button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
output {
  display: block;
  margin-top: 8px;
  min-height: 1em;
}
.activity {
  grid-column: span 2;
}
.activity nav {
  gap: 3px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.scroll {
  overflow: auto;
  max-height: 250px;
}
table {
  border-collapse: collapse;
  width: 100%;
  white-space: nowrap;
  font-size: 13px;
}
th,
td {
  text-align: right;
  padding: 5px 7px;
  border-bottom: 1px solid var(--line);
}
th:first-child,
td:first-child {
  text-align: left;
}
.trades tr:last-child td {
  border: 0;
}
#error {
  color: var(--sell);
}
[hidden] {
  display: none !important;
}
@media (max-width: 940px) {
  .desk {
    grid-template-columns: minmax(0, 1fr) minmax(220px, 0.55fr);
  }
  .ticket {
    grid-column: 2;
    grid-row: 2;
  }
  .activity {
    grid-column: 1;
    grid-row: 2;
  }
  .trades {
    grid-column: 1/-1;
  }
}
@media (max-width: 620px) {
  header {
    gap: 16px;
  }
  header nav {
    gap: 12px;
  }
  .summary {
    gap: 20px;
  }
  .desk {
    display: flex;
    flex-direction: column;
  }
  .chart {
    order: 0;
  }
  .book {
    order: 1;
  }
  .ticket {
    order: 2;
  }
  .trades {
    order: 3;
  }
  .activity {
    order: 4;
  }
  #chart {
    height: 250px;
  }
  .panel {
    padding: 12px;
  }
}
