:root {
  --navy: #23324f;
  --blue: #4b8df0;
  --blue-deep: #3366d6;
  --sky: #eaf2ff;
  --sky-soft: #f4f9ff;
  --text: #2a3a5c;
  --muted: #7d88a5;
  --line: #e3ebf8;
  --danger: #d64545;
  --card: #ffffff;
  --shadow-sm: 0 4px 14px rgba(60, 90, 160, 0.10);
  --shadow-md: 0 10px 30px rgba(60, 90, 160, 0.16);
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: linear-gradient(175deg, #cfdcf7 0%, #dfe9fb 45%, #eef3fd 100%);
  color: var(--text);
  overflow: hidden;
  height: 100vh;
  height: 100dvh;
}
body::before, body::after {
  content: "";
  position: fixed;
  border-radius: 50%;
  filter: blur(30px);
  z-index: 0;
  pointer-events: none;
}
body::before { width: 320px; height: 320px; background: rgba(255,255,255,0.55); top: -80px; right: -60px; }
body::after { width: 300px; height: 300px; background: rgba(160,190,250,0.35); bottom: -80px; left: -60px; }

#app {
  position: relative;
  z-index: 1;
  width: 480px;
  max-width: 100%;
  height: 100vh;
  height: 100dvh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 0 40px rgba(60, 90, 160, 0.15);
}

/* ---------- 顶部栏 ---------- */
.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: linear-gradient(180deg, #dbe7fb, #d3e0f9);
  border-bottom: 1px solid rgba(255,255,255,0.5);
  flex-shrink: 0;
}
.menu-btn {
  width: 38px; height: 38px;
  border: none;
  border-radius: 50%;
  background: #fff;
  color: var(--navy);
  font-size: 18px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  display: flex; align-items: center; justify-content: center;
}
.top-left { display: flex; align-items: center; gap: 10px; }
.top-right { display: flex; align-items: center; gap: 10px; }
.top-center { flex: 1; text-align: center; min-width: 0; line-height: 1.2; }
.top-brand { display: block; font-size: 11px; letter-spacing: 0.5px; color: var(--muted); opacity: 0.8; }
.top-session { display: block; font-size: 16px; font-weight: 800; color: var(--navy); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- 分类抽屉 ---------- */
.drawer-mask { position: fixed; inset: 0; background: rgba(30, 48, 90, 0.30); z-index: 40; opacity: 0; pointer-events: none; transition: opacity 0.2s ease; }
body.drawer-open .drawer-mask { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: 300px;
  max-width: 82vw;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 0 26px 26px 0;
  z-index: 50;
  transform: translateX(-105%);
  transition: transform 0.24s ease;
  padding: 20px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
body.drawer-open .drawer { transform: none; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.drawer-cat { font-family: Georgia, serif; font-style: italic; font-weight: 700; color: #5f83c9; font-size: 22px; }
.drawer-close {
  width: 34px; height: 34px; border: none; border-radius: 50%;
  background: #edf3fd; color: #8297bd; font-size: 20px; cursor: pointer;
}
.drawer-list { display: flex; flex-direction: column; gap: 12px; flex: 1; overflow-y: auto; min-height: 0; padding-right: 2px; }
/* ---------- 抽屉：会话搜索 ---------- */
.drawer-search { position: relative; display: flex; align-items: center; margin-bottom: 14px; }
.drawer-search-ico { position: absolute; left: 13px; color: var(--muted); pointer-events: none; }
.drawer-search-input { width: 100%; border: 1px solid var(--line); border-radius: 13px; padding: 10px 34px 10px 38px; font-size: 14px; font-family: inherit; background: #fff; color: var(--text); outline: none; box-shadow: var(--shadow-sm); }
.drawer-search-input:focus { border-color: #4D6BFE; box-shadow: 0 0 0 3px rgba(77,107,254,.14); }
.drawer-search-clear { position: absolute; right: 6px; width: 28px; height: 28px; border: none; background: transparent; color: var(--muted); font-size: 18px; cursor: pointer; border-radius: 50%; line-height: 1; }
.drawer-search-clear:hover { background: var(--sky); color: var(--blue); }
/* ---------- 抽屉：消息搜索结果 ---------- */
.drawer-list[hidden] { display: none; }
.drawer-search-results { display: flex; flex-direction: column; gap: 6px; flex: 1; overflow-y: auto; min-height: 0; padding-right: 2px; }
.drawer-search-results[hidden] { display: none; }
.msg-result { display: flex; align-items: flex-start; gap: 10px; width: 100%; border: none; background: transparent; padding: 8px 6px; border-radius: 12px; cursor: pointer; text-align: left; font-family: inherit; color: inherit; }
.msg-result:hover { background: var(--sky-soft); }
.msg-result-avatar { width: 34px; height: 34px; border-radius: 50%; background: #ecf3fe; color: #4D6BFE; display: flex; align-items: center; justify-content: center; font-size: 14px; flex-shrink: 0; }
.msg-result-avatar.user { background: #e3ecff; color: #3366d6; }
.msg-result-body { min-width: 0; flex: 1; }
.msg-result-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.msg-result-name { font-size: 14px; font-weight: 700; color: var(--navy); }
.msg-result-date { font-size: 11px; color: var(--muted); flex-shrink: 0; }
.msg-result-snippet { font-size: 13px; color: #93a0ba; line-height: 1.5; margin-top: 3px; word-break: break-word; }
.msg-result-snippet mark { background: transparent; color: #4D6BFE; font-weight: 600; border-radius: 3px; padding: 0 1px; }
.drawer-item {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px 16px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}
.drawer-item:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: #cdddff; }
.drawer-item .di-title { font-size: 16px; font-weight: 800; color: var(--navy); }
.drawer-item .di-sub { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* ---------- 视图区 ---------- */
.view-area { flex: 1; overflow: hidden; position: relative; min-height: 0; }
.view { position: absolute; inset: 0; display: none; flex-direction: column; overflow: hidden; }
.view.active { display: flex; }
.page-scroll { flex: 1; overflow-y: auto; padding: 16px 16px 20px; min-height: 0; }
.view.active.page-scroll { display: block; }
.page-head { display: flex; align-items: center; justify-content: space-between; }
.page-sub { color: var(--muted); font-size: 13px; margin: 8px 0 16px 2px; }
.section-title { font-size: 17px; font-weight: 800; color: var(--navy); }

/* ---------- 卡片 ---------- */
.card { background: var(--card); border-radius: 22px; padding: 18px; box-shadow: var(--shadow-sm); }
.clickable { cursor: pointer; transition: transform 0.12s ease, box-shadow 0.12s ease; }
.clickable:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

/* 主页 Hero */
.hero-card { text-align: center; padding: 24px 18px; margin-bottom: 14px; }
.hero-sub { color: var(--muted); font-size: 13px; letter-spacing: 0.5px; }
.hero-title { font-size: 22px; font-weight: 800; color: var(--navy); margin: 6px 0 12px; }
.hero-days { font-size: 64px; font-weight: 900; color: #3f74d6; line-height: 1; letter-spacing: 1px; }
.hero-days-label { color: var(--muted); font-size: 13px; margin-top: 6px; }
.hero-avatars { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 18px 0 14px; }
.hero-ava {
  width: 52px; height: 52px; border-radius: 50%;
  background: linear-gradient(135deg, #9bc0f5, #5b8ef0);
  color: #fff; font-size: 24px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 16px rgba(75, 141, 240, 0.35);
}
.hero-ava.you { background: linear-gradient(135deg, #ffd3a6, #f6a465); background-size: cover; background-position: center; }
.hero-heart { color: #e86a92; font-size: 20px; }
.hero-since { color: var(--muted); font-size: 13px; text-align: center; }
.hero-since b { color: var(--navy); }

.home-row { display: flex; gap: 12px; margin-bottom: 18px; }
.home-card { flex: 1; }
.card-title { font-size: 14px; font-weight: 800; color: var(--navy); margin-bottom: 10px; }
.home-weather { font-size: 18px; font-weight: 700; color: #3f74d6; }
.home-weather-sub { font-size: 12px; color: var(--muted); margin-top: 6px; }
.home-mood { font-size: 16px; font-weight: 700; color: #3f74d6; }
.home-mood-sub { font-size: 12px; color: var(--muted); margin-top: 6px; }

.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.round-plus {
  width: 34px; height: 34px; border: none; border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), var(--blue-deep));
  color: #fff; font-size: 18px; cursor: pointer; box-shadow: var(--shadow-sm);
}
.home-list { display: flex; flex-direction: column; gap: 12px; }
.day-card { display: flex; align-items: center; justify-content: space-between; }
.day-info .day-name { font-size: 16px; font-weight: 800; color: var(--navy); }
.day-tag { display: inline-block; margin-top: 6px; font-size: 12px; color: #5b8ef0; background: #eaf2ff; padding: 3px 10px; border-radius: 999px; }
.day-right { text-align: right; }
.day-days { font-size: 22px; font-weight: 800; color: #3f74d6; }
.day-days-label { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* ---------- 聊天 ---------- */
.chat-subbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px;
  background: rgba(255,255,255,0.55);
  border-bottom: 1px solid rgba(255,255,255,0.6);
  flex-shrink: 0;
}
.chat-title { font-size: 16px; font-weight: 800; color: var(--navy); }
.chat-actions { display: flex; gap: 8px; }
.mini-btn {
  width: 32px; height: 32px; border: none; border-radius: 50%;
  background: #fff; color: var(--muted); font-size: 14px; cursor: pointer;
  box-shadow: var(--shadow-sm); display: flex; align-items: center; justify-content: center;
}
.mini-btn:hover { color: var(--blue); }
.mini-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.nickline { display: flex; align-items: center; gap: 6px; padding: 6px 20px; font-size: 13px; color: var(--muted); }
.nickline .online { color: #35c66b; font-size: 12px; }

.chat {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px 8px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scrollbar-width: thin;
  scrollbar-color: #b7c9ea transparent;
}
.chat::-webkit-scrollbar { width: 6px; }
.chat::-webkit-scrollbar-thumb { background: #c3d3f0; border-radius: 6px; }

.msg { display: flex; align-items: flex-end; gap: 7px; animation: msg-in 0.22s ease both; }
@keyframes msg-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.msg.user { justify-content: flex-end; }
.avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: linear-gradient(135deg, #9bc0f5, #5b8ef0);
  color: #fff; font-size: 15px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; box-shadow: 0 2px 8px rgba(75,141,240,0.3);
}
.bubble {
  max-width: 76%;
  padding: 11px 16px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}
.msg.user .bubble {
  background: linear-gradient(135deg, #6ea7f5, #4b8df0);
  color: #fff;
  border-bottom-right-radius: 6px;
  box-shadow: 0 4px 12px rgba(75,141,240,0.30);
}
.msg.ai .bubble {
  background: #fff;
  color: var(--text);
  border-bottom-left-radius: 6px;
  box-shadow: var(--shadow-sm);
}
.msg.ai .bubble { white-space: normal; }
.msg.ai .bubble p { margin: 0 0 8px; }
.msg.ai .bubble p:last-child { margin-bottom: 0; }
.msg.ai .bubble h1, .msg.ai .bubble h2, .msg.ai .bubble h3, .msg.ai .bubble h4 { margin: 10px 0 6px; font-size: 16px; font-weight: 800; color: var(--navy); }
.msg.ai .bubble ul, .msg.ai .bubble ol { margin: 0 0 8px; padding-left: 20px; }
.msg.ai .bubble li { margin: 2px 0; }
.msg.ai .bubble code { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: 0.88em; background: #eef2fa; border-radius: 4px; padding: 1px 5px; color: #3366d6; }
.msg.ai .bubble pre { background: #f4f7fd; border-radius: 10px; padding: 10px 12px; overflow-x: auto; margin: 0 0 8px; }
.msg.ai .bubble pre code { background: none; padding: 0; color: var(--text); }
.msg.ai .bubble blockquote { border-left: 3px solid #bcd0f0; margin: 0 0 8px; padding: 2px 10px; color: var(--muted); }
.msg.ai .bubble a { color: #4D6BFE; text-decoration: none; }
.msg.ai .bubble a:hover { text-decoration: underline; }
.msg.ai .bubble hr { border: none; border-top: 1px solid var(--line); margin: 8px 0; }
.msg.ai .bubble del { color: var(--muted); }
.msg-v { display: flex; flex-direction: column; gap: 3px; }
.msg-v.ai { align-items: flex-start; }
.msg-time { font-size: 11px; color: #a9b4cc; padding: 0 4px; }
.msg.user .msg-time { text-align: right; margin-left: auto; }

.copy-bubble {
  border: none; background: transparent; color: var(--muted);
  font-size: 12px; cursor: pointer; padding: 5px 10px; border-radius: 999px; flex-shrink: 0;
  opacity: 0.92; margin: 0 0 4px 2px;
  transition: background 0.12s ease, color 0.12s ease;
}
.copy-bubble:hover { background: var(--sky); color: var(--blue); }
/* ---------- 消息操作行 + 日期分隔 + 停止按钮 ---------- */
.msg-actions { display: flex; align-items: center; gap: 1px; margin-top: 4px; padding: 0 2px; width: 100%; }
.msg-act { width: 26px; height: 24px; border: none; background: transparent; color: #9aa9c6; display: inline-flex; align-items: center; justify-content: center; border-radius: 7px; cursor: pointer; transition: color .12s ease, background .12s ease; }
.msg-act svg { width: 15px; height: 15px; }
.msg-act-last { margin-left: auto; }
.msg-act:hover { background: var(--sky-soft); color: #6B8CBF; }
.msg-act.active { color: #4D6BFE; }
/* ---------- 思考过程（可折叠） ---------- */
.thinking { margin-bottom: 6px; }
.thinking-summary { cursor: pointer; display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); background: rgba(255,255,255,0.5); border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; list-style: none; user-select: none; font-family: inherit; }
.thinking-summary::-webkit-details-marker { display: none; }
.thinking-summary::marker { content: ""; }
.thinking-time { color: #9aa9c6; }
.thinking-chev { display: inline-flex; align-items: center; justify-content: center; transition: transform 0.2s ease; }
.thinking[open] .thinking-chev { transform: rotate(180deg); }
.thinking-body { margin-top: 6px; font-size: 13px; color: #8b96af; line-height: 1.6; background: rgba(255,255,255,0.4); border-radius: 12px; padding: 10px 12px; white-space: pre-wrap; word-break: break-word; max-height: 220px; overflow-y: auto; }
.thinking-body::-webkit-scrollbar { width: 5px; }
.day-divider { display: flex; align-items: center; gap: 10px; margin: 12px 0 6px; }
.day-divider::before, .day-divider::after { content: ""; flex: 1; height: 1px; background: #b4c6dd; }
.day-divider span { background: rgba(255,255,255,0.42); color: var(--muted); font-size: 12px; padding: 3px 12px; border-radius: 999px; box-shadow: 0 2px 8px rgba(60,90,160,0.08); flex-shrink: 0; }
.send-btn.stop { background: linear-gradient(135deg, #f08a8a, #e05a5a); box-shadow: 0 4px 12px rgba(224,90,90,0.3); }
.retry-hint { display: flex; align-items: center; gap: 8px; justify-content: flex-end; padding: 4px 6px 4px 0; }
.retry-label { font-size: 12px; color: #e05a5a; }
.retry-btn { border: 1px solid #f0c4c4; background: #fff; color: #e05a5a; font-size: 12px; padding: 4px 12px; border-radius: 999px; cursor: pointer; transition: background .12s ease, border-color .12s ease; }
.retry-btn:hover { background: #fdecec; border-color: #e8a9a9; }


.bubble.typing { display: inline-flex; gap: 5px; align-items: center; padding: 14px 18px; }
.bubble.typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite both; }
.bubble.typing span:nth-child(2) { animation-delay: 0.2s; }
.bubble.typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes blink { 0%, 80%, 100% { opacity: 0.25; } 40% { opacity: 1; } }

.notice {
  margin: 10px 16px 0; padding: 10px 14px; border-radius: 14px;
  background: #fff7e6; border: 1px solid #ffe1a8; color: #8a5b00; font-size: 13px; line-height: 1.6;
  flex-shrink: 0;
}

.welcome { margin: auto; text-align: center; color: var(--muted); padding: 20px 0; max-width: 340px; }
.welcome-logo {
  width: 62px; height: 62px; margin: 0 auto 16px; border-radius: 20px;
  background: linear-gradient(135deg, #9bc0f5, #4b8ef0); font-size: 30px;
  display: flex; align-items: center; justify-content: center; box-shadow: 0 8px 24px rgba(75,141,240,0.3);
}
.welcome h1 { color: var(--navy); font-size: 21px; margin: 0 0 8px; }
.welcome p { margin: 0; font-size: 14px; line-height: 1.7; }
.suggest { display: flex; flex-wrap: wrap; gap: 9px; justify-content: center; margin-top: 18px; }
.suggest button {
  border: 1px solid var(--line); background: #fff; color: var(--blue);
  padding: 9px 14px; border-radius: 999px; cursor: pointer; font-size: 12px; font-family: inherit;
  box-shadow: var(--shadow-sm); transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.suggest button:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }

/* 输入区 */
.composer { display: flex; flex-direction: column; align-items: stretch; gap: 8px; padding: 10px 14px 16px; flex-shrink: 0; }
.composer-row { display: flex; align-items: flex-end; gap: 10px; }
.composer-pending { display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 8px 10px; box-shadow: var(--shadow-sm); }
.pending-thumb { width: 46px; height: 46px; border-radius: 10px; background-size: cover; background-position: center; background-color: var(--sky); flex-shrink: 0; }
.pending-tip { flex: 1; font-size: 12px; color: var(--muted); }
.pending-x { width: 26px; height: 26px; border: none; border-radius: 50%; background: var(--sky); color: var(--muted); font-size: 16px; line-height: 1; cursor: pointer; flex-shrink: 0; }
.pending-x:hover { background: #fdecec; color: #e05a5a; }
.composer { transition: transform 0.28s ease; }
.composer.kj-open .upload-btn, .composer.kj-open .send-btn { display: none; }
.plus-btn {
  width: 40px; height: 40px; flex-shrink: 0; border: none; border-radius: 50%;
  background: #fff; color: var(--blue); font-size: 22px; cursor: pointer; box-shadow: var(--shadow-sm);
}
.composer textarea {
  flex: 1; resize: none; border: 1px solid var(--line); border-radius: 22px;
  padding: 12px 18px; font-size: 15px; font-family: inherit; line-height: 1.5; max-height: 140px;
  outline: none; background: #fff; color: var(--text); box-shadow: var(--shadow-sm);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.composer textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(75,141,240,0.15); }
.send-btn {
  width: 42px; height: 42px; flex-shrink: 0; border: none; border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), var(--blue-deep));
  color: #fff; font-size: 17px; cursor: pointer; box-shadow: 0 4px 12px rgba(75,141,240,0.3);
  display: flex; align-items: center; justify-content: center;
}
.send-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---------- 回忆网格 ---------- */
.memory-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.mem-card {
  background: #fff; border-radius: 20px; padding: 16px; cursor: pointer;
  box-shadow: var(--shadow-sm); transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.mem-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.mem-ico {
  width: 40px; height: 40px; border-radius: 13px; background: var(--sky);
  display: flex; align-items: center; justify-content: center; font-size: 20px; margin-bottom: 12px;
}
.mem-title { font-size: 15px; font-weight: 800; color: var(--navy); }
.mem-sub { font-size: 12px; color: var(--muted); margin-top: 5px; }
.mem-empty { grid-column: 1 / -1; color: var(--muted); font-size: 13px; text-align: center; padding: 40px 0; }

/* ---------- 占位页 ---------- */
.placeholder { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 30px; }
.placeholder-icon { font-size: 54px; }
.placeholder-title { font-size: 20px; font-weight: 800; color: var(--navy); margin-top: 16px; }
.placeholder-sub { font-size: 14px; color: var(--muted); margin-top: 8px; max-width: 260px; line-height: 1.7; }

/* ---------- 底部标签栏 ---------- */
.tabbar {
  display: flex; align-items: flex-end; justify-content: space-around;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
  border-radius: 24px 24px 0 0;
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
  box-shadow: 0 -8px 24px rgba(60,90,160,0.10);
  flex-shrink: 0;
  position: relative;
  z-index: 5;
}
.tab {
  border: none; background: none; cursor: pointer; color: #9aa7c2;
  display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11px; font-weight: 600;
  padding: 2px 6px; font-family: inherit;
}
.tab-ico { font-size: 20px; }
.tab.active { color: var(--blue); }
.tab-center { position: relative; top: -16px; }
.tab-fab {
  width: 52px; height: 52px; border-radius: 50%;
  background: linear-gradient(135deg, #6ea7f5, #3366d6);
  color: #fff; font-size: 22px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 20px rgba(51,102,214,0.4);
}
.tab-fab-lbl { color: var(--navy); font-weight: 800; margin-top: 2px; }

/* ---------- 弹窗 ---------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(20, 40, 80, 0.4);
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; z-index: 70; padding: 20px;
}
.modal { background: #fff; border-radius: 20px; padding: 22px; width: 100%; max-width: 340px; box-shadow: var(--shadow-md); animation: msg-in 0.18s ease both; }
.modal h3 { margin: 0 0 10px; color: var(--navy); font-size: 17px; }
.modal-text { margin: 0 0 14px; font-size: 14px; color: var(--muted); line-height: 1.7; word-break: break-word; }
.modal-input { width: 100%; border: 1px solid var(--line); border-radius: 14px; padding: 11px 14px; font-size: 15px; font-family: inherit; outline: none; margin-bottom: 16px; }
.modal-textarea { resize: vertical; min-height: 96px; line-height: 1.6; }
.modal-input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(75,141,240,0.15); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; }
.primary-btn {
  border: none; background: linear-gradient(135deg, var(--blue), var(--blue-deep)); color: #fff;
  font-size: 14px; font-weight: 600; padding: 9px 20px; border-radius: 999px; cursor: pointer;
}
.primary-btn.danger { background: linear-gradient(135deg, #e05a5a, #c93a3a); }
.primary-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.ghost-btn { border: 1px solid var(--line); background: #fff; color: #3a4a6b; font-size: 13px; padding: 7px 13px; border-radius: 999px; cursor: pointer; }
.ghost-btn:hover { background: var(--sky); color: var(--blue); }

/* ---------- 轻提示 ---------- */
.toast {
  position: fixed; left: 50%; bottom: 100px; transform: translateX(-50%);
  background: rgba(30, 48, 90, 0.92); color: #fff; padding: 9px 18px; border-radius: 999px;
  font-size: 13px; z-index: 100; pointer-events: none; opacity: 0; transition: opacity 0.25s ease;
}
.toast.show { opacity: 1; }

.hidden { display: none !important; }

/* ---------- 手机 ---------- */
@media (max-width: 720px) {
  #app { box-shadow: none; }
}
/* 消息列与时间 */
.msg-v { display: flex; flex-direction: column; gap: 4px; }
.msg-v.ai { align-items: flex-start; }
.msg-v.user { align-items: flex-end; }
.msg-meta { display: flex; align-items: center; gap: 6px; }
.msg.user .msg-meta { justify-content: flex-start; width: 100%; gap: 1px; }
.msg-edit { width: 24px; height: 22px; }
.msg-edit svg { width: 14px; height: 14px; }
/* ---------- 抽屉：新建对话 + 会话列表 ---------- */
.drawer-newbtn {
  width: 100%;
  border: none;
  background: linear-gradient(135deg, var(--blue), var(--blue-deep));
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  padding: 12px 0;
  border-radius: 16px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(51,102,214,0.28);
  transition: filter 0.12s ease, transform 0.12s ease;
}
.drawer-newbtn:hover { filter: brightness(1.06); transform: translateY(-1px); }
.drawer-hint { color: var(--muted); font-size: 13px; text-align: center; padding: 20px 0; }
.session-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 14px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}
.session-item:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: #cdddff; }
.session-item.active { background: var(--sky); border-color: #b7d0f8; }
.session-item .s-title { flex: 1; min-width: 0; font-size: 15px; font-weight: 800; color: var(--navy); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: left; }
.session-item .s-meta { font-size: 12px; color: var(--muted); text-align: left; }

/* ---------- 上传按钮（输入框左侧） ---------- */
.upload-btn {
  width: 40px; height: 40px; flex-shrink: 0;
  border: none; border-radius: 50%;
  background: #fff; color: var(--blue); font-size: 18px;
  cursor: pointer; box-shadow: var(--shadow-sm);
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.upload-btn:hover { transform: scale(1.06); box-shadow: var(--shadow-md); }
.upload-btn input { display: none; }

/* ---------- 聊天中的图片缩略图 ---------- */
.msg img {
  display: block;
  max-width: 220px;
  max-height: 220px;
  border-radius: 12px;
  margin-top: 6px;
  box-shadow: var(--shadow-sm);
}





/* ---------- 底部导航：更窄的悬浮胶囊 ---------- */
#tabbar {
  margin: 0 16px calc(10px + env(safe-area-inset-bottom));
  border-radius: 24px;
  transition: height 0.28s ease, margin 0.28s ease, border-radius 0.28s ease;
}
#tabbar .tab { transition: opacity 0.2s ease; }

/* 聊天页收起：再小一点、圆钮再往下、隐藏文字 */
#app.nav-collapsed #tabbar { height: 46px; margin-bottom: 6px; padding-bottom: 4px; }
#app.nav-collapsed #tabbar .tab:not(.tab-center) { opacity: 0; pointer-events: none; }
#app.nav-collapsed #tabbar .tab-center { top: 0; }
#app.nav-collapsed #tabbar .tab-fab-lbl { display: none; }
.composer { padding-bottom: calc(26px + env(safe-area-inset-bottom)); }

/* ---------- 导航栏更紧凑、圆钮下调 ---------- */
#tabbar { padding: 6px 10px calc(6px + env(safe-area-inset-bottom)); }
.tab-ico { font-size: 18px; }
.tab-lbl { font-size: 10px; }
.tab-center { top: -9px; }
.tab-fab { width: 48px; height: 48px; font-size: 20px; }
#app.nav-collapsed #tabbar { height: 44px; }

/* ---------- 修复：气泡宽度，防止中文单字竖排 ---------- */
.msg-v { max-width: 76%; min-width: 0; }
.msg-v .bubble { max-width: 100%; }
.msg-v.user { align-items: flex-end; }

/* ---------- 隐藏输入框的缩放把手与滚动条 ---------- */
.composer textarea { resize: none; scrollbar-width: none; }
.composer textarea::-webkit-resizer { display: none; }
.composer textarea::-webkit-scrollbar { width: 0; height: 0; }

/* ---------- 标签栏 SVG 图标 ---------- */
.tab-ico svg { display: block; margin: 0 auto; }

/* ---------- 主页 Lottie 图标容器 ---------- */
#homeIcon { width: 22px; height: 22px; display: block; }
#homeIcon svg { width: 22px; height: 22px; }

/* ---------- 选中标签用 #4D6BFE，主页 Lottie 跟随 currentColor ---------- */
.tab.active { color: #4D6BFE; }
#homeIcon { color: inherit; }
#homeIcon svg path, #homeIcon svg g { fill: currentColor !important; }

/* ---------- 标签 SVG 图标垂直居中 ---------- */
.tab-fab svg { display: block; }

/* ---------- 标签图标：点一下弹一下 ---------- */
@keyframes icon-pop { 0% { transform: scale(1); } 30% { transform: scale(1.25); } 52% { transform: scale(1.25); } 100% { transform: scale(1); } }
.tab-ico.pop, .tab-fab.pop { animation: icon-pop 0.44s ease; }

/* ---------- 未选中 #6B8CBF；Chat 圆钮跟随选中态 ---------- */
.tab { color: #6B8CBF; }
.tab-fab { background: #eef2f9; color: #6B8CBF; box-shadow: 0 4px 10px rgba(107,140,191,0.15); }
.tab.active .tab-fab { background: linear-gradient(135deg, #6ea7f5, #3366d6); color: #fff; box-shadow: 0 8px 20px rgba(51,102,214,0.4); }

/* Chat 未选中：灰色描边；选中去掉描边 */
.tab-fab { outline: 2px solid #6B8CBF; }
.tab.active .tab-fab { outline: none; }

/* ---------- 隐藏标签文字（预览） ---------- */
.tab-lbl, .tab-fab-lbl { display: none; }


/* ============ 无障碍 & 动效规范 ============ */
:root { color-scheme: light; }
html, body { overflow-x: hidden; }
body { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
button, .tab, .upload-btn, .drawer-item, .session-item, textarea, input { touch-action: manipulation; }

/* 键盘焦点可见 */
button:focus-visible, .tab:focus-visible, textarea:focus-visible, input:focus-visible, [tabindex="0"]:focus-visible, a:focus-visible {
  outline: 2px solid #4D6BFE;
  outline-offset: 2px;
}

/* 弹窗/抽屉 滚动时阻止滚动穿透 */
.modal-mask, .drawer { overscroll-behavior: contain; }

/* 会话项作为 button 的重置 */
.session-item { appearance: none; -webkit-appearance: none; font: inherit; color: inherit; text-align: left; cursor: pointer; }

/* 标题防孤行 */
.welcome h1, .hero-title, .placeholder-title { text-wrap: balance; }

/* 尊重系统“减少动效” */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------- 底部图标：统一尺寸 + 视觉平衡 ---------- */
#tabbar .tab-ico svg { width: 20px !important; height: 20px !important; transform-origin: center; }
.tab[data-tab="home"] .tab-ico svg { transform: scale(1.1); }
.tab[data-tab="memory"] .tab-ico svg { transform: scale(1.0); }
.tab[data-tab="together"] .tab-ico svg { transform: scale(0.9); }
.tab[data-tab="mine"] .tab-ico svg { transform: scale(1.26); }

/* ---------- 上传按钮：固定 #6B8CBF，无变色无缩放 ---------- */
.upload-btn { color: #6B8CBF; }
.upload-btn:hover { transform: none; }

/* ---------- 重要的日子：编辑表单 & 卡片 ---------- */
.day-row { display: flex; gap: 10px; margin-bottom: 16px; }
.day-field { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.day-lbl { font-size: 12px; color: var(--muted); }
.day-select { width: 100%; border: 1px solid var(--line); border-radius: 13px; padding: 10px 12px; font-size: 14px; font-family: inherit; background: #fff; color: var(--text); outline: none; }
.day-select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(77,107,254,.14); }
.day-del { margin-left: 8px; border: none; background: none; color: var(--muted); cursor: pointer; font-size: 13px; padding: 2px 6px; border-radius: 8px; }
.day-del:hover { background: #fdeeee; color: var(--danger); }
.day-empty { color: var(--muted); font-size: 13px; text-align: center; padding: 24px 0; }

/* ---------- 重要的日子：⋯ 菜单 ---------- */
.more-btn { border: none; background: transparent; color: var(--muted); cursor: pointer; padding: 2px 4px; border-radius: 8px; margin-left: 6px; line-height: 0; vertical-align: middle; }
.more-btn:hover { background: var(--sky); color: var(--blue); }
.day-pin { display: inline-flex; vertical-align: middle; margin-right: 4px; }
.menu-mask { position: fixed; inset: 0; background: transparent; z-index: 80; }
.day-menu { position: fixed; z-index: 90; background: #fff; border-radius: 14px; box-shadow: var(--shadow-md); padding: 6px; width: 150px; }
.day-menu-item { display: flex; align-items: center; gap: 9px; width: 100%; border: none; background: transparent; color: var(--text); font-size: 14px; padding: 9px 10px; border-radius: 10px; cursor: pointer; font-family: inherit; text-align: left; }
.day-menu-item svg { flex-shrink: 0; }
.day-menu-item:hover { background: var(--sky-soft); }
.day-menu-item.danger { color: var(--danger); }
.day-menu-item.danger:hover { background: #fdeeee; }

/* ---------- 模型切换按钮 & 菜单 ---------- */
.model-btn { display: inline-flex; align-items: center; justify-content: center; border: none; background: transparent; padding: 0; width: 38px; height: 38px; border-radius: 50%; box-shadow: none; cursor: pointer; font-family: inherit; }
.model-logo { width: 38px; height: 38px; border-radius: 50%; background: #fff; color: #6B8CBF; font-size: 18px; font-weight: 500; display: inline-flex; align-items: center; justify-content: center; box-shadow: var(--shadow-sm); transition: transform 0.12s ease; }
.model-btn:hover .model-logo { transform: scale(1.06); }
.model-name { display: none; }
.model-sub { display: block; font-size: 11px; color: var(--muted); font-weight: 400; margin-top: 2px; }

/* ---------- 抽屉会话行 · 日期在外 + 卡片 ---------- */
.session-block { display: flex; flex-direction: column; gap: 2px; }
.s-date { font-size: 11px; color: var(--muted); text-align: left; padding-left: 2px; }
.session-item { position: relative; display: flex; flex-direction: row; align-items: center; justify-content: space-between; gap: 10px; }
.sess-more { border: none; background: transparent; color: var(--muted); cursor: pointer; padding: 4px; border-radius: 8px; line-height: 0; flex-shrink: 0; }
.sess-more:hover { background: var(--sky); color: var(--blue); }
.session-pin { display: inline-flex; vertical-align: middle; margin-right: 4px; }

/* 非聊天页：顶部中间显示品牌名（隐藏会话名） */
#topbar:not(.chat-on) .top-session { display: none; }
#topbar:not(.chat-on) .top-brand { font-size: 17px; font-weight: 800; color: var(--navy); opacity: 1; }

/* ---------- 上传小面板（微信式一排） ---------- */
.upload-panel { position: fixed; z-index: 90; background: #fff; border-radius: 18px; box-shadow: var(--shadow-md); padding: 12px 14px; display: flex; gap: 14px; }
.up-item { display: flex; flex-direction: column; align-items: center; gap: 7px; border: none; background: transparent; cursor: pointer; font-family: inherit; padding: 4px; border-radius: 12px; }
.up-item:hover { background: var(--sky-soft); }
.up-ico { width: 50px; height: 50px; border-radius: 14px; background: #f2f6fc; color: var(--text); display: flex; align-items: center; justify-content: center; }
.up-lbl { font-size: 12px; color: var(--text); }

/* ---------- 上传小面板：从底部滑入（微信式） ---------- */
.upload-panel {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 90;
  background: #fff;
  border-radius: 24px 24px 0 0;
  padding: 18px 16px calc(20px + env(safe-area-inset-bottom));
  box-shadow: 0 -10px 40px rgba(60, 90, 160, 0.16);
  display: flex; justify-content: center; gap: 22px;
  transform: translateY(105%);
  transition: transform 0.28s ease;
}
.upload-panel.open { transform: translateY(0); }
#uploadMenuMask:not(.hidden) { background: rgba(20, 40, 80, 0.35); }

/* ---------- 颜文字抽屉 ---------- */
.kaomoji-panel {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 95;
  background: #fff; border-radius: 24px 24px 0 0;
  box-shadow: 0 -10px 40px rgba(60, 90, 160, 0.18);
  padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
  max-height: 70%;
  display: flex; flex-direction: column;
  transform: translateY(105%);
  transition: transform 0.28s ease;
}
.kaomoji-panel.open { transform: translateY(0); }
#kaomojiMask:not(.hidden) { background: transparent; }
.kj-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 8px; }
.kj-title { font-size: 17px; font-weight: 800; color: var(--navy); }
.kj-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.kj-cats { display: flex; gap: 8px; overflow-x: auto; padding: 6px 0 12px; }
.kj-cat { border: none; background: #f2f6fc; color: var(--text); padding: 7px 14px; border-radius: 999px; font-size: 13px; cursor: pointer; font-family: inherit; white-space: nowrap; }
.kj-cat.active { background: #4D6BFE; color: #fff; }
.kj-grid { flex: 1; overflow-y: auto; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 4px 0 12px; align-content: start; }
.kj-item { border: 1px solid var(--line); background: #fff; border-radius: 14px; padding: 14px 10px; font-size: 14px; text-align: center; cursor: pointer; color: var(--text); font-family: inherit; white-space: pre-wrap; word-break: break-word; }
.kj-item:hover { background: var(--sky-soft); border-color: #b7d0f8; }
.kj-input-row { display: flex; gap: 10px; align-items: center; border-top: 1px solid var(--line); padding-top: 12px; }
.kj-input { flex: 1; border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; font-size: 14px; font-family: inherit; outline: none; }
.kj-input:focus { border-color: #4D6BFE; }


/* ---------- 我的 ---------- */
#view-mine .mine-page { flex: 1; overflow-y: auto; padding: 30px 16px 40px; display: flex; flex-direction: column; gap: 16px; }
.profile-card { display: flex; align-items: center; gap: 16px; background: var(--card); border-radius: 22px; padding: 18px; box-shadow: var(--shadow-sm); }
.avatar-btn { position: relative; width: 72px; height: 72px; border-radius: 50%; border: 2px solid var(--line); background: var(--sky); padding: 0; cursor: pointer; flex-shrink: 0; overflow: hidden; }
.avatar-img { position: absolute; inset: 0; background-size: cover; background-position: center; border-radius: 50%; }
.avatar-edit { position: absolute; right: -2px; bottom: -2px; width: 26px; height: 26px; border-radius: 50%; background: #4D6BFE; color: #fff; font-size: 13px; display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow-sm); }
.profile-info { min-width: 0; }
.profile-name { font-size: 20px; font-weight: 800; color: var(--navy); }
.profile-sub { font-size: 13px; color: var(--muted); margin-top: 4px; }
.mine-list { display: flex; flex-direction: column; gap: 10px; }
.mine-item { display: flex; align-items: center; gap: 14px; width: 100%; border: 1px solid var(--line); background: var(--card); border-radius: 18px; padding: 14px 16px; cursor: pointer; text-align: left; font-family: inherit; color: inherit; box-shadow: var(--shadow-sm); transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease; }
.mine-item:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: #cdddff; }
.mine-ico { width: 40px; height: 40px; border-radius: 13px; background: var(--sky); display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0; }
.mine-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.mine-title { font-size: 15px; font-weight: 700; color: var(--navy); }
.mine-sub { font-size: 12px; color: var(--muted); }
.mine-badge { font-size: 11px; color: #6B8CBF; background: var(--sky-soft); padding: 3px 9px; border-radius: 999px; flex-shrink: 0; }
.mine-version { text-align: center; font-size: 12px; color: var(--muted); margin-top: 8px; }


/* ---------- 我的：头像管理 ---------- */
#view-mine .mine-page { flex: 1; overflow-y: auto; padding: 30px 16px 40px; display: flex; flex-direction: column; gap: 4px; }
.mine-head { margin-bottom: 4px; }
.mine-head-title { font-size: 22px; font-weight: 800; color: var(--navy); }
.mine-head-sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
.mine-section {
  margin-top: 14px;
  background: var(--card);
  border: 1px solid #eef3fb;
  border-radius: 16px;
  padding: 14px 16px;
}
.mine-section-head { padding: 0; }
.mine-section:not(.collapsed) .mine-section-body { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 12px; }
.mine-sub { font-size: 12px; color: var(--muted); margin: 4px 0 10px; }
.avatar-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 8px 0 14px; }
.avatar-card { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 16px; box-shadow: var(--shadow-sm); }
.avatar-big { position: relative; width: 110px; height: 110px; border-radius: 26px; background: var(--sky); background-size: cover; background-position: center; display: flex; align-items: center; justify-content: center; margin: 0 auto; }
.avatar-placeholder { font-size: 34px; }
.avatar-card-name { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 15px; font-weight: 700; color: var(--navy); margin: 8px 0 10px; }
.avatar-action { display: block; width: 100%; border: 1px solid #cfe0f8; background: #fff; color: #3366d6; font-size: 13px; font-weight: 600; padding: 8px 0; border-radius: 12px; cursor: pointer; margin-top: 8px; font-family: inherit; }
.avatar-action:hover { background: var(--sky-soft); }
.avatar-action.danger { border-color: #f3c9c9; color: #e05a5a; }
.avatar-action.danger:hover { background: #fdecec; }
.avatar-action.ghost { background: #fdf4f4; border-color: #f0d0d0; color: #c05050; margin-top: 12px; }
.avatar-show { display: flex; align-items: center; justify-content: space-between; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; margin-top: 6px; }
.avatar-show-label { font-size: 14px; font-weight: 600; color: var(--navy); }
.switch { width: 46px; height: 26px; border-radius: 999px; background: #d6e0ef; border: none; cursor: pointer; position: relative; flex-shrink: 0; transition: background 0.2s ease; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: transform 0.2s ease; }
.switch.on { background: #4D6BFE; }
.switch.on::after { transform: translateX(20px); }
.avatar.avatar-photo { background-size: cover; background-position: center; }
.avatar-user { background: #e3ecff; color: #3366d6; }


/* ---------- 我的：昵称 ---------- */
.profile-name-row { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.profile-name { font-size: 18px; font-weight: 800; color: var(--navy); }
.name-edit { border: none; background: transparent; color: #6B8CBF; cursor: pointer; padding: 4px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; }
.name-edit:hover { background: var(--sky); color: #4D6BFE; }
.name-input { font-size: 16px; font-weight: 700; color: var(--navy); border: 1px solid #4D6BFE; border-radius: 10px; padding: 6px 10px; width: 160px; font-family: inherit; outline: none; }

/* 主页头像支持图片 */
.hero-ava { background-size: cover; background-position: center; }


/* ---------- 我的：可折叠分栏 ---------- */
.mine-section-head { display: flex; align-items: center; justify-content: space-between; width: 100%; border: none; background: transparent; padding: 0; cursor: pointer; font-family: inherit; }
.mine-section-head .section-title { text-align: left; }
.mine-chev { display: inline-flex; align-items: center; justify-content: center; color: var(--muted); transition: transform 0.2s ease; }
.mine-section:not(.collapsed) .mine-chev { transform: rotate(180deg); }
.mine-section.collapsed .mine-section-body { display: none; }


/* ---------- 访问密码登录 ---------- */
.login-mask { position: fixed; inset: 0; z-index: 200; background: linear-gradient(175deg, #cfdcf7, #eef3fd); display: flex; align-items: center; justify-content: center; }
.login-mask.hidden { display: none; }
.login-card { width: 300px; max-width: 88%; background: #fff; border-radius: 22px; padding: 28px 24px; text-align: center; box-shadow: var(--shadow-md); }
.login-logo { font-size: 44px; }
.login-title { font-size: 20px; font-weight: 800; color: var(--navy); margin-top: 8px; }
.login-sub { font-size: 13px; color: var(--muted); margin: 4px 0 16px; }
.login-input { width: 100%; border: 1px solid var(--line); border-radius: 13px; padding: 11px 14px; font-size: 15px; font-family: inherit; outline: none; }
.login-input:focus { border-color: #4D6BFE; box-shadow: 0 0 0 3px rgba(77,107,254,.14); }
.login-btn { width: 100%; border: none; border-radius: 13px; padding: 11px 0; font-size: 15px; font-weight: 700; color: #fff; background: linear-gradient(135deg, #4b6bfe, #3366d6); cursor: pointer; margin-top: 12px; }
.login-btn:hover { filter: brightness(1.05); }
.login-err { color: #e05a5a; font-size: 13px; margin-top: 10px; }
.login-err.hidden { display: none; }


/* ---------- 回忆（记忆库） ---------- */
#view-memory .memory-page { flex: 1; overflow-y: auto; padding: 30px 16px 40px; display: flex; flex-direction: column; gap: 14px; }
.memory-head { position: relative; }
.memory-title { font-size: 22px; font-weight: 800; color: var(--navy); }
.memory-sub { font-size: 13px; color: var(--muted); margin-top: 3px; }
.memory-add { position: absolute; right: 0; top: 2px; border: none; background: linear-gradient(135deg, #4b6bfe, #3366d6); color: #fff; font-size: 13px; font-weight: 700; padding: 8px 14px; border-radius: 999px; cursor: pointer; }
.memory-toolbar { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; }
.mem-cat { border: 1px solid var(--line); background: #fff; color: var(--muted); font-size: 13px; padding: 7px 13px; border-radius: 999px; cursor: pointer; white-space: nowrap; }
.mem-cat.active { background: #4D6BFE; color: #fff; border-color: #4D6BFE; }
.memory-auto { display: flex; align-items: center; justify-content: space-between; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.memory-auto-label { font-size: 14px; font-weight: 600; color: var(--navy); }
.memory-list { flex: 1; overflow-y: auto; min-height: 0; display: flex; flex-direction: column; gap: 10px; padding-right: 2px; }
.memory-empty { color: var(--muted); font-size: 13px; text-align: center; padding: 28px 0; }
.memory-card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 14px 16px; box-shadow: var(--shadow-sm); }
.memory-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mem-cat-badge { font-size: 11px; color: #3366d6; background: var(--sky-soft); padding: 3px 9px; border-radius: 999px; }
.mem-cat-badge.basic { color: #4b8df0; }
.mem-cat-badge.preference { color: #8a6dd6; background: #f1ecfb; }
.mem-cat-badge.emotion { color: #d67a9a; background: #fbeef3; }
.mem-cat-badge.important { color: #e0a23d; background: #fdf4e3; }
.memory-card-actions { display: flex; gap: 2px; }
.mem-action { border: none; background: transparent; color: var(--muted); cursor: pointer; padding: 4px; border-radius: 8px; font-size: 15px; line-height: 1; }
.mem-action:hover { background: var(--sky); }
.memory-card-content { margin-top: 8px; font-size: 15px; color: var(--text); line-height: 1.6; word-break: break-word; }
.memory-card-meta { font-size: 12px; color: var(--muted); margin-top: 8px; }
.fav-tagline { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.note-title { font-size: 15px; font-weight: 700; color: var(--navy); margin-bottom: 4px; }
.note-text { font-size: 14px; color: var(--text); line-height: 1.6; white-space: pre-wrap; word-break: break-word; }

/* ---------- 来过（使用统计） ---------- */
#visitsPage .memory-page { overflow-y: auto; }
#visitsPage .memory-list { flex: none; }
.visits-today { display: flex; gap: 10px; }
.visit-stat { flex: 1; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 12px 6px; text-align: center; }
.visit-num { font-size: 24px; font-weight: 800; color: var(--blue); line-height: 1.15; }
.visit-lbl { font-size: 11px; color: var(--muted); margin-top: 4px; }
.visits-section-title { font-size: 13px; font-weight: 700; color: var(--navy); margin: 4px 0 -2px; }
.visits-chart { display: flex; align-items: flex-end; gap: 8px; height: 118px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 12px 10px 8px; }
.vc-col { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; }
.vc-bar { width: 100%; max-width: 22px; background: linear-gradient(180deg, #6ea7f5, #4b8df0); border-radius: 6px 6px 3px 3px; min-height: 4px; flex-shrink: 0; }
.vc-lbl { font-size: 10px; color: var(--muted); }
#visitsList .memory-month-label { display: inline-flex; align-items: baseline; }
#visitsList .vm-rest { color: var(--muted); font-weight: 400; }
.visit-row { display: flex; align-items: center; justify-content: space-between; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; }
.visit-row-time { font-size: 13px; color: var(--navy); }
.visit-row-dur { font-size: 12px; color: var(--muted); }

/* 记忆弹窗 */
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.modal-title { font-size: 17px; font-weight: 800; color: var(--navy); }
.modal-body { display: flex; flex-direction: column; gap: 12px; }
.modal-foot { display: flex; justify-content: flex-end; margin-top: 16px; }
.mem-content { width: 100%; border: 1px solid var(--line); border-radius: 13px; padding: 10px 12px; font-size: 14px; font-family: inherit; resize: none; outline: none; }
.mem-content:focus { border-color: #4D6BFE; box-shadow: 0 0 0 3px rgba(77,107,254,.14); }


/* ---------- 回忆：宫格落地页 ---------- */
#view-memory .memory-grid-page { flex: 1; overflow-y: auto; padding: 20px 16px; display: flex; flex-direction: column; gap: 6px; }
#view-memory .memory-grid-page[hidden] { display: none; }
#view-memory .memory-detail-page { flex: 1; display: flex; flex-direction: column; min-height: 0; }
#view-memory .memory-detail-page[hidden] { display: none; }
.memory-detail-page .memory-page { flex: 1; overflow: hidden; padding: 20px 16px; display: flex; flex-direction: column; gap: 12px; }
.memory-grid-head { margin-bottom: 6px; }
.memory-grid-title { font-size: 22px; font-weight: 800; color: var(--navy); }
.memory-grid-sub { font-size: 13px; color: var(--muted); margin-top: 3px; }
.memory-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.memory-tile { position: relative; display: flex; flex-direction: column; align-items: flex-start; text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 16px; box-shadow: var(--shadow-sm); cursor: pointer; font-family: inherit; color: inherit; }
.memory-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: #cdddff; }
.memory-tile[data-demo] { opacity: 0.72; }
.mt-ico { width: 40px; height: 40px; border-radius: 13px; background: var(--sky); display: flex; align-items: center; justify-content: center; font-size: 20px; margin-bottom: 10px; }
.mt-title { font-size: 15px; font-weight: 700; color: var(--navy); }
.mt-sub { font-size: 12px; color: var(--muted); margin-top: 3px; }
.mt-arrow { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: #b9c6e0; font-size: 22px; }

/* ---------- 回忆：子页头部 ---------- */
.memory-head { position: static; display: flex; align-items: center; gap: 10px; }
.memory-back { width: 34px; height: 34px; border: none; border-radius: 50%; background: #edf3fd; color: #8297bd; font-size: 22px; cursor: pointer; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.memory-head-main { flex: 1; min-width: 0; }
.memory-head-main .memory-title { margin: 0; }
.memory-head-main .memory-sub { margin-top: 2px; }
.memory-head .memory-add { position: static; flex-shrink: 0; }


/* ---------- 回忆：搜索 + 月份分组 ---------- */
.memory-search { position: relative; display: flex; align-items: center; }
.memory-search-ico { position: absolute; left: 13px; color: var(--muted); pointer-events: none; }
.memory-search-input { width: 100%; border: 1px solid var(--line); border-radius: 13px; padding: 10px 14px 10px 38px; font-size: 14px; font-family: inherit; background: #fff; color: var(--text); outline: none; }
.memory-search-input:focus { border-color: #4D6BFE; box-shadow: 0 0 0 3px rgba(77,107,254,.14); }
.memory-month { margin-bottom: 8px; }
.memory-month-head { display: flex; align-items: center; justify-content: space-between; width: 100%; border: none; border-bottom: 1px solid #d8e3f4; background: transparent; padding: 6px 0 8px; cursor: pointer; font-family: inherit; }
.memory-month-label { font-size: 14px; font-weight: 800; color: var(--navy); }
.memory-month-chev { display: inline-flex; align-items: center; justify-content: center; color: var(--muted); transition: transform 0.2s ease; }
.memory-month:not(.collapsed) .memory-month-chev { transform: rotate(180deg); }
.memory-month.collapsed .memory-month-body { display: none; }
.memory-month-body { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }


/* ---------- 记忆：整理重复 ---------- */
.memory-consolidate { display: block; width: 100%; border: 1px solid var(--line); background: var(--card); color: var(--muted); font-size: 13px; font-weight: 600; padding: 9px 0; border-radius: 12px; cursor: pointer; font-family: inherit; }
.memory-consolidate:hover { background: var(--sky-soft); color: var(--blue); }
.memory-consolidate:disabled { opacity: .6; cursor: not-allowed; }


/* ---------- 我的：AI 人设 ---------- */
.persona-input { width: 100%; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; font-size: 14px; font-family: inherit; resize: vertical; min-height: 110px; outline: none; background: #fff; color: var(--text); line-height: 1.6; }
.persona-input:focus { border-color: #4D6BFE; box-shadow: 0 0 0 3px rgba(77,107,254,.14); }
.persona-save { display: block; width: 100%; margin-top: 10px; border: none; background: linear-gradient(135deg, #4b6bfe, #3366d6); color: #fff; font-size: 14px; font-weight: 700; padding: 11px 0; border-radius: 13px; cursor: pointer; }
.persona-save:hover { filter: brightness(1.05); }


/* ---------- SVG 图标统一尺寸 ---------- */
.mem-action svg { width: 16px; height: 16px; }
.mt-ico svg { width: 22px; height: 22px; }
.mine-ico svg { width: 20px; height: 20px; }
.mine-ico { color: #4b8df0; }


/* ---------- 消息：上传图片小标签卡片 ---------- */
.msg-file-tag { display: inline-flex; align-items: center; gap: 8px; background: rgba(255,255,255,0.4); border: 1px solid rgba(255,255,255,0.6); border-radius: 12px; padding: 6px 10px 6px 6px; margin-bottom: 4px; opacity: 0.55; color: var(--muted); }
.msg-file-tag.user { align-self: flex-end; }
.msg-file-thumb { width: 34px; height: 34px; border-radius: 8px; background-size: cover; background-position: center; flex-shrink: 0; }
.msg-file-label { font-size: 12px; color: var(--muted); }


/* 流式：吐泡泡中提示更浅 */
.bubble.streaming-hint { color: #aebad2; }

/* 颜文字：删除 / 加入库 / 自定义 */
.kj-item { position: relative; display: flex; align-items: center; justify-content: center; padding: 0; overflow: hidden; }
.kj-item-main { flex: 1; border: none; background: transparent; color: var(--text); font-size: 14px; text-align: center; cursor: pointer; padding: 14px 10px; border-radius: 14px; font-family: inherit; }
.kj-del { position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border: none; background: rgba(0,0,0,0.06); color: var(--muted); font-size: 14px; line-height: 1; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity 0.15s ease; }
.kj-item:hover .kj-del { opacity: 1; }
.kj-del:hover { background: #fdecec; color: var(--danger); }
.kj-empty { color: var(--muted); font-size: 13px; text-align: center; padding: 26px 0; grid-column: 1 / -1; }
.kj-add { border: 1px solid var(--line); background: #f4f8ff; color: #3366d6; font-size: 13px; font-weight: 600; padding: 9px 12px; border-radius: 12px; cursor: pointer; white-space: nowrap; }
.kj-add:hover { background: var(--sky); }
