@tailwind base;
@tailwind components;
@tailwind utilities;

@layer utilities {
    .text-shadow {
        text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }
    .transition-all-300 {
        transition: all 0.3s ease;
    }
    
    /* 暗色模式样式 */
    .dark {
        @apply bg-dark-bg text-dark-textDark;
    }
    
    .dark .bg-white {
        @apply bg-dark-card;
    }
    
    .dark .text-textDark {
        @apply text-dark-textDark;
    }
    
    .dark .text-textMedium {
        @apply text-dark-textMedium;
    }
    
    .dark .text-textLight {
        @apply text-dark-textLight;
    }
    
    .dark .border-borderColor {
        @apply border-dark-borderColor;
    }
    
    .dark .bg-gray-50 {
        @apply bg-dark-card;
    }
    
    .dark .shadow-card {
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    }
    
    /* 头像动画效果选项 */
    /* 选项1: 轻微浮动效果 */
    .avatar-float {
        animation: float 3s ease-in-out infinite;
    }
    
    @keyframes float {
        0% { transform: translateY(0px); }
        50% { transform: translateY(-10px); }
        100% { transform: translateY(0px); }
    }
    
    /* 选项2: 缩放脉冲效果 */
    .avatar-pulse {
        animation: pulse 2s infinite;
    }
    
    @keyframes pulse {
        0% { transform: scale(1); }
        50% { transform: scale(1.05); }
        100% { transform: scale(1); }
    }
    
    /* 选项3: 旋转效果 */
    .avatar-rotate {
        animation: rotate 10s linear infinite;
    }
    
    @keyframes rotate {
        0% { transform: rotate(0deg); }
        100% { transform: rotate(360deg); }
    }
    
    /* 选项4: 摇摆效果 */
    .avatar-sway {
        animation: sway 4s ease-in-out infinite;
    }
    
    @keyframes sway {
        0% { transform: rotate(0deg); }
        25% { transform: rotate(5deg); }
        75% { transform: rotate(-5deg); }
        100% { transform: rotate(0deg); }
    }
    
    /* 选项5: 呼吸效果 */
    .avatar-breathe {
        animation: breathe 3s ease-in-out infinite;
    }
    
    @keyframes breathe {
        0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(24, 144, 255, 0.4); }
        50% { transform: scale(1.02); box-shadow: 0 0 0 10px rgba(24, 144, 255, 0); }
        100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(24, 144, 255, 0); }
    }

    /* 标题美化 */
    .page-title {
        background: linear-gradient(135deg, #1890ff, #52c41a);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
        font-weight: 800;
        letter-spacing: 1px;
        text-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }

    /* 优化的动画类 */
    .animate-bounce-light {
        animation: bounce-light 0.5s ease;
    }
    
    @keyframes bounce-light {
        0%, 100% { transform: scale(1); }
        50% { transform: scale(1.05); }
    }
    
    /* 淡入动画 */
    .animate-fade-in-up {
        animation: fadeInUp 0.6s ease-out;
    }
    
    @keyframes fadeInUp {
        from {
            opacity: 0;
            transform: translateY(20px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
    
    /* 脉冲动画 */
    .animate-pulse-slow {
        animation: pulseSlow 2s infinite;
    }
    
    @keyframes pulseSlow {
        0%, 100% { opacity: 1; }
        50% { opacity: 0.7; }
    }
    
    /* 按钮按压效果 */
    .btn-press:active {
        transform: scale(0.98);
    }
    
    /* 按钮悬停效果 */
    .btn-hover-animate {
        transition: all 0.3s ease;
    }
    
    .btn-hover-animate:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
    }
    
    /* 缩放动画 */
    .shake {
        animation: scale 0.5s ease-in-out both;
    }
    
    @keyframes scale {
        0%, 100% { transform: scale(1); }
        50% { transform: scale(1.05); }
    }
    
    /* 移动端优化 */
    @media (max-width: 640px) {
        .p-6 {
            padding: 1rem;
        }
        
        .text-3xl {
            font-size: 1.5rem;
            line-height: 2rem;
        }
        
        .pt-14 {
            padding-top: 4rem;
        }
        
        .w-28 {
            width: 6rem;
        }
        
        .h-28 {
            height: 6rem;
        }
        
        .mb-5 {
            margin-bottom: 1rem;
        }
        
        .gap-3 > * {
            margin-bottom: 0.5rem;
        }
    }
}