/* ═══ 「增加时长」购买弹窗 — 网页端 C 端扫码收款 ═══
   视觉基准完全对齐 components/account-modal.css：浅灰页底 #f2f2f7、白卡、22px 圆角、
   苹果系字体、主色红 #e0342b。z-index 必须高于账号弹窗(100001)，因为它从账号弹窗里被唤起。 */

.buym-overlay {
  display: none;
  position: fixed; inset: 0; z-index: 100002;
  background: rgba(10,10,20,.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  align-items: center; justify-content: center;
  padding: 16px; box-sizing: border-box;
}
.buym-overlay.open { display: flex; }

.buym-box {
  position: relative;
  background: #f2f2f7;
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 22px;
  overflow: hidden;
  width: 100%; max-width: 660px;
  max-height: 90vh;
  display: flex; flex-direction: column;
  box-shadow: 0 1px 2px rgba(0,0,0,0.02), 0 12px 40px rgba(0,0,0,0.1), 0 32px 80px rgba(0,0,0,0.08);
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'PingFang SC', 'Helvetica Neue', 'Microsoft YaHei', sans-serif;
  user-select: none; cursor: default;
}

.buym-close {
  position: absolute; top: 14px; right: 14px; z-index: 20;
  width: 32px; height: 32px; padding: 0; margin: 0;
  border: 1px solid rgba(0,0,0,0.18); border-radius: 50%;
  background: #fff; color: #1a1a1a;
  font-size: 20px; font-weight: 600; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  cursor: pointer; transition: opacity .2s;
}
.buym-close:hover { opacity: .6; }

.buym-head { padding: 20px 24px 6px; }
.buym-title { font-size: 18px; font-weight: 800; color: #1c1c1e; letter-spacing: .01em; }
.buym-sub { margin-top: 5px; font-size: 12.5px; color: #8e8e93; line-height: 1.6; }

/* 提示行：未开通支付 / 下单失败 / 二维码过期都走这里，空的时候不占位 */
.buym-notice {
  margin: 10px 24px 0; padding: 9px 12px;
  background: #fff4f3; border: 1px solid rgba(224,52,43,.22); border-radius: 10px;
  font-size: 12.5px; color: #b3190f; line-height: 1.6;
}
.buym-notice:empty { display: none; }

.buym-view { padding: 16px 24px 4px; overflow-y: auto; scrollbar-width: none; }
.buym-view::-webkit-scrollbar { display: none; }
.buym-view[hidden] { display: none; }

/* ═══ 档位网格 ═══ */
.buym-plans {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(104px, 1fr));
  gap: 10px;
}
.buym-plan {
  position: relative;
  background: #fff; border: 2px solid transparent; border-radius: 14px;
  padding: 14px 8px 12px; text-align: center;
  box-shadow: 0 1px 6px rgba(0,0,0,0.04);
  cursor: pointer; transition: border-color .16s, transform .16s, box-shadow .16s;
  box-sizing: border-box;
}
.buym-plan:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0,0,0,0.09); }
.buym-plan.is-sel { border-color: #e0342b; background: #fff6f5; }
.buym-plan.is-off { opacity: .5; cursor: not-allowed; }
.buym-plan.is-off:hover { transform: none; box-shadow: 0 1px 6px rgba(0,0,0,0.04); }
.buym-plan__name { font-size: 13px; font-weight: 700; color: #1c1c1e; }
.buym-plan__price { margin-top: 6px; font-size: 22px; font-weight: 800; color: #e0342b; line-height: 1; }
.buym-plan__price small { font-size: 12px; font-weight: 700; margin-right: 1px; }
.buym-plan__per { margin-top: 6px; font-size: 11px; color: #8e8e93; }
/* 「超值」角标：由 js 按折合月价算出来，不写死档位 */
.buym-plan__tag {
  position: absolute; top: -8px; left: 50%; transform: translateX(-50%);
  background: linear-gradient(135deg, #e0342b, #b3190f); color: #fff;
  font-size: 10px; font-weight: 700; letter-spacing: .04em;
  padding: 2px 8px; border-radius: 999px; white-space: nowrap;
  box-shadow: 0 2px 6px rgba(224,52,43,.35);
}

/* ═══ 扫码视图 ═══ */
.buym-qrwrap {
  background: #fff; border-radius: 16px; padding: 18px 16px 16px;
  text-align: center; box-shadow: 0 1px 6px rgba(0,0,0,0.04);
}
.buym-qrplan { font-size: 13px; font-weight: 700; color: #1c1c1e; }
.buym-qramount { margin-top: 4px; font-size: 30px; font-weight: 800; color: #e0342b; line-height: 1.1; }
.buym-qrbox {
  margin: 12px auto 0; width: 200px; height: 200px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid rgba(0,0,0,.08); border-radius: 12px; background: #fff;
  overflow: hidden;
}
.buym-qrbox img, .buym-qrbox canvas { display: block; }
.buym-qrbox.is-blurred img, .buym-qrbox.is-blurred canvas {
  filter: blur(18px); opacity: .35; transition: filter .4s, opacity .4s;
}
.buym-qrstatus { margin-top: 12px; font-size: 13.5px; font-weight: 600; color: #1c1c1e; line-height: 1.6; }
.buym-qrstatus.ok { color: #0a8f3c; }
.buym-qrstatus.bad { color: #b3190f; }
.buym-qrorder { margin-top: 4px; font-size: 11px; color: #aeaeb2; word-break: break-all; }
/* 支付完成后「已完成支付」按钮：默认隐藏，到账后显示 */
.buym-done {
  display: none; margin: 12px auto 0; padding: 9px 32px;
  border: none; border-radius: 999px; cursor: pointer;
  font-size: 13px; font-weight: 700; color: #fff; font-family: inherit;
  background: linear-gradient(135deg, #e0342b, #b3190f);
  box-shadow: 0 3px 12px rgba(224,52,43,.35);
  transition: transform .15s, box-shadow .15s;
}
.buym-done.show { display: inline-block; }
.buym-done:hover { transform: translateY(-1px); box-shadow: 0 5px 18px rgba(224,52,43,.5); }
.buym-qrtip { margin-top: 10px; font-size: 12px; color: #8e8e93; line-height: 1.6; }
.buym-back {
  margin-top: 12px; padding: 7px 18px;
  background: #fff; color: #1c1c1e; border: 1px solid rgba(0,0,0,.18); border-radius: 999px;
  font-size: 12.5px; font-weight: 600; font-family: inherit; cursor: pointer;
  transition: background .18s;
}
.buym-back:hover { background: #f2f2f7; }

/* 转圈：纯 CSS，不用 gif */
.buym-spin {
  display: inline-block; width: 12px; height: 12px; margin-right: 6px;
  border: 2px solid rgba(224,52,43,.25); border-top-color: #e0342b; border-radius: 50%;
  vertical-align: -1px; animation: buymSpin .8s linear infinite;
}
@keyframes buymSpin { to { transform: rotate(360deg); } }

/* 底部：当前账号 + 有效期，让客户确认加在谁身上 */
.buym-foot {
  padding: 12px 24px 18px; font-size: 12px; color: #8e8e93; line-height: 1.7; text-align: center;
}
.buym-foot:empty { display: none; }
.buym-foot b { color: #1c1c1e; font-weight: 700; }

/* 窄屏：档位网格收成两列，弹窗贴边 */
@media (max-width: 520px) {
  .buym-plans { grid-template-columns: repeat(2, 1fr); }
  .buym-head, .buym-view, .buym-foot { padding-left: 16px; padding-right: 16px; }
  .buym-notice { margin-left: 16px; margin-right: 16px; }
}

/* ═══ /buy 页的内联档位网格：复用同一套 .buym-plan 卡片，只放大间距 ═══ */
.buypage-plans {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
}
.buypage-plans .buym-plan { padding: 22px 10px 18px; border-radius: 16px; }
.buypage-plans .buym-plan__price { font-size: 30px; }
.buypage-plans .buym-plan__name { font-size: 14px; }
.buypage-plans .buym-plan__per { font-size: 12px; }
