:root {
  --bg: #0f1220;
  --panel: #181c2e;
  --panel-2: #1f2438;
  --text: #e6e9f2;
  --muted: #9aa3bd;
  --accent: #6ea8fe;
  --border: #2a3050;
  --product: #4f9dff;
  --company: #4fd08a;
  --person: #ffb24f;
  --vc_firm: #c98bff;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 13px;
}

#app {
  display: flex;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

#sidebar {
  width: 320px;
  min-width: 320px;
  height: 100%;
  overflow-y: auto;
  background: var(--panel);
  border-right: 1px solid var(--border);
  padding: 14px;
}

.brand h1 {
  margin: 0;
  font-size: 20px;
  letter-spacing: 1px;
  background: linear-gradient(90deg, #6ea8fe, #c98bff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.brand p {
  margin: 2px 0 12px;
  color: var(--muted);
  font-size: 12px;
}

.panel {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 12px;
}
.panel h2 {
  margin: 0 0 8px;
  font-size: 13px;
  color: var(--accent);
  font-weight: 600;
}
.hint { color: var(--muted); font-size: 11px; margin: 0 0 8px; line-height: 1.5; }

input[type="text"] {
  width: 100%;
  background: #11142a;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 7px 9px;
  font-size: 12px;
  outline: none;
}
input[type="text"]:focus { border-color: var(--accent); }
#search { margin-bottom: 8px; }

.type-filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.type-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #11142a;
  font-size: 11px;
  user-select: none;
}
.type-chip input { display: none; }
.type-chip .dot { width: 9px; height: 9px; border-radius: 50%; }
.type-chip.off { opacity: 0.4; }

.btn-row { display: flex; gap: 8px; }
button {
  background: var(--accent);
  color: #0c1020;
  border: none;
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 12px;
  cursor: pointer;
  font-weight: 600;
  flex: 1;
}
button:hover { filter: brightness(1.08); }
#path-run { margin-top: 8px; width: 100%; }
.path-inputs { display: flex; gap: 8px; }
.path-inputs input { flex: 1; }

.path-result {
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.6;
  max-height: 160px;
  overflow-y: auto;
  word-break: break-all;
}
.path-result .status-ok { color: var(--company); }
.path-result .status-unreachable,
.path-result .status-same,
.path-result .status-invalid { color: #ff7a7a; }
.path-node {
  display: inline-block;
  background: #11142a;
  border: 1px solid var(--accent);
  border-radius: 6px;
  padding: 2px 6px;
  margin: 2px 3px 2px 0;
}
.path-arrow { color: var(--muted); margin: 0 2px; }

.stats-top { display: flex; flex-direction: column; gap: 4px; }
.top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 8px;
  background: #11142a;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid transparent;
}
.top-row:hover { border-color: var(--accent); }
.top-row .rank { color: var(--muted); width: 18px; }
.top-row .name { flex: 1; margin: 0 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-row .deg { color: var(--accent); font-weight: 600; }

.stats-list { display: flex; flex-direction: column; gap: 4px; }
.stat-item {
  display: flex;
  justify-content: space-between;
  padding: 5px 8px;
  background: #11142a;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid transparent;
}
.stat-item:hover { border-color: var(--accent); }
.stat-item .label { display: flex; align-items: center; gap: 6px; }
.stat-item .dot { width: 9px; height: 9px; border-radius: 50%; }
.stat-item .count { color: var(--accent); font-weight: 600; }

#stage {
  position: relative;
  flex: 1;
  height: 100%;
  overflow: hidden;
}
#graph { display: block; width: 100%; height: 100%; cursor: grab; }
#graph.grabbing { cursor: grabbing; }

.legend {
  position: absolute;
  left: 12px;
  bottom: 12px;
  background: rgba(15,18,32,0.8);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 11px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.legend .item { display: flex; align-items: center; gap: 6px; }
.legend .dot { width: 10px; height: 10px; border-radius: 50%; }

.node-info {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 280px;
  max-height: calc(100% - 24px);
  overflow-y: auto;
  background: rgba(24,28,46,0.96);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
}
.node-info.hidden { display: none; }
.node-info h3 { margin: 0 0 4px; font-size: 15px; }
.node-info .type-tag {
  display: inline-block; font-size: 11px; padding: 2px 7px; border-radius: 999px;
  margin-bottom: 8px;
}
.node-info .desc { color: var(--muted); line-height: 1.6; margin-bottom: 8px; }
.node-info .meta { display: flex; gap: 12px; margin-bottom: 8px; font-size: 12px; }
.node-info .meta b { color: var(--accent); }
.node-info .aliases { color: var(--muted); font-size: 11px; margin-bottom: 8px; }
.node-info .neighbors-title { font-size: 12px; color: var(--accent); margin-bottom: 4px; }
.node-info .neighbor {
  display: inline-block; background: #11142a; border: 1px solid var(--border);
  border-radius: 6px; padding: 2px 6px; margin: 2px 3px 2px 0; cursor: pointer; font-size: 11px;
}
.node-info .neighbor:hover { border-color: var(--accent); }
.node-info .close { position: absolute; top: 8px; right: 10px; cursor: pointer; color: var(--muted); }

.zoom-controls {
  position: absolute;
  right: 12px;
  bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.zoom-controls button {
  width: 34px; height: 34px; padding: 0; font-size: 16px; border-radius: 8px;
  background: rgba(24,28,46,0.96); color: var(--text); border: 1px solid var(--border);
}
