:root {
  color-scheme: light;
  --bg: #f2f3f5;
  --panel: #ffffff;
  --ink: #16181d;
  --ink-2: #4e5462;
  --ink-3: #848b98;
  --line: #dde0e6;
  --soft: rgba(22, 24, 29, .05);
  --user: #e4e7ec;
  --red: #d9483b;
  --green: #2f9e57;
  --accent: #2a6fd6;
  --f-body: system-ui, -apple-system, "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --f-mono: ui-monospace, "Cascadia Mono", "Roboto Mono", "IBM Plex Mono", Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #101216; --panel: #181b20; --ink: #eceef2; --ink-2: #a8aebb; --ink-3: #737a87; --line: #2a2f37;
    --soft: rgba(236, 238, 242, .06); --user: #262a31; --red: #e2574a; --green: #3aa864; --accent: #5b93e8;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #101216; --panel: #181b20; --ink: #eceef2; --ink-2: #a8aebb; --ink-3: #737a87; --line: #2a2f37;
  --soft: rgba(236, 238, 242, .06); --user: #262a31; --red: #e2574a; --green: #3aa864; --accent: #5b93e8;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
html { touch-action: pan-x pan-y; } /* 不让双指缩放整页 */
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.6 var(--f-body);
  display: flex; flex-direction: column; height: 100dvh; overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}
/* 桌面版网站模式下 html 上有 zoom（见 fit.js），dvh 会被放大。平时 fixed + inset 0，高度交给浏览器；
   只有键盘弹出（visual viewport 明显变矮，kb）时才用 fit.js 算的高度，输入框才不会被挡 */
html.zoomed body { position: fixed; inset: 0; height: auto; }
html.zoomed.kb body { bottom: auto; top: var(--vvt, 0px); height: var(--vvh, 100%); }
button, select, textarea, input { font: inherit; color: inherit; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* 顶栏 */
.bar {
  display: flex; align-items: center; gap: 8px;
  padding: calc(env(safe-area-inset-top) + 8px) 12px 8px;
  background: var(--bar-bg, var(--bg)); flex: none;
}
.tabs { display: flex; background: var(--soft); border-radius: 10px; padding: 2px; flex: none; }
.tab { border: 0; background: none; padding: 4px 11px; border-radius: 8px; color: var(--ink-2); font-size: 13.5px; cursor: pointer; }
.tab[aria-selected="true"] { background: var(--panel); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.06); font-weight: 600; }
.bar .title { flex: 1; min-width: 0; font-size: 14px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sheet .bar .title { color: var(--ink); font-weight: 600; font-size: 15px; }
.actions { display: flex; gap: 2px; flex: none; }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 9px; background: none; color: var(--ink-2); cursor: pointer; }
.icon-btn:active { background: var(--soft); }

main { flex: 1; min-height: 0; display: flex; }
.page { flex: 1; min-width: 0; display: flex; flex-direction: column; position: relative; }
#timeline, #monitor { flex: 1; width: 100%; border: 0; background: var(--bg); }
.tab.alarm::after { content: ""; display: inline-block; width: 7px; height: 7px; margin-left: 5px; border-radius: 50%; background: var(--red); vertical-align: 2px; }
/* 手机：顶栏三个标签放不下对话标题，不显示（还占着位置，把右边的按钮推到最右）；改名在历史里长按 */
html:not(.pc) #title { visibility: hidden; pointer-events: none; }
@media (max-width: 380px) { html:not(.pc) .tab { padding-inline: 8px; } }

/* 对话 */
.log { flex: 1; overflow-y: auto; padding: 12px 14px calc(var(--composer-h, 90px) + 28px); overscroll-behavior: contain; }
.log > * { max-width: 760px; margin-inline: auto; }
.msg-user { display: flex; flex-direction: column; align-items: flex-end; margin: 26px 0 14px; }
.msg-user:first-child, .more + .msg-user { margin-top: 8px; }
.msg-user .bubble { background: var(--bubble-bg, var(--user)); color: var(--bubble-fg, inherit); border-radius: var(--bubble-radius, 18px); padding: var(--bubble-pad, 10px 16px); max-width: var(--bubble-max, 80%); white-space: pre-wrap; word-break: break-word; font-family: var(--f-text, inherit); font-size: var(--text-size, inherit); }
.msg-user .imgs { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; margin-bottom: 6px; }
.msg-user .imgs img { width: 88px; height: 88px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.msg-user .imgs .ph { width: 88px; height: 88px; border-radius: 8px; background: var(--soft); display: grid; place-items: center; color: var(--ink-3); font-size: 12px; }
.msg-user .files { font-size: 12px; color: var(--ink-3); margin-top: 4px; }

.msg-text { margin: 10px 0; word-break: break-word; line-height: var(--text-lh, 1.65); font-family: var(--f-text, inherit); font-size: var(--text-size, 15.5px); }
.msg-text > :first-child { margin-top: 0; }
.msg-text > :last-child { margin-bottom: 0; }
.msg-text p, .msg-text ul, .msg-text ol, .msg-text pre, .msg-text table, .msg-text blockquote { margin: .7em 0; }
.msg-text ul, .msg-text ol { padding-left: 1.5em; }
.msg-text li { margin: .2em 0; }
.msg-text h1, .msg-text h2, .msg-text h3, .msg-text h4 { font-size: 1.05em; margin: 1.2em 0 .5em; font-weight: 600; }
.msg-text h1 { font-size: 1.25em; } .msg-text h2 { font-size: 1.15em; }
.msg-text a { color: var(--accent); }
.msg-text code { font: .88em var(--f-mono); background: var(--soft); padding: .1em .35em; border-radius: 4px; }
.msg-text pre { background: var(--panel); border: 1px solid var(--line); padding: 12px 14px; border-radius: 12px; overflow-x: auto; }
.msg-text pre code { background: none; padding: 0; font-size: 12.5px; line-height: 1.5; }
.msg-text table { border-collapse: collapse; display: block; overflow-x: auto; font-size: 13.5px; }
.msg-text th, .msg-text td { border: 1px solid var(--line); padding: 4px 8px; text-align: left; vertical-align: top; }
.msg-text blockquote { border-left: 3px solid var(--line); margin-left: 0; padding-left: 10px; color: var(--ink-2); }
.msg-text hr { border: 0; border-top: 1px solid var(--line); }
.streaming::after { content: ""; display: inline-block; width: 7px; height: 1em; vertical-align: -2px; margin-left: 2px; background: var(--ink-3); animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* 轨迹：一轮里连续的 Thinking 和工具调用收在一个 .steps 里，像 Claude 的 "Worked for 2m"、ChatGPT 的 "思考了 12 秒"：
   一行标题（在跑时是当前这步、扫光；跑完是"N 步 · 用时"），点开才是每一步 */
details.steps { margin: 8px 0; }
details.steps > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 6px; color: var(--ink-2); font-size: 13.5px; padding: 4px 0; min-width: 0; user-select: none; -webkit-user-select: none; }
details.steps > summary::-webkit-details-marker { display: none; }
details.steps > summary::before { content: ""; width: 6px; height: 6px; border-right: 1.5px solid var(--ink-3); border-bottom: 1.5px solid var(--ink-3); transform: rotate(-45deg); margin: 0 4px 0 2px; transition: transform .15s; flex: none; }
details.steps[open] > summary::before { transform: rotate(45deg); margin-top: -3px; }
details.steps > summary .s-cur { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
details.steps > summary .s-meta { color: var(--ink-3); flex: none; font-variant-numeric: tabular-nums; }
.steps-body { margin: 2px 0 6px 5px; padding-left: 14px; border-left: 1.5px solid var(--line); }
details.row-fold { margin: 2px 0; }
details.row-fold > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 7px;
  padding: 3px 0; color: var(--ink-2); font-size: 13px; min-width: 0;
}
details.row-fold > summary::-webkit-details-marker { display: none; }
.row-fold .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); flex: none; }
.row-fold .dot.run { background: var(--ink-3); animation: pulse 1.2s ease-in-out infinite; }
.row-fold .dot.err { background: var(--red); }
.row-fold .dot.think { background: transparent; border: 1.5px solid var(--ink-3); }
@keyframes pulse { 50% { opacity: .25; } }
.row-fold .name { font-weight: 600; color: var(--ink); flex: none; }
.row-fold .arg { font-family: var(--f-mono); font-size: 12.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.row-fold .sub { font-size: 12px; color: var(--ink-3); flex: none; }
.row-fold .body { margin: 2px 0 8px 14px; padding-left: 10px; border-left: 2px solid var(--line); }
.row-fold pre { margin: 4px 0; font: 12px/1.5 var(--f-mono); white-space: pre-wrap; word-break: break-word; color: var(--ink-2); max-height: calc(var(--vh, 1vh) * 50); overflow: auto; }
.row-fold pre.err { color: var(--red); }
.row-fold .thinking-text { font-size: 13.5px; color: var(--ink-2); white-space: pre-wrap; }
.todos { list-style: none; padding: 0; margin: 4px 0; font-size: 13.5px; }
.todos li { padding: 1px 0; }
.todos .completed { color: var(--ink-3); text-decoration: line-through; }
.todos .in_progress { font-weight: 600; }

.note { text-align: center; font-size: 12.5px; color: var(--ink-3); margin: 10px 0; white-space: pre-wrap; }
.note.error { color: var(--red); }
.activity { color: var(--ink-3); font-size: 13.5px; margin: 8px 0; display: flex; align-items: center; gap: 8px; }
.activity .dots::after { content: "…"; animation: blink 1s steps(2) infinite; }
.empty { color: var(--ink-3); text-align: center; margin-top: calc(var(--vh, 1vh) * 30); }
/* 空白页（还没发消息，skin.js 给 <html> 加 blank）：问候语、输入框居中，提醒列表是输入框下面的托盘。
   .page 是 flex 列，用 order 排：问候语(::before) 0、输入框 1、提醒 2、底下那行字(::after) 3 */
html.blank .page { justify-content: center; }
html.blank .page::before { content: var(--greeting, "今天做什么？"); order: 0; display: block; text-align: center; font: var(--greeting-font, 400 26px/1.3 var(--f-body)); color: var(--greeting-color, var(--ink)); margin: 0 16px 20px; flex: none; }
html.blank .composer { order: 1; }
html.blank .log { order: 2; flex: 0 1 auto; padding: 0 14px 8px; }
html.blank .watch { max-width: 736px; width: calc(100% - 16px); margin: -16px auto 0; padding: 26px 16px 12px; border-radius: 0 0 22px 22px; background: var(--tray-bg, var(--soft)); }
html.blank .watch:empty { display: none; }
.page::after { content: var(--note, none); position: absolute; left: 0; right: 0; bottom: calc(env(safe-area-inset-bottom) + 7px); z-index: 2; text-align: center; font-size: 11.5px; color: var(--ink-3); pointer-events: none; }
html.blank .page::after { position: static; order: 3; margin-top: 10px; }

/* 输入框：浮在对话区底部，后面一层从透明到底色的渐隐，最后一条消息能滚到它上面（.log 的 padding-bottom 留了位置） */
.composer {
  position: absolute; left: 10px; right: 10px; bottom: calc(env(safe-area-inset-bottom) + var(--composer-bottom, 10px)); z-index: 2; margin: 0 auto;
  background: var(--composer-bg, var(--panel)); border: 1px solid var(--composer-line, var(--line)); border-radius: var(--composer-radius, 18px); padding: 8px 8px 6px;
  box-shadow: var(--composer-shadow, 0 1px 2px rgba(0, 0, 0, .04));
  max-width: 760px;
}
html.blank .composer { position: static; width: calc(100% - 20px); flex: none; }
.composer textarea {
  display: block; width: 100%; border: 0; outline: 0; resize: none; background: none;
  padding: 4px 6px; max-height: calc(var(--vh, 1vh) * 40); line-height: 1.45; font-size: var(--input-size, 16px); font-family: var(--f-text, inherit);
}
.composer textarea::placeholder { color: var(--placeholder, var(--ink-3)); }
.composer .row { display: flex; align-items: center; gap: 3px; margin-top: 6px; }
.composer .row > * { order: 2; }
.composer .row > .icon-btn, .composer .row > .agents { order: 0; }
.composer .row > .spacer { order: 1; }
.composer .row > .mic { order: 3; margin-left: 2px; }
.composer .row > .send { order: 4; }
.composer .spacer { flex: 1; }
/* 下拉框本身透明盖在上面，显示的是 .v 里选中的那项，宽度正好 */
.composer select { position: absolute; inset: 0; width: 100%; opacity: 0; border: 0; font-size: 16px; appearance: none; -webkit-appearance: none; }
.composer .icon-btn { width: 30px; flex: none; border-radius: var(--btn-radius, 9px); }
.pick { position: relative; display: flex; align-items: center; gap: 3px; background: var(--soft); border-radius: var(--btn-radius, 8px); padding: 5px 7px; color: var(--ink-2); flex: 0 1 auto; min-width: 0; font-size: 13px; line-height: 1.35; }
.pick svg { width: 16px; height: 16px; flex: none; margin-left: -1px; }
.pick .v { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.attachments { display: flex; gap: 6px; flex-wrap: wrap; padding: 2px 4px 6px; }
.chip { position: relative; display: flex; align-items: center; gap: 6px; background: var(--soft); border-radius: 8px; padding: 4px 26px 4px 6px; font-size: 12.5px; max-width: 180px; }
.chip img { width: 36px; height: 36px; object-fit: cover; border-radius: 6px; }
.chip span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip button { position: absolute; right: 2px; top: 50%; transform: translateY(-50%); border: 0; background: none; width: 22px; height: 22px; color: var(--ink-3); cursor: pointer; padding: 0; }
.chip button svg { width: 14px; height: 14px; }

.composer .mic.on { background: var(--red); color: #fff; }
.composer .mic:disabled { opacity: .3; }
.voice { display: flex; align-items: center; gap: 8px; padding: 2px 4px 6px 6px; font-size: 14px; color: var(--ink-2); }
.voice .v-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--ink-3); flex: none; transition: transform .08s linear; }
.voice.live .v-dot { background: var(--red); }
.voice .v-time { font-variant-numeric: tabular-nums; color: var(--ink); font-weight: 600; }
.voice .spacer { flex: 1; }
.voice button { border: 0; border-radius: 10px; padding: 8px 16px; font-size: 15px; font-weight: 600; cursor: pointer; background: var(--soft); color: var(--ink); }
.voice .v-stop { background: var(--red); color: #fff; }
.send { width: var(--send-size, 34px); height: var(--send-size, 34px); border-radius: var(--send-radius, 50%); border: 0; background: var(--send-bg, var(--ink)); color: var(--send-fg, var(--panel)); display: grid; place-items: center; cursor: pointer; flex: none; }
.send:disabled { opacity: .3; }
.send .i-stop { display: none; fill: currentColor; stroke: none; }
.send.stop .i-send { display: none; }
.send.stop .i-stop { display: block; }

/* 一周用量：上红（用量）下绿（这周过了多少），紧贴。上面一组 A 号，下面一组 B 号（10/27 加的第二个号，子任务先用它；并排放手机底栏会把模型名挤没） */
.usage { border: 0; background: none; padding: 8px 3px; cursor: pointer; display: flex; flex-direction: column; gap: 3px; width: 42px; flex: none; }
.u-acct { display: flex; flex-direction: column; }
.u-bar { display: block; height: 4px; background: var(--soft); overflow: hidden; }
.u-bar:first-child { border-radius: 2px 2px 0 0; }
.u-bar:last-child { border-radius: 0 0 2px 2px; }
.u-bar i { display: block; height: 100%; width: 0; }
.u-used i { background: var(--red); }
.u-time i { background: var(--green); }
/* 上下文：小圆环是占窗口的比例，数字是占了多少 token（每发一条都要再读一遍）。手机在顶栏（底下那排放不下），电脑版在输入框底下 */
.ctx { display: inline-flex; align-items: center; gap: 4px; height: 30px; padding: 0 5px; border: 0; border-radius: 8px; background: none; color: var(--ink-2); cursor: pointer; flex: none; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.bar .ctx { height: 36px; }
.ctx svg { width: 15px; height: 15px; transform: rotate(-90deg); stroke-width: 2.8; }
.ctx .c-bg { stroke: var(--line); }
.ctx .c-fg { stroke: currentColor; stroke-dasharray: var(--p, 0) 100; }
.ctx.hi { color: var(--red); }
.ctx:active { background: var(--soft); }
.usage-pop {
  position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%);
  background: var(--ink); color: var(--panel); font-size: 12.5px; padding: 6px 10px; border-radius: 8px; white-space: pre;
}

/* 历史 */
.sheet { position: fixed; inset: 0; background: var(--bg); display: flex; flex-direction: column; z-index: 10; }
.sessions { list-style: none; margin: 0; padding: 4px 0; overflow-y: auto; flex: 1; }
.sessions li { padding: 10px 12px; margin: 1px 8px; border-radius: 9px; cursor: pointer; display: flex; gap: 10px; align-items: baseline; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.sessions li.menu { align-items: center; gap: 6px; padding-block: 7px; }
.search { padding: 6px 12px 8px; flex: none; }
.search input { width: 100%; border: 0; background: var(--soft); border-radius: 10px; padding: 7px 11px; font-size: 16px; outline: 0; }
.sessions li:active { background: var(--soft); }
.sessions li.current { background: var(--soft); }
.sessions .t { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sessions .d { flex: none; font-size: 12.5px; color: var(--ink-3); }
.sessions .live { width: 7px; height: 7px; border-radius: 50%; background: var(--green); flex: none; align-self: center; order: 3; } /* 放右边，标题才对齐 */
.prefs { display: flex; gap: 8px; padding: 8px 12px calc(env(safe-area-inset-bottom) + 10px); border-top: 1px solid var(--line); flex: none; }
.prefs select { flex: 1; min-width: 0; border: 0; background: var(--soft); border-radius: 9px; padding: 7px 10px; font-size: 14px; color: var(--ink-2); outline: 0; }
.more { margin: 10px auto calc(env(safe-area-inset-bottom) + 14px); border: 0; background: var(--soft); border-radius: 999px; padding: 6px 16px; color: var(--ink-2); font-size: 13.5px; cursor: pointer; }

/* 登录 */
.login { margin: auto; width: min(360px, calc(100% - 32px)); display: flex; flex-direction: column; gap: 10px; }
.login input { border: 1px solid var(--line); background: var(--panel); border-radius: 10px; padding: 10px 12px; font-size: 16px; }
.login button { border: 0; background: var(--ink); color: var(--panel); border-radius: 10px; padding: 10px; font-weight: 600; }
.login .msg { min-height: 1.4em; font-size: 13px; color: var(--red); text-align: center; }

/* 正在进行：文字上扫过一道亮光 */
.shimmer {
  background: linear-gradient(90deg, var(--ink-3) 0 35%, var(--ink) 50%, var(--ink-3) 65% 100%);
  background-size: 250% 100%; -webkit-background-clip: text; background-clip: text; color: transparent !important;
  animation: shimmer 1.5s linear infinite;
}
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }
.row-fold.think.empty > summary { cursor: default; }
.row-fold .dot.run { animation: pulse 1s ease-in-out infinite; }
.row-fold .dot.think.run { border-color: var(--accent); }
.activity .dots3 { display: inline-flex; gap: 4px; padding: 0 2px; }
.activity .dots3 i { width: 6px; height: 6px; border-radius: 50%; background: var(--ink-3); animation: bounce 1.2s ease-in-out infinite; }
.activity .dots3 i:nth-child(2) { animation-delay: .15s; }
.activity .dots3 i:nth-child(3) { animation-delay: .3s; }
@keyframes bounce { 0%, 60%, 100% { transform: translateY(0); opacity: .45; } 30% { transform: translateY(-4px); opacity: 1; } }

/* 子 agent 的步骤 */
.kids { margin: 4px 0; padding: 2px 0 2px 8px; border-left: 2px dashed var(--line); }
.kids .msg-text, .row-fold .report { font-size: 13.5px; color: var(--ink-2); }
.file-link { display: inline-block; font: 12.5px var(--f-mono); color: var(--accent); margin: 2px 0; text-decoration: none; word-break: break-all; }
.msg-text code.path { color: var(--accent); cursor: pointer; text-decoration: underline dotted; text-underline-offset: 3px; }
.msg-text pre { position: relative; }
.msg-text pre .copy { position: absolute; top: 4px; right: 4px; border: 0; border-radius: 6px; background: var(--panel); color: var(--ink-3); font-size: 11.5px; padding: 2px 7px; opacity: .85; }

/* 要用户点的：选项、计划、允许 */
.card { margin: 12px 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); }
.card.live { border-color: var(--accent); }
.card.sent { opacity: .55; pointer-events: none; }
.q + .q { margin-top: 12px; }
.q-h { display: inline-block; font-size: 11.5px; color: var(--ink-3); background: var(--soft); border-radius: 5px; padding: 1px 6px; margin-bottom: 4px; }
.q-text { font-weight: 600; margin-bottom: 6px; }
.opts { display: flex; flex-direction: column; gap: 6px; }
.opt { text-align: left; border: 1px solid var(--line); background: none; border-radius: 9px; padding: 7px 10px; cursor: pointer; display: flex; flex-direction: column; gap: 1px; }
.opt .l { font-weight: 600; }
.opt .d { font-size: 12.5px; color: var(--ink-3); }
.opt.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.opt:disabled { cursor: default; color: inherit; }
.opt:disabled:not(.on) { opacity: .55; }
.other { margin-top: 6px; width: 100%; border: 1px solid var(--line); background: none; border-radius: 9px; padding: 7px 10px; font-size: 16px; outline: 0; }
.other:focus { border-color: var(--accent); }
.q-ans { margin-top: 6px; font-size: 13px; color: var(--ink-3); }
.card .msg-text { font-size: 14px; }
.card-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }
.btn { border: 0; border-radius: 10px; padding: 7px 14px; background: var(--ink); color: var(--panel); font-weight: 600; font-size: 14px; cursor: pointer; }
.btn:disabled { opacity: .35; }
.btn.ghost { background: var(--soft); color: var(--ink); font-weight: 500; }
.btn.danger { background: var(--red); color: #fff; font-weight: 500; }
.sessions li.menu .t { flex: 1; }
.sessions li.menu .btn { padding: 5px 10px; font-size: 13px; }
.perm { margin: 4px 0 8px; }
.perm-t { font-size: 13.5px; }
.perm .card-actions { justify-content: flex-start; margin-top: 6px; }

/* 到最下面 */
.to-bottom {
  position: absolute; right: 2px; bottom: calc(100% + 10px); z-index: 2;
  width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: var(--panel); color: var(--ink-2);
  display: grid; place-items: center; box-shadow: 0 2px 8px rgba(0,0,0,.18); cursor: pointer;
}

/* 斜杠命令 */
.cmds {
  position: absolute; left: 0; right: 0; bottom: calc(100% + 6px); max-height: min(320px, calc(var(--vh, 1vh) * 40)); overflow-y: auto;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 4px 16px rgba(0,0,0,.18); z-index: 3; padding: 4px;
}
.cmd { display: flex; flex-direction: column; align-items: flex-start; width: 100%; border: 0; background: none; text-align: left; padding: 6px 9px; border-radius: 8px; cursor: pointer; }
.cmd:active { background: var(--soft); }
.cmd .n { font: 13.5px var(--f-mono); color: var(--ink); }
.cmd .d { font-size: 12px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }

/* 看文件 */
.viewer-body { flex: 1; overflow: auto; padding: 12px 14px calc(env(safe-area-inset-bottom) + 20px); }
.viewer-body .doc { max-width: 760px; margin: 0 auto; }
.src { font: 12.5px/1.55 var(--f-mono); counter-reset: none; }
.src .ln { white-space: pre-wrap; word-break: break-word; padding-left: 3.6em; text-indent: -3.6em; }
.src .ln::before { content: attr(data-n); display: inline-block; width: 3em; margin-right: .6em; text-align: right; color: var(--ink-3); text-indent: 0; }
.src .ln.hl { background: color-mix(in srgb, var(--accent) 18%, transparent); }
.dir { list-style: none; margin: 0; padding: 0; }
.dir li { padding: 9px 4px; border-bottom: 1px solid var(--line); cursor: pointer; }
.dir li.is-dir { font-weight: 600; }
.doc-img { max-width: 100%; display: block; margin: 0 auto; }
.file-open { color: var(--accent); }
#viewer { z-index: 11; }

/* 看图 */
.zoom { position: fixed; inset: 0; z-index: 20; background: rgba(0,0,0,.92); display: grid; place-items: center; overflow: auto; }
.zoom img { max-width: 100%; max-height: 100%; object-fit: contain; }
.zoom.full { display: block; }
.zoom.full img { max-width: none; max-height: none; }
.zoom .icon-btn { position: fixed; top: calc(env(safe-area-inset-top) + 8px); right: 8px; color: #fff; background: rgba(255,255,255,.12); }
.msg-text img { max-width: 100%; }
img.zoomable { cursor: zoom-in; }

/* 计时、复制、开头 */
.activity .t, .row-fold .el { font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; flex: none; }
.turn-end { display: flex; margin: -2px 0 6px -6px; }
.copy-turn { width: 30px; height: 28px; color: var(--ink-3); }
.copy-turn svg { width: 17px; height: 17px; }
.copy-turn.done { color: var(--green); }
/* 新对话那页：后台提醒 */
.watch { display: grid; gap: 14px; padding: 6px 2px 0; max-width: 560px; }
.w-head { display: flex; align-items: center; gap: 8px; }
.w-st { flex: 1; min-width: 0; display: grid; }
.w-st b { font-size: 15px; }
.w-sub { font-size: 12.5px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.w-btn { border: 1px solid var(--line); background: var(--panel); color: var(--ink); border-radius: 16px; padding: 5px 12px; font-size: 13.5px; cursor: pointer; white-space: nowrap; }
.w-btn:active { background: var(--soft); }
.w-sec { display: grid; gap: 2px; }
.w-sec h3 { margin: 0 0 2px; font-size: 12px; font-weight: 500; color: var(--ink-3); letter-spacing: .06em; }
.w-row { display: grid; grid-template-columns: 74px minmax(0, 1fr) auto; gap: 8px; align-items: baseline; padding: 6px 8px; border-radius: 8px; background: var(--panel); border: 1px solid var(--line); }
.w-t { font: 12px var(--f-mono); color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.w-x { display: grid; gap: 1px; min-width: 0; font-size: 13.5px; line-height: 1.45; }
.w-x span { color: var(--ink-2); overflow-wrap: anywhere; }
.w-cancel { border: 0; background: none; color: var(--ink-3); font-size: 18px; line-height: 1; padding: 0 4px; cursor: pointer; }
.w-run { border-radius: 8px; }
.w-sum { width: 100%; display: grid; grid-template-columns: 74px minmax(0, 1fr) auto; gap: 8px; align-items: baseline; padding: 6px 8px; border: 0; border-radius: 8px; background: none; color: var(--ink); font: inherit; font-size: 13.5px; text-align: left; cursor: pointer; }
.w-sum:active { background: var(--soft); }
.w-why { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.w-what { font-size: 12.5px; color: var(--ink-2); white-space: nowrap; }
.w-run.err .w-what { color: var(--red); }
.w-det { display: none; padding: 2px 8px 10px 90px; font-size: 13px; }
.w-run.open { background: var(--panel); border: 1px solid var(--line); }
.w-run.open .w-det { display: grid; gap: 6px; }
.w-note > :first-child { margin-top: 0; } .w-note > :last-child { margin-bottom: 0; }
.w-note p, .w-note ul { margin: 4px 0; } .w-note ul { padding-left: 18px; }
.w-acts { margin: 0; padding: 0; list-style: none; display: grid; gap: 1px; font: 11.5px/1.5 var(--f-mono); color: var(--ink-3); overflow-wrap: anywhere; }
.w-meta { margin: 0; font-size: 11.5px; color: var(--ink-3); }
@media (max-width: 480px) { .w-det { padding-left: 8px; } }

/* 公式 */
.math-block { overflow-x: auto; overflow-y: hidden; margin: .55em 0; }
.math-block .katex-display { margin: 0; }
.katex { font-size: 1.08em; }
.math-raw { white-space: pre-wrap; }
.dir li.pin { color: var(--accent); }
.dir li.pin + li:not(.pin) { border-top: 6px solid var(--soft); }
.msg-user.queued .bubble { opacity: .55; }
.sessions li.unread .t { font-weight: 700; color: var(--ink); }
.sessions li.unread::after { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex: none; align-self: center; order: 3; }
.bar .title { cursor: pointer; }

/* 子 agent：输入框底下的小药丸（图标、在跑的点、几个在跑），点开是树 */
.composer .agents { display: inline-flex; align-items: center; gap: 4px; height: 30px; padding: 0 5px; border: 0; border-radius: 8px; background: none; color: var(--ink-2); cursor: pointer; flex: none; font-size: 13px; font-variant-numeric: tabular-nums; }
.composer .agents svg { width: 19px; height: 19px; }
.agents .a-dot { display: none; width: 6px; height: 6px; border-radius: 50%; flex: none; }
.agents .a-n:empty { display: none; }
.composer .agents.run { background: var(--soft); color: var(--ink); padding-right: 8px; }
.agents.run .a-dot { display: block; background: var(--accent); animation: pulse 1s ease-in-out infinite; }
.agents.err .a-dot { display: block; background: var(--red); }
.composer .agents:active { background: var(--soft); }
.st { width: 7px; height: 7px; border-radius: 50%; flex: none; background: var(--green); }
.st.running { background: var(--accent); animation: pulse 1s ease-in-out infinite; }
.st.error { background: var(--red); }
.st.stopped, .st.idle { background: none; border: 1.5px solid var(--ink-3); }
.agents-body { flex: 1; overflow: auto; padding: 10px 12px calc(env(safe-area-inset-bottom) + 24px); }
.agents-body > * { max-width: 760px; margin-inline: auto; }
.a-head { font-size: 12.5px; color: var(--ink-3); margin: 0 0 6px; }
.a-root { display: flex; align-items: center; gap: 8px; padding: 6px 6px; font-weight: 600; }
.a-root .a-desc { font-size: 14.5px; }
.a-tree, .a-kids { list-style: none; margin: 0; padding: 0; }
.a-tree { padding-left: 9px; }
.a-kids { padding-left: 10px; }
.a-node { position: relative; padding-left: 12px; }
.a-node::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; border-left: 1.5px solid var(--line); }
.a-node:last-child::before { bottom: auto; height: 19px; }
.a-node::after { content: ""; position: absolute; left: 0; top: 18px; width: 9px; border-top: 1.5px solid var(--line); }
.a-row { display: grid; gap: 1px; width: 100%; text-align: left; border: 0; background: none; padding: 7px 6px; border-radius: 8px; cursor: pointer; color: var(--ink); }
.a-row:active { background: var(--soft); }
.a-top { display: flex; align-items: center; gap: 7px; min-width: 0; }
.a-desc { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14px; }
.a-meta { flex: none; font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.a-cur { font: 11.5px var(--f-mono); color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-left: 14px; }
.a-info { display: grid; gap: 3px; font-size: 13px; color: var(--ink-2); margin: 2px 0 10px; }
.a-st { display: flex; align-items: center; gap: 7px; color: var(--ink); font-weight: 600; }
.a-curline { font: 12px/1.5 var(--f-mono); color: var(--ink-3); margin: -4px 0 10px; overflow-wrap: anywhere; }
.a-result { border: 1px solid var(--line); background: var(--panel); border-radius: 10px; padding: 10px 12px; margin: 0 0 6px; font-size: 14px; }
.a-sec > summary, .a-sec-h { font-size: 12px; color: var(--ink-3); letter-spacing: .04em; margin: 12px 0 4px; }
.a-sec > summary { cursor: pointer; }
.a-prompt { font: 12px/1.5 var(--f-mono); white-space: pre-wrap; word-break: break-word; color: var(--ink-2); background: var(--soft); padding: 8px 10px; border-radius: 8px; max-height: calc(var(--vh, 1vh) * 50); overflow: auto; margin: 4px 0; }
.a-steps .msg-text { font-size: 13.5px; color: var(--ink-2); }

/* agent：历史列表里每行标是哪家；开着的对话里 agent 选框锁住 */
#sessions .ag { flex: none; font-size: 11.5px; color: var(--ink-3); margin: 0 8px; }
#agent-pick.locked { opacity: .65; }
.tab[hidden] { display: none; }

/* =====================================================================
   设计层（2026-10-31 第五版）：所有风格共用的控件样子、交互和动效，后面是每个风格自己的变化。
   变量在 skins.css。改这里不影响时间线页（它不加载 app.css）。
   ===================================================================== */
body { font-family: var(--f-ui); }
body, .bar, #history, .composer, .msg-user .bubble { transition: background-color .3s var(--ease), color .3s var(--ease), border-color .3s var(--ease); }

/* ---------- 顶栏 ---------- */
.bar { gap: 6px; min-height: 52px; }
.icon-btn { width: 36px; height: 36px; border-radius: var(--btn-radius); transition: background-color .15s, color .15s; }
.icon-btn:hover { background: var(--hover); color: var(--ink); }
.icon-btn:active { transform: scale(.94); }
.tab { transition: background-color .2s, color .2s, box-shadow .2s; }
.tab:hover { color: var(--ink); }

/* ---------- 对话：正文 ---------- */
.log > * { max-width: 768px; }
.msg-text { font-family: var(--f-text-pref, var(--f-text)); font-size: calc(var(--text-size) * var(--scale, 1)); line-height: var(--text-lh); color: var(--ink); }
.msg-text strong { font-weight: 600; }
.msg-text h1, .msg-text h2, .msg-text h3, .msg-text h4 { font-weight: 600; line-height: 1.35; margin: 1.3em 0 .5em; }
.msg-text h1 { font-size: 1.3em; } .msg-text h2 { font-size: 1.18em; } .msg-text h3, .msg-text h4 { font-size: 1.05em; }
.msg-text a { color: var(--accent); text-decoration: underline; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); text-underline-offset: 3px; }
.msg-text a:hover { text-decoration-color: currentColor; }
.msg-text ul, .msg-text ol { padding-left: 1.45em; }
.msg-text li::marker { color: var(--ink-3); }
.msg-text code { font: .86em/1.4 var(--f-mono); background: var(--code-bg); padding: .14em .4em; border-radius: 6px; }
.msg-text pre { background: var(--code-bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.msg-text pre code { font-size: 13px; line-height: 1.6; }
.msg-text pre .copy { top: 8px; right: 8px; background: var(--panel); border: 1px solid var(--line); opacity: 0; transition: opacity .15s; }
.msg-text pre:hover .copy { opacity: 1; }
@media (hover: none) { .msg-text pre .copy { opacity: .9; } }
.msg-text table { font-size: .92em; border-collapse: collapse; }
.msg-text th, .msg-text td { border: 0; border-bottom: 1px solid var(--line); padding: 9px 18px 9px 0; }
.msg-text th { font-weight: 600; border-bottom-color: color-mix(in srgb, var(--ink) 25%, transparent); }
.msg-text tr:last-child td { border-bottom: 0; }
.msg-text blockquote { border-left: 3px solid var(--line); color: var(--ink-2); padding-left: 14px; }
.msg-text hr { border-top: 1px solid var(--line); margin: 1.6em 0; }

/* 用户消息：右边的气泡，正文用界面字体 */
.msg-user { margin: 28px 0 16px; position: relative; }
.msg-user .bubble { font-family: var(--f-ui); font-size: calc(var(--text-size) * var(--scale, 1)); line-height: 1.6; }

/* 一轮回答完的操作：复制。最后一轮常显，之前的鼠标移上去才显 */
.turn-end { margin: 2px 0 10px -6px; gap: 2px; transition: opacity .2s; }
.copy-turn { width: 32px; height: 32px; border-radius: 8px; }
.copy-turn::after { content: "已复制"; position: absolute; margin: -30px 0 0 0; font-size: 11.5px; color: var(--panel); background: var(--ink); padding: 2px 7px; border-radius: 6px; opacity: 0; transform: translateY(4px); transition: .18s var(--ease); pointer-events: none; white-space: nowrap; }
.copy-turn.done::after { opacity: 1; transform: none; }
@media (hover: hover) {
  .log > .turn-end { opacity: 0; }
  .log > .turn-end:hover, .log > .msg-text:hover + .turn-end, .log > .turn-end:not(:has(~ .turn-end)) { opacity: 1; }
}

/* 正在输出的文字：默认一根闪的竖线 */
.streaming::after { display: none; }
.msg-text.streaming > :last-child::after, .msg-text.streaming > :is(ul, ol):last-child > li:last-child::after {
  content: ""; display: inline-block; width: 2px; height: 1.05em; margin-left: 3px; vertical-align: -3px; background: var(--ink-2); animation: blink 1s steps(2) infinite;
}

/* ---------- 轨迹（思考、工具） ---------- */
details.steps > summary { transition: color .15s; border-radius: 8px; }
details.steps > summary:hover { color: var(--ink); }
details.steps > summary .s-meta:empty { display: none; }
@supports selector(::details-content) {
  :root { interpolate-size: allow-keywords; }
  details.steps::details-content { height: 0; overflow: clip; opacity: 0; transition: height .28s var(--ease), opacity .2s, content-visibility .28s allow-discrete; }
  details.steps[open]::details-content { height: auto; opacity: 1; }
}
details.row-fold > summary { font-size: 13px; gap: 8px; }
.row-fold .name { font-weight: 500; }
.row-fold .arg { font-family: var(--f-ui); font-size: 13px; }
.row-fold .dot { width: 6px; height: 6px; }
.row-fold pre { background: var(--code-bg); border-radius: 8px; padding: 8px 10px; }

/* 正在回答的那一行 */
.activity { min-height: 28px; }
.activity .txt { font-size: 13.5px; }

/* ---------- 输入框 ---------- */
.composer { transition: border-color .2s, box-shadow .2s, background-color .3s; }
.composer:focus-within { border-color: var(--composer-line-focus, var(--composer-line, var(--line))); }
.composer textarea { color: var(--ink); }
.composer .icon-btn { width: 34px; height: 34px; border-radius: var(--btn-radius); color: var(--ink-2); }
.pick { background: none; border-radius: var(--btn-radius); padding: 5px 8px; color: var(--ink-2); transition: background-color .15s, color .15s; }
.pick:hover { background: var(--hover); color: var(--ink); }
.pick::after { content: ""; width: 5px; height: 5px; border-right: 1.4px solid currentColor; border-bottom: 1.4px solid currentColor; transform: rotate(45deg) translateY(-2px); margin-left: 4px; opacity: .6; flex: none; }
.send { transition: transform .15s var(--ease), opacity .2s, background-color .2s; }
.send:not(:disabled):active { transform: scale(.92); }
.send:disabled { opacity: .35; cursor: default; }
.to-bottom { left: 50%; right: auto; transform: translateX(-50%); width: 34px; height: 34px; background: var(--bg); border: 1px solid color-mix(in srgb, var(--ink) 14%, transparent); color: var(--ink); box-shadow: 0 2px 10px rgba(0, 0, 0, .12); transition: opacity .2s, transform .2s var(--ease); }
.to-bottom:hover { color: var(--ink); }
.to-bottom[hidden] { display: grid !important; opacity: 0; pointer-events: none; transform: translate(-50%, 6px); }
.cmds, .usage-pop { border-radius: var(--radius); }

/* ---------- 空白页 ---------- */
html.blank .page::before { font-family: var(--f-ui); font-size: 28px; font-weight: 500; letter-spacing: -.01em; animation: rise .5s var(--ease) both; }
html.blank .composer { animation: rise .5s .05s var(--ease) both; }
html.blank .watch { animation: rise .5s .1s var(--ease) both; }

/* ---------- 左栏 / 历史 ---------- */
.side-new, .side-h { display: none; }
.pc .side-new { display: flex; align-items: center; gap: 10px; margin: 6px 8px 2px; padding: 8px 12px; border: 0; border-radius: var(--btn-radius); background: none; color: var(--ink); font-size: 14px; cursor: pointer; text-align: left; transition: background-color .15s; }
.pc .side-new:hover { background: var(--hover); }
.pc .side-new svg { width: 18px; height: 18px; color: var(--ink-2); }
.pc .side-h { display: block; padding: 14px 20px 4px; font-size: 12px; color: var(--ink-3); }
.search input { background: var(--hover); transition: background-color .15s, box-shadow .15s; }
.search input:focus { background: var(--panel); box-shadow: 0 0 0 1px var(--line); }
.sessions li { transition: background-color .12s; border-radius: var(--btn-radius); font-size: 14px; }
.sessions li.current { background: var(--side-active); }
@media (hover: hover) {
  .sessions li:hover { background: var(--hover); }
  .sessions li.current:hover { background: var(--side-active); }
  .pc #sessions .ag, .pc #sessions .d { opacity: 0; transition: opacity .15s; }
  .pc #sessions li:hover .ag, .pc #sessions li:hover .d { opacity: 1; }
}
.prefs-btn { display: flex; align-items: center; gap: 10px; margin: 6px 8px calc(env(safe-area-inset-bottom) + 8px); padding: 9px 12px; border: 0; border-radius: var(--btn-radius); background: none; color: var(--ink-2); font-size: 14px; cursor: pointer; flex: none; transition: background-color .15s, color .15s; }
.prefs-btn:hover { background: var(--hover); color: var(--ink); }
.prefs-btn svg { width: 18px; height: 18px; }

/* 抽屉、面板进出 */
.sheet { transition: opacity .22s var(--ease), transform .26s var(--ease), display .26s allow-discrete; }
@starting-style { html:not(.pc) .sheet:not([hidden]) { opacity: 0; transform: translateY(14px); } }
@starting-style { html:not(.pc) #history:not([hidden]) { opacity: 0; transform: translateX(-24px); } }
@starting-style { #viewer:not([hidden]) { opacity: 0; transform: translateX(24px); } }

/* ---------- 设置 ---------- */
#settings { z-index: 12; }
.settings-panel { display: flex; flex-direction: column; height: 100%; background: var(--bg); }
.settings-body { flex: 1; overflow-y: auto; padding: 4px 16px calc(env(safe-area-inset-bottom) + 28px); }
.set-sec { max-width: 640px; margin: 0 auto; padding: 8px 0 18px; }
.set-sec + .set-sec { border-top: 1px solid var(--line); }
.set-sec h3 { margin: 12px 0 8px; font-size: 13px; font-weight: 600; color: var(--ink-3); }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 11px 0; flex-wrap: wrap; }
.set-l { min-width: 0; flex: 1 1 180px; }
.set-n { font-size: 14.5px; color: var(--ink); }
.set-h { font-size: 12.5px; color: var(--ink-3); margin-top: 1px; }
.seg-ctl { display: inline-flex; background: var(--hover); border-radius: 10px; padding: 3px; gap: 2px; flex: none; }
.seg-ctl button { border: 0; background: none; padding: 5px 12px; border-radius: 8px; font-size: 13px; color: var(--ink-2); cursor: pointer; white-space: nowrap; transition: background-color .18s, color .18s, box-shadow .18s; }
.seg-ctl button:hover { color: var(--ink); }
.seg-ctl button.on { background: var(--panel); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .1); font-weight: 500; }
.dark .seg-ctl button.on { background: color-mix(in srgb, var(--ink) 14%, var(--bg)); }
.set-input { width: 180px; border: 1px solid var(--line); background: var(--panel); border-radius: 10px; padding: 7px 11px; font-size: 15px; outline: 0; color: var(--ink); }
.set-input:focus { border-color: var(--ink-3); }
.set-danger { border: 1px solid var(--line); background: none; color: var(--red); border-radius: 10px; padding: 7px 14px; font-size: 14px; cursor: pointer; }
.set-danger:hover { background: color-mix(in srgb, var(--red) 8%, transparent); }
.skin-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 6px; }
@media (min-width: 560px) { .skin-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.skin-card { display: grid; gap: 2px; text-align: left; border: 1.5px solid var(--line); background: var(--panel); border-radius: 14px; padding: 8px 8px 10px; cursor: pointer; transition: border-color .18s, transform .18s var(--ease), box-shadow .18s; }
.skin-card:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0, 0, 0, .08); }
.skin-card.on { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.sk-n { font-size: 13.5px; font-weight: 600; color: var(--ink); margin-top: 6px; padding: 0 2px; }
.sk-d { font-size: 11.5px; color: var(--ink-3); padding: 0 2px; }
/* 小预览：一条用户气泡、两行回答、一个输入框和发送键 */
.pv { position: relative; height: 82px; border-radius: 9px; overflow: hidden; background: var(--pv-bg); display: grid; align-content: start; gap: 6px; padding: 10px; }
.pv i { display: block; height: 6px; border-radius: 3px; background: var(--pv-ink); opacity: .55; }
.pv .pv-u { justify-self: end; width: 46%; height: 14px; border-radius: var(--pv-br); background: var(--pv-user); opacity: 1; }
.pv .pv-a { width: 86%; } .pv .pv-a.short { width: 58%; }
.pv .pv-c { position: absolute; left: 8px; right: 8px; bottom: 8px; height: 18px; border-radius: var(--pv-cr); background: var(--pv-comp); opacity: 1; box-shadow: var(--pv-cs); }
.pv .pv-c::after { content: ""; position: absolute; right: 3px; top: 3px; width: 12px; height: 12px; border-radius: var(--pv-sr); background: var(--pv-send); }
.pv-me { --pv-bg: #f2f3f5; --pv-ink: #16181d; --pv-user: #e4e7ec; --pv-comp: #fff; --pv-send: #16181d; --pv-br: 7px; --pv-cr: 7px; --pv-sr: 50%; --pv-cs: 0 0 0 1px #dde0e6; }
.pv-claude { --pv-bg: #faf9f5; --pv-ink: #141413; --pv-user: #f0eee6; --pv-comp: #fff; --pv-send: #c6613f; --pv-br: 6px; --pv-cr: 7px; --pv-sr: 3px; --pv-cs: 0 0 0 1px #dedcd1; }
.pv-chatgpt { --pv-bg: #ffffff; --pv-ink: #0d0d0d; --pv-user: #f4f4f4; --pv-comp: #fff; --pv-send: #000; --pv-br: 9px; --pv-cr: 9px; --pv-sr: 50%; --pv-cs: 0 1px 3px rgba(0,0,0,.18); }
.pv-gemini { --pv-bg: #ffffff; --pv-ink: #1f1f1f; --pv-user: #e9eef6; --pv-comp: #f0f4f9; --pv-send: #0b57d0; --pv-br: 9px 2px 9px 9px; --pv-cr: 9px; --pv-sr: 50%; --pv-cs: none; }
.dark .pv-me { --pv-bg: #101216; --pv-ink: #eceef2; --pv-user: #262a31; --pv-comp: #181b20; --pv-send: #eceef2; --pv-cs: 0 0 0 1px #2a2f37; }
.dark .pv-claude { --pv-bg: #262624; --pv-ink: #faf9f5; --pv-user: #141413; --pv-comp: #30302e; --pv-cs: 0 0 0 1px #45443f; }
.dark .pv-chatgpt { --pv-bg: #212121; --pv-ink: #ececec; --pv-user: #303030; --pv-comp: #303030; --pv-send: #fff; --pv-cs: none; }
.dark .pv-gemini { --pv-bg: #131314; --pv-ink: #e3e3e3; --pv-user: #333537; --pv-comp: #1e1f20; --pv-send: #a8c7fa; }

/* ---------- 动效 ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
@keyframes fade { from { opacity: 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes breathe { 50% { transform: scale(.72); opacity: .55; } }
.log > .msg-user, .log > details.steps, .log > .card, .log > .note { animation: rise .32s var(--ease) both; }
.log > .msg-text { animation: fade .4s var(--ease) both; }
html.calm *, html.calm *::before, html.calm *::after { animation: none !important; transition: none !important; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* =====================================================================
   风格：Claude
   ===================================================================== */
:root[data-skin="claude"] .bar { min-height: 52px; }
:root[data-skin="claude"] .tabs { background: var(--hover); }
:root[data-skin="claude"] .tab[aria-selected="true"] { box-shadow: 0 0 0 .5px rgba(0, 0, 0, .08), 0 1px 2px rgba(0, 0, 0, .05); }
:root[data-skin="claude"] .msg-user .bubble { padding: 10px 16px; }
:root[data-skin="claude"] .msg-text h1, :root[data-skin="claude"] .msg-text h2, :root[data-skin="claude"] .msg-text h3 { font-family: var(--f-ui); }
/* 轨迹：一行灰色的无衬线小字，箭头在后面；展开是一条竖线，每步一个点挂在线上 */
:root[data-skin="claude"] details.steps > summary { font-family: var(--f-ui); font-size: 14px; color: var(--ink-3); }
:root[data-skin="claude"] details.steps > summary:hover { color: var(--ink-2); }
:root[data-skin="claude"] details.steps > summary::before { order: 3; margin-left: 4px; }
:root[data-skin="claude"] .steps-body { margin: 4px 0 8px 6px; padding-left: 18px; border-left: 1px solid var(--line); }
:root[data-skin="claude"] .steps-body > .row-fold > summary { position: relative; }
:root[data-skin="claude"] .steps-body > .row-fold > summary .dot { position: absolute; left: -22.5px; top: 50%; margin-top: -3.5px; width: 8px; height: 8px; background: var(--bg); border: 1.5px solid var(--ink-3); }
:root[data-skin="claude"] .steps-body > .row-fold > summary .dot.run { border-color: var(--accent); background: var(--accent); }
:root[data-skin="claude"] .steps-body > .row-fold > summary .dot.err { border-color: var(--red); }
:root[data-skin="claude"] .row-fold .name { color: var(--ink-2); font-weight: 500; }
:root[data-skin="claude"] .row-fold .thinking-text { font-family: var(--f-ui); color: var(--ink-3); }
/* 在回答：陶土橙的星形在转 */
:root[data-skin="claude"] .activity .dots3 i { display: none; }
:root[data-skin="claude"] .activity .dots3::before { content: ""; width: 20px; height: 20px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23d97757' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M12 2.6v5.6M12 15.8v5.6M2.6 12h5.6M15.8 12h5.6M5.4 5.4l3.9 3.9M14.7 14.7l3.9 3.9M18.6 5.4l-3.9 3.9M9.3 14.7l-3.9 3.9'/%3E%3C/svg%3E") center / contain no-repeat; animation: spin 2.4s linear infinite; }
/* 空白页：衬线大字问候，前面一颗橙色星 */
html.blank:root[data-skin="claude"] .page::before { font: 300 38px/1.2 var(--f-greet); padding-left: 50px; width: fit-content; margin-inline: auto; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23d97757' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M12 2.6v5.6M12 15.8v5.6M2.6 12h5.6M15.8 12h5.6M5.4 5.4l3.9 3.9M14.7 14.7l3.9 3.9M18.6 5.4l-3.9 3.9M9.3 14.7l-3.9 3.9'/%3E%3C/svg%3E") left center / 34px no-repeat; }
/* 输入框：白底细边，左边方圆的按钮带边，模型名是文字，发送是橙色方块 */
:root[data-skin="claude"] .composer { padding: 12px 12px 10px; }
:root[data-skin="claude"] .composer textarea { padding: 2px 6px 6px; }
:root[data-skin="claude"] .composer .row > .icon-btn:not(.mic) { width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 8px; }
:root[data-skin="claude"] .composer .row > .icon-btn:not(.mic) + .icon-btn { margin-left: 4px; }
:root[data-skin="claude"] .send svg { width: 16px; height: 16px; stroke-width: 2.2; }
:root[data-skin="claude"] .send:disabled { opacity: .45; }
/* 左栏：新对话前面一个橙色圆 */
:root[data-skin="claude"] .pc .side-new svg, html.pc[data-skin="claude"] .side-new svg { width: 22px; height: 22px; padding: 4px; border-radius: 50%; background: var(--accent); color: #fff; stroke-width: 2.4; }
html.pc[data-skin="claude"] #history { border-right-color: transparent; }

/* =====================================================================
   风格：ChatGPT
   ===================================================================== */
html.pc[data-skin="chatgpt"] .bar { position: relative; }
html.pc[data-skin="chatgpt"] .bar .tabs { position: absolute; left: 50%; transform: translateX(-50%); }
html.pc[data-skin="chatgpt"] .bar .title { margin-left: 4px; }
:root[data-skin="chatgpt"] .tabs { border-radius: 999px; padding: 3px; }
:root[data-skin="chatgpt"] .tab { border-radius: 999px; padding: 5px 16px; }
:root[data-skin="chatgpt"] .tab[aria-selected="true"] { box-shadow: 0 1px 4px rgba(0, 0, 0, .12); font-weight: 500; }
:root[data-skin="chatgpt"].dark .tab[aria-selected="true"] { background: #424242; }
:root[data-skin="chatgpt"] .msg-user { margin: 30px 0 18px; }
:root[data-skin="chatgpt"] .msg-text { margin: 12px 0; }
:root[data-skin="chatgpt"] .msg-text h1, :root[data-skin="chatgpt"] .msg-text h2, :root[data-skin="chatgpt"] .msg-text h3 { font-weight: 600; }
/* 正在输出：文字后面一个呼吸的黑点 */
:root[data-skin="chatgpt"] .msg-text.streaming > :last-child::after, :root[data-skin="chatgpt"] .msg-text.streaming > :is(ul, ol):last-child > li:last-child::after { width: .6em; height: .6em; border-radius: 50%; background: var(--ink); vertical-align: -1px; margin-left: 5px; animation: pulse-size 1.25s ease-in-out infinite; }
@keyframes pulse-size { 50% { transform: scale(1.25); } }
:root[data-skin="chatgpt"] .activity .dots3 i { display: none; }
:root[data-skin="chatgpt"] .activity .dots3::before { content: ""; width: 12px; height: 12px; border-radius: 50%; background: var(--ink); animation: pulse-size 1.25s ease-in-out infinite; }
/* 轨迹：灰字"做了 N 步"，箭头在后面；展开是左边一根线 */
:root[data-skin="chatgpt"] details.steps > summary { font-size: 14px; }
:root[data-skin="chatgpt"] details.steps > summary::before { order: 3; margin-left: 2px; }
:root[data-skin="chatgpt"] .steps-body { border-left: 2px solid var(--line); margin: 6px 0 10px 2px; padding-left: 16px; }
:root[data-skin="chatgpt"] .row-fold .name { color: var(--ink-2); }
:root[data-skin="chatgpt"] .row-fold .dot { display: none; }
/* 每一轮的操作常显 */
:root[data-skin="chatgpt"] .log > .turn-end { opacity: 1; }
/* 输入框：没有边、一圈很淡的阴影，大圆角；空的时候发送键藏起来，麦克风变成黑色圆钮 */
:root[data-skin="chatgpt"] .composer { padding: 10px 10px 10px; }
:root[data-skin="chatgpt"] .composer textarea { padding: 4px 12px 6px; }
:root[data-skin="chatgpt"] .composer .icon-btn { width: 36px; height: 36px; border-radius: 50%; }
:root[data-skin="chatgpt"] .send svg { stroke-width: 2.4; }
:root[data-skin="chatgpt"] .composer:has(.send:disabled) .send { display: none; }
:root[data-skin="chatgpt"] .composer:has(.send:disabled) .mic { width: 36px; height: 36px; border-radius: 50%; background: var(--send-bg); color: var(--send-fg); }
html.blank:root[data-skin="chatgpt"] .page::before { font-weight: 400; font-size: 28px; }
/* 左栏 */
html.pc[data-skin="chatgpt"] #history { border-right-color: transparent; }
:root[data-skin="chatgpt"] .sessions li { padding-block: 8px; }

/* =====================================================================
   风格：Gemini
   ===================================================================== */
:root[data-skin="gemini"] .tabs { border-radius: 999px; }
:root[data-skin="gemini"] .tab { border-radius: 999px; padding: 5px 14px; }
:root[data-skin="gemini"] .tab[aria-selected="true"] { background: var(--side-active); color: var(--ink); box-shadow: none; }
/* 回答前面一颗渐变的四角星：宽屏放在左边空白里，手机放在回答上面 */
:root[data-skin="gemini"] .msg-user::after { content: ""; align-self: flex-start; width: 24px; height: 24px; margin: 22px 0 -10px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0' y1='0' x2='1' y2='1'%3E%3Cstop offset='0' stop-color='%234285f4'/%3E%3Cstop offset='.55' stop-color='%239b72cb'/%3E%3Cstop offset='1' stop-color='%23d96570'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath fill='url(%23g)' d='M12 1.5C12.7 7.3 16.7 11.3 22.5 12 16.7 12.7 12.7 16.7 12 22.5 11.3 16.7 7.3 12.7 1.5 12 7.3 11.3 11.3 7.3 12 1.5Z'/%3E%3C/svg%3E") center / contain no-repeat; }
:root[data-skin="gemini"] .log:has(> #activity:not([hidden])) > .msg-user:not(:has(~ .msg-user))::after { animation: spin 2s var(--ease) infinite; }
@media (min-width: 900px) { :root[data-skin="gemini"] .msg-user::after { position: absolute; left: -46px; top: calc(100% + 16px); margin: 0; } }
:root[data-skin="gemini"] .activity .dots3 { display: none; }
:root[data-skin="gemini"] .activity .txt:empty::before { content: "正在思考"; }
/* 轨迹："显示思路"的胶囊按钮 */
:root[data-skin="gemini"] details.steps > summary { display: inline-flex; width: auto; max-width: 100%; padding: 7px 14px; border-radius: 999px; background: var(--panel); color: var(--ink); font-size: 14px; }
:root[data-skin="gemini"] details.steps > summary:hover { background: var(--hover); }
:root[data-skin="gemini"] details.steps > summary::before { order: 3; margin: -3px 0 0 6px; }
:root[data-skin="gemini"] details.steps[open] > summary::before { margin-top: 3px; }
:root[data-skin="gemini"] .steps-body { border-left: 0; margin: 10px 0 6px; padding: 10px 16px; background: var(--panel); border-radius: 16px; }
:root[data-skin="gemini"] .row-fold .dot { background: var(--accent); }
/* 空白页：渐变的大字问候，靠左 */
html.blank:root[data-skin="gemini"] .page::before { font-size: 40px; font-weight: 500; letter-spacing: -.02em; text-align: left; width: calc(100% - 20px); max-width: 740px; margin-inline: auto; padding-left: 4px;
  background: var(--grad); background-size: 400% 100%; background-position: 0 0; -webkit-background-clip: text; background-clip: text; color: transparent; animation: gem-in 1.4s var(--ease) both; }
@keyframes gem-in { from { background-position: 100% 0; opacity: .2; } }
/* 输入框：浅蓝灰底，没有边和阴影，大圆角；空的时候没有发送键 */
:root[data-skin="gemini"] .composer { padding: 12px 12px 10px 14px; }
:root[data-skin="gemini"] .composer:focus-within { background: color-mix(in srgb, var(--composer-bg) 70%, var(--line)); }
:root[data-skin="gemini"] .composer textarea { font-size: 16.5px; padding: 4px 8px 8px; }
:root[data-skin="gemini"] .composer .icon-btn { width: 40px; height: 40px; border-radius: 50%; }
:root[data-skin="gemini"] .composer:has(.send:disabled) .send { display: none; }
:root[data-skin="gemini"] .pick { border-radius: 999px; padding: 6px 12px; }
/* 左栏：胶囊形的行，选中的是浅蓝 */
:root[data-skin="gemini"] .sessions li { border-radius: 999px; padding: 8px 16px; }
:root[data-skin="gemini"] .pc .side-new, html.pc[data-skin="gemini"] .side-new { background: var(--line); border-radius: 999px; width: fit-content; padding: 9px 18px 9px 14px; margin: 8px 12px 6px; color: var(--ink-2); }
html.pc[data-skin="gemini"] #history { border-right-color: transparent; }
:root[data-skin="gemini"] .search input { border-radius: 999px; padding-inline: 16px; }
:root[data-skin="gemini"] .card, :root[data-skin="gemini"] .msg-text pre { border-radius: 16px; }

/* 手机上 Gemini 的圆钮小一点，给模型名留位置 */
@media (max-width: 520px) {
  :root[data-skin="gemini"] .composer .icon-btn { width: 36px; height: 36px; }
  :root[data-skin="gemini"] { --send-size: 38px; }
  :root[data-skin="gemini"] .pick { padding: 5px 8px; }
}
.pick { flex-shrink: 1; min-width: 44px; }
:root[data-skin="gemini"] .sessions li:hover { background: var(--side-hover, var(--hover)); }
/* 手机上：开着的对话里 agent 锁死了，选框只是展示，省下位置给模型名 */
@media (max-width: 520px) { #agent-pick.locked { display: none !important; } }
/* pc.css 里 #sessions li.current 用的是 id，这里同样用 id 才盖得住：选中行用风格自己的颜色（Gemini 是浅蓝） */
#sessions li.current { background: var(--side-active); }
.dark .to-bottom { border-color: color-mix(in srgb, var(--ink) 24%, transparent); }

/* =====================================================================
   第六版（2026-10-31 夜）：居中、去掉渐隐、"+"菜单和模型菜单
   ===================================================================== */
/* 对话一列居中：不靠子元素的 margin（.msg-text 等自己的 margin 会把它盖掉，以前在手机版网页上就靠左了），
   统一用 .log 左右的 padding 把内容挤到中间，宽 768px，和输入框对齐 */
.log { padding-inline: max(16px, calc((100% - 768px) / 2)); container: log / inline-size; }
.log > * { max-width: none; margin-inline: 0; }
.composer { max-width: 768px; }
html.blank .composer { width: calc(100% - 32px); }
/* 输入框下面那行小字：不加渐隐，只给字本身垫一小块底色，免得和滚到后面的正文叠在一起 */
.page::after { width: fit-content; margin-inline: auto; padding: 0 10px; border-radius: 6px; background: var(--bg); }
/* Gemini 的星：只在对话列左边留得出位置时才放到左边空白里 */
@media (min-width: 900px) { :root[data-skin="gemini"] .msg-user::after { position: static; margin: 22px 0 -10px; } }
@container log (min-width: 880px) { :root[data-skin="gemini"] .msg-user::after { position: absolute; left: -46px; top: calc(100% + 16px); margin: 0; } }

/* 原来的两个图标、三个下拉框、用量条：藏起来（app.js 还在用它们），换成"+"和模型按钮 */
.composer .row > label.icon-btn, #agent-pick, #model-pick, #effort-pick, #usage { display: none !important; }
.composer .row > .plus-btn { order: 0; }
.composer .row > .model-btn { order: 2; }
.plus-btn svg { width: 20px; height: 20px; stroke-width: 1.9; transition: transform .2s var(--ease); }
.plus-btn.active svg { transform: rotate(45deg); }
.plus-btn.active, .model-btn.active { background: var(--hover); color: var(--ink); }
.model-btn { display: inline-flex; align-items: center; gap: 5px; height: 32px; padding: 0 8px 0 10px; border: 0; border-radius: var(--btn-radius); background: none; color: var(--ink); font-size: 14px; cursor: pointer; min-width: 0; flex: 0 1 auto; transition: background-color .15s; }
.model-btn:hover { background: var(--hover); }
.model-btn > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.model-btn .mb-a { color: var(--ink-2); flex: none; }
.model-btn .mb-a:not(:empty)::after { content: "·"; margin-left: 5px; color: var(--ink-3); }
.model-btn .mb-m { min-width: 0; }
.model-btn .mb-e { color: var(--ink-3); flex: none; }
.model-btn .mb-e:empty, .model-btn .mb-a:empty { display: none; }
.model-btn .mb-chev svg { width: 15px; height: 15px; color: var(--ink-3); flex: none; display: block; }

/* 弹出菜单 */
.pop-menu { position: absolute; bottom: calc(100% + 8px); z-index: 5; min-width: 230px; max-width: min(340px, calc(100vw - 32px)); max-height: min(60vh, 480px); overflow-y: auto;
  padding: 6px; border-radius: calc(var(--radius) + 4px); background: var(--menu-bg, var(--panel)); border: 1px solid var(--line);
  box-shadow: 0 12px 32px rgba(0, 0, 0, .12), 0 2px 6px rgba(0, 0, 0, .06);
  opacity: 0; transform: translateY(6px) scale(.98); transform-origin: bottom left; transition: opacity .16s var(--ease), transform .18s var(--ease); }
.pop-menu.right { transform-origin: bottom right; }
.pop-menu.show { opacity: 1; transform: none; }
.dark .pop-menu { box-shadow: 0 12px 32px rgba(0, 0, 0, .45); }
.pm-h { padding: 8px 10px 4px; font-size: 12px; color: var(--ink-3); }
.pm-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: calc(var(--radius) - 2px); background: none; color: var(--ink); text-align: left; cursor: pointer; font-size: 14px; }
.pm-item:hover, .pm-item:focus-visible { background: var(--hover); outline: 0; }
.pm-item:disabled { opacity: .4; cursor: default; }
.pm-ic svg { width: 18px; height: 18px; color: var(--ink-2); display: block; }
.pm-t { flex: 1; min-width: 0; display: grid; gap: 1px; }
.pm-d { font-size: 12px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pm-check { width: 18px; flex: none; }
.pm-check svg { width: 18px; height: 18px; color: var(--accent); stroke-width: 2.2; display: none; }
.pm-item.on .pm-check svg { display: block; }
.pm-seg { display: flex; gap: 2px; margin: 2px 6px 6px; padding: 3px; border-radius: 10px; background: var(--hover); }
.pm-seg button { flex: 1; border: 0; background: none; padding: 5px 0; border-radius: 8px; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.pm-seg button.on { background: var(--panel); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .1); font-weight: 500; }
.dark .pm-seg button.on { background: color-mix(in srgb, var(--ink) 14%, var(--menu-bg, var(--panel))); }
.pm-foot { margin: 6px 4px 2px; padding: 8px 6px 2px; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--ink-3); display: grid; gap: 2px; font-variant-numeric: tabular-nums; }

/* 每个风格的"+"和模型按钮 */
:root[data-skin="claude"] .model-btn { font-size: 14px; }
:root[data-skin="claude"] .model-btn .mb-m { color: var(--ink); }
:root[data-skin="chatgpt"] .model-btn { border-radius: 999px; padding: 0 10px 0 12px; height: 36px; }
:root[data-skin="chatgpt"] .pop-menu { border-radius: 16px; }
:root[data-skin="gemini"] .model-btn { border-radius: 999px; height: 36px; padding: 0 10px 0 14px; }
:root[data-skin="gemini"] .pop-menu { border-radius: 16px; border: 0; }
:root[data-skin="gemini"] .pm-item { border-radius: 999px; }

/* 手机上的菜单：底部面板 */
.pm-veil { position: fixed; inset: 0; z-index: 30; background: rgba(0, 0, 0, .28); opacity: 0; transition: opacity .2s; }
.pm-veil.show { opacity: 1; }
.pop-menu.as-sheet { position: fixed; z-index: 31; left: 8px; right: 8px; bottom: calc(env(safe-area-inset-bottom) + 8px); top: auto; max-width: none; min-width: 0; max-height: 72vh;
  border-radius: 22px; padding: 4px 8px 10px; transform: translateY(24px); transform-origin: bottom center; }
.pop-menu.as-sheet.show { transform: none; }
.pm-grip { width: 36px; height: 4px; border-radius: 2px; background: var(--line); margin: 6px auto 4px; }
.pop-menu.as-sheet .pm-item { padding: 11px 12px; font-size: 15px; }
/* 等你确认的那组：标题用强调色 */
details.steps.asking > summary { color: var(--accent); font-weight: 500; }
/* 卡片里的按钮、提醒托盘的按钮：圆角跟风格（ChatGPT、Gemini 是胶囊，Claude 是小圆角） */
.card .btn, .w-btn { border-radius: var(--btn-radius); }
.w-btn { border: 0; background: var(--panel); box-shadow: 0 0 0 1px var(--line); transition: background-color .15s; }
.w-btn:hover { background: var(--hover); }
.opt { border-radius: calc(var(--radius) - 2px); transition: border-color .15s, background-color .15s; }
.opt:hover:not(:disabled) { border-color: var(--ink-3); }
.chip { border-radius: calc(var(--radius) - 2px); }

/* =====================================================================
   第七版（2026-11-01）：/ 菜单和高亮、分出（fork）、顺便问、提示
   ===================================================================== */
/* 输入框里命令的高亮：输入框后面垫一层同样排版的字（透明），命令那几个字画底色 */
.composer textarea { position: relative; z-index: 1; background: transparent; }
.hl-back { position: absolute; z-index: 0; margin: 0; box-sizing: border-box; border: 0 solid transparent; color: transparent; white-space: pre-wrap; overflow-wrap: break-word; word-break: break-word; overflow: hidden; pointer-events: none; }
.hl-back mark { color: transparent; background: color-mix(in srgb, var(--cmd, var(--accent)) 16%, transparent); border-radius: 5px; box-shadow: 0 0 0 2px color-mix(in srgb, var(--cmd, var(--accent)) 16%, transparent); }
.hl-back mark.me { background: color-mix(in srgb, #8b5cf6 18%, transparent); box-shadow: 0 0 0 2px color-mix(in srgb, #8b5cf6 18%, transparent); }
/* 认出来的命令：输入框上面一行，写它是干什么的 */
.cmd-hint { display: flex; gap: 8px; align-items: baseline; padding: 0 6px 6px; font-size: 12.5px; color: var(--ink-3); min-width: 0; animation: fade .2s var(--ease); }
.cmd-hint b { color: var(--cmd, var(--accent)); font: 500 12.5px var(--f-mono); flex: none; }
.cmd-hint span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
/* / 菜单 */
.cmds { padding: 6px; background: var(--menu-bg, var(--panel)); box-shadow: 0 12px 32px rgba(0, 0, 0, .12); animation: rise .16s var(--ease); }
.cmd { border-radius: calc(var(--radius) - 4px); padding: 7px 10px; }
.cmd:hover, .cmd.sel { background: var(--hover); }
.cmd .n { font-weight: 500; }
.cmd.me .n { color: #7c3aed; }
.dark .cmd.me .n { color: #b79cff; }
/* 每轮下面：复制、分出 */
.turn-end { display: flex; align-items: center; }
.fork-turn { width: 32px; height: 32px; border-radius: 8px; color: var(--ink-3); }
.fork-turn svg { width: 17px; height: 17px; }
.fork-turn:hover { color: var(--ink); }
/* 提示条 */
.toast { position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 110px); z-index: 50; transform: translate(-50%, 8px); opacity: 0; padding: 8px 14px; border-radius: 10px; background: var(--ink); color: var(--bg); font-size: 13.5px; box-shadow: 0 6px 20px rgba(0, 0, 0, .2); transition: opacity .2s, transform .25s var(--ease); pointer-events: none; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
/* 顺便问的小窗：电脑在右边，手机从下面上来 */
.side-panel { position: fixed; z-index: 40; display: flex; flex-direction: column; background: var(--bg); box-shadow: -12px 0 40px rgba(0, 0, 0, .14); transition: transform .3s var(--ease), opacity .25s; }
.pc .side-panel { top: 0; right: 0; bottom: 0; width: min(460px, 42vw); border-left: 1px solid var(--line); transform: translateX(24px); opacity: 0; }
html:not(.pc) .side-panel { left: 0; right: 0; bottom: 0; top: calc(env(safe-area-inset-top) + 36px); border-radius: 20px 20px 0 0; transform: translateY(40px); opacity: 0; box-shadow: 0 -12px 40px rgba(0, 0, 0, .18); }
.side-panel.show { transform: none; opacity: 1; }
.side-head { display: flex; align-items: center; gap: 10px; padding: 12px 10px 8px 18px; flex: none; }
.side-t { font-weight: 600; font-size: 15px; }
.side-s { font-size: 12.5px; color: var(--ink-3); flex: 1; }
.side-acts { display: flex; gap: 2px; }
.side-frame { flex: 1; width: 100%; border: 0; background: var(--bg); }
/* 小窗里面的页面（?side=1）：只要对话和输入框 */
html.side .bar, html.side #history, html.side #agents-sheet, html.side #btn-side, html.side .page::after { display: none !important; }
html.side body { display: flex !important; flex-direction: column; }
html.side main { flex: 1; min-height: 0; }
html.side .log { padding-inline: 16px; padding-top: 4px; }
html.side .composer { left: 10px; right: 10px; bottom: 10px; }
