/* 05 记忆档案：搜索 + 索引贴分类 + 一张张卡片（能改能删）+ 右下角「记一条」。不显示底栏。 */
.memory { min-height: 100vh; min-height: 100dvh; padding: calc(env(safe-area-inset-top, 0px) + 44px) 0 0; display: flex; flex-direction: column; }
.mem-head { display: flex; align-items: center; gap: 6px; height: 52px; padding: 0 12px 0 8px; }
.mem-head h1 { display: flex; align-items: baseline; gap: 8px; margin: 0; font-size: 17px; font-weight: 600; }
.mem-head h1 .script { font-size: 30px; font-weight: 400; }
.mem-head .count { margin-left: auto; font-family: var(--f-mono); font-size: 12px; color: var(--c-ink-2); }

.mem-search {
  margin: 8px 20px 0; height: 46px; border-radius: 23px; background: var(--c-paper);
  display: flex; align-items: center; gap: 8px; padding: 0 8px 0 16px; box-shadow: 0 3px 10px rgba(var(--c-shadow), .10);
}
.mem-search svg { stroke: var(--c-ink-2); flex: none; }
.mem-search input { flex: 1; min-width: 0; height: 40px; border: 0; outline: none; background: transparent; font: inherit; font-size: 14px; color: var(--c-ink); }
.mem-search input::placeholder { color: var(--c-ink-2); }
.mem-search .clear { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 18px; color: var(--c-ink-2); }

/* 索引贴 */
.mem-tabs { display: flex; gap: 6px; align-items: flex-end; margin: 18px 0 0; padding: 0 20px; overflow-x: auto; scrollbar-width: none; }
.mem-tabs::-webkit-scrollbar { display: none; }
.mem-tabs button {
  flex: none; height: 32px; padding: 0 14px; border-radius: 10px 10px 0 0; font-size: 13px;
  background: var(--c-paper); color: var(--c-ink-2); transition: height .15s ease;
}
.mem-tabs button[aria-selected="true"] { height: 38px; background: var(--c-paper-blue); color: var(--c-ink); font-weight: 600; }

/* 卡片盒 */
.mem-box {
  flex: 1; margin: 0 14px; padding: 16px 14px calc(env(safe-area-inset-bottom, 0px) + 100px);
  background: var(--c-paper-blue); border-radius: 14px 14px 0 0; display: flex; flex-direction: column; gap: 14px;
}
.mem-card {
  position: relative; background: var(--c-paper); border-radius: 6px; padding: 8px 6px 14px 16px;
  box-shadow: 0 4px 10px rgba(var(--c-shadow), .10); border-top: 4px solid var(--tag-bg, var(--mem-3-bg));
}
.mem-card:nth-child(4n+1) { transform: rotate(-.8deg); }
.mem-card:nth-child(4n+2) { transform: rotate(.7deg); }
.mem-card:nth-child(4n+3) { transform: rotate(-.4deg); }
.mem-card:nth-child(4n) { transform: rotate(.9deg); }
.mem-card.flash { animation: flash 1.6s ease; }
@keyframes flash { 0%, 60% { box-shadow: 0 0 0 4px var(--c-pink), 0 4px 10px rgba(var(--c-shadow), .10); } }
.mem-top { display: flex; align-items: center; gap: 8px; }
.tag { font-size: 11px; padding: 2px 8px; border-radius: 4px; background: var(--tag-bg, var(--mem-3-bg)); color: var(--tag-ink, var(--mem-3-ink)); }
.mem-top .mono { font-size: 11px; color: var(--c-ink-2); }
.mem-top .by { font-size: 11px; color: var(--c-ink-2); }
.mem-acts { margin-left: auto; display: flex; }
.mem-acts button { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; border-radius: 50%; }
.mem-acts svg { stroke: var(--c-ink-2); }
.mem-acts .danger { width: auto; padding: 0 10px; border-radius: 18px; font-size: 12px; background: var(--c-paper-pink); color: var(--c-pink-ink); }
.mem-text { font-size: 15px; line-height: 1.65; margin: 2px 8px 0 0; white-space: pre-wrap; word-break: break-word; }
.mem-text mark { background: var(--mem-2-bg); color: inherit; border-radius: 2px; }
.mem-photo { float: right; margin: 6px 6px 4px 12px; padding: 5px 5px 12px; background: var(--c-paper); transform: rotate(4deg); box-shadow: 0 3px 8px rgba(var(--c-shadow), .16); }
.mem-photo img { width: 76px; height: 76px; object-fit: cover; }

/* 改的时候 */
.mem-edit textarea, .mem-form textarea {
  width: 100%; min-height: 88px; resize: vertical; border: 1.5px dashed rgba(92, 132, 177, .45); border-radius: 8px;
  background: transparent; font: inherit; font-size: 15px; line-height: 1.65; color: var(--c-ink); padding: 8px 10px; outline: none;
}
.mem-edit textarea:focus, .mem-form textarea:focus { border-color: var(--c-accent); }
.tag-pick { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.tag-pick button { height: 32px; padding: 0 12px; border-radius: 16px; font-size: 13px; background: var(--tag-bg); color: var(--tag-ink); opacity: .55; }
.tag-pick button[aria-checked="true"] { opacity: 1; font-weight: 600; box-shadow: 0 0 0 2px var(--tag-ink) inset; }
.edit-row { display: flex; justify-content: flex-end; gap: 8px; margin: 10px 8px 0 0; }
.edit-row button { height: 36px; padding: 0 16px; border-radius: 18px; font-size: 13px; background: var(--c-paper); border: 1.5px solid var(--c-blue); }
.edit-row .ok { background: var(--c-blue); color: var(--c-paper); border: 0; font-weight: 600; }

.mem-empty { text-align: center; color: var(--c-ink-2); font-size: 14px; padding: 40px 0; }
.mem-empty b { display: block; color: var(--c-ink); font-size: 16px; margin-bottom: 4px; }
.mem-more { align-self: center; height: 40px; padding: 0 16px; font-size: 13px; color: var(--c-ink-2); }

.mem-fab {
  position: fixed; right: max(22px, calc(50% - 240px + 22px)); bottom: calc(env(safe-area-inset-bottom, 0px) + 30px); z-index: 5;
  height: 52px; padding: 0 20px; border-radius: 26px; background: var(--mem-fab); color: var(--c-paper);
  font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 6px;
  box-shadow: 0 6px 14px rgba(184, 106, 124, .3); transform: rotate(-3deg);
}
.mem-fab svg { stroke: var(--c-paper); }
.mem-form .btn-row { margin-top: 16px; }
