:root {
  color-scheme: light;
  --bg: #f5f7f4;
  --card: #ffffff;
  --text: #1f2a24;
  --muted: #6b7a70;
  --line: #dbe3dc;
  --accent: #2f7d4f;
  --accent-soft: #e3f1e8;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans SC", sans-serif;
  background: var(--bg);
  color: var(--text);
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
}

header h1 { font-size: 18px; margin: 0; }

.badge {
  font-size: 12px;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 4px 10px;
}

main { max-width: 960px; margin: 0 auto; padding: 20px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
  margin-bottom: 16px;
}

#login-card { max-width: 420px; }

label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 12px; }

input, select, button {
  width: 100%;
  margin-top: 6px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 14px;
  background: #fff;
  color: var(--text);
}

button { cursor: pointer; }
button:disabled { cursor: progress; opacity: 0.65; }
button.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
button.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }

.row { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; }
.row > select, .row > button { width: auto; min-width: 120px; }
.row.wrap { flex-wrap: wrap; }
.row.wrap button { width: auto; }

.msg { color: var(--muted); font-size: 13px; min-height: 18px; }

.chart-card { padding: 10px; }
canvas { width: 100%; height: 360px; display: block; }

@media (max-width: 640px) {
  main { padding: 12px; }
  canvas { height: 260px; }
  .row { flex-wrap: wrap; }
}

/* --- ONB-01: four parallel object homes -------------------------------- */

.tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin-bottom: 14px;
  padding-bottom: 2px;
}

.tabs button {
  width: auto;
  flex: 1 1 0;
  min-width: 96px;
  margin-top: 0;
  white-space: nowrap;
}

.tabs button.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.context { margin-bottom: 16px; }

.crumbs {
  margin: 0 0 6px;
  font-size: 12px;
  color: var(--muted);
  min-height: 16px;
}

.onb-progress {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 12px;
  color: var(--muted);
}

.onb-count { color: var(--accent); font-weight: 600; }

.onb-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.onb-steps .step.done { color: var(--accent); }
.onb-steps .step.skipped { color: var(--muted); font-style: italic; }

.obj-list {
  list-style: none;
  margin: 0 0 14px;
  padding: 0;
}

.obj-list li {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.obj-list li:last-child { border-bottom: 0; }
.obj-list li.pending { opacity: 0.6; }
.obj-list li.empty { color: var(--muted); font-size: 13px; display: block; }

.obj-main { display: flex; flex-direction: column; min-width: 140px; flex: 1 1 auto; }
.obj-main strong { font-size: 14px; font-weight: 600; }
.obj-sub { font-size: 12px; color: var(--muted); }

.obj-badges { display: flex; gap: 6px; flex-wrap: wrap; }
.obj-actions { display: flex; gap: 8px; align-items: center; }
.obj-actions select { width: auto; min-width: 130px; margin-top: 0; }

.pill {
  font-size: 12px;
  line-height: 1;
  border-radius: 999px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  background: #fff;
}

.pill.warn { color: #8a6100; background: #fff6df; border-color: #f0d79a; }
.pill.danger { color: #a3241c; background: #fdecea; border-color: #f2b9b3; }
.pill.muted { color: var(--muted); background: #f2f4f2; }
.pill.ok { color: var(--accent); background: var(--accent-soft); border-color: var(--accent); }

button.small { padding: 6px 10px; font-size: 13px; width: auto; margin-top: 0; }
button.ghost {
  width: auto;
  margin-top: 0;
  padding: 6px 10px;
  font-size: 13px;
  background: #fff;
  color: var(--accent);
  border-color: var(--accent);
}

.hint { color: var(--muted); font-size: 12px; margin: 0 0 10px; }
.scan-preview { width: 100%; max-height: 200px; border-radius: 10px; background: #000; }
.chart-card { padding: 10px; border: 1px solid var(--line); border-radius: 12px; }

/* --- ONB-02: 卫星底图围面 --------------------------------------------- */

.map-canvas {
  width: 100%;
  height: 360px;
  border-radius: 12px;
  background: #0f1720;
  border: 1px solid var(--line);
  touch-action: none;
  cursor: crosshair;
}

.warn {
  margin: 0 0 10px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.45;
  color: #8a6100;
  background: #fff6df;
  border: 1px solid #f0d79a;
}

@media (max-width: 640px) {
  .map-canvas { height: 300px; }
}
