/* 桌面预览：深色桌面背景 + 手机外壳居中 */
html,
body {
  background: var(--desktop-bg);
}

.device-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 28px;
}

/* 手机外壳（无刘海） */
.device {
  width: calc(var(--screen-width) + 2 * var(--bezel));
  padding: var(--bezel);
  background: #0d0f14;
  border-radius: var(--device-radius);
  box-shadow:
    0 30px 60px rgb(20 34 58 / 28%),
    0 4px 16px rgb(20 34 58 / 18%),
    inset 0 0 0 2px rgb(255 255 255 / 8%);
}

.device__screen {
  position: relative;
  display: flex;
  flex-direction: column;
  width: var(--screen-width);
  height: var(--screen-height);
  overflow: hidden;
  background: var(--color-page);
  border-radius: var(--screen-radius);
}

/* 状态栏（无刘海） */
.statusbar {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: space-between;
  height: var(--statusbar-height);
  padding: 0 var(--space-5);
  color: var(--color-text);
  background: var(--color-page);
}

.statusbar__time {
  font-size: 14px;
  font-weight: 600;
}

.statusbar__icons {
  display: flex;
  align-items: center;
  gap: 5px;
}

/* 屏幕可视区：头部固定、主体滚动、Tab 栏固定底部 */
.app-viewport {
  position: relative;
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  background: var(--color-page);
}

.app-header {
  display: flex;
  flex: none;
  align-items: center;
  gap: var(--space-2);
  min-height: 56px;
  padding: 0 var(--space-4);
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}

.app-header__back {
  display: grid;
  width: 32px;
  height: 32px;
  margin-left: calc(-1 * var(--space-2));
  padding: 0;
  color: var(--color-text);
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  place-items: center;
}

.app-header__back:active {
  background: var(--color-page);
}

.app-header__title {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
}

/* 微信 H5 专属顶部导航 */
.app-header__wx-btn {
  display: grid;
  flex: none;
  width: 32px;
  height: 32px;
  padding: 0;
  color: var(--color-text-secondary);
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  place-items: center;
}

.app-header__wx-btn:active {
  background: var(--color-page);
}

.app-header__wx-center {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
}

.app-header__wx-name {
  max-width: 100%;
  overflow: hidden;
  font-size: 14px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-header__wx-domain {
  max-width: 100%;
  overflow: hidden;
  color: var(--color-text-tertiary);
  font-size: 11px;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-main {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  /* 隐藏滚动条但保留上下滚动能力 */
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE / 旧版 Edge */
}

.app-main::-webkit-scrollbar {
  display: none; /* Chrome / Safari / 新版 Edge */
}

/* 底部 Tab 栏已移除，个人中心入口改至右上角 */

.app-error {
  padding: var(--space-6) var(--space-4);
  color: var(--color-danger);
}

/* Toast：定位到手机屏幕内 Tab 栏上方 */
.app-toast-host {
  position: fixed;
  left: 50%;
  z-index: 100;
  bottom: calc((100vh - var(--screen-height) - 2 * var(--bezel)) / 2 + var(--bezel) + 20px);
  max-width: calc(var(--screen-width) - 48px);
  padding: 10px 16px;
  color: #fff;
  background: rgb(24 32 42 / 88%);
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.4;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 8px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

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