:root{
  --bg:#0b0f14;
  --panel:#0f1620;
  --panel2:#0c121a;
  --text:#e7eef7;
  --muted:#9fb2c8;
  --border:rgba(255,255,255,.08);
  --accent:#7dd3fc;
  --good:#86efac;
  --bad:#fda4af;
  --warn:#fbbf24;
  --shadow: 0 10px 30px rgba(0,0,0,.35);
  --radius:14px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --sans: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji","Segoe UI Emoji";
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family:var(--sans);
  background: radial-gradient(1200px 900px at 20% -10%, rgba(125,211,252,.18), transparent 55%),
              radial-gradient(900px 700px at 95% 0%, rgba(134,239,172,.12), transparent 50%),
              var(--bg);
  color:var(--text);
}

a{color:inherit;text-decoration:none}
a:hover{opacity:.92}

.topbar{
  position:sticky; top:0; z-index:20;
  display:flex; gap:18px;
  align-items:center;
  justify-content:space-between;
  padding:14px 18px;
  background: rgba(11,15,20,.85);
  backdrop-filter: blur(10px);
  border-bottom:1px solid var(--border);
}

.brand{display:flex; gap:12px; align-items:center}
.logo{
  display:inline-flex; align-items:center; justify-content:center;
  width:42px; height:42px;
  border-radius:12px;
  background: linear-gradient(135deg, rgba(125,211,252,.25), rgba(134,239,172,.18));
  border:1px solid var(--border);
  box-shadow: var(--shadow);
  font-weight:800;
}
.brand-text .title{font-weight:800; letter-spacing:.2px}
.brand-text .subtitle{font-size:12px;color:var(--muted); margin-top:2px}

.nav{display:flex; gap:10px; flex-wrap:wrap; align-items:center}
.navlink{
  padding:8px 10px;
  border-radius:10px;
  border:1px solid transparent;
  color:var(--muted);
}
.navlink.active{
  color:var(--text);
  border-color: var(--border);
  background: rgba(255,255,255,.04);
}

.actions{display:flex; gap:10px; align-items:center}
.btn{
  display:inline-flex; align-items:center; justify-content:center;
  padding:9px 12px;
  border-radius:12px;
  border:1px solid var(--border);
  background: rgba(255,255,255,.05);
  color:var(--text);
  cursor:pointer;
  user-select:none;
}
.btn:hover{background: rgba(255,255,255,.075)}
.btn.secondary{color:var(--muted)}
.btn:active{transform: translateY(1px)}

.container{
  max-width:1180px;
  margin:0 auto;
  padding:18px;
}

.grid{
  display:grid;
  grid-template-columns: 1.15fr .85fr;
  gap:14px;
}
@media (max-width: 980px){
  .grid{grid-template-columns:1fr}
  .nav{display:none}
}

.card{
  border:1px solid var(--border);
  background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.02));
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow:hidden;
}
.card .hd{
  padding:14px 14px 10px 14px;
  border-bottom:1px solid var(--border);
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:14px;
}
.card .hd h2{
  margin:0;
  font-size:16px;
}
.card .hd p{margin:6px 0 0 0; color:var(--muted); font-size:13px}
.card .bd{padding:14px}

.pills{display:flex; flex-wrap:wrap; gap:8px}
.pill{
  font-family:var(--mono);
  font-size:12px;
  padding:6px 8px;
  border-radius:999px;
  border:1px solid var(--border);
  background: rgba(255,255,255,.03);
  color:var(--muted);
}
.pill.good{color:var(--good)}
.pill.bad{color:var(--bad)}
.pill.warn{color:var(--warn)}

.row{display:flex; gap:10px; align-items:center; flex-wrap:wrap}
.field{display:flex; flex-direction:column; gap:6px; flex:1; min-width:220px}
label{font-size:12px;color:var(--muted)}
select, input[type="text"]{
  padding:10px 10px;
  background: rgba(0,0,0,.22);
  border:1px solid var(--border);
  border-radius:12px;
  color:var(--text);
  outline:none;
}
select:focus, input[type="text"]:focus{
  border-color: rgba(125,211,252,.35);
  box-shadow: 0 0 0 3px rgba(125,211,252,.12);
}

hr.sep{border:0;border-top:1px solid var(--border); margin:14px 0}

.kv{
  display:grid;
  grid-template-columns: 140px 1fr;
  gap:10px 12px;
  font-size:13px;
}
.kv .k{color:var(--muted)}
.kv .v{color:var(--text); line-height:1.45}

.small{font-size:12px;color:var(--muted); line-height:1.5}
.list{margin:0; padding-left:18px; color:var(--text)}
.list li{margin:6px 0}

.footer{
  border-top:1px solid var(--border);
  padding:14px 18px;
  color:var(--muted);
  font-size:12px;
  text-align:center;
}

/* SVG */
.diagram-wrap{
  width:100%;
  overflow:hidden;
}
svg{max-width:100%; height:auto}

.node{cursor:pointer}
.node circle{
  fill: rgba(255,255,255,.06);
  stroke: rgba(255,255,255,.16);
  stroke-width: 2;
}
.node text{
  fill: var(--text);
  font-weight:700;
}
.node .sub{
  fill: var(--muted);
  font-weight:600;
}

.node.active circle{
  stroke: rgba(125,211,252,.75);
  fill: rgba(125,211,252,.10);
}

.edge{
  fill:none;
  stroke-linecap:round;
  stroke-linejoin:round;
  opacity:.9;
}
.edge.sheng{stroke: rgba(134,239,172,.75); stroke-width: 3}
.edge.ke{stroke: rgba(253,164,175,.78); stroke-width: 2.6}
.edge.cheng{stroke: rgba(251,191,36,.9); stroke-dasharray: 6 6; stroke-width: 2.6}
.edge.wu{stroke: rgba(125,211,252,.85); stroke-dasharray: 2 7; stroke-width: 2.6}

.hidden{display:none !important}
.badge{
  display:inline-flex;
  align-items:center;
  gap:6px;
  font-size:12px;
  color:var(--muted);
}
.dot{width:8px;height:8px;border-radius:99px;background:rgba(255,255,255,.25)}
.dot.good{background: rgba(134,239,172,.85)}
.dot.bad{background: rgba(253,164,175,.85)}
.dot.warn{background: rgba(251,191,36,.95)}
.dot.info{background: rgba(125,211,252,.85)}
