* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif; color: #111; }
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: grid; grid-template-columns: 180px 1fr auto; gap: 12px;
  align-items: center; padding: 10px 14px; border-bottom: 1px solid #e5e7eb; background: #fff;
}
.title { font-weight: 700; }
#searchInput { width: 100%; padding: 8px 10px; border: 1px solid #d1d5db; border-radius: 8px; }
.stats { color: #4b5563; font-size: 13px; }

.layout {
  display: grid;
  grid-template-columns: 280px 360px 1fr;
  gap: 10px;
  height: calc(100vh - 58px);
  padding: 10px;
}
.panel {
  border: 1px solid #e5e7eb; border-radius: 10px;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.panel h3 {
  margin: 0; padding: 10px 12px;
  border-bottom: 1px solid #f0f0f0;
  font-size: 14px;
  background: #fafafa;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.tree-actions { display: inline-flex; gap: 6px; }
.tree-actions button {
  border: 1px solid #d1d5db;
  background: #fff;
  color: #374151;
  border-radius: 6px;
  padding: 2px 6px;
  font-size: 12px;
  cursor: pointer;
}
.tree-actions button:hover { background: #f3f4f6; }
.tree, .list, .detail { padding: 10px; overflow: auto; }

.tree-row {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 1px 0;
}
.tree .twisty {
  width: 18px;
  border: 0;
  background: transparent;
  color: #6b7280;
  cursor: pointer;
}
.tree .twisty.placeholder { visibility: hidden; }
.tree .node {
  flex: 1;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
  font-size: 13px;
}
.tree .node:hover { background: #f3f4f6; }
.tree .node.active { background: #e0ecff; color: #1d4ed8; }
.tree .child { margin-left: 10px; border-left: 1px dashed #ddd; padding-left: 8px; }
.tree .child.collapsed { display: none; }

.q-item {
  border: 1px solid #eee; border-radius: 8px; padding: 8px; margin-bottom: 8px;
  cursor: pointer; font-size: 13px;
}
.q-item:hover { background: #fafafa; }
.q-item.active { border-color: #93c5fd; background: #eff6ff; }
.q-meta { color: #6b7280; font-size: 12px; margin-bottom: 4px; }
.q-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.detail h4 { margin: 0 0 8px; }
.detail .block { margin-bottom: 12px; }
.detail .label { color: #6b7280; font-size: 12px; margin-bottom: 2px; }
.detail .value { white-space: pre-wrap; line-height: 1.6; }
.detail ul { margin: 4px 0 0 16px; }
.tag {
  display: inline-block;
  margin: 2px 6px 2px 0;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid #dbeafe;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 12px;
}

@media (max-width: 1100px) {
  .layout { grid-template-columns: 230px 1fr; }
  .right { grid-column: 1 / -1; min-height: 320px; }
}
