[hidden] {
  display:none!important
}
.billing-membership {
  padding:16px;
  border-radius:2px;
  background:var(--sand-light);
  color:var(--ink)
}
.billing-channel {
  display:flex;
  gap:28px;
  border:1px solid var(--sand-light);
  border-radius:2px;
  margin:24px 0;
  padding:18px
}
.billing-channel input {
  accent-color:var(--ink)
}
.billing-checkout {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:30px;
  border:1px solid var(--sand-light);
  border-radius:2px;
  padding:28px;
  margin:24px 0
}
.billing-amount {
  font-family:var(--serif);
  display:block;
  font-size:38px;
  color:var(--ink)
}
.billing-qr {
  background:var(--paper);
  padding:16px;
  width:max-content;
  max-width:100%;
  border-radius:2px
}
.billing-qr canvas,.billing-qr img {
  display:block;
  max-width:240px;
  width:100%;
  height:auto
}
.billing-order-no {
  overflow-wrap:anywhere;
  font-family:monospace
}
.portal-grid article {
  padding:24px;
  border:1px solid var(--sand-light);
  border-radius:2px
}
.portal-grid article strong {
  font-family:var(--serif);
  display:block;
  font-size:30px;
  margin:16px 0
}
.billing-order {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  padding:16px 0;
  border-bottom:1px solid var(--sand-light)
}
.billing-order small {
  display:block;
  overflow-wrap:anywhere
}
.billing-order button {
  flex-shrink:0
}
@media(max-width:680px) {
  .billing-checkout {
    grid-template-columns:1fr;
    padding:18px
  }
  .billing-channel {
    gap:18px
  }
  .billing-order {
    align-items:flex-start;
    flex-direction:column
  }
}
#plans {
  grid-template-columns:repeat(2,minmax(0,1fr))
}
#orderList {
  text-align:left
}
.billing-order small {
  margin-top:6px
}
.portal-back {
  display:inline-block;
  margin-bottom:18px;
  margin-right:12px
}
@media(max-width:680px) {
  #plans {
    grid-template-columns:1fr
  }
}
/* Keep prices and purchase actions aligned despite wrapping descriptions. */
#plans > article { display:flex; flex-direction:column; }
#plans > article > strong { margin-top:auto; padding-top:16px; }
#plans > article > :last-child { min-height:48px; display:flex; align-items:center; }
#plans > article > button:last-child { justify-content:center; width:100%; }

/* Equal footer geometry for paid, unavailable and free cards. */
#plans > article > :last-child { margin: 0; flex-shrink: 0; }
#plans > article > strong { flex-shrink: 0; }


/* Payment diagnostics must wrap instead of expanding the mobile checkout grid. */
.billing-body .billing-workbench > *, .billing-body .billing-checkout > * { min-width:0; }
.billing-body .billing-qr { width:fit-content; max-width:100%; box-sizing:border-box; overflow-wrap:anywhere; }

/* Keep the plan chosen on the marketing page visible after login. */
.billing-requested-plan { margin:14px 0 0; padding:10px 12px; border:1px solid var(--brand); background:var(--sand-light); font-size:var(--text-secondary); color:var(--ink); }
#plans > article.is-requested { border-color:var(--brand); box-shadow:4px 4px 0 var(--sand); }
#plans > article.is-requested > h2::after { content:' · 已选择'; color:var(--brand-deep); font:600 12px/1.4 var(--body); }

/* Gate state shares the secondary-page footer so billing is no longer a dead end. */
.billing-body .secondary-footer { display:flex; justify-content:space-between; flex-wrap:wrap; gap:18px; width:min(1120px,calc(100% - 48px)); margin:0 auto 40px; padding:24px 0 0; border-top:1px solid var(--line); font-size:var(--text-copyright); color:var(--muted); }
.billing-body .secondary-footer nav { display:flex; flex-wrap:wrap; gap:20px; }
