/**
 * 统一医疗级UI设计系统
 * 温暖关怀风格 + 中性柔和色调
 * 参考One Medical/Babylon等优秀医疗app设计
 */

/* ============================================
   设计系统变量
   ============================================ */

:root {
  /* 主色调（中性柔和） */
  --health-primary: #6B7280;        /* 主色：中性灰 */
  --health-primary-light: #9CA3AF;  /* 浅灰 */
  --health-primary-dark: #4B5563;   /* 深灰 */
  --health-accent: #A78BFA;         /* 柔和紫色（温暖点缀） */
  --health-accent-light: #C4B5FD;   /* 浅紫色 */
  
  /* 背景色（温暖柔和） */
  --health-bg-primary: #FAFAF9;     /* 主背景：温暖米白 */
  --health-bg-secondary: #F5F5F4;   /* 次背景：浅灰米色 */
  --health-bg-card: #FFFFFF;         /* 卡片背景：纯白 */
  --health-bg-elevated: #FFFFFF;     /* 浮起背景 */
  
  /* 文字颜色（清晰层级） */
  --health-text-primary: #1F2937;    /* 主文字：深灰 */
  --health-text-secondary: #6B7280;  /* 次文字：中性灰 */
  --health-text-tertiary: #9CA3AF;  /* 三级文字：浅灰 */
  --health-text-disabled: #D1D5DB;  /* 禁用文字 */
  
  /* 状态颜色（温暖友好） */
  --health-success: #10B981;        /* 成功：柔和绿 */
  --health-success-light: #D1FAE5;  /* 成功浅色 */
  --health-warning: #F59E0B;        /* 警告：柔和橙 */
  --health-warning-light: #FEF3C7;  /* 警告浅色 */
  --health-error: #EF4444;          /* 错误：柔和红 */
  --health-error-light: #FEE2E2;   /* 错误浅色 */
  --health-info: #3B82F6;           /* 信息：柔和蓝 */
  --health-info-light: #DBEAFE;     /* 信息浅色 */
  
  /* 边框颜色 */
  --health-border: #E5E7EB;         /* 边框：浅灰 */
  --health-border-light: #F3F4F6;  /* 浅边框 */
  --health-border-dark: #D1D5DB;   /* 深边框 */
  
  /* 间距系统（8px基准） */
  --health-spacing-xs: 4px;
  --health-spacing-sm: 8px;
  --health-spacing-md: 16px;
  --health-spacing-lg: 24px;
  --health-spacing-xl: 32px;
  --health-spacing-2xl: 48px;
  --health-spacing-3xl: 64px;
  
  /* 圆角系统（温暖圆润） */
  --health-radius-sm: 8px;
  --health-radius-md: 12px;
  --health-radius-lg: 16px;
  --health-radius-xl: 20px;
  --health-radius-2xl: 24px;
  --health-radius-round: 50%;
  
  /* 阴影系统（柔和阴影） */
  --health-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --health-shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
  --health-shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
  --health-shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.1);
  
  /* 字体系统 */
  --health-font-xs: 12px;
  --health-font-sm: 14px;
  --health-font-base: 16px;
  --health-font-lg: 18px;
  --health-font-xl: 20px;
  --health-font-2xl: 24px;
  --health-font-3xl: 30px;
  --health-font-4xl: 36px;
  
  /* 字体别名（兼容iOS命名） */
  --health-font-title1: var(--health-font-3xl);
  --health-font-title2: var(--health-font-2xl);
  --health-font-title3: var(--health-font-xl);
  --health-font-headline: var(--health-font-lg);
  --health-font-body: var(--health-font-base);
  --health-font-callout: var(--health-font-base);
  --health-font-subheadline: var(--health-font-sm);
  --health-font-footnote: var(--health-font-xs);
  --health-font-caption1: var(--health-font-xs);
  --health-font-caption2: var(--health-font-xs);
  --health-font-large-title: var(--health-font-4xl);
  
  /* 字重 */
  --health-weight-regular: 400;
  --health-weight-medium: 500;
  --health-weight-semibold: 600;
  --health-weight-bold: 700;
  
  /* 行高 */
  --health-line-height-tight: 1.4;
  --health-line-height-normal: 1.5;
  --health-line-height-relaxed: 1.6;
  --health-line-height-loose: 1.8;
  
  /* 动画系统（流畅自然） */
  --health-duration-fast: 0.15s;
  --health-duration-normal: 0.25s;
  --health-duration-slow: 0.35s;
  
  /* 动画曲线 */
  --health-ease: cubic-bezier(0.4, 0, 0.2, 1);
  --health-ease-out: cubic-bezier(0, 0, 0.2, 1);
  
  /* Z-index层级 */
  --health-z-base: 1;
  --health-z-dropdown: 1000;
  --health-z-sticky: 1020;
  --health-z-fixed: 1030;
  --health-z-modal-backdrop: 1040;
  --health-z-modal: 1050;
  --health-z-popover: 1060;
  --health-z-tooltip: 1070;
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
  :root {
    --health-bg-primary: #111827;
    --health-bg-secondary: #1F2937;
    --health-bg-card: #1F2937;
    --health-bg-elevated: #374151;
    
    --health-text-primary: #F9FAFB;
    --health-text-secondary: #D1D5DB;
    --health-text-tertiary: #9CA3AF;
    --health-text-disabled: #6B7280;
    
    --health-border: #374151;
    --health-border-light: #4B5563;
    --health-border-dark: #6B7280;
  }
}

/* ============================================
   基础样式
   ============================================ */

.health-app {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-color: var(--health-bg-primary);
  color: var(--health-text-primary);
  min-height: 100vh;
  line-height: var(--health-line-height-normal);
}

/* ============================================
   导航栏组件
   ============================================ */

.health-nav {
  position: sticky;
  top: 0;
  z-index: var(--health-z-sticky);
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(20px) saturate(180%);
  margin-top: 0;
  padding-top: 0;
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--health-border-light);
  padding-top: calc(env(safe-area-inset-top, 0px) + var(--health-spacing-md));
  padding-bottom: var(--health-spacing-md);
  padding-left: 0;
  padding-right: 0;
  min-height: 60px; /* 确保有足够高度容纳logo */
}

.health-nav-blur {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
}

.health-nav-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 100%;
  margin: 0 auto;
  padding: 0 var(--health-spacing-md);
  min-height: 52px; /* 确保有足够高度容纳logo */
}

/* 管理端导航栏特殊设置 - 移除前后留空，占满整个宽度 */
#adminTopNav.health-nav .health-nav-content {
  max-width: 100% !important;
  width: 100% !important;
  margin: 0 !important;
}

/* 管理端内容区域移除顶部留空（导航栏使用sticky定位，不需要预留空间） */
body.admin-pc-page .health-container,
body.health-app.admin-pc-page .health-container {
  padding-top: 0 !important;
  margin-top: 0 !important;
}

/* 管理端导航栏确保无留空，滚动时置顶 */
#adminTopNav.health-nav {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  position: sticky !important;
  position: -webkit-sticky !important; /* Safari */
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
}

@media (min-width: 768px) {
  .health-nav-content {
    max-width: 700px;
  }
}

@media (min-width: 1024px) {
  .health-nav-content {
    max-width: 1000px;
  }
}

.health-nav-logo {
  display: flex;
  align-items: center;
  gap: var(--health-spacing-md);
  text-decoration: none;
  color: inherit;
  height: 100%;
  min-height: 52px; /* 确保logo有足够高度 */
}

.health-nav-logo:hover {
  opacity: 0.8;
}

.health-nav-logo-img {
  width: 120px;
  height: auto;
  min-width: 80px;
  max-width: 150px;
  max-height: 52px;
  border-radius: var(--health-radius-md);
  object-fit: contain; /* 使用contain确保完整显示，不被裁剪 */
  flex-shrink: 0;
  display: block;
}

.health-nav-logo-text {
  display: flex;
  flex-direction: column;
}

/* 兼容页面中直接使用div的情况 */
.health-nav-logo > div:not(.health-nav-logo-text) {
  display: flex;
  flex-direction: column;
}

.health-nav-logo-title {
  font-size: var(--health-font-lg);
  font-weight: var(--health-weight-bold);
  color: var(--health-text-primary);
  line-height: 1.2;
  margin: 0;
}

.health-nav-logo-subtitle {
  font-size: var(--health-font-xs);
  color: var(--health-text-tertiary);
  margin-top: 2px;
  margin: 0;
}

.health-nav-title {
  font-size: var(--health-font-xl);
  font-weight: var(--health-weight-bold);
  color: var(--health-text-primary);
  margin: 0;
  line-height: 1.2;
}

.health-nav-subtitle {
  font-size: var(--health-font-sm);
  color: var(--health-text-tertiary);
  margin-top: 2px;
}

.health-nav-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: var(--health-spacing-sm) var(--health-spacing-md);
  background: transparent;
  border: none;
  border-radius: var(--health-radius-md);
  color: var(--health-primary);
  font-size: var(--health-font-base);
  cursor: pointer;
  transition: background-color var(--health-duration-fast) var(--health-ease);
  -webkit-tap-highlight-color: transparent;
}

.health-nav-button:hover {
  background-color: var(--health-bg-secondary);
}

.health-nav-button:active {
  background-color: var(--health-bg-secondary);
  transform: scale(0.95);
}

/* ============================================
   容器组件
   ============================================ */

.health-container {
  max-width: 100%;
  margin: 0 auto;
  padding: var(--health-spacing-lg) var(--health-spacing-md);
  padding-bottom: calc(70px + env(safe-area-inset-bottom, 0px) + var(--health-spacing-lg));
}

@media (min-width: 768px) {
  .health-container {
    max-width: 700px;
    padding: var(--health-spacing-xl) var(--health-spacing-lg);
  }
}

@media (min-width: 1024px) {
  .health-container {
    max-width: 1000px;
  }
}

/* ============================================
   卡片组件
   ============================================ */

.health-card {
  background: var(--health-bg-card);
  border: 1px solid var(--health-border-light);
  border-radius: var(--health-radius-lg);
  padding: var(--health-spacing-lg);
  margin-bottom: var(--health-spacing-lg);
  transition: all var(--health-duration-normal) var(--health-ease);
  box-shadow: var(--health-shadow-sm);
  color: var(--health-text-primary); /* 确保文字颜色 */
}

/* 确保health-card内的文字颜色正确 */
.health-card,
.health-card * {
  color: inherit;
}

/* 如果卡片有白色背景，确保文字是深色 */
.health-card[style*="background: white"],
.health-card[style*="background: #fff"],
.health-card[style*="background: #ffffff"],
.health-card.bg-white {
  color: var(--health-text-primary) !important;
}

.health-card.bg-white * {
  color: var(--health-text-primary) !important;
}

/* 修复Tailwind bg-white类的文字颜色 */
.bg-white {
  color: var(--health-text-primary) !important;
}

/* 确保所有白色背景的元素都有正确的文字颜色 */
[class*="bg-white"],
[style*="background: white"],
[style*="background:#fff"],
[style*="background: #fff"],
[style*="background:#ffffff"],
[style*="background: #ffffff"],
[style*="background-color: white"],
[style*="background-color:#fff"],
[style*="background-color: #fff"],
[style*="background-color:#ffffff"],
[style*="background-color: #ffffff"] {
  color: var(--health-text-primary) !important;
}

/* 确保bg-white内的Tailwind文本颜色类正常工作 */
.bg-white .text-slate-700,
.bg-white .text-slate-800,
.bg-white .text-slate-600,
.bg-white .text-blue-800,
.bg-white .text-blue-600,
.bg-white .text-green-800,
.bg-white .text-red-800,
.bg-white .text-purple-800,
.bg-white .text-orange-800,
.bg-white .text-cyan-800,
.bg-white .text-indigo-800,
.bg-white .text-emerald-800 {
  color: inherit !important;
}

.bg-white *:not([style*="color: white"]):not([style*="color:#fff"]):not([style*="color:#ffffff"]):not([style*="color:white"]):not([class*="text-white"]):not([class*="text-slate-"]):not([class*="text-blue-"]):not([class*="text-green-"]):not([class*="text-red-"]):not([class*="text-purple-"]):not([class*="text-orange-"]):not([class*="text-cyan-"]):not([class*="text-indigo-"]):not([class*="text-yellow-"]):not([class*="text-pink-"]) {
  color: var(--health-text-primary) !important;
}

/* 确保bg-white内的所有文本元素都有颜色（但保留Tailwind文本颜色类） */
.bg-white p:not([class*="text-"]):not([style*="color"]),
.bg-white h1:not([class*="text-"]):not([style*="color"]),
.bg-white h2:not([class*="text-"]):not([style*="color"]),
.bg-white h3:not([class*="text-"]):not([style*="color"]),
.bg-white h4:not([class*="text-"]):not([style*="color"]),
.bg-white h5:not([class*="text-"]):not([style*="color"]),
.bg-white h6:not([class*="text-"]):not([style*="color"]),
.bg-white span:not([class*="text-"]):not([style*="color"]),
.bg-white div:not([style*="color"]):not([class*="text-"]) {
  color: var(--health-text-primary) !important;
}

/* 确保所有白色背景的元素都有深色文字（但保留Tailwind文本颜色类） */
[class*="bg-white"]:not([class*="text-"]):not([style*="color"]),
[style*="background: white"]:not([class*="text-"]):not([style*="color"]),
[style*="background: #fff"]:not([class*="text-"]):not([style*="color"]),
[style*="background: #ffffff"]:not([class*="text-"]):not([style*="color"]) {
  color: var(--health-text-primary) !important;
}

/* 对于bg-white内的元素，如果没有Tailwind文本颜色类，使用默认深色 */
[class*="bg-white"] *:not([class*="text-white"]):not([class*="text-slate-"]):not([class*="text-blue-"]):not([class*="text-green-"]):not([class*="text-red-"]):not([class*="text-purple-"]):not([class*="text-orange-"]):not([class*="text-cyan-"]):not([class*="text-indigo-"]):not([class*="text-yellow-"]):not([class*="text-pink-"]):not([style*="color: white"]):not([style*="color:#fff"]):not([style*="color:#ffffff"]):not([style*="color:white"]) {
  color: var(--health-text-primary) !important;
}

/* 确保Tailwind文本颜色类优先级更高 - 不覆盖Tailwind的颜色类 */
/* 注意：Tailwind的文本颜色类有自己的优先级，不需要强制覆盖 */
.bg-white [class*="text-slate-"],
.bg-white [class*="text-blue-"],
.bg-white [class*="text-green-"],
.bg-white [class*="text-red-"],
.bg-white [class*="text-purple-"],
.bg-white [class*="text-orange-"],
.bg-white [class*="text-cyan-"],
.bg-white [class*="text-indigo-"],
.bg-white [class*="text-yellow-"],
.bg-white [class*="text-pink-"],
.bg-white [class*="text-emerald-"],
.bg-white [class*="text-teal-"] {
  /* Tailwind类会设置自己的颜色，不覆盖 */
  /* 移除!important，让Tailwind类正常工作 */
}

.health-card:hover {
  box-shadow: var(--health-shadow-md);
  border-color: var(--health-border);
  transform: translateY(-2px);
}

.health-card-group {
  background: var(--health-bg-secondary);
  border-radius: var(--health-radius-xl);
  padding: var(--health-spacing-md);
  margin-bottom: var(--health-spacing-xl);
}

.health-card-group-item {
  background: var(--health-bg-card);
  border-radius: var(--health-radius-lg);
  padding: var(--health-spacing-lg);
  margin-bottom: var(--health-spacing-md);
  border: 1px solid var(--health-border-light);
}

.health-card-group-item:last-child {
  margin-bottom: 0;
}

/* ============================================
   按钮组件
   ============================================ */

.health-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--health-spacing-sm) var(--health-spacing-lg);
  border-radius: var(--health-radius-md);
  font-size: var(--health-font-base);
  font-weight: var(--health-weight-medium);
  line-height: var(--health-line-height-normal);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--health-duration-normal) var(--health-ease);
  -webkit-tap-highlight-color: transparent;
  min-height: 48px; /* 移动端友好 */
  text-decoration: none;
  user-select: none;
}

.health-btn-primary {
  background: linear-gradient(135deg, var(--health-primary) 0%, var(--health-primary-dark) 100%);
  color: #FFFFFF;
  border-color: var(--health-primary);
  box-shadow: var(--health-shadow-sm);
}

.health-btn-primary:hover {
  background: linear-gradient(135deg, var(--health-primary-light) 0%, var(--health-primary) 100%);
  box-shadow: var(--health-shadow-md);
  transform: translateY(-2px);
}

.health-btn-primary:active {
  transform: translateY(0);
  box-shadow: var(--health-shadow-sm);
}

.health-btn-secondary {
  background: var(--health-bg-card);
  color: var(--health-text-primary);
  border-color: var(--health-border);
}

.health-btn-secondary:hover {
  background: var(--health-bg-secondary);
  border-color: var(--health-primary);
  color: var(--health-primary);
}

.health-btn-text {
  background: transparent;
  color: var(--health-primary);
  border-color: transparent;
  padding: var(--health-spacing-xs) var(--health-spacing-sm);
}

.health-btn-text:hover {
  background: var(--health-bg-secondary);
}

/* 按钮尺寸 */
.health-btn-large {
  padding: var(--health-spacing-md) var(--health-spacing-xl);
  font-size: var(--health-font-lg);
  min-height: 52px;
}

.health-btn-small {
  padding: var(--health-spacing-xs) var(--health-spacing-md);
  font-size: var(--health-font-sm);
  min-height: 36px;
}

/* 按钮状态 */
.health-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.health-btn-full {
  width: 100%;
}

/* ============================================
   表单组件
   ============================================ */

.health-input {
  width: 100%;
  padding: var(--health-spacing-sm) var(--health-spacing-md);
  border: 1px solid var(--health-border);
  border-radius: var(--health-radius-md);
  background: var(--health-bg-card);
  color: var(--health-text-primary);
  font-size: var(--health-font-base);
  line-height: var(--health-line-height-normal);
  transition: all var(--health-duration-normal) var(--health-ease);
  min-height: 48px; /* 移动端友好，防止iOS自动缩放 */
  -webkit-appearance: none;
  appearance: none;
}

.health-input:focus {
  outline: none;
  border-color: var(--health-primary);
  box-shadow: 0 0 0 3px rgba(107, 114, 128, 0.1);
}

.health-input::placeholder {
  color: var(--health-text-tertiary);
}

.health-input:disabled {
  background: var(--health-bg-secondary);
  color: var(--health-text-disabled);
  cursor: not-allowed;
}

.health-input-group {
  margin-bottom: var(--health-spacing-lg);
}

.health-label {
  display: block;
  font-size: var(--health-font-sm);
  font-weight: var(--health-weight-medium);
  color: var(--health-text-primary);
  margin-bottom: var(--health-spacing-sm);
}

.health-label-required::after {
  content: ' *';
  color: var(--health-error);
}

.health-textarea {
  width: 100%;
  min-height: 100px;
  padding: var(--health-spacing-md);
  border: 1px solid var(--health-border);
  border-radius: var(--health-radius-md);
  background: var(--health-bg-card);
  color: var(--health-text-primary);
  font-size: var(--health-font-base);
  font-family: inherit;
  resize: vertical;
  transition: all var(--health-duration-normal) var(--health-ease);
  -webkit-appearance: none;
  appearance: none;
}

.health-textarea:focus {
  outline: none;
  border-color: var(--health-primary);
  box-shadow: 0 0 0 3px rgba(107, 114, 128, 0.1);
}

.health-textarea::placeholder {
  color: var(--health-text-tertiary);
}

/* ============================================
   底部导航栏
   ============================================ */

.health-tab-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-top: 1px solid var(--health-border-light);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  z-index: var(--health-z-fixed);
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.05);
}

.health-tab-bar-content {
  display: flex;
  align-items: center;
  justify-content: space-around;
  height: 50px;
  padding: 0 var(--health-spacing-xs);
  max-width: 100%;
}

.health-tab-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: var(--health-spacing-xs) 2px;
  color: var(--health-text-tertiary);
  text-decoration: none;
  transition: all var(--health-duration-normal) var(--health-ease);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  min-width: 0;
  position: relative;
}

.health-tab-item-icon {
  font-size: 22px;
  margin-bottom: 2px;
  transition: all var(--health-duration-normal) var(--health-ease);
  display: flex;
  align-items: center;
  justify-content: center;
  color: inherit;
  position: relative;
}

.health-tab-item-icon i {
  font-size: 22px;
  color: inherit;
}

.health-tab-item-label {
  font-size: 11px;
  font-weight: var(--health-weight-medium);
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  padding: 0 2px;
}

.health-tab-item.active {
  color: var(--health-primary);
}

.health-tab-item.active .health-tab-item-icon {
  transform: scale(1.05);
  color: var(--health-primary);
}

.health-tab-item.active .health-tab-item-label {
  color: var(--health-primary);
  font-weight: var(--health-weight-semibold);
}

.health-tab-item.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 2px;
  background: var(--health-primary);
  border-radius: 0 0 2px 2px;
}

.health-tab-item:active {
  transform: scale(0.95);
  opacity: 0.8;
}

.health-tab-badge {
  position: absolute;
  top: -4px;
  right: -8px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  background: var(--health-error);
  border-radius: 8px;
  font-size: 10px;
  font-weight: var(--health-weight-semibold);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  box-shadow: 0 2px 4px rgba(239, 68, 68, 0.3);
  z-index: 1;
}

.health-tab-badge.dot {
  min-width: 8px;
  width: 8px;
  height: 8px;
  padding: 0;
  border-radius: 50%;
  right: -4px;
  top: -2px;
}

/* ============================================
   列表组件
   ============================================ */

.health-list {
  background: var(--health-bg-card);
  border-radius: var(--health-radius-lg);
  overflow: hidden;
  margin-bottom: var(--health-spacing-xl);
  border: 1px solid var(--health-border-light);
}

.health-list-section {
  margin-bottom: var(--health-spacing-md);
}

.health-list-section-header {
  padding: var(--health-spacing-sm) var(--health-spacing-lg);
  font-size: var(--health-font-xs);
  font-weight: var(--health-weight-semibold);
  color: var(--health-text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: var(--health-bg-secondary);
}

.health-list-item {
  display: flex;
  align-items: center;
  padding: var(--health-spacing-lg);
  border-bottom: 1px solid var(--health-border-light);
  text-decoration: none;
  color: var(--health-text-primary);
  transition: background var(--health-duration-fast) var(--health-ease);
  cursor: pointer;
  min-height: 44px;
}

.health-list-item:last-child {
  border-bottom: none;
}

.health-list-item:hover {
  background: var(--health-bg-secondary);
}

.health-list-item:active {
  background: var(--health-bg-secondary);
  transform: scale(0.98);
}

.health-list-item-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: var(--health-spacing-lg);
  color: var(--health-text-secondary);
  flex-shrink: 0;
}

.health-list-item-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--health-spacing-xs);
  min-width: 0;
}

.health-list-item-title {
  font-size: var(--health-font-base);
  font-weight: var(--health-weight-regular);
  color: var(--health-text-primary);
  line-height: var(--health-line-height-normal);
}

.health-list-item-subtitle {
  font-size: var(--health-font-sm);
  color: var(--health-text-tertiary);
  line-height: var(--health-line-height-normal);
}

.health-list-item-chevron {
  margin-left: var(--health-spacing-sm);
  color: var(--health-text-tertiary);
  font-size: var(--health-font-sm);
  flex-shrink: 0;
}

/* ============================================
   状态指示器
   ============================================ */

.health-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--health-border-light);
  border-top-color: var(--health-primary);
  border-radius: var(--health-radius-round);
  animation: health-spin 0.6s linear infinite;
}

@keyframes health-spin {
  to {
    transform: rotate(360deg);
  }
}

.health-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--health-spacing-xl);
  gap: var(--health-spacing-md);
}

.health-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--health-spacing-3xl);
  text-align: center;
}

.health-empty-icon {
  width: 64px;
  height: 64px;
  margin-bottom: var(--health-spacing-lg);
  color: var(--health-text-tertiary);
  opacity: 0.5;
}

.health-empty-title {
  font-size: var(--health-font-lg);
  font-weight: var(--health-weight-semibold);
  color: var(--health-text-primary);
  margin-bottom: var(--health-spacing-sm);
}

.health-empty-description {
  font-size: var(--health-font-base);
  color: var(--health-text-tertiary);
  line-height: var(--health-line-height-relaxed);
}

/* ============================================
   工具类
   ============================================ */

/* 文本对齐 */
.health-text-left { text-align: left; }
.health-text-center { text-align: center; }
.health-text-right { text-align: right; }

/* 文本颜色 */
.health-text-primary { color: var(--health-text-primary); }
.health-text-secondary { color: var(--health-text-secondary); }
.health-text-tertiary { color: var(--health-text-tertiary); }
.health-text-primary-color { color: var(--health-primary); }
.health-text-success { color: var(--health-success); }
.health-text-warning { color: var(--health-warning); }
.health-text-error { color: var(--health-error); }
.health-text-info { color: var(--health-info); }

/* 背景颜色 */
.health-bg-primary { background: var(--health-bg-primary); }
.health-bg-secondary { background: var(--health-bg-secondary); }
.health-bg-card { background: var(--health-bg-card); }
.health-bg-success { background: var(--health-success-light); }
.health-bg-warning { background: var(--health-warning-light); }
.health-bg-error { background: var(--health-error-light); }
.health-bg-info { background: var(--health-info-light); }

/* 间距 */
.health-mt-xs { margin-top: var(--health-spacing-xs); }
.health-mt-sm { margin-top: var(--health-spacing-sm); }
.health-mt-md { margin-top: var(--health-spacing-md); }
.health-mt-lg { margin-top: var(--health-spacing-lg); }
.health-mt-xl { margin-top: var(--health-spacing-xl); }

.health-mb-xs { margin-bottom: var(--health-spacing-xs); }
.health-mb-sm { margin-bottom: var(--health-spacing-sm); }
.health-mb-md { margin-bottom: var(--health-spacing-md); }
.health-mb-lg { margin-bottom: var(--health-spacing-lg); }
.health-mb-xl { margin-bottom: var(--health-spacing-xl); }

.health-p-xs { padding: var(--health-spacing-xs); }
.health-p-sm { padding: var(--health-spacing-sm); }
.health-p-md { padding: var(--health-spacing-md); }
.health-p-lg { padding: var(--health-spacing-lg); }
.health-p-xl { padding: var(--health-spacing-xl); }

/* 显示/隐藏 */
.health-hidden { display: none !important; }
.health-visible { display: block !important; }

/* 页面过渡动画 */
.health-page {
  animation: health-fade-in var(--health-duration-normal) var(--health-ease);
}

.fade-in {
  animation: health-fade-in var(--health-duration-normal) var(--health-ease);
}

@keyframes health-fade-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 响应式设计 */
@media (max-width: 768px) {
  .health-card {
    padding: var(--health-spacing-md);
    margin-bottom: var(--health-spacing-md);
  }
  
  .health-btn {
    width: 100%;
    margin-bottom: var(--health-spacing-sm);
  }
  
  .health-input {
    font-size: 16px; /* 防止iOS自动缩放 */
  }
  
  .health-container {
    padding: var(--health-spacing-md);
  }
}

/* 安全区域适配 */
.health-safe-top {
  padding-top: calc(env(safe-area-inset-top, 0px) + var(--health-spacing-md));
}

.health-safe-bottom {
  padding-bottom: calc(env(safe-area-inset-bottom, 0px) + var(--health-spacing-md));
}

/* 触摸优化 */
@media (hover: none) and (pointer: coarse) {
  .health-btn:hover {
    transform: none;
  }
  
  .health-card:hover {
    transform: none;
  }
}

/* ============================================
   兼容性：iOS变量映射（向后兼容）
   ============================================ */

:root {
  /* iOS变量映射到health变量 */
  --ios-bg-primary: var(--health-bg-primary);
  --ios-bg-secondary: var(--health-bg-secondary);
  --ios-bg-tertiary: var(--health-bg-card);
  --ios-bg-grouped: var(--health-bg-secondary);
  
  --ios-text-primary: var(--health-text-primary);
  --ios-text-secondary: var(--health-text-secondary);
  --ios-text-tertiary: var(--health-text-tertiary);
  --ios-text-quaternary: var(--health-text-disabled);
  
  --ios-separator: var(--health-border);
  --ios-separator-opaque: var(--health-border-dark);
  
  --ios-tint: var(--health-primary);
  --ios-tint-secondary: var(--health-accent);
  --ios-tint-tertiary: var(--health-accent);
  --ios-tint-quaternary: var(--health-error);
  
  --ios-red: var(--health-error);
  --ios-orange: var(--health-warning);
  --ios-yellow: var(--health-warning);
  --ios-green: var(--health-success);
  --ios-mint: var(--health-info);
  --ios-teal: var(--health-info);
  --ios-cyan: var(--health-info);
  --ios-blue: var(--health-info);
  --ios-indigo: var(--health-primary);
  --ios-purple: var(--health-accent);
  --ios-pink: var(--health-error);
  --ios-brown: var(--health-warning);
  
  --ios-spacing-xs: var(--health-spacing-xs);
  --ios-spacing-sm: var(--health-spacing-sm);
  --ios-spacing-md: var(--health-spacing-md);
  --ios-spacing-lg: var(--health-spacing-lg);
  --ios-spacing-xl: var(--health-spacing-xl);
  --ios-spacing-2xl: var(--health-spacing-2xl);
  
  --ios-radius-sm: var(--health-radius-sm);
  --ios-radius-md: var(--health-radius-md);
  --ios-radius-lg: var(--health-radius-lg);
  --ios-radius-xl: var(--health-radius-xl);
  --ios-radius-2xl: var(--health-radius-2xl);
  
  --ios-font-large-title: var(--health-font-4xl);
  --ios-font-title1: var(--health-font-3xl);
  --ios-font-title2: var(--health-font-2xl);
  --ios-font-title3: var(--health-font-xl);
  --ios-font-headline: var(--health-font-lg);
  --ios-font-body: var(--health-font-base);
  --ios-font-callout: var(--health-font-base);
  --ios-font-subheadline: var(--health-font-sm);
  --ios-font-footnote: var(--health-font-xs);
  --ios-font-caption1: var(--health-font-xs);
  --ios-font-caption2: var(--health-font-xs);
  
  --ios-duration-fast: var(--health-duration-fast);
  --ios-duration-normal: var(--health-duration-normal);
  --ios-duration-slow: var(--health-duration-slow);
  
  --ios-ease: var(--health-ease);
  --ios-ease-in: var(--health-ease);
  --ios-ease-out: var(--health-ease-out);
  --ios-ease-in-out: var(--health-ease);
  
  --ios-shadow-sm: var(--health-shadow-sm);
  --ios-shadow-md: var(--health-shadow-md);
  --ios-shadow-lg: var(--health-shadow-lg);
}

/* ============================================
   兼容性：iOS组件类（向后兼容）
   ============================================ */

.ios-input-group {
  margin-bottom: var(--health-spacing-lg);
}

.ios-input-label {
  display: block;
  font-size: var(--health-font-sm);
  font-weight: var(--health-weight-medium);
  color: var(--health-text-primary);
  margin-bottom: var(--health-spacing-sm);
  padding-left: var(--health-spacing-sm);
}

.ios-input {
  width: 100%;
  min-height: 48px;
  padding: var(--health-spacing-sm) var(--health-spacing-md);
  background: var(--health-bg-card);
  border: 1px solid var(--health-border);
  border-radius: var(--health-radius-md);
  font-size: var(--health-font-base);
  color: var(--health-text-primary);
  transition: all var(--health-duration-normal) var(--health-ease);
  -webkit-appearance: none;
  appearance: none;
}

.ios-input:focus {
  outline: none;
  border-color: var(--health-primary);
  box-shadow: 0 0 0 3px rgba(107, 114, 128, 0.1);
}

.ios-input::placeholder {
  color: var(--health-text-tertiary);
}

.ios-textarea {
  width: 100%;
  min-height: 100px;
  padding: var(--health-spacing-md);
  background: var(--health-bg-card);
  border: 1px solid var(--health-border);
  border-radius: var(--health-radius-md);
  font-size: var(--health-font-base);
  color: var(--health-text-primary);
  font-family: inherit;
  resize: vertical;
  transition: all var(--health-duration-normal) var(--health-ease);
  -webkit-appearance: none;
  appearance: none;
}

.ios-textarea:focus {
  outline: none;
  border-color: var(--health-primary);
  box-shadow: 0 0 0 3px rgba(107, 114, 128, 0.1);
}

.ios-textarea::placeholder {
  color: var(--health-text-tertiary);
}

.ios-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: var(--health-spacing-sm) var(--health-spacing-lg);
  border-radius: var(--health-radius-md);
  font-size: var(--health-font-base);
  font-weight: var(--health-weight-medium);
  border: none;
  cursor: pointer;
  transition: all var(--health-duration-normal) var(--health-ease);
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.ios-button-primary {
  background: linear-gradient(135deg, var(--health-primary) 0%, var(--health-primary-dark) 100%);
  color: #FFFFFF;
  box-shadow: var(--health-shadow-sm);
}

.ios-button-primary:hover {
  background: linear-gradient(135deg, var(--health-primary-light) 0%, var(--health-primary) 100%);
  box-shadow: var(--health-shadow-md);
  transform: translateY(-2px);
}

.ios-button-primary:active {
  transform: translateY(0);
  box-shadow: var(--health-shadow-sm);
}

.ios-button-secondary {
  background: var(--health-bg-card);
  color: var(--health-text-primary);
  border: 1px solid var(--health-border);
}

.ios-button-secondary:hover {
  background: var(--health-bg-secondary);
  border-color: var(--health-primary);
  color: var(--health-primary);
}

.ios-button-ghost {
  background: transparent;
  color: var(--health-primary);
}

.ios-button-ghost:hover {
  background: var(--health-bg-secondary);
}

.ios-button-full {
  width: 100%;
}

.ios-fab {
  position: fixed;
  bottom: calc(70px + env(safe-area-inset-bottom, 0px) + var(--health-spacing-lg));
  right: var(--health-spacing-lg);
  width: 56px;
  height: 56px;
  border-radius: var(--health-radius-round);
  background: linear-gradient(135deg, var(--health-primary) 0%, var(--health-primary-dark) 100%);
  color: white;
  border: none;
  box-shadow: var(--health-shadow-lg);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  z-index: var(--health-z-fixed);
  transition: all var(--health-duration-normal) var(--health-ease);
  -webkit-tap-highlight-color: transparent;
}

.ios-fab:hover {
  transform: scale(1.1);
  box-shadow: var(--health-shadow-xl);
}

.ios-fab:active {
  transform: scale(0.95);
}

.ios-card {
  background: var(--health-bg-card);
  border: 1px solid var(--health-border-light);
  border-radius: var(--health-radius-lg);
  padding: var(--health-spacing-lg);
  margin-bottom: var(--health-spacing-lg);
  transition: all var(--health-duration-normal) var(--health-ease);
  box-shadow: var(--health-shadow-sm);
}

.ios-card:hover {
  box-shadow: var(--health-shadow-md);
  border-color: var(--health-border);
  transform: translateY(-2px);
}

.ios-list {
  background: var(--health-bg-card);
  border-radius: var(--health-radius-lg);
  overflow: hidden;
  margin-bottom: var(--health-spacing-xl);
  border: 1px solid var(--health-border-light);
}

.ios-list-item {
  display: flex;
  align-items: center;
  padding: var(--health-spacing-lg);
  border-bottom: 1px solid var(--health-border-light);
  text-decoration: none;
  color: var(--health-text-primary);
  transition: background var(--health-duration-fast) var(--health-ease);
  cursor: pointer;
  min-height: 44px;
}

.ios-list-item:last-child {
  border-bottom: none;
}

.ios-list-item:hover {
  background: var(--health-bg-secondary);
}

.ios-list-item:active {
  background: var(--health-bg-secondary);
  transform: scale(0.98);
}

.ios-list-item-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: var(--health-spacing-lg);
  color: var(--health-text-secondary);
  flex-shrink: 0;
}

.ios-list-item-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--health-spacing-xs);
  min-width: 0;
}

.ios-list-item-title {
  font-size: var(--health-font-base);
  font-weight: var(--health-weight-regular);
  color: var(--health-text-primary);
  line-height: var(--health-line-height-normal);
}

.ios-list-item-subtitle {
  font-size: var(--health-font-sm);
  color: var(--health-text-tertiary);
  line-height: var(--health-line-height-normal);
}

.ios-list-item-chevron {
  margin-left: var(--health-spacing-sm);
  color: var(--health-text-tertiary);
  font-size: var(--health-font-sm);
  flex-shrink: 0;
}

.ios-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  background: var(--health-error);
  border-radius: 10px;
  font-size: var(--health-font-xs);
  font-weight: var(--health-weight-semibold);
  color: white;
  line-height: 1;
}

.ios-scale-in {
  animation: health-fade-in var(--health-duration-normal) var(--health-ease);
}

/* ============================================
   工具类补充
   ============================================ */

/* 文字间距 */
.spacing-wide {
  letter-spacing: 0.05em;
}

.spacing-wider {
  letter-spacing: 0.08em;
}

/* 行高 */
.leading-loose {
  line-height: 1.8;
}

.leading-extra-loose {
  line-height: 2;
}

/* 维度颜色（保留兼容性） */
.dimension-h,
.h-dimension {
  background: linear-gradient(to bottom right, #f3e8ff, #fce7f3);
  border-color: #a855f7;
}

.dimension-d,
.d-dimension {
  background: linear-gradient(to bottom right, #d1fae5, #a7f3d0);
  border-color: #10b981;
}

.dimension-e,
.e-dimension {
  background: linear-gradient(to bottom right, #cffafe, #a5f3fc);
  border-color: #06b6d4;
}

.dimension-b,
.b-dimension {
  background: linear-gradient(to bottom right, #fed7aa, #fdba74);
  border-color: #f97316;
}

/* 维度徽章 */
.dimension-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--health-radius-md);
  font-weight: var(--health-weight-bold);
  color: white;
}

.dimension-badge.h {
  background: linear-gradient(135deg, #a855f7 0%, #9333ea 100%);
}

.dimension-badge.d {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.dimension-badge.e {
  background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
}

.dimension-badge.b {
  background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
}

/* 边框颜色 */
.border-h-dimension {
  border-color: #a855f7;
}

.border-d-dimension {
  border-color: #10b981;
}

.border-e-dimension {
  border-color: #06b6d4;
}

.border-b-dimension {
  border-color: #f97316;
}
