/* ========================================
   v600：员工端手机 UI（完全独立设计系统）
   - 仅在 员工账号 + ≤768px 时由 WorkerMobile 激活
   - 浅色系：渐变头部 + 20px 大圆角白卡 + 60px 底部导航
   - 所有类名 wm- 前缀，PC 端 / 老板端零影响
   ======================================== */

/* PC 端 / 超宽屏永远隐藏 */
@media (min-width: 769px) {
  #worker-app { display: none !important; }
}

#worker-app {
  position: fixed;
  inset: 0;
  z-index: 900;
  background: #eaf2fb;
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  color: #1e293b;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}
#worker-app.hidden { display: none; }
#worker-app * { box-sizing: border-box; }
#worker-app input, #worker-app textarea, #worker-app select { font-size: 16px; } /* iOS 防聚焦缩放 */

/* ===== 页面滚动区 ===== */
.wm-body {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
  padding-bottom: calc(76px + env(safe-area-inset-bottom));
}

/* ===== 渐变头部（高约 200px，含状态留白） ===== */
.wm-head {
  padding: calc(20px + env(safe-area-inset-top)) 20px 56px;
  color: #fff;
  position: relative;
}
.wm-head-blue  { background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 55%, #2563eb 100%); }
.wm-head-orange{ background: linear-gradient(135deg, #fbbf24 0%, #f97316 60%, #ea580c 100%); }
.wm-head-pink  { background: linear-gradient(135deg, #f472b6 0%, #ec4899 55%, #db2777 100%); }
/* v602 首页：淡蓝天空渐变 + 深色文字（按设计稿） */
.wm-head-sky {
  background: linear-gradient(180deg, #cfe5fb 0%, #ddecfc 55%, #e6f1fe 100%);
  color: #0f172a;
  padding: calc(28px + env(safe-area-inset-top)) 20px 68px;
}
.wm-head-date-big {
  font-size: 27px; font-weight: 800; text-align: center; letter-spacing: 1px; color: #0f172a;
}
.wm-head-date-big .wm-head-week { font-size: 20px; margin-left: 8px; font-weight: 700; }
.wm-head-title {
  font-size: 22px; font-weight: 700; letter-spacing: 0.5px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.wm-head-date { font-size: 13px; opacity: 0.85; margin-top: 4px; }
.wm-back-btn {
  width: 34px; height: 34px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; color: #fff; cursor: pointer; flex-shrink: 0;
  border: none;
}
.wm-back-btn:active { background: rgba(255, 255, 255, 0.35); }

/* 头部大数字（工资页） */
.wm-head-amount { font-size: 40px; font-weight: 800; line-height: 1.15; margin-top: 14px; }
.wm-head-amount small { font-size: 15px; font-weight: 600; opacity: 0.9; margin-right: 4px; }
.wm-head-sub { font-size: 13px; opacity: 0.9; margin-top: 6px; }
.wm-head-chips { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.wm-head-chip {
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px; padding: 5px 12px; font-size: 12.5px; color: #fff;
}

/* 头部内容压卡：内容区上移叠住头部底部 */
.wm-overlap { margin-top: -40px; padding: 0 16px; position: relative; }

/* ===== 卡片 ===== */
.wm-card {
  background: #fff;
  border-radius: 20px;
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.06);
}
.wm-card-title { font-size: 15px; font-weight: 700; color: #0f172a; margin-bottom: 12px; display: flex; align-items: center; justify-content: space-between; }
.wm-card-title .wm-more { font-size: 12.5px; font-weight: 500; color: #3b82f6; cursor: pointer; }

/* 统计双卡 */
.wm-stat2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.wm-stat-card {
  background: #fff; border-radius: 20px; padding: 14px 16px;
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.06);
}
.wm-stat-label { font-size: 13px; color: #475569; font-weight: 600; display: flex; align-items: center; gap: 7px; }
.wm-stat-ico {
  width: 22px; height: 22px; border-radius: 6px; background: #eff6ff; color: #2563eb;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.wm-stat-ico svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.wm-stat-value { font-size: 30px; font-weight: 800; color: #0f172a; margin-top: 8px; }
.wm-stat-value small { font-size: 13px; font-weight: 600; color: #94a3b8; margin-left: 3px; }
.wm-stat-value.green { color: #16a34a; }
.wm-stat-value.blue  { color: #2563eb; }
.wm-stat-value.orange{ color: #ea580c; }

/* ===== 打卡按钮 ===== */
.wm-sign-wrap { display: flex; flex-direction: column; align-items: center; padding: 10px 0 2px; }
.wm-sign-btn {
  width: 172px; height: 172px; border-radius: 50%;
  border: none;
  color: #fff; font-size: 21px; font-weight: 700; letter-spacing: 2px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  cursor: pointer;
  box-shadow: 0 0 0 12px rgba(255, 255, 255, 0.55), 0 14px 32px rgba(22, 163, 74, 0.32);
  background: linear-gradient(145deg, #4ade80 0%, #22c55e 45%, #16a34a 100%);
  transition: transform 0.12s ease;
  outline: none; -webkit-appearance: none;
}
.wm-sign-btn svg { width: 34px; height: 34px; stroke: currentColor; fill: none; stroke-width: 2.1; stroke-linecap: round; stroke-linejoin: round; }
.wm-sign-btn:active { transform: scale(0.95); }
.wm-sign-btn .wm-sign-time { font-size: 12px; font-weight: 500; opacity: 0.92; letter-spacing: 0; }
.wm-sign-btn.done {
  background: linear-gradient(145deg, #93c5fd 0%, #60a5fa 45%, #3b82f6 100%);
  box-shadow: 0 0 0 12px rgba(255, 255, 255, 0.55), 0 14px 32px rgba(59, 130, 246, 0.3);
}
.wm-sign-btn.rejected {
  background: linear-gradient(145deg, #f87171 0%, #ef4444 50%, #dc2626 100%);
  box-shadow: 0 0 0 12px rgba(255, 255, 255, 0.55), 0 14px 32px rgba(239, 68, 68, 0.3);
}
.wm-sign-hint { font-size: 12px; color: rgba(255, 255, 255, 0.85); margin-top: 14px; }
.wm-head-sky .wm-sign-hint { color: #7c8ba1; }

/* ===== 打卡首页日期行 ===== */
.wm-day-strip { display: flex; gap: 8px; }
.wm-day-item {
  flex: 1; text-align: center; padding: 8px 0; border-radius: 12px;
  font-size: 12px; color: #64748b; background: #f1f5f9;
}
.wm-day-item b { display: block; font-size: 17px; color: #334155; font-weight: 700; margin-bottom: 2px; }
.wm-day-item.today { background: #2563eb; color: rgba(255, 255, 255, 0.85); }
.wm-day-item.today b { color: #fff; }

/* ===== 列表行 ===== */
.wm-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid #f1f5f9; cursor: pointer;
}
.wm-row:last-child { border-bottom: none; padding-bottom: 2px; }
.wm-row:active { background: #f8fafc; }
.wm-row-body { flex: 1; min-width: 0; }
.wm-row-title { font-size: 14.5px; font-weight: 600; color: #0f172a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wm-row-sub { font-size: 12.5px; color: #94a3b8; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wm-row-right { text-align: right; flex-shrink: 0; }
.wm-row-amount { font-size: 15px; font-weight: 700; color: #0f172a; }
.wm-row-amount.in { color: #16a34a; }
/* v602 任务行：蓝色圆图标 + 右箭头（按设计稿） */
.wm-row-avatar {
  width: 42px; height: 42px; border-radius: 50%;
  background: #3b82f6; color: #fff;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; font-size: 17px; font-weight: 700;
}
.wm-row-avatar svg { width: 19px; height: 19px; stroke: currentColor; fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.wm-row-avatar.orange { background: #f97316; }
.wm-row-arrow { color: #c3cad6; font-size: 20px; font-weight: 700; flex-shrink: 0; line-height: 1; }

/* 状态标签 */
.wm-tag {
  display: inline-block; padding: 2px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 600; flex-shrink: 0;
}
.wm-tag.green { background: #dcfce7; color: #16a34a; }
.wm-tag.amber { background: #fef3c7; color: #b45309; }
.wm-tag.red { background: #fee2e2; color: #dc2626; }
.wm-tag.blue { background: #dbeafe; color: #2563eb; }
.wm-tag.gray { background: #f1f5f9; color: #64748b; }

/* 缩略图（现场记录） */
.wm-thumb {
  width: 80px; height: 80px; border-radius: 14px; object-fit: cover; flex-shrink: 0;
  background: #f1f5f9;
}

/* v626：无预览帧的记录类型（语音/文字）图标缩略块 + 多类型快捷入口 */
.wm-thumb-ico {
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; color: #64748b;
}
.wm-quick {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
}
.wm-quick-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  padding: 9px 0; border: none; border-radius: 14px;
  background: rgba(255, 255, 255, 0.92); cursor: pointer;
  font-size: 20px; line-height: 1;
}
.wm-quick-btn span { font-size: 11.5px; font-weight: 600; color: #2563eb; }
.wm-quick-btn:active { transform: scale(0.96); }

/* 空状态 */
.wm-empty { text-align: center; padding: 36px 20px; color: #94a3b8; font-size: 13.5px; }
.wm-empty .wm-empty-icon { font-size: 38px; margin-bottom: 10px; opacity: 0.7; }

/* ===== 现场记录大按钮 ===== */
.wm-capture-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 13px 0; border: none; border-radius: 999px;
  background: #fff; color: #2563eb; font-size: 16px; font-weight: 700;
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.08); cursor: pointer;
}
.wm-capture-btn:active { transform: scale(0.98); }

/* ===== 我的页面 ===== */
.wm-profile { display: flex; align-items: center; gap: 14px; }
.wm-avatar {
  width: 58px; height: 58px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.25); border: 2px solid rgba(255, 255, 255, 0.5);
  color: #fff; font-size: 24px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.wm-profile-name { font-size: 19px; font-weight: 700; color: #fff; }
.wm-profile-sub { font-size: 12.5px; color: rgba(255, 255, 255, 0.85); margin-top: 3px; }

/* 菜单列表 */
.wm-menu-row {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 2px; border-bottom: 1px solid #f1f5f9; cursor: pointer; font-size: 15px; color: #334155;
}
.wm-menu-row:last-child { border-bottom: none; }
.wm-menu-row:active { background: #f8fafc; }
.wm-menu-icon { width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 17px; flex-shrink: 0; }
.wm-menu-arrow { margin-left: auto; color: #cbd5e1; font-size: 14px; }

/* ===== 底部导航（4 tab，60px） ===== */
.wm-tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 950;
  height: calc(60px + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: #fff;
  border-top: 1px solid #eef2f7;
  display: flex; align-items: stretch;
  box-shadow: 0 -2px 12px rgba(15, 23, 42, 0.04);
}
.wm-tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; font-size: 10.5px; color: #94a3b8; cursor: pointer;
  background: none; border: none; padding: 0;
}
.wm-tab svg { width: 23px; height: 23px; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.wm-tab.active { color: #2563eb; font-weight: 600; }

/* ===== 底部 Sheet 弹层 ===== */
.wm-sheet-mask {
  position: fixed; inset: 0; z-index: 960;
  background: rgba(15, 23, 42, 0.45);
  display: flex; align-items: flex-end;
  animation: wmFade 0.18s ease;
}
.wm-sheet {
  width: 100%; max-height: 86vh; overflow-y: auto;
  background: #fff; border-radius: 22px 22px 0 0;
  padding: 12px 20px calc(20px + env(safe-area-inset-bottom));
  animation: wmUp 0.24s cubic-bezier(0.32, 1, 0.46, 1);
}
@keyframes wmUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes wmFade { from { opacity: 0; } to { opacity: 1; } }
.wm-sheet-grip { width: 40px; height: 4px; border-radius: 2px; background: #e2e8f0; margin: 0 auto 14px; }
.wm-sheet-title { font-size: 16.5px; font-weight: 700; color: #0f172a; text-align: center; margin-bottom: 16px; }

/* 表单 */
.wm-field { margin-bottom: 14px; }
.wm-field-label { font-size: 13px; color: #64748b; margin-bottom: 7px; font-weight: 600; }
.wm-seg { display: flex; background: #f1f5f9; border-radius: 12px; padding: 3px; }
.wm-seg-item { flex: 1; text-align: center; padding: 9px 0; border-radius: 10px; font-size: 14px; color: #64748b; cursor: pointer; }
.wm-seg-item.on { background: #fff; color: #2563eb; font-weight: 700; box-shadow: 0 1px 4px rgba(15, 23, 42, 0.1); }
.wm-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.wm-chip-pick {
  padding: 8px 14px; border-radius: 999px; border: 1px solid #e2e8f0;
  font-size: 13px; color: #475569; background: #fff; cursor: pointer;
}
.wm-chip-pick.on { background: #eff6ff; border-color: #3b82f6; color: #2563eb; font-weight: 600; }
.wm-input {
  width: 100%; border: 1px solid #e2e8f0; border-radius: 12px;
  padding: 11px 14px; font-size: 15px; color: #0f172a; outline: none; background: #f8fafc;
}
.wm-input:focus { border-color: #3b82f6; background: #fff; }
.wm-textarea { width: 100%; border: 1px solid #e2e8f0; border-radius: 12px; padding: 11px 14px; font-size: 15px; color: #0f172a; outline: none; background: #f8fafc; min-height: 72px; resize: none; }
/* v609 打卡绑定项目：搜索 + 下拉多选 */
.wm-proj-drop { max-height: 210px; overflow-y: auto; border: 1px solid #e2e8f0; border-radius: 12px; background: #fff; overscroll-behavior: contain; }
.wm-proj-opt { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 11px 14px; font-size: 15px; color: #0f172a; border-bottom: 1px solid #f1f5f9; cursor: pointer; }
.wm-proj-opt:last-child { border-bottom: none; }
.wm-proj-opt.on { background: #eff6ff; color: #2563eb; font-weight: 600; }
.wm-proj-opt-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wm-proj-opt-check { width: 20px; text-align: center; color: #2563eb; font-weight: 700; flex: none; }
.wm-proj-empty { padding: 16px; text-align: center; font-size: 13px; color: #94a3b8; }
.wm-chip-x { margin-left: 5px; font-size: 14px; opacity: 0.7; }
.wm-submit-btn {
  width: 100%; padding: 14px 0; border: none; border-radius: 14px;
  background: linear-gradient(135deg, #3b82f6, #2563eb); color: #fff;
  font-size: 16px; font-weight: 700; cursor: pointer; margin-top: 4px;
}
.wm-submit-btn:active { opacity: 0.9; }
.wm-submit-btn[disabled] { opacity: 0.55; }
.wm-submit-btn.green { background: linear-gradient(135deg, #10b981, #059669); }

/* ===== 日历（考勤记录页） ===== */
.wm-cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.wm-cal-month { font-size: 16px; font-weight: 700; color: #0f172a; }
.wm-cal-nav {
  width: 32px; height: 32px; border-radius: 10px; border: 1px solid #e2e8f0; background: #fff;
  color: #64748b; font-size: 15px; cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.wm-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.wm-cal-wd { text-align: center; font-size: 11px; color: #94a3b8; padding: 6px 0; }
.wm-cal-cell {
  aspect-ratio: 1; border-radius: 12px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; font-size: 13.5px; color: #334155;
  position: relative; background: #f8fafc;
}
.wm-cal-cell.blank { background: transparent; }
.wm-cal-cell .wm-dot { position: absolute; bottom: 5px; width: 5px; height: 5px; border-radius: 50%; }
.wm-dot.green { background: #22c55e; }
.wm-dot.amber { background: #f59e0b; }
.wm-dot.red { background: #ef4444; }
.wm-cal-cell.today { border: 1.5px solid #3b82f6; font-weight: 700; color: #2563eb; }

/* ===== 图片灯箱 ===== */
.wm-lightbox {
  position: fixed; inset: 0; z-index: 980;
  background: rgba(0, 0, 0, 0.92);
  display: flex; align-items: center; justify-content: center;
  animation: wmFade 0.18s ease;
}
.wm-lightbox img { max-width: 100%; max-height: 88%; border-radius: 10px; }
.wm-lightbox-close {
  position: absolute; top: calc(14px + env(safe-area-inset-top)); right: 16px;
  width: 38px; height: 38px; border-radius: 50%; border: none;
  background: rgba(255, 255, 255, 0.15); color: #fff; font-size: 18px; cursor: pointer;
}
.wm-lightbox-cap {
  position: absolute; bottom: calc(26px + env(safe-area-inset-bottom));
  left: 0; right: 0; text-align: center; color: rgba(255, 255, 255, 0.85); font-size: 13px; padding: 0 30px;
}

/* 上传中遮罩 */
.wm-busy {
  position: fixed; inset: 0; z-index: 970;
  background: rgba(15, 23, 42, 0.5);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  color: #fff; font-size: 14px;
}
.wm-spinner {
  width: 38px; height: 38px; border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.25); border-top-color: #fff;
  animation: wmSpin 0.8s linear infinite;
}
@keyframes wmSpin { to { transform: rotate(360deg); } }
