/* AIOS 智核 Web 界面样式 */
* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #0f1220;
  --bg2: #171a2e;
  --bg3: #1f2340;
  --fg: #e8eaf6;
  --muted: #8b90b0;
  --accent: #5b8cff;
  --accent2: #7c5bff;
  --ok: #35d07f;
  --warn: #ffb020;
  --danger: #ff5c5c;
  --radius: 10px;
  --mono: Consolas, 'Courier New', monospace;
}
html, body { height: 100%; }
body {
  font-family: 'Segoe UI', 'Microsoft YaHei', system-ui, sans-serif;
  background: radial-gradient(1200px 600px at 20% -10%, #1b2140 0%, var(--bg) 55%);
  color: var(--fg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ===== 顶栏 ===== */
.topbar {
  display: flex; align-items: center; gap: 20px;
  padding: 10px 18px;
  background: rgba(15, 18, 32, .85);
  border-bottom: 1px solid #262b4d;
  backdrop-filter: blur(8px);
  z-index: 10;
}
.brand { display: flex; align-items: baseline; gap: 8px; }
.logo { color: var(--accent2); font-size: 22px; }
.brand-name { font-size: 18px; font-weight: 700; letter-spacing: 1px; }
.tagline { color: var(--muted); font-size: 12px; }
.tabs { display: flex; gap: 6px; flex: 1; }
.tab {
  background: transparent; color: var(--muted); border: none;
  padding: 7px 14px; border-radius: 8px; cursor: pointer; font-size: 14px;
  transition: all .15s;
}
.tab:hover { background: var(--bg3); color: var(--fg); }
.tab.active { background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #fff; font-weight: 600; }
.statusbar { display: flex; gap: 8px; }
.pill {
  font-size: 12px; padding: 4px 10px; border-radius: 20px;
  background: var(--bg3); color: var(--muted); white-space: nowrap;
}
.pill.ok { color: var(--ok); }
.pill.warn { color: var(--warn); }
.pill.bad { color: var(--danger); }

/* ===== 视图 ===== */
.view { display: none; flex: 1; overflow: hidden; }
.view.active { display: flex; }

/* ===== 对话 ===== */
#view-chat { flex-direction: row; }
.sidebar {
  width: 240px; display: flex; flex-direction: column; gap: 12px;
  padding: 14px; background: var(--bg2); border-right: 1px solid #262b4d;
  overflow-y: auto;
}
.side-section { display: flex; flex-direction: column; gap: 8px; }
.side-section.grow { flex: 1; }
.side-title {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px;
}
.mini {
  background: var(--bg3); color: var(--fg); border: none; border-radius: 6px;
  width: 22px; height: 22px; cursor: pointer;
}
select, input[type="text"], input:not([type]), textarea {
  background: var(--bg3); color: var(--fg); border: 1px solid #2e3460;
  border-radius: 8px; padding: 8px 10px; font-size: 14px; outline: none;
  font-family: inherit;
}
select:focus, input:focus, textarea:focus { border-color: var(--accent); }
.session-list { list-style: none; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }
.session-list li {
  display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 8px 10px; border-radius: 8px; cursor: pointer; font-size: 13px;
  color: var(--muted);
}
.session-list li .sess-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1 1 100%; min-width: 0; }
.session-list li .sess-time { font-family: var(--mono); font-size: 11px; color: var(--muted); flex: none; opacity: .85; }
.session-list li .sess-meta { font-family: var(--mono); font-size: 10.5px; opacity: .7; flex: none; margin-right: auto; }
/* S1「找得回」：分组头 / 空态 / 检索工具条（2026-09-27）。分组头是标题不是会话行，点它不打开会话 */
.session-list li.sess-group {
  display: flex; justify-content: space-between; cursor: default; padding: 7px 4px 2px;
  font-size: 11px; color: var(--muted); background: transparent; border-top: 1px dashed var(--bg3);
}
.session-list li.sess-group:hover { background: transparent; color: var(--muted); }
.session-list li.sess-empty { display: block; cursor: default; font-size: 12px; line-height: 1.55; color: var(--muted); padding: 8px 6px; }
.session-list li.sess-empty:hover { background: transparent; color: var(--muted); }
.sess-stats { font-family: var(--mono); font-size: 10.5px; line-height: 1.4; }
.sess-tools { display: flex; gap: 6px; }
.sess-tools input { flex: 1 1 auto; min-width: 0; padding: 5px 8px; font-size: 12px; }
.sess-tools select { flex: none; max-width: 46%; padding: 5px 6px; font-size: 12px; }
.session-list li:hover { background: var(--bg3); color: var(--fg); }
.session-list li.active { background: var(--bg3); color: var(--fg); border-left: 3px solid var(--accent); }
.hint { font-size: 11px; color: var(--muted); }

/* 开关 */
.switch { position: relative; display: inline-block; width: 42px; height: 22px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute; inset: 0; background: var(--bg3); border-radius: 22px;
  transition: .2s; cursor: pointer;
}
.slider::before {
  content: ''; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px;
  background: var(--muted); border-radius: 50%; transition: .2s;
}
.switch input:checked + .slider { background: var(--accent); }
.switch input:checked + .slider::before { transform: translateX(20px); background: #fff; }

/* 聊天区 */
.chat-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
/* S2「此刻」状态带（2026-09-27）：一屏答「在跑吗 / 在做什么 / 做到哪 / 何时下一轮 / 为何没跑」 */
.now-band {
  flex: none; border-bottom: 1px solid var(--bg3); background: var(--bg2, var(--bg3));
  padding: 9px 14px 8px; display: flex; flex-direction: column; gap: 5px; font-size: 12px;
}
.now-main { display: flex; align-items: center; gap: 8px; }
.now-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; background: var(--muted); }
.now-dot.run { background: var(--accent); box-shadow: 0 0 0 3px rgba(120, 170, 255, .18); animation: nowPulse 1.6s ease-in-out infinite; }
.now-dot.ok { background: #4caf78; }
.now-dot.warn { background: #d9a13b; }
.now-dot.bad { background: var(--danger); }
@keyframes nowPulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
.now-headline { font-weight: 600; color: var(--fg); }
.now-meta { font-family: var(--mono); font-size: 10.5px; color: var(--muted); }
.now-lines { display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--muted); }
.now-item { display: inline-flex; gap: 5px; align-items: baseline; min-width: 0; }
.now-item b { color: var(--fg); font-weight: 600; opacity: .85; flex: none; }
.now-item > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 46ch; }
.now-human { font-size: 10.5px; color: var(--muted); opacity: .85; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 768px) {
  .now-band { padding: 8px 10px 7px; }
  .now-item > span { max-width: 100%; }
  .now-human { white-space: normal; }
}
.messages { flex: 1; overflow-y: auto; padding: 18px 22px; display: flex; flex-direction: column; gap: 12px; }
/* S3「说得动」：指令条 + 动作卡（2026-09-27） */
.act-bar { flex: none; display: flex; align-items: center; gap: 8px; padding: 8px 22px; border-bottom: 1px solid var(--border); background: var(--panel, rgba(127,127,127,.05)); flex-wrap: wrap; }
.act-bar-hint { color: var(--muted); font-size: 12px; margin-right: auto; }
.act-bar button { font-size: 12px; padding: 4px 10px; border-radius: 6px; cursor: pointer; }
.act-card {
  border: 1px solid var(--border); border-left: 3px solid var(--muted); border-radius: 10px;
  background: var(--panel, rgba(127,127,127,.06)); padding: 10px 12px; font-size: 13px; line-height: 1.6;
}
.act-card.ok { border-left-color: #2e9b52; }
.act-card.warn { border-left-color: #d08700; }
.act-card.bad { border-left-color: #cf3b3b; }
.act-card.run { border-left-color: #3b7dcf; }
.act-head { font-weight: 600; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.act-ref code { font-size: 12px; padding: 1px 5px; border-radius: 4px; background: rgba(127,127,127,.18); }
.act-time { margin-left: auto; color: var(--muted); font-size: 12px; font-weight: 400; }
.act-row { display: flex; gap: 8px; align-items: baseline; }
.act-row > b { flex: none; width: 5.4em; color: var(--muted); font-weight: 600; }
.act-row > span { min-width: 0; word-break: break-word; }
.act-stream { margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--border); max-height: 260px; overflow-y: auto; font-size: 12px; }
/* S4「听得见」：AIOS 主动开口的样式（与「你问了它」区分开） */
.msg-row.proactive .msg-bubble { border-left: 3px solid #d08700; background: rgba(208,135,0,.08); }
.proactive-tag { color: #d08700; font-weight: 600; }
.live-note { font-size: 12px; color: var(--muted); padding: 0 4px; }
.live-note.warn { color: #d08700; }
/* L0 口径总账（2026-09-27 学习中心）：一行一把尺，数字要一眼可比，出处要能追 */
.ledger { margin: 10px 0 4px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--panel, rgba(127,127,127,.05)); }
.ledger-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.ledger-rows { display: flex; flex-direction: column; gap: 3px; font-size: 13px; }
.ledger-row { display: grid; grid-template-columns: 12em 8em 1fr auto; gap: 8px; align-items: baseline; }
.ledger-row .lg-name { color: var(--muted); }
.ledger-row .lg-value { font-variant-numeric: tabular-nums; }
.ledger-row .lg-ruler { color: var(--muted); font-size: 12px; }
.ledger-row .lg-src code { font-size: 11px; opacity: .7; }
.ledger-warn { margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--border); font-size: 12px; color: #d08700; line-height: 1.7; }
@media (max-width: 768px) { .ledger-row { grid-template-columns: 1fr; gap: 0 4px; } .ledger-row .lg-ruler, .ledger-row .lg-src { font-size: 11px; } }
/* L1 学习前线：批量喂料的逐条回执（排队/学习中/已入库/失败一眼可辨，失败可单条重试） */
.learn-queue { display: flex; flex-direction: column; gap: 3px; margin: 6px 0 2px; }
.learn-queue .lq-row { display: grid; grid-template-columns: 3.2em 1.4em 4.2em 1fr 2fr auto; gap: 6px; align-items: baseline; font-size: 12.5px; padding: 3px 6px; border-radius: 6px; background: rgba(127,127,127,.07); }
.learn-queue .lq-row .lq-idx { color: var(--muted); font-variant-numeric: tabular-nums; }
.learn-queue .lq-row .lq-target { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.learn-queue .lq-row .lq-text { color: var(--muted); overflow-wrap: anywhere; }
.learn-queue .lq-ok { border-left: 3px solid #2e9e5b; }
.learn-queue .lq-bad { border-left: 3px solid #d9534f; }
.learn-queue .lq-running { border-left: 3px solid #d08700; }
.learn-queue .lq-wait { border-left: 3px solid var(--border); opacity: .65; }
@media (max-width: 768px) { .learn-queue .lq-row { grid-template-columns: 2.6em 1.2em 1fr; } .learn-queue .lq-row .lq-text { grid-column: 1 / -1; } }
/* L2 知识资产分区：筛选条 / 资产行 / 卫生块 */
.la-filters { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.la-filter.active { border-color: var(--accent, #4b8); color: var(--accent, #4b8); font-weight: 600; }
.la-scope { margin-top: 6px; line-height: 1.7; }
#la-list .la-item, .la-hyg-block .la-item { padding: 5px 8px; border-radius: 6px; background: rgba(127,127,127,.06); margin-bottom: 4px; }
#la-list .la-head, .la-hyg-block .la-head { font-size: 13.5px; overflow-wrap: anywhere; }
#la-list .la-meta, .la-hyg-block .la-meta { margin-top: 2px; }
.la-hyg-block { margin: 10px 0; }
.la-hyg-block h3 { font-size: 13.5px; margin: 0 0 6px; }
.la-null { color: #d08700; }
.la-cands { display: flex; flex-direction: column; gap: 3px; margin: 8px 0; }
.la-cand { display: flex; gap: 6px; align-items: baseline; font-size: 12.5px; }
/* L3 主人裁决：徽标 + 逐条操作条 */
.la-acts { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.la-vd { padding: 1px 6px; border-radius: 8px; font-size: 11.5px; border: 1px solid var(--border); }
.la-vd-none { opacity: .55; }
.la-vd-pin { border-color: #d08700; color: #d08700; }
.la-vd-adopt { border-color: #2e9e5b; color: #2e9e5b; }
.la-vd-retire { border-color: #cf3b3b; color: #cf3b3b; }
@media (max-width: 768px) { .la-filters { flex-direction: column; } .la-filter { text-align: left; } }
/* L4 决策落地：候选状态徽标 */
.lm-badge { padding: 1px 6px; border-radius: 8px; font-size: 11.5px; border: 1px solid var(--border); }
.lm-in { border-color: #2e9e5b; color: #2e9e5b; }
.lm-out { border-color: #d08700; color: #d08700; }
#lm-pick, #lm-title, #lm-rationale { box-sizing: border-box; }
/* S5「打断」：正在朗读时的可见状态（麦克风按钮与停止朗读按钮） */
#btn-mic.speaking { box-shadow: 0 0 0 3px rgba(208,135,0,.35); animation: none; }
button.danger { border-color: #cf3b3b; color: #cf3b3b; }
.run-time { color: var(--muted); }
.msg-row { display: flex; flex-direction: column; max-width: 78%; }
.msg-row.user { align-self: flex-end; align-items: flex-end; }
.msg-row.assistant { align-self: flex-start; }
.msg-bubble {
  padding: 10px 14px; border-radius: 14px; line-height: 1.65;
  font-size: 14.5px; white-space: pre-wrap; word-break: break-word;
}
.msg-row.user .msg-bubble { background: linear-gradient(135deg, var(--accent), var(--accent2)); border-bottom-right-radius: 4px; }
.msg-row.assistant .msg-bubble { background: var(--bg3); border-bottom-left-radius: 4px; }
.msg-meta { font-size: 11px; color: var(--muted); margin: 4px 6px; }
.msg-time { font-family: var(--mono); opacity: .9; }
.tool-note {
  font-size: 12px; color: var(--accent); background: rgba(91,140,255,.08);
  border: 1px dashed #3a4a8a; border-radius: 8px; padding: 6px 10px; margin-top: 4px;
}
.tool-note .msg-time { color: var(--muted); margin-right: 6px; }
.composer {
  display: flex; gap: 10px; padding: 14px 18px;
  background: var(--bg2); border-top: 1px solid #262b4d;
}
.composer textarea { flex: 1; resize: none; max-height: 120px; }
.mic, .send {
  border: none; border-radius: 10px; cursor: pointer; font-size: 16px;
  min-width: 46px; padding: 8px 14px;
}
.mic { background: var(--bg3); color: var(--fg); }
.mic.recording { background: var(--danger); color: #fff; animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .6; } }
.send { background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #fff; font-weight: 600; }
.mic-tip {
  position: fixed; bottom: 90px; left: 50%; transform: translateX(-50%);
  background: var(--danger); color: #fff; padding: 10px 18px; border-radius: 20px; font-size: 14px;
}
.hidden { display: none !important; }

/* ===== 对话页 · 进化动态面板 ===== */
.evo-feed {
  background: var(--bg2); border-top: 1px solid #262b4d; padding: 0 14px;
}
.evo-feed summary {
  cursor: pointer; user-select: none; font-size: 13px; font-weight: 600;
  padding: 10px 4px; color: var(--fg); list-style: none; display: flex; align-items: center; gap: 8px;
}
.evo-feed summary::-webkit-details-marker { display: none; }
.evo-feed summary::before { content: '▸'; color: var(--accent); transition: transform .15s; }
.evo-feed[open] summary::before { transform: rotate(90deg); }
.evo-feed summary .hint { font-weight: 400; }
.evo-feed-head {
  display: flex; align-items: center; gap: 10px;
  padding: 0 4px 8px; border-bottom: 1px dashed #262b4d;
}
.evo-feed-head .feed-spacer { flex: 1; }
.evo-feed .journal { max-height: 260px; overflow-y: auto; padding-bottom: 10px; }
.evo-tag {
  font-size: 11px; border-radius: 4px; padding: 1px 6px; margin-right: 4px; white-space: nowrap;
}
.evo-tag.manual { background: rgba(124, 91, 255, .15); color: #a99cff; }
.evo-tag.auto { background: rgba(53, 208, 127, .12); color: var(--ok); }

/* ===== 访问凭据门（Bearer Token） ===== */
.auth-trigger {
  background: var(--bg3); color: var(--muted);
  border: 1px solid #2e3460; border-radius: 20px;
  padding: 4px 12px; font-size: 12px; cursor: pointer;
  font-family: inherit; white-space: nowrap; transition: all .15s;
}
.auth-trigger:hover { border-color: var(--accent); color: var(--fg); }
.auth-trigger.authed {
  background: rgba(53, 208, 127, .13);
  border-color: var(--ok);
  color: var(--ok);
  font-weight: 600;
}
.auth-trigger.authed:hover { border-color: var(--ok); color: var(--ok); }
.auth-gate {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(8, 10, 20, .72);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
}
.auth-card {
  background: var(--bg2); border: 1px solid #262b4d; border-radius: var(--radius);
  padding: 26px 28px; width: min(420px, 92vw);
  display: flex; flex-direction: column; gap: 12px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .45);
}
.auth-card h2 { margin-bottom: 0; }
.auth-card input { width: 100%; font-family: var(--mono); }
.auth-actions { display: flex; gap: 10px; }
.auth-actions button { flex: 1; }

/* ===== 进化 / 记忆 / 模型 / 系统 ===== */
/* 注：#view-earning 必须在这个列表里（2026-09-27 补）—— 漏了它时创收页继承 .view 的 overflow:hidden，
   内容一长就被裁掉且整页不能滚（实测 scrollHeight 1774 / clientHeight 790，主人报「显示不全、下不去」）。 */
#view-overview, #view-evolution, #view-memory, #view-modules, #view-learnhub, #view-configsys, #view-earning { overflow-y: auto; padding: 22px; flex-direction: column; gap: 16px; }
.evo-card, .mem-card, .models-card, .sys-card {
  background: var(--bg2); border: 1px solid #262b4d; border-radius: var(--radius);
  padding: 18px 20px;
}
h2 { font-size: 16px; margin-bottom: 8px; }
.desc { font-size: 13px; color: var(--muted); margin-bottom: 14px; line-height: 1.6; }
.evo-controls, .mem-controls, .models-actions, .sys-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.evo-controls input { flex: 1; min-width: 260px; }
button {
  background: var(--bg3); color: var(--fg); border: 1px solid #2e3460;
  border-radius: 8px; padding: 8px 16px; cursor: pointer; font-size: 14px;
  font-family: inherit; transition: all .15s;
}
button:hover { border-color: var(--accent); }
button.primary { background: linear-gradient(135deg, var(--accent), var(--accent2)); border: none; color: #fff; font-weight: 600; }
button.danger { background: rgba(255,92,92,.15); border-color: var(--danger); color: var(--danger); }
button.ghost { background: transparent; }
.evo-status { margin-top: 12px; font-size: 13px; color: var(--muted); }
.journal, .mem-list { list-style: none; margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.journal li, .mem-list li {
  background: var(--bg3); border-radius: 8px; padding: 10px 14px; font-size: 13px;
  display: flex; flex-direction: column; gap: 4px;
}
.journal .j-title { font-weight: 600; }
.journal .j-meta { font-size: 11px; color: var(--muted); }
.run-time {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent);
  background: rgba(91, 140, 255, .08);
  border-radius: 4px;
  padding: 1px 6px;
  margin-right: 4px;
  white-space: nowrap;
}
.journal .j-status { font-weight: 700; }
.j-status.applied { color: var(--ok); }
.j-status.rolled_back { color: var(--danger); }
.j-status.halt { color: var(--warn); }
.mem-list li .mem-text { white-space: pre-wrap; word-break: break-word; }
.mem-list li .mem-tags { font-size: 11px; color: var(--muted); }
.mem-list li button { float: right; padding: 2px 8px; font-size: 11px; }
.models-table { width: 100%; border-collapse: collapse; margin-top: 6px; font-size: 13px; }
.models-table th, .models-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid #262b4d; vertical-align: middle; }
.models-table th { color: var(--muted); font-weight: 500; font-size: 12px; }
.models-table input { width: 100%; padding: 6px 8px; font-size: 12px; }
.models-table .key-cell input { font-family: var(--mono); }
.msg { margin-top: 12px; font-size: 13px; color: var(--muted); }
.msg.ok { color: var(--ok); }
.msg.bad { color: var(--danger); }
.sys-pre {
  background: var(--bg3); border-radius: 8px; padding: 14px; font-family: var(--mono);
  font-size: 12.5px; line-height: 1.7; overflow-x: auto; margin-top: 10px;
}
.small-btn { padding: 4px 10px; font-size: 12px; }
.spinner::after {
  content: ''; display: inline-block; width: 12px; height: 12px;
  border: 2px solid var(--muted); border-top-color: var(--accent);
  border-radius: 50%; animation: spin .8s linear infinite; vertical-align: middle; margin-left: 8px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== P0-4 统一反馈:提示条 + 骨架屏 ===== */
.toast-host {
  position: fixed; top: 62px; right: 14px; z-index: 998;
  display: flex; flex-direction: column; gap: 8px; max-width: min(420px, 92vw);
}
.toast {
  display: flex; align-items: flex-start; gap: 8px;
  background: var(--bg2); border: 1px solid #3a3f66; border-left-width: 4px; border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .45); padding: 9px 10px; font-size: 13px; line-height: 1.5;
  animation: toast-in .18s ease-out;
}
@keyframes toast-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.toast-ok { border-left-color: var(--ok); }
.toast-warn { border-left-color: var(--warn); }
.toast-bad { border-left-color: var(--danger); }
.toast-info, .toast-loading { border-left-color: var(--accent); }
.toast-icon { flex: none; }
.toast-text { flex: 1; word-break: break-word; }
.toast-x { flex: none; background: none; border: none; color: var(--muted); cursor: pointer; font-size: 12px; padding: 0 2px; }
.toast-x:hover { color: var(--fg); }
@media (max-width: 480px) { .toast-host { top: auto; bottom: 12px; right: 8px; left: 8px; max-width: none; } }

.sk-container { min-height: 28px; }
.sk-line {
  height: 12px; border-radius: 6px; margin: 8px 0;
  background: linear-gradient(90deg, rgba(139,144,176,.14) 25%, rgba(139,144,176,.30) 37%, rgba(139,144,176,.14) 63%);
  background-size: 400% 100%; animation: sk-shimmer 1.3s ease-in-out infinite;
}
@keyframes sk-shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
.sk-note { color: var(--muted); font-size: 12.5px; padding: 2px 0 4px; }
tr.sk-row td { padding: 2px 6px; }
tr.sk-row .sk-line { margin: 5px 0; }

/* ===== P0-3 危险操作三段式确认对话框 ===== */
.aios-dialog-mask {
  position: fixed; inset: 0; z-index: 999; display: flex; align-items: center; justify-content: center;
  background: rgba(8, 10, 20, .72); backdrop-filter: blur(2px); padding: 16px;
}
.aios-dialog {
  width: min(560px, 100%); max-height: 86vh; overflow: auto;
  background: var(--bg2); border: 1px solid #3a3f66; border-radius: var(--radius);
  box-shadow: 0 18px 60px rgba(0, 0, 0, .55); padding: 16px 18px;
}
.ad-title { font-size: 17px; line-height: 1.45; margin-bottom: 12px; }
.ad-sec { margin-bottom: 10px; }
.ad-k { color: var(--muted); font-size: 12px; letter-spacing: .5px; margin-bottom: 3px; }
.ad-v { font-size: 13.5px; line-height: 1.55; }
ul.ad-impacts { margin: 0; padding-left: 18px; }
ul.ad-impacts li { margin: 2px 0; }
.ad-miss { color: var(--warn); }
.ad-cost { color: var(--fg); }
.ad-rev-ok { color: var(--ok); }
.ad-rev-bad { color: var(--danger); }
.ad-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; flex-wrap: wrap; }
.ad-actions button { min-width: 108px; }
@media (max-width: 480px) { .ad-actions button { flex: 1; min-width: 0; } }

/* ===== P0-2 总览状态带(现在在跑吗/在干嘛/为什么没跑) ===== */
.pace-band {
  border: 1px solid #262b4d; border-left: 4px solid var(--muted); border-radius: var(--radius);
  background: rgba(31, 35, 64, .45); padding: 10px 12px; margin: 8px 0 12px;
}
.pace-band.ok { border-left-color: var(--ok); }
.pace-band.warn { border-left-color: var(--warn); }
.pace-band.bad { border-left-color: var(--danger); }
.pace-head { font-size: 16px; font-weight: 600; line-height: 1.4; }
.pace-band.ok .pace-head { color: var(--ok); }
.pace-band.warn .pace-head { color: var(--warn); }
.pace-band.bad .pace-head { color: var(--danger); }
.pace-sub { color: var(--muted); font-size: 13px; margin-top: 4px; word-break: break-word; }
.pace-facts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.pace-facts span {
  font-size: 12px; color: var(--muted); border: 1px solid #262b4d;
  border-radius: 999px; padding: 1px 8px; white-space: nowrap;
}
.pace-go { margin-top: 8px; }

/* ============ 移动端适配（手机/平板） ============ */
@media (max-width: 768px) {
  header { flex-wrap: wrap; gap: 8px; padding: 8px 10px; }
  .brand { font-size: 15px; }
  .tabs { order: 3; width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 2px; }
  .tab { flex: none; white-space: nowrap; padding: 6px 12px; font-size: 13px; }
  .statusbar { gap: 4px; }
  .statusbar .pill { font-size: 11px; padding: 2px 6px; }

  #view-chat { flex-direction: column; }
  .sidebar { width: 100%; max-height: 38vh; border-right: none; border-bottom: 1px solid var(--border); }
  .session-list { max-height: 26vh; }

  .messages { padding: 12px; }
  .msg-row { max-width: 92%; }
  .msg-row .msg-body { font-size: 15px; }

  .evo-card, .mem-card, .models-card, .sys-card { margin: 8px; padding: 12px; }
  .evo-controls { flex-wrap: wrap; }
  .evo-controls input { min-width: 60%; flex: 1; }
  .models-table { display: block; overflow-x: auto; }
  .sys-pre { font-size: 11px; }

  .composer { padding: 8px 10px; }
  .composer textarea { font-size: 16px; } /* 防 iOS 缩放 */
  .composer .send-btn { padding: 8px 14px; }
}
@media (max-width: 480px) {
  .brand .sub { display: none; }
  .statusbar .pill { display: none; }
  .statusbar .auth-trigger { font-size: 11px; padding: 2px 6px; }
  .messages { padding: 8px; }
  .msg-row { max-width: 100%; }
}

/* ---- 记忆面板 v2 (2026-09-06, 008) ---- */
.mem-stat-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin: 10px 0 6px; }
.mem-stat { background: var(--bg2); border: 1px solid rgba(255,255,255,.06); border-radius: 10px; padding: 10px 8px; text-align: center; }
.mem-stat .n { font-size: 20px; font-weight: 700; color: var(--accent); }
.mem-stat .n .cap { font-size: 12px; color: #778; font-weight: 400; }
.mem-stat .k { font-size: 11px; color: #889; margin-top: 2px; }
.mem-health { font-size: 12px; color: #889; margin: 6px 0 2px; }
.mem-health-bar { height: 6px; border-radius: 3px; background: var(--bg3); overflow: hidden; margin: 4px 0; }
.mem-health-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--ok), var(--accent)); border-radius: 3px; }
.mem-views { display: flex; gap: 6px; flex-wrap: wrap; margin: 12px 0 4px; }
.mem-view-btn { background: var(--bg2); border: 1px solid rgba(255,255,255,.08); color: #bbc; padding: 5px 12px; border-radius: 16px; cursor: pointer; font-size: 13px; }
.mem-view-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.mem-view-title { font-size: 13px; color: #889; margin: 8px 2px 2px; }
.mem-item { position: relative; padding-right: 76px; }
.mem-row1 { display: flex; align-items: center; gap: 8px; font-size: 12px; flex-wrap: wrap; }
.mem-layer { font-size: 11px; padding: 1px 8px; border-radius: 10px; background: var(--bg3); color: #ccd; white-space: nowrap; }
.mem-layer.l-fact { background: rgba(91,140,255,.16); color: #9db9ff; }
.mem-layer.l-experience { background: rgba(124,91,255,.16); color: #c3b4ff; }
.mem-layer.l-skill { background: rgba(53,208,127,.14); color: #7fe0ae; }
.mem-stars { color: #ffc53d; font-size: 12px; letter-spacing: 1px; white-space: nowrap; }
.mem-stars .dim { color: #3a3f5c; }
.mem-time { color: #778; white-space: nowrap; }
.mem-mentions { color: #a78bff; font-size: 11px; white-space: nowrap; }
.mem-tag { display: inline-block; font-size: 11px; color: #8ab; background: rgba(91,140,255,.12); border-radius: 8px; padding: 0 6px; margin: 0 3px 3px 0; }
.mem-ops { position: absolute; top: 10px; right: 12px; }
.mem-list li button { float: none; }
.mem-item .del, .mem-item .restore { padding: 3px 10px; border-radius: 6px; font-size: 11px; border: 1px solid rgba(255,255,255,.12); background: transparent; color: #aab; cursor: pointer; }
.mem-item .del:hover { color: var(--danger); border-color: var(--danger); }
.mem-item .restore:hover { color: var(--ok); border-color: var(--ok); }
.mem-empty { color: #667; text-align: center; padding: 26px; border: 1px dashed rgba(255,255,255,.12); border-radius: 10px; font-size: 13px; }
@media (max-width: 768px) { .mem-stat-grid { grid-template-columns: repeat(3, 1fr); } .mem-item { padding-right: 10px; } .mem-ops { position: static; margin-top: 6px; } }

/* ---- 记忆面板 v3 (2026-09-06): 加星/加载更多/档案柜筛选 ---- */
.mem-arch-filter { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 8px 0; }
.mem-arch-filter input { flex: 1; min-width: 160px; }
.mem-item .star { padding: 3px 10px; border-radius: 6px; font-size: 11px; border: 1px solid rgba(255,200,61,.35); background: transparent; color: #ffc53d; cursor: pointer; }
.mem-item .star:hover { background: rgba(255,200,61,.12); border-color: #ffc53d; }
#mem-more-wrap { text-align: center; margin-top: 4px; }
#mem-more { color: var(--accent); border: 1px dashed rgba(91,140,255,.4); padding: 6px 22px; border-radius: 14px; background: transparent; cursor: pointer; font-size: 13px; }
#mem-more:hover { background: rgba(91,140,255,.1); }
@media (max-width: 768px) { .mem-ops { display: flex; gap: 6px; margin-top: 6px; } }

/* ===== 系统仪表盘 v2 (2026-09-07, 008: 人话卡片/健康快照/三系统协同) ===== */
.sys-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin: 10px 0 4px; }
.sys-grid .s-card { background: var(--bg2); border: 1px solid rgba(255,255,255,.06); border-radius: 10px; padding: 12px; }
.sys-grid .s-card .n { font-size: 19px; font-weight: 700; color: var(--accent); }
.sys-grid .s-card .n.ok { color: var(--ok); }
.sys-grid .s-card .n.warn { color: var(--warn); }
.sys-grid .s-card .n.bad { color: var(--danger); }
.sys-grid .s-card .k { font-size: 11px; color: #889; margin-top: 3px; line-height: 1.5; }
.sys-bar { height: 6px; border-radius: 3px; background: var(--bg3); overflow: hidden; margin: 6px 0 3px; }
.sys-bar i { display: block; height: 100%; border-radius: 3px; transition: width .4s; }
.sys-bar i.low { background: linear-gradient(90deg, var(--ok), #7fe0ae); }
.sys-bar i.mid { background: linear-gradient(90deg, var(--warn), #ffcf6e); }
.sys-bar i.high { background: linear-gradient(90deg, var(--danger), #ff8a8a); }
.sys-warnings { display: flex; flex-direction: column; gap: 5px; margin-top: 8px; }
.sys-warnings .w-item { font-size: 12.5px; background: rgba(255,176,32,.08); border: 1px solid rgba(255,176,32,.3); color: #ffd27a; border-radius: 8px; padding: 6px 10px; }
.sys-warnings .w-crit { background: rgba(255,92,92,.1); border-color: var(--danger); color: #ff9c9c; }
.sys-ok-note { font-size: 12.5px; color: var(--ok); background: rgba(53,208,127,.08); border: 1px solid rgba(53,208,127,.25); border-radius: 8px; padding: 6px 10px; margin-top: 8px; }
.sys-fusion-node { border-top: 2px solid var(--accent); }
.sys-fusion-node.hermes { border-top-color: var(--ok); }
.sys-fusion-node.dsh { border-top-color: var(--accent2); }
.sys-fusion-node .t { font-size: 13px; font-weight: 700; margin-bottom: 6px; }
.sys-fusion-node .st { font-size: 12px; line-height: 1.6; color: #bbc; }

/* 会话行操作(对话页) */
.sess-op { background: transparent; border: none; color: var(--muted); cursor: pointer; font-size: 12px; padding: 0 3px; opacity: 0; transition: opacity .15s; }
.session-list li:hover .sess-op { opacity: 1; }
.sess-op:hover { color: var(--fg); }
.sess-op.del:hover { color: var(--danger); }
.agent-desc { font-size: 11.5px; color: var(--muted); line-height: 1.5; background: var(--bg3); border-radius: 8px; padding: 6px 10px; }
.agent-map-item { display: flex; flex-direction: column; gap: 2px; }
.agent-map-item .am-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.agent-map-item .am-name { font-weight: 700; }
.agent-map-item .am-badge { font-size: 11px; padding: 1px 8px; border-radius: 10px; background: rgba(91,140,255,.14); color: #9db9ff; white-space: nowrap; }
.agent-map-item .am-desc { font-size: 11.5px; color: #889; }
.bl-toolbar .bl-view.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.bl-ops { float: right; }
.bl-act { cursor: pointer; font-size: 11px; padding: 1px 6px; border-radius: 6px; border: 1px solid rgba(255,255,255,.12); margin-left: 4px; color: #aab; }
.bl-act:hover { border-color: var(--accent); color: var(--fg); }
.bl-act.del:hover { color: var(--danger); border-color: var(--danger); }
.bl-act.done:hover { color: var(--ok); border-color: var(--ok); }
#bl-result { white-space: pre-wrap; word-break: break-word; font-size: 12px; }
@media (max-width: 768px) { .sess-op { opacity: 1; } }
/* 模块管理 code 样式 */
.mod-detail code, .mod-domain code { background: rgba(128,128,128,.12); padding: 0 4px; border-radius: 4px; font-size: 12px; }
/* ===== 进化中心二级子导航 + 模块中心组合树视图 (2026-09-06, 008) ===== */
.subnav {
  display: flex; gap: 6px; flex-wrap: wrap;
  position: sticky; top: -6px; z-index: 6;
  background: var(--bg);
  padding: 10px 2px 8px; margin: -10px -2px 0;
}
.subtab {
  background: transparent; color: var(--muted); border: 1px solid transparent;
  padding: 6px 15px; border-radius: 8px; cursor: pointer; font-size: 13.5px;
  font-family: inherit; transition: all .15s;
}
.subtab:hover { background: var(--bg3); color: var(--fg); border-color: #2e3460; }
.subtab.active {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff; font-weight: 600; border-color: transparent;
}
.subpage { display: none; flex-direction: column; gap: 16px; width: 100%; }
.subpage.active { display: flex; }
#mc-tbody tr.mod-row-child td:first-child { padding-left: 30px; }
.mod-tree-guide { color: var(--accent2); opacity: .75; margin-right: 6px; font-size: 12px; }
@media (max-width: 768px) {
  .subnav { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .subtab { white-space: nowrap; }
}

/* ===== 模块页中文说明层 (008: 悬停弹中文说明 + 代码名弱化显示) ===== */
.tip { position: relative; cursor: help; border-bottom: 1px dotted rgba(139,144,176,.65); }
.tip:hover::after, .tip:active::after {
  content: attr(data-tip);
  position: absolute; left: 0; top: calc(100% + 7px); z-index: 80;
  width: max-content; max-width: 320px;
  padding: 7px 11px; border-radius: 8px;
  background: #10142b; border: 1px solid #2e3460;
  color: var(--fg); font-size: 12px; line-height: 1.75;
  box-shadow: 0 8px 24px rgba(0,0,0,.5);
  white-space: normal; text-align: left; font-weight: 400;
}
.zhcode { opacity: .5; font-family: var(--mono); font-size: 11px; margin-left: 6px; font-weight: 400; }
.mc-tip-note { font-size: 12px; color: var(--muted); margin: 2px 0 8px; line-height: 1.8; }
.mod-table th { white-space: nowrap; }

/* ===== 模块页滚动修复 + 表格横滑 (2026-09-07, 008 P0/P2 前端) ===== */
#view-modules { overflow-y: auto; padding: 22px; flex-direction: column; gap: 16px; }
.mc-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 8px; }
.mod-table { width: 100%; border-collapse: collapse; min-width: 920px; }
.mod-table th { text-align: left; font-size: 12px; font-weight: 500; color: var(--muted); padding: 9px 10px; border-bottom: 1px solid #2e3460; }
.mod-table td { padding: 9px 10px; border-bottom: 1px solid rgba(255,255,255,.045); vertical-align: middle; }
.mod-table tr.mod-row:hover td { background: rgba(91,140,255,.06); }
.mod-table td.ops { white-space: nowrap; }
.mod-table td.ops button { padding: 3px 9px; font-size: 12px; }
@media (max-width: 768px) {
  #view-modules { padding: 10px; }
  .mod-table { min-width: 860px; }
  .mc-table-wrap { margin: 0 -2px; }
}

/* ===== 手机端第二轮: 模块表精简列 + safe-area + 现代视口 (2026-09-06b, 008) ===== */
@supports (height: 100dvh) { body { height: 100dvh; } }
@media (max-width: 768px) {
  /* 11 列在手机上太挤: 保留 模块/状态/画像/遥测/操作, 其余列进行详情(点行可见) */
  .mod-table { min-width: 430px; }
  .mod-table th:nth-child(2), .mod-table td:nth-child(2),
  .mod-table th:nth-child(3), .mod-table td:nth-child(3),
  .mod-table th:nth-child(5), .mod-table td:nth-child(5),
  .mod-table th:nth-child(7), .mod-table td:nth-child(7),
  .mod-table th:nth-child(8), .mod-table td:nth-child(8),
  .mod-table th:nth-child(10), .mod-table td:nth-child(10) { display: none; }
  .mod-table th, .mod-table td { padding: 7px 6px; font-size: 12.5px; }
  .mod-table td.ops button { padding: 3px 6px; font-size: 11.5px; }
}
@media (max-width: 768px) {
  #view-modules { padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }
  #view-evolution, #view-memory, #view-models, #view-system, #view-earning { padding: 14px 12px calc(14px + env(safe-area-inset-bottom, 0px)); }
  .evo-card, .mem-card, .models-card, .sys-card { margin: 0 0 10px; padding: 12px; }
  .mod-table .mod-row td:first-child { min-width: 0; }
}

/* ===== 手机端第三轮: 标签自动换行全可见 + 空聊天引导 (2026-09-06c, 008) ===== */
.tabs { flex-wrap: wrap; row-gap: 4px; }
@media (max-width: 768px) {
  /* 关键修复: .tabs 基类带 flex:1(basis 0) 会与品牌/状态栏挤同一行被压到几十像素 → 菜单看不见。
     手机端强制独占整行(order 3 + flex-basis 100%),内部再自动换行,任意宽度全部标签可见。 */
  .tabs { flex: 1 1 100%; width: auto; order: 3; min-width: 0; row-gap: 6px; }
  .tab { flex: 1 1 30%; min-width: 100px; text-align: center; padding: 9px 4px; white-space: nowrap; }
  .brand-name { font-size: 16px; }
}
.messages { position: relative; }
.chat-empty {
  position: absolute; inset: 28% 18% auto; text-align: center;
  color: var(--muted); font-size: 13.5px; line-height: 2.1;
  pointer-events: none; opacity: .9;
}
@media (max-width: 768px) {
  /* 二级菜单同款病: .subnav 原为单行横滑(nowrap+overflow-x),5 项 531px 超 370px 容器 → 治理/日志在屏外。
     改为自动换行全可见;sticky 固定定位在换行多行下会遮内容,手机端改静态。 */
  .subnav { flex-wrap: wrap; overflow-x: visible; position: static; margin: 0; row-gap: 6px; }
  .subtab { text-align: center; }
}

/* 📊 度量中心(2026-09-07 · I10) */
.m-tbl { border-collapse: collapse; width: 100%; max-width: 640px; font-size: 13px; margin-top: 6px; }
.m-tbl th, .m-tbl td { border: 1px solid rgba(255,255,255,.09); padding: 5px 10px; text-align: left; font-variant-numeric: tabular-nums; }
.m-tbl th { background: var(--bg3); color: #99a; font-weight: 600; }
.m-tbl td { background: var(--bg2); color: #dde; }
tr.m-alert > td { background: rgba(255,120,80,.12) !important; color: #ffb09a; }
.rb-item { padding: 5px 0; border-bottom: 1px dashed rgba(255,255,255,.08); font-size: 12.5px; color: #dde; max-width: 760px; }
.rb-item .rb-t { color: #889; margin-right: 6px; font-variant-numeric: tabular-nums; }
.rb-item .rb-d { margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-trend { display: inline-flex; gap: 2px; align-items: flex-end; height: 24px; vertical-align: bottom; margin: 0 4px; }
.m-trend i { width: 6px; background: linear-gradient(180deg, var(--accent), #6fb0ff); border-radius: 2px; min-height: 2px; }
/* 自主学习成果页(2026-09-09,008) */
.sl-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)); gap: 8px; margin: 6px 0 2px; }
.sl-stat { background: rgba(255,255,255,.045); border: 1px solid rgba(255,255,255,.09); border-radius: 8px; padding: 10px 12px; }
.sl-stat b { display: block; font-size: 20px; font-variant-numeric: tabular-nums; margin-bottom: 2px; }
.sl-stat span { font-size: 12px; opacity: .8; }
/* 学习侧真尺卡(2026-09-25 · 规划 M1):一眼能看出分子/分母、窗口与口径 */
.sl-rulers { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.sl-ruler { background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.10); border-left: 3px solid rgba(110,170,255,.55); border-radius: 8px; padding: 10px 12px; }
.sl-ruler-h { font-size: 12px; opacity: .85; margin-bottom: 4px; }
.sl-ruler-v { font-size: 26px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.2; }
.sl-ruler-inline { font-size: 14px; font-weight: 400; opacity: .8; }
.sl-ruler-s { font-size: 12px; opacity: .85; margin-top: 3px; }
.sl-ruler-b { font-size: 11px; opacity: .55; margin-top: 5px; }
.sl-ruler-n { font-size: 12px; opacity: .8; margin-top: 4px; }
/* M10:最近学到的卡片里的引文块与「已被行动用过」标记(不新造视觉语言,沿用卡片内的弱化/强调层级) */
.sl-ruler-s .sl-quote { display: block; margin-top: 4px; font-size: 11.5px; line-height: 1.45; opacity: .78; border-left: 2px solid rgba(110,170,255,.45); padding-left: 6px; }
.sl-ruler-v .sl-ok { font-size: 13px; font-weight: 600; color: #6ddc9b; }
.sl-miss { opacity: .62; font-style: italic; font-size: 15px; }
/* 创收页 M3(2026-09-25):「未接入」必须与「0」在视觉上可区分 */
.earn-miss { opacity: .62; font-style: italic; font-size: 15px; }
.sl-chip { display: inline-block; padding: 2px 10px; border-radius: 999px; background: rgba(110,170,255,.14); border: 1px solid rgba(110,170,255,.3); margin: 2px 4px 2px 0; font-size: 12px; color: #cde; }
/* 批2 008:总览可点卡 + 占位壳 */
.ov-card { cursor: pointer; transition: transform .08s ease; }
.ov-card:hover { transform: translateY(-1px); }
.ov-card .s-card { height: 100%; }
.ph { border: 1px dashed rgba(160,180,220,.35); border-radius: 8px; padding: 10px 12px; margin: 4px 0; font-size: 12.5px; color: #99a; background: rgba(140,160,220,.05); line-height: 1.8; }
/* API 文档页(2026-09-09,008) */
.api-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.api-table td { padding: 2px 8px 2px 0; border-bottom: 1px solid rgba(255,255,255,.05); vertical-align: top; }
.api-table td code { font-family: Consolas, monospace; font-size: 11.5px; }
.api-m { display: inline-block; min-width: 52px; color: #8fd; }

/* ===== P0-5 窄屏导航折叠 + 状态点不再整体隐藏(2026-09-18) =====
   背景:原来 ≤768px 的标签条是 overflow-x:auto 横着滚;≤480px 直接把状态点 display:none,
   等于在手机上"藏功能+丢状态"。现在:标签条收进汉堡菜单(7 域全可达),状态点保底显示。 */
.nav-toggle {
  display: none; align-items: center; gap: 4px;
  background: var(--bg3); color: var(--fg); border: 1px solid #262b4d;
  border-radius: 8px; padding: 7px 12px; font-size: 13px; cursor: pointer; white-space: nowrap;
}
.nav-toggle:hover { background: #262b4d; }
@media (max-width: 768px) {
  .topbar { gap: 10px; }
  .nav-toggle { display: inline-flex; }
  .tabs {
    display: none; order: 3; width: 100%; flex: none;
    flex-wrap: wrap; gap: 6px; overflow-x: visible; padding: 6px 0 2px;
    border-top: 1px solid #262b4d; margin-top: 4px;
  }
  body.nav-open .tabs { display: flex; }
  .tab { flex: 1 1 46%; text-align: left; padding: 10px 12px; font-size: 14px; }
  .statusbar { flex-wrap: wrap; gap: 4px; }
}
@media (max-width: 480px) {
  /* 覆盖旧规则(.pill{display:none}):状态点是"有没有出问题"的唯一入口,不能藏 */
  .statusbar .pill { display: inline-block; font-size: 10.5px; padding: 2px 6px; }
  .brand .tagline { display: none; }
}

/* ===== P0-6 面包屑(域 › 子页;可点回上级) ===== */
.crumb {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
  padding: 5px 18px; font-size: 12.5px; color: var(--muted);
  background: rgba(15, 18, 32, .55); border-bottom: 1px solid #262b4d;
}
.crumb-link {
  background: none; border: none; padding: 0; cursor: pointer;
  color: var(--accent); font-size: 12.5px; font-family: inherit;
}
.crumb-link:hover { text-decoration: underline; }
.crumb-sep { color: #4a5070; }
.crumb-cur { color: var(--fg); font-weight: 600; }
@media (max-width: 768px) { .crumb { padding: 4px 12px; font-size: 12px; } }

/* ===== P1-3 待办筛选/批量选择 + 技能检索 ===== */
.bl-filter input, .bl-filter select, .bl-bulk input[type=checkbox], #sk-q {
  background: var(--bg3); color: var(--fg); border: 1px solid #2c3157; border-radius: 6px;
  padding: 5px 8px; font-size: 13px; font-family: inherit;
}
.bl-filter input:focus, #sk-q:focus { outline: 1px solid var(--accent); }
#auto-backlog li.bl-hit { background: rgba(91, 140, 255, .06); }
.bl-pick { margin-right: 6px; vertical-align: middle; }
#bl-sel-info.on { color: var(--accent); }
#sk-hits ul.journal { margin-top: 6px; }


/* ===== P2-2 ⌘K 命令面板(2026-09-20) =====
   独立组件样式;遮罩点击关闭在 palette.js 里绑定,这里只管外观与移动端可用性。 */
.palette-mask {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0, 0, 0, 0.45);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 8vh 12px 12px;
}
.palette-box {
  width: 100%; max-width: 680px; max-height: 74vh;
  background: var(--card, #1b1f24); border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px; box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  display: flex; flex-direction: column; overflow: hidden;
}
.palette-input {
  width: 100%; box-sizing: border-box; padding: 12px 14px; font-size: 15px;
  background: transparent; border: none; border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  color: inherit; outline: none;
}
.palette-list { overflow-y: auto; padding: 4px 0; }
.palette-row {
  display: flex; align-items: baseline; gap: 8px;
  padding: 7px 12px; cursor: pointer; border-left: 3px solid transparent;
}
.palette-row.active { background: rgba(255, 255, 255, 0.08); border-left-color: #3b7dd8; }
.palette-src {
  flex: 0 0 auto; font-size: 11px; opacity: 0.75;
  border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 4px; padding: 0 5px;
}
.palette-label { flex: 1 1 auto; font-size: 13.5px; line-height: 1.45; word-break: break-word; }
.palette-hint { flex: 0 0 auto; font-size: 11.5px; opacity: 0.7; }
.palette-foot { padding: 6px 12px; border-top: 1px solid rgba(255, 255, 255, 0.1); }
@media (max-width: 480px) {
  .palette-mask { padding: 4vh 6px 6px; }
  .palette-box { max-height: 84vh; }
  .palette-hint { display: none; }   /* 手机窄屏:hint 让位给标题 */
}


/* ===== P2-5 移动端底部导航 + 一键语音(2026-09-20) =====
   为什么:手机上顶栏在屏幕最上方,单手拇指够不到;7 域要展开汉堡才能点,播报入口更是没有。
   契约变更(≤768px):底栏接管主导航 —— 顶栏标签条与汉堡让位(避免两套导航并存);
   桌面端(>768px)底栏不显示、顶栏完全照旧。触控目标高度 ≥44px 是系统级可用性下限,不做妥协。 */
.bottom-nav { display: none; }
@media (max-width: 768px) {
  .bottom-nav {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 900;
    background: var(--bg2, #151a2e); border-top: 1px solid #262b4d;
    padding: 4px 4px calc(4px + env(safe-area-inset-bottom, 0px));
    gap: 2px; justify-content: space-between;
  }
  .bottom-nav .bn-item {
    flex: 1 1 0; min-width: 0; min-height: 44px;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
    background: transparent; border: none; color: var(--muted); font-size: 10px;
    padding: 4px 2px; cursor: pointer; border-radius: 8px;
  }
  .bottom-nav .bn-ico { font-size: 17px; line-height: 1.1; }
  .bottom-nav .bn-item.active { color: var(--fg); background: rgba(255, 255, 255, 0.07); }
  .bottom-nav .bn-item.playing { color: #f0b429; }
  .bottom-nav .bn-label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  body { padding-bottom: 62px; }                 /* 内容不被底栏遮住 */
  .toast-host { bottom: 68px !important; }       /* 提示条上移,别被底栏压住 */
  .nav-toggle, .tabs { display: none !important; } /* 顶栏导航在手机让位给底栏 */
}

/* 【P2-6 只读访客态】只有只读凭据被拿来做写操作时才出现的常驻横幅 */
.ro-banner{position:fixed;left:0;right:0;bottom:0;z-index:60;padding:8px 12px;text-align:center;
  font-size:13px;background:#7c2d12;color:#fed7aa;border-top:1px solid #ea580c;box-shadow:0 -2px 8px rgba(0,0,0,.35)}
@media (max-width:768px){.ro-banner{bottom:56px;font-size:12px}} /* 768 以下有底栏,避开遮挡 */
