/* 果子 · 手机控制台（B3）—— 色值与壳端 global.css / 占位页同源 */

:root {
  --brand: #f04a2e;
  --brand-strong: #d93c22;
  --brand-soft: #ffece7;
  --grad-brand: linear-gradient(135deg, #ff7550 0%, #f04a2e 100%);
  --bg: #f5f6fa;
  --surface: #ffffff;
  --text: #181b2a;
  --text-2: #5c6378;
  --text-3: #9aa1b6;
  --border: #e7e9f2;
  --green: #16a34a;
  --green-soft: #e8f7ee;
  --red: #dc2626;
  --red-soft: #fdecec;
  --blue: #2563eb;
  --blue-soft: #eaf1fe;
  --gray-soft: #eef0f6;
  --shadow-1: 0 2px 10px rgba(24, 27, 42, 0.06);
  --shadow-2: 0 12px 32px rgba(24, 27, 42, 0.12);
  --radius: 16px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  max-width: 560px;
  margin: 0 auto;
  min-height: 100vh;
  -webkit-tap-highlight-color: transparent;
  line-height: 1.5;
}

.hidden { display: none !important; }

.view:not(.hidden) { animation: fadeIn 0.18s ease; }
@keyframes fadeIn { from { opacity: 0; } }

/* ---------------- 登录 ---------------- */

#view-login {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 32px 24px calc(32px + env(safe-area-inset-bottom));
  background-image:
    radial-gradient(560px 420px at 18% -10%, rgba(240, 74, 46, 0.14), transparent 68%),
    radial-gradient(520px 400px at 92% 108%, rgba(255, 117, 80, 0.16), transparent 70%);
}

.login-wrap { width: 100%; max-width: 380px; display: flex; flex-direction: column; align-items: center; text-align: center; }
.login-logo { width: 84px; height: 84px; border-radius: 50%; filter: drop-shadow(0 12px 20px rgba(240, 74, 46, 0.28)); }
.login-title { font-size: 22px; font-weight: 800; margin-top: 18px; letter-spacing: 0.5px; }
.login-sub { font-size: 13px; color: var(--text-2); margin-top: 8px; }
.login-form { width: 100%; display: flex; flex-direction: column; gap: 12px; margin-top: 28px; }
.login-error { margin-top: 14px; color: var(--red); font-size: 13px; }

.input {
  width: 100%;
  height: 50px;
  border-radius: 14px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  padding: 0 16px;
  font-size: 15px;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s;
  font-family: inherit;
}
.input:focus { border-color: var(--brand); }

.btn-primary {
  width: 100%;
  height: 50px;
  border-radius: 14px;
  border: none;
  background: var(--grad-brand);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(240, 74, 46, 0.24);
  font-family: inherit;
  transition: transform 0.12s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}
.btn-primary:active:not(:disabled) { transform: scale(0.985); box-shadow: 0 3px 10px rgba(240, 74, 46, 0.2); }
.btn-primary:disabled { opacity: 0.55; box-shadow: none; }

.btn-ghost {
  width: 100%;
  height: 48px;
  border-radius: 14px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 15px;
  cursor: pointer;
  font-family: inherit;
}

/* 软底次级按钮（卡片内动作：开启完成通知等；不发光、与卡片同宽） */
.btn-soft {
  width: 100%;
  height: 46px;
  border-radius: 14px;
  border: none;
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-size: 15px;
  font-weight: 650;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.12s ease, background 0.2s ease;
}
.btn-soft:active:not(:disabled) { transform: scale(0.985); background: #ffdfd6; }
.btn-soft:disabled { opacity: 0.55; }

/* 危险态描边按钮（退出登录等不可逆操作） */
.btn-ghost.is-danger { color: var(--red); border-color: rgba(220, 38, 38, 0.32); }
.btn-ghost.is-danger:active { background: var(--red-soft); }

.btn-danger {
  width: 100%;
  height: 48px;
  border-radius: 14px;
  border: 1.5px solid var(--red);
  background: transparent;
  color: var(--red);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

/* 设备卡行内小按钮（B4 P1：解绑） */
.btn-inline {
  height: 30px;
  padding: 0 12px;
  border-radius: 9px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  font-size: 12.5px;
  font-family: inherit;
  cursor: pointer;
}
.btn-inline.is-danger { color: var(--red); border-color: var(--red); }
.btn-inline:disabled { opacity: 0.6; }

/* ---------------- 顶栏 / 主框架 ---------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: calc(14px + env(safe-area-inset-top)) 18px 12px;
  background: rgba(245, 246, 250, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 rgba(24, 27, 42, 0.04);
}
.topbar-logo { width: 36px; height: 36px; border-radius: 50%; box-shadow: 0 4px 10px rgba(240, 74, 46, 0.16); }
.topbar-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.topbar-title { font-weight: 800; font-size: 21px; line-height: 1.25; letter-spacing: 0.3px; }
.topbar-sub { font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-online {
  flex: none;
  font-size: 11.5px;
  color: var(--text-2);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
}
.topbar-online .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.topbar-online .dot.off { background: var(--text-3); }

/* 日常 Tab：全局顶栏与聊天头重复（logo/在线数），隐藏顶栏，只留一行聊天头 */
body.tab-daily .topbar { display: none; }

/* P2 实时流状态胶囊（任务线详情头）：连接中 / 实时 / 重连中 */
.stream-pill {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--shadow-1);
  color: var(--text-2);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.stream-pill::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-3);
}
.stream-pill.is-live { color: var(--green); }
.stream-pill.is-live::before { background: var(--green); }
.stream-pill.is-connecting::before,
.stream-pill.is-reconnecting::before { animation: pulse 1.2s ease-in-out infinite; }
.stream-pill.is-reconnecting { color: var(--blue); }
.stream-pill.is-reconnecting::before { background: var(--blue); }

/* P2 派单附件（缩略图 / 类型图标 / 进度条 / 音频试听） */
.att-file { position: fixed; left: -9999px; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.att-bar { display: flex; gap: 10px; margin-top: 10px; }
.att-btn {
  flex: 1;
  padding: 10px 0;
  border-radius: 12px;
  border: 1px dashed var(--border);
  background: var(--surface);
  color: var(--text-2);
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
}
.att-btn:disabled { opacity: 0.6; }
.att-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.att-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border-radius: 12px;
  padding: 8px 10px;
  box-shadow: var(--shadow-1);
}
.att-thumb { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; background: var(--gray-soft); flex: none; }
.att-icon {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: var(--gray-soft);
  color: var(--text-2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.att-icon svg { width: 24px; height: 24px; }
.att-icon.kind-audio { background: var(--blue-soft); color: var(--blue); }
.att-icon.kind-video { background: var(--brand-soft); color: var(--brand); }
.att-icon.kind-image { background: var(--green-soft); color: var(--green); }
.att-thumb-btn { position: relative; border: none; padding: 0; background: none; cursor: pointer; border-radius: 8px; flex: none; display: flex; }
.att-play {
  position: absolute;
  right: -4px;
  bottom: -4px;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 8px;
  background: var(--brand);
  border-radius: 50%;
  border: 2px solid var(--surface);
}
.att-info { flex: 1; min-width: 0; }
.att-name { font-size: 13px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.att-sub { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.att-sub-err, .att-item.failed .att-sub { color: var(--red); }
.att-progress { height: 4px; border-radius: 2px; background: var(--gray-soft); margin-top: 5px; overflow: hidden; }
.att-progress-bar { height: 100%; border-radius: 2px; background: var(--grad-brand); transition: width 0.2s ease; }
.att-rm { border: none; background: none; color: var(--text-3); font-size: 14px; padding: 6px; cursor: pointer; font-family: inherit; }

.pane { padding: 4px 16px calc(160px + env(safe-area-inset-bottom)); }

.sec-title { font-size: 13px; color: var(--text-2); font-weight: 600; margin: 14px 2px 10px; }

/* ---------------- 底部 tab / FAB ---------------- */

.tabbar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 560px;
  display: flex;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
  z-index: 12;
}
.tab-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 9px 0 7px;
  border: none;
  background: none;
  color: var(--text-3);
  font-size: 11px;
  cursor: pointer;
  font-family: inherit;
}
.tab-item svg { width: 22px; height: 22px; }
.tab-item.active { color: var(--brand); }

.fab {
  position: fixed;
  right: max(20px, calc(50vw - 280px + 20px));
  bottom: calc(84px + env(safe-area-inset-bottom));
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: var(--grad-brand);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 24px rgba(240, 74, 46, 0.34);
  cursor: pointer;
  z-index: 15;
  transition: transform 0.12s ease, box-shadow 0.2s ease;
}
.fab svg { width: 26px; height: 26px; }
.fab:active { transform: scale(0.94); box-shadow: 0 6px 16px rgba(240, 74, 46, 0.28); }

/* ---------------- 卡片 ---------------- */

.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-1); padding: 14px 16px; }
.card.tappable { cursor: pointer; }
.card.tappable:active { transform: scale(0.985); }
.list > .card + .card { margin-top: 10px; }

.card-head { display: flex; align-items: flex-start; gap: 10px; }
.card-title { font-size: 15px; font-weight: 650; flex: 1; min-width: 0; line-height: 1.45; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-meta { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 12.5px; color: var(--text-3); flex-wrap: wrap; }
.card-meta .sep { color: var(--border); }
.card-arrow { color: var(--text-3); font-size: 18px; flex: none; line-height: 1.2; }
.dev-actions { display: flex; justify-content: flex-end; margin-top: 10px; }
.dev-os-line { display: inline-flex; align-items: center; gap: 5px; }
.dev-os-line .dev-os-icon { width: 13px; height: 13px; }

/* ---------------- 徽章 / 状态点 ---------------- */

.badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 600; flex: none; }
.badge-queued { background: var(--blue-soft); color: var(--blue); }
.badge-running { background: var(--brand-soft); color: var(--brand-strong); }
.badge-succeeded { background: var(--green-soft); color: var(--green); }
.badge-failed { background: var(--red-soft); color: var(--red); }
.badge-canceled { background: var(--gray-soft); color: var(--text-2); }
.badge-running::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand);
  margin-right: 5px;
  animation: pulse 1.2s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: 0.3; } }

.st-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); flex: none; }
.st-dot.active { background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }

/* ---------------- 进度条 ---------------- */

.progress { height: 8px; border-radius: 99px; background: var(--gray-soft); overflow: hidden; margin-top: 10px; }
.progress > i { display: block; height: 100%; width: 0; border-radius: 99px; background: var(--grad-brand); transition: width 0.4s ease; }
.progress.indeterminate > i { width: 35%; animation: slideBar 1.2s ease-in-out infinite; }
@keyframes slideBar { 0% { transform: translateX(-120%); } 100% { transform: translateX(340%); } }

.stage-text { font-size: 12.5px; color: var(--text-2); margin-top: 8px; word-break: break-all; }

/* ---------------- 筛选 chips ---------------- */

.chips { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 8px; scrollbar-width: none; }
#pane-jobs .chips { padding-top: 8px; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none;
  padding: 6px 13px;
  border-radius: 99px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-2);
  cursor: pointer;
  font-family: inherit;
  max-width: 45vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chip.active { background: var(--brand); border-color: var(--brand); color: #fff; }

/* ---------------- 详情 sheet ---------------- */

.sheet {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 560px;
  background: var(--bg);
  overflow-y: auto;
  z-index: 20;
}
.subbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 12px;
  background: rgba(245, 246, 250, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.back-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: var(--surface);
  box-shadow: var(--shadow-1);
  font-size: 22px;
  line-height: 1;
  padding-bottom: 3px;
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
}
.subbar-title { font-weight: 700; font-size: 16px; }
.sheet-body { padding: 6px 16px calc(40px + env(safe-area-inset-bottom)); }

.detail-title { font-size: 19px; font-weight: 750; line-height: 1.4; margin: 8px 0 14px; word-break: break-all; }
.detail-status { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.detail-status .badge { font-size: 13px; padding: 5px 14px; }
.wait-note { font-size: 12.5px; color: var(--text-2); margin-top: 8px; }

/* ---------------- kv / 用量 / 产出 ---------------- */

.kv { display: flex; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.kv:last-child { border-bottom: none; }
.kv-k { color: var(--text-2); flex: none; }
.kv-v { color: var(--text); text-align: right; word-break: break-all; }

.usage-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 4px; }
.usage-cell { background: var(--surface); border-radius: 12px; padding: 12px 8px; text-align: center; box-shadow: var(--shadow-1); }
.usage-num { font-size: 16px; font-weight: 700; }
.usage-label { font-size: 11px; color: var(--text-3); margin-top: 3px; }

.art-row { display: flex; align-items: flex-start; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.art-row:last-child { border-bottom: none; }
.art-main { flex: 1; min-width: 0; }
.art-name { font-size: 13.5px; word-break: break-all; }
.art-rel { font-size: 11.5px; color: var(--text-3); word-break: break-all; margin-top: 2px; }
.art-size { font-size: 12px; color: var(--text-3); flex: none; }

.art-row-link { text-decoration: none; color: inherit; align-items: center; }
.art-row-link:active { opacity: 0.65; }
.art-dl { flex: none; font-size: 12px; color: var(--brand); font-weight: 650; }
.art-local { flex: none; font-size: 11.5px; color: var(--text-3); }

.result-text { font-size: 13.5px; color: var(--text); line-height: 1.65; white-space: pre-wrap; word-break: break-word; }

/* ---------------- 结果摘要：Markdown 轻渲染 ---------------- */

.md-body { font-size: 13.5px; color: var(--text); line-height: 1.65; word-break: break-word; }
.md-body .md-p { margin: 0 0 9px; }
.md-body .md-p:last-child { margin-bottom: 0; }
.md-body .md-h { font-weight: 700; line-height: 1.4; margin: 14px 0 8px; }
.md-body .md-h:first-child { margin-top: 0; }
.md-body .md-h1 { font-size: 17px; }
.md-body .md-h2 { font-size: 16px; }
.md-body .md-h3 { font-size: 14.5px; }
.md-body .md-h4 { font-size: 13.5px; color: var(--text-2); }
.md-body .md-list { margin: 4px 0 9px; padding-left: 20px; }
.md-body .md-list li { margin: 3px 0; }
.md-body .md-quote { margin: 8px 0; padding: 6px 12px; border-left: 3px solid var(--border); background: var(--bg); border-radius: 0 8px 8px 0; color: var(--text-2); }
.md-body .md-hr { border: none; border-top: 1px solid var(--border); margin: 12px 0; }
.md-body .md-pre { background: #14172e; color: #e8eaf2; border-radius: 10px; padding: 10px 12px; overflow-x: auto; margin: 8px 0 9px; }
.md-body .md-pre code { background: none; color: inherit; padding: 0; font-size: 12px; }
.md-body code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; background: var(--gray-soft); border-radius: 5px; padding: 1px 5px; color: var(--brand-strong); }
.md-body a { color: var(--blue); text-decoration: none; word-break: break-all; }
.md-body del { color: var(--text-3); }
.md-table-wrap { overflow-x: auto; margin: 6px 0 9px; }
.md-table { border-collapse: collapse; width: 100%; font-size: 12.5px; }
.md-table th, .md-table td { border: 1px solid var(--border); padding: 6px 9px; text-align: left; word-break: break-word; }
.md-table th { background: var(--bg); font-weight: 650; color: var(--text-2); }

/* ---------------- 表单（建单） ---------------- */

.form-label { font-size: 13px; color: var(--text-2); font-weight: 600; margin: 18px 2px 8px; }
.form-textarea {
  width: 100%;
  min-height: 130px;
  border-radius: 14px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  padding: 14px 16px;
  font-size: 15px;
  color: var(--text);
  outline: none;
  resize: vertical;
  font-family: inherit;
  line-height: 1.55;
}
.form-textarea:focus { border-color: var(--brand); }

.dev-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.dev-grid.single { grid-template-columns: minmax(0, 1fr); }
/* 铺满整行时改为横向：左边设备名，右边系统版本，像一条设备状态条 */
.dev-grid.single .dev-tile { flex-direction: row; align-items: center; gap: 10px; }
.dev-grid.single .dev-tile-top { flex: 1; }
.dev-tile {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
  padding: 10px 11px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: inherit;
  text-align: left;
  font-family: inherit;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}
.dev-tile.picked { border-color: var(--brand); background: var(--brand-soft); }
.dev-tile:active { transform: scale(0.985); }
.dev-tile-top { display: flex; align-items: center; gap: 6px; min-width: 0; }
.dev-os-icon { width: 15px; height: 15px; flex: none; color: var(--text-3); }
.dev-tile-name { flex: 1; min-width: 0; font-size: 13px; font-weight: 620; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dev-tile-check { flex: none; font-size: 12px; font-weight: 800; color: var(--brand); }
.dev-tile-sub { font-size: 11.5px; color: var(--text-3); line-height: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 派单前置态：未配对 / 全部离线（状态卡替代表单，刷新与去设备页给出明确出口） */
.dev-gate {
  margin-top: 10px;
  padding: 30px 22px 18px;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-1);
  text-align: center;
}
.dev-gate-icon { width: 34px; height: 34px; color: var(--text-3); }
.dev-gate-title { margin-top: 12px; font-size: 15.5px; font-weight: 650; color: var(--text); }
.dev-gate-desc { margin-top: 8px; font-size: 12.5px; line-height: 1.75; color: var(--text-3); }
.dev-gate-refresh { margin-top: 18px; }
.dev-gate-link {
  margin-top: 10px;
  padding: 6px 10px;
  border: none;
  background: none;
  color: var(--text-2);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
}
.dev-gate-link:active { color: var(--brand); }

.switch-row { display: flex; align-items: center; gap: 12px; padding: 14px 0; }
.switch-row-main { flex: 1; }
.switch-row-title { font-size: 14.5px; font-weight: 600; }
.switch-row-sub { font-size: 12px; color: var(--text-3); margin-top: 3px; line-height: 1.5; }

.switch { position: relative; width: 48px; height: 28px; flex: none; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch .knob { position: absolute; inset: 0; border-radius: 99px; background: var(--gray-soft); transition: background 0.2s; pointer-events: none; }
.switch .knob::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: var(--shadow-1);
  transition: transform 0.2s;
}
.switch input:checked + .knob { background: var(--brand); }
.switch input:checked + .knob::after { transform: translateX(20px); }

/* ---------------- 账户卡 ---------------- */

.avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--grad-brand);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
  flex: none;
}

/* 账户卡：余额行（R20 与后台/壳端余额口径同步） */
.acct-balance {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
  padding: 9px 14px;
  border-radius: 12px;
  background: var(--brand-soft);
}
.acct-balance-label { font-size: 12.5px; color: var(--text-2); }
.acct-balance-value { font-size: 17px; font-weight: 700; color: #b52f14; font-variant-numeric: tabular-nums; }

/* ---------------- 空态 / 加载 / toast ---------------- */

.empty { text-align: center; padding: 56px 24px; color: var(--text-3); }
.empty-title { font-size: 15px; color: var(--text-2); margin-bottom: 6px; font-weight: 600; }
.empty-desc { font-size: 13px; line-height: 1.7; }

.loading { text-align: center; padding: 48px 0; color: var(--text-3); font-size: 13px; }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(96px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  background: rgba(24, 27, 42, 0.92);
  color: #fff;
  font-size: 13px;
  padding: 10px 18px;
  border-radius: 99px;
  z-index: 60;
  max-width: 84vw;
  text-align: center;
  animation: fadeIn 0.18s ease;
}

.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }

/* ---------------- 扫码免密登录遮罩（B3.5 P1） ---------------- */

.pair-loading {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(245, 246, 250, 0.94);
  display: flex;
  align-items: center;
  justify-content: center;
}

.pair-loading-box { text-align: center; }

.pair-spinner {
  width: 34px;
  height: 34px;
  margin: 0 auto;
  border-radius: 50%;
  border: 3px solid var(--brand-soft);
  border-top-color: var(--brand);
  animation: pairSpin 0.8s linear infinite;
}
@keyframes pairSpin { to { transform: rotate(360deg); } }

.pair-loading-text { margin-top: 14px; font-size: 13.5px; color: var(--text-2); }

/* ---------------- 详情底部抽屉（P5：任务线；列表保持可见） ---------------- */

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 19;
  background: rgba(24, 27, 42, 0.34);
  opacity: 0;
  transition: opacity 0.22s ease;
  pointer-events: none;
}
.drawer-backdrop.show { opacity: 1; pointer-events: auto; }

.drawer {
  position: fixed;
  top: auto;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%) translateY(92vh);
  width: 100%;
  max-width: 560px;
  height: 92vh;
  background: var(--bg);
  border-radius: 18px 18px 0 0;
  box-shadow: 0 -10px 36px rgba(24, 27, 42, 0.22);
  z-index: 20;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform 0.24s cubic-bezier(0.22, 0.8, 0.32, 1);
  will-change: transform;
}

.drawer-handle { flex: none; display: flex; justify-content: center; padding: 8px 0 2px; touch-action: none; cursor: grab; }
.drawer-handle span { width: 40px; height: 4px; border-radius: 99px; background: #d9dce8; }

.drawer-head {
  flex: none;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 16px 10px;
  touch-action: none;
}
.drawer-head .subbar-title { flex: 1; font-weight: 700; font-size: 16px; }
.drawer-close {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: var(--surface);
  box-shadow: var(--shadow-1);
  color: var(--text-2);
  font-size: 15px;
  cursor: pointer;
  font-family: inherit;
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 2px 16px calc(18px + env(safe-area-inset-bottom));
}

/* ---------------- 任务线对话流 ---------------- */

.thread-title { font-size: 18px; font-weight: 750; line-height: 1.4; word-break: break-all; padding: 2px 0 0; }
.thread-sub { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: 12.5px; color: var(--text-3); flex-wrap: wrap; }
.thread-sub .sep { color: var(--border); }

.turn { margin-top: 18px; }
.turn-idx { font-size: 11.5px; color: var(--text-3); margin: 0 4px 10px; }

.bubble-user { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.bubble-user-text {
  max-width: 82%;
  background: var(--grad-brand);
  color: #fff;
  border-radius: 16px 16px 4px 16px;
  padding: 9px 13px;
  font-size: 14px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  box-shadow: 0 4px 12px rgba(240, 74, 46, 0.22);
}
.bubble-atts { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; max-width: 82%; }
.bubble-att {
  width: 68px;
  height: 68px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow-1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-2);
  font-size: 12px;
  text-decoration: none;
  padding: 0 8px;
  text-align: center;
  word-break: break-all;
}
.bubble-att img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bubble-att-pill { width: auto; min-width: 48px; height: 34px; padding: 0 12px; }

.turn-card {
  margin-top: 8px;
  background: var(--surface);
  border-radius: 4px 16px 16px 16px;
  box-shadow: var(--shadow-1);
  padding: 12px 14px;
}
.turn-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.turn-time { font-size: 12px; color: var(--text-3); }
.turn-card > .md-body, .turn-card > .result-text { margin-top: 8px; }
.turn-card > .progress { margin-top: 8px; }
.turn-card > .stage-text { margin-top: 6px; }
.turn-card > .wait-note { margin-top: 6px; }
.turn-arts { margin-top: 6px; border-top: 1px solid var(--border); padding-top: 2px; }
.turn-more { margin-top: 8px; padding: 2px 0; background: none; border: none; color: var(--text-3); font-size: 12.5px; cursor: pointer; font-family: inherit; }
.turn-info { margin-top: 6px; }

/* ---------------- 继续对话 composer ---------------- */

.composer {
  flex: none;
  padding: 10px 16px calc(12px + env(safe-area-inset-bottom));
  background: var(--surface);
  border-top: 1px solid var(--border);
}
.composer-row { display: flex; align-items: flex-end; gap: 10px; }
.composer-input {
  flex: 1;
  min-height: 44px;
  max-height: 120px;
  border-radius: 14px;
  border: 1.5px solid var(--border);
  background: var(--bg);
  padding: 11px 14px;
  font-size: 15px;
  line-height: 1.4;
  color: var(--text);
  outline: none;
  resize: none;
  font-family: inherit;
}
.composer-input:focus { border-color: var(--brand); }
.composer-send {
  flex: none;
  height: 44px;
  padding: 0 20px;
  border-radius: 14px;
  border: none;
  background: var(--grad-brand);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 6px 14px rgba(240, 74, 46, 0.24);
  transition: transform 0.12s ease, opacity 0.2s ease;
}
.composer-send:active:not(:disabled) { transform: scale(0.96); }
.composer-send:disabled { opacity: 0.6; }
.composer-mic {
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.12s ease, color 0.15s ease, border-color 0.15s ease;
}
.composer-mic svg { width: 22px; height: 22px; }
.composer-mic:active { transform: scale(0.94); color: var(--brand); border-color: var(--brand); }
.composer-cancel { height: 44px; }

/* ---------------- P2.5 语音输入浮层（派单页 / 续聊共用） ---------------- */

.voice-overlay {
  position: fixed;
  inset: 0;
  z-index: 55; /* 高于抽屉 / FAB；低于 toast（60）与扫码遮罩（80） */
  background: rgba(24, 27, 42, 0.45);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0 16px calc(18px + env(safe-area-inset-bottom));
  animation: fadeIn 0.18s ease;
}
.voice-panel {
  width: 100%;
  max-width: 460px;
  background: var(--surface);
  border-radius: 24px;
  padding: 24px 22px 18px;
  box-shadow: var(--shadow-2);
  text-align: center;
  animation: voiceUp 0.22s ease;
}
@keyframes voiceUp { from { transform: translateY(28px); opacity: 0; } }
.voice-state { font-size: 15px; font-weight: 700; color: var(--text); }
.voice-stage { position: relative; height: 92px; margin-top: 14px; }
.voice-wave { width: 100%; height: 92px; display: block; }
.voice-busy { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.voice-spinner {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid var(--brand-soft);
  border-top-color: var(--brand);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.voice-timer { font-size: 13px; color: var(--text-3); margin-top: 6px; font-variant-numeric: tabular-nums; }
.voice-actions { display: flex; align-items: center; justify-content: center; gap: 46px; margin-top: 16px; }
.voice-act {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  transition: transform 0.12s ease, opacity 0.2s ease;
}
.voice-act:active:not(:disabled) { transform: scale(0.94); }
.voice-act:disabled { opacity: 0.45; }
.voice-act-cancel { background: var(--gray-soft); color: var(--text-2); font-size: 18px; }
.voice-act-done { background: var(--grad-brand); color: #fff; box-shadow: 0 10px 22px rgba(240, 74, 46, 0.32); }
.voice-act-done svg { width: 26px; height: 26px; }
.voice-hint { font-size: 12px; color: var(--text-3); margin-top: 14px; }

/* 派单表单：提交主按钮（满宽 + 与表单留白节奏） */
.create-submit { margin-top: 26px; margin-bottom: 4px; }

/* ---------------- 滑动删除（列表卡片左滑） ---------------- */

.swipe { position: relative; border-radius: var(--radius); overflow: hidden; touch-action: pan-y; }
.list > .swipe + .swipe { margin-top: 10px; }
.swipe-actions { position: absolute; top: 0; right: 0; bottom: 0; width: 96px; display: flex; }
.swipe-del {
  flex: 1;
  border: none;
  background: var(--red);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.swipe-del:active { background: #b91c1c; }
/* R129：进行中的任务线左滑只作提示（服务端删不掉） */
.swipe-del.is-blocked { background: #9ca3af; }
.swipe-del.is-blocked:active { background: #9ca3af; }
.swipe-content { position: relative; z-index: 1; transform: translateX(0); transition: transform 0.18s ease; will-change: transform; }
.swipe.dragging .swipe-content { transition: none; }
.swipe.open .swipe-content { transform: translateX(-96px); }

/* 任务线卡片一行结果摘要 */
.card-summary {
  margin-top: 8px;
  font-size: 12.5px;
  color: var(--text-2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-summary-err { color: var(--red); }

/* ---------------- 待确认卡（B4 P1.5 远程审批） ---------------- */

.wait-confirm { color: var(--brand-strong); font-weight: 600; }

.qc-card {
  margin-top: 12px;
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  background: var(--surface);
}
.qc-title { font-size: 14px; font-weight: 700; }
.qc-sub { margin-top: 4px; font-size: 12px; color: var(--text-2); line-height: 1.5; }
.qc-group { margin-top: 12px; }
.qc-item + .qc-item { margin-top: 14px; }
.qc-q { font-size: 13.5px; line-height: 1.5; }
.qc-header { color: var(--text-2); margin-right: 6px; }
.qc-opts { margin-top: 8px; display: flex; flex-direction: column; gap: 8px; }
.qc-opt {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  width: 100%;
  text-align: left;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  padding: 10px 12px;
  font-size: 13.5px;
  font-family: inherit;
  cursor: pointer;
}
.qc-opt.is-picked { border-color: var(--brand); background: var(--brand-soft); }
.qc-box {
  flex: none;
  width: 16px;
  height: 16px;
  margin-top: 1px;
  border: 1.5px solid var(--border);
  border-radius: 50%;
  box-sizing: border-box;
}
.qc-box.is-multi { border-radius: 4px; }
.qc-opt.is-picked .qc-box {
  border-color: var(--brand);
  background: var(--brand);
  box-shadow: inset 0 0 0 3px var(--surface);
}
.qc-opt-label { flex: 1; }
.qc-opt-desc { display: block; margin-top: 2px; font-size: 12px; color: var(--text-2); }
.qc-input {
  margin-top: 8px;
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font-size: 13.5px;
  font-family: inherit;
  outline: none;
}
.qc-input:focus { border-color: var(--brand); }
.qc-submit { width: 100%; margin-top: 14px; height: 44px; font-size: 15px; }

/* ---------------- 日常对话（ChatGPT 式；2026-10 双模式改造） ---------------- */

/* 固定视口高度：头部 + 消息流 + 输入框；消息流内部滚动，页面不滚。
   58px = 顶栏（12 + 34 + 12），58px = 底部 tab；dvh 随键盘 / 地址栏收放。
   日常 Tab 隐藏了顶栏，高度相应补回 58px。 */
.pane.pane-chat {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 58px - 58px - env(safe-area-inset-bottom));
  height: calc(100dvh - 58px - 58px - env(safe-area-inset-bottom));
  min-height: 0;
  padding: 0;
}
body.tab-daily .pane.pane-chat {
  height: calc(100vh - 58px - env(safe-area-inset-bottom));
  height: calc(100dvh - 58px - env(safe-area-inset-bottom));
}

.chat-head {
  position: relative;
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: calc(6px + env(safe-area-inset-top)) 12px 2px;
}
.chat-icon {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: none;
  color: var(--text-2);
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  font-family: inherit;
}
.chat-icon:active { background: var(--gray-soft); }
/* 模型选择并入头部居中（替代原「日常」标题 + 独立模型条，少一层） */
.chat-model {
  flex: 1;
  min-width: 0;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 5px;
  height: 36px;
  padding: 0 4px;
  border: none;
  background: none;
  color: var(--text);
  font-size: 15px;
  font-weight: 650;
  letter-spacing: 0.2px;
  cursor: pointer;
  font-family: inherit;
}
.chat-model:active { opacity: 0.55; }
.chat-model span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.model-caret { flex: none; color: var(--text-3); font-size: 10px; }
.chat-actions { flex: none; display: flex; align-items: center; gap: 10px; }
.chat-dev {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  color: var(--text-3);
}
.chat-dev:empty { display: none; }
.chat-dev .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--text-3); }
.chat-dev .dot.off { background: var(--text-3); }
.chat-new {
  flex: none;
  height: 32px;
  padding: 0 6px;
  border: none;
  background: none;
  color: var(--brand-strong);
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
  font-family: inherit;
}
.chat-new:active { opacity: 0.55; }

.chat-stream {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 4px 16px 18px;
  scrollbar-width: none;
}
.chat-stream::-webkit-scrollbar { display: none; }

.chat-turn { flex: none; padding: 10px 0; }
.chat-user { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.chat-bubble {
  max-width: 84%;
  background: var(--brand);
  color: #fff;
  border-radius: 16px 16px 6px 16px;
  padding: 10px 14px;
  font-size: 14.5px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}
.chat-turn .bubble-atts { max-width: 84%; }

.chat-assistant { display: flex; align-items: flex-start; gap: 8px; margin-top: 10px; }
.chat-avatar {
  flex: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--brand-soft);
  object-fit: cover;
  display: flex;
  align-items: center;
  justify-content: center;
}
.chat-body {
  flex: 1;
  min-width: 0;
  padding: 1px 2px 0;
}

/* 助手正文复用 .md-body（Markdown 轻渲染），这里只微调字号与段落节奏 */
.chat-md { font-size: 14px; }
.chat-md .md-p { margin-bottom: 8px; }
.chat-status {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  color: var(--text-3);
  line-height: 1.5;
}
.chat-status + .chat-status { margin-top: 4px; }
.chat-status.is-running { color: var(--text-2); }
.chat-dot {
  flex: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand);
  animation: pulse 1.2s ease-in-out infinite;
}
.chat-err { font-size: 13px; color: var(--red); line-height: 1.6; white-space: pre-wrap; word-break: break-word; }
.chat-arts { margin-top: 6px; border-top: 1px solid var(--border); padding-top: 2px; }
.chat-action {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
  padding: 0;
  border: none;
  background: none;
  color: var(--brand-strong);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.chat-action + .chat-action { margin-left: 14px; }

/* 空态：占满消息流，垂直居中。只留「你好，xx」+ 一句介绍（对齐壳端） */
.chat-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 8px 4px 24px;
}
.chat-empty-title { font-size: 24px; font-weight: 800; letter-spacing: 0.5px; }
.chat-empty-sub { margin-top: 10px; max-width: 330px; font-size: 13px; line-height: 1.6; color: var(--text-3); }

/* 输入区：白底与 tabbar 连成一片，由 tabbar 的 border-top 分隔 */
.chat-composer {
  flex: none;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 8px 12px 10px;
  background: var(--surface);
}
.chat-input {
  flex: 1;
  min-height: 42px;
  max-height: 120px;
  border-radius: 21px;
  border: 1.5px solid var(--border);
  background: var(--bg);
  padding: 10px 15px;
  font-size: 15px;
  line-height: 1.4;
  color: var(--text);
  outline: none;
  resize: none;
  font-family: inherit;
}
.chat-input:focus { border-color: var(--brand); }
.chat-send {
  flex: none;
  height: 42px;
  padding: 0 16px;
  border-radius: 21px;
  border: none;
  background: var(--brand);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.12s ease, opacity 0.2s ease;
}
.chat-send:active { transform: scale(0.95); }

/* 模型 / 历史底部面板：mask(30) < pop(31) < toast(60) */
.chat-pop-mask {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(24, 27, 42, 0.32);
  animation: fadeIn 0.16s ease;
}
.chat-pop {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  z-index: 31;
  width: 100%;
  max-width: 560px;
  max-height: 64vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--surface);
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -12px 32px rgba(24, 27, 42, 0.2);
  padding: 16px 16px calc(18px + env(safe-area-inset-bottom));
  animation: popUp 0.2s ease;
}
@keyframes popUp { from { transform: translate(-50%, 30px); opacity: 0; } }

/* 历史记录：左侧全高抽屉（长列表可滚动；模型选择仍走底部面板） */
.chat-pop.drawer {
  left: 0;
  right: auto;
  top: 0;
  bottom: 0;
  transform: none;
  width: min(78vw, 300px);
  max-width: none;
  max-height: none;
  height: 100vh; /* 显式全高：不依赖包含块（与底部 tab 同屏时也铺满） */
  height: 100dvh;
  border-radius: 0 20px 20px 0;
  box-shadow: 12px 0 32px rgba(24, 27, 42, 0.18);
  padding: calc(16px + env(safe-area-inset-top)) 14px calc(18px + env(safe-area-inset-bottom)) 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: drawerIn 0.22s ease;
}
@keyframes drawerIn { from { transform: translateX(-100%); } }
.chat-pop.drawer .pop-list { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; margin-right: -6px; padding-right: 6px; gap: 2px; }
.pop-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-bottom: 10px; }
.pop-head .pop-title { padding: 0; }
.pop-new {
  border: none;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 12.5px;
  font-weight: 700;
  padding: 7px 12px;
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
}
.pop-new:active { opacity: 0.75; }
.pop-group { font-size: 11.5px; font-weight: 700; color: var(--text-3); padding: 10px 6px 3px; }
.pop-group:first-child { padding-top: 2px; }
.pop-title { font-size: 13px; font-weight: 700; color: var(--text-2); padding: 0 2px 10px; }
.pop-list { display: flex; flex-direction: column; gap: 4px; }
.pop-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  padding: 11px 12px;
  border: none;
  border-radius: 12px;
  background: none;
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
}
.pop-item:active { background: var(--gray-soft); }
.pop-item.picked { background: var(--brand-soft); }
.pop-item-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pop-item-name { font-size: 14.5px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.pop-item-desc { font-size: 12px; color: var(--text-3); line-height: 1.45; }
.pop-check { color: var(--brand); font-size: 13px; }
.pop-empty { padding: 26px 0; text-align: center; font-size: 13px; color: var(--text-3); }

/* 历史对话行：左点进会话，右侧删（与工作 Tab 的删除同一语义） */
.pop-row { display: flex; align-items: center; gap: 4px; border-radius: 12px; }
.pop-row.picked { background: var(--brand-soft); }
.pop-row-main {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  padding: 9px 2px 9px 10px;
  border: none;
  border-radius: 12px;
  background: none;
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
}
.pop-row-main:active { background: var(--gray-soft); }
/* 历史标题：单行 + 省略（抽屉收紧后避免两行换行） */
.pop-thread-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.pop-name {
  display: block;
  min-width: 0;
  font-size: 14px;
  font-weight: 600;
  line-height: 21px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* 历史副标题：该对话使用的模型（打开后模型条同步跟随） */
.pop-sub {
  display: block;
  font-size: 11.5px;
  color: var(--text-3);
  line-height: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pop-del {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: none;
  background: none;
  color: var(--text-3);
  border-radius: 10px;
  cursor: pointer;
  font-family: inherit;
}
.pop-del svg { width: 16px; height: 16px; }
.pop-del:active { background: var(--red-soft); color: var(--red); }

/* ---------------- 工作派单：四档选择（只露档位名） ---------------- */

.model-chips { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.model-chip {
  min-width: 0;
  height: 32px;
  border-radius: 9px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.model-chip.active { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-strong); }
.model-chip:active { transform: scale(0.98); }

.tier-badge {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 8px;
  border-radius: 99px;
  background: var(--gray-soft);
  color: var(--text-2);
  font-size: 11.5px;
  font-weight: 600;
}

.form-hint { font-size: 12.5px; color: var(--text-3); line-height: 1.6; }
