/* 金狗雷达 —— 深色主题, 自包含零 CDN */
:root {
  --bg: #0e1217; --panel: #161c24; --panel2: #1d2530; --line: #2a3442;
  --fg: #dce5ef; --dim: #7d8ea3; --acc: #3ea6ff; --acc-dim: #1e4f78;
  --up: #26d07c; --down: #ff5d5d; --warn: #f5a623; --danger: #ff5d5d;
  --safe: #26d07c;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font: 13px/1.45 -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--fg);
  display: flex; flex-direction: column;
  overflow-x: hidden;      /* 手机端防水平溢出(卡片被裁的根因) */
  max-width: 100vw;
}
button { font: inherit; cursor: pointer; }
input, select {
  font: inherit; background: var(--panel2); color: var(--fg);
  border: 1px solid var(--line); border-radius: 6px; padding: 5px 8px; outline: none;
}
input:focus, select:focus { border-color: var(--acc); }

/* header */
header {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 10px 14px; background: var(--panel); border-bottom: 1px solid var(--line);
}
.brand { font-size: 17px; font-weight: 700; white-space: nowrap; }
.brand .sub { font-size: 12px; font-weight: 400; color: var(--dim); margin-left: 8px; }
.brand .sub.ok { color: var(--safe); }
.lookup { display: flex; gap: 6px; flex: 1 1 240px; min-width: 0; max-width: 640px; }
.lookup input { flex: 1 1 140px; min-width: 0; font-family: ui-monospace, Menlo, monospace; }
.lookup button { background: var(--acc); border: none; color: #fff; border-radius: 6px; padding: 5px 14px; font-weight: 600; }
.counts { margin-left: auto; color: var(--dim); white-space: nowrap; }
@media (max-width: 720px) { .counts { margin-left: 0; } }
.counts b { color: var(--fg); }

/* status strip */
.statusbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px;
  padding: 6px 14px; background: #11161d; border-bottom: 1px solid var(--line);
  font-size: 12px;
}
.sources { display: flex; gap: 6px; flex-wrap: wrap; }
.src { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px;
  border-radius: 10px; background: var(--panel2); color: var(--dim); cursor: default; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #555; display: inline-block; }
.dot.healthy { background: var(--safe); box-shadow: 0 0 4px var(--safe); }
.dot.degraded { background: var(--warn); }
.dot.down { background: var(--danger); box-shadow: 0 0 4px var(--danger); }
.dot.disabled, .dot.unknown { background: #4a5560; }
.coverage { color: var(--dim); }
.coverage .chip-mini { background: var(--panel2); border-radius: 4px; padding: 1px 6px; margin-right: 4px; }

/* filters */
.filters { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 8px 14px; }
.chipgroup { display: flex; gap: 4px; }
.chip {
  background: var(--panel2); color: var(--dim); border: 1px solid var(--line);
  border-radius: 12px; padding: 2px 10px; font-size: 12px;
}
.chip.on { background: var(--acc-dim); color: #cfe7ff; border-color: var(--acc); }
label.chk { display: flex; align-items: center; gap: 4px; color: var(--dim); }
.filters input[type=number] { width: 90px; }

/* main table */
main { flex: 1; overflow: auto; padding: 0 8px 12px; }
.tablewrap { max-width: 1400px; margin: 0 auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 6px 8px; border-bottom: 1px solid #1a222c; white-space: nowrap; }
th { position: sticky; top: 0; background: var(--bg); color: var(--dim); font-weight: 500; z-index: 2; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tbody tr { cursor: pointer; }
tbody tr:hover { background: #1a232e; }
tbody tr.q { border-left: 2px solid var(--acc); }
.sym { font-weight: 600; }
.addr { color: var(--dim); font-size: 11px; font-family: ui-monospace, Menlo, monospace; max-width: 140px; overflow: hidden; text-overflow: ellipsis; }
.age { color: var(--dim); font-variant-numeric: tabular-nums; }
.up { color: var(--up); } .down { color: var(--down); }
.badge { border-radius: 4px; padding: 1px 6px; font-size: 11px; }
.badge.verified_safe { background: #123324; color: var(--safe); }
.badge.honeypot { background: #3a1216; color: var(--danger); }
.badge.risky { background: #3a2a10; color: var(--warn); }
.badge.unverified { background: #232c38; color: var(--dim); }
.badge.ai-high { background: #123324; color: var(--safe); font-weight: 700; }
.badge.ai-mid { background: #3a2a10; color: var(--warn); font-weight: 700; }
.badge.ai-low { background: #232c38; color: var(--dim); }
.scorebtn { background: var(--acc); border: none; color: #fff; border-radius: 6px; padding: 4px 12px; margin-top: 6px; }
.launch { color: var(--dim); font-size: 11px; background: var(--panel2); padding: 1px 6px; border-radius: 4px; }
.empty { text-align: center; color: var(--dim); padding: 60px 0; }
.lkbusy { opacity: .6; }

/* drawer */
.drawer {
  position: fixed; top: 0; right: 0; width: min(420px, 92vw); height: 100%;
  background: var(--panel); border-left: 1px solid var(--line);
  overflow-y: auto; z-index: 50; padding: 14px; transition: transform .15s ease;
}
.drawer.hidden { transform: translateX(105%); }
.drawer-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.drawer-head #dSymbol { font-size: 16px; font-weight: 700; flex: 1; }
.drawer-head button { background: none; border: none; color: var(--dim); font-size: 15px; }
.dsec { margin: 10px 0; }
.dsec h4 { margin: 0 0 6px; font-size: 12px; color: var(--dim); }
.kv { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; border-bottom: 1px dashed #1c2530; }
.kv .k { color: var(--dim); } .kv .v { text-align: right; word-break: break-all; }
.kv .v.mono { font-family: ui-monospace, Menlo, monospace; font-size: 12px; }
.flagrow { padding: 2px 0; }
.flagrow .pass { color: var(--safe); } .flagrow .fail { color: var(--danger); }
.flagrow .info { color: var(--dim); }
pre.sec { background: #0f141b; border: 1px solid var(--line); border-radius: 6px; padding: 8px;
  font-size: 11px; overflow: auto; max-height: 180px; white-space: pre-wrap; word-break: break-all; }

/* toasts */
#toasts { position: fixed; top: 60px; right: 14px; z-index: 100; display: flex; flex-direction: column; gap: 8px; max-width: 340px; }
.toast {
  background: var(--panel2); border: 1px solid var(--line); border-left-width: 4px;
  border-radius: 8px; padding: 10px 12px; box-shadow: 0 6px 20px #0008; animation: slidein .2s ease;
}
.toast .t { font-weight: 700; margin-bottom: 2px; }
.toast .b { color: var(--dim); font-size: 12px; word-break: break-all; }
.toast.good { border-left-color: var(--safe); } .toast.warn { border-left-color: var(--warn); }
.toast.danger { border-left-color: var(--danger); } .toast.info { border-left-color: var(--acc); }
@keyframes slidein { from { transform: translateX(30px); opacity: 0; } }
.copybtn { font-size: 11px; background: var(--panel2); border: 1px solid var(--line);
  border-radius: 4px; padding: 1px 6px; color: var(--dim); }


/* ================= 卡片视图(手机优先, 对标博主 UI 的信息层级) ================= */
.cards { max-width: 1400px; margin: 0 auto; display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); padding: 4px 6px; }
@media (max-width: 720px) { .cards { grid-template-columns: 1fr; } }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  overflow: hidden; cursor: pointer; max-width: 100%; min-width: 0; }
.card.q { border-color: var(--acc-dim); }
.card-head { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px 6px; min-width: 0; }
.card-logo { width: 42px; height: 42px; border-radius: 50%; object-fit: cover;
  background: var(--panel2); flex: none; }
.card-title { flex: 1; min-width: 0; }
.card-sym { font-size: 19px; font-weight: 800; letter-spacing: .2px; }
.card-sub { color: var(--dim); font-size: 12px; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; }
.tag { display: inline-block; font-size: 11px; border-radius: 4px; padding: 0 5px;
  margin-right: 4px; background: var(--panel2); color: var(--dim); }
.tag.chain { background: #1e3a5f; color: #9fc7ff; }
.badges { display: flex; flex-direction: column; align-items: flex-end; gap: 4px;
  flex: none; max-width: 100px; }
.push-badge { font-size: 11px; border-radius: 10px; padding: 1px 8px;
  background: #3a2a10; color: var(--warn); white-space: nowrap; }
.push-badge.first { background: #16324a; color: #8fc4ff; }

.card-mid { display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 6px 12px; border-top: 1px solid #1a222c; border-bottom: 1px solid #1a222c; }
.card-mid .when { color: var(--dim); font-size: 12px; line-height: 1.5;
  flex: 1 1 auto; min-width: 0; }
.card-mid .when div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-mid .card-mult { flex: none; }
.card-mid .when b { color: var(--fg); font-size: 15px; }
.card-mult { font-size: 26px; font-weight: 900; color: var(--warn); font-variant-numeric: tabular-nums; }
.card-mult.down { color: var(--dim); }

.card-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.card-grid .cell { padding: 7px 8px; border-right: 1px solid #1a222c; border-bottom: 1px solid #1a222c; min-width: 0; }
.card-grid .cell:nth-child(4n) { border-right: none; }
.cell .k { color: var(--dim); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 420px) {
  .cell .k { font-size: 10px; } .cell .v { font-size: 15px; }
  .card-mult { font-size: 22px; } .card-sym { font-size: 17px; }
  .card-actions a, .card-actions button { min-width: 56px; font-size: 12px; }
}
.cell .v { font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cell .v.up { color: var(--up); } .cell .v.down { color: var(--down); }
.cell .v.safe { color: var(--safe); } .cell .v.dim { color: var(--dim); font-weight: 400; }

.card-narr { padding: 8px 12px; border-bottom: 1px solid #1a222c; }
.card-narr .label { color: var(--acc); font-weight: 700; font-size: 12px; margin-right: 6px; }
.card-narr .text { font-size: 13px; line-height: 1.5; color: #b9c6d6;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card-ai { padding: 8px 12px; border-bottom: 1px solid #1a222c; font-size: 13px; line-height: 1.6; }
.card-ai .r { color: var(--safe); } .card-ai .k { color: var(--danger); }

.card-actions { display: flex; gap: 6px; padding: 8px 10px; flex-wrap: wrap; }
.card-actions a, .card-actions button {
  flex: 1; text-align: center; text-decoration: none; font-size: 13px;
  background: var(--panel2); color: #a9c7ea; border: 1px solid var(--line);
  border-radius: 7px; padding: 6px 4px; min-width: 64px;
}
.card-actions button.score { background: var(--acc-dim); color: #cfe7ff; border-color: var(--acc); }
.card-actions .disabled { opacity: .35; pointer-events: none; }


/* ================= 模拟盘 ================= */
.paper-stats { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  max-width: 1400px; margin: 8px auto; padding: 0 6px; }
.pstat { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.pstat .t { color: var(--dim); font-size: 12px; }
.pstat .v { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; margin: 2px 0; }
.pstat .s { color: var(--dim); font-size: 11px; }
.paper-note { max-width: 1400px; margin: 4px auto 10px; padding: 0 6px; color: var(--dim); font-size: 12px; line-height: 1.6; }
.paper-h { max-width: 1400px; margin: 16px auto 6px; padding: 0 8px; font-size: 14px; color: var(--fg); }
.paper-h span { color: var(--dim); font-weight: 400; font-size: 12px; }
#paperOpen, #paperClosed { background: var(--panel); }
#viewSwitch .chip { cursor: pointer; }
