:root {
  color-scheme: dark;
  --bg: #101212;
  --panel: #171b19;
  --line: #2c342e;
  --text: #f3f6f1;
  --muted: #a4afa3;
  --green: #d1f582;
  --violet: #baa6fa;
  --dim: #222923;
  --mono: Consolas,"SFMono-Regular",monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: radial-gradient(ellipse at 25% -180px,#2a3529 0,transparent 55%),var(--bg);
  color: var(--text);
  font: 16px/1.55 "Segoe UI","PingFang SC","Microsoft YaHei",sans-serif;
  font-variant-numeric: tabular-nums;
}

[hidden] {
  display: none!important;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  cursor: pointer;
  color: inherit;
  touch-action: manipulation;
}

button:focus-visible,a:focus-visible,canvas:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 3px;
}

.frame {
  width: min(1260px,calc(100% - 80px));
  margin: auto;
}

.top {
  border-bottom: 1px solid #2e372e;
  background: #101312c9;
}

.bar {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 680;
  letter-spacing: .02em;
  white-space: nowrap;
}

.logo {
  width: 34px;
  height: 34px;
  background: var(--green);
  border-radius: 9px;
  display: flex;
  gap: 3px;
  align-items: center;
  justify-content: center;
}

.logo i {
  width: 3px;
  height: 9px;
  background: #243221;
  border-radius: 4px;
  transform: rotate(23deg);
}

.logo i:nth-child(2) {
  height: 17px;
}

.logo i:nth-child(3) {
  height: 13px;
}

nav {
  display: flex;
  gap: 33px;
  color: #bfc9be;
  font-size: 14px;
}

nav a:hover {
  color: var(--green);
}

.status {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  font-size: 13px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 10px;
  background: #171c18;
}

.status i,.follow i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #d8b87a;
}

.status[data-live=true] i,.follow[aria-pressed=true] i {
  background: var(--green);
  box-shadow: 0 0 10px #d1f58266;
}

.intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding: 38px 0 28px;
}

.location {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 14px;
  margin: 0 0 8px;
}

.location span {
  width: 8px;
  height: 8px;
  border: 1px solid var(--green);
  transform: rotate(45deg);
  margin-left: 3px;
}

.location b {
  font-weight: 400;
}

h1,h2,p {
  margin: 0;
}

h1 {
  font-size: clamp(36px,5vw,62px);
  font-weight: 750;
  letter-spacing: -.07em;
  line-height: 1.16;
}

h1 span:last-child {
  color: var(--green);
}

.intro-right {
  text-align: right;
  color: var(--muted);
  font-size: 14px;
  padding-bottom: 2px;
}

.intro-right span {
  color: #d8e3d6;
  font: 13px var(--mono);
  letter-spacing: .04em;
}

.intro-right p {
  margin-top: 6px;
}

.dashboard {
  display: grid;
  grid-template-columns: minmax(303px,.92fr) minmax(0,1.8fr);
  gap: 18px;
  align-items: stretch;
}

.panel {
  min-width: 0;
  background: linear-gradient(158deg,#1a1f1b,#161917 60%);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 21px 23px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

h2 {
  font-size: 19px;
  font-weight: 680;
  letter-spacing: .015em;
}

.mono {
  font-family: var(--mono);
  font-size: 13px;
}

.muted {
  color: var(--muted);
}

.tag {
  color: #d9e5d2;
  font-size: 12px;
  border: 1px solid #3d493a;
  border-radius: 999px;
  background: #20291e;
  padding: 3px 9px;
  white-space: nowrap;
}

#proxy-route[data-proxy=true] {
  color: var(--green);
  border-color: #516143;
}

.speed {
  display: flex;
  flex-direction: column;
}

.meter {
  height: 205px;
  position: relative;
  margin: 2px 0 0;
  display: grid;
  place-items: center;
}

.meter canvas {
  width: min(100%,304px);
  height: 190px;
}

.meter-value {
  position: absolute;
  inset: 65px 0 auto;
  text-align: center;
  display: grid;
  justify-items: center;
  line-height: 1;
}

.meter-value small {
  color: var(--muted);
  font-size: 13px;
}

.meter-value strong {
  color: var(--green);
  font-family: var(--mono);
  font-size: clamp(45px,5vw,61px);
  font-weight: 600;
  letter-spacing: -.08em;
  margin: 8px 0 6px;
}

.meter-value span {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 13px;
}

.results {
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  padding: 15px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin: 0 0 16px;
}

.results>div {
  padding: 0 9px;
  display: flex;
  align-items: baseline;
  gap: 4px;
  flex-wrap: wrap;
  line-height: 1.25;
}

.results>div:first-child {
  padding-left: 0;
}

.results>div+div {
  border-left: 1px solid var(--line);
}

.result-label {
  width: 100%;
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 5px;
  white-space: nowrap;
}

.result-label b {
  margin-right: 4px;
  font-size: 16px;
}

.down {
  color: var(--green);
}

.up {
  color: var(--violet);
}

.ping {
  color: #ead59a;
}

.results strong {
  font: 600 clamp(17px,1.8vw,23px) var(--mono);
  letter-spacing: -.07em;
}

.results small {
  font: 11px var(--mono);
  color: var(--muted);
}

.primary {
  background: var(--green);
  color: #192015;
  border: 0;
  border-radius: 9px;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-weight: 720;
  margin-top: auto;
  transition: background .18s,transform .18s;
}

.primary:hover {
  background: #e0ffa2;
}

.primary:active {
  transform: scale(.988);
}

.play {
  width: 0;
  height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 8px solid currentColor;
}

.primary[data-active=true] .play {
  width: 9px;
  height: 9px;
  border: 0;
  background: currentColor;
  border-radius: 1px;
}

.test-note {
  font-size: 13px;
  color: var(--muted);
  margin: 10px 0 0;
  min-height: 2.5em;
}

.test-note[data-error=true] {
  color: #ffb29e;
}

.test-engine {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 12px;
  color: var(--muted);
  font-size: 13px;
}

.test-engine a {
  color: var(--green);
  text-underline-offset: 3px;
}

.test-engine a:hover {
  text-decoration: underline;
}

.chart-toolbar,.range-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 9px 17px;
  color: #cad4c9;
  font-size: 14px;
}

.legend span {
  white-space: nowrap;
}

.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: 1px;
}

.dot.in {
  background: var(--green);
}

.dot.out {
  background: var(--violet);
}

.legend b {
  font: 13px var(--mono);
  color: var(--muted);
  margin-left: 3px;
}

.seg {
  display: flex;
  align-items: center;
  white-space: nowrap;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #121613;
}

.seg button,.follow {
  border: 0;
  background: none;
  border-radius: 5px;
  padding: 5px 9px;
  font-size: 13px;
  color: #aab7aa;
  min-height: 33px;
}

.seg button:hover,.follow:hover {
  color: var(--text);
  background: #263028;
}

.seg button[aria-pressed=true] {
  background: #354233;
  color: #e7f3e3;
}

.chart-wrap {
  height: 220px;
  margin-top: 9px;
  position: relative;
}

#chart,#overview-chart {
  width: 100%;
  height: 100%;
  display: block;
}

#chart {
  cursor: grab;
  touch-action: pan-y;
}

#chart.dragging {
  cursor: grabbing;
}

.empty {
  position: absolute;
  inset: 45% 10% auto;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  pointer-events: none;
}

.tooltip {
  position: absolute;
  z-index: 2;
  top: 15px;
  min-width: 132px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #43503f;
  background: #111712;
  pointer-events: none;
  box-shadow: 0 6px 20px #06090685;
  font: 12px/1.6 var(--mono);
  white-space: pre;
  color: #e2ecdf;
}

.range-row {
  margin-top: 5px;
}

.follow {
  display: flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  padding: 5px 10px;
}

.follow[aria-pressed=true] {
  color: var(--green);
  background: #222d1e;
}

.overview {
  height: 39px;
  margin-top: 9px;
  border: 1px solid #2f392f;
  border-radius: 5px;
  position: relative;
  cursor: grab;
  touch-action: none;
  background: #101611;
  isolation: isolate;
}

.overview:active {
  cursor: grabbing;
}

.selection {
  position: absolute;
  inset: 0 auto 0 0;
  border: 1px solid #9bad7d;
  border-radius: 3px;
  background: #c7f58525;
  box-shadow: 0 0 0 100vmax #0a110c8c;
  clip-path: inset(0 -100vmax);
  pointer-events: none;
}

.overview {
  clip-path: inset(-2px -8px round 6px);
}

.handle {
  position: absolute;
  top: -3px;
  bottom: -3px;
  min-width: 20px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  background: none;
  transform: translateX(-50%);
  cursor: ew-resize;
  touch-action: none;
}

.handle:last-child {
  z-index: 2;
}

.handle::before {
  content: "";
  width: 5px;
  height: 17px;
  background: #b9d496;
  border-radius: 3px;
  box-shadow: 0 0 0 1px #212e1b;
}

.overview-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
  gap: 8px;
  margin-top: 5px;
}

.overview-foot span:first-child {
  font-family: var(--mono);
}

.secondary {
  margin-top: 18px;
  display: grid;
  grid-template-columns: minmax(303px,.92fr) minmax(0,1.8fr);
  gap: 18px;
}

.distribution {
  display: flex;
  align-items: center;
  gap: 20px;
}

.ring {
  --ratio: 0%;
  height: 114px;
  width: 114px;
  flex: 0 0 114px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #2c352d;
}

.ring[data-filled=true] {
  background: conic-gradient(var(--green) 0 var(--ratio),var(--violet) var(--ratio) 100%);
}

.ring>div {
  background: #181d19;
  border-radius: 50%;
  width: 95px;
  height: 95px;
  display: grid;
  align-content: center;
  text-align: center;
}

.ring strong {
  font: 600 16px var(--mono);
}

.ring span {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

.distribution-values {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 7px;
}

.distribution-values div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--muted);
}

.distribution-values div+div {
  border-top: 1px solid var(--line);
  padding-top: 6px;
}

.distribution-values strong {
  white-space: nowrap;
  color: var(--text);
  font: 13px var(--mono);
}

.history-scroll {
  max-height: 190px;
  overflow: auto;
}

table {
  border-collapse: collapse;
  width: 100%;
  text-align: right;
  font-size: 14px;
}

th,td {
  padding: 8px 5px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

th:first-child,td:first-child {
  text-align: left;
}

th {
  color: var(--muted);
  font-weight: 550;
}

td:not(:first-child) {
  font-family: var(--mono);
}

td:nth-child(2) {
  color: var(--green);
}

td:nth-child(3) {
  color: var(--violet);
}

.history-empty {
  color: var(--muted);
  font-size: 14px;
  margin: 15px 0 7px;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #9eaa9f;
  padding: 19px 0 26px;
  font-size: 13px;
}

@media (max-width:1050px) {
  .frame {
    width: calc(100% - 44px);
  }
  .dashboard,.secondary {
    grid-template-columns: minmax(260px,1fr) minmax(0,1.65fr);
  }
  .panel {
    padding: 17px;
  }
  .chart-toolbar {
    gap: 6px;
  }
  .legend {
    gap: 5px 10px;
  }
}

@media (max-width:760px) {
  .frame {
    width: calc(100% - 28px);
  }
  .bar {
    min-height: 56px;
    gap: 12px;
  }
  .logo {
    height: 30px;
    width: 30px;
  }
  .brand {
    font-size: 14px;
    gap: 8px;
  }
  nav {
    gap: 15px;
  }
  nav a:first-child {
    display: none;
  }
  .status {
    padding: 4px 7px;
  }
  .intro {
    padding: 28px 1px 20px;
    align-items: flex-start;
  }
  .intro-right {
    align-self: end;
  }
  .intro-right p {
    display: none;
  }
  .dashboard,.secondary {
    grid-template-columns: minmax(0,1fr);
    gap: 13px;
  }
  .secondary {
    margin-top: 13px;
  }
  .meter {
    height: 177px;
  }
  .meter canvas {
    height: 170px;
  }
  .meter-value {
    top: 55px;
  }
  .results {
    margin-bottom: 13px;
  }
  .results>div {
    justify-content: center;
  }
  .result-label {
    text-align: center;
  }
  .chart-wrap {
    height: 202px;
  }
  .distribution {
    gap: 25px;
  }
  h2 {
    font-size: 18px;
  }
  section {
    scroll-margin-top: 8px;
  }
}

@media (max-width:390px) {
  .frame {
    width: calc(100% - 22px);
  }
  .panel {
    padding: 13px;
  }
  .chart-toolbar {
    flex-wrap: wrap;
  }
  .hint {
    display: none;
  }
  .seg button {
    padding-inline: 7px;
  }
  nav {
    display: none;
  }
  .overview-foot {
    justify-content: center;
  }
  footer {
    font-size: 11px;
  }
}

@media (prefers-reduced-motion:reduce) {
  html {
    scroll-behavior: auto;
  }
  *,*::before,*::after {
    transition: none!important;
  }
}
