/* 设计 token 参照 home 项目的视觉效果（配色/圆角/模糊度）手写的，不是抄它的 CSS 文件。 */
:root {
  --accent: #e8879e;
  --bg-base: #f6f2f1;
  --card-tint: #ffffff;
  --text: #2b2b2d;
  --text-soft: #948d8a;
  --border-soft: rgba(0, 0, 0, 0.07);
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
}

body {
  background: var(--bg-base);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-tap-highlight-color: transparent;
}

/* 手机端优先：整个 app 限定最大宽度居中，超过手机宽度的屏幕也保持手机比例，
   不铺满横向撑开。 */
.frame {
  position: relative;
  width: 100%;
  max-width: 480px;
  height: 100dvh;
  margin: 0 auto;
  overflow: hidden;
  background: var(--bg-base);
}

.pages {
  position: relative;
  height: calc(100% - 96px - env(safe-area-inset-bottom));
  padding-top: env(safe-area-inset-top);
}

.page {
  position: absolute;
  inset: 0;
  display: none;
}

.page.active {
  display: flex;
  flex-direction: column;
}

.tabbar {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom));
  z-index: 15;
  height: 64px;
  border-radius: 24px;
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0 8px;
  background: var(--card-tint);
  border: 1px solid var(--border-soft);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
}

.tab-item {
  flex: 0 0 auto;
  border: none;
  background: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 9px 15px;
  border-radius: 16px;
  color: var(--text-soft);
  transition: background 0.2s ease, color 0.2s ease;
}

.tab-item svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tab-item span {
  font-size: 10.5px;
}

.tab-item.active {
  background: #000;
  color: #fff;
}

/* 头像圆图：home/chat 页共用。有 avatar_url 就当背景图铺满，没有就显示名字首字
   配纯色底（两种色调轮流用，纯粹为了区分不同联系人，没有别的含义）。 */
.avatar-circle {
  border-radius: 50%;
  background-color: var(--border-soft);
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #fff;
  font-weight: 600;
}

.avatar-circle.tint-a { background-color: #000; }
.avatar-circle.tint-b { background-color: var(--accent); }

.placeholder-page {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-soft);
  font-size: 13px;
  padding: 20px;
  text-align: center;
}
