* { 
    box-sizing: border-box; 
    margin: 0; 
    padding: 0; 
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto;
    line-height: 1.6;
    background: #f5f5f5;
    color: #333;
}

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

.header {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    text-align: center;
}

.header h1 {
    color: #333;
    margin-bottom: 10px;
}

/* Tab样式 */
.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.tab {
    padding: 10px 20px;
    background: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.tab.active {
    background: #4CAF50;
    color: white;
}

.tab:hover {
    opacity: 0.9;
}

/* 商品列表样式 */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.product-card {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.2s;
}

.product-card:hover {
    transform: translateY(-2px);
}

.product-card h3 {
    margin-bottom: 10px;
    color: #333;
}

.product-card .price {
    color: #e53935;
    font-size: 24px;
    font-weight: bold;
    margin: 10px 0;
}

.product-card .stock {
    color: #666;
    margin-bottom: 15px;
}

.product-card .description {
    color: #666;
    margin-bottom: 15px;
    font-size: 14px;
}

/* 按钮样式 */
.btn {
    background: #4CAF50;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    width: 100%;
    transition: background-color 0.2s;
}

.btn:hover {
    background: #45a049;
}

.btn:disabled {
    background: #cccccc;
    cursor: not-allowed;
}

/* 订单列表样式 */
.orders-list {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.order-search {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.order-search input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.order-search button {
    width: auto;
    white-space: nowrap;
}

.order-item {
    border-bottom: 1px solid #eee;
    padding: 15px 0;
}

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

.order-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 14px;
}

.order-id {
    color: #666;
}

.order-time {
    color: #999;
}

.order-content {
    margin: 10px 0;
}

.order-product {
    font-weight: bold;
    margin-bottom: 8px;
}

.order-info {
    font-size: 14px;
    color: #666;
    margin-bottom: 5px;
}

.order-card {
    background: #f5f5f5;
    padding: 12px;
    border-radius: 4px;
    margin-top: 10px;
    font-family: monospace;
    word-break: break-all;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
}

.modal-content {
    background: white;
    padding: 25px;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    margin: 50px auto;
}

.modal h2 {
    margin-bottom: 20px;
    color: #333;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #555;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.form-group input:focus {
    outline: none;
    border-color: #4CAF50;
}

.notice {
    background: #e8f5e9;
    border-left: 4px solid #4CAF50;
    padding: 12px;
    margin: 15px 0;
    font-size: 14px;
    color: #2e7d32;
}

.button-group {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

/* Loading样式 */
.loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.9);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.loading-text {
    background: #333;
    color: white;
    padding: 15px 30px;
    border-radius: 30px;
    font-size: 16px;
}

/* 支付相关样式 */
#card-element {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
}

.payment-error {
    color: #fa755a;
    font-size: 13px;
    margin-top: 8px;
    min-height: 20px;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .products-grid {
        grid-template-columns: 1fr;
    }

    .order-header {
        flex-direction: column;
    }

    .order-time {
        margin-top: 5px;
    }

    .modal-content {
        width: 95%;
        margin: 20px auto;
    }

    .button-group {
        flex-direction: column;
    }

    .button-group .btn {
        width: 100%;
    }
}