* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #ededed; color: #1a1a1a;
}
#chat-app {
  display: flex; flex-direction: column;
  height: 100vh; max-width: 480px; margin: 0 auto;
  background: #ededed;
}

/* 顶栏 */
.hd {
  flex: 0 0 auto; height: 52px; background: #f7f7f7;
  display: flex; align-items: center; padding: 0 10px;
  border-bottom: 1px solid #d8d8d8; position: relative;
}
.hd-back { width: 36px; font-size: 26px; color: #444; }
.hd-title { flex: 1; text-align: center; }
.hd-name { display: block; font-size: 16px; font-weight: 600; }
.hd-status { font-size: 11px; color: #888; display: inline-flex; align-items: center; gap: 3px; }
.dot { width: 6px; height: 6px; border-radius: 50%; background: #2ecc71; display: inline-block; }
.hd-more { width: 36px; text-align: center; font-size: 22px; color: #444; cursor: pointer; }
.hd-actions { display: flex; align-items: center; gap: 10px; }
.hd-act { font-size: 13px; color: #07c160; cursor: pointer; white-space: nowrap; }
.hd-act#recall-btn { font-size: 19px; color: #444; }

/* 消息区 */
.msgs { flex: 1; overflow-y: auto; padding: 14px 12px; }
.row { display: flex; margin-bottom: 16px; align-items: flex-start; }
.row.me { flex-direction: row-reverse; }
.avatar {
  width: 38px; height: 38px; border-radius: 5px; flex: 0 0 38px;
  background: #c9d6e8 center/cover; font-size: 20px;
  display: flex; align-items: center; justify-content: center;
}
.avatar.bot { background: #07c160; color: #fff; }
.avatar.me { background: #b0b0b0; color: #fff; }
.bubble {
  max-width: 70%; margin: 0 9px; padding: 9px 12px; border-radius: 6px;
  font-size: 15px; line-height: 1.5; word-break: break-word; position: relative;
  white-space: pre-wrap;
}
.row.bot .bubble { background: #fff; }
.row.me .bubble { background: #95ec69; }
.bubble img, .bubble video { max-width: 180px; border-radius: 4px; display: block; }
.bubble.file { color: #576b95; }

/* 团卡片 */
.card {
  background: #fff; border-radius: 8px; overflow: hidden; max-width: 78%;
  margin: 0 9px; box-shadow: 0 1px 4px rgba(0,0,0,.08); font-size: 14px;
}
.card .c-title { padding: 10px 12px 4px; font-weight: 600; }
.card .c-sub { padding: 0 12px 8px; color: #888; font-size: 12px; }
.card .c-btn {
  display: block; text-align: center; background: #07c160; color: #fff;
  padding: 9px; text-decoration: none; font-weight: 600;
}
.typing { color: #999; font-size: 13px; padding: 4px 12px; }

/* 输入栏 */
.inbar {
  flex: 0 0 auto; display: flex; align-items: flex-end; gap: 6px;
  padding: 8px; background: #f7f7f7; border-top: 1px solid #ddd;
}
.icon-btn {
  flex: 0 0 auto; width: 38px; height: 38px; border: none; background: #fff;
  border-radius: 6px; font-size: 20px; cursor: pointer; display: flex;
  align-items: center; justify-content: center; color: #444;
}
.icon-btn.rec { background: #07c160; color: #fff; animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .55; } }
#input {
  flex: 1; resize: none; border: none; border-radius: 6px; padding: 9px 10px;
  font-size: 15px; max-height: 100px; font-family: inherit; line-height: 1.4;
}
.send-btn {
  flex: 0 0 auto; border: none; background: #07c160; color: #fff;
  border-radius: 6px; padding: 0 16px; height: 38px; font-size: 15px; cursor: pointer;
}
.send-btn:disabled { background: #9bd7b5; }

/* 弹窗 */
.modal {
  position: fixed; inset: 0; background: rgba(0,0,0,.45);
  display: flex; align-items: center; justify-content: center; z-index: 50;
}
.modal.hidden { display: none; }
.modal-box { background: #fff; border-radius: 12px; padding: 20px; width: 86%; max-width: 340px; }
.modal-box h3 { font-size: 16px; margin-bottom: 14px; }
.modal-box label { display: block; font-size: 13px; color: #666; margin-bottom: 12px; }
.modal-box input {
  width: 100%; margin-top: 5px; padding: 9px; border: 1px solid #ddd;
  border-radius: 6px; font-size: 15px;
}
.modal-actions { display: flex; gap: 10px; margin-top: 6px; }
.btn-main { flex: 1; background: #07c160; color: #fff; border: none; padding: 10px; border-radius: 6px; font-size: 15px; }
.btn-ghost { flex: 1; background: #eee; color: #555; border: none; padding: 10px; border-radius: 6px; font-size: 15px; }
.rc-msg { margin-top: 12px; font-size: 13px; color: #e8453c; min-height: 18px; }
