/* ==========================================================================
   蜂巢 HIVE · AI 员工调度生产系统
   Design tokens — 源自风格模板 00007 (Discord Analysis)
   ========================================================================== */

:root {
  /* 底层画布 */
  --bg: #0a0d3a;
  --nav: #0d1147;
  --panel: #12163f;
  --panel-2: #0b0f33;
  --card: #1e2353;
  --card-2: #171c50;
  --card-3: #141a4a;
  --track: #262c63;

  /* 描边 */
  --line: rgba(255, 255, 255, 0.08);
  --line-2: #2a2f63;
  --line-3: rgba(255, 255, 255, 0.12);

  /* 品牌色 */
  --brand: #5865f2;
  --brand-soft: #7c89f5;
  --brand-100: #a9b2ff;
  --brand-50: #c9ceff;
  --brand-25: #dce0ff;
  --green: #35ed7e;
  --green-soft: #7bf0ae;
  --pink: #ec48bd;
  --pink-soft: #f58fd5;
  --cyan: #00b0f4;

  /* 文字 */
  --t1: #ffffff;
  --t2: #8b90c8;
  --t3: #6e74a8;
  --t4: #5b62b8;

  /* 圆角 */
  --r-sm: 8px;
  --r-md: 10px;
  --r-lg: 12px;
  --r-xl: 16px;
  --r-2xl: 20px;
  --r-3xl: 24px;

  --font: "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", sans-serif;
  --num: "Hanken Grotesk", "Inter", "SF Pro Display", "Segoe UI", system-ui, sans-serif;

  --shadow-pop: 0 16px 40px -8px rgba(0, 0, 0, 0.45);
  --shadow-glow: 0 0 28px 0 rgba(88, 101, 242, 0.35);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  background: var(--bg);
  color: var(--t1);
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: #232a5e;
  border-radius: 6px;
  border: 3px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background: #333a75; background-clip: padding-box; }

button { font-family: inherit; border: 0; background: none; cursor: pointer; color: inherit; }
input { font-family: inherit; }
a { color: inherit; text-decoration: none; }

.num { font-family: var(--num); font-variant-numeric: tabular-nums; }

/* ==========================================================================
   顶部全局导航
   ========================================================================== */

.app {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

.topbar {
  flex: none;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 16px;
  background: var(--nav);
  border-bottom: 1px solid var(--line);
  position: relative;
  z-index: 40;
}

.logo {
  width: 28px;
  height: 28px;
  flex: none;
  display: grid;
  place-items: center;
}

.brand {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.2px;
  white-space: nowrap;
}

.vdivider {
  width: 1px;
  height: 22px;
  background: rgba(255, 255, 255, 0.14);
  flex: none;
}

.proj-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: var(--r-md);
  background: var(--card);
  flex: none;
}
.proj-chip .name { font-size: 12px; font-weight: 500; }
.proj-chip .ver { font-size: 11px; color: var(--t2); font-family: var(--num); }

.spacer { flex: 1 1 auto; }

.nav-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border-radius: var(--r-lg);
  background: var(--card-2);
  flex: none;
}
.nav-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border-radius: var(--r-sm);
  font-size: 12px;
  font-weight: 500;
  color: var(--t2);
  transition: color 0.16s, background 0.16s;
  white-space: nowrap;
}
.nav-tab:hover { color: var(--t1); background: rgba(255, 255, 255, 0.05); }
.nav-tab.active {
  background: var(--brand);
  color: #fff;
  font-weight: 600;
}
.nav-tab svg { flex: none; }

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: var(--r-md);
  background: rgba(53, 237, 126, 0.14);
  flex: none;
}
.status-chip .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(53, 237, 126, 0.7);
  animation: pulse 2.2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(53, 237, 126, 0.55); }
  70% { box-shadow: 0 0 0 7px rgba(53, 237, 126, 0); }
  100% { box-shadow: 0 0 0 0 rgba(53, 237, 126, 0); }
}
.status-chip .txt {
  font-size: 11px;
  font-weight: 500;
  color: var(--green);
  white-space: nowrap;
}

.icon-btn {
  width: 26px;
  height: 26px;
  border-radius: var(--r-sm);
  background: var(--card);
  display: grid;
  place-items: center;
  flex: none;
  transition: background 0.16s;
}
.icon-btn:hover { background: #262c63; }

.avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  flex: none;
  background: linear-gradient(135deg, #5865f2, #ec48bd);
  display: grid;
  place-items: center;
  overflow: hidden;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: var(--r-md);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  transition: filter 0.16s, background 0.16s;
}
.btn-primary { background: var(--green); color: #000; }
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost { background: var(--card); color: var(--t2); font-weight: 500; }
.btn-ghost:hover { background: #262c63; color: var(--t1); }
.btn-brand { background: var(--brand); color: #fff; }
.btn-brand:hover { filter: brightness(1.1); }

/* ==========================================================================
   S1 · 三栏工作台
   ========================================================================== */

.workbench {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr) 320px;
  min-height: 0;
}

.col {
  min-height: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.col-left,
.col-right {
  background: var(--panel);
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px;
  gap: 14px;
}
.col-left { border-right: 1px solid var(--line); }
.col-right { border-left: 1px solid var(--line); gap: 12px; }

.col-center { background: var(--bg); }

.panel-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}
.panel-head h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
}
.panel-head .count {
  font-size: 10px;
  color: var(--t3);
  font-weight: 500;
}
.panel-head .link {
  margin-left: auto;
  font-size: 10px;
  color: var(--brand-soft);
  font-weight: 500;
  cursor: pointer;
}
.panel-head .link:hover { color: var(--brand-100); }

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border-radius: var(--r-md);
  background: var(--card);
  flex: none;
  transition: box-shadow 0.16s;
}
.search-box:focus-within { box-shadow: 0 0 0 1px var(--brand); }
.search-box input {
  border: 0;
  outline: 0;
  background: none;
  color: var(--t1);
  font-size: 11px;
  width: 100%;
  padding: 0;
}
.search-box input::placeholder { color: var(--t3); }

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex: none;
}
.chip {
  padding: 6px 9px;
  border-radius: var(--r-sm);
  background: var(--card-2);
  color: var(--t2);
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  transition: background 0.16s, color 0.16s;
}
.chip:hover { background: #222a63; color: var(--t1); }
.chip.active {
  background: rgba(88, 101, 242, 0.28);
  color: var(--brand-100);
}

.sec-label {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
  font-size: 11px;
  font-weight: 500;
  color: var(--t3);
}
.sec-label .link {
  margin-left: auto;
  font-size: 10px;
  color: var(--brand-soft);
  cursor: pointer;
}
.sec-label .link:hover { color: var(--brand-100); }

/* 列表项（插件 / 模板 / 日志） */
.plugin {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--r-lg);
  background: var(--card);
  flex: none;
  cursor: grab;
  transition: transform 0.14s, background 0.16s, box-shadow 0.16s;
}
.plugin:hover {
  background: #242a60;
  transform: translateX(2px);
  box-shadow: 0 6px 18px -6px rgba(0, 0, 0, 0.5);
}
.plugin:active { cursor: grabbing; }
.plugin .p-icon {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  flex: none;
}
.plugin .p-body { min-width: 0; }
.plugin .p-name {
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.plugin .p-meta {
  font-size: 10px;
  color: var(--t2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tpl {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--r-lg);
  background: var(--card-2);
  flex: none;
  cursor: pointer;
  transition: background 0.16s, transform 0.14s;
  border: 1px solid transparent;
}
.tpl:hover {
  background: #1d2358;
  border-color: rgba(88, 101, 242, 0.45);
  transform: translateX(2px);
}

.quota {
  padding: 12px;
  border-radius: 14px;
  background: var(--card);
  flex: none;
}
.quota .row {
  display: flex;
  align-items: center;
  font-size: 11px;
}
.quota .row .label { color: var(--t2); font-weight: 500; }
.quota .row .value { margin-left: auto; font-weight: 700; font-family: var(--num); }
.quota .track {
  height: 6px;
  border-radius: 3px;
  background: var(--bg);
  margin: 8px 0;
  overflow: hidden;
}
.quota .bar {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, #5865f2, #ec48bd);
  transition: width 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.quota .foot { font-size: 10px; color: var(--t3); }

/* ---------- 中部：编排画布 ---------- */

.canvas-wrap {
  flex: 1 1 auto;
  position: relative;
  min-height: 0;
  overflow: auto;
  background: var(--bg);
}
.canvas-stage {
  position: relative;
  width: 100%;
  min-width: 960px;
  height: 788px;
  transform-origin: 0 0;
}

.canvas-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.group-box {
  position: absolute;
  border-radius: var(--r-3xl);
  background: rgba(18, 22, 63, 0.78);
  transition: box-shadow 0.2s, border-color 0.2s;
}
.group-box:hover { box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.03); }

.group-head {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  pointer-events: none;
}
.group-head .g-title { font-size: 13px; font-weight: 700; }
.group-head .g-sub {
  margin-left: auto;
  font-size: 10px;
  color: var(--t2);
  font-weight: 400;
}

.node {
  position: absolute;
  height: 84px;
  border-radius: var(--r-xl);
  background: var(--card);
  border: 1px solid var(--line-2);
  cursor: pointer;
  transition: border-color 0.16s, box-shadow 0.2s, transform 0.16s;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  overflow: hidden;
}
.node:hover {
  border-color: rgba(88, 101, 242, 0.7);
  transform: translateY(-1px);
  box-shadow: 0 10px 26px -12px rgba(0, 0, 0, 0.8);
}
.node.selected {
  border-color: var(--brand);
  border-width: 2px;
  box-shadow: var(--shadow-glow), 0 14px 34px -10px rgba(0, 0, 0, 0.6);
}
.node.alert { border-color: var(--pink); box-shadow: 0 0 22px 0 rgba(236, 72, 189, 0.22); }
.node .n-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--r-md);
  display: grid;
  place-items: center;
  flex: none;
}
.node .n-body { min-width: 0; flex: 1 1 auto; }
.node .n-name {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.node .n-meta {
  font-size: 10px;
  color: var(--t2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.node .n-pill {
  position: absolute;
  right: 12px;
  bottom: 12px;
  padding: 3px 9px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 500;
  white-space: nowrap;
}
.pill-run { background: rgba(53, 237, 126, 0.18); color: var(--green); }
.pill-queue { background: rgba(255, 255, 255, 0.08); color: var(--t2); }
.pill-done { background: rgba(88, 101, 242, 0.2); color: var(--brand-100); }
.pill-retry { background: rgba(236, 72, 189, 0.2); color: var(--pink-soft); }

/* 画布浮层 */
.canvas-overlay {
  position: absolute;
  z-index: 5;
}
.crumb {
  left: 24px;
  top: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: var(--r-md);
  background: rgba(13, 17, 71, 0.85);
  backdrop-filter: blur(10px);
  font-size: 11px;
}
.crumb .up { color: var(--t3); font-weight: 500; }
.crumb .cur { font-weight: 600; }
.crumb .saved {
  padding: 3px 7px;
  border-radius: 7px;
  background: rgba(53, 237, 126, 0.16);
  color: var(--green);
  font-size: 9px;
  font-weight: 500;
}

.legend {
  right: 24px;
  top: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: var(--r-md);
  background: rgba(13, 17, 71, 0.85);
  backdrop-filter: blur(10px);
  font-size: 10px;
  color: var(--t2);
}
.legend .item { display: flex; align-items: center; gap: 5px; }
.legend .swatch { width: 8px; height: 8px; border-radius: 50%; }

.dock {
  left: 50%;
  transform: translateX(-50%);
  bottom: 96px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border-radius: var(--r-3xl);
  background: var(--card);
  border: 1px solid var(--line-3);
  box-shadow: var(--shadow-pop);
}
.dock button {
  width: 32px;
  height: 32px;
  border-radius: var(--r-md);
  background: var(--track);
  display: grid;
  place-items: center;
  transition: background 0.16s, transform 0.14s;
}
.dock button:hover { background: #333a75; transform: translateY(-1px); }
.dock button.on { background: rgba(53, 237, 126, 0.18); }
.dock .ddiv { width: 1px; height: 20px; background: var(--line-3); }
.dock .elapsed { font-size: 11px; color: var(--t2); padding: 0 4px; font-family: var(--num); }

.minimap {
  right: 24px;
  bottom: 96px;
  width: 150px;
  height: 96px;
  border-radius: var(--r-lg);
  background: rgba(13, 17, 71, 0.92);
  border: 1px solid var(--line-2);
  overflow: hidden;
}

.zoombar {
  right: 24px;
  bottom: 52px;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 8px;
  border-radius: var(--r-md);
  background: var(--card);
}
.zoombar button {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border-radius: 5px;
  color: var(--t2);
}
.zoombar button:hover { background: var(--track); color: var(--t1); }
.zoombar .val {
  font-size: 10px;
  color: var(--t2);
  font-family: var(--num);
  min-width: 34px;
  text-align: center;
}

.hint {
  left: 24px;
  bottom: 24px;
  font-size: 10px;
  color: var(--t4);
}

/* 执行日志 */
.logpanel {
  flex: none;
  height: 148px;
  background: var(--panel-2);
  border-top: 1px solid var(--line);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
}
.logpanel .head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}
.logpanel .head .t { font-size: 11px; font-weight: 700; }
.logpanel .head .live {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  animation: pulse 2.2s infinite;
}
.logpanel .head .note { margin-left: auto; font-size: 10px; color: var(--t4); }

.log-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: 10px;
  flex: none;
  animation: slideIn 0.32s ease-out;
}
@keyframes slideIn {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: none; }
}
.log-row .time { width: 58px; flex: none; color: var(--t4); font-family: var(--num); }
.log-row .src { width: 118px; flex: none; font-weight: 500; }
.log-row .msg { flex: 1 1 auto; color: var(--t2); }

/* ---------- 右侧属性检查器 ---------- */

.ins-card {
  height: 68px;
  border-radius: 14px;
  background: var(--card);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 12px;
  flex: none;
}
.ins-card .avatar-lg {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  flex: none;
}
.ins-card .body { min-width: 0; flex: 1 1 auto; }
.ins-card .name { font-size: 13px; font-weight: 600; }
.ins-card .sub { font-size: 10px; color: var(--t2); }

.tabs {
  display: flex;
  gap: 18px;
  align-items: center;
  flex: none;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}
.tabs .tab {
  font-size: 12px;
  font-weight: 500;
  color: var(--t3);
  padding: 0;
  transition: color 0.16s;
}
.tabs .tab:hover { color: var(--t2); }
.tabs .tab.active { color: var(--t1); font-weight: 600; }

.field-label { font-size: 11px; font-weight: 500; color: var(--t2); flex: none; }

.select-like {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border-radius: var(--r-md);
  background: var(--card);
  font-size: 11px;
  font-weight: 500;
  flex: none;
  cursor: pointer;
  transition: background 0.16s;
}
.select-like:hover { background: #262c63; }
.select-like .caret { margin-left: auto; }

.slider-row { display: flex; align-items: center; font-size: 11px; }
.slider-row .val { margin-left: auto; font-weight: 700; font-family: var(--num); }
.slider {
  height: 20px;
  display: flex;
  align-items: center;
  flex: none;
  cursor: pointer;
}
.slider .rail {
  position: relative;
  width: 100%;
  height: 4px;
  border-radius: 2px;
  background: var(--track);
}
.slider .fill {
  position: absolute;
  left: 0;
  top: 0;
  height: 4px;
  border-radius: 2px;
  background: var(--brand);
}
.slider .knob {
  position: absolute;
  top: 50%;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 5px rgba(88, 101, 242, 0.25);
  transition: box-shadow 0.16s;
}
.slider:hover .knob { box-shadow: 0 0 0 8px rgba(88, 101, 242, 0.3); }

.stepper {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border-radius: var(--r-md);
  background: var(--card);
  font-size: 11px;
  font-weight: 500;
  flex: none;
}
.stepper .btns { margin-left: auto; display: flex; gap: 8px; }
.stepper .btns button {
  width: 14px;
  height: 14px;
  display: grid;
  place-items: center;
  color: var(--t2);
}
.stepper .btns button:hover { color: var(--t1); }

.prompt-box {
  position: relative;
  padding: 10px;
  border-radius: var(--r-md);
  background: var(--card);
  flex: none;
}
.prompt-box .txt {
  font-size: 10px;
  line-height: 1.6;
  color: var(--t2);
  outline: 0;
  min-height: 56px;
}
.prompt-box .cnt {
  text-align: right;
  font-size: 9px;
  color: var(--t4);
  font-family: var(--num);
  margin-top: 4px;
}

.switch-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--r-md);
  background: var(--card-2);
  flex: none;
}
.switch-row .nm { font-size: 11px; font-weight: 500; }
.switch-row.off .nm { color: var(--t3); }
.switch {
  margin-left: auto;
  width: 28px;
  height: 16px;
  border-radius: 8px;
  background: var(--line-2);
  position: relative;
  flex: none;
  transition: background 0.18s;
}
.switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--t2);
  transition: transform 0.18s, background 0.18s;
}
.switch.on { background: rgba(53, 237, 126, 0.9); }
.switch.on::after { transform: translateX(12px); background: var(--bg); }

.ins-footer {
  display: flex;
  gap: 8px;
  flex: none;
  margin-top: auto;
  padding-top: 12px;
}
.ins-footer .btn { flex: 1 1 0; justify-content: center; padding: 11px; }

/* ==========================================================================
   S2 / S3 · 页面型内容
   ========================================================================== */

.page {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 32px;
  min-height: 0;
}
.page-inner { display: flex; flex-direction: column; gap: 24px; }

.page-head {
  display: flex;
  align-items: center;
  gap: 16px;
}
.page-head .titles h1 {
  margin: 0;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.2px;
}
.page-head .titles p {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--t2);
}
.page-head .actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.kpi-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
}
.kpi {
  padding: 20px;
  border-radius: var(--r-2xl);
  background: var(--card);
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: transform 0.18s, box-shadow 0.18s;
}
.kpi:hover { transform: translateY(-2px); }
.kpi .k-label { font-size: 11px; font-weight: 500; color: var(--t2); }
.kpi .k-value {
  font-size: 34px;
  font-weight: 800;
  line-height: 1.1;
  font-family: var(--num);
  letter-spacing: -0.5px;
}
.kpi .k-foot { font-size: 10px; color: var(--t3); }
.kpi.hero { background: var(--brand); }
.kpi.hero .k-label { color: var(--brand-25); }
.kpi.hero .k-foot { color: var(--brand-50); }
.kpi.good .k-value { color: var(--green); }
.kpi.warn .k-value { color: var(--pink-soft); }

.dept-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
}
.dept {
  padding: 20px;
  border-radius: var(--r-2xl);
  background: var(--panel);
  border: 1px solid var(--line-2);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform 0.18s, box-shadow 0.18s;
}
.dept:hover { transform: translateY(-2px); box-shadow: var(--shadow-pop); }
.dept .d-head { display: flex; align-items: center; gap: 8px; }
.dept .d-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.dept .d-name { font-size: 15px; font-weight: 700; }
.dept .d-cnt { margin-left: auto; font-size: 11px; font-weight: 500; color: var(--t2); }
.dept .d-progress { display: flex; align-items: center; gap: 12px; }
.dept .d-track {
  flex: 1 1 auto;
  height: 8px;
  border-radius: 4px;
  background: var(--track);
  overflow: hidden;
}
.dept .d-bar { height: 100%; border-radius: 4px; transition: width 0.7s cubic-bezier(0.2, 0.8, 0.2, 1); }
.dept .d-pct { font-size: 13px; font-weight: 700; font-family: var(--num); flex: none; }
.dept .d-metric { display: flex; align-items: baseline; font-size: 10px; color: var(--t3); }
.dept .d-metric b { margin-left: auto; font-size: 13px; font-weight: 600; color: var(--t1); font-family: var(--num); }
.dept .d-av { display: flex; margin-top: 2px; }
.dept .d-av .av {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--panel);
  margin-left: -8px;
  display: grid;
  place-items: center;
  font-size: 9px;
  font-weight: 700;
  color: #fff;
}
.dept .d-av .av:first-child { margin-left: 0; }
.dept .d-av .av.more { background: var(--card); color: var(--t2); font-size: 12px; }

.section-head {
  display: flex;
  align-items: center;
  gap: 12px;
}
.section-head h3 { margin: 0; font-size: 14px; font-weight: 700; }
.section-head .note { margin-left: auto; font-size: 10px; color: var(--t3); }

.table {
  border-radius: var(--r-xl);
  background: var(--panel);
  overflow: hidden;
}
.trow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px 150px;
  gap: 12px;
  padding: 0 14px;
  height: 46px;
  align-items: center;
  transition: background 0.16s;
}
.trow.head {
  height: 42px;
  background: var(--card);
  font-size: 10px;
  font-weight: 500;
  color: var(--t3);
}
.trow:not(.head):hover { background: rgba(255, 255, 255, 0.03); }
.trow .cell { font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trow .cell.strong { font-weight: 500; }
.trow .cell.dim { color: var(--t2); font-weight: 400; }
.trow .cell.right { text-align: right; }

.cards-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
}
.agent-card {
  padding: 18px;
  border-radius: 18px;
  background: var(--panel);
  border: 1px solid var(--line-2);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform 0.18s, border-color 0.18s, box-shadow 0.18s;
}
.agent-card:hover {
  transform: translateY(-3px);
  border-color: rgba(88, 101, 242, 0.6);
  box-shadow: var(--shadow-pop);
}
.agent-card .a-av {
  width: 40px;
  height: 40px;
  border-radius: 13px;
  display: grid;
  place-items: center;
}
.agent-card .a-name { font-size: 13px; font-weight: 600; }
.agent-card .a-meta { font-size: 10px; color: var(--t3); }
.agent-card .a-btn {
  margin-top: 2px;
  padding: 9px;
  border-radius: 9px;
  background: var(--card);
  color: var(--t2);
  font-size: 11px;
  font-weight: 500;
  text-align: center;
  transition: background 0.16s, color 0.16s;
}
.agent-card .a-btn:hover { background: #262c63; color: var(--t1); }
.agent-card .a-btn.install {
  background: rgba(53, 237, 126, 0.16);
  color: var(--green);
  font-weight: 600;
}
.agent-card .a-btn.install:hover { background: rgba(53, 237, 126, 0.26); }
.agent-card .a-btn.primary { background: var(--green); color: #000; font-weight: 700; }
.agent-card .a-btn.primary:hover { filter: brightness(1.08); background: var(--green); }

.cta-band {
  padding: 24px;
  border-radius: var(--r-3xl);
  background: var(--brand);
  display: flex;
  align-items: center;
  gap: 16px;
}
.cta-band h3 { margin: 0; font-size: 16px; font-weight: 700; }
.cta-band p { margin: 6px 0 0; font-size: 11px; color: var(--brand-50); }
.cta-band .btn { margin-left: auto; padding: 12px 16px; border-radius: var(--r-lg); }

/* 徽标 */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 9px;
  font-weight: 600;
}
.badge.new { background: rgba(53, 237, 126, 0.16); color: var(--green); }
.badge.hot { background: rgba(236, 72, 189, 0.18); color: var(--pink-soft); }

/* 空态 */
.empty {
  padding: 48px 0;
  text-align: center;
  color: var(--t3);
  font-size: 12px;
}

/* Toast */
.toast-host {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}
.toast {
  padding: 10px 16px;
  border-radius: var(--r-lg);
  background: var(--card);
  border: 1px solid var(--line-3);
  box-shadow: var(--shadow-pop);
  font-size: 12px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: toastIn 0.28s ease-out;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
.toast.out { animation: toastOut 0.3s ease-in forwards; }
@keyframes toastOut {
  to { opacity: 0; transform: translateY(10px); }
}

/* ==========================================================================
   细节补全
   ========================================================================== */

/* 顶栏状态芯片：暂停态 */
.status-chip.paused { background: rgba(139, 144, 200, 0.14); }
.status-chip.paused .dot { background: var(--t2); animation: none; }
.status-chip.paused .txt { color: var(--t2); }

/* 检查器主体 */
.ins-body { display: flex; flex-direction: column; gap: 10px; flex: 1 1 auto; }

/* 画布交互细节 */
.canvas-stage,
.node,
.group-head { user-select: none; }
.node .n-body { padding-right: 66px; }
.group-head .g-title { letter-spacing: 0.2px; }
.canvas-wrap { scrollbar-gutter: stable; }

/* 创建自定义员工占位卡 */
.agent-card.create {
  background: var(--card-3);
  border-style: dashed;
  border-color: rgba(88, 101, 242, 0.55);
}
.agent-card.create:hover { border-color: var(--brand); }

/* 模板卡链路图（flex 自适应，避免拉伸变形） */
.flow-line { display: flex; align-items: center; height: 28px; }
.flow-line .fl-node { flex: 1 1 0; height: 28px; border-radius: 8px; min-width: 24px; }
.flow-line .fl-link {
  flex: none;
  width: 22px;
  height: 2px;
  background: #6C78F0;
  position: relative;
}
.flow-line .fl-link::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #6C78F0;
  transform: translate(-50%, -50%);
}

/* 部门成员头像：实色 + 清晰首字 */
.dept .d-av .av {
  font-size: 10px;
  letter-spacing: 0;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

/* ==========================================================================
   自适应
   ========================================================================== */

@media (max-width: 1500px) {
  .cards-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1420px) {
  .dept-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1280px) {
  .workbench { grid-template-columns: 240px minmax(0, 1fr) 300px; }
  .cards-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1080px) {
  .workbench { grid-template-columns: minmax(0, 1fr) 300px; }
  .col-left { display: none; }
}
@media (max-width: 860px) {
  .workbench { grid-template-columns: minmax(0, 1fr); }
  .col-right { display: none; }
  .nav-tabs { display: none; }
  .page { padding: 20px; }
  .kpi-row, .dept-row, .cards-grid { grid-template-columns: minmax(0, 1fr); }
  .trow { grid-template-columns: minmax(0, 1fr) 110px; }
  .trow .cell:nth-child(2) { display: none; }
}
