.search-container {
    display: flex;
    justify-content: center;
    margin-top: 1rem;
}

#search-input {
    width: 30%; /* 调整宽度为30% */
    padding: 0.5rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
}

#search-button {
    padding: 0.5rem 1rem;
    margin-left: 0.5rem;
    border: none;
    border-radius: 4px;
    background-color: #432801;
    color: white;
    cursor: pointer;
    font-size: 1rem;
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.3); /* 添加阴影效果 */
    transition: transform 0.3s ease, box-shadow 0.3s ease; /* 添加过渡效果 */
}

#search-button:hover {
    transform: translateY(-3px); /* 鼠标悬停时按钮上移 */
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); /* 鼠标悬停时阴影变化 */
}

#search-button:active {
    transform: translateY(0); /* 按钮按下时效果 */
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.3); /* 按钮按下时阴影变化 */
}
/* 基础样式 */
body {
    font-family: 'Roboto', sans-serif;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-rows: auto 1fr auto;
    min-height: 100vh;
    background-color: #f8f9fa;
    color: #343a40;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

header {
    background-color: #8e5602;
    color: white;
    padding: 2rem 0;
    text-align: center;
}

header h1 {
    font-size: 2.5rem;
    margin: 0;
}

header p {
    font-size: 1.2rem;
    margin: 0.5rem 0;
}

main {
    padding: 2rem 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

footer {
    background-color: #8e5602;
    color: white;
    padding: 1rem 0;
    text-align: center;
}

#pattern-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-gap: 1rem; /* 设置行和列之间的间距 */
    padding: 1rem;
}

.pattern-image {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

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

.modal {
    display: none;
    position: fixed;
    z-index: 1;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.4);
    transition: opacity 0.3s ease;
}

.modal-content {
    background-color: white;
    color: #343a40;
    margin: 15% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
}

#pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 1rem;
}

#pagination button {
    margin: 0 0.5rem;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    background-color: #8e5602;
    color: white;
    cursor: pointer;
    transition: opacity 0.3s ease; /* 添加透明度变化的过渡效果 */
    opacity: 1;
}

#pagination button:hover {
    background-color: #432801;
}

#pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#pagination .active {
    font-weight: bold;
    background-color: #432801;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
}

.close:hover,
.close:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

/* 搜索框样式 */
.search-container {
    display: flex;
    justify-content: center;
    margin-top: 1rem;
    position: relative;
}

#search-input {
    width: 30%; /* 初始宽度 */
    padding: 0.5rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
    transition: width 0.3s ease-in-out; /* 添加宽度变化的过渡效果 */
}

#search-input.expanded {
    width: 50%; /* 展开后的宽度 */
}

#search-button {
    padding: 0.5rem 1rem;
    margin-left: 0.5rem;
    border: none;
    border-radius: 4px;
    background-color: #432801;
    color: white;
    cursor: pointer;
    font-size: 1rem;
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

#search-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
}

#search-button:active {
    transform: translateY(0);
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.3);
}

/* 响应式设计 */
@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }

    header p {
        font-size: 1rem;
    }

    .modal-content {
        width: 90%;
    }

    #pattern-container {
        grid-template-columns: repeat(2, 1fr);
    }

    #search-input {
        width: 70%; /* 在小屏幕上增加搜索框宽度 */
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.5rem;
    }

    header p {
        font-size: 0.9rem;
    }

    .modal-content {
        width: 95%;
    }

    #pattern-container {
        grid-template-columns: 1fr; /* 在更小屏幕上变为单列 */
    }

    #search-input {
        width: 90%; /* 在更小屏幕上进一步增加搜索框宽度 */
    }
}
