/* 省的不是钱 — one stylesheet, no framework, no client script.
   Cold house, warm heater: a cool blue-grey ground with a single ember
   orange, and one green kept for the money end of the trade-off. */

:root {
  --bg: #141013;
  --panel: #1e191e;
  --panel2: #262027;
  --line: #352d36;
  --ink: #f0e9ee;
  --dim: #c0b3bb;
  --faint: #8b7f88;
  --ember: #e8874a;
  --ember-dim: #b0602f;
  --cool: #6ea8c8;
  --money: #6fbf8f;
  --radius: 12px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  padding: 0 14px calc(28px + env(safe-area-inset-bottom));
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.6 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
        "Helvetica Neue", "Noto Sans SC", "PingFang SC", sans-serif;
  overflow-wrap: anywhere;
}
main { max-width: 780px; margin: 0 auto; }

.topbar {
  max-width: 780px; margin: 0 auto; padding: 20px 0 14px;
  display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 12px; align-items: start;
}
.mark {
  width: 40px; height: 40px; display: grid; place-items: center; border-radius: 11px;
  background: linear-gradient(160deg, var(--ember) 0%, var(--ember-dim) 100%);
  color: #1a0d05; font-size: 21px; line-height: 1;
}
.titles h1 { margin: 0; font-size: 22px; font-weight: 650; text-wrap: balance; }
.titles h1 .en {
  display: block; font-size: 12.5px; font-weight: 500; color: var(--faint);
  letter-spacing: .07em; text-transform: uppercase; margin-top: 3px;
}
.titles p { margin: 8px 0 0; color: var(--dim); font-size: 14px; }
.titles b { color: var(--ember); font-weight: 650; }

.panel {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px; margin: 0 0 14px;
}
.panel h2 {
  margin: 0 0 10px; font-size: 12px; font-weight: 650; letter-spacing: .09em;
  text-transform: uppercase; color: var(--faint);
}
.panel h2.spaced { margin-top: 22px; }
.panel.quiet { background: transparent; }

.sub { margin: 0 0 10px; color: var(--dim); font-size: 13.5px; }
.sub:last-child { margin-bottom: 0; }
.sub b { color: var(--ink); }
.tiny { margin: 10px 0 0; color: var(--faint); font-size: 12px; line-height: 1.6; }
.tiny b { color: var(--dim); }

/* ------------------------------------------------------------------- form */

.pills { display: grid; grid-template-columns: 1fr; gap: 7px; }
@media (min-width: 560px) { .pills { grid-template-columns: 1fr 1fr; } }
.pill {
  display: flex; flex-direction: column; gap: 2px; min-width: 0;
  padding: 10px 12px; text-align: left; cursor: pointer;
  font: inherit; color: var(--ink);
  background: var(--panel2); border: 1px solid var(--line); border-radius: 9px;
}
.pill b { font-size: 13.5px; font-weight: 620; }
.pill span { font-size: 11.5px; color: var(--faint); line-height: 1.45; }
.pill.on { border-color: var(--ember); background: #2c2119; }
.pill.on b { color: var(--ember); }

.dials { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-top: 12px; }
.dial { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1 1 130px; }
.dial label { font-size: 11.5px; color: var(--faint); letter-spacing: .03em; }
.withunit { position: relative; display: block; }
.withunit input {
  width: 100%; padding: 9px 46px 9px 12px;
  background: #0f0b0e; border: 1px solid var(--line); border-radius: 8px; color: var(--ink);
  font: 500 15px/1.2 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-variant-numeric: tabular-nums;
}
.withunit i {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  font-style: normal; font-size: 11px; color: var(--faint); pointer-events: none;
}
.withunit i.pre { right: auto; left: 11px; font-size: 13px; }
.withunit:has(i.pre) input { padding-left: 24px; padding-right: 12px; }
input:focus-visible, button:focus-visible { outline: 2px solid var(--ember); outline-offset: 2px; }

.go {
  flex: 1 1 100%; margin-top: 4px; padding: 11px 16px; border: 0; border-radius: 9px;
  cursor: pointer; font: inherit; font-weight: 650; letter-spacing: .02em;
  background: linear-gradient(160deg, var(--ember) 0%, var(--ember-dim) 100%);
  color: #1a0d05;
}

/* ---------------------------------------------------------------- verdict */

.verdict {
  border: 1px solid var(--line); border-left-width: 3px; border-radius: var(--radius);
  padding: 16px; margin: 0 0 14px; background: var(--panel);
}
.verdict > b { display: block; font-size: 19px; font-weight: 660; text-wrap: balance; }
.verdict .say { margin: 12px 0 0; color: var(--dim); font-size: 13.5px; }
.verdict.two { border-left-color: var(--ember); }
.verdict.two > b { color: var(--ember); }
.verdict.na { border-left-color: var(--faint); }
.verdict.na > b { color: var(--dim); }

.ends { display: grid; grid-template-columns: 1fr; gap: 10px; margin: 14px 0 0; }
@media (min-width: 560px) { .ends { grid-template-columns: 1fr 1fr; } }
.end {
  display: flex; flex-direction: column; gap: 3px; min-width: 0;
  padding: 12px 13px; background: var(--panel2); border-radius: 10px;
  border-left: 3px solid var(--line);
}
.end .k { font-size: 11.5px; color: var(--faint); letter-spacing: .03em; }
.end .v { font-size: 20px; font-weight: 660; font-variant-numeric: tabular-nums; }
.end .n { font-size: 12px; color: var(--faint); line-height: 1.5; }
.end.money { border-left-color: var(--money); }
.end.money .v { color: var(--money); }
.end.warmth { border-left-color: var(--ember); }
.end.warmth .v { color: var(--ember); }

/* ------------------------------------------------------------------ chart */

svg.frontier { width: 100%; height: auto; display: block; margin: 4px 0 0; }
.frontier .gl { stroke: var(--line); stroke-width: 1; }
.frontier .gx, .frontier .gy { fill: var(--faint); font-size: 10px; }
.frontier .ax { fill: var(--faint); font-size: 10.5px; }
.frontier .who { stroke: var(--cool); stroke-width: 1.4; stroke-dasharray: 5 4; }
.frontier .wholab { fill: var(--cool); font-size: 10.5px; }
.frontier .fr { fill: none; stroke: var(--ember); stroke-width: 2.6; stroke-linejoin: round; }
.frontier .frp { fill: var(--ember); }
.frontier .now { fill: var(--ink); }
.frontier .nowlab { fill: var(--ink); font-size: 11px; font-weight: 600; }
.frontier .arrow { stroke: var(--faint); stroke-width: 1.4; stroke-dasharray: 3 3; }

/* --------------------------------------------------------------- findings */

.finding {
  padding: 12px 13px; border-radius: 9px; background: var(--panel2);
  border-left: 3px solid var(--line); margin: 0 0 10px;
}
.finding:last-child { margin-bottom: 0; }
.finding b { display: block; font-size: 14px; font-weight: 640; text-wrap: balance; }
.finding p { margin: 6px 0 0; color: var(--dim); font-size: 13px; }
.finding.ok { border-left-color: var(--cool); }
.finding.warn { border-left-color: var(--ember); }
.finding.warn b { color: var(--ember); }

/* ------------------------------------------------------------------ table */

.scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.at { border-collapse: collapse; width: 100%; font-size: 13px; white-space: nowrap; }
table.at th, table.at td { padding: 7px 12px; text-align: right; }
table.at thead th {
  color: var(--faint); font-weight: 550; font-size: 11px; letter-spacing: .03em;
  border-bottom: 1px solid var(--line);
}
table.at tbody th { text-align: left; font-weight: 620; font-variant-numeric: tabular-nums; }
table.at td { color: var(--dim); font-variant-numeric: tabular-nums; }
table.at tbody tr + tr th, table.at tbody tr + tr td { border-top: 1px solid #2a232b; }
table.at tr.whorow { background: #1b2830; }
table.at tr.whorow th, table.at tr.whorow td { color: var(--cool); }

.foot { max-width: 780px; margin: 10px auto 0; color: var(--faint); font-size: 11.5px; text-align: center; }

/* Somewhere else — the door out of the five built-in places. Closed by
   default because most people are in one of the five; opened by the server
   whenever there is something pasted in it, so a paste is never hidden
   behind a triangle the person has to remember to click. */
.more { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 10px; }
.more > summary {
  cursor: pointer; color: var(--cool); font-weight: 600; font-size: 14px;
  list-style: none; padding: 4px 0;
}
.more > summary::-webkit-details-marker { display: none; }
.more > summary::before { content: "＋ "; color: var(--faint); }
.more[open] > summary::before { content: "－ "; }
.more .lbl {
  display: block; margin: 8px 0 6px; color: var(--dim); font-size: 13px; line-height: 1.5;
}
.more textarea {
  width: 100%; min-width: 0; resize: vertical;
  background: var(--panel2); color: var(--ink);
  border: 1px solid var(--line); border-radius: 9px; padding: 9px 10px;
  font: 13px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.more textarea:focus-visible { outline: 2px solid var(--ember); outline-offset: 1px; }
