/* Director Workbench & Favorites Styles */
.director-slate-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 12px; margin-bottom: 8px; border-radius: 12px;
  background: color-mix(in srgb, var(--accent, #3b82f6) 8%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent, #3b82f6) 24%, transparent);
  flex-wrap: wrap; font-size: 12.5px;
}
.slate-fields, .slate-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.slate-tag { font-weight: 700; color: var(--accent, #3b82f6); }
.slate-lbl { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); }
.slate-lbl input {
  width: 118px; padding: 4px 8px; border-radius: 8px; border: 1px solid var(--line, rgba(148,163,184,0.3));
  background: var(--card-bg, rgba(255,255,255,0.6)); color: var(--ink); font-size: 12px;
}

.dir-inquiry-card, .dir-ver-banner {
  border-radius: 14px; padding: 14px 16px; margin-bottom: 10px;
  background: color-mix(in srgb, var(--accent, #3b82f6) 8%, var(--glass-card, var(--surface-2, rgba(255,255,255,0.55))));
  border: 1px solid color-mix(in srgb, var(--accent, #3b82f6) 28%, transparent);
}
.dir-inq-head, .dir-ver-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.dir-inq-chips { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
.dir-chip {
  padding: 4px 10px; border-radius: 999px; font-size: 12px; cursor: pointer;
  border: 1px solid var(--glass-stroke, var(--border, rgba(148,163,184,0.35))); background: transparent; color: var(--ink, var(--text, #111827));
}
.dir-chip.on, .dir-chip:hover {
  background: var(--accent, #3b82f6); color: #fff; border-color: var(--accent, #3b82f6);
}
.dir-inq-foot { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.dir-inq-note { flex: 1; min-width: 180px; }

.fav-heart-btn.is-fav { color: #e11d48 !important; font-weight: 600; }

.dir-drawer-backdrop {
  position: fixed; inset: 0; z-index: 10001; background: rgba(15, 23, 42, 0.36);
  backdrop-filter: blur(3px); display: flex; justify-content: flex-end;
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity 320ms var(--ease-out, cubic-bezier(0.23, 1, 0.32, 1)), visibility 0s linear 320ms;
}
.dir-drawer-backdrop.is-in {
  opacity: 1; visibility: visible; pointer-events: auto;
  transition: opacity 320ms var(--ease-out, cubic-bezier(0.23, 1, 0.32, 1)), visibility 0s linear 0s;
}
.dir-drawer-backdrop.hidden { display: none; }
.dir-drawer {
  width: min(860px, 94vw); height: 100vh; height: 100dvh; display: flex; flex-direction: column;
  background: var(--panel, var(--surface, rgba(255,255,255,0.96))); color: var(--ink, var(--text, #111827));
  border-left: 1px solid var(--line, var(--border, rgba(148,163,184,0.3)));
  box-shadow: -16px 0 48px rgba(15, 23, 42, 0.22); backdrop-filter: blur(22px);
  transform: translateX(100%);
  transition: transform 320ms var(--ease-drawer, cubic-bezier(0.32, 0.72, 0, 1));
}
.dir-drawer-backdrop.is-in .dir-drawer { transform: translateX(0); }
[data-theme="dark"] .dir-drawer { background: rgba(17, 24, 39, 0.95); }
.dir-drawer-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 14px 18px; border-bottom: 1px solid var(--line, rgba(148,163,184,0.25)); flex-wrap: wrap;
}
.dir-tabs { display: flex; gap: 6px; padding: 10px 18px; border-bottom: 1px solid var(--line, rgba(148,163,184,0.2)); flex-wrap: wrap; }
.dir-tab {
  padding: 6px 12px; border-radius: 999px; border: 1px solid transparent; flex-shrink: 0; white-space: nowrap;
  background: transparent; color: var(--muted); cursor: pointer; font-size: 13px; font-weight: 600;
}
.dir-tab.active { background: var(--accent, #3b82f6); color: #fff; }
.dir-drawer-body { flex: 1; overflow-y: auto; padding: 16px 18px; display: flex; flex-direction: column; gap: 14px; }

.dir-bin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.dir-ver-card {
  padding: 12px; border-radius: 12px; border: 1px solid var(--glass-stroke, var(--border, rgba(148,163,184,0.28)));
  background: var(--glass-card, var(--surface-2, rgba(255,255,255,0.5))); cursor: pointer; transition: border-color .15s;
}
.dir-ver-card.active { border-color: var(--accent, #3b82f6); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent, #3b82f6) 22%, transparent); }
.dir-seg-list, .dir-fav-list { display: flex; flex-direction: column; gap: 10px; }
.dir-seg-item, .dir-fav-card, .dir-mm-branch, .dir-fav-editor {
  padding: 12px 14px; border-radius: 12px; border: 1px solid var(--glass-stroke, var(--border, rgba(148,163,184,0.25)));
  background: var(--glass-card, var(--surface-2, rgba(255,255,255,0.45)));
}
.dir-fav-toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap;
  padding: 10px 12px; border-radius: 12px;
  background: color-mix(in srgb, var(--accent, #3b82f6) 7%, var(--glass-card, var(--surface-2, rgba(255,255,255,0.5))));
  border: 1px solid color-mix(in srgb, var(--accent, #3b82f6) 22%, transparent);
}
.dir-fav-textarea, .dir-fav-note-input {
  width: 100%; border-radius: 10px; padding: 9px 11px; font: inherit; font-size: 13px; line-height: 1.55;
  border: 1px solid var(--glass-stroke, var(--border, rgba(148,163,184,0.38)));
  background: var(--panel, var(--surface, rgba(255,255,255,0.92))); color: var(--ink, var(--text, #111827));
}
[data-theme="dark"] .dir-fav-textarea, [data-theme="dark"] .dir-fav-note-input {
  background: rgba(15, 23, 42, 0.85); color: #f1f5f9;
}
.dir-fav-textarea { min-height: 96px; resize: vertical; }
.dir-fav-excerpt {
  margin-top: 8px; white-space: pre-wrap; word-break: break-word; font-size: 13px; line-height: 1.6;
  max-height: 320px; overflow-y: auto; user-select: text; -webkit-user-select: text;
}
.dir-fav-toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 10010;
  padding: 8px 16px; border-radius: 999px; background: rgba(15, 23, 42, 0.92); color: #fff;
  font-size: 12.5px; font-weight: 600; box-shadow: 0 10px 28px rgba(15, 23, 42, 0.28);
  display: inline-flex; align-items: center; gap: 10px;
}
.dir-tl-track { display: flex; gap: 6px; overflow-x: auto; padding: 8px 2px; }
.dir-tl-clip {
  min-width: 140px; flex: 1; padding: 10px; border-radius: 10px;
  background: color-mix(in srgb, var(--accent, #3b82f6) 12%, var(--glass-card, var(--surface-2, rgba(255,255,255,0.5))));
  border: 1px solid color-mix(in srgb, var(--accent, #3b82f6) 30%, transparent);
}
#dir-diff-base-sel {
  background: var(--glass-card, var(--surface-2, #fff)); color: var(--ink, var(--text, #111827));
  border: 1px solid var(--glass-stroke, var(--border, rgba(148,163,184,0.35)));
}
.dir-diff-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 720px) {
  .dir-diff-grid { grid-template-columns: 1fr; }
  .dir-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding: 8px 14px; }
  .dir-tabs::-webkit-scrollbar { display: none; }
}
.dir-sel-bar {
  position: fixed; left: 0; top: 0; z-index: 950; display: inline-flex; align-items: center; gap: 6px; padding: 5px 8px;
  max-width: calc(100vw - 16px); overflow-x: auto; scrollbar-width: none;
  border-radius: 999px; background: rgba(15, 23, 42, 0.92); color: #fff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.28); backdrop-filter: blur(10px);
  opacity: 0; scale: 0.96; visibility: hidden; pointer-events: none;
  transform-origin: 50% 100%;
  transition: opacity 160ms var(--ease-out, cubic-bezier(0.23, 1, 0.32, 1)), scale 160ms var(--ease-out, cubic-bezier(0.23, 1, 0.32, 1)), visibility 0s linear 160ms;
}
.dir-sel-bar::-webkit-scrollbar { display: none; }
.dir-sel-bar.show {
  opacity: 1; scale: 1; visibility: visible; pointer-events: auto;
  transition: opacity 160ms var(--ease-out, cubic-bezier(0.23, 1, 0.32, 1)), scale 160ms var(--ease-out, cubic-bezier(0.23, 1, 0.32, 1)), visibility 0s linear 0s;
}
.dir-sel-btn {
  border: 0; background: transparent; color: #fff; font-size: 12px; font-weight: 600;
  padding: 3px 8px; border-radius: 999px; cursor: pointer; white-space: nowrap;
}
.dir-sel-btn:hover { background: rgba(255, 255, 255, 0.16); }

/* 🎛 节点图（仿达芬奇调色节点） */
.ng-host { display: flex; flex-direction: column; gap: 8px; outline: none; }
.ng-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.ng-toolbar .ng-title { font-weight: 700; margin-right: 4px; }
.ng-toolbar button {
  padding: 5px 10px; border-radius: 8px; font-size: 12px; cursor: pointer; color: #e5e7eb;
  background: #1f2430; border: 1px solid #3a4150;
}
.ng-toolbar button:hover { background: #2a3140; border-color: #5b6578; }
.ng-status { font-size: 12px; margin-left: auto; }
.ng-canvas {
  position: relative; height: min(64vh, 620px); overflow: hidden; border-radius: 12px; cursor: grab; touch-action: none;
  background-color: #14161b;
  background-image: radial-gradient(circle, rgba(255,255,255,0.07) 1px, transparent 1.2px);
  background-size: 22px 22px; border: 1px solid #2b303b;
}
.ng-canvas:active { cursor: grabbing; }
.ng-world { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.ng-wires { position: absolute; left: 0; top: 0; width: 1px; height: 1px; overflow: visible; pointer-events: none; }
.ng-wires path { fill: none; }
.ng-wire { stroke: #8b93a5; stroke-width: 2.2; }
.ng-wire.sel { stroke: #fbbf24; stroke-width: 3; }
.ng-wire.temp { stroke: #60a5fa; stroke-dasharray: 6 5; }
.ng-hit { stroke: transparent; stroke-width: 14; pointer-events: stroke; cursor: pointer; }
.ng-nodes { position: absolute; left: 0; top: 0; }
.ng-node {
  position: absolute; width: 196px; border-radius: 10px; color: #e5e7eb; font-size: 12px; line-height: 1.5;
  background: #262b36; border: 1px solid #3c4352; border-top: 4px solid var(--nc);
  box-shadow: 0 6px 18px rgba(0,0,0,0.45); cursor: move; user-select: none;
}
.ng-node.sel { border-color: #fbbf24; box-shadow: 0 0 0 2px rgba(251,191,36,0.45), 0 8px 22px rgba(0,0,0,0.5); }
.ng-node.kind-root { background: #2d2540; }
.ng-head { display: flex; justify-content: space-between; padding: 5px 9px 0; font-size: 10.5px; opacity: 0.75; }
.ng-kind { color: var(--nc); font-weight: 700; letter-spacing: 0.5px; }
.ng-ttl { padding: 2px 9px 4px; font-weight: 700; font-size: 12.5px; }
.ng-body { padding: 0 9px 8px; color: #b8c0cf; max-height: 132px; overflow: hidden; white-space: pre-wrap; }
.ng-body.ng-empty { opacity: 0.4; font-style: italic; }
.ng-node [contenteditable="true"] { outline: 1px dashed #60a5fa; background: #11141a; user-select: text; cursor: text; max-height: none; border-radius: 4px; }
.ng-port {
  position: absolute; top: 26px; width: 12px; height: 12px; border-radius: 50%;
  background: #14161b; border: 2px solid var(--nc); cursor: crosshair;
}
.ng-port.in { left: -7px; }
.ng-port.out { right: -7px; }
.ng-port:hover { background: var(--nc); }
.ng-help { font-size: 11.5px; }
@media (prefers-reduced-motion: reduce) {
  .dir-drawer { transform: none !important; transition-duration: 1ms !important; }
  .dir-drawer-backdrop, .dir-sel-bar { transition-duration: 80ms, 80ms, 0s !important; }
  .dir-sel-bar { scale: 1 !important; }
}
