/* 资源需求页面样式 */

/* 上传区域动画 */
.upload-area {
    position: relative;
    overflow: hidden;
}

.upload-area::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent,
        rgba(255, 255, 255, 0.03),
        transparent
    );
    transform: rotate(0deg);
    opacity: 0;
    transition: opacity 0.3s;
}

.upload-area:hover::before {
    opacity: 1;
    animation: uploadSweep 3s linear infinite;
}

@keyframes uploadSweep {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 拖拽状态 */
.upload-area.drag-over label {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    transform: scale(1.02);
}

/* 图片预览 */
.image-preview {
    position: relative;
    display: inline-block;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.image-preview img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.image-preview .remove-btn {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 24px;
    height: 24px;
    background: rgba(220, 38, 38, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    backdrop-filter: blur(10px);
}

.image-preview .remove-btn:hover {
    transform: scale(1.1);
    background: rgba(220, 38, 38, 1);
}

/* 需求卡片 */
.request-card {
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.request-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.05),
        transparent
    );
    transition: left 0.5s;
}

.request-card:hover::before {
    left: 100%;
}

.request-card:hover {
    transform: translateX(4px);
    border-color: rgba(255, 255, 255, 0.15);
}

/* 状态标签 */
.status-badge {
    position: relative;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    border-radius: 9999px;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    transition: all 0.2s;
}

.status-badge.pending {
    background: rgba(251, 191, 36, 0.1);
    color: rgb(251, 191, 36);
    border: 1px solid rgba(251, 191, 36, 0.2);
}

.status-badge.completed {
    background: rgba(34, 197, 94, 0.1);
    color: rgb(34, 197, 94);
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.status-badge.rejected {
    background: rgba(239, 68, 68, 0.1);
    color: rgb(239, 68, 68);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.status-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* 加载动画 */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    border-top-color: rgba(255, 255, 255, 0.6);
    animation: spin 0.8s linear infinite;
}

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

/* 成功提示动画 */
.success-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: 1rem;
    padding: 2rem 3rem;
    text-align: center;
    z-index: 1000;
    opacity: 0;
    animation: successPop 0.5s ease-out forwards;
}

@keyframes successPop {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }
    50% {
        transform: translate(-50%, -50%) scale(1.05);
    }
    100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.success-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 1rem;
    background: rgba(34, 197, 94, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: successIconPulse 0.5s ease-out 0.3s;
}

@keyframes successIconPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* 响应式优化 */
@media (max-width: 768px) {
    .request-card {
        padding: 1rem;
    }
    
    .upload-area label {
        padding: 1.5rem;
    }
    
    .success-message {
        width: 90%;
        padding: 1.5rem;
    }
}

/* 深色模式优化 */
@media (prefers-color-scheme: dark) {
    .upload-area label {
        background: rgba(255, 255, 255, 0.03);
    }
}

/* 流光按钮增强 */
.flow-border {
    position: relative;
    background: rgba(255, 255, 255, 0.05);
    overflow: hidden;
}

.flow-border::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(
        45deg,
        transparent,
        rgba(255, 255, 255, 0.4),
        transparent
    );
    opacity: 0;
    transition: opacity 0.3s;
    border-radius: inherit;
}

.flow-border:hover::after {
    opacity: 1;
    animation: flowRotate 3s linear infinite;
}

@keyframes flowRotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 骨架屏动画 */
.skeleton-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 0.5rem;
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
}

.skeleton-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.08),
        transparent
    );
    animation: skeletonWave 1.5s infinite;
}

@keyframes skeletonWave {
    0% { left: -100%; }
    100% { left: 100%; }
}

.skeleton-line {
    height: 1rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 0.25rem;
    margin-bottom: 0.75rem;
}

.skeleton-line:last-child {
    margin-bottom: 0;
    width: 60%;
}

/* 处理原因在卡片中的样式 */
.request-card .line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.request-card .line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 详情弹窗中的处理结果样式增强 */
.request-detail .whitespace-pre-wrap {
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* 图片点击提示 */
#request-detail-modal img[onclick] {
    transition: transform 0.2s, opacity 0.2s;
}

#request-detail-modal img[onclick]:hover {
    transform: scale(1.02);
    opacity: 0.9;
}

/* 处理状态动画增强 */
.status-badge.pending::before {
    animation: pulse 2s infinite;
}

.status-badge.completed::before {
    background: currentColor;
    animation: none;
}

.status-badge.rejected::before {
    background: currentColor;
    animation: none;
}

/* 我的需求特殊标识 */
.request-card[data-my="true"]::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 0;
    height: 0;
    border-left: 15px solid transparent;
    border-top: 15px solid rgba(59, 130, 246, 0.6);
    border-top-right-radius: 8px;
}

/* 响应式优化 */
@media (max-width: 768px) {
    .request-card .line-clamp-2 {
        -webkit-line-clamp: 3;
    }
    
    .status-badge {
        font-size: 0.7rem;
        padding: 0.2rem 0.5rem;
    }
}