* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

body {
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
        "Microsoft YaHei", Arial, sans-serif;
    color: #222;
    -webkit-font-smoothing: antialiased;
}

.page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
}

.card {
    width: 100%;
    max-width: 760px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.28);
    overflow: hidden;
}

.head {
    padding: 30px;
    text-align: center;
    color: #fff;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.head h1 {
    margin: 0 0 8px;
    font-size: 28px;
    font-weight: 600;
}

.head p {
    margin: 0;
    font-size: 14px;
    opacity: 0.9;
}

.view {
    padding: 32px 30px 36px;
}

.hidden {
    display: none !important;
}

.alert {
    margin: 18px 30px 0;
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.6;
    background: #fdecea;
    color: #b3261e;
    border: 1px solid #f5c6c2;
}

.alert.success {
    background: #e7f6ec;
    color: #1e7a3c;
    border-color: #bfe5cb;
}

.label {
    display: block;
    margin-bottom: 12px;
    font-size: 16px;
    font-weight: 600;
}

.amount-row {
    position: relative;
}

.cny {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 22px;
    font-weight: 700;
    color: #667eea;
}

.amount-input {
    width: 100%;
    padding: 16px 16px 16px 40px;
    font-size: 22px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

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

.rate-box {
    margin: 20px 0 24px;
    padding: 16px 20px;
    background: #f8f9ff;
    border: 1px solid #e0e5ff;
    border-radius: 10px;
}

.rate-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    font-size: 14px;
    color: #555;
}

.rate-line.total {
    margin-top: 6px;
    padding-top: 12px;
    border-top: 1px dashed #ccd3ff;
    font-size: 16px;
}

.rate-line.total strong {
    font-size: 22px;
    color: #4b5bd6;
}

.hint {
    margin: 8px 0 0;
    text-align: center;
    font-size: 12px;
    color: #98a;
}

.btn {
    width: 100%;
    border: 0;
    border-radius: 10px;
    padding: 15px 18px;
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}

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

.btn.primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.btn.secondary {
    background: #f0f0f4;
    color: #555;
}

.btn.secondary:hover {
    background: #e4e4ec;
}

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

.meta-box {
    margin-bottom: 20px;
    padding: 14px 18px;
    background: #f8f9fa;
    border-radius: 10px;
}

.meta-line {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 5px 0;
    font-size: 14px;
    color: #666;
}

.meta-line span:last-child {
    color: #222;
    font-weight: 600;
    text-align: right;
    word-break: break-all;
}

.mono {
    font-family: ui-monospace, Consolas, "Courier New", monospace;
    font-size: 13px;
}

.qr-box {
    margin-bottom: 18px;
    padding: 16px;
    text-align: center;
    border: 2px solid #e6e6e6;
    border-radius: 12px;
}

.qrcode {
    display: inline-block;
    line-height: 0;
}

.qrcode canvas,
.qrcode img {
    width: 240px;
    height: 240px;
}

.qr-box p {
    margin: 12px 0 0;
    font-size: 14px;
    color: #555;
}

.pay-frame {
    width: 100%;
    height: 600px;
    margin-bottom: 18px;
    background: #f8f8fa;
    border: 2px solid #e6e6e6;
    border-radius: 12px;
}

.status {
    margin: 14px 0 18px;
    text-align: center;
    font-size: 15px;
    color: #666;
}

.status.warn {
    color: #a26a00;
}

.actions {
    display: flex;
    gap: 12px;
}

.actions .btn {
    padding: 12px;
    font-size: 15px;
}

.success-view {
    padding: 44px 30px;
    text-align: center;
}

.check {
    width: 70px;
    height: 70px;
    line-height: 70px;
    margin: 0 auto 18px;
    border-radius: 50%;
    background: #e7f6ec;
    color: #1e9d4b;
    font-size: 38px;
    font-weight: 700;
}

.success-view h2 {
    margin: 0 0 12px;
    font-size: 24px;
}

.success-info {
    margin: 0 0 26px;
    font-size: 14px;
    color: #555;
    word-break: break-all;
}

.footer {
    margin: 18px 0 0;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.85);
    text-align: center;
}

@media (max-width: 768px) {
    .head {
        padding: 24px 20px;
    }

    .head h1 {
        font-size: 22px;
    }

    .view {
        padding: 26px 20px 30px;
    }

    .alert {
        margin: 14px 20px 0;
    }

    .pay-frame {
        height: 520px;
    }
}

@media (max-width: 480px) {
    .qrcode canvas,
    .qrcode img {
        width: 220px;
        height: 220px;
    }

    .pay-frame {
        height: 460px;
    }

    .actions {
        flex-direction: column;
    }
}
