/* 图床系统动画效果 - 修复闪烁版 */

/* 磨砂玻璃效果 */
.glass-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* 页面加载动画 - 减小幅度 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-15px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(15px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

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

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
    }
}

/* 基础动画类 - 移除初始透明度，只在动画执行时应用 */
.animate-fade-in {
    animation: fadeIn 0.4s ease-out both;
}

.animate-slide-in-left {
    animation: slideInLeft 0.4s ease-out both;
}

.animate-slide-in-right {
    animation: slideInRight 0.4s ease-out both;
}

.animate-slide-in-down {
    animation: slideInDown 0.3s ease-out both;
}

.animate-scale-in {
    animation: scaleIn 0.3s ease-out both;
}

.animate-pulse {
    animation: pulse 3s infinite;
}

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

/* 延迟动画 - 减少延迟时间 */
.animate-delay-100 {
    animation-delay: 0.1s;
}

.animate-delay-200 {
    animation-delay: 0.15s;
}

.animate-delay-300 {
    animation-delay: 0.2s;
}

.animate-delay-400 {
    animation-delay: 0.25s;
}

.animate-delay-500 {
    animation-delay: 0.3s;
}

.animate-delay-600 {
    animation-delay: 0.35s;
}

/* 页面容器动画 */
.page-container {
    animation: fadeIn 0.5s ease-out both;
}

/* 导航栏动画 */
.navbar {
    animation: slideInDown 0.4s ease-out both;
}

.navbar a {
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.navbar a::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: -100%;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, #3b82f6, #1d4ed8);
    transition: left 0.2s ease;
}

.navbar a:hover::before {
    left: 0;
}

.navbar a:hover {
    transform: translateY(-1px);
}

/* 卡片动画 - 减小悬停效果 */
.card {
    transition: all 0.2s ease;
    transform: translateY(0);
    border-radius: 12px;
}

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

/* 按钮动画 - 更细腻的效果 */
.btn {
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    border-radius: 8px;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    transition: width 0.4s, height 0.4s;
    transform: translate(-50%, -50%);
    z-index: 0;
}

.btn:hover::before {
    width: 200px;
    height: 200px;
}

.btn:hover {
    transform: translateY(-1px);
}

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

/* 表单输入动画 */
.form-input {
    transition: all 0.2s ease;
    border-radius: 8px;
}

.form-input:focus {
    transform: scale(1.01);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Logo动画 */
.logo {
    animation: scaleIn 0.6s ease-out;
}

.logo i {
    transition: all 0.3s ease;
}

.logo:hover i {
    transform: scale(1.1) rotate(5deg);
}

/* 标题动画 */
.title {
    animation: fadeIn 0.5s ease-out 0.1s both;
}

.description {
    animation: fadeIn 0.5s ease-out 0.2s both;
}

/* 特色功能动画 */
.feature {
    transition: all 0.2s ease;
}

.feature:hover {
    transform: translateY(-3px);
}

.feature:hover .feature-icon {
    transform: scale(1.1);
}

/* 图片预览动画 */
.image-preview {
    transition: all 0.2s ease;
}

.image-preview:hover {
    transform: translateY(-2px);
}

.image-preview img {
    transition: transform 0.3s ease;
}

.image-preview:hover img {
    transform: scale(1.05);
}

/* 图片项动画 */
.image-item {
    transition: all 0.2s ease;
}

.image-item:hover {
    transform: translateY(-2px);
}

/* 模态框动画 */
.modal {
    transition: opacity 0.2s ease;
}

.modal-content {
    animation: scaleIn 0.3s ease-out;
}

/* 加载动画 */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.loading-spinner {
    animation: spin 1s linear infinite;
}

/* 进度条动画 */
@keyframes progressFill {
    from { width: 0%; }
}

.progress-bar {
    animation: progressFill 0.5s ease-out;
    transition: width 0.3s ease;
}

/* 统计数字动画 */
@keyframes countUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stat-number {
    animation: countUp 0.6s ease-out;
}

/* 上传区域动画 */
.upload-area {
    transition: all 0.2s ease;
}

.upload-area.drag-over {
    transform: scale(1.01);
    border-color: #3b82f6;
    background-color: #eff6ff;
}

/* 通知动画 */
@keyframes slideInTop {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.notification {
    animation: slideInTop 0.3s ease-out;
}

/* 表格行动画 */
.table-row {
    transition: background-color 0.1s ease;
}

.table-row:hover {
    background-color: #f8fafc;
}

/* 表格优化 */
.table-fixed {
    table-layout: fixed;
}

.table-fixed th,
.table-fixed td {
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 响应式表格优化 */
@media (max-width: 640px) {
    .table-fixed {
        font-size: 0.875rem;
    }
    
    .table-fixed th,
    .table-fixed td {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
}

/* 标签动画 */
.tag {
    transition: all 0.1s ease;
}

.tag:hover {
    transform: scale(1.05);
}

/* 侧边栏动画 */
.sidebar {
    transition: all 0.2s ease;
}

.sidebar-item {
    transition: all 0.1s ease;
}

.sidebar-item:hover {
    transform: translateX(3px);
    background-color: rgba(59, 130, 246, 0.1);
}

/* 移动端优化 */
@media (max-width: 768px) {
    /* 减少移动端的动画幅度 */
    .card:hover {
        transform: translateY(-1px);
    }
    
    .btn:hover {
        transform: translateY(-0.5px);
    }
    
    .feature:hover {
        transform: translateY(-1px);
    }
    
    .image-preview:hover {
        transform: translateY(-1px);
    }
    
    .image-item:hover {
        transform: translateY(-1px);
    }
    
    /* 禁用一些可能影响性能的悬停效果 */
    .navbar a:hover {
        transform: none;
    }
    
    .form-input:focus {
        transform: none;
    }
    
    .upload-area.drag-over {
        transform: none;
    }
}

/* 减少动画偏好设置 */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* 深色模式适配 */
@media (prefers-color-scheme: dark) {
    .card:hover {
        box-shadow: 0 8px 20px -4px rgba(0, 0, 0, 0.3), 0 6px 8px -4px rgba(0, 0, 0, 0.2);
    }
    
    .table-row:hover {
        background-color: rgba(255, 255, 255, 0.05);
    }
} 