:root {
  --bg: #ffffff;
  --tx: #17202a;
  --mt: #5c6b7a;
  --bd: #e6edf5;
  --sf: #f4f7fb;
  --pr: #2787e4;
  --ph: #1b6fc4;
  --dg: #dc2626;
  --ok: #15803d;
  color: var(--tx);
  font-family: system-ui, sans-serif;
  background: var(--bg);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--tx); }
button, input, textarea { font: inherit; color: var(--tx); }
button {
  min-height: 44px;
  font-weight: 650;
  padding: 8px 14px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: var(--pr);
  color: #fff;
  cursor: pointer;
}
button:hover { background: var(--ph); }
button.gh { background: #fff; color: #334155; border-color: #cbd5e1; }
button.gh:hover { background: var(--sf); }
button.dg { background: var(--dg); }
button.dg:hover { background: #b91c1c; }
button.x {
  width: 44px;
  height: 44px;
  padding: 0;
  font-size: 26px;
  line-height: 1;
  background: #fff;
  color: var(--tx);
  border: 1px solid var(--bd);
}
input, textarea {
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  padding: 10px 12px;
}
textarea { display: block; width: 100%; min-height: 140px; resize: vertical; line-height: 1.5; }
code { color: #1e3a8a; background: #eff6ff; border-radius: 6px; padding: 2px 6px; }
.gate {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #eef3f8;
}
.gate[hidden] { display: none; }
.gate-card {
  width: min(100%, 360px);
  margin: 0;
  padding: 32px 28px 28px;
  background: #fff;
  border: 1px solid var(--bd);
  border-radius: 20px;
  box-shadow: 0 16px 40px rgba(23, 32, 42, 0.06);
}
.gate-mark {
  margin: 0;
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--pr);
}
.gate-card h1 {
  margin: 8px 0 22px;
  font-size: 28px;
  font-weight: 680;
  letter-spacing: -0.03em;
}
.gate-card input {
  display: block;
  width: 100%;
  min-height: 48px;
  margin: 0;
}
.gate-err {
  min-height: 1.3em;
  margin: 10px 0 0;
  color: #b91c1c;
  font-size: 13px;
}
.gate-card button { width: 100%; margin-top: 14px; }
.home { max-width: 440px; padding: 8px 4px 20px; }
.home h1 { margin: 0 0 18px; font-size: 22px; font-weight: 650; }
.gb {
  margin: 0;
  font-size: 64px;
  font-weight: 720;
  letter-spacing: -0.04em;
  line-height: 0.95;
}
.unit { margin: 6px 0 0; font-size: 18px; color: var(--mt); }
.period { margin: 10px 0 0; color: var(--mt); font-size: 14px; line-height: 1.45; }
.home .open-manage { margin-top: 22px; }
.split { margin: 14px 0 0; display: grid; gap: 8px; }
.split-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; font-size: 14px; }
.split-l { color: var(--mt); }
.split-v { font-variant-numeric: tabular-nums; font-weight: 600; }
.split-bar { grid-column: 1 / -1; height: 6px; border-radius: 3px; background: rgba(127,127,127,.15); overflow: hidden; }
.split-bar i { display: block; height: 100%; border-radius: 3px; }
.split-v + .split-bar i { background: #2563eb; }
.split-d .split-bar i { background: #16a34a; }
.split-u .split-bar i { background: #9ca3af; }
.msg { min-height: 1.3em; color: var(--mt); font-size: 13px; margin: 8px 0; }
.er { color: #b91c1c; }
.ok { color: var(--ok); }
.of { color: var(--mt); }
.hint { color: var(--mt); font-size: 13px; line-height: 1.45; margin: 6px 0 10px; }
.domain-filter { display: block; width: 100%; min-height: 44px; margin: 0 0 8px; }
.wlist {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 320px;
  margin: 0 0 4px;
  padding-right: 4px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #9eb4cc transparent;
}
.wlist::-webkit-scrollbar { width: 10px; }
.wlist::-webkit-scrollbar-track { background: transparent; }
.wlist::-webkit-scrollbar-thumb {
  background: #b7c9dc;
  border: 3px solid transparent;
  border-radius: 99px;
  background-clip: padding-box;
}
.wlist::-webkit-scrollbar-thumb:hover { background: #8eabc8; background-clip: padding-box; border: 3px solid transparent; }
.wrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 52px;
  padding: 6px 6px 6px 12px;
  border: 1px solid var(--bd);
  border-radius: 12px;
  background: #fff;
}
.wrow code { overflow-wrap: anywhere; background: transparent; padding: 0; }
.wrow .chip {
  margin-left: auto;
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 650;
  color: var(--pr);
  background: #e8f3fc;
  border-radius: 999px;
  padding: 3px 8px;
  white-space: nowrap;
}
.wrow button.x { flex: 0 0 auto; }
.empty { margin: 0; color: var(--mt); font-size: 14px; }
.sheet {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: none;
  flex-direction: column;
  background: #fff;
  color: var(--tx);
}
.sheet.open { display: flex; }
.sheet-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px 10px 16px;
  border-bottom: 1px solid var(--bd);
  background: #fff;
}
.sheet-bar h2 { margin: 0; font-size: 18px; }
.sheet-body { flex: 1; overflow: auto; padding: 16px; -webkit-overflow-scrolling: touch; }
.sheet-inner { max-width: 720px; margin: 0 auto; }
.tb { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0; }
.tb input { flex: 1 1 180px; min-width: 0; min-height: 44px; }
.sortbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
}
.sortbar[hidden] { display: none; }
.sortbar label { flex: 0 0 auto; color: var(--mt); font-size: 13px; }
.sortbar select {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 40px;
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  padding: 8px 12px;
}
.peer {
  display: flex;
  align-items: stretch;
  gap: 8px;
  border: 1px solid var(--bd);
  border-radius: 12px;
  padding: 8px 8px 8px 12px;
  margin: 0 0 8px;
  background: #fff;
}
.peer-main { flex: 1 1 auto; min-width: 0; }
.peer-top { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.peer-ip { color: var(--mt); font-size: 13px; margin-top: 2px; }
.peer-bars { margin-top: 8px; display: grid; gap: 5px; }
.pbar { display: grid; grid-template-columns: 118px 1fr; gap: 8px; align-items: center; }
.pbar-l { color: var(--mt); font-size: 12px; line-height: 1.2; white-space: nowrap; }
.pbar-track {
  position: relative;
  height: 22px;
  border-radius: 6px;
  background: rgba(127, 127, 127, .15);
  overflow: hidden;
}
.pbar-track i { display: block; height: 100%; border-radius: 6px; }
.pbar-track b {
  position: absolute;
  right: 8px;
  top: 0;
  height: 22px;
  line-height: 22px;
  font-size: 12px;
  font-weight: 650;
  font-style: normal;
  font-variant-numeric: tabular-nums;
  color: #17202a;
  text-shadow: 0 0 3px #fff, 0 0 3px #fff;
}
.pbar-v .pbar-track i { background: #2563eb; }
.pbar-d .pbar-track i { background: #16a34a; }
.peer-act {
  display: flex;
  flex-direction: column;
  justify-content: stretch;
  gap: 4px;
  margin: 0;
  flex: 0 0 auto;
}
.peer-act button {
  flex: 1 1 0;
  min-height: 28px;
  padding: 4px 8px;
  font-size: 12px;
  border-radius: 8px;
  white-space: nowrap;
}
h3.sec { margin: 18px 0 8px; font-size: 16px; }
.stats {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
  background: #fff;
  flex-direction: column;
}
.stats.open { display: flex; }
.modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(23, 32, 42, .35);
}
.modal.open { display: flex; }
.modal-card {
  width: min(420px, 100%);
  background: #fff;
  border-radius: 16px;
  padding: 28px 22px;
  text-align: center;
}
.probe-wait p, .probe-fail p { margin: 14px 0 0; font-size: 16px; line-height: 1.4; }
.probe-fail[hidden], .probe-wait[hidden] { display: none; }
.probe-actions { display: flex; gap: 8px; margin-top: 18px; }
.probe-actions button { flex: 1 1 0; }
.spin {
  width: 28px;
  height: 28px;
  border: 3px solid #e6edf5;
  border-top-color: var(--pr);
  border-radius: 50%;
  display: inline-block;
  animation: sh-spin .8s linear infinite;
}
@keyframes sh-spin { to { transform: rotate(360deg); } }
.stats-body { flex: 1; overflow: auto; padding: 16px; }
.stats-inner { max-width: 760px; margin: 0 auto; }
.sg { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 8px 0; }
.sc { background: var(--sf); border: 1px solid var(--bd); border-radius: 12px; padding: 10px; }
.sc .v { font-size: 18px; font-weight: 700; overflow-wrap: anywhere; }
.sc .l { color: var(--mt); font-size: 12px; margin-top: 2px; }
.dr {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--bd);
}
.dr code { flex: 1 1 140px; min-width: 0; overflow-wrap: anywhere; }
.dr .b { flex: 1 1 180px; font-size: 13px; color: #334155; }
.dr button { flex: 1 1 160px; min-height: 40px; }
.tag { font-size: 12px; color: var(--mt); }
.brx { fill: #0ea5e9; }
.btx { fill: var(--pr); }
@media (max-width: 420px) {
  .gb { font-size: 48px; }
}
@media (min-width: 800px) {
  .sg { grid-template-columns: repeat(4, 1fr); }
}

.yt { margin: 18px 0 0; display: grid; gap: 8px; }
.yt-h { margin: 0; font-size: 15px; }
.yt-sub { grid-column: 1 / -1; font-size: 12px; color: var(--mt); margin: 0; }

.pick {
  margin: 22px 0 0;
  padding: 12px;
  border: 1px solid var(--bd);
  border-radius: 14px;
  background: var(--sf);
}
.pick h3 { margin: 0; font-size: 15px; }
.pick-now { margin: 8px 0 0; font-size: 18px; font-weight: 680; }
.pick-meta { margin: 4px 0 10px; color: var(--mt); font-size: 13px; }
.pick-row {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(70px, 1fr) auto;
  gap: 8px;
  align-items: center;
  margin: 6px 0;
  font-size: 13px;
}
.pick-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-bar {
  position: relative;
  height: 8px;
  border-radius: 4px;
  background: #e6edf5;
}
.pick-bar i { display: block; height: 100%; border-radius: 4px; background: #dc2626; }
.pick-bar i.ok { background: var(--ok); }
.pick-bar i.wait { background: var(--pr); opacity: .55; }
.pick-bar em {
  position: absolute;
  left: 25%;
  top: -3px;
  width: 1px;
  height: 14px;
  background: #94a3b8;
}
.pick-sec { font-variant-numeric: tabular-nums; color: var(--mt); }
.pick-timer {
  height: 8px;
  margin: 12px 0 6px;
  border-radius: 4px;
  background: #e6edf5;
  overflow: hidden;
}
.pick-timer i { display: block; height: 100%; background: var(--pr); }
.pick-list { margin-top: 8px; max-height: 420px; overflow: auto; }
.pick-row.testing { outline: 1px solid var(--pr); border-radius: 8px; background: #fff; }
.pick-row.selected .pick-name { font-weight: 720; }
#pick-run { width: 100%; margin-top: 8px; }
.pick-best { margin-top: 14px; padding-top: 8px; border-top: 1px solid var(--bd); }
.pick-best h3 { margin: 0 0 8px; }
.pick-best-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  margin: 6px 0;
}
.pick-best-row button { min-height: 36px; padding: 6px 10px; }
