/* 支付页面样式 - 简洁设计，避免滚动 */
:root {
    --primary-color: #4361ee;
    --primary-light: #eef2ff;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
}

body {
    background: #f8fafc;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 简约导航栏 */
.simple-nav {
    background: white;
    border-bottom: 1px solid #e5e7eb;
    padding: 16px 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.nav-content {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 18px;
    text-decoration: none;
}

.nav-logo:hover {
    color: var(--primary-color);
}

/* 支付主容器 */
.payment-wrapper {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.payment-main {
    display: grid;
    grid-template-columns: 400px 450px;
    gap: 40px;
    max-width: 900px;
    width: 100%;
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    max-height: 850px; /* 限制最大高度，避免滚动 */
}

/* 左侧订单信息 */
.order-section {
    padding: 40px 30px;
    background: linear-gradient(135deg, #f6f7ff, #f0f5ff);
    border-right: 1px solid #e5e7eb;
}

.order-status {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 30px;
    font-size: 16px;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: var(--primary-color);
    border-radius: 50%;
    animation: pulse 1.5s infinite;
}

.order-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 30px;
}

.order-info {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.info-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.info-label {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

.info-value {
    font-size: 15px;
    color: var(--text-primary);
    font-weight: 500;
}

.order-id {
    font-family: monospace;
    background: rgba(0, 0, 0, 0.03);
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    font-size: 14px;
}

.total-amount {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid var(--primary-light);
}

.total-amount .info-label {
    font-size: 14px;
    color: var(--text-secondary);
}

.total-amount .info-value {
    font-size: 28px;
    color: var(--primary-color);
    font-weight: 700;
}

/* 右侧支付操作 */
.payment-section {
    padding: 40px 30px;
    display: flex;
    flex-direction: column;
    overflow: hidden; /* 防止内容超出 */
}

.payment-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 30px;
}

/* 支付方式选择 */
.payment-methods {
    margin-bottom: 30px;
}

.method-label {
    display: block;
    margin-bottom: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.methods-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.method-radio {
    display: none;
}

.method-label-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.method-label-card:hover {
    border-color: var(--primary-color);
    background: var(--primary-light);
}

.method-radio:checked + .method-label-card {
    border-color: var(--primary-color);
    background: var(--primary-light);
    position: relative;
}

.method-radio:checked + .method-label-card::after {
    content: "✓";
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--primary-color);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
}

.method-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.method-icon.wechat {
    background: rgba(9, 187, 7, 0.1);
    color: #09bb07;
}

.method-icon.alipay {
    background: rgba(22, 119, 255, 0.1);
    color: #1677ff;
}

.method-text {
    flex: 1;
}

.method-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.method-desc {
    font-size: 12px;
    color: var(--text-secondary);
}

/* 支付二维码区域 */
.qr-section {
    display: none; /* 默认隐藏 */
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    animation: fadeIn 0.3s ease;
    margin-top: 20px;
    width: 100%;
    padding: 0 20px;
}

.qr-section.active {
    display: flex;
}

.qr-code-wrapper {
    width: 240px;
    height: 240px;
    padding: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    position: relative;
}

.qr-code-wrapper::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border-radius: 16px;
    background: linear-gradient(135deg, #09bb07, #1677ff);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.qr-code-wrapper:hover::before {
    opacity: 0.1;
}

.qr-code {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 64px;
    min-width: 200px;
    min-height: 200px;
}

.qr-code.wechat { color: #09bb07; }
.qr-code.alipay { color: #1677ff; }

.qr-code img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 8px;
}

.qr-info {
    background: #f8fafc;
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 16px;
    width: 100%;
    max-width: 400px;
    box-sizing: border-box;
    text-align: center;
}

.qr-order-info {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 12px;
}

.qr-order-info div {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    color: var(--text-primary);
}

.qr-instruction {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e5e7eb;
}

.payment-instruction {
    background: #f8fafc;
    border-radius: 8px;
    padding: 14px;
    margin-bottom: 16px;
    width: 100%;
    max-width: 400px;
    box-sizing: border-box;
}

.payment-instruction h4 {
    margin: 0 0 8px 0;
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 600;
}

.payment-instruction ol {
    margin: 0;
    padding-left: 20px;
    font-size: 12px;
    color: var(--text-secondary);
}

.payment-instruction li {
    margin-bottom: 4px;
    line-height: 1.5;
}

.countdown {
    background: #fef3c7;
    border: 1px solid #fbbf24;
    border-radius: 8px;
    padding: 8px 14px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #92400e;
    font-size: 13px;
    margin-bottom: 0;
}

.countdown.warning {
    background: #fee2e2;
    border-color: #ef4444;
    color: #991b1b;
}

/* 支付按钮 */
.payment-actions {
    margin-top: auto; /* 将按钮推到容器底部 */
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}

.payment-buttons {
    display: flex;
    gap: 12px;
}

.btn-pay {
    flex: 2;
    background: linear-gradient(135deg, var(--primary-color), #5a75fd);
    color: white;
    border: none;
    padding: 16px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-pay:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(67, 97, 238, 0.3);
}

.btn-pay:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-cancel {
    flex: 1;
    background: white;
    color: var(--text-secondary);
    border: 1px solid #d1d5db;
    padding: 16px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-cancel:hover {
    background: #f9fafb;
    border-color: #9ca3af;
}

/* 成功页面 */
.success-section {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    padding: 40px 20px;
}

.success-section.active {
    display: flex;
}

.success-icon {
    width: 80px;
    height: 80px;
    background: var(--success-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    color: white;
    margin: 0px 36%; /* 修改这一行，上下0，左右auto */
    box-shadow: 0 10px 25px rgba(16, 185, 129, 0.3);
}

.success-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.success-info {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 12px;
    padding: 20px;
    margin: 24px 0;
    width: 100%;
    max-width: 400px;
}

.info-row.success {
    flex-direction: row;
    justify-content: space-between;
    margin-bottom: 12px;
}

.btn-download {
    background: linear-gradient(135deg, var(--success-color), #34d399);
    color: white;
    border: none;
    padding: 16px 32px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin: 20px 0;
}

.btn-download:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.3);
}

/* 加载动画 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.loading-content {
    text-align: center;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

/* 动画 */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

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

/* 响应式设计 */
@media (max-width: 900px) {
    .payment-main {
        grid-template-columns: 1fr;
        max-width: 500px;
        max-height: none;
    }

    .order-section {
        border-right: none;
        border-bottom: 1px solid #e5e7eb;
    }
}

@media (max-width: 480px) {
    .payment-wrapper {
        padding: 10px;
    }

    .payment-main {
        border-radius: 12px;
    }

    .order-section,
    .payment-section {
        padding: 30px 20px;
    }

    .methods-grid {
        grid-template-columns: 1fr;
    }

    .qr-code-wrapper {
        width: 200px;
        height: 200px;
    }

    .qr-code {
        width: 160px;
        height: 160px;
        font-size: 48px;
    }
}
