/* app-theme web: mobile-only */
@media (max-width: 768px) {
/* =====================================================================
   app-theme.css — 仅作用于原生 App 的视觉增强层
   策略：不重编 React 包，仅覆盖/增强 Tailwind 产物。
   品牌色 #22A06B，iOS 质感（柔和层次、克制渐变、弹性动效）。
   ===================================================================== */

:root {
  /* 品牌 */
  --brand: #22a06b;
  --brand-deep: #0f6e46;
  --brand-soft: rgba(34, 160, 107, 0.12);
  --brand-gradient: linear-gradient(135deg, #2bb577 0%, #15915f 100%);
  --brand-gradient-deep: linear-gradient(135deg, #1a9b66 0%, #0e6a44 100%);

  /* 页面背景（极淡冷调，让白卡浮起） */
  --app-bg: linear-gradient(180deg, #f2f6f4 0%, #f5f8f7 26%, #f8faf9 58%, #f9fbf9 100%);

  /* 层次阴影 */
  --shadow-card: 0 1px 2px rgba(16, 24, 40, 0.04), 0 12px 30px -12px rgba(16, 24, 40, 0.14);
  --shadow-card-sm: 0 1px 2px rgba(16, 24, 40, 0.04), 0 8px 22px -10px rgba(16, 24, 40, 0.12);
  --shadow-brand: 0 8px 20px -6px rgba(14, 110, 70, 0.45);
  --hairline: rgba(15, 23, 42, 0.07);

  /* iOS 弹性曲线 */
  --ease-ios: cubic-bezier(0.32, 0.72, 0, 1);
  /* iOS 弹簧曲线（带轻微过冲，用于图标回弹） */
  --ease-spring: cubic-bezier(0.34, 1.3, 0.6, 1);
}

/* ---------- 基础 ---------- */
html {
  -webkit-tap-highlight-color: transparent;
}
body,
#root {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-variant-numeric: tabular-nums;
}
#root {
  animation: app-fade 0.35s ease both;
}

/* 隐藏滚动条，移动端更干净 */
#root ::-webkit-scrollbar {
  width: 0;
  height: 0;
}
#root * {
  scrollbar-width: none;
}

/* ---------- 页面背景 ---------- */
#root .min-h-screen.bg-white {
  background: var(--app-bg);
  background-attachment: fixed;
}

/* ---------- 卡片层次 ---------- */
#root .rounded-3xl.bg-white {
  box-shadow: var(--shadow-card);
}
#root .rounded-2xl.bg-white.shadow-sm {
  box-shadow: var(--shadow-card-sm);
}
/* 中性发丝边，替代过浅的 slate-100 */
#root .bg-white.border-slate-100 {
  border-color: var(--hairline);
}
/* 卡片内部分隔线更轻 */
#root .border-t.border-slate-100 {
  border-color: rgba(15, 23, 42, 0.05);
}

/* ---------- 主按钮 ---------- */
#root .bg-emerald-900 {
  background-image: var(--brand-gradient-deep);
  box-shadow: var(--shadow-brand);
}
#root .bg-emerald-600 {
  background-image: var(--brand-gradient);
  box-shadow: 0 8px 20px -6px rgba(21, 145, 95, 0.45);
}
#root button,
#root a {
  transition-timing-function: var(--ease-ios);
}

/* ---------- 底部 Tab 栏：悬浮液态玻璃大胶囊（iOS 原生 liquid glass 风格） ---------- */
/* 把 React 的贴底全宽 nav 改造成两侧留边、全圆角、强毛玻璃的悬浮胶囊 */
#root nav {
  left: 12px !important;
  right: 12px !important;
  width: auto !important;
  max-width: none !important;
  bottom: calc(10px + env(safe-area-inset-bottom) * 0.55) !important;
  translate: 0 !important;
  transform: none !important;
  padding-bottom: 0 !important;
  border-radius: 33px !important;
  border: 1px solid rgba(255, 255, 255, 0.6) !important;
  background: rgba(255, 255, 255, 0.5) !important;
  backdrop-filter: blur(26px) saturate(1.9) !important;
  -webkit-backdrop-filter: blur(26px) saturate(1.9) !important;
  box-shadow: 0 20px 44px -14px rgba(15, 23, 42, 0.28),
    inset 0 1px 1px rgba(255, 255, 255, 0.75) !important;
  overflow: hidden;
  touch-action: none;
}
/* 内层 flex 容器：固定 64 高、左右内边距，作为滑动玻璃片的定位参照 */
#root nav > div {
  position: relative;
  height: 64px;
  padding: 0 10px;
}
/* 隐藏 React 自带的逐档淡入药丸 */
#root nav .bg-emerald-50 {
  display: none;
}
/* 大尺寸液态玻璃激活片：由 app-tabbar.js 居中定位，全圆角、白色玻璃、淡绿描边，
   在各 Tab 间用 Apple 原生缓动平滑滑入（0.4s） */
#root .app-tab-indicator {
  position: absolute;
  top: 50%;
  left: 0;
  height: 54px;
  border-radius: 27px;
  background: rgba(255, 255, 255, 0.74);
  backdrop-filter: blur(14px) saturate(1.7);
  -webkit-backdrop-filter: blur(14px) saturate(1.7);
  border: 1px solid rgba(34, 160, 107, 0.26);
  box-shadow: 0 8px 18px -8px rgba(21, 145, 95, 0.4),
    inset 0 1px 1px rgba(255, 255, 255, 0.85);
  transform: translate(0, -50%);
  transition: transform 0.4s var(--ease-ios), width 0.4s var(--ease-ios);
  pointer-events: none;
}
/* 拖拽放大镜经过的 Tab：图标放大、变品牌绿（松手前的预览，不改变 React 状态） */
#root nav a.app-lens-hot {
  color: #15915f;
}
#root nav a.app-lens-hot svg {
  scale: 1.28;
  transition: scale 0.18s var(--ease-ios), color 0.18s var(--ease-ios);
}
/* 激活 Tab 的图标：Apple 原生弹簧回弹——深压缩、强过冲、再小幅震荡后落回 1.1 */
#root nav a.text-emerald-600 svg {
  animation: app-tab-pop 0.55s var(--ease-spring) both;
}
@keyframes app-tab-pop {
  0%   { scale: 0.6; }
  35%  { scale: 1.32; }
  58%  { scale: 0.92; }
  78%  { scale: 1.13; }
  100% { scale: 1.1; }
}
/* 悬浮胶囊浮于内容之上，给主内容加足底部留白，避免最后一排被遮挡 */
#root main {
  padding-bottom: calc(96px + env(safe-area-inset-bottom) * 0.4) !important;
}

/* ---------- 输入控件 ---------- */
#root input:focus,
#root textarea:focus,
#root select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px var(--brand-soft);
  outline: none;
}
#root input,
#root textarea {
  transition: border-color 0.18s var(--ease-ios), box-shadow 0.18s var(--ease-ios);
}

/* ---------- 倒计时（暖橙）卡 ---------- */
#root .border-orange-200.rounded-2xl {
  background: linear-gradient(135deg, #fff5ea 0%, #ffe7cf 100%);
  border-color: #f4c69b;
}
#root .bg-orange-400 {
  background-image: linear-gradient(135deg, #fb923c 0%, #f97316 100%);
  box-shadow: 0 6px 14px -4px rgba(249, 115, 22, 0.45);
}

/* ---------- 快速记录彩色图标 ---------- */
#root .bg-emerald-500.rounded-2xl {
  background-image: linear-gradient(135deg, #2bb577, #15915f);
  box-shadow: 0 6px 14px -4px rgba(21, 145, 95, 0.5);
}
#root .bg-teal-500.rounded-2xl {
  background-image: linear-gradient(135deg, #2dd4bf, #0d9488);
  box-shadow: 0 6px 14px -4px rgba(13, 148, 136, 0.5);
}
#root .bg-amber-500.rounded-2xl {
  background-image: linear-gradient(135deg, #fcd34d, #f59e0b);
  box-shadow: 0 6px 14px -4px rgba(245, 158, 11, 0.5);
}
#root .bg-green-500.rounded-2xl {
  background-image: linear-gradient(135deg, #4ade80, #16a34a);
  box-shadow: 0 6px 14px -4px rgba(22, 163, 74, 0.5);
}
#root .bg-red-400.rounded-2xl {
  background-image: linear-gradient(135deg, #fb7185, #ef4444);
  box-shadow: 0 6px 14px -4px rgba(239, 68, 68, 0.5);
}
#root .bg-cyan-500.rounded-2xl {
  background-image: linear-gradient(135deg, #22d3ee, #06b6d4);
  box-shadow: 0 6px 14px -4px rgba(6, 182, 212, 0.5);
}
#root .bg-violet-500.rounded-2xl {
  background-image: linear-gradient(135deg, #a78bfa, #8b5cf6);
  box-shadow: 0 6px 14px -4px rgba(139, 92, 246, 0.5);
}

/* ---------- 弹层 / 底部抽屉（仅增强背景模糊，不干预自带的上滑/淡入动画） ---------- */
#root .fixed.inset-0 {
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

/* ---------- 触感按压态（由 app-touch.js 切换） ---------- */
#root .app-pressed {
  transform: scale(0.97);
  transition: transform 0.14s var(--ease-ios), filter 0.14s var(--ease-ios);
}
#root .app-pressed-alt {
  filter: brightness(0.96);
  transition: filter 0.14s var(--ease-ios);
}

/* ---------- 焦点可见性（无障碍） ---------- */
#root a:focus-visible,
#root button:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* ---------- 关键帧 ---------- */
@keyframes app-fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* ---------- 疫苗关闭 / 跳过（app-vaccine.js） ---------- */
.app-vaccine-card {
  position: relative;
}

/* 半透明水印：已接种单个对号 / 已跳过单个叉，放在空白区不遮日期 */
.app-vaccine-watermark {
  position: absolute;
  right: 16px;
  width: 46px;
  height: 46px;
  display: none;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 0;
}
.app-vaccine-watermark svg {
  width: 100%;
  height: 100%;
}
/* 已接种：右下角空白（无 footer） */
.app-vaccine-watermark.is-done {
  display: flex;
  bottom: 10px;
  color: #22a06b;
  opacity: 0.13;
}
/* 已跳过：右侧中部空白（标签与底部操作之间） */
.app-vaccine-watermark.is-skipped {
  display: flex;
  top: 50%;
  transform: translateY(-50%);
  color: #e5484d;
  opacity: 0.15;
}

/* 已跳过灰色徽标 */
.app-vaccine-badge {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  line-height: 1;
  padding: 5px 10px;
  border-radius: 999px;
  background: #eef0f2;
  color: #8a9099;
  font-weight: 500;
  white-space: nowrap;
}

/* 已跳过卡片整体灰态 */
.app-vaccine-skipped {
  border-left-color: #dee0e3 !important;
  background: #f7f8fa !important;
  opacity: 0.78;
}
.app-vaccine-skipped > div:first-child > div.shrink-0 {
  display: none;
}
.app-vaccine-skipped .text-slate-900 {
  color: #8a9099 !important;
}

/* 详情页：关闭 / 恢复按钮（位于状态表单卡片下方） */
.app-vaccine-detail-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 48px;
  margin-top: 14px;
  border-radius: 999px;
  border: 1px solid #f0c9cb;
  background: #fff;
  color: #e5484d;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: transform 0.15s var(--ease-ios), background 0.2s, border-color 0.2s;
}
.app-vaccine-detail-btn svg {
  width: 18px;
  height: 18px;
}
.app-vaccine-detail-btn[data-mode="restore"] {
  border-color: #bfe6d4;
  color: #15915f;
}
.app-vaccine-detail-btn:active {
  transform: scale(0.97);
  background: #fafafa;
}

/* 轻量 toast */
.app-vaccine-toast {
  position: fixed;
  left: 50%;
  bottom: calc(110px + env(safe-area-inset-bottom));
  transform: translate(-50%, 12px);
  background: rgba(31, 35, 41, 0.92);
  color: #fff;
  font-size: 13px;
  padding: 10px 18px;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s var(--ease-ios), transform 0.25s var(--ease-ios);
  z-index: 120;
  max-width: 80vw;
}
.app-vaccine-toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---------- 尊重减弱动效 ---------- */
@media (prefers-reduced-motion: reduce) {
  #root {
    animation: none !important;
  }
  #root nav a.text-emerald-600 svg {
    animation: none !important;
  }
  #root *,
  #root *::before,
  #root *::after {
    transition-duration: 0.01ms !important;
  }
}

}
