/* 基础样式设置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'PingFang SC', sans-serif;
    background-color: #0A1F3D;
    color: #FFFFFF;
    line-height: 1.6;
    overflow-x: hidden; /* 防止水平滚动条 */
}

/* 头部样式 */
.header {
    text-align: center;
    padding: 60px 20px;
    background: linear-gradient(180deg, rgba(10,31,61,0.8) 0%, rgba(10,31,61,1) 100%);
    overflow: hidden; /* 防止子元素动画导致溢出 */
    width: 100%;
}

.main-title {
    font-size: 36px;
    font-weight: bold;
    margin-bottom: 15px;
    text-shadow: 0 0 10px rgba(74,144,226,0.3);
    animation: titlePulse 2s infinite ease-in-out;
    letter-spacing: 2px;
}

.sub-title {
    font-size: 18px;
    color: #CCCCCC;
    margin-bottom: 8px;
    animation: fadeIn 1s ease-out;
}

.description {
    font-size: 14px;
    color: #CCCCCC;
    animation: fadeIn 1s ease-out;
}

/* 添加标题动画 */
@keyframes titlePulse {
    0% {
        transform: scale(1) translateZ(0); /* 添加 translateZ 启用 GPU 加速 */
        text-shadow: 0 0 10px rgba(74,144,226,0.3);
    }
    50% {
        transform: scale(1.05) translateZ(0);
        text-shadow: 0 0 20px rgba(74,144,226,0.5);
    }
    100% {
        transform: scale(1) translateZ(0);
        text-shadow: 0 0 10px rgba(74,144,226,0.3);
    }
}

/* 为其他元素添加渐入动画 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px) translateZ(0);
    }
    to {
        opacity: 1;
        transform: translateY(0) translateZ(0);
    }
}

/* 搜索区域样式 */
.search-section {
    padding: 20px;
    max-width: 800px;
    margin: 0 auto;
}

.search-container {
    display: flex;
    gap: 10px;
}

.search-input {
    width: 100%;
    padding: 12px 20px;
    border-radius: 8px;
    border: 1px solid #4A90E2;
    background-color: #2A3F5F;
    color: #FFFFFF;
    font-size: 16px;
    transition: all 0.3s ease;
    box-shadow: 0 0 0 rgba(74,144,226,0);
}

.search-input:focus {
    outline: none;
    border-color: #6BB9F0;
    box-shadow: 0 0 15px rgba(74,144,226,0.3);
}

/* 资源分区样式 */
.resource-section {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
}

.section-title {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 20px;
}

.category-tags {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.category-tag {
    padding: 8px 20px;
    border: none;
    border-radius: 6px;
    background-color: #2A3F5F;
    color: #4A90E2;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}

.category-tag::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255,255,255,0.1),
        transparent
    );
    transition: 0.5s;
}

.category-tag:hover::after {
    left: 100%;
}

.category-tag.active {
    border: 2px solid #0A1F3D;
    background-color: #4A90E2;
    color: #FFFFFF;
}

.resource-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    padding: 10px;
}

.resource-card {
    background-color: #2A3F5F;
    border: 1px solid #4A90E2;
    border-radius: 8px;
    overflow: hidden; /* 确保图片不会溢出圆角 */
    transition: all 0.3s ease;
    transform: translateY(0) translateZ(0);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.resource-card:hover {
    transform: translateY(-5px) translateZ(0);
    box-shadow: 0 8px 15px rgba(0,0,0,0.2);
    background-color: #3A4F6F;
}

.card-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 15px;
}

.download-btn {
    padding: 8px 20px;
    border: none;
    border-radius: 4px;
    background-color: #4A90E2;
    color: #FFFFFF;
    cursor: pointer;
    transition: all 0.2s;
}

.download-btn:hover {
    background-color: #6BB9F0;
    transform: translateY(-2px);
}

.download-btn:active {
    transform: translateY(0) scale(0.98);
}

/* 底部样式 */
.footer {
    text-align: center;
    padding: 40px 20px;
    margin-top: 60px;
}

.copyright {
    font-size: 12px;
    color: #CCCCCC;
    margin-bottom: 10px;
}

.update-info {
    font-size: 14px;
    color: #CCCCCC;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .search-container {
        flex-direction: column;
    }
    
    .search-button {
        width: 100%;
    }
    
    .resource-grid {
        grid-template-columns: 1fr;
    }

    .resource-image {
        height: 180px;
    }
}

/* 资源统计信息 */
.resource-stats {
    display: none;
}

/* 删除所有评论相关样式 */
.comment-btn,
.comments-section,
.comments-list,
.comment,
.comment-header,
.comment-content,
.comment-form {
    display: none;
}

/* 添加加载状态样式 */
.loading {
    text-align: center;
    padding: 40px;
    color: #4A90E2;
    font-size: 16px;
    grid-column: 1 / -1;
}

/* 修改图片容器样式 */
.resource-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    position: relative;
    background-color: #1a2f4f;
}

.resource-image::before {
    content: '加载中...';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #4A90E2;
    font-size: 14px;
}

.resource-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    position: relative;
    z-index: 1;
}

.resource-card:hover .resource-image img {
    transform: scale(1.05);
}

/* 内容区域样式 */
.resource-content {
    padding: 20px;
}

.resource-content h3 {
    margin-bottom: 10px;
    font-size: 18px;
    color: #FFFFFF;
}

.resource-content p {
    margin-bottom: 15px;
    color: #CCCCCC;
    font-size: 14px;
    line-height: 1.5;
} 