/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f8f8;
}

a {
    text-decoration: none;
    color: #0066cc;
}

a:hover {
    color: #ff6600;
}

img {
    border: none;
    max-width: 100%;
    height: auto;
}

ul, ol {
    list-style: none;
}

.clearfix:after {
    content: "";
    display: block;
    height: 0;
    clear: both;
    visibility: hidden;
}

/* 顶部导航栏样式 */
.header {
    background-color: #0066cc;
    color: white;
    padding: 10px 0;
}

.header .logo {
    float: left;
    margin-left: 20px;
}

.header .nav {
    float: right;
    margin-right: 20px;
}

.header .nav ul li {
    display: inline-block;
    margin-left: 20px;
}

.header .nav ul li a {
    color: white;
    font-size: 16px;
}

.header .nav ul li a:hover {
    text-decoration: underline;
}

/* 搜索栏样式 */
.search-box {
    padding: 20px;
    text-align: center;
    background-color: #f0f0f0;
}

.search-box input[type="text"] {
    width: 300px;
    height: 36px;
    padding: 0 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
}

.search-box input[type="submit"] {
    height: 36px;
    padding: 0 15px;
    background-color: #0066cc;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
}

.search-box input[type="submit"]:hover {
    background-color: #0052a3;
}

/* 产品展示区样式 - 一行三个产品并居中 */
.product-container {
    width: 95%;
    max-width: 1200px; /* 限制最大宽度 */
    margin: 20px auto;
    overflow: hidden;
}

.product-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center; /* 水平居中 */
    margin: 0 -10px;
}

.product-item {
    width: 33.333%; /* 一行显示三个产品 */
    padding: 0 10px;
    margin-bottom: 20px;
    box-sizing: border-box;
    display: flex; /* 确保内容填满容器 */
}

.product-item-inner {
    background-color: white;
    border: 1px solid #eee;
    border-radius: 5px;
    overflow: hidden;
    transition: all 0.3s ease;
    flex: 1; /* 填满父容器 */
}

.product-item-inner:hover {
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.product-image {
    position: relative;
    padding-top: 75%;
    overflow: hidden;
}

.product-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.product-image img:hover {
    transform: scale(1.05);
}

.product-info {
    padding: 15px;
}

.product-name {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 5px;
    height: 40px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.product-price {
    color: #ff6600;
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 10px;
}

.product-actions {
    display: flex;
    justify-content: space-between;
}

.add-to-cart {
    background-color: #ff6600;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.add-to-cart:hover {
    background-color: #e65c00;
}

.view-details {
    background-color: #f0f0f0;
    color: #333;
    border: 1px solid #ddd;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.view-details:hover {
    background-color: #e0e0e0;
}

/* 分页样式 */
.pagination {
    text-align: center;
    margin: 30px 0;
}

.pagination ul li {
    display: inline-block;
    margin: 0 5px;
}

.pagination ul li a {
    display: block;
    width: 30px;
    height: 30px;
    line-height: 30px;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 3px;
}

.pagination ul li a:hover,
.pagination ul li.active a {
    background-color: #0066cc;
    color: white;
    border-color: #0066cc;
}

/* 页脚样式 */
.footer {
    background-color: #333;
    color: white;
    padding: 30px 0;
    margin-top: 30px;
}

.footer-inner {
    width: 95%;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
}

.footer-col {
    width: 23%;
    margin-bottom: 20px;
}

.footer-col h3 {
    font-size: 18px;
    margin-bottom: 15px;
    border-bottom: 1px solid #555;
    padding-bottom: 10px;
}

.footer-col ul li {
    margin-bottom: 10px;
}

.footer-col ul li a {
    color: #ccc;
}

.footer-col ul li a:hover {
    color: white;
}

.copyright {
    text-align: center;
    padding: 15px 0;
    background-color: #222;
    color: #999;
    font-size: 14px;
}

/* 响应式设计 - 小屏幕设备 */
@media (max-width: 768px) {
    .product-item {
        width: 50%;
    }
    
    .footer-col {
        width: 48%;
    }
    
    .header .logo,
    .header .nav {
        float: none;
        text-align: center;
        margin: 10px 0;
    }
    
    .header .nav ul li {
        margin: 0 10px;
    }
}

/* 响应式设计 - 超小屏幕设备 */
@media (max-width: 480px) {
    .product-item {
        width: 100%;
    }
    
    .footer-col {
        width: 100%;
    }
    
    .search-box input[type="text"] {
        width: 70%;
    }
}    