/* ==========================================================================
   抖音星光充值 —— 页面样式（原创实现）
   设计基准：桌面端 720px 卡片，主色 #161823，页面底色 #f3f5fa，强调色 #fe2c55
   ========================================================================== */

:root {
  --ink: #161823;
  --ink-60: rgba(22, 24, 35, .6);
  --ink-50: rgba(22, 24, 35, .5);
  --ink-34: rgba(22, 24, 35, .34);
  --ink-12: rgba(22, 24, 35, .12);
  --ink-08: rgba(22, 24, 35, .08);
  --ink-05: rgba(22, 24, 35, .05);
  --ink-03: rgba(22, 24, 35, .03);
  --bg: #f3f5fa;
  --card: #fff;
  --brand: #fe2c55;
  --link: #04498d;
  --mint: #2ee59d;
  --mint-deep: #12b47f;
  --radius-card: 24px;
  --shadow-card: 0 12px 32px rgba(22, 24, 35, .04);
  --font: "PingFang SC", "HarmonyOS Sans SC", -apple-system, BlinkMacSystemFont, "Microsoft YaHei", "Helvetica Neue", sans-serif;
  --font-num: "DIN Alternate", "SF Pro Display", "Helvetica Neue", var(--font);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

button { font-family: inherit; }

/* 移动端手感：去掉点击蓝块、避免双击缩放 */
button,
a { -webkit-tap-highlight-color: transparent; }

button { touch-action: manipulation; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- 页面容器与背景光晕 ---------- */

.page {
  position: relative;
  min-height: 100dvh;
  min-width: 320px;
  display: flex;
  flex-direction: column;
}

.page__aurora {
  position: absolute;
  inset: 0 0 auto;
  height: 760px;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(760px 420px at 22% -8%, rgba(46, 229, 157, .22), transparent 68%),
    radial-gradient(680px 380px at 82% -12%, rgba(77, 190, 255, .18), transparent 70%),
    radial-gradient(520px 320px at 50% 4%, rgba(254, 44, 85, .08), transparent 72%),
    linear-gradient(180deg, #eef6ff 0%, #f3f5fa 62%, #f3f5fa 100%);
  -webkit-mask-image: linear-gradient(180deg, #000 55%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 55%, transparent 100%);
}

/* ---------- 顶部栏 ---------- */

.header {
  position: relative;
  z-index: 2;
  height: 112px;
  padding: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand__logo {
  width: 44px;
  height: 44px;
  flex: none;
  display: grid;
  place-items: center;
}

.brand__logo img {
  width: 44px;
  height: 44px;
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 6px 14px rgba(64, 122, 240, .28));
}

.brand__name {
  font-size: 24px;
  font-weight: 700;
  line-height: 29px;
  letter-spacing: .2px;
  white-space: nowrap;
}

.header__actions {
  display: flex;
  align-items: center;
  gap: 24px;
}

.account { position: relative; }

.avatar-btn {
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--ink-08);
  border-radius: 50%;
  background: rgba(255, 255, 255, .88);
  color: var(--ink-60);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: box-shadow .18s ease, transform .18s ease;
}

.avatar-btn__icon { width: 38px; height: 38px; display: block; }

.avatar-btn--logged {
  background: linear-gradient(140deg, #2af2ae, #0b9e6e);
  border-color: transparent;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .5px;
}

.avatar-btn:hover { box-shadow: 0 4px 14px rgba(22, 24, 35, .1); }

.avatar-btn:focus-visible,
.account-menu__btn:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.avatar-btn[aria-expanded="true"] { box-shadow: 0 0 0 2px var(--ink-12); }

.account-menu {
  position: absolute;
  top: 48px;
  right: 0;
  width: 220px;
  padding: 16px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 28px rgba(22, 24, 35, .12);
  z-index: 20;
  animation: pop .16s ease-out;
}

@keyframes pop {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: none; }
}

.account-menu__name {
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.account-menu__id {
  margin-top: 4px;
  font-size: 12px;
  color: var(--ink-50);
}

.account-menu__btn {
  width: 100%;
  height: 36px;
  margin-top: 14px;
  border: 0;
  border-radius: 6px;
  background: var(--ink-05);
  color: var(--ink);
  font-size: 13px;
  cursor: pointer;
}

.account-menu__btn:hover { background: rgba(22, 24, 35, .09); }

/* ---------- 主卡片 ---------- */

.main {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 24px 136px;
}

.card {
  width: 720px;
  max-width: 100%;
  min-height: 612px;
  padding: 24px;
  background: var(--card);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
}

/* 用户信息条 */
.userbar {
  width: 100%;
  height: 64px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: .5px solid var(--ink-12);
  border-radius: 8px;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: background .16s ease, border-color .16s ease;
}

.userbar:hover { background: rgba(22, 24, 35, .02); border-color: rgba(22, 24, 35, .2); }

.userbar:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

.userbar__info {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.userbar__avatar {
  width: 40px;
  height: 40px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: transparent;
  overflow: hidden;
}

.userbar__avatar img,
.userbar__avatar-ico { width: 40px; height: 40px; display: block; object-fit: contain; }

.userbar__avatar--logged {
  background: linear-gradient(140deg, #2af2ae, #0b9e6e);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .5px;
}

.userbar__avatar--logged svg,
.userbar__avatar--logged img { display: none; }

.userbar__copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.userbar__copy strong {
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.userbar__copy span {
  font-size: 12px;
  line-height: 17px;
  color: var(--ink-34);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.userbar__action {
  flex: none;
  height: 24px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  border-radius: 4px;
  background: var(--ink);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
}

.userbar__action--ghost {
  background: var(--ink-05);
  color: var(--ink-60);
}

/* 余额 */
.balance {
  position: relative;
  height: 125px;
  padding-top: 33px;
}

.balance__label {
  display: block;
  font-size: 15px;
  font-weight: 500;
  line-height: 21px;
  color: var(--ink);
}

.balance__value {
  display: block;
  margin-top: 1px;
  font-family: var(--font-num);
  font-size: 42px;
  font-weight: 800;
  line-height: 48px;
  letter-spacing: -1.5px;
  font-variant-numeric: tabular-nums;
}

.balance__art {
  position: absolute;
  top: 24px;
  right: 8px;
  width: 98px;
  height: 98px;
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 18px 18px rgba(64, 150, 240, .24));
  animation: float 4.6s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-6px) rotate(2deg); }
}

/* 套餐标题 */
.packages-heading {
  height: 24px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.packages-heading strong {
  font-size: 17px;
  font-weight: 500;
  line-height: 24px;
}

.packages-heading span {
  font-size: 13px;
  line-height: 18px;
  color: var(--ink-34);
}

/* 套餐网格 */
.packages {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.package {
  position: relative;
  height: 93px;
  padding: 24px 16px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  border: .5px solid var(--ink-12);
  border-radius: 12px;
  background: var(--ink-03);
  color: var(--ink);
  cursor: pointer;
  transition: border-color .16s ease, background .16s ease, transform .16s ease;
}

.package:hover { border-color: rgba(22, 24, 35, .3); }

.package:active { transform: scale(.985); }

.package:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

/* 选中态只改颜色与内阴影描边，不改 padding / 边框宽度，避免格子内容跳动 */
.package--selected {
  border-color: transparent;
  box-shadow: inset 0 0 0 2px var(--ink);
  background: rgba(22, 24, 35, .04);
}

.package__tag {
  position: absolute;
  top: -.5px;
  left: -.5px;
  min-width: 40px;
  height: 24px;
  padding: 0 8px;
  border-radius: 12px 0 12px 0;
  background: var(--ink);
  color: #fff;
  font-size: 12px;
  line-height: 24px;
  text-align: center;
}

.package__amount {
  display: flex;
  align-items: center;
  gap: 2px;
}

.package__amount svg,
.package__amount img { width: 16px; height: 16px; flex: none; object-fit: contain; }

.package__amount strong {
  font-family: var(--font-num);
  font-size: 24px;
  font-weight: 700;
  line-height: 29px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.package__price {
  margin-top: 2px;
  font-size: 13px;
  line-height: 18px;
  color: var(--ink-34);
}

/* 自定义金额入口 */
.package--custom { border-style: dashed; }

.package--custom .package__amount {
  gap: 6px;
  color: var(--ink-60);
}

.package--custom strong {
  font-size: 16px;
  font-weight: 500;
  line-height: 22px;
  font-family: var(--font);
}

/* 提交按钮 */
.submit {
  width: 100%;
  height: 56px;
  margin-top: 32px;
  border: 0;
  border-radius: 32px;
  background: var(--ink);
  color: #fff;
  font-size: 17px;
  font-weight: 500;
  cursor: pointer;
  transition: transform .16s ease, opacity .16s ease, box-shadow .16s ease;
}

.submit:hover { box-shadow: 0 10px 24px rgba(22, 24, 35, .18); }

.submit:active { transform: scale(.995); }

.submit:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

.submit[disabled] { cursor: wait; opacity: .65; }

/* 协议 */
.agreement {
  height: 17px;
  margin-top: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 12px;
  line-height: 17px;
  flex-wrap: wrap;
}

.agreement span { color: var(--ink-34); }

.agreement a {
  color: var(--link);
  text-decoration: none;
}

.agreement a:hover { text-decoration: underline; }

.checkbox {
  width: 14px;
  height: 14px;
  margin: 0 3px 0 0;
  padding: 0;
  flex: none;
  display: grid;
  place-items: center;
  border: 1px solid rgba(22, 24, 35, .28);
  border-radius: 50%;
  background: #fff;
  color: transparent;
  cursor: pointer;
  transition: background .14s ease, border-color .14s ease, color .14s ease;
}

.checkbox svg { width: 10px; height: 10px; }

.checkbox--checked {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.checkbox:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* ---------- 弹窗通用 ---------- */

.modal {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.modal[hidden] { display: none; }

.modal__mask {
  position: absolute;
  inset: 0;
  background: rgba(22, 24, 35, .45);
  backdrop-filter: blur(2px);
  animation: fade .18s ease-out;
}

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.modal__dialog {
  position: relative;
  z-index: 1;
  width: 100%;
  max-height: calc(100dvh - 48px);
  overflow-y: auto;
  padding: 28px;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(22, 24, 35, .18);
  animation: pop .18s ease-out;
}

.dialog-custom { max-width: 520px; }
.dialog-login { max-width: 400px; }
.dialog-success { max-width: 360px; text-align: center; }
.dialog-doc { max-width: 560px; }

.dialog-custom__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.dialog-custom__header strong { font-size: 22px; font-weight: 600; }

.dialog-custom__close {
  width: 32px;
  height: 32px;
  flex: none;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--ink-05);
  color: rgba(22, 24, 35, .65);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.dialog-custom__close:hover { background: rgba(22, 24, 35, .1); }

.dialog-custom__close:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

.dialog-custom__hint {
  margin: 10px 0 0;
  font-size: 13px;
  line-height: 18px;
  color: var(--ink-34);
}

.dialog-custom__input {
  height: 64px;
  margin-top: 20px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--ink-12);
  border-radius: 10px;
  background: var(--ink-03);
  transition: border-color .16s ease, box-shadow .16s ease;
}

.dialog-custom__input:focus-within {
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(22, 24, 35, .07);
}

.dialog-custom__input--error { border-color: var(--brand); }

.dialog-custom__input input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-family: var(--font-num);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -.5px;
  outline: none;
}

.dialog-custom__input input::placeholder {
  color: rgba(22, 24, 35, .22);
  font-family: var(--font);
  font-size: 16px;
  font-weight: 400;
  letter-spacing: 0;
}

.dialog-custom__unit { font-size: 15px; color: var(--ink-50); }

.dialog-custom__error {
  min-height: 18px;
  margin-top: 6px;
  font-size: 12px;
  line-height: 18px;
  color: var(--brand);
}

.dialog-custom__presets {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 6px;
}

.dialog-custom__presets button {
  height: 38px;
  border: 1px solid var(--ink-12);
  border-radius: 6px;
  background: var(--ink-03);
  color: var(--ink);
  font-size: 14px;
  cursor: pointer;
  transition: border-color .14s ease, background .14s ease;
}

.dialog-custom__presets button:hover { border-color: rgba(22, 24, 35, .32); }

.dialog-custom__presets button.is-active {
  border-color: var(--ink);
  background: rgba(22, 24, 35, .06);
  font-weight: 600;
}

.dialog-custom__result {
  margin: 16px 0 0;
  font-size: 13px;
  color: var(--ink-50);
}

.dialog-custom__result b {
  font-family: var(--font-num);
  font-size: 15px;
  color: var(--ink);
}

.dialog-custom__confirm {
  width: 100%;
  height: 48px;
  margin-top: 20px;
  border: 0;
  border-radius: 24px;
  background: var(--ink);
  color: #fff;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
}

.dialog-custom__confirm:hover { box-shadow: 0 8px 20px rgba(22, 24, 35, .2); }

.dialog-custom__confirm:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

/* 登录表单 */
.field { display: block; margin-top: 18px; }

.field__label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  color: var(--ink-50);
}

.field input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1px solid var(--ink-12);
  border-radius: 10px;
  background: var(--ink-03);
  color: var(--ink);
  font-size: 15px;
  outline: none;
  transition: border-color .16s ease, box-shadow .16s ease;
}

.field input:focus {
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(22, 24, 35, .07);
}

.field__row { display: flex; gap: 8px; }

/* 抖音号头像预览 */
.avatar-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid var(--ink-08);
  border-radius: 10px;
  background: var(--ink-03);
}

.avatar-preview__circle {
  width: 36px;
  height: 36px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #e9e9ec;
  color: var(--ink-34);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .5px;
  overflow: hidden;
  transition: background .2s ease, color .2s ease;
}

.avatar-preview__text {
  flex: 1;
  min-width: 0;
  font-size: 12px;
  line-height: 17px;
  color: var(--ink-34);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.field__send {
  flex: none;
  height: 48px;
  padding: 0 14px;
  border: 1px solid var(--ink-12);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}

.field__send:disabled { color: var(--ink-34); cursor: not-allowed; }

.dialog-login__tip {
  margin: 14px 0 0;
  font-size: 12px;
  line-height: 17px;
  color: var(--ink-34);
  text-align: center;
}

/* 成功弹窗 */
.success__icon {
  width: 64px;
  height: 64px;
  margin: 4px auto 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(180deg, #35d17f, #16b25f);
  box-shadow: 0 8px 18px rgba(22, 178, 95, .24);
}

.success__icon svg { width: 30px; height: 30px; }

.success__title {
  display: block;
  margin-top: 16px;
  font-size: 19px;
  font-weight: 600;
}

.success__desc {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--ink-50);
}

.success__rows {
  margin: 20px 0 0;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--ink-03);
  display: grid;
  gap: 10px;
}

.success__rows div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
}

.success__rows dt { color: var(--ink-50); }

.success__rows dd {
  margin: 0;
  font-family: var(--font-num);
  font-weight: 700;
  font-size: 14px;
}

/* 协议正文 */
.dialog-doc__body {
  margin: 16px 0 0;
  max-height: 52dvh;
  overflow-y: auto;
  font-size: 13px;
  line-height: 22px;
  color: var(--ink-60);
  white-space: pre-wrap;
}

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 88px;
  z-index: 9500;
  padding: 11px 20px;
  border-radius: 10px;
  background: rgba(22, 24, 35, .88);
  color: #fff;
  font-size: 13px;
  line-height: 18px;
  transform: translate(-50%, 12px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s ease, transform .22s ease;
  max-width: min(90vw, 420px);
  text-align: center;
}

.toast--show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 响应式 ---------- */

/* ---------- 平板：卡片收窄 ---------- */

@media (max-width: 820px) {
  .header { height: 88px; padding: 20px; }
  .brand__logo, .brand__logo img { width: 40px; height: 40px; }
  .brand__name { font-size: 20px; }

  .main { padding: 8px 16px 120px; align-items: flex-start; }

  .card {
    padding: 20px;
    border-radius: 20px;
    min-height: auto;
  }

  .balance { height: 108px; padding-top: 24px; }
  .balance__value { font-size: 36px; line-height: 42px; }
  .balance__art { width: 76px; height: 76px; top: 20px; right: 0; }

  .packages-heading { height: auto; align-items: center; flex-wrap: wrap; gap: 4px 8px; }
  .packages-heading strong { font-size: 16px; }
  .packages-heading span { font-size: 12px; }

  .package { height: 88px; padding: 20px 8px 16px; }
  .package__amount strong { font-size: 22px; }
  .package--custom strong { font-size: 14px; }
}

/* ---------- 手机：整页重排（全宽内容 + 底部固定充值栏） ---------- */

@media (max-width: 768px) {
  .page { min-height: 100dvh; }
  .page__aurora { height: 460px; }

  .header {
    height: 56px;
    padding: 0 16px;
  }

  .brand { gap: 8px; }
  .brand__logo, .brand__logo img { width: 32px; height: 32px; }
  .brand__name { font-size: 18px; }

  .avatar-btn { width: 34px; height: 34px; }
  .avatar-btn__icon { width: 32px; height: 32px; }

  /* 内容区全宽，底部留出固定充值栏的高度 */
  .main {
    display: block;
    padding: 0 16px calc(132px + env(safe-area-inset-bottom));
    align-items: stretch;
  }

  .card {
    width: 100%;
    max-width: 100%;
    min-height: 0;
    padding: 0;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
  }

  .userbar { background: rgba(255, 255, 255, .72); }

  .balance { height: auto; padding: 24px 0 20px; }
  .balance__label { font-size: 13px; }
  .balance__value { font-size: 34px; line-height: 40px; letter-spacing: -1px; }
  .balance__art { width: 68px; height: 68px; top: 14px; right: 0; }

  .packages-heading { margin-bottom: 2px; }
  .packages-heading strong { font-size: 15px; }
  .packages-heading span { font-size: 12px; }

  /* 三列排布：7 档套餐 + 自定义（占两列），刚好铺满不落单 */
  .packages {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .package {
    height: 84px;
    padding: 18px 6px 14px;
    background: rgba(255, 255, 255, .8);
    border-color: rgba(22, 24, 35, .09);
  }

  .package__amount { gap: 2px; }
  .package__amount strong { font-size: 20px; }
  .package__amount svg,
  .package__amount img { width: 14px; height: 14px; }
  .package__price { font-size: 12px; }

  .package--custom {
    grid-column: span 2;
    flex-direction: row;
    gap: 10px;
    height: 84px;
  }

  .package--custom .package__price { margin-top: 0; }
  .package--custom strong { font-size: 15px; }

  /* 底部固定充值栏 */
  .action-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 60;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, .94);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    border-top: 1px solid rgba(22, 24, 35, .07);
  }

  .submit {
    height: 48px;
    margin-top: 0;
    font-size: 16px;
  }

  .agreement {
    height: auto;
    margin-top: 10px;
    line-height: 17px;
    text-align: center;
  }

  .toast { bottom: calc(150px + env(safe-area-inset-bottom)); }
}

/* ---------- 小屏手机 / 底部抽屉式弹窗 ---------- */

@media (max-width: 560px) {
  .modal {
    align-items: flex-end;
    padding: 0;
  }

  .modal__dialog {
    width: 100%;
    max-width: none;
    max-height: 88dvh;
    padding: 22px 20px calc(20px + env(safe-area-inset-bottom));
    border-radius: 20px 20px 0 0;
    animation: sheet-up .24s cubic-bezier(.22, .8, .28, 1);
  }

  @keyframes sheet-up {
    from { transform: translateY(100%); opacity: .6; }
    to { transform: translateY(0); opacity: 1; }
  }

  .dialog-custom__presets { grid-template-columns: repeat(4, 1fr); }
  .dialog-custom__presets button { height: 40px; font-size: 13px; }

  /* iOS 聚焦输入框不放大：字号不低于 16px */
  .field input { font-size: 16px; }
  .dialog-custom__input input { font-size: 22px; }

  .modal__mask { border-radius: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}
