/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

/* 容器样式 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 头部导航 */
.header {
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
}

.logo a {
    font-size: 24px;
    font-weight: bold;
    color: #ff6b6b;
    text-decoration: none;
}

.nav ul {
    display: flex;
    list-style: none;
}

.nav li {
    margin-left: 30px;
}

.nav a {
    color: #333;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.nav a:hover {
    color: #ff6b6b;
}

.search {
    display: flex;
}

.search input {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px 0 0 4px;
    outline: none;
    width: 250px;
}

.search button {
    padding: 8px 16px;
    background-color: #ff6b6b;
    color: white;
    border: none;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    transition: background-color 0.3s;
}

.search button:hover {
    background-color: #ff5252;
}

/* 轮播图 */
.banner {
    background-color: #ff6b6b;
    color: white;
    padding: 80px 0;
    text-align: center;
}

.banner h1 {
    font-size: 48px;
    margin-bottom: 20px;
}

.banner p {
    font-size: 20px;
}

/* 商品分类 */
.categories {
    padding: 50px 0;
    background-color: white;
}

.categories h2 {
    text-align: center;
    margin-bottom: 40px;
    font-size: 32px;
    color: #333;
}

.category-list {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
}

.category-item {
    text-align: center;
    margin: 20px;
}

.category-item a {
    display: block;
    text-decoration: none;
    color: #333;
    transition: transform 0.3s;
}

.category-item a:hover {
    transform: translateY(-5px);
}

.category-item img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 50%;
    margin-bottom: 10px;
}

/* 商品列表 */
.product-list, .product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.product-item {
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.product-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.product-item a {
    text-decoration: none;
    color: #333;
    display: block;
}

.product-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.product-item h3 {
    padding: 15px;
    font-size: 18px;
    margin-bottom: 5px;
}

.product-item .price {
    padding: 0 15px;
    color: #ff6b6b;
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 5px;
}

.product-item .desc {
    padding: 0 15px 15px;
    font-size: 14px;
    color: #666;
    line-height: 1.4;
}

.product-item .meta {
    padding: 0 15px 15px;
    font-size: 12px;
    color: #999;
    display: flex;
    justify-content: space-between;
}

/* 热门商品 */
.hot-products {
    padding: 50px 0;
    background-color: #f5f5f5;
}

.hot-products h2 {
    text-align: center;
    margin-bottom: 40px;
    font-size: 32px;
    color: #333;
}

/* 商品列表页 */
.filter {
    background-color: white;
    padding: 20px 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.filter-content {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.filter-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-item label {
    font-weight: 500;
    color: #666;
}

.filter-item input, .filter-item select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    outline: none;
}

.btn-filter {
    padding: 8px 16px;
    background-color: #ff6b6b;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn-filter:hover {
    background-color: #ff5252;
}

.product-section {
    padding: 50px 0;
    background-color: #f5f5f5;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    margin-top: 40px;
}

.pagination a {
    padding: 10px 15px;
    margin: 0 5px;
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: #333;
    transition: all 0.3s;
}

.pagination a:hover {
    background-color: #ff6b6b;
    color: white;
    border-color: #ff6b6b;
}

.pagination a.active {
    background-color: #ff6b6b;
    color: white;
    border-color: #ff6b6b;
}

/* 商品详情 */
.product-detail {
    padding: 50px 0;
    background-color: white;
}

.detail-content {
    display: flex;
    gap: 40px;
}

.product-images {
    flex: 1;
}

.main-image {
    margin-bottom: 20px;
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
}

.main-image img {
    width: 100%;
    height: auto;
    display: block;
}

.thumbnails {
    display: flex;
    gap: 10px;
}

.thumbnails img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border: 2px solid #eee;
    border-radius: 4px;
    cursor: pointer;
    transition: border-color 0.3s;
}

.thumbnails img:hover {
    border-color: #ff6b6b;
}

.product-info {
    flex: 1;
}

.product-info h1 {
    font-size: 28px;
    margin-bottom: 20px;
    color: #333;
}

.product-info .price {
    font-size: 32px;
    color: #ff6b6b;
    font-weight: bold;
    margin-bottom: 20px;
}

.product-info .meta {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    color: #666;
    font-size: 14px;
}

.description h3, .seller-info h3 {
    font-size: 18px;
    margin-bottom: 15px;
    color: #333;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.description p {
    margin-bottom: 10px;
    color: #666;
    line-height: 1.6;
}

.seller {
    display: flex;
    align-items: center;
    gap: 15px;
}

.seller img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
}

.seller-name {
    font-weight: 500;
    color: #333;
}

.seller-rating {
    color: #ffd700;
}

.action-buttons {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

.btn-chat, .btn-buy {
    padding: 15px 30px;
    font-size: 16px;
    font-weight: 500;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-chat {
    background-color: white;
    color: #ff6b6b;
    border: 2px solid #ff6b6b;
}

.btn-chat:hover {
    background-color: #ff6b6b;
    color: white;
}

.btn-buy {
    background-color: #ff6b6b;
    color: white;
}

.btn-buy:hover {
    background-color: #ff5252;
}

/* 相关推荐 */
.related-products {
    padding: 50px 0;
    background-color: #f5f5f5;
}

.related-products h2 {
    text-align: center;
    margin-bottom: 40px;
    font-size: 32px;
    color: #333;
}

/* 个人中心 */
.profile {
    padding: 50px 0;
    background-color: #f5f5f5;
}

.profile-content {
    display: flex;
    gap: 40px;
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.profile-sidebar {
    width: 250px;
    background-color: #fafafa;
    padding: 30px 0;
    border-right: 1px solid #eee;
}

.user-info {
    text-align: center;
    margin-bottom: 30px;
}

.avatar img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 15px;
}

.username {
    font-size: 18px;
    font-weight: 500;
    color: #333;
}

.sidebar-nav ul {
    list-style: none;
}

.sidebar-nav li {
    margin-bottom: 10px;
}

.sidebar-nav a {
    display: block;
    padding: 12px 30px;
    color: #666;
    text-decoration: none;
    transition: all 0.3s;
}

.sidebar-nav a:hover, .sidebar-nav a.active {
    background-color: #ff6b6b;
    color: white;
}

.profile-main {
    flex: 1;
    padding: 30px;
}

.profile-main h2 {
    font-size: 24px;
    margin-bottom: 30px;
    color: #333;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

/* 我的发布 */
.published-items {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.published-item {
    display: flex;
    gap: 20px;
    padding: 20px;
    background-color: #fafafa;
    border-radius: 8px;
    transition: box-shadow 0.3s;
}

.published-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.item-image img {
    width: 150px;
    height: 150px;
    object-fit: cover;
    border-radius: 4px;
}

.item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.item-info h3 {
    font-size: 18px;
    margin-bottom: 10px;
    color: #333;
}

.item-info .price {
    font-size: 20px;
    color: #ff6b6b;
    font-weight: bold;
    margin-bottom: 10px;
}

.item-info .status {
    color: #4caf50;
    font-size: 14px;
    margin-bottom: 15px;
}

.actions button {
    padding: 8px 16px;
    margin-right: 10px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.actions button:first-child {
    background-color: #2196f3;
    color: white;
}

.actions button:first-child:hover {
    background-color: #0b7dda;
}

.actions button:last-child {
    background-color: #f44336;
    color: white;
}

.actions button:last-child:hover {
    background-color: #d32f2f;
}

/* 页脚 */
.footer {
    background-color: #333;
    color: white;
    text-align: center;
    padding: 30px 0;
    margin-top: 50px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .header .container {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }

    .nav ul {
        justify-content: center;
    }

    .nav li {
        margin: 0 15px;
    }

    .banner h1 {
        font-size: 36px;
    }

    .banner p {
        font-size: 16px;
    }

    .detail-content {
        flex-direction: column;
    }

    .profile-content {
        flex-direction: column;
    }

    .profile-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #eee;
    }

    .published-item {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .filter-content {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-item {
        justify-content: space-between;
    }
}

@media (max-width: 480px) {
    .search input {
        width: 200px;
    }

    .product-list, .product-grid {
        grid-template-columns: 1fr;
    }

    .category-list {
        flex-direction: column;
        align-items: center;
    }

    .banner h1 {
        font-size: 28px;
    }

    .banner p {
        font-size: 14px;
    }
}