/* Collaboration Engine Styles */
.collaboration-container {
    min-height: calc(100vh - 120px); /* 减去头部和边距的高度 */
    width: 100%;
    background-color: rgba(18, 18, 18, 0.8);
    border-radius: 12px;
    padding: 20px;
    margin-top: 40px;
    position: relative;
    overflow-y: auto;
}

/* Core Operation Console */
.core-console {
    display: flex;
    height: auto;
    min-height: 600px;
    margin-bottom: 30px;
    gap: 20px;
}

/* Agent Library */
.agent-library {
    width: 250px;
    height: 100%;
    background-color: rgba(42, 90, 81, 0.7);
    border-radius: 8px;
    padding: 20px;
    overflow-y: auto;
}

.agent-library h4 {
    color: #FFE066;
    margin-bottom: 20px;
    font-size: 18px;
}

.agent-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.agent-item {
    text-align: center;
    cursor: grab;
    transition: transform 0.2s;
}

.agent-item:hover {
    transform: scale(1.05);
}

.agent-icon {
    width: 60px;
    height: 60px;
    background-color: rgba(255, 224, 102, 0.2);
    border: 2px solid #FFE066;
    border-radius: 8px;
    margin: 0 auto 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.agent-item.dragging .agent-icon {
    cursor: grabbing;
    opacity: 0.8;
    transform: scale(1.1);
}

.agent-label {
    font-size: 12px;
    color: #fff;
    line-height: 1.2;
}

/* Drag操作台 */
.drag-operation {
    width: 800px;
    height: 100%;
    background: linear-gradient(135deg, rgba(30, 30, 40, 0.95) 0%, rgba(17, 17, 27, 0.95) 100%);
    border-radius: 8px;
    position: relative;
    overflow: hidden;
}

.sandbox-area {
    width: 100%;
    height: 100%;
    position: relative;
}

.start-node {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background-color: #FFE066;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #121212;
    font-weight: bold;
}

.drag-track {
    position: absolute;
    background-color: #FFE066;
    height: 2px;
    opacity: 0.6;
    pointer-events: none;
    z-index: 10;
}

.drag-track.dashed {
    background-image: linear-gradient(to right, #FFE066 5px, transparent 5px);
    background-size: 8px 100%;
    background-repeat: repeat-x;
}

.adsorption-animation {
    position: absolute;
    border: 2px solid #FFE066;
    border-radius: 50%;
    background-color: transparent;
    transform: translate(-50%, -50%);
    animation: ripple 0.3s ease-out;
    pointer-events: none;
    z-index: 20;
}

@keyframes ripple {
    0% {
        width: 0;
        height: 0;
        opacity: 1;
    }
    100% {
        width: 60px;
        height: 60px;
        opacity: 0;
    }
}

/* Parameter Configuration */
.parameter-config {
    width: 250px;
    height: 100%;
    background-color: rgba(42, 90, 81, 0.7);
    border-radius: 8px;
    padding: 20px;
    overflow-y: auto;
}

.parameter-config h4 {
    color: #FFE066;
    margin-bottom: 20px;
    font-size: 18px;
}

.parameter-group {
    margin-bottom: 25px;
}

.parameter-group label {
    display: block;
    color: #fff;
    margin-bottom: 8px;
    font-size: 14px;
}

.parameter-slider {
    width: 180px;
    height: 8px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    position: relative;
    margin: 15px 0;
}

.slider-thumb {
    position: absolute;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background-color: #FFE066;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.3);
    transition: .4s;
    border-radius: 20px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background-color: #FFE066;
}

input:checked + .toggle-slider:before {
    transform: translateX(20px);
}

/* Simulation Control */
.simulation-control {
    height: 200px;
    background-color: rgba(42, 90, 81, 0.5);
    border-radius: 8px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 40px;
}

.progress-container {
    flex: 1;
}

.progress-bar {
    width: 300px;
    height: 10px;
    background-color: #3A6A61;
    border-radius: 5px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background-color: #FFE066;
    width: 0;
    transition: width 0.3s ease;
}

.progress-text {
    position: absolute;
    right: -120px;
    top: 50%;
    transform: translateY(-50%);
    color: #FFE066;
    font-size: 14px;
    min-width: 100px;
}

.progress-bar.error .progress-fill {
    background-color: #FF4040;
}

.log-window {
    width: 400px;
    height: 120px;
    background-color: #2A5A51;
    border-radius: 8px;
    padding: 15px;
    overflow-y: auto;
}

.log-entry {
    color: #fff;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 5px;
}

.log-entry:before {
    content: "→ ";
    color: #FFE066;
}

.log-entry.error {
    color: #FF4040;
}

.log-entry.error:before {
    content: "⚠️ ";
    color: #FF4040;
}

.control-buttons {
    display: flex;
    gap: 10px;
}

.control-btn {
    padding: 10px 20px;
    border: 2px solid #FFE066;
    background-color: transparent;
    color: #FFE066;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.control-btn:hover {
    background-color: #FFE066;
    color: #121212;
}

.control-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.control-btn.stop {
    border-color: #FF4040;
    color: #FF4040;
}

.control-btn.stop:hover {
    background-color: #FF4040;
    color: white;
}

/* Shiba Animation */
.simulation-shiba {
    position: absolute;
    right: 20px;
    bottom: 20px;
    width: 40px;
    height: 40px;
    transition: transform 0.5s ease;
    z-index: 100;
    cursor: pointer;
}

.simulation-shiba.jumping {
    animation: jump 0.5s ease;
}

.simulation-shiba.patting {
    animation: pat 0.3s ease 3;
}

@keyframes jump {
    0% {
        transform: translateX(0);
    }
    50% {
        transform: translateX(-50px) translateY(-30px);
    }
    100% {
        transform: translateX(-50px);
    }
}

@keyframes pat {
    0%, 100% {
        transform: translateX(-50px) translateY(0);
    }
    50% {
        transform: translateX(-53px) translateY(-3px);
    }
}

/* Demo Actions */
.demo-actions {
    margin-top: 30px;
    display: flex;
    gap: 15px;
    justify-content: center;
}

/* Responsive Design */
@media (max-width: 1400px) {
    .core-console {
        flex-direction: column;
        height: auto;
    }
    
    .agent-library, .drag-operation, .parameter-config {
        width: 100%;
        margin-bottom: 20px;
    }
    
    .collaboration-container {
        height: auto;
        min-height: 1300px;
    }
}

@media (max-width: 768px) {
    .agent-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .simulation-control {
        flex-direction: column;
        gap: 20px;
        height: auto;
        min-height: 200px;
    }
    
    .log-window {
        width: 100%;
    }
    
    .progress-bar {
        width: 100%;
    }
}