﻿:root {
  --bg: #ededed;
  --me: #95ec69;
  --other: #ffffff;
  --line: #dcdcdc;
  --text: #191919;
  --muted: #9a9a9a;
  --accent: #2f6fed;
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: #f2f3f5;
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }
.screen { height: 100%; }

/* ---------- 登录 ---------- */
#login { display: flex; align-items: center; justify-content: center; background: #ffffff; padding: 24px; }
.login-box { width: 100%; max-width: 340px; }
.site-title { font-size: 22px; font-weight: 600; letter-spacing: 2px; color: #2a2f37; text-align: center; margin-bottom: 28px; }
.field { display: block; margin-bottom: 14px; }
.field input {
  width: 100%; padding: 12px 14px; font-size: 16px; color: var(--text);
  background: #f7f7f8; border: 1px solid #e4e5e8; border-radius: 8px; outline: none;
}
.field input:focus { border-color: #b9c9ea; background: #fff; }
.primary {
  width: 100%; margin-top: 8px; padding: 12px; font-size: 15px; font-weight: 600;
  color: #fff; background: #2f6fed; border: none; border-radius: 8px; cursor: pointer;
}
.primary:active { background: #2559c2; }
.tip { min-height: 18px; margin-top: 12px; font-size: 13px; color: #d0544b; text-align: center; }
.tip.strong { color: #333; font-size: 14px; margin: 0 0 14px; }

/* ---------- 主界面 ---------- */
#main { display: flex; flex-direction: column; }
.topbar {
  height: 50px; flex: 0 0 auto; display: flex; align-items: center; justify-content: flex-end;
  padding: 0 14px; background: #ededed; border-bottom: 1px solid var(--line);
}
.topbar { position: relative; }
.topbar .title {
  position: absolute; left: 0; right: 0; text-align: center; pointer-events: none;
  font-size: 16px; font-weight: 500; color: #2a2f37;
}
.tools { display: flex; align-items: center; gap: 8px; }
.icon {
  background: none; border: none; font-size: 17px; color: #5b626b; cursor: pointer;
  width: 32px; height: 32px; border-radius: 6px;
}
.icon:active { background: rgba(0,0,0,.05); }
.ghost {
  background: none; border: 1px solid #cfd2d7; color: #5b626b;
  padding: 5px 11px; border-radius: 6px; font-size: 13px; cursor: pointer;
}

.chat {
  flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch;
  background-color: var(--bg);
  background-image: none;
  background-size: cover;
  background-position: center;
}
.chat.bg-default { background-color: #ededed; }
.chat.bg-paper { background-color: #f4ede1; }
.chat.bg-gray { background-color: #dfe3e8; }
.chat.bg-dark { background-color: #303338; }
.chat-inner { padding: 16px 12px 8px; min-height: 100%; }

.row { display: flex; align-items: flex-start; gap: 9px; margin-bottom: 16px; }
.row.me { flex-direction: row-reverse; }
.avatar {
  width: 38px; height: 38px; border-radius: 5px; flex: 0 0 auto; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600; color: #fff; background: #8f97a3;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar.a05 { background: #4a7bd1; }
.avatar.a06 { background: #3f9c6d; }
.col { max-width: 72%; }
.bubble {
  position: relative; padding: 9px 12px; border-radius: 6px; font-size: 15px; line-height: 1.5;
  word-break: break-word; white-space: pre-wrap; background: var(--other);
}
.bubble::before {
  content: ""; position: absolute; top: 12px; width: 0; height: 0;
  border: 6px solid transparent;
}
.row.other .bubble::before { left: -11px; border-right-color: var(--other); }
.row.me .bubble { background: var(--me); }
.row.me .bubble::before { right: -11px; border-left-color: var(--me); }
.time-sep { text-align: center; font-size: 11px; color: #9a9a9a; margin: 6px 0 14px; }
.chat.bg-dark .time-sep { color: #b9bcc2; }

.composer {
  flex: 0 0 auto; display: flex; gap: 8px; align-items: flex-end;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  background: #f7f7f7; border-top: 1px solid var(--line);
}
.composer textarea {
  flex: 1; resize: none; max-height: 120px; padding: 9px 11px; font-size: 15px;
  font-family: inherit; color: var(--text); line-height: 1.45;
  background: #fff; border: 1px solid #e2e3e6; border-radius: 6px; outline: none;
}
.composer textarea:focus { border-color: #c9cdd4; }
.send {
  flex: 0 0 auto; padding: 9px 16px; font-size: 14px; font-weight: 500;
  color: #fff; background: #2f6fed; border: none; border-radius: 6px; cursor: pointer;
}
.send:active { background: #2559c2; }

