/* ===== 丰城产科医院 H5 接诊游戏 - 样式 ===== */
/* 移动端优先，清爽医疗主题（白底 + 青蓝点缀） */

:root {
  --bg: #f4f7fa;
  --card: #ffffff;
  --primary: #2b8a9e;        /* 青蓝，主色 */
  --primary-dark: #1f6e80;
  --accent: #e8f4f8;
  --text: #1f2d3d;
  --text-light: #6c7a89;
  --border: #e0e7ee;
  --health: #4caf7a;        /* 健康值绿 */
  --satis: #f0a93b;         /* 满意度橙 */
  --danger: #e06c5c;
  --shadow: 0 2px 12px rgba(43, 138, 158, 0.08);
}

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

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
/* 整页封面背景：铺满整个浏览器窗口（桌面+手机都满屏） */
body {
  background-image: url('assets/cover.jpg');
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  background-attachment: fixed;
}
/* 整页暗化遮罩：让标题文字可读；游戏/结算屏为白底会盖住此遮罩 */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.3), rgba(0,0,0,0.55));
  pointer-events: none;
}

/* 手机壳：居中、最大宽度、阴影 */
#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  background: transparent;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
  position: relative;
}

/* ===== 通用屏幕容器 ===== */
.screen {
  display: none;
  flex: 1;
  flex-direction: column;
  padding: 20px 18px 28px;
  background: var(--card);
}
.screen.active { display: flex; }

/* ===== 标题屏 ===== */
#titleScreen { justify-content: center; align-items: center; text-align: center; }
.logo {
  font-size: 40px;
  margin-bottom: 8px;
}
.hospital-name {
  font-size: 24px;
  font-weight: 700;
  color: var(--primary-dark);
  letter-spacing: 1px;
  margin-bottom: 4px;
}
.subtitle {
  font-size: 13px;
  color: var(--text-light);
  margin-bottom: 32px;
}

/* 标题屏：透明背景，让 body 的封面背景透出，铺满整页 */
#titleScreen { background: transparent; }
#titleScreen .hospital-name {
  color: #fff;
  font-size: 24px;
  text-shadow: 0 2px 10px rgba(0,0,0,0.7);
}
#titleScreen .subtitle {
  color: rgba(255,255,255,0.92);
  text-shadow: 0 1px 6px rgba(0,0,0,0.7);
  margin-bottom: 30px;
}
/* 主页打赏按钮在深色背景上改用半透明白，确保可读 */
#titleScreen .donate-entry {
  background: rgba(255,255,255,0.16);
  color: #fff;
  border-color: rgba(255,255,255,0.65);
}
#titleScreen .donate-entry:active { background: rgba(255,255,255,0.28); }
.name-input {
  width: 80%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 15px;
  text-align: center;
  margin-bottom: 18px;
  background: var(--bg);
  color: var(--text);
}
.name-input:focus {
  outline: none;
  border-color: var(--primary);
}

/* ===== 按钮 ===== */
.btn {
  display: block;
  width: 100%;
  padding: 14px 16px;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.08s, box-shadow 0.15s, background 0.15s;
  background: var(--primary);
  color: #fff;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--primary); }
.btn-primary:active { background: var(--primary-dark); }
.btn-ghost {
  background: transparent;
  color: var(--primary-dark);
  border: 1.5px solid var(--primary);
}
.btn-ghost:active { background: var(--accent); }
.btn-block { margin-top: 10px; }

/* ===== 顶部状态栏 ===== */
.status-bar {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  padding: 14px 16px;
  border-radius: 14px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.status-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  opacity: 0.95;
}
.status-row .doctor { font-weight: 600; }
.phase-tag {
  font-size: 12px;
  background: rgba(255,255,255,0.18);
  padding: 3px 10px;
  border-radius: 20px;
}
.patient-card {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
}
.patient-avatar {
  font-size: 30px;
  width: 48px; height: 48px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.18);
  border-radius: 50%;
}
.patient-info .pname { font-size: 17px; font-weight: 600; }
.patient-info .pmeta { font-size: 12px; opacity: 0.9; }

/* 数值条 */
.bars { margin-top: 12px; }
.bar-row { margin-bottom: 8px; }
.bar-label {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  margin-bottom: 3px;
}
.bar-track {
  height: 8px;
  background: rgba(255,255,255,0.25);
  border-radius: 6px;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  border-radius: 6px;
  transition: width 0.4s ease;
}
.bar-fill.health { background: #9fe8c0; }
.bar-fill.satis { background: #ffd27a; }

/* ===== 场景文本 ===== */
.scene {
  background: var(--accent);
  border-left: 3px solid var(--primary);
  padding: 14px 16px;
  border-radius: 0 12px 12px 0;
  font-size: 15px;
  line-height: 1.7;
  margin-bottom: 18px;
  min-height: 60px;
}
.scene .prompt {
  font-weight: 600;
  color: var(--primary-dark);
  margin-bottom: 8px;
}

/* 反馈气泡（选择后） */
.feedback {
  background: #fff8e8;
  border: 1px solid #f0d98a;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 16px;
  display: none;
}
.feedback.show { display: block; }

/* ===== 选项列表 ===== */
.options { display: flex; flex-direction: column; gap: 10px; }
.option-btn {
  text-align: left;
  background: var(--card);
  color: var(--text);
  border: 1.5px solid var(--border);
  padding: 14px 16px;
  border-radius: 12px;
  font-size: 15px;
  line-height: 1.5;
  cursor: pointer;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  transition: border-color 0.15s, background 0.15s;
}
.option-btn:active { background: var(--accent); border-color: var(--primary); }
.option-btn .num {
  flex-shrink: 0;
  width: 24px; height: 24px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
}
.option-btn.disabled {
  opacity: 0.5;
  pointer-events: none;
}

/* ===== 结算屏 ===== */
#endScreen { justify-content: center; align-items: center; text-align: center; }
.grade {
  font-size: 64px;
  font-weight: 800;
  width: 120px; height: 120px;
  line-height: 120px;
  border-radius: 50%;
  margin-bottom: 16px;
  color: #fff;
  box-shadow: var(--shadow);
}
.grade.S { background: #d4af37; }
.grade.A { background: var(--primary); }
.grade.B { background: #6c8cb4; }
.grade.C { background: var(--satis); }
.grade.D { background: var(--danger); }
.end-title { font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.end-patient { font-size: 13px; color: var(--text-light); margin-bottom: 18px; }

.final-bars { width: 100%; margin-bottom: 18px; }
.final-bar-row { margin-bottom: 12px; }
.final-bar-row .bar-label { color: var(--text); font-size: 13px; font-weight: 600; }
.final-bar-row .bar-track {
  height: 12px;
  background: var(--border);
}
.final-bar-row .bar-fill.health { background: var(--health); }
.final-bar-row .bar-fill.satis { background: var(--satis); }

.receipt {
  width: 100%;
  background: var(--accent);
  border-radius: 12px;
  padding: 14px 16px;
  text-align: left;
  font-size: 13px;
  line-height: 1.8;
  margin-bottom: 20px;
}
.receipt h4 {
  color: var(--primary-dark);
  font-size: 13px;
  margin-bottom: 6px;
  border-bottom: 1px dashed var(--border);
  padding-bottom: 4px;
}

.end-actions { width: 100%; }

/* 打赏入口（第 2 步启用） */
.donate-entry { display: block; }

/* 简易过渡动画 */
.fade-in { animation: fadeIn 0.3s ease; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============================================================
 * 打赏弹窗（第 2 步）
 * ============================================================ */
.donate-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 20px 16px;
  overflow-y: auto;
}
.donate-overlay.show { display: flex; }
.donate-modal {
  background: #fff;
  border-radius: 18px;
  width: 100%;
  max-width: 420px;
  padding: 24px 20px 18px;
  position: relative;
  max-height: 92vh;
  overflow-y: auto;
  box-shadow: 0 8px 40px rgba(0,0,0,0.25);
  animation: pop 0.22s ease;
}
@keyframes pop {
  from { transform: scale(0.94); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}
.donate-close {
  position: absolute;
  top: 10px; right: 14px;
  border: none;
  background: transparent;
  font-size: 28px;
  line-height: 1;
  color: #9aa3ad;
  cursor: pointer;
}
.donate-title {
  text-align: center;
  font-size: 18px;
  color: var(--primary-dark);
  margin-bottom: 16px;
}
.pay-tabs {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-bottom: 14px;
}
.pay-tab {
  padding: 8px 24px;
  border: 1.5px solid var(--border);
  background: #fff;
  border-radius: 22px;
  font-size: 14px;
  cursor: pointer;
  color: var(--text-light);
  transition: all 0.15s;
}
.pay-tab.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.qr-wrap {
  display: flex;
  justify-content: center;
}
.qr-wrap img {
  width: 200px;
  height: 200px;
  border-radius: 14px;
  background: #fff;
}
.pay-hint {
  text-align: center;
  font-size: 12px;
  color: var(--text-light);
  margin: 10px 0 16px;
}
.donate-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.donate-form input,
.donate-form textarea {
  width: 100%;
  padding: 11px 13px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  background: var(--bg);
  color: var(--text);
  resize: vertical;
}
.donate-form input:focus,
.donate-form textarea:focus {
  outline: none;
  border-color: var(--primary);
}
.donate-form textarea { min-height: 60px; }
.donate-toast {
  text-align: center;
  font-size: 13px;
  color: var(--health);
  min-height: 18px;
  margin: 8px 0 0;
}
.records-section {
  margin-top: 18px;
  border-top: 1px dashed var(--border);
  padding-top: 14px;
}
.records-section h4 {
  font-size: 14px;
  color: var(--text);
  margin-bottom: 10px;
}
.records-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.record-item {
  background: var(--bg);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
}
.record-item .r-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 3px;
}
.record-item .r-nick { font-weight: 600; color: var(--text); }
.record-item .r-amt { color: var(--satis); font-weight: 700; }
.record-item .r-msg { color: var(--text-light); line-height: 1.5; margin-bottom: 2px; }
.record-item .r-time { font-size: 11px; color: #aab2bd; }
.badge-pending {
  font-size: 10px;
  background: #fff3cd;
  color: #b8860b;
  padding: 1px 6px;
  border-radius: 8px;
  margin-left: 6px;
  vertical-align: middle;
}
.records-note {
  font-size: 11px;
  color: #aab2bd;
  text-align: center;
  margin-top: 12px;
  line-height: 1.5;
}
