/* 工作台（js/pages/workbench.js） */
.wb { display: grid; grid-template-columns: 220px 270px minmax(0, 1fr); align-items: start; gap: 12px; }
.wb-packages, .wb-tree {
  position: sticky;
  top: 12px;
  max-height: calc(100vh - 140px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--sheet);
}
.wb-search { width: calc(100% - 16px); margin: 8px; }
.wb-group { padding: 0 6px 8px; }
.wb-group-title { margin: 8px 6px 4px; color: var(--ink-3); font-size: 12px; font-weight: 600; }
.wb-pkg, .wb-node {
  display: flex;
  width: 100%;
  border: 0;
  border-radius: var(--radius);
  background: none;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}
.wb-pkg { flex-direction: column; gap: 2px; padding: 6px 8px; }
.wb-pkg:hover, .wb-node:hover { background: var(--sheet-2); }
.wb-pkg.is-on, .wb-node.is-on { background: var(--tint); }
.wb-pkg-name { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.wb-pkg-meta { display: flex; align-items: center; gap: 6px; color: var(--ink-3); font-size: 11.5px; }
.wb-tree-head { display: flex; flex-direction: column; gap: 6px; padding: 10px; border-bottom: 1px solid var(--line); }
.wb-tree-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.wb-tree-links { display: flex; gap: 10px; font-size: 12.5px; }
.wb-tree-links:empty { display: none; }
.wb-tree-actions { display: flex; flex-wrap: wrap; gap: 4px; }
.wb-tree-body { padding: 4px; }
.wb-node { align-items: center; gap: 4px; padding: 3px 6px 3px calc(6px + var(--depth, 0) * 14px); font-size: 13px; }
.wb-node.is-on { font-weight: 600; }
.wb-node > span:not(.wb-node-pad) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wb-node-pad { flex: none; width: 12px; }
.wb-node-size { flex: none; margin-left: auto; padding-left: 6px; color: var(--ink-3); font-size: 11px; }
.wb-deleted { margin-top: 10px; color: var(--ink-2); font-size: 12.5px; }
.wb-deleted summary { padding: 4px 6px; cursor: pointer; }
.wb-main { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.wb-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.wb-bar:empty { display: none; }
.wb-path { display: flex; align-items: center; gap: 6px; min-width: 0; font-family: var(--font-mono); font-size: 13px; overflow-wrap: anywhere; }
.wb-path small { color: var(--ink-3); font-family: var(--font); }
.wb-bar-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.wb-lang { width: auto; padding: 3px 6px; font-size: 12px; }
.wb-modes { display: inline-flex; overflow: hidden; border: 1px solid var(--line-2); border-radius: var(--radius); }
.wb-mode { padding: 3px 10px; border: 0; background: var(--sheet); color: var(--ink-2); font-size: 12px; cursor: pointer; }
.wb-mode.is-on { background: var(--accent); color: var(--machine-ink); }
.wb-notes { display: flex; flex-direction: column; gap: 6px; }
.wb-notes:empty { display: none; }
.wb-note { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 6px 10px; border-radius: var(--radius); background: var(--info-bg); color: var(--info-ink); font-size: 12.5px; }
.wb-note.is-warn { background: var(--warn-bg); color: var(--warn-ink); }
.wb-note.is-ok { background: var(--ok-bg); color: var(--ok-ink); }
.wb-note-actions { display: inline-flex; gap: 6px; margin-left: auto; }
.wb-stage { height: calc(100vh - 240px); min-height: 420px; }
.wb-stage > .editor, .wb-split > .editor { height: 100%; }
.wb-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; height: 100%; }
.wb-preview { box-sizing: border-box; height: 100%; overflow: auto; padding: 16px 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--sheet); }
.wb-image { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.wb-image img {
  max-width: 100%;
  max-height: 70vh;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: repeating-conic-gradient(var(--sheet-2) 0% 25%, var(--sheet) 0% 50%) 50% / 16px 16px;
}
.wb-live-box > summary { padding: 6px 0; font-size: 13px; font-weight: 600; cursor: pointer; }
.wb-small { font-size: 12px; }
.wb-diff { max-height: 60vh; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--code-bg); font: 12.5px/1.55 var(--font-mono); }
.wb-diff-row { display: flex; white-space: pre; }
.wb-diff-row.is-add { background: var(--tok-add-bg); }
.wb-diff-row.is-del { background: var(--tok-del-bg); }
.wb-diff-op { flex: none; width: 22px; color: var(--ink-3); text-align: center; user-select: none; }
.wb-diff-text { padding-right: 12px; }
.wb-diff-skip { padding: 2px 22px; background: var(--sheet); color: var(--ink-3); font-style: italic; }
.wb-history { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 12px; min-height: 300px; }
.wb-history-list { display: flex; flex-direction: column; gap: 4px; max-height: 60vh; overflow: auto; }
.wb-version { display: flex; flex-direction: column; align-items: flex-start; padding: 6px 8px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--sheet); color: var(--ink); text-align: left; cursor: pointer; }
.wb-version:hover { background: var(--sheet-2); }
.wb-version small { color: var(--ink-3); }
.wb-version-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; }
.wb-version-head .btn { margin-left: auto; }
@media (max-width: 1100px) {
  .wb { grid-template-columns: 1fr; }
  .wb-packages, .wb-tree { position: static; max-height: 320px; }
  .wb-split { grid-template-columns: 1fr; }
  .wb-stage { height: auto; }
}
