/* ===================================================
   中医舌诊养生 - 明亮健康风移动端样式
   =================================================== */

/* ---- 禁止选中/复制/右键 & Reset ---- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

/* ---- CSS Variables ---- */
:root {
  /* 主色调：翡翠绿 + 暖金色 */
  --green:       #22c55e;
  --green-light: #4ade80;
  --green-dim:   #16a34a;
  --green-bg:    #f0fdf4;
  --gold:        #f59e0b;
  --gold-light:  #fbbf24;
  --gold-pure:   #d97706;

  /* 背景色系（明亮） */
  --bg-white:    #ffffff;
  --bg-warm:     #fefcf8;
  --bg-cream:    #faf8f4;
  --bg-card:     #ffffff;
  --bg-card2:    #f8faf7;

  /* 边框与阴影 */
  --border:      rgba(34,197,94,0.12);
  --border-md:   rgba(34,197,94,0.18);
  --shadow-sm:   0 2px 12px rgba(34,197,94,0.06);
  --shadow-md:   0 4px 20px rgba(0,0,0,0.06);
  --shadow-lg:   0 8px 32px rgba(0,0,0,0.08);
  --shadow-card: 0 4px 24px rgba(34,197,94,0.08);

  /* 文字色系 */
  --text-primary:#1a2e1a;
  --text-second: #4a5a4a;
  --text-dim:    #7a8a7a;
  --text-green:  #16a34a;

  /* 圆角 */
  --radius-xs:   8px;
  --radius-sm:   12px;
  --radius-md:   16px;
  --radius-lg:   20px;
  --radius-xl:   28px;

  --transition:  0.3s cubic-bezier(0.16,1,0.3,1);
}

/* ---- Base ---- */

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, "PingFang SC", "Noto Sans SC", "Source Han Sans SC", "Microsoft YaHei", sans-serif;
  background: var(--bg-warm);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
button { cursor: pointer; border: none; outline: none; background: none; font-family: inherit; }
input { outline: none; }

/* ---- Utility ---- */
.hidden { display: none !important; }
.active { display: block !important; }

/* ===================================================
   SPLASH SCREEN
   =================================================== */
.splash-screen {
  position: fixed; inset: 0; z-index: 9999;
  background: linear-gradient(160deg, #f0fdf4 0%, #ffffff 50%, #fefcf8 100%);
  display: flex; align-items: center; justify-content: center;
  animation: splashFadeOut 0.6s ease-out 2.2s forwards;
}

.splash-inner {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}

.splash-lotus svg {
  width: 100px; height: 100px;
  animation: lotusRotate 4s linear infinite, lotusAppear 0.8s ease-out forwards;
  opacity: 0;
  filter: drop-shadow(0 4px 12px rgba(34,197,94,0.2));
}

.splash-title {
  font-size: 2.4rem; font-weight: 800;
  background: linear-gradient(135deg, #16a34a, #22c55e, #4ade80);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 0.3em;
  animation: fadeSlideUp 0.6s ease-out 0.4s forwards; opacity: 0;
}

.splash-sub {
  font-size: 0.85rem; color: var(--text-dim); letter-spacing: 0.2em;
  animation: fadeSlideUp 0.6s ease-out 0.6s forwards; opacity: 0;
}

.splash-loader {
  width: 160px; margin-top: 24px;
  animation: fadeSlideUp 0.6s ease-out 0.8s forwards; opacity: 0;
}

.loader-track {
  height: 3px; background: rgba(34,197,94,0.1); border-radius: 3px; overflow: hidden;
}
.loader-fill {
  height: 100%; width: 0;
  background: linear-gradient(90deg, #16a34a, #22c55e, #4ade80);
  border-radius: 3px;
  animation: loaderProgress 1.8s ease-in-out 0.8s forwards;
}

@keyframes lotusRotate { to { transform: rotate(360deg); } }
@keyframes lotusAppear { to { opacity: 1; } }
@keyframes loaderProgress { to { width: 100%; } }
@keyframes splashFadeOut { to { opacity: 0; pointer-events: none; } }
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ===================================================
   APP SHELL
   =================================================== */
.app {
  position: relative; min-height: 100vh;
  max-width: 480px; margin: 0 auto;
  background: var(--bg-warm);
  overflow: hidden;
}

/* 背景装饰 */
.bg-ornament { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }

.bg-circle {
  position: absolute; border-radius: 50%;
}
.bg-circle-1 {
  width: 500px; height: 500px;
  top: -200px; right: -150px;
  background: radial-gradient(circle, rgba(34,197,94,0.08) 0%, transparent 70%);
  animation: bgFloat1 8s ease-in-out infinite;
}
.bg-circle-2 {
  width: 400px; height: 400px;
  bottom: 200px; left: -150px;
  background: radial-gradient(circle, rgba(245,158,11,0.06) 0%, transparent 70%);
  animation: bgFloat2 10s ease-in-out infinite;
}
.bg-circle-3 {
  width: 300px; height: 300px;
  top: 40%; right: -100px;
  background: radial-gradient(circle, rgba(34,197,94,0.05) 0%, transparent 70%);
  animation: bgFloat3 12s ease-in-out infinite;
}

@keyframes bgFloat1 { 0%,100%{ transform: translate(0,0); } 50%{ transform: translate(-20px,20px); } }
@keyframes bgFloat2 { 0%,100%{ transform: translate(0,0); } 50%{ transform: translate(20px,-15px); } }
@keyframes bgFloat3 { 0%,100%{ transform: translate(0,0); } 50%{ transform: translate(-15px,10px); } }

/* Page transitions */
.page {
  display: none;
  position: relative; z-index: 1;
  min-height: 100vh;
  padding-bottom: calc(env(safe-area-inset-bottom, 20px) + 20px);
  animation: pageIn 0.4s var(--transition);
}
.page.active { display: block; }

@keyframes pageIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ===================================================
   HOME PAGE
   =================================================== */

/* Header */
.home-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px 0;
}

.header-brand { display: flex; align-items: center; gap: 10px; }
.brand-icon {
  width: 42px; height: 42px;
  background: linear-gradient(135deg, #f0fdf4, #dcfce7);
  border: 1px solid rgba(34,197,94,0.15);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-sm);
}
.brand-text { display: flex; flex-direction: column; }
.brand-name { font-size: 1.1rem; font-weight: 700; color: var(--text-primary); letter-spacing: 0.02em; }
.brand-tagline { font-size: 0.65rem; color: var(--text-dim); letter-spacing: 0.1em; }

.header-badge {
  display: flex; align-items: center; gap: 6px;
  font-size: 0.72rem; color: var(--green-dim);
  background: var(--green-bg);
  border: 1px solid rgba(34,197,94,0.15);
  border-radius: 20px;
  padding: 5px 12px;
}
.badge-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 6px rgba(34,197,94,0.5);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse { 0%,100%{opacity:1;} 50%{opacity:0.5;} }

/* Hero Section */
.hero-section {
  position: relative;
  padding: 12px 20px 16px;
  min-height: 180px;
}

.hero-deco { 
  position: absolute; 
  right: -10px; 
  top: -10px; 
}

.deco-ring {
  position: absolute; border-radius: 50%;
  border: 1px solid rgba(34,197,94,0.08);
  transform: translate(-50%, -50%);
}
.deco-ring-1 { width: 100px; height: 100px; top: 60px; left: 60px; animation: ringPulse 3s ease-in-out infinite; }
.deco-ring-2 { width: 130px; height: 130px; top: 60px; left: 60px; animation: ringPulse 3s ease-in-out 0.5s infinite; }
.deco-ring-3 { width: 160px; height: 160px; top: 60px; left: 60px; animation: ringPulse 3s ease-in-out 1s infinite; }

.hero-lotus { position: relative; z-index: 1; animation: heroFloat 4s ease-in-out infinite; }
.hero-lotus svg { width: 110px !important; height: 110px !important; }

@keyframes ringPulse {
  0%,100%{ opacity:0.6; transform:translate(-50%,-50%) scale(1); }
  50%{ opacity:1; transform:translate(-50%,-50%) scale(1.04); }
}
@keyframes heroFloat {
  0%,100%{ transform: translateY(0) scale(1); }
  50%{ transform: translateY(-6px) scale(1.02); }
}

.hero-text { position: relative; z-index: 2; padding-right: 110px; }
.hero-title { margin-bottom: 8px; }
.hero-title .line1 {
  display: block;
  font-size: 1.6rem; font-weight: 800;
  background: linear-gradient(135deg, #1a2e1a 0%, #16a34a 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 0.02em;
}
.hero-title .line2 {
  display: block;
  font-size: 0.82rem; color: var(--text-dim);
  letter-spacing: 0.08em; margin-top: 2px;
  font-weight: 400;
}
.hero-desc {
  font-size: 0.75rem; color: var(--text-second);
  line-height: 1.6; letter-spacing: 0.02em;
}

/* Feature Cards - 2x2 Grid Layout */
.feature-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  padding: 0 20px 16px;
}

.feature-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}
.feature-card:active { transform: scale(0.97); }

.feature-icon { font-size: 1.5rem; }
.feature-info { display: flex; flex-direction: column; }
.feature-name { font-size: 0.88rem; font-weight: 600; color: var(--text-primary); }
.feature-desc { font-size: 0.72rem; color: var(--text-dim); margin-top: 2px; }

/* Upload Section */
.upload-section { padding: 0 20px 20px; }

.upload-card {
  position: relative;
  background: linear-gradient(145deg, #ffffff 0%, #f8faf7 100%);
  border: 1.5px solid rgba(34,197,94,0.15);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: var(--transition);
}
.upload-card:active { transform: scale(0.99); box-shadow: var(--shadow-md); }

/* 舌头卡通图（上传区域） */
.upload-katong-img {
  width: 100px;
  height: 100px;
  object-fit: contain;
  border-radius: 16px;
}

.upload-card-inner {
  padding: 20px 24px 28px;
  display: flex; flex-direction: column; align-items: center;
  text-align: center; gap: 8px; position: relative;
}

.upload-icon-wrap {
  position: relative; margin-bottom: 10px;
}
.upload-pulse {
  position: absolute; inset: -20px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(34,197,94,0.1) 0%, transparent 70%);
  animation: uploadPulse 2.5s ease-in-out infinite;
}
@keyframes uploadPulse {
  0%,100%{ transform: scale(0.9); opacity: 0.6; }
  50%{ transform: scale(1.15); opacity: 1; }
}

.upload-title {
  font-size: 1.1rem; font-weight: 700;
  color: var(--text-primary); letter-spacing: 0.02em;
}
.upload-hint {
  font-size: 0.78rem; color: var(--text-dim);
  line-height: 1.7; margin-bottom: 8px;
}

.upload-btns { display: flex; gap: 12px; margin-top: 8px; width: 100%; }

.btn-upload {
  flex: 1;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 16px;
  border-radius: var(--radius-md);
  font-size: 0.85rem; font-weight: 600;
  letter-spacing: 0.02em;
  transition: var(--transition);
}
.btn-camera {
  background: linear-gradient(135deg, #16a34a, #22c55e);
  color: #ffffff;
  box-shadow: 0 4px 16px rgba(34,197,94,0.3);
}
.btn-camera:active { transform: scale(0.96); box-shadow: 0 2px 8px rgba(34,197,94,0.2); }

.btn-gallery {
  background: var(--green-bg);
  border: 1px solid rgba(34,197,94,0.2);
  color: var(--green-dim);
}
.btn-gallery:active { transform: scale(0.96); background: #dcfce7; }

/* Guide Section */
.guide-section { padding: 0 20px 24px; }

.guide-title {
  font-size: 0.9rem; font-weight: 600;
  color: var(--text-primary); letter-spacing: 0.08em;
  margin-bottom: 14px;
  display: flex; align-items: center; gap: 8px;
}
.title-deco { font-size: 0.5rem; color: var(--green); }

.guide-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}
.guide-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex; flex-direction: column; gap: 6px;
  box-shadow: var(--shadow-sm);
}
.guide-num {
  font-size: 1.1rem; font-weight: 800;
  color: rgba(34,197,94,0.15);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.guide-item p {
  font-size: 0.74rem; color: var(--text-second);
  line-height: 1.6;
}

/* Disclaimer */
.disclaimer {
  padding: 0 20px 32px;
  text-align: center;
}
.disclaimer p {
  font-size: 0.7rem; color: var(--text-dim);
  letter-spacing: 0.03em;
  opacity: 0.7;
}

/* ===================================================
   PREVIEW PAGE
   =================================================== */
.preview-header, .report-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  background: var(--bg-white);
  border-bottom: 1px solid var(--border);
}

.back-btn, .share-btn {
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  background: var(--green-bg);
  border: 1px solid rgba(34,197,94,0.15);
  border-radius: 10px;
  color: var(--green-dim);
  transition: var(--transition);
}
.back-btn:active, .share-btn:active { transform: scale(0.93); background: #dcfce7; }

.page-title {
  font-size: 1rem; font-weight: 700;
  color: var(--text-primary); letter-spacing: 0.05em;
}

.preview-body { padding: 24px 20px; }

.preview-image-wrap { text-align: center; margin-bottom: 24px; }
.preview-frame {
  position: relative; display: inline-block;
  border-radius: var(--radius-lg);
  overflow: hidden;
  max-width: 280px; width: 100%;
  box-shadow: var(--shadow-lg);
}
/* 预览页舌头引导 */
.tongue-guide-frame {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 2;
}
.preview-frame img {
  width: 100%; aspect-ratio: 1;
  object-fit: cover; border-radius: var(--radius-lg);
  display: block;
}

.frame-corner {
  position: absolute; width: 24px; height: 24px;
  border-color: var(--green);
  border-style: solid;
}
.frame-tl { top: 10px; left: 10px; border-width: 2.5px 0 0 2.5px; border-radius: 6px 0 0 0; }
.frame-tr { top: 10px; right: 10px; border-width: 2.5px 2.5px 0 0; border-radius: 0 6px 0 0; }
.frame-bl { bottom: 10px; left: 10px; border-width: 0 0 2.5px 2.5px; border-radius: 0 0 0 6px; }
.frame-br { bottom: 10px; right: 10px; border-width: 0 2.5px 2.5px 0; border-radius: 0 0 6px 0; }

.preview-tip { margin-top: 12px; font-size: 0.76rem; color: var(--text-dim); }

.quality-check { margin-bottom: 24px; }
.quality-title {
  font-size: 0.88rem; font-weight: 600; color: var(--text-primary);
  margin-bottom: 12px; display: flex; align-items: center; gap: 8px;
  letter-spacing: 0.05em;
}

.quality-items { display: flex; flex-direction: column; gap: 8px; }
.quality-item {
  display: flex; align-items: center; gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 11px 14px;
  font-size: 0.82rem; color: var(--text-second);
  box-shadow: var(--shadow-sm);
}
.q-icon {
  width: 22px; height: 22px;
  background: rgba(34,197,94,0.1);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.72rem; color: var(--green); flex-shrink: 0;
}
.q-status {
  margin-left: auto; font-size: 0.73rem;
  color: var(--green-dim);
}

.preview-actions { display: flex; gap: 12px; }

.btn-primary {
  flex: 1;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 20px;
  background: linear-gradient(135deg, #16a34a, #22c55e);
  color: #ffffff;
  font-size: 0.9rem; font-weight: 700;
  letter-spacing: 0.05em;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 20px rgba(34,197,94,0.3);
  transition: var(--transition);
}
.btn-primary:active { transform: scale(0.97); box-shadow: 0 2px 10px rgba(34,197,94,0.2); }
.btn-primary.full-width { width: 100%; }

.btn-secondary {
  flex: 1;
  padding: 14px 20px;
  background: var(--bg-white);
  border: 1px solid var(--border-md);
  color: var(--text-primary);
  font-size: 0.9rem; font-weight: 600;
  letter-spacing: 0.02em;
  border-radius: var(--radius-md);
  transition: var(--transition);
}
.btn-secondary:active { transform: scale(0.97); background: var(--green-bg); }

/* ===================================================
   ANALYZING PAGE
   =================================================== */
#page-analyzing {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh;
  background: linear-gradient(180deg, var(--bg-warm) 0%, var(--green-bg) 100%);
}
.analyzing-body {
  display: flex; flex-direction: column; align-items: center;
  padding: 40px 24px; gap: 40px; width: 100%;
}

.scan-container {
  position: relative; width: 220px; height: 220px;
  contain: layout style paint;
}

.scan-image {
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: 50%;
  border: 3px solid rgba(34,197,94,0.3);
  box-shadow: 0 0 30px rgba(34,197,94,0.15);
}

.scan-overlay {
  position: absolute; inset: 0;
  border-radius: 50%; overflow: hidden;
}
.scan-line {
  position: absolute; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(34,197,94,0.7), transparent);
  box-shadow: 0 0 10px rgba(34,197,94,0.4);
  display: none;
}
/* 单向平滑扫描：从上到下，不回弹 */
@keyframes scanMoveSingle {
  0%   { top: -5%; opacity: 0; }
  15%  { opacity: 1; }
  85%  { opacity: 1; }
  100% { top: 105%; opacity: 0; }
}

.scan-grid {
  position: absolute; inset: 0;
  background-image:
    repeating-linear-gradient(0deg, transparent, transparent 19px, rgba(34,197,94,0.04) 20px),
    repeating-linear-gradient(90deg, transparent, transparent 19px, rgba(34,197,94,0.04) 20px);
}

.scan-ring {
  position: absolute;
  border-radius: 50%; border: 2px solid rgba(34,197,94,0.15);
  top: 50%; left: 50%; transform: translate(-50%,-50%);
  animation: scanRingPulseGentle 3.5s ease-out infinite;
}
.scan-ring-1 { width: 240px; height: 240px; animation-delay: 0s; }
.scan-ring-2 { width: 270px; height: 270px; animation-delay: 1.5s; }

@keyframes scanRingPulseGentle {
  0%  { transform: translate(-50%,-50%) scale(0.95); opacity: 0.4; }
  100%{ transform: translate(-50%,-50%) scale(1.12); opacity: 0; }
}

.analyzing-text { width: 100%; }
.analyzing-title {
  font-size: 1.4rem; font-weight: 800;
  background: linear-gradient(135deg, #1a2e1a, #16a34a);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  text-align: center;
  letter-spacing: 0.05em; margin-bottom: 8px;
}
.analyzing-sub {
  font-size: 0.82rem; color: var(--text-dim);
  text-align: center; margin-bottom: 28px;
  letter-spacing: 0.08em;
}
@keyframes textCycleGentle { 
  from { opacity: 0.65; } 
  to { opacity: 1; } 
}

.analyzing-steps { display: flex; flex-direction: column; gap: 10px; }

.step-item {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.83rem; color: var(--text-dim);
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}
.step-item.active {
  border-color: rgba(34,197,94,0.25);
  color: var(--text-primary);
  background: var(--green-bg);
}
.step-item.done {
  border-color: rgba(34,197,94,0.2);
  color: var(--green-dim);
  background: var(--green-bg);
}

.step-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--text-dim); flex-shrink: 0;
  transition: var(--transition);
}
.step-item.active .step-dot {
  background: var(--green);
  box-shadow: 0 0 8px rgba(34,197,94,0.5);
  animation: dotPulse 1s ease-in-out infinite;
}
.step-item.done .step-dot {
  background: var(--green);
  box-shadow: none;
}
@keyframes dotPulse {
  0%,100%{ transform: scale(1); }
  50%{ transform: scale(1.5); }
}

/* ===================================================
   REPORT PAGE
   =================================================== */
.report-body { padding: 20px; display: flex; flex-direction: column; gap: 16px; }

/* 舌象摘要卡 */
.report-summary-card {
  background: linear-gradient(145deg, var(--bg-card) 0%, var(--green-bg) 100%);
  border: 1px solid rgba(34,197,94,0.15);
  border-radius: var(--radius-xl);
  padding: 20px;
  display: flex; gap: 16px; align-items: center;
  box-shadow: var(--shadow-card);
}
.report-thumb {
  width: 80px; height: 80px; flex-shrink: 0;
  border-radius: var(--radius-md);
  object-fit: cover;
  border: 2px solid rgba(34,197,94,0.2);
  box-shadow: var(--shadow-md);
}
.report-summary-info { flex: 1; }
.report-label {
  font-size: 0.7rem; color: var(--text-dim); letter-spacing: 0.1em; margin-bottom: 4px;
}
.report-constitution {
  font-size: 1.3rem; font-weight: 800;
  background: linear-gradient(135deg, #16a34a, #22c55e);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 0.03em;
  margin-bottom: 6px;
}
.report-score-wrap { display: flex; align-items: center; gap: 8px; }
.report-score-bar {
  flex: 1; height: 5px;
  background: rgba(34,197,94,0.1);
  border-radius: 3px; overflow: hidden;
}
.report-score-fill {
  height: 100%;
  background: linear-gradient(90deg, #16a34a, #22c55e, #4ade80);
  border-radius: 3px;
  transition: width 1s ease-out;
}
.report-score-text {
  font-size: 0.85rem; font-weight: 700; color: var(--green-dim); width: 40px; text-align: right;
}

/* 消费券模块 */
.report-section-title {
  font-size: 0.9rem; font-weight: 700;
  color: var(--text-primary); letter-spacing: 0.1em;
  margin-bottom: 12px;
  display: flex; align-items: center; gap: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.section-icon { font-size: 1rem; }

.tongue-features {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}
.tongue-feature-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}
.tongue-feature-item {
  background: var(--bg-card2);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  border: 1px solid var(--border);
  min-height: 58px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.feature-label { font-size: 0.68rem; color: var(--text-dim); margin-bottom: 2px; letter-spacing: 0.06em; }
.feature-value { font-size: 0.82rem; font-weight: 600; color: var(--text-primary); line-height: 1.3; }
.feature-value.highlight { color: var(--text-green); }
.feature-value.highlight {
  background: linear-gradient(135deg, #16a34a, #22c55e);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 700;
}

/* 健康状态 */
.health-indicators { display: flex; flex-direction: column; gap: 10px; }
.health-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  display: flex; align-items: center; gap: 12px;
  box-shadow: var(--shadow-sm);
}
.health-icon { font-size: 1.1rem; flex-shrink: 0; }
.health-info { flex: 1; }
.health-name { font-size: 0.8rem; color: var(--text-primary); margin-bottom: 5px; font-weight: 500; }
.health-bar { height: 5px; background: rgba(34,197,94,0.08); border-radius: 3px; overflow: hidden; }
.health-bar-fill { height: 100%; border-radius: 3px; transition: width 1.2s ease-out; }
.health-bar-fill.good { background: linear-gradient(90deg, #16a34a, #4ade80); }
.health-bar-fill.fair { background: linear-gradient(90deg, #d97706, #fbbf24); }
.health-bar-fill.poor { background: linear-gradient(90deg, #dc2626, #f87171); }
.health-level { font-size: 0.72rem; color: var(--text-dim); flex-shrink: 0; }

/* 分析详情 */
.analysis-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}
.analysis-text {
  font-size: 0.82rem; color: var(--text-second);
  line-height: 2; letter-spacing: 0.02em;
}
.analysis-text p { margin-bottom: 8px; }
.analysis-text p:last-child { margin-bottom: 0; }

/* 调养建议 */
.suggest-cards { display: flex; flex-direction: column; gap: 10px; }
.suggest-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
}
.suggest-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.suggest-emoji { font-size: 1.2rem; flex-shrink: 0; }
.suggest-title { font-size: 0.9rem; font-weight: 700; color: var(--green-dim); }
.suggest-desc { font-size: 0.76rem; color: var(--text-second); line-height: 1.7; }

/* 33消费券 */
.coupon-section {
  margin-top: 24px;
}
.coupon-content {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.coupon-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 14px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}
.coupon-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
  margin-top: 1px;
}
.coupon-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.coupon-label {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--green-dim);
}
.coupon-value {
  font-size: 0.76rem;
  color: var(--text-second);
  line-height: 1.7;
}

/* 注意事项 */
.warn-card {
  background: rgba(34,197,94,0.05);
  border: 1px solid rgba(34,197,94,0.15);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex; gap: 10px; align-items: flex-start;
}
.warn-icon { font-size: 1rem; flex-shrink: 0; margin-top: 1px; }
.warn-text { font-size: 0.76rem; color: var(--text-second); line-height: 1.7; }

/* Report Footer */
.report-footer { padding: 0 20px 32px; display: flex; flex-direction: column; gap: 12px; }
.report-disclaimer {
  font-size: 0.68rem; color: var(--text-dim);
  text-align: center; letter-spacing: 0.03em; opacity: 0.7;
}

/* ===================================================
   TOAST
   =================================================== */
.toast {
  position: fixed; bottom: 80px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  /* 旧浏览器先显示纯色，modern浏览器blur覆盖 */
  background: rgba(26,46,26,0.92);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  color: #ffffff;
  font-size: 0.82rem;
  padding: 10px 20px;
  border-radius: 24px;
  opacity: 0; pointer-events: none;
  transition: all 0.3s ease;
  white-space: nowrap;
  box-shadow: 0 8px 32px rgba(0,0,0,0.15);
  z-index: 999;
}
.toast.show {
  opacity: 1; transform: translateX(-50%) translateY(0);
}

/* ===================================================
   SCROLLBAR
   =================================================== */
::-webkit-scrollbar { width: 0; }

/* ===================================================
   MEDIA QUERIES
   =================================================== */
@media (min-width: 480px) {
  .app {
    box-shadow: 0 0 60px rgba(34,197,94,0.05);
    border-left: 1px solid rgba(34,197,94,0.08);
    border-right: 1px solid rgba(34,197,94,0.08);
  }
  .hero-title .line1 { font-size: 2rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ===================================================
   用户信息对话框
   =================================================== */
.dialog-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
  animation: fadeIn 0.3s ease;
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.dialog-content {
  background: #ffffff;
  border-radius: 20px;
  width: 100%;
  max-width: 400px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  animation: slideUp 0.3s ease;
}
@keyframes slideUp {
  from { transform: translateY(30px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.dialog-header {
  padding: 20px 20px 10px;
  text-align: center;
  border-bottom: 1px solid #f0f0f0;
}
.dialog-header h3 {
  margin: 0 0 6px;
  font-size: 1.1rem;
  color: #333;
  font-weight: 600;
}
.dialog-hint {
  font-size: 0.8rem;
  color: #999;
  margin: 0;
}
.dialog-form {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.form-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.form-row label {
  font-size: 0.85rem;
  color: #666;
  font-weight: 500;
}
.form-row input,
.form-row select,
.form-row textarea {
  padding: 10px 12px;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  font-size: 0.9rem;
  color: #333;
  background: #fafafa;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
  outline: none;
  border-color: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.1);
  background: #fff;
}
.form-row textarea {
  resize: none;
  height: 60px;
}
.dialog-actions {
  padding: 12px 20px 20px;
  display: flex;
  gap: 10px;
}
.dialog-actions .btn-secondary,
.dialog-actions .btn-primary {
  flex: 1;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}
.dialog-actions .btn-secondary {
  background: #f5f5f5;
  color: #666;
}
.dialog-actions .btn-primary {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #fff;
}

/* 用药建议模块 */
.medication-content {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}
.medication-text {
  font-size: 0.9rem;
  color: var(--text-primary);
  line-height: 1.8;
}
.medication-text p {
  margin: 0 0 8px;
}
.medication-text p:last-child {
  margin-bottom: 0;
}
.medication-hint {
  font-size: 0.85rem;
  color: #999;
  text-align: center;
  padding: 12px;
}

/* ===================================================
   相机预览页面
   =================================================== */
#page-camera {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh; /* 动态视口高度，适配移动端 */
  background: #000;
  z-index: 2000;
  display: none; /* 默认隐藏 */
  flex-direction: column;
  overflow: hidden;
}
/* 只有添加 active class 时才显示 */
#page-camera.active {
  display: flex;
}

.camera-container {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  background: #000;
}

/* 顶部导航 */
.camera-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
}

.camera-header .back-btn {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  cursor: pointer;
}

.camera-header .page-title {
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.switch-camera-btn {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  cursor: pointer;
}

.switch-camera-btn:active {
  background: rgba(255, 255, 255, 0.3);
}

/* 相机预览区 */
.camera-preview {
  flex: 1;
  position: relative;
  overflow: hidden;
  background: #000;
}

.camera-preview video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1); /* 镜像翻转 */
}

/* 边缘遮罩 - 突出舌头区域 */
.camera-mask {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  background: 
    radial-gradient(ellipse 70% 50% at 50% 45%, transparent 40%, rgba(0,0,0,0.5) 100%);
}

/* 舌头轮廓引导 - 下移1/4位置 */
.camera-tongue-guide {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -25%);
  width: 45%;
  max-width: 200px;
  height: auto;
  pointer-events: none;
  z-index: 5;
  filter: drop-shadow(0 0 8px rgba(34, 197, 94, 0.4));
}

/* 拍摄提示 */
.camera-tips {
  padding: 12px 16px;
  text-align: center;
  z-index: 10;
  background: linear-gradient(to top, rgba(0,0,0,0.6) 0%, transparent 100%);
}

.camera-tips p {
  display: inline-block;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
}

/* 相机底部控制区 */
.camera-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
  padding-bottom: calc(20px + env(safe-area-inset-bottom, 0));
  background: rgba(0, 0, 0, 0.8);
  gap: 20px;
}

/* 拍摄按钮 */
.camera-actions {
  display: flex;
  justify-content: center;
  z-index: 10;
}

.capture-btn {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  border: 4px solid #fff;
  padding: 4px;
  cursor: pointer;
  transition: all 0.2s;
}

.capture-btn:active {
  transform: scale(0.95);
  background: rgba(255, 255, 255, 0.5);
}

.capture-btn-inner {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: #fff;
  transition: all 0.2s;
}

.capture-btn:active .capture-btn-inner {
  background: #f0f0f0;
  transform: scale(0.9);
}

/* 相册选择链接 */
.camera-gallery-link {
  text-align: center;
  z-index: 10;
}

.btn-text {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.9rem;
  cursor: pointer;
  padding: 8px 16px;
}



