/* 充值页面样式 */
.recharge-section {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
}

.recharge-container {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 30px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    contain: content; /* 包含内部布局，提高渲染性能 */
}

/* 充值金额选项 */
.section-title {
    margin-bottom: 20px;
    color: var(--text-primary);
    font-weight: 500;
}

.recharge-options {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
    contain: layout style; /* 包含布局变化 */
}

.recharge-option {
    background: var(--gray);
    border: 2px solid transparent;
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.recharge-option:hover {
    background: var(--gray-hover);
}

.recharge-option.active {
    border-color: var(--primary);
    background: var(--primary-light);
}

.recharge-option .amount {
    font-size: 1.25rem;
    font-weight: bold;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.recharge-option .scores {
    font-size: 0.9rem;
    color: var(--text-primary);
}

.discount-tag {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--primary);
    color: var(--text-primary);
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 0 0 0 8px;
}

/* 自定义金额 */
.custom-amount-container {
    margin-bottom: 24px;
    padding: 16px;
    background: var(--gray);
    border-radius: 12px;
    contain: content; /* 包含内部布局变化 */
}

.custom-amount-hint {
    margin-top: 8px;
    font-size: 0.9rem;
    color: var(--text-primary);
}

/* 支付方式选择 */
.payment-methods {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    contain: layout style; /* 包含布局变化 */
}

.payment-method {
    padding: 16px;
    border-radius: 12px;
    background: var(--gray);
    cursor: pointer;
    border: 2px solid transparent;
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    max-width: 200px;
}

.payment-method:hover {
    background: var(--gray-hover);
}

.payment-method.active {
    border-color: var(--primary);
    background: var(--primary-light);
}

.payment-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.payment-icon svg {
    width: 28px;
    height: 28px;
}

.wechat-icon svg {
    fill: #07C160;
}

.alipay-icon svg {
    fill: #1677FF;
}

.payment-name {
    font-weight: 500;
}

/* 充值摘要 */
.recharge-summary {
    background: var(--gray);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 24px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.summary-row:last-child {
    margin-bottom: 0;
    font-weight: bold;
}

/* 充值按钮 */
.recharge-btn {
    width: 100%;
    padding: 14px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
}

.recharge-btn:disabled {
    background: var(--gray);
    color: var(--text-primary);
    cursor: not-allowed;
}

/* 充值记录 */
.recharge-records {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    contain: content; /* 限制重绘范围 */
}

.records-table-container {
    overflow-x: auto;
    margin-bottom: 16px;
    -webkit-overflow-scrolling: touch; /* 提升移动端滚动体验 */
}

.records-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed; /* 使用固定表格布局提高性能 */
}

/* 设置表格各列宽度 */
.records-table th:nth-child(1),
.records-table td:nth-child(1) {
    width: 30%; /* 订单编号列宽度 */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis; /* 超出部分显示省略号 */
}

.records-table th:nth-child(2),
.records-table td:nth-child(2) {
    width: 15%; /* 金额列宽度 */
}

.records-table th:nth-child(3),
.records-table td:nth-child(3) {
    width: 15%; /* 积分列宽度 */
}

.records-table th:nth-child(4),
.records-table td:nth-child(4) {
    width: 15%; /* 状态列宽度 */
}

.records-table th:nth-child(5),
.records-table td:nth-child(5) {
    width: 25%; /* 时间列宽度 */
}

.records-table th,
.records-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.records-table th {
    color: var(--text-primary);
    font-weight: 500;
    white-space: nowrap;
}

.records-table tr:last-child td {
    border-bottom: none;
}

.empty-record td {
    text-align: center;
    color: var(--text-primary);
    padding: 30px 0;
}

/* 订单状态标签 */
.status-tag {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.85rem;
}

.status-unpaid {
    background: #FFF7E6;
    color: #D48806;
}

.status-paid {
    background: #F6FFED;
    color: #52C41A;
}

.status-closed {
    background: #F5F5F5;
    color: #00000073;
}

.status-refunded {
    background: #F9F0FF;
    color: #722ED1;
}

/* 分页 */
.records-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    contain: layout style; /* 限制重绘范围 */
}

.page-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    background: transparent;
    cursor: pointer;
}

.page-btn:hover {
    background: var(--gray);
}

.page-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--text-primary);
}

/* 支付二维码模态框 */
.payment-qr-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    z-index: 1000;
}

.payment-qr-modal.active {
    display: block;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--card-bg);
    width: 90%;
    max-width: 400px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    contain: content; /* 限制重绘范围 */
}

.modal-header {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.2rem;
}

.modal-close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
}

.qr-code-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
}

.qr-code {
    margin-bottom: 15px;
}

.qr-info {
    text-align: center;
}

.qr-amount {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 5px;
}

.qr-order-no, .qr-expiry {
    font-size: 0.9rem;
    color: var(--text-primary);
    margin-bottom: 5px;
}

.payment-help {
    text-align: center;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.payment-help p {
    margin-bottom: 10px;
}

.payment-help p:last-child {
    margin-bottom: 0;
}

.modal-footer {
    padding: 16px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.payment-status {
    color: var(--text-primary);
}

.payment-status.success {
    color: #52C41A;
}

.cancel-btn {
    background: var(--gray);
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
}

.cancel-btn:hover {
    background: var(--gray-hover);
}

.payment-success-message {
    margin-bottom: 0;
}

/* iframe支付容器样式 */
.iframe-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
    width: 100%;
    overflow: hidden;
}

#payment-iframe {
    border: none;
    background: #fff;
    width: 300px;
    height: 300px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* 响应式调整 */
@media (max-width: 768px) {
    .iframe-container {
        padding: 0;
    }
    
    #payment-iframe {
        width: 100%;
        max-width: 300px;
    }
}

/* 响应式布局 */
@media (max-width: 768px) {
    .recharge-options {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .payment-methods {
        flex-direction: column;
    }
    
    .payment-method {
        max-width: 100%;
    }
    
    .records-table th:nth-child(1),
    .records-table td:nth-child(1) {
        display: none;
    }
}
.payment-link {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5px 10px;
    background-color: #0019d7;
    color: var(--text-primary);
    text-decoration: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: bold;
    margin: 10px auto;
    transition: all 0.3s ease;
    width: 80%;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.payment-link:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    transform: translateY(-2px);
}

.payment-link .link-icon {
    margin-right: 8px;
    font-size: 18px;
}
