/* Metamuse v2 · 抽屉 / sheet 样式 (P1 占位,P2 接溯源 + 双向羁绊) */

.sheet-mask {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 90;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}
.sheet-mask.active { opacity: 1; pointer-events: auto; }

.sheet {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  /* M11 D 全屏故事化 — 抽屉占 90% 高度 */
  height: 92%;
  background: #fff;
  border-radius: 24px 24px 0 0;
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.25);
  z-index: 91;
  display: flex; flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
}
.sheet.active { transform: translateY(0); }

/* 暗黑沉浸变体(角色档案抽屉用) — 跟立绘背景统一,不破坏沉浸 */
.sheet.sheet-dark {
  background: rgba(20, 18, 16, 0.92);
  backdrop-filter: blur(28px) saturate(1.1);
  -webkit-backdrop-filter: blur(28px) saturate(1.1);
  color: rgba(255, 255, 255, 0.92);
  box-shadow: 0 -12px 48px rgba(0, 0, 0, 0.55);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.sheet.sheet-dark .handle { background: rgba(255, 255, 255, 0.28); }
.sheet.sheet-dark .sheet-close-x { color: rgba(255, 255, 255, 0.55); }
.sheet.sheet-dark .sheet-close-x:active { color: #fff; }

/* 档案 sheet hero (compact 版,代替原 view-persona-info 全屏 hero) */
.sheet.sheet-dark .persona-sheet-hero {
  text-align: center;
  padding: 8px 0 22px;
}
.sheet.sheet-dark .ph-avatar {
  width: 88px; height: 88px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background-size: cover; background-position: center 25%;
  background-color: rgba(255,255,255,0.06);
  border: 2px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.40);
}
.sheet.sheet-dark .ph-name {
  font-size: 22px; font-weight: 700;
  letter-spacing: 0.5px;
  color: #fff;
  font-family: "Songti SC", "STSong", serif;
  margin-bottom: 8px;
}
.sheet.sheet-dark .ph-bio {
  font-size: 13.5px; line-height: 1.85;
  color: rgba(255, 255, 255, 0.72);
  font-family: "Songti SC", "STSong", serif;
  letter-spacing: 0.3px;
  padding: 0 4px;
}

/* 档案 blocks 在暗黑 sheet 内 */
.sheet.sheet-dark .story-block {
  padding: 14px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.sheet.sheet-dark .story-block:last-child { border-bottom: none; }
.sheet.sheet-dark .story-block .h {
  font-size: 11px;
  color: rgba(255, 200, 195, 0.92);   /* 朱红淡 */
  letter-spacing: 1.5px;
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 8px;
}
.sheet.sheet-dark .story-block .text {
  font-size: 14px; line-height: 1.85;
  color: rgba(255, 255, 255, 0.85);
  font-family: "Songti SC", "STSong", serif;
}
.sheet.sheet-dark .story-block .text strong {
  color: rgba(255, 200, 195, 0.95);
  font-weight: 500;
}

/* ============ v2.7 世界观可视化 ============ */
/* 世界观区块用左侧朱红丝带区分(跟基础档案对比) */
.sheet.sheet-dark .story-block.sb-world {
  position: relative;
  padding-left: 14px;
}
.sheet.sheet-dark .story-block.sb-world::before {
  content: '';
  position: absolute;
  left: 0; top: 18px; bottom: 18px;
  width: 2px;
  background: linear-gradient(180deg, rgba(168,66,60,0.7), rgba(168,66,60,0.15));
  border-radius: 2px;
}
/* 解锁区块更神秘 — 朱红渐变背景 + 锁标 */
.sheet.sheet-dark .story-block.sb-world.sb-unlock {
  background: linear-gradient(180deg, rgba(168,66,60,0.10) 0%, rgba(168,66,60,0.04) 100%);
  border-radius: 12px;
  padding: 14px 16px;
  margin: 8px 0;
  border-bottom: none;
}
.sheet.sheet-dark .story-block.sb-world.sb-unlock .h::before {
  content: '🔒  ';
  letter-spacing: 0;
}

/* 时间线 */
.sheet.sheet-dark .timeline {
  list-style: none;
  padding: 0;
  margin: 0;
  position: relative;
}
.sheet.sheet-dark .timeline::before {
  content: '';
  position: absolute;
  left: 4px; top: 8px; bottom: 8px;
  width: 1px;
  background: linear-gradient(180deg, rgba(255,200,195,0.4), rgba(255,200,195,0.05));
}
.sheet.sheet-dark .timeline li {
  position: relative;
  padding: 6px 0 6px 22px;
  font-size: 13.5px;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.88);
  font-family: "Songti SC", serif;
}
.sheet.sheet-dark .timeline li .tl-dot {
  position: absolute;
  left: 0; top: 14px;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: rgba(168, 66, 60, 0.85);
  box-shadow: 0 0 0 3px rgba(20, 18, 16, 0.5);
}
.sheet.sheet-dark .timeline li .tl-when {
  display: inline-block;
  color: rgba(255, 200, 195, 0.92);
  font-weight: 600;
  font-style: italic;
  margin-right: 8px;
  font-size: 12.5px;
  letter-spacing: 0.5px;
}

/* 关系网 */
.sheet.sheet-dark .rel-net {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sheet.sheet-dark .rel-net li {
  display: flex;
  gap: 12px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 10px;
  border-left: 2px solid rgba(168, 66, 60, 0.5);
}
.sheet.sheet-dark .rel-net .rel-who {
  flex-shrink: 0;
  color: rgba(255, 200, 195, 0.95);
  font-weight: 600;
  font-family: "Songti SC", serif;
  min-width: 60px;
  font-size: 13.5px;
}
.sheet.sheet-dark .rel-net .rel-desc {
  color: rgba(255, 255, 255, 0.78);
  font-size: 13px;
  font-family: "Songti SC", serif;
  line-height: 1.65;
}

/* 技能/弱点 标签 */
.sheet.sheet-dark .skills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.sheet.sheet-dark .skill-tag,
.sheet.sheet-dark .weak-tag {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: 14px;
  font-size: 12.5px;
  letter-spacing: 0.4px;
  font-family: "Songti SC", serif;
}
.sheet.sheet-dark .skill-tag {
  background: rgba(168, 66, 60, 0.18);
  border: 1px solid rgba(255, 200, 195, 0.3);
  color: rgba(255, 235, 230, 0.95);
}
.sheet.sheet-dark .weak-tag {
  background: rgba(80, 80, 80, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.78);
  font-style: italic;
}

/* 解锁列表 */
.sheet.sheet-dark .unlocks {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.sheet.sheet-dark .unlocks li {
  font-size: 13px;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.78);
  font-family: "Songti SC", serif;
  padding-left: 10px;
  border-left: 1px dashed rgba(255, 200, 195, 0.4);
}
.sheet.sheet-dark .unlocks .unlock-when {
  display: block;
  font-size: 11px;
  color: rgba(255, 200, 195, 0.85);
  letter-spacing: 1px;
  font-style: italic;
  margin-bottom: 2px;
  text-transform: uppercase;
}

/* "凝一个新的 TA" CTA 卡片(档案抽屉底,语义连续:看完 TA 想 TA 们) */
.persona-new-cta {
  display: block;
  width: 100%;
  margin-top: 22px;
  padding: 18px 20px;
  background: linear-gradient(135deg, rgba(168,66,60,0.32) 0%, rgba(168,66,60,0.18) 100%);
  border: 1px solid rgba(168,66,60,0.45);
  border-radius: 16px;
  text-align: center;
  position: relative;
  cursor: pointer;
  font-family: inherit;
  color: #fff;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.persona-new-cta:active { transform: scale(0.98); }
.persona-new-cta::after {
  content: '→';
  position: absolute; right: 18px; top: 50%;
  transform: translateY(-50%);
  color: rgba(255,255,255,0.65);
  font-size: 16px;
  font-family: -apple-system, sans-serif;
}
.persona-new-cta .ttl {
  display: block;
  font-family: "Songti SC", "STSong", serif;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  letter-spacing: 1px;
  margin-bottom: 4px;
}
.persona-new-cta .sub {
  display: block;
  font-size: 11.5px;
  color: rgba(255,255,255,0.65);
  letter-spacing: 0.5px;
  font-family: "Songti SC", serif;
  font-style: italic;
}

/* "翻看回忆" CTA — 比"凝新 TA"更克制更慢热 */
.memoir-cta {
  display: block;
  width: 100%;
  margin-top: 18px;
  padding: 16px 20px;
  background: rgba(255, 240, 235, 0.05);
  border: 1px dashed rgba(225, 145, 130, 0.45);
  border-radius: 14px;
  text-align: center;
  position: relative;
  cursor: pointer;
  font-family: inherit;
  color: rgba(255, 230, 220, 0.95);
  transition: transform 0.15s ease, background 0.2s ease;
}
.memoir-cta:active { transform: scale(0.985); background: rgba(255, 240, 235, 0.08); }
.memoir-cta::after {
  content: '↗';
  position: absolute; right: 18px; top: 50%;
  transform: translateY(-50%);
  color: rgba(255, 230, 220, 0.55);
  font-size: 14px;
}
.memoir-cta .ttl {
  display: block;
  font-family: "Songti SC", "STSong", serif;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 2px;
  margin-bottom: 4px;
}
.memoir-cta .sub {
  display: block;
  font-size: 11px;
  color: rgba(255, 230, 220, 0.5);
  letter-spacing: 1.5px;
  font-family: "Songti SC", serif;
  font-style: italic;
}

/* ============ 个性化区块 "你 眼 里 的 TA" ============ */
.sheet.sheet-dark .cust {
  margin-top: 22px;
  padding: 0;
  background: rgba(255, 240, 235, 0.04);
  border: 1px solid rgba(255, 230, 220, 0.10);
  border-radius: 14px;
  overflow: hidden;
}
.sheet.sheet-dark .cust > .cust-h {
  list-style: none;
  cursor: pointer;
  padding: 14px 18px;
  display: flex; align-items: baseline; justify-content: space-between;
  font-family: "Songti SC", serif;
  -webkit-user-select: none;
  user-select: none;
}
.sheet.sheet-dark .cust > .cust-h::-webkit-details-marker { display: none; }
.sheet.sheet-dark .cust > .cust-h::after {
  content: '＋';
  font-family: -apple-system, sans-serif;
  font-weight: 100;
  color: rgba(255, 230, 220, 0.55);
  font-size: 16px;
  margin-left: 8px;
}
.sheet.sheet-dark .cust[open] > .cust-h::after { content: '−'; }
.sheet.sheet-dark .cust .cust-h-l {
  font-size: 14px;
  letter-spacing: 2.5px;
  color: rgba(255, 245, 240, 0.92);
  font-weight: 500;
}
.sheet.sheet-dark .cust .cust-h-r {
  font-size: 11px;
  letter-spacing: 1.5px;
  color: rgba(255, 230, 220, 0.42);
  font-style: italic;
  flex: 1;
  margin-left: 8px;
}
.sheet.sheet-dark .cust-body {
  padding: 4px 16px 16px;
  border-top: 1px dashed rgba(255, 230, 220, 0.10);
}
.sheet.sheet-dark .cust-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 0;
  border-bottom: 1px dashed rgba(255, 230, 220, 0.08);
}
.sheet.sheet-dark .cust-row:last-of-type { border-bottom: none; }
.sheet.sheet-dark .cust-row-l { flex: 1; min-width: 0; }
.sheet.sheet-dark .cust-row-h {
  font-size: 12.5px;
  letter-spacing: 1.5px;
  color: rgba(255, 245, 240, 0.85);
  font-family: "Songti SC", serif;
  margin-bottom: 3px;
}
.sheet.sheet-dark .cust-row-sub {
  font-size: 10.5px;
  letter-spacing: 0.6px;
  color: rgba(255, 230, 220, 0.40);
  font-family: "Songti SC", serif;
  font-style: italic;
}
.sheet.sheet-dark .cust-row-r { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }

/* TA 在你这里的样子 — 圆形头像按钮 */
.sheet.sheet-dark .cust-av-btn {
  position: relative;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: rgba(20, 18, 16, 0.55);
  border: 1.5px solid rgba(225, 145, 130, 0.45);
  overflow: hidden;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
}
.sheet.sheet-dark .cust-av-btn img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.sheet.sheet-dark .cust-av-btn img:not([src]),
.sheet.sheet-dark .cust-av-btn img[src=""] { display: none; }
.sheet.sheet-dark .cust-av-btn .cust-av-edit {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  font-size: 8.5px;
  letter-spacing: 1px;
  color: rgba(255, 220, 200, 0.85);
  background: rgba(20, 18, 16, 0.78);
  padding: 1px 0;
  font-family: "Songti SC", serif;
}
.sheet.sheet-dark .cust-av-btn.uploading { opacity: 0.5; pointer-events: none; }

/* 文本输入框 */
.sheet.sheet-dark .cust-text-input {
  width: 110px;
  padding: 8px 10px;
  background: rgba(20, 18, 16, 0.55);
  border: 1px solid rgba(255, 230, 220, 0.20);
  border-radius: 8px;
  color: #fff;
  font-family: "Songti SC", serif;
  font-size: 13px;
  letter-spacing: 1px;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}
.sheet.sheet-dark .cust-text-input::placeholder { color: rgba(255, 230, 220, 0.30); font-style: italic; }
.sheet.sheet-dark .cust-text-input:focus { border-color: rgba(225, 145, 130, 0.55); }

/* 挑选按钮 / 恢复按钮 */
.sheet.sheet-dark .cust-pick-btn,
.sheet.sheet-dark .cust-clr-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 99px;
  padding: 6px 12px;
  font-size: 11px;
  letter-spacing: 1px;
  color: rgba(255, 240, 235, 0.85);
  font-family: "Songti SC", serif;
  cursor: pointer;
}
.sheet.sheet-dark .cust-clr-btn {
  border-color: rgba(168, 66, 60, 0.40);
  color: rgba(225, 145, 130, 0.85);
}
.sheet.sheet-dark .cust-pick-btn:active,
.sheet.sheet-dark .cust-clr-btn:active { transform: scale(0.97); }

/* Pill 三档选择 */
.sheet.sheet-dark .cust-pills {
  display: flex; gap: 4px;
  background: rgba(20, 18, 16, 0.45);
  border: 1px solid rgba(255, 230, 220, 0.10);
  border-radius: 99px;
  padding: 3px;
}
.sheet.sheet-dark .cust-pill {
  padding: 5px 10px;
  background: transparent;
  border: none;
  border-radius: 99px;
  color: rgba(255, 230, 220, 0.55);
  font-size: 11.5px;
  letter-spacing: 1px;
  font-family: "Songti SC", serif;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.sheet.sheet-dark .cust-pill.active {
  background: rgba(168, 66, 60, 0.55);
  color: #fff;
}
/* v2.7.13: mood 8 选 — 之前继承 .cust-pills 的 99px 圆角 + 200px 窄宽,wrap 后挤成花瓣形
   改成方框胶囊 + 280px 宽 + start 对齐,4 行 2 列规整排列 */
.sheet.sheet-dark .cust-pills-mood {
  flex-wrap: wrap;
  max-width: 280px;
  justify-content: flex-start;
  border-radius: 12px;
  padding: 6px;
  gap: 6px;
}

/* 4 色 swatch — 描写色调选择 */
.sheet.sheet-dark .cust-color-dots {
  display: flex; gap: 8px;
  background: rgba(20, 18, 16, 0.45);
  border: 1px solid rgba(255, 230, 220, 0.10);
  border-radius: 99px;
  padding: 4px 6px;
}
.sheet.sheet-dark .cust-color-dot {
  width: 20px; height: 20px;
  border-radius: 50%;
  border: 1.5px solid transparent;
  cursor: pointer;
  padding: 0;
  transition: transform 0.12s, border-color 0.12s;
}
.sheet.sheet-dark .cust-color-dot:active { transform: scale(0.92); }
.sheet.sheet-dark .cust-color-dot.active {
  border-color: rgba(255, 255, 255, 0.85);
  box-shadow: 0 0 0 2px rgba(20, 18, 16, 0.6);
}
.sheet.sheet-dark .cust-color-dot.dot-pink  { background: rgba(255, 200, 195, 0.85); }
.sheet.sheet-dark .cust-color-dot.dot-rose  { background: rgba(245, 165, 175, 0.95); }
.sheet.sheet-dark .cust-color-dot.dot-cream { background: rgba(255, 230, 195, 0.90); }
.sheet.sheet-dark .cust-color-dot.dot-gray  { background: rgba(255, 255, 255, 0.65); }
.sheet.sheet-dark .cust-pill-row { align-items: flex-start; }
.sheet.sheet-dark .cust-reset {
  display: block;
  width: 100%;
  margin-top: 14px;
  padding: 8px;
  background: transparent;
  border: 1px dashed rgba(255, 230, 220, 0.18);
  border-radius: 8px;
  color: rgba(255, 230, 220, 0.55);
  font-size: 11px;
  letter-spacing: 2px;
  font-family: "Songti SC", serif;
  cursor: pointer;
}
.sheet.sheet-dark .cust-reset:active { background: rgba(168, 66, 60, 0.10); }

/* ============ 声线 sheet ============ */
#voice-sheet .body { padding-bottom: 60px; }
.voice-tip {
  font-size: 11.5px;
  letter-spacing: 1.2px;
  color: rgba(255, 230, 220, 0.55);
  font-style: italic;
  font-family: "Songti SC", serif;
  margin-top: -4px;
  margin-bottom: 14px;
}
.voice-list {
  display: flex; flex-direction: column; gap: 8px;
}
.voice-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  background: rgba(255, 240, 235, 0.04);
  border: 1px solid rgba(255, 230, 220, 0.10);
  border-radius: 12px;
  cursor: pointer;
  font-family: "Songti SC", serif;
  transition: border-color 0.15s, background 0.15s;
}
.voice-item:hover { background: rgba(255, 240, 235, 0.07); }
.voice-item.playing { border-color: rgba(225, 145, 130, 0.55); background: rgba(168, 66, 60, 0.08); }
.voice-item.selected {
  border-color: rgba(225, 145, 130, 0.85);
  background: rgba(168, 66, 60, 0.18);
}
.voice-item .voice-ico {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(168, 66, 60, 0.20);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.voice-item .voice-ico::before {
  content: '▶';
  color: rgba(255, 220, 200, 0.85);
  font-size: 11px;
  margin-left: 2px;
}
.voice-item.playing .voice-ico::before { content: '❚❚'; font-size: 9px; margin: 0; }
.voice-item .voice-meta { flex: 1; min-width: 0; }
.voice-item .voice-name {
  font-size: 13px;
  letter-spacing: 1px;
  color: rgba(255, 245, 240, 0.92);
  margin-bottom: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.voice-item .voice-desc {
  font-size: 10.5px;
  letter-spacing: 0.5px;
  color: rgba(255, 230, 220, 0.45);
  font-style: italic;
}
.voice-item .voice-pick-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 99px;
  padding: 5px 12px;
  font-size: 11px;
  letter-spacing: 1px;
  color: rgba(255, 240, 235, 0.85);
  font-family: "Songti SC", serif;
  cursor: pointer;
  flex-shrink: 0;
}
.voice-item.selected .voice-pick-btn {
  background: rgba(168, 66, 60, 0.55);
  border-color: rgba(225, 145, 130, 0.65);
  color: #fff;
}

/* "管理这段关系" — 档案抽屉底,两个克制+危险两态的破坏性按钮 */
.rel-manage {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px dashed rgba(255, 230, 220, 0.14);
}
.rel-manage-h {
  font-size: 11px;
  letter-spacing: 3px;
  color: rgba(255, 230, 220, 0.42);
  font-family: "Songti SC", serif;
  text-align: center;
  margin-bottom: 12px;
}
.rel-manage-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 12px 14px;
  margin-bottom: 8px;
  background: rgba(255, 240, 235, 0.04);
  border: 1px solid rgba(255, 230, 220, 0.10);
  border-radius: 10px;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.rel-manage-btn:active { transform: scale(0.99); }
.rel-manage-btn:hover { background: rgba(255, 240, 235, 0.07); }
.rel-manage-btn .rel-manage-l {
  font-size: 13px;
  letter-spacing: 1.5px;
  font-family: "Songti SC", serif;
  color: rgba(255, 240, 235, 0.85);
}
.rel-manage-btn .rel-manage-r {
  font-size: 10.5px;
  letter-spacing: 0.5px;
  font-family: "Songti SC", serif;
  color: rgba(255, 230, 220, 0.42);
  font-style: italic;
}
.rel-manage-btn.rel-manage-danger { border-color: rgba(168, 66, 60, 0.35); }
.rel-manage-btn.rel-manage-danger .rel-manage-l { color: rgba(225, 145, 130, 0.92); }
.rel-manage-btn.rel-manage-danger:hover { background: rgba(168, 66, 60, 0.10); border-color: rgba(168, 66, 60, 0.55); }

/* ============ 回忆录 sheet ============ */
.sheet#memoir-sheet { z-index: 105; }
.sheet#memoir-sheet .body { padding: 24px 22px 64px; }
.memoir-hero {
  text-align: center;
  padding: 8px 0 16px;
  margin-bottom: 14px;
  border-bottom: 1px solid rgba(255, 230, 220, 0.10);
}
.memoir-avatar {
  width: 64px; height: 64px;
  margin: 0 auto 12px;
  border-radius: 50%;
  overflow: hidden;
  border: 1.5px solid rgba(225, 145, 130, 0.55);
  box-shadow: 0 4px 18px rgba(168, 66, 60, 0.25);
}
.memoir-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.memoir-title {
  font-family: "Songti SC", "STSong", serif;
  font-size: 18px;
  color: rgba(255, 245, 240, 0.92);
  letter-spacing: 3px;
  margin-bottom: 6px;
}
.memoir-title strong { color: var(--accent); font-weight: 600; }
.memoir-stats {
  font-size: 11.5px;
  color: rgba(255, 230, 220, 0.62);
  letter-spacing: 1.5px;
  font-family: "Songti SC", serif;
}
/* 时间轴 */
.memoir-timeline {
  position: relative;
  padding-left: 22px;
}
.memoir-timeline::before {
  content: '';
  position: absolute;
  left: 6px; top: 4px; bottom: 8px;
  width: 1px;
  background: linear-gradient(to bottom, rgba(225,145,130,0.45) 0%, rgba(225,145,130,0.15) 100%);
}
.memoir-event {
  position: relative;
  padding: 10px 0 14px;
}
.memoir-event::before {
  content: '';
  position: absolute;
  left: -22px; top: 16px;
  width: 11px; height: 11px;
  border-radius: 50%;
  background: rgba(20, 18, 16, 0.95);
  border: 2px solid var(--accent);
  box-shadow: 0 0 0 3px rgba(20, 18, 16, 0.95);
}
.memoir-event.is-meet::before { background: var(--accent); }
.memoir-event.is-stage::before { background: rgba(255, 220, 200, 0.85); border-color: rgba(255, 220, 200, 0.85); }
.memoir-event.is-engrave::before { background: #fff; border-color: #fff; }
.memoir-event-day {
  font-size: 10.5px;
  color: rgba(255, 230, 220, 0.5);
  letter-spacing: 1.5px;
  font-family: "Songti SC", serif;
  margin-bottom: 4px;
}
.memoir-event-title {
  font-size: 13px;
  color: rgba(255, 245, 240, 0.88);
  font-family: "Songti SC", "STSong", serif;
  letter-spacing: 0.6px;
  margin-bottom: 4px;
  font-weight: 500;
}
.memoir-event.is-stage .memoir-event-title { color: rgba(255, 220, 200, 0.95); }
.memoir-event.is-engrave .memoir-event-title { color: #fff; }
.memoir-event-quote {
  font-size: 12px;
  color: rgba(255, 230, 220, 0.72);
  font-family: "Songti SC", serif;
  font-style: italic;
  letter-spacing: 0.4px;
  line-height: 1.6;
  padding: 6px 10px;
  border-left: 2px solid rgba(225, 145, 130, 0.35);
  background: rgba(255, 240, 235, 0.04);
  border-radius: 0 6px 6px 0;
}
.memoir-event-quote .who {
  display: block;
  font-style: normal;
  font-size: 10px;
  color: rgba(255, 230, 220, 0.4);
  letter-spacing: 1px;
  margin-bottom: 3px;
}
.memoir-tail {
  text-align: center;
  margin-top: 24px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 230, 220, 0.10);
  font-size: 11px;
  color: rgba(255, 230, 220, 0.45);
  letter-spacing: 2px;
  font-family: "Songti SC", serif;
  font-style: italic;
}

/* 1→2 庆祝卡 — 用户蒸出第 2 个 TA 后一次性出现 */
.celebrate-mask {
  position: fixed; inset: 0;
  background: radial-gradient(circle at 50% 40%, rgba(168,66,60,0.30) 0%, rgba(0,0,0,0.65) 60%);
  z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  animation: cel-bg 0.6s ease-out;
}
.celebrate-mask.hidden { display: none; }
@keyframes cel-bg { from { opacity: 0; } to { opacity: 1; } }
.celebrate-card {
  width: 100%; max-width: 360px;
  background: linear-gradient(180deg, rgba(20,18,16,0.96) 0%, rgba(45,28,28,0.96) 100%);
  border: 1px solid rgba(255,200,195,0.22);
  border-radius: 20px;
  padding: 32px 24px 24px;
  text-align: center;
  box-shadow: 0 16px 60px rgba(168,66,60,0.45);
  animation: cel-pop 0.7s cubic-bezier(0.32, 0.72, 0, 1);
}
@keyframes cel-pop {
  from { opacity: 0; transform: scale(0.92) translateY(10px); }
  to   { opacity: 1; transform: none; }
}
.celebrate-card .seal {
  width: 64px; height: 64px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 35%, rgba(255,200,195,0.55), transparent 55%),
    var(--accent);
  box-shadow: 0 0 0 2px rgba(255,200,195,0.30), 0 8px 28px rgba(168,66,60,0.55);
  position: relative;
}
.celebrate-card .seal::after {
  content: attr(data-num);
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: "DM Sans", serif;
  font-weight: 700;
  font-size: 32px;
  color: #fff;
  letter-spacing: -2px;
}
.celebrate-card .ttl {
  font-family: "Songti SC", "STSong", serif;
  font-size: 20px; font-weight: 600;
  color: #fff;
  letter-spacing: 2px;
  margin-bottom: 8px;
}
.celebrate-card .ttl .em { color: #ffd6cc; }
.celebrate-card .sub {
  font-family: "Songti SC", serif;
  font-size: 13px;
  color: rgba(255,255,255,0.65);
  font-style: italic;
  letter-spacing: 0.5px;
  line-height: 1.85;
  margin-bottom: 22px;
  white-space: pre-line;
}
.celebrate-card .avatars {
  display: flex; justify-content: center; align-items: center; gap: 12px;
  margin-bottom: 22px;
}
.celebrate-card .av {
  width: 56px; height: 56px;
  border-radius: 50%;
  background-size: cover; background-position: center 25%;
  border: 2px solid rgba(255,255,255,0.16);
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
  background-color: rgba(255,255,255,0.05);
}
.celebrate-card .av-conn {
  font-size: 16px;
  color: rgba(255,200,195,0.65);
  font-family: "Songti SC", serif;
  font-style: italic;
}
.celebrate-card .cta {
  width: 100%;
  background: rgba(168,66,60,0.30);
  border: 1px solid rgba(168,66,60,0.55);
  color: #fff;
  padding: 12px;
  border-radius: 99px;
  font-family: "Songti SC", serif;
  font-size: 14px;
  letter-spacing: 1px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.celebrate-card .cta:active { background: rgba(168,66,60,0.50); }

/* 用户名字征询卡 — 聊 3 句后一次性弹,问 TA 该怎么叫你 */
/* ============ PWA 引导卡 (添加主屏 + 推送) ============ */
.pwa-mask {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.62);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  z-index: 9990;
}
.pwa-mask[hidden] { display: none; }
.pwa-card {
  position: fixed;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: min(360px, calc(100vw - 32px));
  background: linear-gradient(165deg, rgba(40, 28, 30, 0.96) 0%, rgba(20, 14, 16, 0.98) 100%);
  border: 1px solid rgba(225, 145, 130, 0.35);
  border-radius: 18px;
  padding: 28px 24px 20px;
  z-index: 9991;
  box-shadow: 0 12px 48px rgba(168, 66, 60, 0.30);
  text-align: center;
  font-family: "Songti SC", "STSong", serif;
  color: rgba(255, 240, 235, 0.95);
}
.pwa-card[hidden] { display: none; }
.pwa-close {
  position: absolute; top: 8px; right: 12px;
  background: transparent; border: none;
  color: rgba(255, 220, 200, 0.55);
  font-size: 22px;
  cursor: pointer;
  padding: 6px 12px;
}
.pwa-icon {
  font-size: 36px;
  margin-bottom: 10px;
}
.pwa-title {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 4px;
  color: rgba(255, 245, 240, 0.96);
  margin-bottom: 6px;
}
.pwa-desc {
  font-size: 12px;
  letter-spacing: 1.5px;
  color: rgba(255, 220, 200, 0.62);
  font-style: italic;
  margin-bottom: 18px;
  line-height: 1.7;
}
.pwa-steps {
  background: rgba(255, 240, 235, 0.06);
  border: 1px solid rgba(225, 145, 130, 0.20);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 18px;
  text-align: left;
}
.pwa-step {
  font-size: 12px;
  letter-spacing: 1.2px;
  color: rgba(255, 230, 220, 0.85);
  line-height: 1.9;
}
.pwa-step strong { color: rgba(225, 145, 130, 0.95); font-weight: 500; }
.ios-share-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px;
  background: rgba(225, 145, 130, 0.22);
  border-radius: 4px;
  font-size: 11px;
  margin: 0 2px;
}
.pwa-cta {
  width: 100%;
  padding: 12px 0;
  background: var(--accent);
  border: none;
  border-radius: 10px;
  color: #fff;
  font-family: inherit;
  font-size: 14px;
  letter-spacing: 4px;
  font-weight: 500;
  cursor: pointer;
  margin-bottom: 8px;
  box-shadow: 0 4px 14px rgba(168, 66, 60, 0.40);
}
.pwa-cta:active { transform: scale(0.985); }
.pwa-skip {
  width: 100%;
  padding: 8px 0;
  background: transparent;
  border: none;
  color: rgba(255, 220, 200, 0.45);
  font-family: inherit;
  font-size: 11px;
  letter-spacing: 2px;
  cursor: pointer;
}

.alias-mask {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 199;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  animation: cel-bg 0.4s ease-out;
}
.alias-mask.hidden { display: none; }
.alias-card {
  width: 100%; max-width: 320px;
  background: linear-gradient(180deg, rgba(20,18,16,0.96) 0%, rgba(38,24,24,0.96) 100%);
  border: 1px solid rgba(255,200,195,0.20);
  border-radius: 18px;
  padding: 28px 22px 22px;
  text-align: center;
  box-shadow: 0 16px 48px rgba(168,66,60,0.30);
  animation: cel-pop 0.5s cubic-bezier(0.32, 0.72, 0, 1);
}
.alias-card .alias-h {
  font-family: "Songti SC", "STSong", serif;
  font-size: 16px;
  color: #fff;
  letter-spacing: 2px;
  margin-bottom: 18px;
  font-weight: 600;
}
.alias-card .alias-input {
  width: 100%;
  /* 关键:appearance:none 才能盖住浏览器对 input 的默认白底 */
  -webkit-appearance: none;
  appearance: none;
  background-color: rgba(255,255,255,0.06) !important;
  background-image: none;
  border: 1px solid rgba(255,200,180,0.22);
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 16px;
  color: #fff !important;
  font-family: inherit;
  outline: none;
  text-align: center;
  letter-spacing: 2px;
  margin-bottom: 18px;
  transition: border-color 0.2s, background-color 0.2s, box-shadow 0.2s;
  caret-color: #ffd6cc;
}
.alias-card .alias-input:focus {
  border-color: rgba(255,200,180,0.65);
  background-color: rgba(255,255,255,0.10) !important;
  box-shadow: 0 0 0 3px rgba(168, 66, 60, 0.18);
}
.alias-card .alias-input::placeholder {
  color: rgba(255,255,255,0.35);
  letter-spacing: 1px;
}
/* iOS / Chrome 自动填充修正(否则 autofill 会染白底黑字) */
.alias-card .alias-input:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 1000px rgba(38,24,24,0.96) inset !important;
  -webkit-text-fill-color: #fff !important;
}
.alias-card .alias-actions {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.alias-card .alias-skip,
.alias-card .alias-ok {
  padding: 11px;
  border-radius: 99px;
  font-family: "Songti SC", serif;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 1px;
  cursor: pointer;
  border: none;
}
.alias-card .alias-skip {
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.65);
  border: 1px solid rgba(255,255,255,0.10);
}
.alias-card .alias-ok {
  background: rgba(168,66,60,0.85);
  color: #fff;
}
.alias-card .alias-ok:active { background: rgba(168,66,60,1); }

/* v2.6: .lightning-menu 已被 base.css 的 .sg-stack 取代,这里保留空区块占位防误引用 */

/* "你" 块:用户头像 + TA 怎么叫你(替换原 .my-alias-row) */
.sheet.sheet-dark .me-block {
  margin-top: 22px;
  padding: 14px 14px 14px 14px;
  background: rgba(168, 66, 60, 0.10);
  border: 1px solid rgba(255, 200, 180, 0.20);
  border-radius: 14px;
  display: flex; align-items: center; gap: 14px;
}
.sheet.sheet-dark .me-block-av {
  position: relative;
  width: 56px; height: 56px;
  border-radius: 50%;
  background: rgba(20, 18, 16, 0.55);
  border: 1.5px solid rgba(255, 200, 180, 0.32);
  flex-shrink: 0;
  cursor: pointer;
  overflow: hidden;
  padding: 0;
  font-family: inherit;
}
.sheet.sheet-dark .me-block-av img {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
}
.sheet.sheet-dark .me-block-av img:not([src]),
.sheet.sheet-dark .me-block-av img[src=""] { display: none; }
.sheet.sheet-dark .me-block-av .me-block-av-empty {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
  color: rgba(255, 200, 180, 0.62);
  font-family: -apple-system, sans-serif;
  font-weight: 200;
}
.sheet.sheet-dark .me-block-av.has-img .me-block-av-empty { display: none; }
.sheet.sheet-dark .me-block-av .me-block-av-edit {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: rgba(20, 18, 16, 0.78);
  font-size: 9px;
  letter-spacing: 1.5px;
  color: rgba(255, 220, 200, 0.85);
  padding: 2px 0;
  font-family: "Songti SC", serif;
  display: none;
}
.sheet.sheet-dark .me-block-av.has-img .me-block-av-edit { display: block; }
.sheet.sheet-dark .me-block-av.uploading { opacity: 0.5; pointer-events: none; }
.sheet.sheet-dark .me-block-info {
  flex: 1;
  display: flex; flex-direction: column; gap: 4px;
}
.sheet.sheet-dark .me-block-l {
  font-family: "Songti SC", serif;
  font-size: 11.5px;
  color: rgba(255, 200, 180, 0.62);
  letter-spacing: 1.5px;
}
.sheet.sheet-dark .me-block-r {
  display: flex; align-items: center; gap: 10px;
}
/* 用 .my-alias-row 的旧 selectors 给 .me-block 内复用 */
.sheet.sheet-dark .me-block .ma-value {
  flex: 1;
  font-family: "Songti SC", serif;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  letter-spacing: 1px;
}
.sheet.sheet-dark .me-block .ma-value.empty { color: rgba(255,255,255,0.40); font-weight: 400; }
.sheet.sheet-dark .me-block .ma-edit {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 99px;
  padding: 5px 12px;
  color: rgba(255, 255, 255, 0.85);
  font-size: 11.5px;
  font-family: "Songti SC", serif;
  letter-spacing: 1px;
  cursor: pointer;
}
.sheet.sheet-dark .me-block .ma-edit:active {
  background: rgba(168, 66, 60, 0.30);
  border-color: rgba(168, 66, 60, 0.55);
}

/* 旧 .my-alias-row 保留兼容(已不渲染但其它代码可能引用 — 安全) */
.sheet.sheet-dark .my-alias-row {
  margin-top: 22px;
  padding: 14px 16px;
  background: rgba(168, 66, 60, 0.10);
  border: 1px solid rgba(255, 200, 180, 0.20);
  border-radius: 14px;
  display: flex; align-items: center; gap: 12px;
}
.sheet.sheet-dark .my-alias-row .ma-label {
  font-family: "Songti SC", serif;
  font-size: 12px;
  color: rgba(255, 200, 180, 0.78);
  letter-spacing: 1.5px;
}
.sheet.sheet-dark .my-alias-row .ma-value {
  flex: 1;
  font-family: "Songti SC", serif;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  letter-spacing: 1px;
}
.sheet.sheet-dark .my-alias-row .ma-value.empty { color: rgba(255,255,255,0.40); font-weight: 400; }
.sheet.sheet-dark .my-alias-row .ma-edit {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 99px;
  padding: 6px 14px;
  color: rgba(255, 255, 255, 0.85);
  font-size: 12px;
  font-family: "Songti SC", serif;
  letter-spacing: 1px;
  cursor: pointer;
}
.sheet.sheet-dark .my-alias-row .ma-edit:active {
  background: rgba(168, 66, 60, 0.30);
  border-color: rgba(168, 66, 60, 0.55);
}

/* 关系阶段进度条(在 persona-sheet 内) */
.sheet.sheet-dark .rel-progress {
  margin-top: 22px;
  padding: 14px 16px 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
}
.sheet.sheet-dark .rel-h {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 12px;
}
.sheet.sheet-dark .rel-h-l {
  font-family: "Songti SC", serif;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.65);
  letter-spacing: 2px;
}
.sheet.sheet-dark .rel-h-r {
  font-family: "Songti SC", serif;
  font-size: 14px;
  font-weight: 600;
  color: #ffd6cc;
  letter-spacing: 1px;
}
.sheet.sheet-dark .rel-bar {
  position: relative;
  height: 4px;
  background: rgba(255, 255, 255, 0.10);
  border-radius: 2px;
  margin-bottom: 28px;
}
.sheet.sheet-dark .rel-fill {
  height: 100%;
  background: linear-gradient(90deg, rgba(168,66,60,0.80) 0%, rgba(255,200,180,0.95) 100%);
  border-radius: 2px;
  transition: width 0.6s cubic-bezier(0.32, 0.72, 0, 1);
}
.sheet.sheet-dark .rel-ticks {
  position: absolute; top: -3px; left: 0; right: 0;
  display: flex; justify-content: space-between;
}
.sheet.sheet-dark .rel-tick {
  display: flex; flex-direction: column; align-items: center;
  position: relative;
}
.sheet.sheet-dark .rel-tick i {
  width: 10px; height: 10px;
  background: rgba(255,255,255,0.18);
  border: 2px solid rgba(20,18,16,0.92);
  border-radius: 50%;
}
.sheet.sheet-dark .rel-tick.reached i {
  background: var(--accent);
  box-shadow: 0 0 0 2px rgba(168,66,60,0.30);
}
.sheet.sheet-dark .rel-tick.current i {
  background: #ffd6cc;
  box-shadow: 0 0 0 3px rgba(255,214,204,0.40), 0 0 12px rgba(255,200,180,0.55);
}
.sheet.sheet-dark .rel-tick b {
  font-family: "Songti SC", serif;
  font-weight: 400;
  font-size: 10px;
  color: rgba(255,255,255,0.45);
  margin-top: 8px;
  letter-spacing: 0.5px;
}
.sheet.sheet-dark .rel-tick.reached b { color: rgba(255,214,204,0.78); }
.sheet.sheet-dark .rel-tick.current b {
  color: #ffd6cc;
  font-weight: 600;
}
.sheet.sheet-dark .rel-hint {
  text-align: center;
  font-size: 11.5px;
  color: rgba(255,255,255,0.55);
  font-family: "Songti SC", serif;
  font-style: italic;
  letter-spacing: 0.5px;
  margin-top: 14px;  /* v2.7.13: 修复跟 rel-tick b 标签重叠(原 -6px 是把 hint 压到刻度行) */
}
/* 认识天数 + 累计句数 — 情感锚点,弱化字号 + 朱红描边给"重要数字"暗示 */
.sheet.sheet-dark .rel-meta {
  text-align: center;
  font-size: 11px;
  color: rgba(255, 230, 220, 0.62);
  font-family: "Songti SC", serif;
  letter-spacing: 1.5px;
  margin-top: 6px;
  padding-top: 8px;
  border-top: 1px dashed rgba(225, 145, 130, 0.18);
}
.sheet .handle {
  width: 36px; height: 4px;
  background: #d4d2cc;
  border-radius: 2px;
  margin: 10px auto 12px;
  flex-shrink: 0;
}
.sheet .body {
  flex: 1;
  overflow-y: auto;
  padding: 0 22px 22px;
  -webkit-overflow-scrolling: touch;
}

/* 占位:无出处时的提示 */
.sheet .placeholder {
  padding: 40px 0;
  text-align: center;
  color: var(--ink-mute);
  font-size: 13px;
  line-height: 1.8;
}
.sheet .placeholder .tip-h {
  font-size: 16px;
  color: var(--accent);
  font-family: "Songti SC", serif;
  margin-bottom: 8px;
  letter-spacing: 1px;
}

/* 出处抽屉 · 故事化文案头 */
.sheet .story-h {
  padding: 6px 0 14px;
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  font-family: "Songti SC", "STSong", serif;
  line-height: 1.6;
  letter-spacing: 0.5px;
}
.sheet .story-h strong { color: var(--accent); }

/* 原文片段卡 */
.sheet .src-box {
  background: var(--accent-pale);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 14px;
}
.sheet .src-box .meta {
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 1px;
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.sheet .src-box .meta svg {
  width: 13px; height: 13px;
  stroke: currentColor; fill: none; stroke-width: 1.8;
}
.sheet .src-box .text {
  font-size: 13.5px;
  line-height: 1.85;
  color: var(--ink-3);
  font-family: "Songti SC", "STSong", serif;
  letter-spacing: 0.3px;
  white-space: pre-wrap;
}
.sheet .src-box .position-line {
  margin-top: 10px;
  font-size: 11px;
  color: var(--ink-mute);
  letter-spacing: 0.5px;
  font-family: -apple-system, sans-serif;
}
.sheet .src-box .position-line .match-badge {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 99px;
  font-size: 10px;
  letter-spacing: 0.3px;
  font-weight: 500;
  margin-left: 2px;
}
.sheet .src-box .position-line .match-exact {
  background: rgba(52, 199, 89, 0.16);
  color: #2a7a3a;
}
.sheet .src-box .position-line .match-no_punct {
  background: rgba(0, 122, 255, 0.14);
  color: #1a5fb4;
}
.sheet .src-box .position-line .match-trigram {
  background: rgba(252, 218, 40, 0.20);
  color: #8a6a00;
}

/* "看上下文"降级文字链 */
.sheet-context-link {
  padding: 6px 22px 0;
  text-align: center;
  flex-shrink: 0;
}
.sheet-context-link .link-btn {
  background: none; border: none; cursor: pointer;
  color: var(--accent);
  font-size: 12px;
  letter-spacing: 0.5px;
  padding: 6px 12px;
}
.sheet-context-link .link-btn:disabled { opacity: 0.5; cursor: progress; }

/* 关闭 × 按钮 — 抽屉右上角悬浮 */
.sheet-close-x {
  position: absolute;
  top: 8px; right: 12px;
  width: 36px; height: 36px;
  background: none; border: none; cursor: pointer;
  font-size: 24px; color: var(--ink-mute);
  font-family: -apple-system, sans-serif;
  line-height: 1;
}
.sheet-close-x:active { color: var(--ink); }

/* 抽屉底部按钮区 — 现 mockup 04 双主操作 */
.sheet-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 10px 22px calc(14px + var(--safe-bottom));
  flex-shrink: 0;
}
.sheet-actions .action-btn {
  padding: 13px 14px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: none;
  text-align: left;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  line-height: 1.4;
  transition: opacity 0.2s, transform 0.1s;
}
.sheet-actions .action-btn .btn-h svg { width: 13px; height: 13px; vertical-align: -2px; }
.sheet-actions .action-btn:active { transform: scale(0.97); }
.sheet-actions .action-btn:disabled { opacity: 0.55; cursor: progress; }
.sheet-actions .action-btn .btn-h { font-size: 13px; }
.sheet-actions .action-btn .btn-sub {
  font-size: 10.5px;
  font-weight: 400;
  opacity: 0.8;
}
.sheet-actions .action-btn.ghost {
  background: var(--accent-pale);
  color: var(--accent);
  border: 1.5px solid #f5dde1;
}
.sheet-actions .action-btn.primary {
  background: var(--accent);
  color: #fff;
}
.sheet-actions .action-btn.engrave {
  background: var(--accent);
  color: #fff;
}
.sheet-actions .action-btn.engrave .btn-sub { color: rgba(255,255,255,0.85); }
.sheet-actions .action-btn.engrave.engraved {
  background: rgba(168, 66, 60, 0.14);
  color: var(--accent);
  border: 1px solid rgba(168, 66, 60, 0.30);
}
.sheet-actions .action-btn.engrave.engraved .btn-sub { color: rgba(168, 66, 60, 0.75); }
.sheet-actions .action-btn.from-source {
  background: var(--accent-pale);
  color: var(--accent);
  border: 1.5px solid #f5dde1;
}
.sheet-actions .action-btn.from-source .btn-sub { color: rgba(168, 66, 60, 0.65); }
.sheet-actions .action-btn.hidden { display: none; }
.sheet-actions .toast {
  grid-column: 1 / -1;
  font-size: 12px;
  text-align: center;
  color: var(--accent);
  padding: 4px 0;
  letter-spacing: 0.5px;
  animation: slide-up 0.25s ease-out;
}

/* src-tag has-source 默认就是朱红圆 — 已在 base.css 定义,这里无须再覆盖 */

/* from-source 回复:左侧朱红边 + "由这段记忆蒸出" 小标 */
.msg.assistant.from-source {
  border-left: 2px solid var(--accent);
  padding-left: 14px;
}
.msg.assistant.from-source .fs-tag {
  display: block;
  font-size: 10.5px;
  color: var(--accent);
  letter-spacing: 0.5px;
  margin-bottom: 4px;
  opacity: 0.85;
  font-weight: 500;
}

/* 章节上下文块(看上下文 按钮加载后追加到 sheet body) */
.context-block {
  margin-top: 8px;
  padding: 14px 16px;
  background: #f5f3ec;
  border-radius: 12px;
}
.context-block .meta {
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 1px;
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 10px;
}
.context-block p {
  font-size: 13.5px;
  line-height: 1.85;
  color: var(--ink-3);
  font-family: "Songti SC", "STSong", serif;
  letter-spacing: 0.3px;
  margin-bottom: 8px;
}
.context-block p.hit {
  color: var(--ink);
  background: rgba(168, 66, 60, 0.10);
  padding: 6px 10px;
  border-left: 3px solid var(--accent);
  border-radius: 4px;
  margin-left: -10px;
  margin-right: -10px;
  font-weight: 500;
}

/* v2.5 TA 的日记 + 事实 bullet (替代 radar) */
/* v2.9 P0#3 CP 邀请 — 浮卡列出本地角色 */
.cp-invite-mask {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 90;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.cp-invite-mask.hidden { display: none; }
.cp-invite-card {
  position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(360px, 90vw);
  background: rgba(20,18,16,0.96);
  -webkit-backdrop-filter: blur(24px) saturate(1.1);
  backdrop-filter: blur(24px) saturate(1.1);
  border: 1px solid rgba(255,200,180,0.30);
  border-radius: 18px;
  padding: 18px 18px 14px;
  z-index: 91;
  color: #fff;
  box-shadow: 0 16px 48px rgba(0,0,0,0.65);
}
.cp-invite-card.hidden { display: none; }
.cp-invite-card .cpi-h {
  font-family: "Songti SC", serif;
  font-size: 14px;
  color: rgba(255,200,180,0.95);
  letter-spacing: 2px;
  margin-bottom: 14px;
  text-align: center;
}
/* v2.9.2 切换 / CP 模式互切按钮 */
.cp-invite-card .cpi-toggle {
  display: block;
  margin-top: 6px;
  font-size: 11px;
  color: rgba(255,255,255,0.55);
  letter-spacing: 0.5px;
  cursor: pointer;
  font-family: -apple-system, "PingFang SC", sans-serif;
  font-weight: normal;
}
.cp-invite-card .cpi-toggle:hover { color: rgba(255,200,180,0.95); }
.cp-invite-card .cpi-list {
  display: flex; flex-direction: column; gap: 6px;
  max-height: 60vh; overflow-y: auto;
  margin-bottom: 12px;
}
.cp-invite-card .cpi-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.16s, border 0.16s;
  text-align: left;
  width: 100%;
  color: #fff;
  font-family: inherit;
}
.cp-invite-card .cpi-item:hover { background: rgba(168,66,60,0.20); border-color: rgba(255,200,180,0.40); }
.cp-invite-card .cpi-item .cpi-av {
  width: 40px; height: 40px;
  border-radius: 50%;
  background-size: cover; background-position: center;
  background-color: rgba(255,255,255,0.10);
  flex-shrink: 0;
}
.cp-invite-card .cpi-item .cpi-info { flex: 1; min-width: 0; }
.cp-invite-card .cpi-item .cpi-name {
  font-family: "Songti SC", serif;
  font-size: 14px;
  letter-spacing: 0.5px;
  color: #fff;
  margin-bottom: 2px;
}
.cp-invite-card .cpi-item .cpi-bio {
  font-size: 11.5px;
  color: rgba(255,255,255,0.55);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cp-invite-card .cpi-empty {
  text-align: center;
  font-size: 12px;
  color: rgba(255,255,255,0.55);
  font-family: "Songti SC", serif;
  font-style: italic;
  padding: 20px 0;
}
.cp-invite-card .cpi-close {
  display: block;
  margin: 0 auto;
  padding: 8px 22px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 99px;
  color: rgba(255,255,255,0.85);
  font-family: inherit;
  font-size: 12.5px;
  cursor: pointer;
}

/* v2.8.2 情绪雷达卡 — 8 维 Plutchik + 基线对比 + 压力槽 */
.sheet.sheet-dark .emo-radar-card {
  margin-top: 22px;
  padding: 16px 14px 14px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
}
.sheet.sheet-dark .er-h {
  display: flex; align-items: center; justify-content: space-between;
  font-family: "Songti SC", serif;
  font-size: 12.5px;
  color: rgba(255,200,180,0.85);
  letter-spacing: 2.5px;
  margin-bottom: 10px;
}
.sheet.sheet-dark .er-h-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: rgba(168,66,60,0.85);
  box-shadow: 0 0 8px rgba(168,66,60,0.6);
  transition: background 0.4s ease, box-shadow 0.4s ease;
}
.sheet.sheet-dark .er-svg {
  display: block;
  width: 100%;
  max-width: 280px;
  aspect-ratio: 1;
  margin: 0 auto;
}
.sheet.sheet-dark .er-grid line { stroke: rgba(255,255,255,0.06); stroke-width: 1; }
.sheet.sheet-dark .er-grid polygon {
  fill: none; stroke: rgba(255,255,255,0.06); stroke-width: 1;
}
.sheet.sheet-dark .er-baseline {
  fill: rgba(255,255,255,0.03);
  stroke: rgba(255,255,255,0.20);
  stroke-width: 1;
  stroke-dasharray: 3 3;
}
.sheet.sheet-dark .er-current {
  fill: rgba(168,66,60,0.32);
  stroke: rgba(255,200,180,0.85);
  stroke-width: 1.5;
  filter: drop-shadow(0 0 6px rgba(168,66,60,0.45));
  transition: all 0.6s cubic-bezier(0.32, 0.72, 0, 1);
}
.sheet.sheet-dark .er-dots circle {
  fill: rgba(255,200,180,0.95);
  stroke: rgba(20,18,16,0.9);
  stroke-width: 1.5;
  transition: r 0.4s ease;
}
.sheet.sheet-dark .er-labels text {
  font-family: "Songti SC", serif;
  font-size: 11.5px;
  fill: rgba(255,255,255,0.55);
  letter-spacing: 0.5px;
  text-anchor: middle;
  dominant-baseline: middle;
}
.sheet.sheet-dark .er-labels text.active {
  fill: rgba(255,214,204,0.95);
  font-weight: 600;
}
.sheet.sheet-dark .er-meta {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.sheet.sheet-dark .er-stress-row {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 8px;
}
.sheet.sheet-dark .er-stress-l, .sheet.sheet-dark .er-secret-l {
  flex-shrink: 0;
  font-family: "Songti SC", serif;
  font-size: 11px;
  color: rgba(255,255,255,0.55);
  letter-spacing: 1px;
  width: 64px;
}
.sheet.sheet-dark .er-stress-bar {
  flex: 1;
  height: 6px;
  background: rgba(255,255,255,0.08);
  border-radius: 3px;
  overflow: hidden;
}
.sheet.sheet-dark .er-stress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, rgba(168,66,60,0.5) 0%, rgba(255,140,100,0.95) 100%);
  border-radius: 3px;
  transition: width 0.6s cubic-bezier(0.32, 0.72, 0, 1);
}
.sheet.sheet-dark .er-stress-num {
  flex-shrink: 0;
  font-family: "DM Sans", -apple-system, sans-serif;
  font-size: 11px;
  font-weight: 600;
  color: rgba(255,200,180,0.85);
  width: 24px;
  text-align: right;
}
.sheet.sheet-dark .er-secret-row {
  display: flex; align-items: center; gap: 10px;
}
.sheet.sheet-dark .er-secret-dots {
  letter-spacing: 4px;
  color: rgba(255,200,180,0.85);
  font-size: 12px;
}
.sheet.sheet-dark .er-empty {
  text-align: center;
  font-size: 11.5px;
  color: rgba(255,255,255,0.4);
  font-family: "Songti SC", serif;
  font-style: italic;
  margin-top: 8px;
}

.diary-card, .about-card {
  margin: 12px 12px 14px;
  padding: 14px 14px 12px;
  background: linear-gradient(160deg, rgba(40,25,30,0.42), rgba(20,18,16,0.6));
  border: 1px solid rgba(168, 66, 60, 0.22);
  border-radius: 14px;
}
.diary-card.hidden, .about-card.hidden { display: none; }
.dy-h, .abt-h {
  font-size: 11.5px;
  color: rgba(255, 200, 195, 0.78);
  letter-spacing: 2px;
  margin-bottom: 10px;
}
.dy-list { display: flex; flex-direction: column; gap: 12px; }
.dy-entry {
  background: rgba(255, 255, 255, 0.04);
  border-left: 2px solid rgba(168, 66, 60, 0.45);
  padding: 10px 12px 10px 14px;
  border-radius: 6px;
  font-family: "Songti SC", "STSong", serif;
  font-size: 14px;
  line-height: 1.78;
  color: rgba(255, 235, 230, 0.92);
  white-space: pre-wrap;
  position: relative;
}
.dy-entry .dy-date {
  font-family: -apple-system, sans-serif;
  font-size: 10.5px;
  color: rgba(255, 255, 255, 0.42);
  letter-spacing: 0.5px;
  margin-bottom: 6px;
  display: block;
}
.dy-empty {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
  text-align: center;
  padding: 12px;
  font-family: "Songti SC", serif;
}
.abt-list { display: flex; flex-direction: column; gap: 6px; }
.abt-item {
  display: flex; align-items: flex-start; gap: 8px;
  font-size: 13px;
  color: rgba(255, 235, 230, 0.85);
  padding: 6px 0;
}
.abt-item::before {
  content: '・';
  color: rgba(255, 200, 195, 0.6);
  flex-shrink: 0;
}
.abt-empty {
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.42);
  text-align: center;
  padding: 4px;
}

/* v2.2.0 印象 radar 卡 (deprecated, 隐藏) */
.impressions-card {
  background: linear-gradient(160deg, rgba(40,25,30,0.4), rgba(20,18,16,0.6));
  border: 1px solid rgba(168,66,60,0.25);
  border-radius: 14px;
  padding: 14px 12px 10px;
  margin: 12px 12px 14px;
  text-align: center;
}
.impressions-card.hidden { display: none; }
.imp-h {
  font-size: 11.5px;
  color: rgba(255, 200, 195, 0.72);
  letter-spacing: 1.5px;
  margin-bottom: 8px;
}
.imp-radar {
  width: 180px; height: 180px;
  display: block;
  margin: 0 auto 4px;
}
.imp-radar .grid { fill: none; stroke: rgba(255,255,255,0.10); stroke-width: 0.5; }
.imp-radar .axis { stroke: rgba(255,255,255,0.10); stroke-width: 0.5; }
.imp-radar .shape {
  fill: rgba(168, 66, 60, 0.35);
  stroke: rgba(255, 200, 195, 0.85);
  stroke-width: 1.4;
  stroke-linejoin: round;
}
.imp-radar .vlabel {
  fill: rgba(255, 235, 230, 0.82);
  font-size: 9px;
  font-family: -apple-system, sans-serif;
  text-anchor: middle;
}
.imp-labels {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  font-size: 10px;
  color: rgba(255,255,255,0.55);
  letter-spacing: 0.5px;
}
.imp-labels .ipl b { color: rgba(255,200,195,0.92); font-weight: 500; }

/* v1.7.0 角色档案抽屉里的"编辑/分享" actions */
.char-actions {
  display: flex; gap: 10px;
  margin: 16px 12px 12px;
}
.char-act {
  flex: 1;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.92);
  padding: 11px 12px;
  border-radius: 12px;
  font-size: 13px; letter-spacing: 1px;
  cursor: pointer;
  transition: background 0.18s, transform 0.15s;
}
.char-act:active { transform: scale(0.97); }
.char-act:hover { background: rgba(168, 66, 60, 0.15); border-color: rgba(168, 66, 60, 0.35); }
.char-act.char-share { background: linear-gradient(160deg, rgba(168,66,60,0.20), rgba(168,66,60,0.12)); border-color: rgba(168,66,60,0.35); }

/* v2.0.3 市场搜索栏 */
.market-bar {
  display: flex; flex-direction: column; gap: 10px;
  margin-bottom: 14px;
}
/* 创建页是浅色卡背景,搜索栏改用浅色风 */
.market-q {
  width: 100%;
  background: #fff;
  border: 1px solid #ece6d8;
  border-radius: 99px;
  padding: 9px 16px;
  color: var(--ink);
  font-size: 13.5px;
  outline: none;
  transition: border-color 0.18s;
  box-sizing: border-box;
  -webkit-appearance: none;
}
.market-q:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(168,66,60,0.08); }
.market-q::placeholder { color: var(--ink-soft); }
.market-chips { display: flex; gap: 6px; align-items: center; flex-wrap: nowrap; overflow-x: auto; padding: 2px 0; }
.market-chips::-webkit-scrollbar { display: none; }
.mk-chip {
  background: #fff;
  border: 1px solid #ece6d8;
  color: var(--ink-dim);
  padding: 5px 13px;
  border-radius: 99px;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.18s, color 0.18s, border-color 0.18s;
}
.mk-chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.mk-spacer { flex: 1; }
.mk-sort { font-size: 11.5px; }

/* ============ v1.6 角色编辑器 (kind 入口 + 全屏 modal) ============ */
/* "轻聊 / 剧情" 二选一入口 — create 页第二张卡 */
.kind-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 4px 0 8px;
}
.kind-tile {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 14px;
  padding: 18px 12px;
  color: rgba(255, 255, 255, 0.92);
  cursor: pointer;
  text-align: center;
  transition: transform 0.15s, background 0.18s, border-color 0.18s;
  -webkit-tap-highlight-color: transparent;
}
.kind-tile:active { transform: scale(0.97); }
.kind-tile:hover { background: rgba(255, 255, 255, 0.10); border-color: rgba(255, 200, 195, 0.30); }
.kind-tile.kind-tile-storied { background: linear-gradient(160deg, rgba(168,66,60,0.15), rgba(255,255,255,0.06)); border-color: rgba(168,66,60,0.35); }
.kt-emoji { font-size: 28px; margin-bottom: 6px; }
.kt-h { font-size: 15px; font-weight: 600; letter-spacing: 2px; margin-bottom: 4px; }
.kt-sub { font-size: 11.5px; color: rgba(255, 255, 255, 0.6); line-height: 1.5; }

/* hidden file input */
.ed-hidden-file { display: none; }

/* 编辑器 modal */
.editor-mask {
  position: fixed; inset: 0;
  z-index: 130;
  background: rgba(10, 9, 7, 0.92);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  display: flex; align-items: stretch; justify-content: center;
  animation: editor-in 0.28s cubic-bezier(0.22, 0.9, 0.34, 1.0);
}
.editor-mask.hidden { display: none; }
@keyframes editor-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.editor-shell {
  width: 100%; max-width: 560px;
  display: flex; flex-direction: column;
  background: #181614;
  color: rgba(255, 255, 255, 0.95);
}
/* v2.1.4 移动端 — 540px 以下完全占满,不留侧边距 */
@media (max-width: 540px) {
  .editor-shell { max-width: 100%; }
  .ed-row { margin-bottom: 14px; }
  .editor-body { padding: 14px 14px calc(var(--safe-bottom) + 20px); }
  .ed-title { font-size: 15px; letter-spacing: 1.5px; }
  .ed-save { padding: 7px 12px; font-size: 12.5px; }
}
.editor-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(var(--safe-top) + 10px) 14px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.ed-close {
  width: 36px; height: 36px;
  background: transparent; border: none; cursor: pointer;
  color: rgba(255, 255, 255, 0.85);
  display: flex; align-items: center; justify-content: center;
}
.ed-close svg { width: 22px; height: 22px; }
.ed-title {
  font-size: 16px; font-weight: 600; letter-spacing: 2px;
  color: #fff;
}
.ed-save {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 8px 14px;
  border-radius: 99px;
  font-size: 13px; font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s, opacity 0.18s;
}
.ed-save:active { transform: scale(0.95); }
.ed-save[disabled] {
  opacity: 0.55;
  pointer-events: none;
  background: rgba(168,66,60,0.55);
  position: relative;
}
/* 微 spinner — 保存按钮 disabled 时显示 */
.ed-save[disabled]::after {
  content: '';
  display: inline-block;
  width: 12px; height: 12px;
  margin-left: 6px;
  vertical-align: -2px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: ed-spin 0.7s linear infinite;
}
@keyframes ed-spin {
  to { transform: rotate(360deg); }
}
.editor-tabs {
  display: flex;
  gap: 0;
  padding: 0 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  overflow-x: auto;
  scrollbar-width: none;
}
.editor-tabs::-webkit-scrollbar { display: none; }
.editor-tabs.hidden { display: none; }

/* AI 共创 + 6 模板 */
.editor-assist {
  padding: 10px 14px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.02);
}
.editor-assist.hidden { display: none; }
.ea-row {
  display: flex; gap: 8px; margin-bottom: 8px;
}
.ea-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 10px;
  padding: 9px 12px;
  color: #fff;
  font-size: 14px;
  outline: none;
  transition: border-color 0.18s;
}
.ea-input:focus { border-color: rgba(168, 66, 60, 0.6); }
.ea-input::placeholder { color: rgba(255, 255, 255, 0.4); font-size: 13px; }
.ea-go {
  background: linear-gradient(160deg, rgba(168,66,60,0.85), rgba(168,66,60,0.95));
  color: #fff;
  border: none;
  padding: 9px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  letter-spacing: 0.5px;
  transition: transform 0.15s, opacity 0.18s;
}
.ea-go:active { transform: scale(0.96); }
.ea-go[disabled] { opacity: 0.5; pointer-events: none; }
.ea-templates {
  display: flex; gap: 6px; flex-wrap: wrap;
}
.ea-tpl {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.85);
  padding: 5px 11px;
  border-radius: 99px;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s;
}
.ea-tpl:hover { background: rgba(168, 66, 60, 0.18); border-color: rgba(168, 66, 60, 0.45); }
.ea-tpl:active { transform: scale(0.95); }
.ed-tab {
  background: transparent; border: none;
  padding: 12px 14px;
  color: rgba(255, 255, 255, 0.55);
  font-size: 14px; letter-spacing: 1px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: color 0.18s, border-color 0.18s;
}
.ed-tab.active {
  color: #fff;
  border-bottom-color: var(--accent);
}
.editor-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 16px calc(var(--safe-bottom) + 24px);
}
.ed-pane.hidden { display: none; }
.ed-row {
  margin-bottom: 16px;
}
.ed-lab {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12.5px; color: rgba(255, 255, 255, 0.65);
  margin-bottom: 6px;
  letter-spacing: 0.5px;
}
.ed-cnt {
  font-size: 11px; color: rgba(255, 255, 255, 0.42);
}
.ed-req {
  font-size: 10.5px; color: rgba(168, 66, 60, 0.85);
  border: 1px solid rgba(168, 66, 60, 0.35);
  padding: 1px 6px; border-radius: 6px;
}
.ed-inp,
.ed-ta {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 10px;
  padding: 10px 12px;
  color: #fff;
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.18s, background 0.18s;
  box-sizing: border-box;
}
.ed-ta { resize: vertical; line-height: 1.55; min-height: 60px; }
.ed-inp:focus,
.ed-ta:focus {
  border-color: rgba(168, 66, 60, 0.6);
  background: rgba(255, 255, 255, 0.06);
}
.ed-inp::placeholder,
.ed-ta::placeholder { color: rgba(255, 255, 255, 0.35); }

/* 头像 */
.ed-avatar-row { display: flex; align-items: center; gap: 12px; }
.ed-avatar-preview {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08) center/cover no-repeat;
  border: 1px solid rgba(255,255,255,0.12);
  flex-shrink: 0;
}
.ed-avatar-btn {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.14);
  color: #fff;
  padding: 9px 14px; border-radius: 99px;
  font-size: 13px; cursor: pointer;
}
.ed-avatar-btn:active { transform: scale(0.96); }

/* 场景预览卡 */
.ed-scene-card {
  background: linear-gradient(160deg, rgba(168,66,60,0.18), rgba(255,255,255,0.04));
  border: 1px solid rgba(255,200,195,0.20);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 16px;
}
.esc-icons { display: flex; gap: 12px; font-size: 18px; margin-bottom: 8px; opacity: 0.85; }
.esc-i { display: inline-flex; align-items: center; }
.esc-meta { font-size: 13px; color: rgba(255,255,255,0.78); margin-bottom: 6px; line-height: 1.5; }
.esc-scenario { font-family: "Songti SC", serif; font-size: 14px; color: rgba(255, 200, 195, 0.92); line-height: 1.6; }

/* 剧情线 */
.ed-beat-list {
  display: flex; flex-direction: column; gap: 12px;
  margin-bottom: 14px;
}
.ed-beat {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 12px;
  padding: 12px;
  position: relative;
}
.ed-beat.ed-beat-fired {
  background: linear-gradient(160deg, rgba(168,66,60,0.10), rgba(255,255,255,0.04));
  border-color: rgba(168,66,60,0.45);
}
/* v2.0.1 流程图 */
.ed-flow-wrap {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 12px 10px 8px;
  margin-bottom: 14px;
}
.ed-flow-wrap.empty { display: none; }
.ed-flow-h {
  font-size: 11.5px;
  color: rgba(255,255,255,0.55);
  letter-spacing: 1px;
  margin-bottom: 6px;
  text-align: center;
}
.ed-flow {
  width: 100%;
  height: auto;
  max-height: 200px;
  display: block;
}
.ed-flow .node {
  fill: rgba(168, 66, 60, 0.22);
  stroke: rgba(168, 66, 60, 0.6);
  stroke-width: 1.2;
  cursor: pointer;
  transition: fill 0.15s;
}
.ed-flow .node:hover { fill: rgba(168, 66, 60, 0.45); }
.ed-flow .node.fired { fill: rgba(168, 66, 60, 0.7); stroke: rgba(255, 200, 195, 0.85); }
.ed-flow .node-label {
  font-size: 10px;
  fill: rgba(255, 235, 230, 0.92);
  text-anchor: middle;
  pointer-events: none;
  font-family: -apple-system, sans-serif;
}
.ed-flow .edge {
  stroke: rgba(255, 200, 195, 0.45);
  stroke-width: 1.4;
  fill: none;
  marker-end: url(#arrow);
}
.ed-flow .edge-default {
  stroke: rgba(255, 255, 255, 0.18);
  stroke-dasharray: 3 3;
}

.ed-next-row { display: flex; flex-wrap: wrap; gap: 6px; }
.ed-next-chip {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.72);
  padding: 5px 11px;
  border-radius: 99px;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.16s, border-color 0.16s, color 0.16s;
}
.ed-next-chip.on {
  background: rgba(168,66,60,0.45);
  border-color: rgba(168,66,60,0.85);
  color: #fff;
}

.ed-fired-badge {
  display: inline-block;
  background: rgba(168,66,60,0.85);
  color: #fff;
  font-size: 10.5px;
  padding: 1px 7px;
  border-radius: 99px;
  margin-left: 6px;
  letter-spacing: 0.5px;
  vertical-align: 1px;
}
.ed-ending-badge {
  display: inline-block;
  background: linear-gradient(135deg, #b88c3a, #d4a04a);
  color: #1a1714;
  font-size: 10.5px;
  font-weight: 600;
  padding: 1px 8px;
  border-radius: 99px;
  margin-left: 6px;
  letter-spacing: 1px;
  vertical-align: 1px;
}
.ed-beat-ending { border-color: rgba(212, 160, 74, 0.5); }
.ed-ending-row { margin-bottom: 10px; }
.ed-ending-toggle {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: rgba(255,255,255,0.72);
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
}
.ed-ending-toggle input { accent-color: #d4a04a; cursor: pointer; }
.ed-beat-h {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12.5px; color: rgba(255,255,255,0.6);
  margin-bottom: 8px;
}
.ed-beat-del {
  background: transparent; border: none;
  color: rgba(255,255,255,0.42);
  cursor: pointer;
  font-size: 18px;
  padding: 0 4px;
}
.ed-beat-del:hover { color: rgba(168,66,60,0.85); }
.ed-trig-row {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin-bottom: 8px;
}
.ed-trig-chip {
  display: inline-flex; align-items: center; gap: 4px;
  background: rgba(168,66,60,0.16);
  border: 1px solid rgba(168,66,60,0.35);
  color: rgba(255, 200, 195, 0.95);
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 11.5px;
}
.ed-add-beat {
  width: 100%;
  background: rgba(168,66,60,0.12);
  border: 1px dashed rgba(168,66,60,0.45);
  color: rgba(255,200,195,0.92);
  padding: 12px;
  border-radius: 12px;
  font-size: 13px; cursor: pointer;
  letter-spacing: 1px;
}
.ed-add-beat:active { transform: scale(0.98); }
.ed-tip {
  font-size: 11.5px; color: rgba(255,255,255,0.42);
  margin-top: 10px; line-height: 1.5;
  text-align: center;
}
