/* ============ 站点外壳与移动端适配 ============ */
html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: #e9e6f7;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica,
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: #1c1c20;
  overflow: hidden;
}

/* 桌面端给一个手机画布，移动端满屏 */
uni-app {
  position: relative;
  display: block;
  width: 100%;
  max-width: 430px;
  height: 100%;
  margin: 0 auto;
  overflow: hidden;
  background: #f4f6fa;
}

@media (min-width: 700px) {
  body {
    background: radial-gradient(120% 80% at 50% 0%, #cfc4ff 0%, #e9e6f7 45%, #eef1f7 100%);
  }
  uni-app {
    height: calc(100% - 40px);
    margin-top: 20px;
    border-radius: 24px;
    box-shadow: 0 24px 60px rgba(70, 50, 160, 0.22);
    /* 让页面里的 position:fixed 元素（底部按钮、弹层）以手机画布为参照，而不是整个浏览器窗口 */
    transform: translateZ(0);
  }
  body uni-tabbar.uni-tabbar-bottom {
    max-width: 430px;
    margin: 0 auto;
    border-radius: 0 0 24px 24px;
    overflow: hidden;
    bottom: 20px;
  }
}

uni-app,
uni-page,
uni-page-wrapper,
uni-page-body {
  display: block;
  width: 100%;
}

uni-page,
uni-page-wrapper {
  height: 100%;
}

uni-page-wrapper {
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
}

uni-page-wrapper::-webkit-scrollbar {
  width: 0;
  height: 0;
}

/* uni-app 内部的滚动容器改成跟随内容高度，交给外层滚动 */
uni-page-body uni-scroll-view,
uni-page-body .uni-scroll-view,
uni-page-body .uni-scroll-view-content {
  height: auto !important;
  max-height: none !important;
}

uni-page-body .uni-scroll-view {
  overflow: visible !important;
}

/* 底部 tabbar */
uni-tabbar.uni-tabbar-bottom {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 998;
  display: block;
}

/* base.css 里内部 .uni-tabbar 是 fixed 且依赖未定义的 --window-left/right，
   会缩成图标宽度；这里改回普通布局，让四项铺满 430px 画布 */
uni-tabbar.uni-tabbar-bottom .uni-tabbar {
  position: static;
  width: 100%;
}

uni-tabbar .uni-tabbar {
  position: relative;
  display: flex;
  flex-direction: row;
  justify-content: space-around;
  align-items: stretch;
  height: 50px;
  background: #fff;
}

uni-tabbar .uni-tabbar__item {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

uni-tabbar .uni-tabbar__bd {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

uni-tabbar .uni-tabbar__icon {
  width: 24px;
  height: 24px;
  line-height: 0;
}

uni-tabbar .uni-tabbar__icon img {
  width: 100%;
  height: 100%;
  display: block;
}

uni-tabbar .uni-tabbar__label {
  font-size: 10px;
  line-height: normal;
  margin-top: 3px;
  color: #666;
}

uni-tabbar .uni-tabbar__item.is-active .uni-tabbar__label {
  color: #6a52ff;
}

/* 页面切换的轻微淡入 */
#pageBody > * {
  animation: pageFade 0.18s ease-out;
}

@keyframes pageFade {
  from {
    opacity: 0.4;
  }
  to {
    opacity: 1;
  }
}

/* 加载态 */
.page-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 60vh;
  color: #8d87a8;
  font-size: 13px;
}

/* 通用可点击反馈 */
.tappable {
  cursor: pointer;
}

.tappable:active {
  opacity: 0.72;
}

/* 自定义确认弹层 */
.app-toast {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 9999;
  max-width: 280px;
  padding: 12px 18px;
  border-radius: 10px;
  background: rgba(28, 28, 32, 0.86);
  color: #fff;
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
  pointer-events: none;
  animation: toastIn 0.18s ease-out;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translate(-50%, -46%);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%);
  }
}
