:root {
--bg: #ffffff;
--fg: #1a1a1a;
--muted: #6b7280;
--panel: #f6f7f9;
--border: #e2e5ea;
--edge: #cbd2dc;
--edge-strong: #4b5563;
--dir: #475569;
--file: #2563eb;
--func: #16a34a;
--type: #d97706;
--var: #9333ea;
--ext: #64748b;
--accent: #ef4444;
}
@media (prefers-color-scheme: dark) {
:root {
--bg: #0f1115;
--fg: #e6e8eb;
--muted: #9aa4b2;
--panel: #171a21;
--border: #262b36;
--edge: #333c4a;
--edge-strong: #94a3b8;
--dir: #94a3b8;
}
}
* {
box-sizing: border-box;
}
[hidden] {
display: none !important;
}
html,
body {
margin: 0;
height: 100%;
background: var(--bg);
color: var(--fg);
font: 13px/1.4 system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}
#app {
display: flex;
flex-direction: column;
height: 100%;
}
header {
display: flex;
gap: 14px;
align-items: center;
flex-wrap: wrap;
padding: 8px 12px;
border-bottom: 1px solid var(--border);
background: var(--panel);
}
header h1 {
font-size: 13px;
margin: 0;
font-weight: 600;
}
header .stat {
color: var(--muted);
}
header label {
display: inline-flex;
gap: 4px;
align-items: center;
cursor: pointer;
}
header input[type=search] {
padding: 3px 7px;
border: 1px solid var(--border);
border-radius: 5px;
background: var(--bg);
color: var(--fg);
}
header button {
padding: 3px 10px;
border: 1px solid var(--border);
border-radius: 5px;
background: var(--bg);
color: var(--fg);
cursor: pointer;
}
header button:hover {
border-color: var(--edge-strong);
}
header #focusCtl {
display: inline-flex;
gap: 6px;
align-items: center;
color: var(--muted);
}
header #focusCtl button {
padding: 1px 8px;
}
header #focusLabel {
color: var(--fg);
font-weight: 600;
max-width: 220px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
#stage {
flex: 1;
overflow: hidden;
position: relative;
}
#scene {
position: absolute;
inset: 0;
width: 100%;
height: 100%;
display: block;
cursor: grab;
touch-action: none;
}
#scene:active {
cursor: grabbing;
}
#sidePanel {
position: absolute;
top: 10px;
right: 10px;
width: 232px;
max-height: calc(100% - 20px);
overflow: auto;
background: var(--panel);
border: 1px solid var(--border);
border-radius: 8px;
padding: 10px 12px;
font-size: 12px;
box-shadow: 0 6px 20px rgba(0, 0, 0, 0.14);
}
#sidePanel h2 {
font-size: 12px;
margin: 0 24px 2px 0;
word-break: break-all;
}
#sidePanel .sp-kind {
color: var(--muted);
font-size: 10px;
text-transform: uppercase;
letter-spacing: .04em;
}
#sidePanel .sp-group {
margin-top: 9px;
color: var(--muted);
font-size: 10px;
text-transform: uppercase;
letter-spacing: .04em;
}
#sidePanel .row {
display: block;
width: 100%;
text-align: left;
border: 0;
background: none;
color: var(--fg);
font: inherit;
padding: 3px 4px;
border-radius: 4px;
cursor: pointer;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
#sidePanel .row:hover {
background: var(--border);
}
#sidePanel .sp-close {
position: absolute;
top: 6px;
right: 8px;
border: 0;
background: none;
color: var(--muted);
cursor: pointer;
font-size: 16px;
line-height: 1;
}
.legend {
position: absolute;
right: 10px;
bottom: 10px;
background: var(--panel);
border: 1px solid var(--border);
border-radius: 6px;
padding: 8px 10px;
pointer-events: none;
}
.legend div {
display: flex;
align-items: center;
gap: 6px;
margin: 2px 0;
color: var(--muted);
}
.dot {
width: 9px;
height: 9px;
border-radius: 50%;
display: inline-block;
}
.dot.sq {
border-radius: 2px;
}
#status {
position: absolute;
left: 10px;
bottom: 10px;
color: var(--muted);
background: var(--panel);
border: 1px solid var(--border);
border-radius: 6px;
padding: 4px 8px;
font-size: 11px;
opacity: 0;
transition: opacity .3s ease;
pointer-events: none;
}
#status.show {
opacity: 1;
}
.graph-tooltip {
position: absolute;
pointer-events: none;
background: var(--panel);
color: var(--fg);
border: 1px solid var(--border);
border-radius: 6px;
padding: 6px 10px;
font-size: 11px;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
display: none;
z-index: 100;
max-width: 320px;
word-break: break-all;
line-height: 1.4;
}
.graph-tooltip .tt-title {
font-weight: 600;
margin-bottom: 2px;
display: flex;
align-items: center;
gap: 6px;
}
.graph-tooltip .tt-kind {
font-size: 10px;
text-transform: uppercase;
padding: 1px 4px;
border-radius: 3px;
background: var(--border);
}
.graph-tooltip .tt-path {
color: var(--muted);
}
.graph-tooltip .tt-meta {
color: var(--muted);
font-size: 10px;
margin-top: 2px;
}