/* H5 全局壳样式：模拟小程序导航栏 / tabBar / 交互反馈 */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
  background: #F5F7FA;
  color: #1E293B;
  -webkit-font-smoothing: antialiased;
}

/* 顶部导航栏 */
.h5-nav {
  position: sticky; top: 0; z-index: 100;
  height: 44px; background: #1E40AF; color: #FFF;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 500; letter-spacing: .3px;
  box-shadow: 0 1px 4px rgba(0,0,0,.12);
  padding-top: env(safe-area-inset-top);
}
.h5-nav-title { max-width: 80%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 页面容器 */
.h5-page { min-height: calc(100vh - 44px - 56px); padding-bottom: 12px; }

/* 底部 tabBar */
.h5-tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 100;
  height: 56px; background: #FFF; border-top: 1px solid #E8EDF3;
  display: flex; align-items: stretch; padding-bottom: env(safe-area-inset-bottom);
}
.h5-tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; font-size: 11px; color: #94A3B8; cursor: pointer;
}
.h5-tab.active { color: #2563EB; font-weight: 500; }
.h5-tab-dot { width: 20px; height: 20px; border-radius: 6px; background: #E2E8F0; }
.h5-tab.active .h5-tab-dot { background: #2563EB; }

/* Toast */
.h5-toast {
  position: fixed; left: 50%; top: 45%; transform: translate(-50%, -50%) scale(.95);
  z-index: 3000; max-width: 78vw; padding: 12px 20px; border-radius: 10px;
  background: rgba(17,24,39,.9); color: #FFF; font-size: 14px; text-align: center;
  opacity: 0; transition: opacity .25s, transform .25s; pointer-events: none;
  box-shadow: 0 8px 30px rgba(0,0,0,.2);
}
.h5-toast.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }

/* Loading */
.h5-loading {
  position: fixed; inset: 0; z-index: 2500; background: rgba(255,255,255,.65);
  display: flex; align-items: center; justify-content: center;
}
.h5-loading-box {
  background: #FFF; border-radius: 14px; padding: 22px 28px;
  box-shadow: 0 10px 40px rgba(0,0,0,.14);
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  font-size: 14px; color: #475569;
}
.h5-spinner {
  width: 28px; height: 28px; border: 3px solid #DBEAFE; border-top-color: #2563EB;
  border-radius: 50%; animation: h5spin .8s linear infinite;
}
@keyframes h5spin { to { transform: rotate(360deg); } }

/* Modal */
.h5-modal-mask {
  position: fixed; inset: 0; z-index: 2600; background: rgba(15,23,42,.45);
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.h5-modal {
  width: 100%; max-width: 320px; background: #FFF; border-radius: 14px; overflow: hidden;
  box-shadow: 0 20px 50px rgba(0,0,0,.22);
}
.h5-modal-title { padding: 20px 20px 8px; font-size: 16px; font-weight: 600; text-align: center; color: #0F172A; }
.h5-modal-content { padding: 8px 20px 20px; font-size: 14px; line-height: 1.6; color: #475569; text-align: center; max-height: 50vh; overflow-y: auto; }
.h5-modal-actions { display: flex; border-top: 1px solid #E8EDF3; }
.h5-modal-btn {
  flex: 1; padding: 14px; border: 0; background: #FFF; font-size: 15px; cursor: pointer; color: #475569;
}
.h5-modal-btn + .h5-modal-btn { border-left: 1px solid #E8EDF3; }
.h5-modal-btn.confirm { color: #2563EB; font-weight: 500; }

/* 小程序原生组件默认样式修正 */
button { font-family: inherit; cursor: pointer; }
input, textarea { font-family: inherit; outline: none; }
img { max-width: 100%; }
