/* ===================================================
   中医舌诊养生 - 明亮健康风移动端样式
   =================================================== */

/* ---- 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);
}

/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

/* ---- 禁止右键/长按弹窗/文本选择 ---- */
* {
  -webkit-touch-callout: none;   /* iOS 禁止长按菜单 */
  -webkit-user-select: none;     /* Safari/Chrome */
  -moz-user-select: none;        /* Firefox */
  -ms-user-select: none;         /* IE/Edge */
  user-select: none;
}
/* 输入框恢复选择功能 */
input, textarea, [contenteditable="true"] {
  -webkit-user-select: text;
  user-select: text;
}
/* 图片禁止长按保存 */
img {
  -webkit-touch-callout: none;
  pointer-events: none;
}
/* 按钮和链接恢复pointer-events */
button, a, label, .btn-upload, .btn-camera, .btn-gallery,
.btn-primary, .btn-secondary, .share-btn, #upload-card,
.header-btn, .nav-btn, #logout-btn, #nav-history-btn {
  pointer-events: auto;
}

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; }

/* ===================================================
   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);
}

/* 背景装饰 */
.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-top: 0;
  padding-bottom: calc(env(safe-area-inset-bottom, 20px) + 20px);
}
.page.active { 
  display: block; 
}

/* ===================================================
   HOME PAGE
   =================================================== */

/* Header */
.home-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px 0;
  flex-wrap: wrap;
  gap: 8px;
}

.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: 16px 20px 12px;
  min-height: auto;
}

.hero-deco { position: absolute; right: 0; top: 0; }

.deco-ring {
  position: absolute; border-radius: 50%;
  border: 1px solid rgba(34,197,94,0.08);
  transform: translate(-50%, -50%);
}
.deco-ring-1 { width: 160px; height: 160px; top: 80px; left: 80px; opacity: 0.8; }
.deco-ring-2 { width: 200px; height: 200px; top: 80px; left: 80px; opacity: 0.6; }
.deco-ring-3 { width: 240px; height: 240px; top: 80px; left: 80px; opacity: 0.4; }

.hero-lotus { position: relative; z-index: 1; }

@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: 150px; }
.hero-title { margin-bottom: 12px; }
.hero-title .line1 {
  display: block;
  font-size: 1.9rem; 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.9rem; color: var(--text-dim);
  letter-spacing: 0.08em; margin-top: 4px;
  font-weight: 400;
}
.hero-desc {
  font-size: 0.8rem; color: var(--text-second);
  line-height: 1.8; letter-spacing: 0.02em;
}

/* Feature Cards — 2×2 网格 */
.feature-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 0 20px 20px;
}

.feature-card {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}
.feature-card:active { transform: scale(0.97); }

.feature-icon { font-size: 1.3rem; }
.feature-info { display: flex; flex-direction: column; }
.feature-name { font-size: 0.82rem; font-weight: 600; color: var(--text-primary); }
.feature-desc { font-size: 0.68rem; 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-card::before {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 0% 0%, rgba(34,197,94,0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 100% 100%, rgba(245,158,11,0.04) 0%, transparent 50%);
  pointer-events: none;
}

.upload-card-inner {
  padding: 32px 24px;
  display: flex; flex-direction: column; align-items: center;
  text-align: center; gap: 8px; position: relative;
}

.upload-icon-wrap {
  position: relative; margin-bottom: 10px;
}
.upload-icon {
  position: relative;
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.upload-katong-img,
.tongue-svg-icon {
  width: 72px;
  height: 86px;
  object-fit: contain;
  border-radius: 50%;
  pointer-events: none;
}
.tongue-svg-icon {
  animation: tongueFloat 3s ease-in-out infinite;
  filter: drop-shadow(0 2px 8px rgba(224,122,111,0.3));
}
@keyframes tongueFloat {
  0%,100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}
.upload-pulse {
  position: absolute; inset: -20px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(34,197,94,0.08) 0%, transparent 70%);
}

.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);
}
.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: none;
  align-items: center; justify-content: center;
  min-height: 100vh;
  background: linear-gradient(180deg, var(--bg-warm) 0%, var(--green-bg) 100%);
  /* 确保内容紧贴顶部开始居中，无空白 */
  padding-top: 0 !important;
}
#page-analyzing.active {
  display: flex;
}
.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;
}

.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: 3px;
  background: linear-gradient(90deg, transparent, rgba(34,197,94,0.9), transparent);
  box-shadow: 0 0 15px rgba(34,197,94,0.6);
  animation: scanMove 2s ease-in-out infinite;
  top: 0;
}
@keyframes scanMove {
  0%   { top: 0%; opacity: 0; }
  10%  { opacity: 1; }
  90%  { opacity: 1; }
  100% { top: 100%; 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.25);
  top: 50%; left: 50%; transform: translate(-50%,-50%);
  animation: scanRingPulse 2s ease-out infinite;
}
.scan-ring-1 { width: 240px; height: 240px; animation-delay: 0s; }
.scan-ring-2 { width: 270px; height: 270px; animation-delay: 0.6s; }

@keyframes scanRingPulse {
  0%  { transform: translate(-50%,-50%) scale(0.9); opacity: 0.5; }
  50% { transform: translate(-50%,-50%) scale(1.05); opacity: 0.2; }
  100%{ transform: translate(-50%,-50%) scale(1.15); 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;
  animation: textCycle 1.5s ease-in-out infinite alternate;
}
@keyframes textCycle { from { opacity: 0.5; } 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; }

/* ============================================
   身体调理板块
   ============================================ */
.body-treatment-section { margin-top: 16px; }
.treatment-list { display: flex; flex-direction: column; gap: 12px; }
.treatment-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
}
.treatment-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.treatment-num {
  width: 24px;
  height: 24px;
  background: linear-gradient(135deg, var(--green) 0%, var(--green-dim) 100%);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}
.treatment-name {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--green-dim);
}
.treatment-desc {
  font-size: 0.75rem;
  color: var(--text-second);
  line-height: 1.7;
  margin-bottom: 8px;
}
.treatment-cycle {
  font-size: 0.72rem;
  color: var(--green);
  font-weight: 600;
  padding: 4px 10px;
  background: rgba(34,197,94,0.08);
  border-radius: var(--radius-sm);
  display: inline-block;
}

/* ============================================
   健康食品板块
   ============================================ */
.health-foods-section { margin-top: 16px; }
.foods-list { display: flex; flex-direction: column; gap: 12px; }
.food-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
}
.food-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--green-dim);
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px dashed var(--border);
}
.food-section { margin-bottom: 10px; }
.food-section:last-child { margin-bottom: 0; }
.food-section-title {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 6px;
}
.food-item {
  font-size: 0.74rem;
  color: var(--text-second);
  line-height: 1.6;
  padding-left: 12px;
  position: relative;
}
.food-item::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--green);
}

/* 注意事项 */
.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; }
}

/* ===================================================
   v2.0 NEW COMPONENTS
   =================================================== */

/* ---- Header 用户按钮 ---- */
.header-btn {
  display: flex; align-items: center; gap: 6px;
  font-size: 0.78rem; font-weight: 600;
  color: var(--green-dim);
  background: var(--green-bg);
  border: 1px solid rgba(34,197,94,0.15);
  border-radius: 20px;
  padding: 6px 14px;
  transition: var(--transition);
}
.header-btn:active { transform: scale(0.95); background: #dcfce7; }
.header-user { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.header-phone-wrap { display: flex; flex-direction: column; align-items: flex-end; }
.header-phone {
  font-size: 0.72rem; font-weight: 600;
  color: var(--text-second);
  letter-spacing: 0.02em;
}
.nav-btn { 
  font-size: 0.72rem; 
  padding: 6px 10px; 
  /* 确保整个按钮区域都可点击 */
  cursor: pointer;
}
/* 确保nav-btn内的所有元素都不阻挡事件 */
#nav-history-btn svg,
#nav-history-btn span {
  pointer-events: none;
}

/* ---- Report Header 多按钮 ---- */
.report-header-actions { display: flex; gap: 8px; }
.icon-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);
}
.icon-btn:active { transform: scale(0.93); background: #dcfce7; }

/* ---- 压缩提示 ---- */
.upload-auto-compress {
  font-size: 0.72rem; color: var(--green-dim);
  background: rgba(34,197,94,0.08);
  padding: 4px 12px; border-radius: 12px;
  margin-top: 2px;
}
.compress-info {
  display: inline-block;
  font-size: 0.74rem; color: var(--green-dim);
  background: rgba(34,197,94,0.08);
  padding: 4px 14px; border-radius: 12px;
  margin-top: 8px;
}

/* ===================================================
   AUTH MODAL (登录/注册弹窗)
   =================================================== */
.modal-overlay {
  position: fixed; inset: 0; z-index: 9998;
  background: rgba(0,0,0,0.45);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center; justify-content: center;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.modal-overlay.active { display: flex; opacity: 1; }

.modal-content {
  width: 100%; max-width: 380px;
  background: var(--bg-white);
  border-radius: var(--radius-xl);
  padding: 28px 24px 24px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
  animation: modalIn 0.3s ease-out;
}
@keyframes modalIn {
  from { transform: translateY(20px) scale(0.97); opacity: 0; }
  to   { transform: translateY(0) scale(1); opacity: 1; }
}

.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
}
.modal-title {
  font-size: 1.2rem; font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.04em;
}
.modal-close {
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-card2);
  border-radius: 50%;
  color: var(--text-dim);
  transition: var(--transition);
}
.modal-close:active { transform: scale(0.9); background: rgba(34,197,94,0.15); }

/* Auth Tabs */
.auth-tabs {
  display: flex; gap: 0;
  background: var(--bg-card2);
  border-radius: var(--radius-sm);
  padding: 3px;
  margin-bottom: 20px;
}
.auth-tab {
  flex: 1; padding: 10px;
  font-size: 0.88rem; font-weight: 600;
  color: var(--text-dim);
  background: transparent;
  border-radius: 10px;
  transition: var(--transition);
  text-align: center;
}
.auth-tab.active {
  color: var(--green-dim);
  background: var(--bg-white);
  box-shadow: 0 2px 8px rgba(34,197,94,0.08);
}

/* Auth Form Panels */
.auth-form-panel { display: none; }
.auth-form-panel.active { display: block; }

.auth-field { margin-bottom: 14px; }
.auth-field label {
  display: block;
  font-size: 0.78rem; font-weight: 600;
  color: var(--text-second);
  margin-bottom: 6px;
}
.auth-field input {
  width: 100%;
  padding: 12px 14px;
  font-size: 0.88rem;
  color: var(--text-primary);
  background: var(--bg-card2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  transition: var(--transition);
}
.auth-field input:focus {
  border-color: rgba(34,197,94,0.4);
  background: var(--bg-white);
  box-shadow: 0 0 0 3px rgba(34,197,94,0.08);
}
.auth-field input::placeholder { color: var(--text-dim); font-size: 0.82rem; }

.auth-error {
  font-size: 0.76rem; color: #dc2626;
  margin-bottom: 10px; min-height: 18px;
}

/* Auth Benefits */
.auth-benefits {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.auth-benefits p {
  font-size: 0.74rem;
  color: var(--text-dim);
  line-height: 1.8;
}

/* ===================================================
   HISTORY PAGE (历史报告页)
   =================================================== */
.history-body {
  padding: 16px 20px;
  display: flex; flex-direction: column; gap: 10px;
  min-height: calc(100vh - 140px);
}
/* History Footer（回到首页） */
.history-footer {
  padding: 0 20px 32px;
  display: flex; flex-direction: column; gap: 12px;
}

.history-card {
  display: flex; align-items: center; gap: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: var(--transition);
}
.history-card:active { transform: scale(0.98); background: var(--green-bg); }

.history-thumb {
  width: 56px; height: 56px; flex-shrink: 0;
  border-radius: var(--radius-sm);
  object-fit: cover;
  border: 1.5px solid rgba(34,197,94,0.15);
}

.history-info { flex: 1; }
.history-constitution {
  font-size: 0.92rem; font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
}
.history-date {
  font-size: 0.7rem; color: var(--text-dim);
  margin-bottom: 2px;
}
.history-score {
  font-size: 0.72rem; color: var(--text-second);
}
.history-score span {
  font-weight: 700; color: var(--green-dim);
}

.history-arrow {
  font-size: 1.4rem; color: var(--text-dim);
  font-weight: 300;
}

/* History Empty State */
.history-empty {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 60px 20px;
  text-align: center;
}
.empty-icon { font-size: 3rem; margin-bottom: 12px; opacity: 0.5; }
.history-empty p {
  font-size: 0.88rem; color: var(--text-dim);
  margin-bottom: 4px;
}
.empty-hint {
  font-size: 0.74rem !important;
  color: var(--text-dim) !important;
  opacity: 0.6;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ===================================================
   AUTH v3.0 新增：手机号验证码 / 到期徽章 / 到期面板
   =================================================== */

/* 验证码输入行 */
.auth-field-code .code-input-wrap {
  display: flex; gap: 8px;
}
.auth-field-code .code-input-wrap input {
  flex: 1; min-width: 0;
}
.btn-send-code {
  flex-shrink: 0;
  padding: 0 14px;
  height: 44px;
  font-size: 0.78rem; font-weight: 600;
  color: var(--green-dim);
  background: rgba(34,197,94,0.1);
  border: 1.5px solid rgba(34,197,94,0.25);
  border-radius: var(--radius-sm);
  white-space: nowrap;
  transition: var(--transition);
}
.btn-send-code:disabled {
  color: var(--text-dim);
  background: var(--bg-card2);
  border-color: var(--border);
  cursor: not-allowed;
}
.btn-send-code:not(:disabled):active {
  background: rgba(34,197,94,0.2);
  transform: scale(0.97);
}

/* auth intro */
.auth-intro {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 18px;
  padding: 12px 14px;
  background: var(--bg-card2);
  border-radius: var(--radius-sm);
}
.auth-intro-icon { font-size: 1.5rem; }
.auth-intro-text {
  font-size: 0.82rem; color: var(--text-second);
  font-weight: 500;
}

/* 到期状态徽章（header 区域） */
.expire-badge {
  display: none;
  font-size: 0.65rem; font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  margin-left: 4px;
  vertical-align: middle;
}
.expire-badge.ok {
  background: rgba(34,197,94,0.12);
  color: var(--green-dim);
  border: 1px solid rgba(34,197,94,0.25);
}
.expire-badge.warning {
  background: rgba(245,158,11,0.12);
  color: #b45309;
  border: 1px solid rgba(245,158,11,0.3);
}
.expire-badge.expired {
  background: rgba(220,38,38,0.08);
  color: #dc2626;
  border: 1px solid rgba(220,38,38,0.2);
}

/* 到期提示面板 */
.expire-notice {
  text-align: center;
  padding: 16px 0 8px;
}
.expire-icon {
  font-size: 3rem;
  margin-bottom: 12px;
  display: block;
}
.expire-title {
  font-size: 1.1rem; font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 10px;
}
.expire-desc {
  font-size: 0.82rem; color: var(--text-second);
  line-height: 1.7;
  margin-bottom: 14px;
}
.expire-wechat {
  background: var(--bg-card2);
  border: 1.5px dashed rgba(34,197,94,0.3);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-bottom: 4px;
}
.expire-wechat-label {
  font-size: 0.72rem; color: var(--text-dim);
  margin-bottom: 4px;
}
.expire-wechat-id {
  font-size: 1rem; font-weight: 700;
  color: var(--green-dim);
  letter-spacing: 0.05em;
}

/* ===================================================
   HEALTH INFO MODAL (补充健康信息弹窗)
   =================================================== */
.health-modal {
  max-width: 400px;
  padding-bottom: 8px;
}
.health-subtitle {
  font-size: 0.78rem;
  color: var(--text-dim);
  text-align: center;
  margin-bottom: 18px;
}

/* select 下拉框样式 */
.auth-field select {
  width: 100%;
  padding: 12px 14px;
  font-size: 0.88rem;
  color: var(--text-primary);
  background: var(--bg-card2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  transition: var(--transition);
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237a8a7a' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}
.auth-field select:focus {
  border-color: rgba(34,197,94,0.4);
  background-color: var(--bg-white);
  box-shadow: 0 0 0 3px rgba(34,197,94,0.08);
}

/* 弹窗底部双按钮 */
.health-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.health-actions .btn-secondary {
  flex: 1;
  padding: 13px 16px;
  text-align: center;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 600;
}
.health-actions .btn-primary {
  flex: 1.5;
  padding: 13px 16px;
  text-align: center;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 700;
}

/* 报告页个人信息区 */
.report-user-info {
  display: grid;
  grid-template-columns: auto 1fr auto 1fr;
  gap: 6px 14px;
  align-items: baseline;
  padding: 10px 0;
  margin-bottom: 6px;
  font-size: 0.76rem;
  color: var(--text-dim);
  border-bottom: 1px dashed var(--border);
}
.report-user-info .user-label {
  color: var(--text-dim);
  white-space: nowrap;
}
.report-user-info .user-value {
  color: var(--text-second);
  font-weight: 500;
}

@media (min-width: 600px) {
  .health-modal {
    max-width: 420px;
    padding: 32px 28px 12px;
  }
  .report-user-info {
    font-size: 0.82rem;
  }
}
.share-modal-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,0.5);
  -webkit-backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s ease;
}
.share-modal-overlay.active { opacity: 1; pointer-events: auto; }

.share-modal-box {
  width: 92%; max-width: 340px;
  background: #fff;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0,0,0,0.18);
  transform: translateY(20px);
  transition: transform 0.3s ease;
}
.share-modal-overlay.active .share-modal-box { transform: translateY(0); }

.share-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 20px 12px;
}
.share-modal-header h3 {
  font-size: 1.05rem; font-weight: 600; color: #1a1a2e; margin: 0;
}
.share-modal-close {
  background: none; border: none; cursor: pointer;
  color: #999; padding: 4px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.share-modal-close:hover { background: #f0f0f0; color: #333; }

.share-modal-body {
  padding: 8px 20px 16px;
  min-height: 260px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}

.share-loading {
  display: flex; flex-direction: column; align-items: center; gap: 16px;
}
.share-loading p { font-size: 0.85rem; color: #888; margin: 0; }

.share-spinner {
  width: 40px; height: 40px;
  border: 3px solid #e8e0d0; border-top-color: var(--primary);
  border-radius: 50%;
  animation: share-spin 0.8s linear infinite;
}
@keyframes share-spin { to { transform: rotate(360deg); } }

.share-qr-container {
  background: #fff;
  padding: 16px;
  border-radius: 12px;
  border: 1px solid #eee8e0;
}
.share-qr-img {
  width: 220px; height: 220px;
  display: block; border-radius: 8px;
}

.share-actions {
  display: flex; gap: 12px;
  margin-top: 20px;
}
.share-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 10px 20px;
  border-radius: 10px; border: none;
  font-size: 0.85rem; font-weight: 500;
  cursor: pointer; transition: all 0.2s;
}
.share-btn:active { transform: scale(0.96); }
.share-btn-copy {
  background: #f5f0e8; color: #6b5e50;
}
.share-btn-copy:hover { background: #ede6d8; }
.share-btn-download {
  background: var(--primary); color: #fff;
}
.share-btn-download:hover { background: var(--primary-dark); }

.share-modal-footer {
  padding: 0 20px 18px;
  text-align: center;
}
.share-modal-footer p {
  font-size: 0.78rem; color: #aaa; margin: 0;
}

/* ============================================
   舌头形状虚线引导
   ============================================ */
/* 上传卡片中的舌头引导区 */
.tongue-guide-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 10px 0 6px;
}
.tongue-guide-svg {
  width: 90px;
  height: 106px;
  filter: drop-shadow(0 0 6px rgba(74,222,128,0.3));
}
/* 舌头轮廓呼吸动画 */
.tongue-outline {
  animation: tongue-pulse 2.4s ease-in-out infinite;
  transform-origin: center;
}
.tongue-tip {
  animation: tongue-pulse 2.4s ease-in-out infinite;
}
@keyframes tongue-pulse {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}
.tongue-guide-hint {
  font-size: 0.72rem;
  color: rgba(74,222,128,0.85);
  margin: 4px 0 0;
  letter-spacing: 0.03em;
}

/* 预览页 preview-frame 中叠加的舌头引导SVG */
.preview-frame {
  position: relative;
}
.preview-frame img {
  position: relative;
  z-index: 1;
}
.preview-tongue-guide {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 55%;
  height: 70%;
  pointer-events: none;
  z-index: 10;
  filter: drop-shadow(0 0 6px rgba(74,222,128,0.5));
  opacity: 0.9;
}

/* ============================================
   相机取景页（全屏，脱离 .app 的 480px 限制）
   ============================================ */

/* 相机页面：fixed 全屏，覆盖一切 */
.camera-fullscreen {
  display: none;
  position: fixed !important;
  inset: 0;
  width: 100vw !important;
  height: 100vh !important;
  max-width: none !important;
  z-index: 9999;
  background: #000;
}
.camera-fullscreen.active {
  display: block !important;
}

.camera-viewfinder {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
}

/* 视频全屏铺满（默认后置，不镜像） */
#camera-video {
  position: absolute;
  top: 0; left: 0;
  width: 100% !important;
  height: 100% !important;
  /* contain 而非 cover：显示完整画面，不裁剪放大 */
  object-fit: contain;
  z-index: 1;
}

/* 绿色舌头轮廓引导（叠加在视频正中心） */
.camera-tongue-guide {
  position: absolute;
  /* 居中定位 */
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 5;
  pointer-events: none;

  /* 尺寸：基于视口，缩小到原来的约2/3 */
  width: min(43vmin, 226px);
  height: auto;
  aspect-ratio: 120 / 140;
  filter:
    drop-shadow(0 0 10px rgba(74,222,128,0.6))
    drop-shadow(0 0 24px rgba(74,222,128,0.25));
}
/* 前置摄像头时：视频镜像，轮廓也同步镜像 */
.camera-fullscreen.front-facing #camera-video {
  transform: scaleX(-1);
}
.camera-fullscreen.front-facing .camera-tongue-guide {
  transform: translate(-50%, -50%) scaleX(-1);
}
.camera-tongue-guide .tongue-outline {
  animation: camera-outline-pulse 2s ease-in-out infinite;
}
.camera-tongue-guide .tongue-tip {
  animation: camera-tip-pulse 1.5s ease-in-out infinite;
}
@keyframes camera-outline-pulse {
  0%, 100% { stroke-opacity: 0.55; }
  50% { stroke-opacity: 1; }
}
@keyframes camera-tip-pulse {
  0%, 100% { r: 3.5px; opacity: 0.65; }
  50% { r: 4.8px; opacity: 1; }
}

/* 拍摄提示文字 */
.camera-hint {
  position: absolute;
  top: 10vh; /* 相对屏幕定位 */
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  z-index: 6;
  pointer-events: none;
}
.hint-icon { font-size: 2rem; line-height: 1; }
.hint-text {
  font-size: 0.95rem;
  color: rgba(255,255,255,0.92);
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 7px 20px;
  border-radius: 22px;
  letter-spacing: 0.06em;
  white-space: nowrap;
  border: 1px solid rgba(74,222,128,0.3);
}

/* 底部控制栏 */
.camera-controls {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 28px 36px calc(28px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, transparent 100%);
  z-index: 10;
}

/* 相机按钮通用样式 */
.camera-btn {
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  transition: all var(--transition);
  -webkit-tap-highlight-color: transparent;
}

/* 取消按钮 */
.camera-cancel {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  color: rgba(255,255,255,0.85);
  background: rgba(255,255,255,0.12);
}
.camera-cancel:hover,
.camera-cancel:active {
  background: rgba(255,255,255,0.22);
  transform: scale(0.92);
}

/* 快门按钮（大圆形） */
.camera-shutter {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
  border: 3.5px solid rgba(255,255,255,0.88);
  position: relative;
}
.shutter-inner {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #fff;
  box-shadow:
    0 0 24px rgba(255,255,255,0.4),
    inset 0 0 10px rgba(0,0,0,0.06);
  transition: all 0.15s ease;
}
.camera-shutter:hover .shutter-inner {
  background: #f0f0f0;
}
.camera-shutter:active .shutter-inner {
  transform: scale(0.82);
  background: #e0e0e0;
  box-shadow: 0 0 30px rgba(255,255,255,0.6);
}

/* 切换摄像头按钮 */
.camera-switch {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  color: rgba(255,255,255,0.85);
  background: rgba(255,255,255,0.12);
}
.camera-switch:hover,
.camera-switch:active {
  background: rgba(255,255,255,0.22);
  transform: scale(0.92);
}

/* 拍照闪光效果 */
.camera-viewfinder .flash-overlay {
  position: absolute;
  inset: 0;
  background: #fff;
  z-index: 20;
  opacity: 0;
  pointer-events: none;
}
.camera-fullscreen.flash-active .flash-overlay {
  animation: flash-burst 0.35s ease-out forwards;
}
@keyframes flash-burst {
  0% { opacity: 0.95; }
  100% { opacity: 0; }
}

/* ===================================================
   平板适配（768px+，如联想小新 Pad 2024）
   屏幕尺寸：11寸竖屏 1200×1920（实际 CSS 像素约 800×1280）
   =================================================== */
@media (min-width: 600px) {
  /* 首页容器放宽 */
  .app {
    max-width: 560px;
  }

  /* Hero 区域更大 */
  .hero-title .line1 {
    font-size: 2.2rem;
  }

  /* 上传卡片更宽敞 */
  .upload-card-inner {
    padding: 40px 32px;
  }
  .upload-icon {
    width: 100px;
    height: 100px;
  }
  .upload-katong-img,
  .tongue-svg-icon {
    width: 90px;
    height: 106px;
  }
  .upload-title {
    font-size: 1.25rem;
  }
  .upload-hint {
    font-size: 0.88rem;
  }

  /* 特性卡片更大间距 */
  .feature-cards {
    gap: 14px;
  }
  .feature-card {
    padding: 18px 16px;
  }
  .feature-name { font-size: 0.92rem; }
  .feature-desc { font-size: 0.76rem; }

  /* 相机轮廓（平板屏幕大，但保持紧凑） */
  .camera-tongue-guide {
    width: min(36vmin, 190px);
  }
  .hint-text {
    font-size: 1.05rem;
    padding: 9px 26px;
  }

  /* 快门按钮更大 */
  .camera-shutter {
    width: 88px;
    height: 88px;
  }
  .shutter-inner {
    width: 70px;
    height: 70px;
  }
  .camera-cancel, .camera-switch {
    width: 52px;
    height: 52px;
  }

  /* 控制栏更高 */
  .camera-controls {
    padding: 32px 48px calc(32px + env(safe-area-inset-bottom));
  }

  /* 报告页优化 */
  .report-summary-card {
    padding: 24px;
  }
  .report-thumb {
    width: 100px;
    height: 100px;
  }
  .report-constitution {
    font-size: 1.5rem;
  }
  .tongue-feature-item {
    min-height: 66px;
    padding: 12px 16px;
  }
}

/* 大平板（800px+，接近完整 iPad 尺寸） */
@media (min-width: 800px) {
  .app {
    max-width: 640px;
  }
  .hero-title .line1 { font-size: 2.5rem; }

  .camera-tongue-guide {
    width: min(50vmin, 420px);
  }

  /* 登录弹窗居中且更宽 */
  .modal-content {
    max-width: 420px;
    padding: 32px 28px;
  }
}
