/* ============================================================
   医院主题 · AI 情境教学平台
   设计基调：医用青绿 + 洁净白 + 监护仪深蓝；全站最小字号 15px
   ============================================================ */

:root {
  --primary: #0e8f86;          /* 医用青绿 */
  --primary-dark: #0a6e67;
  --primary-deep: #07433f;
  --accent: #1392c8;           /* 输液蓝 */
  --monitor: #0b2440;          /* 监护仪深蓝 */
  --monitor-green: #2ee6a8;    /* 心电绿 */
  --bg: #eef6f5;
  --card: #ffffff;
  --text: #16323a;
  --muted: #5b7480;
  --danger: #d23f3f;
  --warn: #e07b1f;
  --ok: #1e8e5a;
  --border: #d8e7e5;
  --radius: 16px;
  --shadow: 0 3px 16px rgba(10, 110, 103, .10);
  --shadow-hover: 0 10px 28px rgba(10, 110, 103, .18);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; }

body {
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", sans-serif;
  /* 洁净诊室背景：淡青渐变 + 医疗十字暗纹 */
  background:
    url("data:image/svg+xml,%3Csvg width='84' height='84' viewBox='0 0 84 84'%3E%3Cpath d='M38 30h8v8h8v8h-8v8h-8v-8h-8v-8h8z' fill='%230e8f86' fill-opacity='0.045'/%3E%3C/svg%3E"),
    linear-gradient(160deg, #e4f2f0 0%, #eef6f5 45%, #e8f1f6 100%);
  color: var(--text);
  line-height: 1.7;
  font-size: 16px;
}

a { color: var(--primary-dark); text-decoration: none; }

/* ============ 动效关键帧 ============ */
@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  14% { transform: scale(1.22); }
  28% { transform: scale(1); }
  42% { transform: scale(1.18); }
  60% { transform: scale(1); }
}
@keyframes floaty {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}
@keyframes blink { 50% { opacity: .3; } }
@keyframes sirenGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(210, 63, 63, .45); }
  50% { box-shadow: 0 0 0 12px rgba(210, 63, 63, 0); }
}
@keyframes shakeIn {
  0% { transform: translateX(0); }
  20% { transform: translateX(-7px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(2px); }
  100% { transform: translateX(0); }
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes ecgDash {
  from { stroke-dashoffset: 1000; }
  to { stroke-dashoffset: 0; }
}
@keyframes scanline {
  from { background-position: 0 0; }
  to { background-position: 240px 0; }
}
@keyframes breathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.015); }
}
@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .45; transform: scale(.8); }
}

/* ============ 顶部导航 ============ */
.topbar {
  background: linear-gradient(120deg, var(--primary-deep), var(--primary-dark) 55%, var(--primary));
  color: #fff;
  padding: 0 30px;
  display: flex;
  align-items: center;
  gap: 26px;
  height: 64px;
  box-shadow: 0 2px 14px rgba(7, 67, 63, .35);
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar .logo-cross {
  width: 34px; height: 34px; border-radius: 9px;
  background: #fff; color: var(--primary-dark);
  display: flex; align-items: center; justify-content: center;
  font-size: 21px; font-weight: 900;
  animation: heartbeat 2.4s ease-in-out infinite;
  flex-shrink: 0;
}
.topbar .brand { font-size: 17px; font-weight: 700; letter-spacing: .5px; line-height: 1.3; }
.topbar .brand small { display: block; font-size: 15px; font-weight: 400; opacity: .8; letter-spacing: 1px; }
.topbar nav { display: flex; gap: 6px; flex: 1; }
.topbar nav a {
  color: rgba(255,255,255,.9);
  padding: 7px 16px;
  border-radius: 10px;
  font-size: 15px;
  transition: .18s;
}
.topbar nav a:hover, .topbar nav a.active { background: rgba(255,255,255,.18); color: #fff; transform: translateY(-1px); }
.topbar .user { font-size: 15px; opacity: .95; display: flex; align-items: center; gap: 10px; }
.topbar .user form { display: inline; }
.topbar .user button {
  background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.4);
  color: #fff; border-radius: 9px; padding: 5px 14px; cursor: pointer; font-size: 15px;
  transition: .18s;
}
.topbar .user button:hover { background: rgba(255,255,255,.3); }

.container { max-width: 1760px; margin: 26px auto 56px; padding: 0 28px; }

/* ============ 宽屏多栏布局 ============ */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; align-items: start; }
.grid-21 { display: grid; grid-template-columns: 1.6fr 1fr; gap: 22px; align-items: start; }
.grid-12 { display: grid; grid-template-columns: 1fr 1.6fr; gap: 22px; align-items: start; }
.col { display: flex; flex-direction: column; }
.sticky-col { position: sticky; top: 84px; }
@media (max-width: 1100px) {
  .grid-2, .grid-21, .grid-12 { grid-template-columns: 1fr; }
  .sticky-col { position: static; }
}

/* ============ 卡片 ============ */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px 28px;
  margin-bottom: 22px;
  border: 1px solid var(--border);
  border-top: 3px solid transparent;
  background-clip: padding-box;
  animation: slideUp .45s ease both;
  transition: box-shadow .25s, transform .25s;
}
.card:hover { box-shadow: var(--shadow-hover); }
.card h2 { font-size: 19px; margin-bottom: 14px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.card h3 { font-size: 16px; margin: 14px 0 8px; }
.card h2 .icon {
  display: inline-flex; width: 34px; height: 34px; border-radius: 10px;
  align-items: center; justify-content: center; font-size: 19px;
  background: linear-gradient(135deg, #d9efed, #eaf7f5);
  animation: floaty 3.2s ease-in-out infinite;
  flex-shrink: 0;
}
.card h2 .icon.alert { background: linear-gradient(135deg, #fde3e3, #fff0f0); animation: heartbeat 1.6s infinite; }
.card h2 .icon.ai { background: linear-gradient(135deg, #ddeefc, #eef7ff); }

.phase-tag {
  display: inline-block; font-size: 15px; padding: 2px 13px; border-radius: 20px;
  background: #dcefed; color: var(--primary-dark); font-weight: 600;
}
.phase-tag.teal { background: #d7f0ec; color: var(--primary-dark); }
.phase-tag.orange { background: #fdeede; color: var(--warn); }

.muted { color: var(--muted); font-size: 15px; }

/* ============ 按钮 ============ */
.btn {
  display: inline-block; border: none; cursor: pointer; font-size: 16px;
  padding: 11px 28px; border-radius: 11px; font-weight: 600;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff; transition: .2s; position: relative;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(10,110,103,.3); }
.btn.secondary { background: #e3eeec; color: var(--text); }
.btn.secondary:hover { box-shadow: 0 6px 14px rgba(10,110,103,.15); }
.btn.danger { background: linear-gradient(135deg, #e25555, #c43333); animation: sirenGlow 2s infinite; }
.btn.danger:hover { box-shadow: 0 8px 18px rgba(210,63,63,.4); }
.btn.ghost { background: transparent; border: 1.5px solid var(--primary); color: var(--primary-dark); }
.btn:disabled { background: #b9cbc8; cursor: not-allowed; animation: none; }
.btn.small { padding: 6px 16px; font-size: 15px; }

/* ============ 消息 ============ */
.messages { margin-bottom: 18px; }
.msg { padding: 13px 18px; border-radius: 11px; margin-bottom: 8px; font-size: 15px; animation: slideUp .35s ease both; }
.msg.success { background: #e2f4ea; color: var(--ok); border: 1px solid #bfe5d0; }
.msg.error { background: #fdeaea; color: var(--danger); border: 1px solid #f5c6c6; }

/* ============ 表单 ============ */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 15px; font-weight: 600; margin-bottom: 6px; }
.field input[type=text], .field input[type=password], .field input[type=number],
.field select, .field textarea {
  width: 100%; padding: 11px 14px; border: 1.5px solid var(--border);
  border-radius: 11px; font-size: 15px; font-family: inherit; background: #fcfefe;
  transition: border-color .2s, box-shadow .2s;
}
.field textarea { min-height: 92px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(14,143,134,.14);
}

/* ============ 首页阶段卡 ============ */
.phase-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.phase-card {
  background: var(--card); border-radius: var(--radius); border: 1px solid var(--border);
  box-shadow: var(--shadow); padding: 24px; display: flex; flex-direction: column; gap: 10px;
  transition: .25s; position: relative; overflow: hidden;
  animation: slideUp .45s ease both;
}
.phase-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
}
.phase-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-hover); }
.phase-card .num {
  width: 44px; height: 44px; border-radius: 13px;
  background: linear-gradient(135deg, #d9efed, #ddeefc);
  color: var(--primary-dark); font-weight: 800; display: flex;
  align-items: center; justify-content: center; font-size: 21px;
}
.phase-card:hover .num { animation: floaty 1.6s ease-in-out infinite; }
.phase-card h3 { font-size: 16px; margin: 0; color: var(--muted); font-weight: 600; }
.phase-card .status { font-size: 15px; }
.status .ok { color: var(--ok); font-weight: 600; }
.status .pending { color: var(--warn); font-weight: 600; }
.status .locked { color: var(--muted); }
.phase-card .btn { margin-top: auto; text-align: center; }

/* 首页欢迎语：铺满卡片宽度，不提前换行 */
.home-hero-text { font-size: 16px; opacity: .94; width: 100%; max-width: none; margin: 8px 0 0; line-height: 1.85; }

/* 阶段卡头部：图标在左，阶段名称大字号在右 */
.phase-head { display: flex; align-items: center; gap: 14px; }
.phase-head .num {
  width: 54px; height: 54px; border-radius: 15px; font-size: 26px; flex-shrink: 0;
}
.phase-name {
  font-size: 23px; font-weight: 800; line-height: 1.2;
  color: var(--primary-dark); letter-spacing: .5px; white-space: nowrap;
}
.phase-actions { margin-top: auto; display: flex; flex-direction: column; gap: 8px; }
.phase-actions .btn { margin-top: 0; }

/* 拓展变体病例卡片（并排可选） */
.variant-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 14px; margin-top: 14px;
}
.variant-card {
  border: 1.5px solid var(--border); border-radius: 14px; padding: 16px 16px 18px;
  background: linear-gradient(180deg, #ffffff, #f6fbfa);
  display: flex; flex-direction: column; gap: 8px; transition: .2s;
}
.variant-card:hover { border-color: var(--primary); transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.variant-title { font-size: 16px; font-weight: 700; color: var(--primary-dark); line-height: 1.4; }
.variant-cc { font-size: 13px; color: var(--accent); font-weight: 600; }
.variant-brief { font-size: 13.5px; color: var(--muted); line-height: 1.7; margin: 0; flex: 1; }
.variant-card .btn { align-self: flex-start; margin-top: 4px; }

/* ============ 教师端 · 课堂实况 ============ */
.live-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(440px, 1fr));
  gap: 16px;
}
.live-empty { color: var(--muted); text-align: center; padding: 40px; }
.live-panel { display: flex; flex-direction: column; gap: 10px; padding: 18px 20px; }
.live-panel.running { border: 1.5px solid var(--primary); box-shadow: 0 0 0 3px rgba(13,148,136,.08); }
.live-panel.idle { opacity: .75; }
.lp-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.lp-name { font-size: 17px; font-weight: 800; color: var(--primary-dark); }
.lp-idle-body { color: var(--muted); font-size: 14px; padding: 18px 0 8px; }
.lp-stage { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.lp-day {
  font-size: 12.5px; font-weight: 700; color: #fff; background: var(--primary);
  border-radius: 999px; padding: 2px 10px;
}
.lp-stage-title { font-weight: 700; font-size: 15px; flex: 1; }
.lp-score { font-size: 13.5px; color: var(--muted); }
.lp-score b { color: var(--primary-dark); font-size: 16px; }
.lp-vitals {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px;
}
.lv-item {
  background: #0b2440; color: #d7f7ef; border-radius: 8px;
  padding: 5px 8px; display: flex; flex-direction: column; min-width: 0;
}
.lv-item .k { font-size: 11px; opacity: .75; }
.lv-item .v { font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lp-meta {
  display: flex; flex-wrap: wrap; gap: 6px 16px;
  font-size: 13px; color: var(--muted);
  border-top: 1px dashed var(--border); padding-top: 8px;
}
.lp-meta b { color: var(--text); }
.lp-timeline {
  list-style: none; margin: 0; padding: 8px 10px;
  background: #f6f9f8; border-radius: 10px;
  display: flex; flex-direction: column; gap: 4px;
  min-height: 120px; max-height: 168px; overflow-y: auto;
  font-size: 13px;
}
.lp-timeline li { display: flex; gap: 8px; align-items: baseline; line-height: 1.5; }
.lp-timeline .t { font-family: Consolas, monospace; color: var(--muted); flex-shrink: 0; font-size: 12px; }
.lp-timeline .ic { flex-shrink: 0; }
.lp-timeline .m { min-width: 0; }
.lp-timeline .lk-error .m { color: var(--danger); }
.lp-timeline .lk-miss .m { color: var(--warn); }
.lp-timeline .lk-nudge .m { color: #b45309; font-weight: 600; }
.lp-timeline .lk-correct .m { color: var(--ok); }
.lp-timeline .lk-outcome .m { font-weight: 700; }
.lp-foot {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: auto; gap: 10px;
}

/* ============ 教师端 · 投屏镜像/动态回放 ============ */
.mirror-controls {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 14px 20px; margin-bottom: 18px;
}
.mirror-controls .btn { margin-top: 0; }
.mirror-progress {
  flex: 1; min-width: 160px; height: 10px; border-radius: 999px;
  background: #e3ebe9; overflow: hidden;
}
.mirror-progress-fill {
  height: 100%; width: 0; border-radius: 999px;
  background: linear-gradient(90deg, var(--primary), #2ee6a8);
  transition: width .12s linear;
}
/* 镜像页双栏布局：左侧病情面板固定宽，右侧操作实录铺满剩余空间 */
.mirror-layout {
  display: grid;
  grid-template-columns: 400px minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
}
.mirror-left { min-width: 0; }
.mirror-right { min-width: 0; display: flex; flex-direction: column; }
@media (max-width: 980px) {
  .mirror-layout { grid-template-columns: 1fr; }
}
.mirror-feed-card { display: flex; flex-direction: column; flex: 1; }
.mirror-feed {
  flex: 1; min-height: 480px; max-height: 74vh; overflow-y: auto;
  display: flex; flex-direction: column; gap: 8px;
  background: #f6f9f8; border-radius: 12px; padding: 14px;
}
.mr-event {
  display: flex; gap: 10px; align-items: baseline;
  background: #fff; border: 1px solid var(--border); border-radius: 12px;
  padding: 9px 14px; font-size: 14.5px; line-height: 1.6;
  animation: slideUp .3s ease both; max-width: 92%;
}
.mr-event .t { font-family: Consolas, monospace; font-size: 12.5px; color: var(--muted); flex-shrink: 0; }
.mr-event .ic { flex-shrink: 0; }
.mr-event .m { min-width: 0; }
.mr-event.bad { border-color: #fca5a5; background: #fef2f2; }
.mr-event.bad .m { color: var(--danger); font-weight: 600; }
.mr-event.warn { border-color: #fcd9a0; background: #fffbeb; }
.mr-event.warn .m { color: #b45309; }
.mr-event.good { border-color: #a7e3c9; background: #f0fdf6; }
.mr-event.good .m { color: var(--ok); font-weight: 600; }
.mr-event.nudge {
  border-color: #f0ad4e; background: linear-gradient(120deg, #fff3df, #fff9ec);
  align-self: flex-end;
}
.mr-event.nudge .m { color: #b45309; font-weight: 700; }
.mr-event.diag { border-color: #93c5fd; background: #eff6ff; }
.mr-event.diag .m { font-weight: 700; color: #1d4ed8; }
.mr-event.stage { border-color: var(--primary); background: #e6f6f3; }
.mr-event.stage .m { font-weight: 700; color: var(--primary-dark); }
.mr-event.outcome { border-width: 2px; }
.mr-event.outcome .m { font-weight: 800; font-size: 15.5px; }
.mirror-outcome {
  display: flex; align-items: center; gap: 18px;
  margin-top: 14px; border-radius: 14px; padding: 16px 20px;
  animation: slideUp .4s ease both;
}
.mirror-outcome img { width: 110px; border-radius: 12px; }
.mirror-outcome .big { font-size: 22px; font-weight: 800; }
.mirror-outcome .sub { font-size: 14.5px; color: var(--muted); margin-top: 4px; }
.mirror-outcome.good { background: #f0fdf6; border: 2px solid #a7e3c9; }
.mirror-outcome.good .big { color: var(--ok); }
.mirror-outcome.bad { background: #fef2f2; border: 2px solid #fca5a5; }
.mirror-outcome.bad .big { color: var(--danger); }

/* 练习数据回看 / 课后复盘列表 */
.runs-list { display: flex; flex-direction: column; gap: 12px; }
.run-row {
  border: 1.5px solid var(--border); border-left-width: 5px; border-radius: 12px;
  padding: 12px 16px; background: #fcfefe;
}
.run-row.good { border-left-color: var(--ok); }
.run-row.bad { border-left-color: var(--danger); }
.run-row-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.run-no { font-size: 16px; font-weight: 800; color: var(--primary-dark); }
.run-outcome { font-size: 13px; font-weight: 700; padding: 2px 12px; border-radius: 14px; }
.run-outcome.good { background: #dcfce7; color: #16a34a; }
.run-outcome.bad { background: #fee2e2; color: #dc2626; }
.run-date { font-size: 12px; color: var(--muted); margin-left: auto; }
.run-metrics { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 13.5px; color: var(--muted); }
.run-metrics b { color: var(--text); font-weight: 700; }
.run-row-foot { margin-top: 10px; }

/* ============ 课中模拟 ============ */
.sim-header {
  display: flex; justify-content: space-between; align-items: center;
  background:
    linear-gradient(120deg, var(--monitor), #123a63);
  color: #fff; padding: 15px 26px;
  border-radius: var(--radius); margin-bottom: 20px;
  border: 1px solid #1c4a7c;
  position: relative; overflow: hidden;
}
.sim-header::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(90deg, transparent 0 118px, rgba(46,230,168,.06) 118px 120px);
  animation: scanline 6s linear infinite;
}
.sim-header .title { font-weight: 700; font-size: 17px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.live-dot {
  width: 11px; height: 11px; border-radius: 50%; background: #ff5252;
  display: inline-block; animation: pulseDot 1.2s infinite;
}
.sim-header .timer {
  font-size: 30px; font-weight: 800; font-variant-numeric: tabular-nums;
  background: rgba(46,230,168,.12); color: var(--monitor-green);
  padding: 4px 20px; border-radius: 12px; border: 1px solid rgba(46,230,168,.35);
  font-family: Consolas, monospace; z-index: 1;
}
.sim-header .timer.warning { color: #ffb74d; border-color: rgba(255,183,77,.4); background: rgba(255,183,77,.1); }
.sim-header .timer.critical { color: #ff5252; border-color: rgba(255,82,82,.5); background: rgba(255,82,82,.12); animation: blink 1s step-end infinite; }

/* 顶部：生命体征（倒计时左侧，两排展示） */
.sim-header-right { display: flex; align-items: center; gap: 16px; z-index: 1; position: relative; }
.sim-vitals {
  display: grid; grid-template-columns: repeat(3, minmax(118px, 1fr));
  gap: 7px 8px; align-items: stretch; justify-items: stretch;
}
.hv-item {
  background: rgba(8,28,52,.55); color: var(--monitor-green);
  font-family: Consolas, monospace; font-weight: 600; font-size: 13px;
  padding: 6px 11px; border-radius: 8px;
  border: 1px solid rgba(46,230,168,.28); white-space: nowrap;
  display: flex; align-items: center; gap: 6px;
}
.hv-item::before { content: '❤'; font-size: 12px; color: #ff5d73; animation: heartbeat 1.5s infinite; }
@media (max-width: 880px) {
  .sim-header { flex-direction: column; align-items: stretch; gap: 12px; }
  .sim-header-right { justify-content: space-between; }
  .sim-vitals { grid-template-columns: repeat(2, auto); }
}

/* 病人状态图 */
.patient-figure {
  border-radius: 14px; overflow: hidden; margin-bottom: 14px;
  aspect-ratio: 4 / 3; background: #0b1e28;
  border: 1px solid var(--border); position: relative;
}
.patient-figure img { width: 100%; height: 100%; object-fit: cover; display: block; animation: breathe 4.5s ease-in-out infinite; }
.patient-figure.critical img { animation: breathe 1.8s ease-in-out infinite; }
.patient-figure .state-badge {
  position: absolute; top: 12px; left: 12px;
  padding: 4px 14px; border-radius: 20px; font-size: 15px; font-weight: 700;
  background: rgba(11,36,64,.82); color: var(--monitor-green);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
.patient-figure.critical .state-badge { color: #ff8a80; animation: blink 1.1s step-end infinite; }

.vitals { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0 4px; }
.vital {
  background: var(--monitor); color: var(--monitor-green); font-family: Consolas, monospace;
  padding: 9px 15px; border-radius: 11px; font-size: 15px; font-weight: 600;
  border: 1px solid rgba(46,230,168,.25);
  display: inline-flex; align-items: center; gap: 8px;
}
.vital::before { content: '❤'; font-size: 15px; color: #ff5d73; animation: heartbeat 1.5s infinite; }

.narrative {
  background: linear-gradient(120deg, #fff8e9, #fffcf3);
  border-left: 5px solid #f0b429;
  padding: 15px 18px; border-radius: 10px; font-size: 15.5px; margin-bottom: 6px;
}
.narrative.emergency {
  background: linear-gradient(120deg, #fdecec, #fff5f5);
  border-left-color: var(--danger);
  animation: sirenGlow 2.2s infinite;
}

.action-group { margin-bottom: 18px; }
.action-group h3 {
  font-size: 15px; color: var(--primary-dark); border-bottom: 2px solid #d9efed;
  padding-bottom: 6px; margin-bottom: 10px; display: flex; align-items: center; gap: 8px;
}
.action-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(255px, 1fr)); gap: 9px; }
.action-item {
  display: flex; align-items: flex-start; gap: 10px; padding: 11px 14px;
  border: 1.5px solid var(--border); border-radius: 11px; cursor: pointer;
  font-size: 15px; background: #fcfefe; transition: .15s;
}
.action-item:hover { border-color: var(--primary); background: #f1faf8; transform: translateY(-2px); box-shadow: 0 4px 10px rgba(10,110,103,.12); }
.action-item input { margin-top: 4px; accent-color: var(--primary); width: 16px; height: 16px; }
.action-item:has(input:checked) { border-color: var(--primary); background: #e2f2ef; box-shadow: inset 0 0 0 1px var(--primary); }

.nudge {
  background: linear-gradient(120deg, #fff3df, #fff9ec);
  border: 1.5px solid #f0ad4e; border-radius: var(--radius);
  padding: 18px 22px; margin-bottom: 20px;
  animation: shakeIn .55s ease, sirenGlow 2.6s 1s infinite;
}
.nudge .who { font-weight: 700; color: var(--warn); margin-bottom: 6px; display: flex; gap: 8px; align-items: center; font-size: 16px; }
.nudge .who::before { content: '🤖'; font-size: 21px; animation: floaty 2s ease-in-out infinite; }
.nudge pre { white-space: pre-wrap; font-family: inherit; font-size: 15.5px; }
.nudge .src { font-size: 15px; color: var(--muted); margin-top: 8px; transform-origin: left; }

/* AI 教练大弹窗 */
.nudge-reopen { margin-top: 14px; }
.nudge-overlay { z-index: 240; }
.nudge-modal {
  max-width: 620px; width: 92vw;
  border-top: 6px solid #f0ad4e;
  animation: slideUp .3s ease both;
}
.nudge-modal .modal-header {
  background: linear-gradient(120deg, #fff3df, #fff9ec);
}
.nudge-modal .modal-header h3 { color: #b45309; font-size: 19px; }
.nudge-modal .nudge-text {
  white-space: pre-wrap; font-family: inherit; font-size: 16px; line-height: 1.85;
  margin: 0; color: var(--text);
}
.nudge-modal .nudge-src { font-size: 14px; color: var(--muted); margin-top: 14px; }
.nudge-footer {
  display: flex; justify-content: flex-end; gap: 12px;
  padding: 16px 22px 20px; border-top: 1px solid var(--border);
}
.nudge-footer .btn { width: auto; padding: 11px 24px; font-size: 15px; }

/* ============ 结局 ============ */
.outcome-banner {
  text-align: center; padding: 26px 20px; border-radius: var(--radius); margin-bottom: 22px;
  animation: slideUp .5s ease both;
}
.outcome-banner.good { background: linear-gradient(135deg, #e3f6ec, #f0fbf4); border: 2px solid #7fd3a6; }
.outcome-banner.bad { background: linear-gradient(135deg, #fbe7e7, #fdf1f1); border: 2px solid #e08c8c; animation: slideUp .5s ease both, sirenGlow 2.5s 1s 3; }
.outcome-banner.mid { background: linear-gradient(135deg, #fdf2e3, #fef9ef); border: 2px solid #ecbd7c; }
.outcome-banner h1 { font-size: 28px; margin-bottom: 8px; }
.outcome-banner p { font-size: 16px; }

/* ============ 时间轴 ============ */
.timeline { list-style: none; padding-left: 0; }
.timeline li {
  display: flex; gap: 14px; padding: 8px 0; border-left: 3px solid var(--border);
  padding-left: 16px; margin-left: 44px; position: relative; font-size: 15px;
  animation: slideUp .4s ease both;
}
.timeline li::before {
  content: ''; width: 12px; height: 12px; border-radius: 50%;
  background: var(--primary); position: absolute; left: -7.5px; top: 14px;
  box-shadow: 0 0 0 3px #d9efed;
}
.timeline li.error::before, .timeline li.miss::before { background: var(--danger); box-shadow: 0 0 0 3px #fbdcdc; }
.timeline li.nudge::before { background: var(--warn); box-shadow: 0 0 0 3px #fdeede; animation: pulseDot 1.6s infinite; }
.timeline li.correct::before, .timeline li.outcome-recovered::before { background: var(--ok); box-shadow: 0 0 0 3px #d8f0e2; }
.timeline .t {
  font-family: Consolas, monospace; color: var(--muted); min-width: 52px;
  position: absolute; left: -66px; font-size: 15px;
}
.timeline li.error .text, .timeline li.miss .text { color: var(--danger); }
.timeline li.nudge .text { color: var(--warn); }
.timeline li.correct .text { color: var(--ok); }

/* ============ 统计 ============ */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 8px; }
.stat {
  background: linear-gradient(160deg, #f4fbfa, #eef6f5); border: 1px solid var(--border); border-radius: 13px;
  padding: 15px 16px; text-align: center; transition: .2s;
}
.stat:hover { transform: translateY(-3px); box-shadow: 0 6px 14px rgba(10,110,103,.14); }
.stat .v { font-size: 27px; font-weight: 800; color: var(--primary-dark); }
.stat .k { font-size: 15px; color: var(--muted); }
.stat.bad .v { color: var(--danger); }
.stat.good .v { color: var(--ok); }

table.data { width: 100%; border-collapse: collapse; font-size: 15px; }
table.data th, table.data td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; }
table.data th { background: #eef6f5; color: var(--muted); font-size: 15px; }
table.data tr:hover td { background: #f1faf8; }

.tag { display: inline-block; padding: 1px 11px; border-radius: 20px; font-size: 15px; font-weight: 600; }
.tag.green { background: #e2f4ea; color: var(--ok); }
.tag.red { background: #fdeaea; color: var(--danger); }
.tag.orange { background: #fdeede; color: var(--warn); }
.tag.blue { background: #ddeefc; color: #0d5e8f; }
.tag.gray { background: #e9f0ef; color: var(--muted); }

/* ============ 报告 ============ */
.report {
  background: #f4fbfa; border: 1px solid var(--border); border-radius: 13px;
  padding: 20px 24px; white-space: pre-wrap; font-size: 15.5px;
}
.report-source { font-size: 15px; color: var(--muted); margin-top: 8px; }

/* ============ 登录/注册 ============ */
.auth-page {
  min-height: calc(100vh - 0px);
  display: grid; grid-template-columns: 1.15fr 1fr;
}
.auth-side {
  background: linear-gradient(rgba(7,67,63,.55), rgba(11,36,64,.72)), var(--auth-img) center/cover no-repeat;
  color: #fff; display: flex; flex-direction: column; justify-content: flex-end;
  padding: 48px 56px;
}
.auth-side h2 { font-size: 30px; margin-bottom: 10px; }
.auth-side p { font-size: 16px; opacity: .92; max-width: 560px; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.auth-box { width: 100%; max-width: 430px; }
.auth-box .brand-big { text-align: center; margin-bottom: 24px; }
.auth-box .brand-big .logo-cross {
  width: 56px; height: 56px; border-radius: 16px; margin: 0 auto 12px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff; font-size: 30px; font-weight: 900;
  display: flex; align-items: center; justify-content: center;
  animation: heartbeat 2.4s infinite;
}
.auth-box .brand-big h1 { font-size: 23px; color: var(--primary-deep); }
.auth-box .brand-big p { color: var(--muted); font-size: 15px; margin-top: 4px; }
@media (max-width: 980px) { .auth-page { grid-template-columns: 1fr; } .auth-side { display: none; } }

/* ============ 独立首页（Landing） ============ */
.landing { font-size: 16px; }
.landing-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; gap: 14px;
  padding: 14px 5vw;
  background: rgba(7, 50, 47, .55);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  color: #fff;
}
.landing-nav .brand { font-weight: 700; font-size: 17px; display: flex; align-items: center; gap: 10px; }
.landing-nav .spacer { flex: 1; }
.landing-nav a.nav-btn {
  color: #fff; padding: 9px 26px; border-radius: 11px; font-size: 16px; font-weight: 600;
  border: 1.5px solid rgba(255,255,255,.6); transition: .2s;
}
.landing-nav a.nav-btn:hover { background: rgba(255,255,255,.18); transform: translateY(-1px); }
.landing-nav a.nav-btn.solid { background: #fff; color: var(--primary-deep); border-color: #fff; }

.landing-hero {
  min-height: 92vh;
  background:
    linear-gradient(rgba(6, 40, 38, .68), rgba(8, 28, 50, .78)),
    var(--hero-img) center/cover no-repeat;
  color: #fff;
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  text-align: center; padding: 120px 6vw 80px; position: relative; overflow: hidden;
}
.landing-hero .kicker {
  font-size: 16px; letter-spacing: 4px; color: var(--monitor-green);
  margin-bottom: 18px; animation: slideUp .6s ease both;
}
.landing-hero h1 {
  font-size: clamp(34px, 4.6vw, 60px); line-height: 1.25; max-width: 1000px;
  margin-bottom: 22px; animation: slideUp .6s .12s ease both;
  text-shadow: 0 4px 30px rgba(0,0,0,.4);
}
.landing-hero .sub {
  font-size: clamp(16px, 1.4vw, 20px); max-width: 760px; opacity: .94;
  margin-bottom: 40px; animation: slideUp .6s .22s ease both;
}
.landing-hero .cta-row { display: flex; gap: 18px; flex-wrap: wrap; justify-content: center; animation: slideUp .6s .32s ease both; }
.landing-hero .cta {
  padding: 15px 44px; border-radius: 14px; font-size: 18px; font-weight: 700;
  background: linear-gradient(135deg, var(--primary), var(--accent)); color: #fff;
  transition: .22s; box-shadow: 0 10px 30px rgba(14,143,134,.45);
}
.landing-hero .cta:hover { transform: translateY(-3px) scale(1.02); }
.landing-hero .cta.outline { background: transparent; border: 2px solid rgba(255,255,255,.75); box-shadow: none; }
.landing-hero .ecg-svg {
  position: absolute; bottom: 0; left: 0; width: 100%; height: 110px; opacity: .85;
}
.landing-hero .ecg-svg path {
  fill: none; stroke: var(--monitor-green); stroke-width: 2.5;
  stroke-dasharray: 1000; animation: ecgDash 5s linear infinite;
  filter: drop-shadow(0 0 6px rgba(46,230,168,.8));
}

.landing-section { padding: 86px 6vw; }
.landing-section.alt { background: linear-gradient(160deg, #eaf5f3, #e7f0f5); }
.landing-section .sec-head { text-align: center; max-width: 820px; margin: 0 auto 50px; }
.landing-section .sec-head .phase-tag { font-size: 16px; margin-bottom: 12px; }
.landing-section .sec-head h2 { font-size: clamp(26px, 3vw, 38px); color: var(--primary-deep); margin-bottom: 12px; }
.landing-section .sec-head p { color: var(--muted); font-size: 17px; }

.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; max-width: 1380px; margin: 0 auto; }
.feature-card {
  background: #fff; border-radius: 20px; padding: 34px 30px;
  border: 1px solid var(--border); box-shadow: var(--shadow);
  transition: .25s; position: relative; overflow: hidden;
}
.feature-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 5px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transform: scaleX(0); transform-origin: left; transition: transform .35s;
}
.feature-card:hover { transform: translateY(-8px); box-shadow: var(--shadow-hover); }
.feature-card:hover::before { transform: scaleX(1); }
.feature-card .f-icon {
  width: 62px; height: 62px; border-radius: 18px; font-size: 31px;
  background: linear-gradient(135deg, #d9efed, #ddeefc);
  display: flex; align-items: center; justify-content: center; margin-bottom: 18px;
}
.feature-card:hover .f-icon { animation: floaty 1.8s ease-in-out infinite; }
.feature-card h3 { font-size: 20px; margin-bottom: 10px; color: var(--primary-deep); }
.feature-card p { color: var(--muted); font-size: 15.5px; }

.flow-strip {
  display: flex; align-items: center; justify-content: center; gap: 0;
  max-width: 1280px; margin: 0 auto; flex-wrap: wrap;
}
.flow-step {
  background: #fff; border: 1px solid var(--border); border-radius: 18px;
  padding: 26px 30px; text-align: center; width: 270px; box-shadow: var(--shadow);
  transition: .25s;
}
.flow-step:hover { transform: translateY(-6px); box-shadow: var(--shadow-hover); }
.flow-step .s-num {
  width: 44px; height: 44px; border-radius: 50%; margin: 0 auto 12px;
  background: linear-gradient(135deg, var(--primary), var(--accent)); color: #fff;
  font-weight: 800; font-size: 19px; display: flex; align-items: center; justify-content: center;
}
.flow-step h4 { font-size: 18px; margin-bottom: 8px; color: var(--primary-deep); }
.flow-step p { font-size: 15px; color: var(--muted); }
.flow-arrow { font-size: 30px; color: var(--primary); padding: 0 16px; animation: floaty 2s ease-in-out infinite; }

.landing-stats { display: flex; justify-content: center; gap: 70px; flex-wrap: wrap; }
.landing-stats .ls { text-align: center; }
.landing-stats .ls .v { font-size: 46px; font-weight: 800; color: var(--primary-dark); font-family: Consolas, monospace; }
.landing-stats .ls .k { font-size: 16px; color: var(--muted); }

.landing-footer {
  background: var(--primary-deep); color: rgba(255,255,255,.85);
  text-align: center; padding: 36px 6vw; font-size: 15px;
}

/* ============ 病程阶段电影式开场 ============ */
@keyframes kenburns {
  from { transform: scale(1.04); }
  to { transform: scale(1.16); }
}
@keyframes cursorBlink { 50% { opacity: 0; } }
@keyframes introVignette {
  0%, 100% { box-shadow: inset 0 0 180px 60px rgba(180, 30, 30, .55); }
  50% { box-shadow: inset 0 0 260px 110px rgba(180, 30, 30, .8); }
}
@keyframes smokeDrift {
  from { transform: scale(.4) translateY(0); opacity: 0; }
  30% { opacity: .9; }
  to { transform: scale(2.6) translateY(-60px); opacity: 0; }
}

.stage-intro {
  position: fixed; inset: 0; z-index: 999;
  background: #04141c;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; cursor: pointer;
  transition: opacity 1.15s ease;
}
.stage-intro .intro-img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; opacity: .85;
  background: #04141c;
  animation: kenburns 7s ease-out forwards;
  transition: filter 1.1s ease, transform 1.1s ease;
}
.stage-intro .intro-skip-btn {
  position: absolute; bottom: 30px; right: 38px; z-index: 4;
  padding: 10px 22px; border-radius: 999px;
  border: 1.5px solid rgba(255, 255, 255, .45);
  background: rgba(4, 20, 28, .55); color: rgba(255, 255, 255, .88);
  font-size: 15px; letter-spacing: 1px; cursor: pointer;
}
.stage-intro .intro-skip-btn:hover { background: rgba(4, 20, 28, .78); }
.stage-intro .intro-veil {
  position: absolute; inset: 0;
  background: linear-gradient(rgba(4, 22, 30, .45), rgba(4, 22, 30, .82) 78%);
}
.stage-intro.critical .intro-veil { animation: introVignette 1.6s ease-in-out infinite; }
.stage-intro .intro-text {
  position: relative; z-index: 2; text-align: center; color: #fff;
  padding: 0 6vw; max-width: 1200px;
}
.stage-intro .intro-kicker {
  font-size: 17px; letter-spacing: 5px; color: var(--monitor-green);
  margin-bottom: 20px; display: flex; align-items: center; justify-content: center; gap: 10px;
}
.stage-intro.critical .intro-kicker { color: #ff8a80; }
.stage-intro h1 {
  font-size: clamp(30px, 4.2vw, 56px); line-height: 1.35;
  text-shadow: 0 4px 36px rgba(0, 0, 0, .65);
  min-height: 1.4em;
}
.stage-intro h1 .type-cursor {
  display: inline-block; width: .55em; color: var(--monitor-green);
  animation: cursorBlink .75s step-end infinite; font-weight: 400;
}
.stage-intro.critical h1 .type-cursor { color: #ff8a80; }
.stage-intro .intro-day {
  margin-top: 26px; font-size: clamp(18px, 1.8vw, 26px); font-weight: 600;
  color: rgba(255, 255, 255, .92); letter-spacing: 3px;
  opacity: 0; transform: translateY(14px);
  transition: opacity .6s ease, transform .6s ease;
}
.stage-intro .intro-day.show { opacity: 1; transform: translateY(0); }

/* 烟雾散场 */
.stage-intro .smoke {
  position: absolute; border-radius: 50%; pointer-events: none; opacity: 0; z-index: 3;
  background: radial-gradient(circle, rgba(225, 240, 238, .85) 0%, rgba(225, 240, 238, 0) 65%);
  filter: blur(14px);
}
.stage-intro.dissolve { opacity: 0; }
.stage-intro.dissolve .intro-img { filter: blur(26px) brightness(1.7); transform: scale(1.28); }
.stage-intro.dissolve .smoke { animation: smokeDrift 1.15s ease-out forwards; }

/* ============ 选择题选项 ============ */
.options-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 18px; }
.options-grid label { font-weight: 400; display: block; padding: 4px 0; cursor: pointer; font-size: 15px; }
@media (max-width: 900px) { .options-grid { grid-template-columns: 1fr; } }

@media (max-width: 980px) {
  .feature-grid { grid-template-columns: 1fr; }
  .flow-arrow { transform: rotate(90deg); padding: 10px 0; }
}
@media (max-width: 860px) {
  .phase-grid, .stat-grid { grid-template-columns: 1fr; }
  .action-list { grid-template-columns: 1fr; }
  .topbar { flex-wrap: wrap; height: auto; padding: 10px 16px; }
}

/* ============ 课前预习 2×2 网格 ============ */
.precourse-header { margin-bottom: 14px; padding: 14px 24px; }
.precourse-header-inner {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
}
.precourse-header-inner .precourse-tags {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.precourse-header-inner .btn { margin-left: auto; flex-shrink: 0; }

.precourse-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: start;
}
@media (max-width: 1100px) {
  .precourse-grid { grid-template-columns: 1fr; }
}

/* 四个模块的淡色背景 */
.card-blue  { background: linear-gradient(170deg, #eaf4fd 0%, #f5f9fd 100%); }
.card-green { background: linear-gradient(170deg, #eaf7f0 0%, #f5fbf7 100%); }
.card-yellow{ background: linear-gradient(170deg, #fef9e7 0%, #fefdf6 100%); }
.card-purple{ background: linear-gradient(170deg, #f3eef9 0%, #faf8fd 100%); }

/* 预习四卡：固定外框尺寸，内容超出在卡内滚动，不随内容拉伸/收缩 */
.precourse-fixed {
  height: 440px;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.precourse-fixed > h2 { flex-shrink: 0; }
.precourse-card-body {
  flex: 1; min-height: 0;
  overflow-y: auto;
  padding-right: 6px;
}
.precourse-card-body::-webkit-scrollbar { width: 6px; }
.precourse-card-body::-webkit-scrollbar-thumb { background: rgba(0,0,0,.15); border-radius: 3px; }

/* 预习资料行 + 弹窗查看全文 */
.resource-row {
  display: flex; align-items: center; gap: 12px;
  border: 1px solid var(--border); border-radius: 12px;
  background: rgba(255,255,255,.65);
  padding: 12px 14px; margin-bottom: 10px;
}
.resource-info { flex: 1; min-width: 0; }
.resource-title { font-weight: 700; font-size: 15px; color: var(--primary-dark); }
.resource-summary { font-size: 13.5px; color: var(--muted); margin-top: 3px; line-height: 1.5; }
.resource-row .btn { flex-shrink: 0; width: auto; }

/* 折叠/展开 */
.hidden { display: none; }

.precourse-summary {
  display: flex; flex-direction: column; gap: 6px;
  font-size: 15px; line-height: 1.6;
}
.precourse-summary p { margin: 0; }

/* ============ 对话框（情境导入页） ============ */
.dialog-box {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 18px 22px; border-radius: 13px; margin-bottom: 14px;
  animation: slideUp .4s ease both;
  position: relative;
}
.dialog-box .dialog-avatar {
  width: 48px; height: 48px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; flex-shrink: 0;
}
.dialog-box .dialog-content { flex: 1; min-width: 0; }
.dialog-box .dialog-speaker {
  font-size: 16px; font-weight: 700; margin-bottom: 8px;
  letter-spacing: .5px;
}
.dialog-box .dialog-content p {
  margin: 0; font-size: 19px; line-height: 1.85; font-weight: 500;
}

/* 患者主诉 —— 蓝色调 */
.dialog-patient {
  background: linear-gradient(135deg, #eaf4fd, #f3f8fe);
  border: 1px solid #c4dcf0;
}
.dialog-patient .dialog-avatar { background: #d0e4f5; }
.dialog-patient .dialog-speaker { color: #1a5f8a; }

/* 家属代诉 —— 暖色调 */
.dialog-family {
  background: linear-gradient(135deg, #fef5e7, #fffbf3);
  border: 1px solid #eed9b8;
}
.dialog-family .dialog-avatar { background: #f5e2c6; }
.dialog-family .dialog-speaker { color: #b5731a; }

/* ============ 接诊页三栏布局 ============ */
.sim-layout {
  display: grid;
  grid-template-columns: 1fr 340px 1.4fr;
  gap: 16px;
  align-items: start;
}
.sim-left { min-width: 0; }
.sim-right { min-width: 0; }
@media (max-width: 1380px) {
  .sim-layout { grid-template-columns: 1fr 1fr; }
  .sim-phone { display: none; }
}
@media (max-width: 980px) {
  .sim-layout { grid-template-columns: 1fr; }
}

/* ============ 手机屏幕模块 ============ */
.sim-phone {
  position: sticky; top: 84px;
  display: flex; flex-direction: column; align-items: center;
}
.phone-frame {
  width: 320px; height: 560px;
  background: #1a1a2e;
  border-radius: 32px;
  border: 3px solid #2d2d44;
  box-shadow: 0 0 0 4px #16162a, 0 12px 40px rgba(0,0,0,.35);
  display: flex; flex-direction: column;
  overflow: hidden; position: relative;
}
.phone-notch {
  width: 140px; height: 24px;
  background: #0d0d18;
  border-radius: 0 0 18px 18px;
  margin: 0 auto;
  position: relative; z-index: 2;
}
.phone-status-bar {
  display: flex; justify-content: space-between;
  padding: 4px 20px 2px;
  font-size: 12px; color: rgba(255,255,255,.6);
  font-family: "SF Pro Text", "Segoe UI", sans-serif;
}
.phone-screen {
  flex: 1; overflow-y: auto;
  padding: 12px 14px 16px;
  display: flex; flex-direction: column;
  gap: 10px;
  scroll-behavior: smooth;
}
.phone-screen::-webkit-scrollbar { width: 3px; }
.phone-screen::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 3px; }

/* 手机空状态 */
.chat-empty {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  color: rgba(255,255,255,.3); text-align: center; gap: 8px;
}
.chat-empty-icon { font-size: 40px; opacity: .5; }
.chat-empty p { font-size: 13px; line-height: 1.6; margin: 0; }

/* 聊天气泡 */
.chat-bubble {
  max-width: 88%; animation: slideUp .3s ease both;
}
.chat-bubble .chat-speaker {
  font-size: 11px; font-weight: 600; margin-bottom: 3px;
  opacity: .7; padding: 0 4px;
}
.chat-bubble .chat-text {
  padding: 9px 13px; border-radius: 14px;
  font-size: 13.5px; line-height: 1.55; word-break: break-word;
}
/* 对方（患者）—— 左侧灰色 */
.chat-bubble.left { align-self: flex-start; }
.chat-bubble.left .chat-speaker { color: #a0c4ff; }
.chat-bubble.left .chat-text {
  background: #2a2a40; color: #e0e0e0;
  border-bottom-left-radius: 4px;
}
/* 自己（医生）—— 右侧绿色 */
.chat-bubble.right { align-self: flex-end; text-align: right; }
.chat-bubble.right .chat-speaker { color: #7bed9f; }
.chat-bubble.right .chat-text {
  background: #0e8f86; color: #fff;
  border-bottom-right-radius: 4px;
}

/* ============ 模块化折叠结构 ============ */
/* 情境导入：患者情况描述（放大、加粗、微软雅黑，铺满模块宽度） */
.briefing-brief {
  font-family: 'Microsoft YaHei', '微软雅黑', 'PingFang SC', sans-serif;
  font-size: 19.5px; font-weight: 700; line-height: 1.95;
  width: 100%; max-width: none; margin: 0; letter-spacing: .2px;
}

/* 规则声明弹窗底部（阅读倒计时确认） */
.rules-modal-footer {
  padding: 14px 22px 20px; border-top: 1px solid var(--border);
  display: flex; justify-content: center;
}
.rules-modal-footer .btn { min-width: 240px; text-align: center; }

.card-sub {
  font-size: 14px; color: var(--muted); margin: 0 0 16px 0;
}
.card-head-row {
  display: flex; align-items: baseline; justify-content: space-between;
  flex-wrap: wrap; gap: 6px 14px; margin-bottom: 14px;
}
.card-head-row h2 { margin-bottom: 0; }
.card-sub-inline {
  font-size: 14px; color: var(--muted); white-space: nowrap;
}
.module-block {
  border: 1.5px solid #d1e7e4;
  border-radius: 12px;
  margin-bottom: 14px;
  overflow: hidden;
  background: #f8fcfb;
  transition: border-color .2s;
}
.module-block.module-collapsed {
  background: #fafefe;
  opacity: .85;
}
.module-block.module-collapsed:hover {
  opacity: 1;
  border-color: var(--primary);
}

.module-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  cursor: pointer;
  -webkit-user-select: none; user-select: none;
  transition: background .15s;
}
.module-header:hover {
  background: #eef6f5;
}
.module-header h3 {
  font-size: 16px;
  color: var(--primary-dark);
  margin: 0;
  border: none;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.module-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}
.module-toggle {
  font-size: 14px;
  color: var(--muted);
  transition: transform .2s;
}

.module-body {
  padding: 4px 16px 14px;
  border-top: 1px solid #e8f0ee;
}

.module-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px dashed #e5e7eb;
}

.finish-btn {
  padding: 8px 18px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: .2s;
}
.finish-btn:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}
.finish-btn.done {
  background: #9ca3af;
  pointer-events: none;
}

.hint-btn-inline {
  padding: 8px 14px;
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  border: 1.5px solid #fbbf24;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #92400e;
  cursor: pointer;
  transition: .2s;
}
.hint-btn-inline:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(251, 191, 36, .3);
}

/* 进入下一环节按钮 */
.phase-next {
  padding: 10px 16px;
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  border-top: 2px solid #93c5fd;
  text-align: center;
  animation: slideUp .3s ease both;
}
.phase-next-btn {
  padding: 10px 28px;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: .2s;
  box-shadow: 0 4px 14px rgba(37, 99, 235, .3);
}
.phase-next-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(37, 99, 235, .4);
}

/* 手机屏模式 */
.sim-phone.chat-mode .phone-frame { display: flex; }
.sim-phone.chat-mode .exam-buttons { margin-top: 10px; width: 320px; }
.sim-phone.exam-mode .phone-frame { display: none; }
.sim-phone.exam-mode .exam-buttons {
  width: 100%;
  margin-top: 0;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 8px;
}
.sim-phone.exam-mode .exam-btn {
  flex: 1 1 auto;
  min-width: 140px;
}

/* 进度条（同行：进度条 + 百分比） */
.progress-wrap {
  flex-shrink: 0;
  width: 140px;
}
.progress-bar {
  height: 9px;
  background: #d1e7e4;
  border-radius: 5px;
  overflow: hidden;
  position: relative;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), #10b981);
  border-radius: 5px;
  transition: width .35s ease;
}
.progress-pct {
  font-size: 15px;
  font-weight: 700;
  color: var(--primary-dark);
  min-width: 40px;
  text-align: right;
}

/* 问诊输入区（仅输入框，对话渲染在手机屏） */
.ask-input-only {
  border: 1.5px solid #d1e7e4;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}

/* 输入区域 */
.chat-input-wrap {
  border-top: 1px solid #e5e7eb;
  padding: 10px 12px;
}
.chat-input-wrap textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid #e5e7eb;
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
  box-sizing: border-box;
  transition: border-color .2s;
}
.chat-input-wrap textarea:focus {
  outline: none;
  border-color: var(--primary);
}
.chat-input-wrap textarea::placeholder {
  color: var(--muted);
}
.chat-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
}
.chat-actions-right {
  display: flex;
  align-items: center;
  gap: 10px;
}
.voice-btn {
  width: 40px;
  height: 40px;
  border: 1.5px solid #e5e7eb;
  border-radius: 50%;
  background: #fff;
  font-size: 18px;
  cursor: pointer;
  transition: .2s;
}
.voice-btn:hover {
  border-color: var(--primary);
  background: #f1faf8;
}
.voice-btn.recording {
  animation: pulse 1.5s infinite;
  border-color: var(--danger);
  background: #fef2f2;
}
.submit-ask-btn {
  padding: 10px 22px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: .2s;
}
.submit-ask-btn:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

/* 已覆盖/遗漏方向 */
.completed-asks {
  padding: 10px 12px;
  border-top: 1px dashed #e5e7eb;
}
.completed-asks .title {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
}
.completed-asks-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.completed-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: #dcfce7;
  color: #16a34a;
  font-size: 12px;
  border-radius: 16px;
}
.completed-tag .check {
  font-size: 11px;
}
.completed-tag.missed {
  background: #fef3c7;
  color: #d97706;
}

/* 遗漏提示弹窗 */
.hint-modal {
  max-width: 480px;
}
.hint-modal .modal-body {
  padding: 16px;
}
.missed-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  background: #fef3c7;
  border-radius: 10px;
  margin-bottom: 10px;
}
.missed-item:last-child {
  margin-bottom: 0;
}
.missed-item .icon {
  font-size: 20px;
}
.missed-item .content {
  flex: 1;
}
.missed-item .title {
  font-weight: 600;
  color: #92400e;
  margin-bottom: 4px;
}
.missed-item .desc {
  font-size: 14px;
  color: #b45309;
  line-height: 1.5;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .6; }
}

/* 问诊项可点击提示（旧版，保留兼容） */
.ask-trigger { position: relative; }
.ask-trigger::after {
  content: '💬'; position: absolute; right: 10px; top: 50%;
  transform: translateY(-50%); font-size: 13px; opacity: .4;
  transition: opacity .2s;
}
.ask-trigger:hover::after { opacity: .8; }
.ask-trigger:has(input:checked)::after { opacity: 1; }

/* 查体/辅查项可点击提示 */
.exam-trigger { position: relative; }
.exam-trigger::after {
  content: '\1f4cb'; position: absolute; right: 10px; top: 50%;
  transform: translateY(-50%); font-size: 13px; opacity: .4;
  transition: opacity .2s;
}
.exam-trigger:hover::after { opacity: .8; }
.exam-trigger:has(input:checked)::after { opacity: 1; }

/* ============ 检查结果按钮区 ============ */
.exam-buttons {
  margin-top: 12px; width: 320px;
  display: flex; flex-direction: column; gap: 6px;
}
.exam-buttons-empty {
  text-align: center;
  font-size: 12px; color: var(--muted);
  padding: 8px 0;
}

/* 中间面板顶部操作指示（查体/辅查模式下显示） */
.exam-panel-hint { display: none; }
.sim-phone.exam-mode .exam-panel-hint {
  display: block;
  text-align: center;
  font-size: 13.5px; color: var(--primary-dark);
  background: linear-gradient(135deg, #ecfdf5, #d1fae5);
  border: 1px solid #a7f3d0; border-radius: 10px;
  padding: 9px 14px; margin-bottom: 12px; line-height: 1.5;
}
.sim-phone.exam-mode .exam-panel-hint b { color: var(--primary); }

.exam-btn {
  width: 100%;
  background: linear-gradient(180deg, #ffffff 0%, #eef4f3 100%);
  border: 1.5px solid #cdddd9;
  border-bottom-width: 3px;
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 14.5px; font-weight: 600;
  cursor: pointer; color: var(--text);
  transition: .12s ease; font-family: inherit;
  text-align: left;
  box-shadow: 0 3px 0 #d4e2de, 0 6px 14px rgba(10,110,103,.12);
}
.exam-btn::before { content: '🔍 '; opacity: .7; }
.exam-btn:hover {
  border-color: var(--primary); color: var(--primary-dark);
  background: linear-gradient(180deg, #ffffff 0%, #e6f5f2 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 0 #b9d6cf, 0 9px 20px rgba(10,110,103,.18);
}
.exam-btn:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #b9d6cf, 0 3px 8px rgba(10,110,103,.14);
}

/* ============ 弹窗 ============ */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,.55);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center;
  animation: fadeIn .2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal-card {
  background: var(--card); border-radius: var(--radius);
  box-shadow: 0 16px 48px rgba(0,0,0,.35);
  max-width: 600px; width: 90vw; max-height: 80vh;
  display: flex; flex-direction: column;
  animation: slideUp .3s ease both;
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 22px; border-bottom: 1px solid var(--border);
}
.modal-header h3 { margin: 0; font-size: 17px; color: var(--primary-dark); }
.modal-close {
  background: none; border: none; font-size: 26px; cursor: pointer;
  color: var(--muted); padding: 0 4px; line-height: 1;
  transition: color .15s;
}
.modal-close:hover { color: var(--danger); }
.modal-body {
  padding: 20px 22px 24px; overflow-y: auto;
  font-size: 15px; line-height: 1.8;
  color: var(--text);
}
.modal-body .exam-result-text { white-space: pre-wrap; }

/* 检查报告图片区（点击项目后随结果展示，可由教师后台上传真实报告） */
.exam-result-image { margin-top: 16px; }
.exam-result-image .exam-image-label {
  font-size: 13px; font-weight: 600; color: var(--muted);
  margin-bottom: 8px; display: flex; align-items: center; gap: 6px;
}
.exam-result-image .exam-image-label::before { content: '🖼'; }
.exam-result-image img {
  width: 100%; border-radius: 10px; border: 1px solid var(--border);
  display: block;
}
.exam-result-image.placeholder img { display: none; }
.exam-result-image.placeholder {
  border: 1.5px dashed #cbd5e1; border-radius: 10px;
  padding: 26px 16px; text-align: center; background: #f8fafc;
}
.exam-result-image.placeholder .exam-image-label {
  justify-content: center; color: #94a3b8; margin: 0;
}
