* { margin: 0; padding: 0; box-sizing: border-box; }
html, body, #app { height: 100%; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; background: #ededed; color: #000; }
.page { height: 100%; display: flex; flex-direction: column; }

/* 顶部导航 */
.navbar {
  height: 50px;
  background: #ededed;
  border-bottom: 1px solid #d6d6d6;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 0 15px;
  flex-shrink: 0;
}
.navbar .back { position: absolute; left: 15px; font-size: 16px; color: #576b95; cursor: pointer; }
.navbar .title { font-size: 17px; font-weight: 600; }
.navbar .action { position: absolute; right: 15px; font-size: 16px; color: #576b95; cursor: pointer; }

/* 登录页 */
.login-page { background: #fff; justify-content: flex-start; padding-top: 80px; }
.login-title { text-align: center; font-size: 22px; font-weight: 600; margin-bottom: 40px; }
.login-form { padding: 0 30px; }
.login-input {
  width: 100%; height: 48px; border: none; border-bottom: 1px solid #e5e5e5;
  font-size: 16px; outline: none; margin-bottom: 10px; padding: 0 5px;
}
.login-btn {
  width: 100%; height: 46px; margin-top: 30px; background: #07c160;
  color: #fff; border: none; border-radius: 4px; font-size: 17px;
}
.login-btn:disabled { opacity: 0.6; }
.login-error { color: #fa5151; text-align: center; margin-top: 15px; font-size: 14px; }

/* 会话列表 */
.conv-list { flex: 1; overflow-y: auto; background: #fff; }
.conv-item {
  display: flex; align-items: center; padding: 12px 15px;
  border-bottom: 1px solid #f2f2f2; cursor: pointer;
}
.conv-item:active { background: #f2f2f2; }
.conv-avatar {
  width: 48px; height: 48px; border-radius: 6px; margin-right: 12px;
  object-fit: cover; flex-shrink: 0;
}
.conv-body { flex: 1; min-width: 0; }
.conv-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.conv-name { font-size: 16px; color: #000; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.conv-time { font-size: 12px; color: #b2b2b2; flex-shrink: 0; }
.conv-bottom { display: flex; justify-content: space-between; align-items: center; }
.conv-msg { font-size: 14px; color: #999; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; flex: 1; }
.conv-badge {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: #fa5151; color: #fff; font-size: 12px; text-align: center; line-height: 18px;
  margin-left: 8px; flex-shrink: 0;
}
.empty { text-align: center; padding: 60px 20px; color: #999; font-size: 14px; }

/* 聊天页 */
.chat-body { flex: 1; overflow-y: auto; padding: 15px; background: #ededed; }
.chat-time { text-align: center; color: #999; font-size: 12px; margin: 10px 0; }
.msg-row { display: flex; margin-bottom: 15px; }
.msg-row.self { flex-direction: row-reverse; }
.msg-avatar {
  width: 40px; height: 40px; border-radius: 4px; object-fit: cover;
  flex-shrink: 0; margin: 0 10px;
}
.msg-bubble {
  max-width: 70%; min-height: 40px; padding: 10px 12px;
  border-radius: 4px; font-size: 15px; line-height: 1.4;
  word-break: break-word; position: relative;
}
.msg-row:not(.self) .msg-bubble { background: #fff; }
.msg-row.self .msg-bubble { background: #95ec69; }
.msg-bubble img { max-width: 100%; border-radius: 4px; display: block; cursor: pointer; }
.msg-bubble video { max-width: 100%; border-radius: 4px; display: block; }
.msg-bubble .emoji { font-size: 28px; }

/* 底部输入区 */
.chat-footer {
  background: #f7f7f7; border-top: 1px solid #d6d6d6; padding: 8px 12px;
  display: flex; align-items: center; flex-shrink: 0;
}
.chat-input {
  flex: 1; height: 40px; border: none; border-radius: 4px;
  background: #fff; padding: 0 10px; font-size: 15px; outline: none;
}
.chat-btn {
  margin-left: 10px; padding: 0 16px; height: 36px;
  background: #07c160; color: #fff; border: none; border-radius: 4px;
  font-size: 15px;
}
.chat-btn:disabled { opacity: 0.5; }
.chat-tool {
  margin-right: 10px; font-size: 22px; color: #666; cursor: pointer;
  position: relative;
}
.chat-tool input {
  position: absolute; left: 0; top: 0; width: 100%; height: 100%;
  opacity: 0; cursor: pointer;
}

/* 设置弹窗 */
.modal-mask {
  position: fixed; left: 0; top: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5); z-index: 100; display: flex;
  align-items: center; justify-content: center;
}
.modal {
  width: 80%; max-width: 320px; background: #fff; border-radius: 8px;
  padding: 20px;
}
.modal-title { font-size: 18px; font-weight: 600; text-align: center; margin-bottom: 20px; }
.modal-input {
  width: 100%; height: 42px; border: 1px solid #e5e5e5;
  border-radius: 4px; padding: 0 10px; font-size: 15px; margin-bottom: 12px;
}
.modal-btns { display: flex; margin-top: 20px; }
.modal-btn { flex: 1; height: 42px; border: none; font-size: 16px; border-radius: 4px; }
.modal-btn.cancel { background: #f2f2f2; margin-right: 10px; }
.modal-btn.ok { background: #07c160; color: #fff; }

.toast {
  position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%);
  background: rgba(0,0,0,0.7); color: #fff; padding: 12px 20px;
  border-radius: 6px; font-size: 14px; z-index: 200;
}
