/* =====================
   首页特定样式
===================== */

/* 搜索区域样式 */
.search-section {
    text-align: center;
    margin: 32px 24px;
}

.search-container {
    display: flex;
    max-width: 600px;
    margin: 0 auto;
}

#search-input {
    flex: 1;
    border-radius: 24px 0 0 24px;
    border: 1px solid #ddd;
    padding: 12px 16px;
    font-size: 16px;
}

.search-btn {
    background-color: #1B5E20;
    color: white;
    border: none;
    width: 80px;
    border-radius: 0 24px 24px 0;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
}

.search-btn:hover {
    background-color: #2E7D32;
}

/* 商品卡片网格布局 */
.product-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 20px;
    margin-top: 16px;
    padding: 0 24px;
}

.product-card {
    transition: transform 0.2s, box-shadow 0.2s;
    text-align: center;
}

.product-card:hover {
    transform: translateY(-5px);
}

.product-image {
    height: 120px;
    background-color: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 32px;
    border-radius: 8px 8px 0 0;
}

.product-info {
    padding: 12px;
}

.product-name {
    font-weight: 500;
    font-size: 14px;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    height: 36px;
}

.product-price {
    color: #e53935;
    font-weight: bold;
    font-size: 16px;
}

/* 分类区域样式 */
.categories-section {
    margin-top: 40px;
    padding: 0 24px;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 20px;
    margin-top: 16px;
}

.category-card {
    text-align: center;
    padding: 20px 10px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.category-icon {
    font-size: 28px;
    margin-bottom: 8px;
}

.category-name {
    font-weight: 500;
    font-size: 14px;
    color: #212121;
}

/* 搜索结果样式 */
.search-results-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
}

.search-header {
    text-align: center;
    margin-bottom: 32px;
}

.search-header h2 {
    font-size: 24px;
    color: #212121;
    margin-bottom: 8px;
}

.search-header p {
    color: #757575;
    font-size: 16px;
    margin-bottom: 16px;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 24px;
}

.result-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    text-decoration: none;
}

.result-card .product-image {
    height: 100px;
    font-size: 32px;
}

.result-card .product-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    padding: 12px;
}

.product-desc {
    color: #757575;
    font-size: 14px;
    margin-bottom: 12px;
    flex-grow: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.view-detail {
    align-self: flex-start;
    margin-top: 8px;
}

.no-results {
    text-align: center;
    padding: 40px 20px;
    color: #757575;
    font-size: 16px;
}

.no-results a {
    color: #1B5E20;
    text-decoration: none;
    font-weight: 500;
}

.no-results a:hover {
    text-decoration: underline;
}

/* 未登录提示 */
.login-prompt {
    text-align: center;
    padding: 40px 20px;
    color: #757575;
}

.login-btn {
    display: inline-block;
    margin-top: 16px;
    padding: 8px 24px;
    background-color: #1B5E20;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 500;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .search-container {
        max-width: 100%;
    }
    
    .categories-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
    
    .category-card {
        padding: 16px 8px;
    }
}

@media (max-width: 480px) {
    .search-container {
        flex-direction: column;
    }
    
    #search-input {
        border-radius: 24px;
        margin-bottom: 12px;
    }
    
    .search-btn {
        border-radius: 24px;
        width: 100%;
    }
    
    .product-list {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
    
    .categories-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}