/**
 * 任务启动器样式
 * 提供启动反馈和进度追踪的视觉效果
 */

/* ========== 模态框基础样式 ========== */
.task-launch-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.task-launch-modal.show {
    opacity: 1;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.task-launch-modal.show .modal-content {
    transform: scale(1);
}

/* ========== 头部区域 ========== */
.launch-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 30px 24px;
    text-align: center;
    color: white;
}

.launch-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 16px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: iconPulse 2s infinite;
}

@keyframes iconPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.7);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 15px rgba(255, 255, 255, 0);
    }
}

.launch-header h3 {
    margin: 0;
    font-size: 22px;
    font-weight: 600;
}

/* ========== 主体区域 ========== */
.launch-body {
    padding: 24px;
}

/* ========== 进度条 ========== */
.launch-progress {
    margin-bottom: 24px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 4px;
    width: 0%;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

/* 进度条闪光效果 */
.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
        transparent,
        rgba(255, 255, 255, 0.4),
        transparent
    );
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

.progress-text {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #666;
}

.progress-text span:first-child {
    font-weight: 600;
    color: #667eea;
}

/* ========== 当前阶段 ========== */
.current-stage {
    background: linear-gradient(135deg, #667eea15 0%, #764ba215 100%);
    border: 2px solid #667eea;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 15px;
    font-weight: 500;
    color: #667eea;
}

.current-stage i {
    font-size: 18px;
}

/* ========== 阶段列表 ========== */
.stage-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}

.stage-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #f5f5f5;
    border-radius: 6px;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.stage-item i {
    font-size: 16px;
    color: #999;
    width: 20px;
    text-align: center;
}

.stage-item span {
    flex: 1;
    font-size: 14px;
    color: #666;
}

.stage-status {
    font-size: 16px;
}

/* 激活状态 */
.stage-item.active {
    background: linear-gradient(135deg, #667eea15 0%, #764ba215 100%);
    border-color: #667eea;
}

.stage-item.active i {
    color: #667eea;
    animation: spin 1s linear infinite;
}

.stage-item.active span {
    color: #667eea;
    font-weight: 500;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* 完成状态 */
.stage-item.completed {
    background: linear-gradient(135deg, #4CAF5015 0%, #81C78415 100%);
    border-color: #4CAF50;
}

.stage-item.completed i {
    color: #4CAF50;
}

.stage-item.completed span {
    color: #4CAF50;
    text-decoration: line-through;
}

/* 失败状态 */
.stage-item.failed {
    background: linear-gradient(135deg, #f4433615 0%, #ff575715 100%);
    border-color: #f44336;
}

.stage-item.failed i,
.stage-item.failed span {
    color: #f44336;
}

/* ========== 提示信息 ========== */
.launch-tips {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: #fff9c4;
    border-radius: 6px;
    font-size: 13px;
    color: #666;
}

.launch-tips i {
    color: #FFC107;
    font-size: 16px;
}

/* ========== 响应式设计 ========== */
@media (max-width: 600px) {
    .modal-content {
        width: 95%;
        max-height: 85vh;
    }

    .launch-header {
        padding: 24px 20px;
    }

    .launch-icon {
        width: 64px;
        height: 64px;
    }

    .launch-header h3 {
        font-size: 18px;
    }

    .launch-body {
        padding: 20px;
    }

    .current-stage {
        font-size: 14px;
        padding: 12px;
    }

    .stage-item {
        padding: 10px;
    }
}

/* ========== 动画效果 ========== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stage-item {
    animation: fadeIn 0.3s ease;
}

.stage-item:nth-child(1) { animation-delay: 0.05s; }
.stage-item:nth-child(2) { animation-delay: 0.1s; }
.stage-item:nth-child(3) { animation-delay: 0.15s; }
.stage-item:nth-child(4) { animation-delay: 0.2s; }
