/* style.css —— 肌肉存款助手 自定义样式 */

:root {
  --brand: #10b981;
  --brand-dark: #047857;
  --gold: #f59e0b;
}

* {
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  padding-bottom: 76px; /* 为固定底部导航留出空间 */
}

/* ===== 底部导航 ===== */
.md-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 28rem;
  display: flex;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(10px);
  border-top: 1px solid #1e293b;
  z-index: 50;
}
.md-nav__item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 12px 0 14px;
  font-size: 24px;
  line-height: 1;
  color: #64748b;
  transition: color 0.2s;
}
.nav-active,
.nav-active span {
  color: var(--brand);
  font-weight: 600;
}

/* ===== 食物卡片 ===== */
.food-card {
  width: 100%;
  text-align: left;
  background: #1e293b;
  border: 1px solid transparent;
  border-radius: 14px;
  padding: 12px 14px;
  transition: all 0.2s;
}
.food-card:active { transform: scale(0.98); }
.food-card--active {
  border-color: var(--brand);
  background: #064e3b;
}

/* ===== 分类筛选 chip ===== */
.cat-chip {
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  background: #1e293b;
  color: #94a3b8;
  white-space: nowrap;
  transition: all 0.2s;
}
.cat-chip--active {
  background: var(--brand);
  color: #042f2e;
  font-weight: 600;
}

/* ===== 吸收优化提醒 ===== */
.reminder {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fcd34d;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 13px;
  margin-top: 8px;
  line-height: 1.5;
  animation: fadeIn 0.3s ease;
}

/* ===== Toast ===== */
.md-toast {
  position: fixed;
  left: 50%;
  bottom: 96px;
  transform: translateX(-50%) translateY(10px);
  background: #0f172a;
  color: #fff;
  border: 1px solid #334155;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s;
  z-index: 100;
  max-width: 90%;
  text-align: center;
}
.md-toast--show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.md-toast--success { border-color: var(--brand); }
.md-toast--warn { border-color: var(--gold); }

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

/* 桌面预览时的滚动条 */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-thumb { background: #334155; border-radius: 3px; }

/* ===== 悬浮“记录一餐”按钮 ===== */
.md-app { position: relative; }
.md-fab {
  position: absolute;
  right: 16px;
  bottom: 84px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, #34d399, #059669);
  color: #042f2e;
  font-weight: 700;
  font-size: 14px;
  padding: 12px 18px;
  border-radius: 999px;
  box-shadow: 0 8px 22px rgba(16, 185, 129, 0.45);
  z-index: 40;
  transition: transform 0.15s ease;
}
.md-fab:active { transform: scale(0.95); }

/* ===== 训练知识卡片弹窗 ===== */
.md-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.md-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.7);
  backdrop-filter: blur(4px);
}
.md-modal__panel {
  position: relative;
  width: 100%;
  max-width: 22rem;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 20px;
  padding: 20px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  animation: fadeIn 0.25s ease;
}
.train-tip {
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 14px;
  padding: 12px 14px;
  line-height: 1.5;
}
