        :root {
            /* 现代深色侧边栏 + 浅色主内容区 */
            --sidebar-bg: #1a1f2e;
            --sidebar-bg-hover: #252b3d;
            --sidebar-active: #3b82f6;
            --sidebar-text: #94a3b8;
            --sidebar-text-active: #fff;
            --sidebar-border: rgba(255,255,255,0.06);
            
            --primary: #3b82f6;
            --primary-dark: #2563eb;
            --primary-light: #60a5fa;
            --success: #10b981;
            --warning: #f59e0b;
            --danger: #ef4444;
            --info: #06b6d4;
            
            --bg: #f1f5f9;
            --bg-card: #ffffff;
            --bg-secondary: #f8fafc;
            --bg-elevated: #ffffff;
            
            --text: #0f172a;
            --text-secondary: #475569;
            --text-light: #94a3b8;
            --text-muted: #64748b;
            
            --border: #e2e8f0;
            --border-light: #f1f5f9;
            
            --radius-sm: 8px;
            --radius: 12px;
            --radius-lg: 16px;
            
            --shadow: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.02);
            --shadow-sm: 0 1px 2px rgba(0,0,0,0.03);
            --shadow-md: 0 4px 12px rgba(0,0,0,0.06), 0 2px 4px rgba(0,0,0,0.03);
            --shadow-lg: 0 10px 40px rgba(0,0,0,0.08), 0 4px 8px rgba(0,0,0,0.04);
            --shadow-xl: 0 20px 60px rgba(0,0,0,0.12), 0 8px 16px rgba(0,0,0,0.06);
            
            --glow-primary: 0 0 20px rgba(59,130,246,0.15);
            --glow-success: 0 0 20px rgba(16,185,129,0.15);
            --glow-danger: 0 0 20px rgba(239,68,68,0.15);
        }
        
        * { margin: 0; padding: 0; box-sizing: border-box; }
        
        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
            background: var(--bg);
            min-height: 100vh;
            color: var(--text);
            line-height: 1.5;
        }

        /* ===== Layout ===== */
        .app-layout {
            display: flex;
            flex-direction: column;
            min-height: 100vh;
        }

        /* ===== Top Navigation Bar ===== */
        .top-nav {
            background: var(--sidebar-bg);
            display: flex;
            align-items: center;
            justify-content: space-between;
            height: 56px;
            padding: 0 16px;
            position: fixed;
            top: 0; left: 0; right: 0;
            z-index: 100;
            border-bottom: 1px solid var(--sidebar-border);
        }
        .top-nav-brand {
            display: flex;
            align-items: center;
            gap: 10px;
            flex-shrink: 0;
        }
        .top-nav-logo {
            width: 36px;
            height: 36px;
            border-radius: var(--radius-sm);
            background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 18px;
            box-shadow: 0 4px 12px rgba(59,130,246,0.3);
        }
        .top-nav-title {
            color: #fff;
            font-size: 15px;
            font-weight: 700;
            letter-spacing: 0.5px;
        }
        .top-nav-title small {
            display: block;
            font-size: 10px;
            font-weight: 400;
            color: var(--sidebar-text);
            margin-top: 1px;
        }
        .top-nav-menu {
            display: flex;
            align-items: center;
            gap: 2px;
            flex: 1;
            justify-content: center;
            overflow-x: auto;
            scrollbar-width: none;
            padding: 0 12px;
        }
        .top-nav-menu::-webkit-scrollbar { display: none; }
        .top-nav-item {
            padding: 7px 12px;
            border-radius: var(--radius-sm);
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 6px;
            font-size: 12px;
            color: var(--sidebar-text);
            transition: all 0.2s ease;
            user-select: none;
            white-space: nowrap;
            position: relative;
        }
        .top-nav-item:hover {
            background: var(--sidebar-bg-hover);
            color: #e2e8f0;
        }
        .top-nav-item.active {
            background: linear-gradient(135deg, rgba(59,130,246,0.25) 0%, rgba(37,99,235,0.2) 100%);
            color: var(--sidebar-text-active);
            font-weight: 500;
        }
        .top-nav-item.active::after {
            content: '';
            position: absolute;
            bottom: 2px;
            left: 50%;
            transform: translateX(-50%);
            width: 16px;
            height: 2px;
            background: var(--primary);
            border-radius: 2px;
        }
        .nav-badge {
            background: var(--danger);
            color: #fff;
            font-size: 10px;
            padding: 1px 6px;
            border-radius: 10px;
            min-width: 18px;
            text-align: center;
            margin-left: 4px;
            font-weight: 600;
        }
        .top-nav-item.active .nav-badge { background: rgba(255,255,255,0.25); }
        .top-nav-right {
            display: flex;
            align-items: center;
            gap: 8px;
            flex-shrink: 0;
        }
        .ws-status-top {
            display: flex;
            align-items: center;
            gap: 6px;
            font-size: 11px;
            color: var(--sidebar-text);
        }
        .ws-dot {
            width: 8px;
            height: 8px;
            border-radius: 50%;
            background: var(--success);
            box-shadow: 0 0 8px rgba(16,185,129,0.5);
            animation: pulse 2s ease-in-out infinite;
        }
        .ws-dot.offline {
            background: var(--danger);
            box-shadow: 0 0 8px rgba(239,68,68,0.5);
            animation: none;
        }
        @keyframes pulse {
            0%, 100% { opacity: 1; }
            50% { opacity: 0.5; }
        }

        /* ===== Main Content ===== */
        .main-wrapper {
            flex: 1;
            margin-top: 56px;
            display: flex;
            flex-direction: column;
            min-height: calc(100vh - 56px);
        }

        /* ===== Header ===== */
        .header {
            background: var(--bg-card);
            border-bottom: 1px solid var(--border);
            padding: 0 24px;
            height: 64px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            position: sticky;
            top: 0;
            z-index: 90;
            box-shadow: var(--shadow-sm);
        }
        .header h1 { 
            font-size: 20px; 
            font-weight: 700; 
            color: var(--text);
            letter-spacing: -0.3px;
        }
        .header-right { 
            display: flex; 
            align-items: center; 
            gap: 16px; 
            font-size: 13px; 
            color: var(--text-muted);
        }
        .header-time {
            display: flex;
            align-items: center;
            gap: 6px;
            padding: 6px 12px;
            background: var(--bg-secondary);
            border-radius: var(--radius-sm);
            font-weight: 500;
        }

        .main { 
            padding: 24px; 
            flex: 1;
            overflow-x: auto; 
        }

        /* 独立管理页面（工作流/能力）内嵌 iframe 容器 */
        .embed-page { padding: 0; height: calc(100vh - 64px); }
        .embed-frame {
            width: 100%;
            height: 100%;
            border: none;
            display: block;
            background: var(--bg);
            border-radius: 0;
        }

        /* ===== Cards ===== */
        .stats-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
            gap: 20px;
            margin-bottom: 28px;
        }
        .stat-card {
            background: var(--bg-card);
            border-radius: var(--radius);
            padding: 24px;
            box-shadow: var(--shadow);
            position: relative;
            overflow: hidden;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            border: 1px solid var(--border-light);
        }
        .stat-card:hover { 
            box-shadow: var(--shadow-lg); 
            transform: translateY(-3px);
            border-color: var(--border);
        }
        .stat-card::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 3px;
            background: linear-gradient(90deg, var(--primary), var(--primary-light));
            opacity: 0;
            transition: opacity 0.3s;
        }
        .stat-card:hover::before { opacity: 1; }
        .stat-card .stat-icon {
            position: absolute; 
            top: 20px; 
            right: 20px;
            width: 44px; 
            height: 44px; 
            border-radius: var(--radius);
            display: flex; 
            align-items: center; 
            justify-content: center;
            font-size: 22px; 
            opacity: 0.12;
            transition: all 0.3s;
        }
        .stat-card:hover .stat-icon {
            opacity: 0.2;
            transform: scale(1.1);
        }
        .stat-card .stat-icon.blue { background: var(--primary); }
        .stat-card .stat-icon.orange { background: var(--warning); }
        .stat-card .stat-icon.red { background: var(--danger); }
        .stat-card .stat-icon.green { background: var(--success); }
        .stat-card h3 { 
            color: var(--text-light); 
            font-size: 13px; 
            margin-bottom: 10px; 
            font-weight: 500;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }
        .stat-card .value { 
            font-size: 32px; 
            font-weight: 800; 
            color: var(--text);
            letter-spacing: -1px;
            line-height: 1.1;
        }
        .stat-card .sub { 
            font-size: 12px; 
            margin-top: 6px; 
            color: var(--text-light);
            font-weight: 500;
        }

        .card {
            background: var(--bg-card);
            border-radius: var(--radius);
            padding: 24px;
            margin-bottom: 24px;
            box-shadow: var(--shadow);
            border: 1px solid var(--border-light);
            transition: box-shadow 0.3s;
        }
        .card:hover {
            box-shadow: var(--shadow-md);
        }
        .card-title { 
            font-size: 16px; 
            font-weight: 700; 
            margin-bottom: 20px; 
            display: flex; 
            align-items: center; 
            gap: 10px;
            color: var(--text);
        }

        /* ===== Agent Cards ===== */
        .agent-grid { 
            display: grid; 
            grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); 
            gap: 20px; 
        }
        .agent-card {
            border: 1px solid var(--border);
            border-radius: var(--radius);
            padding: 20px;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            background: var(--bg-card);
            position: relative;
            overflow: hidden;
        }
        .agent-card::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            width: 4px;
            height: 100%;
            background: linear-gradient(180deg, var(--primary), var(--primary-light));
            opacity: 0;
            transition: opacity 0.3s;
        }
        .agent-card:hover { 
            border-color: var(--primary); 
            box-shadow: var(--shadow-lg); 
            transform: translateY(-3px);
        }
        .agent-card:hover::before { opacity: 1; }
        .agent-header { display: flex; align-items: center; margin-bottom: 14px; }
        .agent-avatar {
            width: 48px; 
            height: 48px; 
            border-radius: 50%;
            background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
            display: flex; 
            align-items: center; 
            justify-content: center;
            color: #fff; 
            font-size: 20px; 
            margin-right: 14px; 
            flex-shrink: 0;
            box-shadow: 0 4px 12px rgba(59,130,246,0.25);
        }
        .agent-info h4 { 
            font-size: 15px; 
            margin-bottom: 3px;
            font-weight: 600;
        }
        .agent-info p { 
            color: var(--text-light); 
            font-size: 12px; 
        }

        .badge {
            display: inline-block;
            padding: 4px 12px;
            border-radius: 20px;
            font-size: 12px;
            font-weight: 600;
        }
        .badge-online { background: rgba(16,185,129,0.1); color: var(--success); }
        .badge-busy { background: rgba(245,158,11,0.1); color: var(--warning); }
        .badge-idle { background: rgba(6,182,212,0.1); color: var(--info); }
        .badge-offline { background: rgba(148,163,184,0.1); color: var(--text-light); }
        .badge-high { background: rgba(239,68,68,0.1); color: var(--danger); }
        .badge-normal { background: rgba(245,158,11,0.1); color: var(--warning); }
        .badge-low { background: rgba(16,185,129,0.1); color: var(--success); }

        /* ===== Buttons ===== */
        .btn {
            padding: 9px 18px;
            border: none;
            border-radius: var(--radius-sm);
            cursor: pointer;
            font-size: 13px;
            font-weight: 600;
            transition: all 0.2s ease;
            display: inline-flex;
            align-items: center;
            gap: 6px;
        }
        .btn-sm { padding: 6px 14px; font-size: 12px; }
        .btn-primary { 
            background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%); 
            color: #fff;
            box-shadow: 0 2px 8px rgba(59,130,246,0.25);
        }
        .btn-primary:hover { 
            background: linear-gradient(135deg, var(--primary-dark) 0%, #1d4ed8 100%); 
            transform: translateY(-1px);
            box-shadow: 0 4px 16px rgba(59,130,246,0.35);
        }
        .btn-danger { 
            background: linear-gradient(135deg, var(--danger) 0%, #dc2626 100%); 
            color: #fff;
            box-shadow: 0 2px 8px rgba(239,68,68,0.25);
        }
        .btn-danger:hover { 
            background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%); 
            transform: translateY(-1px);
            box-shadow: 0 4px 16px rgba(239,68,68,0.35);
        }
        .btn-success { 
            background: linear-gradient(135deg, var(--success) 0%, #059669 100%); 
            color: #fff;
            box-shadow: 0 2px 8px rgba(16,185,129,0.25);
        }
        .btn-success:hover { 
            background: linear-gradient(135deg, #059669 0%, #047857 100%); 
            transform: translateY(-1px);
            box-shadow: 0 4px 16px rgba(16,185,129,0.35);
        }
        .btn-secondary { 
            background: var(--bg-secondary); 
            color: var(--text-secondary);
            border: 1px solid var(--border);
        }
        .btn-secondary:hover { 
            background: var(--border-light); 
            border-color: var(--text-light);
        }
        .btn-warning { 
            background: linear-gradient(135deg, var(--warning) 0%, #d97706 100%); 
            color: #fff;
            box-shadow: 0 2px 8px rgba(245,158,11,0.25);
        }
        .btn-warning:hover { 
            background: linear-gradient(135deg, #d97706 0%, #b45309 100%); 
            transform: translateY(-1px);
        }
        .btn-ghost { 
            background: transparent; 
            color: var(--text-secondary); 
            border: 1px solid var(--border); 
        }
        .btn-ghost:hover { 
            background: var(--bg-secondary); 
            border-color: var(--text-light);
        }
        .btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

        /* ===== Table ===== */
        .table { 
            width: 100%; 
            border-collapse: separate;
            border-spacing: 0;
            font-size: 13px; 
        }
        .table th { 
            text-align: left; 
            padding: 12px 16px; 
            border-bottom: 2px solid var(--border); 
            color: var(--text-light); 
            font-weight: 600; 
            font-size: 11px;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }
        .table td { 
            padding: 12px 16px; 
            border-bottom: 1px solid var(--border-light); 
        }
        .table tr { transition: background 0.15s; }
        .table tr:hover { background: var(--bg-secondary); }

        /* ===== 对话记录页 Tab ===== */
        .conv-tabs { display: flex; gap: 8px; margin-bottom: 16px; }
        .conv-tab { 
            padding: 10px 20px; 
            border: 1px solid var(--border); 
            background: var(--bg-card); 
            border-radius: var(--radius-sm); 
            cursor: pointer; 
            font-size: 13px; 
            color: var(--text-muted); 
            transition: all 0.2s ease;
            font-weight: 500;
        }
        .conv-tab:hover { 
            border-color: var(--primary); 
            color: var(--primary); 
            box-shadow: var(--shadow-sm);
        }
        .conv-tab.active { 
            background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%); 
            border-color: transparent; 
            color: #fff; 
            font-weight: 600;
            box-shadow: 0 2px 8px rgba(59,130,246,0.25);
        }
        .conv-filter { 
            width: 100%; 
            padding: 10px 12px; 
            border: 1px solid var(--border); 
            border-radius: var(--radius-sm); 
            font-size: 13px; 
            color: var(--text); 
            background: var(--bg-card); 
            outline: none;
            transition: border-color 0.2s, box-shadow 0.2s;
        }
        .conv-filter:focus { 
            border-color: var(--primary); 
            box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
        }
        .conv-filter option { color: var(--text); }

        /* ===== Chat Layout ===== */
        .chat-layout { display: flex; gap: 20px; height: calc(100vh - 112px); min-height: 420px; }

        /* 左侧员工列表 */
        .chat-sidebar {
            width: 280px; 
            flex-shrink: 0;
            background: var(--bg-card);
            border-radius: var(--radius); 
            overflow: hidden;
            box-shadow: var(--shadow);
            display: flex; 
            flex-direction: column;
            border: 1px solid var(--border-light);
        }
        .chat-sidebar-header {
            padding: 16px 18px;
            background: linear-gradient(135deg, var(--sidebar-bg) 0%, #252b3d 100%);
            color: #fff; 
            font-size: 14px; 
            font-weight: 600;
            display: flex; 
            align-items: center; 
            gap: 10px;
            flex-shrink: 0;
        }
        .chat-sidebar-list { flex: 1; overflow-y: auto; }

        .chat-agent {
            display: flex; 
            align-items: center; 
            gap: 12px;
            padding: 14px 16px; 
            cursor: pointer;
            border-bottom: 1px solid var(--border-light);
            transition: all 0.2s ease;
        }
        .chat-agent:hover { background: var(--bg-secondary); }
        .chat-agent.active { 
            background: rgba(59,130,246,0.06); 
            border-left: 3px solid var(--primary); 
        }
        .chat-agent .ca-avatar {
            width: 42px; 
            height: 42px; 
            border-radius: 50%; 
            flex-shrink: 0;
            display: flex; 
            align-items: center; 
            justify-content: center;
            font-size: 18px; 
            color: #fff;
            background: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);
            box-shadow: 0 2px 8px rgba(139,92,246,0.25);
        }
        .chat-agent.active .ca-avatar { 
            background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%); 
            box-shadow: 0 2px 8px rgba(59,130,246,0.3);
        }
        .chat-agent .ca-body { flex: 1; min-width: 0; }
        .chat-agent .ca-name {
            font-size: 14px; 
            font-weight: 600; 
            color: var(--text);
            white-space: nowrap; 
            overflow: hidden; 
            text-overflow: ellipsis;
        }
        .chat-agent .ca-status {
            font-size: 12px; 
            color: var(--text-light);
            display: flex; 
            align-items: center; 
            gap: 5px; 
            margin-top: 3px;
        }
        .chat-agent .ca-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
        .chat-agent .ca-dot.online { background: var(--success); box-shadow: 0 0 6px rgba(16,185,129,0.5); }
        .chat-agent .ca-dot.offline { background: var(--text-light); }

        /* 右侧对话区 */
        .chat-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
        .chat-panel {
            display: flex; 
            flex-direction: column; 
            height: 100%;
            background: var(--bg-card); 
            border-radius: var(--radius);
            box-shadow: var(--shadow); 
            overflow: hidden;
            border: 1px solid var(--border-light);
        }
        .chat-panel-header {
            padding: 14px 20px; 
            border-bottom: 1px solid var(--border);
            display: flex; 
            align-items: center; 
            gap: 14px; 
            flex-shrink: 0;
            background: var(--bg-secondary);
        }
        .chat-panel-header .ch-avatar {
            width: 44px; 
            height: 44px; 
            border-radius: 50%;
            display: flex; 
            align-items: center; 
            justify-content: center;
            font-size: 20px; 
            color: #fff;
            background: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);
            box-shadow: 0 2px 8px rgba(139,92,246,0.25);
        }
        .chat-panel-header .ch-info { flex: 1; }
        .chat-panel-header .ch-name { 
            font-size: 15px; 
            font-weight: 700;
            color: var(--text);
        }
        .chat-panel-header .ch-meta { 
            font-size: 12px; 
            color: var(--text-light); 
            margin-top: 2px; 
        }

        /* 消息区 */
        .chat-messages {
            flex: 1; 
            overflow-y: auto; 
            padding: 24px;
            display: flex; 
            flex-direction: column; 
            gap: 16px;
            background: var(--bg-secondary);
        }
        .chat-msg { 
            display: flex; 
            gap: 12px; 
            max-width: 80%; 
            animation: fadeInUp 0.35s ease; 
            align-items: flex-start; 
        }
        .chat-msg.user { align-self: flex-end; flex-direction: row-reverse; }
        .chat-msg.assistant { align-self: flex-start; }
        .chat-msg.system { align-self: center; max-width: 90%; }

        .chat-msg .msg-avatar {
            width: 36px; 
            height: 36px; 
            border-radius: 50%; 
            flex-shrink: 0;
            display: flex; 
            align-items: center; 
            justify-content: center;
            font-size: 14px; 
            color: #fff;
            box-shadow: 0 2px 6px rgba(0,0,0,0.1);
        }
        .chat-msg.user .msg-avatar { 
            background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%); 
        }
        .chat-msg.assistant .msg-avatar { 
            background: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%); 
        }

        .chat-msg .msg-content { min-width: 0; }
        .chat-msg.user .msg-content { display: flex; flex-direction: column; align-items: flex-end; }
        .chat-msg.assistant .msg-content { display: flex; flex-direction: column; align-items: flex-start; }

        .chat-bubble {
            padding: 12px 18px; 
            border-radius: 16px;
            font-size: 14px; 
            line-height: 1.6; 
            word-break: break-word;
            box-shadow: var(--shadow-sm);
        }
        .chat-msg.user .chat-bubble {
            background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
            color: #fff; 
            border-bottom-right-radius: 4px;
            box-shadow: 0 2px 8px rgba(59,130,246,0.25);
        }
        .chat-msg.assistant .chat-bubble {
            background: var(--bg-card); 
            color: var(--text); 
            border-bottom-left-radius: 4px;
            border: 1px solid var(--border);
        }
        .chat-msg.system .chat-bubble {
            background: #fef3c7; 
            color: #92400e; 
            font-size: 12px;
            border: 1px dashed #fbbf24;
            border-radius: 12px;
        }
        .chat-time { 
            font-size: 11px; 
            color: var(--text-light); 
            margin-top: 5px;
            font-weight: 500;
        }

        /* 欢迎页 */
        .chat-welcome { 
            text-align: center; 
            padding: 60px 24px; 
        }
        .chat-welcome-icon { 
            font-size: 64px; 
            margin-bottom: 16px;
            filter: drop-shadow(0 4px 12px rgba(0,0,0,0.1));
        }
        .chat-welcome-title { 
            font-size: 20px; 
            font-weight: 700; 
            color: var(--text); 
            margin-bottom: 8px; 
        }
        .chat-welcome-desc { 
            font-size: 14px; 
            color: var(--text-secondary); 
            line-height: 1.7; 
            margin-bottom: 24px; 
        }
        .chat-welcome-tips { 
            display: flex; 
            flex-direction: column; 
            gap: 8px; 
            max-width: 400px; 
            margin: 0 auto; 
        }
        .chat-welcome-tip {
            font-size: 13px; 
            color: var(--text-muted);
            background: var(--bg-card); 
            padding: 10px 16px;
            border-radius: var(--radius-sm); 
            text-align: left;
            border: 1px solid var(--border-light);
            box-shadow: var(--shadow-sm);
        }

        /* 快捷指令 */
        .chat-quick-actions {
            display: flex; 
            gap: 8px; 
            padding: 10px 18px;
            border-top: 1px solid var(--border); 
            flex-wrap: wrap; 
            flex-shrink: 0;
            background: var(--bg-card);
        }
        .chat-quick-btn {
            padding: 6px 14px; 
            background: var(--bg-secondary);
            border: 1px solid var(--border); 
            border-radius: 20px;
            font-size: 12px; 
            color: var(--text-secondary);
            cursor: pointer; 
            transition: all 0.2s ease; 
            white-space: nowrap;
            font-weight: 500;
        }
        .chat-quick-btn:hover { 
            background: var(--primary); 
            color: #fff; 
            border-color: var(--primary);
            box-shadow: 0 2px 8px rgba(59,130,246,0.25);
            transform: translateY(-1px);
        }

        /* 输入区 */
        .chat-input-bar {
            display: flex; 
            gap: 12px; 
            padding: 14px 18px;
            border-top: 1px solid var(--border); 
            flex-shrink: 0;
            align-items: flex-end;
            background: var(--bg-card);
        }
        .chat-input-bar textarea {
            flex: 1; 
            padding: 12px 18px; 
            border: 1px solid var(--border);
            border-radius: 24px; 
            font-size: 14px; 
            outline: none;
            resize: none; 
            min-height: 44px; 
            max-height: 120px;
            font-family: inherit; 
            line-height: 1.5; 
            background: var(--bg-secondary);
            color: var(--text); 
            transition: all 0.2s ease;
        }
        .chat-input-bar textarea:focus { 
            border-color: var(--primary); 
            background: var(--bg-card);
            box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
        }
        .chat-send-btn {
            padding: 12px 24px; 
            background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
            color: #fff; 
            border: none; 
            border-radius: 24px;
            font-size: 14px; 
            font-weight: 600; 
            cursor: pointer;
            transition: all 0.2s ease; 
            white-space: nowrap; 
            height: 44px;
            box-shadow: 0 2px 8px rgba(59,130,246,0.25);
        }
        .chat-send-btn:hover { 
            transform: translateY(-2px); 
            box-shadow: 0 4px 16px rgba(59,130,246,0.4);
        }

        @keyframes fadeInUp {
            from { opacity: 0; transform: translateY(10px); }
            to { opacity: 1; transform: translateY(0); }
        }

        /* ===== Confirm Items ===== */
        .confirm-item {
            border: 1px solid var(--border);
            border-radius: var(--radius);
            padding: 20px;
            margin-bottom: 14px;
            background: var(--bg-card);
            transition: all 0.2s;
            box-shadow: var(--shadow-sm);
        }
        .confirm-item:hover {
            box-shadow: var(--shadow-md);
        }
        .confirm-item.urgent { 
            border-color: var(--danger); 
            background: rgba(239,68,68,0.03);
            box-shadow: 0 0 0 1px rgba(239,68,68,0.1), var(--shadow-sm);
        }
        .confirm-header { 
            display: flex; 
            justify-content: space-between; 
            align-items: center; 
            margin-bottom: 10px; 
        }
        .confirm-title { 
            font-weight: 700; 
            font-size: 14px;
            color: var(--text);
        }
        .confirm-time { 
            color: var(--text-light); 
            font-size: 12px;
            font-weight: 500;
        }
        .confirm-actions { display: flex; gap: 10px; margin-top: 14px; }

        /* ===== Report Items ===== */
        .report-item {
            border-left: 3px solid var(--primary);
            background: var(--bg-card);
            border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
            padding: 14px 18px;
            margin-bottom: 10px;
            cursor: pointer;
            transition: all 0.25s ease;
            box-shadow: var(--shadow-sm);
        }
        .report-item:hover { 
            box-shadow: var(--shadow-md); 
            transform: translateX(3px);
        }
        .report-item.unread { 
            background: rgba(59,130,246,0.04);
            border-left-width: 4px;
        }
        .report-item.high { border-left-color: var(--danger); }
        .report-item.normal { border-left-color: var(--warning); }
        .report-item.low { border-left-color: var(--success); }
        .report-header { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
        .report-agent { 
            font-weight: 700; 
            font-size: 13px;
            color: var(--text);
        }
        .report-title { 
            font-size: 13px; 
            color: var(--text);
            font-weight: 500;
        }
        .report-content { 
            font-size: 12px; 
            color: var(--text-secondary); 
            margin-top: 6px; 
            line-height: 1.6; 
        }
        .report-time { 
            font-size: 11px; 
            color: var(--text-light); 
            margin-top: 6px;
            font-weight: 500;
        }

        /* ===== Relay Flow ===== */
        .flow-record {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 10px 14px;
            border-bottom: 1px solid var(--border-light);
            font-size: 12px;
            transition: background 0.15s;
        }
        .flow-record:hover { background: var(--bg-secondary); }
        .flow-type { 
            font-weight: 700; 
            min-width: 100px;
            color: var(--text);
        }
        .flow-arrow { color: var(--text-light); }
        .flow-delivered { color: var(--success); font-weight: 600; }
        .flow-pending { color: var(--warning); font-weight: 600; }

        /* ===== Alerts ===== */
        .alert-item {
            display: flex;
            align-items: flex-start;
            gap: 14px;
            padding: 14px;
            border-radius: var(--radius-sm);
            margin-bottom: 10px;
            background: var(--bg-secondary);
            border: 1px solid var(--border-light);
            transition: all 0.2s;
        }
        .alert-item:hover {
            box-shadow: var(--shadow-sm);
        }
        .alert-item.resolved { opacity: 0.6; }
        .alert-icon { font-size: 22px; flex-shrink: 0; }
        .alert-content { flex: 1; }
        .alert-message { 
            font-size: 13px; 
            font-weight: 700;
            color: var(--text);
        }
        .alert-meta { 
            font-size: 11px; 
            color: var(--text-light); 
            margin-top: 5px;
            font-weight: 500;
        }

        /* ===== Toast ===== */
        .toast {
            white-space: pre-line;
            position: fixed;
            top: 80px;
            right: 24px;
            background: var(--text);
            color: #fff;
            padding: 14px 22px;
            border-radius: var(--radius-sm);
            font-size: 13px;
            z-index: 9999;
            animation: slideIn 0.35s cubic-bezier(0.4, 0, 0.2, 1);
            box-shadow: var(--shadow-xl);
            font-weight: 500;
        }
        .toast.success { 
            background: var(--success); 
            box-shadow: 0 10px 40px rgba(16,185,129,0.3);
        }
        .toast.error { 
            background: var(--danger); 
            box-shadow: 0 10px 40px rgba(239,68,68,0.3);
        }
        .toast.warning { 
            background: var(--warning); 
            box-shadow: 0 10px 40px rgba(245,158,11,0.3);
        }
        @keyframes slideIn { 
            from { transform: translateX(100%) scale(0.9); opacity: 0; } 
            to { transform: translateX(0) scale(1); opacity: 1; } 
        }

        /* ===== Loading ===== */
        .loading { text-align: center; padding: 48px; color: var(--text-light); }
        .spinner {
            width: 40px; 
            height: 40px;
            border: 3px solid var(--border);
            border-top-color: var(--primary);
            border-radius: 50%;
            animation: spin 0.8s linear infinite;
            margin: 0 auto 14px;
        }
        @keyframes spin { to { transform: rotate(360deg); } }

        .hidden { display: none !important; }
        .empty-state { 
            text-align: center; 
            padding: 48px; 
            color: var(--text-light); 
            font-size: 14px;
            font-weight: 500;
        }

        /* ===== Tabs ===== */
        .sub-tabs { 
            display: flex; 
            gap: 4px; 
            margin-bottom: 18px; 
            border-bottom: 1px solid var(--border); 
        }
        .sub-tab {
            padding: 10px 18px;
            cursor: pointer;
            font-size: 13px;
            color: var(--text-muted);
            border-bottom: 2px solid transparent;
            transition: all 0.2s ease;
            font-weight: 500;
        }
        .sub-tab:hover { color: var(--primary); }
        .sub-tab.active { 
            color: var(--primary); 
            border-bottom-color: var(--primary); 
            font-weight: 700;
        }

        /* ===== Butler Page ===== */
        .butler-layout { display: flex; gap: 20px; height: calc(100vh - 112px); min-height: 500px; }
        .butler-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
        .butler-status-bar {
            background: var(--bg-card); 
            border-radius: var(--radius); 
            padding: 14px 20px;
            box-shadow: var(--shadow); 
            display: flex; 
            align-items: center; 
            gap: 16px; 
            flex-shrink: 0;
            border: 1px solid var(--border-light);
        }
        .butler-status-bar .bs-avatar {
            width: 48px; 
            height: 48px; 
            border-radius: 50%; 
            flex-shrink: 0;
            display: flex; 
            align-items: center; 
            justify-content: center;
            font-size: 20px; 
            color: #fff;
            background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
            box-shadow: 0 4px 12px rgba(59,130,246,0.25);
        }
        .butler-status-bar .bs-info { flex: 1; }
        .butler-status-bar .bs-name { 
            font-size: 16px; 
            font-weight: 700;
            color: var(--text);
        }
        .butler-status-bar .bs-meta { 
            font-size: 12px; 
            color: var(--text-light); 
            margin-top: 3px; 
            display: flex; 
            align-items: center; 
            gap: 10px; 
        }
        .butler-status-bar .bs-metrics { display: flex; gap: 24px; }
        .butler-status-bar .bs-metric { text-align: center; }
        .butler-status-bar .bs-metric-value { 
            font-size: 22px; 
            font-weight: 800; 
            color: var(--text);
        }
        .butler-status-bar .bs-metric-label { 
            font-size: 11px; 
            color: var(--text-light); 
            margin-top: 3px;
            font-weight: 500;
        }
        .butler-action-bar { display: flex; gap: 8px; flex-shrink: 0; flex-wrap: wrap; }
        .butler-tabs { 
            display: flex; 
            gap: 4px; 
            flex-shrink: 0; 
            border-bottom: 1px solid var(--border); 
            background: var(--bg-card);
            padding: 0 4px;
            border-radius: var(--radius-sm) var(--radius-sm) 0 0;
        }
        .butler-tab {
            padding: 10px 18px; 
            cursor: pointer; 
            font-size: 13px; 
            color: var(--text-muted);
            border-bottom: 2px solid transparent; 
            transition: all 0.2s ease; 
            white-space: nowrap;
            font-weight: 500;
        }
        .butler-tab:hover { color: var(--primary); }
        .butler-tab.active { 
            color: var(--primary); 
            border-bottom-color: var(--primary); 
            font-weight: 700;
        }
        .butler-tab-body { flex: 1; min-height: 0; overflow-y: auto; }
        .butler-action-btn {
            padding: 10px 16px; 
            border: 1px solid var(--border); 
            background: var(--bg-card);
            border-radius: var(--radius-sm); 
            cursor: pointer; 
            font-size: 13px; 
            color: var(--text);
            transition: all 0.2s ease; 
            display: flex; 
            align-items: center; 
            gap: 6px; 
            white-space: nowrap;
            font-weight: 500;
        }
        .butler-action-btn:hover { 
            border-color: var(--primary); 
            color: var(--primary); 
            transform: translateY(-1px);
            box-shadow: var(--shadow-sm);
        }
        .butler-action-btn.active { 
            background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%); 
            color: #fff; 
            border-color: transparent; 
            box-shadow: 0 2px 8px rgba(59,130,246,0.25);
        }
        .butler-content {
            flex: 1; 
            min-height: 0; 
            display: flex; 
            flex-direction: column;
            background: var(--bg-card); 
            border-radius: var(--radius);
            box-shadow: var(--shadow); 
            overflow: hidden;
            border: 1px solid var(--border-light);
        }
        .butler-panel-header {
            padding: 12px 18px; 
            border-bottom: 1px solid var(--border); 
            display: flex; 
            align-items: center; 
            gap: 10px; 
            flex-shrink: 0;
            background: var(--bg-secondary);
        }
        .butler-panel-title { 
            font-size: 14px; 
            font-weight: 700; 
            flex: 1;
            color: var(--text);
        }
        .butler-panel-body { flex: 1; overflow-y: auto; padding: 18px; }
        .butler-panel-body .bp-empty { 
            text-align: center; 
            padding: 40px; 
            color: var(--text-light);
            font-weight: 500;
        }
        .kb-file-item {
            display: flex; 
            align-items: center; 
            gap: 12px; 
            padding: 12px 14px;
            border-radius: var(--radius-sm); 
            cursor: pointer; 
            transition: all 0.15s; 
            margin-bottom: 4px;
            border: 1px solid transparent;
        }
        .kb-file-item:hover { 
            background: var(--bg-secondary); 
            border-color: var(--border);
        }
        .kb-file-item.active { 
            background: rgba(59,130,246,0.06); 
            border-color: var(--primary);
        }
        .kb-file-icon { font-size: 20px; }
        .kb-file-name { 
            font-size: 13px; 
            font-weight: 600;
            color: var(--text);
        }
        .kb-file-meta { 
            font-size: 11px; 
            color: var(--text-light);
            font-weight: 500;
        }
        .kb-content-viewer {
            background: var(--bg-secondary); 
            border-radius: var(--radius-sm); 
            padding: 16px;
            font-size: 13px; 
            line-height: 1.7; 
            white-space: pre-wrap; 
            word-break: break-word;
            max-height: 300px; 
            overflow-y: auto; 
            margin-top: 12px;
            border: 1px solid var(--border-light);
        }
        .skill-item, .tool-item {
            display: flex; 
            align-items: center; 
            gap: 12px; 
            padding: 12px 14px;
            border-radius: var(--radius-sm); 
            margin-bottom: 6px; 
            border: 1px solid var(--border);
            background: var(--bg-card);
            transition: all 0.2s;
        }
        .skill-item:hover, .tool-item:hover { 
            border-color: var(--primary); 
            box-shadow: var(--shadow-sm);
            transform: translateX(2px);
        }
        .skill-icon, .tool-icon { font-size: 20px; }
        .skill-name, .tool-name { 
            font-size: 13px; 
            font-weight: 600;
            color: var(--text);
        }
        .skill-desc, .tool-desc { 
            font-size: 12px; 
            color: var(--text-light);
            font-weight: 500;
        }
        .task-form { display: flex; flex-direction: column; gap: 14px; }
        .task-form textarea { 
            min-height: 80px; 
            padding: 12px; 
            border-radius: var(--radius-sm); 
            border: 1px solid var(--border); 
            font-size: 14px; 
            resize: vertical; 
            outline: none;
            transition: border-color 0.2s, box-shadow 0.2s;
        }
        .task-form textarea:focus {
            border-color: var(--primary);
            box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
        }
        .butler-chat-area { flex: 1; min-height: 0; display: flex; flex-direction: column; }

        /* ===== Takeover (对话接管) ===== */
        .takeover-bar {
            background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
            border-bottom: 1px solid #f59e0b;
            padding: 8px 12px;
            display: flex;
            align-items: center;
            gap: 8px;
            flex-wrap: wrap;
        }
        .takeover-badge {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            padding: 4px 12px;
            border-radius: 20px;
            font-size: 13px;
            font-weight: 600;
        }
        .takeover-badge.active {
            background: #fee2e2;
            color: #dc2626;
            border: 1px solid #fca5a5;
        }
        .takeover-badge.requested {
            background: #fef3c7;
            color: #d97706;
            border: 1px solid #fcd34d;
        }
        .chat-bubble.takeover-bubble {
            background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
            border: 1px solid #93c5fd;
            color: #1e40af;
        }
        .chat-msg.supervisor {
            flex-direction: row;
        }
        .chat-msg.supervisor .chat-bubble {
            background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
            border: 1px solid #93c5fd;
            color: #1e40af;
        }
        .chat-send-btn.takeover {
            background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
            box-shadow: 0 4px 12px rgba(220,38,38,0.3);
        }
        .chat-send-btn.takeover:hover {
            background: linear-gradient(135deg, #b91c1c 0%, #991b1b 100%);
            transform: translateY(-1px);
        }

        /* ===== Responsive ===== */
        @media (max-width: 768px) {
            .top-nav { height: 48px; padding: 0 8px; }
            .top-nav-title { display: none; }
            .top-nav-item span:not(.nav-badge) { display: none; }
            .top-nav-item { padding: 6px 8px; }
            .top-nav-item.active::after { display: none; }
            .main-wrapper { margin-left: 0; margin-top: 48px; }
            .stats-grid { grid-template-columns: repeat(2, 1fr); }
            .main { padding: 16px; }
            .chat-layout { flex-direction: column; height: auto; }
            .chat-sidebar { width: 100%; height: 200px; }
            .butler-layout { flex-direction: column; height: auto; }
        }
