/* 房源任务助手 · 全局样式（移动端优先） */
:root {
  --bg: #f4f6f9;
  --card: #ffffff;
  --ink: #1f2937;
  --muted: #6b7280;
  --line: #e5e7eb;
  --brand: #2563eb;
  --brand-dark: #1d4ed8;
  --ok: #059669;
  --warn: #b45309;
  --err: #dc2626;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.page { max-width: 560px; margin: 0 auto; padding: 14px 14px 40px; }

.header { padding: 10px 4px 14px; }
.header h1 { font-size: 20px; font-weight: 700; }
/* b228：顶部只留异常提示行（身份信息已移入「我的」），空时整块隐藏 */
.header .sub { font-size: 12px; color: var(--muted); }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 12px;
}
.card h2 { font-size: 16px; margin-bottom: 10px; }

.field { margin-bottom: 10px; }
.field label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.field input, .field select, .field textarea,
.cascade-box input[type="search"] {
  width: 100%; padding: 10px 12px; font-size: 15px;
  border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink);
  outline: none;
}
.field input:focus, .field select:focus, .cascade-box input[type="search"]:focus { border-color: var(--brand); }
.cascade-box input[type="search"] { margin: 2px 0 8px; }
.cascade-box select:disabled { color: var(--muted); background: #f9fafb; }

/* 楼盘授权列表行（b200h-2）：楼盘名 + 勾租/售，双推已授权的盘隐藏 */
.blk-tag { font-style: normal; font-size: 11px; color: #64748b; margin-left: 5px;
  border: 1px solid #d1d5db; border-radius: 6px; padding: 0 4px; white-space: nowrap; }
.comm-list { max-height: 280px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.comm-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border-bottom: 1px solid #f1f5f9; }
.comm-row:last-child { border-bottom: none; }
.comm-row.disabled .comm-name { color: #9ca3af; }
.comm-name { font-size: 13px; }
.dim-box { display: flex; gap: 12px; flex: none; }
.dim { font-size: 13px; color: var(--ink); display: inline-flex; align-items: center; gap: 3px; user-select: none; cursor: pointer; }
.dim input { accent-color: var(--brand); width: 15px; height: 15px; }
.row2 { display: flex; gap: 10px; }
.row2 .field { flex: 1; }

.btn {
  display: inline-block; width: 100%; padding: 11px 16px;
  background: var(--brand); color: #fff; border: none; border-radius: 8px;
  font-size: 15px; font-weight: 600; cursor: pointer; text-align: center;
}
.btn:active { background: var(--brand-dark); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-plain { background: #eef2ff; color: var(--brand); }
.btn-ok { background: var(--ok); }
.btn-warn { background: #fff7ed; color: var(--warn); border: 1px solid #fed7aa; }
.btn-sm { width: auto; padding: 7px 14px; font-size: 13px; }

.msg { display: none; padding: 9px 12px; border-radius: 8px; font-size: 13px; margin: 10px 0; }
.msg-info { background: #eff6ff; color: var(--brand); }
.msg-ok { background: #ecfdf5; color: var(--ok); }
.msg-warn { background: #fffbeb; color: var(--warn); }
.msg-err { background: #fef2f2; color: var(--err); }

/* 任务卡片 */
.task-card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 13px; margin-bottom: 10px; }
.task-addr { font-size: 15px; font-weight: 700; }
.task-attr { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.chip { font-size: 12px; padding: 3px 9px; border-radius: 999px; background: #f1f5f9; color: #475569; }
.chip-brand { background: #eff6ff; color: var(--brand); }
.chip-price { background: #fff1f2; color: #be123c; }
.owner-line { margin-top: 7px; font-size: 13px; color: var(--ink); background: #f8fafc; border-radius: 8px; padding: 7px 10px; }
.task-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; }
.task-time { font-size: 12px; color: var(--muted); }

/* 标签页导航 */
.tabs { display: flex; gap: 6px; margin-bottom: 12px; position: sticky; top: 0; z-index: 5; background: var(--bg); padding: 6px 0; }
.tab {
  flex: 1; text-align: center; padding: 8px 4px; font-size: 13px; font-weight: 600;
  border-radius: 8px; color: var(--muted); cursor: pointer; border: 1px solid transparent;
  background: transparent; position: relative;
}
.tab.active { background: #fff; color: var(--brand); border-color: var(--line); }
.tab .badge {
  position: absolute; top: -2px; right: 8px; min-width: 16px; height: 16px;
  background: var(--err); color: #fff; font-size: 10px; line-height: 16px;
  border-radius: 999px; padding: 0 4px;
}

/* 级联选择 */
.cascade-box { border: 1px solid var(--line); border-radius: 8px; padding: 10px; max-height: 420px; overflow-y: auto; }
.cascade-box .lv-label { font-size: 12px; color: var(--muted); margin: 6px 0 4px; }

/* 弹窗 */
.modal-mask {
  display: none; position: fixed; inset: 0; background: rgba(15, 23, 42, .45);
  z-index: 50; align-items: flex-end; justify-content: center;
}
.modal-mask.show { display: flex; }
.modal {
  background: #fff; border-radius: 16px 16px 0 0; width: 100%; max-width: 560px;
  padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); max-height: 86vh; overflow-y: auto;
}
.modal h3 { font-size: 16px; margin-bottom: 12px; }

/* 列表行（后台） */
.row-item { border: 1px solid var(--line); border-radius: 10px; padding: 11px; margin-bottom: 9px; background: #fff; }
.row-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.row-title { font-size: 14px; font-weight: 700; }
.status-tag { font-size: 11px; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.st-pending { background: #fffbeb; color: var(--warn); }
.st-approved { background: #ecfdf5; color: var(--ok); }
.st-rejected { background: #fef2f2; color: var(--err); }
.st-open { background: #eff6ff; color: var(--brand); }
.st-muted { background: #f1f5f9; color: var(--muted); }
.row-meta { font-size: 12px; color: var(--muted); margin-top: 5px; }
.row-actions { display: flex; gap: 8px; margin-top: 9px; }

/* 评论区 */
.comment-box { margin-top: 10px; border-top: 1px dashed var(--line); padding-top: 9px; }
.comment-item { font-size: 13px; padding: 6px 0; border-bottom: 1px dashed #f1f5f9; }
.comment-item:last-child { border-bottom: none; }
.comment-item .who { font-weight: 700; margin-right: 6px; }
.comment-item.who-admin .who { color: var(--brand); }
.comment-item.who-staff .who { color: var(--ok); }
.comment-item .when { color: var(--muted); font-size: 11px; margin-left: 6px; }

/* 空态与水印 */
.empty { text-align: center; color: var(--muted); font-size: 13px; padding: 30px 0; }
.ver { text-align: center; font-size: 11px; color: #cbd5e1; margin-top: 22px; }
.ver a { color: #94a3b8; text-decoration: underline; }

/* 群聊 · 微信风格气泡（公共尺寸在这，消息页配色在 #pane-msg 段覆盖） */
.chat-img { margin-top: 6px; }
.chat-img img { max-width: 180px; max-height: 180px; border-radius: 8px; border: 1px solid var(--line); display: block; }
.chat-line.me .chat-img img { margin-left: auto; }

/* 任务详情页（b200g） */
.dt-sec { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line); }
.dt-sec h4 { font-size: 13px; color: var(--brand); margin: 0 0 6px; }
.dt-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; font-size: 14px; }
.dt-grid .lbl { color: var(--muted); font-size: 12px; margin-right: 4px; }
.dt-copy { display: inline-block; margin-left: 6px; font-size: 12px; color: var(--brand); background: #eef2ff; border-radius: 6px; padding: 1px 8px; cursor: pointer; user-select: none; }
.dt-copy:active { background: var(--brand); color: #fff; }
/* 相似房源用真表格：表头与数据列天然对齐（b200h-4）；
   b200n-2 手机端不再折行：单元格禁换行，超宽整表横向滑动 */
.sim-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* 已确认同一套横幅（b200p 批次二）：相似 → 同一套，替代确认按钮 */
.sim-linked {
  margin: 6px 0 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #047857;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.sim-linked b { word-break: break-all; }
tr.sim-hit { background: #f0fdf4; }
table.sim-table { width: 100%; min-width: 340px; border-collapse: collapse; font-size: 12.5px; }
.sim-table th { text-align: left; font-weight: 400; font-size: 11.5px; color: var(--muted); padding: 4px 4px 4px 0; border-bottom: 1px solid var(--line); white-space: nowrap; }
.sim-table td { padding: 6px 4px 6px 0; border-bottom: 1px dashed #f1f5f9; white-space: nowrap; }
.sim-table td.sim-id { font-variant-numeric: tabular-nums; }
.sim-table tr:last-child td { border-bottom: none; }
.sim-table td.sim-ops { white-space: nowrap; text-align: right; }
.sim-table .dt-copy { margin-left: 0; margin-right: 4px; }
/* 电话查询/参考信息共用行（b200h-4）：两区行样式一致 */
.pq-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; font-size: 13.5px; padding: 6px 0; border-bottom: 1px dashed #f1f5f9; }
.pq-row:last-child { border-bottom: none; }
.pq-row .lbl { color: var(--muted); font-size: 12px; }
/* 必填红星 */
.req-star { color: var(--err); margin-left: 2px; font-weight: 700; }
.feat-tog { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); cursor: pointer; }

/* 任务详情全屏页（b200h）：替代弹窗，详情+跟进表单合一 */
.dt-view { display: none; position: fixed; inset: 0; background: var(--bg); z-index: 60; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.dt-view.show { display: block; }
.dt-topbar { position: sticky; top: 0; z-index: 5; background: var(--bg); display: flex; align-items: center; gap: 8px; padding: 10px 0; }
.dt-pos { font-size: 12px; color: var(--muted); white-space: nowrap; }
.btn-row2 { display: flex; gap: 10px; margin-top: 4px; }
.btn-row2 .btn { flex: 1; }
.field textarea { resize: vertical; font-family: inherit; }

/* 我留的跟进历史 */
.note-hist { font-size: 13px; padding: 6px 0; border-bottom: 1px dashed #f1f5f9; color: var(--ink); word-break: break-word; }
.note-hist:last-child { border-bottom: none; }
.note-hist .when { color: var(--muted); font-size: 11px; margin-left: 6px; white-space: nowrap; }

/* ---------- 会话列表（微信式） ---------- */

/* ======================================================================
   b227 · 微信风格改版：底部四 Tab（首页 / 房源 / 消息 / 我的）
   配色沿用微信：主绿 #07c160、自己气泡 #95ec69、聊天底 #ededed
   ====================================================================== */
:root {
  --wx-green: #07c160;
  --wx-green-dark: #06ad56;
  --wx-bubble-me: #95ec69;
  --wx-bubble-you: #ffffff;   /* 对方气泡（原先未定义 → 背景透明，气泡没有底色） */
  --wx-chat-bg: #ededed;
  --wx-line: #e6e6e6;
  --wx-gray: #9ca3af;
}

/* 页面给固定底栏让位（含 iPhone 安全区） */
.page { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
.pane { animation: paneIn .12s ease-out; }
@keyframes paneIn { from { opacity: .6 } to { opacity: 1 } }

/* ---------- 底部导航 ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: flex; background: #f7f7f7; border-top: 1px solid #dcdcdc;
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar-item {
  flex: 1; background: none; border: none; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; padding: 7px 0 6px; font-size: 11px; color: #7a7e83;
  font-family: inherit; position: relative;
}
.tabbar-item svg { width: 24px; height: 24px; fill: none; stroke: currentColor;
  stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.tabbar-item.active { color: var(--wx-green); }
.tabbar-dot {
  position: absolute; top: 3px; left: 50%; margin-left: 4px;
  min-width: 17px; height: 17px; line-height: 17px; padding: 0 4px;
  background: #fa5151; color: #fff; font-size: 11px; font-style: normal;
  border-radius: 999px; text-align: center;
}

/* ---------- 分段（房源页 待办 / 我的提交） ---------- */
.segbar { display: flex; gap: 8px; margin: 2px 0 12px; }
.seg {
  flex: 1; padding: 9px 6px; font-size: 14px; font-weight: 600; font-family: inherit;
  color: #4b5563; background: #fff; border: 1px solid var(--wx-line);
  border-radius: 10px; cursor: pointer; position: relative;
}
.seg.active { color: var(--wx-green); border-color: #b7ebc9; background: #f2fdf6; }
/* b261：顶部 5 个 tab（待办/录入/已有/无效/无电话）——手机宽度下要缩字号与内边距，
   否则「无电话」三个字会换行。 */
.segbar-5 { gap: 5px; }
.segbar-5 .seg { padding: 8px 2px; font-size: 12.5px; border-radius: 8px; }
.seg-badge {
  position: absolute; top: -6px; right: 8px; min-width: 17px; height: 17px;
  line-height: 17px; padding: 0 4px; background: #fa5151; color: #fff;
  font-size: 11px; font-style: normal; border-radius: 999px; text-align: center;
}

/* ---------- 首页 ---------- */
.home-card {
  background: linear-gradient(135deg, #07c160 0%, #05a852 100%);
  color: #fff; border-radius: 14px; padding: 18px 16px 16px;
}
.home-hello { font-size: 19px; font-weight: 700; }
.home-stat { display: flex; margin: 16px 0 4px; }
.home-stat .hs { flex: 1; text-align: center; }
.home-stat .hs b { display: block; font-size: 22px; font-weight: 700; line-height: 1.2; }
.home-stat .hs span { font-size: 11.5px; opacity: .85; }
.home-cta {
  width: 100%; margin-top: 14px; padding: 10px;
  background: rgba(255,255,255,.92); color: #059048;
  border: none; border-radius: 10px; font-size: 15px; font-weight: 700;
  font-family: inherit; cursor: pointer;
}

/* ---------- 单元格列表（首页/我的） ---------- */
.cell-group { background: #fff; border-radius: 12px; margin-top: 12px; overflow: hidden; }
.cell {
  display: flex; align-items: center; gap: 8px; padding: 14px 14px;
  border-bottom: 1px solid #f2f2f2; font-size: 15px; cursor: pointer;
}
.cell:last-child { border-bottom: none; }
.cell:active { background: #fafafa; }
.cell-t { flex: 1; color: var(--ink); }
.cell.danger .cell-t { color: #fa5151; text-align: center; }
.cell-v { font-size: 13px; color: var(--wx-gray); }
.cell-arw { color: #c7c7cc; font-style: normal; font-size: 16px; }

/* ---------- 我的 ---------- */
.me-head { display: flex; align-items: center; gap: 12px; padding: 8px 4px 4px; }
.me-avatar {
  width: 52px; height: 52px; border-radius: 10px; background: var(--wx-green);
  color: #fff; font-size: 22px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
}
.me-idbox { min-width: 0; }
.me-name { font-size: 18px; font-weight: 700; }
.me-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }

/* ---------- 我的 · 功能宫格（b236，docs/43 §7.1） ----------
   按等级动态渲染：越权项**不渲染**（非置灰）。宫格末行用 flex 居中，
   避免 5 项时出现 4+1 左对齐留白。 */
.hub-sec { background: #fff; border-radius: 12px; margin-top: 12px; padding: 14px 6px 10px; }
.hub-h { display: flex; align-items: baseline; justify-content: space-between; padding: 0 8px 10px; }
.hub-h b { font-size: 13px; font-weight: 500; color: #475569; }
.hub-h span { font-size: 11px; color: #94a3b8; }
.hub-grid { display: flex; flex-wrap: wrap; justify-content: flex-start; }
.hub-item {
  flex: 0 0 25%; display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 6px 0; color: var(--ink); cursor: pointer; position: relative;
}
.hub-item:active .hub-ico { transform: scale(.94); }
.hub-ico {
  width: 44px; height: 44px; border-radius: 13px; background: #eff6ff;
  display: flex; align-items: center; justify-content: center; transition: transform .12s;
}
.hub-ico svg {
  width: 22px; height: 22px; stroke: var(--brand); fill: none; stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round;
}
.hub-t { font-size: 12px; line-height: 1.2; text-align: center; }
.hub-item.admin .hub-ico { background: #f1f5f9; }
.hub-item.admin .hub-ico svg { stroke: #334155; }
.hub-dot {
  position: absolute; top: 2px; left: 50%; margin-left: 10px; min-width: 16px; height: 16px;
  border-radius: 999px; background: #fa5151; color: #fff; font-size: 10px;
  line-height: 16px; text-align: center; padding: 0 4px;
}

/* 轻提示（b236） */
.htc-toast {
  position: fixed; left: 50%; bottom: 96px; transform: translate(-50%, 8px);
  max-width: 76vw; padding: 10px 16px; border-radius: 10px;
  background: rgba(17, 24, 39, .88); color: #fff; font-size: 13.5px; line-height: 1.4;
  text-align: center; opacity: 0; pointer-events: none; transition: opacity .18s, transform .18s;
  z-index: 9999;
}
.htc-toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 聊天气泡头像 ---------- */
.wx-av {
  width: 42px; height: 42px; border-radius: 9px; flex: none;
  color: #fff; font-size: 18px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
}

/* ---------- 消息页（b234：顶部三 Tab + 消息流 + 输入栏，不再是会话列表） ----------
   固定占满视口并给底部导航让位；display 由 switchPane 设为 flex。 */
#pane-msg {
  position: fixed; inset: 0; z-index: 30;
  max-width: 560px; margin: 0 auto;
  flex-direction: column;
  padding-bottom: calc(55px + env(safe-area-inset-bottom));
  background: var(--wx-chat-bg);
}
/* b242：顶部三 Tab 换成会话列表（管理员要服务所有员工，Tab 会无限增长没法看） */
.conv-head {
  flex: none; display: flex; align-items: center; gap: 6px;
  padding: calc(8px + env(safe-area-inset-top)) 10px 8px;
  background: #f7f7f7; border-bottom: 1px solid #dcdcdc;
}
.conv-head-title {
  flex: 1; min-width: 0; font-size: 16px; font-weight: 600; color: #111;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.conv-back {
  flex: none; width: 30px; height: 30px; padding: 0 0 4px; border: none;
  background: transparent; color: #111; font-size: 24px; line-height: 1;
  font-family: inherit; cursor: pointer;
}
.conv-sync {
  flex: none; width: 30px; height: 30px; padding: 0; border: none;
  background: transparent; color: #7b7b7b; font-size: 17px; line-height: 1;
  font-family: inherit; cursor: pointer;
}
.conv-searchbox { flex: none; padding: 8px 10px; background: #f7f7f7; }
.conv-searchbox input {
  width: 100%; box-sizing: border-box; padding: 7px 12px; border: none;
  border-radius: 8px; background: #ececec; color: #111; font-size: 14px;
  font-family: inherit; outline: none; -webkit-appearance: none;
}
.conv-list { flex: 1; overflow-y: auto; background: #fff; -webkit-overflow-scrolling: touch; }
.conv-row {
  display: flex; align-items: center; gap: 10px; width: 100%; box-sizing: border-box;
  padding: 11px 12px; border: none; border-bottom: 1px solid #f0f0f0;
  background: #fff; text-align: left; font-family: inherit; cursor: pointer;
}
.conv-row:active { background: #f2f2f2; }
.conv-main { flex: 1; min-width: 0; }
.conv-top { display: flex; align-items: baseline; gap: 8px; }
.conv-name {
  flex: 1; min-width: 0; font-size: 15px; color: #111;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.conv-time { flex: none; font-size: 11px; color: #a0a0a0; }
.conv-sub {
  margin-top: 3px; font-size: 13px; color: #9b9b9b;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.conv-badge {
  flex: none; min-width: 18px; height: 18px; line-height: 18px; padding: 0 5px;
  background: #fa5151; color: #fff; font-size: 11px; font-style: normal;
  border-radius: 999px; text-align: center;
}
.conv-tag {
  display: inline-block; margin-left: 5px; padding: 0 5px; border-radius: 4px;
  background: #eef1f5; color: #6b7280; font-size: 10.5px; line-height: 15px;
  vertical-align: 1px; font-weight: 400;
}
.conv-empty { text-align: center; color: #9b9b9b; font-size: 13px; padding: 44px 18px; line-height: 1.9; }
#pane-msg .chat-scroll { flex: 1; overflow-y: auto; padding: 12px 12px 16px;
  background: var(--wx-chat-bg); -webkit-overflow-scrolling: touch; }
#pane-msg .chat-line { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 14px; }
#pane-msg .chat-line.me { justify-content: flex-end; }
#pane-msg .chat-col { max-width: 72%; }
#pane-msg .chat-meta { font-size: 11px; color: #8b8b8b; margin-bottom: 4px; }
/* b237：管理员身份标签——消息写入时管理员也是 'agent'，身份靠读侧权限判定 */
#pane-msg .chat-role {
  display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 4px;
  background: #e7f8ee; color: #0f7b4f; font-size: 10.5px; font-style: normal;
  line-height: 16px; vertical-align: 1px;
}
#pane-msg .chat-bubble {
  position: relative;
  padding: 9px 12px; border-radius: 6px; background: var(--wx-bubble-you);
  border: none; font-size: 15px; line-height: 1.5; color: #111;
  white-space: pre-wrap; word-break: break-word;
  box-shadow: 0 1px 1px rgba(0,0,0,.03);
}
#pane-msg .chat-line.me .chat-bubble { background: var(--wx-bubble-me); color: #111; }
#pane-msg .chat-line.me .chat-col { align-items: flex-end; display: flex; flex-direction: column; }
.chat-time { text-align: center; font-size: 11px; color: #9b9b9b; margin: 4px 0 12px; }
.chat-empty { text-align: center; color: #9b9b9b; font-size: 13px; padding-top: 90px; line-height: 1.9; }
#pane-msg .chat-ref {
  display: inline-block; margin-top: 6px; font-size: 12px;
  color: #576b95; background: #fff; border: 1px solid #e2e5ea;
  border-radius: 4px; padding: 3px 8px; cursor: pointer;
}
#pane-msg .chat-img img { max-width: 160px; border-radius: 6px; margin-top: 4px; }
#pane-msg .msg { margin: 0 10px; }
.chat-inputbar {
  flex: none; display: flex; align-items: flex-end; gap: 8px; padding: 8px 10px;
  background: #f7f7f7; border-top: 1px solid #dcdcdc;
}
.chat-plus {
  flex: none; width: 34px; height: 34px; padding: 0; border-radius: 50%;
  border: 1.6px solid #7b7b7b; background: transparent; color: #7b7b7b;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  font-family: inherit; -webkit-tap-highlight-color: transparent;
}
.chat-plus:active { background: #e9e9e9; }
.chat-plus svg { width: 20px; height: 20px; fill: none; stroke: currentColor;
  stroke-width: 1.9; stroke-linecap: round; }
.chat-inputbar textarea {
  flex: 1; min-height: 36px; max-height: 100px; padding: 8px 10px;
  border: 1px solid #dcdcdc; border-radius: 6px; background: #fff;
  font-size: 15px; font-family: inherit; resize: none; color: #111; outline: none;
}
.chat-send {
  flex: none; padding: 9px 14px; border: none; border-radius: 6px;
  background: var(--wx-green); color: #fff; font-size: 14px; font-weight: 600;
  font-family: inherit; cursor: pointer;
}
.chat-send:disabled { background: #d0d0d0; }

/* ---------- 权限申请子页 ---------- */
.subpage {
  display: none; position: fixed; inset: 0; z-index: 65;
  background: var(--bg); overflow-y: auto; -webkit-overflow-scrolling: touch;
}
.subpage.show { display: block; }
.subpage .page { padding-bottom: 30px; }

/* 气泡小尖角：向左（对方）/ 向右（自己），微信观感 */
#pane-msg .chat-bubble::after {
  content: ''; position: absolute; top: 13px; left: -5px;
  width: 0; height: 0; border: 5px solid transparent;
  border-left: 0; border-right-color: #fff;
}
#pane-msg .chat-line.me .chat-bubble::after {
  left: auto; right: -5px;
  border-left: 5px solid var(--wx-bubble-me); border-right: 0;
  border-top-color: transparent; border-bottom-color: transparent;
}

/* ---------- 页面内确认弹窗（b242）：替代 window.confirm ----------
   安卓壳 1.2.4 的 WebChromeClient 没实现 onJsConfirm，confirm() 恒 false，只能自己画。 */
.dlg-mask {
  position: fixed; inset: 0; z-index: 9998; padding: 24px;
  background: rgba(0, 0, 0, .45);
  display: flex; align-items: center; justify-content: center;
}
.dlg-card {
  width: 100%; max-width: 330px; background: #fff; border-radius: 14px;
  padding: 18px 16px 12px; box-shadow: 0 12px 32px rgba(0, 0, 0, .22);
}
.dlg-txt {
  font-size: 14px; line-height: 1.75; color: #1f2937;
  white-space: pre-line; max-height: 46vh; overflow-y: auto;
}
.dlg-btns { display: flex; gap: 10px; margin-top: 16px; }
.dlg-btns button {
  flex: 1; padding: 10px 0; border: none; border-radius: 10px;
  font-size: 15px; font-family: inherit; cursor: pointer;
}
.dlg-no { background: #f1f3f5; color: #374151; }
.dlg-yes { background: var(--wx-green, #07c160); color: #fff; font-weight: 600; }
