* {
    margin: 0;
    padding: 0;
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
}

body {
    height: 100vh;
}

.container {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); /* 自动填充的列 */
    grid-auto-rows: 200px; /* 高度自动调整 */
    gap: 10px;
    padding: 20px;
    background-color: #f9f9f9;
}

.item {
    text-align: center;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

.item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 3px;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .container {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); /* 窄屏时使用更小的列 */
    }
}
