:root {
  --bg: #0f1311;
  --panel: #161c19;
  --line: #26302b;
  --text: #e8efe9;
  --muted: #8aa093;
  --pos: #3fb96a;
  --neg: #e5564b;
  --accent: #4a9d6e;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, "Segoe UI", Roboto, "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}

/* ---- admin-style shell: left sidebar + right content ---- */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 208px; flex-shrink: 0; background: var(--panel);
  border-right: 1px solid var(--line); position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 4px; padding: 16px 12px;
}
.sidebar .logo {
  font-weight: 700; font-size: 16px; padding: 6px 10px 14px; letter-spacing: .3px;
}
.sidebar .logo .dot { color: var(--accent); }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border-radius: 8px; color: var(--muted); text-decoration: none; font-size: 14px;
  border: 1px solid transparent; transition: background .12s, color .12s;
}
.nav-item:hover { background: #1b231f; color: var(--text); }
.nav-item.active { background: #14241a; color: var(--text); border-color: #1c4a30; }
.nav-item .ico { width: 18px; text-align: center; font-size: 15px; }
.sidebar .nav-spacer { flex: 1; }
.sidebar .nav-foot { font-size: 11px; color: var(--muted); padding: 8px 10px; line-height: 1.5; }
.content { flex: 1; min-width: 0; display: flex; flex-direction: column; }

@media (max-width: 760px) {
  .layout { flex-direction: column; }
  .sidebar {
    width: 100%; height: auto; position: static; flex-direction: row;
    overflow-x: auto; gap: 6px; padding: 10px;
  }
  .sidebar .logo { display: none; }
  .sidebar .nav-spacer, .sidebar .nav-foot { display: none; }
  .nav-item { white-space: nowrap; padding: 8px 12px; }
}
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 12px 20px; border-bottom: 1px solid var(--line);
  background: var(--panel); position: sticky; top: 0; z-index: 5;
}
.brand { font-weight: 600; font-size: 16px; }
.target-box { display: flex; align-items: center; gap: 8px; }
#addr {
  width: 360px; max-width: 48vw; padding: 7px 10px; border-radius: 6px;
  border: 1px solid var(--line); background: #0d100e; color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px;
}
#setAddr {
  padding: 7px 14px; border-radius: 6px; border: 1px solid var(--accent);
  background: var(--accent); color: #06120b; font-weight: 600; cursor: pointer;
}
#setAddr:hover { filter: brightness(1.08); }
.pill {
  padding: 3px 10px; border-radius: 999px; font-size: 12px;
  background: #2a211f; color: var(--muted); border: 1px solid var(--line);
}
.pill.ok { background: #10281b; color: var(--pos); border-color: #1c4a30; }
.pill.bad { background: #2a1716; color: var(--neg); border-color: #4a1f1c; }
.muted { color: var(--muted); }
.center { text-align: center; }
main { padding: 20px; max-width: 1180px; margin: 0 auto; }

.cards {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px;
}
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px;
}
.card .label { color: var(--muted); font-size: 12px; margin-bottom: 6px; }
.card .value { font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; }
.card .sub { font-size: 12px; margin-top: 4px; }

.grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 14px; margin-bottom: 18px; }
.panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
  padding: 14px 16px; margin-bottom: 18px;
}
.panel-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }
.panel-head h2 { font-size: 14px; margin: 0; }
.note { color: var(--muted); font-size: 11px; margin: 10px 0 0; line-height: 1.5; }

.tbl { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.tbl th, .tbl td { text-align: right; padding: 7px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl th:first-child, .tbl td:first-child,
.tbl th:nth-child(2), .tbl td:nth-child(2) { text-align: left; }
.tbl th { color: var(--muted); font-weight: 500; font-size: 12px; }

.pos { color: var(--pos); }
.neg { color: var(--neg); }
.tag { padding: 1px 7px; border-radius: 4px; font-size: 11px; }
.tag.long { background: #10281b; color: var(--pos); }
.tag.short { background: #2a1716; color: var(--neg); }

.feed { list-style: none; margin: 0; padding: 0; max-height: 340px; overflow-y: auto; }
.feed li {
  display: flex; align-items: baseline; gap: 8px; padding: 7px 4px;
  border-bottom: 1px solid var(--line); font-size: 13px;
}
.feed li.flash { animation: flash 1.2s ease-out; }
@keyframes flash { from { background: #1d3326; } to { background: transparent; } }
.feed .t { color: var(--muted); font-size: 11px; min-width: 62px; }
.feed .k { font-weight: 600; min-width: 70px; }
.feed .k.open { color: var(--accent); }
.feed .k.close { color: var(--muted); }
.feed .k.liq { color: var(--neg); }
.feed .lat { margin-left: auto; font-size: 11px; font-variant-numeric: tabular-nums; white-space: nowrap; }

.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.tag-manip { background: #2a1716; color: var(--neg); border: 1px solid #4a1f1c; }
.tag-suspect { background: #2a2416; color: #e0b24b; border: 1px solid #4a3f1c; }
.tag-farmer { background: #1a2330; color: #5aa6e0; border: 1px solid #244a66; }
.tag-normal { background: #10281b; color: var(--pos); border: 1px solid #1c4a30; }
.tag-thin { background: #262626; color: var(--muted); border: 1px solid var(--line); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.dot.ok { background: var(--pos); box-shadow: 0 0 6px var(--pos); }
#ovBody tr { cursor: pointer; }
#ovBody tr:hover { background: #1b231f; }
#ovBody tr.sel { background: #14241a; }
.mini { padding: 3px 8px; border-radius: 5px; border: 1px solid var(--line); background: #0d100e; color: var(--muted); cursor: pointer; font-size: 11px; }
.mini:hover { color: var(--neg); border-color: #4a1f1c; }
#reasons { margin-top: 8px; }
.navlink { font-size: 13px; font-weight: 400; color: var(--accent); text-decoration: none; margin-left: 10px; }
.navlink:hover { text-decoration: underline; }
#window, #topN { padding: 6px 8px; border-radius: 6px; border: 1px solid var(--line); background: #0d100e; color: var(--text); font-size: 12px; }
.mini.add { color: var(--pos); border-color: #1c4a30; }
.mini.add:hover { filter: brightness(1.2); }
.addr-cell { white-space: nowrap; }
.addr-full { user-select: all; -webkit-user-select: all; cursor: text; }
.copy { margin-left: 6px; padding: 1px 6px; border-radius: 4px; border: 1px solid var(--line); background: #0d100e; color: var(--muted); cursor: pointer; font-size: 12px; line-height: 1.4; }
.copy:hover { color: var(--accent); border-color: var(--accent); }

@media (max-width: 820px) {
  .cards { grid-template-columns: repeat(2, 1fr); }
  .grid { grid-template-columns: 1fr; }
  #addr { width: 200px; }
}
