/* 历史任务管理页面专用样式 */

/* 用户信息区域样式 */
.user-details {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-left: 2em;
}

.user-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    /* margin-left: 3em; */
}

.user-name {
    color: #e0e0e0;
    font-weight: 500;
    font-size: 0.95em;
}

/* 回到主页链接样式 */
.home-link {
    color: #06b6d4;
    background: rgba(6, 182, 212, 0.1);
    border: 1px solid rgba(6, 182, 212, 0.3);
    text-decoration: none;
    font-size: 0.9em;
    padding: 6px 12px;
    border-radius: 25px;
    transition: all 0.3s ease;
    font-weight: 400;
    display: inline-block;
    line-height: 1.2;
    vertical-align: middle;
}

.home-link:hover {
    background: rgba(6, 182, 212, 0.2);
    border-color: rgba(6, 182, 212, 0.5);
    color: #0891b2;
    text-decoration: none;
    transform: translateY(-1px);
}

/* 退出登录按钮样式 */
.logout-btn {
    background: rgba(220, 53, 69, 0.15);
    color: #f8d7da;
    border: 1.5px solid rgba(220, 53, 69, 0.4);
    padding: 6px 12px;
    border-radius: 25px;
    font-size: 0.85em;
    cursor: pointer;
    font-weight: 300;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.logout-btn:hover {
    background: rgba(220, 53, 69, 0.25);
    border-color: rgba(220, 53, 69, 0.6);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.2);
}

.logout-btn:active {
    transform: translateY(0);
}

/* 统计信息卡片 */
.statistics {
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
}

.stat-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 15px;
    text-align: center;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(139, 92, 246, 0.3);
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.2);
}

.stat-number {
    font-size: 1.8em;
    font-weight: 700;
    background: linear-gradient(135deg, #8b5cf6 0%, #3b82f6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.8em;
    color: #a0aec0;
    font-weight: 500;
}

/* 任务控制栏 */
.history-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.controls-left {
    display: flex;
    gap: 15px;
    align-items: center;
}

.controls-right {
    display: flex;
    align-items: center;
}

.task-count {
    color: #a0aec0;
    font-size: 0.9em;
}

.status-filter {
    padding: 8px 15px;
    border: 1px solid rgba(139, 92, 246, 0.4);
    border-radius: 25px;
    background: rgba(30, 30, 30, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    color: #ffffff;
    font-size: 0.9em;
    cursor: pointer;
    transition: all 0.3s ease;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23e0e0e0' d='M6 8L2 4h8z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px;
    padding-right: 35px;
}

.status-filter:hover {
    background-color: rgba(40, 40, 40, 0.95);
    border-color: rgba(139, 92, 246, 0.6);
}

/* 任务列表 */
.task-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.task-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 25px;
    transition: all 0.3s ease;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.task-item:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(139, 92, 246, 0.3);
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.2);
}

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

.task-title {
    flex: 1;
    margin-right: 20px;
}

.task-name {
    font-size: 1.2em;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 5px;
    line-height: 1.3;
}

.task-meta {
    display: flex;
    gap: 15px;
    font-size: 0.85em;
    color: #a0aec0;
}

.task-status {
    padding: 4px 12px;
    border-radius: 25px;
    font-size: 0.8em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.task-status.pending {
    background: rgba(156, 163, 175, 0.2);
    color: #d1d5db;
    border: 1px solid rgba(156, 163, 175, 0.3);
}

.task-status.processing {
    background: rgba(59, 130, 246, 0.2);
    color: #93c5fd;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.task-status.completed {
    background: rgba(16, 185, 129, 0.2);
    color: #6ee7b7;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.task-status.error {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.task-actions {
    display: flex;
    gap: 8px;
}

.task-actions .btn-download {
    padding: 6px 12px;
    font-size: 0.85em;
    border-radius: 25px;
    background: rgba(139, 92, 246, 0.15);
    color: #a78bfa;
    border: 1px solid rgba(139, 92, 246, 0.4);
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
}

.task-actions .btn-download:hover {
    background: rgba(139, 92, 246, 0.25);
    border-color: rgba(139, 92, 246, 0.6);
    transform: translateY(-1px);
    text-decoration: none;
    color: #a78bfa;
}

.task-actions .btn-view {
    padding: 6px 12px;
    font-size: 0.85em;
    border-radius: 25px;
    background: rgba(59, 130, 246, 0.15);
    color: #06b6d4;
    border: 1px solid rgba(59, 130, 246, 0.4);
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
}

.task-actions .btn-view:hover {
    background: rgba(59, 130, 246, 0.25);
    border-color: rgba(59, 130, 246, 0.6);
    transform: translateY(-1px);
    text-decoration: none;
    color: #06b6d4;
}

.task-actions .btn-delete {
    padding: 6px 12px;
    font-size: 0.85em;
    border-radius: 25px;
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.4);
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
}

.task-actions .btn-delete:hover {
    background: rgba(239, 68, 68, 0.25);
    border-color: rgba(239, 68, 68, 0.6);
    transform: translateY(-1px);
    text-decoration: none;
    color: #f87171;
}

.task-details {
    color: #d0d0d0;
    line-height: 1.6;
}

.task-details p {
    margin-bottom: 8px;
}

.task-details strong {
    color: #ffffff;
}

/* 模态框样式 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal.show {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: rgba(30, 30, 30, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 25px;
    max-width: 800px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    transform: scale(0.9);
    transition: transform 0.3s ease;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.modal.show .modal-content {
    transform: scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-header h3 {
    margin: 0;
    color: #ffffff;
    font-size: 1.3em;
    font-weight: 600;
}

.close-btn {
    background: none;
    border: none;
    color: #a0aec0;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.close-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
}

.modal-body {
    padding: 25px 30px;
    max-height: 50vh;
    overflow-y: auto;
}

.task-info {
    margin-bottom: 20px;
}

.task-preview {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 25px;
    padding: 20px;
    max-height: 300px;
    overflow-y: auto;
}

.modal-footer {
    padding: 20px 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 30px;
    padding: 20px;
}

.page-btn {
    background: rgba(139, 92, 246, 0.15);
    color: #a78bfa;
    border: 1px solid rgba(139, 92, 246, 0.4);
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 0.9em;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.page-btn:hover:not(:disabled) {
    background: rgba(139, 92, 246, 0.25);
    border-color: rgba(139, 92, 246, 0.6);
    transform: translateY(-1px);
}

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

.page-info {
    color: #a0aec0;
    font-size: 0.9em;
}

/* 加载和空状态 */
.loading, .empty-state {
    padding: 60px 40px;
    text-align: center;
    margin-top: 30px;
}

.empty-icon {
    font-size: 4em;
    margin-bottom: 20px;
    opacity: 0.6;
}

.empty-state h3 {
    color: #ffffff;
    margin-bottom: 15px;
    font-size: 1.3em;
}

.empty-state p {
    color: #a0aec0;
    margin-bottom: 25px;
    line-height: 1.6;
}

/* 按钮样式扩展 */
.btn-danger {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.4);
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 0.9em;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.25);
    border-color: rgba(239, 68, 68, 0.6);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(239, 68, 68, 0.3);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .stat-number {
        font-size: 2em;
    }
    
    .history-controls {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }

    /* 刷新按钮移动端等宽纵向 */
    .controls-left {
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }

    #refresh-btn {
        width: 100%;
        padding: 12px;
        text-align: center;
        margin: 0;
    }

    .status-filter {
        width: 100%;
        padding: 12px;
        text-align: center;
    }
    
    .controls-right {
        justify-content: center;
    }
    
    .task-header {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    
    .task-title {
        margin-right: 0;
    }
    
    .task-meta {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    /* 任务容器中按钮纵向等宽布局 */
    .task-actions {
        flex-direction: column;
        gap: 10px;
        width: 100%;
        justify-content: stretch;
        align-items: stretch;
    }

    .task-actions .btn-view,
    .task-actions .btn-delete,
    .task-actions .btn-download {
        width: 100%;
        padding: 12px;
        text-align: center;
        margin: 0;
        flex: none;
        box-sizing: border-box;
    }
    
    .modal-content {
        width: 95%;
        max-height: 90vh;
    }
    
    .modal-header, .modal-body, .modal-footer {
        padding: 20px;
    }
}