/* style.css */
body {
    margin: 0;
    padding: 0;
    background: url('https://material-1301092013.cos.ap-beijing.myqcloud.com/image/icon/icon.png') no-repeat center center fixed;
    background-size: cover;
    background-attachment: fixed;
    /* 确保背景固定 */
    font-family: 'Microsoft YaHei', sans-serif;
    min-height: 100vh;
    height: 100vh;
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
    overflow: hidden;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.container {
    width: 100%;
    max-width: 400px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(5px);
    box-sizing: border-box;
    overflow: hidden;
    height: auto;
    max-height: 95vh;
    margin: auto;
    transform: translateY(-5%);
}

.body-loaded .container {
    opacity: 1;
    /* 完全显示 */
    transform: translateY(0);
    /* 复位位置 */
}

.user-info {
    margin-bottom: 20px;
    position: relative;
}

.account-info {
    line-height: 1.5;
    font-size: 14px;
    color: #666;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.login-btn {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    background: #07c160;
    color: white;
    border: none;
    padding: 6px 15px;
    border-radius: 15px;
    font-size: 12px;
    cursor: pointer;
}

.product-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    padding: 8px 0;
    overflow: hidden;
    margin: 8px 0;
}

.product-item {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.product-item h3 {
    /* margin: 1px 0;
    font-size: 11px; */
    color: #000;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.product-item p {
    /* margin: 1px 0;
    font-size: 10px; */
    color: #666;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.product-item:hover {
    background: #e9ecef;
}

.quantity-control {
    margin-top: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
}

.quantity-control button {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    padding: 0;
    background: #07c160;
    color: white;
    border: none;
    font-size: 12px;
    line-height: 20px;
}

.quantity-control input {
    width: 32px;
    height: 20px;
    padding: 0;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 10px;
    font-size: 10px;
    pointer-events: none;
    /* 禁止任何交互 */
    user-select: none;
    /* 禁止选择文本 */
    -webkit-user-select: none;
    background-color: #f8f9fa;
    /* 添加背景色表明不可编辑 */
}

/* 登录弹窗样式 */
.login-mask {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.login-box {
    position: relative;
    /* 确保错误提示相对于此容器定位 */
    background: white;
    padding: 25px;
    border-radius: 10px;
    width: 80%;
    max-width: 300px;
    position: relative;
    text-align: center;
}

.login-box h3 {
    margin: 0 0 15px 0;
    color: #333;
}

/* 输入框样式 */
#inputDeviceId {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-sizing: border-box;
    outline: none;
}

#inputDeviceId:focus {
    border-color: #07c160;
    box-shadow: 0 0 5px rgba(7, 193, 96, 0.3);
}

/* 确认按钮样式 */
#confirmLogin {
    width: 100%;
    padding: 10px;
    background: #07c160;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s ease;
}

/* 悬停时按钮样式 */
#confirmLogin:hover {
    background: #05a14c;
}

/* 设备ID无效的提示样式 */
.bind-error-message {
    position: absolute;
    top: -35px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #f44336;
    color: white;
    padding: 6px 12px;
    border-radius: 5px;
    font-size: 14px;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    z-index: 1100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
}

/* 显示提示时的样式 */
.bind-error-message.show {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, -10px);
}

/* 错误提示动画 */
@keyframes fadeInOut {
    0% {
        opacity: 0;
        transform: translate(-50%, -10px);
    }

    10% {
        opacity: 1;
        transform: translate(-50%, 0);
    }

    90% {
        opacity: 1;
        transform: translate(-50%, 0);
    }

    100% {
        opacity: 0;
        transform: translate(-50%, -10px);
    }
}

/* 操作限制样式 */
[data-protected] {
    pointer-events: none;
    opacity: 0.6;
}

#customInput {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-sizing: border-box;
    transition: all 0.3s ease;
    /* 添加过渡效果 */
}

#customInput:focus {
    outline: none;
    border-color: #07c160;
    box-shadow: 0 0 5px rgba(7, 193, 96, 0.3);
    position: relative;
    z-index: 2;
    -webkit-tap-highlight-color: transparent;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

/* 添加输入框的视口处理 */
@viewport {
    viewport-fit: contain;
}

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

.payment-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.price-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
}

.total-points {
    font-size: 14px;
    color: #666;
}

.total-price {
    font-size: 16px;
    color: #333;
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* 修改支付按钮样式 */
#payButton {
    background: rgba(7, 193, 96, 0.9);
    color: white;
    border: none;
    padding: 12px 30px;
    /* 增加内边距使按钮更大 */
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    /* 增大字体 */
    font-weight: 600;
    /* 加粗字体 */
    transition: all 0.3s ease;
}

#payButton:hover {
    background: #07c160;
    transform: scale(1.02);
    /* 悬停时轻微放大效果 */
}

button {
    /* background: #07c160; */
    background: rgba(7, 193, 96, 0.9);
    /* 90%不透明度 */
    transition: background 0.3s ease;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
}

button:hover {
    background: #07c160;
    /* 悬停时完全显示 */
}

/* 在style.css中添加加载样式 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.3s ease;
}

.loader {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #07c160;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

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

    100% {
        transform: rotate(360deg);
    }
}

.wechat-alert {
    text-align: center;
    padding: 40px 20px;
    color: #f56c6c;
}

.retry-btn {
    background: #e6a23c;
    margin-top: 10px;
}

.retry-btn:hover {
    background: #cf9236;
}

/* 余额更新动画 */
.balance-loading {
    display: inline-block;
    animation: balance-loading 1.5s infinite;
    opacity: 0.7;
}

@keyframes balance-loading {
    0% {
        opacity: 0.4;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.4;
    }
}

/* Toast 样式 */
.toast-container {
    position: fixed;
    left: 50%;
    bottom: 30%;
    transform: translateX(-50%);
    z-index: 9999;
    pointer-events: none;
}

.toast-message {
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 10px 20px;
    border-radius: 4px;
    font-size: 14px;
    opacity: 0;
    transform: translateY(20px);
    animation: toastAnimation 2s ease-in-out forwards;
}

@keyframes toastAnimation {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }

    20% {
        opacity: 1;
        transform: translateY(0);
    }

    80% {
        opacity: 1;
        transform: translateY(0);
    }

    100% {
        opacity: 0;
        transform: translateY(-20px);
    }
}

/* 动画保持不变 */
@keyframes heartbeat {
    0% {
        transform: scale(1);
    }

    25% {
        transform: scale(1.1);
    }

    50% {
        transform: scale(1);
    }

    75% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}

.rebate-banner {
    padding: 12px;
    /* 使用更柔和的渐变 */
    background: linear-gradient(135deg, #FF6B6B 0%, #FF4757 100%);
    border-radius: 8px;
    margin: 16px 0;
    text-align: center;
    box-shadow: 0 4px 12px rgba(255, 71, 87, 0.2);
    border: none;
}

.rebate-title {
    font-size: 18px;
    font-weight: bold;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    animation: heartbeat 1.5s infinite;
    display: inline-block;
}

.rebate-tip {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.95);
    margin-left: 8px;
    display: inline-block;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.rebate-countdown {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.9);
    margin-top: 4px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.rebate-plus {
    font-size: 1.2em;
    color: #ff4757;
    font-weight: bold;
    text-shadow: 0 2px 4px rgba(255, 71, 87, 0.3);
}

.balance-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    /* 添加这行，让内容两端对齐 */
    margin-top: 5px;
}

.record-btn {
    display: inline-block;
    padding: 4px 12px;
    background: #f8f9fa;
    color: #333;  /* 改为黑色 */
    border-radius: 12px;
    text-decoration: none;
    font-size: 13px;
    border: 1px solid #e0e0e0;
    margin-left: auto;
    margin-right: 10px;
    font-weight: 500;
}

.record-btn:hover {
    background: #f9f9f9;
    color: #000;  /* hover时更深的黑色 */
}