/* 净界 · H5 版样式
 * 移动优先；桌面端把整块应用收窄居中，保持"作业 App"的操作密度。 */

:root {
  --green: #2e7d32;
  --green-d: #1b5e20;
  --green-l: #e8f5e9;
  --blue: #1565c0;
  --orange: #ef6c00;
  --purple: #6a1b9a;
  --red: #d32f2f;
  --ink: #25303b;
  --muted: #7f8c8d;
  --line: #e4e9ee;
  --bg: #f5f6fa;
  --card: #ffffff;
  --radius: 14px;
  --topbar-h: 52px;
  --tabbar-h: 58px;
  --maxw: 680px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}

h1, h2, h3, h4, p { margin: 0; }
button { font-family: inherit; font-size: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 15px; color: var(--ink); }
a { color: var(--green); text-decoration: none; }

.is-hidden { display: none !important; }
.muted { color: var(--muted); font-size: 13px; }
.req { color: var(--red); font-style: normal; }

/* ---------------- 顶栏 ---------------- */

.topbar {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--maxw);
  height: calc(var(--topbar-h) + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 8px 0;
  display: flex;
  align-items: center;
  gap: 4px;
  background: linear-gradient(135deg, var(--green-d), #388e3c);
  color: #fff;
  z-index: 60;
  box-shadow: 0 1px 6px rgba(0, 0, 0, .12);
}

.topbar-btn {
  width: 38px; height: 38px;
  border: none; background: transparent; color: #fff;
  font-size: 26px; line-height: 1;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  padding-bottom: 2px;
}
.topbar-btn:active { background: rgba(255, 255, 255, .18); }
.topbar-title { flex: 1; font-size: 17px; font-weight: 600; text-align: center; }
.topbar-title:only-child { text-align: left; padding-left: 12px; }
.topbar-space { width: 8px; }

/* ---------------- 内容区 ---------------- */

.view {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: calc(var(--topbar-h) + env(safe-area-inset-top) + 14px) 14px 34px;
  min-height: 100vh;
}
body.has-tabbar .view { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 26px); }

/* ---------------- 底部导航 ---------------- */

.tabbar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--maxw);
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  display: flex;
  background: #fff;
  border-top: 1px solid var(--line);
  z-index: 60;
}
.tabbar-item {
  flex: 1;
  border: none;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--muted);
  padding: 6px 0;
}
.tabbar-item.is-active { color: var(--green); }
.tabbar-icon { font-size: 19px; line-height: 1.1; }
.tabbar-label { font-size: 11px; }
/* 键盘弹出时临时收起底栏（见 app.js bindKeyboardTabbar）：
 * 只隐藏视觉，不改 .view 的 padding-bottom —— 打字过程中页面不留白跳动。 */
body.kb-open .tabbar { display: none !important; }

/* ---------------- 通用块 ---------------- */

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: 0 2px 10px rgba(23, 43, 77, .05);
}
.card-title { font-size: 15.5px; font-weight: 600; margin-bottom: 10px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.card-head h3 { font-size: 17px; font-weight: 600; }
/* 卡片内横向按钮组（存证台账用）：窄屏自动换行，不等宽，避免长文案被截断 */
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.btn-row .btn { flex: 1 1 auto; min-width: 104px; }
/* 已撤销的存证整卡降饱和：一眼可与有效记录区分，不必逐字去读状态标签 */
.muted-card { opacity: .62; }

.section { margin-bottom: 16px; }
.section-title { font-size: 15px; font-weight: 600; color: var(--green-d); }
.section-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; margin: 18px 2px 10px;
}

.kv { display: flex; gap: 10px; padding: 5px 0; border-bottom: 1px dashed #eef1f4; }
.kv:last-child { border-bottom: none; }
.kv > span { color: var(--muted); font-size: 13.5px; flex: 0 0 78px; }
.kv > b { font-weight: 600; flex: 1; word-break: break-word; }

/* ---------------- 按钮 ---------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: 11px;
  padding: 11px 16px;
  font-size: 15px;
  font-weight: 600;
  background: #eef1f4;
  color: var(--ink);
  transition: filter .15s ease;
}
.btn:active { filter: brightness(.94); }
.btn:disabled { opacity: .55; }
.btn-primary { background: var(--green); color: #fff; }
.btn-outline { background: #fff; color: var(--green); border-color: #b7d7b9; }
.btn-ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-danger { background: #fff; color: var(--red); border-color: #f0c4c4; }
.btn-block { display: flex; width: 100%; margin-top: 10px; }
.btn-sm { padding: 7px 12px; font-size: 13.5px; border-radius: 9px; }
.link { background: none; border: none; color: var(--green); font-size: 13.5px; padding: 4px; }
/* 字段下方的小操作行：如「新建合同」页就地建档入口 */
.field-aux { margin: -6px 0 10px; }
.field-aux .link { padding: 2px 4px; font-size: 13px; }
.link-danger { background: none; border: none; color: var(--red); font-size: 13px; padding: 2px 4px; }

/* 提示条：用于「客户下拉」下的常态服务提示、无客户档案引导、字典未收录提醒等 */
.hint-card {
  margin-top: 8px; padding: 9px 11px; border-radius: 10px;
  background: var(--green-l); border: 1px solid #cfe8d2;
  font-size: 12.5px; color: #3c5a41; line-height: 1.75;
}
.hint-card b { color: var(--green-d); }
.hint-card.is-warn { background: #fff5e6; border-color: #ffe0b2; color: #8a5a00; }
.hint-card.is-warn b { color: #8a5a00; }
.link-btn {
  background: none; border: none; padding: 0 3px;
  color: var(--green-d); font-size: 12.5px; font-weight: 700;
  text-decoration: underline;
}

.form-actions { margin-top: 6px; }
.sticky-actions { margin-top: 16px; }

/* ---------------- 表单 ---------------- */

.field { display: block; margin-bottom: 13px; }
.field .lbl { display: block; font-size: 13px; color: #55636e; margin-bottom: 5px; }
.field input, .field select, .field textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: #fbfcfd;
  border-radius: 11px;
  padding: 11px 12px;
  outline: none;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: #8bc48e;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(46, 125, 50, .1);
}
.field textarea { resize: vertical; }
/* 只读字段（如服务热线自动取公司电话）：底色压暗，提示「这里是带出来的，不用填」 */
.field input[readonly] { background: #f0f2f5; color: #55636e; }
.field-row { display: flex; gap: 8px; }
.field-row input { flex: 1; }
.field-row .btn { flex: 0 0 auto; white-space: nowrap; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.hint { font-size: 12.5px; color: var(--muted); margin-top: 8px; min-height: 16px; }
/* 手机号输入错误提示（登录 / 注册）：平时不占高度，格式不对才出现 */
.phone-err { display: none; margin: 5px 0 0; font-size: 12.5px; line-height: 1.5; color: var(--red); }
.phone-err.is-on { display: block; }

/* ---------------- 工具条 / 筛选 ---------------- */

.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; }
.search {
  flex: 1;
  /* 输入框的默认最小宽度约 200px，窄屏（360/375）会把同一行的按钮顶出屏幕，
   * 导致「新增」看不见、页面横向溢出。允许它被压缩，按钮保持自身宽度。 */
  min-width: 0;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 11px;
  padding: 10px 12px;
  outline: none;
}
/* 工具条里的按钮按内容定宽、不参与挤压，文字不折行（否则会被压成竖排）。 */
.toolbar > .btn { flex: 0 0 auto; white-space: nowrap; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0; flex: 1; }
/* 多选标签组（施工报告：防治对象 / 施工器械）：可换行、不横向滚动、不参与 flex 挤压 */
.chips-multi { flex: none; flex-wrap: wrap; overflow: visible; }
.chip {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  background: #fff;
  color: #55636e;
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 13.5px;
  white-space: nowrap;
}
.chip.is-active { background: var(--green); border-color: var(--green); color: #fff; font-weight: 600; }
/* 区域名称选「其他（手动填写）」时出现的手填框 */
.area-custom { margin-top: 8px; }
/* 「更多 / 收起」：虚线描边与可勾选标签区分开 */
.chip-toggle { border-style: dashed; color: var(--green-d); }
/* 收起态只藏「非常用」项；已选项永远不会被藏（生成时若收起区有选中项会自动展开） */
[data-chips].is-collapsed .chip.is-extra { display: none; }

/* ---------------- 三步向导（施工报告现场出单） ----------------
 * 步骤条常驻顶部：现场最怕「填了一半不知道还剩几步」。
 * 每屏只回答一个问题，最后一步才出现「生成」。 */

.wizard-steps { display: flex; gap: 6px; margin-bottom: 12px; }
.wizard-step {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 4px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}
.wizard-step b {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 20px;
  text-align: center;
}
.wizard-step.is-current {
  border-color: #8bc48e;
  color: var(--green-d);
  font-weight: 600;
  box-shadow: 0 0 0 3px rgba(46, 125, 50, .08);
}
.wizard-step.is-current b { background: var(--green); color: #fff; }
.wizard-step.is-done { color: var(--green-d); }
.wizard-step.is-done b { background: var(--green-l); color: var(--green-d); }

.wizard-pane { display: none; }
.wizard-pane.is-current { display: block; }

/* 底部动作条：上一步 / 下一步 / 生成 并排等宽。
 * hidden 属性必须显式藏起来 —— .btn 的 display:inline-flex 会盖掉浏览器对 [hidden] 的默认处理，
 * 否则前两步会同时出现「下一步」和「生成作业单」。 */
.wizard-actions { display: flex; gap: 8px; }
.wizard-actions .btn { flex: 1; }
.wizard-actions .btn[hidden] { display: none; }

/* 卡片内并排按钮的间距（药械记录区用） */
.gap-top { margin-top: 8px; }

/* ---------------- 列表 ---------------- */

.list { background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: 0 2px 10px rgba(23, 43, 77, .05); }
.list-plain { padding: 0; }
.row {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 10px;
  padding: 13px 14px;
  border: none;
  border-bottom: 1px solid #f0f3f6;
  background: #fff;
  text-align: left;
}
.row:last-child { border-bottom: none; }
.row:active { background: #f6faf6; }
.row-static { cursor: default; }
.row-main { flex: 1; min-width: 0; }
.row-title { font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.row-sub { font-size: 13px; color: var(--muted); margin-top: 3px; }
.row-sub2 { font-size: 12.5px; color: #9aa8b2; margin-top: 2px; word-break: break-all; }
.row-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.chev { color: #c3ccd4; font-size: 20px; line-height: 1; }

/* 客户列表：行内右侧「导航」按钮（一个客户一个）。
 * 行本身是「进详情」的按钮，导航按钮做成它的兄弟节点 —— 嵌套 <button> 既不合法，
 * 也会让「点导航」被行点击吞掉。390px 下按钮固定宽度、文字区 min-width:0 自适应，
 * 保证不横向溢出、按钮不换行错位。 */
.cust-row { display: flex; align-items: center; background: #fff; border-bottom: 1px solid #f0f3f6; }
.cust-row:last-child { border-bottom: none; }
.cust-row .row { flex: 1 1 auto; min-width: 0; border-bottom: none; padding-right: 4px; }
.row-nav { flex: 0 0 auto; padding: 0 12px 0 0; }
.nav-btn {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 7px 10px; border: 1px solid #bfe0c5; border-radius: 9px;
  background: #f2faf3; color: var(--green-d);
  font-size: 12.5px; font-weight: 600; line-height: 1.2; white-space: nowrap;
  cursor: pointer;
}
.nav-btn svg { width: 14px; height: 14px; flex: 0 0 auto; }
.nav-btn:active { filter: brightness(.95); }
.nav-btn.is-off { border-color: #e3e9ee; background: #f6f8fa; color: #9aa8b2; }

/* ---------------- 标签 / 状态 ---------------- */

.tag {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.7;
  color: #fff;
  white-space: nowrap;
}
.tag-green { background: #43a047; }
.tag-brown { background: #8d6e63; }
.tag-sky { background: #29b6f6; }
.tag-orange { background: #fb8c00; }
.tag-grey { background: #90a4ae; }

.pill {
  display: inline-block;
  padding: 1px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}
.pill-ok { background: #e8f5e9; color: #2e7d32; }
.pill-draft { background: #eceff1; color: #607d8b; }
.pill-bad { background: #ffebee; color: #c62828; }

.risk { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.risk-low { background: #e8f5e9; color: #2e7d32; }
.risk-mid { background: #fff8e1; color: #ef6c00; }
.risk-high { background: #ffebee; color: #c62828; }

/* ---------------- 首页 ---------------- */

.hero {
  background: linear-gradient(135deg, #1b5e20, #43a047);
  color: #fff;
  border-radius: var(--radius);
  padding: 20px 18px;
  margin-bottom: 14px;
}
.hero-hi { font-size: 13px; opacity: .85; }
.hero-mail { font-size: 19px; font-weight: 700; margin: 2px 0 8px; word-break: break-all; }
.hero-tip { font-size: 12.5px; opacity: .88; line-height: 1.6; }
/* 首页问候条压成一行（20261108）：姓名 + 今日待办 + 管理后台，
 * 高度从三行降到一行，把首屏空间让给常用功能。窄屏摘要超长截断。 */
.hero-line { display: flex; align-items: center; gap: 10px; padding: 12px 14px; }
.hero-line .hero-mail {
  margin: 0; font-size: 16px; flex: 0 0 auto; max-width: 55%;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; word-break: normal;
}
.hero-line .hero-tip {
  flex: 1 1 auto; min-width: 0; margin: 0; line-height: 1.4;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.hero-line .hero-admin { margin-top: 0; flex: 0 0 auto; }
/* 管理员首页直达后台的按钮：白描边胶囊，仅 org_manage 角色渲染（views.biz.js 首页） */
.hero-admin {
  margin-top: 10px; padding: 5px 12px; font-size: 12.5px; color: #fff;
  background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .55);
  border-radius: 999px; cursor: pointer;
}
.hero-admin:active { background: rgba(255, 255, 255, .28); }

.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 16px; }
.stat-row-tight { margin-bottom: 0; }
.stat {
  background: #fff;
  border-radius: 12px;
  padding: 12px 4px;
  text-align: center;
  box-shadow: 0 2px 10px rgba(23, 43, 77, .05);
}
.stat b { display: block; font-size: 20px; font-weight: 700; line-height: 1.3; }
.stat span { font-size: 11.5px; color: var(--muted); }

/* 首页「直达卡」：数量 + 最近一条真实内容，整卡可点 → 直达对应列表。
 * 卡片窄（手机上一行四张），预览行固定单行截断，绝不换行撑高整行。 */
.stat-link {
  position: relative;
  display: block;
  width: 100%;
  background: #fff;
  border: none;
  border-radius: 12px;
  padding: 12px 7px 10px;
  text-align: center;
  box-shadow: 0 2px 10px rgba(23, 43, 77, .05);
  overflow: hidden;
}
.stat-link:active { background: #f6faf6; }
.stat-link b { display: block; font-size: 20px; font-weight: 700; line-height: 1.25; }
.stat-link .sl-label { display: block; font-size: 11.5px; color: var(--muted); }
.stat-link .sl-prev {
  display: block;
  margin-top: 5px;
  font-style: normal;
  font-size: 10.5px;
  line-height: 1.35;
  color: #90a4ae;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stat-link .sl-chev {
  position: absolute;
  top: 6px;
  right: 7px;
  font-size: 12px;
  font-style: normal;
  line-height: 1;
  color: #c3ccd6;
}
.stat-link.is-locked { background: #fafbfc; box-shadow: none; border: 1px dashed #e6ebf0; }
.stat-link.is-locked b { color: #9aa5b1; }
.stat-link.is-locked .sl-prev { color: #b0bac4; }
.c-green { color: var(--green); }
.c-blue { color: var(--blue); }
.c-orange { color: var(--orange); }
.c-purple { color: var(--purple); }
.c-red { color: var(--red); }
.c-grey { color: #90a4ae; }

.entry-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.entry {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  background: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 15px 14px;
  text-align: left;
  box-shadow: 0 2px 10px rgba(23, 43, 77, .05);
}
.entry:active { background: #f6faf6; }
.entry-icon { font-size: 22px; margin-bottom: 6px; }
.entry-label { font-size: 15px; font-weight: 600; }
.entry-desc { font-size: 12px; color: var(--muted); }

/* 首页常用功能固定四项一排（20261108h）：窄屏也保持一行，不折行、
 * 不横向滚动；只留图标 + 短名，说明文字留给「更多」面板。 */
.entry-grid.is-row4 { grid-template-columns: repeat(4, 1fr); gap: 8px; }
.entry-grid.is-row4 .entry { align-items: center; text-align: center; padding: 12px 6px; }
.entry-grid.is-row4 .entry-icon { margin-bottom: 4px; font-size: 20px; }
.entry-grid.is-row4 .entry-label { font-size: 13px; white-space: nowrap; }
.entry-more .entry-icon { color: var(--muted); font-weight: 700; letter-spacing: 1px; }

/* 「更多」功能面板：两列瀑布，窄屏不横向滚动；超高时面板内部纵向滚动。 */
.more-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; max-height: 58vh; overflow-y: auto; }
.more-item {
  display: flex; align-items: center; gap: 10px;
  background: #f7f9fa; border: none; border-radius: 12px;
  padding: 12px 10px; text-align: left;
}
.more-item:active { background: #eef3f1; }
.more-item .entry-icon { font-size: 18px; margin: 0; }
.more-item.is-locked { background: #fafbfc; }
.mi-body { min-width: 0; flex: 1; }
.mi-label { display: block; font-size: 13.5px; font-weight: 600; }
.mi-desc {
  display: block; font-size: 11.5px; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ---------------- 区域明细 / 照片 ---------------- */

.item-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 12px;
  box-shadow: 0 2px 10px rgba(23, 43, 77, .05);
}
.item-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.item-no { font-size: 13.5px; font-weight: 700; color: var(--green); }
.item-tools { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }

/* 「施工作业区域」卡片内嵌的用药子块（药剂跟随区域，合并一块） */
.zone-chems {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #f7faf8;
  border: 1px solid var(--line);
}
.zone-chems-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; flex-wrap: wrap; margin-bottom: 10px;
}
.chem-quick {
  flex: 1 1 150px; min-width: 0;
  padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px;
  background: #fff; color: var(--text); font-size: 13.5px;
}
.chem-sub {
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  padding: 12px; margin-bottom: 10px;
}
.chem-sub-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; margin-bottom: 10px;
}

.photo-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.photo { position: relative; width: 76px; height: 76px; border-radius: 10px; overflow: hidden; background: #eceff1; display: block; }
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-del {
  position: absolute; top: 2px; right: 2px;
  width: 20px; height: 20px; border-radius: 50%;
  border: none; background: rgba(0, 0, 0, .58); color: #fff;
  font-size: 14px; line-height: 1; display: flex; align-items: center; justify-content: center;
}

.detail-item {
  background: #fff;
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 12px;
  box-shadow: 0 2px 10px rgba(23, 43, 77, .05);
}
.detail-item-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }

.alert { border-radius: 10px; padding: 10px 12px; font-size: 13px; margin-top: 10px; }
.alert-warn { background: #fff8e1; color: #8d6e00; border-left: 3px solid #fbc02d; }

/* ---------------- 报告 ---------------- */

.report-title { font-size: 17px; font-weight: 700; margin-bottom: 6px; }
.report-meta { font-size: 12.5px; color: var(--muted); margin-bottom: 10px; }
.report-body {
  white-space: pre-wrap;
  word-break: break-word;
  font-family: inherit;
  font-size: 13.8px;
  line-height: 1.85;
  color: #33414d;
  background: #fafbfa;
  border-radius: 10px;
  padding: 12px 13px;
  margin: 0 0 10px;
}
.report-plan { background: var(--green-l); }
.report-body:last-child { margin-bottom: 0; }

/* ---------------- 状态页 ---------------- */

.state { text-align: center; padding: 46px 18px; color: var(--muted); }
.state-icon { font-size: 34px; margin-bottom: 10px; }
.state-title { font-size: 15px; color: #55636e; font-weight: 600; }
.state-desc { font-size: 13px; margin-top: 6px; }
.spinner {
  width: 26px; height: 26px; margin: 0 auto 10px;
  border: 3px solid #dbe6dc; border-top-color: var(--green);
  border-radius: 50%; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------- 登录页 ---------------- */

.auth { max-width: 400px; margin: 0 auto; padding: 34px 4px 30px; }
.auth-brand { text-align: center; margin-bottom: 22px; }
/* 品牌标：图形由 P.LOGO.mark() 内联 SVG 提供，容器只管尺寸与投影。
   2026-10-12 之前这里是「绿底方块 + 消字」的占位符，现换成正式标（防区框 + 水滴）。 */
.auth-logo {
  width: 62px; height: 62px; margin: 0 auto 12px;
  display: flex; align-items: center; justify-content: center;
  filter: drop-shadow(0 6px 16px rgba(27, 94, 32, .28));
}
.auth-logo svg { display: block; width: 62px; height: 62px; }
.auth-brand h1 { font-size: 22px; font-weight: 700; letter-spacing: 1px; }
.auth-brand p { font-size: 13px; color: var(--muted); margin-top: 4px; }
.auth-brand .auth-slogan { font-size: 11.5px; color: var(--muted); opacity: .85; margin-top: 2px; }
.tabs { display: flex; gap: 6px; margin-bottom: 12px; background: #eceff1; padding: 4px; border-radius: 12px; }
.tab {
  flex: 1; border: none; background: transparent; color: #607d8b;
  border-radius: 9px; padding: 9px 4px; font-size: 13.5px;
}
.tab.is-active { background: #fff; color: var(--green); font-weight: 700; box-shadow: 0 1px 4px rgba(0, 0, 0, .08); }
.auth-card { margin-bottom: 12px; }
.auth-foot { text-align: center; font-size: 12px; color: #9aa8b2; line-height: 1.7; padding: 0 10px; }

/* ---------------- 我的 ---------------- */

.profile-head { display: flex; align-items: center; gap: 14px; }
.avatar {
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--green-l); color: var(--green-d);
  font-size: 22px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.profile-mail { font-size: 16px; font-weight: 600; word-break: break-all; }

/* 平台运营方专属卡（20261013h）：管理入口原来混在普通列表里，跟「意见反馈」长得一样，
 * 管理员实测找不到。改为置顶 + 紫色标签 + 双列按钮，普通用户不渲染这一块。 */
.plat-card {
  border: 1.5px solid #e3d4f2;
  background: linear-gradient(180deg, #faf4ff 0%, #ffffff 62%);
}
.plat-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 11px; }
.plat-tag {
  font-size: 12px; font-weight: 600; color: #fff;
  background: var(--purple); padding: 3px 10px; border-radius: 999px;
}
.plat-tip { font-size: 12px; color: var(--muted); }
.plat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.plat-btn {
  display: flex; flex-direction: column; align-items: flex-start; gap: 3px;
  padding: 12px; font: inherit; text-align: left; cursor: pointer;
  background: #fff; border: 1.5px solid #e3d4f2; border-radius: 12px;
}
.plat-btn:active { background: #f7f0ff; }
.plat-name {
  display: flex; align-items: center; gap: 6px;
  font-size: 15px; font-weight: 600; color: var(--ink);
}
.plat-desc { font-size: 12px; color: var(--muted); }
/* 待处理条数角标：有未处理事项才出现，避免「0」看着像没东西可做 */
.plat-num {
  min-width: 18px; height: 18px; padding: 0 5px;
  font-size: 11.5px; font-style: normal; font-weight: 600; line-height: 18px;
  text-align: center; color: #fff; background: var(--red); border-radius: 999px;
}
/* 三个入口时，第三个独占一行 —— 两列网格里留一个空格子更难看 */
.plat-btn.is-wide { grid-column: 1 / -1; }

/* ---------------- 平台看板（20261013j） ----------------
 * 只给运营方看的一页，密度比业务页高：KPI 六宫格 + 分布条 + 组织改档 + 用户清单。 */
.pb-kpi { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.pb-kpi-i {
  padding: 11px 8px; text-align: center;
  background: #fbfcfe; border: 1px solid var(--line); border-radius: 11px;
}
.pb-kpi-i b { display: block; font-size: 20px; font-weight: 700; line-height: 1.25; color: var(--ink); }
.pb-kpi-i span { font-size: 11.5px; color: var(--muted); }
/* 可点指标卡：整格当按钮用，外观保持原宫格 */
.pb-kpi-i.is-link {
  width: 100%; font-family: inherit; color: inherit; cursor: pointer;
  -webkit-appearance: none; appearance: none;
}
.pb-kpi-i.is-link:active { background: #f4f0fa; }

/* 档位分布条：三段按家数占比铺开，一眼看出付费转化 */
.pb-bar {
  display: flex; height: 10px; margin-bottom: 12px;
  background: #eef1f5; border-radius: 999px; overflow: hidden;
}
.pb-bar-i { display: block; height: 100%; }
.pb-bar-i.is-free { background: #b0bec5; }
.pb-bar-i.is-pro { background: #43a047; }
.pb-bar-i.is-team { background: var(--purple); }

/* 待处理两个入口：数字放在右边，跟角标语义一致 */
.pb-jump { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pb-jump-btn {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 12px; font: inherit; cursor: pointer; text-align: left;
  background: #fff; border: 1px solid var(--line); border-radius: 11px; color: var(--ink);
}
.pb-jump-btn:active { background: #f6faf6; }
.pb-jump-btn b { font-size: 18px; color: var(--purple); }

/* 组织条目：每个组织一个可改档的块 */
.pb-org { padding: 12px 0; border-bottom: 1px solid var(--line); }
.pb-org:last-child { border-bottom: none; padding-bottom: 0; }
.pb-org-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pb-org-name { font-size: 15.5px; font-weight: 600; word-break: break-all; }
.pb-org-meta { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.pb-switch { display: flex; gap: 8px; margin-top: 9px; }
.pb-sw {
  flex: 1; padding: 8px 4px; font-size: 13.5px; text-align: center;
  color: var(--ink); background: #fff; cursor: pointer;
  border: 1.5px solid var(--line); border-radius: 9px;
}
.pb-sw:active { background: #f6faf6; }
/* 当前档位：实心且不可点 —— 它不是「可以再点一次」的开关 */
.pb-sw.is-on {
  color: var(--purple); border-color: #d9c2ee; background: #f7f0ff;
  font-weight: 600; cursor: default;
}

/* 管理动作：与「常用按钮」用虚线分隔，删除永远靠右，窄屏换行不挤在一起 */
.pb-admin-actions {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-top: 11px; padding-top: 10px; border-top: 1px dashed var(--line);
}
.pb-admin-btn { flex: 0 0 auto; }
.pb-danger { margin-left: auto; }
.pb-org.is-off { opacity: .78; }
.pb-off-meta { color: #e65100; }
.pill-warn { background: #fff3e0; color: #e65100; }
/* 无负责人组织：整块红色左边界 + 负责人行标红，看板一眼能扫出来 */
.pb-org.is-orphan {
  border-left: 3px solid #e53935; padding-left: 10px;
  background: #fffafa; border-radius: 4px;
}
.pb-owner-missing { color: #c62828; font-weight: 600; }
.pb-del-input {
  width: 100%; padding: 9px 12px; background: #fffafa;
  border: 1px solid #f0c4c4; border-radius: 10px; font: inherit;
}

.pb-user { padding: 11px 0; border-bottom: 1px solid var(--line); }
.pb-user:last-child { border-bottom: none; }
.pb-user.is-off { opacity: .82; }
.pb-user-actions { margin-top: 8px; padding-top: 8px; }

@media (max-width: 420px) {
  /* 极窄屏：删除独占一行，远离其它按钮，避免误触 */
  .pb-danger { margin-left: 0; }
  .pb-admin-actions { row-gap: 8px; }
}
.pb-search {
  width: 100%; padding: 9px 12px; margin-bottom: 6px;
  border: 1px solid var(--line); border-radius: 10px; background: #fbfcfe;
}

/* 指标卡明细弹层：占屏幕一半以内、内部滚动，手机上一列读完 */
.pb-detail { max-height: 56vh; overflow-y: auto; margin-top: 6px; }
.pb-detail-row { padding: 10px 0; border-bottom: 1px solid var(--line); }
.pb-detail-row:last-child { border-bottom: none; }
.pb-detail-tags { display: flex; gap: 6px; margin-top: 5px; flex-wrap: wrap; }

/* ---------------- 甲方门户 ---------------- */

.portal { max-width: 640px; margin: 0 auto; padding: 20px 14px 44px; }
.portal-head { text-align: center; margin-bottom: 18px; }
.portal-badge {
  display: inline-block; background: var(--green-l); color: var(--green-d);
  border-radius: 999px; padding: 3px 14px; font-size: 12px; font-weight: 600; margin-bottom: 10px;
}
.portal-head h1 { font-size: 20px; font-weight: 700; line-height: 1.45; }
.portal-sub { font-size: 13px; color: var(--muted); margin-top: 6px; }
.portal-foot {
  margin-top: 22px; padding-top: 14px; border-top: 1px dashed var(--line);
  text-align: center; font-size: 12px; color: #9aa8b2; line-height: 1.9;
}

/* ---------------- 提示 / 弹层 ---------------- */

.toast {
  position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%);
  background: rgba(30, 38, 46, .92); color: #fff;
  padding: 9px 18px; border-radius: 999px; font-size: 13.5px;
  z-index: 90; max-width: 86%; text-align: center;
}

/* 底部弹层必须压在交付件预览层（z-index 120）与全屏签名（140）之上：
 * 预览层点「导出」弹的就是这个 sheet，层级低了就整个藏在预览背后（点了像没反应）。 */
.sheet { position: fixed; inset: 0; z-index: 160; display: flex; align-items: flex-end; justify-content: center; }
.sheet-mask { position: absolute; inset: 0; background: rgba(0, 0, 0, .42); }
.sheet-body {
  position: relative;
  width: 100%; max-width: var(--maxw);
  background: #fff;
  border-radius: 18px 18px 0 0;
  padding: 20px 18px calc(18px + env(safe-area-inset-bottom));
  animation: sheet-in .2s ease;
}
@keyframes sheet-in { from { transform: translateY(18px); opacity: .6; } to { transform: none; opacity: 1; } }
.sheet-title { font-size: 16.5px; font-weight: 700; margin-bottom: 8px; }
.sheet-text { font-size: 13.8px; color: #55636e; line-height: 1.8; }
.sheet-actions { display: flex; gap: 10px; margin-top: 16px; }
.sheet-actions .btn { flex: 1; margin-top: 0; }
.share-input {
  width: 100%; margin-top: 10px;
  border: 1px solid var(--line); background: #f7f9fa;
  border-radius: 10px; padding: 10px 12px;
  font-size: 12.5px; color: #45535e;
}

/* ---------------- 桌面端微调 ---------------- */

@media (min-width: 700px) {
  body { font-size: 15.5px; }
  .view { padding-left: 18px; padding-right: 18px; }
  .entry-grid { grid-template-columns: repeat(4, 1fr); }
  .photo { width: 88px; height: 88px; }
}

/* ============================================================
   组织版 / 派工 / 合同 / 药剂 / 看板 / AI / 管理后台 新增样式
   ============================================================ */

/* ---------------- 补充色彩与标签变体 ---------------- */

.c-teal { color: #00838f; }
.c-brown { color: #5d4037; }
.c-indigo { color: #3949ab; }
.c-cyan { color: #0277bd; }

.tag-blue { background: #e3f2fd; color: #1565c0; }
.tag-red { background: #fdecea; color: #c62828; }

.pill-doing { background: #fff3e0; color: #e65100; }
.pill-wait { background: #e8eaf6; color: #3949ab; }

.alert-list { display: flex; flex-direction: column; gap: 8px; }
.alert-info { background: #eef4fb; color: #2c5b8a; }

/* ---------------- 通用小工具 ---------------- */

.grow { flex: 1; }
.grid-2.grid-gap { gap: 12px; margin-bottom: 12px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; line-height: 1.7; }
.plain-list { margin: 0; padding-left: 18px; font-size: 13.5px; color: #55636e; line-height: 1.9; }
.hash, .hash-line { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 11.5px; word-break: break-all; }
.hash-line { color: #6b7885; }
.ok-hint { color: #2e7d32; font-size: 13px; margin-top: 6px; }
.field-hint { display: block; margin-top: 5px; font-size: 12px; color: #8a97a3; }
.field-hint.is-ok { color: #2e7d32; }
.field-hint.is-warn { color: #e65100; }

/* 上门导航：唤起手机地图 App 的入口与选择列表（客户资料 / 点位弹层共用）。
 * 前缀用 navto- 而不是 nav-：后者早被底部/侧栏导航占用，复用会串样式。 */
.navto-actions { display: flex; gap: 8px; }
.navto-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.navto-item {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left;
  padding: 12px 14px; background: #f6f8f7; border: 1px solid var(--line);
  border-radius: 12px; font-size: 14.5px; color: inherit;
}
.navto-item b { font-weight: 600; }
.navto-item .navto-note { font-style: normal; font-size: 12px; color: #8a97a3; }
.navto-item .navto-go { margin-left: auto; font-style: normal; color: #8a97a3; }
/* 弹层顶部说明：解释「选一次就记住」的规则，避免用户以为每次都问 */
.navto-tip { margin: 4px 0 0; font-size: 12.5px; color: #5b6874; }
.navto-tip b { color: var(--green-d); }
/* 「默认」徽章：标出当前会走哪家，也是用户确认「记住没生效」的唯一凭据 */
.navto-badge {
  display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 999px;
  font-size: 11px; font-weight: 500; color: #fff; background: var(--green-d);
  vertical-align: 1px;
}
.icon-btn {
  width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line);
  background: #fff; color: #5b6874; font-size: 16px; line-height: 1;
  display: flex; align-items: center; justify-content: center; flex: 0 0 auto;
}
.scope-banner { background: #f7faf8; }

/* ---------------- 分段控件 ---------------- */

.seg {
  display: flex; gap: 4px; padding: 4px; margin: 0 0 12px;
  background: #eef1f5; border-radius: 12px;
}
.seg-item {
  flex: 1; border: none; background: transparent; color: #5b6874;
  padding: 9px 6px; border-radius: 9px; font-size: 13.5px; font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.seg-item.is-active { background: #fff; color: var(--green-d); font-weight: 700; box-shadow: 0 1px 4px rgba(0,0,0,.08); }

/* ---------------- 流程按钮行 ---------------- */

.flow-row { display: flex; gap: 10px; flex-wrap: wrap; }
.flow-row .btn { flex: 1; min-width: 120px; margin-top: 0; }

/* ---------------- 组织 ---------------- */

.org-item, .org-main { min-width: 0; }
.org-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 4px; border-bottom: 1px solid #f1f4f7; cursor: pointer;
}
.org-item:last-child { border-bottom: none; }
.org-item.is-current { background: #f4faf5; border-radius: 10px; padding-left: 10px; padding-right: 10px; }
.invite-row { display: flex; align-items: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.invite-code {
  flex: 1; min-width: 140px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 17px; letter-spacing: 2px; font-weight: 700; color: var(--green-d);
  background: var(--green-l); border-radius: 10px; padding: 10px 12px; text-align: center;
}

/* ---------------- AI 输出区 ---------------- */

.ai-out {
  white-space: pre-wrap; word-break: break-word;
  font-family: inherit; font-size: 13.5px; line-height: 1.85;
  background: #f8fafb; border: 1px solid var(--line); border-radius: 10px;
  padding: 12px; margin: 10px 0 0; color: #33404b; min-height: 44px;
}
/* 空占位不显示边框：没有 AI 输出时这里就是一块空白卡片，白占一屏 */
.ai-out:empty { display: none; }
.ai-meta { font-size: 12.5px; color: var(--muted); margin: -4px 2px 10px; }
.ai-inline { margin-top: 6px; }

/* AI 输出的分块结构：标题条 + 正文 + 操作行（施工报告润色用） */
.ai-out-head { font-size: 12.8px; font-weight: 700; color: #3949ab; margin-bottom: 8px; }
.ai-out-body { white-space: pre-wrap; word-break: break-word; }
.ai-out .flow-row { margin-top: 12px; }
.ai-out .flow-row .btn { margin-top: 0; }

.q-log { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.q-item { display: flex; gap: 8px; align-items: flex-start; }
.q-role {
  flex: 0 0 auto; width: 30px; height: 30px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; background: #eef1f5; color: #5b6874;
}
.q-user .q-role { background: var(--green-l); color: var(--green-d); }
.q-assistant .q-role { background: #e8eaf6; color: #3949ab; }
.q-text {
  flex: 1; background: #fff; border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; font-size: 13.5px; line-height: 1.8;
  white-space: pre-wrap; word-break: break-word;
}

/* ---------------- 图表 ---------------- */

.chart { display: block; width: 100%; height: auto; }
.chart-empty { padding: 24px 0; text-align: center; color: var(--muted); font-size: 13px; }

.donut-wrap { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.donut { flex: 0 0 auto; }
.legend { flex: 1; min-width: 140px; display: flex; flex-direction: column; gap: 6px; }
.legend-item { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.legend-item i { width: 10px; height: 10px; border-radius: 3px; flex: 0 0 auto; }
.legend-item span { flex: 1; color: #55636e; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.legend-item b { color: #25303b; }

.bars { display: flex; flex-direction: column; gap: 9px; }
.bar-row { display: flex; align-items: center; gap: 10px; }
.bar-label { flex: 0 0 80px; font-size: 12.5px; color: #5b6874; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { flex: 1; height: 10px; background: #eef1f5; border-radius: 6px; overflow: hidden; display: block; }
.bar-track i { display: block; height: 100%; border-radius: 6px; }
.bar-value { flex: 0 0 auto; font-size: 12.5px; color: #25303b; min-width: 34px; text-align: right; }

.columns { display: flex; align-items: flex-end; gap: 8px; height: 190px; padding-top: 6px; }
.col { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; }
.col-bar-wrap { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; }
.col-bar { width: 62%; max-width: 44px; border-radius: 6px 6px 3px 3px; min-height: 3px; }
.col-value { font-size: 11.5px; color: #45535e; margin-top: 5px; }
.col-label { font-size: 11.5px; color: var(--muted); }

/* ---------------- 签名 ---------------- */

.sign-page { max-width: 720px; margin: 0 auto; }
.sign-head { padding: 20px 16px 6px; }
.sign-head h1 { font-size: 19px; font-weight: 700; margin-bottom: 4px; }
.sign-pad-wrap { margin: 12px 14px; }
.sign-pad {
  display: block; width: 100%; height: auto; aspect-ratio: 900 / 320;
  background: #fff; border: 1px dashed #c3ced8; border-radius: 12px;
  touch-action: none; cursor: crosshair;
}
.sign-hint { text-align: center; font-size: 12px; color: var(--muted); margin-top: 8px; }
.sign-tools { display: flex; justify-content: center; gap: 10px; margin: 10px 0 0; }

/* 全屏书写：手机上的小框手指写不开，点「全屏书写」把画布铺满整屏。
 * 按钮文字随状态切换（小框里显示「全屏书写」，全屏里显示「写好了」）。 */
.sign-pad-wrap.is-full {
  position: fixed; left: 0; right: 0; top: 0; bottom: 0; margin: 0;
  z-index: 140; background: #fff;
  display: flex; flex-direction: column; justify-content: center;
  padding: 12px 12px calc(12px + env(safe-area-inset-bottom, 0px));
}
/* 全屏也保持 900:320 横版：不再让画布随竖屏拉成竖长条，
 * 宽度按可用高度反算，横屏手机能铺开，竖屏则居中一条横向书写区。 */
.sign-pad-wrap.is-full .sign-pad {
  flex: 0 0 auto; height: auto; aspect-ratio: 900 / 320;
  width: min(100%, calc((100vh - 170px) * 900 / 320));
  width: min(100%, calc((100dvh - 170px) * 900 / 320));
  border-radius: 8px; margin: 0 auto;
}
.sign-pad-wrap.is-full .sign-hint { margin: 8px 0 0; }
.sign-pad-wrap .spf-out { display: none; }
.sign-pad-wrap.is-full .spf-in { display: none; }
.sign-pad-wrap.is-full .spf-out { display: inline; }
body.is-signing { overflow: hidden; }
.sign-img { display: block; max-width: 100%; border-radius: 10px; background: #fff; }
.sign-block { margin-top: 4px; }

/* 设置页：已保存的默认签名预览 */
.sign-cur { margin: 10px 0 4px; }
.sign-cur-img {
  display: block; max-width: 100%; max-height: 120px; object-fit: contain;
  border: 1px solid #e3e7ee; border-radius: 10px; background: #fff;
}

/* 设置页默认签名：有签名时签名板默认收起，点「重新签名」再展开。
 * .btn 的 display:inline-flex 会盖掉 [hidden] 的浏览器默认处理，必须显式补规则。 */
.sign-editor { margin-top: 4px; }
.sign-editor[hidden] { display: none; }
.sign-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.sign-actions .btn { flex: 1 1 auto; min-width: 118px; margin-top: 0; }
.sign-actions .btn[hidden] { display: none; }

/* 签字前折叠展示报告正文，避免客户签字页过长 */
.sign-preview { padding: 0; overflow: hidden; }
.sign-preview > summary {
  padding: 14px 16px; cursor: pointer; font-size: 14px; font-weight: 600;
  color: var(--green-d); list-style: none;
}
.sign-preview > summary::-webkit-details-marker { display: none; }
.sign-preview > summary::after { content: ' ▾'; color: var(--muted); font-weight: 400; }
.sign-preview[open] > summary::after { content: ' ▴'; }
.sign-preview .report-body { margin: 0 16px 16px; }

/* 施工报告第 3 步：低频填写项折叠（内部备注 / 现场问题 / 整改建议 / 安全注意）。
 * 用 details 而不是 JS 切换，展开状态由浏览器管，页面重绘不丢。 */
.more-fold { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 4px; }
.more-fold > summary {
  padding: 10px 0 2px; cursor: pointer; font-size: 14px; font-weight: 600;
  color: var(--green-d); list-style: none;
}
.more-fold > summary::-webkit-details-marker { display: none; }
.more-fold > summary::after { content: ' ▾'; color: var(--muted); font-weight: 400; }
.more-fold[open] > summary::after { content: ' ▴'; }
.more-fold > summary .muted { font-weight: 400; font-size: 12.5px; }
.more-fold-body { padding-top: 4px; }

/* 客户签字页顶部的告知条 */
.cl-notice { background: #fff8e1; box-shadow: 0 2px 10px rgba(191, 144, 0, .12); }
.cl-notice p { margin: 0; font-size: 13.5px; line-height: 1.8; color: #6d4c00; }

/* ---------------- 管理后台 ---------------- */

body.is-admin { background: #eef1f5; }
body.is-admin .view { max-width: none; padding: 0; background: #eef1f5; }

.admin { display: flex; align-items: stretch; min-height: 100vh; max-width: 1440px; margin: 0 auto; background: #eef1f5; }

.admin-side {
  flex: 0 0 212px; width: 212px;
  background: #1f2a33; color: #b9c5cd;
  display: flex; flex-direction: column; gap: 4px;
  padding: 16px 12px; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
/* 后台侧栏品牌标：同样由 P.LOGO.mark() 提供图形 */
.admin-brand { display: flex; align-items: center; gap: 10px; padding: 4px 6px 14px; }
.admin-logo {
  width: 34px; height: 34px; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
}
.admin-logo svg { display: block; width: 34px; height: 34px; }
.admin-brand b { display: block; color: #fff; font-size: 15px; line-height: 1.3; }
.admin-brand-sub { font-size: 11.5px; color: #7d8b95; }
.admin-scope {
  font-size: 11.5px; color: #8fa0ab; background: #17212a;
  border-radius: 8px; padding: 7px 10px; margin-bottom: 8px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.nav-group { margin-bottom: 6px; }
.nav-group-title { font-size: 11px; color: #6b7a85; padding: 8px 8px 4px; letter-spacing: 1px; }
.nav-item {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 10px; border-radius: 9px; color: #b9c5cd;
  font-size: 13.5px; text-decoration: none;
}
.nav-item:hover { background: #27343e; color: #fff; }
.nav-item.is-active { background: #2e7d32; color: #fff; font-weight: 600; }
.nav-icon { width: 16px; text-align: center; flex: 0 0 auto; opacity: .9; }
.admin-side-foot { margin-top: auto; padding-top: 10px; border-top: 1px solid #2b3843; }

.admin-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.admin-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 18px 22px 12px;
}
.admin-head h1 { font-size: 20px; font-weight: 700; }
.admin-head-right { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex: none; }
.admin-body { padding: 0 22px 28px; }

.admin-card {
  background: #fff; border: 1px solid #e2e8ee; border-radius: 14px;
  padding: 16px 18px; margin-bottom: 14px;
}
.admin-card h3 { font-size: 14.5px; font-weight: 700; margin-bottom: 10px; }
.admin-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.admin-card-head h3 { margin-bottom: 0; }
.admin-empty { padding: 26px 0; text-align: center; color: var(--muted); font-size: 13px; }
.admin-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.admin-actions .btn { margin-top: 0; }
.admin-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.kpi-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 14px; }
.kpi {
  background: #fff; border: 1px solid #e2e8ee; border-radius: 14px;
  padding: 14px 16px; display: flex; flex-direction: column; gap: 2px;
  border-left: 4px solid #cfd8e0;
}
.kpi b { font-size: 22px; font-weight: 700; color: #25303b; line-height: 1.3; }
.kpi span { font-size: 12.5px; color: var(--muted); }
.kpi-blue { border-left-color: #1565c0; }
.kpi-green { border-left-color: #2e7d32; }
.kpi-purple { border-left-color: #6a1b9a; }
.kpi-orange { border-left-color: #ef6c00; }
.kpi-teal { border-left-color: #00838f; }
.kpi-red { border-left-color: #d32f2f; }
.kpi-brown { border-left-color: #5d4037; }
.kpi-cyan { border-left-color: #0277bd; }

.mini-list { display: flex; flex-direction: column; }
.mini-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 2px; border-bottom: 1px solid #f1f4f7; font-size: 13.5px;
}
.mini-item:last-child { border-bottom: none; }
.mini-item > span:first-child { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-meta { font-size: 12.5px; color: var(--muted); flex: 0 0 auto; }

.table-wrap { background: #fff; border: 1px solid #e2e8ee; border-radius: 14px; overflow: hidden; }
.table-hint { padding: 10px 14px; font-size: 12.5px; color: var(--muted); border-bottom: 1px solid #eef1f5; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th {
  text-align: left; font-weight: 600; color: #5b6874; background: #f7f9fa;
  padding: 10px 12px; border-bottom: 1px solid #eef1f5; white-space: nowrap;
}
.table td { padding: 10px 12px; border-bottom: 1px solid #f4f7f9; vertical-align: top; }
.table tbody tr:last-child td { border-bottom: none; }
.table tr.is-link { cursor: pointer; }
.table tr.is-link:hover td { background: #f5faf6; }

/* 管理后台响应式：窄屏时侧栏变为横向条 */
@media (max-width: 900px) {
  .admin { flex-direction: column; }
  .admin-side {
    flex: none; width: 100%; height: auto; position: static;
    flex-direction: row; align-items: center; gap: 6px;
    padding: 10px 12px; overflow-x: auto; overflow-y: hidden;
  }
  .admin-brand { padding: 0 8px 0 0; flex: 0 0 auto; }
  .admin-brand-sub, .admin-scope { display: none; }
  .nav-group { display: flex; align-items: center; gap: 6px; margin-bottom: 0; }
  .nav-group-title { display: none; }
  .nav-item { white-space: nowrap; padding: 8px 11px; font-size: 13px; }
  .admin-side-foot { margin: 0 0 0 auto; padding: 0; border: none; }
  .admin-head { padding: 14px 14px 10px; }
  .admin-body { padding: 0 14px 24px; }
  .admin-grid-2 { grid-template-columns: 1fr; }
  .kpi-row { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- 现场交付件（docgen） ----------
 * 交付件的排版样式全部内联在生成的 HTML 里（交付件只输出 PDF，打印与导出两条
 * 输出路径共用一份排版，不会各自漂移）。这里只负责两件事：做出格式选择弹层，
 * 以及打印时把应用界面本身藏掉、只留交付件。 */

.fmt-choice { display: grid; gap: 8px; margin-top: 10px; }
.fmt-btn {
  display: block; width: 100%; text-align: left; cursor: pointer;
  background: #fff; border: 1px solid #d9e2dc; border-radius: 10px;
  padding: 12px 14px; font-size: 14px; color: #1c2b24; line-height: 1.5;
}
.fmt-btn:hover { border-color: #2e7d32; background: #f6faf7; }
.fmt-btn b { display: block; font-size: 15px; margin-bottom: 2px; }
.fmt-btn span { color: #6b7c74; font-size: 12.5px; }
.fmt-btn.is-disabled { opacity: 0.7; cursor: default; }
.fmt-btn.is-disabled:hover { border-color: #d9e2dc; background: #fff; }

/* 内置浏览器里的提示：不列用不了的路径，直接给出可执行的下一步 */
.fmt-note {
  margin: 10px 0 0; padding: 9px 11px; border-radius: 8px;
  background: #fff8e6; border: 1px solid #f0e0b8; color: #7a5c14; font-size: 12.5px;
}

/* ---------- 交付件预览层 ----------
 * 「提交后先看一眼，再决定导不导」。这一层只负责把交付件按真实排版显示出来，
 * 不生成任何文件；用户点「导出」后才生成 PDF。 */
.docpreview {
  position: fixed; inset: 0; z-index: 120;
  background: #eceff1; display: flex; flex-direction: column;
}
.docpreview.is-hidden { display: none; }
.docpreview-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 14px; padding-top: calc(12px + env(safe-area-inset-top));
  background: #fff; border-bottom: 1px solid var(--line);
}
.docpreview-head b {
  font-size: 14.5px; color: var(--ink); overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}
.docpreview-close {
  flex: none; border: 0; background: #eef2ef; color: #2c3a33;
  border-radius: 999px; padding: 6px 15px; font-size: 13px; cursor: pointer;
}
.docpreview-tip {
  padding: 9px 14px; background: #f6faf7; border-bottom: 1px solid #e2ebe6;
  color: #4a5a52; font-size: 12.5px; line-height: 1.7;
}
.docpreview-stage { flex: 1; overflow: auto; -webkit-overflow-scrolling: touch; padding: 12px; }
.docpreview-paper {
  position: relative; margin: 0 auto; overflow: hidden;
  background: #fff; border-radius: 4px; box-shadow: 0 2px 12px rgba(0, 0, 0, .12);
}
.docpreview-inner { position: absolute; top: 0; left: 0; background: #fff; }
.docpreview-actions {
  padding: 10px 14px calc(12px + env(safe-area-inset-bottom));
  background: #fff; border-top: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 8px;
}
.docpreview-actions .btn { margin-top: 0; }

#print-root { display: none; }
@media print {
  /* html 的背景也必须一并压白：只改 body 时，打印页内容结束后的余白会露出
     html 的 --bg（淡紫灰），交付件底部出现一块紫灰色块（真机打印已复现）。 */
  html.is-printing, body.is-printing { background: #fff; }
  body.is-printing > *:not(#print-root) { display: none !important; }
  body.is-printing #print-root { display: block !important; }
  body.is-printing #print-root img { max-width: 100%; }
  @page { size: A4; margin: 14mm 12mm; }
}

/* ---------------- 版本锁与定价页 ---------------- */

/* 版本不足的入口：保留位置但降饱和，点进去是升级引导 */
.entry.is-locked { background: #fafbfc; border-style: dashed; }
.entry.is-locked .entry-icon { filter: grayscale(1); opacity: .5; }
.entry.is-locked .entry-label { color: #7b8794; }
.entry.is-locked .entry-desc { color: #9aa5b1; }

.plan-card.is-current { border-color: #a5cfa8; }
.plan-price { margin: 2px 0 8px; }
.plan-price b { font-size: 21px; color: #1c2b24; font-variant-numeric: tabular-nums; }
.plan-usage {
  display: flex; justify-content: space-between; gap: 10px;
  padding: 6px 0; border-top: 1px dashed var(--line);
  font-size: 13.5px; color: #5b6470;
}
.plan-usage b { color: #1c2b24; font-variant-numeric: tabular-nums; }
.plan-table-wrap { overflow-x: auto; }
.plan-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.plan-table th, .plan-table td { border: 1px solid var(--line); padding: 7px 8px; text-align: left; white-space: nowrap; }
.plan-table th { background: #f6faf6; font-weight: 600; }
.plan-table td.num { text-align: center; }

/* 周期定价选择器 */
.cycle-row { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0 8px; }
.cycle-chip {
  padding: 5px 11px; font-size: 13px; line-height: 1.2;
  border: 1px solid var(--line); border-radius: 999px;
  background: #fff; color: #4a5a52; cursor: pointer;
}
.cycle-chip.is-on {
  border-color: #2e7d32; background: #e8f5e9; color: #2e7d32; font-weight: 600;
}
.cycle-only { font-size: 12.5px; color: #8a97a3; }

/* 推广码展示 */
.ref-code {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 12px; margin: 6px 0 8px;
  background: #f6faf6; border: 1px dashed #a5cfa8; border-radius: 9px;
}
.ref-code b {
  font-size: 20px; letter-spacing: 1.5px; color: #2e7d32;
  font-variant-numeric: tabular-nums;
}
.ref-sep { border: 0; border-top: 1px solid var(--line); margin: 14px 0 10px; }

/* ---------------- 常用药剂导入弹层 ---------------- */

.preset-group { margin-bottom: 12px; }
.preset-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding-bottom: 4px; margin-bottom: 4px; border-bottom: 1px solid var(--line);
  font-size: 14px; color: #1c2b24;
}
.preset-head .link { font-size: 12.5px; }
.preset-group .muted { margin: 2px 0 6px; }
.preset-row {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 6px 2px; font-size: 13.5px; line-height: 1.55;
  border-bottom: 1px dashed #eef1f3;
}
.preset-row:last-child { border-bottom: 0; }
.preset-row input { margin-top: 2px; flex: 0 0 auto; }
.preset-row.is-has { opacity: .55; }
.preset-main { display: flex; flex-direction: column; }
.preset-main b { font-weight: 600; color: #22303a; }
.preset-sub { font-size: 12.2px; color: #7b8794; }

/* ---------------- 公章上传预览 ---------------- */

.seal-cur { display: flex; align-items: center; gap: 12px; margin: 6px 0 2px; }
.seal-cur img {
  width: 96px; height: 96px; object-fit: contain;
  border: 1px dashed #cfd6dc; border-radius: 50%; background: #fff;
}
.seal-cur .muted { flex: 1; }

/* ---------------- 点位坐标输入（客户 / 勘察明细 / 设备共用） ---------------- */

.coord-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; align-items: center; }
.coord-row input { min-width: 0; }
.coord-row .btn { white-space: nowrap; }

/* ---------------- 点位地图 ---------------- */

.map-card { padding: 10px; }
.map-canvas {
  width: 100%;
  height: 360px;
  border-radius: 12px;
  overflow: hidden;
  background: #eef1f5;   /* 底图未加载完时的占位色，避免出现「一片黑」 */
}
.map-hint { font-size: 12.2px; color: var(--muted); margin: 8px 2px 2px; }
.map-info { padding: 2px 4px; max-width: 220px; }
.map-info b { display: block; font-size: 13px; color: var(--ink); }
.map-info span { display: block; font-size: 11.5px; color: var(--muted); }

/* ---------------- 全屏选点器 ---------------- */

.geo-pick {
  position: fixed; inset: 0; z-index: 150;
  background: #fff;
  display: flex; flex-direction: column;
}
.geo-pick-head {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.geo-pick-title { flex: 1; text-align: center; font-weight: 600; font-size: 15px; }
.geo-pick-search {
  display: flex; gap: 8px; padding: 8px 12px;
  border-bottom: 1px solid var(--line);
}
.geo-pick-search input {
  flex: 1; min-width: 0;
  border: 1px solid var(--line); border-radius: 10px;
  padding: 8px 12px;
}
.geo-sug {
  position: absolute; left: 12px; right: 12px; top: 104px;
  z-index: 152;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 8px 24px rgba(23, 43, 77, .16);
  max-height: 46vh; overflow: auto;
}
.geo-sug-item {
  display: block; width: 100%; text-align: left;
  padding: 9px 12px; border: 0; background: transparent;
  border-bottom: 1px solid #f1f4f7;
}
.geo-sug-item:last-child { border-bottom: 0; }
.geo-sug-item b { display: block; font-size: 13.5px; color: var(--ink); font-weight: 600; }
.geo-sug-item span { display: block; font-size: 11.8px; color: var(--muted); }
/* z-index:0 是关键：把腾讯地图内部图层（透明交互层/控件，z-index 动辄数百上千）
 * 全部收笼进本层的层叠上下文。没有它，TMap 内部层会逃逸到 .geo-pick 的层叠竞争里，
 * 把 z-index:152 的搜索候选列表压在下面 —— 列表看得见（透明层不遮挡视觉），
 * 但点击全被地图层吃掉，表现为「点候选无响应」（20261013s 真渲染实测复现）。 */
.geo-pick-body { position: relative; z-index: 0; flex: 1; min-height: 0; }
.geo-canvas { width: 100%; height: 100%; background: #eef1f5; }
.geo-cross {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  font-size: 30px; line-height: 1;
  color: var(--red);
  text-shadow: 0 0 4px #fff, 0 0 4px #fff, 0 0 8px #fff;
  pointer-events: none;
}
.geo-pick-foot {
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: #fff;
}
.geo-addr { font-size: 13.5px; color: var(--ink); }
.geo-coord { font-size: 12.2px; color: var(--muted); font-variant-numeric: tabular-nums; }
/* 定位结果提示（精度 / 是否纠偏）：有话说才出现，平时不占地方 */
.geo-tip { margin-top: 5px; font-size: 12.2px; line-height: 1.5; color: var(--green-d); }
.geo-tip.is-warn { color: #e65100; }
/* 纠偏方式切换：低频但关键，用弱化的下划线按钮，避免和主操作抢注意力 */
.geo-fix {
  display: block; margin-top: 6px; padding: 0;
  border: 0; background: transparent; text-align: left;
  font-size: 12.2px; color: var(--muted); text-decoration: underline;
}

/* ---------------- 排班日历 ---------------- */

.cal-title { font-size: 15px; font-weight: 600; }
.cal-head {
  display: grid; grid-template-columns: repeat(7, 1fr);
  gap: 4px; margin: 6px 0 4px;
}
.cal-dow { text-align: center; font-size: 12px; color: var(--muted); }
.cal-dow.is-weekend { color: var(--orange); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-cell {
  min-height: 64px;
  padding: 3px 3px 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  display: flex; flex-direction: column; gap: 2px;
  text-align: left; overflow: hidden;
}
.cal-cell.is-out { background: transparent; border-color: transparent; }
.cal-cell.is-weekend { background: #fbfbfd; }
.cal-cell.is-today { border-color: var(--green); box-shadow: inset 0 0 0 1px var(--green); }
.cal-day { font-size: 12px; font-weight: 600; color: var(--ink); }
.cal-cell.is-today .cal-day { color: var(--green); }
.cal-tasks { display: flex; flex-direction: column; gap: 2px; }
.cal-task {
  display: block;
  font-size: 10.5px; font-style: normal; line-height: 1.5;
  padding: 1px 4px; border-radius: 5px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background: #f1f4f7; color: #55636e;
}
.cal-task.is-pending { background: #e3f0fd; color: var(--blue); }
.cal-task.is-doing { background: #fdeedd; color: var(--orange); }
.cal-task.is-done { background: var(--green-l); color: var(--green-d); text-decoration: line-through; }
.cal-task.is-cancelled { background: #f1f4f7; color: #9aa6b2; text-decoration: line-through; }
.cal-task.is-overdue { box-shadow: inset 2px 0 0 var(--red); }
.cal-more { font-size: 10px; color: var(--muted); }

/* ============================================================
   合同服务周期提醒（首页 / 合同详情）
   ============================================================ */

/* 统计条：四格等宽，数字大、标签小 */
.cyc-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 2px 0 12px; }
.cyc-stat {
  background: #f7f9fb;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 4px;
  text-align: center;
}
.cyc-stat b { display: block; font-size: 19px; line-height: 1.25; color: var(--ink); }
.cyc-stat span { font-size: 11.5px; color: var(--muted); }

/* 待办行：客户名 + 徽章一行，元信息一行，操作一行（窄屏不挤） */
.cyc-list { display: flex; flex-direction: column; }
.cyc-item { padding: 10px 0; border-bottom: 1px dashed var(--line); }
.cyc-item:last-child { border-bottom: none; }
.cyc-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cyc-cust {
  flex: 1; min-width: 0; text-align: left;
  background: none; border: none; padding: 0; font: inherit;
  font-size: 14.5px; font-weight: 600; color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cyc-meta { margin-top: 3px; font-size: 12.5px; color: var(--muted); }
.cyc-ops { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }

/* 周期状态徽章（浅底彩字，自成一套，不与 .tag-* 实底风格混用） */
.cyc-tag {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.7;
  white-space: nowrap;
}
.cyc-overdue { background: #fdecea; color: #c62828; }
.cyc-due { background: #fff3e0; color: #e65100; }
.cyc-ok { background: var(--green-l); color: var(--green-d); }
.cyc-expired { background: #eceff1; color: #607d8b; }
.cyc-unset { background: #eceff1; color: #8a97a3; }

.cyc-empty { font-size: 13px; color: var(--muted); padding: 8px 0; }
.cyc-warn { margin-top: 8px; font-size: 13px; color: #c62828; }

/* 小型按钮：提醒行内用，比 .btn 小一档 */
.btn-mini {
  padding: 5px 12px;
  border-radius: 8px;
  font-size: 12.5px;
  border: 1px solid var(--line);
  background: #fff;
  color: #5b6874;
}
.btn-mini-primary { background: var(--blue); border-color: var(--blue); color: #fff; }

/* 卡片标题右侧动作组（合同详情：设置周期 / 完成本期服务） */
.head-acts { display: flex; align-items: center; gap: 12px; }
.head-note { font-size: 12.5px; color: var(--muted); }

/* 来源标记：周期名单里「这条来自客户档案而不是合同」。
 * 用户点进去才知道该去哪儿改 —— 不标的话在客户档案里找不到那条合同。 */
.cyc-src {
  flex: none;
  margin-right: 6px;
  padding: 1px 6px;
  border-radius: 6px;
  font-size: 11px;
  background: #eef2f6;
  color: #607d8b;
}

/* 回款：配色与周期徽章分开（一套讲上门、一套讲收钱），避免同屏两种含义长得一样 */
.pay-list { display: flex; flex-direction: column; }
/* 首页回款提醒里来自客户档案的欠款（没有电子合同的短期 / 一次性客户）：
 * 左侧一道细色条 + 顶部「客户档案」标签，和合同欠款一眼分得开。
 * 只作用在 .pay-list 内，不影响客户列表 / 合同页里同名的 .cyc-item。 */
.pay-list .cyc-item.is-customer {
  border-left: 3px solid #c9dce9;
  padding-left: 9px;
}
.pay-tag {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.7;
  white-space: nowrap;
}
.pay-overdue { background: #fdecea; color: #c62828; }
.pay-due { background: #fff8e1; color: #a06a00; }
.pay-pending { background: #e8eef7; color: #37506e; }
.pay-paid { background: var(--green-l); color: var(--green-d); }
.pay-unset { background: #eceff1; color: #8a97a3; }
/* 无应收：比「未设置」更深一点的灰并加一圈描边，读起来是「确定不收」而不是「还没填」 */
.pay-none {
  background: #eef1f3; color: #5b6874;
  border: 1px solid var(--line);
  padding: 0 7px; line-height: 1.6;
}
.pay-warn { margin-top: 8px; font-size: 13px; color: #c62828; }

/* 已收进度条：一眼看出「收了几成」。宽度由内联 style 给，样式只负责外观。 */
.pay-bar {
  height: 6px;
  border-radius: 999px;
  background: #eceff1;
  overflow: hidden;
  margin-bottom: 10px;
}
.pay-bar > i { display: block; height: 100%; background: var(--green); border-radius: 999px; }

.pay-log { margin-top: 10px; border-top: 1px dashed var(--line); padding-top: 8px; }
.pay-log-head { font-size: 12.5px; color: var(--muted); margin-bottom: 4px; }
.pay-log-item {
  display: flex; align-items: baseline; gap: 10px;
  padding: 4px 0; font-size: 13px;
}
.pay-log-item b { color: var(--green-d); font-weight: 600; }
.pay-log-item span { color: var(--muted); font-size: 12.5px; }
.pay-log-item em { margin-left: auto; font-style: normal; font-size: 12.5px; color: var(--muted); }

/* ---------------- 地图密钥按钮行（设置 → 公司信息） ----------------
 * 保存密钥 / 怎么申请：与说明卡同宽，左侧对齐。 */
.key-btn-bar { margin-top: 8px; }

.key-guide {
  margin-top: 8px; padding: 10px 12px;
  border: 1px dashed var(--line); border-radius: 10px;
  background: #fbfcfd; font-size: 12.5px; line-height: 1.7;
}
.kg-title { margin: 0 0 6px; font-weight: 600; color: var(--ink); }
.kg-list { margin: 0; padding-left: 18px; }
.kg-list li { margin-bottom: 5px; }
.kg-step b { display: block; color: var(--ink); }
.kg-step span { color: var(--muted); }
.kg-avoid { margin: 6px 0 0; color: var(--red); }
.kg-foot { margin: 8px 0 0; color: var(--muted); }
.kg-foot a { color: var(--green-d); }
.kg-identity {
  margin: 0 0 8px; padding: 7px 9px; border-radius: 8px;
  background: #f2f9f3; border-left: 3px solid var(--green); color: var(--ink);
}
.kg-acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 5px; }
.kg-go, .kg-copy {
  display: inline-block; padding: 2px 10px; border-radius: 999px;
  font-size: 12px; line-height: 1.8; font-family: inherit;
  border: 1px solid var(--line); background: #fff; color: var(--green-d);
  text-decoration: none; cursor: pointer;
}
.kg-go:hover, .kg-copy:hover { border-color: var(--green); }
.kg-opt { margin: 8px 0 0; color: var(--muted); }
.kg-opt b { display: block; color: var(--ink); }
.kg-opt .kg-copy { margin-top: 5px; }

/* ---------------- 地图密钥统一说明 ----------------
 * 文案与链接定义在 config.js 的 PCO.MAP_HELP，geo.js 的 P.keyNote 只负责套样式。
 * 长句必须能换行：移动端 390px 下不允许撑出横向滚动条。 */
.map-key-note {
  margin-top: 8px; padding: 8px 10px;
  border-left: 3px solid var(--green); border-radius: 8px;
  background: #f7fbf8; color: var(--muted);
  font-size: 12.5px; line-height: 1.65;
  word-break: break-word; overflow-wrap: anywhere;
}
.map-key-note p { margin: 0 0 4px; }
.map-key-note p:last-child { margin-bottom: 0; }
.map-key-note b { color: var(--ink); font-weight: 600; }
.map-key-note .mk-links a { color: var(--green-d); }
.map-key-inline {
  display: block; margin-top: 6px;
  color: var(--muted); font-size: 12px; line-height: 1.6;
  word-break: break-word; overflow-wrap: anywhere;
}
.map-key-inline a { color: var(--green-d); }

/* ---------------- 离线横幅（本地草稿配套，20261012x） ----------------
 * fixed 在顶栏正下方：顶栏是 fixed 的，放流内会被它压住。
 * 出现时由 body.offline 把 .view 的 padding-top 加高一截，别让横幅压住第一张卡。 */
.offline-bar {
  position: fixed;
  top: calc(var(--topbar-h) + env(safe-area-inset-top));
  left: 50%; transform: translateX(-50%);
  width: 100%; max-width: var(--maxw);
  padding: 6px 14px;
  font-size: 12.5px; line-height: 1.5; text-align: center;
  color: #8a5a00; background: #fff5e6; border-bottom: 1px solid #ffe0b2;
  z-index: 55;
}
.offline-bar.is-hidden { display: none; }
body.offline .view { padding-top: calc(var(--topbar-h) + env(safe-area-inset-top) + 46px); }

/* 表单里的草稿状态条：「已暂存 hh:mm」这类一句话反馈，不抢视觉 */
.draft-note {
  display: flex; align-items: center; gap: 8px;
  margin: 0 0 10px; padding: 7px 12px;
  font-size: 12.5px; color: var(--muted);
  background: var(--bg); border: 1px solid var(--line); border-radius: 10px;
}
.draft-note b { color: var(--ink); font-weight: 600; }
.draft-note .link-btn { margin-left: auto; }
.draft-note.is-warn { color: #8a5a00; background: #fff5e6; border-color: #ffe0b2; }

/* ---------------- 付款方式（20261013i） ----------------
 * 下单页展示：收款二维码 + 银行账号 + 转账附言要求。
 * 二维码和账号都没配时整块不渲染（见 views.plan.js payHtml），所以这里只负责「配了长什么样」。 */
.pay-box {
  margin: 10px 0 12px; padding: 12px 13px;
  background: #f6faf6; border: 1px solid #cfe6d0; border-radius: 11px;
}
.pay-title { font-size: 13.5px; font-weight: 600; color: var(--green); margin-bottom: 9px; }
.pay-body { display: flex; gap: 14px; align-items: flex-start; flex-wrap: wrap; }
.pay-qr { text-align: center; flex: none; }
.pay-qr img {
  display: block; width: 146px; height: 146px; object-fit: contain;
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
}
.pay-qr span { display: block; margin-top: 5px; font-size: 12px; color: #8a97a3; }
.pay-bank { flex: 1 1 200px; min-width: 190px; }
.pay-bank p {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 6px 0; font-size: 13.5px; border-top: 1px dashed var(--line);
}
.pay-bank p:first-child { border-top: 0; padding-top: 0; }
.pay-bank p span { color: var(--muted); flex: none; }
.pay-bank p b { color: #1c2b24; word-break: break-all; }
.pay-remark { margin-top: 11px; padding-top: 10px; border-top: 1px solid #cfe6d0; }
.pay-remark > b { font-size: 13.5px; color: #1c2b24; }
.pay-remark > p { margin-top: 4px; font-size: 12.5px; color: #5b6470; }
.pay-code {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 8px 10px; margin: 7px 0;
  background: #fff; border: 1px dashed #a5cfa8; border-radius: 9px;
}
.pay-code code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13.5px; color: var(--green); word-break: break-all; flex: 1 1 auto;
}

/* 迷你复制按钮（付款方式 / 推广码共用） */
.mini-btn {
  padding: 3px 10px; font-size: 12px; line-height: 1.6;
  border: 1px solid #a5cfa8; border-radius: 999px;
  background: #fff; color: var(--green); cursor: pointer; flex: none;
}
.mini-btn:active { background: var(--green-l); }

/* ---------------- 客户档案：服务周期调整 + 回款设置（20261108） ----------------
 * 概览条 / 排期表 / 回款流水都只服务客户档案，不复用合同回款的 .pay-* 结构，
 * 避免同一套 class 在两个页面里语义漂移。徽章色沿用 cyc-* / pay-* 的既有色板。 */
.c-overview { margin: 0 0 14px; }
.csum {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); gap: 10px;
  padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px;
  background: linear-gradient(180deg, #f7faf8 0%, #fff 100%);
}
.csum-item { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.csum-k { font-size: 11.5px; color: var(--muted); }
.csum-v { font-size: 15px; line-height: 1.45; color: var(--ink); font-weight: 600; }
.csum-s { font-style: normal; font-size: 12px; color: var(--muted); }
/* 客户档案概览压成一行：周期 / 回款 / 保障期各一个短标签（20261109） */
.csum.csum-line {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 6px 8px; padding: 10px 12px;
}
.csum-line .csum-k { flex: 0 0 auto; }
.csum-line .csum-k:not(:first-child) { margin-left: 4px; }

.cycle-ops { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 4px 0 2px; }
.cyc-pause {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px; border: 1px solid var(--line); border-radius: 8px;
  background: #fff; font-size: 13px; color: #5b6874; cursor: pointer;
}
.cyc-pause input { width: auto; margin: 0; }
.cyc-paused { background: #eceff1; color: #546e7a; }
.pay-partial { background: #fff3e0; color: #e65100; }
.pay-unset { background: #eceff1; color: #8a97a3; }

.pay-sched-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 8px; margin: 12px 0 6px; font-size: 13px;
}
.pay-sched-head b { color: var(--green-d); }
.pay-sched-head span { font-size: 12px; color: var(--muted); }
.pay-sched-scroll {
  border: 1px solid var(--line); border-radius: 10px;
  overflow: auto; max-height: 264px; background: #fff;
  -webkit-overflow-scrolling: touch;
}
.ps-row {
  display: grid; grid-template-columns: 54px 84px 1fr 1fr 64px;
  gap: 8px; align-items: center; padding: 7px 10px;
  border-top: 1px solid #f0f3f5; font-size: 12.5px;
}
.ps-row:first-child { border-top: 0; }
.ps-head {
  position: sticky; top: 0; z-index: 1;
  background: #f6f8fa; color: var(--muted); font-size: 11.5px;
}
.ps-row.is-overdue { background: #fff7f6; }
.ps-row .pay-tag { justify-self: start; }
.pay-empty { padding: 6px 0; }

/* 收款方式：一次收清 / 分期收款两档，分段按钮比下拉更容易一眼看出当前是哪种 */
.seg {
  display: flex; border: 1px solid var(--line); border-radius: 10px;
  overflow: hidden; background: #fff;
}
.seg-btn {
  flex: 1 1 0; padding: 9px 6px; border: 0; background: transparent;
  font-size: 13.5px; line-height: 1.3; color: #5b6874; cursor: pointer;
}
.seg-btn + .seg-btn { border-left: 1px solid var(--line); }
.seg-btn.on { background: var(--green-d); color: #fff; font-weight: 600; }
/* 三档服务方式：窄屏允许折行，但按钮本身不撑出页面（390px 不横向溢出） */
.seg-3 .seg-btn { padding: 8px 3px; font-size: 12.5px; white-space: normal; word-break: keep-all; }

/* 卡内低频设置 / 整卡折叠：默认收起，填过值的自动 open（编辑时不藏用户已填内容） */
.c-fold { margin: 6px 0 10px; border-top: 1px dashed var(--line); padding-top: 8px; }
.c-fold > summary {
  cursor: pointer; list-style: none; padding: 4px 0 8px;
  font-size: 13px; font-weight: 600; color: var(--green-d);
}
.c-fold > summary::-webkit-details-marker { display: none; }
.c-fold > summary::before { content: '▸'; margin-right: 6px; color: var(--muted); }
.c-fold[open] > summary::before { content: '▾'; }
.card.c-card-fold { padding: 0; }
.c-card-fold > summary {
  cursor: pointer; list-style: none; padding: 14px 16px;
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
}
.c-card-fold > summary::-webkit-details-marker { display: none; }
.c-card-fold > summary h3 { font-size: 17px; font-weight: 600; }
.c-card-fold > summary .muted { font-size: 12px; }
.c-card-fold[open] > summary { border-bottom: 1px dashed var(--line); }
.c-fold-body { padding: 12px 16px 16px; }

/* 售后保障期徽章：在保绿 / 临近橙 / 已到期红（过期必须显式标出，便于续签） */
.wt-tag {
  display: inline-block; font-size: 11.5px; padding: 2px 7px;
  border-radius: 999px; background: #eceff1; color: #8a97a3;
}
.wt-active { background: #e8f5e9; color: #2e7d32; }
.wt-warn { background: #fff3e0; color: #e65100; }
.wt-expired { background: #fdecea; color: #c62828; }
.wt-unset { background: #eceff1; color: #8a97a3; }
.wt-presets { margin-top: 2px; }
/* 列表行里的倒计时：徽章后跟一段起止日，窄屏允许折行，不撑出页面 */
.wt-line { line-height: 1.8; }
.wt-dates { color: #9aa8b2; white-space: normal; }

/* 客户列表的售后筛选条：复用 .seg 分段样式，只压一下上下间距 */
.c-wfilter { margin: -2px 0 10px; }
.c-wfilter .seg-btn b { font-weight: 600; }

/* 回款流水：客户档案一行一笔，主行金额 + 方式，次行日期 / 期次 / 备注 */
.pay-log .pay-log-item { display: block; padding: 8px 0; border-top: 1px dashed #eef2f5; }
.pay-log .pay-log-item:first-child { border-top: 0; }
.pl-main { display: flex; align-items: baseline; gap: 8px; font-size: 13.5px; }
.pl-main b { color: var(--green-d); font-weight: 600; }
.pl-method, .pl-period { font-size: 11.5px; color: #607d8b; background: #eef2f6; border-radius: 6px; padding: 1px 6px; }
.pl-sub { margin-top: 3px; font-size: 12px; color: var(--muted); word-break: break-all; }

@media (max-width: 640px) {
  .csum { grid-template-columns: 1fr; gap: 8px; padding: 11px 12px; }
  .csum-item { flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 6px; }
  .csum-k { min-width: 74px; }
  .seg-btn { font-size: 12.5px; padding: 8px 4px; }
  .ps-row { grid-template-columns: 48px 80px 1fr 1fr 58px; gap: 5px; padding: 7px 8px; font-size: 12px; }
  .pay-sched-scroll { max-height: 300px; }
  .row-nav { padding-right: 10px; }
  .nav-btn { padding: 6px 8px; gap: 3px; font-size: 12px; }
  .cust-row .chev { font-size: 17px; }
}

/* =========================================================================
 * 报价（20261109 · 第一批：价目表 + 报价单）
 * ========================================================================= */
.q-amt { font-weight: 600; color: var(--green-d); white-space: nowrap; }
.q-head-line {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 8px; flex-wrap: wrap; margin-bottom: 8px;
}
.q-title { font-size: 16px; font-weight: 600; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.q-ver { font-size: 11.5px; color: #607d8b; background: #eef2f6; border-radius: 6px; padding: 1px 6px; margin-left: 6px; }
.q-hint { font-size: 11.5px; }
.q-form .card + .card { margin-top: 12px; }
.q-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 10px; }
.q-form-actions { margin-top: 12px; }
.q-form-actions .btn { flex: 1; }

/* 价目项卡片：一行一个项目，窄屏自动折成两列 / 单列 */
.q-line {
  border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; margin-bottom: 10px; background: #fbfcfb;
}
.q-line-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 4px; font-size: 13px;
}
.q-line-del {
  border: 0; background: none; color: var(--muted); font-size: 12px;
  cursor: pointer; padding: 2px 4px;
}
.q-line-sum { font-size: 12.5px; color: var(--muted); }
.q-line-sum b { color: var(--green-d); font-weight: 600; }

/* 分项预览 / 合计：合计必须一眼看出「等于总价」 */
.q-fees { border: 1px dashed var(--line); border-radius: 10px; padding: 10px 12px; margin: 10px 0; }
.q-fee-rows { display: block; }
.q-fee-row { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; padding: 3px 0; }
.q-fee-row b { font-weight: 600; color: #37474f; white-space: nowrap; }
.q-fee-total {
  display: flex; justify-content: space-between; align-items: baseline; gap: 10px;
  border-top: 1px solid var(--line); margin-top: 6px; padding-top: 8px; font-size: 14px;
}
.q-fee-total b { color: var(--green-d); font-size: 19px; font-weight: 700; }
.q-diff { font-size: 11.5px; }

/* 偏差提示：只提示，不阻断（琥珀色，不是报警红） */
.q-dev { font-size: 12.5px; line-height: 1.5; border-radius: 8px; padding: 8px 10px; background: #f4f8f5; color: #41604a; }
.q-dev.is-warn { background: #fff8e6; color: #8a6116; }

/* 客户分享页 */
.q-portal-total {
  display: flex; justify-content: space-between; align-items: baseline; gap: 10px;
  padding-bottom: 8px; border-bottom: 1px solid var(--line); margin-bottom: 6px;
}
.q-portal-total span { font-size: 13px; color: var(--muted); }
.q-portal-total b { font-size: 24px; font-weight: 700; color: var(--green-d); }
.q-scope { white-space: pre-wrap; line-height: 1.65; font-size: 13.5px; }
.q-link {
  width: 100%; margin-top: 8px; font-size: 12.5px; padding: 8px 10px;
  border: 1px solid var(--line); border-radius: 8px; background: #fafbfc;
}

/* 价目表行 */
.pb-rows { display: flex; flex-direction: column; gap: 10px; }
.pb-row {
  position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px 10px; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
}
.pb-cell { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.pb-lbl { font-size: 11.5px; color: var(--muted); }
.pb-cell select, .pb-cell input { width: 100%; }
.pb-pair { display: flex; align-items: center; gap: 4px; }
.pb-triple { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
.pb-note { grid-column: 1 / -1; }
.pb-del {
  position: absolute; right: 8px; top: 6px; border: 0; background: none;
  color: var(--muted); font-size: 13px; cursor: pointer; padding: 2px 4px;
}

/* 价目项选择弹层 */
.q-pick-list { display: flex; flex-direction: column; gap: 8px; max-height: 52vh; overflow: auto; }
.q-pick {
  display: flex; gap: 8px; align-items: flex-start; line-height: 1.5;
  border: 1px solid var(--line); border-radius: 10px; padding: 9px 10px; font-size: 13px;
}
.q-pick input { margin-top: 2px; }

@media (max-width: 640px) {
  .q-grid-3 { grid-template-columns: 1fr 1fr; }
  .pb-row { grid-template-columns: 1fr 1fr; }
  .q-form-actions { flex-direction: column; }
  .q-form-actions .btn { width: 100%; }
  .q-portal-total b { font-size: 21px; }
}

/* =========================================================================
 * 免费体验 14 天（20261108）
 * 首页/版本页顶部的倒计时横幅 + 升级页 + 平台看板体验期操作
 * ========================================================================= */

.trial-banner {
  border: 1px solid #c8e6c9;
  border-left: 4px solid var(--green);
  background: #f3faf3;
  border-radius: 12px;
  padding: 11px 13px;
  margin-bottom: 12px;
}
.trial-banner .tb-main {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.trial-banner .tb-title { font-size: 15px; font-weight: 700; color: var(--green-d); }
.trial-banner .tb-time { font-size: 11.5px; color: #6f8a76; }
.trial-banner .tb-sub { margin-top: 4px; font-size: 12.5px; color: #55705c; line-height: 1.5; }
.trial-banner .tb-sub b { color: var(--green-d); }
.trial-banner .tb-price { margin-top: 3px; font-size: 12px; color: #6f8a76; }
.trial-banner .tb-cta { margin-top: 9px; }

/* 剩余 3 天 / 1 天：琥珀色提示，强于常态但不到报警 */
.trial-banner.is-d3,
.trial-banner.is-d1 {
  border-color: #ffe0b2;
  border-left-color: var(--orange);
  background: #fff8ef;
}
.trial-banner.is-d3 .tb-title,
.trial-banner.is-d1 .tb-title { color: #bf5600; }
.trial-banner.is-d3 .tb-sub,
.trial-banner.is-d1 .tb-sub { color: #7a5a3a; }
.trial-banner.is-d3 .tb-time,
.trial-banner.is-d1 .tb-time { color: #a0713f; }

/* 当天到期 / 已到期：红色，文案明确「只拦新增，历史可读可导出」 */
.trial-banner.is-today,
.trial-banner.is-expired {
  border-color: #ffcdd2;
  border-left-color: var(--red);
  background: #fff5f5;
}
.trial-banner.is-today .tb-title,
.trial-banner.is-expired .tb-title { color: #b71c1c; }
.trial-banner.is-today .tb-sub,
.trial-banner.is-expired .tb-sub { color: #8a4a4a; }
.trial-banner.is-today .tb-time,
.trial-banner.is-expired .tb-time { color: #a15a5a; }
.trial-banner.is-expired .tb-sub b { color: #b71c1c; }

/* --------- 升级说明页 --------- */
.upgrade-hero {
  background: linear-gradient(135deg, #1b5e20, #388e3c);
  color: #fff;
  border-radius: var(--radius);
  padding: 16px 15px;
  margin-bottom: 12px;
}
.upgrade-hero.is-expired { background: linear-gradient(135deg, #8e2020, #c03636); }
.upgrade-hero .up-kicker { font-size: 11.5px; letter-spacing: .12em; opacity: .88; }
.upgrade-hero .up-title { font-size: 21px; font-weight: 700; margin: 3px 0 4px; }
.upgrade-hero .up-sub { font-size: 13px; line-height: 1.55; opacity: .95; }
.upgrade-hero .up-time { margin-top: 7px; font-size: 11.5px; opacity: .82; }
.upgrade-hero .btn { margin-top: 12px; }
.upgrade-hero .btn-primary { background: #fff; color: var(--green-d); }
.upgrade-hero.is-expired .btn-primary { background: #fff; color: #a32020; }
.upgrade-hero .btn-ghost { background: rgba(255, 255, 255, .14); color: #fff; border-color: rgba(255, 255, 255, .4); }

.up-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 2px 0 8px; }
.up-col { border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; background: #fafcfd; }
.up-col b { display: block; font-size: 13px; margin-bottom: 4px; }
.up-col ul { margin: 0; padding-left: 17px; }
.up-col li { font-size: 12.5px; color: #5b6b78; line-height: 1.65; }
.up-col.is-ok { border-color: #c8e6c9; background: #f5fbf5; }
.up-col.is-ok b { color: var(--green-d); }
.up-col.is-no { border-color: #ffe0b2; background: #fffaf3; }
.up-col.is-no b { color: #bf5600; }

/* 三档价格卡（升级说明页） */
.up-tiers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin: 4px 0 10px; }
.up-tier {
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 10px 11px;
  background: #fafcfd;
}
.up-tier.is-current { border-color: #c8e6c9; background: #f5fbf5; }
.up-tier-head { display: flex; align-items: center; justify-content: space-between; gap: 5px; }
.up-tier-head b { font-size: 14px; color: var(--green-d); }
.up-tier-price { margin: 3px 0 2px; font-size: 17px; font-weight: 700; color: #1f3327; }
.up-tier-meta { margin: 0; font-size: 11.5px; color: #6f7f89; }
.up-tier-desc { margin: 5px 0 0; font-size: 11.5px; color: #5b6b78; line-height: 1.55; }

/* --------- 平台看板：体验期一行与操作 --------- */
.pb-trial-ok { color: var(--green-d); font-weight: 600; }
.pb-trial-warn { color: #bf5600; font-weight: 600; }
.pb-trial-bad { color: var(--red); font-weight: 600; }
.pb-trial-hint { color: #9aa8b2; }
.pb-trial-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin: 6px 0 2px;
}
.pb-trial-actions-label { font-size: 11.5px; color: #9aa8b2; margin-right: 2px; }
.pb-trial-btn { padding: 2px 9px; font-size: 12px; }

@media (max-width: 640px) {
  .up-grid { grid-template-columns: 1fr; }
  .up-tiers { grid-template-columns: 1fr; }
}

/* =========================================================================
 * 首页待办筛选 / 搜索 与 附近客户（20261108）
 * 与已上线的客户列表 .cust-row / .row-nav / .nav-btn 共存，不改那些规则。
 * ========================================================================= */

/* 待办筛选条：chip 可换行（5 档在 390px 下横滑会把「合同将到期」藏到屏幕外），
 * 搜索框独占一行，宽度 100% 不撑破卡片 */
.todo-filter { display: flex; flex-direction: column; gap: 7px; margin-bottom: 10px; }
.todo-filter .chips { flex: none; flex-wrap: wrap; overflow: visible; }
/* 周期明细页的筛选条同上：chip 换行，别指望用户猜到右边还能横滑 */
#cy-chips { flex-wrap: wrap; overflow: visible; }
/* 客户列表工具栏：390px 下「附近客户」不能被挤成两行，搜索框让位 */
#c-nearby { flex: 0 0 auto; white-space: nowrap; }
.todo-search {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  padding: 8px 11px;
  font-size: 13.5px;
  outline: none;
  margin-bottom: 10px;
}
.todo-filter .todo-search { margin-bottom: 0; }
.todo-search:focus { border-color: #a5cdb0; }
/* 过滤结果数量提示（客户列表 / 周期服务） */
.list-count { margin: -4px 2px 8px; }

/* 附近客户：中心卡片 + 半径 chip + 距离列表 */
.nb-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.nb-center { min-width: 0; }
.nb-center b { display: block; font-size: 14.5px; margin-top: 2px; word-break: break-all; }
.nb-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.nb-search { margin: 12px 0 0; }
.nb-panel { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); }
.nb-err { margin-top: 8px; font-size: 12.5px; color: var(--red); }
.nb-pick-list { max-height: 240px; overflow: auto; margin: 6px 0 4px; }
.nb-pick-item {
  display: flex; width: 100%; align-items: baseline; justify-content: space-between; gap: 10px;
  padding: 9px 2px; border: none; background: none; text-align: left;
  border-bottom: 1px dashed var(--line);
}
.nb-pick-item:last-child { border-bottom: none; }
.nb-pick-item b { font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nb-pick-item span { flex: 0 0 auto; max-width: 55%; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nb-summary { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: baseline; font-size: 13px; color: var(--muted); margin: 10px 0; }
.nb-summary b { color: var(--ink); }
.nb-dist { color: var(--green-d); font-weight: 600; }
.nb-note { margin-top: 12px; font-size: 12.5px; color: var(--muted); }
.nb-miss { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.nb-miss button {
  border: 1px solid var(--line); background: #fff; border-radius: 999px;
  padding: 5px 10px; font-size: 12.5px; color: #55636e;
}
.nb-miss button:active { background: #f2f5f7; }
.nb-hint { padding: 18px 6px; }

/* =========================================================================
 * 报价列表行内「删除」按钮（2026-11-12 报价软删批次）
 * 行结构复用客户列表 .cust-row / .row-nav：.q-row 是进详情的按钮，删除按钮是
 * 它的兄弟节点，避免 button 嵌套。不改上面任何存量规则。
 * ========================================================================= */
.q-del-btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 7px 10px; border: 1px solid #f3d0d0; border-radius: 9px;
  background: #fff6f6; color: var(--red);
  font-size: 12.5px; font-weight: 600; line-height: 1.2; white-space: nowrap;
  cursor: pointer;
}
.q-del-btn:active { filter: brightness(.96); }
.q-del-btn.is-off { border-color: #e3e9ee; background: #f6f8fa; color: #9aa8b2; cursor: default; }
@media (max-width: 640px) {
  .q-del-btn { padding: 6px 8px; font-size: 12px; }
}

/* =========================================================================
 * 报价行项目（2026-11-15 第二批：可选 / 分组 / 折扣 / 查看回执）
 * 只新增类，不改上面第一批与软删批次的任何规则。
 * ========================================================================= */
.q-tag-opt {
  display: inline-block; margin-left: 6px; padding: 1px 6px;
  border-radius: 999px; background: #fff3e0; color: #ef6c00;
  font-size: 10.5px; font-weight: 600; vertical-align: middle;
}
.q-tag-grp {
  display: inline-block; margin-left: 6px; padding: 1px 6px;
  border-radius: 999px; background: #eef2f6; color: #546e7a;
  font-size: 10.5px; vertical-align: middle;
}
.q-check {
  display: flex; align-items: flex-start; gap: 7px;
  margin: 8px 0 2px; font-size: 12.5px; color: #55636e; line-height: 1.5;
}
.q-check input { margin-top: 2px; flex: 0 0 auto; }
.q-receipt { color: var(--green-d); }
.q-receipt.is-off { display: none; }

/* 详情页行项目 */
.q-detail-line {
  position: relative; padding: 9px 92px 9px 0;
  border-bottom: 1px dashed var(--line);
}
.q-detail-line:last-child { border-bottom: none; }
.q-detail-main { font-size: 13.5px; font-weight: 600; word-break: break-all; }
.q-detail-sub { margin-top: 3px; font-size: 12px; color: var(--muted); line-height: 1.5; }
.q-detail-amt {
  position: absolute; right: 0; top: 10px;
  font-size: 13.5px; font-weight: 700; color: var(--green-d); white-space: nowrap;
}

/* 客户分享页：单行项目卡片 + 可选勾选 */
.q-portal-item { padding: 11px 12px; }
.q-portal-item + .q-portal-item { margin-top: 8px; }
.q-portal-item.is-opt { border-left: 3px solid #ffb74d; }
.q-portal-item-top { display: flex; align-items: flex-start; gap: 9px; }
.q-portal-pick { flex: 0 0 auto; display: flex; align-items: center; margin-top: 2px; }
.q-portal-pick input { width: 18px; height: 18px; }
.q-portal-item-main { flex: 1; min-width: 0; }
.q-portal-item-name { font-size: 13.5px; font-weight: 600; line-height: 1.45; word-break: break-all; }
.q-portal-item-sub { margin-top: 3px; font-size: 12px; color: var(--muted); line-height: 1.5; }
.q-portal-item-amt {
  flex: 0 0 auto; font-size: 13.5px; font-weight: 700;
  color: var(--green-d); white-space: nowrap; transition: color .15s, opacity .15s;
}
.q-portal-item-amt.is-off { color: #b0bec5; text-decoration: line-through; opacity: .75; }
.q-portal-deposit { border-top: 1px dashed var(--line); margin-top: 6px; padding-top: 7px; }

@media (max-width: 640px) {
  .q-detail-line { padding-right: 84px; }
  .q-portal-item { padding: 10px; }
}

/* ---------- 包年报价方案向导（quote.annual.js + views.quote.js） ----------
 * sheet-body 本身没有高度上限，长表单必须自带滚动容器，否则手机端会顶出屏幕。 */
/* 参数区与预览区是兄弟节点，各自限高：预览若放进滚动容器并 sticky，
 * 其自身高度超过容器时会把参数表单整块盖住（390px 实测）。 */
.aw-body { max-height: 42vh; overflow-y: auto; -webkit-overflow-scrolling: touch; padding-right: 2px; }
.aw-sec { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px 2px; margin-bottom: 10px; }
.aw-sec h4 { font-size: 13.5px; font-weight: 700; color: var(--green-d); margin: 0 0 10px; }
.aw-sec .grid-2 { gap: 0 10px; }
.aw-sec .field { margin-bottom: 10px; }
.aw-sec .field .lbl { font-size: 12px; margin-bottom: 3px; }
.aw-sec .field input, .aw-sec .field select { font-size: 13px; }
.aw-check { display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; color: #455a64; margin: 2px 0 10px; line-height: 1.5; }
.aw-check input { margin-top: 2px; flex: 0 0 auto; }
.aw-radios { display: flex; gap: 14px; flex-wrap: wrap; margin: 2px 0 10px; }
.aw-radios label { display: flex; gap: 6px; align-items: center; font-size: 12.5px; }
.aw-fold details { font-size: 12.5px; }
.aw-fold summary { cursor: pointer; color: var(--green-d); font-weight: 600; padding: 4px 0 10px; }
.aw-fold .grid-2 { margin-top: 6px; }
.aw-derived { background: #eef4f0; border-radius: 8px; padding: 7px 9px; margin: 6px 0; line-height: 1.6; }
.aw-preview { max-height: 30vh; overflow-y: auto; background: #f7faf8; border: 1px solid #d8e8dd; border-radius: 10px; padding: 10px 12px; margin-top: 8px; font-size: 12.5px; }
.aw-pre-row { display: flex; justify-content: space-between; gap: 10px; padding: 2px 0; }
.aw-pre-row b { font-weight: 600; white-space: nowrap; }
.aw-pre-total { display: flex; justify-content: space-between; align-items: baseline; border-top: 1px dashed #bcd6c5; margin-top: 6px; padding-top: 7px; }
.aw-pre-total b { font-size: 20px; color: var(--green-d); font-weight: 700; }
.aw-warn { background: #fff4e5; color: #8a5312; border-radius: 8px; padding: 8px 10px; line-height: 1.55; margin-top: 8px; }
.aw-muted { color: var(--muted); font-size: 11.5px; line-height: 1.5; margin-top: 6px; }
@media (max-width: 640px) {
  .aw-body { max-height: 38vh; }
  .aw-preview { max-height: 28vh; }
  .q-toolbar-annual { flex-wrap: wrap; }
  .q-toolbar-annual .search { flex: 1 1 100%; }
}

/* ---------- 套餐档位 / 附件 chip / 电子签名（20261115 整合批次） ---------- */
.q-tier-box { border: 1px dashed var(--line); border-radius: 10px; padding: 10px 12px 6px; margin-bottom: 12px; background: #fbfdfb; }
.q-tier-head { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; margin-bottom: 8px; }
.q-tier-head .lbl { font-size: 13px; font-weight: 600; color: #37474f; }
.q-tier-head .muted { font-size: 11.5px; }
.q-tier-box .seg { margin-bottom: 6px; }
.q-tier-box > .muted { font-size: 11.5px; line-height: 1.5; margin: 2px 0 8px; }
.q-attach { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 10px; }
.q-attach-chip { font-size: 12px; color: #41604a; background: #eef4f0; border: 1px solid #d8e8dd; border-radius: 999px; padding: 3px 9px; word-break: break-all; }
.q-sign-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; margin: 4px 0 6px; font-size: 13px; }
.q-sign-head .muted { font-size: 11.5px; }
.q-sign-canvas { display: block; width: 100%; height: auto; max-height: 220px; background: #fff; border: 1px solid var(--line); border-radius: 10px; touch-action: none; box-shadow: inset 0 0 0 1px #f2f6f4; }
.q-sign-box { margin-top: 10px; border-top: 1px dashed var(--line); padding-top: 8px; }
.q-sign-box > .muted { display: block; font-size: 11.5px; margin-bottom: 4px; }
.q-sign-img { display: block; width: 220px; max-width: 100%; height: auto; background: #fff; border: 1px solid #e3e9ee; border-radius: 8px; }
/* 报价表单：客户搜索框 + 就地建档引导（s 批） */
.q-cust-search { width: 100%; flex: none; margin: 0 0 10px; font-size: 13px; }
#qf-cust-hint .hint-card { margin-top: 10px; }
@media (max-width: 640px) {
  .q-cust-search { padding: 9px 11px; }
}

@media (max-width: 640px) {
  .q-tier-box .seg-btn { padding-left: 8px; padding-right: 8px; font-size: 12px; }
  .q-sign-canvas { max-height: 180px; }
  /* 服务项目工具栏有 3 个按钮（含「包年方案向导」），390px 下必须允许换行，
   * 否则按钮把 .q-form 撑宽，整页出现 32px 横向滚动。 */
  .q-form .toolbar { flex-wrap: wrap; }
}

/* ===== t 批：服务范围自动填写 + 客户已接受报价可删 ===== */
.q-scope-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.q-scope-tools .lbl { display: inline; margin: 0; font-size: 13px; font-weight: 600; color: #37474f; }
.q-scope-tools .q-check { margin: 0; flex: 0 0 auto; }
.q-scope-tools .btn-mini { flex: 0 0 auto; margin-left: auto; }
.q-scope-hint { margin: 5px 0 0; font-size: 11.5px; color: #7b8894; line-height: 1.55; }
.q-scope-hint.is-manual { color: #b26a00; }
/* 已接受单据的删除按钮：仍是同一个「删除」，暖红底提示弹层里有风险说明；
 * v 批改为单次确认，不再要求输入「删除」二字（手机输入法下极易卡住）。 */
.q-del-btn.is-risk { border-color: #e8a9a9; background: #fff0f0; color: #c0392b; }
.q-del-warn {
  background: #fff6e8; border: 1px solid #ffdca8; color: #8a5a00;
  border-radius: 10px; padding: 9px 11px; font-size: 12.5px;
  line-height: 1.7; margin: 0 0 12px;
}
/* 报价列表版本标记：用于一眼分辨「功能已上线但浏览器还吃旧缓存」。 */
.q-ver {
  flex: 0 0 auto; align-self: center; margin-left: auto; padding-left: 8px;
  font-size: 11px; line-height: 1.2; color: #9aa8b2; white-space: nowrap;
}
@media (max-width: 640px) {
  .q-scope-tools { gap: 8px; }
  .q-scope-tools .btn-mini { margin-left: 0; }
  .q-ver { font-size: 10.5px; padding-left: 4px; }
}

/* ===== w 批：删除链路诊断与已转合同单据 ===== */
/* 已转合同也允许软删，但用琥珀色区别于已接受的暖红底，避免误以为同类风险。 */
.q-del-btn.is-warn { border-color: #e8c98a; background: #fff7e6; color: #9a6300; }
.q-del-diag {
  list-style: none; margin: 0 0 12px; padding: 8px 10px;
  background: #f6f8fa; border: 1px solid #e3e9ee; border-radius: 10px;
  font-size: 12px; line-height: 1.75; color: #37474f;
  word-break: break-word;
}
.q-del-diag li + li { margin-top: 4px; padding-top: 4px; border-top: 1px dashed #e3e9ee; }

/* ---------- AI 报价（z 批：AI 助手 → AI 报价 Tab） ---------- */
.ai-verify {
  display: inline-block; margin-left: 4px; padding: 1px 6px;
  font-size: 11px; line-height: 1.5; font-weight: 600;
  color: #8d6e00; background: #fff8e1; border: 1px solid #f0d88a;
  border-radius: 999px; vertical-align: middle;
}
.aq-checks {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 12px;
}
.aq-result { margin-top: 12px; }
@media (max-width: 620px) {
  .aq-checks { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- 常规加购目录 + 手动添加项目（aa 批 20261115k） ---------- */
.aq-extras { display: flex; flex-direction: column; gap: 6px; }
.aq-xrow {
  display: grid; align-items: center; gap: 8px;
  grid-template-columns: auto minmax(0, 1fr) 64px 30px 118px auto;
  padding: 6px 8px; border: 1px solid #e3e9ee; border-radius: 8px;
  background: #fbfcfd;
}
.aq-xrow.is-on { border-color: #9fc3e8; background: #f2f8fd; }
.aq-x-name {
  font-size: 13px; color: #263238; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.aq-x-qty, .aq-x-price, .aq-m-qty, .aq-m-price, .aq-m-unit {
  width: 100%; min-width: 0; padding: 4px 6px; font-size: 13px;
  border: 1px solid #d7e0e7; border-radius: 6px;
}
.aq-x-unit, .aq-x-price-w { font-size: 12px; color: #55636e; white-space: nowrap; }
.aq-x-price-w { display: inline-flex; align-items: center; gap: 3px; }
.aq-m-row { grid-template-columns: 64px minmax(0, 1fr) 56px 64px 118px 96px; background: #fff; }
.aq-m-name {
  padding: 4px 6px; font-size: 13px; width: 100%; min-width: 0;
  border: 1px solid #d7e0e7; border-radius: 6px;
}
.aq-m-bill { padding: 4px 4px; font-size: 12px; border: 1px solid #d7e0e7; border-radius: 6px; }
.aq-x-del {
  padding: 3px 8px; font-size: 12px; color: #b26a00;
  background: #fff4e3; border: 1px solid #f0d88a; border-radius: 6px;
}
@media (max-width: 620px) {
  .aq-xrow { grid-template-columns: auto minmax(0, 1fr) 60px 26px 108px; }
  .aq-xrow .ai-verify { display: none; }
  .aq-m-row { grid-template-columns: 56px minmax(0, 1fr) 56px 60px 108px; }
  .aq-m-bill { display: none; }
}


