:root {
  --brand: #c94e22;
  --brand-dark: #a83f1b;
  --bg: #f8f7f4;
  --card: #ffffff;
  --text: #2b2b2b;
  --muted: #999999;
  --border: #eeeeee;
  --line: #e9e1d8;
  --chat-font: 15px;
  --ai-bubble: #f3ede9;
  --ai-text-muted: #8a857f;
  --avatar-bg: #e8e2db;
  --code-bg: #f0eae4;
  --code-fg: #b23b2e;
  --pre-bg: #f5f2ef;
  --ink: #1d1d1d;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body { margin: 0; }
img { max-width: 100%; }
input, textarea, select, button { font-family: inherit; }

html, body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: var(--bg);
  font-size: 15px;
  overflow-x: hidden;   /* 防横向溢出：内容被挤宽时不往右变形/出现横向滚动 */
  max-width: 100%;
}

/* 顶部栏 */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--brand);
  color: #fff;
}
/* 顶栏全站渲染：移动端非首页隐藏它（导航走底部 tabbar），首页保留品牌栏；桌面端全站显示 → 任意页都有三页导航 */
@media (max-width: 899.98px) {
  .topbar { display: none; }
}
body.on-home .topbar { display: block; }
.topbar-inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 52px;
  padding: 0 16px;
}
.brand { font-size: 18px; font-weight: 700; letter-spacing: 1px; }
.nav-links { display: none; gap: 24px; }
.nav-links a { color: #fff; font-size: 15px; text-decoration: none; opacity: 0.9; }
.nav-links a.active { opacity: 1; font-weight: 700; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.phone { font-size: 13px; opacity: 0.9; }
.logout { color: #fff; font-size: 13px; text-decoration: none; opacity: 0.9; }

/* 主容器 */
.container {
  max-width: 640px;
  margin: 0 auto;
  padding: 16px 16px 80px;
}

/* 卡片 */
.card {
  background: var(--card);
  border-radius: 12px;
  padding: 18px 16px;
  margin-bottom: 14px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}
.card-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--brand);
}
.card-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.card-title-row .card-title { margin-bottom: 0; }

/* 表单 */
.field { margin-bottom: 14px; }
.field label {
  display: block;
  font-size: 13px;
  color: #666;
  margin-bottom: 6px;
}
.field input, .field textarea, .field select {
  width: 100%;
  padding: 10px 12px;
  font-size: 15px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fafafa;
  color: var(--text);
  outline: none;
  font-family: inherit;
}
.field input:focus, .field textarea:focus, .field select:focus {
  border-color: var(--brand);
  background: #fff;
}
textarea { resize: vertical; }

/* 重点强调的「选题 / 内容」框 */
.field.focus-field {
  border: 1.5px solid var(--brand);
  border-radius: 10px;
  padding: 12px;
  background: rgba(201, 78, 34, 0.04);
}
.field.focus-field label { color: var(--brand); font-weight: 600; }
.field.focus-field textarea { background: #fff; min-height: 118px; }

.radio-row { display: flex; gap: 20px; padding: 4px 0; }
.radio-row label { display: flex; align-items: center; gap: 6px; font-size: 15px; color: var(--text); margin: 0; }
.radio-row input[type="radio"] { accent-color: var(--brand); width: auto; }

/* 内容类型 × 推广平台：两级横排 tab */
.tab-group { margin: 4px 0 16px; display: flex; flex-direction: column; gap: 8px; }
.tab-row { display: flex; flex-wrap: wrap; gap: 8px; }
.tab-chip {
  flex: 0 0 auto;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--line, #e3dcd3);
  background: #fff;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
}
.tab-chip:hover { border-color: var(--brand); color: var(--brand); }
.tab-chip.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

/* 按钮 */
.btn-primary {
  display: inline-block;
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 13px 20px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-block { display: block; width: 100%; }

.btn-send {
  flex-shrink: 0;
  background: #fff;
  color: var(--brand);
  border: 1px solid var(--brand);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  cursor: pointer;
}
.btn-send:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-copy {
  background: #fff;
  color: var(--brand);
  border: 1px solid var(--brand);
  border-radius: 6px;
  padding: 5px 14px;
  font-size: 13px;
  cursor: pointer;
  margin-top: 10px;
}

.btn-del {
  background: none;
  color: #c0392b;
  border: none;
  font-size: 13px;
  cursor: pointer;
  /* 原来 2px 4px → 手机上实测命中区 34×21（历史卡片右上角）。它旁边没有别的东西，
     但「删除」是个**破坏性**操作：点不准的代价是误删，比点不到更糟。撑到 ~28px 高。 */
  padding: 6px 8px;
  border-radius: 6px;
}

.btn-mini {
  color: var(--brand);
  font-size: 13px;
  text-decoration: none;
  /* 4px 8px → 手机上 27px 高。这一排（编辑/删除/去对聊…）是「我的」页唯一的操作入口，
     手指够得着的下限约 28px（Apple 建议 44，但那是整屏只有一个主按钮时的标准）。 */
  padding: 6px 10px;
  border: 1px solid var(--brand);
  border-radius: 6px;
  margin-left: 6px;
}
.btn-mini-del { color: #c0392b; border-color: #c0392b; }
.btn-mini-plain { color: #6f5c4b; border-color: #d8cabc; background: #faf6f0; }

.btn-plain {
  background: #fff;
  color: #666;
  border: 1px solid #ddd;
  border-radius: 10px;
  padding: 12px 20px;
  font-size: 15px;
  cursor: pointer;
}

.code-row { display: flex; gap: 10px; }
.loc-row { display: flex; gap: 10px; }
.loc-row input { flex: 1; }
.loc-row .btn-send { padding: 10px 16px; }

/* 上传产品/门店图 */
.up-grid { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 10px; }
.up-thumb {
  position: relative;
  width: 82px; height: 82px;
  border-radius: 8px; overflow: hidden;
  border: 1px solid var(--line, #eee);
}
.up-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.up-del {
  position: absolute; top: 2px; right: 2px;
  width: 20px; height: 20px; line-height: 18px; text-align: center;
  background: rgba(0,0,0,0.55); color: #fff; border-radius: 50%;
  font-size: 15px; cursor: pointer; user-select: none;
}
.up-row { display: flex; align-items: center; gap: 12px; }

/* 继续修改（续写）输入行 */
/* 豆包式输入条 pill */
.revise-row {
  display: flex; align-items: center; gap: 4px; margin-top: 8px;
  background: #fff; border: 1px solid var(--border); border-radius: 24px;
  padding: 5px 10px;
}
.revise-row input {
  flex: 1; min-width: 0; padding: 9px 4px; font-size: 15px;
  border: none; background: transparent; color: var(--text);
  outline: none; font-family: inherit;
}
.revise-row input:focus { border: none; background: transparent; }
.bar-btn {
  flex-shrink: 0; width: 38px; height: 38px; border: none; background: transparent;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: #5f5f5f;
}
.bar-btn:hover { background: #f2f2f2; }
.bar-btn svg { width: 22px; height: 22px; fill: currentColor; }
.bar-send { background: var(--brand); color: #fff; }
.bar-send:hover { background: var(--brand); }
.bar-send svg { fill: #fff; }
.bar-send:disabled { opacity: 0.4; cursor: not-allowed; }
/* 「每次问 / 自动」模式胶囊（B6，2026-10-12）：输入条最左边那颗两态小键。
   刻意不复用 .bar-btn —— 那是 38×38 的圆形图标按钮，这是带字的小胶囊。 */
.ui-mode-pill {
  flex-shrink: 0; height: 30px; min-width: 62px; padding: 0 11px; margin-right: 2px;
  text-align: center; box-sizing: border-box;
  border: 1px solid var(--border); border-radius: 15px; background: transparent;
  color: #5f5f5f; font-size: 12px; font-family: inherit; line-height: 28px;
  cursor: pointer; white-space: nowrap;
}
.ui-mode-pill:hover { background: #f2f2f2; }
.ui-mode-pill.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.ui-mode-pill.on:hover { background: var(--brand); }
.bar-plus svg { fill: #5f5f5f; }
/* 语音「按住说话」条 */
.voice-bar {
  position: relative; display: flex; align-items: center; justify-content: center;
  margin-top: 8px; height: 50px; font-size: 15px; font-weight: 600;
  background: #fff; border: 1px solid var(--brand); border-radius: 25px;
  color: var(--brand); cursor: pointer; user-select: none; -webkit-user-select: none;
  touch-action: none;
}
.voice-bar:active { background: #fdf0e8; }
.voice-bar.recording { background: #fdf0e8; border-color: #e0392b; color: #e0392b; }
.voice-kb { position: absolute; right: 12px; border: none; background: transparent; font-size: 18px; cursor: pointer; }
/* 更多功能弹层（+ 号） */
.more-mask { position: fixed; inset: 0; z-index: 40; background: rgba(0,0,0,0.16); }
.more-menu {
  position: fixed; left: 12px; right: 12px; bottom: 92px; z-index: 41;
  background: #fff; border-radius: 16px; padding: 10px;
  display: flex; flex-wrap: wrap; gap: 8px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.12);
}
.more-menu .fn-chip { margin: 0; }
#reviseLog { margin-top: 10px; }
#reviseLog div { margin-top: 4px; }

/* 底部标签栏 */
.tabbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  background: #fff;
  border-top: 1px solid var(--border);
  height: 56px;
  z-index: 10;
}
.tabbar a {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #999;
  text-decoration: none;
  font-size: 15px;
}
.tabbar a.active { color: var(--brand); font-weight: 700; }
/* 猫导 C 位中心圆（不超出导航栏，避免盖住输入框；用猫掌图标） */
.tabbar a.tabbar-center { flex-direction: column; justify-content: center; gap: 1px; }
.tabbar-orb {
  width: 38px; height: 38px;
  margin-top: 0;
  border-radius: 50%;
  background: var(--brand, #c94e22);
  color: #fff;
  font-size: 20px;
  display: flex; align-items: center; justify-content: center;
  border: 3px solid #fff;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.16);
}
.tabbar a.active .tabbar-orb { background: #a83e19; }
.tabbar-orb-lab { font-size: 11px; margin-top: 1px; }

/* 首页：猫导能力 · 多行展开（不横向滑动） */
.cap-card {
  background: #fff;
  border: 1px solid var(--line, #e3dcd3);
  border-radius: 18px;
  padding: 10px 8px 14px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .04);
  margin-bottom: 8px;
}
.cap-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 2px;
}
.cap-chip {
  width: 100%; box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  background: #fdf6f0;
  color: var(--text);
  border: 1px solid var(--line, #e3dcd3);
  border-radius: 999px;
  padding: 9px 6px;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  min-width: 0;
}
.cap-chip:hover { border-color: var(--brand); color: var(--brand); }
.cap-chip.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.cap-emoji { font-size: 15px; }

/* 写文案页左上角三条杠（历史抽屉） */
.app-menu {
  position: fixed;
  top: 66px; left: 14px;
  z-index: 20;
  width: 40px; height: 40px;
  background: #fdf6f0; color: var(--text);
  border: 1px solid var(--line, #e3dcd3); border-radius: 10px;
  font-size: 18px; line-height: 1; cursor: pointer;
}
.app-menu:hover { border-color: var(--brand); color: var(--brand); }
.hist-item { padding: 12px; border: 1px solid #f0eae4; border-radius: 12px; margin-bottom: 10px; background: #fff; }
.hist-item-head { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 12px; }
.hist-item-del { cursor: pointer; font-size: 16px; padding: 0 4px; color: var(--muted); }
.hist-item-del:hover { color: #e0524a; }
.hist-item-prod { font-size: 15px; font-weight: 600; color: var(--text); margin-top: 6px; }
.hist-item-hook { font-size: 13px; color: #6b6560; margin-top: 4px; line-height: 1.5; }
.hist-item-actions { display: flex; gap: 8px; margin-top: 10px; }
.hist-item-detail { margin-top: 8px; padding-top: 8px; border-top: 1px dashed #f0eae4; }
.hist-row { display: flex; gap: 8px; font-size: 13px; margin: 4px 0; }
.hist-label { flex: none; width: 78px; color: var(--muted); }
.hist-val { flex: 1; color: var(--text); word-break: break-word; white-space: pre-wrap; line-height: 1.5; }
.hist-script { font-variant-ligatures: none; }

/* 写文案双模式切换 */
.mode-switch {
  display: flex;
  gap: 8px;
  margin: 0 0 14px;
  padding: 4px;
  background: #f2ede7;
  border-radius: 999px;
}
.mode-btn {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  padding: 9px 0;
  border-radius: 999px;
  cursor: pointer;
}
.mode-btn.active { background: #fff; color: var(--brand); font-weight: 700; box-shadow: 0 1px 4px rgba(0,0,0,0.08); }

/* agent 写文案卡 */
.copy-card { cursor: pointer; color: var(--brand); font-weight: 600; }
.copy-card:hover { border-color: var(--brand); }

/* 提示 */
.muted { color: var(--muted); font-size: 13px; }
.empty { text-align: center; color: var(--muted); padding: 60px 0; font-size: 15px; }
.empty a { color: var(--brand); }

/* 登录页 */
.login-body { background: var(--brand); min-height: 100vh; }
.login-box {
  max-width: 400px;
  margin: 0 auto;
  padding: 60px 24px;
  background: var(--bg);
  border-radius: 16px;
  margin-top: 12vh;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}
.login-logo { font-size: 28px; font-weight: 800; color: var(--brand); text-align: center; letter-spacing: 2px; }
.login-sub { text-align: center; color: var(--muted); font-size: 13px; margin: 8px 0 28px; }
.login-tip { text-align: center; color: var(--muted); font-size: 12px; margin-top: 14px; }
.login-back { display: inline-block; color: var(--brand); font-size: 14px; text-decoration: none; margin-bottom: 8px; }

/* 登录方式切换 */
.login-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  margin-bottom: 18px;
}
.login-tab {
  flex: 1;
  text-align: center;
  padding: 10px 0;
  color: var(--muted);
  font-size: 15px;
  text-decoration: none;
  border-bottom: 2px solid transparent;
}
.login-tab.active {
  color: var(--brand);
  font-weight: 700;
  border-bottom-color: var(--brand);
}

/* 结果区 */
.result-text { white-space: pre-wrap; line-height: 1.7; font-size: 15px; }
.script-text { white-space: pre-wrap; line-height: 1.8; font-size: 15px; }
.result-tags { white-space: pre-wrap; line-height: 1.7; font-size: 15px; color: var(--brand); margin-top: 2px; }
.hist-tags { color: var(--brand); line-height: 1.6; margin-top: 2px; }
.ai-badge { text-align: center; color: var(--muted); font-size: 12px; margin: 8px 0 16px; }

/* 生成进度分步 */
.prog {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 0 0 16px;
}
.prog-step {
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 13px;
  color: var(--muted);
  transition: all 0.2s;
}
.prog-step.on {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
  font-weight: 600;
}
.prog-arrow { color: var(--muted); font-style: normal; font-size: 13px; }

/* 结果区操作栏：一键复制全部 / 换个思路重写 */
.result-bar { display: flex; gap: 12px; margin-bottom: 14px; }
.ver-badge {
  align-self: center;
  color: var(--brand);
  background: rgba(201, 78, 34, 0.08);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13px;
  flex: 0 0 auto;
  margin-right: auto;
}
.result-bar .btn-copy { margin-top: 0; flex: 1; text-align: center; background: var(--brand); border-color: var(--brand); color: #fff; padding: 11px 14px; border-radius: 10px; font-size: 15px; }
.result-bar .btn-copy:last-child { background: #fff; color: var(--brand); }

/* 历史 */
.hist-item { margin-bottom: 12px; }
.hist-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.hist-time { color: var(--muted); font-size: 12px; }
.hist-product { font-weight: 600; font-size: 15px; margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hist-preview { color: #555; font-size: 14px; line-height: 1.5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hist-toggle { margin-top: 8px; }
.hist-detail { margin-top: 6px; padding-top: 6px; border-top: 1px dashed #eee; }
.hist-row { margin-bottom: 10px; }
.hist-row .btn-copy { margin-top: 2px; }
.hist-label { color: var(--brand); font-weight: 700; font-size: 13px; margin-bottom: 2px; }
.hist-val { color: #222; font-size: 14px; line-height: 1.6; white-space: pre-wrap; word-break: break-word; }
.hist-row-script .hist-val { line-height: 1.8; }

/* 超长字段二次折叠展开（历史详情里的产品/提示词等） */
.hist-clamp.clamped { max-height: 104px; overflow: hidden; }
.hist-clamp.clamped.expanded { max-height: none; overflow: visible; }
.hist-clamp-toggle { margin-top: 6px; }

/* 商家列表 */
.merchant-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.merchant-item:last-child { border-bottom: none; }
.merchant-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.merchant-info { flex: 1; min-width: 0; }
.merchant-name { font-weight: 600; font-size: 15px; }
.merchant-preview { color: #555; font-size: 13px; line-height: 1.5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.btn-toggle { flex-shrink: 0; margin-top: 2px; }
.merchant-ops { margin-top: 6px; display: flex; gap: 8px; }
.merchant-detail { margin-top: 6px; padding-top: 6px; border-top: 1px dashed #eee; }
.merchant-row { margin-bottom: 8px; }
.merchant-row .hist-val { color: #222; font-size: 14px; line-height: 1.6; }

/* 访客记录（管理员） */
.rec-list { display: flex; flex-direction: column; }
.rec-row { display: grid; grid-template-columns: 1.4fr 0.6fr 1fr 1fr; gap: 8px; padding: 10px 4px; border-bottom: 1px solid var(--border); color: #222; text-decoration: none; align-items: center; font-size: 14px; }
.rec-row.rec-head { color: var(--muted); font-size: 12px; padding-bottom: 6px; }
.rec-row:not(.rec-head):active { background: rgba(201, 78, 34, 0.06); }
.rec-phone { font-weight: 600; }
.rec-cnt { color: var(--brand); text-align: center; }
.rec-active, .rec-time { color: #555; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .5px; }

/* 弹层 */
.mask {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.form-panel {
  width: 100%;
  max-width: 640px;
  max-height: 85vh;
  overflow-y: auto;
  background: #fff;
  border-radius: 16px 16px 0 0;
  padding: 20px 16px 24px;
}
.form-panel h3 { margin: 0 0 16px; color: var(--brand); font-size: 17px; }
.form-ops { display: flex; gap: 12px; margin-top: 16px; }
.form-ops .btn-primary { flex: 1; }

/* 商家画像提示条：没建过画像时提醒去建 */
.merchant-hint {
  margin-top: 10px; padding: 10px 12px; border-radius: 10px;
  background: rgba(201, 78, 34, 0.08); border: 1px solid rgba(201, 78, 34, 0.22);
  color: #a0441f; font-size: 13px; line-height: 1.5;
  display: flex; align-items: flex-start; gap: 8px;
}
.merchant-hint-close {
  flex: none; background: transparent; border: none; color: inherit;
  font-size: 16px; line-height: 1; cursor: pointer; padding: 0 2px; margin-left: auto;
}

/* 猫导拿不准反问弹窗 */
.ask-q { font-size: 15px; font-weight: 700; color: #222; line-height: 1.5; margin: 4px 0 10px; }
.ask-opts { display: flex; flex-wrap: wrap; gap: 8px; }
.ask-opt {
  background: #fff; color: var(--brand); border: 1px solid var(--brand);
  border-radius: 20px; padding: 8px 16px; font-size: 14px; cursor: pointer;
}
.ask-opt:active { background: var(--brand); color: #fff; }
.ask-opt.sel { background: var(--brand); color: #fff; }
.ask-item + .ask-item { border-top: 1px solid #f0f0f0; margin-top: 12px; padding-top: 14px; }
.ask-custom {
  width: 100%; box-sizing: border-box; margin-top: 10px;
  border: 1px solid #ddd; border-radius: 10px; padding: 8px 12px; font-size: 14px; font-family: inherit;
}
.ask-custom:focus { outline: none; border-color: var(--brand); }

/* 意见反馈（管理员收集） */
.fb-item { padding: 12px 0; border-bottom: 1px solid var(--border); }
.fb-item:last-child { border-bottom: none; }
.fb-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.fb-phone { font-weight: 600; color: #222; font-size: 15px; }
.fb-time { color: var(--muted); font-size: 13px; }
.fb-content { font-size: 15px; color: #333; line-height: 1.6; white-space: pre-wrap; word-break: break-word; }
.fb-contact { margin-top: 6px; font-size: 13px; color: var(--brand); }

/* 未登录提醒弹窗 */
#loginMask { align-items: center; }
.auth-box {
  width: 86%;
  max-width: 340px;
  background: #fff;
  border-radius: 16px;
  padding: 26px 20px 22px;
  text-align: center;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}
.auth-title { font-size: 18px; font-weight: 700; color: var(--text); margin-bottom: 10px; }
.auth-desc { font-size: 14px; color: #666; line-height: 1.6; margin-bottom: 20px; }
.auth-ops { display: flex; gap: 12px; }
.auth-ops .btn-primary, .auth-ops .btn-plain { flex: 1; }

/* Toast */
#toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.78);
  color: #fff;
  padding: 12px 22px;
  border-radius: 10px;
  font-size: 14px;
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
  max-width: 80vw;
  text-align: center;
}
#toast.show { opacity: 1; }

/* 响应式栅格：手机单列，桌面双栏 */
.form-grid { display: block; }
.hist-grid { display: block; }
.card-narrow { max-width: 560px; margin-left: auto; margin-right: auto; }

@media (min-width: 900px) {
  .nav-links { display: flex; }
  .tabbar { display: none; }
  .container { max-width: 960px; }
  /* 桌面有顶栏(52px 粘顶) + 无底部导航：聊天页占满剩余高度，底部留 16px，不整页滚动 */
  .chat-page { height: calc(100dvh - 68px); }
  .form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    align-items: start;
  }
  .form-grid .card { margin-bottom: 0; }
  .hist-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
  }
  .hist-grid .card { margin-bottom: 0; }
}

/* 首页 */
.home-container { max-width: 960px; padding-top: 40px; }
.home-hero { text-align: center; padding: 24px 8px 36px; }
.home-logo {
  display: inline-block;
  font-size: 15px;
  color: var(--brand);
  border: 1px solid var(--brand);
  border-radius: 20px;
  padding: 4px 16px;
  margin-bottom: 18px;
  letter-spacing: 2px;
}
.home-title { font-size: 30px; font-weight: 800; margin: 0 0 12px; line-height: 1.3; }
.home-sub { color: var(--muted); font-size: 15px; line-height: 1.7; max-width: 520px; margin: 0 auto 24px; }
.home-cta { display: flex; gap: 12px; justify-content: center; }
.home-cta .btn-primary, .home-cta .btn-plain { text-decoration: none; }
.home-cards { display: grid; gap: 14px; margin-bottom: 14px; }
.home-card { position: relative; }
.home-card-tag { color: var(--brand); font-weight: 700; font-size: 13px; margin-bottom: 8px; }
.home-card-title { font-size: 17px; font-weight: 700; margin-bottom: 6px; }
.home-card-desc { color: #555; font-size: 14px; line-height: 1.6; }
.home-contact p { margin: 6px 0; }
.home-footer { text-align: center; color: var(--muted); font-size: 12px; padding: 20px 0 40px; }

@media (min-width: 900px) {
  .home-cards { grid-template-columns: repeat(3, 1fr); }
}

/* 门户首页：顶部公司介绍轮播 */
.banner {
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  margin-bottom: 22px;
  touch-action: pan-y; /* 允许纵向滚动页面，横向滑动交给轮播 */
}
.b-track {
  display: flex;
  transition: transform 0.5s ease;
  transform: translateX(calc(var(--i, 0) * -100%));
}
.b-slide {
  flex: 0 0 100%;
  min-width: 100%;
  height: 230px;
  padding: 36px 40px;
  box-sizing: border-box;
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative; /* 让 .b-brand 头像锚定在本张 slide 上，跟着轮播走 */
}
.b-slide-1 { background: linear-gradient(145deg, #b83f1a 0%, #d96a2a 55%, #e88a3d 100%); padding-right: clamp(100px, 28vw, 150px); } /* 给右侧头像留位，避免文字压图 */
/* 品牌主视觉：首页正文第一张 <img>，微信抓它做分享卡片封面（微信不认 og:image，取 body 首图） */
.b-brand {
  position: absolute;
  right: clamp(16px, 6vw, 30px);
  top: 50%;
  transform: translateY(-50%);
  width: clamp(76px, 20vw, 116px);
  height: clamp(76px, 20vw, 116px);
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.28);
}
.b-slide-2 { background: linear-gradient(145deg, #2f5496 0%, #4a7ec1 60%, #6fa0d8 100%); }
.b-slide-3 { background: linear-gradient(145deg, #1f1f1f 0%, #3a3a3a 60%, #555 100%); }
.b-tag { font-size: 13px; opacity: 0.85; letter-spacing: 2px; margin-bottom: 12px; }
.b-title { font-size: 26px; font-weight: 800; line-height: 1.4; margin-bottom: 10px; }
.b-sub { font-size: 14px; opacity: 0.9; }
.b-dots {
  position: absolute;
  bottom: 14px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 8px;
}
.b-dot { width: 8px; height: 8px; border-radius: 50%; background: rgba(255, 255, 255, 0.5); cursor: pointer; }
.b-dot.active { background: #fff; }

/* 三个核心服务方块 */
.svc-grid { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 22px; }
.svc {
  flex: 1 1 30%;
  min-width: 130px;
  background: var(--card);
  border-radius: 18px;
  padding: 26px 16px;
  text-align: center;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
  cursor: pointer;
}
.svc-main { background: linear-gradient(145deg, #b83f1a 0%, #e8823d 100%); color: #fff; }
.svc-icon { font-size: 40px; line-height: 1; margin-bottom: 12px; }
.svc-name { font-size: 17px; font-weight: 700; margin-bottom: 6px; }
.svc-desc { font-size: 13px; line-height: 1.5; opacity: 0.85; }

/* 下方横栏：其他服务 */
.hmenu { display: flex; flex-direction: column; gap: 16px; }
.hitem {
  display: flex;
  align-items: center;
  background: var(--card);
  border-radius: 16px;
  padding: 18px 20px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
  cursor: pointer;
}
.hitem-icon { font-size: 32px; margin-right: 16px; }
.hitem-logo { width: 52px; height: 52px; object-fit: cover; border-radius: 12px; display: block; margin-right: 16px; }
.hitem-name { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.hitem-desc { font-size: 13px; color: var(--muted); }

/* 门户首页容器微调 */
.home-container { padding-top: 22px; }

/* 服务案例 */
.home-section-title {
  font-size: 17px;
  font-weight: 700;
  margin: 6px 0 14px;
  color: var(--text);
}
.case-grid { display: grid; gap: 12px; margin-bottom: 24px; }
.case-card { cursor: pointer; margin-bottom: 0; }
.case-tag { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--brand); margin-bottom: 8px; }
.case-badge {
  background: rgba(201, 78, 34, 0.1);
  border-radius: 10px;
  padding: 2px 10px;
  font-size: 12px;
}
.case-hook { font-size: 14px; color: #444; line-height: 1.6; }

/* 联系我们 */
.contact-card { margin-bottom: 8px; }
.contact-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 4px;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.contact-item:last-child { border-bottom: none; }
.contact-icon { font-size: 26px; flex-shrink: 0; }
.contact-body { flex: 1; }
.contact-main { font-size: 15px; font-weight: 600; margin-bottom: 3px; }
.contact-sub { font-size: 13px; color: var(--muted); }
.contact-arrow { color: var(--muted); font-size: 18px; }
/* 加微信：行内小二维码 */
.contact-qr {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
}
/* 加微信：全屏码弹层 */
.qr-mask {
  display: none;              /* 默认隐藏，点击才弹 */
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  z-index: 999;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.qr-panel {
  background: #fff;
  border-radius: 20px;
  padding: 28px 24px 24px;
  text-align: center;
  max-width: 360px;
  width: 100%;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}
.qr-title { font-size: 16px; font-weight: 700; margin-bottom: 16px; color: var(--text); }
.clip-ops { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.qr-img {
  width: 260px;
  height: 260px;
  object-fit: contain;
  border-radius: 8px;
  display: block;
  margin: 0 auto;
}
.qr-hint { font-size: 13px; color: var(--muted); margin: 14px 0 18px; }
.qr-close {
  display: inline-block;
  background: var(--accent, #c94e22);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  padding: 10px 36px;
  cursor: pointer;
}

@media (min-width: 900px) {
  .case-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 420px) {
  .svc { padding: 20px 10px; }
  .svc-icon { font-size: 34px; }
  .svc-name { font-size: 15px; }
  .svc-desc { font-size: 12px; }
}

/* ── 智能体：训练预览 + 对聊气泡 ── */
.result-sec {
  font-size: 14px;
  font-weight: 700;
  color: var(--brand);
  margin: 16px 0 8px;
  padding-top: 6px;
  border-top: 1px solid var(--border);
}
.model-item { margin-bottom: 10px; }
.model-name { font-size: 15px; font-weight: 600; color: var(--text); }

.chat-box {
  max-height: 55vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 6px 0;
  background: var(--chat-bg, transparent);
}
/* 旧的「消息行即气泡」块已被下方新版「头像外置 + .msg-content 为气泡」布局覆盖删除 */
/* 改稿聊天：助理气泡装整份文案卡片，全宽无底色，交给内层 .card 做视觉结构 */
.msg-cards {
  max-width: 100%;
  align-self: stretch;
  background: transparent;
  padding: 0;
  border-radius: 0;
}
.msg-cards .card { margin: 0 0 12px; }
.msg-cards .ai-head { font-weight: 600; color: var(--brand); font-size: 15px; margin: 2px 0 4px; }
.msg-cards .ai-summary { color: var(--ai-text-muted); font-size: 14px; margin: 0 0 8px; }
.msg-cards .ai-body { margin-top: 8px; }
.msg-cards .ai-toggle { margin-top: 0; }

/* ── 智能体对聊：多话题 + 传图（persona_chat）── */
.chat-layout { display: flex; gap: 14px; align-items: flex-start; }
.chat-sidebar {
  flex: 0 0 168px; min-width: 0;
  border-right: 1px solid #eee; padding-right: 12px;
  display: flex; flex-direction: column; gap: 8px;
}
.chat-main { flex: 1; min-width: 0; }
.new-topic-btn {
  background: var(--brand); color: #fff; border: 0; border-radius: 8px;
  padding: 9px 12px; font-size: 14px; cursor: pointer; white-space: nowrap;
}
.thread-list { display: flex; flex-direction: column; gap: 6px; overflow-y: auto; max-height: 48vh; }
.thread-empty { color: #a49d97; font-size: 13px; padding: 8px 0; }
.thread-item {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  padding: 8px 10px; border-radius: 8px; cursor: pointer;
  background: #f6f2ee; color: var(--text); font-size: 14px;
}
.thread-item:hover { background: #efe9e3; }
.thread-item.active { background: var(--brand); color: #fff; }
.thread-title {
  flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.thread-item.active .thread-title { color: #fff; }
/* 抽屉里改名/删除：原来只有字形本身的大小（实测 ✎ = 13×16、× = 12×16），
   在手机上根本点不准 —— 撑出命中区（字号不变，加 padding）。 */
.thread-del { flex-shrink: 0; color: inherit; opacity: 0.55; font-size: 16px; line-height: 1; cursor: pointer; padding: 6px 8px; }
.thread-del:hover { opacity: 1; }
/* 气泡内图片 */
.msg-imgs { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.msg-imgs img.msg-img { max-width: 120px; max-height: 120px; border-radius: 8px; object-fit: cover; }
/* 输入区上方的待发缩略图 */
.attach-bar {
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
  padding: 8px; background: #faf7f3; border-radius: 8px; margin-top: 10px;
}
.attach-thumb { position: relative; }
.attach-thumb img { display: block; width: 56px; height: 56px; object-fit: cover; border-radius: 8px; }
.attach-thumb button {
  position: absolute; top: -6px; right: -6px; width: 20px; height: 20px;
  border-radius: 50%; border: 0; background: #e0392b; color: #fff;
  font-size: 13px; line-height: 20px; cursor: pointer; padding: 0;
}
/* 待发「文档/视频附件」chip（输入区上方）+ 用户气泡内的附件 chip。
   ⚠️ 名字住在自己的 `-tx` 那一格上，省略号也只能写在那儿：容器上写
   `overflow:hidden; text-overflow:ellipsis` 对 flex 行里那个**匿名文本项**是无效的 ——
   文本在 flex 里默认不可收缩到低于 min-content，于是挤不下时不是画省略号，而是把
   右边那颗 ×（`flex:none`）整个推出 chip 外面（375 宽实测 285px，屏幕上连点都点不到）。
   这正是 codex 账本第 7 条：让位的是**左边那段文字**，右边那颗控制件必须留住自己的位置。
   同小程序 `.attach-file-tx{flex:1;min-width:0;…ellipsis}` + `.attach-file-del{flex:none}`。
   —— 谁要改这几条：判据在 tests/attach-chip.test.js（结构）+ tests/ui/test_server_ui.py 的
   2Z 组（真浏览器量的像素）。 */
.attach-file {
  display: inline-flex; align-items: center; gap: 5px;
  background: #fff; border: 1px solid #e6e0d8; border-radius: 8px;
  padding: 7px 11px; font-size: 14px; color: #444; max-width: 220px;
  position: relative;
}
.attach-file-ic, .msg-file-ic { flex: none; }
.attach-file-tx, .msg-file-tx {
  flex: 1; min-width: 0;
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.attach-file button {
  flex: none; width: 18px; height: 18px; border-radius: 50%; border: 0;
  background: #e0392b; color: #fff; font-size: 12px; line-height: 18px;
  cursor: pointer; padding: 0;
}
.msg-files { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.msg-file {
  display: inline-flex; align-items: center; gap: 5px;
  background: #f3eeee; border-radius: 8px; padding: 6px 10px;
  font-size: 13px; color: #555; max-width: 220px;
}
.btn-attach {
  flex-shrink: 0; background: #fff; color: var(--brand);
  border: 1px solid var(--brand); border-radius: 8px;
  padding: 9px 11px; font-size: 15px; cursor: pointer; line-height: 1;
}
.btn-attach:hover { background: #fdf6f0; }
/* 窄屏：话题列表收到顶部紧凑横向滚动 */
@media (max-width: 640px) {
  .chat-layout { flex-direction: column; }
  .chat-sidebar { flex: none; width: 100%; border-right: 0; border-bottom: 1px solid #eee; padding: 0 0 10px; }
  .thread-list { flex-direction: row; overflow-x: auto; max-height: none; padding-bottom: 4px; }
  .thread-item { flex: 0 0 auto; max-width: 160px; }
}

/* 对聊页：返回上一页 */
.chat-back { display: inline-block; color: var(--brand); font-size: 14px; text-decoration: none; margin-bottom: 6px; }
.chat-back:hover { text-decoration: underline; }

/* 对聊：Markdown 渲染（助理气泡内） */
.msg-ai code { background: #ece5de; color: var(--code-fg); padding: 1px 5px; border-radius: 4px; font-size: 13px; }
.msg-ai strong { font-weight: 700; color: var(--text); }
.msg-ai em { color: var(--text); }
.msg-ai a { color: var(--brand); text-decoration: underline; }

/* 话题重命名按钮 */
.thread-ops { flex-shrink: 0; display: inline-flex; gap: 2px; }
.thread-rename { cursor: pointer; opacity: 0.5; font-size: 13px; line-height: 1.2; padding: 7px 8px; }
.thread-rename:hover { opacity: 1; }
.thread-item.active .thread-rename, .thread-item.active .thread-del { color: #fff; }

/* 聊天图片放大灯箱 */
.lightbox {
  position: fixed; inset: 0; background: rgba(0, 0, 0, 0.82); z-index: 1000;
  display: none; align-items: center; justify-content: center; cursor: zoom-out;
}
.lightbox img { max-width: 92vw; max-height: 92vh; border-radius: 8px; cursor: zoom-out; }
.lb-close {
  position: absolute; top: 14px; right: 16px; width: 40px; height: 40px;
  background: rgba(0, 0, 0, 0.4); color: #fff; font-size: 26px; line-height: 1;
  border: none; border-radius: 50%; cursor: pointer; z-index: 2;
}
.lb-close:hover { background: rgba(0, 0, 0, 0.6); }
.msg-img { cursor: zoom-in; }
.attach-thumb img { cursor: zoom-in; }

/* ── 猫导独立对话页 /chat（豆包式整页）── */
.chat-page {
  display: flex; flex-direction: column;
  max-width: 980px; margin: 0 auto;
  /* 顶部 padding 已归零，只需再减去底部导航 56，页面恰好填满、不产生整页滚动 */
  height: calc(100dvh - 56px); min-height: 480px;
}
/* 聊天页抹掉容器底内边距(80px)，避免页面多出可滚的空白，功能条+输入框才能真正钉在底部 */
/* 聊天页：容器上下内边距全归零，让页面从 webview 顶部开始，不留空白 */
main.container:has(> .chat-page) { padding: 0 16px; }
.chat-head {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 4px 10px; border-bottom: 1px solid #eee;
}
.chat-menu {
  flex: none;
  background: #fdf6f0; color: var(--text);
  border: 1px solid var(--line, #e3dcd3); border-radius: 10px;
  width: 38px; height: 38px; font-size: 17px; line-height: 1; cursor: pointer;
}
.chat-menu:hover { border-color: var(--brand); color: var(--brand); }
.chat-avatar { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; flex: none; }
.chat-head-info { flex: 1; min-width: 0; }
.chat-head-name { font-size: 17px; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-head-sub { font-size: 13px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* 窄屏：压缩头部固定控件宽度，让「猫导」名字 + AI 提示能完整横排，不再被挤成竖排/省略号 */
@media (max-width: 480px) {
  .chat-head { gap: 8px; padding: 6px 4px 8px; }
  .chat-avatar { width: 36px; height: 36px; }
  .chat-menu { width: 32px; height: 32px; font-size: 15px; border-radius: 8px; }
  .chat-speak { padding: 5px 8px; font-size: 12px; }
  .chat-voice { max-width: 70px; font-size: 12px; padding: 5px 4px; }
}
.chat-speak {
  flex: none;
  white-space: nowrap;               /* 文字不换行，窄屏时按钮不被折行显得消失 */
  background: #fdf6f0; color: var(--brand);
  border: 1px solid var(--line, #e3dcd3); border-radius: 999px;
  padding: 7px 14px; font-size: 14px; cursor: pointer;
}
.chat-speak:hover { border-color: var(--brand); }
/* 顶栏「＋ 新对话」（学 DeepSeek，2026-10-08 加）：与隔壁两颗药丸同一套取值，
   只有一处不同 —— `flex: none` + nowrap，它不许被压成「＋ …」（窄屏它进第一行，
   第一行有富余；真放不下该换行，不该截字）。 */
.chat-new {
  flex: none; white-space: nowrap;
  background: #fdf6f0; color: var(--text);
  border: 1px solid var(--line, #e3dcd3); border-radius: 999px;
  padding: 7px 14px; font-size: 14px; font-weight: 700; cursor: pointer;
}
.chat-new:hover { border-color: var(--brand); color: var(--brand); }
/* 头部「服务商家」下拉：跟其它头部控件同款，窄屏压窄 */
.merchant-select {
  flex: none; max-width: 130px; white-space: nowrap;
  background: #fdf6f0; color: var(--text);
  border: 1px solid var(--line, #e3dcd3); border-radius: 999px;
  padding: 7px 10px; font-size: 13px; cursor: pointer;
}
.merchant-select:hover { border-color: var(--brand); }
@media (max-width: 480px) {
  .merchant-select { max-width: 84px; font-size: 12px; padding: 6px 6px; }
}
.chat-main { display: flex; flex-direction: column; flex: 1 1 0; min-height: 0; }
.chat-box { max-height: none; flex: 1 1 0; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }

/* 会话列表侧滑抽屉（豆包式） */
.drawer-mask {
  position: fixed; inset: 0; background: rgba(0, 0, 0, 0.45);
  opacity: 0; visibility: hidden; transition: opacity .25s; z-index: 1000;
}
.drawer-mask.show { opacity: 1; visibility: visible; }
.chat-drawer {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: 80%; max-width: 320px; min-width: 260px;
  background: #fff; box-shadow: 0 0 24px rgba(0, 0, 0, 0.18);
  display: flex; flex-direction: column; padding: 18px 14px;
  transform: translateX(-100%); transition: transform .28s ease; z-index: 1001;
}
.chat-drawer.open { transform: translateX(0); }
.drawer-head { display: flex; align-items: center; gap: 10px; padding-bottom: 14px; border-bottom: 1px solid #f0eae4; }
.drawer-head .chat-avatar { width: 40px; height: 40px; }
.drawer-head-name { font-size: 16px; font-weight: 700; color: var(--text); }
.drawer-new { width: 100%; margin-top: 14px; }
.chat-drawer .thread-list { flex: 1; overflow-y: auto; margin-top: 12px; display: flex; flex-direction: column; gap: 4px; }
.drawer-foot { padding-top: 12px; border-top: 1px solid #f0eae4; }
.drawer-back {
  width: 100%; background: #fdf6f0; color: var(--text);
  border: 1px solid var(--line, #e3dcd3); border-radius: 999px;
  padding: 10px; font-size: 14px; cursor: pointer; text-align: center;
}
.drawer-back:hover { border-color: var(--brand); color: var(--brand); }
/* 抽屉里的「进入猫导世界」卡片：跳猫导设置页，做成品牌主色实心卡片区别于其他入口 */
.drawer-maodao {
  width: 100%; margin-bottom: 10px;
  background: var(--brand); color: #fff;
  border: 0; border-radius: 12px; padding: 12px;
  font-size: 15px; font-weight: 600; cursor: pointer; text-align: center;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.drawer-maodao:hover { background: #a83e19; }

/* 聊天气泡旁头像 + 每条朗读按钮 */
.msg-user, .msg-ai { display: flex; align-items: flex-start; gap: 8px; }
.msg-ai { flex-direction: row; }
.msg-avatar { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; margin-top: 2px; flex: none; }
.msg-user .msg-text, .msg-ai .msg-text { flex: 1 1 auto; min-width: 0; }
.msg-user { flex-direction: row-reverse; }
.msg-content { flex: 1 1 auto; min-width: 0; display: block; }


/* ── /chat 宽屏分屏：左栏 = 功能本体，右栏 = 猫导（2026-10-11）──────────────
   用户原话：「左侧聊天的分屏打开功能后直接在分屏上可以使用功能……猫导左侧填写和操控
   选择相关按钮。」这一屏从前**没有**宽屏布局（`.chat-page` 一直是 980 居中），所以
   这里是**新增**，不是复用 —— 与小程序那边（chat.wxss 的 @media(min-width:900px)）
   是同一套几何：左栏 375px，与小程序 750rpx（=375px，正好一整台手机）严格相等，
   于是面板在两端的版式完全一样，一条尺寸都不用为「左栏」另调。

   为什么动的是 `main.container` 而不是 `.chat-page`：网页的 `.chat-drawer` 与
   `.chat-page` 是**兄弟**（都在 main.container 里），`#pbPane` 也挂在那儿 ——
   要让它俩并排，能设 flex 的公共父节点就是 main.container 本身。
   （小程序那边抽屉在 .chat-page 内部，所以那边改的是 .chat-page 自己的 padding-left。
     两端结构不同、结论相同，别照着一边的写法去改另一边。）

   `max-width: none` 是这儿的关键：容器默认封顶 960px，不解开的话 375 左栏要从
   960 里切，聊天区只剩 537px（而 1280 屏上本该有 841px）。小程序那边对应的那句是
   `.chat-page{--wide-max:none}`。 */
@media (min-width: 900px) {
  main.container:has(> .chat-page.panel-open) {
    max-width: none;
    display: flex; gap: 16px; align-items: stretch;
  }
  .chat-page.panel-open { flex: 1 1 auto; min-width: 0; max-width: none; margin: 0; }
  /* 聊天区不跟着视口无限拉宽（1920 屏上满宽的气泡读起来很难受），挨着左栏留 980 */
  .chat-page.panel-open .chat-head,
  .chat-page.panel-open .chat-main { max-width: 980px; margin-right: auto; }
  main.container:has(> .chat-page.panel-open) .pb-pane { display: flex; }
}
/* 左栏本体。默认 display:none —— 上面那条 media query 里才放出来，
   且必须**同时**满足「宽屏」和「面板已打开」，窄屏 / 未打开都进不来。 */
.pb-pane {
  display: none;
  flex: 0 0 375px; width: 375px; min-width: 0;
  flex-direction: column;
  height: calc(100dvh - 68px);          /* 与宽屏 .chat-page 同高，两栏底部对齐 */
  box-sizing: border-box;
  background: #fff; border: 1px solid var(--line, #e3dcd3); border-radius: 14px;
  overflow-y: auto; overflow-x: hidden;
}

/* 左栏现在有四块（排版 / 短剧 / 录音笔 / 评论获客），同一时刻只显示一块。
   ⚠️ 上面 media query 里的 `display:flex` 是**作者样式**，会压过浏览器对 `[hidden]`
   的默认 `display:none`（UA 样式）—— 不钉这一条，打开短剧时那块没打开的排版面板
   会跟着一起被 flex 放出来。 */
.pb-pane[hidden] { display: none !important; }

/* 功能本体是整页 iframe 的两块：栏内不再滚动（滚动交给 iframe 里的页面），
   且 iframe 必须铺满整栏——中间留白会让它看起来像嵌歪了。 */
.pb-pane > iframe { display: block; width: 100%; height: 100%; border: 0; background: #fff; }
.pb-pane.pane-drama,
.pb-pane.pane-recorder,
.pb-pane.pane-leads { overflow: hidden; }
/* 短剧工作台比排版面板宽：它里面有场次表、镜头表和候选图，375 会挤成一列。
   仍然比聊天区窄（右栏始终是主体），只是不再按手机宽度硬切。 */
.pb-pane.pane-drama { flex: 0 0 clamp(440px, 40vw, 720px); width: clamp(440px, 40vw, 720px); }
/* 评论获客：线索卡一行要放「勾选 + 头像 + 昵称 + 意向 + 分数」，375 会把意向挤下去。 */
.pb-pane.pane-leads { flex: 0 0 clamp(400px, 36vw, 560px); width: clamp(400px, 36vw, 560px); }
/* 多选导出聊天记录（底部动作条：复制 / 导出Word；计数与取消在顶部多选栏） */
.select-bar { display: flex; align-items: center; gap: 12px; margin: 10px 14px 0; padding: 9px 12px; border-radius: 18px; background: #fff; box-shadow: 0 2px 16px rgba(0,0,0,.10); }
.select-bar .select-opt,
.select-bar .select-export { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; border-radius: 14px; padding: 11px 14px; font-size: 14px; font-weight: 600; border: 1px solid var(--line, #e3dcd3); background: #fff; color: #3a2a1c; }
.select-bar .select-export { background: var(--brand); color: #fff; border-color: var(--brand); }
.select-bar .sb-ico { font-size: 15px; }
/* 多选顶部栏（微信式）：取消 + 已选 N 条消息，覆盖在会话头上方 */
.select-topbar { position: fixed; top: 0; left: 0; right: 0; height: 50px; z-index: 980; display: none; align-items: center; justify-content: center; background: var(--bg, #faf7f2); box-shadow: 0 1px 0 rgba(0,0,0,.06); }
.select-topbar .st-cancel { position: absolute; left: 2px; top: 0; bottom: 0; padding: 0 16px; font-size: 15px; background: none; border: none; color: #3a2a1c; cursor: pointer; }
.select-topbar .st-title { font-size: 16px; font-weight: 600; color: #3a2a1c; }
.select-topbar .st-title b { color: var(--brand); }
/* 多选模式：隐藏会话头、让顶部多选栏占位，聊天区顶部留出多选栏高度 */
body.selecting .chat-head { display: none; }
body.selecting .chat-main { padding-top: 50px; }
/* 长按消息上下文菜单（微信式：深色圆角 + 图标网格，锚定消息位置）；禁止文本选中 */
.msg-ai .msg-content, .msg-user .msg-content,
.msg-ai .msg-text, .msg-user .msg-text,
.msg-ai .msg-text *, .msg-user .msg-text * { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.msg-menu-mask { position: fixed; inset: 0; z-index: 1000; display: none; }
.msg-menu-panel { position: fixed; z-index: 1001; min-width: 236px; background: rgba(29,29,31,.94); border-radius: 14px; padding: 12px 8px; box-shadow: 0 8px 30px rgba(0,0,0,.28); backdrop-filter: blur(6px); }
.msg-menu-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px 2px; }
.msg-menu-grid .mm-item { display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 8px 4px; background: none; border: none; border-radius: 10px; cursor: pointer; }
.msg-menu-grid .mm-item:active { background: rgba(255,255,255,.10); }
.msg-menu-grid .mm-item .mm-ico { font-size: 23px; line-height: 1; }
.msg-menu-grid .mm-item .mm-lab { font-size: 12px; color: rgba(255,255,255,.94); white-space: nowrap; }
.msg-select { flex: none; display: flex; align-items: center; align-self: center; margin: 0 6px; }
.msg-select input { appearance: none; -webkit-appearance: none; width: 22px; height: 22px; border: 2px solid #c9c9c9; border-radius: 50%; background: #fff; cursor: pointer; position: relative; transition: border-color .15s, background .15s; }
.msg-select input:checked { border-color: #07c160; background: #07c160; }
.msg-select input:checked::after { content: ''; position: absolute; left: 6px; top: 3px; width: 6px; height: 11px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.msg-user-body { text-align: right; }
.msg-user-name { font-size: 11px; opacity: .82; margin-bottom: 2px; text-align: right; }
.msg-avatar-fb { display: flex; align-items: center; justify-content: center; font-size: 17px; background: var(--avatar-bg); }
.msg-ai .spk-btn {
  flex: none;
  background: #fff; border: 1px solid var(--line, #e3dcd3);
  border-radius: 8px; padding: 2px 6px; font-size: 13px; cursor: pointer;
}
.msg-ai .spk-btn:hover { border-color: var(--brand); }

/* 功能条：卡片圈住，高度稳定不上下串动，常用在前横向左滑（豆包式） */
.fn-card {
  position: relative;
  background: #fff;
  border: 1px solid var(--line, #e3dcd3);
  border-radius: 16px;
  padding: 6px 5px;
  margin: 6px 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .04);
  min-height: 0;
}
.fn-card::after {
  content: '';
  position: absolute; top: 0; right: 0; bottom: 0; width: 28px;
  background: linear-gradient(to right, rgba(255,255,255,0), #fff);
  pointer-events: none; border-radius: 0 16px 16px 0;
}
.fn-bar {
  display: flex; flex-wrap: nowrap; gap: 8px; margin: 0;
  overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none;
  align-items: center;
}
.fn-bar::-webkit-scrollbar { display: none; }
.fn-chip {
  flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  height: 30px; padding: 0 12px;
  background: #fdf6f0; color: var(--text);
  border: 1px solid var(--line, #e3dcd3); border-radius: 999px;
  font-size: 13px; line-height: 1; font-weight: 500; cursor: pointer; white-space: nowrap;
}
.fn-emoji { font-size: 16px; line-height: 1; flex: none; }
.fn-chip:hover { border-color: var(--brand); color: var(--brand); }
.fn-chip.active { background: var(--brand); color: #fff; border-color: var(--brand); }
/* 声音选择（猫导页头部） */
.chat-voice {
  flex: none; max-width: 98px;
  background: #fdf6f0; color: var(--text);
  border: 1px solid var(--line, #e3dcd3); border-radius: 999px;
  padding: 6px 6px; font-size: 12px; cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* 实时口译弹层 */
.interp-rows { display: flex; gap: 10px; margin: 6px 0 12px; }
.interp-col { flex: 1; min-width: 0; }
.interp-lab { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.interp-box {
  min-height: 64px; max-height: 120px; overflow-y: auto;
  background: #faf8f5; border: 1px solid var(--border); border-radius: 10px;
  padding: 8px 10px; font-size: 13px; color: var(--text); line-height: 1.6;
  white-space: pre-wrap; word-break: break-word;
}

/* ── agent 工具结果卡（doc / biz / map / note）── */
.msg-cards { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; width: 100%; }
.tool-card {
  background: #fff; border: 1px solid var(--line, #e3dcd3); border-radius: 12px;
  padding: 12px; font-size: 13px; max-width: 100%; overflow: hidden;
}
.tool-card .doc-link {
  display: inline-block; background: var(--brand, #c94e22); color: #fff;
  border-radius: 8px; padding: 8px 14px; font-size: 14px; text-decoration: none;
}
/* PPT 的打印入口：下载是实心主按钮，打印是描边次按钮 —— 两颗并排时只有一颗抢眼。
   与 .doc-link 同高同圆角，换行时也不会把卡片撑出圆角。 */
.doc-print {
  display: inline-block; margin-left: 8px; padding: 8px 14px; font-size: 14px;
  border: 1px solid var(--brand, #c94e22); border-radius: 8px;
  color: var(--brand, #c94e22); background: #fff; text-decoration: none;
  vertical-align: top; line-height: 1.2;
}
.doc-print:hover { background: #fff3ec; }
.note-card { color: var(--text); line-height: 1.6; }

/* 检索来源卡：默认折叠（`<details>` 不带 open），只露一行「查到 N 条来源」。
   老板先读结论，核对时再点开；展开后正文与普通 note 卡一致。 */
.src-collapse { padding: 10px 12px; }
.src-collapse > summary {
  cursor: pointer; color: var(--brand, #c94e22); font-weight: 600;
  list-style: none; outline: none;
}
.src-collapse > summary::-webkit-details-marker { display: none; }
.src-collapse > summary::before { content: '▸ '; }
.src-collapse[open] > summary::before { content: '▾ '; }
.src-collapse > summary:focus-visible { outline: 2px solid var(--brand, #c94e22); outline-offset: 2px; border-radius: 4px; }
.src-collapse-body { margin-top: 8px; }

.biz-name { font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.biz-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.biz-table th, .biz-table td { text-align: left; padding: 5px 8px; border-bottom: 1px solid #f0eae4; vertical-align: top; }
.biz-table th { width: 98px; color: var(--muted); font-weight: 400; white-space: nowrap; }
.biz-scope { margin-top: 8px; color: var(--text); line-height: 1.6; }
.biz-note { margin-top: 8px; color: var(--muted); font-size: 12px; }
.video-dl {
  display: inline-block; margin-top: 6px; background: var(--brand, #c94e22); color: #fff;
  border-radius: 8px; padding: 6px 12px; font-size: 13px; text-decoration: none; line-height: 1.4;
}

.td-row { display: flex; gap: 8px; align-items: center; margin-top: 8px; flex-wrap: wrap; }
.td-toggle { background: transparent; border: 1px solid var(--brand, #c94e22); color: var(--brand, #c94e22);
  border-radius: 8px; padding: 5px 10px; font-size: 13px; cursor: pointer; line-height: 1.4; }
.td-body { margin-top: 8px; }

.map-title { font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.map-link { display: inline-block; color: var(--brand); text-decoration: none; font-size: 13px; margin-bottom: 6px; }
.map-geo { color: var(--text); font-size: 13px; margin-bottom: 6px; }
.map-pois { margin: 4px 0 0; padding-left: 18px; color: var(--text); line-height: 1.6; }
.map-tel { color: var(--brand); font-size: 12px; }

/* ── 技能市场（豆包式）── */
.drawer-foot { display: flex; flex-direction: column; gap: 8px; }
.drawer-sub { display: flex; gap: 8px; }
.drawer-sub .drawer-back { flex: 1; }
/* 抽屉里「智能体市场」实心入口：区别于猫导主橙 */
.drawer-market {
  width: 100%;
  background: linear-gradient(135deg, #c94e22, #e58a54); color: #fff;
  border: 0; border-radius: 12px; padding: 12px;
  font-size: 15px; font-weight: 600; cursor: pointer; text-align: center;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  box-shadow: 0 4px 14px rgba(201,78,34,.28);
}
.drawer-market:hover { filter: brightness(1.05); }
/* 技能市场（Coze 式）弹层 */
.skills-sheet {
  position: relative; padding: 20px 16px calc(20px + env(safe-area-inset-bottom));
  border-radius: 20px 20px 0 0;
}
.skills-close { position: absolute; top: 16px; right: 16px; width: 30px; height: 30px; border: none; border-radius: 50%; background: #f0ebe5; color: #6f5c4b; font-size: 15px; cursor: pointer; }
.skills-head { display: flex; align-items: center; gap: 12px; margin: 2px 0 6px; }
.skills-ico { width: 46px; height: 46px; border-radius: 14px; background: linear-gradient(135deg, #c94e22, #e58a54); display: flex; align-items: center; justify-content: center; font-size: 22px; flex: none; }
.skills-t { flex: 1; min-width: 0; }
.skills-title { font-size: 18px; font-weight: 800; color: #2f2116; }
.skills-sub { font-size: 12px; color: #a8988a; margin-top: 3px; line-height: 1.5; }
.skill-cats { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 16px 4px; }
.skill-cat {
  border: 1px solid #e9dfd5; background: #faf6f0; color: #7a6a5a;
  border-radius: 18px; padding: 6px 14px; font-size: 13px; cursor: pointer; transition: .15s;
}
.skill-cat.active { border-color: var(--brand); color: #fff; background: var(--brand); }
.skill-list { max-height: 46vh; overflow-y: auto; display: grid; grid-template-columns: 1fr; gap: 10px; }
.skill-card {
  border: 1px solid #f0e8e0; border-radius: 14px; padding: 12px 14px; background: #fff;
  box-shadow: 0 1px 6px rgba(120,90,60,.05);
}
.skill-head { display: flex; align-items: center; gap: 10px; }
.skill-emoji { width: 34px; height: 34px; border-radius: 10px; background: #f8efe7; display: flex; align-items: center; justify-content: center; font-size: 18px; flex: none; }
.skill-name { font-weight: 700; font-size: 15px; color: #2f2116; }
.skill-desc { color: #8a786a; font-size: 12px; line-height: 1.5; margin-top: 6px; }
.skill-foot { display: flex; justify-content: flex-end; margin-top: 10px; }
.btn-mini.skill-on { background: rgba(43,162,76,.10); color: #2ba24c; border-color: #2ba24c; }
@media (min-width: 520px) {
  .skill-list { grid-template-columns: 1fr 1fr; }
}

/* ── 填写模式：功能条橙色强调 + 全屏表单弹层 ── */
.fn-chip.fn-fill {
  background: linear-gradient(135deg, #ff9a3c, #fb7a1d);
  color: #fff; border-color: #fb7a1d; font-weight: 700;
  box-shadow: 0 2px 8px rgba(251, 122, 29, 0.28);
}
.fn-chip.fn-fill:hover { color: #fff; border-color: #fb7a1d; }
/* 功能条：⚙ 排序入口 chip（灰色，区别于真功能） */
.fn-chip.fn-edit-btn {
  background: #f0ebe5; color: #7a6a5a; border-color: #e0d8ce; font-weight: 600;
}
.fn-chip.fn-edit-btn:hover { color: #7a6a5a; border-color: #d0c8be; }
/* 功能条排序弹层：全部功能列成行，按住 ≡ 拖动调整顺序 */
.fn-sort-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.fn-sort-title { font-size: 17px; font-weight: 800; color: #2f2116; }
.fn-sort-hint { font-size: 12px; color: #a8988a; flex: 1; }
.fn-sort-list { display: flex; flex-direction: column; gap: 8px; max-height: 62vh; overflow-y: auto; }
.fn-sort-row {
  display: flex; align-items: center; gap: 12px;
  background: #fdf6f0; border: 1px solid #f0e8e0; border-radius: 12px;
  padding: 11px 14px; touch-action: none;
}
.fn-sort-no {
  width: 22px; height: 22px; flex: none; border-radius: 50%;
  background: #f0ebe5; color: #7a6a5a; font-size: 12px;
  display: flex; align-items: center; justify-content: center;
}
.fn-sort-ico { font-size: 20px; flex: none; }
.fn-sort-label { flex: 1; font-size: 15px; color: #2f2116; font-weight: 600; }
.fn-sort-grip { font-size: 20px; color: #c0b4a8; cursor: grab; }
.fn-sort-row.dragging {
  position: relative; z-index: 5; background: #fff;
  box-shadow: 0 6px 18px rgba(120, 90, 60, .2); border-color: var(--brand);
}
/* 可拖进的槽位：高亮一圈品牌色边框 */
.fn-sort-row.drop-here { border: 2px dashed var(--brand); box-shadow: inset 0 0 0 2px #fff; }
/* 固定不可拖的文案创作：置灰 + 锁形图标 */
.fn-sort-row.locked { background: #f1ebe4; border-color: #e6ddd3; }
.fn-sort-row.locked .fn-sort-ico, .fn-sort-row.locked .fn-sort-label { opacity: .6; }
.fn-sort-grip.fn-sort-lock { cursor: default; color: #b8a898; font-size: 15px; }
body.fn-sorting { -webkit-user-select: none; user-select: none; }
.fill-sheet {
  width: 100%; max-width: 640px; max-height: 92vh; overflow-y: auto;
  background: #fff; border-radius: 16px 16px 0 0; padding: 16px 16px 24px;
}
.fill-head {
  position: sticky; top: -16px; z-index: 2; background: #fff;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 4px 0 8px;
}
.fill-title { font-size: 17px; font-weight: 700; color: var(--text); }
.fill-close { margin-left: auto; }

/* 聊天流里的文案结果卡（copy 消息） */
.copy-wrap { background: #faf8f5; border: 1px solid var(--line, #e3dcd3); border-radius: 12px; padding: 10px; }
.copy-wrap .card { background: #fff; }
.copy-wrap .card:last-child { margin-bottom: 0; }
.copy-hint { margin-top: 10px; font-size: 12px; color: var(--muted); text-align: center; }

/* 我的页 · 管理员工作台卡片 */
.admin-card { display: block; text-decoration: none; color: var(--text); border-color: #fb7a1d; }
.admin-card:hover { border-color: var(--brand); }
.admin-card .card-title { margin-bottom: 4px; }


/* ── 账号卡（粘同行主页链接 → TikHub 取数 + 千问看账号）── */
.account-card { max-width: 100%; }
.acct-head { display: flex; align-items: center; gap: 10px; }
.acct-avatar {
  width: 46px; height: 46px; border-radius: 50%; object-fit: cover;
  background: #f2f2f2; flex: none;
}
.acct-id { min-width: 0; }
.acct-id .biz-name { margin-bottom: 2px; }
.acct-meta { color: var(--muted); font-size: 12px; }
.acct-bio { margin-top: 8px; color: var(--text); line-height: 1.6; }
.acct-list-title { margin-top: 10px; color: var(--muted); font-size: 12px; }
.acct-list { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.acct-list .bench-item { padding: 7px 9px; }
.acct-analysis {
  margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--line, #e3dcd3);
  color: var(--text); line-height: 1.7;
}
.acct-analysis > :first-child { margin-top: 0; }
.acct-copy { margin-top: 8px; }
.acct-note { margin-top: 8px; color: var(--muted); font-size: 12px; line-height: 1.5; }

/* ── 「猫导要动左边面板」确认卡（B2，2026-10-11）─────────────────────────────
   这张卡是**要用户做决定**的，得从一排工具卡里挑出来：极浅的品牌底色 + 左边一条
   实心竖线。定过态之后（done / denied）只换边框色和下面那行字，卡的整体形状不动 ——
   一变形用户就找不着自己刚才点的是哪张了。

   颜色都算过对比度（不是看着差不多就写）：正文 #2b2b2b / 摘要 #6b5b52 落在
   #fff7f3 上分别是 13.4:1 和 6.1:1；「允许一次」是白字压品牌色 4.6:1。 */
.ui-act-card { background: #fff7f3; border-color: #f0d9cc; border-left: 3px solid var(--brand, #c94e22); }
.ui-act-say { color: var(--text); font-size: 13.5px; line-height: 1.6; font-weight: 600; }
.ui-act-ops { margin-top: 6px; color: #6b5b52; font-size: 12.5px; line-height: 1.5; }
.ui-act-note { margin-top: 8px; color: #6b5b52; font-size: 12.5px; }
.ui-act-bad { color: #b23b2e; }
/* #15 结算符号的另一半：✓ 办成了 = 绿。
   #157a38 落在这张卡自己的底 #fff7f3 上是 **5.13:1**（算过的，不是看着差不多）。
   ⚠️ 没有复用小程序那支 --ok(#178c3e)：它在两张卡底上都只有 3.9~4.1:1，够不着这条仓的
   4.5 线（那个 token 本来就只该用在描边/圆点上）。两端的取值是**同一个字面值**。
   判据在 tests/ui-review.test.js 的 C2/C3（从产物 style.css 里读、先剥注释）。 */
.ui-act-ok { color: #157a38; }
/* 出卡前评审闸（2026-10-13）：「这一步猫导没敢替你直接改」。**不是报错**，所以不用
   .ui-act-bad 那个红；用与同一张卡上「以后这类都允许」那颗键同一支暖色（#a33e1b）。
   它落在的**真实**底色就是这张卡的 #fff7f3 → 6.09:1（最浅的停靠点纯白是 6.44:1，
   --bg #f8f7f4 上 6.01:1）—— 三个都算过，不靠看。判据在 tests/ui-review.test.js 的 C 节。 */
.ui-act-hold { color: #a33e1b; }
.ui-act-btns { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.ui-act-btns button { border-radius: 8px; padding: 7px 14px; font-size: 13px; cursor: pointer; line-height: 1.4; }
.ui-act-yes { background: var(--brand, #c94e22); border: 1px solid var(--brand, #c94e22); color: #fff; font-weight: 600; }
.ui-act-no { background: #fff; border: 1px solid #d8cec5; color: #5c534c; }
.ui-act-always { background: #fdeee7; border: 1px solid var(--brand, #c94e22); color: #a33e1b; }
.ui-act-done { border-left-color: #3f9d63; }
.ui-act-denied { background: #faf9f7; border-color: var(--line, #e9e1d8); border-left-color: #c8bfb7; }

/* ①-a 拒绝可带反馈：「不了」和「不了，改成那样」不是一回事。这块只在**已拒绝**的卡里长，
   底色是 .ui-act-denied 的 #faf9f7（近白）—— 所以每个取值都按这块底算过对比度：
   入口 #8a4a2c 6.6:1，按钮 #5c534c 7.4:1，白字压品牌色与 .ui-act-yes 同一对（4.6:1）。 */
.ui-act-reply-link {
  margin-top: 8px; padding: 0; background: none; border: 0; cursor: pointer;
  color: #8a4a2c; font-size: 12.5px; line-height: 1.6;
  text-decoration: underline; text-underline-offset: 3px;
}
.ui-act-reply { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; align-items: center; }
/* 高度写死 + border-box：不写的话 1px 边框和 padding 会把行撑高一点点，
   同一排里两个按钮就跟着错位（原生控件那套算法各浏览器还不一样）。 */
.ui-act-reply-in {
  flex: 1 1 190px; min-width: 0; height: 34px; box-sizing: border-box;
  padding: 0 10px; border: 1px solid #d8cec5; border-radius: 8px;
  font-size: 13px; color: var(--text, #2b2b2b); background: #fff;
}
.ui-act-reply-in:focus { outline: none; border-color: var(--brand, #c94e22); }
.ui-act-reply-go, .ui-act-reply-x { border-radius: 8px; padding: 7px 14px; font-size: 13px; cursor: pointer; line-height: 1.4; }
.ui-act-reply-go { background: var(--brand, #c94e22); border: 1px solid var(--brand, #c94e22); color: #fff; font-weight: 600; }
.ui-act-reply-x { background: #fff; border: 1px solid #d8cec5; color: #5c534c; }

/* ── 选择题反问卡（kind:'ask'，2026-10-12）───────────────────────────────────
   与上面 .ui-act-card 同一族（同一份底色 #fff7f3 与左边那条竖线）：两者都是「猫导要你
   点一下」。区别只在**问的东西不同** —— ui_act 是确认（我要动面板），这张是提问（你要哪个）。

   对比度都算过，不是看着差不多：正文 #2b2b2b 压 #fff7f3 是 13.4:1；副标题 #6b5b52
   压白底 6.7:1；选中那一项是白字压品牌色 4.6:1（与 .ui-act-yes 同一对）。
   ⚠️ 没选中的那几项**不许靠调浅文字来变灰** —— 那会把对比度压到 3:1 以下，
   区分只落在底色、边框和那个 ✓ 上（文字保持 #2b2b2b）。

   ⚠️ 类名前缀是 `aq-` **不是** `ask-`：`ask-q` / `ask-opts` / `ask-opt` 早被
      01-app-shell-history-login.css:254 那块（fill.js 的反问弹窗）占了。网页没有
      小程序那种组件样式隔离，style.css 是一张全局表 —— 同名的两套规则会当场互串
      （我这边那条带 button 兜底的选择器会把那边的胶囊撑成整块，那边 `:active`
      又会命中我这张卡的键）。改前缀治两头，别再改回去。 */
.aq-card { background: #fff7f3; border-color: #f0d9cc; border-left: 3px solid var(--brand, #c94e22); }
.aq-head {
  display: inline-block; margin-top: 7px; padding: 1px 9px; border-radius: 999px;
  background: #fdeee7; border: 1px solid #f0d9cc; color: #a33e1b; font-size: 12px;
  line-height: 1.7;
}
.aq-q { margin-top: 7px; color: var(--text, #2b2b2b); font-size: 14px; line-height: 1.6; font-weight: 600; }
/* 选项整块纵排（不是横排一排小键）：用户在这一屏上要一眼扫完再点，一列最好读也最好点。 */
.aq-opts { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.aq-opt {
  display: block; width: 100%; box-sizing: border-box; text-align: left; cursor: pointer;
  padding: 9px 12px; border-radius: 10px; background: #fff; border: 1px solid #d8cec5;
}
.aq-opt:hover { border-color: var(--brand, #c94e22); }
.aq-label { display: block; color: var(--text, #2b2b2b); font-size: 13.5px; line-height: 1.5; font-weight: 600; }
.aq-desc { display: block; margin-top: 2px; color: #6b5b52; font-size: 12.5px; line-height: 1.5; font-weight: 400; }
/* 选中那一项：品牌底 + 白字 + ✓（对比度 4.6:1）。 */
.aq-opt-on { background: var(--brand, #c94e22); border-color: var(--brand, #c94e22); }
.aq-opt-on .aq-label { color: #fff; }
/* 选中那一项的说明也是白字：原来给的 #ffe6da 压在品牌色上只有 3.8:1（算过）——
   小字要 4.5:1，那行副标题在橙底上是发虚的。改成 #fff，与小程序那端同值。 */
.aq-opt-on .aq-desc { color: #fff; }
/* 答过之后整列不再是待点状态：底色压暗一档 + 默认光标。文字**不调浅**（见上面对比度那段）。 */
.aq-opts.aq-locked .aq-opt { background: #f6f4f1; border-color: #e9e1d8; cursor: default; }
.aq-opts.aq-locked .aq-opt:hover { border-color: #e9e1d8; }
/* ⚠️ 这一条**不是冗余**，少不得：上面那条 `.aq-opts.aq-locked .aq-opt` 是 3 个类，
   压得过 `.aq-opt-on` 的 1 个类 —— 把它去掉，答过之后选中那一项底色就退回灰，
   而白字（.aq-opt-on .aq-label / .aq-desc）照样生效 → 白字压灰底，那一行连同 ✓
   在屏幕上直接没了。2026-10-12 是从真图 A2 里看出来的（当时的机器判据只量了 color、
   没量 background，所以漏掉了这一条）。小程序那端同一条写在 .aq-opts-locked 里。 */
.aq-opts.aq-locked .aq-opt.aq-opt-on { background: var(--brand, #c94e22); border-color: var(--brand, #c94e22); }
.aq-card.aq-done { border-left-color: #3f9d63; }
/* 反问卡的出口键（「根据已有内容直接写」，2026-10-14）。
   它**不是选项里的一个**，所以不能长得像选项（白底实心块）——
   长得像选项，用户会以为它也是一个「答案」，点了就等于选了它。
   虚线边 + 浅品牌底，与选项那一列拉开层级。
   对比度**算过不是看着差不多**：#a33e1b 压 #fdeee7 = 5.69:1，
   与上面 .aq-head 用的是**同一对取值**（已验过的那一对）。 */
.aq-direct {
  display: block; width: 100%; box-sizing: border-box; text-align: center; cursor: pointer;
  margin-top: 8px; padding: 8px 12px; border-radius: 10px;
  background: #fdeee7; border: 1px dashed #f0d9cc; color: #a33e1b;
  font-size: 13px; line-height: 1.6;
}
.aq-direct:hover { border-color: var(--brand, #c94e22); }
/* 自动降级的倒计时（2026-10-15，对位 codex 的 AUTO_RESOLUTION_VISIBLE_COUNTDOWN）。
   它是「再过 N 秒我就自己往下走了」的**预告**，不是能点/能选的东西 —— 所以没有边框、
   没有底、不长得像 .aq-direct（虚线块）也不像 .aq-opt（白底实心块），只占一行小字。
   颜色取 #a33e1b 压卡自己的 #fff7f3：**算过**是 6.09:1（同一对取值压在 .aq-head 那块
   #fdeee7 上是 5.69:1，本表已验过；压在更浅的卡底上只会更高）。不新造一对取值。 */
.aq-cd { margin-top: 8px; color: #a33e1b; font-size: 12.5px; line-height: 1.6; }

/* ── 图表卡（kind:'chart'，2026-10-14）───────────────────────────────────────
   调研回来的一串数画成图（services/tools/chart.py：柱形 / 横条 / 堆叠 / 扇形）。
   壳与 .aq-card / .ui-act-card 同一族（都是 .tool-card），底色取**白**：这张卡里
   颜色是要读的信息（堆叠/扇形靠颜色分辨每一块），卡自己带暖色的话色块压上去跟着偏色，
   图例那颗小方块就与图上那一块对不上了。

   ⚠️ 六种块色由**服务端**给（下面只把 color 绑成 background），这里一个色值都不写 ——
      两端各写一张调色板，改一边就是一次静默分家。
   ⚠️ 尺寸用 px 写死：柱子的轨道高度（.ch-col-track 96px）与横条高度（.ch-row-fill 12px）
      是**几何基准**，用 % / em 会随字体与父容器漂移，长短对比跟着失真。
   ⚠️ 文字全在**白底或浅底**上，取的是本表已有的那几对：#2b2b2b（13.4:1）、
      #6b5b52（6.7:1）、--muted（与 .biz-note 同一对）。不新造浅灰文字。 */
.ch-card { background: #fff; border-color: #e9e1d8; }
.ch-title { margin-top: 6px; color: var(--text, #2b2b2b); font-size: 14px; font-weight: 700; line-height: 1.5; }
.ch-unit { margin-top: 4px; color: var(--muted); font-size: 12px; }
.ch-lab { color: var(--text, #2b2b2b); font-size: 12.5px; line-height: 1.45; }
/* 印的是模型原话（value_text）与它自己标的 as_of，**不是**服务端算出来的百分比。 */
.ch-val { color: #6b5b52; font-size: 12px; line-height: 1.45; }
.ch-asof { margin-left: 4px; color: var(--muted); font-size: 11px; }

/* 竖柱：轨道等高、柱子从底往上长。min-height 是给「算出来 0 或者极小」的那一根留的
   —— 不留的话它变成一条看不见的线，屏幕上像「这一项没数」，而它其实有数。 */
.ch-bars { display: flex; align-items: flex-end; gap: 8px; margin-top: 12px; }
.ch-col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; }
.ch-col-val { text-align: center; }
.ch-col-track {
  width: 100%; height: 96px; margin: 4px 0 3px;
  display: flex; align-items: flex-end; background: #f6f4f1; border-radius: 4px;
}
.ch-col-fill { width: 100%; min-height: 3px; border-radius: 4px 4px 0 0; }
.ch-col .ch-lab { color: #6b5b52; font-size: 12px; text-align: center; word-break: break-all; }

/* 横向条：一行一个，名字长 / 项数多的时候比竖柱好读（所以后端超过 6 项会建议换它）。 */
.ch-rows { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.ch-row-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.ch-row-top .ch-lab { min-width: 0; word-break: break-all; }
.ch-row-top .ch-val { white-space: nowrap; }
.ch-row-track { margin-top: 4px; height: 12px; background: #f6f4f1; border-radius: 6px; }
.ch-row-fill { height: 12px; min-width: 3px; border-radius: 6px; }

/* 堆叠：一条 100% 的横条切成几段（分段宽度就是 pct）。 */
.ch-stack { display: flex; height: 26px; margin-top: 12px; border-radius: 6px; overflow: hidden; background: #f6f4f1; }
.ch-stack-seg { min-width: 2px; }

/* 扇形：真·扇形（见 01-render.js 的 pieSvg），尺寸写死好让图例贴着它排。 */
.ch-pie { display: block; width: 132px; height: 132px; margin: 12px auto 2px; }

/* 图例：色块 → 名字 → 值。值右对齐（`margin-left:auto`），一列数字才能竖着比。 */
.ch-legend { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.ch-leg { display: flex; align-items: center; gap: 6px; }
.ch-leg .ch-lab { flex: 1 1 auto; min-width: 0; word-break: break-all; }
.ch-leg .ch-val { margin-left: auto; white-space: nowrap; }
.ch-dot { flex: 0 0 10px; width: 10px; height: 10px; border-radius: 3px; }

/* 来源行：**每个点都带 source**（服务端硬性要求），所以这行一定不空。
   与正文用一条细线隔开 —— 它是脚注，不该混进图里读。 */
.ch-src {
  margin-top: 10px; padding-top: 8px; border-top: 1px solid #f0eae4;
  color: var(--muted); font-size: 12px; line-height: 1.6;
}
.ch-note { margin-top: 6px; color: #6b5b52; font-size: 12px; line-height: 1.6; }

/* 生图卡（工具 `ecimg`，见 01-render.js 那段）：note 卡里挂一堵图墙。
   一张竖图时给个上限高度（短剧人物图是 720x1280，铺满会把气泡拉成一整屏）；
   多张时两列换行。`object-fit: cover` 不裁内容，只让方图/竖图在格子里一样高。 */
.note-imgs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.note-img { display: block; line-height: 0; border-radius: 10px; overflow: hidden; }
.note-img img {
  display: block; width: 176px; max-width: 100%; max-height: 300px;
  object-fit: cover; background: #f6f4f1;
}
/* ── 抽屉：聊天记录 / 文案记录 / 收藏 标签页 ── */
.drawer-tabs { display: flex; gap: 8px; margin-top: 12px; }
.drawer-tab {
  flex: 1; background: #f5efe8; color: var(--text);
  border: 1px solid #eee; border-radius: 999px; padding: 7px 0;
  font-size: 13px; cursor: pointer; text-align: center;
}
.drawer-tab.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.drawer-pane { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.chat-drawer .drawer-pane .thread-list { flex: 1; overflow-y: auto; }
.copy-record {
  border: 1px solid #f0eae4; border-radius: 12px; padding: 12px 14px;
  margin: 8px 0 0; background: #fff; cursor: pointer; display: block;
}
.copy-record-title { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.copy-record-sub { font-size: 13px; color: var(--muted); line-height: 1.5; }
.copy-record-meta { font-size: 12px; color: var(--muted); margin-top: 6px; }

/* 收藏条目（抽屉「🖇 收藏」）：标题 + 摘要 + 相对时间，右侧复制/删除 */
.fav-item {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid #f0eae4; border-radius: 12px; padding: 11px 13px;
  margin: 8px 0 0; background: #fff;
}
.fav-item .fav-main { flex: 1 1 auto; min-width: 0; }
.fav-title { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fav-sub { font-size: 13px; color: var(--muted); line-height: 1.5; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fav-meta { font-size: 11.5px; color: #b3ada7; margin-top: 4px; }
.fav-item .fav-ops { flex: 0 0 auto; display: flex; gap: 6px; }
.fav-btn {
  border: 1px solid #eee; border-radius: 999px; background: #f5f5f5;
  color: var(--text); font-size: 12px; font-weight: 500; padding: 6px 11px;
  cursor: pointer; white-space: nowrap;
}
.fav-btn:active { background: #ececec; }
.fav-btn.fav-del { color: #c0392b; border-color: #efcfc8; }

/* ── 文案结果卡：下方一排功能（复制/朗读/有用/没用/转发）── */
.msg-actions { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.msg-act-btn {
  flex: 0 0 auto; background: #fff; color: var(--text);
  border: 1px solid var(--line, #e3dcd3); border-radius: 10px;
  width: 36px; height: 36px; font-size: 16px; line-height: 1; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.msg-act-btn:hover { border-color: var(--brand); }
.msg-act-btn.rated { background: rgba(214,132,78,0.10); border-color: var(--brand); }
.msg-act-forward { margin-left: auto; color: var(--brand); border-color: var(--brand); }

/* ── 转发分享底部弹层（对标豆包图二）── */
.share-sheet {
  width: 100%; max-width: 640px; max-height: 85vh; overflow-y: auto;
  background: #fff; border-radius: 16px 16px 0 0; padding: 18px 16px 24px;
}
.share-title { font-size: 16px; font-weight: 700; color: var(--text); margin-bottom: 16px; text-align: center; }
.share-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px 4px; padding: 0 4px 8px; }
.share-opt {
  background: #fff; color: var(--text); border: 0; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 12px;
}
.share-ico {
  width: 52px; height: 52px; border-radius: 14px; display: flex; align-items: center; justify-content: center;
  font-size: 24px; background: #f5efe8;
}

/* ── 个人中心（对标豆包图一）── */
.profile-page { max-width: 640px; margin: 0 auto; }
.pf-hero { display: flex; flex-direction: column; align-items: center; padding: 26px 0 8px; }
.pf-avatar-wrap { position: relative; cursor: pointer; }
.pf-avatar {
  width: 96px; height: 96px; border-radius: 50%; object-fit: cover;
  background: #f5efe8; display: flex; align-items: center; justify-content: center;
  font-size: 48px; border: 1px solid #eee;
}
.pf-avatar-fb { color: #d68e2c; }
.pf-avatar-edit {
  position: absolute; bottom: -6px; left: 50%; transform: translateX(-50%);
  background: var(--brand); color: #fff; font-size: 11px; border-radius: 999px;
  padding: 2px 12px; pointer-events: none;
  white-space: nowrap; line-height: 1.4;  /* 防「换头像」被压成竖排 */
}
.pf-name { font-size: 20px; font-weight: 700; color: var(--text); margin-top: 14px; cursor: text; }
.pf-name-edit { font-size: 14px; color: var(--muted); }
.pf-id { font-size: 13px; color: var(--muted); margin-top: 4px; }
/* 猫导自己的页面头部（点猫导头像进入） */
.mdl-hero { position: relative; display: flex; flex-direction: column; align-items: center; padding: 26px 0 8px; }
/* 返回箭头：font-size 30px 看着大，但「‹」这个字形本身只有 ~10px 宽（实测 10×30），
   是这一页唯一的返回入口。加 padding 撑命中区，同时把 left/top 减掉同样的量，
   箭头**视觉位置不动**（18-12=6、12-8=4）。 */
.mdl-back { position: absolute; left: 6px; top: 4px; padding: 8px 12px; font-size: 30px; line-height: 1; color: var(--text); text-decoration: none; }
.mdl-avatar { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; background: #f5efe8; border: 1px solid #eee; }
.mdl-avatar-fb { width: 96px; height: 96px; border-radius: 50%; background: #f5efe8; border: 1px solid #eee; display: flex; align-items: center; justify-content: center; font-size: 48px; color: #d68e2c; }
.mdl-name { font-size: 20px; font-weight: 700; color: var(--text); margin-top: 14px; }
.mdl-tag { font-size: 13px; color: var(--muted); margin-top: 4px; }
.pf-acct-btn {
  display: inline-block; margin-top: 16px; padding: 9px 26px;
  background: #fff; color: var(--text); border: 1px solid #eee; border-radius: 999px;
  font-size: 14px; text-decoration: none;
}
.pf-list {
  margin-top: 18px; background: #fff; border: 1px solid var(--line, #e3dcd3);
  border-radius: 14px; overflow: hidden;
}
.pf-row {
  display: flex; align-items: center; gap: 12px; padding: 15px 16px;
  border-bottom: 1px solid #f4efe9; text-decoration: none; color: var(--text);
  font-size: 15px; cursor: pointer;
}
.pf-row:last-child { border-bottom: 0; }
.pf-row-ico { width: 30px; height: 30px; border-radius: 8px; display: flex; align-items: center; justify-content: center; background: #f5efe8; font-size: 16px; }
.pf-row-t { flex: 1; }
.pf-row-val { color: var(--muted); font-size: 14px; max-width: 45%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-row-val-btn { color: var(--brand); }
.pf-row-arr { color: #c9c2ba; font-size: 20px; }
.pf-switch { width: 40px; height: 22px; border-radius: 999px; background: #d8d2ca; position: relative; flex: none; transition: background .2s; }
.pf-switch-dot { position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: left .2s; box-shadow: 0 1px 2px rgba(0,0,0,.15); }
.pf-switch.on { background: var(--brand); }
.pf-switch.on .pf-switch-dot { left: 20px; }

/* ── 个人中心弹层（底部 sheet，对标豆包）── */
.pf-sheet {
  width: 100%; max-width: 560px; max-height: 82vh; overflow-y: auto;
  background: #fff; border-radius: 18px 18px 0 0; padding: 20px 18px 24px;
}
.pf-sheet-head { font-size: 17px; font-weight: 700; color: var(--text); margin-bottom: 14px; }
.pf-sheet-body { font-size: 15px; }
.pf-sheet-ops { display: flex; gap: 12px; margin-top: 18px; }
.pf-sheet-ops .btn-primary { flex: 1; }
.pf-sheet-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 6px; color: #333; cursor: pointer;
}
.pf-sheet-row + .pf-sheet-row { border-top: 1px solid #f4efe9; }
.pf-sheet-row.on { color: var(--brand); font-weight: 600; }
.pf-check { color: var(--brand); }

/* 猫粮用量 */
.usage-total { font-size: 15px; color: #333; }
.usage-total b { font-size: 20px; color: var(--brand); }
.usage-day {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 2px; border-bottom: 1px solid #f4efe9;
}
.usage-day b { color: var(--brand); }

/* 充值收藏码 */
.pf-qr { width: 240px; height: 240px; object-fit: contain; border-radius: 12px; margin: 0 auto; display: block; }
.qr-fallback { padding: 30px 10px; color: #555; font-size: 15px; line-height: 1.7; }
.qr-fallback b { color: var(--brand); }

/* 猫粮充值（套餐卡 + 动态收款码） */
/* 两池页签：短剧 / 文案。默认短剧；文案在「不卖」时仍然显示（余额还在）。 */
.pay-tabs { display: flex; gap: 8px; margin-bottom: 12px; }
.pay-tab {
  flex: 1; text-align: center; padding: 8px 6px; border-radius: 10px;
  border: 1.5px solid #eee; font-size: 14px; color: var(--muted); cursor: pointer;
}
.pay-tab.on { border-color: var(--brand); color: var(--brand); background: #fff7f3; font-weight: 600; }
.pay-balance { display: flex; align-items: center; gap: 6px; font-size: 15px; color: #555; margin-bottom: 12px; }
.pay-balance b { color: var(--brand); font-size: 18px; }
#pkgList { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 12px; }
.pkg-card {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center;
  border: 1.5px solid #eee; border-radius: 12px; padding: 14px 8px; cursor: pointer;
  transition: border-color .15s, background .15s, transform .1s;
}
.pkg-card.on { border-color: var(--brand); background: #fff7f3; transform: translateY(-1px); }
.pkg-card:active { transform: scale(.98); }
.pkg-price { font-size: 22px; font-weight: 700; color: var(--brand); }
.pkg-num { font-size: 13px; color: var(--muted); margin-top: 4px; white-space: nowrap; }
.pkg-check {
  position: absolute; top: 8px; right: 10px; width: 20px; height: 20px; border-radius: 50%;
  border: 1.5px solid #ddd; color: transparent; font-size: 13px;
  display: flex; align-items: center; justify-content: center;
}
.pkg-card.on .pkg-check { background: var(--brand); border-color: var(--brand); color: #fff; }
.pay-status { min-height: 20px; font-size: 13px; margin: 4px 0 10px; color: var(--muted); }
#payQrWrap { text-align: center; margin: 4px 0 10px; }
.pay-qr-tip { margin-top: 8px; font-size: 13px; color: var(--brand); line-height: 1.5; }

/* 记忆 */
.mem-item {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 10px;
  padding: 12px 4px; border-bottom: 1px solid #f4efe9;
}
.mem-txt { flex: 1; min-width: 0; color: #333; line-height: 1.6; word-break: break-word; }
.mem-ops { display: flex; gap: 8px; flex: none; }

/* 回访事实的出处/时效/流水（2026-11-08）。这三行是「这条从哪来、什么时候记的、
   上次谁改了什么」—— 以前页面上只有一句判断，改错了也不知道原来是什么。 */
.recall-badge {
  display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 8px;
  font-size: 11px; line-height: 18px; vertical-align: 1px;
}
.recall-badge-suspect { background: #fff3e0; color: #b26a00; }
.recall-badge-ok { background: #e8f5e9; color: #2e7d32; }
.recall-badge-merged { background: #eef1f6; color: #5b6b82; }
.recall-src {
  margin-top: 4px; font-size: 12px; color: var(--muted); line-height: 1.5;
  overflow: hidden; text-overflow: ellipsis; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.recall-src em { font-style: normal; color: #b9b0a6; }
.recall-when { margin-top: 2px; font-size: 11px; color: #b9b0a6; }
.recall-when a { color: var(--brand); }

/* 字体与背景 */
.pf-field-label { font-size: 14px; color: var(--muted); margin-bottom: 8px; }
.ape-bgs { display: flex; gap: 14px; flex-wrap: wrap; }
.ape-bg { width: 44px; height: 44px; border-radius: 10px; border: 2px solid #eee; cursor: pointer; }
.ape-bg:active { border-color: var(--brand); }

/* ── 聊天三点状态（豆包式）── */
.typing-row { display: flex; align-items: flex-end; gap: 8px; }
.typing { display: flex; gap: 5px; align-items: center; min-width: 48px; min-height: 20px; }
.typing span {
  width: 8px; height: 8px; border-radius: 50%; background: #c2bab2;
  animation: typing-bounce 1.2s infinite ease-in-out;
}
.typing span:nth-child(2) { animation-delay: 0.15s; }
.typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes typing-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: .45; }
  30% { transform: translateY(-5px); opacity: 1; }
}

/* ── 管理工作台：经营概览 + 充值订单 ── */
.rec-row.ord-row { grid-template-columns: 1.5fr 0.6fr 0.8fr 0.9fr 0.8fr 1.3fr; }
/* 末列是「会员」（档位 + 到期日 + 按钮），要够宽。
   实测（1280px 视口截图）：留给它 1.6fr 时，徽标/日期/按钮被挤成三行，
   连带旁边的「注册时间」也把日期断成两行、整行高度飘。给到 1.9fr、
   同时把注册时间提到 1.1fr 之后，两者都各占一行了。
   这几个数字是照实渲染图调出来的，不是估的 —— 改窄了会重新挤回去。 */
.rec-row.user-row { grid-template-columns: 1.3fr 0.5fr 0.8fr 0.8fr 0.8fr 0.8fr 1fr 1.3fr 1.7fr; }
.ord-status { text-align: center; color: var(--muted); font-size: 13px; }
.ord-status.st1 { color: #1a7f37; font-weight: 600; }
.ord-status.st0 { color: #b45309; }
.ord-status.st2 { color: #888; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 10px; margin-top: 4px; }
.stat-tile { background: #fff7f2; border: 1px solid #f3e0d5; border-radius: 10px; padding: 10px 8px; text-align: center; }
.stat-num { font-size: 16px; font-weight: 700; color: var(--brand); }
.stat-lab { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* ── 访客表末列：会员档位 + 开通入口 ──
   这一列的数据行不再是整行 <a>（<a> 里放不了 <button>，点了会顺带跳走），
   所以「看记录」那个入口收到的 .rec-phone 上，要自己把链接的下划线/蓝字压掉。 */
.rec-phone { color: inherit; text-decoration: none; }
.rec-phone:hover { color: var(--brand); text-decoration: underline; }
/* 竖排两层：上一层是「档位 + 到期日」，下一层是按钮。
   一开始写成 flex-wrap 横排，实测会按可用宽度在 1~3 行之间乱跳（同一张表里
   各行高度都不一样），所以改成显式两层 —— 高度可预期，按钮也总在同一列位置上。 */
.rec-vip { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; font-size: 12px; }
/* 两层锁，缺一不可（两者都是照实渲染图调出来的）：
   · `flex-wrap: wrap` —— 不加的话默认 nowrap，三个词会被压缩到**词中间**断开：
     已到期那行实测断成「未开 / 通」「2026-09- / 23」「已到 / 期」。
     开了 wrap，挤不下时在**词之间**换行，不在词内部断。
   · `white-space: nowrap` 加在**每个词上**，不加在 .vip-line 上 ——
     加在线上会让整行的 min-content 顶住 grid 的 fr 轨道（已到期那行最长，
     一 nowrap 就把旁边「注册时间」挤到两行，其余四行还是一行，像随机坏掉）。
     加在词上，轨道的地板只到最宽那个词（「到 2026-09-23」），注册时间就守得住。 */
.vip-line { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.vip-tag { color: var(--muted); }
.vip-tag.on { color: var(--brand); font-weight: 600; }
.vip-exp { color: #555; }
.vip-exp.warn { color: #b45309; }
.vip-tag, .vip-exp { white-space: nowrap; }
.vip-btn { border: 1px solid var(--border); background: #fff; color: #444;
  border-radius: 6px; padding: 3px 8px; font-size: 12px; cursor: pointer; white-space: nowrap; }
.vip-btn:hover { border-color: var(--brand); color: var(--brand); }

/* 开通/修改会员那个弹层里的表单（复用 .mask/.auth-box，只是多两行输入）。
   ⚠️ `.auth-box` 整体是 text-align:center（它平时只装一行标题 + 一行说明），
   表单里这两样**必须显式改回左对齐**：`档位`/`有效期（天）` 居中会离开它标注的
   输入框（框是全宽的，标签却缩在中间，看不出在标谁）；提示那句话最长，
   居中时第二行只剩几个字，读起来像被截断。 */
.vip-form { display: flex; flex-direction: column; gap: 4px; margin: 10px 0 4px; }
.vip-lab { font-size: 12px; color: var(--muted); margin-top: 6px; text-align: left; }
/* 「（到 2027-07-25）」整块不断行，见 workbench.html 里那段 */
.vip-nowrap { white-space: nowrap; }
.vip-hint { font-size: 12px; color: var(--muted); line-height: 1.5; margin-top: 6px; text-align: left; }

/* ── 链接提取结果卡 ── */
.link-card { max-width: 100%; }
.link-summary { color: #444; margin: 4px 0; line-height: 1.5; }
.link-points-title { color: var(--muted); font-size: 12px; margin-top: 6px; }
.link-points { margin: 2px 0 6px; padding-left: 18px; color: #333; }
.link-points li { margin: 2px 0; }
.link-hook { background: #fff4ec; border-left: 3px solid var(--brand); padding: 6px 8px; border-radius: 4px; margin-top: 6px; color: #7a2f10; }

/* ── 视频口播提取：批量弹层 + 口播文案卡 ── */
#videoText {
  width: 100%; min-height: 130px; resize: vertical; box-sizing: border-box;
  padding: 10px; border: 1px solid var(--border, #e5d8ce); border-radius: 8px;
  font-size: 14px; line-height: 1.5; color: #333; background: #fff;
}
#videoText:focus { border-color: var(--brand, #c94e22); outline: none; }
.transcript {
  white-space: pre-wrap; word-break: break-word; line-height: 1.6;
  background: #faf7f4; border: 1px solid #f0e6dc; border-radius: 8px;
  padding: 10px; margin: 6px 0; color: #333; max-height: 320px; overflow: auto;
}
.video-card .btn-copy { margin: 2px 0 8px; }

/* ── 视频号对标：候选清单卡 + 对标结果卡 ── */
.bench-list-card { max-width: 100%; }
.bench-list { display: flex; flex-direction: column; gap: 8px; }
.bench-item {
  background: #faf7f4; border: 1px solid #f0e6dc; border-radius: 8px; padding: 9px 10px;
}
.bench-item-t { color: var(--text); font-weight: 600; line-height: 1.4; }
.bench-item-sub { color: var(--muted); font-size: 12px; margin-top: 2px; }
.bench-pick {
  display: inline-block; margin-top: 8px; background: var(--brand, #c94e22); color: #fff;
  border: 0; border-radius: 8px; padding: 7px 12px; font-size: 13px; cursor: pointer;
}
.bench-pick:hover { filter: brightness(1.05); }
.bench-card { max-width: 100%; }
.bench-meta { color: var(--muted); font-size: 13px; margin: 0 0 8px; }
.bench-video {
  display: block; width: 100%; max-width: 100%; border-radius: 10px; margin: 4px 0 10px;
  background: #000; aspect-ratio: 9/16; max-height: 46vh; object-fit: contain;
}
.bench-cover {
  display: block; width: 100%; max-width: 100%; border-radius: 10px; margin: 4px 0 10px;
  background: #f2f2f2; object-fit: cover; max-height: 46vh;
}
.bench-hook { background: #fff4ec; border-left: 3px solid var(--brand); padding: 6px 8px; border-radius: 4px; margin-top: 6px; color: #7a2f10; }
.bench-angle { color: var(--text); margin-top: 6px; line-height: 1.5; }
.bench-borrow-title { color: var(--muted); font-size: 12px; margin-top: 8px; }
.bench-write {
  display: block; width: 100%; margin: 8px 0 6px; background: var(--brand, #c94e22); color: #fff;
  border: 0; border-radius: 10px; padding: 10px 14px; font-size: 15px; font-weight: 600; text-align: center;
}
.bench-write:hover { filter: brightness(1.05); }
.bench-play {
  display: inline-block; margin: 4px 6px 8px 0; background: #f4f4f4; color: var(--text);
  border: 1px solid #e2e2e2; border-radius: 8px; padding: 6px 12px; font-size: 13px; cursor: pointer;
}
.bench-play:hover { filter: brightness(0.97); }
.bench-play-dl {
  display: inline-block; margin: 4px 6px 8px 0; font-size: 12px; color: var(--muted, #888);
  text-decoration: underline; cursor: pointer;
}

/* ── 聊天排版美化（微信式：头像在外，气泡只包内容）── */
.chat-box { gap: 14px; padding: 8px 0 14px; }

/* 消息行：只承载 头像 + 气泡，不自己当气泡（去掉旧的行级背景/内边距/字号） */
.msg-user, .msg-ai {
  display: flex; align-items: flex-start; justify-content: flex-start; gap: 12px;
  max-width: 100%; padding: 0; margin: 0; background: transparent;
  white-space: normal; border-radius: 0; align-self: stretch; width: 100%;
}
.msg-ai { flex-direction: row; }
.msg-user { flex-direction: row-reverse; }

/* 头像：外置，略大，与气泡顶部对齐；方形（猫导/用户都改方形） */
.msg-avatar { width: 38px; height: 38px; border-radius: 0; object-fit: cover; margin-top: 3px; flex: none; }
.msg-user-avatar { margin-top: 3px; } /* 名字已移出气泡，头像与名字行顶部对齐 */
.msg-avatar-fb { display: flex; align-items: center; justify-content: center; font-size: 19px; background: var(--avatar-bg); }

/* 气泡本体：只在 .msg-content 上给背景/圆角/宽度，文字自然包裹，不再被头像挤窄 */
.msg-content {
  flex: 0 1 auto; min-width: 0; max-width: none; text-align: left;
  padding: 10px 14px; border-radius: 14px;
  white-space: pre-wrap; word-break: break-word;
  line-height: 1.7; font-size: var(--chat-font, 17px);
}
.msg-ai .msg-content { background: var(--ai-bubble); color: var(--text); border-top-left-radius: 4px; }
.msg-user .msg-content { background: var(--brand); color: #fff; border-top-right-radius: 4px; }

/* ⑩ 气泡占比（2026-10-16，用户「气泡的占比单独借鉴一下」；源 = opencode
   `session-ui/src/components/message-part.css:127-134`）。
   它那边**用户侧是真气泡**（右对齐、有底色、被 `min(82%, 64ch)` 封顶），
   **助手侧根本不是气泡**（`width:100%`、无底色无圆角 padding，`:1-8`）。我们助手侧有气泡，
   所以这一批只借**用户侧的两条**，助手侧维持占满 —— 「要不要连助手那层皮也去掉」是产品观感
   的事，另说（记在 plans 的 ⑩ 节）。
   ⚠️ 「贴合内容」不能写 `width:fit-content` —— `.msg-content` 的父级 `.msg-main` 是 **column**
   flex，交叉轴默认 `stretch`，所以宽度是被拉满的（这就是三种气泡都 844px 的真因）；
   交叉轴上那个开关是 `align-self`。`flex:0 1 auto` 管的是另一根轴（高度），改它没用。
   ⚠️ `64ch` 用的是**元素自己的字号**（`--chat-font` 有档位）→ 用户调大字号时上限跟着放大，
   封的一直是「64 个字宽」而不是某个死像素。`82%` 那一半在窄屏才起作用（见下面媒体查询那条，
   它选择器更弱、盖不住这里）。 */
.msg-user .msg-content { align-self: flex-end; max-width: min(82%, 64ch); }

/* ⑬ 右边留一列（codex 借条，2026-10-17；源 = `codex-rs/tui/src/history_cell/messages.rs:196-200`）：
   它那边用户消息的折行宽 = `width - (LIVE_PREFIX_COLS + 1)`，注释原文
   `keep a one-column right margin for wrapping` —— 用户 = 宽−3、助手 = 宽−2。
   我们落的不是那个终端算式，而是**它要的那件事**：用户消息折行时右缘再让出**一个字符宽**
   （`1ch` = 当前字号下「0」的宽，跟着 `--chat-font` 档位走，与 ⑩ 的 `64ch` 同一个尺子），
   长 URL / 中英混排不贴着气泡边。
   ⚠️ **只加用户侧**，与 codex 同一条不对称：助手那层（`.msg-content` 的 14px）不动。
   ⚠️ 与 ⑩ 是同一条几何：外面那层 `min(82%, 64ch)` 一个字没动，这里改的是**里面的内缩**，
     所以加起来折行宽度真的窄了一列 —— 前后图要一起看（`tests/_measure_chat_typo.py`）。
   ⚠️ 别并进上面那条声明里：那条整行被三个变异体当锚点（`min(82%, 64ch)` 的取舍判据）钉着，
     并为它单独留一行，注释里那段「82% 在窄屏先到顶」也才读得通。 */
.msg-user .msg-content { padding-right: calc(14px + 1ch); }

/* 消息主体列 + 对齐：气泡列 = [头像+8, 头像+8]，两侧气泡同宽、边缘对齐，且各自头像留 8px 呼吸。
   头像 30px + 间隙 8px：猫导气泡左缘=猫导头像右缘+8(38)，右缘=用户头像左缘-8(W-38)；
   用户气泡左缘=猫导头像右缘+8(38)，右缘=用户头像左缘-8(W-38)。两侧气泡同宽，头像不贴气泡。 */
.msg-main { display: flex; flex-direction: column; min-width: 0; flex: 1 1 auto; }
.msg-user, .msg-ai { gap: 8px; }
.msg-ai { padding-right: 38px; }   /* 右侧让出用户头像(30)+间隙(8)，头像与气泡留 8px */
.msg-user { padding-left: 38px; }  /* 左侧让出猫导头像(30)+间隙(8)，头像与气泡留 8px */

/* 用户气泡内部：文本右对齐；用户名已挪到气泡外(上文 msg-main) */
.msg-user-body { text-align: right; }
.msg-user-name { font-size: 12px; color: var(--muted); opacity: 0.9; margin-bottom: 4px; text-align: right; }
.msg-user .msg-text, .msg-ai .msg-text { flex: 0 1 auto; text-align: left; }

/* 操作条：气泡内末尾 */
.msg-actions { margin-top: 6px; }

/* 一轮干完那行小字（「工作 2 分 03 秒 · 用了 3 次工具」，文案在 05-stream.js 的 _turnMetaText）。
   颜色**是算出来的不是挑出来的**：这一行 12px 又是给人读的信息，不能按分隔线那种灰来配。
   #666 在气泡底色(--ai-bubble #f3ede9)上 4.95:1、在白底上 5.74:1（WCAG AA 正文 4.5:1）；
   而 --muted(#999) 在气泡上只有 2.46:1 —— 别顺手拿它顶，那双眼睛看得出来、对比度算不出来。 */
.msg-meta { margin-top: 6px; font-size: 12px; line-height: 1.5; color: #666666; }

/* ── 文案生成卡（copy 消息）：单个宽白卡，去掉「米色气泡→copy-wrap→白卡」三层嵌套 ── */
.msg-copy .msg-content {
  background: #fff; border: 1px solid var(--line, #e9e1d8);
  max-width: 94%; padding: 4px; display: block;
  border-radius: 16px; box-shadow: 0 1px 5px rgba(0,0,0,.05);
}
.copy-wrap { background: transparent; border: 0; padding: 0; }
.copy-wrap .card { background: #fff; }
.copy-wrap .card:last-child { margin-bottom: 0; }
.copy-part.card {
  border: 0; border-radius: 0; padding: 14px 12px; margin: 0; box-shadow: none;
}
.copy-part.card + .copy-part.card { border-top: 1px solid #f0e9e1; }
.copy-part .card-title { font-size: 15px; font-weight: 700; color: var(--brand); margin: 0 0 6px; }
.copy-part .result-text, .copy-part .script-text { font-size: 15px; line-height: 1.85; color: var(--text); white-space: pre-wrap; }
.copy-part .result-tags { color: var(--brand); font-size: 14px; margin-top: 6px; }
.copy-part .btn-copy { margin-top: 10px; }
.copy-hint { color: var(--muted); font-size: 12px; text-align: center; margin: 10px 0 4px; }

/* 窄屏（手机）：气泡更靠边、标题卡内边距收回，避免文本更挤 */
@media (max-width: 480px) {
  .msg-content { max-width: none; padding: 8px 11px; }
  /* ⑬ 的窄屏底座：`.msg-user .msg-content` 那条选择器比上面这条**更强**，
     不加这句的话手机上用户气泡是「左 11 右 14+1ch」，字看着偏左。
     底座跟这里的 11px 走，仍然多一个现场字号下的 1ch。 */
  .msg-user .msg-content { padding-right: calc(11px + 1ch); }
  /* 手机头像同为 30px，两侧让位 38（头像30+间隙8，与桌面同值）：头像与气泡留 8px 呼吸 */
  .msg-ai { padding-right: 38px; }
  .msg-user { padding-left: 38px; }
  .msg-copy .msg-content { max-width: 96%; padding: 2px; }
  .copy-part.card { padding: 12px 10px; }
  .msg-avatar { width: 30px; height: 30px; }
  .msg-user-avatar { margin-top: 3px; } /* 名字已移到气泡外，头像与顶上对齐（同 AI 侧），不再下移 15px */
}

/* ══ 智能体市场（Coze 式）══ */
.market-page {
  min-height: 100vh;
  background: linear-gradient(180deg, #fdf3ec 0%, #f6efe8 100%);
  padding: 0 0 40px;
  overflow-x: hidden;   /* 防任何子元素(搜索框/卡片)把页面撑出横向滚动 */
}
.mk-head {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 8px;
  padding: 14px 16px; background: #ffffff;
  box-shadow: 0 1px 8px rgba(201, 78, 34, 0.06);
}
.mk-back {
  width: 34px; height: 34px; flex: none; box-sizing: border-box;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0; margin: 0;
  background: #fdf3ec; color: var(--brand);
  border: 1px solid var(--line, #e3dcd3); border-radius: 50%;
  font-size: 18px; line-height: 1;
}
.mk-back:hover { background: #f6e7dc; }
.mk-title { font-size: 17px; font-weight: 700; color: #3a2a1c; flex: none; }
.mk-search { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; background: #f4f1ee; border-radius: 20px; padding: 4px 4px 4px 14px; }
.mk-search input { flex: 1; min-width: 0; border: none; background: none; outline: none; font-size: 14px; color: #3a2a1c; }
.mk-search-btn { background: var(--brand); color: #fff; border: none; border-radius: 16px; padding: 5px 12px; font-size: 13px; }

.mk-tabs { display: flex; gap: 8px; padding: 14px 16px 2px; }
.mk-tab {
  flex: 1; padding: 10px 0; border: none; background: #f1ebe4; color: #8a786a;
  border-radius: 22px; font-size: 15px; font-weight: 600; cursor: pointer; transition: .15s;
}
.mk-tab.on { background: var(--brand); color: #fff; box-shadow: 0 4px 14px rgba(201,78,34,.25); }

.mk-pane { padding: 8px 16px 0; }
.mk-sec { font-size: 13px; font-weight: 700; color: #3a2a1c; margin: 12px 2px 10px; display: flex; align-items: baseline; gap: 8px; }
.mk-sec-tip { font-size: 12px; color: #a8988a; font-weight: 400; }

.mk-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
.mk-grid-mine { grid-template-columns: 1fr; }
.mk-card {
  background: #fff; border-radius: 18px; padding: 14px;
  box-shadow: 0 2px 12px rgba(120, 90, 60, 0.08);
  border: 1px solid #f0e8e0;
  min-width: 0; overflow: hidden;   /* 网格项默认 min-width:auto，长文字会把卡片撑出容器 → 裁掉/乱版 */
}
.mk-card-head { display: flex; align-items: center; gap: 12px; }
.mk-ico {
  width: 46px; height: 46px; border-radius: 14px; flex: none;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, #c94e22, #e58a54);
}
.mk-card-t { flex: 1; min-width: 0; }
.mk-card-name { font-size: 16px; font-weight: 700; color: #2f2116; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mk-card-sub { font-size: 12px; color: #a8988a; margin-top: 3px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mk-price { font-size: 12px; font-weight: 700; color: var(--brand); background: #fceee6; padding: 3px 8px; border-radius: 12px; flex: none; }
.mk-price-free { color: #2ba24c; background: #e5f7ea; }
.mk-price-own { color: #7a93c8; background: #e9eefb; }
.mk-price.st-on { color: #2ba24c; background: #e5f7ea; }
.mk-card-body {
  font-size: 13px; color: #6f5c4b; line-height: 1.5; margin: 10px 0 12px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.mk-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.mk-meta { font-size: 12px; color: #a8988a; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mk-meta b { color: #7a6a5a; font-weight: 600; }
.mk-card-link { cursor: pointer; }
.mk-card-link:hover .mk-card-foot .mk-go { color: #07c160; }
.mk-go { color: #07c160; font-weight: 600; }
.mk-mk-ops { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.mk-empty {
  grid-column: 1 / -1; text-align: center; color: #a8988a;
  font-size: 14px; padding: 46px 12px; line-height: 1.8;
}
.mk-empty a { color: var(--brand); font-weight: 600; }

.mk-btn {
  border: none; border-radius: 18px; padding: 7px 14px; font-size: 13px; font-weight: 600;
  cursor: pointer; white-space: nowrap; transition: .15s;
}
.mk-btn-main { background: var(--brand); color: #fff; box-shadow: 0 3px 10px rgba(201,78,34,.28); }
.mk-btn-plain { background: #f1ebe4; color: #6f5c4b; }
.mk-btn:active { transform: scale(.97); }

@media (min-width: 520px) {
  .mk-grid { grid-template-columns: 1fr 1fr; }
  .mk-grid-mine { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 380px) {
  .mk-mk-ops { flex-direction: column; align-items: flex-end; }
}

/* ══ 市场 · 详情/套餐弹层（Coze 式）══ */
.mk-sheet { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.mk-sheet-mask { position: absolute; inset: 0; background: rgba(30, 20, 12, 0.42); }
.mk-sheet-card {
  position: relative; width: 100%; max-width: 560px; max-height: 88vh;
  background: #fff; border-radius: 20px 20px 0 0; overflow: hidden;
  display: flex; flex-direction: column; animation: mkUp .22s ease;
}
@keyframes mkUp { from { transform: translateY(30px); opacity: .5; } to { transform: none; opacity: 1; } }
.mk-close { position: absolute; top: 14px; right: 14px; width: 30px; height: 30px; border: none; border-radius: 50%; background: #f0ebe5; color: #6f5c4b; font-size: 15px; cursor: pointer; z-index: 2; }
.mk-detail-body { padding: 22px 20px 12px; overflow-y: auto; }
.mk-detail-foot { padding: 14px 20px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid #f0e8e0; }
.mk-cta { display: block; width: 100%; border: none; background: var(--brand); color: #fff; font-size: 16px; font-weight: 700; padding: 13px 0; border-radius: 25px; cursor: pointer; box-shadow: 0 6px 18px rgba(201,78,34,.3); }
.mk-cta:active { transform: scale(.99); }

.mk-d-head { display: flex; align-items: center; gap: 14px; }
.mk-d-t { flex: 1; min-width: 0; }
.mk-d-title { font-size: 19px; font-weight: 800; color: #2f2116; line-height: 1.3; }
.mk-d-sub { font-size: 13px; color: #8a786a; margin-top: 4px; line-height: 1.5; }
.mk-pills { display: flex; flex-wrap: wrap; gap: 7px; margin: 14px 0 4px; }
.mk-pill { font-size: 12px; color: #8a786a; background: #f4f0eb; border-radius: 12px; padding: 4px 9px; }
.mk-d-sec { font-size: 14px; font-weight: 700; color: #3a2a1c; margin: 18px 0 8px; }
.mk-d-desc { background: #fbf7f2; border-radius: 12px; padding: 12px 14px; font-size: 13px; color: #5c4a3a; line-height: 1.7; }
.mk-d-line { margin: 6px 0; }
.mk-d-note { font-size: 12px; color: #a8988a; margin-top: 12px; line-height: 1.6; }

.mk-plan-body { padding: 22px 20px calc(22px + env(safe-area-inset-bottom)); overflow-y: auto; }
.mk-plan-grid { margin-top: 18px; display: flex; gap: 12px; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; }
.mk-plan-card {
  flex: 0 0 46%; scroll-snap-align: start;
  background: #fff; border: 1.5px solid #f0e8e0; border-radius: 16px; padding: 16px;
  box-shadow: 0 2px 12px rgba(120,90,60,.06);
  display: flex; flex-direction: column;
}
.mk-plan-name { font-size: 17px; font-weight: 800; color: #2f2116; }
.mk-plan-tag { font-size: 12px; color: #a8988a; margin-top: 3px; }
.mk-plan-price { font-size: 26px; font-weight: 800; color: #2f2116; margin: 12px 0 2px; display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.mk-plan-price small { font-size: 14px; color: #8a786a; font-weight: 600; }
.mk-plan-orig { font-size: 13px; color: #b8a89a; text-decoration: line-through; font-weight: 500; }
.mk-plan-off { font-size: 11px; color: #2ba24c; background: #e5f7ea; padding: 1px 6px; border-radius: 8px; font-weight: 700; }
.mk-plan-avg { font-size: 12px; color: #a8988a; margin: 2px 0 10px; }
.mk-plan-buy { display: block; width: 100%; border: none; background: #1a1a1a; color: #fff; font-size: 15px; font-weight: 700; padding: 12px 0; border-radius: 22px; cursor: pointer; margin: 10px 0; }
.mk-plan-buy:active { transform: scale(.99); }
.mk-plan-list { list-style: none; margin: 0; padding: 0; font-size: 13px; color: #6f5c4b; line-height: 2; }
@media (min-width: 520px) {
  .mk-plan-card { flex: 0 0 31.5%; }
}

/* ══ 首页 · 智能体市场大卡片 ══ */
.mk-banner {
  margin: 16px; display: flex; align-items: center; gap: 14px;
  padding: 18px 18px; border-radius: 20px; cursor: pointer;
  background: linear-gradient(135deg, #c94e22, #e58a54);
  box-shadow: 0 8px 22px rgba(201, 78, 34, 0.30); color: #fff;
}
.mk-banner-ico { width: 52px; height: 52px; border-radius: 16px; background: rgba(255,255,255,.22); display: flex; align-items: center; justify-content: center; font-size: 26px; flex: none; }
.mk-banner-t { flex: 1; min-width: 0; }
.mk-banner-name { font-size: 19px; font-weight: 800; }
.mk-banner-sub { font-size: 13px; opacity: .92; margin-top: 3px; }
.mk-banner-go { background: #fff; color: var(--brand); font-size: 14px; font-weight: 700; padding: 9px 16px; border-radius: 22px; flex: none; }
.mk-banner:active { transform: scale(.99); }
/* 技能市场：同款大卡，用偏冷的绿做区分（智能体市场=暖橙，技能市场=工具绿） */
.mk-banner-skills { background: linear-gradient(135deg, #2f8f5b, #54c97f); box-shadow: 0 8px 22px rgba(47, 143, 91, 0.28); }
.mk-banner-platform { background: linear-gradient(135deg, #2b6bb5, #5aa9e8); box-shadow: 0 8px 22px rgba(43, 107, 181, 0.28); }

/* ── 代码猫导页（真跑）── */
.code-page { display: flex; flex-direction: column; height: calc(100dvh - 76px); }
.mk-code-tag { display: inline-block; background: #1f6feb1a; color: #1f6feb; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 8px; vertical-align: 2px; }
.code-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid #eee; background: #fff; flex: none; }
.code-back { font-size: 26px; color: #333; background: none; border: none; padding: 0 6px; }
.code-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: #f3f3f3; flex: none; }
.code-head-info { flex: 1; min-width: 0; }
.code-head-name { font-size: 17px; font-weight: 800; }
.code-backend { font-size: 12px; color: var(--brand); font-weight: 600; }
.code-head-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.code-bal { background: #f7f2ec; border: none; border-radius: 16px; padding: 6px 12px; font-size: 13px; color: #7a5b3a; flex: none; }
.code-gate { flex: 1; display: flex; align-items: center; justify-content: center; padding: 24px; }
.code-gate-card { background: #fff; border: 1px solid #eee; border-radius: 18px; max-width: 360px; padding: 28px 22px; text-align: center; }
.code-gate-ico { font-size: 40px; }
.code-gate-title { font-size: 18px; font-weight: 800; margin: 12px 0 8px; }
.code-gate-desc { font-size: 14px; color: var(--muted); line-height: 1.7; margin-bottom: 18px; }
.code-main { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.code-thread { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.code-msg { display: flex; }
.code-user { justify-content: flex-end; }
.code-user .user-bubble { background: var(--brand); color: #fff; }
.code-bubble { max-width: 86%; padding: 10px 14px; border-radius: 16px; font-size: 15px; line-height: 1.6; white-space: pre-wrap; word-break: break-word; }
.code-assistant { justify-content: flex-start; }
.code-assistant .asst-bubble { background: #f3f3f3; color: #1c1c1c; }
.asst-text { display: inline; }
.code-caret { display: inline-block; width: 2px; height: 1em; background: var(--brand); margin-left: 2px; animation: caretBlink .9s steps(2) infinite; vertical-align: -2px; }
@keyframes caretBlink { 0%,100% { opacity: 1; } 50% { opacity: 0; } }
.code-run-card { flex-direction: column; width: 100%; background: #0f1720; color: #d7e0ea; border-radius: 14px; overflow: hidden; }
.run-head { display: flex; align-items: center; gap: 8px; padding: 9px 12px; background: #16212c; font-size: 13px; }
.run-tag { font-weight: 700; color: #7dd3fc; }
.run-status { flex: 1; color: #9fb1c2; font-size: 12px; }
.run-toggle { background: none; border: 1px solid #33424f; color: #9fb1c2; border-radius: 10px; font-size: 12px; padding: 3px 9px; }
.run-collapse { display: block; }
.run-code { margin: 0; padding: 12px; background: #0b1220; color: #9fb1c2; font-size: 12.5px; line-height: 1.55; overflow-x: auto; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.run-out { padding: 0 12px 8px; border-top: 1px solid #1e2a35; }
.run-err .run-pre { color: #fca5a5; }
.run-lab { font-size: 11px; color: #647990; padding: 8px 0 4px; }
.run-pre { margin: 0; white-space: pre-wrap; word-break: break-word; font-size: 13px; line-height: 1.5; color: #d7e0ea; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.code-msg .run-errline { padding: 8px 12px; color: #fca5a5; font-size: 13px; background: #1a1113; border-top: 1px solid #2a1a1e; }
.run-trunc { padding: 6px 12px; color: #647990; font-size: 12px; }
.run-status.ok { color: #4ad295; }
.run-status.err { color: #f87171; }
.run-diff { margin: 0; padding: 12px; background: #0b1220; color: #9fb1c2; font-size: 12.5px; line-height: 1.55; overflow-x: auto; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.run-dl-line { display: block; white-space: pre; min-height: 1.2em; }
.run-dl-line.d-add  { color: #4ad295; background: rgba(36,138,92,.18); }
.run-dl-line.d-del  { color: #f87171; background: rgba(185,61,61,.18); }
.run-dl-line.d-hunk { color: #7dd3fc; background: #16212c; }
.run-dl-line.d-file { color: #d7e0ea; background: #16212c; font-weight: 600; }
.run-dl-line.d-ctx  { color: #9fb1c2; }
.code-msg.code-err { justify-content: flex-start; color: #b42318; background: #fdecec; border-radius: 12px; padding: 8px 12px; font-size: 13px; width: 100%; }
.code-input { flex: none; padding: 10px 12px 16px; border-top: 1px solid #eee; background: #fff; }
.code-input-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.code-lang { border: 1px solid #ddd; border-radius: 10px; padding: 6px 10px; font-size: 13px; background: #fff; }
.code-input-box { display: flex; align-items: flex-end; gap: 8px; }
.code-input-box textarea { flex: 1; resize: none; border: 1px solid #ddd; border-radius: 12px; padding: 10px 12px; font-size: 15px; line-height: 1.5; }

/* ── 门店 POI 选择器 ── */
.poi-row { display: flex; gap: 8px; margin-top: 8px; }
.poi-btn { background: #f3ede6; color: var(--brand); border: none; border-radius: 10px; padding: 8px 12px; font-size: 13px; font-weight: 600; }
#poiMask .form-panel { max-height: 78dvh; overflow-y: auto; }
.poi-search { display: flex; gap: 8px; margin-bottom: 12px; }
.poi-search input { flex: 1; border: 1px solid #ddd; border-radius: 10px; padding: 9px 12px; font-size: 15px; }
.poi-list { display: flex; flex-direction: column; gap: 8px; }
.poi-item { border: 1px solid #eee; border-radius: 12px; padding: 11px 12px; cursor: pointer; transition: background .15s; }
.poi-item:active { background: #f4efe9; }
.poi-item-name { font-size: 15px; font-weight: 700; }
.poi-item-addr { font-size: 12.5px; color: var(--muted); margin-top: 3px; line-height: 1.5; }
.poi-empty { text-align: center; color: var(--muted); font-size: 14px; padding: 20px 0; }

/* ── 平台后台（抖音/本地推 账号分析 + 运营方案）── */
.platform-notice { background: #eef4fb; border: 1px solid #d4e3f6; color: #1f4d7f; border-radius: 10px; padding: 10px 12px; font-size: 13px; line-height: 1.55; margin-bottom: 14px; }
.platform-notice.warn { background: #fdf1e9; border-color: #f5d9c4; color: #8a4b12; }
.platform-notice.ok { background: #eaf6ef; border-color: #cdebd8; color: #1f6a3e; }
.pl-sec { border: 1px solid #eee; border-radius: 14px; padding: 14px; margin-bottom: 16px; background: #fff; }
.pl-sec-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.pl-sec-title { font-size: 16px; font-weight: 800; color: var(--ink); }
.pl-sec-ops { display: flex; gap: 8px; }
.pl-bind { text-decoration: none; display: inline-flex; align-items: center; }
.pl-list { display: flex; flex-direction: column; gap: 8px; }
.pl-card { display: flex; align-items: center; justify-content: space-between; gap: 8px; border: 1px solid #eee; border-radius: 12px; padding: 11px 12px; }
.pl-card-l { min-width: 0; }
.pl-card-name { font-size: 15px; font-weight: 700; }
.pl-card-sub { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.pl-card-r { display: flex; gap: 8px; flex: none; }
.btn-plain.danger { color: #c0392b; border-color: #efcfc8; }
.pl-empty { color: var(--muted); font-size: 14px; padding: 8px 0; line-height: 1.6; }
.pl-box { min-height: 60px; }
.analysis-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 4px 0 10px; }
.an-cell { background: #f7f4f0; border-radius: 10px; text-align: center; padding: 12px 4px; }
.an-num { font-size: 18px; font-weight: 800; color: var(--brand); }
.an-lab { font-size: 12px; color: var(--muted); margin-top: 4px; }
.pl-vids { display: flex; flex-direction: column; gap: 6px; }
.pl-vid { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; color: #444; padding: 6px 10px; background: #faf8f5; border-radius: 8px; }
.pl-vid-t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 62%; color: #222; }
.pl-plan { display: flex; flex-direction: column; gap: 12px; }
.pl-sect { border: 1px solid #eee; border-radius: 12px; padding: 12px; font-size: 14.5px; line-height: 1.7; color: #333; }
.pl-sect.tip { background: #fff8e8; border-color: #f2e3bd; }
.pl-sect-h { font-weight: 800; color: var(--ink); margin-bottom: 6px; }
.pl-topics { margin: 0; padding-left: 18px; }
.pl-topics li { margin-bottom: 4px; }
.pl-plan-txt { white-space: pre-wrap; }

/* ── 消息区 Markdown 渲染（markdown-it 输出，html:false 防 XSS）── */
/* 2026-10-16：正文**块的间距**照 opencode 那一套收敛（`session-ui/src/components/markdown.css`，
   v1.18.21）—— 段距 8→12、列表缩进 22→32、列表项只留底距 8、代码块 radius 8→6 / padding 12 /
   上下 12-24、表格 16 与 th/td 12、引用 16、分隔线 12→32。
   ⚠️ **字号故意没抄**：它的基准是 14px 桌面正文，我们是 15px（`--chat-font`）；照抄会把 h3
   压到 13px < 正文（它靠字重+`muted` 色分层，那是终端/桌面的取舍），聊天里读起来是缩小。
   同理 `pre` 的字号留在下面那条 `pre code`（13px），不跟它的 13px 对不上就改外层。 */
/* .msg-content 是 white-space:pre-wrap，会把 markdown 块标签间换行渲染成全角空行；
   故 AI 侧 .msg-text 改回 normal（换行由 markdown-it breaks:true 生成 <br>），用户侧仍用 esc 纯文本需保留 pre-wrap。 */
#chat .msg-ai .msg-text { white-space: normal; font-size: var(--chat-font, 15px); line-height: 1.6; }
#chat .msg-ai .msg-text > :first-child { margin-top: 0; }
#chat .msg-ai .msg-text > :last-child { margin-bottom: 0; }
#chat .msg-ai .msg-text p { margin: 0 0 12px; }   /* 借 opencode：段距 12px */
/* 标题：字号仍是 em（不抄它的固定 px，见文件头）；**上下留白与行高照它** ——
   h1 28/12、h2 24/10、h3+ 20/8，行高 150%（它 `:34-68` + `--line-height-large`）。 */
#chat .msg-ai .msg-text h1, #chat .msg-ai .msg-text h2, #chat .msg-ai .msg-text h3,
#chat .msg-user .msg-text h1, #chat .msg-user .msg-text h2, #chat .msg-user .msg-text h3 {
  font-weight: 600; color: var(--text); line-height: 1.5; margin: 20px 0 8px; }
#chat .msg-ai .msg-text h1 { font-size: 1.14em; margin: 28px 0 12px; }
#chat .msg-ai .msg-text h2 { font-size: 1em; margin: 24px 0 10px; }
#chat .msg-ai .msg-text h3 { font-size: 0.94em; }
#chat .msg-ai .msg-text ul, #chat .msg-ai .msg-text ol,
#chat .msg-user .msg-text ul, #chat .msg-user .msg-text ol {
  margin: 8px 0 12px; padding-left: 32px; }   /* 借 opencode：缩进 32px、下距 12px */
#chat .msg-ai .msg-text li, #chat .msg-user .msg-text li { margin: 0 0 8px; }
#chat .msg-ai .msg-text code { background: var(--code-bg); color: var(--code-fg); padding: 2px 4px; border-radius: 4px; font-size: 13px; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }   /* 借 opencode：padding 2px 4px */
#chat .msg-ai .msg-text pre { background: var(--pre-bg); border: 1px solid var(--border); border-radius: 6px; padding: 12px; overflow-x: auto; margin: 12px 0 24px; }   /* 借 opencode：radius 6 / padding 12 / 上下 12-24 */
#chat .msg-ai .msg-text pre code { background: none; color: var(--text); padding: 0; border-radius: 0; font-size: 13px; line-height: 1.55; display: block; }
#chat .msg-ai .msg-text blockquote { margin: 16px 0; padding: 2px 12px; border-left: 3px solid var(--brand); color: #6b645e; background: rgba(201,78,34,.04); border-radius: 0 8px 8px 0; }   /* 借 opencode：上下 16px */
#chat .msg-ai .msg-text hr { border: 0; border-top: 1px solid var(--border); margin: 32px 0; }
#chat .msg-ai .msg-text a { color: var(--brand); text-decoration: underline; word-break: break-all; }
#chat .msg-ai .msg-text table { border-collapse: collapse; width: 100%; margin: 16px 0; font-size: var(--chat-font, 15px); }   /* 借 opencode：16px、字号=正文 */
#chat .msg-ai .msg-text th, #chat .msg-ai .msg-text td { border: 1px solid var(--border); padding: 12px; text-align: left; vertical-align: top; }   /* 借 opencode：padding 12px */
#chat .msg-ai .msg-text th { background: var(--pre-bg); font-weight: 600; }
#chat .msg-ai .msg-text strong { font-weight: 700; color: var(--text); }
#chat .msg-ai .msg-text em { color: var(--text); }

/* 过程块（推理链 + 联网核实状态）：默认折叠成「过程」，点开看 */
#chat .think-box {
  margin: 0 0 8px; border: 1px solid var(--border); border-radius: 10px;
  background: rgba(0,0,0,0.025); overflow: hidden;
}
#chat .think-box summary {
  cursor: pointer; list-style: none; padding: 7px 12px;
  font-size: 12px; color: var(--muted, #999); user-select: none;
  display: flex; align-items: center; gap: 6px;
}
#chat .think-box summary::-webkit-details-marker { display: none; }
#chat .think-box summary::before {
  content: ''; width: 6px; height: 6px; flex: none;
  border-right: 1.5px solid var(--muted, #aaa); border-bottom: 1.5px solid var(--muted, #aaa);
  transform: rotate(-45deg); transition: transform .15s; margin-left: 2px;
}
#chat .think-box[open] summary::before { transform: rotate(45deg); }
/* 折叠计数那一小截（`… +N 行`）：**只在折叠态显示** —— 展开了那几行就在眼皮底下，
   再报「还有 N 行」就是废话。零 JS：靠 details 自己的 open 属性切（同上面那条箭头）。 */
#chat .think-box[open] .think-fold { display: none; }
#chat .think-body {
  padding: 4px 12px 10px; font-size: 13px; line-height: 1.65;
  color: #666; white-space: normal; word-break: break-word;
}
/* 密码框「显示/隐藏」切换 */
.pwd-wrap { position: relative; }
.pwd-wrap input { padding-right: 44px; }
.pwd-wrap .pwd-toggle {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  background: none; border: 0; cursor: pointer; font-size: 18px; line-height: 1;
  opacity: .5; padding: 6px 8px; color: inherit;
}
.pwd-wrap .pwd-toggle:hover { opacity: .9; }
.pwd-wrap .pwd-toggle.on { opacity: .85; }

/* 思考中：小转圈，明确告诉用户猫导在想（这期间正文还没出） */
#chat .think-spinner {
  width: 11px; height: 11px; flex: none; border-radius: 50%;
  border: 2px solid rgba(0,0,0,.15); border-top-color: var(--brand, #c94e22);
  animation: think-spin .8s linear infinite;
}
#chat .think-box[open] summary { padding-bottom: 4px; }
#chat .think-box[open] .think-body { border-top: 1px dashed var(--border); padding-top: 8px; }
@keyframes think-spin { to { transform: rotate(360deg); } }

/* ── 常显的「过程」那一行 + 来源条（2026-10-16）──────────────────────────────
   服务端给 `thinking` 帧加了两个可选字段：`progress`（这一句是过程、不是模型自己的
   思考）与 `sources`（这一轮真检索到的 URL）。它们原来一起躺在**默认折叠**的
   `.think-box` 里 —— 折叠态下屏幕上只剩「思考中… · +N 行」，用户报的
   「不像 deepseek 能实时看到调用工具和信息源」就是这个。模型自己的推理不带
   `progress`，仍旧只进折叠块（两者从此分家）。 */
#chat .live-line {
  display: flex; align-items: center; gap: 6px; margin: 0 0 8px;
  font-size: 12px; color: var(--muted, #999);
}
/* 专家模式小标：猫导按聊天内容自己切到编导/投流时，用户得看得见「换了镜片」。
   没有这一行，回答变窄了用户只会觉得「怎么答得跟刚才不一样」，看不出是切了专家。 */
#chat .expert-chip {
  display: inline-block; margin: 0 0 8px; padding: 2px 9px;
  font-size: 12px; line-height: 18px; border-radius: 9px;
  color: var(--brand, #c94e22); border: 1px solid rgba(201, 78, 34, .35);
  background: rgba(201, 78, 34, .07);
}
#chat .expert-chip.expert-traffic {
  color: #1f6f8b; border-color: rgba(31, 111, 139, .35); background: rgba(31, 111, 139, .07);
}
/* 专家模式手动开关（2026-10-20）：功能条最前面那颗 chip + 四档选择弹层。
   常态沿用 .fn-chip（米色胶囊），非「自动」时由 JS 挂 .active（品牌色）——
   用户一眼能看出「这一轮我锁了编导/投流」，而不是只有点进弹层才知道。 */
.fn-chip.fn-expert { font-weight: 600; }
.expert-opts { display: flex; flex-direction: column; gap: 8px; }
.expert-opt {
  display: block; width: 100%; box-sizing: border-box; text-align: left;
  padding: 10px 14px; border: 1px solid var(--border); border-radius: 12px;
  background: #fff; color: var(--text); font-family: inherit; cursor: pointer;
}
.expert-opt:hover { border-color: var(--brand, #c94e22); }
.expert-opt.on { border-color: var(--brand, #c94e22); background: rgba(201, 78, 34, .06); }
.expert-opt-name { display: block; font-size: 15px; font-weight: 600; }
.expert-opt-check { float: right; color: var(--brand, #c94e22); font-weight: 700; }
.expert-opt-hint { display: block; margin-top: 3px; font-size: 12px; color: var(--muted); line-height: 1.5; }
.expert-panel { max-height: 80vh; overflow-y: auto; }
}
#chat .live-dot {
  width: 6px; height: 6px; flex: none; border-radius: 50%;
  background: var(--brand, #c94e22); animation: live-pulse 1.2s ease-in-out infinite;
}
@keyframes live-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
#chat .live-txt { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
/* 来源条：这一轮**真检索到**的站。边搜边出，回答写完了也留着 —— 它是这一轮的可核记录。
   外站一律带 rel="noopener noreferrer"（同 .msg-link 那条口径：别把本页地址当 referer 送出去）。 */
#chat .src-strip {
  margin: 0 0 8px; padding: 7px 12px; border: 1px solid var(--border);
  border-radius: 10px; background: rgba(0,0,0,0.025);
}
#chat .src-head { font-size: 12px; color: var(--muted, #999); margin-bottom: 3px; }
#chat .src-item {
  display: block; font-size: 12px; color: var(--accent, #c94e22); text-decoration: none;
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
#chat .src-item:hover { text-decoration: underline; }

/* ── 微信式语音消息气泡（聊天框里）：绿色半圆气泡 + 波形 + 秒数，点一下播放 ── */
/* 关键：.msg-content 默认 flex:1 1 auto 会撑满整行 → 语音气泡必须收窄成「贴合内容」的紧凑气泡并贴向头像侧，
   否则会渲染成一整条绿色长条（这就是之前"不是半圆形"的真因）。 */
.msg-voice .msg-main { flex: 0 1 auto; align-items: flex-start; }   /* msg-main 宽度=内容，不占满 */
.msg-voice .msg-content {
  flex: 0 0 auto;
  background: #95ec69; color: #134f16;
  border-radius: 18px;             /* 内侧大圆角，胶囊感 */
  border-top-right-radius: 9px;    /* 头像侧稍平（配小尾巴） */
  border-bottom-right-radius: 9px;
  padding: 9px 13px;
  cursor: pointer;
  position: relative;
  -webkit-user-select: none; user-select: none;
}
.msg-voice .msg-content::after {          /* 右侧小尾巴：指向用户头像 */
  content: ""; position: absolute; top: 50%; right: -6px;
  transform: translateY(-50%);
  width: 0; height: 0;
  border-top: 5px solid transparent; border-bottom: 5px solid transparent;
  border-left: 6px solid #95ec69;
}
.msg-voice .vv { display: flex; align-items: center; gap: 6px; min-width: 92px; }
.msg-voice .vv-ico { font-size: 13px; line-height: 1; }
.msg-voice .vv-wave { display: flex; align-items: center; gap: 2px; height: 16px; }
.msg-voice .vv-wave span { width: 2.5px; border-radius: 2px; background: #2f6d26; }
.msg-voice .vv-wave span:nth-child(1) { height: 6px; }
.msg-voice .vv-wave span:nth-child(2) { height: 10px; }
.msg-voice .vv-wave span:nth-child(3) { height: 7px; }
.msg-voice .vv-wave span:nth-child(4) { height: 12px; }
.msg-voice .vv-wave span:nth-child(5) { height: 8px; }
.msg-voice .vv-wave span:nth-child(6) { height: 5px; }
.msg-voice .vv-dur { color: #134f16; font-size: 13px; font-weight: 600; }
.msg-voice .vv.playing .vv-wave span { animation: vvBar 0.8s ease-in-out infinite; }
@keyframes vvBar { 0%, 100% { transform: scaleY(0.4); } 50% { transform: scaleY(2); } }

/* ── 移动端 H5（微信/手机浏览器）：禁长按唤起系统「复制/上下文菜单」浮层，避免挡住语音按住手势与聊天操作 ── */
/* 说明：本应用复制一律走按钮，长按选中并无必要；仅输入框保留可选中，供编辑/复制自己说的话。 */
html, body, .app, #app, main, .container {
  -webkit-touch-callout: none !important;
  -webkit-user-select: none !important;
  user-select: none !important;
}
#chat .msg-content, #chat .msg-text, #chat .copy-wrap, #chat .copy-wrap *,
.bar, .bar-row, .revise-row, .voice-bar, .voice-bar *,
.tabbar, .tabbar *, .topbar, .topbar *, .page-header,
.mask, .mask *, .more-mask, .more-mask * {
  -webkit-touch-callout: none !important;
  -webkit-user-select: none !important;
  user-select: none !important;
}
input, textarea, .msg-text input, .msg-text textarea {
  -webkit-touch-callout: default !important;
  -webkit-user-select: text !important;
  user-select: text !important;
}
/* 语音按住：禁系统触摸动作抢手势（长按不滚动、不触发上下文菜单，松手才判定发送意图） */
.tabbar-center, .tabbar a.tabbar-center,
.voice-bar, .voice-bar * {
  touch-action: none !important;
}
/* ── 语音转文字弹层（右滑语音「转文字预览」）精装 ──
   只在 .voice-preview 作用域内覆盖通用 .mask/.form-panel，专打 #voicePreview，
   不碰视频提取 / 更多功能 / 登录 等其它共用 .form-panel 的弹层。 */

/* 悬层抬到其它 form-panel 之上，且面板本身有「从底部滑入」的微动画 */
.voice-preview { z-index: 101; }
.voice-preview .form-panel {
  border-radius: 20px 20px 0 0;
  padding: 22px 18px calc(26px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -10px 32px rgba(0, 0, 0, 0.12);
  animation: vp-in 0.22s ease-out;
}
@keyframes vp-in {
  from { transform: translateY(26px); opacity: 0.5; }
  to   { transform: translateY(0);    opacity: 1; }
}

/* 头部：圆形图标 + 标题 + 副标题 */
.voice-preview .vp-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.voice-preview .vp-ico {
  flex: none; width: 48px; height: 48px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--brand);
  background: linear-gradient(135deg, rgba(201, 78, 34, 0.16), rgba(201, 78, 34, 0.04));
  border: 1px solid rgba(201, 78, 34, 0.16);
}
.voice-preview .vp-title { font-size: 17px; font-weight: 700; color: var(--text); line-height: 1.2; }
.voice-preview .vp-sub { margin-top: 3px; font-size: 12.5px; color: var(--muted, #999); }

/* 「已识别」状态徽标 */
.voice-preview .vp-badge {
  display: inline-flex; align-items: center; gap: 4px;
  margin-bottom: 12px; padding: 4px 10px; border-radius: 20px;
  font-size: 12px; color: #1c7c39; background: rgba(34, 175, 76, 0.10);
}

/* 可编辑文本框：独立精细样式，不依赖全局 textarea 默认 */
.voice-preview .vp-text {
  display: block; width: 100%; box-sizing: border-box; min-height: 132px;
  border: 1px solid #e8e8e8; border-radius: 12px; padding: 12px 13px;
  font-size: 15px; line-height: 1.65; color: var(--text);
  background: #fafafa; resize: vertical; font-family: inherit; outline: none;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.voice-preview .vp-text::placeholder { color: #b5b0ab; }
.voice-preview .vp-text:focus {
  border-color: var(--brand); background: #fff;
  box-shadow: 0 0 0 3px rgba(201, 78, 34, 0.10);
}

/* 提示行 */
.voice-preview .vp-hint { margin: 10px 2px 0; font-size: 12px; color: #b3ada7; }

/* 底部按钮：主操作「发送」更宽更醒目，两个次要按钮静音退后。去掉按钮里的 emoji（头部已有渐变麦克风图标），
   让『发语音 / 取消』读作轻量次级项，橙色「发送」成为唯一焦点——排布利落不打架。 */
.voice-preview .form-ops { gap: 10px; margin-top: 16px; }
.voice-preview .form-ops button { flex: 1; height: 46px; border-radius: 12px; font-size: 15px; border: none; }
.voice-preview .form-ops .btn-primary { flex: 1.25; font-weight: 600; background: var(--brand); color: #fff; }
.voice-preview .form-ops .btn-primary:active { background: #b4421c; }
.voice-preview .form-ops .btn-plain { font-weight: 500; background: #f5f5f5; color: #8a8680; }
.voice-preview .form-ops .btn-plain:active { background: #ececec; }

/* 「按住说话」条上切回文字的 ⌨ 按钮：整齐的圆形热区，点按有反馈 */
.voice-bar .voice-kb {
  width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; color: #a5a09b; transition: background 0.12s, color 0.12s;
}
.voice-bar .voice-kb:active { background: #f0edeb; color: var(--brand); }
/* ── 顶部头部：压缩固定控件，让最右「🐱 陪伴」永不溢出屏外 ──
   根因：03-agent-chat.css 里 @media(max-width:480px) 的 .chat-speak 规则写在了
   基础 .chat-speak（padding 7px 14px/14px）之前，source order 靠后的基础规则胜出
   → 「🔊 朗读：开 / 🐱 陪伴」两颗药丸在窄屏根本没变窄；一旦菜单+头像+商家+朗读+陪伴
   的固定宽度相加超过容器，flex 不换行，最右的 陪伴 先被甩出屏。
   .chat-head-info 是 flex:1 min-width:0 → 名字其实可被压到 0，真正挤爆的是这些 flex:none 项。
   这里（文件名 11- 排在最末，后写胜出）收紧定宽项，并允许药丸收缩+省略号，保证任意宽度都不溢出。 */

@media (max-width: 520px) {
  .chat-head { gap: 6px; padding: 6px 2px 8px; }
  .chat-menu { width: 32px; height: 32px; font-size: 15px; }
  .chat-avatar { width: 34px; height: 34px; }
  /* 商家下拉：只缩到能显示「服务商家」，选完商家名长也维持窄 */
  .merchant-select { max-width: 66px; font-size: 12px; padding: 6px 5px; }
  /* 药丸：真正变窄（覆盖被压制的基础规则）+ 允许收缩并在收不下时出省略号，而不是把陪伴顶出去 */
  .chat-speak {
    padding: 6px 9px; font-size: 12px;
    flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis;
  }
  .chat-head-info { flex: 1 1 auto; }
}

/* ── 视频卡「拆解/改写」：收进一个带标题的分组框（同类两拆解并排、改写单独一根），更好看也更清楚 ──
   之前三个散按钮在窄卡里堆叠，丑又挤；现在框起来，同类分组，加载/结果落框内。 */
.omni-panel {
  margin-top: 10px; padding: 10px 11px;
  border: 1px solid var(--line, #eee3d8); border-radius: 12px;
  background: #fffdfa;
}
.omni-panel-label {
  font-size: 12px; font-weight: 600; color: var(--muted, #a49d97);
  margin-bottom: 8px; display: flex; align-items: center; gap: 5px; line-height: 1.2;
}
.omni-row { display: flex; gap: 8px; }
.omni-row + .omni-row { margin-top: 8px; }
.omni-btn {
  flex: 1 1 0; min-width: 0; white-space: nowrap;
  padding: 10px 8px; border-radius: 10px;
  border: 1px solid var(--brand); background: #fff; color: var(--text);
  font-size: 14px; font-weight: 700; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
}
.omni-btn:disabled { opacity: 0.55; cursor: default; }
/* 文案拆解（最快）用品牌主色实心突出；进阶拆解/爆款改写白底深字（高对比，看得清） */
.omni-btn-quick { background: var(--brand); border-color: var(--brand); color: #fff; }
.omni-btn-rewrite { color: var(--text); }
.omni-body { width: 100%; margin-top: 10px; }
.omni-body .omni-loading {
  display: flex; align-items: flex-start; gap: 8px;
  color: var(--muted, #999); font-size: 13px; line-height: 1.5;
}
.omni-loading::before {
  content: ''; width: 14px; height: 14px; flex: none; margin-top: 2px; border-radius: 50%;
  border: 2px solid #eadfd3; border-top-color: var(--brand);
  animation: omni-spin 0.8s linear infinite;
}
@keyframes omni-spin { to { transform: rotate(360deg); } }
.omni-loading-text { flex: 1 1 auto; min-width: 0; }
/* 实时秒数（证明还在跑）；结果区报错红字 */
.omni-sec { color: #b9a99a; flex: none; font-variant-numeric: tabular-nums; }
.omni-error { padding: 10px 12px; border-radius: 10px; background: #fdf1f1; color: #b3282d; font-size: 13px; }

/* ── 流式期间「↓ 回到底部」悬浮胶囊：用户往上滚去读就亮出，点它回到最新并恢复跟随 ── */
.scroll-pill {
  position: fixed; right: 16px; bottom: 96px; z-index: 60;
  display: none; padding: 8px 14px; border-radius: 999px;
  border: 1px solid var(--line, #e9e1d8); background: rgba(255, 255, 255, 0.96);
  color: var(--text); font-size: 13px; font-weight: 600; cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
}
.scroll-pill:hover { color: var(--brand); border-color: var(--brand); }

/* ── 管理工作台（/workbench）窄屏：两张表改成竖排卡片 ──
   宽屏下 .rec-row.ord-row 是 6 列、.rec-row.user-row 是 8 列 grid（见上面 :1566/:1567），
   375px 屏上每列只剩 ~35px、字号还是 14px，数字全挤成一团。窄屏改成「一行一个字段」：
   表头藏掉，标签改从每个值格的 data-k 取（workbench.html 里加的），
   一套 HTML 同时服务宽窄两版，不做第二份 DOM。
   注意：.rec-* / .stat-* / .fb-* 只有 workbench.html 一个模板在用（已 grep 确认），
   所以这段不会波及别的页面。 */
@media (max-width: 640px) {
  .stat-grid { grid-template-columns: repeat(auto-fit, minmax(84px, 1fr)); gap: 8px; }
  .stat-num { font-size: 15px; }

  /* 表头藏的是一行列名，竖排里它不对应任何一条数据。
     这里不能用「谁特指度高谁赢」的写法：表头 HTML 是
     class="rec-row rec-head ord-row"，跟数据行共用 .rec-row.ord-row，
     两条规则特指度天然一样（试过两边都加 .rec-list，还是平手），平手时后写的赢，
     display:block 会盖掉 none，表头就顶着一张「手机号 套餐 金额…」的空卡出来。
     改成用 :not(.rec-head) 把表头**从这条规则里摘出去**，
     表头就只剩上面那条 display:none 命中它，跟书写顺序无关。 */
  .rec-row.rec-head { display: none; }
  .rec-row.ord-row:not(.rec-head),
  .rec-row.user-row:not(.rec-head) { display: block; padding: 12px 6px; }

  /* 手机号独占一行当标题 */
  .rec-row .rec-phone { font-size: 15px; margin-bottom: 8px; }

  /* 其余各列流式横排，前面用 data-k 补回标签 */
  .rec-row .rec-cnt,
  .rec-row .rec-active,
  .rec-row .rec-time {
    display: inline-block;
    text-align: left;
    margin: 0 16px 6px 0;
    font-size: 13px;
  }
  .rec-row .rec-cnt::before,
  .rec-row .rec-active::before,
  .rec-row .rec-time::before {
    content: attr(data-k) " ";
    color: var(--muted);
  }

  /* 会员那一列**不能**跟上面一起变成 inline-block —— 它的内容是「徽标 + 到期日 +
     一个按钮」，横排时会和前一列的注册时间挤在同一行，按钮还会被换行切开。
     窄屏下让它自己独占一行（display:block 本来就会，这里只补标签和间距）。 */
  /* 窄屏上换个摆法：整行就是这么宽，够摆「档位 + 到期日 + 按钮」一条，
     所以宽屏那两层竖排（06 里 .rec-vip 的 flex-direction: column）在这里掰回横排。 */
  .rec-row .rec-vip { flex-direction: row; flex-wrap: wrap; align-items: center; margin-top: 8px; }
  .rec-row .rec-vip::before { content: attr(data-k) " "; color: var(--muted); }
  .rec-row .vip-btn { margin-left: 6px; }

  /* 状态：底色胶囊（待付 / 已付 / 已关），颜色沿用宽屏的 .st0/.st1/.st2 */
  .rec-row .ord-status {
    display: inline-block;
    margin: 0 16px 6px 0;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 12px;
    line-height: 1.5;
  }
  .rec-row .ord-status::before { content: attr(data-k) " "; color: var(--muted); }
  .ord-status.st0 { background: #fdf3e3; }
  .ord-status.st1 { background: #eaf6ec; }
  .ord-status.st2 { background: #f0f0f0; }
}

/* ── 通用输入/确认弹层（替代原生 prompt/confirm，见 static/common.js）──────────────
   z-index 必须高过聊天页的抽屉(1001)、长按菜单与多选浮层(1000)、选择模式顶栏(980)：
   原生的 .mask 是 100，在抽屉里重命名对话时弹出来会被整个盖住、看着像「点了没反应」。 */
.dlg-mask { z-index: 2000; }
.dlg-desc { margin-bottom: 4px; }
.dlg-input, .dlg-textarea {
  width: 100%;
  box-sizing: border-box;
  margin-top: 12px;
  border: 1px solid #ddd;
  border-radius: 10px;
  padding: 11px 12px;
  font-size: 16px;   /* 16px 起：iOS 上小于 16px 的输入框聚焦时会被自动放大页面 */
  font-family: inherit;
  color: var(--text);
  background: #fff;
}
.dlg-textarea { min-height: 108px; line-height: 1.6; resize: vertical; }
.dlg-input:focus, .dlg-textarea:focus { outline: none; border-color: var(--brand); }
/* 只读展示（如「复制微信号」兜底）：点一下整段选中，方便直接拷贝 */
.dlg-input[readonly] { background: #f7f4f0; user-select: all; -webkit-user-select: all; }
.dlg-ops { margin-top: 18px; }
.dlg-ops .btn-primary.danger { background: #c0392b; }
/* ── 手机上的聊天页顶栏：改成**两行**，不再把一排控件挤在一行 ──
   11-chat-head-analyze-fix.css 解决了「陪伴被顶出屏外」，但代价是每个控件都被压到极限：
   375px 实测（容器 343px）人头像 34 + 菜单 32 + 商家 66 + 朗读 86 + 陪伴 62 + 间距 30 = 310，
   只剩 ~29px 给名字 —— 人设名显示成「猫…」（默认的「猫导」都要 34px）、
   商家显示成「佛山老…」（看不出当前服务的是哪家）、「🐱 陪伴」的「陪伴」两个字完全没了。
   溢出是保住了，但信息也没了：这是**读不了**，不是**点不到**。

   一行放不下这些控件是硬事实，所以这里让它换行，而不是继续压：
     第一行 = 身份（菜单 / 头像 / 人设名 / 「＋ 新对话」）
     第二行 = 控件（服务商家 / 朗读 / 陪伴）
   换行靠一个 `flex-basis:100%` 的伪元素强制断行（order 把它排在身份之后、控件之前），
   HTML 结构一行都不用动 —— 宽屏那套单行排布完全不受影响（整段在 media query 里）。

   ⚠️ 阈值 899 是**量出来的**，而且量出来才发现不是「差一点」而是「差一块」：
   2026-10-08 加「＋ 新对话」时用 tools/audit/_head_widths.py + _head_probe.py 在真浏览器里
   扫了 360~1280 每一档（明细 _out/head_widths.json）。关键在于**容器自己也有上限**：
   01-app-shell-history-login.css 里 `.container { max-width: 640px }`，只有
   `@media (min-width: 900px)` 才把它放到 960px —— 所以 **641~899 这一整段的顶栏可用宽
   恒为 608px**（640 − 内边距 32），跟视口多宽无关（660/700/768 三档实测都是 608）。
   而单行要放下 7 个定宽控件 + 完整的「猫导」正好也要
   控件 494 + 6×间距 72 + 内边距 8 + 名字 34 = 608 —— 卡在临界上，实测这三档里
   「猫导」拿到 33px / 需要 34px，渲染成**「猫…」**（_head_probe 里 name cw=33 sw=34；
   _head_widths 的 clipped 判据带 1px 容差，把这种差 1px 的截断判成了「没截」，别信它）。
   也就是说 641~899 **单行根本放不下**（这一带在装新按钮之前是放得下的：少 90px，
   名字有 56px 富余 —— 新按钮把这份富余吃掉了）。所以阈值跟着容器的断点走：899。
   顺带修掉旧的 520 阈值在 521~640 留的那个**真坏过**的带：media query 已不生效、
   单行又放不下，最右的控件被甩出屏外（装新按钮前是「陪伴」，之后是「＋ 新对话」@587
   完全看不见）、名字被压成 0。现在 375~899 全走两行，名字有 150~390px。

   窄屏两行里各控件的实测宽（375，容器 343）：
     第一行 90+34+32+间距 24 = 180，名字拿 165（够「猫导」＋几个字，实测已渲染）；
     第二行 116+88+64+间距 16 = 284 —— 都留得住。 */
@media (max-width: 899px) {
  .chat-head { flex-wrap: wrap; row-gap: 8px; }

  /* 强制断行：100% 宽 + 0 高，占满一行但不占高度，只吃掉一个 row-gap */
  .chat-head::after { content: ''; order: 2; flex: 0 0 100%; height: 0; }

  /* 第一行：身份。名字拿到整行剩下的宽度（不再被压成 1 个字） */
  .chat-menu, .chat-avatar { order: 1; }
  .chat-head-info { order: 1; flex: 1 1 0; min-width: 0; }
  /* 「＋ 新对话」= 身份那一类（order 1）→ 落在第一行最右。375 实测第一行
     90+34+32+间距 24 = 180，名字仍拿 165px（「猫导」够，还带几个字）。**别把它放进第二行**：
     第二行已在 284/343，再加就是 11- 记的那个「陪伴被顶出屏」。 */
  .chat-new { order: 1; }

  /* 第二行：控件。有地方了，就把 11- 里为了「不溢出」而收掉的可读性还回去 */
  .merchant-select, .chat-speak { order: 3; }
  .merchant-select { max-width: 120px; }         /* 原来 66px，一行只放得下 5 个字 */
  .chat-speak {
    /* 撤掉 11- 的收缩+省略号：第二行放得下，不该再出现「🐱 …」 */
    flex: none; overflow: visible; text-overflow: clip;
  }
}
/* ── 聊天页：软键盘弹起时的高度适配 ──
   2026-09-12 用户真机截图：在微信内置浏览器里打字，整页被顶飞 ——
   顶部标题栏和消息滚出屏幕，只剩半条表情反应栏挂在状态栏上，中间一大片空白。

   原因：iOS 的 WebKit 不认 <meta interactive-widget>（那是 Chromium 的东西），
   键盘弹起时**不缩布局视口**，于是 .chat-page 的 100dvh 仍是整屏高 →
   输入条落在键盘后面 → 浏览器只能把整页往上滚去看它 → 头部被推出可视区。

   修法：chat.parts/08-keyboard.js 把「键盘占掉的高度」量出来写进根元素 --kb，
   这里把聊天页缩到键盘上沿。键盘没弹时 --kb 是 0px，与改动前逐像素等价。 */
.chat-page {
  height: calc(100dvh - 56px - var(--kb, 0px));
}
/* 键盘弹起时 tabbar 反正压在键盘后面，留着只会白占 56px，所以这时不再为它预留。
   min-height 也必须一起撤掉：03-agent-chat.css 里那句 min-height:480px 是给矮窗口兜底的，
   键盘一弹可视区常常只剩 400px 出头，兜底值反而把页面卡在 480，输入条照样掉到键盘后面
   （实测：只改 height 不改 min-height，480 减不下去，正好差在键盘下沿上）。 */
body.kb-up .chat-page {
  height: calc(100dvh - var(--kb, 0px));
  min-height: 0;
}
body.kb-up .tabbar { display: none; }
/* 「停止生成」是 fixed 定位（chat.html 内联 bottom:150px）：键盘一弹它就落到键盘后面，
   流式生成中想停都点不到。跟着键盘一起抬上去。 */
body.kb-up #stopGenBtn { bottom: calc(150px + var(--kb, 0px)); }
/* 「填写模式」按形态适配（见 constants.py 的 FORM_UI、fill.js 的 setForm）
   ───────────────────────────────────────────────────────────────────────────
   原来这里是「内容类型(4) × 平台(3)」两级 tab（.tab-group/.tab-chip），拼出十几种组合而
   没有一格跟着变。现在是一排 6 个形态 chip + 该形态专属的格子 + 「更多设置」折叠。
   旧的 .tab-group/.tab-chip 留在 00-base-ui.css 里没删（这版之后已无人用）。 */

/* 形态：一排 6 个。窄屏横滑而不是换行 —— 换行会让 6 个形态占三行，
   把「这条文案想讲什么」那个主输入框挤到屏幕上第一屏之外。 */
.form-bar {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 0 6px;
  margin-bottom: 2px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.form-bar::-webkit-scrollbar { display: none; }
.form-chip {
  flex: 0 0 auto;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: all .15s;
}
.form-chip:hover { border-color: var(--brand); color: var(--brand); }
.form-chip.active { background: var(--brand); border-color: var(--brand); color: #fff; }

/* 选中形态后那行说明：说的是**结构**（拿到手长什么样），不是营销话术 */
.form-blurb {
  font-size: 13px;
  color: #666;
  line-height: 1.5;
  padding: 2px 0 12px 10px;
  border-left: 3px solid var(--brand);
  margin-bottom: 4px;
}

/* 形态专属格子的 chip 组：比形态 chip 小一号（一屏里可能要出现三组） */
.field-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.field-chip {
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fafafa;
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  transition: all .15s;
}
.field-chip:hover { border-color: var(--brand); color: var(--brand); }
.field-chip.active { background: var(--brand); border-color: var(--brand); color: #fff; }

/* 「更多设置」折叠头。复用 .card-title-row 的两端对齐，这里只加可点的手感 */
.more-head { cursor: pointer; margin-bottom: 6px; }
.more-arrow { font-size: 13px; color: var(--brand); font-weight: 600; }
#moreHint { line-height: 1.5; }
#moreBox { margin-top: 12px; }

/* 窄屏：形态 chip 更小一点，一屏能多露两个（仍然横滑） */
@media (max-width: 420px) {
  .form-chip { padding: 7px 12px; font-size: 13px; }
  .field-chip { padding: 6px 11px; }
}
/* ── 账号截图 → 候选清单卡（「这是哪个号？」）──────────────────────────────
   复用 06 号里 .bench-item / .bench-pick 的形（同一类卡片，别再写一份按钮样式）；
   这里只补候选行特有的：头像 + 两行文字 + 右侧按钮的横排。              */

.account-pick-card { max-width: 100%; }
.acct-cand { display: flex; align-items: flex-start; gap: 9px; }
.acct-cand .acct-avatar { width: 38px; height: 38px; flex: 0 0 38px; }
.acct-cand-id { flex: 1 1 auto; min-width: 0; }
.acct-cand-id .bench-item-sub { word-break: break-word; }
/* 按钮跟着卡片走（不是整行撑满）：手机上「就是它」点起来够大即可 */
.acct-cand .bench-pick { flex: 0 0 auto; margin-top: 0; white-space: nowrap; }
/* ── 页内多开：宽屏 /chat 顶上一排会话标签 ─────────────────────────────────────
   谁画的：static/chat.parts/06b-tabs.js（renderTabs / tabsHtml）。DOM 插在
   templates/chat.html 的 `.chat-head` 与 `.chat-main` 之间。
   视觉照抄小程序那套（miniprogram/pages/chat/chat.wxss 的 tab 段），三条它是这么定的、
   这里照做：
     · **等宽格**（宽度写死，不由标题撑）：一排**标签**，不是一行长短不齐的文字；
     · **活动格高 2px + 下沿画成自己的底色**：把槽底那条分界线盖掉，看上去就是
       「这一格管的就是下面这块」（folder tab）；
     · **溢出渐隐**：只在真的溢出时出现，差不到 1px 不算（算式在 06b 的 fadeFlags）。
   类名一律 `chat-tabs*`，刻意区别于本仓已有的 `.tabbar`（底部导航条）—— 只差一个连字符，
   谁读错一次都要花半天。

   配色换网页令牌（00-base-ui.css 的 :root），**对比度是按 WCAG 算过的、不是看出来的**
   （见 memory「对比度必须算不能看」；这一批实测值如下，改任何一格底色都要重算）：
     活动格标题 --brand #c94e22 / 白格 #ffffff        = 4.57:1 ✓
     非活动格标题 #7a6c5a / 非活动格底 #f5f2f0       = 4.57:1 ✓
     ✕ --brand-dark #a83f1b / 品牌淡底 #faede9       = 5.41:1 ✓
        （这里**不能用 --brand**：3.99:1 不够 —— 浅底上是它，不是深色那支）
     ↩ 恢复 #3f3931 / #fbf2ef                        = 10.35:1 ✓
   ⚠️ 不许用 --muted(#999999)：在 --bg 上只有 2.6:1。 */
.chat-tabs {
  flex: 0 0 auto;                    /* .chat-page 是定高 flex 列，聊天区 flex:1 自己让位 */
  position: relative;
  padding: 6px 6px 0;
  background: #ebe6e0;               /* 槽：比格子深一档 */
  border-bottom: 1px solid #ddd6cd;  /* 槽底那条分界线，活动格会把它盖掉 */
  border-radius: 12px 12px 0 0;
  box-sizing: border-box;
}
/* hidden 属性要单独护一句：UA 的 [hidden]{display:none} 会被本文件别处的 display 盖掉
   （作者样式一律赢过 UA）。窄屏与「还没画」都靠它。 */
.chat-tabs[hidden] { display: none; }

.chat-tabs-strip {                    /* 横向滚动容器 */
  overflow-x: auto; overflow-y: hidden;
  scrollbar-width: none; -ms-overflow-style: none;
}
.chat-tabs-strip::-webkit-scrollbar { display: none; }
.chat-tabs-inner {
  display: flex; gap: 6px;
  align-items: flex-end;             /* 活动格高 2px 只往上长，槽底那条线才对得齐 */
  width: max-content; min-width: 100%;
  padding-right: 2px;
}

.chat-tab {
  flex: 0 0 auto;
  width: 148px;                      /* 等宽格：一排标签，不是一行文字 */
  height: 30px; box-sizing: border-box;
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  padding: 0 6px 0 10px;
  border-radius: 9px 9px 0 0;
  background: rgba(255, 255, 255, .5);   /* 合成后 #f5f2f0，标题对比度按它算 */
  color: #7a6c5a;
  font-size: 13px; line-height: 1;
  cursor: pointer; user-select: none;
}
.chat-tab:hover { background: rgba(255, 255, 255, .78); }
.chat-tab.is-on {
  height: 32px;                      /* 高 2px：盖掉槽底那 1px 分界线 + 圆角的豁口 */
  margin-bottom: -1px;
  background: var(--card); color: var(--brand); font-weight: 600;
  border-bottom: 1px solid var(--card);   /* 下沿画成自己的底色 = folder tab 的关键 */
}
.chat-tab-title {
  flex: 1 1 auto; min-width: 0;      /* 少了 min-width:0，flex 子项不肯缩、省略号不出现 */
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.chat-tab-x {
  flex: none; font-size: 11px; line-height: 1;
  padding: 3px 6px; border-radius: 999px;
  background: rgba(201, 78, 34, .10); color: var(--brand-dark);
}
.chat-tab-x:hover { background: rgba(201, 78, 34, .18); }
.chat-tab-restore {
  width: auto; padding: 0 10px; justify-content: center;
  background: #fbf2ef; color: #3f3931; font-size: 12px;
}
.chat-tab-restore:hover { background: #f7e6e0; }

/* 溢出渐隐：两层同色渐变压在槽的两端，只有 .chat-tabs 带上 fade-l / fade-r 才显形 */
.chat-tabs-fade-l, .chat-tabs-fade-r {
  position: absolute; top: 6px; bottom: 1px; width: 26px;
  pointer-events: none; opacity: 0; transition: opacity .15s; z-index: 2;
}
.chat-tabs-fade-l { left: 6px;  background: linear-gradient(to right, #ebe6e0, rgba(235, 230, 224, 0)); }
.chat-tabs-fade-r { right: 6px; background: linear-gradient(to left,  #ebe6e0, rgba(235, 230, 224, 0)); }
.chat-tabs.fade-l .chat-tabs-fade-l { opacity: 1; }
.chat-tabs.fade-r .chat-tabs-fade-r { opacity: 1; }

/* 窄屏：这一排不存在（JS 也不维护它，见 06b-tabs.js 的 renderTabs 第二步）。 */
@media (max-width: 899px) { .chat-tabs { display: none; } }

@media (min-width: 900px) {
  /* 左栏（公众号排版）开着时，03-agent-chat.css:278-279 把 .chat-head/.chat-main 压到 980，
     漏了这一条 —— 不补的话标签条会通栏、与聊天区右边缘错位。写在这里靠后级联胜出，
     **不动 03 那个文件**。 */
  .chat-page.panel-open .chat-tabs { max-width: 980px; margin-right: auto; }
}
/* 左下角「任务胶囊」：猫导这一刻在跑几个工具。
   对标的就是 Claude Code 输入框下面那颗「● 0 agents」——**常驻**，空闲时也画，
   只是灰着；在跑时才亮起来。由后端 `{"type":"tools","n":N,"labels":[...]}` 驱动
   （见 services/agent.py 那段并发：起 N 一帧、收 0 一帧），DOM 在 templates/chat.html，
   逻辑在 static/chat.parts/05-stream.js 的 _toolCapsule()。

   ⚠️ **在流里**，排在功能条卡片上面（DOM 在 templates/chat.html，是 .fn-card 的**前一个**兄弟）。
      `align-self: flex-start` 让它在一个纵向 flex 列（.chat-main）里**收到内容宽**，不成通栏。
      **不要**改成 position:absolute/fixed 浮上去 —— 2026-10-12 实测过两种浮法都坏：
      写死 `bottom:150px` 在 PC 宽屏下压在输入条那排上（用户截图：盖住了橙色的「自动」那颗）；
      锚在卡片上浮到消息区上面，则盖住最新那条气泡的左下角 —— 而消息区自动滚到底，
      被盖的一截**永远滚不出来**。在流里一个像素都不挡，代价是常驻占一行。
   ⚠️ 底色**不透明**：半透明白底 + 浅色字是本仓踩过的坑（对比度要算不能看，见 memory
      `contrast-must-be-computed`）。这里是白底。空闲文字 #6b655e 对白底 5.8:1、
      在跑时 var(--ink) 约 16:1 —— 两档都过 4.5:1（13px 不是大字，不能用 3:1 那一档）。
      ⚠️ **别**图省事用 var(--muted) #999999（2.9:1）或 var(--ai-text-muted) #8a857f（3.7:1）:
      这两个本仓的既有灰都是给**大字号/装饰**用的，放这颗上就是看不见。 */
.tool-capsule {
  align-self: flex-start;             /* 纵向 flex 列里收到内容宽（别拉成通栏） */
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 100%;
  margin: 0 0 6px 2px;
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);            /* #fff，不透明 */
  color: #6b655e;                     /* 空闲态：5.8:1 */
  font-size: 13px;
  line-height: 1.3;
  box-shadow: 0 4px 14px rgba(29, 29, 29, .10);
}
/* 在跑（后端说 n>0）时才亮：文字加深、圆点亮起并开始呼吸 */
.tool-capsule.on {
  color: var(--ink);
  box-shadow: 0 4px 14px rgba(29, 29, 29, .16);
}
/* 文字超长时截断（完整那句话本来就在「过程」块里，这里只是个指示器） */
.tool-capsule > span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* 那颗小圆点：**它自己不带信息**（旁边一直有中文，完整那句在 title/aria 上），
   但**颜色**要说清「是哪一态」。2026-10-16 按 Claude Code 那颗点分了态
   （docs/claude-code-borrow.md 的 C1），只上有真信号的三态 —— 第四态 failed 没有信号，
   不编一个出来（编了就是屏幕上说假话）：
     空闲 idle    #c9c2ba 死灰，不呼吸（对白底 **1.76:1** —— 这条**故意**不按 1.4.11 那 3:1 算：
                  那颗点是装饰，旁边那行中文字一直把「哪一态」说全；真要按 3:1 得把灰压到
                  #8a857f 以下，那是另一笔改动，别混进这一条）
     在跑 running var(--brand) #c94e22 品牌色 + 呼吸（4.57:1）
     等你 waiting #b45309 琥珀 + 呼吸（5.02:1）—— **不是红**：红是「出事了」，
                  这里是「该你了」，两者混用会把「等你点一下」读成「报错」
   ⚠️ 顺序要紧：[data-state] 与 `.tool-capsule.on` 的选择器**同一档**（都是类那一列），
      同档靠**后写的赢**。把 running/waiting 这两条挪到 .on 前面，屏幕上就永远是品牌色，
      而且光看代码看不出来 —— 别动这个顺序。
   ⚠️ **这段注释的收尾两个字符一个都不能少**（星号加斜杠；这里不敢把字面量写出来 —— 一写出来
      这段注释就在例子里提前闭合了，同一个坑当场复发）。2026-10-16 漏过一次：它把紧跟其后的
      `.tool-capsule-dot` 基础规则和 `.tool-capsule.on .tool-capsule-dot` 那条**整条吞进注释** ——
      那颗点当场 0×0（胶囊窄 7px）、`在跑` 的呼吸动画一起没了，而浏览器**不报任何错**、
      CSS 语法检查也看不出来。抓到它的是 tests/_measure_capsule_states.py 的**真浏览器前后图**
      （before 那份 动画=tool-capsule-pulse，after 那份 动画=none）。现在另加
      tests/css-sanity.test.js 守这一类：数配平 + 一份「必须活着的选择器」名单
      （`.tool-capsule-dot` 就在名单里）。
*/
.tool-capsule-dot {
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #c9c2ba;
}
.tool-capsule.on .tool-capsule-dot {
  background: var(--brand);
  animation: tool-capsule-pulse 1.2s ease-in-out infinite;
}
/* 空闲：死灰 —— 显式写一遍（三态齐全，改其中一态时一眼看得见另外两态在哪）*/
.tool-capsule[data-state="idle"] .tool-capsule-dot {
  background: #c9c2ba;
}
/* 在跑：品牌色（上面那条已经给了，写在这里是为了让三态一眼看全）*/
.tool-capsule[data-state="running"] .tool-capsule-dot {
  background: var(--brand);
}
/* 等你：琥珀 —— 必须排在 `.on` 那条**之后**（同档选择器，后写的赢，见上面那句）*/
.tool-capsule[data-state="waiting"] .tool-capsule-dot {
  background: #b45309;
}
/* 刚跑完（2026-10-17，C2 逐项耗时）：绿、**不呼吸** —— 跑完了就别再装还在动。
   色值取本仓既有的「成了」绿 #157a38（同 05-tool-cards-skill-market.css 的 .ui-act-ok），
   对白底 **5.42:1**（算的，不是看的；远过 1.4.11 那条 3:1）。
   ⚠️ 也同样必须排在 `waiting` 之后、且是 3 个选择器级（同上面那句顺序警告）——
      写成 2 级会被 `.tool-capsule.on .tool-capsule-dot` 压住，屏幕上照旧是品牌红、静默。 */
.tool-capsule[data-state="done"] .tool-capsule-dot {
  background: #157a38;
  animation: none;
}
/* done 态可点（点开「这一轮的账」，C4）：光标与键盘焦点圈都要给 —— 只挂 role/tabindex
   而没有可见焦点，键盘用户 Tab 到它时屏幕上没有任何变化，等于不可用。 */
.tool-capsule[data-state="done"] { cursor: pointer; }
.tool-capsule[data-state="done"]:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}
/* ── 「这一轮的账」（C4 + codex #16，2026-10-17）────────────────────────────
   点一下 done 态的胶囊，在它下面展开这张小卡：每项一行（名字 / 没跑成 / 耗时）。
   · 白底，正文 var(--ink) 约 16:1；副文字 #6b655e 5.8:1；「没跑成」#b42318 6.6:1；
     按钮 var(--brand) #c94e22 4.57:1 —— 全部过 4.5:1（13px 不是大字，算过不是看的）。
   · **默认只列 5 项**（codex 的 TOOL_CALL_MAX_LINES）；点「展开全部」放到第二档 50 项
     （USER_SHELL_TOOL_CALL_MAX_LINES）。两档都由 05-stream.js 的 _capLedgerModel 切，
     CSS 不参与「列几项」—— 那是内容，不是样式。
   · 与胶囊同一条规矩：**在流里**、align-self:flex-start 收到内容宽，别浮起来。
   · **第二档（50 项）要能自己滚**：账长到 44vh 就封顶、里面滚，否则它会把输入框和
     「停止生成」一起顶出屏幕（那条是 position:fixed，_capLedgerPaint 按 offsetHeight
     把它抬到账上面；账本身不封顶，抬多高都不够）。 */
.tool-ledger {
  align-self: flex-start;
  max-width: min(100%, 460px);
  max-height: 44vh;
  overflow-y: auto;
  margin: 0 0 8px 2px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  color: var(--ink);
  font-size: 13px;
  line-height: 1.5;
  box-shadow: 0 6px 18px rgba(29, 29, 29, .10);
}
.tool-ledger-head {
  margin-bottom: 6px;
  color: #6b655e;                     /* 5.8:1 */
  font-size: 12px;
}
.tool-ledger-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 2px 0;
}
/* 名字是**唯一可伸缩**的那一列：工具名可能很长，截断它，别把右边的耗时挤出卡片 */
.tl-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tl-note {
  flex: none;
  color: #b42318;                     /* 6.6:1 —— 「没跑成」要能被一眼看见，但又别像报错横幅 */
}
.tl-dur {
  flex: none;
  margin-left: auto;                  /* 右对齐成一列，扫一眼就能比哪一步慢 */
  color: #6b655e;                     /* 5.8:1 */
  font-variant-numeric: tabular-nums; /* 数字等宽：上下两行的秒数才对得齐 */
}
.tool-ledger-tail {
  margin-top: 4px;
  color: #6b655e;
  font-size: 12px;
}
/* 「展开全部（还有 N 项）」：第二档入口。按钮必须有可见中文（memory: 按钮必须有中文）。 */
.tool-ledger-more {
  margin-top: 6px;
  padding: 2px 0;
  border: 0;
  background: none;
  color: var(--brand);                /* 4.57:1 */
  font: inherit;
  cursor: pointer;
}
.tool-ledger-more:hover { text-decoration: underline; }
.tool-ledger-more:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}
@keyframes tool-capsule-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: .35; transform: scale(.75); }
}
@media (prefers-reduced-motion: reduce) {
  .tool-capsule.on .tool-capsule-dot { animation: none; }
}
/* ⚠️ **没有** body.kb-up 那一档，也不该加：这一版是 absolute 锚在功能条卡片上的，
   卡片本身就在输入条上方那一列里、页面缩它就跟着缩 —— 键盘弹起它会自己跟着抬。
   老版本是 fixed 定位，才需要 `bottom: calc(150px + var(--kb))` 手动追键盘；
   换回 fixed 的话那条必须一起加回来，否则窄屏上胶囊会掉到键盘后面。 */
/* ── 市场调研弹层（2026-10-14：「打字」改成「选」）────────────────────────────
   壳是共用的 `.mask .dlg-mask` + `.auth-box`（跟 askText / askConfirm 同一套），
   这一份只补**里面那三行**：标签 + 一排能点的 chip + 两个输入框。

   为什么单独开一片、不并进 12-dlg-and-workbench-narrow.css：那一片是**通用弹层**的壳，
   而这里全是「调研这一格」的专用长相（三行、chip 排布）。通用壳里塞专用件，
   下一个弹层想改 padding 就得先搞清会不会碰到调研这一格。 */

/* `.auth-box` 整体是 text-align:center（它平时只装一行标题 + 一行说明）。
   这三行的标签是**左对齐**的：标签缩在中间会看不出它在标谁 —— 同
   06-drawer-personal-funds.css 里 `.vip-form` 那段注释。 */
.rs-box { text-align: left; max-width: 380px; }
.rs-sec { margin-top: 14px; }
.rs-lab {
  display: flex; align-items: baseline; gap: 6px;
  font-size: 13px; color: var(--muted); margin-bottom: 8px;
}
/* 括号里那句补充（「可多选」「可留空」）—— 不是标题的一部分，压小压淡 */
.rs-lab em { font-style: normal; font-size: 12px; color: #a09a94; }
.rs-row { display: flex; flex-wrap: wrap; gap: 8px; }

/* chip 的取值定死 px 不用 em：这几颗是**点击目标**，字号一变（窄屏/系统放大字体）
   高度跟着变，同一行能塞几颗就跟着变，弹层高度在两台机器上不是一个东西。 */
.rs-chip {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid #d8cec5;
  background: #f7f5f2;
  color: var(--text);
  font-size: 13px;
  line-height: 1.2;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}
/* 选中态：底 `--brand` + 白字（对比度 4.6:1，跟 `.btn-primary` / `.aq-opt-on` 同源）。
   ⚠️ 半透明白字压在浅底上只有 3.2~3.7:1，本仓栽过 —— 选中态要看得见就得把底压深。 */
.rs-chip.rs-on { background: var(--brand, #c94e22); border-color: var(--brand, #c94e22); color: #fff; }
.rs-chip:active { transform: scale(0.97); }
/* 弹层里的输入框复用 `.dlg-input`（12-dlg-and-workbench-narrow.css 已经定好边框/聚焦色）。
   这里只把它的 `margin-top` 收掉：上面 `.rs-lab` 已经给了 8px 间距，再加 12px 会把
   标签和它标的那个框推得太开，看不出是一组。 */
.rs-box .dlg-input { margin-top: 0; }
/* ── 竞品比价表（市场调研 · 副按钮）──────────────────────────────────────────
   一张卡 = 一张表。壳复用 `.tool-card`（白底、圆角、边框），这里只补表头、
   横向滚动和来源列。手机上表格不折列（折了就看不出哪一格对哪一行），
   整块横向滚 —— 与「一行一张小卡」的小程序实现不同，两端各有各的形状。

   列名**不在这里**：表头来自卡片上的 `columns`（服务端模板是唯一来源）。 */

/* 临时状态栏：轮询期间固定在视口顶部。**不是消息**，不落盘、不参与跨端合并。
   底色用 --brand-dark 而不是 --brand：白字压在 #c94e22 上只有 4.5 出头，
   压在 #a83f1b 上才稳（本仓栽过浅底白字，见 memory `contrast-must-be-computed`）。 */
.rs-bar {
  position: fixed; top: 14px; left: 50%; transform: translateX(-50%);
  z-index: 80; max-width: 92vw;
  padding: 9px 16px; border-radius: 999px;
  background: var(--brand-dark, #a83f1b); color: #fff;
  font-size: 13px; line-height: 1.2;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .18);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* `.tool-card` 自带 12px 内边距；这张卡的每一段自己定内边距（表要贴边才能横向滚） */
.rs-card { padding: 0; }
.rs-head { padding: 11px 12px 9px; border-bottom: 1px solid #f0eae4; background: #fffaf7; }
.rs-title { font-size: 14px; font-weight: 700; color: var(--text); word-break: break-word; }
.rs-sub { margin-top: 3px; font-size: 12px; color: var(--muted); }

/* 横向滚动容器。表格给一个 min-width，列才有地方站；容器自己不撑破气泡。 */
.rs-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.rs-table { width: 100%; min-width: 640px; border-collapse: collapse; font-size: 13px; }
.rs-table th, .rs-table td {
  text-align: left; padding: 8px 10px; border-bottom: 1px solid #f0eae4;
  vertical-align: top;
}
.rs-table th {
  font-weight: 600; color: #6d665f; white-space: nowrap;
  background: #fcfaf8; position: sticky; top: 0;
}
/* 价格是这张表的主角：加粗 + 品牌深色，先看到钱。 */
.rs-table .rs-price { color: var(--brand-dark, #a83f1b); font-weight: 700; white-space: nowrap; }
.rs-src { max-width: 220px; }
.rs-src > a {
  display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; vertical-align: top;
  color: var(--brand, #c94e22); text-decoration: none;
}
.rs-src > a:hover { text-decoration: underline; }
.rs-quote { margin-top: 4px; font-size: 12px; color: var(--muted); }
.rs-quote > summary { cursor: pointer; }
.rs-quote > div {
  margin-top: 4px; color: var(--text); line-height: 1.5; white-space: pre-wrap;
  max-height: 120px; overflow: auto;
}

.rs-empty, .rs-err { padding: 12px; font-size: 13px; color: var(--muted); line-height: 1.6; }
.rs-err { color: var(--brand-dark, #a83f1b); }
.rs-miss {
  padding: 8px 12px; border-top: 1px solid #f0eae4;
  font-size: 12px; color: var(--muted);
}
.rs-miss > summary { cursor: pointer; color: var(--brand, #c94e22); }
.rs-miss ul { margin: 6px 0 0; padding-left: 18px; line-height: 1.6; }
.rs-foot { padding: 10px 12px; text-align: right; border-top: 1px solid #f0eae4; }
.rs-foot .btn-copy { margin-top: 0; }
