* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Microsoft YaHei", Arial, sans-serif;
    background-color: #f5f5f5;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* 头部样式 */
.header {
    background-color: #e3393c;
    color: white;
    padding: 15px 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.search-box {
    display: flex;
    flex: 1;
    max-width: 500px;
    margin-left: 50px;
}

.search-box input {
    flex: 1;
    padding: 10px 15px;
    border: none;
    border-radius: 3px 0 0 3px;
    font-size: 14px;
}

.search-box button {
    padding: 10px 30px;
    background-color: #f42424;
    color: white;
    border: none;
    border-radius: 0 3px 3px 0;
    cursor: pointer;
    font-size: 14px;
}

.search-box button:hover {
    background-color: #d81e1e;
}

/* 分类导航 */
.category-nav {
    background-color: white;
    border-bottom: 2px solid #e3393c;
    margin-bottom: 20px;
}

.category-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 15px 0;
}

.category-item {
    padding: 10px 20px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.3s;
    border-radius: 3px;
    background-color: #f5f5f5;
}

.category-item:hover {
    background-color: #ffe5e5;
    transform: translateY(-2px);
}

.category-item.active {
    background-color: #e3393c;
    color: white;
}

/* 商品网格 */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.product-card {
    background-color: white;
    border-radius: 5px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.product-image {
    width: 100%;
    height: 220px;
    object-fit: cover;
}

.product-info {
    padding: 15px;
}

.product-name {
    font-size: 14px;
    color: #333;
    margin-bottom: 10px;
    height: 40px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.product-price {
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.price {
    color: #e3393c;
    font-size: 20px;
    font-weight: bold;
}

.old-price {
    color: #999;
    font-size: 14px;
    text-decoration: line-through;
}

/* 商品详情页 */
.product-detail {
    background-color: white;
    padding: 30px;
    border-radius: 5px;
    margin-bottom: 30px;
}

.detail-main {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.image-gallery {
    position: relative;
}

.main-image {
    width: 100%;
    height: 400px;
    object-fit: cover;
    border-radius: 5px;
    margin-bottom: 10px;
}

.thumbnail-list {
    display: flex;
    gap: 10px;
    overflow-x: auto;
}

.thumbnail {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 3px;
    cursor: pointer;
    border: 2px solid transparent;
}

.thumbnail.active {
    border-color: #e3393c;
}

.detail-info h1 {
    font-size: 24px;
    margin-bottom: 15px;
}

.detail-price {
    background-color: #f5f5f5;
    padding: 20px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.detail-price .price {
    font-size: 28px;
}

.spec-section {
    margin-bottom: 20px;
}

.spec-section h3 {
    margin-bottom: 10px;
    font-size: 16px;
}

.spec-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.spec-option {
    padding: 8px 15px;
    border: 1px solid #ddd;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.3s;
}

.spec-option:hover {
    border-color: #e3393c;
}

.spec-option.active {
    border-color: #e3393c;
    background-color: #fff5f5;
    color: #e3393c;
}

.stock-info {
    color: #666;
    margin-bottom: 20px;
}

.description {
    padding: 20px 0;
    border-top: 1px solid #eee;
}

.description h2 {
    margin-bottom: 15px;
}

/* 推荐商品 */
.recommend-section {
    background-color: white;
    padding: 30px;
    border-radius: 5px;
}

.recommend-section h2 {
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e3393c;
}

/* 分页 */
.pagination {
    padding: 20px 0;
}

.pagination > div:first-child {
    text-align: center;
    color: #666;
    margin-bottom: 10px;
    font-size: 14px;
}

.page-btn {
    padding: 8px 15px;
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
}

.page-btn:hover {
    border-color: #e3393c;
    color: #e3393c;
}

.page-btn.active {
    background-color: #e3393c;
    color: white;
    border-color: #e3393c;
}

/* 加载状态 */
.loading {
    text-align: center;
    padding: 50px;
    color: #999;
}
