/* 公共样式：入口页、登录页、弹窗、Toast、按钮、表单 */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  color: #1f2937;
  background: #f3f5f9;
}
a { text-decoration: none; color: inherit; }
button { font-family: inherit; cursor: pointer; border: none; outline: none; }
input, select, textarea {
  font-family: inherit; font-size: 14px; padding: 9px 12px;
  border: 1px solid #d7dce5; border-radius: 8px; outline: none; width: 100%;
  background: #fff; transition: border-color .2s;
}
input:focus, select:focus, textarea:focus { border-color: #4f7cff; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 18px; border-radius: 8px; font-size: 14px; transition: all .2s;
}
.btn-primary { background: #4f7cff; color: #fff; }
.btn-primary:hover { background: #3b66e8; }
.btn-plain { background: #eef1f7; color: #4b5563; }
.btn-plain:hover { background: #e2e7f1; }
.btn-danger { background: #ef6a6e; color: #fff; }
.btn-danger:hover { background: #e05256; }
.btn-sm { padding: 5px 12px; font-size: 13px; border-radius: 6px; }

/* ---------- 入口页 ---------- */
.entry-wrap {
  min-height: 100%; display: flex; flex-direction: column;
  align-items: center; justify-content: center; padding: 24px;
  background: linear-gradient(135deg, #4f7cff 0%, #6a5cff 50%, #9b6bff 100%);
}
.entry-logo { font-size: 34px; font-weight: 700; color: #fff; letter-spacing: 2px; }
.entry-sub { color: rgba(255,255,255,.85); margin: 10px 0 40px; font-size: 15px; }
.entry-cards { display: flex; gap: 28px; flex-wrap: wrap; justify-content: center; }
.entry-card {
  width: 240px; background: #fff; border-radius: 18px; padding: 36px 24px;
  text-align: center; cursor: pointer; box-shadow: 0 18px 40px rgba(20, 30, 80, .25);
  transition: transform .25s, box-shadow .25s;
}
.entry-card:hover { transform: translateY(-8px); box-shadow: 0 26px 50px rgba(20, 30, 80, .35); }
.entry-card svg { width: 72px; height: 72px; }
.entry-card h3 { margin: 16px 0 6px; font-size: 20px; }
.entry-card p { color: #8a93a6; font-size: 13px; }

/* ---------- 登录页 ---------- */
.login-wrap {
  min-height: 100%; display: flex; align-items: center; justify-content: center; padding: 24px;
  background: linear-gradient(135deg, #4f7cff 0%, #6a5cff 50%, #9b6bff 100%);
}
.login-box {
  width: 380px; max-width: 100%; background: #fff; border-radius: 18px;
  padding: 36px 34px; box-shadow: 0 18px 50px rgba(20, 30, 80, .3);
}
.login-box h1 { font-size: 22px; text-align: center; }
.login-box .login-tip { text-align: center; color: #8a93a6; font-size: 13px; margin: 8px 0 26px; }
.form-item { margin-bottom: 16px; }
.form-item label { display: block; font-size: 13px; color: #6b7280; margin-bottom: 6px; }
.login-btn { width: 100%; padding: 11px; font-size: 15px; margin-top: 6px; }
.login-back { display: block; text-align: center; margin-top: 18px; font-size: 13px; color: #8a93a6; }
.login-back:hover { color: #4f7cff; }
.login-err { color: #ef6a6e; font-size: 13px; text-align: center; min-height: 18px; margin-bottom: 8px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; top: 18%; transform: translate(-50%, -16px);
  background: rgba(17, 24, 39, .88); color: #fff; padding: 11px 22px;
  border-radius: 10px; font-size: 14px; z-index: 1000; opacity: 0;
  transition: all .3s; pointer-events: none; max-width: 80vw; text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 模态框 ---------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(15, 23, 42, .45);
  display: flex; align-items: center; justify-content: center; z-index: 900; padding: 20px;
}
.modal {
  background: #fff; border-radius: 14px; width: 520px; max-width: 100%;
  max-height: 86vh; display: flex; flex-direction: column;
  animation: pop .22s ease;
}
@keyframes pop { from { transform: scale(.94); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 20px; font-size: 16px; font-weight: 600; border-bottom: 1px solid #eef1f6;
}
.modal-x { cursor: pointer; color: #9ca3af; font-size: 22px; line-height: 1; }
.modal-x:hover { color: #374151; }
.modal-body { padding: 18px 20px; overflow-y: auto; }
.modal-foot { padding: 14px 20px; border-top: 1px solid #eef1f6; display: flex; justify-content: flex-end; gap: 10px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.form-grid .full { grid-column: 1 / -1; }

/* ---------- 空状态 ---------- */
.empty { text-align: center; color: #9ca3af; padding: 40px 0; font-size: 14px; }

/* ---------- 滚动条 ---------- */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #cdd4e0; border-radius: 4px; }
::-webkit-scrollbar-track { background: transparent; }

@media (max-width: 480px) {
  .form-grid { grid-template-columns: 1fr; }
  .login-box { padding: 30px 24px; }
}

/* ---------- 打卡机按钮 ---------- */
.clock-panel { text-align: center; padding: 10px 0 4px; }
.clock-time { font-size: 30px; font-weight: 700; font-family: Consolas, monospace; }
.clock-date { color: #8a93a6; font-size: 13px; margin: 4px 0 14px; }
.clock-emp { max-width: 280px; margin: 0 auto 16px; }
.clock-btns { display: flex; gap: 14px; justify-content: center; }
.clock-btn {
  width: 130px; height: 130px; border-radius: 50%; font-size: 17px; font-weight: 700;
  color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  transition: transform .15s; border: 6px solid rgba(255,255,255,.5);
  box-shadow: 0 8px 20px rgba(20,30,60,.18);
}
.clock-btn small { font-size: 12px; font-weight: 400; opacity: .9; }
.clock-btn:active { transform: scale(.94); }
.clock-btn.in { background: #36c48d; }
.clock-btn.out { background: #ef6a6e; }
.clock-btn[disabled] { background: #c3c9d6; cursor: not-allowed; box-shadow: none; }
.clock-status { margin-top: 14px; font-size: 14px; color: #4b5563; }
.clock-status b { font-family: Consolas, monospace; }

/* ---------- 打印小票 ---------- */
.print-area { display: none; }
@media print {
  body.printing > *:not(.print-area) { display: none !important; }
  body.printing .print-area { display: block !important; }
}
.receipt {
  width: 76mm; margin: 0 auto; padding: 8mm 4mm; font-family: "Courier New", monospace;
  font-size: 12px; color: #000;
}
.receipt .r-title { text-align: center; font-size: 16px; font-weight: 700; letter-spacing: 2px; }
.receipt .r-sub { text-align: center; font-size: 11px; margin: 2px 0 8px; }
.receipt .r-line { border-top: 1px dashed #000; margin: 6px 0; }
.receipt table { width: 100%; border-collapse: collapse; }
.receipt td { padding: 3px 0; font-size: 12px; }
.receipt td:last-child { text-align: right; }
.receipt .r-big { font-size: 18px; font-weight: 700; }
.receipt .r-center { text-align: center; }
.receipt .r-foot { text-align: center; margin-top: 8px; font-size: 11px; }
