/* ============ CookWhat · iOS 26 风格设计系统 ============ */
:root {
  --bg: #F2F4F8;
  --bg-grad-1: #E8EDF6;
  --bg-grad-2: #F6F1EC;
  --card: rgba(255,255,255,0.72);
  --card-solid: #FFFFFF;
  --card-border: rgba(255,255,255,0.85);
  --text: #1B1E28;
  --text-2: #6B7280;
  --text-3: #9CA3AF;
  --accent: #F97A4B;      /* 主色：蜜桃珊瑚 */
  --accent-2: #FBAF7E;
  --accent-deep: #E05E33;
  --green: #34C759;
  --red: #FF3B30;
  --amber: #FF9500;
  --blue: #0A84FF;
  --shadow: 0 8px 28px rgba(31,41,55,0.07);
  --shadow-sm: 0 2px 10px rgba(31,41,55,0.05);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --nav-h: 64px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro SC", "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
  --tap-scale: 0.97;
  --ease: cubic-bezier(0.32, 0.72, 0, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html { font-size: 16px; }
body {
  font-family: var(--font);
  background:
    radial-gradient(1200px 600px at 100% -10%, rgba(255,156,88,0.20), transparent 60%),
    radial-gradient(900px 500px at -10% 20%, rgba(106,160,255,0.16), transparent 55%),
    linear-gradient(160deg, var(--bg-grad-1), var(--bg-grad-2));
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}
#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  position: relative;
  padding-bottom: calc(var(--nav-h) + var(--safe-bottom) + 16px);
  background: transparent;
}

/* ---------- 玻璃面板 ---------- */
.glass {
  background: var(--card);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow);
}

.card {
  background: var(--card);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid rgba(255,255,255,0.9);
  border-radius: var(--radius-xl);
  box-shadow: 0 2px 12px rgba(31,41,55,0.05), 0 1px 2px rgba(31,41,55,0.03);
  padding: 20px;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

/* ---------- 布局 ---------- */
.page {
  padding: calc(var(--safe-top) + 12px) 16px 24px;
  animation: pageIn 0.35s var(--ease);
}
@keyframes pageIn {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 4px 16px;
}
.page-title { font-size: 28px; font-weight: 800; letter-spacing: -0.6px; }
.page-sub { font-size: 14px; color: var(--text-2); margin-top: 2px; }
.back-btn {
  width: 40px; height: 40px; border-radius: 14px;
  background: var(--card); border: 1px solid var(--card-border);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; cursor: pointer; color: var(--text);
  box-shadow: var(--shadow-sm);
}
.icon-btn {
  width: 40px; height: 40px; border-radius: 14px;
  background: var(--card); border: 1px solid var(--card-border);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; cursor: pointer; color: var(--text);
  box-shadow: var(--shadow-sm);
}

/* ---------- 底部导航 ---------- */
.tab-bar {
  position: fixed;
  bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px;
  height: calc(var(--nav-h) + var(--safe-bottom));
  padding: 8px 12px var(--safe-bottom);
  display: flex;
  background: rgba(255,255,255,0.78);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  border-top: 1px solid rgba(255,255,255,0.8);
  box-shadow: 0 -6px 30px rgba(31,41,55,0.08);
  z-index: 50;
}
.tab-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; color: var(--text-3); font-size: 11px; cursor: pointer;
  border-radius: 16px; transition: color 0.2s;
}
.tab-item .tab-ic { font-size: 22px; line-height: 1; transition: transform 0.3s var(--ease); }
.tab-item.active { color: var(--accent); font-weight: 600; }
.tab-item.active .tab-ic { transform: translateY(-2px) scale(1.1); }
.tab-item:active { transform: scale(0.92); }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: none; cursor: pointer; font-family: var(--font);
  font-size: 16px; font-weight: 600; color: #fff;
  background: linear-gradient(160deg, #F9976B, #F27A4F);
  border-radius: 18px; padding: 14px 22px;
  box-shadow: 0 6px 16px rgba(242,122,79,0.22), inset 0 1px 0 rgba(255,255,255,0.25);
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), opacity 0.2s;
  user-select: none;
  letter-spacing: 0.2px;
}
.btn:active { transform: scale(var(--tap-scale)); }
.btn:disabled { opacity: 0.45; box-shadow: none; }
.btn-block { width: 100%; }
.btn-ghost {
  background: var(--card); color: var(--text);
  border: 1px solid var(--card-border); box-shadow: var(--shadow-sm);
}
.btn-ghost:active { background: rgba(255,255,255,0.6); }
.btn-green { background: linear-gradient(135deg, #34D159, #2BB24C); box-shadow: 0 6px 16px rgba(52,199,89,0.18); }
.btn-red { color: #fff; background: linear-gradient(135deg, #FF453A, #E3322A); box-shadow: 0 6px 16px rgba(255,59,48,0.16); }
.btn-sm { padding: 9px 16px; font-size: 14px; border-radius: 14px; }

/* ---------- 输入 ---------- */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 7px; padding-left: 4px; }
.input, .textarea, .select {
  width: 100%; font-family: var(--font); font-size: 16px;
  background: rgba(255,255,255,0.8);
  border: 1.5px solid rgba(255,255,255,0.9);
  border-radius: var(--radius-md); padding: 13px 15px;
  color: var(--text); outline: none;
  box-shadow: inset 0 1px 4px rgba(31,41,55,0.04);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.input:focus, .textarea:focus, .select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(255,107,53,0.14);
}
.textarea { min-height: 88px; resize: vertical; }
.input::placeholder, .textarea::placeholder { color: var(--text-3); }

/* ---------- 标签 ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 7px 13px; border-radius: 999px;
  background: rgba(255,255,255,0.75);
  border: 1px solid var(--card-border);
  color: var(--text-2); font-size: 13px; font-weight: 500;
  cursor: pointer; transition: all 0.2s var(--ease); user-select: none;
}
.chip:active { transform: scale(0.95); }
.chip.selected {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; border-color: transparent;
  box-shadow: 0 3px 10px rgba(242,122,79,0.2);
}
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-sm { padding: 5px 11px; font-size: 12px; }

.tag {
  display: inline-block; padding: 3px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 600;
  background: rgba(249,122,75,0.10); color: var(--accent-deep);
}

/* ---------- 卡片容器 ---------- */
.section-title { font-size: 17px; font-weight: 700; padding: 18px 4px 10px; display: flex; align-items: center; gap: 6px; }
.section-title .sub { font-size: 12px; color: var(--text-3); font-weight: 400; }

/* ---------- 菜品卡 ---------- */
.dish-card {
  display: flex; gap: 14px; align-items: center;
  background: var(--card); backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid rgba(255,255,255,0.9); border-radius: var(--radius-lg);
  padding: 13px; margin-bottom: 12px; cursor: pointer;
  box-shadow: 0 2px 12px rgba(31,41,55,0.05);
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.dish-card:active { transform: scale(0.98); }
.dish-thumb {
  width: 76px; height: 76px; border-radius: 18px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 40px;
  background: linear-gradient(135deg, rgba(249,151,107,0.18), rgba(255,209,102,0.20));
}
.dish-thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: 18px; }
.dish-info { flex: 1; min-width: 0; }
.dish-name { font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.dish-meta { font-size: 12px; color: var(--text-2); margin-top: 4px; display: flex; flex-wrap: wrap; gap: 4px 10px; }
.dish-intro { font-size: 12px; color: var(--text-3); margin-top: 4px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- 列表项 ---------- */
.list-item {
  display: flex; align-items: center; gap: 12px;
  background: var(--card); backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--card-border); border-radius: var(--radius-lg);
  padding: 14px 16px; margin-bottom: 10px;
  box-shadow: var(--shadow-sm);
}
.list-ic {
  width: 44px; height: 44px; border-radius: 14px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 22px;
  background: rgba(255,255,255,0.85);
}
.list-main { flex: 1; min-width: 0; }
.list-title { font-size: 15px; font-weight: 600; }
.list-sub { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.list-arrow { color: var(--text-3); font-size: 14px; }

/* ---------- 空状态 / 加载 / 错误 ---------- */
.empty {
  text-align: center; padding: 60px 24px; color: var(--text-3);
}
.empty .empty-ic { font-size: 60px; margin-bottom: 14px; display: block; }
.empty .empty-title { font-size: 16px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.empty .empty-sub { font-size: 13px; line-height: 1.6; }
.empty .btn { margin-top: 18px; }

.loading { text-align: center; padding: 40px; color: var(--text-2); font-size: 14px; }
.spinner {
  width: 34px; height: 34px; margin: 0 auto 12px; border-radius: 50%;
  border: 3px solid rgba(255,107,53,0.2); border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 模态 ---------- */
.overlay {
  position: fixed; inset: 0; background: rgba(15,18,28,0.4);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  z-index: 100; display: flex; align-items: flex-end; justify-content: center;
  animation: fadeIn 0.25s var(--ease);
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.sheet {
  width: 100%; max-width: 480px; max-height: 86vh; overflow-y: auto;
  background: rgba(250,250,252,0.92);
  backdrop-filter: blur(30px) saturate(180%);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  border-radius: 28px 28px 0 0; padding: 10px 20px calc(20px + var(--safe-bottom));
  animation: sheetUp 0.35s var(--ease);
  box-shadow: 0 -10px 40px rgba(0,0,0,0.15);
}
@keyframes sheetUp { from { transform: translateY(60px); opacity: 0.6; } to { transform: translateY(0); opacity: 1; } }
.sheet-handle { width: 44px; height: 5px; border-radius: 3px; background: rgba(0,0,0,0.12); margin: 8px auto 14px; }
.sheet-title { font-size: 18px; font-weight: 700; text-align: center; margin-bottom: 14px; }

.dialog {
  width: calc(100% - 60px); max-width: 340px; margin: auto;
  background: rgba(250,250,252,0.95);
  backdrop-filter: blur(30px) saturate(180%);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  border-radius: 24px; padding: 22px;
  transform: translateY(-30%); text-align: center;
  animation: dialogIn 0.3s var(--ease);
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
@keyframes dialogIn { from { transform: translateY(-26%) scale(0.94); opacity: 0; } to { transform: translateY(-30%) scale(1); opacity: 1; } }
.dialog-title { font-size: 17px; font-weight: 700; margin-bottom: 8px; }
.dialog-text { font-size: 14px; color: var(--text-2); line-height: 1.6; margin-bottom: 18px; }
.dialog-actions { display: flex; gap: 10px; }
.dialog-actions .btn { flex: 1; }

/* ---------- Toast ---------- */
.toast-wrap { position: fixed; top: calc(var(--safe-top) + 16px); left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  background: rgba(30,32,42,0.9); color: #fff; font-size: 14px;
  padding: 11px 18px; border-radius: 999px; max-width: 80vw;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  animation: toastIn 0.3s var(--ease);
}
@keyframes toastIn { from { transform: translateY(-16px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ---------- 步骤卡片 ---------- */
.step-card {
  background: var(--card); backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid var(--card-border); border-radius: var(--radius-xl);
  padding: 20px; margin-bottom: 16px; box-shadow: var(--shadow);
  position: relative; overflow: hidden;
  transition: all 0.5s var(--ease);
}
.step-card.done { opacity: 0.35; transform: scale(0.96); filter: grayscale(0.4); }
.step-no-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 30px; height: 30px; padding: 0 8px; border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; font-weight: 700; font-size: 14px; margin-right: 8px;
}
.step-title { font-size: 18px; font-weight: 700; display: flex; align-items: center; }
.step-desc { font-size: 15px; line-height: 1.7; margin-top: 10px; color: var(--text); }
.step-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.meta-pill {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; font-weight: 500; color: var(--text-2);
  background: rgba(255,255,255,0.8); border: 1px solid var(--card-border);
  padding: 6px 10px; border-radius: 999px;
}
.meta-pill .dot { width: 6px; height: 6px; border-radius: 50%; }
.step-ingredients { margin-top: 12px; }
.step-ing-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.step-ing-item {
  font-size: 12px; padding: 5px 10px; border-radius: 10px;
  background: rgba(10,132,255,0.1); color: #0A66CC;
}
.step-spice-item {
  font-size: 12px; padding: 5px 10px; border-radius: 10px;
  background: rgba(249,122,75,0.10); color: var(--accent-deep);
  font-weight: 600;
}
.step-tips {
  margin-top: 12px; font-size: 13px; color: var(--text-2);
  background: rgba(255,149,0,0.1); border-radius: 14px; padding: 10px 13px;
  border-left: 3px solid var(--amber);
  line-height: 1.6;
}

/* ---------- 倒计时 ---------- */
.timer-box {
  margin-top: 14px; border-radius: 20px; padding: 16px;
  background: rgba(255,255,255,0.75);
  border: 1px solid var(--card-border);
  text-align: center;
}
.timer-display { font-size: 46px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: 1px; color: var(--text); }
.timer-actions { display: flex; gap: 10px; margin-top: 12px; }
.timer-actions .btn { flex: 1; font-size: 14px; padding: 11px; }
.timer-ringing {
  background: rgba(255,59,48,0.08);
  border: 1.5px solid var(--red);
  animation: pulse 0.9s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,59,48,0.35); }
  50% { box-shadow: 0 0 0 12px rgba(255,59,48,0); }
}

/* ---------- 完成动画 ---------- */
.finish-overlay {
  position: fixed; inset: 0; z-index: 150;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: linear-gradient(160deg, #FFF3E6, #FFE8D6);
  animation: finishBg 0.6s var(--ease);
}
@keyframes finishBg { from { opacity: 0; } to { opacity: 1; } }
.finish-emoji { font-size: 110px; animation: finishPop 0.6s var(--ease); }
@keyframes finishPop {
  0% { transform: scale(0); opacity: 0; }
  60% { transform: scale(1.15); }
  100% { transform: scale(1); opacity: 1; }
}
.finish-title { font-size: 24px; font-weight: 800; margin-top: 20px; animation: fadeUp 0.6s 0.2s both var(--ease); }
.finish-sub { font-size: 14px; color: var(--text-2); margin-top: 8px; animation: fadeUp 0.6s 0.3s both var(--ease); }
.finish-btns { display: flex; gap: 12px; margin-top: 30px; animation: fadeUp 0.6s 0.4s both var(--ease); }
@keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }

/* ---------- 图片/头像 ---------- */
.avatar { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; background: linear-gradient(135deg, #FFB88C, #FF8F5A); display: flex; align-items: center; justify-content: center; font-size: 30px; color: #fff; }
.hero-img { width: 100%; height: 210px; object-fit: cover; border-radius: var(--radius-xl); box-shadow: 0 10px 32px rgba(31,41,55,0.12); }
.hero-wrap { position: relative; }
.hero-wrap::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius-xl); background: linear-gradient(180deg, rgba(0,0,0,0.08), transparent 30%, transparent 70%, rgba(0,0,0,0.10)); pointer-events: none; }

/* ---------- 表单开关 ---------- */
.switch {
  width: 52px; height: 30px; border-radius: 999px; background: rgba(0,0,0,0.12);
  position: relative; cursor: pointer; transition: background 0.25s;
  flex-shrink: 0;
}
.switch::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px;
  border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  transition: transform 0.25s var(--ease);
}
.switch.on { background: var(--green); }
.switch.on::after { transform: translateX(22px); }

/* ---------- 评分 ---------- */
.stars { display: flex; gap: 4px; font-size: 26px; cursor: pointer; justify-content: center; }
.stars span { transition: transform 0.15s; }
.stars span.active { transform: scale(1.15); }

/* ---------- 进度条 ---------- */
.progress-wrap { height: 8px; border-radius: 999px; background: rgba(0,0,0,0.08); overflow: hidden; margin-top: 6px; }
.progress-bar { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width 0.5s var(--ease); }

/* ---------- 隐藏滚动条工具行 ---------- */
.scroll-row { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 8px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.scroll-row::-webkit-scrollbar { display: none; }

/* ---------- 分割线/间距 ---------- */
.divider { height: 1px; background: rgba(0,0,0,0.06); margin: 14px 0; }
.flex { display: flex; align-items: center; gap: 10px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-6 { gap: 6px; } .gap-8 { gap: 8px; } .gap-12 { gap: 12px; }
.mt-4 { margin-top: 4px; } .mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; } .mt-20 { margin-top: 20px; }
.text-sm { font-size: 13px; } .text-xs { font-size: 12px; }
.text-2 { color: var(--text-2); }
.text-center { text-align: center; }
.badge-num {
  min-width: 18px; height: 18px; border-radius: 999px; background: var(--red);
  color: #fff; font-size: 11px; display: inline-flex; align-items: center; justify-content: center; padding: 0 5px;
}

/* 统计卡 */
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat-card { text-align: center; background: var(--card); border: 1px solid var(--card-border); border-radius: var(--radius-lg); padding: 14px 6px; box-shadow: var(--shadow-sm); }
.stat-num { font-size: 22px; font-weight: 800; }
.stat-label { font-size: 11px; color: var(--text-2); margin-top: 2px; }

/* 用色气泡 */
.color-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin-right: 4px; }
.expired { color: var(--red); }
.expiring { color: var(--amber); }

/* 输入组内的图标按钮 */
.inline-add { display: flex; gap: 8px; }
.inline-add .input { flex: 1; }
