/* ========== 侧边栏任务组件 ========== */

.qm-task-widget {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    margin-bottom: 1rem;
}

.dark .qm-task-widget {
    background: #1e293b;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

/* ========== 头部 ========== */
.qm-task-widget__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: linear-gradient(135deg, #7c3aed 0%, #ec4899 50%, #f97316 100%);
    color: #ffffff;
}

.qm-task-widget__header-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.qm-task-widget__header-left i {
    font-size: 16px;
}

.qm-task-widget__title {
    font-size: 15px;
    font-weight: 700;
}

.qm-task-widget__header-right {
    display: flex;
    align-items: center;
}

.qm-task-widget__streak {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.qm-task-widget__streak i {
    color: #fbbf24;
}

/* ========== 倒计时 ========== */
.qm-task-widget__countdown {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.08), rgba(236, 72, 153, 0.06));
    font-size: 12px;
    color: #64748b;
}

.qm-task-widget__countdown i {
    color: #7c3aed;
}

.dark .qm-task-widget__countdown {
    background: rgba(124, 58, 237, 0.15);
    color: #94a3b8;
}

/* ========== 内容区 ========== */
.qm-task-widget__content {
    padding: 12px;
}

/* ========== 标签页 ========== */
.qm-task-widget__tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
    padding: 4px;
    background: #f1f5f9;
    border-radius: 10px;
}

.dark .qm-task-widget__tabs {
    background: #0f172a;
}

.qm-task-widget__tab {
    flex: 1;
    padding: 8px 12px;
    border: none;
    background: transparent;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s ease;
}

.qm-task-widget__tab:hover {
    color: #7c3aed;
}

.qm-task-widget__tab.active {
    background: #ffffff;
    color: #7c3aed;
    box-shadow: 0 2px 8px rgba(124, 58, 237, 0.15);
}

.dark .qm-task-widget__tab {
    color: #94a3b8;
}

.dark .qm-task-widget__tab.active {
    background: #334155;
    color: #a78bfa;
}

/* ========== 任务列表 ========== */
.qm-task-widget__list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.qm-task-widget__list.hidden {
    display: none;
}

/* ========== 空状态 ========== */
.qm-task-widget__empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 32px 16px;
    color: #94a3b8;
}

.qm-task-widget__empty i {
    font-size: 32px;
    opacity: 0.5;
}

.qm-task-widget__empty span {
    font-size: 13px;
}

/* ========== 未登录提示 ========== */
.qm-task-widget__login-hint {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 32px 16px;
    text-align: center;
}

.qm-task-widget__login-hint i {
    font-size: 36px;
    background: linear-gradient(135deg, #7c3aed, #ec4899);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.qm-task-widget__login-hint p {
    font-size: 14px;
    color: #64748b;
    margin: 0;
}

.dark .qm-task-widget__login-hint p {
    color: #94a3b8;
}

.qm-task-widget__login-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 24px;
    background: linear-gradient(135deg, #7c3aed, #ec4899);
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    border-radius: 10px;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
    transition: all 0.2s ease;
}

.qm-task-widget__login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(124, 58, 237, 0.4);
    color: #ffffff;
}


/* ========== 任务卡片 ========== */
.qm-task-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    transition: all 0.2s ease;
}

.qm-task-card:hover {
    border-color: rgba(124, 58, 237, 0.3);
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.04), rgba(236, 72, 153, 0.02));
}

.dark .qm-task-card {
    background: #0f172a;
    border-color: #334155;
}

.dark .qm-task-card:hover {
    border-color: rgba(124, 58, 237, 0.5);
    background: rgba(124, 58, 237, 0.1);
}

/* 红点徽章 */
.qm-task-card__badge {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    background: linear-gradient(135deg, #ef4444, #f97316);
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.5);
    animation: taskBadgePulse 2s ease-in-out infinite;
}

@keyframes taskBadgePulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.8;
    }
}

/* 任务图标 */
.qm-task-card__icon {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.12), rgba(236, 72, 153, 0.1));
    border-radius: 10px;
}

.qm-task-card__icon i {
    font-size: 16px;
    background: linear-gradient(135deg, #7c3aed, #ec4899);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* 任务信息 */
.qm-task-card__info {
    flex: 1;
    min-width: 0;
}

.qm-task-card__name {
    font-size: 14px;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.3;
    margin-bottom: 2px;
}

.dark .qm-task-card__name {
    color: #f1f5f9;
}

.qm-task-card__desc {
    font-size: 11px;
    color: #64748b;
    line-height: 1.3;
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dark .qm-task-card__desc {
    color: #94a3b8;
}

/* 进度条 */
.qm-task-card__progress {
    display: flex;
    align-items: center;
    gap: 8px;
}

.qm-task-card__progress-bar {
    flex: 1;
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
}

.dark .qm-task-card__progress-bar {
    background: #334155;
}

.qm-task-card__progress-fill {
    height: 100%;
    background: linear-gradient(135deg, #7c3aed, #ec4899);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.qm-task-card__progress-text {
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    white-space: nowrap;
}

.dark .qm-task-card__progress-text {
    color: #94a3b8;
}

/* 操作区 */
.qm-task-card__action {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    flex-shrink: 0;
}

.qm-task-card__reward {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 700;
    background: linear-gradient(135deg, #7c3aed, #ec4899);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.qm-task-card__reward i {
    color: #fbbf24;
}

/* 按钮样式 */
.qm-task-card__btn {
    padding: 6px 14px;
    border: none;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #e2e8f0;
    color: #64748b;
}

.dark .qm-task-card__btn {
    background: #334155;
    color: #94a3b8;
}

.qm-task-card__btn:hover {
    background: #cbd5e1;
}

.dark .qm-task-card__btn:hover {
    background: #475569;
}

/* 可领取状态按钮 */
.qm-task-card__btn--claim {
    background: linear-gradient(135deg, #7c3aed, #ec4899);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.35);
}

.qm-task-card__btn--claim:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(124, 58, 237, 0.45);
    background: linear-gradient(135deg, #7c3aed, #ec4899);
}

/* 已领取状态按钮 */
.qm-task-card__btn--disabled {
    background: #10b981;
    color: #ffffff;
    cursor: not-allowed;
    opacity: 0.8;
}

.qm-task-card__btn--disabled:hover {
    background: #10b981;
    transform: none;
}

/* ========== 任务卡片状态样式 ========== */

/* 已完成可领取 */
.qm-task-card--completed {
    border-color: rgba(124, 58, 237, 0.3);
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.06), rgba(236, 72, 153, 0.04));
}

.dark .qm-task-card--completed {
    border-color: rgba(124, 58, 237, 0.5);
    background: rgba(124, 58, 237, 0.15);
}

/* 已领取 */
.qm-task-card--claimed {
    opacity: 0.7;
}

.qm-task-card--claimed .qm-task-card__progress-fill {
    background: #10b981;
}

/* ========== 移动端响应式 ========== */
@media (max-width: 768px) {
    .qm-task-widget {
        border-radius: 12px;
        margin-bottom: 0.75rem;
    }
    
    .qm-task-widget__header {
        padding: 12px 14px;
    }
    
    .qm-task-widget__title {
        font-size: 14px;
    }
    
    .qm-task-widget__streak {
        padding: 3px 8px;
        font-size: 11px;
    }
    
    .qm-task-widget__countdown {
        padding: 6px 14px;
        font-size: 11px;
    }
    
    .qm-task-widget__content {
        padding: 10px;
    }
    
    .qm-task-widget__tabs {
        margin-bottom: 10px;
        padding: 3px;
    }
    
    .qm-task-widget__tab {
        padding: 6px 10px;
        font-size: 12px;
    }
    
    .qm-task-widget__list {
        gap: 8px;
    }
    
    .qm-task-card {
        padding: 10px;
        gap: 10px;
    }
    
    .qm-task-card__icon {
        width: 36px;
        height: 36px;
    }
    
    .qm-task-card__icon i {
        font-size: 14px;
    }
    
    .qm-task-card__name {
        font-size: 13px;
    }
    
    .qm-task-card__desc {
        font-size: 10px;
    }
    
    .qm-task-card__progress-bar {
        height: 5px;
    }
    
    .qm-task-card__progress-text {
        font-size: 10px;
    }
    
    .qm-task-card__reward {
        font-size: 11px;
    }
    
    .qm-task-card__btn {
        padding: 5px 12px;
        font-size: 11px;
    }
}

/* ========== 折叠功能（移动端可选） ========== */
.qm-task-widget--collapsed .qm-task-widget__content {
    display: none;
}

.qm-task-widget--collapsed .qm-task-widget__countdown {
    display: none;
}

.qm-task-widget__toggle {
    display: none;
    width: 24px;
    height: 24px;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.2s ease;
    align-items: center;
    justify-content: center;
}

.qm-task-widget__toggle:hover {
    background: rgba(255, 255, 255, 0.3);
}

.qm-task-widget--collapsed .qm-task-widget__toggle i {
    transform: rotate(180deg);
}

@media (max-width: 768px) {
    .qm-task-widget__toggle {
        display: inline-flex;
    }
    
    .qm-task-widget__header-right {
        gap: 8px;
    }
}

/* ========== Toast 通知样式 ========== */
.qm-task-toast {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    padding: 12px 20px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 10000;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
}

.qm-task-toast.is-visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

.dark .qm-task-toast {
    background: #1e293b;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    color: #f1f5f9;
}

.qm-task-toast i {
    font-size: 18px;
}

/* 成功状态 */
.qm-task-toast--success {
    border-left: 4px solid #10b981;
}

.qm-task-toast--success i {
    color: #10b981;
}

/* 错误状态 */
.qm-task-toast--error {
    border-left: 4px solid #ef4444;
}

.qm-task-toast--error i {
    color: #ef4444;
}

/* 信息状态 */
.qm-task-toast--info {
    border-left: 4px solid #7c3aed;
}

.qm-task-toast--info i {
    color: #7c3aed;
}
