/* 工程部工作平台 · 手机端样式 */
* { margin:0; padding:0; box-sizing:border-box; -webkit-tap-highlight-color:transparent; }
html,body { width:100%; }
body {
  font-family:-apple-system,"PingFang SC","Microsoft YaHei",sans-serif;
  background:#f2f4f8; color:#1f2937; font-size:15px; line-height:1.5;
}
.page { max-width:640px; margin:0 auto; min-height:100vh; padding-bottom:76px; }

/* 顶部 */
.topbar {
  position:sticky; top:0; z-index:50;
  background:linear-gradient(135deg,#1e3a8a,#2563eb); color:#fff;
  padding:14px 16px; display:flex; align-items:center; justify-content:space-between;
  box-shadow:0 2px 8px rgba(30,58,138,.25);
}
.topbar .title { font-size:17px; font-weight:700; }
.topbar .sub { font-size:11px; opacity:.85; margin-top:1px; }
.topbar .btn {
  background:rgba(255,255,255,.16); border:none; color:#fff;
  padding:7px 12px; border-radius:8px; font-size:13px; cursor:pointer;
}
.topbar .btn:active { background:rgba(255,255,255,.3); }

/* 看板统计 */
.stats-row { display:flex; gap:8px; padding:12px 12px 4px; }
.stat-card {
  flex:1; background:#fff; border-radius:10px; padding:10px;
  box-shadow:0 1px 3px rgba(0,0,0,.06);
}
.stat-card .k { font-size:11px; color:#6b7280; }
.stat-card .v { font-size:17px; font-weight:800; color:#1e3a8a; margin-top:2px; }
.stat-card.income .v { color:#15803d; }
.stat-card.expense .v { color:#b45309; }
.stat-card.warn .v { color:#dc2626; }

/* 卡片列表 */
.list { padding:10px 12px; display:flex; flex-direction:column; gap:10px; }
.card {
  background:#fff; border-radius:12px; padding:13px 14px;
  box-shadow:0 1px 3px rgba(0,0,0,.06); cursor:pointer;
}
.card:active { background:#f8fafc; }
.card .row1 { display:flex; align-items:center; justify-content:space-between; gap:8px; }
.card .name { font-size:16px; font-weight:700; flex:1; }
.card .addr { font-size:12px; color:#6b7280; margin-top:3px; }
.card .meta { display:flex; gap:8px; font-size:12px; color:#6b7280; margin-top:6px; flex-wrap:wrap; }
.badge {
  font-size:11px; padding:2px 8px; border-radius:20px; white-space:nowrap; font-weight:600;
}
.badge.gray { background:#f3f4f6; color:#4b5563; }
.badge.blue { background:#eff6ff; color:#1d4ed8; }
.badge.green { background:#dcfce7; color:#15803d; }
.badge.red { background:#fee2e2; color:#dc2626; }
.badge.orange { background:#ffedd5; color:#c2410c; }
.badge.purple { background:#f3e8ff; color:#7c3aed; }

/* 首页搜索框 */
.searchbar {
  display:flex; gap:8px; padding:10px 12px 0; background:transparent;
}
.searchbar input {
  flex:1; border:1px solid #d1d5db; border-radius:10px; padding:10px 12px;
  font-size:15px; background:#fff; color:#1f2937;
}
.searchbar input:focus { outline:none; border-color:#2563eb; }
.searchbar button {
  border:none; border-radius:10px; background:#2563eb; color:#fff;
  font-size:14px; font-weight:700; padding:0 18px; cursor:pointer;
}

/* 项目台账：在建/已完工切换 */
.ledger-tabs {
  display:flex; gap:8px; padding:12px 12px 0;
}
.ledger-tab {
  flex:1; text-align:center; padding:9px 0; border-radius:10px; cursor:pointer;
  background:#e5e7eb; color:#4b5563; font-size:13px; font-weight:700;
}
.ledger-tab.on { background:#2563eb; color:#fff; }

/* 已完工按类别分组 */
.cat-head {
  padding:14px 14px 0; font-size:14px; font-weight:800; color:#1e3a8a;
}

/* 进度时间线 */
.timeline { padding:14px 14px 4px; position:relative; }
.timeline::before {
  content:''; position:absolute; left:17px; top:8px; bottom:8px;
  width:2px; background:#dbeafe;
}
.tl-item { position:relative; padding:0 0 14px 30px; }
.tl-item::before {
  content:''; position:absolute; left:13px; top:6px;
  width:10px; height:10px; border-radius:50%;
  background:#2563eb; border:2px solid #bfdbfe; box-sizing:border-box;
}
.tl-card {
  background:#fff; border-radius:10px; padding:11px 13px;
  box-shadow:0 1px 3px rgba(0,0,0,.05);
}
.tl-date { font-size:13px; font-weight:800; color:#1e3a8a; }
.tl-body { font-size:13px; color:#374151; margin-top:5px; white-space:pre-wrap; }
.tl-body.plan { color:#15803d; }

/* 日报页 */
.daily-t { font-size:15px; font-weight:800; color:#1e3a8a; margin-bottom:12px; }
.att-panel .btn.primary { margin-top:6px; }

.empty { text-align:center; color:#9ca3af; padding:36px 16px; font-size:13px; }
.empty .big { font-size:15px; color:#6b7280; margin-bottom:4px; }

/* 项目详情头 */
.detail-head {
  background:linear-gradient(135deg,#1e3a8a,#2563eb); color:#fff;
  padding:14px 16px 12px;
}
.detail-head .name { font-size:18px; font-weight:800; }
.detail-head .line { font-size:12px; opacity:.9; margin-top:3px; }
.detail-head .tags { display:flex; gap:6px; margin-top:8px; flex-wrap:wrap; }
.detail-head .tags .badge { background:rgba(255,255,255,.18); color:#fff; }

/* 标签页 */
.tabs {
  position:sticky; top:62px; z-index:40;
  display:flex; background:#fff; border-bottom:1px solid #e5e7eb;
  padding:0 4px;
}
.tabs .tab { flex:1; text-align:center; padding:11px 0; font-size:14px; color:#6b7280; cursor:pointer; border-bottom:2px solid transparent; }
.tabs .tab.on { color:#1d4ed8; font-weight:700; border-bottom-color:#1d4ed8; }

/* 记录条目 */
.rec {
  background:#fff; border-radius:10px; padding:12px 14px; margin:0 12px 10px;
  box-shadow:0 1px 3px rgba(0,0,0,.05);
}
.rec .h { display:flex; justify-content:space-between; align-items:center; font-size:14px; font-weight:700; }
.rec .h .date { color:#6b7280; font-weight:500; font-size:12px; }
.rec .body { font-size:13px; color:#374151; margin-top:6px; white-space:pre-wrap; }
.rec .tags2 { display:flex; gap:6px; margin-top:7px; flex-wrap:wrap; }
.rec .amount { font-size:16px; font-weight:800; }
.rec .amount.in { color:#15803d; }
.rec .amount.out { color:#b45309; }
.rec .del {
  margin-top:8px; background:none; border:none; color:#dc2626; font-size:12px; cursor:pointer; padding:4px 8px 4px 0;
}
.rec .del:active { opacity:.6; }
.rec .ph { display:flex; gap:8px; margin-top:8px; flex-wrap:wrap; }
.rec .ph img { width:72px; height:72px; object-fit:cover; border-radius:8px; border:1px solid #e5e7eb; }
.rec .ph img:active { opacity:.7; }
.rec .meta2 { font-size:11px; color:#9ca3af; margin-top:6px; }

/* 浮动按钮 */
.fab {
  position:fixed; right:18px; bottom:84px; z-index:45;
  width:56px; height:56px; border-radius:50%; border:none; cursor:pointer;
  background:#2563eb; color:#fff; font-size:28px; line-height:1;
  box-shadow:0 4px 14px rgba(37,99,235,.45);
}
.fab:active { transform:scale(.94); }

/* 底部导航 */
.bottom-nav {
  position:fixed; left:0; right:0; bottom:0; z-index:50;
  max-width:640px; margin:0 auto;
  background:#fff; border-top:1px solid #e5e7eb;
  display:flex; padding-bottom:env(safe-area-inset-bottom);
}
.bottom-nav .item { flex:1; text-align:center; padding:9px 0 7px; color:#6b7280; font-size:12px; cursor:pointer; }
.bottom-nav .item.on { color:#1d4ed8; font-weight:700; }
.bottom-nav .item .ico { font-size:18px; line-height:1.2; }

/* 弹层表单 */
.mask {
  position:fixed; inset:0; z-index:80; background:rgba(17,24,39,.5);
  display:flex; align-items:flex-end; justify-content:center;
}
.sheet {
  background:#fff; width:100%; max-width:640px; border-radius:16px 16px 0 0;
  padding:16px 16px calc(20px + env(safe-area-inset-bottom));
  max-height:88vh; overflow-y:auto;
}
.sheet h3 { font-size:16px; font-weight:800; margin-bottom:14px; }
.field { margin-bottom:12px; }
.field label { display:block; font-size:12px; color:#6b7280; margin-bottom:4px; }
.field input[type=text], .field input[type=number], .field input[type=date],
.field input[type=password], .field textarea, .field select {
  width:100%; border:1px solid #d1d5db; border-radius:8px;
  padding:10px 12px; font-size:15px; background:#fff; color:#1f2937;
}
.field textarea { min-height:70px; resize:vertical; }
.field input:focus, .field textarea:focus, .field select:focus { outline:none; border-color:#2563eb; }
.row2 { display:flex; gap:10px; }
.row2 .field { flex:1; }
.btn-row { display:flex; gap:10px; margin-top:16px; }
.btn {
  flex:1; border:none; border-radius:10px; padding:13px; font-size:15px; font-weight:700; cursor:pointer;
}
.btn.primary { background:#2563eb; color:#fff; }
.btn.ghost { background:#f3f4f6; color:#374151; }
.btn.primary:active { background:#1d4ed8; }
.btn.ghost:active { background:#e5e7eb; }
.btn.danger { background:#dc2626; color:#fff; }
.file-hint { font-size:11px; color:#9ca3af; margin-top:4px; }
.preview-imgs { display:flex; gap:8px; flex-wrap:wrap; margin-top:8px; }
.preview-imgs img { width:64px; height:64px; object-fit:cover; border-radius:8px; }

/* 全屏看图 */
.viewer {
  position:fixed; inset:0; z-index:90; background:rgba(0,0,0,.92);
  display:flex; align-items:center; justify-content:center;
}
.viewer img { max-width:100%; max-height:100%; }
.viewer .close { position:fixed; top:16px; right:16px; color:#fff; font-size:26px; background:none; border:none; cursor:pointer; padding:8px; }

/* 提示条 */
.toast {
  position:fixed; left:50%; top:20%; transform:translateX(-50%); z-index:99;
  background:rgba(17,24,39,.9); color:#fff; font-size:13px;
  padding:10px 18px; border-radius:10px; max-width:80%; text-align:center;
  display:none;
}

/* 登录页 */
.login-wrap { min-height:100vh; display:flex; flex-direction:column; align-items:center; justify-content:center; padding:30px 24px; background:linear-gradient(160deg,#1e3a8a 0%,#2563eb 60%,#3b82f6 100%); }
.login-box { width:100%; max-width:360px; background:#fff; border-radius:16px; padding:26px 22px; box-shadow:0 10px 30px rgba(0,0,0,.2); }
.login-box .logo { text-align:center; margin-bottom:20px; }
.login-box .logo .t { font-size:20px; font-weight:800; color:#1e3a8a; }
.login-box .logo .s { font-size:12px; color:#6b7280; margin-top:4px; }
.login-box .field input { background:#f9fafb; }
.login-tip { color:#94a3b8; font-size:12px; text-align:center; margin-top:16px; }

/* 用户菜单 */
.menu { position:absolute; top:calc(100% + 6px); right:12px; background:#fff; border-radius:10px; box-shadow:0 6px 20px rgba(0,0,0,.15); overflow:hidden; z-index:60; min-width:150px; }
.menu .mi { padding:12px 16px; font-size:14px; color:#374151; cursor:pointer; display:block; width:100%; background:none; border:none; text-align:left; }
.menu .mi:active { background:#f3f4f6; }
.menu .mi.red { color:#dc2626; }

/* 列表操作条 */
.opbar { display:flex; gap:8px; padding:10px 12px 2px; }
.opbar .btn { flex:1; padding:10px; font-size:13px; }

/* 小提示 */
.note { font-size:12px; color:#9ca3af; padding:4px 14px; }

/* 首页分区标题 */
.sec-title {
  padding:14px 14px 2px; font-size:14px; font-weight:800; color:#1f2937;
  display:flex; align-items:baseline; gap:8px;
}
.sec-title .sec-sub { font-size:11px; color:#9ca3af; font-weight:500; }

/* 考勤页 */
.att-panel { background:#fff; border-radius:12px; margin:10px 12px; padding:12px 14px; box-shadow:0 1px 3px rgba(0,0,0,.06); }
.att-note { font-size:11px; color:#9ca3af; margin-top:4px; }
.period-row { display:flex; gap:10px; }
.period-btn {
  flex:1; text-align:center; padding:11px 0; border-radius:10px; font-size:15px; font-weight:700; cursor:pointer;
  background:#f3f4f6; color:#374151; border:1px solid #e5e7eb;
}
.period-btn.on { background:#2563eb; color:#fff; border-color:#2563eb; }
.worker-group-title { font-size:12px; color:#6b7280; font-weight:700; padding:10px 14px 2px; }
.worker-row { display:flex; align-items:center; justify-content:space-between; gap:8px; cursor:pointer; }
.worker-row .worker-main { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.worker-row .worker-name { font-size:15px; font-weight:700; }
.worker-row .worker-phone { font-size:11px; color:#9ca3af; font-weight:500; }
.att-check { display:flex; align-items:center; gap:5px; font-size:13px; color:#6b7280; white-space:nowrap; }
.att-check input { width:18px; height:18px; accent-color:#2563eb; }

/* 工人档案弹层 */
.w-info { display:flex; flex-wrap:wrap; gap:6px 14px; font-size:13px; color:#374151; background:#f8fafc; border-radius:10px; padding:10px 12px; margin-bottom:10px; }
.w-info span { white-space:nowrap; }

/* 付款分组 */
.pay-group-head {
  background:#fff; border-radius:10px; padding:10px 14px; margin-bottom:8px;
  font-size:13px; color:#374151; box-shadow:0 1px 3px rgba(0,0,0,.05);
  display:flex; justify-content:space-between; align-items:center;
}
.pay-group-head b { color:#b45309; font-size:15px; }
