/* 费用中心样式 */

.cost-center-container {
    padding: 20px;
    max-width: 1400px;
    margin: 0 auto;
}

/* ==================== 支付弹窗样式 ==================== */
.payment-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10001;
    justify-content: center;
    align-items: center;
}

.payment-modal.show {
    display: flex;
}

.payment-modal-content {
    background: white;
    border-radius: 8px;
    width: 380px;
    max-width: 90%;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.payment-modal-header {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px 24px 16px;
    position: relative;
}

.payment-modal-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 500;
    color: #333;
}

.payment-close-btn {
    position: absolute;
    right: 20px;
    top: 20px;
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    padding: 0;
    line-height: 1;
}

.payment-close-btn:hover {
    background: transparent;
    color: #666;
}

.payment-modal-body {
    padding: 16px 24px 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.payment-amount {
    margin-bottom: 24px;
}

.payment-amount .amount-label {
    font-size: 14px;
    color: #666;
    margin-right: 8px;
}

.payment-amount .amount-value {
    font-size: 20px;
    font-weight: 600;
    color: #1e5fdb;
}

.payment-qrcode {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 12px;
    width: 100%;
}

.payment-qrcode #paymentQRCode {
    width: 200px;
    height: 200px;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

.payment-qrcode #paymentQRCode canvas,
.payment-qrcode #paymentQRCode img {
    width: 100% !important;
    height: 100% !important;
    display: block;
    margin: 0 auto;
}

.payment-hint {
    font-size: 14px;
    color: #666;
    margin-bottom: 12px;
}

.payment-method-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.payment-method-logo img {
    height: 32px;
    object-fit: contain;
}

.payment-modal-footer {
    display: flex;
    gap: 10px;
    padding: 0 24px 20px;
    justify-content: flex-end;
}

.payment-btn-back,
.payment-btn-confirm {
    height: 32px;
    padding: 0 20px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.payment-btn-back {
    background: white;
    color: #666;
    border: 1px solid #d9d9d9;
}

.payment-btn-back:hover {
    color: #1e5fdb;
    border-color: #1e5fdb;
}

.payment-btn-confirm {
    background: #1e5fdb;
    color: white;
}

.payment-btn-confirm:hover {
    background: #1651c5;
}

/* 标签页 */
.tabs {
    display: flex;
    border-bottom: 2px solid #e8e8e8;
    margin-bottom: 24px;
}

.tab-btn {
    padding: 12px 24px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 16px;
    color: #666;
    position: relative;
    transition: all 0.3s;
}

.tab-btn:hover {
    color: #1e5fdb;
}

.tab-btn.active {
    color: #1e5fdb;
    font-weight: 500;
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: #1e5fdb;
}

/* 余额和套餐区域 */
.balance-section {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 20px;
    margin-bottom: 32px;
}

.balance-card {
    background: white;
    padding: 24px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.balance-header h3 {
    font-size: 14px;
    color: #666;
    margin: 0 0 16px 0;
    font-weight: 500;
}

.balance-card .balance-amount {
    margin-bottom: 20px;
}

.amount-value {
    font-size: 48px;
    font-weight: 600;
    color: #333;
}

.amount-unit {
    font-size: 16px;
    color: #999;
    margin-left: 8px;
}

.package-info {
    border-top: 1px solid #f0f0f0;
    padding-top: 16px;
}

.package-type {
    margin-bottom: 8px;
}

.type-label {
    display: inline-block;
    padding: 4px 12px;
    background: #e6f7ff;
    color: #1890ff;
    border-radius: 4px;
    font-size: 12px;
}

.package-desc {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #666;
}

.info-btn {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 1px solid #d9d9d9;
    background: white;
    color: #999;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.info-btn:hover {
    border-color: #1e5fdb;
    color: #1e5fdb;
}

/* 账单详情 */
.account-detail {
    background: white;
    padding: 24px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.detail-header {
    margin-bottom: 20px;
}

.detail-header h3 {
    font-size: 16px;
    color: #333;
    margin: 0;
}

.detail-content {
    margin-bottom: 20px;
}

.detail-row {
    display: flex;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

.detail-label {
    font-size: 14px;
    color: #666;
    margin-right: 16px;
}

.detail-value {
    font-size: 14px;
    color: #333;
}

.detail-value .num-value {
    color: #1e5fdb;
    font-weight: 600;
    margin: 0 4px;
}

.detail-actions {
    display: flex;
    gap: 12px;
    padding-top: 16px;
}

/* 交易记录 */
.transaction-section {
    background: white;
    padding: 24px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.section-header {
    margin-bottom: 20px;
}

.section-header h3 {
    font-size: 16px;
    color: #333;
    margin: 0;
}

.transaction-table-wrapper {
    overflow-x: auto;
    margin-bottom: 16px;
}

.transaction-table {
    width: 100%;
    border-collapse: collapse;
}

.transaction-table thead {
    background: #fafafa;
}

.transaction-table th {
    padding: 12px 16px;
    text-align: left;
    font-size: 14px;
    color: #666;
    font-weight: 500;
    border-bottom: 1px solid #f0f0f0;
}

.transaction-table td {
    padding: 16px;
    font-size: 14px;
    color: #333;
    border-bottom: 1px solid #f0f0f0;
}

.empty-data {
    text-align: center !important;
    color: #999 !important;
    padding: 40px !important;
}

/* 分页 */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 20px;
    gap: 30px;
}

.pagination-info {
    font-size: 14px;
    color: #666;
}

.page-size-select {
    padding: 0;
    border: none;
    background: transparent;
    font-size: 14px;
    cursor: pointer;
    outline: none;
    color: #666;
}

.page-size-select:hover {
    color: #1e5fdb;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.page-btn {
    padding: 0;
    border: none;
    background: transparent;
    font-size: 14px;
    cursor: pointer;
    color: #666;
    transition: color 0.2s;
}

.page-btn:hover:not(:disabled) {
    color: #1e5fdb;
}

.page-btn:disabled {
    cursor: not-allowed;
    opacity: 0.3;
}

.page-jump {
    font-size: 14px;
    color: #666;
}

.page-input {
    width: 50px;
    height: 30px;
    padding: 0;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    text-align: center;
    font-size: 14px;
    line-height: 28px;
    outline: none;
    transition: border-color 0.2s;
    -moz-appearance: textfield;
}

.page-input::-webkit-outer-spin-button,
.page-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.page-input:focus {
    border-color: #1e5fdb;
}

/* 套餐弹窗 */
.package-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    padding: 20px 0;
}

.package-option {
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    padding: 24px;
    text-align: center;
    transition: all 0.3s;
    position: relative;
}

.package-option:hover {
    border-color: #1e5fdb;
    box-shadow: 0 4px 12px rgba(30, 95, 219, 0.15);
    transform: translateY(-4px);
}

.package-option.highlight {
    border-color: #1e5fdb;
    background: linear-gradient(180deg, #f0f5ff 0%, white 30%);
}

.recommend-tag {
    position: absolute;
    top: -10px;
    right: 20px;
    background: linear-gradient(135deg, #1e5fdb 0%, #0d3e9e 100%);
    color: white;
    padding: 4px 16px;
    border-radius: 12px;
    font-size: 12px;
}

.package-option h4 {
    font-size: 18px;
    color: #333;
    margin: 0 0 16px 0;
}

.package-price {
    font-size: 32px;
    font-weight: 600;
    color: #1e5fdb;
    margin: 0 0 20px 0;
}

.package-features {
    list-style: none;
    padding: 0;
    margin: 0 0 24px 0;
    text-align: left;
}

.package-features li {
    padding: 8px 0;
    color: #666;
    font-size: 14px;
}

.package-features li::before {
    content: '✓';
    color: #52c41a;
    margin-right: 8px;
    font-weight: bold;
}

/* 响应式 */
@media (max-width: 1024px) {
    .balance-section {
        grid-template-columns: 1fr;
    }
    
    .package-options {
        grid-template-columns: 1fr;
    }
}


/* 顶部操作栏 */
.cost-top-bar {
    background: white;
    padding: 16px 20px;
    margin-bottom: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.cost-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.balance-display {
    display: flex !important;
    align-items: center !important;
    gap: 4px !important;
    padding: 0 16px;
    border-left: 1px solid #e8e8e8;
    border-right: 1px solid #e8e8e8;
}

.cost-actions .balance-display .balance-label {
    font-size: 14px !important;
    color: #666 !important;
    line-height: 1 !important;
}

.cost-actions .balance-display .balance-amount {
    font-size: 14px !important;
    font-weight: 600 !important;
    color: #333 !important;
    line-height: 1 !important;
    position: relative !important;
    top: 0.5px !important;
}

.cost-actions .balance-display .balance-number {
    font-size: 14px !important;
    font-weight: 600 !important;
    color: #333 !important;
    line-height: 1 !important;
}

.btn-default {
    background: white;
    color: #666;
    border: 1px solid #d9d9d9;
}

.btn-default:hover {
    color: #1e5fdb;
    border-color: #1e5fdb;
}

/* 按钮基础样式 */
.btn {
    padding: 8px 20px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
    outline: none;
}

.btn-primary {
    background: linear-gradient(135deg, #1e5fdb 0%, #0d3e9e 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(30, 95, 219, 0.3);
}

.btn-secondary {
    background: #f5f7fa;
    color: #666;
    border: 1px solid #d9d9d9;
}

.btn-secondary:hover {
    background: #e8f0fe;
    color: #1e5fdb;
    border-color: #1e5fdb;
}

/* 账单卡片（合并版） */
.bill-card {
    display: flex;
    gap: 20px;
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    margin-bottom: 20px;
    max-width: 800px;
}

.bill-left {
    flex: 1;
    padding-right: 20px;
    border-right: 1px solid #f0f0f0;
}

.bill-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.bill-right {
    flex: 1.5;
}

.bill-label {
    font-size: 14px;
    color: #666;
}

.bill-right .bill-label {
    margin-bottom: 12px;
}

.bill-value {
    margin-bottom: 16px;
}

.bill-value .amount-value {
    font-size: 36px;
    font-weight: 600;
    color: #1e5fdb;
}

.bill-value .amount-unit {
    font-size: 14px;
    color: #999;
    margin-left: 4px;
}

.package-tag {
    display: inline-block;
}

.bill-detail {
    display: flex;
    align-items: center;
    padding: 12px 0;
    margin-bottom: 16px;
}

.bill-action {
    display: flex;
    gap: 12px;
}

/* 温馨提示区域 */
.bill-tips {
    flex: 1;
    padding-left: 20px;
    border-left: 1px solid #f0f0f0;
}

.tips-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.tips-icon {
    font-size: 18px;
}

.tips-title {
    font-size: 14px;
    font-weight: 500;
    color: #666;
}

.tips-content {
    font-size: 13px;
    color: #999;
    line-height: 1.8;
}

.tips-content p {
    margin: 8px 0;
}

/* 调整账单卡片布局为三列 */
.bill-card {
    display: flex;
    gap: 0;
    max-width: 100%;
}

.bill-card .bill-left,
.bill-card .bill-right,
.bill-card .bill-tips {
    flex: 1;
    padding: 0 20px;
}

.bill-card .bill-left {
    border-right: 1px solid #f0f0f0;
}

.bill-card .bill-right {
    border-right: 1px solid #f0f0f0;
}

/* ==================== 在线充值弹窗样式 ==================== */

.recharge-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.recharge-modal.show {
    display: flex;
}

.recharge-modal-content {
    background: white;
    border-radius: 8px;
    width: 480px;
    max-width: 90%;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

.recharge-modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.recharge-modal-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.recharge-close-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.3s;
}

.recharge-close-btn:hover {
    background: #f5f5f5;
    color: #666;
}

.recharge-modal-body {
    padding: 24px 20px;
}

.recharge-section {
    margin-bottom: 20px;
}

.recharge-section:last-child {
    margin-bottom: 0;
}

.recharge-label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.recharge-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 14px;
    outline: none;
    transition: all 0.3s;
    box-sizing: border-box;
}

.recharge-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.recharge-input[readonly] {
    background-color: #f7fafc;
    cursor: not-allowed;
    color: #333;
}

.recharge-input[readonly]:focus {
    border-color: #e2e8f0;
    box-shadow: none;
}

.recharge-tip {
    margin-top: 6px;
    font-size: 12px;
    color: #999;
}

/* 充值档位选择 */
.recharge-amounts {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}

.recharge-amount-btn {
    flex: 1;
    padding: 10px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: white;
    color: #333;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    outline: none;
}

.recharge-amount-btn:hover {
    border-color: #667eea;
    color: #667eea;
    background: #f7fafc;
}

.recharge-amount-btn.active {
    border-color: #667eea;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.recharge-payment-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.recharge-payment-btn {
    padding: 20px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100px;
}

.recharge-payment-btn:hover {
    border-color: #667eea;
    background: #f7fafc;
}

.recharge-payment-btn.active {
    border-color: #667eea;
    background: #eef2ff;
    position: relative;
}

.recharge-payment-btn.active::after {
    content: '✓';
    position: absolute;
    top: 6px;
    right: 6px;
    width: 20px;
    height: 20px;
    background: #667eea;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

.recharge-payment-logo {
    width: 120px;
    height: auto;
    max-height: 80px;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

.recharge-modal-footer {
    padding: 16px 20px;
    border-top: 1px solid #f0f0f0;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.recharge-btn-cancel,
.recharge-btn-submit {
    padding: 10px 24px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
    border: none;
    font-weight: 500;
}

.recharge-btn-cancel {
    background: #f5f5f5;
    color: #666;
}

.recharge-btn-cancel:hover {
    background: #e0e0e0;
}

.recharge-btn-submit {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.recharge-btn-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.recharge-btn-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* ==================== 自定义对话框 ==================== */

/* 确认对话框 */
.custom-dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10002;
    backdrop-filter: blur(2px);
}

.custom-dialog {
    background: white;
    border-radius: 12px;
    width: 420px;
    max-width: 90%;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    animation: dialogSlideIn 0.3s ease-out;
}

@keyframes dialogSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.custom-dialog-header {
    padding: 20px 24px 16px;
    border-bottom: 1px solid #e2e8f0;
}

.custom-dialog-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #2d3748;
}

.custom-dialog-body {
    padding: 24px;
    font-size: 14px;
    line-height: 1.8;
    color: #4a5568;
    max-height: 400px;
    overflow-y: auto;
}

.custom-dialog-body p {
    margin: 0 0 12px;
}

.custom-dialog-body p:last-child {
    margin-bottom: 0;
}


.custom-dialog-footer {
    padding: 16px 24px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.dialog-btn {
    padding: 8px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.dialog-btn-cancel {
    background: #f7fafc;
    color: #4a5568;
}

.dialog-btn-cancel:hover {
    background: #e2e8f0;
}

.dialog-btn-confirm {
    background: #1e5fdb;
    color: white;
}

.dialog-btn-confirm:hover {
    background: #1651c4;
    box-shadow: 0 2px 8px rgba(30, 95, 219, 0.3);
}

/* 提示对话框 */
.custom-alert-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10002;
    backdrop-filter: blur(2px);
}

.custom-alert {
    background: white;
    border-radius: 12px;
    width: 400px;
    max-width: 90%;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    animation: dialogSlideIn 0.3s ease-out;
}

.custom-alert-header {
    padding: 20px 24px 16px;
    border-bottom: 1px solid #e2e8f0;
}

.custom-alert-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #2d3748;
}

.custom-alert-body {
    padding: 24px;
    font-size: 14px;
    line-height: 1.8;
    color: #4a5568;
    text-align: center;
}

.custom-alert-footer {
    padding: 16px 24px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: center;
}

.alert-btn {
    padding: 8px 32px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.alert-btn-confirm {
    background: #1e5fdb;
    color: white;
}

.alert-btn-confirm:hover {
    background: #1651c4;
    box-shadow: 0 2px 8px rgba(30, 95, 219, 0.3);
}


/* 禁用按钮样式 */
.btn.disabled-btn,
.btn:disabled {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
    pointer-events: auto !important;
    position: relative;
}

.btn.disabled-btn:hover,
.btn:disabled:hover {
    transform: none !important;
    box-shadow: none !important;
    background: #1e5fdb !important;
}

.btn.disabled-btn::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}

.btn.disabled-btn:hover::after {
    opacity: 1;
}
