/* =====================================================
   公共样式（H5 版）
   rpx -> rem 换算：1rem = 100rpx（750 设计稿基准）
   html 字体大小 = 100vw / 7.5，则 100rpx = 1rem
   ===================================================== */

html {
  font-size: calc(100vw / 7.5);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  padding: 0;
  background: #f6f7f9;
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

* {
  box-sizing: border-box;
}

img {
  border: none;
  vertical-align: middle;
}

/* ================= 页面容器 ================= */
.page {
  width: 100%;
  min-height: 100vh;
  display: none;
  background: #f6f7f9;
}

.page.active {
  display: block;
}

/* tab 页给底部 tabBar 预留空间 */
.page.with-tabbar {
  padding-bottom: 1.6rem; /* 160rpx */
}

/* ================= 底部 tabBar ================= */
.tab-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  background: #fff;
  padding-bottom: env(safe-area-inset-bottom);
  z-index: 100;
  box-shadow: 0 -0.01rem 0 rgba(0, 0, 0, 0.05);
}

.tab-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.1rem 0 0.06rem;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}

.tab-item:active {
  background: #f7f8fa;
}

.tab-icon {
  width: 0.32rem;
  height: 0.32rem;
  margin-bottom: 0.04rem;
}

.tab-text {
  font-size: 0.22rem;
  line-height: 1;
}

/* ================= Toast ================= */
.toast {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  padding: 0.2rem 0.32rem;
  border-radius: 0.12rem;
  font-size: 0.28rem;
  line-height: 1.5;
  z-index: 999;
  max-width: 80%;
  text-align: center;
  display: none;
  pointer-events: none;
}

.toast.show {
  display: block;
  animation: toast-fade 0.2s ease;
}

@keyframes toast-fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* ================= Modal ================= */
.modal-mask {
  position: fixed;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 998;
  display: none;
  align-items: center;
  justify-content: center;
}

.modal-mask.show {
  display: flex;
}

.modal-box {
  width: 5.4rem;
  background: #fff;
  border-radius: 0.24rem;
  overflow: hidden;
}

.modal-title {
  font-size: 0.32rem;
  font-weight: 600;
  color: #111;
  text-align: center;
  padding: 0.36rem 0.3rem 0;
}

.modal-content {
  font-size: 0.28rem;
  color: #333;
  text-align: center;
  padding: 0.28rem 0.3rem;
  line-height: 1.5;
}

.modal-input {
  display: block;
  width: calc(100% - 0.6rem);
  margin: 0.1rem auto 0;
  height: 0.8rem;
  border: 0.01rem solid #ebedf0;
  border-radius: 0.08rem;
  font-size: 0.28rem;
  padding: 0 0.2rem;
  outline: none;
}

.modal-btns {
  display: flex;
  border-top: 0.01rem solid #ebedf0;
}

.modal-btn {
  flex: 1;
  height: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.32rem;
  color: #323233;
  cursor: pointer;
  user-select: none;
}

.modal-btn + .modal-btn {
  border-left: 0.01rem solid #ebedf0;
}

.modal-btn.confirm {
  color: #07c160;
  font-weight: 500;
}

.modal-btn:active {
  background: #f7f8fa;
}
