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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    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: 1000;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    position: relative;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: #e74c3c;
    text-decoration: none;
}

/* 移动端菜单按钮 */
.mobile-menu-btn {
    display: none;
    font-size: 1.5rem;
    background: none;
    border: none;
    cursor: pointer;
    color: #333;
    padding: 0.5rem;
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.nav-links a {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: #e74c3c;
}

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s;
}

.btn-primary {
    background-color: #e74c3c;
    color: white;
}

.btn-primary:hover {
    background-color: #c0392b;
}

.btn-secondary {
    background-color: #3498db;
    color: white;
}

.btn-secondary:hover {
    background-color: #2980b9;
}

.btn-outline {
    background-color: transparent;
    border: 2px solid #e74c3c;
    color: #e74c3c;
}

.btn-outline:hover {
    background-color: #e74c3c;
    color: white;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

/* 表单样式 */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #333;
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: #e74c3c;
}

/* 卡片样式 */
.card {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
}

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

.card-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background-color: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
}

.card-body {
    padding: 1.5rem;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #333;
}

.card-text {
    color: #666;
    margin-bottom: 1rem;
}

.card-price {
    font-size: 1.5rem;
    font-weight: bold;
    color: #e74c3c;
    margin-bottom: 1rem;
}

.card-price .original-price {
    font-size: 1rem;
    color: #999;
    text-decoration: line-through;
    margin-left: 0.5rem;
}

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

/* 分类样式 */
.categories {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding: 1rem 0;
    margin-bottom: 2rem;
}

.category-btn {
    padding: 0.75rem 1.5rem;
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 20px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.3s;
}

.category-btn:hover,
.category-btn.active {
    background-color: #e74c3c;
    color: white;
    border-color: #e74c3c;
}

/* 商品分类图标 */
.category-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 1rem;
    background-color: white;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.category-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.category-icon {
    font-size: 3rem;
    margin-bottom: 0.75rem;
}

.category-name {
    font-size: 1rem;
    font-weight: 500;
    color: #333;
}

/* 购物车样式 */
.cart-item {
    display: flex;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid #eee;
}

.cart-item:last-child {
    border-bottom: none;
}

.cart-item-img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 4px;
    margin-right: 1rem;
    background-color: #f0f0f0;
}

.cart-item-info {
    flex: 1;
}

.cart-item-title {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.cart-item-price {
    color: #e74c3c;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.cart-item-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.quantity-btn {
    width: 30px;
    height: 30px;
    border: 1px solid #ddd;
    background-color: white;
    cursor: pointer;
    border-radius: 4px;
}

.quantity-display {
    width: 40px;
    text-align: center;
    font-weight: 600;
}

.cart-summary {
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-top: 2rem;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.summary-total {
    font-size: 1.5rem;
    font-weight: bold;
    color: #e74c3c;
}

/* 登录/注册页面 */
.auth-container {
    max-width: 400px;
    margin: 4rem auto;
    padding: 2rem;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.auth-title {
    text-align: center;
    margin-bottom: 2rem;
    color: #333;
}

.auth-tabs {
    display: flex;
    margin-bottom: 2rem;
    border-bottom: 2px solid #eee;
}

.auth-tab {
    flex: 1;
    padding: 1rem;
    text-align: center;
    cursor: pointer;
    font-weight: 500;
    color: #666;
    transition: all 0.3s;
}

.auth-tab.active {
    color: #e74c3c;
    border-bottom: 2px solid #e74c3c;
}

/* 加载动画 */
.loading {
    text-align: center;
    padding: 2rem;
    color: #666;
}

.loading-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #e74c3c;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 提示消息 */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 1rem 2rem;
    background-color: #2ecc71;
    color: white;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    z-index: 2000;
    animation: slideIn 0.3s ease;
}

.toast.error {
    background-color: #e74c3c;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 1rem;
    }

    /* 移动端菜单 */
    .mobile-menu-btn {
        display: block;
    }
    
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        flex-direction: column;
        padding: 1rem;
        gap: 0;
        box-shadow: 0 4px 8px rgba(0,0,0,0.1);
        z-index: 1000;
    }
    
    .nav-links.active {
        display: flex;
    }
    
    .nav-links li {
        width: 100%;
    }
    
    .nav-links a {
        display: block;
        padding: 0.75rem 0;
        border-bottom: 1px solid #eee;
    }
    
    .nav-links li:last-child a {
        border-bottom: none;
    }

    .cart-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .cart-item-img {
        width: 100%;
        height: 200px;
        margin-right: 0;
        margin-bottom: 1rem;
    }
}

/* 页脚 */
footer {
    background-color: #333;
    color: white;
    padding: 2rem 0;
    margin-top: 4rem;
}

footer .container {
    text-align: center;
}

footer p {
    margin: 0.5rem 0;
    color: #999;
}

/* 搜索框 */
.search-box {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.search-box input {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.search-box button {
    padding: 0.75rem 1.5rem;
    background-color: #e74c3c;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

/* 商品详情页 */
.product-detail {
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin: 2rem 0;
}

.product-detail-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.product-detail-image {
    width: 100%;
    height: 400px;
    object-fit: cover;
    border-radius: 8px;
    background-color: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
}

.product-detail-info h1 {
    margin-bottom: 1rem;
    color: #333;
}

.product-detail-price {
    font-size: 2rem;
    font-weight: bold;
    color: #e74c3c;
    margin-bottom: 1rem;
}

.product-detail-description {
    color: #666;
    margin-bottom: 2rem;
    line-height: 1.8;
}

.product-detail-actions {
    display: flex;
    gap: 1rem;
}

/* 商品图片展示样式 */
.product-images-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.main-image-container {
    width: 100%;
    border-radius: 8px;
    overflow: hidden;
    background-color: #f8f9fa;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.main-product-image {
    width: 100%;
    height: 400px;
    object-fit: cover;
    display: block;
    transition: transform 0.3s;
}

.main-product-image:hover {
    transform: scale(1.02);
}

.thumbnail-list {
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    padding: 0.5rem 0;
}

.thumbnail-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s;
    flex-shrink: 0;
}

.thumbnail-image:hover {
    border-color: #e74c3c;
    transform: translateY(-2px);
}

.thumbnail-image.active {
    border-color: #e74c3c;
    box-shadow: 0 2px 8px rgba(231, 76, 60, 0.3);
}

@media (max-width: 768px) {
    .product-detail-content {
        grid-template-columns: 1fr;
    }

    .product-detail-actions {
        flex-direction: column;
    }
    
    .main-product-image {
        height: 300px;
    }
    
    .thumbnail-image {
        width: 60px;
        height: 60px;
    }
}

/* 页面内容样式 */
.page-content {
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin: 2rem 0;
}

.page-content h1 {
    color: #333;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e74c3c;
}

.content-section {
    margin-bottom: 2rem;
}

.content-section h2 {
    color: #e74c3c;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.content-section p {
    color: #666;
    line-height: 1.8;
    margin-bottom: 1rem;
}

/* 价值列表 */
.value-list {
    list-style: none;
    padding: 0;
}

.value-list li {
    padding: 0.5rem 0;
    color: #666;
    line-height: 1.6;
}

/* 时间线 */
.timeline {
    position: relative;
    padding-left: 2rem;
}

.timeline-item {
    position: relative;
    padding-bottom: 1.5rem;
    border-left: 2px solid #e74c3c;
    padding-left: 1.5rem;
    margin-left: -2rem;
}

.timeline-item:last-child {
    border-left: 2px solid transparent;
}

.timeline-item h3 {
    color: #e74c3c;
    margin-bottom: 0.5rem;
}

.timeline-item p {
    color: #666;
    margin: 0;
}

/* 优势网格 */
.advantage-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.advantage-item {
    text-align: center;
    padding: 1.5rem;
    background-color: #f8f9fa;
    border-radius: 8px;
    transition: transform 0.3s;
}

.advantage-item:hover {
    transform: translateY(-5px);
}

.advantage-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.advantage-item h3 {
    color: #333;
    margin-bottom: 0.5rem;
}

.advantage-item p {
    color: #666;
    font-size: 0.9rem;
    margin: 0;
}

/* 联系信息 */
.contact-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.contact-item {
    text-align: center;
    padding: 1.5rem;
    background-color: #f8f9fa;
    border-radius: 8px;
}

.contact-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.contact-item h3 {
    color: #333;
    margin-bottom: 0.5rem;
}

.contact-item p {
    color: #666;
    margin: 0.25rem 0;
}

.contact-note {
    font-size: 0.85rem;
    color: #999;
}

/* 联系表单 */
.contact-form {
    max-width: 600px;
    margin-top: 1rem;
}

/* FAQ列表 */
.faq-list {
    margin-top: 1rem;
}

.faq-item {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 8px;
}

.faq-item h3 {
    color: #333;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.faq-item p {
    color: #666;
    margin: 0;
}

/* 政策列表 */
.policy-list {
    margin-top: 1rem;
}

.policy-list h3 {
    color: #333;
    margin: 1.5rem 0 0.5rem;
    font-size: 1.1rem;
}

.policy-list ul {
    list-style: disc;
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}

.policy-list li {
    color: #666;
    line-height: 1.8;
    margin-bottom: 0.5rem;
}

/* 流程步骤 */
.process-steps {
    margin-top: 1rem;
}

.step {
    display: flex;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 8px;
}

.step-number {
    width: 40px;
    height: 40px;
    background-color: #e74c3c;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: bold;
    margin-right: 1rem;
    flex-shrink: 0;
}

.step h3 {
    color: #333;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.step p {
    color: #666;
    margin: 0;
}

/* 注意事项 */
.notice-box {
    background-color: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1rem;
}

.notice-box ul {
    list-style: disc;
    padding-left: 1.5rem;
    margin: 0;
}

.notice-box li {
    color: #856404;
    line-height: 1.8;
    margin-bottom: 0.5rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .advantage-grid,
    .contact-info {
        grid-template-columns: 1fr;
    }
    
    .step {
        flex-direction: column;
    }
    
    .step-number {
        margin-bottom: 0.5rem;
    }
}
