/* ============================================================
   现场工时统计系统 · 设计系统 v2（高级感 / 丝滑动效）
   ============================================================ */
:root {
  --bg-1: #eef2ff;
  --bg-2: #f6f8fc;
  --bg-3: #eafaf1;
  --surface: rgba(255, 255, 255, 0.95);
  --surface-solid: #ffffff;
  --surface-2: #f4f6fb;
  --primary: #4f6ef7;
  --primary-d: #3a57e0;
  --primary-soft: #eaf0ff;
  --text: #1b2330;
  --muted: #6b7686;
  --border: #e4e9f2;
  --ok: #16a34a;
  --ok-soft: #e7f7ec;
  --warn: #f59e0b;
  --warn-soft: #fef3e0;
  --danger: #ef4444;
  --danger-soft: #fdeaea;
  --radius: 18px;
  --radius-sm: 13px;
  --shadow: 0 18px 50px rgba(31, 45, 80, 0.12);
  --shadow-sm: 0 6px 18px rgba(31, 45, 80, 0.08);
  --shadow-pop: 0 24px 70px rgba(20, 30, 60, 0.28);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  /* 磨砂/亚克力玻璃：高不透明度白 + 强模糊，保证文字可读性 */
  --glass-bg: linear-gradient(135deg, rgba(255,255,255,.94), rgba(255,255,255,.86));
  --glass-bg-2: linear-gradient(135deg, rgba(255,255,255,.92), rgba(255,255,255,.82));
  --glass-brd: rgba(255,255,255,.7);
  --glass-hi: rgba(255,255,255,.92);
  --shadow-glass: 0 14px 44px rgba(28,40,74,.14), 0 3px 10px rgba(28,40,74,.06);
  --shadow-glass-lg: 0 34px 90px rgba(18,28,56,.30), 0 6px 18px rgba(18,28,56,.10);
  --accent-grad: linear-gradient(135deg, #4f6ef7, #7d92ff 55%, #57e0c4);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; color: var(--text); min-height: 100vh;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  background: var(--bg-2);
  overflow-x: hidden;
}

/* 录入页：100vh 弹性外壳，内容自适应铺满，页面级滚动条取消（内容超出时内部隐形滚轮） */
body.app-shell { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }
body.app-shell .topbar { flex: 0 0 auto; }
/* 关键：在 flex column 布局里，.page 带 margin:0 auto 会禁用 align-self:stretch，
   导致 .page 宽度被 shrink 到内容宽度（卡片不同时 page 宽度不同，居中 left 随之变化 → 切换单/批量时卡片左右抖动）。
   这里强制 width:100% + box-sizing，让 .page 按 max-width 取固定宽度居中，不随卡片内容 shrink。 */
body.app-shell .page { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding-bottom: 40px;
  width: 100%; box-sizing: border-box; }
/* 维护页：靠前端分页保证内容不溢出视口，强制禁用页面级滚动条；录入/历史/账号页保持可滚动 */
.page.no-scroll { overflow: hidden; }
/* 动态渐变背景 */
body::before {
  content: ""; position: fixed; inset: -20%; z-index: -2;
  background:
    radial-gradient(40% 38% at 18% 22%, rgba(79, 110, 247, 0.20), transparent 60%),
    radial-gradient(42% 40% at 82% 18%, rgba(16, 185, 129, 0.16), transparent 60%),
    radial-gradient(45% 45% at 70% 85%, rgba(124, 139, 255, 0.18), transparent 60%),
    linear-gradient(135deg, var(--bg-1), var(--bg-2) 45%, var(--bg-3));
  /* animation disabled for perf (was bgShift 18s) */
}
body::after {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(120% 80% at 50% -10%, rgba(255,255,255,0.55), transparent 55%);
}
/* 浮动光斑（液态玻璃氛围） */
.bg-orbs { position: fixed; inset: -12%; z-index: -1; pointer-events: none; filter: blur(60px); opacity: .26;
  background:
    radial-gradient(26% 26% at 22% 32%, rgba(79,110,247,.6), transparent 70%),
    radial-gradient(24% 24% at 80% 26%, rgba(16,185,129,.5), transparent 70%),
    radial-gradient(30% 30% at 66% 82%, rgba(124,139,255,.55), transparent 70%),
    radial-gradient(20% 20% at 34% 74%, rgba(245,158,11,.4), transparent 70%);
  /* animation disabled for perf (was orbFloat 24s) */
}
@keyframes orbFloat {
  0%   { transform: translate3d(0,0,0) scale(1); }
  50%  { transform: translate3d(2.5%,-2%,0) scale(1.1); }
  100% { transform: translate3d(-2%,2.5%,0) scale(1.05); }
}
@keyframes bgShift {
  0%   { transform: translate3d(0,0,0) scale(1); }
  100% { transform: translate3d(0,-2.5%,0) scale(1.06); }
}

button { font-family: inherit; cursor: pointer; border: none; }
a { text-decoration: none; color: inherit; }

/* ---------- 通用按钮 ---------- */
.btn {
  position: relative; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: var(--radius-sm); padding: 13px 22px; font-size: 15px; font-weight: 700;
  background: linear-gradient(135deg, var(--primary), #6a82ff); color: #fff;
  box-shadow: 0 8px 20px rgba(79,110,247,.30), inset 0 1px 0 rgba(255,255,255,.35);
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), filter .18s;
  letter-spacing: .5px;
}
.btn:hover { filter: brightness(1.06); transform: translateY(-2px); box-shadow: 0 14px 30px rgba(79,110,247,.40), inset 0 1px 0 rgba(255,255,255,.4); }
.btn:active { transform: translateY(0) scale(.985); }
.btn.ghost { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); box-shadow: none; }
.btn.ghost:hover { background: #eef1f7; transform: translateY(-1px); }
/* 导入：蓝色描边（与"新增"主色蓝呼应但用 ghost 不抢） */
.btn.ghost.info { background: var(--primary-soft); color: var(--primary); border-color: var(--primary); box-shadow: 0 2px 6px rgba(79,110,247,.18); }
.btn.ghost.info:hover { background: #dbe5ff; transform: translateY(-1px); box-shadow: 0 6px 14px rgba(79,110,247,.28); }
/* 导出：绿色描边（绿色=成功/归档，语义与"导出完成"匹配） */
.btn.ghost.success { background: var(--ok-soft); color: var(--ok); border-color: var(--ok); box-shadow: 0 2px 6px rgba(22,163,74,.18); }
.btn.ghost.success:hover { background: #d4f0dd; transform: translateY(-1px); box-shadow: 0 6px 14px rgba(22,163,74,.28); }
.btn.ok { background: var(--ok); } .btn.ok:hover { background: #128a3e; box-shadow: 0 12px 26px rgba(22,163,74,.3); }
.btn.danger { background: var(--danger); color: #fff; border: 0; } .btn.danger:hover { background: #d83a3a; box-shadow: 0 12px 26px rgba(239,68,68,.3); }
.btn.warn { background: var(--warn); color: #fff; } .btn.warn:hover { background: #d1850a; box-shadow: 0 12px 26px rgba(245,158,11,.3); }
[data-theme="dark"] .btn.warn { background: var(--warn); color: #1a1106; }
[data-theme="dark"] .btn.warn:hover { background: #ffa620; box-shadow: 0 12px 26px rgba(245,158,11,.4); }
.btn.lg { padding: 16px 28px; font-size: 17px; border-radius: 16px; }
.btn.sm { padding: 4px 10px; font-size: 11.5px; font-weight: 600; letter-spacing: .2px; border-radius: 8px; gap: 4px; }
.op-col { white-space: nowrap; text-align: center; }
.op-none { color: var(--muted); }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none !important; }
/* 涟漪 */
.ripple { position: absolute; border-radius: 50%; background: rgba(255,255,255,.5); transform: scale(0); animation: ripple .6s var(--ease); pointer-events: none; }
@keyframes ripple { to { transform: scale(2.4); opacity: 0; } }

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 14px;
  padding: 14px 22px; background: rgba(255,255,255,.82); backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border-bottom: 1px solid var(--glass-brd); box-shadow: 0 6px 24px rgba(28,40,74,.06);
}
.topbar .ttl { font-weight: 800; font-size: 17px; display: flex; align-items: center; gap: 9px; }
.topbar .ttl .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 4px var(--ok-soft); animation: pulse 2s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .45; } }
.topbar .spacer { flex: 1; }
/* 顶栏中间的 tab 容器：5 个 tab 拉开合理间距，不再因 span 无 flex 顶在一起 */
.topbar #topnav { display: inline-flex; align-items: center; gap: 10px; }

/* 账号菜单（topbar 最右）：头像 + 名字 + 下拉箭头。
   仅 hover 触发展开（鼠标移走即收起，无"点击持久"状态）；点击不响应。 */
.user-menu { position: relative; display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 12px 7px 8px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--muted);
  white-space: nowrap; cursor: pointer;
  transition: background .18s var(--ease), border-color .18s var(--ease), box-shadow .18s var(--ease); }
/* hover 触发反馈 + 菜单展开（鼠标移开自动收起） */
.user-menu:hover { background: var(--surface-solid); border-color: var(--primary);
  box-shadow: 0 4px 14px rgba(79,110,247,.14); }
.user-menu .um-avatar { width: 26px; height: 26px; border-radius: 50%; box-shadow: none; flex: 0 0 auto; vertical-align: middle; }
.user-menu .um-name { color: var(--text); font-weight: 800; font-size: 13.5px; letter-spacing: .3px; max-width: 120px; overflow: hidden; text-overflow: ellipsis; }
.user-menu .um-caret { width: 13px; height: 13px; color: var(--muted); transition: transform .25s var(--ease), color .2s; flex: 0 0 auto; }
.user-menu:hover .um-caret { transform: rotate(180deg); color: var(--primary); }

/* 菜单容器默认收起；仅 hover 父时展开。点击不持久化（CSS :hover 天然瞬态） */
.um-actions { position: absolute; left: 50%; right: auto; top: 100%;
  transform: translateX(-50%) translateY(-6px);
  display: flex; flex-direction: column; gap: 5px; padding-top: 6px; min-width: 116px;
  opacity: 0; pointer-events: none;
  transition: opacity .22s var(--ease), transform .22s var(--ease); }
.user-menu:hover .um-actions { opacity: 1; pointer-events: auto; transform: translateX(-50%) translateY(0); }
.um-actions .btn { padding: 9px 14px; font-size: 13px; border-radius: 11px; box-shadow: 0 8px 22px rgba(12,20,56,.18); justify-content: center; gap: 8px; }
.um-actions .btn.um-logout { color: var(--danger); }
/* �� hover �ƶ�（�����ı���ȥ����ʾ���ܣ����ų���ʹ�û�����） */
.dd-trigger.no-float:hover { transform: none; filter: none; box-shadow: 0 4px 14px rgba(79,110,247,.32), inset 0 1px 0 rgba(255,255,255,.25); }
.dd-trigger.no-float:active { transform: none; }
.chip { font-size: 13px; padding: 7px 13px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); white-space: nowrap; }
.chip b { color: var(--text); }

/* 顶栏搜索框（看板）—— 玻璃胶囊，左放大镜右 × 清空，输入即过滤 */
.topbar-search { position: relative; display: inline-flex; align-items: center; gap: 8px;
  height: 40px; padding: 0 14px; border-radius: var(--radius-sm);
  background: #fff; border: 1.5px solid var(--border); color: var(--muted);
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease), background .18s; }
.topbar-search:focus-within { background: #fff; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(79,110,247,.16), inset 0 1px 2px rgba(28,40,74,.04); }
.topbar-search .ts-ic { width: 16px; height: 16px; flex: 0 0 16px; color: var(--muted); }
.topbar-search .ts-input { border: none; background: transparent; outline: none; font: inherit; font-size: 14px; font-weight: 600; color: var(--text); padding: 4px 0; width: 180px; min-width: 0; letter-spacing: .3px; }
.topbar-search .ts-input::placeholder { color: #aab3c4; font-weight: 500; letter-spacing: 0; }
.topbar-search .ts-clear { visibility: hidden; align-items: center; justify-content: center; width: 22px; height: 22px; flex: 0 0 22px; border-radius: 50%; border: none; background: rgba(28,40,74,.1); color: var(--muted); font-size: 15px; line-height: 1; cursor: pointer; transition: background .18s, color .18s; }
.topbar-search.has-text .ts-clear { visibility: visible; }
.topbar-search .ts-clear:hover { background: var(--danger-soft); color: var(--danger); }

/* 玻璃下拉（组别筛选） */
.dd { position: relative; }
.dd-trigger {
  display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700;
  padding: 8px 14px 8px 16px; border-radius: 999px; cursor: pointer; color: #fff; font-family: inherit;
  min-width: 108px; justify-content: space-between;
  background: linear-gradient(135deg, var(--primary), var(--primary-d)); border: 1px solid rgba(255,255,255,.18);
  box-shadow: 0 4px 14px rgba(79,110,247,.32), inset 0 1px 0 rgba(255,255,255,.25); transition: transform .18s var(--ease), box-shadow .18s var(--ease), filter .18s;
}
.dd-trigger:hover { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(79,110,247,.42), inset 0 1px 0 rgba(255,255,255,.3); filter: brightness(1.04); }
.dd-trigger:active { transform: translateY(0); }
.dd-trigger .dd-caret { color: #fff; opacity: .9; }
.dd.open .dd-trigger { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(79,110,247,.14); }
.dd-caret { transition: transform .25s var(--ease); color: var(--muted); }
.dd.open .dd-caret { transform: rotate(180deg); }
.dd-menu {
  position: absolute; top: calc(100% + 8px); left: 0; min-width: 116px; z-index: 40;
  background: var(--glass-bg); backdrop-filter: blur(20px) saturate(170%); -webkit-backdrop-filter: blur(20px) saturate(170%);
  border: 1px solid var(--glass-brd); border-radius: 14px; box-shadow: var(--shadow-glass-lg);
  padding: 5px; opacity: 0; transform: translateY(-6px) scale(.98); pointer-events: none;
  transition: opacity .22s var(--ease), transform .22s var(--ease);
}
.dd.open .dd-menu { opacity: 1; transform: none; pointer-events: auto; }
.dd-menu::before { content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; background: linear-gradient(150deg, var(--glass-hi), rgba(255,255,255,0) 42%); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none; }
.dd-item { padding: 8px 12px; border-radius: 10px; font-size: 13.5px; font-weight: 600; color: var(--text); cursor: pointer; transition: background .15s, color .15s; white-space: nowrap; }
.dd-item:hover { background: var(--primary-soft); }
.dd-item.active { background: var(--accent-grad); color: #fff; }

/* ---------- 页面容器 / 入场动画 ---------- */
.page { max-width: 960px; margin: 0 auto; padding: 30px 18px 80px; }
.page.wide { max-width: 1440px; }
[data-anim] { opacity: 0; transform: translateY(16px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
[data-anim].in { opacity: 1; transform: none; }

/* 登录卡"慢慢浮现"特调：比基础 [data-anim] 更慢、更立体。
   - 距离 16px → 32px（更明显的"上浮"）
   - 叠加 scale(0.96 → 1)，给一点"材质化"反馈
   - 时长 .6s → 1.4s，节奏更舒展；ease-out 与项目主约定一致
   - 仅动 opacity + transform，全 GPU 合成，不触发布局与重绘
   - 系统「减少动态效果」由上方 prefers-reduced-motion: reduce 通配兜底 */
.login-card[data-anim] {
  opacity: 0;
  transform: translateY(32px) scale(0.96);
  transition: opacity 1.4s cubic-bezier(.22, 1, .36, 1),
              transform 1.4s cubic-bezier(.22, 1, .36, 1);
}
.login-card[data-anim].in {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* 玻璃卡片（液态玻璃：顶部高光 rim + 强模糊 + 分层阴影） */
.card {
  position: relative;
  background: var(--glass-bg); backdrop-filter: blur(20px) saturate(170%);
  -webkit-backdrop-filter: blur(20px) saturate(170%);
  border: 1px solid var(--glass-brd); border-radius: var(--radius);
  box-shadow: var(--shadow-glass); padding: 26px;
  transition: transform .3s var(--ease), box-shadow .3s var(--ease);
}
.card::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px;
  background: linear-gradient(150deg, var(--glass-hi), rgba(255,255,255,0) 42%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-glass-lg); }
/* 账号管理页整卡不做 hover 浮动（提升特异性以覆盖全局 .card:hover） */
.page.wide .acct-card, .page.wide .acct-card:hover { transform: none; box-shadow: var(--shadow-glass); }
.card + .card { margin-top: 18px; }

/* 录入页：单人 / 批量 两个卡片 ——
   统一最小高度 + 按钮行 absolute 贴底，无论 src-note / emp-preview 内容长度如何，切换瞬间按钮行 Y 位置 / 卡片高度 0px 位移。 */
#singleCard, #batchCard {
  position: relative;
  display: flex; flex-direction: column;
  min-height: 480px;
  padding-bottom: 78px;  /* 给底部按钮预留空间，避免按钮覆盖 src-note / 字段 */
}
#singleCard > .btn-row, #batchCard > .btn-row {
  position: absolute;
  left: 18px; right: 18px; bottom: 18px;
  margin: 0;
}
[data-density="compact"] #singleCard,
[data-density="compact"] #batchCard { min-height: 420px; padding: 18px 18px 70px 18px; }
[data-density="compact"] #singleCard > .btn-row,
[data-density="compact"] #batchCard > .btn-row { left: 18px; right: 18px; bottom: 14px; }

/* 录入页：卡片底色改回白色（保持简洁描边、轻阴影；不浮不放大） */
body.app-shell .card {
  background: #ffffff;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  backdrop-filter: none; -webkit-backdrop-filter: none;
}
body.app-shell .card:hover { transform: none; box-shadow: var(--shadow-sm); }
/* 批量录入卡片：DOM 中前一个是单人卡片（同 .card）会命中 .card+.card 的 18px 上间距，
   而单人卡片前是分段条不命中 → 批量比单人低 18px。这里把它收到 8px，相对现状上移 10px。 */
#batchCard { margin-top: 0px; }

/* 卡片头部（图标 + 标题）—— flex-start + min-height 让 sub 行数不同也不撑高卡片头部，
   确保单人和批量两种卡片的"顶部位置"严格对齐到分段条下方同一基线 */
.card-hd { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 20px; min-height: 62px; }
.card-ic { width: 46px; height: 46px; flex: 0 0 46px; border-radius: 14px; background: linear-gradient(135deg, var(--primary), #7d92ff); display: flex; align-items: center; justify-content: center; font-size: 24px; line-height: 1; box-shadow: 0 8px 20px rgba(79,110,247,.32); }
.card-ic .ic-emoji { display: inline-flex; line-height: 1; transform: translateY(1px); }
.card-hd > div:not(.card-ic) { padding-top: 1px; }
.card-title { font-weight: 800; font-size: 18px; letter-spacing: .3px; line-height: 1.35; }
.card-hd .sub { color: var(--muted); font-size: 13px; margin: 4px 0 0; line-height: 1.55; }
.card-hd .hd-text { min-width: 0; }
.card-hd .hd-actions { margin-left: auto; flex: 0 0 auto; }
.av-chip { display: inline-flex; align-items: center; gap: 8px; }

/* 头像 */
.avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; background: var(--surface-2); box-shadow: 0 2px 8px rgba(28,40,74,.12); flex: 0 0 auto; vertical-align: middle; display: inline-block; }
.avatar-sm { width: 38px; height: 38px; }
.avatar-lg { width: 88px; height: 88px; box-shadow: 0 0 0 4px var(--surface), 0 6px 18px rgba(28,40,74,.16); }
.avatar-xs { width: 28px; height: 28px; box-shadow: none; }
.chip { font-size: 13px; padding: 7px 13px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); white-space: nowrap; display: inline-flex; align-items: center; gap: 8px; }
.chip .avatar { box-shadow: none; }

/* 表单头像预览 */
.av-row { display: flex; align-items: center; gap: 16px; margin: 4px 0 18px; }
.av-row-tip { color: var(--muted); font-size: 13px; line-height: 1.55; }

/* 可点击的头像选择器 */
.av-picker { position: relative; display: inline-block; cursor: pointer; border-radius: 50%; }
.av-picker input[type=file] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; z-index: 1; }
.av-picker .av-cam { position: absolute; right: -2px; bottom: -2px; width: 30px; height: 30px; border-radius: 50%; background: linear-gradient(135deg, var(--primary), var(--primary-d)); color: #fff; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 10px rgba(79,110,247,.4); pointer-events: none; opacity: 0; transform-origin: center center; transition: opacity .2s var(--ease); z-index: 2; }
.av-picker .av-cam svg { width: 16px; height: 16px; display: block; }
.av-picker:hover .av-cam, .av-picker:focus-within .av-cam { opacity: 1; }
.av-picker::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: rgba(0,0,0,.45); opacity: 0; transition: opacity .2s var(--ease); pointer-events: none; }
.av-picker:hover::after, .av-picker:focus-within::after { opacity: 1; }
.av-picker .av-cam-tip { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); color: #fff; font-size: 13px; font-weight: 700; opacity: 0; transition: opacity .2s var(--ease); pointer-events: none; z-index: 2; white-space: nowrap; }
.av-picker:hover .av-cam-tip, .av-picker:focus-within .av-cam-tip { opacity: 1; }
@media (max-width: 560px) {
  .card-hd { flex-wrap: wrap; }
  .card-hd .hd-actions { margin-left: 0; width: 100%; }
  .card-hd .hd-actions .btn { width: 100%; }
}

/* 双列网格（宽屏并排，窄屏堆叠） */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
@media (max-width: 620px) { .grid2 { grid-template-columns: 1fr; } }

/* 实时识别旁显（输入框下方） */
.recog { margin-top: 9px; font-size: 13.5px; display: none; align-items: center; gap: 7px; min-height: 0; }
.recog.show { display: flex; animation: pop .3s var(--ease); }
.recog .ric { font-weight: 800; display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; font-size: 12px; color: #fff; flex: 0 0 18px; }
.recog.ok { color: var(--ok); }
.recog.ok .ric { background: var(--ok); }
.recog.ok b { color: var(--text); }
.recog.bad { color: var(--danger); }
.recog.bad .ric { background: var(--danger); }

/* 数据来源说明 */
.src-note { margin-top: 20px; padding-top: 14px; border-top: 1px dashed var(--border); font-size: 12px; color: var(--muted); line-height: 1.6; }

/* ---------- 录入：分段控件 ---------- */
.seg { display: inline-flex; background: linear-gradient(135deg, rgba(79,110,247,.12), rgba(125,162,255,.10)); border: 1px solid #d6e2ff; border-radius: 14px; padding: 5px; gap: 4px; position: relative; box-shadow: inset 0 1px 0 rgba(255,255,255,.7); }
.seg button { border: none; background: transparent; padding: 10px 20px; border-radius: 10px; font-weight: 700; color: var(--muted); font-size: 14px; transition: color .2s, background .25s; position: relative; z-index: 2; }
.seg button:hover { color: var(--primary); }
.seg button.active { color: #fff; }
.seg .seg-ind { position: absolute; top: 5px; bottom: 5px; left: 0; border-radius: 10px; background: var(--accent-grad); box-shadow: 0 8px 20px rgba(79,110,247,.38); transition: transform .35s var(--ease); z-index: 1; }
/* 只 transform 参与过渡：width 由 JS 同步设置，立即生效，避免与 transform 并发动画造成指示器"位置偏移一下"的视觉错位。 */

/* 切换 tab 时卡片内容淡入（不做位移，避免切换瞬间"位置偏移一下"） */
@keyframes segSwapIn { from { opacity: 0; } to { opacity: 1; } }
.card.swap-in { animation: segSwapIn .28s var(--ease) both; }

/* btn 内联 svg 与文字水平垂直居中（解决 ■ / emoji 字符偏低问题） */
.btn > svg { flex: 0 0 auto; vertical-align: middle; margin-top: -1px; }

/* 表单 */
.field { margin-bottom: 16px; }
.field > label { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); margin-bottom: 8px; font-weight: 600; }

/* 登录输入框（统一设计语言） */
.login-input {
  width: 100%; padding: 15px 18px; font-size: 16px; font-weight: 600; letter-spacing: .4px;
  border: 1.5px solid var(--glass-brd);   border-radius: var(--radius-sm); background: rgba(255,255,255,.74);
  color: var(--text); outline: none; transition: border-color .18s, box-shadow .18s, background .18s;
  box-shadow: inset 0 1px 2px rgba(28,40,74,.05);
}
.login-input::placeholder { color: #9aa4b6; font-weight: 500; letter-spacing: 0; }
.login-input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(79,110,247,.16), inset 0 1px 2px rgba(28,40,74,.04); background: #fff; }

/* 密码框 + 小眼睛 */
.pwd-wrap { position: relative; }
.pwd-wrap .login-input { padding-right: 50px; }
.pwd-eye {
  position: absolute; top: 50%; right: 6px; transform: translateY(-50%);
  width: 36px; height: 36px; display: grid; place-items: center; border: none; background: transparent;
  cursor: pointer; border-radius: 10px; color: var(--muted); transition: background .18s, color .18s;
}
.pwd-eye:hover { background: var(--surface-2); color: var(--primary); }
.pwd-eye:active { transform: translateY(-50%) scale(.92); }
.pwd-eye svg { width: 20px; height: 20px; }
/* 默认显示「睁眼」(可见状态图标)，隐藏「闭眼」(不可见状态图标)：逻辑上默认密码隐藏，故默认显示睁眼提示可点开 */
.pwd-eye .eye-off { display: none; }
.pwd-eye.show .eye-open { display: none; }
.pwd-eye.show .eye-off { display: block; }
.input {
  width: 100%; padding: 16px 18px; font-size: 19px; font-weight: 700; letter-spacing: 1px;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm); background: #fff;
  color: var(--text); outline: none; transition: border-color .18s, box-shadow .18s, background .18s;
  box-shadow: inset 0 1px 2px rgba(28,40,74,.05);
}
.input::placeholder { color: #aab3c4; font-weight: 500; letter-spacing: 0; text-transform: none; }
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(79,110,247,.16), inset 0 1px 2px rgba(28,40,74,.04); background: #fff; }
.input.opt { font-size: 16px; font-weight: 600; background: var(--surface-2); }
textarea.input { font-size: 15px; font-weight: 600; letter-spacing: .5px; min-height: 150px; resize: vertical; line-height: 1.9; text-transform: none; }

/* 输入框右侧内嵌清空按钮（有内容时显示） */
.input-wrap { position: relative; }
.input-wrap > .input { padding-right: 44px; }
.input-clear { position: absolute; top: 50%; right: 8px; transform: translateY(-50%); width: 22px; height: 22px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer; display: flex; align-items: center; justify-content: center; opacity: 0; pointer-events: none; transition: opacity .15s var(--ease), background .15s, color .15s; }
.input-clear svg { width: 11px; height: 11px; display: block; overflow: visible; }
.input-clear svg path { stroke: currentColor; stroke-width: 2; stroke-linecap: round; fill: none; }
.input-wrap > .input:not(:placeholder-shown) ~ .input-clear { opacity: 1; pointer-events: auto; }
.input-clear:hover { background: var(--danger-soft); color: var(--danger); }
.input-clear:active { transform: translateY(-50%) scale(.9); }

/* 输入框错误反馈：变红边框 + 抖动抖动提醒（工号清单空集时使用） */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  15%, 55% { transform: translateX(-7px); }
  35%, 75% { transform: translateX(7px); }
}
.input.is-error {
  border-color: var(--danger) !important;
  background: var(--danger-soft) !important;
  box-shadow: 0 0 0 4px rgba(239,68,68,.18), inset 0 1px 2px rgba(28,40,74,.04) !important;
  animation: shake .42s var(--ease);
}

/* 表单下拉（账号管理页） */
.sel {
  width: 100%; padding: 14px 16px; font-size: 15px; font-weight: 600; font-family: inherit;
  border: 1.5px solid var(--glass-brd); border-radius: var(--radius-sm); background: rgba(255,255,255,.74) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236b7686' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 16px center;
  color: var(--text); outline: none; cursor: pointer; transition: border-color .18s, box-shadow .18s;
  -webkit-appearance: none; appearance: none;
}
.sel:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(79,110,247,.16); }
.lbl { display: block; font-size: 13px; color: var(--muted); font-weight: 600; margin: 14px 0 8px; }

.btn-row { display: flex; gap: 12px; margin-top: 6px; }
.btn-row .btn { flex: 1; }

/* 实时解析 chips */
.parse-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; min-height: 4px; }
.pchip { display: flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 12px; background: var(--primary-soft); border: 1px solid #d6e2ff; font-size: 14px; animation: pop .35s var(--ease); }
.pchip .k { color: var(--muted); font-size: 12px; }
.pchip .v { font-weight: 700; }
.pchip.ok { background: var(--ok-soft); border-color: #bfe9cd; }
.pchip.warn { background: var(--warn-soft); border-color: #f6dca6; }
@keyframes pop { from { transform: scale(.85); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* 切换开关 */
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; font-size: 14px; color: var(--muted); font-weight: 600; }
.switch .track { width: 46px; height: 26px; border-radius: 999px; background: #d7dde8; position: relative; transition: background .25s; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.2); transition: transform .28s var(--ease); }
.switch.on .track { background: var(--primary); }
.switch.on .track::after { transform: translateX(20px); }

/* 时间选择器 */
input[type="datetime-local"] { font-family: inherit; }
.dtpicker { width: 100%; padding: 14px 16px; font-size: 16px; font-weight: 600; border: 1.5px solid var(--glass-brd); border-radius: var(--radius-sm); background: rgba(255,255,255,.6); color: var(--text); outline: none; transition: border-color .18s, box-shadow .18s; box-shadow: inset 0 1px 2px rgba(28,40,74,.05); }
.dtpicker:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(79,110,247,.15); }

/* ---------- 弹层 / 模态 ---------- */
.wb-overlay {
  position: fixed; inset: 0; z-index: 60; display: none; place-items: center; padding: 20px;
  background: rgba(18, 26, 44, .5); backdrop-filter: blur(6px); opacity: 0; transition: opacity .26s var(--ease);
}
.wb-overlay.show { display: grid; opacity: 1; }
/* 弹窗自适应：宽 / 高 / 内边距 / 字号 / 输入框 padding 全部基于视口计算（避免低矮窗口出滚动条） */
.wb-modal {
  width: 100%; max-width: min(560px, 94vw); position: relative; background: var(--glass-bg);
  backdrop-filter: blur(26px) saturate(180%); -webkit-backdrop-filter: blur(26px) saturate(180%);
  border: 1px solid var(--glass-brd); border-radius: 24px;
  /* 自适应内边距：窗口越矮，上内边距越小；高度从 28 到 14 */
  padding: clamp(16px, 3.6vh, 32px) clamp(18px, 3.2vw, 32px);
  /* 内容区最大高度 = 视口高度 - 80px（顶部间距 + 底部间距），完全避免浏览器滚动条 */
  max-height: calc(100vh - 40px); overflow-y: auto; box-sizing: border-box;
  box-shadow: var(--shadow-glass-lg); text-align: center; transform: translateY(14px) scale(.94); opacity: 0;
  transition: transform .32s var(--ease), opacity .32s var(--ease);
}
.wb-modal::before { content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; background: linear-gradient(150deg, var(--glass-hi), rgba(255,255,255,0) 42%); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none; }
.wb-overlay.show .wb-modal { transform: none; opacity: 1; }
.wb-modal-lg { max-width: min(700px, 96vw); }   /* 工号清单弹窗 / 编辑弹窗用更大的尺寸 */
.wb-modal-account { max-width: min(640px, 95vw); }  /* 账号编辑专款 */
.wb-modal h2 { margin: 0 0 6px; font-size: clamp(18px, 2.4vh, 22px); display: flex; align-items: center; justify-content: center; gap: 9px; }
.wb-modal .sub { color: var(--muted); font-size: clamp(12.5px, 1.5vh, 14px); margin-bottom: clamp(10px, 1.8vh, 18px); line-height: 1.6; }
/* 弹窗内表单元素也跟随视口自适应（输入框 padding / 字号 / 按钮大小） */
.wb-modal .lbl { display: block; font-size: clamp(12px, 1.5vh, 13px); color: var(--muted); font-weight: 600; margin: clamp(10px, 1.4vh, 14px) 0 clamp(6px, .8vh, 8px); text-align: left; }
.wb-modal .input { padding: clamp(10px, 1.4vh, 16px) clamp(12px, 1.6vw, 18px); font-size: clamp(13px, 1.8vh, 19px); }
.wb-modal .login-input { padding: clamp(10px, 1.4vh, 15px) clamp(12px, 1.6vw, 18px); font-size: clamp(13px, 1.8vh, 16px); }
.wb-modal .btn { padding: clamp(8px, 1.2vh, 13px) clamp(14px, 1.6vw, 22px); font-size: clamp(12px, 1.6vh, 15px); }
.wb-modal .btn.lg { padding: clamp(12px, 1.6vh, 16px) clamp(18px, 2vw, 28px); font-size: clamp(14px, 1.8vh, 17px); }
.wb-modal textarea.input { min-height: clamp(100px, 14vh, 150px); font-size: clamp(13px, 1.7vh, 15px); }
.wb-modal .sel { padding: clamp(10px, 1.4vh, 14px) clamp(12px, 1.6vw, 16px); font-size: clamp(13px, 1.8vh, 15px); }
.wb-modal .actions { display: flex; gap: clamp(8px, 1vw, 12px); justify-content: center; margin-top: clamp(12px, 1.8vh, 18px); flex-wrap: wrap; }
.wb-modal .actions .btn { flex: 1; min-width: 120px; }
.wb-modal .err-msg { color: var(--danger); font-size: clamp(12.5px, 1.6vh, 14px); margin: clamp(8px, 1.2vh, 10px) 0; line-height: 1.6; }
.wb-modal .ok-msg { color: var(--ok); font-size: clamp(12.5px, 1.6vh, 14px); margin: clamp(8px, 1.2vh, 10px) 0; line-height: 1.6; }
/* 头像预览行也自适应 */
.wb-modal .av-row { margin: clamp(6px, 1vh, 18px) 0 clamp(10px, 1.6vh, 18px); }
.wb-modal .avatar-lg { width: clamp(60px, 9vh, 88px); height: clamp(60px, 9vh, 88px); }
/* 开关 */
.wb-modal .switch .track { width: clamp(36px, 5vh, 46px); height: clamp(20px, 2.8vh, 26px); }
.wb-modal .switch .track::after { width: clamp(16px, 2.2vh, 20px); height: clamp(16px, 2.2vh, 20px); }
.wb-modal .switch.on .track::after { transform: translateX(clamp(16px, 2.2vh, 20px)); }

/* ===== 批量：工号清单弹窗 + 卡片预览 ===== */
.emp-preview { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 8px; }
.emp-empty { width: 100%; font-size: 13px; color: var(--muted); background: var(--surface-2); border: 1px dashed var(--border); border-radius: 12px; padding: 14px 16px; line-height: 1.5; }
.emp-chip { position: relative; display: inline-flex; align-items: center; gap: 7px; padding: 7px 28px 7px 12px; border-radius: 11px; background: #fff; border: 1px solid var(--border); font-size: 13.5px; box-shadow: var(--shadow-sm); animation: pop .3s var(--ease); transition: border-color .15s var(--ease), box-shadow .15s var(--ease); }
.emp-chip:hover { border-color: var(--primary); box-shadow: var(--shadow-md); }
.emp-chip b { letter-spacing: .4px; color: var(--text); }
.emp-chip-name { color: var(--muted); font-size: 12.5px; }
/* 右上角删除按钮：默认透明，hover/focus-within chip 时显示 */
.emp-chip-x { position: absolute; top: 50%; right: 4px; transform: translateY(-50%); width: 18px; height: 18px; padding: 0; border: 0; border-radius: 50%; background: var(--danger-soft); color: var(--danger); display: flex; align-items: center; justify-content: center; cursor: pointer; opacity: 0; transition: opacity .15s var(--ease), transform .15s var(--ease), background .15s; }
.emp-chip-x svg { width: 10px; height: 10px; display: block; overflow: visible; }
.emp-chip-x svg path { stroke: currentColor; stroke-width: 2; stroke-linecap: round; fill: none; }
.emp-chip:hover .emp-chip-x, .emp-chip:focus-within .emp-chip-x { opacity: 1; }
.emp-chip-x:hover { background: var(--danger); color: #fff; transform: translateY(-50%) scale(1.1); }
.emp-chip-x:active { transform: translateY(-50%) scale(.92); }
/* 触屏默认半显，避免无 hover 时找不到 */
@media (pointer: coarse) { .emp-chip-x { opacity: .55; } .emp-chip-x:hover { opacity: 1; } }

/* 弹窗内 */
.emp-modal { text-align: left; }
.emp-modal-hd { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.emp-modal-hd h2 { margin: 0; font-size: 20px; justify-content: flex-start; }
.emp-modal-x { width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); color: var(--muted); font-size: 20px; line-height: 1; cursor: pointer; transition: background .18s, color .18s, border-color .18s; }
.emp-modal-x:hover { background: var(--danger-soft); color: var(--danger); border-color: rgba(239,68,68,.3); }
.emp-modal-tip { color: var(--muted); font-size: 13px; margin: 0 0 14px; line-height: 1.6; }
.emp-list { max-height: 44vh; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 4px; margin: 0 -4px 4px; scrollbar-width: thin; }
.emp-list::-webkit-scrollbar { width: 6px; }
.emp-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 6px; }
.emp-row { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 12px; background: #fff; border: 1px solid var(--border); animation: pop .28s var(--ease); }
.emp-idx { width: 24px; height: 24px; flex: 0 0 24px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); font-size: 12.5px; font-weight: 800; display: grid; place-items: center; }
.emp-id { font-weight: 800; letter-spacing: .4px; font-size: 15px; }
.emp-name { color: var(--muted); font-size: 13.5px; flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.emp-del { width: 28px; height: 28px; flex: 0 0 28px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface-2); color: var(--muted); font-size: 17px; line-height: 1; cursor: pointer; transition: background .18s, color .18s, border-color .18s; }
.emp-del:hover { background: var(--danger-soft); color: var(--danger); border-color: rgba(239,68,68,.35); }
.emp-input-row { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.emp-input-dot { width: 30px; height: 30px; flex: 0 0 30px; border-radius: 9px; background: var(--primary-soft); color: var(--primary); font-size: 18px; font-weight: 800; display: grid; place-items: center; }
.emp-input-row .input { flex: 1 1 auto; }
.emp-modal-ft { display: flex; align-items: center; gap: 12px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--glass-brd); }
.emp-modal-ft .emp-count { font-size: 13px; color: var(--muted); }
.emp-modal-ft .spacer { flex: 1 1 auto; }
.emp-modal-ft .btn { flex: 0 0 auto; min-width: 96px; }

/* 成功打勾动画 */
.check-wrap { width: 76px; height: 76px; margin: 6px auto 14px; border-radius: 50%; background: var(--ok-soft); display: grid; place-items: center; animation: pop .4s var(--ease); }
.check-wrap svg { width: 42px; height: 42px; }
.check-wrap .path { stroke: var(--ok); stroke-width: 5; fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 48; stroke-dashoffset: 48; animation: draw .5s .15s var(--ease) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }

/* 异常态警示 ⚠ 圆 */
.check-wrap.has-warn { background: var(--warn-soft); box-shadow: 0 0 0 4px rgba(255,159,28,.12); }
.check-wrap.has-warn .path { fill: none; stroke: var(--warn); stroke-width: 4; stroke-linejoin: round; stroke-dasharray: 0; stroke-dashoffset: 0; animation: none; }
.check-wrap.has-warn .bang { fill: none; stroke: var(--warn); stroke-width: 5; stroke-linecap: round; stroke-dasharray: 14; stroke-dashoffset: 14; animation: draw .35s .2s var(--ease) forwards; }
.check-wrap.has-warn .dot  { fill: var(--warn); opacity: 0; animation: fade .2s .45s var(--ease) forwards; }
@keyframes fade { to { opacity: 1; } }

/* 异常态弹窗头部：标题 + 副标题 */
.batch-head-warn { color: var(--warn); }
/* h2 同级紧挨的副标题 */
.detail-box + .head-warn,
.batch-warn-head { display: block; color: var(--warn); font-size: 13px; font-weight: 600; margin: -6px 0 14px; padding: 8px 12px; background: var(--warn-soft); border-radius: 10px; letter-spacing: .2px; }
/* 标题紧下方副标题（与 h2 同列、无前置兄弟） */
.modal-box > h2 + .head-warn { display: inline-block; margin-top: -4px; margin-bottom: 14px; }

/* 警告图标 */
.warn-ico { width: 64px; height: 64px; margin: 0 auto 12px; border-radius: 50%; background: var(--warn-soft); display: grid; place-items: center; font-size: 34px; animation: pop .4s var(--ease); }
.warn-ico svg { width: 38px; height: 38px; display: block; }
.block-ico { width: 64px; height: 64px; margin: 0 auto 12px; border-radius: 50%; background: var(--danger-soft); display: grid; place-items: center; font-size: 32px; animation: pop .4s var(--ease); }
.block-ico svg { width: 38px; height: 38px; display: block; }

/* 切换账号：本机已登录账号列表 */
.sw-list { display: flex; flex-direction: column; gap: 8px; max-height: 46vh; overflow-y: auto; margin: 2px 0 4px; }
.sw-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface-2); cursor: pointer; transition: background .18s var(--ease), border-color .18s var(--ease), transform .12s var(--ease); }
.sw-item:hover { background: var(--primary-soft); border-color: var(--primary); transform: translateY(-1px); }
.sw-item.is-cur { opacity: .72; cursor: default; }
.sw-item.is-cur:hover { transform: none; background: var(--surface-2); border-color: var(--border); }
.sw-av { width: 42px; height: 42px; border-radius: 50%; flex: 0 0 auto; object-fit: cover; background: var(--surface-3, #eef1f6); }
.sw-info { flex: 1 1 auto; min-width: 0; text-align: left; }
.sw-name { font-size: 15px; font-weight: 600; color: var(--text, #1c2433); display: flex; align-items: center; gap: 7px; }
.sw-user { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.sw-right { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.sw-x { width: 24px; height: 24px; border: none; background: transparent; color: var(--muted); font-size: 18px; line-height: 1; border-radius: 50%; cursor: pointer; transition: background .15s, color .15s; }
.sw-x:hover { background: var(--danger-soft); color: var(--danger); }
.sw-pwd { flex-basis: 100%; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border); }
.sw-pwd .pwd-wrap { margin-bottom: 8px; }
.sw-pwd-actions { display: flex; gap: 8px; }
.sw-pwd-actions .btn { flex: 1; min-width: 0; }

/* 登录页：记住密码 / 记住登录状态 勾选 */
.login-checks { display: flex; flex-direction: column; gap: 9px; margin: 14px 0 4px; text-align: left; }
.ck { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--muted); cursor: pointer; user-select: none; }
.ck input { width: 17px; height: 17px; accent-color: var(--primary, #4f6ef7); cursor: pointer; }

/* 登录页：账号输入下拉选择 */
.acct-dd-wrap { position: relative; }
.acct-dd-wrap .login-input { padding-right: 46px; }
/* 账号框右侧的下拉三角按钮（仅此按钮展开历史账号列表） */
.acct-toggle {
  position: absolute; top: 50%; right: 6px; transform: translateY(-50%);
  width: 34px; height: 34px; display: flex; align-items: center; justify-content: center;
  border: none; background: transparent; color: var(--muted, #6b7393); cursor: pointer; border-radius: 8px;
  transition: background .15s, color .15s;
}
.acct-toggle:hover { background: var(--surface-2, #f1f4fb); color: var(--primary); }
.acct-toggle:active { transform: translateY(-50%) scale(.92); }
.acct-toggle svg { width: 18px; height: 18px; transition: transform .18s ease; }
.acct-toggle.open { color: var(--primary); }
.acct-toggle.open svg { transform: rotate(180deg); }
.acct-dd {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 50;
  background: rgba(255, 255, 255, 0.96); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 16px 40px rgba(28, 40, 74, 0.18), 0 2px 6px rgba(28, 40, 74, 0.08);
  padding: 6px; max-height: 280px; overflow-y: auto; overscroll-behavior: contain;
  animation: dd-pop .18s var(--ease, cubic-bezier(.2,.8,.2,1));
}
@keyframes dd-pop { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }
.acct-dd:empty { display: none; }
.acct-dd[hidden] { display: none; }
.acct-item {
  display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 9px;
  cursor: pointer; transition: background .12s ease;
}
.acct-item:hover, .acct-item.active { background: var(--surface-2, #f1f4fb); }
.acct-item-av { width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0; background: var(--primary-soft, #e6edff); object-fit: cover; }
.acct-item-info { flex: 1; min-width: 0; line-height: 1.25; }
.acct-item-name { font-size: 14px; font-weight: 600; color: var(--text, #1c284a); display: flex; align-items: center; gap: 6px; }
.acct-item-user { font-size: 12px; color: var(--muted, #6b7393); margin-top: 2px; }
.acct-cur { font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 999px; background: linear-gradient(135deg, #fff5d6, #f0c25a); color: #6b3f0a; border: 1px solid rgba(176, 110, 24, .4); letter-spacing: .3px; }
.acct-item-right { flex-shrink: 0; display: flex; align-items: center; }
.acct-lock { color: #1f9d57; display: inline-flex; }
.acct-lock svg { width: 16px; height: 16px; }
.acct-nopwd { font-size: 11px; color: var(--muted, #6b7393); padding: 2px 8px; border-radius: 999px; background: rgba(0,0,0,.04); }
.acct-empty { padding: 18px; text-align: center; color: var(--muted, #6b7393); font-size: 13px; }

/* 信息行（进行中任务详情） */
.detail-box { background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px; padding: 16px; text-align: left; margin: 6px 0 4px; }
.detail-box .row { display: flex; justify-content: space-between; padding: 7px 0; font-size: 14px; border-bottom: 1px dashed var(--border); }
.detail-box .row:last-child { border-bottom: none; }
.detail-box .row .k { color: var(--muted); }
.detail-box .row .v { font-weight: 700; }
.detail-box .row .v.big { font-size: 17px; color: var(--primary-d); }

/* 批量结果异常明细：嵌入统计行内，点击行直接展开 */
.batch-row { }
.batch-row:last-of-type summary { border-bottom: none; }
.batch-row > summary { list-style: none; display: flex; justify-content: space-between; padding: 7px 0; font-size: 14px; cursor: pointer; user-select: none; border-bottom: 1px dashed var(--border); transition: background .15s; }
.batch-row > summary::-webkit-details-marker { display: none; }
.batch-row > summary:hover { background: var(--surface-2); }
.batch-row > summary .k { color: var(--muted); }
.batch-row > summary .v { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; }
.batch-row > summary .count.warn { color: var(--warn); }
.batch-row > summary .count.err  { color: var(--danger); }
.batch-row > summary .caret { display: inline-block; color: var(--muted); font-size: 11px; transition: transform .2s var(--ease); }
.batch-row[open] > summary .caret { transform: rotate(180deg); }
.batch-row .batch-detail { margin: 4px 0 8px; padding: 4px 10px 8px; background: var(--surface-2); border-radius: 10px; border: 1px dashed var(--border); max-height: 220px; overflow-y: auto; }
.batch-row .batch-detail .row { display: flex; justify-content: space-between; align-items: baseline; padding: 5px 0; font-size: 13px; gap: 12px; border-bottom: 1px dashed var(--border); }
.batch-row .batch-detail .row:last-of-type { border-bottom: none; }
.batch-row .batch-detail .row .k { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .2px; flex-shrink: 0; }
.batch-row .batch-detail .row .v { color: var(--danger); font-weight: 600; text-align: right; }
.batch-row .batch-detail .row .v.muted { color: var(--muted); font-weight: 500; }
.batch-row .batch-detail .overflow { text-align: center; padding: 6px 0 2px; color: var(--muted); font-size: 12px; }
/* 明细行：工号 + 姓名 stacked 在左列 */
.batch-row .batch-detail .row .k { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex-shrink: 0; }
.batch-row .batch-detail .row .emp-no { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .2px; }
.batch-row .batch-detail .row .emp-name { font-size: 12px; color: var(--muted); font-weight: 500; }

/* 结束选项大按钮 */
.opt-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 8px 0 4px; }
.opt-card { border: 1.5px solid var(--border); border-radius: 16px; padding: 20px 14px; background: var(--surface-solid); text-align: center; cursor: pointer; transition: transform .18s var(--ease), border-color .18s, box-shadow .18s, background .18s; }
.opt-card:hover { transform: translateY(-3px); border-color: var(--primary); box-shadow: var(--shadow-sm); background: var(--primary-soft); }
.opt-card .ic { font-size: 30px; margin-bottom: 8px; }
.opt-card .t { font-weight: 800; font-size: 16px; }
.opt-card .d { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* Toast */
.wb-toast {
  position: fixed; left: 50%; bottom: 34px; transform: translateX(-50%) translateY(20px);
  background: #1b2330; color: #fff; padding: 13px 24px; border-radius: 13px; font-size: 14px; font-weight: 600;
  opacity: 0; transition: .28s var(--ease); z-index: 80; pointer-events: none; box-shadow: var(--shadow-pop); max-width: 90vw;
}
.wb-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.wb-toast.ok { background: #128a3e; }
.wb-toast.warn { background: #c77f12; }
.wb-toast.error { background: #d83a3a; }

/* ---------- 登录 ---------- */
.login-wrap { min-height: 100vh; display: flex; flex-direction: column; padding: 0 20px 24px; }
.login-head { padding: 16px 4px; }
.login-main { flex: 1; display: grid; place-items: center; width: 100%; }
.login-card { position: relative; width: 100%; max-width: 420px; background: var(--glass-bg); backdrop-filter: blur(24px) saturate(180%); -webkit-backdrop-filter: blur(24px) saturate(180%); border: 1px solid var(--glass-brd); border-radius: 26px; box-shadow: var(--shadow-glass-lg); padding: 40px 26px 40px 26px; }
.login-card::before { content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; background: linear-gradient(150deg, var(--glass-hi), rgba(255,255,255,0) 42%); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none; }
.brand { display: flex; flex-direction: column; align-items: center; gap: 16px; margin-bottom: 26px; text-align: center; }
.brand h1 { font-size: 22px; margin: 0; letter-spacing: .4px; white-space: nowrap; }
.brand > div { min-width: 0; }
.brand p { margin: 4px 0 0; font-size: 13.5px; color: var(--muted); }
.login-card .btn { width: 100%; padding: 15px; font-size: 16px; margin-top: 8px; }
@media (max-width: 480px) {
  .brand { gap: 12px; }
  .brand h1 { font-size: 18px; }
  .brand p { font-size: 11.5px; }
}

.hint { font-size: 12px; color: var(--muted); margin-top: 16px; text-align: center; line-height: 1.7; }
.err { color: var(--danger); font-size: 13px; margin-top: 10px; min-height: 18px; text-align: center; font-weight: 600; }
.pwd-meter { margin-top: 8px; }
.pwd-meter-bar { height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; border: 1px solid var(--border); }
.pwd-meter-bar span { display: block; height: 100%; width: 0; border-radius: 999px; transition: width .2s, background .2s; }
.pwd-meter-bar span.lv1 { width: 20%; background: var(--danger); }
.pwd-meter-bar span.lv2 { width: 36%; background: #e8833a; }
.pwd-meter-bar span.lv3 { width: 52%; background: #d9a441; }
.pwd-meter-bar span.lv4 { width: 72%; background: #4aa36b; }
.pwd-meter-bar span.lv5 { width: 88%; background: var(--ok); }
.pwd-meter-bar span.lv6 { width: 100%; background: var(--ok); }
.pwd-hint { font-size: 11.5px; color: var(--muted); margin-top: 4px; }

/* ---------- 看板 ---------- */
.summary { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
/* ===== 看板 · 主题区顶部筛选卡（方案 D） ===== */
/* 方案 B：看板左侧筛选侧栏（始终可见）+ 右侧主区（内部滚动） */
.page.wide.board-layout { display: flex; gap: 16px; align-items: stretch; min-height: 0; overflow: hidden; padding-bottom: 0; }
.board-aside { align-self: stretch; }
.board-main  { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 18px; overflow-y: auto; padding-right: 2px; }
.board-aside {
  position: relative; flex: 0 0 210px;
  /* 撑到接近视口底部：不依赖 body.app-shell，用 min-height 直接钉（留 160px 缓冲，避免空旷） */
  min-height: calc(100vh - 160px);
  background: var(--glass-bg-2); backdrop-filter: blur(18px) saturate(170%);
  -webkit-backdrop-filter: blur(18px) saturate(170%);
  border: 1px solid var(--glass-brd); border-radius: var(--radius);
  /* 玻璃阴影按需求取消：仅保留 1px 极淡底边线提示层级，不浮起卡片 */
  box-shadow: inset 0 -1px 0 rgba(28,40,74,.06);
  padding: 16px 14px; box-sizing: border-box;
  display: flex; flex-direction: column; gap: 16px;
  /* 内部不出现滚动条：内容少，居中或自然铺，若超出由整体页面级溢出处理 */
  overflow: hidden;
}
.board-aside::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px;
  background: linear-gradient(150deg, var(--glass-hi), rgba(255,255,255,0) 42%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none;
}
.ba-hd { display: flex; align-items: center; gap: 8px; }
.ba-hd .bf-ic {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 7px;
  background: var(--primary-soft); color: var(--primary);
}
.ba-hd-t { font-weight: 700; font-size: 14px; color: var(--text); }
.ba-fld { display: flex; flex-direction: column; gap: 7px; }
.ba-lbl { font-size: 12px; color: var(--muted); font-weight: 600; }
.ba-search.topbar-search {
  width: 100%; height: 38px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px;
  padding: 0 12px; box-sizing: border-box;
}
.ba-search.topbar-search .ts-input { width: 100%; min-width: 0; }
.ba-cat-list { display: flex; flex-direction: column; gap: 5px; }
.ba-cat-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 12px; border-radius: 9px; cursor: pointer;
  font-size: 14px; color: var(--text);
  border: 1px solid var(--border); background: var(--surface-2);
  transition: background .15s, border-color .15s, color .15s;
  user-select: none;
}
.ba-cat-item:hover { border-color: var(--primary); background: var(--primary-soft); }
.ba-cat-item.active { background: var(--primary-soft); color: var(--primary); border-color: var(--primary); font-weight: 700; }
.ba-meta { margin-top: auto; display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.bf-live { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--text); }
.bf-live-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--ok);
  box-shadow: 0 0 0 0 rgba(63,192,140,.6);
  animation: bf-pulse 2s infinite;
}
@keyframes bf-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(63,192,140,.55); }
  70%  { box-shadow: 0 0 0 8px rgba(63,192,140,0); }
  100% { box-shadow: 0 0 0 0 rgba(63,192,140,0); }
}
@media (max-width: 960px) {
  .page.wide.board-layout { flex-direction: column; min-height: 0; overflow: auto; height: auto; }
  .board-aside { align-self: stretch; flex: 0 0 auto; }
  .ba-cat-list { flex-direction: row; flex-wrap: wrap; }
  .ba-cat-item { flex: 0 0 auto; }
}
/* 平板 / 窄屏（768–1024）：侧栏收窄、表格横向滚动、tab 间距收紧 */
@media (max-width: 1024px) {
  .board-aside { flex: 0 0 184px; min-height: calc(100vh - 130px); }
  .page.wide.board-layout .table-card { overflow-x: auto; }
  .page.wide.board-layout .table-card table.compact { min-width: 760px; }
  .topbar #topnav { gap: 7px; }
  .topbar #topnav .btn { padding: 8px 12px; font-size: 12.5px; }
}
@media (max-width: 880px) {
  .topbar { flex-wrap: wrap; row-gap: 8px; }
  .topbar #topnav { gap: 6px; }
  .topbar #topnav .btn { padding: 7px 10px; font-size: 12px; }
  .summary .card { min-width: 130px; padding: 14px 16px; }
  .summary .card .n { font-size: 24px; }
}
/* ===== 看板：整页 flex 列填满视口（取消外部浏览器滚轮），body 100vh 不出滚动条 ===== */
body.board-page { height: 100vh; display: flex; flex-direction: column; overflow: hidden; }
body.board-page > .topbar { flex: 0 0 auto; }
body.board-page > .page.wide.board-layout {
  flex: 1 1 auto; min-height: 0;
  width: 100%; max-width: none;
  padding: 16px 18px 18px;
  box-sizing: border-box;
}
/* 右侧主区不再由 board-main 自身滚动，改为 table-card 内部滚 + 分页 */
.board-page .board-main { overflow: hidden; padding-right: 2px; }
.board-page .board-main .summary { flex: 0 0 auto; }
.board-page .board-main .table-card {
  flex: 1 1 auto; min-height: 0;
  display: flex; flex-direction: column;
}
.board-page .board-main .table-card .tbl-wrap {
  flex: 1 1 auto; min-height: 0; max-height: none;
  overflow-y: auto;
  border-radius: 0 0 var(--radius) var(--radius);
}
.board-page .board-main .table-card table.compact { min-width: 760px; }
.board-page .board-main .table-card thead th {
  position: sticky; top: 0; z-index: 2;
  background: var(--surface-solid);
  box-shadow: inset 0 -1px 0 var(--border);
}
.board-page .board-main .table-card .empty { flex: 0 0 auto; }
.board-page .board-main .table-card .pager { border-top: 1px solid var(--border); margin-top: 0; }
.summary .card { flex: 1; min-width: 150px; padding: 18px 20px; }
.summary .card .n { font-size: 30px; font-weight: 800; letter-spacing: .5px; }
.summary .card .l { font-size: 13px; color: var(--muted); margin-top: 3px; }
.table-card { position: relative; background: var(--glass-bg-2); backdrop-filter: blur(18px) saturate(170%); -webkit-backdrop-filter: blur(18px) saturate(170%); border: 1px solid var(--glass-brd); border-radius: var(--radius); box-shadow: var(--shadow-glass); overflow: hidden; }
/* 看板主区弱化阴影：summary 三卡 + 在岗明细长表仅留极淡底边线提示层级，悬浮玻璃感去掉
   限定 .page.wide.board-layout 作用域，避免误伤登录/录入等其他页的 .card 玻璃阴影 */
.page.wide.board-layout .summary .card,
.page.wide.board-layout .table-card {
  box-shadow: inset 0 -1px 0 rgba(28,40,74,.06);
}
/* 看板"结束"按钮：收紧垂直尺寸（padding 减半 + line-height 1.2），
   让有按钮的行高与"无按钮（—）"的行高一致；只作用于看板作用域，不影响其他页 .btn.sm */
.board-page .board-main .table-card td { padding-top: 13px; padding-bottom: 13px; line-height: 1.5; }
.board-page .board-main .table-card .btn.danger.sm {
  padding: 5px 12px;
  font-size: 12px;
  line-height: 1.2;
  border-radius: 7px;
  box-shadow: 0 3px 8px rgba(239,68,68,.22), inset 0 1px 0 rgba(255,255,255,.3);
}
/* "—"占位与结束按钮同高，保证无按钮行高与有按钮行一致 */
.board-page .board-main .table-card td .op-none {
  display: inline-flex; align-items: center; min-height: 24px;
}

/* 看板远程结束后的撤销浮层 */
.undo-bar {
  position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 16px);
  display: flex; align-items: center; gap: 14px;
  background: var(--glass-bg-2); backdrop-filter: blur(18px) saturate(170%);
  -webkit-backdrop-filter: blur(18px) saturate(170%);
  border: 1px solid var(--glass-brd); border-radius: 14px;
  padding: 12px 16px 12px 18px; box-shadow: 0 18px 40px rgba(8,16,40,.28);
  z-index: 80; opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s;
  color: var(--text); font-size: 13.5px; font-weight: 600;
}
.undo-bar.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.undo-bar .undo-bar-txt { white-space: nowrap; }
.undo-bar .btn { padding: 6px 14px; font-size: 12.5px; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 14px 16px; text-align: left; font-size: 14px; border-bottom: 1px solid var(--border); }
th { background: var(--surface-2); color: var(--muted); font-weight: 700; font-size: 12.5px; letter-spacing: .3px; }
tbody tr { transition: background .2s; }
tbody tr:hover { background: #f7f9fe; }
#rows tr, #rows tr:hover { background: transparent; transition: none; }
tr.lv-orange td { background: #fff8ec; }
tr.lv-red td { background: #fff1f1; }
tr.lv-critical td { background: #ffe3e3; }
/* 维护页：已停用行弱化显示，突出“启用”按钮 */
.row-disabled td { background: #fff5f5; }
.row-disabled .btn.ok { font-weight: 800; }
.pill { font-size: 12px; padding: 4px 11px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); }
.pill.cat { background: var(--primary-soft); border-color: #cfe0ff; color: var(--primary-d); }
/* 管理员徽章：香槟金渐变（非俗气亮黄）—深棕字 + 金边 + 微高光 */
.pill.admin {
  background: linear-gradient(135deg, #fff5d6 0%, #f0c25a 48%, #c98a2a 100%);
  border: 1px solid rgba(176, 110, 24, .55);
  color: #4a2e0a;
  font-weight: 700;
  letter-spacing: .4px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .65), 0 1px 2px rgba(176, 110, 24, .18);
  text-shadow: 0 1px 0 rgba(255, 255, 255, .35);
}
/* 只读徽章：低饱和蓝灰（避免被误认为可点） */
.pill.viewer {
  background: rgba(91, 141, 239, .10);
  border-color: rgba(91, 141, 239, .30);
  color: #3a6fc9;
  font-weight: 600;
}
.dur-cell b { color: var(--text); font-variant-numeric: tabular-nums; }
.empty { padding: 54px; text-align: center; color: var(--muted); font-size: 15px; }

/* 分页控件（数据维护页 / 历史页 / 审计页 / 账号页通用，替代内置滚动条）
   关键：min-height 60px = pg-btn(34) + padding-top(16) + padding-bottom(6) + 余量
   确保 pager 在 innerHTML 为空时也占稳高度，让 pageSize 算得准 */
.pager { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px; padding: 16px 4px 6px; flex-shrink: 0; border-top: 1px solid var(--border); margin-top: 6px; min-height: 60px; box-sizing: border-box; }
.pager .pg-info { font-size: 13px; color: var(--muted); margin-right: 6px; white-space: nowrap; }
.pager .pg-btn { min-width: 34px; height: 34px; padding: 0 10px; border-radius: 9px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font-weight: 700; font-size: 13px; cursor: pointer; transition: background .15s, color .15s, border-color .15s, box-shadow .15s; }
.pager .pg-btn:hover:not([disabled]) { border-color: var(--primary); color: var(--primary); background: var(--surface-solid); box-shadow: 0 4px 12px rgba(79,110,247,.16); }
.pager .pg-btn.cur { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 6px 16px rgba(79,110,247,.3); }
.pager .pg-btn[disabled] { opacity: .4; cursor: not-allowed; }
.pager .pg-ellipsis { color: var(--muted); padding: 0 2px; font-weight: 700; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); display: inline-block; margin-right: 6px; animation: pulse 1.6s infinite; }
@media (max-width: 640px) { th.hide-sm, td.hide-sm { display: none; } .btn-row { flex-wrap: wrap; } .opt-grid { grid-template-columns: 1fr; } }

/* ========== 统一响应式 ========== */

/* 平板及以下 */
@media (max-width: 900px) {
  .page { padding: 22px 14px 60px; }
  .page.wide { padding: 22px 14px 60px; }
  .topbar { padding: 12px 16px; gap: 8px; flex-wrap: wrap; }
  .topbar .ttl { font-size: 16px; }
  .topbar .chip { font-size: 12.5px; padding: 6px 11px; }
  .topbar .btn.ghost { padding: 8px 12px !important; font-size: 12.5px !important; }
  .topbar .spacer { flex: 1 1 100%; height: 0; order: 99; } /* 强制换行分隔 */
  .topbar { row-gap: 8px; }
  .card { padding: 22px; border-radius: 18px; }
  .card-hd { gap: 12px; }
  .card-hd .card-title { font-size: 18px; }
  .card-hd .card-ic { width: 42px; height: 42px; font-size: 22px; border-radius: 12px; }
  .input { padding: 15px 16px; font-size: 17px; }
  .login-card { padding: 30px 24px; }
}

/* 统计摘要（板） */
@media (max-width: 720px) {
  .summary { gap: 8px; }
  .summary .card { min-width: 0; padding: 14px 16px; }
  .summary .card .n { font-size: 24px; }
  .summary .card .l { font-size: 12px; }
}

/* 手机 */
@media (max-width: 600px) {
  .page { padding: 16px 12px 50px; }
  .page.wide { padding: 16px 12px 50px; }
  .card { padding: 18px; border-radius: 16px; }
  .card-hd { flex-wrap: wrap; }
  .card-hd .hd-actions { margin-left: 0 !important; width: 100%; }
  .card-hd .hd-actions .btn { width: 100%; }
  .card-hd .card-title { font-size: 17px; }
  .topbar { padding: 10px 12px; }
  .topbar .ttl { font-size: 15px; }
  .topbar > .chip { font-size: 12px; padding: 5px 10px; gap: 6px; }
  .topbar > .chip .avatar { width: 24px; height: 24px; }
  .topbar .btn.ghost { padding: 7px 10px !important; font-size: 12px !important; }
  .input { padding: 14px 14px; font-size: 16px; }
  .wb-modal { padding: 22px 18px; border-radius: 18px; }
  .wb-modal h2 { font-size: 18px; }
  textarea.input { font-size: 14px; min-height: 120px; }
  .summary .card { padding: 14px 14px; }
  .summary .card .n { font-size: 22px; }
  /* 表格横滑 */
  .table-card { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table-card table { min-width: 580px; }
  /* 通用小屏隐藏关键列 */
  table.compact th.hide-tn, table.compact td.hide-tn { display: none; }
/* 看板：非管理员隐藏「操作」列（仅管理员可远程结束） */
/* body.no-op-col .op-col { display: none; } — 已删除：操作列移除后该规则无目标 */
}

/* 超窄屏 */
@media (max-width: 380px) {
  .topbar .ttl { font-size: 14px; }
  .topbar > .chip:not(:first-of-type) { display: none; }
  .card { padding: 16px 14px; border-radius: 14px; }
}

/* 登录页品牌区：小屏收紧间距 */
@media (max-width: 600px) {
  .brand { gap: 10px; }
}

/* ===== 跨页面切换动效（方案 B：整页淡入淡出，View Transitions API）=====
   现代浏览器（Chrome/Edge 126+）原生支持；不支持时自动降级为普通跳转，无副作用。 */
@view-transition { navigation: auto; }

/* 整页交叉淡入淡出：旧页淡出、新页淡入（无位移、无方向、无共享元素形变） */
::view-transition-old(root) { animation: vtFadeOut .3s var(--ease) both; }
::view-transition-new(root) { animation: vtFadeIn .38s var(--ease) both; }
@keyframes vtFadeOut { to { opacity: 0; } }
@keyframes vtFadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ===== 历史工时页（history.html）===== */
.nav-cur { background: var(--primary-soft); color: var(--primary) !important; border-color: rgba(79,110,247,.3) !important; }
.filter-row { display: flex; flex-wrap: wrap; gap: 14px 18px; align-items: flex-end; }
.filter-row .field { margin: 0; min-width: 150px; }
.filter-row .field.grow { flex: 1 1 200px; }
.filter-row .field label { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 6px; font-weight: 600; }
.filter-btns { display: flex; align-items: center; gap: 10px; margin-top: 18px; }
.filter-btns .btn { padding: 10px 18px; }
.tbl-wrap { max-height: 64vh; overflow: auto; }
/* 操作审计页：对齐历史工时明细卡片 —— page flex column → acct-card 占满 → table-card 占满 → tbl-wrap 内部滚；pager 正常流显示 */
.page.wide.audit-page {
  max-width: none; width: 100%;
  display: flex; flex-direction: column;
  padding: 0 0 10px;
  overflow: hidden;
}
.audit-page .card.acct-card {
  flex: 1 1 auto; min-height: 0;
  display: flex; flex-direction: column;
  margin: 18px 22px 8px;
}
.audit-page .acct-card .table-card {
  flex: 1 1 auto; min-height: 0;
  display: flex; flex-direction: column;
}
.audit-page .acct-card .tbl-wrap {
  flex: 1 1 auto; min-height: 0;
  max-height: none;
  border-radius: 0 0 var(--radius) var(--radius);
}
.audit-page .acct-card table.compact { min-width: 760px; }
.audit-page .acct-card thead th {
  position: sticky; top: 0; z-index: 2;
  background: var(--surface-solid);
  box-shadow: inset 0 -1px 0 var(--border);
}
.audit-page .acct-card:hover { transform: none; box-shadow: var(--shadow-sm); }

/* 账号管理页：与审计/历史同构 —— page flex column → 卡撑满 → 表格撑满 → tbl-wrap 内部滚；pager 常显 */
.page.wide.acct-page {
  max-width: none; width: 100%;
  display: flex; flex-direction: column;
  padding: 0 0 10px;
  overflow: hidden;
}
.acct-page .card.acct-card {
  flex: 1 1 auto; min-height: 0;
  display: flex; flex-direction: column;
  margin: 18px 22px 8px;
}
.acct-page .acct-card .table-card {
  flex: 1 1 auto; min-height: 0;
  display: flex; flex-direction: column;
}
.acct-page .acct-card .tbl-wrap {
  flex: 1 1 auto; min-height: 0;
  max-height: none;
  border-radius: 0 0 var(--radius) var(--radius);
}
.acct-page .acct-card table.compact { min-width: 760px; }
.acct-page .acct-card table.compact th,
.acct-page .acct-card table.compact td { padding: 9px 12px; }
.acct-page .acct-card thead th {
  position: sticky; top: 0; z-index: 2;
  background: var(--surface-solid);
  box-shadow: inset 0 -1px 0 var(--border);
}
.acct-page .acct-card:hover { transform: none; box-shadow: var(--shadow-sm); }
.empty-state { padding: 48px; text-align: center; color: var(--muted); font-size: 15px; }
.badge { display: inline-block; font-size: 12px; padding: 3px 10px; border-radius: 999px; font-weight: 700; }
.badge.warn { background: #fff4e0; color: #c2780c; border: 1px solid #ffe1ad; }
.badge.ok { background: #e7f7ee; color: #1c8a4f; border: 1px solid #b8e8cc; }
/* 历史页：是否复核 三态方块徽章（实心填充） */
.badge.review-pending { background: #e64545; color: #fff; padding: 5px 12px; border-radius: 6px; font-size: 12px; font-weight: 600; letter-spacing: 0.5px; border: none; }
.badge.review-done    { background: #2faf5a; color: #fff; padding: 5px 12px; border-radius: 6px; font-size: 12px; font-weight: 600; letter-spacing: 0.5px; border: none; }
/* 编辑弹窗：原始数据正常时的静态提示 */
.sub-static { display: inline-block; background: #f1f4f8; color: #5a6678; padding: 7px 14px; border-radius: 8px; font-size: 13px; font-weight: 500; }
/* 历史页：筛选卡片内的「仅看待复核」胶囊按钮（与「全部组别」下拉同形） */
.hist-page .pill-toggle {
  display: inline-flex; align-items: center; gap: 7px;
  height: 36px; padding: 0 16px;
  border-radius: 11px;
  border: 1px solid rgba(79,110,247,.4);
  background: #fff; color: #3a57e0;
  font-size: 13px; font-weight: 600; font-family: inherit;
  cursor: pointer; white-space: nowrap; user-select: none;
  transition: box-shadow .18s, transform .18s, background .18s, color .18s, border-color .18s;
}
.hist-page .pill-toggle:hover { box-shadow: 0 6px 18px rgba(79,110,247,.28); transform: translateY(-1px); }
.hist-page .pill-toggle:active { transform: translateY(0); }
.hist-page .pill-toggle .pt-check { display: none; }
.hist-page .pill-toggle.on {
  background: linear-gradient(135deg, #2faf5a, #5fd28a);
  border-color: transparent; color: #fff;
  box-shadow: 0 6px 18px rgba(47,175,90,.32);
}
.hist-page .pill-toggle.on .pt-check { display: inline-block; }

/* 历史页：显礼卡片 flex 展开，明细卡片 flex:1 长度铺底 + 内部滚轮 */
.page.wide.hist-page {
  max-width: none; width: 100%;
  display: flex; flex-direction: column;
  padding: 0 0 10px;
  overflow: hidden;
}
.hist-page .card { padding: 20px 22px; }
.hist-page .card:not(.filter-card) { margin-left: 22px; margin-right: 22px; }
.hist-page .card.detail-card {
  flex: 1 1 0; min-height: 0;
  display: flex; flex-direction: column;
  margin-top: 18px;
  margin-bottom: 8px;
}
/* 明细卡片内部：表格卡片 flex 展开，格子 flex:1 内部滚 */
.hist-page .detail-card .table-card {
  flex: 1 1 0; min-height: 0;
  display: flex; flex-direction: column;
}
.hist-page .detail-card .tbl-wrap {
  flex: 1 1 0; min-height: 0; max-height: none;
  border-radius: 0 0 var(--radius) var(--radius);
  overflow-y: auto;
}
/* 基础数据状态（默认）：居中提示 */
.hist-page .detail-card .empty-state {
  flex: 1 1 auto; min-height: 240px;
  display: flex; align-items: center; justify-content: center;
  flex-direction: column; gap: 8px;
  font-size: 14px;
}
.hist-page .detail-card .empty-state .es-icon { font-size: 38px; opacity: .55; }
.hist-page .detail-card .empty-state .es-hint { color: var(--primary); font-weight: 600; font-size: 13px; opacity: .85; }
/* 历史页明细卡片取消 hover 上浮（保持 flex 部居高度稳定） */
.hist-page .card.detail-card:hover { transform: none; box-shadow: var(--shadow-sm); }
.hist-page .card-hd { margin-bottom: 14px; min-height: 0; }
.hist-page .card-title { font-size: 16px; }
.hist-page .card-hd .sub { font-size: 12px; }
.hist-page .filter-row { gap: 10px 14px; }
.hist-page .filter-row .field { min-width: 132px; }
.hist-page .filter-row .field.grow { flex: 1 1 160px; }
.hist-page .filter-row .field label { font-size: 11.5px; margin-bottom: 5px; }
.hist-page .filter-row .field.lob { flex: 0 0 220px; max-width: 220px; }
.hist-page .filter-btns { margin-top: 14px; gap: 8px; }
.hist-page .filter-btns .btn { padding: 8px 16px; font-size: 13px; }
.hist-page .tbl-wrap { max-height: 72vh; }
/* 历史明细：恢复内置竖向滚动条（仅本卡片允许滚动；审计/账号卡片仍走分页、无滚动） */
.hist-page .detail-card .tbl-wrap thead th {
  position: sticky; top: 0; z-index: 2;
  background: var(--surface-solid);
  box-shadow: inset 0 -1px 0 var(--border);
}

/* ===== 历史页 · 筛选条方案 C（分组紧凑 · 紧贴 topbar）===== */
.page.wide.hist-page { padding: 0 0 10px; }
.hist-page .card.filter-card {
  margin-top: 0;
  padding: 8px 22px;
  border-radius: 0;
  border-top: none;
  background: linear-gradient(180deg, #ffffff 0%, #eef1f8 100%);
  border-bottom: 1px solid rgba(28,40,74,0.14);
  box-shadow: 0 1px 0 rgba(28,40,74,0.04);
}
.hist-page .card.filter-card .card-hd { display: none; }
/* 小屏与 topbar 左右内边距保持对齐 */
@media (max-width: 900px) {
  .hist-page .card.filter-card,
  .hist-page .card:not(.filter-card) { padding-left: 16px; padding-right: 16px; }
}
@media (max-width: 600px) {
  .hist-page .card.filter-card,
  .hist-page .card:not(.filter-card) { padding-left: 12px; padding-right: 12px; }
}
.hist-page .filter-groups {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: stretch;
}
.hist-page .f-group {
  padding: 3px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.hist-page .f-group + .f-group { border-left: 1px solid var(--border); }
.hist-page .f-group:first-child { padding-left: 2px; }
.hist-page .f-group:last-child { padding-right: 2px; }
.hist-page .f-group-label {
  font-size: 12px;
  color: #3a4358;                       /* 比 --muted (#6b7686) 深一档，呼应主色蓝灰，与筛选控件主体协调 */
  font-weight: 700;
  letter-spacing: 0.4px;
  line-height: 1;
}
.hist-page .f-group-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.hist-page .f-group-row .input {
  padding: 0 12px;
  font-size: 13px;
  height: 36px;
  min-width: 0;
  line-height: 36px;
}
.hist-page .f-group-row input[type="date"] { width: 124px; }
.hist-page .f-group-row .ac { position: relative; flex: 0 0 170px; min-width: 0; }
.hist-page .ac .input { width: 100%; flex: 1 1 auto; }
.hist-page .f-group-row #fStation { width: 100%; flex: 0 0 170px; min-width: 0; }
.hist-page .f-group-row #fProject { width: 170px; flex: 0 0 170px; min-width: 0; }
/* 工号/姓名 联想下拉 */
.hist-page .ac-list {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 60;
  margin: 0; padding: 4px; list-style: none;
  background: #fff; border: 1px solid rgba(28,40,74,.14);
  border-radius: 8px; box-shadow: 0 10px 30px rgba(28,40,74,.18);
  max-height: 260px; overflow-y: auto;
}
.hist-page .ac-item {
  display: flex; align-items: baseline; gap: 10px;
  padding: 6px 10px; border-radius: 6px; cursor: pointer;
  font-size: 13px; line-height: 1.4; white-space: nowrap;
}
.hist-page .ac-item:hover, .hist-page .ac-item.active { background: #eef1f7; }
.hist-page .ac-emp { font-weight: 700; color: var(--text); }
.hist-page .ac-name { color: var(--muted); font-size: 12px; margin-left: auto; }
/* 筛选条内组别 · 胶囊（去 hover 浮动 + 适配 36h 与筛选条同高） */
.hist-page .dd-trigger.dd-cf {
  height: 36px;
  min-width: 108px;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 700;
  gap: 8px;
  color: var(--text);
  background: #ffffff;
  border: 1px solid rgba(28,40,74,0.22);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8), 0 1px 2px rgba(28,40,74,.04);
  transition: background .18s var(--ease), border-color .18s var(--ease), box-shadow .18s var(--ease);
}
.hist-page .dd-trigger.dd-cf .dd-caret { color: var(--primary); opacity: 1; }
.hist-page .dd-trigger.dd-cf:hover {
  transform: none;
  background: #f4f7fd;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,110,247,.14), 0 1px 2px rgba(28,40,74,.04);
  filter: none;
}
.hist-page .dd-trigger.dd-cf:active { transform: none; }
.hist-page .dd.open .dd-trigger.dd-cf {
  background: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,110,247,.18), 0 1px 2px rgba(28,40,74,.04);
}
.hist-page .f-dash {
  color: var(--muted);
  font-size: 13px;
  padding: 0 2px;
  user-select: none;
}
.hist-page .f-group.f-group-actions .btn {
  padding: 9px 20px;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.hist-page .f-group.f-group-actions .btn.ghost {
  background: #ffffff;
  border: 1px solid rgba(28,40,74,0.22);
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8), 0 1px 2px rgba(28,40,74,.04);
  font-weight: 700;
}
.hist-page .f-group.f-group-actions .btn.ghost:hover {
  background: #f4f7fd;
  border-color: rgba(28,40,74,0.32);
  color: var(--primary);
  transform: translateY(-1px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8), 0 2px 6px rgba(28,40,74,.08);
  filter: none;
}
.hist-page .f-group.f-group-actions .btn svg { width: 12px; height: 12px; }

/* 历史页「导出」按钮 · 绿色实心（成功/下载语义） */
.hist-page .f-group.f-group-actions .btn.export {
  background: linear-gradient(135deg, #16a34a, #22c55e);
  color: #fff;
  border: 1px solid rgba(255,255,255,.18);
  box-shadow: 0 4px 14px rgba(22,163,74,.32), inset 0 1px 0 rgba(255,255,255,.25);
  font-weight: 700;
}
.hist-page .f-group.f-group-actions .btn.export:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(22,163,74,.42), inset 0 1px 0 rgba(255,255,255,.3);
  filter: brightness(1.04);
  background: linear-gradient(135deg, #16a34a, #22c55e);
}
.hist-page .f-group.f-group-actions .btn.export:active {
  transform: translateY(0);
}
/* 账号页「导出」按钮 · 绿色实心（与历史页导出语义一致，右上角视觉协调） */
.acct-page .btn.export {
  background: linear-gradient(135deg, #16a34a, #22c55e);
  color: #fff;
  border: 1px solid rgba(255,255,255,.18);
  box-shadow: 0 4px 14px rgba(22,163,74,.32), inset 0 1px 0 rgba(255,255,255,.25);
  font-weight: 700;
}
.acct-page .btn.export:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(22,163,74,.42), inset 0 1px 0 rgba(255,255,255,.3);
  filter: brightness(1.04);
  background: linear-gradient(135deg, #16a34a, #22c55e);
}
.acct-page .btn.export:active { transform: translateY(0); }

/* 联想下拉：匹配命中的字高亮 */
.hist-page .ac-item mark { background: rgba(79,110,247,.18); color: var(--primary-d); border-radius: 3px; padding: 0 1px; font-weight: 700; }
/* 尊重系统「减少动态效果」偏好：关闭持续动画与过渡，提升性能与无障碍；并关闭整页视图切换 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important; animation-iteration-count: 1 !important;
    transition-duration: .001ms !important; scroll-behavior: auto !important;
  }
  @view-transition { navigation: none; }
}

/* ============================================================
   方案 A · 视觉精修：暗色模式 + 密度切换 + 切换控件
   （data-theme / data-density 挂在 <html> 上，由 ui.js 注入切换按钮）
   ============================================================ */

/* ---------- 暗色模式 ---------- */
[data-theme="dark"] {
  --bg-1: #0d1420;
  --bg-2: #0f1622;
  --bg-3: #0e1a18;
  --surface: rgba(27, 34, 50, 0.95);
  --surface-solid: #1a2130;
  --surface-2: #212a3c;
  --primary: #6b85ff;
  --primary-d: #8494ff;
  --primary-soft: #1d2740;
  --text: #e8ecf4;
  --muted: #93a0b6;
  --border: #2b3548;
  --ok: #22c55e;
  --ok-soft: #10301c;
  --warn: #f59e0b;
  --warn-soft: #2e2310;
  --danger: #f87171;
  --danger-soft: #2e1616;
  --glass-bg: linear-gradient(135deg, rgba(30, 38, 56, .94), rgba(26, 33, 49, .86));
  --glass-bg-2: linear-gradient(135deg, rgba(28, 36, 54, .92), rgba(24, 31, 47, .82));
  --glass-brd: rgba(255, 255, 255, .12);
  --glass-hi: rgba(255, 255, 255, .16);
  --shadow: 0 18px 50px rgba(0, 0, 0, .5);
  --shadow-sm: 0 6px 18px rgba(0, 0, 0, .35);
  --shadow-pop: 0 24px 70px rgba(0, 0, 0, .6);
  --shadow-glass: 0 14px 44px rgba(0, 0, 0, .5), 0 3px 10px rgba(0, 0, 0, .3);
  --shadow-glass-lg: 0 34px 90px rgba(0, 0, 0, .6), 0 6px 18px rgba(0, 0, 0, .35);
}
[data-theme="dark"] body { background: var(--bg-2); color: var(--text); }
[data-theme="dark"] body::before {
  background:
    radial-gradient(40% 38% at 18% 22%, rgba(107, 133, 255, 0.16), transparent 60%),
    radial-gradient(42% 40% at 82% 18%, rgba(34, 197, 94, 0.10), transparent 60%),
    radial-gradient(45% 45% at 70% 85%, rgba(124, 139, 255, 0.12), transparent 60%),
    linear-gradient(135deg, var(--bg-1), var(--bg-2) 45%, var(--bg-3));
}
[data-theme="dark"] body::after { background: radial-gradient(120% 80% at 50% -10%, rgba(255, 255, 255, 0.06), transparent 55%); }
[data-theme="dark"] .bg-orbs { opacity: .14; }
[data-theme="dark"] .topbar { background: rgba(20, 26, 40, .82); }
[data-theme="dark"] .topbar-search { background: var(--surface-2); border-color: var(--border); }
[data-theme="dark"] .topbar-search:focus-within { background: var(--surface-solid); }
[data-theme="dark"] body.app-shell .card { background: var(--surface-solid); border-color: var(--border); }
[data-theme="dark"] .input, [data-theme="dark"] .login-input { background: var(--surface-2); color: var(--text); border-color: var(--border); }
[data-theme="dark"] .input:focus, [data-theme="dark"] .login-input:focus { background: var(--surface-solid); border-color: var(--primary); }
[data-theme="dark"] .sel, [data-theme="dark"] .dtpicker { background-color: var(--surface-2); border-color: var(--border); color: var(--text); }
[data-theme="dark"] .acct-dd { background: var(--surface-solid); border-color: var(--border); }
[data-theme="dark"] .acct-item:hover, [data-theme="dark"] .acct-item.active { background: var(--surface-2); }
[data-theme="dark"] tbody tr:hover { background: rgba(255, 255, 255, 0.04); }
[data-theme="dark"] tr.lv-orange td { background: rgba(245, 158, 11, 0.10); }
[data-theme="dark"] tr.lv-red td { background: rgba(248, 113, 113, 0.10); }
[data-theme="dark"] tr.lv-critical td { background: rgba(248, 113, 113, 0.16); }
[data-theme="dark"] .emp-chip, [data-theme="dark"] .emp-row, [data-theme="dark"] .sw-item,
[data-theme="dark"] .detail-box, [data-theme="dark"] .opt-card, [data-theme="dark"] .pchip { background: var(--surface-solid); border-color: var(--border); }
[data-theme="dark"] .sw-item:hover, [data-theme="dark"] .opt-card:hover { background: var(--primary-soft); }
[data-theme="dark"] .emp-empty, [data-theme="dark"] .sub-static { background: var(--surface-2); color: var(--muted); }
[data-theme="dark"] .hist-page .card.filter-card { background: linear-gradient(180deg, #1a2130 0%, #141b28 100%); border-bottom-color: var(--border); }
[data-theme="dark"] .hist-page .ac-list { background: var(--surface-solid); border-color: var(--border); }
[data-theme="dark"] .hist-page .ac-item:hover, [data-theme="dark"] .hist-page .ac-item.active { background: var(--surface-2); }
[data-theme="dark"] .hist-page .dd-trigger.dd-cf,
[data-theme="dark"] .hist-page .f-group.f-group-actions .btn.ghost { background: var(--surface-solid); border-color: var(--border); color: var(--text); }
[data-theme="dark"] .hist-page .dd-trigger.dd-cf:hover,
[data-theme="dark"] .hist-page .f-group.f-group-actions .btn.ghost:hover,
[data-theme="dark"] .hist-page .dd.open .dd-trigger.dd-cf { background: var(--surface-2); border-color: var(--primary); }
[data-theme="dark"] .hist-page .ac-item mark { background: rgba(107, 133, 255, .25); color: var(--primary-d); }
[data-theme="dark"] .badge.warn { background: #2e2310; color: #f5b94a; border-color: #4a3a17; }
[data-theme="dark"] .badge.ok { background: #10301c; color: #4ade80; border-color: #1b4a2c; }
[data-theme="dark"] .wb-toast { background: #0a0f18; color: #e8ecf4; }
/* ---------- 暗色补充：.btn.ghost / 焦点 / 输入 / 徽章 / 弹窗 ---------- */
/* 暗色下 ghost 按钮 hover：原亮色硬编码 #eef1f7 在暗色下刺眼，改用蓝色微弱高亮 */
[data-theme="dark"] .btn.ghost:hover,
[data-theme="dark"] .btn.ghost:focus-visible {
  background: rgba(107, 133, 255, .12);
  color: var(--text);
  border-color: var(--primary);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(107, 133, 255, .18);
  filter: none;
}
[data-theme="dark"] .btn.ghost.nav-cur,
[data-theme="dark"] .btn.ghost.active {
  background: rgba(107, 133, 255, .18);
  color: var(--primary-d);
  border-color: var(--primary);
}
/* 暗色下：导入/导出颜色变体（提亮底色 + 高亮边框 + 调亮字色） */
[data-theme="dark"] .btn.ghost.info { background: rgba(107, 133, 255, .14); color: #8aa3ff; border-color: #5b78ff; box-shadow: 0 2px 8px rgba(107, 133, 255, .22); }
[data-theme="dark"] .btn.ghost.info:hover { background: rgba(107, 133, 255, .22); box-shadow: 0 6px 18px rgba(107, 133, 255, .35); }
[data-theme="dark"] .btn.ghost.success { background: rgba(34, 197, 94, .14); color: #4ade80; border-color: #22c55e; box-shadow: 0 2px 8px rgba(34, 197, 94, .22); }
[data-theme="dark"] .btn.ghost.success:hover { background: rgba(34, 197, 94, .22); box-shadow: 0 6px 18px rgba(34, 197, 94, .35); }
/* 暗色下焦点环不要切回白底 */
[data-theme="dark"] .input:focus,
[data-theme="dark"] .login-input:focus { background: var(--surface-2); box-shadow: 0 0 0 4px rgba(107, 133, 255, .20); }
[data-theme="dark"] .topbar-search:focus-within { background: var(--surface-2); border-color: var(--primary); box-shadow: 0 0 0 4px rgba(107, 133, 255, .20); }
/* 暗色下卡片/标签不卡死在白底 */
[data-theme="dark"] .emp-chip,
[data-theme="dark"] .emp-row,
[data-theme="dark"] .sw-item,
[data-theme="dark"] .sub-static { background: var(--surface-2); color: var(--text); }
[data-theme="dark"] .sub-static { color: var(--muted); }
/* 暗色下补漏的徽章 */
[data-theme="dark"] .badge.danger { background: #2e1616; color: #f87171; border-color: #4a1f1f; }
[data-theme="dark"] .badge.info   { background: #0f2231; color: #6db8ff; border-color: #1f3a52; }
[data-theme="dark"] .badge.review-pending { background: #4a1f1f; color: #fca5a5; }
[data-theme="dark"] .badge.review-done    { background: #10301c; color: #4ade80; }
/* 暗色下 select/option 可读性（兼容主流浏览器，部分仅 webkit 支持） */
[data-theme="dark"] select.sel option,
[data-theme="dark"] .dtpicker option { background: var(--surface-2); color: var(--text); }
/* 暗色下顶部用户菜单 hover 状态保持一致 */
[data-theme="dark"] .user-menu:hover,
[data-theme="dark"] .user-menu:focus-within { background: var(--surface-2); border-color: var(--primary); }


/* ---------- 紧凑密度 ---------- */
[data-density="compact"] th, [data-density="compact"] td { padding: 8px 12px; font-size: 13px; }
[data-density="compact"] .card { padding: 16px; }
[data-density="compact"] .card-hd { margin-bottom: 12px; }
[data-density="compact"] .summary { gap: 8px; margin-bottom: 12px; }
[data-density="compact"] .summary .card { padding: 12px 16px; }
[data-density="compact"] .summary .card .n { font-size: 24px; }
[data-density="compact"] .field { margin-bottom: 10px; }
[data-density="compact"] .input { padding: 12px 14px; font-size: 16px; }
[data-density="compact"] .login-input { padding: 12px 16px; font-size: 15px; }
[data-density="compact"] .btn { padding: 10px 18px; font-size: 14px; }
[data-density="compact"] .page { padding-top: 20px; }

/* ---------- 主题/密度切换控件（仅注入有 .topbar 的页面） ---------- */
.pref-switch { display: inline-flex; align-items: center; gap: 6px; }
.pref-btn {
  position: relative;
  width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2);
  color: var(--muted); cursor: pointer;
  transition: background .18s var(--ease), color .18s var(--ease), border-color .18s var(--ease),
              box-shadow .22s var(--ease), transform .12s var(--ease);
}
/* hover：边框+图标变主色 + 微弱蓝色光晕，让"按钮在那"在暗/亮模式下都清晰 */
.pref-btn:hover {
  background: var(--surface-solid);
  color: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 4px 14px rgba(79, 110, 247, .28);
}
/* 按下：缩放反馈 */
.pref-btn:active { transform: scale(.94); box-shadow: 0 2px 8px rgba(79, 110, 247, .22); }
/* 当前模式指示（aria-pressed=true）：明确告诉用户"已是这个状态" */
.pref-btn[aria-pressed="true"] {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 4px 14px rgba(79, 110, 247, .38);
}
.pref-btn[aria-pressed="true"]:hover { filter: brightness(1.08); }
.pref-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(79, 110, 247, .35); }
.pref-btn svg { width: 17px; height: 17px; display: block; }
.pref-btn .ic-moon { display: none; }
[data-theme="dark"] .pref-btn[data-pref="theme"] .ic-sun { display: none; }
[data-theme="dark"] .pref-btn[data-pref="theme"] .ic-moon { display: block; }
/* 暗色下当前模式指示色更柔和（白字 vs 蓝填充对比过强，让颜色更柔） */
[data-theme="dark"] .pref-btn[aria-pressed="true"] { color: #0d1420; }

/* ---------- 页面切换 View Transitions（丝滑跨页过渡） ----------
   前提：topbar 内导航 <a> 在 ui.js 里被拦截，调用 document.startViewTransition。
   浏览器不支持时降级为直接 location.href（行为不变）。 */
@media (prefers-reduced-motion: no-preference) {
  ::view-transition-old(root) {
    animation: wt-leave .42s cubic-bezier(.4, 0, .2, 1) both;
  }
  ::view-transition-new(root) {
    animation: wt-enter .52s cubic-bezier(.22, 1, .36, 1) both;
  }
}
@keyframes wt-leave {
  0%   { opacity: 1; transform: translateY(0)    scale(1);    filter: blur(0); }
  100% { opacity: 0; transform: translateY(-8px) scale(.985); filter: blur(4px); }
}
@keyframes wt-enter {
  0%   { opacity: 0; transform: translateY(12px) scale(.985); filter: blur(4px); }
  100% { opacity: 1; transform: translateY(0)    scale(1);    filter: blur(0); }
}
/* 让顶层 topbar/背景保持流畅，避免在离场时被截到很糊 */
::view-transition-old(root) { z-index: 2; }
::view-transition-new(root) { z-index: 2; }
