﻿/* ===================================================
   智养中医AI - 科技中医风 UI v4.0
   配色：青蓝科技 + 自然生命绿 + 深空黑
   适配：联想小新2024平板 11寸 1920x1200 竖屏
   =================================================== */

/* ---- CSS Variables ---- */
:root {
  /* 青蓝科技主色系 */
  --primary:        #00D4FF;      /* 科技青 */
  --primary-dark:    #00A8E0;      /* 深海青 */
  --primary-light:   #66E5FF;      /* 浅青 */
  --primary-glow:    rgba(0,212,255,0.3);
  
  /* 能量绿（健康/生命） */
  --accent:          #00FF88;      /* 能量绿 */
  --accent-dark:     #00CC6A;
  --accent-light:    #66FFB3;
  --accent-glow:     rgba(0,255,136,0.3);
  
  /* 中性色 */
  --gold:            #00B4D8;      /* 青色金（非传统金色） */
  --gold-light:      #48CAE4;
  
  /* 背景色系（深空科技风） */
  --bg-dark:        #0A0E1A;      /* 深空黑 */
  --bg-deep:        #0F1629;      /* 深蓝黑 */
  --bg-card:        rgba(15,22,41,0.85);  /* 玻璃卡片 */
  --bg-card-light:  rgba(255,255,255,0.06);
  
  /* 文字色系 */
  --text-primary:   #FFFFFF;
  --text-second:   #B4C6E0;
  --text-dim:      #6B7FA3;
  --text-gold:     #48CAE4;
  
  /* 边框与光效 */
  --border:         rgba(0,212,255,0.15);
  --border-md:      rgba(0,212,255,0.25);
  --border-glow:    rgba(0,212,255,0.4);
  
  /* 阴影 */
  --shadow-sm:      0 2px 12px rgba(0,0,0,0.3);
  --shadow-md:      0 4px 24px rgba(0,0,0,0.4);
  --shadow-lg:      0 8px 40px rgba(0,0,0,0.5);
  --shadow-glow:    0 4px 30px var(--primary-glow);
  --shadow-card:    0 8px 32px rgba(0,212,255,0.08);
  
  /* 圆角 */
  --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;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}
input, textarea, [contenteditable="true"] {
  -webkit-user-select: text;
  user-select: text;
}
img {
  -webkit-touch-callout: none;
  pointer-events: none;
}
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,
#auth-login-btn {
  pointer-events: auto;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

body {
  font-family: -apple-system, "PingFang SC", "Noto Sans SC", "Source Han Sans SC", "Microsoft YaHei", sans-serif;
  background: var(--bg-dark);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ---- Utility ---- */
.hidden { display: none !important; }

/* ===================================================
   科技背景动效
   =================================================== */
.tech-bg {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background: linear-gradient(135deg, var(--bg-dark) 0%, var(--bg-deep) 50%, #0D1B2A 100%);
}

/* 数字流光粒子 */
.tech-particle {
  position: absolute;
  width: 2px;
  height: 2px;
  background: var(--primary);
  border-radius: 50%;
  opacity: 0.6;
  animation: particleFloat 8s linear infinite;
}
.tech-particle:nth-child(1) { left: 10%; animation-delay: 0s; animation-duration: 12s; }
.tech-particle:nth-child(2) { left: 20%; animation-delay: 2s; animation-duration: 10s; }
.tech-particle:nth-child(3) { left: 35%; animation-delay: 4s; animation-duration: 14s; }
.tech-particle:nth-child(4) { left: 50%; animation-delay: 1s; animation-duration: 11s; }
.tech-particle:nth-child(5) { left: 65%; animation-delay: 3s; animation-duration: 13s; }
.tech-particle:nth-child(6) { left: 80%; animation-delay: 5s; animation-duration: 9s; }
.tech-particle:nth-child(7) { left: 90%; animation-delay: 2.5s; animation-duration: 15s; }

@keyframes particleFloat {
  0% { transform: translateY(100vh) scale(0); opacity: 0; }
  10% { opacity: 0.8; }
  90% { opacity: 0.8; }
  100% { transform: translateY(-100px) scale(1); opacity: 0; }
}

/* 青色光晕 */
.tech-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.15;
}
.tech-glow-1 {
  width: 400px; height: 400px;
  top: -100px; right: -100px;
  background: radial-gradient(circle, var(--primary) 0%, transparent 70%);
  animation: glowPulse 8s ease-in-out infinite;
}
.tech-glow-2 {
  width: 300px; height: 300px;
  bottom: 200px; left: -80px;
  background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
  animation: glowPulse 10s ease-in-out infinite reverse;
}

@keyframes glowPulse {
  0%,100% { transform: scale(1); opacity: 0.12; }
  50% { transform: scale(1.15); opacity: 0.2; }
}

/* 网格线背景 */
.tech-grid {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image: 
    linear-gradient(rgba(0,212,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,212,255,0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  animation: gridMove 20s linear infinite;
}
@keyframes gridMove {
  0% { transform: perspective(500px) rotateX(60deg) translateY(0); }
  100% { transform: perspective(500px) rotateX(60deg) translateY(60px); }
}

/* ===================================================
   APP SHELL
   =================================================== */
.app {
  position: relative;
  min-height: 100vh;
  max-width: 480px;
  margin: 0 auto;
  background: transparent;
  z-index: 1;
}

/* 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: 20px 24px 0;
  flex-wrap: wrap;
  gap: 12px;
}

.header-brand { display: flex; align-items: center; gap: 12px; }

.brand-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(0,212,255,0.15), rgba(0,255,136,0.1));
  border: 1px solid var(--border);
  box-shadow: 0 4px 20px var(--primary-glow);
  position: relative;
  overflow: hidden;
}
.brand-icon::before {
  content: '';
  position: absolute;
  top: -50%; left: -50%;
  width: 200%; height: 200%;
  background: linear-gradient(45deg, transparent 40%, rgba(0,212,255,0.1) 50%, transparent 60%);
  animation: iconShine 3s ease-in-out infinite;
}
@keyframes iconShine {
  0%,100% { transform: translateX(-100%) rotate(45deg); }
  50% { transform: translateX(100%) rotate(45deg); }
}
.brand-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
  position: relative;
  z-index: 1;
}

.brand-text { display: flex; flex-direction: column; }
.brand-name {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.05em;
  text-shadow: 0 0 20px var(--primary-glow);
}
.brand-tagline {
  font-size: 0.62rem;
  color: var(--primary);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-weight: 500;
}

.header-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  color: var(--accent);
  background: rgba(0,255,136,0.08);
  border: 1px solid rgba(0,255,136,0.2);
  border-radius: 20px;
  padding: 5px 12px;
}
.badge-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse { 0%,100%{opacity:1;} 50%{opacity:0.5;} }

/* Hero Section */
.hero-section {
  position: relative;
  padding: 28px 24px 20px;
}

.hero-inner {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.hero-visual {
  width: 100px;
  height: 100px;
  flex-shrink: 0;
  position: relative;
}

.hero-circle {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(0,212,255,0.2), rgba(0,255,136,0.15));
  border: 1px solid var(--border);
  animation: heroCirclePulse 4s ease-in-out infinite;
}
.hero-circle::before {
  content: '';
  position: absolute;
  top: -4px; right: -4px; bottom: -4px; left: -4px;
  border-radius: 50%;
  border: 1px dashed rgba(0,212,255,0.3);
  animation: heroRotate 20s linear infinite;
}

@keyframes heroCirclePulse {
  0%,100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}
@keyframes heroRotate { to { transform: rotate(360deg); } }

.hero-icon-inner {
  position: absolute;
  top: 8px; right: 8px; bottom: 8px; left: 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--bg-deep), var(--bg-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-glow);
  overflow: hidden;
}
.hero-icon-inner::before {
  content: '舌';
  font-size: 2.2rem;
  color: var(--primary);
  font-family: serif;
  font-weight: 300;
  text-shadow: 0 0 20px var(--primary-glow);
}

.hero-text { flex: 1; }
.hero-title { margin-bottom: 12px; }

.hero-title .line1 {
  display: block;
  font-size: 1.75rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 0.02em;
  line-height: 1.3;
}

.hero-title .line2 {
  display: block;
  font-size: 0.82rem;
  color: var(--accent);
  letter-spacing: 0.15em;
  margin-top: 6px;
  font-weight: 500;
}

.hero-desc {
  font-size: 0.78rem;
  color: var(--text-second);
  line-height: 1.8;
  letter-spacing: 0.01em;
}

/* Feature Cards */
.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;
  backdrop-filter: blur(10px);
  transition: var(--transition);
}
.feature-card:active { transform: scale(0.97); border-color: var(--border-md); }

.feature-icon {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  background: linear-gradient(135deg, rgba(0,212,255,0.15), rgba(0,255,136,0.1));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.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, rgba(15,22,41,0.9), rgba(10,14,26,0.95));
  border: 1.5px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  backdrop-filter: blur(20px);
  box-shadow: 
    var(--shadow-card),
    0 0 40px rgba(0,212,255,0.05),
    inset 0 1px 0 rgba(255,255,255,0.05);
  transition: var(--transition);
}
.upload-card:active { transform: scale(0.99); }

/* 渐变边框光效 */
.upload-card::before {
  content: '';
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  background:
    radial-gradient(ellipse at 0% 0%, rgba(0,212,255,0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 100% 100%, rgba(0,255,136,0.06) 0%, transparent 50%);
  pointer-events: none;
}

/* 扫描线动效 */
.upload-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
  animation: scanLine 3s ease-in-out infinite;
  opacity: 0.5;
}
@keyframes scanLine {
  0%,100% { top: 0; opacity: 0; }
  50% { opacity: 0.6; }
  100% { top: 100%; opacity: 0; }
}

.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: 90px;
  height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.upload-katong-img,
.tongue-svg-icon {
  width: 80px;
  height: 96px;
  object-fit: contain;
  border-radius: 50%;
  pointer-events: none;
  filter: drop-shadow(0 0 15px var(--primary-glow));
}
.tongue-svg-icon {
  animation: tongueFloat 3s ease-in-out infinite;
}
@keyframes tongueFloat {
  0%,100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
.upload-pulse {
  position: absolute;
  top: -20px; right: -20px; bottom: -20px; left: -20px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0,212,255,0.1) 0%, transparent 70%);
  animation: uploadPulse 2s ease-in-out infinite;
}
@keyframes uploadPulse {
  0%,100% { transform: scale(1); opacity: 0.5; }
  50% { transform: scale(1.1); opacity: 0.8; }
}

.upload-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.02em;
}
.upload-hint {
  font-size: 0.76rem;
  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: 14px 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, var(--primary-dark), var(--primary));
  color: #000;
  box-shadow: 0 4px 20px var(--primary-glow);
  border: none;
}
.btn-camera:active { transform: scale(0.96); box-shadow: 0 2px 10px var(--primary-glow); }

.btn-gallery {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border-md);
  color: var(--text-primary);
}
.btn-gallery:active { transform: scale(0.96); background: rgba(255,255,255,0.08); }

/* Guide Section */
.guide-section { padding: 0 20px 24px; }

.guide-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 0.08em;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.guide-title::before {
  content: '';
  width: 3px;
  height: 16px;
  background: linear-gradient(180deg, var(--primary), var(--accent));
  border-radius: 2px;
}

.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-sm);
  padding: 14px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  backdrop-filter: blur(10px);
}
.guide-num {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #000;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.guide-item p {
  font-size: 0.74rem;
  color: var(--text-second);
  line-height: 1.5;
}

/* Disclaimer */
.disclaimer {
  padding: 0 20px 32px;
  text-align: center;
}
.disclaimer p {
  font-size: 0.68rem;
  color: var(--text-dim);
  letter-spacing: 0.03em;
  opacity: 0.6;
}

/* ===================================================
   PREVIEW PAGE
   =================================================== */
.preview-header, .report-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: rgba(15,22,41,0.8);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.back-btn, .share-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--primary);
  transition: var(--transition);
}
.back-btn:active, .share-btn:active { 
  transform: scale(0.93); 
  background: rgba(0,212,255,0.1);
  border-color: var(--border-md);
}

.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), 0 0 40px var(--primary-glow);
  border: 2px solid var(--border);
}
.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(--primary);
  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);
  backdrop-filter: blur(10px);
}
.q-icon {
  width: 22px;
  height: 22px;
  background: rgba(0,212,255,0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  color: var(--primary);
  flex-shrink: 0;
}
.q-status {
  margin-left: auto;
  font-size: 0.73rem;
  color: var(--accent);
}

.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, var(--primary-dark), var(--primary));
  color: #000;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 20px var(--primary-glow);
  border: none;
  transition: var(--transition);
}
.btn-primary:active { 
  transform: scale(0.97); 
  box-shadow: 0 2px 10px var(--primary-glow);
}
.btn-primary.full-width { width: 100%; }

.btn-secondary {
  flex: 1;
  padding: 14px 20px;
  background: var(--bg-card);
  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: rgba(0,212,255,0.08);
  border-color: var(--border-md);
}

/* ===================================================
   ANALYZING PAGE
   =================================================== */
#page-analyzing {
  display: none;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(180deg, var(--bg-dark) 0%, var(--bg-deep) 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(0,212,255,0.3);
  box-shadow: 0 0 40px var(--primary-glow);
}

.scan-overlay {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  border-radius: 50%;
  overflow: hidden;
}
.scan-line {
  position: absolute;
  left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--primary), var(--accent), transparent);
  box-shadow: 0 0 20px var(--primary);
  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;
  top: 0; right: 0; bottom: 0; left: 0;
  background-image:
    repeating-linear-gradient(0deg, transparent, transparent 19px, rgba(0,212,255,0.04) 20px),
    repeating-linear-gradient(90deg, transparent, transparent 19px, rgba(0,212,255,0.04) 20px);
}

.scan-ring {
  position: absolute;
  border-radius: 50%;
  border: 2px solid rgba(0,212,255,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, var(--text-primary), var(--primary));
  -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);
  backdrop-filter: blur(10px);
}
.step-item.active {
  border-color: rgba(0,212,255,0.3);
  color: var(--text-primary);
  background: rgba(0,212,255,0.08);
}
.step-item.done {
  border-color: rgba(0,255,136,0.2);
  color: var(--accent);
  background: rgba(0,255,136,0.05);
}

.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(--primary);
  box-shadow: 0 0 10px var(--primary);
  animation: dotPulse 1s ease-in-out infinite;
}
.step-item.done .step-dot {
  background: var(--accent);
  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, rgba(0,212,255,0.1), rgba(0,255,136,0.05));
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 20px;
  display: flex;
  gap: 16px;
  align-items: center;
  box-shadow: var(--shadow-card), 0 0 30px rgba(0,212,255,0.05);
  backdrop-filter: blur(20px);
  animation: cardSlideIn 0.6s ease-out both;
}
@keyframes cardSlideIn {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.report-thumb {
  width: 80px;
  height: 80px;
  flex-shrink: 0;
  border-radius: var(--radius-md);
  object-fit: cover;
  border: 2px solid var(--border);
  box-shadow: var(--shadow-glow);
}
.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, var(--primary), var(--accent));
  -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(0,212,255,0.1);
  border-radius: 3px;
  overflow: hidden;
}
.report-score-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 3px;
  transition: width 1s ease-out;
}
.report-score-text {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--primary);
  width: 40px;
  text-align: right;
}

/* 报告区块标题 */
.report-section-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.1em;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  position: relative;
}
.report-section-title::before {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 40px;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 1px;
}
.section-icon {
  font-size: 1.1rem;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(0,212,255,0.15), rgba(0,255,136,0.1));
  border-radius: 8px;
}

/* 舌象特征 */
.tongue-features {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  backdrop-filter: blur(10px);
  animation: sectionFadeIn 0.5s ease-out 0.1s both;
}
@keyframes sectionFadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.tongue-feature-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.tongue-feature-item {
  background: rgba(255,255,255,0.03);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  border: 1px solid rgba(0,212,255,0.08);
  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 {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -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;
  backdrop-filter: blur(10px);
}
.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(0,212,255,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, var(--primary), var(--accent)); }
.health-bar-fill.fair { background: linear-gradient(90deg, #F59E0B, #FBBF24); }
.health-bar-fill.poor { background: linear-gradient(90deg, #EF4444, #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;
  backdrop-filter: blur(10px);
}
.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;
  backdrop-filter: blur(10px);
}
.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(--primary); }
.suggest-desc { font-size: 0.76rem; color: var(--text-second); line-height: 1.7; }

/* 处方学习 */
.prescription-section {
  margin: 0;
}
.prescription-card {
  background: linear-gradient(145deg, rgba(0,212,255,0.08), rgba(0,255,136,0.04));
  border-radius: var(--radius-lg);
  padding: 18px 16px;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border);
  backdrop-filter: blur(10px);
}
.prescription-name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px dashed var(--border-md);
}
.prescription-block { margin-bottom: 14px; }
.prescription-block:last-child { margin-bottom: 0; }
.prescription-label {
  font-size: 0.8rem;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 6px;
}
.prescription-content {
  font-size: 0.82rem;
  color: var(--text-second);
  line-height: 1.8;
}

/* 注意事项 */
.warn-card {
  background: rgba(0,255,136,0.05);
  border: 1px solid rgba(0,255,136,0.15);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  backdrop-filter: blur(10px);
}
.warn-icon { font-size: 1rem; flex-shrink: 0; }
.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.6;
}

/* ===================================================
   TOAST
   =================================================== */
.toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(10,14,26,0.92);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  color: var(--text-primary);
  font-size: 0.82rem;
  padding: 10px 20px;
  border-radius: 24px;
  border: 1px solid var(--border);
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s ease;
  white-space: nowrap;
  box-shadow: var(--shadow-lg);
  z-index: 9999;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ===================================================
   SCROLLBAR
   =================================================== */
::-webkit-scrollbar { width: 0; }

/* ===================================================
   v3.0 报告增强样式
   =================================================== */

/* 兼体质显示 */
.constitution-secondary {
  font-size: 0.78rem;
  color: var(--gold);
  font-weight: 600;
  margin-left: 8px;
  opacity: 0.85;
}

/* 疾病风险预测矩阵 */
.risk-matrix-section { margin-top: 4px; }
.risk-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.risk-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 14px;
  border-radius: var(--radius-md);
  font-size: 0.76rem;
  font-weight: 600;
  border: 1px solid transparent;
  transition: var(--transition);
  backdrop-filter: blur(10px);
}
.risk-icon { font-size: 0.95rem; }
.risk-name { color: var(--text-primary); white-space: nowrap; }
.risk-level {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  letter-spacing: 0.02em;
}

/* 风险等级配色 - 科技风 */
.risk-normal {
  background: linear-gradient(135deg, rgba(0,255,136,0.1), rgba(0,212,255,0.05));
  border-color: rgba(0,255,136,0.2);
}
.risk-normal .risk-level { background: var(--accent); color: #000; }

.risk-low {
  background: linear-gradient(135deg, rgba(0,212,255,0.1), rgba(72,202,228,0.05));
  border-color: rgba(0,212,255,0.2);
}
.risk-low .risk-level { background: var(--primary); color: #000; }

.risk-medium {
  background: linear-gradient(135deg, rgba(245,158,11,0.1), rgba(251,191,36,0.05));
  border-color: rgba(245,158,11,0.2);
}
.risk-medium .risk-level { background: #F59E0B; color: #000; }

.risk-high {
  background: linear-gradient(135deg, rgba(239,68,68,0.1), rgba(248,113,113,0.05));
  border-color: rgba(239,68,68,0.2);
}
.risk-high .risk-level { 
  background: #EF4444; 
  color: #fff; 
  animation: riskPulse 2s ease-in-out infinite;
}
@keyframes riskPulse {
  0%,100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.85; transform: scale(1.05); }
}

/* 亚健康预警信号 */
.subhealth-section { margin-top: 4px; }
.subhealth-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px 16px;
  background: linear-gradient(145deg, rgba(245,158,11,0.05), rgba(0,212,255,0.03));
  border: 1.5px dashed rgba(245,158,11,0.2);
  border-radius: var(--radius-lg);
}
.subhealth-tag {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.76rem;
  color: var(--text-second);
  background: var(--bg-card);
  border: 1px solid rgba(245,158,11,0.15);
  border-radius: var(--radius-sm);
  padding: 7px 12px;
  backdrop-filter: blur(10px);
}
.subhealth-dot {
  width: 6px; height: 6px;
  background: #F59E0B;
  border-radius: 50%;
  flex-shrink: 0;
  animation: dotBlink 2s ease-in-out infinite;
}
@keyframes dotBlink {
  0%,100% { opacity: 1; }
  50% { opacity: 0.35; }
}

/* 体质详解 */
.constitution-detail-section { margin-top: 4px; }
.formation-reason-box {
  background: linear-gradient(145deg, rgba(0,212,255,0.05), rgba(0,255,136,0.03));
  border: 1.5px solid rgba(0,212,255,0.15);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  margin-bottom: 12px;
  position: relative;
  backdrop-filter: blur(10px);
}
.formation-text {
  font-size: 0.8rem;
  color: var(--text-second);
  line-height: 1.9;
  letter-spacing: 0.02em;
}
.formation-reason-sub {
  background: linear-gradient(145deg, rgba(72,202,228,0.08), rgba(0,180,216,0.04));
  border-color: rgba(72,202,228,0.2);
}
.constitution-challenges-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 8px;
  padding-left: 4px;
}

.challenge-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.challenge-item {
  font-size: 0.82rem;
  color: var(--text-second);
  line-height: 1.75;
  padding-left: 12px;
  position: relative;
}
.challenge-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 9px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
}

/* 外治调理方案 */
.external-therapy-section { margin-top: 4px; }
.therapy-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.therapy-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  backdrop-filter: blur(10px);
  transition: var(--transition);
  border-left: 3px solid transparent;
}
.therapy-card:hover {
  border-left-color: var(--primary);
  box-shadow: var(--shadow-md), 0 0 20px rgba(0,212,255,0.1);
}
.therapy-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.therapy-num {
  width: 26px; height: 26px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #000;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 800;
  flex-shrink: 0;
  box-shadow: 0 2px 10px var(--primary-glow);
}
.therapy-name {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-primary);
}
.therapy-desc {
  font-size: 0.76rem;
  color: var(--text-second);
  line-height: 1.85;
  letter-spacing: 0.01em;
}

/* 生活调养指南 */
.lifestyle-section { margin-top: 4px; }
.lifestyle-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.lifestyle-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  backdrop-filter: blur(10px);
  transition: var(--transition);
}
.lifestyle-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: var(--border-md);
}
.lifestyle-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 13px 16px 10px;
  background: linear-gradient(90deg, rgba(0,212,255,0.08), transparent);
  border-bottom: 1px solid var(--border);
}
.lifestyle-icon { font-size: 1.15rem; }
.lifestyle-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.04em;
}
.lifestyle-body {
  padding: 13px 16px 15px;
  font-size: 0.77rem;
  color: var(--text-second);
  line-height: 1.85;
  letter-spacing: 0.01em;
}

/* AI茶饮/药膳推荐卡片 */
.ai-recipe-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  backdrop-filter: blur(10px);
  transition: var(--transition);
}
.ai-recipe-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: var(--border-md);
}
.recipe-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 13px 16px 10px;
  background: linear-gradient(90deg, rgba(0,212,255,0.08), transparent);
  border-bottom: 1px solid var(--border);
}
.recipe-icon { font-size: 1.15rem; }
.recipe-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.04em;
}
.recipe-body {
  padding: 13px 16px 15px;
  font-size: 0.82rem;
  color: var(--text-second);
  line-height: 1.85;
  white-space: pre-line;
}

/* ===================================================
   身体调理板块
   =================================================== */
.body-treatment-section { margin-top: 4px; }
.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;
  backdrop-filter: blur(10px);
}
.treatment-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.treatment-num {
  width: 24px;
  height: 24px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #000;
  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(--text-primary);
}
.treatment-desc {
  font-size: 0.82rem;
  color: var(--text-second);
  line-height: 1.7;
  margin-bottom: 8px;
}
.treatment-cycle {
  font-size: 0.72rem;
  color: var(--primary);
  font-weight: 600;
  padding: 4px 10px;
  background: rgba(0,212,255,0.08);
  border-radius: var(--radius-sm);
  display: inline-block;
}

/* ===================================================
   报告导出禁用动画
   =================================================== */
.report-body.no-animate *,
.report-body.no-animate {
  animation: none !important;
  transition: none !important;
  transform: none !important;
  opacity: 1 !important;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ===================================================
   平板适配 (1024px+) - 针对11寸 1920x1200 屏幕
   =================================================== */
@media (min-width: 600px) {
  .app { max-width: 560px; }
  .hero-title .line1 { font-size: 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.2rem; }
  .feature-cards { gap: 14px; }
  .feature-card { padding: 18px 16px; }
  .report-summary-card { padding: 24px; }
  .report-thumb { width: 100px; height: 100px; }
  .report-constitution { font-size: 1.5rem; }
}

@media (min-width: 800px) {
  .app { max-width: 640px; }
  .hero-title .line1 { font-size: 2.2rem; }
}

/* 大平板竖屏优化 */
@media (min-width: 1024px) and (orientation: portrait) {
  .app {
    max-width: 800px;
  }
  
  /* 头部 */
  .home-header {
    padding: 28px 48px 0;
  }
  .header-brand { gap: 16px; }
  .brand-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
  }
  .brand-name { font-size: 1.4rem; }
  .brand-tagline { font-size: 0.75rem; }
  
  /* Hero */
  .hero-section {
    padding: 32px 48px 24px;
  }
  .hero-inner { gap: 28px; }
  .hero-visual { width: 130px; height: 130px; }
  .hero-icon-inner::before { font-size: 2.8rem; }
  .hero-title .line1 { font-size: 2.4rem; }
  .hero-title .line2 { font-size: 0.95rem; }
  .hero-desc { font-size: 0.9rem; line-height: 1.9; }
  
  /* 功能卡片 */
  .feature-cards {
    padding: 0 48px 28px;
    gap: 16px;
  }
  .feature-card {
    padding: 18px 20px;
    border-radius: var(--radius-lg);
  }
  .feature-icon {
    width: 48px;
    height: 48px;
    font-size: 1.4rem;
  }
  .feature-name { font-size: 0.95rem; }
  .feature-desc { font-size: 0.78rem; }
  
  /* 上传区域 */
  .upload-section {
    padding: 0 48px 28px;
  }
  .upload-card {
    border-radius: 28px;
    min-height: 300px;
  }
  .upload-card-inner {
    padding: 48px 40px;
  }
  .upload-icon {
    width: 120px;
    height: 120px;
  }
  .upload-katong-img, .tongue-svg-icon {
    width: 100px;
    height: 120px;
  }
  .upload-title { font-size: 1.3rem; }
  .upload-hint { font-size: 0.88rem; }
  .btn-upload {
    padding: 16px 32px;
    font-size: 0.95rem;
    border-radius: var(--radius-lg);
  }
  
  /* 引导区 */
  .guide-section {
    padding: 0 48px 32px;
  }
  .guide-title { font-size: 0.95rem; }
  .guide-item { padding: 16px; }
  .guide-item p { font-size: 0.82rem; }
  
  /* 报告页 */
  .report-body {
    padding: 24px 48px;
    gap: 20px;
  }
  .report-section-title { font-size: 1rem; }
  .section-icon {
    width: 36px;
    height: 36px;
    font-size: 1.2rem;
  }
  .tongue-features { padding: 20px; }
  .tongue-feature-item { padding: 12px 14px; min-height: 64px; }
  .feature-label { font-size: 0.72rem; }
  .feature-value { font-size: 0.88rem; }
  .analysis-content { padding: 20px; }
  .analysis-text { font-size: 0.88rem; }
  
  /* 处方学习 */
  .prescription-card { padding: 22px 20px; }
  .prescription-name { font-size: 1.1rem; }
  .prescription-label { font-size: 0.85rem; }
  .prescription-content { font-size: 0.88rem; }
  
  /* 底部 */
  .disclaimer { padding: 0 48px 40px; }
  .report-footer { padding: 0 48px 40px; }
}

/* 超大平板横屏检测 */
@media (min-width: 1024px) and (orientation: landscape) {
  .app {
    max-width: 600px;
  }
}

/* ===================================================
   AUTH MODAL (登录/注册弹窗)
   =================================================== */
.modal-overlay {
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 9998;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(10px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.active { display: flex; }

.modal-content {
  width: 100%;
  max-width: 380px;
  background: linear-gradient(145deg, var(--bg-deep), var(--bg-dark));
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 28px 24px 24px;
  box-shadow: var(--shadow-lg), 0 0 60px rgba(0,212,255,0.1);
  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-card);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text-dim);
  transition: var(--transition);
}
.modal-close:active { transform: scale(0.9); background: rgba(0,212,255,0.1); }

/* Auth Tabs */
.auth-tabs {
  display: flex;
  gap: 0;
  background: var(--bg-card);
  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(--text-primary);
  background: rgba(0,212,255,0.1);
  border: 1px solid var(--border);
}

.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-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  transition: var(--transition);
}
.auth-field input:focus {
  border-color: var(--primary);
  background: rgba(0,212,255,0.05);
  box-shadow: 0 0 0 3px rgba(0,212,255,0.1);
}
.auth-field input::placeholder { color: var(--text-dim); font-size: 0.82rem; }

.auth-error {
  font-size: 0.76rem;
  color: #EF4444;
  margin-bottom: 10px;
  min-height: 18px;
}

.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;
}

/* 验证码输入行 */
.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(--primary);
  background: rgba(0,212,255,0.1);
  border: 1.5px solid var(--border-md);
  border-radius: var(--radius-sm);
  white-space: nowrap;
  transition: var(--transition);
}
.btn-send-code:disabled {
  color: var(--text-dim);
  background: var(--bg-card);
  border-color: var(--border);
  cursor: not-allowed;
}
.btn-send-code:not(:disabled):active {
  background: rgba(0,212,255,0.2);
  transform: scale(0.97);
}

.auth-intro {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  padding: 12px 14px;
  background: var(--bg-card);
  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;
}

/* 到期状态徽章 */
.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(0,255,136,0.12);
  color: var(--accent);
  border: 1px solid rgba(0,255,136,0.25);
}
.expire-badge.warning {
  background: rgba(245,158,11,0.12);
  color: #F59E0B;
  border: 1px solid rgba(245,158,11,0.3);
}
.expire-badge.expired {
  background: rgba(239,68,68,0.08);
  color: #EF4444;
  border: 1px solid rgba(239,68,68,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-card);
  border: 1.5px dashed var(--border-md);
  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(--primary);
  letter-spacing: 0.05em;
}

/* 健康信息弹窗 */
.health-modal {
  max-width: 400px;
  padding-bottom: 8px;
}
.health-subtitle {
  font-size: 0.78rem;
  color: var(--text-dim);
  text-align: center;
  margin-bottom: 18px;
}

.auth-field select {
  width: 100%;
  padding: 12px 14px;
  font-size: 0.88rem;
  color: var(--text-primary);
  background: var(--bg-card);
  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='%2300D4FF' 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: var(--primary);
  background-color: rgba(0,212,255,0.05);
  box-shadow: 0 0 0 3px rgba(0,212,255,0.1);
}

.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; }

/* ===================================================
   HISTORY PAGE (历史报告页)
   =================================================== */
.history-body {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: calc(100vh - 140px);
}
.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;
  backdrop-filter: blur(10px);
  cursor: pointer;
  transition: var(--transition);
}
.history-card:active { transform: scale(0.98); background: rgba(0,212,255,0.08); }

.history-thumb {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  object-fit: cover;
  border: 1.5px solid var(--border);
}
.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(--primary); }

.history-arrow {
  font-size: 1.4rem;
  color: var(--text-dim);
  font-weight: 300;
}

.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;
}

/* ===================================================
   SHARE MODAL
   =================================================== */
.share-modal-overlay {
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 9999;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(10px);
  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: linear-gradient(145deg, var(--bg-deep), var(--bg-dark));
  border: 1px solid var(--border);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow-lg), 0 0 40px rgba(0,212,255,0.1);
  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: var(--text-primary);
  margin: 0;
}
.share-modal-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-dim);
  padding: 4px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.share-modal-close:hover { background: var(--bg-card); color: var(--text-primary); }

.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: var(--text-dim); margin: 0; }

.share-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  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 var(--border);
}
.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: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border);
}
.share-btn-copy:hover { background: rgba(0,212,255,0.1); }
.share-btn-download {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  color: #000;
}
.share-btn-download:hover { opacity: 0.9; }

.share-modal-footer {
  padding: 0 20px 18px;
  text-align: center;
}
.share-modal-footer p {
  font-size: 0.78rem;
  color: var(--text-dim);
  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 8px var(--primary-glow));
}
.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: var(--primary);
  margin: 4px 0 0;
  letter-spacing: 0.03em;
}

.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 8px var(--primary-glow));
  opacity: 0.9;
}

/* ===================================================
   相机取景页
   =================================================== */
.camera-fullscreen {
  display: none;
  position: fixed !important;
  top: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  left: 0 !important;
  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;
  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;
  width: min(43vmin, 226px);
  height: auto;
  aspect-ratio: 120 / 140;
  filter:
    drop-shadow(0 0 12px var(--primary-glow))
    drop-shadow(0 0 24px rgba(0,212,255,0.2));
}
.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.6);
  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 var(--border);
}

.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;
  top: 0; right: 0; bottom: 0; left: 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; }
}

/* ===================================================
   Header 按钮
   =================================================== */
.header-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--primary);
  background: rgba(0,212,255,0.08);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 6px 14px;
  transition: var(--transition);
}
.header-btn:active { 
  transform: scale(0.95); 
  background: rgba(0,212,255,0.15);
}
.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-history-btn svg, #nav-history-btn span { pointer-events: none; }

.report-header-actions { display: flex; gap: 8px; }
.icon-btn {
  width: 38px; height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--primary);
  transition: var(--transition);
}
.icon-btn:active { 
  transform: scale(0.93); 
  background: rgba(0,212,255,0.1);
}

.upload-auto-compress {
  font-size: 0.72rem;
  color: var(--primary);
  background: rgba(0,212,255,0.08);
  padding: 4px 12px;
  border-radius: 12px;
  margin-top: 2px;
}
.compress-info {
  display: inline-block;
  font-size: 0.74rem;
  color: var(--primary);
  background: rgba(0,212,255,0.08);
  padding: 4px 14px;
  border-radius: 12px;
  margin-top: 8px;
}

/* ===================================================
   平板大屏相机优化
   =================================================== */
@media (min-width: 600px) {
  .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));
  }
}

@media (min-width: 1024px) {
  .camera-tongue-guide {
    width: min(32vmin, 280px);
  }
  .hint-text {
    font-size: 1.1rem;
    padding: 10px 28px;
  }
}
