/* ==========================================================================
   延安大学咸阳医院 · 教学管理信息系统 —— 手机端（扫码填报）样式
   与主站共用 style.css 的设计变量，本文件只补移动端专用组件
   ========================================================================== */

body.m-body {
  background: var(--bg);
  padding-bottom: 40px;
}

.m-wrap { max-width: 660px; margin: 0 auto; padding: 0 13px 34px; }

/* ---------------- 顶部身份条 ---------------- */
.m-top {
  background: linear-gradient(120deg, var(--brand) 0%, var(--brand-d) 100%);
  color: #fff;
  padding: calc(16px + env(safe-area-inset-top)) 16px 18px;
}
.m-top .m-crumb { font-size: 11.5px; color: rgba(255, 255, 255, .72); }
.m-top .m-me { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.m-top .m-av {
  width: 46px; height: 46px; border-radius: 50%; flex: none;
  background: rgba(255, 255, 255, .18); border: 1.5px solid rgba(255, 255, 255, .38);
  display: flex; align-items: center; justify-content: center;
  font-size: 19px; font-weight: 700;
}
.m-top .m-me h1 { margin: 0; font-size: 19px; letter-spacing: .4px; }
.m-top .m-me .m-meta { font-size: 12px; color: rgba(255, 255, 255, .82); margin-top: 2px; }
.m-top .m-out {
  margin-left: auto;
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 13px;
  font-size: 12.5px;
  color: rgba(255, 255, 255, .9);
  border: 1px solid rgba(255, 255, 255, .38);
  border-radius: 20px;
  background: rgba(255, 255, 255, .1);
  text-decoration: none;
  white-space: nowrap;
}
.m-top .m-out:active { background: rgba(255, 255, 255, .24); }
.m-top .m-badge {
  display: inline-block; font-size: 11px; padding: 1px 8px; border-radius: 20px;
  background: var(--gold); color: var(--brand-d); font-weight: 600; margin-left: 6px;
}
.m-top .m-notice {
  margin-top: 11px; font-size: 12px; line-height: 1.7; color: rgba(255, 255, 255, .9);
  background: rgba(255, 255, 255, .12); border-radius: 8px; padding: 8px 11px;
}

/* ---------------- 卡片 ---------------- */
.m-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--sh); margin-top: 13px; overflow: hidden;
}
.m-card > h2 {
  font-size: 13.5px; margin: 0; padding: 11px 14px; border-bottom: 1px solid var(--line);
  background: #fbfcfe; display: flex; align-items: center; gap: 8px;
}
.m-card > h2::before {
  content: ""; width: 3px; height: 13px; background: var(--red); border-radius: 2px;
}
.m-card > h2 .hint { margin-left: auto; font-size: 11.5px; color: var(--ink-3); font-weight: 400; }
.m-card .m-in { padding: 13px 14px; }

/* ---------------- 指标小格 ---------------- */
.m-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); }
.m-kpis .m-k { background: #fff; padding: 12px 6px; text-align: center; }
.m-kpis .m-k .n { font-size: 20px; font-weight: 700; line-height: 1.2; }
.m-kpis .m-k .k { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; }
.m-kpis .m-k .n small { font-size: 11px; font-weight: 500; color: var(--ink-3); margin-left: 2px; }

/* ---------------- 按钮组 ---------------- */
.m-acts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.m-act {
  display: flex; align-items: center; gap: 10px; padding: 13px 12px;
  border: 1px solid var(--line); border-radius: 9px; background: #fff;
  color: var(--ink); text-decoration: none; box-shadow: var(--sh);
}
.m-act:active { background: var(--brand-l); }
.m-act .ic {
  width: 34px; height: 34px; border-radius: 8px; flex: none;
  background: var(--brand-l); color: var(--brand);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 700;
}
.m-act .tt { font-size: 13.5px; font-weight: 600; }
.m-act .dd { font-size: 11.5px; color: var(--ink-3); }

/* ---------------- 记录列表 ---------------- */
.m-list { list-style: none; margin: 0; padding: 0; }
.m-list li { padding: 10px 14px; border-bottom: 1px solid #eef1f6; font-size: 13px; }
.m-list li:last-child { border-bottom: none; }
.m-list .t { font-weight: 600; }
.m-list .s { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; }
.m-list .r { display: flex; align-items: center; gap: 8px; margin-top: 4px; }

/* ---------------- 表单 ---------------- */
.m-form { padding: 13px 14px 16px; }
.m-f { display: block; margin-bottom: 12px; }
.m-f > span { display: block; font-size: 12.5px; color: var(--ink-2); margin-bottom: 5px; }
.m-f > span i { color: var(--red); font-style: normal; margin-left: 3px; }
.m-f input, .m-f select, .m-f textarea {
  width: 100%;
  font-family: var(--ff);
  font-size: 16px;                  /* 16px 以下 iOS 会强制放大页面 */
  color: var(--ink);
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  min-height: 46px;
  -webkit-appearance: none;
  appearance: none;
}
.m-f select {
  background-image:
    linear-gradient(45deg, transparent 50%, var(--ink-2) 50%),
    linear-gradient(135deg, var(--ink-2) 50%, transparent 50%);
  background-position: calc(100% - 18px) 20px, calc(100% - 13px) 20px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 34px;
}
.m-f textarea { min-height: 92px; line-height: 1.7; resize: vertical; font-size: 15px; }
.m-f input:focus, .m-f select:focus, .m-f textarea:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(35, 67, 130, .1);
}
.m-f .m-tip { font-size: 11.5px; color: var(--ink-3); margin-top: 5px; line-height: 1.65; }
.m-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* 手机号后四位：大字、宽字距，便于核对 */
.m-f input.m-pin {
  font-family: var(--mono);
  font-size: 27px;
  font-weight: 700;
  letter-spacing: 15px;
  text-align: center;
  padding: 11px 0 11px 15px;
  min-height: 58px;
}
.m-f input.m-pin::placeholder { letter-spacing: 15px; color: var(--ink-3); font-weight: 400; }

/* 身份分段切换 */
.m-seg {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  margin-bottom: 9px;
}
.m-seg label {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 12px 6px;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-2);
  cursor: pointer;
  border-right: 1px solid var(--line);
  transition: background .15s, color .15s;
}
.m-seg label:last-child { border-right: none; }
.m-seg label input { position: absolute; opacity: 0; pointer-events: none; }
.m-seg label.on { background: var(--brand); color: #fff; }

.m-radio { display: flex; flex-wrap: wrap; gap: 8px; }
.m-radio label {
  flex: 1 1 auto; text-align: center; font-size: 14px; padding: 12px;
  min-height: 46px;
  border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.m-radio input { position: absolute; opacity: 0; pointer-events: none; }
.m-radio input:checked + span { color: var(--brand); font-weight: 700; }
.m-radio label:has(input:checked) { border-color: var(--brand); background: var(--brand-l); }

.m-submit {
  width: 100%; font-family: var(--ff); font-size: 16px; font-weight: 600;
  color: #fff; background: var(--brand); border: none; border-radius: 9px;
  padding: 14px; margin-top: 6px; cursor: pointer; min-height: 50px;
}
.m-submit:active { background: var(--brand-d); }
.m-back {
  display: block; text-align: center; font-size: 14px; color: var(--ink-2);
  margin-top: 10px; padding: 13px; border: 1px solid var(--line);
  border-radius: 9px; background: #fff; text-decoration: none; min-height: 48px;
}

/* ---------------- 提示 ---------------- */
.m-alert {
  margin: 12px 14px 0; padding: 10px 12px; font-size: 12.5px; line-height: 1.7;
  background: var(--bad-bg); color: var(--bad); border-radius: 8px;
  border-left: 3px solid var(--bad);
}
.m-alert ul { margin: 4px 0 0; padding-left: 18px; }
.m-ok {
  margin: 12px 14px 0; padding: 10px 12px; font-size: 12.5px; line-height: 1.7;
  background: var(--ok-bg); color: var(--ok); border-radius: 8px;
  border-left: 3px solid var(--ok);
}
.m-note {
  font-size: 12px; line-height: 1.75; color: var(--ink-2);
  background: #f7f9fc; border-left: 3px solid var(--gold);
  border-radius: 0 8px 8px 0; padding: 10px 12px; margin: 12px 0 0;
}

/* ---------------- 成功页 ---------------- */
.m-done { text-align: center; padding: 42px 20px 30px; }
.m-done .ic {
  width: 66px; height: 66px; border-radius: 50%; margin: 0 auto 14px;
  background: var(--ok-bg); color: var(--ok); font-size: 30px;
  display: flex; align-items: center; justify-content: center;
}
.m-done h1 { font-size: 19px; margin: 0 0 6px; }
.m-done p { font-size: 13px; color: var(--ink-2); margin: 4px 0; }

/* ---------------- 页脚 ---------------- */
.m-foot {
  text-align: center; font-size: 11.5px; color: var(--ink-3);
  padding: 20px 14px; line-height: 1.8;
}

@media (max-width: 420px) {
  .m-kpis { grid-template-columns: repeat(3, 1fr); }
  .m-acts { grid-template-columns: 1fr; }
  .m-row2 { grid-template-columns: 1fr; }
  .m-wrap { padding: 0 10px 34px; }
  .m-f input.m-pin { font-size: 24px; letter-spacing: 11px; }
}

/* 横屏 / 平板：内容居中且不过宽 */
@media (min-width: 661px) {
  .m-body { padding-bottom: 60px; }
  .m-top {
    max-width: 660px;
    margin: 0 auto;
    border-radius: 0 0 var(--r) var(--r);
  }
}

/* 表单内联提示与必填标记的对比度增强 */
.m-f .m-tip b { color: var(--ink-2); }

/* 触摸设备按下反馈 */
@media (hover: none) {
  .m-act:active { background: #eef2fa; }
  .m-list li:active { background: #fafbfe; }
}

/* ---------------- 定位打卡（H5 考勤） ---------------- */
.m-geo {
  display: flex; align-items: center; gap: 8px;
  padding: 11px 14px; border-top: 1px solid var(--line);
  font-size: 12.5px; color: var(--ink-2);
}
.m-geo .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); flex: none; }
.m-geo.on .dot { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-bg); }
.m-geo.bad .dot { background: var(--red); box-shadow: 0 0 0 3px var(--bad-bg); }
.m-geo .re { margin-left: auto; color: var(--brand); font-size: 12px; flex: none; }

.m-done-in { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 13px 14px 4px; }
.m-done-in .b { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; text-align: center; }
.m-done-in .b .k { font-size: 11.5px; color: var(--ink-3); }
.m-done-in .b .v { font-size: 19px; font-weight: 700; font-family: var(--mono); margin-top: 2px; }
.m-done-in .b.on { border-color: var(--brand); background: var(--brand-l); }
.m-done-in .b.miss .v { color: var(--ink-3); }

.m-punch { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 12px 14px 4px; }
.m-punch button {
  appearance: none; border: none; border-radius: 10px; padding: 14px 8px;
  font-size: 15.5px; font-weight: 700; font-family: var(--ff); color: #fff;
  background: var(--brand); cursor: pointer; min-height: 56px; line-height: 1.3;
}
.m-punch button.sub { background: var(--gold); color: #4a3a12; }
.m-punch button:disabled { opacity: .45; cursor: not-allowed; }
.m-punch button .t { display: block; font-size: 11.5px; font-weight: 500; opacity: .85; margin-top: 2px; }

.m-state { padding: 8px 14px 12px; }
.m-state .ln { padding: 8px 11px; border-radius: 8px; margin-top: 7px; font-size: 12.5px; line-height: 1.6; }
.m-state .ln.ok { background: var(--ok-bg); color: var(--ok); }
.m-state .ln.no { background: var(--warn-bg); color: var(--warn); }
.m-state .ln.bad { background: var(--bad-bg); color: var(--bad); }
.m-state .ln:empty { display: none; }

/* ---------------- 打卡前选科室（轮转表未登记时） ---------------- */
.m-pick { padding: 11px 14px 3px; border-top: 1px solid var(--line); }
.m-pick label { display: block; font-size: 12.5px; color: var(--ink-2); }
.m-pick label .hint { margin-left: 6px; font-size: 11.5px; color: var(--ink-3); }
.m-pick input {
  display: block; width: 100%; margin-top: 6px; padding: 11px 12px;
  border: 1px solid var(--line); border-radius: 9px;
  font-size: 16px; font-family: var(--ff); color: var(--ink); background: #fff;
  min-height: 46px;
}
.m-pick input:focus { outline: none; border-color: var(--brand); }
.m-pick-tip { margin-top: 6px; font-size: 11.5px; color: var(--ink-3); line-height: 1.6; }
