:root {
  --bg: #0d1117;
  --panel: #161b22;
  --panel2: #1c2129;
  --panel3: #222833;
  --border: #30363d;
  --border2: #262c35;
  --text: #e6edf3;
  --muted: #8b949e;
  --faint: #848d97;
  --link: #58a6ff;
  --pos: #3fb950;
  --neg: #f85149;
  --warn: #d29922;
  --grid: #21262d;
  /* 各所品牌色, 与 cmp-venues 一致 */
  --v-hl: #50d2c1;
  --v-bn: #f0b90b;
  --v-bg: #4fa3ff;
  --v-bybit: #f7a35c;
  --v-gate: #63d2a6;
  --v-cb: #7d92f5;
  --v-poly: #b98cf0;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg); color: var(--text);
  font: 14px/1.5 -apple-system, "SF Pro Text", "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-text-size-adjust: 100%;
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; color: inherit; }
.num, td.n, th.n { font-variant-numeric: tabular-nums; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }
.pos { color: var(--pos); } .neg { color: var(--neg); }
.muted { color: var(--muted); } .faint { color: var(--faint); }
:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }

/* ── header ── */
header { position: sticky; top: 0; z-index: 30; background: rgba(13,17,23,.95); backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border); }
.hwrap { max-width: 1440px; margin: 0 auto; padding: 8px 16px; display: flex; align-items: center; gap: 16px; }
.brand { display: flex; align-items: center; gap: 8px; white-space: nowrap; color: var(--text); }
.brand:hover { text-decoration: none; }
.logo { font-size: 19px; line-height: 1; }
.title { font-weight: 700; font-size: 16px; }
.title .sub { color: var(--muted); font-weight: 500; font-size: 13px; margin-left: 4px; }
.hsearch { position: relative; flex: 1 1 auto; max-width: 420px; }
.hsearch input { width: 100%; height: 34px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--panel); color: var(--text); font-size: 14px; outline: none; }
.hsearch input:focus { border-color: var(--link); }
body.home .hsearch { visibility: hidden; }
.hstatus { margin-left: auto; display: flex; align-items: center; gap: 8px; font-size: 12px; }
.sites { position: relative; }
.sites > summary { list-style: none; cursor: pointer; user-select: none; border: 1px solid var(--border); border-radius: 999px;
  padding: 2px 9px; color: var(--muted); font-size: 11.5px; white-space: nowrap; }
.sites > summary::-webkit-details-marker { display: none; }
.sites > summary::after { content: " ▾"; font-size: 10px; }
.sites > summary:hover, .sites[open] > summary { color: var(--text); border-color: var(--faint); }
.sitelist { position: absolute; right: 0; top: calc(100% + 6px); z-index: 40; min-width: 240px;
  display: flex; flex-direction: column; gap: 1px; padding: 5px;
  background: var(--panel); border: 1px solid var(--border); border-radius: 9px; box-shadow: 0 10px 28px rgba(0,0,0,.55); }
.xlink { display: flex; align-items: baseline; gap: 7px; border-radius: 6px; padding: 6px 9px;
  color: var(--text); font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.xlink:hover { background: var(--panel2); text-decoration: none; }
.xlink .xsub { color: var(--muted); font-size: 11px; font-weight: 400; }
.xsep { height: 1px; background: var(--border); margin: 3px 4px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--pos); display: inline-block; flex: 0 0 auto;
  animation: pulse 2s infinite; }
.dot.bad { background: var(--neg); animation: none; }
.dot.warn { background: var(--warn); animation: none; }
@keyframes pulse { 0%,100% { opacity: 1 } 50% { opacity: .35 } }
@media (prefers-reduced-motion: reduce) { .dot { animation: none; } }
#updated { white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ── 搜索建议 ── */
.sugg { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 50; background: var(--panel);
  border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 12px 32px rgba(0,0,0,.6); padding: 4px;
  max-height: 70vh; overflow-y: auto; }
.sg { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 7px; cursor: pointer; }
.sg.on, .sg:hover { background: var(--panel3); }
.sg .sk { font-weight: 700; font-size: 14px; min-width: 64px; }
.sg .sz { color: var(--muted); font-size: 12px; }
.sg .scat { font-size: 11px; color: var(--muted); border: 1px solid var(--border); border-radius: 999px; padding: 0 7px; }
.sg .svs { display: flex; gap: 3px; margin-left: auto; }
.sg .soi { color: var(--faint); font-size: 12px; min-width: 64px; text-align: right; }
.sg .sapr { font-size: 12px; min-width: 120px; text-align: right; }
.vd { width: 7px; height: 7px; border-radius: 50%; display: inline-block; opacity: .9; }
.sempty { padding: 10px 12px; color: var(--muted); font-size: 13px; }

/* ── 布局 ── */
main { max-width: 1440px; margin: 0 auto; padding: 14px 16px 28px; min-height: 60vh; }
footer { max-width: 1440px; margin: 0 auto; padding: 14px 16px 28px; color: var(--faint); font-size: 12px; }
.loading { padding: 60px 0; text-align: center; color: var(--muted); }
.card { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; margin: 14px 0; }
.cardhead { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-bottom: 10px; }
.cardhead h2 { font-size: 15px; margin: 0; font-weight: 700; }
.cardhead .hint { color: var(--faint); font-size: 12px; }
.grow { flex: 1 1 auto; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: var(--bg); }
.seg button { border: 0; background: transparent; color: var(--muted); padding: 4px 10px; font-size: 12.5px; cursor: pointer;
  border-right: 1px solid var(--border2); white-space: nowrap; }
.seg button:last-child { border-right: 0; }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--panel3); color: var(--text); font-weight: 600; }
.lbl { color: var(--faint); font-size: 12px; }
.grp { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; }
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border); border-radius: 8px; background: var(--panel2);
  color: var(--text); padding: 4px 11px; font-size: 12.5px; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: var(--faint); text-decoration: none; }
.chk { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 12.5px; cursor: pointer; user-select: none; }
.chk input { accent-color: var(--link); margin: 0; }

/* ── 首页 ── */
.hero { text-align: center; padding: 34px 0 10px; }
.hero h1 { font-size: 26px; margin: 0 0 6px; letter-spacing: .5px; }
.hero .lead { color: var(--muted); margin: 0 0 18px; font-size: 13.5px; }
.bigsearch { position: relative; max-width: 640px; margin: 0 auto; }
.bigsearch input { width: 100%; height: 52px; padding: 0 18px; font-size: 18px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--panel); color: var(--text); outline: none; box-shadow: 0 6px 24px rgba(0,0,0,.25); }
.bigsearch input:focus { border-color: var(--link); }
.bigsearch .sugg { text-align: left; }
.quick { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 14px auto 0; max-width: 760px; }
.qc { border: 1px solid var(--border); border-radius: 999px; padding: 3px 11px; font-size: 12.5px; color: var(--text); background: var(--panel); }
.qc:hover { border-color: var(--faint); text-decoration: none; }
.qc .qa { margin-left: 5px; font-size: 11.5px; }

.vstrip { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 16px 0 4px; }
.vpill { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border); border-radius: 999px; padding: 2px 10px;
  font-size: 12px; color: var(--muted); background: var(--panel); white-space: nowrap; }
.vpill b { color: var(--text); font-weight: 600; }
.vpill.bad { border-color: rgba(248,81,73,.45); }
.vpill.warn { border-color: rgba(210,153,34,.5); }
.vpill .st { font-size: 11px; }

.ctl { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-bottom: 10px; }
.count { color: var(--faint); font-size: 12px; margin-left: auto; }

/* ── 表格通用 ── */
.tscroll { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 8px; }
table { border-collapse: separate; border-spacing: 0; width: 100%; }
th, td { padding: 7px 10px; border-bottom: 1px solid var(--border2); white-space: nowrap; text-align: right; vertical-align: middle; }
th { position: sticky; top: 0; z-index: 2; background: var(--panel2); color: var(--muted); font-weight: 600; font-size: 12px; }
th.l, td.l { text-align: left; }
tbody tr:hover td { background: rgba(88,166,255,.06); }
th.sort { cursor: pointer; user-select: none; }
th.sort:hover { color: var(--text); }
th.sort.on { color: var(--text); }
th.sort.on::after { content: " ▾"; font-size: 10px; }
th.sort.on.asc::after { content: " ▴"; }
.vh { display: inline-flex; align-items: center; gap: 6px; }
.vh .vd { width: 8px; height: 8px; }
.hs { display: block; font-weight: 400; font-size: 10.5px; color: var(--faint); margin-top: 1px; }
.sticky1 { position: sticky; left: 0; z-index: 3; background: var(--panel); }
th.sticky1 { z-index: 4; background: var(--panel2); }
tbody tr:hover td.sticky1 { background: #1a2029; }

/* 首页总表 */
table.all td { font-size: 13px; }
table.all td.k a { color: var(--text); font-weight: 700; }
table.all td.k .zh { color: var(--faint); font-size: 11.5px; margin-left: 6px; font-weight: 400; }
table.all tbody tr { cursor: pointer; }
.cell { display: inline-block; min-width: 64px; padding: 1px 6px; border-radius: 5px; }
.cell .sb { display: block; font-size: 10.5px; color: var(--faint); line-height: 1.2; }
.cat { font-size: 11px; color: var(--muted); border: 1px solid var(--border); border-radius: 999px; padding: 0 7px; }
td.na { color: #4b525c; }
.xw { font-size: 10px; color: var(--warn); margin-left: 3px; }
.more { display: flex; justify-content: center; margin-top: 12px; }

/* ── 币页 ── */
.coinhead { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 6px 16px; padding: 6px 0 2px; }
.ckey { font-size: 30px; font-weight: 800; letter-spacing: .5px; line-height: 1.1; }
.ccat { font-size: 12px; color: var(--muted); border: 1px solid var(--border); border-radius: 999px; padding: 1px 9px; position: relative; top: -5px; }
.czh { color: var(--muted); font-size: 14px; position: relative; top: -4px; }
.cmeta { color: var(--muted); font-size: 13px; padding-bottom: 4px; }
.cmeta b { color: var(--text); font-weight: 600; }
.others { font-size: 12.5px; color: var(--muted); padding-bottom: 4px; }
.notfound { padding: 40px 0; text-align: center; }
.notfound h2 { margin: 0 0 8px; }

table.sum td { font-size: 13px; }
table.sum th, table.sum td { padding-left: 8px; padding-right: 8px; }
table.sum td.venue { min-width: 150px; }
.vname { display: inline-flex; align-items: center; gap: 7px; font-weight: 700; }
.vname .vd { width: 9px; height: 9px; }
.csym { display: block; color: var(--muted); font-size: 11.5px; font-weight: 400; margin-left: 16px; }
.csym a { color: var(--muted); }
.csym a:hover { color: var(--link); }
tr.alt td { background: rgba(255,255,255,.012); }
tr.alt td.venue .vname { font-weight: 500; color: var(--muted); }
tr.alt td.venue .vname .vd { opacity: .45; }
tr.dead td { opacity: .55; }
.tag { display: inline-block; font-size: 10.5px; line-height: 1.5; border-radius: 4px; padding: 0 5px; margin-left: 5px;
  border: 1px solid var(--border); color: var(--muted); font-weight: 400; vertical-align: 1px; }
.tag.w { color: var(--warn); border-color: rgba(210,153,34,.45); }
.tag.r { color: var(--neg); border-color: rgba(248,81,73,.45); }
.big { font-weight: 700; font-size: 14px; }
.sub2 { display: block; font-size: 10.5px; color: var(--faint); line-height: 1.25; }
.sub2.pos { color: rgba(63,185,80,.8); } .sub2.neg { color: rgba(248,81,73,.85); }
td.hi { box-shadow: inset 0 -2px 0 rgba(63,185,80,.65); }
td.lo { box-shadow: inset 0 -2px 0 rgba(248,81,73,.6); }
tfoot td { border-bottom: 0; border-top: 1px solid var(--border); color: var(--muted); font-size: 12px; background: var(--panel2); }
tfoot td .big { color: var(--text); font-size: 13px; }
.cd { font-size: 11px; color: var(--faint); display: block; }
.loadingcell { color: #4b525c; }

/* 图 */
.legend { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 2px 0 10px; }
.lg { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); cursor: pointer; user-select: none; }
.lg input { margin: 0; accent-color: var(--link); }
.lg .sw { width: 16px; height: 0; border-top: 3px solid; border-radius: 2px; }
.lg .sw.d1 { border-top-style: dashed; }
.lg .sw.d2 { border-top-style: dotted; }
.lg.on { color: var(--text); }
.chartbox { position: relative; }
.chartbox canvas { display: block; width: 100%; }
.ctitle { font-size: 12px; color: var(--muted); margin: 4px 0 2px; display: flex; gap: 10px; align-items: baseline; }
.cnote { color: var(--faint); font-size: 11.5px; margin-top: 6px; }
.tip { position: fixed; z-index: 60; pointer-events: none; background: rgba(22,27,34,.97); border: 1px solid var(--border);
  border-radius: 8px; padding: 7px 9px; font-size: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.5); max-width: 320px; }
.tip .tt { color: var(--muted); margin-bottom: 3px; font-variant-numeric: tabular-nums; }
.tip .tr { display: flex; align-items: center; gap: 6px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tip .tr .tl { color: var(--muted); }
.tip .tr .tv { margin-left: auto; padding-left: 12px; font-weight: 600; }
.tip .tr .tc { color: var(--faint); font-weight: 400; padding-left: 8px; min-width: 64px; text-align: right; }

/* 明细表 */
.hscroll { max-height: 620px; overflow: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--border2); border-radius: 8px; }
table.hist th { top: 0; }
table.hist thead tr.r2 th, table.hist thead tr.r3 th { top: auto; position: static; }
table.hist td { font-size: 12.5px; padding: 5px 10px; }
table.hist td.t { text-align: left; color: var(--muted); }
table.hist td.partial { color: var(--faint); font-style: italic; }
table.hist td.partial::after { content: "*"; font-style: normal; color: var(--warn); margin-left: 2px; font-size: 10px; }
table.hist tr.sumr th { background: var(--panel3); color: var(--text); font-weight: 600; font-size: 12.5px; }
table.hist tr.sumr th.l { color: var(--muted); font-weight: 500; }
table.hist .ch { display: block; color: var(--text); }
table.hist .cs { display: block; font-weight: 400; font-size: 10.5px; color: var(--faint); }
tr.day td { border-top: 1px solid var(--border); }
.empty { padding: 26px; text-align: center; color: var(--muted); }

@media (max-width: 860px) {
  .title .sub { display: none; }
  .hwrap { gap: 10px; padding: 7px 12px; }
  main, footer { padding-left: 12px; padding-right: 12px; }
  .sites { display: none; }
  .hero { padding-top: 18px; }
  .hero h1 { font-size: 21px; }
  .bigsearch input { height: 46px; font-size: 16px; }
  .card { padding: 12px 10px; border-radius: 10px; }
  .ckey { font-size: 25px; }
  th, td { padding: 6px 8px; }
  .sg .svs, .sg .soi { display: none; }
  .catcol { display: none; }
  .seg { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .seg::-webkit-scrollbar { display: none; }
  .seg button { flex: 0 0 auto; }
  .hscroll { max-height: 70vh; }
}
@media (max-width: 520px) {
  .title { display: none; }
  #updated { display: none; }
  body.home .hsearch { display: none; }
  .hsearch { max-width: none; }
  .sg .sapr { min-width: 0; }
}
