/* 全局样式 */
::selection {
    background: rgba(59, 130, 246, 0.1);
}

/* 拖拽区域样式 */
.upload-zone {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.upload-zone::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom right, rgba(59, 130, 246, 0.05), rgba(99, 102, 241, 0.05));
    border-radius: inherit;
    z-index: -1;
}

.upload-zone.drag-over {
    transform: scale(1.01);
    background: linear-gradient(to bottom right, rgba(59, 130, 246, 0.1), rgba(99, 102, 241, 0.1));
    border-color: rgba(59, 130, 246, 0.5);
}

/* 结果卡片样式 */
.result-card {
    position: relative;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(8px);
    border-radius: 1rem;
    border: 1px solid rgba(229, 231, 235, 0.5);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.result-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom right, rgba(59, 130, 246, 0.05), rgba(99, 102, 241, 0.05));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.result-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.result-card:hover::before {
    opacity: 1;
}

.result-card img {
    width: 100%;
    height: 200px;
    object-fit: contain;
    background: rgba(249, 250, 251, 0.8);
    backdrop-filter: blur(4px);
}

.result-card .overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    border-top: 1px solid rgba(229, 231, 235, 0.5);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.result-card:hover .overlay {
    transform: translateY(0);
}

/* 进度条动画 */
@keyframes progress {
    0% {
        background-position: 0 0;
    }
    100% {
        background-position: 30px 0;
    }
}

.processing .progress-bar {
    background-size: 30px 30px;
    background-image: linear-gradient(
        45deg,
        rgba(255, 255, 255, 0.15) 25%,
        transparent 25%,
        transparent 50%,
        rgba(255, 255, 255, 0.15) 50%,
        rgba(255, 255, 255, 0.15) 75%,
        transparent 75%,
        transparent
    );
    animation: progress 1s linear infinite;
}

/* 错误提示样式 */
.error-message {
    background: rgba(254, 226, 226, 0.8);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: rgb(220, 38, 38);
    padding: 0.75rem;
    border-radius: 0.75rem;
    margin-bottom: 1rem;
    transform: translateY(-0.5rem);
    animation: slideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-1rem);
    }
    to {
        opacity: 1;
        transform: translateY(-0.5rem);
    }
}

/* 禁用状态样式 */
.disabled {
    opacity: 0.5;
    pointer-events: none;
    filter: grayscale(100%);
}

/* 加载中状态 */
.loading {
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: inherit;
}

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

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

.animate-fade-in {
    animation: fade-in 0.3s ease-out forwards;
}

.animate-fade-out {
    animation: fade-out 0.3s ease-out forwards;
}

/* 上传区域动画 */
#dropZone {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#dropZone:hover {
    border-color: rgba(59, 130, 246, 0.5);
    background-color: rgba(59, 130, 246, 0.02);
}

/* 进度条动画 */
#progressBar {
    transition: width 0.3s ease-in-out;
}

/* 结果卡片动画 */
.result-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.result-card:hover {
    transform: translateY(-2px);
}

/* 预览模态框动画 */
#previewModal {
    transition: opacity 0.3s ease-out;
}

#previewModal.hidden {
    opacity: 0;
    pointer-events: none;
}

#previewModal:not(.hidden) {
    opacity: 1;
}

#previewImage {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 设置模态框动画 */
#settingsModal {
    transition: opacity 0.3s ease-out;
}

#settingsModal.hidden {
    opacity: 0;
    pointer-events: none;
}

#settingsModal:not(.hidden) {
    opacity: 1;
}

/* 按钮动画 */
button {
    transition: all 0.2s ease-out;
}

button:active {
    transform: scale(0.98);
}

/* 自定义滚动条 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.2);
} 