/* ==================================================================
   云语打赏 - 按钮 & 弹窗
   设计参考：圆角卡片弹窗 · 金额选择卡 · 支付方式卡 · 红色渐变支付按钮
   浅色 / 深色（html[data-night='night']）双模式
   ================================================================== */

/* ---------------- 入口按钮 ---------------- */

.yunyu-donation-wrap { display: inline-flex; margin: 0; padding: 0; }

.yunyu-donation-btn {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 10px 26px;
    border: none; border-radius: 999px;
    background: linear-gradient(135deg, #ff7a7a, #ff3d5a);
    color: #fff; font-size: 14px; font-weight: 600; letter-spacing: .3px;
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(255, 70, 95, .25);
    transition: transform .22s ease, box-shadow .22s ease, filter .22s ease;
}
.yunyu-donation-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 22px rgba(255, 70, 95, .35);
    filter: brightness(1.03);
}
.yunyu-donation-btn:active { transform: translateY(0); }
.yunyu-donation-btn i { font-size: 16px; line-height: 1; }

/* ---------------- 弹窗容器 ---------------- */

.yunyu-modal {
    position: fixed; inset: 0; z-index: 100050;
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
}
.yunyu-modal-mask {
    position: absolute; inset: 0;
    background: rgba(17, 22, 38, .55);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}
.yunyu-modal-card {
    position: relative; z-index: 1;
    width: 450px; max-width: 100%;
    max-height: 92vh;
    display: flex; flex-direction: column;
    background: #ffffff;
    border-radius: 22px;
    box-shadow: 0 24px 70px rgba(15, 23, 42, .28);
    overflow: hidden;
    animation: ydPop .24s cubic-bezier(.2, .9, .3, 1.2);
}
@keyframes ydPop {
    from { opacity: 0; transform: translateY(16px) scale(.96); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ---------------- 头部 ---------------- */

.yunyu-modal-close {
    position: absolute; top: 16px; right: 16px; z-index: 3;
    width: 32px; height: 32px;
    border: none; border-radius: 50%;
    background: #f1f4f9; color: #8b95a7;
    font-size: 20px; line-height: 1;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: background .2s, color .2s;
}
.yunyu-modal-close:hover { background: #e6ebf3; color: #5d677a; }

.yunyu-modal-head {
    display: flex; align-items: center; gap: 13px;
    padding: 24px 26px 8px;
}
.yunyu-modal-head-icon {
    flex: 0 0 auto;
    width: 48px; height: 48px; border-radius: 14px;
    background: linear-gradient(135deg, #2f8cff, #15b8ff);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 8px 18px rgba(34, 140, 255, .3);
}
.yunyu-modal-head-icon i { font-size: 24px; }
.yunyu-modal-head-info { display: flex; flex-direction: column; min-width: 0; }
.yunyu-modal-head-info b { font-size: 19px; font-weight: 700; color: #1f2733; line-height: 1.3; }
.yunyu-modal-head-info span { font-size: 12.5px; color: #98a1b2; margin-top: 2px; }

/* ---------------- 主体 ---------------- */

.yunyu-modal-body {
    padding: 8px 26px 24px;
    overflow-y: auto;
}
.yunyu-section-title {
    font-size: 14px; font-weight: 600; color: #323b4c;
    margin: 16px 0 10px;
}
.yunyu-section-title:first-child { margin-top: 8px; }

/* 金额选择卡 */
.yunyu-amount-grid {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
}
.yunyu-amount-card {
    height: 74px;
    border: 1.5px solid #e7ebf2; border-radius: 15px;
    background: #fff;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; user-select: none;
    transition: border-color .18s, background .18s, transform .18s;
}
.yunyu-amount-card:hover { border-color: #b9cdf7; }
.yunyu-amount-card.active {
    border-color: #2e7cf6;
    background: rgba(46, 124, 246, .07);
}
.yunyu-amount-cny { font-size: 13px; font-weight: 600; color: #98a1b2; margin-right: 2px; }
.yunyu-amount-num { font-size: 21px; font-weight: 700; color: #2b3445; }
.yunyu-amount-card.active .yunyu-amount-cny { color: #2e7cf6; }
.yunyu-amount-card.active .yunyu-amount-num { color: #2e7cf6; }

/* 自定义金额 */
.yunyu-custom {
    display: flex; align-items: center;
    height: 52px; margin-top: 12px;
    border: 1.5px solid #e7ebf2; border-radius: 15px;
    background: #fff;
    transition: border-color .18s, box-shadow .18s;
}
.yunyu-custom:focus-within {
    border-color: #2e7cf6;
    box-shadow: 0 0 0 3px rgba(46, 124, 246, .1);
}
.yunyu-custom-prefix {
    padding: 0 10px 0 16px;
    font-size: 16px; font-weight: 700; color: #2e7cf6;
}
.yunyu-custom-input {
    flex: 1; min-width: 0; height: 100%;
    border: none; outline: none; background: transparent;
    font-size: 15px; color: #2b3445;
}
.yunyu-custom-input::placeholder { color: #a4acbb; font-weight: 400; }

.yunyu-limit-hint {
    font-size: 12px; color: #a4acbb;
    margin: 9px 2px 0;
}

/* 留言 */
.yunyu-message { margin-top: 12px; }
.yunyu-message-input {
    width: 100%; box-sizing: border-box;
    border: 1.5px solid #e7ebf2; border-radius: 15px;
    padding: 12px 15px;
    background: #fff; color: #2b3445;
    font-size: 13.5px; line-height: 1.5;
    outline: none; resize: none;
    transition: border-color .18s, box-shadow .18s;
}
.yunyu-message-input:focus {
    border-color: #2e7cf6;
    box-shadow: 0 0 0 3px rgba(46, 124, 246, .1);
}
.yunyu-message-input::placeholder { color: #a4acbb; }

/* 提示说明框 */
.yunyu-tips {
    margin-top: 14px;
    background: #f6f8fb; border-radius: 15px;
    padding: 12px 16px;
}
.yunyu-tips p {
    position: relative;
    margin: 0; padding-left: 14px;
    font-size: 12.5px; line-height: 1.9; color: #98a1b2;
}
.yunyu-tips p::before {
    content: ''; position: absolute; left: 2px; top: 12px;
    width: 4px; height: 4px; border-radius: 50%;
    background: #b6bfd0;
}

/* 支付方式卡：自适应列数——3 种方式时单行 3 列横排 */
.yunyu-pay-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(80px, 1fr)); gap: 8px;
}
.yunyu-pay-card {
    height: 44px;
    border: 1px solid #e7ebf2; border-radius: 12px;
    background: #fff;
    display: flex; align-items: center; justify-content: center; gap: 6px;
    font-size: 13px; color: #2b3445;
    cursor: pointer;
    transition: border-color .18s, background .18s;
}
.yunyu-pay-card:hover { border-color: #b9cdf7; }
.yunyu-pay-card.active {
    border-color: #2e7cf6;
    background: rgba(46, 124, 246, .07);
}
.yunyu-pay-icon {
    width: 24px; height: 24px; border-radius: 7px;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 12px; font-weight: 700;
    flex: 0 0 auto;
}
.ydpi--wechat  { background: #09bb07; }
.ydpi--alipay  { background: #1677ff; }
.ydpi--balance { background: linear-gradient(135deg, #ffb03a, #ff8a12); }
.ydpi--points  { background: linear-gradient(135deg, #ff8fb1, #ff3d7a); }
.ydpi--paypal  { background: #005ea8; }
.ydpi--other   { background: #8b95a7; }

/* 错误 / 结果 */
.yunyu-error {
    display: none;
    margin-top: 10px;
    font-size: 12.5px; color: #f03e3e;
}
.yunyu-error.show { display: block; }

.yunyu-result { display: none; margin-top: 12px; }
.yunyu-result.show { display: block; }
.yunyu-result .ydr-wait {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    font-size: 13.5px; color: #6b7588;
}
.yunyu-result .ydr-spin {
    width: 16px; height: 16px; border-radius: 50%;
    border: 2px solid #d4dbe6; border-top-color: #2e7cf6;
    animation: ydSpin .8s linear infinite;
}
@keyframes ydSpin { to { transform: rotate(360deg); } }
.yunyu-result .ydr-qr { text-align: center; }
.yunyu-result .ydr-qr p { margin: 0 0 10px; font-size: 13px; color: #6b7588; }
.yunyu-result .ydr-qr img {
    width: 190px; height: 190px; border-radius: 12px;
    border: 1px solid #eef1f6;
}
.yunyu-result .ydr-ok { text-align: center; padding: 6px 0; }
.yunyu-result .ydr-ok-icon {
    width: 58px; height: 58px; margin: 0 auto 10px;
    border-radius: 50%;
    background: linear-gradient(135deg, #34d399, #10b981);
    color: #fff; font-size: 30px;
    display: flex; align-items: center; justify-content: center;
}
.yunyu-result .ydr-ok p { margin: 0; font-size: 15px; font-weight: 600; color: #2b3445; }
.yunyu-result .ydr-fail { text-align: center; font-size: 13px; color: #f03e3e; }

/* 提交按钮 */
.yunyu-submit {
    width: 100%; height: 54px;
    margin-top: 14px;
    border: none; border-radius: 17px;
    background: linear-gradient(135deg, #ff7a7a, #ff2d50);
    color: #fff; font-size: 17px; font-weight: 700; letter-spacing: 1px;
    cursor: pointer;
    box-shadow: 0 12px 26px rgba(255, 64, 90, .32);
    transition: transform .2s, box-shadow .2s, filter .2s, opacity .2s;
}
.yunyu-submit:hover { transform: translateY(-1px); box-shadow: 0 15px 30px rgba(255, 64, 90, .4); filter: brightness(1.03); }
.yunyu-submit:active { transform: translateY(0); }
.yunyu-submit.disabled, .yunyu-submit:disabled {
    opacity: .6; cursor: not-allowed;
    transform: none; box-shadow: none; filter: none;
}

.yunyu-no-pay {
    padding: 28px 10px; text-align: center;
    font-size: 13.5px; color: #98a1b2;
}
.yunyu-no-pay i { font-size: 17px; margin-right: 4px; vertical-align: -2px; }

/* ---------------- 深色模式 ---------------- */

html[data-night='night'] .yunyu-modal-card {
    background: #252b3b;
    box-shadow: 0 24px 70px rgba(0, 0, 0, .5);
}
html[data-night='night'] .yunyu-modal-close { background: rgba(255, 255, 255, .07); color: #99a3b8; }
html[data-night='night'] .yunyu-modal-close:hover { background: rgba(255, 255, 255, .12); color: #d7deea; }

html[data-night='night'] .yunyu-modal-head-info b { color: #e9eef8; }
html[data-night='night'] .yunyu-modal-head-info span { color: #8d98ad; }

html[data-night='night'] .yunyu-section-title { color: #d5dceb; }

html[data-night='night'] .yunyu-amount-card,
html[data-night='night'] .yunyu-pay-card {
    background: transparent;
    border-color: #38415a;
    color: #e3e9f4;
}
html[data-night='night'] .yunyu-amount-card:hover,
html[data-night='night'] .yunyu-pay-card:hover { border-color: #4e6aa8; }
html[data-night='night'] .yunyu-amount-card.active,
html[data-night='night'] .yunyu-pay-card.active {
    border-color: #3d8bff;
    background: rgba(61, 139, 255, .12);
}
html[data-night='night'] .yunyu-amount-num { color: #e3e9f4; }
html[data-night='night'] .yunyu-amount-cny { color: #8d98ad; }
html[data-night='night'] .yunyu-amount-card.active .yunyu-amount-num,
html[data-night='night'] .yunyu-amount-card.active .yunyu-amount-cny { color: #5ea1ff; }

html[data-night='night'] .yunyu-custom,
html[data-night='night'] .yunyu-message-input {
    background: rgba(255, 255, 255, .03);
    border-color: #38415a;
    color: #e3e9f4;
}
html[data-night='night'] .yunyu-custom-input { color: #e3e9f4; }
html[data-night='night'] .yunyu-limit-hint { color: #7d879b; }

html[data-night='night'] .yunyu-tips { background: rgba(255, 255, 255, .05); }
html[data-night='night'] .yunyu-tips p { color: #8d98ad; }
html[data-night='night'] .yunyu-tips p::before { background: #5d687e; }

html[data-night='night'] .yunyu-result .ydr-wait,
html[data-night='night'] .yunyu-result .ydr-qr p { color: #a9b3c7; }
html[data-night='night'] .yunyu-result .ydr-ok p { color: #e3e9f4; }
html[data-night='night'] .yunyu-result .ydr-qr img { border-color: #38415a; }
html[data-night='night'] .yunyu-result .ydr-spin { border-color: #38415a; border-top-color: #5ea1ff; }

html[data-night='night'] .yunyu-no-pay { color: #8d98ad; }
