/* 本体助手独立页面（/agent/）。左：对话列表；中：对话；右：画布（要看图时才出现）。 */
:root {
  --bg: #ffffff; --side: #f7f7f8; --ink: #1f2328; --muted: #6b7280; --line: #e5e7eb; --soft: #f3f4f6;
  --accent: #4f46e5; --accent-soft: #eef2ff; --ok: #15803d; --err: #b91c1c; --warn: #b45309;
  --me: #f1f1f4; --radius: 12px; --side-w: 260px; --panel-w: 48vw; --split-w: 6px; --rail-w: 52px;
  --surface: #f4f5f9; --risk: #c8413a; --risk-bg: #fcecea; --warnc: #b7700f; --warn-bg: #fdf3e1; --okc: #1f7a5c; --ok-bg: #e6f3ec;
  --shadow: 0 1px 2px rgba(18,24,52,.04), 0 6px 18px -12px rgba(18,24,52,.22);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #17181b; --side: #1e1f23; --ink: #e8e8ea; --muted: #9ca3af; --line: #2d2f34; --soft: #24262b;
          --accent: #8b8cf6; --accent-soft: #2a2b45; --ok: #4ade80; --err: #f87171; --warn: #fbbf24; --me: #26282d;
          --surface: #141518; --risk: #f2877f; --risk-bg: #3a2323; --warnc: #f0b45a; --warn-bg: #3a301d; --okc: #5fcf9f; --ok-bg: #1b3128;
          --shadow: 0 1px 2px rgba(0,0,0,.3); }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); font-size: 15px; line-height: 1.6; }
button { font: inherit; color: inherit; background: none; border: 1px solid var(--line); border-radius: 8px; padding: 5px 10px; cursor: pointer; }
button:hover { background: var(--soft); }
button.primary, a.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.primary:hover { filter: brightness(1.05); }
button:disabled { opacity: .45; cursor: not-allowed; }
button.icon { border: 0; padding: 2px 8px; font-size: 18px; line-height: 1; color: var(--muted); }
button.link { border: 0; padding: 0 4px; color: var(--accent); }
a { color: var(--accent); text-decoration: none; }
.muted { color: var(--muted); font-size: 13px; }
.err { color: var(--err); }
.boot, .gate { max-width: 420px; margin: 18vh auto; text-align: center; }
.gate a.primary { display: inline-block; padding: 8px 18px; border-radius: 8px; }

.app { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); height: 100vh; }
.app { transition: grid-template-columns .22s ease; }
body.panel-open .app { grid-template-columns: var(--side-w) minmax(0, 1fr) var(--split-w) var(--panel-w); }
body.panel-open.panel-rail .app { grid-template-columns: var(--side-w) minmax(0, 1fr) var(--rail-w); }
body.dragging .app { transition: none; }
body.dragging { user-select: none; cursor: col-resize; }
body.dragging iframe { pointer-events: none; }
body.panel-open.panel-full .app { grid-template-columns: minmax(0, 1fr); }
body.panel-full .side { display: none; }

/* 左栏：展开时 .sfull，收起时 .smini（约 56px 的图标栏） */
.side { background: var(--side); border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 14px 12px; gap: 10px; min-height: 0; overflow: hidden; }
.sfull { display: flex; flex-direction: column; gap: 10px; flex: 1; min-height: 0; }
.smini { display: none; flex-direction: column; align-items: center; gap: 4px; flex: 1; min-height: 0; }
.smini .logo { margin-bottom: 6px; }
.smini button, .smini a { width: 38px; height: 38px; padding: 0; border: 0; border-radius: 10px; display: grid; place-items: center; color: var(--muted); background: none; }
.smini button:hover, .smini a:hover { background: var(--soft); color: var(--ink); }
.smini .sg { width: 24px; height: 1px; background: var(--line); margin: 4px 0; }
.smini .sp { flex: 1; }
.brand .sidetog { margin-left: auto; width: 28px; height: 28px; flex: none; }
.brand { white-space: nowrap; min-width: 0; }
.brand .ed { flex: none; }
body.side-mini { --side-w: 56px; }
@media (min-width: 901px) {
  body.side-mini .side { padding: 14px 8px; }
  body.side-mini .sfull { display: none; }
  body.side-mini .smini { display: flex; }
}
.brand { display: flex; align-items: center; gap: 8px; font-size: 16px; padding: 2px 4px; }
.logo { width: 26px; height: 26px; border-radius: 7px; background: var(--accent); color: #fff; display: grid; place-items: center; font-size: 14px; }
.proj { display: flex; flex-direction: column; gap: 2px; font-size: 12px; color: var(--muted); }
.proj select { font: inherit; font-size: 14px; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 5px 8px; }
.new { background: var(--bg); text-align: left; padding: 8px 10px; }
.hist-h { font-size: 12px; color: var(--muted); padding: 4px 4px 0; }
.hist { flex: 1; overflow: auto; display: flex; flex-direction: column; gap: 2px; }
.hist button { border: 0; text-align: left; display: flex; flex-direction: column; padding: 6px 8px; border-radius: 8px; }
.hist button span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14px; }
.hist button small { color: var(--muted); font-size: 11px; }
.hist button.on { background: var(--accent-soft); }
.foot { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; border-top: 1px solid var(--line); padding-top: 10px; font-size: 13px; }
.foot button { padding: 3px 9px; font-size: 13px; }
.foot a { margin-left: auto; font-size: 13px; }

/* 中栏 */
.chat { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.bar { display: flex; align-items: center; gap: 10px; padding: 10px 18px; border-bottom: 1px solid var(--line); }
.bar #toggleSide { display: none; }
.membtn { display: inline-flex; align-items: center; gap: 6px; flex: none; margin-left: auto; padding: 4px 10px; border-radius: 999px; font-size: 13px; background: var(--bg); }
.views ~ .membtn { margin-left: 8px; }
body.panel-open .membtn { margin-left: auto; }
.membtn em { font-style: normal; font-size: 11.5px; padding: 0 7px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); white-space: nowrap; }
.membtn em.warn { background: var(--warn-bg); color: var(--warnc); }
.mempop { position: fixed; z-index: 26; width: min(420px, calc(100vw - 24px)); max-height: min(72vh, 640px); display: flex; flex-direction: column;
  background: var(--bg); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 16px 44px rgba(18,24,52,.22); overflow: hidden; }
.mempop .mph { display: flex; align-items: baseline; gap: 10px; padding: 12px 14px 10px; border-bottom: 1px solid var(--line); }
.mempop .mph b { font-size: 15px; }
.mempop .mph .muted { flex: 1; }
.mempop .mpb { overflow: auto; padding: 10px 14px 14px; }
.mempop section { margin-top: 12px; }
.mempop section:first-of-type { margin-top: 6px; }
.mempop h4 { margin: 0 0 6px; font-size: 13px; display: flex; gap: 6px; align-items: baseline; }
.mempop h4 small { color: var(--muted); font-weight: 400; }
.mempop .mg-pending h4 { color: var(--warnc); }
.mempop .memadd { width: 100%; text-align: left; border-style: dashed; color: var(--muted); }
.mempop .memnew { margin: 0; }
.mempop .mems li { padding: 7px 10px; }
.mempop .mems li p { font-size: 13.5px; }
.mempop .mg-core li { border-color: color-mix(in srgb, var(--accent) 30%, var(--line)); }
.mempop .mg-pending li { border-color: color-mix(in srgb, var(--warnc) 35%, var(--line)); background: color-mix(in srgb, var(--warn-bg) 50%, var(--bg)); }
.local-line { margin: 0; font-size: 13.5px; color: var(--muted); border-left: 3px solid var(--accent); padding: 4px 10px; background: var(--accent-soft); border-radius: 0 8px 8px 0; }
/* 交接卡：本体助手把场景交给系统助手后，对话里跟着显示那边的进度 */
.handoff { border: 1px solid var(--line); border-left: 3px solid var(--mc, var(--accent)); border-radius: 10px; background: var(--bg); padding: 10px 12px; box-shadow: var(--shadow); }
.handoff p { margin: 4px 0 0; }
.handoff .hoh { display: flex; align-items: center; gap: 8px; color: var(--ink); }
.handoff .hoh i { width: 8px; height: 8px; border-radius: 50%; background: var(--mc, var(--accent)); flex: none; }
.handoff .hoh b { font-size: 13.5px; }
.handoff .hst { margin-left: auto; font-size: 12px; padding: 1px 9px; border-radius: 999px; background: var(--soft); color: var(--muted); white-space: nowrap; }
.handoff .hst.s-busy { background: var(--accent-soft); color: var(--accent); }
.handoff .hst.s-busy::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 5px; border-radius: 50%; background: currentColor; vertical-align: 1px; animation: blink 1.2s infinite; }
.handoff .hst.s-wait { background: var(--warn-bg); color: var(--warnc); }
.handoff .hst.s-done { background: var(--ok-bg); color: var(--okc); }
.handoff .hst.s-read { background: var(--accent-soft); color: var(--accent); }
.handoff .hosum { color: var(--ink); font-size: 13.5px; padding: 6px 10px; background: var(--surface); border-radius: 8px; margin-top: 8px; }
.handoff .hof { margin-top: 6px; }
.handoff .hof .link { padding: 0; font-size: 13px; }
.title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tag { white-space: nowrap; font-size: 11px; padding: 1px 7px; border-radius: 999px; background: var(--soft); color: var(--muted); }
.tag.bad { color: var(--err); }
.views { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.views button { font-size: 13px; padding: 3px 10px; border-radius: 999px; }
body.panel-open .views { display: none; }
.thread { flex: 1; overflow: auto; padding: 22px 18px 8px; }
.turn { max-width: 760px; margin: 0 auto 22px; display: flex; flex-direction: column; gap: 8px; }
.me { align-self: flex-end; max-width: 85%; background: var(--me); padding: 8px 14px; border-radius: 16px 16px 4px 16px; white-space: pre-wrap; word-break: break-word; }
.bot { display: flex; flex-direction: column; gap: 8px; }
.bot .text p { margin: 0 0 8px; }
.bot .text ul { margin: 0 0 8px; padding-left: 20px; }
.bot code { background: var(--soft); padding: 0 4px; border-radius: 4px; font-size: 13px; }
/* 工具步骤：回答上方一行小标签；打开过画布的那步是按钮 */
.steps { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; font-size: 12.5px; line-height: 1.5; }
.steps li { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; padding: 2px 10px; border-radius: 999px; background: var(--soft); color: var(--muted); }
.steps li i { font-style: normal; font-size: 11px; color: var(--ok); }
.steps li span { color: var(--ink); opacity: .72; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.steps li.bad { background: var(--risk-bg); color: var(--err); }
.steps li.bad i { color: var(--err); font-weight: 700; }
.steps li.go { padding: 0; background: var(--accent-soft); }
.steps li.go button { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; border: 0; border-radius: 999px; padding: 2px 10px; font-size: inherit; line-height: inherit; color: var(--accent); }
.steps li.go button:hover { background: color-mix(in srgb, var(--accent) 14%, transparent); }
.steps li.go span { color: inherit; opacity: 1; font-weight: 600; }
.steps li.go b { font-weight: 400; }
.note-line { margin: 0; font-size: 13px; color: var(--muted); }
.ok-line { margin: 0; font-size: 14px; color: var(--ok); }
.ok-line::before { content: "● "; font-size: 9px; vertical-align: 2px; }
.card { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; background: var(--bg); box-shadow: 0 1px 3px rgba(0,0,0,.05); }
.card header { font-weight: 600; margin-bottom: 8px; display: flex; gap: 8px; align-items: center; }
.change { border-top: 1px dashed var(--line); padding: 6px 0; }
.change:first-of-type { border-top: 0; }
.change .who { font-size: 12px; color: var(--muted); }
.change .who em { color: var(--err); font-style: normal; margin-left: 8px; }
.kv { display: grid; grid-template-columns: 90px 1fr; gap: 2px 10px; font-size: 14px; }
.kv span { color: var(--muted); grid-row: span 2; }
.kv del { color: var(--muted); }
.kv ins { text-decoration: none; color: var(--ok); }
.kv ins::before { content: "→ "; color: var(--muted); }
.decide { display: flex; gap: 8px; align-items: center; margin-top: 10px; flex-wrap: wrap; }
.decide .note { flex: 1; min-width: 160px; font: inherit; font-size: 13px; border: 1px solid var(--line); border-radius: 8px; padding: 5px 8px; background: var(--bg); color: var(--ink); }
.thinking { flex-direction: row; align-items: center; gap: 5px; padding: 6px 0; }
.thinking span { margin-left: 6px; font-size: 13px; color: var(--muted); }
.thinking i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite; }
.thinking i:nth-child(2) { animation-delay: .2s; } .thinking i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .2; } 40% { opacity: 1; } }

.hello { max-width: 760px; margin: 10vh auto 0; text-align: center; }
.hello h1 { font-size: 22px; font-weight: 600; margin: 0 0 22px; }
.sugs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; text-align: left; }
.sug { text-align: left; display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: var(--radius); }
.sug span { font-size: 13px; color: var(--muted); }

.composer { padding: 8px 18px 18px; }
.focus { max-width: 760px; margin: 0 auto 6px; font-size: 13px; background: var(--accent-soft); border-radius: 8px; padding: 3px 4px 3px 10px; display: flex; align-items: center; justify-content: space-between; }
.box { max-width: 760px; margin: 0 auto; display: flex; align-items: flex-end; gap: 8px; border: 1px solid var(--line); border-radius: 16px; padding: 8px 8px 8px 14px; background: var(--bg); box-shadow: 0 2px 10px rgba(0,0,0,.05); }
.box:focus-within { border-color: var(--accent); }
.box textarea { flex: 1; border: 0; outline: 0; resize: none; font: inherit; background: transparent; color: var(--ink); max-height: 200px; padding: 4px 0; }
.send { width: 34px; height: 34px; border-radius: 50%; background: var(--accent); border: 0; color: #fff; font-size: 16px; padding: 0; }

/* 右栏画布 */
.panel { border-left: 1px solid var(--line); display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--bg); }
/* 分隔条 */
.split { cursor: col-resize; background: var(--line); position: relative; min-width: 0; touch-action: none; transition: background .15s; }
.split::after { content: ""; position: absolute; left: -4px; right: -4px; top: 0; bottom: 0; }
.split:hover, .split:focus-visible, body.dragging .split { background: var(--accent); outline: 0; }
.split::before { content: ""; position: absolute; left: 1px; top: 50%; width: 4px; height: 36px; margin-top: -18px; border-radius: 2px; background: var(--bg); opacity: .8; }
/* 画布顶栏 */
.phd { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-bottom: 1px solid var(--line); min-width: 0; }
.ptitle { display: flex; flex-direction: column; min-width: 0; max-width: 150px; line-height: 1.25; }
.ptitle b { font-size: 14px; white-space: nowrap; }
.ptitle .muted { font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tabs2 { display: flex; gap: 10px; flex: 1; min-width: 0; align-items: center; justify-content: center; }
.tabs2 .seg { display: inline-flex; align-items: center; gap: 2px; padding: 2px; border: 1px solid var(--line); border-radius: 10px; background: var(--soft); }
.tabs2 .seg em { font-style: normal; font-size: 11px; color: var(--muted); padding: 0 6px 0 6px; white-space: nowrap; }
.tabs2 button { border: 0; border-radius: 8px; padding: 4px 8px; font-size: 13px; display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; background: transparent; }
.tabs2 button:hover { background: var(--bg); }
.tabs2 button.on { background: var(--bg); color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.tabs2 .ic, .rail .ic, .ibtn .ic { flex: none; }
.tabs2 .more { position: relative; }
.tabs2 .morebtn { border: 1px solid var(--line); background: var(--bg); }
.tabs2 .moremenu { position: absolute; right: 0; top: calc(100% + 4px); z-index: 30; min-width: 190px; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 28px rgba(0,0,0,.16); padding: 6px; display: flex; flex-direction: column; gap: 2px; }
.tabs2 .moremenu button { width: 100%; justify-content: flex-start; padding: 6px 8px; }
.tabs2 .moremenu .mg { font-size: 11px; color: var(--muted); padding: 4px 8px 0; }
.pacts { display: flex; align-items: center; gap: 2px; margin-left: auto; flex: none; }
.ibtn { display: inline-grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 1px solid transparent; border-radius: 8px; color: var(--muted); font-size: 18px; line-height: 1; background: none; cursor: pointer; }
.ibtn:hover { background: var(--soft); color: var(--ink); }
a.ibtn { text-decoration: none; }
/* 收起后的细栏 */
.rail { display: none; flex-direction: column; align-items: center; gap: 4px; padding: 10px 0; overflow: auto; }
.rail button { width: 36px; height: 36px; padding: 0; border: 0; border-radius: 10px; display: grid; place-items: center; color: var(--muted); }
.rail button:hover { background: var(--soft); color: var(--ink); }
.rail button.on { background: var(--accent-soft); color: var(--accent); }
.rail .rg { width: 22px; height: 1px; background: var(--line); margin: 6px 0; }
.rail .rg:first-child { display: none; }
body.panel-rail .panel .rail { display: flex; }
body.panel-rail .panel .phd, body.panel-rail .panel .framebox { display: none; }
body.panel-rail .panel { min-width: 0; overflow: hidden; }
/* 全屏：画布铺满窗口，对话缩成右下角浮窗 */
body.panel-full .panel { position: fixed; inset: 0; z-index: 12; border-left: 0; }
body.panel-full .chat { position: fixed; right: 16px; bottom: 16px; width: min(400px, calc(100vw - 32px)); height: min(580px, 72vh); z-index: 14; background: var(--bg); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 12px 40px rgba(0,0,0,.22); overflow: hidden; }
body.panel-full .chat .bar { padding: 8px 12px; }
body.panel-full .chat .thread { padding: 12px 12px 4px; }
body.panel-full .chat .composer { padding: 6px 10px 12px; }
body.panel-full .chat .hello { margin-top: 3vh; }
body.panel-full .chat .hello h1 { font-size: 17px; }
body.panel-full .chat .sugs { grid-template-columns: minmax(0, 1fr); }
body.panel-full.chat-min .chat { display: none; }
.chatmin { margin-left: auto; font-size: 16px; }
.chatfab { position: fixed; right: 20px; bottom: 20px; z-index: 14; border-radius: 999px; padding: 9px 18px; background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 6px 20px rgba(0,0,0,.25); }
.chatfab:hover { background: var(--accent); filter: brightness(1.08); }
@media (prefers-reduced-motion: reduce) { .app, .split { transition: none; } }
.framebox { overflow: hidden; }
.framebox { flex: 1; min-height: 0; display: flex; }
.framebox iframe { flex: 1; border: 0; width: 100%; background: #fff; }
.views em { font-style: normal; font-size: 11px; color: var(--muted); align-self: center; padding: 0 2px 0 8px; white-space: nowrap; }
.views em:first-child { padding-left: 0; }

/* 本页自画的视图：业务速览、资料库、演示系统 */
.native { flex: 1; min-width: 0; overflow: auto; padding: 14px 18px 40px; font-size: 14px; }
.native h3 { margin: 4px 0 2px; font-size: 17px; }
.native h4 { margin: 18px 0 8px; font-size: 14px; display: flex; gap: 6px; align-items: baseline; }
.native h4 small, .itabs small { color: var(--muted); font-weight: 400; margin-left: 4px; }
.native p { margin: 4px 0; }
.small { font-size: 12px; }
.empty { margin: 10vh auto; max-width: 420px; text-align: center; }
.crumbs { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; font-size: 13px; margin-bottom: 10px; color: var(--muted); }
.crumbs button { border: 0; padding: 0 2px; color: var(--accent); }
.books { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.bookcard { text-align: left; display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border-radius: var(--radius); }
.bookcard > b { font-size: 15px; }
.nums { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px 8px; margin-top: 6px; }
.nums i { font-style: normal; font-size: 12px; color: var(--muted); }
.nums i b { font-size: 15px; color: var(--ink); margin-right: 2px; }
.itabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--line); padding-bottom: 8px; margin-bottom: 10px; }
.itabs button { border: 0; font-size: 13px; padding: 3px 10px; border-radius: 8px; }
.itabs button.on { background: var(--accent-soft); color: var(--accent); }
.procs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.procs button { width: 100%; border: 0; text-align: left; display: flex; justify-content: space-between; gap: 8px; padding: 6px 8px; }
.warn { color: var(--warn); }
.pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.pair .ours b { display: inline-block; margin-right: 6px; }
.pair .ours .tag, .pair .ours code { margin-right: 4px; }
.lbl { display: inline-block; font-size: 11px; color: var(--muted); background: var(--soft); border-radius: 5px; padding: 0 6px; margin-right: 6px; }
.theirs { border-left: 3px solid var(--accent-soft); padding-left: 10px; display: flex; flex-direction: column; gap: 8px; }
.src .what { font-size: 11px; color: var(--accent); margin-right: 6px; }
.src q { quotes: "「" "」"; }
.src details.doc { margin-top: 3px; font-size: 12px; }
.src details.doc summary { cursor: pointer; color: var(--muted); }
.src details.doc p { background: var(--soft); border-radius: 8px; padding: 6px 8px; margin: 4px 0 0; }
.nosrc { color: var(--warn); font-size: 12px; }
.phead { margin-bottom: 4px; }
details.lane { margin: 10px 0; }
details.lane summary, details.step summary { cursor: pointer; }
details.lane summary a { font-size: 12px; margin-left: 10px; }
.lanebox { max-height: 56vh; overflow: auto; border: 1px solid var(--line); border-radius: 8px; margin-top: 6px; background: #fff; }
.lanebox img { display: block; width: 100%; height: auto; }
details.step { border-top: 1px solid var(--line); padding: 6px 0; }
details.step summary { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; list-style: none; }
details.step summary::-webkit-details-marker { display: none; }
details.step .no { font-size: 12px; color: var(--muted); min-width: 26px; }
details.step .who { font-size: 12px; color: var(--muted); }
details.step .pair { border-top: 0; padding-top: 6px; }
.lsearch { display: flex; gap: 6px; margin-bottom: 10px; }
.lsearch input { flex: 1; font: inherit; font-size: 14px; border: 1px solid var(--line); border-radius: 8px; padding: 5px 10px; background: var(--bg); color: var(--ink); }
.libs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.libs button { width: 100%; text-align: left; display: flex; flex-direction: column; gap: 2px; padding: 8px 12px; }
.libs .snip { font-size: 12px; color: var(--ink); background: var(--soft); border-radius: 6px; padding: 2px 6px; }
.dl { margin-left: 8px; }
iframe.docx { width: 100%; height: 70vh; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.slides { padding-left: 22px; }
.slides li { margin-bottom: 8px; }
.slides p { color: var(--muted); font-size: 13px; white-space: pre-wrap; }
.tablewrap { overflow: auto; max-height: 50vh; border: 1px solid var(--line); border-radius: 8px; }
.tablewrap table { border-collapse: collapse; font-size: 12px; }
.tablewrap td { border: 1px solid var(--line); padding: 2px 6px; white-space: nowrap; }
img.shot { max-width: 100%; border: 1px solid var(--line); border-radius: 8px; }
pre.txt { white-space: pre-wrap; font-size: 13px; }
.warnbox { background: var(--soft); border-left: 3px solid var(--warn); padding: 8px 10px; border-radius: 6px; font-size: 13px; }
.demos { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; margin-top: 10px; }
.demo { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; }
.demo > b { font-size: 15px; }
.demo .tag { align-self: flex-start; }
.demo .acts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; padding-top: 6px; }
.demo a.primary { padding: 5px 10px; border-radius: 8px; font-size: 13px; }
ol.plan { margin: 6px 0; padding-left: 20px; }

/* 记忆与帮助 */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.35); display: grid; place-items: center; z-index: 20; padding: 16px; }
.sheet { position: relative; width: min(680px, 100%); max-height: 86vh; overflow: auto; background: var(--bg); border-radius: 16px; padding: 22px 24px; }
.sheet .close { position: absolute; top: 12px; right: 12px; }
.sheet h2 { margin: 0 0 8px; font-size: 18px; }
.sheet h3 { font-size: 14px; margin: 18px 0 6px; display: flex; gap: 6px; align-items: baseline; }
.sheet h3 small { color: var(--muted); font-weight: 400; }
.sheet ol li { margin-bottom: 6px; }
.memnew { display: flex; flex-direction: column; gap: 8px; margin: 10px 0; }
.memnew textarea { font: inherit; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; background: var(--bg); color: var(--ink); }
.memnew div { display: flex; gap: 12px; align-items: center; font-size: 13px; }
.memnew button { margin-left: auto; }
.mems { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.mems li { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.mems li p { margin: 4px 0; white-space: pre-wrap; }
.mems .tags { display: flex; gap: 4px; }
.mems .tags span { font-size: 11px; padding: 0 6px; border-radius: 999px; background: var(--soft); color: var(--muted); }
.mems .tags .warn { color: var(--warn); }
.mems .tags .pin { color: var(--accent); }
.mems .acts { display: flex; gap: 6px; }
.mems .acts button { font-size: 12px; padding: 1px 8px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #1f2328; color: #fff; padding: 8px 14px; border-radius: 10px; font-size: 14px; z-index: 30; }

/* 窄屏：左栏变抽屉，画布盖在对话上 */
@media (max-width: 900px) {
  .app, body.panel-open .app, body.panel-open.panel-rail .app, body.panel-open.panel-full .app { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; inset: 0 auto 0 0; width: min(280px, 86vw); z-index: 15; transform: translateX(-100%); transition: transform .2s; }
  body.side-open .side { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.25); }
  .bar #toggleSide { display: inline-block; }
  .views { display: none; }
  .panel { position: fixed; inset: 0; z-index: 12; }
  .split { display: none; }
  .ptitle { display: none; }
  .sugs { grid-template-columns: minmax(0, 1fr); }
  .pair { grid-template-columns: minmax(0, 1fr); }
  .theirs { border-left: 0; border-top: 2px solid var(--accent-soft); padding: 6px 0 0; }
  .hello { margin-top: 6vh; }
}

/* 画布里自画的视图：半屏单列，全屏多列 */
.native { container-type: inline-size; }
.books, .demos { grid-template-columns: minmax(0, 1fr); }
.libs { display: flex; }
body.panel-full .native { padding: 22px max(28px, 4vw) 60px; }
body.panel-full .books { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
body.panel-full .demos { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
body.panel-full .libs { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 10px; }
body.panel-full .libs li { display: flex; }
body.panel-full .libs button { height: 100%; }
body.panel-full .demo { padding: 16px 18px; }
body.panel-full .lanebox { max-height: 70vh; }
body.panel-full iframe.docx { height: 78vh; }
body:not(.panel-full) .native { max-width: none; }
.native > .crumbs, .native > .phead { max-width: 1100px; }

/* ---------------------------------------------------------------- 业务场景中心（展示版 scenes 视图） */
.native.sc { background: var(--surface); padding: 16px 20px 40px; }
body.panel-full .native.sc { padding: 24px max(28px, 3vw) 60px; }
.sc .dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--line); vertical-align: 1px; margin-right: 4px; }
.sc .dot.lv-risk, .hello .dot.lv-risk { background: var(--risk); }
.sc .dot.lv-warn, .hello .dot.lv-warn { background: var(--warnc); }
.sc .dot.lv-low { background: #94a3b8; }
.sc .dot.lv-ok, .hello .dot.lv-ok { background: var(--okc); }
.sc-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.sc-head > div { flex: 1; min-width: 0; }
.sc-head h3 { margin: 0; font-size: 19px; letter-spacing: .01em; }
.sc-head p { margin: 2px 0 0; }
.screfresh { font-size: 17px; background: var(--bg); border: 1px solid var(--line); }
.mchip { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 6px; font-size: 11.5px; font-weight: 600; white-space: nowrap;
  color: var(--mc); background: color-mix(in srgb, var(--mc) 11%, var(--bg)); }
/* 运营小卡 */
.ops { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.op { text-align: left; display: flex; flex-direction: column; gap: 10px; padding: 12px 14px 12px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line);
  box-shadow: var(--shadow); position: relative; overflow: hidden; }
.op::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--mc); }
.op:hover { background: var(--bg); border-color: color-mix(in srgb, var(--mc) 45%, var(--line)); }
.oph { display: flex; align-items: center; gap: 8px; min-width: 0; }
.oph i { width: 8px; height: 8px; border-radius: 2px; background: var(--mc); flex: none; }
.oph b { font-size: 14px; white-space: nowrap; }
.pill { margin-left: auto; font-size: 11px; padding: 1px 8px; border-radius: 999px; white-space: nowrap; background: var(--soft); color: var(--muted); }
.pill.lv-risk { background: var(--risk-bg); color: var(--risk); }
.pill.lv-warn { background: var(--warn-bg); color: var(--warnc); }
.pill.lv-ok { background: var(--ok-bg); color: var(--okc); }
.opk { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.opk .k { display: flex; flex-direction: column; min-width: 0; }
.opk .k b { font-size: 19px; line-height: 1.2; font-variant-numeric: tabular-nums; white-space: nowrap; letter-spacing: -.01em; }
.opk .k b small { font-size: 11px; font-weight: 500; color: var(--muted); margin-left: 2px; letter-spacing: 0; }
.opk .k span { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.opk .t-risk b { color: var(--risk); }
.opk .t-warn b { color: var(--warnc); }
/* 痛点雷达 */
.sc-sec { margin-top: 20px; }
.sc-sec > h4 { margin: 0 0 8px; font-size: 15px; display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.sc-sec > h4 small { font-size: 12px; color: var(--muted); font-weight: 400; }
.sctabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 10px; }
.sctabs button { border: 1px solid transparent; border-radius: 999px; font-size: 13px; padding: 3px 12px; background: transparent; color: var(--muted); }
.sctabs button:hover { background: var(--bg); color: var(--ink); }
.sctabs button.on { background: var(--bg); border-color: var(--line); color: var(--ink); font-weight: 600; box-shadow: var(--shadow); }
.sctabs button small { margin-left: 5px; font-size: 11px; color: var(--risk); font-weight: 600; }
.scards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.scard { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line);
  box-shadow: var(--shadow); cursor: pointer; border-left: 3px solid var(--line); min-width: 0; }
.scard:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.scard:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.scard.lv-risk { border-left-color: var(--risk); }
.scard.lv-warn { border-left-color: var(--warnc); }
.scard.lv-ok { border-left-color: var(--okc); }
.sch { display: flex; align-items: center; gap: 8px; min-width: 0; }
.sch > b { font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hand { margin-left: auto; flex: none; font-size: 11px; padding: 1px 7px; border-radius: 5px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.hand.h-run { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
.hand.h-apv { color: var(--warnc); border-color: color-mix(in srgb, var(--warnc) 35%, var(--line)); }
.scard .pain { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 39px; }
.scf { display: flex; align-items: flex-end; gap: 8px; margin-top: 2px; }
.sig { display: flex; align-items: baseline; gap: 6px; min-width: 0; flex: 1; }
.sig .n { font-size: 24px; line-height: 1; font-variant-numeric: tabular-nums; }
.scard.lv-risk .sig .n { color: var(--risk); }
.scard.lv-warn .sig .n { color: var(--warnc); }
.scard.lv-ok .sig .n { color: var(--okc); }
.sig .n.na { color: var(--muted); }
.sig span { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sig small { font-size: 11px; }
.scf .go { flex: none; font-size: 12.5px; padding: 3px 10px; border-radius: 8px; color: var(--accent); border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); background: var(--bg); }
.scf .go:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
/* 最近执行 */
.recent { list-style: none; margin: 0; padding: 4px 0; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.recent li { display: grid; grid-template-columns: 86px auto minmax(0, max-content) minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 7px 14px; font-size: 13px; }
.recent li + li { border-top: 1px solid var(--line); }
.recent time { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.recent b { white-space: nowrap; }
.recent .msg { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recent em { font-style: normal; font-size: 11.5px; color: var(--muted); white-space: nowrap; }
/* 场景详情 */
.sd-head { display: flex; gap: 16px; align-items: stretch; padding: 14px 16px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line);
  box-shadow: var(--shadow); border-left: 4px solid var(--line); }
.sd-head.lv-risk { border-left-color: var(--risk); }
.sd-head.lv-warn { border-left-color: var(--warnc); }
.sd-head.lv-ok { border-left-color: var(--okc); }
.sdt { flex: 1; min-width: 0; }
.sdt .sch .hand { margin-left: 0; }
.sdt h3 { margin: 6px 0 4px; font-size: 20px; }
.sdt p { margin: 0; color: var(--ink); font-size: 14px; }
.sdn { flex: none; display: flex; flex-direction: column; align-items: flex-end; justify-content: center; min-width: 120px; padding-left: 16px; border-left: 1px solid var(--line); text-align: right; }
.sdn b { font-size: 34px; line-height: 1.05; font-variant-numeric: tabular-nums; }
.sd-head.lv-risk .sdn b, .sd-head.lv-risk .sdn em { color: var(--risk); }
.sd-head.lv-warn .sdn b, .sd-head.lv-warn .sdn em { color: var(--warnc); }
.sd-head.lv-ok .sdn b, .sd-head.lv-ok .sdn em { color: var(--okc); }
.sdn span { font-size: 12px; color: var(--muted); }
.sdn em { font-style: normal; font-size: 12px; font-weight: 600; }
.sd-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
.sbox { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; min-width: 0; }
.sbox p { margin: 2px 0 0; font-size: 13.5px; }
.bl { display: block; font-size: 11.5px; font-weight: 600; color: var(--muted); letter-spacing: .06em; margin-bottom: 2px; }
.sbox code, .act code { font-size: 11px; background: var(--soft); border-radius: 4px; padding: 0 5px; margin-left: 4px; }
.acts2 { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 6px; }
.act { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; padding: 2px 8px 2px 2px; border-radius: 7px; background: var(--accent-soft); color: var(--accent); }
.act code { margin: 0; background: var(--bg); color: var(--muted); }
.sc .native-h4, .sc > h4 { margin: 18px 0 8px; font-size: 14px; display: flex; gap: 8px; align-items: baseline; }
.sigs { list-style: none; margin: 0; padding: 4px 0; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; }
.sigs li { display: flex; align-items: baseline; gap: 6px; padding: 5px 12px; font-size: 13px; min-width: 0; }
.sigs li + li { border-top: 1px dashed var(--line); }
.sigs li b { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.sigs li span { color: var(--muted); font-size: 12px; margin-left: auto; white-space: nowrap; padding-left: 10px; }
/* 处理链：横向六步 */
.chain { list-style: none; margin: 0; padding: 14px 8px 12px; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); background: var(--bg); border: 1px solid var(--line); border-radius: 12px; }
.chain li { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 3px; padding: 0 6px; min-width: 0; }
.chain li::before { content: ""; position: absolute; top: 13px; left: calc(-50% + 16px); right: calc(50% + 16px); height: 2px; background: var(--line); }
.chain li:first-child::before { display: none; }
.chain li.done::before, .chain li.now::before { background: var(--accent); }
.chain .no { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 600; background: var(--soft); color: var(--muted); border: 2px solid var(--line); position: relative; z-index: 1; }
.chain li.done .no { background: var(--accent); border-color: var(--accent); color: #fff; }
.chain li.now .no { background: var(--bg); border-color: var(--accent); color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent); }
.chain b { font-size: 13px; }
.chain li.now b { color: var(--accent); }
.chain .t { font-size: 11.5px; color: var(--muted); line-height: 1.4; }
/* 场景里的系统助手对话 */
.achat { margin-top: 14px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; }
.ach { display: flex; align-items: center; gap: 8px; padding: 9px 14px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--soft) 60%, var(--bg)); }
.ach i { width: 8px; height: 8px; border-radius: 50%; background: var(--mc); }
.ach b { font-size: 13.5px; }
.ach .tag { margin-left: auto; }
.acb { padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; max-height: 560px; overflow: auto; }
.sc-empty { margin: 0; }
.sm { max-width: 100%; }
.me2 { align-self: flex-end; max-width: 85%; background: var(--me); padding: 6px 12px; border-radius: 14px 14px 4px 14px; font-size: 13.5px; }
.bot2 .text { font-size: 13.5px; }
.bot2 .text p { margin: 0 0 6px; }
.bot2 .text ul { margin: 0 0 6px; padding-left: 18px; }
.acf { display: flex; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--line); }
.acf input { flex: 1; min-width: 0; font: inherit; font-size: 13.5px; border: 1px solid var(--line); border-radius: 8px; padding: 5px 10px; background: var(--bg); color: var(--ink); }
.acf button { font-size: 13px; white-space: nowrap; }
/* 方案预览卡 */
.prop { border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--line)); border-radius: 12px; padding: 10px 12px; margin-top: 8px; background: color-mix(in srgb, var(--accent-soft) 35%, var(--bg)); }
.prop header { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.prop header b { font-size: 14.5px; }
.lbl2 { font-size: 11px; font-weight: 600; color: #fff; background: var(--accent); border-radius: 5px; padding: 1px 6px; }
.prop > p { margin: 0 0 6px; font-size: 13.5px; }
.imp { list-style: none; margin: 0 0 6px; padding: 0; display: flex; flex-direction: column; gap: 3px; font-size: 13px; }
.imp li { display: flex; gap: 6px; align-items: baseline; }
.rt { flex: none; font-size: 11px; padding: 0 6px; border-radius: 4px; font-weight: 600; }
.r-pass { background: var(--ok-bg); color: var(--okc); }
.r-warn { background: var(--warn-bg); color: var(--warnc); }
.r-block { background: var(--risk-bg); color: var(--risk); }
.r-chg { background: var(--soft); color: var(--muted); }
.basis { font-size: 12.5px; margin-bottom: 6px; }
.basis summary { cursor: pointer; color: var(--muted); }
.basis ul { margin: 4px 0 0; padding-left: 18px; color: var(--muted); }
.pfoot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pst { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.pst.s-done { color: var(--okc); }
.pst.s-failed { color: var(--risk); }
.prop.s-done { border-color: color-mix(in srgb, var(--okc) 45%, var(--line)); background: color-mix(in srgb, var(--ok-bg) 40%, var(--bg)); }
.prop.s-cancelled { opacity: .7; }
.sd-val { margin: 12px 0 0; font-size: 13.5px; display: flex; gap: 10px; align-items: baseline; }
.sd-val .bl { margin: 0; }
/* 欢迎页的场景入口 */
.hello-sub { margin: 18px 0 8px; font-size: 13px; color: var(--muted); text-align: left; }
.sugs.scs .sug b { display: flex; align-items: center; gap: 4px; }
.hello .dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--line); margin-right: 2px; }
.sugs.scs .sug span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
/* 画布宽窄（容器查询） */
@container (max-width: 640px) {
  .ops { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .scards, .sd-grid { grid-template-columns: minmax(0, 1fr); }
  .chain { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 14px; }
  .chain li:nth-child(4)::before { display: none; }
  .recent li { grid-template-columns: auto minmax(0, 1fr); }
  .recent li time, .recent li em { display: none; }
  .recent li .msg { grid-column: 1 / -1; }
  .sd-head { flex-direction: column; }
  .sdn { border-left: 0; padding-left: 0; text-align: left; flex-direction: row; gap: 8px; align-items: baseline; }
  .sigs li { flex-wrap: wrap; }
  .sigs li b { white-space: normal; }
  .sigs li span { margin-left: 13px; padding-left: 0; white-space: normal; flex-basis: 100%; }
  .acf { flex-wrap: wrap; }
  .acf input { flex-basis: 100%; }
}
@container (max-width: 420px) { .ops { grid-template-columns: minmax(0, 1fr); } }
@container (min-width: 1000px) { .scards { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@container (min-width: 1240px) { .ops { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
@media (max-width: 900px) { .membtn { margin-left: auto !important; } .membtn span { display: none; } }

