
/* ============ TipTap 编辑器与特效（v_0.23） ============ */
/* 编辑器容器（复用在聊天输入盒，保持原外观：用现有 chat 样式亦可，这里提供微调） */
.sbs-tiptap { outline: none; word-break: break-word; }
.sbs-tiptap.chat-inline { max-height: 34vh; }
.sbs-tiptap p { margin: 0; }
.sbs-tiptap p + p { margin-top: 6px; }
.sbs-tiptap .is-editor-empty:first-child::before { content: attr(data-placeholder); color: var(--dim); pointer-events: none; float: left; height: 0; }
/* 特效 mark */
.ts-rainbow { background-image: linear-gradient(90deg, #ff5f5f, #ffa94d, #ffd43b, #8ce99a, #4dabf7, #b197fc, #f783ac, #ff5f5f); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; background-size: 400% 100%; animation: ts-rainbow-move 3s linear infinite; }
@keyframes ts-rainbow-move { 0% { background-position: 0% 50%; } 100% { background-position: 400% 50%; } }
.ts-shake { display: inline-block; animation: ts-shake-anim .35s linear infinite; }
@keyframes ts-shake-anim { 0%,100% { transform: translate(0,0); } 25% { transform: translate(1.2px,-1px); } 50% { transform: translate(-1.2px,1px); } 75% { transform: translate(1px,1.2px); } }
.ts-wave { display: inline-block; animation: ts-wave-anim 1.4s ease-in-out infinite; }
@keyframes ts-wave-anim { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
.ts-glitch { display: inline-block; position: relative; animation: ts-glitch-jit .45s infinite steps(2, jump-none); }
.ts-glitch::before, .ts-glitch::after { content: attr(data-glitch-text); position: absolute; left: 0; top: 0; width: 100%; overflow: hidden; clip-path: inset(0 0 0 0); opacity: .7; pointer-events: none; }
.ts-glitch::before { color: #4dabf7; transform: translate(-1.5px, -1px); animation: ts-glitch-a .9s infinite steps(2, jump-none); }
.ts-glitch::after { color: #f783ac; transform: translate(1.5px, 1px); animation: ts-glitch-b 1.1s infinite steps(2, jump-none); }
@keyframes ts-glitch-a { 0% { clip-path: inset(0 0 80% 0); } 25% { clip-path: inset(30% 0 40% 0); } 50% { clip-path: inset(60% 0 20% 0); } 75% { clip-path: inset(10% 0 70% 0); } 100% { clip-path: inset(45% 0 35% 0); } }
@keyframes ts-glitch-b { 0% { clip-path: inset(70% 0 10% 0); } 25% { clip-path: inset(20% 0 60% 0); } 50% { clip-path: inset(40% 0 30% 0); } 75% { clip-path: inset(80% 0 5% 0); } 100% { clip-path: inset(15% 0 65% 0); } }
/* 纯 CSS 故障：RGB 通道分裂 + 顿挫抖动（不依赖 data-glitch-text，编辑器内外一致） */
@keyframes ts-glitch-jit {
  0%, 100% { transform: translate(0, 0); text-shadow: 1.5px 0 rgba(77,171,247,.8), -1.5px 0 rgba(247,131,172,.8); }
  20% { transform: translate(-1px, 0); text-shadow: -2px 0 rgba(77,171,247,.85), 2px 0 rgba(247,131,172,.85); }
  40% { transform: translate(1px, -1px); text-shadow: 2px 1px rgba(77,171,247,.85), -2px -1px rgba(247,131,172,.85); }
  60% { transform: translate(-1px, 1px); text-shadow: -2px -1px rgba(77,171,247,.85), 2px 1px rgba(247,131,172,.85); }
  80% { transform: translate(1px, 0); text-shadow: 1px 0 rgba(77,171,247,.8), -1px 0 rgba(247,131,172,.8); }
}
.ts-blink { animation: ts-blink-anim 1s steps(2, start) infinite; }
@keyframes ts-blink-anim { 0%,49% { opacity: 1; } 50%,100% { opacity: 0; } }
/* 剧透 */
.ts-spoiler { background: #454a5c; color: transparent; border-radius: 4px; padding: 0 4px; cursor: pointer; transition: background .2s, color .2s; }
.ts-spoiler:hover { background: #565b6e; }
.ts-spoiler.ts-revealed { background: transparent; color: inherit; }
.ts-spoiler.ts-revealed::before { content: none; }

/* 演出指令 */
.ts-perf { display: inline-block; background: var(--card2); border: 1px solid var(--acc); color: var(--acc); border-radius: 6px; padding: 0 6px; font-size: 12px; line-height: 18px; margin: 0 3px; cursor: default; animation: ts-perf-pulse 1.2s ease-in-out infinite; }
.ts-perf.ts-paused { animation: none; box-shadow: 0 0 0 2px var(--acc); }
@keyframes ts-perf-pulse { 0%,100% { opacity: 1; } 50% { opacity: .5; } }
/* 高亮 mark */
mark[data-hl] { background: var(--hl); color: #000; padding: 0 2px; border-radius: 3px; }
/* 选中菜单（rtMenu）扩展样式 */
.rt-menu { position: fixed; z-index: 99999; background: var(--card); border: 1px solid var(--acc); border-radius: 10px; padding: 8px; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; max-width: 92vw; box-shadow: 0 8px 24px rgba(0,0,0,.6); max-height: 60vh; overflow-y: auto; }
.rt-menu .rt-rbtn { background: var(--card2); color: var(--fg); border: 1px solid var(--line); border-radius: 6px; padding: 3px 8px; font-size: 12px; cursor: pointer; }
.rt-menu .rt-rbtn:hover { border-color: var(--acc); color: var(--acc); }
.rt-menu .rt-fxbtn { background: linear-gradient(90deg, #ff5f5f22, #ffa94d22, #ffd43b22, #8ce99a22, #4dabf722, #b197fc22, #f783ac22); }
.rt-menu .rt-cdot { width: 18px; height: 18px; border-radius: 50%; border: 2px solid #fff3; cursor: pointer; }
.rt-menu .rt-sep { width: 1px; height: 20px; background: var(--line); margin: 0 3px; }
.rt-menu select, .rt-menu input[type=color] { background: var(--card2); color: var(--fg); border: 1px solid var(--line); border-radius: 6px; font: inherit; font-size: 12px; padding: 2px 4px; }
.rt-danger { color: #ff8787 !important; border-color: #ff878755 !important; }

/* ============ 聊天发言类型（闲聊/对话/动作/想法/旁白） ============ */
#chatModeBtn { min-width: 88px; text-align: left; flex-shrink: 0; }
.cm-flag { display: inline-block; font-size: 10px; color: var(--dim); border: 1px solid var(--line); border-radius: 5px; padding: 0 4px; margin-left: 6px; vertical-align: 1px; }
/* 闲聊：默认（OOC，稍淡） */
.chat-msg.cm-chat { opacity: .82; }
.chat-msg.cm-chat b { font-weight: 600; }
/* 对话：常规角色台词 */
.chat-msg.cm-talk { }
/* 动作：斜体 + 淡紫 */
.chat-msg.cm-act { }
.chat-msg.cm-act .cm-body, .chat-msg.cm-act .t + b + * , .chat-msg.cm-act ~ * { }
.chat-msg.cm-act { color: #b197fc; }
.chat-msg.cm-act b { color: #b197fc; }
/* 想法：斜体 + 灰蓝 */
.chat-msg.cm-thought { color: #74c0fc; font-style: italic; }
.chat-msg.cm-thought b { color: #74c0fc; font-style: italic; }
/* 旁白：房主，金色描边 */
.chat-msg.cm-narr { background: linear-gradient(90deg, #e8c06018, #e8c06005); border: 1px solid #e8c06055; border-radius: 8px; padding: 3px 8px; margin: 3px 0; color: #e8c060; }
.chat-msg.cm-narr b { color: #e8c060; }
/* 模式选择菜单 */
.mode-row { padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; margin: 5px 0; cursor: pointer; }
.mode-row:hover { border-color: var(--acc); }
.mode-on { border-color: var(--acc); background: var(--card2); }
.mode-lock { opacity: .55; }

/* ---------- 下划线/删除线样式（data-under / data-stk） ---------- */
.rt-sel { min-width: 64px; }
/* ---------- Ruby 注音 ---------- */
ruby { font-style: normal; }
ruby rt { font-size: 0.6em; opacity: .75; }
/* ---------- 特效入场动画 ---------- */
[data-enter] { animation-duration: var(--ts-enter-dur, 1s); animation-fill-mode: both; }
[data-enter="blur"] { animation-name: ts-enter-blur; animation-timing-function: ease; }
@keyframes ts-enter-blur { from { opacity: 0; filter: blur(4px); } to { opacity: 1; filter: none; } }
[data-enter="typewriter"] { display: inline-block; } /* 渲染结果：逐字由 JS 打字机逐字打出（第一行从左到右→第二行→第三行依次往下） */
/* 编辑器内（ProseMirror）：设置 typewriter 瞬间 span 获得 data-enter，播放一次揭示动画（行依次往下） */
.ProseMirror [data-enter="typewriter"] { display: inline-block; animation: ts-enter-type 1.2s cubic-bezier(.2,.7,.3,1) both; }
@keyframes ts-enter-type { 0% { clip-path: inset(0 0 100% 0); } 100% { clip-path: inset(0 0 0 0); } }
/* 进入速度：慢 1-3 / 中 4-6 / 快 7-9 */
[data-speed="1"], [data-speed="2"], [data-speed="3"] { --ts-enter-dur: 1.5s; }
[data-speed="4"], [data-speed="5"], [data-speed="6"] { --ts-enter-dur: 1s; }
[data-speed="7"], [data-speed="8"], [data-speed="9"] { --ts-enter-dur: .4s; }
/* 语气尺度：低语/收束（小+淡）→ 中性 → 强调/爆发（大+重） */
[data-tone="-1"] { font-size: .94em; opacity: .9; }
[data-tone="-2"], [data-tone="-3"], [data-tone="-4"] { font-size: .85em; opacity: .75; }
[data-tone="1"] { font-size: 1.08em; font-weight: 600; }
[data-tone="2"], [data-tone="3"], [data-tone="4"] { font-size: 1.18em; font-weight: 700; }
/* ---------- 菜单补充 ---------- */
.rt-menu .rt-pick { width: 24px; height: 20px; padding: 0; border: none; background: transparent; cursor: pointer; }

/* ---------- Ruby 注音（data-ruby + CSS 上标注音） ---------- */
ruby.rt-ruby { line-height: 1; }
ruby.rt-ruby::after { content: attr(data-ruby); display: block; font-size: 0.55em; line-height: 1; color: var(--dim); text-align: center; }

/* ============ 展开编辑（⤢）富文本完整功能 ============ */
/* 黄色 T 键 */
.fp-tbtn { background: linear-gradient(180deg, #ffd43b, #e8b20a); color: #201500; font-weight: 900; font-size: 15px; width: 30px; height: 30px; border: 1px solid #caa000; border-radius: 7px; cursor: pointer; box-shadow: 0 2px 5px rgba(0,0,0,.3); }
.fp-tbtn:hover { filter: brightness(1.08); }
.fp-tbtn:active { transform: translateY(1px); }
/* 完整面板 */
.fp-warn { font-size: 12px; color: var(--dim); background: var(--card2); border: 1px solid var(--line); border-radius: 7px; padding: 5px 8px; margin: 6px 0; }
.fp-grid { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px; border: 1px solid var(--line); border-radius: 10px; max-height: 44vh; overflow-y: auto; }
.fp-btn { background: var(--card2); color: var(--fg); border: 1px solid var(--line); border-radius: 7px; padding: 5px 10px; font-size: 12px; cursor: pointer; }
.fp-btn:hover { border-color: var(--acc); color: var(--acc); }
.fp-b { font-weight: 800; }
.fp-rainbow { background-image: linear-gradient(90deg, #ff5f5f22, #ffa94d22, #ffd43b22, #8ce99a22, #4dabf722, #b197fc22); }
.fp-hlbtn { width: 30px; height: 26px; border-radius: 6px; border: 1px solid var(--line); cursor: pointer; color: #000; font-weight: 600; font-size: 11px; }
.fp-danger { color: #ff8787; border-color: #ff878755; }

/* ============ 新节点样式（完整复刻） ============ */
/* 面板分组 */
.fp-section { display: flex; flex-direction: column; gap: 6px; padding: 8px; border: 1px solid var(--line); border-radius: 10px; max-height: 56vh; overflow-y: auto; }
.fp-row { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.fp-lb { font-size: 11px; color: var(--dim); min-width: 42px; }
/* 编辑/消息中 */
.sbs-tiptap h1, .sbs-tiptap h2, .sbs-tiptap h3 { margin: 6px 0 3px; line-height: 1.3; }
.sbs-tiptap h1 { font-size: 1.6em; } .sbs-tiptap h2 { font-size: 1.35em; } .sbs-tiptap h3 { font-size: 1.15em; }
.sbs-tiptap blockquote, .chat-msg blockquote { border-left: 3px solid var(--acc); margin: 4px 0; padding: 2px 10px; background: var(--card2); border-radius: 0 8px 8px 0; color: var(--dim); }
.sbs-tiptap ul, .sbs-tiptap ol, .chat-msg ul, .chat-msg ol { margin: 4px 0; padding-left: 22px; }
.sbs-tiptap li, .chat-msg li { margin: 2px 0; }
.sbs-tiptap hr, .chat-msg hr { border: none; border-top: 1px solid var(--line); margin: 8px 0; }
.sbs-tiptap code, .chat-msg code { background: var(--card2); border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; font-family: monospace; font-size: .92em; }
.sbs-tiptap code::before, .sbs-tiptap code::after { content: ''; }
.sbs-tiptap pre.rt-codeblock, .chat-msg pre.rt-codeblock { background: var(--card2); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; overflow-x: auto; margin: 6px 0; }
.sbs-tiptap pre.rt-codeblock code, .chat-msg pre.rt-codeblock code { background: transparent; border: none; padding: 0; }
.rt-link, .chat-msg a.rt-link { color: var(--acc); text-decoration: underline; cursor: pointer; }
.rt-inline-img { display: block; max-width: 100%; }
/* 提及 */
.ts-mention { background: var(--acc); color: #000; border-radius: 6px; padding: 0 5px; font-weight: 600; margin: 0 2px; cursor: default; }
/* 智能链接卡片 */
.ts-smartlink { display: inline-block; border: 1px solid var(--line); border-radius: 8px; padding: 4px 10px; margin: 2px 3px 2px 0; color: var(--fg); background: var(--card2); text-decoration: none; cursor: pointer; }
.ts-smartlink:hover { border-color: var(--acc); }
/* 演出速度/语气（档位规则见上方入场动画区） */

/* ============ 富文本顶栏工具栏（SealChat 同款） ============ */
.fptool { display: flex; flex-wrap: nowrap; align-items: center; gap: 4px; padding: 5px 8px; background: var(--card2); border: 1px solid var(--line); border-radius: 9px; margin-bottom: 6px; position: relative; overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; max-width: 100%; box-sizing: border-box; white-space: nowrap; }
.fptool::-webkit-scrollbar { height: 4px; }
.fptool::-webkit-scrollbar-thumb { background: var(--line); border-radius: 4px; }
.fptool-btn { min-width: 24px; height: 24px; padding: 0 5px; background: var(--card); color: var(--fg); border: 1px solid var(--line); border-radius: 6px; font-size: 11px; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.fptool-btn:hover { border-color: var(--acc); color: var(--acc); }
.fptool-btn:active { transform: translateY(1px); }
.fptool-u { text-decoration: underline; }
.fptool-s { text-decoration: line-through; }
.fptool-fx { background-image: linear-gradient(90deg, #ff5f5f22, #ffa94d22, #ffd43b22, #8ce99a22, #4dabf722, #b197fc22); }
.fptool-hl { background: #ffd43b; color: #000; border: 1px solid rgba(0,0,0,.45); box-shadow: inset 0 -3px 0 #e8b20a; }
.fptool-color { background: #ff5f5f; color: #000; border: 1px solid rgba(0,0,0,.45); box-shadow: inset 0 -3px 0 #d13c3c; }
.fptool-sel { height: 24px; background: var(--card); color: var(--fg); border: 1px solid var(--line); border-radius: 6px; font-size: 11px; padding: 0 2px 0 6px; cursor: pointer; flex-shrink: 0; appearance: none; -webkit-appearance: none; -moz-appearance: none; text-align: center; text-overflow: ellipsis; white-space: nowrap; overflow: hidden; background-image: linear-gradient(45deg, transparent 50%, var(--dim) 50%), linear-gradient(135deg, var(--dim) 50%, transparent 50%); background-position: calc(100% - 8px) 55%, calc(100% - 4px) 55%; background-size: 4px 4px, 4px 4px; background-repeat: no-repeat; }
/* P▾ / A▾ 一个字母宽 */
.fptool-sel.fptool-p, .fptool-sel.fptool-a { width: 30px; padding-left: 0; }
.fptool-sel.fptool-p option, .fptool-sel.fptool-a option { text-align: left; }
/* 平台字体贴合 */
.fptool-sel.fptool-font { width: 94px; padding-left: 8px; text-align: left; }
.fptool-sel:hover { border-color: var(--acc); }

.fptool-sep { width: 1px; height: 16px; background: var(--line); margin: 0 2px; flex-shrink: 0; }

/* ============ 输入栏上方工具栏行（T 键 toggle） ============ */
.fptool-inline { margin: 4px 0 6px; position: sticky; z-index: 30; box-shadow: 0 2px 10px rgba(0,0,0,.2); }
.fptool-x { margin-left: auto; color: var(--dim); }
/* 取色板 */
.fp-palette { position: fixed; z-index: 999998; background: var(--card); border: 1px solid var(--acc); border-radius: 12px; padding: 8px; width: 232px; box-shadow: 0 10px 30px rgba(0,0,0,.5); animation: sbsToastIn .2s ease; }
.fp-pal-h { display: flex; align-items: center; justify-content: space-between; font-size: 13px; color: var(--acc); margin-bottom: 6px; }
.fp-pal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-bottom: 6px; }
.fp-pal-grid7 { grid-template-columns: repeat(7, 1fr); }
.fp-pal-c { width: 24px; height: 24px; border-radius: 6px; border: 1px solid var(--line); cursor: pointer; }
.fp-pal-c:hover { transform: scale(1.12); border-color: var(--acc); }
.fp-pal-row { display: flex; gap: 6px; align-items: center; }
.fp-pal-in { flex: 1; height: 26px; border: 1px solid var(--line); border-radius: 6px; background: transparent; padding: 0 2px; cursor: pointer; }

/* 使用中状态框 */
.fptool-btn.fp-active { outline: 2px solid var(--acc) !important; outline-offset: 2px !important; box-shadow: none !important; position: relative; z-index: 2; }
.fptool-btn.fp-active::after { content: ''; position: absolute; inset: -4px; border: 2px solid var(--acc); border-radius: 8px; pointer-events: none; }
.fptool-hl.fp-active::after, .fptool-color.fp-active::after { border-color: var(--acc); background: transparent; }
/* 取色板确定/退出 */
.fp-pal-btns { display: flex; gap: 8px; margin-top: 8px; justify-content: flex-end; }
.fp-pal-c.fp-pal-on { box-shadow: 0 0 0 2px var(--acc), 0 0 0 3px #fff; }
.fp-pal-title { font-weight: 700; }
/* 二级菜单 */
.fp-sub { position: fixed; z-index: 999998; background: var(--card); border: 1px solid var(--acc); border-radius: 12px; padding: 10px; width: 300px; box-shadow: 0 10px 30px rgba(0,0,0,.5); animation: sbsToastIn .2s ease; }
.fp-sub-h { display: flex; align-items: center; justify-content: space-between; font-size: 13px; font-weight: 700; color: var(--acc); margin-bottom: 8px; }
.fp-sub-row { display: flex; align-items: center; gap: 6px; margin: 5px 0; flex-wrap: wrap; }
.fp-sub-group { display: flex; gap: 4px; flex-wrap: wrap; }
.fp-sub-in { background: var(--card2); color: var(--fg); border: 1px solid var(--line); border-radius: 6px; padding: 3px 6px; font-size: 12px; flex: 1; min-width: 80px; }
.fp-sub-col { width: 30px; height: 24px; border: 1px solid var(--line); border-radius: 6px; background: transparent; padding: 0 1px; cursor: pointer; }
.fp-sub-btn { display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px; }
/* 剧透：编辑栏内正常显示（输入框），预览（消息）彻底隐藏 */
.sbs-tiptap .ts-spoiler, .sbs-tiptap [data-spoiler] { background: transparent; color: inherit; cursor: default; }
.sbs-tiptap [data-spoiler]::before { content: none; }
/* 消息预览：彻底遮住 */
.chat-msg .ts-spoiler, .chat-msg [data-spoiler], #view-battle [data-spoiler], .chat-msg .rt-spoiler {
  background: #454a5c; color: transparent !important; border-radius: 4px; padding: 0 6px; cursor: pointer; transition: background .2s, color .2s; user-select: none;
}
.chat-msg [data-spoiler]:hover { background: #565b6e; }
.chat-msg [data-spoiler].ts-revealed, .chat-msg [data-spoiler]:hover.revealed { background: transparent; color: inherit; }
/* 演出 scale */
[data-scale="shout"] { font-size: 1.3em; }
[data-scale="whisper"] { font-size: .8em; opacity: .8; }

/* ============ SealChat 风格面板 ============ */
.sc-panel { position: fixed; z-index: 999998; background: var(--card); border: 1px solid var(--acc); border-radius: 12px; padding: 10px 12px; width: 320px; box-shadow: 0 10px 30px rgba(0,0,0,.5); animation: sbsToastIn .2s ease; max-height: 70vh; overflow-y: auto; }
.sc-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.sc-title { font-size: 14px; font-weight: 700; color: var(--acc); }
.sc-row { display: flex; align-items: flex-start; gap: 8px; margin: 7px 0; }
.sc-lb { min-width: 52px; font-size: 12px; color: var(--dim); padding-top: 3px; }
.sc-chips { display: flex; gap: 4px; flex-wrap: wrap; }
.sc-chip { background: var(--card2); color: var(--fg); border: 1px solid var(--line); border-radius: 7px; padding: 3px 9px; font-size: 12px; cursor: pointer; display: inline-flex; flex-direction: column; align-items: center; line-height: 1.1; }
.sc-chip small { font-size: 9px; color: var(--dim); }
.sc-chip:hover { border-color: var(--acc); color: var(--acc); }
.sc-chip.is-active { border-color: var(--acc); background: var(--acc); color: #000; }
.sc-chip.is-active small { color: #0008; }
.sc-sec { border: 1px solid var(--line); border-radius: 10px; padding: 8px; margin: 6px 0; }
.sc-sec-h { display: flex; flex-direction: column; margin-bottom: 4px; }
.sc-hint { font-size: 10px; color: var(--dim); }
.sc-ms { width: 100%; box-sizing: border-box; background: var(--card2); color: var(--fg); border: 1px solid var(--line); border-radius: 6px; padding: 5px 8px; font-size: 12px; margin: 6px 0; }
.sc-in { background: var(--card2); color: var(--fg); border: 1px solid var(--line); border-radius: 6px; padding: 4px 7px; font-size: 12px; flex: 1; min-width: 0; }
.sc-col { width: 34px; height: 26px; border: 1px solid var(--line); border-radius: 6px; background: transparent; padding: 0 2px; cursor: pointer; }
.sc-ruby { display: flex; flex-direction: column; gap: 4px; }
.sc-btns { display: flex; gap: 8px; justify-content: flex-end; margin-top: 10px; }

/* ============ 聊天实时预览栏 ============ */
.prev-box { display: none; border: 1px dashed var(--line); border-radius: 8px; padding: 6px 10px; margin-bottom: 4px; background: var(--card2); }
.prev-head { font-size: 11px; color: var(--dim); margin-bottom: 3px; }
.prev-body { font-size: 13px; color: var(--fg); word-break: break-word; max-height: 120px; overflow-y: auto; }
.prev-body blockquote, .prev-body ul, .prev-body ol { margin: 3px 0; padding-left: 18px; }
.prev-body hr { margin: 5px 0; }
.prev-body .ts-spoiler, .prev-body [data-spoiler] { background: #454a5c; color: transparent; border-radius: 4px; padding: 0 5px; }
/* 长文本 modal 宽度 */
#modalBox .mbox.mbox-wide { width: min(940px, 96vw) !important; }


/* ===== 下划线/删除线（SealChat 原版方案：class + CSS 变量，currentColor 跟色） ===== */
.tiptap-text-decoration {
  --tiptap-decoration-thickness: 0.12em;
  --tiptap-decoration-underline-offset: 0.18em;
  --tiptap-decoration-dot-size: max(1px, calc(var(--tiptap-decoration-thickness) * 0.55));
  --tiptap-decoration-dot-step: 0.36em;
  --tiptap-decoration-wave-height: 0.22em;
  --tiptap-decoration-line-layer-1: linear-gradient(currentColor, currentColor);
  --tiptap-decoration-line-layer-2: linear-gradient(transparent, transparent);
  --tiptap-decoration-line-layer-3: linear-gradient(transparent, transparent);
  --tiptap-decoration-line-size: 100% var(--tiptap-decoration-thickness);
  --tiptap-decoration-line-pos-1: 0 calc(100% + var(--tiptap-decoration-underline-offset));
  --tiptap-decoration-line-pos-2: 0 calc(100% + var(--tiptap-decoration-underline-offset) + 0.24em);
  --tiptap-decoration-line-pos-3: 0 calc(100% + var(--tiptap-decoration-underline-offset) + 0.48em);
  text-decoration: none !important;
  padding-bottom: calc(var(--tiptap-decoration-underline-offset) + var(--tiptap-decoration-wave-height));
  background-repeat: repeat-x;
  background-origin: content-box;
  background-clip: padding-box;
  background-image:
    var(--tiptap-decoration-line-layer-1),
    var(--tiptap-decoration-line-layer-2),
    var(--tiptap-decoration-line-layer-3);
  background-size:
    var(--tiptap-decoration-line-size),
    var(--tiptap-decoration-line-size),
    var(--tiptap-decoration-line-size);
  background-position:
    var(--tiptap-decoration-line-pos-1),
    var(--tiptap-decoration-line-pos-2),
    var(--tiptap-decoration-line-pos-3);
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.tiptap-text-decoration--strike {
  --tiptap-decoration-line-pos-1: 0 50%;
  --tiptap-decoration-line-pos-2: 0 calc(50% - 0.22em);
  --tiptap-decoration-line-pos-3: 0 calc(50% + 0.22em);
  padding-bottom: 0;
}

.tiptap-text-decoration--dotted {
  --tiptap-decoration-line-layer-1: radial-gradient(circle, currentColor var(--tiptap-decoration-dot-size), transparent calc(var(--tiptap-decoration-dot-size) + 0.5px));
  --tiptap-decoration-line-size: var(--tiptap-decoration-dot-step) calc(var(--tiptap-decoration-thickness) * 2 + 2px);
}

.tiptap-text-decoration--dense-dotted {
  --tiptap-decoration-dot-step: 0.24em;
  --tiptap-decoration-dot-size: max(1px, calc(var(--tiptap-decoration-thickness) * 0.7));
  --tiptap-decoration-line-layer-1: radial-gradient(circle, currentColor var(--tiptap-decoration-dot-size), transparent calc(var(--tiptap-decoration-dot-size) + 0.45px));
  --tiptap-decoration-line-size: var(--tiptap-decoration-dot-step) calc(var(--tiptap-decoration-thickness) * 2 + 2px);
}

.tiptap-text-decoration--wave-soft {
  --tiptap-decoration-wave-height: 8px;
  --tiptap-decoration-line-layer-1: url("data:image/svg+xml;utf8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%228%22%20viewBox%3D%220%200%2024%208%22%3E%3Cpath%20d%3D%22M0%204%20L1%203.38%20L2%202.80%20L3%202.30%20L4%201.92%20L5%201.68%20L6%201.60%20L7%201.68%20L8%201.92%20L9%202.30%20L10%202.80%20L11%203.38%20L12%204.00%20L13%204.62%20L14%205.20%20L15%205.70%20L16%206.08%20L17%206.32%20L18%206.40%20L19%206.32%20L20%206.08%20L21%205.70%20L22%205.20%20L23%204.62%20L24%204.00%22%20fill%3D%22none%22%20stroke%3D%22%23fff%22%20stroke-width%3D%222%22%20vector-effect%3D%22non-scaling-stroke%22%20stroke-linejoin%3D%22round%22%20stroke-linecap%3D%22round%22%2F%3E%3C%2Fsvg%3E");
  --tiptap-decoration-line-size: 24px var(--tiptap-decoration-wave-height);
}
.tiptap-text-decoration--wave-soft[data-th="thin"] { --tiptap-decoration-line-layer-1: url("data:image/svg+xml;utf8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%228%22%20viewBox%3D%220%200%2024%208%22%3E%3Cpath%20d%3D%22M0%204%20L1%203.38%20L2%202.80%20L3%202.30%20L4%201.92%20L5%201.68%20L6%201.60%20L7%201.68%20L8%201.92%20L9%202.30%20L10%202.80%20L11%203.38%20L12%204.00%20L13%204.62%20L14%205.20%20L15%205.70%20L16%206.08%20L17%206.32%20L18%206.40%20L19%206.32%20L20%206.08%20L21%205.70%20L22%205.20%20L23%204.62%20L24%204.00%22%20fill%3D%22none%22%20stroke%3D%22%23fff%22%20stroke-width%3D%221%22%20vector-effect%3D%22non-scaling-stroke%22%20stroke-linejoin%3D%22round%22%20stroke-linecap%3D%22round%22%2F%3E%3C%2Fsvg%3E"); }
.tiptap-text-decoration--wave-soft[data-th="bold"] { --tiptap-decoration-line-layer-1: url("data:image/svg+xml;utf8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%228%22%20viewBox%3D%220%200%2024%208%22%3E%3Cpath%20d%3D%22M0%204%20L1%203.38%20L2%202.80%20L3%202.30%20L4%201.92%20L5%201.68%20L6%201.60%20L7%201.68%20L8%201.92%20L9%202.30%20L10%202.80%20L11%203.38%20L12%204.00%20L13%204.62%20L14%205.20%20L15%205.70%20L16%206.08%20L17%206.32%20L18%206.40%20L19%206.32%20L20%206.08%20L21%205.70%20L22%205.20%20L23%204.62%20L24%204.00%22%20fill%3D%22none%22%20stroke%3D%22%23fff%22%20stroke-width%3D%223%22%20vector-effect%3D%22non-scaling-stroke%22%20stroke-linejoin%3D%22round%22%20stroke-linecap%3D%22round%22%2F%3E%3C%2Fsvg%3E"); }
.tiptap-text-decoration--wave-heavy {
  --tiptap-decoration-wave-height: 10.4px;
  --tiptap-decoration-line-layer-1: url("data:image/svg+xml;utf8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2210.4%22%20viewBox%3D%220%200%2024%2010.4%22%3E%3Cpath%20d%3D%22M0%205.2%20L1%204.27%20L2%203.40%20L3%202.65%20L4%202.08%20L5%201.72%20L6%201.60%20L7%201.72%20L8%202.08%20L9%202.65%20L10%203.40%20L11%204.27%20L12%205.20%20L13%206.13%20L14%207.00%20L15%207.75%20L16%208.32%20L17%208.68%20L18%208.80%20L19%208.68%20L20%208.32%20L21%207.75%20L22%207.00%20L23%206.13%20L24%205.20%22%20fill%3D%22none%22%20stroke%3D%22%23fff%22%20stroke-width%3D%222%22%20vector-effect%3D%22non-scaling-stroke%22%20stroke-linejoin%3D%22round%22%20stroke-linecap%3D%22round%22%2F%3E%3C%2Fsvg%3E");
  --tiptap-decoration-line-size: 24px var(--tiptap-decoration-wave-height);
}
.tiptap-text-decoration--wave-heavy[data-th="thin"] { --tiptap-decoration-line-layer-1: url("data:image/svg+xml;utf8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2210.4%22%20viewBox%3D%220%200%2024%2010.4%22%3E%3Cpath%20d%3D%22M0%205.2%20L1%204.27%20L2%203.40%20L3%202.65%20L4%202.08%20L5%201.72%20L6%201.60%20L7%201.72%20L8%202.08%20L9%202.65%20L10%203.40%20L11%204.27%20L12%205.20%20L13%206.13%20L14%207.00%20L15%207.75%20L16%208.32%20L17%208.68%20L18%208.80%20L19%208.68%20L20%208.32%20L21%207.75%20L22%207.00%20L23%206.13%20L24%205.20%22%20fill%3D%22none%22%20stroke%3D%22%23fff%22%20stroke-width%3D%221%22%20vector-effect%3D%22non-scaling-stroke%22%20stroke-linejoin%3D%22round%22%20stroke-linecap%3D%22round%22%2F%3E%3C%2Fsvg%3E"); }
.tiptap-text-decoration--wave-heavy[data-th="bold"] { --tiptap-decoration-line-layer-1: url("data:image/svg+xml;utf8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2210.4%22%20viewBox%3D%220%200%2024%2010.4%22%3E%3Cpath%20d%3D%22M0%205.2%20L1%204.27%20L2%203.40%20L3%202.65%20L4%202.08%20L5%201.72%20L6%201.60%20L7%201.72%20L8%202.08%20L9%202.65%20L10%203.40%20L11%204.27%20L12%205.20%20L13%206.13%20L14%207.00%20L15%207.75%20L16%208.32%20L17%208.68%20L18%208.80%20L19%208.68%20L20%208.32%20L21%207.75%20L22%207.00%20L23%206.13%20L24%205.20%22%20fill%3D%22none%22%20stroke%3D%22%23fff%22%20stroke-width%3D%223%22%20vector-effect%3D%22non-scaling-stroke%22%20stroke-linejoin%3D%22round%22%20stroke-linecap%3D%22round%22%2F%3E%3C%2Fsvg%3E"); }
.tiptap-text-decoration--double {
  --tiptap-decoration-line-layer-2: var(--tiptap-decoration-line-layer-1);
}

.tiptap-text-decoration--triple {
  --tiptap-decoration-line-layer-2: var(--tiptap-decoration-line-layer-1);
  --tiptap-decoration-line-layer-3: var(--tiptap-decoration-line-layer-1);
}

/* 跑团聊天：长文本自动折行（自动换行内容不再一行溢出） */
.chat-msg { word-break: break-all; overflow-wrap: anywhere; }

/* 历史消息（data-hist）：入场特效只在首次出现时播一次，刷新/重载不重播 */
.chat-msg[data-hist="1"] [data-enter] { animation: none !important; }

/* 切换界面：整个界面的卡片与按钮同时上滑归位（随 .anim-in 触发） */
@keyframes sbsCardUp{from{transform:translateY(22px);opacity:0}to{transform:translateY(0);opacity:1}}
.view.anim-in .card,.view.anim-in button{animation:sbsCardUp .45s cubic-bezier(.2,.7,.3,1) backwards;animation-delay:.02s}

.view.anim-in{animation:sbsViewIn .28s ease-out both;animation-delay:.02s}

/* 编辑器内子面板浮层（注音 / 文字演出 / 富文本工具栏）：独立于 #modalBox，
   避免把发帖框/回复框连同已输入的文字一起顶掉。z-index 高于 modalBox(100)。 */
#fpFloatWrap{position:fixed;inset:0;z-index:130;background:rgba(6,8,14,.62);display:none;align-items:center;justify-content:center;padding:16px}
#fpFloatWrap .fp-float-box{background:var(--card);border:1px solid var(--line);border-radius:12px;padding:14px 16px;width:min(560px,94vw);max-height:86vh;overflow:auto;box-shadow:0 16px 50px rgba(0,0,0,.6)}
#fpFloatWrap .fp-float-box.wide{width:min(1060px,96vw)}
