* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
:root {
  --bg: #f5f7fb; --card: #fff; --line: #e6eaf2; --line-2: #eef1f6;
  --text: #14203c; --muted: #7c86a0;
  --primary: #2b5cad; --primary-deep: #1d4076; --primary-weak: #edf2fb;
  --ok: #0f8a56; --ok-weak: #e8f7ef;
  --warn: #b26a00; --warn-weak: #fdf3e5;
  --danger: #d64545; --danger-weak: #fdeeed;
  --radius: 14px; --radius-s: 10px;
  --shadow-1: 0 1px 2px rgba(16, 24, 40, .04);
  --shadow-2: 0 12px 30px -20px rgba(20, 32, 64, .35);
}
/* 字体栈覆盖 iOS / 安卓 / 鸿蒙 / Windows：system-ui 让安卓和鸿蒙拿到本机正文字体，
   只写 -apple-system + PingFang 会让安卓回退到宋体。
   text-size-adjust：iOS 横屏会自动放大字号，锁住。
   overscroll-behavior：手机往下拉不再触发整页刷新 —— 长表单填一半被刷掉是真的会骂人的。 */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; overscroll-behavior-y: contain; }
body {
  background: var(--bg); color: var(--text);
  font-family: system-ui, -apple-system, "PingFang SC", "Hiragino Sans GB", "Noto Sans SC",
    "Source Han Sans SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 15px; padding-bottom: calc(24px + env(safe-area-inset-bottom));
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: contain;
}
a { color: var(--primary); text-decoration: none; }
button { font-family: inherit; }
::selection { background: rgba(43, 92, 173, .16); }
input, select, textarea { transition: border-color .15s ease, box-shadow .15s ease; }
input:focus, select:focus, textarea:focus { outline: none; border-color: rgba(43, 92, 173, .55); box-shadow: 0 0 0 3px rgba(43, 92, 173, .10); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: none; border-radius: 11px; padding: 10px 16px; font-size: 14px; cursor: pointer; background: var(--primary); color: #fff; box-shadow: 0 6px 16px -10px rgba(43, 92, 173, .8); transition: transform .12s ease, box-shadow .12s ease, opacity .12s ease; white-space: nowrap; }
.btn .ic, .btn > svg { flex: none; }
.btn:active { transform: translateY(1px); box-shadow: 0 3px 8px -8px rgba(43, 92, 173, .8); }
.btn:disabled { opacity: .5; box-shadow: none; }
.btn.block { display: block; width: 100%; padding: 13px; font-size: 16px; }
.btn.ghost { background: #fff; color: var(--primary); border: 1px solid rgba(43, 92, 173, .38); box-shadow: none; }
.btn.plain { background: var(--primary-weak); color: var(--primary); box-shadow: none; }
.btn.danger { background: var(--danger); box-shadow: 0 6px 16px -10px rgba(214, 69, 69, .8); }
.btn.warn { background: #b26a00; box-shadow: 0 6px 16px -10px rgba(178, 106, 0, .7); }
.btn.sm { padding: 6px 12px; font-size: 13px; }

.card { background: var(--card); border: 1px solid #e9edf4; border-radius: var(--radius); padding: 16px; margin: 12px; box-shadow: var(--shadow-1); }
.card h3 { font-size: 15px; font-weight: 650; margin-bottom: 12px; letter-spacing: -.2px; }
.muted { color: var(--muted); font-size: 13px; }
/* iOS 的硬规则：输入框字号 < 16px 时，一聚焦就自动放大整个页面，且不会自动缩回。
   这不是审美问题，是「点一下输入框页面就跳」的实际体验故障。 */
input, select, textarea { width: 100%; border: 1px solid #dfe5ee; border-radius: 11px; padding: 11px 12px; font-size: 16px; background: #fff; color: var(--text); margin-top: 6px; }
textarea { min-height: 130px; line-height: 1.7; font-size: 16px; }
label { display: block; font-size: 12.5px; color: var(--muted); margin-top: 12px; font-weight: 500; }
/* 表单双列：用相邻兄弟 margin 代替 flex gap。
   flex 容器上的 gap 要 iOS 14.1 / Chrome 84，低于此版本两个输入框会贴在一起。
   margin 是 20 年前就有的写法，任何设备都不会错。 */
.row { display: flex; }
.row > * + * { margin-left: 10px; }
.row > * { flex: 1; min-width: 0; }
.row > .btn { flex: 1; }
.tag { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.tag.ok { background: var(--ok-weak); color: var(--ok); }
.tag.warn { background: var(--warn-weak); color: var(--warn); }
.tag.gray { background: #eef1f6; color: var(--muted); }
.tag.blue { background: var(--primary-weak); color: var(--primary); }
.tag.red { background: var(--danger-weak); color: var(--danger); }

/* 顶栏 + 顶部导航 */
.hdrwrap { position: sticky; top: 0; z-index: 20; }
/* 品牌块只在桌面侧栏出现（详见文件末尾 min-width:900px 的媒体查询） */
.brand { display: none; }
.topbar { background: rgba(255, 255, 255, .94); border-bottom: 1px solid var(--line); padding: 13px 16px; display: flex; align-items: center; gap: 10px; }
.topbar .back { font-size: 20px; color: var(--text); background: none; border: none; cursor: pointer; padding: 0 4px; }
.topbar h1 { font-size: 16.5px; flex: 1; font-weight: 650; letter-spacing: -.2px; }
.topnav { display: flex; gap: 6px; padding: 8px 12px; background: rgba(255, 255, 255, .94); border-bottom: 1px solid var(--line); overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.topnav::-webkit-scrollbar { display: none; }
.topnav a { flex: 0 0 auto; text-align: center; padding: 7px 15px; border-radius: 9px; font-size: 13px; color: var(--muted); background: none; }
.topnav a.on { background: var(--primary-weak); color: var(--primary); font-weight: 600; }
.topnav { mask-image: linear-gradient(90deg, #000 93%, transparent); -webkit-mask-image: linear-gradient(90deg, #000 93%, transparent); }
.topnav .nav-hint { align-self: center; color: var(--muted); font-size: 15px; padding-left: 2px; }

/* 底部导航 */
.tabbar { position: fixed; bottom: 0; left: 0; right: 0; background: var(--card); border-top: 1px solid var(--line); display: flex; z-index: 30; }
.tabbar a { flex: 1; text-align: center; padding: 9px 0 8px; color: var(--muted); font-size: 11px; }
.tabbar a .ic { display: block; font-size: 20px; margin-bottom: 2px; }
.tabbar a.on { color: var(--primary); }

/* 数据卡片 */
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px; }
.stat { background: var(--card); border: 1px solid #e9edf4; border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow-1); }
.stat .v { font-size: 21px; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat .v.money { color: var(--primary); }

.list-item { background: var(--card); border: 1px solid #edf0f5; border-radius: var(--radius); margin: 10px 12px; padding: 14px 16px; box-shadow: var(--shadow-1); }
.list-item .t { font-weight: 600; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.list-item .d { margin-top: 6px; font-size: 13px; color: var(--muted); display: flex; justify-content: space-between; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 8px 6px; text-align: left; border-bottom: 1px solid var(--line-2); }
th { color: var(--muted); font-weight: 500; }

/* 字段卡片网格（2026-11-03）：标签小字在上、值在下。手机上两列，长值占整行；
   标签定宽对齐的列表扫起来快，但字段一多就成一条长带，卡片分格更耐看也更好点。 */
.fld-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.fld-cell { background: #f6f8fc; border: 1px solid #eef1f7; border-radius: 10px; padding: 8px 10px; min-width: 0; }
.fld-cell.wide { grid-column: 1 / -1; }
.fld-cell.hero { background: var(--primary-weak); border-color: rgba(43, 92, 173, .16); }
.fld-cell .fl { display: block; font-size: 11px; line-height: 1.35; color: var(--muted); }
.fld-cell .fv { display: block; margin-top: 3px; font-size: 14px; line-height: 1.45; color: var(--text); overflow-wrap: anywhere; }
.fld-cell .fv.big { font-size: 20px; font-weight: 700; color: var(--primary); font-variant-numeric: tabular-nums; letter-spacing: -.3px; }
.fld-cell .fv.ok { color: var(--ok); font-weight: 600; font-variant-numeric: tabular-nums; }
.fld-cell .fv.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; letter-spacing: .02em; }
.fld-cell .fv .muted { color: var(--muted); font-weight: 400; font-size: 12px; }

/* 弹层 */
/* 弹层：inset 简写要 iOS 14.1 / Chrome 87，低于此遮罩会塌成 0 尺寸 → 弹窗整个不可见。
   这里展开成四边定位，兼容到 iOS 9。 */
.mask { position: fixed; top: 0; right: 0; bottom: 0; left: 0; background: rgba(11, 18, 34, .46); z-index: 50; display: flex; align-items: center; justify-content: center; padding: calc(24px + env(safe-area-inset-top)) 24px calc(24px + env(safe-area-inset-bottom)); }
.modal { background: var(--card); border-radius: 16px; padding: 20px; width: 100%; max-width: 420px; max-height: 82vh; overflow: auto; box-shadow: 0 24px 60px -24px rgba(11, 18, 34, .5); }
.modal h3 { margin-bottom: 12px; }
.toast { position: fixed; top: 18%; left: 50%; transform: translateX(-50%); background: rgba(20, 26, 40, .88); color: #fff; padding: 10px 22px; border-radius: 999px; z-index: 99; font-size: 14px; box-shadow: 0 10px 26px -12px rgba(11, 18, 34, .6); }
.hidden { display: none !important; }

/* 签名画板：白底容器 + 淡黑大字姓名参考层 + 透明笔迹层（三层叠加） */
.sign-box { position: relative; width: 100%; height: 220px; background: #fff; border: 2px dashed #ccd5e3; border-radius: 12px; overflow: hidden; }
.sign-hint { position: absolute; top: 0; right: 0; bottom: 0; left: 0; display: flex; align-items: center; justify-content: center; color: #c9cfda; font-family: "STKaiti", "KaiTi", "Kaiti SC", "PingFang SC", serif; font-weight: 700; -webkit-text-stroke: 1.4px currentColor; paint-order: stroke fill; line-height: 1; user-select: none; pointer-events: none; transition: opacity .4s ease; }
.sign-hint.faded { opacity: 0; }
.sign-hint:empty { display: none; }
.sign-box canvas { position: absolute; top: 0; right: 0; bottom: 0; left: 0; width: 100%; height: 100%; display: block; touch-action: none; }

/* 二维码 */
.qrbox { text-align: center; padding: 10px 0; }
.qrbox img { width: 200px; height: 200px; }
.qrbox .amt { font-size: 26px; font-weight: 700; color: var(--primary); margin: 6px 0; }

.bar-wrap { background: #eef1f6; border-radius: 8px; height: 10px; overflow: hidden; margin-top: 6px; }
.bar-wrap i { display: block; height: 100%; background: var(--primary); border-radius: 8px; }

/* 数据看板 · 今日收入各团队横向柱（条长按最大团队归一，右侧给金额与占比） */
.team-bars { margin-top: 10px; border-top: 1px solid var(--line-2); padding-top: 10px; display: flex; flex-direction: column; gap: 7px; }
.tb-row { display: flex; align-items: center; font-size: 12px; }
.tb-row > * + * { margin-left: 8px; }
.tb-name { width: 68px; flex: none; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-track { flex: 1; height: 8px; border-radius: 4px; background: #eef1f6; overflow: hidden; }
.tb-track i { display: block; height: 100%; border-radius: 4px; transition: width .35s ease; }
.tb-amt { width: 80px; flex: none; text-align: right; font-variant-numeric: tabular-nums; }
.tb-pct { width: 34px; flex: none; text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }

/* 布局 */
.menu-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px 4px; }
.menu-grid a { background: transparent; border-radius: 12px; padding: 2px 0 6px; text-align: center; font-size: 11.5px; color: #3d475c; }
.menu-grid a .ic { display: grid; place-items: center; width: 52px; height: 52px; margin: 0 auto 7px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(16, 24, 40, .03); }
.menu-grid a .ic svg { width: 29px; height: 29px; display: block; }
.menu-grid a:active .ic { transform: scale(.94); }
.field-tip { font-size: 12px; color: var(--muted); margin-top: 4px; line-height: 1.6; }
/* 日期快捷按钮（2026-11-02 方案 A）：日历控件不动，下面挂常用项；不占输入框宽度 */
.dchips { display: flex; flex-wrap: wrap; margin-top: 6px; }
.dchip { flex: none; padding: 0 13px; height: 31px; border-radius: 8px; border: 1px solid #dfe5ee; background: #f2f5fb; color: #46536e; font-size: 12.5px; line-height: 1; cursor: pointer; white-space: nowrap; }
.dchip + .dchip { margin-left: 6px; }
.dchip:active { background: var(--primary-weak); color: var(--primary); border-color: rgba(43, 92, 173, .38); }
.d-hint { margin-top: 6px; }
/* 校验失败：把缺的那个框标出来（toast 说完 6 秒自动消） */
.vf.err { outline: 2px solid var(--danger); outline-offset: 2px; border-radius: 10px; }
input.err, select.err, textarea.err { border-color: var(--danger) !important; box-shadow: 0 0 0 3px rgba(214, 69, 69, .12) !important; }
.fld-src-tip { margin: 4px 0 0; }
code.ph { background: var(--primary-weak); color: var(--primary); border-radius: 4px; padding: 1px 6px; font-size: 12px; }
/* 模板条件段落示例（{{#if …}}）：手机上也不能被截断 */
.tpl-code { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin: 8px 0; font-size: 12px; line-height: 1.85; white-space: pre-wrap; word-break: break-all; overflow-x: auto; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

/* ---- 业绩看板 / 薪资明细 / 配置（手机优先，一屏看清） ---- */
.stat-grid.g3 { grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.bignum { font-size: 28px; font-weight: 700; line-height: 1.15; letter-spacing: -.5px; font-variant-numeric: tabular-nums; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 5px 12px; font-size: 13px; }
.kv .k { color: var(--muted); }
.kv .v { text-align: right; font-variant-numeric: tabular-nums; }
.sec { border-top: 1px dashed var(--line); margin-top: 10px; padding-top: 10px; }
.sec-t { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.amt-line { display: flex; justify-content: space-between; gap: 8px; padding: 3px 0; font-size: 13px; }
.amt-line.total { border-top: 1px solid var(--line-2); margin-top: 6px; padding-top: 8px; font-size: 16px; font-weight: 700; }
.pill { display: inline-block; padding: 5px 12px; border-radius: 999px; font-size: 12px; background: #eef1f6; color: var(--muted); white-space: nowrap; }
.pill.on { background: var(--primary-weak); color: var(--primary); font-weight: 600; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tier-row { display: grid; grid-template-columns: 1fr 1fr .8fr auto; gap: 6px; align-items: center; margin-top: 6px; }
/* 薪资档位是 4 列窄格子，但字号仍要 16px（同一条 iOS 规则）。
   靠减小内边距把高度压回来，视觉不变。 */
.tier-row input { margin-top: 0; padding: 7px 5px; font-size: 16px; }
.tier-row .del { background: none; border: none; color: var(--danger); font-size: 18px; padding: 0 4px; cursor: pointer; }
.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tbl-wrap table { min-width: 520px; }

/* 订单列表专用表格：固定列宽 + 单行省略。
   历史问题：公司列用「全称」的 nowrap 标签，把客户名称列挤到只剩一个字宽，客户名一字一行竖排。 */
.ell { display: block; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.odt { min-width: 0 !important; table-layout: fixed; width: 100%; }
.odt th, .odt td { padding: 9px 5px; vertical-align: middle; }
.odt th:first-child, .odt td:first-child { padding-left: 0; }
.odt th:last-child, .odt td:last-child { padding-right: 0; }
.odt .c-cust { min-width: 0; }
.odt .c-cust b { font-size: 13.5px; font-weight: 650; color: var(--text); }
.odt .c-cust .sub { font-size: 11px; margin-top: 3px; }
.odt .c-amt { text-align: right; }
.odt .c-amt b { font-size: 13.5px; font-variant-numeric: tabular-nums; }
.odt .cell-tag { margin-top: 4px; text-align: right; }
.odt .cell-tag .tag { font-size: 11px; padding: 2px 6px; }
.odt .c-ops { text-align: center; }
.odt .c-cos .tag {
  font-size: 10.5px; padding: 2px 5px; max-width: 100%;
  overflow: hidden; text-overflow: ellipsis; vertical-align: middle;
}
.mh { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.tag.mini { font-size: 11px; padding: 2px 8px; }

/* 订单行（工作台「最近订单」等） */
.orow { display: flex; padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.orow > * + * { margin-left: 8px; }
.orow:last-child { border-bottom: none; }
.orow .main { flex: 1; min-width: 0; }
.orow b { font-size: 13px; font-weight: 650; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.orow .meta { font-size: 10.5px; color: #98a1b2; margin-top: 4px; }
.orow .right { text-align: right; flex: none; }
.orow .amt { font-size: 13.5px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--primary); }

/* 登录页 · 加到手机桌面指引（仅移动端显示） */
.hs-tip { margin: 14px 0 0; padding: 14px; border-radius: 14px; background: linear-gradient(180deg, #f4f8ff, #e7efff); border: 1px solid #d2dffa; }
.hs-hd { display: flex; align-items: center; gap: 10px; margin-bottom: 11px; }
.hs-hd-ico { width: 36px; height: 36px; flex: 0 0 auto; border-radius: 11px; background: #dbe6ff; display: flex; align-items: center; justify-content: center; font-size: 20px; }
.hs-hd b { display: block; font-size: 15px; color: #16203a; }
.hs-hd .sub { font-size: 12px; color: #6b7791; margin-top: 3px; }
.hs-os { display: flex; align-items: center; gap: 8px; margin-top: 9px; }
.hs-tag { flex: 0 0 auto; font-size: 11.5px; font-weight: 700; padding: 4px 9px; border-radius: 7px; }
.hs-tag.ios { background: #1c2333; color: #fff; }
.hs-tag.and { background: #0f8a56; color: #fff; }
.hs-chain { display: flex; align-items: center; gap: 3px; flex-wrap: wrap; }
.hs-pill { background: #fff; border: 1px solid #d9e3fa; border-radius: 8px; padding: 4px 7px; font-size: 11.5px; color: #2b3550; white-space: nowrap; }
.hs-ar { font-style: normal; color: #9aa8c6; font-size: 12px; }
@media (min-width: 760px) { .hs-tip { display: none; } }

/* 登录页 · 还没有账号（员工找管理员 / 企业自助注册） */
.join-card { border: 1px solid #d2dffa; background: linear-gradient(180deg, #f7faff, #eef4ff); }
.join-t { font-size: 15px; font-weight: 700; color: #16203a; margin-bottom: 10px; }
.join-row { display: flex; gap: 9px; align-items: flex-start; margin-top: 9px; font-size: 13px; color: #39445e; line-height: 1.6; }
.join-tag { flex: 0 0 auto; font-size: 11.5px; font-weight: 700; padding: 3px 8px; border-radius: 7px; margin-top: 2px; }
.join-tag.emp { background: #dbe6ff; color: #2a55d8; }
.join-tag.boss { background: #1c2333; color: #fff; }

/* 软件功能更新日志（时间线） */
.cl-wrap { padding: 0; }
.cl-group { position: relative; padding: 14px 16px 2px 32px; }
.cl-group::before { content: ''; position: absolute; left: 20px; top: 26px; bottom: 0; width: 2px; background: #e6ebf6; }
.cl-group:last-child::before { display: none; }
.cl-date { position: relative; font-size: 13px; font-weight: 700; color: #16203a; margin-bottom: 8px; letter-spacing: .02em; }
.cl-date::before { content: ''; position: absolute; left: -16px; top: 5px; width: 9px; height: 9px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 3px #e8efff; }
.cl-item { display: flex; gap: 8px; align-items: flex-start; margin: 7px 0; font-size: 13.5px; line-height: 1.6; color: #39445e; }
.cl-tag { flex: 0 0 auto; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 6px; margin-top: 2px; }
.cl-tag.new { background: #e3f7ec; color: #12805a; }
.cl-tag.improve { background: #e8efff; color: #2a55d8; }
.cl-tag.fix { background: #fff2e0; color: #b8641a; }

/* 印章 / 负责人签名上传 */
.seal-list { display: flex; flex-direction: column; gap: 12px; }
.seal-item { display: flex; gap: 12px; align-items: center; border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
.seal-thumb { flex: 0 0 auto; width: 92px; height: 92px; border-radius: 8px; background: #f7f9ff; border: 1px dashed #d9e2f5; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.seal-thumb img { max-width: 88%; max-height: 88%; object-fit: contain; }
.seal-info { flex: 1; min-width: 0; font-size: 13px; }
.seal-info b { font-size: 14px; }
.seal-check { background: #f7f9ff; border-radius: 10px; padding: 14px; text-align: center; }
.seal-check img { max-width: 100%; max-height: 220px; object-fit: contain; }

/* 合同归档 */
.ar-kpi { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 6px; }
.ar-kpi > div { background: var(--primary-weak); border-radius: 10px; padding: 10px; }
.ar-kpi .v { font-size: 20px; font-weight: 700; margin: 2px 0; font-variant-numeric: tabular-nums; }
.ar-row { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.ar-row > div:first-child { flex: 1 1 150px; min-width: 0; }
.ar-row:last-child { border-bottom: none; }
.card-warn { border: 1px solid #f0c68a; background: #fffdf8; }

/* 存储空间强提醒：只能点按钮关闭 */
.mask.hard { background: rgba(12, 18, 32, .62); }
.mask.hard .modal { border-top: 4px solid var(--danger); }
.st-alert-ico { font-size: 28px; }
.st-alert h3 { margin: 6px 0 8px; color: var(--danger); }
.st-alert p { font-size: 14px; line-height: 1.7; margin: 6px 0; }

/* 客户签署页 */
.sealed-tip { display: inline-block; margin-top: 8px; background: #e3f7ec; color: #12805a; font-size: 12.5px; padding: 5px 10px; border-radius: 8px; }
.sign-agree { display: flex; gap: 8px; align-items: flex-start; margin-top: 14px; font-size: 13px; line-height: 1.6; color: #39445e; }
.sign-agree input { margin-top: 3px; }

/* 合同模板字段确认 */
.fld-list { display: flex; flex-direction: column; gap: 10px; max-height: 58vh; overflow: auto; margin-top: 8px; padding-right: 2px; }
.fld-row { border: 1px solid var(--line); border-radius: 10px; padding: 10px; background: #fbfcff; }
.fld-k { font-size: 13px; margin-bottom: 6px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.fld-k code { background: var(--primary-weak); color: var(--primary); padding: 2px 6px; border-radius: 5px; font-size: 12.5px; }
.fld-src { width: 100%; }
.fld-opt { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line); }
.fld-opt .row > * + * { margin-left: 8px; }

/* 下单页：合同模板专属字段 */
.vars-block { margin-top: 14px; padding: 12px; background: #f7f9fd; border: 1px solid var(--line-2); border-radius: 10px; }
.vars-block label { margin-top: 8px; display: block; }
.vars-block .field-tip { margin: 4px 0 0; }

/* 密码框：可见切换 + 强度提示 */
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 46px; }
.pw-eye { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; font-size: 17px; line-height: 1; padding: 8px 10px; cursor: pointer; color: var(--muted); opacity: .75; }
.pw-eye.on { opacity: 1; }
.pw-hint { font-size: 12px; color: var(--muted); margin-top: 6px; line-height: 1.5; }
.pw-hint.bad { color: var(--warn); }
.pw-hint.ok { color: #12805a; }
.pw-note { background: var(--warn-weak); color: #8a5a06; font-size: 13px; line-height: 1.7; padding: 10px 12px; border-radius: 10px; margin-bottom: 6px; }
.pw-result { background: var(--primary-weak); border-radius: 10px; padding: 14px; text-align: center; font-size: 24px; font-weight: 600; letter-spacing: 3px; color: var(--primary); margin: 10px 0; }

/* 员工列表操作按钮：2×2 排列，手机上也不挤 */
.emp-acts { margin-top: 10px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.emp-acts .btn { width: 100%; }
.btn:disabled { opacity: .45; }

/* 版本更新提示条：固定在底部，不遮挡操作区 */
.ver-bar { position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 9999;
  display: flex; align-items: center; gap: 12px; background: #1f2a37; color: #fff;
  font-size: 13px; padding: 10px 14px; border-radius: 999px; box-shadow: 0 6px 20px rgba(0,0,0,.25); }
.ver-bar button { border: 0; background: var(--primary); color: #fff; font-size: 13px; padding: 6px 12px; border-radius: 999px; cursor: pointer; }

/* 新订单提醒红点（导航「订单」上） */
.topnav a { position: relative; }
.nav-badge {
  position: absolute; top: -5px; right: -10px; min-width: 16px; height: 16px;
  line-height: 16px; border-radius: 8px; background: #e5484d; color: #fff;
  font-size: 10px; font-style: normal; font-weight: 700; padding: 0 4px;
}

/* ===== 集团：模块内公司页签（总管理员） ===== */
.cotabs {
  display: flex; gap: 8px; overflow-x: auto; padding: 8px 12px 2px;
  -webkit-overflow-scrolling: touch; scrollbar-width: none;
  mask-image: linear-gradient(90deg, #000 94%, transparent);
  -webkit-mask-image: linear-gradient(90deg, #000 94%, transparent);
}
.cotabs::-webkit-scrollbar { display: none; }
.cotab {
  flex: none; border: 1px solid var(--line); background: #fff; color: var(--text);
  font-size: 13px; padding: 6px 14px; border-radius: 999px; cursor: pointer;
  white-space: nowrap; max-width: 42vw; overflow: hidden; text-overflow: ellipsis;
}
.cotab.on { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }
.ro-bar {
  margin: 6px 12px 2px; padding: 7px 12px; border-radius: 8px; font-size: 12px;
  background: #fff8e6; color: #8a5a00; border: 1px solid #f3e0ae;
}

/* ================= 桌面端（≥900px）=================
   同一套 DOM，不另做「左侧菜单 + 表格化后台」：
   app.js 里 40 多个 render 函数都是手机骨架，重构外壳的风险远大于收益；
   而 PC 端的真实用户是老板、财务、集团总管理员，低频、以看报表和导表为主。
   这里只做三件事：内容居中、多列化、表格放开 —— 全部是 CSS，不碰业务逻辑。

   为什么是 900px：iPad 竖屏 768、横屏 1024，900 落在两者之间，
   平板横屏也能拿到桌面布局；iPad 竖屏继续用手机布局（一列更顺手）。 */
@media (min-width: 900px) {
  /* ===== 桌面端：左侧固定导航栏 + 右侧内容区 =====
     不另写一套后台骨架：把顶部横条整体挪到左侧竖栏，
     内容区改为左对齐自适应，组件全部原样复用。 */
  :root { --side: 240px; }
  body { font-size: 15.5px; padding-bottom: 0; }

  /* —— 左侧导航栏 —— */
  .hdrwrap {
    position: fixed; top: 0; bottom: 0; left: 0; width: var(--side);
    display: flex; flex-direction: column;
    background: #fff; border-right: 1px solid var(--line);
    z-index: 20; overflow-y: auto; overflow-x: hidden;
  }
  .brand {
    display: flex; align-items: center; flex: none; height: 56px; padding: 0 18px;
    font-size: 15.5px; font-weight: 700; letter-spacing: .2px;
    color: var(--primary); border-bottom: 1px solid var(--line);
  }
  /* 页面标题条挪到内容区顶部，横向通铺（左侧让出导航栏宽度） */
  .hdrwrap > .topbar {
    position: fixed; top: 0; left: var(--side); right: 0; height: 56px; box-sizing: border-box;
    background: rgba(255, 255, 255, .96); border-bottom: 1px solid var(--line);
    padding: 0 26px; display: flex; align-items: center; gap: 10px; z-index: 19;
  }
  .hdrwrap > .topbar h1 { font-size: 16.5px; }
  /* —— PC 页面签：标题条右侧的最近打开页面，点一下直达 —— */
  .hdrwrap > .topbar #recent-tabs {
    display: flex; margin-left: auto; gap: 6px; max-width: 62%;
    overflow-x: auto; scrollbar-width: none;
  }
  .hdrwrap > .topbar #recent-tabs::-webkit-scrollbar { display: none; }
  .rtab {
    flex: none; display: inline-flex; align-items: center; gap: 4px;
    padding: 4px 10px; border-radius: 8px; font-size: 12.5px; cursor: pointer;
    color: #46536e; background: #f2f5fb; border: 1px solid transparent;
    white-space: nowrap;
  }
  .rtab:hover { border-color: var(--line); }
  .rtab.on { background: var(--primary-weak); color: var(--primary); font-weight: 600; }
  .rtab .rt-x { font-style: normal; opacity: .45; font-size: 13px; }
  .rtab .rt-x:hover { opacity: 1; color: var(--danger); }
  .hdrwrap > .topnav {
    display: flex; flex-direction: column; flex: none; gap: 2px;
    padding: 10px 10px 14px; background: none; border-bottom: none;
    overflow: visible; mask-image: none; -webkit-mask-image: none;
  }
  .hdrwrap > .topnav a { display: block; text-align: left; padding: 10px 14px; border-radius: 10px; font-size: 14px; color: #46536e; }
  .hdrwrap > .topnav a:hover { background: #f2f5fb; }
  .hdrwrap > .topnav a.on { background: var(--primary-weak); color: var(--primary); font-weight: 650; }
  .hdrwrap > .topnav .nav-hint { display: none; }
  /* 集团：公司页签落到侧栏底部 */
  .hdrwrap > .cotabs {
    margin-top: auto; flex: none; flex-wrap: wrap; gap: 6px; padding: 12px 12px 4px;
    border-top: 1px solid var(--line); overflow: visible;
    mask-image: none; -webkit-mask-image: none;
  }
  .hdrwrap > .cotabs .cotab { max-width: 100%; font-size: 12.5px; padding: 5px 12px; }
  .hdrwrap > .ro-bar { margin: 8px 12px 14px; }
  .hdrwrap > .cotabs:last-child, .hdrwrap > .ro-bar:last-child { margin-bottom: 14px; }

  /* —— 右侧内容区 —— */
  #app > .hdrwrap ~ *:not(.mask):not(.toast):not(.ver-bar) {
    margin-left: calc(var(--side) + 24px); margin-right: 24px; max-width: 1400px;
  }
  /* 第一块内容让开 56px 的标题条 */
  #app > .hdrwrap + * { margin-top: 72px; }

  /* 登录 / 注册 / 首次改密：没有主导航，保持居中小卡片，不要侧栏 */
  .hdrwrap.no-nav {
    position: static; width: auto; display: block;
    background: none; border-right: none; overflow: visible;
  }
  .hdrwrap.no-nav > .brand { display: none; }
  .hdrwrap.no-nav > .topbar {
    position: static; height: auto; background: none; border-bottom: none;
    padding: 16px 24px 6px; justify-content: center;
  }
  #app > .hdrwrap.no-nav ~ *:not(.mask):not(.toast):not(.ver-bar) {
    margin-left: auto; margin-right: auto; max-width: 460px;
  }
  #app > .hdrwrap.no-nav + * { margin-top: 24px; }
  /* 登录页外层是内联 padding 的裸 div，同样收窄居中 */
  #app > div[style*="padding:36px 24px 48px"] { max-width: 460px; margin-left: auto; margin-right: auto; }

  /* 看板 2 列 → 4 列，一屏看完不用滚 */
  .stat-grid { grid-template-columns: repeat(4, 1fr); }
  .stat-grid.g3 { grid-template-columns: repeat(3, 1fr); }
  /* 功能菜单 4 列 → 8 列 */
  .menu-grid { grid-template-columns: repeat(8, 1fr); }
  /* 字段卡片：PC 四列，长值仍占两格；操作按钮 PC 上并排不整行通铺 */
  .fld-grid { grid-template-columns: repeat(4, 1fr); gap: 10px; }
  .fld-cell.wide { grid-column: span 2; }

  /* 表格：容器已经够宽，取消横向滚动与最小宽度 */
  .tbl-wrap { overflow-x: visible; }
  .tbl-wrap table { min-width: 0; }
  th, td { padding: 10px 8px; }
  .odt th, .odt td { padding: 11px 10px; }
  .odt .c-cust b, .odt .c-amt b { font-size: 14px; }

  /* 卡片与弹窗：桌面有空间，放宽一点 */
  .card { padding: 18px 20px; }
  .modal { max-width: 540px; }
  .fld-list { max-height: 66vh; }
  /* 单列表单在宽屏上别拉满整行，620px 是看得清又不空的高度 */
  .card > input, .card > select { max-width: 620px; }
  /* 「创建订单」这类整宽按钮铺满 1180px 太夸张，改成内容宽；
     登录/改密页容器只有 460px，单独恢复 100% 保持视觉重心居中 */
  .card > .btn.block { width: auto; padding: 10px 32px; display: inline-flex; }
  #app > div[style*="padding:36px 24px 48px"] .btn.block { width: 100%; padding: 13px; }

  /* 印章上传横排 */
  .seal-list { flex-direction: row; flex-wrap: wrap; }
  .seal-item { flex: 1 1 320px; }
  /* 归档行宽屏一行放完 */
  .ar-row > div:first-child { flex: 1 1 auto; }
}


/* ================= 图表与临期台账（2026-11-01） ================= */
.bar-chart { display: block; color: var(--text); overflow: visible; }
.cost-bars .tb-name { width: 96px; }
.cost-bars .tb-row { padding: 3px 0; border-radius: 6px; }
.cost-bars .tb-row:active { background: var(--primary-weak); }

.exp-legend { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-top: 6px; font-size: 12px; color: var(--muted); }
.exp-legend span { display: inline-flex; align-items: center; gap: 5px; }
.exp-legend i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.exp-legend i.ln { width: 16px; height: 3px; border-radius: 2px; background: #E8873C; }
.exp-foot { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line-2); font-size: 12.5px; color: var(--muted); }
.exp-foot b { color: var(--text); }
.exp-foot a { color: var(--primary); }

/* 详情表底色：本月红 / 下月黄 / 第三月蓝 / 已过期灰 */
.exp-table tr.exp-r1 > td { background: rgba(214, 69, 69, .085); }
.exp-table tr.exp-r2 > td { background: rgba(203, 142, 20, .13); }
.exp-table tr.exp-r3 > td { background: rgba(43, 92, 173, .085); }
.exp-table tr[data-expired="1"] > td { background: rgba(124, 134, 160, .10); }
.exp-table td.c-end { text-align: right; white-space: nowrap; }
.exp-tag { display: inline-block; padding: 2px 7px; border-radius: 6px; font-size: 11px; line-height: 1.6; }
.exp-tag.red { background: rgba(214, 69, 69, .14); color: #b33535; }
.exp-tag.yellow { background: rgba(203, 142, 20, .2); color: #8a5c00; }
.exp-tag.blue { background: rgba(43, 92, 173, .14); color: var(--primary); }
.exp-tag.gray { background: rgba(124, 134, 160, .16); color: var(--muted); }
.c-red { color: #c53b3b !important; }
.c-yellow { color: #a06a00 !important; }
.c-blue { color: var(--primary) !important; }

.exp-sums { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.exp-sums > div { background: var(--bg); border-radius: 10px; padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; }
.exp-sums span { font-size: 11.5px; }
.exp-sums b { font-size: 18px; font-variant-numeric: tabular-nums; }
.exp-filts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.exp-filts .tag { padding: 6px 12px; cursor: pointer; }
.exp-warn { background: var(--warn-weak); color: var(--warn); border-radius: 8px; padding: 8px 10px; font-size: 12.5px; margin: 6px 0; line-height: 1.6; }

/* 多选下拉 */
.ms-box { display: flex; flex-wrap: wrap; gap: 8px; margin: 2px 0 4px; }
.ms-item { display: inline-flex; align-items: center; gap: 6px; padding: 7px 11px; border: 1px solid var(--line); border-radius: 9px; font-size: 13px; background: #fff; }
.ms-item input { width: auto; margin: 0; }
.ms-item:has(input:checked) { border-color: rgba(43, 92, 173, .55); background: var(--primary-weak); color: var(--primary); }
.fld-cond { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line); }
.fld-opts-t { min-height: 64px; }

/* 审计日志 */
.au-table td.au-time b { font-size: 12.5px; font-variant-numeric: tabular-nums; }
.au-table td.au-main { line-height: 1.6; font-size: 13px; }
.au-act { display: flex; align-items: center; gap: 6px; margin-top: 2px; font-weight: 500; }
.au-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); flex: none; }
.au-dot.bad { background: var(--danger); }
.au-res { text-align: right; }
.au-pager { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 12px; }
.au-table .sub, .exp-table .sub { font-size: 11.5px; margin-top: 2px; }

/* 静态码收款：备注短码（客户付款页） */
.st-note {
  background: var(--warn-weak); color: var(--warn);
  border: 1px solid #f3ddb8; border-radius: var(--radius-s);
  padding: 10px 12px; font-size: 13.5px; line-height: 1.6; text-align: center; font-weight: 600;
}
.st-code {
  margin: 12px auto 0; max-width: 320px;
  border: 2px dashed var(--primary); border-radius: var(--radius-s);
  background: var(--primary-weak); color: var(--primary-deep);
  font-size: 26px; font-weight: 700; letter-spacing: 2px;
  font-variant-numeric: tabular-nums; text-align: center;
  padding: 14px 8px; user-select: all; -webkit-user-select: all;
}
/* 订单号 + 「点此复制」同一行（2026-11-03 一屏化：不用再点按钮跳下一页） */
.st-codewrap { margin: 12px auto 0; max-width: 320px; display: -webkit-flex; display: flex; -webkit-align-items: stretch; align-items: stretch; }
.st-codewrap .st-code { -webkit-flex: 1; flex: 1; min-width: 0; margin: 0; }
.st-copy {
  -webkit-flex: 0 0 auto; flex: 0 0 auto; width: 92px; margin-left: 8px;
  border: 2px solid var(--primary); border-radius: var(--radius-s);
  background: var(--primary); color: #fff; font-size: 13.5px; font-weight: 600;
  line-height: 1.35; padding: 0 8px; font-family: inherit; cursor: pointer;
}
.st-copy.ok { background: #e9f7ef; border-color: var(--ok); color: var(--ok); }
.st-qr { text-align: center; margin-top: 6px; }
.st-qr img { width: 230px; height: 230px; object-fit: contain; border-radius: 10px; }
/* 二维码上方提醒（2026-11-03：由浅灰小字改为醒目主色提示，客户一眼知道要扫码） */
.st-qr-tip {
  margin: 18px 0 10px; text-align: center;
  font-size: 16px; font-weight: 700; color: var(--primary-deep); line-height: 1.6;
}
.st-qr-tip:after { content: '↓'; display: block; font-size: 15px; line-height: 1; margin-top: 4px; color: var(--primary); }
.st-qr-after { margin: 10px 0 0; text-align: center; font-size: 12.5px; color: var(--muted); line-height: 1.8; }
.st-remind {
  background: var(--primary-weak); color: var(--primary-deep);
  border-radius: var(--radius-s); padding: 12px; font-size: 15px;
  text-align: center; line-height: 1.7;
}
.st-remind b { font-size: 18px; letter-spacing: 1px; font-variant-numeric: tabular-nums; }
.st-toast {
  position: fixed; left: 50%; bottom: 64px; transform: translateX(-50%);
  background: rgba(20, 32, 60, .9); color: #fff; font-size: 13.5px;
  padding: 10px 16px; border-radius: 20px; z-index: 99; max-width: 86vw; text-align: center;
}

/* 收款核对（订单列表顶部） */
.pc-sec { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.pc-row { display: flex; align-items: center; flex-wrap: wrap; padding: 8px 0; border-bottom: 1px dashed var(--line-2); }
.pc-row:last-child { border-bottom: 0; }
.pc-main { flex: 1 1 220px; min-width: 0; }
.pc-ops { display: flex; flex-wrap: wrap; margin-left: auto; }
.pc-ops > * + * { margin-left: 6px; }
@media (max-width: 899px) {
  .pc-row { align-items: flex-start; }
  .pc-ops { width: 100%; margin: 6px 0 0; }
  .pc-ops .btn { flex: 1 1 auto; }
}

/* 合同阅读层：签署页/付款页内全屏打开，不跳转不下载 */
#rd { position: fixed; left: 0; right: 0; top: 0; bottom: 0; z-index: 99; background: #f2f4f8; }
.rd-bar { height: 48px; background: #fff; border-bottom: 1px solid #e5e8ee; display: flex; align-items: center; justify-content: space-between; padding: 0 16px; }
.rd-bar b { font-size: 15px; }
#rd-close { color: var(--primary); font-size: 14px; padding: 10px 2px 10px 12px; }
#rd-frame { width: 100%; height: calc(100% - 49px); border: 0; display: block; background: #f2f4f8; }

/* 阅读层兜底：加载失败/超时不给白屏，给重试与下载 */
#rd-tip { position: absolute; left: 0; right: 0; top: 49px; bottom: 0; background: #f2f4f8; display: flex; align-items: center; justify-content: center; padding: 24px; }
#rd-tip[hidden] { display: none; }
.rd-tip-box { background: #fff; border-radius: 14px; padding: 22px 18px; max-width: 340px; text-align: center; border: 1px solid #e5e8ee; }
.rd-tip-box b { font-size: 16px; }
.rd-tip-box p { margin-top: 8px; line-height: 1.8; font-size: 13px; }
.rd-tip-box .row { display: flex; justify-content: center; margin-top: 14px; }
.rd-tip-box .row > * + * { margin-left: 10px; }

/* 返回手势提示条（一次做一层的确认） */
.bg-tip { position: fixed; left: 50%; bottom: 76px; transform: translateX(-50%); background: rgba(24,28,36,.86); color: #fff; font-size: 13px; padding: 9px 16px; border-radius: 999px; z-index: 200; opacity: 0; pointer-events: none; transition: opacity .18s ease; white-space: nowrap; }
.bg-tip.on { opacity: 1; }

/* 引导卡折叠常见问题（2026-11-10） */
.hs-faq { margin-top: 12px; padding-top: 10px; border-top: 1px dashed #c3d4f2; }
.hs-faq-toggle { display: block; width: 100%; text-align: left; background: none; border: none; padding: 0; font-size: 12px; color: #3a6fd8; cursor: pointer; }
.hs-faq-body { margin-top: 8px; font-size: 12px; color: #56617a; line-height: 1.7; }
.hs-faq-body p { margin: 0 0 6px; }
.hs-faq-body p:last-child { margin-bottom: 0; }
.hs-faq-body b { color: #16203a; }
