/* 助手的「人格与记忆」面板（右侧抽屉），2026-11-30 重做。
   规矩：全程浅色（不用深灰深蓝的大色块）；字只用常规和半粗两档；一屏只留要操作的东西，解释收进 ⓘ 悬停气泡；
   配色取 logo 的蓝 #30ACD8 和金 #EA9838。类名一律 mp- 开头，不沾 collection.css 里旧的 .memory-dialog 规则。 */
.mp { --mp-line: #e9ecf1; --mp-soft: #f4f6f9; --mp-text: #1d2129; --mp-sub: #5b6573; --mp-faint: #98a1ad; --mp-blue: #1274a5;
  position: fixed; inset: 0 0 0 auto; margin: 0; width: 580px; max-width: 100vw; height: 100dvh; max-height: 100dvh; box-sizing: border-box; padding: 0; border: 0; border-radius: 28px 0 0 28px;
  color: var(--mp-text); background: #fff; overflow: hidden; font-size: 14px; line-height: 1.6; box-shadow: -28px 0 70px -36px rgb(10 53 82 / 40%); animation: mp-slide .34s cubic-bezier(.22, 1, .36, 1) both; }
.mp[open] { display: flex; flex-direction: column; }
.mp::backdrop { background: rgb(15 35 52 / 26%); backdrop-filter: blur(3px); animation: mp-fade .24s ease both; }
.mp button { font: inherit; cursor: pointer; }
.mp svg { flex: none; }

/* ---------- 头部：小机器人 + 助手叫什么、是谁的助手 ---------- */
.mp-head { flex: none; display: flex; align-items: center; gap: 16px; padding: 30px 24px 22px 28px;
  background: radial-gradient(80% 150% at 0% 0%, #e6f6fd 0, rgb(230 246 253 / 0%) 64%), radial-gradient(55% 130% at 100% 0%, #fff4e2 0, rgb(255 244 226 / 0%) 62%); }
.mp-bot { flex: none; width: 72px; height: 72px; display: grid; place-items: center; }
.mp-bot.small { width: 56px; height: 56px; opacity: .9; }
.mp-robot { width: 100%; height: 100%; stroke: none; overflow: visible; }
.mp-robot .rb-body { transform-box: fill-box; transform-origin: 50% 60%; animation: rb-float 3.6s ease-in-out infinite; }
.mp-robot .rb-shadow { transform-box: fill-box; transform-origin: center; animation: rb-shadow 3.6s ease-in-out infinite; }
.mp-robot .rb-eyes { transform-box: fill-box; transform-origin: center; animation: rb-blink 4.6s infinite; }
.mp-robot .rb-ping { transform-box: fill-box; transform-origin: center; animation: rb-ping 2.6s ease-out infinite; }
.mp-bot.yes .rb-body { animation: rb-nod .7s ease both; }
.mp-id { min-width: 0; flex: 1; }
.mp-id h2 { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; font-size: 22px; font-weight: 600; line-height: 1.35; letter-spacing: .01em; }
.mp-id h2 span { overflow: hidden; max-width: 100%; white-space: nowrap; text-overflow: ellipsis; }
.mp-id h2 i { padding: 0 10px; border-radius: 99px; color: var(--mp-blue); background: rgb(255 255 255 / 80%); box-shadow: inset 0 0 0 1px #cfeaf6; font-style: normal; font-size: 12px; font-weight: 400; line-height: 22px; letter-spacing: 0; }
.mp-id p { margin: 2px 0 0; color: var(--mp-sub); font-size: 13.5px; }
.mp-close { align-self: flex-start; width: 36px; height: 36px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 12px; color: var(--mp-faint); background: transparent; transition: background .16s ease, color .16s ease; }
.mp-close:hover { color: var(--mp-text); background: rgb(255 255 255 / 85%); }
.mp-close svg { width: 18px; height: 18px; }

/* ---------- 三个页签 ---------- */
.mp-tabs { flex: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin: 0 28px; padding: 4px; border-radius: 16px; background: var(--mp-soft); }
.mp-tabs button { height: 40px; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 0; white-space: nowrap; border: 0; border-radius: 12px; color: var(--mp-sub); background: transparent; font-size: 14px; transition: background .2s ease, color .2s ease, box-shadow .2s ease; }
.mp-tabs button svg { width: 16px; height: 16px; }
.mp-tabs button:hover { color: var(--mp-text); }
.mp-tabs button[aria-pressed=true] { color: var(--mp-blue); background: #fff; font-weight: 600; box-shadow: 0 8px 18px -12px rgb(10 53 82 / 45%), 0 0 0 1px rgb(10 53 82 / 4%); }
.mp-alert { flex: none; margin: 12px 28px 0; padding: 9px 14px; border-radius: 12px; color: #96560d; background: #fff4e3; font-size: 13px; }
.mp-alert:empty { display: none; }
.mp-body { flex: 1; min-height: 0; overflow: auto; padding: 22px 28px 28px; scrollbar-width: thin; scrollbar-color: #dfe3e9 transparent; }
.mp-body[aria-busy=true] { pointer-events: none; }
.mp-snack { position: absolute; left: 50%; bottom: 26px; z-index: 30; padding: 9px 18px; border-radius: 99px; color: var(--mp-blue); background: #fff; font-size: 13.5px; font-weight: 500; transform: translateX(-50%);
  box-shadow: 0 16px 36px -14px rgb(10 53 82 / 45%), inset 0 0 0 1px #cfeaf6; animation: mp-rise .26s cubic-bezier(.22, 1, .36, 1) both; }
.mp-snack[hidden] { display: none; }

/* ---------- 悬停小标志（解释都收在这里）和任何带 data-tip 的东西 ---------- */
.mp [data-tip] { position: relative; }
.mp [data-tip]::after { content: attr(data-tip); position: absolute; z-index: 40; left: 50%; top: calc(100% + 8px); width: max-content; max-width: 250px; padding: 9px 13px; border-radius: 12px; color: var(--mp-sub); background: #fff;
  font-size: 12.5px; font-weight: 400; line-height: 1.65; text-align: left; white-space: normal; letter-spacing: 0; pointer-events: none; opacity: 0; transform: translate(-50%, -4px);
  box-shadow: 0 18px 40px -16px rgb(10 53 82 / 40%), 0 0 0 1px var(--mp-line); transition: opacity .16s ease, transform .16s ease; }
.mp [data-tip]:hover::after, .mp [data-tip]:focus::after, .mp [data-tip]:focus-within::after { opacity: 1; transform: translate(-50%, 0); }
.mp [data-tip].left::after { left: -8px; transform: translate(0, -4px); }
.mp [data-tip].left:hover::after, .mp [data-tip].left:focus::after { transform: none; }
.mp [data-tip].right::after { left: auto; right: -8px; transform: translate(0, -4px); }
.mp [data-tip].right:hover::after, .mp [data-tip].right:focus::after { transform: none; }
.mp [data-tip].up::after { top: auto; bottom: calc(100% + 8px); }
.mp-tip { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; color: #b3bac4; vertical-align: middle; outline: 0; cursor: help; transition: color .16s ease, background .16s ease; }
.mp-tip svg { width: 16px; height: 16px; }
.mp-tip:hover, .mp-tip:focus { color: var(--mp-blue); background: #e8f6fc; }

/* ---------- 按钮 ---------- */
.mp-btn { height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 0 18px; border: 0; border-radius: 13px; color: var(--mp-text); background: var(--mp-soft); font-size: 14px; white-space: nowrap; transition: background .16s ease, box-shadow .16s ease, transform .16s ease, opacity .16s ease; }
.mp-btn:hover { background: #e9edf2; }
.mp-btn:active { transform: scale(.98); }
.mp-btn svg { width: 16px; height: 16px; }
.mp-btn.primary { color: #fff; background: linear-gradient(135deg, #30acd8, #1783b3); font-weight: 500; box-shadow: 0 12px 22px -14px rgb(18 116 165 / 85%); }
.mp-btn.primary:hover { background: linear-gradient(135deg, #2aa3cf, #14779f); }
.mp-btn.primary:disabled { color: #8fa3b1; background: #e9eef2; box-shadow: none; cursor: default; }
.mp-btn.small { height: 32px; padding: 0 14px; border-radius: 10px; font-size: 13px; }
.mp-icon { width: 34px; height: 34px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 11px; color: #a3abb6; background: transparent; transition: background .16s ease, color .16s ease; }
.mp-icon svg { width: 17px; height: 17px; }
.mp-icon:hover { color: var(--mp-text); background: var(--mp-soft); }
.mp-icon.danger:hover { color: #d9463c; background: #fdeeec; }
.mp :is(.mp-btn, .mp-icon, .mp-close, .mp-tabs button):focus-visible { outline: 2px solid #30acd8; outline-offset: 2px; }

/* ---------- 输入框 ---------- */
.mp :is(input:not([type=radio]), textarea) { width: 100%; box-sizing: border-box; padding: 10px 14px; border: 1px solid #e1e5ea; border-radius: 13px; color: var(--mp-text); background: #fff; font: inherit; font-size: 14px; transition: border-color .18s ease, box-shadow .18s ease; }
.mp input:not([type=radio]) { height: 44px; padding-block: 0; }
.mp textarea { display: block; min-height: 68px; resize: vertical; line-height: 1.65; }
.mp :is(input:not([type=radio]), textarea):focus { outline: 0; border-color: #30acd8; box-shadow: 0 0 0 4px rgb(48 172 216 / 16%); }
.mp ::placeholder { color: #b4bbc5; }

/* ---------- 人格设置 ---------- */
.mp-form { display: grid; gap: 22px; }
.mp-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.mp-field { position: relative; display: block; }
.mp-field > span, .mp-seg legend { display: block; margin-bottom: 8px; padding: 0; color: var(--mp-sub); font-size: 13px; }
.mp-count { position: absolute; right: 12px; bottom: 8px; color: #b4bbc5; font-size: 11.5px; pointer-events: none; }
.mp-seg { min-width: 0; margin: 0; padding: 0; border: 0; }
.mp-seg > div { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 4px; padding: 4px; border-radius: 15px; background: var(--mp-soft); }
.mp-seg label { display: block; cursor: pointer; }
.mp-seg input { position: absolute; opacity: 0; pointer-events: none; }
.mp-seg span { display: block; height: 38px; border-radius: 11px; color: var(--mp-sub); font-size: 14px; line-height: 38px; text-align: center; white-space: nowrap; transition: background .2s ease, color .2s ease, box-shadow .2s ease; }
.mp-seg label:hover span { color: var(--mp-text); }
.mp-seg input:checked + span { color: var(--mp-blue); background: #fff; font-weight: 600; box-shadow: 0 8px 18px -12px rgb(10 53 82 / 45%), 0 0 0 1px rgb(10 53 82 / 4%); }
.mp-seg input:focus-visible + span { outline: 2px solid #30acd8; outline-offset: 1px; }
.mp-more { border-top: 1px solid var(--mp-line); }
.mp-more summary, .mp-flow summary { display: flex; align-items: center; gap: 6px; list-style: none; color: var(--mp-sub); font-size: 13.5px; cursor: pointer; user-select: none; }
.mp-more summary { padding: 16px 0 0; }
.mp :is(.mp-more, .mp-flow) summary::-webkit-details-marker { display: none; }
.mp :is(.mp-more, .mp-flow) summary > svg { width: 15px; height: 15px; color: #b3bac4; transition: transform .2s ease; }
.mp :is(.mp-more, .mp-flow)[open] summary > svg { transform: rotate(90deg); }
.mp :is(.mp-more, .mp-flow) summary:hover { color: var(--mp-text); }
.mp-more-body { display: grid; gap: 18px; padding-top: 18px; }
.mp-foot { position: sticky; bottom: -28px; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 -28px -28px; padding: 16px 28px 24px; background: linear-gradient(180deg, rgb(255 255 255 / 0%), #fff 34%); }
.mp-foot .mp-btn { min-width: 148px; height: 44px; }

/* ---------- 工具条、列表 ---------- */
.mp-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.mp-search { position: relative; flex: 1; min-width: 0; display: block; }
.mp-search svg { position: absolute; left: 14px; top: 50%; width: 16px; height: 16px; color: #a3abb6; transform: translateY(-50%); pointer-events: none; }
.mp .mp-search input { height: 40px; padding-left: 40px; border-color: transparent; background: var(--mp-soft); }
.mp .mp-search input:focus { border-color: #30acd8; background: #fff; }
.mp-note { flex: 1; display: flex; align-items: center; gap: 4px; color: var(--mp-sub); font-size: 13.5px; }
.mp-note b { font-weight: 600; color: var(--mp-text); }
.mp-slot:empty { display: none; }
.mp-slot { margin-bottom: 12px; }
.mp-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; margin: 0; padding: 0; list-style: none; }
.mp-item { display: flex; align-items: flex-start; gap: 10px; padding: 14px 10px 14px 18px; border: 1px solid var(--mp-line); border-radius: 18px; background: #fff; transition: border-color .2s ease, box-shadow .25s ease; animation: mp-rise .32s cubic-bezier(.22, 1, .36, 1) both; }
.mp-item:hover { border-color: #cfeaf6; box-shadow: 0 16px 30px -24px rgb(18 116 165 / 60%); }
.mp-item.off { background: #fafbfc; }
.mp-item.off p { color: var(--mp-faint); }
.mp-item.wait { border-color: #f7dcb4; background: linear-gradient(135deg, #fffaf1, #fff); }
.mp-main { min-width: 0; flex: 1; }
.mp-main p { margin: 0; font-size: 14.5px; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; }
.mp-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.mp-chip { padding: 0 9px; border-radius: 99px; font-style: normal; font-size: 11.5px; line-height: 20px; }
.mp-chip.core { color: var(--mp-blue); background: #e4f6fc; }
.mp-chip.ref { color: var(--mp-sub); background: var(--mp-soft); }
.mp-chip.wait { color: #a55f0a; background: #fff0d9; }
.mp-chip.off { color: var(--mp-faint); background: var(--mp-soft); }
.mp-ops { flex: none; display: flex; align-items: center; gap: 2px; opacity: .5; transition: opacity .18s ease; }
.mp-ops .mp-btn { margin-right: 4px; }
:is(.mp-item, .mp-list.flow li):hover .mp-ops, .mp-ops:focus-within, .mp-item.wait .mp-ops { opacity: 1; }
.mp-empty { display: grid; justify-items: center; gap: 4px; padding: 44px 20px 36px; color: var(--mp-faint); font-size: 13px; text-align: center; }
.mp-empty b { margin-top: 6px; color: var(--mp-sub); font-size: 14.5px; font-weight: 500; }
.mp-loading { height: 132px; border-radius: 18px; background: linear-gradient(100deg, #f4f6f9 30%, #fafbfc 50%, #f4f6f9 70%) 0 0 / 200% 100%; animation: mp-shimmer 1.3s linear infinite; }

/* ---------- 增改一条 ---------- */
.mp-editor { padding: 12px; border-radius: 18px; background: linear-gradient(135deg, #eff9fd, #fffaf1); box-shadow: inset 0 0 0 1px #d6eef8; animation: mp-rise .24s cubic-bezier(.22, 1, .36, 1) both; }
.mp-editor footer { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.mp-editor .mp-btn { height: 36px; padding: 0 16px; border-radius: 11px; }
.mp-editor .mp-btn:not(.primary) { background: rgb(255 255 255 / 80%); }
.mp-grow { flex: 1; }
.mp-seg.mini > div { width: 186px; padding: 3px; border-radius: 12px; background: rgb(255 255 255 / 70%); }
.mp-seg.mini span { height: 30px; border-radius: 9px; font-size: 13px; line-height: 30px; }
.mp-item.editing { display: block; padding: 0; border: 0; background: transparent; box-shadow: none; }
.mp-item.editing > :not(.mp-editor) { display: none; }

/* ---------- 短期记忆：按天排 ---------- */
.mp-day + .mp-day { margin-top: 26px; }
.mp-earlier { display: flex; margin: 22px auto 2px; padding: 0 26px; color: var(--mp-sub); }
.mp-day h3 { display: flex; align-items: baseline; gap: 8px; margin: 0 0 12px; font-size: 16px; font-weight: 600; }
.mp-day h3 small { color: var(--mp-faint); font-size: 12.5px; font-weight: 400; }
.mp-flow { margin-top: 10px; padding: 12px 10px 12px 16px; border-radius: 18px; background: var(--mp-soft); }
.mp-list.flow { gap: 0; margin-top: 8px; }
.mp-list.flow li { display: flex; align-items: flex-start; gap: 12px; padding: 10px 0; border-top: 1px solid #e6e9ee; }
.mp-list.flow time { flex: none; width: 40px; padding-top: 2px; color: var(--mp-faint); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.mp-list.flow p { font-size: 14px; }
.mp-list.flow small { display: -webkit-box; overflow: hidden; margin-top: 2px; color: var(--mp-faint); font-size: 12.5px; line-height: 1.6; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

/* ---------- 工作规范：一节一个框，一条一行；两行放不下的点一下展开 ---------- */
/* 「工作规范」页：「我定的」空着时的一行提示；「平台统一的」那一组前面的小分隔。 */
.mp-hint { padding: 13px 18px; border: 1px dashed #dfe4ea; border-radius: 18px; color: var(--mp-faint); font-size: 13.5px; }
.mp-group { display: flex; align-items: center; gap: 10px; margin: 30px 0 18px; color: var(--mp-sub); font-size: 13px; font-weight: 500; }
.mp-group::after { content: ""; flex: 1; order: 1; height: 1px; background: var(--mp-line); }
.mp-group small { order: 2; color: var(--mp-faint); font-size: 12.5px; font-weight: 400; font-variant-numeric: tabular-nums; }
.mp-group + .mp-day { margin-top: 0; }
.mp-total { flex: none; color: var(--mp-faint); font-size: 13px; font-variant-numeric: tabular-nums; }
.mp-rules { margin: 0; padding: 0; list-style: none; counter-reset: mp-rule; border: 1px solid var(--mp-line); border-radius: 18px; overflow: hidden; }
.mp-rules > li { counter-increment: mp-rule; display: flex; align-items: flex-start; gap: 12px; padding: 13px 14px; border-top: 1px solid var(--mp-line); outline: 0; transition: background .16s ease; }
.mp-rules > li:first-child { border-top: 0; }
.mp-rules > li::before { content: counter(mp-rule); flex: none; width: 22px; height: 22px; margin-top: 1px; border-radius: 50%; color: var(--mp-blue); background: #e4f6fc; font-size: 11.5px; line-height: 22px; text-align: center; font-variant-numeric: tabular-nums; }
.mp-rules > li.note { counter-increment: none; background: #fffcf6; }
.mp-rules > li.note::before { content: ""; background: #EA9838; width: 6px; height: 6px; margin: 9px 8px 0; }
.mp-rules p { display: -webkit-box; overflow: hidden; font-size: 14px; white-space: normal; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.mp-rules ul { display: none; margin: 6px 0 0; padding-left: 18px; color: var(--mp-sub); font-size: 13px; line-height: 1.7; }
.mp-rules > li > svg { flex: none; width: 15px; height: 15px; margin-top: 5px; color: #b3bac4; opacity: 0; transition: transform .2s ease; }
.mp-rules > li.more { cursor: pointer; }
.mp-rules > li.more > svg { opacity: 1; }
.mp-rules > li.more:hover, .mp-rules > li.more:focus-visible { background: #f7fbfd; }
.mp-rules > li.open p { display: block; }
.mp-rules > li.open ul { display: block; }
.mp-rules > li.open > svg { transform: rotate(90deg); }

@keyframes mp-slide { from { transform: translateX(48px); opacity: 0; } }
@keyframes mp-fade { from { opacity: 0; } }
@keyframes mp-rise { from { opacity: 0; transform: translateY(6px); } }
.mp-snack { animation-name: mp-snack; }
@keyframes mp-snack { from { opacity: 0; transform: translate(-50%, 8px); } }
@keyframes mp-shimmer { to { background-position: -200% 0; } }
@keyframes rb-float { 50% { transform: translateY(-2.6px); } }
@keyframes rb-shadow { 50% { transform: scaleX(.84); opacity: .1; } }
@keyframes rb-blink { 0%, 43%, 49%, 100% { transform: scaleY(1); } 46% { transform: scaleY(.1); } }
@keyframes rb-ping { 0% { transform: scale(1); opacity: .5; } 70%, 100% { transform: scale(2.7); opacity: 0; } }
@keyframes rb-nod { 25% { transform: translateY(3px) rotate(-5deg); } 55% { transform: translateY(-2px) rotate(4deg); } 80% { transform: translateY(1px) rotate(-1deg); } }

/* 手机上：占满整屏，图标按钮一直亮着（没有鼠标悬停）。 */
@media (hover: none) { .mp-ops { opacity: 1; } }
@media (max-width: 680px) {
  .mp { width: 100vw; border-radius: 0; }
  .mp-head { padding: 22px 16px 18px 20px; gap: 12px; }
  .mp-bot { width: 60px; height: 60px; }
  .mp-id h2 { font-size: 20px; }
  .mp-tabs, .mp-alert { margin-inline: 16px; }
  .mp-tabs button { font-size: 13.5px; }
  .mp-tabs button svg { display: none; }
  .mp-body { padding: 18px 16px 24px; }
  .mp-foot { bottom: -24px; margin: 0 -16px -24px; padding: 14px 16px 20px; }
  .mp-foot .mp-btn { flex: 1; }
  .mp-seg > div { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mp-seg.mini > div, .mp-seg > div[style*="--n:3"] { grid-template-columns: repeat(var(--n), minmax(0, 1fr)); }
  /* 编辑框里的分类有三个选项，手机上和按钮挤不进一行：分类单占一行，按钮在下一行靠右。 */
  .mp-editor footer { flex-wrap: wrap; }
  .mp-editor .mp-seg.mini { flex: 1 1 100%; }
  .mp-editor .mp-seg.mini > div { width: auto; }
  .mp [data-tip]::after { max-width: 210px; }
}
@media (prefers-reduced-motion: reduce) { .mp, .mp::backdrop, .mp *, .mp *::after { animation: none !important; transition: none !important; } }
