:root {
  color-scheme: light dark;
  --page: #f4f6f3;
  --card: #ffffff;
  --ink: #17241c;
  --muted: #59665d;
  --line: #e2e9e3;
  --track: #e7efe8;
  --accent: #17634a;
  --alert: #8b4019;
  --alert-bg: #fff2e8;
  --button: #eaf2eb;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --page: #101714; --card: #19241e; --ink: #ecf4ed; --muted: #aebdb2;
    --line: #304237; --track: #35483c; --accent: #8ddfba;
    --alert: #ffc49c; --alert-bg: #3b2a21; --button: #293e32;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--page); color: var(--ink); }
main { width: min(100%, 43rem); margin-inline: auto; padding: max(20px, env(safe-area-inset-top)) 14px max(22px, env(safe-area-inset-bottom)); }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 30px; letter-spacing: .035em; }
h2 { font-size: 15px; }
h3 { font-size: 14px; }
.page-header { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 0 3px 15px; }
.page-header p, .muted { font-size: 12px; color: var(--muted); line-height: 1.45; }
.page-header p { margin-top: 4px; }
button { min-height: 44px; border-radius: 12px; border: 1px solid var(--line); padding: 0 14px; color: var(--accent); background: var(--button); cursor: pointer; font: inherit; font-size: 14px; font-weight: 650; }
button:disabled { opacity: .65; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.card { border-radius: 16px; border: 1px solid var(--line); background: var(--card); overflow: hidden; margin-bottom: 10px; }
.card-head { padding: 11px 13px 0; }
table { width: 100%; table-layout: fixed; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 7px 10px; overflow-wrap: anywhere; }
th:first-child, td:first-child { width: 40%; padding-left: 13px; }
th:last-child, td:last-child { padding-right: 13px; }
thead th { font-weight: 550; color: var(--muted); font-size: 11px; }
tbody tr { border-top: 1px solid var(--line); }
tbody th { font-size: 13px; }
.reading { display: block; font-size: 20px; line-height: 1.12; font-weight: 700; }
.reading.muted { font-size: 12px; font-weight: 550; }
.subline { display: block; margin-top: 3px; }
progress { display: block; margin-top: 4px; width: 100%; height: 3px; border: 0; background: var(--track); border-radius: 4px; color: var(--accent); }
progress::-webkit-progress-bar { background: var(--track); border-radius: 4px; }
progress::-webkit-progress-value { background: var(--accent); border-radius: 4px; }
progress::-moz-progress-bar { background: var(--accent); border-radius: 4px; }
.low, .alert { color: var(--alert); }
progress.low::-webkit-progress-value { background: var(--alert); }
progress.low::-moz-progress-bar { background: var(--alert); }
.wallet-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 6px; }
.wallet-card { padding: 8px 13px 11px; border-top: 1px solid var(--line); min-width: 0; }
.wallet-card + .wallet-card { border-left: 1px solid var(--line); }
.wallet-card .reading { margin-top: 4px; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.wallet-card small { font-size: 10px; color: var(--muted); }
.notice { padding: 9px 11px; background: var(--alert-bg); color: var(--alert); border-radius: 10px; margin-bottom: 10px; font-size: 13px; }
.details { margin: 11px 0; }
details { border-bottom: 1px solid var(--line); }
summary { display: flex; align-items: center; justify-content: space-between; min-height: 44px; gap: 10px; padding: 7px 6px; cursor: pointer; font-size: 13px; font-weight: 650; }
summary::after { content: '+'; color: var(--muted); font-size: 19px; margin-left: 2px; }
details[open] summary::after { content: '−'; }
summary .muted { margin-left: auto; font-weight: 500; text-align: right; }
.detail-body { padding: 5px 6px 12px; }
.detail-group { padding: 9px 0; }
.detail-group + .detail-group { border-top: 1px solid var(--line); }
.detail-row { display: grid; grid-template-columns: minmax(5em, 1fr) auto; gap: 6px; font-size: 13px; margin-top: 6px; }
.detail-row span:last-child { text-align: right; overflow-wrap: anywhere; }
.pairing { padding: 17px; }
.pairing form { display: grid; gap: 8px; margin-top: 11px; }
.pairing label { color: var(--muted); font-size: 13px; }
.pairing input { font-size: 17px; padding: 11px; border-radius: 10px; border: 1px solid var(--line); background: var(--page); color: var(--ink); width: 100%; }
.pairing p { margin-top: 8px; font-size: 13px; color: var(--alert); }
footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); padding-inline: 3px; }
footer button { border: 0; background: transparent; font-size: 12px; }
