/* 支付宝小程序公共展示层：保留业务代码，仅收敛端内展示。 */
html,
body {
  scrollbar-width: none;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar {
  display: none;
}

/* 支付宝小程序右上角胶囊操作区，统一承载更多和关闭小程序。 */
.statusbar {
  position: relative;
}

/* 有状态栏的页面也按“我的发票”页面的手机画布顶部位置对齐。 */
.statusbar > .mini-app-actions {
  top: 16px;
  transform: none;
}

.mini-app-actions {
  position: absolute;
  top: calc(50% + 6px);
  right: 12px;
  z-index: 25;
  display: inline-flex;
  align-items: stretch;
  height: 36px;
  overflow: hidden;
  transform: translateY(-50%);
  border: 1px solid rgba(34, 60, 48, 0.13);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 2px 8px rgba(27, 67, 48, 0.12);
  backdrop-filter: blur(8px);
}

.phone > .mini-app-actions {
  top: 16px;
  transform: none;
}

.statusbar-green .mini-app-actions {
  border-color: rgba(255, 255, 255, 0.42);
  background: rgba(221, 255, 241, 0.72);
}

.mini-app-action {
  width: 38px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  color: #172d28;
}

.mini-app-action + .mini-app-action {
  border-left: 1px solid rgba(34, 60, 48, 0.12);
}

.statusbar-green .mini-app-action + .mini-app-action {
  border-left-color: rgba(34, 60, 48, 0.15);
}

.mini-app-action:active {
  background: rgba(19, 137, 95, 0.12);
}

/* 公共操作面板保持手机画布宽度和四角圆角。 */
.mini-action-backdrop {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: none;
  align-items: flex-end;
  justify-content: center;
  padding: 0 12px 12px;
  background: rgba(18, 35, 28, 0.38);
}

.mini-action-backdrop.open {
  display: flex;
}

.mini-action-sheet {
  width: min(390px, 100%);
  max-height: calc(100dvh - 24px);
  overflow: auto;
  padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
  border: 1px solid #e1ebe5;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 12px 38px rgba(18, 46, 34, 0.2);
}

.mini-action-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 32px;
  color: #172d28;
  font-size: 16px;
  font-weight: 700;
}

.mini-action-sheet-close {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #7c918a;
}

.mini-action-sheet-close:active {
  background: #eef7f2;
  color: #13895f;
}

.mini-action-intro {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-top: 16px;
  padding: 13px;
  border-radius: 12px;
  background: #e9fbf4;
  color: #13895f;
}

.mini-action-intro-icon {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  border-radius: 10px;
  background: #fff;
}

.mini-action-intro-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}

.mini-action-intro-copy strong {
  color: #172d28;
  font-size: 14px;
}

.mini-action-intro-copy span,
.mini-action-note,
.mini-action-info-label {
  color: #7c918a;
  font-size: 11px;
  line-height: 1.6;
}

.mini-action-info-list {
  margin-top: 12px;
  overflow: hidden;
  border: 1px solid #e4eee9;
  border-radius: 12px;
}

.mini-action-info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px;
  border-bottom: 1px solid #eef4ef;
}

.mini-action-info-row:last-child {
  border-bottom: 0;
}

.mini-action-info-label {
  flex: 1;
}

.mini-action-info-value {
  max-width: 58%;
  color: #172d28;
  font-size: 12px;
  font-weight: 700;
  text-align: right;
  overflow-wrap: anywhere;
}

.mini-action-note {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 9px;
  background: #f5faf7;
}

.mini-action-actions {
  display: flex;
  gap: 9px;
  margin-top: 14px;
}

.mini-action-actions button {
  min-height: 42px;
  flex: 1;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
}

.mini-action-secondary {
  border: 1px solid #dbe8df;
  background: #fff;
  color: #445c54;
}

.mini-action-primary {
  border: 1px solid #20bd7b;
  background: #20bd7b;
  color: #fff;
}

@media (max-width: 480px) {
  .mini-action-backdrop {
    padding-right: 0;
    padding-bottom: 0;
    padding-left: 0;
  }

  .mini-action-sheet {
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 18px 18px 0 0;
  }
}

/* “我的”页功能弹窗必须限制在手机画布内，避免 PC 预览时相对浏览器窗口错位。 */
.phone > .profile-backdrop,
.phone > .stats-backdrop,
.phone > .feature-backdrop {
  position: absolute;
  inset: 0;
}

.phone > .profile-sheet,
.phone > .stats-sheet,
.phone > .feature-sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-height: calc(100dvh - 24px);
  border-radius: 18px;
  transform: translateY(100%);
}

.phone > .profile-sheet.open,
.phone > .stats-sheet.open,
.phone > .feature-sheet.open {
  transform: translateY(0);
}

/* PC 端按手机比例展示完整的小程序外框，长内容只在页面内容区滚动。 */
@media (min-width: 700px) {
  html,
  body {
    height: 100%;
    min-height: 0;
    overflow: hidden;
  }

  .stage,
  .page-shell,
  .page {
    width: 100%;
    height: 100vh;
    min-height: 0 !important;
    padding: 0 !important;
    align-items: center;
    overflow: hidden;
  }

  .stage .phone,
  .page-shell .phone,
  .page .phone {
    width: min(100%, 390px);
    max-width: 390px;
    height: min(100%, 844px);
    max-height: 100%;
    min-height: 0 !important;
  }

  .bottom-actions,
  .bottom-nav,
  .bottom,
  .picker-sheet {
    width: min(390px, 100%);
  }

  .stage .scroll,
  .page-shell .app-body,
  .page .body {
    min-height: 0;
  }

  .page-shell .app-body {
    max-height: calc(100% - 68px);
  }

  .page .body {
    height: calc(100% - 68px);
  }
}

/* 所有功能弹窗保持原小程序底部弹层的尺寸和位置，内容较长时在弹窗内部滚动。 */
.profile-sheet,
.stats-sheet,
.feature-sheet {
  top: auto;
  bottom: 0;
  height: auto;
  min-height: 0;
  max-height: calc(100dvh - 24px);
  overflow: auto;
  border-radius: 18px;
}

/* 通用弹层统一为手机画布内的四角圆润底部弹窗。 */
.modal-backdrop {
  align-items: flex-end;
}

.modal-backdrop > .sheet {
  width: min(390px, 100%);
  height: auto;
  min-height: 0;
  max-height: calc(100dvh - 24px);
  overflow: auto;
  border-radius: 18px;
  transform: translateY(100%);
}

.modal-backdrop.open > .sheet {
  transform: translateY(0);
}

.sheet-backdrop + .sheet {
  top: auto;
  bottom: 0;
  width: min(390px, 100%);
  height: auto;
  min-height: 0;
  max-height: calc(100dvh - 24px);
  overflow: auto;
  border-radius: 18px;
}

.sheet-backdrop + .sheet.open {
  transform: translate(-50%, 0);
}
