/* ==========================================================================
   健康减脂 3.0 Web · 今日 / 记一餐 / 记运动 视图样式（views-a.css）

   约定：
   - 只放视图专属的 `view-` / `meal-` / `exercise-` 前缀类，不复写 app.css 的全局组件；
   - 全部颜色/圆角/阴影取自 app.css 的设计 token（自动跟随浅色 / 深色）；
   - 移动优先：默认手机宽度，宽屏由 app.css 的 720px 容器兜底。
   ========================================================================== */

/* ---------- 今日页 ---------- */

.view-today {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.view-today__topline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.view-today__heading {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.view-today__eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--accent);
}

.view-today__date {
  font-size: 22px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: 0.01em;
}

.view-today__ring {
  margin: 6px 0 2px;
}

.view-today__progress {
  text-align: center;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.view-today__goal {
  margin-top: 6px;
  text-align: center;
}

.view-today__hints {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 6px;
}

.view-today__hint {
  text-align: center;
}

.view-today__metrics {
  padding: 12px;
}

.view-today__actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.view-today__actions .btn {
  width: 100%;
  padding-left: 10px;
  padding-right: 10px;
}

.view-today__empty {
  padding: 8px;
}

/* 餐次分组 */
.view-meals {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 8px;
}

.view-meals__group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.view-meals__group-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 0 2px 2px;
}

.view-meals__group-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
}

.view-today__exercises .list {
  margin-top: 2px;
}

/* 步数 / 备注补录 */
.view-today__fill {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.view-today__fill .card__title {
  margin-bottom: 2px;
}

.view-today__field-row {
  align-items: stretch;
}

.view-today__steps-input {
  flex: 1;
  min-width: 0;
}

.view-today__steps-save {
  flex: none;
  min-width: 76px;
}

.view-today__field-actions {
  justify-content: flex-end;
}

.view-today__note-input {
  min-height: 64px;
}

.view-today__formula {
  text-align: center;
  padding: 0 8px 2px;
}

/* ---------- 记一餐 sheet ---------- */

.meal-editor {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.meal-editor__panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.meal-editor__busy {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--text-2);
  font-size: 13px;
}

.meal-editor__busy .spinner {
  flex: none;
}

.meal-editor__photo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.meal-editor__photo-actions .btn {
  flex: 1;
  min-width: 132px;
  padding-left: 8px;
  padding-right: 8px;
}

.meal-editor__preview-wrap {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--sep);
  border-radius: 14px;
  background: var(--inset);
}

.meal-editor__preview {
  width: 100%;
  max-height: 200px;
  object-fit: cover;
}

.meal-editor__preview-wrap .icon-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  background: color-mix(in srgb, var(--card) 82%, transparent);
  color: var(--text);
}

.meal-editor__placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 96px;
  padding: 12px;
  border: 1px dashed var(--sep);
  border-radius: 14px;
  background: var(--bg);
}

.meal-editor__placeholder-icon {
  font-size: 28px;
  line-height: 1;
}

.meal-editor__chips-label {
  margin-top: -2px;
}

.meal-editor__quick .chip-btn {
  min-height: 32px;
  font-size: 12px;
}

.meal-editor__estimate {
  display: flex;
  flex-direction: column;
}

.meal-editor__fields {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.meal-editor__confirm,
.exercise-editor__confirm {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.meal-editor__confirm .inline,
.exercise-editor__confirm .inline {
  justify-content: flex-end;
  gap: 8px;
}

/* ---------- 记运动 sheet ---------- */

.exercise-editor {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.exercise-editor__busy {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--text-2);
  font-size: 13px;
}

.exercise-editor__busy .spinner {
  flex: none;
}

.exercise-editor__presets {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.exercise-quick {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-height: 52px;
  padding: 9px 12px;
  border: 1px solid var(--sep);
  border-radius: 12px;
  background: var(--card);
  color: var(--text);
  text-align: left;
  transition: background 0.12s ease, transform 0.08s ease;
}

.exercise-quick:active {
  transform: scale(0.98);
  background: var(--inset);
}

.exercise-quick__name {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
}

.exercise-quick__meta {
  font-size: 11px;
  color: var(--text-2);
}

.exercise-editor__fields {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* 窄屏（≤380px）下快捷项单列，避免文字挤压 */
@media (max-width: 380px) {
  .exercise-editor__presets {
    grid-template-columns: 1fr;
  }

  .view-today__actions {
    grid-template-columns: 1fr;
  }
}
