/* style.css — Z Remote H5 深色移动优先 */
:root {
  --bg: #0e0e11;
  --card: #17171c;
  --card2: #1d1d24;
  --border: #26262e;
  --text: #e8e8ea;
  /* v0.8.3(P1-7):次要灰字提亮至 ≥#A8A8A8(旧 #9a9aa3 对比不足) */
  --text2: #a9a9b2;
  --text3: #8b8b96;
  --accent: #5b7cfa;
  /* v0.8.3(P0-2):主操作按钮专用蓝(白图标对比 4.9:1 ≥ 4.5:1;--accent 白字仅 3.7:1) */
  --accent-strong: #4263eb;
  --accent-dim: #3a53ad;
  --success: #3fb27f;
  --warn: #e0a458;
  --danger: #e05c5c;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --kb-inset: 0px; /* 键盘高度(visualViewport 实时写入,iOS 弹键盘不缩布局视口的补偿) */
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
/* v0.10.13:锁宽——任何子树超宽都不允许产生页面级横向滚动(顶栏曾 404px/390 视口,整页可横拖) */
html, body { height: 100%; overflow-x: hidden; }
body {
  background: var(--bg); color: var(--text);
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", "Segoe UI", sans-serif;
  overscroll-behavior: none;
}
/* P0-3:dvh(Dynamic Viewport Height)适配 iPhone 12 Pro 等机型底部工具栏遮挡;
   100dvh 随浏览器 chrome 显隐动态缩放,确保 composer 始终可见;
   不支持 dvh 的旧浏览器退化到 100%(等同原有行为) */
#app { height: 100%; display: flex; flex-direction: column; }
@supports (height: 100dvh) {
  #app { height: 100dvh; }
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, textarea, select { font: inherit; color: var(--text); background: var(--card2); border: 1px solid var(--border); border-radius: 10px; outline: none; }
input:focus, textarea:focus, select:focus { border-color: var(--accent); }
a { color: var(--accent); }
::-webkit-scrollbar { width: 0; height: 0; }

/* ---------- 通用 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 0 18px; border-radius: 12px;
  background: var(--accent); color: #fff; font-weight: 600;
  transition: transform .12s ease, opacity .12s ease;
}
.btn:active { transform: scale(.97); }
.btn[disabled] { opacity: .4; }
.btn.ghost { background: var(--card2); color: var(--text); border: 1px solid var(--border); }
.btn.danger { background: var(--danger); }
.btn.small { min-height: 34px; padding: 0 12px; border-radius: 9px; font-size: 14px; }

#toast-root { position: fixed; left: 0; right: 0; bottom: calc(90px + var(--sab) + var(--kb-inset)); display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 99; pointer-events: none; }
.toast {
  max-width: 86vw; padding: 10px 16px; border-radius: 10px; font-size: 14px;
  background: #2a2a33; color: var(--text); box-shadow: 0 4px 18px rgba(0,0,0,.5);
  animation: fadein .15s ease;
}
.toast.err { background: #3a2226; color: #ffb4b4; }
/* 带操作按钮的 toast(归档撤销等) */
.toast.act { display: flex; align-items: center; gap: 12px; }
.toast-act { color: var(--accent); font-weight: 700; background: none; border: 0; padding: 0; font-size: 14px; }

@keyframes fadein { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

.spin { display: inline-block; width: 14px; height: 14px; border: 2px solid var(--text2); border-top-color: transparent; border-radius: 50%; animation: rot .8s linear infinite; vertical-align: -2px; }
@keyframes rot { to { transform: rotate(360deg); } }

.offline-bar, .reconn-bar {
  padding: 6px 12px; text-align: center; font-size: 13px;
  background: #3a2f1c; color: var(--warn);
}
.reconn-bar { background: #2a2a33; color: var(--text2); }
.machine-bar {
  padding: 8px 14px; font-size: 13px;
  background: #1c2a3a; color: #9ecfff;
  border-bottom: 1px solid var(--border);
}
.machine-bar .link {
  background: transparent; border: none; color: var(--accent);
  text-decoration: underline; padding: 0; margin-left: 4px;
  font-size: 13px; cursor: pointer;
}

/* ---------- 登录页 ---------- */
.login-wrap { flex: 1; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-card { width: 100%; max-width: 360px; background: var(--card); border: 1px solid var(--border); border-radius: 18px; padding: 32px 24px; }
.login-card h1 { font-size: 22px; margin-bottom: 4px; }
.login-card .sub { color: var(--text2); font-size: 14px; margin-bottom: 24px; }
.login-card input { width: 100%; height: 48px; padding: 0 14px; margin-bottom: 14px; }
.login-card .btn { width: 100%; }
.login-err { color: var(--danger); font-size: 13px; min-height: 20px; margin-bottom: 8px; }

/* ---------- 顶栏 ---------- */
/* v0.10.13:三层独立布局——顶栏 sticky 吸顶(z-index 提到 20 盖住内容层);
   min-width:0 让 flex 子项可收缩,配合 html/body overflow-x:hidden 根治横溢 */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 10px;
  min-width: 0;
  padding: calc(8px + var(--sat)) 14px 8px;
  background: rgba(14,14,17,.92); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  overscroll-behavior: contain;
}
.topbar h1 { font-size: 17px; font-weight: 700; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.machine-select { font: inherit; font-size: 13px; color: var(--text); background: var(--card2); border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; outline: none; min-width: 0; }
.machine-select:focus { border-color: var(--accent); }
.icon-btn { flex: none; width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; color: var(--text2); font-size: 19px; }
.icon-btn:active { background: var(--card2); }
/* v0.10.13:窄屏(≤420px,全部手机竖屏)顶栏紧凑——收窄选择器/图标,
   低频动作(刷新/添加设备)收进 ⋮ 菜单(菜单内恒有,功能不减);
   作用域限 .topbar-list:fleet 页 btn-refresh 是其顶栏唯一刷新入口,不可隐藏 */
@media (max-width: 420px) {
  .topbar { gap: 8px; padding-left: 10px; padding-right: 10px; }
  .topbar .icon-btn { width: 36px; height: 36px; font-size: 17px; }
  .machine-select { max-width: 88px; padding: 6px 8px; }
  .topbar-list #btn-refresh,
  .topbar-list #btn-machine-add { display: none; }
}

/* ---------- 搜索与筛选(对标 Claude App 极简设计) ---------- */
.list-tools { padding: 10px 14px; background: var(--bg); border-bottom: 1px solid var(--border); }
.search-box {
  display: flex; align-items: center; gap: 8px;
  background: var(--card2); border: 1px solid var(--border); border-radius: 12px;
  padding: 10px 12px; margin-bottom: 10px;
}
.search-box:focus-within { border-color: var(--accent); }
.search-ico { font-size: 16px; color: var(--text2); flex-shrink: 0; }
.search-box input {
  flex: 1; background: none; border: 0; outline: none;
  font-size: 15px; color: var(--text);
  -webkit-appearance: none; appearance: none;
}
.search-box input::placeholder { color: var(--text2); }
.search-box input::-webkit-search-cancel-button { display: none; }
.search-clear {
  width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; background: var(--card); color: var(--text2); font-size: 18px;
  flex-shrink: 0; transition: opacity .15s ease;
}
.search-clear:active { background: var(--border); }
/* v0.8.3(P1-4):harness 筛选收进搜索框旁漏斗图标,首屏少一层 chrome */
.search-funnel {
  width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 8px; color: var(--text2); flex-shrink: 0; position: relative;
}
.search-funnel:active { background: var(--card); }
.search-funnel.on { color: var(--accent); }
.search-funnel.on::after {
  content: ''; position: absolute; top: 3px; right: 3px;
  width: 6px; height: 6px; border-radius: 50%; background: var(--accent);
}

.filter-chips {
  display: flex; gap: 8px; overflow-x: auto; -webkit-overflow-scrolling: touch;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge */
}
/* v0.8.3(P1-4):harness 条默认收起,漏斗点开;筛选激活时常开 */
.harness-row { display: none; margin-bottom: 4px; }
.harness-row.open { display: flex; }
.filter-chips::-webkit-scrollbar { display: none; /* Chrome/Safari */ }
.fchip {
  flex-shrink: 0; padding: 6px 14px; border-radius: 99px;
  background: var(--card2); border: 1px solid var(--border);
  font-size: 13px; color: var(--text2); white-space: nowrap;
  transition: all .15s ease;
}
.fchip:active { transform: scale(.96); }
.fchip.on {
  background: var(--accent); border-color: var(--accent);
  color: #fff; font-weight: 500;
}

/* ---------- 会话列表 ---------- */
/* v0.10.13:内容层独立滚动 + overscroll contain(滚到头不传导给页面,顶栏拖动同理) */
.view { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.wrap { max-width: 760px; margin: 0 auto; padding: 10px 14px calc(20px + var(--sab)); }
/* P1-6 修复:桌面端充分利用宽度 */
@media (min-width: 1024px) {
  .wrap { max-width: 960px; }
  .msgs-inner { max-width: 960px; }
  .composer-inner { max-width: 960px; }
}

/* 左滑操作(对标 iOS Mail / Claude App):actions 绝对定位藏在卡片右缘,卡片左移露出 */
.sess-row { position: relative; overflow: hidden; margin-bottom: 10px; border-radius: 14px; touch-action: pan-y; }
.sess-row .sess-item { margin-bottom: 0; position: relative; z-index: 1; transition: transform .18s ease; touch-action: pan-y; }
.sess-actions { position: absolute; top: 0; right: 0; bottom: 0; display: flex; z-index: 0; }
.swipe-act { width: 76px; height: 100%; color: #fff; font-size: 14px; font-weight: 600; }
.swipe-act.pin { background: var(--accent); }
.swipe-act.arch { background: var(--danger); }
.swipe-act.arch.restore { background: var(--success); }
/* 归档折叠移除(配合 JS 先定高再加 .gone) */
.sess-row.gone { transition: height .2s ease, opacity .2s ease, margin-bottom .2s ease; height: 0 !important; opacity: 0; margin-bottom: 0; }

.sess-item {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  background: var(--card); border: 1px solid var(--border); border-radius: 14px;
  padding: 13px 14px; margin-bottom: 10px;
}
/* 入场动画只给非静默渲染(进列表/手动刷新);15s 轮询静默刷新不播,否则半透明瞬间露出左滑操作钮+卡片位移(owner 2026-07-24 反馈) */
.anim-in .sess-item { animation: fadein .15s ease; }
.sess-item:active { background: var(--card2); }
.sess-main { flex: 1; min-width: 0; }
.sess-title { font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* v0.8.3(P0-3):标题行 = 标题 + 右侧主状态点(色点+文字),meta 行只留单色次要标签 */
.sess-head { display: flex; align-items: center; gap: 8px; }
.sess-head .sess-title { flex: 1; min-width: 0; }
.sess-status { flex: none; display: inline-flex; align-items: center; }
.sess-chev { color: var(--text2); flex: none; }
/* P1-5:最后消息预览(对标 Claude App) */
.sess-preview { font-size: 13px; color: var(--text2); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sess-meta { font-size: 12.5px; color: var(--text2); margin-top: 3px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
/* v0.8.3(P0-3):模型/Harness/设备/来源统一降为单色次要标签(≥12px),色彩噪声只留状态点 */
.meta-chip {
  font-size: 12px; color: var(--text2); background: var(--card2);
  border: 1px solid var(--border); border-radius: 6px; padding: 1px 7px;
  white-space: nowrap;
}
/* v0.8.3(P1-7):路径等等宽信息加轻微底色区块 */
.path-chip {
  font-family: var(--mono); font-size: 11.5px; color: var(--text2);
  background: var(--card2); border: 1px solid var(--border);
  border-radius: 6px; padding: 1px 6px;
  max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; padding: 1px 8px; border-radius: 99px; border: 1px solid var(--border); color: var(--text2); }
.badge.busy { color: var(--accent); border-color: var(--accent-dim); }
.badge.pending { color: var(--warn); border-color: #57431f; }
.badge.archived { opacity: .7; }
.empty { text-align: center; color: var(--text2); padding: 60px 20px; font-size: 14px; }
/* v0.10.6:加载失败重试入口(消息列表首载 / 智能层快照)。复用 accent 链接色,加粗+可点。 */
.load-retry { padding: 60px 20px; }
.retry-link { color: var(--accent); font-weight: 600; cursor: pointer; text-decoration: none; }
.retry-link:hover { text-decoration: underline; }
.retry-msg { color: var(--text2); }
.menu { position: relative; }
/* P2-2 修复:菜单弹出增加过渡动画 */
.menu-pop {
  position: absolute; right: 0; top: 46px; min-width: 170px; z-index: 30;
  background: var(--card2); border: 1px solid var(--border); border-radius: 12px; padding: 6px;
  box-shadow: 0 8px 30px rgba(0,0,0,.55);
  animation: fadein .12s ease;
}
/* v0.8.3(P1-5):菜单项 = 前置图标 + 文案(两列对齐);置灰项沉底 + 分隔线 */
.menu-pop button { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 11px 12px; border-radius: 8px; font-size: 15px; }
.menu-pop button:active { background: var(--card); }
.menu-ico { flex: none; width: 20px; text-align: center; font-size: 15px; }
.menu-txt { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.menu-lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* v0.8.3(P1-11):置灰项不再用 opacity 压对比(旧 .45 后 <3:1),改实色灰 ≥3:1 */
.menu-pop button.menu-disabled { color: #82828c; cursor: default; }
.menu-pop button.menu-disabled .menu-ico { opacity: .6; }
.menu-pop button.menu-disabled:active { background: transparent; }
.menu-sub { display: block; font-size: 11px; color: var(--text2); margin-top: 1px; }
.menu-sep { height: 1px; background: var(--border); margin: 6px 8px; }

/* ---------- 弹层 ---------- */
.mask { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 40; display: flex; align-items: flex-end; justify-content: center; }
.sheet {
  width: 100%; max-width: 560px; max-height: 86vh; overflow-y: auto;
  background: var(--card); border: 1px solid var(--border); border-bottom: 0;
  border-radius: 18px 18px 0 0; padding: 20px 18px calc(20px + var(--sab));
  animation: sheetup .18s ease;
}
@keyframes sheetup { from { transform: translateY(30px); opacity: .5; } to { transform: none; opacity: 1; } }
.sheet h2 { font-size: 17px; margin-bottom: 16px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--text2); margin-bottom: 6px; }
.field input, .field select { width: 100%; height: 46px; padding: 0 12px; }
.field textarea { width: 100%; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.chip { font-size: 12.5px; padding: 5px 10px; border-radius: 99px; background: var(--card2); border: 1px solid var(--border); color: var(--text2); }
.chip.on { border-color: var(--accent); background: rgba(91,124,250,.12); color: var(--text); }
.ns-note { font-size: 12.5px; color: var(--text2); padding: 8px 0; line-height: 1.5; }
.sheet-row { display: flex; gap: 10px; margin-top: 18px; }
.sheet-row .btn { flex: 1; }
.switch-row { display: flex; align-items: center; justify-content: space-between; min-height: 46px; }

/* ---------- 聊天页 ---------- */
.msgs { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; overflow-anchor: auto; }
.msgs-inner { max-width: 760px; margin: 0 auto; padding: 14px 14px 8px; }
/* P2-3 修复:消息间距从 14px 收紧到 10px,增强对话感 */
.msg {
  margin-bottom: 10px;
  /* 视口外消息跳过布局/绘制:虚拟列表 80% 收益零 JS 成本(Safari 15.4+ 支持,旧浏览器退化) */
  content-visibility: auto;
  contain-intrinsic-size: 0 90px;
}
.msg.user { display: flex; justify-content: flex-end; }
.msg.user .bubble {
  max-width: 82%; background: var(--accent); color: #fff;
  border-radius: 16px 16px 4px 16px; padding: 10px 14px;
  white-space: pre-wrap; word-break: break-word; font-size: 15px;
}
/* P2-4 修复:assistant bubble 内边距从 2px 增加到 4px 8px,避免内容贴边 */
.msg.assistant .bubble { padding: 4px 8px; font-size: 15px; word-break: break-word; }
.msg .role { font-size: 11.5px; color: var(--text2); margin-bottom: 4px; }
.msg .files { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.file-pill { font-size: 12px; padding: 4px 10px; border-radius: 8px; background: var(--card2); border: 1px solid var(--border); color: var(--text2); }
.chat-thumb { max-width: 160px; max-height: 160px; border-radius: 10px; border: 1px solid var(--border); cursor: zoom-in; object-fit: cover; }
.chat-thumb:active { transform: scale(1.02); }
.img-lightbox { position: fixed; inset: 0; z-index: 9999; background: rgba(0,0,0,.92); display: flex; align-items: center; justify-content: center; cursor: zoom-out; }
.img-lightbox img { max-width: 94vw; max-height: 94vh; border-radius: 8px; }
.tool-preview { font-size: 12px; color: var(--text2); font-family: var(--mono); white-space: pre-wrap; word-break: break-all; max-height: 60px; overflow: hidden; }
.tool-full { font-size: 12px; color: var(--text2); font-family: var(--mono); white-space: pre-wrap; word-break: break-all; }

/* markdown */
.bubble p { margin: 6px 0; }
.bubble h1, .bubble h2, .bubble h3, .bubble h4 { margin: 14px 0 6px; line-height: 1.35; }
.bubble h1 { font-size: 19px; } .bubble h2 { font-size: 17.5px; } .bubble h3 { font-size: 16px; } .bubble h4 { font-size: 15px; }
.bubble ul, .bubble ol { margin: 6px 0 6px 22px; }
.bubble li { margin: 3px 0; }
.bubble blockquote { border-left: 3px solid var(--border); padding: 2px 12px; margin: 8px 0; color: var(--text2); }
.bubble hr { border: 0; border-top: 1px solid var(--border); margin: 12px 0; }
.bubble code.inline { font-family: var(--mono); font-size: 13px; background: var(--card2); border: 1px solid var(--border); border-radius: 5px; padding: 1px 5px; }
pre.code { background: #101014; border: 1px solid var(--border); border-radius: 12px; margin: 10px 0; overflow: hidden;
  /* 代码块延迟布局 */
  content-visibility: auto; contain-intrinsic-size: 0 120px;
}
pre.code .code-head { display: flex; justify-content: space-between; align-items: center; padding: 6px 12px; background: var(--card2); font-size: 12px; color: var(--text2); }
.copy-btn { font-size: 12px; color: var(--text2); padding: 2px 8px; border-radius: 6px; border: 1px solid var(--border); }
pre.code code { display: block; font-family: var(--mono); font-size: 13px; line-height: 1.5; padding: 12px; overflow-x: auto; white-space: pre; }
.table-wrap { overflow-x: auto; margin: 10px 0; }
table { border-collapse: collapse; font-size: 13.5px; min-width: 60%; }
th, td { border: 1px solid var(--border); padding: 6px 10px; text-align: left; }
th { background: var(--card2); }

/* tool / thinking 折叠卡 */
details.tool-card, details.think-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  margin: 8px 0; overflow: hidden;
  /* 闭合折叠卡跳过内部布局,打开时才做(配合 JS 惰性挂载,真正省 DOM 构建成本) */
}
details.tool-card:not([open]) .body, details.think-card:not([open]) .body { display: none; }
details.tool-card summary, details.think-card summary {
  list-style: none; cursor: pointer; padding: 9px 12px; font-size: 13px; color: var(--text2);
  display: flex; align-items: center; gap: 8px; user-select: none;
}
details.tool-card summary::-webkit-details-marker, details.think-card summary::-webkit-details-marker { display: none; }
.tool-name { font-family: var(--mono); font-size: 12.5px; color: var(--accent); }
.tool-sum { font-family: var(--mono); font-size: 11.5px; color: var(--text3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 55%; }
details.tool-card .body, details.think-card .body { padding: 0 12px 10px; font-family: var(--mono); font-size: 12px; color: var(--text2); white-space: pre-wrap; word-break: break-word; max-height: 320px; overflow-y: auto; }
details.think-card .body { color: #8b8b96; font-family: inherit; font-size: 13px; }
details.tool-card summary::after, details.think-card summary::after { content: "›"; margin-left: auto; transition: transform .12s; }
details[open].tool-card summary::after, details[open].think-card summary::after { transform: rotate(90deg); }
/* tool 惰性展开按钮 */
.tool-expand { display: block; margin-top: 6px; font-size: 12px; color: var(--accent); background: none; border: 0; padding: 4px 0; cursor: pointer; font-family: inherit; }
/* 长文本懒展开 */
.long-more { display: inline; color: var(--accent); cursor: pointer; font-size: 13px; }

/* 审批 / 提问卡 */
.action-card {
  position: sticky; top: 8px; z-index: 5;
  background: #221d14; border: 1px solid #57431f; border-radius: 14px;
  padding: 12px 14px; margin-bottom: 12px;
}
.action-card.q { background: var(--card); border-color: var(--accent-dim); }
.action-card .ac-title { font-size: 13.5px; font-weight: 600; color: var(--warn); margin-bottom: 6px; }
.action-card.q .ac-title { color: var(--accent); }
.action-card .ac-body { font-size: 13px; color: var(--text2); font-family: var(--mono); max-height: 140px; overflow-y: auto; white-space: pre-wrap; word-break: break-word; margin-bottom: 10px; }
.action-card .ac-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.ac-actions .btn { min-height: 38px; font-size: 14px; }
.opt-btn { display: block; width: 100%; text-align: left; background: var(--card2); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; font-size: 14.5px; }
.opt-btn.sel { border-color: var(--accent); background: rgba(91,124,250,.12); }
/* v0.6.3:选项名称/描述各占一行,单行省略号——治 iOS 原生 select 弹层字大且截断 */
.opt-btn .opt-label { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.opt-btn .opt-desc { display: block; font-size: 12px; color: var(--text2); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* v0.8.8:接力副本徽标(可点)+ 副本浮层项(chip + 单行摘要) */
.relay-badge { cursor: pointer; color: var(--accent); font-weight: 600; }
.relay-badge:active { opacity: .6; }
.relay-mirror-item { display: flex; align-items: center; }
.relay-mirror-item .rm-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* v0.6.3:新建面板自定义选择字段(替代原生 <select>),单行「名称 — 描述」超出省略号 */
/* v0.8.3(P0-1):右侧 16px chevron ⌄ 给出「这是个选择器,可点」的提示 */
.ns-pick { display: block; position: relative; width: 100%; min-height: 46px; padding: 11px 34px 11px 12px; background: var(--card2); border: 1px solid var(--border); border-radius: 10px; text-align: left; font-size: 14.5px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ns-pick::after { content: '⌄'; position: absolute; right: 10px; top: 50%; transform: translateY(-52%); font-size: 16px; line-height: 1; color: var(--text2); pointer-events: none; }
.ns-pick:active { border-color: var(--accent); }
.ns-pick-label { white-space: nowrap; }
.ns-pick-desc { color: var(--text2); font-size: 12.5px; }
/* v0.8.3(P1-10):harness 选中态统一蓝色实心 + 白字(对齐首页 fchip.on;旧细蓝描边与实心不一致) */
#ns-harness .chip.on { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 500; }
/* v0.8.3(P0-1):创建改 sticky 底部主按钮,字段再多也始终可见 */
.ns-create-bar {
  position: sticky; bottom: 0; z-index: 2;
  margin: 18px -18px calc(-20px - var(--sab));
  padding: 12px 18px calc(12px + var(--sab));
  background: var(--card); border-top: 1px solid var(--border);
}
.ns-create { width: 100%; min-height: 48px; font-size: 16px; background: var(--accent-strong); border-color: var(--accent-strong); }
/* v0.8.3(P2-12):Plan 模式原生 checkbox 改主题 Switch(选中蓝,触达区整行 ≥44px) */
.kr-switch-row { cursor: pointer; }
.kr-switch { position: relative; display: inline-block; width: 46px; height: 28px; flex: none; }
.kr-switch input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; margin: 0; cursor: pointer; }
.kr-switch i { position: absolute; inset: 0; border-radius: 99px; background: var(--card2); border: 1px solid var(--border); transition: background .15s ease, border-color .15s ease; pointer-events: none; }
.kr-switch i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--text2); transition: left .15s ease, background .15s ease; }
.kr-switch input:checked + i { background: var(--accent-strong); border-color: var(--accent-strong); }
.kr-switch input:checked + i::after { left: 21px; background: #fff; }

/* 回到底部 */
.to-bottom {
  position: absolute; right: 16px; bottom: 96px; z-index: 8;
  min-width: 40px; height: 40px; border-radius: 20px;
  background: var(--card2); border: 1px solid var(--border); color: var(--text2);
  display: flex; align-items: center; justify-content: center; font-size: 18px;
  padding: 0 12px; box-shadow: 0 4px 14px rgba(0,0,0,.4);
  white-space: nowrap;
}
.to-bottom.has-new {
  background: var(--accent); color: #fff; border-color: var(--accent);
  font-size: 13px; font-weight: 600; padding: 0 14px;
}

/* ---------- composer ---------- */
/* P0-3:底部安全区 + 键盘补偿;max() 兜底确保微信浏览器等 env() 返回 0 时仍有最小边距 */
.composer { border-top: 1px solid var(--border); background: rgba(14,14,17,.94); backdrop-filter: blur(12px); padding: 10px 12px max(calc(10px + var(--kb-inset)), calc(10px + var(--sab) + var(--kb-inset))); transition: padding-bottom .15s ease; }
.composer-inner { max-width: 900px; margin: 0 auto; position: relative; }
.attach-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.attach-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; background: var(--card2); border: 1px solid var(--border); border-radius: 8px; padding: 5px 8px; max-width: 220px; }
.attach-chip .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attach-chip .p { color: var(--accent); font-variant-numeric: tabular-nums; }
.attach-chip .x { color: var(--text2); font-size: 14px; padding: 0 2px; }
.input-row { display: flex; align-items: flex-end; gap: 10px; }
.input-row textarea {
  flex: 1; resize: none; max-height: 160px; min-height: 52px;
  padding: 14px 16px; border-radius: 16px; font-size: 16px; line-height: 1.5;
}
/* v0.6.7:他源详情输入框 #fd-input 字号/行高/padding/圆角与 Kimi 会话 #input(.input-wrap textarea)完全一致,
   修「字号过大、输入几字就折行溢出」;保留 .input-row 的 flex:1 内联发送键布局 */
#fd-input {
  font-size: 15px; line-height: 1.45;
  padding: 13px 14px; border-radius: 14px;
  min-height: 52px; max-height: 132px;
  background: var(--card2);
}
.round-btn {
  flex: none; width: 44px; height: 44px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--card2); border: 1px solid var(--border); color: var(--text2); font-size: 19px;
}
/* v0.8.3(P0-2):发送键统一为最强视觉——有内容蓝色实心白图标(对比 ≥4.5:1),空态降灰;
   Kimi 会话(.action-row)与他源详情(.input-row)同规格 40×40 */
.round-btn.send { background: var(--accent-strong); border-color: var(--accent-strong); color: #fff; }
.round-btn.send[disabled] { background: var(--card2); color: var(--text2); border-color: var(--border); }
.input-row .round-btn.send { width: 40px; height: 40px; font-size: 17px; flex: none; }
.round-btn:active { transform: scale(.95); }

/* / 指令面板 */
.slash-panel {
  position: absolute; left: 0; right: 0; bottom: calc(100% + 6px); z-index: 20;
  max-height: 300px; overflow-y: auto;
  background: var(--card2); border: 1px solid var(--border); border-radius: 14px; padding: 6px;
  box-shadow: 0 -6px 30px rgba(0,0,0,.5);
}
.slash-item { display: flex; gap: 10px; align-items: baseline; width: 100%; text-align: left; padding: 10px 12px; border-radius: 9px; }
.slash-item.sel { background: rgba(91,124,250,.16); }
.slash-item .cmd { font-family: var(--mono); font-size: 14px; color: var(--accent); flex: none; }
.slash-item .desc { font-size: 12.5px; color: var(--text2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- v0.2:状态反馈 ---------- */
/* 状态点(列表行/详情顶栏共用) */
.st { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; white-space: nowrap; }
.st .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text2); flex: none; }
.st-run { color: var(--success); }
.st-run .dot { background: var(--success); }
.st-pend { color: var(--warn); }
.st-pend .dot { background: var(--warn); }
.st-idle { color: var(--text2); }
.st-idle .dot { background: #4a4a55; }
.dot.pulse { animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .35; transform: scale(.8); }
}

/* 运行指示条(消息区底部) */
#runbar, #fd-runbar {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 6px 12px calc(4px + var(--sab) / 2);
  font-size: 13px; color: var(--text2);
  background: linear-gradient(transparent, rgba(14,14,17,.85));
}
.tdots { display: inline-flex; gap: 4px; }
.tdots i {
  width: 6px; height: 6px; border-radius: 50%; background: var(--accent);
  animation: tbounce 1.2s ease-in-out infinite;
}
.tdots i:nth-child(2) { animation-delay: .15s; }
.tdots i:nth-child(3) { animation-delay: .3s; }
@keyframes tbounce {
  0%, 100% { transform: translateY(0); opacity: .5; }
  50% { transform: translateY(-4px); opacity: 1; }
}

/* 消息回执状态 */
/* v0.8.3(P1-6):时间戳不再独占一行,浮动进气泡右下角(11px 次要灰;跨分钟才输出,见 shouldShowMsgTime) */
.msg-time { float: right; margin: 6px 0 0 12px; font-size: 11px; line-height: 1.4; opacity: .75; }
.msg.user .msg-time { color: rgba(255,255,255,.85); }
.msg.assistant .msg-time { color: var(--text2); }
.msg.user.pending .bubble { opacity: .88; }
.msg-status { font-size: 11.5px; color: rgba(255,255,255,.9); }
.msg-status.ok { color: #d6ffe9; }
.msg-status.queued { color: #ffe9c2; }
.msg-status.failed { color: #ffd2d2; text-decoration: underline; cursor: pointer; }
.msg-status .spin { border-color: rgba(255,255,255,.7); border-top-color: transparent; width: 11px; height: 11px; }

/* 骨架屏 */
.skel-item, .skel-msg {
  border-radius: 14px; margin-bottom: 10px;
  background: linear-gradient(90deg, var(--card) 25%, var(--card2) 50%, var(--card) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
}
.skel-item { height: 64px; }
.skel-msg { height: 74px; width: 86%; }
.skel-msg.w60 { width: 60%; margin-left: auto; }
@keyframes shimmer {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}

/* composer 提示条(待审批锁定/排队提示) */
.composer-hint {
  margin-bottom: 6px; padding: 7px 12px; border-radius: 10px;
  background: #2a2416; color: var(--warn); font-size: 13px; text-align: center;
}

/* ⚡/■ 按钮:v0.8.3(P0-2)降为描边/次要色,发送键才是最强视觉(旧彩字彩边抢镜) */
.round-btn.steer, .round-btn.stop { background: transparent; color: var(--text2); border-color: var(--border); }
.round-btn.steer:active { color: var(--warn); border-color: #57431f; }
.round-btn.stop:active { color: var(--danger); border-color: #5a2a2a; }

/* 列表行 cwd 副标题(走查 v0.2.1) */
.sess-cwd {
  max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-family: var(--mono); font-size: 11px; opacity: .75;
}

/* ---------- v0.3:会话体验 ---------- */
/* 置顶图标与来源 tag */
.pin { margin-right: 5px; font-size: 13px; }
.sess-tag {
  font-size: 11px; padding: 1px 7px; border-radius: 99px;
  background: var(--card2); border: 1px solid var(--border); color: var(--text2);
  max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sess-tag.machine { color: var(--accent); border-color: var(--accent); }

/* 会话信息条 */
#infobar, #fd-infobar {
  display: flex; gap: 8px; align-items: center; overflow-x: auto;
  padding: 6px 14px; border-bottom: 1px solid var(--border);
  background: rgba(14,14,17,.9); font-size: 12.5px; white-space: nowrap;
}
.info-chip {
  flex: none; display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 99px;
  background: var(--card2); border: 1px solid var(--border); color: var(--text2);
  font-size: 12px; min-height: 26px;
}
button.info-chip:active { border-color: var(--accent); color: var(--text); }
.info-chip.static { opacity: .8; }

/* 系统注入卡 */
details.inject-card {
  max-width: 82%; margin: 6px 0 2px auto;
  background: #14141a; border: 1px dashed #2e2e3a; border-radius: 12px; overflow: hidden;
}
details.inject-card summary {
  list-style: none; cursor: pointer; padding: 7px 12px;
  font-size: 12px; color: #8e8e99; user-select: none; /* v0.8.3(P1-7):#7a7a88 对比不足 */
}
details.inject-card summary::-webkit-details-marker { display: none; }
details.inject-card .body {
  padding: 0 12px 10px; font-family: var(--mono); font-size: 11.5px; color: #83838e; /* v0.8.3(P1-7) */
  white-space: pre-wrap; word-break: break-word; max-height: 240px; overflow-y: auto;
}
details.inject-card summary::after { content: "›"; margin-left: 8px; float: right; transition: transform .12s; }
details[open].inject-card summary::after { transform: rotate(90deg); }

/* composer 两行重构:输入框全宽 + 操作行 */
.input-wrap textarea {
  width: 100%; resize: none; min-height: 52px; max-height: 132px;
  padding: 13px 14px; border-radius: 14px; font-size: 15px; line-height: 1.45;
  background: var(--card2);
}
.action-row { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.action-row .act-left { display: flex; gap: 8px; }
.action-row .round-btn { width: 40px; height: 40px; font-size: 17px; }

/* 提问卡子问题分组(v0.4.1) */
.q-sub { margin-bottom: 10px; padding-bottom: 8px; border-bottom: 1px dashed var(--border); }
.q-sub:last-child { border-bottom: 0; margin-bottom: 2px; }
.q-sub-head { font-size: 13px; font-weight: 600; color: var(--text); margin: 6px 0 6px; }
.q-sub-body { font-size: 12.5px; color: var(--text2); margin-bottom: 8px; }
.q-other {
  width: 100%; height: 42px; padding: 0 12px; margin-top: 2px;
  font-size: 14px; background: var(--card2);
}
.error-card {
  padding: 10px 12px; border: 1px dashed var(--danger); border-radius: 10px;
  color: var(--danger); font-size: 13px;
}

/* 排队条(v0.4.4 权威队列) */
#queuebar, #fd-queuebar {
  border-top: 1px solid var(--border);
  background: rgba(23,23,28,.92);
  padding: 6px 14px calc(4px + var(--sab) / 2);
}
.qbar-head {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--warn); cursor: pointer; user-select: none;
  min-height: 30px;
}
.qbar-head b { color: var(--warn); }
.qbar-arrow { margin-left: auto; font-size: 12px; color: var(--text2); }
.qbar-item {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 4px; border-top: 1px dashed var(--border);
  font-size: 13px;
}
.qbar-idx { color: var(--text2); font-family: var(--mono); font-size: 11.5px; flex: none; }
.qbar-time { color: var(--text2); font-family: var(--mono); font-size: 11.5px; flex: none; }
.qbar-text {
  flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--text); cursor: pointer;
}
.qbar-text.open { white-space: normal; word-break: break-all; }

/* 气泡/工具卡一键复制(2026-07-21 复制优化轮) */
.bubble { position: relative; }
.bubble-copy {
  position: absolute; top: 4px; right: 6px; z-index: 2;
  border: 0; background: transparent; color: inherit; opacity: .32;
  font-size: 14px; line-height: 1; padding: 6px; cursor: pointer;
}
.bubble-copy:active { opacity: 1; transform: scale(1.1); }
.msg.user .bubble-copy { color: rgba(255,255,255,.85); }
/* v0.6.7:他源详情用户长指令截断+展开(继承蓝色气泡的 pre-wrap;展开键白字下划线,贴气泡可读) */
.fd-text { white-space: pre-wrap; word-break: break-word; }
.fd-expand {
  display: inline; border: 0; background: transparent; cursor: pointer;
  font: inherit; font-size: 12.5px; padding: 0; margin-left: 2px;
  color: rgba(255,255,255,.92); text-decoration: underline;
}
/* v0.6.9 B5:重复用户消息右上角 ×N 角标(同一指令被 resume 重复写入 jsonl,已合并为一条) */
.fd-dup {
  position: absolute; top: -9px; right: -7px; z-index: 3;
  font-size: 11px; font-weight: 700; line-height: 1; color: #fff;
  background: #e0576b; border-radius: 99px; padding: 3px 7px;
  box-shadow: 0 1px 4px rgba(0,0,0,.4); pointer-events: none;
}
.tool-copy {
  float: right; border: 0; background: transparent; color: var(--text2);
  opacity: .5; font-size: 13px; padding: 2px 6px; cursor: pointer;
}
.tool-copy:active { opacity: 1; }
.qbar-act.copy-one { color: var(--text2); }

/* turn 静默失败显形红条(2026-07-22) */
.errbar {
  margin: 6px 10px; padding: 9px 12px; border-radius: 10px;
  background: #3a1f22; color: #ffb4ab; border: 1px solid #7a3a3f;
  font-size: 13px; line-height: 1.5;
  display: flex; align-items: center; gap: 8px;
}
.errbar-text { flex: 1; min-width: 0; }
.errbar-hint { color: #d98c86; margin-left: 8px; font-size: 12px; }
/* v0.10.5:hint 三态视觉区分 */
.errbar-hint-running { color: #a8c7a0; }
.errbar-hint-queued { color: #c7b88a; }
.errbar-hint-retry { color: #d98c86; cursor: pointer; text-decoration: underline; }
.errbar-close {
  flex: none; width: 32px; height: 32px; border: none; border-radius: 8px;
  background: transparent; color: #d98c86; font-size: 18px; line-height: 1;
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
}
.errbar-close:active { background: rgba(255,180,171,.15); }

/* v0.9.10(C quota banner):Kimi 配额冻结 / 10 分钟无回复 顶部横幅 */
.quota-banner {
  position: sticky; top: 0; z-index: 50;
  margin: 0; padding: 10px 14px;
  background: #3a2c14; color: #f4d488;
  border-bottom: 1px solid #6b4e1f;
  font-size: 13px; line-height: 1.5;
  display: flex; align-items: center; gap: 10px;
  box-shadow: 0 1px 0 rgba(0,0,0,.4);
}
.quota-banner-text { flex: 1; min-width: 0; }
.quota-banner-relay {
  flex: none; padding: 6px 10px; border-radius: 8px;
  background: #f4d488; color: #2b1e08; font-weight: 600;
  text-decoration: none; font-size: 12.5px;
  border: 1px solid #b08a3a;
}
.quota-banner-relay:active { transform: scale(.96); background: #e8c66f; }

/* v0.10.11(B):Kimi 额度芯片(顶栏 brain 旁) */
.quota-chip {
  flex: none; display: inline-block;
  padding: 2px 8px; border-radius: 10px;
  font-size: 11px; font-weight: 600; line-height: 1.6;
  background: #1e2a1e; color: #8fd48f; border: 1px solid #2e5a2e;
  white-space: nowrap; cursor: default; vertical-align: middle;
}
.quota-chip.warn { background: #3a2c14; color: #f4d488; border-color: #6b4e1f; }
.quota-chip.danger { background: #3a1414; color: #f48888; border-color: #6b1f1f; }

/* v0.10.11(A):横幅点击定位消息高亮 */
.flash-highlight { animation: flashMsg 2s ease-out; }
@keyframes flashMsg {
  0% { background: rgba(244,212,136,.25); }
  100% { background: transparent; }
}

.qbar-act {
  flex: none; width: 32px; height: 32px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--card2); border: 1px solid var(--border); font-size: 14px;
}
.qbar-act.steer-one { color: var(--warn); }
.qbar-act.cancel-one { color: var(--danger); }
.qbar-act:active { transform: scale(.94); }

/* v0.9.11 版本自更新提示条 */
.ver-update-bar {
  position: sticky; top: 0; z-index: 60;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  background: #1a2e1a; color: #a8e6a8;
  border-bottom: 1px solid #2e5a2e;
  font-size: 13px; line-height: 1.5;
  box-shadow: 0 1px 4px rgba(0,0,0,.4);
}
.ver-update-text { flex: 1; min-width: 0; }
.ver-update-btn {
  flex: none; padding: 6px 14px; border-radius: 8px;
  background: #4caf50; color: #fff; font-weight: 600;
  border: none; font-size: 12.5px; cursor: pointer;
}
.ver-update-btn:active { transform: scale(.96); background: #43a047; }
.ver-update-later {
  flex: none; padding: 6px 10px; border-radius: 8px;
  background: transparent; color: #a8e6a8; font-size: 12.5px;
  border: 1px solid #2e5a2e; cursor: pointer;
}
.ver-update-later:active { background: #2e5a2e; }

/* 队列条:执行中行与完成淡出(v0.4.5) */
.qbar-item.active { border-top: 0; }
.qbar-live { color: var(--success); font-size: 12px; animation: pulse 1.2s ease-in-out infinite; }
.qbar-head.done { color: var(--success); cursor: default; }

/* 守护中状态与活动面板(v0.4.8) */
.st-guard { color: #4fc3dc; }
.st-guard .dot { background: #4fc3dc; }

#activitybar {
  display: flex; align-items: center; gap: 10px;
  padding: 4px 14px; border-bottom: 1px solid var(--border);
  background: rgba(14,14,17,.88); font-size: 12px; cursor: pointer; user-select: none;
  min-height: 30px;
}
#activitybar .qbar-arrow { margin-left: auto; }
.act-hist { color: var(--text2); }

#activity-panel {
  border-bottom: 1px solid var(--border);
  background: #121218;
  max-height: 280px; overflow-y: auto;
  padding: 6px 14px;
}
.act-item {
  display: flex; align-items: center; gap: 7px;
  padding: 6px 2px; font-size: 12.5px; border-bottom: 1px dashed #1e1e26;
  width: 100%; text-align: left; color: var(--text);
}
.act-item:last-child { border-bottom: 0; }
.act-kind { color: var(--accent); font-family: var(--mono); font-size: 11px; flex: none; }
.act-desc { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text2); }
.act-time { color: var(--text2); font-size: 11px; flex: none; }
.act-sep { margin: 8px 0 4px; font-size: 11.5px; color: var(--text2); }
button.act-child { cursor: pointer; border-radius: 8px; }
button.act-child:active { background: var(--card2); }

/* 流式视图与工具摘要(v0.4.9) */
.cursor { display: inline-block; color: var(--accent); animation: blink 1s steps(1) infinite; font-weight: 700; }
@keyframes blink { 50% { opacity: 0; } }
.msg.live .bubble { opacity: .92; }
details.think-card.live-think { border-color: #2b3a55; }
.tool-sum {
  color: var(--text2); font-family: var(--mono); font-size: 11px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  max-width: 55%; margin-left: 6px;
}
details.tool-card summary { display: flex; align-items: center; gap: 6px; }
details.tool-card summary::after { margin-left: auto; }

/* 机群联邦页 */
.fleet-stats { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 12px; }
.fleet-stat { font-size: 12.5px; padding: 4px 10px; border-radius: 99px; border: 1px solid var(--border); color: var(--text2); }
.fleet-h { display: inline-block; font-size: 10.5px; font-weight: 700; color: #0e0e11; border-radius: 6px; padding: 1px 6px; margin-right: 7px; vertical-align: 1px; }

/* 机群生命体征卡 */
.fleet-vitals { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 12px; }
.vital-card { flex: 1 0 108px; background: var(--card); border: 1px solid var(--border); border-top: 2px solid transparent; border-radius: 12px; padding: 10px 12px; }
.vital-name { font-size: 12px; font-weight: 700; }
.vital-count { font-size: 22px; font-weight: 700; margin: 2px 0; }
.vital-sub { font-size: 11px; color: var(--text2); white-space: nowrap; }
.fleet-note { font-size: 11px; color: var(--text2); margin: -6px 2px 10px; line-height: 1.5; }
.sys-group-head { display: flex; align-items: center; gap: 6px; width: 100%; text-align: left; background: none; border: none; color: var(--text2); font-size: 12px; padding: 10px 4px 4px; cursor: pointer; }
.sys-caret { font-size: 10px; }
.sys-group { opacity: 0.72; }

/* 账号全景卡 — v0.8.3(P1-8)统一卡结构:账号名 + 额度状态条(无接口→「额度未知」占位条)+ 一行次要说明 */
.acct-strip { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 10px; }
.acct-card { flex: 1 0 168px; background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 9px 11px; }
.acct-name { font-size: 12px; font-weight: 700; }
.acct-sub { font-size: 11px; color: var(--text2); margin-top: 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-quota { margin-top: 6px; font-size: 11px; display: flex; align-items: center; gap: 6px; }
.acct-bar { flex: 1; height: 4px; background: var(--border); border-radius: 2px; overflow: hidden; display: inline-block; }
.acct-bar i { display: block; height: 100%; border-radius: 2px; }
.acct-bar.unknown i { width: 100%; background: repeating-linear-gradient(45deg, #26262e 0 5px, #1d1d24 5px 10px); }
.acct-pct { flex: none; font-size: 11px; font-variant-numeric: tabular-nums; }
.acct-pct.unk { color: var(--text2); }

/* 分组切换 + 模型主标签 */
.fleet-toggle { display: flex; gap: 6px; margin: 0 0 8px; }
.fleet-toggle .tg { border: 1px solid var(--border); background: var(--card); color: var(--text2); border-radius: 999px; padding: 4px 12px; font-size: 12px; }
.fleet-toggle .tg.on { color: var(--text); border-color: var(--text2); font-weight: 600; }
.fleet-m { display: inline-block; color: #fff; font-size: 10px; font-weight: 700; border-radius: 6px; padding: 1px 6px; margin-right: 6px; vertical-align: 1px; }
.fleet-ghead { display: flex; align-items: center; gap: 6px; margin: 12px 0 4px; font-size: 12px; color: var(--text2); }
.fleet-gcount { font-size: 11px; opacity: 0.7; }
.fleet-h2 { font-size: 10px; font-weight: 600; margin-right: 6px; }

/* 待答锁定横幅(可点,引导到答题卡) */
.locked-banner { background: rgba(224,164,88,.14); border: 1px solid rgba(224,164,88,.45); color: #e0a458; border-radius: 10px; padding: 9px 12px; font-size: 13px; text-align: center; cursor: pointer; }
.locked-banner b { color: #f0b96a; }
.action-card.flash { animation: acflash 1.6s ease; }
@keyframes acflash { 0%,100% { box-shadow: none; } 30% { box-shadow: 0 0 0 3px rgba(224,164,88,.8); } }
.newver-bar { background: #2fbf71; color: #fff; text-align: center; font-size: 13px; padding: 9px 10px; border-radius: 10px; margin: 6px 10px; cursor: pointer; font-weight: 600; }

/* v0.6.0:harness 筛选条色点 */
.hchip-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 4px; vertical-align: 1px; }
/* v0.6.0:首页联邦会话分隔标题 */
.fleet-home-sep { font-size: 12px; color: var(--text2); margin: 14px 0 6px; padding-left: 2px; }
/* v0.6.0:首页联邦会话行(无滑动手势) */
.fleet-home-item { width: 100%; }
/* v0.6.0:机群页缓存提示 */
.fleet-cache-note { font-size: 11px; color: var(--text2); text-align: center; padding: 6px 0 2px; opacity: 0.7; }

/* v0.6.1:我的指令面板(痛点2) */
.my-cmd-sheet { max-height: 78vh; display: flex; flex-direction: column; }
.my-cmd-count { font-size: 12.5px; color: var(--text2); margin: -6px 0 12px; }
.my-cmd-last { width: 100%; text-align: left; padding: 12px; margin-bottom: 10px; border-radius: 10px; background: rgba(91,124,250,.14); border: 1px solid rgba(91,124,250,.4); color: #8aa2ff; font-size: 14px; font-weight: 600; }
.my-cmd-last:disabled { opacity: .4; }
.my-cmd-list { overflow-y: auto; flex: 1; margin: 0 -6px; }
.my-cmd-item { display: flex; align-items: flex-start; gap: 8px; padding: 10px 8px; border-radius: 8px; cursor: pointer; }
.my-cmd-item:active { background: var(--card2); }
.my-cmd-tag { flex: 0 0 auto; font-size: 11px; padding: 2px 7px; border-radius: 99px; margin-top: 1px; white-space: nowrap; }
.my-cmd-tag.manual { background: rgba(91,124,250,.16); color: #8aa2ff; }
.my-cmd-tag.inj { background: rgba(224,164,88,.14); color: #e0a458; }
.my-cmd-prev { flex: 1; font-size: 13.5px; color: var(--text); word-break: break-all; line-height: 1.4; }
/* v0.6.1:消息定位高亮(痛点2 跳转闪烁) */
.kr-flash { animation: krflash 1.6s ease; }
@keyframes krflash { 0%,100% { box-shadow: none; } 25% { box-shadow: 0 0 0 3px rgba(91,124,250,.85); background: rgba(91,124,250,.10); } }

/* ──────────────────────────────────────────────────────────────
 * v0.9.0 · 批 3a:智能层面板(全舰队快照 / 问答 / 增强三选一)
 * 390px 手机优先,深色 SaaS 风格,复用 var(--card/border/text/accent/danger/warn/success)
 * ────────────────────────────────────────────────────────────── */
.intel-modal { max-width: 460px; max-height: 86vh; overflow-y: auto; }
.intel-card { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 14px; margin-bottom: 12px; }
.intel-snapshot-row { display: flex; gap: 8px; flex-wrap: wrap; }
.intel-stat { flex: 1 0 78px; padding: 10px 10px; background: var(--card2); border-radius: 10px; min-width: 0; }
.intel-stat-num { font-size: 22px; font-weight: 700; color: var(--text); line-height: 1.15; }
.intel-stat-lbl { font-size: 11px; color: var(--text2); margin-top: 4px; }
.intel-stat.warn .intel-stat-num { color: var(--warn); }
.intel-stat.danger .intel-stat-num { color: var(--danger); }
.intel-stat.ok .intel-stat-num { color: var(--success); }
.intel-ask-row { display: flex; gap: 8px; margin-top: 10px; }
.intel-ask-row input { flex: 1; min-width: 0; padding: 10px 12px; background: var(--card2); border: 1px solid var(--border); border-radius: 10px; color: var(--text); font-size: 14px; outline: none; }
.intel-ask-row input:focus { border-color: var(--accent); }
.intel-ask-row button { padding: 10px 16px; background: var(--accent); color: #fff; border: 0; border-radius: 10px; font-weight: 600; font-size: 14px; cursor: pointer; }
.intel-ask-row button:active { opacity: .85; }
.intel-ask-out { margin-top: 12px; padding: 12px; background: var(--card2); border-radius: 10px; font-size: 13.5px; line-height: 1.65; color: var(--text); white-space: pre-wrap; word-break: break-word; }
.intel-evidence { margin-top: 8px; font-size: 11.5px; color: var(--text3); }
.intel-evidence span { display: inline-block; margin: 2px 6px 2px 0; padding: 2px 6px; border: 1px solid var(--border); border-radius: 6px; }
.intel-copilot-3col { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 560px) { .intel-copilot-3col { grid-template-columns: 1fr 1fr 1fr; } }
.intel-copilot-col { background: var(--card2); border: 1px solid var(--border); border-radius: 10px; padding: 12px; font-size: 13px; line-height: 1.55; max-height: 280px; overflow-y: auto; white-space: pre-wrap; word-break: break-word; }
.intel-copilot-col h4 { margin: 0 0 8px; font-size: 12px; color: var(--accent); font-weight: 700; letter-spacing: .3px; }
.intel-copilot-col .axis { font-size: 11.5px; padding: 6px 0; border-top: 1px dashed var(--border); color: var(--text2); }
.intel-copilot-col .axis b { color: var(--text2); margin-right: 4px; font-weight: 600; }
.intel-copilot-col .axis.changed b { color: var(--warn); }
.intel-copilot-col .axis.changed b::after { content: '⚠ '; }
.intel-copilot-banner { padding: 10px 12px; border-radius: 10px; margin-bottom: 10px; font-size: 13px; line-height: 1.5; }
.intel-copilot-banner.required { background: rgba(224,92,92,.14); border: 1px solid var(--danger); color: var(--danger); }
.intel-copilot-banner.silent { background: rgba(63,178,127,.14); border: 1px solid var(--success); color: var(--success); }
.intel-copilot-actions { display: flex; gap: 8px; margin-top: 12px; }
.intel-copilot-actions button { flex: 1; padding: 11px; border-radius: 10px; font-weight: 600; font-size: 14px; cursor: pointer; }
.intel-copilot-actions .send-orig { background: var(--card2); border: 1px solid var(--border); color: var(--text); }
.intel-copilot-actions .send-enhanced { background: var(--accent); border: 0; color: #fff; }
.intel-copilot-actions button:active { opacity: .85; }
.round-btn.enhance:active { color: var(--accent); border-color: var(--accent-strong); background: rgba(91,124,250,.12); }
