:root {
  --bg: #101612;
  --bg-2: #18211c;
  --line: #2c3b33;
  --text: #e8f2eb;
  --muted: #8ea497;
  --gold: #d7a441;
  --gold-2: #f0d7a0;
  --long: #3cba78;
  --short: #e15d64;
  --warn: #e0b15a;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { min-height: 100vh; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }

.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(900px 420px at 10% -10%, rgba(215, 164, 65, 0.16), transparent 60%),
    radial-gradient(700px 380px at 110% 10%, rgba(60, 186, 120, 0.12), transparent 55%),
    var(--bg);
}
.login-card {
  width: min(440px, 100%);
  background: rgba(24, 33, 28, 0.92);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 28px 24px 22px;
  box-shadow: var(--shadow);
}
.login-card h1 { margin: 6px 0 8px; font-size: 36px; letter-spacing: -0.04em; }
.lede { color: var(--muted); line-height: 1.6; margin-top: 0; }
label { display: block; margin: 14px 0 0; color: var(--muted); font-size: 13px; }
input, select {
  width: 100%;
  margin-top: 6px;
  background: #101612;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 12px;
}
button[type="submit"], .solid {
  margin-top: 16px;
  width: 100%;
  border: 0;
  border-radius: 12px;
  padding: 12px 14px;
  background: var(--gold);
  color: #1b1408;
  font-weight: 700;
}
.ghost, .text {
  border: 1px solid var(--line);
  background: transparent;
  border-radius: 999px;
  padding: 8px 12px;
}
.text { border: 0; color: var(--muted); }
.error { color: var(--short); min-height: 1.2em; font-size: 13px; }
.eyebrow { color: var(--gold-2); letter-spacing: 0.14em; text-transform: uppercase; font-size: 12px; margin: 0; }

#app { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.side {
  border-right: 1px solid var(--line);
  padding: 22px 16px;
  background: #141c18;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand { display: flex; gap: 10px; align-items: center; }
.mark {
  width: 42px; height: 42px; display: grid; place-items: center;
  border-radius: 14px; background: var(--gold); color: #1b1408; font-weight: 800;
}
.brand small { display: block; color: var(--muted); }
.side nav, .tabbar { display: flex; flex-direction: column; gap: 6px; margin-top: 28px; }
.side nav button, .tabbar button {
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 12px;
  padding: 10px 12px;
  color: var(--muted);
}
.side nav button.active, .tabbar button.active { background: #243129; color: var(--text); }
.side-note { color: var(--muted); font-size: 12px; line-height: 1.5; margin-top: 28px; }

main { padding: 22px 22px 96px; }
.top { display: flex; justify-content: space-between; gap: 16px; align-items: flex-end; }
.top h2 { margin: 4px 0 0; font-size: 28px; letter-spacing: -0.03em; }
.top-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.pill {
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(215, 164, 65, 0.14);
  color: var(--gold-2);
  font-size: 12px;
}

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 18px 0; }
.stat, .card, .trader, .paper, .strategy {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 18px;
}
.stat { padding: 14px 16px; }
.stat b { display: block; font-size: 26px; margin-top: 4px; }
.stat span, .muted { color: var(--muted); font-size: 13px; }
.grid { display: grid; gap: 12px; }
.card { padding: 16px; }
.card h3 { margin: 0 0 8px; display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.reason { line-height: 1.65; margin: 8px 0; }
.votes { display: flex; flex-direction: column; gap: 8px; }
.vote { display: grid; grid-template-columns: 1.4fr 0.6fr 0.8fr; gap: 8px; font-size: 13px; padding-top: 6px; border-top: 1px solid var(--line); }
.long { color: var(--long); }
.short { color: var(--short); }
.tag { font-size: 12px; border-radius: 999px; padding: 3px 8px; background: #243129; }
.tag.long { background: rgba(60, 186, 120, 0.15); }
.tag.short { background: rgba(225, 93, 100, 0.15); }
.tag.wait { background: rgba(224, 177, 90, 0.15); color: var(--warn); }

.traders { display: grid; gap: 10px; }
.trader { padding: 14px; display: grid; gap: 8px; }
.trader header { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.nums { display: flex; gap: 14px; flex-wrap: wrap; font-variant-numeric: tabular-nums; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.actions button { border-radius: 999px; border: 1px solid var(--line); background: transparent; padding: 7px 10px; }
.actions button.on { background: var(--gold); color: #1b1408; border-color: transparent; font-weight: 700; }
.filters { display: flex; gap: 8px; margin: 12px 0; flex-wrap: wrap; }
.filters button {
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  padding: 7px 12px;
}
.filters button.on { background: #243129; color: var(--text); }

.strategy { padding: 16px; display: grid; gap: 12px; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.help { color: var(--muted); font-size: 13px; line-height: 1.6; }
.check { display: flex; gap: 8px; align-items: center; }
.check input { width: auto; }

.paper { padding: 14px; margin-bottom: 10px; }
.paper ol { margin: 8px 0 0; padding-left: 18px; color: var(--muted); }
.banner {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #243129;
  color: var(--muted);
  line-height: 1.55;
}

.tabbar { display: none; }

@media (max-width: 860px) {
  #app { grid-template-columns: 1fr; }
  .side { display: none; }
  main { padding: 16px 14px 108px; }
  .stats, .fields { grid-template-columns: 1fr 1fr; }
  .top { align-items: flex-start; flex-direction: column; }
  .tabbar {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    position: fixed;
    left: 0; right: 0; bottom: 0;
    background: rgba(16, 22, 18, 0.96);
    border-top: 1px solid var(--line);
    padding: 8px 6px calc(8px + env(safe-area-inset-bottom));
    margin: 0;
    z-index: 5;
  }
  .tabbar button { text-align: center; font-size: 12px; padding: 8px 2px; }
  .vote { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .login-card h1 { font-size: 30px; }
}
