/* ============================================================
   审批中心 · 新版界面 · 设计令牌（唯一颜色/尺寸来源）
   规则：页面里不许再出现 #xxxxxx 硬编码颜色，一律用 var(--...)
   ============================================================ */

:root {
  /* ---------- 品牌色 ---------- */
  --brand:        #2f6bf6;   /* 主色（蓝） */
  --brand-dark:   #2456cc;
  --brand-soft:   #eaf1ff;   /* 主色浅底，用于选中态 */
  --brand-ink:    #1b3f8f;   /* 主色深字 */

  /* ---------- 语义色 ---------- */
  --ok:      #1a9d57;  --ok-soft:  #e7f6ee;
  --warn:    #d9822b;  --warn-soft:#fdf1e3;
  --danger:  #d84a4a;  --danger-soft:#fbecec;
  --info:    #4a7ba8;  --info-soft:  #eef3f8;

  /* ---------- 中性色阶（从深到浅，只有这 7 档） ---------- */
  --ink-1: #1c2128;   /* 正文标题 */
  --ink-2: #49525e;   /* 次级正文 */
  --ink-3: #858d99;   /* 辅助说明、时间 */
  --ink-4: #b6bcc6;   /* 占位符、禁用 */
  --line:  #e6e8ee;   /* 分隔线 */
  --line-soft: #f0f2f6;
  --bg:    #f4f6fa;   /* 页面底色 */
  --panel: #ffffff;   /* 卡片 */

  /* ---------- 通知（沿用现场管理的黄底公告） ---------- */
  --notice-bg:   #fff8e8;
  --notice-line: #ffe0a3;
  --notice-ink:  #8a5a12;

  /* ---------- 九宫格：每个申请项一个专属色（替代丑 emoji） ---------- */
  --t-xc-feiyong:   #2f6bf6;  /* 现场费用付款 */
  --t-xc-caigou:    #0f9b8e;  /* 现场采购付款 */
  --t-fenbao:       #5b57d1;  /* 分包工程付款 */
  --t-beiyongjin:   #1a9d57;  /* 现场备用金 */
  --t-ry-baoxiao:   #7a8a2e;  /* 备用金日常报销 */
  --t-gs-caigou:    #2f8fd6;  /* 公司采购付款 */
  --t-gs-feiyong:   #4a7ba8;  /* 公司费用付款 */
  --t-bm-beiyongjin:#c07f2e;  /* 部门备用金 */
  --t-bm-baoxiao:   #8a6bbf;  /* 部门报销 */

  /* ---------- 尺寸：8px 基准 ---------- */
  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px;  --sp-4: 16px;
  --sp-5: 20px; --sp-6: 24px; --sp-8: 32px;

  --r-s: 8px; --r-m: 12px; --r-l: 16px; --r-full: 999px;

  /* ---------- 字号（一律照现场管理小程序：28rpx = 14px 是正文/表单字段） ---------- */
  --fs-xs: 11px;   /* 辅助说明、时间   = 22rpx */
  --fs-s:  12.5px; /* 九宫格短名、次要正文 = 25rpx */
  --fs-m:  14px;   /* 正文、表单字段、字段名 = 28rpx */
  --fs-l:  17px;   /* 表单页大标题、导航标题 = 34rpx */
  --fs-xl: 19px;   /* 单号、金额 = 38rpx */
  --fs-sec:18px;   /* 分组大标题 = 36rpx */
  --fs-xxl:27px;   /* 封面大标题 = 54rpx */

  /* ---------- 阴影（只有两档） ---------- */
  --sh-1: 0 1px 2px rgba(28,33,40,.06);
  --sh-2: 0 2px 12px rgba(28,33,40,.10);

  /* ---------- 布局 ---------- */
  --screen-w: 100%;         /* 手机上铺满屏幕；原来固定 375px，390/414/430 的手机两边会留灰边、看着像没适配 */
  --screen-w-wide: 560px;   /* 电脑上打开的宽度（比手机宽一截，列表和九宫格看得清） */
  --tabbar-h: calc(56px + env(safe-area-inset-bottom));   /* 底部导航 + iPhone 底部安全区 */
  --navbar-h: 48px;
  --pad: var(--sp-4);       /* 左右内缩，全站统一 */
}

/* ============ 基础 ============ */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; padding: 0;
  background: #dfe3ea;                 /* 电脑上的外围底色 */
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC",
               "Microsoft YaHei", "Helvetica Neue", sans-serif;
  color: var(--ink-1);
  font-size: var(--fs-m);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  /* 企微/微信内置浏览器会按系统字号放大网页字体，加上这两条按设备宽度原样渲染 */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* 电脑打开时固定宽度、居中；手机上自动满屏 */
.screen {
  width: 100%;
  max-width: var(--screen-w);
  min-height: 100vh;
  margin: 0 auto;
  background: var(--bg);
  position: relative;
  display: flex;
  flex-direction: column;
}
/* 电脑上看：整块居中、固定宽度，四周留灰底，像一台手机 */
@media (min-width: 480px) {
  /* 电脑上打开：手机屏宽换成更宽的那档（--screen-w 是 .screen / .tabbar / 弹层共用的） */
  :root { --screen-w: var(--screen-w-wide); }
  body { background: #d9dde5; }
  .screen {
    min-height: calc(100vh - 48px);
    margin: 24px auto;
    border-radius: var(--r-l);
    box-shadow: var(--sh-2);
    overflow: hidden;
  }
}

/* 内容区：底部给 tabbar 让出空间 */
.view {
  flex: 1;
  padding-bottom: calc(var(--tabbar-h) + var(--sp-4));
}
/* 子页（详情/发起表单）没有 tabbar */
.view.no-tabbar { padding-bottom: var(--sp-6); }

/* ============ 顶栏 ============ */
.navbar {
  height: var(--navbar-h);
  display: flex; align-items: center; gap: var(--sp-2);
  padding: 0 var(--pad);
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 30;
  font-size: var(--fs-l); font-weight: 600;
}
.navbar .back {
  color: var(--brand); font-weight: 500;
  font-size: var(--fs-m);
  padding: 0 var(--sp-2) 0 0;
  cursor: pointer;
}
.navbar .nav-title { flex: 1; text-align: center; padding-right: 40px; }
.navbar .nav-act { color: var(--brand); font-size: var(--fs-s); font-weight: 500; cursor: pointer; }

/* 主屏的封面（不是导航栏，是页面第一块）：居中排版 */
.cover {
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  color: #fff;
  padding: var(--sp-4) var(--pad) var(--sp-4);
  text-align: center;
  position: relative;          /* 姓名·角色靠右上角绝对定位（原来是标题下面一行，页头太高） */
}
.cover h1 { margin: 0; font-size: var(--fs-xxl); letter-spacing: 3px; font-weight: 700; }
.cover .sub { margin-top: var(--sp-1); font-size: var(--fs-s); opacity: .85; letter-spacing: 1px; }
/* 当前身份（姓名 · 角色）：放页头右下角的小胶囊，不再占一行高度 */
.cover .who {
  position: absolute;
  bottom: var(--sp-3);
  right: var(--pad);
  padding: 3px 10px;
  font-size: var(--fs-s);
  line-height: 1.4;
  white-space: nowrap;
  background: rgba(255, 255, 255, .16);
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: var(--r-full);
}

/* iOS / 企微 webview：输入框字号 < 16px 时聚焦会把整页放大，看着也像"没适配手机"。
   手机上把可聚焦控件的字号提到 16px（这是各家 H5 的标准做法；桌面端不受影响）。 */
@media (max-width: 479px) {
  /* 必须有 !important：下面表单/表格里各处对 input 的字号声明更具体，不然盖不过来 */
  html body input, html body select, html body textarea { font-size: 16px !important; }
}

/* ============ 通知栏（财务发的公告） ============ */
.notice-bar {
  display: flex; align-items: center; gap: var(--sp-2);
  margin: var(--sp-3) var(--pad) 0;
  padding: var(--sp-3) var(--sp-3);
  background: var(--notice-bg);
  border: 1px solid var(--notice-line);
  border-radius: var(--r-m);
  color: var(--notice-ink);
  font-size: var(--fs-s);
  cursor: pointer;
}
.notice-bar .nb-tag {
  flex: none; font-size: var(--fs-xs); font-weight: 700;
  background: var(--warn); color: #fff;
  padding: 2px 6px; border-radius: var(--r-s);
}
.notice-bar .nb-text {
  flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.notice-bar .nb-more { flex: none; color: var(--notice-ink); opacity: .75; font-size: var(--fs-xs); }

/* ============ 区块 ============ */
.section { margin-top: var(--sp-5); }
.section-title {
  display: flex; align-items: center; gap: var(--sp-2);
  padding: 0 var(--pad) var(--sp-2);
  font-size: var(--fs-m); font-weight: 700; color: var(--ink-1);
}
.section-title::before {
  content: ""; width: 3px; height: 14px; border-radius: 2px;
  background: var(--brand);
}
.section-title .count {
  font-size: var(--fs-xs); font-weight: 600; color: #fff;
  background: var(--danger); border-radius: var(--r-full);
  padding: 1px 7px; margin-left: var(--sp-1);
}
.section-title .more {
  margin-left: auto; font-size: var(--fs-s); font-weight: 500;
  color: var(--ink-3); cursor: pointer;
}

/* ============ 卡片 ============ */
.card {
  background: var(--panel);
  border-radius: var(--r-m);
  box-shadow: var(--sh-1);
  margin: 0 var(--pad);
  overflow: hidden;
}

/* ============ 分组大标题（照现场管理：居中标题 + 灰/蓝/灰三段横线） ============ */
.section.group {
  margin: var(--sp-5) var(--pad) 0;
  padding: var(--sp-4) var(--sp-3) var(--sp-2);
  background: var(--panel);
  border-radius: var(--r-m) var(--r-m) 0 0;
  box-shadow: var(--sh-1);
}
.g-title {
  text-align: center; font-size: var(--fs-sec); font-weight: 700;
  letter-spacing: 2px; color: var(--ink-1);
}
.section-bars { display: flex; align-items: center; justify-content: center; margin-top: var(--sp-2); }
.bar-gray { flex: 1; height: 1px; background: var(--line); }
.bar-blue { flex: none; width: 90px; height: 3px; border-radius: 2px; background: var(--brand); margin: 0 6px; }

/* ============ 九宫格（发起申请 / 管理入口） ============
   照现场管理：3 列、格子之间用细线分隔、48px 圆角标志块 + 一行短名 */
.grid {
  display: flex; flex-wrap: wrap;
  background: var(--panel);
  padding: var(--sp-1) 0 var(--sp-3);
}
.grid.home {
  margin: 0 var(--pad);
  border-radius: 0 0 var(--r-m) var(--r-m);
  overflow: hidden;
  box-shadow: var(--sh-1);
}
.grid-cell {
  width: 33.3333%; box-sizing: border-box;
  display: flex; flex-direction: column; align-items: center;
  padding: 15px 5px;
  border-right: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  cursor: pointer; text-align: center;
}
.grid-cell:nth-child(3n) { border-right: 0; }
.grid-cell:active { background: #f7f9fc; }
/* 标志块：专属色渐变圆角块 + 白线条图标（现场管理那套 png 图标的路子，但内置 SVG，不依赖图片） */
.grid-cell .mark, .mark {
  width: 48px; height: 48px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  background: linear-gradient(150deg, color-mix(in srgb, var(--c, var(--brand)) 78%, #fff), var(--c, var(--brand)));
  box-shadow: 0 3px 8px color-mix(in srgb, var(--c, var(--brand)) 28%, transparent);
}
.grid-cell .mark svg, .mark svg { width: 26px; height: 26px; display: block; }
/* 老浏览器不支持 color-mix：退回实色 + 普通投影 */
@supports not (color: color-mix(in srgb, red 12%, #fff)) {
  .grid-cell .mark, .mark { background: var(--c, var(--brand)); box-shadow: none; }
}
/* 「新增申请表」那一格 */
.mark.add { background: var(--line-soft); color: var(--ink-3); box-shadow: none; }
.grid-cell .label {
  font-size: var(--fs-s); color: var(--ink-1); line-height: 1.35; padding: 0 4px;
  margin-top: var(--sp-2);
}
/* 列表行里的小标志（26px，跟现场管理的列表图标一个尺寸感） */
.mark.mini {
  width: 26px; height: 26px; border-radius: 7px; flex: none;
  box-shadow: none;
}
.mark.mini svg { width: 15px; height: 15px; }
/* 管理九宫格：比申请入口小一点，更像工具 */
.grid.admin .mark { width: 42px; height: 42px; border-radius: 11px; }
.grid.admin .mark svg { width: 22px; height: 22px; }

/* ============ 列表项 ============ */
.list-item {
  display: block; width: 100%;
  padding: var(--sp-3) var(--pad);
  background: var(--panel);
  border: 0; border-bottom: 1px solid var(--line);
  text-align: left; font: inherit; color: inherit;
  cursor: pointer;
}
.list-item:last-child { border-bottom: 0; }
.list-item:active { background: var(--line-soft); }
.li-top { display: flex; align-items: center; gap: var(--sp-2); }
.li-title {
  flex: 1; min-width: 0;
  font-size: var(--fs-m); font-weight: 600; color: var(--ink-1);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.li-money {
  flex: none; font-size: var(--fs-m); font-weight: 700;
  color: var(--ink-1); font-variant-numeric: tabular-nums;
}
.li-sub {
  margin-top: var(--sp-1);
  display: flex; align-items: center; gap: var(--sp-2);
  font-size: var(--fs-xs); color: var(--ink-3);
}
.li-sub .dot { color: var(--ink-4); }
.li-sub .node { color: var(--ink-2); }
/* 行里第二排（单号/时间/节点 + 右边标志或按钮） */
.li-top.line2 { margin-top: var(--sp-1); }
.li-top.line2 .li-sub {
  margin-top: 0;
  flex: 1; min-width: 0;
  overflow: hidden; white-space: nowrap;
}
/* 标题后面跟的灰色人名 */
.li-who { color: var(--ink-3); font-weight: 500; }

/* 状态徽章（批准 / 驳回 / 已付款 就靠这些标志，不再单开「抄送我的」一栏） */
.badge {
  flex: none; font-size: var(--fs-xs); font-weight: 600;
  padding: 2px 7px; border-radius: var(--r-s);
}
.st-todo  { background: var(--warn-soft);   color: var(--warn); }
/* 待付款：样式跟「已付款」一模一样（实心、白字），只换颜色 —— 橙色=等着处理，绿色=已付完 */
.st-pay   { background: var(--warn); color: #fff; }
.st-back  { background: var(--danger-soft); color: var(--danger); }
.st-draft { background: var(--line-soft);   color: var(--ink-3); }
.st-cc    { background: var(--info-soft);   color: var(--info); }
/* 已付款：实心绿，一眼能看见（申请人、中间审批者、总经理的列表里都出现这个） */
.st-paid  { background: var(--ok); color: #fff; }

/* 未读小红点（列表行里用，公告标题前也用） */
.dot-red {
  flex: none; width: 8px; height: 8px; border-radius: 50%;
  background: var(--danger);
  display: inline-block; vertical-align: middle; margin-right: 6px;
}

/* ============ 公告页 ============ */
/* 未读的那条浅蓝底，一眼看得出哪条没读 */
.notice-row.unread { background: var(--brand-soft); }
.notice-row { cursor: pointer; }
.notice-row:active { background: var(--line-soft); }
.unread-tag {
  margin-left: var(--sp-2);
  font-size: var(--fs-xs); font-weight: 600; color: var(--danger);
}
/* 已发公告每条下面的「修改 / 撤下」 */
.notice-acts { display: flex; gap: var(--sp-2); margin-top: var(--sp-2); }

/* ============ 空状态 ============ */
.empty {
  padding: var(--sp-8) var(--pad);
  text-align: center; color: var(--ink-3); font-size: var(--fs-s);
}

/* ============ 底部导航 ============ */
.tabbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: var(--screen-w); max-width: 100%;
  height: var(--tabbar-h);
  display: flex;
  background: var(--panel);
  border-top: 1px solid var(--line);
  z-index: 40;
}
@media (min-width: 480px) {
  .tabbar { border-radius: 0 0 var(--r-l) var(--r-l); }
}
.tab {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 2px;
  color: var(--ink-3); font-size: var(--fs-xs);
  cursor: pointer; border: 0; background: none; font-family: inherit;
  position: relative;
}
.tab .tab-ico { display: flex; align-items: center; justify-content: center; height: 22px; }
.tab .tab-ico svg { width: 21px; height: 21px; display: block; }
.tab.on { color: var(--brand); font-weight: 600; }
.tab .tab-badge {
  position: absolute; top: 4px; left: calc(50% + 8px);
  min-width: 16px; height: 16px; padding: 0 4px;
  background: var(--danger); color: #fff;
  font-size: 10px; font-weight: 700; line-height: 16px;
  border-radius: var(--r-full);
}

/* ============ 查询页 tab ============ */
.seg {
  display: flex; gap: var(--sp-1);
  padding: var(--sp-2) var(--pad);
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.seg::-webkit-scrollbar { display: none; }
.seg button {
  flex: none; padding: 6px 12px;
  border: 0; border-radius: var(--r-full);
  background: var(--line-soft); color: var(--ink-2);
  font: inherit; font-size: var(--fs-s); cursor: pointer;
}
.seg button.on { background: var(--brand); color: #fff; font-weight: 600; }
.seg button .n { opacity: .8; font-size: var(--fs-xs); }

/* 长列表分页：上一页 / 下一页 */
.pager {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2);
  padding: var(--sp-3) var(--pad) var(--sp-4);
}
.pager .pg { font-size: var(--fs-xs); color: var(--ink-3); }
.pager .btn.sm[disabled] { opacity: .45; }

/* 搜索框 */
.search {
  display: flex; align-items: center; gap: var(--sp-2);
  margin: var(--sp-3) var(--pad);
  padding: var(--sp-2) var(--sp-3);
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--r-full);
  color: var(--ink-3); font-size: var(--fs-s);
}
.search input {
  flex: 1; border: 0; outline: 0; background: none;
  font: inherit; font-size: var(--fs-m); color: var(--ink-1);
}
.search .s-ico { display: flex; color: var(--ink-3); }
.search .s-ico svg { width: 16px; height: 16px; display: block; }

/* ============ 我的页 ============ */
.me-head {
  padding: var(--sp-5) var(--pad);
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: var(--sp-3);
}
.avatar {
  width: 52px; height: 52px; border-radius: var(--r-m);
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  color: #fff; font-size: 20px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex: none;
}
.me-head .m-name { font-size: var(--fs-l); font-weight: 700; }
.me-head .m-meta { font-size: var(--fs-s); color: var(--ink-3); margin-top: 2px; }
/* 五个角色各自的颜色：现场 / 职员 / 总经办 / 财务 / 总经理 */
.role-chip {
  display: inline-block; margin-top: var(--sp-2);
  font-size: var(--fs-xs); font-weight: 600;
  padding: 2px 8px; border-radius: var(--r-s);
  background: var(--brand-soft); color: var(--brand-ink);
}
.role-chip.site    { background: #eef1f8;          color: #3d4a63; }
.role-chip.staff   { background: var(--brand-soft); color: var(--brand-ink); }
.role-chip.office  { background: #eae9fb;          color: #4a46b8; }
.role-chip.finance { background: var(--ok-soft);    color: var(--ok); }
.role-chip.admin   { background: var(--warn-soft);  color: var(--warn); }

/* 键值行 */
.kv {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-3) var(--pad);
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  font-size: var(--fs-m);
}
.kv:last-child { border-bottom: 0; }
.kv .k { flex: none; width: 84px; color: var(--ink-3); font-size: var(--fs-s); }
.kv .v { flex: 1; min-width: 0; color: var(--ink-1); }
.kv .go { color: var(--ink-4); font-size: 16px; }
.kv.clickable { cursor: pointer; }
.kv.clickable:active { background: var(--line-soft); }

/* ============ 表单（发起申请 / 发通知） ============ */
.fi {
  display: flex; flex-direction: column; gap: var(--sp-1);
  padding: var(--sp-3) var(--pad);
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}
.fi:last-child { border-bottom: 0; }
.fi > label { font-size: var(--fs-s); color: var(--ink-2); }
.fi .req { color: var(--danger); }
.fi input[type=text], .fi input[type=number], .fi textarea, .fi select {
  border: 0; outline: 0; background: none;
  font: inherit; font-size: var(--fs-m); color: var(--ink-1);
  padding: 0; width: 100%; resize: none;
}
.fi textarea { min-height: 72px; line-height: 1.6; }
.fi .hint { font-size: var(--fs-xs); color: var(--ink-3); }

/* 金额输入 */
.fi.money input { font-size: var(--fs-xl); font-weight: 700; font-variant-numeric: tabular-nums; }
.fi.money { flex-direction: row; align-items: center; }
.fi.money .cur { color: var(--ink-2); font-size: var(--fs-l); font-weight: 700; }

/* 明细表 */
.tbl { background: var(--panel); }
.tbl-row {
  display: grid; grid-template-columns: 1fr 96px 72px 28px;
  gap: var(--sp-2); align-items: center;
  padding: var(--sp-2) var(--pad);
  border-bottom: 1px solid var(--line);
  font-size: var(--fs-s);
}
.tbl-row.head {
  background: var(--line-soft); color: var(--ink-3);
  font-size: var(--fs-xs); font-weight: 600;
}
/* 「+ 添加一行」整行跨满 */
.tbl-row.add { display: block; text-align: center; }
.tbl-row.add .del { color: var(--brand); font-weight: 600; }
.tbl-row input {
  border: 0; outline: 0; background: none; font: inherit; color: var(--ink-1);
  width: 100%;
}
.tbl-row .num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl-row .del { color: var(--ink-4); text-align: center; cursor: pointer; }
.tbl-sum {
  display: flex; justify-content: flex-end; gap: var(--sp-2);
  padding: var(--sp-3) var(--pad);
  font-size: var(--fs-m); font-weight: 700;
  background: var(--panel);
}

/* 提交条 */
.submit-bar {
  position: sticky; bottom: 0;
  padding: var(--sp-3) var(--pad);
  background: var(--panel);
  border-top: 1px solid var(--line);
  display: flex; gap: var(--sp-3);
}
.btn {
  flex: 1; padding: var(--sp-3);
  border: 0; border-radius: var(--r-m);
  background: var(--brand); color: #fff;
  font: inherit; font-size: var(--fs-m); font-weight: 600;
  cursor: pointer;
}
.btn:active { background: var(--brand-dark); }
.btn.ghost { background: var(--line-soft); color: var(--ink-2); }
.btn.ok    { background: var(--ok); }
.btn.danger{ background: var(--danger); }
.btn.sm { flex: none; padding: 6px 14px; font-size: var(--fs-s); }

/* ============ 弹层 ============ */
.mask {
  position: fixed; inset: 0; background: rgba(28,33,40,.45);
  display: flex; align-items: flex-end; justify-content: center;
  z-index: 60;
}
.sheet {
  width: var(--screen-w); max-width: 100%;
  background: var(--panel);
  border-radius: var(--r-l) var(--r-l) 0 0;
  max-height: 78vh; overflow: auto;
  padding-bottom: var(--sp-4);
}
.sheet-head {
  position: sticky; top: 0;
  padding: var(--sp-4) var(--pad) var(--sp-2);
  background: var(--panel);
  font-size: var(--fs-l); font-weight: 700;
  display: flex; align-items: center;
}
.sheet-head .x { margin-left: auto; color: var(--ink-3); cursor: pointer; font-weight: 400; }
.opt {
  padding: var(--sp-3) var(--pad);
  border-bottom: 1px solid var(--line);
  font-size: var(--fs-m); cursor: pointer;
}
.opt:active { background: var(--line-soft); }
.opt.on { color: var(--brand); font-weight: 600; }

/* toast */
.toast {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--tabbar-h) + 24px);
  padding: var(--sp-2) var(--sp-4);
  background: rgba(28,33,40,.9); color: #fff;
  border-radius: var(--r-full); font-size: var(--fs-s);
  z-index: 80; pointer-events: none;
}


/* ============ 真表单（按 form_json 渲染） ============ */
.tb-block { border-top: 1px dashed var(--line); padding-top: var(--sp-2); margin-top: var(--sp-2); }
.tb-block:first-child { border-top: 0; margin-top: 0; padding-top: 0; }
.tb-head { display: flex; align-items: center; justify-content: space-between; font-size: var(--fs-xs); color: var(--ink-3); }
.add-row {
  display: block; text-align: center; padding: var(--sp-3) 0;
  color: var(--brand); font-size: var(--fs-s); font-weight: 600; cursor: pointer;
}
.add-row .del, .file-row .del { color: var(--danger); font-weight: 500; cursor: pointer; }
.file-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--sp-2) 0; border-bottom: 1px solid var(--line-soft); font-size: var(--fs-s);
}
.money-in { font-size: var(--fs-l); font-weight: 700; }


/* ============ 未登录：扫码登录页 ============ */
/* 登录页：紧凑一点（二维码面板本身就有 300px 高，别再往上堆留白） */
.login-wrap { padding: var(--sp-5) var(--pad) var(--sp-4); text-align: center; }
/* 登录页：手机壳框架只按内容高度，不撑满窗口（否则上下各一大片白） */
.screen.compact { min-height: 0; }
/* 电脑上再把登录页这块壳体居中，免得贴着顶、下面一大片灰 */
@media (min-width: 480px) {
  body { display: flex; flex-direction: column; min-height: 100vh; }
  .screen.compact { margin: auto; }
}
.login-wrap h1 { margin: 0; font-size: var(--fs-xl); letter-spacing: 2px; color: var(--brand-ink); }
.login-sub { margin-top: 2px; font-size: var(--fs-s); color: var(--ink-3); letter-spacing: 1px; }
.login-card {
  margin-top: var(--sp-3); padding: var(--sp-3) var(--sp-2);
  background: var(--panel); border-radius: var(--r-m); box-shadow: var(--sh-1);
}
.login-tip { font-size: var(--fs-m); font-weight: 600; color: var(--ink-1); }
.wwlogin { display: flex; justify-content: center; margin-top: var(--sp-1); }
.wwlogin iframe { display: block; }
.login-foot { margin-top: var(--sp-1); font-size: var(--fs-xs); color: var(--ink-3); }
.login-err {
  margin-top: var(--sp-2); padding: var(--sp-2) var(--sp-3);
  background: var(--danger-soft); color: var(--danger);
  border-radius: var(--r-s); font-size: var(--fs-s); line-height: 1.6; text-align: left;
}

/* ============ 调试水印（正式版删掉） ============ */
.dev-flag {
  position: fixed; top: 6px; right: 6px;
  font-size: 10px; color: var(--ink-4);
  z-index: 90;
}

/* ============ 角色 / 申请表 / 人员 这几个管理页要用的零件 ============ */

/* 黄底说明条（跟顶部公告一个色系） */
.warn-strip {
  margin: var(--sp-3) var(--pad) 0;
  padding: var(--sp-3);
  background: var(--notice-bg);
  border: 1px solid var(--notice-line);
  border-radius: var(--r-s);
  color: var(--notice-ink);
  font-size: var(--fs-s);
  line-height: 1.7;
  white-space: pre-line;
}

/* 蓝底说明条（中性提示，比如「内容是从旧单引用过来的」——别用黄条当警告吓人） */
.info-strip {
  margin: var(--sp-3) var(--pad) 0;
  padding: var(--sp-3);
  background: var(--brand-soft);
  border-radius: var(--r-s);
  color: var(--brand-ink);
  font-size: var(--fs-s);
  line-height: 1.7;
}

/* 可点的小胶囊（配角色时勾申请项 / 勾审批链） */
.sw-row { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-top: var(--sp-1); }
.chip {
  border: 1px solid var(--line); background: var(--line-soft); color: var(--ink-2);
  border-radius: var(--r-full); padding: 5px 12px;
  font: inherit; font-size: var(--fs-s); cursor: pointer;
}
.chip.on { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.chip:active { opacity: .85; }

/* 审批顺序（编号胶囊 + ↑ 往前挪） */
.steps { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); margin: var(--sp-1) 0; }
.step {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--brand-soft); color: var(--brand-ink);
  border-radius: var(--r-full); padding: 3px 10px;
  font-size: var(--fs-s); font-weight: 600;
}
.step.empty { background: var(--line-soft); color: var(--ink-3); font-weight: 400; }
/* 固定的最后一步：财务付款（不属于审批链） */
.step.fixed { background: var(--ok-soft); color: var(--ok); }
.step .up {
  border: 0; background: none; padding: 0 2px;
  color: var(--brand); font: inherit; cursor: pointer;
}

/* 申请表编辑弹层里的色块 / 图标 */
.sw {
  width: 28px; height: 28px; padding: 0;
  border: 2px solid transparent; border-radius: 8px;
  background: var(--c, var(--brand)); cursor: pointer;
}
.sw.on { border-color: var(--ink-1); }
.sw.ico {
  width: 34px; height: 34px; border-radius: 9px;
  background: var(--line-soft); color: var(--ink-2);
  display: inline-flex; align-items: center; justify-content: center;
}
.sw.ico.on { background: var(--brand); color: #fff; }
.sw.ico svg { width: 17px; height: 17px; display: block; }

/* 弹层里每项下面那行说明 */
.opt-sub { display: block; font-size: var(--fs-xs); color: var(--ink-3); margin-top: 2px; }
/* 人员项：姓名第一位（判定标准），企微账号那行在后面 */
.opt-name { font-weight: 600; }
/* 已在本角色的那一项，姓名后面跟一个「点一下移出」提示 */
.opt-act { margin-left: var(--sp-2); font-size: var(--fs-xs); color: var(--danger); }

/* 「审批者」小标签 */
.tag-appr {
  margin-left: var(--sp-2);
  font-size: var(--fs-xs); font-weight: 600; color: #fff;
  background: var(--brand); border-radius: var(--r-full); padding: 1px 8px;
}
/* 「收付款岗」小标签（财务） */
.tag-pay {
  margin-left: var(--sp-2);
  font-size: var(--fs-xs); font-weight: 600; color: #fff;
  background: var(--ok); border-radius: var(--r-full); padding: 1px 8px;
}
/* 卡片顶部那行小提示（比如「待我付款」里说明打开能驳回） */
.card-hint {
  padding: var(--sp-2) var(--pad);
  background: var(--brand-soft);
  color: var(--brand-ink);
  font-size: var(--fs-xs);
  border-bottom: 1px solid var(--line);
}

/* 详情页底部那行提示 */
.pay-hint { flex: 1; align-self: center; font-size: var(--fs-s); color: var(--ink-3); line-height: 1.5; }

/* 审批经过里的时间 */
.kv .t { margin-left: var(--sp-2); color: var(--ink-3); font-size: var(--fs-xs); }

/* 表单字段：标签也照现场管理放大到正文同号（现场管理 label-text = 28rpx = 14px） */
.fi > label { font-size: var(--fs-m); color: var(--ink-2); }
.fi input[type=text], .fi input[type=number], .fi textarea, .fi select { font-size: var(--fs-m); }

/* ============ 管理页：项目字典 / 备用金结清与余额 ============ */
.pj-in { display: flex; gap: var(--sp-2); align-items: stretch; }
.pj-in input { flex: 1; min-width: 0; }
.pj-acts { display: flex; gap: var(--sp-2); flex: none; }
.btn.block { flex: none; width: 100%; }

/* 余额小面板：一个大数字 + 一行拆账 */
.bal { text-align: center; padding: var(--sp-2) 0 var(--sp-2); }
.bal .cap { font-size: var(--fs-s); color: var(--ink-3); }
.bal .num { font-size: 30px; font-weight: 700; color: var(--brand-ink); letter-spacing: .5px; }
.bal .num.neg { color: var(--danger); }
.bal .brk { margin-top: 2px; font-size: var(--fs-xs); color: var(--ink-3); }
.bal-res {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3);
  padding-top: var(--sp-2); border-top: 1px solid var(--line-soft); font-size: var(--fs-m);
}
.bal-res .k { color: var(--ink-3); font-size: var(--fs-s); }
.bal-res .v { font-weight: 600; }
.kv .v.strong { font-weight: 700; }
/* 发起表单里的备用金余额小面板（照老界面的 pb-box 重画） */
.pb-box { text-align: center; padding: var(--sp-2) 0 var(--sp-1); }
.pb-label { font-size: var(--fs-s); color: var(--ink-3); }
.pb-num { font-size: 28px; font-weight: 700; color: var(--brand-ink); letter-spacing: .5px; }
.pb-num.neg { color: var(--danger); }
.pb-break { margin-top: 2px; font-size: var(--fs-xs); color: var(--ink-3); line-height: 1.6; }
.bal-res .v.bad { color: var(--danger); font-weight: 700; }

/* 详情页附件：图片给缩略图，点开原图 */
.files a.file-row { text-decoration: none; color: var(--ink-1); }
/* 非图片附件方块（PDF 红底白字）——原来是一个很小的 📎，看不清类型 */
.att-doc { width: 56px; height: 56px; flex: none; border-radius: var(--r-s); border: 1px solid var(--line);
  background: var(--panel); display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; letter-spacing: .5px; color: var(--ink-3); }
.att-doc.pdf { background: var(--danger); border-color: var(--danger); color: #fff; }
.att-thumb { width: 56px; height: 56px; object-fit: cover; border-radius: var(--r-s); border: 1px solid var(--line); flex: none; }
.li-money.in { color: var(--ok); }
.li-money.out { color: var(--danger); }

/* 弹层里的红字按钮（「删除此表」） */
.btn.ghost.danger-text { color: var(--danger); }
