:root {
  --primary: #2f7cf6;
  --primary-d: #1c63d6;
  --ok: #18a058;
  --warn: #e8833a;
  --err: #d03050;
  --bg: #f5f6f8;
  --card: #ffffff;
  --text: #1f2329;
  --sub: #8a909a;
  --line: #ebedf0;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
}

.app { max-width: 480px; margin: 0 auto; min-height: 100vh; position: relative; }
.topbar {
  background: var(--primary);
  color: #fff;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar h1 { font-size: 17px; margin: 0; font-weight: 600; }
.topbar .right { font-size: 13px; opacity: .9; }

.hidden { display: none !important; }

/* 卡片 */
.card {
  background: var(--card);
  border-radius: 12px;
  margin: 12px;
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.card h2 { font-size: 15px; margin: 0 0 12px; }

/* 表单 */
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 13px; color: var(--sub); margin-bottom: 6px; }
.field input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  font-size: 15px;
  outline: none;
  background: #fafbfc;
}
.field input:focus { border-color: var(--primary); background: #fff; }
.face-preview { display: block; width: 100%; max-width: 220px; margin-top: 8px; border-radius: 10px; border: 1px solid var(--line); }

.btn {
  display: block;
  width: 100%;
  border: none;
  border-radius: 8px;
  padding: 12px;
  font-size: 15px;
  font-weight: 600;
  background: var(--primary);
  color: #fff;
  cursor: pointer;
}
.btn:active { background: var(--primary-d); }
.btn.ghost { background: #eef3ff; color: var(--primary); }
.btn.ok { background: var(--ok); }
.btn:disabled { background: #c9cdd4; cursor: not-allowed; }

.tabs { display: flex; gap: 8px; margin-bottom: 14px; }
.tabs .tab {
  flex: 1; text-align: center; padding: 9px; border-radius: 8px;
  background: #eef0f3; color: var(--sub); cursor: pointer; font-size: 14px;
}
.tabs .tab.active { background: var(--primary); color: #fff; }

/* 地图 */
#map { width: 100%; height: 260px; border-radius: 12px; overflow: hidden; }
.loc-status {
  margin: 12px 12px 0; padding: 12px 14px; border-radius: 10px; font-size: 14px;
  display: flex; align-items: center; gap: 8px; font-weight: 600;
}
.loc-status.ok { background: #e8f7ee; color: var(--ok); }
.loc-status.err { background: #fdecec; color: var(--err); }
.loc-status .dot { width: 9px; height: 9px; border-radius: 50%; background: currentColor; }

.addr-box { font-size: 12px; color: var(--sub); margin: 8px 12px 0; word-break: break-all; }

/* 打卡按钮区 */
.checkin-wrap { padding: 14px 12px 0; }
.checkin-btn {
  height: 88px; border-radius: 16px; font-size: 20px; font-weight: 700;
  background: linear-gradient(135deg,#2f7cf6,#5a9bff); color:#fff; border:none; width:100%;
  box-shadow: 0 6px 16px rgba(47,124,246,.35);
}
.checkin-btn:disabled { background: #c9cdd4; box-shadow: none; }

/* 记录列表 */
.record {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 14px;
}
.record:last-child { border-bottom: none; }
.record .time { color: var(--sub); font-size: 12px; }
.tag { font-size: 11px; padding: 2px 7px; border-radius: 6px; }
.tag.ok { background:#e8f7ee; color:var(--ok); }
.tag.no { background:#fdecec; color:var(--err); }

/* 弹窗 */
.mask {
  position: fixed; inset: 0; background: rgba(0,0,0,.45);
  display: flex; align-items: center; justify-content: center; z-index: 50; padding: 24px;
}
.modal {
  background: #fff; border-radius: 14px; width: 100%; max-width: 340px; padding: 20px;
}
.modal h3 { margin: 0 0 12px; font-size: 16px; }
.modal p { color: var(--sub); font-size: 14px; margin: 6px 0; }
.modal .actions { margin-top: 16px; display: flex; gap: 10px; }
.modal .actions .btn { margin: 0; }

.toast {
  position: fixed; left: 50%; top: 40%; transform: translate(-50%,-50%);
  background: rgba(0,0,0,.82); color:#fff; padding: 12px 18px; border-radius: 10px;
  font-size: 14px; z-index: 99; max-width: 80%; text-align: center;
}

.spinner {
  width: 22px; height: 22px; border: 3px solid rgba(255,255,255,.4);
  border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite; display:inline-block; vertical-align:middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* 登录页底部客服电话：固定底部居中 */
.footer-info {
  position: fixed; left: 0; right: 0; bottom: 14px;
  text-align: center; color: var(--sub); font-size: 13px;
  padding: 8px 12px; z-index: 15;
}
.footer-info a { color: var(--primary); text-decoration: none; }
