/* [B1-a v7.10] 自 static/index.html <style> 块原样抽离（内容零改动） */
    * { margin: 0; padding: 0; box-sizing: border-box; }
    body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; background: #f0f2f5; color: #333; }

    .login-page { display: flex; justify-content: center; align-items: center; height: 100vh; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
    .login-card { background: white; padding: 40px; border-radius: 12px; box-shadow: 0 8px 32px rgba(0,0,0,0.2); width: 380px; }
    .login-card h1 { text-align: center; font-size: 22px; margin-bottom: 8px; color: #333; }
    .login-card p { text-align: center; color: #999; font-size: 13px; margin-bottom: 28px; }

    .app-layout { display: flex; height: 100vh; }
    .sidebar { width: 220px; background: #1a1a2e; color: #eee; display: flex; flex-direction: column; flex-shrink: 0; position: relative; }
    .sidebar-header { padding: 20px; text-align: center; border-bottom: 1px solid #2a2a4e; }
    .sidebar-header h2 { font-size: 16px; color: #fff; }
    .sidebar-header p { font-size: 11px; color: #888; margin-top: 4px; }
    /* [B2-g1 / V6 v6.85+86] 侧栏滚动加固：正确收缩出滚动区 + 高对比 12px 滚动条 */
    .sidebar-menu { list-style: none; padding: 6px 0 18px; flex: 1 1 0%; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
    .sidebar-menu::-webkit-scrollbar { width: 12px; }
    .sidebar-menu::-webkit-scrollbar-track { background: #14142a; }
    .sidebar-menu::-webkit-scrollbar-thumb { background: #50509a; border-radius: 6px; border: 2px solid #14142a; min-height: 40px; }
    .sidebar-menu::-webkit-scrollbar-thumb:hover { background: #6f7ff0; }
    /* [v6.85] 底部渐隐：「还有更多菜单」的视线提示 */
    .sidebar.is-scrollable-more::after { content: ''; position: absolute; left: 0; right: 12px; bottom: 0; height: 34px; pointer-events: none; z-index: 2; background: linear-gradient(180deg, rgba(26,26,46,0) 0%, rgba(26,26,46,.96) 78%); }
    /* [v6.84] 菜单搜索框（32 项菜单快速定位） */
    .sidebar-search { position: relative; padding: 8px 12px 4px; }
    .sidebar-search-input { width: 100%; box-sizing: border-box; background: #23233f; border: 1px solid #2f2f52; border-radius: 6px; color: #ddd; font-size: 12px; padding: 6px 24px 6px 8px; outline: none; }
    .sidebar-search-input::placeholder { color: #6a6a92; }
    .sidebar-search-input:focus { border-color: #667eea; }
    .sidebar-search-clear { position: absolute; right: 20px; top: 50%; transform: translateY(-40%); color: #888; cursor: pointer; font-size: 11px; }
    .sidebar-search-clear:hover { color: #fff; }
    .menu-empty { padding: 16px 24px; font-size: 12px; color: #6a6a92; }
    /* [v6.84] 导航分组：组标题可点击折叠 + 项数角标；[v6.86] 吸顶 */
    .sidebar-menu .menu-group { margin-bottom: 1px; }
    .sidebar-menu .menu-group-title { display: flex; align-items: center; gap: 6px; padding: 8px 24px 3px; font-size: 11px; color: #6a6a92; letter-spacing: 1.5px; user-select: none; cursor: pointer; position: sticky; top: 0; z-index: 3; background: #1a1a2e; }
    .sidebar-menu .menu-group-title:hover { color: #9a9ac0; }
    .sidebar-menu .menu-group-count { font-size: 10px; color: #55557a; letter-spacing: 0; }
    .sidebar-menu .menu-group-arrow { margin-left: auto; font-size: 10px; color: #55557a; }
    .sidebar-menu .menu-group-items { list-style: none; }
    /* [v6.84] 紧凑化：菜单总高约 -18% */
    .sidebar-menu li { padding: 7px 24px; cursor: pointer; display: flex; align-items: center; gap: 10px; font-size: 13px; color: #aaa; transition: all 0.2s; }
    .sidebar-menu li:hover { background: #2a2a4e; color: #fff; }
    .sidebar-menu li.active { background: #4a4a8e; color: #fff; border-left: 3px solid #667eea; }
    .sidebar-menu li .badge { background: #e74c3c; color: #fff; font-size: 10px; padding: 1px 6px; border-radius: 10px; margin-left: auto; }
    /* [v6.86] 悬浮滚动钮：还有更多时 ↓ 滚一屏，到底后 ↑ 回顶（小屏/高缩放救急） */
    .sidebar-scroll-fab { position: absolute; right: 18px; bottom: 14px; width: 30px; height: 30px; border-radius: 50%; background: #50509a; color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: 0 2px 10px rgba(0,0,0,.45); z-index: 5; font-size: 15px; line-height: 1; user-select: none; }
    .sidebar-scroll-fab:hover { background: #6f7ff0; }

    .main-area { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
    .topbar { height: 50px; background: white; display: flex; align-items: center; justify-content: space-between; padding: 0 24px; border-bottom: 1px solid #e8e8e8; }
    .content { flex: 1; padding: 20px; overflow-y: auto; }

    .page-title { font-size: 18px; font-weight: 600; margin-bottom: 16px; color: #333; }

    .stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; margin-bottom: 20px; }
    .stat-card { background: white; padding: 20px; border-radius: 8px; box-shadow: 0 1px 4px rgba(0,0,0,0.06); }
    .stat-card .label { font-size: 13px; color: #888; }
    .stat-card .value { font-size: 28px; font-weight: 700; color: #333; margin: 8px 0; }
    .stat-card .change { font-size: 12px; color: #67c23a; }
    .stat-card.clickable { cursor: pointer; transition: box-shadow .2s, transform .2s; }
    .stat-card.clickable:hover { box-shadow: 0 4px 14px rgba(0,0,0,0.15); transform: translateY(-2px); }
    .stat-card.clickable::after { content: '点击查看 →'; display: block; font-size: 11px; color: #409eff; margin-top: 6px; }

    .chart-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
    .chart-box { background: white; padding: 16px; border-radius: 8px; box-shadow: 0 1px 4px rgba(0,0,0,0.06); }
    .chart-box h3 { font-size: 14px; color: #555; margin-bottom: 12px; }
    .chart-canvas { width: 100%; height: 280px; }

    .toolbar { display: flex; gap: 12px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }

    /* 对话中心样式 */
    .chat-layout { display: flex; height: calc(100vh - 110px); background: white; border-radius: 8px; box-shadow: 0 1px 4px rgba(0,0,0,0.06); overflow: hidden; }
    .chat-sidebar { width: 200px; border-right: 1px solid #e8e8e8; display: flex; flex-direction: column; }
    .chat-sidebar-header { padding: 12px; border-bottom: 1px solid #f0f0f0; display: flex; justify-content: space-between; align-items: center; }
    .chat-list { flex: 1; overflow-y: auto; }
    .chat-item { padding: 12px; cursor: pointer; border-bottom: 1px solid #f5f5f5; transition: background 0.2s; }
    .chat-item:hover { background: #f5f5f5; }
    .chat-item.active { background: #ecf5ff; border-left: 3px solid #409eff; }
    .chat-item .title { font-size: 13px; color: #333; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .chat-item .time { font-size: 11px; color: #999; margin-top: 4px; }
    .chat-main { flex: 1; display: flex; flex-direction: column; }
    .chat-messages { flex: 1; overflow-y: auto; padding: 20px; }
    .chat-msg { margin-bottom: 16px; display: flex; }
    .chat-msg.user { justify-content: flex-end; }
    .chat-msg .bubble { max-width: 70%; padding: 10px 14px; border-radius: 12px; font-size: 14px; line-height: 1.6; }
    .chat-msg.user .bubble { background: #409eff; color: white; }
    .chat-msg.assistant .bubble { background: #f4f4f5; color: #333; }
    .chat-msg .agent-tag { font-size: 11px; color: #999; margin-bottom: 4px; }
    .chat-input-area { padding: 16px; border-top: 1px solid #e8e8e8; display: flex; gap: 12px; }

    /* [B2-h1/v6.126] 对话页左侧智能体面板（点名调度） */
    .chat-agents { width: 190px; border-right: 1px solid #e8e8e8; display: flex; flex-direction: column; background: #fafbfc; overflow-y: auto; }
    .chat-agents-header { padding: 12px 12px 6px; display: flex; justify-content: space-between; align-items: center; position: sticky; top: 0; background: #fafbfc; z-index: 1; }
    .agent-item { display: flex; align-items: center; gap: 8px; padding: 8px 10px; margin: 0 8px 3px; border-radius: 8px; cursor: pointer; transition: background 0.15s, box-shadow 0.15s; border: 1px solid transparent; }
    .agent-item:hover { background: #f0f2f5; }
    .agent-item.active { background: #ecf5ff; border-color: #b3d8ff; box-shadow: 0 0 0 1px #b3d8ff inset; }
    .agent-item.active .agent-name { color: #409eff; }
    .agent-item.disabled { opacity: 0.55; cursor: not-allowed; }
    .agent-avatar { width: 30px; height: 30px; border-radius: 50%; flex: none; object-fit: cover; border: 1px solid #e4e7ed; display: inline-flex; align-items: center; justify-content: center; font-size: 17px; line-height: 1; }
    .agent-avatar.auto { background: linear-gradient(135deg, #a8c6ff, #409eff); color: #fff; font-size: 15px; }
    .agent-avatar.emoji { background: #fff; }
    .agent-meta { min-width: 0; }
    .agent-name { font-size: 12.5px; font-weight: 600; color: #303133; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .agent-sub { font-size: 10.5px; color: #a8abb2; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .chat-target-bar { display: flex; align-items: center; gap: 8px; padding: 6px 16px; background: #ecf5ff; border-bottom: 1px solid #d9ecff; font-size: 12px; }
    .chat-input-area .el-input { flex: 1; }

    /* 任务分派样式 */
    .task-card { background: white; padding: 16px; border-radius: 8px; box-shadow: 0 1px 4px rgba(0,0,0,0.06); margin-bottom: 12px; }
    .task-card .task-title { font-weight: 600; font-size: 15px; margin-bottom: 8px; }
    .task-card .task-meta { font-size: 12px; color: #888; margin-bottom: 8px; }
    .task-card .task-agents { display: flex; gap: 6px; margin-bottom: 8px; }

    /* P3：待处理提醒跳转定位——跟进任务行高亮（3秒渐隐） */
    .followup-row-highlight td { background: #fdf6ec !important; box-shadow: inset 0 0 0 2px #e6a23c; transition: background 0.5s; }

    /* [B2-g1 / V6 v6.87] 内容区布局响应保留 768 断点 */
    @media (max-width: 768px) {
      .chart-row { grid-template-columns: 1fr; }
      .stats-row { grid-template-columns: 1fr 1fr; }
      .chat-sidebar { width: 160px; }
      .chat-agents { width: 150px; }
      .topbar { flex-wrap: wrap; gap: 4px; }
      .topbar-info { flex-wrap: wrap; gap: 4px; }
    }
    /* [v6.87] 侧栏折叠断点 768→600：600~768px 窗口仍保留 220px 完整文字菜单（窗口缩窄不再"只剩图标栏"） */
    @media (max-width: 600px) {
      .sidebar { width: 60px; overflow-x: hidden; }
      .sidebar-header { padding: 14px 2px; }
      .sidebar-header h2 { font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.2; }
      .sidebar-header p { display: none; }
      .sidebar-menu li { padding: 9px 0; justify-content: center; }
      .sidebar-menu li span:first-child { font-size: 18px; line-height: 1; }
      .sidebar-menu li span:last-child { display: none; }
      .sidebar-menu .menu-group-title { font-size: 0; padding: 0; margin: 6px 12px; letter-spacing: 0; border-top: 1px solid #2a2a4e; height: 0; overflow: hidden; }
      .sidebar-search { display: none; }
      .sidebar-menu .menu-group-count, .sidebar-menu .menu-group-arrow { display: none; }
      /* [v6.88] 60px 图标栏放不下悬浮钮，会遮住底部图标 → 手机端隐藏（触摸滑动原生可用） */
      .sidebar-scroll-fab { display: none; }
      /* [v6.88] 顶栏窄屏防溢出：隐藏状态标签与用户名，按钮缩字，高度自适应 */
      .topbar { height: auto; min-height: 46px; padding: 6px 10px; flex-wrap: wrap; gap: 4px 8px; overflow: hidden; }
      .topbar-title { font-size: 13px !important; flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
      .topbar-actions { gap: 6px !important; flex-wrap: nowrap; }
      .topbar-tag, .topbar-user { display: none !important; }
      .topbar-btn { padding: 4px 6px !important; font-size: 12px !important; }
    }
    @media (max-width: 480px) {
      .stats-row { grid-template-columns: 1fr; }
      .topbar-info span:not(.tag) { display: none; }
    }

    /* 弹窗内原生输入框样式（绕过el-dialog焦点陷阱） */
    .dlg-input {
      width: 100%; padding: 4px 8px; border: 1px solid #dcdfe6; border-radius: 4px;
      font-size: 13px; line-height: 22px; outline: none; transition: border-color 0.2s;
      background: #fff;
    }
    .dlg-input:focus { border-color: #409eff; }
    .dlg-textarea {
      width: 100%; padding: 4px 8px; border: 1px solid #dcdfe6; border-radius: 4px;
      font-size: 13px; line-height: 1.5; outline: none; transition: border-color 0.2s;
      resize: vertical; font-family: inherit; background: #fff;
    }
    .dlg-textarea:focus { border-color: #409eff; }
    .dlg-checkbox-group { display: flex; flex-wrap: wrap; gap: 8px; }
    .dlg-checkbox-label {
      display: inline-flex; align-items: center; gap: 4px; font-size: 13px;
      cursor: pointer; padding: 4px 8px; border-radius: 4px; border: 1px solid #dcdfe6;
      transition: all 0.2s; background: #fff;
    }
    .dlg-checkbox-label:hover { border-color: #409eff; color: #409eff; }
    .dlg-checkbox-label input[type="checkbox"] { cursor: pointer; }
    .dlg-select {
      width: 100%; padding: 4px 8px; border: 1px solid #dcdfe6; border-radius: 4px;
      font-size: 13px; line-height: 22px; outline: none; transition: border-color 0.2s;
      background: #fff; cursor: pointer; appearance: auto;
    }
    .dlg-select:focus { border-color: #409eff; }
    /* jsPlumb 流程编辑器节点样式 */
    .flow-editor-node {
      position: absolute; width: 140px; padding: 10px 12px; background: #fff;
      border: 2px solid #c0c4cc; border-radius: 8px; cursor: move; z-index: 10;
      box-shadow: 0 2px 8px rgba(0,0,0,0.08); transition: border-color 0.2s, box-shadow 0.2s;
      user-select: none;
    }
    .flow-editor-node:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.15); }
    .flow-editor-node.jtk-drag-selected { border-color: #409eff; box-shadow: 0 0 0 3px rgba(64,158,255,0.2); }
    .flow-node-agent { border-left: 4px solid #409eff; }
    .flow-node-condition { border-left: 4px solid #e6a23c; border-radius: 8px; }
    .flow-node-wait { border-left: 4px solid #909399; }
    .flow-node-interrupt { border-left: 4px solid #f56c6c; }
    .flow-node-terminal { border-left: 4px solid #67c23a; }
    /* jsPlumb 端点 */
    .jtk-endpoint { z-index: 11; }
    .jtk-overlay { z-index: 12; font-size: 11px; color: #606266; }
    /* 原生标签样式（替代el-tag） */
    .tag-native {
      display: inline-block; padding: 2px 8px; font-size: 12px; border-radius: 4px;
      line-height: 1.4; border: 1px solid; vertical-align: middle;
    }
    .tag-success { background: #f0f9eb; color: #67c23a; border-color: #e1f3d8; }
    .tag-warning { background: #fdf6ec; color: #e6a23c; border-color: #faecd8; }
    .tag-danger  { background: #fef0f0; color: #f56c6c; border-color: #fde2e2; }
    .tag-info    { background: #f4f4f5; color: #909399; border-color: #e9e9eb; }
    .task-progress { margin-bottom:8px; font-size:12px; color:#409eff; }
