/* buy.css - 首页购买页面样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 40px 20px;
}

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

.header {
    text-align: center;
    margin-bottom: 40px;
}

.header h1 {
    font-size: 36px;
    color: white;
    margin-bottom: 10px;
}

.header p {
    color: rgba(255,255,255,0.9);
    font-size: 16px;
}

/* 商品列表 - 电脑版 */
.products {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 24px;
}

.product-card {
    background: white;
    border-radius: 20px;
    width: 260px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}

.product-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px 20px;
    text-align: center;
}

.product-name {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 10px;
}

.product-price {
    font-size: 32px;
    font-weight: bold;
}

.product-price small {
    font-size: 14px;
}

.product-body {
    padding: 20px;
}

.product-desc {
    color: #666;
    font-size: 14px;
    line-height: 1.8;
    margin-bottom: 20px;
}

.product-desc div {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.buy-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s;
}

.buy-btn:hover {
    transform: translateY(-2px);
}

/* 支付弹窗样式 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 20px;
    padding: 30px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    position: relative;
}

.qr-code {
    background: white;
    padding: 20px;
    margin: 20px 0;
    text-align: center;
}

.qr-code img {
    width: 200px;
    height: 200px;
    margin: 0 auto;
}

.order-info {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 10px;
    margin: 15px 0;
    font-size: 14px;
}

.close-btn {
    background: #6c757d;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    margin-top: 10px;
    width: 100%;
}

.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #667eea;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 0.6s linear infinite;
    margin-right: 8px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.footer {
    text-align: center;
    color: rgba(255,255,255,0.8);
    margin-top: 40px;
    font-size: 12px;
}

/* Toast 提示样式 */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 12px 24px;
    border-radius: 30px;
    font-size: 14px;
    z-index: 3000;
    backdrop-filter: blur(10px);
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
}

.toast.show {
    opacity: 1;
}

/* ========== 手机版专用样式 ========== */
@media (max-width: 768px) {
    body {
        padding: 20px 15px;
    }
    
    .container {
        max-width: 100%;
    }
    
    .header h1 {
        font-size: 28px;
    }
    
    .header p {
        font-size: 14px;
    }
    
    /* 手机版：商品卡片竖排单列 */
    .products {
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }
    
    .product-card {
        width: 70%;
        max-width: 360px;
    }
    
    .product-header {
        padding: 20px;
    }
    
    .product-name {
        font-size: 20px;
    }
    
    .product-price {
        font-size: 26px;
    }
    
    .product-body {
        padding: 16px;
    }
    
    .product-desc {
        font-size: 13px;
    }
    
    .buy-btn {
        padding: 12px;
        font-size: 16px;
    }
    
    .modal-content {
        padding: 20px;
    }
    
    .qr-code img {
        width: 180px;
        height: 180px;
    }
    
    .toast {
        white-space: normal;
        text-align: center;
        max-width: 80%;
        font-size: 13px;
        padding: 10px 20px;
    }
}