/* ============================================================
   css/panels/panels-memory-lib.css — 记忆库多视图（原创 UI）
   韩系法式唯美 · 跟随主题 · 零 emoji · SVG 线条图标
   ============================================================ */

#tab-memory {
    position: relative;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    background: var(--bg-primary);
    /* 浅色模式：浅米渐变上放深暖字才看得清（白字对比度仅 ~1.9:1） */
    --on-accent: #5A3D3D;
    --ml-rose-deep: #7A5A5A;
}
[data-theme-mode="dark"] #tab-memory {
    --on-accent: #FFF;
    --ml-rose-deep: #C9A8A8;
}

/* ===== 单一滚动容器（微信朋友圈式：标题+统计随内容滚走，只有吸顶区固定）===== */
.ml-body-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    position: relative;
    scrollbar-gutter: stable;
}

/* ===== 顶部（header/stats/sticky 直接挂在滚动容器下，保证 sticky 吸顶生效）===== */
    font-family: var(--font-decorative, 'Playfair Display', Georgia, serif);
    font-style: italic; font-size: 14px; letter-spacing: 2px;
    color: var(--gold); opacity: 0.8;
}

/* ===== 统计卡（可点击）===== */
.ml-stat {
    display: flex; flex-direction: column; align-items: center;
    padding: 10px 22px; background: var(--surface);
    border: 1px solid var(--border); border-radius: 16px;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.ml-stat:active { transform: scale(0.96); }
.ml-stat-num { font-family: var(--font-decorative, 'Playfair Display', serif); font-size: 24px; color: var(--text-primary); line-height: 1.1; }
.ml-stat-label { font-size: 11px; color: var(--ml-rose-deep); margin-top: 3px; }

/* ===== 吸顶区（tab + 「全部」筛选栏一起吸顶；hero+stats 随内容滚走）===== */
.ml-sticky {
    position: sticky;
    top: 0;
    z-index: 20;
    background: var(--bg-primary);
    box-shadow: 0 1px 0 var(--border);
}

/* ===== 视图 tab ===== */
.ml-vtab {
    flex: 1; max-width: 90px;
    border: 1px solid var(--border); background: var(--surface);
    color: var(--text-secondary); font-size: 13px; padding: 9px 0;
    border-radius: 20px; cursor: pointer; font-family: var(--font-body);
    transition: all 0.2s ease;
}
.ml-vtab.active {
    background: var(--accent-gradient); color: var(--on-accent); border-color: transparent;
    box-shadow: 0 2px 8px var(--accent-glow, rgba(201,168,168,0.3));
}
.ml-vtab:active { transform: scale(0.95); }

/* ===== 主页 ===== */
.ml-home { display: block; }
.ml-home-today { padding: 4px 18px 2px; flex-shrink: 0; }
.ml-today-card {
    background: linear-gradient(180deg, rgba(201,168,168,.06), var(--surface));
    border: 1px solid var(--border); border-radius: 16px;
    padding: 14px 16px; box-shadow: var(--shadow-xs);
}
.ml-today-en { font-family: var(--font-decorative, 'Playfair Display', serif); font-style: italic; font-size: 12px; color: var(--ml-rose-deep); }
.ml-today-text { font-size: 13px; color: var(--text-secondary); margin-top: 4px; line-height: 1.6; }
.ml-today-text b { color: var(--ml-rose-deep); font-weight: 600; }
.ml-today-chart { padding-top: 10px; margin-top: 10px; border-top: 1px dashed var(--border); }
.ml-mini-chart-label { font-size: 10px; color: var(--text-muted); margin-bottom: 6px; letter-spacing: 1px; }
.ml-section-head {
    display: flex; align-items: baseline; gap: 8px;
    padding: 14px 18px 8px; flex-shrink: 0;
}
.ml-section-zh { font-size: 15px; font-weight: 600; color: var(--text-primary); }
.ml-section-en { font-family: var(--font-decorative, 'Playfair Display', serif); font-style: italic; font-size: 12px; color: var(--gold); opacity: 0.75; }

/* ===== 列表视图筛选 ===== */
.ml-list-view { display: flex; flex-direction: column; }
.ml-filters { flex-shrink: 0; }
.ml-search {
    flex: 1; display: flex; align-items: center; gap: 8px;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 22px; padding: 8px 14px; box-shadow: var(--shadow-xs);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.ml-search:focus-within { border-color: var(--rose); box-shadow: 0 0 0 3px var(--rose-light); }
.ml-search svg { flex-shrink: 0; color: var(--text-muted); }
.ml-search input { flex: 1; border: none; outline: none; background: transparent; font-size: 14px; color: var(--text-primary); font-family: var(--font-body); -webkit-text-security: none; }
.ml-filters { position: relative; }

.ml-sort-btn { border: none; background: none; font-size: 12px; color: var(--text-muted); cursor: pointer; padding: 6px 4px; min-width: 36px; font-family: var(--font-body); transition: color 0.2s ease, transform 0.15s ease; }
.ml-sort-btn:active { transform: scale(0.95); }
.ml-sort-btn.active { color: var(--text-primary); font-weight: 600; border-bottom: 2px solid var(--rose); }
/* ===== 滚动区 & 列表（跟随外层 .ml-body-scroll 滚动，自身不滚）===== */

/* ===== 记忆卡片（重要度条 / 标签 / 淡出）===== */
.ml-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 16px; padding: 12px 14px;
    box-shadow: var(--shadow-sm), var(--shadow-xs);
    cursor: pointer; transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}
.ml-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.ml-card:active { transform: scale(0.98); }
.ml-card-faded { opacity: 0.72; }
.ml-card-faded-strong { opacity: 0.5; filter: saturate(0.35); transition: opacity 0.3s ease, filter 0.3s ease; }
.ml-card-faded-strong:hover { opacity: 0.7; filter: saturate(0.6); }
.ml-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.ml-card-title { font-size: 14.5px; font-weight: 600; color: var(--text-primary); line-height: 1.35; flex: 1; min-width: 0; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
/* 标题「事件类型」彩色圆角框（问题①）：去掉 · 前的类型做成带色小框，一眼分清主次
   2026-09 微调：圆角 9→7px 稍微方一点点；颜色明度提一点点（brightness 略升 + 提透明度） */
.ml-title-badge {
    display: inline-block; vertical-align: 1px; margin-right: 5px; padding: 1px 7px;
    font-size: 11px; font-weight: 600; line-height: 1.5; border-radius: 7px; white-space: nowrap;
    color: #3E2F2F; background: var(--tb, var(--accent-rose)); opacity: 0.96;
    filter: brightness(1.06) saturate(1.02);
}
.ml-title-rest { color: inherit; }
.ml-card-badges { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; }
.ml-badge { font-size: 10px; padding: 2px 8px; border-radius: 10px; border: 1px solid; white-space: nowrap; }
.ml-badge-treasure { color: var(--gold-dark); border-color: var(--gold); background: var(--gold-light); }
.ml-badge-fade { color: var(--text-muted); border-color: var(--border); }
.ml-badge-archived { color: var(--text-muted); border-color: var(--border); }
.ml-badge-manual-fade { color: var(--sage); border-color: var(--sage); background: var(--sage-light); }
/* ★ 2028-09 甲方定「卡片高度统一」：标题最多一行、摘要固定两行高度（没摘要也占着位置），
   高度不再随标题/摘要长短变来变去（实测 tools/ui-memlib-measure.js 会量 cardHeightsSame）。
   两列（一行两个）模式本来就不显示摘要，那里不设高度。 */
.ml-card-summary { margin-top: 5px; font-size: 12.5px; color: var(--text-secondary); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: calc(1.45em * 2); }
.ml-tag { font-size: 10px; color: var(--lavender); background: var(--lavender-light); border: 1px solid rgba(184,168,196,0.25); padding: 2px 9px; border-radius: 11px; }
.ml-card-groups { max-width: 60%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ml-rose-deep); }
.ml-imp-bar { height: 4px; width: 100%; background: rgba(201,168,168,0.25); border-radius: 2px; margin-top: 9px; overflow: hidden; }
.ml-imp-fill { display: block; height: 100%; background: linear-gradient(90deg, var(--rose), var(--gold)); border-radius: 2px; transition: width 0.3s ease; }

/* ===== 空状态 ===== */
.ml-empty { text-align: center; padding: 60px 30px; width: 100%; grid-column: 1 / -1; }
.ml-empty-deco { font-family: var(--font-decorative, 'Playfair Display', Georgia, serif); font-style: italic; font-size: 17px; color: var(--gold); opacity: 0.7; }
.ml-empty-text { margin-top: 8px; font-size: 13px; color: var(--text-muted); }

/* ===== 统计视图 ===== */
.ml-stats-view { display: block; }
.ml-dist { display: flex; flex-direction: column; gap: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 14px; box-shadow: var(--shadow-sm); }
.ml-dist-row { display: flex; align-items: center; gap: 10px; }
.ml-dist-name { width: 60px; font-size: 12px; color: var(--text-secondary); flex-shrink: 0; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ml-dist-bar { flex: 1; height: 8px; background: var(--border); border-radius: 4px; overflow: hidden; }
.ml-dist-fill { display: block; height: 100%; background: linear-gradient(90deg, var(--rose), var(--gold)); border-radius: 4px; }
.ml-dist-fill.imp-low { background: var(--sage); }
.ml-dist-fill.imp-mid { background: var(--rose); }
.ml-dist-fill.imp-high { background: linear-gradient(90deg, var(--rose), var(--gold)); }
.ml-dist-fill.imp-max { background: linear-gradient(90deg, var(--gold), #d8b26a); }
.ml-dist-num { width: 28px; font-size: 12px; color: var(--text-primary); text-align: right; }
.ml-dist-empty { font-size: 12px; color: var(--text-muted); text-align: center; padding: 10px; }

/* ===== 详情视图（全屏）===== */
.ml-detail-view { display: flex; flex-direction: column; height: 100%; overflow: hidden; }
.ml-detail-header {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 16px; flex-shrink: 0;
    border-bottom: 1px solid var(--border);
}
.ml-back-btn {
    display: flex; align-items: center; gap: 4px;
    border: none; background: none; color: var(--rose);
    font-size: 14px; cursor: pointer; font-family: var(--font-body); padding: 4px;
    transition: opacity 0.2s ease;
}
.ml-back-btn:active { opacity: 0.6; transform: scale(0.95); }
.ml-detail-title-mini { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.ml-detail-scroll { flex: 1; overflow-y: auto; padding: 18px 20px; padding-bottom: calc(80px + var(--safe-bottom, 0px) + var(--kbd-h, 0px)); -webkit-overflow-scrolling: touch; }
.ml-detail-hero { text-align: center; padding: 6px 0 16px; }
.ml-detail-en { font-family: var(--font-decorative, 'Playfair Display', Georgia, serif); font-style: italic; font-size: 14px; color: var(--gold); letter-spacing: 2px; opacity: 0.8; }
.ml-detail-title { font-size: 21px; font-weight: 600; color: var(--text-primary); margin-top: 4px; line-height: 1.4; }
.ml-detail-time { margin-top: 6px; font-size: 12px; color: var(--text-muted); }
.ml-detail-body { margin-top: 8px; padding: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; font-size: 14px; line-height: 1.8; color: var(--text-primary); white-space: pre-wrap; word-break: break-word; box-shadow: var(--shadow-sm); }
.ml-detail-meta { margin-top: 12px; }
.ml-detail-groups { font-size: 12px; color: var(--text-secondary); }
.ml-detail-tags { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; }
.ml-detail-weight { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
.ml-weight-label { font-size: 12px; color: var(--text-muted); width: 42px; flex-shrink: 0; text-align: right; }
.ml-imp-bar-lg { flex: 1; height: 6px; margin-top: 0; }
.ml-weight-num { font-size: 13px; color: var(--text-primary); font-weight: 600; min-width: 42px; text-align: right; }
.ml-detail-fade { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
/* ===== 详情页：正事 / 琐事 切换（2028 新增）===== */
.ml-detail-kind { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
/* 「正事 / 琐事」这七个字必须一行放下（2028 甲方实锤：62px 放不下被折成两行） */
.ml-detail-kind .ml-weight-label { width: 76px; white-space: nowrap; text-align: left; }
.ml-kind-switch { display: inline-flex; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 2px; flex: none; }
.ml-kind-opt {
    border: none; background: transparent; color: var(--text-secondary);
    font-size: 12px; padding: 5px 14px; border-radius: 12px; cursor: pointer;
    font-family: var(--font-body); transition: all .2s ease;
}
.ml-kind-opt:active { transform: scale(.95); }
.ml-kind-opt.active { background: var(--accent); color: var(--on-accent); box-shadow: 0 2px 6px var(--accent-glow, rgba(201,168,168,.3)); }
.ml-kind-hint { font-size: 11px; color: var(--text-muted); }
@media (max-width: 369px) {
    .ml-detail-kind { gap: 8px; }
    .ml-detail-kind .ml-weight-label { width: 68px; font-size: 11.5px; }
    .ml-kind-opt { padding: 5px 10px; }
}
.ml-fade-bar-lg { flex: 1; height: 6px; margin-top: 0; background: rgba(201,168,168,0.25); border-radius: 3px; overflow: hidden; }
.ml-fade-fill { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--rose, #C9A8A8), #8890a8); transition: width 0.5s ease; }
.ml-fade-fill.ml-fade-keep { background: linear-gradient(90deg, #d4a843, #e8c96a); }
.ml-fade-fill.ml-fade-module { background: linear-gradient(90deg, #9ab89a, #b8d4b8); }
.ml-fade-fill.ml-fade-archived { background: linear-gradient(90deg, #8890a8, #6b7a98); }
.ml-fade-fill.ml-fade-highimp { background: linear-gradient(90deg, #d4a843, #e8c96a); }
.ml-fade-num { font-size: 13px; color: var(--text-primary); font-weight: 600; min-width: 40px; }
.ml-fade-keep { color: var(--gold-dark); }
/* 卡片淡忘度条（替换旧 fade-dot） */
.ml-fade-bar-mini { height: 3px; width: 100%; background: rgba(201,168,168,0.25); border-radius: 2px; margin-top: 5px; overflow: hidden; }
.ml-fade-fill-mini { display: block; height: 100%; border-radius: 2px; transition: width 0.4s ease; }
.ml-fade-fill-mini-clear { background: linear-gradient(90deg, #c8a0a0, #d4a0a0); }
.ml-fade-fill-mini-fading { background: linear-gradient(90deg, #b8a0c0, #a0a8c0); }
.ml-fade-fill-mini-faded { background: linear-gradient(90deg, #a8a8b8, #b0b0b8); }
.ml-fade-fill-mini-protected { background: linear-gradient(90deg, #d4a843, #e8c96a); }
.ml-fade-fill-mini-module { background: linear-gradient(90deg, #9ab89a, #b8d4b8); }
.ml-fade-fill-mini-gone { background: linear-gradient(90deg, #c0b0a0, #d0c8c0); opacity: 0.4; }
.ml-fade-fill-mini-manual { background: linear-gradient(90deg, #a0b8a0, #c0d0c0); }

/* 事件结束标记圆点 */
.ml-resolved-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; border: 1.5px solid var(--lavender); margin-left: 6px; vertical-align: middle; opacity: 0.7; }

/* 详情页淡忘药丸 */
.ml-fade-pill { font-size: 10px; padding: 2px 8px; border-radius: 10px; white-space: nowrap; flex-shrink: 0; font-family: var(--font-body); border: 1px solid; }
.ml-fade-pill-treasure { color: var(--gold-dark); background: var(--gold-light); border-color: var(--gold); }
.ml-fade-pill-module { color: var(--sage); background: var(--sage-light); border-color: var(--sage); }
.ml-fade-pill-clear { color: var(--ml-rose-deep); background: var(--rose-light); border-color: var(--rose); }
.ml-fade-pill-fading { color: var(--text-secondary); background: var(--surface); border-color: var(--border); }
.ml-fade-pill-faded { color: var(--text-muted); background: var(--border); border-color: transparent; opacity: 0.7; }
.ml-fade-pill-gone { color: var(--text-muted); background: var(--border); border-color: transparent; opacity: 0.5; }
.ml-fade-pill-manual { color: var(--sage); background: var(--sage-light); border-color: var(--sage); }

/* 事件结局卡片 */
.ml-resolution-card { margin-top: 12px; padding: 14px 16px; background: linear-gradient(145deg, var(--rose-light), transparent); border: 1px solid rgba(201,168,168,0.2); border-radius: 14px; text-align: center; }
.ml-resolution-icon { margin-bottom: 6px; color: var(--rose); opacity: 0.8; }
.ml-resolution-en { font-family: var(--font-decorative, 'Playfair Display', serif); font-style: italic; font-size: 12px; color: var(--gold); opacity: 0.7; }
.ml-resolution-text { margin-top: 6px; font-size: 14px; color: var(--text-primary); line-height: 1.6; }
.ml-resolution-time { margin-top: 4px; font-size: 11px; color: var(--text-muted); }
.ml-tl-resolution { margin-bottom: 12px; }
.ml-detail-actions { display: flex; gap: 8px; margin-top: 20px; flex-wrap: wrap; }
.ml-btn { flex: 1; min-width: 0; border: 1px solid var(--rose, #C9A8A8); background: var(--rose-light, rgba(201,168,168,0.10)); color: var(--ml-rose-deep, #7A5A5A); font-size: 12px; padding: 9px 0; border-radius: 22px; cursor: pointer; font-family: var(--font-body); transition: all 0.2s ease; }
.ml-btn:hover { background: var(--rose-light); border-color: var(--rose); }
.ml-btn:active { transform: scale(0.95); }
.ml-btn-primary { background: var(--accent-gradient); color: var(--on-accent); border-color: transparent; box-shadow: 0 2px 8px var(--accent-glow, rgba(201,168,168,0.3)); }
.ml-btn-danger { color: var(--danger, #c87); border-color: rgba(200,130,130,0.4); background: transparent; }
/* 按钮统一配色：除删除(红)外全部统一为玫瑰色调 */
/* 帮助面板：平面单色按钮 */
.ml-btn-flat { flex: 1; border: 1px solid var(--rose); background: var(--rose-light); color: var(--ml-rose-deep); font-size: 12px; padding: 9px 0; border-radius: 22px; cursor: pointer; font-family: var(--font-body); transition: all 0.2s ease; }
.ml-btn-flat:active { transform: scale(0.95); }

/* ===== 淡忘度滑块弹窗 ===== */
.ml-fade-overlay { position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.3); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; z-index: 50; animation: mlFadeIn 0.2s ease; }
@keyframes mlFadeIn { from { opacity: 0; } to { opacity: 1; } }
.ml-fade-slider-card { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 24px 20px 18px; width: 88%; max-width: 300px; text-align: center; box-shadow: 0 8px 32px rgba(0,0,0,0.12); opacity: 0; transition: opacity 0.25s ease; }
.ml-fade-slider-en { font-family: var(--font-display); font-size: 13px; color: var(--text-muted); margin-bottom: 2px; }
.ml-fade-slider-title { font-size: 17px; font-weight: 600; color: var(--text-primary); font-family: var(--font-body); margin-bottom: 18px; }
.ml-fade-slider-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.ml-fade-slider-end { font-size: 11px; color: var(--text-muted); flex-shrink: 0; width: 28px; }
.ml-fade-range { flex: 1; -webkit-appearance: none; appearance: none; height: 6px; border-radius: 3px; background: linear-gradient(90deg, var(--rose), #8890a8); outline: none; cursor: pointer; }
.ml-fade-range::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 22px; height: 22px; border-radius: 50%; background: var(--surface); border: 2px solid var(--rose); cursor: pointer; box-shadow: 0 2px 6px rgba(0,0,0,0.1); transition: transform 0.15s ease; }
.ml-fade-range::-webkit-slider-thumb:active { transform: scale(1.15); }
.ml-fade-range::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: var(--surface); border: 2px solid var(--rose); cursor: pointer; }
.ml-fade-slider-val { font-size: 28px; font-weight: 700; color: var(--text-primary); font-family: var(--font-body); margin: 4px 0; }
.ml-fade-slider-hint { font-size: 11px; color: var(--text-muted); margin-bottom: 16px; }
.ml-fade-slider-actions { display: flex; gap: 10px; }
.ml-fade-slider-actions .ml-btn { flex: 1; }

/* ===== 新建/编辑/导入表单 ===== */
.ml-edit-form { display: flex; flex-direction: column; gap: 12px; }
.ml-field label { display: block; font-size: 12px; color: var(--text-muted); margin-bottom: 6px; }
.ml-field input, .ml-field textarea {
    width: 100%; border: 1px solid var(--border); background: var(--surface);
    border-radius: 12px; padding: 10px 12px; font-size: 14px; color: var(--text-primary);
    font-family: var(--font-body); outline: none; transition: border-color 0.2s ease;
}
.ml-field input:focus, .ml-field textarea:focus { border-color: var(--rose); }
.ml-field input[type="number"] { -webkit-appearance: none; appearance: none; -moz-appearance: textfield; }
.ml-field textarea { resize: vertical; line-height: 1.6; }
.ml-edit-actions, .ml-new-actions { display: flex; gap: 10px; margin-top: 6px; }
.ml-new-hero { text-align: center; padding: 6px 0 16px; }

/* ===== 批量导入：来源区 ===== */
.ml-imp-source { display: flex; flex-direction: column; gap: 12px; }
.ml-imp-drop {
    border: 1.5px dashed var(--rose-light); background: var(--surface);
    border-radius: 16px; padding: 22px 16px; text-align: center; cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}
.ml-imp-drop:active { transform: scale(0.985); }
.ml-imp-drop:hover { border-color: var(--rose); background: var(--rose-light); }
.ml-imp-drop.dragging { border-color: var(--rose); background: var(--rose-light); box-shadow: var(--shadow-glow); }
.ml-imp-drop-ico { color: var(--rose); margin-bottom: 6px; }
.ml-imp-drop-title { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.ml-imp-drop-sub { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.ml-imp-files { display: flex; flex-direction: column; gap: 6px; }
.ml-imp-file {
    display: flex; align-items: center; gap: 8px; padding: 8px 12px;
    background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
}
.ml-imp-file-ico { color: var(--rose); display: flex; }
.ml-imp-file-name { flex: 1; font-size: 13px; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ml-imp-file-x { border: none; background: none; color: var(--text-muted); cursor: pointer; padding: 4px; display: flex; border-radius: 6px; transition: color 0.2s ease; }
.ml-imp-file-x:active { transform: scale(0.9); }
.ml-imp-file-x:hover { color: var(--rose); }
.ml-imp-or { display: flex; align-items: center; gap: 12px; color: var(--text-muted); font-size: 12px; }
.ml-imp-or::before, .ml-imp-or::after { content: ''; flex: 1; height: 1px; background: var(--gold); opacity: 0.25; }
.ml-imp-textarea { width: 100%; border: 1px solid var(--border); background: var(--surface); border-radius: 14px; padding: 12px; font-size: 14px; color: var(--text-primary); font-family: var(--font-body); outline: none; line-height: 1.6; resize: vertical; transition: border-color 0.2s ease; }
.ml-imp-textarea:focus { border-color: var(--rose); }
.ml-imp-actions { display: flex; }
.ml-imp-actions .ml-btn { flex: 1; }

/* ===== 批量导入：导入方式选择（只记大事 / 细节全记） ===== */
.ml-imp-mode { margin-bottom: 12px; }
.ml-imp-mode-label { font-size: 12px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
.ml-imp-mode-seg { display: flex; gap: 8px; background: var(--input-bg); border-radius: var(--radius-md); padding: 3px; }
.ml-imp-mode-btn { flex: 1; height: 36px; border: none; border-radius: var(--radius-sm); background: transparent; color: var(--text-secondary); font-size: 13px; cursor: pointer; font-family: inherit; transition: background 0.16s ease, color 0.16s ease, transform 0.12s ease; }
.ml-imp-mode-btn.on { background: var(--surface-solid); color: var(--accent); box-shadow: var(--shadow-xs); font-weight: 600; }
.ml-imp-mode-btn:active { transform: scale(0.96); }
.ml-imp-mode-sub { font-size: 11px; color: var(--text-muted); margin-top: 6px; line-height: 1.5; }
.ml-imp-result { margin-top: 4px; }
.ml-imp-hint { font-size: 12px; color: var(--text-muted); text-align: center; padding: 14px; }
@keyframes mlImpPulse { 0%, 100% { opacity: 0.4; transform: scale(0.8); } 50% { opacity: 1; transform: scale(1.1); } }

/* ===== 批量导入：结果/卡片 ===== */
.ml-imp-countbar { display: flex; align-items: center; justify-content: space-between; margin: 14px 2px 10px; }
.ml-imp-count { font-size: 12px; color: var(--text-secondary); }
.ml-imp-selall { border: none; background: none; color: var(--rose); font-size: 12px; cursor: pointer; font-family: var(--font-body); padding: 2px 6px; border-radius: 8px; transition: background 0.2s ease; }
.ml-imp-selall:active { background: var(--rose-light); }
.ml-imp-cards { display: flex; flex-direction: column; gap: 12px; }
.ml-imp-card { background: var(--surface-solid); border: 1px solid var(--border); border-radius: 16px; padding: 12px 14px; box-shadow: var(--shadow-xs), var(--shadow-sm); }
.ml-imp-card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.ml-imp-check { position: relative; width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex: none; }
.ml-imp-check input { position: absolute; opacity: 0; width: 22px; height: 22px; margin: 0; }
.ml-imp-checkmark { width: 20px; height: 20px; border: 1.5px solid var(--border); border-radius: 6px; background: var(--surface); display: flex; align-items: center; justify-content: center; transition: background 0.2s ease, border-color 0.2s ease; }
.ml-imp-check input:checked + .ml-imp-checkmark { background: var(--rose); border-color: var(--rose); }
.ml-imp-check input:checked + .ml-imp-checkmark::after { content: ''; width: 9px; height: 5px; border-left: 2px solid var(--on-accent); border-bottom: 2px solid var(--on-accent); transform: rotate(-45deg); }
.ml-imp-title { flex: 1; border: 1px solid transparent; background: transparent; font-size: 14px; font-weight: 600; color: var(--text-primary); font-family: var(--font-body); padding: 6px 8px; border-radius: 10px; outline: none; transition: border-color 0.2s ease, background 0.2s ease; }
.ml-imp-title:focus { border-color: var(--rose); background: var(--surface); }
.ml-imp-del { border: none; background: none; color: var(--text-muted); cursor: pointer; padding: 4px; display: flex; border-radius: 8px; flex: none; transition: color 0.2s ease; }
.ml-imp-del:hover { color: var(--rose); }
.ml-imp-del:active { transform: scale(0.9); }
.ml-imp-field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.ml-imp-field label { font-size: 11px; color: var(--text-muted); }
.ml-imp-in { width: 100%; border: 1px solid var(--border); background: var(--surface); border-radius: 11px; padding: 8px 11px; font-size: 13px; color: var(--text-primary); font-family: var(--font-body); outline: none; line-height: 1.5; transition: border-color 0.2s ease; }
.ml-imp-in:focus { border-color: var(--rose); }
.ml-imp-field input[type="range"] { width: 100%; margin: 0; -webkit-appearance: none; appearance: none; height: 4px; background: var(--border); border-radius: 2px; outline: none; }
.ml-imp-field input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 16px; height: 16px; border-radius: 50%; background: var(--rose); border: 2px solid var(--surface-solid); box-shadow: 0 1px 3px rgba(30,28,26,0.25); cursor: pointer; }
.ml-imp-field input[type="range"]::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: var(--rose); border: 2px solid var(--surface-solid); box-shadow: 0 1px 3px rgba(30,28,26,0.25); cursor: pointer; }
.ml-imp-row { display: flex; gap: 14px; }
.ml-imp-row .ml-imp-field { flex: 1; }
.ml-imp-val { color: var(--rose); font-weight: 600; }
.ml-imp-treasure, .ml-imp-time { border: 1px solid var(--border); background: var(--surface); color: var(--text-secondary); font-size: 12px; padding: 7px 12px; border-radius: 12px; cursor: pointer; font-family: var(--font-body); transition: all 0.2s ease; }
.ml-imp-treasure:active, .ml-imp-time:active { transform: scale(0.96); }
.ml-imp-treasure.on { background: var(--rose); border-color: var(--rose); color: var(--on-accent); }
.ml-imp-body { margin-top: 2px; }
.ml-imp-body summary { font-size: 12px; color: var(--rose); cursor: pointer; padding: 4px 0; outline: none; }
.ml-imp-body textarea { margin-top: 6px; }
.ml-imp-pager { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 16px 0; }
.ml-imp-pageinfo { font-size: 12px; color: var(--text-secondary); }
.ml-imp-confirmbar { display: flex; margin: 8px 0 4px; }
.ml-imp-confirmbar .ml-btn { flex: 1; }

/* ===== 关联人物行 / 未配模型提示 ===== */
.ml-imp-needcfg { background: var(--surface); border: 1px solid var(--rose-light); border-radius: 16px; padding: 20px 16px; text-align: center; margin-top: 8px; }
.ml-imp-needcfg-title { font-size: 15px; font-weight: 600; color: var(--text-primary); }
.ml-imp-needcfg-desc { font-size: 12px; color: var(--text-secondary); margin: 8px 0 14px; line-height: 1.6; }
.ml-imp-needcfg .ml-btn { min-width: 150px; }

/* ===== 批量导入·任务中心（2026 甲方需求：后台识别 + 总览 + 红点 + 逐条审阅）===== */
.ml-imp-note { font-size: 12px; color: var(--text-secondary); line-height: 1.6; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 10px 12px; margin-bottom: 12px; }
/* 识别提示（2000 字建议；浅色/深色都用 rose 淡底，靠文字色自适应） */
.ml-imp-tip { font-size: 11.5px; color: var(--text-secondary); line-height: 1.65; margin: 8px 2px 10px; padding: 8px 11px; background: rgba(201,168,168,0.08); border-left: 2px solid rgba(201,168,168,0.45); border-radius: 8px; }
.ml-imp-taskhead { font-size: 12px; font-weight: 600; color: var(--text-secondary); margin: 16px 2px 8px; }
.ml-imp-tasklist { display: flex; flex-direction: column; gap: 8px; }
.ml-imp-tasks-empty { font-size: 12px; color: var(--text-muted); text-align: center; padding: 12px; background: var(--surface); border: 1px dashed var(--border); border-radius: 14px; }
.ml-imp-task {
    position: relative; display: flex; align-items: center; gap: 10px;
    background: var(--surface-solid); border: 1px solid var(--border); border-radius: 14px;
    padding: 10px 12px; box-shadow: var(--shadow-xs); transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.ml-imp-task:hover { border-color: var(--rose); }
.ml-imp-task.is-new { border-color: var(--rose); box-shadow: 0 0 0 1px var(--rose), var(--shadow-sm); }
.ml-imp-task-ico { color: var(--text-secondary); display: flex; flex: none; }
.ml-imp-task.is-new .ml-imp-task-ico { color: var(--rose); }
.ml-imp-task-main { flex: 1; min-width: 0; }
.ml-imp-task-name { font-size: 13px; font-weight: 600; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ml-imp-task-status { font-size: 11px; margin-top: 3px; }
.ml-imp-task-status.ok { color: var(--sage); }
.ml-imp-task-status.err { color: #c46a5a; }
.ml-imp-task-status.busy { color: var(--text-muted); }
.ml-imp-task-degraded { font-size: 11px; color: var(--text-secondary); margin-top: 3px; }
.ml-imp-task-degraded::before { content: ''; display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: var(--gold); margin-right: 5px; vertical-align: 1px; }
.ml-imp-task-actions { display: flex; align-items: center; gap: 6px; flex: none; }
.ml-imp-task-btn { border: 1px solid var(--border); background: var(--surface); color: var(--text-secondary); font-size: 12px; padding: 6px 11px; border-radius: 12px; cursor: pointer; font-family: var(--font-body); transition: all 0.2s ease; }
.ml-imp-task-btn:active { transform: scale(0.95); }
.ml-imp-task-btn.primary { border-color: var(--rose); background: var(--rose); color: var(--on-accent); }
.ml-imp-task-btn.primary:hover { filter: brightness(1.05); }
.ml-imp-task-x { border: none; background: none; color: var(--text-muted); cursor: pointer; padding: 4px; display: flex; border-radius: 8px; transition: color 0.2s ease; }
.ml-imp-task-x:hover { color: var(--rose); }
.ml-imp-task-x:active { transform: scale(0.9); }
.ml-imp-task-dots { display: inline-flex; gap: 3px; align-items: center; }
.ml-imp-task-dots i { width: 4px; height: 4px; border-radius: 50%; background: var(--text-muted); animation: mlImpDots 1.1s ease-in-out infinite; }
.ml-imp-task-dots i:nth-child(2) { animation-delay: 0.18s; }
.ml-imp-task-dots i:nth-child(3) { animation-delay: 0.36s; }
@keyframes mlImpDots { 0%, 100% { opacity: 0.3; } 50% { opacity: 1; } }
.ml-imp-reviewhead { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 4px 2px 10px; }
.ml-imp-reviewhead span { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.ml-imp-reviewback { border: 1px solid var(--border); background: var(--surface); color: var(--text-secondary); font-size: 12px; padding: 6px 12px; border-radius: 12px; cursor: pointer; font-family: var(--font-body); transition: all 0.2s ease; }
.ml-imp-reviewback:active { transform: scale(0.95); }

/* 批量导入按钮红点（主页右上「导入」） */
.ml-act-import { position: relative; }
.ml-act-badge {
    position: absolute; top: -5px; right: -5px; min-width: 16px; height: 16px; padding: 0 4px;
    border-radius: 9px; background: #e26a6a; color: #fff; font-size: 10px; font-weight: 700;
    display: flex; align-items: center; justify-content: center; line-height: 1;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2); opacity: 0; transform: scale(0.5); pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
}
.ml-act-badge.show { opacity: 1; transform: scale(1); }

/* ===== 手动批量写 ===== */
.ml-batch-toggle { text-align: right; margin: -6px 2px 8px; font-size: 12px; color: var(--sage); cursor: pointer; }
.ml-batch-common { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px; margin-bottom: 12px; display: flex; flex-direction: column; gap: 8px; }
.ml-batch-common-title { font-size: 12px; color: var(--text-secondary); font-weight: 600; }
.ml-batch-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 12px; }
.ml-batch-addbtn { display: flex; }
.ml-batch-addbtn .ml-btn { flex: 1; }
.ml-batch-hint { font-size: 11px; color: var(--text-muted); margin-top: 10px; line-height: 1.6; }

/* ===== 时间筛选月历 ===== */
.ml-cal-overlay {
    position: absolute; inset: 0; z-index: 30;
    display: flex; align-items: center; justify-content: center;
    background: rgba(20,16,14,0.45);
}
.ml-cal-panel {
    width: 84%; max-width: 320px;
    background: var(--surface-solid); border: 1px solid var(--border);
    border-radius: 20px; padding: 16px; box-shadow: var(--shadow-lg);
}
.ml-cal-head { display: flex; align-items: center; justify-content: space-between; padding: 0 4px 10px; }
.ml-cal-nav { border: 1px solid var(--border); background: var(--surface); color: var(--text-secondary); width: 30px; height: 30px; border-radius: 50%; cursor: pointer; font-size: 16px; }
.ml-cal-nav:active { transform: scale(0.92); }
#ml-cal-title { font-size: 15px; font-weight: 600; color: var(--text-primary); font-family: var(--font-body); }
.ml-cal-week { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; font-size: 11px; color: var(--text-muted); margin-bottom: 4px; }
.ml-cal-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.ml-cal-day, .ml-cal-empty { height: 34px; display: flex; align-items: center; justify-content: center; font-size: 13px; border-radius: 8px; }
.ml-cal-day { color: var(--text-primary); cursor: pointer; position: relative; transition: background 0.2s ease; }
.ml-cal-day:active { transform: scale(0.9); }
.ml-cal-day.today { color: var(--rose); font-weight: 700; }
.ml-cal-day.has-mem::after { content: ''; position: absolute; bottom: 3px; width: 4px; height: 4px; border-radius: 50%; background: var(--rose); }
.ml-cal-quick { display: flex; gap: 6px; margin-top: 12px; }
.ml-cal-quick button { flex: 1; border: 1px solid var(--border); background: var(--surface); color: var(--text-secondary); font-size: 12px; padding: 6px 0; border-radius: 14px; cursor: pointer; font-family: var(--font-body); transition: all 0.2s ease; }
.ml-cal-quick button:active { transform: scale(0.95); }
.ml-cal-close { display: block; width: 100%; margin-top: 10px; border: 1px solid var(--rose); background: var(--rose-light); color: var(--rose); font-size: 13px; padding: 8px 0; border-radius: 16px; cursor: pointer; font-family: var(--font-body); transition: transform 0.2s ease, background 0.2s ease; }
.ml-cal-close:hover { background: rgba(201,168,168,0.2); }
.ml-cal-close:active { transform: scale(0.96); }

/* ===== 帮助按钮 + 弹层 ===== */
.ml-help-btn {
    position: absolute; top: 12px; right: 12px;
    width: 30px; height: 30px;
    display: flex; align-items: center; justify-content: center;
    border: 1px solid var(--rose); background: var(--rose-light);
    color: var(--ml-rose-deep); border-radius: 50%; cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 4px rgba(201,168,168,0.08);
}
.ml-help-btn:hover { background: rgba(201,168,168,0.18); border-color: var(--ml-rose-deep); }
.ml-config-btn { right: 50px; }
.ml-help-btn:active { transform: scale(0.9); }
.ml-help-overlay {
    position: absolute; inset: 0; z-index: 60;
    display: flex; align-items: center; justify-content: center;
    background: rgba(20,16,14,0.35);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.ml-help-panel {
    width: 86%; max-width: 340px; max-height: 78%;
    background: var(--surface-solid); border: 1px solid var(--border);
    border-radius: 20px; padding: 20px 18px 16px;
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    overflow-y: auto;
}
.ml-help-en { font-family: var(--font-decorative, 'Playfair Display', serif); font-style: italic; font-size: 13px; color: var(--gold); text-align: center; letter-spacing: 1.5px; }
.ml-help-title { font-family: var(--font-body); font-size: 18px; font-weight: 600; color: var(--text-primary); text-align: center; margin: 2px 0 8px; }
.ml-help-line { width: 36px; height: 1px; margin: 0 auto 14px; background: linear-gradient(90deg, transparent, var(--gold), transparent); }
.ml-help-section { margin-bottom: 10px; }
/* 板块编号标题（层次分明：1..4 几大类，下面再细分条目）*/
.ml-help-num {
    font-size: 13px; font-weight: 700; color: var(--text-primary);
    margin: 16px 0 8px; padding: 9px 12px; border-radius: 12px;
    background: linear-gradient(90deg, rgba(201,168,168,0.12), rgba(201,168,168,0.04));
    border-left: 3px solid var(--rose);
}
.ml-help-item {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 8px 10px; border-radius: 12px;
    transition: background 0.15s ease;
}
.ml-help-item:hover { background: var(--rose-light); }
.ml-help-icon {
    flex-shrink: 0; width: 28px; height: 28px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%; font-size: 13px;
}
.ml-help-icon.main { background: var(--rose-light); color: var(--ml-rose-deep); }
.ml-help-icon.all { background: var(--sage-light); color: var(--sage); }
.ml-help-icon.treasure { background: var(--gold-light); color: var(--gold-dark); }
.ml-help-icon.stats { background: var(--lavender-light); color: var(--lavender); }
.ml-help-item-body { flex: 1; min-width: 0; }
.ml-help-item-label { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.ml-help-item-desc { font-size: 11px; color: var(--text-muted); margin-top: 2px; line-height: 1.4; }
.ml-help-panel .ml-btn { margin-top: 14px; width: 100%; }

/* ===== 发生时间选择器 ===== */
.ml-time-field { display: flex; align-items: center; gap: 8px; }
.ml-time-field-label { font-size: 13px; color: var(--text-primary); flex: 1; }
.ml-time-field-btn {
    border: 1px solid var(--rose); background: var(--rose-light);
    color: var(--rose-hover); font-size: 12px; padding: 6px 14px;
    border-radius: 15px; cursor: pointer; font-family: var(--font-body);
    transition: transform 0.2s ease;
}
.ml-time-field-btn:active { transform: scale(0.94); }
.ml-dt-overlay {
    position: absolute; inset: 0; z-index: 70;
    display: flex; align-items: center; justify-content: center;
    background: rgba(20,16,14,0.45);
}
.ml-dt-panel {
    width: 86%; max-width: 320px;
    background: var(--surface-solid); border: 1px solid var(--border);
    border-radius: 20px; padding: 16px; box-shadow: var(--shadow-lg);
}
.ml-dt-title { font-size: 16px; font-weight: 600; color: var(--text-primary); text-align: center; margin-bottom: 10px; }
.ml-dt-head { display: flex; align-items: center; justify-content: space-between; padding: 0 4px 8px; }
.ml-dt-month { font-size: 15px; font-weight: 600; color: var(--text-primary); font-family: var(--font-body); }
.ml-dt-cal { margin-bottom: 10px; }
.ml-cal-day.selected { background: var(--accent-gradient); color: var(--on-accent); }
.ml-dt-time { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 8px 0; }
.ml-dt-time-unit { font-size: 12px; color: var(--text-muted); }
.ml-dt-timeval { font-size: 18px; font-weight: 600; color: var(--text-primary); min-width: 26px; text-align: center; font-family: var(--font-decorative, 'Playfair Display', serif); }
.ml-dt-step {
    width: 28px; height: 28px; border: 1px solid var(--border);
    background: var(--surface); color: var(--rose); border-radius: 50%;
    cursor: pointer; font-size: 15px; transition: transform 0.15s ease;
}
.ml-dt-step:active { transform: scale(0.88); }
.ml-dt-actions { display: flex; gap: 10px; margin-top: 10px; }

/* ===== 动效：下滑感（交错入场）===== */
.ml-card { transform: translateZ(0); }
.ml-card.ml-reveal-in { animation: mlReveal 0.5s cubic-bezier(.2,.7,.2,1) both; }
@keyframes mlReveal {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== 动效：浮动感（呼吸）===== */
@keyframes mlFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

/* ===== 动效：空间感（hover 简洁上浮）===== */
.ml-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

/* ===== 搜索行 ===== */
.ml-search { flex: 1; min-width: 0; }

/* ===== 操作按钮（写在筛选行最右）+ 筛选行 ===== */
.ml-act-btn {
    display: flex; align-items: center; gap: 4px;
    border: 1px solid var(--rose); background: var(--rose-light);
    color: var(--ml-rose-deep); font-size: 12px; padding: 8px 14px;
    border-radius: 16px; cursor: pointer; font-family: var(--font-body);
    box-shadow: var(--shadow-xs);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.ml-act-btn:hover { box-shadow: var(--shadow-sm); }
.ml-act-btn:active { transform: scale(0.95); }
.ml-act-import { border-color: var(--sage); background: var(--sage-light); color: var(--sage); }
.ml-act-import:hover { filter: brightness(1.15); }

    flex-shrink: 0; display: flex; align-items: center; gap: 4px;
    border: 1px solid var(--border); background: var(--surface);
    color: var(--text-secondary); font-size: 12px; padding: 7px 14px;
    border-radius: 15px; cursor: pointer; font-family: var(--font-body);
    transition: all 0.2s ease;
}
.ml-filter-btn.active {
    background: var(--accent-gradient); color: var(--on-accent);
    border-color: transparent;
    box-shadow: 0 2px 8px var(--accent-glow, rgba(201,168,168,0.3));
}

/* ===== 类型下拉面板（覆盖式弹层）===== */
.ml-type-panel {
    position: absolute; inset: 0; z-index: 45;
    background: rgba(20,16,14,0.35);
    display: flex; align-items: flex-start; justify-content: center;
    padding: 90px 16px 0;
}
    width: 100%; max-width: 340px;
    background: var(--surface-solid); border: 1px solid var(--border);
    border-radius: 16px; padding: 12px; box-shadow: var(--shadow-lg);
}
    width: 100%; border: 1px solid var(--border); background: var(--surface);
    border-radius: 12px; padding: 8px 12px; font-size: 13px;
    color: var(--text-primary); font-family: var(--font-body); outline: none;
}
.ml-type-list { max-height: 260px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.ml-type-item {
    display: flex; align-items: center; justify-content: space-between;
    border: none; background: none; color: var(--text-secondary);
    font-size: 13px; padding: 8px 10px; border-radius: 10px;
    cursor: pointer; font-family: var(--font-body); text-align: left;
    transition: background 0.15s ease;
}
.ml-type-item:active { background: var(--rose-light); }
.ml-type-item.active { background: var(--rose-light); color: var(--rose-hover); font-weight: 600; }
.ml-type-count { font-size: 11px; color: var(--text-muted); }

/* ===== 管理按钮 + 批量条 ===== */
.ml-manage-btn {
    border: 1px solid var(--border); background: var(--surface);
    color: var(--text-secondary); font-size: 12px; padding: 6px 14px;
    border-radius: 13px; cursor: pointer; font-family: var(--font-body);
    transition: transform 0.2s ease;
}
.ml-manage-btn:active { transform: scale(0.95); }
.ml-batch-bar {
    position: fixed; left: 0; right: 0; bottom: calc(var(--nav-height) + var(--safe-bottom)); z-index: 40;
    display: flex; align-items: center; gap: 6px;
    padding: 10px 16px 10px;
    background: var(--surface-solid); border-top: 1px solid var(--border);
    box-shadow: 0 -4px 16px rgba(0,0,0,0.08);
}
.ml-batch-count { flex: 1; font-size: 12px; color: var(--text-secondary); }
.ml-batch-bar button {
    border: 1px solid var(--border); background: var(--surface);
    color: var(--text-secondary); font-size: 12px; padding: 7px 12px;
    border-radius: 15px; cursor: pointer; font-family: var(--font-body);
    transition: transform 0.2s ease;
}
.ml-batch-bar button:active { transform: scale(0.94); }
.ml-batch-bar .ml-batch-done { background: var(--accent-gradient); color: var(--on-accent); border-color: transparent; }

/* ===== 卡片勾选框（管理模式）===== */
.ml-card-check { margin-bottom: 6px; }
.ml-check-box {
    display: inline-block; width: 18px; height: 18px;
    border: 1.5px solid var(--rose); border-radius: 50%;
    background: transparent; transition: background 0.2s ease, border-color 0.2s ease;
}
.ml-check-box.checked { background: var(--rose); border-color: var(--rose); }

/* ===== 主页近7天小图 ===== */
    margin: 2px 18px 0; padding: 10px 12px 8px;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 16px; box-shadow: var(--shadow-sm);
}
.ml-mini-chart-bars { display: flex; align-items: stretch; gap: 6px; height: 58px; }
.ml-mini-col { flex: 1; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 3px; cursor: pointer; transition: transform 0.2s ease; }
.ml-mini-col:active { transform: scale(0.94); }
.ml-mini-num { font-size: 10px; color: var(--text-secondary); }
.ml-mini-bar { width: 100%; max-width: 20px; border-radius: 4px 4px 0 0; background: linear-gradient(180deg, var(--rose), var(--gold)); opacity: calc(0.45 + var(--bar-pct, 50) * 0.0055); min-height: 3px; transition: height 0.4s cubic-bezier(0.2, 0.7, 0.2, 1); }
.ml-mini-bar-zero { min-height: 0; height: 0 !important; opacity: 0; }
.ml-mini-label { font-size: 9px; color: var(--text-muted); }

/* ===== 窄屏适配 <370px ===== */
@media (max-width: 370px) {
    .ml-filter-actions .ml-act-btn span { display: none; }
    .ml-filter-actions .ml-act-btn { padding: 6px 9px; }
    .ml-act-btn { font-size: 11px; padding: 5px 9px; }
    .ml-stat { padding: 8px 12px; }
    .ml-stat-num { font-size: 20px; }
    .ml-vtab { font-size: 12px; padding: 9px 0; }
    .ml-detail-scroll { padding: 14px 12px; padding-bottom: calc(80px + var(--safe-bottom, 0px) + var(--kbd-h, 0px)); }
    .ml-fade-pill { display: none; }
    .ml-detail-actions { gap: 6px; }
    .ml-detail-actions .ml-btn { font-size: 11px; padding: 8px 0; }
    .ml-fade-slider-card { width: 94%; padding: 20px 14px 16px; }
    .ml-mini-chart-bars { gap: 3px; height: 48px; }
}

/* ===== 统计：每日记忆日历 ===== */
.ml-calendar-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 16px; padding: 12px; box-shadow: var(--shadow-sm);
}
.ml-cal-head { display: flex; align-items: center; justify-content: space-between; padding: 0 2px 10px; }
.ml-cal-title { font-size: 15px; font-weight: 600; color: var(--text-primary); font-family: var(--font-body); }
.ml-cal-day { position: relative; flex-direction: column; gap: 0; padding: 2px 0; }
.ml-cal-num { font-size: 13px; color: var(--text-primary); line-height: 1.2; }
.ml-cal-count { font-size: 9px; color: var(--ml-rose-deep); font-weight: 600; line-height: 1; margin-top: 1px; }
.ml-cal-day.has-mem { background: var(--rose-light); }
.ml-cal-day.today .ml-cal-num { color: var(--rose); font-weight: 700; }

/* ===== 清除筛选按钮 ===== */
    flex-shrink: 0; border: 1px solid var(--sage); background: var(--sage-light);
    color: var(--sage); font-size: 11px; padding: 4px 10px; border-radius: 13px;
    cursor: pointer; font-family: var(--font-body); transition: transform 0.2s ease;
}

/* 主页/珍藏 内容区整体放进 .ml-scroll 后，子元素自带左右边距会产生双重缩进，统一去掉由 .ml-scroll 控制 */
.ml-home .ml-scroll .ml-home-today { padding: 4px 0 2px; }
.ml-home .ml-scroll .ml-section-head { padding: 14px 0 8px; }
.ml-home .ml-scroll .ml-mini-chart { margin: 2px 0 0; }
.ml-home .ml-scroll .ml-featured { margin: 0; }
.ml-treasure-view .ml-scroll .ml-section-head { padding: 14px 0 8px; }
.ml-treasure-view .ml-treasure-sec { padding: 0; }

/* ===== 今日时间线（主页）===== */
.ml-today-timeline { margin-top: 8px; display: flex; flex-direction: column; gap: 0; }
.ml-today-item {
    display: flex; align-items: center; gap: 10px;
    padding: 6px 2px; cursor: pointer; border-radius: 8px;
    transition: background 0.15s ease;
}
.ml-today-item:active { background: var(--rose-light); }
.ml-today-dot { flex-shrink: 0; width: 7px; height: 7px; border-radius: 50%; background: var(--rose); box-shadow: 0 0 0 3px var(--rose-light); }
.ml-today-item-time { flex-shrink: 0; font-size: 11px; color: var(--text-muted); min-width: 52px; }
.ml-today-item-text { font-size: 13px; color: var(--text-primary); line-height: 1.4; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 问题⑦：today 时间线超过 6 条自动折叠，默认只看前 5 条 +「展开全部」 */
.ml-today-foldbtn {
    width: 100%; margin: 8px 0 0; padding: 9px 0; border: 1px dashed var(--border);
    background: var(--surface); color: var(--ml-rose-deep); font-size: 12.5px; border-radius: 12px;
    cursor: pointer; font-family: var(--font-body); transition: all .2s ease;
}
.ml-today-foldbtn:active { transform: scale(.98); background: var(--rose-light); }

/* ===== 今天想和你重温（主页）===== */
.ml-featured-card {
    background: var(--surface);
    border: 1px solid var(--gold); border-radius: 16px;
    padding: 14px 16px; cursor: pointer;
    box-shadow: var(--shadow-xs); transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.ml-featured-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.ml-featured-card:active { transform: scale(0.985); }
.ml-featured-en { font-family: var(--font-decorative, 'Playfair Display', serif); font-style: italic; font-size: 11px; color: var(--gold-dark); letter-spacing: 1.5px; }
.ml-featured-title { font-size: 16px; font-weight: 600; color: var(--text-primary); margin-top: 4px; line-height: 1.4; }
.ml-featured-time { font-size: 11px; color: var(--text-muted); margin-top: 3px; }
.ml-featured-summary { font-size: 13px; color: var(--text-secondary); margin-top: 6px; line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ===== 珍藏视图 ===== */
.ml-treasure-view { display: block; }
.ml-treasure-sec { padding: 0 18px; }
.ml-treasure-empty {
    font-size: 12px; color: var(--text-muted); line-height: 1.6;
    padding: 12px 14px; background: var(--surface);
    border: 1px dashed var(--border); border-radius: 14px;
}
/* 珍藏三区：折叠头 + 分页 */
.ml-treasure-head .ml-fold-arrow {
    margin-left: auto; width: 16px; height: 16px; position: relative; flex-shrink: 0;
    align-self: center;
}
.ml-treasure-head .ml-fold-arrow::before {
    content: ''; position: absolute; left: 3px; top: 5px; width: 9px; height: 9px;
    border-right: 1.6px solid var(--text-muted); border-bottom: 1.6px solid var(--text-muted);
    transform: rotate(45deg); transition: transform 0.3s ease;
}
.ml-treasure-head .ml-fold-arrow.collapsed::before { transform: rotate(-45deg); }
.ml-treasure-body {
    display: grid; grid-template-rows: 1fr;
    transition: grid-template-rows 0.35s cubic-bezier(0.2, 0.7, 0.2, 1), opacity 0.3s ease;
}
.ml-treasure-body.collapsed { grid-template-rows: 0fr; opacity: 0.6; }
.ml-treasure-inner { overflow: hidden; min-height: 0; }
.ml-treasure-body.collapsed .ml-treasure-inner { pointer-events: none; }
.ml-pager { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 4px 0 2px; }
.ml-pager-btn {
    width: 30px; height: 30px; border-radius: 50%;
    border: 1px solid var(--rose); background: var(--rose-light); color: var(--ml-rose-deep);
    display: flex; align-items: center; justify-content: center; cursor: pointer;
    transition: transform 0.2s ease, opacity 0.2s ease;
}
.ml-pager-btn:active { transform: scale(0.9); }
.ml-pager-btn:disabled { opacity: 0.35; cursor: default; }
.ml-pager-info { font-size: 12px; color: var(--text-secondary); font-family: var(--font-decorative, 'Playfair Display', serif); letter-spacing: 1px; }

/* ===== 详情页：相似记忆 / 完整时间线 ===== */
.ml-detail-links { display: flex; gap: 10px; margin-top: 12px; }
.ml-btn-ghost { flex: 1; border: 1px solid var(--rose); background: var(--rose-light); color: var(--ml-rose-deep); }
.ml-link-btn { display: flex; align-items: center; justify-content: center; gap: 4px; }
.ml-link-arrow { flex-shrink: 0; transition: transform 0.25s ease; }
.ml-link-btn.open .ml-link-arrow { transform: rotate(180deg); }
.ml-detail-related, .ml-detail-timeline { margin-top: 14px; }
.ml-detail-sub-title {
    font-size: 13px; font-weight: 600; color: var(--text-primary);
    margin-bottom: 8px; display: flex; align-items: center; gap: 6px;
}
.ml-detail-sub-title::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--gold); }
.ml-detail-sub-loading, .ml-detail-sub-empty { font-size: 12px; color: var(--text-muted); padding: 8px 0; }
.ml-similar-row {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 12px; padding: 9px 12px; margin-bottom: 6px; cursor: pointer;
    transition: transform 0.15s ease;
}
.ml-similar-row:active { transform: scale(0.97); }
.ml-similar-title { font-size: 13px; color: var(--text-primary); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ml-similar-score { flex-shrink: 0; font-size: 11px; color: var(--ml-rose-deep); font-weight: 600; }
.ml-timeline { position: relative; padding-left: 14px; }
.ml-timeline::before { content: ''; position: absolute; left: 3px; top: 8px; bottom: 8px; width: 1.5px; background: linear-gradient(180deg, var(--rose), var(--gold)); }
.ml-tl-item { position: relative; padding: 6px 0 6px 12px; cursor: pointer; }
.ml-tl-dot { position: absolute; left: -14px; top: 12px; width: 8px; height: 8px; border-radius: 50%; background: var(--surface-solid); border: 2px solid var(--rose); }
.ml-tl-item.self .ml-tl-dot { background: var(--gold); border-color: var(--gold-dark); }
.ml-tl-body { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 8px 12px; transition: transform 0.15s ease; }
.ml-tl-item:active .ml-tl-body { transform: scale(0.97); }
.ml-tl-time { font-size: 11px; color: var(--text-muted); }
.ml-tl-title { font-size: 13px; color: var(--text-primary); margin-top: 2px; line-height: 1.4; }
.ml-tl-self { display: inline-block; font-size: 10px; color: var(--gold-dark); border: 1px solid var(--gold); border-radius: 8px; padding: 0 6px; margin-left: 4px; }

/* ===== 记忆 AI 设置弹层 ===== */
/* ===== 记忆 AI 设置弹层 ===== */
.ml-config-overlay {
    position: absolute; inset: 0; z-index: 75;
    display: flex; align-items: center; justify-content: center;
    background: rgba(30,28,26,0.28);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}
.ml-config-panel {
    width: 88%; max-width: 320px; max-height: 85%;
    background: var(--surface-solid, #FFFCFA); border: 1px solid rgba(201,168,168,0.15);
    border-radius: 22px; padding: 26px 22px 22px;
    box-shadow: 0 4px 32px rgba(30,28,26,0.08), 0 0 0 1px rgba(201,168,168,0.06);
    overflow-y: auto;
}
.ml-config-en {
    font-family: var(--font-display, 'Playfair Display', serif); font-style: italic;
    font-size: 14px; color: var(--rose, #C9A8A8); text-align: center; letter-spacing: 0.04em;
    margin-bottom: 2px;
}
.ml-config-title {
    font-family: var(--font-body); font-size: 17px; font-weight: 600;
    color: var(--text-primary); text-align: center; margin-bottom: 10px;
}
.ml-config-line { width: 32px; height: 1px; margin: 0 auto 12px; background: var(--rose, #C9A8A8); opacity: 0.3; }

/* 状态行 */
.ml-config-status { font-size: 12px; text-align: center; margin-bottom: 14px; line-height: 1.6; min-height: 18px; padding: 8px 12px; border-radius: 10px; }
.ml-config-ok { color: var(--sage); background: var(--sage-light); }
.ml-config-warn { color: var(--text-secondary); background: rgba(201,168,168,0.06); }

/* 覆盖配置：居中主按钮（问题②：不做成不起眼的链接，做显眼的居中按钮） */
.ml-config-override-btn {
    width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px;
    padding: 12px 0; font-size: 14px; font-family: var(--font-body); font-weight: 600;
    border: none; border-radius: 14px; cursor: pointer; color: var(--on-accent, #5A3D3D);
    background: var(--accent-gradient, var(--rose-dark, #A88080));
    box-shadow: 0 2px 10px var(--accent-glow, rgba(201,168,168,.3));
    transition: all .2s ease;
}
.ml-config-override-btn:active { transform: scale(.98); }
.ml-config-override-btn .ml-config-toggle-adv-arrow {
    width: 8px; height: 8px; border-right: 1.6px solid currentColor; border-bottom: 1.6px solid currentColor;
    transform: rotate(45deg); transition: transform .25s ease; margin-top: -2px;
}
.ml-config-override-btn .ml-config-toggle-adv-arrow.collapsed { transform: rotate(-135deg); }

/* 覆盖配置区块（问题③：有重点、有分区，不再一堆平铺）*/
.ml-config-adv { margin-top: 14px; display: flex; flex-direction: column; gap: 14px; }
.ml-config-sec {
    padding: 14px 14px 10px; border-radius: 16px;
    background: rgba(201,168,168,0.05); border: 1px solid rgba(201,168,168,0.14);
}
.ml-config-sec-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 10px; }
.ml-config-sec-title { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.ml-config-sec-en { font-family: var(--font-decorative, 'Playfair Display', serif); font-style: italic; font-size: 11px; color: var(--gold); letter-spacing: 1px; }
.ml-config-sec-desc { font-size: 11px; color: var(--text-muted); margin-bottom: 10px; line-height: 1.5; }
.ml-config-sec-body { display: flex; flex-direction: column; gap: 10px; }
.ml-field { display: flex; flex-direction: column; gap: 5px; }
.ml-field label { font-size: 11px; color: var(--text-muted); }
.ml-config-select {
    width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px;
    background: var(--surface-solid); color: var(--text-primary); font-size: 13px; font-family: var(--font-body);
    outline: none; -webkit-appearance: none; appearance: none; cursor: pointer; transition: border-color .2s ease;
}
.ml-config-select:focus { border-color: var(--rose); }
.ml-config-select option { color: var(--text-primary); background: var(--surface-solid); }

.ml-config-actions { display: flex; gap: 10px; margin-top: 4px; }
.ml-config-save {
    flex: 1; padding: 10px 0; font-size: 13px; font-family: var(--font-body); font-weight: 600;
    border: none; border-radius: 12px; cursor: pointer;
    background: rgba(201,168,168,0.15); color: var(--ml-rose-deep, #7A5A5A);
    transition: all 0.2s ease;
}
.ml-config-save:hover { background: rgba(201,168,168,0.25); }
.ml-config-save:active { transform: scale(0.97); }
.ml-config-cancel {
    flex: 1; padding: 10px 0; font-size: 13px; font-family: var(--font-body);
    border: 1px solid rgba(201,168,168,0.12); border-radius: 12px; cursor: pointer;
    background: transparent; color: var(--text-secondary); transition: all 0.2s ease;
}
.ml-config-cancel:hover { border-color: var(--rose); }
.ml-config-cancel:active { transform: scale(0.97); }

.ml-switch-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13px; color: var(--text-primary); padding: 4px 0; }

/* ===== 记忆卡片气泡（聊天框内）===== */
.memory-card-bubble {
    max-width: 260px; background: var(--surface);
    border: 1px solid var(--rose); border-radius: 16px;
    overflow: hidden; box-shadow: var(--shadow-sm);
    font-family: var(--font-body);
}
.mem-card-deco {
    height: 3px;
    background: linear-gradient(90deg, var(--rose), var(--gold), var(--rose));
}
.mem-card-body { padding: 12px 14px; }
.mem-card-title { font-size: 14px; font-weight: 600; color: var(--text-primary); line-height: 1.4; }
.mem-card-summary { font-size: 12px; color: var(--text-secondary); margin-top: 6px; line-height: 1.5; }
.mem-card-meta { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 11px; }
.mem-card-time { color: var(--text-muted); }
.mem-card-groups { display: flex; gap: 4px; }
.mem-card-group { font-size: 10px; color: var(--ml-rose-deep); background: var(--rose-light); padding: 1px 7px; border-radius: 8px; }

/* ===== 骨架屏加载动画 ===== */
.ml-skeleton {
    background: linear-gradient(90deg, var(--border) 25%, var(--rose-light) 50%, var(--border) 75%);
    background-size: 200% 100%;
    animation: mlShimmer 1.4s ease-in-out infinite;
    border-radius: 10px;
}
@keyframes mlShimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
.ml-sk-card {
    height: 72px; border-radius: 16px;
    margin-bottom: 11px;
}
.ml-sk-today {
    height: 80px; border-radius: 16px;
    margin-bottom: 14px;
}
    height: 58px; border-radius: 16px;
    margin: 0 0 14px;
}
    height: 90px; border-radius: 16px;
    margin-bottom: 14px;
}
    height: 18px; width: 80px; border-radius: 9px;
    margin-bottom: 6px;
}
.ml-sk-dist {
    height: 120px; border-radius: 16px;
    margin-bottom: 14px;
}
.ml-sk-calendar {
    height: 160px; border-radius: 16px;
    margin-bottom: 14px;
}
.ml-sk-treasure-sec {
    height: 100px; border-radius: 16px;
    margin-bottom: 14px;
}

/* ===== 减少动态偏好 ===== */
@media (prefers-reduced-motion: reduce) {
    .ml-card, .ml-stat, .ml-btn, .ml-group-chip, .ml-vtab, .ml-filter-btn, .ml-act-btn, .ml-featured-card, .ml-mini-col, .ml-similar-row, .ml-tl-item .ml-tl-body { transition: none; }
    .ml-card:hover, .ml-stat:active, .ml-btn:active, .ml-group-chip:active, .ml-vtab:active, .ml-filter-btn:active, .ml-act-btn:active, .ml-featured-card:active { transform: none; }
    .ml-card.ml-reveal-in { animation: none; opacity: 1; transform: none; }
    .ml-skeleton { animation: none; background: var(--border); }
}

/* ===== 列表日期分组头（今天 / 昨天 / N天前 / 年月）===== */
    display: flex; align-items: center; gap: 8px;
    margin: 14px 4px 6px;
    font-size: 12px; font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 1px;
}
    content: ''; flex: 1; height: 1px;
    background: linear-gradient(90deg, transparent, var(--border), transparent);
}
.ml-list-view .ml-date-group:first-child, .ml-home-list .ml-date-group:first-child { margin-top: 2px; }

/* ===== 详情页：对话原文区 ===== */
.ml-detail-ctx-body { margin-top: 14px; }
.ml-detail-ctx-text {
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 2px solid var(--gold);
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 12.5px;
    line-height: 1.7;
    color: var(--text-primary);
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 46vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* ===== 统计页：记忆库空间卡 ===== */
.ml-storage-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 14px 16px;
}
.ml-storage-en {
    font-family: var(--font-decorative, 'Playfair Display', Georgia, serif);
    font-style: italic; font-size: 15px; color: var(--gold);
    letter-spacing: 2px; margin-bottom: 10px;
}
.ml-storage-row {
    display: flex; align-items: center; justify-content: space-between;
    font-size: 13px; color: var(--text-secondary);
    padding: 5px 0;
}
.ml-storage-row b { color: var(--text-primary); font-weight: 600; font-variant-numeric: tabular-nums; }
.ml-storage-total {
    border-top: 1px dashed var(--border);
    margin-top: 6px; padding-top: 8px;
    color: var(--text-primary); font-weight: 600;
}
.ml-storage-note { margin-top: 8px; font-size: 11px; color: var(--text-muted); line-height: 1.6; }

/* ===== 时间筛选：8 个快捷按钮换行 ===== */
.ml-cal-quick { flex-wrap: wrap; }
.ml-cal-quick button { flex: 1 0 21%; }
.ml-cal-quick button:active { background: var(--rose-light); color: var(--ml-rose-deep); }

/* ===== 分类书签栏（彩色 + 数量）===== */
.ml-cat-bar { display: flex; gap: 8px; overflow-x: auto; padding: 2px 18px 8px; scrollbar-width: none; -ms-overflow-style: none; }
.ml-cat-bar::-webkit-scrollbar { display: none; width: 0; height: 0; }
.ml-cat-chip { flex-shrink: 0; display: inline-flex; align-items: center; gap: 5px; padding: 6px 11px; border-radius: 16px; border: 1px solid var(--border); background: var(--surface-solid); color: var(--text-secondary); font-size: 12px; cursor: pointer; transition: all .25s cubic-bezier(.2,.9,.2,1); }
.ml-cat-chip:hover { transform: translateY(-1px); box-shadow: var(--shadow-xs); }
.ml-cat-chip:active { transform: scale(.96); }
.ml-cat-chip svg { color: var(--cat-color, var(--accent-rose)); }
.ml-cat-chip .ml-cat-count { font-variant-numeric: tabular-nums; font-size: 10px; color: var(--text-muted); background: rgba(0,0,0,.04); padding: 1px 6px; border-radius: 9px; }
.ml-cat-chip.active { background: var(--cat-color, var(--accent)); border-color: var(--cat-color, var(--accent)); color: #3E2F2F; }
.ml-cat-chip.active:hover { box-shadow: 0 4px 12px rgba(0,0,0,.14); }
.ml-cat-chip.active .ml-cat-count { background: rgba(0,0,0,.12); color: #3E2F2F; }
.ml-cat-chip.active svg { color: #3E2F2F; }
.ml-cat-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--cat-color, var(--accent-rose)); display: inline-block; }

/* ===== 「渐淡」两栏分区（问题①@渐淡：正在变淡 / 彻底消失）===== */
.ml-fade-sec-head { display: flex; align-items: center; gap: 8px; margin: 14px 0 6px; cursor: pointer; user-select: none; transition: opacity .2s ease; }
.ml-fade-sec-head:active { opacity: .7; }
.ml-fade-sec-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.ml-fade-sec-dot.fa-fading { background: var(--rose); box-shadow: 0 0 0 4px rgba(201,168,168,.16); }
.ml-fade-sec-dot.fa-gone { background: var(--text-muted); box-shadow: 0 0 0 4px rgba(0,0,0,.06); }
.ml-fade-sec-title { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.ml-fade-sec-count { font-size: 11px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.ml-fade-sec-head .ml-fold-arrow { margin-left: auto; width: 16px; height: 16px; position: relative; flex-shrink: 0; align-self: center; }
.ml-fade-sec-head .ml-fold-arrow::before { content: ''; position: absolute; left: 3px; top: 5px; width: 9px; height: 9px; border-right: 1.6px solid var(--text-muted); border-bottom: 1.6px solid var(--text-muted); transform: rotate(45deg); transition: transform .3s ease; }
.ml-fade-sec-head .ml-fold-arrow.collapsed::before { transform: rotate(-45deg); }
/* 折叠容器: grid-template-rows 过渡，遵守 DOM 铁律（同珍藏） */
.ml-fade-sec-body { display: grid; grid-template-rows: 1fr; transition: grid-template-rows .35s cubic-bezier(.2,.7,.2,1), opacity .3s ease; }
.ml-fade-sec-body.collapsed { grid-template-rows: 0fr; opacity: .6; }
.ml-fade-sec-inner { overflow: hidden; min-height: 0; }
.ml-fade-sec-body.collapsed .ml-fade-sec-inner { pointer-events: none; }
.ml-fade-sec-list { display: flex; flex-direction: column; gap: 0; }
.ml-fade-sec-empty { font-size: 12.5px; color: var(--text-muted); padding: 10px 2px 4px; line-height: 1.6; }

/* ===== 分类书脊 + 身份区隔 ===== */
.ml-card { position: relative; }
.ml-card-spine { position: absolute; left: 0; top: 0; bottom: 0; width: 4px; border-radius: 4px 0 0 4px; opacity: .78; }
.ml-card-treasure { box-shadow: 0 0 0 1px rgba(196,168,106,.30), 0 6px 18px rgba(196,168,106,.14); }
.ml-card-important { border-color: rgba(201,168,168,.35); box-shadow: 0 6px 18px rgba(201,168,168,.16); }
.ml-card-groups { display: flex; align-items: center; gap: 4px; font-size: 11px; margin-top: 6px; }
.ml-card-groups svg { color: currentColor; }

/* ===== 手账式时间线（日期圆点 + 标签）===== */
.ml-tl-item { position: relative; padding-left: 2px; }
.ml-tl-day { display: flex; align-items: center; gap: 8px; margin: 10px 0 6px; padding-left: 2px; }
.ml-tl-day-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent-rose, #C9A8A8); box-shadow: 0 0 0 4px rgba(201,168,168,.14); flex-shrink: 0; }
.ml-tl-day-label { font-family: var(--font-decorative, 'Playfair Display', Georgia, serif); font-style: italic; font-size: 12px; color: var(--text-secondary); letter-spacing: 1px; }
.ml-tl-day::after { content: ''; flex: 1; height: 1px; background: var(--gold, #C4A86A); opacity: .18; margin-left: 2px; }

/* ===== 卡片分类+日期 一行（问题③：日期清楚，不显示负数天）===== */
.ml-card-sub { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 6px; }
.ml-card-sub .ml-card-groups { margin-top: 0; flex-shrink: 0; max-width: 55%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ml-card-date { flex-shrink: 0; font-size: 11px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
/* 琐事标记：淡雅一点，跟珍藏/渐淡那些徽章同一套观感（禁 emoji，纯文字） */
.ml-badge-trivial { color: var(--text-secondary); border-color: var(--border); background: rgba(140,170,120,.10); margin-right: auto; }
/* ★ 2028-09 甲方定：卡片里「琐事」要紧挨着分类同一行（不去撑高卡片、不把它推到中间），
   日期仍然贴右（margin-left:auto）——这样一行放下三个东西，卡片高度才统一。 */
.ml-card-sub .ml-badge-trivial { margin-right: 0; padding: 1px 7px; line-height: 1.5; font-size: 9.5px; }
.ml-card-sub .ml-card-date { margin-left: auto; }

/* 「按程度」子标签（正事 / 琐事）：和点「按时间」冒出的时间条同一种感觉 */
.ml-kind-row { display: flex; padding: 0 18px 6px; }
.ml-kind-chips { display: flex; gap: 6px; flex: 1; min-width: 0; }
.ml-kind-chip {
    flex: 0 0 auto; white-space: nowrap;
    border: 1px solid var(--border); background: var(--surface); color: var(--text-secondary);
    font-size: 12px; padding: 6px 13px; border-radius: 14px; cursor: pointer;
    font-family: var(--font-body); transition: all .2s ease;
}
.ml-kind-chip:active { transform: scale(.95); }
.ml-kind-chip.active { border-color: var(--rose); background: var(--rose-light); color: var(--ml-rose-deep); font-weight: 600; }
@media (max-width: 400px) {
    .ml-sort-btn { font-size: 11.5px; min-width: 30px; padding: 6px 2px; }
    .ml-manage-btn { padding: 5px 10px; font-size: 11.5px; }
}
@media (max-width: 369px) {
    .ml-sort-btn { font-size: 11px; min-width: 27px; letter-spacing: -.2px; }
}

/* ===== 旧记忆「琐事/正事」整理提示（2028 新增，一次性）===== */
.ml-kind-backfill {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    margin: 8px 18px 2px; padding: 10px 14px;
    background: var(--gold-light, rgba(196,168,106,.12));
    border: 1px solid rgba(196,168,106,.28); border-radius: 14px;
}
.ml-kb-text { flex: 1; min-width: 180px; font-size: 12px; line-height: 1.6; color: var(--text-secondary); }
.ml-kb-btn {
    border: 1px solid var(--rose); background: var(--rose-light, rgba(201,168,168,.18));
    color: var(--ml-rose-deep, #7A5A5A); font-size: 12px; padding: 6px 14px; border-radius: 13px;
    cursor: pointer; font-family: var(--font-body); flex: none; transition: all .2s ease;
}
.ml-kb-btn:active { transform: scale(.95); }
/* 次要按钮（「再试一次」这类）：不加底色，别跟主按钮抢 */
.ml-kb-btn-ghost { border-color: var(--border); background: transparent; color: var(--text-secondary); }
.ml-kb-btn-ghost:hover { border-color: var(--rose); color: var(--ml-rose-deep); }
@media (max-width: 369px) {
    .ml-kind-backfill { margin-left: 12px; margin-right: 12px; padding: 9px 12px; }
    .ml-kb-text { min-width: 140px; font-size: 11.5px; }
}
/* 关联人物小标签（★ 2028-09：容器永远在，固定一行高度 —— 有人的卡和没人的卡一样高） */
.ml-card-persons { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; min-height: 22px; }
.ml-person-chip { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; color: var(--sage); background: var(--sage-light); border: 1px solid rgba(140,170,120,.28); padding: 2px 8px; border-radius: 11px; cursor: pointer; transition: transform .15s ease, background .15s ease; }
.ml-person-chip:active { transform: scale(.93); background: rgba(140,170,120,.22); }

/* ===== 一行两个（grid，信息精简+压矮）===== */
.ml-list.ml-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ml-list.ml-grid .ml-tl-day { grid-column: 1 / -1; }
.ml-list.ml-grid .ml-card { padding: 10px 10px; }
.ml-list.ml-grid .ml-card-summary, .ml-list.ml-grid .ml-card-persons { display: none; }
/* ★ 2028-09 甲方定「两列也要一样高」：标题**恒占两行**（一行标题的卡也留出第二行的位置）。
   原来只写 line-clamp:2，一行标题的元素就只占一行 → 同排卡片差 20~39px（实测量尺
   tools/memcard-height-measure.js 抓到的真数值）。 */
.ml-list.ml-grid .ml-card-title { font-size: 14px; -webkit-line-clamp: 2; min-height: calc(14px * 1.35 * 2); }
/* ★ 2028-09 甲方定：「琐事」标要贴在分类右边，不许自己单独占一行。
   原来这里被改成 flex-direction:column → 分类 / 琐事 / 日期 各占一行，卡片被撑高 20px。 */
.ml-list.ml-grid .ml-card-sub { align-items: center; gap: 6px; margin-top: 4px; }
.ml-list.ml-grid .ml-card-sub .ml-card-groups { max-width: none; flex: 0 1 auto; min-width: 0; }
.ml-list.ml-grid .ml-card .ml-imp-bar { margin-top: 7px; }
.ml-list.ml-grid .ml-card .ml-fade-bar-mini { margin-top: 4px; }
.ml-list.ml-grid .ml-cat-chip, .ml-list.ml-grid .ml-tl-item { padding-left: 0; }

/* ===== 按天/按分类 切换 ===== */
.ml-mode-btn { border: none; background: transparent; color: var(--text-secondary); font-size: 12px; padding: 6px 14px; border-radius: 12px; cursor: pointer; font-family: var(--font-body); transition: all .2s ease; }
.ml-mode-btn.active { background: var(--accent); color: var(--on-accent); box-shadow: 0 2px 6px var(--accent-glow, rgba(201,168,168,.3)); }
/* 问题④：按时间/按分类 叠加筛选时，被隐藏的那一侧模式按钮持续闪烁高亮提醒 */
@keyframes mlModeBlink { 0%, 100% { box-shadow: 0 0 0 0 rgba(201,168,168,0); } 50% { box-shadow: 0 0 0 4px rgba(201,168,168,.42); } }
.ml-mode-btn.mb-blink { color: var(--ml-rose-deep); animation: mlModeBlink 1.1s ease-in-out infinite; }

/* ===== 加载更多 ===== */
.ml-load-more { display: block; width: 100%; margin: 12px 0 4px; padding: 11px 0; border: 1px dashed var(--border); background: var(--surface); color: var(--text-secondary); font-size: 13px; border-radius: 14px; cursor: pointer; transition: all .2s ease; }
.ml-load-more:active { transform: scale(.98); background: var(--rose-light); color: var(--ml-rose-deep); }

/* ===== 人物视图 ===== */
.ml-persona-view { display: block; }
.ml-persona-tab { border: none; background: transparent; color: var(--text-secondary); font-size: 12px; padding: 6px 14px; border-radius: 12px; cursor: pointer; font-family: var(--font-body); transition: all .2s ease; }
.ml-persona-tab.active { background: var(--accent); color: var(--on-accent); box-shadow: 0 2px 6px var(--accent-glow, rgba(201,168,168,.3)); }
.ml-act-add { padding: 7px 14px; }
.ml-persona-empty { text-align: center; padding: 56px 24px; }
.ml-persona-empty-deco { font-family: var(--font-decorative, 'Playfair Display', Georgia, serif); font-style: italic; font-size: 16px; color: var(--gold); opacity: .72; }
.ml-persona-empty-text { margin-top: 10px; font-size: 13px; color: var(--text-muted); line-height: 1.7; }

.ml-persona-card { display: flex; align-items: center; gap: 12px; padding: 13px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-xs); margin-bottom: 10px; cursor: pointer; transition: transform .2s ease, box-shadow .2s ease; }
.ml-persona-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.ml-persona-card:active { transform: scale(.98); }
.ml-persona-avatar { width: 46px; height: 46px; flex-shrink: 0; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 20px; color: #fff; font-weight: 600; font-family: var(--font-body); }
.ml-persona-info { flex: 1; min-width: 0; }
.ml-persona-name { font-size: 15px; font-weight: 600; color: var(--text-primary); display: flex; align-items: center; gap: 6px; }
.ml-persona-rel { font-size: 11px; color: var(--ml-rose-deep); background: var(--rose-light); padding: 1px 8px; border-radius: 9px; }
.ml-persona-sub { font-size: 12px; color: var(--text-muted); margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ml-persona-count { font-size: 11px; color: var(--sage); flex-shrink: 0; }

/* ===== 人物关系网（带连线/关系词 + 动效）===== */
.ml-persona-map-card { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow-sm); padding: 10px 12px; margin-top: 4px; }
.ml-persona-map-toolbar { display: flex; align-items: center; justify-content: space-between; padding: 0 2px 8px; }
.ml-persona-map-title { font-family: var(--font-decorative, 'Playfair Display', Georgia, serif); font-style: italic; font-size: 13px; color: var(--gold); letter-spacing: 1.5px; }
.ml-persona-zoom { display: inline-flex; gap: 6px; }
.ml-zoom-btn { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); color: var(--text-secondary); font-size: 16px; line-height: 1; cursor: pointer; font-family: var(--font-body); transition: all .2s ease; }
.ml-zoom-btn:active { transform: scale(.9); background: var(--rose-light); color: var(--rose); }
.ml-persona-map-wrap { position: relative; touch-action: none; }
.ml-persona-map-svg { width: 100%; display: block; user-select: none; -webkit-user-select: none; }
.ml-persona-node { cursor: pointer; }
.ml-persona-node-inner { opacity: 0; animation: mlPNodeIn .45s cubic-bezier(.2,.8,.2,1) forwards; }
.ml-persona-node circle { transform-box: fill-box; transform-origin: center; transition: transform .2s ease, filter .2s ease; }
.ml-persona-node:hover circle { transform: scale(1.1); filter: brightness(1.06); }
.ml-persona-node:active circle { transform: scale(.96); }
@keyframes mlPNodeIn { from { opacity: 0; transform: scale(.4); } to { opacity: 1; transform: scale(1); } }
.ml-persona-node-label { font-size: 11px; font-weight: 600; text-anchor: middle; }
.ml-node-name { transition: opacity .2s ease; }
/* 关系词：贴线转角度，去掉白底框（原 paint-order stroke 白圈已移除），只靠偏移离开线 */
.ml-persona-edge-label { font-size: 11px; fill: var(--text-secondary); text-anchor: middle; font-family: var(--font-body); transition: opacity .2s ease; }
/* 细节（小名/简介/生日）默认隐藏，由 _mapDetail 按缩放渐进显示 */
.ml-node-nick, .ml-node-note, .ml-node-birth { opacity: 0; transition: opacity .35s ease; fill: var(--text-muted); font-size: 10px; font-weight: 500; }
/* 随缩放渐显细节：缩小只留圆点，放大渐显名字/关系词 */
.ml-map-min .ml-node-name, .ml-map-min .ml-persona-edge-label { opacity: 0; }
.ml-map-mid .ml-node-name { opacity: 1; }
.ml-map-mid .ml-persona-edge-label { opacity: .6; }
.ml-map-full .ml-node-name, .ml-map-full .ml-persona-edge-label { opacity: 1; }
.ml-persona-center { animation: mlPPulse 3.4s ease-in-out infinite; }
.ml-persona-center circle { transform-box: fill-box; transform-origin: center; }
.ml-persona-center-label { font-size: 15px; font-weight: 700; fill: var(--ml-rose-deep); font-family: var(--font-body); }
@keyframes mlPPulse { 0%, 100% { opacity: 1; } 50% { opacity: .72; } }
.ml-persona-edge { opacity: 0; animation: mlPEdgeIn .5s ease forwards; }
.ml-persona-edge.rel { stroke-dasharray: 4 4; }
@keyframes mlPEdgeIn { to { opacity: 1; } }
.ml-persona-map-hint { font-size: 11px; color: var(--text-muted); text-align: center; margin-top: 8px; }

/* 人物详情：关系/小名/生日 一行紧凑排列 */
.ml-persona-detail-meta { display: flex; align-items: center; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 2px 0 4px; font-size: 12px; color: var(--text-secondary); }
.ml-persona-meta-sep { color: var(--rose); opacity: .55; }
.ml-persona-detail-meta span { font-weight: 500; }

/* 人物详情：hero 头像 + 名片式信息块（韩系法式唯美） */
.ml-persona-detail-hero { text-align: center; padding-bottom: 4px; }
.ml-persona-detail-avatar { width: 74px; height: 74px; border-radius: 50%; margin: 0 auto 8px; display: flex; align-items: center; justify-content: center; font-size: 32px; font-weight: 700; color: #fff; font-family: var(--font-body); box-shadow: 0 8px 22px rgba(160,110,110,.22), 0 0 0 4px var(--surface-solid), 0 0 0 5px var(--border); }
.ml-persona-detail-hero .ml-persona-sheet-en { margin-top: 2px; }
.ml-persona-detail-hero .ml-persona-sheet-title { font-size: 19px; margin: 2px 0 6px; }
.ml-persona-detail-hero .ml-persona-hero-line { margin-top: 10px; }
.ml-persona-field-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px; }
.ml-persona-field-label { font-size: 11px; color: var(--text-muted); margin-bottom: 8px; letter-spacing: .4px; }
.ml-persona-field-body { font-size: 13px; line-height: 1.65; color: var(--text-secondary); }
.ml-persona-field-card .ml-card-persons { display: flex; flex-wrap: wrap; gap: 6px; }

/* ===== 人物详情：关联记忆（搜索 + 预览）===== */
.ml-persona-detail-mem { display: flex; align-items: center; gap: 8px; padding: 9px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; margin-bottom: 6px; cursor: pointer; transition: transform .15s ease; }
.ml-persona-detail-mem:active { transform: scale(.98); }
.ml-persona-detail-mem-title { font-size: 13px; color: var(--text-primary); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ml-persona-detail-mem-time { font-size: 11px; color: var(--text-muted); flex-shrink: 0; }
.mpp-link-row { display: flex; align-items: center; gap: 10px; width: 100%; }
.mpp-link-preview { font-size: 12px; color: var(--text-secondary); line-height: 1.6; margin: 6px 2px 2px; padding: 8px 10px; background: var(--rose-light); border-radius: 10px; }

/* ===== 人物详情/编辑 弹层（隐藏态插入 → rAF 加 .show，防闪烁）===== */
.ml-persona-overlay { position: absolute; inset: 0; z-index: 90; display: flex; align-items: center; justify-content: center; background: rgba(30,26,22,.5); opacity: 0; transition: opacity .25s ease; }
.ml-persona-overlay.show { opacity: 1; }
.ml-persona-sheet { width: 90%; max-width: 342px; max-height: 88%; background: var(--surface-solid); border: 1px solid var(--border); border-radius: 24px; padding: 22px 18px 18px; box-shadow: var(--shadow-lg), 0 0 0 1px rgba(201,168,168,.07); overflow-y: auto; scrollbar-width: none; -ms-overflow-style: none; transform: translateY(14px); transition: transform .3s cubic-bezier(.2,.8,.2,1), opacity .3s ease; opacity: 0; }
.ml-persona-overlay.show .ml-persona-sheet { transform: translateY(0); opacity: 1; }
.ml-persona-sheet::-webkit-scrollbar { display: none; width: 0; height: 0; }
.ml-persona-sheet-hero { text-align: center; padding-bottom: 12px; }
.ml-persona-sheet-en { font-family: var(--font-decorative, 'Playfair Display', Georgia, serif); font-style: italic; font-size: 13px; color: var(--gold); letter-spacing: 2px; }
.ml-persona-sheet-title { font-size: 18px; font-weight: 600; color: var(--text-primary); margin: 3px 0 8px; }
.ml-persona-hero-line { width: 38px; height: 1px; margin: 0 auto; background: linear-gradient(90deg, transparent, var(--gold), transparent); }
.ml-persona-form { display: flex; flex-direction: column; gap: 13px; }
.ml-persona-form .ml-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ml-persona-form .ml-field label { display: block; font-size: 11.5px; color: var(--text-muted); margin-bottom: 6px; letter-spacing: .3px; }
.ml-persona-form .ml-field input, .ml-persona-form .ml-field textarea { width: 100%; border: 1px solid var(--border); background: var(--surface); border-radius: 13px; padding: 10px 12px; font-size: 14px; color: var(--text-primary); font-family: var(--font-body); outline: none; transition: border-color .2s ease, box-shadow .2s ease; }
.ml-persona-form .ml-field input:focus, .ml-persona-form .ml-field textarea:focus { border-color: var(--rose); box-shadow: 0 0 0 3px rgba(201,168,168,.14); }
.ml-persona-form .ml-field input::placeholder, .ml-persona-form .ml-field textarea::placeholder { color: var(--text-muted); opacity: .6; }
.ml-persona-form .ml-field input[readonly].dp-trigger { cursor: pointer; }
.ml-persona-form .ml-field textarea { resize: vertical; line-height: 1.6; }

/* 人物编辑：分区卡片（清爽、主次分明） */
.ml-persona-edit-card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 12px 14px; }
.ml-persona-edit-card-title { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; color: var(--text-primary); margin-bottom: 12px; }
.ml-persona-edit-card-title::before { content: ''; width: 3px; height: 14px; border-radius: 2px; background: var(--rose); }
.ml-persona-edit-en { font-family: var(--font-decorative, 'Playfair Display', Georgia, serif); font-style: italic; font-size: 11px; color: var(--gold); letter-spacing: 1.5px; }
.ml-persona-edit-card-body { display: flex; flex-direction: column; gap: 12px; }
.ml-persona-edit-card .ml-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ml-persona-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.ml-persona-chips .ml-person-chip { background: var(--surface); border: 1px solid var(--border); color: var(--text-secondary); }
.ml-persona-chips .ml-person-chip:active { background: var(--rose-light); color: var(--rose); border-color: var(--rose); }
.ml-persona-actions { display: flex; gap: 10px; margin-top: 6px; }
.ml-persona-actions .ml-btn { flex: 1; }
.ml-persona-relations { display: flex; flex-direction: column; gap: 10px; }
.ml-persona-rel-row { display: flex; flex-direction: column; gap: 6px; padding: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; }
.ml-persona-rel-top { display: flex; align-items: center; gap: 8px; position: relative; }
.ml-persona-rel-top .mpp-rel-label { flex: 1.4; min-width: 0; }
.ml-persona-rel-top .ml-persona-pick-list { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 30; background: var(--surface-solid); border: 1px solid var(--border); border-radius: 12px; padding: 4px; box-shadow: var(--shadow-md); max-height: 160px; }
.ml-persona-rel-x { flex-shrink: 0; width: 30px; height: 30px; border-radius: 50%; border: 1px solid rgba(200,130,130,.4); background: transparent; color: var(--danger, #c87); cursor: pointer; font-size: 14px; line-height: 1; }
.ml-persona-rel-x:active { transform: scale(.9); }
.ml-persona-rel-add { align-self: flex-start; border: 1px dashed var(--border); background: transparent; color: var(--text-secondary); font-size: 12px; padding: 7px 12px; border-radius: 14px; cursor: pointer; font-family: var(--font-body); transition: all .2s ease; }
.ml-persona-rel-add:active { transform: scale(.96); }
.ml-persona-hint { font-size: 11px; color: var(--text-muted); line-height: 1.6; }

/* 关系网选人面板 */
.ml-persona-pick-list { max-height: 180px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; margin-top: 6px; }
/* 选人按钮（自定义，替代原生 select） */
.ml-persona-rel-pick { flex: 1; min-width: 0; border: 1px solid var(--border); background: var(--surface); color: var(--text-primary); font-size: 13px; padding: 8px 12px; border-radius: 12px; cursor: pointer; text-align: left; font-family: var(--font-body); transition: border-color .2s ease; }
.ml-persona-rel-pick:active { border-color: var(--rose); }
.mpp-rel-label { border: 1px solid var(--border); background: var(--surface); border-radius: 12px; padding: 8px 10px; font-size: 13px; color: var(--text-primary); font-family: var(--font-body); outline: none; transition: border-color .2s ease, box-shadow .2s ease; }
.mpp-rel-label:focus { border-color: var(--rose); box-shadow: 0 0 0 3px rgba(201,168,168,.14); }
/* 方向（双向 / 我→TA / TA→我）一排小切换 */
.ml-persona-rel-dir { display: flex; gap: 6px; }
.ml-rel-dir { flex: 1; text-align: center; font-size: 11px; padding: 5px 0; border: 1px solid var(--border); border-radius: 9px; color: var(--text-muted); background: var(--surface); cursor: pointer; font-family: var(--font-body); transition: all .18s ease; }
.ml-rel-dir.on { background: var(--rose-light); color: var(--rose); border-color: var(--rose); font-weight: 600; }

/* ===== 按时间：单行左右滑动时间条 ===== */
.ml-time-row { display: flex; align-items: center; padding: 2px 18px 8px; }
.ml-time-chips { display: flex; flex-wrap: nowrap; overflow-x: auto; gap: 8px; scrollbar-width: none; -ms-overflow-style: none; }
.ml-time-chips::-webkit-scrollbar { display: none; width: 0; height: 0; }
.ml-time-chips .ml-fs-chip { flex: none; min-width: 52px; padding: 7px 12px; white-space: nowrap; }
.ml-time-chips .ml-fs-cal { flex: none; width: auto; min-width: 52px; margin-top: 0; border: 1px solid var(--rose); background: var(--rose-light); color: var(--ml-rose-deep); font-size: 12px; padding: 7px 11px; white-space: nowrap; border-radius: 14px; cursor: pointer; font-family: var(--font-body); transition: all .2s ease; }
.ml-time-chips .ml-fs-cal:active { transform: scale(.95); }

/* ===== 归并「筛选」弹层 ===== */
.ml-filtersheet-overlay.show { opacity: 1; }
.ml-filtersheet-overlay.show .ml-filtersheet { transform: translateY(0); opacity: 1; }
.ml-fs-chip { flex: 1 0 21%; border: 1px solid var(--border); background: var(--surface); color: var(--text-secondary); font-size: 12px; padding: 8px 0; border-radius: 14px; cursor: pointer; font-family: var(--font-body); transition: all .2s ease; }
.ml-fs-chip:active { transform: scale(.95); }
.ml-fs-chip.active { background: var(--accent); color: var(--on-accent); border-color: transparent; box-shadow: 0 2px 6px var(--accent-glow, rgba(201,168,168,.3)); }
.ml-fs-cal { width: 100%; margin-top: 8px; border: 1px solid var(--rose); background: var(--rose-light); color: var(--ml-rose-deep); font-size: 12px; padding: 8px 0; border-radius: 14px; cursor: pointer; font-family: var(--font-body); transition: all .2s ease; }
.ml-fs-cal:active { transform: scale(.98); }
.ml-fs-tag.active { background: var(--accent); color: var(--on-accent); border-color: transparent; }
.ml-fs-tag.active span { color: var(--on-accent); }
.ml-filtersheet-actions .ml-btn { flex: 1; }
/* 「筛选」入口按钮激活态 */
.ml-act-btn.active { background: var(--accent); color: var(--on-accent); border-color: transparent; box-shadow: 0 2px 8px var(--accent-glow, rgba(201,168,168,.3)); }

/* ===== 下拉刷新（2028-03 甲方：刷新最新状态）===== */
/* 指示器是滚动容器的第一个子元素，靠自身 height 撑开，内容自然被推下（不覆盖、不抖动） */
.ml-pull {
    height: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
.ml-pull-inner { display: flex; align-items: center; gap: 8px; height: 46px; }
.ml-pull-text { font-size: 12px; color: var(--text-muted); letter-spacing: .5px; }
.ml-pull-arrow { color: var(--gold); opacity: .6; transition: transform .18s ease; flex-shrink: 0; }
.ml-pull-spinner { display: none; width: 13px; height: 13px; border-radius: 50%; border: 1.6px solid rgba(201,168,168,.3); border-top-color: var(--rose); animation: mlPullSpin .7s linear infinite; }
.ml-pull.loading .ml-pull-spinner { display: block; }
.ml-pull.loading .ml-pull-arrow { display: none; }
@keyframes mlPullSpin { to { transform: rotate(360deg); } }

/* ===== 主页「旧事删除 / 回收站」两个方块（2028-09 甲方定，方向 A：清爽留白）
   一行两个、一样宽、合起来占满整行；只有线条小图标 + 中文名 + 一个数字，别的不加。 */
.ml-quick-blk {
    flex: 1 1 0; min-width: 0; box-sizing: border-box;
    display: flex; flex-direction: column; align-items: flex-start; text-align: left;
    min-height: 96px; padding: 15px 14px 14px;
    background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
    box-shadow: var(--shadow-xs); cursor: pointer;
    font-family: var(--font-body); color: inherit;
    -webkit-tap-highlight-color: transparent;
    transition: transform .18s ease, box-shadow .2s ease, border-color .2s ease;
}
.ml-quick-blk:hover { border-color: var(--rose); box-shadow: var(--shadow-sm); }
.ml-quick-blk:active { transform: scale(.98); }
.ml-quick-count { margin-top: auto; padding-top: 8px; font-size: 11px; color: var(--text-muted); letter-spacing: .2px; }
.ml-quick-blk.has-items .ml-quick-count { color: var(--ml-rose-deep); }

/* ===== 记忆库里的「滑入整页」（旧事删除 / 回收站）：从右侧滑进滑出 =====
   基类是关着那一态（推到屏幕右边外），.open 才滑进来；#tab-memory 有 overflow:hidden，
   所以关着时它既看不见也点不到（不用 display 切换 —— display:none↔flex 会重播子动画、会闪）。
   全屏内容页铁律：绝对定位铺满 #tab-memory（不是 fixed 挂 body），顶栏自己让出 iOS 顶部安全区。 */
.ml-slide-page {
    position: absolute; inset: 0; z-index: 320;
    display: flex; flex-direction: column;
    background: var(--bg-primary); overflow: hidden;
    transform: translateX(100%);
    transition: transform .34s cubic-bezier(.32,.72,0,1);
    pointer-events: none;
    will-change: transform;
}
.ml-slide-page.open { transform: translateX(0); pointer-events: auto; }
/* 回收站盖在旧事删除那一页上面（返回顺序不打架） */
#ml-trash-view { z-index: 340; }
.ml-slide-page > .ml-detail-header { padding-top: calc(12px + var(--safe-top, 0px)); }
/* 页内那一个「?」（跟着顶栏走，不再用绝对定位贴屏幕角） */
.ml-page-help { position: static; margin-left: auto; width: 28px; height: 28px; flex: none; }
.ml-page-scroll {
    flex: 1; min-height: 0; overflow-y: auto;
    padding: 14px 18px calc(26px + var(--safe-bottom, 0px));
    -webkit-overflow-scrolling: touch;
}

/* ===== 旧事删除（整页里的卡片堆；2028-09 甲方定：跟手拖动 + 松手落位，一次只走一张）===== */
/* 骨架屏（还没拿到数据时摆这个，绝不出现「加载失败」白板） */
.ml-oldmem-sk { padding-top: 10px; }
.ml-oldmem-sk-card { height: 92px; border-radius: 16px; margin-top: 10px; padding: 14px; box-sizing: border-box; }
.ml-skl { height: 9px; border-radius: 5px; background: rgba(0,0,0,.07); margin-top: 8px; }
.ml-skl:first-child { margin-top: 0; }
.ml-skl-line.w40 { width: 40%; }
.ml-skl-line.w60 { width: 60%; }
.ml-skl-line.w80 { width: 80%; }
.ml-skl-line.w90 { width: 90%; }
.ml-oldmem-retry {
    display: block; margin: 0 auto; border: 1px solid var(--rose); background: var(--rose-light, rgba(201,168,168,.18));
    color: var(--ml-rose-deep, #7A5A5A); font-size: 12px; padding: 7px 18px; border-radius: 14px;
    cursor: pointer; font-family: var(--font-body); transition: transform .18s ease;
}
.ml-oldmem-retry:active { transform: scale(.95); }
.ml-oldmem-filters { margin: 10px 0 14px; }
.ml-oldmem-slider-row { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.ml-oldmem-slider-label { font-size: 11px; color: var(--text-muted); flex-shrink: 0; width: 78px; }
.ml-oldmem-slider-val { font-size: 11px; color: var(--ml-rose-deep); flex-shrink: 0; width: 36px; text-align: right; font-variant-numeric: tabular-nums; }
/* 滑杆：轨道左半段跟着当前值填色（--pct 由 JS 按值写）；touch-action: pan-y 让纵向手势照常滚页面，
   横向交给这个原生控件自己（防误碰在 JS 捕获层做，见 panels-memory-oldmem.js 的 _oldMemBindRangeGuard） */
.ml-oldmem-range { flex: 1; width: 100%; min-width: 0; height: 20px; -webkit-appearance: none; appearance: none; background: transparent; touch-action: pan-y; }
.ml-oldmem-range::-webkit-slider-runnable-track { height: 3px; border-radius: 3px;
    background: linear-gradient(90deg, var(--rose) 0%, var(--rose) var(--pct, 50%), rgba(196,168,106,.42) var(--pct, 50%), rgba(196,168,106,.42) 100%); }
.ml-oldmem-range::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 16px; height: 16px; border-radius: 50%; background: var(--surface); border: 1.5px solid var(--rose); box-shadow: 0 1px 4px rgba(201,168,168,.45); margin-top: -6.5px; }
.ml-oldmem-range::-moz-range-track { height: 3px; border-radius: 3px;
    background: linear-gradient(90deg, var(--rose) 0%, var(--rose) var(--pct, 50%), rgba(196,168,106,.42) var(--pct, 50%), rgba(196,168,106,.42) 100%); }
.ml-oldmem-range::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--surface); border: 1.5px solid var(--rose); }

/* 卡片舞台＝自己算位置的一条轨道（2028-09 甲方定：跟手拖动 + 松手落位）
   —— 不再用浏览器原生吸附滚动（那套「轻轻一划就跳好几张、手指一动就换张」）；
   touch-action: pan-y 让纵向手势照常滚页面，横向手势交给 JS（只在明确横向时才接管）。 */
.ml-oldmem-stage {
    position: relative;
    touch-action: pan-y;
    overflow: hidden;
    margin: 0;
}
.ml-oldmem-track {
    display: flex; align-items: stretch;
    gap: 10px; padding: 2px 0 12px;
    transition: transform .34s cubic-bezier(.32,.72,0,1);
    will-change: transform;
}
/* 一张卡占满内容宽减去「露一角」（那 16px 就是告诉你可以左右翻） */
.ml-oldmem-card {
    position: relative;
    flex: 0 0 calc(100% - 26px);
    min-height: 232px;
    box-sizing: border-box;
    padding: 16px 16px 14px;
    background: var(--surface);
    border: 1px solid rgba(196,168,106,.32);
    border-radius: 18px;
    box-shadow: var(--shadow-sm), var(--shadow-xs);
    transition: border-color .22s ease, box-shadow .22s ease, opacity .3s ease;
    overflow: hidden;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}
/* 当前这张只靠边框/阴影说话：绝不缩放、绝不给邻居变暗（甲方实锤「晃眼」） */
.ml-oldmem-card.cur { border-color: rgba(201,168,168,.5); box-shadow: var(--shadow-md, var(--shadow-sm)), var(--shadow-xs); }
.ml-oldmem-card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
    background: linear-gradient(90deg, transparent, rgba(196,168,106,.5), transparent);
}
.ml-oldmem-card-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.ml-oldmem-card-en { font-family: var(--font-decorative, 'Playfair Display', serif); font-style: italic; font-size: 11px; color: var(--gold); letter-spacing: 1.2px; }
.ml-oldmem-card-when { font-size: 11px; color: var(--text-muted); flex: none; letter-spacing: .3px; }
.ml-oldmem-card-title { font-size: 16px; font-weight: 600; color: var(--text-primary); line-height: 1.45; margin-top: 12px; letter-spacing: .2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ml-oldmem-card-sub { display: flex; align-items: center; gap: 6px; margin-top: 8px; min-height: 16px; }
.ml-oldmem-cat { font-size: 11px; flex-shrink: 0; letter-spacing: .3px; }
.ml-oldmem-card-summary {
    margin-top: 12px; font-size: 12.5px; color: var(--text-secondary); line-height: 1.75;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.ml-oldmem-meters { margin-top: 16px; padding-top: 12px; border-top: 1px dashed var(--border); }
.ml-oldmem-bars { display: flex; align-items: center; gap: 10px; }
.ml-oldmem-bars + .ml-oldmem-bars { margin-top: 10px; }
.ml-oldmem-bar-label { font-size: 11px; color: var(--text-muted); flex-shrink: 0; width: 76px; font-variant-numeric: tabular-nums; letter-spacing: .2px; }
.ml-oldmem-bar { flex: 1; height: 4px; border-radius: 4px; background: rgba(0,0,0,.06); overflow: hidden; }
.ml-oldmem-bar-fill { display: block; height: 100%; border-radius: 4px; }
.ml-oldmem-bar-fill.imp { background: linear-gradient(90deg, rgba(201,168,168,.5), var(--rose)); }
.ml-oldmem-bar-fill.fade { background: linear-gradient(90deg, rgba(160,170,190,.5), #8FA8C4); }
.ml-oldmem-actions { display: flex; gap: 10px; margin-top: 18px; }
.ml-oldmem-actions button { flex: 1; font-size: 13px; font-family: var(--font-body); padding: 10px 0; border-radius: 14px; cursor: pointer; letter-spacing: .3px; transition: transform .16s ease, opacity .16s ease, background .2s ease; }
.ml-oldmem-actions button:active { transform: scale(.96); }
.ml-oldmem-open { border: 1px solid var(--border); background: var(--surface); color: var(--text-secondary); }
.ml-oldmem-del { border: 1px solid rgba(180,110,110,.32); background: rgba(201,168,168,.12); color: #96625F; }
.ml-oldmem-del:hover { background: rgba(201,168,168,.22); }
/* 翻卡：只有第一张时藏掉左右箭头与提示（没什么可翻的，别摆一堆装饰） */
.ml-oldmem-pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 14px; }
.ml-oldmem-pager.single { display: none; }
.ml-oldmem-arrow {
    width: 30px; height: 30px; border-radius: 50%; flex: none;
    border: 1px solid rgba(168,128,128,.28); background: rgba(201,168,168,.14);
    color: var(--rose-dark, #A88080); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: transform .18s ease, opacity .18s ease, background .2s ease;
}
.ml-oldmem-arrow:active { transform: scale(.9); }
.ml-oldmem-arrow:disabled, .ml-oldmem-arrow[aria-disabled="true"] { opacity: .3; pointer-events: none; }
.ml-oldmem-hint { font-size: 11.5px; color: var(--text-muted); letter-spacing: .6px; min-width: 96px; text-align: center; }
.ml-oldmem-empty { text-align: center; padding: 44px 18px 40px; width: 100%; }
.ml-oldmem-empty-en { font-family: var(--font-decorative, 'Playfair Display', serif); font-style: italic; font-size: 15px; color: var(--gold); opacity: .8; margin-bottom: 10px; letter-spacing: 1px; }
.ml-oldmem-empty span { font-size: 12.5px; color: var(--text-muted); line-height: 1.9; }

/* ===== 旧事删除页里那一句说明（2028-09 甲方定：页内只留一个「?」，说明就是一句短话，
   问号已经挪到顶栏，不再跟在句子尾巴上、也不再贴屏幕边）===== */
.ml-oldmem-sub {
    margin: 0 0 12px; padding: 0 2px;
    font-size: 12.5px; line-height: 1.8; color: var(--text-secondary); letter-spacing: .1px;
}
.ml-oldmem-sub-zh { display: block; }

/* 三段筛选（全部/正事/琐事）跟「按时间/按分类」同排：把内边距与间距收一点，
   保证 360px 也一行放得下（实测项见 tools/ui-memlib-measure.js） */
@media (max-width: 400px) {
    .ml-mode-btn { padding: 6px 9px; font-size: 11.5px; }
}
@media (max-width: 360px) {
    .ml-mode-btn { padding: 6px 7px; font-size: 11px; letter-spacing: -.2px; }
    .ml-kind-chip { padding: 6px 10px; font-size: 11.5px; }
}
@media (max-width: 369px) {
    .ml-sort-btn { font-size: 11px; min-width: 0; padding: 6px 1px; letter-spacing: -.2px; }
    .ml-manage-btn { padding: 5px 9px; font-size: 11px; }
    .ml-kind-chip { padding: 6px 9px; font-size: 11px; }
}

/* ===== 「按程度」两栏（正事 / 琐事）：复用「渐淡」两栏同一套分区与折叠，上下两栏、各自可加载更多 ===== */
.ml-kind-sec { margin-bottom: 6px; }
.ml-kind-sec-head { display: flex; align-items: center; gap: 7px; padding: 8px 0 6px; cursor: pointer; }
.ml-kind-sec-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.ml-kind-sec-dot.kd-matter { background: var(--rose); }
.ml-kind-sec-dot.kd-trivial { background: var(--sage, #8CAA78); }
.ml-kind-sec-title { font-size: 13.5px; font-weight: 600; color: var(--text-primary); font-family: var(--font-body); }
.ml-kind-sec-count { font-size: 11.5px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.ml-kind-sec-en { font-family: var(--font-decorative, 'Playfair Display', serif); font-style: italic; font-size: 11px; color: var(--gold); opacity: .8; margin-left: auto; }
.ml-kind-sec-note { font-size: 11px; color: var(--text-muted); line-height: 1.6; padding: 0 0 6px 14px; }
.ml-kind-sec-body { display: grid; grid-template-rows: 1fr; transition: grid-template-rows .3s cubic-bezier(.2,.7,.2,1), opacity .26s ease; opacity: 1; }
.ml-kind-sec-body.collapsed { grid-template-rows: 0fr; opacity: 0; }
.ml-kind-sec-inner { overflow: hidden; min-height: 0; }
.ml-kind-sec-list { display: flex; flex-direction: column; gap: 10px; }
.ml-kind-sec-empty { font-size: 12px; color: var(--text-muted); line-height: 1.7; padding: 6px 0 8px; }

/* ===== 回收站入口（旧事删除页最下面一条：有没有东西都看得见，有东西才露数字） */
.ml-oldmem-trash-entry {
    display: flex; align-items: center; gap: 8px;
    margin: 14px 0 0; padding: 12px 14px;
    background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
    cursor: pointer; transition: border-color .2s ease, transform .16s ease, box-shadow .2s ease;
}
.ml-oldmem-trash-entry:active { transform: scale(.985); }
.ml-oldmem-trash-entry:hover { border-color: var(--rose); }
.ml-oldmem-trash-entry.has-items { border-color: rgba(196,168,106,.4); box-shadow: var(--shadow-xs); }
.ml-oldmem-trash-ico { display: flex; align-items: center; justify-content: center; width: 18px; height: 18px; color: var(--text-muted); flex: none; }
.ml-oldmem-trash-entry-zh { font-size: 13.5px; color: var(--text-primary); letter-spacing: .3px; }
.ml-oldmem-trash-entry-en { font-family: var(--font-decorative, 'Playfair Display', serif); font-style: italic; font-size: 11px; color: var(--gold); opacity: .75; letter-spacing: .5px; }
.ml-oldmem-trash-entry-count { margin-left: auto; font-size: 11.5px; color: var(--ml-rose-deep); }
.ml-oldmem-trash-entry .ml-trash-carets { margin-left: 2px; opacity: .7; }

/* 「找回」按钮（回收站每条右边，金色描边不抢主视觉） */
.ml-trash-restore {
    flex-shrink: 0; font-size: 12px; font-family: var(--font-body);
    border: 1px solid rgba(196,168,106,.4); background: rgba(196,168,106,.12);
    color: var(--gold-dark, #A89050); padding: 7px 13px; border-radius: 13px; cursor: pointer;
    letter-spacing: .3px;
    transition: transform .16s ease, background .2s ease;
}
.ml-trash-restore:active { transform: scale(.94); }
.ml-trash-restore:hover { background: rgba(196,168,106,.2); }

/* 回收站（第二个整页：按月分组、每条点一下就地展开看原来的内容）===== */
.ml-trash-head {
    padding: 18px 18px 0;
}
.ml-trash-sub { font-size: 12.5px; color: var(--text-secondary); line-height: 1.8; margin: 0 0 4px; }
.ml-trash-list { display: flex; flex-direction: column; gap: 10px; padding: 6px 18px calc(28px + var(--safe-bottom, 0px)); }
.ml-trash-month { display: flex; align-items: center; gap: 10px; padding: 12px 2px 4px; }
.ml-trash-month:first-child { padding-top: 4px; }
.ml-trash-month-line { flex: 1; height: 1px; background: linear-gradient(90deg, transparent, rgba(196,168,106,.35), transparent); }
.ml-trash-month-label { flex: none; font-family: var(--font-decorative, 'Playfair Display', serif); font-style: italic; font-size: 12px; color: var(--gold-dark, #A89050); letter-spacing: 1px; }
.ml-trash-empty { text-align: center; padding: 56px 26px 0; }
.ml-trash-empty-en { font-family: var(--font-decorative, 'Playfair Display', serif); font-style: italic; font-size: 15px; color: var(--gold); opacity: .8; margin-bottom: 10px; letter-spacing: 1px; }
.ml-trash-empty span { font-size: 12.5px; color: var(--text-muted); line-height: 1.9; }
.ml-trash-item {
    background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
    padding: 0 15px; overflow: hidden;
    transition: border-color .22s ease, box-shadow .22s ease;
}
.ml-trash-item.open { border-color: rgba(201,168,168,.45); box-shadow: var(--shadow-xs); }
.ml-trash-row { display: flex; align-items: center; gap: 12px; padding: 14px 0; cursor: pointer; }
.ml-trash-row:active { opacity: .82; }
.ml-trash-info { flex: 1; min-width: 0; }
.ml-trash-title { display: flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--text-primary); line-height: 1.45; letter-spacing: .2px; }
.ml-trash-meta { display: flex; align-items: center; gap: 7px; font-size: 11px; color: var(--text-muted); margin-top: 5px; }
.ml-trash-dot { width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: .5; flex: none; }
/* 展开箭头（纯 CSS 线条，零 emoji）：收起朝右、展开朝下 */
.ml-trash-carets {
    flex: none; width: 6px; height: 6px; margin-left: 2px;
    border-right: 1.4px solid var(--text-muted); border-bottom: 1.4px solid var(--text-muted);
    transform: rotate(-45deg); transition: transform .22s ease;
}
.ml-trash-item.open .ml-trash-carets { transform: rotate(45deg) translate(-1px, -1px); }
/* 展开区：grid-template-rows 展开过渡（与珍藏/渐淡同一套，不闪不跳） */
.ml-trash-detail { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .3s cubic-bezier(.2,.7,.2,1), opacity .26s ease; opacity: 0; }
.ml-trash-item.open .ml-trash-detail { grid-template-rows: 1fr; opacity: 1; }
.ml-trash-detail > .ml-trash-detail-inner { overflow: hidden; min-height: 0; }
.ml-trash-detail-inner { padding-bottom: 14px; }
.ml-trash-detail-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 11px; color: var(--text-muted); padding-bottom: 8px; border-bottom: 1px dashed var(--border); }
.ml-trash-cat { font-size: 11px; }
.ml-trash-kind { font-size: 10.5px; padding: 2px 7px; border-radius: 9px; background: var(--rose-light, rgba(201,168,168,.16)); color: var(--ml-rose-deep); }
.ml-trash-when { font-size: 10.5px; }
.ml-trash-summary { font-size: 12.5px; color: var(--text-secondary); line-height: 1.65; margin-top: 9px; }
.ml-trash-body { font-size: 13px; color: var(--text-primary); line-height: 1.8; margin-top: 9px; white-space: pre-wrap; word-break: break-word; }
.ml-trash-nobody { font-size: 12px; color: var(--text-muted); }
.ml-trash-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.ml-trash-ctx-label { font-size: 11px; color: var(--text-muted); margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--border); }
.ml-trash-ctx { font-size: 12px; color: var(--text-secondary); line-height: 1.75; margin-top: 6px; white-space: pre-wrap; word-break: break-word; max-height: 220px; overflow-y: auto; -webkit-overflow-scrolling: touch; }

/* 窄屏（<370px）：留白与字号再收一点，卡片绝不横向溢出 */
@media (max-width: 369px) {
    .ml-oldmem-card { padding: 15px 14px 13px; }
    .ml-oldmem-bar-label { width: 68px; }
    .ml-oldmem-card-title { font-size: 15px; }
    .ml-oldmem-card-summary { font-size: 12px; }
    .ml-oldmem-slider-label { width: 70px; }
    .ml-page-scroll { padding-left: 12px; padding-right: 12px; }
    .ml-trash-list { padding-left: 12px; padding-right: 12px; }
    .ml-trash-head { padding-left: 12px; padding-right: 12px; }
    .ml-quick-blk { padding: 14px 12px 13px; }
}
/* 矮屏（iPhone SE 那类小屏）：摘要少一行，别把按钮挤出去 */
@media (max-height: 620px) {
    .ml-oldmem-card-summary { -webkit-line-clamp: 2; }
    .ml-oldmem-card { min-height: 214px; }
}

/* ===== 减少动态偏好：新增强调/弹层/关系网动效全部静止 ===== */
@media (prefers-reduced-motion: reduce) {
    .ml-persona-node, .ml-persona-center, .ml-persona-edge, .ml-fs-chip, .ml-fs-tag, .ml-fs-cal,
    .ml-persona-card, .ml-persona-avatar, .ml-person-chip, .ml-mode-btn, .ml-persona-tab,
    .ml-quick-blk, .ml-filter-entry, .ml-filtersheet, .ml-persona-overlay .ml-persona-sheet { animation: none; transition: none; }
    .ml-persona-node, .ml-persona-edge { opacity: 1; }
    .ml-slide-page { transition: opacity .2s ease; transform: none; opacity: 0; }
    .ml-slide-page.open { opacity: 1; }
    .ml-oldmem-track { transition: none; }
}


/* ============================================================
   ===== UI3 记忆库母体（TASK-UI3-PRODADOPT-002-B · 窗口 B）=====
   结构对照 G:\kstar-ui3-refs\style\docs\design\KSTAR-UI3-MEMORY-LIBRARY-DRAFT-V2-preview.html
   原则：新结构用 ui3mem- 前缀自成一套，不复用旧 ml-* 骨架的观感；
        旧 ml-* 里只剩「业务钩子」（JS 查询 / 其它模块仍在用）与
        「非本窗口的层」（详情 / 旧事删除 / 回收站 / 设置 / 人物弹层 / 月历）。
   ============================================================ */
#tab-memory {
    --u-bg: #fbf3ef;
    --u-surface: rgba(255, 251, 247, .88);
    --u-surface-strong: #fffdfb;
    --u-surface-soft: rgba(255, 252, 249, .72);
    --u-text: #55463f;
    --u-text-2: #8f8078;
    --u-text-3: #b3a39a;
    --u-rose: #c6a29d;
    --u-rose-soft: #eadbd7;
    --u-sage: #a9b6a2;
    --u-gold: #b5a076;
    --u-line: rgba(137, 112, 98, .095);
    --u-shadow: 0 15px 40px rgba(170, 120, 100, .105);
    --u-ease: cubic-bezier(.16, 1, .3, 1);
    background: var(--u-bg);
}
[data-theme-mode="dark"] #tab-memory {
    --u-bg: #1b1816;
    --u-surface: rgba(40, 35, 32, .86);
    --u-surface-strong: #262120;
    --u-surface-soft: rgba(48, 42, 38, .66);
    --u-text: #ede4de;
    --u-text-2: #b7a9a0;
    --u-text-3: #8d8079;
    --u-rose: #cfa9a3;
    --u-rose-soft: #4a3a38;
    --u-sage: #a9b6a2;
    --u-gold: #c3ac7e;
    --u-line: rgba(255, 240, 230, .10);
    --u-shadow: 0 15px 40px rgba(0, 0, 0, .34);
}
/* —— 顶栏（固定；标题居中）—— */
.ui3mem-topbar {
    flex: none; display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: 8px;
    padding: calc(8px + var(--safe-top, 0px)) 14px 8px;
    background: linear-gradient(180deg, var(--u-bg) 62%, rgba(0, 0, 0, 0));
    position: relative; z-index: 6;
}
.ui3mem-top-title { text-align: center; font-family: var(--font-display, serif); font-size: 16.5px; letter-spacing: 3px; color: var(--u-text); }
.ui3mem-top-actions { display: flex; gap: 6px; justify-content: flex-end; }
.ui3mem-icon-btn {
    width: 38px; height: 38px; padding: 0; border: 1px solid var(--u-line); border-radius: 13px;
    background: var(--u-surface-soft); color: var(--u-text-2);
    display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
    transition: transform .22s var(--u-ease), background .22s ease, color .22s ease;
}
.ui3mem-icon-btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.ui3mem-icon-btn:active { transform: scale(.92); background: var(--u-rose-soft); color: var(--u-text); }
/* —— 滚动容器（沿用 JS / 下拉刷新都在用的 id）—— */
#tab-memory .ml-body-scroll { padding: 0 0 calc(28px + var(--safe-bottom, 0px)); scrollbar-gutter: auto; }
/* —— 子导航（母体 subnav；吸顶）—— */
#tab-memory .ml-sticky { position: sticky; top: 0; z-index: 5; background: linear-gradient(180deg, var(--u-bg) 78%, rgba(0, 0, 0, 0)); padding: 2px 0 4px; }
.ui3mem-subnav { position: relative; display: flex; gap: 2px; margin: 0 14px; padding: 4px; border: 1px solid var(--u-line); border-radius: 16px; background: var(--u-surface); }
.ui3mem-subnav-ind {
    position: absolute; top: 4px; bottom: 4px; left: 4px; width: 0; border-radius: 12px;
    background: var(--u-surface-strong); box-shadow: 0 3px 10px rgba(170, 120, 100, .12);
    transition: transform .34s var(--u-ease), width .34s var(--u-ease); pointer-events: none;
}
.ui3mem-subnav-ind.is-on { opacity: 1; }
#tab-memory .ml-vtab {
    flex: 1; min-width: 0; position: relative; z-index: 1; border: none; background: none; cursor: pointer;
    font-family: var(--font-body, sans-serif); font-size: 12.5px; color: #9d8b83; padding: 8px 2px; border-radius: 12px;
    transition: color .26s ease;
}
#tab-memory .ml-vtab.active { color: #6b534b; font-weight: 600; }
[data-theme-mode="dark"] #tab-memory .ml-vtab { color: var(--u-text-3); }
[data-theme-mode="dark"] #tab-memory .ml-vtab.active { color: var(--u-text); }
/* 旧的吸顶 tabs 容器：现在由 .ui3mem-subnav 承担外观，这条只留定位兜底 */
#tab-memory .ml-view-tabs { display: none; }
/* —— 视图切换（同空间 12：旧视图淡出 → 新视图淡入上抬，方向感由 forward/reverse 决定）—— */
.view { padding: 4px 38px 0; box-sizing: border-box; }
.ui3mem-out-forward { opacity: 0; transform: translateX(-16px); transition: opacity .22s ease, transform .34s var(--u-ease); }
.ui3mem-out-reverse { opacity: 0; transform: translateX(16px); transition: opacity .22s ease, transform .34s var(--u-ease); }
.ui3mem-in-forward { opacity: 0; transform: translateX(22px); }
.ui3mem-in-reverse { opacity: 0; transform: translateX(-22px); }
.ui3mem-arrived { animation: ui3memIn .34s var(--u-ease) forwards; }
@keyframes ui3memIn { from { opacity: 0; } to { opacity: 1; transform: none; } }
/* —— 通用小件 —— */
.ui3mem-sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 30px 0 12px; }
.ui3mem-sec-head h2 { margin: 0; font-family: var(--font-display, serif); font-size: 17px; font-weight: 500; color: var(--u-text); letter-spacing: 1px; }
.ui3mem-sec-head span { font-size: 11.5px; color: var(--u-text-3); }
.ui3mem-chev { flex: none; width: 8px; height: 8px; border-top: 1.4px solid var(--u-text-3); border-right: 1.4px solid var(--u-text-3); transform: rotate(45deg); }
.ui3mem-ghost { display: none !important; }
.ui3mem-card-en { font-family: var(--font-decorative, 'Playfair Display', serif); font-style: italic; font-size: 11.5px; letter-spacing: 1.4px; color: var(--u-gold); }
/* —— 母体「记忆引言」（首页 / 珍藏 / 人物共用）—— */
.ui3mem-intro { position: relative; padding: 6px 2px 4px; }
.ui3mem-intro-label { font-family: var(--font-decorative, 'Playfair Display', serif); font-size: 10.5px; letter-spacing: 3.4px; color: var(--u-gold); text-transform: uppercase; }
.ui3mem-intro-mark { position: absolute; top: 0; right: 0; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--u-line); background: var(--u-surface); display: flex; align-items: center; justify-content: center; }
.ui3mem-intro-mark span { font-family: var(--font-display, serif); font-style: italic; font-size: 17px; color: var(--u-rose); }
.ui3mem-intro h1 { margin: 12px 0 8px; font-family: var(--font-display, serif); font-size: 25px; font-weight: 500; line-height: 1.42; letter-spacing: .6px; color: var(--u-text); }
.ui3mem-intro-copy { margin: 0; font-size: 12.5px; line-height: 1.85; color: var(--u-text-2); }
.ui3mem-intro-meta { margin-top: 10px; font-size: 11.5px; color: var(--u-text-3); }
/* —— 今天（母体 today-surface + 30 天痕迹）—— */
.ui3mem-today {
    display: flex; align-items: center; gap: 12px; margin-top: 18px; padding: 14px 16px;
    border: 1px solid var(--u-line); border-radius: 20px; background: var(--u-surface); box-shadow: var(--u-shadow);
    cursor: pointer; transition: transform .28s var(--u-ease), box-shadow .28s ease;
}
.ui3mem-today:active { transform: scale(.985); box-shadow: 0 8px 22px rgba(170, 120, 100, .14); }
.ui3mem-today-num { font-family: var(--font-display, serif); font-size: 30px; line-height: 1; color: var(--u-text); }
.ui3mem-today-copy { flex: 1; min-width: 0; }
.ui3mem-today-label { font-size: 13px; color: var(--u-text); }
.ui3mem-today-sub { margin: 3px 0 0; font-size: 11.5px; color: var(--u-text-3); }
.ui3mem-today-trace { display: flex; align-items: flex-end; gap: 2px; height: 26px; width: 84px; flex: none; }
.ui3mem-trace-bar { flex: 1; min-height: 2px; border-radius: 2px; background: var(--u-rose-soft); }
.ui3mem-trace-bar.on { background: var(--u-rose); }
.ui3mem-trace-bar.today { background: var(--u-gold); }
.ui3mem-today-list:empty { display: none; }
/* 今天那几页（真实「今日时间线」数据）*/
.ui3mem-today-list { margin-top: 12px; }
.ui3mem-tl-row { display: flex; gap: 10px; padding: 9px 2px; }
.ui3mem-tl-time { flex: none; width: 40px; font-size: 11.5px; color: var(--u-text-3); padding-top: 2px; }
.ui3mem-tl-title { font-size: 13.5px; color: var(--u-text); line-height: 1.5; }
.ui3mem-tl-more { margin-top: 6px; border: none; background: none; padding: 6px 2px; font-family: var(--font-body, sans-serif); font-size: 12px; color: var(--u-rose); cursor: pointer; }
/* 旧 today 卡（时间线 + 近 7 天小柱图）在新结构里不再渲染 */
/* —— 记忆一览（母体 memory-glance）—— */
.ui3mem-glance-note { margin: -4px 0 12px; font-size: 11.5px; line-height: 1.8; color: var(--u-text-3); }
.ui3mem-glance-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ui3mem-glance-item {
    text-align: left; padding: 13px 14px; border: 1px solid var(--u-line); border-radius: 16px;
    background: var(--u-surface); cursor: pointer; font-family: var(--font-body, sans-serif);
    transition: transform .26s var(--u-ease), background .26s ease;
}
.ui3mem-glance-item:active { transform: scale(.975); background: var(--u-surface-strong); }
.ui3mem-glance-item.is-static { cursor: default; }
.ui3mem-glance-item.is-static:active { transform: none; }
.ui3mem-glance-num { font-family: var(--font-display, serif); font-size: 20px; color: var(--u-text); line-height: 1.1; }
.ui3mem-glance-label { margin-top: 5px; font-size: 12px; color: var(--u-text-2); }
.ui3mem-glance-note-line { margin-top: 3px; font-size: 10.5px; color: var(--u-text-3); }
/* —— 记忆入口（母体 memory-quick）—— */
.ui3mem-quick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ui3mem-quick-card {
    display: flex; flex-direction: column; align-items: flex-start; gap: 5px; padding: 15px 14px;
    border: 1px solid var(--u-line); border-radius: 18px; background: var(--u-surface-soft);
    font-family: var(--font-body, sans-serif); cursor: pointer; text-align: left;
    transition: transform .26s var(--u-ease), background .26s ease;
}
.ui3mem-quick-card:active { transform: scale(.975); background: var(--u-surface-strong); }
.ui3mem-quick-title { font-size: 14px; color: var(--u-text); letter-spacing: .4px; }
.ui3mem-quick-note { font-size: 11px; color: var(--u-text-3); }
/* —— 最近留下 —— */
.ui3mem-recent-list { display: flex; flex-direction: column; gap: 9px; }
.ui3mem-archive { display: flex; flex-direction: column; gap: 9px; }
/* 母体记忆条：只有正文和右下日期，没有卡面 */
.ui3mem-item { padding: 9px 2px 11px; border-bottom: 1px solid var(--u-line); cursor: pointer; }
.ui3mem-item:last-child { border-bottom: none; }
.ui3mem-item.is-manage { display: grid; grid-template-columns: 26px 1fr; gap: 8px; }
.ui3mem-item-body { min-width: 0; }
.ui3mem-item-check { display: flex; align-items: flex-start; padding-top: 3px; }
.ui3mem-check-box { width: 17px; height: 17px; border-radius: 6px; border: 1.4px solid var(--u-text-3); display: block; transition: background .2s ease, border-color .2s ease; }
.ui3mem-check-box.on { background: var(--u-rose); border-color: var(--u-rose); }
.ui3mem-item-title { font-family: var(--font-display, serif); font-size: 15px; line-height: 1.55; color: var(--u-text); }
.ui3mem-item-summary { margin-top: 5px; font-size: 12.5px; line-height: 1.78; color: var(--u-text-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ui3mem-item-meta { display: flex; align-items: center; gap: 8px; margin-top: 7px; font-size: 11px; color: var(--u-text-3); }
.ui3mem-item-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--u-sage); flex: none; }
.ui3mem-item-when { margin-left: auto; flex: none; }
.ui3mem-item-tag { font-size: 10.5px; color: var(--u-text-3); border: 1px solid var(--u-line); border-radius: 8px; padding: 1px 6px; }
.ui3mem-item.is-treasure .ui3mem-item-title { color: #7d5a52; }
.ui3mem-item.is-important .ui3mem-item-dot { background: var(--u-gold); }
.ui3mem-item.is-faded { opacity: .72; }
.ui3mem-item.is-faded .ui3mem-item-title { color: var(--u-text-2); }
[data-theme-mode="dark"] .ui3mem-item.is-treasure .ui3mem-item-title { color: #e0c3bc; }
/* 标题里的「事件类型」小框沿用既有业务 hook 类名 .ml-title-badge，只换 UI3 观感 */
.ui3mem-item-title .ml-title-badge { color: var(--u-rose); }
.ui3mem-item-title .ml-title-rest { color: inherit; }
.ui3mem-item-persons { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 6px; }
.ui3mem-person-chip { font-size: 10.5px; color: var(--u-text-2); background: var(--u-surface-soft); border: 1px solid var(--u-line); border-radius: 9px; padding: 2px 7px; cursor: pointer; }
.ui3mem-item-weight { margin-top: 7px; height: 3px; border-radius: 2px; background: var(--u-line); overflow: hidden; }
.ui3mem-item-weight i { display: block; height: 100%; border-radius: 2px; background: linear-gradient(90deg, var(--u-rose), var(--u-gold)); }
.ui3mem-item-fade { margin-top: 5px; height: 3px; border-radius: 2px; background: var(--u-line); overflow: hidden; }
.ui3mem-item-fade i { display: block; height: 100%; border-radius: 2px; }
.ui3mem-fade-clear i { background: var(--u-sage); }
.ui3mem-fade-fading i { background: var(--u-gold); }
.ui3mem-fade-faded i { background: var(--u-text-3); }
.ui3mem-fade-gone i { background: #b9a49c; }
.ui3mem-fade-manual i { background: var(--u-rose); }
.ui3mem-fade-protected i { background: #9fb0c9; }
.ui3mem-fade-module i { background: var(--u-sage); }
/* 日期分组头 / 渐淡两栏 / 按程度两栏 */
.ui3mem-day-head { display: flex; align-items: center; gap: 10px; margin: 18px 0 2px; font-size: 11.5px; color: var(--u-text-3); }
.ui3mem-day-head::after { content: ""; flex: 1; height: 1px; background: var(--u-line); }
.ui3mem-fade-sec { margin-top: 14px; }
.ui3mem-fade-head { display: flex; align-items: center; gap: 8px; padding: 8px 2px; cursor: pointer; }
.ui3mem-fade-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--u-gold); flex: none; }
.ui3mem-fade-title { font-family: var(--font-display, serif); font-size: 14.5px; color: var(--u-text); }
.ui3mem-fade-count { margin-left: auto; font-size: 11px; color: var(--u-text-3); }
.ui3mem-fold-arrow { width: 7px; height: 7px; border-right: 1.4px solid var(--u-text-3); border-bottom: 1.4px solid var(--u-text-3); transform: rotate(45deg); transition: transform .26s var(--u-ease); }
.ui3mem-fold-arrow.up { transform: rotate(-135deg); }
.ui3mem-fade-body { overflow: hidden; }
.ui3mem-fade-body.is-folded { display: none; }
.ui3mem-load-more { margin: 14px auto 4px; display: block; border: 1px solid var(--u-line); background: var(--u-surface-soft); color: var(--u-text-2); font-family: var(--font-body, sans-serif); font-size: 12px; padding: 8px 20px; border-radius: 14px; cursor: pointer; transition: transform .22s var(--u-ease); }
.ui3mem-load-more:active { transform: scale(.96); }
.ui3mem-empty { padding: 34px 4px; text-align: center; }
.ui3mem-empty-text { font-family: var(--font-display, serif); font-size: 15px; color: var(--u-text-2); }
.ui3mem-empty-deco { margin-top: 6px; font-size: 11.5px; color: var(--u-text-3); }
/* —— 珍藏 —— */
.ui3mem-treasure-intro { padding: 6px 2px 0; }
.ui3mem-treasure-intro h1 { margin: 10px 0 8px; font-family: var(--font-display, serif); font-size: 22px; font-weight: 500; line-height: 1.45; color: var(--u-text); }
.ui3mem-treasure-group { margin-top: 6px; }
.ui3mem-treasure-head { cursor: pointer; user-select: none; }
.ui3mem-treasure-head:active { opacity: .72; }
.ui3mem-treasure-sec { display: flex; flex-direction: column; gap: 9px; }
.ui3mem-pager { font-size: 11.5px; color: var(--u-text-3); text-align: center; padding: 8px 0; }
.ui3mem-treasure-card { display: flex; align-items: center; gap: 12px; padding: 16px; border: 1px solid var(--u-line); border-radius: 20px; background: var(--u-surface); box-shadow: var(--u-shadow); cursor: pointer; transition: transform .28s var(--u-ease); }
.ui3mem-treasure-card:active { transform: scale(.985); }
.ui3mem-treasure-copy { flex: 1; min-width: 0; }
.ui3mem-treasure-copy h3 { margin: 6px 0 4px; font-family: var(--font-display, serif); font-size: 15px; font-weight: 500; color: var(--u-text); line-height: 1.5; }
.ui3mem-treasure-copy p { margin: 0; font-size: 11.5px; line-height: 1.8; color: var(--u-text-3); }
/* —— 整理清单（写下 / 导入 / 旧事 / 回收站）—— */
.ui3mem-manage-list { border: 1px solid var(--u-line); border-radius: 18px; background: var(--u-surface-soft); overflow: hidden; }
.ui3mem-manage-row { display: flex; align-items: center; gap: 10px; padding: 13px 14px; cursor: pointer; border-bottom: 1px solid var(--u-line); transition: background .22s ease; }
.ui3mem-manage-row:last-child { border-bottom: none; }
.ui3mem-manage-row:active { background: var(--u-surface-strong); }
.ui3mem-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.ui3mem-row-title { font-size: 13.5px; color: var(--u-text); }
.ui3mem-row-sub { font-size: 11px; color: var(--u-text-3); }
.ui3mem-row-note { font-size: 11.5px; color: var(--u-rose); }
/* —— 全部（档案）工具条 + 状态 —— */
.ui3mem-archive-tools { display: flex; gap: 8px; padding: 4px 0 2px; }
.ui3mem-tool-btn {
    flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 12px;
    border: 1px solid var(--u-line); border-radius: 15px; background: var(--u-surface); color: var(--u-text-2);
    font-family: var(--font-body, sans-serif); font-size: 12.5px; cursor: pointer;
    transition: transform .24s var(--u-ease), background .24s ease;
}
.ui3mem-tool-btn:active { transform: scale(.97); background: var(--u-surface-strong); }
.ui3mem-archive-note { margin: 12px 0 4px; font-size: 11.5px; line-height: 1.8; color: var(--u-text-3); }
.ui3mem-archive-note b { color: var(--u-text-2); font-weight: 600; }
.ui3mem-archive-note button { border: none; background: none; padding: 0 0 0 6px; font-family: var(--font-body, sans-serif); font-size: 11.5px; color: var(--u-rose); cursor: pointer; }
/* 旧记忆补分类提示（真实动作按钮）*/
.ui3mem-backfill { display: flex; align-items: center; gap: 10px; margin: 10px 0 2px; padding: 12px 14px; border: 1px solid var(--u-line); border-radius: 16px; background: var(--u-surface-soft); }
.ui3mem-backfill-text { flex: 1; font-size: 11.5px; line-height: 1.7; color: var(--u-text-2); }
.ui3mem-backfill-go { border: none; background: none; font-family: var(--font-body, sans-serif); font-size: 12px; color: var(--u-rose); cursor: pointer; }
/* —— 年鉴（统计）—— */
.ui3mem-yearbook-hero { padding: 8px 2px 0; text-align: left; }
.ui3mem-yearbook-num { margin-top: 8px; font-family: var(--font-display, serif); font-size: 40px; line-height: 1; color: var(--u-text); }
.ui3mem-yearbook-hero h1 { margin: 6px 0 8px; font-family: var(--font-display, serif); font-size: 16px; font-weight: 500; color: var(--u-text-2); letter-spacing: 1px; }
.ui3mem-yearbook-trace { display: flex; align-items: flex-end; gap: 2px; height: 42px; margin-top: 14px; }
.ui3mem-stats-sec { margin-top: 4px; }
.ui3mem-dist { gap: 10px; }
.ui3mem-dist-row { display: flex; align-items: center; gap: 10px; }
.ui3mem-dist-name { width: 62px; flex: none; font-size: 11.5px; color: var(--u-text-2); text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ui3mem-dist-bar { flex: 1; height: 6px; border-radius: 3px; background: var(--u-line); overflow: hidden; }
.ui3mem-dist-bar i { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--u-rose), var(--u-gold)); }
.ui3mem-dist-num { width: 34px; flex: none; font-size: 11.5px; color: var(--u-text-3); text-align: right; }
/* 月历（真实日历数据；旧 .ml-calendar-card 卡面被本层覆盖成母体纸面观感）*/
.ui3mem-calendar-card { border: 1px solid var(--u-line); border-radius: 18px; background: var(--u-surface); box-shadow: none; padding: 14px; }
.ui3mem-cal-track { display: flex; align-items: flex-end; gap: 3px; height: 46px; margin: 2px 0 12px; }
.ui3mem-cal-bar { flex: 1; min-height: 2px; border-radius: 2px; background: var(--u-rose-soft); }
.ui3mem-cal-bar.on { background: var(--u-gold); }
/* —— 人物 —— */
.ui3mem-people-intro { padding: 6px 2px 0; }
.ui3mem-people-intro h1 { margin: 10px 0 8px; font-family: var(--font-display, serif); font-size: 22px; font-weight: 500; color: var(--u-text); }
.ui3mem-people-tools { display: flex; align-items: center; gap: 8px; margin: 16px 0 2px; }
.ui3mem-subtabs { display: inline-flex; padding: 3px; gap: 2px; border: 1px solid var(--u-line); border-radius: 15px; background: var(--u-surface); flex: 1; }
.ui3mem-subtab { flex: 1; border: none; background: none; font-family: var(--font-body, sans-serif); font-size: 12.5px; color: var(--u-text-3); padding: 7px 4px; border-radius: 12px; cursor: pointer; transition: background .24s ease, color .24s ease; }
.ui3mem-subtab.active { background: var(--u-surface-strong); color: var(--u-text); box-shadow: 0 2px 8px rgba(170, 120, 100, .10); }
.ui3mem-people-tools .ui3mem-tool-btn { flex: none; padding: 8px 14px; }
.ui3mem-people-body { margin-top: 12px; }
/* —— 整理 / 筛选面板（母体 sheet）—— */
.ui3mem-sheet-root {
    position: absolute; inset: 0; z-index: 60; display: flex; align-items: flex-end; justify-content: center;
    background: rgba(48, 38, 33, .30); opacity: 0; pointer-events: none;
    transition: opacity .3s ease; -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
}
.ui3mem-sheet-root.open { opacity: 1; pointer-events: auto; }
.ui3mem-sheet {
    width: 100%; max-height: 82%; overflow-y: auto; -webkit-overflow-scrolling: touch;
    background: var(--u-surface-strong); border-top-left-radius: 26px; border-top-right-radius: 26px;
    padding: 8px 22px calc(22px + var(--safe-bottom, 0px)); box-shadow: 0 -14px 40px rgba(150, 108, 92, .16);
    transform: translateY(102%); transition: transform .38s var(--u-ease);
}
.ui3mem-sheet-root.open .ui3mem-sheet { transform: translateY(0); }
.ui3mem-sheet-grip { width: 38px; height: 4px; border-radius: 2px; background: var(--u-line); margin: 4px auto 12px; }
.ui3mem-sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.ui3mem-sheet-title { font-family: var(--font-display, serif); font-size: 17px; color: var(--u-text); letter-spacing: 1px; }
.ui3mem-sheet-close { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--u-line); background: var(--u-surface-soft); color: var(--u-text-2); font-family: var(--font-body, sans-serif); font-size: 13px; line-height: 1; cursor: pointer; }
.ui3mem-sheet-label { margin: 18px 0 9px; font-size: 12px; color: var(--u-text-3); letter-spacing: .6px; }
.ui3mem-cv-search { display: flex; align-items: center; gap: 8px; margin-top: 12px; padding: 0 12px; border: 1px solid var(--u-line); border-radius: 15px; background: var(--u-surface-soft); }
.ui3mem-cv-search input { flex: 1; min-width: 0; border: none; outline: none; background: none; padding: 11px 0; font-family: var(--font-body, sans-serif); font-size: 13.5px; color: var(--u-text); }
.ui3mem-cv-search input::placeholder { color: var(--u-text-3); }
.ui3mem-cv-search span { color: var(--u-text-3); display: flex; }
.ui3mem-cv-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.ui3mem-chip {
    border: 1px solid var(--u-line); background: var(--u-surface-soft); color: var(--u-text-2);
    font-family: var(--font-body, sans-serif); font-size: 12px; padding: 7px 13px; border-radius: 14px; cursor: pointer;
    transition: transform .2s var(--u-ease), background .2s ease, color .2s ease;
}
.ui3mem-chip:active { transform: scale(.95); }
.ui3mem-chip.active { background: var(--u-rose-soft); color: #7d5a52; border-color: transparent; }
[data-theme-mode="dark"] .ui3mem-chip.active { color: var(--u-text); }
.ui3mem-seg { display: flex; gap: 2px; padding: 3px; border: 1px solid var(--u-line); border-radius: 15px; background: var(--u-surface-soft); }
.ui3mem-seg-btn { flex: 1; border: none; background: none; font-family: var(--font-body, sans-serif); font-size: 12.5px; color: var(--u-text-3); padding: 8px 4px; border-radius: 12px; cursor: pointer; transition: background .24s ease, color .24s ease; }
.ui3mem-seg-btn.active { background: var(--u-surface-strong); color: var(--u-text); box-shadow: 0 2px 8px rgba(170, 120, 100, .10); }
.ui3mem-seg-btn.mb-blink { animation: ui3memBlink 1.5s ease-in-out 2; }
@keyframes ui3memBlink { 0%, 100% { color: var(--u-text-3); } 50% { color: var(--u-rose); } }
.ui3mem-cat-row { display: flex; gap: 7px; overflow-x: auto; padding-bottom: 2px; -webkit-overflow-scrolling: touch; }
.ui3mem-cat-row::-webkit-scrollbar { display: none; }
.ui3mem-cat-chip { flex: none; border: 1px solid var(--u-line); background: var(--u-surface-soft); color: var(--u-text-2); font-family: var(--font-body, sans-serif); font-size: 12px; padding: 7px 12px; border-radius: 14px; cursor: pointer; display: inline-flex; align-items: center; gap: 5px; transition: transform .2s var(--u-ease); }
.ui3mem-cat-chip:active { transform: scale(.95); }
.ui3mem-cat-chip.active { background: var(--u-rose-soft); color: #7d5a52; border-color: transparent; }
.ui3mem-cat-count { font-size: 10.5px; color: var(--u-text-3); }
.ui3mem-sheet-row { display: flex; align-items: center; gap: 10px; padding: 13px 2px; cursor: pointer; border-bottom: 1px solid var(--u-line); }
.ui3mem-sheet-row:last-child { border-bottom: none; }
.ui3mem-sheet-row .ui3mem-row-main { flex: 1; min-width: 0; }
.ui3mem-sheet-row .ui3mem-chev { opacity: .8; }
.ui3mem-sheet-actions { display: flex; gap: 10px; margin-top: 18px; }
.ui3mem-btn { flex: 1; border: 1px solid var(--u-line); background: var(--u-surface-soft); color: var(--u-text-2); font-family: var(--font-body, sans-serif); font-size: 13px; padding: 12px; border-radius: 15px; cursor: pointer; transition: transform .22s var(--u-ease); }
.ui3mem-btn:active { transform: scale(.97); }
.ui3mem-btn.primary { background: var(--u-rose-soft); color: #7d5a52; border-color: transparent; }
[data-theme-mode="dark"] .ui3mem-btn.primary { color: var(--u-text); }
/* 兼容占位（无可见外观）里的旧下拉面板：留在结构里给 JS 当容器 */
#tab-memory .ui3mem-ghost .ml-type-list { display: block; }
/* 底部留白：批量条出现时不被盖住 */
#tab-memory .ui3mem-batch-bar { margin: 16px 0 0; }
#tab-memory .ml-empty { padding: 34px 4px; text-align: center; }
#tab-memory .ml-empty-text { font-family: var(--font-display, serif); font-size: 15px; color: var(--u-text-2); }
#tab-memory .ml-empty-deco { margin-top: 6px; font-size: 11.5px; color: var(--u-text-3); }
/* —— 骨架屏（UI3 语法；旧 ml-sk-* 已随旧骨架退场）—— */
.ui3mem-sk-row { height: 62px; border-radius: 14px; margin: 10px 0; background: linear-gradient(90deg, var(--u-surface-soft), var(--u-surface), var(--u-surface-soft)); background-size: 200% 100%; animation: ui3memSk 1.5s linear infinite; }
.ui3mem-sk-block { height: 120px; border-radius: 18px; margin: 14px 0; background: linear-gradient(90deg, var(--u-surface-soft), var(--u-surface), var(--u-surface-soft)); background-size: 200% 100%; animation: ui3memSk 1.5s linear infinite; }
@keyframes ui3memSk { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .ui3mem-sk-row, .ui3mem-sk-block { animation: none; } }
/* 统计页骨架屏（统计模块自带这两个类名，本层沿用旧类名但给它母体的纸质色，不再是灰块） */
#tab-memory .ml-sk-calendar { height: 210px; border-radius: 18px; background: var(--u-surface); border: 1px solid var(--u-line); }
#tab-memory .ml-sk-dist { height: 120px; border-radius: 16px; background: var(--u-surface); border: 1px solid var(--u-line); }
/* —— 窄屏（360~369）—— */
@media (max-width: 369px) {
    .view { padding: 4px 26px 0; }
    .ui3mem-intro h1 { font-size: 22px; }
    .ui3mem-glance-grid, .ui3mem-quick-grid { gap: 6px; }
    .ui3mem-sheet { padding-left: 16px; padding-right: 16px; }
}
/* —— 减少动态偏好（含 iOS）—— */
@media (prefers-reduced-motion: reduce) {
    .ui3mem-sheet-root, .ui3mem-sheet, .ui3mem-subnav-ind, .ui3mem-item, .ui3mem-glance-item,
    .ui3mem-quick-card, .ui3mem-tool-btn, .ui3mem-icon-btn, .ui3mem-chip, .ui3mem-btn { transition: none !important; }
    .ui3mem-arrived { animation: none !important; opacity: 1 !important; transform: none !important; }
    .ui3mem-out-forward, .ui3mem-out-reverse { opacity: 0 !important; transform: none !important; }
    .ui3mem-in-forward, .ui3mem-in-reverse { opacity: 1 !important; transform: none !important; }
    .ui3mem-seg-btn.mb-blink { animation: none; }
}
