/* 任务卡片样式 */
.task-card {
    border: 1px solid #e8ecef;
    border-radius: 4px;
    transition: all 0.3s ease;
    overflow: hidden;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.task-card:hover {
    box-shadow: 0 0 1.5px rgba(0, 0, 0, .037), 0 0 3.7px rgba(0, 0, 0, .053), 0 0 7.6px rgba(0, 0, 0, .067), 0 0 15.7px rgba(0, 0, 0, .083), 0 0 43px rgba(0, 0, 0, .12);
    transform: scale(1.05);
    transition: all .3s;
}

/* 任务类型标签 */
.task-type {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0, 123, 255, 0.9);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: bold;
    z-index: 2;
    backdrop-filter: blur(4px);
}

.task-type.daily {
    background: rgba(40, 167, 69, 0.9);
}

.task-type.weekly {
    background: rgba(255, 193, 7, 0.9);
    color: #212529;
}

.task-type.special {
    background: rgba(220, 53, 69, 0.9);
}

/* 封面图片容器 */
.card-img-container {
    position: relative;
    overflow: hidden;
}

.task-cover {
    transition: transform 0.3s ease;
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.task-card:hover .task-cover {
    transform: scale(1.05);
}

/* 卡片内容 */
.card-body {
    padding: 16px;
    position: relative;
    z-index: 2;
}

/* 任务标题 */
.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
    line-height: 1.4;
    margin-bottom: 8px;
}

/* 资源标题 */
.card-text {
    font-size: 13px;
    color: #6c757d;
    line-height: 1.3;
}

/* 奖励信息 */
.task-reward {
    color: #28a745;
    font-weight: bold;
    font-size: 18px;
}

.task-difficulty {
    color: #ffc107;
    font-size: 13px;
    margin-left: 8px;
    background: rgba(255, 193, 7, 0.1);
    padding: 2px 6px;
    border-radius: 8px;
}

/* 参与人数样式 */
.task-participants {
    font-size: 12px;
    color: #6c757d;
}

.task-participants .current {
    color: #28a745;
    font-weight: bold;
    font-size: 13px;
}

.task-participants .total {
    color: #007bff;
    font-weight: bold;
    font-size: 13px;
}

/* 进度条样式 */
.task-progress .progress {
    background-color: #e9ecef;
    border-radius: 8px;
    overflow: hidden;
    height: 6px;
}

.task-progress .progress-bar {
    background: linear-gradient(90deg, #28a745, #20c997);
    transition: width 0.6s ease;
    border-radius: 8px;
}

/* 倒计时样式 */
.task-countdown {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    padding: 8px 12px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 13px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
    animation: task-pulse 2s infinite;
}

@keyframes task-pulse {
    0% { 
        box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
        transform: scale(1);
    }
    50% { 
        box-shadow: 0 4px 12px rgba(40, 167, 69, 0.5);
        transform: scale(1.02);
    }
    100% { 
        box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
        transform: scale(1);
    }
}

/* 状态标签 */
.task-status {
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: bold;
    text-align: center;
    display: inline-block;
}

.task-status.not-started {
    background-color: #f8f9fa;
    color: #6c757d;
    border: 1px solid #dee2e6;
}

.task-status.ended {
    background-color: #6c757d;
    color: white;
}

.task-status.full {
    background-color: #ffc107;
    color: #212529;
}

/* 按钮样式 */
.user-action .btn {
    font-weight: 600;
    border-radius: 20px;
    padding: 10px 16px;
    font-size: 14px;
    transition: all 0.3s ease;
    position: relative;
    z-index: 3;
    text-transform: none;
    letter-spacing: 0.5px;
}

/* 统一按钮高度 */
.task-action-btn {
    height: 40px !important;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

/* 可点击内容元素 */
.task-clickable {
    transition: background-color 0.2s ease;
    border-radius: 6px;
    padding: 4px;
    margin: -4px;
}

.task-clickable:hover {
    background-color: rgba(40, 167, 69, 0.08);
}

.user-action .btn:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.user-action .btn-success {
    background: linear-gradient(135deg, #28a745, #20c997);
    border: none;
    color: white;
}

.user-action .btn-success:hover {
    background: linear-gradient(135deg, #218838, #1db584);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
}

.user-action .btn-outline-primary {
    border-color: #007bff;
    color: #007bff;
    background: transparent;
}

.user-action .btn-outline-primary:hover {
    background-color: #007bff;
    border-color: #007bff;
    color: white;
    box-shadow: 0 6px 20px rgba(0, 123, 255, 0.4);
}

.user-action .btn-secondary {
    background-color: #6c757d;
    border-color: #6c757d;
    color: white;
}

.user-action .btn-warning {
    background-color: #ffc107;
    border-color: #ffc107;
    color: #212529;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .task-card {
        margin-bottom: 16px;
    }
    
    .card-title {
        font-size: 15px;
    }
    
    .task-reward {
        font-size: 16px;
    }
    
    .user-action .btn {
        padding: 8px 12px;
        font-size: 13px;
    }
}

/* 深色模式支持 */
/* @media (prefers-color-scheme: dark) {
    .task-card {
        background: #2d3748;
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    .card-title {
        color: #e2e8f0;
    }
    
    .card-text {
        color: #a0aec0;
    }
} */

/* 加载状态 */
.task-card.loading {
    opacity: 0.6;
    pointer-events: none;
}

.task-card.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 24px;
    margin: -12px 0 0 -12px;
    border: 2px solid #28a745;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
    z-index: 10;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}