/* ============================================================
   员工端移动端样式（独立于管理端 app.css）
   ============================================================ */
:root {
  --brand: #4f7cff;
  --brand-2: #6d5bff;
  --brand-grad: linear-gradient(135deg, #4f7cff 0%, #6d5bff 100%);
  --ink: #17233d;
  --ink-2: #5b6b87;
  --ink-3: #93a0b8;
  --bg: #f3f5fa;
  --card: #ffffff;
  --line: #e9edf5;
  --fill: #f2f4f9;
  --danger: #f0454d;
  --ok: #22b268;
  --warn: #e8930c;
  --r-lg: 22px;
  --r-md: 16px;
  --r-sm: 12px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "HarmonyOS Sans SC", "MiSans", "Segoe UI", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
.boot { text-align: center; color: var(--ink-3); padding: 80px 0; }
button { font-family: inherit; }

/* ---------------- 页面骨架 ---------------- */
.m-page { min-height: 100vh; padding-bottom: calc(104px + env(safe-area-inset-bottom)); }

/* 顶部渐变头图 */
.m-hero {
  background: var(--brand-grad);
  padding: calc(26px + env(safe-area-inset-top)) 20px 62px;
  color: #fff;
  border-radius: 0 0 28px 28px;
  position: relative;
  overflow: hidden;
}
.m-hero::before {
  content: ""; position: absolute; right: -40px; top: -60px;
  width: 190px; height: 190px; border-radius: 50%;
  background: rgba(255, 255, 255, .12);
}
.m-hero::after {
  content: ""; position: absolute; right: 36px; bottom: -70px;
  width: 130px; height: 130px; border-radius: 50%;
  background: rgba(255, 255, 255, .09);
}
.m-logo {
  width: 52px; height: 52px; border-radius: 16px;
  background: rgba(255, 255, 255, .18);
  backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 14px;
}
.m-logo svg { width: 26px; height: 26px; }
.m-hero-title { font-size: 22px; font-weight: 700; letter-spacing: .5px; }
.m-hero-sub { font-size: 13px; opacity: .85; margin-top: 2px; }

.m-body { padding: 0 16px; margin-top: -40px; position: relative; z-index: 1; }

/* ---------------- 卡片 ---------------- */
.m-card {
  background: var(--card);
  border-radius: var(--r-lg);
  padding: 20px 18px;
  box-shadow: 0 10px 34px rgba(23, 43, 99, .07);
  margin-bottom: 14px;
  animation: rise .35s ease both;
}
.m-card.tight { padding: 16px; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }

.m-title { font-size: 17px; font-weight: 700; margin: 0 0 4px; }
.m-desc { font-size: 12.5px; color: var(--ink-3); margin: 0 0 14px; }

/* ---------------- 分段控件 ---------------- */
.m-seg {
  display: flex; background: #e8ecf5; border-radius: 13px; padding: 4px; margin-bottom: 14px;
}
.m-seg-item {
  flex: 1; border: none; background: none; padding: 9px 0;
  font-size: 14px; color: var(--ink-2); border-radius: 10px; cursor: pointer;
  transition: all .2s; font-weight: 500;
}
.m-seg-item.active {
  background: #fff; color: var(--ink); font-weight: 600;
  box-shadow: 0 2px 8px rgba(23, 43, 99, .12);
}

/* ---------------- 表单 ---------------- */
.m-field { margin-bottom: 13px; }
.m-field label { display: block; font-size: 12.5px; color: var(--ink-2); margin: 0 2px 6px; }
.m-inwrap {
  display: flex; align-items: center; gap: 10px;
  background: var(--fill); border-radius: var(--r-sm);
  padding: 0 14px; height: 48px;
  border: 1.5px solid transparent; transition: all .18s;
}
.m-inwrap:focus-within {
  border-color: var(--brand); background: #fff;
  box-shadow: 0 0 0 3.5px rgba(79, 124, 255, .13);
}
.m-inwrap svg { width: 18px; height: 18px; flex-shrink: 0; color: var(--ink-3); }
.m-inwrap:focus-within svg { color: var(--brand); }
.m-inwrap input {
  flex: 1; border: none; outline: none; background: none;
  font-size: 15.5px; color: var(--ink); min-width: 0; height: 100%;
}
.m-inwrap input::placeholder { color: var(--ink-3); }

/* ---------------- 按钮 ---------------- */
.m-btn {
  width: 100%; height: 50px; border: none; border-radius: 15px;
  background: var(--brand-grad); color: #fff; font-size: 16px; font-weight: 600;
  letter-spacing: 2px; cursor: pointer;
  box-shadow: 0 8px 20px rgba(79, 124, 255, .32);
  transition: transform .15s, box-shadow .15s, opacity .15s;
}
.m-btn:active { transform: scale(.975); box-shadow: 0 4px 12px rgba(79, 124, 255, .3); }
.m-btn:disabled { opacity: .5; }
.m-btn-ghost {
  width: 100%; height: 46px; border: 1.5px solid var(--line); border-radius: 14px;
  background: #fff; color: var(--ink-2); font-size: 14.5px; cursor: pointer; font-weight: 500;
}
.m-btn-ghost:active { background: var(--fill); }
.m-btn-sm {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 7px 14px; border-radius: 10px; border: none; cursor: pointer;
  font-size: 13px; font-weight: 500;
  background: rgba(79, 124, 255, .1); color: var(--brand);
}
.m-btn-sm.danger { background: rgba(240, 69, 77, .1); color: var(--danger); }
.m-footnote { text-align: center; font-size: 12px; color: var(--ink-3); margin-top: 4px; }

/* ---------------- 状态徽标 / 提示条 ---------------- */
.m-badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 600; padding: 4px 12px; border-radius: 999px;
}
.m-badge.pending { background: #fff4dd; color: #b26d00; }
.m-badge.approved { background: #e0f7ea; color: #0d8a4e; }
.m-badge.rejected { background: #ffe5e6; color: #d2343c; }
.m-badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.m-alert {
  display: flex; gap: 9px; align-items: flex-start;
  border-radius: var(--r-sm); padding: 11px 13px; font-size: 13px; margin-bottom: 14px;
  line-height: 1.55;
}
.m-alert svg { width: 17px; height: 17px; flex-shrink: 0; margin-top: 2px; }
.m-alert.info { background: #ecf1ff; color: #3457c9; }
.m-alert.error { background: #ffecec; color: #c53035; }
.m-alert.warn { background: #fff4dd; color: #a06a00; }

/* ---------------- 状态页（待审核） ---------------- */
.m-status-hero { text-align: center; padding: 10px 0 4px; }
.m-status-icon {
  width: 74px; height: 74px; margin: 6px auto 14px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #ecf1ff, #f3efff); color: var(--brand);
  position: relative;
}
.m-status-icon svg { width: 34px; height: 34px; }
.m-status-icon.ok { background: linear-gradient(135deg, #e0f7ea, #eefcf3); color: var(--ok); }
.m-status-icon.err { background: linear-gradient(135deg, #ffecec, #fff4f4); color: var(--danger); }
.m-status-icon::after {
  content: ""; position: absolute; inset: -8px; border-radius: 50%;
  border: 1.5px dashed rgba(79, 124, 255, .35);
  animation: spin 14s linear infinite;
}
.m-status-icon.ok::after { border-color: rgba(34, 178, 104, .3); }
.m-status-icon.err::after { border-color: rgba(240, 69, 77, .25); animation-duration: 30s; }
@keyframes spin { to { transform: rotate(360deg); } }
.m-status-title { font-size: 18px; font-weight: 700; margin: 0 0 6px; }
.m-status-sub { font-size: 13px; color: var(--ink-3); margin: 0 0 16px; }

.m-info-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 11px 2px; border-bottom: 1px solid var(--line); font-size: 14px;
}
.m-info-row:last-child { border-bottom: none; }
.m-info-row .k { color: var(--ink-3); font-size: 13px; }
.m-info-row .v { font-weight: 500; }

/* ---------------- 统计卡 ---------------- */
.m-stat-card {
  background: var(--brand-grad); color: #fff;
  border-radius: var(--r-lg); padding: 18px;
  box-shadow: 0 10px 26px rgba(79, 124, 255, .28);
  margin-bottom: 14px; animation: rise .35s ease both;
  position: relative; overflow: hidden;
}
.m-stat-card::after {
  content: ""; position: absolute; right: -30px; top: -40px;
  width: 130px; height: 130px; border-radius: 50%; background: rgba(255, 255, 255, .1);
}
.m-stat-hi { font-size: 15px; font-weight: 700; }
.m-stat-sub { font-size: 12px; opacity: .82; margin-top: 1px; }
.m-stat-num { display: flex; align-items: baseline; gap: 5px; margin: 12px 0 10px; }
.m-stat-num b { font-size: 30px; font-weight: 700; line-height: 1; }
.m-stat-num span { font-size: 13px; opacity: .8; }
.m-progress {
  height: 7px; background: rgba(255, 255, 255, .22); border-radius: 999px; overflow: hidden;
}
.m-progress > div {
  height: 100%; border-radius: 999px; width: 0;
  background: linear-gradient(90deg, #aef4cd, #6ef0ff);
  transition: width .5s ease;
}

/* ---------------- 上传 ---------------- */
.m-upzone {
  border: 1.8px dashed rgba(79, 124, 255, .5);
  background: linear-gradient(180deg, #f6f9ff, #edf3ff);
  border-radius: 18px;
  padding: 26px 16px; text-align: center; cursor: pointer; transition: all .18s;
  color: var(--ink-2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8), 0 4px 14px rgba(79, 124, 255, .08);
}
.m-upzone:active { background: #e8efff; border-color: var(--brand); transform: scale(.99); }
.m-upzone .ico {
  width: 52px; height: 52px; margin: 0 auto 10px; border-radius: 17px;
  background: var(--brand-grad); color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 14px rgba(79, 124, 255, .35);
}
.m-upzone .ico svg { width: 25px; height: 25px; }
.m-upzone .big { font-size: 15.5px; font-weight: 700; color: var(--ink); }
.m-upzone .big em { font-style: normal; color: var(--brand); }
.m-upzone .hint { font-size: 12px; color: var(--ink-3); margin-top: 3px; }

/* 底部悬浮上传按钮 */
.m-fab-wrap {
  position: fixed; left: 16px; right: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom));
  z-index: 30; max-width: 398px; margin: 0 auto;
}
.m-fab-wrap::before {
  content: ""; position: absolute; left: 0; right: 0; top: -30px; bottom: -6px;
  background: linear-gradient(transparent, var(--bg) 62%);
  pointer-events: none; z-index: -1;
}
.m-fab {
  width: 100%; height: 56px; border: none; border-radius: 18px;
  background: var(--brand-grad); color: #fff;
  font-size: 17px; font-weight: 700; letter-spacing: 1px;
  display: flex; align-items: center; justify-content: center; gap: 9px;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(79, 124, 255, .45), inset 0 1px 0 rgba(255, 255, 255, .25);
  transition: transform .15s, box-shadow .15s;
}
.m-fab:active { transform: scale(.97); box-shadow: 0 6px 16px rgba(79, 124, 255, .4); }
.m-fab svg { width: 23px; height: 23px; }

.m-yearrow { display: flex; align-items: center; gap: 10px; margin-bottom: 13px; }
.m-yearrow label { font-size: 13px; color: var(--ink-2); }
.m-yearsel {
  flex: 1; height: 42px; border: none; border-radius: 12px;
  background-color: var(--fill); color: var(--ink);
  padding: 0 34px 0 14px; font-size: 16px; font-weight: 700; outline: none;
  appearance: none; -webkit-appearance: none;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="10" height="6"><path d="M1 1l4 4 4-4" stroke="%239aa3b8" stroke-width="1.5" fill="none" stroke-linecap="round"/></svg>');
  background-repeat: no-repeat; background-position: right 14px center;
}

.m-queue { margin-top: 13px; }
.m-qitem {
  display: flex; align-items: center; gap: 10px; padding: 9px 2px;
  border-bottom: 1px dashed var(--line); font-size: 13px;
  animation: rise .25s ease both;
}
.m-qitem:last-child { border-bottom: none; }
.m-qitem .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-qitem .st { color: var(--ink-3); font-size: 12px; flex-shrink: 0; }
.m-qitem .st.done { color: var(--ok); font-weight: 600; }
.m-qitem .st.fail { color: var(--danger); }
.m-pbar { width: 64px; height: 5px; background: #e8edf5; border-radius: 999px; overflow: hidden; flex-shrink: 0; }
.m-pbar > div { height: 100%; background: var(--brand-grad); width: 0; transition: width .2s; border-radius: 999px; }

/* ---------------- 相册 ---------------- */
.m-chips {
  display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 10px;
  scrollbar-width: none;
}
.m-chips::-webkit-scrollbar { display: none; }
.m-chip {
  flex-shrink: 0; padding: 7px 16px; border-radius: 999px; border: none;
  background: #fff; color: var(--ink-2); font-size: 13.5px; cursor: pointer;
  box-shadow: 0 1px 4px rgba(23, 43, 99, .07); font-weight: 500; transition: all .18s;
}
.m-chip.active { background: var(--brand-grad); color: #fff; font-weight: 600; box-shadow: 0 4px 12px rgba(79, 124, 255, .3); }

.m-datehead {
  display: flex; align-items: baseline; gap: 8px; margin: 16px 2px 9px;
}
.m-datehead .d { font-size: 14.5px; font-weight: 700; }
.m-datehead .n { font-size: 12px; color: var(--ink-3); }

.m-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.m-cell {
  position: relative; aspect-ratio: 1; border-radius: 13px; overflow: hidden;
  background: #e9edf5; cursor: zoom-in;
  animation: rise .3s ease both;
}
.m-cell img { width: 100%; height: 100%; object-fit: cover; display: block; }
.m-cell .del {
  position: absolute; top: 5px; right: 5px; width: 24px; height: 24px; border-radius: 50%;
  background: rgba(23, 35, 61, .5); color: #fff; border: none; cursor: pointer;
  font-size: 14px; line-height: 22px; padding: 0; backdrop-filter: blur(3px);
}
.m-cell .del:active { background: var(--danger); }

.m-empty { text-align: center; padding: 34px 0 22px; color: var(--ink-3); }
.m-empty svg { width: 56px; height: 56px; opacity: .5; margin-bottom: 8px; }
.m-empty .t { font-size: 13.5px; }

/* ---------------- 专属入口 ---------------- */
.m-mine { display: flex; gap: 14px; align-items: center; margin-top: 15px; padding-top: 15px; border-top: 1px dashed var(--line); }
.m-mine .qr { width: 88px; flex-shrink: 0; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); padding: 5px; background: #fff; }
.m-mine .qr svg { width: 100%; height: auto; display: block; }
.m-mine .txt { font-size: 12px; color: var(--ink-3); margin-bottom: 7px; }
.m-linkline {
  display: flex; gap: 8px; align-items: center;
  background: var(--fill); border-radius: 10px; padding: 8px 10px;
}
.m-linkline .u { flex: 1; font-size: 12px; word-break: break-all; color: var(--brand); }

/* ---------------- 顶栏（登录态） ---------------- */
.m-topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  background: rgba(243, 245, 250, .88); backdrop-filter: blur(14px);
  padding: calc(12px + env(safe-area-inset-top)) 16px 10px;
}
.m-topbar .t { font-size: 17px; font-weight: 700; }
.m-iconbtn {
  width: 36px; height: 36px; border-radius: 12px; border: none; cursor: pointer;
  background: #fff; color: var(--ink-2); box-shadow: 0 1px 5px rgba(23, 43, 99, .08);
  display: flex; align-items: center; justify-content: center; font-size: 14px;
}
.m-iconbtn svg { width: 18px; height: 18px; }
.m-iconbtn:active { background: var(--fill); }

/* ---------------- 灯箱 / 弹窗 / Toast（移动端版） ---------------- */
.lightbox {
  position: fixed; inset: 0; background: rgba(10, 14, 26, .94); z-index: 100;
  display: flex; align-items: center; justify-content: center;
  flex-direction: column; gap: 14px; padding: 20px;
  animation: fadein .2s ease both;
}
.lightbox img { max-width: 100%; max-height: 78vh; border-radius: 10px; }
.lightbox .lb-bar {
  display: flex; gap: 10px; align-items: center; color: #b9c2d4; font-size: 12.5px; flex-wrap: wrap; justify-content: center;
}
.lightbox .lb-bar .m-btn-sm { background: rgba(240, 69, 77, .16); color: #ff858b; }
.lightbox .lb-close {
  position: fixed; top: calc(14px + env(safe-area-inset-top)); right: 16px;
  width: 38px; height: 38px; border-radius: 50%; border: none; cursor: pointer;
  background: rgba(255, 255, 255, .14); color: #fff; font-size: 20px; line-height: 38px; padding: 0;
}
@keyframes fadein { from { opacity: 0; } }

.modal {
  position: fixed; inset: 0; background: rgba(15, 23, 42, .5); z-index: 90;
  display: flex; align-items: flex-end; justify-content: center;
  animation: fadein .18s ease both;
}
.modal .modal-card {
  background: #fff; border-radius: 22px 22px 0 0; padding: 24px 20px calc(20px + env(safe-area-inset-bottom));
  width: 100%; max-width: 560px; animation: slideup .25s ease both;
}
@keyframes slideup { from { transform: translateY(40%); opacity: .5; } }
.modal h3 { margin: 0 0 8px; font-size: 17px; }
.modal .m-text { font-size: 14px; color: var(--ink-2); margin: 0 0 18px; }
.cx-text { font-size: 14px; color: var(--ink-2); margin: 4px 0 20px; }
.cx-actions { display: flex; gap: 10px; }
.cx-btn {
  flex: 1; height: 46px; border: 1.5px solid var(--line); border-radius: 14px;
  background: #fff; color: var(--ink-2); font-size: 15px; font-weight: 500; cursor: pointer;
}
.cx-btn:active { background: var(--fill); }
.cx-btn.cx-danger {
  background: linear-gradient(135deg, #ff6b70, #f0454d); border: none; color: #fff;
  font-weight: 600; box-shadow: 0 8px 18px rgba(240, 69, 77, .3);
}
.modal .m-actions { display: flex; gap: 10px; }
.modal .m-actions .m-btn-ghost { flex: 1; height: 46px; }
.modal .m-actions .m-btn.danger {
  flex: 1; height: 46px; letter-spacing: 0; font-size: 15px;
  background: linear-gradient(135deg, #ff6b70, #f0454d); box-shadow: 0 8px 18px rgba(240, 69, 77, .3);
}

#toast {
  position: fixed; left: 50%; bottom: calc(46px + env(safe-area-inset-bottom));
  transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center;
  width: max-content; max-width: 86vw;
}
.toast-item {
  background: rgba(23, 35, 61, .92); color: #fff; padding: 10px 20px; border-radius: 999px;
  font-size: 13.5px; animation: rise .25s ease both; backdrop-filter: blur(8px);
  max-width: 86vw; text-align: center;
}
.toast-item.err { background: rgba(214, 58, 64, .95); }

/* ---------------- 桌面宽度适配（员工页在电脑打开时居中收窄） ---------------- */
@media (min-width: 560px) {
  .m-page { max-width: 430px; margin: 0 auto; background: var(--bg); min-height: 100vh; box-shadow: 0 0 60px rgba(23, 43, 99, .08); }
  .m-topbar { max-width: 430px; }
  #toast { left: 50%; }
}
