/* ============ v20.24.0 —— 继续追问弹窗（一比一复刻星月写作） ============ */
/* ============ v20.25.0 —— 对齐星月全功能：双模式/对话管理/聊天设置/上下文明细/分支会话 ============ */
/* ============ v20.25.1 —— 星月同款选区菜单（加粗/高亮/清除/批注 + 彩色 AI 按钮网格） ============ */
.sq-menu { min-width: 420px !important; max-width: min(480px, 94vw); padding: 8px !important; gap: 8px !important; background: #FFFDF8 !important; border-radius: 12px !important; box-shadow: 0 10px 32px rgba(80,60,30,.22) !important; }
.sq-top { display: flex; align-items: center; gap: 4px; padding: 0 2px 6px; border-bottom: 1px solid #EFE6D2; }
.sq-top .sq-wc { font-size: 12px; color: #8A7A5E; background: #F3EAD6; border-radius: 999px; padding: 3px 10px; margin-right: 4px; white-space: nowrap; }
.sq-top button { border: 0; background: transparent; color: #4A3F2E; font-size: 13px; padding: 5px 9px; border-radius: 6px; cursor: pointer; white-space: nowrap; }
.sq-top button:hover { background: #F5ECD9; }
.sq-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.sq-grid button { border: 0 !important; color: #FFF !important; font-size: 13px !important; font-weight: 600; border-radius: 9px !important; padding: 11px 4px !important; cursor: pointer; text-align: center; white-space: nowrap; box-shadow: 0 2px 6px rgba(0,0,0,.12); transition: transform .08s, filter .12s; }
.sq-grid button:hover { filter: brightness(1.08); transform: translateY(-1px); }
.sq-grid button:active { transform: translateY(0); }
.sq-c1 { background: linear-gradient(135deg, #4F8EF7, #3564E4) !important; }
.sq-c2 { background: linear-gradient(135deg, #B77CF0, #9B59D0) !important; }
.sq-c3 { background: linear-gradient(135deg, #3FC98A, #23A46A) !important; }
.sq-c4 { background: linear-gradient(135deg, #49B8B2, #2A9D96) !important; }
.sq-c5 { background: linear-gradient(135deg, #F2A154, #E07E2A) !important; }
.sq-c6 { background: linear-gradient(135deg, #F4C04A, #E0A020) !important; }
.sq-c7 { background: linear-gradient(135deg, #F06070, #D63A4E) !important; }
.sq-c8 { background: linear-gradient(135deg, #55A8E8, #2A87C8) !important; }
@media (max-width: 560px) { .sq-menu { min-width: 92vw !important; } .sq-grid { grid-template-columns: repeat(2, 1fr); } }
body.fu-lock { overflow: hidden; }
.fu-overlay { position: fixed; inset: 0; z-index: 3400; display: flex; align-items: center; justify-content: center; background: rgba(32,26,18,.48); animation: fu-in .16s ease-out; }
@keyframes fu-in { from { opacity: 0; } to { opacity: 1; } }
.fu-shell { width: min(1180px, 95vw); height: min(88vh, 940px); background: #FFFDF8; border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 24px 80px rgba(40,30,15,.35); display: flex; flex-direction: column; overflow: hidden; }
.fu-shell.fu-fullscreen { width: 100vw; height: 100vh; border-radius: 0; }
.fu-flex { flex: 1; }

/* 头部 */
.fu-head { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--border); background: linear-gradient(#F7F1E3, #F3EAD6); flex-wrap: wrap; }
.fu-title { font-size: 16px; color: #C4392C; letter-spacing: 1px; }
/* v20.25.0 模式切换（继续追问 / 自由追问） */
.fu-modeseg { display: flex; background: #EFE6D2; border-radius: 999px; padding: 2px; margin-left: 4px; }
.fu-modeseg button { border: 0; background: transparent; color: #8A7A5E; font-size: 12.5px; padding: 5px 14px; border-radius: 999px; cursor: pointer; white-space: nowrap; }
.fu-modeseg button.on { background: #C4392C; color: #FFF; }
.fu-hbtn { border: 1px solid var(--border); background: #FFFEFA; color: #6B5B45; border-radius: 8px; padding: 5px 10px; font-size: 13px; cursor: pointer; }
.fu-hbtn:hover { background: #F3EAD6; }
.fu-hbtn.fu-x { width: 30px; padding: 5px 0; text-align: center; }
.fu-pill { font-size: 12px; color: #8A7A5E; background: #F3EAD6; border: 1px dashed var(--border); border-radius: 999px; padding: 4px 10px; white-space: nowrap; }

/* 主体两栏 */
.fu-cols { flex: 1; display: flex; min-height: 0; position: relative; }
/* v20.26.0 追问历史：默认收起，不占常驻分栏；点「追问历史」临时滑出覆盖显示 */
.fu-side { position: absolute; top: 0; left: 0; bottom: 0; width: 260px; z-index: 6; border-right: 1px solid var(--border); background: #FBF7EC; display: flex; flex-direction: column; min-height: 0; transform: translateX(-100%); transition: transform .18s ease; box-shadow: 6px 0 20px rgba(60,45,20,.12); }
.fu-side.fu-side-open { transform: translateX(0); }
.fu-side.fu-side-hidden { display: none; }
.fu-hbtn.on { background: #C4392C; color: #FFF; border-color: #C4392C; }
.fu-side-head { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px 6px; }
.fu-side-head b { font-size: 14px; color: #4A3F2E; }
.fu-side-head small { font-size: 12px; color: #8A7A5E; }
.fu-side-hint { font-size: 11px; color: #A9997A; padding: 0 14px 8px; border-bottom: 1px dashed var(--border); }
.fu-sessions { flex: 1; overflow-y: auto; padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.fu-side-empty { font-size: 12px; color: #A9997A; text-align: center; padding: 28px 8px; line-height: 1.8; }
.fu-sess { text-align: left; border: 1px solid var(--border); background: #FFFEFA; border-radius: 8px; padding: 8px 10px; cursor: pointer; display: flex; flex-direction: column; gap: 3px; }
.fu-sess:hover { border-color: #C4392C; }
.fu-sess.on { border-color: #C4392C; background: #FDF3EE; }
.fu-sess b { font-size: 12.5px; color: #4A3F2E; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fu-sess small { font-size: 11px; color: #A9997A; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 右侧主区 */
.fu-main { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
/* v20.26.0 正文预览与对话合并为同一滚动区（星月式）：正文完整展开在上、对话紧随其后，一起滚动，中间无分隔线 */
.fu-body { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; }
.fu-pvwrap { position: relative; display: flex; flex-direction: column; background: #FFFEFA; flex: none; }
.fu-pvwrap.fu-folded .fu-preview { display: none; }
.fu-pv-top { display: flex; align-items: center; gap: 8px; padding: 6px 12px; background: #FBF7EC; border-bottom: 1px dashed var(--border); font-size: 12px; color: #8A7A5E; }
.fu-multi { display: flex; align-items: center; gap: 4px; font-size: 12px; color: #6B5B45; cursor: pointer; }
.fu-preview { flex: none; padding: 20px 40px 24px; white-space: pre-wrap; line-height: 1.9; font-size: 15px; color: #33291A; }
.fu-mark { background: rgba(53,100,228,.26); border-bottom: 2px solid #3564E4; border-radius: 2px; padding: 0 1px; }
.fu-pv-empty { color: #A9997A; font-size: 13px; padding: 40px 0; text-align: center; }
.fu-pv-foot { display: none; }

/* 对话区 */
.fu-chat { flex: none; padding: 6px 20px 18px; display: flex; flex-direction: column; gap: 12px; }
.fu-chat-empty { color: #A9997A; font-size: 13px; text-align: center; padding: 26px 10px; }
/* v20.25.0 引用当前内容确认条（自由追问） */
.fu-citebar { border-top: 1px dashed var(--border); background: #EDF6E9; padding: 10px 14px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.fu-citebar .fu-cite-main { flex: 1; min-width: 220px; display: flex; flex-direction: column; gap: 3px; }
.fu-citebar .fu-cite-main b { font-size: 13.5px; color: #3E6B2F; }
.fu-citebar .fu-cite-main span { font-size: 12px; color: #4A3F2E; }
.fu-citebar .fu-cite-main small { font-size: 11.5px; color: #8A997A; }
.fu-citebar .fu-cite-ops { display: flex; align-items: center; gap: 8px; }
/* v20.25.0 上下文字数按钮 */
.fu-above-btn { border: 0; background: transparent; color: #3564E4; font-size: 11px; cursor: pointer; padding: 0; text-decoration: underline dotted; }
.fu-above-btn:hover { color: #2C54C2; }
/* v20.25.0 分支/模式徽标 */
.fu-branch-tag { font-style: normal; font-size: 10.5px; color: #3564E4; background: #EDF2FF; border-radius: 999px; padding: 1px 7px; margin-left: 6px; vertical-align: 1px; }
.fu-branch-tag.fu-tag-free { color: #3E6B2F; background: #EAF6E7; }
/* v20.25.0 提示词快照 */
.fu-pre { margin: 0; white-space: pre-wrap; word-break: break-word; font-family: ui-monospace, Consolas, monospace; font-size: 12px; line-height: 1.7; color: #33291A; background: #FBF7EC; border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; }
.fu-prompt-modal .fu-modal-body { padding-top: 10px; }
.fu-ctxrow em { font-style: normal; margin-left: auto; font-size: 12px; color: #3564E4; white-space: nowrap; }
.fu-histbar { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: #8A7A5E; background: #F3EAD6; border: 1px solid var(--border); border-radius: 8px; padding: 6px 12px; }
.fu-msg { display: flex; flex-direction: column; gap: 8px; }
.fu-q, .fu-a { display: flex; gap: 8px; align-items: flex-start; }
.fu-q > b, .fu-a > b { flex: none; width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; color: #FFF; }
.fu-q > b { background: #C4392C; }
.fu-a > b { background: #7A9E5F; }
.fu-q { background: #FDF3EE; border: 1px solid #F0DBCF; border-radius: 10px; padding: 10px 14px; }
.fu-q > span { flex: 1; font-size: 14px; color: #4A3F2E; white-space: pre-wrap; }
.fu-q > em { flex: none; font-style: normal; font-size: 11px; color: #A9997A; }
.fu-a { background: #FFFEFA; border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; }
.fu-a .fu-md { flex: 1; min-width: 0; font-size: 14px; line-height: 1.85; color: #33291A; word-break: break-word; }
.fu-md b { color: #B03A22; }
.fu-h { font-weight: 700; color: #4A3F2E; margin: 4px 0 2px; }
.fu-h1 { font-size: 16px; } .fu-h2 { font-size: 15px; } .fu-h3 { font-size: 14px; }
.fu-li { padding-left: 4px; }
.fu-acts { padding: 4px 0 0 34px; display: flex; gap: 8px; }

/* 底部输入区 */
.fu-inputzone { border-top: 1px solid var(--border); background: #FBF7EC; padding: 8px 14px 10px; display: flex; flex-direction: column; gap: 7px; }
.fu-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fu-label { font-size: 12.5px; color: #8A7A5E; }
.fu-tabs { display: flex; background: #EFE6D2; border-radius: 8px; padding: 2px; }
.fu-tab { border: 0; background: transparent; color: #8A7A5E; font-size: 12.5px; padding: 5px 14px; border-radius: 6px; cursor: pointer; }
.fu-tab.on { background: #3564E4; color: #FFF; }
.fu-mini { border: 1px solid var(--border); background: #FFFEFA; color: #6B5B45; font-size: 12px; border-radius: 8px; padding: 4px 10px; cursor: pointer; white-space: nowrap; }
.fu-mini:hover { background: #F3EAD6; }
.fu-mini.fu-danger { color: #C0392B; border-color: #E5B9AF; }
.fu-icon { border: 0; background: transparent; color: #8A7A5E; font-size: 12.5px; cursor: pointer; padding: 4px 6px; border-radius: 6px; white-space: nowrap; }
.fu-icon:hover { background: #F3EAD6; }
.fu-inputrow textarea.fu-input { flex: 1; min-width: 0; resize: none; border: 1px solid var(--border); border-radius: 10px; padding: 9px 12px; font-size: 14px; line-height: 1.6; background: #FFFEFA; color: #33291A; font-family: inherit; }
.fu-inputrow textarea.fu-input:focus { outline: 2px solid rgba(53,100,228,.35); }
.fu-counts { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; font-size: 11px; color: #A9997A; white-space: nowrap; }
.fu-selwrap { display: flex; align-items: center; gap: 5px; font-size: 12px; color: #8A7A5E; }
.fu-selwrap select { border: 1px solid var(--border); border-radius: 8px; background: #FFFEFA; color: #4A3F2E; font-size: 12.5px; padding: 4px 6px; max-width: 220px; }
.fu-send { border: 0; background: #C4392C; color: #FFF; font-size: 13.5px; border-radius: 9px; padding: 7px 22px; cursor: pointer; }
.fu-send:hover { background: #A93024; }
.fu-send.fu-stop { background: #8A7A5E; }
.fu-chip { display: inline-flex; align-items: center; gap: 6px; background: #F3EAD6; border: 1px solid var(--border); border-radius: 999px; padding: 3px 10px; font-size: 12px; color: #4A3F2E; }
.fu-chip i { font-style: normal; color: #A9997A; }
.fu-chip button { border: 0; background: transparent; color: #A9997A; cursor: pointer; font-size: 12px; padding: 0; }
.fu-chip button:hover { color: #C0392B; }
.fu-chip.fu-chip-on { background: #FDF3EE; border-color: #E5B9AF; color: #B03A22; }

/* 子弹窗 */
.fu-sub { position: fixed; inset: 0; z-index: 3600; display: flex; align-items: center; justify-content: center; background: rgba(32,26,18,.35); animation: fu-in .14s ease-out; }
.fu-sub-inner { background: #FFFDF8; border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 20px 60px rgba(40,30,15,.35); width: 520px; max-width: 94vw; max-height: 86vh; display: flex; flex-direction: column; overflow: hidden; }
.fu-modal { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.fu-modal-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border); background: linear-gradient(#F7F1E3, #F3EAD6); }
.fu-modal-head b { font-size: 15px; color: #4A3F2E; }
.fu-modal-head small { font-size: 11.5px; color: #A9997A; }
.fu-modal-head .fu-x { margin-left: auto; }
.fu-modal-tabs { padding: 10px 16px 0; }
.fu-search { padding: 10px 16px 0; }
.fu-search input { width: 100%; box-sizing: border-box; border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; font-size: 13px; background: #FFFEFA; color: #33291A; }
.fu-modal-body { flex: 1; overflow-y: auto; padding: 12px 16px; display: flex; flex-direction: column; gap: 8px; min-height: 120px; }
.fu-modal-foot { display: flex; align-items: center; gap: 8px; padding: 10px 16px; border-top: 1px solid var(--border); background: #FBF7EC; }
.fu-muted { font-size: 11.5px; color: #A9997A; }
.fu-btn { border: 0; background: #3564E4; color: #FFF; font-size: 13px; border-radius: 8px; padding: 6px 16px; cursor: pointer; }
.fu-btn:hover { background: #2C54C2; }
.fu-btn.fu-ghost { background: #F3EAD6; color: #6B5B45; border: 1px solid var(--border); }
.fu-btn.fu-ghost:hover { background: #EFE3C8; }
.fu-empty { color: #A9997A; font-size: 13px; text-align: center; padding: 30px 10px; line-height: 1.9; }
.fu-item { position: relative; border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; background: #FFFEFA; cursor: pointer; }
.fu-item:hover, .fu-item.on { border-color: #3564E4; background: #F5F8FF; }
.fu-item b { font-size: 13.5px; color: #4A3F2E; display: block; margin-bottom: 4px; }
.fu-item p { margin: 0; font-size: 12.5px; color: #8A7A5E; line-height: 1.7; padding-right: 60px; }
.fu-item .fu-mini { position: absolute; right: 10px; top: 10px; }
.fu-item.fu-edit { cursor: default; display: flex; flex-direction: column; gap: 6px; }
.fu-item.fu-edit:hover { border-color: var(--border); background: #FFFEFA; }
.fu-item-title, .fu-item-content { border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; font-size: 13px; background: #FFFEFA; color: #33291A; font-family: inherit; }
.fu-item-content { resize: vertical; line-height: 1.6; }
.fu-item-ops { display: flex; gap: 8px; }
.fu-field { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; color: #6B5B45; }
.fu-field input, .fu-field textarea { border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; font-size: 13.5px; background: #FFFEFA; color: #33291A; font-family: inherit; resize: vertical; line-height: 1.6; }
.fu-opt { display: flex; align-items: center; gap: 8px; border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; font-size: 13px; color: #4A3F2E; cursor: pointer; background: #FFFEFA; }
.fu-opt:hover { border-color: #3564E4; }
.fu-opt em { font-style: normal; margin-left: auto; font-size: 11.5px; color: #A9997A; white-space: nowrap; }
.fu-opt span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fu-pick-grp { font-size: 12px; color: #A9997A; padding: 6px 2px 0; border-bottom: 1px dashed var(--border); }

/* 关联知识库（全高面板） */
/* v20.27.2：关联面板尺寸修正——压过 .fu-sub-inner 的 520px 限宽，保证面板足够高、内部可滚动，按钮不再被裁切 */
.fu-lib-panel .fu-sub-inner { width: min(920px, 94vw) !important; max-width: 94vw !important; height: min(88vh, 980px) !important; max-height: 88vh !important; }
.fu-lib { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.fu-lib-work { display: flex; align-items: center; gap: 8px; padding: 10px 16px; font-size: 13px; color: #6B5B45; border-bottom: 1px dashed var(--border); }
.fu-lib-work select { border: 1px solid var(--border); border-radius: 8px; padding: 5px 10px; font-size: 13px; background: #FFFEFA; color: #4A3F2E; }
.fu-lib-title { margin: 12px 16px 0; font-size: 17px; color: #4A3F2E; }
.fu-lib-title small { font-size: 12px; color: #A9997A; font-weight: 400; }
.fu-lib-desc { margin: 8px 16px 0; font-size: 12.5px; color: #8A7A5E; line-height: 1.8; }
.fu-banner { margin: 10px 16px; background: #EAF6E7; border: 1px solid #C4E2BC; border-radius: 10px; padding: 10px 14px; font-size: 12.5px; color: #3E6B2F; line-height: 1.7; }
.fu-lib-body { flex: 1; overflow-y: auto; padding: 0 16px 16px; display: flex; flex-direction: column; gap: 10px; }
.fu-sec { border: 1px solid var(--border); border-radius: 12px; background: #FFFEFA; overflow: hidden; }
/* v20.27.4 根因修复：.fu-lib-body 是 flex 列容器，子项默认 flex-shrink:1 会被压扁，
   .fu-sec 的 overflow:hidden 再把下半截（选择按钮）裁掉——这就是“按钮只剩一条蓝边”的原因。 */
.fu-lib-body > .fu-sec { flex: none; flex-shrink: 0; }
.fu-sec-head { display: flex; align-items: center; gap: 8px; padding: 10px 14px; }
.fu-sec-head b { font-size: 14px; color: #4A3F2E; }
.fu-sec-icon { font-size: 15px; }
.fu-sec-badge { font-style: normal; font-size: 11px; color: #3564E4; background: #EDF2FF; border-radius: 999px; padding: 2px 8px; }
.fu-sec-badge.fu-dim { color: #A9997A; background: #F3EAD6; }
.fu-fold { border: 0; background: transparent; color: #A9997A; cursor: pointer; font-size: 13px; padding: 2px 6px; }
.fu-sec-body { padding: 0 14px 14px; }
.fu-sec-desc { margin: 0 0 8px; font-size: 12px; color: #A9997A; }
.fu-sec-empty { text-align: center; color: #A9997A; font-size: 12.5px; padding: 18px 0 6px; }
.fu-sec-btns { display: flex; justify-content: center; gap: 10px; margin-top: 12px; }
/* v20.27.1：选择按钮必须一眼可见——实心蓝底白字，不再用与背景同色的 ghost 样式 */
.fu-sec-btns .fu-btn, .fu-sec-btns .fu-btn.fu-ghost { background: #3564E4 !important; color: #FFF !important; border: 1px solid #3564E4 !important; font-size: 13.5px !important; padding: 9px 22px !important; border-radius: 9px !important; box-shadow: 0 2px 8px rgba(53,100,228,.25); cursor: pointer; }
.fu-sec-btns .fu-btn:hover { background: #2C54C2 !important; }
.fu-sec-btns .fu-btn.fu-ghost[data-quick] { background: #FFFEFA !important; color: #3564E4 !important; }
/* v20.27.0 选择弹层工具条 */
.fu-pk-tools { display: flex; align-items: center; gap: 8px; padding: 10px 16px 0; flex-wrap: wrap; }
.fu-pk-kw { flex: 1; min-width: 160px; border: 1px solid var(--border); border-radius: 8px; padding: 7px 12px; font-size: 13px; background: #FFFEFA; color: #33291A; }
.fu-pk-gall { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-size: 12px; color: #6B5B45; }
.fu-pick-grp { padding: 8px 2px 4px; border-bottom: 1px dashed var(--border); }
.fu-pick-modal .fu-opt em { font-size: 11.5px; }
.fu-switch { width: 36px; height: 20px; border-radius: 999px; background: #D8CDB4; position: relative; cursor: pointer; transition: background .15s; flex: none; }
.fu-switch span { position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #FFF; transition: left .15s; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.fu-switch.on { background: #3564E4; }
.fu-switch.on span { left: 18px; }
.fu-chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.fu-clear { border: 0; background: transparent; color: #C0392B; font-size: 12px; cursor: pointer; padding: 3px 6px; }
.fu-clear:hover { text-decoration: underline; }

/* 快捷输入弹层 */
.fu-quick-pop .fu-sub-inner { width: 540px; }
.fu-quick { display: flex; flex-direction: column; flex: 1; min-height: 0; }

/* 小屏适配 */
@media (max-width: 900px) {
  .fu-shell { width: 100vw; height: 100vh; border-radius: 0; }
  .fu-side { position: absolute; z-index: 5; height: 100%; box-shadow: 8px 0 24px rgba(0,0,0,.15); }
  .fu-preview { padding: 30px 16px 12px; }
  .fu-sub-inner { width: 96vw !important; }
}
/* v20.27.2 对话里的「本次已关联」摘要行 */
.fu-refs { margin: -4px 0 0 34px; font-size: 12px; color: #5B6B8A; background: #EEF3FF; border: 1px solid #D5E1FA; border-radius: 8px; padding: 4px 10px; line-height: 1.6; }
