/* 移动端优先的商品列表样式 */
.haoziw-products-container {
    max-width: 100%;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f5f5f5;
    min-height: 100vh;
}

.haoziw-products-container h2 {
    text-align: center;
    padding: 15px 0;
    margin: 0;
    background: #fff;
    border-bottom: 1px solid #eee;
    font-size: 18px;
    font-weight: 500;
    color: #333;
}

/* 折扣规则 */
.discount-rules {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 15px;
    margin: 10px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    text-align: center;
}

.discount-rules p {
    margin: 0;
    font-size: 14px;
    font-weight: 500;
}

.discount-rules strong {
    font-weight: 700;
    font-size: 15px;
}

/* 商品列表 */
.products-list {
    padding: 10px;
}

.product-item {
    display: flex;
    align-items: center;
    background: #fff;
    margin-bottom: 10px;
    padding: 12px 15px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: all 0.2s ease;
    min-height: 60px;
}

.product-item.selected {
    background: #e8f4fd;
    border: 1px solid #007cba;
}

/* 勾选框 */
.product-checkbox {
    position: relative;
    margin-right: 12px;
    cursor: pointer;
    flex-shrink: 0;
}

.product-checkbox input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.checkmark {
    position: relative;
    display: inline-block;
    width: 20px;
    height: 20px;
    background: #fff;
    border: 2px solid #ddd;
    border-radius: 50%;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.product-checkbox input[type="checkbox"]:checked + .checkmark {
    background: #007cba;
    border-color: #007cba;
}

.product-checkbox input[type="checkbox"]:checked + .checkmark:after {
    content: '';
    position: absolute;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* 商品详情 - 横向排列 */
.product-details {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-width: 0; /* 防止flex子项溢出 */
}

.product-name {
    margin: 0;
    font-size: 16px;
    font-weight: 500;
    color: #333;
    line-height: 1.3;
    flex: 1;
    margin-right: 10px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.product-price {
    font-size: 18px;
    color: #ff4757;
    font-weight: 600;
    flex-shrink: 0;
    white-space: nowrap;
}

/* 订单摘要 */
.order-summary {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    padding: 15px;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    border-top: 1px solid #eee;
    z-index: 1000;
}

.order-summary h3 {
    display: none;
}

.summary-items {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
}

.summary-items > p {
    margin: 0;
    font-size: 14px;
    color: #666;
}

.price-details {
    text-align: right;
}

.original-price {
    margin: 0 0 2px 0 !important;
    font-size: 13px !important;
    color: #999 !important;
    text-decoration: line-through;
}

.discount-info {
    margin: 0 0 2px 0 !important;
    font-size: 12px !important;
    color: #ff6b35 !important;
}

.final-amount {
    font-size: 18px !important;
    font-weight: 600 !important;
    color: #ff4757 !important;
    margin: 0 !important;
}

.create-order-btn {
    width: 100%;
    padding: 15px;
    border: none;
    border-radius: 25px;
    background: #007cba;
    color: white;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.create-order-btn:hover:not(:disabled) {
    background: #005a87;
}

.create-order-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* 响应式优化 */
@media (max-width: 480px) {
    .product-item {
        padding: 12px;
    }
    
    .product-info h3 {
        font-size: 15px;
    }
    
    .product-price .price {
        font-size: 16px;
    }
    
    .checkmark {
        width: 20px;
        height: 20px;
    }
    
    .product-checkbox input[type="checkbox"]:checked + .checkmark:after {
        left: 6px;
        top: 2px;
        width: 5px;
        height: 10px;
    }
}

/* 滚动优化 */
.products-list {
    padding-bottom: 120px; /* 为底部订单摘要留出空间 */
}

/* 旧样式清理 - 保留订单页面样式 */
.haoziw-orders-container {
    max-width: 100%;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f5f5f5;
    min-height: 100vh;
}

.haoziw-orders-container h2 {
    text-align: center;
    padding: 15px 0;
    margin: 0;
    background: #fff;
    border-bottom: 1px solid #eee;
    font-size: 18px;
    font-weight: 500;
    color: #333;
}

.orders-list {
    padding: 10px;
}

.order-item {
    background: #fff;
    margin-bottom: 10px;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

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

.order-number {
    font-weight: 500;
    color: #333;
}

.order-date {
    color: #999;
    font-size: 12px;
}

.order-status {
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    color: white;
}

.order-status.status-success {
    background: #27ae60;
}

.order-status.status-pending {
    background: #f39c12;
}

.order-status.status-expired {
    background: #e74c3c;
}

.order-amount {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    color: #666;
}

.final-amount {
    font-weight: 600;
    color: #ff4757;
}

.order-validity {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #999;
    margin-top: 5px;
}

.validity-status.valid {
    color: #27ae60;
}

.validity-status.expired {
    color: #e74c3c;
}

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

.modal-content {
    background: white;
    border-radius: 15px;
    padding: 40px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.close {
    position: absolute;
    right: 15px;
    top: 15px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #aaa;
}

.close:hover {
    color: #000;
}

.modal h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 24px;
}

.payment-info {
    margin-bottom: 25px;
}

.payment-info p {
    margin: 8px 0;
    font-size: 16px;
    color: #34495e;
}

.qr-code {
    margin: 25px 0;
}

.qr-code img {
    max-width: 200px;
    height: auto;
    border: 2px solid #ecf0f1;
    border-radius: 10px;
    padding: 10px;
}

.qr-code p {
    margin-top: 15px;
    color: #7f8c8d;
    font-size: 14px;
}

.payment-status {
    margin-top: 20px;
}

.payment-status p {
    font-size: 16px;
    font-weight: 600;
    color: #27ae60;
}

/* 订单列表样式 */
.orders-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.order-item {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    padding: 25px;
    transition: all 0.3s ease;
}

.order-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #ecf0f1;
}

.order-number {
    font-weight: 600;
    color: #2c3e50;
    font-size: 16px;
}

.order-date {
    color: #7f8c8d;
    font-size: 14px;
}

.order-status {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-success {
    background: #d4edda;
    color: #155724;
}

.status-pending {
    background: #fff3cd;
    color: #856404;
}

.status-expired {
    background: #f8d7da;
    color: #721c24;
}

.order-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.order-amount {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.order-amount span {
    font-size: 14px;
    color: #34495e;
}

.discount {
    color: #e74c3c !important;
    font-weight: 600;
}

.final-amount {
    font-weight: 700;
    color: #2c3e50 !important;
    font-size: 16px !important;
}

.order-validity {
    display: flex;
    flex-direction: column;
    gap: 5px;
    align-items: flex-end;
}

.validity-status {
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.validity-status.valid {
    background: #d1ecf1;
    color: #0c5460;
}

.validity-status.expired {
    background: #f8d7da;
    color: #721c24;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .products-grid {
        grid-template-columns: 1fr;
    }
    
    .order-details {
        grid-template-columns: 1fr;
    }
    
    .order-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .order-validity {
        align-items: flex-start;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.product-card,
.order-item {
    animation: fadeIn 0.5s ease-out;
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #007cba;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* 充值页面样式 */
.haoziw-recharge-container {
    max-width: 100%;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f5f5f5;
    min-height: 100vh;
}

.haoziw-recharge-container h2 {
    text-align: center;
    padding: 15px 0;
    margin: 0;
    background: #fff;
    border-bottom: 1px solid #eee;
    font-size: 18px;
    font-weight: 500;
    color: #333;
}

.user-balance {
    background: #fff;
    margin: 10px;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    text-align: center;
}

.user-balance p {
    margin: 0;
    font-size: 16px;
    color: #666;
}

.user-balance strong {
    font-size: 20px;
    color: #ff4757;
}

.recharge-form {
    background: #fff;
    margin: 10px;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.recharge-form h3 {
    margin-top: 0;
    font-size: 16px;
    color: #333;
    text-align: center;
}

.amount-input {
    margin-bottom: 20px;
}

.amount-input label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    color: #666;
}

.amount-input input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    box-sizing: border-box;
}

.create-recharge-btn {
    width: 100%;
    padding: 15px;
    border: none;
    border-radius: 25px;
    background: #007cba;
    color: white;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.create-recharge-btn:hover:not(:disabled) {
    background: #005a87;
}

.create-recharge-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

#recharge-payment-hint {
    background: #fff;
    margin: 10px;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    text-align: center;
}

#recharge-payment-hint p {
    margin: 5px 0;
    font-size: 14px;
    color: #666;
}

/* 移动端优化 */
@media (max-width: 480px) {
    .haoziw-recharge-container h2 {
        font-size: 16px;
        padding: 12px 0;
    }
    
    .user-balance p {
        font-size: 14px;
    }
    
    .user-balance strong {
        font-size: 18px;
    }
    
    .recharge-form h3 {
        font-size: 15px;
    }
    
    .amount-input label {
        font-size: 13px;
    }
    
    .amount-input input {
        font-size: 16px; /* 防止iOS缩放 */
        padding: 15px;
    }
    
    .create-recharge-btn {
        font-size: 16px;
        padding: 16px;
    }
    
    #recharge-payment-hint p {
        font-size: 13px;
    }
}
