:root {
  --bg: #f6f7f9; --surface: #ffffff; --text: #16191d; --muted: #5b6470; --line: #dfe3e8;
  --accent: #2557d6; --accent-text: #ffffff; --focus: #1b46b3;
  --eth: #3b63d9; --tron: #d9534f;
  --lock: #b3261e; --lock-bg: #fdecea; --unlock: #1d6f42; --unlock-bg: #e6f4ec; --destroy: #8a4b00; --destroy-bg: #fdf0dc;
  --open-bg: #eef1f6; --done-bg: #e9eefc; --notice-bg: #fff6d6; --notice-line: #e4c860; --error: #b3261e;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101216; --surface: #181b21; --text: #eceff3; --muted: #9aa4b2; --line: #2a2f38;
    --accent: #7ba0ff; --accent-text: #0b1020; --focus: #a9c0ff;
    --eth: #7a9bff; --tron: #ff7b73;
    --lock: #ff9d95; --lock-bg: #3a1f1d; --unlock: #7fd6a1; --unlock-bg: #17301f; --destroy: #ffc27a; --destroy-bg: #3a2a12;
    --open-bg: #222730; --done-bg: #1f2a4a; --notice-bg: #3a3214; --notice-line: #6f5f1f; --error: #ff9d95;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.6 system-ui, -apple-system, "Segoe UI", "Hiragino Sans", "PingFang SC", "Noto Sans CJK SC", sans-serif; }
a { color: var(--accent); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }

header { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 20px; padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--line); }
.brand { font-weight: 700; color: var(--text); text-decoration: none; margin-right: 8px; }
nav { display: flex; flex-wrap: wrap; gap: 2px; flex: 1; }
nav a { padding: 8px 12px; border-radius: 8px; text-decoration: none; color: var(--muted); min-height: 40px; display: inline-flex; align-items: center; }
nav a:hover { background: var(--open-bg); color: var(--text); }
nav a[aria-current="page"] { color: var(--text); background: var(--open-bg); font-weight: 600; }
.who { display: flex; align-items: center; gap: 10px; color: var(--muted); margin: 0; }
.who button { background: none; border: 1px solid var(--line); color: var(--text); border-radius: 8px; padding: 6px 12px; min-height: 36px; cursor: pointer; font: inherit; }
.who button:hover { background: var(--open-bg); }

main { max-width: 1040px; margin: 0 auto; padding: 20px 16px 40px; }
h1 { font-size: 22px; margin: 4px 0 14px; }
h2 { font-size: 16px; margin: 0 0 10px; }
footer { max-width: 1040px; margin: 0 auto; padding: 0 16px 28px; color: var(--muted); font-size: 12.5px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 18px; margin-bottom: 16px; }
.card.narrow { max-width: 400px; margin: 40px auto; }
.card label { display: block; margin: 12px 0; font-weight: 600; font-size: 14px; }
input[type=text], input[type=password], select { width: 100%; margin-top: 6px; padding: 10px 12px; min-height: 44px; font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; }
button { font: inherit; }
button.primary { width: 100%; min-height: 44px; margin-top: 8px; border: 0; border-radius: 8px; background: var(--accent); color: var(--accent-text); font-weight: 700; cursor: pointer; }
button.primary:hover { filter: brightness(1.08); }
.error { color: var(--error); font-weight: 600; margin: 8px 0; }
.notice { background: var(--notice-bg); border: 1px solid var(--notice-line); border-radius: 10px; padding: 10px 14px; margin: 0 0 14px; }
.hint { color: var(--muted); font-size: 13px; margin: 14px 0 0; }
.empty { padding: 28px 12px; text-align: center; color: var(--muted); background: var(--surface); border: 1px dashed var(--line); border-radius: 12px; }
.empty strong { color: var(--text); }
.more { margin: 14px 0 0; }
.queried { color: var(--muted); margin: 10px 0 4px; }
.state { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; margin: 8px 0 14px; }

.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.filters select { width: auto; margin: 0; flex: 1 1 140px; }
.filters button, .search button { min-height: 44px; padding: 0 18px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; }
.search { display: flex; gap: 8px; margin-bottom: 14px; }
.search input { margin: 0; flex: 1; min-width: 0; }
.search button.primary { width: auto; margin: 0; border: 0; }

.tablewrap { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12.5px; color: var(--muted); font-weight: 600; background: var(--bg); }
tbody tr:last-child td { border-bottom: 0; }
.addr { font: 13px/1.5 ui-monospace, "SF Mono", Menlo, Consolas, monospace; word-break: break-all; overflow-wrap: anywhere; }
a.addr { text-decoration: none; }
a.addr:hover { text-decoration: underline; }
.kind, .tag { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.kind.add { color: var(--lock); background: var(--lock-bg); }
.kind.remove { color: var(--unlock); background: var(--unlock-bg); }
.kind.destroy { color: var(--destroy); background: var(--destroy-bg); }
.tag.done { background: var(--done-bg); }
.tag.open { background: var(--open-bg); color: var(--muted); }

.chart { width: 100%; height: auto; display: block; }
.chart rect.eth, .sw.eth { fill: var(--eth); background: var(--eth); }
.chart rect.tron, .sw.tron { fill: var(--tron); background: var(--tron); }
.chart .axis { stroke: var(--line); stroke-width: 1; }
.chart .tick { fill: var(--muted); font-size: 11px; }
.legend { color: var(--muted); font-size: 13px; margin: 0 0 6px; }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin: 0 4px 0 10px; }
.sw:first-child { margin-left: 0; }
details { margin-top: 10px; }
summary { cursor: pointer; color: var(--accent); min-height: 32px; }

@media (max-width: 720px) {
  main { padding: 14px 12px 32px; }
  /* header: brand and account on the first row, the four sections as equal tabs below */
  header { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; padding: 8px 12px; }
  .brand { grid-column: 1; grid-row: 1; margin: 0; }
  .who { grid-column: 2; grid-row: 1; }
  nav { grid-column: 1 / -1; grid-row: 2; display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
  nav a { justify-content: center; padding: 8px 4px; }
  /* the charts are scaled down to the screen width, so their text must be larger in chart units */
  .chart .tick { font-size: 22px; }
  .tablewrap { border: 0; background: none; }
  table, tbody, tr, td { display: block; width: 100%; }
  thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  tr { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 6px 12px; margin-bottom: 10px; }
  td { display: flex; gap: 12px; padding: 5px 0; border: 0; }
  td::before { content: attr(data-label); flex: 0 0 64px; color: var(--muted); font-size: 12.5px; padding-top: 2px; }
  .card .tablewrap tr { background: var(--bg); }
}
@media (prefers-reduced-motion: no-preference) {
  a, button, nav a { transition: background-color .12s ease, color .12s ease; }
}
