/* lilyapp 手机端样式：QQ 式主页 + 角色聊天页 + 四个标签页。 */

:root {
  --bg: #0f1115;
  --bg-soft: #14171d;
  --bg-raised: #1a1e26;
  --bg-input: #1b1f27;
  --line: #2a303b;
  --line-soft: #21262f;
  --fg: #e8eaed;
  --fg-dim: #9aa3af;
  --fg-mute: #6b7280;
  --accent: #4c8dff;
  --accent-strong: #3b7bf0;
  --ok: #3ecf8e;
  --warn: #e0a33e;
  --busy: #a78bfa;
  --bad: #ef5f6b;
  --bubble-me: #2a4a7f;
  --bubble-her: #1c212a;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --nav-h: 58px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

button, input, textarea { font-family: inherit; color: inherit; }

.app {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  min-height: 0;
  padding-bottom: calc(var(--nav-h) + var(--safe-bottom));
}

.view {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

/* ---------- 主页头部 ---------- */

.home-head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: calc(8px + var(--safe-top)) 12px 8px;
}
.me { position: relative; display: flex; align-items: center; flex: 1 1 auto; min-width: 0; }
.me-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: linear-gradient(145deg, #2a4a7f, #4c8dff);
  color: #fff; font-weight: 700; font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  flex: 0 0 auto;
  overflow: hidden;
}
.me-avatar img { width: 100%; height: 100%; object-fit: cover; }
.me-live {
  position: absolute; left: 30px; top: 30px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--bg-soft);
  display: flex; align-items: center; justify-content: center;
}

.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--fg-mute); display: inline-block; flex: 0 0 auto; }
.dot.online { background: var(--ok); }
.dot.connecting { background: var(--warn); }
.dot.offline { background: var(--bad); }

.icon-btn {
  width: 40px; height: 40px;
  border: 0; border-radius: 10px;
  background: transparent; color: var(--fg-dim);
  font-size: 20px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  flex: 0 0 auto;
}
.icon-btn:active { background: var(--bg-raised); }

/* ---------- 搜索 ---------- */

.search-wrap {
  flex: 0 0 auto;
  position: relative;
  margin: 0 12px 8px;
}
.search-ico {
  position: absolute; left: 11px; top: 50%;
  width: 17px; height: 17px; transform: translateY(-50%);
  fill: none; stroke: var(--fg-mute); stroke-width: 1.8; stroke-linecap: round;
}
.search-wrap input {
  width: 100%; height: 38px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: var(--bg-input);
  padding: 0 12px 0 36px;
  font-size: 14px; outline: none;
}
.search-wrap input::placeholder { color: var(--fg-mute); }
.search-wrap input:focus { border-color: var(--line); }

/* ---------- 列表 ---------- */

.list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 2px 8px 12px;
  -webkit-overflow-scrolling: touch;
}

.role-row {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-height: 66px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  text-align: left;
  padding: 8px 10px;
}
.role-row:active { background: var(--bg-raised); }

.role-avatar { position: relative; flex: 0 0 auto; width: 46px; height: 46px; }
.role-avatar .avatar {
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--bg-raised);
  color: var(--fg-dim);
  font-size: 17px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.role-avatar img { width: 100%; height: 100%; object-fit: cover; }
.role-avatar .live {
  position: absolute; right: 0; bottom: 1px;
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--ok);
  border: 2px solid var(--bg);
}
.role-avatar .live.busy { background: var(--warn); }
.role-avatar .live.offline { background: var(--fg-mute); }
.role-avatar .live.error { background: var(--bad); }

.role-main { flex: 1 1 auto; min-width: 0; }
.role-top { display: flex; align-items: center; gap: 6px; }
.role-name {
  font-size: 15px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cat {
  flex: 0 0 auto;
  font-size: 9px; line-height: 1;
  padding: 3px 4px;
  border-radius: 4px;
  border: 1px solid currentColor;
  opacity: .95;
}
.cat.bot { color: #b18cff; }
.cat.local { color: #4ecfa0; }
.cat.api { color: #6aa5ff; }
.role-preview {
  margin-top: 3px;
  font-size: 12px; color: var(--fg-mute);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.role-side {
  flex: 0 0 auto;
  display: flex; flex-direction: column;
  align-items: flex-end; gap: 6px;
  min-width: 44px;
}
.role-time { font-size: 11px; color: var(--fg-mute); }
.badge {
  min-width: 18px; height: 18px;
  border-radius: 9px;
  background: var(--accent); color: #fff;
  font-size: 10px; line-height: 18px; text-align: center;
  padding: 0 5px;
}
.empty-tip {
  padding: 40px 20px;
  text-align: center;
  color: var(--fg-mute);
  font-size: 13px;
  line-height: 1.7;
}

/* ---------- 底部标签 ---------- */

.bottom-nav {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  height: calc(var(--nav-h) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  display: flex;
  background: var(--bg-soft);
  border-top: 1px solid var(--line-soft);
  z-index: 5;
}
.nav-btn {
  flex: 1 1 0;
  border: 0; background: transparent;
  color: var(--fg-mute);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 3px;
  font-size: 10px;
  padding-top: 4px;
}
.nav-btn svg {
  width: 22px; height: 22px;
  fill: none; stroke: currentColor;
  stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
}
.nav-btn.active { color: var(--accent); }

/* ---------- 通用页头 ---------- */

.page-head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 4px;
  height: calc(48px + var(--safe-top));
  padding: var(--safe-top) 8px 0;
  border-bottom: 1px solid var(--line-soft);
  background: var(--bg-soft);
}
.page-head h2 {
  flex: 1 1 auto;
  margin: 0;
  font-size: 16px; font-weight: 600;
  padding-left: 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.page-head .icon-btn { margin-left: auto; }

.chips {
  flex: 0 0 auto;
  display: flex; gap: 8px;
  padding: 8px 12px;
  overflow-x: auto;
}
.chip {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--fg-dim);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  min-height: 32px;
}
.chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ---------- 任务 ---------- */

.task-row {
  display: flex; align-items: center; gap: 10px;
  width: 100%; text-align: left;
  border: 0; background: transparent;
  border-radius: 12px;
  padding: 11px 10px;
}
.task-row:active { background: var(--bg-raised); }
.task-dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; background: var(--fg-mute); }
.task-dot.green { background: var(--ok); }
.task-dot.orange { background: var(--warn); }
.task-dot.gray { background: var(--fg-mute); }
.task-main { flex: 1 1 auto; min-width: 0; }
.task-name { font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.task-sub { font-size: 11px; color: var(--fg-mute); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chev { color: var(--fg-mute); font-size: 18px; flex: 0 0 auto; }

/* ---------- 插件 ---------- */

.plugin-card {
  margin: 8px 4px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: var(--bg-soft);
  overflow: hidden;
}
.plugin-card h3 {
  margin: 0;
  padding: 11px 13px;
  font-size: 14px;
  border-bottom: 1px solid var(--line-soft);
  display: flex; justify-content: space-between; align-items: center;
}
.plugin-card h3 span { font-size: 11px; color: var(--fg-mute); font-weight: 400; }
.plugin-item {
  display: flex; gap: 12px;
  padding: 9px 13px;
  font-size: 13px;
  border-bottom: 1px solid rgba(255,255,255,.03);
}
.plugin-item:last-child { border-bottom: 0; }
.plugin-item .k { flex: 1 1 auto; min-width: 0; color: var(--fg-dim); }
.plugin-item .v { flex: 0 0 auto; max-width: 55%; text-align: right; word-break: break-word; }
.plugin-item .v.ok { color: var(--ok); }
.plugin-item .v.warn { color: var(--warn); }
.plugin-item .v.bad { color: var(--bad); }

/* ---------- 文件 ---------- */

.file-row {
  display: flex; align-items: center; gap: 10px;
  width: 100%; text-align: left;
  border: 0; background: transparent;
  border-radius: 10px;
  padding: 9px 10px;
}
.file-row:active { background: var(--bg-raised); }
.file-ico {
  width: 36px; height: 36px; border-radius: 9px;
  background: var(--bg-raised);
  color: var(--fg-dim);
  font-size: 10px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  flex: 0 0 auto;
  text-transform: uppercase;
}
.file-ico.img { color: #7dd3fc; }
.file-ico.vid { color: #c4b5fd; }
.file-ico.aud { color: #fcd34d; }
.file-ico.doc { color: #93c5fd; }
.file-main { flex: 1 1 auto; min-width: 0; }
.file-name { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-sub { font-size: 11px; color: var(--fg-mute); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- 聊天页 ---------- */

.chat {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}
.chat-head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 2px;
  height: calc(50px + var(--safe-top));
  padding: var(--safe-top) 6px 0;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--line-soft);
}
.chat-head .back { font-size: 30px; font-weight: 300; width: 42px; }
.chat-title { flex: 1 1 auto; min-width: 0; text-align: center; }
.chat-name { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-sub {
  display: flex; align-items: center; justify-content: center; gap: 4px;
  font-size: 11px; color: var(--fg-mute);
  margin-top: 1px;
  height: 14px;
  white-space: nowrap; overflow: hidden;
}
.text-btn {
  border: 0; background: transparent;
  color: var(--accent);
  font-size: 13px;
  min-width: 52px; height: 40px;
  flex: 0 0 auto;
}

.messages {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 10px 10px 4px;
  -webkit-overflow-scrolling: touch;
}
.chat-empty {
  flex: 1 1 auto;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 6px; padding: 30px 24px; text-align: center;
}
.empty-avatar {
  width: 64px; height: 64px; border-radius: 50%;
  background: var(--bg-raised);
  color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; font-weight: 600;
  margin-bottom: 6px;
  overflow: hidden;
}
.empty-avatar img { width: 100%; height: 100%; object-fit: cover; }
.empty-title { margin: 0; font-size: 16px; font-weight: 600; }
.empty-text { margin: 0; font-size: 13px; color: var(--fg-mute); }

.day-sep { text-align: center; font-size: 11px; color: var(--fg-mute); margin: 14px 0 10px; }

.msg { display: flex; gap: 8px; margin-bottom: 10px; align-items: flex-end; }
.msg.me { flex-direction: row-reverse; }
.msg-body { display: flex; flex-direction: column; min-width: 0; max-width: 78%; }
.msg.me .msg-body { align-items: flex-end; }
.msg-body .bubble { max-width: 100%; }
.avatar {
  flex: 0 0 auto;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--bg-raised);
  color: var(--fg-dim);
  font-size: 13px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  user-select: none;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.msg.me .avatar { visibility: hidden; height: 0; width: 0; }
.avatar.blank { visibility: hidden; }

.bubble {
  max-width: 78%;
  min-width: 0;
  background: var(--bubble-her);
  border: 1px solid var(--line-soft);
  border-radius: 14px 14px 14px 4px;
  padding: 9px 12px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.msg.me .bubble {
  background: var(--bubble-me);
  border-color: transparent;
  border-radius: 14px 14px 4px 14px;
  color: #f2f6ff;
}
.msg.failed .bubble { border-color: var(--bad); }
.msg.failed .bubble::after {
  content: "没发出去";
  display: block; font-size: 11px; color: var(--bad); margin-top: 4px;
}
.bubble img.att {
  display: block; max-width: 100%; max-height: 260px;
  border-radius: 9px; margin: 2px 0 4px;
}
.bubble img.meme {
  max-width: 132px; max-height: 132px;
  width: auto; height: auto;
  object-fit: contain;
}
.bubble a.file { color: var(--accent); font-size: 13px; word-break: break-all; }
.bubble .notice { font-size: 12px; color: var(--fg-dim); font-style: italic; }
.bubble .meta { font-size: 10px; color: rgba(255,255,255,.45); margin-top: 4px; }

/* 长消息折叠 */
.bubble.collapsed {
  max-height: 232px;
  overflow: hidden;
  position: relative;
}
.bubble.collapsed::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: 0; height: 48px;
  background: linear-gradient(rgba(28,33,42,0), var(--bubble-her));
  pointer-events: none;
}
.msg.me .bubble.collapsed::after {
  background: linear-gradient(rgba(42,74,127,0), var(--bubble-me));
}
.expand-btn {
  display: block;
  margin: 4px 0 2px;
  border: 0;
  background: transparent;
  color: var(--accent);
  font-size: 12px;
  padding: 0;
}
.expand-btn:active { opacity: .7; }

/* 气泡底下的 token 用量 */
.msg-usage {
  max-width: 100%;
  margin: 3px 2px 0;
  font-size: 10px;
  color: var(--fg-mute);
  display: flex;
  gap: 4px;
  align-items: center;
}
.msg-usage .est { border: 1px solid var(--line); border-radius: 4px; padding: 0 3px; font-size: 9px; }

.typing { display: inline-flex; gap: 3px; padding: 2px 0; }
.typing i { width: 5px; height: 5px; border-radius: 50%; background: var(--fg-dim); animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; }
.typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%,64%,100% { opacity: .25 } 32% { opacity: 1 } }

.cancel-link {
  display: block;
  margin-top: 6px;
  border: 0;
  background: transparent;
  color: var(--bad);
  font-size: 12px;
  padding: 0;
  text-decoration: underline;
}

/* ---------- 待发附件 ---------- */

.pending-bar {
  flex: 0 0 auto;
  display: flex; gap: 8px;
  padding: 8px 12px 0;
  overflow-x: auto;
  background: var(--bg-soft);
}
.pending-chip {
  position: relative;
  flex: 0 0 auto;
  height: 54px; min-width: 54px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--bg-input);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; color: var(--fg-dim);
  padding: 0 6px;
}
.pending-chip img { width: 52px; height: 52px; object-fit: cover; border-radius: 8px; }
.pending-x {
  position: absolute; top: -6px; right: -6px;
  width: 20px; height: 20px; border-radius: 10px;
  border: 0; background: var(--bad); color: #fff;
  font-size: 13px; line-height: 20px; padding: 0;
}

/* ---------- 附件菜单 ---------- */

.attach-menu {
  position: absolute;
  left: 12px;
  bottom: calc(66px + var(--safe-bottom));
  z-index: 15;
  display: flex;
  flex-direction: column;
  min-width: 124px;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
}
.attach-menu button {
  border: 0;
  background: transparent;
  color: var(--fg);
  padding: 11px 16px;
  font-size: 14px;
  text-align: left;
}
.attach-menu button:active { background: var(--bg-input); }

/* ---------- 输入区 ---------- */

.composer {
  flex: 0 0 auto;
  display: flex; align-items: flex-end; gap: 6px;
  padding: 6px 8px calc(6px + var(--safe-bottom));
  background: var(--bg-soft);
  border-top: 1px solid var(--line-soft);
}
.composer textarea {
  flex: 1 1 auto;
  min-height: 40px; max-height: 120px;
  resize: none;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg-input);
  padding: 10px 12px;
  font-size: 15px; line-height: 1.4;
  outline: none;
}
.composer textarea:focus { border-color: var(--accent); }
.composer .attach {
  background: var(--bg-input);
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 22px;
}
.send-btn {
  flex: 0 0 auto;
  min-width: 58px; height: 40px;
  border: 0; border-radius: 12px;
  background: var(--accent); color: #fff;
  font-size: 14px; font-weight: 600;
}
.send-btn:active { background: var(--accent-strong); }
.send-btn[disabled] { opacity: .55; }

/* ---------- 会话切换 ---------- */

.sheet {
  position: fixed; inset: 0; z-index: 30;
  background: rgba(0,0,0,.55);
  display: flex; align-items: flex-end;
}
.sheet-panel {
  width: 100%; max-height: 78vh;
  background: var(--bg-soft);
  border-radius: 16px 16px 0 0;
  border-top: 1px solid var(--line);
  display: flex; flex-direction: column;
  padding-bottom: var(--safe-bottom);
  animation: sheet-up .2s ease-out;
}
@keyframes sheet-up { from { transform: translateY(24px); opacity: .5 } to { transform: none; opacity: 1 } }
.sheet-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 8px 10px 16px;
  font-size: 15px; font-weight: 600;
  border-bottom: 1px solid var(--line-soft);
}
.sheet-list { overflow-y: auto; padding: 6px; }

.sess-row {
  display: flex; align-items: center; gap: 10px;
  width: 100%; text-align: left;
  border: 0; background: transparent;
  border-radius: 12px;
  padding: 10px 12px;
  min-height: 58px;
}
.sess-row:active { background: var(--bg-raised); }
.sess-row.active { background: var(--bg-raised); }
.sess-main { flex: 1 1 auto; min-width: 0; }
.sess-title { font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sess-sub { font-size: 11px; color: var(--fg-mute); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sess-new { color: var(--accent); font-weight: 500; }
.sess-new .sess-title { color: var(--accent); }

/* ---------- 设置 / 阅读器 ---------- */

.page-overlay {
  position: fixed; inset: 0; z-index: 40;
  background: var(--bg);
  display: flex; flex-direction: column;
}
.settings-body { flex: 1 1 auto; overflow-y: auto; padding: 6px 0 calc(20px + var(--safe-bottom)); }
.set-group { margin: 12px 14px; }
.set-group h3 {
  margin: 0 0 6px 4px;
  font-size: 11px; font-weight: 500; color: var(--fg-mute);
}
.set-card {
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: var(--bg-soft);
  overflow: hidden;
}
.set-row {
  display: flex; align-items: center; gap: 12px;
  width: 100%; text-align: left;
  border: 0; background: transparent;
  padding: 13px 14px;
  font-size: 14px;
  border-bottom: 1px solid var(--line-soft);
  min-height: 48px;
}
.set-row:last-child { border-bottom: 0; }
.set-row .k { flex: 1 1 auto; }
.set-row .v { color: var(--fg-mute); font-size: 13px; max-width: 60%; text-align: right; word-break: break-all; }
.set-row.danger { color: var(--bad); justify-content: center; }
.set-row:active { background: var(--bg-raised); }

.reader-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 12px 14px calc(24px + var(--safe-bottom));
  font-size: 13px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--fg-dim);
}
.reader-body .proj-head {
  color: var(--fg);
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 4px;
}
.reader-body .proj-sub { font-size: 11px; color: var(--fg-mute); margin-bottom: 14px; }
.file-link {
  display: flex; align-items: center; gap: 8px;
  width: 100%; text-align: left;
  border: 0; border-bottom: 1px solid var(--line-soft);
  background: transparent;
  padding: 11px 4px;
  font-size: 13px;
  color: var(--fg);
}
.file-link:last-child { border-bottom: 0; }
.file-link .code { color: var(--fg-mute); font-size: 11px; flex: 0 0 auto; }
.file-link .t { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-link:active { background: var(--bg-raised); }

/* ---------- 登录 ---------- */

.login {
  position: fixed; inset: 0; z-index: 50;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.login-card { width: 100%; max-width: 320px; text-align: center; }
.login-logo {
  width: 72px; height: 72px; border-radius: 22px;
  margin: 0 auto 14px;
  background: linear-gradient(145deg, #2a4a7f, #4c8dff);
  color: #fff; font-size: 32px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.login-card h1 { margin: 0; font-size: 24px; }
.login-sub { color: var(--fg-mute); font-size: 13px; margin: 6px 0 22px; }
.login-card input {
  width: 100%; height: 46px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg-input);
  padding: 0 14px;
  font-size: 15px; outline: none;
  margin-bottom: 12px;
}
.login-card input:focus { border-color: var(--accent); }
.primary-btn {
  border: 0; border-radius: 12px;
  background: var(--accent); color: #fff;
  font-size: 15px; font-weight: 600;
  padding: 11px 22px;
  min-height: 44px;
}
.primary-btn:active { background: var(--accent-strong); }
.primary-btn[disabled] { opacity: .55; }
.login-card .primary-btn { width: 100%; }
.login-err { min-height: 18px; color: var(--bad); font-size: 12px; margin: 10px 0 0; }

/* ---------- 提示条 ---------- */

.toast {
  position: fixed;
  left: 50%; bottom: calc(90px + var(--safe-bottom));
  transform: translateX(-50%);
  max-width: 86vw;
  background: rgba(26,30,38,.96);
  border: 1px solid var(--line);
  color: var(--fg);
  font-size: 13px;
  padding: 9px 14px;
  border-radius: 10px;
  z-index: 60;
}

@media (min-width: 720px) {
  /* 平板/横屏别把内容拉成一整条，收成手机宽度居中 */
  .app { width: 100%; max-width: 640px; margin: 0 auto; }
  .bottom-nav {
    width: min(100%, 640px);
    left: 50%; right: auto;
    transform: translateX(-50%);
  }
  .chat {
    width: min(100%, 640px);
    left: 50%; right: auto;
    transform: translateX(-50%);
    border-left: 1px solid var(--line-soft);
    border-right: 1px solid var(--line-soft);
  }
  .page-overlay {
    width: min(100%, 640px);
    left: 50%; right: auto;
    transform: translateX(-50%);
    border-left: 1px solid var(--line-soft);
    border-right: 1px solid var(--line-soft);
  }
  .list { padding: 2px 8px 12px; }
  .messages { padding: 10px 10px 4px; }
  .bubble { max-width: 78%; }
}
