
.products {
    display: grid;
    gap: 20px;
    justify-content: center;
    padding: 20px;
    max-width: 1240px;
    margin: 0 auto;
}

.product {
    border: 1px solid #ddd;
    padding: 10px;
    text-align: center;
    background: #fff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    transition: transform 0.3s ease;
}

.product:hover {
    transform: scale(1.05);
}

.image-container {
    width: 100%;
    overflow: hidden;
    border-radius: 5px;
}

.product img {
    width: 100%;
    height: auto;
    border-radius: 5px;
    transition: opacity 0.3s ease;
}

.product-title {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-word;
}


/* 电脑端：每行 4 个 */
@media (min-width: 1024px) {
    .products {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* 手机端：每行 2 个 */
@media (max-width: 1023px) {
    .products {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 整体样式 */
.products-select {
    width: 150px;
    padding: 8px 12px;
    font-size: 16px;
    color: #333;
    background-color: #f8f8f8;
    border: 2px solid #ccc;
    border-radius: 8px;
    outline: none;
    appearance: none; /* 去掉原生下拉箭头 */
    -webkit-appearance: none; /* 去掉 Safari/Chrome 下的默认样式 */
    -moz-appearance: none; /* 去掉 Firefox 下的默认样式 */
    box-sizing: border-box;
    transition: border-color 0.3s ease, background-color 0.3s ease;
}

/* 添加聚焦时的样式 */
.products-select:focus {
    border-color: #007BFF;
    background-color: #e9f4ff;
}

/* 下拉箭头 */
.products-select::after {
    content: '\25BC'; /* 向下箭头 */
    font-size: 14px;
    color: #aaa;
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none; /* 不让箭头影响选择 */
}

/* 让select元素在input中显示下拉箭头 */
.products-select {
    position: relative;
}

/* 添加占位符文本样式 */
.products-select option:first-child {
    color: #aaa;
    font-style: italic;
}

/* 鼠标悬停时改变边框颜色 */
.products-select:hover {
    border-color: #888;
}