/* 聊天详情：记忆 / 设置 / 工具页 */

/* ============ 居中弹窗（语音 / 红包 / 转账 / 记忆工具） ============ */
.center-backdrop{
  position:absolute; inset:0;
  background:rgba(11,11,15,.44);
  display:flex; align-items:center; justify-content:center;
  padding:0 26px;
  opacity:0; pointer-events:none;
  transition:opacity .24s;
  z-index:82;
}
.center-backdrop.show{ opacity:1; pointer-events:auto; }
.center-card{
  width:100%; max-width:320px;
  max-height:76%;
  overflow-y:auto;
  background:var(--bg);
  border-radius:28px;
  padding:22px 0 18px;
  box-shadow:0 24px 60px rgba(11,11,15,.24);
  transform:scale(.9) translateY(10px);
  opacity:0;
  transition:transform .34s var(--spring), opacity .24s;
}
.center-backdrop.show .center-card{ transform:none; opacity:1; }
.center-card::-webkit-scrollbar{ width:0; }
.cc-title{
  font-size:16px; font-weight:600;
  color:var(--ink);
  text-align:center;
  padding:0 24px 4px;
}
.cc-sub{
  font-size:12px; color:var(--gray-2);
  text-align:center;
  padding:6px 24px 2px;
  line-height:1.6;
}
.center-card .pad-body{ padding:14px 22px 4px; }

/* ============ 红包 / 转账 详情（居中弹窗内） ============ */
.pay-detail{ padding:8px 16px 2px; }
.pay-hero{
  position:relative; overflow:hidden;
  border-radius:22px; padding:24px 18px 20px;
  text-align:center; color:#fff;
  background:#E85A48;
  box-shadow:none;
}
.pay-hero.tr{ background:#F09A3A; box-shadow:none; }
.pay-hero.done{ background:#E7B7AD; box-shadow:none; }
.pay-hero.tr.done{ background:#E4C09A; box-shadow:none; }
.pay-hero.back{ background:#C5C8D0; box-shadow:none; }
.pay-hero::before{ display:none; }
.pay-hero > *{ position:relative; z-index:1; }
.pay-hero-avatar{
  width:48px; height:48px; border-radius:50%;
  object-fit:cover; margin:0 auto 10px; display:block;
  box-shadow:none;
}
.pay-hero-who{ font-size:13px; opacity:.92; }
.pay-hero-note{
  font-size:15.5px; font-weight:600; margin-top:6px;
  text-shadow:none;
  word-break:break-word;
}
.pay-hero-amt{
  margin-top:14px;
  font-family:var(--font-num), inherit;
  font-size:38px; font-weight:700; line-height:1;
  letter-spacing:-.02em;
  text-shadow:none;
}
.pay-hero-amt small{ font-size:20px; font-weight:600; margin-right:2px; }
.pay-hero-seal{
  width:64px; height:64px; margin:12px auto 0;
  border-radius:50%;
  background:#F6E3B2;
  box-shadow:none;
  display:flex; align-items:center; justify-content:center;
  font-family:"Noto Serif SC", "Songti SC", "STSong", serif;
  font-size:26px; font-weight:700; color:#B23A22;
}
.pay-hero-state{
  display:inline-block; margin-top:12px;
  padding:4px 12px; border-radius:999px;
  background:rgba(255,255,255,.2);
  font-size:11.5px; letter-spacing:.04em;
}
.pay-meta{
  margin:12px 0 0;
  border-radius:16px; background:var(--fill);
  overflow:hidden;
}
.pay-meta div{
  display:flex; justify-content:space-between; align-items:center; gap:12px;
  padding:11px 14px; font-size:12.5px;
}
.pay-meta div + div{ box-shadow:inset 0 1px 0 var(--hairline); }
.pay-meta span{ color:var(--gray-2); flex:0 0 auto; }
.pay-meta b{ font-weight:500; color:var(--ink); font-family:var(--font-num), inherit; text-align:right; word-break:break-all; }
.pay-btns{ display:flex; flex-direction:column; gap:8px; margin-top:12px; }
.pay-btn{
  min-height:46px; padding:8px 14px;
  border:none; border-radius:15px;
  font-family:inherit; font-size:15px; font-weight:600; line-height:1.25;
  cursor:pointer; color:#fff;
  background:var(--ink);
  transition:transform .16s, opacity .16s;
}
.pay-btn:active{ transform:scale(.98); }
.pay-btn.red{ background:#E85A48; box-shadow:none; }
.pay-btn.tr{ background:#F09A3A; box-shadow:none; }
.pay-btn.ghost{ background:var(--fill); color:var(--ink); }
.pay-btn.ghost.danger{ color:var(--danger); }
.pay-btn small{ display:block; font-size:11px; font-weight:400; opacity:.7; margin-top:2px; }
.center-card .save-btn{ margin-top:20px; height:46px; font-size:15px; }
.center-card .sheet-item{ padding:13px 22px; }
.center-card .sheet-item-preview{ max-width:220px; }

/* ============ 聊天详情页（右上角三点进入） ============ */
.tinfo-card{
  display:flex; align-items:center; gap:14px;
  padding:20px;
  margin:14px 20px 0;
  background:var(--fill);
  border-radius:24px;
}
.tinfo-card.tinfo-card-group{
  display:block;
  padding:18px 16px 14px;
}
.tinfo-card-group .tinfo-head{
  display:flex; align-items:center; gap:14px;
  padding:0 4px 14px;
}
.tinfo-avatar{
  width:60px; height:60px;
  border-radius:50%;
  object-fit:cover;
  background:var(--bg);
  flex:0 0 auto;
}
.tinfo-avatar.tinfo-avatar-edit{
  cursor:pointer;
  box-shadow:0 0 0 2px transparent;
  transition:box-shadow .18s;
}
@media (hover: hover) and (pointer: fine){
.tinfo-avatar.tinfo-avatar-edit:hover{
  box-shadow:0 0 0 2px rgba(var(--tint-rgb),.35);
}
}

.grp-grid{
  display:grid;
  grid-template-columns:repeat(4, 1fr);
  gap:12px 6px;
  padding:4px 0 2px;
}
.grp-tile{
  display:flex; flex-direction:column; align-items:center;
  gap:6px;
  padding:4px 2px;
  border:0; background:transparent;
  cursor:pointer;
  -webkit-tap-highlight-color:transparent;
}
.grp-tile:active{ opacity:.72; }
.grp-tile-av{
  position:relative;
  width:52px; height:52px;
}
.grp-tile-av img,
.grp-tile-av .grp-tile-plus{
  width:52px; height:52px;
  border-radius:16px;
  object-fit:cover;
  background:var(--bg);
  display:block;
}
.grp-tile-av .grp-tile-plus{
  display:flex; align-items:center; justify-content:center;
  border:1.5px dashed rgba(var(--tint-rgb),.35);
  background:rgba(var(--tint-rgb),.06);
  color:var(--tint);
}
.grp-tile-av .grp-tile-plus svg{
  width:22px; height:22px; stroke:currentColor; fill:none;
  stroke-width:1.8; stroke-linecap:round;
}
.grp-tile-badge{
  position:absolute; left:50%; bottom:-3px;
  transform:translateX(-50%);
  font-size:9px; font-weight:600; line-height:1;
  padding:2px 5px; border-radius:8px;
  white-space:nowrap;
  background:var(--ink); color:var(--bg);
}
.grp-tile-badge.muted{ background:#8E8E93; }
.grp-tile-badge.admin{ background:var(--tint); color:#fff; }
.grp-tile-name{
  max-width:100%;
  font-size:11px; font-weight:500; color:var(--ink);
  text-align:center;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
  line-height:1.3;
}
.grp-member-acts{
  display:flex; flex-direction:column; gap:8px;
  padding:8px 0 4px;
}
.grp-member-acts .save-btn{ margin:0; }
.grp-members{ display:none; }
.tinfo-avatar-initial{
  width:60px; height:60px;
  border-radius:50%;
  background:var(--bg); color:var(--ink);
  display:flex; align-items:center; justify-content:center;
  font-size:24px; font-weight:600;
  flex:0 0 auto;
}
.tinfo-word{ flex:1; min-width:0; }
.tinfo-word b{ display:block; font-size:18px; font-weight:600; }
.tinfo-word span{
  display:block;
  font-size:12.5px; color:var(--gray-2);
  margin-top:5px; line-height:1.6;
}
.tm-pane .tinfo-card{ margin:2px 18px 14px; }
.tinfo-persona{
  margin:22px 20px 0;
  padding:16px 18px;
  background:var(--fill);
  border-radius:20px;
  font-size:13px; color:var(--gray-1);
  line-height:1.75;
  max-height:168px;
  overflow-y:auto;
  white-space:pre-wrap;
}
.tinfo-persona::-webkit-scrollbar{ width:0; }
.tinfo-label{
  font-size:11px; font-weight:600;
  letter-spacing:.1em;
  color:var(--gray-2);
  margin:26px 20px 8px;
}
/* 详情页入口行（记忆 / 设置） */
.tinfo-entry{
  display:flex; align-items:center; gap:14px;
  width:100%;
  padding:17px 20px;
  border:none; background:var(--fill);
  border-radius:20px;
  margin:0 20px 10px;
  box-sizing:border-box;
  width:calc(100% - 40px);
  cursor:pointer;
  text-align:left;
  transition:transform .2s var(--spring), background .18s;
}
@media (hover: hover) and (pointer: fine){
.tinfo-entry:hover{ background:rgba(var(--tint-rgb),.06); }
}

.tinfo-entry:active{ transform:scale(.98); }
.tinfo-entry .te-ico{
  width:38px; height:38px;
  flex:0 0 auto;
  border-radius:13px;
  background:var(--bg);
  display:flex; align-items:center; justify-content:center;
}
.tinfo-entry .te-ico svg{
  width:20px; height:20px;
  fill:none; stroke:var(--ink);
  stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round;
}
.tinfo-entry .te-word{ flex:1; min-width:0; }
.tinfo-entry .te-word b{ display:block; font-size:15px; font-weight:600; color:var(--ink); }
.tinfo-entry .te-word span{
  display:block;
  font-size:12px; color:var(--gray-2);
  margin-top:3px;
}
.tinfo-entry .te-arrow{
  width:18px; height:18px;
  flex:0 0 auto;
  fill:none; stroke:var(--gray-3);
  stroke-width:2; stroke-linecap:round; stroke-linejoin:round;
}

/* ============ 记忆 / 美化 / 互动 / 设置：同页左右切换 ============ */
.tm-switch{
  display:flex; gap:3px;
  margin:2px 18px 14px;
  background:var(--fill);
  border-radius:17px;
  padding:4px;
  flex:0 0 auto;
}
.tm-sw{
  flex:1; height:38px;
  border:none; border-radius:13px;
  background:transparent;
  font-family:inherit;
  font-size:14px; font-weight:500;
  color:var(--gray-1);
  cursor:pointer;
  display:flex; align-items:center; justify-content:center; gap:6px;
  transition:background .22s, color .22s, box-shadow .22s, transform .18s var(--spring);
}
.tm-sw svg{
  width:16px; height:16px;
  fill:none; stroke:currentColor;
  stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round;
}
.tm-sw.on{
  background:var(--bg); color:var(--ink); font-weight:600;
  box-shadow:0 2px 8px rgba(0,0,0,.09);
}
.tm-sw:active{ transform:scale(.97); }
/* 聊天设置四个 Tab：均分宽度，略收字号/图标以免挤在一起 */
#tmSwitch .tm-sw{
  flex:1 1 0; min-width:0;
  font-size:13px; gap:4px;
  white-space:nowrap;
}
#tmSwitch .tm-sw svg{ width:15px; height:15px; flex:0 0 auto; }
.tm-panes{ flex:1; min-height:0; display:flex; }
.tm-pane{
  display:none;
  flex:1; min-height:0;
  overflow-y:auto;
  padding:0 0 30px;
}
.tm-pane.on{ display:block; animation:viewIn .26s var(--ease-out) both; }
.tm-pane::-webkit-scrollbar{ width:0; }

/* 内容大块 */
.tm-block{
  margin:0 18px 14px;
  background:var(--fill);
  border-radius:22px;
  overflow:hidden;
}
.tm-block-head{
  display:flex; align-items:center; gap:9px;
  padding:15px 16px 0;
}
.tm-block-head svg{
  width:17px; height:17px; flex:0 0 auto;
  fill:none; stroke:var(--ink);
  stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round;
}
.tm-block-head b{ font-size:14px; font-weight:600; }
.tm-note{
  padding:6px 16px 0;
  font-size:11.5px; color:var(--gray-2); line-height:1.65;
}
.tm-block-head + .tm-row{ margin-top:6px; }
.tm-row{
  display:flex; align-items:center; gap:12px;
  padding:13px 16px;
}
/* display:flex 会盖掉 HTML hidden；群/私聊切换依赖这些规则真正藏掉 */
.tm-row[hidden],
.tm-block[hidden],
.tm-fold[hidden],
.tm-foot-note[hidden],
.tm-mini-btn[hidden],
.tm-private-only[hidden],
.tm-group-only[hidden]{
  display:none !important;
}
.tm-row + .tm-row{ box-shadow:inset 0 1px 0 rgba(11,11,15,.05); }
.tm-key{ flex:1; min-width:0; }
.tm-key b{ display:block; font-size:14px; font-weight:500; color:var(--ink); }
.tm-key span{ display:block; font-size:11.5px; color:var(--gray-2); margin-top:3px; line-height:1.5; }
.tm-val{
  flex:0 0 auto;
  font-size:13.5px; color:var(--gray-1);
  max-width:52%;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
  font-variant-numeric:tabular-nums;
}
.tm-row input[type="text"],
.tm-row input[type="number"],
.tm-row input[type="datetime-local"],
.tm-row input[type="time"]{
  flex:0 0 auto;
  width:130px;
  border:none; outline:none;
  background:var(--bg);
  border-radius:12px;
  padding:9px 12px;
  font-family:inherit; font-size:14px;
  color:var(--ink); text-align:right;
}
.tm-row input[type="number"]{ width:86px; }
.tm-row input[type="datetime-local"]{ width:auto; max-width:58%; min-width:0; font-size:12.5px; }
/* 行内下拉（聊天美化：选 CSS 预设） */
.tm-row .tm-select{
  flex:0 0 auto;
  max-width:52%;
  border:none; outline:none;
  background:var(--bg);
  border-radius:12px;
  padding:9px 30px 9px 12px;
  font-family:inherit; font-size:13.5px;
  color:var(--ink);
  appearance:none; -webkit-appearance:none;
  cursor:pointer;
  background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238A8A93' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat:no-repeat; background-position:right 10px center; background-size:14px;
  text-overflow:ellipsis; white-space:nowrap; overflow:hidden;
}
.tm-row input::placeholder{ color:var(--gray-3); }
.tm-area{
  display:block;
  width:calc(100% - 32px);
  margin:4px 16px 14px;
  min-height:78px;
  border:none; outline:none; resize:vertical;
  background:var(--bg);
  border-radius:15px;
  padding:12px 14px;
  font-family:inherit; font-size:13.5px; line-height:1.7;
  color:var(--ink);
}
.tm-area::placeholder{ color:var(--gray-3); }
/* iOS 式开关 */
.tm-toggle{
  position:relative;
  flex:0 0 auto;
  width:46px; height:28px;
  border:none; border-radius:999px;
  background:var(--gray-3);
  cursor:pointer;
  transition:background .24s;
}
.tm-toggle::after{
  content:'';
  position:absolute; top:3px; left:3px;
  width:22px; height:22px; border-radius:50%;
  background:#fff;
  box-shadow:0 2px 6px rgba(0,0,0,.22);
  transition:transform .28s var(--spring);
}
.tm-toggle.on{ background:var(--ink); }
.tm-toggle.on::after{ transform:translateX(18px); }
/* 块内分段选择 */
.tm-seg{
  display:flex; gap:3px;
  margin:0 16px 12px;
  background:var(--bg);
  border-radius:14px;
  padding:3px;
}
.tm-seg-btn{
  flex:1; height:34px;
  border:none; border-radius:11px;
  background:transparent;
  font-family:inherit; font-size:12.5px; font-weight:500;
  color:var(--gray-1);
  cursor:pointer;
  transition:background .2s, color .2s;
}
.tm-seg-btn.on{ background:var(--primary); color:var(--ink); font-weight:600; }
/* 折叠子区 */
.tm-fold{ display:none; }
.tm-fold.show{ display:block; }
/* 功能提示词：默认收起，点击行展开；展开后每行一个卡片 */
.pmod-toggle{ cursor:pointer; }
.pmod-toggle .pmod-chev{
  display:flex; align-items:center; justify-content:center;
  width:28px; height:28px; border-radius:50%;
  background:var(--bg); color:var(--gray-1);
  transition:transform .2s;
  flex:none;
}
.pmod-toggle .pmod-chev svg{ width:15px; height:15px; fill:none; stroke:currentColor; stroke-width:2.4; stroke-linecap:round; stroke-linejoin:round; }
.pmod-toggle.open .pmod-chev{ transform:rotate(180deg); background:var(--ink); color:var(--on-ink); }
.pmod-list{ padding:2px 16px 14px; }
.pmod-items{ display:flex; flex-direction:column; gap:8px; }
.pmod{
  display:flex; align-items:center; gap:10px;
  width:100%; text-align:left;
  border:1px solid var(--hairline); border-radius:14px;
  background:var(--card);
  padding:10px 12px;
  font-family:inherit; cursor:pointer;
  transition:border-color .15s, background .15s, box-shadow .15s;
}
.pmod:active{ transform:scale(.995); }
.pmod .pmod-check{
  display:flex; align-items:center; justify-content:center;
  width:22px; height:22px; border-radius:50%;
  border:1.5px solid var(--gray-3); color:transparent;
  flex:none; transition:all .15s;
}
.pmod .pmod-check svg{ width:12px; height:12px; fill:none; stroke:currentColor; stroke-width:3; stroke-linecap:round; stroke-linejoin:round; }
.pmod .pmod-word{ display:flex; flex-direction:column; gap:2px; min-width:0; }
.pmod .pmod-word b{ font-size:13.5px; font-weight:600; color:var(--ink); }
.pmod .pmod-word small{ font-size:11.5px; color:var(--gray-2); line-height:1.4; }
.pmod.on{ border-color:var(--ink); background:var(--bg); box-shadow:0 2px 10px rgba(0,0,0,.06); }
.pmod.on .pmod-check{ background:var(--ink); border-color:var(--ink); color:var(--on-ink); }
/* 概率滑块 */
.tm-slider{ flex:1; display:flex; align-items:center; gap:12px; }
.tm-slider input[type="range"]{
  flex:1; min-width:0;
  -webkit-appearance:none; appearance:none;
  height:4px; border-radius:999px;
  background:var(--gray-3);
  outline:none;
}
.tm-slider input[type="range"]::-webkit-slider-thumb{
  -webkit-appearance:none;
  width:22px; height:22px; border-radius:50%;
  background:var(--card); border:1px solid var(--hairline);
  box-shadow:0 2px 8px rgba(0,0,0,.18);
  cursor:pointer;
}
.tm-slider input[type="range"]::-moz-range-thumb{
  width:20px; height:20px; border-radius:50%;
  background:var(--card); border:1px solid var(--hairline);
  box-shadow:0 2px 8px rgba(0,0,0,.18);
  cursor:pointer;
}
.tm-slider-val{
  flex:0 0 auto; min-width:46px; text-align:right;
  font-size:13px; color:var(--gray-1);
  font-variant-numeric:tabular-nums;
}
/* 页脚按钮区 */
.tm-foot{ padding:2px 18px 0; }
.tm-foot .save-btn{ margin-top:10px; height:48px; border-radius:22px; }
.tm-foot .del-persona-btn{ margin-top:10px; }
.tm-foot-note{
  margin:14px 2px 0;
  font-size:12px; color:var(--gray-2); line-height:1.7;
}
/* 美化板块里塞进来的「颜色 / 滑块」表单、气泡预览、背景库（从设置页搬来） */
.tm-block .tm-fields{ margin:10px 12px 0; }
.tm-block .tm-preview{ margin:12px 12px 0; background:var(--bg); }
.tm-block .bg-actions{ margin:12px 16px 0; }
.tm-block .bg-grid{ margin:12px 16px 0; }
.tm-block .bg-grid:not(:empty){ margin-bottom:14px; }
.tm-block .bg-empty{ margin:10px 16px 14px; }
.tm-block .tm-fields + .tm-btn-grid,
.tm-block .tm-preview + .tm-btn-grid{ margin-top:12px; }
/* 底部操作键：两列排版，避免一长串按钮 */
.tm-btn-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
  margin-top:12px;
}
.tm-mini-btn{
  height:46px;
  border:1px solid var(--hairline);
  border-radius:16px;
  background:var(--bg);
  color:var(--gray-1);
  font-family:inherit; font-size:14px; font-weight:500;
  cursor:pointer;
  transition:background .18s, color .18s, transform .18s var(--spring);
}
@media (hover: hover) and (pointer: fine){
.tm-mini-btn:hover{ background:rgba(var(--tint-rgb),.04); color:var(--ink); }
}

.tm-mini-btn:active{ transform:scale(.97); }
.tm-mini-btn.danger{
  color:var(--danger);
  border-color:rgba(255,59,48,.34);
  background:rgba(255,59,48,.06);
}
@media (hover: hover) and (pointer: fine){
.tm-mini-btn.danger:hover{ background:rgba(255,59,48,.12); color:var(--danger); }
}

.chat-av-row{ align-items:center; }
.chat-av-img{
  width:36px; height:36px; border-radius:50%;
  object-fit:cover; flex:0 0 auto; background:var(--fill);
}
.chat-av-acts{ display:flex; gap:6px; flex:0 0 auto; }
.chat-av-btn{
  border:none; background:var(--fill); color:var(--ink);
  font:inherit; font-size:12px; font-weight:560;
  height:28px; padding:0 10px; border-radius:999px; cursor:pointer;
}

/* ============ 记忆系统 ============ */
.mem-hero{
  display:flex; gap:9px;
  margin:0 18px 12px;
}
.mem-stat{
  flex:1;
  background:var(--fill);
  border-radius:18px;
  padding:12px 6px;
  text-align:center;
}
.mem-stat b{
  display:block;
  font-family:var(--font-num);
  font-size:20px; font-weight:600;
  line-height:1.2;
}
.mem-stat span{ font-size:11px; color:var(--gray-2); }
.mem-tabs{
  display:flex; gap:3px;
  margin:0 18px 10px;
  background:var(--fill);
  border-radius:15px;
  padding:3px;
  overflow-x:auto;
  scrollbar-width:none;
}
.mem-tabs::-webkit-scrollbar{ width:0; height:0; }
.mem-tab{
  flex:1 1 0; min-width:0;
  padding:9px 4px;
  border:none;
  border-radius:12px;
  background:transparent;
  color:var(--gray-1);
  font-family:inherit;
  font-size:12px; font-weight:500;
  line-height:1.3;
  white-space:nowrap;
  display:flex; align-items:center; justify-content:center; gap:4px;
  cursor:pointer;
  transition:background .18s, color .18s, transform .2s var(--spring);
}
.mem-tab-n{
  font-style:normal;
  font-family:var(--font-num), inherit;
  font-size:11px; font-weight:600;
  padding:1px 6px;
  border-radius:999px;
  background:rgba(var(--tint-rgb),.1);
  color:var(--gray-1);
  line-height:1.5;
}
.mem-tab.on .mem-tab-n{
  background:rgba(var(--tint-rgb),.14);
  color:var(--ink);
}
.mem-tab.on{
  background:var(--bg); color:var(--ink); font-weight:600;
  box-shadow:0 2px 6px rgba(0,0,0,.07);
}
.mem-tab:active{ transform:scale(.96); }
.mem-bar{
  display:flex; align-items:center; flex-wrap:wrap; gap:8px;
  padding:0 18px 2px;
}
.mem-bar .mem-count{
  flex:1 1 100%;
  font-size:12px; color:var(--gray-2); line-height:1.6;
  word-break:break-all;
}
.mem-btn{
  flex:0 0 auto;
  padding:8px 14px;
  border:none; border-radius:999px;
  background:var(--fill);
  color:var(--ink);
  font-family:inherit;
  font-size:12.5px; font-weight:500;
  line-height:1.4; white-space:nowrap;
  cursor:pointer;
  transition:background .18s, transform .2s var(--spring);
}
@media (hover: hover) and (pointer: fine){
.mem-btn:hover{ background:rgba(var(--tint-rgb),.06); }
}

.mem-btn:active{ transform:scale(.95); }
.mem-btn.primary{ background:var(--primary); font-weight:600; }
.mem-list{ padding:8px 18px 24px; display:flex; flex-direction:column; gap:12px; }
/* 记忆卡片：左侧色条 + 序号 + 标题 + 正文 + 关键词，底部元信息与操作 */
.mem-card{
  position:relative;
  --mc-a:#0B0B0F; --mc-b:#F2F2F7; --mc-c:#E5E5EA;
  background:linear-gradient(150deg, var(--mc-b) 0%, var(--card) 62%);
  border-radius:24px;
  padding:16px 18px 14px 20px;
  box-shadow:0 1px 0 var(--hairline), 0 0 0 1px var(--hairline), 0 10px 26px -18px rgba(var(--tint-rgb),.28);
  overflow:hidden;
  animation:memIn .42s var(--ease-out) both;
}
@keyframes memIn{ from{ opacity:0; transform:translateY(8px) scale(.98); } to{ opacity:1; transform:none; } }
.mem-card::before{
  content:''; position:absolute; left:0; top:14px; bottom:14px;
  width:4px; border-radius:0 4px 4px 0;
  background:var(--mc-a);
}
.mem-card.kind-big{ --mc-a:#FF9F0A; --mc-b:#FFF2D6; --mc-c:#FFE0B2; }
.mem-card.kind-view{ --mc-a:#5E5CE6; --mc-b:#E9E6FF; --mc-c:#D8D3FF; }
.mem-card.kind-normal{ --mc-a:#30B0C7; --mc-b:#E3F6FA; --mc-c:#C9EEF4; }
.mem-card.kind-digest{ --mc-a:#34C759; --mc-b:#E3F8EA; --mc-c:#C8F0D4; }
.mem-card.kind-mega{ --mc-a:#AF52DE; --mc-b:#F3E6FA; --mc-c:#E4D0F5; }
.mem-card.folded{ opacity:.72; }
.mem-fold-tog{
  margin-top:8px; border:0; background:transparent; color:var(--mc-a, #30B0C7);
  font-size:12px; padding:0; cursor:pointer;
}
html[data-theme="dark"] .mem-card{
  --mc-a:#C7C7CC; --mc-b:#2C2C2E; --mc-c:#3A3A3C;
  background:linear-gradient(150deg, var(--mc-b) 0%, var(--card) 70%);
}
html[data-theme="dark"] .mem-card.kind-big{ --mc-a:#FFB340; --mc-b:#3A2E1A; --mc-c:#4A3820; }
html[data-theme="dark"] .mem-card.kind-view{ --mc-a:#8B89F0; --mc-b:#2A2848; --mc-c:#35325A; }
html[data-theme="dark"] .mem-card.kind-normal{ --mc-a:#5AC8DA; --mc-b:#1E3338; --mc-c:#274248; }
html[data-theme="dark"] .mem-card.kind-digest{ --mc-a:#30D158; --mc-b:#1A3324; --mc-c:#234030; }
html[data-theme="dark"] .mem-card.kind-mega{ --mc-a:#BF5AF2; --mc-b:#2E1F3A; --mc-c:#3A2848; }
.mem-kind-tag{
  flex:0 0 auto;
  margin-top:3px;
  padding:2px 8px;
  border-radius:999px;
  background:var(--mc-a);
  color:#fff;
  font-size:10.5px;
  font-weight:600;
  line-height:1.4;
}
.mem-flash-note{
  margin:0 0 2px;
  padding:10px 12px;
  border-radius:14px;
  background:var(--fill);
  color:var(--gray-1);
  font-size:12.5px;
  line-height:1.55;
}
.mem-head{
  display:flex; align-items:flex-start; gap:10px;
}
.mem-no{
  flex:0 0 auto;
  min-width:26px; height:26px; padding:0 7px;
  border-radius:9px;
  background:var(--mc-a); color:#fff;
  font-family:var(--font-num);
  font-size:11.5px; font-weight:700;
  display:flex; align-items:center; justify-content:center;
  letter-spacing:.02em;
}
.mem-head b{
  flex:1;
  font-size:14.5px; font-weight:600;
  line-height:1.5;
  color:var(--ink);
  padding-top:2px;
}
.mem-tools{ display:flex; gap:2px; flex:0 0 auto; }
.mem-del, .mem-edit{
  width:28px; height:28px;
  border:none; border-radius:9px;
  background:transparent;
  color:var(--gray-3);
  cursor:pointer;
  display:flex; align-items:center; justify-content:center;
  transition:background .15s, color .15s, transform .18s var(--spring);
}
.mem-del svg, .mem-edit svg{
  width:15px; height:15px;
  fill:none; stroke:currentColor;
  stroke-width:2; stroke-linecap:round; stroke-linejoin:round;
}
@media (hover: hover) and (pointer: fine){
.mem-del:hover{ background:rgba(255,59,48,.1); color:var(--danger); }
}

@media (hover: hover) and (pointer: fine){
.mem-edit:hover{ background:rgba(var(--tint-rgb),.06); color:var(--ink); }
}

.mem-del:active, .mem-edit:active{ transform:scale(.9); }
.mem-text{
  font-size:13.2px; color:var(--gray-1);
  line-height:1.78;
  margin-top:9px;
  white-space:pre-wrap;
}
.mem-keys{
  display:flex; flex-wrap:wrap; gap:6px;
  margin-top:11px;
}
.mem-key{
  padding:4px 11px;
  border-radius:999px;
  background:var(--mc-c);
  font-size:11.5px; color:var(--ink);
}
.mem-key.main{ background:var(--mc-a); color:#fff; font-weight:600; }
.mem-meta{
  display:flex; flex-wrap:wrap; align-items:center; gap:5px 10px;
  font-size:11px; color:var(--gray-2);
  margin-top:12px; padding-top:10px;
  border-top:1px dashed rgba(11,11,15,.09);
}
.mem-meta span{ display:inline-flex; align-items:center; gap:3px; white-space:nowrap; }
.mem-meta .mem-src{
  margin-left:auto;
  padding:2px 8px; border-radius:999px;
  background:rgba(var(--tint-rgb),.05); color:var(--gray-1); font-weight:500;
}
/* 生成中的角标 */
.busy-pill{
  display:inline-flex; align-items:center; gap:6px;
  padding:5px 11px; border-radius:999px;
  background:var(--fill); font-size:11.5px; color:var(--gray-1);
}
.busy-pill i{
  width:6px; height:6px; border-radius:50%; background:var(--ink);
  animation:busyDot 1s infinite alternate;
}
@keyframes busyDot{ from{ opacity:.2; } to{ opacity:1; } }
.mem-empty{
  padding:46px 24px;
  text-align:center;
  font-size:13px; color:var(--gray-2);
  line-height:1.8;
}
/* ============ 功能页：氛围桌面 + 分组 bento（勿给 .view 根设 display） ============ */
/* 功能目录：统一的双列入口，灰阶图标与清晰分组。 */
.tools-view{position:relative;overflow:hidden;background:var(--bg);}
.tools-scroll{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:calc(var(--head-top) + 24px) 20px 28px;display:flex;flex-direction:column;gap:28px;scrollbar-width:none;}
.tools-scroll::-webkit-scrollbar{width:0;}
.tools-hero{padding:0 2px 4px;}
.tools-kicker{margin:0 0 13px;font:500 10px/1.4 var(--font-num);letter-spacing:.2em;color:var(--gray-2);}
.tools-title{display:flex;align-items:center;justify-content:space-between;margin:0;font-size:30px;font-weight:650;line-height:1.25;letter-spacing:-.04em;color:var(--ink);}
.tools-title-mark{display:grid;place-items:center;width:34px;height:34px;border:1px solid var(--hairline);border-radius:50%;font-size:22px;font-weight:400;color:var(--gray-2);}
.tools-lead{margin:10px 0 0;font-size:12px;line-height:1.6;color:var(--gray-1);}
.tools-group{min-width:0;}
.tools-label{display:flex;align-items:center;justify-content:space-between;margin:0 2px 12px;font-size:12px;font-weight:600;line-height:1.5;letter-spacing:.06em;color:var(--gray-1);}
.tools-group-num{font:400 10px/1.5 var(--font-num);letter-spacing:.1em;color:var(--gray-3);}
.tools-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;}
.tools-view .tool-card{display:grid;grid-template-columns:32px minmax(0,1fr);grid-template-rows:auto auto;column-gap:10px;row-gap:3px;align-content:center;align-items:center;position:relative;min-width:0;min-height:82px;padding:15px 12px;border:1px solid var(--hairline);border-radius:17px;background:var(--card);box-shadow:0 3px 12px rgba(var(--tint-rgb),.025);color:var(--ink);font:inherit;text-align:left;cursor:pointer;transition:background .16s ease,transform .16s ease,border-color .16s ease;-webkit-tap-highlight-color:transparent;}
.tools-view .tool-icon{grid-column:1;grid-row:1 / 3;display:grid;place-items:center;width:32px;height:36px;border-radius:11px;background:var(--tool-icon-bg,#f2f2f2);color:var(--tool-icon-ink,#6f6f6f);}
.tools-view .tool-icon svg{width:19px;height:19px;fill:none;stroke:currentColor;stroke-width:1.65;stroke-linecap:round;stroke-linejoin:round;}
.tools-view .tool-name{grid-column:2;grid-row:1;display:block;min-width:0;font-size:14px;font-weight:600;line-height:1.5;letter-spacing:0;}
.tools-view .tool-desc{grid-column:2;grid-row:2;display:block;min-width:0;margin:0;font-size:10px;font-weight:400;line-height:1.65;color:var(--gray-1);overflow-wrap:anywhere;}
.tools-view .tool-card:active{transform:scale(.975);background:var(--fill);}
.tools-view .tool-card:focus-visible{outline:2px solid var(--ink);outline-offset:3px;}
@media (hover:hover) and (pointer:fine){.tools-view .tool-card:hover{background:var(--fill);border-color:rgba(var(--tint-rgb),.15);}}
.tools-view .music,.tools-view .couple,.tools-view .idol{--tool-icon-bg:#f0f0f0;--tool-icon-ink:#7e7e7e;}
.tools-view .icity,.tools-view .phone,.tools-view .health{--tool-icon-bg:#f1f1f1;--tool-icon-ink:#7e7e7e;}
.tools-view .charcard,.tools-view .theater,.tools-view .tarot{--tool-icon-bg:#efefef;--tool-icon-ink:#797979;}
.tools-view .novel,.tools-view .reader,.tools-view .pickup{--tool-icon-bg:#f1f1f1;--tool-icon-ink:#818181;}
.tools-view .store,.tools-view .shop,.tools-view .takeout{--tool-icon-bg:#f1f1f1;--tool-icon-ink:#8c8c8c;}
.tools-view .mcp{--tool-icon-bg:#f1f1f1;--tool-icon-ink:#828282;}
html[data-theme="dark"] .tools-view .tool-icon{background:rgba(255,255,255,.065);color:#bbbbbb;}
html[data-theme="dark"] .tools-view .music .tool-icon,html[data-theme="dark"] .tools-view .couple .tool-icon,html[data-theme="dark"] .tools-view .idol .tool-icon{color:#b9b9b9;}
html[data-theme="dark"] .tools-view .icity .tool-icon,html[data-theme="dark"] .tools-view .phone .tool-icon,html[data-theme="dark"] .tools-view .health .tool-icon{color:#c2c2c2;}
@media(max-width:350px){.tools-scroll{padding-left:14px;padding-right:14px;}.tools-grid{gap:8px;}.tools-view .tool-card{column-gap:8px;padding:13px 10px;grid-template-columns:28px minmax(0,1fr);}.tools-view .tool-icon{width:28px;height:34px;}.tools-view .tool-name{font-size:13px;}}
@media(prefers-reduced-motion:reduce){.tools-view .tool-card{transition:none;}}

/* 功能页视觉层次：纸面、唱片和双心，使用本地 CSS/SVG 绘制。 */
.tools-view{--tools-paper:#f7f7f7;--tools-card:#ffffff;--tools-accent:#292929;--tools-rule:#dddddd;background:var(--tools-paper);}
.tools-scroll{gap:25px;padding-top:calc(var(--head-top) + 23px);}
.tools-hero{padding:0 2px;}
.tools-eyebrow{display:flex;align-items:center;justify-content:space-between;}
.tools-kicker{margin:0;font-size:9px;letter-spacing:.18em;color:var(--gray-1);}
.tools-edition{font-size:18px;color:var(--tools-accent);}
.tools-heading{display:flex;align-items:baseline;justify-content:space-between;gap:12px;margin-top:15px;}
.tools-title{display:block;font-size:31px;font-weight:600;letter-spacing:.03em;}
.tools-wordmark{font-family:Georgia,"Times New Roman",serif;font-size:42px;font-style:italic;font-weight:400;letter-spacing:-.065em;line-height:1;color:var(--tools-accent);}
.tools-lead{margin-top:9px;font-size:11px;letter-spacing:.025em;}
.tools-hero-rule{display:flex;align-items:center;gap:5px;margin-top:21px;}
.tools-hero-rule span{display:block;height:1px;flex:1;background:var(--tools-rule);}
.tools-hero-rule i{width:5px;height:5px;border:1px solid var(--tools-accent);border-radius:50%;}
.tools-featured{display:grid;grid-template-columns:1.08fr 1fr;gap:10px;}
.tools-view .tool-feature{display:block;position:relative;min-height:184px;overflow:hidden;padding:17px;border:0;border-radius:19px;box-shadow:none;}
.tools-view .feature-music{background:#484848;color:#fafafa;}
.tools-view .feature-couple{background:#eaeaea;color:#414141;}
.tool-feature-tag{position:absolute;top:17px;left:17px;z-index:2;font-size:10px;letter-spacing:.06em;opacity:.75;}
.tool-feature-copy{position:absolute;z-index:2;left:17px;right:15px;bottom:19px;}
.tools-view .tool-feature .tool-name{font-size:18px;font-weight:500;line-height:1.4;}
.tools-view .tool-feature .tool-desc{margin-top:5px;color:inherit;font-size:10px;line-height:1.7;opacity:.72;max-width:calc(100% - 12px);}
.tool-feature-arrow{position:absolute;z-index:3;right:15px;top:14px;font-size:18px;font-weight:400;opacity:.7;}
.tool-vinyl{position:absolute;display:grid;place-items:center;width:106px;height:106px;right:-13px;top:32px;border-radius:50%;background:repeating-radial-gradient(circle at center,#292929 0px,#292929 3px,#424242 4px,#292929 5px);border:1px solid #676767;transform:rotate(-18deg);box-shadow:0 7px 18px #29292933;}
.tool-vinyl:before{content:"";position:absolute;inset:9px;border-radius:50%;border:1px solid #ffffff13;}
.tool-vinyl i{display:block;position:relative;width:37px;height:37px;border-radius:50%;background:#d6d6d6;border:5px solid #dfdfdf;}
.tool-vinyl i:after{content:"";position:absolute;left:50%;top:50%;width:5px;height:5px;border-radius:50%;transform:translate(-50%,-50%);background:#484848;}
.tool-love-art{position:absolute;width:116px;height:79px;right:12px;top:34px;fill:none;stroke:#9a9a9a;stroke-width:1.1;transform:rotate(-9deg);}
.tool-love-art path:nth-child(2){stroke:#727272;}
.tool-love-art .tool-love-spark{stroke:#9f9f9f;}
.tools-label{color:var(--ink);font-size:12px;font-weight:500;letter-spacing:.08em;gap:13px;}
.tools-label:after{content:"";height:1px;flex:1;background:var(--tools-rule);order:1;}
.tools-group-num{order:2;color:var(--gray-2);font-style:italic;}
.tools-view .tool-card:not(.tool-feature){background:var(--tools-card);border-color:var(--tools-rule);border-radius:15px;min-height:79px;box-shadow:none;}
.tools-view .tool-card:not(.tool-feature) .tool-icon{background:transparent;width:32px;height:36px;border-right:1px solid var(--tools-rule);border-radius:0;padding-right:7px;box-sizing:content-box;}
.tools-view .tool-card:not(.tool-feature){grid-template-columns:39px minmax(0,1fr);column-gap:8px;}
.tools-view .tool-card:not(.tool-feature) .tool-name{font-size:13px;font-weight:500;}
.tools-view .tool-card:not(.tool-feature) .tool-desc{font-size:10px;}
.tools-view .tool-feature:active{transform:scale(.975);}
@media(hover:hover) and (pointer:fine){.tools-view .feature-music:hover{background:#3d3d3d;}.tools-view .feature-couple:hover{background:#dddddd;}.tools-view .tool-card:not(.tool-feature):hover{background:var(--fill);}}
html[data-theme="dark"] .tools-view{--tools-paper:#151515;--tools-card:#222222;--tools-accent:#d6d6d6;--tools-rule:#393939;}
html[data-theme="dark"] .tools-view .feature-music{background:#414141;color:#efefef;}
html[data-theme="dark"] .tools-view .feature-couple{background:#3f3f3f;color:#ececec;}
html[data-theme="dark"] .tool-love-art{stroke:#b3b3b3;}
html[data-theme="dark"] .tool-love-art path:nth-child(2){stroke:#c5c5c5;}
@media(max-width:350px){.tools-view .tool-feature{min-height:180px;padding:14px;}.tool-feature-copy{left:14px;right:12px;}.tools-view .tool-card:not(.tool-feature){grid-template-columns:32px minmax(0,1fr);column-gap:8px;}.tools-view .tool-card:not(.tool-feature) .tool-icon{width:25px;}.tools-wordmark{font-size:36px;}.tool-love-art{width:98px;right:3px;}}

/* 角色卡生成：整页内嵌网页 */
.charcard-body{
  flex:1; min-height:0; display:flex; flex-direction:column;
  overflow:hidden; overscroll-behavior:none;
}
.charcard-frame{
  flex:1; min-height:0; width:100%;
  border:none; background:var(--card);
  /* 避免 iframe 获焦时把外层页面滚飞 */
  overflow:auto; overscroll-behavior:contain;
  touch-action:pan-x pan-y;
}
.charcard-note{
  margin:0; padding:6px 16px calc(6px + env(safe-area-inset-bottom));
  font-size:11px; color:var(--gray-2); text-align:center;
}
.tool-sub-body{
  flex:1; display:flex; flex-direction:column;
  align-items:center; justify-content:center; gap:14px;
  padding:0 40px 60px; text-align:center;
}
.tool-sub-body .ph-icon{ width:84px; height:84px; border-radius:30px; }
.tool-sub-body .ph-icon svg{ width:36px; height:36px; }
.tool-sub-body h2{ margin:0; font-size:19px; font-weight:700; }
.tool-sub-body p{ margin:0; font-size:13.5px; color:var(--gray-1); line-height:1.75; }

/* Memory archive: monochrome paper, scoped to memory surfaces. */
#tmPaneMemory>.tm-block{background:transparent;border-bottom:1px solid var(--hairline);border-radius:0;margin:0 18px 12px;}
#tmPaneMemory>.tm-block .tm-note{color:var(--gray-1);}
#tmPaneMemory .mem-hero{gap:0;background:var(--fill);border-radius:20px;margin-bottom:18px;}
#tmPaneMemory .mem-stat{background:transparent;border-radius:0;}
#tmPaneMemory .mem-stat+.mem-stat{border-left:1px solid var(--hairline);}
.mem-hall-entry{display:block;width:calc(100% - 36px);margin:0 18px 22px;text-align:left;border:1px solid var(--ink);border-radius:22px;padding:22px;background:var(--ink);color:var(--on-ink);}
.mem-hall-entry>b{display:flex;justify-content:space-between;margin:14px 0 10px;font-size:25px;letter-spacing:2px;}
.mem-hall-entry p{font-size:12px;line-height:1.7;margin:0 0 12px;overflow-wrap:anywhere;opacity:.85;}
.mem-hall-entry small{font-size:11px;opacity:.65;}
.mh-kicker{font-size:10px;letter-spacing:2px;opacity:.65;}
.mem-advanced{margin:0 18px 16px;}
.mem-advanced>summary,.mem-explain>summary{font-size:12px;color:var(--gray-1);padding:14px 16px;cursor:pointer;}
.mem-advanced .tm-block{margin:0;background:var(--fill);}
.mh-view{display:flex;flex-direction:column;overflow:hidden;}
.mh-identity{margin:0 22px 15px;font-size:12px;color:var(--gray-1);overflow-wrap:anywhere;}
.mh-nav{display:flex;margin:0 20px;gap:6px;border-bottom:1px solid var(--hairline);}
.mh-view button,.mh-editor button{appearance:none;border:0;font-family:inherit;cursor:pointer;}
.mh-nav button{flex:1;background:transparent;padding:12px 4px;color:var(--gray-1);border:0;border-bottom:2px solid transparent;border-radius:0;font-size:13px;}
.mh-nav button.on{color:var(--ink);border-color:var(--ink);}
.mh-toolbar{display:flex;gap:8px;margin:15px 20px;}
.mh-toolbar button,.mh-actions button,.mh-wide{background:var(--fill);color:var(--ink);padding:10px 14px;border-radius:12px;font-size:12px;min-height:40px;}
.mh-toolbar button:last-child{background:var(--ink);color:var(--on-ink);}
.mh-searchbar{display:flex;gap:8px;margin:0 20px 12px;}
.mh-searchbar[hidden],#mhLegacy[hidden]{display:none!important;}
.mh-searchbar input{min-width:0;flex:1;}
.mh-searchbar select{width:95px;}
.mh-view input,.mh-view select,.mh-editor input:not([type=checkbox]),.mh-editor textarea,.mh-editor select{border:1px solid var(--hairline);border-radius:12px;padding:10px;background:var(--fill);color:var(--ink);font:inherit;font-size:16px;box-sizing:border-box;max-width:100%;}
.mh-scroll{flex:1;min-height:0;overflow:auto;padding:8px 20px calc(25px + var(--sab));}
#mhBody h2{font-size:27px;letter-spacing:1px;margin:12px 0;}
.mh-lead{font-size:12px;color:var(--gray-1);line-height:1.8;overflow-wrap:anywhere;}
.mh-metrics{display:grid;grid-template-columns:repeat(3,1fr);margin:22px 0;gap:8px;}
.mh-metrics>div{padding:16px 4px;background:var(--fill);border-radius:15px;text-align:center;}
.mh-metrics b{display:block;font-size:24px;margin-bottom:8px;}.mh-metrics span{font-size:11px;color:var(--gray-1);}
.mh-section{border-top:1px solid var(--hairline);padding-top:18px;margin:22px 0;}
.mh-section h3{font-size:15px;margin:0 0 12px;}
.mh-section-head{display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap;}.mh-section-head span{font-size:10px;color:var(--gray-1);}
.mh-card{border:1px solid var(--hairline);border-radius:17px;padding:17px;margin:12px 0;background:var(--card);}
.mh-meta{font-size:10px;color:var(--gray-1);line-height:1.7;overflow-wrap:anywhere;}.mh-card h3{font-size:15px;line-height:1.6;margin:8px 0;}.mh-card p{font-size:13px;line-height:1.9;white-space:pre-wrap;overflow-wrap:anywhere;max-height:230px;overflow:auto;margin:6px 0 12px;}
.mh-tags{display:flex;flex-wrap:wrap;gap:5px;}.mh-tags span{font-size:10px;padding:4px 8px;border-radius:7px;background:var(--fill);color:var(--gray-1);}
.mh-actions{display:flex;flex-wrap:wrap;gap:6px;margin-top:14px;}.mh-actions button{flex:1;padding:8px;}
.mh-empty{color:var(--gray-1);font-size:12px;line-height:1.9;padding:24px 10px;text-align:center;}
.mh-trace{border-bottom:1px solid var(--hairline);padding:10px 0;font-size:12px;}.mh-trace summary{cursor:pointer;line-height:1.8;}.mh-trace pre{white-space:pre-wrap;overflow-wrap:anywhere;font:inherit;line-height:1.8;color:var(--gray-1);}
.mh-network{width:100%;background:var(--fill);border-radius:18px;margin-top:10px;}.mh-network line{stroke:var(--gray-3);stroke-width:1;}.mh-network circle{fill:var(--card);stroke:var(--hairline);}.mh-network text{font-size:10px;fill:var(--ink);pointer-events:none;}.mh-network .center{fill:var(--primary);}.mh-network g{cursor:pointer;}
#mhNode{width:100%;}#mhLegacy{margin:20px 0;}#mhLegacy>summary{font-size:12px;color:var(--gray-1);padding:12px 0;cursor:pointer;}#mhLegacy .tm-block{margin:12px 0;}#mhLegacy .mem-list{padding:0;}#mhLegacy .mem-card{background:var(--fill);border:1px solid var(--hairline);box-shadow:none;color:var(--ink);}#mhLegacy .mem-card::before{display:none;}#mhLegacy .mem-card .mem-key{background:var(--card);color:var(--ink);}#mhLegacy .mem-card .mem-meta{color:var(--gray-1);}
#mhEditBackdrop .mh-editor{padding:22px;width:min(420px,calc(100vw - 28px));max-height:85dvh;overflow:auto;box-sizing:border-box;background:var(--card);border-radius:22px;}
.mh-editor h3{margin:0 0 12px;}.mh-editor label{display:block;font-size:12px;line-height:1.8;margin:12px 0 6px;}.mh-editor input:not([type=checkbox]),.mh-editor textarea,.mh-editor select{width:100%;}.mh-editor textarea{resize:vertical;}.mh-editor-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px;}.mh-editor .mh-check{display:flex;gap:9px;align-items:center;}.mh-editor .mh-check input{width:17px;height:17px;}.mh-editor .mh-actions button:last-child{background:var(--ink);color:var(--on-ink);}

.mh-card{border:0;border-radius:0;padding:18px 0 20px;border-bottom:1px solid var(--hairline);background:transparent;margin:0;}
.mh-card-top{display:flex;align-items:center;gap:7px;flex-wrap:wrap;}
.mh-category{font-size:10px;letter-spacing:.5px;color:var(--ink);font-weight:600;}
.mh-state{font-size:9px;color:var(--gray-1);border:1px solid var(--hairline);border-radius:5px;padding:2px 5px;}
#mhBody .mh-card h3{font-size:17px;font-weight:600;line-height:1.6;margin:10px 0 4px;}
.mh-card .mh-meta{font-size:10px;line-height:1.8;}.mh-card .mh-text{font-size:13px;line-height:1.9;margin:12px 0;max-height:none;overflow:visible;}
.mh-card .mh-subjective{font-size:10px;color:var(--gray-1);line-height:1.8;margin:8px 0;border-left:2px solid var(--hairline);padding-left:9px;}
.mh-clue-details{font-size:11px;color:var(--gray-1);margin-top:13px;}.mh-clue-details summary{cursor:pointer;line-height:1.8;}.mh-clue-details p{max-height:none;}
.mh-facts{font-size:11px;line-height:1.8;}.mh-facts>div{display:grid;grid-template-columns:64px minmax(0,1fr);gap:8px;margin:7px 0;}.mh-facts dt{color:var(--gray-1);}.mh-facts dd{margin:0;color:var(--ink);overflow-wrap:anywhere;}
.mh-revision{border-left:1px solid var(--hairline);padding:10px 0 4px 12px;margin-top:10px;}.mh-revision small{font-size:10px;}.mh-revision p{font-size:12px;}
.mh-actions{gap:5px;}.mh-actions button{font-size:10px;border-radius:8px;min-height:36px;}.mh-actions button:first-child{flex:1.4;}
.mh-link{background:transparent;color:var(--gray-1);font-size:10px;padding:8px 0;}
.mh-timeline{border-left:1px solid var(--hairline);padding-left:18px;margin-left:3px;}.mh-timeline .mh-card{position:relative;}.mh-timeline .mh-card:before{content:'';position:absolute;left:-22px;top:23px;width:6px;height:6px;background:var(--ink);border:2px solid var(--card);border-radius:50%;}
.mh-retrieval{padding:15px 0;margin:20px 0;border-top:1px solid var(--hairline);font-size:12px;line-height:1.8;}.mh-retrieval>summary{cursor:pointer;}
.mh-review{border:1px solid var(--hairline);border-radius:15px;padding:16px;margin:12px 0;background:var(--fill);}.mh-review>p{font-size:12px;line-height:1.9;overflow-wrap:anywhere;}
.mh-searchbar{flex-direction:column;gap:7px;}.mh-searchbar input{width:100%;}.mh-searchbar select{width:100%;font-size:12px;}
.mh-edit-clues{margin-top:15px;padding:13px;background:var(--fill);border-radius:12px;font-size:12px;}.mh-edit-clues>summary{cursor:pointer;line-height:1.8;}
.mh-network .center{fill:var(--ink);}.mh-network .center+text{fill:var(--on-ink);}
@media(min-width:650px){.mh-scroll{max-width:650px;width:100%;box-sizing:border-box;margin:auto;}.mh-collections{grid-template-columns:repeat(4,1fr);}.mh-searchbar{flex-direction:row;}.mh-searchbar select{width:150px;}.mh-hero-index{right:12px;}}

/* 列表优先：搜索、分类、卡片正文；辅助信息在详情内。 */
.mh-identity{margin:0 20px 10px;}.mh-nav{margin-bottom:12px;}.mh-nav button{padding:10px 4px;}
.mh-searchbar{display:flex;flex-direction:column;margin:0 16px;gap:10px;}.mh-searchbar select[hidden]{display:none!important;}
.mh-searchbar input{width:100%;font-size:16px;background:var(--fill);padding:12px 14px;border:0;}
.mh-filter-chips{display:flex;gap:5px;}.mh-filter-chips button{flex:1;min-width:0;padding:9px 4px;background:transparent;color:var(--gray-1);font-size:12px;border-radius:9px;white-space:nowrap;min-height:38px;}.mh-filter-chips button.on{background:var(--ink);color:var(--on-ink);}
.mh-toolbar{margin:10px 16px 8px;gap:8px;justify-content:flex-end;}.mh-toolbar button{font-size:11px;min-height:36px;padding:9px 12px;border-radius:9px;}
.mh-scroll{padding:6px 16px calc(24px + var(--sab));background:var(--fill);}
.mh-list-heading{display:flex;justify-content:space-between;gap:10px;font-size:10px;color:var(--gray-1);padding:12px 2px;}
.mh-card{margin:0 0 12px;padding:16px;border:1px solid var(--hairline);border-radius:15px;background:var(--card);box-sizing:border-box;}
.mh-card-top{display:flex;gap:6px;align-items:center;}.mh-card-top time{font-size:10px;color:var(--gray-1);margin-left:auto;white-space:nowrap;}
.mh-category{font-size:10px;font-weight:600;background:var(--fill);border-radius:5px;padding:4px 7px;letter-spacing:0;}
#mhBody .mh-card h3{font-size:16px;line-height:1.6;margin:12px 0 7px;}
.mh-card .mh-text{font-size:13px;line-height:1.8;margin:0 0 9px;max-height:none;overflow:visible;}
.mh-card .mh-subjective,.mh-context{font-size:10px;line-height:1.7;color:var(--gray-1);border:0;padding:0;margin:4px 0 8px;overflow-wrap:anywhere;}
.mh-tags{gap:8px;margin:9px 0 12px;}.mh-tags span{font-size:10px;padding:0;background:transparent;color:var(--gray-1);}.mh-tags span:before{content:'#';opacity:.7;margin-right:2px;}
.mh-card-bottom{position:relative;border-top:1px solid var(--hairline);padding-top:10px;display:flex;justify-content:space-between;gap:8px;align-items:flex-start;flex-wrap:wrap;}
.mh-card-bottom>.mh-actions{margin:0;gap:6px;}.mh-card-bottom>.mh-actions button{flex:none;min-width:52px;font-size:11px;min-height:34px;padding:6px 10px;background:var(--fill);}
.mh-card-bottom>.mh-clue-details{margin:0;display:contents;}.mh-card-bottom>.mh-clue-details>summary{font-size:11px;cursor:pointer;min-height:34px;line-height:34px;color:var(--gray-1);margin-left:auto;list-style:none;}.mh-card-bottom>.mh-clue-details>summary:after{content:' ▾';}.mh-card-bottom>.mh-clue-details[open]>summary:after{content:' ▴';}
.mh-detail-panel{flex-basis:100%;width:100%;border-top:1px dashed var(--hairline);padding-top:10px;margin-top:2px;}.mh-detail-panel .mh-actions{margin-top:14px;}.mh-history{font-size:11px;line-height:1.8;margin-top:12px;}
.mh-fulltext{font-size:11px;line-height:1.8;color:var(--gray-1);margin-bottom:10px;}.mh-fulltext summary{cursor:pointer;}.mh-fulltext p{font-size:13px;color:var(--ink);max-height:none;}
.mh-pending-link{display:flex;width:100%;justify-content:space-between;align-items:center;font-size:11px;line-height:1.7;padding:12px 14px;margin-bottom:12px;border-radius:10px;background:var(--card);color:var(--ink);}
#mhLegacy{margin:18px 0;}#mhLegacy>summary{font-size:11px;}
@media(min-width:650px){.mh-scroll{max-width:none;}.mh-scroll>#mhBody,.mh-scroll>#mhLegacy{max-width:640px;margin-left:auto;margin-right:auto;}.mh-searchbar,.mh-toolbar{max-width:640px;width:calc(100% - 32px);margin-left:auto;margin-right:auto;}.mh-searchbar{flex-direction:column;}}

/* 当前记忆归属：双人名牌，保持紧凑。 */
.mh-identity{display:flex;align-items:center;gap:10px;margin:0 16px 12px;padding:11px 14px;border:1px solid var(--hairline);border-radius:12px;background:var(--card);color:var(--ink);box-sizing:border-box;}
.mh-person{flex:1;min-width:0;text-align:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:14px;font-weight:600;line-height:1.5;letter-spacing:.3px;}
.mh-pair-mark{display:flex;align-items:center;justify-content:center;gap:8px;flex:none;width:70px;color:var(--gray-1);}
.mh-pair-mark i{display:block;width:18px;height:1px;background:var(--hairline);}
.mh-pair-mark svg{display:block;width:15px;height:15px;fill:none;stroke:currentColor;stroke-width:1.5;stroke-linejoin:round;}
@media(min-width:650px){.mh-identity{max-width:640px;width:calc(100% - 32px);margin-left:auto;margin-right:auto;}}

/* Group chat: compact member entry, mention chooser and member sheet. */
.group-summary{display:flex;align-items:center;gap:10px;flex:0 0 auto;border:0;border-bottom:1px solid var(--hairline);background:var(--bg);color:var(--gray-1);padding:7px 18px;font:inherit;font-size:10px;text-align:left;cursor:pointer;min-height:40px;}
.group-summary[hidden],.group-mention-list[hidden]{display:none!important;}
#groupSummaryAvatars{display:flex;flex:0 0 auto;padding-left:5px;}#groupSummaryAvatars img{width:23px;height:23px;object-fit:cover;border-radius:8px;border:2px solid var(--bg);margin-left:-5px;box-sizing:border-box;}#groupSummaryText{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
#talkInputRow{position:relative;}.group-mention-list{position:absolute;bottom:calc(100% + 7px);left:0;right:0;background:var(--bg);border:1px solid var(--hairline);border-radius:13px;max-height:190px;overflow:auto;z-index:20;box-shadow:0 8px 24px #0002;}
.group-mention-list button{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;padding:11px 14px;border:0;background:transparent;color:var(--ink);font:inherit;font-size:12px;text-align:left;min-height:40px;}.group-mention-list button small{font-size:9px;color:var(--gray-2);}.group-mention-list button.on{background:var(--fill);}.group-mention-list button:disabled{opacity:.45;}.group-mention-empty{padding:13px;font-size:11px;color:var(--gray-2);}
.group-sheet-mask{position:fixed;inset:0;z-index:11000;background:#0006;display:none;align-items:flex-end;justify-content:center;}.group-sheet-mask.show{display:flex;}.group-sheet{width:min(560px,100%);max-height:85dvh;background:var(--bg);color:var(--ink);border-radius:22px 22px 0 0;display:flex;flex-direction:column;overflow:hidden;padding-bottom:env(safe-area-inset-bottom,0px);}
.group-sheet-head{display:flex;align-items:center;gap:12px;padding:20px 20px 15px;border-bottom:1px solid var(--hairline);}.group-sheet-head>div{flex:1;min-width:0;}.group-sheet-head b{display:block;font-size:18px;overflow-wrap:anywhere;}.group-sheet-head small{display:block;font-size:10px;color:var(--gray-2);margin-top:5px;}.group-sheet button{font:inherit;font-size:11px;min-height:36px;border:1px solid var(--hairline);border-radius:9px;background:transparent;color:var(--ink);padding:7px 11px;cursor:pointer;}
.group-sheet-body{overflow:auto;padding:17px 20px 22px;min-height:0;}.group-pace-title{display:flex;justify-content:space-between;font-size:11px;margin-bottom:10px;}.group-pace-title small{font-size:9px;color:var(--gray-2);}.group-pace{display:grid;grid-template-columns:repeat(3,1fr);gap:7px;}.group-pace button.on{background:var(--ink);color:var(--bg);}.group-pace-note{font-size:10px;line-height:1.8;color:var(--gray-2);margin:9px 0 20px;}
.group-member{border-top:1px solid var(--hairline);padding:12px 0;}.group-member summary{list-style:none;display:flex;align-items:center;gap:11px;cursor:pointer;}.group-member summary::-webkit-details-marker{display:none;}.group-member img{width:39px;height:39px;border-radius:12px;object-fit:cover;}.group-member summary>span{flex:1;min-width:0;}.group-member b{display:block;font-size:13px;overflow-wrap:anywhere;}.group-member small{display:block;color:var(--gray-2);font-size:9px;margin-top:4px;}.group-member summary>i{font-style:normal;color:var(--gray-2);font-size:12px;}.group-member p{font-size:11px;line-height:1.8;white-space:pre-wrap;overflow-wrap:anywhere;color:var(--gray-1);margin:12px 0;}.group-member-actions{display:flex;gap:8px;flex-wrap:wrap;}.group-sheet button:focus-visible,.group-member summary:focus-visible{outline:2px solid var(--gray-2);outline-offset:2px;}

.group-announcement{flex-shrink:0;margin:0 14px 8px;border-radius:14px;background:var(--fill);color:var(--ink);overflow:hidden;}
.group-announcement[hidden],#groupAnnouncementBody[hidden],#groupAnnouncementEdit[hidden]{display:none!important;}
.group-announcement-toggle{display:flex;align-items:center;gap:10px;width:100%;padding:11px 13px;border:0;background:transparent;color:inherit;text-align:left;}
.group-announcement-toggle b{font-size:12px;white-space:nowrap;}.group-announcement-toggle span{min-width:0;flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px;color:var(--gray-2);}.group-announcement-toggle i{font-style:normal;}
#groupAnnouncementBody{padding:0 13px 12px;}#groupAnnouncementText{margin:0;padding:8px 0 12px;border-top:1px solid var(--hairline);font-size:13px;line-height:1.7;white-space:pre-wrap;overflow-wrap:anywhere;max-height:22vh;overflow-y:auto;}
.group-announcement-foot{display:flex;align-items:center;justify-content:space-between;gap:8px;}.group-announcement-foot small{font-size:10px;color:var(--gray-2);}.group-announcement-foot button{border:0;background:var(--card);color:var(--ink);border-radius:9px;padding:7px 10px;font-size:11px;}
.center-card.group-announcement-editor{max-width:380px;padding:22px;text-align:left;}.group-announcement-editor>b{font-size:18px;}.group-announcement-editor>p{font-size:12px;line-height:1.6;color:var(--gray-2);}.group-announcement-editor textarea{box-sizing:border-box;width:100%;height:180px;resize:vertical;border:1px solid var(--hairline);border-radius:12px;background:var(--fill);color:var(--ink);padding:12px;font:inherit;font-size:14px;line-height:1.6;}.group-announcement-editor>small{display:block;margin:8px 0 18px;font-size:10px;color:var(--gray-2);}.group-announcement-editor>div{display:flex;gap:10px;}.group-announcement-editor button{flex:1;padding:11px;border:0;border-radius:12px;background:var(--fill);color:var(--ink);font:inherit;font-size:13px;}#groupAnnouncementSave{background:var(--ink);color:var(--on-ink);}

/* 线上聊天设置：减少常驻说明，完整解释按需展开。 */
[data-view="talk-manage"] .tm-explain{padding:5px 16px 8px;color:var(--gray-2);}
[data-view="talk-manage"] .tm-explain summary{display:inline-flex;align-items:center;gap:5px;cursor:pointer;font-size:10px;line-height:1.5;list-style:none;border-bottom:1px dashed var(--gray-3);}
[data-view="talk-manage"] .tm-explain summary::-webkit-details-marker{display:none;}
[data-view="talk-manage"] .tm-explain summary::after{content:'＋';font-size:11px;}
[data-view="talk-manage"] .tm-explain[open] summary::after{content:'−';}
[data-view="talk-manage"] .tm-explain .tm-note{padding:7px 0 0;margin:0;font-size:11px;line-height:1.75;}
[data-view="talk-manage"] .tm-note{font-size:11px;line-height:1.6;margin:7px 0 9px;}
[data-view="talk-manage"] .tm-key>span{font-size:11px;line-height:1.45;margin-top:4px;}
[data-view="talk-manage"] .tm-row{padding-top:12px;padding-bottom:12px;}
[data-view="talk-manage"] .tm-block-head{padding-top:17px;padding-bottom:4px;}

.mh-card-bottom>.mh-actions .mh-confirm{background:var(--ink);color:var(--on-ink);min-width:80px;font-weight:600;}

/* Independent groups keep field-list outlines and action grids from touching. */
.tm-chat-appearance .tm-fields{margin:12px 16px 16px;}
.tm-chat-appearance .tm-preset-section{margin:0 16px 16px;padding:12px;border:1px solid var(--hairline);border-radius:16px;background:var(--bg);}
.tm-chat-appearance .tm-preset-section>.field{padding:0;gap:10px;background:transparent;flex-wrap:wrap;}
.tm-chat-appearance .tm-preset-section label{width:auto;flex:0 0 auto;}
.tm-chat-appearance .tm-preset-section select{flex:1;min-width:120px;max-width:100%;}
.tm-chat-appearance .tm-preset-section .tm-btn-grid{margin-top:12px;}
.tm-chat-appearance .tm-appearance-actions{margin:0 16px 16px;}
.tm-chat-appearance .tm-mini-btn{height:auto;min-height:44px;padding:10px 8px;font-size:12px;line-height:1.45;white-space:normal;}
.tm-chat-appearance .set-slider-wrap{min-width:0;flex:1;}
.tm-chat-appearance .set-slider-wrap input{min-width:0;}

.mh-revision h4{margin:8px 0;font-size:13px;overflow-wrap:anywhere;}
.mh-revision p{white-space:pre-wrap;overflow-wrap:anywhere;}
.mh-revision button{min-height:36px;padding:8px 12px;border-radius:10px;background:var(--ink);color:var(--on-ink);font-size:12px;}
