/* === style.css === */
:root {
  --bg: rgb(var(--gray-255));
  --bg-side: rgb(var(--gray-250));
  --bg-soft: rgb(var(--gray-245));
  --fg: rgb(var(--gray-16));
  --fg-2: rgb(var(--gray-110));
  --fg-3: rgb(var(--gray-136));
  --line: rgb(var(--gray-236));
  --line-2: rgb(var(--gray-222));
  --ok: rgb(var(--gray-136));
  --warn: rgb(var(--gray-168));
  --bad: rgb(var(--gray-110));
  --shadow-sm: 0 1px 2px rgba(var(--gray-16), .05);
  --shadow-md: 0 10px 30px rgba(var(--gray-16), .10);
  --shadow-lg: 0 24px 70px rgba(var(--gray-16), .16);
  --r-sm: 11px;
  --r-md: 16px;
  --r-lg: 24px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  touch-action: pan-x pan-y;
}

body { overflow: hidden; }

.app { display: flex; height: 100dvh; }

/* ================= 侧栏 ================= */
.side {
  flex: 0 0 272px;
  width: 272px;
  display: flex;
  flex-direction: column;
  background: var(--bg-side);
  border-right: 1px solid var(--line);
  min-height: 0;
}

.side-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px;
  padding: 16px 12px 0;
}

.draw-entry {
  flex: 1;
  height: 40px;
  display: flex; align-items: center; justify-content: center; gap: 7px;
  padding: 0 12px;
  border: 1px solid var(--line-2);
  border-radius: 11px;
  background: rgb(var(--gray-255));
  color: var(--fg-2);
  font: inherit; font-size: 13.2px; font-weight: 500;
  cursor: pointer;
  transition: .16s ease;
}
.draw-entry:hover { border-color: rgb(var(--gray-200)); color: var(--fg); background: rgb(var(--gray-250)); }
.draw-entry.on { border-color: rgb(var(--gray-222)); color: var(--fg); background: rgb(var(--gray-236)); font-weight: 600; }
.draw-entry.on:hover { border-color: rgb(var(--gray-200)); color: var(--fg); background: rgb(var(--gray-236)); }
.draw-entry.on svg { opacity: 1; }
.draw-entry svg { flex: 0 0 auto; opacity: .85; }

.icon-btn {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--fg-3);
  cursor: pointer;
  transition: .16s ease;
}
.icon-btn:hover { background: rgb(var(--gray-255)); border-color: var(--line); color: var(--fg); }

.new-char {
  margin: 8px 12px 10px;
  height: 40px;
  display: flex; align-items: center; justify-content: center; gap: 7px;
  border: 1px dashed var(--line-2);
  border-radius: 12px;
  background: rgb(var(--gray-255));
  color: var(--fg-2);
  font: inherit; font-size: 13.2px;
  cursor: pointer;
  transition: .18s ease;
}
.new-char:hover { border-style: solid; border-color: var(--fg); color: var(--fg); box-shadow: var(--shadow-sm); }

.char-list { flex: 1 1 auto; overflow-y: auto; padding: 0 8px 8px; min-height: 0; }
.char-list::-webkit-scrollbar { width: 8px; }
.char-list::-webkit-scrollbar-thumb { background: rgb(var(--gray-236)); border-radius: 8px; border: 2px solid var(--bg-side); }

.char {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px;
  border-radius: 13px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: .15s ease;
  margin-bottom: 2px;
}
.char { position: relative; overflow: hidden; }
.char:hover { background: rgb(var(--gray-255)); border-color: var(--line); }
.char.active { background: rgb(var(--gray-255)); border-color: var(--line-2); box-shadow: var(--shadow-sm); }
.char.active::before {
  content: ''; position: absolute; left: 2px; top: 20%; bottom: 20%;
  width: 3px; border-radius: 3px; background: var(--fg);
}

.char-av {
  flex: 0 0 36px;
  width: 36px; height: 36px;
  border-radius: 12px;
  display: grid; place-items: center;
  font-size: 14px; font-weight: 650;
  color: rgb(var(--gray-255));
  background: linear-gradient(150deg, rgb(var(--gray-56)), rgb(var(--gray-16)));
  user-select: none;
}
.char.active .char-av { background: linear-gradient(150deg, rgb(var(--gray-34)), rgb(var(--gray-16))); }

.char-info { min-width: 0; flex: 1; }
.char-info b {
  display: block;
  font-size: 13.6px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.char-info small {
  display: block;
  font-size: 11.6px; color: var(--fg-3);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.side-foot { flex: 0 0 auto; padding: 10px 12px 14px; border-top: 1px solid var(--line); }

.provider-line {
  width: 100%; height: 36px;
  display: flex; align-items: center; gap: 8px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgb(var(--gray-255));
  color: var(--fg-2);
  font: inherit; font-size: 12.4px;
  cursor: pointer;
  transition: .16s ease;
  overflow: hidden;
}
.provider-line:hover { border-color: rgb(var(--gray-222)); color: var(--fg); }
.ptext { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--fg-3); flex: 0 0 auto; }
.dot.ok { background: var(--ok); box-shadow: 0 0 0 3px rgba(var(--gray-136), .12); }
.dot.warn { background: var(--warn); box-shadow: 0 0 0 3px rgba(var(--gray-168), .12); }
.dot.bad { background: var(--bad); }

/* ================= 主区 ================= */
.main { flex: 1 1 auto; display: flex; flex-direction: column; min-width: 0; position: relative; }

.chat-head {
  flex: 0 0 auto;
  display: flex; align-items: center; gap: 11px;
  padding: 11px max(18px, calc((100% - 860px) / 2));
  border-bottom: 1px solid var(--line);
  background: rgba(var(--gray-255), .88);
  backdrop-filter: saturate(180%) blur(14px);
  z-index: 4;
}

.mini-avatar {
  flex: 0 0 34px;
  width: 34px; height: 34px; overflow: hidden;
  border-radius: 11px;
  display: grid; place-items: center;
  font-size: 13px; font-weight: 650;
  color: rgb(var(--gray-255));
  background: linear-gradient(150deg, rgb(var(--gray-56)), rgb(var(--gray-16)));
  user-select: none;
}

.who { min-width: 0; flex: 1; }
.who b { display: block; font-size: 14.2px; font-weight: 620; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who small { display: block; font-size: 11.8px; color: var(--fg-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.head-actions { display: flex; align-items: center; gap: 6px; }

.pill {
  height: 32px;
  padding: 0 12px;
  display: inline-flex; align-items: center; gap: 5px;
  border: 1px solid var(--line-2);
  border-radius: 9px;
  background: rgb(var(--gray-255));
  color: var(--fg-2);
  font: inherit; font-size: 12.5px;
  cursor: pointer;
  transition: .16s ease;
  white-space: nowrap;
}
.pill:hover { border-color: rgb(var(--gray-200)); color: var(--fg); box-shadow: var(--shadow-sm); }
.pill.primary { background: var(--fg); border-color: var(--fg); color: rgb(var(--gray-255)); }
.pill.primary:hover { background: rgb(var(--gray-0)); border-color: rgb(var(--gray-0)); color: rgb(var(--gray-255)); }

/* ================= 消息区 ================= */
.messages {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 24px 20px 10px;
  min-height: 0;
}
.messages::-webkit-scrollbar { width: 10px; }
.messages::-webkit-scrollbar-thumb { background: rgb(var(--gray-236)); border-radius: 10px; border: 3px solid rgb(var(--gray-255)); }
.messages::-webkit-scrollbar-thumb:hover { background: rgb(var(--gray-222)); }

.row {
  display: flex; gap: 12px;
  max-width: 860px;
  margin: 0 auto 20px;
  animation: pop .22s ease both;
}
.row.me { flex-direction: row-reverse; }

@keyframes pop {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.avatar {
  flex: 0 0 34px;
  width: 34px; height: 34px; align-self: flex-start; overflow: hidden;
  border-radius: 11px;
  display: grid; place-items: center;
  font-size: 12.5px; font-weight: 650;
  color: rgb(var(--gray-255));
  background: linear-gradient(150deg, rgb(var(--gray-56)), rgb(var(--gray-16)));
  margin-top: 2px;
  user-select: none;
}
.row.me .avatar { background: rgb(var(--gray-245)); color: var(--fg-2); }
.row.grouped { margin-top: -16px; margin-bottom: 6px; }
.row.grouped .avatar { opacity: 0; }
.row.grouped.ai .bubble { border-top-left-radius: 5px; }
.row.ai:has(+ .row.ai.grouped) .bubble { border-bottom-left-radius: 5px; }
.row.me:has(+ .row.me.grouped) .bubble { border-bottom-right-radius: 5px; }
.row.grouped.me .bubble { border-top-right-radius: 5px; }

.bubble {
  max-width: min(660px, 76%);
  padding: 12px 16px;
  border-radius: var(--r-md);
  font-size: var(--chat-font-size, 14.6px);
  line-height: 1.74;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.row.ai .bubble { background: rgb(var(--gray-255)); border: 1px solid var(--line); border-top-left-radius: 6px; box-shadow: var(--shadow-sm); }
.row.story-opening .avatar { display: none; }
.row.ai.story-opening .bubble { width: 100%; max-width: 660px; padding: 16px; border-radius: 16px; }
.story-opening-section + .story-opening-section { margin-top: 14px; padding-top: 12px; border-top: 1px solid rgb(var(--gray-222)); }
.story-opening-section h3 { margin: 0 0 5px; color: rgb(var(--gray-56)); font-size: 14px; }
.story-opening-section:first-child h3 { font-size: 17px; }
.story-opening-section p { margin: 0; }
.story-choices .story-choice { display: block; width: 100%; min-height: 44px; margin-top: 6px; padding: 8px 10px; text-align: left; white-space: normal; overflow-wrap: anywhere; }
.story-narration-body { width: 100%; max-width: 680px; min-width: 0; }
.story-narrator { color: var(--fg-3); font-size: 12px; font-weight: 600; margin-bottom: 6px; }
#messages.story-creation-chat .story-narration .bubble {
  width: 100%; max-width: none; padding: 0; border: 0; border-radius: 0;
  background: transparent; box-shadow: none; font-size: 14px; line-height: 1.65;
}
.story-narration :is(.story-intro-text, .story-past-choice) { margin: 0; }
.story-narration .story-intro-text + .story-opening-section { margin-top: 14px; }
.story-narration .story-opening-section h3 { font-size: 1em; }
.story-narration .story-choice { font-size: inherit; line-height: 1.45; }
.story-narration .story-past-choice + .story-past-choice { margin-top: 4px; }
.row.me .bubble { background: var(--fg); color: rgb(var(--gray-255)); border-top-right-radius: 6px; }
.row.sys .bubble { background: var(--bg-soft); border: 0; color: var(--fg-3); font-size: 13px; }
.row.err .bubble { background: rgb(var(--gray-245)); border: 1px solid rgb(var(--gray-222)); color: rgb(var(--gray-80)); font-size: 13.2px; }

.cursor {
  display: inline-block;
  width: 7px; height: 15px;
  margin-left: 2px;
  vertical-align: -2px;
  background: var(--fg-3);
  border-radius: 2px;
  animation: blink 1s steps(2) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.typing { display: inline-flex; gap: 4px; align-items: center; height: 20px; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: rgb(var(--gray-200)); animation: bob 1.1s infinite ease-in-out; }
.typing i:nth-child(2) { animation-delay: .15s; }
.typing i:nth-child(3) { animation-delay: .3s; }
@keyframes bob { 0%, 60%, 100% { transform: translateY(0); opacity: .55; } 30% { transform: translateY(-4px); opacity: 1; } }

.row.group-typing-status {
  justify-content: flex-start;
  padding-left: 4px;
}
.group-typing-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(var(--gray-255), .88);
  border: 1px solid rgba(0, 0, 0, .06);
  color: var(--fg-3, #777);
  font-size: 12px;
  line-height: 1.3;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .04);
  backdrop-filter: blur(8px);
}
.group-typing-pill .typing { height: 14px; }
.group-typing-pill .typing i { width: 5px; height: 5px; }

/* 空状态 */
.empty {
  height: 100%;
  max-width: 860px;
  margin: 0 auto;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center;
  padding-bottom: 40px;
  animation: pop .3s ease both;
}
.empty-mark { font-family: Georgia, serif; font-size: 64px; line-height: .6; color: rgb(var(--gray-236)); margin-bottom: 6px; }
.empty h1 { font-size: 19px; font-weight: 600; margin: 10px 0 6px; letter-spacing: .3px; }
.empty p { margin: 0; color: var(--fg-3); font-size: 13.4px; }
.empty .cta {
  margin-top: 20px;
  height: 38px; padding: 0 20px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: rgb(var(--gray-255));
  color: var(--fg);
  font: inherit; font-size: 13.5px;
  cursor: pointer;
  transition: .2s ease;
  box-shadow: var(--shadow-sm);
}
.empty .cta:hover { border-color: var(--fg); transform: translateY(-1px); box-shadow: var(--shadow-md); }

.empty-av {
  width: 76px; height: 76px;
  border-radius: 24px;
  display: grid; place-items: center;
  font-size: 27px; font-weight: 650;
  color: rgb(var(--gray-255));
  background: linear-gradient(150deg, rgb(var(--gray-56)), rgb(var(--gray-16)));
  margin-bottom: 16px;
  box-shadow: 0 12px 30px rgba(var(--gray-16), .14);
}

.empty-tip { margin-top: 14px; font-size: 12.2px; color: rgb(var(--gray-200)); }

/* ================= 输入区 ================= */
.composer-wrap { flex: 0 0 auto; padding: 8px 20px 16px; position: relative; }

/* 输入框上方的轻提示：报错和提示都不进对话流 */
.notice {
  position: absolute;
  left: 50%;
  bottom: calc(100% - 2px);
  transform: translate(-50%, 8px);
  max-width: min(600px, calc(100% - 36px));
  padding: 9px 16px;
  border-radius: 12px;
  background: rgb(var(--gray-250));
  border: 1px solid rgb(var(--gray-222));
  color: rgb(var(--gray-80));
  font-size: 13px;
  line-height: 1.55;
  text-align: center;
  box-shadow: 0 8px 24px rgba(var(--gray-34), .07);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
  z-index: 160;
}
.notice.show { opacity: 1; transform: translate(-50%, 0); }
.notice.ok { background: rgb(var(--gray-245)); border-color: rgb(var(--gray-222)); color: rgb(var(--gray-80)); }

.composer {
  display: flex; align-items: flex-end; gap: 10px;
  max-width: 860px; margin: 0 auto;
  padding: 8px 8px 8px 18px;
  background: rgb(var(--gray-255));
  border: 1px solid var(--line-2);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  transition: border-color .18s ease, box-shadow .18s ease;
}
.composer:focus-within { border-color: rgb(var(--gray-200)); box-shadow: 0 4px 22px rgba(var(--gray-16), .07); }

.composer textarea {
  flex: 1 1 auto;
  border: 0; outline: 0; resize: none;
  background: transparent;
  font: inherit; font-size: 14.8px;
  line-height: 1.62;
  color: var(--fg);
  padding: 9px 0;
  max-height: 168px;
  min-height: 24px;
}
.composer textarea::placeholder { color: rgb(var(--gray-168)); }

.composer button {
  flex: 0 0 auto;
  width: 38px; height: 38px;
  border: 0; border-radius: 50%;
  background: var(--fg);
  color: rgb(var(--gray-255));
  display: grid; place-items: center;
  cursor: pointer;
  transition: .18s ease;
}
.composer button:hover:not(:disabled) { transform: scale(1.05); }
.composer button:disabled { background: rgb(var(--gray-236)); color: rgb(var(--gray-200)); cursor: not-allowed; }

.hint { max-width: 860px; margin: 8px auto 0; text-align: center; font-size: 11.4px; color: rgb(var(--gray-200)); letter-spacing: .2px; }

/* ================= 对话记录弹层 ================= */
.pop {
  position: absolute;
  right: 18px; top: 58px;
  width: 316px;
  max-height: 66vh;
  display: none;
  flex-direction: column;
  background: rgb(var(--gray-255));
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-md);
  z-index: 12;
  overflow: hidden;
  animation: pop .18s ease both;
}
.pop.show { display: flex; }

.pop-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 12.8px;
  color: var(--fg-2);
}

.link-btn {
  border: 0; background: transparent;
  color: var(--fg-2);
  font: inherit; font-size: 12.4px;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 6px;
}
.link-btn:hover { color: var(--fg); background: var(--bg-soft); }

.pop-list { overflow-y: auto; padding: 6px; }
.pop-list::-webkit-scrollbar { width: 8px; }
.pop-list::-webkit-scrollbar-thumb { background: rgb(var(--gray-236)); border-radius: 8px; }

.hist {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 10px;
  border-radius: 10px;
  cursor: pointer;
  transition: .14s ease;
}
.hist:hover { background: var(--bg-soft); }
.hist.active { background: var(--bg-soft); }
.hist-main { flex: 1; min-width: 0; }
.hist-main b {
  display: block; font-size: 13.1px; font-weight: 550;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.hist-main small { font-size: 11.4px; color: var(--fg-3); }
.hist-del {
  flex: 0 0 auto;
  width: 24px; height: 24px;
  border: 0; border-radius: 7px;
  background: transparent; color: rgb(var(--gray-200));
  cursor: pointer; font-size: 15px; line-height: 1;
  opacity: 0; transition: .14s;
}
.hist:hover .hist-del { opacity: 1; }
.hist-del:hover { background: rgb(var(--gray-245)); color: var(--bad); }

.pop-empty { padding: 18px 12px; text-align: center; font-size: 12.6px; color: var(--fg-3); }

/* ================= 面板 ================= */
.sheet-mask {
  position: fixed; inset: 0;
  background: rgba(var(--gray-16), .18);
  backdrop-filter: blur(2px);
  opacity: 0; pointer-events: none;
  transition: opacity .22s ease;
  z-index: 20;
}
.sheet-mask.show { opacity: 1; pointer-events: auto; }

.sheet {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: min(430px, 100%);
  background: rgb(var(--gray-255));
  border-left: 1px solid var(--line);
  box-shadow: none;
  transform: translateX(102%);
  transition: transform .28s cubic-bezier(.22, .8, .3, 1);
  z-index: 21;
  display: flex;
  flex-direction: column;
  padding: 22px 22px 26px;
  overflow-y: auto;
}
.sheet.show { transform: none; box-shadow: var(--shadow-lg); }

.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.sheet-head h2 { font-size: 16px; font-weight: 650; margin: 0; letter-spacing: .2px; }

.row2 { display: flex; gap: 12px; }

.avatar-edit { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.avatar-preview {
  flex: 0 0 auto;
  width: 64px; height: 64px;
  border-radius: 20px;
  display: grid; place-items: center;
  font-size: 23px; font-weight: 650;
  color: rgb(var(--gray-255));
  background: linear-gradient(150deg, rgb(var(--gray-56)), rgb(var(--gray-16)));
  overflow: hidden;
}
.avatar-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-actions { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.avatar-actions small { flex: 0 0 100%; font-size: 11.2px; color: var(--fg-3); }

/* 头像图片通用 */
.char-av img, .avatar img, .mini-avatar img, .empty-av img {
  width: 100%; height: 100%; min-width: 0; min-height: 0;
  object-fit: cover;
  display: block;
  border-radius: inherit;
}
.has-img { background: rgb(var(--gray-236)) !important; }

.field { display: block; margin-bottom: 15px; flex: 1; min-width: 0; }
.field > span,
.field > label { display: block; font-size: 12.6px; font-weight: 560; color: var(--fg-2); margin-bottom: 6px; letter-spacing: .15px; }
.field > span b { color: var(--fg); font-weight: 650; font-variant-numeric: tabular-nums; }

.field input[type=text],
.field input[type=password],
.field input[type=email],
.field input[type=search],
.field input[type=number],
.field input[type=time],
.field textarea {
  width: 100%;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  background: rgb(var(--gray-250));
  padding: 10px 12px;
  font: inherit; font-size: 13.8px;
  color: var(--fg);
  outline: 0;
  transition: border-color .16s ease, background-color .16s ease, box-shadow .16s ease;
  resize: vertical;
}
.field input[type=number],
.field input[type=time] { font-variant-numeric: tabular-nums; }
.field textarea { line-height: 1.62; }
.field input:focus, .field textarea:focus, .field select:focus {
  border-color: rgb(var(--gray-136));
  background: rgb(var(--gray-255));
  box-shadow: 0 0 0 3px rgba(var(--gray-16), .06);
  outline: none;
}
.field small { display: block; margin-top: 5px; font-size: 11.4px; line-height: 1.45; color: var(--fg-3); }
.field > span + small,
.field > label + small { margin-top: -2px; margin-bottom: 7px; }

.field-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.field-head > span { font-size: 12.6px; font-weight: 560; color: var(--fg-2); letter-spacing: .15px; flex: 1 1 auto; }

.mem-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-top: 7px; font-size: 11.2px; color: var(--fg-3);
}
.switch-btn {
  border: 1px solid var(--line-2);
  background: rgb(var(--gray-255));
  color: var(--fg-2);
  font: inherit; font-size: 11.6px;
  padding: 3px 9px;
  border-radius: 7px;
  cursor: pointer;
  transition: .16s ease;
}
.switch-btn:hover:not(:disabled) { border-color: var(--fg); color: var(--fg); }
.switch-btn:disabled { opacity: .55; cursor: default; }
#cMemory { line-height: 1.72; max-height: 300px; }
.switch { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; user-select: none; }
.switch input { accent-color: rgb(var(--gray-16)); width: 13px; height: 13px; cursor: pointer; }
#memStamp { text-align: right; }
.mem-flash { animation: memflash .9s ease; }
@keyframes memflash {
  0% { box-shadow: 0 0 0 0 rgba(var(--gray-136), .35); }
  100% { box-shadow: 0 0 0 10px rgba(var(--gray-136), 0); }
}

.field input[type=range] {
  width: 100%;
  -webkit-appearance: none; appearance: none;
  height: 4px; border-radius: 4px;
  background: linear-gradient(90deg, var(--fg) var(--pct, 50%), rgb(var(--gray-236)) var(--pct, 50%));
  outline: 0;
}
.field input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: rgb(var(--gray-255));
  border: 1.5px solid var(--fg);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
}

/* 预设接口列表 */
.preset-hint { display: block; margin: -2px 0 8px; font-size: 11.2px; color: var(--fg-3); }
.preset-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }

.preset {
  position: relative;
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  min-width: 0;
  overflow: hidden;
  padding: 10px 24px 10px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgb(var(--gray-255));
  cursor: pointer;
  transition: .16s ease;
  text-align: left;
  font: inherit;
}
.preset > div { width: 100%; min-width: 0; }
.preset:hover { border-color: rgb(var(--gray-200)); background: rgb(var(--gray-255)); }
.preset.active { border-color: var(--fg); background: rgb(var(--gray-250)); box-shadow: 0 0 0 3px rgba(var(--gray-16), .05); }
.preset b { display: block; font-size: 12.8px; font-weight: 550; color: var(--fg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.preset small { font-size: 10.6px; color: var(--fg-3); display: block; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.preset .tick {
  position: absolute; right: 11px; top: 50%; transform: translateY(-50%);
  color: var(--fg); opacity: 0; font-size: 12px;
}
.preset.active .tick { opacity: 1; }

/* 免费内置模型 vs 第三方自备 API 隔离区 */
.prov-free-zone {
  padding: 12px;
  border-radius: 14px;
  background: rgba(99, 102, 241, .06);
  border: 1px solid rgba(99, 102, 241, .22);
  margin-bottom: 14px;
}
.prov-zone-title {
  font-weight: 700 !important;
  color: var(--fg) !important;
}
.prov-byok-zone {
  border: 1px dashed var(--line);
  border-radius: 14px;
  padding: 12px;
  margin-bottom: 14px;
  background: rgba(128, 128, 128, .04);
}
.prov-byok-title {
  display: block;
  font-size: 13px !important;
  font-weight: 600 !important;
  color: var(--fg-2) !important;
  margin-bottom: 10px !important;
}
.prov-byok-zone #providerDetails {
  margin-top: 12px;
}

.sheet-foot {
  display: flex; gap: 10px;
  position: sticky;
  bottom: -26px;
  margin: 10px -22px -26px;
  padding: 13px 22px 20px;
  background: rgb(var(--gray-255));
  border-top: 1px solid var(--line);
  z-index: 2;
}

.test-btn, .save-btn {
  height: 40px;
  border-radius: var(--r-sm);
  font: inherit; font-size: 13.6px;
  cursor: pointer;
  transition: .18s ease;
}
.test-btn {
  flex: 0 0 auto; padding: 0 16px;
  background: rgb(var(--gray-255));
  border: 1px solid var(--line-2);
  color: var(--fg-2);
}
.test-btn:hover:not(:disabled) { border-color: var(--fg); color: var(--fg); }
.test-btn.danger:hover:not(:disabled) { border-color: var(--bad); color: var(--bad); background: rgb(var(--gray-250)); }
.save-btn {
  flex: 1 1 auto;
  background: var(--fg);
  border: 1px solid var(--fg);
  color: rgb(var(--gray-255));
}
.save-btn:hover { opacity: .88; }
.test-btn:disabled { opacity: .5; cursor: default; }

.test-out {
  margin: 8px 0 4px;
  font-size: 12.4px;
  line-height: 1.55;
  color: var(--fg-3);
  white-space: pre-wrap;
  word-break: break-word;
}
.test-out:empty { display: none; margin: 0; }
.test-out.ok { color: #16a34a; }
.test-out.bad { color: #dc2626; }
[data-theme="dark"] .test-out.ok { color: #4ade80; }
[data-theme="dark"] .test-out.bad { color: #f87171; }

/* 角色设定：专属美化入口卡 / 聊天背景控件 / 底部辅助操作行 */
.char-theme-entry {
  display: flex; align-items: center; gap: 11px;
  width: 100%; height: auto; min-height: 56px;
  padding: 11px 13px; border-radius: 14px;
  text-align: left;
}
.char-theme-entry-ic {
  width: 34px; height: 34px; border-radius: 11px; flex: none;
  display: grid; place-items: center;
  background: rgba(var(--gray-16), .07); color: var(--fg);
  font-size: 15px; line-height: 1;
}
.char-theme-entry-text {
  flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px;
}
.char-theme-entry-text strong {
  font-size: 13.5px; font-weight: 620; color: var(--fg); line-height: 1.3;
}
.char-theme-entry-text small {
  margin: 0 !important; font-size: 11.4px; color: var(--fg-3); line-height: 1.35;
}
.char-theme-entry-arrow {
  flex: none; font-size: 18px; line-height: 1; color: var(--fg-3);
}

.chatbg-row { display: flex; align-items: center; gap: 12px; }
.chatbg-thumb {
  width: 54px; height: 70px; flex: none;
  border-radius: 11px; border: 1px solid var(--line-2);
  background: rgb(var(--gray-245)) center / cover no-repeat;
  overflow: hidden;
}
.chatbg-ops { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.chatbg-dimline {
  display: flex; align-items: center; gap: 10px;
  margin-top: 10px; padding: 9px 12px;
  border-radius: 12px; border: 1px solid var(--line);
  background: rgb(var(--gray-250));
  font-size: 12px; color: var(--fg-2); font-variant-numeric: tabular-nums;
}
.chatbg-dimline input[type=range] { flex: 1; min-width: 0; }
.field-hint { margin: 6px 0 0; font-size: 11.4px; line-height: 1.5; color: var(--fg-3); }

.char-extra-ops {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin: 6px 0 12px;
}
.char-extra-ops:not(:has(> button:not([hidden]))) { display: none; }
.char-extra-ops .test-btn {
  flex: 1 1 auto; min-width: 0;
  font-size: 12.8px; padding: 0 12px;
}
.char-extra-ops .test-btn.danger {
  color: #d64545; border-color: rgba(214, 69, 69, .26); background: rgba(214, 69, 69, .05);
}
[data-theme="dark"] .char-extra-ops .test-btn.danger {
  color: #f87171; border-color: rgba(248, 113, 113, .28); background: rgba(248, 113, 113, .08);
}

/* 主动消息类型复选胶囊 */
#proactiveTypes { display: flex; flex-wrap: wrap; gap: 8px; }
#proactiveTypes > span { flex: 0 0 100%; margin-bottom: 2px; }
#proactiveTypes > label {
  display: inline-flex; align-items: center; gap: 6px;
  margin: 0; padding: 7px 11px; min-height: 36px;
  border: 1px solid var(--line-2); border-radius: 10px;
  background: rgb(var(--gray-250)); color: var(--fg); font-size: 12.6px; font-weight: 500;
  cursor: pointer; user-select: none;
}
#proactiveTypes > label input { accent-color: var(--fg); margin: 0; }


/* ================= 生图 ================= */
/* 生图视图：独立于角色聊天 */
.draw-view { display: none; flex: 1 1 auto; min-height: 0; overflow-y: auto; }
.draw-view::-webkit-scrollbar { width: 10px; }
.draw-view::-webkit-scrollbar-thumb { background: rgb(var(--gray-236)); border-radius: 8px; border: 3px solid rgb(var(--gray-255)); }
body.draw-mode .draw-view { display: block; }
body.draw-mode .chat-head,
body.draw-mode .messages,
body.draw-mode .composer-wrap,
body.draw-mode .pop,
body.draw-mode .side-foot { display: none !important; }

.draw-inner { max-width: 860px; margin: 0 auto; padding: 32px 24px 70px; }
.draw-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.draw-head h2 { margin: 0; font-size: 19px; font-weight: 650; letter-spacing: .2px; }
.style-tag {
  padding: 3px 9px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: rgb(var(--gray-250));
  color: var(--fg-3);
  font-size: 11.4px; font-weight: 500;
  letter-spacing: .3px;
  white-space: nowrap;
}
.style-tag.model-tag {
  border-color: rgb(var(--gray-222));
  background: rgb(var(--gray-255));
  color: rgb(var(--gray-56));
  font-weight: 600;
}

.who-row { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; flex-wrap: wrap; }
.who-label { flex: 0 0 auto; font-size: 12.2px; color: var(--fg-2); }
.who-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.who-chip {
  height: 28px; padding: 0 12px;
  max-width: 140px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: rgb(var(--gray-255));
  color: var(--fg-2);
  font: inherit; font-size: 12.3px;
  cursor: pointer;
  transition: .15s ease;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.who-chip:hover { border-color: rgb(var(--gray-200)); color: var(--fg); }
.who-chip.active { border-color: var(--fg); background: rgb(var(--gray-245)); color: var(--fg); font-weight: 600; }

.draw-box {
  padding: 15px 15px 14px;
  background: rgb(var(--gray-255));
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow-sm);
}

.draw-box textarea {
  width: 100%;
  min-height: 96px;
  padding: 13px 14px;
  border: 1px solid var(--line-2);
  border-radius: 13px;
  background: rgb(var(--gray-250));
  font: inherit; font-size: 14.4px; line-height: 1.72;
  color: var(--fg);
  outline: 0;
  resize: none;
  transition: .16s ease;
}
.draw-box textarea:focus { border-color: rgb(var(--gray-200)); background: rgb(var(--gray-255)); box-shadow: 0 0 0 3px rgba(var(--gray-16), .045); }

.draw-ops { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; }
.ops-left { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; min-width: 0; }

.ai-btn {
  height: 30px; padding: 0 12px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: rgb(var(--gray-255));
  color: var(--fg-2);
  font: inherit; font-size: 12.4px;
  cursor: pointer;
  transition: .15s ease;
  white-space: nowrap;
}
.ai-btn:hover:not(:disabled) { border-color: rgb(var(--gray-200)); color: var(--fg); background: rgb(var(--gray-250)); }
.ai-btn:disabled { opacity: .55; cursor: default; }

.idea-out:empty { display: none; }
.idea-head { margin: 13px 0 2px; font-size: 12.4px; font-weight: 500; color: var(--fg-2); letter-spacing: .2px; }
.idea-sug {
  display: flex; align-items: flex-start; gap: 9px;
  width: 100%;
  text-align: left;
  margin-top: 9px;
  padding: 11px 13px;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  background: rgb(var(--gray-255));
  color: var(--fg);
  font: inherit; font-size: 13px; line-height: 1.68;
  cursor: pointer;
  transition: .15s ease;
  animation: pop .18s ease both;
}
.idea-sug:hover { border-color: rgb(var(--gray-200)); box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.sug-idx {
  flex: 0 0 auto;
  width: 19px; height: 19px;
  margin-top: 2px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: rgb(var(--gray-236));
  color: var(--fg-2);
  font-size: 11px; font-weight: 600;
  transition: .15s ease;
}
.idea-sug:hover .sug-idx { background: var(--fg); color: rgb(var(--gray-255)); }
.sug-txt { flex: 1; min-width: 0; }
.idea-err { margin-top: 9px; font-size: 12.4px; color: rgb(var(--gray-80)); }
.draw-err { display: none; margin-top: 10px; padding: 9px 11px; border-radius: 10px; background: rgb(var(--gray-245)); border: 1px solid rgb(var(--gray-222)); color: rgb(var(--gray-80)); font-size: 12.6px; line-height: 1.6; }
.draw-err.show { display: block; }

/* 画廊 */
.gal-head { display: none; margin: 28px 0 11px; font-size: 12.4px; color: var(--fg-3); letter-spacing: .2px; }
.gal-head.show { display: block; }
.draw-gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 26px; }
.gal-head.show + .draw-gallery { margin-top: 0; }
.gal-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: 14px;
  overflow: hidden;
  background: rgb(var(--gray-245));
  border: 1px solid var(--line);
  cursor: zoom-in;
  animation: pop .22s ease both;
}
.gal-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gal-cap {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 18px 9px 8px;
  background: linear-gradient(transparent, rgba(var(--gray-0), .6));
  color: rgb(var(--gray-255)); font-size: 11px; line-height: 1.4;
  opacity: 0; transition: .16s ease;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.gal-item:hover .gal-cap { opacity: 1; }
.gal-empty { grid-column: 1 / -1; padding: 30px 0 6px; text-align: center; font-size: 12.8px; color: var(--fg-3); }
.gal-slot { display: grid; place-items: center; aspect-ratio: 1; border-radius: 14px; border: 1px dashed var(--line-2); background: rgb(var(--gray-250)); }
.sizes { display: flex; gap: 6px; }
.draw-modes { margin-bottom: 12px; }
.draw-source {
  display: flex; align-items: center; gap: 12px; margin-bottom: 12px;
  padding: 10px; border: 1px dashed rgb(var(--gray-222)); border-radius: 12px;
}
.draw-source img { width: 76px; height: 76px; object-fit: contain; border-radius: 8px; background: rgb(var(--gray-245)); }
.draw-source-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; min-width: 0; }
.draw-source-actions span { flex-basis: 100%; white-space: normal; }
#drawView [hidden], #promptSheet [hidden] { display: none; }
.role-memory-text { white-space: pre-wrap; overflow-wrap: anywhere; }

.registration-welcome {
  box-sizing: border-box; width: min(440px, calc(100% - 32px)); max-height: calc(100% - 32px);
  margin: auto; padding: clamp(20px, 6vw, 32px); border: 1px solid rgb(var(--gray-222));
  border-radius: 24px; background: rgb(var(--gray-255)); color: var(--fg);
}
.registration-welcome::backdrop { background: rgb(0 0 0 / .6); }
.registration-welcome-eyebrow { margin: 0 0 8px; font-size: 13px; }
.registration-welcome h2 { margin: 0 0 12px; font-size: 26px; }
.registration-welcome p { color: var(--fg-3); line-height: 1.65; }
.registration-welcome ul { display: grid; gap: 10px; padding: 0; margin: 20px 0; list-style: none; }
.registration-welcome li { display: grid; gap: 5px; padding: 12px; border-radius: 12px; background: rgb(var(--gray-245)); }
.registration-welcome li span { font-size: 13px; color: var(--fg-3); line-height: 1.55; }
.registration-welcome .save-btn { width: 100%; min-height: 44px; }

.size-chip {
  height: 30px; padding: 0 13px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: rgb(var(--gray-255));
  color: var(--fg-2);
  font: inherit; font-size: 12.4px;
  cursor: pointer;
  transition: .15s ease;
}
.size-chip:hover { border-color: rgb(var(--gray-200)); color: var(--fg); }
.size-chip.active { border-color: var(--fg); color: var(--fg); background: rgb(var(--gray-245)); font-weight: 500; }

.draw-go {
  flex: 0 0 auto; min-height: 48px; min-width: 108px; padding: 0 24px;
  border: 1px solid var(--fg);
  border-radius: 11px;
  background: var(--fg);
  color: rgb(var(--gray-255));
  font: inherit; font-size: 16px; font-weight: 650; white-space: nowrap;
  cursor: pointer;
  transition: .16s ease;
}
.draw-go:hover:not(:disabled) { opacity: .88; }
.draw-go:disabled { opacity: .55; cursor: default; }

@media (max-width: 780px) {
  .draw-ops { flex-direction: column; align-items: stretch; }
  .draw-go { min-height: 52px; }
}

/* 图片消息 */
.bubble.img-bubble {
  padding: 7px;
  line-height: 0;
  max-width: min(374px, 74%);
  background: rgb(var(--gray-255));
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.chat-img {
  display: block;
  width: 100%;
  max-width: 360px;
  height: auto;
  border-radius: 11px;
  cursor: zoom-in;
  background: rgb(var(--gray-245));
}
.img-cap {
  padding: 7px 8px 9px;
  font-size: 11.8px;
  line-height: 1.5;
  color: var(--fg-3);
}

/* 生成中的占位 */
.drawing { display: flex; align-items: center; gap: 11px; }
.shimmer {
  width: 150px; height: 150px;
  border-radius: 12px;
  background: linear-gradient(100deg, rgb(var(--gray-245)) 25%, rgb(var(--gray-236)) 45%, rgb(var(--gray-245)) 65%);
  background-size: 220% 100%;
  animation: sh 1.3s linear infinite;
}
@keyframes sh { 0% { background-position: 180% 0; } 100% { background-position: -40% 0; } }
.draw-note { font-size: 12.6px; color: var(--fg-3); line-height: 1.6; }

/* 大图预览 */
.lightbox {
  position: fixed; inset: 0;
  display: none;
  align-items: center; justify-content: center;
  padding: 30px;
  background: rgba(var(--gray-16), .86);
  z-index: 115;
  cursor: zoom-out;
}
.lightbox.show { display: flex; animation: pop .16s ease both; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 10px; box-shadow: 0 30px 80px rgba(var(--gray-0), .45); }
.lightbox-dl {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%);
  padding: 8px 18px; border-radius: 999px;
  background: rgba(255, 255, 255, .94); color: #111;
  font-size: 13px; font-weight: 500; text-decoration: none;
  border: 1px solid rgba(0, 0, 0, .12);
  box-shadow: 0 4px 16px rgba(0, 0, 0, .22);
}
.lightbox-dl:hover { background: #fff; }

/* ================= 手机端 ================= */
.only-mobile { display: none; }
.side-mask {
  position: fixed; inset: 0;
  background: rgba(var(--gray-16), .22);
  opacity: 0; pointer-events: none;
  transition: opacity .2s;
  z-index: 15;
}

@media (max-width: 780px) {
  .only-mobile { display: grid; }

  .side {
    position: fixed;
    top: 0; bottom: 0; left: 0;
    width: 278px; flex-basis: 278px;
    transform: translateX(-102%);
    transition: transform .26s cubic-bezier(.22, .8, .3, 1);
    z-index: 16;
    box-shadow: var(--shadow-lg);
  }
  .side.show { transform: none; }
  .side.show + .main { pointer-events: none; }
  .side-mask.show { opacity: 1; pointer-events: auto; }

  .chat-head { padding: 9px 12px; gap: 8px; }
  .head-actions .pill { padding: 0 9px; font-size: 12px; }
  #historyBtn { display: none; }
  .messages { padding: 16px 12px 6px; }
  .row { margin-bottom: 16px; }
  .bubble { max-width: 82%; font-size: 14.4px; }
  .composer-wrap { padding: 6px 10px calc(12px + env(safe-area-inset-bottom)); }
  .head-actions .pill { height: 34px; }
  .hint { display: none; }
  .avatar, .mini-avatar { flex-basis: 30px; width: 30px; height: 30px; font-size: 11px; border-radius: 9px; }
  .sheet { width: 100%; border-left: 0; padding: 18px 16px 24px; }
  .sheet-foot { bottom: -24px; margin: 10px -16px -24px; padding: 12px 16px calc(16px + env(safe-area-inset-bottom)); }
  .pop { right: 8px; left: 8px; width: auto; }
  .draw-inner { padding: 22px 16px 60px; }
  .draw-gallery { grid-template-columns: repeat(2, 1fr); gap: 9px; margin-top: 20px; }
  .draw-head h2 { font-size: 17px; }
  .bubble.img-bubble { max-width: 84%; }
  .chat-img { max-width: 100%; }
}

/* ---------------- 首次进入：三选一 ---------------- */
.welcome { position: fixed; inset: 0; z-index: 95; background: rgb(var(--gray-255)); display: none; overflow-y: auto; }
.welcome.show { display: block; }
.welcome-inner { max-width: 1010px; margin: 0 auto; min-height: 100%; display: flex; flex-direction: column; justify-content: center; padding: 26px 24px 24px; }
.welcome-head { text-align: center; margin-bottom: 26px; flex: 0 0 auto; }
.welcome-head h1 { margin: 0 0 10px; font-size: 26px; font-weight: 650; letter-spacing: .6px; }
.welcome-head p { margin: 0; color: rgb(var(--gray-136)); font-size: 14px; }
.wskip {
  margin-top: 14px; padding: 7px 16px; border: 0; background: none;
  color: rgb(var(--gray-168)); font-size: 13px; cursor: pointer; border-radius: 8px;
  transition: color .15s ease, background .15s ease;
}
.wskip:hover { color: rgb(var(--gray-80)); background: rgb(var(--gray-245)); }
.welcome-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.wcard {
  display: flex; flex-direction: column; overflow: hidden;
  background: rgb(var(--gray-255)); border: 1px solid rgb(var(--gray-236)); border-radius: 18px;
  cursor: pointer; transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.wcard:hover { transform: translateY(-3px); border-color: rgb(var(--gray-200)); box-shadow: 0 14px 34px rgba(var(--gray-34), .08); }
.wcard-pic { height: clamp(140px, 29vh, 300px); background: rgb(var(--gray-245)); overflow: hidden; flex: 0 0 auto; }
.wcard-pic img { width: 100%; height: 100%; object-fit: cover; object-position: center 16%; display: block; }
.wcard-body { display: flex; flex-direction: column; flex: 1; padding: 15px 18px 17px; }
.wcard-name { font-size: 18px; font-weight: 650; letter-spacing: .4px; }
.wcard-tag { margin-top: 7px; color: rgb(var(--gray-136)); font-size: 12.5px; }
.wcard-desc { text-wrap: pretty; margin-top: 12px; flex: 1; color: rgb(var(--gray-80)); font-size: 13.5px; line-height: 1.7; }
.wcard-go {
  margin-top: 14px; height: 36px; display: flex; align-items: center; justify-content: center;
  border-radius: 10px; background: rgb(var(--gray-255)); color: rgb(var(--gray-56));
  border: 1px solid rgb(var(--gray-222));
  font-size: 13px; font-weight: 600; letter-spacing: .3px;
  transition: background .16s ease, color .16s ease, border-color .16s ease;
}
.wcard:hover .wcard-go { background: rgb(var(--gray-56)); color: rgb(var(--gray-255)); border-color: rgb(var(--gray-56)); }

@media (max-width: 820px) {
  .welcome-inner { padding: 40px 16px 44px; }
  .welcome-head { margin-bottom: 26px; }
  .welcome-head h1 { font-size: 22px; }
  .welcome-head p { font-size: 13px; }
  .welcome-grid { grid-template-columns: 1fr; gap: 14px; }
  .wcard { flex-direction: row; align-items: stretch; }
  .wcard-pic { flex: 0 0 118px; height: auto; min-height: 118px; }
  .wcard-body { padding: 14px 15px; }
  .wcard-name { font-size: 16px; }
  .wcard-desc { font-size: 12.5px; line-height: 1.65; margin-top: 9px; }
  .wcard-go { margin-top: 12px; height: 34px; font-size: 12.5px; }
}


/* ================= 酒馆能力：侧栏分栏 / 世界书 / 人设 ================= */
.side-tabs { display: flex; gap: 4px; padding: 2px 12px 8px; }
.side-tab {
  flex: 1; height: 32px; border: 1px solid transparent; border-radius: 9px;
  background: transparent; color: var(--fg-3);
  font: inherit; font-size: 12.8px; font-weight: 500; cursor: pointer;
  transition: .15s ease;
}
.side-tab:hover { color: var(--fg-2); background: rgb(var(--gray-255)); }
.side-tab.active { background: rgb(var(--gray-255)); color: var(--fg); border-color: var(--line); box-shadow: var(--shadow-sm); }

.side-pane { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; }
[hidden] { display: none !important; }
.card-settings-head { margin-bottom: 14px; }
.card-settings-head h3 { margin: 0 0 4px; font-size: 15px; }
.card-settings-head p { margin: 0; color: var(--fg-2); font-size: 13px; line-height: 1.5; }
#charSheet label.field > small { margin: 0 0 2px; line-height: 1.45; }
.side-pane[hidden] { display: none; }
.pane-acts { display: flex; gap: 6px; padding: 0 12px 8px; }
.pane-acts .new-char { margin: 0; flex: 1 1 auto; }
.new-char.ghost { border-style: solid; flex: 0 0 auto; padding: 0 12px; font-size: 12.4px; }

.foot-link {
  width: 100%; height: 36px; margin-bottom: 6px;
  display: flex; align-items: center; gap: 7px; padding: 0 10px;
  border: 0; border-radius: 10px; background: transparent;
  color: var(--fg-2); font: inherit; font-size: 12.8px; cursor: pointer;
  transition: .15s ease;
}
.foot-link:hover { background: rgb(var(--gray-255)); color: var(--fg); }
.foot-link svg { opacity: .8; flex: 0 0 auto; }

/* 世界书条目 */
.wi-list { display: flex; flex-direction: column; gap: 8px; }
.wi-item { border: 1px solid var(--line); border-radius: 11px; background: rgb(var(--gray-255)); overflow: hidden; }
.wi-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; cursor: pointer; user-select: none; }
.wi-head b { font-size: 13px; font-weight: 550; color: var(--fg); }
.wi-head small { color: var(--fg-3); font-size: 11px; margin-left: auto; white-space: nowrap; }
.wi-dot { width: 6px; height: 6px; border-radius: 50%; background: rgb(var(--gray-200)); flex: 0 0 auto; }
.wi-dot.on { background: var(--ok); }
.wi-body { display: none; padding: 12px 12px 4px; border-top: 1px solid var(--line); background: rgb(var(--gray-250)); }
.wi-item.open .wi-body { display: block; }
.wi-body .field { margin-bottom: 11px; }
.wi-body .row2 { gap: 10px; }
.wi-flag { display: flex; gap: 14px; flex-wrap: wrap; padding: 2px 0 6px; }
.wi-flag label { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--fg-2); cursor: pointer; }
.wi-flag input { accent-color: rgb(var(--gray-16)); }
.wi-del {
  margin-left: auto; width: 24px; height: 24px; border: 0; border-radius: 7px;
  background: transparent; color: rgb(var(--gray-200)); font-size: 15px; line-height: 1; cursor: pointer;
}
.wi-del:hover { background: rgb(var(--gray-245)); color: var(--bad); }
.wi-empty { padding: 22px 10px; text-align: center; font-size: 12.6px; color: var(--fg-3); }

/* 人设切换 */
.pers-list { display: flex; flex-wrap: wrap; gap: 6px; }
.pers-chip {
  height: 32px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 9px;
  background: rgb(var(--gray-255)); color: var(--fg-2); font: inherit; font-size: 12.5px; cursor: pointer;
  transition: .15s ease;
}
.pers-chip:hover { border-color: rgb(var(--gray-200)); color: var(--fg); }
.pers-chip.active { border-color: var(--fg); color: var(--fg); background: rgb(var(--gray-245)); font-weight: 600; }
.pers-chip.add { border-style: dashed; color: var(--fg-3); }

/* 角色卡 / 世界书在侧栏里的条目 */
.book-item { display: flex; align-items: center; gap: 10px; padding: 10px 10px; border-radius: 12px; cursor: pointer; border: 1px solid transparent; margin-bottom: 2px; }
.book-item:hover { background: rgb(var(--gray-255)); border-color: var(--line); }
.book-item.active { background: rgb(var(--gray-255)); border-color: var(--line-2); box-shadow: var(--shadow-sm); }
.book-ic {
  flex: 0 0 30px; width: 30px; height: 30px; border-radius: 9px;
  display: grid; place-items: center; background: rgb(var(--gray-245)); color: var(--fg-2);
  font-size: 13px;
}
.book-item b { display: block; font-size: 13px; font-weight: 550; color: var(--fg); }
.book-item small { display: block; font-size: 11.2px; color: var(--fg-3); }

.char-fav { margin-left: 4px; color: rgb(var(--gray-168)); font-size: 12px; }

.wb-pick { display: flex; flex-wrap: wrap; gap: 6px; }


/* ===== 提示词结构面板 ===== */
.foot-row { display: flex; gap: 6px; align-items: center; }
.foot-row .foot-link { flex: 1 1 auto; min-width: 0; }
.foot-link.narrow { flex: 0 0 auto; }
.ps-lead { font-size: 12.5px; color: rgb(var(--gray-136)); line-height: 1.75; margin: -6px 0 14px; }
.seg-list { display: flex; flex-direction: column; gap: 8px; }
.seg-row {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 12px; border: 1px solid rgb(var(--gray-236)); border-radius: 12px;
  background: rgb(var(--gray-255)); transition: background .15s, border-color .15s;
}
.seg-row.off { background: rgb(var(--gray-250)); border-color: rgb(var(--gray-236)); }
.seg-main { flex: 1 1 auto; min-width: 0; }
.seg-name { font-size: 13.5px; font-weight: 600; color: rgb(var(--gray-56)); line-height: 1.3; }
.seg-row.off .seg-name { color: rgb(var(--gray-168)); }
.seg-desc { font-size: 11.5px; color: rgb(var(--gray-168)); margin-top: 3px; line-height: 1.5; }
.seg-tok { font-size: 11px; color: rgb(var(--gray-200)); font-variant-numeric: tabular-nums; flex: 0 0 auto; }
.seg-move { display: flex; flex-direction: column; gap: 1px; flex: 0 0 auto; }
.seg-move button {
  width: 28px; height: 19px; border: 0; background: transparent; cursor: pointer;
  color: rgb(var(--gray-200)); font-size: 9px; line-height: 1; padding: 0; border-radius: 3px;
  display: grid; place-items: center;
}
.seg-move button:hover:not(:disabled) { background: rgb(var(--gray-236)); color: rgb(var(--gray-110)); }
.seg-move button:disabled { opacity: .3; cursor: default; }
.seg-sw {
  position: relative; width: 34px; height: 20px; padding: 0; border: 0; flex: 0 0 auto;
  border-radius: 999px; background: rgb(var(--gray-236)); transition: background .18s; cursor: pointer;
}
.seg-sw::after {
  content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px;
  border-radius: 50%; background: rgb(var(--gray-255)); box-shadow: 0 1px 3px rgba(var(--gray-16), .18);
  transition: transform .18s;
}
.seg-sw.on { background: rgb(var(--gray-16)); }
.seg-sw.on::after { transform: translateX(14px); }
.pm-presets.fold { margin-top: 0; margin-bottom: 10px; }
.pm-preset-row { display: flex; gap: 6px; margin-bottom: 8px; }
.pm-preset-row input, .pm-preset-row select {
  flex: 1 1 0; min-width: 0; min-height: 36px; padding: 6px 8px;
  border: 1px solid rgb(var(--gray-222)); border-radius: 8px; background: rgb(var(--gray-250));
  color: var(--fg); font: inherit;
}
.pm-preset-row button { flex-shrink: 0; }
.pm-summary, .pm-hits { font-size: 12px; line-height: 1.55; color: var(--fg-3); margin: 0 0 8px; }
.pm-hits { padding-inline-start: 18px; overflow-wrap: anywhere; }
.pm-preview {
  margin: 0; padding: 12px; border-radius: 10px; background: rgb(var(--gray-250));
  border: 1px solid rgb(var(--gray-236)); font-size: 11.5px; line-height: 1.7; color: rgb(var(--gray-80));
  white-space: pre-wrap; word-break: break-word; max-height: 300px; overflow: auto;
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
}
.fold { border-top: 1px solid rgb(var(--gray-245)); margin-top: 16px; padding-top: 4px; }
.fold summary {
  list-style: none; cursor: pointer; padding: 10px 0; font-size: 13px; color: rgb(var(--gray-110));
  font-weight: 500; display: flex; align-items: center; gap: 6px;
}
.fold summary::-webkit-details-marker { display: none; }
.fold summary::before { content: '›'; font-size: 15px; color: rgb(var(--gray-200)); transition: transform .18s; }
.fold[open] summary::before { transform: rotate(90deg); }
.fold-in { padding: 2px 0 6px; }
@media (max-width: 640px) {
  .seg-row { padding: 10px; gap: 8px; }
  .seg-desc { font-size: 11px; }
}



/* ===== 模型列表 ===== */
.model-row { display: flex; gap: 8px; align-items: center; }
.model-row input { flex: 1 1 auto; min-width: 0; }
.model-picker {
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg-soft, var(--bg));
  padding: 8px;
}
.model-picker-filter {
  width: 100%;
  margin-bottom: 6px;
  padding: 7px 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--fg);
  font-size: 12.5px;
}
.model-picker-list {
  max-height: 180px;
  overflow-y: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.model-picker-item {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--fg);
  font-size: 12px;
  cursor: pointer;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.model-picker-item.active,
.model-picker-item:hover {
  border-color: var(--fg);
  background: var(--fg);
  color: var(--bg);
}
.mini-btn {
  flex: 0 0 auto; height: 40px; padding: 0 13px; border: 1px solid rgb(var(--gray-236));
  background: rgb(var(--gray-255)); border-radius: 10px; font-size: 12.5px; color: rgb(var(--gray-56));
  cursor: pointer; white-space: nowrap; transition: background .15s;
}
.mini-btn:hover:not(:disabled) { background: rgb(var(--gray-245)); }
.mini-btn:disabled { opacity: .5; cursor: default; }


/* ===== 空间切换：虚拟恋人 / 酒馆 ===== */
.space-switch {
  display: flex; gap: 3px; margin: 12px 12px 6px; padding: 3px;
  background: rgb(var(--gray-245)); border-radius: 10px;
}
.space-btn {
  flex: 1 1 0; height: 32px; border: 0; background: transparent; border-radius: 8px;
  font-size: 12.5px; color: rgb(var(--gray-136)); cursor: pointer; font-weight: 500;
  transition: background .15s, color .15s; font-family: inherit;
}
.space-btn:hover:not(.active) { color: rgb(var(--gray-80)); }
.space-btn.active {
  background: rgb(var(--gray-255)); color: rgb(var(--gray-16)); font-weight: 600;
  box-shadow: 0 1px 3px rgba(var(--gray-16), .1);
}
.pane-acts { display: flex; gap: 6px; }
.pane-acts .new-char { flex: 1 1 0; min-width: 0; }
.pane-acts .new-char.ghost { flex: 0 0 auto; padding-left: 10px; padding-right: 10px; }
@media (max-width: 640px) {
  .space-switch { margin: 10px 10px 4px; }
  .space-btn { height: 34px; font-size: 13px; }
}

/* 底部两个入口并排：覆盖单独一排时的 width:100% */
.foot-row .foot-link { width: auto; margin-bottom: 0; padding: 0 9px; }
.foot-link span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.foot-row { margin-bottom: 8px; }

/* 画图入口缩成 brand 旁边的小动作，别和空间切换抢层级 */
.side-brand { flex: 1 1 auto; }
.draw-entry {
  flex: 0 0 auto !important; height: 30px !important; padding: 0 10px !important;
  font-size: 12.3px !important; border-radius: 9px !important; gap: 5px !important;
}


/* ================= 广场 ================= */
.square-view { display: none; flex: 1 1 auto; min-height: 0; overflow-y: auto; }
.square-view::-webkit-scrollbar { width: 10px; }
.square-view::-webkit-scrollbar-thumb { background: rgb(var(--gray-236)); border-radius: 8px; border: 3px solid rgb(var(--gray-255)); }
body.square-mode .square-view { display: block; }
body.square-mode .chat-head,
body.square-mode .messages,
body.square-mode .composer-wrap,
body.square-mode .pop,
body.square-mode .draw-view,
body.square-mode .side-foot { display: none !important; }

.sq-inner { max-width: 980px; margin: 0 auto; padding: 30px 24px 70px; }
.sq-head { margin-bottom: 22px; }
.sq-head h1 { margin: 0 0 6px; font-size: 24px; font-weight: 650; letter-spacing: .3px; }
.sq-head p { margin: 0; font-size: 13.4px; color: var(--fg-2); line-height: 1.7; }

.sq-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.sq-segs { display: inline-flex; gap: 2px; background: rgb(var(--gray-245)); border-radius: 10px; padding: 3px; }
.sq-seg {
  border: 0; background: transparent; color: var(--fg-2);
  font: inherit; font-size: 13px; font-weight: 500;
  padding: 6px 14px; border-radius: 8px; cursor: pointer; transition: .15s ease;
}
.sq-seg:hover { color: var(--fg); }
.sq-seg.active { background: rgb(var(--gray-255)); color: var(--fg); font-weight: 600; box-shadow: 0 1px 3px rgba(var(--gray-16), .08); }
.sq-segs.small .sq-seg { padding: 5px 12px; font-size: 12.6px; }
.sq-search {
  flex: 1 1 180px; min-width: 140px; max-width: 280px; height: 34px;
  padding: 0 12px; border: 1px solid var(--line); border-radius: 9px;
  background: rgb(var(--gray-255)); color: var(--fg); font: inherit; font-size: 13px;
  outline: none; transition: border-color .15s ease;
}
.sq-search:focus { border-color: var(--fg-2); }
.sq-right { display: flex; align-items: center; gap: 8px; }
.sq-pub {
  border: 1px solid var(--fg); background: var(--fg); color: rgb(var(--gray-255));
  font: inherit; font-size: 13px; font-weight: 550;
  padding: 8px 16px; border-radius: 9px; cursor: pointer; transition: .16s ease;
}
.sq-pub:hover { background: rgb(var(--gray-0)); }

.sq-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(184px, 1fr)); gap: 16px; }
.sq-card {
  border: 1px solid var(--line); border-radius: 14px; background: rgb(var(--gray-255));
  overflow: hidden; cursor: pointer; transition: .18s ease;
  display: flex; flex-direction: column;
}
.sq-card:hover { border-color: rgb(var(--gray-222)); box-shadow: 0 4px 16px rgba(var(--gray-16), .07); transform: translateY(-1px); }
.sq-cover { position: relative; aspect-ratio: 4 / 5; background: rgb(var(--gray-245)); overflow: hidden; }
.sq-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sq-cover .ph {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 34px; font-weight: 600; color: rgb(var(--gray-200)); letter-spacing: 2px;
}
.sq-badge {
  position: absolute; top: 9px; left: 9px;
  background: rgba(var(--gray-255), .94); color: var(--fg-2);
  font-size: 11px; font-weight: 550; padding: 3px 8px; border-radius: 6px;
  backdrop-filter: blur(4px);
}
.sq-body { padding: 11px 12px 12px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.sq-name { font-size: 13.6px; font-weight: 600; margin: 0; line-height: 1.4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sq-sum {
  font-size: 12.2px; color: var(--fg-2); line-height: 1.55; margin: 0;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  min-height: 38px;
}
.sq-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; }
.sq-author { display: flex; align-items: center; gap: 5px; min-width: 0; }
.sq-author img, .sq-author .av {
  width: 16px; height: 16px; border-radius: 50%; object-fit: cover; flex: 0 0 auto;
  background: rgb(var(--gray-236)); display: flex; align-items: center; justify-content: center;
  font-size: 9px; color: rgb(var(--gray-136));
}
.sq-author span { font-size: 11.4px; color: var(--fg-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sq-nums { display: flex; gap: 9px; font-size: 11.4px; color: var(--fg-3); flex: 0 0 auto; }
.sq-nums b { font-weight: 500; }

.sq-empty { padding: 60px 20px; text-align: center; font-size: 13.4px; color: var(--fg-3); line-height: 1.8; }
.sq-more { display: flex; justify-content: center; padding: 26px 0 0; }

/* 详情 */
.po-cover {
  width: 100%; aspect-ratio: 4 / 5; max-height: 400px;
  border-radius: 13px; overflow: hidden; background: rgb(var(--gray-245)); margin-bottom: 16px;
  position: relative;
}
.po-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.po-cover .ph { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 46px; color: rgb(var(--gray-200)); }
.po-desc { font-size: 13.4px; line-height: 1.75; color: var(--fg-2); margin: 0 0 16px; white-space: pre-wrap; }
.po-ops { display: flex; align-items: center; gap: 9px; margin-bottom: 20px; flex-wrap: wrap; }
.po-like {
  border: 1px solid var(--line-2); background: rgb(var(--gray-255)); color: var(--fg-2);
  font: inherit; font-size: 13px; padding: 9px 15px; border-radius: 9px;
  cursor: pointer; transition: .16s ease; display: inline-flex; align-items: center; gap: 5px;
}
.po-like:hover { border-color: rgb(var(--gray-200)); }
.po-like.on { border-color: rgb(var(--gray-200)); background: rgb(var(--gray-245)); color: rgb(var(--gray-110)); }
.po-import { width: auto; flex: 1; min-width: 130px; padding: 9px 16px; font-size: 13px; }
.po-sec { font-size: 12.4px; color: var(--fg-2); font-weight: 600; letter-spacing: .2px; margin: 0 0 11px; padding-top: 4px; border-top: 1px solid var(--line); padding-top: 16px; }
.po-cms { display: flex; flex-direction: column; gap: 13px; margin-bottom: 14px; }
.po-cm { display: flex; gap: 9px; }
.po-cm-av {
  width: 26px; height: 26px; border-radius: 50%; flex: 0 0 auto; object-fit: cover;
  background: rgb(var(--gray-236)); display: flex; align-items: center; justify-content: center;
  font-size: 11px; color: rgb(var(--gray-136));
}
.po-cm-main { min-width: 0; flex: 1; }
.po-cm-top { display: flex; align-items: baseline; gap: 7px; margin-bottom: 3px; }
.po-cm-top b { font-size: 12.4px; font-weight: 600; }
.po-cm-top span { font-size: 11px; color: var(--fg-3); }
.po-cm-main p { margin: 0; font-size: 13px; line-height: 1.65; color: var(--fg); word-break: break-word; }
.po-input-row { margin-top: 4px; }

/* 表单：验证码行 / 下拉框 */
.code-row { display: flex; gap: 8px; align-items: center; }
.code-row input { flex: 1; min-width: 0; }
.code-row .mini-btn { flex: 0 0 auto; height: 38px; padding: 0 12px; }
.field select {
  width: 100%; border: 1px solid var(--line-2); border-radius: var(--r-sm);
  background: rgb(var(--gray-250)); padding: 10px 12px; font: inherit; font-size: 13.6px;
  color: var(--fg); outline: 0; cursor: pointer; appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6'><path d='M1 1l4 4 4-4' stroke='%238a8f99' stroke-width='1.5' fill='none' stroke-linecap='round'/></svg>");
  background-repeat: no-repeat; background-position: right 12px center;
}
.field select:focus { border-color: rgb(var(--gray-200)); background-color: rgb(var(--gray-255)); }

/* 注册与登录入口 */
#authBoot { display: none; }
body.auth-pending #authBoot {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0; inset: 0; z-index: 135; display: grid; align-content: center; justify-items: center;
  gap: 12px; padding: 24px; background: rgb(var(--gray-255)); color: var(--fg);
}
#authBoot strong { font-size: 28px; font-weight: 650; }
#authBoot p { margin: 0; color: var(--fg-2); font-size: 14px; text-align: center; }
#authRetry { min-height: 46px; padding: 10px 20px; border: 1px solid var(--line); border-radius: 12px; background: var(--fg); color: rgb(var(--gray-255)); font: inherit; cursor: pointer; }
body.auth-pending #app,
body.auth-required #app,
body.auth-pending .sheet:not(#authSheet),
body.auth-required .sheet:not(#authSheet),
body.auth-pending .sheet-mask:not(#authMask),
body.auth-required .sheet-mask:not(#authMask),
body.auth-pending .h5-shade,
body.auth-required .h5-shade,
body.auth-pending .h5-toast,
body.auth-required .h5-toast,
body.auth-pending .mj-mask,
body.auth-required .mj-mask,
body.auth-pending .bp-mask,
body.auth-required .bp-mask,
body.auth-pending .grp-mask,
body.auth-required .grp-mask,
body.auth-pending .onboard-mask,
body.auth-required .onboard-mask,
body.auth-pending .h5-ctx-mask,
body.auth-required .h5-ctx-mask { display: none !important; }
body.auth-required { overflow: hidden; background: rgb(var(--gray-255)); }
body.auth-required #authMask { position: fixed; top: 0; right: 0; bottom: 0; left: 0; inset: 0; z-index: 130; display: block; visibility: visible; opacity: 1; background: rgb(var(--gray-255)); }
body.auth-required #authSheet {
  position: fixed; top: var(--h5-top, 0px); right: 0; bottom: auto; left: 0; inset: var(--h5-top, 0px) 0 auto; z-index: 131;
  display: flex; flex-direction: column; width: 100%; height: var(--h5-height, 100dvh); max-height: none;
  margin: 0; padding: max(64px, env(safe-area-inset-top)) max(28px, env(safe-area-inset-left), env(safe-area-inset-right)) max(48px, env(safe-area-inset-bottom));
  border: 0; border-radius: 0; overflow: auto; overscroll-behavior: contain;
  transform: none; visibility: visible; background: rgb(var(--gray-255)); box-shadow: none; transition: none;
}
body.auth-required .auth-form-panel { flex: 0 0 auto; width: 100%; max-width: 400px; margin: auto; }
#authSheet .sheet-head { margin-bottom: 36px; align-items: flex-start; }
#authSheet .sheet-head h3 { margin: 0; color: var(--fg); font-size: 32px; font-weight: 650; letter-spacing: -.8px; line-height: 1.35; }
#authTitle:focus { outline: none; }
#authSheet .sheet-sub { margin: 12px 0 0; color: var(--fg-2); font-size: 14px; line-height: 1.7; }
#authSheet .field { margin-bottom: 24px; }
#authSheet .field > span,
#authSheet .field > label { display: block; margin: 0 0 10px; color: var(--fg); font-size: 14px; line-height: 1.5; }
#authSheet .field > span small { display: inline; margin: 0 0 0 7px; color: var(--fg-3); font-size: 12px; }
#authSheet input {
  width: 100%; min-width: 0; min-height: 54px; padding: 14px 16px; border: 1px solid var(--line-2); border-radius: 12px;
  background: rgb(var(--gray-255)); color: var(--fg); font: inherit; font-size: 16px; line-height: 1.5;
}
#authSheet input::placeholder { color: var(--fg-3); opacity: 1; }
#authSheet input:focus-visible { outline: 2px solid var(--fg); outline-offset: 2px; }
#authSheet button:focus-visible,
#authSheet a:focus-visible { outline: 2px solid var(--fg); outline-offset: 3px; }
#authSheet .code-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
#authSheet #auSend {
  min-height: 54px; padding: 0 16px; border: 1px solid var(--line-2); border-radius: 12px;
  background: rgb(var(--gray-250)); color: var(--fg); font: inherit; font-size: 13px; white-space: nowrap; cursor: pointer;
}
.auth-password-row { position: relative; }
#authSheet .auth-password-row input { padding-right: 64px; }
#auPasswordToggle { position: absolute; top: 1px; right: 2px; bottom: 1px; width: 58px; padding: 0; border: 0; border-radius: 10px; background: transparent; color: var(--fg-2); font: inherit; font-size: 13px; cursor: pointer; }
#authSheet #authOut { min-height: 0; margin: 0; padding: 0; color: var(--fg-2); font-size: 13px; line-height: 1.7; overflow-wrap: anywhere; }
#authSheet #authOut:not(:empty) { margin: 0 0 18px; }
#authSheet #auGo {
  width: 100%; min-height: 56px; margin-top: 6px; border: 1px solid var(--fg); border-radius: 12px;
  background: var(--fg); color: rgb(var(--gray-255)); font: inherit; font-size: 16px; font-weight: 600; cursor: pointer;
}
#authSheet button:disabled { opacity: .5; cursor: default; }
#authSheet .auth-switch { margin: 22px 0 0; text-align: center; }
#authSheet #auToggle { min-height: 42px; padding: 6px 4px; color: var(--fg-2); font-size: 14px; }
.auth-free-note { margin: 32px 0 0; color: var(--fg-3); font-size: 12px; line-height: 1.8; text-align: center; }
.auth-free-note span { padding: 0 8px; }
@media (max-width: 640px) {
  body.auth-required .auth-form-panel { margin-block: 0 auto; }
}
@media (max-width: 360px) {
  body.auth-required #authSheet { padding-inline: max(24px, env(safe-area-inset-left), env(safe-area-inset-right)); }
  #authSheet #auSend { padding-inline: 12px; }
}
.auth-switch { margin: 2px 0 14px; }
.sheet.wide { width: min(520px, 100%); }

@media (max-width: 640px) {
  .sq-inner { padding: 18px 14px 60px; }
  .sq-head h1 { font-size: 20px; }
  .sq-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
  .sq-body { padding: 9px 10px 10px; }
  .sq-name { font-size: 12.8px; }
  .sq-sum { font-size: 11.6px; -webkit-line-clamp: 2; min-height: 34px; }
  .sq-bar { gap: 8px; }
  .sq-pub { padding: 7px 13px; font-size: 12.4px; }
  .po-cover { max-height: 320px; }
  .draw-entry { height: 28px !important; padding: 0 8px !important; font-size: 11.8px !important; }
}

.who-btn {
  display: flex; align-items: center; gap: 8px; width: 100%;
  border: 0; background: transparent; padding: 8px 9px; margin-bottom: 6px;
  border-radius: 9px; font: inherit; font-size: 12.8px; color: var(--fg-2);
  cursor: pointer; transition: .15s ease; text-align: left;
}
.who-btn:hover { background: rgb(var(--gray-245)); color: var(--fg); }
.who-av {
  width: 22px; height: 22px; border-radius: 50%; flex: 0 0 auto;
  background: rgb(var(--gray-236)); color: rgb(var(--gray-136));
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 600; overflow: hidden;
}
.who-av img { width: 100%; height: 100%; object-fit: cover; }
.who-av.guest { border: 1px dashed rgb(var(--gray-222)); background: rgb(var(--gray-255)); color: rgb(var(--gray-200)); }
.pf-av-row { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.pf-av {
  width: 62px; height: 62px; border-radius: 50%; flex: 0 0 auto;
  background: rgb(var(--gray-236)); color: rgb(var(--gray-136)); overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 600;
}
.pf-av img { width: 100%; height: 100%; object-fit: cover; }
.pf-hint { margin: 6px 0 0; font-size: 11.2px; color: var(--fg-3); }


/* 详情弹层：对齐与比例微调 */
.po-ops { align-items: stretch; }
.po-like { min-height: 38px; padding: 9px 18px; justify-content: center; }
.po-import { min-height: 38px; }
.po-cover { aspect-ratio: 3 / 4; max-height: 288px; }
.po-cm-av { width: 30px; height: 30px; font-size: 12px; }
.po-cm { gap: 10px; }
.po-cms { gap: 15px; margin-bottom: 18px; }
.po-sec { margin-bottom: 13px; }
.po-input-row { align-items: stretch; }
.po-input-row input { height: 40px; padding: 0 13px; }
.po-input-row .mini-btn { height: 40px !important; padding: 0 16px; }

.test-btn.danger.armed { background: rgb(var(--gray-110)) !important; border-color: rgb(var(--gray-110)) !important; color: rgb(var(--gray-255)) !important; }

/* 文件选择框：display:none 在部分环境会让 input.click() 失效，改成移出视口 */
.hidden-file {
  position: fixed !important;
  left: -9999px !important; top: 0 !important;
  width: 1px; height: 1px; opacity: 0;
  pointer-events: none;
  display: block !important;
}

/* 品牌行（月见 + 广场 + 画图）只在首页/聊天页出现；
   广场、画图是独立页面，各自有自己的标题，不再重复一行品牌 */
body.square-mode .side-head,
body.draw-mode .side-head { display: none !important; }

/* 这两个页面的返回按钮，桌面端也要有，否则进去出不来 */
#sqBack, #drawBack { display: inline-flex !important; }

/* ---------------- 聊天页背景图 ----------------
   用「渐变 + 图」两层 background-image 叠在一起实现压暗，
   不额外加 DOM 层，也就不影响 #messages 的滚动结构。
   --chatbg-dim 由角色设置里的滑块写入（0 = 不压暗）。 */
#messages.has-chat-bg {
  background-image:
    linear-gradient(rgba(255, 255, 255, var(--chatbg-dim, 0.22)),
                    rgba(255, 255, 255, var(--chatbg-dim, 0.22))),
    var(--chatbg);
  background-size: cover, cover;
  background-position: center, center;
  background-repeat: no-repeat, no-repeat;
  background-attachment: fixed, fixed;
}
[data-theme="dark"] #messages.has-chat-bg {
  background-image:
    linear-gradient(rgba(0, 0, 0, var(--chatbg-dim, 0.45)),
                    rgba(0, 0, 0, var(--chatbg-dim, 0.45))),
    var(--chatbg);
}
/* 有背景时给气泡一点底色，保证长段文字仍然清楚 */
#messages.has-chat-bg .bubble {
  backdrop-filter: blur(8px);
}
@media (max-width: 780px) {
  #messages.has-chat-bg { background-attachment: scroll, scroll; }
}

/* ---------------- 多人群聊 ---------------- */
.grp-mask {
  position: fixed; inset: 0; z-index: 220;
  background: rgba(0, 0, 0, .48);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  isolation: isolate;
  transform: translate3d(0, 0, 0);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}
.grp-card {
  width: 100%; max-width: 384px; max-height: 78vh;
  display: flex; flex-direction: column;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 22px; padding: 20px 18px 14px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .22);
  position: relative;
  z-index: 1;
}
/* 打开全屏弹窗时暂停底层聊天气泡的 backdrop-filter，避免安卓 WebView/Chromium GPU 分块合成穿透撕裂与卡死 */
body.grp-modal-open #messages .bubble,
body.grp-modal-open #messages .row .bubble {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
[data-theme="dark"] .grp-card { background: #1a1c22; border-color: rgba(255, 255, 255, .10); }
.grp-title { margin: 0 0 6px; font-size: 16px; }
.grp-hint { margin: 0 0 14px; font-size: 12px; line-height: 1.5; color: #8a8a8a; }
.grp-list { flex: 1 1 auto; overflow-y: auto; margin: 0 -4px; padding: 0 4px; }
.grp-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 8px; border-radius: 12px; cursor: pointer;
}
.grp-row:hover { background: rgba(0, 0, 0, .04); }
[data-theme="dark"] .grp-row:hover { background: rgba(255, 255, 255, .06); }
.grp-row input { width: 17px; height: 17px; accent-color: #111; flex: none; }
.grp-av {
  width: 34px; height: 34px; border-radius: 10px; flex: none;
  overflow: hidden; display: block; background: #eee;
}
.grp-av img { width: 100%; height: 100%; object-fit: cover; }
.grp-info { display: flex; flex-direction: column; min-width: 0; }
.grp-name { font-size: 14px; font-weight: 500; }
.grp-sub { font-size: 11px; color: #9a9a9a; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grp-foot { display: flex; gap: 10px; padding-top: 14px; }
.grp-foot .test-btn { flex: 0 0 auto; }
.grp-foot .save-btn { flex: 1 1 auto; }

/* 群聊资料编辑弹窗（群头像 + 群名称） */
.grp-prof-card { max-width: 390px; }
.grp-prof-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-bottom: 14px;
}
.grp-prof-head h3 { margin: 0; font-size: 16.5px; font-weight: 700; }
.grp-prof-close {
  width: 30px; height: 30px; border-radius: 50%; border: 0;
  background: rgba(0, 0, 0, .06); color: inherit;
  font-size: 18px; line-height: 1; cursor: pointer;
  display: grid; place-items: center; flex: none;
}
[data-theme="dark"] .grp-prof-close { background: rgba(255, 255, 255, .1); }
.grp-prof-av-row { display: flex; align-items: center; gap: 14px; }
.grp-prof-av {
  width: 64px; height: 64px; flex: none;
  border-radius: 18px; overflow: hidden;
  display: grid; place-items: center;
  font-size: 22px; font-weight: 700;
  background: rgba(0, 0, 0, .06); color: inherit;
  border: 1px solid rgba(0, 0, 0, .08);
}
[data-theme="dark"] .grp-prof-av {
  background: rgba(255, 255, 255, .09);
  border-color: rgba(255, 255, 255, .12);
}
.grp-prof-av img { width: 100%; height: 100%; object-fit: cover; display: block; }
.grp-prof-av-ops { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.grp-prof-av-btns { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.grp-prof-av-ops .grp-hint { margin: 0; }
.grp-prof-input {
  width: 100%; box-sizing: border-box;
  padding: 11px 13px; border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, .12);
  background: rgba(0, 0, 0, .025);
  color: inherit; font: inherit; font-size: 14.5px;
  outline: none; transition: border-color .15s ease, background .15s ease;
}
.grp-prof-input:focus,
.grp-prof-input:focus-visible {
  border-color: #111;
  background: #fff;
  outline: none;
  box-shadow: 0 0 0 3px rgba(17, 17, 17, .07);
}
[data-theme="dark"] .grp-prof-input {
  border-color: rgba(255, 255, 255, .14);
  background: rgba(255, 255, 255, .06);
}
[data-theme="dark"] .grp-prof-input:focus {
  border-color: rgba(255, 255, 255, .55);
  background: rgba(255, 255, 255, .1);
}

/* 微信风格群聊拼格头像（2~9人自动排列） */
.has-grp-grid {
  background: #e5e7eb !important;
  padding: 2px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
}
[data-theme="dark"] .has-grp-grid {
  background: #2b2e34 !important;
}
.h5-chat-ava.has-grp-grid {
  border-radius: 10px !important;
}
.h5-avatar.has-grp-grid {
  border-radius: 12px !important;
}
.grp-grid {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 2px;
}
.grp-grid-row {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2px;
}
.grp-grid-tile {
  aspect-ratio: 1 / 1;
  flex: 0 0 auto;
  border-radius: 3px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: #d1d5db;
  color: #374151;
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
}
[data-theme="dark"] .grp-grid-tile {
  background: #3f434c;
  color: #e5e7eb;
}
.grp-grid-2 .grp-grid-tile { width: calc((100% - 2px) / 2); }
.grp-grid-3 .grp-grid-tile { width: calc((100% - 4px) / 3); border-radius: 2px; font-size: 8px; }
.grp-grid-tile img {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  object-fit: cover;
  display: block;
  border-radius: 0 !important;
}

/* 创建群聊弹窗顶部的群头像与群名称设置区 */
.grp-create-card { max-width: 400px; }
.grp-create-setup {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  margin-bottom: 10px;
  border-radius: 14px;
  background: rgba(0, 0, 0, .028);
  border: 1px solid rgba(0, 0, 0, .07);
}
[data-theme="dark"] .grp-create-setup {
  background: rgba(255, 255, 255, .04);
  border-color: rgba(255, 255, 255, .09);
}
.grp-create-av {
  width: 56px;
  height: 56px;
  flex: none;
  border-radius: 14px;
  overflow: hidden;
  display: grid;
  place-items: center;
  font-size: 18px;
  font-weight: 700;
  background: rgba(0, 0, 0, .06);
  color: inherit;
  border: 1px solid rgba(0, 0, 0, .08);
  cursor: pointer;
}
.grp-create-av img { width: 100%; height: 100%; object-fit: cover; display: block; }
.grp-create-fields {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.grp-create-fields .grp-prof-input {
  padding: 8px 11px;
  font-size: 13.5px;
  border-radius: 10px;
}
.grp-create-av-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.grp-create-av-bar .test-btn {
  padding: 4px 9px;
  font-size: 11.5px;
  min-height: 0;
}
.grp-create-av-tip {
  font-size: 11px;
  color: #888;
}

/* 角色主动发消息时的站内微信式顶部轻提醒浮条 */
.proactive-banner {
  position: fixed;
  top: max(12px, env(safe-area-inset-top));
  left: 50%;
  transform: translate(-50%, -18px);
  opacity: 0;
  z-index: 160;
  width: min(358px, calc(100vw - 24px));
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 13px;
  border-radius: 18px;
  border: 1px solid rgba(17, 17, 17, .08);
  background: rgba(255, 255, 255, .92);
  color: #111;
  box-shadow: 0 12px 32px rgba(15, 23, 42, .14), 0 2px 8px rgba(15, 23, 42, .06);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  text-align: left;
  font: inherit;
  cursor: pointer;
  transition: transform .26s cubic-bezier(.2, .85, .3, 1), opacity .22s ease;
}
.proactive-banner.show {
  transform: translate(-50%, 0);
  opacity: 1;
}
[data-theme="dark"] .proactive-banner {
  background: rgba(28, 30, 34, .92);
  color: #f3f4f6;
  border-color: rgba(255, 255, 255, .12);
}
.proactive-banner-av {
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: 12px;
  overflow: hidden;
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 700;
  background: rgba(0, 0, 0, .06);
}
.proactive-banner-av img { width: 100%; height: 100%; object-fit: cover; display: block; }
.proactive-banner-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.proactive-banner-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.proactive-banner-top strong {
  font-size: 13.5px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.proactive-banner-time {
  font-size: 11px;
  color: #888;
  flex: none;
}
.proactive-banner-text {
  font-size: 12.5px;
  color: #555;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
[data-theme="dark"] .proactive-banner-text { color: #b5bcc8; }

/* 群聊气泡上方的说话人名字 */
.bubble .speaker-name {
  display: block; font-size: 11px; font-weight: 600;
  opacity: .55; margin-bottom: 3px; letter-spacing: .3px;
}

/* ---------------- 聊天设置面板（背景 + 纯爱开关） ---------------- */
.cs-card { max-width: 400px; max-height: 84vh; overflow-y: auto; overscroll-behavior: contain; }
.cs-card .cs-sec { flex-shrink: 0; }
.cs-card .grp-foot { flex-shrink: 0; position: sticky; bottom: -14px; background: inherit; padding: 12px 0 6px; margin-top: 4px; z-index: 2; }
.cs-sec { margin-bottom: 14px; }
.cs-label { font-size: 12px; font-weight: 600; opacity: .55; margin-bottom: 8px; }

.cs-switch {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 11px 12px; border-radius: 12px; cursor: pointer; text-align: left;
  border: 1px solid rgba(0, 0, 0, .09); background: rgba(0, 0, 0, .02);
  font: inherit; color: inherit;
}
.cs-switch.on { border-color: #111; background: rgba(0, 0, 0, .055); }
.cs-switch-name { font-size: 14px; font-weight: 600; flex: none; }
.cs-switch-desc { flex: 1; min-width: 0; font-size: 11px; opacity: .55; line-height: 1.35; }
.cs-knob {
  flex: none; width: 38px; height: 22px; border-radius: 11px;
  background: rgba(0, 0, 0, .2); position: relative; transition: background .18s;
}
.cs-knob::after {
  content: ''; position: absolute; top: 3px; left: 3px;
  width: 16px; height: 16px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .18s;
}
.cs-switch.on .cs-knob { background: #111; }
.cs-switch.on .cs-knob::after { transform: translateX(16px); }

[data-theme="dark"] .cs-switch { border-color: rgba(255, 255, 255, .12); background: rgba(255, 255, 255, .05); }
[data-theme="dark"] .cs-switch.on { border-color: #fff; background: rgba(255, 255, 255, .1); }
[data-theme="dark"] .cs-knob { background: rgba(255, 255, 255, .25); }
[data-theme="dark"] .cs-switch.on .cs-knob { background: #fff; }
[data-theme="dark"] .cs-switch.on .cs-knob::after { background: #111; }

/* 聊天设置面板微调：说明文字换行、按钮描边、对比度 */
.cs-switch { flex-wrap: wrap; }
.cs-switch-name { order: 1; flex: 1 1 auto; }
.cs-knob { order: 2; }
.cs-switch-desc {
  order: 3; flex-basis: 100%; margin-top: 5px;
  font-size: 11.5px; opacity: .68; line-height: 1.4;
}
.cs-card .chatbg-ops .test-btn {
  border: 1px solid rgba(0, 0, 0, .14);
  background: rgba(0, 0, 0, .035);
}
[data-theme="dark"] .cs-card .chatbg-ops .test-btn {
  border-color: rgba(255, 255, 255, .18);
  background: rgba(255, 255, 255, .07);
}
.cs-card .grp-hint { opacity: .7; }

/* 云端历史版本（聊天设置内） */
.cs-hist-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin-bottom: 6px;
}
.cs-hist-head .cs-label { margin-bottom: 0; }
.cs-hist-status { font-size: 11.5px; opacity: .68; margin-bottom: 8px; }
.cs-hist-list {
  display: flex; flex-direction: column; gap: 6px;
  max-height: 200px; overflow-y: auto;
}
.cs-hist-item {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 10px; border-radius: 10px;
  border: 1px solid rgba(0, 0, 0, .09); background: rgba(0, 0, 0, .02);
}
.cs-hist-info { min-width: 0; flex: 1; }
.cs-hist-ver { font-size: 12.5px; font-weight: 600; line-height: 1.35; }
.cs-hist-meta { font-size: 11px; opacity: .62; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cs-hist-btn {
  flex: none; padding: 4px 10px; border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, .14); background: #fff; color: #111;
  font: inherit; font-size: 12px; cursor: pointer;
}
.cs-hist-btn:hover { background: rgba(0, 0, 0, .05); }
.cs-hist-btn:disabled { opacity: .45; cursor: default; }
[data-theme="dark"] .cs-hist-item { border-color: rgba(255, 255, 255, .12); background: rgba(255, 255, 255, .04); }
[data-theme="dark"] .cs-hist-btn { border-color: rgba(255, 255, 255, .18); background: rgba(255, 255, 255, .08); color: #f5f5f5; }
[data-theme="dark"] .cs-hist-btn:hover { background: rgba(255, 255, 255, .14); }

/* ================= 富文本消息 / 停止生成 / 快捷栏 / 群聊点名 / 场景画图 / 文档预览 ================= */
.rp-action {
  font-style: italic;
  opacity: .72;
}
.rp-paren {
  opacity: .64;
  font-size: .92em;
  letter-spacing: .015em;
}
.rp-quote {
  display: inline-block;
  padding-left: 9px;
  margin: 2px 0;
  border-left: 2.5px solid rgba(var(--gray-128), .45);
  opacity: .86;
}
.rp-gap {
  display: block;
  height: 7px;
  line-height: 0;
  font-size: 0;
}

.composer button.composer-tool {
  width: 34px; height: 34px;
  margin-bottom: 2px;
  background: transparent;
  color: rgb(var(--gray-128));
  border-radius: 50%;
}
.composer button.composer-tool:hover:not(:disabled) {
  background: rgba(var(--gray-128), .1);
  color: var(--fg);
}
.composer button.composer-tool[hidden],
.group-bar[hidden],
.sq-author-bar[hidden] { display: none !important; }

.composer button#sendBtn.is-stop {
  background: transparent;
  color: var(--fg);
  border: 1.5px solid var(--fg);
}
.composer button#sendBtn.is-stop:hover:not(:disabled) {
  background: var(--fg);
  color: rgb(var(--gray-255));
}

.group-bar {
  max-width: 860px; margin: 0 auto 8px;
  display: flex; align-items: center; gap: 6px;
  flex-wrap: wrap;
  padding: 0 2px;
}
.group-bar-label {
  font-size: 11.5px; color: rgb(var(--gray-145)); margin-right: 2px;
}
.group-pill {
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: rgb(var(--gray-255));
  color: var(--fg);
  font: inherit; font-size: 12px; line-height: 1.35;
  cursor: pointer; transition: .15s ease;
}
.group-pill:hover { border-color: rgb(var(--gray-160)); }
.group-pill.active {
  background: var(--fg);
  color: rgb(var(--gray-255));
  border-color: var(--fg);
}
.group-pill.group-nudge {
  margin-left: auto;
  border-style: dashed;
}

.tavern-message-controls {
  display: flex; align-items: center; gap: 4px; flex-wrap: wrap;
}
.msg-quick-btn {
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: rgb(var(--gray-140));
  font: inherit; font-size: 11px; line-height: 1.45;
  cursor: pointer; transition: .15s ease;
}
.msg-quick-btn:hover { color: var(--fg); border-color: var(--line-2); background: rgba(var(--gray-128), .08); }
.msg-quick-btn.playing {
  background: var(--fg); color: rgb(var(--gray-255)); border-color: var(--fg);
}

.role-memory-edit {
  width: 100%; box-sizing: border-box;
  margin-top: 8px; padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line-2);
  background: rgb(var(--gray-255));
  color: var(--fg);
  font: inherit; font-size: 13.5px; line-height: 1.6;
  resize: vertical; outline: none;
}
.role-memory-edit:focus { border-color: var(--fg); }

.chat-draw-sizes {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  margin: 8px 0 10px;
}
.chat-draw-status {
  margin: 0 0 10px;
  padding: 8px 11px;
  border-radius: 12px;
  font-size: 12.5px;
  line-height: 1.5;
  background: rgba(var(--gray-128), .08);
  color: var(--fg);
}
.chat-draw-status.err {
  background: rgba(214, 69, 69, .09);
  color: #c73838;
}
.chat-draw-status.ok {
  background: rgba(46, 160, 96, .1);
  color: #217a48;
}

.doc-prev-card { max-width: 520px; }
.doc-prev-list {
  display: flex; flex-direction: column; gap: 8px;
  max-height: 52vh; overflow-y: auto;
  margin: 10px 0 14px; padding-right: 2px;
}
.doc-prev-sec { font-size: 12px; font-weight: 600; color: rgb(var(--gray-140)); margin-top: 4px; }
.doc-prev-row {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 9px 11px; border-radius: 10px;
  border: 1px solid var(--line); background: rgba(var(--gray-128), .03);
}
.doc-prev-row input[type="checkbox"] { margin-top: 4px; flex: none; accent-color: var(--fg); }
.doc-prev-main { flex: 1; min-width: 0; }
.doc-prev-name {
  width: 100%; box-sizing: border-box;
  padding: 4px 8px; border-radius: 6px;
  border: 1px solid var(--line-2);
  background: rgb(var(--gray-255)); color: var(--fg);
  font: inherit; font-size: 13.5px; font-weight: 600;
}
.doc-prev-bname { font-size: 13.5px; font-weight: 600; }
.doc-prev-meta { font-size: 11.5px; opacity: .68; margin-top: 4px; line-height: 1.4; }
.doc-prev-group {
  display: flex; align-items: center; gap: 8px;
  font-size: 12.5px; padding: 6px 2px; cursor: pointer;
}

.sq-author { cursor: pointer; }
.sq-author:hover span:last-child { text-decoration: underline; }
.sq-author-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 12px; margin-bottom: 12px;
  border-radius: 10px; border: 1px solid var(--line);
  background: rgba(var(--gray-128), .04);
  font-size: 13px;
}
.po-author-link {
  border: 0; background: transparent; padding: 0;
  color: inherit; font: inherit; font-weight: 600;
  cursor: pointer; text-decoration: underline; text-underline-offset: 3px;
}

.cs-mute-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 6px; }
.cs-mute-row {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 6px 10px; border-radius: 9px; border: 1px solid var(--line);
}
.cs-mute-name { font-size: 13px; font-weight: 500; }
.cs-hist-btn.muted { opacity: .65; text-decoration: line-through; }
.cs-tts-select {
  width: 100%; box-sizing: border-box;
  padding: 7px 10px; margin-bottom: 8px;
  border-radius: 8px; border: 1px solid var(--line-2);
  background: rgb(var(--gray-255)); color: var(--fg);
  font: inherit; font-size: 12.5px;
}

.cs-bg-presets {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px;
  margin: 6px 0 12px;
}
.cs-bg-preset {
  position: relative; padding: 0; border-radius: 14px; overflow: hidden;
  aspect-ratio: 3 / 4; border: 1.5px solid var(--line-2);
  background-color: rgba(var(--gray-128), .06);
  cursor: pointer; transition: transform .15s ease, border-color .15s ease;
}
.cs-bg-preset.cs-bg-special {
  display: flex; align-items: center; justify-content: center;
}
.cs-bg-glyph {
  font-size: 13px; font-weight: 600; color: var(--fg-2);
  padding-bottom: 14px;
}
.cs-bg-preset img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block;
}
.cs-bg-preset:hover { transform: scale(1.02); }
.cs-bg-preset.active { border-color: var(--fg); box-shadow: 0 0 0 1.5px var(--fg); }
.cs-bg-preset.active::after {
  content: '✓'; position: absolute; right: 5px; top: 5px; z-index: 2;
  width: 19px; height: 19px; border-radius: 50%;
  background: var(--fg); color: rgb(var(--gray-255));
  font-size: 11px; font-weight: 700; display: grid; place-items: center;
}
.cs-bg-preset span {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 1;
  padding: 3px 4px; font-size: 11px; font-weight: 500; line-height: 1.25; text-align: center;
  background: rgba(255, 255, 255, .88); color: #1a1d24;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
[data-theme="dark"] .cs-bg-preset span { background: rgba(0, 0, 0, .68); color: #f5f5f5; }
.h5-global-tip {
  display: block; width: 100%; margin: 12px 0 4px; padding: 10px 12px;
  border: 0; border-radius: 14px; background: rgba(var(--gray-128), .07);
  color: var(--fg-2, #6f7685); font-size: 12px; text-align: center; cursor: pointer;
}
.pbud-meter {
  padding: 12px 14px; margin: 2px 0 12px;
  border-radius: 16px; border: 1px solid var(--line);
  background: rgba(var(--gray-128), .05);
}
.pbud-meter-top {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
  font-size: 12.5px; color: var(--fg-2); margin-bottom: 8px;
}
.pbud-meter-top strong { font-size: 13.5px; color: var(--fg); font-variant-numeric: tabular-nums; }
.pbud-bar {
  height: 7px; border-radius: 999px; background: rgba(var(--gray-128), .14); overflow: hidden;
}
.pbud-bar i {
  display: block; height: 100%; border-radius: 999px;
  background: var(--fg); transition: width .2s ease;
}
.pbud-sub { margin-top: 7px; font-size: 11.5px; color: var(--fg-2); }
.pbud-presets {
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px;
  margin-bottom: 14px;
}
.pbud-pill {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 9px 4px; border-radius: 13px; cursor: pointer;
  border: 1.5px solid var(--line-2); background: transparent; color: var(--fg);
  font: inherit; transition: border-color .15s ease, background .15s ease;
}
.pbud-pill b { font-size: 12.5px; font-weight: 600; }
.pbud-pill span { font-size: 10.5px; color: var(--fg-2); font-variant-numeric: tabular-nums; }
.pbud-pill.active {
  border-color: var(--fg); background: var(--fg); color: rgb(var(--gray-255));
}
.pbud-pill.active span { color: rgba(255, 255, 255, .78); }
[data-theme="dark"] .pbud-pill.active span { color: rgba(0, 0, 0, .7); }
.pbud-input {
  width: 96px; flex: none; padding: 6px 8px; border-radius: 10px;
  border: 1px solid var(--line-2); background: rgb(var(--gray-255)); color: var(--fg);
  font: inherit; font-size: 13px; text-align: right; font-variant-numeric: tabular-nums;
}
[data-theme="dark"] .pbud-input { background: rgba(255, 255, 255, .06); }

[data-theme="dark"] .group-pill { background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .16); }
[data-theme="dark"] .group-pill.active { background: #fff; color: #111; border-color: #fff; }
[data-theme="dark"] .role-memory-edit,
[data-theme="dark"] .doc-prev-name,
[data-theme="dark"] .cs-tts-select {
  background: rgba(255, 255, 255, .05);
  border-color: rgba(255, 255, 255, .16);
  color: #f5f5f5;
}

/* AI 立体化扩写条与导入薄卡提示条 */
.persona-ai-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
}
.persona-ai-btn,
.persona-ai-undo {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .15s ease, transform .12s ease, background .15s ease, border-color .15s ease;
}
.persona-ai-btn {
  border: 1px solid var(--line-2);
  background: rgba(var(--gray-16), .06);
  color: var(--fg);
}
.persona-ai-btn:hover { background: rgba(var(--gray-16), .11); border-color: rgb(var(--gray-168)); }
.persona-ai-btn:active { transform: scale(.98); }
.persona-ai-btn:disabled { opacity: .55; cursor: wait; }
.persona-ai-undo {
  border: 1px solid var(--line-2);
  background: transparent;
  color: var(--fg-2);
}
.persona-ai-undo:hover { color: var(--fg); border-color: var(--fg-2); }
.persona-ai-hint {
  flex: 1 1 100%;
  font-size: 11.4px;
  color: var(--fg-3);
  line-height: 1.45;
}

.enrich-banner {
  position: fixed;
  left: 50%;
  top: max(14px, env(safe-area-inset-top));
  transform: translate(-50%, -14px);
  z-index: 420;
  width: min(92vw, 420px);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, .14);
  color: #16161a;
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s ease, transform .22s ease;
}
.enrich-banner.show {
  opacity: 1;
  transform: translate(-50%, 0);
  pointer-events: auto;
}
[data-theme="dark"] .enrich-banner {
  background: rgba(28, 28, 32, .94);
  color: #f4f4f6;
  border-color: rgba(255, 255, 255, .14);
}
.enrich-banner-copy {
  flex: 1;
  min-width: 0;
  font-size: 12.5px;
  line-height: 1.45;
}
.enrich-banner-copy b {
  display: block;
  font-size: 13px;
  margin-bottom: 2px;
}
.enrich-banner-go {
  flex: none;
  padding: 6px 12px;
  border-radius: 999px;
  border: 0;
  background: var(--fg);
  color: rgb(var(--gray-255));
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}
.enrich-banner-close {
  flex: none;
  width: 24px;
  height: 24px;
  border: 0;
  background: transparent;
  color: var(--fg-2);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

/* ============ 聊天发图 / 语音输入 / 灵感回复 / 月痕记忆 / 回收站 ============ */
.auth-home-link {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 500;
}
.composer .composer-tool-btn {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 0 !important;
  background: transparent !important;
  color: var(--fg-2) !important;
  box-shadow: none !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .15s ease, color .15s ease, transform .12s ease;
}
.composer .composer-tool-btn:hover {
  background: rgba(var(--gray-128), .1) !important;
  color: var(--fg) !important;
}
.composer .composer-tool-btn.is-active,
.composer .composer-tool-btn.is-recording {
  background: rgba(229, 72, 77, .14) !important;
  color: #e5484d !important;
  animation: moonVoicePulse 1.15s ease-in-out infinite;
}
@keyframes moonVoicePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(229, 72, 77, .35); }
  50% { box-shadow: 0 0 0 6px rgba(229, 72, 77, 0); }
}

/* ============ 微信风格「按住 说话」语音条与录音浮层 ============ */
.composer.voice-mode #input,
.composer.voice-mode #parenBtn,
.composer.voice-mode #sendBtn {
  display: none !important;
}
.composer .voice-hold-btn {
  flex: 1 1 auto;
  width: auto;
  height: 40px;
  border-radius: 14px;
  border: 1px solid rgba(var(--gray-128), .14);
  background: rgba(var(--gray-128), .08);
  color: var(--fg);
  font: inherit;
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: .6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  transition: background .14s ease, color .14s ease, transform .1s ease, border-color .14s ease;
}
.composer .voice-hold-btn[hidden] {
  display: none !important;
}
.composer .voice-hold-btn:hover:not(:disabled) {
  transform: none;
  background: rgba(var(--gray-128), .13);
}
.composer .voice-hold-btn.is-pressing {
  background: rgba(var(--gray-128), .22);
  border-color: rgba(var(--gray-128), .26);
  transform: scale(.988);
}
.composer .voice-hold-btn.is-canceling {
  background: rgba(229, 72, 77, .16);
  border-color: rgba(229, 72, 77, .35);
  color: #e5484d;
}
.voice-hud {
  position: fixed;
  left: 50%;
  bottom: calc(116px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 9500;
  width: min(82vw, 290px);
  padding: 18px 20px 15px;
  border-radius: 22px;
  background: rgba(22, 25, 34, .88);
  color: #fff;
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  box-shadow: 0 18px 44px rgba(0, 0, 0, .32);
  text-align: center;
  pointer-events: none;
  transition: background .16s ease;
}
.voice-hud[hidden] {
  display: none !important;
}
.voice-hud.is-canceling {
  background: rgba(196, 46, 54, .92);
}
.voice-hud-wave {
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  margin-bottom: 10px;
}
.voice-hud-wave span {
  display: block;
  width: 4px;
  height: 10px;
  border-radius: 99px;
  background: rgba(255, 255, 255, .92);
  animation: moonVoiceBar .9s ease-in-out infinite;
  transform-origin: center;
}
.voice-hud-wave span:nth-child(2) { animation-delay: .12s; height: 18px; }
.voice-hud-wave span:nth-child(3) { animation-delay: .24s; height: 24px; }
.voice-hud-wave span:nth-child(4) { animation-delay: .36s; height: 18px; }
.voice-hud-wave span:nth-child(5) { animation-delay: .48s; height: 10px; }
.voice-hud.is-canceling .voice-hud-wave span {
  animation: none;
  height: 6px;
  opacity: .65;
}
@keyframes moonVoiceBar {
  0%, 100% { transform: scaleY(.45); opacity: .72; }
  50% { transform: scaleY(var(--rms, 1.15)); opacity: 1; }
}
.voice-hud-text {
  font-size: 14px;
  line-height: 1.5;
  font-weight: 500;
  color: #fff;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}
.voice-hud-tip {
  margin-top: 8px;
  font-size: 11.5px;
  color: rgba(255, 255, 255, .74);
}
.composer .composer-tool-btn.inspire-btn.is-busy {
  opacity: .55;
  pointer-events: none;
}
.composer .composer-tool-btn.paren-btn {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.5px;
  line-height: 1;
  padding: 0;
  font-family: inherit;
}
#sendBtn.is-cont .send-cont-txt {
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
}
/* 兼容不支持 :has() 的旧版安卓 WebView（如部分 OPPO / 华为机型），避免 user-recall-bar 把气泡挤成竖排 */
.row.has-recall-bar {
  flex-wrap: wrap;
}
.row:has(.user-recall-bar) {
  flex-wrap: wrap;
}
.user-recall-bar {
  flex: 0 0 100%;
  width: 100%;
  display: flex;
  justify-content: flex-end;
  margin-top: 2px;
  padding-right: 44px;
}
.user-recall-btn {
  border: 0;
  background: transparent;
  color: var(--fg-2);
  font: inherit;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 6px;
  cursor: pointer;
  opacity: .75;
  transition: opacity .15s ease, background .15s ease;
}
.user-recall-btn:hover {
  opacity: 1;
  color: var(--fg);
  background: rgba(var(--gray-128), .1);
}

/* ============ 沉浸聊天模式样式已迁至 modules/immersive-chat.css ============ */
#messages.is-batch-render .row {
  animation: none !important;
}

.photo-preview-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 780px;
  margin: 0 auto 8px;
  padding: 8px 12px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(12px);
}
[data-theme="dark"] .photo-preview-bar {
  background: rgba(30, 30, 34, .92);
  border-color: rgba(255, 255, 255, .12);
}
.photo-preview-bar[hidden] { display: none; }
.photo-preview-bar img {
  width: 46px;
  height: 46px;
  border-radius: 10px;
  object-fit: cover;
  flex: none;
  border: 1px solid var(--line);
}
.photo-preview-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.photo-preview-info b { font-size: 12.5px; color: var(--fg); }
.photo-preview-info span { font-size: 11.5px; color: var(--fg-2); }
.photo-preview-clear {
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 0;
  background: rgba(var(--gray-128), .12);
  color: var(--fg-2);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.msg-photo-wrap {
  margin-bottom: 6px;
}
.msg-photo-wrap:last-child { margin-bottom: 0; }
.msg-photo-img {
  display: block;
  max-width: min(220px, 60vw);
  max-height: 260px;
  border-radius: 12px;
  object-fit: cover;
  cursor: zoom-in;
  border: 1px solid rgba(var(--gray-128), .18);
}

.inspire-tray {
  max-width: 780px;
  margin: 0 auto 8px;
  padding: 10px 12px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .95);
  backdrop-filter: blur(16px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .08);
}
[data-theme="dark"] .inspire-tray {
  background: rgba(26, 26, 30, .95);
  border-color: rgba(255, 255, 255, .12);
}
.inspire-tray[hidden] { display: none; }
.inspire-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--fg);
}
.inspire-ops {
  display: flex;
  align-items: center;
  gap: 8px;
}
.inspire-close {
  border: 0;
  background: transparent;
  color: var(--fg-2);
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
}
.inspire-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.inspire-loading {
  padding: 12px 6px;
  font-size: 12.5px;
  color: var(--fg-2);
  text-align: center;
}
.inspire-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(var(--gray-128), .04);
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}
.inspire-item:hover {
  background: rgba(var(--gray-128), .09);
  border-color: var(--fg-2);
}
.inspire-item-main {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--fg);
}
.inspire-tag {
  display: inline-block;
  margin-right: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 600;
  background: rgba(var(--gray-128), .13);
  color: var(--fg-2);
  vertical-align: 1px;
}
.inspire-send {
  flex: none;
  padding: 4px 10px;
  border-radius: 999px;
  border: 0;
  background: var(--fg);
  color: rgb(var(--gray-255));
  font: inherit;
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
}

/* 月痕 · 三层记忆弹窗 */
.mv-card {
  width: min(94vw, 480px);
  max-height: 84vh;
  display: flex;
  flex-direction: column;
}
.mv-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.mv-char-bar {
  margin-bottom: 10px;
}
.mv-char-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 11.5px;
  color: var(--fg-2);
}
.mv-char-strip {
  display: flex;
  align-items: center;
  gap: 7px;
  overflow-x: auto;
  padding-bottom: 2px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.mv-char-strip::-webkit-scrollbar { display: none; }
.mv-char-pill {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 5px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(var(--gray-128), .04);
  color: var(--fg);
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color .16s ease, border-color .16s ease, color .16s ease, opacity .16s ease;
}
.mv-char-pill.is-empty {
  opacity: .68;
}
.mv-char-pill.active {
  background: var(--fg);
  color: rgb(var(--gray-255));
  border-color: var(--fg);
  opacity: 1;
}
.mv-char-av {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10.5px;
  font-weight: 600;
  background: rgba(var(--gray-128), .22);
  color: var(--fg);
}
.mv-char-pill.active .mv-char-av {
  background: rgba(var(--gray-255), .2);
  color: rgb(var(--gray-255));
}
.mv-char-av img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.mv-char-name {
  max-width: 78px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mv-char-count {
  font-size: 11px;
  color: var(--fg-2);
}
.mv-char-pill.active .mv-char-count {
  color: rgba(var(--gray-255), .82);
}
.mv-impression {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: linear-gradient(135deg, rgba(var(--gray-128), .06), rgba(var(--gray-128), .02));
  margin-bottom: 12px;
}
.mv-impression-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  font-size: 12px;
  color: var(--fg-2);
}
.mv-impression-top strong { color: var(--fg); font-size: 12.5px; }
.mv-impression-text {
  font-size: 13px;
  line-height: 1.6;
  color: var(--fg);
  white-space: pre-wrap;
}
.mv-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 10px;
}
.mv-tab {
  padding: 7px 6px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--fg-2);
  font: inherit;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
}
.mv-tab.active {
  background: var(--fg);
  color: rgb(var(--gray-255));
  border-color: var(--fg);
}
.mv-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 140px;
  max-height: 40vh;
  padding-right: 2px;
}
.mv-item {
  padding: 10px 12px;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: rgba(var(--gray-128), .03);
  transition: opacity .2s ease, border-color .2s ease;
}
.mv-item.is-faded {
  opacity: .56;
  border-style: dashed;
}
.mv-item-body {
  font-size: 13px;
  line-height: 1.5;
  color: var(--fg);
  margin-bottom: 6px;
}
.mv-item-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
  color: var(--fg-2);
}
.mv-item-ops {
  display: flex;
  align-items: center;
  gap: 6px;
}
.mv-polish-btn {
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: transparent;
  color: var(--fg);
  font: inherit;
  font-size: 11px;
  cursor: pointer;
}
.mv-polish-btn.is-bright {
  background: var(--fg);
  color: rgb(var(--gray-255));
  border-color: var(--fg);
}
.mv-del-btn {
  border: 0;
  background: transparent;
  color: var(--fg-2);
  font-size: 12px;
  cursor: pointer;
}
.mv-add-row {
  display: flex;
  gap: 6px;
  margin-top: 10px;
}
.mv-add-row input {
  flex: 1;
  padding: 8px 11px;
  border-radius: 11px;
  border: 1px solid var(--line-2);
  background: transparent;
  color: var(--fg);
  font: inherit;
  font-size: 13px;
}
.mv-empty {
  padding: 24px 12px;
  text-align: center;
  font-size: 12.5px;
  color: var(--fg-2);
  line-height: 1.6;
}

/* 角色回收站 */
.trash-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 55vh;
  overflow-y: auto;
  margin: 10px 0;
}
.trash-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(var(--gray-128), .04);
}
.trash-info {
  flex: 1;
  min-width: 0;
}
.trash-info b {
  display: block;
  font-size: 13.5px;
  color: var(--fg);
  margin-bottom: 2px;
}
.trash-info span {
  font-size: 11.5px;
  color: var(--fg-2);
}
.trash-ops {
  display: flex;
  gap: 6px;
  flex: none;
}
.mv-card .grp-foot,
.cs-card .grp-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}
.mv-card .ghost-btn,
.cs-card .ghost-btn {
  padding: 7px 16px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: transparent;
  color: var(--fg-2);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.mv-card .ghost-btn:hover,
.cs-card .ghost-btn:hover {
  color: var(--fg);
  border-color: var(--fg-2);
}

/* ============ 列表长按操作菜单 & 删除 / 置顶样式 ============ */
.h5-wx-item {
  -webkit-touch-callout: none;
  user-select: none;
  -webkit-user-select: none;
  transition: background .15s ease, transform .12s ease;
}
.h5-wx-item.is-pressing {
  transform: scale(0.985);
  background: rgba(var(--gray-128), .12) !important;
}
.h5-wx-pin,
.char-pin-tag {
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  color: #5b67d6;
  background: rgba(91, 103, 214, .12);
  vertical-align: middle;
}
.h5-ctx-mask {
  z-index: 120;
  align-items: flex-end;
  padding: 12px;
}
.h5-ctx-sheet {
  width: min(440px, 100%);
  padding: 16px;
  border-radius: 24px;
  margin-bottom: env(safe-area-inset-bottom, 0px);
}
.h5-ctx-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 4px 14px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 12px;
}
.h5-ctx-head .h5-wx-ava {
  width: 44px;
  height: 44px;
  border-radius: 13px;
  flex: none;
}
.h5-ctx-head .h5-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.h5-ctx-head .h5-text strong {
  font-size: 15px;
  color: var(--fg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.h5-ctx-head .h5-text small {
  font-size: 12px;
  color: var(--fg-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.h5-ctx-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.h5-ctx-btn {
  width: 100%;
  min-height: 46px;
  padding: 10px 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(var(--gray-128), .06);
  color: var(--fg);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  text-align: center;
  cursor: pointer;
  transition: background .15s ease, transform .1s ease;
}
.h5-ctx-btn:active {
  transform: scale(0.985);
}
.h5-ctx-switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
  padding: 11px 16px;
}
.h5-ctx-switch-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.h5-ctx-switch-copy strong {
  font-size: 14px;
  font-weight: 600;
  color: var(--fg);
}
.h5-ctx-switch-copy small {
  font-size: 11.5px;
  color: var(--fg-2);
  font-weight: 400;
}
.h5-toggle-pill {
  position: relative;
  flex: none;
  width: 44px;
  height: 26px;
  border-radius: 999px;
  background: #cfd5e2;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, .08);
  transition: background .2s ease, box-shadow .2s ease;
}
:root[data-theme='dark'] .h5-toggle-pill {
  background: rgba(255, 255, 255, .24);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12);
}
.h5-toggle-pill i {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .20);
  transition: transform .22s cubic-bezier(.22, 1, .36, 1);
}
.h5-toggle-pill.is-on {
  background: #5561d6;
  box-shadow: inset 0 0 0 1px rgba(85, 97, 214, .2);
}
:root[data-theme='dark'] .h5-toggle-pill.is-on {
  background: #6b77f0;
}
.h5-toggle-pill.is-on i {
  transform: translateX(18px);
}
.h5-ctx-btn.is-danger {
  color: #e5484d !important;
  background: rgba(229, 72, 77, .1) !important;
  border-color: rgba(229, 72, 77, .24) !important;
  font-weight: 600;
}
.h5-ctx-btn.is-cancel {
  margin-top: 10px;
  background: transparent;
  color: var(--fg-2);
}
.h5-list-row.is-danger-row strong {
  color: #e5484d !important;
}
.h5-sticker.danger {
  color: #e5484d !important;
  background: rgba(229, 72, 77, .12) !important;
  border-color: rgba(229, 72, 77, .22) !important;
}
.danger-text-btn {
  color: #e5484d !important;
  border-color: rgba(229, 72, 77, .28) !important;
}
.danger-text-btn:hover {
  background: rgba(229, 72, 77, .1) !important;
}
.char {
  position: relative;
}
.char-del-btn {
  flex: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 0;
  background: transparent;
  color: var(--fg-3);
  font-size: 15px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity .15s ease, background .15s ease, color .15s ease;
}
.char:hover .char-del-btn,
.char:focus-within .char-del-btn,
.char.active .char-del-btn {
  opacity: .72;
}
.char-del-btn:hover {
  opacity: 1 !important;
  background: rgba(229, 72, 77, .15);
  color: #e5484d;
}
.composer {
  align-items: center;
  gap: 6px;
  padding-left: 12px;
}

/* ============ 微信风格聊天时间分割线 ============ */
.chat-time-divider {
  max-width: 860px;
  margin: 14px auto 12px;
  text-align: center;
  user-select: none;
  pointer-events: none;
}
.chat-time-divider span {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 6px;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--fg-3, #8a8f98);
  background: rgba(var(--gray-128), .09);
  font-variant-numeric: tabular-nums;
  letter-spacing: .2px;
}
body.has-chat-bg .chat-time-divider span {
  color: rgba(255, 255, 255, .92);
  background: rgba(16, 18, 24, .34);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  text-shadow: 0 1px 2px rgba(0, 0, 0, .18);
}
[data-theme="light"] body.has-chat-bg .chat-time-divider span,
html[data-theme="light"] body.has-chat-bg .chat-time-divider span {
  color: rgba(255, 255, 255, .94);
  background: rgba(24, 27, 36, .32);
}

/* ============ 输入框「＋」收纳托盘（微信极简风） ============ */
.composer .plus-toggle-btn svg {
  transition: transform .22s cubic-bezier(.2, .8, .2, 1);
}
.composer .plus-toggle-btn.is-open {
  background: rgba(var(--gray-128), .12) !important;
  color: var(--fg) !important;
}
.composer .plus-toggle-btn.is-open svg {
  transform: rotate(45deg);
}
.composer-plus-tray {
  max-width: 860px;
  margin: 10px auto 0;
  padding: 14px 10px 12px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: rgba(var(--gray-255), .95);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 8px 26px rgba(15, 20, 34, .08);
  animation: plusTrayIn .18s cubic-bezier(.2, .8, .2, 1);
}
.composer-plus-tray[hidden] {
  display: none !important;
}
body.plus-tray-open .composer-wrap .hint {
  display: none;
}
body.h5-active.plus-tray-open .h5-nav {
  display: none !important;
}
body.h5-active.plus-tray-open[data-h5-page='chat'] .composer-wrap {
  padding-bottom: max(12px, env(safe-area-inset-bottom));
}
body.h5-active .composer-plus-tray {
  margin-top: 10px;
  padding: 16px 10px 14px;
  border-radius: 22px;
}
@keyframes plusTrayIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
/* ── 「＋」托盘分页（微信式左右滑动） ── */
.composer-plus-grid { display: none; }
.plus-pages {
  display: flex;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}
.plus-pages::-webkit-scrollbar { display: none; }
.plus-page {
  flex: 0 0 100%;
  min-width: 100%;
  box-sizing: border-box;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(88px, auto));
  gap: 8px 6px;
  align-content: start;
}
.plus-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 8px;
}
.plus-dots[hidden] { display: none; }
.plus-dots i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(var(--gray-128), .3);
  transition: width .2s ease, background .2s ease;
}
.plus-dots i.on {
  width: 16px;
  border-radius: 3px;
  background: var(--fg-2);
}
body.vn-stage-active #main .plus-dots i { background: rgba(255, 255, 255, .3); }
body.vn-stage-active #main .plus-dots i.on { background: #fff; }

.composer-plus-grid {
  display: none;
}
.plus-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 6px 2px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--fg-2);
  font: inherit;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: transform .12s ease, color .15s ease;
}
.plus-tile[hidden] {
  display: none !important;
}
.plus-tile:hover {
  color: var(--fg);
}
.plus-tile:active {
  transform: scale(.94);
}
.plus-tile-ico {
  width: 46px;
  height: 46px;
  border-radius: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(var(--gray-128), .08);
  border: 1px solid var(--line);
  color: var(--fg);
  transition: background .15s ease, border-color .15s ease;
}
.plus-tile:hover .plus-tile-ico {
  background: rgba(var(--gray-128), .14);
}
.plus-tile-txt {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0;
}
[data-theme="dark"] .composer-plus-tray {
  background: rgba(24, 26, 32, .94);
  box-shadow: 0 12px 32px rgba(0, 0, 0, .45);
}

/* 微信式整条气泡弹出动效 */
@keyframes wechatBubblePop {
  0% { opacity: 0; transform: translateY(7px) scale(0.96); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
.bubble.wechat-pop {
  animation: wechatBubblePop .22s cubic-bezier(.22, 1, .36, 1) both;
}

/* 气泡右下角 · 一键生成剧情配图 */
.bubble-scene-bar {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
.bubble-scene-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid rgba(var(--gray-128), .22);
  background: rgba(var(--gray-128), .07);
  color: var(--fg-2, #666);
  font: inherit;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.25;
  cursor: pointer;
  opacity: .84;
  transition: opacity .15s ease, background .15s ease, transform .12s ease;
}
.bubble-scene-btn:hover:not(:disabled) {
  opacity: 1;
  background: rgba(var(--gray-128), .14);
  color: var(--fg, #111);
}
.bubble-scene-btn:active:not(:disabled) {
  transform: scale(0.95);
}
.bubble-scene-btn.is-busy {
  opacity: .65;
  cursor: default;
}
body.skin-glass .bubble-scene-btn {
  background: rgba(255, 255, 255, .42);
  border-color: rgba(255, 255, 255, .65);
  color: #3b4254;
}
:root[data-theme="dark"] .bubble-scene-btn {
  background: rgba(255, 255, 255, .10);
  border-color: rgba(255, 255, 255, .16);
  color: rgba(255, 255, 255, .78);
}

.msg-scene-wrap {
  margin-top: 8px;
  width: min(228px, 64vw);
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(var(--gray-128), .16);
  background: rgba(var(--gray-128), .06);
}
.msg-scene-img {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  cursor: zoom-in;
  animation: wechatBubblePop .28s ease both;
}
.msg-scene-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 9px;
  font-size: 10.5px;
  color: var(--fg-2, #777);
  background: rgba(var(--gray-128), .05);
}
.msg-scene-redraw {
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 11px;
  padding: 1px 4px;
  border-radius: 6px;
  cursor: pointer;
  opacity: .88;
}
.msg-scene-redraw:hover {
  opacity: 1;
  background: rgba(var(--gray-128), .12);
}
.msg-scene-shimmer {
  aspect-ratio: 3 / 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px;
  text-align: center;
  background: linear-gradient(120deg, rgba(var(--gray-128), .06) 25%, rgba(var(--gray-128), .15) 50%, rgba(var(--gray-128), .06) 75%);
  background-size: 220% 100%;
  animation: sceneShimmer 1.5s linear infinite;
}
.msg-scene-shimmer b {
  font-size: 12px;
  font-weight: 600;
  color: var(--fg, #222);
}
.msg-scene-shimmer small {
  font-size: 10.5px;
  color: var(--fg-2, #777);
}
.msg-scene-spin {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2.2px solid rgba(var(--gray-128), .22);
  border-top-color: var(--fg, #333);
  animation: sceneSpin .85s linear infinite;
}
@keyframes sceneShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
@keyframes sceneSpin {
  to { transform: rotate(360deg); }
}

/* ===== 用户头像 & 换情头弹窗 ===== */
.avatar.has-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.avatar.avatar-clickable {
  cursor: pointer;
  transition: transform .15s ease, opacity .15s ease;
}
.avatar.avatar-clickable:active {
  transform: scale(0.93);
  opacity: .85;
}
.couple-ava-card {
  max-width: 400px;
}
.couple-ava-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 12px 6px 8px;
}
.couple-ava-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.couple-ava-ring {
  width: 78px;
  height: 78px;
  border-radius: 22px;
  overflow: hidden;
  display: grid;
  place-items: center;
  font-size: 24px;
  font-weight: 700;
  color: rgb(var(--gray-255));
  background: linear-gradient(150deg, rgb(var(--gray-56)), rgb(var(--gray-16)));
  border: 2px solid var(--line, rgba(var(--gray-128), .2));
  box-shadow: 0 6px 18px rgba(0, 0, 0, .12);
  cursor: pointer;
  transition: transform .15s ease;
}
.couple-ava-ring:active {
  transform: scale(0.95);
}
.couple-ava-ring img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.couple-ava-heart {
  font-size: 18px;
  color: #e87a90;
  margin-top: -34px;
  user-select: none;
}
.couple-ava-name {
  font-size: 14px;
  font-weight: 650;
  color: var(--fg);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.couple-ava-sub {
  font-size: 11px;
  color: var(--fg-2);
  text-align: center;
  min-height: 15px;
}
.couple-ava-btn {
  margin-top: 2px;
  width: 100%;
  max-width: 124px;
  font-size: 12.5px;
  padding: 6px 10px;
}
.couple-ava-reset {
  border: 0;
  background: transparent;
  color: var(--fg-2);
  font-size: 11.5px;
  padding: 2px 6px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.couple-ava-tip {
  margin: 6px 2px 12px;
  line-height: 1.55;
}

/* ===== 聊天字体大小调节面板 ===== */
.h5-font-preview {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 12px;
  margin-bottom: 14px;
  border-radius: 16px;
  background: rgba(var(--gray-128), .08);
  border: 1px solid var(--line, rgba(var(--gray-128), .16));
}
.h5-font-bubble {
  max-width: 86%;
  padding: 9px 13px;
  border-radius: 16px;
  line-height: 1.58;
  word-break: break-word;
}
.h5-font-bubble.ai {
  align-self: flex-start;
  background: rgb(var(--gray-255));
  color: rgb(var(--gray-24));
  border: 1px solid rgba(var(--gray-128), .16);
  border-top-left-radius: 5px;
}
.h5-font-bubble.me {
  align-self: flex-end;
  background: rgb(var(--gray-24));
  color: rgb(var(--gray-255));
  border-top-right-radius: 5px;
}
[data-theme="dark"] .h5-font-bubble.ai {
  background: rgba(255, 255, 255, .10);
  color: #f2f4f8;
  border-color: rgba(255, 255, 255, .14);
}
[data-theme="dark"] .h5-font-bubble.me {
  background: rgba(255, 255, 255, .20);
  color: #ffffff;
}
.h5-font-presets {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}
.h5-font-presets .h5-chip {
  justify-content: center;
  padding: 8px 4px;
  font-size: 12.5px;
}
.h5-font-slider-box {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(var(--gray-128), .07);
  border: 1px solid var(--line, rgba(var(--gray-128), .14));
  margin-bottom: 12px;
}
.h5-font-val-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 13px;
  color: var(--fg-2);
}
.h5-font-val-row strong {
  color: var(--fg);
  font-size: 15px;
  margin-right: auto;
}
.h5-font-val-row .h5-chip {
  min-height: 28px;
  padding: 2px 10px;
  font-size: 12px;
}
.h5-font-val-row .h5-chip:disabled {
  opacity: .42;
}
.h5-font-range-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.h5-font-range-row input[type="range"] {
  flex: 1 1 auto;
  accent-color: var(--fg);
  height: 28px;
}
.h5-font-a {
  font-weight: 600;
  color: var(--fg-2);
  user-select: none;
}
.h5-font-a.small { font-size: 12px; }
.h5-font-a.large { font-size: 20px; }

/* ===== 剧场：丢设定开玩（自由文游弹窗） ===== */
.free-game-card {
  max-width: 460px;
  max-height: 86vh;
}
.free-game-lead {
  margin: 0 0 10px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--fg-2);
}
.free-game-body {
  flex: 1 1 auto;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-right: 2px;
}
.free-game-upload {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.free-game-pick {
  width: 100%;
  justify-content: center;
  padding: 10px 12px;
  font-size: 13px;
  border-style: dashed;
}
.free-game-status {
  font-size: 12px;
  line-height: 1.45;
  padding: 7px 10px;
  border-radius: 10px;
  background: rgba(var(--gray-128), .08);
  color: var(--fg-2);
}
.free-game-status.ok {
  background: rgba(34, 160, 107, .12);
  color: #1f7a53;
}
.free-game-status.warn {
  background: rgba(217, 119, 6, .12);
  color: #b45309;
}
.free-game-status.err {
  background: rgba(220, 38, 38, .12);
  color: #dc2626;
}
[data-theme="dark"] .free-game-status.ok { color: #6ee7b7; }
[data-theme="dark"] .free-game-status.warn { color: #fbbf24; }
[data-theme="dark"] .free-game-status.err { color: #fca5a5; }
.free-game-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.free-game-counter {
  font-size: 11.5px;
  color: var(--fg-2);
  font-variant-numeric: tabular-nums;
}
.free-game-counter.warn {
  color: #d97706;
  font-weight: 600;
}
.free-game-textarea {
  width: 100%;
  min-height: 150px;
  max-height: 280px;
  resize: vertical;
  line-height: 1.55;
  font-family: inherit;
  font-size: 13.5px;
}
.free-game-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--fg);
  cursor: pointer;
  user-select: none;
  padding: 2px 0;
}
.free-game-check input {
  width: 16px;
  height: 16px;
  accent-color: var(--fg);
}

/* ===== 广场首屏冷加载骨架屏 ===== */
.h5-post-skel {
  pointer-events: none;
  min-height: 228px;
  background: rgba(var(--gray-128), .10) !important;
  animation: sqSkelPulse 1.3s ease-in-out infinite;
}
.h5-post-skel .h5-post-cover {
  background: rgba(var(--gray-128), .14);
}
@keyframes sqSkelPulse {
  0%, 100% { opacity: .55; }
  50% { opacity: .95; }
}

/* ===== 我的页面头像点击更换 & 交互式头像裁剪弹窗 ===== */
.h5-profile-avatar-btn {
  position: relative;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  flex: 0 0 auto;
  display: inline-flex;
  border-radius: 50%;
  transition: transform .15s ease;
}
.h5-profile-avatar-btn:active {
  transform: scale(0.94);
}
.h5-profile-avatar-badge {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--fg, #1c1c1e);
  color: var(--bg, #fff);
  border: 2px solid var(--bg, #fff);
  font-size: 10px;
  font-weight: 700;
  display: grid;
  place-items: center;
  line-height: 1;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .2);
}
#pfAvatar {
  cursor: pointer;
}

.ava-crop-mask {
  position: fixed;
  inset: 0;
  z-index: 9990;
  background: rgba(12, 12, 16, .76);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.ava-crop-card {
  width: 100%;
  max-width: 360px;
  box-sizing: border-box;
  border-radius: 22px;
  background: var(--surface, #fff);
  color: var(--fg, #1c1c1e);
  border: 1px solid var(--line, rgba(128, 128, 128, .2));
  box-shadow: 0 20px 56px rgba(0, 0, 0, .38);
  padding: 16px 18px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.ava-crop-head {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.ava-crop-head h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
}
.ava-crop-stage {
  position: relative;
  width: 264px;
  height: 264px;
  border-radius: 22px;
  overflow: hidden;
  background: #141418;
  touch-action: none;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14), 0 8px 24px rgba(0, 0, 0, .25);
}
.ava-crop-stage.is-dragging {
  cursor: grabbing;
}
.ava-crop-canvas {
  width: 264px;
  height: 264px;
  display: block;
}
.ava-crop-frame {
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: 22px;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .82);
}
.ava-crop-frame::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px dashed rgba(255, 255, 255, .42);
}
.ava-crop-stage.is-dragging .ava-crop-frame {
  background-image:
    linear-gradient(to right, transparent 33.1%, rgba(255, 255, 255, .28) 33.3%, transparent 33.6%, transparent 66.4%, rgba(255, 255, 255, .28) 66.6%, transparent 66.9%),
    linear-gradient(to bottom, transparent 33.1%, rgba(255, 255, 255, .28) 33.3%, transparent 33.6%, transparent 66.4%, rgba(255, 255, 255, .28) 66.6%, transparent 66.9%);
}
.ava-crop-hint {
  margin: 10px 0 8px;
  font-size: 12px;
  color: var(--fg-2, #777);
}
.ava-crop-zoom {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}
.ava-crop-zlabel {
  font-size: 16px;
  font-weight: 600;
  color: var(--fg-2, #777);
  width: 16px;
  text-align: center;
  user-select: none;
}
.ava-crop-slider {
  flex: 1;
  min-width: 0;
  accent-color: var(--fg, #1c1c1e);
}
.ava-crop-reset {
  border: 1px solid var(--line, rgba(128, 128, 128, .25));
  background: transparent;
  color: var(--fg-2, #666);
  font-size: 11.5px;
  border-radius: 8px;
  padding: 4px 8px;
  cursor: pointer;
  flex: 0 0 auto;
}
.ava-crop-foot {
  width: 100%;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
.ava-crop-foot .save-btn,
.ava-crop-foot .test-btn {
  min-width: 84px;
}

/* 长对话按需分段加载：首屏秒开最近消息，顶部一键展开更早记录 */
.chat-load-more-wrap {
  display: flex;
  justify-content: center;
  padding: 6px 0 12px;
}
.chat-load-more-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  border-radius: 999px;
  border: 1px solid rgba(128, 128, 128, .22);
  background: rgba(255, 255, 255, .74);
  color: var(--fg-2, #5c6375);
  font-size: 12px;
  font-weight: 560;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: transform .12s ease, opacity .15s ease, background .15s ease;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.chat-load-more-btn:active { transform: scale(.96); opacity: .82; }
[data-theme="dark"] .chat-load-more-btn {
  background: rgba(28, 32, 46, .74);
  border-color: rgba(255, 255, 255, .14);
  color: rgba(232, 236, 246, .84);
}
body.skin-glass .chat-load-more-btn {
  background: rgba(255, 255, 255, .42);
  border-color: rgba(255, 255, 255, .52);
  color: #1f2430;
}
html[data-theme="dark"] body.skin-glass .chat-load-more-btn {
  background: rgba(22, 28, 42, .52);
  border-color: rgba(255, 255, 255, .18);
  color: rgba(240, 244, 255, .9);
}

/* 全局触控响应提速：消除移动端双击缩放等待与灰块闪动 */
button, a, [role="button"], .pm-style-card, .sq-card, .char {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/* ---------- 世界书挂载面板 & 角色内选书标签 & 全局开关 ---------- */
.wb-global-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--fg);
  cursor: pointer;
}
.wb-global-toggle input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent, #7c5cff);
  flex: none;
}
.wb-pick-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 4px;
}
.wb-pick-empty {
  font-size: 12.5px;
  color: var(--fg-3);
}
.wb-pick-chip {
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  color: var(--fg-2);
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
  transition: all .15s ease;
}
.wb-pick-chip.is-on {
  border-color: var(--accent, #7c5cff);
  background: rgba(124, 92, 255, .14);
  color: var(--fg);
  font-weight: 600;
}
.wb-pick-chip.is-global {
  border-color: #ea8c2e;
  background: rgba(234, 140, 46, .16);
  color: var(--fg);
  font-weight: 600;
}

/* 角色设定面板 · 顶部 3 分栏精简版样式 */
.cs-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
  padding: 4px;
  margin: 0 0 16px;
  border-radius: 14px;
  background: var(--bg-soft, rgba(128, 134, 150, .10));
  border: 1px solid var(--line, rgba(128, 134, 150, .16));
}
.cs-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 8px 6px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--fg-2, #666);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s ease, color .15s ease, box-shadow .15s ease;
}
.cs-tab.is-active {
  background: var(--bg, #fff);
  color: var(--fg, #171921);
  border-color: var(--line, rgba(128, 134, 150, .18));
  box-shadow: 0 2px 8px rgba(15, 20, 36, .08);
}
[data-theme="dark"] .cs-tab.is-active {
  background: rgba(255, 255, 255, .12);
  color: #fff;
  border-color: rgba(255, 255, 255, .14);
}
.cs-tab-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #f08a24;
  box-shadow: 0 0 0 2px rgba(240, 138, 36, .22);
  flex: none;
}
.cs-panel[hidden] {
  display: none !important;
}
.cs-card-box {
  padding: 12px 13px;
  border-radius: 16px;
  background: var(--bg-soft, rgba(128, 134, 150, .06));
  border: 1px solid var(--line, rgba(128, 134, 150, .16));
  margin-bottom: 14px;
}
.cs-global-warn {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  margin-bottom: 12px;
  border-radius: 14px;
  background: rgba(234, 140, 46, .13);
  border: 1px solid rgba(234, 140, 46, .42);
  color: var(--fg);
  font-size: 12.5px;
  line-height: 1.5;
}
.cs-shortcut {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  margin-bottom: 14px;
  border-radius: 16px;
  border: 1px solid var(--line, rgba(128, 134, 150, .18));
  background: var(--bg-soft, rgba(128, 134, 150, .06));
  color: var(--fg);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform .12s ease, border-color .15s ease;
}
.cs-shortcut:active {
  transform: scale(.985);
}
.cs-shortcut-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.cs-shortcut-info strong {
  font-size: 13.5px;
  font-weight: 700;
}
.cs-shortcut-info small {
  font-size: 12px;
  color: var(--fg-3, #777);
}
.cs-shortcut-go {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--accent, #5b67d6);
  white-space: nowrap;
  flex: none;
}
.cs-fold {
  margin-bottom: 14px;
  border-radius: 16px;
  border: 1px solid var(--line, rgba(128, 134, 150, .16));
  background: var(--bg-soft, rgba(128, 134, 150, .06));
  overflow: hidden;
}
.cs-fold > summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 13px;
  font-size: 13.5px;
  font-weight: 650;
  cursor: pointer;
}
.cs-fold > summary::-webkit-details-marker {
  display: none;
}
.cs-fold-hint {
  font-size: 12px;
  font-weight: 500;
  color: var(--fg-3, #777);
}
.cs-fold[open] .cs-fold-hint {
  opacity: .5;
}
.cs-fold-body {
  padding: 2px 13px 12px;
  border-top: 1px solid var(--line, rgba(128, 134, 150, .14));
}
.wb-bind-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 10px 0 12px;
  max-height: 46vh;
  overflow-y: auto;
}
.wb-bind-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
}
.wb-bind-main {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  color: var(--fg);
  text-align: left;
  font: inherit;
  cursor: pointer;
  transition: all .15s ease;
}
.wb-bind-main.is-on {
  border-color: var(--accent, #7c5cff);
  background: rgba(124, 92, 255, .10);
}
.wb-bind-check {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 1.5px solid var(--line-strong, rgba(var(--gray-128), .4));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex: none;
  color: #fff;
}
.wb-bind-main.is-on .wb-bind-check {
  background: var(--accent, #7c5cff);
  border-color: var(--accent, #7c5cff);
}
.wb-bind-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 2px;
}
.wb-bind-info b {
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wb-bind-info small {
  font-size: 11.5px;
  color: var(--fg-3);
}
.wb-bind-global {
  flex: none;
  padding: 0 10px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  color: var(--fg-2);
  font: inherit;
  font-size: 12px;
  white-space: nowrap;
  cursor: pointer;
  transition: all .15s ease;
}
.wb-bind-global.is-on {
  border-color: var(--accent, #7c5cff);
  background: var(--accent, #7c5cff);
  color: #fff;
  font-weight: 600;
}












/* === mobile.css === */
.h5-only { display: none; }

@media (max-width: 780px) {
  html:has(body.h5-active) {
    overflow: hidden;
    height: 100%;
    overscroll-behavior: none;
  }
  .h5-active {
    --h5-ink: rgb(var(--gray-34));
    --h5-text: rgb(var(--gray-34));
    --h5-muted: rgb(var(--gray-110));
    --h5-line: rgb(var(--gray-222));
    --h5-radius: 16px;
    --h5-edge: max(14px, env(safe-area-inset-left), env(safe-area-inset-right));
    background: rgb(var(--gray-245));
    color: var(--h5-text);
    line-height: 1.5;
    overscroll-behavior: none;
  }
  .h5-active [hidden] { display: none !important; }
  .h5-active .app {
    position: fixed;
    top: var(--h5-top, 0px);
    right: 0;
    bottom: auto;
    left: 0;
    inset: var(--h5-top, 0px) 0 auto;
    width: 100%;
    height: 100vh;
    height: var(--h5-height, 100dvh);
    flex-direction: column;
    overflow: hidden;
    background: radial-gradient(ellipse 95% 290px at 74% 0%, rgb(var(--gray-236)) 2%, transparent 85%), linear-gradient(160deg, rgb(var(--gray-250)), rgb(var(--gray-255)) 54%, rgb(var(--gray-245)));
  }
  /* 全面屏状态栏安全区统一由各页顶栏（.h5-page / .h5-chat-intro）内部承载，避免与 .app 叠加产生双倍留白 */
  .h5-active:not(.h5-keyboard) .app { padding-top: 0; }
  .h5-active .side,
  .h5-active .side-mask,
  .h5-active .square-view,
  .h5-active .chat-head,
  .h5-active .welcome,
  .h5-active #historyPop { display: none !important; }
  .h5-active .main { display: none; }
  .h5-active[data-h5-page='chat'] .main,
  .h5-active[data-h5-page='draw'] .main { display: flex; min-height: 0; }
  .h5-active[data-h5-page='draw'] #drawBack { display: none !important; }
  .h5-active .h5-nav,
  .h5-active .h5-page,
  .h5-active .h5-chat-intro,
  .h5-active .h5-drawer,
  .h5-active .h5-post-details { min-width: 0; }
  .h5-nav button,
  .h5-page button,
  .h5-chat-intro button,
  .h5-shade button,
  .h5-post-details button {
    font: inherit;
    color: inherit;
    cursor: pointer;
    text-align: inherit;
    -webkit-appearance: none;
    appearance: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }
  .h5-nav button:focus,
  .h5-page button:focus { outline: none; }
  .h5-active button:focus-visible { outline: 2px solid rgb(var(--gray-110)); outline-offset: 2px; }
  .h5-active input:focus-visible,
  .h5-active textarea:focus-visible,
  .h5-active select:focus-visible { outline: none; }
  .h5-active button:disabled { cursor: default; }
  .h5-active input:not([type='range']),
  .h5-active select,
  .h5-active textarea { font-size: 16px; }
  .h5-active textarea { resize: none; }
  .h5-icon, .h5-chevron { display: inline-grid; place-items: center; flex: none; width: 20px; height: 20px; }
  .h5-icon svg, .h5-chevron svg, .h5-sticker svg, .h5-hero-art svg { display: block; width: 100%; height: 100%; }
  .h5-chevron { width: 15px; height: 15px; color: rgb(var(--gray-110)); }
  .h5-text { display: block; flex: 1; min-width: 0; }
  .h5-text strong, .h5-text small { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .h5-text strong { font-size: 14px; line-height: 1.35; font-weight: 700; }
  .h5-text small { font-size: 11.5px; color: var(--h5-muted); margin-top: 3px; }

  .h5-active .h5-icon-button {
    flex: none; display: grid; place-items: center; width: 44px; height: 44px; padding: 0;
    border: 1px solid var(--h5-line); border-radius: 50%;
    color: rgb(var(--gray-80)); background: rgba(var(--gray-255), 0.722);
  }
  .h5-page { display: block; flex: 1 1 0; min-height: 0; overflow: auto; overscroll-behavior-y: contain; padding: 4px var(--h5-edge) 18px; }
  .h5-nav {
    flex: none; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); z-index: 6;
    padding: 3px var(--h5-edge) max(4px, env(safe-area-inset-bottom));
    border-top: 1px solid var(--h5-line); background: rgba(var(--gray-255), 0.929);
    box-shadow: 0 -5px 20px rgba(var(--gray-56), 0.031);
  }
  .h5-active .h5-nav-item {
    display: grid; justify-items: center; align-content: center; gap: 1px;
    min-height: 53px; padding: 0 2px; border: 0; border-radius: 12px;
    background: transparent; color: rgb(var(--gray-110)); font-size: 11.5px;
  }
  .h5-nav-item .h5-icon { width: 23px; height: 23px; }
  .h5-active .h5-nav-item[aria-current] { color: rgb(var(--gray-80)); font-weight: 720; }
  .h5-nav-item[aria-current] .h5-icon { filter: drop-shadow(0 2px 3px rgba(var(--gray-168), 0.533)); }

  .h5-search {
    display: flex; align-items: center; gap: 8px; min-width: 0; width: 100%; min-height: 44px; margin: 0 0 11px;
    padding: 0 13px; border: 1px solid rgb(var(--gray-222)); border-radius: 999px; background: rgba(var(--gray-255), 0.678); color: var(--h5-muted);
  }
  .h5-search input { width: 100%; min-width: 0; min-height: 42px; border: 0; padding: 0; outline: 0 !important; font: inherit; color: var(--h5-text); background: transparent; }
  .h5-search:focus-within { outline: 2px solid rgb(var(--gray-168)); outline-offset: 1px; }
  .h5-section-head { display: flex; justify-content: space-between; align-items: center; gap: 4px; min-height: 40px; margin: 9px 0 3px; }
  .h5-section-head h2 { display: flex; align-items: center; gap: 7px; margin: 0; font-size: 16px; color: var(--h5-text); line-height: 1.3; }
  .h5-section-head h2::before { content: ''; width: 4px; height: 15px; border-radius: 99px; background: linear-gradient(rgb(var(--gray-168)), rgb(var(--gray-110))); flex: none; }
  .h5-active .h5-text-button { display: inline-flex; flex-direction: row-reverse; align-items: center; gap: 2px; min-height: 44px; border: 0; padding: 0 0 0 6px; background: none; color: var(--h5-muted); font-size: 12px; }
  .h5-text-button .h5-icon { width: 14px; height: 14px; }
  .h5-list { border: 1px solid var(--h5-line); border-radius: var(--h5-radius); background: rgba(var(--gray-255), 0.737); overflow: hidden; }
  .h5-active .h5-list-row { display: flex; align-items: center; gap: 9px; width: 100%; min-height: 54px; padding: 7px 9px; border: 0; background: transparent; }
  .h5-list-row + .h5-list-row { border-top: 1px solid rgb(var(--gray-236)); }
  .h5-list-row .h5-row-extra { max-width: 72px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--h5-muted); font-size: 10px; }
  .h5-avatar, .h5-profile-avatar, .h5-recommend-art, .h5-post-cover, .h5-chat-art {
    display: grid; place-items: center; flex: none; min-width: 0; overflow: hidden;
    color: rgb(var(--gray-110)); background: radial-gradient(circle at 28% 20%, rgba(var(--gray-255), 0.533), transparent 52%), linear-gradient(140deg, rgb(var(--gray-236)), rgb(var(--gray-222)));
  }
  .h5-avatar { width: 40px; height: 40px; border-radius: 10px; font-size: 17px; font-weight: 700; }
  .h5-active .h5-avatar img,
  .h5-active .h5-profile-avatar img,
  .h5-active .h5-recommend-art img,
  .h5-active .h5-post-cover img,
  .h5-active .h5-chat-art img { display: block; width: 100%; height: 100%; object-fit: cover; }
  .h5-empty { display: grid; grid-template-columns: 23px minmax(0, 1fr) auto; align-items: center; gap: 8px; min-height: 64px; padding: 10px; border: 1px solid var(--h5-line); border-radius: var(--h5-radius); background: rgba(var(--gray-255), 0.729); }
  .h5-empty > .h5-icon { color: rgb(var(--gray-168)); }
  .h5-empty .h5-text small { white-space: normal; }
  .h5-active .h5-chip { display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-height: 44px; padding: 5px 10px; border: 1px solid rgb(var(--gray-222)); border-radius: 999px; background: rgb(var(--gray-245)); color: rgb(var(--gray-80)); font-size: 12px; white-space: nowrap; }
  .h5-active .h5-chip.selected { color: rgb(var(--gray-56)); background: rgb(var(--gray-222)); border-color: rgb(var(--gray-200)); font-weight: 700; }
  .h5-chip .h5-icon { width: 16px; height: 16px; }

  .h5-active .h5-tile {
    position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 5px;
    min-width: 0; min-height: 92px; padding: 8px; border: 1px solid rgb(var(--gray-236)); border-radius: 15px;
    background: linear-gradient(145deg, rgb(var(--gray-222)), rgb(var(--gray-245)) 95%);
  }
  .h5-create-grid .h5-tile:nth-child(2), .h5-create-grid .h5-tile:nth-child(3) { background: linear-gradient(145deg, rgb(var(--gray-236)), rgb(var(--gray-245))); border-color: rgb(var(--gray-236)); }
  .h5-tile > .h5-sticker { align-self: center; }
  .h5-tile .h5-text strong { font-size: 13px; }
  .h5-tile .h5-text small { font-size: 10px; }
  .h5-tile .h5-text { width: 100%; }
  .h5-tile .h5-chevron { position: absolute; right: 4px; bottom: 7px; width: 12px; height: 12px; }
  .h5-tile:has(.h5-chevron) .h5-text small { padding-right: 7px; }
  .h5-sticker {
    display: grid; place-items: center; flex: none; width: 35px; height: 35px; padding: 6px; border-radius: 12px;
    color: rgb(var(--gray-110)); background: radial-gradient(circle at 29% 19%, rgb(var(--gray-255)) 3%, rgb(var(--gray-236)) 38%, rgb(var(--gray-200)) 100%);
    box-shadow: inset 0 1px 2px rgb(var(--gray-255)), 0 3px 6px rgba(var(--gray-110), 0.11);
  }
  .h5-sticker.pink { color: rgb(var(--gray-80)); background: radial-gradient(circle at 29% 19%, rgb(var(--gray-255)), rgb(var(--gray-236)) 40%, rgb(var(--gray-200))); }
  .h5-sticker.blue { color: rgb(var(--gray-110)); background: radial-gradient(circle at 29% 19%, rgb(var(--gray-255)), rgb(var(--gray-236)) 40%, rgb(var(--gray-200))); }
  .h5-create-grid .h5-sticker { width: 41px; height: 41px; padding: 8px; transform: rotate(-8deg); }
  .h5-recommend { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .h5-active .h5-recommend-card { display: block; position: relative; width: 100%; min-width: 0; height: auto; padding: 0; overflow: hidden; border: 1px solid var(--h5-line); border-radius: 13px; background: rgb(var(--gray-236)); }
  .h5-active .h5-recommend-card::before { content: ''; display: block; width: 100%; padding-top: 108.695%; }
  .h5-recommend-art { position: absolute; top: 0; right: 0; bottom: 0; left: 0; inset: 0; width: 100%; height: 100%; }
  .h5-recommend-art img { object-position: center 34%; }
  .h5-recommend-card .h5-text { position: absolute; top: auto; right: 0; bottom: 0; left: 0; inset: auto 0 0; padding: 5px 6px; background: rgba(var(--gray-245), 0.929); border-radius: 10px 10px 0 0; }
  .h5-recommend-card .h5-text small { margin-top: 0; font-size: 10px; }

  .h5-hero {
    position: relative; isolation: isolate; overflow: hidden; min-height: 89px;
    border: 1px solid rgb(var(--gray-222)); border-radius: var(--h5-radius); padding: 13px 75px 13px 12px;
    background: radial-gradient(ellipse at 100% 0%, rgb(var(--gray-200)) 0%, transparent 65%), linear-gradient(125deg, rgb(var(--gray-222)), rgb(var(--gray-245)) 75%);
  }
  .h5-hero h1 { margin: 0; color: var(--h5-ink); font-size: 22px; line-height: 1.25; font-weight: 770; letter-spacing: .035em; }
  .h5-hero p { margin: 5px 0 0; font-size: 12px; color: var(--h5-muted); }
  .h5-hero-art { position: absolute; right: 13px; top: 50%; width: 56px; height: 56px; color: rgb(var(--gray-110)); transform: translateY(-50%) rotate(-12deg); filter: drop-shadow(0 6px 5px rgba(var(--gray-136), 0.541)); }
  .h5-tags:empty { display: none; }
  .h5-square-searchbar { margin-bottom: 6px; }
  .h5-square-searchbar .h5-search { gap: 6px; min-height: 36px; margin: 0; padding-inline: 10px; }
  .h5-square-searchbar .h5-search input { min-height: 34px; }
  .h5-square-searchbar .h5-search input::placeholder { font-size: 13px; }
  .h5-square-searchbar .h5-search .h5-icon { width: 16px; height: 16px; }
  .h5-square-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; margin-bottom: 6px; }
  .h5-active .h5-square-searchbar .h5-chip,
  .h5-active .h5-square-tabs .h5-chip {
    min-width: 0; min-height: 34px; padding: 3px 7px; gap: 3px; font-size: 12px;
  }
  .h5-active .h5-square-searchbar .h5-chip { min-height: 36px; }
  .h5-square-tabs .h5-icon { width: 13px; height: 13px; }
  .h5-square-results {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 9px;
  }
  .h5-square-results:empty { display: none; }
  .h5-active .h5-post-card {
    display: block; position: relative; isolation: isolate; width: 100%; min-width: 0; height: auto;
    padding: 0; overflow: hidden; border: 1px solid var(--h5-line); border-radius: 15px;
    background: #252525; color: #fff;
  }
  /* 使用 padding-top 占位撑开卡片纵横比，兼容旧版 Android/OEM 内核（Chromium < 88 不支持 aspect-ratio 导致卡片塌陷成细白条） */
  .h5-active .h5-post-card::before {
    content: ''; display: block; width: 100%; padding-top: 150%;
  }
  .h5-active .h5-post-card:focus-visible { outline-offset: -3px; }
  .h5-post-cover { position: absolute; top: 0; right: 0; bottom: 0; left: 0; inset: 0; width: 100%; height: 100%; font-size: 46px; font-weight: 720; }
  .h5-post-cover img { object-position: center 34%; }
  .h5-active .h5-square-results .h5-post-cover::after {
    content: ''; position: absolute; top: 0; right: 0; bottom: 0; left: 0; inset: 0;
    background: linear-gradient(transparent 21%, #0002 37%, #0009 61%, #000f 100%);
  }
  .h5-badge { position: absolute; top: 8px; left: 8px; padding: 2px 7px; border-radius: 7px; background: #000a; color: #fff; font-size: 10px; }
  .h5-badge.h5-post-audience { left: auto; right: 8px; }
  .h5-post-body { position: absolute; top: auto; right: 0; bottom: 0; left: 0; inset: auto 0 0; display: grid; gap: 4px; padding: 9px 9px 10px; text-shadow: 0 1px 3px #0009; }
  .h5-post-body strong { font-size: clamp(14px, 4.2vw, 19px); line-height: 1.25; }
  .h5-post-body strong, .h5-post-body small { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; }
  .h5-post-body small { color: #eee; font-size: 11px; line-height: 1.4; }
  .h5-post-author { overflow: hidden; color: #ddd; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
  .h5-post-body .h5-tags { margin: 0; }
  .h5-post-body .h5-tags > span { max-width: 74%; padding: 1px 6px; border: 1px solid #fff4; font-size: 10px; }
  .h5-post-stats { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 3px; color: #eee; font-size: 11px; font-variant-numeric: tabular-nums; }
  .h5-post-stats > span { display: inline-flex; align-items: center; gap: 3px; }
  .h5-post-stats .h5-icon { width: 13px; height: 13px; }
  .h5-tags { display: flex; flex-wrap: wrap; gap: 4px; margin: 3px 0; }
  .h5-tags > span { max-width: 100%; padding: 1px 6px; border-radius: 99px; color: rgb(var(--gray-80)); background: rgb(var(--gray-236)); font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .h5-square-more { margin-top: 10px; text-align: center; }
  .h5-square-more p { margin: 0; color: var(--h5-muted); font-size: 12px; }

  .h5-create-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
  .h5-create-grid .h5-tile { min-height: 104px; padding: 9px 12px; }
  .h5-create-grid .h5-tile .h5-text strong { font-size: 15px; }
  .h5-page > .h5-chip { margin-top: 10px; }
  .h5-assist-banner {
    display: flex; align-items: center; justify-content: space-between; gap: 14px;
    margin: 10px 0 14px; padding: 15px 16px; border: 1px solid var(--h5-line); border-radius: 18px;
    background: linear-gradient(130deg, rgb(var(--gray-245)), rgb(var(--gray-222))); color: var(--h5-ink);
  }
  .h5-assist-banner small, .h5-assist-result small { display: block; margin-bottom: 4px; color: var(--h5-muted); font-size: 12px; font-weight: 650; }
  .h5-assist-banner strong { display: block; font-size: 20px; line-height: 1.25; }
  .h5-assist-banner p { margin: 6px 0 0; color: var(--h5-muted); font-size: 13px; }
  .h5-assist-banner .h5-icon { width: 30px; height: 30px; }
  .h5-assist-form, .h5-assist-preview { margin: 0 0 14px; padding: 14px; border: 1px solid var(--h5-line); border-radius: 18px; background: rgb(var(--gray-255)); }
  .h5-assist-step { margin: 0 0 9px; font-size: 15px; line-height: 1.35; }
  .h5-assist-choices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-bottom: 18px; }
  .h5-active .h5-assist-choice {
    display: grid; align-content: start; gap: 3px; min-width: 0; min-height: 77px; padding: 8px;
    border: 1px solid var(--h5-line); border-radius: 12px; background: rgb(var(--gray-250));
    color: var(--h5-ink); line-height: 1.25; text-align: left;
  }
  .h5-active .h5-assist-choice[aria-pressed='true'] { border-color: var(--h5-ink); background: var(--h5-ink); color: rgb(var(--gray-255)); }
  .h5-assist-choice .h5-icon { width: 17px; height: 17px; margin-bottom: 2px; }
  .h5-assist-choice strong { font-size: 13px; }
  .h5-assist-choice small { font-size: 11px; opacity: .78; }
  .h5-assist-hint { margin: 0 0 8px; color: var(--h5-muted); font-size: 13px; }
  .h5-assist-ideas, .h5-assist-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
  .h5-assist-ideas > span { margin-right: 1px; color: var(--h5-muted); font-size: 12px; }
  .h5-active .h5-assist-ideas .h5-chip { min-height: 36px; padding: 4px 8px; font-size: 12px; }
  .h5-assist-field { display: grid; gap: 5px; min-width: 0; color: var(--h5-ink); font-size: 13px; font-weight: 650; }
  .h5-assist-field textarea,
  .h5-assist-field select {
    width: 100%; min-width: 0; padding: 9px; border: 1px solid var(--h5-line); border-radius: 10px;
    background: rgb(var(--gray-250)); color: var(--h5-text); font-weight: 400;
  }
  .h5-assist-field textarea { resize: none; line-height: 1.6; }
  .h5-assist-field textarea::placeholder { color: var(--h5-muted); opacity: 1; }
  .h5-assist-field select { min-height: 42px; }
  .h5-assist-count { display: block; margin-top: 4px; color: var(--h5-muted); font-size: 11px; text-align: right; }
  .h5-assist-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 8px 0 0; }
  .h5-assist-form button:disabled, .h5-assist-preview button:disabled { opacity: .56; }
  .h5-assist-status { margin: 0 0 14px; padding: 10px 12px; border: 1px solid var(--h5-line); border-radius: 10px; color: var(--h5-muted); font-size: 13px; overflow-wrap: anywhere; }
  .h5-assist-status.is-error { border-color: currentColor; color: var(--h5-ink); }
  .h5-assist-preview p { margin: 0 0 8px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; }
  .h5-assist-result h2 { margin: 0 0 5px; font-size: 21px; line-height: 1.25; overflow-wrap: anywhere; scroll-margin-top: 12px; }
  .h5-assist-result p { color: var(--h5-muted); }
  .h5-assist-detail { margin-top: 8px; border: 1px solid var(--h5-line); border-radius: 11px; background: rgb(var(--gray-250)); }
  .h5-assist-detail summary { min-height: 44px; padding: 11px 10px; font-size: 14px; font-weight: 650; cursor: pointer; overflow-wrap: anywhere; }
  .h5-assist-detail p { padding: 0 10px 4px; }
  .h5-assist-entry-key { display: block; padding: 0 10px 5px; color: var(--h5-muted); font-size: 12px; overflow-wrap: anywhere; }
  .h5-assist-refine { margin-top: 15px; padding-top: 12px; border-top: 1px solid var(--h5-line); }
  .h5-assist-refine h3 { margin: 0 0 4px; font-size: 15px; }
  .h5-assist-refine .h5-assist-hint { white-space: normal; }
  .h5-assist-actions { margin: 8px 0 0; }
  .h5-library-tabs { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 2px; margin: 10px 0; padding: 3px; border: 1px solid var(--h5-line); border-radius: 13px; background: rgba(var(--gray-255), 0.722); }
  .h5-library-gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .h5-active .h5-gallery-card { min-width: 0; overflow: hidden; padding: 0; border: 1px solid var(--h5-line); border-radius: 12px; background: rgb(var(--gray-255)); }
  .h5-gallery-card img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; background: rgb(var(--gray-236)); }
  @supports not (aspect-ratio: 1) {
    .h5-gallery-card img { height: 44vw; }
  }
  .h5-gallery-card span { display: block; overflow: hidden; padding: 6px 8px; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
  .h5-active .h5-library-tab { display: grid; justify-items: center; align-content: center; gap: 1px; min-height: 47px; min-width: 0; padding: 0; border: 0; border-radius: 10px; background: transparent; color: rgb(var(--gray-80)); font-size: 11px; }
  .h5-active .h5-library-tab[aria-pressed='true'] { color: rgb(var(--gray-56)); background: rgb(var(--gray-222)); font-weight: 700; }
  .h5-library-controls { display: flex; align-items: flex-start; gap: 6px; }
  .h5-library-controls .h5-search { margin-bottom: 1px; }
  .h5-profile { display: flex; align-items: center; gap: 9px; margin: 9px 0 13px; padding: 10px 0; }
  .h5-profile-avatar { width: 60px; height: 60px; border: 3px solid rgb(var(--gray-236)); border-radius: 50%; box-shadow: 0 0 0 1px rgb(var(--gray-200)); font-size: 24px; font-weight: 730; }
  .h5-profile .h5-text strong { font-size: 19px; }
  .h5-settings .h5-list-row { min-height: 60px; }

  .h5-chat-intro { display: block; flex: none; padding: 4px var(--h5-edge) 6px; }
  .h5-active[data-h5-page='draw'] .h5-chat-intro { display: none; }
  .h5-chat-top { display: flex; align-items: center; gap: 5px; margin-bottom: 5px; }
  .h5-chat-top h1 { flex: 1; min-width: 0; margin: 0 0 0 2px; font-size: 16px; font-weight: 730; }
  .h5-chat-spacer { flex: 1; }
  .h5-chat-top .h5-icon-button { background: rgba(var(--gray-255), 0.58); }
  .h5-chat-hero { display: grid; grid-template-columns: minmax(90px, .48fr) 1fr; grid-template-rows: auto auto; align-items: center; column-gap: 10px; position: relative; overflow: hidden; min-height: 78px; padding-right: 10px; border: 1px solid rgb(var(--gray-222)); border-radius: var(--h5-radius); background: linear-gradient(105deg, rgb(var(--gray-236)), rgb(var(--gray-222))); }
  .h5-chat-art { grid-row: 1 / 3; align-self: stretch; min-height: 78px; max-height: 118px; width: 100%; position: relative; font-size: 32px; font-weight: 720; }
  .h5-chat-art img { object-position: 50% 32%; }
  .h5-chat-hero .h5-text { grid-row: 1 / 3; }
  .h5-chat-hero:has(.h5-scenario) .h5-text { grid-row: 1; align-self: end; }
  .h5-chat-hero .h5-text strong { font-size: 20px; color: var(--h5-ink); }
  .h5-chat-hero.tavern { background: linear-gradient(125deg, rgb(var(--gray-56)), rgb(var(--gray-80))); border-color: rgb(var(--gray-80)); }
  .h5-chat-hero.tavern .h5-text strong,
  .h5-chat-hero.tavern .h5-text small,
  .h5-chat-hero.tavern .h5-scenario { color: rgb(var(--gray-255)); }
  .h5-scenario { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; align-self: start; overflow: hidden; font-size: 11px; margin: 4px 0 6px; }
  .h5-chat-tools { display: flex; align-items: stretch; gap: 4px; margin-top: 5px; }
  .h5-chat-tools > * { min-width: 0; flex: 1; }
  .h5-active .h5-chat-tools .h5-chip { min-height: 36px; padding: 0 3px; gap: 3px; }
  .h5-chat-tools .h5-chip .h5-icon { width: 14px; height: 14px; }
  .h5-chat-tools .h5-list-row { padding: 5px 6px; border: 1px solid var(--h5-line); border-radius: 12px; background: rgb(var(--gray-245)); }
  .h5-chat-tools .h5-list-row:nth-child(1) { background: rgb(var(--gray-245)); }
  .h5-chat-tools .h5-list-row .h5-sticker { width: 25px; height: 25px; padding: 4px; border-radius: 8px; }
  .h5-chat-tools .h5-list-row .h5-text strong { font-size: 12px; }
  .h5-chat-tools .h5-list-row .h5-text small { font-size: 10px; }
  .h5-chat-tools .h5-chevron { display: none; }
  .h5-chat-start .h5-chip { margin: 9px 6px 0 0; }
  .h5-active .messages { padding: 10px var(--h5-edge) 5px; overscroll-behavior-y: contain; background: linear-gradient(140deg, rgb(var(--gray-250)), rgb(var(--gray-250)) 55%, rgb(var(--gray-245))); }
  .h5-active .messages .row { gap: 7px; margin-bottom: 10px; }
  .h5-active .messages .row.grouped { margin-top: -5px; }
  .h5-active .messages .row.me .avatar { display: grid; background: rgb(var(--gray-222)); color: rgb(var(--gray-80)); }
  .h5-active .messages .row.ai .avatar { background: rgb(var(--gray-222)); color: rgb(var(--gray-80)); }
  .h5-active .messages .bubble { max-width: min(78%, 500px); padding: 8px 10px; border-radius: 14px; color: var(--h5-text); font-size: var(--chat-font-size, 14.5px); line-height: 1.55; overflow-wrap: anywhere; }
  .h5-active .messages .row.me .bubble { background: rgb(var(--gray-222)); border-top-right-radius: 5px; }
  .h5-active .messages .row.ai .bubble { background: rgb(var(--gray-255)); border: 1px solid var(--h5-line); border-top-left-radius: 5px; }
  .h5-active .messages .row.ai.story-opening .bubble { max-width: 660px; padding: 14px; border-radius: 16px; }
  .h5-active #messages.story-creation-chat .story-narration .bubble { font-size: calc(var(--chat-font-size, 14.5px) - 1px); }
  .h5-active #messages.story-creation-chat .row.me .bubble { font-size: calc(var(--chat-font-size, 14.5px) - 1px); }
  .h5-active #messages.story-creation-chat .story-narration { gap: 4px; margin-bottom: 18px; }
  .h5-active .h5-no-character .composer-wrap { display: none; }
  .h5-active .composer-wrap { background: rgb(var(--gray-255)); border-top: 1px solid var(--h5-line); padding: 5px var(--h5-edge); }
  .h5-active .composer { min-height: 50px; gap: 7px; border: 1px solid var(--h5-line); border-radius: 22px; background: rgb(var(--gray-250)); padding: 3px 4px 3px 13px; box-shadow: none; }
  .h5-active .composer:focus-within { border-color: rgb(var(--gray-136)); box-shadow: none; }
  .h5-active #input { min-width: 0; min-height: 44px; padding: 10px 0; line-height: 1.5; color: var(--h5-text); }
  .h5-active #input:focus-visible { outline: none; }
  .h5-active .composer.voice-mode { padding: 4px 6px; }
  .h5-active .composer .voice-hold-btn { height: 42px; border-radius: 17px; font-size: 15px; }
  .h5-active #sendBtn { width: 44px; height: 44px; border-radius: 50%; background: var(--h5-ink); color: rgb(var(--gray-255)); touch-action: manipulation; }
  .h5-active #sendBtn:disabled { background: rgb(var(--gray-168)); color: rgb(var(--gray-255)); opacity: .78; }
  .h5-active .empty .cta { min-height: 44px; color: rgb(var(--gray-80)); border-color: var(--h5-line); }
  .h5-active.h5-keyboard .h5-nav,
  .h5-active.h5-keyboard .h5-chat-hero,
  .h5-active.h5-keyboard .h5-chat-tools { display: none; }
  .h5-active.h5-keyboard[data-h5-page='chat'] .composer-wrap { padding-bottom: 8px; }

  .h5-shade {
    position: fixed; z-index: 35; top: var(--h5-top, 0px); right: 0; bottom: auto; left: 0; inset: var(--h5-top, 0px) 0 auto; height: 100vh; height: var(--h5-height, 100dvh);
    display: flex; align-items: flex-end; justify-content: center;
    background: rgba(var(--gray-34), 0.459);
  }
  .h5-drawer {
    width: 100%; max-width: 620px;
    max-height: calc(var(--h5-height, 100dvh) - max(24px, var(--safe-top, 0px), env(safe-area-inset-top, 0px)) - 10px);
    box-sizing: border-box;
    overflow-x: hidden; overflow-y: auto; overscroll-behavior-y: contain;
    padding: 14px var(--h5-edge) max(17px, env(safe-area-inset-bottom)); border-radius: 26px 26px 0 0;
    background: radial-gradient(ellipse 80% 170px at 72% 0%, rgb(var(--gray-222)), transparent), rgb(var(--gray-250));
    box-shadow: 0 -10px 38px rgba(var(--gray-34), 0.196);
  }
  .h5-drawer::before { content: ''; display: block; width: 39px; height: 4px; margin: -5px auto 2px; border-radius: 99px; background: rgb(var(--gray-168)); }
  .h5-drawer-head { display: flex; align-items: center; gap: 7px; }
  .h5-drawer-head > .h5-icon { color: rgb(var(--gray-136)); width: 24px; height: 24px; }
  .h5-drawer-head h2 { flex: 1; margin: 0; font-size: 21px; color: var(--h5-ink); }
  .h5-drawer-lead { margin: 1px 0 10px; font-size: 13px; color: var(--h5-muted); }
  .h5-install-brand { display: flex; align-items: center; gap: 12px; margin: 8px 0 14px; }
  .h5-install-brand img { width: 48px; height: 48px; border-radius: 12px; }
  .h5-install-brand strong,
  .h5-install-brand small { display: block; }
  .h5-install-brand small { margin-top: 4px; color: var(--h5-muted); }
  .h5-install-steps { margin: 0 0 6px; padding-left: 23px; color: var(--h5-ink); font-size: 14px; line-height: 1.65; }
  .h5-install-steps li + li { margin-top: 6px; }
  .h5-install-action { width: 100%; min-height: 44px; justify-content: center; }
  .h5-mode-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 5px; width: 100%; min-width: 0; }
  .h5-mode-list .h5-list-row { width: 100%; max-width: 100%; min-width: 0; box-sizing: border-box; border: 1px solid var(--h5-line); border-radius: 12px; background: rgba(var(--gray-255), 0.639); }
  .h5-mode-list .h5-list-row.selected { border-color: rgb(var(--gray-136)); background: rgb(var(--gray-236)); }
  .h5-story-personas .h5-text small { white-space: normal; }
  .h5-mode-check { display: grid; place-items: center; flex: none; width: 23px; height: 23px; padding: 4px; border-radius: 50%; background: rgb(var(--gray-110)); color: rgb(var(--gray-255)); }
  .h5-mode-check svg { width: 100%; }
  .h5-drawer > .h5-chip { margin-top: 8px; }
  .h5-history-row { display: flex; align-items: center; padding-right: 6px; }
  .h5-history-row + .h5-history-row { border-top: 1px solid var(--h5-line); }

  .h5-active .sheet {
    top: auto; right: 0; left: 0; bottom: 0; width: 100%;
    max-height: calc(var(--h5-height, 100dvh) - max(22px, var(--safe-top, 0px), env(safe-area-inset-top, 0px)) - 10px);
    z-index: 41;
    padding: 0 var(--h5-edge) 0;
    border: 0; border-top: 1px solid var(--h5-line); border-radius: 26px 26px 0 0;
    transform: translateY(110%); visibility: hidden; overscroll-behavior-y: contain;
    background: rgb(var(--gray-250));
    box-shadow: 0 -14px 40px rgba(0, 0, 0, .14);
  }
  .h5-active .sheet.show { transform: none; visibility: visible; }
  .h5-active.h5-keyboard .sheet { top: calc(var(--h5-top, 0px) + max(10px, var(--safe-top, 0px))); bottom: auto; max-height: calc(var(--h5-height, 100dvh) - max(10px, var(--safe-top, 0px))); }
  .h5-active .sheet .mini-btn,
  .h5-active .sheet .switch-btn,
  .h5-active .sheet .save-btn,
  .h5-active .sheet .test-btn,
  .h5-active .sheet .pers-chip { min-height: 42px; }
  .h5-active .sheet .save-btn { height: 46px; border-radius: 14px; font-size: 15px; font-weight: 650; background: var(--h5-ink); border-color: var(--h5-ink); color: rgb(var(--gray-255)); }
  .h5-active .sheet .test-btn { border-radius: 13px; font-size: 13.5px; font-weight: 560; }
  .h5-active .sheet .ghost-btn { flex: none; min-height: 36px; height: 36px; padding: 0 14px; border: 1px solid var(--h5-line); border-radius: 999px; background: rgba(var(--gray-255), 0.85); color: rgb(var(--gray-80)); font: inherit; font-size: 13px; font-weight: 560; }
  .h5-active .h5-use-server { display: inline-block; align-self: flex-start; margin: 0 0 12px; color: rgb(var(--gray-80)); background: rgb(var(--gray-236)); border-color: var(--h5-line); }
  .h5-active .sheet:not(#authSheet):not(#postSheet) .sheet-head {
    position: sticky; top: 0; z-index: 6;
    min-height: 54px;
    margin: 0 calc(var(--h5-edge) * -1) 14px;
    padding: 18px var(--h5-edge) 11px;
    background: rgba(var(--gray-250), .98);
    border-bottom: 1px solid var(--h5-line);
  }
  .h5-active .sheet:not(#authSheet):not(#postSheet) .sheet-head::before {
    content: ''; position: absolute; top: 7px; left: 50%; transform: translateX(-50%);
    width: 36px; height: 4px; border-radius: 99px;
    background: rgba(var(--gray-128), .28);
  }
  .h5-active .sheet:not(#authSheet):not(#postSheet) .sheet-head h2,
  .h5-active .sheet:not(#authSheet):not(#postSheet) .sheet-head h3 { font-size: 17px; font-weight: 720; letter-spacing: -.01em; margin: 0; overflow-wrap: anywhere; }
  .h5-active .sheet-head .sheet-sub { margin: 2px 0 0; overflow-wrap: anywhere; color: var(--h5-muted); font-size: 12px; }
  .h5-active .sheet:not(#authSheet):not(#postSheet) .sheet-foot {
    position: sticky; bottom: -1px; z-index: 6;
    margin: 12px calc(var(--h5-edge) * -1) 0;
    padding: 11px var(--h5-edge) max(15px, calc(env(safe-area-inset-bottom) + 1px));
    background: rgba(var(--gray-250), .98);
    box-shadow: 0 4px 0 rgb(var(--gray-250));
    border-top: 1px solid var(--h5-line);
    flex-wrap: nowrap;
  }
  .h5-active .sheet:not(#authSheet):not(#postSheet) #tavernToolsBody {
    padding-bottom: max(18px, env(safe-area-inset-bottom));
  }
  .h5-active .sheet-mask { z-index: 40; background: rgba(0, 0, 0, .46); }
  /* 全局移动端 WebView 防 GPU 瓦片丢帧/白块/缺字护盾：禁止滚动列表、图标徽章、抽屉、弹窗与聊天气泡触发重度 backdrop-filter 合成层 */
  .h5-active .h5-drawer,
  .h5-active .h5-drawer *,
  .h5-active .sheet,
  .h5-active .sheet *,
  .h5-active .h5-list,
  .h5-active .h5-list *,
  .h5-active .h5-page .h5-sticker,
  .h5-active .h5-page .h5-chip,
  .h5-active .h5-page .h5-card,
  .h5-active .h5-page .h5-post-card,
  .h5-active .h5-page .h5-story-card,
  .h5-active #messages .bubble {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }
  .h5-active #authMask { z-index: 130; }
  .h5-active #authSheet { z-index: 131; }
  .h5-active[data-h5-page='post'] #postSheet {
    top: var(--h5-top, 0px); bottom: auto; height: var(--h5-height, 100dvh); max-height: none; border: 0; border-radius: 0;
    padding-top: max(10px, env(safe-area-inset-top));
    background: radial-gradient(ellipse at 75% 0%, rgb(var(--gray-236)), transparent 220px), rgb(var(--gray-250));
  }
  .h5-active[data-h5-page='post'] #postSheet .sheet-head { flex-direction: row-reverse; justify-content: flex-end; gap: 8px; }
  .h5-active[data-h5-page='post'] #postSheet .sheet-head > div { flex: 1; min-width: 0; }
  .h5-active[data-h5-page='post'] #poCover { height: clamp(155px, 48vw, 240px); max-height: none; aspect-ratio: auto; border: 1px solid var(--h5-line); border-radius: 16px; background: rgb(var(--gray-222)); }
  .h5-active[data-h5-page='post'] #poCover img { width: 100%; height: 100%; object-fit: cover; object-position: center 34%; }
  .h5-active[data-h5-page='post'] #postSheet[data-post-kind='character'] #poCover img { object-position: center 16%; }
  .h5-active[data-h5-page='post'] .h5-post-details { display: block; }
  .h5-post-details .h5-tags { margin: 8px 0; }
  .h5-detail-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; padding: 7px; text-align: center; background: rgb(var(--gray-236)); border-radius: 12px; }
  .h5-detail-author { display: flex; align-items: center; gap: 9px; margin-top: 8px; padding: 7px; border: 1px solid var(--h5-line); border-radius: 12px; background: rgba(var(--gray-255), 0.722); }
  .h5-detail-description { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; margin: 0 0 8px; overflow: hidden; overflow-wrap: anywhere; font-size: 13px; }
  .h5-active .h5-primary { display: flex; align-items: center; justify-content: center; gap: 7px; width: 100%; min-height: 46px; margin: 10px 0 0; border: 0; border-radius: 25px; background: linear-gradient(125deg, rgb(var(--gray-110)), rgb(var(--gray-110))); color: rgb(var(--gray-255)); font-weight: 730; }
  .h5-active .mj-mask {
    top: var(--h5-top, 0px); right: 0; bottom: auto; left: 0;
    inset: var(--h5-top, 0px) 0 auto;
    height: var(--h5-height, 100dvh);
  }
  .h5-active .grp-mask {
    inset: 0;
    height: 100%;
  }
  .h5-active.h5-keyboard .grp-mask {
    top: var(--h5-top, 0px); right: 0; bottom: auto; left: 0;
    inset: var(--h5-top, 0px) 0 auto;
    height: var(--h5-height, 100dvh);
  }
  .h5-active.h5-keyboard .mj-shell {
    height: 100%;
    max-height: 100%;
    border-radius: 16px 16px 0 0;
  }
  .h5-active.h5-keyboard .grp-card {
    max-height: calc(var(--h5-height, 100dvh) - 20px);
    overflow-y: auto;
  }
  .h5-toast { display: block; position: fixed; z-index: 160; left: 50%; bottom: max(70px, calc(55px + env(safe-area-inset-bottom))); transform: translateX(-50%); max-width: calc(100vw - 28px); width: max-content; padding: 8px 12px; border-radius: 12px; color: rgb(var(--gray-255)); background: rgb(var(--gray-56)); box-shadow: 0 5px 15px rgba(var(--gray-34), 0.196); font-size: 13px; overflow-wrap: anywhere; }
  .h5-keyboard .h5-toast { top: calc(var(--h5-top, 0px) + 3px); bottom: auto; }
}

@media (max-width: 380px) {
  .h5-active { --h5-edge: max(10px, env(safe-area-inset-left), env(safe-area-inset-right)); }
  .h5-tile .h5-text strong { font-size: 12px; }
  .h5-list-row .h5-row-extra { max-width: 60px; }
}

@media (max-width: 780px) and (max-height: 510px) {
  .h5-chat-hero, .h5-chat-tools { display: none; }
  .h5-nav .h5-nav-item { min-height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  .h5-active .sheet,
  .h5-active .row { animation-duration: .01ms; transition-duration: .01ms; }
}

/* 聊天页顶部标题：群名 + 人数/成员 */
.h5-chat-title { flex: 1; min-width: 0; margin-left: 2px; }
.h5-chat-title h1 {
  margin: 0; font-size: 15px; font-weight: 730; line-height: 1.25;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.h5-chat-sub {
  display: block; margin-top: 1px; font-size: 11px; line-height: 1.3;
  color: #8f8f8f;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
[data-theme="dark"] .h5-chat-sub { color: #9a9a9a; }

/* H5 群聊点名条 / 快捷操作 / 作者过滤条 */
.h5-active .group-bar {
  margin-bottom: 6px; padding: 0 2px; gap: 5px;
  overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch;
}
.h5-active .group-pill { flex: none; font-size: 11.5px; padding: 4px 9px; }
.h5-active .composer { padding-left: 8px; gap: 6px; }
.h5-active .tavern-message-controls { gap: 4px; }
.h5-active .msg-quick-btn { padding: 3px 8px; font-size: 11px; }
.h5-author-bar { margin: 8px 0 4px; padding: 7px 10px; font-size: 12.5px; }
.h5-detail-author { border: 0; background: transparent; width: 100%; text-align: left; cursor: pointer; }

/* 移动端点击跟手微反馈 + 长列表渲染隔离提速 */
@media (max-width: 780px) {
  .h5-active .h5-post-card,
  .h5-active .h5-wx-item,
  .h5-active .h5-list-row,
  .h5-active .h5-nav-item,
  .h5-active .h5-sq-seg-btn,
  .h5-active .h5-tag-pill,
  .h5-active .h5-chip,
  .h5-active .h5-icon-button {
    transition: transform .11s cubic-bezier(.22, 1, .36, 1), opacity .11s ease;
  }
  .h5-active .h5-post-card:active,
  .h5-active .h5-tile:active { transform: scale(.975); opacity: .9; }
  .h5-active .h5-wx-item:active,
  .h5-active .h5-list-row:active { opacity: .78; }
  .h5-active .h5-nav-item:active,
  .h5-active .h5-icon-button:active,
  .h5-active .h5-sq-seg-btn:active,
  .h5-active .h5-tag-pill:active,
  .h5-active .h5-chip:active { transform: scale(.94); }
  .h5-active .h5-post-card {
    content-visibility: auto;
    contain-intrinsic-size: auto 248px;
  }
  .h5-active .h5-wx-item {
    content-visibility: auto;
    contain-intrinsic-size: auto 72px;
  }
  .h5-active .bubble {
    -webkit-touch-callout: none;
  }
  .h5-active .h5-wx-msg.is-typing {
    color: var(--accent, #7c6aff);
    font-weight: 500;
  }
}




/* === theme.css === */
:root {
  color-scheme: light;
  --gray-0: 0, 0, 0;
  --gray-16: 16, 16, 16;
  --gray-34: 34, 34, 34;
  --gray-56: 56, 56, 56;
  --gray-80: 80, 80, 80;
  --gray-110: 110, 110, 110;
  --gray-128: 128, 128, 128;
  --gray-136: 136, 136, 136;
  --gray-168: 168, 168, 168;
  --gray-200: 200, 200, 200;
  --gray-222: 222, 222, 222;
  --gray-236: 236, 236, 236;
  --gray-245: 245, 245, 245;
  --gray-250: 250, 250, 250;
  --gray-255: 255, 255, 255;
}

:root[data-theme='dark'] {
  color-scheme: dark;
  --gray-0: 255, 255, 255;
  --gray-16: 245, 245, 245;
  --gray-34: 230, 230, 230;
  --gray-56: 212, 212, 212;
  --gray-80: 190, 190, 190;
  --gray-110: 164, 164, 164;
  --gray-128: 128, 128, 128;
  --gray-136: 128, 128, 128;
  --gray-168: 96, 96, 96;
  --gray-200: 65, 65, 65;
  --gray-222: 42, 42, 42;
  --gray-236: 28, 28, 28;
  --gray-245: 19, 19, 19;
  --gray-250: 13, 13, 13;
  --gray-255: 0, 0, 0;
}

.tavern-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.tavern-tool-note { margin: 0 0 12px; color: var(--fg-2); overflow-wrap: anywhere; }
.tavern-action[aria-pressed='true'] { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.tavern-message-controls { display: flex; align-items: center; gap: 2px; align-self: flex-end; margin-bottom: 2px; }
.tavern-message-controls small { color: var(--fg-2); font-variant-numeric: tabular-nums; }
.tavern-message-controls .tavern-action { min-width: 32px; min-height: 32px; padding: 0 5px; }
.tavern-message-controls .tavern-action:disabled { opacity: .4; }
.tavern-advanced { margin: 10px 0 16px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; }
.tavern-advanced summary { cursor: pointer; font-weight: 650; }
.tavern-advanced[open] summary { margin-bottom: 10px; }
.tavern-advanced .field:last-child { margin-bottom: 0; }
.tavern-rule-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.tavern-rule-fields input { width: 100%; padding: 6px 8px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--bg); color: var(--fg); }
.h5-square-searchbar { display: flex; align-items: flex-start; gap: 6px; }
.h5-square-searchbar .h5-search { flex: 1; min-width: 0; }
.h5-square-genres { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }

@media (max-width: 780px) {
  .h5-active, .h5-active .app, .h5-active .messages,
  .h5-active .h5-nav, .h5-active .h5-drawer, .h5-active .composer-wrap,
  .h5-active .sheet, .h5-active[data-h5-page='post'] #postSheet { background: var(--bg); }
  .h5-active .h5-nav { box-shadow: none; }
  .h5-active .h5-section-head h2::before { background: var(--fg); }
  .h5-active .h5-create-grid .h5-tile,
  .h5-active .h5-sticker,
  .h5-active .h5-hero,
  .h5-active .h5-avatar,
  .h5-active .h5-profile-avatar { background: var(--bg-soft); border-color: var(--line); }
  .h5-active .h5-sticker,
  .h5-active .h5-hero-art,
  .h5-active .h5-nav-item .h5-icon { box-shadow: none; filter: none; color: currentColor; }
  .h5-active .h5-primary,
  .h5-active .h5-chip.selected,
  .h5-active .h5-post-action,
  .h5-active #sendBtn:not(:disabled), .h5-active .sheet .save-btn { background: var(--fg); color: var(--bg); border-color: var(--fg); }
  .h5-active .h5-post-card { color: #fff; background: #252525; }
  .h5-active .h5-post-cover::after { background: linear-gradient(transparent 32%, #0005 58%, #000e 100%); }
  .h5-active .h5-post-body .h5-tags > span { background: #000b; color: #fff; }
  .h5-active .h5-post-action { background: #fff; color: #000; }
  .h5-active .h5-chat-hero.tavern { background: var(--bg-soft); border-color: var(--line); }
  .h5-active .h5-chat-hero.tavern .h5-text strong,
  .h5-active .h5-chat-hero.tavern .h5-text small,
  .h5-active .h5-chat-hero.tavern .h5-scenario { color: var(--fg); }
  .h5-active .messages .row.has-msg-controls { flex-wrap: wrap; }
  .h5-active .messages .row:has(.tavern-message-controls) { flex-wrap: wrap; }
  .h5-active .messages .tavern-message-controls { flex-basis: 100%; margin-inline: 33px 0; }
  .h5-active .messages .row.me .tavern-message-controls { justify-content: flex-end; margin-inline: 0; }
  .h5-active .tavern-message-controls .tavern-action { min-width: 38px; min-height: 34px; }
  .h5-active #tavernToolsSheet .tavern-action { min-height: 44px; }
}


/* === skin-porcelain.css === */
/* skin-porcelain.css —— 月见 H5「珍珠陶瓷白 + 手绘小猫耳搜索框 + 满幅卡片」主题皮肤
 * 仅作用于 <= 780px H5 端（body.h5-active[data-h5-skin="porcelain"]），完全不影响桌面端与经典模式。
 */

@media (max-width: 780px) {
  body.h5-active[data-h5-skin='porcelain'] {
    --porc-bg: #ffffff;
    --porc-surface: rgba(255, 255, 255, .92);
    --porc-soft: #f4f5f8;
    --porc-user-bub: #eceef3;
    --porc-pill-on: #a2a8b5;
    --porc-pill-on-ink: #ffffff;
    --porc-ink: #1a1d24;
    --porc-sub: #888f9d;
    --porc-line: #eceef3;
    --porc-shadow: 0 8px 24px rgba(20, 26, 40, .065);
    --porc-shadow-sm: 0 3px 10px rgba(20, 26, 40, .045);
    --h5-ink: var(--porc-ink);
    --h5-text: var(--porc-ink);
    --h5-muted: var(--porc-sub);
    --h5-line: var(--porc-line);
    --h5-radius: 20px;
    background: var(--porc-bg);
    color: var(--porc-ink);
  }

  :root[data-theme='dark'] body.h5-active[data-h5-skin='porcelain'] {
    --porc-bg: #111216;
    --porc-surface: rgba(26, 28, 34, .92);
    --porc-soft: #1c1e24;
    --porc-user-bub: #282b34;
    --porc-pill-on: #e5e8f0;
    --porc-pill-on-ink: #14161c;
    --porc-ink: #f2f4f8;
    --porc-sub: #8f96a6;
    --porc-line: rgba(255, 255, 255, .10);
    --porc-shadow: 0 10px 26px rgba(0, 0, 0, .38);
    --porc-shadow-sm: 0 3px 10px rgba(0, 0, 0, .25);
  }

  body.h5-active[data-h5-skin='porcelain'],
  body.h5-active[data-h5-skin='porcelain'] .app,
  body.h5-active[data-h5-skin='porcelain'] .h5-page,
  body.h5-active[data-h5-skin='porcelain'] .messages {
    background: var(--porc-bg);
  }

  /* ---------- 广场顶部品牌栏 ---------- */
  .h5-sq-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 6px 2px 10px;
  }
  .h5-sq-brand {
    display: inline-flex; align-items: center; gap: 8px;
  }
  .h5-sq-moon {
    width: 24px; height: 24px; display: inline-grid; place-items: center;
    color: var(--porc-ink, currentColor);
  }
  .h5-sq-brand h1 {
    margin: 0; font-size: 22px; font-weight: 800; letter-spacing: .4px;
    color: var(--porc-ink, var(--h5-ink)); line-height: 1.15;
  }
  body.h5-active[data-h5-skin='porcelain'] .h5-sq-gear {
    width: 38px; height: 38px; border-radius: 50%;
    border: 1px solid var(--porc-line);
    background: var(--porc-surface);
    color: var(--porc-ink);
    box-shadow: var(--porc-shadow-sm);
  }

  /* ---------- 手绘小猫耳搜索框 ---------- */
  .h5-cat-search-wrap {
    position: relative;
    margin-top: 4px;
    margin-bottom: 10px;
  }
  .h5-cat-ears {
    position: absolute;
    right: 92px;
    top: -14px;
    width: 44px;
    height: 20px;
    pointer-events: none;
    z-index: 3;
    color: var(--porc-ink, var(--h5-ink));
    opacity: .88;
  }
  body.h5-active[data-h5-skin='porcelain'] .h5-square-searchbar {
    display: flex; align-items: center; gap: 8px; margin-bottom: 0;
  }
  body.h5-active[data-h5-skin='porcelain'] .h5-square-searchbar .h5-search {
    min-height: 40px; padding: 0 14px;
    background: var(--porc-soft);
    border: 1px solid var(--porc-line);
    border-radius: 999px;
    color: var(--porc-sub);
    box-shadow: inset 0 1px 2px rgba(20, 26, 40, .02);
  }
  body.h5-active[data-h5-skin='porcelain'] .h5-square-searchbar .h5-search input {
    min-height: 38px; font-size: 14px; color: var(--porc-ink);
  }
  body.h5-active[data-h5-skin='porcelain'] .h5-square-searchbar .h5-chip {
    min-height: 40px; padding: 0 12px;
    background: var(--porc-surface);
    border: 1px solid var(--porc-line);
    color: var(--porc-ink);
    box-shadow: var(--porc-shadow-sm);
  }

  /* ---------- 珍珠灰分类胶囊 ---------- */
  body.h5-active[data-h5-skin='porcelain'] .h5-square-tabs {
    display: flex; align-items: center; gap: 8px;
    overflow-x: auto; scrollbar-width: none;
    margin-bottom: 10px; padding: 2px 0;
  }
  body.h5-active[data-h5-skin='porcelain'] .h5-square-tabs::-webkit-scrollbar { display: none; }
  body.h5-active[data-h5-skin='porcelain'] .h5-square-tabs .h5-chip {
    flex: none; min-height: 34px; padding: 0 14px;
    border-radius: 999px;
    background: var(--porc-soft);
    border: 1px solid var(--porc-line);
    color: var(--porc-ink);
    font-size: 12.5px; font-weight: 560;
  }
  body.h5-active[data-h5-skin='porcelain'] .h5-square-tabs .h5-chip.selected {
    background: var(--porc-pill-on);
    border-color: transparent;
    color: var(--porc-pill-on-ink);
    font-weight: 680;
    box-shadow: var(--porc-shadow-sm);
  }

  /* ---------- 满幅文字覆盖卡片（文字直接叠加在封面图上） ---------- */
  body.h5-active[data-h5-skin='porcelain'] .h5-square-results {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 11px; margin-top: 6px;
  }
  body.h5-active[data-h5-skin='porcelain'] .h5-post-card {
    display: block; width: 100%; height: auto; aspect-ratio: auto;
    border-radius: 22px;
    border: 1px solid var(--porc-line);
    background: #e6e8ee;
    box-shadow: var(--porc-shadow);
    overflow: hidden;
  }
  body.h5-active[data-h5-skin='porcelain'] .h5-post-card::before {
    content: ''; display: block; width: 100%; padding-top: 133.3333%;
  }
  :root[data-theme='dark'] body.h5-active[data-h5-skin='porcelain'] .h5-post-card {
    background: #20232b;
  }
  body.h5-active[data-h5-skin='porcelain'] .h5-post-cover {
    background: linear-gradient(150deg, #eff1f6 0%, #dce0ea 55%, #b8c0d0 100%);
    color: rgba(255, 255, 255, .8);
  }
  :root[data-theme='dark'] body.h5-active[data-h5-skin='porcelain'] .h5-post-cover {
    background: linear-gradient(150deg, #272b36 0%, #1c1f27 55%, #14171e 100%);
  }
  body.h5-active[data-h5-skin='porcelain'] .h5-square-results .h5-post-cover::after {
    background: linear-gradient(
      180deg,
      rgba(16, 20, 30, .02) 0%,
      rgba(16, 20, 30, .06) 42%,
      rgba(16, 20, 30, .54) 76%,
      rgba(16, 20, 30, .80) 100%
    );
  }
  body.h5-active[data-h5-skin='porcelain'] .h5-badge {
    top: 9px; left: 9px;
    padding: 3px 8px; border-radius: 999px;
    background: rgba(255, 255, 255, .90);
    color: #1f2430;
    font-size: 10px; font-weight: 650;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .08);
  }
  body.h5-active[data-h5-skin='porcelain'] .h5-badge.h5-post-audience {
    left: auto; right: 9px;
    background: rgba(20, 24, 34, .36);
    color: #fff;
  }
  body.h5-active[data-h5-skin='porcelain'] .h5-post-body {
    padding: 10px 11px 11px; gap: 3px;
    text-shadow: 0 1px 4px rgba(0, 0, 0, .35);
  }
  body.h5-active[data-h5-skin='porcelain'] .h5-post-body strong {
    font-size: 14.5px; font-weight: 740; color: #fff; -webkit-line-clamp: 1;
  }
  body.h5-active[data-h5-skin='porcelain'] .h5-post-body small {
    font-size: 11px; color: rgba(255, 255, 255, .86); -webkit-line-clamp: 1;
  }
  body.h5-active[data-h5-skin='porcelain'] .h5-post-author {
    font-size: 10px; color: rgba(255, 255, 255, .78);
  }
  body.h5-active[data-h5-skin='porcelain'] .h5-post-body .h5-tags { display: none; }
  body.h5-active[data-h5-skin='porcelain'] .h5-post-stats {
    gap: 8px; margin-top: 2px; font-size: 10.5px; color: rgba(255, 255, 255, .92);
  }

  /* ---------- 悬浮珍珠白胶囊底栏 + 中间凸起纯白陶瓷圆「+」 ---------- */
  body.h5-active[data-h5-skin='porcelain'] .h5-nav {
    margin: 4px 12px max(10px, env(safe-area-inset-bottom));
    padding: 4px 6px;
    border-radius: 30px;
    border: 1px solid var(--porc-line);
    background: var(--porc-surface);
    box-shadow: 0 10px 30px rgba(20, 26, 40, .09);
    overflow: visible;
  }
  body.h5-active[data-h5-skin='porcelain'] .h5-nav-item {
    min-height: 48px; gap: 2px; border-radius: 20px;
    color: var(--porc-sub); font-size: 10.5px; font-weight: 560;
    transition: color .18s ease, transform .18s ease;
  }
  body.h5-active[data-h5-skin='porcelain'] .h5-nav-item .h5-icon { width: 21px; height: 21px; }
  body.h5-active[data-h5-skin='porcelain'] .h5-nav-item[aria-current] {
    color: var(--porc-ink); font-weight: 720;
  }
  body.h5-active[data-h5-skin='porcelain'] .h5-nav-item.h5-nav-fab {
    position: relative;
    min-height: 52px;
    padding: 0;
    align-self: center;
    justify-self: center;
    width: 52px; height: 52px;
    margin-top: -14px;
    border-radius: 50%;
    background: linear-gradient(155deg, #ffffff 0%, #f5f7fb 58%, #e5e9f2 100%);
    border: 1.5px solid rgba(255, 255, 255, .96);
    color: var(--porc-ink);
    box-shadow:
      0 0 0 4px rgba(255, 255, 255, .92),
      0 8px 20px rgba(24, 32, 52, .16),
      0 2px 5px rgba(24, 32, 52, .08),
      inset 0 2px 3px rgba(255, 255, 255, 1),
      inset 0 -3px 6px rgba(135, 146, 170, .22);
    transition: transform .16s cubic-bezier(.22, 1, .36, 1), box-shadow .18s ease, background .18s ease;
  }
  body.h5-active[data-h5-skin='porcelain'] .h5-nav-item.h5-nav-fab::before {
    content: '';
    position: absolute; top: 3px; right: 3px; bottom: 3px; left: 3px; inset: 3px; border-radius: 50%;
    border: 1px solid rgba(162, 168, 181, .30);
    pointer-events: none;
  }
  body.h5-active[data-h5-skin='porcelain'] .h5-nav-item.h5-nav-fab:active {
    transform: scale(0.92);
  }
  body.h5-active[data-h5-skin='porcelain'] .h5-nav-item.h5-nav-fab .h5-icon {
    width: 24px; height: 24px;
    position: relative; z-index: 1;
  }
  body.h5-active[data-h5-skin='porcelain'] .h5-nav-item.h5-nav-fab > span:last-child {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0);
  }
  body.h5-active[data-h5-skin='porcelain'] .h5-nav-item.h5-nav-fab[aria-current] {
    background: linear-gradient(155deg, #2e3340 0%, #161921 100%);
    color: #ffffff;
    border-color: rgba(255, 255, 255, .25);
    box-shadow:
      0 0 0 4px rgba(255, 255, 255, .94),
      0 10px 24px rgba(20, 26, 40, .26),
      inset 0 1.5px 2px rgba(255, 255, 255, .22);
  }
  body.h5-active[data-h5-skin='porcelain'] .h5-nav-item.h5-nav-fab[aria-current]::before {
    border-color: rgba(255, 255, 255, .18);
  }
  :root[data-theme='dark'] body.h5-active[data-h5-skin='porcelain'] .h5-nav-item.h5-nav-fab {
    background: linear-gradient(155deg, #2d313d 0%, #1a1d25 100%);
    border-color: rgba(255, 255, 255, .14);
    color: #f4f6fa;
    box-shadow:
      0 0 0 4px rgba(20, 22, 28, .92),
      0 10px 24px rgba(0, 0, 0, .48),
      inset 0 1.5px 2px rgba(255, 255, 255, .14),
      inset 0 -3px 6px rgba(0, 0, 0, .35);
  }
  :root[data-theme='dark'] body.h5-active[data-h5-skin='porcelain'] .h5-nav-item.h5-nav-fab[aria-current] {
    background: linear-gradient(155deg, #ffffff 0%, #e4e8f0 100%);
    color: #14161c;
  }

  /* ---------- 列表 / 我的 / 卡片容器 ---------- */
  body.h5-active[data-h5-skin='porcelain'] .h5-list,
  body.h5-active[data-h5-skin='porcelain'] .h5-empty {
    background: var(--porc-surface);
    border: 1px solid var(--porc-line);
    border-radius: 20px;
    box-shadow: var(--porc-shadow-sm);
  }
  body.h5-active[data-h5-skin='porcelain'] .h5-list-row + .h5-list-row {
    border-top-color: var(--porc-line);
  }
  body.h5-active[data-h5-skin='porcelain'] .h5-avatar { border-radius: 50%; }
  body.h5-active[data-h5-skin='porcelain'] .h5-create-grid .h5-tile {
    border-radius: 20px; background: var(--porc-surface);
    border: 1px solid var(--porc-line); box-shadow: var(--porc-shadow-sm);
  }
  body.h5-active[data-h5-skin='porcelain'] .h5-drawer {
    background: var(--porc-bg);
    border-radius: 28px 28px 0 0;
  }
  body.h5-active[data-h5-skin='porcelain'] .h5-section-head h2::before {
    background: var(--porc-pill-on);
  }

  /* ---------- 聊天页（珍珠陶瓷白 iOS 气泡 + 亲密度胶囊 + 悬浮输入栏） ---------- */
  body.h5-active[data-h5-skin='porcelain'] .h5-chat-intro {
    padding: 6px var(--h5-edge) 8px;
    background: var(--porc-surface);
    border-bottom: 1px solid var(--porc-line);
  }
  body.h5-active[data-h5-skin='porcelain'] .h5-chat-top { gap: 7px; margin-bottom: 0; }
  body.h5-active[data-h5-skin='porcelain'] .h5-chat-top .h5-icon-button {
    width: 36px; height: 36px;
    border-color: var(--porc-line);
    background: var(--porc-bg);
    color: var(--porc-ink);
  }
  .h5-chat-ava-btn {
    padding: 0; border: 0; background: transparent; cursor: pointer;
    flex: none; border-radius: 50%; display: inline-flex;
    transition: transform .12s ease;
  }
  .h5-chat-ava-btn:active { transform: scale(0.93); }
  .h5-chat-ava {
    width: 34px; height: 34px; border-radius: 50%; flex: none;
    overflow: hidden; display: grid; place-items: center;
    background: var(--porc-soft, #f0f2f6); color: var(--porc-ink, #222);
    border: 1px solid var(--porc-line, #e6e8ee);
    font-size: 13px; font-weight: 700;
  }
  .h5-chat-ava img { width: 100%; height: 100%; object-fit: cover; display: block; }
  .h5-love-pill {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    flex: 0 1 auto; min-width: 0; max-width: 240px;
    margin: 0 2px; padding: 5px 10px;
    border-radius: 999px;
    border: 1px solid var(--porc-line, #eceef3);
    background: var(--porc-bg, #fff);
    color: var(--porc-sub, #888f9d);
    font-size: 11px; font-weight: 600; white-space: nowrap;
    box-shadow: var(--porc-shadow-sm, none);
    cursor: pointer;
  }
  .h5-love-pill strong { color: var(--porc-ink, #1a1d24); font-weight: 700; }
  .h5-love-bar {
    flex: 1 1 56px; min-width: 34px; max-width: 84px; height: 5px; border-radius: 999px;
    background: var(--porc-soft, #f0f2f6); overflow: hidden;
  }
  .h5-love-bar i {
    display: block; height: 100%; border-radius: 999px;
    background: var(--porc-pill-on, #a2a8b5);
  }
  @media (max-width: 480px) {
    .h5-love-label,
    .h5-love-bar { display: none; }
    .h5-love-pill { padding: 4px 8px; gap: 3px; font-size: 11px; }
  }
  .h5-more-switch {
    align-items: center;
  }
  .h5-switch-track {
    position: relative; flex: none;
    width: 44px; height: 26px; border-radius: 999px;
    background: rgba(128, 128, 128, .22);
    transition: background .18s ease;
  }
  .h5-switch-track::after {
    content: ''; position: absolute; top: 3px; left: 3px;
    width: 20px; height: 20px; border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .18);
    transition: transform .18s ease;
  }
  .h5-more-switch.on .h5-switch-track {
    background: var(--porc-ink, #1a1d24);
  }
  :root[data-theme='dark'] .h5-more-switch.on .h5-switch-track::after {
    background: #14161c;
  }
  .h5-more-switch.on .h5-switch-track::after {
    transform: translateX(18px);
  }

  body.h5-active[data-h5-skin='porcelain'] .messages { padding: 12px var(--h5-edge) 10px; }
  body.h5-active[data-h5-skin='porcelain'] .messages .bubble {
    padding: 10px 13px; border-radius: 20px; font-size: var(--chat-font-size, 14.5px); line-height: 1.6;
  }
  body.h5-active[data-h5-skin='porcelain'] .messages .row.ai .bubble {
    background: var(--porc-soft);
    border: 1px solid var(--porc-line);
    border-bottom-left-radius: 6px;
    box-shadow: var(--porc-shadow-sm);
  }
  body.h5-active[data-h5-skin='porcelain'] #messages.has-chat-bg .row.ai .bubble {
    background: rgba(255, 255, 255, .94);
  }
  :root[data-theme='dark'] body.h5-active[data-h5-skin='porcelain'] #messages.has-chat-bg .row.ai .bubble {
    background: rgba(28, 30, 36, .88);
  }
  body.h5-active[data-h5-skin='porcelain'] .messages .row.me .bubble {
    background: var(--porc-user-bub);
    color: var(--porc-ink);
    border: 1px solid var(--porc-line);
    border-bottom-right-radius: 6px;
    box-shadow: var(--porc-shadow-sm);
  }
  /* H5 移动端隐藏气泡下方常驻操作栏，改为长按气泡弹出「消息操作」 */
  body.h5-active .messages .row .tavern-message-controls {
    display: none !important;
  }
  body.h5-active .messages .row .bubble {
    -webkit-touch-callout: none;
    user-select: none;
    -webkit-user-select: none;
    transition: transform .15s ease, filter .15s ease;
  }
  body.h5-active .messages .row .bubble.is-pressing {
    transform: scale(0.975);
    filter: brightness(0.96);
  }
  body.h5-active[data-h5-skin='porcelain'] #tavernToolsSheet .sheet-box,
  body.h5-active[data-h5-skin='porcelain'] #tavernToolsSheet .panel {
    background: var(--porc-bg);
    border-top-left-radius: 26px;
    border-top-right-radius: 26px;
  }
  body.h5-active[data-h5-skin='porcelain'] #tavernToolsSheet .tavern-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 10px 0 4px;
  }
  body.h5-active[data-h5-skin='porcelain'] #tavernToolsSheet .tavern-action {
    min-height: 44px;
    border-radius: 16px;
    background: var(--porc-surface);
    border: 1px solid var(--porc-line);
    color: var(--porc-ink);
    font-size: 13.5px;
    font-weight: 560;
    box-shadow: var(--porc-shadow-sm);
  }
  body.h5-active[data-h5-skin='porcelain'] #tavernToolsSheet .tavern-action:active {
    transform: scale(0.97);
    background: var(--porc-soft);
  }
  body.h5-active[data-h5-skin='porcelain'] #tavernToolsSheet .tavern-action.danger {
    color: #d64545;
    border-color: rgba(214, 69, 69, .22);
    background: rgba(214, 69, 69, .05);
  }
  .tavern-variant-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin: 4px 0 12px;
    padding: 6px 8px;
    border-radius: 14px;
    background: var(--porc-soft, rgba(128, 128, 128, .08));
  }
  .tavern-variant-bar .tavern-action {
    min-height: 34px !important;
    padding: 0 12px;
    border-radius: 12px !important;
  }
  .tavern-variant-pos {
    font-size: 12.5px;
    color: var(--porc-sub, var(--fg-2));
    font-variant-numeric: tabular-nums;
  }
  body.h5-active[data-h5-skin='porcelain'] .composer-wrap {
    background: transparent;
    border-top: 0;
    padding: 6px var(--h5-edge) 8px;
  }
  body.h5-active[data-h5-skin='porcelain'] .composer {
    background: var(--porc-surface);
    border: 1px solid var(--porc-line);
    border-radius: 999px;
    padding: 4px 5px 4px 10px;
    box-shadow: var(--porc-shadow);
  }
  body.h5-active[data-h5-skin='porcelain'] #sendBtn {
    width: 38px; height: 38px;
    background: var(--porc-ink);
    color: var(--porc-bg);
  }
  body.h5-active[data-h5-skin='porcelain'] #sendBtn:disabled {
    background: var(--porc-soft);
    color: var(--porc-sub);
    opacity: 1;
  }

  /* ---------- 外观主题抽屉（皮肤切换 + 9 张内置背景图网格） ---------- */
  .h5-skin-grid {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px;
    margin: 6px 0 14px;
  }
  .h5-skin-opt {
    display: flex; flex-direction: column; gap: 3px;
    padding: 12px; border-radius: 16px;
    border: 1.5px solid var(--h5-line);
    background: var(--porc-soft, rgba(var(--gray-255), .7));
    text-align: left;
  }
  .h5-skin-opt[aria-pressed='true'] {
    border-color: var(--h5-ink);
    background: var(--porc-bg, rgb(var(--gray-255)));
    box-shadow: var(--porc-shadow-sm, none);
  }
  .h5-skin-opt strong { font-size: 13.5px; color: var(--h5-ink); }
  .h5-skin-opt small { font-size: 11px; color: var(--h5-muted); }

  .h5-bg-veil {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; margin: 4px 0 12px;
    border-radius: 16px; border: 1px solid var(--h5-line);
    background: var(--porc-soft, rgb(var(--gray-250)));
    font-size: 12px; color: var(--h5-muted);
  }
  .h5-bg-veil input { flex: 1; accent-color: var(--h5-ink); }
  .h5-bg-grid {
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px;
    margin-bottom: 12px;
  }
  .h5-bg-tile {
    display: flex; flex-direction: column; align-items: center; gap: 5px;
    padding: 0; border: 0; background: transparent;
  }
  .h5-bg-thumb {
    width: 100%; aspect-ratio: 9 / 14; border-radius: 14px;
    border: 2px solid var(--h5-line);
    background-color: var(--porc-soft, rgb(var(--gray-245)));
    position: relative; overflow: hidden;
    display: grid; place-items: center;
    font-size: 11.5px; font-weight: 600; color: var(--h5-muted);
    box-shadow: var(--porc-shadow-sm, none);
  }
  @supports not (aspect-ratio: 9 / 14) {
    .h5-bg-thumb { height: 148px; }
  }
  .h5-bg-img {
    position: absolute; top: 0; right: 0; bottom: 0; left: 0; inset: 0; width: 100%; height: 100%;
    object-fit: cover; display: block;
  }
  .h5-bg-tile[aria-pressed='true'] .h5-bg-thumb {
    border-color: var(--h5-ink);
    box-shadow: 0 0 0 1.5px var(--h5-ink);
  }
  .h5-bg-tile[aria-pressed='true'] .h5-bg-thumb::after {
    content: '✓'; position: absolute; right: 5px; top: 5px; z-index: 2;
    width: 19px; height: 19px; border-radius: 50%;
    background: var(--h5-ink); color: var(--porc-bg, #fff);
    font-size: 11px; font-weight: 800; display: grid; place-items: center;
  }
  .h5-bg-name {
    font-size: 11px; font-weight: 600; color: var(--h5-ink);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;
  }

  /* ---------- 主题背景（作用于广场 / 聊天列表 / 酒馆 / 我的 / 创作等界面，与聊天背景独立） ---------- */
  body.h5-active.has-theme-bg:not([data-h5-page='chat'])::before {
    content: '';
    position: fixed; top: 0; right: 0; bottom: 0; left: 0; inset: 0; z-index: 0; pointer-events: none;
    background-image: var(--theme-bg);
    background-size: cover; background-position: center; background-repeat: no-repeat;
  }
  body.h5-active.has-theme-bg:not([data-h5-page='chat'])::after {
    content: '';
    position: fixed; top: 0; right: 0; bottom: 0; left: 0; inset: 0; z-index: 0; pointer-events: none;
    background: rgba(255, 255, 255, var(--theme-bg-dim, .35));
  }
  :root[data-theme='dark'] body.h5-active.has-theme-bg:not([data-h5-page='chat'])::after {
    background: rgba(14, 16, 20, var(--theme-bg-dim, .55));
  }
  body.h5-active.has-theme-bg:not([data-h5-page='chat']) .app {
    position: fixed; z-index: 1;
    background: transparent !important;
  }
  body.h5-active.has-theme-bg:not([data-h5-page='chat']) .h5-page {
    background: transparent !important;
  }
  body.h5-active.has-theme-bg:not([data-h5-page='chat']) .h5-list,
  body.h5-active.has-theme-bg:not([data-h5-page='chat']) .h5-wx-list,
  body.h5-active.has-theme-bg:not([data-h5-page='chat']) .h5-chat-seg,
  body.h5-active.has-theme-bg:not([data-h5-page='chat']) .h5-wx-new-group,
  body.h5-active.has-theme-bg:not([data-h5-page='chat']) .h5-profile,
  body.h5-active.has-theme-bg:not([data-h5-page='chat']) .h5-search,
  body.h5-active.has-theme-bg:not([data-h5-page='chat']) .h5-chip,
  body.h5-active.has-theme-bg:not([data-h5-page='chat']) .h5-tile,
  body.h5-active.has-theme-bg:not([data-h5-page='chat']) .h5-empty,
  body.h5-active.has-theme-bg:not([data-h5-page='chat']) .h5-sq-gear,
  body.h5-active.has-theme-bg:not([data-h5-page='chat']) .h5-nav {
    background: rgba(255, 255, 255, .88);
  }
  body.h5-active.has-theme-bg:not([data-h5-page='chat']) .h5-chip.selected {
    background: var(--porc-pill-on, #a2a8b5);
    color: var(--porc-pill-on-ink, #fff);
  }
  :root[data-theme='dark'] body.h5-active.has-theme-bg:not([data-h5-page='chat']) .h5-list,
  :root[data-theme='dark'] body.h5-active.has-theme-bg:not([data-h5-page='chat']) .h5-wx-list,
  :root[data-theme='dark'] body.h5-active.has-theme-bg:not([data-h5-page='chat']) .h5-chat-seg,
  :root[data-theme='dark'] body.h5-active.has-theme-bg:not([data-h5-page='chat']) .h5-wx-new-group,
  :root[data-theme='dark'] body.h5-active.has-theme-bg:not([data-h5-page='chat']) .h5-profile,
  :root[data-theme='dark'] body.h5-active.has-theme-bg:not([data-h5-page='chat']) .h5-search,
  :root[data-theme='dark'] body.h5-active.has-theme-bg:not([data-h5-page='chat']) .h5-chip,
  :root[data-theme='dark'] body.h5-active.has-theme-bg:not([data-h5-page='chat']) .h5-tile,
  :root[data-theme='dark'] body.h5-active.has-theme-bg:not([data-h5-page='chat']) .h5-empty,
  :root[data-theme='dark'] body.h5-active.has-theme-bg:not([data-h5-page='chat']) .h5-sq-gear,
  :root[data-theme='dark'] body.h5-active.has-theme-bg:not([data-h5-page='chat']) .h5-nav {
    background: rgba(24, 26, 32, .74);
  }

  /* ---------- 聊天页分组切换：联系人 / 群组 / 角色动态 ---------- */
  .h5-chat-seg {
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px;
    padding: 4px; margin: 10px 0 4px;
    border-radius: 16px;
    background: var(--porc-soft, #f4f5f8);
    border: 1px solid var(--porc-line, #eceef3);
  }
  .h5-chat-seg-btn {
    position: relative;
    min-width: 0;
    display: inline-flex; align-items: center; justify-content: center; gap: 5px;
    border: 0; border-radius: 12px; padding: 9px 6px;
    background: transparent; color: var(--h5-muted, #888f9d);
    font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap;
    transition: background .15s ease, color .15s ease, box-shadow .15s ease;
  }
  .h5-chat-seg-btn.active {
    background: var(--porc-bg, #ffffff);
    color: var(--h5-ink, #1a1d24);
    box-shadow: var(--porc-shadow-sm, 0 2px 8px rgba(0, 0, 0, .05));
  }
  .h5-seg-dot {
    width: 7px; height: 7px; border-radius: 50%;
    background: #fa5151; flex: none;
  }
  .h5-wx-new-group {
    display: flex; align-items: center; justify-content: center; gap: 6px;
    width: 100%; margin-top: 12px; padding: 12px;
    border-radius: 16px;
    border: 1px dashed var(--porc-line, #d8dce4);
    background: var(--porc-surface, #ffffff);
    color: var(--h5-ink, #1a1d24);
    font-size: 13.5px; font-weight: 600; cursor: pointer;
  }

  /* ---------- 酒馆顶部 4 枚快捷操作胶囊：单行紧凑排列、整齐居中 ---------- */
  body.h5-active .h5-page .tavern-actions {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) repeat(3, minmax(0, 1fr));
    gap: 6px;
    margin: 8px 0 4px;
    width: 100%;
    align-items: center;
  }
  body.h5-active .h5-page .tavern-actions .h5-chip {
    width: 100%;
    min-width: 0;
    min-height: 36px;
    justify-content: center;
    gap: 3px;
    padding: 0 5px;
    border-radius: 14px;
    font-size: 11.5px;
    font-weight: 560;
    white-space: nowrap;
  }
  body.h5-active .h5-page .tavern-actions .h5-chip .h5-icon {
    width: 13px;
    height: 13px;
    flex: 0 0 auto;
  }
  @media (max-width: 365px) {
    body.h5-active .h5-page .tavern-actions {
      gap: 4px;
    }
    body.h5-active .h5-page .tavern-actions .h5-chip {
      padding: 0 3px;
      font-size: 10.5px;
      gap: 2px;
    }
    body.h5-active .h5-page .tavern-actions .h5-chip .h5-icon {
      width: 12px;
      height: 12px;
    }
  }

  /* ---------- 微信风格聊天列表（舒展大号圆角方头像 + 右上角红点数字未读角标） ---------- */
  .h5-wx-list {
    display: flex; flex-direction: column;
    margin-top: 10px;
    border-radius: 20px;
    background: var(--porc-surface, rgb(var(--gray-255)));
    border: 1px solid var(--porc-line, var(--h5-line));
    box-shadow: var(--porc-shadow-sm, none);
    overflow: hidden;
  }
  .h5-wx-item {
    position: relative;
    display: flex; align-items: center; gap: 14px;
    width: 100%; min-height: 86px; padding: 15px 16px;
    border: 0; background: transparent;
    text-align: left; cursor: pointer;
    color: var(--h5-ink);
    transition: background .12s ease;
  }
  .h5-wx-item:active {
    background: rgba(128, 128, 128, .08);
  }
  .h5-wx-item + .h5-wx-item::before {
    content: '';
    position: absolute; top: 0; left: 86px; right: 16px;
    height: 1px;
    background: var(--porc-line, var(--h5-line));
  }
  .h5-wx-ava-wrap {
    position: relative; flex: none;
    width: 56px; height: 56px;
    display: block;
  }
  .h5-wx-ava {
    width: 56px; height: 56px;
    border-radius: 12px !important;
    overflow: hidden;
    display: grid; place-items: center;
    background: var(--porc-soft, #eef0f4);
    font-size: 18px; font-weight: 700; color: var(--h5-muted);
  }
  .h5-wx-ava img {
    width: 100%; height: 100%; object-fit: cover; display: block;
  }
  .h5-wx-badge {
    position: absolute; top: -6px; right: -6px; z-index: 2;
    min-width: 20px; height: 20px; padding: 0 5px;
    border-radius: 999px;
    background: #fa5151; color: #ffffff;
    border: 1.5px solid #ffffff;
    font-size: 11.5px; font-weight: 700; line-height: 17px;
    text-align: center; font-variant-numeric: tabular-nums;
    box-shadow: 0 2px 6px rgba(250, 81, 81, .35);
  }
  :root[data-theme='dark'] .h5-wx-badge {
    border-color: #181a20;
  }
  .h5-wx-body {
    flex: 1; min-width: 0;
    display: flex; flex-direction: column; gap: 6px;
  }
  .h5-wx-top {
    display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  }
  .h5-wx-name {
    font-size: 16.5px; font-weight: 620; line-height: 1.25;
    color: var(--h5-ink);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .h5-wx-time {
    flex: none;
    font-size: 12px; line-height: 1.2;
    color: #b0b5bf;
    font-variant-numeric: tabular-nums;
  }
  .h5-wx-msg {
    font-size: 13.5px; line-height: 1.35;
    color: var(--h5-muted, #8e939e);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .h5-nav-item {
    position: relative;
  }
  .h5-nav-badge {
    position: absolute; top: 2px; right: calc(50% - 20px); z-index: 3;
    min-width: 16px; height: 16px; padding: 0 4px;
    border-radius: 999px;
    background: #fa5151; color: #ffffff;
    border: 1.5px solid #ffffff;
    font-size: 10px; font-weight: 700; line-height: 13px;
    text-align: center; font-variant-numeric: tabular-nums;
  }
  :root[data-theme='dark'] .h5-nav-badge {
    border-color: #181a20;
  }

  /* 外观抽屉里的「主题背景 / 默认聊天背景」分段切换器 */
  .h5-bg-tabs {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px;
    padding: 4px; margin: 4px 0 8px;
    border-radius: 16px;
    background: var(--porc-soft, rgba(128, 128, 128, .1));
    border: 1px solid var(--h5-line);
  }
  .h5-bg-tab {
    border: 0; border-radius: 12px; padding: 9px 8px;
    background: transparent; color: var(--h5-muted);
    font-size: 13px; font-weight: 600; cursor: pointer;
    transition: background .15s ease, color .15s ease, box-shadow .15s ease;
  }
  .h5-bg-tab.active {
    background: var(--porc-bg, #fff);
    color: var(--h5-ink);
    box-shadow: var(--porc-shadow-sm, 0 2px 8px rgba(0, 0, 0, .06));
  }
  .h5-bg-tip {
    margin: 0 0 8px; font-size: 11.5px; line-height: 1.45;
    color: var(--h5-muted);
  }

  /* ---------- 二级表单弹层（角色设定 / 我的人设 / 接口设置 / 提示词 / 剧本 / 发布 / 账号 / 主动消息） ---------- */
  body.h5-active[data-h5-skin='porcelain'] .sheet:not(#authSheet):not(#postSheet) {
    background: #f5f6f9;
    border-top-color: rgba(20, 26, 40, .06);
  }
  :root[data-theme='dark'] body.h5-active[data-h5-skin='porcelain'] .sheet:not(#authSheet):not(#postSheet) {
    background: #12141a;
    border-top-color: rgba(255, 255, 255, .10);
  }
  body.h5-active[data-h5-skin='porcelain'] .sheet:not(#authSheet):not(#postSheet) .sheet-head {
    background: rgba(245, 246, 249, .92);
    border-color: rgba(20, 26, 40, .07);
  }
  body.h5-active[data-h5-skin='porcelain'] .sheet:not(#authSheet):not(#postSheet) .sheet-foot {
    background: rgba(245, 246, 249, .96);
    box-shadow: 0 4px 0 #f5f6f9;
    border-color: rgba(20, 26, 40, .07);
  }
  :root[data-theme='dark'] body.h5-active[data-h5-skin='porcelain'] .sheet:not(#authSheet):not(#postSheet) .sheet-head {
    background: rgba(18, 20, 26, .92);
    border-color: rgba(255, 255, 255, .09);
  }
  :root[data-theme='dark'] body.h5-active[data-h5-skin='porcelain'] .sheet:not(#authSheet):not(#postSheet) .sheet-foot {
    background: rgba(18, 20, 26, .96);
    box-shadow: 0 4px 0 #12141a;
    border-color: rgba(255, 255, 255, .09);
  }
  body.h5-active[data-h5-skin='porcelain'] .sheet:not(#authSheet):not(#postSheet) .sheet-head h2,
  body.h5-active[data-h5-skin='porcelain'] .sheet:not(#authSheet):not(#postSheet) .sheet-head h3 {
    color: var(--porc-ink);
  }
  body.h5-active[data-h5-skin='porcelain'] .sheet:not(#authSheet):not(#postSheet) .ghost-btn {
    background: #ffffff;
    border-color: rgba(20, 26, 40, .09);
    color: var(--porc-ink);
    box-shadow: 0 1px 3px rgba(20, 26, 40, .05);
  }
  :root[data-theme='dark'] body.h5-active[data-h5-skin='porcelain'] .sheet:not(#authSheet):not(#postSheet) .ghost-btn {
    background: #1e212b;
    border-color: rgba(255, 255, 255, .12);
    color: #eef1f7;
    box-shadow: none;
  }

  /* 头像编辑卡片化 */
  body.h5-active[data-h5-skin='porcelain'] .sheet .avatar-edit,
  body.h5-active[data-h5-skin='porcelain'] .sheet .pf-av-row {
    padding: 13px 14px;
    margin-bottom: 16px;
    border-radius: 18px;
    background: #ffffff;
    border: 1px solid rgba(20, 26, 40, .07);
    box-shadow: 0 2px 8px rgba(20, 26, 40, .035);
  }
  :root[data-theme='dark'] body.h5-active[data-h5-skin='porcelain'] .sheet .avatar-edit,
  :root[data-theme='dark'] body.h5-active[data-h5-skin='porcelain'] .sheet .pf-av-row {
    background: #1b1e27;
    border-color: rgba(255, 255, 255, .09);
    box-shadow: none;
  }
  body.h5-active[data-h5-skin='porcelain'] .sheet .avatar-preview {
    width: 62px; height: 62px; border-radius: 18px;
    border: 1px solid rgba(20, 26, 40, .08);
  }
  body.h5-active[data-h5-skin='porcelain'] .sheet .switch-btn {
    min-height: 36px; padding: 0 13px; border-radius: 11px;
    font-size: 12.8px; font-weight: 560;
    background: #f4f5f8; border-color: rgba(20, 26, 40, .09); color: var(--porc-ink);
  }
  :root[data-theme='dark'] body.h5-active[data-h5-skin='porcelain'] .sheet .switch-btn {
    background: rgba(255, 255, 255, .07); border-color: rgba(255, 255, 255, .12); color: #eef1f7;
  }

  /* 表单标签与输入框 */
  body.h5-active[data-h5-skin='porcelain'] .sheet:not(#authSheet):not(#postSheet) .field {
    margin-bottom: 16px;
  }
  body.h5-active[data-h5-skin='porcelain'] .sheet:not(#authSheet):not(#postSheet) .field > span,
  body.h5-active[data-h5-skin='porcelain'] .sheet:not(#authSheet):not(#postSheet) .field > label {
    font-size: 13px; font-weight: 640; color: var(--porc-ink); margin-bottom: 6px;
  }
  body.h5-active[data-h5-skin='porcelain'] .sheet:not(#authSheet):not(#postSheet) .field > small {
    font-size: 11.5px; color: var(--porc-sub); line-height: 1.45;
  }
  body.h5-active[data-h5-skin='porcelain'] .sheet:not(#authSheet):not(#postSheet) .field input[type=text],
  body.h5-active[data-h5-skin='porcelain'] .sheet:not(#authSheet):not(#postSheet) .field input[type=password],
  body.h5-active[data-h5-skin='porcelain'] .sheet:not(#authSheet):not(#postSheet) .field input[type=email],
  body.h5-active[data-h5-skin='porcelain'] .sheet:not(#authSheet):not(#postSheet) .field input[type=number],
  body.h5-active[data-h5-skin='porcelain'] .sheet:not(#authSheet):not(#postSheet) .field input[type=time],
  body.h5-active[data-h5-skin='porcelain'] .sheet:not(#authSheet):not(#postSheet) .field select,
  body.h5-active[data-h5-skin='porcelain'] .sheet:not(#authSheet):not(#postSheet) .field textarea {
    background: #ffffff;
    border: 1px solid rgba(20, 26, 40, .09);
    border-radius: 14px;
    padding: 11px 13px;
    color: var(--porc-ink);
    box-shadow: 0 1px 2px rgba(20, 26, 40, .025);
  }
  body.h5-active[data-h5-skin='porcelain'] .sheet:not(#authSheet):not(#postSheet) .field textarea {
    padding: 12px 13px;
    line-height: 1.65;
  }
  body.h5-active[data-h5-skin='porcelain'] .sheet:not(#authSheet):not(#postSheet) .field input:focus,
  body.h5-active[data-h5-skin='porcelain'] .sheet:not(#authSheet):not(#postSheet) .field select:focus,
  body.h5-active[data-h5-skin='porcelain'] .sheet:not(#authSheet):not(#postSheet) .field textarea:focus {
    border-color: #1a1d24;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(26, 29, 36, .08);
  }
  :root[data-theme='dark'] body.h5-active[data-h5-skin='porcelain'] .sheet:not(#authSheet):not(#postSheet) .field input[type=text],
  :root[data-theme='dark'] body.h5-active[data-h5-skin='porcelain'] .sheet:not(#authSheet):not(#postSheet) .field input[type=password],
  :root[data-theme='dark'] body.h5-active[data-h5-skin='porcelain'] .sheet:not(#authSheet):not(#postSheet) .field input[type=email],
  :root[data-theme='dark'] body.h5-active[data-h5-skin='porcelain'] .sheet:not(#authSheet):not(#postSheet) .field input[type=number],
  :root[data-theme='dark'] body.h5-active[data-h5-skin='porcelain'] .sheet:not(#authSheet):not(#postSheet) .field input[type=time],
  :root[data-theme='dark'] body.h5-active[data-h5-skin='porcelain'] .sheet:not(#authSheet):not(#postSheet) .field select,
  :root[data-theme='dark'] body.h5-active[data-h5-skin='porcelain'] .sheet:not(#authSheet):not(#postSheet) .field textarea {
    background: #1b1e27;
    border-color: rgba(255, 255, 255, .10);
    color: #f2f4f8;
    box-shadow: none;
  }
  :root[data-theme='dark'] body.h5-active[data-h5-skin='porcelain'] .sheet:not(#authSheet):not(#postSheet) .field input:focus,
  :root[data-theme='dark'] body.h5-active[data-h5-skin='porcelain'] .sheet:not(#authSheet):not(#postSheet) .field select:focus,
  :root[data-theme='dark'] body.h5-active[data-h5-skin='porcelain'] .sheet:not(#authSheet):not(#postSheet) .field textarea:focus {
    border-color: rgba(242, 244, 248, .55);
    background: #202430;
    box-shadow: 0 0 0 3px rgba(242, 244, 248, .10);
  }

  /* 按钮 / 美化入口卡 / 预设卡 / 人设芯片 / 提示词条目 */
  body.h5-active[data-h5-skin='porcelain'] .sheet:not(#authSheet):not(#postSheet) .test-btn,
  body.h5-active[data-h5-skin='porcelain'] .sheet:not(#authSheet):not(#postSheet) .mini-btn,
  body.h5-active[data-h5-skin='porcelain'] .sheet:not(#authSheet):not(#postSheet) .pers-chip,
  body.h5-active[data-h5-skin='porcelain'] .sheet:not(#authSheet):not(#postSheet) .preset,
  body.h5-active[data-h5-skin='porcelain'] .sheet:not(#authSheet):not(#postSheet) .seg-row,
  body.h5-active[data-h5-skin='porcelain'] .sheet:not(#authSheet):not(#postSheet) .chatbg-dimline {
    background: #ffffff;
    border-color: rgba(20, 26, 40, .09);
    color: var(--porc-ink);
  }
  :root[data-theme='dark'] body.h5-active[data-h5-skin='porcelain'] .sheet:not(#authSheet):not(#postSheet) .test-btn,
  :root[data-theme='dark'] body.h5-active[data-h5-skin='porcelain'] .sheet:not(#authSheet):not(#postSheet) .mini-btn,
  :root[data-theme='dark'] body.h5-active[data-h5-skin='porcelain'] .sheet:not(#authSheet):not(#postSheet) .pers-chip,
  :root[data-theme='dark'] body.h5-active[data-h5-skin='porcelain'] .sheet:not(#authSheet):not(#postSheet) .preset,
  :root[data-theme='dark'] body.h5-active[data-h5-skin='porcelain'] .sheet:not(#authSheet):not(#postSheet) .seg-row,
  :root[data-theme='dark'] body.h5-active[data-h5-skin='porcelain'] .sheet:not(#authSheet):not(#postSheet) .chatbg-dimline {
    background: #1b1e27;
    border-color: rgba(255, 255, 255, .10);
    color: #eef1f7;
  }
  body.h5-active[data-h5-skin='porcelain'] .sheet .preset.active,
  body.h5-active[data-h5-skin='porcelain'] .sheet .pers-chip.active {
    border-color: var(--porc-ink);
    box-shadow: 0 0 0 1px var(--porc-ink);
  }
  body.h5-active[data-h5-skin='porcelain'] .sheet .char-theme-entry {
    box-shadow: 0 2px 8px rgba(20, 26, 40, .035);
  }
  body.h5-active[data-h5-skin='porcelain'] .sheet .char-theme-entry-ic {
    background: #f0f2f7; color: #1a1d24;
  }
  :root[data-theme='dark'] body.h5-active[data-h5-skin='porcelain'] .sheet .char-theme-entry-ic {
    background: rgba(255, 255, 255, .09); color: #f2f4f8;
  }
  body.h5-active[data-h5-skin='porcelain'] .sheet .persona-ai-btn {
    background: #ffffff;
    border-color: rgba(20, 26, 40, .12);
    color: var(--porc-ink);
    box-shadow: 0 1px 3px rgba(20, 26, 40, .04);
  }
  :root[data-theme='dark'] body.h5-active[data-h5-skin='porcelain'] .sheet .persona-ai-btn {
    background: #1e212b;
    border-color: rgba(255, 255, 255, .14);
    color: #f2f4f8;
    box-shadow: none;
  }
  body.h5-active[data-h5-skin='porcelain'] .sheet .save-btn {
    background: #1a1d24; border-color: #1a1d24; color: #ffffff;
    box-shadow: 0 6px 16px rgba(20, 26, 40, .16);
  }
  :root[data-theme='dark'] body.h5-active[data-h5-skin='porcelain'] .sheet .save-btn {
    background: #f2f4f8; border-color: #f2f4f8; color: #111318;
    box-shadow: 0 6px 16px rgba(0, 0, 0, .32);
  }
  body.h5-active[data-h5-skin='porcelain'] .sheet .seg-row.off {
    opacity: .62;
  }
  body.h5-active[data-h5-skin='porcelain'] .sheet .fold {
    border-top-color: rgba(20, 26, 40, .08);
  }
  :root[data-theme='dark'] body.h5-active[data-h5-skin='porcelain'] .sheet .fold {
    border-top-color: rgba(255, 255, 255, .09);
  }
  body.h5-active[data-h5-skin='porcelain'] .sheet .pm-style-card {
    background: #ffffff;
    border-color: rgba(20, 26, 40, .09);
  }
  :root[data-theme='dark'] body.h5-active[data-h5-skin='porcelain'] .sheet .pm-style-card {
    background: #1b1e27;
    border-color: rgba(255, 255, 255, .10);
  }
  body.h5-active[data-h5-skin='porcelain'] .sheet .pm-style-card.active {
    border-color: var(--pm-tone, var(--porc-ink));
    background: color-mix(in srgb, var(--pm-tone, #1a1d24) 6%, #ffffff);
    box-shadow: 0 0 0 1px var(--pm-tone, var(--porc-ink));
  }
  :root[data-theme='dark'] body.h5-active[data-h5-skin='porcelain'] .sheet .pm-style-card.active {
    border-color: var(--pm-tone, #f2f4f8);
    background: color-mix(in srgb, var(--pm-tone, #f2f4f8) 12%, #1b1e27);
    box-shadow: 0 0 0 1px var(--pm-tone, #f2f4f8);
  }
  body.h5-active[data-h5-skin='porcelain'] .sheet .pm-style-preview {
    background: #ffffff;
    border-color: rgba(20, 26, 40, .08);
  }
  :root[data-theme='dark'] body.h5-active[data-h5-skin='porcelain'] .sheet .pm-style-preview {
    background: #1b1e27;
    border-color: rgba(255, 255, 255, .09);
  }
  body.h5-active[data-h5-skin='porcelain'] .sheet .pm-len-seg {
    background: rgba(20, 26, 40, .05);
    border-color: rgba(20, 26, 40, .07);
  }
  :root[data-theme='dark'] body.h5-active[data-h5-skin='porcelain'] .sheet .pm-len-seg {
    background: rgba(255, 255, 255, .05);
    border-color: rgba(255, 255, 255, .09);
  }
  body.h5-active[data-h5-skin='porcelain'] .sheet .pm-len-btn.active {
    background: #ffffff; color: #1a1d24;
  }
  :root[data-theme='dark'] body.h5-active[data-h5-skin='porcelain'] .sheet .pm-len-btn.active {
    background: #272b38; color: #f2f4f8;
  }
  body.h5-active[data-h5-skin='porcelain'] .sheet .pm-preview {
    background: #ffffff; border-color: rgba(20, 26, 40, .09); color: var(--porc-ink);
  }
  :root[data-theme='dark'] body.h5-active[data-h5-skin='porcelain'] .sheet .pm-preview {
    background: #1b1e27; border-color: rgba(255, 255, 255, .10); color: #dce1ec;
  }
  body.h5-active[data-h5-skin='porcelain'] .sheet #proactiveTypes > label {
    background: #ffffff; border-color: rgba(20, 26, 40, .09); color: var(--porc-ink);
  }
  :root[data-theme='dark'] body.h5-active[data-h5-skin='porcelain'] .sheet #proactiveTypes > label {
    background: #1b1e27; border-color: rgba(255, 255, 255, .10); color: #eef1f7;
  }
}


/* === modules/chat-enhance.css === */
/* ==========================================================================
   月见 MOON · 聊天沉浸感与高频体验增强模块 (chat-enhance.css)
   覆盖：微信引用回复 / 语音声线选择 / 聊天记录搜索 / 破冰引导 / 批量管理 / 广场标签
   ========================================================================== */

/* 1. 微信同款「引用回复」预览条 & 气泡内引用块 */
.quote-preview-bar {
  max-width: 860px;
  margin: 0 auto 6px;
  padding: 7px 10px 7px 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  border-left: 3px solid #5b67d6;
  background: rgba(var(--gray-255), .92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.2px;
  color: var(--fg-2);
  animation: plusTrayIn .15s ease;
}
.quote-preview-bar[hidden] {
  display: none !important;
}
.quote-preview-main {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.quote-preview-main strong {
  font-size: 11.2px;
  color: #5b67d6;
  font-weight: 600;
}
.quote-preview-main span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--fg-2);
}
.quote-preview-clear {
  flex: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 0;
  background: rgba(var(--gray-128), .12);
  color: var(--fg-2);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
}
.msg-quote-ref {
  margin-bottom: 6px;
  padding: 5px 8px;
  border-radius: 8px;
  border-left: 2.5px solid rgba(91, 103, 214, .75);
  background: rgba(var(--gray-128), .12);
  font-size: 11.8px;
  line-height: 1.45;
  color: inherit;
  opacity: .82;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.row.me .msg-quote-ref {
  border-left-color: rgba(255, 255, 255, .65);
  background: rgba(255, 255, 255, .14);
}
.msg-quote-ref b {
  font-size: 10.8px;
  font-weight: 600;
  opacity: .9;
}
.msg-quote-ref span {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 2. 聊天搜索定位脉冲高亮 */
.row.search-jump-hit .bubble {
  animation: moonSearchPulse 1.6s ease;
}
@keyframes moonSearchPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(91, 103, 214, 0); }
  25%, 55% { box-shadow: 0 0 0 4px rgba(91, 103, 214, .38); }
}

/* 3. 聊天记录搜索弹窗 */
.csearch-card {
  width: min(500px, 100%);
  max-height: 82vh;
  display: flex;
  flex-direction: column;
}
.csearch-input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 14px;
  border: 1px solid var(--line-2);
  background: rgba(var(--gray-128), .06);
  margin-bottom: 10px;
  transition: border-color .16s ease, box-shadow .16s ease;
}
.csearch-input-wrap:focus-within {
  border-color: #5b67d6;
  box-shadow: 0 0 0 3px rgba(91, 103, 214, .14);
}
.csearch-input-wrap input {
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--fg);
  font: inherit;
  font-size: 14px;
}
.csearch-input-wrap input:focus,
.csearch-input-wrap input:focus-visible {
  outline: none !important;
  box-shadow: none !important;
}
.csearch-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 160px;
  max-height: 56vh;
}
.csearch-hit {
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(var(--gray-128), .04);
  color: var(--fg);
  font: inherit;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}
.csearch-hit:hover {
  background: rgba(91, 103, 214, .08);
  border-color: rgba(91, 103, 214, .28);
}
.csearch-hit-top {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--fg-2);
  margin-bottom: 4px;
}
.csearch-hit-txt {
  font-size: 13.2px;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.csearch-hit-txt mark {
  background: rgba(91, 103, 214, .22);
  color: inherit;
  padding: 0 2px;
  border-radius: 4px;
}

/* 4. 角色专属声线选择弹窗 */
.voice-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 10px 0 14px;
}
.voice-opt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 13px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(var(--gray-128), .04);
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.voice-opt.active {
  border-color: #5b67d6;
  background: rgba(91, 103, 214, .1);
}
.voice-opt-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: left;
}
.voice-opt-info strong {
  font-size: 13.8px;
  color: var(--fg);
}
.voice-opt-info small {
  font-size: 11.6px;
  color: var(--fg-2);
}
.voice-try-btn {
  flex: none;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: var(--bg);
  color: var(--fg);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

/* 5. 新用户「今晚先和谁聊聊？」首分钟破冰引导 */
.onboard-mask {
  z-index: 85;
  padding: 16px;
}
.onboard-card {
  width: min(560px, 100%);
  padding: 22px 18px 18px;
  border-radius: 26px;
}
.onboard-kicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(91, 103, 214, .12);
  color: #5b67d6;
  font-size: 11.5px;
  font-weight: 600;
  margin-bottom: 8px;
}
.onboard-card h2 {
  margin: 0 0 6px;
  font-size: 20px;
  font-weight: 700;
  color: var(--fg);
}
.onboard-sub {
  margin: 0 0 16px;
  font-size: 13px;
  color: var(--fg-2);
  line-height: 1.55;
}
.onboard-picks {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
@media (max-width: 520px) {
  .onboard-picks {
    grid-template-columns: 1fr;
  }
}
.onboard-pick {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(var(--gray-128), .04);
  text-align: left;
  cursor: pointer;
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.onboard-pick:hover {
  transform: translateY(-2px);
  border-color: rgba(91, 103, 214, .5);
  box-shadow: 0 10px 24px rgba(91, 103, 214, .12);
}
@media (max-width: 520px) {
  .onboard-pick {
    flex-direction: row;
    align-items: center;
  }
}
.onboard-pick-av {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 13px;
  object-fit: cover;
  background: rgba(var(--gray-128), .12);
}
@media (max-width: 520px) {
  .onboard-pick-av {
    width: 64px;
    height: 64px;
    aspect-ratio: 1;
    flex: none;
  }
}
.onboard-pick-body {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.onboard-pick-body strong {
  font-size: 14.5px;
  color: var(--fg);
}
.onboard-pick-body span {
  font-size: 11.8px;
  color: var(--fg-2);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.onboard-pick-go {
  margin-top: auto;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--fg);
  color: var(--bg);
  font-size: 11.8px;
  font-weight: 600;
  text-align: center;
}
.onboard-foot {
  display: flex;
  justify-content: center;
}

/* 6. 广场性格/题材快捷标签栏 */
.h5-tag-rail {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  padding: 2px 2px 8px;
  margin-bottom: 4px;
  scrollbar-width: none;
}
.h5-tag-rail::-webkit-scrollbar {
  display: none;
}
.h5-tag-pill {
  flex: none;
  padding: 4px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(var(--gray-128), .05);
  color: var(--fg-2);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.h5-tag-pill.active {
  background: rgba(91, 103, 214, .14);
  border-color: rgba(91, 103, 214, .45);
  color: #5b67d6;
  font-weight: 600;
}

/* 7. 列表多选批量删除模式 */
.h5-batch-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  margin-bottom: 10px;
  border-radius: 16px;
  border: 1px solid rgba(91, 103, 214, .28);
  background: rgba(91, 103, 214, .08);
  font-size: 12.5px;
}
.h5-batch-ops {
  display: flex;
  align-items: center;
  gap: 6px;
}
.h5-batch-btn {
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: var(--bg);
  color: var(--fg);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.h5-batch-btn.is-danger {
  background: #e5484d;
  border-color: #e5484d;
  color: #fff;
  font-weight: 600;
}
.h5-batch-btn:disabled {
  opacity: .42;
  cursor: not-allowed;
}
.h5-wx-check {
  flex: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1.8px solid var(--line-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: 2px;
  font-size: 12px;
  color: #fff;
  transition: background .15s ease, border-color .15s ease;
}
.h5-wx-item.is-selected .h5-wx-check {
  background: #5b67d6;
  border-color: #5b67d6;
}
.h5-wx-item.is-selected {
  background: rgba(91, 103, 214, .07) !important;
}


/* === modules/moon-journal.css === */
/* ==========================================================================
   月见 MOON · 月色手账 / 动态空间 (moon-journal.css)
   原创雾面柔瓷白 (Soft-Porcelain) + 冷月银紫 (#5B67D6) 伴侣手账美学
   ========================================================================== */

.mj-mask {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(15, 18, 28, .48);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  animation: mjFadeIn .18s ease;
}
@media (min-width: 781px) {
  .mj-mask {
    align-items: center;
    padding: 20px;
  }
}
@keyframes mjFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.mj-shell {
  width: min(640px, 100%);
  height: min(88vh, 780px);
  max-height: 92dvh;
  display: flex;
  flex-direction: column;
  border-radius: 26px 26px 0 0;
  background: var(--mj-bg, #f1f3f7);
  color: var(--mj-fg, #171921);
  border: 1px solid rgba(255, 255, 255, .65);
  box-shadow: 0 24px 64px rgba(15, 20, 36, .24);
  overflow: hidden;
  animation: mjSlideUp .22s cubic-bezier(.2, .85, .25, 1);
}
@media (min-width: 781px) {
  .mj-shell {
    border-radius: 26px;
  }
}
[data-theme="dark"] .mj-shell,
[data-theme="dark"] .mj-inline-moments {
  --mj-bg: #14161d;
  --mj-card: #1c1f29;
  --mj-fg: #f2f4fa;
  --mj-sub: #9aa2b4;
  --mj-line: rgba(255, 255, 255, .09);
  border-color: rgba(255, 255, 255, .1);
}
[data-theme="light"] .mj-shell,
.mj-shell,
[data-theme="light"] .mj-inline-moments,
.mj-inline-moments {
  --mj-bg: #f1f3f7;
  --mj-card: rgba(255, 255, 255, .86);
  --mj-fg: #171921;
  --mj-sub: #656c7c;
  --mj-line: rgba(23, 25, 33, .08);
}
.mj-inline-moments {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 8px 0 24px;
  color: var(--mj-fg);
}
body.skin-glass .mj-inline-moments {
  --mj-card: var(--lg-surface, rgba(255, 255, 255, .64));
  --mj-line: var(--lg-border, rgba(255, 255, 255, .52));
}
@keyframes mjSlideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.mj-head {
  flex: none;
  padding: 16px 18px 12px;
  background: linear-gradient(135deg, rgba(91, 103, 214, .11), rgba(167, 139, 250, .06) 55%, transparent);
  border-bottom: 1px solid var(--mj-line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.mj-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.mj-title-wrap h2 {
  margin: 0;
  font-size: 17.5px;
  font-weight: 700;
  letter-spacing: .3px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.mj-title-wrap small {
  font-size: 11.8px;
  color: var(--mj-sub);
}
.mj-close {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--mj-line);
  background: var(--mj-card);
  color: var(--mj-fg);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.mj-tabs {
  flex: none;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--mj-line);
}
.mj-tab {
  padding: 8px 6px;
  border-radius: 13px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--mj-sub);
  font: inherit;
  font-size: 12.6px;
  font-weight: 600;
  cursor: pointer;
  transition: background .16s ease, color .16s ease, border-color .16s ease;
}
.mj-tab.active {
  background: var(--mj-card);
  border-color: rgba(91, 103, 214, .28);
  color: #5b67d6;
  box-shadow: 0 4px 12px rgba(91, 103, 214, .09);
}

.mj-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px 14px calc(20px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* 顶部快捷入口胶囊（聊天列表/我的页） */
.mj-entry-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(91, 103, 214, .25);
  background: linear-gradient(135deg, rgba(91, 103, 214, .1), rgba(167, 139, 250, .1));
  color: #5b67d6;
  font: inherit;
  font-size: 12.2px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

/* 1. 角色动态（朋友圈） */
.mj-hero-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 18px;
  background: var(--mj-card);
  border: 1px solid var(--mj-line);
}
.mj-hero-bar p {
  margin: 0;
  font-size: 12.5px;
  color: var(--mj-sub);
  line-height: 1.5;
}
.mj-primary-btn {
  flex: none;
  padding: 8px 14px;
  border-radius: 999px;
  border: 0;
  background: #5b67d6;
  color: #fff;
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(91, 103, 214, .26);
  transition: transform .12s ease, opacity .15s ease;
}
.mj-primary-btn:disabled {
  opacity: .55;
  cursor: wait;
}
.mj-primary-btn:active {
  transform: scale(.96);
}

.mj-moment {
  padding: 14px;
  border-radius: 20px;
  background: var(--mj-card);
  border: 1px solid var(--mj-line);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.mj-moment-head {
  display: flex;
  align-items: center;
  gap: 10px;
}
.mj-av {
  width: 40px;
  height: 40px;
  border-radius: 13px;
  object-fit: cover;
  flex: none;
  background: rgba(91, 103, 214, .14);
  color: #5b67d6;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 14px;
  overflow: hidden;
}
.mj-av img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.mj-moment-meta {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.mj-moment-meta strong {
  font-size: 14.2px;
  color: var(--mj-fg);
}
.mj-moment-meta small {
  font-size: 11.5px;
  color: var(--mj-sub);
}
.mj-mood-tag {
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(91, 103, 214, .1);
  color: #5b67d6;
}
.mj-moment-text {
  margin: 0;
  font-size: 14px;
  line-height: 1.72;
  white-space: pre-wrap;
  color: var(--mj-fg);
}
.mj-moment-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--mj-line);
}
.mj-moment-acts {
  display: flex;
  align-items: center;
  gap: 8px;
}
.mj-act-btn {
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--mj-line);
  background: transparent;
  color: var(--mj-sub);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.mj-act-btn.liked {
  color: #e5484d;
  border-color: rgba(229, 72, 77, .28);
  background: rgba(229, 72, 77, .08);
}
.mj-comments {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 9px 11px;
  border-radius: 13px;
  background: rgba(var(--gray-128), .06);
  font-size: 12.6px;
  line-height: 1.55;
}
.mj-comment-line b {
  color: #5b67d6;
  margin-right: 4px;
}
.mj-comment-form {
  display: flex;
  gap: 6px;
}
.mj-comment-form input {
  flex: 1;
  min-width: 0;
  padding: 7px 11px;
  border-radius: 999px;
  border: 1px solid var(--mj-line);
  background: rgba(var(--gray-128), .05);
  color: var(--mj-fg);
  font: inherit;
  font-size: 12.8px;
  outline: 0;
}
.mj-comment-form button {
  padding: 6px 12px;
  border-radius: 999px;
  border: 0;
  background: var(--mj-fg);
  color: var(--mj-bg);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

/* 2. 月色小金库（虚拟零花 & 红包账单） */
.mj-wallet-card {
  padding: 18px;
  border-radius: 22px;
  background: linear-gradient(135deg, #21253a, #373f6e 62%, #5b67d6);
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 14px 32px rgba(45, 54, 110, .22);
}
.mj-wallet-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}
.mj-wallet-card .mj-mood-tag {
  background: rgba(255, 255, 255, .18);
  color: #eef1ff;
  border: 1px solid rgba(255, 255, 255, .24);
}
.mj-wallet-label {
  font-size: 12px;
  opacity: .78;
}
.mj-wallet-amt {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -.5px;
  font-variant-numeric: tabular-nums;
  margin-top: 2px;
}
.mj-wallet-note {
  font-size: 11px;
  opacity: .72;
}
.mj-wallet-btns {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.mj-wbtn {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .28);
  background: rgba(255, 255, 255, .14);
  color: #fff;
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}
.mj-wbtn.solid {
  background: #fff;
  color: #21253a;
  border-color: #fff;
}
.mj-wbtn:disabled {
  opacity: .55;
  cursor: default;
}

.mj-bill-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.mj-bill-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 13px;
  border-radius: 16px;
  background: var(--mj-card);
  border: 1px solid var(--mj-line);
}
.mj-bill-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.mj-bill-info strong {
  font-size: 13.5px;
}
.mj-bill-info small {
  font-size: 11.5px;
  color: var(--mj-sub);
}
.mj-bill-amt {
  font-size: 14.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.mj-bill-amt.plus {
  color: #16a34a;
}
.mj-bill-amt.minus {
  color: #e5484d;
}

/* 1:1 微信原版风格红包 & 转账聊天气泡卡片 */
.msg-redpacket.wx-pay-card {
  position: relative;
  width: min(248px, 68vw);
  border-radius: 6px;
  overflow: visible;
  background: #FA9D3B;
  color: #FFFFFF;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .06);
  margin: 1px 0 2px;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: opacity .15s ease, transform .12s ease;
}
.msg-redpacket.wx-pay-card:active {
  transform: scale(.985);
}
.msg-redpacket.wx-pay-card.is-opened {
  background: #F6C896;
}
/* 微信原版气泡小三角 */
.msg-redpacket.wx-pay-card.is-incoming::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 15px;
  width: 0;
  height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-right: 6px solid #FA9D3B;
}
.msg-redpacket.wx-pay-card.is-incoming.is-opened::before {
  border-right-color: #F6C896;
}
.msg-redpacket.wx-pay-card.is-outgoing::before {
  content: "";
  position: absolute;
  right: -5px;
  top: 15px;
  width: 0;
  height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 6px solid #FA9D3B;
}
.msg-redpacket.wx-pay-card.is-outgoing.is-opened::before {
  border-left-color: #F6C896;
}
.wx-pay-main {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px 14px 11px 13px;
  min-height: 64px;
  box-sizing: border-box;
}
.wx-pay-ico {
  width: 40px;
  height: 40px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
}
.wx-pay-ico svg {
  display: block;
}
.wx-pay-info {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
}
.wx-pay-title {
  color: #FFFFFF;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wx-rp-greet {
  font-size: 15.5px;
  font-weight: 500;
  letter-spacing: 0.01em;
}
.wx-tf-amt {
  font-size: 16.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}
.wx-pay-sub {
  font-size: 12px;
  line-height: 1.35;
  color: rgba(255, 255, 255, .92);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wx-pay-foot {
  height: 24px;
  padding: 0 13px;
  background: #FFFFFF;
  color: #999999;
  font-size: 11px;
  line-height: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: 0 0 6px 6px;
  border-top: 0.5px solid rgba(0, 0, 0, .04);
}
.wx-pay-brand {
  color: #999999;
  font-weight: 400;
}
body[data-theme="dark"] .wx-pay-foot,
body.theme-dark .wx-pay-foot,
body[data-skin="dark-glass"] .wx-pay-foot,
body[data-skin="night"] .wx-pay-foot {
  background: #2C2C2C;
  color: #8C8C8C;
  border-top-color: rgba(255, 255, 255, .06);
}
body[data-theme="dark"] .wx-pay-brand,
body.theme-dark .wx-pay-brand,
body[data-skin="dark-glass"] .wx-pay-brand,
body[data-skin="night"] .wx-pay-brand {
  color: #8C8C8C;
}
body[data-theme="dark"] .msg-redpacket.wx-pay-card.is-opened,
body.theme-dark .msg-redpacket.wx-pay-card.is-opened,
body[data-skin="dark-glass"] .msg-redpacket.wx-pay-card.is-opened {
  background: #9E7347;
}
body[data-theme="dark"] .msg-redpacket.wx-pay-card.is-incoming.is-opened::before,
body.theme-dark .msg-redpacket.wx-pay-card.is-incoming.is-opened::before,
body[data-skin="dark-glass"] .msg-redpacket.wx-pay-card.is-incoming.is-opened::before {
  border-right-color: #9E7347;
}
body[data-theme="dark"] .msg-redpacket.wx-pay-card.is-outgoing.is-opened::before,
body.theme-dark .msg-redpacket.wx-pay-card.is-outgoing.is-opened::before,
body[data-skin="dark-glass"] .msg-redpacket.wx-pay-card.is-outgoing.is-opened::before {
  border-left-color: #9E7347;
}
.row.me .bubble.has-redpacket,
.row.ai .bubble.has-redpacket {
  padding: 2px 4px !important;
  background: transparent !important;
  box-shadow: none !important;
  border: 0 !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  overflow: visible !important;
}

/* 3. 纪念日 & 打卡日历 */
.mj-cal-card {
  padding: 14px;
  border-radius: 20px;
  background: var(--mj-card);
  border: 1px solid var(--mj-line);
}
.mj-cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.mj-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 5px;
  text-align: center;
}
.mj-cal-wd {
  font-size: 11px;
  color: var(--mj-sub);
  padding-bottom: 4px;
}
.mj-cal-day {
  aspect-ratio: 1;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--mj-fg);
  position: relative;
}
.mj-cal-day.is-today {
  border: 1.5px solid #5b67d6;
  font-weight: 700;
}
.mj-cal-day.has-chat {
  background: rgba(91, 103, 214, .14);
  color: #5b67d6;
  font-weight: 700;
}
.mj-cal-day.has-chat::after {
  content: "";
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #5b67d6;
  position: absolute;
  bottom: 3px;
}
.mj-anni-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.mj-anni-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 16px;
  background: var(--mj-card);
  border: 1px solid var(--mj-line);
}
.mj-anni-days {
  font-size: 16px;
  font-weight: 800;
  color: #5b67d6;
  font-variant-numeric: tabular-nums;
}
.mj-anni-form {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding: 12px;
  border-radius: 16px;
  background: var(--mj-card);
  border: 1px solid var(--mj-line);
}
.mj-anni-form input {
  flex: 1;
  min-width: 120px;
  padding: 7px 10px;
  border-radius: 10px;
  border: 1px solid var(--mj-line);
  background: rgba(var(--gray-128), .05);
  color: var(--mj-fg);
  font: inherit;
  font-size: 12.8px;
}

/* 4. 相册 & 心动摘录 */
.mj-sub-switch {
  display: inline-flex;
  gap: 4px;
  padding: 3px;
  border-radius: 999px;
  background: rgba(var(--gray-128), .08);
  align-self: flex-start;
}
.mj-sub-btn {
  padding: 5px 12px;
  border-radius: 999px;
  border: 0;
  background: transparent;
  color: var(--mj-sub);
  font: inherit;
  font-size: 12.2px;
  font-weight: 600;
  cursor: pointer;
}
.mj-sub-btn.active {
  background: var(--mj-card);
  color: #5b67d6;
}
.mj-fav-card {
  padding: 14px 15px;
  border-radius: 18px;
  background: var(--mj-card);
  border: 1px solid var(--mj-line);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.mj-fav-quote {
  margin: 0;
  font-size: 13.8px;
  line-height: 1.7;
  color: var(--mj-fg);
  white-space: pre-wrap;
}
.mj-fav-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--mj-sub);
}
.mj-album-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.mj-album-tile {
  aspect-ratio: 1;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--mj-line);
  background: rgba(var(--gray-128), .08);
  position: relative;
  cursor: pointer;
  padding: 0;
}
.mj-album-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.mj-album-cap {
  position: absolute;
  inset: auto 0 0 0;
  padding: 4px 6px;
  font-size: 10px;
  color: #fff;
  background: linear-gradient(transparent, rgba(0, 0, 0, .65));
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 1:1 微信红包封面拆包弹窗 / 详情页 / 转账确认页 / 发送页 */
.wx-modal-mask {
  position: fixed;
  inset: 0;
  z-index: 9600;
  background: rgba(0, 0, 0, .58);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 16px;
  animation: wx-fade-in .16s ease;
}
@keyframes wx-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* 拆红包封面 */
.wx-rp-cover-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  width: min(306px, 86vw);
}
.wx-rp-cover {
  position: relative;
  width: 100%;
  min-height: 446px;
  border-radius: 12px;
  overflow: hidden;
  background: #D94E3E;
  box-shadow: 0 18px 46px rgba(0, 0, 0, .42);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-bottom: 22px;
}
.wx-rp-cover-top {
  width: 100%;
  padding: 58px 24px 104px;
  background: #E45946;
  border-bottom-left-radius: 50% 44px;
  border-bottom-right-radius: 50% 44px;
  box-shadow: 0 2.5px 0 rgba(242, 204, 139, .38), 0 8px 20px rgba(152, 34, 21, .28);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  box-sizing: border-box;
}
.wx-rp-sender {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #FDE1A9;
  font-size: 15px;
  font-weight: 500;
}
.wx-mini-av {
  width: 24px !important;
  height: 24px !important;
  border-radius: 4px !important;
  font-size: 12px !important;
  overflow: hidden;
  flex: none;
}
.wx-rp-cover-greet {
  color: #FDE1A9;
  font-size: 21px;
  font-weight: 600;
  text-align: center;
  line-height: 1.45;
  word-break: break-word;
}
.wx-rp-open-coin {
  width: 88px;
  height: 88px;
  margin-top: -44px;
  border-radius: 50%;
  border: 3px solid #F6D89E;
  background: radial-gradient(circle at 35% 30%, #F7DEA8, #E3BC74);
  color: #3A2C14;
  font-size: 36px;
  font-weight: 600;
  font-family: "PingFang SC", "Songti SC", serif;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(130, 36, 20, .35);
  transition: transform .15s ease;
  z-index: 2;
}
.wx-rp-open-coin:active {
  transform: scale(.94);
}
.wx-rp-open-coin.is-spinning {
  animation: wx-coin-spin .42s linear infinite;
}
@keyframes wx-coin-spin {
  0% { transform: rotateY(0deg); }
  100% { transform: rotateY(360deg); }
}
.wx-rp-cover-foot {
  color: rgba(253, 225, 169, .72);
  font-size: 11.5px;
  margin-top: auto;
  padding-top: 28px;
}
.wx-rp-cover-close {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, .65);
  background: transparent;
  color: #FFFFFF;
  font-size: 22px;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
}

/* 微信红包详情页 & 转账详情页共用白底卡片 */
.wx-detail-sheet,
.wx-send-sheet {
  width: min(360px, 92vw);
  max-height: 86vh;
  overflow-y: auto;
  border-radius: 12px;
  background: #FFFFFF;
  color: #191919;
  box-shadow: 0 18px 46px rgba(0, 0, 0, .32);
}
.wx-rp-detail-banner {
  background: #E45946;
  height: 92px;
  border-bottom-left-radius: 50% 28px;
  border-bottom-right-radius: 50% 28px;
  padding: 12px 14px 0;
  box-sizing: border-box;
}
.wx-detail-nav,
.wx-tf-nav,
.wx-send-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 15.5px;
  font-weight: 600;
}
.wx-detail-nav {
  color: #FDE1A9;
}
.wx-detail-back,
.wx-tf-close {
  width: 32px;
  height: 32px;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.wx-nav-spacer {
  width: 32px;
}
.wx-rp-detail-body {
  padding: 18px 20px 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.wx-rp-detail-sender {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 600;
  color: #191919;
}
.wx-detail-av {
  width: 26px !important;
  height: 26px !important;
  border-radius: 4px !important;
  font-size: 12px !important;
}
.wx-rp-detail-greet {
  margin-top: 6px;
  font-size: 13px;
  color: #888888;
}
.wx-rp-detail-amt {
  margin-top: 22px;
  color: #CFA052;
  display: flex;
  align-items: baseline;
  gap: 3px;
}
.wx-amt-num {
  font-size: 46px;
  font-weight: 600;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.wx-amt-unit {
  font-size: 14px;
  font-weight: 500;
}
.wx-rp-detail-link {
  margin-top: 10px;
  border: 0;
  background: transparent;
  color: #CFA052;
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
}
.wx-rp-rec-list {
  border-top: 8px solid #F7F7F7;
  padding: 10px 18px 16px;
}
.wx-rp-rec-head {
  font-size: 12.5px;
  color: #999999;
  padding-bottom: 10px;
  border-bottom: 0.5px solid #EDEDED;
}
.wx-rp-rec-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0 4px;
}
.wx-rp-rec-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.wx-rp-rec-left strong {
  font-size: 14.5px;
  color: #191919;
}
.wx-rp-rec-left small {
  font-size: 12px;
  color: #999999;
}
.wx-rp-rec-amt {
  font-size: 15px;
  font-weight: 600;
  color: #191919;
  font-variant-numeric: tabular-nums;
}

/* 微信转账详情 / 收款页 */
.wx-tf-nav {
  padding: 12px 14px;
  color: #191919;
}
.wx-tf-body {
  padding: 22px 24px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.wx-tf-status-ico {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  margin-bottom: 14px;
}
.wx-tf-status-ico.is-ok { background: #07C160; }
.wx-tf-status-ico.is-wait { background: #FA9D3B; }
.wx-tf-status-ico.is-refund { background: #8E8E93; }
.wx-tf-status-txt {
  font-size: 16px;
  color: #191919;
  font-weight: 500;
}
.wx-tf-big-amt {
  margin-top: 12px;
  font-size: 40px;
  font-weight: 700;
  color: #191919;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.wx-tf-note-line {
  margin-top: 8px;
  font-size: 13px;
  color: #7F7F7F;
}
.wx-tf-actions {
  padding: 18px 28px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.wx-green-btn {
  width: 100%;
  height: 44px;
  border: 0;
  border-radius: 8px;
  background: #07C160;
  color: #FFFFFF;
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}
.wx-green-btn:active { background: #06AD56; }
.wx-red-btn {
  width: 100%;
  height: 44px;
  border: 0;
  border-radius: 8px;
  background: #EA5F4B;
  color: #FFFFFF;
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}
.wx-red-btn:active { background: #D94E3E; }
.wx-tf-refund-hint {
  font-size: 12.5px;
  color: #888888;
}
.wx-link-btn {
  border: 0;
  background: transparent;
  color: #576B95;
  font: inherit;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  padding: 0 2px;
}
.wx-tf-meta {
  border-top: 0.5px solid #EDEDED;
  margin: 12px 20px 0;
  padding: 14px 0 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: #999999;
  text-align: center;
}

/* 微信风格发红包 / 转账输入弹窗 */
.wx-send-sheet {
  background: #EDEDED;
  overflow: hidden;
}
.wx-send-topbar {
  background: #EDEDED;
  padding: 12px 14px 10px;
  color: #191919;
}
.wx-send-cancel {
  border: 0;
  background: transparent;
  color: #191919;
  font: inherit;
  font-size: 14.5px;
  cursor: pointer;
  padding: 4px 2px;
}
.wx-send-tabs {
  display: inline-flex;
  background: rgba(0, 0, 0, .06);
  border-radius: 8px;
  padding: 3px;
  gap: 2px;
}
.wx-send-tab {
  border: 0;
  background: transparent;
  color: #555555;
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  padding: 5px 16px;
  border-radius: 6px;
  cursor: pointer;
}
.wx-send-tab.active {
  background: #FFFFFF;
  color: #EA5F4B;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .08);
}
.wx-send-sheet.is-transfer-mode .wx-send-tab.active {
  color: #07C160;
}
.wx-send-body {
  padding: 8px 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.wx-rp-row {
  background: #FFFFFF;
  border-radius: 8px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.wx-rp-row-label {
  font-size: 15px;
  font-weight: 500;
  color: #191919;
  flex: none;
}
.wx-rp-row-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  justify-content: flex-end;
}
.wx-rp-amt-input {
  width: 130px;
  border: 0;
  outline: none;
  background: transparent;
  text-align: right;
  font-size: 17px;
  font-weight: 600;
  color: #191919;
  font-variant-numeric: tabular-nums;
}
.wx-rp-row-unit {
  font-size: 14px;
  color: #191919;
}
.wx-rp-note-input {
  width: 100%;
  border: 0;
  outline: none;
  background: transparent;
  font: inherit;
  font-size: 14.5px;
  color: #191919;
}
.wx-rp-big-preview {
  text-align: center;
  font-size: 38px;
  font-weight: 700;
  color: #191919;
  font-variant-numeric: tabular-nums;
  padding: 4px 0;
}
.wx-tf-recipient {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 6px 0 2px;
}
.wx-tf-av {
  width: 44px !important;
  height: 44px !important;
  border-radius: 6px !important;
}
.wx-tf-to-name {
  font-size: 15px;
  font-weight: 600;
  color: #191919;
}
.wx-tf-input-card {
  background: #FFFFFF;
  border-radius: 10px;
  padding: 16px 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.wx-tf-input-label {
  font-size: 13.5px;
  color: #555555;
}
.wx-tf-amt-line {
  display: flex;
  align-items: baseline;
  gap: 8px;
  border-bottom: 1px solid #EDEDED;
  padding-bottom: 8px;
}
.wx-tf-yen {
  font-size: 30px;
  font-weight: 700;
  color: #191919;
}
.wx-tf-amt-input {
  width: 100%;
  border: 0;
  outline: none;
  background: transparent;
  font-size: 34px;
  font-weight: 700;
  color: #191919;
  font-variant-numeric: tabular-nums;
}
.wx-tf-note-input {
  width: 100%;
  border: 0;
  outline: none;
  background: transparent;
  font: inherit;
  font-size: 13.5px;
  color: #576B95;
  padding-top: 2px;
}
.wx-send-presets {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.wx-send-sheet.is-transfer-mode .wx-send-presets {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}
.wx-preset-pill {
  padding: 8px 6px;
  border-radius: 6px;
  border: 1px solid rgba(0, 0, 0, .08);
  background: #FFFFFF;
  color: #333333;
  font: inherit;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wx-preset-pill.active {
  border-color: #EA5F4B;
  color: #EA5F4B;
  background: #FFF5F3;
}
.wx-send-sheet.is-transfer-mode .wx-preset-pill.active {
  border-color: #07C160;
  color: #07C160;
  background: #F0FBF5;
}
.wx-send-bal {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: #7F7F7F;
  padding: 0 2px;
}
.wx-send-footnote {
  text-align: center;
  font-size: 11px;
  color: #999999;
}

@media (prefers-reduced-motion: reduce) {
  .wx-rp-open-coin.is-spinning,
  .wx-modal-mask { animation: none; }
}


/* === modules/bubble-pack.css === */
/* ==========================================================================
   月见 MOON · 沉浸透背景底栏 + 20 款可爱 AI 气泡装扮 (bubble-pack.css)
   ========================================================================== */

/* ---------- 0. 微信式沉浸聊天：进入聊天页直接隐藏底部 5-Tab 导航栏 ---------- */
body.h5-active[data-h5-page='chat'] .h5-nav {
  display: none !important;
}
body.h5-active[data-h5-page='chat'] .composer-wrap {
  padding-bottom: max(12px, env(safe-area-inset-bottom)) !important;
}
body.h5-active.h5-keyboard[data-h5-page='chat'] .composer-wrap {
  padding-bottom: 8px !important;
}

/* ---------- 1. 聊天页全屏透出背景 + 顶部栏 / 输入栏磨砂融入 ---------- */
body.h5-active[data-h5-page='chat'].has-chat-bg .app {
  background-image:
    linear-gradient(rgba(255, 255, 255, var(--chatbg-dim, .18)),
                    rgba(255, 255, 255, var(--chatbg-dim, .18))),
    var(--chatbg) !important;
  background-size: cover, cover !important;
  background-position: center, center !important;
  background-repeat: no-repeat, no-repeat !important;
}
:root[data-theme='dark'] body.h5-active[data-h5-page='chat'].has-chat-bg .app {
  background-image:
    linear-gradient(rgba(10, 12, 18, var(--chatbg-dim, .38)),
                    rgba(10, 12, 18, var(--chatbg-dim, .38))),
    var(--chatbg) !important;
}
body.h5-active[data-h5-page='chat'].has-chat-bg #messages,
body.h5-active[data-h5-page='chat'].has-chat-bg #messages.has-chat-bg {
  background: transparent !important;
  background-image: none !important;
}

/* 顶部栏极轻透明渐变融入聊天壁纸（禁用移动端 heavy backdrop-filter 防安卓 GPU 瓦片丢失） */
body.h5-active[data-h5-page='chat'].has-chat-bg .h5-chat-intro {
  background: linear-gradient(180deg, rgba(255, 255, 255, .86) 0%, rgba(255, 255, 255, .56) 76%, rgba(255, 255, 255, 0) 100%) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border-bottom: 0 !important;
  box-shadow: none !important;
}
:root[data-theme='dark'] body.h5-active[data-h5-page='chat'].has-chat-bg .h5-chat-intro {
  background: linear-gradient(180deg, rgba(14, 18, 28, .82) 0%, rgba(14, 18, 28, .50) 76%, rgba(14, 18, 28, 0) 100%) !important;
  border-bottom: 0 !important;
}
:root[data-theme='dark'] body.h5-active[data-h5-page='chat'].has-chat-bg .h5-chat-intro-sub {
  color: rgba(255, 255, 255, .78) !important;
  text-shadow: 0 1px 4px rgba(0, 0, 0, .28);
}
body.h5-active[data-h5-page='chat'].has-chat-bg .h5-chat-top .h5-icon-button {
  background: rgba(255, 255, 255, .78) !important;
  border-color: rgba(255, 255, 255, .72) !important;
}
:root[data-theme='dark'] body.h5-active[data-h5-page='chat'].has-chat-bg .h5-chat-top .h5-icon-button {
  background: rgba(22, 26, 38, .66) !important;
  border-color: rgba(255, 255, 255, .18) !important;
}

/* 输入栏 + 底部 5-Tab 悬浮胶囊：高透霜面底色，无重度 backdrop-filter */
body.h5-active[data-h5-page='chat'].has-chat-bg .composer-wrap {
  background: transparent !important;
  border-top: 0 !important;
}
body.h5-active[data-h5-page='chat'].has-chat-bg .composer {
  background: rgba(255, 255, 255, .90) !important;
  border: 1px solid rgba(255, 255, 255, .82) !important;
  box-shadow: 0 6px 24px rgba(15, 20, 34, .10) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
:root[data-theme='dark'] body.h5-active[data-h5-page='chat'].has-chat-bg .composer {
  background: rgba(22, 26, 38, .88) !important;
  border: 1px solid rgba(255, 255, 255, .18) !important;
  box-shadow: 0 8px 26px rgba(0, 0, 0, .22) !important;
}
:root[data-theme='dark'] body.h5-active[data-h5-page='chat'].has-chat-bg .composer textarea {
  color: #ffffff !important;
}
:root[data-theme='dark'] body.h5-active[data-h5-page='chat'].has-chat-bg .composer textarea::placeholder {
  color: rgba(255, 255, 255, .74) !important;
}
:root[data-theme='dark'] body.h5-active[data-h5-page='chat'].has-chat-bg .composer .icon-btn,
:root[data-theme='dark'] body.h5-active[data-h5-page='chat'].has-chat-bg .composer .voice-btn,
:root[data-theme='dark'] body.h5-active[data-h5-page='chat'].has-chat-bg .composer .plus-btn,
:root[data-theme='dark'] body.h5-active[data-h5-page='chat'].has-chat-bg .composer .composer-tool-btn {
  color: rgba(255, 255, 255, .86) !important;
}
:root[data-theme='dark'] body.h5-active[data-h5-page='chat'].has-chat-bg .composer .voice-hold-btn {
  background: rgba(255, 255, 255, .14) !important;
  border-color: rgba(255, 255, 255, .22) !important;
  color: #ffffff !important;
}
:root[data-theme='dark'] body.h5-active[data-h5-page='chat'].has-chat-bg .composer .voice-hold-btn.is-pressing {
  background: rgba(255, 255, 255, .26) !important;
}
body.h5-active[data-h5-page='chat'].has-chat-bg .composer-plus-tray {
  background: rgba(255, 255, 255, .94) !important;
  border-color: rgba(255, 255, 255, .80) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
:root[data-theme='dark'] body.h5-active[data-h5-page='chat'].has-chat-bg .composer-plus-tray {
  background: rgba(22, 26, 38, .94) !important;
  border-color: rgba(255, 255, 255, .18) !important;
}
body.h5-active[data-h5-page='chat'].has-chat-bg .h5-nav {
  background: rgba(255, 255, 255, .90) !important;
  border: 1px solid rgba(255, 255, 255, .78) !important;
  box-shadow: 0 8px 26px rgba(15, 20, 34, .10) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
:root[data-theme='dark'] body.h5-active[data-h5-page='chat'].has-chat-bg .h5-nav {
  background: rgba(20, 24, 34, .90) !important;
  border: 1px solid rgba(255, 255, 255, .16) !important;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .24) !important;
}
:root[data-theme='dark'] body.h5-active[data-h5-page='chat'].has-chat-bg .h5-nav-item {
  color: rgba(255, 255, 255, .74) !important;
}
:root[data-theme='dark'] body.h5-active[data-h5-page='chat'].has-chat-bg .h5-nav-item[aria-current] {
  color: #ffffff !important;
}
:root[data-theme='dark'] body.h5-active[data-h5-page='chat'].has-chat-bg .h5-nav-item.h5-nav-fab {
  background: linear-gradient(155deg, rgba(44, 50, 68, .92) 0%, rgba(22, 26, 36, .92) 100%) !important;
  border-color: rgba(255, 255, 255, .24) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

/* 有背景时默认气泡采用高质感丝滑半透底（不叠 backdrop-filter，杜绝滚动撕裂/花屏） */
body.h5-active[data-h5-page='chat'].has-chat-bg #messages .row.ai .bubble {
  background: rgba(255, 255, 255, .92);
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
body.h5-active[data-h5-page='chat'].has-chat-bg #messages .row.me .bubble {
  background: rgba(236, 242, 252, .94);
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
:root[data-theme='dark'] body.h5-active[data-h5-page='chat'].has-chat-bg #messages .row.ai .bubble {
  background: rgba(28, 32, 44, .88);
  border-color: rgba(255, 255, 255, .16);
}
:root[data-theme='dark'] body.h5-active[data-h5-page='chat'].has-chat-bg #messages .row.me .bubble {
  background: rgba(46, 52, 72, .90);
  border-color: rgba(255, 255, 255, .20);
}

/* 桌面端有聊天背景时，顶部栏与底栏同样轻透融入 */
@media (min-width: 781px) {
  body.has-chat-bg .main {
    background-image:
      linear-gradient(rgba(255, 255, 255, var(--chatbg-dim, .2)),
                      rgba(255, 255, 255, var(--chatbg-dim, .2))),
      var(--chatbg);
    background-size: cover, cover;
    background-position: center, center;
  }
  :root[data-theme='dark'] body.has-chat-bg .main {
    background-image:
      linear-gradient(rgba(10, 12, 18, var(--chatbg-dim, .4)),
                      rgba(10, 12, 18, var(--chatbg-dim, .4))),
      var(--chatbg);
  }
  body.has-chat-bg #messages,
  body.has-chat-bg #messages.has-chat-bg {
    background: transparent !important;
    background-image: none !important;
  }
  body.has-chat-bg .chat-head {
    background: rgba(255, 255, 255, .52);
    backdrop-filter: blur(18px) saturate(140%);
  }
  :root[data-theme='dark'] body.has-chat-bg .chat-head {
    background: rgba(18, 22, 32, .42);
    border-bottom-color: rgba(255, 255, 255, .12);
  }
  body.has-chat-bg .composer-wrap {
    background: transparent;
  }
  body.has-chat-bg .composer {
    background: rgba(255, 255, 255, .58);
    backdrop-filter: blur(20px) saturate(145%);
  }
  :root[data-theme='dark'] body.has-chat-bg .composer {
    background: rgba(22, 26, 38, .44);
    border-color: rgba(255, 255, 255, .18);
  }
}

/* ---------- 2. 20 款可爱 AI 气泡装扮样式（变量驱动 + 萌趣透明角标贴纸） ---------- */
body[data-bubble-style]:not([data-bubble-style='default']) #messages .row.ai .bubble:not(.img-bubble):not(.has-redpacket) {
  position: relative;
  background: var(--bub-ai-bg) !important;
  border: 1.5px solid var(--bub-ai-bd) !important;
  color: var(--bub-ai-fg) !important;
  box-shadow: 0 6px 18px var(--bub-shadow, rgba(20, 26, 48, .08)) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border-radius: 18px !important;
  border-top-left-radius: 6px !important;
  overflow: visible !important;
}
body[data-bubble-style]:not([data-bubble-style='default']) #messages .row.me .bubble:not(.img-bubble):not(.has-redpacket) {
  position: relative;
  background: var(--bub-me-bg) !important;
  border: 1.5px solid var(--bub-me-bd) !important;
  color: var(--bub-me-fg) !important;
  box-shadow: 0 6px 18px var(--bub-shadow, rgba(20, 26, 48, .08)) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border-radius: 18px !important;
  border-top-right-radius: 6px !important;
  overflow: visible !important;
}
body[data-bubble-style]:not([data-bubble-style='default']) #messages .row.ai .bubble .rp-paren {
  color: var(--bub-paren-fg, inherit) !important;
  opacity: .76;
}

/* 萌宠/饰品透明小贴纸：仅挂在非连续第一条气泡右上角 & 用户气泡左上角，可爱不挡字 */
body[data-bubble-style]:not([data-bubble-style='default']) #messages .row.ai:not(.grouped) .bubble:not(.img-bubble):not(.has-redpacket)::after {
  content: '';
  position: absolute;
  top: -15px;
  right: -11px;
  width: 30px;
  height: 30px;
  background-image: var(--bub-charm);
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  pointer-events: none;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, .14));
  z-index: 2;
}
body[data-bubble-style]:not([data-bubble-style='default']) #messages .row.me:not(.grouped) .bubble:not(.img-bubble):not(.has-redpacket)::after {
  content: '';
  position: absolute;
  top: -14px;
  left: -10px;
  width: 26px;
  height: 26px;
  background-image: var(--bub-charm);
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  pointer-events: none;
  transform: scaleX(-1);
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, .14));
  z-index: 2;
}
/* 让贴纸有轻微呼吸边距，避免紧贴上一条气泡 */
body[data-bubble-style]:not([data-bubble-style='default']):not([data-bubble-style='liquid-glass']) #messages .row:not(.grouped) {
  margin-top: 8px;
}

/* ---------- 2b. 液态玻璃气泡（可自定义通透度 / 磨砂模糊 / 高光折射 / 圆角 / 光学色调） ---------- */
body[data-bubble-style='liquid-glass'] #messages .row.ai .bubble:not(.img-bubble):not(.has-redpacket) {
  background: var(--bub-ai-bg) !important;
  border: 1px solid var(--bub-ai-bd) !important;
  color: var(--bub-ai-fg) !important;
  box-shadow: var(--lg-shadow) !important;
  text-shadow: var(--lg-text-shadow, none);
  backdrop-filter: blur(var(--lg-blur, 0px)) saturate(var(--lg-sat, 130%)) brightness(1.03) !important;
  -webkit-backdrop-filter: blur(var(--lg-blur, 0px)) saturate(var(--lg-sat, 130%)) brightness(1.03) !important;
  border-radius: var(--lg-radius, 28px) !important;
  border-top-left-radius: var(--lg-corner, 9px) !important;
}
body[data-bubble-style='liquid-glass'] #messages .row.me .bubble:not(.img-bubble):not(.has-redpacket) {
  background: var(--bub-me-bg) !important;
  border: 1px solid var(--bub-me-bd) !important;
  color: var(--bub-me-fg) !important;
  box-shadow: var(--lg-shadow) !important;
  text-shadow: var(--lg-text-shadow, none);
  backdrop-filter: blur(var(--lg-blur, 0px)) saturate(var(--lg-sat, 130%)) brightness(1.03) !important;
  -webkit-backdrop-filter: blur(var(--lg-blur, 0px)) saturate(var(--lg-sat, 130%)) brightness(1.03) !important;
  border-radius: var(--lg-radius, 28px) !important;
  border-top-right-radius: var(--lg-corner, 9px) !important;
}
:root[data-theme='dark'] body[data-bubble-style='liquid-glass'] #messages .row .bubble:not(.img-bubble):not(.has-redpacket) {
  backdrop-filter: blur(var(--lg-blur, 0px)) saturate(var(--lg-sat, 130%)) brightness(1.08) !important;
  -webkit-backdrop-filter: blur(var(--lg-blur, 0px)) saturate(var(--lg-sat, 130%)) brightness(1.08) !important;
}
body[data-bubble-style='liquid-glass'] #messages .row .bubble::after {
  display: none !important;
}
/* 弹窗打开时暂停液态玻璃 backdrop-filter，防止安卓 GPU 瓦片撕裂 */
body.grp-modal-open[data-bubble-style='liquid-glass'] #messages .bubble {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

/* ---------- 3. 气泡装扮选择弹窗（20 款可视化网格 + 实时预览） ---------- */
.bp-mask {
  position: fixed;
  inset: 0;
  z-index: 82;
  background: rgba(14, 17, 26, .52);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: mjFadeIn .16s ease;
}
@media (min-width: 781px) {
  .bp-mask {
    align-items: center;
    padding: 20px;
  }
}
.bp-shell {
  width: min(580px, 100%);
  max-height: 88dvh;
  display: flex;
  flex-direction: column;
  border-radius: 26px 26px 0 0;
  background: var(--mj-bg, #f1f3f7);
  color: var(--mj-fg, #171921);
  border: 1px solid rgba(255, 255, 255, .6);
  box-shadow: 0 24px 64px rgba(15, 20, 36, .26);
  overflow: hidden;
}
@media (min-width: 781px) {
  .bp-shell {
    border-radius: 26px;
  }
}
:root[data-theme='dark'] .bp-shell {
  background: #151821;
  color: #f2f4fa;
  border-color: rgba(255, 255, 255, .12);
}
.bp-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 18px 10px;
  border-bottom: 1px solid rgba(128, 134, 150, .14);
}
.bp-head h3 {
  margin: 0;
  font-size: 16.5px;
  font-weight: 700;
}
.bp-head small {
  display: block;
  font-size: 11.5px;
  opacity: .68;
  margin-top: 2px;
}
.bp-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 0;
  background: rgba(128, 134, 150, .14);
  color: inherit;
  font-size: 18px;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.bp-scope-bar {
  display: flex;
  gap: 8px;
  padding: 10px 16px 6px;
}
.bp-scope-btn {
  flex: 1;
  padding: 7px 10px;
  border-radius: 12px;
  border: 1px solid rgba(128, 134, 150, .22);
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}
.bp-scope-btn.active {
  background: #5b67d6;
  border-color: #5b67d6;
  color: #fff;
}
.bp-preview {
  margin: 6px 16px 10px;
  padding: 16px 14px 12px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(162, 178, 214, .28), rgba(202, 212, 234, .22));
  border: 1px solid rgba(128, 134, 150, .16);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.bp-pv-row {
  display: flex;
}
.bp-pv-row.me {
  justify-content: flex-end;
}
.bp-pv-bub {
  position: relative;
  max-width: 78%;
  padding: 8px 13px;
  border-radius: 16px;
  font-size: 13px;
  line-height: 1.5;
  backdrop-filter: blur(12px);
}
.bp-pv-bub.ai { border-top-left-radius: 5px; }
.bp-pv-bub.me { border-top-right-radius: 5px; }
.bp-pv-charm {
  position: absolute;
  top: -13px;
  right: -9px;
  width: 26px;
  height: 26px;
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .14));
}
.bp-pv-bub.me .bp-pv-charm {
  right: auto;
  left: -9px;
  transform: scaleX(-1);
}
.bp-grid {
  flex: 1;
  overflow-y: auto;
  padding: 4px 16px calc(18px + env(safe-area-inset-bottom, 0px));
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
@media (min-width: 520px) {
  .bp-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
.bp-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 7px;
  padding: 10px 10px 9px;
  border-radius: 16px;
  border: 1.5px solid rgba(128, 134, 150, .18);
  background: rgba(255, 255, 255, .72);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform .12s ease, border-color .15s ease, box-shadow .15s ease;
}
:root[data-theme='dark'] .bp-card {
  background: rgba(255, 255, 255, .05);
  border-color: rgba(255, 255, 255, .10);
}
.bp-card:active {
  transform: scale(.96);
}
.bp-card.active {
  border-color: #5b67d6;
  box-shadow: 0 6px 18px rgba(91, 103, 214, .22);
}
.bp-card-swatch {
  position: relative;
  height: 54px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  overflow: visible;
}
.bp-mini-bub {
  position: relative;
  width: 100%;
  padding: 7px 10px;
  border-radius: 12px;
  border-top-left-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bp-card-img {
  position: absolute;
  top: -8px;
  right: -6px;
  width: 34px;
  height: 34px;
  object-fit: contain;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, .16));
  pointer-events: none;
}
.bp-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}
.bp-card-meta strong {
  font-size: 12.5px;
  font-weight: 650;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bp-card-meta span {
  font-size: 10px;
  opacity: .62;
  flex: none;
}
.bp-card.active .bp-card-meta span {
  color: #5b67d6;
  opacity: 1;
  font-weight: 700;
}

/* ---------- 4. 液态玻璃预览背景 & 自定义参数调节面板 ---------- */
.bp-preview.is-glass {
  background:
    radial-gradient(circle at 18% 22%, rgba(124, 186, 255, .58), transparent 46%),
    radial-gradient(circle at 82% 76%, rgba(255, 168, 214, .54), transparent 48%),
    radial-gradient(circle at 52% 48%, rgba(168, 152, 255, .44), transparent 56%),
    linear-gradient(135deg, #c9daf6 0%, #e7d8f7 52%, #d4eef6 100%);
  border-color: rgba(255, 255, 255, .42);
}
:root[data-theme='dark'] .bp-preview.is-glass {
  background:
    radial-gradient(circle at 18% 22%, rgba(76, 134, 232, .52), transparent 48%),
    radial-gradient(circle at 84% 78%, rgba(208, 96, 164, .44), transparent 50%),
    radial-gradient(circle at 52% 46%, rgba(112, 92, 214, .38), transparent 58%),
    linear-gradient(135deg, #172038 0%, #241b38 52%, #142838 100%);
  border-color: rgba(255, 255, 255, .14);
}
.bp-card-swatch.is-glass-swatch {
  background:
    radial-gradient(circle at 20% 25%, rgba(128, 194, 255, .52), transparent 52%),
    radial-gradient(circle at 82% 78%, rgba(248, 168, 218, .48), transparent 54%),
    linear-gradient(135deg, rgba(196, 218, 252, .65), rgba(228, 212, 252, .65));
}
:root[data-theme='dark'] .bp-card-swatch.is-glass-swatch {
  background:
    radial-gradient(circle at 20% 25%, rgba(82, 146, 240, .48), transparent 52%),
    radial-gradient(circle at 82% 78%, rgba(206, 98, 166, .42), transparent 54%),
    linear-gradient(135deg, rgba(28, 42, 74, .82), rgba(44, 30, 68, .82));
}
.bp-glass-panel {
  margin: 0 16px 10px;
  padding: 11px 13px 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, .62);
  border: 1px solid rgba(128, 134, 150, .18);
  display: flex;
  flex-direction: column;
  gap: 9px;
}
:root[data-theme='dark'] .bp-glass-panel {
  background: rgba(255, 255, 255, .05);
  border-color: rgba(255, 255, 255, .12);
}
.bp-glass-panel[hidden] {
  display: none !important;
}
.bp-glass-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.bp-glass-title {
  font-size: 12.5px;
  font-weight: 700;
}
.bp-glass-reset {
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid rgba(128, 134, 150, .24);
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 11px;
  opacity: .78;
  cursor: pointer;
}
.bp-glass-reset:active {
  opacity: 1;
  transform: scale(.96);
}
.bp-tint-row {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 6px;
}
.bp-tint-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 6px 2px 5px;
  border-radius: 11px;
  border: 1.5px solid rgba(128, 134, 150, .18);
  background: rgba(255, 255, 255, .45);
  color: inherit;
  font: inherit;
  font-size: 10.5px;
  cursor: pointer;
  transition: border-color .14s ease, transform .1s ease;
}
:root[data-theme='dark'] .bp-tint-btn {
  background: rgba(255, 255, 255, .05);
  border-color: rgba(255, 255, 255, .10);
}
.bp-tint-btn.active {
  border-color: #5b67d6;
  background: rgba(91, 103, 214, .14);
  font-weight: 700;
}
.bp-tint-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid rgba(128, 134, 150, .28);
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, .85), 0 2px 5px rgba(0, 0, 0, .10);
}
.bp-sliders {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
}
.bp-slider-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.bp-slider-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
}
.bp-slider-head em {
  font-style: normal;
  font-variant-numeric: tabular-nums;
  opacity: .72;
  font-size: 11px;
}
.bp-range {
  width: 100%;
  margin: 0;
  accent-color: #5b67d6;
  cursor: pointer;
}


/* === modules/card-theme.css === */
/* ==========================================================================
   月见 MOON · 单角色专属美化系统 (modules/card-theme.css)
   8 套精选全套皮肤预设 · 开场档案卡 · 可折叠羁绊条 · 气泡/顶栏/输入框/轻氛围联动
   ========================================================================== */

/* ---------- 1. 预设主题变量（作用域限定在 #main，不影响广场与我的页面） ---------- */
body.card-theme-active #main {
  --ct-accent: #e11d48;
  --ct-accent-soft: rgba(225, 29, 72, .18);
  --ct-accent-bd: rgba(225, 29, 72, .38);
  --ct-accent-glow: rgba(225, 29, 72, .28);
  --ct-card-bg: rgba(14, 11, 16, .88);
  --ct-card-bd: rgba(225, 29, 72, .34);
  --ct-card-fg: #f4eff3;
  --ct-card-muted: rgba(236, 224, 232, .62);
  --ct-bub-ai-bg: rgba(22, 18, 26, .88);
  --ct-bub-ai-bd: rgba(225, 29, 72, .26);
  --ct-bub-ai-fg: #f4eff3;
  --ct-bub-me-bg: linear-gradient(135deg, rgba(159, 18, 57, .90), rgba(190, 24, 93, .86));
  --ct-bub-me-bd: rgba(251, 113, 133, .40);
  --ct-bub-me-fg: #fff7f9;
  --ct-paren: #fda4af;
  --ct-font: "Songti SC", "STSong", "Noto Serif SC", Georgia, serif;
  --ct-topbar-bg: rgba(16, 12, 18, .78);
  --ct-comp-bg: rgba(18, 14, 22, .86);
  --ct-comp-bd: rgba(225, 29, 72, .30);
  --ct-ava-ring: rgba(244, 63, 94, .62);
  --ct-bond-bg: rgba(16, 12, 19, .90);
  --ct-badge-radius: 50%;
  --ct-ambient-bg: radial-gradient(circle at 20% 20%, rgba(225, 29, 72, .14), transparent 55%), radial-gradient(circle at 80% 75%, rgba(190, 24, 93, .12), transparent 55%);
  --ct-particle-color: rgba(251, 113, 133, .55);
}

/* 预设 2：月光琉璃 */
body.card-theme-active[data-card-theme="moonlight-glass"] #main {
  --ct-accent: #93c5fd;
  --ct-accent-soft: rgba(147, 197, 253, .16);
  --ct-accent-bd: rgba(147, 197, 253, .38);
  --ct-accent-glow: rgba(147, 197, 253, .28);
  --ct-card-bg: rgba(10, 16, 34, .84);
  --ct-card-bd: rgba(147, 197, 253, .34);
  --ct-card-fg: #eff6ff;
  --ct-card-muted: rgba(219, 234, 254, .65);
  --ct-bub-ai-bg: rgba(15, 23, 46, .84);
  --ct-bub-ai-bd: rgba(147, 197, 253, .28);
  --ct-bub-ai-fg: #f0f6ff;
  --ct-bub-me-bg: linear-gradient(135deg, rgba(59, 130, 246, .86), rgba(99, 102, 241, .84));
  --ct-bub-me-bd: rgba(191, 219, 254, .42);
  --ct-bub-me-fg: #ffffff;
  --ct-paren: #bfdbfe;
  --ct-font: inherit;
  --ct-topbar-bg: rgba(10, 16, 34, .76);
  --ct-comp-bg: rgba(12, 19, 38, .84);
  --ct-comp-bd: rgba(147, 197, 253, .30);
  --ct-ava-ring: rgba(147, 197, 253, .65);
  --ct-bond-bg: rgba(10, 16, 34, .88);
  --ct-ambient-bg: radial-gradient(circle at 22% 18%, rgba(147, 197, 253, .16), transparent 55%), radial-gradient(circle at 78% 82%, rgba(167, 139, 250, .14), transparent 55%);
  --ct-particle-color: rgba(191, 219, 254, .62);
}

/* 预设 3：鎏金王座 */
body.card-theme-active[data-card-theme="gilded-velvet"] #main {
  --ct-accent: #e5be67;
  --ct-accent-soft: rgba(212, 175, 55, .16);
  --ct-accent-bd: rgba(212, 175, 55, .42);
  --ct-accent-glow: rgba(212, 175, 55, .26);
  --ct-card-bg: rgba(16, 13, 11, .90);
  --ct-card-bd: rgba(212, 175, 55, .40);
  --ct-card-fg: #fbf5e6;
  --ct-card-muted: rgba(240, 224, 186, .66);
  --ct-bub-ai-bg: rgba(24, 19, 15, .88);
  --ct-bub-ai-bd: rgba(212, 175, 55, .30);
  --ct-bub-ai-fg: #fbf5e6;
  --ct-bub-me-bg: linear-gradient(135deg, rgba(161, 118, 38, .90), rgba(120, 82, 24, .90));
  --ct-bub-me-bd: rgba(245, 208, 138, .44);
  --ct-bub-me-fg: #fffcf2;
  --ct-paren: #f3d58d;
  --ct-font: "Songti SC", "STSong", "Noto Serif SC", Georgia, serif;
  --ct-topbar-bg: rgba(16, 13, 11, .80);
  --ct-comp-bg: rgba(20, 16, 13, .88);
  --ct-comp-bd: rgba(212, 175, 55, .34);
  --ct-ava-ring: rgba(229, 190, 103, .70);
  --ct-bond-bg: rgba(18, 14, 11, .92);
  --ct-ambient-bg: radial-gradient(circle at 25% 20%, rgba(212, 175, 55, .14), transparent 55%), radial-gradient(circle at 75% 80%, rgba(180, 120, 40, .12), transparent 55%);
  --ct-particle-color: rgba(245, 208, 138, .60);
}

/* 预设 4：松雪宣纸（古风仙侠 / 新中式） */
body.card-theme-active[data-card-theme="ink-snow"] #main {
  --ct-accent: #d94841;
  --ct-accent-soft: rgba(217, 72, 65, .15);
  --ct-accent-bd: rgba(217, 72, 65, .36);
  --ct-accent-glow: rgba(217, 72, 65, .20);
  --ct-card-bg: rgba(20, 26, 28, .88);
  --ct-card-bd: rgba(196, 212, 208, .28);
  --ct-card-fg: #f2f5f2;
  --ct-card-muted: rgba(214, 224, 220, .66);
  --ct-bub-ai-bg: rgba(24, 31, 34, .88);
  --ct-bub-ai-bd: rgba(186, 206, 202, .24);
  --ct-bub-ai-fg: #f0f4f2;
  --ct-bub-me-bg: linear-gradient(135deg, rgba(164, 52, 48, .88), rgba(128, 38, 42, .88));
  --ct-bub-me-bd: rgba(235, 142, 136, .38);
  --ct-bub-me-fg: #fff7f6;
  --ct-paren: #cbd8d4;
  --ct-font: "Songti SC", "STSong", "Noto Serif SC", "Kaiti SC", serif;
  --ct-topbar-bg: rgba(18, 24, 26, .80);
  --ct-comp-bg: rgba(20, 26, 28, .88);
  --ct-comp-bd: rgba(186, 206, 202, .26);
  --ct-ava-ring: rgba(217, 72, 65, .64);
  --ct-bond-bg: rgba(18, 24, 26, .92);
  --ct-badge-radius: 10px;
  --ct-ambient-bg: radial-gradient(circle at 20% 15%, rgba(200, 224, 220, .10), transparent 55%), radial-gradient(circle at 80% 80%, rgba(217, 72, 65, .09), transparent 55%);
  --ct-particle-color: rgba(240, 248, 246, .68);
}

/* 预设 5：初樱奶油（浅色柔雾甜宠） */
body.card-theme-active[data-card-theme="sakura-cream"] #main {
  --ct-accent: #ec4899;
  --ct-accent-soft: rgba(236, 72, 153, .13);
  --ct-accent-bd: rgba(244, 114, 182, .40);
  --ct-accent-glow: rgba(244, 114, 182, .22);
  --ct-card-bg: rgba(255, 248, 251, .92);
  --ct-card-bd: rgba(244, 114, 182, .34);
  --ct-card-fg: #3b1c2a;
  --ct-card-muted: rgba(102, 54, 76, .68);
  --ct-bub-ai-bg: rgba(255, 250, 252, .94);
  --ct-bub-ai-bd: rgba(244, 162, 196, .52);
  --ct-bub-ai-fg: #3a1d2b;
  --ct-bub-me-bg: linear-gradient(135deg, #f472b6, #ec4899);
  --ct-bub-me-bd: rgba(244, 114, 182, .45);
  --ct-bub-me-fg: #ffffff;
  --ct-paren: #be5a83;
  --ct-font: inherit;
  --ct-topbar-bg: rgba(255, 246, 250, .86);
  --ct-comp-bg: rgba(255, 248, 251, .92);
  --ct-comp-bd: rgba(244, 162, 196, .48);
  --ct-ava-ring: rgba(244, 114, 182, .70);
  --ct-bond-bg: rgba(255, 248, 251, .94);
  --ct-ambient-bg: radial-gradient(circle at 25% 20%, rgba(251, 207, 232, .35), transparent 55%), radial-gradient(circle at 80% 75%, rgba(249, 168, 212, .25), transparent 55%);
  --ct-particle-color: rgba(244, 114, 182, .52);
}

/* 预设 6：海盐盛夏 */
body.card-theme-active[data-card-theme="summer-soda"] #main {
  --ct-accent: #38bdf8;
  --ct-accent-soft: rgba(56, 189, 248, .15);
  --ct-accent-bd: rgba(56, 189, 248, .40);
  --ct-accent-glow: rgba(56, 189, 248, .24);
  --ct-card-bg: rgba(12, 26, 40, .84);
  --ct-card-bd: rgba(125, 211, 252, .34);
  --ct-card-fg: #f0f9ff;
  --ct-card-muted: rgba(186, 230, 253, .68);
  --ct-bub-ai-bg: rgba(14, 32, 48, .84);
  --ct-bub-ai-bd: rgba(125, 211, 252, .28);
  --ct-bub-ai-fg: #f0f9ff;
  --ct-bub-me-bg: linear-gradient(135deg, #0284c7, #0ea5e9);
  --ct-bub-me-bd: rgba(186, 230, 253, .44);
  --ct-bub-me-fg: #ffffff;
  --ct-paren: #7dd3fc;
  --ct-font: inherit;
  --ct-topbar-bg: rgba(10, 24, 38, .78);
  --ct-comp-bg: rgba(12, 28, 42, .86);
  --ct-comp-bd: rgba(125, 211, 252, .30);
  --ct-ava-ring: rgba(56, 189, 248, .68);
  --ct-bond-bg: rgba(12, 26, 40, .90);
  --ct-ambient-bg: radial-gradient(circle at 20% 25%, rgba(56, 189, 248, .16), transparent 55%), radial-gradient(circle at 80% 75%, rgba(34, 211, 238, .14), transparent 55%);
  --ct-particle-color: rgba(186, 230, 253, .60);
}

/* 预设 7：霓虹夜雨 */
body.card-theme-active[data-card-theme="cyber-neon"] #main {
  --ct-accent: #f43f5e;
  --ct-accent-soft: rgba(244, 63, 94, .18);
  --ct-accent-bd: rgba(34, 211, 238, .42);
  --ct-accent-glow: rgba(236, 72, 153, .30);
  --ct-card-bg: rgba(13, 12, 22, .90);
  --ct-card-bd: rgba(236, 72, 153, .42);
  --ct-card-fg: #f8f7ff;
  --ct-card-muted: rgba(216, 206, 244, .66);
  --ct-bub-ai-bg: rgba(20, 18, 34, .88);
  --ct-bub-ai-bd: rgba(34, 211, 238, .32);
  --ct-bub-ai-fg: #f5f5ff;
  --ct-bub-me-bg: linear-gradient(135deg, #ec4899, #8b5cf6);
  --ct-bub-me-bd: rgba(244, 114, 182, .45);
  --ct-bub-me-fg: #ffffff;
  --ct-paren: #67e8f9;
  --ct-font: inherit;
  --ct-topbar-bg: rgba(13, 12, 22, .80);
  --ct-comp-bg: rgba(16, 14, 28, .88);
  --ct-comp-bd: rgba(236, 72, 153, .34);
  --ct-ava-ring: rgba(34, 211, 238, .72);
  --ct-bond-bg: rgba(14, 12, 24, .92);
  --ct-ambient-bg: radial-gradient(circle at 20% 20%, rgba(236, 72, 153, .16), transparent 55%), radial-gradient(circle at 82% 78%, rgba(34, 211, 238, .15), transparent 55%);
  --ct-particle-color: rgba(103, 232, 249, .58);
}

/* 预设 8：复古胶片 */
body.card-theme-active[data-card-theme="warm-film"] #main {
  --ct-accent: #f59e0b;
  --ct-accent-soft: rgba(245, 158, 11, .16);
  --ct-accent-bd: rgba(245, 158, 11, .38);
  --ct-accent-glow: rgba(217, 119, 6, .24);
  --ct-card-bg: rgba(24, 18, 14, .90);
  --ct-card-bd: rgba(245, 158, 11, .34);
  --ct-card-fg: #faf3e8;
  --ct-card-muted: rgba(236, 216, 190, .66);
  --ct-bub-ai-bg: rgba(32, 24, 18, .88);
  --ct-bub-ai-bd: rgba(245, 158, 11, .26);
  --ct-bub-ai-fg: #faf3e8;
  --ct-bub-me-bg: linear-gradient(135deg, #b45309, #d97706);
  --ct-bub-me-bd: rgba(251, 191, 36, .42);
  --ct-bub-me-fg: #fffaf0;
  --ct-paren: #fcd34d;
  --ct-font: "Songti SC", "STSong", "Noto Serif SC", Georgia, serif;
  --ct-topbar-bg: rgba(24, 18, 14, .80);
  --ct-comp-bg: rgba(28, 21, 16, .88);
  --ct-comp-bd: rgba(245, 158, 11, .30);
  --ct-ava-ring: rgba(245, 158, 11, .68);
  --ct-bond-bg: rgba(24, 18, 14, .92);
  --ct-ambient-bg: radial-gradient(circle at 22% 20%, rgba(245, 158, 11, .14), transparent 55%), radial-gradient(circle at 78% 82%, rgba(180, 83, 9, .14), transparent 55%);
  --ct-particle-color: rgba(253, 211, 77, .55);
}

/* ---------- 2. 聊天界面全链路联动（气泡 / 括号 / 头像光环 / 输入框） ---------- */
body.card-theme-active #main .row.ai .bubble:not(.photo-bubble):not(.rp-card-bubble) {
  background: var(--ct-bub-ai-bg) !important;
  border: 1px solid var(--ct-bub-ai-bd) !important;
  color: var(--ct-bub-ai-fg) !important;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .14) !important;
}
body.card-theme-active #main .row.me .bubble:not(.photo-bubble):not(.rp-card-bubble) {
  background: var(--ct-bub-me-bg) !important;
  border: 1px solid var(--ct-bub-me-bd) !important;
  color: var(--ct-bub-me-fg) !important;
}
body.card-theme-active #main .row .av,
body.card-theme-active #main .row .avatar {
  box-shadow: 0 0 0 2px var(--ct-ava-ring), 0 0 12px var(--ct-accent-glow) !important;
}
body.card-theme-active #main .bubble .act,
body.card-theme-active #main .bubble .rich-act,
body.card-theme-active #main .bubble .ct-paren {
  color: var(--ct-paren) !important;
  font-style: italic;
}
/* 底部输入框跟随聊天气泡的微透明磨砂质感，避免浅色主题下出现突兀黑底及占位字看不清 */
body.card-theme-active:not(.vn-stage-active) #main .composer {
  background: linear-gradient(155deg, rgba(255, 255, 255, .72) 0%, rgba(252, 250, 255, .60) 55%, rgba(255, 255, 255, .68) 100%) !important;
  border: 1px solid rgba(255, 255, 255, .80) !important;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .07), inset 0 1px 0 rgba(255, 255, 255, .88) !important;
  backdrop-filter: blur(16px) saturate(145%) !important;
  -webkit-backdrop-filter: blur(16px) saturate(145%) !important;
}
body.card-theme-active:not(.vn-stage-active) #main .composer:focus-within {
  border-color: var(--ct-accent-bd, rgba(225, 29, 72, .38)) !important;
}
body.card-theme-active:not(.vn-stage-active) #main .composer textarea {
  color: #1d2230 !important;
  caret-color: var(--ct-accent, #e11d48);
}
body.card-theme-active:not(.vn-stage-active) #main .composer textarea::placeholder {
  color: rgba(29, 34, 48, .50) !important;
}
body.card-theme-active:not(.vn-stage-active) #main .composer .icon-btn,
body.card-theme-active:not(.vn-stage-active) #main .composer .voice-btn,
body.card-theme-active:not(.vn-stage-active) #main .composer .plus-btn,
body.card-theme-active:not(.vn-stage-active) #main .composer .composer-tool-btn {
  color: rgba(29, 34, 48, .72) !important;
}
:root[data-theme='dark'] body.card-theme-active:not(.vn-stage-active) #main .composer {
  background: linear-gradient(155deg, rgba(30, 36, 52, .72) 0%, rgba(22, 27, 40, .62) 55%, rgba(28, 34, 50, .68) 100%) !important;
  border-color: rgba(255, 255, 255, .18) !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .24), inset 0 1px 0 rgba(255, 255, 255, .16) !important;
}
:root[data-theme='dark'] body.card-theme-active:not(.vn-stage-active) #main .composer textarea {
  color: #eef2fc !important;
}
:root[data-theme='dark'] body.card-theme-active:not(.vn-stage-active) #main .composer textarea::placeholder {
  color: rgba(238, 242, 252, .56) !important;
}
:root[data-theme='dark'] body.card-theme-active:not(.vn-stage-active) #main .composer .icon-btn,
:root[data-theme='dark'] body.card-theme-active:not(.vn-stage-active) #main .composer .voice-btn,
:root[data-theme='dark'] body.card-theme-active:not(.vn-stage-active) #main .composer .plus-btn,
:root[data-theme='dark'] body.card-theme-active:not(.vn-stage-active) #main .composer .composer-tool-btn {
  color: rgba(238, 242, 252, .82) !important;
}
body.card-theme-active #main #sendBtn {
  background: var(--ct-accent) !important;
  color: #ffffff !important;
}

/* ---------- 3. 轻量背景氛围层（纯 CSS 合成，零主线程卡顿） ---------- */
.ct-ambient-layer {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
  background: var(--ct-ambient-bg);
}
.ct-ambient-dot {
  position: absolute;
  border-radius: 50%;
  background: var(--ct-particle-color);
  opacity: 0;
  animation: ctFloat var(--ct-dur, 11s) linear infinite;
  animation-delay: var(--ct-delay, 0s);
  will-change: transform, opacity;
}
@keyframes ctFloat {
  0%   { transform: translate3d(0, -10%, 0) scale(.7); opacity: 0; }
  18%  { opacity: .75; }
  82%  { opacity: .65; }
  100% { transform: translate3d(var(--ct-dx, 18px), 108vh, 0) scale(1.05); opacity: 0; }
}

/* ---------- 4. 开场档案美化卡（截图同款高级磨砂卡） ---------- */
.ct-intro-wrap {
  width: 100%;
  max-width: 520px;
  margin: 8px auto 18px;
  padding: 0 4px;
  position: relative;
  z-index: 2;
}
.ct-intro-card {
  position: relative;
  border-radius: 22px;
  padding: 22px 20px 18px;
  background: var(--ct-card-bg);
  border: 1px solid var(--ct-card-bd);
  color: var(--ct-card-fg);
  box-shadow: 0 14px 38px rgba(0, 0, 0, .32), inset 0 0 0 1px rgba(255, 255, 255, .05);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  font-family: var(--ct-font);
  overflow: hidden;
}
.ct-intro-card::before {
  content: "";
  position: absolute;
  top: 0; left: 16%; right: 16%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--ct-accent), transparent);
  opacity: .75;
}
.ct-intro-tools {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  gap: 6px;
}
.ct-intro-tool-btn {
  border: 1px solid var(--ct-card-bd);
  background: var(--ct-accent-soft);
  color: var(--ct-card-fg);
  border-radius: 99px;
  font-size: 11px;
  padding: 3px 10px;
  cursor: pointer;
  opacity: .86;
}
.ct-intro-tool-btn:hover { opacity: 1; }
.ct-intro-head {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 18px;
  padding-right: 54px;
}
.ct-badge {
  width: 60px;
  height: 60px;
  flex-shrink: 0;
  border-radius: var(--ct-badge-radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: 700;
  color: var(--ct-accent);
  background: radial-gradient(circle at center, var(--ct-accent-soft), rgba(0, 0, 0, .22));
  border: 1.5px solid var(--ct-accent-bd);
  box-shadow: 0 0 18px var(--ct-accent-glow);
}
.ct-title-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}
.ct-name {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 1px;
}
.ct-sub {
  font-size: 11px;
  letter-spacing: 2.2px;
  text-transform: uppercase;
  color: var(--ct-card-muted);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.ct-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.ct-tag {
  font-size: 11px;
  padding: 2px 9px;
  border-radius: 6px;
  border: 1px solid var(--ct-card-bd);
  background: var(--ct-accent-soft);
  color: var(--ct-card-fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.ct-quote {
  position: relative;
  margin: 0 0 18px;
  padding: 6px 8px 6px 14px;
  border-left: 2px solid var(--ct-accent);
  font-size: 14px;
  line-height: 1.75;
  font-style: italic;
  color: var(--ct-card-fg);
  opacity: .94;
}
.ct-fields {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 14px 0;
  border-top: 1px solid rgba(255, 255, 255, .08);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  margin-bottom: 16px;
}
.ct-field-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 14px;
  font-size: 13px;
  line-height: 1.5;
}
.ct-field-k {
  color: var(--ct-card-muted);
  flex-shrink: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.ct-field-v {
  text-align: right;
  color: var(--ct-card-fg);
}
.ct-field-row.is-highlight .ct-field-v {
  color: var(--ct-accent);
  font-weight: 700;
}
.ct-bio {
  font-size: 13.5px;
  line-height: 1.85;
  color: var(--ct-card-muted);
  white-space: pre-line;
  margin-bottom: 16px;
}
.ct-footer {
  text-align: center;
  font-size: 11px;
  letter-spacing: 3.2px;
  text-transform: uppercase;
  color: var(--ct-card-muted);
  opacity: .72;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.ct-intro-card.is-collapsed .ct-quote,
.ct-intro-card.is-collapsed .ct-fields,
.ct-intro-card.is-collapsed .ct-bio,
.ct-intro-card.is-collapsed .ct-footer {
  display: none;
}
.ct-intro-card.is-collapsed .ct-intro-head {
  margin-bottom: 0;
}

/* ---------- 5. 底部可折叠羁绊条（与聊天气泡同款微透明磨砂质感，自适应浅/深主题） ---------- */
.ct-bond-bar {
  position: relative;
  max-width: 860px;
  margin: 0 auto 8px;
  border-radius: 18px;
  background: linear-gradient(155deg, rgba(255, 255, 255, .72) 0%, rgba(252, 250, 255, .60) 55%, rgba(255, 255, 255, .68) 100%);
  border: 1px solid rgba(255, 255, 255, .80);
  color: #1d2230;
  text-shadow: 0 1px 6px rgba(255, 255, 255, .36);
  padding: 10px 14px 10px;
  backdrop-filter: blur(16px) saturate(145%);
  -webkit-backdrop-filter: blur(16px) saturate(145%);
  box-shadow: 0 6px 20px rgba(15, 23, 42, .07), inset 0 1px 0 rgba(255, 255, 255, .88);
  transition: padding .18s ease, background .18s ease, border-color .18s ease;
}
:root[data-theme='dark'] .ct-bond-bar {
  background: linear-gradient(155deg, rgba(30, 36, 52, .72) 0%, rgba(22, 27, 40, .62) 55%, rgba(28, 34, 50, .68) 100%);
  border-color: rgba(255, 255, 255, .18);
  color: #eef2fc;
  text-shadow: 0 1px 4px rgba(0, 0, 0, .28);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .24), inset 0 1px 0 rgba(255, 255, 255, .16);
}
.ct-bond-toggle {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  width: 26px;
  height: 22px;
  border-radius: 99px;
  border: 1px solid rgba(255, 255, 255, .86);
  background: rgba(255, 255, 255, .78);
  color: #363d4f;
  backdrop-filter: blur(16px) saturate(145%);
  -webkit-backdrop-filter: blur(16px) saturate(145%);
  box-shadow: 0 2px 8px rgba(15, 23, 42, .08), inset 0 1px 0 rgba(255, 255, 255, .90);
  font-size: 11px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
:root[data-theme='dark'] .ct-bond-toggle {
  border-color: rgba(255, 255, 255, .20);
  background: rgba(34, 40, 58, .80);
  color: #eef2fc;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .26), inset 0 1px 0 rgba(255, 255, 255, .18);
}
.ct-bond-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
}
.ct-bond-stage {
  color: var(--ct-bond-accent, var(--ct-accent));
  font-weight: 800;
}
/* 浅色磨砂底上对偏浅的点缀色自动加深一档，保证可读性 */
:root:not([data-theme='dark']) body.card-theme-active[data-card-theme="moonlight-glass"] #main { --ct-bond-accent: #2563eb; }
:root:not([data-theme='dark']) body.card-theme-active[data-card-theme="gilded-velvet"] #main { --ct-bond-accent: #b47b14; }
:root:not([data-theme='dark']) body.card-theme-active[data-card-theme="summer-soda"] #main { --ct-bond-accent: #0284c7; }
:root:not([data-theme='dark']) body.card-theme-active[data-card-theme="warm-film"] #main { --ct-bond-accent: #b45309; }
.ct-bond-body {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ct-bond-bar.is-collapsed {
  padding: 7px 14px;
}
.ct-bond-bar.is-collapsed .ct-bond-body {
  display: none;
}
.ct-bond-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
}
.ct-bond-track {
  flex: 1;
  height: 5px;
  border-radius: 99px;
  background: rgba(28, 34, 52, .14);
  overflow: hidden;
}
:root[data-theme='dark'] .ct-bond-track {
  background: rgba(255, 255, 255, .16);
}
.ct-bond-fill {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--ct-bond-accent, var(--ct-accent)), var(--ct-paren));
  transition: width .3s ease;
}

/* ---------- 6. 单角色专属美化配置弹窗 ---------- */
.ct-modal-mask {
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  z-index: 1200;
  background: rgba(8, 10, 18, .62);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
@media (min-width: 720px) {
  .ct-modal-mask { align-items: center; }
}
.ct-modal {
  width: 100%;
  max-width: 520px;
  max-height: 88vh;
  background: var(--bg, #14151c);
  color: var(--fg, #f4f5f8);
  border-radius: 24px 24px 0 0;
  border: 1px solid var(--line, rgba(255, 255, 255, .12));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 56px rgba(0, 0, 0, .45);
}
@media (min-width: 720px) {
  .ct-modal { border-radius: 24px; }
}
.ct-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px 12px;
  border-bottom: 1px solid var(--line, rgba(255, 255, 255, .1));
}
.ct-modal-head h3 { margin: 0; font-size: 16px; font-weight: 800; }
.ct-modal-close {
  border: 0;
  background: rgba(128, 128, 140, .16);
  color: inherit;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 16px;
  cursor: pointer;
}
.ct-modal-body {
  padding: 14px 16px 18px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.ct-tabs {
  display: flex;
  gap: 8px;
  padding: 10px 16px 0;
}
.ct-tab-btn {
  flex: 1;
  height: 36px;
  border-radius: 12px;
  border: 1px solid var(--line, rgba(255, 255, 255, .12));
  background: rgba(128, 128, 140, .08);
  color: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.ct-tab-btn.is-on {
  background: linear-gradient(135deg, rgba(139, 92, 246, .28), rgba(236, 72, 153, .24));
  border-color: rgba(196, 181, 253, .55);
}
.ct-upload-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.ct-upload-btn {
  flex: 1;
  height: 38px;
  border-radius: 12px;
  border: 1px dashed rgba(167, 139, 250, .55);
  background: rgba(139, 92, 246, .10);
  color: inherit;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}
.ct-custom-frame-wrap {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--ct-card-bd);
  background: rgba(12, 11, 18, .65);
  box-shadow: 0 14px 36px rgba(0, 0, 0, .32);
}
.ct-custom-frame {
  width: 100%;
  border: 0;
  display: block;
  background: transparent;
}
.ct-custom-tip {
  font-size: 11.5px;
  line-height: 1.55;
  opacity: .72;
}
.ct-preset-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.ct-preset-btn {
  position: relative;
  text-align: left;
  padding: 12px 12px 11px;
  border-radius: 16px;
  border: 1.5px solid var(--line, rgba(255, 255, 255, .12));
  background: rgba(128, 128, 140, .08);
  color: inherit;
  cursor: pointer;
  transition: transform .12s ease, border-color .15s ease;
}
.ct-preset-btn:active { transform: scale(.97); }
.ct-preset-btn.is-on {
  border-color: var(--p-accent, #e11d48);
  box-shadow: 0 0 0 1px var(--p-accent, #e11d48), 0 8px 20px rgba(0, 0, 0, .18);
}
.ct-preset-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
}
.ct-preset-swatch {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 1.5px solid rgba(255, 255, 255, .4);
}
.ct-preset-name { font-size: 13.5px; font-weight: 800; }
.ct-preset-rec {
  margin-left: auto;
  font-size: 10px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 99px;
  background: rgba(225, 29, 72, .18);
  color: #fb7185;
}
.ct-preset-desc { font-size: 11px; opacity: .68; line-height: 1.35; }
.ct-toggle-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ct-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(128, 128, 140, .08);
  border: 1px solid var(--line, rgba(255, 255, 255, .08));
  font-size: 13px;
  cursor: pointer;
}
.ct-toggle-row input { width: 18px; height: 18px; accent-color: #8b5cf6; }
.ct-tweak-box {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border-radius: 16px;
  background: rgba(128, 128, 140, .06);
  border: 1px solid var(--line, rgba(255, 255, 255, .08));
}
.ct-tweak-box label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  opacity: .85;
}
.ct-tweak-box input,
.ct-tweak-box textarea {
  width: 100%;
  box-sizing: border-box;
  border-radius: 10px;
  border: 1px solid var(--line, rgba(255, 255, 255, .14));
  background: rgba(128, 128, 140, .08);
  color: inherit;
  padding: 8px 10px;
  font: inherit;
  font-size: 13px;
}
.ct-modal-foot {
  display: flex;
  gap: 10px;
  padding: 12px 16px 16px;
  border-top: 1px solid var(--line, rgba(255, 255, 255, .1));
}
.ct-btn-ghost {
  flex: 1;
  height: 42px;
  border-radius: 12px;
  border: 1px solid var(--line, rgba(255, 255, 255, .16));
  background: transparent;
  color: inherit;
  font-weight: 700;
  cursor: pointer;
}
.ct-btn-primary {
  flex: 2;
  height: 42px;
  border-radius: 12px;
  border: 0;
  background: linear-gradient(135deg, #8b5cf6, #ec4899);
  color: #fff;
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
}

/* ---------- 7. 创建角色 / 角色设定内嵌美化直选卡片 ---------- */
.ct-inline-card {
  padding: 12px;
  border-radius: 16px;
  border: 1px solid rgba(20, 26, 40, .09);
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(20, 26, 40, .03);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
:root[data-theme='dark'] .ct-inline-card {
  background: #1b1e27;
  border-color: rgba(255, 255, 255, .10);
  box-shadow: none;
}
.ct-inline-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.ct-inline-hint {
  font-size: 11.4px;
  color: var(--fg-3, #888f9d);
  line-height: 1.4;
}
.ct-inline-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 620;
  color: var(--fg-2, #6b7280);
  background: rgba(128, 128, 140, .10);
  white-space: nowrap;
}
.ct-inline-status.is-active {
  color: var(--fg, #1a1d24);
  background: rgba(20, 26, 40, .07);
}
:root[data-theme='dark'] .ct-inline-status.is-active {
  color: #f2f4f8;
  background: rgba(255, 255, 255, .12);
}
.ct-inline-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: none;
}
.ct-inline-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}
.ct-inline-chip {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  height: 36px;
  padding: 0 8px;
  border-radius: 11px;
  border: 1px solid rgba(20, 26, 40, .09);
  background: #f6f7fa;
  color: var(--fg, #1a1d24);
  font: inherit;
  font-size: 12px;
  font-weight: 560;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, transform .1s ease, box-shadow .15s ease;
}
:root[data-theme='dark'] .ct-inline-chip {
  background: rgba(255, 255, 255, .05);
  border-color: rgba(255, 255, 255, .09);
  color: #e9ecf4;
}
.ct-inline-chip:active { transform: scale(.97); }
.ct-inline-chip.is-on {
  background: #ffffff;
  border-color: var(--p-accent, #1a1d24);
  box-shadow: 0 0 0 1px var(--p-accent, #1a1d24);
  font-weight: 680;
}
:root[data-theme='dark'] .ct-inline-chip.is-on {
  background: rgba(255, 255, 255, .11);
  border-color: var(--p-accent, #f2f4f8);
  box-shadow: 0 0 0 1px var(--p-accent, #f2f4f8);
}
.ct-inline-sw {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex: none;
  border: 1px solid rgba(255, 255, 255, .45);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .14);
}
.ct-inline-sw.is-off {
  background: linear-gradient(135deg, #e5e7eb 46%, #9ca3af 48%, #9ca3af 52%, #f3f4f6 54%);
  border-color: rgba(0, 0, 0, .12);
}
.ct-inline-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ct-inline-rec {
  position: absolute;
  top: -6px;
  right: 4px;
  font-style: normal;
  font-size: 9px;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 5px;
  background: #e11d48;
  color: #ffffff;
  line-height: 1.25;
  box-shadow: 0 1px 4px rgba(225, 29, 72, .30);
}
:root[data-theme='dark'] .ct-inline-rec {
  background: #fb7185;
  color: #181014;
}
.ct-custom-tools {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  padding: 8px 10px 4px;
}
.ct-inline-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.ct-inline-act {
  height: 36px;
  padding: 0 8px;
  border-radius: 11px;
  border: 1px solid rgba(20, 26, 40, .10);
  background: #f6f7fa;
  color: var(--fg, #1a1d24);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}
:root[data-theme='dark'] .ct-inline-act {
  background: rgba(255, 255, 255, .06);
  border-color: rgba(255, 255, 255, .11);
  color: #eef1f7;
}
.ct-inline-act.has-code {
  border-color: rgba(225, 29, 72, .45);
  background: rgba(225, 29, 72, .08);
  color: #be123c;
}
:root[data-theme='dark'] .ct-inline-act.has-code {
  border-color: rgba(251, 113, 133, .45);
  background: rgba(251, 113, 133, .14);
  color: #fda4af;
}


/* === modules/skin-glass.css === */
/* ==========================================================================
   月见 MOON · 液态玻璃主题 (Liquid Glass · skin-glass.css)
   在保留瓷白极简几何布局的基础上，为全局注入透明磨砂液态玻璃与高光玻璃边。
   仅在 body.skin-glass 激活时生效，切回「瓷白极简」零残留。
   ========================================================================== */

body.skin-glass {
  --lg-surface: linear-gradient(155deg, rgba(255, 255, 255, .84) 0%, rgba(247, 250, 255, .74) 55%, rgba(255, 255, 255, .80) 100%);
  --lg-surface-strong: linear-gradient(155deg, rgba(255, 255, 255, .94) 0%, rgba(246, 249, 255, .88) 100%);
  --lg-surface-pill: linear-gradient(155deg, rgba(255, 255, 255, .90) 0%, rgba(246, 249, 255, .80) 100%);
  --lg-border: rgba(255, 255, 255, .78);
  --lg-border-soft: rgba(20, 28, 48, .08);
  --lg-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .92),
    inset 0 -1px 0 rgba(255, 255, 255, .36),
    0 10px 28px rgba(15, 23, 42, .08);
  --lg-shadow-sm:
    inset 0 1px 0 rgba(255, 255, 255, .86),
    0 4px 14px rgba(15, 23, 42, .06);
  --lg-ink: #121622;
  --lg-sub: rgba(20, 24, 36, .66);
  --lg-blur: none;
  --lg-veil: rgba(242, 246, 252, .16);
}

:root[data-theme='dark'] body.skin-glass {
  --lg-surface: linear-gradient(155deg, rgba(30, 36, 52, .88) 0%, rgba(20, 24, 36, .82) 55%, rgba(28, 34, 48, .86) 100%);
  --lg-surface-strong: linear-gradient(155deg, rgba(34, 40, 58, .95) 0%, rgba(22, 26, 40, .92) 100%);
  --lg-surface-pill: linear-gradient(155deg, rgba(36, 42, 60, .90) 0%, rgba(22, 26, 40, .84) 100%);
  --lg-border: rgba(255, 255, 255, .18);
  --lg-border-soft: rgba(255, 255, 255, .10);
  --lg-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .24),
    inset 0 -1px 0 rgba(255, 255, 255, .06),
    0 12px 32px rgba(0, 0, 0, .28);
  --lg-shadow-sm:
    inset 0 1px 0 rgba(255, 255, 255, .20),
    0 6px 16px rgba(0, 0, 0, .22);
  --lg-ink: #f4f7fc;
  --lg-sub: rgba(236, 242, 255, .74);
  --lg-veil: rgba(10, 14, 24, .34);
}

/* ---------- 1. 全局满屏液态光影背景（广场 / 聊天列表 / 剧场 / 我的 / 聊天页全贯通） ---------- */
body.skin-glass::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(var(--lg-veil), var(--lg-veil)),
    var(--glass-bg, url('/media/chatbg/presets/silver-snow.jpg'));
  background-size: cover, cover;
  background-position: center, center;
  background-repeat: no-repeat, no-repeat;
}

body.skin-glass,
body.skin-glass .app,
body.skin-glass .main,
body.skin-glass .h5-page,
body.skin-glass .messages,
body.skin-glass #messages,
body.skin-glass .h5-chat-hero {
  background: transparent !important;
  color: var(--lg-ink);
}
body.skin-glass:not(.h5-active) .app,
body.skin-glass .h5-nav {
  position: relative;
  z-index: 1;
}
body.skin-glass.h5-active .app {
  position: fixed;
  z-index: 1;
}
body.skin-glass .h5-nav {
  z-index: 25;
}
body.skin-glass .h5-shade {
  z-index: 35;
}

/* 聊天页若角色单独设置了壁纸，仍以角色壁纸优先铺满；未设置时自然透出液态玻璃全局背景 */
body.skin-glass.h5-active[data-h5-page='chat'].has-chat-bg .app {
  background-image:
    linear-gradient(rgba(255, 255, 255, var(--chatbg-dim, .14)),
                    rgba(255, 255, 255, var(--chatbg-dim, .14))),
    var(--chatbg) !important;
}
:root[data-theme='dark'] body.skin-glass.h5-active[data-h5-page='chat'].has-chat-bg .app {
  background-image:
    linear-gradient(rgba(10, 14, 24, var(--chatbg-dim, .34)),
                    rgba(10, 14, 24, var(--chatbg-dim, .34))),
    var(--chatbg) !important;
}

/* ---------- 2. 液态玻璃容器（高质感半透高光渐变，禁用滚动卡片 backdrop-filter 杜绝安卓 WebView GPU 分块丢失/花屏） ---------- */
body.skin-glass .h5-list,
body.skin-glass .h5-wx-list,
body.skin-glass .h5-wx-new-group,
body.skin-glass .h5-empty,
body.skin-glass .h5-profile,
body.skin-glass .h5-account-card,
body.skin-glass .h5-hero-card,
body.skin-glass .h5-card,
body.skin-glass .h5-create-grid .h5-tile,
body.skin-glass .h5-post-card,
body.skin-glass .h5-story-card,
body.skin-glass .side {
  background: var(--lg-surface) !important;
  border: 1px solid var(--lg-border) !important;
  box-shadow: var(--lg-shadow) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border-radius: 24px !important;
}

body.skin-glass .h5-chat-seg {
  background: var(--lg-surface) !important;
  border: 1px solid var(--lg-border) !important;
  box-shadow: var(--lg-shadow-sm) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border-radius: 20px !important;
}
body.skin-glass .h5-chat-seg-btn {
  color: var(--lg-sub) !important;
  border-radius: 15px !important;
}
body.skin-glass .h5-chat-seg-btn.active {
  background: rgba(255, 255, 255, .44) !important;
  color: var(--lg-ink) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .82), 0 4px 12px rgba(15, 23, 42, .08) !important;
}
:root[data-theme='dark'] body.skin-glass .h5-chat-seg-btn.active {
  background: rgba(255, 255, 255, .16) !important;
  color: var(--lg-ink) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .26), 0 4px 12px rgba(0, 0, 0, .24) !important;
}
body.skin-glass .h5-wx-item {
  background: transparent !important;
  color: var(--lg-ink) !important;
}
body.skin-glass .h5-wx-item:active {
  background: rgba(255, 255, 255, .20) !important;
}
:root[data-theme='dark'] body.skin-glass .h5-wx-item:active {
  background: rgba(255, 255, 255, .08) !important;
}
body.skin-glass .h5-wx-item + .h5-wx-item::before {
  background: var(--lg-border-soft) !important;
}
body.skin-glass .h5-wx-name {
  color: var(--lg-ink) !important;
  text-shadow: 0 1px 10px rgba(255, 255, 255, .36);
}
:root[data-theme='dark'] body.skin-glass .h5-wx-name {
  text-shadow: 0 1px 8px rgba(0, 0, 0, .42);
}
body.skin-glass .h5-wx-msg,
body.skin-glass .h5-wx-time {
  color: var(--lg-sub) !important;
}
body.skin-glass .h5-wx-ava {
  background: rgba(255, 255, 255, .40) !important;
  border: 1px solid var(--lg-border-soft) !important;
  color: var(--lg-ink) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .65);
}
:root[data-theme='dark'] body.skin-glass .h5-wx-ava {
  background: rgba(255, 255, 255, .12) !important;
  color: var(--lg-ink) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18);
}
body.skin-glass .h5-wx-new-group {
  border-style: dashed !important;
  color: var(--lg-ink) !important;
  border-radius: 18px !important;
}

body.skin-glass .h5-list-row {
  background: transparent !important;
  position: relative;
  z-index: 1;
}
body.skin-glass .h5-list-row + .h5-list-row {
  border-top: 1px solid var(--lg-border-soft) !important;
}
/* 「我的工具」属于超长滚动列表，在安卓 WebView 下叠加 backdrop-filter 会触发 512px GPU 分块遮挡文字；改用高质感半透明磨砂底避免花屏并提升滚动流畅度 */
body.skin-glass .h5-list.h5-settings {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  background: rgba(255, 255, 255, .74) !important;
  isolation: isolate;
  overflow: hidden;
}
:root[data-theme='dark'] body.skin-glass .h5-list.h5-settings {
  background: rgba(24, 28, 40, .76) !important;
}
/* ---------- 0. 全面屏透明状态栏安全区 + 广场顶部栏三段均衡排版（全主题通用） ---------- */
body.h5-active .app {
  padding-top: 0 !important;
}
body.h5-active .h5-page {
  padding-top: calc(6px + max(env(safe-area-inset-top, 0px), var(--safe-top, 0px))) !important;
}
body.h5-active[data-h5-page='chat'] .h5-chat-intro {
  padding-top: calc(6px + max(env(safe-area-inset-top, 0px), var(--safe-top, 0px))) !important;
}
body.h5-active[data-h5-page='draw'] #drawView {
  padding-top: calc(8px + max(env(safe-area-inset-top, 0px), var(--safe-top, 0px))) !important;
}
body.h5-active .h5-sq-header {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 8px !important;
  margin-bottom: 8px !important;
  min-height: 40px;
}
body.h5-active .h5-sq-brand {
  flex-shrink: 0;
  gap: 5px !important;
}
body.h5-active .h5-sq-brand h1 {
  font-size: 17px !important;
  letter-spacing: .02em;
}
body.h5-active .h5-sq-seg {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  flex: 1;
  min-width: 0;
}
body.h5-active .h5-sq-seg-btn {
  position: relative;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 6px 10px !important;
  min-height: 34px !important;
  font-size: 14.5px !important;
  font-weight: 500;
  color: var(--h5-sub, #6b7280) !important;
  border-radius: 999px;
  white-space: nowrap;
  transition: color .16s ease, transform .14s ease;
}
body.h5-active .h5-sq-seg-btn.active {
  font-size: 15.5px !important;
  font-weight: 750 !important;
  color: var(--h5-text, #141822) !important;
}
body.h5-active .h5-sq-seg-btn.active::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 1px;
  transform: translateX(-50%);
  width: 18px;
  height: 3px;
  border-radius: 999px;
  background: currentColor;
  opacity: .88;
}
body.skin-glass .h5-sq-seg-btn {
  color: var(--lg-sub) !important;
}
body.skin-glass .h5-sq-seg-btn.active {
  color: var(--lg-ink) !important;
  background: rgba(255, 255, 255, .36) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .75) !important;
}
:root[data-theme='dark'] body.skin-glass .h5-sq-seg-btn.active {
  background: rgba(255, 255, 255, .14) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .24) !important;
}
body.skin-glass .h5-sq-seg-btn.active::after {
  display: none;
}
body.h5-active .h5-cat-search-wrap {
  margin-bottom: 6px !important;
}
body.h5-active .h5-tag-rail {
  margin-bottom: 10px !important;
}

body.skin-glass .h5-list-row strong,
body.skin-glass .h5-section-head,
body.skin-glass .h5-chat-intro-name,
body.skin-glass .h5-title {
  color: var(--lg-ink) !important;
  text-shadow: 0 1px 10px rgba(255, 255, 255, .38);
}
:root[data-theme='dark'] body.skin-glass .h5-list-row strong,
:root[data-theme='dark'] body.skin-glass .h5-section-head,
:root[data-theme='dark'] body.skin-glass .h5-chat-intro-name,
:root[data-theme='dark'] body.skin-glass .h5-title {
  text-shadow: 0 1px 8px rgba(0, 0, 0, .42);
}

/* 广场卡片封面上的角色名/简介叠在暗色封面上，必须保持白色高对比度 */
body.skin-glass .h5-post-body strong {
  color: #ffffff !important;
  text-shadow: 0 1px 8px rgba(0, 0, 0, .72) !important;
}
body.skin-glass .h5-post-body small,
body.skin-glass .h5-post-author,
body.skin-glass .h5-post-stats {
  color: rgba(255, 255, 255, .88) !important;
  text-shadow: 0 1px 6px rgba(0, 0, 0, .65) !important;
}

body.skin-glass .h5-list-row small,
body.skin-glass .h5-chat-intro-sub,
body.skin-glass .h5-chat-sub,
body.skin-glass .h5-drawer-lead,
body.skin-glass .h5-bg-tip {
  color: var(--lg-sub) !important;
}
:root[data-theme='dark'] body.skin-glass .h5-chat-sub,
:root[data-theme='dark'] body.skin-glass .h5-chat-intro-sub {
  color: rgba(236, 242, 255, .82) !important;
  text-shadow: 0 1px 6px rgba(0, 0, 0, .48);
}
body.skin-glass .chat-time-divider span {
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .78);
  border: 1px solid rgba(255, 255, 255, .82);
  color: #202634 !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
:root[data-theme='dark'] body.skin-glass .chat-time-divider span {
  background: rgba(22, 26, 40, .82);
  border-color: rgba(255, 255, 255, .16);
  color: rgba(240, 245, 255, .90) !important;
  text-shadow: 0 1px 4px rgba(0, 0, 0, .45);
}

/* 图标圆徽章与筛选胶囊：禁用 backdrop-filter，杜绝列表/抽屉内 10+ 独立 GPU RenderPass 导致相邻行文字被吞 */
body.skin-glass .h5-sticker,
body.skin-glass .h5-icon-button,
body.skin-glass .h5-sq-gear,
body.skin-glass .h5-square-searchbar .h5-search,
body.skin-glass .h5-chip {
  background: var(--lg-surface-pill) !important;
  border: 1px solid var(--lg-border) !important;
  box-shadow: var(--lg-shadow-sm) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  color: var(--lg-ink) !important;
}
body.skin-glass .h5-chip.selected {
  background: var(--lg-surface-strong) !important;
  border-color: rgba(255, 255, 255, .86) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .95),
    0 6px 18px rgba(15, 23, 42, .14) !important;
  font-weight: 700 !important;
}
:root[data-theme='dark'] body.skin-glass .h5-chip.selected {
  border-color: rgba(255, 255, 255, .42) !important;
}

/* ---------- 3. 悬浮液态玻璃底部胶囊导航栏（高透高光胶囊，移动端禁用 heavy backdrop-filter 防花屏） ---------- */
body.skin-glass .h5-nav {
  background: var(--lg-surface-strong) !important;
  border: 1px solid var(--lg-border) !important;
  box-shadow: var(--lg-shadow) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border-radius: 999px !important;
}
body.skin-glass .h5-nav-item {
  color: var(--lg-sub) !important;
  border-radius: 999px;
  transition: background .18s ease, color .18s ease;
}
body.skin-glass .h5-nav-item[aria-current] {
  color: var(--lg-ink) !important;
  background: rgba(255, 255, 255, .56) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .85);
}
:root[data-theme='dark'] body.skin-glass .h5-nav-item[aria-current] {
  background: rgba(255, 255, 255, .16) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .24);
}
body.skin-glass .h5-nav-item.h5-nav-fab {
  background: var(--lg-surface-strong) !important;
  border: 1px solid var(--lg-border) !important;
  color: var(--lg-ink) !important;
  box-shadow: var(--lg-shadow) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

/* ---------- 4. 聊天页：通透融入背景顶栏 / 悬浮霜面气泡 / 透明输入胶囊 ---------- */
body.skin-glass .h5-chat-intro,
body.skin-glass .topbar {
  background: linear-gradient(180deg, rgba(248, 250, 255, .88) 0%, rgba(248, 250, 255, .64) 76%, rgba(248, 250, 255, 0) 100%) !important;
  border-bottom: 0 !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
:root[data-theme='dark'] body.skin-glass .h5-chat-intro,
:root[data-theme='dark'] body.skin-glass .topbar {
  background: linear-gradient(180deg, rgba(14, 18, 28, .86) 0%, rgba(14, 18, 28, .56) 76%, rgba(14, 18, 28, 0) 100%) !important;
}

body.skin-glass .composer-wrap {
  background: transparent !important;
  border-top: 0 !important;
}
body.skin-glass .composer {
  background: var(--lg-surface-strong) !important;
  border: 1px solid var(--lg-border) !important;
  box-shadow: var(--lg-shadow) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
body.skin-glass .composer textarea {
  color: var(--lg-ink) !important;
}
body.skin-glass .composer textarea::placeholder {
  color: var(--lg-sub) !important;
}
body.skin-glass .composer .voice-hold-btn {
  background: rgba(255, 255, 255, .36) !important;
  border-color: var(--lg-border-soft) !important;
  color: var(--lg-ink) !important;
}
body.skin-glass .composer .voice-hold-btn.is-pressing {
  background: rgba(255, 255, 255, .58) !important;
}
:root[data-theme='dark'] body.skin-glass .composer .voice-hold-btn {
  background: rgba(255, 255, 255, .12) !important;
  color: #f4f7ff !important;
}
:root[data-theme='dark'] body.skin-glass .composer .voice-hold-btn.is-pressing {
  background: rgba(255, 255, 255, .24) !important;
}
body.skin-glass .composer-plus-tray {
  background: var(--lg-surface-strong) !important;
  border: 1px solid var(--lg-border) !important;
  box-shadow: var(--lg-shadow) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

/* 液态玻璃聊天气泡（无 backdrop-filter，丝滑 120fps 且彻底免疫安卓滚动花屏/抽屉穿透） */
body.skin-glass:not([data-bubble-style]) #messages .row.ai .bubble,
body.skin-glass[data-bubble-style=''] #messages .row.ai .bubble {
  background: linear-gradient(155deg, rgba(255, 255, 255, .92) 0%, rgba(246, 250, 255, .86) 100%) !important;
  border: 1px solid rgba(255, 255, 255, .88) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .96),
    0 5px 16px rgba(15, 23, 42, .07) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  color: #161b26 !important;
  border-radius: 20px !important;
}
body.skin-glass:not([data-bubble-style]) #messages .row.me .bubble,
body.skin-glass[data-bubble-style=''] #messages .row.me .bubble {
  background: linear-gradient(155deg, rgba(232, 240, 255, .94) 0%, rgba(218, 230, 252, .88) 100%) !important;
  border: 1px solid rgba(255, 255, 255, .88) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .95),
    0 5px 16px rgba(15, 23, 42, .08) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  color: #141926 !important;
  border-radius: 20px !important;
}
:root[data-theme='dark'] body.skin-glass:not([data-bubble-style]) #messages .row.ai .bubble,
:root[data-theme='dark'] body.skin-glass[data-bubble-style=''] #messages .row.ai .bubble {
  background: linear-gradient(155deg, rgba(36, 44, 64, .88) 0%, rgba(22, 28, 44, .84) 100%) !important;
  border: 1px solid rgba(255, 255, 255, .20) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .22),
    0 6px 18px rgba(0, 0, 0, .24) !important;
  color: #f3f6fc !important;
}
:root[data-theme='dark'] body.skin-glass:not([data-bubble-style]) #messages .row.me .bubble,
:root[data-theme='dark'] body.skin-glass[data-bubble-style=''] #messages .row.me .bubble {
  background: linear-gradient(155deg, rgba(78, 98, 142, .90) 0%, rgba(54, 70, 108, .86) 100%) !important;
  border: 1px solid rgba(255, 255, 255, .24) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .24),
    0 6px 18px rgba(0, 0, 0, .24) !important;
  color: #ffffff !important;
}

/* 底部抽屉：纯实底高质感霜面，禁止任何 backdrop-filter 与 translateZ(0) 强制复合层，彻底根治安卓 WebView 缺行/白块/透字 */
body.skin-glass .h5-drawer {
  background: #f5f7fc !important;
  border-top: 1px solid rgba(255, 255, 255, .9) !important;
  box-shadow: 0 -12px 40px rgba(15, 23, 42, .18) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  isolation: auto;
  transform: none;
}
:root[data-theme='dark'] body.skin-glass .h5-drawer {
  background: #171b26 !important;
  border-top: 1px solid rgba(255, 255, 255, .14) !important;
  box-shadow: 0 -12px 40px rgba(0, 0, 0, .44) !important;
}
body.skin-glass .h5-drawer .h5-mode-list .h5-list-row {
  background: #ffffff !important;
  border: 1px solid rgba(15, 23, 42, .07) !important;
}
:root[data-theme='dark'] body.skin-glass .h5-drawer .h5-mode-list .h5-list-row {
  background: #222736 !important;
  border: 1px solid rgba(255, 255, 255, .10) !important;
}
body.skin-glass .h5-drawer .h5-sticker {
  background: #f1f4fa !important;
  border: 1px solid rgba(15, 23, 42, .06) !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
:root[data-theme='dark'] body.skin-glass .h5-drawer .h5-sticker {
  background: rgba(255, 255, 255, .09) !important;
  border-color: rgba(255, 255, 255, .12) !important;
}
body.skin-glass .h5-drawer .h5-list-row strong,
body.skin-glass .h5-drawer .h5-list-row small {
  text-shadow: none !important;
}

/* 外观抽屉里的「界面风格」双卡片选择器 */
.h5-skin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 6px 0 14px;
}
.h5-skin-opt {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 13px;
  border-radius: 18px;
  border: 1.5px solid var(--h5-line, rgba(0, 0, 0, .1));
  background: rgba(255, 255, 255, .45);
  text-align: left;
  cursor: pointer;
  transition: transform .14s ease, border-color .16s ease, box-shadow .16s ease;
}
:root[data-theme='dark'] .h5-skin-opt {
  background: rgba(255, 255, 255, .07);
}
.h5-skin-opt:active {
  transform: scale(.98);
}
.h5-skin-opt strong {
  font-size: 14px;
  font-weight: 700;
  color: var(--h5-text, inherit);
}
.h5-skin-opt span {
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--h5-sub, #6b7280);
}
.h5-skin-opt[aria-pressed='true'] {
  border-color: var(--accent, #7c6aff);
  box-shadow: 0 0 0 2px rgba(124, 106, 255, .18);
}
.h5-skin-opt.is-glass-card {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, .82) 0%, rgba(224, 236, 252, .72) 100%) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
:root[data-theme='dark'] .h5-skin-opt.is-glass-card {
  background:
    linear-gradient(145deg, rgba(72, 92, 128, .38) 0%, rgba(28, 36, 56, .48) 100%) !important;
}

/* ---------- 5. Prompt 设置面板快捷文风 / 篇幅 / 全局自定义指令 ---------- */
.pm-quick-section {
  margin-bottom: 14px;
}
.pm-quick-label {
  font-size: 12.5px;
  font-weight: 650;
  color: var(--fg-2, #6b7280);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.pm-style-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.pm-style-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 11px 11px 10px;
  border-radius: 15px;
  border: 1.5px solid var(--line, rgba(0, 0, 0, .09));
  background: var(--soft, rgba(0, 0, 0, .025));
  text-align: left;
  cursor: pointer;
  transition: border-color .16s ease, background .16s ease, transform .12s ease, box-shadow .16s ease;
}
.pm-style-card.is-hero {
  grid-column: 1 / -1;
  padding: 12px 13px;
}
.pm-follow-global {
  width: 100%;
}
:root[data-theme='dark'] .pm-follow-global {
  --pm-tone: #e5e8f0 !important;
}
:root[data-theme='dark'] .pm-follow-global.active .pm-style-tag {
  color: #111318;
}
.char-style-card {
  max-width: 420px;
}
:root[data-theme='dark'] .char-style-card .pm-style-card {
  background: rgba(255, 255, 255, .04);
  border-color: rgba(255, 255, 255, .10);
}
:root[data-theme='dark'] .char-style-card .pm-style-card.active {
  background: color-mix(in srgb, var(--pm-tone, #e5e8f0) 14%, #1b1e27);
}
.pm-style-card:active { transform: scale(.98); }
.pm-style-head {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.pm-style-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: none;
  background: var(--pm-tone, #6366f1);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--pm-tone, #6366f1) 18%, transparent);
}
.pm-style-card strong {
  font-size: 13.2px;
  font-weight: 700;
  color: var(--fg, #141822);
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pm-style-tag {
  margin-left: auto;
  flex: none;
  font-style: normal;
  font-size: 10px;
  font-weight: 650;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(128, 128, 140, .11);
  color: var(--fg-2, #6b7280);
  line-height: 1.25;
}
.pm-style-card > span {
  font-size: 11.2px;
  line-height: 1.4;
  color: var(--fg-2, #6b7280);
}
.pm-style-card.active {
  border-color: var(--pm-tone, #1a1d24);
  background: color-mix(in srgb, var(--pm-tone, #1a1d24) 6%, var(--bg, #ffffff));
  box-shadow: 0 0 0 1px var(--pm-tone, #1a1d24), 0 4px 12px rgba(15, 23, 42, .06);
}
.pm-style-card.active .pm-style-tag {
  background: var(--pm-tone, #1a1d24);
  color: #ffffff;
}
.pm-style-preview {
  margin-top: 8px;
  padding: 9px 11px;
  border-radius: 12px;
  border: 1px solid var(--line, rgba(0, 0, 0, .08));
  background: var(--soft, rgba(0, 0, 0, .03));
  font-size: 11.6px;
  line-height: 1.5;
  color: var(--fg-2, #525866);
}
.pm-style-preview strong {
  color: var(--fg, #141822);
  font-weight: 680;
}
:root[data-theme='dark'] .pm-style-preview {
  background: rgba(255, 255, 255, .04);
  border-color: rgba(255, 255, 255, .09);
  color: #aeb5c4;
}
:root[data-theme='dark'] .pm-style-preview strong {
  color: #f2f4f8;
}
.pm-len-seg {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  padding: 4px;
  border-radius: 14px;
  background: var(--soft, rgba(0, 0, 0, .04));
  border: 1px solid var(--line, rgba(0, 0, 0, .08));
}
.pm-len-btn {
  border: 0;
  background: transparent;
  color: var(--fg-2, #6b7280);
  font-size: 12.5px;
  font-weight: 600;
  height: 34px;
  border-radius: 10px;
  cursor: pointer;
  transition: background .15s ease, color .15s ease, box-shadow .15s ease;
}
.pm-len-btn.active {
  background: var(--panel, #ffffff);
  color: var(--fg, #141822);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .08);
}
:root[data-theme='dark'] .pm-len-btn.active {
  background: rgba(255, 255, 255, .14);
  color: #ffffff;
}
.pm-style-head-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 7px;
}
.pm-style-head-row > span:first-child {
  font-size: 13px;
  font-weight: 640;
  color: var(--fg, #1a1d24);
}
.pm-style-counter {
  font-size: 11px;
  font-weight: 560;
  color: var(--fg-3, #888f9d);
  font-variant-numeric: tabular-nums;
}
.pm-style-counter.is-warn { color: #d97706; }
.pm-style-counter.is-max { color: #dc2626; font-weight: 650; }
:root[data-theme='dark'] .pm-style-counter.is-warn { color: #fbbf24; }
:root[data-theme='dark'] .pm-style-counter.is-max { color: #f87171; }
.pm-style-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.pm-style-upload-btn,
.pm-style-clear-btn {
  height: 36px;
  border-radius: 11px;
  border: 1px solid rgba(20, 26, 40, .11);
  background: #ffffff;
  color: var(--fg, #1a1d24);
  font: inherit;
  font-size: 12.2px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}
.pm-style-upload-btn {
  flex: 1 1 auto;
  padding: 0 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pm-style-clear-btn {
  flex: 0 0 auto;
  padding: 0 13px;
  color: var(--fg-2, #6b7280);
}
:root[data-theme='dark'] .pm-style-upload-btn,
:root[data-theme='dark'] .pm-style-clear-btn {
  background: #1b1e27;
  border-color: rgba(255, 255, 255, .12);
  color: #eef1f7;
}
:root[data-theme='dark'] .pm-style-clear-btn {
  color: #9ca3af;
}
.pm-core-warn {
  margin: 0 0 10px;
  padding: 9px 12px;
  border-radius: 12px;
  background: rgba(239, 68, 68, .12);
  border: 1px solid rgba(239, 68, 68, .35);
  color: #dc2626;
  font-size: 12px;
  line-height: 1.5;
}
:root[data-theme='dark'] .pm-core-warn {
  color: #fca5a5;
}

/* ---------- 6. 聊天右上角「专属文风设定」独立安全弹层（隔离 GPU 图层，免疫液态玻璃穿透） ---------- */
.gs-mask {
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  z-index: 1200;
  background: rgba(8, 12, 22, .52);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  isolation: isolate;
}
@media (min-width: 720px) {
  .gs-mask { align-items: center; padding: 20px; }
}
.gs-modal {
  width: 100%;
  max-width: 460px;
  max-height: calc(100dvh - max(28px, var(--safe-top, 0px), env(safe-area-inset-top, 0px)));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 26px 26px 0 0;
  background: #f5f6f9;
  color: #161922;
  border-top: 1px solid rgba(20, 26, 40, .08);
  box-shadow: 0 -14px 44px rgba(0, 0, 0, .26);
  isolation: isolate;
  transform: translateZ(0);
}
@media (min-width: 720px) {
  .gs-modal {
    border-radius: 24px;
    border: 1px solid rgba(20, 26, 40, .10);
    box-shadow: 0 24px 60px rgba(0, 0, 0, .28);
  }
}
:root[data-theme='dark'] .gs-modal {
  background: #14161d;
  color: #f2f4f8;
  border-color: rgba(255, 255, 255, .10);
}
.gs-head {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 16px 18px 12px;
  background: #f5f6f9;
  border-bottom: 1px solid rgba(20, 26, 40, .07);
}
:root[data-theme='dark'] .gs-head {
  background: #14161d;
  border-bottom-color: rgba(255, 255, 255, .09);
}
.gs-head h3 {
  margin: 0;
  font-size: 16.5px;
  font-weight: 720;
  color: inherit;
}
.gs-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 12px 18px 14px;
}
.gs-hint {
  margin: 0 0 11px;
  font-size: 12px;
  line-height: 1.5;
  color: #6b7280;
}
:root[data-theme='dark'] .gs-hint { color: #9aa2b2; }
.gs-modal .pm-style-card {
  background: #ffffff;
  border-color: rgba(20, 26, 40, .09);
  color: #161922;
}
.gs-modal .pm-style-card strong { color: #161922; }
.gs-modal .pm-style-card > span { color: #6b7280; }
.gs-modal .pm-style-card.active {
  background: color-mix(in srgb, var(--pm-tone, #ec4899) 7%, #ffffff);
  border-color: var(--pm-tone, #ec4899);
  box-shadow: 0 0 0 1px var(--pm-tone, #ec4899);
}
:root[data-theme='dark'] .gs-modal .pm-style-card {
  background: #1d202a;
  border-color: rgba(255, 255, 255, .10);
  color: #f2f4f8;
}
:root[data-theme='dark'] .gs-modal .pm-style-card strong { color: #f2f4f8; }
:root[data-theme='dark'] .gs-modal .pm-style-card > span { color: #9aa2b2; }
:root[data-theme='dark'] .gs-modal .pm-style-card.active {
  background: color-mix(in srgb, var(--pm-tone, #ec4899) 14%, #1d202a);
}
.gs-modal .pm-style-preview {
  background: #ffffff;
  border-color: rgba(20, 26, 40, .08);
  color: #4b5563;
}
.gs-modal .pm-style-preview strong { color: #161922; }
:root[data-theme='dark'] .gs-modal .pm-style-preview {
  background: #1d202a;
  border-color: rgba(255, 255, 255, .09);
  color: #aeb5c4;
}
:root[data-theme='dark'] .gs-modal .pm-style-preview strong { color: #f2f4f8; }
.gs-custom-sec {
  margin-top: 13px;
}
.gs-modal .pm-style-head-row > span:first-child { color: #161922; }
:root[data-theme='dark'] .gs-modal .pm-style-head-row > span:first-child { color: #f2f4f8; }
.gs-textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 11px 13px;
  border-radius: 14px;
  border: 1px solid rgba(20, 26, 40, .10);
  background: #ffffff;
  color: #161922;
  font: inherit;
  font-size: 14.5px;
  line-height: 1.6;
  resize: none;
  outline: none;
}
.gs-textarea:focus {
  border-color: #1a1d24;
  box-shadow: 0 0 0 3px rgba(26, 29, 36, .08);
}
:root[data-theme='dark'] .gs-textarea {
  background: #1d202a;
  border-color: rgba(255, 255, 255, .11);
  color: #f2f4f8;
}
:root[data-theme='dark'] .gs-textarea:focus {
  border-color: rgba(242, 244, 248, .55);
  box-shadow: 0 0 0 3px rgba(242, 244, 248, .10);
}
.gs-foot {
  flex: none;
  display: flex;
  gap: 10px;
  padding: 11px 18px max(15px, env(safe-area-inset-bottom));
  background: #f5f6f9;
  border-top: 1px solid rgba(20, 26, 40, .07);
}
:root[data-theme='dark'] .gs-foot {
  background: #14161d;
  border-top-color: rgba(255, 255, 255, .09);
}
.gs-foot .test-btn {
  flex: 0 0 auto;
  min-width: 88px;
  height: 44px;
  border-radius: 13px;
  background: #ffffff;
  border: 1px solid rgba(20, 26, 40, .10);
  color: #161922;
  font-weight: 600;
}
.gs-foot .save-btn {
  flex: 1 1 auto;
  height: 44px;
  border-radius: 13px;
  background: #1a1d24;
  border: 1px solid #1a1d24;
  color: #ffffff;
  font-size: 15px;
  font-weight: 650;
}
:root[data-theme='dark'] .gs-foot .test-btn {
  background: #1d202a;
  border-color: rgba(255, 255, 255, .12);
  color: #eef1f7;
}
:root[data-theme='dark'] .gs-foot .save-btn {
  background: #f2f4f8;
  border-color: #f2f4f8;
  color: #111318;
}


/* === modules/moon-games.css === */
/* ===== 月见双人互动小游戏大厅（抓娃娃机 / 五子棋 / 真心话大冒险） ===== */
.mg-mask {
  position: fixed;
  inset: 0;
  z-index: 9600;
  background: rgba(16, 18, 28, 0.56);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  box-sizing: border-box;
  animation: mgFadeIn .2s ease;
}
@keyframes mgFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.mg-card {
  width: 100%;
  max-width: 416px;
  max-height: min(90dvh, 760px);
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  border-radius: 24px;
  overflow: hidden;
  background: var(--surface, #fff);
  color: var(--fg, #1f232c);
  border: 1px solid var(--line, rgba(128, 128, 145, .18));
  box-shadow: 0 22px 60px rgba(0, 0, 0, .28);
}
html[data-theme="dark"] .mg-card {
  background: #171923;
  color: #edf0f8;
  border-color: rgba(255, 255, 255, .12);
}

/* 顶部标题栏 */
.mg-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 10px;
  gap: 8px;
  flex: 0 0 auto;
}
.mg-head-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 700;
  min-width: 0;
}
.mg-head-title span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mg-close {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 0;
  background: rgba(128, 134, 152, .14);
  color: inherit;
  font-size: 18px;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
  flex: 0 0 auto;
}

/* 角色陪玩实时气泡条 */
.mg-companion {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 14px 10px;
  padding: 8px 11px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(244, 240, 252, .9), rgba(252, 242, 247, .92));
  border: 1px solid rgba(196, 178, 224, .32);
  flex: 0 0 auto;
}
html[data-theme="dark"] .mg-companion {
  background: linear-gradient(135deg, rgba(44, 41, 64, .75), rgba(52, 39, 54, .72));
  border-color: rgba(255, 255, 255, .1);
}
.mg-comp-av {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  overflow: hidden;
  flex: 0 0 36px;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(145deg, #6d6f82, #383b4a);
}
.mg-comp-av img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.mg-comp-speech {
  flex: 1;
  min-width: 0;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--fg, #262936);
}
html[data-theme="dark"] .mg-comp-speech {
  color: #e9ecf6;
}
.mg-comp-speech b {
  font-size: 11px;
  color: #8876a8;
  display: block;
  margin-bottom: 1px;
}
html[data-theme="dark"] .mg-comp-speech b {
  color: #c2b2e0;
}

/* 三游戏切换 Tab */
.mg-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin: 0 14px 10px;
  padding: 4px;
  border-radius: 14px;
  background: rgba(130, 136, 156, .1);
  flex: 0 0 auto;
}
.mg-tab {
  border: 0;
  background: transparent;
  color: var(--fg-2, #666c7d);
  font-size: 12.5px;
  font-weight: 600;
  padding: 7px 4px;
  border-radius: 10px;
  cursor: pointer;
  transition: background .18s ease, color .18s ease, box-shadow .18s ease;
  white-space: nowrap;
}
.mg-tab.is-active {
  background: var(--surface, #fff);
  color: var(--fg, #1c1f28);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .08);
}
html[data-theme="dark"] .mg-tab.is-active {
  background: #272b3d;
  color: #fff;
}

/* 内容滚动区 */
.mg-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 14px 16px;
  box-sizing: border-box;
}

/* 通用按钮 */
.mg-btn {
  border: 1px solid var(--line, rgba(128, 134, 152, .24));
  background: var(--surface, #fff);
  color: var(--fg, #222);
  border-radius: 12px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: transform .12s ease, opacity .15s ease;
}
.mg-btn:active { transform: scale(.96); }
.mg-btn:disabled { opacity: .48; cursor: not-allowed; }
html[data-theme="dark"] .mg-btn {
  background: #232738;
  color: #edf0f8;
  border-color: rgba(255, 255, 255, .14);
}
.mg-btn-primary {
  border: 0;
  color: #fff;
  background: linear-gradient(135deg, #e77ca0, #b47fe8);
  box-shadow: 0 6px 16px rgba(206, 122, 184, .32);
}
.mg-btn-dark {
  border: 0;
  color: #fff;
  background: linear-gradient(135deg, #2d3246, #1b1e2c);
}
html[data-theme="dark"] .mg-btn-dark {
  background: linear-gradient(135deg, #5c6385, #3d4360);
}
.mg-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-bottom: 10px;
}
.mg-pill {
  border: 1px solid var(--line, rgba(128, 134, 152, .22));
  background: transparent;
  color: var(--fg-2, #666);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
}
.mg-pill.is-on {
  border-color: #d67fa6;
  background: rgba(231, 124, 160, .14);
  color: #c4517f;
}
html[data-theme="dark"] .mg-pill.is-on {
  color: #f3a4c3;
  background: rgba(231, 124, 160, .2);
}

/* ========== 1. 抓娃娃机 ========== */
.mg-claw-stage-wrap {
  position: relative;
  width: 100%;
  border-radius: 18px;
  overflow: hidden;
  border: 2px solid rgba(231, 154, 186, .45);
  background: linear-gradient(180deg, #fff5fa 0%, #f5f1ff 100%);
  box-shadow: inset 0 0 24px rgba(255, 255, 255, .9), 0 8px 20px rgba(175, 135, 190, .14);
}
html[data-theme="dark"] .mg-claw-stage-wrap {
  background: linear-gradient(180deg, #211f30 0%, #191a28 100%);
  border-color: rgba(212, 150, 194, .32);
  box-shadow: inset 0 0 24px rgba(0, 0, 0, .35);
}
.mg-claw-canvas {
  width: 100%;
  height: auto;
  display: block;
  touch-action: manipulation;
  cursor: pointer;
}
.mg-claw-controls {
  display: grid;
  grid-template-columns: 54px 54px minmax(0, 1fr);
  gap: 8px;
  margin-top: 10px;
}
.mg-claw-dir {
  height: 44px;
  font-size: 17px;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
}
.mg-claw-drop {
  height: 44px;
  font-size: 14px;
}
.mg-claw-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
  margin-top: 8px;
}
.mg-shelf {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(130, 136, 156, .07);
}
.mg-shelf-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 650;
  margin-bottom: 6px;
}
.mg-shelf-items {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.mg-plush-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11.5px;
  background: var(--surface, #fff);
  border: 1px solid var(--line, rgba(128, 134, 152, .18));
  cursor: pointer;
}
html[data-theme="dark"] .mg-plush-chip {
  background: #232738;
}
.mg-plush-empty {
  font-size: 11.5px;
  color: var(--fg-2, #888);
}

/* ========== 2. 双人五子棋 ========== */
.mg-gomoku-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.mg-gomoku-status {
  font-size: 12px;
  font-weight: 650;
  color: var(--fg-2, #666);
}
.mg-gomoku-wrap {
  width: 100%;
  max-width: 344px;
  margin: 0 auto;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(185, 148, 102, .42);
  box-shadow: 0 8px 22px rgba(130, 96, 52, .16);
}
.mg-gomoku-canvas {
  width: 100%;
  aspect-ratio: 1 / 1;
  display: block;
  touch-action: manipulation;
  cursor: pointer;
}
.mg-bet-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
}
.mg-bet-input {
  flex: 1;
  min-width: 0;
  height: 36px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid var(--line, rgba(128, 134, 152, .25));
  background: var(--surface, #fff);
  color: inherit;
  font-size: 12.5px;
  box-sizing: border-box;
}
html[data-theme="dark"] .mg-bet-input {
  background: #202434;
}
.mg-gomoku-ops {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin-top: 8px;
}
.mg-gomoku-result {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(231, 124, 160, .14), rgba(180, 127, 232, .14));
  border: 1px solid rgba(214, 127, 166, .35);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.mg-gomoku-result strong {
  font-size: 13.5px;
}

/* ========== 3. 真心话大冒险 ========== */
.mg-tod-stage {
  perspective: 900px;
  margin: 6px 0 12px;
}
.mg-tod-card {
  min-height: 196px;
  border-radius: 20px;
  padding: 18px 18px 16px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(214, 146, 186, .38);
  background: linear-gradient(148deg, #fff8fb 0%, #f6f1ff 55%, #fef6fa 100%);
  box-shadow: 0 10px 28px rgba(180, 127, 198, .16);
  transition: transform .42s cubic-bezier(.22, 1, .36, 1);
}
html[data-theme="dark"] .mg-tod-card {
  background: linear-gradient(148deg, #272236 0%, #1e2133 55%, #2b2131 100%);
  border-color: rgba(231, 150, 196, .28);
}
.mg-tod-card.is-flipping {
  transform: rotateY(90deg) scale(.95);
}
.mg-tod-badges {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.mg-tod-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(231, 124, 160, .16);
  color: #c44f7e;
}
html[data-theme="dark"] .mg-tod-badge {
  color: #f4a4c5;
}
.mg-tod-target {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--fg-2, #767c8f);
}
.mg-tod-text {
  margin: 16px 0;
  font-size: 16px;
  font-weight: 650;
  line-height: 1.62;
  text-align: center;
  color: var(--fg, #222634);
}
html[data-theme="dark"] .mg-tod-text {
  color: #f2f4fc;
}
.mg-tod-foot-tip {
  font-size: 11px;
  text-align: center;
  color: var(--fg-2, #8a90a2);
}
.mg-tod-btns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.mg-tod-send {
  width: 100%;
  margin-top: 10px;
  height: 42px;
  font-size: 14px;
}


/* === modules/moon-stickers.css === */
/* 月见表情包系统样式 */
.composer-sticker-tray {
  margin-top: 8px;
  padding: 10px 10px 12px;
  border-radius: 18px;
  background: var(--panel, rgba(255, 255, 255, 0.94));
  border: 1px solid var(--line, rgba(140, 126, 168, 0.16));
  box-shadow: 0 10px 30px rgba(32, 24, 56, 0.08);
  animation: moonStickerSlide 0.18s cubic-bezier(0.22, 1, 0.36, 1);
  user-select: none;
}

[data-theme="dark"] .composer-sticker-tray {
  background: var(--panel, rgba(26, 24, 38, 0.96));
  border-color: rgba(255, 255, 255, 0.09);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.36);
}

@keyframes moonStickerSlide {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.sticker-tray-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.sticker-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}
.sticker-tabs::-webkit-scrollbar { display: none; }

.sticker-tab {
  border: none;
  background: transparent;
  color: var(--muted, #7c7592);
  font-size: 12.5px;
  font-weight: 500;
  padding: 5px 10px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.16s, color 0.16s;
}
.sticker-tab.active {
  background: var(--accent-soft, rgba(168, 128, 224, 0.16));
  color: var(--accent, #8b5cf6);
  font-weight: 600;
}

.sticker-head-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.sticker-act-btn {
  border: 1px solid var(--line, rgba(140, 126, 168, 0.22));
  background: var(--panel-2, rgba(246, 243, 252, 0.85));
  color: var(--text, #2c2640);
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.12s, background 0.16s, border-color 0.16s;
}
.sticker-act-btn:active { transform: scale(0.96); }
.sticker-act-btn.primary {
  background: var(--accent, #8b5cf6);
  border-color: transparent;
  color: #fff;
}
.sticker-act-btn.active {
  background: rgba(236, 72, 153, 0.14);
  border-color: rgba(236, 72, 153, 0.35);
  color: #db2777;
}
.sticker-act-btn.danger {
  background: rgba(225, 29, 72, 0.1);
  border-color: rgba(225, 29, 72, 0.32);
  color: #e11d48;
  font-weight: 600;
}
[data-theme="dark"] .sticker-act-btn.danger {
  background: rgba(244, 63, 94, 0.18);
  border-color: rgba(244, 63, 94, 0.4);
  color: #fda4af;
}

.sticker-manage-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  padding: 6px 10px;
  margin-bottom: 8px;
  border-radius: 12px;
  background: rgba(225, 29, 72, 0.06);
  border: 1px dashed rgba(225, 29, 72, 0.24);
}
[data-theme="dark"] .sticker-manage-bar {
  background: rgba(244, 63, 94, 0.1);
  border-color: rgba(244, 63, 94, 0.3);
}
.sticker-manage-tip {
  font-size: 11.5px;
  color: var(--muted, #7c7592);
}
.sticker-manage-ops {
  display: flex;
  align-items: center;
  gap: 6px;
}

[data-theme="dark"] .sticker-act-btn {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
  color: #e9e4f8;
}
[data-theme="dark"] .sticker-act-btn.primary {
  background: var(--accent, #a78bfa);
  color: #161224;
}

.sticker-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  max-height: 236px;
  overflow-y: auto;
  padding: 2px 2px 4px;
}

@media (max-width: 780px) {
  .sticker-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 7px;
    max-height: 224px;
  }
}

.sticker-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 6px 4px 5px;
  border-radius: 14px;
  border: 1px solid transparent;
  background: rgba(148, 134, 184, 0.06);
  cursor: pointer;
  transition: transform 0.14s, background 0.15s, border-color 0.15s;
}
.sticker-card:hover {
  background: rgba(148, 134, 184, 0.13);
  border-color: rgba(168, 128, 224, 0.25);
  transform: translateY(-1px);
}
.sticker-card:active { transform: scale(0.94); }

.sticker-card img {
  width: 58px;
  height: 58px;
  object-fit: contain;
  border-radius: 10px;
  pointer-events: none;
}

.sticker-card-label {
  font-size: 11px;
  color: var(--muted, #7c7592);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.25;
}

.sticker-card.is-managing {
  border-color: rgba(225, 29, 72, 0.24);
  background: rgba(225, 29, 72, 0.04);
}
[data-theme="dark"] .sticker-card.is-managing {
  border-color: rgba(244, 63, 94, 0.32);
  background: rgba(244, 63, 94, 0.08);
}

.sticker-card-ops {
  position: absolute;
  top: 3px;
  right: 3px;
  display: flex;
  gap: 3px;
}
.sticker-card-ops-left {
  position: absolute;
  top: 3px;
  left: 3px;
  display: flex;
  gap: 3px;
  z-index: 2;
}
.sticker-del-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  z-index: 3;
  box-shadow: 0 2px 6px rgba(225, 29, 72, 0.35);
}

.sticker-mini-op {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  border: none;
  background: rgba(24, 20, 36, 0.76);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  line-height: 24px;
  text-align: center;
  padding: 0;
  cursor: pointer;
}
.sticker-mini-op.fav { color: #fbbf24; }
.sticker-mini-op.del { background: #e11d48; }

.sticker-fav-badge {
  position: absolute;
  top: 4px;
  left: 5px;
  font-size: 10px;
  color: #f59e0b;
  pointer-events: none;
}

.sticker-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 28px 12px;
  color: var(--muted, #8a82a2);
  font-size: 13px;
  line-height: 1.6;
}

/* 聊天里的表情包气泡（无底框、轻盈弹出） */
.messages .row .bubble.sticker-bubble,
.h5-active .messages .row .bubble.sticker-bubble {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 2px 0 !important;
  max-width: 164px;
  overflow: visible;
}
.messages .row .bubble.sticker-bubble::before,
.messages .row .bubble.sticker-bubble::after {
  display: none !important;
}

.msg-sticker-wrap {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.msg-sticker-img {
  display: block;
  width: 124px;
  height: 124px;
  max-width: 100%;
  object-fit: contain;
  border-radius: 16px;
  cursor: pointer;
  filter: drop-shadow(0 4px 10px rgba(32, 24, 56, 0.1));
  animation: moonStickerPop 0.24s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes moonStickerPop {
  from { opacity: 0; transform: scale(0.76); }
  to { opacity: 1; transform: scale(1); }
}

.bubble:not(.sticker-bubble) .msg-sticker-wrap {
  margin-bottom: 6px;
}

.bubble:not(.sticker-bubble) .msg-sticker-img {
  width: 108px;
  height: 108px;
}

/* 上传/编辑标签小弹窗 */
.sticker-modal-mask {
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: rgba(18, 14, 30, 0.45);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.sticker-modal {
  width: 100%;
  max-width: 340px;
  border-radius: 20px;
  padding: 18px;
  background: var(--panel, #fff);
  color: var(--text, #252036);
  border: 1px solid var(--line, rgba(140, 126, 168, 0.18));
  box-shadow: 0 20px 50px rgba(20, 14, 40, 0.22);
}

[data-theme="dark"] .sticker-modal {
  background: #1e1b2c;
  color: #f0ecfb;
}

.sticker-modal h3 {
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: 600;
}

.sticker-modal-preview {
  display: flex;
  justify-content: center;
  margin-bottom: 12px;
}

.sticker-modal-preview img {
  width: 104px;
  height: 104px;
  object-fit: contain;
  border-radius: 14px;
  background: rgba(148, 134, 184, 0.08);
  padding: 6px;
}

.sticker-modal-input {
  width: 100%;
  box-sizing: border-box;
  padding: 9px 12px;
  border-radius: 12px;
  border: 1px solid var(--line, rgba(140, 126, 168, 0.28));
  background: var(--panel-2, rgba(246, 243, 252, 0.7));
  color: inherit;
  font-size: 14px;
  outline: none;
}

[data-theme="dark"] .sticker-modal-input {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.14);
}

.sticker-modal-hint {
  margin: 6px 0 14px;
  font-size: 12px;
  color: var(--muted, #847c9c);
}

.sticker-modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}


/* === modules/moon-onboarding.css === */
/* =========================================================
   月见 (MOON) · 「初见月色」沉浸式新手引导样式
   4层复合动效：GPT Image 双主题底图 + Canvas 3景深琉璃粒子
                + 切角磨砂琉璃交互卡 + 2.2s 星尘落幕幕布
   ========================================================= */

#moonOnboarding {
  --ob-text: #1c243b;
  --ob-text-sub: rgba(38, 49, 82, 0.72);
  --ob-text-mute: rgba(54, 67, 106, 0.50);
  --ob-glass: rgba(252, 253, 255, 0.66);
  --ob-glass-strong: rgba(255, 255, 255, 0.82);
  --ob-border: rgba(110, 132, 194, 0.28);
  --ob-border-active: rgba(98, 122, 210, 0.72);
  --ob-accent: #5e72c8;
  --ob-accent-soft: rgba(94, 114, 200, 0.13);
  --ob-glow: rgba(145, 166, 238, 0.36);
  --ob-btn-bg: linear-gradient(135deg, rgba(84, 104, 192, 0.94), rgba(121, 136, 214, 0.94));
  --ob-btn-text: #ffffff;
  --ob-ghost-bg: rgba(255, 255, 255, 0.45);
  --ob-input-bg: rgba(255, 255, 255, 0.62);
  --ob-shadow: 0 22px 60px rgba(48, 64, 118, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.85);
  --ob-curtain-bg: radial-gradient(circle at 50% 42%, rgba(242, 246, 255, 0.92), rgba(226, 233, 249, 0.96));

  position: fixed;
  inset: 0;
  z-index: 9600;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--ob-text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  user-select: none;
  opacity: 0;
  transition: opacity 0.52s cubic-bezier(0.22, 1, 0.36, 1), color 0.55s ease;
  background: #edf1fa;
}

#moonOnboarding.ob-visible {
  opacity: 1;
}

#moonOnboarding.ob-closing {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.65s cubic-bezier(0.22, 1, 0.36, 1);
}

#moonOnboarding[data-ob-theme="dark"] {
  --ob-text: #edf2ff;
  --ob-text-sub: rgba(210, 222, 252, 0.76);
  --ob-text-mute: rgba(176, 194, 238, 0.52);
  --ob-glass: rgba(14, 22, 54, 0.56);
  --ob-glass-strong: rgba(20, 31, 72, 0.76);
  --ob-border: rgba(164, 192, 255, 0.24);
  --ob-border-active: rgba(186, 212, 255, 0.80);
  --ob-accent: #a9c4ff;
  --ob-accent-soft: rgba(154, 184, 255, 0.16);
  --ob-glow: rgba(132, 174, 255, 0.40);
  --ob-btn-bg: linear-gradient(135deg, rgba(168, 195, 255, 0.26), rgba(114, 152, 245, 0.34));
  --ob-btn-text: #f5f8ff;
  --ob-ghost-bg: rgba(18, 28, 64, 0.45);
  --ob-input-bg: rgba(9, 15, 38, 0.54);
  --ob-shadow: 0 24px 64px rgba(2, 6, 20, 0.56), inset 0 1px 0 rgba(206, 224, 255, 0.18);
  --ob-curtain-bg: radial-gradient(circle at 50% 42%, rgba(16, 24, 58, 0.92), rgba(7, 11, 28, 0.97));
  background: #090e26;
}

/* ---------- L0: GPT Image 双主题底图 + Ken Burns 缓慢呼吸漂移 ---------- */
.mob-bg {
  position: absolute;
  inset: -4%;
  background-size: cover;
  background-position: center;
  pointer-events: none;
  will-change: transform, opacity;
  animation: mobKenBurns 26s ease-in-out infinite alternate;
  transition: opacity 0.72s cubic-bezier(0.22, 1, 0.36, 1);
}

.mob-bg.light {
  background-image: url('/media/onboarding/ob-bg-light.webp');
  opacity: 1;
}

.mob-bg.dark {
  background-image: url('/media/onboarding/ob-bg-dark.webp');
  opacity: 0;
}

#moonOnboarding[data-ob-theme="dark"] .mob-bg.light { opacity: 0; }
#moonOnboarding[data-ob-theme="dark"] .mob-bg.dark { opacity: 1; }

@keyframes mobKenBurns {
  0%   { transform: scale(1.01) translate3d(0%, 0%, 0); }
  50%  { transform: scale(1.06) translate3d(-1.2%, -0.8%, 0); }
  100% { transform: scale(1.03) translate3d(1.0%, -1.4%, 0); }
}

/* 斜向月光光束叠加层 */
.mob-beam {
  position: absolute;
  inset: -15%;
  pointer-events: none;
  background: linear-gradient(
    126deg,
    transparent 24%,
    rgba(255, 255, 255, 0.24) 44%,
    rgba(196, 212, 255, 0.14) 54%,
    transparent 74%
  );
  opacity: 0.75;
  animation: mobBeamDrift 14s ease-in-out infinite alternate;
  transition: opacity 0.6s ease, background 0.6s ease;
}

#moonOnboarding[data-ob-theme="dark"] .mob-beam {
  background: linear-gradient(
    126deg,
    transparent 26%,
    rgba(164, 202, 255, 0.16) 45%,
    rgba(120, 160, 255, 0.08) 56%,
    transparent 72%
  );
  opacity: 0.85;
}

@keyframes mobBeamDrift {
  0%   { transform: translate3d(-3%, -2%, 0) rotate(-1deg); }
  100% { transform: translate3d(3%, 2%, 0) rotate(1.2deg); }
}

/* ---------- L1: 跨步骤持久 Canvas 粒子层 ---------- */
.mob-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
}

/* ---------- 顶部极细分段进度条 ---------- */
.mob-progress {
  position: fixed;
  top: max(10px, env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  width: min(360px, calc(100vw - 40px));
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 7px;
  z-index: 6;
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.mob-progress.show {
  opacity: 1;
}

.mob-prog-seg {
  height: 2px;
  border-radius: 99px;
  background: rgba(120, 140, 196, 0.24);
  overflow: hidden;
  position: relative;
}

#moonOnboarding[data-ob-theme="dark"] .mob-prog-seg {
  background: rgba(176, 202, 255, 0.18);
}

.mob-prog-fill {
  position: absolute;
  inset: 0;
  background: var(--ob-accent);
  box-shadow: 0 0 8px var(--ob-glow);
  transform-origin: left center;
  transform: scaleX(0);
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.mob-prog-seg.done .mob-prog-fill,
.mob-prog-seg.active .mob-prog-fill {
  transform: scaleX(1);
}

/* ---------- 右上角极简琉璃音乐开关 ---------- */
.mob-audio-btn {
  position: fixed;
  top: max(22px, calc(env(safe-area-inset-top) + 14px));
  right: 16px;
  z-index: 8;
  height: 32px;
  padding: 0 11px;
  border-radius: 99px;
  border: 1px solid var(--ob-border);
  background: var(--ob-ghost-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: var(--ob-text-sub);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: border-color 0.25s ease, color 0.25s ease, background 0.35s ease, opacity 0.3s ease;
}

.mob-audio-btn:hover {
  border-color: var(--ob-border-active);
  color: var(--ob-text);
}

.mob-audio-bars {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 11px;
}

.mob-audio-bars i {
  display: block;
  width: 2px;
  height: 4px;
  border-radius: 2px;
  background: var(--ob-accent);
  transition: height 0.2s ease, opacity 0.2s ease;
  opacity: 0.45;
}

.mob-audio-btn.playing .mob-audio-bars i {
  opacity: 1;
  animation: mobAudioWave 1.15s ease-in-out infinite;
}

.mob-audio-btn.playing .mob-audio-bars i:nth-child(2) { animation-delay: 0.22s; }
.mob-audio-btn.playing .mob-audio-bars i:nth-child(3) { animation-delay: 0.44s; }

@keyframes mobAudioWave {
  0%, 100% { height: 3px; }
  50%      { height: 11px; }
}

/* ---------- 主舞台容器 ---------- */
.mob-stage {
  position: relative;
  z-index: 4;
  width: 100%;
  max-width: 440px;
  padding: calc(26px + env(safe-area-inset-top)) 20px calc(64px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  box-sizing: border-box;
}

/* 步骤呼吸溶隐过渡 */
.mob-step-wrap {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: opacity 0.30s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.34s cubic-bezier(0.22, 1, 0.36, 1),
              filter 0.30s ease;
  will-change: opacity, transform, filter;
}

.mob-step-wrap.leaving {
  opacity: 0;
  transform: scale(0.968) translateY(-4px);
  filter: blur(4px);
}

.mob-step-wrap.entering {
  opacity: 0;
  transform: scale(1.022) translateY(8px);
  filter: blur(3px);
}

/* ---------- 开放空间（第 0 幕序章 & 第 5 幕落幕） ---------- */
.mob-open {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 8px;
  width: 100%;
}

.mob-emblem-wrap {
  position: relative;
  width: 118px;
  height: 118px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mob-emblem-halo {
  position: absolute;
  inset: -14px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--ob-glow) 0%, transparent 68%);
  animation: mobPulse 4.2s ease-in-out infinite;
}

.mob-emblem-ring {
  position: absolute;
  inset: -4px;
  width: calc(100% + 8px);
  height: calc(100% + 8px);
  animation: mobOrbit 28s linear infinite;
  opacity: 0.72;
}

.mob-emblem-img {
  position: relative;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 28px var(--ob-glow), 0 0 0 1px var(--ob-border);
  animation: mobFloat 5.6s ease-in-out infinite;
}

@keyframes mobPulse {
  0%, 100% { transform: scale(0.94); opacity: 0.65; }
  50%      { transform: scale(1.08); opacity: 1; }
}

@keyframes mobOrbit {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

@keyframes mobFloat {
  0%, 100% { transform: translateY(0px); }
  50%      { transform: translateY(-5px); }
}

.mob-eyebrow {
  font-size: 11px;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--ob-accent);
  font-weight: 600;
  margin-bottom: 12px;
}

.mob-hero-title {
  font-size: 24px;
  font-weight: 500;
  letter-spacing: 0.08em;
  line-height: 1.48;
  margin: 0 0 12px;
  color: var(--ob-text);
}

.mob-hero-sub {
  font-size: 14px;
  line-height: 1.75;
  color: var(--ob-text-sub);
  margin: 0 0 32px;
  max-width: 310px;
}

.mob-nick-badge {
  font-size: 26px;
  font-weight: 500;
  letter-spacing: 0.14em;
  color: var(--ob-text);
  margin: 0 0 10px;
}

/* ---------- 切角磨砂琉璃卡片（第 1~4 幕） ---------- */
.mob-card {
  position: relative;
  width: 100%;
  padding: 24px 22px 22px;
  box-sizing: border-box;
  background: var(--ob-glass);
  backdrop-filter: blur(22px) saturate(135%);
  -webkit-backdrop-filter: blur(22px) saturate(135%);
  border: 1px solid var(--ob-border);
  box-shadow: var(--ob-shadow);
  clip-path: polygon(
    14px 0, calc(100% - 14px) 0,
    100% 14px, 100% calc(100% - 14px),
    calc(100% - 14px) 100%, 14px 100%,
    0 calc(100% - 14px), 0 14px
  );
  transition: background 0.55s ease, border-color 0.55s ease, box-shadow 0.55s ease;
  overflow: hidden;
}

/* 四角菱形星芒微光装饰 */
.mob-card::before,
.mob-card::after {
  content: '✦';
  position: absolute;
  font-size: 8px;
  color: var(--ob-accent);
  opacity: 0.55;
  pointer-events: none;
}
.mob-card::before { top: 8px; left: 10px; }
.mob-card::after  { bottom: 8px; right: 10px; }

/* 右上角超大淡色线稿水印 */
.mob-watermark {
  position: absolute;
  top: -12px;
  right: -10px;
  width: 108px;
  height: 108px;
  color: var(--ob-accent);
  opacity: 0.085;
  pointer-events: none;
}

.mob-card-head {
  position: relative;
  z-index: 1;
  margin-bottom: 18px;
}

.mob-kicker {
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ob-accent);
  font-weight: 600;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.mob-kicker::before {
  content: '◆';
  font-size: 7px;
  opacity: 0.78;
}

.mob-card-desc {
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--ob-text-sub);
  margin: 0;
}

/* ---------- 第 1 幕：称呼与头像 ---------- */
.mob-avatar-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 18px;
}

.mob-avatar-btn {
  position: relative;
  width: 78px;
  height: 78px;
  border-radius: 50%;
  border: 1px dashed var(--ob-border-active);
  background: var(--ob-input-bg);
  color: var(--ob-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.mob-avatar-btn:active { transform: scale(0.95); }
.mob-avatar-btn:hover { box-shadow: 0 0 18px var(--ob-glow); }

.mob-avatar-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mob-avatar-plus {
  font-size: 26px;
  font-weight: 300;
  line-height: 1;
}

.mob-avatar-tip {
  margin-top: 7px;
  font-size: 11.5px;
  color: var(--ob-text-mute);
}

.mob-field {
  margin-bottom: 14px;
}

.mob-label {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 12.5px;
  color: var(--ob-text);
  font-weight: 500;
  margin-bottom: 7px;
}

.mob-label small {
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ob-text-mute);
  font-weight: 400;
}

.mob-input {
  width: 100%;
  box-sizing: border-box;
  height: 44px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid var(--ob-border);
  background: var(--ob-input-bg);
  color: var(--ob-text);
  font-size: 14.5px;
  outline: none;
  transition: border-color 0.22s ease, box-shadow 0.22s ease, background 0.35s ease;
}

.mob-input:focus {
  border-color: var(--ob-border-active);
  box-shadow: 0 0 0 3px var(--ob-accent-soft);
}

.mob-input::placeholder {
  color: var(--ob-text-mute);
}

.mob-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 8px;
}

.mob-chip {
  padding: 5px 11px;
  border-radius: 99px;
  border: 1px solid var(--ob-border);
  background: var(--ob-ghost-bg);
  color: var(--ob-text-sub);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.mob-chip.active {
  border-color: var(--ob-border-active);
  background: var(--ob-accent-soft);
  color: var(--ob-text);
  font-weight: 500;
}

/* ---------- 第 2 幕：实时双主题月色选择 ---------- */
.mob-theme-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}

.mob-theme-opt {
  position: relative;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid var(--ob-border);
  background: var(--ob-input-bg);
  cursor: pointer;
  text-align: left;
  color: var(--ob-text);
  transition: border-color 0.28s ease, transform 0.22s ease, box-shadow 0.28s ease, background 0.28s ease;
}

.mob-theme-opt:active { transform: scale(0.97); }

.mob-theme-opt.active {
  border-color: var(--ob-border-active);
  background: var(--ob-accent-soft);
  box-shadow: 0 0 20px var(--ob-glow);
}

.mob-theme-thumb {
  width: 100%;
  height: 112px;
  border-radius: 8px;
  background-size: cover;
  background-position: center;
  margin-bottom: 9px;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.mob-theme-thumb.light { background-image: url('/media/onboarding/ob-bg-light.webp'); }
.mob-theme-thumb.dark  { background-image: url('/media/onboarding/ob-bg-dark.webp'); }

.mob-theme-check {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--ob-accent);
  color: #fff;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.mob-theme-opt.active .mob-theme-check {
  opacity: 1;
  transform: scale(1);
}

.mob-theme-name {
  font-size: 13.5px;
  font-weight: 600;
  margin-bottom: 2px;
}

.mob-theme-en {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ob-text-mute);
}

.mob-theme-caption {
  min-height: 40px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--ob-accent-soft);
  border-left: 2px solid var(--ob-accent);
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--ob-text-sub);
  transition: opacity 0.25s ease;
}

/* ---------- 第 3 幕：初遇角色选择 ---------- */
.mob-char-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}

.mob-char-opt {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--ob-border);
  background: var(--ob-input-bg);
  color: var(--ob-text);
  text-align: left;
  cursor: pointer;
  transition: all 0.24s cubic-bezier(0.22, 1, 0.36, 1);
}

.mob-char-opt:active { transform: scale(0.985); }

.mob-char-opt.active {
  border-color: var(--ob-border-active);
  background: var(--ob-accent-soft);
  box-shadow: 0 6px 22px var(--ob-glow);
}

.mob-char-av {
  width: 52px;
  height: 52px;
  border-radius: 11px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--ob-border);
}

.mob-char-info {
  flex: 1;
  min-width: 0;
}

.mob-char-name {
  font-size: 14.5px;
  font-weight: 600;
  margin-bottom: 3px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.mob-char-tag {
  font-size: 12px;
  color: var(--ob-text-sub);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.45;
}

.mob-char-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid var(--ob-border-active);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: transparent;
  transition: all 0.2s ease;
}

.mob-char-opt.active .mob-char-dot {
  background: var(--ob-accent);
  border-color: var(--ob-accent);
  color: #fff;
}

.mob-escape-btn {
  background: none;
  border: none;
  padding: 4px 2px;
  font-size: 12.5px;
  color: var(--ob-accent);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.mob-escape-note {
  margin-top: 8px;
  padding: 9px 12px;
  border-radius: 9px;
  background: var(--ob-accent-soft);
  font-size: 12px;
  line-height: 1.55;
  color: var(--ob-text-sub);
  display: none;
}

.mob-escape-note.show {
  display: block;
  animation: mobFadeUp 0.26s ease;
}

/* ---------- 第 4 幕：月见玩法（GPT Image 梦核物件） ---------- */
.mob-api-list { display: flex; flex-direction: column; gap: 10px; }
.mob-api-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--ob-border);
  background: var(--ob-input-bg);
}
.mob-api-body strong { font-size: 14.5px; font-weight: 600; color: var(--ob-text); margin-right: 8px; }
.mob-api-body em { font-style: normal; font-size: 11px; letter-spacing: 0.04em; color: var(--ob-accent); }
.mob-api-body span { display: block; margin-top: 4px; font-size: 12px; line-height: 1.5; color: var(--ob-text-sub); }
.mob-api-free {
  flex-shrink: 0;
  padding: 3px 11px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--ob-btn-text);
  background: var(--ob-btn-bg);
  box-shadow: 0 4px 14px var(--ob-glow);
}
.mob-api-note { margin: 12px 2px 0; font-size: 12px; line-height: 1.6; color: var(--ob-text-sub); }

.mob-relic-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mob-relic-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--ob-border);
  background: var(--ob-input-bg);
  cursor: pointer;
  transition: all 0.24s ease;
}

.mob-relic-item.active,
.mob-relic-item:hover {
  border-color: var(--ob-border-active);
  background: var(--ob-accent-soft);
  transform: translateY(-1px);
}

.mob-relic-img {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(34, 48, 92, 0.14);
}

.mob-relic-body strong {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ob-text);
  margin-bottom: 3px;
}

.mob-relic-body span {
  display: block;
  font-size: 12px;
  line-height: 1.5;
  color: var(--ob-text-sub);
}

/* ---------- 按钮与底部导航栏 ---------- */
.mob-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin-top: 18px;
}

.mob-btn-primary {
  position: relative;
  flex: 1;
  height: 46px;
  padding: 0 24px;
  border: 1px solid var(--ob-border-active);
  background: var(--ob-btn-bg);
  color: var(--ob-btn-text);
  font-size: 14.5px;
  font-weight: 500;
  letter-spacing: 0.12em;
  cursor: pointer;
  clip-path: polygon(
    10px 0, calc(100% - 10px) 0,
    100% 10px, 100% calc(100% - 10px),
    calc(100% - 10px) 100%, 10px 100%,
    0 calc(100% - 10px), 0 10px
  );
  box-shadow: 0 10px 28px var(--ob-glow);
  transition: transform 0.2s ease, filter 0.2s ease, box-shadow 0.25s ease;
  overflow: hidden;
}

.mob-btn-primary::after {
  content: '';
  position: absolute;
  top: 0;
  left: -75%;
  width: 50%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.28), transparent);
  transform: skewX(-22deg);
  animation: mobShimmer 3.8s ease-in-out infinite;
}

@keyframes mobShimmer {
  0%, 62% { left: -75%; }
  100%    { left: 135%; }
}

.mob-btn-primary:active { transform: scale(0.975); }
.mob-btn-primary:hover  { filter: brightness(1.06); }

.mob-btn-primary.hero {
  flex: none;
  min-width: 208px;
  height: 48px;
}

.mob-btn-ghost {
  height: 46px;
  padding: 0 18px;
  border: 1px solid var(--ob-border);
  background: var(--ob-ghost-bg);
  backdrop-filter: blur(12px);
  color: var(--ob-text-sub);
  font-size: 13.5px;
  letter-spacing: 0.08em;
  cursor: pointer;
  clip-path: polygon(
    8px 0, calc(100% - 8px) 0,
    100% 8px, 100% calc(100% - 8px),
    calc(100% - 8px) 100%, 8px 100%,
    0 calc(100% - 8px), 0 8px
  );
  transition: all 0.2s ease;
}

.mob-btn-ghost:active { transform: scale(0.97); }
.mob-btn-ghost:hover  { border-color: var(--ob-border-active); color: var(--ob-text); }

.mob-skip-link {
  margin-top: 16px;
  background: none;
  border: none;
  color: var(--ob-text-mute);
  font-size: 12.5px;
  letter-spacing: 0.10em;
  cursor: pointer;
  padding: 6px 12px;
  transition: color 0.2s ease;
}

.mob-skip-link:hover { color: var(--ob-text); }

/* 底部常驻品牌落款 */
.mob-footer {
  position: fixed;
  bottom: max(16px, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  z-index: 5;
  pointer-events: none;
  opacity: 0.72;
}

.mob-brand-serif {
  font-family: Georgia, "Times New Roman", "Songti SC", serif;
  font-style: italic;
  font-size: 15px;
  letter-spacing: 0.10em;
  color: var(--ob-text);
  line-height: 1.2;
}

.mob-brand-sub {
  font-size: 9px;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--ob-text-mute);
  margin-top: 3px;
}

/* ---------- L3: 2.2s 电影感落幕幕布 ---------- */
.mob-curtain {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
  text-align: center;
  background: var(--ob-curtain-bg);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.65s cubic-bezier(0.22, 1, 0.36, 1);
}

.mob-curtain.show {
  opacity: 1;
  pointer-events: auto;
}

.mob-curtain-line {
  font-size: 18px;
  font-weight: 400;
  line-height: 1.9;
  white-space: pre-line;
  letter-spacing: 0.12em;
  color: var(--ob-text);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.85s ease, transform 0.95s ease, letter-spacing 1.6s ease;
}

.mob-curtain.show .mob-curtain-line {
  opacity: 1;
  transform: translateY(0);
  letter-spacing: 0.20em;
}

@keyframes mobFadeUp {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* 减少动态偏好适配 */
@media (prefers-reduced-motion: reduce) {
  .mob-bg, .mob-beam, .mob-emblem-halo, .mob-emblem-ring, .mob-emblem-img, .mob-btn-primary::after {
    animation: none !important;
  }
}

@media (max-height: 680px) {
  .mob-stage { padding-top: 22px; padding-bottom: 52px; }
  .mob-card { padding: 18px 18px 16px; }
  .mob-theme-thumb { height: 88px; }
  .mob-emblem-wrap { width: 96px; height: 96px; margin-bottom: 16px; }
  .mob-emblem-img { width: 80px; height: 80px; }
}


/* === modules/deepseek-import.css === */
/* =========================================================
   月见 (MOON) · 「从 DeepSeek 导入」弹窗样式
   ========================================================= */
.dsi-mask {
  position: fixed;
  top: var(--h5-top, 0px);
  left: 0;
  right: 0;
  bottom: 0;
  height: 100%;
  height: var(--h5-height, 100%);
  z-index: 120;
  background: rgba(12, 16, 28, 0.56);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(12px, calc(env(safe-area-inset-top, 0px) + 8px)) 12px max(12px, calc(env(safe-area-inset-bottom, 0px) + 8px));
  box-sizing: border-box;
  overflow: hidden;
  touch-action: pan-y;
}

.dsi-card {
  width: min(520px, 100%);
  max-height: 100%;
  max-height: min(100%, 760px);
  display: flex;
  flex-direction: column;
  background: var(--bg, #ffffff);
  color: var(--fg, #181c28);
  border: 1px solid var(--line, rgba(0, 0, 0, 0.1));
  border-radius: 20px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.28);
  overflow: hidden;
  box-sizing: border-box;
}

.dsi-head {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px 11px;
  border-bottom: 1px solid var(--line, rgba(0, 0, 0, 0.08));
}

.dsi-head h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 650;
}

.dsi-head-sub {
  margin: 3px 0 0;
  font-size: 12px;
  color: var(--fg-3, #7a8296);
}

.dsi-tabs {
  flex-shrink: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 10px 16px 0;
}

.dsi-tab {
  min-height: 38px;
  padding: 6px 8px;
  border-radius: 12px;
  border: 1px solid var(--line, rgba(0, 0, 0, 0.1));
  background: var(--bg-soft, rgba(128, 136, 160, 0.08));
  color: var(--fg-2, #555e73);
  font-size: 12.5px;
  font-weight: 550;
  line-height: 1.25;
  cursor: pointer;
  transition: all 0.18s ease;
}

.dsi-tab.active {
  background: var(--fg, #181c28);
  color: var(--bg, #ffffff);
  border-color: var(--fg, #181c28);
}

.dsi-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
  padding: 12px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dsi-body > * {
  flex-shrink: 0;
}

.dsi-guide {
  padding: 11px 13px;
  border-radius: 13px;
  background: var(--bg-soft, rgba(108, 124, 210, 0.08));
  border: 1px solid var(--line, rgba(108, 124, 210, 0.18));
  font-size: 12.2px;
  line-height: 1.65;
  color: var(--fg-2, #4d566d);
}

.dsi-guide strong {
  color: var(--fg, #181c28);
}

.dsi-drop {
  width: 100%;
  padding: 18px 14px;
  border-radius: 15px;
  border: 1.5px dashed var(--line, rgba(110, 125, 175, 0.42));
  background: var(--bg-soft, rgba(128, 136, 160, 0.05));
  color: var(--fg, #181c28);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.dsi-drop.compact {
  padding: 10px 14px;
  border-radius: 12px;
  flex-direction: row;
  justify-content: center;
  gap: 8px;
}

.dsi-drop:hover,
.dsi-drop.dragover {
  border-color: var(--fg, #5e72c8);
  background: rgba(110, 132, 214, 0.10);
}

.dsi-drop b {
  font-size: 13.5px;
}

.dsi-drop small {
  font-size: 11.8px;
  color: var(--fg-3, #7c8499);
}

.dsi-status {
  font-size: 12.5px;
  padding: 8px 11px;
  border-radius: 10px;
  background: var(--bg-soft, rgba(128, 136, 160, 0.08));
  color: var(--fg-2, #555e73);
}

.dsi-status.ok {
  color: #157347;
  background: rgba(25, 135, 84, 0.12);
}

.dsi-status.err {
  color: #c92a2a;
  background: rgba(220, 53, 69, 0.12);
}

[data-theme="dark"] .dsi-status.ok { color: #7ae5b2; }
[data-theme="dark"] .dsi-status.err { color: #ff8e96; }

.dsi-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dsi-search {
  flex: 1;
  min-width: 0;
  height: 36px;
  padding: 0 11px;
  border-radius: 10px;
  border: 1px solid var(--line, rgba(0, 0, 0, 0.12));
  background: var(--bg, #fff);
  color: var(--fg, #181c28);
  font-size: 13px;
}

.dsi-mini-btn {
  height: 36px;
  padding: 0 11px;
  border-radius: 10px;
  border: 1px solid var(--line, rgba(0, 0, 0, 0.12));
  background: var(--bg-soft, rgba(128, 136, 160, 0.08));
  color: var(--fg, #181c28);
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
}

.dsi-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 220px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: auto;
  touch-action: pan-y;
  padding-right: 2px;
}

.dsi-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 11px;
  border-radius: 12px;
  border: 1px solid var(--line, rgba(0, 0, 0, 0.1));
  background: var(--bg-soft, rgba(128, 136, 160, 0.05));
  cursor: pointer;
}

.dsi-item.checked {
  border-color: var(--fg, #5e72c8);
  background: rgba(102, 124, 214, 0.11);
}

.dsi-item input[type="checkbox"] {
  margin-top: 3px;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.dsi-item-main {
  flex: 1;
  min-width: 0;
}

.dsi-item-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--fg, #181c28);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dsi-item-meta {
  font-size: 11.5px;
  color: var(--fg-3, #7a8296);
  margin-top: 2px;
}

.dsi-item-prev {
  font-size: 12px;
  color: var(--fg-2, #586178);
  margin-top: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.45;
}

.dsi-opts {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding-top: 8px;
  border-top: 1px solid var(--line, rgba(0, 0, 0, 0.08));
}

.dsi-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.dsi-row label {
  flex-shrink: 0;
  color: var(--fg-2, #555e73);
  font-size: 12.5px;
}

.dsi-select,
.dsi-input {
  flex: 1;
  min-width: 0;
  height: 38px;
  padding: 0 11px;
  border-radius: 10px;
  border: 1px solid var(--line, rgba(0, 0, 0, 0.14));
  background: var(--bg, #fff);
  color: var(--fg, #181c28);
  font-size: 13px;
}

.dsi-textarea {
  width: 100%;
  min-height: 160px;
  padding: 11px 12px;
  border-radius: 12px;
  border: 1px solid var(--line, rgba(0, 0, 0, 0.14));
  background: var(--bg, #fff);
  color: var(--fg, #181c28);
  font-size: 13px;
  line-height: 1.55;
  resize: vertical;
  box-sizing: border-box;
}

.dsi-check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--fg-2, #555e73);
  cursor: pointer;
}

.dsi-foot {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px 14px;
  border-top: 1px solid var(--line, rgba(0, 0, 0, 0.08));
  background: var(--bg, #ffffff);
}

.dsi-foot .save-btn {
  flex: 1;
  min-height: 42px;
  border-radius: 12px;
}

.dsi-foot .ghost-btn {
  min-height: 42px;
  padding: 0 16px;
  border-radius: 12px;
}

@media (max-width: 780px) {
  .dsi-search,
  .dsi-select,
  .dsi-input,
  .dsi-textarea {
    font-size: 16px;
  }
}


/* === modules/moon-auth.css === */
/* =========================================================
   月见 (MOON) · 「初见月色」登录 / 注册琉璃碎片主题样式
   与官网 /home 及新人引导保持一致的柔光白瓷 & 深宵星河美学
   仅在 body.auth-required 或 #authSheet.open 时接管视觉层
   ========================================================= */

#authStage,
html:not([data-theme="dark"]) #authSheet,
html:not([data-theme="dark"]) .ma-topbar {
  --ma-bg: #edf1fa;
  --ma-text: #1c243b;
  --ma-sub: rgba(36, 48, 82, 0.76);
  --ma-mute: rgba(54, 68, 108, 0.60);
  --ma-accent: #5266c4;
  --ma-accent-soft: rgba(82, 102, 196, 0.13);
  --ma-glow: rgba(142, 166, 240, 0.42);
  --ma-glass: rgba(252, 253, 255, 0.72);
  --ma-glass-strong: rgba(255, 255, 255, 0.88);
  --ma-input: rgba(255, 255, 255, 0.74);
  --ma-input-focus: rgba(255, 255, 255, 0.95);
  --ma-border: rgba(110, 132, 194, 0.28);
  --ma-border-hi: rgba(255, 255, 255, 0.90);
  --ma-shadow: 0 26px 68px rgba(42, 58, 114, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.88);
  --ma-btn-bg: linear-gradient(135deg, #5266c4 0%, #6d7fd8 100%);
  --ma-btn-shadow: 0 12px 30px rgba(78, 98, 192, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.34);
  --ma-btn-text: #ffffff;
  --ma-serif: "Noto Serif SC", "Songti SC", "STSong", "Source Han Serif SC", Georgia, serif;
}

#authStage {
  position: fixed;
  inset: 0;
  z-index: 129;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  overflow: hidden;
  background: var(--ma-bg);
  transition: opacity 0.45s cubic-bezier(0.22, 1, 0.36, 1), visibility 0.45s ease;
}

html[data-theme="dark"] #authStage,
html[data-theme="dark"] #authSheet,
html[data-theme="dark"] .ma-topbar {
  --ma-bg: #080d22;
  --ma-text: #eef3ff;
  --ma-sub: rgba(214, 226, 255, 0.80);
  --ma-mute: rgba(196, 210, 245, 0.68);
  --ma-accent: #b0cbff;
  --ma-accent-soft: rgba(154, 184, 255, 0.15);
  --ma-glow: rgba(132, 174, 255, 0.44);
  --ma-glass: rgba(13, 21, 52, 0.64);
  --ma-glass-strong: rgba(18, 29, 68, 0.80);
  --ma-input: rgba(9, 16, 40, 0.64);
  --ma-input-focus: rgba(14, 24, 58, 0.88);
  --ma-border: rgba(164, 192, 255, 0.25);
  --ma-border-hi: rgba(206, 224, 255, 0.22);
  --ma-shadow: 0 28px 72px rgba(2, 6, 22, 0.62), inset 0 1px 0 rgba(206, 224, 255, 0.18);
  --ma-btn-bg: linear-gradient(135deg, #7484eb 0%, #5868d6 100%);
  --ma-btn-shadow: 0 12px 34px rgba(96, 114, 242, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.30);
  --ma-btn-text: #ffffff;
  --ma-serif: "Noto Serif SC", "Songti SC", "STSong", "Source Han Serif SC", Georgia, serif;
}

body.auth-required #authStage,
#authStage.is-active {
  opacity: 1;
  visibility: visible;
}

/* L0: 双主题 GPT Image 氛围天空 + 月光束 */
.ma-sky {
  position: absolute;
  inset: -4%;
  background-size: cover;
  background-position: center;
  will-change: transform, opacity;
  animation: maSkyDrift 28s ease-in-out infinite alternate;
  transition: opacity 0.75s cubic-bezier(0.22, 1, 0.36, 1);
}
#authSheet.show .ma-sky.light { background-image: url('/media/onboarding/ob-bg-light.webp'); opacity: 1; }
#authSheet.show .ma-sky.dark  { background-image: url('/media/onboarding/ob-bg-dark.webp'); opacity: 0; }
html[data-theme="dark"] .ma-sky.light { opacity: 0; }
html[data-theme="dark"] .ma-sky.dark  { opacity: 1; }

@keyframes maSkyDrift {
  0%   { transform: scale(1.01) translate3d(0%, 0%, 0); }
  50%  { transform: scale(1.06) translate3d(-1.1%, -0.7%, 0); }
  100% { transform: scale(1.03) translate3d(1.0%, -1.3%, 0); }
}

.ma-veil {
  position: absolute;
  inset: 0;
  background: radial-gradient(64% 56% at 50% 42%, rgba(255, 255, 255, 0.14) 0%, rgba(235, 240, 252, 0.10) 58%, rgba(224, 232, 250, 0.28) 100%);
  transition: background 0.65s ease;
}
html[data-theme="dark"] .ma-veil {
  background: radial-gradient(64% 56% at 50% 42%, rgba(16, 26, 64, 0.14) 0%, rgba(8, 13, 34, 0.42) 62%, rgba(5, 9, 24, 0.68) 100%);
}

.ma-beam {
  position: absolute;
  inset: -16%;
  background: linear-gradient(126deg, transparent 24%, rgba(255, 255, 255, 0.26) 44%, rgba(196, 214, 255, 0.14) 54%, transparent 74%);
  opacity: 0.78;
  animation: maBeamDrift 15s ease-in-out infinite alternate;
}
html[data-theme="dark"] .ma-beam {
  background: linear-gradient(126deg, transparent 26%, rgba(164, 202, 255, 0.16) 45%, rgba(122, 160, 255, 0.08) 56%, transparent 72%);
  opacity: 0.88;
}
@keyframes maBeamDrift {
  0%   { transform: translate3d(-3%, -2%, 0) rotate(-1deg); }
  100% { transform: translate3d(3%, 2%, 0) rotate(1.2deg); }
}

/* L1: 全屏 3 景深琉璃碎片画布 */
#authShardCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* 右上角极简白瓷/深宵切换 + 返回官网胶囊 */
.ma-topbar {
  position: fixed;
  top: max(16px, env(safe-area-inset-top));
  left: 20px;
  right: 20px;
  z-index: 135;
  display: none;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
}
body.auth-required .ma-topbar { display: flex; }

.ma-pill {
  pointer-events: auto;
  height: 36px;
  padding: 0 13px;
  border-radius: 999px;
  border: 1px solid var(--ma-border);
  background: var(--ma-glass);
  color: var(--ma-sub);
  font: inherit;
  font-size: 12.5px;
  letter-spacing: 0.06em;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  text-decoration: none;
  cursor: pointer;
  backdrop-filter: blur(18px) saturate(145%);
  -webkit-backdrop-filter: blur(18px) saturate(145%);
  box-shadow: 0 8px 22px rgba(24, 36, 82, 0.10), inset 0 1px 0 var(--ma-border-hi);
  transition: transform 0.22s ease, background 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}
.ma-pill:hover {
  transform: translateY(-1px);
  background: var(--ma-glass-strong);
  color: var(--ma-text);
  border-color: var(--ma-accent);
}
.ma-pill svg { width: 14px; height: 14px; flex-shrink: 0; }
.ma-pill img { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; }
.ma-brand-pill { padding-left: 7px; color: var(--ma-text); }
.ma-brand-pill strong { font-family: "Noto Serif SC", "Songti SC", "STSong", Georgia, serif; font-weight: 500; letter-spacing: 0.2em; font-size: 14px; }

/* ---------------- 接管 #authMask 与 #authSheet ---------------- */
body.auth-required {
  background: transparent !important;
}
body.auth-required #authMask {
  background: transparent !important;
  pointer-events: none;
}
body.auth-required #authSheet {
  background: transparent !important;
  padding: max(40px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-left), env(safe-area-inset-right)) max(40px, env(safe-area-inset-bottom)) !important;
}

/* 琉璃磨砂卡片容器 */
body.auth-required .auth-form-panel {
  position: relative;
  max-width: 430px !important;
  padding: 34px 30px 26px !important;
  border-radius: 26px !important;
  background: var(--ma-glass) !important;
  border: 1px solid var(--ma-border) !important;
  backdrop-filter: blur(26px) saturate(155%) !important;
  -webkit-backdrop-filter: blur(26px) saturate(155%) !important;
  box-shadow: var(--ma-shadow) !important;
  color: var(--ma-text) !important;
  animation: maCardWake 0.65s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes maCardWake {
  from { opacity: 0; transform: translateY(16px) scale(0.985); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* 四角精致星芒装饰（延续官网与引导视觉基因） */
body.auth-required .auth-form-panel::before,
body.auth-required .auth-form-panel::after {
  content: "✦";
  position: absolute;
  font-size: 10px;
  color: var(--ma-accent);
  opacity: 0.48;
  pointer-events: none;
}
body.auth-required .auth-form-panel::before { top: 14px; left: 16px; }
body.auth-required .auth-form-panel::after  { bottom: 14px; right: 16px; }

/* 卡片顶部月相徽章（仅在未登录全屏态展示） */
.ma-card-emblem {
  display: none;
  flex-direction: column;
  align-items: center;
  margin-bottom: 14px;
}
body.auth-required .ma-card-emblem { display: flex; }

.ma-emblem-shell {
  position: relative;
  width: 66px;
  height: 66px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
}
.ma-emblem-halo {
  position: absolute;
  inset: -12px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--ma-glow) 0%, transparent 68%);
  animation: maHaloPulse 4.2s ease-in-out infinite;
}
@keyframes maHaloPulse {
  0%, 100% { transform: scale(0.92); opacity: 0.68; }
  50%      { transform: scale(1.10); opacity: 1; }
}
.ma-emblem-ring {
  position: absolute;
  inset: -4px;
  width: calc(100% + 8px);
  height: calc(100% + 8px);
  color: var(--ma-accent);
  opacity: 0.72;
  animation: maOrbit 28s linear infinite;
}
@keyframes maOrbit { to { transform: rotate(360deg); } }
.ma-emblem-img {
  position: relative;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 22px var(--ma-glow), 0 0 0 1px var(--ma-border);
}
.ma-eyebrow {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.36em;
  padding-left: 0.36em;
  color: var(--ma-accent);
}

/* 标题区 */
body.auth-required #authSheet .sheet-head {
  margin-bottom: 24px !important;
  justify-content: center !important;
  text-align: center !important;
}
body.auth-required #authSheet .sheet-head > div { width: 100%; }
body.auth-required #authSheet #authClose { display: none !important; }

body.auth-required #authSheet .sheet-head h3 {
  font-family: var(--ma-serif) !important;
  font-size: 26px !important;
  font-weight: 400 !important;
  letter-spacing: 0.14em !important;
  padding-left: 0.14em;
  line-height: 1.35 !important;
  color: var(--ma-text) !important;
}
body.auth-required #authSheet .sheet-sub {
  margin: 6px 0 0 !important;
  font-size: 13px !important;
  letter-spacing: 0.04em;
  color: var(--ma-sub) !important;
}

/* 表单域与磨砂输入框 */
body.auth-required #authSheet .field { margin-bottom: 16px !important; }
body.auth-required #authSheet .field > :is(span, label) {
  margin: 0 0 7px !important;
  font-size: 13px !important;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--ma-text) !important;
}
body.auth-required #authSheet .field > span small {
  color: var(--ma-mute) !important;
  font-weight: 400;
}

body.auth-required #authSheet input {
  min-height: 48px !important;
  padding: 12px 15px !important;
  border-radius: 14px !important;
  border: 1px solid var(--ma-border) !important;
  background: var(--ma-input) !important;
  color: var(--ma-text) !important;
  font-size: 15px !important;
  transition: border-color 0.22s ease, background 0.22s ease, box-shadow 0.22s ease;
}
body.auth-required #authSheet input::placeholder {
  color: var(--ma-mute) !important;
}
body.auth-required #authSheet input:focus {
  outline: none !important;
  border-color: var(--ma-accent) !important;
  background: var(--ma-input-focus) !important;
  box-shadow: 0 0 0 3px var(--ma-accent-soft) !important;
}

/* 验证码按钮 & 显示密码 */
body.auth-required #authSheet .code-row {
  align-items: stretch !important;
}
body.auth-required #authSheet #auSend {
  height: auto !important;
  align-self: stretch;
  min-height: 48px !important;
  padding: 0 16px !important;
  border-radius: 14px !important;
  border: 1px solid var(--ma-border) !important;
  background: var(--ma-glass-strong) !important;
  color: var(--ma-accent) !important;
  font-size: 13px !important;
  font-weight: 500;
  letter-spacing: 0.04em;
  transition: border-color 0.22s ease, background 0.22s ease, transform 0.18s ease;
}
body.auth-required #authSheet #auSend:hover:not(:disabled) {
  border-color: var(--ma-accent) !important;
  transform: translateY(-1px);
}
body.auth-required #authSheet #auPasswordToggle {
  color: var(--ma-sub) !important;
  font-size: 12.5px !important;
}
body.auth-required #authSheet #auPasswordToggle:hover {
  color: var(--ma-accent) !important;
}

/* 提示与报错文字 */
body.auth-required #authSheet #authOut {
  color: var(--ma-accent) !important;
  font-size: 12.5px !important;
  text-align: center;
}

/* 琉璃流光主提交按钮 */
body.auth-required #authSheet #auGo {
  position: relative;
  overflow: hidden;
  min-height: 50px !important;
  margin-top: 8px !important;
  border-radius: 999px !important;
  border: 1px solid rgba(255, 255, 255, 0.30) !important;
  background: var(--ma-btn-bg) !important;
  color: var(--ma-btn-text) !important;
  font-size: 15px !important;
  font-weight: 600 !important;
  letter-spacing: 0.10em;
  box-shadow: var(--ma-btn-shadow) !important;
  transition: transform 0.24s cubic-bezier(0.22, 1, 0.36, 1), filter 0.24s ease, box-shadow 0.24s ease;
}
body.auth-required #authSheet #auGo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(112deg, transparent 22%, rgba(255, 255, 255, 0.34) 48%, transparent 72%);
  transform: translateX(-120%);
  transition: transform 0.72s cubic-bezier(0.22, 1, 0.36, 1);
}
body.auth-required #authSheet #auGo:hover:not(:disabled) {
  transform: translateY(-1.5px);
  filter: brightness(1.05);
}
body.auth-required #authSheet #auGo:hover:not(:disabled)::after {
  transform: translateX(120%);
}
body.auth-required #authSheet #auGo:active:not(:disabled) {
  transform: translateY(0) scale(0.985);
}

/* 切换登录/注册/忘记密码行 */
body.auth-required #authSheet .auth-switch {
  margin: 16px 0 0 !important;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}
body.auth-required #authSheet #auToggle,
body.auth-required #authSheet #auForgot {
  min-height: 36px !important;
  padding: 4px 6px !important;
  font-size: 13px !important;
  color: var(--ma-sub) !important;
  background: transparent !important;
  border: 0 !important;
  cursor: pointer;
  transition: color 0.2s ease, opacity 0.2s ease;
}
body.auth-required #authSheet #auToggle {
  color: var(--ma-accent) !important;
  font-weight: 500;
}
body.auth-required #authSheet #auToggle:hover,
body.auth-required #authSheet #auForgot:hover {
  color: var(--ma-accent) !important;
  opacity: 0.82;
}

/* 底部权益与官网链接 */
body.auth-required .auth-free-note {
  margin: 18px 0 0 !important;
  padding-top: 16px;
  border-top: 1px solid var(--ma-border);
  font-size: 12px !important;
  color: var(--ma-mute) !important;
  letter-spacing: 0.03em;
}
body.auth-required .auth-free-note a.auth-home-link {
  color: var(--ma-accent) !important;
  text-decoration: none;
  border-bottom: 1px dashed currentColor;
  padding-bottom: 1px;
  white-space: nowrap;
}

@media (max-width: 520px) {
  .ma-topbar { top: max(12px, env(safe-area-inset-top)); left: 14px; right: 14px; }
  .ma-pill { height: 34px; padding: 0 11px; font-size: 12px; }
  body.auth-required #authSheet {
    padding: max(60px, calc(env(safe-area-inset-top) + 52px)) 14px max(24px, env(safe-area-inset-bottom)) !important;
  }
  body.auth-required .auth-form-panel {
    margin-block: auto !important;
    padding: 26px 20px 22px !important;
    border-radius: 22px !important;
  }
  .ma-emblem-shell { width: 58px; height: 58px; margin-bottom: 8px; }
  .ma-emblem-img { width: 46px; height: 46px; }
  body.auth-required #authSheet .sheet-head { margin-bottom: 18px !important; }
  body.auth-required #authSheet .sheet-head h3 { font-size: 23px !important; }
  body.auth-required #authSheet .field { margin-bottom: 14px !important; }
  body.auth-required #authSheet input { min-height: 46px !important; font-size: 16px !important; }
  body.auth-required #authSheet #auSend { min-height: 46px !important; padding: 0 12px !important; }
  body.auth-required #authSheet #auGo { min-height: 48px !important; }
  body.auth-required .auth-free-note { font-size: 11px !important; letter-spacing: 0.01em; line-height: 1.65; }
  body.auth-required .auth-free-note span { padding: 0 4px !important; }
}

@media (prefers-reduced-motion: reduce) {
  .ma-sky, .ma-beam, .ma-emblem-halo, .ma-emblem-ring, body.auth-required .auth-form-panel {
    animation: none !important;
  }
}


/* === modules/immersive-chat.css === */
/* ==========================================================================
   月见 MOON · 沉浸聊天模式 (Immersive Chat · modules/immersive-chat.css)
   全屏角色立绘 + 上半屏清透留白 / 下半屏渐进磨砂柔焦 + 无框流式长文 + 底部悬浮毛玻璃胶囊
   ========================================================================== */

.vn-stage-box {
  display: none;
}

/* 仅在聊天界面（桌面端，或移动端 data-h5-page='chat'）且未打开画图时启用沉浸聊天全屏舞台 */
body.vn-stage-active .main {
  position: relative;
  overflow: hidden;
  background: #0b0d13 !important;
}

body.vn-stage-active #messages {
  display: none !important;
}

body.vn-stage-active.h5-active[data-h5-page='chat'] .h5-chat-intro,
body.vn-stage-active:not(.h5-active) .chat-head {
  display: none !important;
}

body.vn-stage-active .vn-stage-box {
  display: block;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  overflow: hidden;
  background: #0b0d13;
  color: #ffffff;
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
}

body.h5-active:not([data-h5-page='chat']) .vn-stage-box,
.main:has(#drawView.show) .vn-stage-box {
  display: none !important;
}

/* ---------- 1. 四层电影级立绘与渐进柔焦背景 ---------- */
.vn-stage-backdrop {
  position: absolute;
  inset: -44px;
  background-size: cover;
  background-position: center 20%;
  background-repeat: no-repeat;
  filter: blur(28px) brightness(.44) saturate(1.16);
  transform: scale(1.14);
  z-index: 0;
  pointer-events: none;
}

.vn-stage-portrait {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 16%;
  z-index: 1;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
}

@media (min-width: 781px) {
  .vn-stage-backdrop {
    filter: blur(36px) brightness(.26) saturate(1.1);
  }
  .vn-stage-portrait {
    inset: 0 auto 0 50%;
    transform: translateX(-50%);
    width: min(560px, 76vw);
    height: 100%;
    object-fit: cover;
    object-position: center 16%;
    -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 10%, #000 90%, transparent 100%);
    mask-image: linear-gradient(90deg, transparent 0%, #000 10%, #000 90%, transparent 100%);
  }
}

/* 下半屏渐进式摄影级磨砂虚化：上半屏保留清透眼神，28% 起自然化开成柔雾背景 */
.vn-stage-blur-veil {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  backdrop-filter: blur(16px) saturate(1.14);
  -webkit-backdrop-filter: blur(16px) saturate(1.14);
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, transparent 26%, rgba(0, 0, 0, .44) 38%, #000 52%, #000 100%);
  mask-image: linear-gradient(180deg, transparent 0%, transparent 26%, rgba(0, 0, 0, .44) 38%, #000 52%, #000 100%);
  transition: opacity .26s ease;
}

/* 顶部微暗保障图标清晰 + 中上脸部清透 + 下半屏温润柔雾暗角托住纯白长文 */
.vn-stage-scrim {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    rgba(10, 12, 18, .32) 0%,
    rgba(10, 12, 18, .06) 15%,
    rgba(10, 12, 18, .03) 26%,
    rgba(12, 14, 20, .42) 39%,
    rgba(10, 12, 18, .66) 66%,
    rgba(8, 10, 16, .82) 100%
  );
  transition: opacity .26s ease;
}

@media (min-width: 781px) {
  .vn-stage-scrim {
    background:
      linear-gradient(
        90deg,
        rgba(7, 9, 14, .74) 0%,
        rgba(7, 9, 14, .22) 18%,
        transparent 34%,
        transparent 66%,
        rgba(7, 9, 14, .22) 82%,
        rgba(7, 9, 14, .74) 100%
      ),
      linear-gradient(
        180deg,
        rgba(10, 12, 18, .32) 0%,
        rgba(10, 12, 18, .06) 15%,
        rgba(10, 12, 18, .03) 26%,
        rgba(12, 14, 20, .42) 39%,
        rgba(10, 12, 18, .66) 66%,
        rgba(8, 10, 16, .82) 100%
      );
  }
}

/* ---------- 2. 顶部悬浮毛玻璃胶囊栏 ---------- */
.vn-topbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 7;
  padding: calc(var(--safe-top, env(safe-area-inset-top, 0px)) + 10px) 12px 8px;
  pointer-events: none;
}

.vn-topbar-inner {
  max-width: 560px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.vn-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.vn-top-left {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex: 1 1 auto;
  pointer-events: auto;
}

.vn-top-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: none;
  pointer-events: auto;
}

.vn-icon-bare {
  width: 34px;
  height: 36px;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, .94);
  filter: drop-shadow(0 1px 4px rgba(0, 0, 0, .48));
  cursor: pointer;
  border-radius: 50%;
  transition: transform .12s ease, opacity .15s ease;
}

.vn-icon-bare:active {
  transform: scale(.92);
  opacity: .78;
}

/* 角色毛玻璃胶囊（头像 + 角色名/@副标题 + 内嵌白色＋按钮） */
.vn-char-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  max-width: 196px;
  padding: 3px 5px 3px 3px;
  border-radius: 999px;
  background: rgba(18, 20, 28, .42);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border: 1px solid rgba(255, 255, 255, .14);
  box-shadow: 0 4px 16px rgba(0, 0, 0, .18);
}

.vn-char-trigger {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.vn-char-ava {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  flex: none;
  object-fit: cover;
  object-position: center 20%;
  border: 1px solid rgba(255, 255, 255, .28);
  background: rgba(255, 255, 255, .14);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  overflow: hidden;
}

.vn-char-ava img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
  display: block;
}

.vn-char-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.22;
}

.vn-char-meta strong {
  font-size: 13px;
  font-weight: 600;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 84px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .32);
}

.vn-char-meta small {
  font-size: 10.5px;
  color: rgba(255, 255, 255, .74);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 84px;
}

.vn-plus-circle {
  width: 26px;
  height: 26px;
  flex: none;
  border-radius: 50%;
  border: 0;
  background: #ffffff;
  color: #161822;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .2);
  transition: transform .12s ease, opacity .15s ease;
}

.vn-plus-circle:active {
  transform: scale(.9);
}

/* 顶栏毛玻璃圆形功能钮（收藏心形 + 历史消息计数气泡） */
.vn-circle-btn {
  position: relative;
  width: 36px;
  height: 36px;
  flex: none;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .14);
  background: rgba(18, 20, 28, .40);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
  transition: background .15s ease, transform .12s ease;
}

.vn-circle-btn:active {
  transform: scale(.92);
}

.vn-circle-btn.is-faved {
  color: #ff6b8b;
}

.vn-msg-badge {
  position: absolute;
  top: -3px;
  right: -5px;
  min-width: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: rgba(16, 18, 26, .68);
  border: 1px solid rgba(255, 255, 255, .18);
  color: #ffffff;
  font-size: 9.5px;
  font-weight: 600;
  line-height: 15px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .4);
  pointer-events: none;
}

/* 第二行：模型小胶囊 + 轻巧清屏/切回气泡胶囊（左缘与角色胶囊精准对齐） */
.vn-sub-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-left: 40px;
  pointer-events: auto;
  flex-wrap: wrap;
}

@media (min-width: 960px) {
  .vn-top-left > .vn-icon-bare {
    display: none;
  }
  .vn-sub-row {
    padding-left: 0;
  }
}

.vn-model-pill,
.vn-sub-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .14);
  background: rgba(18, 20, 28, .38);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  color: rgba(255, 255, 255, .90);
  font: inherit;
  font-size: 11.5px;
  line-height: 1.4;
  cursor: pointer;
  white-space: nowrap;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .35);
  transition: background .15s ease, transform .12s ease;
}

.vn-sub-pill {
  padding: 3px 9px;
  color: rgba(255, 255, 255, .78);
}

.vn-model-pill:hover,
.vn-sub-pill:hover {
  background: rgba(28, 32, 44, .56);
}

.vn-model-pill:active,
.vn-sub-pill:active {
  transform: scale(.95);
}

/* ---------- 3. 全屏流式长文消息区（无框小说排版 + 上缘柔化渐隐） ---------- */
.vn-feed {
  position: absolute;
  inset: 0;
  z-index: 4;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  scrollbar-width: none;
  -webkit-mask-image: linear-gradient(
    180deg,
    transparent 0%,
    transparent 17%,
    rgba(0, 0, 0, .28) 26%,
    #000 36%,
    #000 84%,
    rgba(0, 0, 0, .38) 91%,
    rgba(0, 0, 0, .08) 96%,
    transparent 100%
  );
  mask-image: linear-gradient(
    180deg,
    transparent 0%,
    transparent 17%,
    rgba(0, 0, 0, .28) 26%,
    #000 36%,
    #000 84%,
    rgba(0, 0, 0, .38) 91%,
    rgba(0, 0, 0, .08) 96%,
    transparent 100%
  );
  transition: opacity .26s ease, transform .26s ease;
}

.vn-feed::-webkit-scrollbar {
  display: none;
}

.vn-feed-inner {
  max-width: 560px;
  margin: 0 auto;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: clamp(235px, 37vh, 355px) 20px calc(112px + env(safe-area-inset-bottom, 0px));
  box-sizing: border-box;
}

/* AI 角色长文：完全无框、无气泡底，像电影字幕/小说直铺在柔雾背景上 */
.vn-turn-ai {
  width: 100%;
  margin: 6px 0 18px;
  color: rgba(255, 255, 255, .94);
  font-size: 15.5px;
  line-height: 1.84;
  letter-spacing: .015em;
  text-shadow: 0 1px 6px rgba(0, 0, 0, .55), 0 0 18px rgba(0, 0, 0, .26);
  word-break: break-word;
}

.vn-turn-ai .vn-para {
  margin: 0 0 13px;
  white-space: pre-wrap;
}

.vn-turn-ai .vn-para:last-child {
  margin-bottom: 0;
}

.vn-turn-ai .rp-paren {
  display: inline;
  color: rgba(228, 232, 246, .82);
  font-size: .96em;
}

.vn-turn-ai .vn-quote {
  color: #ffffff;
}

/* 用户消息：右侧半透明毛玻璃小气泡，轻盈区分双方又不破坏沉浸感 */
.vn-turn-me {
  align-self: flex-end;
  max-width: 82%;
  margin: 8px 0 18px auto;
  padding: 9px 14px;
  border-radius: 18px 18px 5px 18px;
  background: rgba(255, 255, 255, .16);
  border: 1px solid rgba(255, 255, 255, .18);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  color: #ffffff;
  font-size: 14.5px;
  line-height: 1.62;
  white-space: pre-wrap;
  word-break: break-word;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .28);
  box-shadow: 0 4px 16px rgba(0, 0, 0, .18);
}

.vn-turn-me .vn-para {
  margin: 0 0 6px;
}

.vn-turn-me .vn-para:last-child {
  margin-bottom: 0;
}

/* 照片、表情包与红包在沉浸流中的适配 */
.vn-photo {
  display: block;
  max-width: min(210px, 66vw);
  max-height: 220px;
  border-radius: 14px;
  margin: 6px 0 10px;
  object-fit: cover;
  cursor: zoom-in;
  border: 1px solid rgba(255, 255, 255, .22);
  box-shadow: 0 6px 20px rgba(0, 0, 0, .28);
}

.vn-turn-ai .msg-redpacket,
.vn-turn-me .msg-redpacket {
  margin: 6px 0 10px;
  max-width: 260px;
}

/* 末条 AI 回复下方的超轻操作行 */
.vn-last-ops {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  opacity: .72;
  transition: opacity .15s ease;
}

.vn-last-ops:hover,
.vn-last-ops:focus-within {
  opacity: 1;
}

.vn-op-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .16);
  background: rgba(255, 255, 255, .09);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: rgba(255, 255, 255, .88);
  font: inherit;
  font-size: 11.5px;
  cursor: pointer;
  transition: background .15s ease, transform .12s ease;
}

.vn-op-pill:hover:not(:disabled) {
  background: rgba(255, 255, 255, .18);
}

.vn-op-pill:disabled {
  opacity: .38;
  cursor: default;
}

.vn-empty-hint {
  text-align: center;
  padding: 28px 12px 18px;
  color: rgba(255, 255, 255, .64);
  font-size: 14px;
  text-shadow: 0 1px 6px rgba(0, 0, 0, .48);
}

/* 正在输入动态点 */
.vn-typing-dots {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 2px;
  color: rgba(255, 255, 255, .84);
  font-size: 13.5px;
}

.vn-typing-dots i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .86);
  animation: vnDot 1.1s ease-in-out infinite;
}

.vn-typing-dots i:nth-child(2) { animation-delay: .18s; }
.vn-typing-dots i:nth-child(3) { animation-delay: .36s; }

@keyframes vnDot {
  0%, 80%, 100% { opacity: .28; transform: scale(.8); }
  40% { opacity: 1; transform: scale(1.1); }
}

.vn-turn-live .cursor {
  display: inline-block;
  width: 2px;
  height: 15px;
  margin-left: 3px;
  vertical-align: -2px;
  background: rgba(255, 255, 255, .88);
  animation: vnBlink .9s steps(1) infinite;
}

@keyframes vnBlink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

/* ---------- 4. 清屏赏图模式（隐藏文字、柔雾与输入框，恢复钮紧贴右上角） ---------- */
.vn-stage-box.is-clean .vn-stage-blur-veil,
.vn-stage-box.is-clean .vn-stage-scrim,
.vn-stage-box.is-clean .vn-feed {
  opacity: 0;
  pointer-events: none;
}

.vn-stage-box.is-clean .vn-top-row,
.vn-stage-box.is-clean .vn-model-pill,
.vn-stage-box.is-clean .vn-exit-bubble-pill {
  display: none;
}

.vn-stage-box.is-clean .vn-sub-row {
  padding-left: 0;
  justify-content: flex-end;
}

.vn-stage-box.is-clean .vn-clean-pill {
  background: rgba(16, 18, 26, .54);
  color: #ffffff;
  border-color: rgba(255, 255, 255, .28);
  padding: 5px 12px;
}

.vn-clean-tap-layer {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 5;
  cursor: pointer;
}

.vn-stage-box.is-clean .vn-clean-tap-layer {
  display: block;
}

body.vn-stage-active.vn-stage-clean #main .composer-wrap {
  opacity: 0 !important;
  pointer-events: none !important;
  transform: translateY(14px);
}

/* ---------- 5. 底部悬浮毛玻璃输入胶囊（用 #main ID 权重彻底压过气泡包/液态玻璃主题浅色覆盖） ---------- */
body.vn-stage-active:not(.h5-active) #main .composer-wrap,
body.vn-stage-active.h5-active[data-h5-page='chat'] #main .composer-wrap {
  position: absolute !important;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 8;
  background: transparent !important;
  border-top: 0 !important;
  box-shadow: none !important;
  padding: 6px 14px max(12px, env(safe-area-inset-bottom)) !important;
  pointer-events: none;
  transition: opacity .24s ease, transform .24s ease, background .2s ease;
}

body.vn-stage-active.plus-tray-open:not(.h5-active) #main .composer-wrap,
body.vn-stage-active.plus-tray-open.h5-active[data-h5-page='chat'] #main .composer-wrap {
  background: linear-gradient(180deg, transparent 0%, rgba(7, 9, 14, .88) 14%, rgba(7, 9, 14, .98) 100%) !important;
}

body.vn-stage-active #main .composer-wrap > * {
  pointer-events: auto;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}

body.vn-stage-active #main .composer-wrap .hint {
  display: none !important;
}

body.vn-stage-active:not(.h5-active) #main .composer,
body.vn-stage-active.h5-active[data-h5-page='chat'] #main .composer {
  min-height: 48px !important;
  padding: 4px 6px 4px 8px !important;
  gap: 6px !important;
  border-radius: 999px !important;
  background: rgba(24, 26, 36, .58) !important;
  border: 1px solid rgba(255, 255, 255, .16) !important;
  backdrop-filter: blur(22px) saturate(145%) !important;
  -webkit-backdrop-filter: blur(22px) saturate(145%) !important;
  box-shadow:
    0 8px 28px rgba(0, 0, 0, .28),
    inset 0 1px 0 rgba(255, 255, 255, .12) !important;
}

body.vn-stage-active:not(.h5-active) #main .composer:focus-within,
body.vn-stage-active.h5-active[data-h5-page='chat'] #main .composer:focus-within {
  background: rgba(24, 26, 38, .72) !important;
  border-color: rgba(255, 255, 255, .28) !important;
}

/* 按钮排布对齐参考图：[ + ]  输入消息，或按住说话  [ 😊 ] [ 🎤 ] [ ➤ ] */
body.vn-stage-active #main .composer #composerPlusBtn { order: 1; }
body.vn-stage-active #main .composer #input,
body.vn-stage-active #main .composer #voiceHoldBtn { order: 2; flex: 1 1 auto; }
body.vn-stage-active #main .composer #stickerBtn { order: 3; }
body.vn-stage-active #main .composer #voiceBtn { order: 4; }
body.vn-stage-active #main .composer #sendBtn { order: 5; }

body.vn-stage-active #main .composer #input {
  color: #ffffff !important;
  background: transparent !important;
  font-size: 14.5px !important;
  min-height: 38px !important;
  padding: 8px 2px !important;
  caret-color: #ffffff;
}

body.vn-stage-active #main .composer #input::placeholder {
  color: rgba(255, 255, 255, .64) !important;
}

body.vn-stage-active #main .composer .composer-tool-btn {
  width: 34px !important;
  height: 34px !important;
  border-radius: 50% !important;
  background: transparent !important;
  border: 0 !important;
  color: rgba(255, 255, 255, .86) !important;
}

body.vn-stage-active #main .composer .composer-tool-btn:hover,
body.vn-stage-active #main .composer .composer-tool-btn.is-open {
  background: rgba(255, 255, 255, .14) !important;
  color: #ffffff !important;
}

body.vn-stage-active #main .composer .voice-hold-btn {
  background: rgba(255, 255, 255, .12) !important;
  border: 1px solid rgba(255, 255, 255, .18) !important;
  color: #ffffff !important;
  height: 38px !important;
  border-radius: 999px !important;
}

body.vn-stage-active #main .composer #sendBtn {
  width: 36px !important;
  height: 36px !important;
  border-radius: 50% !important;
  background: rgba(255, 255, 255, .94) !important;
  color: #141720 !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .24) !important;
}

body.vn-stage-active #main .composer #sendBtn.is-cont {
  background: rgba(255, 255, 255, .14) !important;
  border: 1px solid rgba(255, 255, 255, .20) !important;
  color: rgba(255, 255, 255, .92) !important;
  box-shadow: none !important;
}

body.vn-stage-active #main .composer #sendBtn:disabled {
  background: rgba(255, 255, 255, .14) !important;
  color: rgba(255, 255, 255, .44) !important;
  box-shadow: none !important;
  opacity: 1 !important;
}

/* 展开的 ＋ 面板、表情托盘、灵感回复条、照片预览条统一深色高对比毛玻璃 */
body.vn-stage-active #main .composer-plus-tray,
body.vn-stage-active #main .composer-sticker-tray,
body.vn-stage-active #main .inspire-tray,
body.vn-stage-active #main .photo-preview-bar {
  background: rgba(16, 18, 26, .90) !important;
  border: 1px solid rgba(255, 255, 255, .14) !important;
  backdrop-filter: blur(24px) saturate(145%) !important;
  -webkit-backdrop-filter: blur(24px) saturate(145%) !important;
  color: #ffffff !important;
  border-radius: 20px !important;
  margin-top: 8px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .42) !important;
}

body.vn-stage-active #main .composer-plus-tray .plus-tile {
  color: rgba(255, 255, 255, .92) !important;
}

body.vn-stage-active #main .composer-plus-tray .plus-tile-ico {
  background: rgba(255, 255, 255, .11) !important;
  border: 1px solid rgba(255, 255, 255, .15) !important;
  color: #ffffff !important;
}

body.vn-stage-active #main .inspire-tray .inspire-head,
body.vn-stage-active #main .inspire-tray .inspire-item,
body.vn-stage-active #main .photo-preview-info b,
body.vn-stage-active #main .photo-preview-info span {
  color: rgba(255, 255, 255, .92) !important;
}

body.vn-stage-active #main .inspire-tray .inspire-item {
  background: rgba(255, 255, 255, .10) !important;
  border-color: rgba(255, 255, 255, .15) !important;
}

body.vn-stage-active #main .composer-wrap .notice {
  background: rgba(16, 18, 26, .80) !important;
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, .16) !important;
  backdrop-filter: blur(14px);
}


/* === modules/square-detail.css === */
/* ==========================================================================
   月见 MOON · 广场角色卡 / 剧本详情页视觉重塑 (modules/square-detail.css)
   全幅电影感立绘头图 + 上浮白瓷编辑卡片 + 单行作者统计 + 底部唯一悬浮主操作坞
   兼容瓷白极简 / 深宵暗黑 / 液态玻璃三套皮肤
   ========================================================================== */

.h5-active[data-h5-page='post'] #postSheet {
  --sqd-bg: #ffffff;
  --sqd-sheet-bg: #ffffff;
  --sqd-card-bg: #f6f7fb;
  --sqd-chip-bg: #f1f3f9;
  --sqd-quote-bg: linear-gradient(135deg, rgba(99, 108, 226, .08) 0%, rgba(140, 152, 240, .03) 100%);
  --sqd-line: rgba(15, 23, 42, .08);
  --sqd-ink: #141722;
  --sqd-body: #34394a;
  --sqd-sub: #747c92;
  --sqd-accent: #5561d6;
  --sqd-dock-bg: rgba(255, 255, 255, .90);
  --sqd-cta-bg: linear-gradient(135deg, #1b1f2e 0%, #2b3148 100%);
  --sqd-cta-fg: #ffffff;

  top: var(--h5-top, 0px) !important;
  bottom: auto !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  height: var(--h5-height, 100dvh) !important;
  max-height: none !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: var(--sqd-bg) !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  -webkit-overflow-scrolling: touch;
}

:root[data-theme='dark'] .h5-active[data-h5-page='post'] #postSheet {
  --sqd-bg: #131622;
  --sqd-sheet-bg: #131622;
  --sqd-card-bg: rgba(255, 255, 255, .055);
  --sqd-chip-bg: rgba(255, 255, 255, .08);
  --sqd-quote-bg: linear-gradient(135deg, rgba(132, 144, 255, .14) 0%, rgba(132, 144, 255, .04) 100%);
  --sqd-line: rgba(255, 255, 255, .10);
  --sqd-ink: #f4f6fc;
  --sqd-body: rgba(235, 239, 252, .88);
  --sqd-sub: rgba(196, 204, 228, .68);
  --sqd-accent: #9aa7ff;
  --sqd-dock-bg: rgba(19, 22, 34, .92);
  --sqd-cta-bg: linear-gradient(135deg, #f3f5fc 0%, #dde3f6 100%);
  --sqd-cta-fg: #121521;
}

/* 顶部悬浮毛玻璃返回 / 分享 / 更多栏（上滑超过头图后平滑转为实体磨砂顶栏防遮字） */
.h5-active[data-h5-page='post'] #postSheet .sheet-head {
  position: fixed !important;
  top: var(--h5-top, 0px);
  left: 0;
  right: 0;
  z-index: 48;
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  justify-content: space-between !important;
  gap: 10px;
  min-height: 0 !important;
  margin: 0 !important;
  padding: calc(var(--safe-top, env(safe-area-inset-top, 0px)) + 10px) 14px 10px !important;
  pointer-events: none;
  background: transparent !important;
  border-bottom: 1px solid transparent !important;
  transition: background .2s ease, border-color .2s ease;
}

.h5-active[data-h5-page='post'] #postSheet.is-scrolled .sheet-head {
  background: var(--sqd-dock-bg) !important;
  backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  border-bottom-color: var(--sqd-line) !important;
  pointer-events: auto;
}

.h5-active[data-h5-page='post'] #postSheet .sheet-head > div:not(.sqd-top-right) {
  display: none !important;
}

.h5-active[data-h5-page='post'] #postSheet .sqd-top-title {
  display: block !important;
  flex: 1 1 auto;
  min-width: 0;
  font-size: 15.5px;
  font-weight: 700;
  color: var(--sqd-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity .2s ease, transform .2s ease;
  pointer-events: none;
}

.h5-active[data-h5-page='post'] #postSheet.is-scrolled .sqd-top-title {
  opacity: 1;
  transform: none;
}

.h5-active[data-h5-page='post'] #postSheet #poClose,
.h5-active[data-h5-page='post'] #postSheet .sqd-top-btn {
  pointer-events: auto;
  width: 38px !important;
  height: 38px !important;
  min-width: 38px !important;
  min-height: 38px !important;
  padding: 0 !important;
  border-radius: 50% !important;
  border: 1px solid rgba(255, 255, 255, .24) !important;
  background: rgba(16, 19, 28, .44) !important;
  backdrop-filter: blur(16px) saturate(145%) !important;
  -webkit-backdrop-filter: blur(16px) saturate(145%) !important;
  color: #ffffff !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .20);
  cursor: pointer;
  transition: transform .12s ease, background .2s ease, color .2s ease, border-color .2s ease;
}

.h5-active[data-h5-page='post'] #postSheet.is-scrolled #poClose,
.h5-active[data-h5-page='post'] #postSheet.is-scrolled .sqd-top-btn {
  background: var(--sqd-card-bg) !important;
  border-color: var(--sqd-line) !important;
  color: var(--sqd-ink) !important;
  box-shadow: none;
}

.h5-active[data-h5-page='post'] #postSheet #poClose:active,
.h5-active[data-h5-page='post'] #postSheet .sqd-top-btn:active {
  transform: scale(.92);
}

.h5-active[data-h5-page='post'] #postSheet .sheet-head > .sqd-top-right {
  display: inline-flex !important;
  align-items: center;
  gap: 8px;
  flex: none !important;
  margin-left: auto;
  pointer-events: auto;
}

/* 滚动主体容器 */
.h5-active[data-h5-page='post'] #postSheet .sheet-body {
  padding: 0 0 calc(98px + env(safe-area-inset-bottom, 0px)) !important;
  margin: 0 !important;
  overflow: visible !important;
}

/* 全幅电影感立绘头图 */
.h5-active[data-h5-page='post'] #postSheet #poCover {
  position: relative;
  width: 100% !important;
  height: clamp(320px, 46vh, 430px) !important;
  max-height: none !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  overflow: hidden;
  background: linear-gradient(145deg, #24293d 0%, #141826 100%) !important;
}

.h5-active[data-h5-page='post'] #postSheet #poCover::after {
  content: '';
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    rgba(10, 12, 20, .38) 0%,
    rgba(10, 12, 20, .06) 24%,
    rgba(10, 12, 20, 0) 56%,
    rgba(10, 12, 20, .42) 86%,
    rgba(10, 12, 20, .68) 100%
  );
}

.h5-active[data-h5-page='post'] #postSheet #poCover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 26%;
  display: block;
}

.h5-active[data-h5-page='post'] #postSheet[data-post-kind='character'] #poCover img {
  object-position: center 15%;
}

.h5-active[data-h5-page='post'] #postSheet #poCover .ph {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  font-size: 64px;
  font-weight: 700;
  color: rgba(255, 255, 255, .42);
}

/* 上浮圆角编辑卡片主体 */
.h5-active[data-h5-page='post'] #postSheet #h5PostDetails {
  position: relative;
  z-index: 4;
  margin: -28px 0 0;
  padding: 22px 18px 14px;
  border-radius: 28px 28px 0 0;
  background: var(--sqd-sheet-bg);
  box-shadow: 0 -10px 30px rgba(15, 23, 42, .08);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

:root[data-theme='dark'] .h5-active[data-h5-page='post'] #postSheet #h5PostDetails {
  border-top: 1px solid rgba(255, 255, 255, .09);
  box-shadow: 0 -12px 32px rgba(0, 0, 0, .44);
}

/* 标题 + 分类徽章 + 发布时间 */
.sqd-title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.sqd-title-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.sqd-title {
  margin: 0;
  font-size: 23px;
  font-weight: 760;
  letter-spacing: -.02em;
  line-height: 1.25;
  color: var(--sqd-ink);
  overflow-wrap: anywhere;
}

.sqd-kind-chip {
  flex: none;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  color: var(--sqd-accent);
  background: rgba(91, 103, 214, .11);
  border: 1px solid rgba(91, 103, 214, .20);
}

.sqd-date {
  flex: none;
  font-size: 12px;
  color: var(--sqd-sub);
  white-space: nowrap;
}

/* 单行紧凑作者 + 精炼统计条（彻底告别丑陋的 3+1 孤儿灰框） */
.sqd-meta-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.h5-active[data-h5-page='post'] #postSheet .sqd-author-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 10px 4px 4px;
  border-radius: 999px;
  border: 1px solid var(--sqd-line);
  background: var(--sqd-card-bg);
  color: var(--sqd-ink);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  max-width: 60%;
  transition: transform .12s ease, background .15s ease;
}

.sqd-author-pill:active {
  transform: scale(.97);
}

.sqd-author-ava {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  flex: none;
  overflow: hidden;
  display: inline-grid;
  place-items: center;
  background: linear-gradient(135deg, #dce2f4, #c5cee8);
  color: #2b3248;
  font-size: 11px;
  font-weight: 700;
}

.sqd-author-ava img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.sqd-author-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sqd-author-arrow {
  color: var(--sqd-sub);
  font-size: 13px;
  line-height: 1;
}

.sqd-stats-inline {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--sqd-sub);
  font-variant-numeric: tabular-nums;
}

.sqd-stat-item {
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
}

.sqd-stat-item strong {
  font-weight: 680;
  color: var(--sqd-ink);
  font-size: 12.5px;
}

/* 轻盈标签行 */
.sqd-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.sqd-tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--sqd-chip-bg);
  border: 1px solid var(--sqd-line);
  color: var(--sqd-sub);
  font-size: 11.5px;
  line-height: 1.45;
}

/* 一句话亮点 / 简介引言卡 */
.sqd-quote {
  position: relative;
  padding: 12px 14px 12px 16px;
  border-radius: 16px;
  background: var(--sqd-quote-bg);
  border: 1px solid rgba(91, 103, 214, .14);
  color: var(--sqd-ink);
  font-size: 14px;
  line-height: 1.65;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.sqd-quote::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 12px;
  bottom: 12px;
  width: 3px;
  border-radius: 99px;
  background: linear-gradient(180deg, #6b76ea 0%, #a28df2 100%);
}

/* 角色简介 / 开场白精致阅读卡（支持展开全部） */
.sqd-card {
  padding: 14px 16px;
  border-radius: 18px;
  background: var(--sqd-card-bg);
  border: 1px solid var(--sqd-line);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sqd-card-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--sqd-sub);
}

.sqd-card-label::before {
  content: '';
  width: 3px;
  height: 12px;
  border-radius: 99px;
  background: var(--sqd-accent);
}

.sqd-card-text {
  margin: 0;
  font-size: 14px;
  line-height: 1.78;
  color: var(--sqd-body);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.sqd-card-text.is-clamped {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 5;
  overflow: hidden;
}

.sqd-card-text.is-clamped-3 {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}

.h5-active[data-h5-page='post'] #postSheet .sqd-expand-btn {
  align-self: flex-start;
  padding: 2px 0;
  border: 0;
  background: transparent;
  color: var(--sqd-accent);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}

.sqd-sources {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.sqd-source-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--sqd-line);
  background: var(--sqd-card-bg);
  color: var(--sqd-sub);
  font-size: 11.5px;
  text-decoration: none;
}

/* 移动端隐藏原始杂乱的 #poDesc（内容已精致归位到 .sqd-quote / .sqd-sources） */
.h5-active[data-h5-page='post'] #postSheet #poDesc {
  display: none !important;
}

/* 评论区整洁接续（消除旧 margin 灰条 + 深色模式高对比适配） */
.h5-active[data-h5-page='post'] #postSheet .po-sec {
  margin: 0 !important;
  padding: 16px 18px 8px !important;
  background: var(--sqd-sheet-bg);
  border-top: 1px solid var(--sqd-line);
  font-size: 14px;
  font-weight: 700;
  color: var(--sqd-ink);
}

.h5-active[data-h5-page='post'] #postSheet #poCms {
  margin: 0 !important;
  padding: 0 18px 14px;
  background: var(--sqd-sheet-bg);
}

.h5-active[data-h5-page='post'] #postSheet .po-cm-av {
  background: var(--sqd-chip-bg);
  border: 1px solid var(--sqd-line);
  color: var(--sqd-ink);
}

.h5-active[data-h5-page='post'] #postSheet .po-cm-top b {
  color: var(--sqd-ink);
}

.h5-active[data-h5-page='post'] #postSheet .po-cm-top span {
  color: var(--sqd-sub);
}

.h5-active[data-h5-page='post'] #postSheet .po-cm-main p {
  color: var(--sqd-body);
}

.h5-active[data-h5-page='post'] #postSheet .po-input-row {
  padding: 6px 18px 16px;
  margin: 0 !important;
  background: var(--sqd-sheet-bg);
  gap: 8px;
}

.h5-active[data-h5-page='post'] #postSheet #poInput {
  border-radius: 999px !important;
  padding: 10px 14px !important;
  background: var(--sqd-card-bg) !important;
  border: 1px solid var(--sqd-line) !important;
  color: var(--sqd-ink) !important;
}

.h5-active[data-h5-page='post'] #postSheet #poInput::placeholder {
  color: var(--sqd-sub) !important;
  opacity: 1;
}

.h5-active[data-h5-page='post'] #postSheet #poSend {
  border-radius: 999px !important;
  padding: 0 18px !important;
  min-height: 40px !important;
  background: var(--sqd-cta-bg) !important;
  color: var(--sqd-cta-fg) !important;
  border: 0 !important;
  font-weight: 600 !important;
}

.h5-active[data-h5-page='post'] #postSheet #postOut {
  margin: 0 !important;
  padding: 0 18px 8px;
  background: var(--sqd-sheet-bg);
}

.h5-active[data-h5-page='post'] #postSheet #postOut:empty {
  display: none;
}

/* 底部唯一悬浮毛玻璃操作坞：[ ♡ 2 ] [ 仅导入 ] [ 💬 开始聊天 (主按钮) ] */
.h5-active[data-h5-page='post'] #postSheet .po-ops {
  position: fixed !important;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 49;
  display: flex !important;
  align-items: center;
  gap: 10px !important;
  margin: 0 !important;
  padding: 10px 16px max(12px, env(safe-area-inset-bottom)) !important;
  background: var(--sqd-dock-bg) !important;
  backdrop-filter: blur(22px) saturate(160%) !important;
  -webkit-backdrop-filter: blur(22px) saturate(160%) !important;
  border-top: 1px solid var(--sqd-line) !important;
  box-shadow: 0 -6px 24px rgba(15, 23, 42, .08);
}

.h5-active[data-h5-page='post'] #postSheet .po-ops #poDel,
.h5-active[data-h5-page='post'] #postSheet .po-ops #poReport,
.h5-active[data-h5-page='post'] #postSheet .po-ops #poStart {
  display: none !important;
}

.h5-active[data-h5-page='post'] #postSheet #poLike {
  flex: none;
  min-width: 66px;
  height: 46px !important;
  min-height: 46px !important;
  padding: 0 14px !important;
  border-radius: 999px !important;
  border: 1px solid var(--sqd-line) !important;
  background: var(--sqd-card-bg) !important;
  color: var(--sqd-ink) !important;
  font-size: 13.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.h5-active[data-h5-page='post'] #postSheet #poLike.on {
  color: #e54865 !important;
  background: rgba(229, 72, 101, .10) !important;
  border-color: rgba(229, 72, 101, .26) !important;
}

.h5-active[data-h5-page='post'] #postSheet #poImport {
  flex: none;
  height: 46px !important;
  min-height: 46px !important;
  padding: 0 16px !important;
  border-radius: 999px !important;
  border: 1px solid var(--sqd-line) !important;
  background: var(--sqd-card-bg) !important;
  color: var(--sqd-ink) !important;
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: none !important;
}

.h5-active[data-h5-page='post'] #postSheet #h5PostStartBtn {
  flex: 1 1 auto;
  height: 46px !important;
  min-height: 46px !important;
  margin: 0 !important;
  padding: 0 18px !important;
  border: 0 !important;
  border-radius: 999px !important;
  background: var(--sqd-cta-bg) !important;
  color: var(--sqd-cta-fg) !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  letter-spacing: .02em;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 7px;
  box-shadow: 0 8px 22px rgba(20, 24, 38, .22);
  cursor: pointer;
}

.h5-active[data-h5-page='post'] #postSheet #h5PostStartBtn:active {
  transform: scale(.98);
}

/* 液态玻璃主题下保持与整站一致的清透通透感 */
body.skin-glass.h5-active[data-h5-page='post'] #postSheet {
  --sqd-sheet-bg: rgba(255, 255, 255, .86);
  --sqd-dock-bg: rgba(255, 255, 255, .78);
}

:root[data-theme='dark'] body.skin-glass.h5-active[data-h5-page='post'] #postSheet {
  --sqd-sheet-bg: rgba(18, 22, 34, .88);
  --sqd-dock-bg: rgba(16, 20, 32, .84);
}

