/* 纳凝智 99 智能体三栏工作区 */
.nzf-tabs {
  display: flex; align-items: center; gap: 6px; margin: 0 0 14px;
  border-bottom: 1px solid rgba(10, 31, 68, .10); padding-bottom: 10px;
}
.nzf-tab {
  height: 34px; padding: 0 16px; border: 0; border-radius: 999px; cursor: pointer;
  background: #F2F5FA; color: #4A5568; font-size: 13px; font-weight: 600;
}
.nzf-tab.active { background: #4169E1; color: #fff; box-shadow: 0 6px 16px rgba(65, 105, 225, .28); }
.nzf-tabs-hint { margin-left: auto; font-size: 12px; color: #8A94A6; }

.nzf-app {
  width: 100vw; margin-left: calc(50% - 50vw); padding: 0 20px 28px; box-sizing: border-box;
}
body[data-nzp="chat"] { overflow-x: hidden; }

.nzf-ws {
  display: grid; grid-template-columns: 240px minmax(0, 1fr) 380px;
  height: clamp(560px, calc(100vh - 300px), 920px); min-height: 560px;
  border: 1px solid rgba(10, 31, 68, .12); border-radius: 16px; overflow: hidden;
  background: #fff; box-shadow: 0 18px 50px rgba(10, 31, 68, .10);
}

/* ── 左栏：任务树 ── */
.nzf-left { display: flex; flex-direction: column; background: #F8FAFD; border-right: 1px solid rgba(10, 31, 68, .09); min-width: 0; }
.nzf-left-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 16px 8px; font-size: 13px; font-weight: 700; color: #0A1F44;
}
.nzf-left-head b { font-size: 15px; color: #4169E1; }
.nzf-left-tools { display: flex; align-items: center; gap: 4px; }
.nzf-tree.collapsed { display: none; }
.nzf-left-head .nzf-fold {
  margin-left: 8px; border: 0; background: transparent; color: #8A94A6;
  font-size: 11px; cursor: pointer; padding: 2px 4px;
}
.nzf-progress-mini { height: 4px; margin: 0 16px 10px; border-radius: 999px; background: #E6EBF4; overflow: hidden; }
.nzf-progress-mini i { display: block; height: 100%; background: linear-gradient(90deg, #4169E1, #6C8CFF); transition: width .4s ease; }
.nzf-left-sub {
  padding: 0 16px 8px; font-size: 11.5px; color: #7A8496;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.nzf-tree { flex: 1; overflow-y: auto; padding: 0 10px 12px; }
.nzf-tree-empty { padding: 20px 8px; font-size: 12px; color: #97A0B0; }
.nzf-node {
  display: flex; align-items: flex-start; gap: 9px; width: 100%; padding: 9px 8px;
  border: 1px solid transparent; border-radius: 9px; background: transparent;
  text-align: left; cursor: pointer; transition: background .15s, border-color .15s;
}
.nzf-node:hover { background: #EFF3FB; }
.nzf-node.sel { background: #fff; border-color: rgba(65, 105, 225, .28); box-shadow: 0 4px 12px rgba(20, 40, 90, .07); }
.nzf-dot {
  flex: none; width: 11px; height: 11px; margin-top: 4px; border-radius: 50%;
  border: 2px solid #C9D1DF; background: transparent;
}
.nzf-node-main { flex: 1; min-width: 0; }
.nzf-node-main b { display: block; font-size: 12.5px; font-weight: 600; color: #33415C; line-height: 1.45; word-break: break-word; }
.nzf-node-main em { display: block; margin-top: 2px; font-size: 10.5px; font-style: normal; color: #97A0B0; }
.nzf-node-mark { flex: none; font-size: 11px; font-weight: 700; color: transparent; }
.nzf-node.done .nzf-dot { background: #4169E1; border-color: #4169E1; }
.nzf-node.done .nzf-node-main b { color: #0A1F44; }
.nzf-node.verified .nzf-dot { background: #22A06B; border-color: #22A06B; box-shadow: 0 0 0 3px rgba(34, 160, 107, .13); }
.nzf-node.verified .nzf-node-mark { color: #22A06B; }
.nzf-node.active .nzf-dot {
  border: 0; background: radial-gradient(circle at 30% 30%, #FF8A4C, #E5484D 70%);
  box-shadow: 0 0 0 4px rgba(229, 72, 77, .16); animation: nzf-pulse 1.2s ease-in-out infinite;
}
.nzf-node.active .nzf-node-main b { color: #C0392B; }
.nzf-node.waiting .nzf-dot { background: #F5A623; border-color: #F5A623; animation: nzf-pulse 1.4s ease-in-out infinite; }
.nzf-node.waiting .nzf-node-mark { color: #E08A00; }
@keyframes nzf-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(229, 72, 77, .28); }
  50% { box-shadow: 0 0 0 6px rgba(229, 72, 77, .06); }
}
.nzf-left-foot { border-top: 1px solid rgba(10, 31, 68, .08); padding: 10px; max-height: 172px; overflow-y: auto; }
.nzf-history-head { font-size: 11px; color: #8A94A6; padding: 2px 4px 6px; }
.nzf-history-item {
  display: block; width: 100%; padding: 8px 9px; margin-bottom: 6px; text-align: left;
  border: 1px solid rgba(10, 31, 68, .08); border-radius: 9px; background: #fff; cursor: pointer;
}
.nzf-history-item:hover { border-color: rgba(65, 105, 225, .35); }
.nzf-history-item b { display: block; font-size: 12px; color: #0A1F44; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nzf-history-item span { display: block; font-size: 11px; color: #7A8496; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nzf-history-item em { display: block; font-size: 10.5px; font-style: normal; color: #4169E1; margin-top: 3px; }

/* ── 中栏：操作区 ── */
.nzf-mid { display: flex; flex-direction: column; min-width: 0; background: #fff; }
.nzf-mid-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 16px 20px 12px; border-bottom: 1px solid rgba(10, 31, 68, .08);
}
.nzf-mid-head h3 { margin: 0 0 4px; font-size: 15.5px; color: #0A1F44; line-height: 1.4; }
.nzf-mid-head p { margin: 0; font-size: 12px; color: #7A8496; line-height: 1.6; }
.nzf-mid-right { flex: none; display: flex; align-items: center; gap: 8px; }
.nzf-step-count { font-size: 11.5px; color: #8A94A6; white-space: nowrap; }
.nzf-mid-body { flex: 1; overflow-y: auto; padding: 18px 20px 24px; }

.nzf-busybar {
  display: flex; align-items: center; gap: 9px; margin-bottom: 14px;
  padding: 11px 14px; border-radius: 10px; background: #F4F7FF;
  border: 1px solid #DCE6FF; font-size: 12.5px; color: #3C4A63;
}
.nzf-spinner {
  flex: none; width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid rgba(65, 105, 225, .25); border-top-color: #4169E1;
  animation: nzf-spin .8s linear infinite;
}
@keyframes nzf-spin { to { transform: rotate(360deg); } }
.nzf-uzi { flex: 1; height: 4px; border-radius: 999px; background: #E3EAFB; overflow: hidden; position: relative; }
.nzf-uzi i { position: absolute; left: 0; top: 0; height: 100%; width: 40%; border-radius: 999px; background: linear-gradient(90deg, #4169E1, #8EA9FF); animation: nzf-run 1.3s ease-in-out infinite; }
@keyframes nzf-run { 0% { left: -40%; } 100% { left: 100%; } }

.nzf-startcard { border: 1px solid rgba(10, 31, 68, .10); border-radius: 13px; padding: 18px; background: #FBFCFE; }
.nzf-startcard-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.nzf-startcard-head h4 { margin: 0; font-size: 14.5px; color: #0A1F44; }
.nzf-tag-auto { font-size: 11px; font-weight: 700; color: #22A06B; background: #E9F9F0; border-radius: 999px; padding: 4px 10px; }
.nzf-muted { margin: 0 0 12px; font-size: 12.5px; color: #6B7688; line-height: 1.75; }
.nzf-examples { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.nzf-example {
  padding: 6px 12px; border-radius: 999px; border: 1px solid #DDE5F5; background: #fff;
  font-size: 12px; color: #3C4A63; cursor: pointer;
}
.nzf-example:hover { border-color: #4169E1; color: #4169E1; }
.nzf-goal {
  width: 100%; box-sizing: border-box; padding: 12px 13px; border-radius: 10px;
  border: 1px solid rgba(10, 31, 68, .14); background: #fff; font-size: 13.5px;
  font-family: inherit; line-height: 1.7; resize: vertical; outline: none;
}
.nzf-goal:focus { border-color: #4169E1; box-shadow: 0 0 0 3px rgba(65, 105, 225, .10); }
.nzf-start-row { display: flex; align-items: center; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
.nzf-cost-tip { font-size: 11.5px; color: #8A94A6; }

.nzf-btn {
  height: 40px; padding: 0 20px; border: 0; border-radius: 10px; cursor: pointer;
  background: #EDF1F8; color: #33415C; font-size: 13.5px; font-weight: 600; font-family: inherit;
}
.nzf-btn.primary { background: #4169E1; color: #fff; box-shadow: 0 8px 20px rgba(65, 105, 225, .24); }
.nzf-btn.ghost { background: #fff; border: 1px solid rgba(10, 31, 68, .14); color: #4A5568; }
.nzf-btn.small { height: 32px; padding: 0 12px; font-size: 12px; border-radius: 8px; box-shadow: none; }
.nzf-btn:disabled { opacity: .55; cursor: not-allowed; }

.nzf-output { }
.nzf-output-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.nzf-output-head h4 { margin: 0; font-size: 14px; color: #0A1F44; }
.nzf-owner { font-size: 10.5px; font-weight: 700; padding: 3px 9px; border-radius: 999px; }
.nzf-owner.ai { background: #EEF3FF; color: #4169E1; }
.nzf-owner.user { background: #FFF4E5; color: #C77700; }
.nzf-owner.handoff { background: #FDEFF0; color: #C0392B; }

.nzf-md { font-size: 13px; color: #2A3448; line-height: 1.85; word-break: break-word; }
.nzf-md h1, .nzf-md h2, .nzf-md h3, .nzf-md h4 { color: #0A1F44; margin: 18px 0 8px; line-height: 1.45; }
.nzf-md h1 { font-size: 17px; }
.nzf-md h2 { font-size: 15.5px; }
.nzf-md h3 { font-size: 14.5px; }
.nzf-md h4 { font-size: 13.5px; }
.nzf-md p { margin: 0 0 10px; }
.nzf-md ul, .nzf-md ol { margin: 0 0 12px; padding-left: 20px; }
.nzf-md li { margin-bottom: 5px; }
.nzf-md a { color: #4169E1; text-decoration: none; border-bottom: 1px dashed rgba(65, 105, 225, .5); }
.nzf-md code { background: #F2F5FA; border-radius: 4px; padding: 1px 5px; font-size: 12px; }
.nzf-md .nzf-code { background: #0E1B33; color: #DDE6F5; border-radius: 9px; padding: 12px 14px; overflow-x: auto; font-size: 12px; }
.nzf-md .nzf-code code { background: transparent; color: inherit; padding: 0; }
.nzf-md blockquote { margin: 0 0 12px; padding: 8px 12px; border-left: 3px solid #C9D6F5; background: #F7F9FE; color: #4A5568; border-radius: 0 8px 8px 0; }
.nzf-table-wrap { overflow-x: auto; margin: 0 0 12px; }
.nzf-md table { width: 100%; border-collapse: collapse; font-size: 12px; }
.nzf-md th, .nzf-md td { border: 1px solid rgba(10, 31, 68, .12); padding: 7px 9px; text-align: left; vertical-align: top; }
.nzf-md th { background: #F5F8FF; color: #0A1F44; font-weight: 700; }

.nzf-pending { padding: 18px; border: 1px dashed #D5DDEA; border-radius: 12px; background: #FBFCFE; }
.nzf-pending b { display: block; font-size: 13px; color: #4A5568; margin-bottom: 6px; }
.nzf-pending p { margin: 0 0 6px; font-size: 12.5px; color: #6B7688; line-height: 1.7; }
.nzf-pending span { font-size: 11.5px; color: #8A94A6; }

.nzf-confirm {
  margin-top: 16px; padding: 14px 16px; border: 2px solid #F5C542; border-radius: 13px;
  background: #FFFDF5; box-shadow: 0 8px 22px rgba(245, 197, 66, .16);
}
.nzf-confirm-head { font-size: 12.5px; font-weight: 700; color: #9A6B00; margin-bottom: 10px; }
.nzf-questions { display: flex; flex-direction: column; gap: 12px; }
.nzf-question b { display: block; font-size: 12.8px; color: #2A3448; line-height: 1.6; }
.nzf-why { display: block; font-size: 11.5px; color: #8A94A6; margin: 3px 0 6px; line-height: 1.55; }
.nzf-options { display: flex; flex-wrap: wrap; gap: 8px; }
.nzf-options label {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px;
  border: 1px solid #E1E7F2; border-radius: 999px; background: #fff; font-size: 12px; color: #33415C; cursor: pointer;
}
.nzf-options input { accent-color: #4169E1; }
.nzf-qtext {
  width: 100%; box-sizing: border-box; padding: 9px 11px; border-radius: 9px;
  border: 1px solid #E1E7F2; font-size: 12.5px; font-family: inherit; resize: vertical; outline: none;
}
.nzf-qtext:focus { border-color: #4169E1; }
.nzf-handoffs { margin-top: 14px; }
.nzf-handoffs h4 { margin: 0 0 8px; font-size: 12px; color: #C0392B; }
.nzf-handoff {
  display: flex; flex-direction: column; gap: 2px; padding: 9px 11px; margin-bottom: 7px;
  border: 1px solid #F6DADC; border-radius: 9px; background: #fff; text-decoration: none;
}
.nzf-handoff:hover { border-color: #E5484D; box-shadow: 0 4px 12px rgba(229, 72, 77, .10); }
.nzf-handoff b { font-size: 12.5px; color: #C0392B; }
.nzf-handoff span { font-size: 11.5px; color: #7A8496; }
.nzf-actions { display: flex; align-items: center; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
.nzf-actions-tip { font-size: 11.5px; color: #8A94A6; }

.nzf-deliverable { margin-bottom: 16px; border: 1px solid rgba(34, 160, 107, .25); border-radius: 13px; overflow: hidden; }
.nzf-deliverable-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 16px; background: linear-gradient(120deg, #EAF9F1, #F7FDFA); border-bottom: 1px solid rgba(34, 160, 107, .18);
}
.nzf-deliverable-head h3 { margin: 4px 0 0; font-size: 15px; color: #0A1F44; }
.nzf-deliverable-actions { display: flex; gap: 8px; }
.nzf-badge { font-size: 11px; font-weight: 700; color: #22A06B; background: #fff; border-radius: 999px; padding: 3px 10px; }
.nzf-deliverable .nzf-md { padding: 16px; max-height: none; }

/* ── 右栏：实时输出 + 指令 ── */
.nzf-right { display: flex; flex-direction: column; background: #0E1B33; border-left: 1px solid rgba(10, 31, 68, .09); min-width: 0; }
.nzf-right-head {
  display: flex; align-items: center; gap: 7px; padding: 13px 16px;
  font-size: 12px; font-weight: 600; color: #C7D3E8; border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.nzf-live-dot { width: 7px; height: 7px; border-radius: 50%; background: #34D399; box-shadow: 0 0 0 4px rgba(52, 211, 153, .14); animation: nzf-pulse 1.8s ease-in-out infinite; }
.nzf-balance { margin-left: auto; font-size: 11px; font-weight: 400; color: #7C8BA6; }
.nzf-logs { flex: 1; overflow-y: auto; padding: 12px 14px; display: flex; flex-direction: column; gap: 9px; }
.nzf-log { padding: 8px 10px; border-radius: 8px; background: rgba(255, 255, 255, .04); border-left: 2px solid rgba(255, 255, 255, .16); }
.nzf-log p { margin: 0; font-size: 12px; line-height: 1.65; color: #C7D3E8; word-break: break-word; }
.nzf-log-sub { margin-top: 4px !important; color: #7C8BA6 !important; font-size: 11.5px !important; }
.nzf-log time { display: block; font-size: 10px; color: #62718C; margin-bottom: 2px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.nzf-log.step { border-left-color: #4169E1; }
.nzf-log.step p { color: #AFC4E8; }
.nzf-log.adjust { border-left-color: #A78BFA; }
.nzf-log.adjust p { color: #C9BDF7; }
.nzf-log.done { border-left-color: #22A06B; background: rgba(34, 160, 107, .10); }
.nzf-log.done p { color: #86E3B8; }
.nzf-log.error { border-left-color: #E5484D; background: rgba(229, 72, 77, .12); }
.nzf-log.error p { color: #FF9EA2; }
.nzf-log.busy { display: flex; align-items: center; gap: 8px; border-left-color: #F5A623; }
.nzf-log.busy p { color: #F3C77B; }
.nzf-log.busy .nzf-spinner { border-color: rgba(245, 166, 35, .3); border-top-color: #F5A623; }
.nzf-log-link { display: inline-block; margin-top: 6px; font-size: 11.5px; color: #FFD18A; }
.nzf-chatbar {
  height: 70px; flex: none; display: flex; gap: 8px; align-items: stretch;
  padding: 10px 12px; border-top: 1px solid rgba(255, 255, 255, .10); background: #0A1527;
}
.nzf-chatbar textarea {
  flex: 1; min-width: 0; height: 50px; box-sizing: border-box; padding: 8px 10px; resize: none;
  border: 1px solid rgba(255, 255, 255, .14); border-radius: 9px; background: rgba(255, 255, 255, .05);
  color: #E4EBF7; font-size: 12.5px; font-family: inherit; line-height: 1.6; outline: none;
}
.nzf-chatbar textarea::placeholder { color: #67768F; }
.nzf-chatbar textarea:focus { border-color: #4169E1; background: rgba(65, 105, 225, .10); }
.nzf-send {
  flex: none; width: 62px; border: 0; border-radius: 9px; cursor: pointer;
  background: #4169E1; color: #fff; font-size: 13px; font-weight: 600;
}
.nzf-send:disabled { opacity: .5; cursor: not-allowed; }

@media (max-width: 1280px) {
  .nzf-ws { grid-template-columns: 210px minmax(0, 1fr) 330px; }
}
@media (max-width: 1024px) {
  .nzf-ws { grid-template-columns: 200px minmax(0, 1fr) 300px; }
  .nzf-app { padding: 0 12px 24px; }
}
@media (max-width: 860px) {
  .nzf-ws { display: flex; flex-direction: column; height: auto; min-height: 0; }
  .nzf-left { border-right: 0; border-bottom: 1px solid rgba(10, 31, 68, .09); }
  .nzf-tree { max-height: 240px; }
  .nzf-left-foot { display: none; }
  .nzf-mid { min-height: 420px; }
  .nzf-right { border-left: 0; border-top: 1px solid rgba(10, 31, 68, .09); }
  .nzf-logs { height: 260px; flex: none; }
  .nzf-tabs-hint { display: none; }
}
