/* 会员购买弹窗 · 样式
原 toolbox.html 809-902 行，逐字搬移，未做任何改动。
   由 toolbox.html 抽出，供 toolbox.html 与 ai-chat.html（画布）共用。
   改这里两边同时生效；不要在任何一页里再复制一份，改成引用本文件。 */

/* z-index 必须是 6500 而不是原来的 95：
   画布页整块 #canvasOverlay 是 z-index:900，画布自己的弹窗在 1400~2600、
   顶层的 #noticeModal / #cvPromptExpandModal 在 6200。沿用 95 的话，
   弹窗在画布里能开、能渲染，但整个被画布盖住 —— 屏幕上完全看不见。 */
.mem-mask{position:fixed;inset:0;z-index:6500;display:none;align-items:center;justify-content:center;padding:24px 16px;
  background:rgba(16,22,36,.52);backdrop-filter:blur(3px);-webkit-backdrop-filter:blur(3px)}
.mem-mask.open{display:flex}
.mem-sheet{position:relative;width:min(1000px,100%);max-height:min(88vh,760px);display:flex;flex-direction:column;overflow:hidden;
  border-radius:18px;background:#fff;box-shadow:0 30px 80px rgba(16,22,36,.34)}
.mem-head{display:flex;align-items:center;gap:10px;flex:0 0 auto;padding:14px 18px;background:#23262d;color:#f2f4f8}
/* 2026-10-06 换真头像（用户："把这个画红色位置增加头像跟随主界面的头像一样"）：
   跟 portal-header.js 的 syncAccountButton 同一套 —— avatarUrl 图片优先，avatarEmoji 兜底。
   display:grid;place-items:center 和下面那条 img 规则是**补进来的**：这份文件原来只有
   尺寸和 overflow:hidden，display 和 img 规则一直靠 toolbox.html 内联的顶栏样式（850-853 行）
   凑齐，而画布页（ai-chat.html）不引那份内联样式 —— 缺这两条，图片会按原图尺寸被
   overflow:hidden 裁成"头像的一角"，不是整颗头像。
   ⚠ 头是深色 #23262d，头像底色不能抄 toolbox 的 #fff（白圆压在深底上会发飘），
      这里给深一档的 #2f333c + 品牌青，emoji 兜底跟 toolbox 深色主题的 --accent 同色。
   ⚠ 权重 2 class，压得过 toolbox 内联的 .acct-avatar 单 class，所以 toolbox 上也是这套底色。 */
.mem-head .acct-avatar{width:30px;height:30px;font-size:13px;overflow:hidden;
  display:grid;place-items:center;border-radius:50%;background:#2f333c;color:#5eead4}
.mem-head .acct-avatar img{width:100%;height:100%;object-fit:cover;display:block;border-radius:50%}
.mem-head b{font-size:14px}
.mem-head .mem-role{padding:2px 9px;border-radius:999px;background:rgba(255,255,255,.16);color:#dfe3ea;font-size:11px}
.mem-head .mem-x{margin-left:auto;width:28px;height:28px;display:grid;place-items:center;border:0;border-radius:8px;
  background:rgba(255,255,255,.12);color:#e6e9ef;font-size:14px;line-height:1;cursor:pointer}
.mem-head .mem-x:hover{background:rgba(255,255,255,.22)}
.mem-body{flex:1 1 auto;display:flex;min-height:0}
/* 左：页签 + 套餐；右：支付面板。两栏在 880px 以下折成上下，避免窄屏把价格挤没 */
.mem-main{flex:1 1 auto;min-width:0;display:flex;flex-direction:column;overflow:auto;padding:16px 18px 18px}
.mem-tabs{flex:0 0 auto;display:flex;gap:6px;margin-bottom:14px;padding:4px;border-radius:12px;background:#f4f6fa}
.mem-tab{flex:1 1 0;min-width:0;padding:9px 8px;border:0;border-radius:9px;background:transparent;color:#5d6779;
  font:600 13px/1.4 inherit;cursor:pointer;transition:background .15s,color .15s,box-shadow .15s}
.mem-tab:hover{color:#0e9c8f}
.mem-tab[aria-selected="true"]{background:#fff;color:#0e9c8f;box-shadow:0 2px 10px rgba(23,32,51,.1)}
.mem-tab small{display:block;margin-top:2px;font-weight:400;font-size:10.5px;color:#98a1b0}
.mem-tab[aria-selected="true"] small{color:#7d8bd6}
.mem-panel[hidden]{display:none}
.mem-sub{margin:0 0 4px;font-size:15px;font-weight:800;color:var(--text)}
.mem-desc{margin:0 0 14px;font-size:12px;color:var(--muted);line-height:1.7}
.mem-tiers{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
.mem-tier{position:relative;padding:14px 12px 12px;border:1.5px solid var(--line);border-radius:12px;background:#fff;
  text-align:center;cursor:pointer;transition:border-color .15s,box-shadow .15s,transform .15s}
.mem-tier:hover{border-color:#b9c4ea;transform:translateY(-2px);box-shadow:0 8px 20px rgba(23,32,51,.1)}
.mem-tier[aria-pressed="true"]{border-color:#0e9c8f;box-shadow:0 8px 22px rgba(14,156,143,.18)}
.mem-tier .mem-flag{position:absolute;left:-1px;top:-1px;padding:2px 8px;border-radius:11px 0 10px 0;
  background:var(--pink);color:#fff;font-size:10px;font-weight:700}
.mem-tier .mem-flag.gold{background:#e8a33c}
.mem-tier .mem-name{font-size:12.5px;font-weight:700;color:#4b5567}
.mem-tier .mem-price{margin:5px 0 1px;font-size:23px;font-weight:800;color:var(--text);font-variant-numeric:tabular-nums}
.mem-tier .mem-price i{font-size:14px;font-style:normal;font-weight:700}
.mem-tier .mem-get{margin-top:8px;display:inline-block;padding:3px 9px;border-radius:999px;background:#fff4e4;color:#b8791b;font-size:11px;font-weight:700}
.mem-tier .mem-foot{margin-top:7px;font-size:10.5px;color:#98a1b0}
/* 存储礼包那行（用户 2026-09-28）：季卡/年卡/三年卡各送 1/2/3 年存储，单独一行显示 */
.mem-tier .mem-store{margin-top:5px;font-size:10.5px;color:#0a8e91;font-weight:600}
.mem-note{display:flex;gap:6px;margin-top:13px;font-size:11px;color:#96a0af;line-height:1.6}
.mem-note::before{content:"⚠";color:#e8a33c;flex:0 0 auto}
.mem-perks{margin-top:16px;padding:14px 16px;border-radius:12px;background:#f7f9fd;border:1px solid #e8edf7}
.mem-perks h4{margin:0 0 10px;font-size:13px;color:var(--text)}
.mem-perks ul{margin:0;padding:0;list-style:none;display:grid;gap:7px}
.mem-perks li{display:flex;gap:7px;font-size:12px;color:#5b6475;line-height:1.6}
.mem-perks li::before{content:"✓";color:var(--cyan);font-weight:800;flex:0 0 auto}
/* 上面那条 .mem-perks li{display:flex} 的权重比浏览器默认的 [hidden]{display:none} 高，
   不补这一条的话 li[hidden] 藏不住 —— 季卡不送存储时会只剩一个孤零零的「✓」。 */
.mem-perks li[hidden]{display:none}
/* 用户 2026-10-03 指定的存储礼包那行：标红加粗，文字跟选中档位联动 */
.mem-perks li.mem-perk-red{color:#d64545;font-weight:700}
/* 卡密兑换（算力加油包页签用，和聊天页一个接口） */
.mem-redeem{display:flex;gap:8px;margin-top:4px}
.mem-redeem input{flex:1 1 auto;min-width:0;height:36px;padding:0 11px;border:1px solid var(--line);border-radius:9px;
  background:#fff;font:13px inherit;color:var(--text)}
.mem-redeem input:focus{outline:0;border-color:#0e9c8f}
.mem-redeem button{flex:0 0 auto;height:36px;padding:0 18px;border:0;border-radius:9px;background:#0e9c8f;color:#fff;
  font:600 13px inherit;cursor:pointer}
.mem-redeem button:hover{background:#0a7d72}
.mem-redeem button:disabled{opacity:.6;cursor:wait}
/* 右：支付面板 */
.mem-pay{flex:0 0 296px;display:flex;flex-direction:column;padding:16px;border-left:1px solid var(--line);background:#fbfcfe}
.mem-pay h4{margin:0 0 10px;font-size:13px;color:var(--text)}
.mem-amount{text-align:center;padding:10px 0 12px}
.mem-amount span{display:block;font-size:11px;color:var(--muted)}
.mem-amount b{display:block;margin-top:2px;font-size:32px;font-weight:800;color:#e8681f;font-variant-numeric:tabular-nums;line-height:1.2}
.mem-amount em{display:block;margin-top:3px;font-size:11px;color:#d64545;font-style:normal}
/* 上面第 75 行的 .mem-amount span{display:block} 是给「支付金额」那个标题用的，
   权重 (0,2,0) 会把下面这两个 span 也变成块级、各自独占一行（实测到账行被拆成 5 行）。
   这里必须用两级选择器压过去，让它们回到行内。 */
.mem-amount .mem-detail,.mem-amount .mem-gift{display:inline}
/* 到账行里只有「赠送 N积分」这一段标红，整行其余部分保持灰色 */
.mem-getline .mem-gift{color:#d64545;font-weight:700}
/* 括号整段不拆行，否则行尾的「）」会被红段挤到下一行 */
.mem-getline .mem-detail{white-space:nowrap}
/* 到账行只有存储那一处允许换行（<br> 是代码里写死的），
   上面「到账共 …（套餐内 … + 赠送 …积分）」整行不换行 ——
   宽度实测 239px、可用 264px，本该放得下，但中文行内断行规则会把它拆开。 */
.mem-amount .mem-getline{margin-top:7px;font-size:11.5px;color:var(--muted);white-space:nowrap}
.mem-ways{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-bottom:12px}
.mem-way{display:flex;align-items:center;justify-content:center;gap:6px;height:36px;border:1.5px solid var(--line);
  border-radius:9px;background:#fff;color:#5b6475;font:600 12px inherit;cursor:pointer}
.mem-way:hover{border-color:#b9c4ea}
.mem-way[aria-pressed="true"]{border-color:#12b76a;color:#12b76a;background:#f0fdf6}
.mem-way.alipay[aria-pressed="true"]{border-color:#1677ff;color:#1677ff;background:#f2f7ff}
.mem-qr{margin-bottom:12px;border:1px solid var(--line);border-radius:12px;background:#fff;padding:10px;text-align:center}
.mem-qr img{display:block;width:100%;max-width:200px;margin:0 auto;aspect-ratio:1/1;object-fit:contain}
.mem-qr-empty{display:grid;place-items:center;height:200px;color:#a3abb8;font-size:12px;line-height:1.8;text-align:center;padding:0 12px}
.mem-tip{margin:0 0 12px;font-size:11px;color:#8d96a5;line-height:1.7}
.mem-agree{display:flex;gap:7px;margin-bottom:12px;font-size:11px;color:#8d96a5;line-height:1.6;cursor:pointer}
.mem-agree input{width:14px;height:14px;flex:0 0 auto;margin:1px 0 0;accent-color:#0e9c8f}
.mem-go{width:100%;height:42px;border:0;border-radius:10px;background:#12b76a;color:#fff;font:700 14px inherit;cursor:pointer}
.mem-go:hover{background:#0e9c5c}
.mem-go:disabled{opacity:.55;cursor:wait}
.mem-msg{margin-top:10px;font-size:11.5px;line-height:1.7;color:#8d96a5}
.mem-msg.err{color:#d64545}
.mem-msg.ok{color:#12a05a}
.mem-cancel{margin-top:8px;width:100%;height:32px;border:1px solid var(--line);border-radius:9px;background:#fff;
  color:#5b6475;font:600 12px inherit;cursor:pointer}
.mem-cancel:hover{background:#f4f6fa}
@media(max-width:880px){
  /* 竖排时改成"整个 body 一起滚"：上面那种两栏各自滚的写法在这里会把套餐区挤成一条缝，
     用户进来只看得见支付面板，得先往上翻半天才选得到套餐 */
  .mem-body{display:block;overflow:auto}
  .mem-main{overflow:visible}
  .mem-pay{border-left:0;border-top:1px solid var(--line)}
  .mem-tiers{grid-template-columns:repeat(2,minmax(0,1fr))}
  .mem-qr img,.mem-qr-empty{max-width:180px;height:180px}
}
