/* ================= 整体布局 ================= */
* { box-sizing: border-box; margin: 0; padding: 0; }

/* 通用隐藏：JS 里大量 classList.add('hidden')，此前只有 .modal/.toast 等个别元素有对应规则，
   导致 #overview-wrap 等元素加了 hidden 仍显示（内容残留在其他页面下方） */
.hidden { display: none; }

:root {
  --primary: #1e6fd9;
  --primary-dark: #1757ab;
  --sidebar-bg: #1f2d3d;
  --sidebar-text: #b7c3d0;
  --sidebar-active: #1e6fd9;
  --border: #e3e7ee;
  --bg: #f3f5f8;
  --text: #2f3542;
  --text-light: #7a8494;
  --danger: #e0483e;
  --success: #2fa84f;
}

html, body {
  height: 100%;
  font-family: system-ui, "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}

#app { display: flex; flex-direction: column; height: 100vh; }
/* 必须再写一条 #app.hidden：上面的 #app 是 ID 选择器（优先级 1,0,0），
   通配的 .hidden（styles.css:6 的 0,1,0）压不过它 —— 登录页显示时 #app 带着 hidden
   却仍是 display:flex，占满一屏 100vh，把下面的 .login-page 整个顶到视口外（实测 1280×900
   下 #loginPage.top = 804，必须往下滚一屏才看见登录框）。和 #dropdown.hidden 是同一个坑。 */
#app.hidden { display: none; }
/* 手机浏览器地址栏伸缩时 100vh 会把底部分页栏顶出可视区；dvh 跟随实际可视高度。
   不支持的浏览器（含 Electron/Chromium 旧版）自动忽略这行，仍用上面的 100vh。 */
@supports (height: 100dvh) {
  #app { height: 100dvh; }
}

/* ================= 顶部栏 ================= */
#topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 58px;
  padding: 0 16px;
  background: linear-gradient(90deg, #16324f, #1e6fd9);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  z-index: 10;
  flex-shrink: 0;
}

/* 侧边栏折叠按钮 */
.hamburger {
  width: 34px; height: 34px;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.4);
  border-radius: 8px;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  line-height: 1;
  transition: background 0.15s;
}
.hamburger:hover { background: rgba(255,255,255,0.22); }

.brand { display: flex; align-items: center; gap: 10px; min-width: 0; flex-shrink: 1; }

.brand-logo {
  width: 34px; height: 34px;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.4);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 700;
  flex-shrink: 0;
}

.brand-text { min-width: 0; }
.brand-title {
  font-size: 16px; font-weight: 600; line-height: 1.2;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.brand-sub { font-size: 11px; opacity: 0.75; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

#top-nav {
  display: flex;
  gap: 4px;
  height: 100%;
  flex: 1;
  min-width: 0;
}

.tab {
  flex: 1 1 0;
  min-width: 0;
  padding: 0 10px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 14px;
  color: rgba(255,255,255,0.85);
  border-bottom: 3px solid transparent;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background 0.15s, color 0.15s;
}

.tab:hover { background: rgba(255,255,255,0.08); color: #fff; }
.tab.active {
  color: #fff;
  border-bottom-color: #ffd166;
  background: rgba(255,255,255,0.12);
  font-weight: 600;
}

/* 帮助标签不参与均分，固定在标签栏最右 */
.tab-help { flex: none; min-width: 64px; }

/* 顶栏右侧：连接状态 + 退出按钮 */
.top-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.conn-badge {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: #2fa84f;
  box-shadow: 0 0 6px rgba(47,168,79,0.8);
  display: inline-block;
}
.conn-badge.off { background: #e0483e; box-shadow: 0 0 6px rgba(224,72,62,0.8); }

/* 顶栏项目切换器（当前项目） */
.proj-switch {
  max-width: 220px;
  padding: 6px 10px;
  border: 1px solid rgba(255,255,255,0.5);
  border-radius: 6px;
  background: rgba(255,255,255,0.08);
  color: #fff;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  outline: none;
}
.proj-switch option { color: #222; background: #fff; }
.proj-switch:focus { border-color: #fff; }

.quit-btn {
  padding: 6px 16px;
  border: 1px solid rgba(255,255,255,0.5);
  border-radius: 6px;
  background: rgba(255,255,255,0.08);
  color: #fff;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
}
.quit-btn:hover { background: var(--danger); border-color: var(--danger); }

/* 修改密码页：限宽居中，输入框不跟着表格铺满一整行 */
.pwd-box { max-width: 420px; padding: 8px 0 0; }
.pwd-box .form-field { margin-bottom: 14px; }
.pwd-actions { margin: 18px 0 12px; }

.cur-user {
  font-size: 13px;
  color: rgba(255,255,255,0.92);
  white-space: nowrap;
}

/* ================= 主体区域 ================= */
#body { display: flex; flex: 1; overflow: hidden; }

/* 侧边栏折叠状态：隐藏侧边栏，内容区自动占满 */
.sidebar-collapsed #sidebar { display: none; }

/* ================= 顶部模块下拉菜单 ================= */
#dropdown {
  position: fixed;
  z-index: 180;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 28px rgba(0,0,0,0.18);
  padding: 6px;
  display: flex;
  flex-direction: column;
  max-height: 60vh;
  overflow-y: auto;
}

#dropdown.hidden { display: none; }

.dd-item {
  padding: 9px 18px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  color: var(--text);
  transition: background 0.12s, color 0.12s;
}

.dd-item:hover { background: #eef4fd; color: var(--primary); }
.dd-item.active { background: var(--primary); color: #fff; font-weight: 600; }
.dd-item.active:hover { background: var(--primary-dark); color: #fff; }

/* ================= 帮助弹窗 ================= */
.modal-box.help-box { width: 680px; }

/* ================= 打印模板「操作说明」停靠侧栏 =================
   为什么不做成弹窗：这份说明是「一手看、一手点」的现场手册，遮罩弹窗会把下面的
   模板列表整个盖死，弹窗挪不动的时候根本没法照着做。改右侧停靠：
   · 无遮罩、无 <dialog>，页面照常可点可滚；z-index 压过工具栏(sidebar)但不压映射窗(160)
   · 位置 top/bottom 留出顶部导航，不遮模块标签和「操作说明」按钮本身
   · 宽度、收起状态都持久化，下次打开还是用户上次的样子 */
#tplGuideDock {
  position: fixed;
  top: 56px; right: 0; bottom: 12px;
  z-index: 90;                       /* 低于 .modal(100) / #tplMapDlg(160)，高于内容区 */
  width: 460px; max-width: calc(100vw - 24px);
  background: #fff;
  border: 1px solid var(--border);
  border-right: none;                /* 贴右边，留 12px 呼吸位 */
  margin-bottom: 12px;
  border-radius: 10px 0 0 10px;
  box-shadow: -8px 8px 28px rgba(15, 23, 42, 0.16);
  display: flex; flex-direction: column;
  overflow: hidden;
}
#tplGuideDock.hidden { display: none; }
/* 收起：只留标题条，页面左侧全空出来 */
#tplGuideDock.collapsed { bottom: auto; height: 44px; }

.tgd-head {
  display: flex; align-items: center; gap: 6px;
  padding: 0 8px 0 14px; height: 44px; flex: none;
  background: #f8fafc; border-bottom: 1px solid var(--border);
  cursor: default;
}
.tgd-title { flex: 1; font-size: 13.5px; font-weight: 600; color: #1d2634; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tgd-btn {
  flex: none; background: none; border: 1px solid transparent; border-radius: 5px;
  padding: 3px 7px; font-size: 13px; line-height: 1; color: var(--text-light); cursor: pointer;
}
.tgd-btn:hover { background: #eef2f7; border-color: var(--border); color: var(--text); }
#tplGuideDock.collapsed .tgd-btn { transform: rotate(180deg); }

.tgd-content { flex: 1; min-height: 0; max-height: none; padding: 14px 18px; }
#tplGuideDock.collapsed .tgd-content { display: none; }

/* 左缘拖宽手柄：拖的是窗口左边，所以光标用 ew-resize */
.tgd-grip {
  position: absolute; left: 0; top: 0; bottom: 0; width: 6px;
  cursor: ew-resize;
}
#tplGuideDock.collapsed .tgd-grip { display: none; }

/* ================= 导出弹窗 ================= */
.modal-box.export-box { width: 460px; }
.export-body { padding: 6px 24px 14px; }
.export-row { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px dashed #eef0f3; }
.export-row:last-of-type { border-bottom: 0; }
.export-label { width: 68px; flex: none; color: var(--text-light); font-size: 13px; padding-top: 4px; }
.export-opts { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.export-opts.export-formats { flex-direction: row; gap: 10px; }
.export-opt {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 10px; border: 1px solid var(--border); border-radius: 5px;
  font-size: 13px; cursor: pointer; user-select: none;
}
.export-opt:hover { border-color: var(--primary); }
.export-opt input { margin: 0; cursor: pointer; }
.export-opt.is-off { color: #aab2bd; cursor: not-allowed; background: #fafbfc; }
.export-opt.is-off:hover { border-color: var(--border); }
.export-count { margin-left: auto; color: var(--text-light); font-size: 12px; }
.export-soon { margin-left: auto; font-size: 11px; color: #b8bfc8; }
.export-hint { margin-top: 8px; font-size: 12px; color: var(--text-light); line-height: 1.6; min-height: 18px; }
/* 有勾选时导出按钮高亮，提示「再点只导这几条」 */
#toolbar #btn-export.has-sel { border-color: var(--primary); color: var(--primary); font-weight: 600; }
/* 打印所选与导出同款高亮：两者都表示「只作用于勾出来的那几条」 */
#toolbar #btn-print-sel.has-sel { border-color: var(--primary); color: var(--primary); font-weight: 600; }

.help-content {
  padding: 20px 24px;
  max-height: 62vh;
  overflow-y: auto;
  line-height: 1.8;
  font-size: 13.5px;
  color: var(--text);
}

.help-content h4 {
  font-size: 14.5px;
  color: #1d2634;
  margin: 18px 0 6px;
}

.help-content h4:first-child { margin-top: 0; }

.help-content ul { padding-left: 22px; margin: 4px 0; }
.help-content li { margin: 3px 0; }
.help-content code {
  background: #f0f2f5;
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 12.5px;
  color: #d6336c;
}

.help-content .kbd {
  background: #eef2f7;
  border: 1px solid #d3dae3;
  border-bottom-width: 2px;
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 12px;
}

.help-content .req { color: #e0483e; }

/* 系统版本更新记录 */
.help-content .muted { color: var(--text-light); font-size: 12.5px; margin: 2px 0 10px; }
.ver-item {
  border-left: 3px solid #d3dae3;
  padding: 2px 0 2px 12px;
  margin: 0 0 12px;
}
.ver-item:first-child { border-left-color: var(--primary); }
.ver-head {
  display: flex; align-items: baseline; gap: 8px;
  margin-bottom: 2px;
}
.ver-head strong { font-size: 14px; color: #1d2634; }
.ver-date { color: var(--text-light); font-size: 12px; }
.ver-item ul { padding-left: 20px; margin: 2px 0; }
.ver-item li { margin: 2px 0; }

/* ---------- 关于系统 / 版本更新 ---------- */
.link-btn {
  background: none; border: none; padding: 0 4px;
  color: var(--primary); font-size: inherit; cursor: pointer;
  text-decoration: underline; font-family: inherit;
}
.link-btn:hover { color: #1656b0; }
.link-btn:disabled { color: #9aa4b2; cursor: default; text-decoration: none; }

.about-hint { color: #78828f; font-size: 12.5px; margin: 6px 0; }
.ok-text { color: #1f9254; }

/* 版权声明：与上方功能列表拉开距离，末行居中弱化 */
.about-copyright { margin-top: 6px; }
.about-copyright p { margin: 6px 0; }
.about-copyright .copyright-line {
  margin-top: 12px;
  color: #78828f;
  font-size: 12.5px;
  text-align: center;
}

/* 证书即将过期（剩余不足 20 天）：用告警色让它在「关于系统」里一眼可见 */
.cert-warn { color: #c0392b; font-weight: 600; }

/* 登录页公告编辑区（系统管理 → 登录页公告，仅管理员可见） */
.notice-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}
.notice-row input[type="text"] {
  flex: 1;
  min-width: 0;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  outline: none;
}
.notice-row input[type="text"]:focus { border-color: var(--primary); }
/* 通知日期：登录页公告栏左侧那一列显示的就是它。定宽不伸缩，
   否则和正文输入框抢空间时日期会被挤成两位数看不清 */
.notice-row input[type="date"].notice-date-in {
  flex: none;
  width: 140px;
  padding: 5px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
}
.notice-row input[type="date"].notice-date-in:focus { border-color: var(--primary); }
/* 阅读量只读展示：不是输入框，别让人以为能改（它由登录页打开详情的次数累加） */
.notice-row .notice-views-ro {
  flex: none;
  min-width: 62px;
  text-align: right;
  font-size: 12px;
  color: #78828f;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.notice-row .link-btn { flex: none; }
/* 通知类型下拉 / 置顶勾选 / 失效时间：都在 .notice-main 这一行里，定宽不伸缩，
   正文输入框才是唯一伸缩的那一格 */
.notice-row select.notice-tag-in {
  flex: none;
  width: 100px;
  padding: 5px 6px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  background: #fff;
}
/* 编辑区底是深色的（沿用登录界面那一套），下拉框默认白字白底会看不清 */
.notice-row select.notice-tag-in option { color: #1f2937; background: #fff; }
.notice-row select.notice-tag-in:focus { border-color: var(--primary); }
.notice-row .notice-top-in {
  flex: none;
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 13px;
  color: #4b5563;
  white-space: nowrap;
  cursor: pointer;
}
/* 第二行：标签失效时间。放正文下面而不是挤在正文旁边 ——
   那一排已经有勾选/日期/类型/置顶/正文/阅读量/附件/三个按钮，再塞一个 datetime 输入框，
   窗口一窄正文输入框就被压到看不见字了 */
.notice-row .notice-sub {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0 0 26px;
  font-size: 12px;
  color: #78828f;
}
.notice-row input[type="datetime-local"].notice-expire-in {
  padding: 3px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12px;
  font-family: inherit;
  outline: none;
}
.notice-row input[type="datetime-local"].notice-expire-in:focus { border-color: var(--primary); }
/* 已过失效时间：此刻登录页按普通显示，用告警色提示一下，别让人以为标签没生效 */
.notice-exp-hint {
  flex: none;
  padding: 1px 6px;
  border-radius: 4px;
  background: #fdecea;
  color: #c0392b;
  font-size: 11px;
  white-space: nowrap;
}
.notice-row button[disabled] { opacity: 0.35; cursor: default; }
/* 「清除」失效时间：去掉后就是长期有效，清空状态下灰掉，别让人反复点 */
.notice-row .notice-sub button[disabled] { opacity: 0.35; cursor: default; }
.notice-row-on { flex: none; display: flex; align-items: center; }
.notice-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
}
.notice-actions .notice-save { width: auto; padding: 6px 20px; font-size: 13px; }

/* 公告编辑区在 #data-table 里（借用它的表体容器）。
   #data-table td 默认是 nowrap + overflow:hidden + max-width:340px，那是给
   业务表的单元格用的；公告行里是一排输入框和按钮，套用这些样式会被直接截断，
   表现为「公告行右边的一大半看不见」。这里整格放开。 */
#table-body td:has(> #notice-rows) {
  padding: 14px 16px;
  max-width: none;
  overflow: visible;
  white-space: normal;
}
/* 公告页只有一行，悬停变色反而让人以为整片都能点 */
#data-table tbody tr:has(> td > #notice-rows):hover { background: transparent; }

.progress {
  height: 8px; border-radius: 4px; background: #e6eaef;
  overflow: hidden; margin: 10px 0 6px;
}
.progress > div {
  height: 100%; width: 0; border-radius: 4px;
  background: var(--primary); transition: width 0.2s ease;
}
/* 进度宽度走预生成类，不走行内 style：CSP 是 style-src 'self'（没有 unsafe-inline），
   element.style.width = '37%' 会被整段拦下 —— 进度条永远停在 0，看起来就像「卡住没动」。
   0~100 共 101 条，生成规则与 .rc-w-N（公告进度条）一致，别手写一半漏一半。 */
.progress > div.w-0 { width: 0; }
.progress > div.w-5 { width: 5%; }
.progress > div.w-10 { width: 10%; }
.progress > div.w-15 { width: 15%; }
.progress > div.w-20 { width: 20%; }
.progress > div.w-25 { width: 25%; }
.progress > div.w-30 { width: 30%; }
.progress > div.w-35 { width: 35%; }
.progress > div.w-40 { width: 40%; }
.progress > div.w-45 { width: 45%; }
.progress > div.w-50 { width: 50%; }
.progress > div.w-55 { width: 55%; }
.progress > div.w-60 { width: 60%; }
.progress > div.w-65 { width: 65%; }
.progress > div.w-70 { width: 70%; }
.progress > div.w-75 { width: 75%; }
.progress > div.w-80 { width: 80%; }
.progress > div.w-85 { width: 85%; }
.progress > div.w-90 { width: 90%; }
.progress > div.w-95 { width: 95%; }
.progress > div.w-100 { width: 100%; }

#update-foot { display: flex; justify-content: flex-end; gap: 10px; padding-top: 8px; padding-bottom: 16px; }

/* 静默升级开关（1.1.79）：放在更新说明下面、按钮组上面。
   深色小字 + 复选框，不能比「立即更新」更显眼——它是个可选偏好，不是主操作。 */
.upd-policy {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 10px 0 2px;
  padding: 8px 10px;
  border: 1px solid #e2eaf4;
  border-radius: 8px;
  background: #f8fbff;
  font-size: 13px;
  line-height: 1.55;
  color: #3d4b5c;
  cursor: pointer;
}
.upd-policy input { margin-top: 2px; flex: none; }
.upd-policy-state:empty { display: none; }
.upd-policy-state { color: #1f6b3a; }

/* 左侧栏 */
#sidebar {
  width: 220px;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  overflow-y: auto;
  flex-shrink: 0;
}

.sidebar-head {
  padding: 14px 16px 10px;
  font-size: 12px;
  letter-spacing: 2px;
  color: #6d7b8c;
  text-transform: uppercase;
}

#side-nav { list-style: none; padding-bottom: 20px; }

.side-item {
  padding: 11px 20px;
  cursor: pointer;
  font-size: 13.5px;
  border-left: 3px solid transparent;
  transition: background 0.12s;
  user-select: none;
}

.side-item:hover { background: rgba(255,255,255,0.06); color: #e6edf3; }
.side-item.active {
  background: rgba(30,111,217,0.22);
  border-left-color: var(--sidebar-active);
  color: #fff;
  font-weight: 600;
}

/* 内容区 */
#content {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
  background: var(--bg);
}

#page-header { margin-bottom: 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
#page-header h2 { font-size: 20px; color: #1d2634; }
/* 打印模板页右上角「操作说明」：和标题同一行、贴右 */
#btn-tpl-guide { flex: 0 0 auto; }

#toolbar {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
  align-items: center;
}

#search {
  flex: 1;
  max-width: 320px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  outline: none;
  background: #fff;
}

#search:focus { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(30,111,217,0.15); }

button {
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  font-size: 13px;
  color: var(--text);
  transition: all 0.12s;
}

button:hover { border-color: var(--primary); color: var(--primary); }
button:disabled, button:disabled:hover {
  opacity: .5; cursor: not-allowed;
  border-color: var(--border); color: var(--text);
}
button.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
button.primary:hover { background: var(--primary-dark); }
button.primary:disabled, button.primary:disabled:hover {
  background: var(--primary); border-color: var(--primary); color: #fff; opacity: .45;
}
button.danger { color: var(--danger); }
button.danger:hover { border-color: var(--danger); background: #fef1f0; }

/* 表格 */
#table-wrap {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: auto;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

#data-table { width: 100%; border-collapse: collapse; min-width: 720px; }

#data-table th {
  position: sticky; top: 0;
  background: #f7f9fb;
  color: #4a5568;
  font-size: 12.5px;
  text-align: left;
  padding: 11px 12px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  z-index: 1;
}

#data-table th.ops-col { width: 150px; }

/* 勾选列：窄、居中、不参与排序；整列 sticky 左侧会让表格横向滚动时丢失，这里保持普通列 */
#data-table th.sel-col, #data-table td.sel-col { width: 34px; padding-left: 12px; padding-right: 0; text-align: center; }
#data-table td.sel-col input, #data-table th.sel-col input { cursor: pointer; }
/* 选中行底色要区分于 hover 色（hover 是 #f4f8fe，偏蓝），这里用浅绿 */
#data-table tbody tr.row-picked { background: #eefaf1; }
#data-table tbody tr.row-picked:hover { background: #e4f6e9; }

#data-table td {
  padding: 9px 12px;
  border-bottom: 1px solid #f0f2f5;
  font-size: 13px;
  max-width: 340px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#data-table tbody tr:hover { background: #f4f8fe; }

#data-table .ops button { padding: 4px 10px; font-size: 12px; margin-right: 6px; }

.empty-row { text-align: center; color: var(--text-light); padding: 36px 0 !important; }

/* 分页 */
#pagination {
  display: flex; align-items: center; justify-content: flex-end;
  gap: 8px; margin-top: 12px; font-size: 13px; color: var(--text-light);
}

#pagination button { padding: 5px 12px; }

/* ================= 弹窗 ================= */
.modal {
  position: fixed; inset: 0;
  background: rgba(15,23,42,0.45);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
}

.modal.hidden { display: none; }

.modal-box {
  background: #fff;
  width: 680px;
  max-width: 96vw;
  max-height: 88vh;
  border-radius: 10px;
  display: flex; flex-direction: column;
  box-shadow: 0 12px 40px rgba(0,0,0,0.25);

  /* 弹窗可拖动缩放（右下角手柄），内容随宽度自适应 */
  position: relative;
  overflow: hidden;
  container-type: inline-size;
}

/* 右下角拖拽手柄 */
.modal-box::after {
  content: '';
  position: absolute;
  right: 2px; bottom: 2px;
  width: 14px; height: 14px;
  cursor: nwse-resize;
  background:
    linear-gradient(135deg, transparent 0 45%, #c4ccd6 45% 55%, transparent 55% 70%, #c4ccd6 70% 80%, transparent 80%);
  opacity: 0.55;
  pointer-events: none;
  border-radius: 0 0 8px 0;
}

.modal-foot { padding-right: 30px; }

.modal-foot-left { display: flex; gap: 8px; margin-right: auto; align-items: center; }

/* 自动保存状态：低存在感的小字，不打断输入 */
#autosave-hint { font-size: 12px; color: var(--muted, #888); white-space: nowrap; }
#autosave-hint.error { color: #c0392b; }
#autosave-hint:empty { display: none; }

/* 弹窗变窄时内部自适应（member-row / unit-row 的回退规则已移至其基础定义之后） */
@container (max-width: 620px) {
  .modal-body, .sect-body { grid-template-columns: 1fr; }
  .form-field.full, .section-units, .member-editor { grid-column: 1 / -1; }
}

.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  /* 标题栏可以按住拖动挪位置（见 renderer.js 的 initModalDrag） */
  cursor: grab;
}
.modal-head.dragging { cursor: grabbing; }
/* 标题栏里的按钮仍是普通指针，不然「×」看着像能拖着走 */
.modal-head button, .modal-head a, .modal-head input, .modal-head select, .modal-head label { cursor: pointer; }

.modal-head h3 { font-size: 16px; }

.close {
  background: none; border: none;
  font-size: 22px; line-height: 1;
  color: var(--text-light);
  padding: 2px 6px;
}
.close:hover { color: var(--danger); }

.modal-body {
  padding: 18px 20px;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px 16px;
}

.form-field { display: flex; flex-direction: column; gap: 5px; }
.form-field.full { grid-column: 1 / -1; }

.form-field label { font-size: 12.5px; color: #55617a; font-weight: 500; }
.form-field label .req { color: var(--danger); margin-left: 2px; }

.form-field input, .form-field select, .form-field textarea {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  background: #fff;
}

.form-field textarea { min-height: 84px; resize: vertical; }

/* 自适应项目单位（致施工单位等）：容器不参与样式，里面的 input/select 走上面的通用规则 */
.unit-pick { display: block; }
.unit-pick > input, .unit-pick > select { width: 100%; box-sizing: border-box; }

/* 录入提速：长文本框上方的常用短语胶囊（点击插入光标处） */
.quick-fill { display: flex; flex-wrap: wrap; gap: 6px; }
.qf-chip {
  padding: 3px 9px;
  font-size: 12px;
  line-height: 1.5;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #f7f9fc;
  color: #55617a;
  cursor: pointer;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.qf-chip:hover { border-color: var(--primary); color: var(--primary); background: #eef4fd; }

/* 多选字段（质量证明文件）：已选 chips + 手填框 + 常用选项胶囊 */
.multi-select { display: flex; flex-direction: column; gap: 6px; }
.ms-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ms-chips:empty { display: none; }
.ms-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 6px 3px 10px;
  font-size: 12px; line-height: 1.5;
  border-radius: 12px;
  border: 1px solid var(--primary);
  background: #eef4fd; color: var(--primary);
}
.ms-chip .ms-chip-x {
  border: none; background: transparent; cursor: pointer;
  color: var(--primary); font-size: 13px; line-height: 1; padding: 0 2px;
}
.ms-chip .ms-chip-x:hover { color: var(--danger); }
.multi-select .ms-input { width: 100%; }
.ms-options { display: flex; flex-wrap: wrap; gap: 6px; }
.ms-opt {
  padding: 3px 9px;
  font-size: 12px; line-height: 1.5;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #f7f9fc;
  color: #55617a;
  cursor: pointer;
}
.ms-opt:hover { border-color: var(--primary); color: var(--primary); background: #eef4fd; }
.ms-opt.active { border-color: var(--primary); color: #fff; background: var(--primary); }
.form-field input:focus, .form-field select:focus, .form-field textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(30,111,217,0.12);
}

.modal-foot {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
}

/* 打印预览：靠左单独一档，与「取消/保存」区隔开，避免误点是保存 */
.modal-foot .ghost-left { margin-right: auto; }

/* 通用确认框：替代原生 alert/confirm/prompt */
/* 层级要高于登录页(300)、文件弹窗(200)，否则「登录失效」这类提示会被盖住 */
#confirmDlg { z-index: 400; }
/* 上面那条 #id 选择器的优先级高于 .modal.hidden，会把 .hidden 的 display:none 压掉，
   结果是「隐藏」的确认框仍铺满全屏，挡住下面所有表单——点输入框点到的全是它。
   因此这里必须用同等优先级单独关掉。 */
#confirmDlg.hidden { display: none; }
.modal-box.confirm-box { width: 420px; }
.modal-box.confirm-box::after { display: none; }   /* 不需要拖拽手柄 */
.confirm-body { display: block; }
.confirm-body p {
  margin: 0; white-space: pre-wrap; word-break: break-word;
  line-height: 1.7;
}
.confirm-body input { width: 100%; margin-top: 12px; }
/* 多行输入（退回意见、待办跟帖）：跟单行框同样宽度，但可拉高、不横向溢出 */
.confirm-body textarea {
  width: 100%; margin-top: 12px; box-sizing: border-box;
  min-height: 88px; max-height: 40vh; resize: vertical;
  font: inherit; line-height: 1.6;
}
/* 单选列表（附表选择这类七选一）：选项多时自身滚动，撑不高弹窗 */
.confirm-radio { max-height: 46vh; overflow: auto; margin-top: 10px; }
.confirm-radio label {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 4px; border-radius: 4px; font-size: 13px; cursor: pointer;
}
.confirm-radio label:hover { background: #f2f3f5; }
.confirm-radio input[type="radio"] { width: auto; margin: 0; flex: 0 0 auto; }
/* 危险操作的主按钮用实心红，避免批量删除时误点 */
.modal-box.confirm-box button.primary.danger {
  background: var(--danger); border-color: var(--danger); color: #fff;
}
.modal-box.confirm-box button.primary.danger:hover { background: #c0392b; }

/* ================= 附表类型选择（旁站记录 detail_table） ================= */
.detail-table-field .dt-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.detail-table-field .dt-picked { flex: 1 1 auto; font-size: 13px; }
.detail-table-field .dt-name { font-weight: normal; }
.detail-table-field .dt-name.muted { color: var(--muted, #888); }
.detail-table-field button { padding: 4px 12px; font-size: 12px; }

/* ================= 现场照片（水印设置弹窗 + 表单缩略图网格） ================= */
/* #photoDlg 有自己的 z-index，比 .modal.hidden 优先级高，必须单独关掉
   （同 #confirmDlg.hidden 的坑：不写就会铺满全屏挡住表单） */
#photoDlg { z-index: 350; }
#photoDlg.hidden { display: none; }
.modal-box.photo-box { width: 820px; max-width: 96vw; }
.photo-body { display: flex; gap: 16px; align-items: flex-start; }
.photo-preview {
  flex: 0 0 auto; width: 420px; max-width: 46vw;
  background: #1b1b1b; border-radius: 6px; overflow: hidden;
  display: flex; align-items: center; justify-content: center; min-height: 200px;
}
.photo-preview canvas { max-width: 100%; max-height: 380px; display: block; }
.photo-opts { flex: 1 1 auto; min-width: 240px; }
.photo-opts label {
  display: block; font-size: 12px; color: var(--muted, #666); margin: 10px 0 4px;
}
.photo-opts input[type="text"],
.photo-opts select { width: 100%; box-sizing: border-box; }
.photo-fixed input[readonly] { background: #f2f3f5; color: #555; }
.photo-row { display: flex; gap: 12px; }
.photo-row > div { flex: 1 1 0; min-width: 0; }
.photo-row input[type="range"] { width: 100%; }
.photo-row input[type="color"] { width: 100%; height: 32px; padding: 2px; }
.photo-check {
  display: flex; align-items: center; gap: 6px;
  margin-top: 14px; font-size: 13px; color: var(--text, #333);
}
/* 表单里的照片网格 */
.photo-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 8px; margin-top: 6px;
}
.photo-cell { position: relative; border-radius: 6px; overflow: hidden; background: #eef0f2; }
.photo-cell img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; }
.photo-name {
  display: block; padding: 2px 4px; font-size: 11px; color: #555;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.photo-del {
  position: absolute; top: 4px; right: 4px; width: 20px; height: 20px; padding: 0;
  border-radius: 50%; border: 0; background: rgba(0,0,0,.55); color: #fff;
  font-size: 14px; line-height: 20px; cursor: pointer;
}
.photo-del:hover { background: rgba(200,40,40,.9); }
.photo-empty {
  grid-column: 1 / -1; padding: 14px; text-align: center;
  font-size: 12px; color: #888; border: 1px dashed #ccd0d5; border-radius: 6px;
}
.photo-actions { display: flex; align-items: center; gap: 12px; margin-top: 8px; flex-wrap: wrap; }
.photo-hint { font-size: 12px; color: #888; }
/* 新增态暂存照片的提示：跟普通说明文字区分开，提醒这些还没落库 */
.photo-hint.photo-pending-hint { color: #b45309; }
.photo-hint.photo-pending-hint::before { content: '●'; margin-right: 4px; font-size: 10px; }
#modal-form [data-photo-add]:disabled { cursor: not-allowed; }

/* ================= 分区折叠长表单（工程项目） ================= */
.modal-box.sectioned { width: 900px; max-width: 96vw; }
.modal-box.sectioned .modal-body { display: block; }

.form-sect {
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 12px;
  overflow: hidden;
  background: #fff;
}

.sect-head {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  background: #f7f9fb;
  cursor: pointer;
  font-size: 14px; font-weight: 600; color: #1d2634;
  user-select: none;
  transition: background 0.12s;
}
.sect-head:hover { background: #eef2f7; }

.sect-dot {
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--primary); color: #fff;
  font-size: 12px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.sect-arrow { margin-left: auto; color: var(--text-light); transition: transform 0.15s; }
.form-sect.collapsed .sect-arrow { transform: rotate(-90deg); }
.form-sect.collapsed .sect-body { display: none; }

.sect-body {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px 18px;
  padding: 14px 16px;
}

/* 参建单位：每方一行 */
.section-units { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 8px; }

.unit-row {
  display: grid;
  grid-template-columns: 92px 1fr 1fr 1fr;
  gap: 10px;
  align-items: center;
}

/* 同 member-row：允许轨道收缩，窄弹窗下不溢出 */
.unit-row > * { min-width: 0; }

.unit-title { font-size: 13px; color: #55617a; font-weight: 500; }

.unit-row input {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  outline: none;
  background: #fff;
}

.unit-row input:focus { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(30,111,217,0.12); }

/* 项目部成员编辑器 */
.member-editor { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 6px; }
.member-editor #add-member { align-self: flex-start; padding: 6px 16px; margin-top: 4px; }

.member-row {
  display: grid;
  grid-template-columns: 0.85fr 1.4fr 1.1fr 126px 1.05fr 126px 1fr 46px;
  gap: 8px;
  align-items: center;
}

/* 允许 fr 轨道收缩：input 固有最小宽度(~198px)否则会把行撑破，
   导致表头与输入框错位（列被挤出容器） */
.member-row > * { min-width: 0; }

.member-row input {
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  outline: none;
  background: #fff;
}

.member-row input:focus { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(30,111,217,0.12); }

.member-row .del-member { padding: 5px 0; }

.member-row.mh {
  font-size: 12px;
  color: var(--text-light);
  border-bottom: 1px solid var(--border);
  padding-bottom: 4px;
}

/* 表头文字与输入框内的文字左对齐：输入框 padding 10px + border 1px = 11px */
.member-row.mh > span { padding: 0 11px; }

/* 窄弹窗回退：改自动换列并隐藏表头。
   ⚠ 必须放在上方基础规则之后 —— 同优先级下后者胜，放前面会被覆盖成死代码 */
@container (max-width: 820px) {
  .member-row { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
  .member-row.mh { display: none; }
  .unit-row { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
}

@media (max-width: 1100px) {
  .member-row { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
  .member-row.mh { display: none; }
  .unit-row { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
}

/* 更窄窗口下内容继续自适应 */
@media (max-width: 860px) {
  .ov-grid { grid-template-columns: 1fr 1fr; }
  .brand-sub { display: none; }
  #toolbar { flex-wrap: wrap; }
  #search { max-width: none; flex: 1 1 100%; }
}

/* ================= 手机竖屏（≤ 640px） =================
   目标：手机浏览器打开网页版时可用，不改变桌面端任何表现。
   桌面窗口最窄一般也在 800px 以上，下面这些规则实际只对手机生效。 */
@media (max-width: 640px) {
  /* 顶栏：品牌文字让位给导航，项目下拉与退出按钮缩小，避免挤成一条 */
  #topbar { height: 52px; padding: 0 10px; gap: 8px; }
  .brand-text { display: none; }
  .brand { flex-shrink: 0; }
  /* 模块标签：桌面是 11 个 flex:1 平分，手机上会各剩 12px 宽、文字全被截掉。
     窄屏改成固定最小宽度 + 横向滚动，每个标签保持可读。
     flex:1 1 auto 让标签栏吃掉顶栏剩余宽度：不写的话它只按内容收缩到 120px 左右，
     而右侧「项目下拉+连接状态+退出」反而占掉 154px，主入口比次要按钮还窄。 */
  #top-nav {
    flex: 1 1 auto;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;           /* Firefox */
    -webkit-overflow-scrolling: touch;
  }
  #top-nav::-webkit-scrollbar { display: none; }
  .tab {
    flex: 0 0 auto;
    min-width: 68px;
    padding: 0 10px;
    font-size: 13px;
  }
  .tab-help { flex: 0 0 auto; min-width: 56px; }
  /* 右侧这组不参与收缩（flex-shrink:0），它每多占 1px，模块标签栏就少 1px。
     项目下拉 88px + 连接状态 + 退出 44px 实测吃掉 154px，标签栏只剩 120px。
     手机上项目下拉压到 76px、去掉内层左右内边距，标签栏能多回 ~20px。 */
  .top-right { gap: 4px; }
  .proj-switch { max-width: 76px; padding: 6px 2px; font-size: 11.5px; }
  .cur-user { display: none; }
  /* 「退出登录」只有顶栏这一处入口（侧边栏没有），手机上不能隐藏，
     只能把文字缩到最小，把宽度尽量让给模块标签栏。 */
  .quit-btn { padding: 5px 4px; font-size: 11px; line-height: 1.2; max-width: 42px; }

  /* 侧边栏：桌面是 220px 常驻的 flex 列，手机上会把内容区挤到只剩 140px。
     窄屏改成「浮层抽屉」——脱离文档流、盖在内容上，内容区始终占满宽度；
     点顶栏汉堡按钮（toggleSidebar）仍能展开/收起，行为与桌面一致。
     抽屉默认是收起的（见 renderer.js 的 init：窄屏且用户没手动选过时加
     sidebar-collapsed），收起时 display:none。 */
  #body { position: relative; }
  #sidebar {
    position: absolute;
    top: 0; left: 0; bottom: 0;
    /* 必须高于所有 .modal（100）、#photoDlg（350）、#confirmDlg（400）：
       登录后若存在未恢复的草稿，checkPendingDrafts() 会先弹 #confirmDlg，
       它铺满全屏且带 45% 深色底。抽屉层级压在它下面时，用户点汉堡展开后
       看到的是那层遮罩，表现就是「功能菜单看不见」。抽屉本身是全屏最高的浮层。 */
    z-index: 500;
    width: 220px;
    box-shadow: 4px 0 18px rgba(0,0,0,0.28);
  }
  /* 抽屉展开时，右侧内容区变暗，点一下即可收起（靠 body 类名控制，不额外加遮罩节点） */
  .sidebar-collapsed #sidebar { display: none; }

  /* 手机抽屉是唯一的导航入口：顶栏模块标签要横向滚动才点得到，用户不会知道还有别的模块。
     所以抽屉里把所有模块分组列出（见 renderer.js renderSideNav 的窄屏分支），
     分组标题可点：切到该模块并展开其功能，已在该模块时只做折叠/展开。 */
  .side-group { list-style: none; margin-bottom: 2px; }
  .side-group-head {
    padding: 10px 20px 6px;
    font-size: 11.5px;
    letter-spacing: 1.5px;
    color: #6d7b8c;
    cursor: pointer;
    user-select: none;
  }
  .side-group.active > .side-group-head { color: #9fb6cd; }
  .side-group-head::before {
    content: '▸';
    display: inline-block;
    width: 12px;
    margin-left: -12px;
    transform: rotate(90deg);
    transition: transform 0.12s;
  }
  /* 子列表收起时箭头朝右，给用户「可以展开」的暗示 */
  .side-group:has(> .side-sub.hidden) > .side-group-head::before { transform: rotate(0deg); }
  .side-sub { list-style: none; }
  /* 分组里的功能项比桌面多一层缩进，读起来是「模块 → 功能」两级 */
  .side-sub .side-item { padding-left: 32px; }

  /* 内容区：收窄内边距，把宽度还给表格 */
  #content { padding: 12px; }
  #page-header { margin-bottom: 10px; }
  #page-header h2 { font-size: 17px; }

  /* 工具栏：按钮会自动换行（见 860px 断点），这里只压缩间距与内边距 */
  #toolbar { gap: 6px; margin-bottom: 10px; }
  #toolbar button { padding: 7px 10px; font-size: 12.5px; }

  /* 表格：保持横向滚动（#table-wrap 已有 overflow:auto）。
     桌面端给单元格的 340px 上限在手机上会把一行撑得过宽，按视口放宽。 */
  #data-table { min-width: 640px; }
  #data-table td { max-width: 180px; padding: 8px 10px; }
  #data-table th { padding: 9px 10px; }

  /* 概览卡片：两列并排在手机上太挤，改单列 */
  .ov-grid { grid-template-columns: 1fr; }
  .ov-lists { grid-template-columns: 1fr; }

  /* 弹窗：基础 .modal-box 已有 max-width:96vw，这里补内边距与高度的收放 */
  .modal-box { max-height: 88vh; }
}

/* 手机横屏介于两者之间时，概览保持两列即可，无需额外规则 */

/* ================= Toast ================= */
.toast {
  position: fixed;
  top: 70px; left: 50%;
  transform: translateX(-50%);
  padding: 10px 22px;
  border-radius: 6px;
  color: #fff;
  font-size: 13px;
  z-index: 200;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}

.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
.toast.hidden { display: none; }

/* ================= 附件管理弹窗 ================= */
.modal-box.file-box { width: 640px; }

.file-toolbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
}

.file-tip { font-size: 12px; color: var(--text-light); }
.file-req { color: var(--primary); font-weight: 600; }

.file-list {
  padding: 10px 20px 18px;
  overflow-y: auto;
  max-height: 46vh;
}

.file-empty {
  text-align: center;
  color: var(--text-light);
  padding: 40px 0;
  font-size: 13px;
}

.file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 10px;
  border-bottom: 1px solid #f0f2f5;
}

.file-item:hover { background: #f7fafd; }

.file-info { min-width: 0; }
.file-name { font-size: 13.5px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-meta { font-size: 12px; color: var(--text-light); margin-top: 3px; }

.file-ops { display: flex; gap: 6px; flex-shrink: 0; }
.file-ops button { padding: 5px 12px; font-size: 12px; }

/* ================= 项目绑定弹窗 ================= */
.modal-box.bind-box { width: 520px; }

.bind-body {
  padding: 18px 20px;
  max-height: 52vh;
  overflow-y: auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 16px;
}

.bind-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
}

.bind-item:hover { border-color: var(--primary); }
.bind-item input { accent-color: var(--primary); }

.bind-empty { grid-column: 1 / -1; text-align: center; color: var(--text-light); padding: 30px 0; }

/* ================= 工作台今日概览 ================= */
#overview-wrap { padding: 2px 0 10px; }

.ov-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.ov-card {
  background: #fff;
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: 10px;
  padding: 16px 18px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.ov-card.warn { border-left-color: #f5a623; }
.ov-card.danger { border-left-color: var(--danger); }
.ov-card.ok { border-left-color: var(--success); }

.ov-num { font-size: 30px; font-weight: 700; color: #1d2634; line-height: 1.2; }
.ov-label { font-size: 13px; color: var(--text-light); margin-top: 4px; }

.ov-lists { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }

@media (max-width: 1100px) { .ov-lists { grid-template-columns: 1fr; } }

.ov-block {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
}

.ov-block h4 { font-size: 14px; color: #1d2634; margin-bottom: 8px; }

.ov-empty { color: var(--text-light); font-size: 13px; padding: 12px 0; text-align: center; }

.ov-todo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 6px;
  border-bottom: 1px solid #f0f2f5;
  cursor: pointer;
  font-size: 13px;
}
.ov-todo:hover { background: #f4f8fe; }
/* 有关联单据的待办会直接跳过去：给个箭头，跟「只切到待办列表」的手动待办区分开 */
.ov-todo[data-ref-id]:not([data-ref-id=""]) .tt::after { content: ' →'; color: var(--primary); }

.ov-todo .pri {
  flex-shrink: 0;
  font-size: 12px;
  padding: 1px 8px;
  border-radius: 10px;
}
.p-high { background: #fde8e7; color: var(--danger); }
.p-mid { background: #fff3e0; color: #e08a00; }
.p-low { background: #e8f5e9; color: var(--success); }

.ov-todo .tt { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ov-todo .pm { color: var(--text-light); font-size: 12px; flex-shrink: 0; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ov-todo .dued { color: var(--text-light); font-size: 12px; flex-shrink: 0; }
.ov-todo .src-auto { flex-shrink: 0; font-size: 11px; color: #1e6fd9; background: #eaf1fd; padding: 1px 6px; border-radius: 8px; }
.ov-todo .src-man { flex-shrink: 0; font-size: 11px; color: #7a8494; background: #f0f2f5; padding: 1px 6px; border-radius: 8px; }

.ov-go {
  width: 100%;
  margin-top: 10px;
  padding: 7px;
  border: none;
  background: transparent;
  color: var(--primary);
  font-size: 13px;
  cursor: pointer;
  text-align: center;
}
.ov-go:hover { background: #eef4fd; border-radius: 6px; }

/* 待办状态列标签 */
#data-table td .tag { display: inline-block; padding: 1px 8px; border-radius: 9px; font-size: 12px; }
#data-table td .tag.t-done { background: #e8f5e9; color: var(--success); }
#data-table td .tag.t-doing { background: #eaf1fd; color: var(--primary); }
#data-table td .tag.t-open { background: #fff3e0; color: #e08a00; }
#data-table td .tag.t-cancel { background: #f0f2f5; color: var(--text-light); }
/* B-41 台账的来源标记：「审·改」= 自动生成后又被人工改过，用橙色提醒会被审核单覆盖 */
#data-table td .tag.t-warn { background: #fff3e0; color: #e08a00; }

/* B-41 台账「累计支付占合同总价比例」超过 100%：标红加粗。
   只提醒不拦 —— 超付可能是真的，也可能只是合同额填少了，但列表上必须看得见。 */
#data-table td .over-ratio { color: #c0392b; font-weight: 600; }

/* 可点单元格（项目名→简报、计量周期→审核结果）。少了这条就只有默认箭头，
   用户看不出能点；<span> 本来也不带链接样式。 */
#data-table td .cell-link { color: var(--primary); cursor: pointer; }
#data-table td .cell-link:hover { text-decoration: underline; }

/* 规划与细则的标题可点预览：按链接光标 + 悬停下划线（继承 .cell-link），
   这里只把「点得开」的意思说清楚，不额外改颜色 */
#data-table td .doc-preview { white-space: nowrap; }

/* 点标题选预览：一行一份附件，整行可点 */
.doc-pv-list { max-height: 60vh; overflow: auto; padding: 4px 2px; }
.doc-pv-item {
  display: flex; flex-direction: column; gap: 2px;
  padding: 9px 12px; border-radius: 6px; cursor: pointer;
  border-bottom: 1px solid var(--border, #e6e9f0);
}
.doc-pv-item:last-child { border-bottom: 0; }
.doc-pv-item:hover { background: #eef4ff; }
.doc-pv-name { font-size: 14px; color: var(--primary); word-break: break-all; }
.doc-pv-meta { font-size: 12px; color: var(--text-light); }

/* 规划细则被退回时列表里露出的意见：橙色左边线，和「草稿」一眼区分 */
#data-table td .rej-note {
  display: inline-block;
  max-width: 100%;
  padding-left: 6px;
  border-left: 3px solid #e08a00;
  color: #9a5b00;
  text-align: left;
  line-height: 1.5;
}

/* 批准意见：绿色左边线，和橙色退回意见一眼区分（同一张表里两种意见不会同时出现在同一行） */
#data-table td .apv-note {
  display: inline-block;
  max-width: 100%;
  padding-left: 6px;
  border-left: 3px solid #2f9e44;
  color: #1f7a33;
  text-align: left;
  line-height: 1.5;
}

/* 通知单回复情况（1.4.6）：施工单位扫码填的整改回复。左侧蓝色线示意「这是外部填进来的」，
   和监理自己写的意见（橙/绿）区分开；空的写灰字「未回复」，一眼看出还没交。 */
#data-table td .rep-note {
  display: inline-block;
  max-width: 100%;
  padding-left: 6px;
  border-left: 3px solid #1c7ed6;
  color: #1a5fa0;
  text-align: left;
  line-height: 1.5;
}
#data-table td .rep-empty { color: #9aa4b0; }

/* 待办截止日期：已逾期标红加天数，今天到期标橙，未到期灰、已完成淡化。
   颜色之外都带有文字（逾期N天 / 今天），不只靠颜色区分。 */
#data-table td .due-over { color: var(--danger); font-weight: 600; white-space: nowrap; }
#data-table td .due-over em,
#data-table td .due-today em {
  font-style: normal; font-size: 11px; margin-left: 2px;
  padding: 0 5px; border-radius: 8px; background: #fde8e7;
}
#data-table td .due-today { color: #c26a00; font-weight: 600; white-space: nowrap; }
#data-table td .due-today em { background: #fff3e0; color: #c26a00; }
#data-table td .due-ok { color: var(--text-light); white-space: nowrap; }
#data-table td .due-done { color: var(--text-light); opacity: .65; white-space: nowrap; }

/* 待办页筛选卡条：状态 × 来源两组 chip（与工程项目 5 列大卡共用 #list-cards） */
#list-cards.todo-cards {
  display: block;
  margin-bottom: 12px;
}
.todo-grp { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.todo-grp + .todo-grp { margin-top: 8px; }
.todo-grp-t {
  flex: 0 0 auto; width: 40px; text-align: right;
  font-size: 12px; color: var(--text-light);
}
.todo-grp-cards { display: flex; gap: 8px; flex-wrap: wrap; }
.todo-chip {
  font: inherit; font-size: 13px; line-height: 20px;
  padding: 3px 12px; border-radius: 14px; cursor: pointer;
  border: 1px solid var(--border); background: #fff; color: var(--text); }
.todo-chip:hover { border-color: var(--primary); color: var(--primary); }
.todo-chip:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.todo-chip.on {
  background: var(--primary); border-color: var(--primary); color: #fff;
}
/* 各组的小圆点区分状态，但不只是靠颜色：文字本身就在 chip 里 */
.todo-chip.warn::before,
.todo-chip.ok::before,
.todo-chip.danger::before {
  content: ''; display: inline-block; width: 6px; height: 6px;
  border-radius: 50%; margin-right: 6px; vertical-align: middle;
}
.todo-chip.warn::before { background: #e08a00; }
.todo-chip.ok::before { background: var(--success); }
.todo-chip.danger::before { background: var(--danger); }
.todo-chip.on.warn::before,
.todo-chip.on.ok::before,
.todo-chip.on.danger::before { background: #fff; }

/* 完成按钮 */
button.ok { color: var(--success); border-color: var(--success); }
button.ok:hover { background: #e8f5e9; }

/* ================= 登录页 ================= */
/* 布局：左列通高是公告栏（宽度 = 登录框的 2 倍 = 800），右列上=登录框、下=应用下载。
   用 grid-template-areas 而不是挪 DOM：三块的文档顺序保持「公告 → 登录 → 下载」，
   Tab 键和读屏顺序就还是自然的。
   列宽固定（左 800 / 右 400），中间留 gap，整块靠 justify-content 横居中 ——
   用 1fr 两列的话窗口一宽，两块会各自被撑到一半屏宽、越宽越难看。
   两列等高：右列两块叠在同一个网格区域（登录框 start、下载区 end），
   行高按两块总和算；左列公告栏 stretch 占满这一行，于是两列同高同顶同底。 */
.login-page {
  position: fixed;
  inset: 0;
  display: grid;
  /* 弹性流式，不再写死 800px：公告栏吃掉剩余空间（1fr），登录列固定 400。
     小窗口时 1fr 会缩到 0 以下把内容挤扁，所以必须 minmax(0, 1fr) ——
     minmax 的 0 下限同时挡住「内部长表格把整列撑破」。 */
  grid-template-columns: minmax(0, 1fr) minmax(0, 400px);
  /* 两列是第一行，页脚整行铺满第二行 */
  grid-template-rows: auto auto;
  grid-template-areas:
    "notice login"
    "foot   foot";
  column-gap: clamp(20px, 4vw, 56px);
  row-gap: 16px;
  /* 整块限宽居中，但左右留白跟着视口变 —— 超宽屏上两列不会被拉到 2400px 宽 */
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px clamp(12px, 2.5vw, 32px);
  box-sizing: border-box;
  justify-content: center;
  /* 内容超过一屏时靠纵向滚动兜住（窗口矮、公告多、下载区展开旧版本有 600 多像素）。
     必须用 safe center：plain center 会把超出部分的上下两端各裁一半、滚都滚不到 */
  align-content: safe center;
  background: linear-gradient(135deg, #16324f 0%, #1e6fd9 60%, #3a9be8 100%);
  z-index: 300;
}

.login-page.hidden { display: none; }

/* 左列：公告栏整列通高 */
.login-page > .login-notice {
  grid-area: notice; align-self: stretch;         /* 右列两块加起来多高，公告栏就多高 */
  /* 1fr 列的默认最小宽度是内容宽度，公告正文里的长串（URL、连续英文）
     会把整列撑到视口以外、出现横向滚动条 */
  min-width: 0;
}
/* 右列：登录框在上、下载区在下，纵向 flex 依次排开。
   两块必须在**不同的**盒子里上下排 —— 1.1.63 起试过把它们「叠在同一个 grid 区域」、
   靠 align-self: start/end 一上一下分居，那只是摆上去，格子行高只按登录框算，
   下载区贴底时整块落在登录框的高度范围内。窗口够高时被公告栏撑住看不出来，
   窗口一矮（实测 1380×720：登录框 186..534、下载区 426..534）就压住「登录」按钮。
   flex 容器的自然高度 = 两口之和，才是真的不重叠。
   下载区**紧贴登录框下方**（不再用 margin-top:auto 推到右列底部）：右列高度就等于
   「登录框 + 14 + 下载区」，公告栏 stretch 跟它等高 —— 两个数字严格对得上，
   不会出现「公告栏比右列多出一截、下载区悬在半空」的观感。
   gap 给 14px：两块之间必须有缝，否则看着像连成一体。 */
.login-page > .login-side {
  grid-area: login;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 14px;
  /* 别写 min-height: 0 —— flex 项在「单列、行高 auto」时会被 grid 压到内容以下，
     下载区就被挤到视口外面（实测 1280×600：容器 391 高，里面两块要 470）。
     被子撑高就让它撑高，超高交给 .login-page 的 overflow-y 滚。 */
}
.login-side > .login-box,
.login-side > .login-download { flex: none; }
/* 平板 / 手机：登录列本身收窄到 480 以内并居中，否则单列时登录框会跟公告栏一样宽，
   输入框横贯整个屏幕、看着像一张表单铺满了屏 */
.login-side { width: 100%; max-width: 480px; margin: 0 auto; }

/* ================= 登录页页脚 =================
   整行铺满两列（grid-area: foot），不跟着某一列走：
   友情链接、应用下载、运行时间、备案号、维护电话挤在一列 400px 里会换好几行。
   内容少时靠 justify/align 居中，不用留白撑高 —— 页脚的高度就是内容高度。 */
.login-page > .login-foot {
  grid-area: foot;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.22);
  color: rgba(255, 255, 255, 0.88);
  font-size: 12.5px;
  /* 别写 min-height: 0 —— 和 .login-side 同一个坑：会被 grid 压到内容以下 */
}

.login-foot a { color: #eaf2ff; text-decoration: none; }
.login-foot a:hover { text-decoration: underline; }

/* 友情链接：一行「友情链接：分类▾ 分类▾ …」
   align-items 用 flex-start 而不是 center：某个分类展开后它自己变高，
   用 center 会把同一行的其它分类一起推到中间，整行跟着上下跳。 */
.login-foot .foot-links {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: center;
  gap: 6px 14px;
  max-width: 100%;
}

/* 「友情链接：」标签，用伪元素挂在容器上，省一个 DOM 节点 */
.login-foot .foot-links:not(.hidden)::before {
  content: '友情链接：';
  opacity: 0.72;
  line-height: 24px;
}

.login-foot .foot-cat { position: relative; }

.login-foot .foot-cat-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 24px;
  padding: 0 8px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font: inherit;
  cursor: pointer;
}

.login-foot .foot-cat-btn:hover { background: rgba(255, 255, 255, 0.2); }
.login-foot .foot-cat-btn[aria-expanded="true"] { background: rgba(255, 255, 255, 0.26); }

/* 箭头：和下载区的收起箭头同一套画法（不受字体影响） */
.login-foot .foot-cat-btn::after {
  content: '';
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  opacity: 0.85;
  transform: rotate(0deg);
  transition: transform 0.15s;
}

.login-foot .foot-cat-btn[aria-expanded="true"]::after { transform: rotate(180deg); }

/* 展开的分类列表：**向上**弹（bottom: calc(100% + 6px)）。
   页脚在页面最底部，向下弹会直接出视口、滚都滚不到。 */
.login-foot .foot-cat-list {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 320;
  min-width: 140px;
  max-width: 260px;
  margin: 0;
  padding: 6px 0;
  list-style: none;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.22);
}

.login-foot .foot-cat-list.hidden { display: none; }

.login-foot .foot-cat-list li { margin: 0; }

.login-foot .foot-cat-list a {
  display: block;
  padding: 6px 14px;
  color: #1f3b5c;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.login-foot .foot-cat-list a:hover { background: #eef5ff; text-decoration: none; }

/* 一行信息：应用下载 | 已稳定运行 | 备案号 | 网站维护 */
.login-foot .foot-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px 10px;
}

/* 分隔符统一由 CSS 挂在每一项前面（除第一项），这样某一项隐藏时不会留下孤零零的竖线 —— 
   比在 HTML 里摆 <span>|</span> 再逐个隐藏可靠。 */
.login-foot .foot-meta > * + *::before {
  content: '|';
  margin-right: 10px;
  opacity: 0.4;
}

/* 每一项前面都带竖线，某一项 hidden 后它的竖线也就跟着不渲染了（display:none 的元素没有伪元素），
   不会出现「连着两条竖线」—— 所以不需要给隐藏项的下一项单独擦线。 */
.login-foot .foot-meta > .hidden { display: none; }

.login-foot .foot-maint { opacity: 0.78; }


/* 登录页公告栏：宽度 = 登录框的 2 倍（800px），一条一行的纵向列表。
   1.1.63 之前是单行横向滚动：滚得快时来不及读完、文字还会从鼠标底下滑走点不中，
   公告一多就只能等它一圈圈转。改成静态列表后每条都能看清、点得准。 */
.login-notice {
  display: flex;
  flex-direction: column;
  /* 宽度交给 grid 列的 1fr，自己别定死 800px —— 定死后窗口一变宽就是
     「公告栏留在原地、右列被推到右边」，中间空出一大条 */
  width: auto;
  min-width: 0;
  max-width: 100%;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 10px;
  overflow: hidden;
  color: #fff;
  font-size: 15px;
}

.login-notice.hidden { display: none; }

/* 栏头：左边「通知」标签，右边条数。标题栏和列表同宽，视觉上像一块面板 */
.login-notice .notice-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px 0 0;
  background: rgba(255, 255, 255, 0.1);
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  height: 38px;
  flex: none;
}

.login-notice .notice-tag {
  flex: none;
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.22);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1px;
}

.login-notice .notice-sum { margin-left: auto; font-size: 14px; opacity: 0.8; }

/* 公告检索框：夹在「通知」标签和条数之间，吃掉剩余宽度但不超过 200px ——
   太宽会把「共 N 条」挤到换行，太窄连四个字都放不下。
   底是半透明白，输入文字和占位符都走白色系，和栏头同一种材质。 */
.login-notice .notice-search {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  max-width: 200px;
  margin-left: 6px;
}
.login-notice .notice-search input {
  width: 100%;
  height: 24px;
  padding: 0 22px 0 8px;      /* 右边留出清空按钮的位置 */
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font: inherit;
  font-size: 13px;
  outline: none;
  /* 移动 Safari 在 <16px 时聚焦会放大页面，手机上把字号抬到 16 */
  -webkit-appearance: none;
}
.login-notice .notice-search input::placeholder { color: rgba(255, 255, 255, 0.66); }
.login-notice .notice-search input:focus {
  border-color: rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.2);
}
/* 搜索框的原生「×」在深色底上是黑的，藏掉，用自己的清空按钮 */
.login-notice .notice-search input::-webkit-search-cancel-button { display: none; }
.login-notice .notice-q-clear {
  position: absolute;
  top: 50%;
  right: 4px;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  color: #fff;
  font-size: 12px;
  line-height: 16px;
  text-align: center;
  cursor: pointer;
}
.login-notice .notice-q-clear:hover { background: rgba(255, 255, 255, 0.45); }
/* #id 优先级高于单类选择器，`.hidden` 单独写在这里压不过上面那条 position 规则，
   所以清空按钮要显式补一条 */
.login-notice .notice-q-clear.hidden { display: none; }

/* 检索无命中：面板不收起（否则连搜索框一起消失，用户清不了关键词），
   列表位置给一行提示 */
.login-notice .notice-empty {
  padding: 18px 14px;
  font-size: 14px;
  opacity: 0.75;
  text-align: center;
  word-break: break-all;
}

/* 列表本身占满剩余高度：公告多时在这里滚，栏头不动。
   用 flex:1 + min-height:0 而不是固定高度 —— 固定高度在「只有一两条」时会留一大块空白，
   面板会显得空心。 */
.login-notice .notice-list {
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;   /* 滚到列表尽头不要把整个登录页一起带着滚 */
}

/* 一行 = 日期 | 主要内容 | 阅读量。三列用 grid：日期和阅读量定宽，
   内容吃掉剩余宽度，行与行之间三列严格对齐（用 flex 时日期宽的会被挤开）。 */
.login-notice .notice-item {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) 64px;
  align-items: center;
  gap: 12px;
  padding: 9px 14px;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.16);
  cursor: pointer;
  text-align: left;
  width: 100%;
  background: transparent;
  border-left: 0;
  border-right: 0;
  border-top: 0;
  color: inherit;
  font: inherit;
}
.login-notice .notice-item:last-child { border-bottom: 0; }
.login-notice .notice-item:hover { background: rgba(255, 255, 255, 0.09); }
.login-notice .notice-item:focus-visible { outline: 1px dashed rgba(255, 255, 255, 0.8); outline-offset: -3px; }

.login-notice .notice-date {
  font-size: 14px;
  opacity: 0.78;
  font-variant-numeric: tabular-nums;   /* 数字等宽，一列日期看起来才齐 */
  white-space: nowrap;
}

/* 主要内容一行显示、超出用「…」，不换行 —— 一条一行是这个列表的前提，
   换行了行高就参差，读起来比滚动还乱。全文点开详情看。 */
.login-notice .notice-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* 「详情」小标：这条点开还有附件、或正文被截断了，提示一下 */
.login-notice .notice-more {
  display: inline-block;
  margin-left: 8px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.24);
  font-size: 12px;
  font-style: normal;
  line-height: 17px;
  opacity: 0.9;
}

/* 通知类型小标：1 紧急（红）、2 新规（橙）、3 系统（蓝）、0 普通（灰，弱化）。
   配色固定在深色登录底上也能读清 —— 登录页底是深色渐变，纯红/纯蓝压上去会发糊。
   文字前面带图标（⚠/📄/ℹ，见 renderer.js 的 NOTICE_TAGS）：三个色块单看颜色
   对色盲用户是同一个灰，前置图标才分得出。 */
.login-notice .notice-badge {
  display: inline-block;
  margin-right: 8px;
  padding: 0 6px;
  border-radius: 4px;
  font-size: 13px;
  font-style: normal;
  line-height: 17px;
  font-weight: 600;
  white-space: nowrap;
  vertical-align: 1px;
}
/* 普通通知不带标签；只在「本页出现了带标签的公告」时才占位，而且样式弱到不抢眼 */
.notice-badge.tag-none { background: rgba(255, 255, 255, 0.12); color: rgba(255, 255, 255, 0.62); font-weight: 400; }
.notice-badge.tag-urgent { background: #e04b4b; color: #fff; }
.notice-badge.tag-new { background: #e08a24; color: #fff; }
.notice-badge.tag-sys { background: #3d7fd0; color: #fff; }
/* 置顶：「顶」字小方块，排在标签前面 */
.login-notice .notice-top,
.notice-dlg-tags .notice-top {
  display: inline-block;
  margin-right: 6px;
  padding: 0 4px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.28);
  color: #fff;
  font-size: 11px;
  font-style: normal;
  line-height: 17px;
  font-weight: 600;
  vertical-align: 1px;
}
/* 正文那一格是 nowrap + ellipsis 的，标签和「详情」都是 inline，
   正文过长时标签本身不会被截掉（它在前面），但要不许换行，否则行高被撑开 */
.login-notice .notice-text > .notice-badge,
.login-notice .notice-text > .notice-top { text-overflow: clip; overflow: visible; }

.login-notice .notice-views {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  font-size: 14px;
  opacity: 0.72;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
/* 眼睛用纯字符：不引图标字体，省一个字体文件 */
.login-notice .notice-views::before { content: '👁'; font-size: 11px; }
/* 公告详情小窗 */
/* 层级必须高于登录页(.login-page 是 z-index:300)。
   公告是从登录页点开的，而 .modal 默认只有 100 —— 弹窗其实已经打开了，
   只是整块被登录页压在下面，用户看到的是「点了没反应」。
   和 #confirmDlg(400) / #photoDlg(350) 拉开一档，免得两组弹窗打架。 */
#noticeDlg { z-index: 340; }
/* 同理：#id 选择器的优先级高于 .modal.hidden，不单独写 .hidden 这条，
   关掉之后弹窗仍铺满全屏，且透明遮罩会吃掉登录框上的点击。 */
#noticeDlg.hidden { display: none; }
.modal-box.notice-box { width: 520px; max-width: 92vw; }
.modal-box.notice-box::after { display: none; }   /* 内容是只读的，不需要拖拽手柄 */
.notice-dlg-body { display: block; }               /* 继承的 grid 会把正文和附件排成两列 */
.notice-dlg-text {
  font-size: 14px;
  line-height: 1.75;
  color: var(--text);
  white-space: pre-wrap;   /* 公告里的换行要保留：管理员可能分行写多条要点 */
  word-break: break-word;
}
/* 详情小窗里的标签行：置顶 + 类型标，和正文之间留一点距离 */
.notice-dlg-tags {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-bottom: 8px;
}
.notice-dlg-tags .notice-top { background: #e6eaef; color: #4b5563; margin-right: 4px; }
.notice-dlg-tags .notice-badge { margin-right: 0; padding: 0 7px; }

.notice-dlg-atts {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.notice-dlg-att { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.notice-dlg-img {
  max-width: 100%;
  max-height: 46vh;
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: zoom-in;
  object-fit: contain;
  background: #f7f9fb;
}
.notice-dlg-cap { font-size: 14px; color: #78828f; word-break: break-all; }
.notice-dlg-dl { font-size: 15px; text-align: left; word-break: break-all; }
/* 附件那一行：下载按钮 + 预览按钮并排。预览只给 PDF/Excel，
   没有预览时这一行里只剩下载按钮，flex 也不会多出空隙 */
.notice-dlg-att-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  max-width: 100%;
}
.notice-dlg-att-row .link-btn { font-size: 15px; text-align: left; word-break: break-all; }
/* 「预览」按钮做成小胶囊，和左边的下载链接区分开：下载是主操作，预览是辅助 */
.notice-dlg-pv {
  flex: none;
  padding: 1px 8px !important;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 13px !important;
  line-height: 18px;
  color: var(--primary);
  background: #f2f7fe;
}
.notice-dlg-pv:hover { background: #e3eefc; }

/* ---------- 附件在线预览 ----------
   预览直接换掉 #notice-dlg-body 的内容（不新开弹窗）：登录页上再叠一层弹窗，
   窄屏会把整个屏幕盖满，返回都找不到。顶部一行「文件名 + 返回详情」常驻，
   下面才是内容区。 */
.notice-pv-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 10px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.notice-pv-name {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 14px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.notice-pv-head .link-btn { flex: none; font-size: 14px; }
.notice-pv-stage { max-height: 60vh; min-height: 120px; overflow: auto; }
/* PDF：iframe 指向服务端的 inline 地址，由 Chromium 自带的阅读器渲染。
   高度用 vh 而不是百分比 —— 父级高度是按内容撑开的，百分比会塌成 0 */
.notice-pv-pdf {
  display: block;
  width: 100%;
  height: 58vh;
  min-height: 320px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #f7f9fb;
}
.notice-pv-hint {
  margin-top: 8px;
  font-size: 13px;
  color: #78828f;
  line-height: 1.6;
}
/* Excel：逐表渲染成表格。表头行冻结、首列当行号/字段名，横向允许滚 */
.notice-pv-sheet { margin-bottom: 14px; }
.notice-pv-sheet-name {
  font-size: 13px;
  font-weight: 600;
  color: #4b5563;
  margin-bottom: 6px;
}
.notice-pv-table {
  border-collapse: collapse;
  font-size: 13px;
  background: #fff;
  min-width: 100%;
}
.notice-pv-table th,
.notice-pv-table td {
  border: 1px solid #dbe2ea;
  padding: 4px 8px;
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
  /* 单元格内容允许很长，但不能把表格撑到无限宽：
     超过 220px 就省略，鼠标悬停看完整值（title 由渲染时挂上） */
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.notice-pv-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #eef3fa;
  font-weight: 600;
}
.notice-pv-table tr:nth-child(even) td { background: #fafcfe; }

/* 管理员编辑区的附件条 */
.notice-row { flex-direction: column; align-items: stretch; }
.notice-main { display: flex; align-items: center; gap: 6px; }
.notice-atts { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px 0 0 26px; }
.notice-att {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 4px 3px 8px;
  background: #eef3fa;
  border-radius: 6px;
  font-size: 12px;
  max-width: 100%;
}
.notice-att-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px; }
.notice-att-size { color: #78828f; flex: none; }
.notice-att-del { flex: none; padding: 0 4px; line-height: 1; }

/* 公告「可见角色」一行（1.1.78）：和「标签失效时间」同一行样式，单独一条 */
.notice-sub.notice-aud { flex-wrap: wrap; }
.notice-aud-title { color: #78828f; font-size: 12px; flex: none; }
.notice-aud-in {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
}
.notice-aud-in input { margin: 0; }
/* 「XX 可见」小结：弱化，但和勾选框拉开一点距离 */
.notice-aud-sum { font-size: 12px; color: #78828f; margin-left: 4px; }

/* ---------- 公告阅读回执（1.1.78）----------
   编辑区里点「阅读回执」弹出。层级要比 #noticeDlg 再高一点：
   管理员是从登录页之外的系统里点的，但万一公告详情还开着，别被它盖住。 */
#noticeReadsDlg { z-index: 345; }
/* #id 的优先级高于 .modal.hidden，不补这条关不掉 */
#noticeReadsDlg.hidden { display: none; }
.modal-box.reads-box { width: 620px; max-width: 94vw; }
.rc-head { margin-bottom: 12px; }
.rc-text { font-size: 15px; color: var(--text); line-height: 1.6; word-break: break-word; }
.rc-meta { margin-top: 4px; font-size: 13px; color: #78828f; }
.rc-stat {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 6px;
}
.rc-num { font-size: 20px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.rc-pct { font-size: 13px; color: #78828f; }
/* 进度条：底槽 + 内条。内条宽度只能靠类名给（CSP 不许行内 style），
   所以下面按 1% 一档列了 rc-w-0 ~ rc-w-100。 */
.rc-bar {
  height: 8px;
  border-radius: 999px;
  background: #e6eaef;
  overflow: hidden;
  margin-bottom: 16px;
}
.rc-bar-in {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #2f8de0, #1e6fd9);
  transition: width 0.25s ease;
}
.rc-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.rc-col h4 { font-size: 13px; color: #4b5563; margin-bottom: 8px; font-weight: 600; }
.rc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 44vh;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 6px;
}
.rc-user {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 6px 10px;
  font-size: 13px;
  border-bottom: 1px solid #f0f3f7;
}
.rc-user:last-child { border-bottom: 0; }
.rc-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rc-role { flex: none; font-size: 12px; color: #78828f; }
.rc-time { flex: none; font-size: 12px; color: #9aa5b1; font-variant-numeric: tabular-nums; }
/* 阅读回执的 IP（1.1.83）：等宽字体、宽度可收缩，IPv6 长地址也不把名字挤没 */
.rc-ip {
  flex: 0 1 auto; max-width: 40%; min-width: 0;
  font-size: 12px; color: #9aa5b1;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* 已读/未读只用左边框颜色区分不够 —— 标题里已经写了「已读 N」「未读 N」，
   色盲用户靠文字也能分清 */
.rc-user.ok { border-left: 3px solid #2f9e5e; }
.rc-user.no { border-left: 3px solid #d0d6de; }
.rc-empty { padding: 14px 10px; font-size: 13px; color: #9aa5b1; text-align: center; }

/* 进度条 1% 一档：动态宽度不能写行内 style（CSP style-src self） */
.rc-bar-in.rc-w-0 { width: 0%; }
.rc-bar-in.rc-w-1 { width: 1%; }
.rc-bar-in.rc-w-2 { width: 2%; }
.rc-bar-in.rc-w-3 { width: 3%; }
.rc-bar-in.rc-w-4 { width: 4%; }
.rc-bar-in.rc-w-5 { width: 5%; }
.rc-bar-in.rc-w-6 { width: 6%; }
.rc-bar-in.rc-w-7 { width: 7%; }
.rc-bar-in.rc-w-8 { width: 8%; }
.rc-bar-in.rc-w-9 { width: 9%; }
.rc-bar-in.rc-w-10 { width: 10%; }
.rc-bar-in.rc-w-11 { width: 11%; }
.rc-bar-in.rc-w-12 { width: 12%; }
.rc-bar-in.rc-w-13 { width: 13%; }
.rc-bar-in.rc-w-14 { width: 14%; }
.rc-bar-in.rc-w-15 { width: 15%; }
.rc-bar-in.rc-w-16 { width: 16%; }
.rc-bar-in.rc-w-17 { width: 17%; }
.rc-bar-in.rc-w-18 { width: 18%; }
.rc-bar-in.rc-w-19 { width: 19%; }
.rc-bar-in.rc-w-20 { width: 20%; }
.rc-bar-in.rc-w-21 { width: 21%; }
.rc-bar-in.rc-w-22 { width: 22%; }
.rc-bar-in.rc-w-23 { width: 23%; }
.rc-bar-in.rc-w-24 { width: 24%; }
.rc-bar-in.rc-w-25 { width: 25%; }
.rc-bar-in.rc-w-26 { width: 26%; }
.rc-bar-in.rc-w-27 { width: 27%; }
.rc-bar-in.rc-w-28 { width: 28%; }
.rc-bar-in.rc-w-29 { width: 29%; }
.rc-bar-in.rc-w-30 { width: 30%; }
.rc-bar-in.rc-w-31 { width: 31%; }
.rc-bar-in.rc-w-32 { width: 32%; }
.rc-bar-in.rc-w-33 { width: 33%; }
.rc-bar-in.rc-w-34 { width: 34%; }
.rc-bar-in.rc-w-35 { width: 35%; }
.rc-bar-in.rc-w-36 { width: 36%; }
.rc-bar-in.rc-w-37 { width: 37%; }
.rc-bar-in.rc-w-38 { width: 38%; }
.rc-bar-in.rc-w-39 { width: 39%; }
.rc-bar-in.rc-w-40 { width: 40%; }
.rc-bar-in.rc-w-41 { width: 41%; }
.rc-bar-in.rc-w-42 { width: 42%; }
.rc-bar-in.rc-w-43 { width: 43%; }
.rc-bar-in.rc-w-44 { width: 44%; }
.rc-bar-in.rc-w-45 { width: 45%; }
.rc-bar-in.rc-w-46 { width: 46%; }
.rc-bar-in.rc-w-47 { width: 47%; }
.rc-bar-in.rc-w-48 { width: 48%; }
.rc-bar-in.rc-w-49 { width: 49%; }
.rc-bar-in.rc-w-50 { width: 50%; }
.rc-bar-in.rc-w-51 { width: 51%; }
.rc-bar-in.rc-w-52 { width: 52%; }
.rc-bar-in.rc-w-53 { width: 53%; }
.rc-bar-in.rc-w-54 { width: 54%; }
.rc-bar-in.rc-w-55 { width: 55%; }
.rc-bar-in.rc-w-56 { width: 56%; }
.rc-bar-in.rc-w-57 { width: 57%; }
.rc-bar-in.rc-w-58 { width: 58%; }
.rc-bar-in.rc-w-59 { width: 59%; }
.rc-bar-in.rc-w-60 { width: 60%; }
.rc-bar-in.rc-w-61 { width: 61%; }
.rc-bar-in.rc-w-62 { width: 62%; }
.rc-bar-in.rc-w-63 { width: 63%; }
.rc-bar-in.rc-w-64 { width: 64%; }
.rc-bar-in.rc-w-65 { width: 65%; }
.rc-bar-in.rc-w-66 { width: 66%; }
.rc-bar-in.rc-w-67 { width: 67%; }
.rc-bar-in.rc-w-68 { width: 68%; }
.rc-bar-in.rc-w-69 { width: 69%; }
.rc-bar-in.rc-w-70 { width: 70%; }
.rc-bar-in.rc-w-71 { width: 71%; }
.rc-bar-in.rc-w-72 { width: 72%; }
.rc-bar-in.rc-w-73 { width: 73%; }
.rc-bar-in.rc-w-74 { width: 74%; }
.rc-bar-in.rc-w-75 { width: 75%; }
.rc-bar-in.rc-w-76 { width: 76%; }
.rc-bar-in.rc-w-77 { width: 77%; }
.rc-bar-in.rc-w-78 { width: 78%; }
.rc-bar-in.rc-w-79 { width: 79%; }
.rc-bar-in.rc-w-80 { width: 80%; }
.rc-bar-in.rc-w-81 { width: 81%; }
.rc-bar-in.rc-w-82 { width: 82%; }
.rc-bar-in.rc-w-83 { width: 83%; }
.rc-bar-in.rc-w-84 { width: 84%; }
.rc-bar-in.rc-w-85 { width: 85%; }
.rc-bar-in.rc-w-86 { width: 86%; }
.rc-bar-in.rc-w-87 { width: 87%; }
.rc-bar-in.rc-w-88 { width: 88%; }
.rc-bar-in.rc-w-89 { width: 89%; }
.rc-bar-in.rc-w-90 { width: 90%; }
.rc-bar-in.rc-w-91 { width: 91%; }
.rc-bar-in.rc-w-92 { width: 92%; }
.rc-bar-in.rc-w-93 { width: 93%; }
.rc-bar-in.rc-w-94 { width: 94%; }
.rc-bar-in.rc-w-95 { width: 95%; }
.rc-bar-in.rc-w-96 { width: 96%; }
.rc-bar-in.rc-w-97 { width: 97%; }
.rc-bar-in.rc-w-98 { width: 98%; }
.rc-bar-in.rc-w-99 { width: 99%; }
.rc-bar-in.rc-w-100 { width: 100%; }


.login-box {
  width: 100%;                    /* 宽度由所在列决定（桌面 400、平板 480、手机满宽） */
  max-width: calc(100vw - 32px);   /* 手机竖屏（360/390px）不溢出，桌面不受影响 */
  background: #fff;
  border-radius: 12px;
  padding: 40px 38px 28px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.3);
  text-align: center;
}

.login-logo {
  width: 56px; height: 56px;
  margin: 0 auto 14px;
  background: linear-gradient(135deg, #1e6fd9, #3a9be8);
  color: #fff;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; font-weight: 700;
}

.login-box h1 { font-size: 22px; color: #1d2634; margin-bottom: 26px; }

.login-box input {
  width: 100%;
  padding: 11px 14px;
  margin-bottom: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 16px;
  outline: none;
}

.login-box input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(30,111,217,0.12); }

.login-box button.primary {
  width: 100%;
  padding: 12px;
  margin-top: 4px;
  font-size: 16px;
  border-radius: 8px;
}

.login-err {
  background: #fef1f0;
  color: var(--danger);
  border: 1px solid #f5c6c2;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 15px;
  margin-bottom: 12px;
}

/* 升级后需重登的提示：用提示色而不是错误色 —— 这不是出错，只是升了一次级 */
.login-upgraded {
  text-align: left;
  background: #fff8e6;
  border: 1px solid #f0d491;
  border-left: 3px solid #e0a52a;
  border-radius: 6px;
  padding: 10px 12px;
  margin-bottom: 16px;
  font-size: 14px;
  line-height: 1.65;
  color: #7a5a12;
}
.login-upgraded strong { display: block; color: #8a5a00; margin-bottom: 2px; }
.login-upgraded .link-btn { padding: 0; margin-top: 4px; font-size: 14px; }

/* 登录页内容可能超过一屏（窗口矮 + 下载区展开旧版本）：允许纵向滚动，
   否则底部的下载区会被裁掉、连滚都滚不到。
   留 32px 而不是上下各 24px：公告条贴顶、下载区贴底，不留白就顶到屏幕边了 */
.login-page { overflow-y: auto; padding: 32px 24px; }

/* 登录页左下角的桌面应用下载区：和公告条同宽，半透明底，白色文字 */
.login-download {
  width: 100%;                       /* 同 .login-box：宽度跟着右列走，单列时不比登录框宽 */
  max-width: calc(100vw - 40px);
  padding: 12px 14px 10px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 10px;
  color: #fff;
  font-size: 13px;
}

.login-download.hidden { display: none; }

.login-download .dl-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 8px;
  cursor: pointer;
  user-select: none;
}

/* 收起箭头：靠旋转变方向，比换字符更稳（不受字体影响） */
.login-download .dl-title::after {
  content: '';
  display: inline-block;
  margin-left: 6px;
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  opacity: 0.8;
  transform: translateY(-1px) rotate(0deg);
  transition: transform 0.15s;
}
.login-download.collapsed .dl-title::after { transform: translateY(-1px) rotate(-90deg); }
.login-download .dl-head:hover .dl-title::after { opacity: 1; }
.login-download .dl-body.hidden { display: none; }
/* 收起时标题下方不要留白 */
.login-download.collapsed .dl-head { margin-bottom: 0; }

.login-download .dl-title { font-weight: 600; letter-spacing: 1px; }
.login-download .dl-sum { font-size: 12px; opacity: 0.75; }

.login-download .dl-list { list-style: none; margin: 0; padding: 0; }
.login-download .dl-group { list-style: none; }
.login-download .dl-old { list-style: none; margin-top: 8px; }
.login-download .dl-old.hidden { display: none; }
.login-download .dl-old .dl-group + .dl-group { margin-top: 8px; }

.login-download .dl-ver {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 5px;
}
.login-download .dl-vno { font-weight: 600; font-size: 13px; }
.login-download .dl-vtag {
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 8px;
  background: #ffd66b;
  color: #6b4a00;
}
.login-download .dl-vdate { margin-left: auto; font-size: 11.5px; opacity: 0.7; }

.login-download .dl-vers { list-style: none; margin: 0 0 4px; padding: 0; }

.login-download .dl-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.login-download .dl-row:last-child { margin-bottom: 0; }

/* 下载按钮：撑满剩余宽度，右侧「下载」两个字固定
   用 #id 提高优先级：全局 button 样式会把这里盖掉 */
.login-download button.dl-btn {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 10px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 7px;
  color: #16324f;
  font-family: inherit;
  font-size: 12.5px;
  cursor: pointer;
  text-align: left;
}
.login-download button.dl-btn:hover { background: #fff; }
.login-download button.dl-btn:disabled { opacity: 0.6; cursor: default; }
.login-download button.dl-btn .dl-os { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.login-download button.dl-btn .dl-go { flex: none; color: var(--primary); font-weight: 600; }
.login-download button.dl-btn.busy .dl-go::after { content: '…'; }

.login-download .dl-cnt { flex: none; font-size: 11.5px; opacity: 0.8; white-space: nowrap; }
.login-download .dl-cnt b { font-weight: 600; }

.login-download button.dl-more {
  width: 100%;
  margin-top: 8px;
  padding: 5px;
  background: transparent;
  border: 1px dashed rgba(255, 255, 255, 0.4);
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.85);
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
}
.login-download button.dl-more:hover { background: rgba(255, 255, 255, 0.1); }
.login-download button.dl-more.hidden { display: none; }

/* 展开旧版本后列表有 600 多像素，用户往下看旧版本时必须还能点「收起」。
   光靠 scrollIntoView 只在展开那一刻管用，用户一滚动按钮又跑出去了 ——
   钉在滚动容器底部，滚到哪都在手边。
   1.1.63 起右列两块叠在同一 grid 区域、由登录页整体滚动，
   不再需要 .login-scroll 那套「展开时改行高 + 归零 margin」的补丁。 */
.login-page:has(.dl-old:not(.hidden)) .login-download button.dl-more {
  position: sticky;
  bottom: 8px;
  z-index: 1;
  background: rgba(20, 45, 75, 0.85);
  backdrop-filter: blur(4px);
}

/* ---------- 安装包校验码（1.1.79） ---------- */
/* 「校验码」按钮：和「下载」按钮同一行，但要窄，不能抢走主导航的位置 */
.login-download button.dl-hash-btn {
  flex: none;
  padding: 6px 8px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 7px;
  color: rgba(255, 255, 255, 0.92);
  font-family: inherit;
  font-size: 11.5px;
  cursor: pointer;
}
.login-download button.dl-hash-btn:hover { background: rgba(255, 255, 255, 0.26); }
.login-download button.dl-hash-btn[aria-expanded="true"] {
  background: #ffd66b;
  border-color: #ffd66b;
  color: #6b4a00;
}

/* 展开面板：插在 .dl-row 后面（.dl-vers 是 ul，所以面板也是一个 li，语义上不报错）。
   毛玻璃轻量材质：半透明 + backdrop-filter，和登录页背景是一体感，而不是压一块实心板上去。 */
.login-download .dl-hash-panel {
  list-style: none;
  margin: 0 0 8px;
  padding: 8px 10px;
  background: rgba(10, 30, 55, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.login-download .dl-hash-item {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
}
.login-download .dl-hash-item:last-of-type { margin-bottom: 0; }
.login-download .dl-hash-k {
  flex: none;
  width: 56px;
  font-size: 11.5px;
  opacity: 0.85;
}
/* 长串必须能断行：MD5 32 位、SHA256 64 位，窄屏一行放不下会撑破登录框 */
.login-download .dl-hash-v {
  flex: 1;
  min-width: 0;
  font-family: ui-monospace, Consolas, 'Courier New', monospace;
  font-size: 11px;
  line-height: 1.5;
  word-break: break-all;
  user-select: all;            /* 点一下整串选中，复制失败时也能手动复制 */
  color: #eaf4ff;
}
.login-download button.dl-hash-copy {
  flex: none;
  padding: 3px 7px;
  background: rgba(255, 255, 255, 0.88);
  border: none;
  border-radius: 5px;
  color: #16324f;
  font-family: inherit;
  font-size: 11px;
  cursor: pointer;
}
.login-download button.dl-hash-copy:hover { background: #fff; }
.login-download .dl-hash-tip {
  margin: 6px 0 0;
  font-size: 11px;
  line-height: 1.55;
  opacity: 0.78;
}
.login-download .dl-hash-tip code {
  padding: 1px 4px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.14);
  font-size: 10.5px;
}

/* 复制用的临时文本框。不能用 display:none / visibility:hidden ——
   那样元素选不中，document.execCommand('copy') 直接返回 false。
   挪到视口外、0 尺寸、透明即可。 */
.copy-shim {
  position: fixed;
  top: -1000px;
  left: -1000px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

/* ================= 监理人员考勤（月度日历网格） ================= */
.att-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 10px;
}
.att-toolbar button { padding: 5px 10px; font-size: 13px; }
.att-toolbar input[type="month"] {
  padding: 5px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
  color: var(--text);
  background: #fff;
}
.att-sum { margin-left: auto; color: var(--text-light); font-size: 12px; }
.att-legend { display: inline-flex; align-items: center; font-size: 12px; color: var(--text-light); }
.att-legend .att-lg { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin: 0 4px 0 10px; }
.att-lg-none { background: #eef0f3; border: 1px solid var(--border); }
.att-lg-in { background: #eaf1fd; border: 1px solid #bcd6f7; }
.att-lg-done { background: #e8f5e9; border: 1px solid #bfe3c4; }
.att-lg-outside { background: #ede7fb; border: 1px solid #cdbcf0; }
.att-lg-patrol { background: #e4f4f7; border: 1px solid #a8d8e2; }
.att-lg-leave { background: #fdf1e0; border: 1px solid #f0d3a8; }
.att-lg-absent { background: #fdeaea; border: 1px solid #efbcbc; }

.att-tip { font-size: 12px; color: var(--text-light); margin: 0 2px 10px; line-height: 1.8; }
.att-tip strong { color: var(--primary); }
.att-month-sum { display: block; margin-top: 2px; color: var(--text); }
.att-month-sum strong { color: var(--text); font-weight: 600; }

.att-hint {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-light);
  line-height: 1.9;
  background: #fff;
  border: 1px dashed var(--border);
  border-radius: 8px;
}

/* 考勤页「只看某人」（从监理人员行内【考勤】跳转过来时出现） */
.att-only {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  margin-bottom: 10px;
  font-size: 13px;
  color: #1461a8;
  background: #e8f1fb;
  border: 1px solid #c5dcf3;
  border-radius: 6px;
}
.att-only strong { color: #0f4c85; }

.att-scroll {
  overflow: auto;
  max-height: calc(100vh - 250px);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.att-table { border-collapse: separate; border-spacing: 0; min-width: max-content; font-size: 12px; }
.att-table th, .att-table td {
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 0;
  text-align: center;
  vertical-align: middle;
}

/* 表头（纵向冻结） */
.att-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  height: 34px;
  background: #f6f8fb;
  font-weight: 600;
  color: var(--text);
}
.att-day-h .att-d { display: block; line-height: 1.15; }
.att-day-h .att-w { display: block; font-size: 10px; font-weight: 400; color: var(--text-light); }
.att-day-h.att-weekend { background: #eef1f6; }
.att-day-h.att-today { background: #eaf1fd; color: var(--primary); }

/* 前两列（横向冻结） */
.att-table .att-name {
  position: sticky;
  left: 0;
  z-index: 2;
  width: 108px; min-width: 108px; max-width: 108px;
  padding: 0 8px;
  text-align: left;
  background: #fff;
}
.att-table .att-count {
  position: sticky;
  left: 108px;
  z-index: 2;
  width: 72px; min-width: 72px; max-width: 72px;
  font-weight: 600;
  color: var(--primary);
  background: #fff;
}
.att-table th.att-name, .att-table th.att-count { z-index: 3; background: #f6f8fb; }
.att-table tfoot td.att-name, .att-table tfoot td.att-count { z-index: 3; background: #f6f8fb; }
.att-table tfoot td { height: 28px; color: var(--text-light); }

.att-name .att-nm { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att-name .att-role {
  display: block;
  font-size: 10px;
  font-weight: 400;
  color: var(--text-light);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* 日期格 */
.att-day { position: relative; cursor: pointer; width: 54px; min-width: 54px; height: 42px; }
.att-day:hover { background: #f4f8fe; }
.att-day.att-weekend { background: #f7f8fa; }
.att-day.att-weekend:hover { background: #eef1f6; }
.att-day.att-in-only { background: #eaf1fd; }
.att-day.att-done { background: #e8f5e9; }
.att-day.att-today { box-shadow: inset 0 0 0 2px var(--primary); }
.att-day.att-readonly { cursor: default; }
.att-day.att-foot, .att-day.att-foot:hover { cursor: default; background: #f6f8fb; }
.att-day.att-foot.att-weekend { background: #eef1f6; }

/* 出勤类型底色（1.1.82）。在岗三类仍沿用蓝/绿（跟签到签退呼应），非在岗三类换色，
   并且格子里直接写类型文字（.att-tag）—— 只靠颜色区分对色弱用户不友好，也会在黑白打印时消失。 */
.att-day.att-t-outside { background: #f1ecfc; }
.att-day.att-t-patrol { background: #e9f6f9; }
.att-day.att-t-leave { background: #fdf4e7; }
.att-day.att-t-absent { background: #fdeeee; }
.att-day.att-off { cursor: pointer; }
.att-tag { display: block; font-weight: 600; line-height: 1.5; color: var(--text); }
.att-day.att-t-leave .att-tag { color: #9a5b00; }
.att-day.att-t-absent .att-tag { color: #b3261e; }

.att-in { display: block; font-weight: 600; line-height: 1.35; color: var(--primary); }
.att-out { display: block; line-height: 1.35; color: var(--success); }
.att-out.att-none { font-weight: 400; color: var(--text-light); }
.att-dot { color: #c9d0da; }

.att-clear {
  display: none;
  position: absolute;
  top: 1px; right: 1px;
  padding: 0 4px;
  font-size: 10px;
  line-height: 15px;
  border: none;
  border-radius: 4px;
  background: rgba(224, 72, 62, .92);
  color: #fff;
  cursor: pointer;
}
.att-day:hover .att-clear { display: block; }

/* ================= 表单内附件上传 / 工作流按钮 ================= */
#modal-form .attach-existing { margin-top: 6px; }
#modal-form .attach-cite { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
#modal-form .attach-cite label { flex: none; font-size: 13px; color: var(--text-light); }
#modal-form .attach-cite input { flex: 1; }
#modal-form .attach-line { font-size: 12px; color: #55617a; line-height: 1.9; }
#modal-form .attach-line.muted { color: var(--text-light); }
#data-table .ops button.wf { font-weight: 500; }
/* 两级审批（1.1.90）：当前角色无按钮可点时说明该谁办，避免「操作列空白」被当成故障 */
#data-table .ops .wf-hint { font-size: 12px; color: var(--text-light); margin-right: 6px; white-space: nowrap; }
/* 监理通知单发布状态徽标（1.4.11）：「已发布」用实底提示已定稿，「草稿」用灰底不抢眼 */
#data-table .pub-badge {
  display: inline-block; padding: 1px 7px; border-radius: 9px;
  font-size: 12px; line-height: 18px;
  background: #e8f2ff; color: var(--primary); border: 1px solid #c6dcfa;
}
#data-table .pub-badge.draft { background: #f2f4f7; color: #8a94a6; border-color: #e2e6ec; }
/* 监理通知单「撤回发布」（1.4.11）：解除定稿锁的逆向操作，用描边不用实心，
   免得在已发布的整行里比「查看」还显眼，被误点成日常操作。 */
#data-table .ops button.pub-undo {
  background: #fff; border: 1px solid #d0d7e2; color: #55617a;
}
#data-table .ops button.pub-undo:hover { border-color: var(--primary); color: var(--primary); }

/* ================= 自动汇总面板（监理月报 / 监理日志） ================= */
.sum-panel {
  border: 1px solid #cfe0f5;
  background: #f5f9ff;
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 14px;
  grid-column: 1 / -1;   /* #modal-form 是网格容器，面板要横跨整行 */
}
.sum-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 10px;
}
.sum-title { font-size: 13px; font-weight: 600; color: var(--primary-dark); }
.sum-head .sum-hint { font-size: 12px; color: var(--text-light); }
.sum-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}
.sum-item {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 7px 10px;
}
.sum-k { font-size: 12px; color: var(--text-light); }
.sum-v { font-size: 15px; font-weight: 600; color: var(--text); }
.sum-v .sum-u { font-size: 12px; font-weight: 400; color: var(--text-light); margin-left: 2px; }
.sum-btn {
  padding: 6px 14px;
  border-radius: 6px;
  border: 1px solid var(--primary);
  background: var(--primary);
  color: #fff;
  font-size: 13px;
  cursor: pointer;
}
.sum-btn:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.sum-btn:disabled { opacity: .5; cursor: not-allowed; }
.sum-btn[disabled]:hover { background: var(--primary); border-color: var(--primary); }
.sum-note { font-size: 12px; color: var(--text-light); line-height: 1.7; margin-top: 8px; }

/* ================= 资料台账：从业务记录生成 ================= */
.modal-box.arc-box { width: 760px; }
.arc-toolbar {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
}
.arc-all { font-size: 13px; color: var(--text); display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.arc-tip { font-size: 12px; color: var(--text-light); flex: 1; min-width: 200px; }
.arc-list { padding: 10px 20px 18px; overflow-y: auto; max-height: 52vh; }
.arc-group { margin-bottom: 12px; }
.arc-group-title {
  font-size: 12.5px; font-weight: 600; color: var(--primary-dark);
  padding: 4px 0; border-bottom: 1px dashed var(--border); margin-bottom: 6px;
}
.arc-row {
  display: grid; grid-template-columns: 22px 1fr 108px;
  gap: 8px; align-items: center;
  padding: 5px 0; font-size: 13px;
  border-bottom: 1px solid #f2f5f9;
  cursor: pointer;
}
.arc-row:hover { background: #f8fbff; }
.arc-row .arc-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.arc-row .arc-date { font-size: 12px; color: var(--text-light); }
.arc-row.arc-done { opacity: .5; }
.arc-empty { padding: 18px 0; text-align: center; color: var(--text-light); font-size: 13px; }

/* ================= 旁站附表：Excel 式多行明细网格 ================= */
.modal-box.detail-box { width: 1080px; max-width: 97vw; }

.detail-toolbar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 10px 20px;
  border-bottom: 1px solid var(--border);
  background: #f8fafc;
}
.detail-picker {
  min-width: 260px; max-width: 46vw;
  padding: 6px 10px; font-size: 13px;
  border: 1px solid var(--border); border-radius: 6px;
  background: #fff; color: var(--text);
}
.detail-picker:focus { outline: none; border-color: var(--primary); }
/* 附表锁定显示：本记录只用这一张，不可切 */
.detail-picker:disabled { background: #f2f3f5; color: var(--text); opacity: 1; cursor: default; }
.detail-tip { font-size: 12px; color: var(--text-light); flex: 1; min-width: 180px; }

/* 表头参数区（甬统表-B-25 上半部分：设计水泥掺入比…机号）
   这些是整张附表共用的固定参数，不是「一行一桩」的列，画在明细表上方 */
.detail-head { padding: 12px 20px 4px; }
.detail-head.hidden { display: none; }
/* 版头（表样 r1/r4/r5）：左表号、中工程名称、右编号 */
.dh-band {
  display: flex; align-items: baseline; gap: 20px;
  font-size: 12.5px; color: var(--text); padding: 0 2px 6px;
}
.dh-no { font-weight: 500; white-space: nowrap; }
.dh-meta { color: var(--text-light); }
.dh-meta b { color: var(--text); font-weight: 500; }
.dh-band .dh-meta:last-child { margin-left: auto; }
.dh-title {
  text-align: center; font-size: 15px; font-weight: 600; letter-spacing: 2px;
  padding: 6px 0 8px; color: var(--text);
}
/* 表样 r6 是 4 格、r7 是 5 格。列数走 class 而不是内联 style ——
   index.html 的 CSP 是 style-src 'self'，style 属性整体被拦，写了也不生效 */
.dh-row {
  display: grid; gap: 0; margin-bottom: 0;
  border: 1px solid var(--border); border-bottom: none; border-radius: 6px 6px 0 0;
}
.dh-row.dh-c1 { grid-template-columns: minmax(0, 1fr); }
.dh-row.dh-c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.dh-row.dh-c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.dh-row.dh-c4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.dh-row.dh-c5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.dh-row:last-of-type { border-bottom: 1px solid var(--border); border-radius: 0 0 6px 6px; }
.dh-cell { display: flex; flex-direction: column; gap: 4px; min-width: 0; padding: 6px 8px; }
.dh-cell + .dh-cell { border-left: 1px solid var(--border); }
.dh-label {
  font-size: 12px; color: var(--text-light); line-height: 1.25;
  text-align: center; word-break: break-all;
}
.dh-cell input {
  width: 100%; box-sizing: border-box; min-width: 0; height: 26px;
  padding: 3px 8px; font-size: 12.5px; text-align: center;
  border: 1px solid var(--border); border-radius: 5px;
  background: #fff; color: var(--text);
}
.dh-cell input:focus { outline: none; border-color: var(--primary); }

/* 网格容器：横向滚动 + 纵向限高，表头 sticky 常驻 */
.detail-grid {
  flex: 1;
  overflow: auto;
  max-height: 58vh;
  padding: 0 20px 4px;
}

.detail-table { border-collapse: collapse; font-size: 12.5px; width: max-content; min-width: 100%; }
.detail-table th,
.detail-table td {
  border: 1px solid var(--border);
  padding: 0;
  text-align: center;
  white-space: nowrap;
}
.detail-table thead th {
  position: sticky; top: 0; z-index: 2;
  background: #eef2f7;
  font-weight: 600; color: #475569;
  padding: 7px 8px;
  white-space: normal; word-break: break-all;
  min-width: 88px; max-width: 150px;
}
.detail-table tbody tr:nth-child(even) { background: #fafcfe; }
.detail-table tbody tr:hover { background: #f1f7ff; }

.detail-table td input {
  width: 100%; min-width: 80px;
  border: 0; background: transparent;
  padding: 6px 8px; font-size: 12.5px; color: var(--text);
  font-family: inherit;
}
.detail-table td input:focus {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
  background: #fff;
  border-radius: 3px;
}
/* 日期/数字列稍窄 */
.detail-table td input[type="date"] { min-width: 130px; }
.detail-table td input[type="number"] { min-width: 72px; text-align: right; }

.detail-table th.ops-col,
.detail-table td.ops {
  position: sticky; right: 0;
  background: #fff;
  box-shadow: -1px 0 0 var(--border);
  width: 58px;
}
.detail-table thead th.ops-col { background: #eef2f7; z-index: 3; }
.detail-table td.ops .del-row { padding: 4px 8px; font-size: 12px; }
.detail-table .empty-row { color: var(--text-light); padding: 30px 0 !important; }

/* ================= 附表 Excel 导入：字段映射确认框 ================= */
/* 层级要高于附表弹窗（两者都是 .modal，z-index 100），
   不加的话映射框会被附表弹窗盖住，看起来像「点了导入没反应」 */
#mapDlg { z-index: 150; }
#mapDlg.hidden { display: none; }
.modal-box.map-box { width: 900px; max-width: 96vw; }

.map-body { padding: 12px 20px; overflow: auto; flex: 1; }
.map-meta { font-size: 12.5px; color: var(--text-light); margin-bottom: 10px; }

.map-table-wrap {
  border: 1px solid var(--border); border-radius: 8px;
  overflow: auto; max-height: 46vh;
}
.map-table { border-collapse: collapse; width: 100%; font-size: 13px; }
.map-table th, .map-table td {
  padding: 6px 10px; border-bottom: 1px solid var(--border);
  text-align: left; vertical-align: middle;
}
.map-table thead th {
  position: sticky; top: 0; z-index: 1;
  background: #f1f5f9; font-weight: 600; color: #1d2634;
  font-size: 12.5px;
}
.map-table tbody tr:last-child td { border-bottom: none; }
.map-table tbody tr:hover { background: #f7fbff; }
.map-col-src { width: 30%; }
.map-src-text { font-weight: 500; word-break: break-all; }
.map-col-arrow { width: 36px; text-align: center; color: var(--text-light); }
.map-col-dst { width: 34%; }
.map-col-dst select { width: 100%; padding: 5px 8px; font-size: 13px; }
.map-col-sample { color: var(--text-light); font-size: 12px; word-break: break-all; }
/* 表头参数列：整张附表共用、不是每行的列，默认不导入 */
.map-row-head { background: #fbfaf3; }
.map-src-head {
  display: inline-block; margin-left: 6px; padding: 0 5px;
  font-size: 11px; line-height: 16px; border-radius: 3px;
  background: #efe6c8; color: #7a6320; font-weight: 400;
}
/* 两个 Excel 列选了同一个字段：后改的不生效，标红让用户当场看到 */
.map-table tr.dup { background: #fff5f5; }
.map-table tr.dup .map-col-dst select { border-color: var(--danger); }

.map-firstrow {
  display: flex; align-items: center; gap: 8px;
  margin-top: 12px; font-size: 12.5px; color: #334155; cursor: pointer;
}
.map-firstrow.hidden { display: none; }

.map-summary { margin-right: auto; font-size: 12.5px; color: var(--text-light); }

/* ================= 打印模板：单元格映射配置 ================= */
/* 层级压在附表映射框之上：模板配置里也可能弹别的框 */
#tplMapDlg, #tplCellDlg { z-index: 160; }
#tplMapDlg.hidden, #tplCellDlg.hidden { display: none; }
.modal-box.tplmap-box {
  width: 1100px; max-width: 96vw;
  height: 78vh; display: flex; flex-direction: column;
}
.modal-box.tplcell-box { width: 460px; max-width: 92vw; }

.tplmap-body { padding: 10px 16px; display: flex; flex-direction: column; gap: 10px; flex: 1; min-height: 0; }
.tplmap-bar {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  font-size: 12.5px; color: #334155;
}
.tplmap-bar label { display: inline-flex; align-items: center; gap: 6px; }
.tplmap-bar select, .tplmap-bar input[type="number"], .tplmap-bar input[type="text"] {
  padding: 4px 8px; font-size: 13px; border: 1px solid var(--border); border-radius: 5px;
}
.tplmap-bar input[type="number"] { width: 92px; }
.tplmap-hint { color: var(--text-light); font-size: 12px; }
.tplmap-hint.warn { color: var(--danger); font-weight: 500; }
/* 签字框（1.3.0）：和上面那排参数同一种排版，单独一行免得挤在一起看不清单位 */
.tplmap-sign {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  font-size: 12.5px; color: #334155;
  padding: 8px 10px; border: 1px dashed var(--border); border-radius: 6px; background: #f8fafc;
}
.tplmap-sign label { display: inline-flex; align-items: center; gap: 6px; }
.tplmap-sign input {
  padding: 4px 8px; font-size: 13px; border: 1px solid var(--border); border-radius: 5px; width: 84px;
}
.tplmap-sign-how { color: var(--text-light); font-size: 12px; }
/* 1.4.2 追加的 Word 占位符说明要独占一行，否则跟上面那句并排挤成两截 */
.tplmap-sign-how + .tplmap-sign-how { flex-basis: 100%; line-height: 1.6; }
.tplmap-sign code { background: #eef2f7; border-radius: 3px; padding: 1px 4px; font-size: 11.5px; }

/* 占位符一览：横向铺一排按钮，多了就折行；高度最多占四行，免得把下面的网格挤没 */
.tplmap-ph {
  border: 1px solid #dbe7f5; background: #f6faff; border-radius: 8px;
  padding: 7px 10px; display: flex; flex-direction: column; gap: 6px; flex: none;
}
.tplmap-ph.hidden { display: none; }
.tplmap-ph-head { font-size: 12px; color: #334155; line-height: 1.55; }
.tplmap-ph-how { color: var(--text-light); }
.tplmap-ph-chips {
  display: flex; flex-wrap: wrap; gap: 6px;
  max-height: 88px; overflow: auto;
}
.tplmap-ph-chip {
  padding: 2px 8px; font-size: 12px; font-family: ui-monospace, Menlo, monospace;
  border: 1px solid #bfd4ee; border-radius: 999px; background: #fff; color: #1e40af;
  cursor: pointer; white-space: nowrap;
}
.tplmap-ph-chip:hover { background: #e8f2ff; border-color: #2563eb; }
.tplmap-ph-chip.on { background: #dcf3e1; border-color: #86c79a; color: #166534; }
.tplmap-ph-chip.on::after { content: ' ·已绑定'; font-family: inherit; }

/* 占位符清单弹窗（Word 模板的准备步骤）：一栏一行，点了就复制 */
.modal-box.tplph-box { width: 620px; max-width: 94vw; }
.tplph-body { padding: 12px 16px; display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.tplph-how { margin: 0; font-size: 12.5px; color: #334155; line-height: 1.6; }
.tplph-actions { display: flex; gap: 8px; }
.tplph-list-wrap { border: 1px solid var(--border); border-radius: 8px; overflow: auto; max-height: 46vh; }
.tplph-table td, .tplph-table th { padding: 5px 10px; font-size: 12.5px; }
.tplph-ph {
  font-family: ui-monospace, Menlo, monospace; color: #1e40af;
  cursor: pointer; white-space: nowrap;
}
.tplph-ph:hover { text-decoration: underline; }
.tplph-sub { color: var(--text-light); }
.tplph-warn { margin: 0; font-size: 12px; color: var(--text-light); line-height: 1.6; }

.tplmap-cols { display: flex; gap: 12px; flex: 1; min-height: 0; }
.tplmap-pane {
  display: flex; flex-direction: column; min-height: 0;
  border: 1px solid var(--border); border-radius: 8px; overflow: hidden;
}
.tplmap-cells { flex: 1.45; min-width: 0; }
.tplmap-binds { flex: 1; min-width: 0; }
.tplmap-pane-head {
  padding: 6px 10px; background: #f1f5f9; font-size: 12.5px; font-weight: 600;
  color: #1d2634; border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
}
.tplmap-sub { font-weight: 400; color: var(--text-light); font-size: 12px; }
.tplmap-cells-wrap, .tplmap-binds-wrap { flex: 1; overflow: auto; }

.tplmap-grid { border-collapse: collapse; width: 100%; font-size: 12px; }
.tplmap-grid th, .tplmap-grid td {
  border-bottom: 1px solid #eef2f7; border-right: 1px solid #f3f6fa;
  padding: 0; white-space: nowrap;
}
.tplmap-grid thead th {
  position: sticky; top: 0; z-index: 2; background: #f8fafc;
  font-weight: 600; color: #475569; padding: 4px 6px; text-align: center;
}
.tplmap-grid tbody th {
  position: sticky; left: 0; z-index: 1; background: #f8fafc;
  padding: 2px 6px; color: #64748b; font-weight: 500; text-align: right;
}
.tplmap-grid td.cell {
  padding: 3px 6px; max-width: 190px; overflow: hidden; text-overflow: ellipsis;
  cursor: pointer; color: #0f172a;
}
.tplmap-grid td.cell:hover { background: #e8f2ff; }
.tplmap-grid td.cell.empty { color: #cbd5e1; cursor: default; }
.tplmap-grid td.cell.empty:hover { background: transparent; }
.tplmap-grid td.cell.bound-field { background: #e8f6ea; }
.tplmap-grid td.cell.bound-fixed { background: #fdf5e3; }
/* 写错名字的占位符：淡红底提示「这格出纸时会原样留着」（原先只在 JS 里加了类，没给它上色） */
.tplmap-grid td.cell.unbound-ph { background: #fdeced; }
.tplmap-grid td.cell.unbound-ph .tpl-cell-addr { color: #b91c1c; }
/* 特殊占位符（{{签字图}}/{{照片N}}）：不用绑字段，淡蓝底跟「写错」的红色区分开 */
.tplmap-grid td.cell.special-ph { background: #eef4fb; }
.tplmap-grid td.cell.special-ph .tpl-cell-addr { color: #1d4ed8; }
.tplmap-grid td.cell.start-row { box-shadow: inset 0 2px 0 #f59e0b; }
.tplmap-grid.picking td.cell { cursor: crosshair; }
.tplmap-grid.picking td.cell:hover { outline: 2px solid #2563eb; outline-offset: -2px; }
/* 点过的那一格：蓝色描边一直留着，占位符按钮绑的就是它 */
.tplmap-grid td.cell.selected { outline: 2px solid #2563eb; outline-offset: -2px; }
/* 按模板列对齐后：缺列留空、空白格淡显、每格上方标地址 */
.tplmap-grid td.cell.gap { background: #fbfcfd; cursor: default; }
.tplmap-grid td.cell.gap:hover { background: #fbfcfd; }
.tplmap-grid td.cell.blank { color: #cbd5e1; }
.tplmap-grid td.cell .tpl-cell-addr {
  display: block; font-size: 10px; line-height: 1.1; color: #94a3b8;
  font-family: ui-monospace, Menlo, Consolas, monospace; letter-spacing: .2px;
}
.tplmap-grid td.cell.bound-field .tpl-cell-addr { color: #15803d; }
.tplmap-grid td.cell.bound-fixed .tpl-cell-addr { color: #b45309; }
.tplmap-grid td.cell .tpl-cell-text { display: block; line-height: 1.3; }
.tplmap-showempty { font-weight: 400; font-size: 12px; color: var(--text-light); margin-left: 8px; cursor: pointer; }
.tplmap-showempty input { vertical-align: -1px; margin-right: 3px; }
#tplmap-goto { width: 74px; text-transform: uppercase; }

.tplmap-bind-table td { padding: 5px 8px; font-size: 12.5px; }
.tplmap-bind-table .b-cell { width: 74px; font-family: ui-monospace, Menlo, monospace; font-weight: 600; color: #1e40af; }
.tplmap-bind-table .b-kind { width: 74px; }
.tplmap-bind-table .b-kind .tag {
  display: inline-block; padding: 0 6px; line-height: 18px; border-radius: 3px; font-size: 11.5px;
}
.tplmap-bind-table .b-kind .tag.field { background: #dcf3e1; color: #166534; }
.tplmap-bind-table .b-kind .tag.fixed { background: #fbeecd; color: #8a5a00; }
.tplmap-bind-table .b-text { word-break: break-all; color: #334155; }
.tplmap-bind-table .b-ops { width: 46px; text-align: right; }
.tplmap-bind-table .b-ops button { padding: 1px 7px; font-size: 12px; }
.tplmap-empty { padding: 18px 10px; text-align: center; color: var(--text-light); font-size: 12.5px; }

.tplcell-body { padding: 14px 18px; display: flex; flex-direction: column; gap: 12px; }
.tplcell-preview {
  padding: 8px 10px; background: #f8fafc; border: 1px solid var(--border); border-radius: 6px;
  font-size: 12.5px; color: #475569; word-break: break-all; max-height: 96px; overflow: auto;
}
.tplcell-row { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.tplcell-row > span { width: 64px; flex: none; color: #334155; }
.tplcell-row select, .tplcell-row input[type="text"] {
  flex: 1; padding: 5px 8px; font-size: 13px; border: 1px solid var(--border); border-radius: 5px;
}
.tplcell-row.hidden { display: none; }
/* 一格绑多个字段：下拉选一个就加进已选列表，列表里点 × 去掉 */
.tplcell-fields { flex: 1; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.tplcell-fields > select { width: 100%; padding: 5px 8px; font-size: 13px; border: 1px solid var(--border); border-radius: 5px; }
.tplcell-fieldhint { font-size: 11.5px; color: var(--text-light); line-height: 1.6; }
.tplcell-picked { display: flex; flex-wrap: wrap; gap: 6px; }
.tplcell-picked:empty { display: none; }
.tplcell-pick {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 4px 2px 8px;
  font-size: 12px; background: #e8f2ff; border: 1px solid #b9d6f7; border-radius: 12px; color: #17457a;
}
.tplcell-pick button {
  border: 0; background: transparent; cursor: pointer; color: #4a6b8f; font-size: 14px; line-height: 1; padding: 0 2px;
}
.tplcell-pick button:hover { color: #b91c1c; }
.tplcell-ph { font-size: 12px; color: var(--text-light); line-height: 2; }
.tplcell-ph.hidden { display: none; }
.tplcell-ph-btn {
  padding: 1px 7px; font-size: 12px; font-family: ui-monospace, Menlo, monospace;
  border: 1px solid var(--border); border-radius: 4px; background: #fff; cursor: pointer;
}
.tplcell-ph-btn:hover { background: #e8f2ff; }

/* 模板管理列表里的「映射」摘要列 */
.tpl-map-sum { font-size: 12px; color: var(--text-light); }
.tpl-map-sum b { color: #1e40af; font-weight: 600; }

/* ================= 登录页平板（单列，≤ 1024px） =================
   原来这里是从 1300px 起的单列断点：只要窄于 1300，公告就被压到 400px 宽、
   排到最上面，平板横屏（1024×768）一进来就得往下滚才看得到登录框。
   1.1.75 改成「两列弹性流式 + 1024 起单列」，单一列时也把登录框排在前面：
   平板和手机的用户第一眼要的是「登录」，不是「看通知」。
   排在文件末尾、且断点比上面的基础规则更窄 —— 同优先级下后出现的生效，
   所以这里直接覆盖上面的 .login-page，不用加 !important。 */
@media (max-width: 1024px) {
  .login-page {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto;
    /* 登录 → 公告 → 页脚。DOM 顺序仍是「公告 → 登录 → 下载」，
       用 grid-area 排位置，不动 DOM，Tab 键顺序不乱。 */
    grid-template-areas:
      "login"
      "notice"
      "foot";
    row-gap: 14px;
    align-content: safe center;
    padding: 20px clamp(12px, 3vw, 28px);
  }
  .login-page > .login-notice {
    /* 双列时靠 stretch 跟右列等高，单列没有「同一行」可言 */
    align-self: auto;
    width: auto;
    max-width: 100%;
    margin: 0 auto;
  }
  .login-page > .login-side { align-self: auto; }
  /* 单列窄屏下日期和阅读量各占 96/64 太挤，内容只剩两百来像素。
     日期列收到 82px（YYYY-MM-DD 在 12px 字号下刚好），阅读量列 52px。 */
  .login-notice .notice-item { grid-template-columns: 82px minmax(0, 1fr) 52px; gap: 8px; padding: 8px 12px; }
  .login-notice .notice-head { padding-right: 12px; }
  .login-page > .login-foot { align-self: auto; }
  /* 分类下拉不能在窄屏上「向上弹浮层」：手机上页脚本身就贴着视口底，
     浮层会盖住登录框。改成点开后在页脚内就地展开（position: static），整页往下长。 */
  .login-foot .foot-cat-list {
    position: static;
    left: auto;
    transform: none;
    margin: 6px 0 0;
    padding: 4px 0;
    max-width: 100%;
    background: rgba(255, 255, 255, 0.14);
    box-shadow: none;
  }
  .login-foot .foot-cat-list a { color: #fff; }
  .login-foot .foot-cat-list a:hover { background: rgba(255, 255, 255, 0.18); }
  .login-foot .foot-links { gap: 6px 10px; }
}

/* ================= 登录页手机（≤ 640px，登录优先 + 折叠） =================
   手机上一屏放不下「登录框 + 公告 + 下载」，实际使用场景是
   「站在工地掏出手机，先登进去」。所以两块辅助信息默认收起，标题栏常显可点开。
   折叠态由 renderer.js 的 syncLoginCollapse() 加/去 .collapsed 类（不写行内样式，
   CSP 的 style-src 'self' 不允许），这里只管收起后的长相。 */
@media (max-width: 640px) {
  /* 公告栏收起：只留标题栏一行 + 「共 N 条」提示 */
  .login-notice.collapsed .notice-list { display: none; }
  .login-notice .notice-head {
    /* 收起时整条都能点，够得着 */
    min-height: 44px;
    cursor: pointer;
  }
  /* 收起箭头：用纯 CSS 三角，展开/收起时通过 .collapsed 翻转 */
  .login-notice .notice-head::after {
    content: '';
    margin-left: auto;
    width: 0; height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid currentColor;
    opacity: 0.75;
    transition: transform 0.15s ease;
  }
  .login-notice.collapsed .notice-head::after { transform: rotate(-90deg); }

  .login-page { padding: 14px 10px; row-gap: 10px; }
  .login-side { max-width: 100%; }
  .login-box { padding: 28px 20px 20px; }
  .login-logo { width: 48px; height: 48px; font-size: 24px; }
  .login-box h1 { font-size: 19px; }
  /* 登录页字号下限：12px 在手机上是「看不清」的临界点 */
  .login-page { font-size: 15px; }
  .login-notice { font-size: 14px; }
  .login-notice .notice-item { grid-template-columns: minmax(0, 1fr) 46px; }
  /* 手机一行放不下「日期 + 正文 + 阅读量」：日期挪到正文上面单独一行 */
  .login-notice .notice-date {
    grid-column: 1 / -1;
    font-size: 12.5px;
  }
  .login-notice .notice-item { grid-template-areas: "date date" "text views"; }
  .login-notice .notice-date { grid-area: date; }
  .login-notice .notice-text { grid-area: text; }
  .login-notice .notice-views { grid-area: views; }
}

/* 触屏设备：把可点的东西撑到 44px 高（手指点得准），不影响鼠标设备上的观感 */
@media (pointer: coarse) {
  .login-page .dl-btn,
  .login-page .dl-head,
  .login-page .login-box button,
  .login-page .notice-head,
  .login-notice .notice-item,
  .login-page .foot-cat-btn,
  .login-page .foot-cat-list a {
    min-height: 44px;
  }
}

/* ================= 独立下载页（/download，download.html） =================
   和登录页同一套渐变背景，但整页可滚动：安装包列表可能很长（3 个版本 × 多个平台）。
   页面不引 renderer.js，只用 styles.css 的这一段，所以类名统一带 dlpage- 前缀，
   避免和业务表单里的样式串味。 */
body.dlpage {
  margin: 0;
  min-height: 100vh;
  padding: 32px 16px;
  box-sizing: border-box;
  background: linear-gradient(135deg, #16324f 0%, #1e6fd9 60%, #3a9be8 100%);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', sans-serif;
  color: #1f3b5c;
}

.dlpage-box {
  max-width: 760px;
  margin: 0 auto;
  padding: 26px 28px 20px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
}

.dlpage-head { position: relative; }

.dlpage-back {
  display: inline-block;
  margin-bottom: 10px;
  color: #1e6fd9;
  font-size: 13px;
  text-decoration: none;
}

.dlpage-back:hover { text-decoration: underline; }

.dlpage-head h1 {
  margin: 0 0 8px;
  font-size: 22px;
  letter-spacing: 1px;
}

.dlpage-sub {
  margin: 0 0 18px;
  color: #5a6b7d;
  font-size: 13px;
  line-height: 1.7;
}

.dlpage-status {
  padding: 18px 0;
  color: #5a6b7d;
  font-size: 13.5px;
}

.dlpage-status.hidden, .dlpage-note.hidden { display: none; }

.dlpage-note {
  margin: 16px 0 4px;
  padding: 14px 16px;
  background: #fff8e6;
  border: 1px solid #f0dca8;
  border-radius: 8px;
  color: #7a5a12;
  font-size: 13px;
  line-height: 1.7;
}

.dlpage-group + .dlpage-group { margin-top: 18px; }

.dlpage-ver {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 600;
}

.dlpage-new {
  padding: 2px 8px;
  border-radius: 10px;
  background: #e6f2ff;
  color: #1e6fd9;
  font-size: 11.5px;
  font-weight: 500;
}

.dlpage-rows {
  margin: 0;
  padding: 0;
  list-style: none;
  border: 1px solid #e3e9f0;
  border-radius: 8px;
  overflow: hidden;
}

/* 每行：文件名（可省略） / 平台 / 大小 / 下载次数 / 下载按钮。
   文件名那一列用 minmax(0, 1fr)：不写 min-width:0 的话长文件名会把整行撑宽、
   把「下载」按钮顶出卡片。 */
.dlpage-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 110px 76px 96px 68px;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  font-size: 13px;
}

.dlpage-row + .dlpage-row { border-top: 1px solid #eef2f7; }
.dlpage-row:nth-child(even) { background: #fafcff; }

.dlpage-name {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 12.5px;
}

.dlpage-plat { color: #33475b; }
.dlpage-size { color: #5a6b7d; text-align: right; }
.dlpage-cnt { color: #8a97a6; font-size: 12px; text-align: right; }

.dlpage-btn {
  display: inline-block;
  padding: 6px 0;
  border-radius: 6px;
  background: #1e6fd9;
  color: #fff;
  font-size: 13px;
  text-align: center;
  text-decoration: none;
}

.dlpage-btn:hover { background: #1a62c2; }

/* 窄屏：一行放不下 5 列，改成「文件名独占一行 + 其余挤在第二行」 */
@media (max-width: 640px) {
  body.dlpage { padding: 16px 10px; }
  .dlpage-box { padding: 18px 14px 14px; }
  .dlpage-row {
    grid-template-columns: minmax(0, 1fr) auto auto;
    grid-template-areas:
      "name name name"
      "plat size btn";
    row-gap: 6px;
  }
  .dlpage-name { grid-area: name; }
  .dlpage-plat { grid-area: plat; }
  .dlpage-size { grid-area: size; }
  .dlpage-btn { grid-area: btn; padding: 6px 16px; }
  /* 次数在手机上让位：位置不够，四个信息挤一行会折成两行反而更乱 */
  .dlpage-cnt { display: none; }
}

.dlpage-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid #eef2f7;
  color: #8a97a6;
  font-size: 12px;
}

/* ================= 系统管理 → 页脚设置 =================
   友情链接一行：名称 / 网址 / 分类 / 上移 / 下移 / 删除。
   网址那一列最宽，名称给 1fr —— 管理员更常改网址，名称短，挤窄一点也能看清。 */
.foot-icp-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px dashed var(--border);
}

.foot-icp-row label { font-size: 13px; color: var(--text-light); }
.foot-icp-row input { width: 300px; max-width: 100%; }

.foot-row {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) minmax(220px, 2fr) 130px auto auto auto;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
}

.foot-row + .foot-row { border-top: 1px solid var(--border); }
.foot-row input { width: 100%; }

@media (max-width: 900px) {
  .foot-row { grid-template-columns: 1fr 1fr; row-gap: 6px; }
  .foot-row input[data-act="url"] { grid-column: 1 / -1; }
}


/* ================= 无障碍 / 适老化（WCAG 2.1 AA） =================
   三件事：① 键盘焦点始终看得见；② 「关怀模式」放大字号、加深对比、关动画；
   ③ 跟随系统的「减少动态效果」。

   历史坑提醒：基础规则写在这里（文件末尾）、断点 @media 写在前面的，
   都会被前面的同名规则按源码顺序盖掉 —— 所以本区块之后不要再追加
   任何针对 .login-page / .login-box 的裸规则，需要的话一并写进下面的块里。 */

/* 键盘焦点：只在用键盘时显示（:focus-visible），鼠标点击不额外套一圈框。
   原来只有公告行自己有 focus-visible，登录按钮、下载按钮、顶栏按钮全靠浏览器默认，
   在深色登录底上几乎看不见。统一给一个高对比描边 + 白边，深浅底都压得住。 */
:focus-visible {
  outline: 2px solid #1a63c8;
  outline-offset: 2px;
}
.login-page :focus-visible,
.login-page :focus-visible * {
  outline: 2px solid #ffffff;
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(16, 42, 78, 0.85);
}

/* 关怀模式开关按钮。登录页那个绝对定位在左上角；进应用后那个在顶栏里跟着排版走 */
.care-toggle {
  padding: 6px 12px;
  border: 1px solid currentColor;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  font-size: 13px;
  line-height: 1.2;
  cursor: pointer;
  opacity: 0.85;
}
.care-toggle:hover { opacity: 1; }
.care-toggle[aria-pressed="true"] {
  opacity: 1;
  font-weight: 700;
  color: #fff;
  background: #1a63c8;
  border-color: #1a63c8;
}

/* 登录页左上角：不参与 grid，避免把公告栏挤下一行 */
#loginPage { position: relative; }
#loginPage > .care-toggle {
  position: absolute;
  top: 10px;
  left: 12px;
  z-index: 2;
  color: #fff;
}

/* ---- 关怀模式：字号分档抬高，不逐条改全站 191 处 px ----
   登录页正文 16px 起（需求里「文字最小字号 ≥16px」针对的就是登录页），
   标题和辅助小字各档同步上调。 */
html.care { font-size: 18px; }          /* 全站 1rem 基准；当前布局大量用的仍是 px，见下面的分档 */
html.care .login-box h1 { font-size: 26px; }
html.care .login-box input,
html.care .login-box button.primary,
html.care .login-err { font-size: 18px; }
html.care .login-notice,
html.care .login-download { font-size: 16px; }
html.care .login-notice .notice-date,
html.care .login-notice .notice-views,
html.care .login-notice .notice-badge,
html.care .login-notice .notice-more,
html.care .login-notice .notice-tag,
html.care .login-notice .notice-sum { font-size: 15px; }
html.care .login-notice .notice-item { padding: 12px 14px; }
html.care .notice-dlg-text { font-size: 17px; }
html.care .login-foot { font-size: 15px; }

/* 对比度：深色登录底上的半透明白字在 55 岁以下够用，对低视力不够 ——
   关怀模式下把面板底色压实、辅助文字不透明度提上去，正文与底色对比度往 7:1 靠。
   标签色块同步加深（原来 #e08a24 橙底白字只有 3.1:1，达不到 AA 的 4.5:1）。 */
html.care .login-notice,
html.care .login-download {
  background: rgba(10, 26, 44, 0.55);
  border-color: rgba(255, 255, 255, 0.55);
}
html.care .login-notice .notice-date,
html.care .login-notice .notice-views { opacity: 1; color: #eaf2fb; }
html.care .login-notice .notice-sum { opacity: 1; color: #eaf2fb; }
html.care .login-notice .notice-item { border-bottom-color: rgba(255, 255, 255, 0.3); }
/* 关怀模式下检索框和预览面板一起放大：登录页公告的检索是 13px，正文预览是 13px，
   都低于适老化要求的 16px 下限 */
html.care .login-notice .notice-search input { font-size: 16px; height: 30px; }
html.care .login-notice .notice-q-clear { width: 20px; height: 20px; line-height: 20px; }
html.care .login-notice .notice-empty { font-size: 16px; }
html.care .notice-dlg-att-row .link-btn,
html.care .notice-dlg-pv { font-size: 16px !important; }
html.care .notice-pv-name,
html.care .notice-pv-hint,
html.care .notice-pv-sheet-name { font-size: 16px; }
html.care .notice-pv-table { font-size: 16px; }
html.care .notice-aud-title,
html.care .notice-aud-in,
html.care .notice-aud-sum { font-size: 16px; }
html.care .notice-badge.tag-urgent { background: #b3261e; }
html.care .notice-badge.tag-new { background: #8a4b00; }
html.care .notice-badge.tag-sys { background: #1c4f96; }
html.care .notice-badge.tag-none { background: rgba(255, 255, 255, 0.24); color: #fff; }

/* 减少动画：关掉过渡与关键帧，滚动动画也不做「平滑」（平滑滚动本身就是一种动效） */
html.care *,
html.care *::before,
html.care *::after {
  animation-duration: 0.001ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.001ms !important;
  scroll-behavior: auto !important;
}

/* 系统层面开了「减少动态效果」就跟着关，不用用户再点一次关怀模式里的那一项 */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* 光标落在被遮住的元素上（安卓 TalkBack 焦点框会跑到屏幕外）：保证滚动进可视区 */
.notice-item, .dl-btn, .foot-cat-list a { scroll-margin: 8px; }

/* ================= 登录安全（1.1.77）：验证码 / 密码显隐 / 记住账号 / 水印 ================= */

/* 密码框 + 「显示」按钮：按钮压在输入框右侧内部，不额外占一行高度。
   输入框右侧留出 52px，避免长密码被按钮盖住最后一个字。 */
.login-pass-wrap { position: relative; }
.login-pass-wrap input { padding-right: 56px; margin-bottom: 12px; }
.pass-eye {
  position: absolute; top: 5px; right: 6px;
  height: 32px; min-width: 44px; padding: 0 8px;
  border: 1px solid var(--border); border-radius: 6px;
  background: #f5f8fc; color: #3d4b5c;
  font-size: 13px; line-height: 1; cursor: pointer;
}
.pass-eye[aria-pressed="true"] { background: #e8f1fd; border-color: var(--primary); color: var(--primary); }

/* 验证码行：输入框自适应，图片固定 108×40（与服务端 SVG 的 width/height 一致，
   不一致会按 viewBox 缩放，数字在手机上就糊了） */
.login-cap-row { display: flex; align-items: stretch; gap: 8px; margin-bottom: 12px; }
.login-cap-row input { flex: 1 1 auto; min-width: 0; margin-bottom: 0; text-transform: uppercase; letter-spacing: 4px; }
.cap-img {
  flex: 0 0 108px; width: 108px; height: 40px; padding: 0;
  border: 1px solid var(--border); border-radius: 8px;
  background: #eef3fa; overflow: hidden; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.cap-img svg { display: block; width: 108px; height: 40px; }
.cap-img:disabled { cursor: wait; }
.cap-loading { font-size: 13px; color: #5b6b7d; }

/* 记住账号：只存用户名。勾选框放大到 16px，和旁边的文字同一视线高度 */
.login-remember {
  display: flex; align-items: center; gap: 8px;
  margin: -2px 0 12px; font-size: 15px; color: #3d4b5c; cursor: pointer;
  user-select: none;
}
.login-remember input { width: 16px; height: 16px; margin: 0; accent-color: var(--primary); }

/* 关怀模式下这几处同样要放大（其余表单控件已在 html.care 里统一处理） */
html.care .login-remember,
html.care .cap-loading { font-size: 17px; }
html.care .pass-eye { font-size: 15px; height: 36px; }

/* 登录页水印：铺满整个登录页的格子里，每格一层文字。
   要点：
   - pointer-events:none —— 绝不挡住表单和输入框的点击；
   - z-index:0 且容器不要建层（不加 position/z-index），让它沉在内容下面；
   - 角度/字号/颜色/透明度来自 --wm-*（1.1.84 由「系统设置 → 水印设置」下发）。
   变量都有兜底值：接口没回来或老版本样式下也不会变成 0 号字/全透明。 */
.login-wm {
  position: absolute; inset: 0; z-index: 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-template-rows: repeat(5, 1fr);
  overflow: hidden;
  pointer-events: none;
  user-select: none;
  /* 登录页整页是深蓝渐变（#loginPage 的 background），左右两栏都压在它上面，
     所以水印统一用白字、只吃管理员配的 alpha。不要把 .wm-cell 的 DOM 放进
     .login-side —— 那样它就会被卡片的背景盖住，反而看不见。 */
  --wm-fg: 255, 255, 255;
  --wm-alpha-k: 1;
}
.wm-cell {
  display: flex; align-items: center; justify-content: center;
  font-size: var(--wm-size, 13px); line-height: 1.2;
  color: rgba(var(--wm-fg, 255, 255, 255), calc(var(--wm-alpha, 0.18) * var(--wm-alpha-k, 1)));
  white-space: nowrap;
  transform: rotate(var(--wm-rotate, -24deg));
  letter-spacing: 1px;
}
/* 关怀模式：底色不变（还是深蓝），只是低视力用户需要更高对比 ——
   字号抬 2px、alpha 抬一档。深色底上白字始终是白字，不要换成管理员配的深色。 */
html.care .wm-cell { --wm-alpha-k: 1.3; font-size: calc(var(--wm-size, 13px) + 2px); }
html.care .login-wm .wm-cell { --wm-alpha-k: 1.8; }

/* ================= 应用内全局水印（1.1.83，后台开关控制） =================
   与登录页水印的区别：这里盖的是登录后的整个系统（含浮层、公告详情窗）。
   要点：
   - position:fixed 且 inset:0：跟着视口而不是某个容器，滚动/翻页都铺满；
   - z-index 取一个「高于普通内容、远低于弹窗」的值：弹窗（#confirmDlg、#noticeDlg）
     在 1000+，这里 40 —— 这样水印压得住页面，但不会盖住任何浮层里的按钮；
   - pointer-events:none：绝不拦截点击、拖选、滚动；
   - 透明度压到 0.06 左右：能看清字又不影响读正文。 */
.app-wm {
  position: fixed; inset: 0; z-index: 40;
  overflow: hidden;
  pointer-events: none;
  user-select: none;
}
.app-wm-grid {
  position: absolute; inset: 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-template-rows: repeat(5, 1fr);
}
/* 应用内是浅色底为主，用深灰最不容易和正文撞色。
   颜色/透明度/字号/角度全部走 --wm-*（在 #app-wm 上设置，见 renderer.js 的 appWmPaint），
   兜底值取 1.1.84 的默认配置，保证「配置还没回来」时也画得出来。 */
.app-wm .wm-cell {
  display: flex; align-items: center; justify-content: center;
  font-size: var(--wm-size, 13px); line-height: 1.2;
  color: rgba(var(--wm-rgb, 30, 45, 70), var(--wm-alpha, 0.18));
  white-space: nowrap;
  transform: rotate(var(--wm-rotate, -24deg));
  letter-spacing: 1px;
  font-family: ui-monospace, Menlo, Consolas, monospace;
}
/* 深色顶栏那一段（.topbar）上水印会看不见：给它单独一层浅色字。
   这里用「整层再叠一份白色字、只在顶栏高度内显示」的做法太绕，
   直接提高对比度即可 —— 顶栏本身很窄，看漏一条水印不影响整体留痕。 */
@media print {
  /* 打印/导出走的是另一套 HTML，页面水印不该被带进打印结果 */
  .app-wm { display: none !important; }
}

/* 登录页里的内容层必须在未定位或自动层里、且自身不透明才能「盖住」水印。
   这里只给两个列容器显式抬一层，避免个别浏览器把 grid 子项也画到水印之上/之下不定 */
.login-notice, .login-side { position: relative; z-index: 1; }

/* 水印设置页（1.1.83）：两行开关 + 保存，铺在整张表体里 */
.wm-set { padding: 18px 20px; max-width: 860px; }
.wm-set-row {
  display: grid; grid-template-columns: auto 110px 1fr;
  align-items: start; gap: 4px 10px;
  padding: 12px 0;
  border-bottom: 1px dashed var(--border);
  cursor: pointer;
}
.wm-set-row input[type="checkbox"] { width: 16px; height: 16px; margin-top: 2px; cursor: pointer; }
.wm-set-title { font-size: 14px; font-weight: 600; color: var(--text); }
.wm-set-row .about-hint { margin: 0; }
.wm-set .notice-actions { justify-content: space-between; align-items: center; }

/* 外观参数（1.1.84）：标签 + 控件 + 数值/单位，一行一项。
   用 grid 而不是 flex 是为了三列对齐 —— 标签长度不一样（「不透明度」比「角度」长三倍），
   flex 下右边界会参差。 */
.wm-sec { margin: 4px 0 2px; }
.wm-sec-title {
  font-size: 13px; font-weight: 600; color: var(--muted, #6b7280);
  letter-spacing: .5px; margin: 16px 0 6px;
}
.wm-item {
  display: grid; grid-template-columns: 96px 1fr 92px;
  align-items: center; gap: 10px;
  padding: 7px 0;
}
.wm-item > label { font-size: 13px; color: var(--text); }
.wm-item input[type="text"], .wm-item input[type="number"] {
  width: 100%; padding: 6px 9px; border: 1px solid var(--border); border-radius: 6px;
  font-size: 13px; background: #fff; outline: none; box-sizing: border-box;
}
.wm-item input[type="text"]:focus, .wm-item input[type="number"]:focus { border-color: var(--brand, #2563eb); }
.wm-item input[type="range"] { width: 100%; cursor: pointer; }
.wm-item .wm-val { font-size: 12px; color: var(--muted, #6b7280); text-align: right; }
.wm-item input[type="color"] {
  width: 100%; height: 30px; padding: 2px; border: 1px solid var(--border);
  border-radius: 6px; background: #fff; cursor: pointer;
}
.wm-tpl { grid-column: 1 / -1; padding-top: 2px; }
.wm-tpl input { font-family: ui-monospace, Menlo, Consolas, monospace; }
/* 占位符速查：做成可点的按钮直接插进模板，比让人背 {账号} 好得多 */
.wm-ph { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.wm-ph button {
  padding: 3px 9px; border: 1px solid var(--border); border-radius: 999px;
  background: #f8fafc; font-size: 12px; color: var(--text); cursor: pointer;
  font-family: ui-monospace, Menlo, Consolas, monospace;
}
.wm-ph button:hover { background: #eef2f7; border-color: var(--brand, #2563eb); }
/* 实时预览：用和真实水印同一套 CSS 变量，所见即所得 */
.wm-prev {
  position: relative; height: 132px; margin-top: 10px;
  border: 1px solid var(--border); border-radius: 8px; overflow: hidden;
  background: var(--bg, #f3f5f8);
}
/* 预览框是浅色卡片，而 .wm-cell 全局默认白字（登录页是深底）——
   不改 --wm-fg 的话预览就是白底白字，看起来像「没生效」。
   这里吃管理员配的 --wm-rgb，和导出件、页面水印是同一种颜色。 */
.wm-prev { --wm-fg: var(--wm-rgb, 30, 45, 70); }
.wm-prev .wm-cell { position: absolute; font-family: ui-monospace, Menlo, Consolas, monospace; }

@media (max-width: 640px) {
  .wm-set-row { grid-template-columns: auto 1fr; }
  .wm-set-row .about-hint { grid-column: 1 / -1; }
  .wm-item { grid-template-columns: 84px 1fr; }
  .wm-item .wm-val { grid-column: 2; text-align: left; }
}

/* ================= 登录日志（管理员，1.1.77） ================= */
.lg-wrap { padding: 14px 16px; }
.lg-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
.lg-bar input[type="search"] { flex: 1 1 180px; min-width: 140px; }
.lg-bar input, .lg-bar select {
  padding: 7px 10px; border: 1px solid var(--border); border-radius: 6px;
  font-size: 14px; background: #fff; outline: none;
}
.lg-bar input:focus, .lg-bar select:focus { border-color: var(--primary); }
.lg-bar button { padding: 7px 14px; font-size: 14px; border-radius: 6px; }
.lg-primary { background: var(--primary); color: #fff; border: 1px solid var(--primary); }
.lg-tilde { font-size: 14px; color: #6b7b8c; }

/* 统计条：每个结果一个色块，和表格里的结果色保持一致，扫一眼就知道最近失败多不多 */
.lg-stats { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.lg-chip {
  font-size: 13px; padding: 3px 10px; border-radius: 999px;
  background: #eef3fa; color: #3d4b5c; border: 1px solid #dbe5f1;
}
.lg-chip b { font-weight: 700; }
.lg-chip.ok { background: #eaf7ee; border-color: #c5e6d0; color: #1f6b3a; }
.lg-chip.bad { background: #fdeeec; border-color: #f3cbc5; color: #a0291d; }
.lg-chip.warn { background: #fff6e5; border-color: #f2dcb0; color: #8a5300; }

.lg-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.lg-table th {
  text-align: left; font-weight: 600; color: #3d4b5c;
  background: #f4f8fd; padding: 8px 10px; border-bottom: 1px solid #dbe5f1;
}
.lg-table td { padding: 8px 10px; border-bottom: 1px solid #edf1f6; vertical-align: top; }
.lg-table tr:hover td { background: #fafcff; }
.lg-time, .lg-ip { white-space: nowrap; font-variant-numeric: tabular-nums; }
.lg-ua { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lg-empty { text-align: center; color: #7c8a99; padding: 24px 0; }
.lg-res { font-size: 13px; padding: 1px 8px; border-radius: 4px; background: #eef3fa; }
.lg-res.ok { background: #eaf7ee; color: #1f6b3a; }
.lg-res.bad { background: #fdeeec; color: #a0291d; }
.lg-res.warn { background: #fff6e5; color: #8a5300; }

.lg-pager { display: flex; align-items: center; gap: 12px; margin-top: 12px; font-size: 14px; color: #4a5a6b; }
.lg-pager button { padding: 5px 14px; border-radius: 6px; font-size: 14px; }

/* 窄屏：筛选栏竖排，表格允许横向滚动（列多，硬挤会把 IP 和时间压成两行） */
@media (max-width: 720px) {
  .lg-bar input[type="search"], .lg-bar select { flex: 1 1 100%; }
  .lg-wrap { overflow-x: auto; }
  .lg-table { min-width: 620px; }
}

/* ================= 下载统计（管理员，1.1.79） ================= */
.ds-wrap { padding: 14px 16px; }
.ds-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
.ds-range {
  padding: 5px 12px; font-size: 13px; border-radius: 999px;
  background: #fff; border: 1px solid var(--border); color: #3d4b5c; cursor: pointer;
}
.ds-range:hover { border-color: var(--primary); color: var(--primary); }
.ds-range.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.ds-tip { margin-left: auto; font-size: 12.5px; color: #7c8a99; }

/* 图表卡片：轻量毛玻璃感（和登录页下载区同一套材质语言：半透明底 + 细边 + blur）。
   blur 只画在这一块上，不铺满整页 —— 大面积 backdrop-filter 在低端集显上会掉帧。 */
.ds-chart {
  padding: 12px 14px 8px;
  margin-bottom: 14px;
  border: 1px solid #dbe5f1;
  border-radius: 10px;
  background: rgba(248, 251, 255, 0.82);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.ds-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 4px; font-size: 13px; color: #3d4b5c; }
.ds-lg { display: inline-flex; align-items: center; gap: 5px; }
.ds-lg b { font-weight: 700; color: #1c3a5c; }
.ds-dot { width: 9px; height: 9px; border-radius: 50%; background: #4c9bf0; }
.ds-dot.ds-c-0 { background: #4c9bf0; }
.ds-dot.ds-c-1 { background: #f0a04c; }
.ds-dot.ds-c-2 { background: #e05a6b; }
.ds-dot.ds-c-3 { background: #5cc98a; }
.ds-dot.ds-c-4 { background: #c46bdd; }

/* SVG 撑满容器：viewBox 固定 900×260，等比缩放，窄屏也不会把刻度压扁 */
.ds-svg { display: block; width: 100%; height: auto; }
.ds-grid { stroke: #e2eaf4; stroke-width: 1; }
.ds-axis { fill: #8a99aa; font-size: 11px; font-family: inherit; }
.ds-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.ds-pt { stroke: none; }
/* 折线配色跟着平台档位走，与图例色点完全一致（两处都从 colorIndex 来） */
.ds-line.ds-ci-0 { stroke: #4c9bf0; }
.ds-line.ds-ci-1 { stroke: #f0a04c; }
.ds-line.ds-ci-2 { stroke: #e05a6b; }
.ds-line.ds-ci-3 { stroke: #5cc98a; }
.ds-line.ds-ci-4 { stroke: #c46bdd; }
.ds-pt.ds-ci-0 { fill: #4c9bf0; }
.ds-pt.ds-ci-1 { fill: #f0a04c; }
.ds-pt.ds-ci-2 { fill: #e05a6b; }
.ds-pt.ds-ci-3 { fill: #5cc98a; }
.ds-pt.ds-ci-4 { fill: #c46bdd; }
.ds-note { margin: 4px 0 0; font-size: 12.5px; color: #7c8a99; }

.ds-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.ds-table th {
  text-align: left; font-weight: 600; color: #3d4b5c;
  background: #f4f8fd; padding: 8px 10px; border-bottom: 1px solid #dbe5f1;
}
.ds-table td { padding: 8px 10px; border-bottom: 1px solid #edf1f6; }
.ds-table tr:hover td { background: #fafcff; }
.ds-time { white-space: nowrap; font-variant-numeric: tabular-nums; color: #5a6b7c; }
.ds-empty { text-align: center; color: #7c8a99; padding: 24px 0; }
.ds-skeleton { height: 260px; border-radius: 10px; }

@media (max-width: 720px) {
  .ds-tip { margin-left: 0; }
  .ds-wrap { overflow-x: auto; }
  .ds-table { min-width: 560px; }
}

/* ================= 骨架屏 / 空状态（1.1.79 统一口径） ================= */
/* 加载中：不给「白屏 + 转圈」，而是画一块和最终内容同尺寸的灰膜，
   内容出来的瞬间不跳版。键盘/读屏用户听到 aria-busy，视觉上是一条扫光。 */
.skeleton {
  position: relative;
  overflow: hidden;
  background: #eef3fa;
  border-radius: 8px;
}
.skeleton::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.7), transparent);
  transform: translateX(-100%);
  animation: sk-sweep 1.2s ease-in-out infinite;
}
@keyframes sk-sweep {
  to { transform: translateX(100%); }
}
/* 关怀模式/系统开了「减少动态」：扫光动画关掉，只留灰底，避免眩晕 */
html.care .skeleton::after { animation: none; }
@media (prefers-reduced-motion: reduce) {
  .skeleton::after { animation: none; }
}

/* 空状态：图标 + 一句话 + 一句「接下来该做什么」。
   各页面原来各写一段灰字，口径不一（有的说「暂无数据」，有的什么都不显示），统一成这个。 */
.empty-state {
  padding: 40px 16px;
  text-align: center;
  color: #6b7b8c;
}
.empty-state::before {
  content: '📭';
  display: block;
  font-size: 34px;
  line-height: 1;
  margin-bottom: 10px;
  opacity: 0.65;
}
.empty-state p { margin: 0 0 6px; font-size: 14px; }
.empty-state p:last-child { margin-bottom: 0; }

/* 空态里的行内引导按钮：看起来像链接，但仍是 <button>（键盘可达） */
.link-btn {
  background: none;
  border: none;
  padding: 0;
  color: var(--primary);
  font-size: 14px;
  cursor: pointer;
  text-decoration: underline;
}
.link-btn:hover { color: var(--primary-dark, #0b5fa5); }
.empty-row .empty-state { padding: 12px 16px; }
.empty-row .empty-state::before { display: none; }

/* ================= 1.1.81 工程项目 / 监理机构 / 监理人员 ================= */

/* --- 工程项目页：状态统计卡条 --- */
#list-cards {
  display: grid;
  /* minmax(0, 1fr) 不能写成 minmax(150px, 1fr)：5 张卡时 5×150=750 加上间隙仍小于
     #content 的内容宽，auto-fit 会多算出一条 0px 的轨道，五张卡挤在四条里。
     窄屏交给下面的 @media 直接降到 2 列。 */
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}
@media (max-width: 1100px) { #list-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 720px) { #list-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* 卡片是 <button>：清掉原生按钮样式，外观沿用 .ov-card */
.lc-card {
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: 10px;
  background: #fff;
  padding: 16px 18px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
  transition: box-shadow .15s, transform .15s, background .15s;
}
.lc-card:hover { box-shadow: 0 3px 12px rgba(0,0,0,0.10); transform: translateY(-1px); }
.lc-card:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
/* 选中态：左边框加粗 + 内描边 + 浅底，不靠颜色单独表达（另有 aria-pressed 与 label 的 ✓） */
.lc-card.on {
  border-left-width: 6px;
  background: #f4f9ff;
  box-shadow: inset 0 0 0 2px rgba(20, 97, 168, .28), 0 1px 4px rgba(0,0,0,0.04);
}
.lc-card.on .ov-label { color: #1d2634; font-weight: 600; }
.lc-card.on .ov-label::after { content: ' ✓'; color: var(--primary); }
.lc-card.warn { border-left-color: #f5a623; }
.lc-card.danger { border-left-color: var(--danger); }
.lc-card.ok { border-left-color: var(--success); }

/* --- 项目状态徽章：图标 + 文字，不只靠颜色区分 --- */
.psb {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 8px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-size: 12px;
  line-height: 18px;
  white-space: nowrap;
}
.psb i { font-style: normal; font-size: 10px; line-height: 1; }
.psb-going { background: #e8f1fb; color: #1461a8; border-color: #bcd8f2; }
.psb-wait  { background: #fff6e3; color: #8a5b00; border-color: #f5deb0; }
.psb-pause { background: #fdeaea; color: #a52222; border-color: #f3c3c3; }
.psb-done  { background: #e9f7ee; color: #1a7a43; border-color: #bfe6cd; }
.psb-other { background: #f1f3f6; color: #4a5866; border-color: #d8dee6; }

/* --- 配齐率 / 到岗率进度条 ---
   宽度只能用预生成的类（CSP 不允许给动态元素写行内 style）。 */
.rate-wrap { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.rate-track {
  display: inline-block;
  width: 54px;
  height: 6px;
  border-radius: 3px;
  background: #e8ecf1;
  overflow: hidden;
}
.rate-fill { display: block; height: 100%; border-radius: 3px; background: var(--primary); }
.rate-fill.ok { background: var(--success); }
.rate-fill.warn { background: #f5a623; }
.rate-fill.danger { background: var(--danger); }
.rate-num { font-variant-numeric: tabular-nums; font-size: 12px; color: #4a5866; }
.rate-na { color: var(--text-light); }
.rate-col { white-space: nowrap; }

/* 0~100 各一条，rateBar() 把百分比取整后拼成 rate-w{N}。 */
.rate-w0 { width: 0%; }
.rate-w1 { width: 1%; }
.rate-w2 { width: 2%; }
.rate-w3 { width: 3%; }
.rate-w4 { width: 4%; }
.rate-w5 { width: 5%; }
.rate-w6 { width: 6%; }
.rate-w7 { width: 7%; }
.rate-w8 { width: 8%; }
.rate-w9 { width: 9%; }
.rate-w10 { width: 10%; }
.rate-w11 { width: 11%; }
.rate-w12 { width: 12%; }
.rate-w13 { width: 13%; }
.rate-w14 { width: 14%; }
.rate-w15 { width: 15%; }
.rate-w16 { width: 16%; }
.rate-w17 { width: 17%; }
.rate-w18 { width: 18%; }
.rate-w19 { width: 19%; }
.rate-w20 { width: 20%; }
.rate-w21 { width: 21%; }
.rate-w22 { width: 22%; }
.rate-w23 { width: 23%; }
.rate-w24 { width: 24%; }
.rate-w25 { width: 25%; }
.rate-w26 { width: 26%; }
.rate-w27 { width: 27%; }
.rate-w28 { width: 28%; }
.rate-w29 { width: 29%; }
.rate-w30 { width: 30%; }
.rate-w31 { width: 31%; }
.rate-w32 { width: 32%; }
.rate-w33 { width: 33%; }
.rate-w34 { width: 34%; }
.rate-w35 { width: 35%; }
.rate-w36 { width: 36%; }
.rate-w37 { width: 37%; }
.rate-w38 { width: 38%; }
.rate-w39 { width: 39%; }
.rate-w40 { width: 40%; }
.rate-w41 { width: 41%; }
.rate-w42 { width: 42%; }
.rate-w43 { width: 43%; }
.rate-w44 { width: 44%; }
.rate-w45 { width: 45%; }
.rate-w46 { width: 46%; }
.rate-w47 { width: 47%; }
.rate-w48 { width: 48%; }
.rate-w49 { width: 49%; }
.rate-w50 { width: 50%; }
.rate-w51 { width: 51%; }
.rate-w52 { width: 52%; }
.rate-w53 { width: 53%; }
.rate-w54 { width: 54%; }
.rate-w55 { width: 55%; }
.rate-w56 { width: 56%; }
.rate-w57 { width: 57%; }
.rate-w58 { width: 58%; }
.rate-w59 { width: 59%; }
.rate-w60 { width: 60%; }
.rate-w61 { width: 61%; }
.rate-w62 { width: 62%; }
.rate-w63 { width: 63%; }
.rate-w64 { width: 64%; }
.rate-w65 { width: 65%; }
.rate-w66 { width: 66%; }
.rate-w67 { width: 67%; }
.rate-w68 { width: 68%; }
.rate-w69 { width: 69%; }
.rate-w70 { width: 70%; }
.rate-w71 { width: 71%; }
.rate-w72 { width: 72%; }
.rate-w73 { width: 73%; }
.rate-w74 { width: 74%; }
.rate-w75 { width: 75%; }
.rate-w76 { width: 76%; }
.rate-w77 { width: 77%; }
.rate-w78 { width: 78%; }
.rate-w79 { width: 79%; }
.rate-w80 { width: 80%; }
.rate-w81 { width: 81%; }
.rate-w82 { width: 82%; }
.rate-w83 { width: 83%; }
.rate-w84 { width: 84%; }
.rate-w85 { width: 85%; }
.rate-w86 { width: 86%; }
.rate-w87 { width: 87%; }
.rate-w88 { width: 88%; }
.rate-w89 { width: 89%; }
.rate-w90 { width: 90%; }
.rate-w91 { width: 91%; }
.rate-w92 { width: 92%; }
.rate-w93 { width: 93%; }
.rate-w94 { width: 94%; }
.rate-w95 { width: 95%; }
.rate-w96 { width: 96%; }
.rate-w97 { width: 97%; }
.rate-w98 { width: 98%; }
.rate-w99 { width: 99%; }
.rate-w100 { width: 100%; }

/* --- 监理人员：证书到期提醒 --- */
.cert-exp { white-space: nowrap; }
.cert-exp b { margin-left: 6px; font-weight: 400; font-size: 12px; color: var(--text-light); }
.cert-exp.ce-soon b { color: #a5730b; }
.cert-exp.ce-expired { color: #c0392b; }
.cert-exp.ce-expired b { color: #c0392b; }
/* 离职 / 休假：整行灰化，扫一眼就知道不参与统计 */
tr.row-muted td { color: var(--text-light); }
tr.row-muted td .psb { opacity: .8; }

/* --- 监理机构：机构人员勾选 --- */
.org-members { border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.om-empty { padding: 14px; font-size: 13px; color: var(--text-light); background: #f8fafc; }
.om-head, .om-row {
  display: grid;
  grid-template-columns: 28px 1fr 96px 120px 64px;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  font-size: 13px;
}
.om-head { background: #f5f7fa; font-weight: 600; color: #4a5866; }
.om-row { border-top: 1px solid var(--border); cursor: pointer; }
.om-row:hover { background: #f8fafc; }
.om-check { margin: 0; }
.om-cert { color: var(--text-light); font-variant-numeric: tabular-nums; }
.om-status { color: var(--text-light); }
.om-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 8px 10px;
  border-top: 1px solid var(--border);
  background: #f5f7fa;
  font-size: 13px;
}
.om-foot #om-count { margin-right: auto; color: var(--text-light); }
.om-foot button { padding: 3px 10px; font-size: 13px; border: 1px solid var(--border); border-radius: 6px; background: #fff; cursor: pointer; }
.om-foot button:hover { border-color: var(--primary); color: var(--primary); }

/* --- 附件：资料类型 + 版本 --- */
.file-role { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-light); }
.file-role select { padding: 3px 8px; font-size: 13px; border: 1px solid var(--border); border-radius: 6px; background: #fff; }
.file-role-tag {
  display: inline-block;
  margin-right: 6px;
  padding: 0 6px;
  border-radius: 8px;
  background: #e8f1fb;
  color: #1461a8;
  font-size: 12px;
  line-height: 18px;
}
.file-ver { margin-right: 6px; font-size: 12px; color: #a5730b; }

/* --- 考勤页：只看某人的横幅 --- */
.att-only {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  padding: 8px 12px;
  border: 1px solid #bcd8f2;
  border-left: 4px solid var(--primary);
  border-radius: 8px;
  background: #f4f9ff;
  font-size: 13px;
}
.att-only strong { color: #0f4c85; }

/* --- 批量新增对话框 --- */
.batch-hint { margin: 0 0 8px; font-size: 13px; color: var(--text-light); }
#batch-text {
  width: 100%;
  min-height: 140px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.6;
  resize: vertical;
}
#batch-text:focus { outline: none; border-color: #1461a8; box-shadow: 0 0 0 3px rgba(20, 97, 168, .12); }
.batch-preview { margin-top: 10px; }
.batch-empty {
  padding: 14px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  text-align: center;
  font-size: 13px;
  color: var(--text-light);
}
.batch-stat { font-size: 13px; color: var(--text-light); margin-bottom: 6px; }
.batch-stat strong { color: var(--text); }
.batch-stat strong.ok { color: #1f8a4c; }
.batch-stat strong.bad { color: #c0392b; }
.batch-scroll { max-height: 240px; overflow: auto; border: 1px solid var(--border); border-radius: 6px; }
.batch-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.batch-table th, .batch-table td {
  padding: 4px 8px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  white-space: nowrap;
}
.batch-table th { position: sticky; top: 0; background: #f5f7fa; font-weight: 600; color: #4a5866; }
.batch-table .batch-no { width: 40px; color: var(--text-light); text-align: right; }
.batch-table .batch-note { color: var(--text-light); white-space: normal; }
.batch-table tr.batch-bad td { background: #fdf0ee; }
.batch-table tr.batch-bad .batch-note { color: #c0392b; }
.batch-table tr.batch-warn td { background: #fff9e8; }
.batch-table tr.batch-warn .batch-note { color: #a5730b; }
.batch-more { padding: 6px 8px; font-size: 12px; color: var(--text-light); }

/* ================= 扫码定位（1.2.0） ================= */
/* 扫码头：和搜索框并排，样式接近但窄一些 —— 它通常只装 6~20 个字符的编号 */
#doc-scan { width: 200px; }
#doc-scan:focus { border-color: var(--primary, #2563eb); outline: none; }

/* 弹窗层级压到 #confirmDlg 之下（100）：归档确认框要能盖住它 */
#docCodeDlg { z-index: 120; }
#docCodeDlg.hidden { display: none; }
.modal-box.doccode-box { width: 860px; max-width: 96vw; height: 76vh; }

.doccode-meta {
  padding: 10px 20px 8px;
  border-bottom: 1px solid var(--border);
  font-size: 13px; color: #475569;
  display: flex; flex-wrap: wrap; gap: 4px 18px;
}
.doccode-meta .dc-item { display: inline-flex; gap: 4px; }
.doccode-meta .dc-k { color: #94a3b8; }
.doccode-meta .dc-v { color: var(--text); font-weight: 500; }
.doccode-meta .dc-v.mono { font-variant-numeric: tabular-nums; letter-spacing: 0.3px; }

.doccode-tabs {
  display: flex; gap: 4px;
  padding: 8px 20px 0;
  border-bottom: 1px solid var(--border);
}
.doccode-tab {
  border: none; background: none; cursor: pointer;
  padding: 7px 14px; font-size: 13.5px; color: #64748b;
  border-bottom: 2px solid transparent;
}
.doccode-tab:hover { color: var(--text); }
.doccode-tab.active { color: var(--primary, #2563eb); border-bottom-color: var(--primary, #2563eb); font-weight: 600; }

/* 流程链结论条：绿=链完整，红=被改过。两种颜色都要显眼，但别刺眼 */
.doccode-chain {
  margin: 10px 20px 0;
  padding: 7px 12px; border-radius: 6px;
  font-size: 12.5px; line-height: 1.5;
}
.doccode-chain.ok { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.doccode-chain.bad { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }

/* 复查推进条（1.4.6）：扫码定位后直接在弹窗里推进整改闭环。
   按钮复用列表行那套 .wf 配色（primary/ok/danger），这里只负责排布。 */
.doccode-actions {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  margin: 10px 20px 0; padding: 8px 12px;
  border-radius: 6px; background: #f8fafc; border: 1px solid var(--border);
}
.doccode-actions.hidden { display: none; }
.doccode-actions .wf-hint { font-size: 12.5px; color: #94a3b8; }

.doccode-body { flex: 1; min-height: 0; overflow: auto; padding: 12px 20px 18px; }
.doccode-pane.hidden { display: none; }

/* 正文：两列的字段表。值可能很长（整改要求），允许换行 */
.dc-grid { display: grid; grid-template-columns: 130px 1fr; gap: 0; font-size: 13px; }
.dc-grid > .dc-k, .dc-grid > .dc-v { padding: 6px 8px; border-bottom: 1px solid #eef2f6; }
.dc-grid > .dc-k { color: #64748b; background: #f8fafc; }
.dc-grid > .dc-v { color: var(--text); white-space: pre-wrap; word-break: break-word; }
.dc-grid > .dc-full-k { grid-column: 1 / -1; }

/* 版本历史 / 流程记录：两张小表 */
.dc-list { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.dc-list th, .dc-list td {
  padding: 6px 8px; text-align: left; vertical-align: top;
  border-bottom: 1px solid #eef2f6;
}
.dc-list th { color: #64748b; font-weight: 500; background: #f8fafc; white-space: nowrap; }
.dc-list td { color: var(--text); word-break: break-word; }
.dc-list tr.dc-head td { background: #f8fafc; color: #94a3b8; }
.dc-empty { padding: 18px 4px; color: #94a3b8; font-size: 13px; }
/* 版本差异：改前灰、改后绿，比只看两个值直观 */
.dc-diff .dc-before { color: #94a3b8; text-decoration: line-through; }
.dc-diff .dc-after { color: #047857; }
.dc-ver-link { color: var(--primary, #2563eb); cursor: pointer; text-decoration: underline; }

@container (max-width: 620px) {
  .dc-grid { grid-template-columns: 1fr; }
  .dc-grid > .dc-k { border-bottom: none; padding-bottom: 0; }
}

/* 用户管理 → 签字图（1.2.9）：缩略图按签名常见比例给个透明底框，别把白纸拍进去显得黑一块 */
.sign-upload { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.sign-thumb { width: 180px; height: 90px; border: 1px dashed var(--border, #d0d5dd); border-radius: 4px;
  display: flex; align-items: center; justify-content: center; background: #fff; overflow: hidden; }
.sign-thumb img { max-width: 100%; max-height: 100%; display: block; }
.sign-thumb .sign-empty { color: var(--text-light, #999); font-size: 12px; }
.sign-actions { display: flex; gap: 8px; }

/* ==========================================================================
   扫码整改页（1.4.0）—— 施工单位手机打开，匿名可见。
   和 .dlpage 一样独立成一段：页面不引 renderer.js，只吃这一段的样式。
   类名统一 rfl-（rectify link）前缀，避免和主界面同名规则互相影响。
   移动端优先：320px 宽也不横向滚动；到 720px 以上才收窄成居中卡片列。
   ========================================================================== */
body.rfl-page {
  margin: 0; min-height: 100vh;
  background: #f1f5f9; color: #1e293b;
  font: 14px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-text-size-adjust: 100%;
}
.rfl-wrap { max-width: 720px; margin: 0 auto; padding: 0 0 32px; }
.rfl-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 12px 16px; background: #0f2c52; color: #fff;
  position: sticky; top: 0; z-index: 10;
}
.rfl-brand { font-size: 15px; font-weight: 600; }
.rfl-code { font-size: 12px; opacity: .85; font-family: ui-monospace, Menlo, Consolas, monospace; }

.rfl-loading, .rfl-error { padding: 40px 16px; text-align: center; color: #64748b; }
.rfl-error { color: #b91c1c; }

.rfl-banner {
  margin: 12px 12px 0; padding: 10px 14px; border-radius: 8px;
  font-size: 13px; font-weight: 600;
}
.rfl-banner.is-open { background: #fff7ed; color: #b45309; border: 1px solid #fed7aa; }
.rfl-banner.is-closed { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }

.rfl-card {
  margin: 12px 12px 0; padding: 14px 16px; background: #fff;
  border-radius: 10px; box-shadow: 0 1px 2px rgba(15, 23, 42, .06);
}
.rfl-title { margin: 0 0 10px; font-size: 17px; line-height: 1.4; color: #0f172a; }
.rfl-sec {
  margin: 0 0 8px; font-size: 13px; font-weight: 600; color: #475569;
  padding-left: 8px; border-left: 3px solid #2563eb;
}
.rfl-card > .rfl-sec:not(:first-child) { margin-top: 16px; }
.rfl-text { white-space: pre-wrap; word-break: break-word; color: #1e293b; }

.rfl-kv { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; }
.rfl-kv > div { display: flex; gap: 6px; min-width: 0; }
.rfl-kv dt { flex: 0 0 auto; color: #64748b; font-size: 12.5px; }
.rfl-kv dd { margin: 0; min-width: 0; word-break: break-word; }

.rfl-photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.rfl-thumb {
  display: block; aspect-ratio: 1 / 1; overflow: hidden; border-radius: 6px;
  background: #f1f5f9; border: 1px solid #e2e8f0;
}
.rfl-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rfl-empty { color: #94a3b8; font-size: 12.5px; }

.rfl-textarea {
  width: 100%; box-sizing: border-box; padding: 10px 12px; border-radius: 8px;
  border: 1px solid #cbd5e1; font: inherit; resize: vertical; background: #fff;
}
.rfl-textarea:focus { outline: none; border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37, 99, 235, .12); }
.rfl-counter { text-align: right; font-size: 12px; color: #94a3b8; margin-top: 4px; }

.rfl-upload-row { margin: 10px 0 6px; }
.rfl-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 100%; box-sizing: border-box; padding: 11px 16px; border-radius: 8px;
  font: inherit; font-size: 15px; cursor: pointer; border: 1px solid transparent;
  -webkit-tap-highlight-color: transparent;
}
.rfl-btn-primary { background: #2563eb; color: #fff; margin-top: 14px; }
.rfl-btn-primary:disabled { background: #93c5fd; }
.rfl-btn-ghost { background: #f8fafc; color: #334155; border-color: #cbd5e1; }
.rfl-hint { margin-top: 8px; font-size: 12px; color: #94a3b8; line-height: 1.5; }
.rfl-closed-text { color: #1e293b; }

.rfl-flow { list-style: none; margin: 0; padding: 0; }
.rfl-flow > li {
  position: relative; padding: 0 0 14px 18px; border-left: 2px solid #e2e8f0;
}
.rfl-flow > li:last-child { border-left-color: transparent; padding-bottom: 0; }
.rfl-flow > li::before {
  content: ''; position: absolute; left: -6px; top: 4px; width: 10px; height: 10px;
  border-radius: 50%; background: #2563eb;
}
.rfl-flow-h { display: flex; justify-content: space-between; gap: 8px; font-size: 13.5px; }
.rfl-flow-h span { color: #94a3b8; font-size: 12px; white-space: nowrap; }
.rfl-flow-s, .rfl-flow-a { font-size: 12.5px; color: #64748b; }
.rfl-flow-d { font-size: 13px; color: #334155; margin-top: 2px; word-break: break-word; }

.rfl-foot { margin: 20px 12px 0; text-align: center; font-size: 12px; color: #94a3b8; }

.rfl-lightbox {
  position: fixed; inset: 0; z-index: 50; background: rgba(15, 23, 42, .92);
  display: flex; align-items: center; justify-content: center; padding: 12px;
}
.rfl-lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; }

.rfl-toast {
  position: fixed; left: 50%; bottom: 32px; transform: translateX(-50%);
  max-width: calc(100% - 48px); padding: 10px 18px; border-radius: 20px;
  background: rgba(15, 23, 42, .9); color: #fff; font-size: 13.5px; z-index: 60;
  word-break: break-word;
}

.rfl-page .hidden { display: none !important; }

@media (min-width: 720px) {
  .rfl-wrap { padding-top: 16px; }
  .rfl-head { border-radius: 10px; }
  .rfl-photos { grid-template-columns: repeat(4, 1fr); }
}
