/* 红会医院 · 后勤一站式服务平台 移动端公共样式 V2（医疗科技浅色系） */
:root {
  --pri: #0E7490;            /* 医疗青蓝 */
  --pri-deep: #155E75;
  --pri-bright: #0891B2;
  --pri-grad: linear-gradient(135deg, #155E75, #0E7490 55%, #0891B2);
  --amber: #D97706;
  --green: #059669;
  --red: #DC2626;
  --info: #0284C7;
  --bg: #F0F6F8;
  --ink: #0F252E;
  --ink-2: #45606C;
  --ink-3: #8AA3AD;
  --card-shadow: 0 2px 8px rgba(14,116,144,.07), 0 8px 24px rgba(14,116,144,.05);
}
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: #D9E3E8; }
body {
  font-family: system-ui, "Microsoft YaHei", "PingFang SC", sans-serif;
  background: #D9E3E8; color: var(--ink);
}
.phone {
  max-width: 420px; margin: 0 auto; background: var(--bg);
  min-height: 100vh; position: relative;
  box-shadow: 0 0 32px rgba(14,60,75,.14);
  padding-bottom: 72px;
}
.phone.no-tab { padding-bottom: 24px; }

/* ---------- 状态栏 ---------- */
.statusbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 18px 4px; font-size: 12px; font-weight: 600; color: #12333F;
  background: #fff;
}
.statusbar.dark { background: transparent; color: rgba(255,255,255,.92); }
.statusbar .icons { display: flex; align-items: center; gap: 5px; }

/* ---------- 导航栏 ---------- */
.navbar {
  background: #fff; display: flex; align-items: center;
  padding: 10px 14px; position: sticky; top: 0; z-index: 40;
  border-bottom: 1px solid #E4EEF2;
}
.navbar .back {
  width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
  font-size: 20px; color: var(--pri); text-decoration: none; border-radius: 50%;
}
.navbar .back:active { background: #E6F3F7; }
.navbar .title { flex: 1; text-align: center; font-size: 16px; font-weight: 700; color: var(--ink); }
.navbar .capsule {
  width: 70px; height: 28px; border: 1px solid #DCE7EC; border-radius: 14px;
  display: flex; align-items: center; justify-content: center; gap: 8px; color: #5B7280; font-size: 13px;
  background: #F7FAFB;
}
.navbar .spacer { width: 32px; }

/* ---------- 通用卡片 ---------- */
.card {
  background: #fff; border-radius: 14px; padding: 16px;
  box-shadow: var(--card-shadow); margin: 12px 14px 0;
  border: 1px solid rgba(14,116,144,.05);
}
.card-title { font-size: 15px; font-weight: 700; color: var(--ink); margin-bottom: 12px; display: flex; align-items: center; gap: 6px; }
.card-title .bar { width: 4px; height: 15px; border-radius: 2px; background: linear-gradient(180deg, #0891B2, #155E75); }

/* ---------- 徽章（浅底深字） ---------- */
.badge { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; line-height: 18px; }
.badge-status-待派单 { background: #FEF6E0; color: #B45309; }
.badge-status-待接单 { background: #E0F2FE; color: #0369A1; }
.badge-status-处理中 { background: #ECFEFF; color: #0E7490; }
.badge-status-待确认 { background: #FFF3E8; color: #C2410C; }
.badge-status-已完成 { background: #E8F8F0; color: #059669; }
.badge-src { background: #EFF4F6; color: #5B7280; }
.badge-alarm { background: #FEECEC; color: #B91C1C; }

/* ---------- 按钮 ---------- */
.btn {
  display: block; width: 100%; border: none; border-radius: 12px;
  padding: 13px 0; font-size: 15px; font-weight: 600; text-align: center;
  background: var(--pri-grad); color: #fff; cursor: pointer; text-decoration: none;
  box-shadow: 0 4px 12px rgba(14,116,144,.28);
  letter-spacing: .5px;
}
.btn:active { opacity: .88; box-shadow: 0 2px 6px rgba(14,116,144,.22); }
.btn-outline { background: #fff; color: var(--pri); border: 1px solid var(--pri); box-shadow: none; }
.btn-gray { background: #EFF4F6; color: #5B7280; box-shadow: none; }
.btn-danger { background: var(--red); box-shadow: 0 4px 12px rgba(220,38,38,.25); }

/* ---------- 底部 tabbar ---------- */
.tabbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 420px; background: rgba(255,255,255,.96);
  backdrop-filter: blur(8px);
  border-top: 1px solid #E2ECF0; display: flex; z-index: 50;
  padding: 6px 0 calc(8px + env(safe-area-inset-bottom));
  box-shadow: 0 -4px 16px rgba(14,116,144,.06);
}
.tabbar a {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  text-decoration: none; color: #93A8B1; font-size: 11px; position: relative;
}
.tabbar a .ic { font-size: 21px; line-height: 1; transition: transform .15s; }
.tabbar a.active { color: var(--pri); font-weight: 700; }
.tabbar a.active .ic { transform: translateY(-1px) scale(1.08); }
.tabbar a.active::before {
  content: ''; position: absolute; top: -7px; width: 22px; height: 3px;
  border-radius: 0 0 3px 3px; background: var(--pri-grad);
}

/* ---------- Toast ---------- */
#toast {
  position: fixed; left: 50%; bottom: 110px; transform: translateX(-50%) translateY(20px);
  background: rgba(15,46,58,.94); color: #fff; font-size: 13px;
  padding: 10px 20px; border-radius: 999px; z-index: 200;
  opacity: 0; pointer-events: none; transition: all .25s ease;
  max-width: 320px; text-align: center;
  box-shadow: 0 6px 20px rgba(15,46,58,.3);
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- 弹层 ---------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(10,34,44,.5); z-index: 100;
  display: none; align-items: flex-end; justify-content: center;
  backdrop-filter: blur(2px);
}
.modal-mask.show { display: flex; }
.modal {
  width: 100%; max-width: 420px; background: #fff;
  border-radius: 20px 20px 0 0; padding: 18px 16px 24px;
  max-height: 82vh; overflow-y: auto;
  animation: slideUp .25s ease;
}
@keyframes slideUp { from { transform: translateY(40px); opacity: .6; } to { transform: none; opacity: 1; } }
.modal h3 { font-size: 16px; margin-bottom: 14px; color: var(--ink); }

/* ---------- 表单 ---------- */
.flabel { font-size: 13px; font-weight: 600; color: #33505C; margin: 16px 0 8px; display: flex; align-items: center; gap: 4px; }
.flabel .req { color: var(--red); }
.finput, .fselect, .ftextarea {
  width: 100%; border: 1px solid #D8E5EA; border-radius: 10px;
  padding: 11px 12px; font-size: 14px; background: #F8FBFC; color: var(--ink);
  font-family: inherit; outline: none; transition: border-color .15s, box-shadow .15s;
}
.finput:focus, .fselect:focus, .ftextarea:focus {
  border-color: var(--pri); background: #fff;
  box-shadow: 0 0 0 3px rgba(14,116,144,.12);
}
.ftextarea { min-height: 90px; resize: none; }
.frow { display: flex; gap: 8px; }

/* ---------- 进度步骤条（青色系 + 当前节点脉冲） ---------- */
.steps { display: flex; align-items: flex-start; padding: 6px 0 2px; }
.step { flex: 1; display: flex; flex-direction: column; align-items: center; position: relative; }
.step .dot {
  width: 22px; height: 22px; border-radius: 50%; background: #E2ECF0; color: #93A8B1;
  display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700;
  z-index: 2; border: 2px solid #fff;
}
.step .lb { font-size: 10px; color: #93A8B1; margin-top: 5px; white-space: nowrap; }
.step .line { position: absolute; top: 11px; left: calc(-50% + 11px); right: calc(50% + 11px); height: 2px; background: #E2ECF0; z-index: 1; }
.step:first-child .line { display: none; }
.step.done .dot { background: var(--pri); color: #fff; }
.step.done .lb { color: var(--pri); font-weight: 600; }
.step.done .line { background: linear-gradient(90deg, #0E7490, #0891B2); }
.step.cur .dot {
  background: var(--pri-bright); color: #fff;
  animation: dotPulse 1.6s ease-out infinite;
}
.step.cur .lb { color: var(--pri); font-weight: 700; }
@keyframes dotPulse {
  0%   { box-shadow: 0 0 0 0 rgba(8,145,178,.45); }
  70%  { box-shadow: 0 0 0 8px rgba(8,145,178,0); }
  100% { box-shadow: 0 0 0 0 rgba(8,145,178,0); }
}

/* ---------- 竖向时间线 ---------- */
.tl { position: relative; padding-left: 26px; }
.tl::before { content: ''; position: absolute; left: 8px; top: 8px; bottom: 8px; width: 2px; background: #E2ECF0; }
.tl-item { position: relative; padding: 0 0 18px; }
.tl-item:last-child { padding-bottom: 2px; }
.tl-item .tdot {
  position: absolute; left: -26px; top: 0; width: 18px; height: 18px; border-radius: 50%;
  background: #fff; border: 2px solid #C7D9E0; display: flex; align-items: center; justify-content: center;
  font-size: 10px; z-index: 2;
}
.tl-item.hl .tdot { border-color: var(--pri); background: var(--pri); color: #fff; box-shadow: 0 0 0 4px rgba(14,116,144,.15); }
.tl-item .tnode { font-size: 14px; font-weight: 600; color: var(--ink); }
.tl-item .tmeta { font-size: 12px; color: var(--ink-2); margin-top: 2px; }
.tl-item .tnote { font-size: 12px; color: var(--ink-3); margin-top: 2px; }

/* ---------- 空态 ---------- */
.empty { text-align: center; padding: 56px 20px; }
.empty .art {
  width: 110px; height: 110px; margin: 0 auto 16px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff, #E1EEF2);
  display: flex; align-items: center; justify-content: center; font-size: 46px;
  box-shadow: inset 0 -6px 14px rgba(14,116,144,.1), 0 6px 16px rgba(14,116,144,.08);
}
.empty .t { font-size: 14px; color: var(--ink-2); font-weight: 600; }
.empty .s { font-size: 12px; color: var(--ink-3); margin-top: 5px; }

/* ---------- 列表行 ---------- */
.row { display: flex; align-items: center; padding: 13px 0; border-bottom: 1px solid #EDF3F5; text-decoration: none; color: inherit; }
.row:last-child { border-bottom: none; }
.row .ric {
  width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center;
  font-size: 19px; margin-right: 12px; flex-shrink: 0;
}
.row .rmain { flex: 1; min-width: 0; }
.row .rt { font-size: 14px; font-weight: 600; color: var(--ink); }
.row .rs { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.row .arrow { color: #B7C9D1; font-size: 16px; }

/* ---------- SLA 红色发光跳动 ---------- */
@keyframes pulse-red { 0%,100% { opacity: 1; } 50% { opacity: .55; } }
.sla-urgent {
  color: var(--red); animation: pulse-red 1s infinite; font-weight: 800;
  font-family: "Consolas", "DIN Alternate", monospace;
  text-shadow: 0 0 10px rgba(220,38,38,.45);
}

/* ---------- 星级（琥珀） ---------- */
.star { font-size: 30px; color: #DFE9ED; cursor: pointer; transition: transform .1s, color .15s; }
.star.on { color: var(--amber); text-shadow: 0 2px 8px rgba(217,119,6,.35); }
.star:active { transform: scale(1.25); }
.stars-static { color: var(--amber); letter-spacing: 2px; }

/* ---------- 标签 ---------- */
.chip {
  display: inline-block; padding: 6px 14px; border-radius: 999px; font-size: 12px;
  background: #F2F7F9; color: #5B7280; margin: 0 8px 8px 0; cursor: pointer; border: 1px solid transparent;
}
.chip.on { background: #E4F4F8; color: var(--pri); border-color: var(--pri); font-weight: 600; }

/* ---------- 角色胶囊（精致分段控件） ---------- */
.role-bar {
  display: flex; gap: 4px; margin: 12px 14px 0; background: #fff; border-radius: 999px; padding: 4px;
  box-shadow: var(--card-shadow); border: 1px solid rgba(14,116,144,.06);
}
.role-bar button {
  flex: 1; border: none; background: transparent; padding: 8px 0; border-radius: 999px;
  font-size: 13px; color: #6E8792; cursor: pointer; font-family: inherit;
  transition: all .2s ease;
}
.role-bar button.on {
  background: var(--pri-grad); color: #fff; font-weight: 700;
  box-shadow: 0 3px 10px rgba(14,116,144,.35);
}

/* ---------- 底部操作条 ---------- */
.actionbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 420px; background: rgba(255,255,255,.97);
  backdrop-filter: blur(8px);
  padding: 10px 14px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid #E2ECF0; display: flex; gap: 10px; z-index: 50;
  box-shadow: 0 -4px 16px rgba(14,116,144,.06);
}
.actionbar .btn { flex: 1; }

/* 信息行 */
.kv { display: flex; font-size: 13px; padding: 7px 0; }
.kv .k { width: 84px; color: var(--ink-3); flex-shrink: 0; }
.kv .v { flex: 1; color: var(--ink); font-weight: 500; }

/* 照片占位 */
.photo-ph {
  width: 72px; height: 72px; border-radius: 10px; margin-right: 8px; flex-shrink: 0;
  background: linear-gradient(135deg, #E4F1F5, #CBE2E9);
  display: flex; align-items: center; justify-content: center; font-size: 26px; color: var(--pri);
}
.photo-real { width: 72px; height: 72px; border-radius: 10px; margin-right: 8px; object-fit: cover; flex-shrink: 0; }

/* 耗材表 */
.mat-table { width: 100%; font-size: 13px; border-collapse: collapse; }
.mat-table th { background: #F2F8FA; color: var(--ink-2); font-weight: 600; padding: 8px 6px; text-align: left; font-size: 12px; }
.mat-table td { padding: 9px 6px; border-bottom: 1px solid #EDF3F5; color: #33505C; }
.mat-table .num { text-align: right; }
