/* ==========================================================================
   广告位投放页设计系统（/ad/one-yuan、/ad/buy 共用）
   - 背景：壁纸图层 + 轻遮罩 + 颗粒；壁纸由 /assets/js/ad-wallpaper.js 驱动
   - 卡片：暗色玻璃拟态；不依赖 Bootstrap / Font Awesome / jQuery
   ========================================================================== */

:root {
    --ink: #eef2ff;
    --ink-2: #a8b2cf;
    --ink-3: #7d88a8;
    --glass: rgba(9, 13, 26, .66);
    --acc-a: #8b5cf6;
    --acc-b: #22d3ee;
    --gold: #fbbf24;
    --danger: #fb7185;
    --radius: 24px;
}

* { box-sizing: border-box; }

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", Roboto, sans-serif;
    color: var(--ink);
    background: #0b1020;
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 40px 16px 56px;
    -webkit-font-smoothing: antialiased;
}

/* ===== 背景壁纸层 ===== */
.bg-stage { position: fixed; inset: 0; z-index: 0; overflow: hidden; }
.bg-fallback {
    position: absolute; inset: 0;
    background:
        radial-gradient(at 8% 0%, #2a1d63 0, transparent 55%),
        radial-gradient(at 92% 8%, #10456b 0, transparent 55%),
        radial-gradient(at 50% 100%, #3a1146 0, transparent 60%),
        #080b16;
}
.bg-img {
    position: absolute; inset: -2%;
    background-size: cover; background-position: center;
    opacity: 0; transition: opacity 1.1s ease;
    filter: saturate(1.05);
    transform: scale(1.04);
}
.bg-img.is-on { opacity: 1; }
.bg-veil {
    position: absolute; inset: 0;
    background:
        radial-gradient(120% 85% at 50% 0%, rgba(6, 10, 24, .06) 0, rgba(6, 10, 24, .34) 100%),
        linear-gradient(180deg, rgba(5, 8, 18, .22) 0, rgba(5, 8, 18, .40) 55%, rgba(3, 6, 14, .58) 100%);
}
.bg-grain {
    position: absolute; inset: 0; opacity: .1; mix-blend-mode: overlay; pointer-events: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/></filter><rect width='140' height='140' filter='url(%23n)' opacity='.55'/></svg>");
}

/* ===== 壁纸控制条 ===== */
.wp-bar {
    position: fixed; top: 16px; right: 16px; z-index: 5;
    display: flex; flex-direction: column; align-items: flex-end; gap: 6px;
}
.wp-btn {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 8px 14px; border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, .18);
    background: rgba(10, 14, 28, .55);
    -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
    color: var(--ink); font-size: 12.5px; font-weight: 600; letter-spacing: .3px;
    cursor: pointer; transition: .25s;
}
.wp-btn:hover { background: rgba(30, 27, 75, .7); border-color: rgba(139, 92, 246, .6); transform: translateY(-1px); }
.wp-btn svg { width: 14px; height: 14px; }
.wp-btn.is-spin svg { animation: adSpin .9s linear infinite; }
.wp-credit { font-size: 11px; color: rgba(238, 242, 255, .6); max-width: 220px; text-align: right; line-height: 1.5; text-shadow: 0 1px 6px rgba(0, 0, 0, .6); }
@keyframes adSpin { to { transform: rotate(360deg); } }

/* ===== 诊断面板（?wpdebug=1） ===== */
.wp-debug {
    position: fixed; left: 12px; bottom: 12px; z-index: 60; max-width: 86vw;
    padding: 10px 12px; border-radius: 12px;
    background: rgba(6, 9, 20, .82); border: 1px solid rgba(255, 255, 255, .16);
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
    font-size: 11.5px; line-height: 1.7; color: #cbd5e1;
    font-family: ui-monospace, Consolas, Menlo, monospace;
    white-space: pre-wrap; word-break: break-all; display: none;
}
.wp-debug.is-on { display: block; }
.wp-debug b { color: #a5b4fc; }
.wp-debug .ok { color: #6ee7b7; }
.wp-debug .no { color: #fda4af; }

/* ===== 主卡片 ===== */
.card {
    position: relative; z-index: 2;
    width: 100%; max-width: 560px;
    background: var(--glass);
    -webkit-backdrop-filter: blur(26px) saturate(160%); backdrop-filter: blur(26px) saturate(160%);
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: var(--radius);
    box-shadow: 0 40px 90px -28px rgba(0, 0, 0, .85), inset 0 1px 0 rgba(255, 255, 255, .1);
    padding: 28px 26px 24px;
    overflow: hidden;
    animation: adRise .6s cubic-bezier(.22, .8, .3, 1) both;
}
@supports not ((backdrop-filter: blur(2px)) or (-webkit-backdrop-filter: blur(2px))) {
    .card { background: rgba(8, 11, 22, .93); }
}
@keyframes adRise { from { opacity: 0; transform: translateY(22px) scale(.985); } to { opacity: 1; transform: none; } }
.card::before {
    content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2px;
    background: linear-gradient(90deg, transparent, var(--acc-a) 25%, var(--acc-b) 60%, transparent);
    opacity: .9;
}
.card::after {
    content: ""; position: absolute; width: 320px; height: 320px; right: -140px; top: -170px;
    background: radial-gradient(closest-side, rgba(139, 92, 246, .38), transparent);
    pointer-events: none;
}
.center { text-align: center; }

/* ===== 头部 ===== */
.brand {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 5px 12px 5px 8px; border-radius: 999px;
    background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .12);
    font-size: 12px; color: var(--ink-2); letter-spacing: .4px;
}
.brand i { width: 7px; height: 7px; border-radius: 50%; background: #34d399; box-shadow: 0 0 10px #34d399; display: block; }
.hd { text-align: center; margin: 16px 0 22px; }
.hd .pos {
    display: inline-block; margin-bottom: 10px; padding: 4px 12px; border-radius: 999px;
    font-size: 11.5px; letter-spacing: .4px; color: #99f6e4;
    background: rgba(34, 211, 238, .12); border: 1px solid rgba(34, 211, 238, .3);
}
.price { display: flex; align-items: flex-start; justify-content: center; gap: 3px; line-height: 1; }
.price .cur { font-size: 22px; font-weight: 700; margin-top: 12px; color: var(--gold); }
.price .amt {
    font-size: 62px; font-weight: 800; letter-spacing: -2px;
    background: linear-gradient(180deg, #fff6e6 0, #fbbf24 55%, #f97316 100%);
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 8px 22px rgba(251, 191, 36, .28));
}
.price .per { align-self: flex-end; margin-bottom: 12px; font-size: 12px; color: var(--ink-3); }
.hd h1 { margin: 6px 0 4px; font-size: 21px; font-weight: 800; letter-spacing: .5px; }
.hd p { margin: 0; font-size: 12.5px; color: var(--ink-3); }

/* ===== 须知 ===== */
.notice {
    border: 1px solid rgba(251, 113, 133, .28);
    background: linear-gradient(180deg, rgba(190, 18, 60, .16), rgba(190, 18, 60, .06));
    border-radius: 16px; padding: 14px 15px 6px; margin-bottom: 20px;
}
.notice h6 { display: flex; align-items: center; gap: 7px; margin: 0 0 9px; font-size: 13.5px; font-weight: 800; color: #ffc7d1; }
.notice h6 svg { width: 15px; height: 15px; color: var(--danger); }
.notice ul { list-style: none; padding: 0; margin: 0 0 6px; }
.notice li { position: relative; padding-left: 15px; font-size: 12.5px; line-height: 1.75; color: #f7b8c4; }
.notice li::before { content: ""; position: absolute; left: 2px; top: 9px; width: 5px; height: 5px; border-radius: 50%; background: var(--danger); opacity: .7; }
.notice li b { color: #fff1f2; }

/* ===== 流程 ===== */
.steps { position: relative; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 16px 0 4px; margin-top: 4px; }
.steps::before { content: ""; position: absolute; left: 12%; right: 12%; top: 31px; height: 1px; background: linear-gradient(90deg, transparent, rgba(139, 92, 246, .5), rgba(34, 211, 238, .5), transparent); }
.step { position: relative; text-align: center; }
.step em {
    position: relative; z-index: 1; display: inline-flex; align-items: center; justify-content: center;
    width: 30px; height: 30px; border-radius: 50%; margin-bottom: 6px; font-style: normal;
    background: rgba(12, 16, 32, .9); border: 1px solid rgba(139, 92, 246, .45);
    box-shadow: 0 6px 16px -6px rgba(0, 0, 0, .8);
}
.step em svg { width: 15px; height: 15px; color: #c4b5fd; }
.step span { display: block; font-size: 11px; color: var(--ink-2); letter-spacing: .2px; }

/* ===== 分区标题 ===== */
.sec { display: flex; align-items: center; gap: 10px; margin: 24px 0 13px; }
.sec b {
    display: inline-flex; align-items: center; gap: 7px; white-space: nowrap;
    font-size: 12.5px; font-weight: 800; letter-spacing: .4px;
    padding: 5px 13px 5px 6px; border-radius: 999px;
    color: #ddd6fe; background: rgba(139, 92, 246, .16); border: 1px solid rgba(139, 92, 246, .34);
}
.sec b i {
    display: inline-flex; align-items: center; justify-content: center;
    width: 18px; height: 18px; border-radius: 50%; font-style: normal; font-size: 10.5px; font-weight: 800;
    background: linear-gradient(135deg, var(--acc-a), var(--acc-b)); color: #0a0d1a;
}
.sec .ln { flex: 1; height: 1px; background: linear-gradient(90deg, rgba(255, 255, 255, .16), transparent); }

/* ===== 表单 ===== */
.fld { margin-bottom: 14px; }
.fld > label { display: flex; align-items: center; justify-content: space-between; font-size: 12px; font-weight: 700; color: var(--ink-2); margin-bottom: 7px; letter-spacing: .3px; }
.fld > label .cnt { font-weight: 600; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.ipt { position: relative; }
.ipt > svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--ink-3); pointer-events: none; transition: .25s; }
.ipt input, .ipt select {
    width: 100%; height: 46px; padding: 0 14px 0 40px;
    font-size: 15px; color: var(--ink);
    background: rgba(255, 255, 255, .05);
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 13px; outline: none; transition: .25s;
    -webkit-appearance: none; appearance: none;
}
.ipt select { padding-right: 38px; cursor: pointer; }
.ipt .chev { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); width: 12px; height: 12px; color: var(--ink-3); pointer-events: none; }
.ipt option { color: #0f172a; background: #f8fafc; }
.ipt input::placeholder { color: rgba(168, 178, 207, .55); }
.ipt input:hover, .ipt select:hover { border-color: rgba(255, 255, 255, .26); }
.ipt input:focus, .ipt select:focus { border-color: rgba(139, 92, 246, .8); background: rgba(139, 92, 246, .08); box-shadow: 0 0 0 4px rgba(139, 92, 246, .14); }
.ipt:focus-within > svg { color: #c4b5fd; }
.tip { margin: 6px 0 0; font-size: 11.5px; color: var(--ink-3); line-height: 1.6; }

/* ===== 预览 ===== */
.preview { margin: 16px 0 4px; padding: 11px 13px; border-radius: 14px; border: 1px dashed rgba(255, 255, 255, .18); background: rgba(255, 255, 255, .035); }
.preview .plabel { font-size: 11px; color: var(--ink-3); letter-spacing: .5px; margin-bottom: 8px; }
.prow { display: flex; align-items: center; gap: 9px; min-height: 22px; }
.ptag { flex: none; font-size: 10.5px; font-weight: 800; padding: 3px 8px; border-radius: 6px; color: #1a1204; background: linear-gradient(135deg, #fde68a, var(--gold)); box-shadow: 0 4px 12px -4px rgba(251, 191, 36, .7); }
.ptitle { font-size: 14px; font-weight: 700; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.phost { margin-left: auto; font-size: 11.5px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 45%; }
.thumb { margin-top: 9px; display: none; align-items: center; gap: 10px; }
.thumb.is-on { display: flex; }
.thumb img { width: 100%; max-width: 220px; height: 62px; object-fit: cover; border-radius: 10px; border: 1px solid rgba(255, 255, 255, .18); background: rgba(255, 255, 255, .05); }
.thumb span { font-size: 11.5px; color: var(--ink-3); line-height: 1.6; }

/* ===== 支付方式 ===== */
.pay-unavailable { padding: 12px 14px; border: 1px solid rgba(248, 113, 113, .38); border-radius: 10px; background: rgba(127, 29, 29, .2); color: #fecaca; font-size: 13px; line-height: 1.6; }
.pay { display: flex; gap: 12px; }
.pay-opt { position: relative; flex: 1; }
.pay-opt input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.pay-box {
    position: relative;
    display: flex; align-items: center; justify-content: center; gap: 9px;
    height: 50px; border-radius: 14px; cursor: pointer; transition: .25s;
    border: 1px solid rgba(255, 255, 255, .13); background: rgba(255, 255, 255, .04);
    font-size: 14px; font-weight: 700; color: var(--ink-2);
}
.pay-box .pay-ico { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 8px; font-style: normal; font-size: 13px; font-weight: 800; color: #fff; }
.pay-ico.ali { background: linear-gradient(135deg, #1677ff, #00a3ee); box-shadow: 0 6px 14px -6px rgba(22, 119, 255, .95); }
.pay-ico.wx { background: linear-gradient(135deg, #09bb07, #22c55e); box-shadow: 0 6px 14px -6px rgba(9, 187, 7, .95); }
.pay-opt:hover .pay-box { border-color: rgba(255, 255, 255, .28); background: rgba(255, 255, 255, .07); }
.pay-opt input:checked + .pay-box { border-color: rgba(34, 211, 238, .65); background: rgba(34, 211, 238, .1); color: #fff; box-shadow: 0 0 0 3px rgba(34, 211, 238, .12); }
.pay-opt input:focus-visible + .pay-box { box-shadow: 0 0 0 3px rgba(139, 92, 246, .5); }
.pay-mark { position: absolute; top: 7px; right: 9px; width: 15px; height: 15px; border-radius: 50%; background: linear-gradient(135deg, var(--acc-a), var(--acc-b)); opacity: 0; transform: scale(.6); transition: .25s; }
.pay-mark::after { content: ""; position: absolute; left: 5px; top: 2.5px; width: 4px; height: 7px; border: solid #0a0d1a; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.pay-opt input:checked + .pay-box .pay-mark { opacity: 1; transform: scale(1); }

/* ===== 合计 + 提交 ===== */
.total { display: flex; align-items: baseline; justify-content: space-between; margin: 20px 0 0; padding: 14px 16px; border-radius: 14px; background: linear-gradient(180deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, .02)); border: 1px solid rgba(255, 255, 255, .1); }
.total > span { font-size: 12.5px; color: var(--ink-2); }
.total strong { font-size: 24px; font-weight: 800; color: var(--gold); letter-spacing: -.5px; }
.total em { font-style: normal; font-size: 11.5px; color: var(--ink-3); margin-left: 6px; }
.total .calc { display: block; font-size: 11px; color: var(--ink-3); margin-top: 3px; }
.submit {
    position: relative; overflow: hidden;
    width: 100%; margin-top: 14px; padding: 17px; border: none; border-radius: 15px; cursor: pointer;
    font-size: 17px; font-weight: 800; letter-spacing: 1px; color: #fff;
    background: linear-gradient(135deg, #6d28d9 0, #7c3aed 45%, #0ea5e9 100%);
    box-shadow: 0 20px 40px -14px rgba(109, 40, 217, .8), inset 0 1px 0 rgba(255, 255, 255, .25);
    transition: transform .2s, box-shadow .25s, filter .25s;
    display: flex; align-items: center; justify-content: center; gap: 9px;
}
.submit svg { width: 17px; height: 17px; }
.submit:hover { transform: translateY(-2px); box-shadow: 0 26px 50px -14px rgba(14, 165, 233, .7), inset 0 1px 0 rgba(255, 255, 255, .3); filter: saturate(1.1); }
.submit:active { transform: translateY(0); }
.submit[disabled] { cursor: default; filter: grayscale(.35) brightness(.8); transform: none; }
.submit.is-off { background: linear-gradient(135deg, #334155, #1e293b); box-shadow: none; cursor: not-allowed; }
.submit::after {
    content: ""; position: absolute; top: 0; left: -60%; width: 40%; height: 100%;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .38), transparent);
    transform: skewX(-18deg); animation: adSheen 3.2s ease-in-out infinite;
}
.submit[disabled]::after, .submit.is-off::after { animation: none; opacity: 0; }
@keyframes adSheen { 0%, 60% { left: -60%; } 100% { left: 130%; } }
.secure { text-align: center; margin: 11px 0 0; font-size: 11.5px; color: var(--ink-3); }
.linkline { text-align: center; margin: 12px 0 0; }
.linkline a { font-size: 12px; color: var(--ink-2); text-decoration: none; border-bottom: 1px dashed rgba(168, 178, 207, .4); padding-bottom: 1px; }
.linkline a:hover { color: #c4b5fd; border-bottom-color: #c4b5fd; }

/* ===== 底部 ===== */
.foot { display: flex; gap: 12px; margin-top: 22px; padding-top: 18px; border-top: 1px solid rgba(255, 255, 255, .09); }
.capsule {
    flex: 1; display: flex; align-items: center; justify-content: center; gap: 7px;
    padding: 12px; border-radius: 999px; font-size: 13px; font-weight: 700;
    text-decoration: none !important; transition: .25s;
}
.capsule svg { width: 15px; height: 15px; }
.capsule-qq { color: #bfdbfe; background: rgba(59, 130, 246, .14); border: 1px solid rgba(96, 165, 250, .3); }
.capsule-qq:hover { background: rgba(59, 130, 246, .26); color: #fff; transform: translateY(-1px); }
.capsule-home { color: var(--ink-2); background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .12); }
.capsule-home:hover { background: rgba(255, 255, 255, .12); color: #fff; transform: translateY(-1px); }
.copyright { text-align: center; margin: 14px 0 0; font-size: 11.5px; color: var(--ink-3); }

/* ===== 提示气泡 ===== */
.toasts { position: fixed; left: 50%; top: 22px; transform: translateX(-50%); z-index: 70; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
    display: flex; align-items: center; gap: 8px;
    max-width: 82vw; padding: 10px 16px; border-radius: 999px; font-size: 13px; font-weight: 600;
    color: #1a1204; background: linear-gradient(135deg, #fde68a, var(--gold));
    box-shadow: 0 16px 32px -12px rgba(0, 0, 0, .7);
    animation: adPop .28s cubic-bezier(.2, .9, .3, 1.2) both;
}
.toast.is-error { color: #fff; background: linear-gradient(135deg, #e11d48, #be123c); }
.toast.is-ok { color: #04200f; background: linear-gradient(135deg, #86efac, #34d399); }
.toast.out { animation: adFade .3s ease both; }
@keyframes adPop { from { opacity: 0; transform: translateY(-14px); } }
@keyframes adFade { to { opacity: 0; transform: translateY(-10px); } }

/* ===== 说明弹层（替代 layer.js） ===== */
.modal { position: fixed; inset: 0; z-index: 80; display: none; align-items: center; justify-content: center; padding: 20px 16px; }
.modal.is-on { display: flex; }
.modal-mask { position: absolute; inset: 0; background: rgba(3, 6, 14, .68); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.modal-box {
    position: relative; width: 100%; max-width: 460px; max-height: 78vh; overflow: auto;
    background: rgba(11, 15, 28, .96); border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 20px; padding: 22px 22px 18px;
    box-shadow: 0 40px 90px -24px rgba(0, 0, 0, .9);
    animation: adPop .3s cubic-bezier(.2, .9, .3, 1.1) both;
}
.modal-box h4 { margin: 0 0 12px; font-size: 16px; font-weight: 800; color: #fff; display: flex; align-items: center; gap: 8px; }
.modal-box h4 svg { width: 17px; height: 17px; color: var(--acc-b); }
.modal-box ol { margin: 0; padding-left: 20px; }
.modal-box li { font-size: 13px; line-height: 2; color: var(--ink-2); }
.modal-box .qq { margin: 12px 0 0; font-size: 12.5px; color: #93c5fd; }
.modal-box .close { display: block; width: 100%; margin-top: 18px; padding: 12px; border: none; border-radius: 12px; cursor: pointer; font-size: 14px; font-weight: 800; color: #fff; background: linear-gradient(135deg, #6d28d9, #0ea5e9); }
.modal-x { position: absolute; top: 12px; right: 14px; width: 28px; height: 28px; border: 1px solid rgba(255, 255, 255, .16); border-radius: 50%; background: rgba(255, 255, 255, .06); color: var(--ink-2); font-size: 16px; line-height: 26px; cursor: pointer; }
.modal-x:hover { color: #fff; background: rgba(255, 255, 255, .14); }

/* ===== 响应式 ===== */
@media (max-width: 768px) {
    body { padding: 62px 12px 40px; }
    .card { padding: 22px 18px 20px; border-radius: 20px; }
    .price .amt { font-size: 50px; }
    .hd h1 { font-size: 19px; }
    .steps::before { top: 27px; }
    .step em { width: 26px; height: 26px; }
    .step span { font-size: 10px; }
    .submit { font-size: 16px; padding: 16px; }
    .wp-credit { display: none; }
    .wp-bar { top: 12px; right: 12px; }
    .wp-btn { padding: 7px 11px; }
    .wp-btn .wp-text { display: none; }
    .thumb img { max-width: 150px; height: 54px; }
}
@media (prefers-reduced-motion: reduce) {
    .card, .toast, .modal-box { animation: none; }
    .submit::after { display: none; }
    .bg-img { transition: none; }
}
