
:root {
  color-scheme: dark;
  --bg: #111111;
  --surface: #1c1c1e;
  --surface-2: #262629;
  --line: #303034;
  --text: #f5f5f5;
  --muted: #929299;
  --green: #07c160;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
}

body {
  padding-bottom: env(safe-area-inset-bottom);
}

button, input, textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 3px;
}

img {
  max-width: 100%;
}

.hidden {
  display: none !important;
}

.page {
  min-height: 100vh;
  padding-bottom: 90px;
}

.page-header {
  position: sticky;
  top: 0;
  z-index: 10;
  min-height: 58px;
  padding: 16px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  font-size: 20px;
  font-weight: 650;
}

.content {
  padding: 14px 16px 24px;
}

.bottom-nav {
  position: fixed;
  z-index: 20;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: space-around;
  padding: 10px 4px calc(10px + env(safe-area-inset-bottom));
  background: rgba(28, 28, 30, .97);
  border-top: 1px solid var(--line);
}

.bottom-nav button {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  padding: 5px 2px;
}

.bottom-nav button.active {
  color: var(--green);
}

.card {
  padding: 16px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}

.muted {
  color: var(--muted);
}

.avatar {
  width: 52px;
  height: 52px;
  flex: 0 0 52px;
  border-radius: 12px;
  object-fit: cover;
  background: var(--surface-2);
}

.row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.search-box {
  width: 100%;
  padding: 12px 14px;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid transparent;
  border-radius: 10px;
}

.primary-button {
  padding: 11px 18px;
  color: white;
  background: var(--green);
  border: 0;
  border-radius: 9px;
}

.divider {
  height: 1px;
  background: var(--line);
  margin: 12px 0;
}


/* ===== 聊天窗口布局优化 ===== */

/* 聊天记录区域：独立滚动 */
#messageList {
  height: calc(100dvh - 270px);
  min-height: 180px !important;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 12px 10px 24px !important;
  scroll-behavior: smooth;
}

/* 表情面板：固定在底部导航上方 */
#emojiPanel {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: calc(76px + env(safe-area-inset-bottom));
  z-index: 19;
  max-height: 32dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 12px;
  border-radius: 18px;
  background: #202023;
  box-shadow: 0 -5px 25px rgba(0,0,0,.35);
}

/* 表情按钮 */
#emojiPanel .emojiChoice {
  width: 13%;
  min-height: 48px;
  border-radius: 10px;
  cursor: pointer;
}

#emojiPanel .emojiChoice:active {
  background: #39393d !important;
  transform: scale(.92);
}

/* 聊天输入框 */
#messageInput {
  min-width: 0;
  font-size: 16px;
  border-radius: 14px;
}

/* 聊天页面按钮 */
#app .back {
  padding: 9px 15px;
  color: white;
  background: #262629;
  border: 1px solid #39393d;
  border-radius: 22px;
}

/* 图片消息 */
#messageList img {
  max-width: 190px;
  border-radius: 10px;
}

/* 滚动条 */
#messageList::-webkit-scrollbar,
#emojiPanel::-webkit-scrollbar {
  display: none;
}
