/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #333;
    background-color: #f5f5f5;
}

.container {
    width: 1200px;
    margin: 0 auto;
}

/* 头部样式 */
.header {
    background-color: #ff4400;
    color: #fff;
    padding: 10px 0;
}

.header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo a {
    color: #fff;
    font-size: 24px;
    font-weight: bold;
    text-decoration: none;
}

.search-box {
    display: flex;
    flex: 1;
    max-width: 600px;
    margin: 0 20px;
}

.search-box input {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 4px 0 0 4px;
}

.search-box button {
    padding: 10px 20px;
    background-color: #ff6a00;
    color: #fff;
    border: none;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
}

.search-box button:hover {
    background-color: #ff8c00;
}

.user-menu a {
    color: #fff;
    text-decoration: none;
    margin-left: 15px;
}

.user-menu a:hover {
    text-decoration: underline;
}



/* 主内容区域 */
.main-content {
    padding: 20px 0;
}

/* 商品列表 */
.product-list {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.product-item {
    background-color: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 15px;
    transition: transform 0.3s ease;
}

.product-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.product-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    margin-bottom: 10px;
}

.product-title {
    font-size: 14px;
    margin-bottom: 10px;
    height: 40px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.product-price {
    font-size: 16px;
    color: #ff4400;
    font-weight: bold;
    margin-bottom: 10px;
}

.product-btn {
    display: block;
    width: 100%;
    padding: 8px;
    background-color: #ff4400;
    color: #fff;
    text-align: center;
    text-decoration: none;
    border-radius: 4px;
    margin-top: 10px;
}

.product-btn:hover {
    background-color: #ff6a00;
}

/* 购物车页面 */
.cart-table {
    width: 100%;
    border-collapse: collapse;
    background-color: #fff;
}

.cart-table th,
.cart-table td {
    padding: 15px;
    border-bottom: 1px solid #e0e0e0;
    text-align: center;
}

.cart-table th {
    background-color: #f5f5f5;
    font-weight: bold;
}

.cart-quantity {
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-quantity input {
    width: 50px;
    text-align: center;
    margin: 0 10px;
}

.cart-remove {
    color: #ff4400;
    cursor: pointer;
}

.cart-remove:hover {
    text-decoration: underline;
}

.cart-total {
    text-align: right;
    margin-top: 20px;
    font-size: 16px;
    font-weight: bold;
}

.cart-checkout {
    display: inline-block;
    padding: 10px 30px;
    background-color: #ff4400;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    margin-top: 10px;
}

.cart-checkout:hover {
    background-color: #ff6a00;
}

/* 登录注册页面 */
.login-container,
.register-container {
    max-width: 400px;
    margin: 50px auto;
    background-color: #fff;
    padding: 30px;
    border-radius: 4px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.login-title,
.register-title {
    font-size: 20px;
    margin-bottom: 20px;
    text-align: center;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
}

.form-btn {
    width: 100%;
    padding: 10px;
    background-color: #ff4400;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 20px;
}

.form-btn:hover {
    background-color: #ff6a00;
}

.form-link {
    text-align: center;
    margin-top: 15px;
}

.form-link a {
    color: #ff4400;
    text-decoration: none;
}

.form-link a:hover {
    text-decoration: underline;
}

/* 订单页面 */
.order-list {
    background-color: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
}

.order-item {
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.order-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
}

.order-products {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.order-product {
    display: flex;
    align-items: center;
    width: calc(50% - 7.5px);
}

.order-product-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    margin-right: 10px;
}

.order-product-info {
    flex: 1;
}

.order-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-top: 15px;
}

.order-total {
    font-size: 16px;
    font-weight: bold;
    margin-right: 20px;
}

.order-btn {
    padding: 5px 15px;
    background-color: #ff4400;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    margin-left: 10px;
}

.order-btn:hover {
    background-color: #ff6a00;
}

/* 页脚 */
.footer {
    background-color: #333;
    color: #fff;
    padding: 30px 0;
    margin-top: 50px;
}

.footer-content {
    display: flex;
    justify-content: space-between;
}

.footer-section h3 {
    margin-bottom: 15px;
    font-size: 16px;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 10px;
}

.footer-section ul li a {
    color: #ccc;
    text-decoration: none;
}

.footer-section ul li a:hover {
    color: #fff;
}

.footer-bottom {
    text-align: center;
    margin-top: 30px;
    padding-top: 15px;
    border-top: 1px solid #444;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .container {
        width: 90%;
    }
}

@media (max-width: 992px) {
    .product-list {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .product-list {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .header-top {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .search-box {
        margin: 10px 0;
        width: 100%;
    }
    
    .user-menu {
        margin-top: 10px;
    }
    
    .category-list {
        overflow-x: auto;
        white-space: nowrap;
    }
}