/* ============================================================
 * H5 外壳样式（手写部分）：手机框 / 导航栏 / TabBar / 浮层
 * 页面与组件样式在 app.css（由 tools/build-css.js 从 wxss 生成）
 * ============================================================ */

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body { margin: 0; padding: 0; }

body {
  background: #ECE9E2;                 /* 桌面端手机框外的底色 */
  color: #22302A;
  font-size: 14px;
  line-height: 1.65;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }
button {
  border: none; outline: none; cursor: pointer;
  font-family: inherit; background: none; padding: 0;
}
input, textarea {
  border: none; outline: none; background: none;
  font-family: inherit; color: inherit;
}
a { color: #3E8464; }

/* ---------- 手机框：移动端全宽，桌面端居中限宽 ---------- */
.phone {
  position: relative;
  max-width: 430px;
  margin: 0 auto;
  min-height: 100vh;
  background: #F7F5F0;
  box-shadow: 0 0 40px rgba(46, 74, 60, 0.10);
  overflow-x: hidden;
}

/* ---------- 顶部导航栏（对应小程序 navigationBar） ---------- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  height: calc(44px + env(safe-area-inset-top));
  padding-top: env(safe-area-inset-top);
  background: #F7F5F0;
  color: #22302A;
}
.navbar__back {
  position: absolute;
  left: 4px;
  top: env(safe-area-inset-top);
  width: 56px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.navbar__back:active { opacity: 0.6; }
.navbar__back-ic {
  font-size: 30px;
  font-weight: 400;
  color: #22302A;
  line-height: 1;
  margin-top: -2px;
}
.navbar__title {
  flex: 1;
  text-align: center;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.5px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  padding: 0 56px;
}

/* ---------- 底部 TabBar（对应小程序 tabBar） ---------- */
.tabbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  margin: 0 auto;
  max-width: 430px;
  display: flex;
  background: #FFFFFF;
  border-top: 1px solid #EDEAE2;
  padding-bottom: env(safe-area-inset-bottom);
  z-index: 50;
}
.tabbar__item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6px 0 5px;
  cursor: pointer;
  color: #98A29A;
}
.tabbar__item:active { opacity: 0.7; }
.tabbar__item--on { color: #3E8464; }
.tabbar__icon {
  width: 26px;
  height: 26px;
  margin-bottom: 2px;
}
.tabbar__text { font-size: 10.5px; line-height: 1; letter-spacing: 0.2px; }

/* ---------- 全局浮层：toast / modal ---------- */
.h5-toast {
  position: fixed;
  left: 50%;
  bottom: 96px;
  transform: translateX(-50%);
  max-width: 78%;
  padding: 10px 18px;
  background: rgba(0, 0, 0, 0.76);
  color: #fff;
  font-size: 14px;
  line-height: 1.5;
  border-radius: 10px;
  text-align: center;
  z-index: 3000;
  pointer-events: none;
}
.h5-mask {
  position: fixed;
  inset: 0;
  background: rgba(20, 18, 30, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 4000;
  padding: 24px;
}
.h5-modal {
  width: 100%;
  max-width: 300px;
  background: #fff;
  border-radius: 14px;
  padding: 24px 20px 16px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}
.h5-modal__t {
  font-size: 16px;
  font-weight: 700;
  color: #22302A;
  margin-bottom: 10px;
}
.h5-modal__c {
  font-size: 14px;
  color: #5C6A61;
  line-height: 1.65;
  text-align: left;
  max-height: 50vh;
  overflow-y: auto;
}
.h5-modal__btns {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}
.h5-modal__btn {
  flex: 1;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}
.h5-modal__btn:active { opacity: 0.85; }
.h5-modal__btn--ghost { background: #F4F5F7; color: #5B6C8F; }
.h5-modal__btn--main {
  background: linear-gradient(135deg, #5FA385, #3E8464);
  color: #fff;
}

/* 浮层过渡 */
.fade-enter-active, .fade-leave-active { transition: opacity 180ms ease; }
.fade-enter-from, .fade-leave-to { opacity: 0; }

/* ---------- 兼容补丁 ---------- */
/* search 页的 .bar 与全局进度条 .bar 撞名：小程序里 page.wxss 整体覆盖 app.wxss，
   H5 用显式重置达到同样效果（高度自适应、不裁剪、贴在导航栏下方） */
.pg-search .bar {
  height: auto;
  overflow: visible;
  top: calc(44px + env(safe-area-inset-top));
}

/* 页面内容区不需要再给 tab 页加底部 padding 之外的冗余 */
.page { position: relative; }
