/* 固视训练 — 展示用样式（平板友好） */
: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);
}

/* ---------- P3: 移动端适配 - 训练页全屏情境化演示 ---------- */
.training-wrap {
  position: fixed;
  inset: 0;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  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;
  /* P3: 移动端viewport修复 */
  width: 100vw;
  height: 100vh;
  width: 100dvw; /* 动态viewport单位 */
  height: 100dvh;
}

/* P3: 移动端响应式调整 */
@media (max-width: 768px) {
  .training-wrap {
    /* 手机端确保填满屏幕 */
    min-height: -webkit-fill-available;
  }
  
  /* 绿点大小适配 */
  .training-wrap .green-dot {
    width: 20px;
    height: 20px;
  }
  
  /* 显微镜光适配 */
  .training-wrap.cataract .microscope-light {
    background: radial-gradient(circle 45vmin at 50% 50%, 
      rgba(255, 255, 240, 1) 0%,
      rgba(255, 248, 220, 0.95) 20%,
      rgba(255, 220, 180, 0.7) 40%,
      rgba(255, 180, 120, 0.3) 60%,
      transparent 80%);
  }
  
  /* 提示文字适配 */
  .training-prompt {
    font-size: 0.95rem;
    padding: 12px 18px;
    max-width: 95%;
    bottom: 15%;
  }
  
  /* 倒计时适配 */
  .training-countdown {
    font-size: 0.95rem;
    top: max(16px, var(--safe-top));
  }
  
  /* 退出按钮适配 */
  .training-exit-btn {
    top: max(12px, var(--safe-top));
    right: max(12px, var(--safe-right));
    padding: 8px 14px;
    font-size: 0.85rem;
  }
  
  /* 准备阶段适配 */
  .training-prep .prep-num {
    font-size: 3rem;
  }
  .training-prep .prep-text {
    font-size: 0.9rem;
    padding: 0 20px;
    text-align: center;
  }
}

/* P3: 平板横屏适配 */
@media (min-width: 768px) and (max-width: 1024px) {
  .training-wrap.cataract .microscope-light {
    background: radial-gradient(circle 40vmin at 50% 50%, 
      rgba(255, 255, 240, 1) 0%,
      rgba(255, 248, 220, 0.95) 20%,
      rgba(255, 220, 180, 0.7) 40%,
      rgba(255, 180, 120, 0.3) 60%,
      transparent 80%);
  }
}

/* P3: 横屏手机特殊处理 */
@media (max-height: 500px) and (orientation: landscape) {
  .training-prompt {
    bottom: 10%;
    font-size: 0.85rem;
  }
  
  .green-dot {
    width: 16px;
    height: 16px;
  }
}

.training-wrap .training-stage {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ========== P0: 白内障真实场景 - 红反射背景 ========== */
.training-wrap.cataract {
  background: radial-gradient(ellipse 80% 80% at 50% 50%, #ff6b35 0%, #e85d04 15%, #d00000 35%, #6a040f 60%, #03071e 100%);
}

/* 红反射基础层 */
.training-wrap.cataract .red-reflex-bg {
  position: absolute;
  inset: 0;
  background: 
    radial-gradient(ellipse 30% 30% at 50% 50%, rgba(255, 200, 150, 0.9) 0%, transparent 60%),
    radial-gradient(ellipse 50% 50% at 50% 50%, rgba(255, 100, 50, 0.6) 0%, transparent 70%),
    radial-gradient(ellipse 80% 80% at 50% 50%, rgba(200, 50, 30, 0.4) 0%, transparent 80%);
  opacity: 0;
  transition: opacity 1s ease;
}

/* 显微镜照明 - 中央明亮圆形 */
.training-wrap.cataract .microscope-light {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle 35vmin at 50% 50%, 
    rgba(255, 255, 240, 1) 0%,
    rgba(255, 248, 220, 0.95) 20%,
    rgba(255, 220, 180, 0.7) 40%,
    rgba(255, 180, 120, 0.3) 60%,
    transparent 80%);
  opacity: 0;
  transition: opacity 1.2s ease, transform 3s ease;
  pointer-events: none;
}

/* 白内障晶体混浊效果 */
.training-wrap.cataract .cataract-opacity {
  position: absolute;
  inset: 0;
  background: 
    radial-gradient(ellipse 25% 25% at 45% 45%, rgba(200, 200, 180, 0.3) 0%, transparent 50%),
    radial-gradient(ellipse 20% 20% at 55% 55%, rgba(180, 180, 160, 0.25) 0%, transparent 45%),
    radial-gradient(ellipse 15% 15% at 50% 50%, rgba(220, 220, 200, 0.2) 0%, transparent 40%);
  opacity: 0;
  transition: opacity 2s ease;
  pointer-events: none;
}

/* 边缘暗化效果 */
.training-wrap.cataract .vignette-dark {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 85% 85% at 50% 50%, transparent 30%, rgba(0, 0, 0, 0.4) 70%, rgba(0, 0, 0, 0.8) 100%);
  opacity: 0;
  transition: opacity 1.5s ease;
  pointer-events: none;
}

/* 相位状态 */
.training-wrap.cataract.phase-strong-light .red-reflex-bg { opacity: 1; }
.training-wrap.cataract.phase-strong-light .microscope-light { opacity: 0.95; }
.training-wrap.cataract.phase-strong-light .vignette-dark { opacity: 0.3; }

.training-wrap.cataract.phase-light-morph .red-reflex-bg { opacity: 1; }
.training-wrap.cataract.phase-light-morph .microscope-light { 
  opacity: 1;
  transform: scale(1.3);
  filter: blur(1px);
}
.training-wrap.cataract.phase-light-morph .cataract-opacity { opacity: 1; }
.training-wrap.cataract.phase-light-morph .vignette-dark { opacity: 0.5; }

.training-wrap.cataract.phase-clear .red-reflex-bg { opacity: 0.8; }
.training-wrap.cataract.phase-clear .microscope-light { 
  opacity: 0.85;
  transform: scale(1.1);
}
.training-wrap.cataract.phase-clear .cataract-opacity { opacity: 0.6; }
.training-wrap.cataract.phase-clear .vignette-dark { opacity: 0.4; }

.training-wrap.cataract.phase-no-blink .red-reflex-bg { opacity: 0.9; }
.training-wrap.cataract.phase-no-blink .microscope-light { opacity: 0.9; }
.training-wrap.cataract.phase-no-blink .cataract-opacity { opacity: 0.5; }
.training-wrap.cataract.phase-no-blink .vignette-dark { opacity: 0.35; }

/* 保留原有兼容性 */
.training-wrap.cataract .light-overlay { display: none; }

/* ========== P0: SMILE/FS-LASIK 真实场景 - 绿点与激光 ========== */
.training-wrap.smile,
.training-wrap.lasik {
  background: radial-gradient(ellipse 100% 100% at 50% 50%, #0a0a0f 0%, #000000 100%);
}

/* 激光扫描网格背景 */
.training-wrap.smile .laser-grid,
.training-wrap.lasik .laser-grid {
  position: absolute;
  inset: 0;
  background-image: 
    linear-gradient(rgba(0, 255, 136, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 255, 136, 0.03) 1px, transparent 1px);
  background-size: 50px 50px;
  opacity: 0;
  transition: opacity 1s ease;
  pointer-events: none;
}

/* 绿点舞台 */
.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: radial-gradient(circle at 30% 30%, #80ffb0, #00ff88 40%, #00cc6a 100%);
  box-shadow: 
    0 0 20px rgba(0, 255, 136, 0.9),
    0 0 40px rgba(0, 255, 136, 0.6),
    0 0 80px rgba(0, 255, 136, 0.3),
    inset 0 0 10px rgba(255, 255, 255, 0.5);
  opacity: 1;
  transition: transform 0.5s ease, opacity 0.4s ease, filter 0.6s ease;
  position: relative;
}

/* 绿点内部脉冲动画 */
.green-dot::before {
  content: '';
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  border: 2px solid rgba(0, 255, 136, 0.3);
  animation: dotPulse 2s ease-in-out infinite;
}

@keyframes dotPulse {
  0%, 100% { transform: scale(1); opacity: 0.5; }
  50% { transform: scale(1.5); opacity: 0; }
}

/* 激光扫描线效果 */
.laser-scan-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(0, 255, 136, 0.8), transparent);
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
}

/* 吸引环视觉效果 */
.suction-ring {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 200px;
  height: 200px;
  border-radius: 50%;
  border: 4px solid rgba(255, 255, 255, 0.1);
  box-shadow: 
    inset 0 0 30px rgba(0, 0, 0, 0.5),
    0 0 20px rgba(255, 255, 255, 0.1);
  opacity: 0;
  transition: opacity 1s ease;
  pointer-events: none;
}

.suction-ring::before {
  content: '';
  position: absolute;
  inset: -20px;
  border-radius: 50%;
  border: 2px dashed rgba(255, 255, 255, 0.1);
  animation: ringRotate 10s linear infinite;
}

@keyframes ringRotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* 固视灯 - FS-LASIK特有 */
.fixation-light {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #fff, #ffdd88 40%, #ffaa44 100%);
  box-shadow: 
    0 0 15px rgba(255, 200, 100, 0.9),
    0 0 30px rgba(255, 180, 80, 0.5);
  opacity: 0;
  transition: opacity 0.5s ease, transform 0.3s ease;
  pointer-events: none;
}

/* 绿点状态变化 */
.training-wrap.phase-dot-blur .green-dot {
  transform: scale(2.5);
  filter: blur(4px);
  opacity: 0.85;
}

.training-wrap.phase-vignette .green-dot {
  transform: scale(2);
  filter: blur(2px);
}

.training-wrap.phase-jump .green-dot {
  animation: dotJumpEnhanced 0.5s ease-in-out 4;
}

@keyframes dotJumpEnhanced {
  0%, 100% { transform: translate(0, 0) scale(1); }
  20% { transform: translate(8px, -6px) scale(1.1); }
  40% { transform: translate(-6px, 4px) scale(0.95); }
  60% { transform: translate(4px, -3px) scale(1.05); }
  80% { transform: translate(-3px, 2px) scale(0.98); }
}

.training-wrap.phase-dot-gone .green-dot {
  opacity: 0;
  transform: scale(0.3);
  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;
}

/* 激光相位激活 */
.training-wrap.phase-laser .laser-grid { opacity: 1; }
.training-wrap.phase-laser .laser-scan-line { 
  opacity: 1;
  animation: laserScan 3s ease-in-out infinite;
}

@keyframes laserScan {
  0%, 100% { top: 20%; opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { top: 80%; opacity: 0; }
}

.training-wrap.phase-suction .suction-ring { opacity: 1; }
.training-wrap.phase-fixation .fixation-light { opacity: 1; }

/* 绿点跳动时固视灯也跳动 */
.training-wrap.phase-jump .fixation-light {
  animation: lightJump 0.5s ease-in-out 4;
}

@keyframes lightJump {
  0%, 100% { transform: translate(-50%, -50%); }
  20% { transform: translate(calc(-50% + 8px), calc(-50% - 6px)); }
  40% { transform: translate(calc(-50% - 6px), calc(-50% + 4px)); }
  60% { transform: translate(calc(-50% + 4px), calc(-50% - 3px)); }
  80% { transform: translate(calc(-50% - 3px), calc(-50% + 2px)); }
}

/* 旧版兼容 */
@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);
}
.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;
}

/* 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;
}

/* ========== 瞳孔追踪 - 横屏Pad布局 ========== */

/* 横屏锁定 */
.landscape-lock {
  position: fixed;
  inset: 0;
  background: #0a0a0f;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  color: #fff;
  padding: 24px;
  text-align: center;
}

.landscape-lock .rotate-icon {
  font-size: 4rem;
  margin-bottom: 16px;
  animation: rotateHint 2s ease-in-out infinite;
}

@keyframes rotateHint {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(90deg); }
}

.landscape-lock p {
  font-size: 1.1rem;
  color: rgba(255,255,255,0.8);
  margin: 0;
}

/* 追踪布局容器 */
.tracking-layout {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: row;
  background: #0a0a0f;
  z-index: 100;
}

/* 左侧摄像头预览区 */
.tracking-preview-section {
  width: 240px;
  min-width: 240px;
  background: #1a1a1f;
  display: flex;
  flex-direction: column;
  border-right: 1px solid #333;
}

.tracking-preview-wrap {
  position: relative;
  width: 100%;
  height: 180px;
  background: #000;
  overflow: hidden;
}

.tracking-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1); /* 镜像显示 */
}

.tracking-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.tracking-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* 瞳孔指示器 */
.pupil-indicator {
  position: absolute;
  width: 12px;
  height: 12px;
  background: #00ff88;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 
    0 0 10px rgba(0,255,136,0.8),
    0 0 20px rgba(0,255,136,0.4);
  transition: all 0.1s ease;
  z-index: 5;
}

.pupil-indicator.is-center {
  background: #34c759;
  box-shadow: 
    0 0 15px rgba(52,199,89,0.9),
    0 0 30px rgba(52,199,89,0.5);
}

/* 中心区域边界 */
.center-zone {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 60px;
  height: 60px;
  border: 2px dashed rgba(255,255,255,0.3);
  border-radius: 50%;
  pointer-events: none;
}

/* 追踪状态面板 */
.tracking-status-section {
  flex: 1;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.tracking-status-panel {
  background: rgba(255,255,255,0.05);
  border-radius: 12px;
  padding: 16px;
  border: 1px solid rgba(255,255,255,0.1);
}

.status-item {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.status-indicator {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #666;
  transition: all 0.3s ease;
}

.status-indicator.good {
  background: #34c759;
  box-shadow: 0 0 10px rgba(52,199,89,0.6);
}

.status-indicator.warning {
  background: #ff9f0a;
  box-shadow: 0 0 10px rgba(255,159,10,0.6);
}

.status-indicator.lost {
  background: #ff3b30;
  box-shadow: 0 0 10px rgba(255,59,48,0.6);
}

.status-text {
  font-size: 0.95rem;
  color: rgba(255,255,255,0.9);
  font-weight: 500;
}

/* 偏离指示器 */
.deviation-meter {
  margin-top: 12px;
}

.deviation-bar-wrap {
  height: 8px;
  background: rgba(255,255,255,0.1);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 8px;
}

.deviation-bar {
  height: 100%;
  width: 0%;
  background: #34c759;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.deviation-bar.good {
  background: linear-gradient(90deg, #34c759, #30d158);
}

.deviation-bar.warning {
  background: linear-gradient(90deg, #ff9f0a, #ff9500);
}

.deviation-bar.danger {
  background: linear-gradient(90deg, #ff3b30, #ff2d55);
}

.deviation-value {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.7);
  font-weight: 600;
}

/* 迷你统计 */
.tracking-stats-mini {
  display: flex;
  justify-content: space-between;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,0.1);
}

.tracking-stats-mini span {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.6);
}

.tracking-stats-mini b {
  color: rgba(255,255,255,0.9);
  font-weight: 600;
}

/* 中央训练场景区 */
.training-scene-section {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* 瞳孔轨迹可视化 */
.trajectory-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 5;
}

.trajectory-canvas {
  width: 100%;
  height: 100%;
}

/* 横屏适配 */
@media (orientation: portrait) {
  .tracking-layout {
    flex-direction: column;
  }
  
  .tracking-preview-section {
    width: 100%;
    height: 120px;
    min-height: 120px;
    flex-direction: row;
    border-right: none;
    border-bottom: 1px solid #333;
  }
  
  .tracking-preview-wrap {
    width: 160px;
    height: 100%;
    min-width: 160px;
  }
  
  .tracking-status-section {
    flex-direction: row;
    align-items: center;
    padding: 8px 12px;
  }
  
  .tracking-status-panel {
    flex: 1;
    padding: 12px;
  }
}

/* 瞳孔轨迹图 - 报告页 */
.trajectory-viz {
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
  aspect-ratio: 1;
  background: #fafafa;
  border-radius: 12px;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
}

.trajectory-viz canvas {
  width: 100%;
  height: 100%;
}

.trajectory-center {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 20px;
  height: 20px;
  border: 2px dashed var(--medical-blue);
  border-radius: 50%;
  opacity: 0.5;
}

/* 摄像头权限提示 */
.camera-permission-dialog {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.camera-permission-content {
  background: #fff;
  border-radius: 16px;
  padding: 32px;
  max-width: 400px;
  text-align: center;
}

.camera-permission-content h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text);
}

.camera-permission-content p {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 24px;
  line-height: 1.6;
}

.camera-permission-content .btn-primary {
  width: 100%;
  margin-bottom: 12px;
}

.camera-permission-content .btn-secondary {
  background: transparent;
  color: var(--text-muted);
  border: none;
  font-size: 0.9rem;
  cursor: pointer;
}

/* 追踪调试信息（开发用） */
.tracking-debug {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(0,0,0,0.7);
  color: #0f0;
  font-family: monospace;
  font-size: 10px;
  padding: 8px;
  border-radius: 4px;
  z-index: 100;
  max-width: 200px;
  line-height: 1.4;
}

/* ========== 瞳孔轨迹图 - 报告页 ========== */
.tr-trajectory {
  margin-bottom: 20px;
}

.tr-trajectory .trajectory-viz {
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
  aspect-ratio: 1;
  background: #fafafa;
  border-radius: 12px;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
}

.tr-trajectory .trajectory-viz canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.tr-trajectory .trajectory-center {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 20px;
  height: 20px;
  border: 2px dashed var(--medical-blue);
  border-radius: 50%;
  opacity: 0.5;
  pointer-events: none;
}

.trajectory-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
  margin-top: 16px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.trajectory-legend .leg {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.trajectory-legend .leg i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.1);
}

.trajectory-legend .leg-center i { background: #34c759; }
.trajectory-legend .leg-deviation i { background: #ff3b30; }
.trajectory-legend .leg-blink i { background: #999; }
