/* ============================================================
   广告位自助购买页（star）
   ------------------------------------------------------------
   与 default 那套购买页功能一致（上传/尺寸校验/档位折扣/扫码支付），
   视觉跟着 star：白卡 + 8px 圆角 + 主题色，表单控件与站内其他页同源。
   ============================================================ */

.st-adbuy-slotbar {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    padding: 14px 16px;
    border-radius: var(--main-radius);
    background: var(--main-bg-color);
    box-shadow: var(--shadow-sm);
}
.st-adbuy-slotbar .st-adbuy-slotname {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 15px;
    color: var(--text-strong);
}
.st-adbuy-slotbar .st-adbuy-slotname i { color: var(--theme-color); font-size: 17px; }
.st-adbuy-meta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-muted);
}
.st-adbuy-meta b { font-weight: 400; color: var(--text-color); }
.st-adbuy-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 9px;
    border-radius: var(--radius-pill);
    font-size: 11.5px;
    background: var(--theme-soft);
    color: var(--theme-color);
}
.st-adbuy-tag.is-leased { background: var(--muted-bg); color: var(--text-muted); }

/* ---------------- 表单区 ---------------- */
.st-adbuy-sec {
    padding: 16px 18px 18px;
    border-radius: var(--main-radius);
    background: var(--main-bg-color);
    box-shadow: var(--shadow-sm);
}
.st-adbuy-sec > h2 {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 0 0 14px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-strong);
}
.st-adbuy-sec > h2 i { color: var(--theme-color); font-size: 16px; }

.st-adbuy-field { margin-bottom: 14px; }
.st-adbuy-field:last-child { margin-bottom: 0; }
.st-adbuy-field > label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    color: var(--text-color);
}
.st-adbuy-field .req { color: var(--theme-color); }

.st-adbuy-input,
.st-adbuy-field input[type="text"],
.st-adbuy-field input[type="url"] {
    width: 100%;
    height: 40px;
    padding: 0 12px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    background: var(--main-bg-color);
    color: var(--text-color);
    font-family: inherit;
    font-size: 13px;
    outline: none;
    transition: border-color .16s var(--ease), box-shadow .16s var(--ease);
}
.st-adbuy-field input:focus {
    border-color: var(--theme-color);
    box-shadow: 0 0 0 3px var(--theme-soft);
}

.st-adbuy-hint {
    margin-top: 6px;
    font-size: 11.5px;
    line-height: 1.7;
    color: var(--text-muted);
}
.st-adbuy-hint code {
    padding: 1px 4px;
    border-radius: 3px;
    background: var(--muted-bg);
    font-size: 11px;
}

/* 上传 / 外链 切换 */
.st-adbuy-tabs { display: inline-flex; gap: 4px; margin-bottom: 10px; }
.st-adbuy-tabs button {
    height: 30px;
    padding: 0 13px;
    border: 1px solid transparent;
    border-radius: var(--radius-pill);
    background: var(--muted-bg);
    color: var(--text-muted);
    font-family: inherit;
    font-size: 12.5px;
    cursor: pointer;
    transition: all .16s var(--ease);
}
.st-adbuy-tabs button.on {
    background: var(--theme-soft);
    border-color: rgba(241, 64, 75, .28);
    color: var(--theme-color);
}

.st-adbuy-drop {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    height: 148px;
    padding: 14px;
    text-align: center;
    border-radius: var(--radius-lg);
    border: 1px dashed rgba(16, 24, 40, .2);
    background: var(--muted-bg);
    cursor: pointer;
    transition: border-color .18s var(--ease), background .18s var(--ease);
}
.st-adbuy-drop i { font-size: 32px; color: var(--text-muted); opacity: .5; line-height: 1; }
.st-adbuy-drop b { font-weight: 400; font-size: 13px; color: var(--text-color); }
.st-adbuy-drop span { font-size: 11.5px; color: var(--text-muted); line-height: 1.6; }
.st-adbuy-drop:hover,
.st-adbuy-drop.drag { border-color: var(--theme-color); background: var(--theme-soft); }
.st-adbuy-drop:hover i { color: var(--theme-color); opacity: .8; }

.st-adbuy-preview { display: none; margin-top: 12px; }
.st-adbuy-preview img {
    display: block;
    max-width: 100%;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line-color);
}
.st-adbuy-preview .meta {
    display: flex;
    gap: 12px;
    margin-top: 6px;
    font-size: 11.5px;
    color: var(--text-muted);
}
.st-adbuy-preview .warn { color: #d97706; }

/* 档位 */
.st-adbuy-tiers {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}
.st-adbuy-tier { position: relative; }
.st-adbuy-tier input { position: absolute; opacity: 0; pointer-events: none; }
.st-adbuy-tier label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 14px 8px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-md, 8px);
    cursor: pointer;
    transition: all .16s var(--ease);
}
.st-adbuy-tier label b { font-size: 13px; font-weight: 400; color: var(--text-color); }
.st-adbuy-tier label em {
    font-style: normal;
    font-size: 17px;
    color: var(--theme-color);
    line-height: 1.2;
}
.st-adbuy-tier label small { font-size: 11px; color: var(--text-muted); }
.st-adbuy-tier input:checked + label {
    border-color: var(--theme-color);
    background: var(--theme-soft);
    box-shadow: 0 0 0 1px var(--theme-color) inset;
}
.st-adbuy-tier .off {
    position: absolute;
    top: -7px;
    right: 6px;
    padding: 1px 6px;
    border-radius: var(--radius-pill);
    background: var(--theme-color);
    color: #fff;
    font-size: 10.5px;
    line-height: 1.6;
}

/* 支付方式 */
.st-adbuy-pay { display: flex; gap: 10px; flex-wrap: wrap; }
.st-adbuy-pay label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 10px 18px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 13px;
    color: var(--text-color);
    transition: all .16s var(--ease);
}
.st-adbuy-pay input { position: absolute; opacity: 0; pointer-events: none; }
.st-adbuy-pay label i { font-size: 17px; }
.st-adbuy-pay label:has(input:checked) {
    border-color: var(--theme-color);
    background: var(--theme-soft);
    color: var(--theme-color);
}

/* 提交条 */
.st-adbuy-submit {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    padding: 16px 18px;
    border-radius: var(--main-radius);
    background: var(--main-bg-color);
    box-shadow: var(--shadow-sm);
}
.st-adbuy-total { font-size: 13px; color: var(--text-muted); }
.st-adbuy-total b {
    margin-left: 6px;
    font-size: 24px;
    font-weight: 400;
    color: var(--theme-color);
    letter-spacing: .3px;
}
.st-adbuy-btn {
    margin-left: auto;
    height: 44px;
    padding: 0 34px;
    border: 0;
    border-radius: var(--radius-sm);
    background: var(--theme-color);
    color: #fff;
    font-family: inherit;
    font-size: 14.5px;
    cursor: pointer;
    transition: filter .16s var(--ease), transform .12s var(--ease);
}
.st-adbuy-btn:hover { filter: brightness(1.05); }
.st-adbuy-btn:active { transform: translateY(1px); }
.st-adbuy-btn:disabled { opacity: .6; cursor: not-allowed; }

.st-adbuy-alert {
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    background: rgba(241, 64, 75, .08);
    color: #b42318;
    font-size: 13px;
    line-height: 1.7;
}
html[data-theme="dark"] .st-adbuy-alert { background: rgba(241, 64, 75, .16); color: #ff9c9c; }

/* ---------------- 扫码支付弹窗 ---------------- */
.st-adpay {
    position: fixed;
    inset: 0;
    z-index: 9990;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.st-adpay[hidden] { display: none; }
.st-adpay-mask { position: absolute; inset: 0; background: rgba(15, 23, 42, .46); }
.st-adpay-card {
    position: relative;
    width: min(92vw, 380px);
    padding: 22px 22px 18px;
    border-radius: var(--radius-lg);
    background: var(--main-bg-color);
    box-shadow: var(--shadow-lg);
    text-align: center;
    animation: stAdpayIn .2s var(--ease);
}
@keyframes stAdpayIn { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
.st-adpay-card h3 { margin: 0 0 4px; font-size: 15px; font-weight: 500; color: var(--text-strong); }
.st-adpay-title { font-size: 12px; color: var(--text-muted); word-break: break-all; }
.st-adpay-amount { margin: 10px 0 14px; font-size: 27px; color: var(--theme-color); }
.st-adpay-qr {
    width: 200px;
    height: 200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    background: #fff;
    border: 1px solid var(--line-color);
    overflow: hidden;
}
.st-adpay-qr img, .st-adpay-qr canvas { width: 190px; height: 190px; }
.st-adpay-qr iframe { width: 100%; height: 100%; border: 0; }
.st-adpay-status { margin-top: 12px; font-size: 12.5px; color: var(--text-muted); min-height: 20px; }
.st-adpay-status.is-ok { color: #16a34a; }
.st-adpay-foot { margin-top: 10px; font-size: 11px; color: var(--text-xs); line-height: 1.7; }
.st-adpay-close {
    position: absolute;
    top: 8px;
    right: 10px;
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--text-muted);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}
.st-adpay-close:hover { background: var(--muted-bg); color: var(--text-color); }

/* 右栏投放须知 */
.st-adbuy-notes { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; }
.st-adbuy-notes li {
    position: relative;
    padding-left: 14px;
    font-size: 12.5px;
    line-height: 1.75;
    color: var(--text-color);
}
.st-adbuy-notes li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 8px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--theme-color);
    opacity: .6;
}
.st-adbuy-notes b { font-weight: 400; color: var(--text-strong); }

@media (max-width: 900px) {
    .st-adbuy-tiers { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 768px) {
    .st-adbuy-sec { padding: 14px; }
    .st-adbuy-btn { width: 100%; margin-left: 0; }
    .st-adbuy-total b { font-size: 21px; }
    .st-adbuy-drop { height: 120px; }
}
