:root {
  --bg: #ededed;
  --bar: #f7f7f7;
  --line: #d9d9d9;
  --text: #111;
  --muted: #888;
  --me: #95ec69;
  --other: #fff;
  --accent: #07c160;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111;
    --bar: #1e1e1e;
    --line: #2c2c2c;
    --text: #e8e8e8;
    --muted: #8a8a8a;
    --me: #3eb575;
    --other: #2c2c2c;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text);
  font: 16px/1.4 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif; }
#app { position: relative; height: 100%; max-width: 480px; margin: 0 auto; display: flex; flex-direction: column;
  background: var(--bg); overflow: hidden; }
#bar { flex: none; display: flex; align-items: center; justify-content: space-between; padding: 12px 16px;
  background: var(--bar); border-bottom: 1px solid var(--line); }
.title { font-weight: 600; }
.status { font-size: 12px; color: var(--muted); }
#list { flex: 1; overflow-y: auto; padding: 12px 16px; display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 75%; padding: 8px 12px; border-radius: 6px; word-break: break-word; }
.msg.me { align-self: flex-end; background: var(--me); color: #111; }
.msg.other { align-self: flex-start; background: var(--other); }
.msg.sys { align-self: center; background: none; color: var(--muted); font-size: 12px; padding: 0; }
#composer { flex: none; display: flex; gap: 8px; padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
  background: var(--bar); border-top: 1px solid var(--line); }
#input { flex: 1; min-width: 0; font-size: 16px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px;
  background: var(--bg); color: var(--text); }
#send { flex: none; padding: 0 16px; border: 0; border-radius: 6px; background: var(--accent); color: #fff; font-size: 15px; }
/* 特效画布铺满整个窗口：宽屏时手机画面两侧的出框内容也要画出来 */
#fx, #fxgl { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 10; }
@media (min-width: 600px) {
  body { background: color-mix(in srgb, var(--bg) 70%, #888); }
  #app { box-shadow: 0 0 0 1px var(--line); }
}
