/* Tailwind CSS v3 */
@import url('https://cdn.tailwindcss.com');

/* Font Awesome */
@import url('https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/css/font-awesome.min.css');

/* 自定义 Tailwind 配置 */
@tailwind base;
@tailwind components;
@tailwind utilities;

@layer utilities {
    .content-auto {
        content-visibility: auto;
    }
    
    .shadow-hover {
        transition: all 0.3s ease;
    }
    
    .shadow-hover:hover {
        transform: translateY(-2px);
        box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    }
    
    .bg-gradient-primary {
        background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
    }
    
    .text-shadow {
        text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }
    
    .transition-all-300 {
        transition: all 0.3s ease;
    }
    
    .hover-scale {
        transition: transform 0.3s ease;
    }
    
    .hover-scale:hover {
        transform: scale(1.02);
    }
    
    .glass-effect {
        background: rgba(255, 255, 255, 0.9);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }
    
    .scrollbar-hide::-webkit-scrollbar {
        display: none;
    }
    
    .scrollbar-hide {
        -ms-overflow-style: none;
        scrollbar-width: none;
    }
    
    .line-clamp-2 {
        overflow: hidden;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
    }
    
    .line-clamp-3 {
        overflow: hidden;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 3;
    }
}

/* 自定义动画 */
@keyframes fadeIn {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

@keyframes slideUp {
    0% { transform: translateY(20px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

@keyframes slideDown {
    0% { transform: translateY(-20px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

@keyframes slideLeft {
    0% { transform: translateX(20px); opacity: 0; }
    100% { transform: translateX(0); opacity: 1; }
}

@keyframes slideRight {
    0% { transform: translateX(-20px); opacity: 0; }
    100% { transform: translateX(0); opacity: 1; }
}

@keyframes bounceGentle {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

@keyframes pulse-slow {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* 全局样式 */
body {
    font-family: 'Inter', 'Noto Sans SC', 'system-ui', 'sans-serif';
    scroll-behavior: smooth;
}

/* 模态框动画 */
.modal-enter {
    animation: fadeIn 0.3s ease-out;
}

.modal-exit {
    animation: fadeIn 0.3s ease-in reverse;
}

/* 卡片悬停效果 */
.news-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.news-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* 按钮动画 */
.btn-primary {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: all 0.6s ease;
}

.btn-primary:hover::before {
    left: 100%;
}

/* 输入框聚焦效果 */
.input-focus:focus {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3);
}

/* 加载动画 */
.loading-spinner {
    border: 3px solid rgba(59, 130, 246, 0.1);
    border-radius: 50%;
    border-top: 3px solid #3b82f6;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
}

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

/* 响应式导航 */
@media (max-width: 768px) {
    .mobile-nav {
        transform: translateX(-100%);
        transition: transform 0.3s ease-in-out;
    }
    
    .mobile-nav.open {
        transform: translateX(0);
    }
}

/* 医疗器械卡片样式 */
.drug-card {
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.drug-card:hover {
    border-color: #3b82f6;
    transform: translateY(-2px);
}

/* 标签页样式 */
.tab-active {
    background-color: #1e40af;
    color: white;
}

.tab-inactive {
    background-color: white;
    color: #64748b;
    transition: all 0.3s ease;
}

.tab-inactive:hover {
    background-color: #f1f5f9;
}

/* 通知提示样式 */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    animation: slideInRight 0.3s ease-out;
}

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

/* 骨架屏样式 */
.skeleton {
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}