/* 自助广告位样式 */
.b2child-self-ad {
    margin: 16px 0;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 12px;
    background: #fff;
}
.b2child-self-ad-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}
.b2child-self-ad-title {
    font-weight: 600;
    font-size: 15px;
}
.b2child-self-ad-btn {
    display: inline-block;
    padding: 5px 14px;
    background: #ff6b6b;
    color: #fff;
    border-radius: 20px;
    font-size: 13px;
    text-decoration: none;
    cursor: pointer;
}
.b2child-self-ad-btn:hover { opacity: .9; color:#fff; }

.b2child-self-ad-grid {
    display: grid;
    grid-template-columns: repeat(var(--per-row, 2), 1fr);
    gap: 10px;
}
@media (max-width: 768px) {
    .b2child-self-ad-grid {
        grid-template-columns: repeat(var(--mobile-per-row, 1), 1fr);
    }
}
.b2child-self-ad-card {
    position: relative;
    display: block;
    aspect-ratio: 8 / 1;
    border-radius: 6px;
    overflow: hidden;
    background: #f5f5f5;
}
.b2child-self-ad-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.b2child-self-ad-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px dashed #ccc;
    color: #999;
    font-size: 13px;
    cursor: pointer;
    background: #fafafa;
}
.b2child-self-ad-empty:hover { border-color: #ff6b6b; color: #ff6b6b; }

.b2child-self-ad-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.b2child-self-ad-link {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    border: 1px solid #eee;
    border-radius: 20px;
    font-size: 13px;
    text-decoration: none;
    cursor: pointer;
}
.b2child-self-ad-link:hover { border-color: #ff6b6b; }

.b2child-self-ad-error { color: #e74c3c; padding: 10px; }

/* 弹窗 */
.b2child-self-ad-modal {
    position: fixed; inset: 0; z-index: 9999;
}
.b2child-self-ad-modal-mask {
    position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 9998;
}
.b2child-self-ad-modal-box {
    position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 460px; max-width: 94vw; max-height: 92vh; overflow: auto;
    background: #f5f7fa; border-radius: 12px; z-index: 9999;
    box-shadow: 0 10px 40px rgba(0,0,0,.25);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
.b2child-self-ad-modal-head {
    display: flex; justify-content: center; align-items: center;
    padding: 16px; background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    border-radius: 12px 12px 0 0; color: #fff; position: relative;
}
.b2child-self-ad-modal-title {
    display: flex; align-items: center; gap: 8px; font-size: 18px; font-weight: 600;
}
.b2sa-cart { width: 24px; height: 24px; fill: #fff; }
.b2child-self-ad-modal-close {
    position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
    font-size: 28px; color: #fff; text-decoration: none; opacity: .9;
}
.b2child-self-ad-modal-close:hover { opacity: 1; color: #fff; }
.b2child-self-ad-modal-body { padding: 16px; }

/* 通用卡片 */
.b2sa-section {
    background: #fff; border-radius: 10px; padding: 14px; margin-bottom: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.b2sa-section-title {
    font-size: 14px; color: #666; margin-bottom: 10px; display: flex; align-items: center; gap: 4px;
}
.b2sa-section-title i { color: #999; font-style: normal; }

/* 广告位信息 */
.b2sa-info-head {
    display: flex; align-items: center; gap: 8px; margin-bottom: 10px;
}
.b2sa-tag {
    display: inline-block; padding: 2px 8px; border-radius: 4px;
    background: linear-gradient(135deg, #ff6b6b, #ff8e53); color: #fff; font-size: 12px;
}
.b2sa-slot-title { font-size: 16px; font-weight: 600; color: #333; }
.b2sa-info-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 6px 0; border-bottom: 1px dashed #f0f0f0; font-size: 14px; color: #555;
}
.b2sa-info-row:last-child { border-bottom: none; }
.b2sa-label { color: #999; }
.b2sa-value { color: #333; }
.b2sa-price { color: #1677ff; font-weight: 600; }
.b2sa-total { color: #ff4d4f; font-weight: 700; font-size: 16px; }
.b2sa-duration {
    padding: 4px 10px; border: 1px solid #ddd; border-radius: 6px; font-size: 14px; background: #fff;
}

/* 表单 */
.b2sa-input {
    width: 100%; padding: 10px 12px; margin-bottom: 10px; border: 1px solid #e8e8e8;
    border-radius: 8px; background: #f8f9fa; font-size: 14px; box-sizing: border-box;
}
.b2sa-input:focus { outline: none; border-color: #4facfe; background: #fff; }
.b2sa-image-row { display: flex; gap: 8px; margin-bottom: 4px; }
.b2sa-image-row .b2sa-input { flex: 1; margin-bottom: 0; }
.b2sa-btn-pick {
    padding: 8px 12px; border: none; border-radius: 8px; background: #4facfe; color: #fff;
    font-size: 13px; cursor: pointer; white-space: nowrap;
}
.b2sa-btn-pick:hover { opacity: .9; }
.b2sa-color-row {
    display: flex; align-items: center; gap: 8px; font-size: 13px; color: #666; margin-bottom: 6px;
}
.b2sa-color-row input[type=color] { width: 36px; height: 28px; border: none; padding: 0; cursor: pointer; }
.b2sa-tip { font-size: 12px; color: #999; margin: 6px 0 0; }

/* 购买说明 */
.b2sa-notice ul { margin: 0; padding-left: 18px; font-size: 13px; color: #666; }
.b2sa-notice li { margin-bottom: 4px; }

/* 支付方式 */
.b2sa-pay-list { display: flex; flex-wrap: wrap; gap: 10px; }
.b2sa-pay-item {
    flex: 1; min-width: 90px; display: flex; align-items: center; justify-content: center; gap: 6px;
    padding: 10px 8px; border: 1px solid #e8e8e8; border-radius: 8px; cursor: pointer;
    background: #f8f9fa; transition: all .2s; position: relative;
}
.b2sa-pay-item input[type=radio] { position: absolute; opacity: 0; }
.b2sa-pay-item.active,
.b2sa-pay-item:hover {
    border-color: #ff6b6b; background: #fff4f4;
}
.b2sa-pay-item .b2sa-icon { width: 22px; height: 22px; }
.b2sa-pay-name { font-size: 14px; color: #333; }
.b2sa-balance-row {
    display: flex; justify-content: space-between; align-items: center;
    margin-top: 12px; padding: 10px; border-radius: 8px; background: #f8f9fa; font-size: 14px; color: #666;
}
.b2sa-balance-amount { color: #1677ff; font-weight: 600; font-size: 16px; }

/* 提交按钮 */
.b2sa-submit-btn {
    width: 100%; padding: 14px; border: none; border-radius: 24px;
    background: linear-gradient(135deg, #ff6b6b 0%, #ff4d4f 100%);
    color: #fff; font-size: 16px; font-weight: 600; cursor: pointer;
    box-shadow: 0 4px 12px rgba(255,77,79,.3); transition: opacity .2s;
}
.b2sa-submit-btn:hover { opacity: .95; }
.b2sa-submit-btn:disabled { opacity: .6; cursor: default; }
.b2sa-submit-total { font-weight: 400; margin-left: 4px; }

.b2child-self-ad-msg { margin-top: 10px; font-size: 13px; min-height: 18px; text-align: center; display: none; }
.b2child-self-ad-msg.error { color: #ff4d4f; display: block; }
.b2child-self-ad-msg.success { color: #52c41a; display: block; }

.b2child-self-ad-pay { text-align: center; padding: 20px 0; }
.b2child-self-ad-qrcode { margin: 12px auto; max-width: 220px; }
.b2child-self-ad-qrcode img { max-width: 100%; }
.b2child-self-ad-pay-tip { font-size: 14px; color: #555; }
.b2child-self-ad-pay-status { margin-top: 10px; font-size: 13px; color: #999; }

@media (max-width: 480px) {
    .b2child-self-ad-modal-box { width: 100%; max-width: 96vw; border-radius: 10px; }
    .b2child-self-ad-modal-body { padding: 12px; }
    .b2sa-pay-list { gap: 8px; }
    .b2sa-pay-item { min-width: 80px; padding: 8px 6px; }
}
