/* 韩哥 AI · 仿 ima 界面样式 */
:root {
  --rail: #f4f3f0;
  --side: #fafaf8;
  --line: #ecebe7;
  --ink: #1b1b19;
  --ink2: #3a3a36;
  --muted: #9a9a94;
  --soft: #b9b9b2;
  --pill: #e7f0e2;
  --hover: #efeee9;
  --dark: #1f1f1d;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; color: var(--ink); background: #fff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; }
svg { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

.app { display: flex; height: 100vh; overflow: hidden; }

/* ① 图标栏 */
.rail {
  width: 72px; flex: 0 0 72px; background: var(--rail);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column; align-items: center;
  padding: 12px 0 10px; gap: 2px;
}
.brand { width: 40px; height: 40px; display: grid; place-items: center; margin-bottom: 10px; color: #eaa63f; }
.brand svg { width: 24px; height: 24px; stroke-width: 1.5; }
.rail-item {
  width: 58px; height: 56px; border: 0; border-radius: 12px; background: transparent;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  color: #5c5c56; font-size: 10.5px; cursor: pointer; transition: background .12s;
}
.rail-item svg { width: 20px; height: 20px; }
.rail-item:hover { background: #eae9e4; }
.rail-item.active { background: var(--pill); color: var(--ink); }
.rail-bottom { margin-top: auto; }

/* ② 会话栏 */
.side {
  width: 292px; flex: 0 0 292px; background: var(--side);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 12px 10px 10px; overflow: hidden;
}
.quick {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 9px 10px; border: 0; border-radius: 10px; background: transparent;
  cursor: pointer; text-align: left;
}
.quick:hover { background: var(--hover); }
.quick-ico { width: 26px; height: 26px; display: grid; place-items: center; color: #4a4a44; }
.quick-ico svg { width: 19px; height: 19px; }
.quick-txt b { display: block; font-size: 13.5px; font-weight: 600; color: var(--ink); }
.quick-txt small { display: block; font-size: 11.5px; color: var(--muted); margin-top: 2px; }

.side-sec {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 10px 6px; font-size: 12px; color: #8e8e88;
}
.icon-btn {
  width: 26px; height: 26px; border: 0; border-radius: 8px; background: transparent;
  color: #7a7a74; display: grid; place-items: center; cursor: pointer; padding: 0;
}
.icon-btn svg { width: 16px; height: 16px; }
.icon-btn:hover { background: #efeeea; color: var(--ink); }

.search-wrap { padding: 0 8px 6px; }
.search-wrap input {
  width: 100%; height: 30px; border-radius: 8px; border: 1px solid #e5e4df;
  background: #fff; padding: 0 10px; font-size: 12.5px; outline: none; color: var(--ink);
}

.hist { flex: 1; overflow-y: auto; padding: 4px 6px 0; }
.hist-item {
  display: flex; align-items: center; gap: 8px; padding: 9px 10px;
  border-radius: 10px; font-size: 13px; color: #353531; cursor: pointer; position: relative;
}
.hist-item:hover { background: var(--hover); }
.hist-item.active { background: var(--pill); }
.hist-item .ico { display: grid; place-items: center; color: #6b6b65; }
.hist-item .ico svg { width: 16px; height: 16px; }
.hist-item .t { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hist-item .del {
  opacity: 0; border: 0; background: transparent; color: #999990;
  font-size: 14px; line-height: 1; cursor: pointer; padding: 2px 3px; border-radius: 6px;
}
.hist-item:hover .del { opacity: 1; }
.hist-item .del:hover { background: #e6e5df; color: #333; }
.side-note { font-size: 11px; color: #b3b3ac; text-align: center; padding: 10px 0 4px; }

/* ③ 主区 */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; background: #fff; }
.topbar { height: 52px; flex: 0 0 52px; display: flex; align-items: center; gap: 12px; padding: 0 20px; }
.top-title { flex: 1; font-size: 13px; color: #a5a59e; padding-left: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me {
  width: 34px; height: 34px; border-radius: 10px; background: var(--dark); color: #fff;
  border: 0; font-size: 13px; cursor: default; flex: 0 0 auto;
}
.stage { flex: 1; position: relative; overflow: hidden; }
.chat { height: 100%; display: flex; flex-direction: column; }

/* 消息区 */
.msgs { flex: 1; overflow-y: auto; padding: 8px 0 12px; scroll-behavior: smooth; }
.msg { display: flex; gap: 10px; width: 100%; max-width: 860px; margin: 0 auto; padding: 14px 24px; }
.msg .av {
  width: 28px; height: 28px; border-radius: 50%; background: var(--dark); color: #fff;
  font-size: 12px; display: grid; place-items: center; flex: 0 0 auto; margin-top: 2px;
}
.msg .body { min-width: 0; flex: 1; }
.msg .who { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.msg .stream { font-size: 15px; line-height: 1.85; color: #22221f; word-break: break-word; }
/* 每句话一个浅色气泡：和用户那边的深色气泡分开，一眼能看出是一条一条发过来的 */
.msg .stream .p {
  width: fit-content; max-width: 90%;
  padding: 9px 14px; margin: 0 0 8px;
  background: #f3f2ed; border-radius: 15px; border-top-left-radius: 5px;
  transform-origin: left bottom;
  animation: qpop .5s cubic-bezier(.34, 1.56, .64, 1) both;
}
.msg .stream .p:last-child { margin-bottom: 0; }
/* Q 弹弹出：像 QQ 消息那样带一点回弹过冲（bezier 过冲把 scale 顶到 >1 再落定） */
@keyframes qpop {
  0%   { opacity: 0; transform: translateY(10px) scale(.82); }
  60%  { opacity: 1; }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
.msg .stream b { font-weight: 600; }
.msg .stream code { background: #e8e7e0; border-radius: 5px; padding: 1px 5px; font-size: 13px; }
.msg .tools { display: flex; gap: 4px; margin-top: 8px; opacity: 0; transition: opacity .15s; }
.msg:hover .tools { opacity: 1; }
.msg.user { justify-content: flex-end; }
.msg.user .bubble {
  background: var(--dark); color: #fff; padding: 10px 14px; border-radius: 16px;
  border-top-right-radius: 6px; max-width: 72%; font-size: 15px; line-height: 1.7;
  white-space: pre-wrap; word-break: break-word;
  transform-origin: right bottom;
  animation: qpop .5s cubic-bezier(.34, 1.56, .64, 1) both;
}
.msg.user .bubble img { max-width: 220px; border-radius: 10px; display: block; margin-top: 6px; }
.msg.error .stream .p { background: #fdf1ee; color: #b3412f; }

/* 四项交付产物：标注图 / 参考图 / 改图（按到达顺序插在文字之间） */
/* 参考图一律 200×140 裁切，排成三列，不会一大一小参差不齐 */
.msg .shot { display: inline-block; vertical-align: top; width: 200px; margin: 2px 10px 12px 0; }
.msg .shot:last-child { margin-bottom: 12px; }
.msg .shot a {
  display: block; border: 1px solid var(--line); border-radius: 12px;
  overflow: hidden; background: #faf9f6; line-height: 0; transition: border-color .15s;
}
.msg .shot a:hover { border-color: #d3d1c8; }
.msg .shot img { display: block; width: 100%; height: 140px; object-fit: cover; }
.msg .shot figcaption {
  font-size: 12px; color: var(--muted); line-height: 1.5; padding: 6px 2px 0; height: 42px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
/* 标注图、改后图：要看细节，放大、不裁剪。宽度写死，图还在下载时也不会窄一下宽一下 */
.msg .shot.big { width: auto; max-width: 100%; }
.msg .shot.big img { width: 640px; height: auto; max-width: 100%; }
.msg .shot.big figcaption { display: block; height: auto; max-width: 700px; }

/* 流式过程中的阶段提示：四阶段进度条 + 当前动作 */
.stage-tip { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.st-bar { display: flex; gap: 4px; flex-wrap: wrap; }
.st-bar i {
  font-style: normal; font-size: 10.5px; line-height: 1; padding: 4px 9px;
  border-radius: 99px; background: #eceae4; color: #9a9891;
  transition: background .25s, color .25s;
}
.st-bar i.on { background: #2f2f2b; color: #fff; }
.st-bar i.done { background: #dcead9; color: #3f7d46; }
.st-txt { color: var(--muted); font-size: 13.5px; }
.st-txt::after {
  content: ""; display: inline-block; width: 5px; height: 5px; border-radius: 50%;
  background: var(--soft); margin-left: 6px; vertical-align: 1px;
  animation: blink 1.1s infinite;
}
.cursor { display: inline-block; width: 7px; height: 15px; background: var(--ink); animation: blink 1s infinite; vertical-align: -2px; margin-left: 2px; }
@keyframes blink { 50% { opacity: 0; } }

/* 欢迎页 */
.welcome { max-width: 860px; margin: 0 auto; padding: 44px 24px 0; }
.w-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.w-logo { width: 30px; height: 30px; border-radius: 50%; background: var(--dark); color: #fff; display: grid; place-items: center; font-size: 13px; }
.w-name { font-size: 15px; font-weight: 600; }
.w-text { font-size: 15px; line-height: 1.9; color: var(--ink); margin: 0; }
.w-list { list-style: none; margin: 12px 0 0; padding: 0; }
.w-list li { margin: 2px 0; }
.w-list button {
  position: relative; width: 100%; display: block; text-align: left; border: 0;
  background: transparent; border-radius: 8px; padding: 7px 10px 7px 18px;
  font-family: inherit; font-size: 14.5px; color: #3a3a36; cursor: pointer;
}
.w-list button::before { content: ""; position: absolute; left: 5px; top: 50%; margin-top: -2.5px; width: 5px; height: 5px; border-radius: 50%; background: var(--soft); }
.w-list button:hover { background: #f6f5f1; color: #000; }
.w-list button:focus-visible { outline: 2px solid #cddcc6; outline-offset: 1px; }
.w-div { border-top: 1px solid #efeeea; margin: 22px 0 12px; }
.w-follow button { color: #6f6f68; font-size: 14px; }

/* 输入区 */
.composer { flex: 0 0 auto; padding: 6px 0 14px; }
.cbox {
  width: calc(100% - 48px); max-width: 860px; margin: 0 auto;
  border: 1px solid #e5e4df; border-radius: 22px; background: #fff;
  box-shadow: 0 2px 12px rgba(0, 0, 0, .04); padding: 2px;
}
#input {
  width: 100%; border: 0; outline: none; resize: none; background: transparent;
  font-size: 15px; line-height: 1.6; padding: 12px 14px 4px; max-height: 160px;
  font-family: inherit; color: var(--ink);
}
.cbar { display: flex; align-items: center; gap: 8px; padding: 2px 8px 8px; }
.model-wrap { position: relative; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; border: 1px solid #e3e2dd;
  background: #fff; border-radius: 999px; padding: 6px 12px; font-size: 12.5px;
  color: var(--ink2); cursor: pointer;
}
.chip:hover { background: #f6f5f2; }
.caret { font-size: 9px; color: #8e8e88; }
.at {
  border: 0; background: transparent; color: #6f6f69; font-size: 15px;
  width: 28px; height: 28px; border-radius: 50%; cursor: pointer; flex: 0 0 auto;
}
.at:hover { background: #f2f1ed; }
.cbar-right { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.send {
  width: 34px; height: 34px; border-radius: 50%; border: 0; background: #e9e8e3;
  color: #a5a5a0; display: grid; place-items: center; cursor: pointer; transition: .15s;
}
.send svg { width: 17px; height: 17px; }
.send.on { background: var(--dark); color: #fff; }
.disc { text-align: center; font-size: 11.5px; color: #bcbcb5; margin-top: 10px; }

/* 附件 */
.attach-row { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 12px 0; }
.thumb { position: relative; width: 56px; height: 56px; border-radius: 10px; overflow: hidden; border: 1px solid #e5e4df; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb button {
  position: absolute; top: 2px; right: 2px; width: 16px; height: 16px; border-radius: 50%;
  border: 0; background: rgba(0, 0, 0, .55); color: #fff; font-size: 10px; line-height: 1; cursor: pointer;
}

/* 模型菜单 */
.model-menu {
  position: absolute; bottom: 42px; left: 0; width: 240px; z-index: 30;
  background: #fff; border: 1px solid #e7e6e1; border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .09); padding: 6px;
}
.mi { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border-radius: 8px; cursor: pointer; font-size: 13px; color: var(--ink2); }
.mi:hover { background: #f4f3ef; }
.mi.active { background: var(--pill); }
.mi .tag { color: #9b9b94; font-size: 11.5px; }

/* 看图 / 改图选择器（多模型可切换版）：菜单要放得下长模型名和实测备注，所以加宽并可滚动 */
.pick-row { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 12px 0; }
.pick-label { color: #9b9b94; font-size: 11px; margin-right: 2px; }
.model-menu.wide { width: 344px; max-width: 84vw; max-height: 58vh; overflow-y: auto; }
.mi.pick { flex-wrap: wrap; align-items: flex-start; }
.mi.pick .note { flex: 0 0 100%; color: #9b9b94; font-size: 11px; line-height: 1.4; margin-top: 3px; }

/* 其他模块占位 */
.placeholder { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; }
.ph-ico { width: 56px; height: 56px; border-radius: 16px; background: #f2f1ec; display: grid; place-items: center; color: #6f6f69; }
.ph-ico svg { width: 26px; height: 26px; }
.placeholder h2 { font-size: 17px; font-weight: 600; color: #22221f; margin: 0; }
.placeholder p { font-size: 13.5px; color: #999990; margin: 0; max-width: 440px; text-align: center; line-height: 1.7; }
.ph-btn { margin-top: 6px; border: 1px solid #dedcd5; background: #fff; border-radius: 10px; padding: 9px 16px; font-size: 13px; color: var(--ink2); cursor: pointer; }
.ph-btn:hover { background: #f6f5f1; }

/* 滚动条 */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #dedcd5; border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: #cfcdc5; }
::-webkit-scrollbar-track { background: transparent; }

/* 窄屏：会话栏变抽屉 */
.side-toggle { display: none; }
.side-mask { position: fixed; inset: 0; background: rgba(0, 0, 0, .18); z-index: 40; }

@media (max-width: 980px) {
  .side-toggle { display: grid; }
  .side {
    position: fixed; left: 72px; top: 0; bottom: 0; z-index: 50;
    width: 280px; flex-basis: 280px; transform: translateX(-104%);
    transition: transform .22s ease; box-shadow: 6px 0 24px rgba(0, 0, 0, .08);
  }
  .app.side-open .side { transform: none; }
  .cbox { width: calc(100% - 20px); }
  .msg { padding: 12px 14px; }
}

@media (max-width: 640px) {
  .rail { width: 56px; flex-basis: 56px; }
  .rail-item { width: 48px; height: 52px; font-size: 9.5px; }
  .side { left: 56px; width: 78vw; }
  .topbar { padding: 0 12px; }
  .welcome { padding: 28px 16px 0; }
}

/* 触屏没有 hover：操作按钮常显 */
@media (hover: none) {
  .msg .tools { opacity: 1; }
  .hist-item .del { opacity: 1; }
}

/* ---------- 借鉴 ima 的四组功能 ---------- */

/* hidden 复位：.mask/.notes-view 自带 display:flex 会盖掉浏览器默认的
   [hidden]{display:none}，不复位遮罩就常驻全屏拦掉所有点击（实测踩过） */
[hidden] { display: none !important; }

/* 停止键：流式期间发送键变红底方块 */
.send.stop { background: #c4483d; color: #fff; }
.send.stop:hover { background: #a83a30; }

/* 点评序号按钮：点一下联动标注图上的框 */
.idx {
  border: 0; background: transparent; padding: 0 1px; font: inherit; color: #b3543f;
  cursor: pointer; border-radius: 4px; font-weight: 600;
}
.idx:hover { background: #f3e3dd; }

/* 标注图上的透明高亮框层 */
.imgwrap { position: relative; display: block; }
.hl {
  position: absolute; display: none; border: 3px solid #ff5a4e; border-radius: 4px;
  background: rgba(255, 90, 78, .16); box-shadow: 0 0 0 2000px rgba(20, 20, 18, .25);
  pointer-events: none;
}
.hl.on { display: block; }

/* 口吻菜单里的自定义指令输入框 */
.instr-wrap { border-top: 1px solid #efeeea; margin-top: 4px; padding: 8px 6px 4px; }
.instr-wrap textarea {
  width: 100%; border: 1px solid #e3e2dd; border-radius: 8px; resize: none;
  font-family: inherit; font-size: 12.5px; line-height: 1.5; padding: 6px 8px;
  color: var(--ink); outline: none; background: #fbfaf7;
}
.instr-wrap textarea:focus { border-color: #c9c7bf; }

/* 笔记视图：左列表右正文 */
.notes-view { display: flex; height: 100%; min-height: 0; }
.nv-list {
  flex: 0 0 240px; border-right: 1px solid var(--line); overflow-y: auto; padding: 12px 8px;
}
.nv-item {
  position: relative; display: flex; flex-direction: column; gap: 2px;
  padding: 9px 26px 9px 10px; border-radius: 10px; cursor: pointer;
}
.nv-item:hover { background: #f4f3ef; }
.nv-item.active { background: var(--pill); }
.nv-item .t { font-size: 13.5px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nv-item small { font-size: 11px; color: #9b9b94; }
.nv-item .del {
  position: absolute; right: 6px; top: 8px; border: 0; background: transparent;
  color: #9b9b94; font-size: 14px; cursor: pointer; opacity: 0;
}
.nv-item:hover .del { opacity: 1; }
.nv-body { flex: 1; overflow-y: auto; padding: 24px 32px; max-width: 860px; }
.nv-body h2 { font-size: 19px; margin: 0 0 6px; }
.nv-body h3 { font-size: 15px; margin: 20px 0 6px; color: #4a4a45; }
.nv-body p { font-size: 14px; line-height: 1.85; margin: 4px 0; color: var(--ink); }
.nv-meta { font-size: 12px; color: #9b9b94; margin-bottom: 12px; }
.nv-empty { color: #9b9b94; font-size: 13.5px; padding: 16px 10px; line-height: 1.8; }
.nv-bar { margin-bottom: 10px; }
.nv-bar .ph-btn { margin: 0; padding: 6px 12px; font-size: 12.5px; }
.nv-shot { margin: 10px 0; }
.nv-shot img { max-width: 440px; width: 100%; border: 1px solid var(--line); border-radius: 12px; display: block; }
.nv-shot figcaption { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* 模态框：脑图 / 自测测验 */
.mask {
  position: fixed; inset: 0; background: rgba(20, 20, 18, .35); z-index: 60;
  display: flex; align-items: center; justify-content: center; padding: 24px;
  animation: mask-in .18s ease-out;
}
.modal {
  background: #fff; border-radius: 16px; width: min(1020px, 94vw); max-height: 88vh;
  display: flex; flex-direction: column; box-shadow: 0 16px 48px rgba(0, 0, 0, .18);
  animation: modal-in .22s cubic-bezier(.2, .9, .3, 1.15);
}
@keyframes mask-in { from { opacity: 0; } }
@keyframes modal-in { from { opacity: 0; transform: scale(.96) translateY(8px); } }
.m-head {
  display: flex; align-items: center; gap: 10px; padding: 14px 18px;
  border-bottom: 1px solid var(--line); font-size: 15px;
}
.m-head b { flex: 0 0 auto; }
.m-act { margin-left: auto; display: flex; gap: 8px; }
.m-act .ph-btn { margin: 0; padding: 6px 12px; font-size: 12.5px; }
.m-head .icon-btn { font-size: 16px; }
.m-body { overflow: auto; padding: 18px; }
.m-loading { color: #9b9b94; font-size: 13.5px; padding: 28px 8px; text-align: center; }

/* 脑图 SVG */
.mm-scroll { overflow: auto; }
.mm-root { fill: #2f2f2b; }
.mm-issue { fill: #f0e8dd; stroke: #d8c9b4; transition: stroke .12s; }
.mm-leaf { fill: #f7f6f2; stroke: #e3e2dd; transition: stroke .12s; }
.mm-issue:hover { stroke: #b39b7d; }
.mm-leaf:hover { stroke: #c9c7bf; }
.mm-e { fill: none; stroke: #c9c7bf; stroke-width: 1.4; }
.mm-t { font-size: 12.5px; fill: #22221f; font-family: inherit; }
.mm-tr { fill: #fff; }

/* 自测测验 */
.qz { margin-bottom: 22px; }
.qz-q { font-size: 14.5px; font-weight: 600; line-height: 1.7; margin-bottom: 8px; }
.qz-o {
  display: block; width: 100%; text-align: left; border: 1px solid #e3e2dd; background: #fbfaf7;
  border-radius: 10px; padding: 8px 12px; margin: 6px 0; font-family: inherit;
  font-size: 13.5px; line-height: 1.6; color: var(--ink); cursor: pointer;
}
.qz-o:hover:not(:disabled) { background: #f2f1ec; }
.qz-o:disabled { cursor: default; opacity: .82; }
.qz-o.right { border-color: #7ba05b; background: #eef3e6; opacity: 1; }
.qz-o.wrong { border-color: #c4483d; background: #f7e9e7; opacity: 1; }
.qz-why { font-size: 12.5px; color: #6f6f69; line-height: 1.7; margin-top: 6px; padding-left: 4px; }

/* 轻提示 */
#toast {
  position: fixed; left: 50%; bottom: 34px; transform: translateX(-50%) translateY(8px);
  background: #2f2f2b; color: #fff; font-size: 13px; padding: 9px 16px; border-radius: 999px;
  opacity: 0; pointer-events: none; transition: .2s; z-index: 70;
}
#toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }

/* 改后图 vs 原图：拖拽分割线对比 */
.cmp {
  position: relative; max-width: 700px; border: 1px solid var(--line); border-radius: 12px;
  overflow: hidden; background: #faf9f6; line-height: 0; cursor: ew-resize; touch-action: none;
}
.cmp-base { display: block; width: 100%; height: auto; }
.cmp-top { position: absolute; inset: 0; clip-path: inset(0 0 0 50%); }
.cmp-top img { display: block; width: 100%; height: 100%; object-fit: fill; }
.cmp-bar {
  position: absolute; top: 0; bottom: 0; left: 50%; width: 2px; margin-left: -1px;
  background: #fff; box-shadow: 0 0 6px rgba(0, 0, 0, .45);
}
.cmp-bar i {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 28px; height: 28px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 5px rgba(0, 0, 0, .35);
}
.cmp-bar i::after {
  content: "◂ ▸"; position: absolute; inset: 0; display: flex; align-items: center;
  justify-content: center; font-size: 10px; font-style: normal; color: #55534c;
}
.cmp-tag {
  position: absolute; top: 8px; font-size: 11px; line-height: 1; padding: 4px 8px;
  border-radius: 6px; background: rgba(24, 24, 22, .55); color: #fff; pointer-events: none;
}
.cmp-tag.l { left: 8px; }
.cmp-tag.r { right: 8px; }
.cmp-full { color: #b3543f; text-decoration: none; font-size: 12px; white-space: nowrap; }
.cmp-full:hover { text-decoration: underline; }

/* 改后图图注上的两个动作按钮：一键放大 / 一键下载 */
.img-act { border: 1px solid #c9c4b8; background: #fff; color: #555; border-radius: 6px;
  cursor: pointer; font-size: 12px; padding: 2px 10px; margin-left: 6px; white-space: nowrap; }
.img-act:hover { border-color: #b3543f; color: #b3543f; }

/* 观点气泡末尾的追问圈圈 */
.fu-circle { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px;
  margin-left: 8px; border-radius: 50%; border: 1px solid #b3543f; color: #b3543f; background: #fff;
  font-size: 12px; line-height: 1; cursor: pointer; vertical-align: middle; padding: 0; }
.fu-circle:hover, .fu-circle.on { background: #b3543f; color: #fff; }
/* 就地展开的追问详解：grid 行高 0fr→1fr 动画，平滑挤压推开后面内容；收起回 0 恢复原间距 */
.fu-panel { display: grid; grid-template-rows: 0fr; margin: 0; opacity: 0;
  transition: grid-template-rows .42s cubic-bezier(.3, 1.25, .5, 1), margin .42s ease, opacity .3s ease; }
.fu-panel.open { grid-template-rows: 1fr; margin: 6px 0 10px; opacity: 1; }
.fu-inner { overflow: hidden; min-height: 0; }
.fu-card { padding: 10px 14px; background: #fbf7f2; border: 1px solid #e8d9c8;
  border-left: 3px solid #b3543f; border-radius: 8px; font-size: 14px; line-height: 1.8;
  transform-origin: top left; }
.fu-panel.open .fu-card { animation: qpop .5s cubic-bezier(.34, 1.56, .64, 1) both; }
.fu-head { font-weight: 600; color: #b3543f; font-size: 13px; margin-bottom: 6px;
  display: flex; justify-content: space-between; align-items: center; }
.fu-x { border: none; background: none; color: #999; cursor: pointer; font-size: 16px; line-height: 1; padding: 0 2px; }
.fu-x:hover { color: #b3543f; }
.fu-err { color: #b3412f; }
.fu-retry { border: 1px solid #b3543f; background: #fff; color: #b3543f; border-radius: 5px;
  cursor: pointer; font-size: 12px; padding: 1px 8px; }

/* 一键放大：遮罩占满整个网页（class 切换显隐，不用 hidden 属性） */
#lightbox { display: none; position: fixed; inset: 0; background: rgba(20, 18, 14, .92);
  z-index: 999; align-items: center; justify-content: center; cursor: zoom-out; }
#lightbox.on { display: flex; }
#lightbox img { max-width: 96vw; max-height: 96vh; object-fit: contain; cursor: default;
  box-shadow: 0 8px 40px rgba(0, 0, 0, .5); }
.lb-close { position: absolute; top: 16px; right: 20px; width: 36px; height: 36px; border-radius: 50%;
  border: none; background: rgba(255, 255, 255, .15); color: #fff; font-size: 22px; cursor: pointer; }
.lb-close:hover { background: rgba(255, 255, 255, .3); }
#lightbox.on img { animation: lbIn .3s cubic-bezier(.34, 1.56, .64, 1) both; }
@keyframes lbIn { from { opacity: 0; transform: scale(.9); } to { opacity: 1; transform: scale(1); } }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 46px; height: 46px;
  border-radius: 50%; border: none; background: rgba(255, 255, 255, .12); color: #fff; font-size: 30px;
  line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.lb-nav:hover { background: rgba(255, 255, 255, .28); }
.lb-nav:disabled { opacity: .25; cursor: default; }
.lb-prev { left: 18px; }
.lb-next { right: 18px; }
.lb-bar { position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 14px; background: rgba(0, 0, 0, .45); padding: 7px 16px; border-radius: 20px; }
.lb-count { color: #eee; font-size: 13px; }
.lb-dl { border: 1px solid rgba(255, 255, 255, .4); background: rgba(255, 255, 255, .12); color: #fff;
  border-radius: 14px; cursor: pointer; font-size: 13px; padding: 3px 14px; }
.lb-dl:hover { background: rgba(255, 255, 255, .28); }
/* 追问加载：三个跳动小点，比静态“…”更有“在干活”的感觉 */
.fu-loading { color: #8a7a66; }
.fu-loading i { display: inline-block; width: 4px; height: 4px; margin-left: 3px; border-radius: 50%;
  background: #b3543f; vertical-align: middle; animation: fuDot 1s infinite ease-in-out; }
.fu-loading i:nth-child(2) { animation-delay: .15s; }
.fu-loading i:nth-child(3) { animation-delay: .3s; }
@keyframes fuDot { 0%, 60%, 100% { transform: translateY(0); opacity: .4; } 30% { transform: translateY(-4px); opacity: 1; } }
/* 尊重系统“减弱动效”：关闭所有动画/过渡，避免眩晕 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* 点评依据：RAG 命中原文卡片 */
.bs-item {
  border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px;
  margin-bottom: 10px; background: #fbfaf7;
}
.bs-meta { font-size: 11.5px; color: #9b9b94; margin-bottom: 6px; }
.bs-text { font-size: 13.5px; line-height: 1.75; color: var(--ink2); }
.bs-note { font-size: 12px; color: #9b9b94; margin-top: 4px; }

/* 连接失败后的重发按钮 */
.btn-retry {
  display: inline-block; margin-top: 8px; border: 1px solid #dedcd5; background: #fff;
  border-radius: 8px; padding: 5px 12px; font-size: 12.5px; color: var(--ink2); cursor: pointer;
}
.btn-retry:hover { background: #f6f5f1; }

/* 四轮：停止标记 / 测验结算 / 脑图节点可点 / 指令计数 / 动效 refinement */
.stopped-tag { color: #9b9b94; font-size: 12px; }
.qz-score { font-size: 12.5px; color: var(--ink2); margin-right: 8px; }
.mm-issue { cursor: pointer; }
#instrCount { display: block; text-align: right; font-size: 11px; color: #9b9b94; margin-top: 2px; }
.cmp:focus-visible { outline: 2px solid #b3543f; outline-offset: 2px; }
.cmp-bar i { transition: transform .15s; }
.cmp:hover .cmp-bar i, .cmp:focus-visible .cmp-bar i { transform: translate(-50%, -50%) scale(1.12); }
.qz-o.wrong { animation: qz-shake .3s; }
@keyframes qz-shake { 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }
.bs-item { animation: bs-in .3s ease-out backwards; }
.bs-item:nth-child(2) { animation-delay: .06s; }
.bs-item:nth-child(3) { animation-delay: .12s; }
@keyframes bs-in { from { opacity: 0; transform: translateY(6px); } }
.nv-shot a { display: block; line-height: 0; border-radius: 12px; overflow: hidden; }
.nv-shot a:hover img { opacity: .92; }
