:root {
  --bg: #0f1115;
  --panel: #171a21;
  --panel-2: #1d2029;
  --border: #2a2e3a;
  --text: #e6e9ef;
  --muted: #8b93a3;
  --accent: #3b82f6;
  --green: #26a69a;
  --red: #ef5350;
  --orange: #f7b731;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  background: var(--bg); color: var(--text);
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px; line-height: 1.5;
}
header.topbar {
  display: flex; align-items: center; gap: 16px;
  padding: 12px 20px; background: var(--panel);
  border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10;
}
header.topbar .logo { font-weight: 700; font-size: 16px; color: var(--accent); }
header.topbar nav { display: flex; gap: 8px; flex: 1; }
header.topbar nav a {
  color: var(--muted); text-decoration: none; padding: 6px 10px; border-radius: 6px;
}
header.topbar nav a:hover, header.topbar nav a.active { color: var(--text); background: var(--panel-2); }
header.topbar .badge {
  font-size: 12px; padding: 3px 8px; border-radius: 10px; background: var(--panel-2); color: var(--muted);
}
.tag { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 12px; }
.tag.green, .tag.ok { background: rgba(38,166,154,.18); color: var(--green); }
.tag.red { background: rgba(239,83,80,.18); color: var(--red); }
.tag.gray, .tag.no { background: rgba(139,147,163,.18); color: var(--muted); }
.tag.orange { background: rgba(247,183,49,.18); color: var(--orange); }

.container { max-width: 1200px; margin: 0 auto; padding: 20px; }
.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }
.card {
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 16px;
}
.card h3 { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.card .meta { color: var(--muted); font-size: 12px; margin-top: 2px; }
.card .price-row { display: flex; align-items: baseline; gap: 12px; margin-top: 10px; }
.card .price { font-size: 22px; font-weight: 700; }
.card .signal { margin-top: 8px; }
.card .foot { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; color: var(--muted); font-size: 12px; }
.card a { color: var(--accent); text-decoration: none; }
.card a:hover { text-decoration: underline; }

button, .btn {
  background: var(--accent); color: #fff; border: none; border-radius: 8px;
  padding: 8px 14px; cursor: pointer; font-size: 13px;
}
button.ghost { background: var(--panel-2); color: var(--text); border: 1px solid var(--border); }
input, select, textarea {
  background: var(--panel-2); color: var(--text); border: 1px solid var(--border);
  border-radius: 8px; padding: 8px 10px; font-size: 13px;
}
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); font-size: 13px; }
th { color: var(--muted); font-weight: 500; }
.muted { color: var(--muted); }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row .grow { flex: 1; }

.form-card { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 20px; margin-bottom: 20px; }
.form-card h2 { font-size: 15px; margin-bottom: 12px; }
.field { margin-bottom: 12px; }
.field label { display: block; color: var(--muted); margin-bottom: 4px; font-size: 12px; }
.field input, .field select { width: 100%; }

#toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  background: var(--panel-2); border: 1px solid var(--border); border-radius: 8px;
  padding: 10px 18px; display: none; z-index: 100;
}
#chart { width: 100%; height: 520px; }
.api-key-box { background: var(--panel-2); border: 1px solid var(--border); border-radius: 8px; padding: 10px; font-family: monospace; font-size: 12px; word-break: break-all; }

.nav-user { display: flex; align-items: center; gap: 8px; margin-left: auto; }

.combo-wrap { position: relative; }
.combo-wrap input { width: 100%; }
.combo-drop {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 50;
  background: var(--panel-2); border: 1px solid var(--border); border-radius: 8px;
  max-height: 280px; overflow-y: auto; display: none;
}
.combo-item { padding: 8px 12px; cursor: pointer; font-size: 13px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.combo-item:hover, .combo-item.sel { background: var(--panel); color: var(--accent); }
.combo-type { font-size: 11px; color: var(--text-dim); border: 1px solid var(--border); border-radius: 4px; padding: 1px 6px; flex-shrink: 0; }

.scrbar {
  position: relative; height: 10px; margin-top: 8px; border-radius: 5px;
  background: var(--panel-2); cursor: pointer; user-select: none;
}
.scrbar-fill {
  position: absolute; top: 0; bottom: 0; left: 0; width: 30%;
  background: var(--accent); border-radius: 5px; opacity: .7;
}
.scrbar-fill:hover { opacity: 1; }

.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; }

.login-body {
  display: flex; align-items: center; justify-content: center; min-height: 100vh;
}
.login-card {
  width: 380px; max-width: calc(100vw - 32px);
  background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 28px;
}
.login-logo { font-size: 20px; font-weight: 700; color: var(--accent); text-align: center; }
.login-sub { text-align: center; margin: 6px 0 16px; font-size: 13px; }
.tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.tab {
  flex: 1; background: transparent; color: var(--muted);
  border: 1px solid var(--border); border-radius: 8px; padding: 8px;
}
.tab.active { background: var(--panel-2); color: var(--text); border-color: var(--accent); }
.login-card .field { display: block; }
.login-card input { width: 100%; margin-bottom: 12px; }
#submit-btn { width: 100%; }
.login-error { margin-top: 12px; color: var(--red); font-size: 13px; min-height: 18px; }