* {
    -webkit-tap-highlight-color: transparent;
}

[hidden] {
    display: none !important;
}

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

body {
    background: #ececee;
    color: #333;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.page {
    width: 100%;
    max-width: 780px;
    margin: 0 auto 40px;
    background: #fff;
    box-shadow: 0 2px 24px rgba(0, 0, 0, 0.06);
}

.banner img {
    display: block;
    width: 100%;
    height: auto;
}

.card {
    padding: 0 28px 44px;
}

.form-title {
    margin: 26px 0 26px;
    font-size: 20px;
    line-height: 1.4;
    font-weight: 700;
    color: #111;
    text-align: center;
}

/* 表单 */
.field {
    margin-bottom: 20px;
}

.label {
    margin-bottom: 8px;
    font-size: 13.5px;
    color: #333;
    line-height: 1.55;
}

.req {
    color: #e5484d;
    margin-left: 2px;
}

.input {
    display: block;
    width: 100%;
    box-sizing: border-box;
    height: 38px;
    padding: 0 10px;
    border: 1px solid #e3e3e3;
    border-radius: 3px;
    background: #f8f8f8;
    color: #222;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: border-color .18s, background .18s;
}

.input:focus {
    border-color: #7fa9ea;
    background: #fff;
}

.input.invalid {
    border-color: #e5484d;
    background: #fff6f6;
}

.field-error {
    margin: 6px 0 0;
    font-size: 12px;
    color: #e5484d;
    min-height: 0;
}

.field-error:empty {
    display: none;
}

/* 单选 */
.radios {
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.radios.inline {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px 22px;
}

/* 支付方式：两个卡片一左一右 */
.pay-list {
    flex-direction: row;
    gap: 10px;
}

.pay-card {
    position: relative;
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    align-items: center;
    padding: 14px 12px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: #f5f6f8;
    cursor: pointer;
    transition: background .15s, border-color .15s;
}

.pay-card[data-pay="wechat"] {
    background: #f3fbf4;
}

.pay-card[data-pay="paypal"] {
    background: #f5f7fb;
}

.pay-card.active[data-pay="wechat"] {
    background: #eaf8ed;
    border-color: #bfe6c6;
}

.pay-card.active[data-pay="paypal"] {
    background: #eef3fc;
    border-color: #c6d8f5;
}

.pay-card input {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: 0;
    opacity: 0;
    pointer-events: none;
}

.pay-body {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.pay-icon {
    width: 34px;
    height: 34px;
    flex: none;
}

.pay-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    font-size: 12.5px;
    line-height: 1.4;
    color: #333;
}

.pay-text span {
    white-space: nowrap;
}

.pay-check {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 16px;
    height: 16px;
    border: 1.5px solid #cfd4dc;
    border-radius: 50%;
    background: #fff;
}

.pay-card.active .pay-check {
    border-color: #2f8ef5;
}

.pay-card.active .pay-check::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #2f8ef5;
}

@media (max-width: 380px) {
    .pay-icon {
        width: 28px;
        height: 28px;
    }

    .pay-text {
        font-size: 11.5px;
    }
}

.radio {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 13px;
    line-height: 1.55;
    color: #444;
    cursor: pointer;
}

.radio input {
    -webkit-appearance: none;
    appearance: none;
    flex: none;
    width: 14px;
    height: 14px;
    margin: 2px 0 0;
    border: 1px solid #cfcfcf;
    border-radius: 50%;
    background: #fff;
    position: relative;
    cursor: pointer;
    transition: border-color .15s;
}

.radio input:checked {
    border-color: #2f8ef5;
}

.radio input:checked::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #2f8ef5;
}

.radio input:checked + span {
    color: #2f8ef5;
}

.radios.invalid .radio input {
    border-color: #e5484d;
}

.loading-text {
    margin: 0;
    font-size: 13px;
    color: #999;
}

/* 上传 */
.hint {
    margin: 0 0 8px;
    font-size: 12px;
    color: #777;
    line-height: 1.6;
}

.uploader {
    position: relative;
    width: 150px;
    height: 120px;
    border: 1px dashed #d8d8d8;
    border-radius: 4px;
    background: #fafafa;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    overflow: hidden;
}

.uploader-plus {
    font-size: 28px;
    font-weight: 300;
    color: #bbb;
    line-height: 1;
}

.uploader-preview {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.uploader-mask {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, .45);
    color: #fff;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.uploader.invalid {
    border-color: #e5484d;
    background: #fff6f6;
}

/* 金额与提交 */
.amount-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 24px 0 18px;
    padding-top: 16px;
    border-top: 1px solid #eee;
    font-size: 13.5px;
    color: #555;
}

.amount-row strong {
    font-size: 18px;
    color: #e5484d;
    font-weight: 700;
}

.submit-row {
    text-align: center;
}

.submit {
    min-width: 160px;
    height: 38px;
    padding: 0 28px;
    border: none;
    border-radius: 3px;
    background: #5b74b8;
    color: #fff;
    font-size: 14px;
    font-family: inherit;
    letter-spacing: .5px;
    cursor: pointer;
    transition: background .18s, opacity .18s;
}

.submit:hover {
    background: #4d66ab;
}

.submit[disabled] {
    opacity: .6;
    cursor: not-allowed;
}

.agree-tip {
    margin: 14px 0 0;
    font-size: 11.5px;
    color: #aaa;
    text-align: center;
}

/* 支付弹层 */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999;
    background: rgba(0, 0, 0, .55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.overlay[hidden] {
    display: none;
}

.pay-box {
    width: 100%;
    max-width: 340px;
    padding: 26px 22px 22px;
    background: #fff;
    border-radius: 10px;
    box-sizing: border-box;
    text-align: center;
}

.pay-title {
    margin: 0 0 10px;
    font-size: 17px;
    color: #111;
}

.pay-amount {
    margin: 0 0 6px;
    font-size: 20px;
    font-weight: 700;
    color: #e5484d;
}

.pay-order {
    margin: 0 0 16px;
    font-size: 12px;
    color: #999;
    word-break: break-all;
}

.qr-wrap {
    padding: 10px 0 4px;
}

#qrcode {
    display: inline-block;
    padding: 8px;
    background: #fff;
}

#qrcode img, #qrcode canvas {
    display: block;
}

.qr-tip {
    margin: 8px 0 0;
    font-size: 12px;
    color: #666;
    line-height: 1.6;
}

.pay-status {
    margin: 14px 0 0;
    font-size: 12.5px;
    color: #888;
    min-height: 18px;
}

.btn-ghost {
    margin-top: 16px;
    height: 36px;
    padding: 0 26px;
    border: 1px solid #ddd;
    border-radius: 3px;
    background: #fff;
    color: #666;
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
}

.btn-primary {
    margin-top: 16px;
    height: 38px;
    padding: 0 40px;
    border: none;
    border-radius: 3px;
    background: #5b74b8;
    color: #fff;
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
}

.success-icon {
    width: 52px;
    height: 52px;
    margin: 4px auto 14px;
    border-radius: 50%;
    background: #34c759;
    color: #fff;
    font-size: 26px;
    line-height: 52px;
    text-align: center;
}

/* 提示 */
.toast {
    position: fixed;
    top: 40px;
    left: 50%;
    z-index: 1000;
    transform: translateX(-50%);
    max-width: 78%;
    padding: 10px 18px;
    border-radius: 4px;
    background: rgba(0, 0, 0, .78);
    color: #fff;
    font-size: 13px;
    line-height: 1.5;
    text-align: center;
}

.toast[hidden] {
    display: none;
}

/* 移动端 */
@media (max-width: 600px) {
    body {
        background: #fff;
    }

    .page {
        max-width: none;
        margin-bottom: 24px;
        box-shadow: none;
    }

    .card {
        padding: 0 18px 36px;
    }

    .form-title {
        margin: 20px 0 22px;
        font-size: 18px;
    }

    .field {
        margin-bottom: 18px;
    }

    /* 16px 是 iOS 不自动放大输入框的临界值，勿改小 */
    .input {
        height: 40px;
        font-size: 16px;
    }

    .uploader {
        width: 132px;
        height: 108px;
    }

    .submit {
        width: 100%;
        height: 42px;
    }
}
