/**
 * 赞赏(打赏)相关弹窗美化样式
 *
 *  1) .dialog.pay-form  打赏浮窗(点击「赞赏」按钮打开)
 *  2) #siteQrcodes      收款码弹窗(点击「打赏」链接打开)
 *
 * 原样式分散在 app.css 等页面样式包中(压缩状态), 这里用独立样式表覆盖,
 * 由 wp_enqueue_style 在页面样式之后输出, 因此优先级更高;
 * 保留原有 id/class 与 dialog--open / dialog__overlay 的动画机制.
 *
 * @since 2.7.0
 */

/* ==================== 一、打赏浮窗 .pay-form ==================== */

/* 遮罩: 加深并加一点毛玻璃 */
.dialog.pay-form .dialog__overlay {
    background: rgba(15, 26, 42, .62) !important;
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
}

/* 卡片 */
.dialog.pay-form .dialog__content {
    width: 400px !important;
    min-width: 0 !important;
    max-width: calc(100vw - 24px);
    max-height: 92vh;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    text-align: left !important;
    border-radius: 18px !important;
    box-shadow: 0 24px 64px rgba(10, 25, 45, .38), 0 2px 10px rgba(10, 25, 45, .12) !important;
}

/* 标题区(头像 + 标题 靠左, 关闭按钮靠右, 用 flex 排布避免挤压) */
.dialog.pay-form .pay-title {
    display: flex !important;
    align-items: center;
    padding: 16px 50px 12px 18px !important;
    line-height: 1.5;
    border-bottom: 1px solid #eef3f8 !important;
}

.dialog.pay-form .pay-title .pull-left,
.dialog.pay-form .pay-title .pull-right {
    float: none !important;
}

.dialog.pay-form .pay-title .avatar {
    display: block;
    width: 38px !important;
    height: 38px !important;
    margin-right: 10px !important;
    border-radius: 50% !important;
    vertical-align: middle !important;
    box-shadow: 0 0 0 2px #fff, 0 0 0 3px #e4eef8;
}

.dialog.pay-form .pay-title .pull-right {
    order: 2;
    margin-left: 2px;
    min-width: 0;
}

.dialog.pay-form .pay-title .pull-right span {
    display: block;
    font-size: 1.5rem;
    font-weight: 600;
    color: #23384d;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 关闭按钮: 收到卡片内右上角, 做成圆形按钮 */
.dialog.pay-form .pay-title .close {
    right: 12px !important;
    top: 12px !important;
    width: 28px;
    height: 28px;
    line-height: 28px;
    text-align: center;
    border-radius: 50%;
    background: #f1f5f9;
    opacity: 1 !important;
    transition: background-color .2s, transform .15s;
}

.dialog.pay-form .pay-title .close:hover {
    background: #e6edf5;
    transform: rotate(90deg);
}

.dialog.pay-form .pay-title .close i {
    font-size: 15px !important;
    color: #64748b !important;
    vertical-align: middle;
}

/* 副标题 */
.dialog.pay-form .pay-sub {
    padding: 10px 18px 0 !important;
    font-size: 1.2rem;
    line-height: 1.6;
    color: #93a3b3;
}

/* 金额选择: 3 列宫格 */
.dialog.pay-form .ds-form {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    padding: 14px 18px 0 !important;
}

.dialog.pay-form .ds-form .fd {
    display: flex;
    align-items: center;
    justify-content: center;
    width: auto !important;
    min-height: 54px;
    padding: 8px 6px;
    text-align: center;
    background: #f8fafc;
    border: 1px solid #e8eef5;
    border-radius: 12px;
    color: #3a5370;
    cursor: pointer;
    transition: border-color .2s, box-shadow .2s, transform .12s, background-color .2s;
}

/* 金额格子内部: 图标与数字排成一行 */
/* (原样式 .ds-form .fd div 自带 padding/margin/边框/固定高度, 且选中态会给内层加红边, 这里统一清掉) */
.dialog.pay-form .ds-form .fd > div,
.dialog.pay-form .ds-form .fd > label {
    display: flex !important;
    align-items: baseline;
    justify-content: center;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    height: auto !important;
    min-height: 0 !important;
    background: transparent !important;
    white-space: nowrap;
    line-height: 1.2;
}

/* 选中态文字/图标统一为白色 */
.dialog.pay-form .ds-form .fd.picked,
.dialog.pay-form .ds-form .fd.picked i,
.dialog.pay-form .ds-form .fd.picked b,
.dialog.pay-form .ds-form .fd.picked span {
    color: #fff !important;
}

.dialog.pay-form .ds-form .fd i {
    width: auto !important;
    height: auto !important;
    margin-right: 4px;
    font-size: 14px !important;
    line-height: 1;
    vertical-align: middle;
}

.dialog.pay-form .ds-form .fd.custom-ds .fs16 {
    font-size: 1.25rem;
    white-space: nowrap;
}

.dialog.pay-form .ds-form .fd.custom-ds i {
    font-size: 13px !important;
}

.dialog.pay-form .ds-form .fd:hover {
    border-color: #b9d6ef;
    transform: translateY(-1px);
}

.dialog.pay-form .ds-form .fd b {
    font-size: 1.8rem;
    font-weight: 600;
    margin: 0 1px;
    line-height: 1;
}

.dialog.pay-form .ds-form .fd.picked {
    color: #fff;
    background: linear-gradient(135deg, #46a6ea 0%, #2f86c9 100%);
    border-color: transparent;
    box-shadow: 0 8px 16px rgba(56, 149, 214, .3);
}

.dialog.pay-form .ds-form .fd.custom-ds {
    grid-column: span 1;
    font-size: 1.3rem;
    padding: 14px 0;
}

/* 自定义金额: 选中后不要蓝底上下留边(看起来像两条蓝条), 改成白底 + 蓝框 */
.dialog.pay-form .ds-form .fd.custom-ds.picked {
    color: #2f86c9 !important;
    background: #fff !important;
    border-color: #3895D6 !important;
    box-shadow: 0 6px 14px rgba(56, 149, 214, .18);
}

.dialog.pay-form .ds-form .fd.custom-ds.picked i,
.dialog.pay-form .ds-form .fd.custom-ds.picked b,
.dialog.pay-form .ds-form .fd.custom-ds.picked span,
.dialog.pay-form .ds-form .fd.custom-ds.picked p {
    color: #2f86c9 !important;
}

/* 自定义金额输入框: 透明底、无边框、无数字微调箭头 */
.dialog.pay-form .ds-form .fd.custom-ds input,
.dialog.pay-form .ds-form .fd.custom-ds input:focus {
    display: inline-block;
    width: 52px !important;
    height: auto;
    padding: 0 2px !important;
    font-size: 1.8rem !important;
    font-weight: 600;
    line-height: 1.2;
    color: inherit !important;
    background: transparent !important;
    border: 0 !important;
    border-radius: 0;
    box-shadow: none !important;
    text-align: center;
    outline: 0;
    -moz-appearance: textfield;
}

.dialog.pay-form .ds-form .fd.custom-ds input::-webkit-outer-spin-button,
.dialog.pay-form .ds-form .fd.custom-ds input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.dialog.pay-form .ds-form .fd.custom-ds p {
    margin: 0 0 0 3px !important;
    font-size: 1.3rem !important;
    line-height: 1;
}

/* 留言 */
.dialog.pay-form .ds-textarea {
    padding: 12px 18px 0 !important;
}

.dialog.pay-form .ds-textarea textarea {
    width: 100%;
    min-height: 62px;
    padding: 10px 12px;
    font-size: 1.3rem;
    line-height: 1.6;
    color: #2c3e50;
    background: #fbfdff;
    border: 1px solid #e3ebf3 !important;
    border-radius: 12px !important;
    resize: vertical;
    box-shadow: none !important;
    transition: border-color .2s, box-shadow .2s;
}

.dialog.pay-form .ds-textarea textarea:focus {
    background: #fff;
    border-color: #3895D6 !important;
    box-shadow: 0 0 0 3px rgba(56, 149, 214, .15) !important;
    outline: 0;
}

/* 金额大字 */
.dialog.pay-form .pay-price {
    padding: 12px 18px 0 !important;
    margin: 0 !important;
    font-size: 3rem;
    font-weight: 600;
    line-height: 1.1;
    color: #2f86c9;
    text-align: center;
    letter-spacing: 1px;
}

.dialog.pay-form .pay-price sup {
    font-size: 1.6rem;
    font-weight: 500;
    top: -.5em;
}

/* 余额提示(整行靠右, 去掉原来自带的灰底小块) */
.dialog.pay-form .pay-balance {
    display: block !important;
    width: 100% !important;
    box-sizing: border-box;
    margin: 0 !important;
    padding: 10px 18px 0 !important;
    font-size: 1.25rem !important;
    line-height: 1.6;
    color: #93a3b3 !important;
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    text-align: right !important;
}

.dialog.pay-form .pay-balance span {
    margin-left: 2px;
    font-weight: 600;
    color: #2f86c9;
}

/* 支付方式 */
.dialog.pay-form .pay-chose {
    display: flex !important;
    align-items: stretch;
    gap: 8px;
    margin: 14px 0 0 !important;
    padding: 14px 18px 0 !important;
    border-top: 1px solid #eef3f8;
}

.dialog.pay-form .pay-chose .dot {
    display: none !important;
}

.dialog.pay-form .pay-chose .fd {
    flex: 1;
    display: block;
    padding: 10px 0;
    text-align: center;
    font-size: 1.3rem;
    color: #3a5370;
    background: #fbfdff;
    border: 1px solid #e8eef5;
    border-radius: 10px;
    cursor: pointer;
    transition: border-color .2s, background-color .2s, color .2s;
}

.dialog.pay-form .pay-chose .fd.picked {
    color: #2f86c9;
    background: #eef7ff;
    border-color: #9ecdee;
}

.dialog.pay-form .pay-chose .fd.disabled {
    opacity: .45;
    cursor: not-allowed;
}

/* 提交按钮 */
.dialog.pay-form .post-zs {
    display: block;
    width: 100%;
    height: 46px !important;
    padding: 0 !important;
    font-size: 1.5rem;
    letter-spacing: 1px;
    color: #fff !important;
    background: linear-gradient(135deg, #43a3e8 0%, #2f86c9 100%) !important;
    border: 0 !important;
    border-radius: 12px !important;
    box-shadow: 0 8px 18px rgba(56, 149, 214, .28);
    cursor: pointer;
    transition: transform .15s, box-shadow .2s, filter .2s;
}

.dialog.pay-form .post-zs:hover {
    filter: brightness(1.05);
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(56, 149, 214, .34);
}

.dialog.pay-form .post-zs:active {
    transform: translateY(0);
}

/* 提交按钮外层容器 */
.dialog.pay-form .dialog__content > .pd20 {
    padding: 14px 18px 18px !important;
}

/* ==================== 二、收款码弹窗 #siteQrcodes ==================== */

/* 背景遮罩(原样式是透明的, 二维码直接浮在页面上)
   注意: 该弹窗实际挂在 .page__wrapper 下(不是 body 直接子级), 因此用后代选择器 */
body #siteQrcodes {
    z-index: 1050;
    background: rgba(15, 26, 42, .62) !important;
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
}

/* 卡片 */
body #siteQrcodes > .qr-wrap {
    display: flex !important;
    flex-wrap: wrap;
    gap: 18px;
    width: 460px !important;
    max-width: calc(100vw - 24px);
    margin-left: -230px !important;
    margin-top: 0 !important;
    padding: 20px 20px 22px;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 24px 64px rgba(10, 25, 45, .38), 0 2px 10px rgba(10, 25, 45, .12);
    transform: translateY(-50%) !important;
}

/* 标题 */
body #siteQrcodes .qr-head {
    flex: 0 0 100%;
    text-align: center;
    font-size: 1.6rem;
    font-weight: 600;
    color: #23384d;
    letter-spacing: 1px;
    padding-bottom: 4px;
}

body #siteQrcodes .qr-head small {
    display: block;
    margin-top: 6px;
    font-size: 1.2rem;
    font-weight: 400;
    color: #93a3b3;
    letter-spacing: 0;
}

/* 单张二维码 */
body #siteQrcodes .qrcode {
    flex: 1 1 0;
    width: auto !important;
    max-width: none;
    padding: 0 !important;
    float: none !important;
    text-align: center;
}

body #siteQrcodes .wx-qr,
body #siteQrcodes .ali-qr {
    padding: 10px;
    background: #f8fafc;
    border: 1px solid #eef3f8;
    border-radius: 14px;
}

body #siteQrcodes .wx-qr img,
body #siteQrcodes .ali-qr img {
    display: block;
    width: 100% !important;
    height: auto;
    border-radius: 8px;
    background: #fff;
}

body #siteQrcodes .qr-label {
    display: block;
    margin-top: 8px;
    font-size: 1.3rem;
    color: #46617f;
}

/* 未设置收款码时的提示 */
body #siteQrcodes .qr-empty {
    flex: 1 1 100%;
    padding: 18px 6px 6px;
    text-align: center;
    font-size: 1.3rem;
    line-height: 1.7;
    color: #93a3b3;
}

/* ==================== 三、小屏适配 ==================== */

@media (max-width: 480px) {
    .dialog.pay-form .dialog__content {
        width: calc(100vw - 24px) !important;
        max-height: 88vh;
        border-radius: 16px !important;
    }

    .dialog.pay-form .ds-form {
        gap: 8px;
        padding: 12px 14px 0 !important;
    }

    .dialog.pay-form .pay-title {
        padding: 14px 14px 10px !important;
    }

    body #siteQrcodes > .qr-wrap {
        width: calc(100vw - 24px) !important;
        margin-left: calc((100vw - 24px) / -2) !important;
        padding: 16px;
    }
}
