/* ========== 全局样式 ========== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

:root {
  --primary: #4CAF50;
  --primary-light: #81C784;
  --primary-dark: #388E3C;
  --primary-bg: #E8F5E9;
  --bg: #F5F7F5;
  --card-bg: #FFFFFF;
  --text: #333333;
  --text-secondary: #666666;
  --text-light: #999999;
  --border: #E0E0E0;
  --warn: #FF9800;
  --alert: #F44336;
  --shadow: 0 2px 8px rgba(0,0,0,0.06);
  --radius: 12px;
  --radius-sm: 8px;
}

html, body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  position: relative;
}

/* ========== 入住表单 ========== */
.onboarding {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #E8F5E9 0%, #F1F8E9 100%);
  padding: 20px;
}

.onboarding-container {
  width: 100%;
  max-width: 400px;
}

.onboarding-header {
  text-align: center;
  margin-bottom: 30px;
}

.logo {
  font-size: 56px;
  margin-bottom: 8px;
}

.onboarding-header h1 {
  font-size: 26px;
  color: var(--primary-dark);
  margin-bottom: 6px;
}

.onboarding-header p {
  color: var(--text-secondary);
  font-size: 14px;
}

.onboarding-form {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 24px 20px;
  box-shadow: var(--shadow);
}

.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 6px;
  font-weight: 500;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 16px;
  color: var(--text);
  background: #FAFAFA;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary);
  background: #FFF;
}

.gender-select {
  display: flex;
  gap: 12px;
}

.gender-option {
  flex: 1;
  position: relative;
}

.gender-option input {
  position: absolute;
  opacity: 0;
}

.gender-option span {
  display: block;
  text-align: center;
  padding: 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 16px;
  color: var(--text-secondary);
  background: #FAFAFA;
  transition: all 0.2s;
}

.gender-option input:checked + span {
  border-color: var(--primary);
  background: var(--primary-bg);
  color: var(--primary-dark);
  font-weight: 600;
}

.onboarding-footer {
  text-align: center;
  margin-top: 20px;
}

.onboarding-footer p {
  font-size: 13px;
  color: var(--text-light);
  line-height: 1.8;
}

/* ========== 按钮 ========== */
.btn-primary {
  width: 100%;
  padding: 14px;
  background: var(--primary);
  color: #FFF;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-primary:hover,
.btn-primary:active {
  background: var(--primary-dark);
}

.btn-primary:disabled {
  background: var(--primary-light);
  cursor: not-allowed;
}

.btn-large {
  padding: 16px;
  font-size: 17px;
  margin-top: 6px;
}

.btn-danger {
  width: 100%;
  padding: 12px;
  background: #FFF;
  color: var(--alert);
  border: 1.5px solid var(--alert);
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-danger:active {
  background: var(--alert);
  color: #FFF;
}

/* ========== 主应用 ========== */
.main-app {
  min-height: 100vh;
  padding-bottom: 70px;
}

.main-content {
  padding: 16px;
  padding-top: 8px;
}

.empty-msg {
  text-align: center;
  color: var(--text-light);
  padding: 40px;
}

/* ========== 页面头部 ========== */
.page-header {
  margin-bottom: 16px;
}

.page-header h2 {
  font-size: 22px;
  color: var(--text);
}

.page-date {
  font-size: 13px;
  color: var(--text-light);
  margin-top: 2px;
}

/* ========== 统计栏 ========== */
.stats-bar {
  display: flex;
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 14px 8px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}

.stat-item {
  flex: 1;
  text-align: center;
  border-right: 1px solid var(--border);
}

.stat-item:last-child {
  border-right: none;
}

.stat-value {
  display: block;
  font-size: 20px;
  font-weight: 700;
  color: var(--primary-dark);
}

.stat-label {
  display: block;
  font-size: 12px;
  color: var(--text-light);
  margin-top: 2px;
}

.stat-tag {
  display: inline-block;
  font-size: 11px;
  color: #FFF;
  padding: 1px 8px;
  border-radius: 10px;
  margin-top: 4px;
}

/* ========== 卡片 ========== */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  margin-bottom: 12px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: #FAFCFA;
}

.meal-icon {
  font-size: 20px;
}

.meal-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.card-body {
  padding: 14px 16px;
}

.card-body h3 {
  font-size: 17px;
  color: var(--text);
  margin-bottom: 6px;
}

.meal-desc {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.food-items {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.food-tag {
  display: inline-block;
  font-size: 13px;
  color: var(--primary-dark);
  background: var(--primary-bg);
  padding: 4px 10px;
  border-radius: 6px;
}

/* ========== 茶饮卡片 ========== */
.tea-card .card-header {
  background: #FFF8E1;
}

.tea-benefit {
  font-size: 13px;
  color: var(--warn);
  font-weight: 500;
  margin-bottom: 6px;
}

.tea-time {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 8px;
}

.tea-note {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 4px;
}

/* ========== 运动卡片 ========== */
.exercise-card .card-header {
  background: #E3F2FD;
}

.exercise-item {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.exercise-item:last-child {
  border-bottom: none;
}

.exercise-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.exercise-detail {
  display: flex;
  gap: 8px;
  margin-bottom: 6px;
}

.exercise-time {
  font-size: 14px;
  color: #1976D2;
  font-weight: 600;
  background: #E3F2FD;
  padding: 2px 10px;
  border-radius: 6px;
}

.exercise-intensity {
  font-size: 13px;
  color: var(--text-secondary);
  background: #F5F5F5;
  padding: 2px 10px;
  border-radius: 6px;
}

.exercise-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.exercise-tips {
  font-size: 12px;
  color: var(--text-light);
}

.exercise-total {
  margin-top: 8px;
  text-align: right;
  font-size: 14px;
  color: var(--primary-dark);
  font-weight: 600;
}

.rest-card .card-header {
  background: #F5F5F5;
}

.rest-text {
  font-size: 14px;
  color: var(--text-secondary);
}

/* ========== 本周计划 ========== */
.adjustment-notice {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #FFF3E0;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  font-size: 13px;
  color: var(--warn);
}

.week-day-card {
  margin-bottom: 10px;
}

.week-day-card.today {
  border: 2px solid var(--primary);
}

.week-day-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: #FAFCFA;
}

.week-day-card.today .week-day-header {
  background: var(--primary-bg);
}

.week-day-name {
  font-size: 15px;
  font-weight: 600;
}

.week-day-tag {
  font-size: 12px;
  padding: 2px 10px;
  border-radius: 10px;
}

.week-day-tag.exercise {
  background: #E3F2FD;
  color: #1565C0;
}

.week-day-tag.rest {
  background: #F5F5F5;
  color: var(--text-light);
}

.week-day-body {
  padding: 10px 14px;
}

.week-meal-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 0;
}

.week-meal-label {
  width: 24px;
  height: 24px;
  line-height: 24px;
  text-align: center;
  font-size: 12px;
  background: var(--primary-bg);
  color: var(--primary-dark);
  border-radius: 6px;
  font-weight: 600;
  flex-shrink: 0;
}

.week-meal-label.tea {
  background: #FFF8E1;
  color: var(--warn);
}

.week-meal-name {
  font-size: 14px;
  color: var(--text);
}

.week-exercise-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
  padding-top: 8px;
  border-top: 1px dashed var(--border);
}

.week-exercise-tag {
  font-size: 12px;
  color: #1565C0;
  background: #E3F2FD;
  padding: 3px 10px;
  border-radius: 6px;
}

/* ========== 进度追踪 ========== */
.progress-overview {
  display: flex;
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 16px 8px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}

.progress-stat {
  flex: 1;
  text-align: center;
  border-right: 1px solid var(--border);
}

.progress-stat:last-child {
  border-right: none;
}

.progress-stat-value {
  display: block;
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
}

.progress-stat-value.positive {
  color: var(--primary);
}

.progress-stat-value.negative {
  color: var(--alert);
}

.progress-stat-label {
  display: block;
  font-size: 12px;
  color: var(--text-light);
  margin-top: 4px;
}

.progress-bar-container {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}

.progress-bar-label {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.progress-bar {
  height: 8px;
  background: #E0E0E0;
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-light), var(--primary));
  border-radius: 4px;
  transition: width 0.5s;
}

.check-in-card .card-header {
  background: var(--primary-bg);
}

.check-in-tip {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.check-in-form {
  display: flex;
  gap: 10px;
}

.check-in-input {
  flex: 1;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 16px;
  background: #FAFAFA;
}

.check-in-input:focus {
  outline: none;
  border-color: var(--primary);
  background: #FFF;
}

.check-in-form .btn-primary {
  width: auto;
  padding: 12px 20px;
  white-space: nowrap;
}

.adjustment-feedback {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
}

.adjustment-good {
  background: #E8F5E9;
  color: var(--primary-dark);
}

.adjustment-warn {
  background: #FFF3E0;
  color: #E65100;
}

.adjustment-alert {
  background: #FFEBEE;
  color: #C62828;
}

.feedback-change {
  font-weight: 600;
  margin-bottom: 4px;
}

/* ========== 体重记录 ========== */
.weight-chart {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.weight-record-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 60px;
}

.weight-bar {
  width: 32px;
  background: linear-gradient(180deg, var(--primary-light), var(--primary));
  border-radius: 6px 6px 0 0;
  margin-bottom: 6px;
  min-height: 20px;
}

.weight-info {
  text-align: center;
}

.weight-date {
  display: block;
  font-size: 11px;
  color: var(--text-light);
}

.weight-value {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin: 2px 0;
}

.weight-change {
  display: block;
  font-size: 11px;
}

.weight-change.positive {
  color: var(--primary);
}

.weight-change.negative {
  color: var(--alert);
}

.weight-change.neutral {
  color: var(--text-light);
}

/* ========== 个人资料 ========== */
.profile-card {
  margin-bottom: 12px;
}

.profile-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 15px;
}

.profile-row:last-child {
  border-bottom: none;
}

.profile-row span:first-child {
  color: var(--text-secondary);
}

.profile-row span:last-child {
  font-weight: 500;
}

.bmi-tag {
  display: inline-block;
  font-size: 12px;
  color: #FFF;
  padding: 1px 8px;
  border-radius: 10px;
  margin-left: 4px;
}

.profile-advice {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 10px;
  padding: 8px 12px;
  background: var(--primary-bg);
  border-radius: var(--radius-sm);
}

.edit-form .form-group {
  margin-bottom: 14px;
}

.edit-form .btn-primary {
  margin-top: 6px;
}

/* ========== 底部导航 ========== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  display: flex;
  background: var(--card-bg);
  border-top: 1px solid var(--border);
  padding: 6px 0;
  padding-bottom: env(safe-area-inset-bottom, 6px);
  z-index: 100;
}

.tab-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px;
  border: none;
  background: none;
  cursor: pointer;
  transition: all 0.2s;
}

.tab-icon {
  font-size: 22px;
  opacity: 0.5;
  transition: opacity 0.2s;
}

.tab-label {
  font-size: 11px;
  color: var(--text-light);
  transition: color 0.2s;
}

.tab-btn.active .tab-icon {
  opacity: 1;
}

.tab-btn.active .tab-label {
  color: var(--primary);
  font-weight: 600;
}

/* ========== 卡片头部（支持换一换按钮）========== */
.card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: #FAFCFA;
}

.meal-title {
  flex: 1;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

/* ========== 换一换按钮 ========== */
.change-btn {
  font-size: 13px;
  color: var(--primary);
  background: var(--primary-bg);
  padding: 4px 12px;
  border-radius: 14px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s;
  flex-shrink: 0;
}

.change-btn:active {
  background: var(--primary);
  color: #FFF;
}

/* ========== 提示栏 ========== */
.tip-bar {
  font-size: 13px;
  color: var(--text-light);
  text-align: center;
  margin-bottom: 12px;
  padding: 6px 14px;
  background: #FAFAFA;
  border-radius: var(--radius-sm);
}

/* ========== 替换弹窗 ========== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-content {
  background: var(--card-bg);
  width: 100%;
  max-width: 480px;
  max-height: 75vh;
  border-radius: 16px 16px 0 0;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.modal-header h3 {
  font-size: 18px;
  color: var(--text);
}

.modal-close {
  font-size: 20px;
  color: var(--text-light);
  cursor: pointer;
  padding: 4px 8px;
}

.modal-body {
  padding: 12px 16px 20px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.option-item {
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.option-item:active {
  background: var(--primary-bg);
}

.option-item.selected {
  border-color: var(--primary);
  background: var(--primary-bg);
}

.option-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.current-tag {
  font-size: 11px;
  color: #FFF;
  background: var(--primary);
  padding: 1px 8px;
  border-radius: 8px;
  font-weight: 400;
  vertical-align: middle;
}

.opt-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.opt-meta {
  font-size: 12px;
  color: var(--text-light);
}

/* ========== 体重趋势图 ========== */
.trend-card .card-body {
  padding: 12px 8px;
}

.trend-chart {
  width: 100%;
}

.trend-chart svg {
  display: block;
  margin: 0 auto;
}

/* ========== 体重记录列表 ========== */
.weight-list {
  max-height: 300px;
  overflow-y: auto;
}

.weight-list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.weight-list-item:last-child {
  border-bottom: none;
}

.weight-list-date {
  font-size: 14px;
  color: var(--text-secondary);
  flex: 1;
}

.weight-list-value {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-right: 12px;
}

/* ========== 调整反馈-信息 ========== */
.adjustment-info {
  background: #E3F2FD;
  color: #1565C0;
}

.feedback-completion {
  margin-top: 6px;
  font-size: 13px;
  opacity: 0.9;
}

/* ========== 每日完成情况 ========== */
.completion-card .card-header {
  background: #F1F8E9;
}

.completion-card .card-body {
  padding: 4px 16px;
}

.completion-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.completion-item:last-child {
  border-bottom: none;
}

.completion-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
  margin-right: 12px;
}

.completion-label {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.completion-plan {
  font-size: 12px;
  color: var(--text-light);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 开关样式 */
.switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #D0D0D0;
  transition: 0.3s;
  border-radius: 26px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

input:checked + .slider {
  background-color: var(--primary);
}

input:checked + .slider:before {
  transform: translateX(22px);
}

/* 运动进度 */
.exercise-progress {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.progress-text {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-light);
  min-width: 36px;
  text-align: right;
}

.progress-text.met {
  color: var(--primary);
}

.range-slider {
  width: 100px;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  background: #E0E0E0;
  border-radius: 3px;
  outline: none;
}

.range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.range-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  border: none;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

/* 每日反馈 */
.completion-feedback {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 500;
}

.feedback-icon {
  font-size: 18px;
  flex-shrink: 0;
}

.feedback-text {
  flex: 1;
}

.feedback-positive {
  background: #E8F5E9;
  color: var(--primary-dark);
}

.feedback-neutral {
  background: #E3F2FD;
  color: #1565C0;
}

.feedback-warn {
  background: #FFF3E0;
  color: #E65100;
}

.feedback-negative {
  background: #FFEBEE;
  color: #C62828;
}

/* 针对性建议 */
.completion-suggestions {
  padding: 12px 16px 16px;
  border-top: 1px solid var(--border);
}

.suggestions-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 10px;
}

.suggestion-item {
  background: #FAFAFA;
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-bottom: 8px;
}

.suggestion-item:last-child {
  margin-bottom: 0;
}

.suggestion-text {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 8px;
}

.suggestion-action {
  display: flex;
  gap: 8px;
  align-items: center;
}

.suggestion-btn {
  padding: 6px 14px;
  background: var(--primary);
  color: #FFF;
  border: none;
  border-radius: 16px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s;
}

.suggestion-btn:active {
  background: var(--primary-dark);
}

.suggestion-more {
  padding: 6px 12px;
  background: none;
  color: var(--text-light);
  border: none;
  font-size: 12px;
  cursor: pointer;
  text-decoration: underline;
}

/* ========== Toast 提示 ========== */
.toast {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(33, 33, 33, 0.9);
  color: #FFF;
  padding: 10px 20px;
  border-radius: 24px;
  font-size: 14px;
  z-index: 2000;
  opacity: 0;
  transition: all 0.3s ease;
  white-space: nowrap;
  max-width: 90%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ========== 完成率统计 ========== */
.completion-stats-card .card-header {
  background: #F3E5F5;
}

.stats-overview {
  display: flex;
  margin-bottom: 14px;
}

.stats-overview-item {
  flex: 1;
  text-align: center;
  border-right: 1px solid var(--border);
}

.stats-overview-item:last-child {
  border-right: none;
}

.stats-overview-value {
  display: block;
  font-size: 22px;
  font-weight: 700;
  color: var(--primary-dark);
}

.stats-overview-label {
  display: block;
  font-size: 11px;
  color: var(--text-light);
  margin-top: 2px;
}

.stats-detail {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.stats-bar-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.stats-bar-label {
  font-size: 13px;
  color: var(--text-secondary);
  width: 60px;
  flex-shrink: 0;
}

.stats-bar-bg {
  flex: 1;
  height: 8px;
  background: #E0E0E0;
  border-radius: 4px;
  overflow: hidden;
}

.stats-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-light), var(--primary));
  border-radius: 4px;
  transition: width 0.5s ease;
}

.stats-bar-fill.exercise {
  background: linear-gradient(90deg, #64B5F6, #1976D2);
}

.stats-bar-num {
  font-size: 12px;
  color: var(--text-light);
  width: 50px;
  text-align: right;
  flex-shrink: 0;
}

.empty-stats {
  text-align: center;
  color: var(--text-light);
  font-size: 13px;
  padding: 16px 0;
}

/* ========== 自定义输入区域 ========== */
.custom-input-section {
  margin-top: 16px;
}

.custom-input-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin-bottom: 12px;
  color: var(--text-light);
  font-size: 12px;
}

.custom-input-divider::before,
.custom-input-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.custom-input-divider span {
  padding: 0 12px;
}

.custom-input-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.custom-category-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.category-pill {
  font-size: 12px;
  padding: 5px 10px;
  border-radius: 16px;
  background: #F5F5F5;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid var(--border);
}

.category-pill.active {
  background: var(--primary);
  color: #FFF;
  border-color: var(--primary);
}

.custom-input-form input {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  background: #FAFAFA;
}

.custom-input-form input:focus {
  outline: none;
  border-color: var(--primary);
  background: #FFF;
}

.custom-submit-btn {
  width: 100%;
  padding: 10px;
  font-size: 14px;
  white-space: nowrap;
}

/* ========== 评估结果 ========== */
.eval-result {
  border-radius: var(--radius-sm);
  border: 1.5px solid;
  padding: 14px;
  margin-top: 12px;
}

.eval-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.eval-icon {
  font-size: 24px;
}

.eval-title {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.eval-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.eval-level {
  font-size: 13px;
  font-weight: 600;
}

.eval-body {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.eval-body p {
  margin-bottom: 4px;
}

.eval-desc {
  margin-top: 4px;
}

/* 评估替代建议 */
.eval-suggestions {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(0,0,0,0.08);
}

.eval-suggestions-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text);
}

.suggestion-group-label {
  font-size: 12px;
  color: var(--text-light);
  margin: 8px 0 4px;
}

.suggestion-option {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255,255,255,0.8);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-bottom: 6px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 13px;
  color: var(--text);
}

.suggestion-option:active {
  background: rgba(255,255,255,1);
  transform: scale(0.98);
}

.suggestion-add {
  color: var(--primary);
  font-weight: 600;
  font-size: 12px;
}

/* 运动方案详情 */
.exercise-plan-detail {
  background: rgba(255,255,255,0.6);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-top: 8px;
}

.plan-detail-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  font-size: 13px;
  border-bottom: 1px solid rgba(0,0,0,0.05);
}

.plan-detail-row:last-child {
  border-bottom: none;
}

.plan-detail-label {
  color: var(--text-secondary);
  font-weight: 500;
}

.plan-detail-value {
  color: var(--text);
  font-weight: 600;
}

.custom-add-btn {
  margin-top: 12px;
}

/* ========== 问答卡片 ========== */
.qa-card .card-header {
  background: #E8F5E9;
}

.qa-messages {
  max-height: 240px;
  overflow-y: auto;
  margin-bottom: 10px;
  padding: 4px 0;
}

.qa-message {
  margin-bottom: 10px;
  display: flex;
}

.qa-message.user {
  justify-content: flex-end;
}

.qa-bubble {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.5;
}

.qa-message.bot .qa-bubble {
  background: #F5F5F5;
  color: var(--text);
  border-bottom-left-radius: 4px;
}

.qa-message.user .qa-bubble {
  background: var(--primary);
  color: #FFF;
  border-bottom-right-radius: 4px;
}

.qa-quick-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.qa-tag {
  font-size: 12px;
  padding: 5px 10px;
  border-radius: 14px;
  background: var(--primary-bg);
  color: var(--primary-dark);
  cursor: pointer;
  transition: all 0.2s;
}

.qa-tag:active {
  background: var(--primary-light);
}

.qa-input-area {
  display: flex;
  gap: 8px;
}

.qa-input {
  flex: 1;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  font-size: 14px;
  background: #FAFAFA;
  outline: none;
  transition: border-color 0.2s;
}

.qa-input:focus {
  border-color: var(--primary);
  background: #FFF;
}

.qa-send-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary);
  color: #FFF;
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  flex-shrink: 0;
  transition: background 0.2s;
}

.qa-send-btn:active {
  background: var(--primary-dark);
}

/* ========== 知识库卡片 ========== */
.knowledge-card .card-header {
  background: #FFF8E1;
}

.knowledge-categories {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.knowledge-category {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 8px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background 0.2s;
}

.knowledge-category:last-child {
  border-bottom: none;
}

.knowledge-category:active {
  background: #FAFAFA;
}

.knowledge-cat-icon {
  font-size: 20px;
}

.knowledge-cat-name {
  flex: 1;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.knowledge-cat-arrow {
  font-size: 12px;
  color: var(--text-light);
}

.knowledge-articles {
  padding-left: 12px;
}

.knowledge-article {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 8px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background 0.2s;
}

.knowledge-article:last-child {
  border-bottom: none;
}

.knowledge-article:active {
  background: var(--primary-bg);
}

.knowledge-article-title {
  font-size: 14px;
  color: var(--text);
}

.knowledge-article-arrow {
  font-size: 18px;
  color: var(--text-light);
}

.knowledge-modal-content {
  max-height: 70vh;
}

.knowledge-article-category {
  font-size: 13px;
  color: var(--text-light);
  margin-bottom: 12px;
}

.knowledge-article-content {
  font-size: 14px;
  color: var(--text);
  line-height: 1.8;
}

/* ========== 响应式 ========== */
@media (min-width: 481px) {
  body {
    box-shadow: 0 0 20px rgba(0,0,0,0.05);
  }
}

@media (max-width: 360px) {
  .stat-value {
    font-size: 17px;
  }
  .card-body h3 {
    font-size: 15px;
  }
}

/* ========== 首屏加载动画 ========== */
.splash-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #E8F5E9 0%, #F1F8E9 50%, #E8F5E9 100%);
  transition: opacity 0.4s ease;
}

.splash-screen.splash-hide {
  opacity: 0;
  pointer-events: none;
}

.splash-logo {
  font-size: 64px;
  animation: splashBounce 1s ease infinite;
}

.splash-title {
  font-size: 20px;
  font-weight: 700;
  color: #388E3C;
  margin-top: 12px;
  letter-spacing: 2px;
}

.splash-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid #C8E6C9;
  border-top-color: #4CAF50;
  border-radius: 50%;
  margin-top: 24px;
  animation: splashSpin 0.8s linear infinite;
}

@keyframes splashBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@keyframes splashSpin {
  to { transform: rotate(360deg); }
}

/* ========== 页面切换动画 ========== */
.page-enter {
  animation: pageFadeIn 0.3s ease;
}

@keyframes pageFadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ========== 视觉美化增强 ========== */

/* 增强全局色彩和阴影 */
:root {
  --shadow: 0 2px 12px rgba(76,175,80,0.06);
  --shadow-hover: 0 4px 16px rgba(76,175,80,0.12);
  --shadow-nav: 0 -2px 12px rgba(0,0,0,0.06);
}

/* 优化背景 */
html, body {
  background: #F5F7F5;
  background-image: radial-gradient(circle at 20% 0%, rgba(232,245,233,0.5) 0%, transparent 50%),
                    radial-gradient(circle at 80% 100%, rgba(232,248,233,0.4) 0%, transparent 50%);
  background-attachment: fixed;
}

/* 增强卡片 */
.card {
  transition: box-shadow 0.25s ease, transform 0.15s ease;
  border: 1px solid rgba(0,0,0,0.02);
}

/* 增强入住页面 */
.onboarding {
  background: linear-gradient(160deg, #E8F5E9 0%, #F1F8E9 40%, #FFFFFF 100%);
}

.onboarding-header .logo {
  animation: logoFloat 3s ease-in-out infinite;
}

@keyframes logoFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-6px) rotate(3deg); }
}

.onboarding-form {
  border: 1px solid rgba(76,175,80,0.08);
  box-shadow: 0 4px 24px rgba(76,175,80,0.08);
}

.onboarding-header h1 {
  background: linear-gradient(135deg, #388E3C, #66BB6A);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* 增强按钮交互 */
.btn-primary {
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(76,175,80,0.25);
}

.btn-primary:active {
  transform: scale(0.97);
  box-shadow: 0 1px 4px rgba(76,175,80,0.2);
}

.btn-large {
  box-shadow: 0 4px 12px rgba(76,175,80,0.3);
}

/* 增强表单输入 */
.form-group input,
.form-group select,
.check-in-input,
.qa-input,
.custom-input-form input {
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.check-in-input:focus,
.qa-input:focus,
.custom-input-form input:focus {
  box-shadow: 0 0 0 3px rgba(76,175,80,0.12);
}

/* 增强底部导航栏 */
.bottom-nav {
  box-shadow: var(--shadow-nav);
  border-top: none;
  backdrop-filter: blur(10px);
  background: rgba(255,255,255,0.95);
}

.tab-btn {
  transition: all 0.2s ease;
  position: relative;
}

.tab-btn:active .tab-icon {
  transform: scale(1.15);
}

.tab-btn.active .tab-icon {
  filter: drop-shadow(0 2px 4px rgba(76,175,80,0.3));
}

/* 导航激活指示器 */
.tab-btn.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 3px;
  background: var(--primary);
  border-radius: 0 0 3px 3px;
}

/* 增强卡片头部渐变 */
.meal-card .card-header,
.exercise-card .card-header,
.tea-card .card-header,
.completion-card .card-header,
.qa-card .card-header,
.knowledge-card .card-header,
.completion-stats-card .card-header {
  border-bottom: 1px solid rgba(0,0,0,0.04);
}

/* 增强换一换按钮 */
.change-btn {
  transition: all 0.2s ease;
}

.change-btn:active {
  transform: scale(0.93);
}

/* 增强开关动画 */
.slider {
  transition: background-color 0.3s, box-shadow 0.3s;
}

input:checked + .slider {
  box-shadow: 0 2px 8px rgba(76,175,80,0.3);
}

.slider:before {
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* 增强选项卡片 */
.option-item {
  transition: all 0.2s ease;
}

.option-item:active {
  transform: scale(0.98);
}

/* 增强进度条动画 */
.progress-bar-fill,
.stats-bar-fill {
  animation: barGrow 0.6s ease;
}

@keyframes barGrow {
  from { width: 0 !important; }
}

/* 增强底部导航图标过渡 */
.tab-icon {
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* 增强统计数值 */
.stat-value,
.progress-stat-value,
.stats-overview-value {
  text-shadow: 0 1px 2px rgba(76,175,80,0.08);
}

/* 增强体重趋势图卡片 */
.trend-card {
  border: 1px solid rgba(76,175,80,0.06);
}

/* 增强 Toast 动画 */
.toast {
  backdrop-filter: blur(10px);
  background: rgba(33,33,33,0.85);
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

/* 增强弹窗 */
.modal-content {
  box-shadow: 0 -4px 30px rgba(0,0,0,0.12);
}

/* 增强建议按钮 */
.suggestion-btn,
.suggestion-option {
  transition: all 0.2s ease;
}

.suggestion-btn:active {
  transform: scale(0.95);
}

.suggestion-option:active {
  transform: scale(0.98);
}

/* 增强类别标签 */
.category-pill,
.qa-tag {
  transition: all 0.2s ease;
}

.category-pill:active,
.qa-tag:active {
  transform: scale(0.93);
}

/* 增强知识库条目 */
.knowledge-category,
.knowledge-article {
  transition: all 0.2s ease;
}

.knowledge-category:active,
.knowledge-article:active {
  transform: translateX(4px);
}

/* 增强性别选择 */
.gender-option span {
  transition: all 0.25s ease;
}

.gender-option:active span {
  transform: scale(0.97);
}

/* 增强搜索/输入框 */
.qa-send-btn {
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(76,175,80,0.2);
}

.qa-send-btn:active {
  transform: scale(0.9);
  box-shadow: 0 1px 4px rgba(76,175,80,0.15);
}

/* ========== 卡片入场动画（交错） ========== */
.main-content .card {
  animation: cardSlideIn 0.35s ease backwards;
}

.main-content .card:nth-child(1) { animation-delay: 0.02s; }
.main-content .card:nth-child(2) { animation-delay: 0.06s; }
.main-content .card:nth-child(3) { animation-delay: 0.10s; }
.main-content .card:nth-child(4) { animation-delay: 0.14s; }
.main-content .card:nth-child(5) { animation-delay: 0.18s; }
.main-content .card:nth-child(6) { animation-delay: 0.22s; }
.main-content .card:nth-child(7) { animation-delay: 0.26s; }
.main-content .card:nth-child(8) { animation-delay: 0.30s; }

@keyframes cardSlideIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ========== 安全区域优化 ========== */
.bottom-nav {
  padding-bottom: max(6px, env(safe-area-inset-bottom));
}

/* ========== 选中文本颜色 ========== */
::selection {
  background: rgba(76,175,80,0.2);
  color: #2E7D32;
}

/* ========== 平滑滚动 ========== */
.main-content {
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

.qa-messages,
.weight-list,
.modal-body {
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}
