/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --blue-50:  #eff6ff;
  --blue-100: #dbeafe;
  --blue-200: #bfdbfe;
  --blue-400: #60a5fa;
  --blue-500: #3b82f6;
  --blue-600: #2563eb;
  --blue-700: #1d4ed8;
  --blue-900: #1e3a8a;
  --purple-100: #ede9fe;
  --purple-400: #a78bfa;
  --purple-500: #8b5cf6;
  --purple-600: #7c3aed;
  --purple-700: #6d28d9;
  --white: #ffffff;
  --gray-50:  #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;
  --green-500: #22c55e;
  --yellow-400: #facc15;
  --red-400: #f87171;
  --orange-400: #fb923c;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
  --shadow-md: 0 4px 16px rgba(37,99,235,.1), 0 2px 6px rgba(0,0,0,.06);
  --shadow-lg: 0 10px 40px rgba(37,99,235,.15), 0 4px 12px rgba(0,0,0,.08);
  --shadow-xl: 0 20px 60px rgba(37,99,235,.18), 0 8px 20px rgba(0,0,0,.1);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: var(--white);
  color: var(--gray-800);
  line-height: 1.6;
  overflow-x: hidden;
}

.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* ===== TYPOGRAPHY ===== */
h1 { font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 700; line-height: 1.2; color: var(--gray-900); }
h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); font-weight: 700; color: var(--gray-900); }
h3 { font-size: 1.1rem; font-weight: 600; color: var(--gray-800); }

.gradient-text {
  background: linear-gradient(135deg, var(--blue-600), var(--purple-500));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ===== BUTTONS ===== */
.btn-primary {
  background: linear-gradient(135deg, var(--blue-600), var(--blue-700));
  color: var(--white);
  border: none;
  border-radius: var(--radius-md);
  padding: 10px 22px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .25s ease;
  font-family: inherit;
  box-shadow: 0 4px 14px rgba(37,99,235,.35);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(37,99,235,.45);
  background: linear-gradient(135deg, var(--blue-700), var(--purple-600));
}
.btn-primary.btn-lg { padding: 14px 32px; font-size: 1rem; border-radius: var(--radius-lg); }
.btn-primary.btn-full { width: 100%; padding: 14px; margin-top: 16px; }
.btn-primary.btn-generate { padding: 14px 28px; font-size: 1rem; gap: 8px; display:inline-flex; align-items:center; }

.btn-ghost {
  background: transparent;
  color: var(--blue-600);
  border: 2px solid var(--blue-200);
  border-radius: var(--radius-md);
  padding: 10px 22px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .25s ease;
  font-family: inherit;
}
.btn-ghost:hover { background: var(--blue-50); border-color: var(--blue-400); transform: translateY(-1px); }
.btn-ghost.btn-lg { padding: 14px 32px; font-size: 1rem; border-radius: var(--radius-lg); }

/* ===== NAVBAR ===== */
.navbar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--blue-100);
  box-shadow: 0 2px 12px rgba(37,99,235,.07);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 68px;
}
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.logo-icon { font-size: 1.6rem; }
.logo-text { font-size: 1.25rem; font-weight: 700; background: linear-gradient(135deg, var(--blue-600), var(--purple-500)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.nav-links { display: flex; gap: 32px; }
.nav-links a { text-decoration: none; color: var(--gray-600); font-size: 0.9rem; font-weight: 500; transition: color .2s; }
.nav-links a:hover { color: var(--blue-600); }
.nav-cta { padding: 8px 20px; font-size: 0.875rem; }

/* ===== SECTION HEADERS ===== */
.section-header { text-align: center; margin-bottom: 48px; }
.section-header h2 { margin: 12px 0 16px; }
.section-header p { color: var(--gray-500); max-width: 560px; margin: 0 auto; }

.section-badge {
  display: inline-block;
  padding: 4px 14px;
  background: linear-gradient(135deg, var(--blue-50), var(--purple-100));
  color: var(--blue-600);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  border: 1px solid var(--blue-200);
  letter-spacing: .04em;
}

/* ===== HERO ===== */
.hero {
  position: relative;
  padding: 80px 0 100px;
  background: linear-gradient(160deg, #f0f7ff 0%, #faf5ff 50%, #f0f4ff 100%);
  overflow: hidden;
}
.hero-bg-shapes { position: absolute; inset: 0; pointer-events: none; }
.shape {
  position: absolute; border-radius: 50%;
  background: linear-gradient(135deg, rgba(59,130,246,.12), rgba(139,92,246,.12));
  filter: blur(40px);
}
.shape-1 { width: 500px; height: 500px; top: -150px; right: -100px; }
.shape-2 { width: 300px; height: 300px; bottom: -80px; left: -60px; background: linear-gradient(135deg, rgba(139,92,246,.15), rgba(59,130,246,.08)); }
.shape-3 { width: 200px; height: 200px; top: 40%; left: 35%; background: linear-gradient(135deg, rgba(59,130,246,.06), rgba(139,92,246,.1)); }

.hero-content { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: center; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 16px;
  background: white;
  border: 1px solid var(--blue-200);
  border-radius: 999px;
  font-size: 0.82rem; font-weight: 600; color: var(--blue-600);
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}
.hero-sub { color: var(--gray-600); font-size: 1.05rem; margin: 20px 0 32px; line-height: 1.7; }
.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 40px; }
.hero-stats { display: flex; align-items: center; gap: 0; }
.stat { display: flex; flex-direction: column; align-items: center; padding: 0 24px; }
.stat:first-child { padding-left: 0; }
.stat-num { font-size: 1.6rem; font-weight: 700; background: linear-gradient(135deg, var(--blue-600), var(--purple-500)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.stat-label { font-size: 0.8rem; color: var(--gray-500); margin-top: 2px; }
.stat-divider { width: 1px; height: 36px; background: var(--blue-200); }

/* Hero Visual */
.hero-visual { display: flex; justify-content: center; }
.dashboard-preview {
  background: white;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  width: 360px;
  border: 1px solid var(--blue-100);
  animation: float 4s ease-in-out infinite;
}
@keyframes float {
  0%,100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
.preview-header {
  display: flex; align-items: center; gap: 6px;
  padding: 14px 20px;
  background: linear-gradient(135deg, var(--blue-600), var(--blue-700));
  color: white;
}
.preview-dot { width: 12px; height: 12px; border-radius: 50%; }
.preview-dot.red { background: #ff5f57; }
.preview-dot.yellow { background: #ffbd2e; }
.preview-dot.green { background: #28c840; }
.preview-title { margin-left: 8px; font-size: 0.85rem; font-weight: 600; }
.preview-body { padding: 20px; background: linear-gradient(180deg, #fafcff, #fff); }

.calorie-ring-wrap { position: relative; display: flex; justify-content: center; margin-bottom: 16px; }
.calorie-ring { width: 120px; height: 120px; }
.ring-center {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center;
}
.ring-cal { font-size: 1.1rem; font-weight: 700; color: var(--gray-800); line-height: 1; }
.ring-unit { font-size: 0.65rem; color: var(--gray-500); }
.ring-label { font-size: 0.6rem; color: var(--gray-400); }

.macro-bars { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.macro-item { display: flex; align-items: center; gap: 8px; }
.macro-name { font-size: 0.72rem; color: var(--gray-600); width: 28px; flex-shrink: 0; }
.macro-bar-bg { flex: 1; height: 6px; background: var(--gray-100); border-radius: 999px; overflow: hidden; }
.macro-bar { height: 100%; border-radius: 999px; transition: width .8s ease; }
.macro-bar.carb { background: linear-gradient(90deg, var(--blue-400), var(--blue-500)); }
.macro-bar.protein { background: linear-gradient(90deg, var(--purple-400), var(--purple-500)); }
.macro-bar.fat { background: linear-gradient(90deg, var(--orange-400), #f97316); }
.macro-val { font-size: 0.68rem; color: var(--gray-500); width: 30px; text-align: right; flex-shrink: 0; }

.meal-chips { display: flex; gap: 8px; }
.chip { padding: 4px 12px; border-radius: 999px; font-size: 0.72rem; font-weight: 600; }
.chip.breakfast { background: var(--blue-50); color: var(--blue-600); }
.chip.lunch { background: var(--purple-100); color: var(--purple-600); }
.chip.dinner { background: var(--gray-100); color: var(--gray-500); }

/* ===== FEATURES ===== */
.features { padding: 96px 0; background: var(--white); }
.features-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.feature-card {
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  transition: all .3s ease;
  position: relative; overflow: hidden;
}
.feature-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--blue-500), var(--purple-500));
  opacity: 0; transition: opacity .3s;
}
.feature-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); border-color: var(--blue-100); }
.feature-card:hover::before { opacity: 1; }
.feature-icon {
  width: 52px; height: 52px; border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; margin-bottom: 16px;
}
.feature-card h3 { margin-bottom: 10px; }
.feature-card p { color: var(--gray-500); font-size: 0.88rem; line-height: 1.65; }

/* ===== PLANNER ===== */
.planner { padding: 96px 0; background: linear-gradient(160deg, #f8fbff 0%, #faf5ff 100%); }
.planner-layout { display: grid; grid-template-columns: 1fr 360px; gap: 32px; align-items: start; }

/* Form Card */
.planner-form-card {
  background: white;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  border: 1px solid var(--blue-100);
}

.form-tabs {
  display: flex;
  border-bottom: 1px solid var(--gray-100);
  background: var(--gray-50);
}
.tab-btn {
  flex: 1; padding: 16px 12px;
  background: none; border: none;
  color: var(--gray-500); font-weight: 600; font-size: 0.88rem;
  cursor: pointer; transition: all .2s;
  font-family: inherit;
  position: relative;
}
.tab-btn.active {
  color: var(--blue-600);
  background: white;
}
.tab-btn.active::after {
  content: '';
  position: absolute; bottom: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--blue-500), var(--purple-500));
}
.tab-btn:hover:not(.active) { color: var(--blue-500); background: white; }

.tab-panel { display: none; padding: 28px; }
.tab-panel.active { display: block; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
.form-group { display: flex; flex-direction: column; gap: 8px; }
.form-group.full { grid-column: 1 / -1; }
.form-group label { font-size: 0.875rem; font-weight: 600; color: var(--gray-700); }
.unit-hint { font-weight: 400; color: var(--gray-400); font-size: 0.8rem; }

.form-group input[type="number"],
.form-group input[type="text"],
.form-group select {
  width: 100%; padding: 10px 14px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-md);
  font-size: 0.9rem; font-family: inherit;
  color: var(--gray-800);
  transition: border-color .2s, box-shadow .2s;
  outline: none;
  background: var(--white);
}
.form-group input:focus,
.form-group select:focus {
  border-color: var(--blue-400);
  box-shadow: 0 0 0 3px rgba(59,130,246,.12);
}
.select-wrap { position: relative; }
.select-wrap select { appearance: none; padding-right: 36px; cursor: pointer; }
.select-wrap::after {
  content: '▾'; position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  color: var(--gray-400); pointer-events: none; font-size: 0.9rem;
}

/* Radio Group */
.radio-group { display: flex; gap: 12px; }
.radio-item input[type="radio"] { display: none; }
.radio-box {
  display: flex; align-items: center; gap: 6px;
  padding: 10px 18px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 0.88rem; font-weight: 500;
  transition: all .2s;
  white-space: nowrap;
}
.radio-item input[type="radio"]:checked + .radio-box {
  border-color: var(--blue-500);
  background: var(--blue-50);
  color: var(--blue-700);
}
.radio-box:hover { border-color: var(--blue-300); }

/* Activity Group */
.activity-group { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.activity-item input[type="radio"] { display: none; }
.activity-box {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 14px 8px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all .2s;
  text-align: center;
}
.activity-item input[type="radio"]:checked + .activity-box {
  border-color: var(--blue-500);
  background: var(--blue-50);
  box-shadow: 0 0 0 2px rgba(59,130,246,.15);
}
.activity-box:hover { border-color: var(--blue-300); }
.act-icon { font-size: 1.4rem; }
.act-name { font-size: 0.8rem; font-weight: 600; color: var(--gray-700); }
.act-desc { font-size: 0.7rem; color: var(--gray-400); }

/* Checkbox Group */
.checkbox-group { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.check-item {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-md);
  cursor: pointer; font-size: 0.88rem;
  transition: all .2s;
}
.check-item:hover { border-color: var(--blue-300); background: var(--blue-50); }
.check-item input[type="checkbox"] {
  width: 16px; height: 16px;
  accent-color: var(--blue-500);
  flex-shrink: 0;
}
.check-item span { color: var(--gray-700); }

/* Goal Group */
.goal-group { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.goal-item input[type="radio"] { display: none; }
.goal-box {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 18px 12px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all .25s;
  text-align: center;
}
.goal-item input[type="radio"]:checked + .goal-box {
  border-color: var(--purple-500);
  background: linear-gradient(135deg, var(--blue-50), var(--purple-100));
  box-shadow: 0 0 0 2px rgba(139,92,246,.15);
}
.goal-box:hover { border-color: var(--purple-400); transform: translateY(-2px); }
.goal-icon { font-size: 1.6rem; }
.goal-name { font-size: 0.85rem; font-weight: 600; color: var(--gray-700); }
.goal-desc { font-size: 0.72rem; color: var(--gray-400); }

.form-btns { display: flex; gap: 12px; margin-top: 8px; justify-content: flex-end; }

/* ===== BMI SIDEBAR ===== */
.bmi-sidebar { display: flex; flex-direction: column; gap: 20px; }

.bmi-card, .tdee-card, .tips-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--blue-100);
}
.bmi-card h3, .tdee-card h3, .tips-card h3 {
  margin-bottom: 16px;
  font-size: 0.95rem;
  color: var(--gray-700);
}

.bmi-display { text-align: center; margin-bottom: 16px; }
.bmi-value { font-size: 2.8rem; font-weight: 700; background: linear-gradient(135deg, var(--blue-500), var(--purple-500)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; line-height: 1; }
.bmi-status { font-size: 0.85rem; color: var(--gray-500); margin-top: 6px; }

.bmi-scale { margin-bottom: 14px; position: relative; }
.bmi-bar { display: flex; border-radius: 999px; overflow: hidden; height: 10px; margin-bottom: 4px; }
.bmi-segment { flex: 1; height: 100%; }
.bmi-segment.underweight { background: #60a5fa; }
.bmi-segment.normal { background: #22c55e; flex: 1.2; }
.bmi-segment.overweight { background: #fb923c; }
.bmi-segment.obese { background: #ef4444; }
.bmi-indicator {
  position: absolute; top: -3px;
  width: 16px; height: 16px;
  background: var(--gray-800);
  border: 2px solid white;
  border-radius: 50%;
  transform: translateX(-50%);
  box-shadow: 0 2px 6px rgba(0,0,0,.3);
  transition: left .5s ease;
}
.bmi-labels {
  display: flex; justify-content: space-between;
  font-size: 0.65rem; color: var(--gray-400); padding-top: 8px;
}
.bmi-desc { font-size: 0.8rem; color: var(--gray-500); line-height: 1.5; text-align: center; }

.tdee-value { font-size: 1.8rem; font-weight: 700; color: var(--blue-600); text-align: center; margin-bottom: 14px; }
.tdee-breakdown { border-top: 1px solid var(--gray-100); padding-top: 12px; margin-bottom: 12px; }
.tdee-row { display: flex; justify-content: space-between; font-size: 0.82rem; padding: 4px 0; }
.tdee-row span:first-child { color: var(--gray-500); }
.tdee-row span:last-child { font-weight: 600; color: var(--gray-700); }

.macro-target { display: flex; flex-direction: column; gap: 6px; border-top: 1px solid var(--gray-100); padding-top: 12px; }
.macro-target-item { display: flex; justify-content: space-between; font-size: 0.8rem; }
.macro-target-item .mname { color: var(--gray-500); }
.macro-target-item .mval { font-weight: 600; color: var(--gray-700); }

.tips-list { display: flex; flex-direction: column; gap: 10px; }
.tip-item {
  display: flex; gap: 10px;
  padding: 10px 12px;
  background: var(--gray-50);
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  color: var(--gray-600);
  line-height: 1.5;
  border-left: 3px solid var(--blue-300);
}
.tip-emoji { font-size: 1rem; flex-shrink: 0; }

/* ===== RESULT ===== */
.result-section { padding: 80px 0; background: linear-gradient(160deg, #f0f7ff, #faf5ff); }
.result-header { text-align: center; margin-bottom: 48px; }
.result-header h2 { margin: 12px 0 12px; }
.result-header p { color: var(--gray-600); font-size: 1rem; }

/* Overview Cards */
.overview-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-bottom: 40px; }
.overview-card {
  background: white; border-radius: var(--radius-lg); padding: 24px 20px;
  text-align: center; box-shadow: var(--shadow-md); border: 1px solid var(--blue-100);
  transition: transform .25s;
}
.overview-card:hover { transform: translateY(-4px); }
.ov-icon { font-size: 2rem; margin-bottom: 8px; }
.ov-val { font-size: 1.6rem; font-weight: 700; background: linear-gradient(135deg, var(--blue-500), var(--purple-500)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.ov-label { font-size: 0.78rem; color: var(--gray-500); margin-top: 4px; }

/* Meal Plans */
.meal-plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-bottom: 40px; }
.meal-card {
  background: white; border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: var(--shadow-md); border: 1px solid var(--blue-100);
}
.meal-card-header {
  padding: 16px 20px;
  display: flex; justify-content: space-between; align-items: center;
}
.meal-card-header h4 { font-size: 1rem; color: white; }
.meal-cal-badge { background: rgba(255,255,255,.25); color: white; padding: 3px 10px; border-radius: 999px; font-size: 0.75rem; font-weight: 600; }
.meal-card-body { padding: 16px 20px; }
.food-list { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.food-list-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  background: var(--gray-50); border-radius: var(--radius-md);
}
.food-emoji { font-size: 1.2rem; }
.food-info { flex: 1; }
.food-name { font-size: 0.88rem; font-weight: 500; color: var(--gray-800); }
.food-detail { font-size: 0.75rem; color: var(--gray-400); margin-top: 2px; }
.food-cal { font-size: 0.8rem; font-weight: 600; color: var(--blue-500); }

/* Nutrition Section */
.nutrition-section { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 40px; }
.nutrition-chart-card, .nutrition-detail-card {
  background: white; border-radius: var(--radius-lg); padding: 28px;
  box-shadow: var(--shadow-md); border: 1px solid var(--blue-100);
}
.nutrition-chart-card h3, .nutrition-detail-card h3 { margin-bottom: 20px; }
.chart-container { display: flex; align-items: center; gap: 24px; }
canvas#macroChart { flex-shrink: 0; }
.chart-legend { display: flex; flex-direction: column; gap: 12px; }
.legend-item { display: flex; align-items: center; gap: 8px; }
.legend-dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
.legend-label { font-size: 0.82rem; color: var(--gray-600); }
.legend-pct { margin-left: auto; font-weight: 600; font-size: 0.85rem; color: var(--gray-700); }

.nutrition-table { display: flex; flex-direction: column; gap: 0; }
.nut-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--gray-100);
}
.nut-row:last-child { border-bottom: none; }
.nut-name { font-size: 0.85rem; color: var(--gray-600); width: 120px; flex-shrink: 0; }
.nut-bar-bg { flex: 1; height: 6px; background: var(--gray-100); border-radius: 999px; overflow: hidden; }
.nut-bar { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--blue-400), var(--purple-500)); }
.nut-val { font-size: 0.8rem; font-weight: 600; color: var(--gray-700); width: 60px; text-align: right; flex-shrink: 0; }

/* Health Tips */
.health-tips-section { margin-bottom: 40px; }
.health-tips-section h3 { margin-bottom: 20px; text-align: center; font-size: 1.2rem; }
.tips-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.health-tip-card {
  background: white; border-radius: var(--radius-lg); padding: 20px;
  box-shadow: var(--shadow-sm); border: 1px solid var(--gray-100);
  border-left: 4px solid var(--blue-400);
  font-size: 0.87rem; color: var(--gray-600); line-height: 1.6;
  transition: box-shadow .2s;
}
.health-tip-card:hover { box-shadow: var(--shadow-md); }
.health-tip-card .tip-title { font-weight: 600; color: var(--gray-800); margin-bottom: 6px; font-size: 0.9rem; }

/* Avoid Section */
.avoid-section {
  background: linear-gradient(135deg, #fff1f1, #fef3f3);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  margin-bottom: 40px;
  border: 1px solid #fecaca;
}
.avoid-section h3 { color: #b91c1c; margin-bottom: 14px; }
.avoid-tags { display: flex; flex-wrap: wrap; gap: 10px; }
.avoid-tag {
  padding: 6px 14px;
  background: white;
  border: 1px solid #fca5a5;
  border-radius: 999px;
  font-size: 0.82rem; color: #dc2626;
  font-weight: 500;
}

.result-actions { display: flex; justify-content: center; gap: 16px; }

/* ===== NUTRITION DB ===== */
.nutrition-db { padding: 96px 0; background: white; }
.food-search-bar {
  display: flex; flex-direction: column; gap: 12px;
  margin-bottom: 32px;
}
.food-search-bar input {
  width: 100%; padding: 14px 20px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-lg);
  font-size: 0.95rem; font-family: inherit;
  color: var(--gray-800); outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.food-search-bar input:focus { border-color: var(--blue-400); box-shadow: 0 0 0 4px rgba(59,130,246,.1); }
.food-filter { display: flex; gap: 8px; flex-wrap: wrap; }
.filter-btn {
  padding: 7px 18px;
  border: 1.5px solid var(--gray-200);
  border-radius: 999px;
  background: white;
  font-size: 0.85rem; font-weight: 500; font-family: inherit;
  color: var(--gray-600);
  cursor: pointer;
  transition: all .2s;
}
.filter-btn.active, .filter-btn:hover {
  background: var(--blue-600); color: white; border-color: var(--blue-600);
}

.food-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.food-card {
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-lg);
  padding: 20px 16px;
  text-align: center;
  transition: all .25s;
  cursor: pointer;
}
.food-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--blue-200); }
.food-card-emoji { font-size: 2.2rem; margin-bottom: 10px; }
.food-card-name { font-size: 0.9rem; font-weight: 600; color: var(--gray-800); margin-bottom: 4px; }
.food-card-cal { font-size: 0.8rem; color: var(--blue-500); font-weight: 600; margin-bottom: 8px; }
.food-card-macros { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; }
.food-macro-badge { padding: 2px 8px; border-radius: 999px; font-size: 0.68rem; font-weight: 500; }
.badge-carb { background: var(--blue-50); color: var(--blue-600); }
.badge-protein { background: var(--purple-100); color: var(--purple-600); }
.badge-fat { background: #fff7ed; color: #c2410c; }
.food-card-category { font-size: 0.68rem; color: var(--gray-400); margin-top: 6px; }

/* ===== FOOTER ===== */
.footer { background: var(--gray-900); color: var(--gray-400); padding: 48px 0 32px; }
.footer-inner { display: flex; flex-direction: column; align-items: center; gap: 20px; text-align: center; }
.footer-brand { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.footer-brand .logo-text { font-size: 1.1rem; }
.footer-brand p { font-size: 0.85rem; color: var(--gray-500); }
.footer-note { max-width: 600px; }
.footer-note p { font-size: 0.8rem; color: var(--gray-600); line-height: 1.6; background: rgba(255,255,255,.04); padding: 12px 16px; border-radius: var(--radius-md); border: 1px solid rgba(255,255,255,.06); }
.footer-copy { font-size: 0.78rem; color: var(--gray-600); }

/* ===== PRINT ===== */
@media print {
  .navbar, .hero, .features, .planner, .nutrition-db, .footer, .result-actions { display: none !important; }
  .result-section { display: block !important; padding: 20px; }
  body { background: white; }
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--gray-100); }
::-webkit-scrollbar-thumb { background: var(--blue-300); border-radius: 999px; }

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .features-grid { grid-template-columns: repeat(2, 1fr); }
  .food-grid { grid-template-columns: repeat(3, 1fr); }
  .overview-cards { grid-template-columns: repeat(2, 1fr); }
  .meal-plans { grid-template-columns: 1fr; }
  .nutrition-section { grid-template-columns: 1fr; }
  .tips-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  .hero-content { grid-template-columns: 1fr; gap: 40px; }
  .hero-visual { display: none; }
  .planner-layout { grid-template-columns: 1fr; }
  .bmi-sidebar { flex-direction: row; flex-wrap: wrap; }
  .bmi-card { flex: 1; min-width: 240px; }
  .tdee-card { flex: 1; min-width: 240px; }
  .tips-card { width: 100%; }
}

@media (max-width: 640px) {
  .features-grid { grid-template-columns: 1fr; }
  .food-grid { grid-template-columns: repeat(2, 1fr); }
  .activity-group { grid-template-columns: repeat(2, 1fr); }
  .goal-group { grid-template-columns: repeat(2, 1fr); }
  .form-grid { grid-template-columns: 1fr; }
  .nav-links { display: none; }
  .overview-cards { grid-template-columns: repeat(2, 1fr); }
  .tips-grid { grid-template-columns: 1fr; }
  .hero-stats { flex-wrap: wrap; justify-content: center; }
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fadeInUp .5s ease both; }
.fade-in-1 { animation-delay: .1s; }
.fade-in-2 { animation-delay: .2s; }
.fade-in-3 { animation-delay: .3s; }

/* Loading spinner */
@keyframes spin { to { transform: rotate(360deg); } }
.loading-spinner {
  display: inline-block; width: 20px; height: 20px;
  border: 2px solid rgba(255,255,255,.4);
  border-top-color: white;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  margin-right: 8px;
}
