/* 全局样式 */
body {
    font-family: 'Arial', sans-serif;
    margin: 0;
    padding: 0;
    background: linear-gradient(135deg, #6e8efb, #a777e3);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    text-align: center;
    padding-bottom: 80px;
}

h1 {
    color: #fff;
    font-size: 2.5em;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

/* 搜索栏 */
.search-bar {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 30px;
}

#searchBox {
    padding: 12px 20px;
    width: 150px;
    border: none;
    border-radius: 25px;
    font-size: 1em;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    outline: none;
    transition: all 0.3s ease;
}

#searchBox:focus {
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

button {
    padding: 12px 25px;
    background-color: #ff6f61;
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1em;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

/* 资源列表 */
.resource-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    padding: 20px;
}

.resource-item {
    background: white;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    text-align: left;
}

.resource-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

/* 资源详情页 */
.resource-card {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    max-width: 600px;
    margin: 20px auto;
    text-align: left;
}

/* 下载按钮 */
.download-btn {
    display: inline-block;
    padding: 15px 30px;
    background: linear-gradient(135deg, #28c76f, #81fbb8);
    color: white;
    text-decoration: none;
    border-radius: 30px;
    font-size: 1.1em;
    font-weight: bold;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    margin-bottom: 10px;
}

.download-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

/* Custom back arrow icon */
.back-arrow {
    display: inline-block;
    color: #ff6f61;
    font-size: 1.2em;
    margin-right: 5px;
    vertical-align: middle;
}

.back-arrow::before {
    content: '\2190'; /* Unicode for left arrow */
}

.back-btn {
    display: inline-flex;
    align-items: center;
    padding: 10px 20px;
    background: linear-gradient(135deg, #6e8efb, #a777e3);
    color: white;
    text-decoration: none;
    border-radius: 20px;
    font-size: 1em;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.back-btn:hover {
    transform: translateX(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

/* 未找到资源提示 */
.no-result {
    background: rgba(255, 255, 255, 0.9);
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    color: #ff6f61;
    font-size: 1.2em;
    text-align: center;
    margin: 20px;
}

/* 分页样式 - 固定底部 */
.pagination {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.9);
    padding: 10px 20px;
    border-radius: 25px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.pagination button {
    padding: 8px 15px;
    background-color: #ff6f61;
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pagination button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

.pagination span {
    color: #333;
    font-size: 1em;
}

/* 响应式设计 */
@media (max-width: 600px) {
    .search-bar {
        flex-direction: column;
        align-items: center;
    }
    #searchBox, button {
        width: 100%;
        max-width: 150px;
    }
    h1 {
        font-size: 1.8em;
    }
    .pagination {
        flex-direction: row;
        gap: 5px;
        padding: 5px 10px;
    }
    .pagination button {
        padding: 6px 12px;
        font-size: 0.9em;
    }
    .pagination span {
        font-size: 0.9em;
    }
    .download-btn {
        padding: 15px 30px;
        background: linear-gradient(135deg, #28c76f, #81fbb8);
        color: white;
        text-decoration: none;
        border-radius: 30px;
        font-size: 1.1em;
        font-weight: bold;
        box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
        transition: transform 0.3s ease, box-shadow 0.3s ease;
        margin-bottom: 10px;
        text-align: center; /* 确保文字居中 */
    }
    .back-btn {
        padding: 8px 15px;
        font-size: 0.9em;
    }
}

/* Updated Modal styles */
.modal {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 1; /* Sit on top */
    left: 0;
    top: 0;
    width: 100%; /* Full width */
    height: 100%; /* Full height */
    overflow: auto; /* Enable scroll if needed */
    background-color: rgb(0,0,0); /* Fallback color */
    background-color: rgba(0,0,0,0.4); /* Black w/ opacity */
}

.modal-content {
    background-color: #fff;
    margin: 15% auto;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    width: 80%;
    max-width: 400px;
    text-align: center;
}

.close-button {
    color: #ff6f61;
    float: right;
    font-size: 20px;
    font-weight: normal;
    cursor: pointer;
    padding: 0 10px;
}

.close-button:hover,
.close-button:focus {
    color: #333;
}

.modal-content p {
    font-size: 1.2em;
    color: #333;
    margin: 20px 0;
}

@media screen and (max-width: 600px) {
    .modal-content {
        width: 90%;
    }
}

.modal-close-btn {
    display: block;
    margin: 20px auto 0; /* 使按钮居中并偏下 */
    padding: 10px 20px;
    background-color: #ff6f61; /* 使用网页主题色 */
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1em;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.modal-close-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}