: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: manipulation; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.55 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;
  border-bottom: 1px solid var(--line); background: var(--panel); flex: none;
}
.tabs { display: flex; background: var(--soft); border-radius: 9px; padding: 2px; flex: none; }
.tab { border: 0; background: none; padding: 5px 11px; border-radius: 7px; color: var(--ink-2); font-size: 14px; cursor: pointer; }
.tab[aria-selected="true"] { background: var(--panel); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); 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, #tasks { flex: 1; width: 100%; border: 0; background: var(--bg); }

/* 对话 */
.log { flex: 1; overflow-y: auto; padding: 12px 14px 20px; overscroll-behavior: contain; }
.log > * { max-width: 760px; margin-inline: auto; }
.msg-user { display: flex; flex-direction: column; align-items: flex-end; margin: 14px 0 10px; }
.msg-user .bubble { background: var(--user); border-radius: 14px 14px 4px 14px; padding: 8px 12px; max-width: 88%; white-space: pre-wrap; word-break: break-word; }
.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: 6px 0; word-break: break-word; }
.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: .55em 0; }
.msg-text ul, .msg-text ol { padding-left: 1.4em; }
.msg-text h1, .msg-text h2, .msg-text h3, .msg-text h4 { font-size: 1em; margin: .9em 0 .4em; }
.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(--soft); padding: 10px 12px; border-radius: 8px; 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; } }

details.row-fold { margin: 2px 0; }
details.row-fold > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 7px;
  padding: 4px 0; color: var(--ink-2); font-size: 13.5px; 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: 13px; margin: 6px 0; display: flex; align-items: center; gap: 6px; }
.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); }

/* 输入框 */
.composer {
  position: relative; flex: none; margin: 0 10px calc(env(safe-area-inset-bottom) + 10px);
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 8px 8px 6px;
  width: calc(100% - 20px); max-width: 760px; align-self: center;
}
.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: 16px;
}
.composer .row { display: flex; align-items: center; gap: 3px; margin-top: 4px; }
.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; }
.composer .mode.on { background: var(--accent); color: #fff; }
.pick { position: relative; display: flex; align-items: center; gap: 3px; background: var(--soft); border-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: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--ink); color: 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; }

/* 一周用量：上红（用量）下绿（这周过了多少），紧贴 */
.usage { border: 0; background: none; padding: 8px 3px; cursor: pointer; display: flex; flex-direction: column; gap: 0; width: 42px; flex: none; }
.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); }
.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: nowrap;
}

/* 历史 */
.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: 11px 16px; border-bottom: 1px solid var(--line); 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: 8px 12px; border-bottom: 1px solid var(--line); flex: none; }
.search input { width: 100%; border: 0; background: var(--soft); border-radius: 9px; 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; }
.more { margin: 10px auto calc(env(safe-area-inset-bottom) + 14px); border: 1px solid var(--line); background: var(--panel); border-radius: 9px; padding: 6px 18px; color: var(--ink-2); }

/* 登录 */
.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: 10px 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; 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: 9px; 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; }

/* 安装与设备设置 */
#settings { z-index: 12; }
.settings-body { overflow: auto; flex: 1; padding: 18px max(16px, env(safe-area-inset-right)) calc(28px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }
.settings-card { max-width: 680px; margin: 0 auto 14px; padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); }
.settings-card h2 { margin: 0 0 8px; font-size: 17px; font-weight: 650; }
.settings-card p { margin: 8px 0; color: var(--ink-2); font-size: 14px; line-height: 1.7; }
.settings-card a { color: var(--accent); }
.settings-card .small { font-size: 12.5px; color: var(--ink-3); }
.settings-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 12px 0 0; }
.settings-actions .btn, .settings-card > .btn { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.settings-status { color: var(--ink-2); overflow-wrap: anywhere; }
.settings-status.error { color: var(--red); }
.settings-status.ok { color: var(--green); }
.settings-label { display: block; font-size: 13px; margin: 10px 0 5px; color: var(--ink-2); }
.settings-input { width: 100%; min-width: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--bg); font-size: 14px; }
.setup-steps { margin: 14px 0; padding-left: 22px; font-size: 14px; color: var(--ink-2); }
.setup-steps li { margin: 6px 0; }
.settings-details { display: grid; grid-template-columns: 68px minmax(0, 1fr); gap: 8px 12px; font-size: 14px; margin: 12px 0; }
.settings-details dt { color: var(--ink-3); }
.settings-details dd { margin: 0; overflow-wrap: anywhere; }
button:focus-visible, a:focus-visible, select:focus-visible, textarea:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
button:disabled { cursor: default; }
.login-heading { margin: 0; font-size: 30px; letter-spacing: -.04em; font-weight: 650; }
.login-sub { font-size: 14px; color: var(--ink-2); margin: 0 0 14px; }
.login .msg { min-height: 1.5em; }
.voice-notice { color: var(--ink-2); font-size: 12px; padding: 0 5px 6px; }
@media (max-width: 600px) {
  body > .bar { flex-wrap: wrap; gap: 4px; padding-inline: max(8px, env(safe-area-inset-left)); }
  body > .bar .tabs { flex: 1; }
  body > .bar .tab { flex: 1; min-height: 38px; padding-inline: 7px; }
  body > .bar #title { order: 4; flex-basis: 100%; min-height: 20px; font-size: 12px; padding-inline: 5px; }
  body > .bar #title:empty { display: none; }
  body > .bar .icon-btn { width: 32px; height: 38px; }
  .composer .row { flex-wrap: wrap; row-gap: 5px; }
  .composer .pick { max-width: 100px; min-height: 34px; }
  .composer .pick#effort-pick { max-width: 74px; }
  .settings-card { padding: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; scroll-behavior: auto !important; transition: none !important; }
}
