/* 手机H5样式（仅适配手机，锁定视口） */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #f2f3f5; color: #1a1a1a;
  font-size: 15px; line-height: 1.5;
}
a { color: inherit; text-decoration: none; }
.page { min-height: 100vh; display: flex; flex-direction: column; }

/* 顶部栏 */
.topbar {
  position: sticky; top: 0; z-index: 10;
  height: 50px; padding: 0 14px;
  display: flex; align-items: center; justify-content: space-between;
  background: #2b6cff; color: #fff;
  padding-top: env(safe-area-inset-top);
}
.topbar-title { font-size: 17px; font-weight: 600; }
.topbar-right { font-size: 14px; opacity: .95; }
.back { font-size: 26px; width: 32px; color: #fff; }

/* 首页宫格 */
.home-topbar { justify-content: space-between; }
.grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 10px; padding: 14px;
}
.cell {
  background: #fff; border-radius: 14px; padding: 18px 8px;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,.05);
}
.cell-icon { font-size: 30px; line-height: 1; }
.cell-title { font-size: 13px; color: #333; text-align: center; }
.empty { grid-column: 1 / -1; text-align: center; color: #999; padding: 40px 0; }

/* 详情 */
.detail { padding: 24px 18px; text-align: center; flex: 1; }
.detail-icon { font-size: 56px; margin-bottom: 10px; }
.detail h2 { margin: 6px 0; font-size: 20px; }
.detail-desc { color: #666; margin: 10px 0 24px; }

/* 登录 */
.login-page { align-items: center; justify-content: center; background: #2b6cff; }
.login-card {
  width: 86%; max-width: 360px; background: #fff; border-radius: 18px;
  padding: 28px 22px; box-shadow: 0 8px 30px rgba(0,0,0,.15);
}
.login-logo { font-size: 44px; text-align: center; }
.login-title { text-align: center; margin: 8px 0 2px; font-size: 20px; }
.login-sub { text-align: center; color: #999; margin: 0 0 18px; font-size: 13px; }
.login-back { display: block; text-align: center; margin-top: 14px; color: #2b6cff; font-size: 13px; }

/* 输入与按钮 */
.inp {
  width: 100%; height: 44px; border: 1px solid #e2e4e8; border-radius: 10px;
  padding: 0 12px; font-size: 15px; margin-bottom: 12px; background: #fafbfc;
}
.btn {
  height: 44px; border: none; border-radius: 10px; font-size: 15px;
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
}
.btn-primary { background: #2b6cff; color: #fff; }
.btn.block { width: 100%; margin-top: 8px; }

/* 提示 */
.tip { background: #fff7e6; color: #b6791f; border-radius: 10px; padding: 12px; font-size: 13px; }
.tip-err { background: #fff1f0; color: #cf1322; }

/* 我的 */
.settings { padding: 14px; flex: 1; }
.settings-user { display: flex; align-items: center; gap: 12px; background: #fff; border-radius: 14px; padding: 16px; margin-bottom: 12px; }
.avatar { font-size: 38px; }
.uname { font-size: 16px; font-weight: 600; }
.usub { font-size: 12px; color: #999; }
.settings-item { display: block; background: #fff; border-radius: 12px; padding: 15px; margin-bottom: 10px; font-size: 15px; }
.settings-item.muted { color: #bbb; text-align: center; font-size: 12px; }

/* 对话 */
.chat-page { background: #f2f3f5; }
.chat-box { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.bubble { max-width: 78%; padding: 10px 13px; border-radius: 14px; font-size: 14px; word-break: break-word; white-space: pre-wrap; }
.bubble-me { align-self: flex-end; background: #2b6cff; color: #fff; border-bottom-right-radius: 4px; }
.bubble-ai { align-self: flex-start; background: #fff; color: #222; border-bottom-left-radius: 4px; }
.chat-input { display: flex; gap: 8px; padding: 10px; background: #fff; border-top: 1px solid #eee; padding-bottom: calc(10px + env(safe-area-inset-bottom)); }
.chat-input .inp { margin-bottom: 0; }
.chat-input .btn { width: 76px; }

/* 底部导航（费用/调试/控制/我的） */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  display: flex; background: #fff; border-top: 1px solid #ececec;
  padding-bottom: env(safe-area-inset-bottom);
}
.tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 7px 0 6px; color: #8a8f99; font-size: 11px;
}
.tab-ico { font-size: 21px; line-height: 1.1; }
.tab.on { color: #2b6cff; font-weight: 600; }
/* 带 tabbar 的一级页：给底部导航留出高度 */
.page.has-tab { min-height: calc(100vh - 58px - env(safe-area-inset-bottom)); }

/* 费用页 */
.fee { padding: 14px; flex: 1; }
.stat-row {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 10px; margin-bottom: 12px;
}
.stat-card {
  background: #fff; border-radius: 14px; padding: 18px 8px;
  text-align: center; box-shadow: 0 1px 3px rgba(0,0,0,.05);
}
.stat-num { font-size: 24px; font-weight: 700; color: #2b6cff; }
.stat-label { font-size: 12px; color: #999; margin-top: 4px; }
