/* =========================================================
   会员续费 / 积分充值弹窗（billing-modals.js 注入的统一设计）
   ---------------------------------------------------------
   设计语言：大气感
   - 居中对称构图：hero 大徽记 + 大标题居中，去碎边角
   - 大价格字（28px 等宽）、大卡片（hover 上浮）、宽敞留白
   - 金色只做「光」，不做「面」：细描边 + 光晕 + 渐变文字，
     主体保持深色沉稳
   - 保留 JS 逻辑硬引用的 id 与 class：
     membership-modal / membership-modal-title / -message / -expiry
     membership-plans-row(.plan-item .plan-label .plan-price .plan-desc)
     close-membership-modal / close-membership-btn / membership-code-btn / switch-to-credits
     credits-modal / billing-credit-balance / credit-plans-row
     buy-credits-btn / buy-credits-btn-price / credits-code-btn / switch-to-membership
     close-credits-modal / redeem-code-modal 系列 / contact-admin-modal 系列
   ========================================================= */

/* ---------- 弹窗骨架 ---------- */
#membership-modal.billing-modal,
#credits-modal.billing-modal,
#redeem-code-modal.billing-modal,
#contact-admin-modal.billing-modal {
    border: 1px solid rgba(211, 181, 143, 0.16);
    border-radius: 20px;
    background:
        radial-gradient(120% 60% at 50% 0%, rgba(211, 181, 143, 0.07) 0%, rgba(211, 181, 143, 0) 55%),
        linear-gradient(180deg, #131211 0%, #0c0d0f 42%);
    color: var(--brand-color-text-primary, #f7f7f5);
    box-shadow:
        0 32px 80px rgba(0, 0, 0, 0.6),
        0 0 0 1px rgba(0, 0, 0, 0.4),
        0 0 44px rgba(211, 181, 143, 0.05);
    padding: 0 0 30px;
    overflow: hidden;
}

#membership-modal.billing-modal { width: min(940px, calc(100vw - 48px)); max-width: min(940px, calc(100vw - 48px)); }
#credits-modal.billing-modal { width: min(820px, calc(100vw - 48px)); max-width: min(820px, calc(100vw - 48px)); }
#redeem-code-modal.billing-modal { width: min(460px, calc(100vw - 48px)); max-width: min(460px, calc(100vw - 48px)); padding: 28px 30px 26px; }
#contact-admin-modal.billing-modal { width: min(460px, calc(100vw - 48px)); max-width: min(460px, calc(100vw - 48px)); padding: 28px 30px 26px; }

/* 小屏/内容超高时限高滚动，避免弹窗被视口裁切 */
#membership-modal.billing-modal,
#credits-modal.billing-modal,
#redeem-code-modal.billing-modal,
#contact-admin-modal.billing-modal {
    max-height: calc(100vh - 48px);
    overflow-y: auto;
}

/* ---------- Hero：居中大徽记 ---------- */
.bm-hero {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    padding: 40px 56px 26px;
    text-align: center;
    /* 右上角是 absolute 关闭按钮，留出空间 */
    /* 关闭按钮悬浮于 hero 之上 */
}

.bm-hero-emblem {
    position: relative;
    width: 68px;
    height: 68px;
    display: grid;
    place-items: center;
    margin-bottom: 16px;
    border: 1px solid rgba(211, 181, 143, 0.45);
    border-radius: 50%;
    color: var(--brand-color-accent, #d3b58f);
    background: radial-gradient(circle at 50% 30%, rgba(211, 181, 143, 0.18) 0%, rgba(211, 181, 143, 0.04) 70%);
    box-shadow:
        0 0 0 6px rgba(211, 181, 143, 0.06),
        0 0 34px rgba(211, 181, 143, 0.22);
}

.bm-hero-emblem svg { width: 32px; height: 32px; }

/* 徽记下的金色光线 */
.bm-hero-emblem::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -17px;
    transform: translateX(-50%);
    width: 180px;
    height: 1px;
    background: linear-gradient(90deg, rgba(211, 181, 143, 0) 0%, rgba(211, 181, 143, 0.5) 50%, rgba(211, 181, 143, 0) 100%);
}

.bm-eyebrow {
    margin: 0 0 10px;
    color: var(--brand-color-accent, #d3b58f);
    font-family: var(--font-mono, ui-monospace, monospace);
    font-size: 11px;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    opacity: 0.9;
}

.bm-hero-title {
    margin: 0;
    color: var(--brand-color-text-primary, #f7f7f5);
    font-size: 30px;
    font-weight: 600;
    letter-spacing: 0.06em;
}

.bm-status-text {
    margin: 10px 0 0;
    color: var(--brand-color-text-secondary, #a4a4a2);
    font-size: 14px;
    line-height: 1.7;
    letter-spacing: 0.02em;
}

.bm-status-expiry {
    margin: 8px 0 0;
    padding: 4px 14px;
    border: 1px solid rgba(211, 181, 143, 0.28);
    border-radius: 999px;
    background: rgba(211, 181, 143, 0.07);
    color: var(--brand-color-accent, #d3b58f);
    font-family: var(--font-mono, ui-monospace, monospace);
    font-size: 12px;
    letter-spacing: 0.04em;
}

/* 积分弹窗 hero 的余额行 */
.bm-balance-line {
    margin-top: 12px;
    display: inline-flex;
    align-items: baseline;
    gap: 10px;
    color: var(--brand-color-text-muted, #8a8b87);
    font-size: 13px;
    letter-spacing: 0.04em;
}

.bm-balance-line .bm-balance-value {
    color: var(--brand-color-accent, #d3b58f);
    font-family: var(--font-mono, ui-monospace, monospace);
    font-size: 24px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

/* ---------- 主体画布 ---------- */
.bm-canvas {
    padding: 26px 56px 0;
}

.bm-section { margin-bottom: 24px; }

/* 区块标签：文字 + 延伸金色细线，克制而大气 */
.bm-section-label {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
}

.bm-section-label span {
    flex: none;
    color: var(--brand-color-text-secondary, #a4a4a2);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.18em;
}

.bm-section-label .bm-rule {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, rgba(211, 181, 143, 0.28) 0%, rgba(211, 181, 143, 0.05) 60%, rgba(255, 255, 255, 0.04) 100%);
}

/* ---------- 套餐卡片（保留 .plan-item 类名供 JS 渲染） ---------- */
#membership-modal .plan-row,
#credits-modal .plan-row {
    display: grid;
    gap: 14px;
}

#membership-modal .plan-row { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
#credits-modal .plan-row { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

#membership-modal .plan-item,
#credits-modal .plan-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 4px;
    min-height: 246px;
    padding: 22px 20px 18px;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.028) 0%, rgba(255, 255, 255, 0.008) 100%);
    cursor: pointer;
    text-align: left;
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

#membership-modal .plan-item:hover,
#credits-modal .plan-item:hover {
    border-color: rgba(211, 181, 143, 0.4);
    transform: translateY(-3px);
}

#membership-modal .plan-item.selected,
#credits-modal .plan-item.selected {
    border-color: rgba(211, 181, 143, 0.75);
    background:
        radial-gradient(130% 100% at 50% 0%, rgba(211, 181, 143, 0.13) 0%, rgba(211, 181, 143, 0.03) 60%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0.01) 100%);
    box-shadow:
        0 0 0 1px rgba(211, 181, 143, 0.55),
        0 12px 32px rgba(211, 181, 143, 0.14);
    transform: translateY(-3px);
}

/* 选中角标：右上金色圆点勾 */
#membership-modal .plan-item.selected::before,
#credits-modal .plan-item.selected::before {
    content: "";
    position: absolute;
    top: 12px;
    right: 12px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 1px solid rgba(211, 181, 143, 0.75);
    background: rgba(211, 181, 143, 0.16);
}

#membership-modal .plan-item.selected::after,
#credits-modal .plan-item.selected::after {
    content: "";
    position: absolute;
    top: 16.5px;
    right: 15.5px;
    width: 7px;
    height: 4px;
    border-left: 1.5px solid var(--brand-color-accent, #d3b58f);
    border-bottom: 1.5px solid var(--brand-color-accent, #d3b58f);
    transform: rotate(-48deg);
}

#membership-modal .plan-label,
#credits-modal .plan-label {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
    color: var(--brand-color-text-primary, #f7f7f5);
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.08em;
}

#credits-modal .plan-label svg { width: 14px; height: 14px; color: var(--brand-color-accent, #d3b58f); }

#membership-modal .plan-price,
#credits-modal .plan-price {
    margin-top: 8px;
    color: var(--brand-color-accent, #d3b58f);
    font-family: var(--font-mono, ui-monospace, monospace);
    font-size: 30px;
    font-weight: 600;
    letter-spacing: 0.01em;
    line-height: 1.15;
}

#membership-modal .plan-desc {
    margin-top: 3px;
    color: var(--brand-color-text-muted, #777875);
    font-family: var(--font-mono, ui-monospace, monospace);
    font-size: 11px;
    letter-spacing: 0.08em;
}

/* 套餐服务清单：每张方案卡直接说明该套餐包含什么 */
#membership-modal .plan-services,
#credits-modal .plan-services {
    display: flex;
    flex-direction: column;
    gap: 9px;
    margin: 17px 0 0;
    padding: 15px 0 0;
    border-top: 1px solid rgba(211, 181, 143, 0.14);
    list-style: none;
}

#membership-modal .plan-services li,
#credits-modal .plan-services li {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    color: var(--brand-color-text-body, #b6b6b2);
    font-size: 12.5px;
    line-height: 1.5;
    letter-spacing: 0.015em;
}

#membership-modal .plan-service-check,
#credits-modal .plan-service-check {
    position: relative;
    flex: none;
    width: 15px;
    height: 15px;
    margin-top: 2px;
    border: 1px solid rgba(211, 181, 143, 0.5);
    border-radius: 50%;
    background: rgba(211, 181, 143, 0.07);
}

#membership-modal .plan-service-check::after,
#credits-modal .plan-service-check::after {
    content: "";
    position: absolute;
    left: 3.5px;
    top: 3.5px;
    width: 6px;
    height: 3px;
    border-left: 1.5px solid var(--brand-color-accent, #d3b58f);
    border-bottom: 1.5px solid var(--brand-color-accent, #d3b58f);
    transform: rotate(-48deg);
}

/* ---------- 支付方式 ---------- */
.bm-pay-row,
#membership-modal .pay-row,
#credits-modal .pay-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

#membership-modal .pay-item,
#credits-modal .pay-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 13px 14px;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.02);
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
}

#membership-modal .pay-item:hover,
#credits-modal .pay-item:hover { border-color: rgba(211, 181, 143, 0.4); }

#membership-modal .pay-item.selected,
#credits-modal .pay-item.selected {
    border-color: rgba(211, 181, 143, 0.65);
    background: rgba(211, 181, 143, 0.07);
    box-shadow: 0 0 0 1px rgba(211, 181, 143, 0.4);
}

#membership-modal .pay-badge,
#credits-modal .pay-badge {
    flex: none;
    width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
}

#membership-modal .pay-badge.wechat,
#credits-modal .pay-badge.wechat { background: #22b358; }
#membership-modal .pay-badge.alipay,
#credits-modal .pay-badge.alipay { background: #1677ff; }

#membership-modal .pay-label,
#credits-modal .pay-label {
    color: var(--brand-color-text-primary, #f7f7f5);
    font-size: 13.5px;
    letter-spacing: 0.04em;
}

/* ---------- 行动区：大 CTA ---------- */
.bm-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 26px;
}

.bm-actions .bm-cta {
    flex: 1;
    height: 50px;
    border: none;
    border-radius: 14px;
    background: linear-gradient(135deg, #ecdfcb 0%, #d9bd97 55%, #c9a87c 100%);
    color: #191410;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.22em;
    cursor: pointer;
    box-shadow: 0 10px 28px rgba(211, 181, 143, 0.22);
    transition: filter 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.bm-actions .bm-cta:hover {
    filter: brightness(1.06);
    transform: translateY(-1px);
    box-shadow: 0 14px 34px rgba(211, 181, 143, 0.3);
}

.bm-actions .bm-cta:active { transform: translateY(0); }

.bm-actions .btn-code {
    flex: none;
    padding: 0 20px;
    height: 50px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 14px;
    background: transparent;
    color: var(--brand-color-text-secondary, #a4a4a2);
    font-size: 13px;
    letter-spacing: 0.06em;
    cursor: pointer;
    transition: color 0.15s ease, border-color 0.15s ease;
}

.bm-actions .btn-code:hover {
    color: var(--brand-color-accent, #d3b58f);
    border-color: rgba(211, 181, 143, 0.5);
}

.bm-switch {
    margin-top: 16px;
    color: var(--brand-color-text-muted, #777875);
    font-size: 12.5px;
    text-align: center;
    letter-spacing: 0.04em;
}

.bm-switch a,
#membership-modal .modal-switch a,
#credits-modal .modal-switch a {
    color: var(--brand-color-accent, #d3b58f);
    cursor: pointer;
}

.bm-switch a:hover { text-decoration: underline; }

/* ---------- 支付未开通态（payments-disabled，由 JS 加到弹窗上） ---------- */
#membership-modal.payments-disabled .bm-canvas,
#credits-modal.payments-disabled .bm-canvas { display: none !important; }

/* ---------- 关闭按钮在深色 hero 上的对比度 ---------- */
#membership-modal.billing-modal .bm-modal-close,
#credits-modal.billing-modal .bm-modal-close,
#redeem-code-modal.billing-modal .bm-modal-close,
#contact-admin-modal.billing-modal .bm-modal-close {
    position: absolute;
    top: 18px;
    right: 18px;
    z-index: 3;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 1px solid rgba(211, 181, 143, 0.22);
    border-radius: 50%;
    background: rgba(211, 181, 143, 0.06);
    color: var(--brand-color-accent, #d3b58f);
    cursor: pointer;
    transition: color .18s ease, background .18s ease, border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.bm-modal-close span,
.bm-modal-close span::after {
    display: block;
    width: 14px;
    height: 1px;
    background: currentColor;
    content: "";
}

.bm-modal-close span { transform: rotate(45deg); }
.bm-modal-close span::after { transform: rotate(90deg); }
.bm-modal-close:hover {
    border-color: rgba(211, 181, 143, 0.66);
    background: rgba(211, 181, 143, 0.16);
    color: var(--brand-color-text-primary, #f7f7f5);
    box-shadow: 0 0 0 3px rgba(211, 181, 143, 0.12), 0 0 22px rgba(211, 181, 143, 0.16);
    transform: translateY(-1px) scale(1.04);
}

.bm-modal-close:active {
    transform: translateY(0) scale(0.94);
}

/* 兑换码：贴着按钮展开的悬浮小面板 */
.bm-redeem-anchor { position: relative; display: inline-flex; }
.bm-redeem-popover {
    position: absolute;
    z-index: 20;
    right: 0;
    bottom: calc(100% + 12px);
    width: 270px;
    padding: 14px;
    border: 1px solid rgba(211, 181, 143, 0.34);
    border-radius: 14px;
    background: linear-gradient(180deg, #1a1714 0%, #100f0e 100%);
    box-shadow: 0 18px 44px rgba(0, 0, 0, .52), 0 0 22px rgba(211, 181, 143, .09);
}
.bm-redeem-popover::after {
    content: "";
    position: absolute;
    right: 28px;
    bottom: -7px;
    width: 12px;
    height: 12px;
    border-right: 1px solid rgba(211, 181, 143, .34);
    border-bottom: 1px solid rgba(211, 181, 143, .34);
    background: #100f0e;
    transform: rotate(45deg);
}
.bm-redeem-popover-head { display:flex; justify-content:space-between; align-items:center; margin-bottom:11px; color:var(--brand-color-text-primary,#f7f7f5); font-size:13px; font-weight:600; }
.bm-popover-close { border:0; background:none; color:var(--brand-color-text-muted,#8a8b87); font-size:20px; line-height:1; cursor:pointer; }
.bm-popover-close:hover { color:var(--brand-color-accent,#d3b58f); }
.bm-redeem-popover-body { display:flex; flex-direction:column; gap:9px; }
.bm-redeem-input { width:100%; box-sizing:border-box; height:36px; padding:0 11px; border:1px solid rgba(255,255,255,.12); border-radius:8px; background:rgba(255,255,255,.045); color:var(--brand-color-text-primary,#f7f7f5); outline:none; }
.bm-redeem-input:focus { border-color:rgba(211,181,143,.7); box-shadow:0 0 0 3px rgba(211,181,143,.1); }
.bm-redeem-submit { height:35px; border:1px solid rgba(211,181,143,.48); border-radius:8px; background:linear-gradient(135deg,#d9bd99,#b98f61); color:#17120e; font-size:12px; font-weight:600; cursor:pointer; }
.bm-redeem-submit:disabled { opacity:.55; cursor:wait; }
.bm-redeem-result { min-height:18px; font-size:12px; line-height:1.5; }
.bm-redeem-result.is-success { color:#b9d7b0; }
.bm-redeem-result.is-error { color:#e3a49a; }

/* ---------- 窄屏适配 ---------- */
@media (max-width: 720px) {
    .bm-hero { padding: 32px 24px 22px; }
    .bm-canvas { padding: 22px 24px 0; }
    .bm-hero-title { font-size: 24px; }
    #membership-modal .plan-row { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
    .bm-redeem-popover { right: auto; left: 50%; transform: translateX(-50%); }
    .bm-redeem-popover::after { right: auto; left: 50%; margin-left: -6px; }
}
