/* 全局样式 */
*, *::before, *::after {
    box-sizing: border-box;
}

.diff_body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f5f5f7;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

/* 触发按钮样式 */
.open-modal-button {
    padding: 14px 28px;
    font-size: 18px;
    color: #fff;
    background-color: #0071e3;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: background-color 0.3s;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.open-modal-button:hover {
    background-color: #005bb5;
}

/* 模态框背景 */
.modal {
    display: none; /* 默认隐藏 */
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: hidden; /* 防止整体滚动 */
    background-color: rgba(0,0,0,0.5);
    justify-content: center;
    align-items: center;
    padding: 20px;
}

/* 模态框内容 */
.modal-content {

    background-color: #fff;
    padding: 32px;
    border-radius: 16px;
    width: 100%;
    max-width: 900px; /* 保持宽度 */
    position: relative;
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
    animation: fadeIn 0.3s ease-out;
    max-height: 90vh; /* 设置最大高度为视口高度的90% */
    overflow: hidden; /* 防止内容溢出影响圆角 */
}

/* 新增的 .modal-body 容器 */
.modal-content .modal-body {
    padding-top: 30px;
    max-height: calc(90vh - 150px); /* 根据需要调整 */
    overflow-y: auto; /* 启用垂直滚动 */
}

/* Webkit 浏览器滚动条样式 */
.modal-content .modal-body::-webkit-scrollbar {
    width: 8px; /* 滚动条宽度 */
}

.modal-content .modal-body::-webkit-scrollbar-track {
    background: #f1f1f1; /* 滚动条轨道颜色 */
    border-radius: 4px;
}

.modal-content .modal-body::-webkit-scrollbar-thumb {
    background-color: #c1c1c1; /* 滚动条滑块颜色 */
    border-radius: 4px;
    border: 2px solid #f1f1f1; /* 滚动条滑块与轨道之间的间距 */
    transition: background-color 0.3s;
}

.modal-content .modal-body::-webkit-scrollbar-thumb:hover {
    background-color: #a8a8a8; /* 滚动条滑块悬停时的颜色 */
}

/* Firefox 滚动条样式 */
.modal-content .modal-body {
    scrollbar-width: thin; /* 滚动条宽度：auto | thin | none */
    scrollbar-color: #c1c1c1 #f1f1f1; /* 滚动条滑块颜色 和 轨道颜色 */
}

/* 关闭按钮 */
.close-button {
    position: absolute;
    top: 24px;
    right: 24px;
    font-size: 28px;
    color: #aaa;
    cursor: pointer;
    transition: color 0.3s;
}

.close-button:hover {
    color: #000;
}

/* 标题 */
.modal-content h2 {
    margin-top: 0;
    margin-bottom: 24px;
    font-size: 28px;
    color: #333;
    text-align: center;
}

/* 支付方式按钮 */
.payment-methods {
    display: flex;
    justify-content: space-between;
    margin-bottom: 32px;
}

.payment-method {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px;
    margin: 0 12px;
    border: 1px solid #ddd;
    border-radius: 12px;
    background-color: #fafafa;
    cursor: pointer;
    transition: border-color 0.3s, background-color 0.3s, transform 0.2s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.payment-method.selected, .payment-method:hover {
    border-color: #0071e3;
    background-color: #e6f0ff;
    transform: translateY(-2px);
}

.payment-method img {
    width: 50px;
    height: 50px;
    margin-bottom: 12px;
}

.payment-method span#userPoints {
    display: block;
    margin-top: 6px;
    font-size: 16px;
    color: #555;
}

/* 付款项列表 */
.payment-items {
    margin-bottom: 32px;
    padding-right: 8px; /* 为滚动条预留空间 */
}

/* 付款项卡片 */
.payment-items .item-card {
    border: 1px solid #eee;
    border-radius: 12px;
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    padding: 8px 16px; /* 缩小内边距 */
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 150px; /* 设置固定高度为原来的一半，根据需要调整 */
}

/* 订单号 */
.payment-items .item-card .item-header {
    display: flex;
    justify-content: flex-start;
    margin-bottom: 4px; /* 缩小下边距 */
}

.payment-items .item-card .order-number {
    font-size: 14px; /* 缩小字体大小 */
    color: #555;
}

/* 主要信息 */
.payment-items .item-card .item-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px; /* 缩小下边距 */
}

.payment-items .item-card .item-name {
    flex: 2;
    font-size: 16px; /* 缩小字体大小 */
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.payment-items .item-card .item-type {
    flex: 1;
    font-size: 14px; /* 缩小字体大小 */
    color: #555;
    text-align: center;
}

.payment-items .item-card .item-amount {
    flex: 1;
    font-size: 16px; /* 保持字体大小 */
    color: #0071e3;
    text-align: right;
}

/* 收款备注 */
.payment-items .item-card .item-remark {
    font-size: 12px; /* 缩小字体大小 */
    color: #777;
    padding-top: 4px; /* 缩小上内边距 */
    border-top: 1px solid #eee;
}

/* 总计样式 */
.payment-items .total {
    display: flex;
    justify-content: flex-end;
    font-size: 18px; /* 缩小字体大小 */
    color: #333;
    margin-top: 8px; /* 缩小上边距 */
}

.payment-items .total span:first-child {
    margin-right: 8px; /* 缩小右边距 */
}

/* 立即支付按钮 */
.pay-now-button {
    width: 100%;
    padding: 16px;
    font-size: 20px;
    color: #fff;
    background-color: #0071e3;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: background-color 0.3s;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.pay-now-button:hover {
    background-color: #005bb5;
}

/* 积分不足提示信息 */
.points-message {
    margin-bottom: 24px;
    padding: 16px;
    background-color: #ffe6e6;
    color: #d8000c;
    border: 1px solid #d8000c;
    border-radius: 12px;
    text-align: center;
    font-size: 16px;
}

/* 隐藏元素 */
.hidden {
    display: none;
}

/* 禁用的立即支付按钮 */
.pay-now-button.disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

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

/* 响应式设计 */
@media (max-width: 768px) {
    .modal-content .modal-body {
        max-height: calc(90vh - 150px); /* 根据需要调整 */
    }

    .payment-items .item-card {
        height: auto; /* 允许高度自适应 */
    }

    .payment-items .item-card .item-main {
        flex-direction: column;
        align-items: flex-start;
    }

    .payment-items .item-card .item-name,
    .payment-items .item-card .item-type,
    .payment-items .item-card .item-amount {
        text-align: left;
        margin-bottom: 4px;
    }

    .payment-items .total {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .modal-content .modal-body {
        max-height: calc(90vh - 150px); /* 根据需要调整 */
    }

    .payment-items .item-card {
        padding: 6px 12px; /* 进一步缩小内边距 */
    }

    .payment-items .item-card .order-number {
        font-size: 12px;
    }

    .payment-items .item-card .item-main {
        flex-direction: column;
        align-items: flex-start;
    }

    .payment-items .item-card .item-name {
        font-size: 14px;
    }

    .payment-items .item-card .item-type {
        font-size: 12px;
    }

    .payment-items .item-card .item-amount {
        font-size: 14px;
    }

    .payment-items .item-card .item-remark {
        font-size: 10px;
    }

    .payment-items .total {
        font-size: 16px;
        margin-top: 6px;
    }
}
