/* ============ 门店员工工具系统 样式 ============ */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --primary: #3370ff;
  --primary-dark: #2860e0;
  --primary-light: #e8f0ff;
  --success: #34c759;
  --warning: #ff9500;
  --danger: #ff3b30;
  --text: #1f2329;
  --text-light: #8f959e;
  --bg: #f5f6f8;
  --card: #ffffff;
  --border: #eceef1;
  --radius: 12px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue",
    "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

/* ============ 登录页 ============ */
#loginPage {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #3370ff 0%, #6f9bff 100%);
  padding: 24px;
}
.login-box {
  background: var(--card);
  border-radius: 20px;
  padding: 40px 32px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.logo {
  font-size: 34px;
  font-weight: 800;
  color: var(--primary);
  text-align: center;
  letter-spacing: 1px;
}
.logo span { color: var(--text); }
.subtitle {
  text-align: center;
  color: var(--text-light);
  font-size: 13px;
  margin: 8px 0 28px;
  letter-spacing: 2px;
}
.login-box input {
  width: 100%;
  padding: 14px 16px;
  margin-bottom: 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 15px;
  outline: none;
  transition: border-color .2s;
}
.login-box input:focus { border-color: var(--primary); }
.btn-primary {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: var(--radius);
  background: var(--primary);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s;
}
.btn-primary:hover { background: var(--primary-dark); }
.error { color: var(--danger); font-size: 13px; margin-top: 10px; text-align: center; min-height: 18px; }
.hint { text-align: center; color: var(--text-light); font-size: 12px; margin-top: 14px; }

/* ============ 主应用布局 ============ */
#app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar-title { font-weight: 700; font-size: 17px; }
.role-badge {
  background: var(--primary-light);
  color: var(--primary);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}
.btn-ghost {
  background: none;
  border: none;
  color: var(--text-light);
  font-size: 14px;
  cursor: pointer;
  padding: 6px;
}
.content {
  flex: 1;
  padding: 16px;
  padding-bottom: 80px;
  max-width: 640px;
  width: 100%;
  margin: 0 auto;
}

/* 底部导航 */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--card);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-around;
  padding: 6px 0 calc(6px + env(safe-area-inset-bottom));
  z-index: 20;
  max-width: 640px;
  margin: 0 auto;
}
.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 11px;
  color: var(--text-light);
  cursor: pointer;
  padding: 4px 6px;
  transition: color .2s;
}
.nav-item.active { color: var(--primary); font-weight: 600; }
.nav-icon { font-size: 22px; margin-bottom: 2px; }

/* ============ 卡片 ============ */
.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.card-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-title .sub { font-size: 12px; color: var(--text-light); font-weight: 400; }

/* 统计块 */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}
.stat-item {
  background: var(--card);
  border-radius: var(--radius);
  padding: 14px 10px;
  text-align: center;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.stat-item .num { font-size: 24px; font-weight: 800; color: var(--primary); }
.stat-item .label { font-size: 12px; color: var(--text-light); margin-top: 4px; }
.stat-item.warn .num { color: var(--warning); }

/* 打卡大按钮 */
.punch-card {
  text-align: center;
  padding: 24px 16px;
}
.punch-time { font-size: 40px; font-weight: 800; letter-spacing: 1px; margin: 8px 0; }
.punch-status { color: var(--text-light); font-size: 13px; margin-bottom: 16px; }
.punch-buttons { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.btn-in, .btn-out {
  padding: 14px 32px;
  border: none;
  border-radius: 30px;
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
}
.btn-in { background: var(--primary); box-shadow: 0 6px 16px rgba(51,112,255,0.3); }
.btn-out { background: var(--success); box-shadow: 0 6px 16px rgba(52,199,89,0.3); }
.btn-in:active, .btn-out:active { transform: scale(0.95); }

/* 列表 */
.list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.list-item:last-child { border-bottom: none; }
.list-item .li-left { flex: 1; }
.list-item .li-title { font-size: 14px; font-weight: 600; }
.list-item .li-sub { font-size: 12px; color: var(--text-light); margin-top: 3px; }

/* 标签 */
.tag {
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  flex-shrink: 0;
}
.tag-blue { background: var(--primary-light); color: var(--primary); }
.tag-green { background: #e6f9ec; color: var(--success); }
.tag-orange { background: #fff3e0; color: var(--warning); }
.tag-red { background: #ffeceb; color: var(--danger); }
.tag-gray { background: #f0f1f3; color: var(--text-light); }

/* 按钮 */
.btn {
  padding: 8px 16px;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  font-weight: 500;
}
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-block { width: 100%; padding: 12px; }
.btn-blue { background: var(--primary); color: #fff; }
.btn-green { background: var(--success); color: #fff; }
.btn-orange { background: var(--warning); color: #fff; }
.btn-red { background: var(--danger); color: #fff; }
.btn-gray { background: #f0f1f3; color: var(--text); }
.btn-outline { background: none; border: 1.5px solid var(--primary); color: var(--primary); }

/* 输入 & 表单 */
.input, .select, .textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  outline: none;
  margin-bottom: 12px;
  background: var(--card);
  font-family: inherit;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--primary); }
.textarea { min-height: 80px; resize: vertical; }
label { font-size: 13px; color: var(--text-light); display: block; margin-bottom: 6px; }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; }

/* 弹窗 */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 100;
}
.modal {
  background: var(--card);
  width: 100%;
  max-width: 640px;
  max-height: 85vh;
  overflow-y: auto;
  border-radius: 20px 20px 0 0;
  padding: 24px 20px calc(24px + env(safe-area-inset-bottom));
  animation: slideUp .25s ease;
}
@keyframes slideUp { from { transform: translateY(40px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.modal-title { font-size: 17px; font-weight: 700; margin-bottom: 16px; text-align: center; }

/* 进度条 */
.progress {
  background: var(--border);
  border-radius: 20px;
  height: 8px;
  overflow: hidden;
  margin-top: 6px;
}
.progress-fill {
  background: var(--primary);
  height: 100%;
  border-radius: 20px;
  transition: width .3s;
}

/* 其他 */
.empty { text-align: center; color: var(--text-light); padding: 30px 0; font-size: 14px; }
.section-title { font-size: 13px; color: var(--text-light); margin: 16px 0 10px; font-weight: 600; }
.toast {
  position: fixed;
  top: 60px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.75);
  color: #fff;
  padding: 10px 20px;
  border-radius: 20px;
  font-size: 14px;
  z-index: 200;
  opacity: 0;
  transition: opacity .3s;
  pointer-events: none;
  white-space: nowrap;
}
.toast.show { opacity: 1; }
.divider { height: 1px; background: var(--border); margin: 14px 0; }
.menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--card);
  border-radius: var(--radius);
  margin-bottom: 10px;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.menu-item .mi-left { display: flex; align-items: center; gap: 12px; }
.menu-item .mi-icon { font-size: 20px; }
.menu-item .mi-title { font-size: 15px; font-weight: 600; }
.menu-item .mi-arrow { color: var(--text-light); }

/* ============ 飞书登录 ============ */
.feishu-login { margin-top: 14px; }
.divider {
  display: flex; align-items: center; gap: 10px;
  color: var(--text-light); font-size: 12px; margin: 14px 0;
}
.divider::before, .divider::after {
  content: ""; flex: 1; height: 1px; background: #e5e6eb;
}
.btn-feishu {
  width: 100%; padding: 12px; border: none; border-radius: var(--radius);
  background: linear-gradient(135deg, #3370ff, #2b5ce6);
  color: #fff; font-size: 15px; font-weight: 600; cursor: pointer;
}
.btn-feishu:active { opacity: 0.85; }
#feishuTip { margin-top: 8px; font-size: 12px; }
