body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f4f4f4;
}

header {
    background-color: #333;
    color: #fff;
    padding: 20px 0;
    text-align: center;
}

main {
    padding: 20px;
    padding-bottom: 40px; /* 增加底部内边距 */
    min-height: calc(100vh - 200px); /* 确保主内容区域有最小高度 */
}

.resource-pack {
    display: flex;
    background-color: #fff;
    margin-bottom: 20px;
    padding: 10px;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    gap: 20px; /* 添加元素之间的间距 */
    align-items: flex-start; /* 让元素从顶部对齐 */
}

.pack-image {
    width: 200px;
    height: auto;
    border-radius: 5px;
    flex-shrink: 0;
    image-rendering: pixelated; /* 添加像素化渲染 */
    image-rendering: -moz-crisp-edges; /* Firefox */
    image-rendering: crisp-edges; /* Safari */
}

.pack-info {
    flex: 1; /* 让信息区域占据剩余空间 */
    margin-left: 0; /* 移除原有的左边距 */
}

.pack-info h2 {
    margin: 0 0 10px 0;
    font-size: 1.5em;
}

.pack-info a {
    text-decoration: none;
    color: #007BFF;
    font-weight: bold;
}

.pack-info a:hover {
    text-decoration: underline;
}

/* 演示图片的布局 */
.pack-previews {
    display: flex;
    gap: 15px;
    flex: 2;
    justify-content: flex-end;
}

.pack-previews img {
    width: 400px;
    height: 300px;
    object-fit: cover;
    border-radius: 5px;
    cursor: pointer;
    transition: transform 0.3s;
    image-rendering: pixelated; /* 添加像素化渲染 */
    image-rendering: -moz-crisp-edges; /* Firefox */
    image-rendering: crisp-edges; /* Safari */
}

/* 添加工具提示样式 */
.pack-previews .preview-wrapper {
    position: relative;
    display: inline-block;
}

.pack-previews .preview-wrapper:hover::after {
    content: "单击图片放大";
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 14px;
    white-space: nowrap;
}

/* 添加图片放大相关样式 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    cursor: pointer;
}

.modal-content {
    max-width: 90%;
    max-height: 90vh;
    margin: auto;
    display: block;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

/* 更新响应式设计 */
@media (max-width: 1440px) {
    .pack-previews img {
        width: 350px;
        height: 260px;
    }
}

@media (max-width: 1200px) {
    .pack-previews img {
        width: 300px;
        height: 225px;
    }
}

@media (max-width: 1024px) {
    .resource-pack {
        flex-wrap: wrap;
    }
    
    .pack-previews {
        flex-basis: 100%;
        justify-content: center;
    }
    
    .pack-previews img {
        width: 320px;
        height: 240px;
    }
}

@media (max-width: 768px) {
    .pack-previews img {
        width: 280px;
        height: 210px;
    }
}

@media (max-width: 600px) {
    .pack-previews img {
        width: 240px;
        height: 180px;
    }
}

footer {
    background-color: #333;
    color: #fff;
    text-align: center;
    padding: 10px 0;
    margin-top: 20px; /* 添加上边距 */
    position: relative; /* 改为相对定位，不再固定在底部 */
    width: 100%;
}

/* 添加搜索框样式 */
.search-container {
    text-align: center;
    padding: 20px;
    background-color: #fff;
    margin-bottom: 20px;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

#searchInput {
    width: 80%;
    max-width: 600px;
    padding: 12px 20px;
    margin: 8px 0;
    border: 2px solid #ddd;
    border-radius: 25px;
    font-size: 16px;
    outline: none;
    transition: border-color 0.3s;
}

#searchInput:focus {
    border-color: #007BFF;
}

#searchInput::placeholder {
    color: #999;
}

/* 添加分页样式 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 20px 0;
    gap: 20px;
}

.pagination button {
    padding: 8px 16px;
    background-color: #007BFF;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.pagination button:hover {
    background-color: #0056b3;
}

.pagination button:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

.pagination #pageInfo {
    font-size: 16px;
    color: #333;
}
