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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit;
}

/* 头部样式 */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    font-size: 28px;
}

.nav-links {
    display: flex;
    gap: 30px;
}

.nav-links a {
    color: white;
    opacity: 0.9;
    transition: opacity 0.3s;
}

.nav-links a:hover {
    opacity: 1;
}

/* 容器 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 分类筛选 */
.filter-section {
    background: white;
    padding: 20px;
    margin: 20px 0;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.filter-title {
    font-size: 16px;
    color: #666;
    margin-bottom: 15px;
}

.filter-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 8px 20px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
}

.filter-btn:hover {
    border-color: #667eea;
    color: #667eea;
}

.filter-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: transparent;
}

/* 商品网格 */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    padding: 20px 0;
}

/* 商品卡片 */
.product-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.15);
}

.product-image {
    width: 100%;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 80px;
}

.product-info {
    padding: 15px;
}

.product-category {
    font-size: 12px;
    color: #667eea;
    background: #f0f0ff;
    padding: 4px 10px;
    border-radius: 10px;
    display: inline-block;
    margin-bottom: 8px;
}

.product-name {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-price {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 10px;
}

.current-price {
    font-size: 20px;
    color: #ff4757;
    font-weight: bold;
}

.current-price::before {
    content: "¥";
    font-size: 14px;
}

.original-price {
    font-size: 14px;
    color: #999;
    text-decoration: line-through;
}

.original-price::before {
    content: "¥";
}

.product-meta {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #999;
}

/* 商品详情页 */
.detail-section {
    padding: 30px 0;
}

.detail-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.detail-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    padding: 30px;
}

.detail-image {
    width: 100%;
    height: 400px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 150px;
}

.detail-info {
    display: flex;
    flex-direction: column;
}

.detail-category {
    font-size: 12px;
    color: #667eea;
    background: #f0f0ff;
    padding: 4px 12px;
    border-radius: 12px;
    display: inline-block;
    margin-bottom: 12px;
    width: fit-content;
}

.detail-name {
    font-size: 24px;
    font-weight: bold;
    color: #333;
    margin-bottom: 15px;
    line-height: 1.4;
}

.detail-description {
    color: #666;
    line-height: 1.8;
    margin-bottom: 20px;
}

.detail-price-box {
    background: linear-gradient(135deg, #fff5f5 0%, #fff0f0 100%);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.detail-price {
    font-size: 32px;
    color: #ff4757;
    font-weight: bold;
}

.detail-price::before {
    content: "¥";
    font-size: 18px;
}

.detail-original-price {
    font-size: 16px;
    color: #999;
    text-decoration: line-through;
    margin-left: 10px;
}

.detail-original-price::before {
    content: "¥";
}

.detail-features {
    margin-bottom: 25px;
}

.features-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
    color: #333;
}

.features-list {
    list-style: none;
}

.features-list li {
    padding: 8px 0;
    color: #666;
    display: flex;
    align-items: center;
    gap: 10px;
}

.features-list li::before {
    content: "✓";
    color: #4CAF50;
    font-weight: bold;
}

.detail-meta {
    display: flex;
    gap: 30px;
    color: #999;
    font-size: 14px;
    margin-bottom: 25px;
}

.action-buttons {
    display: flex;
    gap: 15px;
    margin-top: auto;
}

.btn {
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: white;
    border: 2px solid #667eea;
    color: #667eea;
}

.btn-secondary:hover {
    background: #f0f0ff;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #667eea;
    font-size: 14px;
    margin-bottom: 20px;
    transition: all 0.3s;
}

.back-link:hover {
    gap: 12px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .detail-content {
        grid-template-columns: 1fr;
        padding: 20px;
    }

    .header .container {
        flex-direction: column;
        gap: 15px;
    }

    .nav-links {
        gap: 15px;
    }

    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }

    .action-buttons {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        text-align: center;
    }
}

/* 页脚 */
.footer {
    background: #333;
    color: white;
    text-align: center;
    padding: 30px 20px;
    margin-top: 50px;
}

.footer p {
    opacity: 0.7;
    font-size: 14px;
}
