/* 小澜 · 阶段 0 样式 v2
   2026-11-15 晚：按参考图改版（立绘铺底、半透明气泡、分条消息、更像真人聊天）
   深海深色系；手机优先；单列布局 */

:root {
  --ink: #04121b;
  --ink-2: #061a24;
  --line: rgba(147, 214, 240, 0.16);
  --line-strong: rgba(147, 214, 240, 0.30);
  --text: #eef7fc;
  --dim: #a3c1d1;
  --faint: #6d92a4;
  --accent: #7fd0f0;
  --accent-2: #4aa6cf;
  --glass: rgba(10, 32, 44, 0.62);
  --glass-strong: rgba(7, 24, 33, 0.86);
  --bubble-her: rgba(16, 44, 60, 0.66);
  --bubble-her-line: rgba(140, 205, 235, 0.16);
  --bubble-me-a: #2f93c4;
  --bubble-me-b: #1b6285;
  --danger: #e07070;
  --avatar: none;
  --art: none;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
}

html { background: var(--ink); touch-action: pan-y; -webkit-text-size-adjust: 100%; }

body {
  position: relative;
  color: var(--text);
  background: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

/* 立绘铺底：暗化 + 轻模糊，聊天浮在上面 */
body::before {
  content: "";
  position: fixed;
  inset: -8%;
  background: var(--art) center 16% / cover no-repeat;
  filter: blur(13px) brightness(0.42) saturate(1.18);
  transform: scale(1.06);
  z-index: -2;
}

/* 压暗渐变，保证文字对比度 */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(130% 55% at 50% -12%, rgba(56, 148, 190, 0.30), transparent 62%),
    linear-gradient(180deg,
      rgba(3, 13, 20, 0.42) 0%,
      rgba(3, 13, 20, 0.62) 38%,
      rgba(2, 9, 14, 0.88) 82%,
      rgba(1, 6, 10, 0.96) 100%);
}

#app {
  height: 100dvh;
  display: flex;
  flex-direction: column;
  max-width: 780px;
  margin: 0 auto;
  position: relative;
}

/* ---------- 顶栏 ---------- */

.topbar {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: calc(12px + var(--safe-top)) 16px 11px;
  background: linear-gradient(180deg, rgba(3, 12, 18, 0.88), rgba(3, 12, 18, 0.28));
  position: relative;
  z-index: 5;
}

.me { display: flex; align-items: center; gap: 11px; min-width: 0; flex: 1; }

.avatar {
  width: 46px; height: 46px;
  border-radius: 50%;
  background-image: var(--avatar);
  background-size: cover;
  background-position: 50% 38%;
  background-color: #123245;
  background-repeat: no-repeat;
  border: 1px solid rgba(160, 226, 250, 0.45);
  box-shadow: 0 0 0 3px rgba(99, 184, 224, 0.12), 0 0 22px rgba(99, 184, 224, 0.28);
  flex: none;
}

.who { min-width: 0; }

.name {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.6px;
  color: #dff3fd;
  line-height: 1.25;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.5);
}

.sub {
  font-size: 11.5px;
  color: rgba(190, 226, 242, 0.62);
  letter-spacing: 0.3px;
}

.icon-btn {
  width: 40px; height: 40px;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: rgba(10, 34, 46, 0.55);
  backdrop-filter: blur(8px);
  color: var(--dim);
  font-size: 21px;
  line-height: 1;
  cursor: pointer;
  flex: none;
}
.icon-btn:active { background: rgba(20, 62, 82, 0.8); }

/* ---------- 菜单 ---------- */

.menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 14px;
  min-width: 176px;
  background: var(--glass-strong);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(126, 200, 227, 0.22);
  border-radius: 14px;
  padding: 6px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  z-index: 20;
}

.menu button {
  text-align: left;
  padding: 11px 13px;
  background: none;
  border: 0;
  color: var(--text);
  font-size: 14px;
  border-radius: 9px;
  cursor: pointer;
}
.menu button:hover, .menu button:active { background: rgba(99, 184, 224, 0.14); }

.hidden { display: none !important; }

/* ---------- 聊天区 ---------- */

.chat {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 18px 16px 10px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(99, 184, 224, 0.25) transparent;
}
.chat::-webkit-scrollbar { width: 5px; }
.chat::-webkit-scrollbar-thumb { background: rgba(99, 184, 224, 0.22); border-radius: 3px; }

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100%;
  padding: 12px 0 40px;
  text-align: center;
  animation: rise 0.9s ease both;
}

.hero {
  width: min(58vw, 232px);
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid rgba(190, 232, 248, 0.5);
  filter: drop-shadow(0 18px 48px rgba(0, 0, 0, 0.55)) drop-shadow(0 0 34px rgba(99, 184, 224, 0.22));
  animation: float 6s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}
@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.empty .hi {
  margin: 18px 0 4px;
  font-size: 16.5px;
  color: #dff3fd;
  letter-spacing: 0.8px;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.55);
}
.empty .hi-sub {
  margin: 0;
  font-size: 12.5px;
  color: rgba(180, 214, 230, 0.68);
}

/* ---------- 消息 ---------- */

.msg { display: flex; gap: 9px; margin: 14px 0 0; align-items: flex-start; animation: rise 0.3s ease both; }
.msg.me { justify-content: flex-end; }

.msg .avatar-sm {
  width: 34px; height: 34px;
  border-radius: 50%;
  background-image: var(--avatar);
  background-size: cover;
  background-position: 50% 38%;
  background-color: #123245;
  background-repeat: no-repeat;
  border: 1px solid rgba(160, 226, 250, 0.35);
  box-shadow: 0 0 14px rgba(0, 0, 0, 0.35);
  flex: none;
  margin-top: 1px;
}

/* 每条消息都有头像；自己的头像先给个占位「我」，以后可自定义 */
.msg.me .avatar-sm {
  background: linear-gradient(150deg, #2d5570, #16303f);
  background-image: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12.5px;
  color: rgba(212, 236, 249, 0.85);
  letter-spacing: 0;
}

.bubble {
  max-width: min(78%, 460px);
  padding: 10px 14px;
  border-radius: 6px 17px 17px 17px;
  background: var(--bubble-her);
  backdrop-filter: blur(9px);
  -webkit-backdrop-filter: blur(9px);
  border: 1px solid var(--bubble-her-line);
  font-size: 16px;
  line-height: 1.68;
  white-space: pre-wrap;
  word-break: break-word;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.26);
}

.msg.me .bubble {
  border-radius: 17px 17px 6px 17px;
  background: linear-gradient(160deg, var(--bubble-me-a), var(--bubble-me-b));
  border-color: rgba(158, 224, 250, 0.26);
  color: #f6fdff;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.30);
}

/* 时间分隔（QQ 那种中间的小灰字；断聊 10 分钟以上才出现） */
.time-div {
  display: flex;
  justify-content: center;
  margin: 16px 0 2px;
  font-size: 11.5px;
  letter-spacing: 0.5px;
  color: rgba(190, 226, 242, 0.52);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.5);
}

/* 未读消息提示（QQ 那种底部「∧ N 条新消息」） */
.unread {
  position: absolute;
  left: 50%;
  bottom: calc(84px + var(--safe-bottom));
  transform: translateX(-50%);
  z-index: 6;
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(22, 66, 88, 0.92);
  border: 1px solid rgba(150, 220, 250, 0.32);
  backdrop-filter: blur(10px);
  color: #dff3fd;
  font-size: 12.5px;
  letter-spacing: 0.3px;
  cursor: pointer;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.45);
  white-space: nowrap;
}
.unread:active { background: rgba(30, 84, 110, 0.95); }

/* 打字光标 / 三点 */

.cursor {
  display: inline-block;
  width: 2px;
  height: 1.05em;
  margin-left: 2px;
  vertical-align: -0.16em;
  background: var(--accent);
  animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.dots { display: inline-flex; gap: 4px; padding: 4px 1px; }
.dots i {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.35;
  animation: bounce 1.1s ease-in-out infinite;
}
.dots i:nth-child(2) { animation-delay: 0.15s; }
.dots i:nth-child(3) { animation-delay: 0.3s; }
@keyframes bounce {
  0%, 60%, 100% { transform: none; opacity: 0.35; }
  30% { transform: translateY(-3px); opacity: 0.9; }
}

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

.composer {
  padding: 9px 12px calc(9px + var(--safe-bottom));
  background: linear-gradient(0deg, rgba(2, 10, 15, 0.96), rgba(2, 10, 15, 0.70));
}

.composer-inner {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  background: rgba(12, 38, 52, 0.68);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(126, 200, 227, 0.20);
  border-radius: 21px;
  padding: 7px 8px 7px 15px;
  transition: border-color 0.2s;
}
.composer-inner:focus-within { border-color: rgba(143, 214, 242, 0.55); }

#input {
  flex: 1;
  resize: none;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 16px;
  line-height: 1.5;
  max-height: 128px;
  padding: 6px 0;
}
#input::placeholder { color: var(--faint); }

.send {
  flex: none;
  height: 38px;
  min-width: 64px;
  padding: 0 16px;
  border-radius: 19px;
  border: 1px solid rgba(158, 224, 250, 0.35);
  background: linear-gradient(180deg, #37a1d2, #1d6c90);
  color: #f4fdff;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 1px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(29, 108, 144, 0.45);
}
.send:disabled { opacity: 0.45; cursor: default; }
.send.stop {
  background: linear-gradient(180deg, #8a4a4a, #6d3838);
  border-color: rgba(224, 112, 112, 0.45);
}

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

.banner {
  margin: calc(8px + var(--safe-top)) 14px 0;
  padding: 9px 12px;
  border-radius: 11px;
  background: rgba(224, 112, 112, 0.14);
  border: 1px solid rgba(224, 112, 112, 0.35);
  backdrop-filter: blur(8px);
  color: #f4bcbc;
  font-size: 12.5px;
  line-height: 1.5;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(104px + var(--safe-bottom));
  transform: translateX(-50%);
  max-width: min(88vw, 420px);
  padding: 10px 16px;
  border-radius: 13px;
  background: rgba(9, 28, 38, 0.95);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(126, 200, 227, 0.30);
  color: var(--text);
  font-size: 13.5px;
  line-height: 1.5;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.55);
  z-index: 50;
  animation: rise 0.2s ease both;
}

/* ---------- 弹窗 ---------- */

.dlg {
  border: 1px solid rgba(126, 200, 227, 0.25);
  border-radius: 18px;
  padding: 0;
  background: #0a2431;
  color: var(--text);
  width: min(92vw, 440px);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}
.dlg::backdrop { background: rgba(2, 10, 15, 0.72); backdrop-filter: blur(4px); }

.dlg-body { padding: 20px 20px 16px; }

.dlg h2 {
  margin: 0 0 10px;
  font-size: 17px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.5px;
}

.dlg-hint {
  margin: 0 0 14px;
  font-size: 13px;
  line-height: 1.65;
  color: var(--dim);
}

.field { margin-bottom: 14px; }
.field label {
  display: block;
  font-size: 12.5px;
  color: var(--dim);
  margin-bottom: 6px;
  letter-spacing: 0.4px;
}
.field input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 11px;
  border: 1px solid rgba(126, 200, 227, 0.25);
  background: #071a24;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  outline: none;
}
.field input:focus { border-color: rgba(143, 214, 242, 0.6); }

.field-note {
  margin-top: 6px;
  font-size: 12px;
  color: var(--faint);
  line-height: 1.5;
}

.dlg-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
  margin-top: 6px;
}

.dlg-actions button {
  padding: 9px 14px;
  border-radius: 11px;
  border: 1px solid transparent;
  font-size: 13.5px;
  cursor: pointer;
  font-weight: 500;
}
.dlg-actions .primary {
  background: linear-gradient(180deg, #37a1d2, #1d6c90);
  border-color: rgba(158, 224, 250, 0.35);
  color: #f4fdff;
}
.dlg-actions .ghost {
  background: transparent;
  border-color: rgba(126, 200, 227, 0.25);
  color: var(--dim);
}
.dlg-actions .danger {
  background: rgba(224, 112, 112, 0.16);
  border-color: rgba(224, 112, 112, 0.45);
  color: #f4bcbc;
}

/* 宽屏（电脑上打开时收窄，像手机） */
@media (min-width: 820px) {
  body::before { inset: -10%; }
  #app { border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
}

@media (max-width: 380px) {
  .avatar { width: 42px; height: 42px; }
  .bubble { max-width: 82%; font-size: 15.5px; }
}

@media (prefers-reduced-motion: reduce) {
  .hero, .msg, .empty, .toast { animation: none !important; }
  .dots i { animation: none; }
  .hero { animation: none; }
}

/* ---------------- 记忆（阶段 1） ---------------- */

.mem-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 52vh;
  overflow-y: auto;
  margin: 4px 0 10px;
}

.mem-row {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(126, 200, 227, 0.18);
  background: rgba(12, 38, 52, 0.72);
}

.mem-text {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  word-break: break-word;
}

.mem-meta {
  margin-top: 4px;
  font-size: 11.5px;
  color: var(--faint);
}

.mem-acts {
  margin-top: 6px;
  display: flex;
  gap: 8px;
}

.mem-btn {
  padding: 4px 12px;
  font-size: 12.5px;
  border-radius: 9px;
  border: 1px solid rgba(126, 200, 227, 0.3);
  background: transparent;
  color: var(--dim);
  cursor: pointer;
}
.mem-btn:hover { color: var(--text); border-color: rgba(143, 214, 242, 0.55); }
.mem-btn-danger { color: #e9a4a4; border-color: rgba(224, 112, 112, 0.35); }

.mem-empty {
  margin: 6px 0 10px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--faint);
}

.memcard {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 2px 12px 10px 46px;
  padding: 8px 11px;
  border-radius: 12px;
  border: 1px dashed rgba(126, 200, 227, 0.3);
  background: rgba(12, 38, 52, 0.55);
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--dim);
}
.memcard-ico { flex: none; }
.memcard-text { flex: 1; word-break: break-word; }
.memcard-btn {
  flex: none;
  padding: 2px 8px;
  border-radius: 8px;
  border: 1px solid rgba(126, 200, 227, 0.3);
  background: transparent;
  color: var(--dim);
  font-size: 11.5px;
  cursor: pointer;
}

/* --- v2 双卡：命中卡（泡泡里浮上来的一张纸条） --- */

.memcard {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  animation: memcardIn 440ms cubic-bezier(0.2, 0.9, 0.25, 1.15) both;
}
.memcard--perm {
  border-style: solid;
  border-color: rgba(255, 214, 150, 0.38);
  background: linear-gradient(135deg, rgba(64, 48, 20, 0.5), rgba(20, 40, 54, 0.62));
  color: #f0dcb4;
}
.memcard--temp {
  border-color: rgba(126, 200, 227, 0.32);
}
.memcard-text { position: relative; z-index: 1; }
.memcard-ico, .memcard-btn { position: relative; z-index: 1; }

.memcard-bubbles {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
.memcard-bubbles::before,
.memcard-bubbles::after {
  content: "";
  position: absolute;
  bottom: -18px;
  border-radius: 50%;
  border: 1px solid rgba(143, 214, 242, 0.4);
  background: rgba(143, 214, 242, 0.08);
  animation: bubbleRise 6s linear infinite;
}
.memcard-bubbles::before {
  left: 14%;
  width: 9px;
  height: 9px;
  animation-duration: 5.2s;
}
.memcard-bubbles::after {
  left: 62%;
  width: 14px;
  height: 14px;
  animation-duration: 7.4s;
  animation-delay: 1.4s;
}
.memcard--perm .memcard-bubbles::before,
.memcard--perm .memcard-bubbles::after {
  border-color: rgba(255, 214, 150, 0.4);
  background: rgba(255, 214, 150, 0.07);
}

@keyframes memcardIn {
  from { opacity: 0; transform: translateY(9px) scale(0.97); filter: blur(1.5px); }
  to   { opacity: 1; transform: none; filter: none; }
}

@keyframes bubbleRise {
  0%   { transform: translateY(0) scale(0.7); opacity: 0; }
  12%  { opacity: 0.9; }
  100% { transform: translateY(-74px) scale(1.15); opacity: 0; }
}

/* --- v2 记忆页：两段（宝箱 / 随手记） --- */

.mem-actions { margin: 2px 0 8px; }

.mem-add {
  width: 100%;
  padding: 9px 12px;
  font-size: 13.5px;
  border-radius: 12px;
  border: 1px dashed rgba(255, 214, 150, 0.42);
  background: rgba(64, 48, 20, 0.28);
  color: #f0dcb4;
  cursor: pointer;
}
.mem-add:hover { border-color: rgba(255, 214, 150, 0.7); background: rgba(64, 48, 20, 0.42); }

.mem-sec { margin-bottom: 14px; }
.mem-sec--perm {
  padding: 10px 10px 2px;
  border-radius: 14px;
  border: 1px solid rgba(255, 214, 150, 0.22);
  background: linear-gradient(160deg, rgba(70, 52, 22, 0.32), rgba(12, 34, 46, 0.5));
}
.mem-sec-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 8px;
  margin-bottom: 8px;
}
.mem-sec-title {
  font-size: 13.5px;
  font-weight: 650;
  color: var(--text);
  letter-spacing: 0.2px;
}
.mem-sec--perm .mem-sec-title { color: #f0dcb4; }
.mem-sec-sub {
  font-size: 11.5px;
  color: var(--faint);
}
.mem-sec .mem-list { max-height: none; overflow: visible; margin: 0; }
/* 兼容旧结构：若页面仍用外层单个 .mem-list，保持可滚动 */
.mem-sec .mem-row { margin-bottom: 8px; }
.mem-row--perm { border-color: rgba(255, 214, 150, 0.26); background: rgba(56, 44, 22, 0.42); }
.mem-row--perm .mem-meta { color: rgba(240, 220, 180, 0.62); }
.mem-btn-keep { color: #f0d9a8; border-color: rgba(255, 214, 150, 0.4); }
.mem-btn-keep:hover { color: #ffe9c2; border-color: rgba(255, 214, 150, 0.7); }

@media (prefers-reduced-motion: reduce) {
  .memcard { animation: none !important; }
  .memcard-bubbles::before,
  .memcard-bubbles::after { animation: none !important; opacity: 0.5; }
}

/* --- v2.1 三种记忆卡样式 --- */

/* 设置里的三段选择 */
.seg {
  display: flex;
  gap: 6px;
  margin: 6px 0 2px;
}
.seg button {
  flex: 1;
  padding: 7px 4px;
  font-size: 12.5px;
  border-radius: 9px;
  border: 1px solid rgba(126, 200, 227, 0.28);
  background: transparent;
  color: var(--dim);
  cursor: pointer;
}
.seg button.on {
  color: #071b26;
  background: #8fd6f2;
  border-color: #8fd6f2;
  font-weight: 600;
}

/* 气泡串：一句一句浮出来 */
.memcard--bubbles { align-items: flex-start; }
.memcard-lines {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.memcard-seg {
  opacity: 0;
  transform: translateY(6px);
  animation: segIn 340ms ease forwards;
  animation-delay: calc(var(--i, 0) * 140ms + 120ms);
}
.memcard-seg-line { color: var(--text); }
.memcard--perm .memcard-seg-line { color: #f0dcb4; }
.memcard-btn-late {
  opacity: 0;
  animation: segIn 340ms ease forwards;
  animation-delay: 1.15s;
}
@keyframes segIn {
  to { opacity: 1; transform: none; }
}

/* 闪现条：不占消息流，顶部淡入、几秒后退场 */
.memflash {
  position: absolute;
  top: calc(62px + var(--safe-top));
  left: 12px;
  right: 12px;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 12px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text);
  background: rgba(10, 32, 44, 0.92);
  border: 1px solid rgba(126, 200, 227, 0.35);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  cursor: pointer;
  animation: flashIn 380ms cubic-bezier(0.2, 0.9, 0.25, 1.1) both;
}
.memflash--perm {
  border-color: rgba(255, 214, 150, 0.45);
  color: #f0dcb4;
}
.memflash.out { animation: flashOut 700ms ease forwards; }
.memflash-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.memflash-hint {
  flex: none;
  font-size: 11px;
  opacity: 0.55;
}
@keyframes flashIn {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: none; }
}
@keyframes flashOut {
  to { opacity: 0; transform: translateY(-8px); }
}

/* 行内高亮：她说的话里命中记忆的词 */
.mem-hl {
  color: #ffe9c2;
  border-bottom: 1px dashed rgba(255, 214, 150, 0.6);
  cursor: pointer;
  transition: color 160ms ease, border-color 160ms ease;
}
.mem-hl:hover {
  color: #fff3d8;
  border-bottom-color: rgba(255, 214, 150, 0.95);
}

.mem-tip {
  position: fixed;
  z-index: 90;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(10, 32, 44, 0.96);
  border: 1px solid rgba(255, 214, 150, 0.4);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--text);
  animation: tipIn 160ms ease both;
}
.mem-tip-text { color: #f2e6cf; }
.mem-tip-btn {
  margin-top: 7px;
  padding: 4px 10px;
  border: 1px solid rgba(255, 214, 150, 0.45);
  border-radius: 999px;
  background: rgba(255, 214, 150, 0.1);
  color: #ffe9c2;
  font: inherit;
  font-size: 11.5px;
  cursor: pointer;
}
.mem-tip-btn:hover { background: rgba(255, 214, 150, 0.18); }
@keyframes tipIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .memcard-seg,
  .memcard-btn-late { animation: none !important; opacity: 1; transform: none; }
  .memflash { animation: none !important; }
}