/* 固视训练 — 展示用样式（平板友好） */
:root {
  --bg: #f5f5f5;
  --card-bg: #ffffff;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --medical-blue: #0071e3;
  --medical-blue-light: #e8f4fd;
  --medical-green: #34c759;
  --medical-green-light: #e8f8ec;
  --medical-yellow: #ff9f0a;
  --medical-red: #ff3b30;
  --text: #1d1d1f;
  --text-muted: #6e6e73;
  --border: #e5e5ea;
  --success: #34c759;
  --select-green: #22c55e;
  --highlight: #e67e22;
  --radius: 16px;
  --radius-sm: 12px;
  --radius-card: 16px;
  --shadow: 0 2px 16px rgba(0,0,0,0.06);
  --font: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'SF Pro Display', sans-serif;
  --safe-top: env(safe-area-inset-top, 0);
  --safe-bottom: env(safe-area-inset-bottom, 0);
  --safe-left: env(safe-area-inset-left, 0);
  --safe-right: env(safe-area-inset-right, 0);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  font-family: var(--font);
  font-size: 16px;
  color: var(--text);
  background: #fff;
  -webkit-font-smoothing: antialiased;
}

#root {
  min-height: 100vh;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding-top: var(--safe-top);
  padding-bottom: var(--safe-bottom);
  padding-left: var(--safe-left);
  padding-right: var(--safe-right);
  background: #fff;
}

/* 平板/大屏：加大触控与字体 */
@media (min-width: 768px) {
  html, body { font-size: 18px; }
  .btn-primary, .btn-secondary, .procedure-card { min-height: 48px; }
  .procedure-card { padding: 28px; }
  .training-prompt { font-size: 1.15rem; padding: 18px 28px; }
  .training-countdown { font-size: 1.2rem; top: max(24px, var(--safe-top)); }
  .training-exit-btn { top: max(16px, var(--safe-top)); right: max(16px, var(--safe-right)); padding: 12px 22px; font-size: 1rem; }
}

/* 全屏页面容器 */
.page {
  width: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  animation: fadeIn 0.35s ease;
}
.fullscreen-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px 24px;
  width: 100%;
}
.global-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
  flex-shrink: 0;
}
.global-header .page-title-main {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}
.global-header .header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.global-header .icon-btn {
  padding: 8px 14px;
  font-size: 0.95rem;
  font-family: var(--font);
  color: var(--text-muted);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
}
.global-header .icon-btn:hover {
  color: var(--text);
  border-color: #999;
  background: #f9f9f9;
}
.global-header .back-link {
  font-size: 0.95rem;
  color: var(--text-muted);
  text-decoration: none;
  padding: 8px 0;
}
.global-header .back-link:hover { color: var(--primary); }
.page-content {
  flex: 1;
  min-height: 0;
  overflow: auto;
}
.fullscreen-page:not(.home-page) .page-content {
  padding-top: 8px;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 首页 — 受试者列表全屏风格 */
.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.search-wrap {
  flex: 1;
  min-width: 200px;
  display: flex;
  align-items: center;
  padding: 0 14px;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
}
.search-icon {
  font-size: 1rem;
  color: var(--text-muted);
  margin-right: 8px;
}
.search-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 1rem;
  font-family: var(--font);
  color: var(--text);
  background: transparent;
}
.search-input::placeholder { color: #999; }
.btn-toolbar {
  padding: 10px 20px;
  font-size: 0.95rem;
  font-family: var(--font);
  font-weight: 500;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.btn-toolbar:hover { background: #f5f5f5; border-color: #ccc; }
.fullscreen-table-wrap {
  flex: 1;
  min-height: 0;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.subject-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  background: #fff;
}
.subject-table th,
.subject-table td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.subject-table th {
  font-weight: 600;
  color: var(--text);
  background: #fafafa;
  white-space: nowrap;
}
.subject-table tbody tr:hover { background: #fafafa; }
.subject-table .empty-td {
  text-align: center;
  color: var(--text-muted);
  padding: 40px 16px;
}
.subject-table .op-cell {
  white-space: nowrap;
}
.subject-table .op-cell .btn-op {
  margin-right: 8px;
  margin-bottom: 4px;
}
.btn-op {
  display: inline-block;
  padding: 6px 14px;
  font-size: 0.875rem;
  font-family: var(--font);
  font-weight: 500;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-decoration: none;
  border: none;
  transition: opacity 0.2s;
}
.btn-op:hover { opacity: 0.9; }
.btn-edit {
  color: var(--text);
  background: #fff;
  border: 1px solid var(--border);
}
.btn-edit:hover { background: #f5f5f5; }
.btn-start-exam {
  color: #fff;
  background: var(--primary);
  border: 1px solid var(--primary);
}
.btn-start-exam:hover { color: #fff; background: var(--primary-hover); }
.btn-view-report {
  color: var(--primary);
  background: #fff;
  border: 1px solid var(--primary);
}
.btn-view-report:hover { background: #f0f7ff; }

/* ========== 选择训练项目 — 医疗设备风格（卡片选择）========= */
.select-page-medical .page-content {
  background: #f2f4f6;
  margin: 0 -24px;
  padding: 32px 24px 48px;
  min-height: 60vh;
}
.select-hero {
  text-align: center;
  margin-bottom: 32px;
}
.select-main-title {
  font-size: 28px;
  font-weight: 700;
  color: #1A1A1A;
  margin: 0 0 8px 0;
  letter-spacing: -0.02em;
}
.select-subtitle {
  font-size: 14px;
  color: #7A7A7A;
  margin: 0;
}
.select-cards-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  justify-content: center;
  align-items: stretch;
  max-width: 900px;
  margin: 0 auto 32px;
}
.select-card {
  width: 420px;
  min-height: 160px;
  background: #fff;
  border: 1px solid #E5EAF1;
  border-radius: 14px;
  padding: 20px 24px;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.select-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  border-radius: 14px 0 0 14px;
  background: transparent;
  transition: background 0.2s;
}
.select-card:hover {
  border-color: #2A6CF0;
  box-shadow: 0 8px 24px rgba(42,108,240,0.12);
}
.select-card.selected {
  background: #EAF3FF;
  border-color: #2A6CF0;
  box-shadow: 0 4px 16px rgba(42,108,240,0.15);
}
.select-card.selected::before {
  background: #2A6CF0;
}
.select-card-icon {
  font-size: 2rem;
  line-height: 1;
  flex-shrink: 0;
}
.select-card-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.select-card-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: #1A1A1A;
  margin: 0 0 4px 0;
}
.select-card-en {
  font-size: 0.8rem;
  color: #7A7A7A;
  margin: 0 0 8px 0;
}
.select-card-desc {
  font-size: 0.9rem;
  color: #555;
  line-height: 1.4;
  margin: 0 0 8px 0;
  flex: 0 0 auto;
}
.select-card-duration {
  font-size: 0.85rem;
  color: #2A6CF0;
  font-weight: 500;
  margin: 0;
  margin-top: auto;
  padding-top: 4px;
}
.select-card-check {
  position: absolute;
  top: 16px;
  right: 20px;
  font-size: 0.8rem;
  color: #2A6CF0;
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.2s;
}
.select-card.selected .select-card-check {
  opacity: 1;
}
.select-actions {
  text-align: center;
}
.btn-start-training {
  width: 220px;
  height: 48px;
  padding: 0;
  font-size: 1rem;
  font-family: var(--font);
  font-weight: 600;
  color: #fff;
  background: #2A6CF0;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}
.btn-start-training:hover {
  background: #1E57C8;
}
.btn-start-training:active {
  transform: scale(0.98);
}
@media (max-width: 920px) {
  .select-cards-wrap { flex-direction: column; align-items: center; }
  .select-card { width: 100%; max-width: 420px; }
}

.procedure-cards { display: flex; flex-direction: column; gap: 16px; }
.procedure-card {
  display: block;
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
}
.procedure-card:hover, .procedure-card:focus {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.1);
  outline: none;
}
.procedure-card h3 { font-size: 1.15rem; font-weight: 600; margin-bottom: 6px; color: var(--primary); }
.procedure-card p { font-size: 0.9rem; color: var(--text-muted); line-height: 1.5; }

/* 解释卡片页 */
.explain-page .page-content { padding-top: 0; }

.explain-page .page-title {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text);
}

.explain-page .page-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 24px;
  line-height: 1.5;
}

.explain-cards {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 28px;
}

.explain-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--primary);
}

.explain-card h4 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
}

.explain-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.cta-wrap { text-align: center; margin-top: 28px; }

/* ========== 训练前须知页 — 统一卡片风格 ========== */
.explain-page-notice .explain-content {
  max-width: 640px;
  margin: 0 auto;
  padding: 0 24px 24px;
}
.explain-page-notice .notice-card {
  background: #fff;
  border-radius: var(--radius-card, 12px);
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  border: 1px solid var(--border);
  padding: 28px 32px 32px;
  margin-bottom: 24px;
}
.explain-page-notice .notice-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 12px 0;
  line-height: 1.35;
}
.explain-page-notice .notice-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0 0 24px 0;
}
.explain-page-notice .notice-desc .highlight {
  color: var(--highlight, #ea580c);
  font-weight: 600;
}
.explain-page-notice .notice-list {
  margin: 0 0 20px 1.2em;
  padding: 0;
  font-size: 0.95rem;
  color: var(--text);
  line-height: 1.8;
}
.explain-page-notice .notice-list li { margin-bottom: 6px; }
.explain-page-notice .notice-outro {
  font-size: 0.95rem;
  color: var(--text);
  line-height: 1.65;
  margin: 0;
}
.explain-page-notice .notice-outro .highlight {
  color: var(--highlight, #ea580c);
  font-weight: 600;
}
.explain-page-notice .notice-items {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.explain-page-notice .notice-item {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 16px 18px;
  background: #f8fafc;
  border-radius: 10px;
  border-left: 4px solid var(--primary);
}
.explain-page-notice .notice-item-num {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary);
  flex-shrink: 0;
  line-height: 1.3;
}
.explain-page-notice .notice-item-body {
  flex: 1;
  min-width: 0;
}
.explain-page-notice .notice-item-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 6px 0;
  line-height: 1.35;
}
.explain-page-notice .notice-item-lines,
.explain-page-notice .notice-item-text {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0;
}
.explain-page-notice .notice-item-lines br + br { display: none; }
.explain-page-notice .explain-cta-wrap {
  text-align: center;
  margin-top: 8px;
}
.explain-page-notice .explain-cta-wrap .btn-start-training {
  min-width: 200px;
  padding: 14px 48px;
}

/* ========== 训练前须知 — 统一风格（SMILE/白内障）：2x2 网格 + 右上插图 ========== */
.explain-page-notice .notice-card-unified {
  max-width: 820px;
  margin-left: auto;
  margin-right: auto;
}
.explain-page-notice .notice-card-unified .notice-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}
.explain-page-notice .notice-card-unified .notice-head-text {
  flex: 1;
  min-width: 0;
}
.explain-page-notice .notice-card-unified .notice-title {
  margin-bottom: 8px;
}
.explain-page-notice .notice-card-unified .notice-desc {
  margin-bottom: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}
.explain-page-notice .notice-card-unified .notice-fig {
  flex-shrink: 0;
  width: 120px;
  text-align: center;
}
.explain-page-notice .notice-hero-fig {
  width: 100px;
  height: 100px;
  display: block;
  margin: 0 auto 8px;
}
.explain-page-notice .notice-fig-caption {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin: 0;
}
/* 2x2 网格：四个子项直接排列，保证同行等高对齐 */
.explain-page-notice .notice-card-unified .notice-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto;
  gap: 20px 24px;
  align-items: start;
}
.explain-page-notice .notice-item-smile {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 18px 20px;
  background: #f8fafc;
  border-radius: 12px;
  border: 1px solid #e5eaf1;
}
.explain-page-notice .notice-badge {
  width: 28px;
  height: 28px;
  min-width: 28px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.explain-page-notice .notice-item-smile .notice-item-body {
  flex: 1;
  min-width: 0;
}
.explain-page-notice .notice-item-smile .notice-item-title {
  margin-bottom: 8px;
  font-size: 1rem;
}
.explain-page-notice .notice-item-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.explain-page-notice .notice-item-list li {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.explain-page-notice .notice-item-list li:last-child {
  margin-bottom: 0;
}
.explain-page-notice .notice-item-smile .notice-item-text {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0;
}
.explain-page-notice .notice-check {
  color: var(--primary);
  font-weight: 600;
  flex-shrink: 0;
}
.explain-page-notice .notice-item-inline-fig {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.explain-page-notice .nif-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #22c55e;
}
.explain-page-notice .nif-arrow {
  color: var(--text-muted);
  font-size: 1rem;
}
.explain-page-notice .nif-eye {
  width: 28px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--text-muted);
  background: #f1f5f9;
  position: relative;
}
.explain-page-notice .nif-eye::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
}
.explain-page-notice .explain-content-unified {
  max-width: 900px;
}
@media (max-width: 720px) {
  .explain-page-notice .notice-card-unified .notice-head {
    flex-direction: column;
  }
  .explain-page-notice .notice-card-unified .notice-grid {
    grid-template-columns: 1fr;
    grid-template-rows: none;
  }
}

/* 兼容旧类名 */
.explain-page-title { font-size: 1.25rem; font-weight: 700; color: var(--text); margin-bottom: 16px; }
.explain-intro, .explain-outro { font-size: 0.95rem; color: var(--text); line-height: 1.65; margin-bottom: 12px; }
.explain-intro .highlight, .explain-outro .highlight { color: var(--highlight); font-weight: 600; }
.explain-list { margin: 12px 0 20px 1.2em; padding: 0; font-size: 0.95rem; color: var(--text); line-height: 1.8; }
.explain-list li { margin-bottom: 6px; }
.btn-start-training {
  display: inline-block;
  padding: 14px 48px;
  font-size: 1rem;
  font-family: var(--font);
  font-weight: 500;
  color: #fff;
  background: var(--primary);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.btn-start-training:hover { background: var(--primary-hover, #1e40af); }

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 200px;
  padding: 16px 28px;
  font-size: 1.05rem;
  font-weight: 600;
  font-family: var(--font);
  color: #fff;
  background: var(--primary);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.2s;
  text-decoration: none;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

/* 训练入口：是否启用摄像头眼动（WebGazer） */
.training-choice-screen {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: #f5f5f5;
  box-sizing: border-box;
}
.training-choice-card {
  max-width: 480px;
  width: 100%;
  padding: 28px 24px;
}
.training-choice-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 0 12px 0;
  color: var(--text);
}
.training-choice-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0 0 24px 0;
}
.training-choice-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.training-choice-btn {
  width: 100%;
  padding: 14px 18px;
  font-size: 1rem;
  font-family: var(--font);
  border-radius: 10px;
  cursor: pointer;
  border: none;
}
.training-choice-screen .btn-secondary {
  background: #fff;
  color: var(--primary);
  border: 1px solid var(--border);
}
.training-choice-back {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.95rem;
  cursor: pointer;
  padding: 8px;
  margin-top: 4px;
}
.training-choice-back:hover {
  color: var(--primary);
}

/* WebGazer 校准点 */
.webgazer-calib-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
}
.webgazer-calib-hint {
  position: absolute;
  top: 12%;
  left: 50%;
  transform: translateX(-50%);
  max-width: 90%;
  margin: 0;
  font-size: 0.95rem;
  color: #fff;
  text-align: center;
  line-height: 1.5;
}
.webgazer-calib-dot {
  position: absolute;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 3px solid #fff;
  background: var(--primary);
  color: #fff;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  z-index: 10001;
  padding: 0;
}

/* ---------- 训练页：全屏情境化演示 ---------- */
.training-wrap {
  position: fixed;
  inset: 0;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  min-height: 100vh;
  min-height: 100dvh;
  min-height: -webkit-fill-available;
  padding-top: var(--safe-top);
  padding-bottom: var(--safe-bottom);
  padding-left: var(--safe-left);
  padding-right: var(--safe-right);
  z-index: 100;
  background: #0a0a0f;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.training-wrap .training-stage {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
/* 白内障情景：竖屏时限制舞台比例，减轻透视拉伸 */
.training-wrap.cataract .training-stage {
  width: 100%;
  height: 100%;
  max-width: min(100vw, calc(100dvh * 9 / 16));
  max-height: min(100dvh, calc(100vw * 16 / 9));
  left: 50%;
  top: 50%;
  right: auto;
  bottom: auto;
  transform: translate(-50%, -50%);
}

/* 白内障：术间环境 + 同轴显微镜环形光（中心略暗、周边亮环） */
.training-wrap.cataract .or-room-tint {
  position: absolute;
  inset: -5%;
  background:
    radial-gradient(ellipse 100% 90% at 50% 45%, rgba(12, 28, 24, 0.45) 0%, rgba(8, 14, 18, 0.92) 65%, #05080c 100%),
    linear-gradient(180deg, rgba(30, 45, 40, 0.25) 0%, transparent 40%);
  pointer-events: none;
  z-index: 0;
}
.training-wrap.cataract .microscope-hud {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  box-shadow: inset 0 0 120px rgba(0, 0, 0, 0.35);
  pointer-events: none;
  z-index: 1;
  opacity: 0.35;
  background: radial-gradient(circle at 50% 50%, transparent 32%, rgba(255, 255, 255, 0.04) 33%, transparent 36%);
}
.training-wrap.cataract .light-overlay {
  position: absolute;
  inset: 0;
  /* 环形照明：模拟手术显微镜同轴光 — 内圈略暗、45%～58% 高亮环 */
  background: radial-gradient(
      ellipse 52% 48% at 50% 48%,
      rgba(42, 48, 55, 0.55) 0%,
      rgba(180, 195, 210, 0.35) 28%,
      rgba(255, 252, 245, 0.88) 45%,
      rgba(255, 250, 238, 0.75) 52%,
      rgba(230, 235, 248, 0.25) 68%,
      transparent 78%
    );
  opacity: 0;
  transition: opacity 1.4s ease, transform 10s ease;
  pointer-events: none;
  z-index: 2;
  mix-blend-mode: screen;
}
.training-wrap.cataract.phase-microscope-idle .light-overlay {
  opacity: 0.14;
  transform: scale(0.92);
}
.training-wrap.cataract.phase-strong-light .light-overlay {
  opacity: 0.88;
  transform: scale(1);
}
.training-wrap.cataract.phase-light-morph .light-overlay {
  opacity: 0.93;
  transform: scale(1.35);
  background: radial-gradient(
    ellipse 72% 68% at 50% 50%,
    rgba(60, 65, 72, 0.5) 0%,
    rgba(210, 218, 230, 0.55) 35%,
    rgba(255, 255, 252, 0.95) 48%,
    rgba(255, 248, 235, 0.82) 58%,
    rgba(200, 210, 230, 0.35) 72%,
    transparent 85%
  );
  transition: transform 9s ease, opacity 1.2s ease;
}
.training-wrap.cataract.phase-clear .light-overlay {
  opacity: 0.72;
  transform: scale(1.08);
  background: radial-gradient(
    ellipse 58% 54% at 50% 50%,
    rgba(70, 80, 95, 0.45) 0%,
    rgba(255, 255, 255, 0.82) 42%,
    rgba(230, 238, 255, 0.55) 55%,
    transparent 75%
  );
  transition: opacity 2.2s ease;
}
.training-wrap.cataract.phase-no-blink .light-overlay {
  opacity: 0.58;
  transform: scale(1);
}

/* 全/半飞秒：绿点 */
.training-wrap.smile .dot-stage,
.training-wrap.lasik .dot-stage {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.green-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #00ff88;
  box-shadow: 0 0 30px rgba(0,255,136,0.8), 0 0 60px rgba(0,255,136,0.4);
  opacity: 1;
  transition: transform 0.5s ease, opacity 0.4s ease, filter 0.6s ease;
}
.training-wrap.phase-dot-blur .green-dot {
  transform: scale(2.2);
  filter: blur(3px);
  opacity: 0.9;
}
.training-wrap.phase-vignette .green-dot {
  transform: scale(1.8);
  filter: blur(2px);
}
.training-wrap.phase-jump .green-dot {
  animation: dotJump 0.4s ease-in-out 3;
}
.training-wrap.phase-dot-gone .green-dot {
  opacity: 0;
  transform: scale(0.5);
  visibility: hidden;
}
.training-wrap.phase-dot .green-dot,
.training-wrap.phase-no-blink .green-dot {
  transform: scale(1.2);
  filter: none;
  opacity: 1;
  visibility: visible;
}
.training-wrap.phase-dot-blur .green-dot,
.training-wrap.phase-vignette .green-dot,
.training-wrap.phase-stable .green-dot,
.training-wrap.phase-jump .green-dot {
  visibility: visible;
}
@keyframes dotJump {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(4px, -3px); }
  75% { transform: translate(-3px, 2px); }
}

/* 周边暗化（飞秒） */
.vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 70% 70% at 50% 50%, transparent 40%, rgba(0,0,0,0.85) 100%);
  opacity: 0;
  transition: opacity 2s ease;
  pointer-events: none;
}
.training-wrap.phase-vignette .vignette,
.training-wrap.phase-stable .vignette { opacity: 1; }
.training-wrap.phase-stable .vignette { opacity: 0.7; }

/* 训练提示文案 */
.training-prompt {
  position: absolute;
  bottom: 20%;
  left: 50%;
  transform: translateX(-50%);
  max-width: 90%;
  padding: 14px 24px;
  background: rgba(0,0,0,0.5);
  color: #fff;
  font-size: 1.05rem;
  line-height: 1.5;
  text-align: center;
  border-radius: 12px;
  z-index: 10;
  opacity: 0;
  transition: opacity 0.5s ease;
}
.training-prompt.visible { opacity: 1; }

/* 训练进度条 */
.training-progress-wrap {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: rgba(255,255,255,0.15);
  z-index: 10;
  opacity: 0;
  transition: opacity 0.4s ease;
}
.training-wrap.training-started .training-progress-wrap {
  opacity: 1;
}
.training-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--primary), #60a5fa);
  border-radius: 0 2px 2px 0;
  transition: width 0.25s linear;
}

/* 阶段倒计时 */
.training-countdown {
  position: absolute;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,0.9);
  font-size: 1.1rem;
  font-weight: 600;
  z-index: 10;
}
.training-countdown .num { font-size: 1.4rem; margin: 0 4px; }

/* 训练中退出按钮 */
.training-exit-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 15;
  padding: 10px 18px;
  font-size: 0.9rem;
  font-family: var(--font);
  font-weight: 500;
  color: rgba(255,255,255,0.95);
  background: rgba(0,0,0,0.4);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.training-exit-btn:hover {
  background: rgba(0,0,0,0.6);
  color: #fff;
}
.training-wrap.show-done .training-exit-btn {
  display: none;
}

/* 准备开始倒计时 */
.training-prep {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 20;
  background: #0a0a0f;
}
.training-prep .prep-num {
  font-size: 4rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
}
.training-prep .prep-text {
  font-size: 1rem;
  color: rgba(255,255,255,0.7);
  text-align: center;
  max-width: 90%;
  padding: 0 12px;
}
.training-prep .prep-hint {
  display: block;
  margin-top: 16px;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.45);
  text-align: center;
  max-width: 90%;
}
.training-prep.hidden { display: none; }

/* 训练结束 */
.training-done {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 25;
  background: rgba(10,10,15,0.95);
  color: #fff;
  padding: 24px;
}
.training-done.visible { display: flex; }
.training-done h2 { font-size: 1.5rem; margin-bottom: 12px; }
.training-done p { color: rgba(255,255,255,0.8); margin-bottom: 24px; }
.training-done .btn-primary { min-width: 180px; }

/* ========== 固视训练报告 — 医疗风格（Apple Health + 医疗设备）========== */
.tr-report-content {
  max-width: 900px;
  margin: 0 auto;
  padding-bottom: 48px;
}
.tr-report .card {
  background: #fff;
  border-radius: var(--radius-card);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  padding: 24px;
  margin-bottom: 20px;
}
.tr-section-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 16px 0;
  letter-spacing: -0.01em;
}
.tr-gaze-source {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0 0 14px 0;
}
.tr-gaze-source code {
  font-size: 0.82rem;
  background: #f1f5f9;
  padding: 2px 6px;
  border-radius: 4px;
}
.tr-gaze-stats {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.95rem;
  color: var(--text);
}
.tr-gaze-stats li { padding: 6px 0; }

/* 1 报告摘要区 */
.tr-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  align-items: flex-start;
  justify-content: space-between;
}
.tr-summary-left { flex: 1; min-width: 200px; }
.tr-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 4px 0;
  letter-spacing: -0.02em;
}
.tr-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0 0 20px 0;
  font-weight: 400;
}
.tr-meta {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.95rem;
  color: var(--text);
}
.tr-meta li {
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}
.tr-meta li:last-child { border-bottom: none; }
.tr-meta-label {
  color: var(--text-muted);
  min-width: 72px;
  font-weight: 500;
}
.tr-summary-right {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.tr-score-wrap { text-align: center; }
.tr-score-circle {
  position: relative;
  width: 120px;
  height: 120px;
}
.tr-score-circle svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}
.tr-score-bg {
  fill: none;
  stroke: var(--border);
  stroke-width: 8;
}
.tr-score-fill {
  fill: none;
  stroke: var(--score-color, var(--medical-green));
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dasharray 0.5s ease;
}
.tr-score-inner {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.tr-score-num {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}
.tr-score-total {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
  line-height: 1.2;
  margin-top: 2px;
}
.tr-score-label {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--medical-green);
  margin: 4px 0 0 0;
}
.tr-score-wrap[data-level="medium"] .tr-score-label { color: var(--medical-yellow); }
.tr-score-wrap[data-level="poor"] .tr-score-label { color: var(--medical-red); }
.tr-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}
.tr-tag {
  font-size: 0.8rem;
  padding: 6px 12px;
  background: var(--medical-blue-light);
  color: var(--medical-blue);
  border-radius: 20px;
  font-weight: 500;
}

/* 2 核心指标区 */
.tr-metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
@media (max-width: 640px) {
  .tr-metrics-grid { grid-template-columns: repeat(2, 1fr); }
}
.tr-metric-card {
  padding: 20px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: #fff;
  transition: box-shadow 0.2s;
}
.tr-metric-card:hover { box-shadow: 0 4px 20px rgba(0,113,227,0.08); }
.tr-metric-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--medical-blue);
  margin-bottom: 6px;
  letter-spacing: -0.02em;
}
.tr-metric-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.tr-metric-head .tr-metric-value { margin-bottom: 0; }
.tr-metric-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 700;
}
.tr-metric-icon-good {
  background: var(--medical-green-light);
  color: var(--medical-green);
}
.tr-metric-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}
.tr-metric-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin: 0;
}

/* 3 训练时间轴 */
.tr-timeline-track {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  align-items: flex-start;
}
.tr-timeline-segment {
  flex: 1;
  min-width: 80px;
  max-width: 140px;
  position: relative;
  padding-top: 28px;
  cursor: pointer;
}
.tr-timeline-segment::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 11px;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
}
.tr-timeline-segment:first-child::before { left: 50%; }
.tr-timeline-segment:last-child::before { right: 50%; }
.tr-timeline-dot {
  position: absolute;
  left: 50%;
  top: 6px;
  width: 14px;
  height: 14px;
  margin-left: -7px;
  border-radius: 50%;
  background: var(--medical-green);
  border: 3px solid #fff;
  box-shadow: 0 0 0 1px var(--border);
  z-index: 1;
}
.tr-dot-warn { background: var(--medical-red); }
.tr-timeline-seg-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 4px;
}
.tr-timeline-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  text-align: center;
  line-height: 1.3;
}
.tr-timeline-dur {
  font-size: 0.75rem;
  color: var(--text-muted);
}
.tr-timeline-detail {
  display: none;
  font-size: 0.75rem;
  color: var(--text-muted);
  padding: 8px 10px;
  background: var(--medical-blue-light);
  border-radius: 8px;
  margin-top: 8px;
  line-height: 1.5;
}
.tr-timeline-detail.is-open { display: block; }
.tr-timeline-detail span { margin-right: 12px; }

/* 4 异常事件记录 */
.tr-events-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.tr-events-table th,
.tr-events-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.tr-events-table th {
  font-weight: 600;
  color: var(--text-muted);
  background: #fafafa;
  font-size: 0.8rem;
  text-transform: none;
}
.tr-events-table tbody tr:hover { background: #fafafa; }

/* 5 医疗建议 */
.tr-conclusion-text {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text);
  margin: 0 0 16px 0;
}
.tr-doctor {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0;
}

/* 报告底部操作 */
.tr-actions { margin-top: 24px; }
.tr-actions .report-recorded {
  font-size: 0.95rem;
  color: var(--medical-green);
  margin-bottom: 12px;
  font-weight: 500;
}
.tr-actions .report-action-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.tr-actions .btn-primary {
  background: var(--medical-blue);
  border-color: var(--medical-blue);
}
.tr-actions .btn-primary:hover { background: #0066cc; border-color: #0066cc; }
.tr-actions .btn-secondary {
  border: 1px solid var(--medical-blue);
  color: var(--medical-blue);
}
.tr-actions .btn-secondary:hover { background: var(--medical-blue-light); color: var(--medical-blue); }

@media print {
  .tr-report .card { box-shadow: none; border: 1px solid #ddd; }
  .tr-actions.no-print { display: none !important; }
}

/* 结业/报告页（旧样式保留兼容） */
.report-page .success-badge {
  text-align: center;
  margin-bottom: 24px;
}

.report-page .success-badge .icon {
  font-size: 4rem;
  color: var(--success);
  margin-bottom: 12px;
}

.report-page .success-badge h1 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}

.report-page .success-badge p {
  font-size: 0.95rem;
  color: var(--text-muted);
}

.report-summary {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}

.report-summary h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 12px;
}

.report-summary ul {
  list-style: none;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.8;
}

.report-summary li {
  padding-left: 1.2em;
  position: relative;
}

.report-summary li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--primary);
}

.report-page .actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}

.report-page .actions .btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 200px;
  padding: 14px 24px;
  font-size: 1rem;
  font-weight: 500;
  font-family: var(--font);
  color: var(--primary);
  background: transparent;
  border: 2px solid var(--primary);
  border-radius: 12px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
}

.report-page .actions .btn-secondary:hover {
  background: var(--primary);
  color: #fff;
}
.report-page .report-recorded {
  font-size: 0.95rem;
  color: var(--success);
  margin-bottom: 12px;
  font-weight: 500;
}

/* 报告页 — 患者信息卡片、指标表、轨迹图、结论、第二页指标说明、打印 */
.report-content { padding-bottom: 32px; }

.report-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.report-main-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}
.report-datetime {
  font-size: 0.95rem;
  color: var(--text-muted);
}

/* 患者信息卡片 */
.report-patient-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 24px;
  background: #fff;
}
.report-patient-card-inner {
  display: flex;
  flex-direction: column;
}
.report-patient-row {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  gap: 16px;
}
.report-patient-row:nth-child(odd) { background: #fafafa; }
.report-patient-row:last-child { border-bottom: none; }
.report-patient-label {
  font-size: 0.9rem;
  color: var(--text-muted);
  min-width: 80px;
}
.report-patient-value {
  font-size: 0.95rem;
  color: var(--text);
  font-weight: 500;
}

.report-section {
  margin-bottom: 24px;
}
.report-section-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 12px;
  display: block;
}
.report-metrics-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  margin-bottom: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.report-metrics-table th,
.report-metrics-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.report-metrics-table th {
  font-weight: 600;
  color: var(--text);
  background: #fafafa;
}
.report-metrics-table th:nth-child(1) { width: 22%; }
.report-metrics-table th:nth-child(2) { width: 18%; }
.report-metrics-table th:nth-child(3) { width: 60%; }
.report-metrics-table .desc-cell {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.5;
}
.report-traj-wrap {
  margin-bottom: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 20px;
  background: #fafafa;
}
.report-traj-wrap .report-section-title { margin-bottom: 16px; }
.report-traj-svg {
  display: block;
  max-width: 400px;
  width: 100%;
  height: auto;
  margin: 0 auto 20px;
  background: #fff;
  border-radius: 8px;
}
.report-traj-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
  font-size: 0.9rem;
  color: var(--text-muted);
  padding-top: 4px;
  border-top: 1px solid var(--border);
  margin-top: 4px;
}
.report-traj-legend .leg {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.report-traj-legend .leg i {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.1);
}
.report-traj-legend .leg-deviation i { background: #e74c3c; }
.report-traj-legend .leg-return i { background: #27ae60; }
.report-traj-legend .leg-response i { background: #3498db; }

.report-conclusion {
  margin-bottom: 20px;
  padding: 16px 20px;
  border-radius: var(--radius-sm);
  border-left: 4px solid #999;
}
.report-conclusion .report-section-title { margin-bottom: 8px; }
.report-conclusion .conclusion-text {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0;
}
.report-conclusion-good {
  background: #f0fdf4;
  border-left-color: var(--success);
}
.report-conclusion-good .conclusion-text { color: #047857; }
.report-conclusion-poor {
  background: #fef2f2;
  border-left-color: #dc2626;
}
.report-conclusion-poor .conclusion-text { color: #b91c1c; }

.report-doctor {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 28px;
}

/* 报告底部操作区：提示 + 按钮同一块，对齐 */
.report-actions {
  margin-bottom: 40px;
}
.report-actions .report-recorded {
  font-size: 0.95rem;
  color: var(--success);
  margin-bottom: 14px;
  font-weight: 500;
}
.report-action-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}
.report-action-btns .btn-primary,
.report-action-btns .btn-secondary {
  margin: 0;
}
.report-action-btns .btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  font-size: 1rem;
  font-weight: 500;
  font-family: var(--font);
  color: var(--primary);
  background: #fff;
  border: 2px solid var(--primary);
  border-radius: var(--radius-sm);
  text-decoration: none;
}
.report-action-btns .btn-secondary:hover { background: var(--primary); color: #fff; }

/* 第二页：指标说明 */
.report-page-2.report-indicator-doc {
  padding-top: 24px;
  margin-top: 24px;
  border-top: 2px solid var(--border);
  page-break-before: always;
}
.report-page-2-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}
.report-page-2-intro {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 20px;
  line-height: 1.5;
}
.report-indicator-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.report-indicator-list li {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
  line-height: 1.6;
}
.report-indicator-list li:last-child { border-bottom: none; }
.report-indicator-list li strong {
  display: block;
  color: var(--text);
  margin-bottom: 4px;
}
.report-indicator-list li span { color: var(--text-muted); }

.btn-print {
  padding: 8px 16px;
  font-size: 0.95rem;
  font-family: var(--font);
  font-weight: 500;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.btn-print:hover { background: #f5f5f5; }

@media print {
  .no-print { display: none !important; }
  body, #root, .page, .fullscreen-page, .report-content {
    background: #fff !important;
    box-shadow: none !important;
  }
  .report-page .page-content { padding: 0 !important; }
  .report-traj-wrap {
    background: #fff !important;
    border: 1px solid #ddd !important;
  }
  .report-traj-svg { background: #fff !important; }
  .report-page-2.report-indicator-doc {
    page-break-before: always;
    padding-top: 1rem;
    margin-top: 1rem;
  }
}

/* ---------- 患者管理 ---------- */
.select-footer {
  margin-top: 28px;
  text-align: center;
}
.link-patient {
  font-size: 0.95rem;
  color: var(--text-muted);
  text-decoration: none;
}
.link-patient:hover {
  color: var(--primary);
}

.patients-page .back,
.patient-detail-page .back,
.patient-form-page .back,
.record-page .back {
  display: inline-block;
  font-size: 0.9rem;
  color: var(--text-muted);
  text-decoration: none;
  margin-bottom: 16px;
  padding: 8px 0;
}
.patients-page .back:hover,
.patient-detail-page .back:hover,
.patient-form-page .back:hover,
.record-page .back:hover {
  color: var(--primary);
}

/* ========== 受试者详情 — 医疗风格（参考图）========= */
.patient-detail-medical .patient-detail-content {
  max-width: 900px;
  margin: 0 auto;
  padding-bottom: 32px;
}
.pd-main-card {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  padding: 28px;
  margin-bottom: 24px;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  border: 1px solid var(--border);
}
.pd-info-section {
  flex: 1;
  min-width: 240px;
}
.pd-info-title {
  font-size: 1rem;
  font-weight: 700;
  color: #1A1A1A;
  margin: 0 0 16px 0;
}
.pd-info-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.pd-info-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid #f0f0f0;
  font-size: 0.95rem;
}
.pd-info-list li:last-child { border-bottom: none; }
.pd-info-icon {
  font-size: 1.1rem;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}
.pd-info-label {
  color: #7A7A7A;
  min-width: 88px;
}
.pd-info-value {
  color: #1A1A1A;
  font-weight: 500;
}
.pd-training-preview {
  flex: 0 0 320px;
  min-width: 280px;
}
.pd-preview-card {
  background: #fff;
  border: 1px solid #E5EAF1;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  position: relative;
}
.pd-preview-icon {
  font-size: 2rem;
  margin-bottom: 8px;
  display: block;
}
.pd-preview-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #1A1A1A;
  margin: 0 0 4px 0;
}
.pd-preview-en {
  font-size: 0.8rem;
  color: #7A7A7A;
  margin: 0 0 10px 0;
}
.pd-preview-desc {
  font-size: 0.85rem;
  color: #555;
  line-height: 1.45;
  margin: 0 0 12px 0;
}
.pd-preview-duration {
  font-size: 0.85rem;
  color: #2A6CF0;
  font-weight: 500;
  margin: 0;
}
.pd-preview-badge {
  position: absolute;
  top: 16px;
  right: 16px;
  font-size: 0.8rem;
  color: var(--medical-green);
  font-weight: 600;
}
.pd-actions {
  margin-bottom: 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.btn-pd-start {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 280px;
  height: 48px;
  font-size: 1rem;
  font-weight: 600;
  font-family: var(--font);
  color: #fff;
  background: #2A6CF0;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s;
}
.btn-pd-start:hover { background: #1E57C8; }
.btn-pd-edit {
  font-size: 0.95rem;
  color: #2A6CF0;
  text-decoration: none;
  font-weight: 500;
}
.btn-pd-edit:hover { text-decoration: underline; }
.pd-record-card {
  padding: 24px;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  border: 1px solid var(--border);
}
.pd-record-title {
  font-size: 1rem;
  font-weight: 700;
  color: #1A1A1A;
  margin: 0 0 16px 0;
}
.pd-record-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.pd-record-table th,
.pd-record-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid #f0f0f0;
}
.pd-record-table th {
  font-weight: 600;
  color: #7A7A7A;
  background: #fafafa;
}
.pd-record-table .empty-td {
  text-align: center;
  color: #7A7A7A;
  padding: 24px;
}

/* 患者详情页（旧样式保留兼容） */
.patient-detail-page .page-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}
.patient-detail-page .detail-card {
  margin-bottom: 20px;
}
.patient-detail-page .detail-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: stretch;
  margin-bottom: 24px;
}
.patient-detail-page .detail-actions .btn-primary,
.patient-detail-page .detail-actions .btn-secondary {
  min-width: 0;
  width: 100%;
  max-width: 280px;
  margin: 0 auto;
  text-align: center;
}
.patient-detail-page .section-title {
  margin-top: 8px;
  margin-bottom: 12px;
}
.patient-detail-page .table-wrap {
  margin-bottom: 0;
}
.patient-detail-page .table-wrap .patients-table th:nth-child(1) { width: 45%; }
.patient-detail-page .table-wrap .patients-table th:nth-child(2) { width: 55%; }
.patient-detail-page .detail-card .label {
  min-width: 110px;
}

.patients-toolbar {
  margin-bottom: 16px;
}
.patients-toolbar .btn-primary { min-width: 140px; }

.table-wrap {
  overflow-x: auto;
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}
.patients-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.patients-table th,
.patients-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.patients-table th {
  font-weight: 600;
  color: var(--text);
  background: rgba(0,0,0,0.03);
}
.patients-table td.empty-td {
  color: var(--text-muted);
  text-align: center;
  padding: 24px;
}
.patients-table .link-detail {
  color: var(--primary);
  text-decoration: none;
}
.patients-table .link-detail:hover { text-decoration: underline; }

.btn-sm {
  padding: 8px 14px;
  font-size: 0.85rem;
  font-family: var(--font);
  font-weight: 500;
  color: #fff;
  background: var(--primary);
  border: none;
  border-radius: 8px;
  cursor: pointer;
}
.btn-sm:hover { background: var(--primary-hover); }

.detail-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}
.detail-card p {
  margin-bottom: 10px;
  font-size: 0.95rem;
  color: var(--text);
}
.detail-card p:last-child { margin-bottom: 0; }
.detail-card .label {
  display: inline-block;
  min-width: 120px;
  color: var(--text-muted);
  font-size: 0.9rem;
}
.detail-actions { margin-bottom: 24px; }
.section-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 12px;
}

.form-page-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  text-align: center;
  margin-bottom: 24px;
}
.form-required-hint {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}
.patient-form .required { color: #c00; margin-left: 2px; }
.patient-form .form-group {
  margin-bottom: 16px;
}
.patient-form .form-group .label {
  display: block;
  font-size: 0.95rem;
  color: var(--text);
  margin-bottom: 8px;
}
.patient-form .gender-btns {
  display: flex;
  gap: 12px;
  margin-top: 6px;
}
.patient-form .gender-btn {
  flex: 1;
  max-width: 120px;
  padding: 12px 20px;
  font-size: 1rem;
  font-family: var(--font);
  font-weight: 500;
  color: var(--text-muted);
  background: #f0f0f0;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.patient-form .gender-btn:hover {
  background: #e8e8e8;
  border-color: #ccc;
}
.patient-form .gender-btn.selected {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
}
.patient-form label {
  display: block;
  margin-bottom: 16px;
  font-size: 0.95rem;
  color: var(--text);
}
.patient-form input {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 12px 14px;
  font-size: 1rem;
  font-family: var(--font);
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}
.patient-form input:focus {
  outline: none;
  border-color: var(--primary);
}
.patient-form select {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 12px 14px;
  font-size: 1rem;
  font-family: var(--font);
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
}
.patient-form select:focus {
  outline: none;
  border-color: var(--primary);
}
.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 28px;
  justify-content: center;
}
.btn-create-exit, .btn-next-step {
  padding: 14px 28px;
  font-size: 1rem;
  font-family: var(--font);
  font-weight: 500;
  color: #fff;
  background: #555;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.btn-create-exit:hover, .btn-next-step:hover { background: #333; }
.patient-form button[type="submit"] { margin-top: 8px; }

/* ========== 创建受试者 — 卡片式布局（参考图）========= */
.patient-form-medical .global-header {
  position: relative;
  justify-content: center;
}
.patient-form-medical .global-header .back-link {
  position: absolute;
  left: 0;
}
.patient-form-medical .global-header .page-title-main {
  margin: 0;
}
.patient-form-content {
  background: #f5f5f5;
  min-height: 100%;
  padding: 24px 24px 32px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}
.patient-form-medical .create-subject-card {
  width: 100%;
  max-width: 560px;
  padding: 28px 32px 32px;
  border-radius: var(--radius-card, 12px);
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  background: #fff;
}
.patient-form-medical .create-subject-card .form-required-hint {
  margin-bottom: 20px;
}
.patient-form-medical .patient-form .form-row {
  margin-bottom: 20px;
}
.patient-form-medical .patient-form .form-row:last-of-type {
  margin-bottom: 0;
}
.patient-form-medical .patient-form .form-label {
  display: block;
  font-size: 0.95rem;
  color: var(--text);
  margin-bottom: 8px;
}
.patient-form-medical .patient-form .form-group {
  margin-bottom: 20px;
}
.patient-form-medical .patient-form .form-group .gender-btns {
  margin-top: 8px;
}
.patient-form-medical .patient-form .gender-btn {
  max-width: 140px;
  color: var(--text-muted);
  background: #fff;
  border: 1px solid var(--border);
}
.patient-form-medical .patient-form .gender-btn.selected {
  color: #fff;
  background: #6b7280;
  border-color: #6b7280;
}
.patient-form-medical .patient-form .form-row input {
  margin-top: 8px;
}
.patient-form-medical .input-wrap,
.patient-form-medical .select-wrap {
  position: relative;
  display: block;
  margin-top: 8px;
}
.patient-form-medical .input-wrap input {
  margin-top: 0;
  padding-right: 40px;
}
.patient-form-medical .input-icon {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1rem;
  pointer-events: none;
  color: var(--text-muted);
}
.patient-form-medical .select-wrap select {
  margin-top: 0;
  appearance: none;
  padding-right: 36px;
}
.patient-form-medical .select-arrow {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.65rem;
  pointer-events: none;
  color: var(--text-muted);
}
.patient-form-medical .form-actions {
  margin-top: 32px;
  justify-content: flex-end;
  gap: 16px;
}
.patient-form-medical .btn-create-exit {
  color: var(--primary);
  background: #fff;
  border: 1px solid var(--border);
}
.patient-form-medical .btn-create-exit:hover {
  background: #f9f9f9;
  border-color: #999;
}
.patient-form-medical .btn-next-step {
  background: var(--primary);
  color: #fff;
  border: none;
}
.patient-form-medical .btn-next-step:hover {
  filter: brightness(1.05);
}

.record-footer {
  text-align: center;
  margin-top: 20px;
}

/* ========== 设置页 — 参考图风格（系统设置 + 卡片选项 + 红色退出） ========== */
.settings-page .settings-content {
  max-width: 560px;
  margin: 0 auto;
  padding: 0 24px 32px;
  background: #f5f5f5;
  min-height: 100%;
}
.settings-page .settings-card {
  background: #fff;
  border-radius: var(--radius-card, 12px);
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  border: 1px solid var(--border);
  padding: 24px 24px 28px;
  overflow: visible;
}
.settings-page .settings-section-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 6px 0;
}
.settings-page .settings-section-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0 0 24px 0;
  line-height: 1.4;
}
.settings-page .settings-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}
.settings-page .settings-option-card {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 16px 18px;
  background: #fff;
  border: 1px solid #e5eaf1;
  border-radius: 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
  cursor: pointer;
  font-family: var(--font);
  text-align: left;
  transition: box-shadow 0.2s, border-color 0.2s;
}
.settings-page .settings-option-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.settings-page .settings-option-icon {
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}
.settings-page .settings-option-icon svg {
  width: 22px;
  height: 22px;
}
.settings-page .settings-option-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.settings-page .settings-option-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  display: block;
}
.settings-page .settings-option-sub {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.35;
}
.settings-page .settings-option-arrow {
  font-size: 1.25rem;
  color: var(--text-muted);
  font-weight: 300;
  line-height: 1;
}
/* 设置页 — 小弹窗（产品说明/版本号），不改变页面高度 */
.settings-modal-overlay {
  position: fixed;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  box-sizing: border-box;
}
.settings-modal-backdrop {
  position: absolute;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
}
.settings-modal-box {
  position: relative;
  width: 100%;
  max-width: 400px;
  max-height: 80vh;
  overflow: auto;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
}
.settings-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}
.settings-modal-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}
.settings-modal-close {
  width: 32px;
  height: 32px;
  padding: 0;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  border-radius: 8px;
  transition: color 0.2s, background 0.2s;
}
.settings-modal-close:hover {
  color: var(--text);
  background: #f1f5f9;
}
.settings-modal-body {
  padding: 20px;
}
.settings-modal-p {
  font-size: 0.95rem;
  color: var(--text);
  line-height: 1.65;
  margin: 0 0 12px 0;
}
.settings-modal-p:last-child {
  margin-bottom: 0;
}

.settings-page .settings-logout-btn {
  width: 100%;
  padding: 16px 24px;
  font-size: 1rem;
  font-weight: 600;
  font-family: var(--font);
  color: #fff;
  background: #e11d48;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.2s, filter 0.2s;
}
.settings-page .settings-logout-btn:hover {
  background: #be123c;
  filter: brightness(1.02);
}

/* 隐藏未激活视图 */
[data-view].hidden {
  display: none !important;
}
