/**
 * NewVFX Pay — 支付弹窗现代化重设计
 * 同时作用于：父文档 layui 外壳(.nvfx-pay-layer) 与 同源 iframe 内容(buy.php/checkout.php)。
 * 深色模式由 html[data-theme="dark"] 驱动（iframe 的 data-theme 由 newvfx-pay-modal.js 从父层同步）。
 * 仅覆盖支付弹窗，不影响其它 layui 弹层。由 newvfx-pay 插件独立加载，插件升级不受影响。
 */

/* ============ 父层：卡片外壳 ============ */
.layui-layer.nvfx-pay-layer {
    background: #ffffff !important;
    border-radius: 22px !important;
    corner-shape: squircle;
    border: 1px solid rgba(0, 0, 0, .06);
    box-shadow: 0 18px 50px rgba(0, 0, 0, .18), 0 4px 14px rgba(0, 0, 0, .08) !important;
    overflow: hidden;
    height: auto !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    margin: 0 !important;
}
html[data-theme="dark"] .layui-layer.nvfx-pay-layer {
    background: #2c2c2e !important;
    border-color: #3a3a3c;
    box-shadow: 0 18px 50px rgba(0, 0, 0, .55), 0 4px 14px rgba(0, 0, 0, .4) !important;
}
.nvfx-pay-layer .layui-layer-content { overflow: visible; height: auto !important; }

/* 背景遮罩：苹果磨砂玻璃，483ms 淡出背景注意力、聚焦弹窗 */
.layui-layer-shade.nvfx-pay-shade {
    opacity: 1 !important;
    background: rgba(0, 0, 0, .32) !important;
    -webkit-backdrop-filter: blur(8px) saturate(1.05);
    backdrop-filter: blur(8px) saturate(1.05);
    animation: nvfx-pay-shade-in 483ms cubic-bezier(.32, .72, 0, 1) both;
}
html[data-theme="dark"] .layui-layer-shade.nvfx-pay-shade { background: rgba(0, 0, 0, .5) !important; }
@keyframes nvfx-pay-shade-in {
    from { opacity: 0; -webkit-backdrop-filter: blur(0) saturate(1); backdrop-filter: blur(0) saturate(1); }
    to   { opacity: 1; -webkit-backdrop-filter: blur(8px) saturate(1.05); backdrop-filter: blur(8px) saturate(1.05); }
}
/* 弹窗卡片入场同步 483ms 苹果缓动 */
.layui-layer.nvfx-pay-layer.layer-anim {
    animation-duration: 483ms !important;
    animation-timing-function: cubic-bezier(.32, .72, 0, 1) !important;
}

/* 关闭按钮：去掉雪碧图，画一个干净的 ×；setwin 归零使 close 绝对锚定卡片右上角 */
.nvfx-pay-layer .layui-layer-setwin { position: absolute !important; top: 0 !important; right: 0 !important; width: 0 !important; height: 0 !important; }
.nvfx-pay-layer .layui-layer-close {
    position: absolute !important;
    display: block !important;
    background: none !important;
    width: 34px !important;
    height: 34px !important;
    top: 12px !important;
    right: 12px !important;
    border-radius: 50%;
    opacity: 1 !important;
    transition: background .15s ease;
    z-index: 5;
}
.nvfx-pay-layer .layui-layer-close::before,
.nvfx-pay-layer .layui-layer-close::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 15px;
    height: 2px;
    border-radius: 2px;
    background: #9a9aa0;
    transition: background .15s ease;
}
.nvfx-pay-layer .layui-layer-close::before { transform: translate(-50%, -50%) rotate(45deg); }
.nvfx-pay-layer .layui-layer-close::after  { transform: translate(-50%, -50%) rotate(-45deg); }
.nvfx-pay-layer .layui-layer-close:hover { background: rgba(0, 0, 0, .06); }
.nvfx-pay-layer .layui-layer-close:hover::before,
.nvfx-pay-layer .layui-layer-close:hover::after { background: #1c1c1e; }
html[data-theme="dark"] .nvfx-pay-layer .layui-layer-close::before,
html[data-theme="dark"] .nvfx-pay-layer .layui-layer-close::after { background: #a1a1a6; }
html[data-theme="dark"] .nvfx-pay-layer .layui-layer-close:hover { background: rgba(255, 255, 255, .1); }
html[data-theme="dark"] .nvfx-pay-layer .layui-layer-close:hover::before,
html[data-theme="dark"] .nvfx-pay-layer .layui-layer-close:hover::after { background: #f5f5f7; }

/* ============ iframe 内容：购买信息 ============ */
.newvfx-pay-table { padding: 6px 4px 4px !important; }
.newvfx-pay-table .item {
    padding: 0 !important;
    margin: 0 0 18px !important;
    border: none !important;
    color: #6e6e73 !important;
    font-size: 13px !important;
    line-height: 1.5;
}
.newvfx-pay-table .item:last-child { margin-bottom: 4px !important; }
.newvfx-pay-table .item label {
    display: block;
    color: #86868b !important;
    font-size: 12px !important;
    font-weight: 500;
    letter-spacing: .02em;
    margin-bottom: 7px;
}
.newvfx-pay-table .item label span { color: #a1a1a6 !important; font-weight: 400; }
.newvfx-pay-table .item .tit {
    color: #1c1c1e !important;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.5;
    word-break: break-word;
}
html[data-theme="dark"] .newvfx-pay-table .item { color: #a1a1a6 !important; }
html[data-theme="dark"] .newvfx-pay-table .item label { color: #a1a1a6 !important; }
html[data-theme="dark"] .newvfx-pay-table .item label span { color: #8e8e93 !important; }
html[data-theme="dark"] .newvfx-pay-table .item .tit { color: #f5f5f7 !important; }

/* 价格行：小计 + 大号金额 + RMB */
.newvfx-pay-table .item-price .tit {
    display: flex;
    align-items: baseline;
    justify-content: flex-end;
    gap: 7px;
    font-size: 13px;
    font-weight: 500;
    color: #86868b !important;
}
.newvfx-pay-table .item-price .tit span { font-size: 13px; color: #86868b !important; }
.newvfx-pay-table .item-price .tit t,
.newvfx-pay-table .item-price .tit .login {
    font-size: 28px;
    font-weight: 700;
    font-style: normal;
    letter-spacing: -.01em;
    color: #1c1c1e !important;
    line-height: 1.1;
}
html[data-theme="dark"] .newvfx-pay-table .item-price .tit,
html[data-theme="dark"] .newvfx-pay-table .item-price .tit span { color: #a1a1a6 !important; }
html[data-theme="dark"] .newvfx-pay-table .item-price .tit t,
html[data-theme="dark"] .newvfx-pay-table .item-price .tit .login { color: #f5f5f7 !important; }

/* 账户余额行：顶部分隔线 */
.newvfx-pay-table .item:has(#newvfx_pay_left) {
    border-top: 1px solid rgba(0, 0, 0, .07) !important;
    padding-top: 15px !important;
    margin-top: 2px !important;
}
.newvfx-pay-table .item:has(#newvfx_pay_left) #newvfx_pay_left { font-weight: 600; color: inherit !important; }
html[data-theme="dark"] .newvfx-pay-table .item:has(#newvfx_pay_left) { border-top-color: #3a3a3c !important; }

/* ============ 支付方式按钮 ============ */
.erphp-justbuy {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 12px;
    padding: 0 !important;
}
.erphp-justbuy::after { display: none !important; }
.erphp-justbuy a.newvfx-pay-jump,
.erphp-justbuy a.newvfx-pay-jump3 {
    float: none !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-width: 0 !important;
    height: 50px;
    padding: 0 16px !important;
    margin: 0 !important;
    border-radius: 14px !important;
    corner-shape: squircle;
    font-size: 15px !important;
    font-weight: 600;
    color: #fff !important;
    text-decoration: none !important;
    box-sizing: border-box;
    transition: filter .15s ease, transform .15s ease, box-shadow .15s ease;
}
.erphp-justbuy a .erphp-iconfont { font-size: 21px; line-height: 1; }
.erphp-justbuy a.pmt-wx     { background: #07c160 !important; }
.erphp-justbuy a.pmt-ali    { background: #1677ff !important; }
.erphp-justbuy a.pmt-qq     { background: #12b7f5 !important; }
.erphp-justbuy a.pmt-ut     { background: #26a17b !important; }
.erphp-justbuy a.pmt-stripe { background: #635bff !important; }
.erphp-justbuy a.pmt-pp     { background: #003087 !important; }
.erphp-justbuy a.pmt-ecpay,
.erphp-justbuy a.pmt-newebpay { background: #5a6acf !important; }
.erphp-justbuy a:hover { filter: brightness(1.08); transform: translateY(-1px); box-shadow: 0 6px 16px rgba(0, 0, 0, .18); }
.erphp-justbuy a:active { transform: translateY(0); filter: brightness(.94); box-shadow: none; }

/* 余额支付：主 CTA */
.erphp-creditbuy { margin-top: 12px; }
.erphp-creditbuy a.newvfx-pay-btn,
a.ss-button.newvfx-pay-btn.do-newvfx-pay-pay,
a.ss-button.newvfx-pay-btn.do-newvfx-pay-pay3 {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 50px;
    padding: 0 16px !important;
    margin: 0 !important;
    border: none !important;
    border-radius: 14px !important;
    corner-shape: squircle;
    background: #f5653f !important;
    color: #fff !important;
    font-size: 15px !important;
    font-weight: 600;
    text-decoration: none !important;
    box-sizing: border-box;
    cursor: pointer;
    transition: filter .15s ease, transform .15s ease, box-shadow .15s ease;
}
.erphp-creditbuy a.newvfx-pay-btn:hover,
a.ss-button.newvfx-pay-btn.do-newvfx-pay-pay:hover,
a.ss-button.newvfx-pay-btn.do-newvfx-pay-pay3:hover {
    filter: brightness(1.07);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(245, 101, 63, .35);
}
/* btn-hide 默认隐藏由 buy.php 内联 display:none 控制；此处不再用 !important，以免挡住插件 JS 优惠码后的 .show() 交换 */

/* ============ 表单输入（数量/邮箱/优惠码等） ============ */
.newvfx-pay-table input[type="text"],
.newvfx-pay-table input[type="email"],
.newvfx-pay-table input[type="number"],
.newvfx-pay-table .erphp-faka-input,
.newvfx-pay-table textarea {
    background: #f5f5f7 !important;
    border: 1px solid rgba(0, 0, 0, .1) !important;
    border-radius: 10px !important;
    color: #1c1c1e !important;
    padding: 10px 12px !important;
    font-size: 14px !important;
    box-sizing: border-box;
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.newvfx-pay-table input:focus,
.newvfx-pay-table textarea:focus {
    border-color: #1677ff !important;
    box-shadow: 0 0 0 3px rgba(22, 119, 255, .15) !important;
}
html[data-theme="dark"] .newvfx-pay-table input[type="text"],
html[data-theme="dark"] .newvfx-pay-table input[type="email"],
html[data-theme="dark"] .newvfx-pay-table input[type="number"],
html[data-theme="dark"] .newvfx-pay-table .erphp-faka-input,
html[data-theme="dark"] .newvfx-pay-table textarea {
    background: #242426 !important;
    border-color: #3a3a3c !important;
    color: #f5f5f7 !important;
}
.erphp-faka-num { display: inline-flex; align-items: center; gap: 0; }
.erphp-faka-num a {
    width: 34px; height: 34px;
    display: inline-flex; align-items: center; justify-content: center;
    background: #f5f5f7 !important;
    border: 1px solid rgba(0, 0, 0, .1) !important;
    color: #1c1c1e !important;
    font-size: 18px; text-decoration: none !important;
}
.erphp-faka-num a.erphp-faka-minus { border-radius: 10px 0 0 10px; }
.erphp-faka-num a.erphp-faka-plus  { border-radius: 0 10px 10px 0; }
.erphp-faka-num input { width: 56px; text-align: center; border-radius: 0 !important; border-left: none !important; border-right: none !important; }
html[data-theme="dark"] .erphp-faka-num a { background: #242426 !important; border-color: #3a3a3c !important; color: #f5f5f7 !important; }

/* 提示/错误信息 */
.newvfx-pay-table .login-tips,
.newvfx-pay-table .error { font-size: 13px !important; color: #86868b !important; }
.newvfx-pay-table .error { color: #e5484d !important; }
html[data-theme="dark"] .newvfx-pay-table .login-tips { color: #a1a1a6 !important; }

/* 窄屏适配 */
@media (max-width: 420px) {
    .newvfx-pay-table .item-price .tit t,
    .newvfx-pay-table .item-price .tit .login { font-size: 25px; }
}

/* ============ 支付触发按钮：文案改为 Pay + 钱包图标（父页面） ============
   该钮在资源页显示"下载"、测试页显示"立即购买"，统一呈现为 "Pay" + 图标。
   font-size:0 隐藏原文案，::before 图标 + ::after "Pay"，纯 CSS、插件升级安全。 */
.newvfx-pay-iframe.newvfx-pay-buy {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0 !important;
    line-height: 1;
}
.newvfx-pay-iframe.newvfx-pay-buy::before {
    content: "";
    width: 18px; height: 18px; flex: none;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 12V7H5a2 2 0 0 1 0-4h14v4'/%3E%3Cpath d='M3 5v14a2 2 0 0 0 2 2h16v-5'/%3E%3Cpath d='M18 12a2 2 0 0 0 0 4h4v-4Z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.newvfx-pay-iframe.newvfx-pay-buy::after {
    content: "Pay";
    font-size: 15px;
    font-weight: 600;
    line-height: 1;
    letter-spacing: .3px;
}

/* ============ 页面"服务信息"购买区块（Apple 连续圆角卡片） ============ */
/* 外层大边框：苹果式 squircle 圆角 + 发丝描边 + 柔和投影 */
fieldset.newvfx-pay {
    border: 1px solid rgba(0, 0, 0, .08) !important;
    border-radius: 20px !important;
    corner-shape: squircle;
    background: #ffffff !important;
    padding: 18px 20px 20px !important;
    margin: 0 0 18px !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .04), 0 8px 24px rgba(0, 0, 0, .05);
}
fieldset.newvfx-pay > legend { font-size: 15px; font-weight: 600; color: #1c1c1e; padding: 0 10px; margin-left: -6px; }
html[data-theme="dark"] fieldset.newvfx-pay { border-color: #3a3a3c !important; background: #1c1c1e !important; box-shadow: 0 1px 3px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .35); }
html[data-theme="dark"] fieldset.newvfx-pay > legend { color: #f5f5f7; }
fieldset.newvfx-pay fieldset.newvfx-pay-child {
    border: 1px solid rgba(0, 0, 0, .08) !important;
    border-radius: 16px !important;
    corner-shape: squircle;
    background: #fbfbfd !important;
    padding: 16px 20px 18px !important;
    margin: 0 0 14px !important;
    color: #1c1c1e;
    font-size: 14px;
    line-height: 1.6;
}
fieldset.newvfx-pay fieldset.newvfx-pay-child legend {
    font-size: 15px;
    font-weight: 600;
    color: #1c1c1e;
    padding: 0 8px;
    margin-left: -4px;
}
fieldset.newvfx-pay fieldset.newvfx-pay-child .newvfx-pay-price {
    font-size: 24px;
    font-weight: 700;
    color: #1c1c1e;
    letter-spacing: -.5px;
    margin: 0 2px;
}
html[data-theme="dark"] fieldset.newvfx-pay fieldset.newvfx-pay-child {
    border-color: #3a3a3c !important;
    background: #242426 !important;
    color: #f5f5f7;
}
html[data-theme="dark"] fieldset.newvfx-pay fieldset.newvfx-pay-child legend,
html[data-theme="dark"] fieldset.newvfx-pay fieldset.newvfx-pay-child .newvfx-pay-price { color: #f5f5f7; }

/* 购买钮：现代支付主 CTA（绿色渐变实心 + 阴影 + 悬停上浮） */
.newvfx-pay-iframe.newvfx-pay-buy {
    height: 40px;
    padding: 0 24px !important;
    margin-left: 12px;
    border-radius: 12px !important;
    corner-shape: squircle;
    background: linear-gradient(135deg, #07c160, #05a050) !important;
    color: #fff !important;
    box-shadow: 0 4px 12px rgba(7, 193, 96, .28);
    vertical-align: middle;
    transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}
.newvfx-pay-iframe.newvfx-pay-buy:hover {
    transform: translateY(-1px);
    filter: brightness(1.05);
    box-shadow: 0 6px 16px rgba(7, 193, 96, .36);
}
.newvfx-pay-iframe.newvfx-pay-buy:active { transform: translateY(0); filter: brightness(.97); }

/* 升级会员钮：金色描边次级钮（VIP 质感，非扁平鲑鱼红） */
fieldset.newvfx-pay fieldset.newvfx-pay-child .newvfx-pay-vip {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    height: 40px;
    padding: 0 20px !important;
    margin-left: 12px;
    border-radius: 12px !important;
    corner-shape: squircle;
    background: transparent !important;
    border: 1.5px solid #d4a017 !important;
    color: #a07818 !important;
    font-size: 14px !important;
    font-weight: 600;
    line-height: 1;
    vertical-align: middle;
    text-decoration: none !important;
    transition: background .15s ease, transform .15s ease;
}
fieldset.newvfx-pay fieldset.newvfx-pay-child .newvfx-pay-vip:hover {
    background: rgba(212, 160, 23, .1) !important;
    transform: translateY(-1px);
}
html[data-theme="dark"] fieldset.newvfx-pay fieldset.newvfx-pay-child .newvfx-pay-vip {
    border-color: #d4a83a !important;
    color: #f0c850 !important;
}
html[data-theme="dark"] fieldset.newvfx-pay fieldset.newvfx-pay-child .newvfx-pay-vip:hover {
    background: rgba(240, 200, 80, .12) !important;
}

/* 窄屏：按钮换行铺满 */
@media (max-width: 480px) {
    fieldset.newvfx-pay fieldset.newvfx-pay-child .newvfx-pay-vip,
    .newvfx-pay-iframe.newvfx-pay-buy {
        margin: 10px 10px 0 0;
    }
}
