/* 自定义样式 */
.news-card {
    @apply bg-white rounded-lg shadow-md hover:shadow-xl transition-all duration-300 overflow-hidden;
    transform: translateY(0);
}

.news-card:hover {
    transform: translateY(-4px);
}

.news-image {
    @apply w-full h-48 object-cover;
}

.news-content {
    @apply p-6;
}

.news-title {
    @apply text-xl font-bold text-gray-900 mb-2 line-clamp-2;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-summary {
    @apply text-gray-600 mb-4 line-clamp-3;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-meta {
    @apply flex items-center justify-between text-sm text-gray-500;
}

.news-category {
    @apply inline-block px-3 py-1 bg-blue-100 text-blue-800 rounded-full text-xs font-medium;
}

.news-stats {
    @apply flex items-center space-x-4;
}

.news-stat {
    @apply flex items-center space-x-1;
}

.tag {
    @apply inline-block px-2 py-1 bg-gray-100 text-gray-700 rounded text-xs mr-2 mb-2;
}

.btn {
    @apply px-4 py-2 rounded-lg font-medium transition-colors duration-200;
}

.btn-primary {
    @apply bg-blue-600 text-white hover:bg-blue-700;
}

.btn-secondary {
    @apply bg-gray-200 text-gray-700 hover:bg-gray-300;
}

.btn-outline {
    @apply border border-gray-300 text-gray-700 hover:bg-gray-50;
}

.pagination-btn {
    @apply px-3 py-2 mx-1 rounded-lg transition-colors duration-200;
}

.pagination-btn.active {
    @apply bg-blue-600 text-white;
}

.pagination-btn:not(.active) {
    @apply bg-white text-gray-700 border border-gray-300 hover:bg-gray-50;
}

.pagination-btn:disabled {
    @apply opacity-50 cursor-not-allowed;
}

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

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

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

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .news-card {
        @apply mb-4;
    }
    
    .news-stats {
        @apply flex-col items-start space-x-0 space-y-2;
    }
    
    .search-input {
        @apply w-full;
    }
}

/* 卡片进入动画 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.5s ease-out;
}

/* 搜索高亮 */
.highlight {
    background-color: #fef3c7;
    padding: 2px 4px;
    border-radius: 2px;
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* 返回顶部按钮动画 */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

.bounce {
    animation: bounce 2s infinite;
}

/* 文章内容样式 */
.article-content {
    @apply prose prose-lg max-w-none;
}

.article-content h1,
.article-content h2,
.article-content h3 {
    @apply font-bold text-gray-900 mb-4;
}

.article-content p {
    @apply mb-4 leading-relaxed;
}

.article-content img {
    @apply rounded-lg shadow-md my-6;
}

/* 标签云 */
.tag-cloud {
    @apply flex flex-wrap gap-2;
}

/* 统计卡片动画 */
.stat-card {
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* 搜索框样式 */
.search-container {
    position: relative;
}

.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e5e7eb;
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 10;
}

.search-suggestion {
    padding: 8px 12px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.search-suggestion:hover {
    background-color: #f3f4f6;
}

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

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

.skeleton-text {
    @apply rounded;
    height: 1rem;
    margin-bottom: 0.5rem;
}

.skeleton-title {
    @apply rounded;
    height: 1.5rem;
    margin-bottom: 1rem;
}

.skeleton-image {
    @apply rounded;
    height: 12rem;
    margin-bottom: 1rem;
}
