:root {
  color-scheme: light;
  --surface: #fcfcfb;
  --page: #f9f9f7;
  --ink: #0b0b0b;
  --ink-2: #52514e;
  --muted: #898781;
  --grid: #e1e0d9;
  --axis: #c3c2b7;
  --blue: #2a78d6;
  --orange: #eb6834;
  --aqua: #1baf7a;
  --yellow: #eda100;
  --green: #008300;
  --red: #d03b3b;
  --good: #0ca30c;
  --border: rgba(11, 11, 11, 0.10);
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--page);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.55;
}

.wrap { max-width: 1080px; margin: 0 auto; padding: 24px 20px 60px; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px; background: var(--surface);
  border-bottom: 1px solid var(--grid);
}
.topbar .brand { font-size: 17px; font-weight: 700; }
.topbar .brand span { color: var(--blue); }
.topbar .who { color: var(--ink-2); font-size: 14px; }
.topbar button {
  margin-left: 12px; cursor: pointer;
}

h1 { font-size: 22px; margin: 8px 0 4px; }
h2 { font-size: 18px; margin: 24px 0 12px; }
.sub { color: var(--ink-2); font-size: 14px; margin-bottom: 16px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 16px;
}
.card h3 { margin: 0 0 12px; font-size: 16px; }

.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.grow { flex: 1; }

label.fld { display: block; font-size: 13px; color: var(--ink-2); margin-bottom: 4px; }
input, select, textarea {
  font: inherit;
  padding: 8px 10px;
  border: 1px solid var(--axis);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  width: 100%;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(42, 120, 214, 0.12);
}
.fld-wrap { flex: 1; min-width: 160px; }

button.btn {
  font: inherit; font-weight: 600;
  padding: 9px 16px; border-radius: 8px; border: 1px solid transparent;
  background: var(--blue); color: #fff; cursor: pointer;
}
button.btn:hover { filter: brightness(1.06); }
button.btn.ghost { background: #fff; color: var(--ink-2); border-color: var(--axis); }
button.btn.ghost:hover { border-color: var(--blue); color: var(--blue); }
button.btn.danger { background: #fff; color: var(--red); border-color: var(--red); }
button.btn.small { padding: 5px 10px; font-size: 13px; }
button:disabled { opacity: 0.5; cursor: not-allowed; }

table.tbl { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
table.tbl th, table.tbl td {
  padding: 9px 10px; border-bottom: 1px solid var(--grid); text-align: center;
}
table.tbl th { font-size: 13px; color: var(--ink-2); font-weight: 600; }
table.tbl td.l, table.tbl th.l { text-align: left; }
table.tbl td.r, table.tbl th.r { text-align: right; }
table.tbl tr.total td { font-weight: 700; border-top: 2px solid var(--axis); border-bottom: none; }
table.tbl tr.hl td { background: #f3f7fd; }

.pos { color: var(--good); font-weight: 600; }
.neg { color: var(--red); font-weight: 600; }
.mut { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }

.pill { display: inline-block; padding: 2px 10px; border-radius: 20px; font-size: 13px; }
.pill.blue { background: #e4eefa; color: #1c5cab; }
.pill.green { background: #e4f5e8; color: #0a7a0a; }

.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--grid); margin-bottom: 18px; flex-wrap: wrap; }
.tabs button {
  font: inherit; padding: 10px 16px; border: none; background: none; cursor: pointer;
  color: var(--ink-2); border-bottom: 2px solid transparent;
}
.tabs button.active { color: var(--blue); border-bottom-color: var(--blue); font-weight: 600; }

.toast {
  position: fixed; top: 16px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 8px;
  font-size: 14px; z-index: 999; opacity: 0; pointer-events: none; transition: opacity .2s;
}
.toast.show { opacity: 1; }
.toast.err { background: var(--red); }

.login-box { max-width: 400px; margin: 8vh auto 0; }
.login-box .card { padding: 26px; }
.login-box h1 { margin: 0 0 4px; }
.login-box .sub { margin-bottom: 20px; }

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

.kpi-row { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.kpi {
  flex: 1; min-width: 150px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px;
}
.kpi .v { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; }
.kpi .k { font-size: 13px; color: var(--ink-2); }

.bar-h { display: flex; height: 10px; border-radius: 6px; overflow: hidden; background: var(--grid); margin-top: 8px; }
.bar-h i { display: block; height: 100%; }

.detail-line { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px dashed var(--grid); }
.detail-line:last-child { border-bottom: none; }
.detail-line .k { color: var(--ink-2); }

.reward-list { margin-top: 6px; }
.reward-item { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--grid); }
.reward-item .sig { font-weight: 700; width: 26px; }
.reward-item .ev { font-size: 13px; color: var(--blue); text-decoration: none; margin-left: 8px; }

.small-note { font-size: 13px; color: var(--muted); }
