/* ---------- 急救监护仪 ---------- */

.c9 { background: #2b2d42; }
body.mon-mode #view { padding: 6px; background: #000; }
.mon {
  position: relative; height: 100%; min-height: 520px;
  display: grid; grid-template-rows: auto 1fr auto auto; gap: 4px;
  background: #000; color: #eee; border-radius: 10px; overflow: hidden;
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}
.mon.flash { animation: monflash 0.35s ease-out; }
@keyframes monflash { 0% { box-shadow: inset 0 0 0 2000px rgba(255, 255, 255, 0.85); } 100% { box-shadow: inset 0 0 0 2000px rgba(255, 255, 255, 0); } }

.mon-top { display: flex; align-items: center; gap: 14px; padding: 6px 12px; background: #2a2a2e; font-size: 16px; }
.mon-brand { flex: 1; font-weight: bold; letter-spacing: 1px; color: #fff; }
.mon-lives { font-size: 16px; letter-spacing: 1px; }
.mon-score { color: #ffe23d; font-weight: bold; min-width: 80px; }
.mon-int { color: #bbb; font-size: 14px; }
.mon-int select { background: #111; color: #fff; border: 1px solid #555; border-radius: 6px; font-size: 14px; padding: 2px 4px; }
.mon-adult, .mon-clock { color: #ddd; }
.mon-clock { font-variant-numeric: tabular-nums; }

.mon-main { display: grid; grid-template-columns: 1fr 230px; gap: 4px; min-height: 0; }
.mon-waves { position: relative; min-height: 0; }
.mon-waves canvas { display: block; width: 100%; height: 100%; }
.mon-name { position: absolute; left: 8px; top: 4px; font-size: 13px; color: #3dff4f; pointer-events: none; }
.mon-cpr { position: absolute; left: 50%; top: 36%; transform: translate(-50%, -50%); padding: 8px 18px; border-radius: 10px; background: rgba(255, 140, 26, 0.9); color: #fff; font-size: 22px; font-weight: bold; }

.mon-nums { display: flex; flex-direction: column; gap: 3px; min-height: 0; }
.mt {
  position: relative; flex: 1; min-height: 52px; padding: 2px 8px;
  display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto 1fr auto;
  border-top: 1px solid #333;
}
.mt-label { grid-column: 1 / 3; font-size: 13px; }
.mt-lim { grid-row: 2; font-size: 11px; line-height: 1.2; color: #999; align-self: center; }
.mt-bell { position: absolute; left: 34px; top: 22px; font-size: 13px; filter: grayscale(1) brightness(1.4); opacity: 0.6; }
.mt-val { grid-column: 2; grid-row: 2; justify-self: end; align-self: center; font-size: 40px; line-height: 1; font-weight: bold; font-variant-numeric: tabular-nums; }
.mt-unit { grid-column: 2; grid-row: 3; justify-self: end; font-size: 12px; color: #aaa; }
.mt.green { color: #3dff4f; }
.mt.red { color: #ff3b3b; }
.mt.yellow { color: #ffe23d; }
.mt.white { color: #f2f2f2; }
/* 报警：整格变色闪烁（高级报警快闪，中级报警慢闪） */
.mt.al-high, .mt.al-med { color: #000; }
.mt.al-high .mt-lim, .mt.al-med .mt-lim, .mt.al-high .mt-unit, .mt.al-med .mt-unit { color: #000; }
.mt.al-high .mt-bell, .mt.al-med .mt-bell { filter: none; opacity: 1; }
.mt.green.al-high, .mt.green.al-med { background: #3dff4f; }
.mt.red.al-high, .mt.red.al-med { background: #ff3b3b; }
.mt.yellow.al-high, .mt.yellow.al-med { background: #ffe23d; }
.mt.white.al-high, .mt.white.al-med { background: #f2f2f2; }
.mt.al-high { animation: alblink 0.5s steps(1) infinite; }
.mt.al-med { animation: alblink 1.6s steps(1) infinite; }
@keyframes alblink { 50% { background: transparent; color: inherit; } }

.mon-sub { display: flex; gap: 4px; }
.mt.wide { flex: 0 0 auto; min-width: 200px; min-height: 48px; grid-template-columns: auto auto; column-gap: 14px; }
.mt.wide .mt-val { font-size: 30px; grid-column: 2; grid-row: 1 / 3; }
.mt.wide .mt-label { grid-column: 1; }
.mt.wide .mt-unit { grid-column: 1; grid-row: 2; justify-self: start; align-self: end; }

.mon-bar { display: flex; gap: 6px; padding: 4px; background: #1b1b1e; align-items: stretch; }
.mon-btn { flex: 0 0 auto; min-width: 92px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 6px 10px; border-radius: 6px; background: #4a4a50; color: #eee; font-size: 15px; border: 1px solid #666; }
.mon-btn span { font-size: 24px; line-height: 1; }
.mon-btn:active { transform: translateY(2px); }
.defib-btn { background: #b3121f; border-color: #e33; font-weight: bold; font-size: 17px; }
.mute-btn.on { background: #c62828; border-color: #e33; }
.mon-hint { flex: 1; min-width: 0; padding: 6px 10px; border-radius: 6px; background: #101114; border: 1px solid #333; font-size: 13px; line-height: 1.45; color: #ccc; position: relative; }
.mh-msg { margin: 0 0 4px; font-size: 17px; font-weight: bold; color: #fff; padding-right: 120px; }
.mh-msg.good { color: #3dff4f; }
.mh-msg.bad { color: #ff6b6b; }
.mh-rules { margin: 0; padding-left: 18px; }
.mh-rules b { color: #fff; }
.mh-name { position: absolute; right: 10px; top: 6px; font-size: 13px; color: #aaa; }
.mh-name input { vertical-align: middle; }

/* 除颤面板 */
.mon-defib { position: absolute; left: 0; top: 0; width: min(760px, calc(100% - 8px)); transform-origin: 0 0; z-index: 4; border: 4px solid #c8101e; border-radius: 10px; background: #2a2a2e; box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6); }
.md-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; cursor: move; touch-action: none; padding: 2px 12px; background: #c8101e; color: #fff; font-size: 18px; }
.md-close { color: #fff; background: none; border: 0; font-size: 26px; line-height: 1; padding: 0 6px; }
.md-body { display: grid; grid-template-columns: 1.1fr 2fr 1.1fr auto; gap: 10px; padding: 8px 10px; align-items: center; }
.md-info { display: flex; flex-direction: column; gap: 8px; font-size: 16px; color: #ddd; }
.md-info div { display: flex; justify-content: space-between; gap: 10px; }
.md-info b { color: #fff; }
.md-mid { display: flex; flex-direction: column; gap: 10px; }
.md-energy { display: grid; grid-template-columns: 56px 1fr 56px; gap: 6px; }
.md-energy button { height: 52px; border-radius: 6px; background: #5a5a60; color: #fff; font-size: 40px; font-weight: bold; }
.md-j { display: grid; place-items: center; background: #000; color: #fff; font-size: 40px; border-radius: 6px; }
.md-sync { height: 44px; border-radius: 6px; background: #5a5a60; color: #fff; font-size: 20px; display: flex; align-items: center; justify-content: center; gap: 12px; }
.md-sync i { width: 18px; height: 18px; border-radius: 50%; background: #1d3b1d; border: 2px solid #0a0; }
.md-sync.on { background: #2e7d32; }
.md-sync.on i { background: #6f6; box-shadow: 0 0 8px #6f6; }
.md-right { display: flex; flex-direction: column; gap: 10px; }
.md-right button { height: 48px; border-radius: 6px; font-size: 20px; color: #fff; }
.md-charge { background: #c77800; }
.md-cancel { background: #5a5a60; }
.md-shock { width: 96px; height: 96px; border-radius: 50%; border: 4px solid #ddd; background: #3a3a3e; color: #fff; font-size: 50px; }
.md-shock.ready { background: #e01b24; border-color: #fff; animation: shockready 0.6s ease-in-out infinite alternate; }
@keyframes shockready { to { box-shadow: 0 0 0 10px rgba(224, 27, 36, 0.35); } }

.mon-overlay { position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; background: rgba(0, 0, 0, 0.72); }
.mo-box { max-width: 640px; margin: 16px; padding: 22px 26px; border-radius: 16px; background: #fff; color: var(--ink); text-align: center; }
.mo-box h2 { margin: 0 0 8px; font-size: 30px; }
.mo-box p { font-size: 19px; line-height: 1.6; margin: 8px 0; }
.mo-box .record { font-size: 22px; font-weight: bold; }
.mo-box .record.new { color: #ff8c1a; }

@media (max-width: 900px) {
  .mon-main { grid-template-columns: 1fr 150px; }
  .mt-val { font-size: 28px; }
  .mt-lim, .mt-bell { display: none; }
  .mon-defib { width: calc(100% - 4px); }
  .md-body { grid-template-columns: 1fr 1fr; }
  .md-info { grid-column: 1 / 3; flex-direction: row; justify-content: space-around; }
  .md-shock { justify-self: center; width: 90px; height: 90px; }
  .mon-top { flex-wrap: wrap; gap: 8px; font-size: 14px; }
  .mon-bar { flex-wrap: wrap; }
  .mon-hint { flex-basis: 100%; }
  .mh-rules { font-size: 12px; }
}

/* 合并顶栏：这个玩法里隐藏粉色顶栏，返回 / 全屏 / 声音放进监护仪顶栏 */
body.mon-mode .topbar { display: none; }
.mon-ico { flex: 0 0 auto; width: 38px; height: 38px; border-radius: 8px; background: #3e3e44; color: #fff; font-size: 20px; display: grid; place-items: center; padding: 0; }
.mon-ico svg { width: 22px; height: 22px; }
.mon-ico:active { transform: scale(0.92); }
.md-drag { flex: 1; font-size: 13px; opacity: 0.85; text-align: center; }
.md-grip { position: absolute; right: 0; bottom: 0; width: 34px; height: 34px; display: grid; place-items: end; padding: 0 3px 0 0; color: #fff; background: #c8101e; border-radius: 10px 0 4px 0; font-size: 18px; line-height: 1; cursor: nwse-resize; touch-action: none; }
.tip-btn.on { background: #b07d00; border-color: #ffd34d; }
.mon-tip b { color: #b0000f; }
.mon-btn .mb-txt { font-size: 15px; line-height: 1.2; }
.mon-tip { margin: -2px 0 4px; padding: 8px 12px; padding-right: 120px; border-radius: 8px; background: #ffd640; color: #1a1a1a; font-size: 17px; line-height: 1.55; }
.mon-tip.pop { animation: tippop 0.5s ease-out; }
@keyframes tippop { 0% { background: #fff; } 100% { background: #ffd640; } }
.mon-hint:has(.mon-tip:not([hidden])) .mh-rules { display: none; }
.mon-hint { height: 132px; overflow-y: auto; }
.md-body { padding-bottom: 26px; }
.md-grip-tip { position: absolute; right: 40px; bottom: 6px; font-size: 13px; color: #ffb3b8; pointer-events: none; }
