/* Miagent 应用外壳样式。页面只需使用 var(--ms-top) 做顶部偏移，不要写死 top:0。 */
:root {
  --ms-h: 52px;
  --ms-top: 0px;
  --ms-bar-bg: #ffffff;
  --ms-bar-fg: #143d46;
  --ms-bar-line: #dce7e4;
  --ms-accent: #147b6c;
}
[data-theme="dark"] {
  --ms-bar-bg: #15191f;
  --ms-bar-fg: #e8eef0;
  --ms-bar-line: #2a323b;
  --ms-accent: #4fc1ad;
}
.ms-topbar-on {
  --ms-top: calc(var(--ms-h) + env(safe-area-inset-top, 0px));
}
.ms-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  box-sizing: border-box;
  height: var(--ms-top);
  padding: env(safe-area-inset-top, 0px) 12px 0;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--ms-bar-bg);
  color: var(--ms-bar-fg);
  border-bottom: 1px solid var(--ms-bar-line);
}
.ms-back {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0 8px;
  color: var(--ms-accent);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  -webkit-tap-highlight-color: transparent;
}
.ms-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 16px;
  font-weight: 600;
}
/* 顶部栏占位：内容区从栏下方开始；web-view 中 --ms-top 为 0，不留空白 */
.ms-topbar-on body {
  padding-top: var(--ms-top);
}
