:root {
  /* Aura-inspired Soft Health Palette */
  --bg-primary: #F8FBFA;
  --bg-secondary: #FFFFFF;
  --accent-soft: #E8F5E9;
  --accent-main: #66BB6A;
  --accent-deep: #388E3C;
  --text-primary: #2D3436;
  --text-secondary: #636E72;
  --text-light: #B2BEC3;
  --border-color: #EDF2F1;
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.03);
  --shadow-md: 0 8px 24px rgba(102, 187, 106, 0.08);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.08);
  
  /* Nutrition Colors */
  --protein: #FFAB91;
  --potassium: #90CAF9;
  --phosphorus: #CE93D8;
  --sodium: #FFF59D;
  
  /* Spacing & Radii */
  --space-xs: 8px;
  --space-sm: 12px;
  --space-md: 20px;
  --space-lg: 32px;
  --radius-sm: 12px;
  --radius-md: 20px;
  --radius-lg: 32px;
  
  --font-main: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-main);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  overflow-x: hidden;
}

.app-container {
  max-width: 480px; /* Mimic mobile view */
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg-primary);
  position: relative;
  padding-bottom: 100px;
}

/* Header & Navigation */
header {
  padding: var(--space-lg) var(--space-md) var(--space-sm);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid white;
  box-shadow: var(--shadow-sm);
}

.greeting h1 {
  font-size: 1.25rem;
  margin: 0;
  font-weight: 600;
}

.greeting p {
  font-size: 0.85rem;
  margin: 0;
  color: var(--text-secondary);
}

/* Dashboard Cards */
.section-title {
  padding: 0 var(--space-md);
  margin: var(--space-lg) 0 var(--space-sm);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.section-title h2 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0;
}

.section-title a {
  font-size: 0.8rem;
  color: var(--accent-main);
  text-decoration: none;
}

.main-stats {
  padding: 0 var(--space-md);
}

.hero-card {
  background: linear-gradient(135deg, #FFFFFF 0%, #F1FBF4 100%);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  box-shadow: var(--shadow-md);
  border: 1px solid white;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.progress-container {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  height: 180px;
}

.progress-circle {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: conic-gradient(var(--accent-main) 70%, var(--accent-soft) 0);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.progress-circle::after {
  content: '';
  position: absolute;
  width: 120px;
  height: 120px;
  background: white;
  border-radius: 50%;
}

.progress-content {
  position: relative;
  z-index: 1;
  text-align: center;
}

.progress-content .value {
  font-size: 2rem;
  font-weight: 700;
  display: block;
}

.progress-content .label {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.nutrition-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-sm);
}

.nutri-item {
  text-align: center;
}

.nutri-bar-bg {
  height: 40px;
  width: 6px;
  background: var(--accent-soft);
  border-radius: 3px;
  margin: 0 auto var(--space-xs);
  position: relative;
  overflow: hidden;
}

.nutri-bar-fill {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  border-radius: 3px;
}

.nutri-label {
  font-size: 0.7rem;
  color: var(--text-secondary);
  display: block;
}

.nutri-val {
  font-size: 0.8rem;
  font-weight: 600;
}

@keyframes scan {
  0% { top: 0; }
  50% { top: 100%; }
  100% { top: 0; }
}

/* Weight Tracking */
.weight-row {
  display: flex;
  gap: var(--space-sm);
  padding: 0 var(--space-md);
  margin-top: var(--space-md);
}

.weight-summary-card {
  margin: 0 var(--space-md);
  padding: var(--space-md);
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.weight-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-md);
}

.weight-tabs {
  display: flex;
  background: var(--bg-primary);
  padding: 4px;
  border-radius: 10px;
  gap: 4px;
}

.weight-tab {
  padding: 4px 12px;
  border-radius: 8px;
  font-size: 0.75rem;
  color: var(--text-secondary);
  cursor: pointer;
}

.weight-tab.active {
  background: white;
  color: var(--accent-main);
  box-shadow: var(--shadow-sm);
  font-weight: 600;
}

.bmi-status-bar {
  height: 6px;
  background: linear-gradient(to right, #90CAF9 0%, #90CAF9 18.5%, #66BB6A 18.5%, #66BB6A 24%, #FFF59D 24%, #FFF59D 28%, #FF7675 28%, #FF7675 100%);
  border-radius: 3px;
  position: relative;
  margin: 20px 0 30px;
}

.bmi-indicator {
  position: absolute;
  top: -12px;
  left: 21%;
  width: 4px;
  height: 14px;
  background: var(--text-primary);
  border: 2px solid white;
  border-radius: 2px;
  box-shadow: var(--shadow-sm);
}

.bmi-indicator::after {
  content: '当前 BMI: 22.4 (正常)';
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: 0.7rem;
  color: var(--text-secondary);
}

.weight-chart-mock {
  height: 120px;
  width: 100%;
  margin-top: var(--space-md);
  background-image: linear-gradient(to right, transparent 0%, transparent 99%, rgba(0,0,0,0.05) 100%), 
                    linear-gradient(to bottom, transparent 0%, transparent 99%, rgba(0,0,0,0.05) 100%);
  background-size: 40px 40px;
  position: relative;
  overflow: hidden;
}

.chart-line {
  position: absolute;
  top: 60px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--accent-main);
  opacity: 0.3;
}

.chart-dot {
  position: absolute;
  width: 8px;
  height: 8px;
  background: var(--accent-main);
  border: 2px solid white;
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(102, 187, 106, 0.1);
}

.small-card {
  flex: 1;
  background: var(--bg-secondary);
  padding: var(--space-md);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
}

.small-card h3 {
  font-size: 0.8rem;
  margin: 0 0 var(--space-xs);
  color: var(--text-secondary);
  font-weight: 500;
}

.small-card .value {
  font-size: 1.2rem;
  font-weight: 600;
}

.small-card .trend {
  font-size: 0.7rem;
  margin-left: 4px;
}

.trend.down { color: var(--accent-main); }
.trend.up { color: #FF7675; }

/* Diet Timeline */
.diet-list {
  padding: 0 var(--space-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.diet-card {
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  padding: var(--space-sm) var(--space-md);
  display: flex;
  align-items: center;
  gap: var(--space-md);
  border: 1px solid var(--border-color);
  transition: transform 0.2s;
}

.diet-card:active {
  transform: scale(0.98);
}

.diet-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--accent-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-main);
}

.diet-info {
  flex: 1;
}

.diet-info h4 {
  margin: 0;
  font-size: 0.95rem;
}

.diet-info p {
  margin: 2px 0 0;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.diet-cal {
  font-weight: 600;
  font-size: 0.9rem;
}

/* Recommendations */
.rec-scroll {
  display: flex;
  overflow-x: auto;
  padding: 0 var(--space-md) var(--space-md);
  gap: var(--space-md);
  scroll-snap-type: x mandatory;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.rec-scroll::-webkit-scrollbar { display: none; }

.rec-card {
  min-width: 200px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  scroll-snap-align: start;
}

.rec-image {
  height: 120px;
  background: #eee;
  position: relative;
}

.rec-content {
  padding: var(--space-sm);
}

.rec-content h4 {
  margin: 0;
  font-size: 0.9rem;
}

.rec-tag {
  display: inline-block;
  padding: 2px 8px;
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-size: 0.65rem;
  border-radius: 4px;
  margin-top: 4px;
}

/* FAB */
.fab {
  position: fixed;
  bottom: 100px;
  right: var(--space-md);
  width: 56px;
  height: 56px;
  background: var(--accent-main);
  border-radius: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 4px 20px rgba(102, 187, 106, 0.4);
  z-index: 100;
  cursor: pointer;
  transition: transform 0.2s;
}

.fab:active {
  transform: scale(0.9);
}

/* Bottom Nav */
nav.tab-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 80px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  display: flex;
  justify-content: space-around;
  align-items: center;
  border-top: 1px solid var(--border-color);
  z-index: 1000;
  padding-bottom: env(safe-area-inset-bottom);
}

.tab-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--text-light);
  text-decoration: none;
  font-size: 0.65rem;
}

.tab-item.active {
  color: var(--accent-main);
}

.tab-icon {
  width: 24px;
  height: 24px;
}

/* Overlay/Dialog Styles */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 2000;
  display: flex;
  align-items: flex-end;
  transition: opacity 0.3s;
}

.bottom-sheet {
  width: 100%;
  background: white;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: var(--space-md) var(--space-md) calc(var(--space-lg) + env(safe-area-inset-bottom));
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 -10px 40px rgba(0,0,0,0.1);
}

.sheet-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-lg);
}

.sheet-header h3 {
  margin: 0;
  font-size: 1.2rem;
}

.close-btn {
  padding: 8px;
  color: var(--text-light);
  cursor: pointer;
}

.form-group {
  margin-bottom: var(--space-md);
}

.form-label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.input-field {
  width: 100%;
  padding: 14px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  outline: none;
}

.input-field:focus {
  border-color: var(--accent-main);
  background: white;
}

.btn-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-sm);
  margin-top: var(--space-lg);
}

.btn {
  padding: 14px;
  border-radius: var(--radius-sm);
  border: none;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
}

.btn-primary {
  background: var(--accent-main);
  color: white;
}

.btn-secondary {
  background: var(--accent-soft);
  color: var(--accent-deep);
}

.camera-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.cam-option {
  background: var(--bg-primary);
  border-radius: var(--radius-md);
  padding: var(--space-lg) var(--space-md);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  text-decoration: none;
}

.cam-option svg {
  color: var(--accent-main);
}

/* Food Tag Editor */
.food-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.food-tag {
  padding: 6px 14px;
  background: white;
  border: 1px solid var(--border-color);
  border-radius: 20px;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 6px;
}

.tag-remove {
  color: var(--text-light);
  cursor: pointer;
}

/* Utilities */
.placeholder-image {
  width: 100%;
  height: 100%;
  background: #f0f4f3;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
  font-size: 0.8rem;
}

.placeholder-avatar {
  width: 100%;
  height: 100%;
  background: var(--accent-soft);
  display: flex;
  align-items: center;
  justify-content: center;
}
