/* Real AI Dashboard Styles */

/* Status Indicators */
.status-dot.demo {
    background: #8b5cf6; /* Purple for demo mode */
    box-shadow: 0 0 10px #8b5cf6;
}

.status-indicator.demo {
    color: #8b5cf6;
}

/* Demo Mode Notification */
.demo-mode-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #3b82f6;
    color: white;
    padding: 15px;
    border-radius: 8px;
    z-index: 10000;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    max-width: 300px;
}

/* Metrics Dashboard */
.metrics-dashboard {
    padding: 20px;
    max-width: 1400px;
    margin: 0 auto;
}

.dashboard-section {
    margin-bottom: 40px;
    background: rgba(0, 20, 40, 0.6);
    border-radius: 12px;
    padding: 25px;
    border: 1px solid rgba(14, 165, 233, 0.3);
}

.dashboard-section h2 {
    color: #0ea5e9;
    margin-bottom: 20px;
    font-size: 1.5em;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Status Cards */
.status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.status-card {
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.1), rgba(16, 185, 129, 0.1));
    border: 1px solid rgba(14, 165, 233, 0.4);
    border-radius: 10px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all 0.3s ease;
}

.status-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(14, 165, 233, 0.2);
}

.status-icon {
    font-size: 2.5em;
    opacity: 0.8;
}

.status-info h3 {
    font-size: 2em;
    margin: 0;
    color: #ffffff;
    font-weight: bold;
}

.status-info p {
    margin: 5px 0 0 0;
    color: #94a3b8;
    font-size: 0.9em;
}

.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    font-size: 12px;
    margin-left: auto;
}

.status-indicator.online {
    color: #10b981;
}

.status-indicator.offline {
    color: #ef4444;
}

.status-indicator.warning {
    color: #f59e0b;
}

.status-indicator.success {
    color: #10b981;
}

/* Agent Metrics Grid */
.agent-metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.agent-metric-card {
    background: rgba(16, 185, 129, 0.05);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 8px;
    padding: 20px;
    transition: all 0.3s ease;
}

.agent-metric-card:hover {
    background: rgba(16, 185, 129, 0.1);
}

.agent-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.agent-name {
    font-size: 1.1em;
    font-weight: bold;
    color: #10b981;
}

.agent-type {
    background: rgba(14, 165, 233, 0.2);
    color: #0ea5e9;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8em;
}

.agent-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.metric-item {
    text-align: center;
}

.metric-item .label {
    color: #94a3b8;
    font-size: 0.8em;
    margin-bottom: 5px;
}

.metric-item .value {
    color: #ffffff;
    font-size: 1.2em;
    font-weight: bold;
}

.agent-thinking {
    margin-top: 15px;
    padding: 10px;
    background: rgba(168, 85, 247, 0.1);
    border-radius: 6px;
    border-left: 3px solid #a855f7;
    font-style: italic;
    color: #a855f7;
    font-size: 0.9em;
}

/* Performance Grid */
.performance-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.metric-card {
    background: rgba(14, 165, 233, 0.05);
    border: 1px solid rgba(14, 165, 233, 0.3);
    border-radius: 8px;
    padding: 20px;
    text-align: center;
}

.metric-card h4 {
    color: #0ea5e9;
    margin-bottom: 15px;
    font-size: 1em;
}

.metric-display {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.metric-value {
    font-size: 2em;
    font-weight: bold;
    color: #10b981;
    margin-bottom: 10px;
}

.metric-chart {
    width: 100%;
    height: 60px;
    background: rgba(14, 165, 233, 0.1);
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}

/* Resource Meters */
.resource-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.resource-meter {
    text-align: center;
}

.resource-meter h4 {
    color: #0ea5e9;
    margin-bottom: 15px;
}

.meter {
    background: rgba(14, 165, 233, 0.1);
    border-radius: 20px;
    height: 40px;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(14, 165, 233, 0.3);
}

.meter-bar {
    height: 100%;
    background: linear-gradient(90deg, #10b981, #0ea5e9);
    border-radius: 20px;
    transition: width 0.5s ease;
    width: 0%;
}

.meter-value {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #ffffff;
    font-weight: bold;
    font-size: 0.9em;
    z-index: 2;
}

.meter-value.uptime {
    position: static;
    transform: none;
    font-size: 1.5em;
    color: #10b981;
    margin-top: 10px;
}

/* Activity Feed */
.activity-feed {
    max-height: 400px;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 60px;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(14, 165, 233, 0.1);
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-icon {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.activity-icon.success {
    background: #10b981;
}

.activity-icon.info {
    background: #0ea5e9;
}

.activity-icon.warning {
    background: #f59e0b;
}

.activity-icon.error {
    background: #ef4444;
}

.activity-content {
    flex: 1;
}

.activity-message {
    color: #ffffff;
    font-size: 0.9em;
    margin-bottom: 2px;
}

.activity-time {
    color: #94a3b8;
    font-size: 0.8em;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .status-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .performance-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .metrics-dashboard {
        padding: 15px;
    }
    
    .dashboard-section {
        padding: 20px;
    }
    
    .dashboard-section h2 {
        font-size: 1.3em;
    }
    
    .status-info h3 {
        font-size: 1.8em;
    }
    
    /* Adjust panel positions for medium screens */
    .ai-control-panel {
        right: 10px;
        width: 320px;
    }
    
    .collaboration-panel {
        left: 10px;
        width: 320px;
    }
}

@media (max-width: 768px) {
    .status-grid {
        grid-template-columns: 1fr;
    }
    
    .performance-grid,
    .resource-grid,
    .agent-metrics-grid {
        grid-template-columns: 1fr;
    }
    
    .dashboard-section {
        padding: 15px;
        margin-bottom: 25px;
    }
    
    .dashboard-section h2 {
        font-size: 1.2em;
        margin-bottom: 15px;
    }
    
    .status-card {
        padding: 15px;
        gap: 10px;
    }
    
    .status-icon {
        font-size: 2em;
    }
    
    .status-info h3 {
        font-size: 1.5em;
    }
    
    .status-info p {
        font-size: 0.8em;
    }
    
    .agent-metric-card {
        padding: 15px;
    }
    
    .agent-header {
        margin-bottom: 10px;
    }
    
    .agent-name {
        font-size: 1em;
    }
    
    .agent-type {
        font-size: 0.7em;
        padding: 3px 6px;
    }
    
    .agent-metrics {
        gap: 10px;
    }
    
    .metric-item .label {
        font-size: 0.7em;
    }
    
    .metric-item .value {
        font-size: 1em;
    }
    
    .metric-card {
        padding: 15px;
    }
    
    .metric-card h4 {
        font-size: 0.9em;
        margin-bottom: 10px;
    }
    
    .metric-value {
        font-size: 1.5em;
        margin-bottom: 8px;
    }
    
    .resource-meter h4 {
        font-size: 0.9em;
        margin-bottom: 10px;
    }
    
    .meter {
        height: 35px;
    }
    
    .meter-value {
        font-size: 0.8em;
    }
    
    .meter-value.uptime {
        font-size: 1.2em;
        margin-top: 8px;
    }
    
    .activity-feed {
        max-height: 300px;
        padding: 10px;
    }
    
    .activity-item {
        gap: 8px;
        padding: 8px 0;
    }
    
    .activity-message {
        font-size: 0.8em;
    }
    
    .activity-time {
        font-size: 0.7em;
    }
    
    .metrics-dashboard {
        padding: 10px;
    }
}

@media (max-width: 480px) {
    .dashboard-section {
        padding: 12px;
        margin-bottom: 20px;
    }
    
    .dashboard-section h2 {
        font-size: 1.1em;
        margin-bottom: 12px;
    }
    
    .status-card {
        padding: 12px;
        gap: 8px;
        flex-direction: column;
        align-items: flex-start;
    }
    
    .status-icon {
        font-size: 1.8em;
    }
    
    .status-info {
        width: 100%;
    }
    
    .status-info h3 {
        font-size: 1.3em;
    }
    
    .status-info p {
        font-size: 0.75em;
    }
    
    .status-indicator {
        margin-left: 0;
        align-self: flex-end;
    }
    
    .agent-metric-card {
        padding: 12px;
    }
    
    .agent-header {
        margin-bottom: 8px;
    }
    
    .agent-name {
        font-size: 0.9em;
    }
    
    .agent-type {
        font-size: 0.6em;
        padding: 2px 5px;
    }
    
    .agent-metrics {
        gap: 8px;
    }
    
    .metric-item .label {
        font-size: 0.65em;
    }
    
    .metric-item .value {
        font-size: 0.9em;
    }
    
    .metric-card {
        padding: 12px;
    }
    
    .metric-card h4 {
        font-size: 0.8em;
        margin-bottom: 8px;
    }
    
    .metric-value {
        font-size: 1.3em;
        margin-bottom: 6px;
    }
    
    .resource-meter h4 {
        font-size: 0.8em;
        margin-bottom: 8px;
    }
    
    .meter {
        height: 30px;
    }
    
    .meter-value {
        font-size: 0.7em;
    }
    
    .meter-value.uptime {
        font-size: 1em;
        margin-top: 6px;
    }
    
    .activity-feed {
        max-height: 250px;
        padding: 8px;
    }
    
    .activity-item {
        gap: 6px;
        padding: 6px 0;
    }
    
    .activity-message {
        font-size: 0.75em;
    }
    
    .activity-time {
        font-size: 0.65em;
    }
    
    .metrics-dashboard {
        padding: 8px;
    }
}

/* Animation Effects */
@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.pulse {
    animation: pulse 2s infinite;
}

@keyframes slideIn {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.slide-in {
    animation: slideIn 0.5s ease;
}

.ai-control-panel,
.collaboration-panel,
.task-panel {
    background: rgba(0, 20, 40, 0.5);
    border: 1px solid #0ea5e9;
    border-radius: 12px;
    padding: 20px;
    color: #ffffff;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    z-index: 5000;
    margin-bottom: 20px;
    width: 100%;
    max-width: 100%;
    transition: all 0.3s ease;
}

/* Desktop positioning */
@media (min-width: 769px) {
    .ai-control-panel {
        position: fixed;
        top: 80px;
        right: 20px;
        width: 315px; /* Reduced by 10% from 350px */
        max-height: 72vh; /* Reduced by 10% from 80vh */
        overflow-y: auto;
        z-index: 5000;
    }
    
    .collaboration-panel {
        position: fixed;
        top: 80px;
        left: 20px;
        width: 315px; /* Reduced by 10% from 350px */
        max-height: 72vh; /* Reduced by 10% from 80vh */
        overflow-y: auto;
        z-index: 5000;
    }
    
    .task-panel {
        position: fixed;
        bottom: 20px;
        left: 20px;
        right: 20px;
        height: 300px;
        overflow-y: auto;
        z-index: 4000;
    }
}

/* Mobile layout specific styles */
.ai-control-panel.mobile-layout,
.collaboration-panel.mobile-layout,
.task-panel.mobile-layout {
    transition: all 0.3s ease;
}

/* Ensure panels don't overlap on mobile */
@media (max-width: 768px) {
    .ai-control-panel,
    .collaboration-panel {
        position: static;
        width: calc(100% - 40px);
        max-height: 30vh;
        left: 20px;
        right: 20px;
        margin-bottom: 15px;
        box-sizing: border-box;
    }
    
    .task-panel {
        position: static;
        height: auto;
        max-height: none;
        width: calc(100% - 40px);
        margin: 20px auto;
        box-sizing: border-box;
    }
    
    .ai-control-panel.mobile-layout {
        top: calc(70px + 40vh + 10px) !important;
    }
    
    .task-panel.mobile-layout {
        z-index: 4000 !important;
    }
}

.ai-control-panel {
    top: 80px;
    right: 20px;
    width: 315px; /* Reduced by 10% from 350px */
    max-height: 72vh; /* Reduced by 10% from 80vh */
    overflow-y: auto;
    position: fixed;
    z-index: 5000;
    transition: all 0.3s ease;
}

.ai-control-panel.collapsed {
    width: 60px;
    height: 60px;
    overflow: hidden;
}

.ai-control-panel.collapsed .panel-content {
    opacity: 0;
    pointer-events: none;
    transform: translateX(20px);
}

.ai-control-panel.collapsed .panel-header h3 {
    opacity: 0;
}

/* Panel toggle button positioning */
.panel-toggle {
    position: absolute;
    top: 20px;
    background: rgba(0, 20, 40, 0.5);
    border: 1px solid #0ea5e9;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #0ea5e9;
    font-size: 16px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.2);
    z-index: 5001;
    border-radius: 8px;
    user-select: none;
}

.task-panel .panel-toggle {
    top: 10px;
    right: 10px;
    left: auto;
    border-radius: 8px;
    transform: rotate(0deg);
    width: 36px;
    height: 36px;
    font-size: 14px;
    z-index: 6000;
}

.panel-toggle:hover {
    background: rgba(14, 165, 233, 0.3);
    transform: scale(1.1);
}

.panel-toggle:active {
    transform: scale(0.95);
}

.collaboration-panel .panel-toggle {
    left: -40px;
    border-radius: 8px 0 0 8px;
}

.ai-control-panel .panel-toggle {
    right: -40px;
    border-radius: 0 8px 8px 0;
}

/*  Optimization fold style */
.ai-control-panel.collapsed,
.collaboration-panel.collapsed {
    width: 60px;
    min-height: 60px;
    overflow: visible;
    background: rgba(0, 20, 40, 0.7);
    border: 1px solid #0ea5e9;
    border-radius: 12px;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-control-panel.collapsed .panel-content,
.collaboration-panel.collapsed .panel-content {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.8);
}

.ai-control-panel.collapsed .panel-header h3,
.collaboration-panel.collapsed .panel-header h3 {
    opacity: 0;
}

/* 确保折叠时切换按钮始终可见 */
.ai-control-panel.collapsed .panel-toggle {
    right: -50px;
    transform: rotate(180deg);
    background: rgba(0, 20, 40, 0.7);
    border: 1px solid #0ea5e9;
}

.collaboration-panel.collapsed .panel-toggle {
    left: -50px;
    transform: rotate(180deg);
    background: rgba(0, 20, 40, 0.7);
    border: 1px solid #0ea5e9;
}

.task-panel.horizontal-layout.collapsed .panel-toggle {
    transform: rotate(180deg);
    top: 10px;
    right: 10px;
    left: auto;
}

/* 移动端折叠样式优化 */
@media (max-width: 768px) {
    .ai-control-panel.collapsed,
    .collaboration-panel.collapsed {
        width: 50px;
        min-height: 50px;
        position: static;
        margin: 10px auto;
        background: rgba(0, 20, 40, 0.7);
        border: 1px solid #0ea5e9;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .ai-control-panel.collapsed .panel-toggle,
    .collaboration-panel.collapsed .panel-toggle {
        position: absolute;
        top: 10px;
        right: 10px;
        left: auto;
        transform: rotate(180deg);
        background: rgba(0, 20, 40, 0.7);
        border: 1px solid #0ea5e9;
        width: 36px;
        height: 36px;
        font-size: 14px;
    }
    
    /* 移动端展开时的样式 */
    .ai-control-panel:not(.collapsed),
    .collaboration-panel:not(.collapsed) {
        max-height: 40vh;
        overflow-y: auto;
        width: calc(100% - 40px);
        margin: 15px auto;
    }
    
    /* 确保在非常小的屏幕上也能正常显示 */
    @media (max-width: 480px) {
        .ai-control-panel.collapsed,
        .collaboration-panel.collapsed {
            width: 40px;
            min-height: 40px;
            margin: 8px auto;
        }
        
        .ai-control-panel.collapsed .panel-toggle,
        .collaboration-panel.collapsed .panel-toggle {
            width: 32px;
            height: 32px;
            font-size: 12px;
        }
        
        .ai-control-panel:not(.collapsed),
        .collaboration-panel:not(.collapsed) {
            max-height: 35vh;
            width: calc(100% - 20px);
            margin: 10px auto;
        }
    }
}

/* 折叠过渡效果优化 */
.panel-content {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.panel-header h3 {
    transition: opacity 0.3s ease;
}

.panel-toggle span {
    transition: all 0.3s ease;
}

/* 确保折叠状态下面板不会遮挡其他内容 */
.ai-control-panel.collapsed,
.collaboration-panel.collapsed {
    z-index: 5000;
}

/* Responsive behavior for smaller screens */
@media (max-width: 1200px) {
    .collaboration-panel {
        width: 315px; /* Reduced by 10% from 350px */
    }
    
    .collaboration-panel.collapsed {
        width: 50px;
    }
    
    .ai-control-panel {
        width: 270px; /* Reduced by 10% from 300px */
    }
    
    .ai-control-panel.collapsed {
        width: 50px;
    }
}

/* Additional responsive adjustments for medium screens */
@media (max-width: 992px) {
    .collaboration-panel {
        width: 270px; /* Reduced by 10% from 300px */
    }
    
    .ai-control-panel {
        width: 252px; /* Reduced by 10% from 280px */
    }
    
    .status-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .agent-metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .ai-control-panel,
    .collaboration-panel {
        width: calc(100% - 40px);
        max-height: 30vh;
        left: 20px;
        right: 20px;
        position: static;
        z-index: 5000;
        margin-bottom: 15px;
        transition: all 0.3s ease;
        box-sizing: border-box;
    }
    
    .collaboration-panel {
        top: 70px;
    }
    
    .ai-control-panel {
        top: calc(70px + 30vh + 15px);
    }
    
    /* 在非常小的屏幕上，默认折叠面板以节省空间 */
    @media (max-height: 600px), (max-width: 480px) {
        .ai-control-panel:not(.collapsed),
        .collaboration-panel:not(.collapsed) {
            max-height: 25vh;
        }
        
        .ai-control-panel {
            top: calc(70px + 25vh + 15px);
        }
        
        .task-panel {
            height: 30vh;
            max-height: 200px;
        }
    }
    
    .panel-toggle {
        position: absolute;
        top: 10px;
        right: 10px;
        left: auto;
        border-radius: 8px;
        transform: rotate(0deg);
        width: 36px;
        height: 36px;
        font-size: 14px;
        z-index: 5002;
    }
    
    .collaboration-panel .panel-toggle,
    .ai-control-panel .panel-toggle {
        right: 10px;
        left: auto;
    }
    
    .collaboration-panel.collapsed .panel-toggle,
    .ai-control-panel.collapsed .panel-toggle {
        transform: rotate(180deg);
    }
    
    .task-panel {
        position: static;
        bottom: 0;
        left: 0;
        right: 0;
        height: auto;
        max-height: none;
        width: calc(100% - 40px);
        border-radius: 12px;
        padding: 15px;
        overflow-y: auto;
        z-index: 4000;
        margin: 20px auto;
        margin-left: auto;
        margin-right: auto;
        box-sizing: border-box;
    }
    
    /* Improve touch targets on mobile */
    .panel-toggle {
        min-height: 44px;
        min-width: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Optimize AI panels for mobile */
    .ai-agents-section,
    .collaboration-section {
        max-height: 60vh;
        overflow-y: auto;
    }
    
    .agents-list,
    .collaborations-list {
        max-height: 30vh;
        overflow-y: auto;
    }
    
    .task-submission {
        max-height: 60vh;
        overflow-y: auto;
    }
    
    /* Mobile-specific collapsed states */
    .ai-control-panel.collapsed .panel-content,
    .collaboration-panel.collapsed .panel-content {
        opacity: 0;
        pointer-events: none;
        transform: scale(0.95);
    }
    
    .ai-control-panel .panel-content,
    .collaboration-panel .panel-content {
        transition: all 0.3s ease;
    }
}

@media (max-width: 480px) {
    .ai-control-panel,
    .collaboration-panel {
        width: calc(100% - 20px);
        left: 10px;
        right: 10px;
        padding: 15px;
        max-height: 35vh;
    }
    
    .ai-control-panel {
        right: 10px;
        left: auto;
        top: calc(70px + 35vh + 10px);
    }
    
    .panel-header h3 {
        font-size: 1em;
    }
    
    .task-panel {
        height: 50vh;
        max-height: 250px;
        padding: 12px;
    }
    
    .task-panel .panel-header h3 {
        font-size: 1em;
    }
    
    /* Further adjust form elements for small screens */
    .form-group {
        margin-bottom: 12px;
    }
    
    .form-group label {
        font-size: 0.9em;
        margin-bottom: 4px;
    }
    
    .form-group input,
    .form-group textarea,
    .form-group select {
        padding: 6px 10px;
        font-size: 0.9em;
    }
    
    .btn {
        padding: 8px 16px;
        font-size: 0.9em;
    }
    
    .btn-primary,
    .btn-success {
        padding: 8px 16px;
    }
    
    /* Adjust task result displays */
    .task-result {
        padding: 15px;
        margin-bottom: 15px;
    }
    
    .result-header h4 {
        font-size: 1.1em;
    }
    
    .timestamp {
        font-size: 0.8em;
    }
    
    .result-content h5 {
        font-size: 1em;
        margin-bottom: 8px;
    }
    
    .analysis-text {
        padding: 12px;
        font-size: 0.9em;
    }
    
    .metrics-grid {
        gap: 8px;
    }
    
    .metric {
        padding: 6px 10px;
    }
    
    .metric-label {
        font-size: 0.8em;
    }
    
    .metric-value {
        font-size: 0.9em;
    }
    
    /* Adjust agent metrics display */
    .agent-metric-card {
        padding: 12px;
    }
    
    .agent-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .agent-name {
        font-size: 0.9em;
    }
    
    .agent-type {
        font-size: 0.7em;
    }
    
    /* Adjust status cards */
    .status-card {
        padding: 12px;
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .status-icon {
        font-size: 1.5em;
    }
    
    .status-info h3 {
        font-size: 1.3em;
    }
    
    .status-info p {
        font-size: 0.8em;
    }
}

/* Animation improvements */
.collaboration-panel {
    will-change: transform;
}

.collaboration-panel .panel-toggle span {
    transition: transform 0.2s ease;
    display: inline-block;
}

.collaboration-panel:hover:not(.collapsed) {
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .nav-btn::before {
        display: none;
    }
    
    .nav-btn:hover {
        background: rgba(255, 255, 255, 0.1);
        transform: none;
        box-shadow: none;
    }
    
    .status-card:hover,
    .visualization-card:hover,
    .log-card:hover {
        transform: none;
    }
    
    .agent-metric-card:hover {
        background: rgba(16, 185, 129, 0.05);
    }
    
    .btn:hover {
        transform: none;
        box-shadow: none;
    }
    
    .btn-primary:hover {
        background: linear-gradient(135deg, #10b981, #059669);
    }
    
    .btn-success:hover {
        background: linear-gradient(135deg, #10b981, #16a34a);
    }
    
    .collaboration-panel:hover:not(.collapsed) {
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    }
    
    /* Increase touch targets for better mobile experience */
    .nav-btn {
        min-height: 44px;
        min-width: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .btn {
        min-height: 44px;
        min-width: 44px;
    }
    
    .control-btn {
        min-height: 40px;
        min-width: 40px;
    }
    
    .panel-toggle {
        min-height: 44px;
        min-width: 44px;
    }
}

/* Content fade effect */
.collaboration-panel.collapsed .form-group,
.collaboration-panel.collapsed .task-submission h4,
.collaboration-panel.collapsed .btn {
    opacity: 0;
    transform: translateX(-20px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.task-panel {
    position: fixed;
    bottom: 70px;
    left: 20px;
    right: 20px;
    height: 400px;
    overflow-y: auto;
}

/* 新增的水平布局样式 */
.task-panel.horizontal-layout {
    display: flex;
    flex-direction: row;
    height: 480px;
    min-height: 480px;
    position: fixed;
    bottom: 20px;
    left: 10px;
    right: 30px;
    top: auto;
    padding: 0;
    transform: translateY(50px);
    transition: all 0.3s ease;
}

/* 折叠状态样式 */
.task-panel.horizontal-layout.collapsed {
    height: 50px;
    min-height: 50px;
    overflow: hidden;
}

.task-panel.horizontal-layout.collapsed .panel-section {
    padding: 0;
    overflow: hidden;
}

.task-panel.horizontal-layout.collapsed .panel-header {
    margin-bottom: 0;
    padding: 15px 20px;
    border-bottom: none;
}

.task-panel.horizontal-layout.collapsed .panel-section > *:not(.panel-header) {
    display: none;
}

.task-panel.horizontal-layout .panel-section {
    flex: 1;
    padding: 20px;
    border-right: 1px solid rgba(14, 165, 233, 0.3);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.task-panel.horizontal-layout .panel-section:first-child {
    flex: 0.5;
}

.task-panel.horizontal-layout .panel-section:nth-child(3) {
    flex: 0.5;
}

.task-panel.horizontal-layout .panel-section:last-child {
    border-right: none;
    padding-right: 20px;
}

.task-panel.horizontal-layout .panel-header {
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(14, 165, 233, 0.3);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(14, 165, 233, 0.3);
}

.panel-header h3 {
    margin: 0;
    color: #0ea5e9;
    font-size: 1.2em;
}

.ai-status {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.status-dot.online {
    background: #10b981;
    box-shadow: 0 0 8px #10b981;
}

.status-dot.offline {
    background: #ef4444;
    box-shadow: 0 0 8px #ef4444;
}

.status-dot.warning {
    background: #f59e0b;
    box-shadow: 0 0 8px #f59e0b;
}

.status-dot.error {
    background: #dc2626;
    box-shadow: 0 0 8px #dc2626;
}

/* AI Agents List */
.agents-list {
    margin-bottom: 20px;
    max-height: 300px;
    overflow-y: auto;
}

.agent-card {
    background: rgba(14, 165, 233, 0.1);
    border: 1px solid rgba(14, 165, 233, 0.3);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 10px;
}

.agent-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.agent-header h5 {
    margin: 0;
    color: #ffffff;
    font-size: 1em;
}

.agent-type {
    background: rgba(14, 165, 233, 0.2);
    color: #0ea5e9;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8em;
}

.agent-status.idle {
    color: #10b981;
}

.agent-status.busy {
    color: #f59e0b;
}

.agent-status.offline {
    color: #ef4444;
}

.agent-details {
    font-size: 0.9em;
}

.agent-stats {
    display: flex;
    gap: 15px;
    margin-bottom: 8px;
}

.agent-stats span {
    color: #94a3b8;
}

.agent-capabilities {
    margin-bottom: 8px;
}

.capability-tag {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.7em;
    margin-right: 4px;
}

.current-thought {
    font-style: italic;
    color: #a855f7;
    font-size: 0.8em;
    margin-top: 8px;
    padding: 4px 8px;
    background: rgba(168, 85, 247, 0.1);
    border-radius: 4px;
}

/* Task Submission Form */
.task-submission {
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    color: #0ea5e9;
    margin-bottom: 5px;
    font-weight: 500;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    background: rgba(14, 165, 233, 0.1);
    border: 1px solid rgba(14, 165, 233, 0.3);
    border-radius: 6px;
    padding: 8px 12px;
    color: #ffffff;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #0ea5e9;
    box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.2);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 15px;
}

.capabilities-checkboxes {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    margin-top: 0px;
    padding: 0px;
}

.capabilities-checkboxes label {
    display: flex;
    align-items: center;
    gap: 0px;
    margin: 0;
    font-weight: normal;
    cursor: pointer;
    height: 20px;
}

.capabilities-checkboxes input[type="checkbox"] {
    width: auto;
    margin: 0;
}

/* Buttons */
.btn {
    background: linear-gradient(135deg, #0ea5e9, #3b82f6);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn:hover {
    background: linear-gradient(135deg, #0284c7, #2563eb);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3);
}

.btn-primary {
    background: linear-gradient(135deg, #10b981, #059669);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #059669, #047857);
}

.btn-success {
    background: linear-gradient(135deg, #10b981, #16a34a);
}

.btn-success:hover {
    background: linear-gradient(135deg, #059669, #15803d);
}

/* Task Progress */
.active-task {
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(168, 85, 247, 0.1);
    border: 1px solid rgba(168, 85, 247, 0.3);
    border-radius: 8px;
}

.task-progress {
    margin-bottom: 15px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(14, 165, 233, 0.2);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981, #0ea5e9);
    transition: width 0.5s ease;
    border-radius: 4px;
}

#progress-text {
    color: #a855f7;
    font-weight: 500;
}

/* Task Results */
.task-result {
    background: rgba(16, 185, 129, 0.05);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.result-header h4 {
    margin: 0;
    color: #10b981;
}

.timestamp {
    color: #94a3b8;
    font-size: 0.9em;
}

.result-meta {
    margin-bottom: 20px;
}

.meta-item {
    display: flex;
    margin-bottom: 8px;
}

.meta-item .label {
    color: #0ea5e9;
    font-weight: 500;
    min-width: 120px;
}

.meta-item .value {
    color: #ffffff;
}

.result-content {
    margin-bottom: 20px;
}

.result-content h5 {
    color: #0ea5e9;
    margin-bottom: 10px;
}

.analysis-text {
    background: rgba(0, 0, 0, 0.3);
    padding: 15px;
    border-radius: 6px;
    border-left: 4px solid #10b981;
    line-height: 1.6;
    white-space: pre-wrap;
}

.result-metrics {
    margin-top: 20px;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
}

.metric {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: rgba(14, 165, 233, 0.1);
    border-radius: 6px;
}

.metric-label {
    color: #94a3b8;
    font-size: 0.9em;
}

.metric-value {
    font-weight: 500;
}

.metric-value.success {
    color: #10b981;
}

.metric-value.warning {
    color: #f59e0b;
}

/* Task History */
.history-list {
    max-height: 200px;
    overflow-y: auto;
}

.no-history {
    text-align: center;
    color: #94a3b8;
    font-style: italic;
    padding: 20px;
    background: rgba(14, 165, 233, 0.05);
    border: 1px dashed rgba(14, 165, 233, 0.3);
    border-radius: 8px;
    margin: 10px 0;
}

.history-item {
    background: rgba(14, 165, 233, 0.05);
    border: 1px solid rgba(14, 165, 233, 0.2);
    border-radius: 6px;
    padding: 10px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.history-item:hover {
    background: rgba(14, 165, 233, 0.1);
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.task-type {
    background: rgba(14, 165, 233, 0.2);
    color: #0ea5e9;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8em;
}

.task-description {
    color: #94a3b8;
    font-size: 0.9em;
    margin-bottom: 5px;
}

.result-preview {
    color: #ffffff;
    font-size: 0.8em;
    font-style: italic;
}

/* Custom Agent Styling */
.custom-agent {
    border-left: 3px solid #10b981 !important;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(5, 150, 105, 0.05));
}

.agent-type.custom {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8em;
    font-weight: 500;
}

.agent-creation-modal .form-group input:focus,
.agent-creation-modal .form-group textarea:focus,
.agent-creation-modal .form-group select:focus {
    outline: none;
    border-color: #0ea5e9;
    box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.2);
}

.agent-creation-modal .close-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}

.agent-creation-modal .cancel-btn:hover {
    background: #5b6470;
    transform: translateY(-1px);
}

.agent-creation-modal button[type="submit"]:hover {
    background: linear-gradient(135deg, #059669, #047857);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

/* Status indicators for different connection states */
.status-dot.error {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    animation: pulse 2s infinite;
}

.status-dot.offline {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 6px;
    color: white;
    font-weight: 500;
    z-index: 15000;
    animation: slideIn 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.notification.success {
    background: linear-gradient(135deg, #10b981, #059669);
}

.notification.error {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.notification.info {
    background: linear-gradient(135deg, #0ea5e9, #0284c7);
}

.notification.warning {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

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

/* View transitions */
.view {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    display: none;
}

.view.active {
    opacity: 1;
    transform: translateY(0);
    display: block;
    animation: fadeIn 0.4s ease;
}

.slide-in {
    animation: slideIn 0.5s ease;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .ai-control-panel,
    .collaboration-panel {
        position: relative;
        width: 100%;
        max-height: none;
        margin-bottom: 20px;
    }
    
    .ai-control-panel.collapsed,
    .collaboration-panel.collapsed {
        width: 60px;
        position: fixed;
        right: 20px;
        top: 80px;
    }
    
    .task-panel {
        position: relative;
        height: auto;
        left: 0;
        right: 0;
        bottom: auto;
    }
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .capabilities-checkboxes {
        grid-template-columns: 1fr;
    }
    
    .metrics-grid {
        grid-template-columns: 1fr;
    }
    
    .notification {
        right: 10px;
        left: 10px;
        top: 10px;
        padding: 10px 15px;
        font-size: 0.9em;
    }
}

@media (max-width: 480px) {
    .form-group {
        margin-bottom: 12px;
    }
    
    .form-group label {
        font-size: 0.9em;
        margin-bottom: 4px;
    }
    
    .form-group input,
    .form-group textarea,
    .form-group select {
        padding: 6px 10px;
        font-size: 0.9em;
    }
    
    .btn {
        padding: 8px 16px;
        font-size: 0.9em;
    }
    
    .btn-primary,
    .btn-success {
        padding: 8px 16px;
    }
    
    .task-result {
        padding: 15px;
        margin-bottom: 15px;
    }
    
    .result-header h4 {
        font-size: 1.1em;
    }
    
    .timestamp {
        font-size: 0.8em;
    }
    
    .result-content h5 {
        font-size: 1em;
        margin-bottom: 8px;
    }
    
    .analysis-text {
        padding: 12px;
        font-size: 0.9em;
    }
    
    .metrics-grid {
        gap: 8px;
    }
    
    .metric {
        padding: 6px 10px;
    }
    
    .metric-label {
        font-size: 0.8em;
    }
    
    .metric-value {
        font-size: 0.9em;
    }
}

/* Network Visualization */
#network-graph {
    width: 100%;
    height: 400px;
    background: rgba(0,0,0,0.2);
    border-radius: 8px;
    border: 1px solid rgba(14, 165, 233, 0.3);
}

.node-label {
    font-size: 10px;
    fill: #ffffff;
    pointer-events: none;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.7);
}

.node-icon {
    font-size: 12px;
    fill: #ffffff;
    pointer-events: none;
}

.link {
    stroke: #94a3b8;
    stroke-opacity: 0.6;
}

.prof-smoot-node {
    filter: drop-shadow(0 0 5px rgba(147, 51, 234, 0.7));
}

.topology-controls {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.topology-controls select {
    padding: 5px;
    border-radius: 4px;
    border: 1px solid #ccc;
    background: rgba(0,0,0,0.3);
    color: white;
}

.topology-controls .btn {
    padding: 5px 10px;
    border-radius: 4px;
    background: rgba(14, 165, 233, 0.2);
    color: #0ea5e9;
    border: 1px solid rgba(14, 165, 233, 0.5);
    cursor: pointer;
}

.topology-controls .btn:hover {
    background: rgba(14, 165, 233, 0.3);
}

/* Task Chain Visualization */
#task-chain-graph {
    width: 100%;
    height: 500px;
    background: rgba(0,0,0,0.2);
    border-radius: 8px;
    border: 1px solid rgba(14, 165, 233, 0.3);
}

#task-chain-details {
    margin-top: 20px;
    padding: 15px;
    background: rgba(14, 165, 233, 0.1);
    border-radius: 8px;
}

.agent-step-group {
    margin-bottom: 15px;
    padding: 10px;
    background: rgba(16, 185, 129, 0.1);
    border-radius: 6px;
}

.agent-step-group h6 {
    color: #10b981;
    margin-bottom: 8px;
}

/* Button Styles */
.btn-small {
    padding: 4px 8px;
    font-size: 0.8em;
}

.view-topology-btn {
    background: rgba(14, 165, 233, 0.2);
    color: #0ea5e9;
    border: 1px solid rgba(14, 165, 233, 0.5);
}

.view-topology-btn:hover {
    background: rgba(14, 165, 233, 0.3);
}

/* Mobile-specific adjustments for network visualization */
@media (max-width: 768px) {
    #network-graph {
        height: 350px;
    }
    
    #task-chain-graph {
        height: 350px;
    }
    
    .topology-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .topology-controls select,
    .topology-controls .btn {
        width: 100%;
        margin-bottom: 5px;
        padding: 8px;
        font-size: 14px;
    }
    
    #task-chain-details {
        padding: 12px;
    }
    
    .agent-step-group {
        padding: 8px;
        margin-bottom: 12px;
    }
    
    .agent-step-group h6 {
        font-size: 0.9em;
        margin-bottom: 6px;
    }
    
    /* Optimize network visualization for mobile */
    .node {
        r: 6px;
    }
    
    .node-label {
        font-size: 8px;
    }
    
    .link {
        stroke-width: 1px;
    }
}

@media (max-width: 480px) {
    #network-graph {
        height: 280px;
    }
    
    #task-chain-graph {
        height: 280px;
    }
    
    #task-chain-details {
        padding: 10px;
        margin-top: 15px;
    }
    
    .agent-step-group {
        padding: 6px;
        margin-bottom: 10px;
    }
    
    .agent-step-group h6 {
        font-size: 0.8em;
    }
    
    .agent-step-group ul {
        padding-left: 15px;
    }
    
    .agent-step-group li {
        font-size: 0.8em;
    }
    
    /* Further optimize for very small screens */
    .node {
        r: 5px;
    }
    
    .node-label {
        font-size: 7px;
    }
    
    .link {
        stroke-width: 0.8px;
    }
    
    .topology-controls select,
    .topology-controls .btn {
        padding: 6px;
        font-size: 13px;
    }
}

/* Animation improvements */
.collaboration-panel {
    will-change: transform;
}

.collaboration-panel .panel-toggle span {
    transition: transform 0.2s ease;
    display: inline-block;
}

.collaboration-panel:hover:not(.collapsed) {
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .nav-btn::before {
        display: none;
    }
    
    .nav-btn:hover {
        background: rgba(255, 255, 255, 0.1);
        transform: none;
        box-shadow: none;
    }
    
    .status-card:hover,
    .visualization-card:hover,
    .log-card:hover {
        transform: none;
    }
    
    .agent-metric-card:hover {
        background: rgba(16, 185, 129, 0.05);
    }
    
    .btn:hover {
        transform: none;
        box-shadow: none;
    }
    
    .btn-primary:hover {
        background: linear-gradient(135deg, #10b981, #059669);
    }
    
    .btn-success:hover {
        background: linear-gradient(135deg, #10b981, #16a34a);
    }
    
    .collaboration-panel:hover:not(.collapsed) {
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    }
    
    /* Increase touch targets for better mobile experience */
    .nav-btn {
        min-height: 44px;
        min-width: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .btn {
        min-height: 44px;
        min-width: 44px;
    }
    
    .control-btn {
        min-height: 40px;
        min-width: 40px;
    }
    
    .panel-toggle {
        min-height: 44px;
        min-width: 44px;
    }
}

/* Content fade effect */
.collaboration-panel.collapsed .form-group,
.collaboration-panel.collapsed .task-submission h4,
.collaboration-panel.collapsed .btn {
    opacity: 0;
    transform: translateX(-20px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.task-panel {
    position: fixed;
    bottom: 20px;
    left: 20px;
    right: 20px;
    height: 300px;
    overflow-y: auto;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(14, 165, 233, 0.3);
}

.panel-header h3 {
    margin: 0;
    color: #0ea5e9;
    font-size: 1.2em;
}

/* 新增的子面板标题样式 */
.panel-subheader {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 20px 0 15px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(14, 165, 233, 0.2);
}

.panel-subheader h4 {
    margin: 0;
    color: #0ea5e9;
    font-size: 1.1em;
}

.panel-subheader h5 {
    margin: 0;
    color: #0ea5e9;
    font-size: 1em;
}

.ai-status {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.status-dot.online {
    background: #10b981;
    box-shadow: 0 0 8px #10b981;
}

.status-dot.offline {
    background: #ef4444;
    box-shadow: 0 0 8px #ef4444;
}

.status-dot.warning {
    background: #f59e0b;
    box-shadow: 0 0 8px #f59e0b;
}

.status-dot.error {
    background: #dc2626;
    box-shadow: 0 0 8px #dc2626;
}

/* AI Agents List */
.ai-agents-section {
    margin-bottom: 20px;
}

.agents-list {
    margin-bottom: 20px;
    max-height: 300px;
    overflow-y: auto;
}

.agent-card {
    background: rgba(14, 165, 233, 0.1);
    border: 1px solid rgba(14, 165, 233, 0.3);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 10px;
}

.agent-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.agent-header h5 {
    margin: 0;
    color: #ffffff;
    font-size: 1em;
}

.agent-type {
    background: rgba(14, 165, 233, 0.2);
    color: #0ea5e9;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8em;
}

.agent-status.idle {
    color: #10b981;
}

.agent-status.busy {
    color: #f59e0b;
}

.agent-status.offline {
    color: #ef4444;
}

.agent-details {
    font-size: 0.9em;
}

.agent-stats {
    display: flex;
    gap: 15px;
    margin-bottom: 8px;
}

.agent-stats span {
    color: #94a3b8;
}

.agent-capabilities {
    margin-bottom: 8px;
}

.capability-tag {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.7em;
    margin-right: 4px;
}

.current-thought {
    font-style: italic;
    color: #a855f7;
    font-size: 0.8em;
    margin-top: 8px;
    padding: 4px 8px;
    background: rgba(168, 85, 247, 0.1);
    border-radius: 4px;
}

.task-submission {
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    color: #0ea5e9;
    margin-bottom: 5px;
    font-weight: 500;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    background: rgba(14, 165, 233, 0.1);
    border: 1px solid rgba(14, 165, 233, 0.3);
    border-radius: 6px;
    padding: 8px 12px;
    color: #ffffff;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #0ea5e9;
    box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.2);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 15px;
}

.capabilities-checkboxes {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    margin-top: 5px;
    padding: 2.5px;
}

.capabilities-checkboxes label {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    font-weight: normal;
    cursor: pointer;
}

.capabilities-checkboxes input[type="checkbox"] {
    width: auto;
    margin: 0;
}

/* Buttons */
.btn {
    background: linear-gradient(135deg, #0ea5e9, #3b82f6);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn:hover {
    background: linear-gradient(135deg, #0284c7, #2563eb);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3);
}

.btn-primary {
    background: linear-gradient(135deg, #10b981, #059669);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #059669, #047857);
}

.btn-success {
    background: linear-gradient(135deg, #10b981, #16a34a);
}

.btn-success:hover {
    background: linear-gradient(135deg, #059669, #15803d);
}

/* Task Progress */
.active-task {
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(168, 85, 247, 0.1);
    border: 1px solid rgba(168, 85, 247, 0.3);
    border-radius: 8px;
}

.task-progress {
    margin-bottom: 15px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(14, 165, 233, 0.2);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981, #0ea5e9);
    transition: width 0.5s ease;
    border-radius: 4px;
}

#progress-text {
    color: #a855f7;
    font-weight: 500;
}

/* Task Results */
.task-result {
    background: rgba(16, 185, 129, 0.05);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.result-header h4 {
    margin: 0;
    color: #10b981;
}

.timestamp {
    color: #94a3b8;
    font-size: 0.9em;
}

.result-meta {
    margin-bottom: 20px;
}

.meta-item {
    display: flex;
    margin-bottom: 8px;
}

.meta-item .label {
    color: #0ea5e9;
    font-weight: 500;
    min-width: 120px;
}

.meta-item .value {
    color: #ffffff;
}

.result-content {
    margin-bottom: 20px;
}

.result-content h5 {
    color: #0ea5e9;
    margin-bottom: 10px;
}

.analysis-text {
    background: rgba(0, 0, 0, 0.3);
    padding: 15px;
    border-radius: 6px;
    border-left: 4px solid #10b981;
    line-height: 1.6;
    white-space: pre-wrap;
}

.result-metrics {
    margin-top: 20px;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
}

.metric {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: rgba(14, 165, 233, 0.1);
    border-radius: 6px;
}

.metric-label {
    color: #94a3b8;
    font-size: 0.9em;
}

.metric-value {
    font-weight: 500;
}

.metric-value.success {
    color: #10b981;
}

.metric-value.warning {
    color: #f59e0b;
}

/* Task History */
.history-list {
    max-height: 200px;
    overflow-y: auto;
}

.no-history {
    text-align: center;
    color: #94a3b8;
    font-style: italic;
    padding: 20px;
    background: rgba(14, 165, 233, 0.05);
    border: 1px dashed rgba(14, 165, 233, 0.3);
    border-radius: 8px;
    margin: 10px 0;
}

.history-item {
    background: rgba(14, 165, 233, 0.05);
    border: 1px solid rgba(14, 165, 233, 0.2);
    border-radius: 6px;
    padding: 10px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.history-item:hover {
    background: rgba(14, 165, 233, 0.1);
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.task-type {
    background: rgba(14, 165, 233, 0.2);
    color: #0ea5e9;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8em;
}

.task-description {
    color: #94a3b8;
    font-size: 0.9em;
    margin-bottom: 5px;
}

.result-preview {
    color: #ffffff;
    font-size: 0.8em;
    font-style: italic;
}

/* Custom Agent Styling */
.custom-agent {
    border-left: 3px solid #10b981 !important;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(5, 150, 105, 0.05));
}

.agent-type.custom {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8em;
    font-weight: 500;
}

/* Agent Creation Modal Styles */
#agent-creation-modal {
    display: flex;
    z-index: 10000;
}

#agent-creation-modal .modal-content {
    background: rgba(26, 27, 60, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    z-index: 10001;
}

#agent-creation-modal .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    z-index: 10002;
}

#agent-creation-modal .modal-header h3 {
    color: #64b5f6;
    margin: 0;
}

#agent-creation-modal .modal-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 5px;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    min-width: 44px;
}

#agent-creation-modal .modal-close:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.1);
}

#agent-creation-modal .modal-body {
    padding: 25px;
}

#agent-creation-modal .form-group {
    margin-bottom: 20px;
}

#agent-creation-modal .form-group label {
    display: block;
    margin-bottom: 8px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
}

#agent-creation-modal .form-group input,
#agent-creation-modal .form-group select,
#agent-creation-modal .form-group textarea {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    font-size: 14px;
    transition: border-color 0.3s ease;
    min-height: 44px;
}

#agent-creation-modal .form-group input:focus,
#agent-creation-modal .form-group select:focus,
#agent-creation-modal .form-group textarea:focus {
    outline: none;
    border-color: #64b5f6;
}

#agent-creation-modal .btn {
    padding: 10px 20px;
    border-radius: 25px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    min-height: 44px;
    min-width: 44px;
    display: inline-block;
    text-align: center;
}

#agent-creation-modal .btn-primary {
    background: linear-gradient(45deg, #2196f3, #21cbf3);
    color: white;
    box-shadow: 0 4px 15px rgba(33, 150, 243, 0.3);
}

#agent-creation-modal .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(33, 150, 243, 0.4);
}

.agent-creation-modal .form-group input:focus,
.agent-creation-modal .form-group textarea:focus,
.agent-creation-modal .form-group select:focus {
    outline: none;
    border-color: #0ea5e9;
    box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.2);
}

.agent-creation-modal .close-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}

.agent-creation-modal .cancel-btn:hover {
    background: #5b6470;
    transform: translateY(-1px);
}

.agent-creation-modal button[type="submit"]:hover {
    background: linear-gradient(135deg, #059669, #047857);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

/* Status indicators for different connection states */
.status-dot.error {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    animation: pulse 2s infinite;
}

.status-dot.offline {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 6px;
    color: white;
    font-weight: 500;
    z-index: 15000;
    animation: slideIn 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.notification.success {
    background: linear-gradient(135deg, #10b981, #059669);
}

.notification.error {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.notification.info {
    background: linear-gradient(135deg, #0ea5e9, #0284c7);
}

.notification.warning {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

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

/* View transitions */
.view {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    display: none;
}

.view.active {
    opacity: 1;
    transform: translateY(0);
    display: block;
    animation: fadeIn 0.4s ease;
}

.slide-in {
    animation: slideIn 0.5s ease;
}

/* Enhanced Mobile Responsiveness for AI Panels */
@media (max-width: 1200px) {
    .ai-control-panel,
    .collaboration-panel {
        position: relative;
        width: 100%;
        max-height: none;
        margin-bottom: 20px;
        position: static;
        margin-left: auto;
        margin-right: auto;
        box-sizing: border-box;
    }
    
    .ai-control-panel.collapsed,
    .collaboration-panel.collapsed {
        width: 60px;
        position: fixed;
        right: 20px;
        top: 80px;
    }
    
    .task-panel {
/* ... existing code ... */

/* Enhanced Mobile Responsiveness for AI Panels */
@media (max-width: 1200px) {
    .task-panel {
        position: fixed;
        height: 400px;
        left: 20px;
        right: 20px;
        bottom: 70px;
        margin-top: 20px;
        margin-left: auto;
        margin-right: auto;
        box-sizing: border-box;
        width: calc(100% - 40px);
        max-width: 100%;
    }
    
    /* Adjust panel positions for medium screens */
    .task-panel {
        right: 20px;
        width: calc(100% - 40px);
    }
}

@media (max-width: 768px) {
    .task-panel {
        position: static;
        bottom: 0;
        left: 0;
        right: 0;
        height: auto;
        max-height: none;
        width: calc(100% - 40px);
        border-radius: 12px;
        padding: 15px;
        overflow-y: auto;
        z-index: 4000;
        margin: 20px auto;
        margin-left: auto;
        margin-right: auto;
        box-sizing: border-box;
    }
    
    /* 在非常小的屏幕上，默认折叠面板以节省空间 */
    @media (max-height: 600px), (max-width: 480px) {
        .task-panel:not(.collapsed) {
            max-height: 25vh;
        }
        
        .task-panel {
            height: 30vh;
            max-height: 400px;
        }
    }
    
    /* Improve touch targets on mobile */
    .task-panel {
        min-height: 44px;
        min-width: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Optimize AI panels for mobile */
    .ai-agents-section,
    .collaboration-section {
        max-height: 60vh;
        overflow-y: auto;
    }
    
    .agents-list,
    .collaborations-list {
        max-height: 30vh;
        overflow-y: auto;
    }
    
    .task-submission {
        max-height: 60vh;
        overflow-y: auto;
    }
    
    /* Mobile-specific collapsed states */
    .task-panel.collapsed .panel-content {
        opacity: 0;
        pointer-events: none;
        transform: scale(0.95);
    }
    
    .task-panel .panel-content {
        transition: all 0.3s ease;
    }
    
    /* 在中等屏幕上，水平布局变为垂直堆叠 */
    .task-panel.horizontal-layout {
        flex-direction: column;
    }
    
    .task-panel.horizontal-layout .panel-section {
        border-right: none;
        border-bottom: 1px solid rgba(14, 165, 233, 0.3);
    }
    
    .task-panel.horizontal-layout .panel-section:last-child {
        border-bottom: none;
    }
}

@media (max-width: 480px) {
    .form-group {
        margin-bottom: 12px;
    }
    
    .form-group label {
        font-size: 0.9em;
        margin-bottom: 4px;
    }
    
    .form-group input,
    .form-group textarea,
    .form-group select {
        padding: 6px 10px;
        font-size: 0.9em;
    }
    
    .btn {
        padding: 8px 16px;
        font-size: 0.9em;
    }
    
    .btn-primary,
    .btn-success {
        padding: 8px 16px;
    }
    
    .task-result {
        padding: 15px;
        margin-bottom: 15px;
    }
    
    .result-header h4 {
        font-size: 1.1em;
    }
    
    .timestamp {
        font-size: 0.8em;
    }
    
    .result-content h5 {
        font-size: 1em;
        margin-bottom: 8px;
    }
    
    .analysis-text {
        padding: 12px;
        font-size: 0.9em;
    }
    
    .metrics-grid {
        gap: 8px;
    }
    
    .metric {
        padding: 6px 10px;
    }
    
    .metric-label {
        font-size: 0.8em;
    }
    
    .metric-value {
        font-size: 0.9em;
    }
    
    /* Further mobile optimization for AI panels */
    .task-panel {
        width: calc(100% - 20px);
        left: 10px;
        right: 10px;
        padding: 12px;
        max-height: 45vh;
    }
    
    .task-panel {
        right: 10px;
        left: auto;
    }
    
    .panel-header h3 {
        font-size: 1.1em;
    }
    
    .task-panel {
        height: auto;
        max-height: none;
        padding: 12px;
    }
    
    .task-panel .panel-header h3 {
        font-size: 1em;
    }
    
    /* Adjust agent cards for small screens */
    .agent-card {
        padding: 10px;
    }
    
    .agent-header h5 {
        font-size: 0.9em;
    }
    
    .agent-type {
        font-size: 0.7em;
        padding: 2px 6px;
    }
    
    .agent-details {
        font-size: 0.8em;
    }
    
    .agent-stats {
        gap: 10px;
    }
    
    /* Adjust capability tags for small screens */
    .capability-tag {
        font-size: 0.6em;
        padding: 1px 4px;
        margin-right: 2px;
    }
    
    /* Adjust task submission form for small screens */
    .task-submission {
        max-height: 50vh;
    }
    
    /* Adjust history list for small screens */
    .history-list {
        max-height: 120px;
    }
    
    .history-item {
        padding: 8px;
    }
    
    .history-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .task-type {
        font-size: 0.7em;
        padding: 1px 6px;
    }
    
    .task-description {
        font-size: 0.8em;
    }
    
    .result-preview {
        font-size: 0.7em;
    }
    
    /* 在小屏幕上，水平布局变为垂直堆叠 */
    .task-panel.horizontal-layout {
        flex-direction: column;
    }
    
    .task-panel.horizontal-layout .panel-section {
        border-right: none;
        border-bottom: 1px solid rgba(14, 165, 233, 0.3);
    }
    
    .task-panel.horizontal-layout .panel-section:last-child {
        border-bottom: none;
    }
}

/* Network Visualization */
#network-graph {
    width: 100%;
    height: 400px;
    background: rgba(0,0,0,0.2);
    border-radius: 8px;
    border: 1px solid rgba(14, 165, 233, 0.3);
}

.node-label {
    font-size: 10px;
    fill: #ffffff;
    pointer-events: none;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.7);
}

.node-icon {
    font-size: 12px;
    fill: #ffffff;
    pointer-events: none;
}

.link {
    stroke: #94a3b8;
    stroke-opacity: 0.6;
}

.prof-smoot-node {
    filter: drop-shadow(0 0 5px rgba(147, 51, 234, 0.7));
}

.topology-controls {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.topology-controls select {
    padding: 5px;
    border-radius: 4px;
    border: 1px solid #ccc;
    background: rgba(0,0,0,0.3);
    color: white;
}

.topology-controls .btn {
    padding: 5px 10px;
    border-radius: 4px;
    background: rgba(14, 165, 233, 0.2);
    color: #0ea5e9;
    border: 1px solid rgba(14, 165, 233, 0.5);
    cursor: pointer;
}

.topology-controls .btn:hover {
    background: rgba(14, 165, 233, 0.3);
}

/* Task Chain Visualization */
#task-chain-graph {
    width: 100%;
    height: 500px;
    background: rgba(0,0,0,0.2);
    border-radius: 8px;
    border: 1px solid rgba(14, 165, 233, 0.3);
}

#task-chain-details {
    margin-top: 20px;
    padding: 15px;
    background: rgba(14, 165, 233, 0.1);
    border-radius: 8px;
}

.agent-step-group {
    margin-bottom: 15px;
    padding: 10px;
    background: rgba(16, 185, 129, 0.1);
    border-radius: 6px;
}

.agent-step-group h6 {
    color: #10b981;
    margin-bottom: 8px;
}

/* Button Styles */
.btn-small {
    padding: 4px 8px;
    font-size: 0.8em;
}

.view-topology-btn {
    background: rgba(14, 165, 233, 0.2);
    color: #0ea5e9;
    border: 1px solid rgba(14, 165, 233, 0.5);
}

.view-topology-btn:hover {
    background: rgba(14, 165, 233, 0.3);
}

/* Mobile-specific adjustments for network visualization */
@media (max-width: 768px) {
    #network-graph {
        height: 350px;
    }
    
    #task-chain-graph {
        height: 350px;
    }
    
    .topology-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .topology-controls select,
    .topology-controls .btn {
        width: 100%;
        margin-bottom: 5px;
        padding: 8px;
        font-size: 14px;
    }
    
    #task-chain-details {
        padding: 12px;
    }
    
    .agent-step-group {
        padding: 8px;
        margin-bottom: 12px;
    }
    
    .agent-step-group h6 {
        font-size: 0.9em;
        margin-bottom: 6px;
    }
    
    /* Optimize network visualization for mobile */
    .node {
        r: 6px;
    }
    
    .node-label {
        font-size: 8px;
    }
    
    .link {
        stroke-width: 1px;
    }
}

@media (max-width: 480px) {
    #network-graph {
        height: 280px;
    }
    
    #task-chain-graph {
        height: 280px;
    }
    
    #task-chain-details {
        padding: 10px;
        margin-top: 15px;
    }
    
    .agent-step-group {
        padding: 6px;
        margin-bottom: 10px;
    }
    
    .agent-step-group h6 {
        font-size: 0.8em;
    }
    
    .agent-step-group ul {
        padding-left: 15px;
    }
    
    .agent-step-group li {
        font-size: 0.8em;
    }
    
    /* Further optimize for very small screens */
    .node {
        r: 5px;
    }
    
    .node-label {
        font-size: 7px;
    }
    
    .link {
        stroke-width: 0.8px;
    }
    
    .topology-controls select,
    .topology-controls .btn {
        padding: 6px;
        font-size: 13px;
    }
}