* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; color: #222; background: #fff; }
button, select, input, textarea { font: inherit; color: inherit; }
button { padding: 6px 12px; border: 1px solid #ccc; border-radius: 4px; background: #f7f7f7; cursor: pointer; }
button:hover { background: #eee; }
button:disabled { opacity: .5; cursor: default; }
button.ghost { border-color: transparent; background: transparent; color: #666; }
select { padding: 5px 8px; border: 1px solid #ccc; border-radius: 4px; background: #fff; }
input[type="time"] { padding: 5px 8px; border: 1px solid #ccc; border-radius: 4px; background: #fff; }
.task-create input, .task-create textarea, .task-card input, .task-card textarea { border: 1px solid #ccc; border-radius: 4px; padding: 6px 8px; background: #fff; }
.muted { color: #888; font-size: 12px; }
.sp { flex: 1; }
.inline-control { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }

/* 登录页 */
body.login { display: flex; align-items: center; justify-content: center; }
body.login .card { width: 300px; display: flex; flex-direction: column; gap: 10px; } /* 只给登录框：控制台的卡片也叫 .card，之前被连带压成 300px 宽 */
.card h1 { font-size: 18px; font-weight: 500; margin: 0 0 6px; }
.card input { padding: 8px 10px; border: 1px solid #ccc; border-radius: 4px; }

/* 工作台 */
header { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid #e5e5e5; }
/* 顶栏放不下时：按钮/下拉不许被挤成两行（「新\n建」），只让说明文字缩成省略号（鼠标移上去看全文） */
header > button, header > a.btn, header > select, header > input, header > label, header > .brand { flex-shrink: 0; white-space: nowrap; }
header { overflow-x: auto; scrollbar-width: thin; } /* 窗口太窄（< ~1200px）时顶栏能横着滑，最右边的「退出」不会够不着 */
#daily-status { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#quota { flex: 0 1 auto; min-width: 0; font-size: 11px; line-height: 1.3; }
#quota > div { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand { font-weight: 500; }
main { display: flex; height: calc(100% - 45px); }
aside { width: 220px; border-right: 1px solid #e5e5e5; overflow-y: auto; }
button.icon { padding: 4px 8px; font-size: 15px; line-height: 1; }
aside ul { list-style: none; margin: 0; padding: 6px 0; }
aside li { padding: 8px 14px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
aside li:hover { background: #f5f5f5; }
aside li.active { background: #eaeaea; }
#busy:not(:empty) + #note:not(:empty)::before { content: ' · '; }
section { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.msg { max-width: 820px; white-space: pre-wrap; word-break: break-word; }
.msg.u { align-self: flex-end; background: #f0f0f0; padding: 8px 12px; border-radius: 8px; }
.msg.a { align-self: flex-start; padding: 2px 0; }
.msg.a.live::after { content: "▍"; color: #aaa; }
.msg.t { color: #999; font-size: 12px; }
.msg.t.drift { color: #7a5a00; font-size: 13px; background: #fff6dc; border-left: 3px solid #fab219; border-radius: 4px; padding: 6px 10px; } /* 防跑偏报警：主线几轮没动，她不懂技术也要一眼看见 */
.msg.e { color: #b00020; }
.msg.f a { display: block; }
.files { width: 280px; border-left: 1px solid #e5e5e5; overflow-y: auto; padding: 10px; font-size: 13px; }
.files ul { list-style: none; margin: 8px 0; padding: 0; }
.files li { display: flex; gap: 6px; align-items: center; padding: 4px 0; }
.files li a { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#status { padding: 0 16px 4px; min-height: 18px; }
.row { display: flex; gap: 8px; align-items: center; }

/* 控制台 */
a.btn { display: inline-block; padding: 6px 12px; border: 1px solid transparent; border-radius: 4px; color: #666; text-decoration: none; }
a.btn:hover { background: #eee; }
.console-main { display: block; height: auto; padding: 16px; max-width: 900px; margin: 0 auto; overflow-y: auto; }
.card { border: 1px solid #e5e5e5; border-radius: 6px; padding: 12px 16px; margin-bottom: 14px; }
.card h2 { font-size: 15px; font-weight: 500; margin: 0 0 10px; }
.q { display: flex; align-items: center; gap: 10px; margin: 6px 0; }
.q b { width: 90px; font-weight: 500; }
.bar { display: inline-block; width: 220px; height: 8px; background: #eee; border-radius: 4px; overflow: hidden; }
.bar .fill { display: block; height: 100%; background: #6b8; width: 0; }
.bar .fill.hot { background: #d66; }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th, td { text-align: left; padding: 6px 8px; border-bottom: 1px solid #eee; }
th { color: #888; font-weight: 500; }
ul.plain { padding-left: 18px; }
#codex-reset { margin-top: 10px; padding-top: 8px; border-top: 1px dashed #eee; }
#codex-reset ul.plain { margin: 4px 0 8px; }
#reset-msg { margin-top: 6px; }
#trash td.acts { white-space: nowrap; text-align: right; }
#trash td.acts button { padding: 2px 8px; font-size: 12px; }
#trash-msg { margin-top: 6px; }
code { background: #f4f4f4; padding: 1px 4px; border-radius: 3px; }

/* 记忆页 */
aside.tree { width: 320px; border-right: 1px solid #e5e5e5; overflow-y: auto; padding: 8px 6px; font-size: 13px; }
aside.tree ul { list-style: none; margin: 0; padding: 0 0 0 14px; }
aside.tree details > summary { cursor: pointer; padding: 5px 6px; border-radius: 4px; list-style: none; color: #333; user-select: none; }
aside.tree details > summary::-webkit-details-marker { display: none; }
aside.tree details > summary::before { content: '▸'; display: inline-block; width: 14px; color: #999; }
aside.tree details[open] > summary::before { content: '▾'; }
aside.tree details > summary:hover { background: #f5f5f5; }
aside.tree > details > summary { font-weight: 500; }
aside.tree details details > summary { color: #777; font-size: 12px; }
aside.tree li.item { padding: 4px 6px 4px 20px; cursor: pointer; border-radius: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
aside.tree li.item:hover { background: #f5f5f5; }
aside.tree li.item.active { background: #e8eef8; }
aside.tree li.item.muted { cursor: default; }
aside.tree li.item.muted:hover { background: none; }
section.editor { flex: 1; display: flex; flex-direction: column; padding: 12px 16px; min-width: 0; }
section.editor textarea { flex: 1; width: 100%; margin-top: 10px; padding: 10px; border: 1px solid #ccc; border-radius: 4px; font: 13px/1.5 ui-monospace, Menlo, monospace; resize: none; }

/* 任务板 */
.tasks-main { display: flex; flex-direction: column; height: calc(100% - 45px); overflow: hidden; }
.task-create { flex: none; padding: 12px 16px; border-bottom: 1px solid #e5e5e5; gap: 8px; }
.task-create textarea { width: 100%; margin-top: 8px; resize: vertical; }
.task-row input:first-child { flex: 1; min-width: 220px; }
.task-board { flex: 1; display: grid; grid-template-columns: repeat(4, minmax(240px, 1fr)); gap: 12px; padding: 12px; overflow: auto; }
.task-column { min-width: 240px; border: 1px solid #e5e5e5; border-radius: 6px; background: #fafafa; padding: 8px; }
.task-column-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 4px 8px; }
.task-card { display: flex; flex-direction: column; gap: 8px; border: 1px solid #ddd; border-radius: 6px; background: #fff; padding: 8px; margin-bottom: 8px; }
.task-card input, .task-card select, .task-card textarea { width: 100%; font-size: 13px; }
.task-meta { align-items: stretch; }
.task-meta select { min-width: 0; flex: 1; }
.task-meta input { width: 128px; }
@media (max-width: 900px) {
  .task-row { flex-wrap: wrap; }
  .task-board { grid-template-columns: repeat(4, 260px); }
}

/* markdown（聊天里 AI 的回答、记忆页预览；md.js 画出来的） */
.msg.md { white-space: normal; }
.msg.a.md.live::after { content: none; }
.msg.a.md.live > :last-child::after { content: "▍"; color: #aaa; }
.md > :first-child { margin-top: 0; }
.md > :last-child { margin-bottom: 0; }
.md p { margin: 0 0 8px; }
.md h1, .md h2, .md h3, .md h4, .md h5, .md h6 { margin: 14px 0 6px; line-height: 1.35; font-weight: 600; }
.md h1 { font-size: 1.35em; }
.md h2 { font-size: 1.2em; }
.md h3 { font-size: 1.08em; }
.md h4, .md h5, .md h6 { font-size: 1em; }
.md ul, .md ol { margin: 0 0 8px; padding-left: 22px; }
.md li { margin: 2px 0; }
.md li > ul, .md li > ol { margin: 2px 0 0; }
.md li > p { margin: 0 0 4px; }
.md li.task { list-style: none; margin-left: -18px; }
.md blockquote { margin: 0 0 8px; padding: 2px 12px; border-left: 3px solid #ddd; color: #555; }
.md hr { border: 0; border-top: 1px solid #e5e5e5; margin: 12px 0; }
.md code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .92em; }
.md pre { margin: 0 0 8px; padding: 10px 12px; background: #f6f8fa; border-radius: 6px; overflow-x: auto; white-space: pre; font: 13px/1.45 ui-monospace, Menlo, Consolas, monospace; }
.md pre code { background: none; padding: 0; border-radius: 0; font: inherit; }
.md .md-codebox { margin: 0 0 8px; border-radius: 6px; overflow: hidden; background: #f6f8fa; }
.md .md-codebox > pre { margin: 0; border-radius: 0; }
.md .md-codebar { display: flex; align-items: center; justify-content: space-between; padding: 2px 4px 2px 12px; background: #eaeef2; color: #777; font-size: 12px; }
.md .md-copy { padding: 1px 8px; font-size: 12px; border: 1px solid transparent; background: transparent; color: #555; }
.md .md-copy:hover { background: #fff; border-color: #ddd; }
.md .md-copy.done { color: #2a7a3b; }
.md-copy-buf { position: fixed; left: -9999px; top: 0; opacity: 0; }
.md .md-table { overflow-x: auto; margin: 0 0 8px; }
.md table { width: auto; border-collapse: collapse; font-size: 13px; }
.md th, .md td { border: 1px solid #ddd; padding: 5px 10px; text-align: left; vertical-align: top; }
.md th { background: #f6f8fa; color: #222; font-weight: 600; }
.md tbody tr:nth-child(even) td { background: #fbfbfb; }
.md th.al-c, .md td.al-c { text-align: center; }
.md th.al-r, .md td.al-r { text-align: right; }
.md a { color: #0b62c4; }
.md .md-fm { color: #888; background: #fafafa; font-size: 12px; }
.md-preview { flex: 1; overflow-y: auto; margin-top: 10px; padding: 12px 16px; border: 1px solid #eee; border-radius: 4px; }

/* ---- 任务进度（首页、窗口顶上那条、任务板共用，taskview.js 画的） ----
   颜色只做两件事：蓝色一格一步（做完的深、正在做的浅、没到的是最浅的底槽）；黄 / 红 = 该看看 / 要处理。
   颜色旁边一定有字（「③ 分诊 · 3/5」「4 个工作日没动」），不靠颜色猜；色值取自 dataviz 参考色板（蓝 450/250/100，status warning/critical） */
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex: none; margin-right: 6px; vertical-align: middle; }
.dot.lv-warn { background: #fab219; }
.dot.lv-late { background: #d03b3b; }
.stepper { display: inline-flex; gap: 2px; height: 6px; flex: 0 1 150px; min-width: 48px; vertical-align: middle; } /* 窄的地方（任务板一栏）可以缩 */
.stepper .seg { flex: 1; min-width: 6px; border-radius: 3px; background: #cde2fb; } /* 没到的这几步 = 底槽 */
.stepper .seg.cur { background: #86b6ef; }
.stepper .seg.done { background: #2a78d6; }
.stage-list { display: flex; flex-wrap: wrap; list-style: none; margin: 0; padding: 0; font-size: 12px; color: #888; line-height: 1.6; }
.stage-list li + li::before { content: '→'; margin: 0 6px; color: #bbb; font-weight: 400; }
.stage-list li.done { color: #555; }
.stage-list li.cur { color: #222; font-weight: 600; }
.stage-list .when { margin-left: 4px; color: #999; font-weight: 400; font-size: 11px; }
.tv-prog { display: flex; align-items: center; gap: 10px; min-width: 0; }
.tv-stage { font-size: 13px; color: #222; min-width: 0; overflow-wrap: anywhere; }
.tv-line { display: flex; gap: 8px; font-size: 13px; min-width: 0; }
.tv-line b { flex: none; min-width: 3em; font-weight: 500; color: #888; }
.tv-line span { min-width: 0; overflow-wrap: anywhere; }
.tv-line.muted span { color: #888; }
.tv-empty { color: #999; font-size: 13px; padding: 6px 2px; }
.tv-go { padding: 3px 10px; font-size: 12px; }
.tv-go.small { padding: 0 8px; line-height: 22px; }
.tv-link { color: #0b62c4; text-decoration: none; font-size: 12px; }
.tv-link:hover { text-decoration: underline; }

/* 首页 */
body.home main.home-main { display: block; height: calc(100% - 45px); overflow-y: auto; padding: 14px 20px 40px; }
.home-main > * { max-width: 1180px; margin-left: auto; margin-right: auto; }
.home-main section { display: block; flex: none; min-width: 0; } /* 聊天页的 section 是 flex 列，这里不要 */
a.btn.primary { background: #2a78d6; border-color: #2a78d6; color: #fff; flex-shrink: 0; white-space: nowrap; }
a.btn.primary:hover { background: #256abf; }
.home-main .kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; } /* 要压过上面的 .home-main section（#kpis 也是 section） */
.kpi { border: 1px solid #e5e5e5; border-radius: 6px; padding: 10px 14px; background: #fff; }
.kpi-label { color: #555; font-size: 12px; }
.kpi-value { display: flex; align-items: center; font-size: 24px; font-weight: 600; line-height: 1.25; color: #222; }
.kpi-sub { color: #999; font-size: 12px; }
.home-legend { margin-top: 8px; line-height: 1.7; }
.home-sec { margin-top: 18px; }
.home-sec h2 { font-size: 14px; font-weight: 600; margin: 0 0 8px; color: #444; }
.home-sec h2 .count { margin-left: 4px; font-weight: 400; font-size: 12px; color: #999; }
.home-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 24px; }
.home-lesson a { color: #0b62c4; text-decoration: none; }
.home-lesson a:hover { text-decoration: underline; }
.home-status { margin-top: 16px; }
.tv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 10px; }
.tv-card { display: flex; flex-direction: column; gap: 6px; min-width: 0; padding: 10px 12px; background: #fff; border: 1px solid #e5e5e5; border-left: 4px solid #e5e5e5; border-radius: 6px; }
.tv-card.lv-warn { border-left-color: #fab219; }
.tv-card.lv-late { border-left-color: #d03b3b; }
.tv-head { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.tv-head .tv-title { font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.tv-proj { flex: none; max-width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; color: #888; }
.tv-head .tv-proj { margin-left: auto; }
.tv-foot { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 12px; margin-top: 2px; font-size: 12px; color: #555; }
.tv-level { display: inline-flex; align-items: center; }
.tv-rows { list-style: none; margin: 0; padding: 0; }
.tv-row { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 6px 2px; border-bottom: 1px solid #f0f0f0; font-size: 13px; }
.tv-row .tv-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: inherit; text-decoration: none; }
a.tv-title:hover { text-decoration: underline; }
.tv-when { flex: none; font-size: 12px; color: #888; }
.tv-row.lv-warn .tv-when, .tv-row.lv-late .tv-when { color: #555; }
@media (max-width: 800px) {
  .home-main .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-cols { grid-template-columns: minmax(0, 1fr); }
  .tv-grid { grid-template-columns: minmax(0, 1fr); }
}

/* 聊天窗口顶上：这个窗口关联的任务卡 */
.taskbar { flex: none; padding: 6px 16px; border-bottom: 1px solid #e5e5e5; background: #fcfcfb; font-size: 13px; }
.taskbar.lv-warn { box-shadow: inset 4px 0 0 #fab219; }
.taskbar.lv-late { box-shadow: inset 4px 0 0 #d03b3b; }
.taskbar[hidden] { display: none; }
.tb-main { display: flex; align-items: center; gap: 10px; min-width: 0; cursor: pointer; user-select: none; }
.tb-main.tb-empty { cursor: default; user-select: auto; }
.tb-pin { flex: none; }
.tb-title { flex: 0 1 auto; max-width: 280px; min-width: 60px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.tb-stage { flex: none; white-space: nowrap; }
.tb-next { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #555; }
.tb-level { flex: none; display: inline-flex; align-items: center; white-space: nowrap; font-size: 12px; color: #555; }
.tb-chev { flex: none; color: #999; font-size: 11px; }
.taskbar .stepper { flex-basis: 120px; }
.taskbar button { padding: 2px 8px; font-size: 12px; }
.taskbar select { max-width: 460px; min-width: 0; padding: 2px 6px; font-size: 12px; }
.tb-more { display: flex; flex-direction: column; gap: 6px; padding: 8px 0 2px 26px; }
.tb-acts { flex-wrap: wrap; font-size: 12px; }
.tb-acts a.btn { padding: 2px 8px; font-size: 12px; }
@media (max-width: 900px) { .tb-next { display: none; } } /* 窄屏只留关键的；点开还能看到下一步 */
/* 主线 / 支线（D31）：在支线上时那行换成紫色的「🔀 在支线：…」，一眼看出没在主线上；点开分两节 */
.tb-onside { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 1px 8px; border-radius: 4px; background: #f4effb; color: #6b3fa0; }
.tb-sides { flex: none; white-space: nowrap; font-size: 12px; color: #666; }
.tb-sec { display: flex; gap: 10px; align-items: flex-start; }
.tb-sec-h { flex: none; width: 2.6em; padding-top: 1px; font-size: 12px; font-weight: 500; color: #888; }
.tb-sec-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.side-list { list-style: none; margin: 0; padding: 0; font-size: 12px; line-height: 1.7; color: #444; }
.side-list li.urgent { color: #b3261e; }
.side-list li.cur { font-weight: 600; }
.side-list li.closed { color: #aaa; text-decoration: line-through; }
.side-list .when { margin-left: 6px; font-size: 11px; font-weight: 400; color: #999; }
.side-list .tb-doing { margin-left: 6px; font-size: 11px; color: #6b3fa0; }

/* 聊天里 agent 的进度块：画成一行，不给她看原文 */
.md .md-progress { margin: 6px 0 8px; padding: 4px 10px; border-left: 3px solid #2a78d6; border-radius: 0 4px 4px 0; background: #f3f7fd; color: #555; font-size: 12px; }

/* 任务板卡片上的进度（只看不改） */
.task-progress { display: flex; flex-direction: column; gap: 4px; }

/* ---- 定期任务（2026-09-29）：每一次画在首页日历上（D32）；任务板上「定期任务」那栏 = 规则本身 ---- */
.tv-recur { flex: none; font-size: 12px; }
.recur-panel { flex: none; padding: 8px 16px; border-bottom: 1px solid #e5e5e5; }
.recur-panel > summary { cursor: pointer; user-select: none; }
.recur-panel > summary > * + * { margin-left: 8px; }
.recur-body { display: flex; flex-direction: column; gap: 8px; max-height: 45vh; overflow-y: auto; padding: 8px 0 4px; }
.recur-item { display: flex; flex-direction: column; gap: 6px; padding: 8px; border: 1px solid #e5e5e5; border-radius: 6px; background: #fff; }
.recur-item.recur-new { border-style: dashed; background: #fafafa; }
.recur-item.paused { opacity: .6; }
.recur-row { flex-wrap: wrap; }
.recur-item input:not([type]), .recur-item textarea { border: 1px solid #ccc; border-radius: 4px; padding: 6px 8px; background: #fff; }
.recur-row > input:first-child { flex: 1; min-width: 200px; }
.recur-item textarea { width: 100%; resize: vertical; font-size: 13px; }
.wd-pick { display: inline-flex; gap: 2px; }
.wd-pick label { display: inline-flex; align-items: center; gap: 2px; padding: 2px 6px; border: 1px solid #ddd; border-radius: 4px; font-size: 13px; cursor: pointer; user-select: none; }
.wd-pick label:has(input:checked) { border-color: #86b6ef; background: #e8f0fb; }

/* ---- 首页月历（2026-09-30 D32，照她拍板的本机预览）：日历 + 右边「还没定日子」+ 过期条 + 小菜单 + ✎ 小窗 + 拖动 ---- */
.home-main section[hidden] { display: none; } /* 上面 .home-main section{display:block} 会盖掉 hidden 属性 */
.home-lesson-h { margin-top: 18px !important; }
button.primary { background: #0b62c4; border-color: #0b62c4; color: #fff; }
button.primary:hover { background: #0a56ad; }
button.danger { color: #c0392b; }
.cal-bar { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.cal-bar h2 { margin: 0 8px 0 0 !important; }
.cal-range { font-weight: 600; min-width: 8em; text-align: center; }
.cal-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 270px; gap: 14px; align-items: start; }
.cal-head, .cal-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)) repeat(2, minmax(0, .6fr)); }
.cal-head div { font-size: 12px; color: #888; padding: 2px 6px; }
.cal-grid { border-top: 1px solid #e5e5e5; border-left: 1px solid #e5e5e5; }
.cal-day { min-height: 96px; min-width: 0; padding: 4px 4px 6px; border-right: 1px solid #e5e5e5; border-bottom: 1px solid #e5e5e5; display: flex; flex-direction: column; gap: 2px; cursor: pointer; }
.cal-day:hover { background: #fafcff; }
.cal-day.we { background: #fafafa; }
.cal-day.past { background: #f6f6f6; }
.cal-day.past .cal-num { color: #bbb; }
.cal-day.today { background: #eef5ff; box-shadow: inset 0 0 0 2px #0b62c4; }
.cal-day.drop { background: #e3f4e8; box-shadow: inset 0 0 0 2px #3c9a5f; }
.cal-num { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #666; padding: 0 2px 2px; }
.cal-num.month { font-weight: 600; color: #333; }
.cal-wd { display: none; } /* 「10/9 周五」：手机上一天一行时才用 */
.cal-today { font-size: 11px; color: #fff; background: #0b62c4; border-radius: 8px; padding: 0 6px; line-height: 16px; }
.cal-item { display: flex; align-items: center; gap: 3px; width: 100%; min-width: 0; padding: 1px 5px; border: 1px solid transparent; border-radius: 4px; background: #eef3fa; font-size: 12px; line-height: 20px; text-align: left; white-space: nowrap; overflow: hidden; cursor: grab; }
.cal-item:hover { border-color: #b9cbe6; background: #e3ecf8; }
.cal-item .t { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.cal-item .tm { flex: none; color: #666; }
.cal-item .dot { margin-right: 1px; }
.cal-item.lv-warn { background: #fff4d6; }
.cal-item.lv-late { background: #fde6e6; }
.cal-item.recur { background: #f1ecfb; }
.cal-item.recur.lv-warn { background: #fff4d6; }
.cal-item.recur.lv-late { background: #fde6e6; }
.cal-item.skipped { background: transparent; color: #aaa; text-decoration: line-through; }
.cal-more { align-self: flex-start; padding: 0 5px; border: none; background: none; color: #0b62c4; font-size: 12px; line-height: 20px; }
.cal-more:hover { background: none; text-decoration: underline; }
.undated-side { min-width: 0; padding: 8px 8px 10px; border: 1px solid #e5e5e5; border-radius: 6px; background: #fcfcfc; }
.undated-side h2 { margin: 0 0 6px 2px !important; }
.undated-side.drop { background: #e3f4e8; box-shadow: inset 0 0 0 2px #3c9a5f; }
.side-list-u { display: flex; flex-direction: column; gap: 4px; }
.side-item { display: flex; flex-direction: column; align-items: stretch; gap: 1px; width: 100%; min-width: 0; padding: 5px 8px; border: 1px solid #e8e8e8; border-left: 3px solid #d6dbe3; border-radius: 4px; background: #fff; text-align: left; cursor: grab; }
.side-item:hover { border-color: #b9cbe6; background: #f5f8fd; }
.side-item.lv-warn { border-left-color: #fab219; }
.side-item.lv-late { border-left-color: #d03b3b; }
.side-item .t { font-size: 13px; line-height: 1.4; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.side-item .s { font-size: 11px; color: #888; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-hint { margin: 8px 2px 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 4px; max-width: 320px; padding: 3px 10px; border: 1px solid #ddd; border-radius: 14px; background: #fff; font-size: 12px; white-space: nowrap; overflow: hidden; cursor: grab; }
.chip .t { overflow: hidden; text-overflow: ellipsis; }
.chip .pj { color: #999; }
.chip:hover { border-color: #b9cbe6; background: #f5f8fd; }
.chip.lv-late { border-color: #e7a3a3; background: #fdf0f0; }
/* 首页「还没收工」（10-02）：一个窗口一个小标签，点名字打开窗口、点 ✓ = 不用收工 */
.chip.wrap-chip { cursor: default; padding-right: 3px; border-color: #f3d9a0; background: #fffaf0; }
.chip.wrap-chip:hover { border-color: #e9c46a; background: #fff4d6; }
.wrap-chip a.t { color: inherit; text-decoration: none; }
.wrap-chip a.t:hover { text-decoration: underline; }
.wrap-chip .wrap-x { flex: none; width: 20px; height: 20px; padding: 0; border: 0; border-radius: 50%; background: none; color: #888; font-size: 12px; line-height: 20px; }
.wrap-chip .wrap-x:hover { background: #fff; color: #222; }
.pop { position: absolute; z-index: 20; width: 320px; padding: 10px 12px; background: #fff; border: 1px solid #ddd; border-radius: 8px; box-shadow: 0 6px 24px rgba(0, 0, 0, .13); font-size: 13px; }
.pop h3 { margin: 0 0 4px; font-size: 14px; overflow-wrap: anywhere; }
.pop .meta { color: #666; font-size: 12px; line-height: 1.6; }
.pop .acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.pop .acts button, .pop .acts a.btn { padding: 3px 10px; font-size: 12px; }
.pop .acts a.btn { border-color: #ddd; }
.pop ul { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 3px; }
dialog.edit { width: 480px; max-width: calc(100vw - 32px); padding: 16px 18px; border: 1px solid #ddd; border-radius: 10px; }
dialog.edit::backdrop { background: rgba(0, 0, 0, .25); }
dialog.edit h3 { margin: 0 0 12px; font-size: 15px; }
.e-row { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.e-row.e-top { align-items: flex-start; }
.e-row > label { flex: none; width: 3em; color: #666; }
.e-row > label.e-lab2 { width: auto; margin-left: 10px; }
.e-row input[type="text"], .e-row textarea { flex: 1; min-width: 0; padding: 6px 8px; border: 1px solid #ccc; border-radius: 4px; }
.e-row input[type="date"] { padding: 5px 8px; border: 1px solid #ccc; border-radius: 4px; }
.e-row select { min-width: 0; flex: 1; }
.seg { display: inline-flex; }
.seg button { margin-left: -1px; border-radius: 0; }
.seg button:first-child { margin-left: 0; border-radius: 4px 0 0 4px; }
.seg button:last-child { border-radius: 0 4px 4px 0; }
.seg button.on { position: relative; background: #0b62c4; border-color: #0b62c4; color: #fff; }
.e-foot { display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.tv-edit { flex: none; padding: 0 6px; border: 1px solid transparent; background: none; color: #888; font-size: 13px; line-height: 20px; }
.tv-edit:hover { border-color: #ccc; background: #f7f7f7; color: #333; }
.home-toast { position: fixed; left: 50%; bottom: 22px; z-index: 50; transform: translateX(-50%); display: flex; align-items: center; gap: 8px; padding: 6px 8px 6px 14px; border-radius: 18px; background: #333; color: #fff; font-size: 13px; }
.home-toast[hidden] { display: none; }
.home-toast button { padding: 2px 10px; border-color: transparent; background: #555; color: #fff; font-size: 12px; }
@media (max-width: 1000px) { .cal-wrap { grid-template-columns: minmax(0, 1fr); } }

/* ===== 对话页（2026-09-30 D33，照她拍板的本机预览 .wb-ui/preview/chat.css） =====
   低调：白底、系统字体、颜色只用一种蓝（跟首页的主按钮同色）+ 灰；绿色只在「拖到这里松手」时出现（跟首页日历拖动同色） */
body.chat {
  --line: #e4e7eb; --side: #f6f7f9; --hover: #eceff3; --text: #1f2328; --sub: #57606a; --mute: #8c959f; --guide: #d3d8de;
  --accent: #0b62c4; --accent-bg: #e6effa; --accent-text: #0a3f7e; --drop: #3c9a5f; --drop-bg: #e8f5ec;
  display: flex; flex-direction: column; height: 100%; color: var(--text);
}
body.chat main { flex: 1; min-height: 0; height: auto; }
body.chat button:focus-visible, body.chat select:focus-visible, body.chat a:focus-visible { outline: 2px solid #9ec1ea; outline-offset: 1px; }

/* ---- 顶栏：左边「在哪」，右边额度 + 几个页面入口；模型下拉挪进输入框 ---- */
body.chat header.topbar { flex: none; height: 48px; padding: 0 12px 0 8px; gap: 6px; border-bottom: 1px solid var(--line); overflow: visible; }
body.chat header.topbar .brand { padding: 0 4px; font-weight: 600; }
body.chat header .ghost, body.chat header a.btn { padding: 5px 10px; border: 1px solid transparent; border-radius: 6px; background: none; color: var(--sub); }
body.chat header .ghost:hover, body.chat header a.btn:hover { background: var(--hover); color: var(--text); }
body.chat header .ghost.on { background: var(--hover); color: var(--text); }
body.chat #navtoggle { width: 30px; padding: 4px 0; font-size: 15px; }
.crumb { display: flex; align-items: center; gap: 4px; min-width: 0; margin-left: 4px; padding-left: 12px; border-left: 1px solid var(--line); }
.crumb-proj { display: inline-flex; align-items: center; gap: 6px; flex: none; max-width: 240px; padding: 4px 8px; border: 1px solid transparent; border-radius: 6px; background: none; color: var(--sub); font-size: 13px; cursor: pointer; }
.crumb-proj .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crumb-proj:hover, .crumb-proj.open { background: var(--hover); border-color: var(--line); color: var(--text); }
.crumb-proj .chev { flex: none; width: 12px; height: 12px; color: var(--mute); }
.crumb-sep { flex: none; color: #c3c9d0; }
.crumb-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.crumb-title.draft { color: var(--mute); font-weight: 400; }
body.chat #quota { flex: none; margin-right: 4px; color: var(--mute); font-size: 11px; line-height: 1.35; text-align: right; }
.navlinks { display: inline-flex; flex: none; gap: 0; }
.ico { flex: none; width: 16px; height: 16px; }
/* 额度 / 文件 / 页面入口 / 退出 包了一层（手机上收进「⋯」）：电脑上这层不占位置，跟以前一模一样排在顶栏里 */
.topmore { display: contents; }
.topmore > button { flex-shrink: 0; white-space: nowrap; }
#morebtn, .scrim, #filesclose { display: none; } /* 只在手机上出现，见文件最后「手机」那段 */

/* ---- 左栏：文件夹树 ---- */
body.chat aside#nav { display: flex; flex-direction: column; flex: none; width: 268px; background: var(--side); border-right: 1px solid var(--line); overflow: hidden; }
body.chat.nav-collapsed aside#nav { width: 0; border-right-color: transparent; }
body.chat #nav > * { width: 268px; flex: none; } /* 收起的过程中里面不挤成一团 */
.nav-top { display: flex; gap: 6px; padding: 10px 10px 6px; }
body.chat #newconv { flex: none; padding: 5px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--text); font-size: 13px; white-space: nowrap; }
body.chat #newconv:hover { border-color: #c8cfd7; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .06); }
body.chat #search { display: block; flex: 1; min-width: 0; width: auto; margin: 0; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font-size: 13px; }
body.chat #search:focus { outline: none; border-color: #9ec1ea; box-shadow: 0 0 0 3px #e0ecfa; }
body.chat #nav > ul.navtree { flex: 1 1 auto; min-height: 0; overflow-y: auto; margin: 0; padding: 2px 0 16px; list-style: none; }
body.chat #nav li { padding: 0; overflow: visible; white-space: normal; background: none; cursor: default; }
body.chat #nav li:hover { background: none; }
body.chat #nav li.proj { position: relative; margin: 0 0 2px; }
/* 项目那一行：往下滚时钉在顶上（一直知道自己在哪个项目底下） */
body.chat #nav .proj-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 6px; height: 34px; padding: 0 8px 0 12px; background: var(--side); color: var(--text); font-size: 13.5px; font-weight: 600; cursor: pointer; user-select: none; }
body.chat #nav .proj-head:hover { background: #edf0f3; }
body.chat #nav .proj-head .grip { position: absolute; left: 1px; top: 0; width: 11px; line-height: 34px; text-align: center; color: #aab1b9; font-size: 11px; opacity: 0; cursor: grab; }
body.chat #nav .proj-head .chev { flex: none; width: 12px; height: 12px; margin-left: -2px; color: var(--mute); transition: transform .12s ease; }
body.chat #nav .proj-head .chev.shut { transform: rotate(-90deg); }
body.chat #nav .proj-head .ico { color: #6e7781; }
body.chat #nav .proj-head .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.chat #nav .proj-head .name.locked::after { content: '🔒'; margin-left: 4px; font-size: 10px; opacity: .5; }
body.chat #nav .proj-head .count { flex: none; min-width: 18px; color: var(--mute); font-size: 12px; font-weight: 400; text-align: right; }
body.chat #nav .proj-head input.rename { flex: 1; min-width: 0; margin: 0 0 0 -6px; padding: 2px 6px; border: 1px solid #9ec1ea; border-radius: 5px; background: #fff; font: inherit; }
body.chat #nav button.add, body.chat #nav .acts button { flex: none; width: 22px; height: 22px; padding: 0; border: 0; border-radius: 5px; background: none; color: var(--mute); line-height: 22px; text-align: center; }
body.chat #nav button.add { font-size: 17px; font-weight: 400; }
body.chat #nav .acts button { font-size: 12px; font-weight: 400; }
body.chat #nav button.add:hover, body.chat #nav .acts button:hover { background: #dde2e8; color: var(--text); }
body.chat #nav .acts button.del:hover { color: #b3261e; }
body.chat #nav .acts { display: none; flex: none; }
/* 鼠标移上去才露出的 ✎ × ⠿：只给有鼠标的设备。手机没有「移上去」，iPhone 会把第一下点当成移上去、要点两下才打开对话 */
@media (hover: hover) {
  body.chat #nav .proj-head:hover .grip { opacity: 1; }
  body.chat #nav .proj-head:hover .acts { display: inline-flex; }
  body.chat #nav .proj-head:hover .count { display: none; } /* 悬停时数字让位给 ✎ × */
  body.chat #nav li.conv:hover .acts { display: inline-flex; }
}
/* 触屏：打开着的那个对话常驻 ✎ ×（还有 ✓ 不用收工），先点开它再改 */
@media (hover: none) {
  body.chat #nav li.conv.active .acts { display: inline-flex; }
}
body.chat #nav .editing .acts, body.chat #nav .editing .count, body.chat #nav .editing .wrapn, body.chat #nav .editing .add { display: none !important; }
/* 对话：缩进挂在项目底下，左边一根竖线连着；打开的那个竖线那段变蓝 */
body.chat #nav ul.convs { margin: 0 0 6px; padding: 0; list-style: none; }
body.chat #nav li.proj.folded > ul.convs { display: none; }
body.chat #nav li.conv { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 0 6px; min-height: 30px; margin: 0 8px 0 21px; padding: 0 4px 0 12px; border-left: 1px solid var(--guide); border-radius: 0 6px 6px 0; color: var(--sub); font-size: 13.5px; cursor: pointer; }
body.chat #nav li.conv:hover { background: var(--hover); color: var(--text); }
body.chat #nav li.conv.active { padding-left: 11px; border-left: 2px solid var(--accent); background: var(--accent-bg); color: var(--accent-text); font-weight: 500; }
body.chat #nav li.conv .title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 30px; }
body.chat #nav li.conv .run { flex: none; width: 7px; height: 7px; border-radius: 50%; background: #2da44e; box-shadow: 0 0 0 3px #d4efdb; }
/* 收工提醒（10-02）：还没收工的窗口一个黄点（在跑的照旧绿点）；项目行的黄数字 = 里面几个没收工，项目收起来也看得见 */
body.chat #nav li.conv .wrapdot { flex: none; width: 7px; height: 7px; border-radius: 50%; background: #fab219; }
body.chat #nav .proj-head .wrapn { flex: none; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #fff4d6; color: #8a5a00; font-size: 11px; font-weight: 600; line-height: 18px; text-align: center; }
body.chat #nav li.conv input.rename { flex: 1; min-width: 0; margin: 3px 0 3px -6px; padding: 2px 6px; border: 1px solid #9ec1ea; border-radius: 5px; background: #fff; font: inherit; }
body.chat #nav li.conv.draft .title { color: var(--mute); font-style: italic; font-weight: 400; }
body.chat #nav li.conv .snip { flex-basis: 100%; margin-top: -6px; padding-bottom: 5px; overflow: hidden; color: var(--mute); font-size: 12px; font-weight: 400; text-overflow: ellipsis; white-space: nowrap; }
body.chat #nav li.conv-empty { margin: 0 8px 0 21px; padding: 3px 12px 7px; border-left: 1px solid var(--guide); color: var(--mute); font-size: 12px; }
body.chat #nav li.none { padding: 20px 14px; color: var(--mute); font-size: 13px; text-align: center; }
.nav-foot { padding: 6px 8px; border-top: 1px solid var(--line); }
body.chat .nav-foot button { width: 100%; padding: 6px 10px; border: 0; border-radius: 6px; background: none; color: var(--sub); text-align: left; }
body.chat .nav-foot button:hover { background: var(--hover); color: var(--text); }

/* 拖动：拖项目时先把对话都收起来，只剩项目名好排；蓝线 = 放在这儿；拖对话时目标项目变绿 = 松手挪进去 */
body.chat #nav ul.navtree.compact ul.convs { display: none; }
body.chat #nav li.proj.dragging > .proj-head { opacity: .4; }
body.chat #nav li.proj.drop-before::before, body.chat #nav li.proj.drop-after::after { content: ''; position: absolute; left: 8px; right: 8px; z-index: 3; height: 2px; border-radius: 1px; background: var(--accent); }
body.chat #nav li.proj.drop-before::before { top: -2px; }
body.chat #nav li.proj.drop-after::after { bottom: -2px; }
body.chat #nav li.proj.drop-into { border-radius: 6px; background: var(--drop-bg); box-shadow: inset 0 0 0 2px var(--drop); }
body.chat #nav li.proj.drop-into > .proj-head { border-radius: 6px 6px 0 0; background: var(--drop-bg); }
body.chat #nav li.conv.dragging { opacity: .4; }
body.chat #nav li.proj.flash > .proj-head { animation: flash 1.2s ease-out; }
@keyframes flash { 0%, 30% { background: var(--drop-bg); } 100% { background: var(--side); } }

/* ---- 聊天区：内容放在中间一栏（大屏上不用眼睛横扫一整屏） ---- */
body.chat section.chat { flex: 1; display: flex; flex-direction: column; min-width: 0; }
body.chat .taskbar { padding: 6px 20px; background: #fbfbfc; }
body.chat #msgs { flex: 1; display: block; padding: 0; overflow-y: auto; }
body.chat .col { display: flex; flex-direction: column; gap: 14px; max-width: 820px; margin: 0 auto; padding: 24px 28px 16px; }
body.chat .msg { max-width: 100%; }
body.chat .msg.u { align-self: flex-end; max-width: 82%; padding: 9px 14px; border-radius: 14px 14px 4px 14px; background: #eef2f7; }
body.chat .msg.u .att { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; white-space: normal; }
body.chat .msg.u .att span, body.chat .msg.u .att a { padding: 1px 9px; border: 1px solid #d6dde6; border-radius: 10px; background: #fff; color: var(--sub); font-size: 12px; text-decoration: none; }
body.chat .msg.u .att a:hover { border-color: #b9cbe6; color: var(--accent); } /* 她发过的文件：点了下载 */
body.chat .msg.a { line-height: 1.7; }
body.chat .msg.t { align-self: flex-start; padding: 1px 10px; border-radius: 10px; background: #f3f4f6; color: var(--mute); font-size: 12px; line-height: 20px; }
body.chat .msg.t.drift { align-self: stretch; }
/* 新对话（点了 ＋、还没发第一句）：中间一句话告诉她会放在哪 */
.draft-hint { margin: 16vh auto 0; text-align: center; color: var(--sub); }
.draft-hint h2 { margin: 0 0 10px; color: var(--text); font-size: 20px; font-weight: 600; }
.draft-hint .where { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border: 1px solid var(--line); border-radius: 14px; background: var(--side); color: var(--text); }
.draft-hint p { margin: 10px 0 0; color: var(--mute); font-size: 12.5px; }

/* ---- 输入框：一个圆角盒子，模型 / effort 放在盒子底边 ---- */
.dock { flex: none; padding: 0 28px 16px; }
.dock > * { max-width: 764px; margin-left: auto; margin-right: auto; }
body.chat #status { min-height: 22px; padding: 0 4px 4px; }
.composer2 { padding: 10px 10px 8px 14px; border: 1px solid #d0d6dd; border-radius: 14px; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 6px 20px rgba(0, 0, 0, .04); }
.composer2:focus-within { border-color: #9ec1ea; box-shadow: 0 0 0 3px #e3eefb; }
.composer2.drag { border-color: var(--drop); box-shadow: 0 0 0 3px #d9f0e0; }
.composer2 .chips:not(:empty) { margin-bottom: 6px; }
.composer2 textarea { display: block; width: 100%; min-height: 48px; max-height: 40vh; padding: 2px 0 8px; border: 0; outline: none; background: transparent; font: inherit; line-height: 1.6; resize: none; }
.composer2 .cbar { display: flex; align-items: center; gap: 2px; }
.composer2 .picks { display: inline-flex; gap: 0; }
body.chat .composer2 select { padding: 3px 4px; border: 1px solid transparent; border-radius: 6px; background: transparent; color: var(--sub); font-size: 12.5px; cursor: pointer; }
body.chat .composer2 select:hover { background: var(--hover); }
body.chat .composer2 .tool { margin-left: -6px; padding: 3px 8px; border: 0; border-radius: 6px; background: none; color: var(--sub); font-size: 12.5px; }
body.chat .composer2 .tool:hover { background: var(--hover); }
.composer2 .hint { margin-right: 8px; }
body.chat .composer2 #send, body.chat .composer2 #stop { padding: 5px 16px; border-radius: 8px; }

/* ---- 图片：输入框里贴上的、消息里发过的都显示缩略图，点一下看大图 ---- */
.composer2 .chips { align-items: flex-end; }
.thumbchip { position: relative; display: inline-flex; flex-direction: column; width: 96px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--side); }
.thumbchip img { display: block; width: 96px; height: 64px; object-fit: cover; background: #fff; cursor: zoom-in; }
.thumbchip .nm { padding: 2px 6px; overflow: hidden; color: var(--sub); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
body.chat .thumbchip button.x { position: absolute; top: 3px; right: 3px; width: 18px; height: 18px; padding: 0; border: 0; border-radius: 50%; background: rgba(0, 0, 0, .55); color: #fff; font-size: 12px; line-height: 18px; }
body.chat .composer2 .chip { cursor: pointer; }
body.chat .msg.u .att-imgs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
body.chat .msg.u .att-imgs.only { margin-top: 0; }
body.chat .msg .thumbbtn { padding: 0; border: 1px solid #d6dde6; border-radius: 8px; overflow: hidden; background: #fff; cursor: zoom-in; }
body.chat .msg .thumbbtn img { display: block; max-width: 240px; max-height: 160px; }
body.chat .msg.f { display: flex; flex-wrap: wrap; gap: 6px; }
body.chat .msg.f a.fcard { display: inline-block; padding: 5px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--accent); font-size: 13px; text-decoration: none; }
body.chat .msg.f a.fcard:hover { border-color: #b9cbe6; background: #f5f8fd; }
.lightbox { position: fixed; inset: 0; z-index: 90; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; background: rgba(20, 22, 26, .8); cursor: zoom-out; }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 92vw; max-height: 82vh; border-radius: 4px; background: #fff; box-shadow: 0 10px 40px rgba(0, 0, 0, .45); }
.lb-bar { display: flex; align-items: center; gap: 14px; color: #fff; font-size: 13px; }
.lb-bar a { color: #9ec9ff; }
.lb-hint { color: #aab0b8; font-size: 12px; }

/* ---- 顶栏项目名点开的小菜单 ---- */
.menu { position: fixed; z-index: 40; min-width: 230px; max-height: 60vh; overflow-y: auto; padding: 6px; border: 1px solid #dde1e6; border-radius: 10px; background: #fff; box-shadow: 0 8px 28px rgba(0, 0, 0, .12); font-size: 13px; }
.menu[hidden] { display: none; }
.menu .mh { padding: 4px 8px 6px; color: var(--mute); font-size: 12px; }
body.chat .menu button { display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 8px; border: 0; border-radius: 6px; background: none; color: var(--text); text-align: left; }
body.chat .menu button:hover { background: var(--hover); }
body.chat .menu button.cur { color: var(--mute); cursor: default; }
body.chat .menu button.cur:hover { background: none; }
.menu button .ico { color: #6e7781; }
.menu button .ok { margin-left: auto; color: var(--accent); }

/* 提示条放在顶上（底下是输入框，别挡住） */
body.chat .home-toast { top: 58px; bottom: auto; }
body.chat .chip.up { color: var(--mute); cursor: default; } /* 上传中 */
body.chat .chip.gone { color: var(--mute); cursor: default; } /* 老对话挪过项目 / 文件删了：图找不到 */
body.chat .msg.f .thumbbtn img { max-width: 320px; max-height: 240px; } /* agent 做出来的图大一点 */
body.chat .msg.t.tools { white-space: normal; }
body.chat .msg.t.drift { padding: 6px 10px; border-radius: 4px; background: #fff6dc; color: #7a5a00; font-size: 13px; line-height: 1.5; } /* 防跑偏报警：上面 .msg.t 小标签的样子别把黄条盖掉 */

/* D39 记忆页「🧹 整理记录」 */
.tidy-ops li { margin: .6em 0; }
.tidy-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 6px; }
.tidy-pair h4 { margin: 0 0 4px; font-size: 12px; }
.tidy-pair pre { white-space: pre-wrap; word-break: break-word; max-height: 320px; overflow: auto; font-size: 12px; background: #f7f7f5; padding: 8px; border-radius: 4px; margin: 0; }
.tidy-err { color: #b42318; }

/* ===== 手机（2026-10-10）：屏幕窄于 700px 时换一套排法，电脑上什么都不变。断点跟 app.js 的 PHONE 一样，改要两边一起改 ===== */
@media (max-width: 700px) {
  body { touch-action: manipulation; } /* 双击不放大页面（双指照样能缩放） */
  /* iPhone 点到字小于 16px 的输入框 / 下拉会把整页放大、还缩不回去：手机上能打字、能选的一律 16px（压过各处写的小字号） */
  input, select, textarea { font-size: 16px !important; }
  .home-toast { max-width: calc(100vw - 24px); }
  .menu { max-width: calc(100vw - 16px); }
  .lb-bar { flex-wrap: wrap; justify-content: center; gap: 6px 14px; padding: 0 12px; }
  .lb-hint { display: none; } /* 「按 Esc」手机上没有；点哪都能关，不用说 */

  /* ---- 聊天页顶栏：☰ +「项目 › 对话」+ ⋯；额度、文件、页面入口、退出收进 ⋯ ---- */
  body.chat header.topbar { padding: 0 4px; gap: 2px; }
  body.chat header.topbar .brand { display: none; }
  .crumb { margin-left: 0; padding-left: 2px; border-left: 0; }
  .crumb-proj { max-width: 42vw; padding: 4px 6px; }
  .crumb-proj .ico { display: none; }
  body.chat #morebtn { display: inline-block; flex: none; width: 38px; padding: 2px 0 6px; font-size: 20px; line-height: 1; }
  body.chat.more-open #morebtn { background: var(--hover); color: var(--text); }
  body.chat .topmore { display: none; }
  body.chat.more-open .topmore { position: fixed; top: 50px; right: 6px; z-index: 45; display: flex; flex-direction: column; align-items: stretch; min-width: 210px; max-width: calc(100vw - 12px); padding: 6px; border: 1px solid #dde1e6; border-radius: 10px; background: #fff; box-shadow: 0 8px 28px rgba(0, 0, 0, .14); }
  body.chat.more-open .topmore #quota { margin: 0 0 4px; padding: 4px 10px 8px; border-bottom: 1px solid var(--line); font-size: 12px; text-align: left; }
  body.chat.more-open .topmore .navlinks { display: flex; flex-direction: column; }
  body.chat.more-open .topmore .ghost, body.chat.more-open .topmore a.btn { display: block; padding: 10px 12px; font-size: 15px; text-align: left; }

  /* ---- 对话栏 = 盖在聊天上的抽屉：平时收着，点 ☰ 拉出来（nav-open），点旁边灰的地方或选了对话就收回 ---- */
  body.chat main { position: relative; }
  body.chat aside#nav, body.chat.nav-collapsed aside#nav { position: absolute; top: 0; bottom: 0; left: 0; z-index: 30; width: min(86vw, 330px); border-right-color: var(--line); box-shadow: none; transform: translateX(-100%); visibility: hidden; transition: transform .2s ease, visibility .2s; }
  body.chat.nav-open aside#nav { transform: none; visibility: visible; box-shadow: 6px 0 24px rgba(0, 0, 0, .16); }
  body.chat #nav > * { width: auto; }
  body.chat #nav > ul.navtree { overscroll-behavior: contain; }
  body.chat.nav-open .scrim, body.chat.files-open .scrim { display: block; position: absolute; inset: 0; z-index: 25; background: rgba(20, 24, 28, .32); cursor: pointer; }
  /* 手指点的东西大一点 */
  body.chat #nav .proj-head { height: 42px; }
  body.chat #nav .proj-head .grip { display: none; }
  body.chat #nav li.conv { min-height: 40px; font-size: 15px; }
  body.chat #nav li.conv .title { line-height: 40px; }
  body.chat #nav button.add, body.chat #nav .acts button { width: 32px; height: 32px; line-height: 32px; }

  /* ---- 文件栏 = 从右边盖出来 ---- */
  body.chat aside#files { position: absolute; top: 0; right: 0; bottom: 0; z-index: 30; width: min(88vw, 340px); background: #fff; box-shadow: -6px 0 24px rgba(0, 0, 0, .16); }
  body.chat #filesclose { display: inline-block; margin-left: 2px; font-size: 18px; }
  body.chat .files li { padding: 7px 0; }

  /* ---- 任务进度条：一行只留 卡名 + 第几步，别的点开看 ---- */
  body.chat .taskbar { padding: 6px 12px; }
  .tb-main { gap: 8px; }
  .taskbar .stepper, .tb-sides, .tb-level { display: none; }
  .tb-title { max-width: 45%; min-width: 3em; }
  .tb-stage { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .tb-more { padding-left: 4px; }
  .tb-main.tb-empty { flex-wrap: wrap; row-gap: 2px; }
  .tb-hint { display: none; }
  .taskbar select { flex: 1; max-width: none; }

  /* ---- 消息 ---- */
  body.chat .col { gap: 12px; padding: 14px 12px 12px; }
  body.chat .msg.u { max-width: 88%; }
  body.chat .msg .thumbbtn img { max-width: 200px; max-height: 150px; }
  body.chat .msg.f .thumbbtn img { max-width: 100%; max-height: 240px; }
  .draft-hint { margin-top: 10vh; padding: 0 8px; }

  /* ---- 输入框：底边一行放得下；发送键一直看得见 ---- */
  .dock { padding: 0 8px 8px; }
  body.chat #status { padding: 0 6px 2px; }
  .composer2 { padding: 8px 8px 6px 12px; border-radius: 12px; }
  .composer2 textarea { min-height: 44px; max-height: 32vh; line-height: 1.45; }
  .composer2 .hint { display: none; }
  .composer2 .picks { min-width: 0; }
  body.chat .composer2 select { min-width: 0; max-width: 9.5em; padding: 2px; }
  body.chat:not(.drafting) .composer2 #engine { display: none; } /* 聊过的对话本来就换不了引擎；新对话才给选 */
  body.chat.drafting .composer2 .cbar { flex-wrap: wrap; row-gap: 2px; } /* 新对话三个下拉一行放不下：自己占一行，放在 ＋ 和发送上面 */
  body.chat.drafting .composer2 .picks { order: -1; flex: 1 0 100%; margin-left: -4px; }
  body.chat .composer2 .tool { flex: none; margin-left: -4px; padding: 2px 10px; font-size: 22px; line-height: 1; white-space: nowrap; }
  .composer2 .tool .lbl { display: none; } /* 只留「＋」，省出地方给模型下拉 */
  body.chat .composer2 #send, body.chat .composer2 #stop { flex: none; padding: 7px 16px; }
  body.chat .composer2 #stop:not([hidden]) ~ #send { display: none; } /* 跑着的时候只留「停止」 */
}

/* ===== 手机 · 首页和别的页（跟上面同一个断点）===== */
@media (max-width: 700px) {
  /* 顶栏放不下就折成两行（以前是横着滑，最右边的看不见）；页面主体占掉剩下的高度，顶栏几行都不会多出一截滚动 */
  body { display: flex; flex-direction: column; }
  body > header { flex: none; flex-wrap: wrap; gap: 4px 6px; padding: 8px 10px; overflow-x: visible; }
  body.chat header.topbar { flex-wrap: nowrap; } /* 聊天页顶栏有自己那套（上面），不折行 */
  body > main, body.home main.home-main, main.tasks-main { flex: 1; min-height: 0; height: auto; }
  #today { flex-shrink: 0; white-space: nowrap; }

  /* ---- 首页 ---- */
  body.home main.home-main { padding: 12px 12px 32px; }
  .pop { max-width: calc(100vw - 16px); }
  .e-row { flex-wrap: wrap; }
  .cal-bar { flex-wrap: wrap; row-gap: 4px; }
  .cal-bar > * { flex-shrink: 0; white-space: nowrap; }
  /* 日历：7 栏挤不下 → 一天一行，只列有事的日子（加上今天）；每件事占满一行，标题看得全 */
  .cal-head { display: none; }
  .cal-grid { display: block; border: 0; }
  .cal-day, .cal-day.we, .cal-day.past { min-height: 0; padding: 8px 4px 10px; border-right: 0; background: none; gap: 4px; }
  .cal-day:not(.today):not(:has(.cal-item)) { display: none; }
  .cal-day.today { border-radius: 6px; background: #eef5ff; box-shadow: none; }
  .cal-num, .cal-day.past .cal-num { color: #444; font-size: 13px; font-weight: 600; }
  .cal-n { display: none; }
  .cal-wd { display: inline; }
  .cal-item { padding: 3px 8px; font-size: 14px; line-height: 24px; }

  /* ---- 任务板：四栏改成从上往下排，整页一起滚 ---- */
  main.tasks-main { overflow-y: auto; }
  .task-board { flex: none; overflow: visible; grid-template-columns: minmax(0, 1fr); }
  .task-column { min-width: 0; }
  .task-row input:first-child { flex-basis: 100%; min-width: 0; }
  .recur-body { max-height: none; }

  /* ---- 记忆页：左边的目录放上面，内容在下面 ---- */
  .memory-main { flex-direction: column; }
  .memory-main aside.tree { flex: none; width: auto; max-height: 40%; border-right: 0; border-bottom: 1px solid #e5e5e5; }
  section.editor { min-height: 0; padding: 10px 12px; }

  /* ---- 控制台 ---- */
  .console-main { width: 100%; padding: 12px; } /* 竖排后 margin:auto 会让它缩成内容那么宽、伸出屏幕 */
  .q, .console-main .row { flex-wrap: wrap; }
  .console-main button { white-space: nowrap; }
}
