:root {
  --bg: #f4f7fb;
  --card: #ffffff;
  --border: #e3e8ef;
  --text: #1e293b;
  --muted: #64748b;
  --orange: #f7931a;
  --green: #16a34a;
  --green-bg: rgba(22, 163, 74, 0.12);
  --red: #dc2626;
  --red-bg: rgba(220, 38, 38, 0.10);
  --gray-bg: rgba(100, 116, 139, 0.10);
  --blue: #387cf0;
  --blue-bg: rgba(56, 132, 255, 0.12);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  padding-bottom: env(safe-area-inset-bottom);
}

header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 10;
}
header .logo { width: 36px; height: 36px; border-radius: 8px; }
header .title { flex: 1; }
header h1 { font-size: 18px; font-weight: 700; }
header .sub { font-size: 12px; color: var(--muted); }

.iconbtn {
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 12px;
  font-size: 14px;
}

main { max-width: 520px; margin: 0 auto; padding: 16px 14px 40px; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 14px;
}
.card h2 { font-size: 14px; color: var(--muted); font-weight: 600; margin-bottom: 10px; }

.disclaimer {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #9a3412;
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 14px;
}
.disclaimer h2 { font-size: 14px; color: #c2410c; margin-bottom: 6px; }
.disclaimer p { margin: 0; font-size: 13px; line-height: 1.6; }

.price-card { text-align: left; }
.price-row { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.price { font-size: 40px; font-weight: 800; letter-spacing: -0.5px; font-variant-numeric: tabular-nums; }
.chip {
  font-size: 15px; font-weight: 700;
  padding: 3px 10px; border-radius: 999px;
}
.chip.up { color: var(--green); background: var(--green-bg); }
.chip.down { color: var(--red); background: var(--red-bg); }
.meta-row { margin-top: 6px; font-size: 12px; color: var(--muted); }

.chart-card { padding: 14px 12px 10px; }
.chart-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.chart-head h2 { margin: 0; font-size: 14px; color: var(--muted); font-weight: 600; }
.chart-tabs { display: flex; gap: 4px; }
.chart-tabs .tab {
  background: transparent; border: 1px solid var(--border); color: var(--muted);
  border-radius: 6px; padding: 4px 10px; font-size: 12px; cursor: pointer;
}
.chart-tabs .tab.active { background: var(--orange); border-color: var(--orange); color: #1a1206; font-weight: 700; }
.chart-info { font-size: 11px; color: var(--muted); margin-bottom: 6px; min-height: 16px; }
#chartCanvas { width: 100%; height: auto; display: block; border-radius: 8px; }

.signal-card { border-radius: 14px; padding: 16px; margin-bottom: 14px; }
.signal-card.move { background: var(--blue-bg); border: 1px solid rgba(56, 132, 255, 0.4); }
.signal-card.idle { background: var(--card); border: 1px solid var(--border); }
.signal-title { display: flex; align-items: center; gap: 8px; font-size: 18px; font-weight: 800; margin-bottom: 6px; }
.signal-title.move { color: var(--blue); }
.signal-title.idle { color: var(--muted); }
.dot { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.dot.move { background: var(--blue); }
.dot.idle { background: var(--muted); }
.signal-card ul { list-style: none; }
.signal-card li { font-size: 14px; padding: 3px 0; color: var(--text); }

.levels { list-style: none; }
.levels li {
  display: flex; justify-content: space-between; align-items: center;
  padding: 7px 0; border-bottom: 1px dashed var(--border); font-size: 14px;
}
.levels li:last-child { border-bottom: none; }
.levels .k { color: var(--muted); }
.levels .v { font-weight: 700; font-variant-numeric: tabular-nums; }
.levels .v.warn { color: var(--orange); }

.ex-list { list-style: none; }
.ex-list li {
  display: flex; justify-content: space-between; align-items: center;
  padding: 6px 0; border-bottom: 1px dashed var(--border); font-size: 14px;
}
.ex-list li:last-child { border-bottom: none; }
.ex-list .k { color: var(--muted); }
.ex-list .v { font-weight: 700; font-variant-numeric: tabular-nums; }

.report-list { list-style: none; }
.report-list li { font-size: 13px; color: var(--muted); padding: 3px 0; }

.btn-col { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.btn {
  border: 1px solid var(--border);
  background: var(--gray-bg);
  color: var(--text);
  border-radius: 10px;
  padding: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
.btn.primary { background: var(--orange); border-color: var(--orange); color: #1a1206; }
.btn.danger { color: var(--red); border-color: rgba(220, 38, 38, 0.4); background: transparent; }
.btn:disabled { opacity: 0.5; }

.hint { font-size: 12px; color: var(--muted); margin-top: 8px; }

.footer { text-align: center; font-size: 12px; color: var(--muted); margin-top: 24px; }

.sheet {
  position: fixed; inset: 0; background: rgba(0, 0, 0, 0.45); z-index: 50;
  display: flex; align-items: flex-end;
}
.sheet[hidden] { display: none; }
.sheet-panel {
  width: 100%; max-width: 520px; margin: 0 auto;
  background: var(--card); border-radius: 16px 16px 0 0;
  padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
  max-height: 85vh; overflow-y: auto;
}
.sheet-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.sheet-head h2 { font-size: 17px; }
.sheet-panel label { display: block; font-size: 13px; color: var(--muted); margin: 12px 0 4px; }
.sheet-panel input {
  width: 100%; margin-top: 4px;
  background: var(--bg); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px;
  padding: 10px 12px; font-size: 15px;
}