/* 电脑工作区（网站「电脑」页和电脑上的桌面窗口共用） */
.pw { flex: 1; min-height: 0; display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; grid-template-rows: minmax(0, 1fr) auto; position: relative; background: var(--bg); }
.pw .ic { width: 15px; height: 15px; }
.pw-ell { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.pw-min { min-width: 0; }
.pw-h { display: flex; align-items: center; gap: 2px; font-size: 13px; min-height: 26px; }
.pw-hint { padding: 4px 6px; }
.pw-more { opacity: 0; font-size: 12px; letter-spacing: -1px; }
.pw-p:hover .pw-more, .pw-ent:hover .pw-more { opacity: 1; }
@media (pointer: coarse) { .pw-more { opacity: .7; } }

/* 项目栏 */
.pw-proj { grid-row: 1; grid-column: 1; width: 180px; box-sizing: border-box; display: flex; flex-direction: column; gap: 6px; padding: 8px; border-right: 1px solid var(--line); background: var(--panel-2); min-height: 0; }
.pw-projs { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.pw-p { display: flex; align-items: center; gap: 7px; padding: 6px 8px; border-radius: 7px; color: var(--text); font-size: 13px; }
.pw-p:hover { background: var(--panel); }
.pw-p.active { background: var(--panel); font-weight: 600; box-shadow: inset 2px 0 0 var(--primary); }
.pw-p .ic { color: var(--primary); flex: none; }
.pw-cnt { font-style: normal; font-size: 11px; min-width: 18px; text-align: center; padding: 0 5px; border-radius: 9px; background: var(--primary-weak); color: var(--primary); }

/* 会话和文件 */
.pw-side { grid-row: 1; grid-column: 2; width: 260px; box-sizing: border-box; display: flex; flex-direction: column; border-right: 1px solid var(--line); background: var(--panel); min-height: 0; }
.pw-sec { display: flex; flex-direction: column; gap: 6px; padding: 8px 10px; min-height: 0; }
.pw-sec + .pw-sec { border-top: 1px solid var(--line); }
.pw-kinds { display: flex; flex-wrap: wrap; gap: 4px; }
.pw-kinds .small { padding: 3px 8px; font-size: 12px; display: inline-flex; align-items: center; gap: 4px; }
.pw-kinds .ic { width: 13px; height: 13px; }
.pw-sess-list { max-height: 36vh; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.pw-sess { display: flex; align-items: center; gap: 8px; padding: 5px 6px; border-radius: 7px; cursor: pointer; font-size: 13px; }
.pw-sess:hover, .pw-sess.active { background: var(--panel-2); }
.pw-resume { padding: 2px 8px; font-size: 12px; }
.pw-st { width: 8px; height: 8px; min-width: 8px; border-radius: 50%; display: inline-block; background: var(--line); }
.pw-st.run { background: var(--ok); box-shadow: 0 0 0 3px rgba(63, 125, 78, .18); }
.pw-st.idle { background: var(--primary); }
.pw-st.lost { background: transparent; border: 1.5px dashed var(--muted); }
.pw-fpane { grid-row: 1; grid-column: 4; width: 280px; box-sizing: border-box; display: flex; flex-direction: column; border-left: 1px solid var(--line); background: var(--panel); min-height: 0; }
.pw-files { flex: 1; }
.pw-side .pw-sec { flex: 1; }
.pw-side .pw-sess-list { max-height: none; flex: 1; }
.pw-crumbs { display: flex; flex-wrap: wrap; gap: 3px; font-size: 12.5px; }
.pw-crumbs a { color: var(--text); }
.pw-list { flex: 1; overflow-y: auto; min-height: 0; }
.pw-ent { display: flex; align-items: center; gap: 7px; padding: 4px 6px; border-radius: 6px; cursor: pointer; font-size: 13px; }
.pw-ent:hover { background: var(--panel-2); }
.pw-ent .ic { flex: none; color: var(--muted); }
.pw-ent .pw-dir .ic, .pw-dir { color: var(--primary); }
.pw-sec .icon-btn.on, .pw-status .icon-btn.on { color: var(--primary); }

/* 标签和面板 */
.pw-main { grid-row: 1; grid-column: 3; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.pw-tabbar { display: flex; overflow-x: auto; border-bottom: 1px solid var(--line); background: var(--panel); scrollbar-width: thin; flex: none; }
.pw-tab { display: inline-flex; align-items: center; gap: 6px; padding: 6px 8px 6px 12px; font-size: 12.5px; color: var(--muted); border-right: 1px solid var(--line); white-space: nowrap; }
.pw-tab .ic { width: 13px; height: 13px; }
.pw-tab.active { color: var(--text); background: var(--bg); box-shadow: inset 0 2px 0 var(--primary); }
.pw-tab.ended .pw-tab-t { opacity: .55; }
.pw-tab-t { max-width: 200px; overflow: hidden; text-overflow: ellipsis; }
.pw-tab .icon-btn { width: 20px; height: 20px; font-size: 15px; }
.pw-dirty { width: 7px; height: 7px; border-radius: 50%; background: var(--primary); }
.pw-panes { flex: 1; min-height: 0; position: relative; }
.pw-pane { position: absolute; inset: 0; display: flex; flex-direction: column; }
.pw-termrow { flex: 1; min-height: 0; display: flex; }
.pw-term { flex: 1; min-width: 0; min-height: 0; padding: 6px 0 0 8px; background: var(--panel); }
.pw-term .xterm { height: 100%; }
.pw-conn { position: absolute; top: 8px; right: 14px; font-size: 12px; color: var(--muted); background: var(--panel-2); padding: 2px 8px; border-radius: 6px; }
.pw-lost { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-top: 1px solid var(--line); background: var(--primary-weak); font-size: 13px; }
.pw-keys { display: flex; flex-direction: column; gap: 5px; padding: 6px 5px; border-right: 1px solid var(--line); background: var(--panel-2); overflow-y: auto; flex: none; }
.pw-keys button { width: 46px; min-height: 38px; padding: 0; font-size: 13px; }
.pw-keys button.on { background: var(--primary); color: #fff; }
.pw-edbar { display: flex; align-items: center; gap: 8px; padding: 5px 10px; border-bottom: 1px solid var(--line); background: var(--panel); }
.pw-path { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; direction: rtl; text-align: left; }
.pw-editor { flex: 1; min-height: 0; }
.pw-editor .CodeMirror { height: 100%; font-size: 13px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: var(--panel); color: var(--text); }
.pw-editor .CodeMirror-gutters { background: var(--panel-2); border-right: 1px solid var(--line); }
.pw-editor .CodeMirror-activeline-background { background: var(--panel-2); }
.pw-editor .CodeMirror-cursor { border-left-color: var(--text); }
.pw-note { padding: 24px; color: var(--muted); }
.pw-empty { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 24px; text-align: center; }
.pw-empty h2 { margin: 0; }
.pw-empty p { max-width: 520px; }

/* 状态栏：账号和额度 */
.pw-status { grid-column: 1 / -1; grid-row: 2; display: flex; align-items: center; gap: 4px; padding: 3px 8px; border-top: 1px solid var(--line); background: var(--panel-2); font-size: 12px; overflow-x: auto; scrollbar-width: none; }
.pw-ac { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 6px; color: var(--text); white-space: nowrap; }
.pw-ac:hover, .pw-ac.on { background: var(--panel); }
.pw-ac-n { max-width: 170px; color: var(--muted); }
.pw-ac-u { font-variant-numeric: tabular-nums; }
.pw-ac.hot .pw-ac-u { color: var(--danger); font-weight: 600; }
.pw-pop { position: absolute; right: 10px; bottom: 34px; z-index: 50; width: min(420px, calc(100% - 20px)); background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .14); padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.pw-pop-h { display: flex; align-items: center; gap: 8px; }
.pw-acc { display: flex; align-items: center; gap: 8px; padding: 4px 2px; border-radius: 6px; }
.pw-acc label { display: flex; align-items: center; gap: 8px; cursor: pointer; min-width: 0; flex-wrap: nowrap; padding: 2px 4px; }
.pw-acc label > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.pw-acc input { flex: none; margin: 0; }
.pw-acc.active { background: var(--panel-2); }
.pw-acc .tag { margin: 0; }
.pw-pop > .small { align-self: flex-start; display: inline-flex; align-items: center; gap: 4px; }
.pw-use { border-top: 1px solid var(--line); padding-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.pw-bar-row { display: grid; grid-template-columns: 110px 1fr 44px; align-items: center; gap: 8px; font-size: 12.5px; }
.pw-bar-r { grid-column: 2 / -1; margin-top: -4px; }
.pw-bar { height: 7px; border-radius: 4px; background: var(--panel-2); overflow: hidden; }
.pw-bar i { display: block; height: 100%; background: var(--primary); border-radius: 4px; }
.pw-bar i.hot { background: var(--danger); }
.pw-bar-v { text-align: right; font-variant-numeric: tabular-nums; }
.pw-menu { position: fixed; z-index: 60; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 24px rgba(0, 0, 0, .12); padding: 4px; display: flex; flex-direction: column; min-width: 180px; }
.pw-menu a { padding: 7px 12px; border-radius: 6px; color: var(--text); font-size: 13px; }
.pw-menu a:hover { background: var(--panel-2); }

@media (max-width: 860px) {
  .pw { grid-template-columns: minmax(0, 1fr); }
  .pw-main, .pw-status { grid-column: 1; }
  .pw-fpane { grid-column: 1; position: absolute; z-index: 30; top: 0; bottom: 0; right: 0; width: min(320px, 86vw); box-shadow: -8px 0 24px rgba(0, 0, 0, .12); }
  .pw-proj, .pw-side { grid-column: 1; position: absolute; z-index: 30; top: 0; bottom: 0; box-shadow: 8px 0 24px rgba(0, 0, 0, .12); }
  .pw-proj { left: 0; width: 160px; }
  .pw-side { left: 160px; width: min(310px, calc(100vw - 170px)); }
  .pw-ac-n { display: none; }
}

/* 平板弹出键盘：工作区固定在键盘上方，只留对话（终端 / 编辑器），快捷键那一列保留 */
html.pw-kb, html.pw-kb body { overflow: hidden; }
html.pw-kb .pw { position: fixed; left: 0; right: 0; top: var(--pw-vvt, 0px); height: var(--pw-vvh, 100%); z-index: 900; grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
html.pw-kb .pw-proj, html.pw-kb .pw-side, html.pw-kb .pw-fpane, html.pw-kb .pw-status, html.pw-kb .pw-tabbar, html.pw-kb .pw-edbar, html.pw-kb .pw-pop, html.pw-kb .pw-menu { display: none !important; }
html.pw-kb .pw-main { grid-column: 1; }
html.pw-kb .pw-term { padding-top: 2px; }

.pw-big { justify-content: center; gap: 8px; }
.pw-big button { padding: 10px 16px; font-size: 14px; display: inline-flex; align-items: center; gap: 6px; }
.pw-big .ic { width: 16px; height: 16px; }
.pw-recent { width: min(460px, 100%); display: flex; flex-direction: column; gap: 4px; text-align: left; }
.pw-recent a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px; background: var(--panel); border: 1px solid var(--line); color: var(--text); font-size: 14px; }
.pw-recent a:hover { border-color: var(--primary); }

/* 顶部项目条：当前在做哪个项目，点开切换 / 选择文件夹 */
.pw-head { display: flex; align-items: center; gap: 8px; padding: 4px 8px; border-bottom: 1px solid var(--line); background: var(--panel); flex: none; min-width: 0; }
.pw-sw { display: inline-flex; align-items: center; gap: 7px; padding: 5px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); max-width: 100%; min-width: 0; font-size: 13.5px; color: var(--text); }
.pw-sw:hover { border-color: var(--primary); }
.pw-sw .ic { color: var(--primary); flex: none; }
.pw-sw-path { max-width: 380px; }
.pw-caret { width: 0; height: 0; border: 4px solid transparent; border-top-color: var(--muted); margin-top: 4px; flex: none; }
.pw-swmenu { position: absolute; z-index: 55; top: 44px; left: 8px; width: min(480px, calc(100% - 16px)); max-height: 60vh; overflow-y: auto; background: var(--panel); border: 1px solid var(--line);
  border-radius: 10px; box-shadow: 0 10px 30px rgba(0, 0, 0, .14); padding: 4px; display: flex; flex-direction: column; }
.pw-swmenu a { display: grid; grid-template-columns: auto 1fr auto; grid-template-rows: auto auto; column-gap: 8px; align-items: center; padding: 8px 10px; border-radius: 7px; color: var(--text); font-size: 13.5px; }
.pw-swmenu a .pw-sw-p { grid-column: 2 / -1; }
.pw-swmenu a .ic { color: var(--primary); }
.pw-swmenu a:hover, .pw-swmenu a.active { background: var(--panel-2); }
.pw-swmenu .pw-swpick { display: flex; gap: 8px; border-top: 1px solid var(--line); margin-top: 4px; padding-top: 10px; color: var(--primary); }
.pw-main { position: relative; }

/* 终端下面的输入框：本地打字，整段发过去 */
.pw-compose { display: flex; gap: 8px; align-items: flex-end; padding: 6px 8px; border-top: 1px solid var(--line); background: var(--panel); flex: none; }
.pw-compose textarea { flex: 1; min-height: 38px; max-height: 140px; resize: none; font-size: 15px; line-height: 1.45; padding: 8px 10px; border-radius: 8px; font-family: inherit; }
.pw-compose .primary { min-height: 38px; padding: 0 16px; }

/* 选择文件夹 */
.pw-pick-bg { position: fixed; inset: 0; z-index: 950; background: rgba(20, 18, 15, .35); display: flex; align-items: center; justify-content: center; padding: 16px; }
.pw-pick { width: min(520px, 100%); max-height: min(640px, 90vh); display: flex; flex-direction: column; gap: 8px; background: var(--panel); border-radius: 12px; padding: 14px; box-shadow: 0 14px 40px rgba(0, 0, 0, .2); }
.pw-pick-list { flex: 1; min-height: 160px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; padding: 4px; }
.pw-pick-list a { display: flex; align-items: center; gap: 8px; padding: 9px 10px; border-radius: 6px; color: var(--text); font-size: 14px; }
.pw-pick-list a:hover { background: var(--panel-2); }
.pw-pick-list .ic { color: var(--primary); flex: none; }
html.pw-kb .pw-head, html.pw-kb .pw-swmenu { display: none !important; }
@media (max-width: 860px) { .pw-sw-path, .pw-hide-sm { display: none; } }

.pw-down { position: absolute; inset: 52px 0 0 0; z-index: 5; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 24px; text-align: center; background: var(--bg); }
.pw-down .muted { max-width: 520px; }
.pw-downbar { display: flex; align-items: center; gap: 10px; padding: 6px 12px; background: var(--primary-weak); font-size: 13px; border-bottom: 1px solid var(--line); }
.pw-downbar span { flex: 1; }

/* 斜杠命令：在终端右边列出来，点一下用 */
.pw-termrow { position: relative; }
.pw-cmds { position: absolute; right: 0; top: 0; bottom: 0; z-index: 4; width: min(360px, 62%); display: flex; flex-direction: column; border-left: 1px solid var(--line); background: var(--panel); min-height: 0; box-shadow: -10px 0 28px rgba(0, 0, 0, .10); }   /* 浮在终端右边，不改终端宽度 */
.pw-cmds-h { display: flex; flex-direction: column; gap: 2px; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.pw-cmds-list { flex: 1; overflow-y: auto; padding: 4px; }
.pw-cmd { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.pw-cmd:hover { background: var(--panel-2); }
.pw-cmd-n { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 14px; display: flex; align-items: center; gap: 6px; }
.pw-cmd-src { font-family: inherit; font-size: 11px; color: var(--primary); background: var(--primary-weak); border-radius: 4px; padding: 0 5px; }
.pw-cmd .small { padding: 4px 10px; }
@media (max-width: 700px) { .pw-cmds { width: 84%; } }

/* 终端里的选择菜单：放在右边点着选 */
.pw-opts .pw-cmds-list { display: flex; flex-direction: column; gap: 6px; padding: 8px; }
.pw-opt { text-align: left; padding: 12px 14px; font-size: 14.5px; border-radius: 9px; border: 1px solid var(--line); background: var(--panel); color: var(--text); line-height: 1.35; }
.pw-opt.cur { border-color: var(--primary); background: var(--primary-weak); }
.pw-opt:active { background: var(--panel-2); }

/* 往上翻过之后：回到最新 */
.pw-termrow .pw-term { touch-action: none; }
.pw-bottom { position: absolute; right: 18px; bottom: 12px; z-index: 3; padding: 8px 14px; border-radius: 18px; background: var(--text); color: var(--bg); border: 0; font-size: 13px; box-shadow: 0 4px 14px rgba(0, 0, 0, .2); }
.pw-cmds ~ .pw-bottom { right: calc(min(360px, 62%) + 18px); }

.pw-compose .pw-kbdown { min-height: 38px; padding: 0 12px; }

/* 整页固定：不跟着手指滑、不回弹（网站「电脑」页和桌面窗口） */
html.pc-lock, html.pc-lock body { position: fixed; inset: 0; overflow: hidden; overscroll-behavior: none; touch-action: manipulation; }
html.pc-lock body { width: 100%; height: 100%; }
.pw-list, .pw-sess-list, .pw-cmds-list, .pw-projs, .pw-swmenu, .pw-pick-list, .pw-tabbar, .pw-editor .CodeMirror-scroll { overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
/* iPad：输入框字号不小于 16px，不然一点就自动放大，而且不会缩回去 */
@media (pointer: coarse) { .pw input, .pw textarea, .pw select, .pw-pick input { font-size: 16px; } .pw-compose textarea { font-size: 16px; } }

.pw-opt { display: block; width: 100%; white-space: normal; word-break: break-word; justify-content: flex-start; text-align: left !important; }
.pw-opts .pw-cmds-h { position: relative; padding-right: 40px; }
.pw-opts-x { position: absolute; right: 6px; top: 6px; width: 32px; height: 32px; padding: 0; font-size: 20px; line-height: 1; }

/* ---------- 对话视图 */
.pw-viewbar { display: flex; align-items: center; gap: 10px; padding: 5px 10px; border-bottom: 1px solid var(--line); background: var(--panel); min-width: 0; }
.pw-seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; flex: none; }
.pw-seg button { border: 0; border-radius: 0; background: transparent; padding: 4px 14px; font-size: 13px; color: var(--muted); min-height: 30px; }
.pw-seg button.on { background: var(--primary-weak); color: var(--primary); font-weight: 600; }
.pw-busy-mini { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; min-width: 0; }
.pw-termrow.chatmode .pw-term { position: absolute; inset: 0; visibility: hidden; pointer-events: none; }   /* 终端藏在后面照样跑，大小和看得见时一样，切换不会让 Claude 重画 */
.pw-termrow.chatmode .pw-keys ~ .pw-term { left: 52px; }
.pw-chatwrap { flex: 1; min-width: 0; min-height: 0; position: relative; display: flex; }
.pw-chat { flex: 1; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: 14px 16px 18px; display: flex; flex-direction: column; gap: 10px; background: var(--bg); }
.pw-chat > * { max-width: 860px; width: 100%; margin-left: auto; margin-right: auto; }
.pw-chat-empty { text-align: center; padding: 40px 0; }
.pw-chat-more { text-align: center; }
.pw-msg { display: flex; flex-direction: column; }
.pw-msg.me { align-items: flex-end; }
.pw-msg.sys { align-items: center; }
.pw-bub { background: var(--primary-weak); border: 1px solid color-mix(in srgb, var(--primary) 18%, transparent); padding: 9px 13px; border-radius: 14px 14px 4px 14px; max-width: min(620px, 88%); white-space: pre-wrap; word-break: break-word; line-height: 1.5; font-size: 15px; }
.pw-msg.pending { opacity: .55; }
.pw-ts { font-size: 11px; color: var(--muted); margin-top: 3px; }
.pw-cmdchip { font-family: ui-monospace, Consolas, monospace; font-size: 13px; padding: 4px 10px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); }
.pw-cmdout { font-size: 12.5px; margin-top: 4px; white-space: pre-wrap; max-width: 88%; }
.pw-md { font-size: 15px; line-height: 1.62; word-break: break-word; }
.pw-md p { margin: 0 0 .6em; } .pw-md p:last-child { margin-bottom: 0; }
.pw-md code { font-family: ui-monospace, Consolas, monospace; font-size: .88em; background: var(--panel-2); padding: 1px 5px; border-radius: 4px; }
.pw-md .pw-code { background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; overflow-x: auto; font-size: 13px; line-height: 1.45; margin: .4em 0 .7em; }
.pw-md .pw-code code { background: none; padding: 0; font-size: inherit; }
.pw-md ul, .pw-md ol { margin: .2em 0 .7em; padding-left: 1.4em; } .pw-md li { margin: .15em 0; } .pw-md li.pw-sub { margin-left: 1.2em; }
.pw-md .pw-h { font-weight: 650; margin: .8em 0 .35em; } .pw-md .pw-h1 { font-size: 1.2em; } .pw-md .pw-h2 { font-size: 1.1em; } .pw-md .pw-h3 { font-size: 1em; }
.pw-md blockquote { margin: .4em 0; padding: 2px 12px; border-left: 3px solid var(--line); color: var(--muted); }
.pw-md hr { border: 0; border-top: 1px solid var(--line); margin: .8em 0; }
.pw-md a { color: var(--primary); }
.pw-tblw { overflow-x: auto; margin: .4em 0 .7em; }
.pw-md table { border-collapse: collapse; font-size: 13.5px; } .pw-md th, .pw-md td { border: 1px solid var(--line); padding: 5px 9px; text-align: left; vertical-align: top; } .pw-md th { background: var(--panel-2); }
.pw-steps { border: 1px solid var(--line); border-radius: 10px; background: var(--panel); font-size: 13.5px; }
.pw-steps-h { display: flex; align-items: center; gap: 8px; padding: 8px 12px; cursor: pointer; min-width: 0; color: var(--muted); }
.pw-steps-list { border-top: 1px solid var(--line); padding: 4px 6px; display: flex; flex-direction: column; }
.pw-tool { border-radius: 7px; }
.pw-tool-h { display: flex; align-items: center; gap: 8px; padding: 6px 6px; cursor: pointer; min-width: 0; }
.pw-tool-h .ic { width: 16px; height: 16px; flex: none; color: var(--muted); }
.pw-tool.err .pw-tool-h .ic { color: var(--danger); }
.pw-tool-out { margin: 0 6px 6px 30px; padding: 8px 10px; background: var(--panel-2); border-radius: 6px; font-size: 12px; line-height: 1.45; max-height: 320px; overflow: auto; white-space: pre-wrap; word-break: break-word; }
.pw-bad { color: var(--danger); font-size: 12px; flex: none; }
.pw-think { color: var(--muted); font-size: 13px; padding: 4px 6px; cursor: pointer; }
.pw-think-t { white-space: pre-wrap; font-size: 13px; line-height: 1.5; margin: 6px 0 2px 16px; color: var(--muted); font-style: italic; }
.pw-caret { display: inline-block; width: 0; height: 0; border: 4px solid transparent; border-left: 5px solid currentColor; margin-right: 4px; transition: transform .15s; flex: none; }
.pw-caret.on { transform: rotate(90deg); }
.pw-sep { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; }
.pw-sep::before, .pw-sep::after { content: ""; flex: 1; border-top: 1px dashed var(--line); }
.pw-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; display: inline-block; }
.pw-dot.run { background: var(--primary); animation: pwpulse 1.1s ease-in-out infinite; }
@keyframes pwpulse { 50% { opacity: .3; } }
.pw-busy { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13.5px; padding: 2px 4px; }
.pw-chat-opts { display: flex; flex-direction: column; gap: 6px; padding: 10px; border: 1px solid var(--primary); border-radius: 12px; background: var(--panel); }
.pw-chatwrap .pw-bottom { right: 18px; }
@media (prefers-reduced-motion: reduce) { .pw-dot.run { animation: none; } }

/* ---------- 钩子状态：等你批准 / 出错 */
.pw-st.wait { background: #d4880f; box-shadow: 0 0 0 3px rgba(212, 136, 15, .22); animation: pwpulse 1.1s ease-in-out infinite; }
.pw-st.err { background: var(--danger); }
.pw-dot.wait { background: #d4880f; animation: pwpulse 1.1s ease-in-out infinite; }
.pw-busy.err { color: var(--danger); }
.pw-ask { border: 1.5px solid #d4880f; border-radius: 12px; background: var(--panel); padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.pw-ask-h { display: flex; align-items: center; gap: 8px; }
.pw-ask-sum { font-size: 15px; word-break: break-word; }
.pw-ask-d { margin: 0; max-height: 220px; }
.pw-ask-opts { display: flex; flex-direction: column; gap: 6px; }

/* ---------- Mermaid 图 */
.pw-mmd { margin: .4em 0 .7em; }
.pw-mmd-svg { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px; overflow-x: auto; cursor: zoom-in; text-align: center; }
.pw-mmd-svg svg { max-width: 100%; height: auto; }
.pw-mmd-err { font-size: 12px; color: var(--muted); margin-top: -4px; }
.pw-zoom { position: fixed; inset: 0; z-index: 1000; background: rgba(0, 0, 0, .45); display: flex; flex-direction: column; padding: max(12px, env(safe-area-inset-top)) 12px 12px; }
.pw-zoom-bar { display: flex; align-items: center; gap: 8px; background: var(--panel); border-radius: 10px 10px 0 0; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.pw-zoom-body { flex: 1; overflow: auto; background: var(--panel); border-radius: 0 0 10px 10px; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.pw-zoom-svg { padding: 16px; width: max-content; min-width: 100%; }
.pw-zoom-svg svg { max-width: none !important; height: auto; }

/* ---------- 原生对话 */
.pw-live .pw-md > :last-child { display: inline; }
.pw-caretblink { display: inline-block; width: 8px; height: 1.1em; background: var(--primary); vertical-align: text-bottom; margin-left: 2px; animation: pwpulse .9s steps(2) infinite; }
.pw-stop { margin-left: auto; }
.pw-ask-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.pw-ask-btns button { min-height: 40px; padding: 0 16px; font-size: 14.5px; }
.pw-ask-btns .danger-ghost { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, var(--line)); background: transparent; }
