/* 惠东吉隆安康医院 - 适老化与长辈关爱无障碍样式表 (GB/T 37668-2019 / WCAG 2.1 规范) */

/* 1. 关爱模式字号分级与全局行距 */
html.senior-mode {
  font-size: 19px !important;
}

html.senior-mode[data-font-scale="large"] {
  font-size: 21px !important;
}

html.senior-mode[data-font-scale="xlarge"] {
  font-size: 24px !important;
}

html.senior-mode body {
  line-height: 1.85 !important;
  letter-spacing: 0.4px !important;
  color: #111827 !important;
  background-color: #fafaf9 !important;
}

/* 2. 文本对比度提升：消除低对比浅灰，保护中老年弱视力群体 */
html.senior-mode .text-gray-400,
html.senior-mode .text-gray-500,
html.senior-mode .text-slate-400,
html.senior-mode .text-slate-500 {
  color: #374151 !important;
}

html.senior-mode .text-gray-600,
html.senior-mode .text-slate-600 {
  color: #1f2937 !important;
}

html.senior-mode .text-xs {
  font-size: 0.95rem !important;
  line-height: 1.5 !important;
}

html.senior-mode .text-sm {
  font-size: 1.05rem !important;
  line-height: 1.6 !important;
}

/* 3. 标题与卡片增强 */
html.senior-mode h1, 
html.senior-mode h2, 
html.senior-mode h3 {
  font-weight: 800 !important;
  letter-spacing: 0.5px !important;
  color: #064e3b !important;
}

/* 4. 触控热区与按钮防误触（最小高度 48px，充足触控面积） */
html.senior-mode button,
html.senior-mode a.btn,
html.senior-mode input,
html.senior-mode select {
  min-height: 48px !important;
  padding-top: 10px !important;
  padding-bottom: 10px !important;
  font-weight: 600 !important;
}

html.senior-mode .nav-link {
  font-size: 17px !important;
  padding: 14px 20px !important;
}

/* 5. 焦点键盘导航与高亮（Tab 键聚焦光环） */
html.senior-mode a:focus-visible,
html.senior-mode button:focus-visible,
html.senior-mode input:focus-visible,
html.senior-mode select:focus-visible {
  outline: 4px solid #f59e0b !important;
  outline-offset: 3px !important;
  box-shadow: 0 0 0 6px rgba(245, 158, 11, 0.4) !important;
}

/* 6. 高对比度配色 */
html.senior-mode.high-contrast {
  filter: contrast(125%);
}

html.senior-mode.high-contrast body {
  background-color: #ffffff !important;
  color: #000000 !important;
}

/* 7. 长辈就医快捷通道顶栏 (Senior Quick Assist Bar) */
#seniorQuickBar {
  display: none;
  background: #064e3b;
  border-bottom: 3px solid #f59e0b;
  color: #ffffff;
  padding: 10px 16px;
  position: relative;
  z-index: 99;
}

html.senior-mode #seniorQuickBar {
  display: block !important;
  animation: seniorSlideDown 0.25s ease-out;
}

@keyframes seniorSlideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 8. 悬浮无障碍关爱工具箱 (Floating Accessibility Widget) */
.senior-float-widget {
  position: fixed;
  left: 20px;
  bottom: 24px;
  z-index: 9999;
  font-family: inherit;
}

.senior-toggle-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #0f766e;
  color: #ffffff;
  padding: 10px 18px;
  border-radius: 9999px;
  border: 2px solid #f59e0b;
  box-shadow: 0 4px 16px rgba(15, 118, 110, 0.4);
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.senior-toggle-btn:hover {
  background: #0d5f58;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(15, 118, 110, 0.5);
}

.senior-toggle-btn:active {
  transform: translateY(0);
}

html.senior-mode .senior-toggle-btn {
  background: #d97706;
  border-color: #ffffff;
}

/* 关爱版浮动控制面板 */
.senior-panel-popup {
  display: none;
  position: absolute;
  bottom: 56px;
  left: 0;
  width: 300px;
  background: #ffffff;
  border: 2px solid #0f766e;
  border-radius: 16px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.25);
  padding: 16px;
  color: #1f2937;
  z-index: 10000;
  font-size: 14px;
}

.senior-panel-popup.show {
  display: block;
  animation: seniorPopupFade 0.2s ease-out;
}

@keyframes seniorPopupFade {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 语音朗读悬浮播报条 */
.voice-playing-indicator {
  position: fixed;
  top: 20px;
  right: 20px;
  background: #064e3b;
  color: #fef08a;
  padding: 12px 20px;
  border-radius: 9999px;
  border: 2px solid #eab308;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 99999;
  font-size: 15px;
  font-weight: 700;
  animation: seniorPulse 1.8s infinite;
}

@keyframes seniorPulse {
  0% { box-shadow: 0 0 0 0 rgba(234, 179, 8, 0.6); }
  70% { box-shadow: 0 0 0 12px rgba(234, 179, 8, 0); }
  100% { box-shadow: 0 0 0 0 rgba(234, 179, 8, 0); }
}

@media (max-width: 640px) {
  .senior-float-widget {
    left: 12px;
    bottom: 84px; /* 避开底部固定的快速呼叫或微信条 */
  }
  .senior-toggle-btn {
    padding: 8px 14px;
    font-size: 13px;
  }
  .senior-panel-popup {
    width: 280px;
    left: 0;
  }
}
