/* ============================================================
 * layout.css —— 整页框架（Header + View + Tabbar）
 * ============================================================ */

.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: #f5f5f5;
}

/* 顶部导航 */
.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  height: 44px;
  padding: 0 12px;
  padding-top: env(safe-area-inset-top);
  background: #fff;
  color: #1a1a1a;
  border-bottom: 1px solid #ededed;
  box-shadow: none;
}

.app-header-left,
.app-header-right {
  min-width: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}
.app-header-left {
  cursor: pointer;
  padding: 0 4px;
}
.app-header-left.hidden { visibility: hidden; }

.app-header-title {
  flex: 1;
  text-align: center;
  font-size: 16px;
  font-weight: 500;
  color: #1a1a1a;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0 8px;
}

.app-header.header-white {
  background: #fff;
  color: #333;
  border-bottom: 1px solid #f0f0f0;
  box-shadow: none;
}
.app-header.header-white .icon-chevron-left {
  filter: invert(20%);
}

/* H5 全局不再显示页面内标题栏：标题统一由浏览器/微信顶部显示 */
#app-header,
.app-header {
  display: none !important;
}

/* 内容区 */
.app-view {
  flex: 1;
  min-height: 100vh;
  padding-bottom: calc(56px + env(safe-area-inset-bottom));
}
.app-view.no-tabbar {
  padding-bottom: env(safe-area-inset-bottom);
}

/* 底部 tabbar */
.app-tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 56px;
  padding-bottom: env(safe-area-inset-bottom);
  background: #fff;
  box-shadow: 0 -1px 6px rgba(0, 0, 0, 0.08);
  display: flex;
  z-index: 60;
}
.app-tabbar.hidden { display: none; }

.app-tabbar .tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #999;
  font-size: 10px;
  height: 56px;
}
.app-tabbar .tab.is-active { color: #1a6eff; }

.app-tabbar .tab-icon {
  width: 24px;
  height: 24px;
  margin-right: 0;
  margin-bottom: 2px;
}
/* 与小程序 images/tab 同一套图标（81x81 PNG，普通/选中各一张） */
.app-tabbar .tab-icon-img {
  width: 24px;
  height: 24px;
  object-fit: contain;
  margin-bottom: 2px;
  display: block;
}
.app-tabbar .tab-icon-img.tab-icon-active { display: none; }
.app-tabbar .tab.is-active .tab-icon-img.tab-icon-normal { display: none; }
.app-tabbar .tab.is-active .tab-icon-img.tab-icon-active { display: block; }
.app-tabbar .tab-text {
  font-size: 11px;
  line-height: 1.2;
}

/* 页面切换动画 */
.page {
  animation: pageFadeIn .25s ease;
}
@keyframes pageFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 全局返回按钮：二级功能页统一显示 */
.floating-back {
  position: fixed;
  left: 10px;
  top: calc(10px + env(safe-area-inset-top));
  z-index: 80;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #172033;
  box-shadow: none;
  filter: drop-shadow(0 1px 2px rgba(255, 255, 255, 0.85));
  cursor: pointer;
}
.floating-back.hidden { display: none !important; }
.floating-back:active { transform: scale(0.94); }
/* 返回按钮悬浮在内容左上角，页面自己控制标题/标签与它的间距 */
body.has-floating-back .app-view { padding-top: 0; }