/* 自定义样式 */

/* 文字截断 */
.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes bounceGentle {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-4px);
    }
    60% {
        transform: translateY(-2px);
    }
}

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

.animate-slide-up {
    animation: slideUp 0.4s ease-out;
}

.animate-bounce-gentle {
    animation: bounceGentle 0.6s ease-in-out;
}

/* 悬停效果 */
.hover-lift {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

/* 卡片样式 */
.content-card {
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}

.content-card:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

/* 懒加载图片样式 */
.lazy-image {
    opacity: 0;
    transition: opacity 0.5s ease, transform 0.3s ease;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    transform: scale(0.98);
}

.lazy-image.loaded {
    opacity: 1;
    transform: scale(1);
    animation: none;
    background: none;
}

/* 图片容器 */
.image-container {
    position: relative;
    overflow: hidden;
}

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

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

/* 复制按钮效果 */
.copy-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    cursor: pointer;
    pointer-events: none; /* 防止浮层阻挡点击 */
}

/* 悬停时显示浮层，但点击穿透到图片 */
.image-container:hover .copy-overlay {
    opacity: 1;
}

.copy-text-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(59, 130, 246, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
    border-radius: 0.5rem;
    pointer-events: none; /* 防止浮层阻挡点击 */
}

/* 悬停时显示浮层，但点击穿透到文字内容 */
.content-card:hover .copy-text-overlay {
    opacity: 1;
}

/* 标签样式 */
.tag-button {
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
    border: 1px solid #d1d5db;
}

.tag-button.active {
    background-color: #3b82f6;
    color: white;
    border-color: #3b82f6;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

.tag-button.inactive {
    background-color: white;
    color: #6b7280;
    border-color: #d1d5db;
}

.tag-button.inactive:hover {
    background-color: #f9fafb;
    border-color: #9ca3af;
}

/* 响应式优化 */
@media (max-width: 640px) {
    .content-card {
        margin: 0 0.5rem;
    }
    
    #tag-filter .flex {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    #tag-buttons {
        width: 100%;
    }
}

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

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

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

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

/* Toast 提示样式 */
#copy-toast {
    animation: slideInRight 0.3s ease-out;
}

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

/* 加载状态样式 */
.loading-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;
    }
} 