/* ==========================================================================
   H5 双身份移动端样式（患者端 / 员工端 / 登录 / 身份选择）
   极简原生风格, 主题色跟随诊所后台配置的 CSS 变量
   ========================================================================== */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: #f4f1ee;
  color: #2b2622;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--c-primary, #8c1f28); text-decoration: none; }
button { font-family: inherit; }

.h5-page { max-width: 560px; margin: 0 auto; min-height: 100vh; background: #f4f1ee; padding-bottom: 70px; }

/* ---------- 顶栏 ---------- */
.h5-topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(env(safe-area-inset-top, 0px) + 10px) 12px 10px;
  background: var(--c-primary, #8c1f28); color: #fff;
}
.h5-back, .h5-topbar-action { background: none; border: 0; color: #fff; font-size: 15px; padding: 4px 8px; cursor: pointer; }
.h5-topbar-title { font-weight: 600; font-size: 16px; }
.h5-topbar-action { font-size: 13px; opacity: .92; }

/* ---------- 登录 ---------- */
.h5-login { display: flex; flex-direction: column; align-items: center; padding: 0 18px; }
.h5-login-hero { text-align: center; padding: 56px 0 30px; }
.h5-brand-mark {
  width: 68px; height: 68px; margin: 0 auto 14px; border-radius: 20px;
  background: linear-gradient(135deg, var(--c-primary, #8c1f28), var(--c-gold, #c9a227));
  color: #fff; font-size: 34px; font-weight: 700; line-height: 68px;
  box-shadow: 0 10px 26px rgba(140, 31, 40, .28);
}
.h5-login-hero h1 { margin: 0 0 6px; font-size: 21px; }
.h5-login-hero p { margin: 0; color: #8b8078; font-size: 13.5px; }

.h5-card {
  width: 100%; max-width: 400px; background: #fff; border-radius: 16px;
  padding: 22px 18px; box-shadow: 0 6px 24px rgba(43, 38, 34, .07);
}
.h5-label { display: block; font-size: 13px; color: #6b6159; margin: 14px 0 6px; font-weight: 600; }
.h5-input {
  width: 100%; height: 46px; border: 1px solid #ddd5cc; border-radius: 10px;
  padding: 0 14px; font-size: 16px; background: #fff; color: #2b2622; outline: none;
}
.h5-input:focus { border-color: var(--c-primary, #8c1f28); box-shadow: 0 0 0 3px rgba(140, 31, 40, .10); }
.h5-code-row { display: flex; gap: 10px; }
.h5-code-row .h5-input { flex: 1 1 auto; letter-spacing: 6px; text-align: center; font-size: 20px; }
.h5-code-btn { white-space: nowrap; align-self: center; height: 46px; padding: 0 14px; border-radius: 10px; }
.h5-hint { font-size: 12.5px; color: #2f7d4f; margin-top: 6px; min-height: 16px; }
.h5-hint.is-err { color: #b3261e; }

.h5-btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 44px; padding: 0 20px; border-radius: 10px; border: 1px solid transparent;
  font-size: 15px; cursor: pointer; background: #fff; color: #2b2622;
}
.h5-btn-primary { background: var(--c-primary, #8c1f28); color: #fff; font-weight: 600; }
.h5-btn-primary:disabled { opacity: .6; }
.h5-btn-ghost { background: transparent; color: var(--c-primary, #8c1f28); border-color: var(--c-primary, #8c1f28); }
.h5-btn-block { width: 100%; }
.h5-legal { text-align: center; font-size: 12px; color: #a0988f; margin: 14px auto 0; }
.h5-tip {
  width: 100%; max-width: 400px; background: #fdf6ec; border: 1px solid #f0dfc2;
  border-radius: 12px; padding: 12px 14px; margin-top: 18px; font-size: 12.5px; color: #7a6542;
  display: flex; flex-direction: column; gap: 4px;
}

/* ---------- 身份选择 ---------- */
.h5-choose-hero { text-align: center; padding: 30px 18px 16px; }
.h5-choose-hero h1 { margin: 0 0 4px; font-size: 19px; }
.h5-phone-line { margin: 0; color: #8b8078; font-size: 13.5px; }
.h5-identity-list { padding: 0 18px; display: flex; flex-direction: column; gap: 12px; }
.h5-idcard {
  display: flex; align-items: center; gap: 12px; text-align: left; cursor: pointer;
  background: #fff; border: 1px solid #ece4dc; border-radius: 14px; padding: 14px;
  width: 100%; font-size: 15px;
}
.h5-idcard:active { transform: scale(.99); }
.h5-idcard-ico {
  width: 46px; height: 46px; border-radius: 12px; flex: 0 0 auto;
  background: linear-gradient(135deg, var(--c-primary, #8c1f28), #b96a4a);
  display: flex; align-items: center; justify-content: center; font-size: 22px; color: #fff;
}
.h5-idcard-main { flex: 1 1 auto; display: flex; flex-direction: column; }
.h5-idcard-main strong { font-size: 16px; }
.h5-idcard-main small { color: #8b8078; font-size: 12.5px; }
.h5-idcard-arrow { color: var(--c-primary, #8c1f28); font-size: 13px; }

/* ---------- 工作台 ---------- */
.h5-hello {
  display: flex; align-items: center; justify-content: space-between;
  background: linear-gradient(135deg, var(--c-primary, #8c1f28), #a84a35);
  color: #fff; padding: 20px 18px;
}
.h5-hello-staff { background: linear-gradient(135deg, #2b4a6f, #4a6f8f); }
.h5-hello strong { font-size: 19px; display: block; }
.h5-hello span { font-size: 13px; opacity: .9; }
.h5-role-pill {
  background: rgba(255,255,255,.18); border-radius: 999px; padding: 6px 12px;
  font-size: 12.5px; cursor: pointer; white-space: nowrap;
}
.h5-stat-row { display: flex; background: #fff; margin: 12px 12px 0; border-radius: 14px; padding: 14px 4px; box-shadow: 0 2px 10px rgba(43,38,34,.05); }
.h5-stat { flex: 1; text-align: center; display: flex; flex-direction: column; }
.h5-stat strong { font-size: 22px; color: var(--c-primary, #8c1f28); }
.h5-stat span { font-size: 12px; color: #8b8078; margin-top: 2px; }

.h5-sec { background: #fff; margin: 12px 12px 0; border-radius: 14px; padding: 14px; box-shadow: 0 2px 10px rgba(43,38,34,.05); }
.h5-sec-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.h5-sec-head h2 { margin: 0; font-size: 15.5px; }
.h5-sec-head a { font-size: 13px; }
.h5-date-line { color: #8b8078; font-size: 12.5px; }
.h5-list { display: flex; flex-direction: column; }
.h5-cell {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 2px; border-bottom: 1px solid #f3ede6;
}
.h5-cell:last-child { border-bottom: 0; }
.h5-cell-main { flex: 1 1 auto; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.h5-cell-main strong { font-size: 15px; }
.h5-cell-main small { color: #8b8078; font-size: 12.5px; }
.h5-cell-stack { align-items: flex-start; }
.h5-rec-time { color: #b0a79c !important; }
.h5-rec-line { margin: 4px 0 0; font-size: 13px; color: #4a443c; background: #faf6f1; border-radius: 8px; padding: 6px 9px; }
.h5-rec-line em { font-style: normal; color: #a0988f; }
.h5-badge { font-size: 12px; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.h5-badge-pending { background: #fdf1dd; color: #9a6700; }
.h5-badge-confirmed { background: #e4f2ea; color: #2f7d4f; }
.h5-badge-done { background: #eef0f2; color: #5f6b74; }
.h5-badge-cancelled { background: #fbeae8; color: #b3261e; }
.h5-empty { text-align: center; color: #a0988f; font-size: 13.5px; padding: 26px 0; }

/* ---------- 底部导航 ---------- */
.h5-tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 20;
  display: flex; justify-content: space-around; align-items: center;
  background: #fff; border-top: 1px solid #ece4dc;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.h5-tabbar a {
  flex: 1; text-align: center; padding: 9px 0 7px; font-size: 12px; color: #8b8078;
}
.h5-tabbar a.is-active { color: var(--c-primary, #8c1f28); font-weight: 600; }
