/* 智能体办公室 · 深色主题（发光数字/渐变/状态色） */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --bg: #0d0f16;
  --panel: #151923;
  --panel2: #1a1f2d;
  --border: rgba(255,255,255,0.07);
  --text: #e2e8f0;
  --muted: #8b93a7;
  --accent: #7c6cf0;
  --green: #4ade80;
  --red: #f87171;
  --amber: #fbbf24;
}
html, body { height: 100%; }
body {
  background: var(--bg);
  background-image: radial-gradient(1200px 500px at 50% -100px, rgba(124,108,240,0.10), transparent);
  color: var(--text);
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 13px;
  overflow: hidden;
}

/* ---------- 顶栏 ---------- */
.topbar {
  height: 52px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px;
  border-bottom: 1px solid var(--border);
  background: rgba(21,25,35,0.7);
  backdrop-filter: blur(8px);
}
.brand { font-size: 16px; font-weight: 700; letter-spacing: 0.5px; }
.brand-sub { font-size: 11px; color: var(--muted); font-weight: 400; margin-left: 8px; }
.top-stats { display: flex; gap: 22px; align-items: center; }
.ts { text-align: center; }
.ts-n {
  display: block; font-size: 18px; font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--green); text-shadow: 0 0 12px rgba(74,222,128,0.5);
}
.ts-l { font-size: 10px; color: var(--muted); }
.ts.ws { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.dot-green { background: var(--green); box-shadow: 0 0 8px var(--green); }
.dot-red { background: var(--red); box-shadow: 0 0 8px var(--red); }

/* ---------- 布局 ---------- */
.layout {
  display: grid;
  grid-template-columns: 280px 1fr 250px;
  gap: 12px;
  height: calc(100vh - 52px);
  padding: 12px;
}
.left, .right, .center { display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.center { overflow-y: auto; }
.left { overflow-y: auto; }
.right { overflow: hidden; }

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  flex-shrink: 0;
}
.left .panel:last-child, .right .panel { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.panel-title {
  font-size: 12px; font-weight: 700; color: var(--text);
  margin-bottom: 10px;
  display: flex; align-items: center; gap: 6px;
}
.hint { font-weight: 400; color: var(--muted); font-size: 10px; margin-left: auto; }

/* ---------- 员工名册 ---------- */
.agent-list { display: flex; flex-direction: column; gap: 6px; overflow-y: auto; flex: 1; min-height: 0; }
.agent-row {
  display: flex; align-items: center; gap: 10px;
  background: var(--panel2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
  transition: border-color 0.2s;
}
.agent-row:hover { border-color: rgba(124,108,240,0.4); }
.agent-avatar {
  width: 34px; height: 34px; border-radius: 9px;
  background: linear-gradient(135deg, var(--c), color-mix(in srgb, var(--c) 55%, #000));
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800; color: #fff;
  box-shadow: 0 0 14px color-mix(in srgb, var(--c) 35%, transparent);
  flex-shrink: 0;
}
.agent-info { flex: 1; min-width: 0; }
.agent-name { font-size: 12px; font-weight: 700; white-space: nowrap; }
.agent-role { font-size: 10px; color: var(--muted); font-weight: 400; margin-left: 4px; }
.badge-real {
  font-size: 9px; background: rgba(124,108,240,0.2); color: #b3a8ff;
  border: 1px solid rgba(124,108,240,0.4); border-radius: 4px; padding: 0 4px; margin-left: 4px;
}
.agent-status { font-size: 10px; margin-top: 2px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.agent-status.writing, .agent-status.researching, .agent-status.executing, .agent-status.syncing { color: #7dd3fc; }
.agent-status.meeting { color: #c4b5fd; }
.agent-status.error { color: var(--red); }
.agent-xp { font-size: 11px; font-weight: 700; color: var(--amber); text-align: right; text-shadow: 0 0 10px rgba(251,191,36,0.35); }
.xp-sub { font-size: 9px; color: var(--muted); font-weight: 400; }

/* ---------- 指挥台 ---------- */
.boss-box { display: flex; gap: 6px; margin-bottom: 8px; }
.boss-box input, .new-task input, select {
  flex: 1; min-width: 0;
  background: var(--panel2); border: 1px solid var(--border);
  border-radius: 8px; padding: 8px 10px; color: var(--text); font-size: 12px;
  outline: none;
}
.boss-box input:focus, .new-task input:focus { border-color: var(--accent); }
button {
  background: linear-gradient(135deg, #6d5ce0, #8b7bf7);
  border: none; border-radius: 8px; color: #fff;
  padding: 8px 12px; font-size: 12px; font-weight: 700; cursor: pointer;
  white-space: nowrap;
  transition: filter 0.15s, transform 0.1s;
}
button:hover { filter: brightness(1.15); }
button:active { transform: scale(0.97); }
.demo-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.demo-btns button {
  background: var(--panel2); border: 1px solid var(--border);
  font-weight: 500; font-size: 11px; padding: 7px 4px;
}
.demo-btns button:hover { border-color: rgba(124,108,240,0.5); }

/* ---------- 办公室画布 ---------- */
.office-panel { flex-shrink: 0; }
.canvas-wrap {
  border-radius: 10px; overflow: hidden;
  border: 1px solid var(--border);
  background: #12151f;
  display: flex; justify-content: center;
  position: relative;
}
/* 全屏态 */
.canvas-wrap:fullscreen {
  border-radius: 0;
  width: 100vw; height: 100vh;
  background: #0d0f16;
}
.canvas-wrap:fullscreen .agent-card { top: 18px; right: 18px; }
/* 全屏退出按钮（仅全屏时显示） */
#fs-exit {
  display: none;
  position: absolute; top: 14px; left: 14px; z-index: 20;
  background: rgba(21,25,35,0.88);
  border: 1px solid rgba(124,108,240,0.5);
  color: #e2e8f0; font-size: 12px; font-weight: 600;
  padding: 8px 14px; border-radius: 9px; cursor: pointer;
  backdrop-filter: blur(6px);
  box-shadow: 0 4px 18px rgba(0,0,0,0.45);
}
#fs-exit:hover { background: rgba(124,108,240,0.3); }
.canvas-wrap:fullscreen #fs-exit { display: block; }
#office-canvas { display: block; max-width: 100%; touch-action: none; }
.cam-reset {
  background: rgba(124,108,240,0.12); border: 1px solid rgba(124,108,240,0.35);
  color: #b3a8ff; font-size: 10px; padding: 3px 8px; border-radius: 6px; margin-left: 6px;
}
/* ---------- 员工档案浮卡 ---------- */
.agent-card {
  position: absolute; top: 10px; right: 10px; width: 268px;
  background: rgba(21,25,35,0.96);
  border: 1px solid rgba(124,108,240,0.4);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5), 0 0 20px rgba(124,108,240,0.15);
  backdrop-filter: blur(8px);
  opacity: 0; transform: translateX(16px) scale(0.96);
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  overflow: hidden;
}
.agent-card.show { opacity: 1; transform: translateX(0) scale(1); pointer-events: auto; }
.card-head {
  display: flex; align-items: center; gap: 9px; padding: 10px 12px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--c) 22%, transparent), transparent);
  border-bottom: 1px solid var(--border);
}
.card-head .agent-avatar { width: 32px; height: 32px; }
.card-head .agent-name { font-size: 13px; }
.card-head > div:nth-child(2) { flex: 1; min-width: 0; }
.card-close {
  background: transparent; border: none; color: var(--muted); font-size: 12px;
  padding: 2px 6px; cursor: pointer;
}
.card-close:hover { color: var(--text); filter: none; }
.card-body { padding: 10px 12px; }
.card-row {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 11px; padding: 4px 0; gap: 8px;
}
.card-row span { color: var(--muted); flex-shrink: 0; }
.card-row b { font-weight: 600; text-align: right; font-size: 11px; }
.card-row b.meeting { color: #c4b5fd; }
.card-row b.writing, .card-row b.researching, .card-row b.executing, .card-row b.syncing { color: #7dd3fc; }
.card-row b.error { color: var(--red); }
.card-row b.xp { color: var(--amber); }
.card-actions { display: flex; gap: 6px; margin-top: 8px; }
.card-actions button {
  flex: 1; background: var(--panel2); border: 1px solid var(--border);
  color: var(--text); font-size: 10.5px; padding: 6px 2px; font-weight: 500;
}
.card-actions button:hover { border-color: rgba(124,108,240,0.5); }
.card-act-grid { grid-template-columns: repeat(2, 1fr); display: grid; }
.card-act-grid .act-stop { grid-column: 1 / -1; background: rgba(239,68,68,0.12); border-color: rgba(239,68,68,0.3); color: #fca5a5; }
.card-acts-label { font-size: 10px; color: var(--muted); margin: 10px 0 6px; font-weight: 600; display: flex; align-items: center; justify-content: space-between; }
.chat-hint { font-size: 9px; color: #7dd3fc; font-weight: 400; }
.chat-log { max-height: 110px; overflow-y: auto; display: flex; flex-direction: column; gap: 5px; margin-bottom: 8px; background: rgba(13,15,22,0.5); border-radius: 8px; padding: 8px; min-height: 40px; }
.chat-msg { font-size: 11px; line-height: 1.45; color: var(--text); }
.chat-msg.me { color: #7dd3fc; }
.chat-msg.ta { color: #e2e8f0; }
.chat-msg.thinking { color: var(--muted); opacity: 0.6; }
.chat-msg.err { color: var(--red); }
.chat-input-row { display: flex; gap: 6px; }
.chat-input-row input { flex: 1; background: var(--panel2); border: 1px solid var(--border); border-radius: 8px; padding: 7px 10px; color: var(--text); font-size: 11px; outline: none; }
.chat-input-row input:focus { border-color: var(--accent); }
.chat-input-row button { padding: 7px 12px; font-size: 11px; }
.agent-row { cursor: pointer; }
/* ---------- 真实工作流面板 ---------- */
.work-list { display: flex; flex-direction: column; gap: 5px; overflow-y: auto; flex: 1; min-height: 0; max-height: 180px; }
.work-item { display: flex; gap: 7px; align-items: flex-start; padding: 7px 9px; background: var(--panel2); border: 1px solid var(--border); border-radius: 8px; cursor: pointer; transition: border-color 0.2s; }
.work-item:hover { border-color: rgba(124,108,240,0.45); }
.work-pr { font-size: 11px; line-height: 1.3; }
.work-info { flex: 1; min-width: 0; }
.work-title { font-size: 11px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.work-meta { font-size: 9.5px; color: var(--muted); margin-top: 1px; }
.recent-msgs { max-height: 90px; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }
.recent-msg { font-size: 10px; line-height: 1.4; color: var(--text); padding: 5px 7px; background: rgba(13,15,22,0.5); border-radius: 6px; border-left: 2px solid rgba(124,108,240,0.4); }
.recent-time { color: var(--muted); font-size: 9px; margin-right: 4px; }
/* ---------- 灵枢桥接模式：精简布局 ---------- */
body.bridge .layout { grid-template-columns: 260px 1fr; }
body.bridge .right { display: none; }
body.bridge .center > .panel:not(.office-panel) { display: none; }
body.bridge .top-stats { display: none; }
body.bridge .left { display: block; }
body.bridge .left .panel:last-child .panel-title::after { content: ''; }
#bridge-time { font-size: 9px; color: var(--muted); font-weight: 400; margin-left: 6px; }
/* 指挥台指令回显 */
#boss-echo { max-height: 150px; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.boss-echo-msg { font-size: 10.5px; line-height: 1.45; padding: 6px 8px; border-radius: 7px; background: var(--panel2); border-left: 2px solid var(--accent); }
.boss-echo-msg.reply { border-left-color: var(--green); }
.boss-echo-msg.wait { border-left-color: var(--amber); color: var(--muted); }
.boss-echo-msg.err { border-left-color: var(--red); color: #fca5a5; }
.echo-wait { color: var(--amber); font-size: 9px; }
/* ---------- 3D 标签层 ---------- */
#office-labels {
  position: absolute; inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 5;
}
.actor-label {
  position: absolute; top: 0; left: 0;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  transition: opacity 0.25s;
  will-change: transform;
}
.actor-label.dim { opacity: 0.35; }
.actor-label.sel .al-name { color: #fff; text-shadow: 0 0 10px rgba(124,108,240,0.9); }
.al-name {
  font-size: 10px; font-weight: 600;
  color: rgba(240,244,250,0.95);
  background: rgba(13,15,22,0.55);
  padding: 1px 6px; border-radius: 6px;
  white-space: nowrap;
  backdrop-filter: blur(2px);
}
.al-bubble {
  font-size: 10px; color: #fcd34d;
  background: rgba(24,28,40,0.92);
  border: 1px solid rgba(245,158,11,0.5);
  padding: 2px 8px; border-radius: 8px;
  white-space: nowrap;
  max-width: 150px; overflow: hidden; text-overflow: ellipsis;
}
.al-bubble:empty, .al-bubble[style*="none"] { display: none; }
.actor-xpfx {
  position: absolute; top: 0; left: 0;
  font-size: 13px; font-weight: 800;
  pointer-events: none;
  text-shadow: 0 0 8px currentColor;
  will-change: transform, opacity;
}
.canvas-wrap canvas { display: block; touch-action: none; }

/* ---------- 任务看板 ---------- */
.new-task { display: flex; gap: 6px; margin-bottom: 10px; }
.new-task select { flex: 0 0 auto; max-width: 130px; }
.board {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
}
.board-col {
  background: var(--panel2); border: 1px solid var(--border);
  border-radius: 10px; padding: 8px; min-height: 120px;
}
.col-head { font-size: 11px; font-weight: 700; color: var(--muted); margin-bottom: 8px; display: flex; gap: 6px; }
.task-count {
  background: rgba(124,108,240,0.15); color: #b3a8ff;
  border-radius: 10px; padding: 0 7px; font-size: 10px; font-variant-numeric: tabular-nums;
}
.task-items { display: flex; flex-direction: column; gap: 6px; }
.task-card {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 8px; padding: 8px;
}
.task-title { font-size: 11.5px; font-weight: 600; line-height: 1.4; }
.task-detail { font-size: 10px; color: var(--muted); margin-top: 3px; }
.task-foot { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.pr-badge { font-size: 9px; border-radius: 4px; padding: 1px 5px; }
.pr-urgent { background: rgba(248,113,113,0.15); color: var(--red); border: 1px solid rgba(248,113,113,0.35); }
.pr-high { background: rgba(251,191,36,0.12); color: var(--amber); border: 1px solid rgba(251,191,36,0.3); }
.pr-normal { background: rgba(139,147,167,0.12); color: var(--muted); border: 1px solid rgba(139,147,167,0.25); }
.task-who {
  font-size: 9px; color: #fff; background: var(--c);
  border-radius: 4px; padding: 1px 5px;
}
.task-move { margin-left: auto; }
.mv-btn {
  background: rgba(124,108,240,0.15); border: 1px solid rgba(124,108,240,0.35);
  color: #b3a8ff; padding: 2px 8px; font-size: 11px; border-radius: 5px;
}
.task-empty { color: var(--muted); font-size: 10px; text-align: center; padding: 14px 0; }
#tasks-done .task-card { opacity: 0.6; }

/* ---------- 活动流 ---------- */
.activity-feed { overflow-y: auto; flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 5px; }
.act-item {
  font-size: 11px; line-height: 1.45;
  padding: 6px 8px; border-radius: 7px;
  background: var(--panel2); border-left: 2px solid transparent;
}
.act-time { color: var(--muted); font-size: 9px; margin-right: 5px; font-variant-numeric: tabular-nums; }
.act-done { border-left-color: var(--green); }
.act-boss { border-left-color: var(--amber); background: rgba(251,191,36,0.06); }
.act-state { border-left-color: rgba(124,108,240,0.5); }
.act-task { border-left-color: #7dd3fc; }

/* ---------- 滚动条 ---------- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 3px; }
::-webkit-scrollbar-track { background: transparent; }

@media (max-width: 1100px) {
  .layout { grid-template-columns: 240px 1fr; }
  .right { display: none; }
}
