:root {
    --bg: #efece4;
    --ink: #1c211e;
    --muted: #667068;
    --line: #e2dbd0;
    --paper: #fbfaf6;
    --nav: #24312b;
    --nav-2: #2d3d35;
    --lime: #d6f25c;
    --green: #1f6b4a;
    --fast: #1d7a45;
    --mid: #a97816;
    --slow: #c4541a;
    --bad: #a33b32;
    --shadow: 0 12px 40px rgba(36, 49, 43, .06);
    font-family: "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    color: var(--ink);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, p { margin: 0; }

.app { display: flex; min-height: 100vh; }

.nav {
    width: 248px;
    flex: none;
    background: var(--nav);
    color: #e7eee9;
    display: flex;
    flex-direction: column;
    padding: 22px 14px 16px;
    position: sticky;
    top: 0;
    height: 100vh;
}
.brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; padding: 0 8px; }
.brand svg { width: 28px; height: 28px; fill: none; stroke: var(--lime); stroke-width: 1.6; }
.brand svg circle { fill: var(--lime); stroke: none; }
.brand span { font-family: Palatino, "Palatino Linotype", "Songti SC", serif; font-size: 26px; letter-spacing: .08em; }
.brand-note { color: #9aaba1; font-size: 12px; margin: 8px 8px 18px; }
.nav nav { display: flex; flex-direction: column; gap: 4px; overflow: auto; }
.nav nav a {
    display: flex; flex-direction: column; gap: 2px;
    text-decoration: none; color: inherit;
    padding: 10px 12px; border-radius: 12px;
}
.nav nav a strong { font-size: 14px; font-weight: 650; }
.nav nav a span { font-size: 12px; color: #9aaba1; line-height: 1.4; }
.nav nav a:hover { background: var(--nav-2); }
.nav nav a.on { background: var(--lime); color: #1c2814; }
.nav nav a.on span { color: #3d5228; }
.nav-foot { margin-top: auto; padding: 14px 8px 0; }
.nav-foot a { color: #9aaba1; font-size: 12px; }

.main { flex: 1; min-width: 0; padding: 28px 32px 40px; display: flex; flex-direction: column; gap: 16px; }

.query, .sheet, .insight, .metrics article {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: var(--shadow);
}
.query { padding: 22px 22px 16px; }
.query-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.query h1 { font-size: 28px; font-weight: 650; letter-spacing: -.02em; }
.query-head p { color: var(--muted); margin-top: 4px; }

.seg { display: flex; padding: 3px; background: #efeae1; border-radius: 999px; }
.seg button, .go, .stop, .text-btn, .chip {
    border: 0; background: transparent;
}
.seg button { padding: 6px 14px; border-radius: 999px; color: var(--muted); }
.seg button.on { background: white; color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.06); }

form { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-top: 18px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 120px; }
.field span, .filter-label { font-size: 12px; color: var(--muted); }
.field input, .field select, .field textarea {
    border: 1px solid var(--line); background: white; border-radius: 12px; padding: 11px 12px; outline: none;
}
.field textarea { width: 100%; resize: vertical; min-height: 92px; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--green); }
.grow { flex: 1; min-width: 240px; }
.opt { display: none; }
.show-port .opt-port, .show-method .opt-method, .show-dns .opt-dns, .show-batch .opt-batch { display: flex; }

.go, .stop { height: 44px; padding: 0 18px; border-radius: 12px; }
.go { background: var(--green); color: white; }
.go:disabled { opacity: .55; cursor: default; }
.stop { background: #f3e4df; color: var(--bad); }

.filters { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.filters > div { display: flex; gap: 8px; align-items: flex-start; }
.filter-label { width: 48px; padding-top: 6px; flex: none; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line); background: white; border-radius: 999px; padding: 5px 10px; font-size: 13px; }
.chip.on { background: var(--green); color: white; border-color: var(--green); }
.muted { color: var(--muted); font-size: 13px; font-style: normal; }
.alert { margin-top: 12px; background: #fdeceb; color: var(--bad); border-radius: 10px; padding: 8px 12px; }

.metrics { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.metrics article { padding: 14px 16px; }
.metrics span { color: var(--muted); font-size: 12px; }
.metrics strong { display: block; margin-top: 4px; font-size: 26px; font-variant-numeric: tabular-nums; letter-spacing: -.03em; }
.metrics em { display: block; margin-top: 2px; color: var(--muted); font-style: normal; font-size: 12px; min-height: 16px; }

.progress { height: 3px; background: #e4ddd2; border-radius: 99px; overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; background: var(--green); transition: width .3s ease; }

.workspace { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.sheet { min-width: 0; }
.sheet-bar { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.sheet-bar h2, .insight h2 { font-size: 15px; font-weight: 650; }
.sheet-bar .text-btn { color: var(--green); padding: 0; }
.only-fail { margin-left: auto; font-size: 13px; color: var(--muted); display: flex; gap: 6px; align-items: center; }
#find { width: 180px; border: 1px solid var(--line); border-radius: 10px; padding: 7px 10px; background: white; }
.probe-note { padding: 8px 16px 0; color: var(--muted); font-size: 13px; }
.table-wrap { overflow: auto; max-height: calc(100vh - 280px); }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid #f0ebe3; white-space: nowrap; vertical-align: top; }
th { position: sticky; top: 0; background: #f7f4ee; color: var(--muted); font-weight: 600; font-size: 12px; z-index: 1; }
th.sortable { cursor: pointer; }
tbody tr:hover td { background: #fbf8f2; }
tr.task { cursor: pointer; }
tr.empty td { color: var(--muted); white-space: normal; padding: 28px 16px; }
.hop { color: var(--muted); font-size: 12px; white-space: normal; }
.hop ol { margin: 0; padding-left: 18px; }
.ok { color: var(--fast); }
.fail { color: var(--bad); }

.lat { display: inline-flex; align-items: center; gap: 8px; font-variant-numeric: tabular-nums; }
.lat i { width: 48px; height: 4px; border-radius: 99px; background: #ece7df; position: relative; display: inline-block; }
.lat i::before { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--w); border-radius: inherit; background: currentColor; }
.lv-0 { color: var(--bad); }
.lv-1 { color: var(--fast); }
.lv-2 { color: #3d8f4a; }
.lv-3 { color: var(--mid); }
.lv-4 { color: var(--slow); }

.insight { padding: 16px; position: sticky; top: 16px; }
.insight h3 { margin: 14px 0 8px; font-size: 12px; color: var(--muted); font-weight: 600; }
#map { height: 280px; }
.bars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.bars li { display: grid; grid-template-columns: 72px 1fr auto; gap: 8px; align-items: center; font-size: 12px; }
.bars .track { height: 6px; background: #efeae1; border-radius: 99px; overflow: hidden; }
.bars .track i { display: block; height: 100%; background: var(--green); }
.bars em { font-style: normal; color: var(--muted); font-variant-numeric: tabular-nums; }

@media (max-width: 1100px) {
    .app { display: block; }
    .nav { width: auto; height: auto; position: static; }
    .nav nav { flex-direction: row; overflow: auto; }
    .nav nav a span, .brand-note { display: none; }
    .nav nav a { white-space: nowrap; }
    .nav-foot { margin-top: 0; }
    .main { padding: 16px; }
    .metrics { grid-template-columns: repeat(2, 1fr); }
    .workspace { grid-template-columns: 1fr; }
    .insight { position: static; }
    .table-wrap { max-height: none; }
}
