/* ============================================
   一口喵饭 - 抽卡式宠物配餐应用 v2.0
   视觉灵感：桃源深处有人家
   色调：浅绿 · 桃粉 · 暖米 · 水墨
   ============================================ */

/* Google Fonts 改为 HTML 中异步加载，避免阻塞渲染 */

:root {
  --primary: #7BAE7F;
  --primary-light: #A3D1A7;
  --primary-dark: #5E9462;
  --primary-bg: #EFF8F0;
  --peach: #E8A0BF;
  --peach-light: #F5D0E0;
  --peach-dark: #C77A9C;
  --peach-bg: #FFF0F5;
  --cream: #FDF6EC;
  --warm-paper: #FBF5EB;
  --warm-beige: #F0E6D3;
  --ink: #3D3929;
  --ink-light: #6B6453;
  --ink-lighter: #9E9685;
  --ink-faint: #C5BFB1;
  --success: #7BAE7F;
  --success-bg: #EFF8F0;
  --warning: #E2A858;
  --warning-bg: #FFF8EC;
  --danger: #D47070;
  --danger-bg: #FFF0F0;
  --info: #7BA8C9;
  --info-bg: #EDF5FB;
  --bg: #F7F3EC;
  --card-bg: #FFFDF9;
  --text: var(--ink);
  --text-secondary: var(--ink-light);
  --text-light: var(--ink-lighter);
  --border: #E8E0D4;
  --radius: 20px;
  --radius-sm: 14px;
  --radius-xs: 8px;
  --shadow: 0 2px 16px rgba(61, 57, 41, 0.06);
  --shadow-lg: 0 8px 32px rgba(61, 57, 41, 0.1);
  --tabbar-h: 64px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  width: 100%; height: 100%; height: 100dvh;
  overflow: hidden;
}

body {
  font-family: 'Noto Serif SC', 'PingFang SC', 'STSong', serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image:
    radial-gradient(ellipse at 20% 50%, rgba(232, 160, 191, 0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(123, 174, 127, 0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 80%, rgba(226, 168, 88, 0.04) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

#app {
  width: 100%; height: 100%;
  position: relative;
  overflow: hidden;
  z-index: 1;
}

/* =================== 登录页 =================== */
.auth-page {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
  background: linear-gradient(160deg, #EFF8F0 0%, #FDF6EC 40%, #FFF0F5 70%, #EDF5FB 100%);
}

.auth-page::before {
  content: '';
  position: absolute;
  top: -10%; right: -10%;
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(232, 160, 191, 0.2) 0%, transparent 70%);
  border-radius: 50%;
  animation: floatSlow 8s ease-in-out infinite;
  will-change: transform;
}

.auth-page::after {
  content: '';
  position: absolute;
  bottom: -5%; left: -5%;
  width: 250px; height: 250px;
  background: radial-gradient(circle, rgba(123, 174, 127, 0.15) 0%, transparent 70%);
  border-radius: 50%;
  animation: floatSlow 10s ease-in-out infinite reverse;
}

@keyframes floatSlow {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(15px, -20px) scale(1.05); }
}

.auth-container {
  width: 100%;
  max-width: 400px;
  position: relative;
  z-index: 2;
}

.auth-logo {
  text-align: center;
  margin-bottom: 28px;
  color: var(--ink);
}

.auth-logo-icon {
  font-size: 72px;
  margin-bottom: 8px;
  filter: drop-shadow(0 4px 12px rgba(232, 160, 191, 0.3));
  animation: catBounce 3s ease-in-out infinite;
}

.auth-logo-img {
  width: 120px;
  height: auto;
  margin-bottom: 8px;
  filter: drop-shadow(0 4px 12px rgba(232, 160, 191, 0.3));
  animation: catBounce 3s ease-in-out infinite;
  object-fit: contain;
}

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

.auth-logo h1 {
  font-family: 'ZCOOL KuaiLe', cursive;
  font-size: 32px;
  font-weight: 700;
  letter-spacing: 4px;
  margin-bottom: 4px;
}

.auth-logo p {
  font-size: 14px;
  color: var(--ink-light);
  letter-spacing: 2px;
}

.auth-card {
  background: rgba(255, 253, 249, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(232, 224, 212, 0.5);
}

.auth-form .form-group { margin-bottom: 16px; }

.auth-tabs {
  display: flex;
  background: var(--warm-beige);
  border-radius: var(--radius-sm);
  padding: 4px;
  margin-bottom: 24px;
}

.auth-tab {
  flex: 1;
  padding: 10px;
  border: none;
  background: transparent;
  font-size: 15px;
  font-weight: 600;
  font-family: 'Noto Serif SC', serif;
  color: var(--text-light);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s;
}

.auth-tab.active {
  background: var(--card-bg);
  color: var(--primary-dark);
  box-shadow: 0 2px 8px rgba(61, 57, 41, 0.06);
}

.input-with-icon { position: relative; }
.input-with-icon .input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 18px;
}
.input-with-icon .form-input { padding-left: 44px; }

.field-hint {
  font-size: 12px;
  margin-top: 6px;
  padding-left: 14px;
  min-height: 0;
  line-height: 1.4;
  transition: all 0.2s ease;
}
.field-hint.error {
  color: #e74c3c;
}
.field-hint.success {
  color: #58a65c;
}

.auth-message {
  margin-top: 12px;
  padding: 10px;
  border-radius: var(--radius-xs);
  font-size: 13px;
  text-align: center;
  display: none;
}

.auth-message.error { display: block; background: var(--danger-bg); color: var(--danger); }
.auth-message.success { display: block; background: var(--success-bg); color: var(--primary-dark); }

/* =================== 主应用容器 =================== */
.app-container {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  overflow: hidden;
}

.pages-wrapper {
  position: absolute;
  top: 0; left: 0; right: 0;
  bottom: var(--tabbar-h);
  overflow: hidden;
}

.page {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0 16px 16px;
  display: none;
}

.page.active { display: block; }

/* =================== 顶部栏 =================== */
.top-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0 4px;
  background: var(--bg);
}

.top-header-left {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex: 1;
}

.greeting-text {
  font-family: 'ZCOOL KuaiLe', cursive;
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
}

/* =================== 宠物选择器（首页顶部） =================== */
.pet-selector-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 4px;
  margin: 2px 0 6px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.pet-selector-row:active .pet-selector-avatar {
  transform: scale(0.95);
}

.pet-selector-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #3a3a3a;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.2s;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.pet-selector-avatar span {
  font-size: 26px;
  line-height: 1;
}

.pet-selector-info {
  flex: 1;
  min-width: 0;
}

.pet-selector-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pet-selector-name {
  font-family: 'ZCOOL KuaiLe', cursive;
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.5px;
}

.pet-selector-arrow {
  font-size: 14px;
  color: var(--ink-light);
  opacity: 0.6;
  transition: transform 0.3s;
  flex-shrink: 0;
}

.pet-selector-row.open .pet-selector-arrow {
  transform: rotate(180deg);
}

.pet-selector-sub {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
  font-size: 13px;
  color: var(--ink-light);
  font-family: 'Noto Serif SC', serif;
}

.pet-selector-dot {
  color: var(--ink-faint);
  font-size: 10px;
}

.pet-selector-goal-dot {
  color: var(--primary);
  font-size: 6px;
  flex-shrink: 0;
  margin-left: 2px;
}

.pet-selector-goal {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--primary);
  font-size: 13px;
  font-weight: 600;
  font-family: 'Noto Serif SC', serif;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: opacity 0.2s;
}

.pet-selector-goal:active {
  opacity: 0.6;
}

.pet-selector-goal-arrow {
  font-size: 10px;
  opacity: 0.7;
}


/* =================== 需求选择浮层 =================== */
.need-sheet-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(61, 57, 41, 0.35);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 200;
  display: none;
  align-items: flex-end;
  justify-content: center;
}

.need-sheet-overlay.show {
  display: flex;
}

.need-sheet {
  background: var(--card-bg);
  border-radius: 24px 24px 0 0;
  width: 100%;
  max-width: 500px;
  padding: 0 0 env(safe-area-inset-bottom, 16px);
  animation: slideUp 0.35s cubic-bezier(0.32, 0.72, 0, 1);
}

.need-sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 12px;
}

.need-sheet-title {
  font-family: 'ZCOOL KuaiLe', cursive;
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
}

.need-sheet-close {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--warm-beige);
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-light);
  transition: background 0.2s;
}
.need-sheet-close:active { background: var(--border); }

.need-sheet-options {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0 16px calc(80px + env(safe-area-inset-bottom, 20px));
  max-height: 65vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: none;
}

.need-sheet-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--card-bg);
  cursor: pointer;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
  text-align: left;
  font-family: 'Noto Serif SC', serif;
}

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

.need-sheet-option.active {
  border-color: var(--primary);
  background: var(--primary-bg);
}

.need-sheet-option-icon {
  font-size: 24px;
  flex-shrink: 0;
}

.need-sheet-option-label {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  display: block;
}

.need-sheet-option-desc {
  font-size: 12px;
  color: var(--ink-lighter);
  display: block;
  margin-top: 2px;
}

/* 兼容旧的顶部样式 */
.greeting-text {
  font-family: 'ZCOOL KuaiLe', cursive;
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
}

.top-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pet-avatar-btn {
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 2.5px solid var(--peach);
  background: var(--peach-bg);
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.25s;
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
  position: relative;
}
.pet-avatar-btn:active { transform: scale(0.92); }

.pet-name-area {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
}

.pet-display-name {
  font-family: 'ZCOOL KuaiLe', cursive;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pet-display-sub {
  font-size: 10px;
  color: var(--ink-lighter);
  letter-spacing: 0.5px;
}

/* =================== 宠物切换浮层（底部弹出） =================== */
.pet-sheet-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(61, 57, 41, 0.35);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: none;
  align-items: flex-end;
  justify-content: center;
  animation: overlayFadeIn 0.2s ease;
}

.pet-sheet-overlay.show {
  display: flex;
}

.pet-sheet {
  width: 100%;
  max-width: 480px;
  max-height: 65vh;
  background: var(--card-bg);
  border-radius: var(--radius) var(--radius) 0 0;
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  animation: sheetSlideUp 0.3s ease;
  overflow: hidden;
}

@keyframes sheetSlideUp {
  from { transform: translateY(100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

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

.pet-sheet-title {
  font-family: 'ZCOOL KuaiLe', cursive;
  font-size: 17px;
  color: var(--ink);
}

.pet-sheet-close {
  width: 30px; height: 30px;
  border-radius: 50%;
  border: none;
  background: var(--warm-beige);
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-light);
  transition: all 0.2s;
}

.pet-sheet-close:active {
  background: var(--border);
}

.pet-sheet-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 16px;
  overflow-y: auto;
  flex: 1;
}

.pet-switch-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid transparent;
  background: transparent;
  cursor: pointer;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
  font-family: 'Noto Serif SC', serif;
  width: 100%;
  text-align: left;
}

.pet-switch-item:active { background: var(--warm-beige); }

.pet-switch-item.active {
  background: var(--peach-bg);
  border-color: var(--peach);
}

.pet-switch-item-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #3a3a3a;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 22px;
}

.pet-switch-item-info {
  flex: 1;
  min-width: 0;
}

.pet-switch-item-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}

.pet-switch-item-detail {
  font-size: 12px;
  color: var(--ink-lighter);
  margin-top: 2px;
}

.pet-switch-item-check {
  font-size: 18px;
  color: var(--peach-dark);
  font-weight: 700;
}

.pet-sheet-footer {
  padding: 12px 16px 20px;
  padding-bottom: calc(12px + var(--safe-bottom));
  border-top: 1px dashed var(--warm-beige);
}

.pet-sheet-add-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 1.5px dashed var(--primary);
  background: transparent;
  color: var(--primary-dark);
  font-size: 14px;
  font-weight: 600;
  font-family: 'Noto Serif SC', serif;
  cursor: pointer;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.pet-sheet-add-btn:active {
  background: var(--primary-bg);
  transform: scale(0.98);
}

/* 宠物切换面板内联添加按钮（无宠物时显示） */
.pet-switch-add-inline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 16px;
  margin-top: 8px;
  border-radius: var(--radius-sm);
  border: 2px dashed var(--primary);
  background: var(--primary-bg);
  color: var(--primary-dark);
  font-size: 15px;
  font-weight: 600;
  font-family: 'Noto Serif SC', serif;
  cursor: pointer;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.pet-switch-add-inline-icon {
  font-size: 18px;
}
.pet-switch-add-inline:active {
  background: var(--peach-bg);
  transform: scale(0.97);
}


/* =================== 诉求标签栏 =================== */
.need-tags-bar {
  margin-bottom: 8px;
  animation: fadeInUp 0.35s ease;
}

.need-tags-label {
  font-size: 12px;
  color: var(--text-light);
  margin-bottom: 6px;
  letter-spacing: 0.5px;
  font-weight: 600;
}

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

.page-top-bar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0 12px;
  background: var(--bg);
}

.page-top-bar h2 {
  font-family: 'ZCOOL KuaiLe', cursive;
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
}



/* =================== 诉求标签 =================== */
.need-tags {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  flex: 1;
  padding: 0;
  margin-bottom: 0;
}

.need-tags::-webkit-scrollbar { display: none; }

.need-tag {
  padding: 3px 8px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: transparent;
  font-size: 11px;
  font-weight: 600;
  font-family: 'Noto Serif SC', serif;
  color: var(--text-light);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}

.need-tag.active {
  border-color: var(--primary);
  background: var(--primary-bg);
  color: var(--primary-dark);
}

.need-tag:active { transform: scale(0.95); }

/* =================== ★ 抽卡区域 =================== */
.card-area {
  perspective: 800px;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
}

.recipe-draw-card {
  width: 100%;
  max-width: 380px;
  aspect-ratio: 3/4;
  max-height: calc(100dvh - 300px);
  position: relative;
  cursor: pointer;
  transform-style: preserve-3d;
  transition: transform 0.7s cubic-bezier(0.34, 1.56, 0.64, 1);
  -webkit-tap-highlight-color: transparent;
}

.recipe-draw-card.flipped {
  transform: rotateY(180deg);
}

.card-front, .card-back {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  border-radius: var(--radius);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  overflow: hidden;
}

/* 卡面 - 正面 */
.card-front {
  background: linear-gradient(145deg, #7BAE7F, #9CC3A0, #A3D1A7);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: white;
  box-shadow: 0 8px 32px rgba(123, 174, 127, 0.3), inset 0 1px 0 rgba(255,255,255,0.2);
}

.card-front-deco {
  position: absolute;
  top: 16px; right: 20px;
  font-size: 28px;
  opacity: 0.3;
  animation: floatSlow 6s ease-in-out infinite;
}

.card-front-paw {
  position: absolute;
  bottom: 50px; left: 20px;
  font-size: 24px;
  opacity: 0.3;
}

.card-front-icon {
  font-size: 56px;
  animation: cardPulse 2s ease-in-out infinite;
}

@keyframes cardPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

.card-front-title {
  font-family: 'ZCOOL KuaiLe', cursive;
  font-size: 24px;
  letter-spacing: 4px;
  text-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.card-front-sub {
  font-size: 13px;
  opacity: 0.85;
  letter-spacing: 2px;
}

.card-front-tip {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  font-size: 13px;
  opacity: 1;
  line-height: 1.6;
  text-align: center;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 0 0 var(--radius) var(--radius);
  padding: 12px 16px;
  letter-spacing: 0.5px;
  color: #FFFFFF;
  font-weight: 500;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* 卡面 - 背面 */
.card-back {
  background: var(--card-bg);
  transform: rotateY(180deg);
  box-shadow: 0 8px 32px rgba(61, 57, 41, 0.12);
  border: 1px solid rgba(232, 224, 212, 0.4);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.card-back-content {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 18px;
}

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

.card-recipe-header {
  text-align: center;
  padding-bottom: 12px;
  border-bottom: 1px dashed var(--warm-beige);
  margin-bottom: 12px;
}

.card-recipe-title {
  font-family: 'ZCOOL KuaiLe', cursive;
  font-size: 18px;
  color: var(--primary-dark);
  margin-bottom: 4px;
}

.card-recipe-subtitle {
  font-size: 12px;
  color: var(--text-light);
}

.card-recipe-tag {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  background: var(--primary-bg);
  color: var(--primary-dark);
  margin-top: 4px;
}

.card-recipe-list {
  list-style: none;
}

.card-recipe-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px dashed rgba(240, 230, 211, 0.6);
  font-size: 13px;
}

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

.card-recipe-item-name {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text);
}

.card-recipe-item-amount {
  font-weight: 700;
  color: var(--primary-dark);
  font-size: 13px;
}

.card-recipe-cal {
  text-align: center;
  font-size: 12px;
  color: var(--text-light);
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--warm-beige);
}

.card-recipe-note {
  margin-top: 8px;
  padding: 8px 10px;
  background: var(--warning-bg);
  border-radius: var(--radius-xs);
  font-size: 11px;
  color: #8B6914;
  line-height: 1.6;
}

/* 卡片内：熟自制/生骨肉 切换 */
.card-type-toggle {
  display: flex;
  background: var(--warm-beige);
  border-radius: 10px;
  padding: 3px;
  margin: 10px 0;
  gap: 0;
}

.card-type-btn {
  flex: 1;
  padding: 6px 8px;
  border: none;
  background: transparent;
  font-size: 12px;
  font-weight: 600;
  font-family: 'Noto Serif SC', serif;
  border-radius: 8px;
  cursor: pointer;
  color: var(--text-light);
  transition: all 0.25s;
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
}

.card-type-btn.active {
  background: var(--card-bg);
  color: var(--primary-dark);
  box-shadow: 0 1px 4px rgba(61, 57, 41, 0.08);
}

.card-type-btn:active { transform: scale(0.97); }

/* 卡片底部：查看完整配餐指南（常驻固定） */
.card-detail-footer {
  flex-shrink: 0;
  border-top: 1px solid var(--border);
}

.card-detail-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 16px 20px;
  border: none;
  border-radius: 0 0 var(--radius) var(--radius);
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.2s;
}

.card-detail-btn:active {
  background: var(--warm-beige);
}

.card-detail-btn .card-detail-text {
  font-size: 15px;
  font-weight: 700;
  font-family: 'Noto Serif SC', serif;
  color: var(--ink);
  letter-spacing: 0.3px;
}

.card-detail-btn .card-detail-arrow {
  font-size: 18px;
  color: var(--ink-light);
  opacity: 0.5;
  transition: transform 0.3s, opacity 0.3s;
}

.card-detail-btn:active .card-detail-arrow {
  transform: translateX(3px);
  opacity: 0.8;
}

/* =================== 食谱卡片底部操作栏 =================== */
.recipe-action-bar {
  flex-shrink: 0;
  display: flex;
  gap: 8px;
  padding: 10px 14px;
  background: var(--card-bg, rgba(255, 253, 249, 0.96));
  border-top: 1px solid var(--border);
}

.action-bar-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 10px;
  border: 1.5px solid var(--border);
  border-radius: 14px;
  background: var(--warm-paper);
  font-size: 14px;
  font-weight: 600;
  font-family: 'Noto Serif SC', serif;
  color: var(--ink);
  cursor: pointer;
  transition: all 0.25s;
  -webkit-tap-highlight-color: transparent;
}

.action-bar-btn:active {
  transform: scale(0.97);
}

.action-bar-icon {
  font-size: 16px;
}

.action-bar-detail {
  background: var(--warm-paper);
  border-color: var(--border);
  color: var(--ink-light);
}

.action-bar-detail:active {
  background: var(--warm-beige);
}

.action-bar-record {
  background: var(--primary, #7BAE7F);
  border-color: var(--primary, #7BAE7F);
  color: white;
  box-shadow: 0 2px 10px rgba(123, 174, 127, 0.25);
}

.action-bar-record:active {
  background: #6A9D6E;
}

.action-bar-record.recorded {
  background: var(--warm-beige, #F0EBDF);
  border-color: var(--border);
  color: var(--ink-light);
  box-shadow: none;
}

.action-bar-record.loading {
  opacity: 0.7;
  pointer-events: none;
}

/* =================== 底部 TabBar =================== */
.tabbar {
  display: flex;
  height: var(--tabbar-h);
  padding-bottom: var(--safe-bottom);
  background: rgba(255, 253, 249, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 50;
}

.tab-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--ink-lighter);
  font-size: 10px;
  transition: all 0.25s;
  -webkit-tap-highlight-color: transparent;
  font-family: 'Noto Serif SC', serif;
}

.tab-item .tab-icon { font-size: 22px; transition: transform 0.25s; }
.tab-item .tab-label { font-weight: 600; letter-spacing: 1px; }

.tab-item.active { color: var(--primary-dark); }
.tab-item.active .tab-icon { transform: scale(1.15) translateY(-2px); }

.tab-item.active::after {
  content: '';
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--peach);
  margin-top: 1px;
}

/* =================== 通用组件 =================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  font-family: 'Noto Serif SC', serif;
  cursor: pointer;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
  letter-spacing: 1px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: white;
  box-shadow: 0 4px 14px rgba(123, 174, 127, 0.3);
}
.btn-primary:active {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  transform: scale(0.98);
}

.btn-secondary { background: var(--warm-beige); color: var(--text); }
.btn-outline { background: transparent; border: 1.5px solid var(--border); color: var(--text-secondary); }
.btn-peach { background: linear-gradient(135deg, var(--peach), var(--peach-light)); color: white; box-shadow: 0 4px 14px rgba(232, 160, 191, 0.3); }
.btn-sm { padding: 7px 14px; font-size: 13px; border-radius: 10px; }
.btn-lg { padding: 14px 24px; font-size: 16px; }
.btn-block { width: 100%; }
.btn-icon { background: transparent; border: none; font-size: 18px; cursor: pointer; padding: 6px; }
.btn:disabled { opacity: 0.5; pointer-events: none; }

.form-input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-family: 'Noto Serif SC', serif;
  background: var(--card-bg);
  color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s;
  -webkit-appearance: none;
}

.form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(123, 174, 127, 0.12);
}

/* 原生 select 隐藏（被自定义组件代理） */
.form-select {
  display: none !important;
}

/* =================== 自定义下拉框 =================== */
.custom-select {
  position: relative;
  width: 100%;
}

.custom-select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-family: 'Noto Serif SC', serif;
  background-color: var(--card-bg);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  min-height: 44px;
  box-sizing: border-box;
}

.custom-select-trigger:active,
.custom-select.open .custom-select-trigger {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(123, 174, 127, 0.12);
}

.custom-select-label {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.custom-select-arrow {
  width: 16px;
  height: 16px;
  margin-left: 8px;
  flex-shrink: 0;
  transition: transform 0.25s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.custom-select-arrow svg {
  width: 12px;
  height: 12px;
}

.custom-select.open .custom-select-arrow {
  transform: rotate(180deg);
}

.custom-select-dropdown {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  background: var(--card-bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.06);
  z-index: 1000;
  max-height: 220px;
  overflow-y: auto;
  opacity: 0;
  transform: translateY(-6px) scale(0.98);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.custom-select.open .custom-select-dropdown {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.custom-select-option {
  display: flex;
  align-items: center;
  padding: 11px 14px;
  font-size: 14px;
  font-family: 'Noto Serif SC', serif;
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s;
  -webkit-tap-highlight-color: transparent;
  border-bottom: 1px solid rgba(0,0,0,0.04);
}

.custom-select-option:last-child {
  border-bottom: none;
}

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

.custom-select-option.selected {
  color: var(--primary-dark);
  font-weight: 600;
}

.custom-select-option.selected::before {
  content: '✓ ';
  margin-right: 2px;
  font-size: 13px;
}

/* 下拉框滚动条 */
.custom-select-dropdown::-webkit-scrollbar { width: 4px; }
.custom-select-dropdown::-webkit-scrollbar-track { background: transparent; }
.custom-select-dropdown::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

/* manage-filter 的下拉框紧凑版 */
.manage-filter + .custom-select,
.manage-filter ~ .custom-select {
  width: auto;
  min-width: 100px;
}

.manage-filter + .custom-select .custom-select-trigger,
.manage-filter ~ .custom-select .custom-select-trigger {
  padding: 8px 10px;
  font-size: 13px;
  min-height: 36px;
}

.manage-filter + .custom-select .custom-select-option,
.manage-filter ~ .custom-select .custom-select-option {
  padding: 9px 10px;
  font-size: 13px;
}

/* manage-filter 类型的自定义 select（通过 data 属性） */
.custom-select[data-compact="true"] .custom-select-trigger {
  padding: 8px 10px;
  font-size: 13px;
  min-height: 36px;
}

.custom-select[data-compact="true"] .custom-select-option {
  padding: 9px 10px;
  font-size: 13px;
}

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

.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.input-unit { display: flex; align-items: center; gap: 0; }
.input-unit .form-input { border-radius: var(--radius-sm) 0 0 var(--radius-sm); border-right: none; }
.input-unit span {
  padding: 12px 14px;
  background: var(--warm-beige);
  border: 1.5px solid var(--border);
  border-left: none;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-secondary);
  font-size: 14px;
  white-space: nowrap;
}

/* =================== 自选配餐页 - 精简顶部 =================== */
.custom-top {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  padding: 14px 0 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.custom-pet-row {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.custom-pet-row:active .custom-pet-avatar {
  transform: scale(0.92);
}

.custom-pet-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  transition: transform 0.2s;
}

.custom-pet-info {
  display: flex;
  align-items: center;
  gap: 4px;
}

.custom-pet-name {
  font-family: 'Noto Serif SC', serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
}

.custom-pet-arrow {
  font-size: 12px;
  color: var(--ink-light);
  opacity: 0.6;
}

.custom-type-toggle {
  display: flex;
  background: var(--warm-beige);
  border-radius: 20px;
  padding: 3px;
  flex-shrink: 0;
}

.custom-type-btn {
  padding: 6px 14px;
  border: none;
  background: transparent;
  font-size: 13px;
  font-weight: 600;
  font-family: 'Noto Serif SC', serif;
  border-radius: 18px;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.25s;
  -webkit-tap-highlight-color: transparent;
}

.custom-type-btn.active {
  background: var(--card-bg);
  color: var(--primary-dark);
  box-shadow: 0 2px 8px rgba(61, 57, 41, 0.08);
}

/* =================== 食材分组收纳区 =================== */
.custom-food-sections {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-bottom: 12px;
}

.food-group {
  background: var(--card-bg);
  border-radius: var(--radius);
  border: 1px solid rgba(232, 224, 212, 0.3);
  padding: 16px;
  box-shadow: 0 2px 8px rgba(61, 57, 41, 0.04);
}

.food-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.food-group-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  font-family: 'Noto Serif SC', serif;
}

.food-group-icon {
  font-size: 16px;
}

.food-group-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  font-family: 'Noto Serif SC', serif;
}

.food-group-badge-required {
  background: rgba(232, 100, 100, 0.12);
  color: #D9534F;
}

.food-group-badge-suggest {
  background: var(--primary-bg);
  color: var(--primary-dark);
}

.food-group-badge-optional {
  background: var(--warm-beige);
  color: var(--ink-light);
}

/* 已选食材标签 */
.food-group-selected {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 0;
}

.food-group-selected:empty {
  display: none;
}

.food-selected-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: var(--warm-paper);
  border: 1.5px solid var(--primary);
  font-size: 14px;
  font-weight: 600;
  font-family: 'Noto Serif SC', serif;
  color: var(--ink);
  animation: tagFadeIn 0.2s ease;
}

@keyframes tagFadeIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

.food-selected-tag .tag-cal {
  font-size: 11px;
  color: var(--ink-light);
  font-weight: 400;
}

.food-selected-tag .tag-remove {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(217, 83, 79, 0.15);
  color: #D9534F;
  border: none;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.2s;
}

.food-selected-tag .tag-remove:active {
  background: rgba(217, 83, 79, 0.35);
}

/* 添加按钮 */
.food-group-add-btn {
  display: block;
  width: 100%;
  padding: 14px;
  margin-top: 8px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--warm-paper);
  font-size: 14px;
  font-weight: 600;
  font-family: 'Noto Serif SC', serif;
  color: var(--primary);
  cursor: pointer;
  text-align: center;
  transition: background 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.food-group-add-btn:active {
  background: var(--warm-beige);
}

.food-group-selected:empty + .food-group-add-btn {
  margin-top: 0;
}

/* 生成按钮 */
.custom-generate-btn {
  margin-top: 8px;
  margin-bottom: 8px;
}

/* =================== 食材选择浮层 =================== */
.food-picker-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.food-picker-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.food-picker-sheet {
  width: 100%;
  max-width: 440px;
  max-height: 70vh;
  background: var(--bg);
  border-radius: 20px 20px 0 0;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
  overflow: hidden; /* 防止子元素溢出 */
}

.food-picker-overlay.show .food-picker-sheet {
  transform: translateY(0);
}

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

/* 食材搜索框 */
.food-picker-search-bar {
  padding: 8px 16px;
  flex-shrink: 0;
  border-bottom: 1px solid var(--border);
}

.food-picker-search-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 14px;
  background: var(--warm-paper, #FAF5EA);
  color: var(--ink, #3E3929);
  outline: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.food-picker-search-input:focus {
  border-color: var(--primary, #7BAE7F);
}

.food-picker-search-input::placeholder {
  color: var(--ink-lighter, #B3A98E);
}

/* 浮层A子分类标签 */
.food-picker-sub-label {
  font-size: 12px;
  color: var(--ink-light, #6B6453);
  font-weight: 600;
  margin: 10px 0 6px;
  padding: 0 4px;
}

.food-picker-title {
  font-family: 'Noto Serif SC', serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
}

.food-picker-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--warm-beige);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-light);
}

.food-picker-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.food-picker-footer {
  flex-shrink: 0;
  padding: 14px 20px;
  padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--border);
  background: var(--bg, #FDF6EC);
}

/* 确认添加按钮 —— 始终用绿色主色调，确保醒目可见 */
.food-picker-confirm-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 100%;
  height: 48px;
  padding: 0 20px;
  border: none;
  border-radius: 14px;
  background: var(--primary, #7BAE7F);
  color: white;
  font-size: 16px;
  font-weight: 700;
  font-family: 'Noto Serif SC', serif;
  cursor: pointer;
  transition: all 0.25s;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 2px 12px rgba(123, 174, 127, 0.3);
}

.food-picker-confirm-btn:active {
  transform: scale(0.97);
  background: #6A9D6E;
}

/* 没有选择任何食材时，按钮稍微弱化但仍可见可点 */
.food-picker-confirm-btn.no-selection {
  background: var(--primary, #7BAE7F);
  opacity: 0.65;
}

.food-picker-confirm-btn.no-selection:active {
  opacity: 0.8;
}

.picker-confirm-count {
  font-weight: 700;
  font-size: 16px;
}

/* =================== 自选食材芯片（浮层内） =================== */
.food-chip-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 4px 0;
}

/* 食材芯片：改为行式布局，名字左对齐、卡路里右对齐 */
.food-chip {
  width: 100%;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  background: var(--card-bg);
  font-size: 13px;
  font-family: 'Noto Serif SC', serif;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: left;
}

.food-chip .chip-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.food-chip .chip-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--ink);
}

.food-chip .chip-cal {
  font-size: 12px;
  opacity: 0.5;
  margin-left: auto;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.food-chip .chip-benefit {
  display: inline-block;
  font-size: 11px;
  color: var(--primary);
  background: rgba(123, 174, 127, 0.1);
  padding: 2px 8px;
  border-radius: 6px;
  line-height: 1.4;
  max-width: fit-content;
}

.food-chip.selected {
  border-color: var(--primary);
  background: var(--primary-bg);
  color: var(--primary-dark);
  box-shadow: 0 2px 8px rgba(123, 174, 127, 0.18);
}

.food-chip.selected .chip-name {
  color: var(--primary-dark);
}

.food-chip.selected .chip-benefit {
  background: rgba(123, 174, 127, 0.2);
  color: var(--primary-dark);
}

.food-chip:active { transform: scale(0.97); }

.recipe-content { padding-bottom: 20px; }
.recipe-result { margin-top: 20px; }

/* =================== 配方卡片（完整方案用） =================== */
.recipe-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
  border: 1px solid rgba(232, 224, 212, 0.3);
}

.recipe-card-header {
  background: linear-gradient(135deg, var(--primary), #9CC3A0);
  color: white;
  padding: 18px;
  position: relative;
  overflow: hidden;
}

.recipe-card-header::after {
  content: '🍃';
  position: absolute;
  top: -5px; right: 12px;
  font-size: 32px;
  opacity: 0.2;
}

.recipe-card-header h3 { font-size: 16px; margin-bottom: 4px; font-family: 'ZCOOL KuaiLe', cursive; }
.recipe-card-header p { font-size: 12px; opacity: 0.9; }
.recipe-template-name { font-size: 14px !important; font-weight: 600; opacity: 1 !important; margin: 6px 0 2px; }
.recipe-template-desc { font-size: 12px; opacity: 0.85; margin-bottom: 4px; }

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

.recipe-section { margin-bottom: 16px; }
.recipe-section:last-child { margin-bottom: 0; }
.recipe-section h4 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--ink);
}

.ingredient-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px dashed var(--warm-beige);
  font-size: 14px;
}

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

.ingredient-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.ingredient-name { color: var(--text); white-space: nowrap; }

.ingredient-benefit {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 10px;
  font-size: 11px;
  color: var(--primary-dark);
  background: rgba(107, 142, 35, 0.1);
  white-space: nowrap;
  line-height: 1.6;
  flex-shrink: 0;
}

.ingredient-amount { color: var(--primary-dark); font-weight: 700; text-align: right; white-space: nowrap; margin-left: 10px; flex-shrink: 0; }
.ingredient-cook-note { font-size: 12px; color: var(--text-secondary); padding: 2px 0 6px 28px; opacity: 0.8; }

.recipe-note {
  background: var(--warning-bg);
  border-radius: var(--radius-xs);
  padding: 12px;
  font-size: 13px;
  color: #8B6914;
  line-height: 1.8;
  border: 1px solid rgba(226, 168, 88, 0.15);
}

.supplement-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 0;
  font-size: 13px;
  border-bottom: 1px dashed var(--warm-beige);
}
.supplement-item:last-child { border-bottom: none; }

.recipe-special-note {
  background: var(--danger-bg);
  border: 1px solid rgba(212, 112, 112, 0.2);
  border-radius: var(--radius-xs);
  padding: 12px 14px;
  font-size: 13px;
  color: #B44040;
  line-height: 1.8;
  margin-bottom: 12px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.recipe-special-note .note-icon { font-size: 18px; flex-shrink: 0; }

.recipe-tag-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(255,255,255,0.25);
  color: white;
  margin-left: 6px;
  vertical-align: middle;
}

/* =================== 日历 =================== */
.calendar-content { padding-bottom: 20px; }

.mini-calendar {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
  border: 1px solid rgba(232, 224, 212, 0.3);
}

.cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  font-size: 16px;
  font-weight: 700;
  font-family: 'ZCOOL KuaiLe', cursive;
  color: var(--ink);
  letter-spacing: 2px;
}

.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 12px;
  color: var(--text-light);
  margin-bottom: 8px;
  font-weight: 600;
}

.cal-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.cal-day {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 14px;
  cursor: pointer;
  position: relative;
  border: none;
  background: transparent;
  -webkit-tap-highlight-color: transparent;
  font-family: 'Noto Serif SC', serif;
  font-weight: 500;
  color: var(--ink);
  transition: all 0.2s;
}

.cal-day:active { background: var(--warm-beige); }
.cal-day.today { font-weight: 700; color: var(--primary-dark); background: var(--primary-bg); }
.cal-day.selected { background: linear-gradient(135deg, var(--primary), var(--primary-light)); color: white; box-shadow: 0 3px 10px rgba(123, 174, 127, 0.3); }
.cal-day.has-meal::after { content: ''; position: absolute; bottom: 3px; width: 5px; height: 5px; border-radius: 50%; background: var(--peach); }
.cal-day.selected.has-meal::after { background: white; }
.cal-day.other-month { color: var(--ink-faint); opacity: 0.4; }

.day-detail {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(232, 224, 212, 0.3);
}

.day-detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.day-detail-head h3 {
  font-size: 15px;
  font-weight: 700;
  font-family: 'ZCOOL KuaiLe', cursive;
}

.day-btns { display: flex; gap: 8px; }
.day-meals-list .meal-card { box-shadow: none; border: 1px solid var(--border); }

.meal-card {
  background: var(--card-bg);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-bottom: 8px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid rgba(232, 224, 212, 0.3);
  transition: transform 0.15s;
}
.meal-card:active { transform: scale(0.99); }

.meal-card-icon { font-size: 26px; }
.meal-card-content { flex: 1; }
.meal-card-title { font-size: 14px; font-weight: 600; }
.meal-card-sub { font-size: 12px; color: var(--text-secondary); }
.meal-card-pet { font-size: 12px; color: var(--primary-dark); font-weight: 600; }

.meal-delete-btn {
  background: none;
  border: none;
  font-size: 16px;
  cursor: pointer;
  padding: 4px;
  opacity: 0.4;
  transition: opacity 0.2s;
}
.meal-delete-btn:active { opacity: 0.8; }

.empty-hint {
  text-align: center;
  padding: 24px 16px;
  color: var(--text-light);
  font-size: 14px;
}

/* =================== 营养分析（内嵌在日历页） =================== */
.analysis-section {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 2px dashed var(--warm-beige);
}

/* 营养分析 - 控制区胶囊容器 */
.analysis-controls-capsule {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: 0 2px 12px rgba(61, 57, 41, 0.06);
  border: 1px solid var(--warm-beige);
}

/* 营养分析 - 胶囊宠物选择器 */
.analysis-pet-capsule {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: var(--warm-paper);
  border: 1.5px solid var(--warm-beige);
  border-radius: 40px;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 12px;
  -webkit-tap-highlight-color: transparent;
}
.analysis-pet-capsule:active {
  transform: scale(0.98);
  background: var(--primary-bg);
}
.analysis-pet-avatar {
  font-size: 22px;
  flex-shrink: 0;
}
.analysis-pet-name {
  flex: 1;
  font-size: 15px;
  font-weight: 700;
  font-family: 'ZCOOL KuaiLe', cursive;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.analysis-pet-arrow {
  font-size: 14px;
  color: var(--text-secondary);
  flex-shrink: 0;
}
.analysis-range-tabs {
  margin-bottom: 12px;
}
.analysis-action-btn {
  margin-bottom: 0;
}

/* 营养分析宠物选择抽屉 */
.analysis-pet-sheet-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(61, 57, 41, 0.35);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
}
.analysis-pet-sheet-overlay.show {
  opacity: 1;
  visibility: visible;
}
.analysis-pet-sheet-overlay .pet-sheet {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: var(--card-bg);
  border-radius: 20px 20px 0 0;
  padding-bottom: calc(16px + var(--safe-bottom));
  max-height: 60vh;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: 0 -4px 24px rgba(61, 57, 41, 0.12);
}
.analysis-pet-sheet-overlay.show .pet-sheet {
  transform: translateY(0);
}

/* 分析标准抽屉 */
.analysis-standards-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(61, 57, 41, 0.5);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.analysis-standards-overlay.show {
  opacity: 1;
  visibility: visible;
}
.analysis-standards-sheet {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: var(--card-bg);
  border-radius: 20px 20px 0 0;
  padding-bottom: calc(20px + var(--safe-bottom));
  max-height: 70vh;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: 0 -4px 24px rgba(61, 57, 41, 0.15);
}
.analysis-standards-overlay.show .analysis-standards-sheet {
  transform: translateY(0);
}
.analysis-standards-body {
  padding: 0 16px 16px;
}
.standards-section {
  margin-bottom: 16px;
}
.standards-section h4 {
  font-size: 15px;
  font-weight: 700;
  font-family: 'ZCOOL KuaiLe', cursive;
  color: var(--ink);
  margin-bottom: 8px;
}
.standards-section p {
  font-size: 13px;
  line-height: 1.8;
  color: var(--ink-light);
}
.standards-section strong {
  color: var(--primary-dark);
}
.standards-section ul {
  margin: 6px 0 0 16px;
  padding: 0;
  font-size: 13px;
  line-height: 1.8;
  color: var(--ink-light);
}
.standards-section ul li {
  margin-bottom: 4px;
  list-style: disc;
}
.standards-warning {
  background: rgba(245, 158, 11, 0.08);
  border-radius: 12px;
  padding: 14px;
  border-left: 3px solid var(--warning);
}
.standards-warning p {
  margin: 0;
}

/* 仪表盘 + 指标摘要布局 */
.analysis-dashboard {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 8px 0;
}
.dashboard-indicators-left,
.dashboard-indicators-right {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  min-width: 0;
}
.dashboard-indicator {
  background: rgba(123, 174, 127, 0.06);
  border: 1px solid rgba(123, 174, 127, 0.12);
  border-radius: 10px;
  padding: 8px 10px;
  text-align: center;
}
.dashboard-indicator-name {
  font-size: 11px;
  color: var(--text-secondary);
  margin-bottom: 3px;
  font-family: 'Noto Serif SC', serif;
}
.dashboard-indicator-value {
  font-size: 16px;
  font-weight: 700;
  font-family: 'ZCOOL KuaiLe', cursive;
}
.dashboard-indicator-status {
  font-size: 10px;
  margin-top: 2px;
  font-family: 'Noto Serif SC', serif;
  color: var(--text-secondary) !important;
}
.dashboard-score-center {
  flex-shrink: 0;
  text-align: center;
}
.dashboard-score-label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
}
.score-ring-large {
  width: 120px; height: 120px;
  position: relative;
}
.score-ring-large svg { transform: rotate(-90deg); width: 120px; height: 120px; }
.score-ring-large .score-ring-bg { fill: none; stroke: var(--warm-beige); stroke-width: 7; }
.score-ring-large .score-ring-fill { fill: none; stroke-width: 7; stroke-linecap: round; transition: stroke-dashoffset 1s cubic-bezier(0.22, 1, 0.36, 1); }
.score-ring-large .score-value-main {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -55%);
  font-size: 36px;
  font-weight: 700;
  font-family: 'ZCOOL KuaiLe', cursive;
  color: var(--primary-dark);
  line-height: 1;
}
.score-ring-large .score-value-sub {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, 55%);
  font-size: 12px;
  color: var(--text-secondary);
}

/* 分析底部标准入口 */
.analysis-standards-entry {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 12px 10px 4px;
  margin-top: 12px;
  border-top: 1px dashed var(--warm-beige);
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.analysis-standards-entry:active {
  color: var(--primary-dark);
}
.analysis-summary-text {
  font-size: 13px;
  color: var(--text-secondary);
  text-align: center;
  margin-top: 8px;
  margin-bottom: 4px;
}

/* 数字滚动动画 */
@keyframes countUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.animate-number {
  animation: countUp 0.4s ease-out;
}

/* =================== 我的页面 =================== */
.profile-content { padding-bottom: 20px; }

.profile-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  border-radius: var(--radius);
  color: white;
  margin-bottom: 20px;
  box-shadow: 0 4px 20px rgba(123, 174, 127, 0.3);
}

.profile-avatar {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  flex-shrink: 0;
}

.profile-info { flex: 1; min-width: 0; }

.profile-name {
  font-family: 'ZCOOL KuaiLe', cursive;
  font-size: 20px;
  font-weight: 700;
}

.profile-sub {
  font-size: 12px;
  opacity: 0.85;
  letter-spacing: 1px;
}

.profile-section {
  margin-bottom: 20px;
}

.profile-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.profile-section h3 {
  font-family: 'ZCOOL KuaiLe', cursive;
  font-size: 16px;
  color: var(--ink);
  margin-bottom: 10px;
}

.profile-section-head h3 {
  margin-bottom: 0;
}

.profile-pets-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.profile-pet-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: var(--card-bg);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(232, 224, 212, 0.3);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.profile-pet-card:active { transform: scale(0.98); }

.profile-pet-avatar {
  font-size: 32px;
  flex-shrink: 0;
}

.profile-pet-info { flex: 1; min-width: 0; }

.profile-pet-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}

.profile-pet-detail {
  font-size: 12px;
  color: var(--ink-lighter);
}

.profile-pet-edit {
  font-size: 14px;
  color: var(--ink-faint);
}

.profile-menu {
  display: flex;
  flex-direction: column;
  background: var(--card-bg);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(232, 224, 212, 0.3);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.profile-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  font-family: 'Noto Serif SC', serif;
  color: var(--text-secondary);
  -webkit-tap-highlight-color: transparent;
  transition: background 0.2s;
}

.profile-menu-item:not(:last-child) {
  border-bottom: 1px solid var(--border);
}

.profile-menu-item:active { background: var(--warm-beige); }

.profile-menu-item .menu-arrow {
  margin-left: auto;
  color: var(--ink-faint);
  font-size: 18px;
}

.profile-menu-danger { color: var(--danger) !important; }

.analysis-content { padding-bottom: 20px; }

.range-tabs {
  display: flex;
  background: var(--warm-beige);
  border-radius: var(--radius-sm);
  padding: 4px;
}

.range-tab {
  flex: 1;
  padding: 8px;
  border: none;
  background: transparent;
  font-size: 13px;
  font-weight: 600;
  font-family: 'Noto Serif SC', serif;
  border-radius: 10px;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.25s;
}

.range-tab.active {
  background: var(--card-bg);
  color: var(--primary-dark);
  box-shadow: 0 2px 6px rgba(61, 57, 41, 0.06);
}

.analysis-result { margin-top: 20px; }

.analysis-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
  border: 1px solid rgba(232, 224, 212, 0.3);
}

.analysis-card h3 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 14px;
  font-family: 'ZCOOL KuaiLe', cursive;
  color: var(--ink);
}

.nutrient-bar-group { margin-bottom: 14px; }
.nutrient-bar-label { display: flex; justify-content: space-between; align-items: center; font-size: 13px; margin-bottom: 5px; }
.nutrient-bar-label > span:first-child { flex-shrink: 0; }
.nutrient-bar-right { display: flex; align-items: center; gap: 6px; }
.nutrient-bar-marker-label {
  font-size: 10px;
  color: #C8A96E;
  font-weight: 600;
  opacity: 0.8;
}
.nutrient-bar-values {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  min-width: 80px;
  text-align: right;
}
.nutrient-bar-pct {
  font-size: 12px;
  font-weight: 700;
  padding: 1px 8px;
  border-radius: 10px;
  background: rgba(0,0,0,0.05);
  white-space: nowrap;
  min-width: 48px;
  text-align: right;
  display: inline-block;
}

.nutrient-bar-container { position: relative; }
.nutrient-bar { height: 10px; background: var(--warm-beige); border-radius: 5px; overflow: visible; position: relative; }
.nutrient-bar-fill { height: 100%; border-radius: 5px; transition: width 0.6s ease; position: relative; z-index: 1; }

/* 100% 标记线 */
.nutrient-bar-100-marker {
  position: absolute;
  top: -2px; bottom: -2px;
  width: 2px;
  background: #C8A96E;
  opacity: 0.7;
  z-index: 3;
  pointer-events: none;
  border-radius: 1px;
}

/* 四级颜色：绿=达标 橙=偏高 红=严重超标 蓝=不足 */
.bar-good { background: linear-gradient(90deg, var(--primary), var(--primary-light)); }
.bar-insufficient { background: linear-gradient(90deg, #3B82F6, #60A5FA); }
.bar-high { background: linear-gradient(90deg, #F59E0B, #FBBF24); }
.bar-excess { background: linear-gradient(90deg, var(--danger), #E89090); }
.bar-ok { background: linear-gradient(90deg, var(--info), #9CC5E0); }

/* 百分比文字颜色 */
.pct-good { color: var(--primary-dark); font-weight: 600; }
.pct-low { color: #3B82F6; font-weight: 600; }
.pct-high { color: #F59E0B; font-weight: 600; }
.pct-excess { color: var(--danger); font-weight: 600; }

/* 指标颜色 */
.indicator-good { color: #22C55E; }
.indicator-low { color: #3B82F6; }
.indicator-high { color: #F59E0B; }
.indicator-excess { color: #EF4444; }

/* ===== 调整建议三级模块 ===== */
.advice-group-header {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  font-family: 'ZCOOL KuaiLe', cursive;
  margin: 14px 0 8px;
}
.advice-group-header:first-child { margin-top: 4px; }
.advice-header-critical { background: rgba(239, 68, 68, 0.1); color: #EF4444; }
.advice-header-warning { background: rgba(245, 158, 11, 0.1); color: #D97706; }
.advice-header-supplement { background: rgba(99, 102, 241, 0.1); color: #6366F1; }

.advice-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 4px;
}
.advice-critical .advice-item {
  border-left: 3px solid #EF4444;
  background: rgba(239, 68, 68, 0.04);
}
.advice-warning .advice-item {
  border-left: 3px solid #F59E0B;
  background: rgba(245, 158, 11, 0.04);
}
.advice-supplement .advice-item {
  border-left: 3px solid #6366F1;
  background: rgba(99, 102, 241, 0.04);
}
.advice-success .advice-item {
  border-left: 3px solid #22C55E;
  background: rgba(34, 197, 94, 0.06);
}
.advice-item {
  padding: 10px 12px;
  border-radius: 0 10px 10px 0;
}
.advice-item-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}
.advice-icon { font-size: 16px; flex-shrink: 0; }
.advice-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  flex: 1;
}
.advice-pct {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 10px;
  background: rgba(0,0,0,0.06);
  font-weight: 600;
  flex-shrink: 0;
}
.advice-text {
  font-size: 13px;
  line-height: 1.7;
  color: var(--ink-light);
  padding-left: 22px;
}

/* 分析标准说明 / 免责声明 */
.analysis-disclaimer .disclaimer-content {
  font-size: 12px;
  line-height: 1.8;
  color: var(--ink);
  opacity: 0.75;
}
.analysis-disclaimer .disclaimer-content p {
  margin: 6px 0;
}
.analysis-disclaimer .disclaimer-content ul {
  margin: 4px 0 8px 16px;
  padding: 0;
}
.analysis-disclaimer .disclaimer-content ul li {
  margin-bottom: 4px;
  list-style: disc;
}
.analysis-disclaimer .disclaimer-content em {
  font-style: normal;
  color: var(--primary);
  font-weight: 600;
}
.analysis-disclaimer .disclaimer-warning {
  margin-top: 10px;
  padding: 8px 12px;
  background: rgba(245, 158, 11, 0.08);
  border-radius: 8px;
  border-left: 3px solid var(--warning);
  font-size: 11.5px;
  opacity: 1;
}

.score-ring {
  width: 110px; height: 110px;
  margin: 0 auto 12px;
  position: relative;
}

.score-ring svg { transform: rotate(-90deg); }
.score-ring-bg { fill: none; stroke: var(--warm-beige); stroke-width: 8; }
.score-ring-fill { fill: none; stroke-width: 8; stroke-linecap: round; transition: stroke-dashoffset 0.8s ease; }
.score-value {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-size: 28px;
  font-weight: 700;
  font-family: 'ZCOOL KuaiLe', cursive;
  color: var(--primary-dark);
}

/* =================== 弹窗 =================== */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(61, 57, 41, 0.35);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 200;
  display: none;
  align-items: flex-end;
  justify-content: center;
}

.modal-overlay.show { display: flex; }

.modal-sheet {
  background: var(--card-bg);
  border-radius: 24px 24px 0 0;
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  animation: slideUp 0.35s cubic-bezier(0.32, 0.72, 0, 1);
}

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

.modal-handle { width: 40px; height: 4px; background: var(--warm-beige); border-radius: 2px; margin: 14px auto 0; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 0;
}

.modal-header h2 {
  font-size: 18px;
  font-family: 'ZCOOL KuaiLe', cursive;
  color: var(--ink);
}

.modal-close {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: none;
  background: var(--warm-beige);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-light);
  transition: background 0.2s;
}
.modal-close:active { background: var(--border); }

.modal-body { padding: 16px 20px; }
.modal-footer { padding: 0 20px 20px; }
.modal-sheet-tall { max-height: 95vh; }

/* =================== 自选配餐弹窗 =================== */
.custom-recipe-sheet {
  display: flex;
  flex-direction: column;
  overflow: hidden; /* 覆盖 modal-sheet 的 overflow-y:auto，使 footer 常驻底部 */
}
.custom-recipe-sheet .modal-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 8px;
}
.custom-recipe-sheet .modal-header {
  flex-shrink: 0;
}

/* 食谱名称 */
.custom-recipe-name {
  font-size: 18px;
  font-weight: 700;
  font-family: 'ZCOOL KuaiLe', cursive;
  color: var(--primary-dark, #5A8F5E);
  text-align: center;
  margin: 4px 0 12px;
  line-height: 1.5;
}
.custom-recipe-name .recipe-name-emoji {
  font-size: 20px;
}

/* 底部常驻操作栏 */
.custom-recipe-action-bar {
  flex-shrink: 0;
  display: flex;
  gap: 10px;
  padding: 12px 20px;
  padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--border);
  background: var(--card-bg, #FFFDF9);
}
.custom-action-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 13px 10px;
  border: 1.5px solid var(--border);
  border-radius: 14px;
  font-size: 14px;
  font-weight: 600;
  font-family: 'Noto Serif SC', serif;
  cursor: pointer;
  transition: all 0.25s;
  -webkit-tap-highlight-color: transparent;
}
.custom-action-btn:active {
  transform: scale(0.97);
}
.custom-action-icon {
  font-size: 16px;
}
.custom-action-save {
  background: var(--warm-paper, #FAF5EA);
  color: var(--ink, #3E3A32);
}
.custom-action-save:active {
  background: var(--warm-beige, #F0EBDF);
}
.custom-action-save.saved {
  background: var(--peach-bg, #FFF1F4);
  border-color: var(--peach, #E8A0BF);
  color: var(--peach-dark, #C77A9E);
}
.custom-action-record {
  background: var(--primary, #7BAE7F);
  border-color: var(--primary, #7BAE7F);
  color: white;
  box-shadow: 0 2px 10px rgba(123, 174, 127, 0.25);
}
.custom-action-record:active {
  background: #6A9D6E;
}
.custom-action-record.recorded {
  background: var(--warm-beige, #F0EBDF);
  border-color: var(--border);
  color: var(--ink-light, #6B6453);
  box-shadow: none;
}
.custom-action-record.loading {
  opacity: 0.7;
  pointer-events: none;
}

/* =================== 煮饭动画 =================== */
.cooking-animation-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(61, 57, 41, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.cooking-animation-overlay.show {
  display: flex;
}
.cooking-animation-content {
  text-align: center;
  animation: cookingBounceIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes cookingBounceIn {
  from { transform: scale(0.7); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.cooking-pot {
  position: relative;
  margin-bottom: 16px;
}
.pot-body {
  font-size: 72px;
  animation: potWobble 0.8s ease-in-out infinite alternate;
}
@keyframes potWobble {
  0% { transform: rotate(-3deg) scale(1); }
  50% { transform: rotate(2deg) scale(1.05); }
  100% { transform: rotate(-3deg) scale(1); }
}
.pot-steam {
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
}
.steam {
  font-size: 18px;
  color: rgba(255, 255, 255, 0.7);
  animation: steamRise 1.2s ease-out infinite;
}
.steam.s1 { animation-delay: 0s; }
.steam.s2 { animation-delay: 0.4s; }
.steam.s3 { animation-delay: 0.8s; }
@keyframes steamRise {
  0% { transform: translateY(0) scale(0.8); opacity: 0; }
  30% { opacity: 0.8; }
  100% { transform: translateY(-24px) scale(1.3); opacity: 0; }
}
.pot-ingredients {
  position: absolute;
  top: -30px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 4px;
  font-size: 20px;
}
.pot-ingredients span {
  animation: ingredientDrop 0.6s ease-in forwards;
  opacity: 0;
}
@keyframes ingredientDrop {
  0% { transform: translateY(-40px); opacity: 0; }
  60% { opacity: 1; }
  100% { transform: translateY(10px); opacity: 0; }
}
.cooking-text {
  font-size: 16px;
  font-weight: 700;
  font-family: 'ZCOOL KuaiLe', cursive;
  color: white;
  margin-bottom: 12px;
  text-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.cooking-dots {
  display: flex;
  gap: 6px;
  justify-content: center;
}
.cooking-dots .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.8);
  animation: dotPulse 1.2s ease-in-out infinite;
}
.cooking-dots .dot:nth-child(2) { animation-delay: 0.2s; }
.cooking-dots .dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes dotPulse {
  0%, 100% { transform: scale(0.6); opacity: 0.4; }
  50% { transform: scale(1.2); opacity: 1; }
}

/* Radio pills */
.radio-pills { display: flex; gap: 10px; }
.pill {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.25s;
  font-size: 15px;
  font-family: 'Noto Serif SC', serif;
  background: var(--card-bg);
}
.pill input { display: none; }
.pill.active, .pill:has(input:checked) {
  border-color: var(--primary);
  background: var(--primary-bg);
  color: var(--primary-dark);
}

.avatar-picker { display: flex; gap: 10px; flex-wrap: wrap; }

.av {
  width: 46px; height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  border: 2px solid transparent;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.25s;
  background: var(--warm-paper);
}

.av.selected {
  border-color: var(--peach);
  background: var(--peach-bg);
  box-shadow: 0 3px 10px rgba(232, 160, 191, 0.2);
}

/* =================== 食材行 =================== */
.ingredient-input-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.ingredient-input-row .form-input:first-child { flex: 1; }
.ingredient-input-row .form-input:nth-child(2) { width: 70px; flex-shrink: 0; }

.ingredient-remove {
  width: 30px; height: 30px;
  border-radius: 50%;
  border: none;
  background: var(--danger-bg);
  color: var(--danger);
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.2s;
}
.ingredient-remove:active { transform: scale(1.1); }

/* =================== 饮食记录 - 食材展示 & 选择按钮 =================== */
.meal-ingredients-display {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 36px;
  margin-bottom: 10px;
}
.meal-ingredients-display:empty::after {
  content: '点击下方按钮添加食材或导入食谱';
  color: var(--ink-light, #6B6453);
  font-size: 13px;
  opacity: 0.6;
  padding: 8px 0;
}
.meal-ing-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  background: var(--warm-paper, #FAF5EA);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 13px;
  color: var(--ink);
  transition: all 0.2s;
}
.meal-ing-tag .ing-tag-name { font-weight: 600; }
.meal-ing-tag .ing-tag-amount {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}
.meal-ing-tag .ing-tag-amount input {
  width: 42px;
  padding: 1px 4px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12px;
  text-align: center;
  background: transparent;
  color: var(--ink);
  -webkit-appearance: none;
}
.meal-ing-tag .ing-tag-amount input:focus {
  border-color: var(--primary);
  outline: none;
}
.meal-ing-tag .ing-tag-unit { font-size: 11px; color: var(--ink-light); }
.meal-ing-tag .ing-tag-remove {
  width: 18px; height: 18px;
  border: none; border-radius: 50%;
  background: rgba(200, 80, 80, 0.12);
  color: #C85050;
  font-size: 11px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}
.meal-add-btns {
  display: flex;
  gap: 8px;
}
.meal-add-btns .btn {
  flex: 1;
  font-size: 13px;
}

/* =================== 食材分类选择浮层（左右结构） =================== */
.meal-food-picker-sheet {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.meal-food-picker-body {
  flex: 1;
  display: flex;
  overflow: hidden;
}
.food-picker-left {
  width: 90px;
  flex-shrink: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  border-right: 1px solid var(--border);
  background: var(--warm-paper, #FAF5EA);
}
.food-picker-cat-item {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 12px 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-light, #6B6453);
  border-left: 3px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.food-picker-cat-item.active {
  background: var(--card-bg, #FFFDF9);
  color: var(--primary-dark, #5A8F5E);
  border-left-color: var(--primary, #7BAE7F);
  font-weight: 700;
}
.food-picker-cat-item .cat-icon { font-size: 16px; }
.food-picker-right {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 10px 12px;
}
.food-picker-food-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 8px;
  border-bottom: 1px solid rgba(0,0,0,0.04);
  cursor: pointer;
  transition: background 0.15s;
  -webkit-tap-highlight-color: transparent;
  border-radius: 8px;
}
.food-picker-food-item:active { background: rgba(123, 174, 127, 0.08); }
.food-picker-food-item.selected {
  background: rgba(123, 174, 127, 0.1);
}
.food-picker-food-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.food-picker-food-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}
.food-picker-food-detail {
  font-size: 11px;
  color: var(--ink-light);
}
.food-picker-food-check {
  width: 22px; height: 22px;
  border: 2px solid var(--border);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  transition: all 0.2s;
  flex-shrink: 0;
}
.food-picker-food-item.selected .food-picker-food-check {
  background: var(--primary, #7BAE7F);
  border-color: var(--primary, #7BAE7F);
  color: white;
}
.meal-food-picker-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
}
.food-picker-selected-count {
  font-size: 13px;
  color: var(--ink-light);
  font-weight: 600;
}

/* =================== 导入收藏食谱列表 =================== */
.import-recipe-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(0,0,0,0.05);
  cursor: pointer;
  transition: background 0.15s;
  -webkit-tap-highlight-color: transparent;
  border-radius: 8px;
  padding-left: 8px;
  padding-right: 8px;
}
.import-recipe-item:active { background: rgba(123, 174, 127, 0.08); }
.import-recipe-item-avatar { font-size: 24px; flex-shrink: 0; }
.import-recipe-item-info { flex: 1; min-width: 0; }
.import-recipe-item-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.import-recipe-item-meta {
  font-size: 12px;
  color: var(--ink-light);
  margin-top: 2px;
}
.import-recipe-item-arrow {
  font-size: 14px;
  color: var(--ink-light);
  opacity: 0.5;
  flex-shrink: 0;
}

/* =================== 内容管理 =================== */
.manage-content { padding-bottom: 20px; }

.manage-tabs {
  display: flex;
  background: var(--warm-beige);
  border-radius: var(--radius-sm);
  padding: 4px;
  margin-bottom: 16px;
}

.manage-tab {
  flex: 1;
  padding: 10px 8px;
  border: none;
  background: transparent;
  font-size: 13px;
  font-weight: 600;
  font-family: 'Noto Serif SC', serif;
  border-radius: 10px;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.25s;
  white-space: nowrap;
}

.manage-tab.active {
  background: var(--card-bg);
  color: var(--primary-dark);
  box-shadow: 0 2px 6px rgba(61, 57, 41, 0.06);
}

.manage-panel { display: none; }
.manage-panel.active { display: block; }

.manage-toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
}

.manage-search { flex: 1; min-width: 0; }
.manage-filter { flex: 1; min-width: 0; font-size: 13px !important; }

.manage-hint {
  font-size: 12px;
  color: var(--text-light);
  display: block;
  margin-bottom: 10px;
}

.manage-list { display: flex; flex-direction: column; gap: 8px; }

.manage-item {
  background: var(--card-bg);
  border-radius: var(--radius-sm);
  padding: 14px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(232, 224, 212, 0.3);
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.manage-item-icon { font-size: 22px; flex-shrink: 0; line-height: 1; }
.manage-item-body { flex: 1; min-width: 0; }

.manage-item-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 3px;
  word-break: break-all;
}

.manage-item-meta {
  font-size: 11px;
  color: var(--text-light);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.manage-item-meta .badge {
  padding: 1px 8px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 600;
}

.badge-source { background: var(--info-bg); color: var(--info); }
.badge-manual { background: var(--warning-bg); color: var(--warning); }
.badge-auto { background: var(--primary-bg); color: var(--primary-dark); }

.manage-item-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
  align-self: center;
}

.manage-action-btn {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--warm-paper);
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.manage-action-btn:active { background: var(--warm-beige); }

/* =================== Toast =================== */
.toast-container {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.toast-backdrop {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: transparent;
  pointer-events: auto;
  animation: toastBdIn 0.2s ease;
  z-index: -1;
}

/* 浅色模式：浅色毛玻璃底 + 绿色描边（方案A） */
.toast {
  background: rgba(255, 253, 247, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 50px;
  padding: 12px 24px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08), 0 1px 4px rgba(0, 0, 0, 0.04);
  font-size: 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: toastIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  min-width: 180px;
  max-width: 320px;
  border: 1.5px solid rgba(123, 174, 127, 0.45);
  pointer-events: auto;
  font-family: 'Noto Serif SC', serif;
  color: var(--ink, #3D3929);
}

.toast.success { border-color: rgba(123, 174, 127, 0.55); }
.toast.error   { border-color: rgba(212, 112, 112, 0.5); }
.toast.info    { border-color: rgba(123, 174, 127, 0.45); }

.toast .toast-icon { font-size: 20px; flex-shrink: 0; }
.toast .toast-msg { line-height: 1.5; }

@keyframes toastIn {
  from { opacity: 0; transform: scale(0.85) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes toastOut {
  from { opacity: 1; transform: scale(1); }
  to { opacity: 0; transform: scale(0.9); }
}

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

/* =================== Loading =================== */
.loading-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(253, 246, 236, 0.85);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.loading-spinner {
  text-align: center;
}

/* 内联分析加载 */
.analysis-loading-cat {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 0;
}

/* ===== 小猫图片走步动画 ===== */
.cat-img-walk {
  width: 80px;
  height: 80px;
  position: relative;
  animation: catImgWalk 0.8s ease-in-out infinite;
  margin: 0 auto;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.1));
}

.cat-img-sprite {
  width: 100%;
  height: 100%;
  object-fit: contain;
  animation: catImgTilt 0.8s ease-in-out infinite;
}

/* 阴影 */
.cat-img-shadow {
  width: 50px;
  height: 8px;
  background: radial-gradient(ellipse, rgba(0,0,0,0.15) 0%, transparent 70%);
  border-radius: 50%;
  margin: 4px auto 0;
  animation: catImgShadow 0.8s ease-in-out infinite;
}

/* 加载小圆点 */
.cat-img-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 14px;
}

.cat-img-dots span {
  width: 7px;
  height: 7px;
  background: var(--leaf, #7BAE7F);
  border-radius: 50%;
  animation: catDotBounce 1.2s ease-in-out infinite;
  opacity: 0.4;
}

.cat-img-dots span:nth-child(1) { animation-delay: 0s; }
.cat-img-dots span:nth-child(2) { animation-delay: 0.2s; }
.cat-img-dots span:nth-child(3) { animation-delay: 0.4s; }

/* 走路弹跳 — 模拟小猫迈步 */
@keyframes catImgWalk {
  0%   { transform: translateY(0) translateX(-8px); }
  25%  { transform: translateY(-6px) translateX(-2px); }
  50%  { transform: translateY(0) translateX(4px); }
  75%  { transform: translateY(-6px) translateX(8px); }
  100% { transform: translateY(0) translateX(-8px); }
}

/* 身体微微左右摇摆 */
@keyframes catImgTilt {
  0%   { transform: rotate(-3deg); }
  25%  { transform: rotate(1deg); }
  50%  { transform: rotate(3deg); }
  75%  { transform: rotate(-1deg); }
  100% { transform: rotate(-3deg); }
}

/* 阴影随弹跳变化 */
@keyframes catImgShadow {
  0%   { transform: scaleX(1); opacity: 0.7; }
  25%  { transform: scaleX(0.75); opacity: 0.4; }
  50%  { transform: scaleX(1); opacity: 0.7; }
  75%  { transform: scaleX(0.75); opacity: 0.4; }
  100% { transform: scaleX(1); opacity: 0.7; }
}

/* 小圆点跳动 */
@keyframes catDotBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-5px); opacity: 1; }
}

.page::after { content: ''; display: block; height: 20px; }

/* =================== 食谱操作按钮（收藏+打卡） =================== */
.card-recipe-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 12px;
  padding-top: 10px;
}

.recipe-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 16px;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  background: var(--warm-paper);
  font-size: 13px;
  font-weight: 600;
  font-family: 'Noto Serif SC', serif;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.25s;
  -webkit-tap-highlight-color: transparent;
}

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

.recipe-action-btn .action-icon {
  font-size: 14px;
  transition: transform 0.3s;
}

.recipe-action-save.saved {
  border-color: var(--peach);
  background: var(--peach-bg);
  color: var(--peach-dark);
}

.recipe-action-save.saved .action-icon {
  transform: scale(1.15);
}

.recipe-action-punch {
  border-color: rgba(123, 174, 127, 0.4);
  background: rgba(123, 174, 127, 0.08);
  color: #5A8F5E;
}

.recipe-action-punch:active {
  background: rgba(123, 174, 127, 0.18);
}

/* recipe-card-header 内的 action 按钮 */
.recipe-header-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.recipe-header-actions .recipe-action-btn {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.35);
  color: white;
  font-size: 12px;
  padding: 6px 14px;
}

.recipe-header-actions .recipe-action-btn:active {
  background: rgba(255, 255, 255, 0.3);
}

.recipe-header-actions .recipe-action-save.saved {
  background: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.5);
  color: white;
}

/* 卡片内查看完整配餐指南文字链接 */
.card-recipe-detail-link {
  text-align: center;
  margin-top: 10px;
  padding-top: 8px;
  font-size: 12px;
  color: var(--ink-light);
  cursor: pointer;
  opacity: 0.65;
  transition: opacity 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.card-recipe-detail-link:active {
  opacity: 1;
}

/* =================== 打卡确认框 =================== */
.punch-confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0);
  transition: background 0.3s;
  -webkit-tap-highlight-color: transparent;
}

.punch-confirm-overlay.show {
  background: rgba(0, 0, 0, 0.35);
}

.punch-confirm-overlay.closing {
  background: rgba(0, 0, 0, 0);
}

.punch-confirm-box {
  background: var(--card-bg, #FFFDF9);
  border-radius: 18px;
  padding: 28px 24px 20px;
  width: 280px;
  text-align: center;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
  transform: scale(0.85);
  opacity: 0;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s;
}

.punch-confirm-overlay.show .punch-confirm-box {
  transform: scale(1);
  opacity: 1;
}

.punch-confirm-overlay.closing .punch-confirm-box {
  transform: scale(0.9);
  opacity: 0;
}

.punch-confirm-icon {
  font-size: 36px;
  margin-bottom: 8px;
}

.punch-confirm-title {
  font-size: 17px;
  font-weight: 700;
  font-family: 'Noto Serif SC', serif;
  color: var(--ink, #3E3A32);
  margin-bottom: 6px;
}

.punch-confirm-desc {
  font-size: 13px;
  color: var(--ink-light, #6B6453);
  line-height: 1.5;
  margin-bottom: 8px;
}

.punch-confirm-recipe {
  font-size: 12px;
  color: var(--primary-dark, #5A8F5E);
  background: var(--primary-bg, rgba(123, 174, 127, 0.08));
  border-radius: 8px;
  padding: 5px 10px;
  display: inline-block;
  margin-bottom: 16px;
}

.punch-confirm-btns {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.punch-confirm-btn {
  width: 100%;
  padding: 11px 16px;
  border: none;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  font-family: 'Noto Serif SC', serif;
  cursor: pointer;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.punch-confirm-yes {
  background: var(--primary, #7BAE7F);
  color: white;
  box-shadow: 0 2px 8px rgba(123, 174, 127, 0.3);
}

.punch-confirm-yes:active {
  transform: scale(0.97);
  background: #6A9D6E;
}

.punch-confirm-no {
  background: transparent;
  color: var(--ink-light, #6B6453);
  font-weight: 500;
}

.punch-confirm-no:active {
  background: var(--warm-beige, #F0EBDF);
}

/* =================== 自定义确认弹窗 =================== */
.app-confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0);
  transition: background 0.3s ease;
}

.app-confirm-overlay.show {
  background: rgba(0, 0, 0, 0.4);
}

.app-confirm-overlay.closing {
  background: rgba(0, 0, 0, 0);
}

.app-confirm-box {
  background: var(--card-bg, #FFFDF9);
  border-radius: 18px;
  padding: 24px 20px 16px;
  width: 280px;
  max-width: 90vw;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
  transform: scale(0.85);
  opacity: 0;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.25s ease;
}

.app-confirm-overlay.show .app-confirm-box {
  transform: scale(1);
  opacity: 1;
}

.app-confirm-overlay.closing .app-confirm-box {
  transform: scale(0.9);
  opacity: 0;
}

.app-confirm-title {
  font-size: 16px;
  font-weight: 700;
  font-family: 'Noto Serif SC', serif;
  color: var(--ink, #3D3929);
  text-align: center;
  margin-bottom: 10px;
}

.app-confirm-message {
  font-size: 14px;
  color: var(--ink-light, #6B6453);
  line-height: 1.6;
  text-align: center;
  margin-bottom: 20px;
  white-space: pre-line;
}

.app-confirm-btns {
  display: flex;
  gap: 10px;
}

.app-confirm-btn {
  flex: 1;
  padding: 11px 16px;
  border: none;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.app-confirm-cancel {
  background: var(--warm-beige, #F0E6D3);
  color: var(--ink-light, #6B6453);
}

.app-confirm-cancel:active {
  transform: scale(0.97);
  background: #E5DBC8;
}

.app-confirm-ok {
  background: var(--primary, #7BAE7F);
  color: white;
  box-shadow: 0 2px 8px rgba(123, 174, 127, 0.3);
}

.app-confirm-ok:active {
  transform: scale(0.97);
  background: #6A9D6E;
}

.app-confirm-ok.danger {
  background: var(--danger, #D47070);
  box-shadow: 0 2px 8px rgba(212, 112, 112, 0.3);
}

.app-confirm-ok.danger:active {
  background: #C25555;
}

/* 保留旧的 .recipe-save-btn 兼容 Profile 页面和 detail modal */
.card-recipe-save {
  display: flex;
  justify-content: center;
  margin-top: 10px;
}

.recipe-save-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  background: var(--warm-paper);
  font-size: 13px;
  font-weight: 600;
  font-family: 'Noto Serif SC', serif;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.25s;
  -webkit-tap-highlight-color: transparent;
}

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

.recipe-save-btn .save-icon {
  font-size: 15px;
  transition: transform 0.3s;
}

.recipe-save-btn.saved {
  border-color: var(--peach);
  background: var(--peach-bg);
  color: var(--peach-dark);
}

.recipe-save-btn.saved .save-icon {
  transform: scale(1.15);
}

/* 卡片头部内的收藏按钮（用于 recipe-card-header） */
.recipe-save-btn-header {
  margin-top: 10px;
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.35);
  color: white;
}

.recipe-save-btn-header:active {
  background: rgba(255, 255, 255, 0.3);
}

.recipe-save-btn-header.saved {
  background: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.5);
  color: white;
}

/* =================== 收藏食谱列表（Profile 页） =================== */
.saved-recipes-count {
  font-size: 12px;
  color: var(--text-light);
}

.saved-recipes-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.saved-recipe-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: var(--card-bg);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(232, 224, 212, 0.3);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.saved-recipe-card:active {
  transform: scale(0.98);
}

.saved-recipe-left {
  flex-shrink: 0;
}

.saved-recipe-avatar {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--primary-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.saved-recipe-content {
  flex: 1;
  min-width: 0;
}

.saved-recipe-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.saved-recipe-meta {
  display: flex;
  gap: 8px;
  font-size: 11px;
  color: var(--ink-lighter);
  margin-bottom: 2px;
}

.saved-recipe-ingredients {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.saved-recipe-date {
  font-size: 11px;
  color: var(--ink-faint);
  margin-top: 2px;
}

.saved-recipe-actions {
  flex-shrink: 0;
  align-self: flex-start;
}

.saved-recipe-delete {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: var(--warm-paper);
  color: var(--ink-faint);
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.saved-recipe-delete:active {
  background: var(--danger-bg);
  color: var(--danger);
}

/* =================== 记录饮食 - 日期选择器 =================== */
.date-picker-hint {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 12px;
  text-align: center;
}

.date-picker-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 12px;
}

.date-picker-nav-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg);
  border: none;
  font-size: 18px;
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.date-picker-nav-btn:active {
  background: var(--primary-light);
}

.date-picker-month {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  min-width: 120px;
  text-align: center;
}

.date-picker-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 6px;
  padding: 0 4px;
}

.date-picker-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  padding: 0 4px;
  margin-bottom: 12px;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}

.date-picker-day {
  aspect-ratio: 1;
  border: none;
  background: transparent;
  border-radius: 50%;
  font-size: 14px;
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  position: relative;
}

.date-picker-day:active {
  transform: scale(0.92);
}

.date-picker-day.today {
  font-weight: 700;
  color: var(--primary);
}

.date-picker-day.today::after {
  content: '';
  position: absolute;
  bottom: 2px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--primary);
}

.date-picker-day.selected {
  background: var(--primary);
  color: #fff;
  font-weight: 600;
}

.date-picker-day.selected.today::after {
  background: #fff;
}

.date-picker-day.other-month {
  color: var(--text-tertiary);
  opacity: 0.4;
}

.date-picker-day.future {
  color: var(--text-tertiary);
  opacity: 0.35;
  pointer-events: none;
}

.date-picker-selected {
  background: var(--bg);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 13px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  min-height: 36px;
}

.date-picker-selected-label {
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
}

.date-picker-selected-dates {
  color: var(--primary);
  font-weight: 500;
}

#confirmMealDates {
  margin-top: 12px;
}

#confirmMealDates:disabled {
  opacity: 0.5;
  pointer-events: none;
}

/* =================== 响应式 =================== */
@media (min-width: 500px) {
  .modal-sheet { border-radius: 24px; margin-bottom: 20px; max-width: 460px; }
  .modal-overlay { align-items: center; }
  .app-container { max-width: 500px; left: 50%; transform: translateX(-50%); }
}

/* =================== 暗色模式 =================== */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1C1A15;
    --card-bg: #2A2720;
    --warm-paper: #252219;
    --warm-beige: #3A3630;
    --cream: #2A2720;
    --border: #3E3A32;
    --ink: #E8E0D4;
    --ink-light: #B5AD9E;
    --ink-lighter: #8A8273;
    --ink-faint: #5E584E;
    --shadow: 0 2px 16px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.3);
    --primary-bg: #1F2E1F;
    --peach-bg: #2E1F25;
    --success-bg: #1F2E1F;
    --warning-bg: #2E2A1F;
    --danger-bg: #2E1F1F;
    --info-bg: #1F252E;
    --primary-dark: #A3D1A7;
    --peach-dark: #F5D0E0;
  }

  body::before {
    background-image:
      radial-gradient(ellipse at 20% 50%, rgba(232, 160, 191, 0.03) 0%, transparent 50%),
      radial-gradient(ellipse at 80% 20%, rgba(123, 174, 127, 0.03) 0%, transparent 50%);
  }

  /* 登录页 */
  .auth-page { background: linear-gradient(160deg, #1C1A15 0%, #25221A 40%, #2A2020 70%, #1C2025 100%); }
  .auth-page::before { background: radial-gradient(circle, rgba(232, 160, 191, 0.08) 0%, transparent 70%); }
  .auth-page::after { background: radial-gradient(circle, rgba(123, 174, 127, 0.06) 0%, transparent 70%); }
  .auth-card { background: rgba(42, 39, 32, 0.95); border-color: rgba(62, 58, 50, 0.6); }
  .auth-tabs { background: #252219; }
  .auth-tab.active { background: #2A2720; color: var(--primary-dark); }
  .auth-message.error { background: #2E1F1F; color: #E89090; }
  .auth-message.success { background: #1F2E1F; color: #A3D1A7; }

  /* 表单 */
  .form-input, .form-select { background-color: var(--warm-paper); border-color: var(--border); color: var(--ink); }
  .form-input::placeholder { color: var(--ink-lighter); }
  .form-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(123, 174, 127, 0.15); }

  /* 自定义下拉框暗色模式 */
  .custom-select-trigger { background-color: var(--warm-paper); border-color: var(--border); color: var(--ink); }
  .custom-select-trigger:active,
  .custom-select.open .custom-select-trigger { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(123, 174, 127, 0.15); }
  .custom-select-arrow svg path { fill: #B5AD9E; }
  .custom-select-dropdown { background: var(--card-bg); border-color: var(--border); box-shadow: 0 8px 24px rgba(0,0,0,0.35), 0 2px 8px rgba(0,0,0,0.2); }
  .custom-select-option { color: var(--ink); border-bottom-color: rgba(255,255,255,0.04); }
  .custom-select-option:active { background: var(--primary-bg); }
  .custom-select-option.selected { color: var(--primary-dark); }

  /* 顶部栏 */
  .top-header { background: var(--bg); }
  .page-top-bar { background: var(--bg); }

  /* 宠物信息行 */
  .pet-selector-sub { color: var(--ink-light); }
  .pet-selector-goal { color: var(--primary); }
  .pet-selector-goal-dot { color: var(--primary); }
  
  /* 右上角我的按钮 */
  .top-profile-btn { background: var(--peach-bg); border-color: rgba(232, 160, 191, 0.4); }

  .need-capsule-btn:active { background: rgba(123, 174, 127, 0.3); color: white; }
  
  /* 需求选择浮层 */
  .need-sheet-overlay { background: rgba(0, 0, 0, 0.55); }
  .need-sheet { background: var(--card-bg); }
  .need-sheet-title { color: var(--ink); }
  .need-sheet-close { background: var(--warm-beige); color: var(--ink-light); }
  .need-sheet-close:active { background: var(--border); }
  .need-sheet-option { background: var(--card-bg); border-color: var(--border); }
  .need-sheet-option.active { background: var(--primary-bg); border-color: rgba(123, 174, 127, 0.4); }
  .need-sheet-option-label { color: var(--ink); }
  .need-sheet-option-desc { color: var(--ink-lighter); }

  /* 宠物选择器 */
  .pet-selector-avatar { background: #4a4a4a; }
  .pet-selector-name { color: var(--ink); }
  .pet-selector-sub { color: var(--ink-lighter); }
  .pet-selector-arrow { color: var(--ink-lighter); }

  /* 宠物切换浮层 */
  .pet-sheet-overlay { background: rgba(0, 0, 0, 0.5); }
  .pet-sheet { background: var(--card-bg); }
  .pet-sheet-header { border-bottom-color: var(--border); }
  .pet-sheet-title { color: var(--ink); }
  .pet-sheet-close { background: var(--warm-beige); color: var(--ink-light); }
  .pet-switch-item:active { background: var(--warm-beige); }
  .pet-switch-item.active { background: var(--peach-bg); border-color: rgba(232, 160, 191, 0.3); }
  .pet-switch-item-avatar { background: #555; }
  .pet-switch-item-name { color: var(--ink); }
  .pet-switch-item-detail { color: var(--ink-lighter); }
  .pet-sheet-footer { border-top-color: var(--border); }
  .pet-sheet-add-btn { color: var(--primary-dark); border-color: var(--primary-dark); }
  .pet-switch-add-inline { color: var(--primary-dark); border-color: var(--primary-dark); background: rgba(123, 174, 127, 0.1); }

  /* 诉求标签 */
  .need-tag { border-color: var(--border); color: var(--ink-lighter); }
  .need-tag.active { background: var(--primary-bg); border-color: rgba(123, 174, 127, 0.4); color: var(--primary-dark); }
  .need-tags-label { color: var(--ink-lighter); }

  /* 抽卡区域 */
  .card-front { box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255,255,255,0.1); }
  .card-front-tip { 
    background: rgba(0, 0, 0, 0.5); 
    color: #FFFFFF; 
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  }
  .card-back { background: var(--card-bg); border-color: var(--border); box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3); }
  .card-recipe-header { border-bottom-color: var(--border); }
  .card-recipe-title { color: var(--primary-dark); }
  .card-recipe-subtitle { color: var(--ink-lighter); }
  .card-recipe-tag { background: var(--primary-bg); color: var(--primary-dark); }
  .card-recipe-item { border-bottom-color: rgba(62, 58, 50, 0.5); }
  .card-recipe-item-name { color: var(--ink); }
  .card-recipe-item-amount { color: var(--primary-dark); }
  .card-recipe-cal { color: var(--ink-lighter); border-top-color: var(--border); }
  .card-recipe-note { background: var(--warning-bg); color: #E2A858; }

  /* 卡片内切换 & 完整方案链接 */
  .card-type-toggle { background: #252219; }
  .card-type-btn { color: var(--ink-lighter); }
  .card-type-btn.active { background: #2A2720; color: var(--primary-dark); }
  .card-detail-footer { border-top-color: var(--border); }
  .card-detail-btn .card-detail-text { color: var(--ink); }
  .card-detail-btn .card-detail-arrow { color: var(--ink-lighter); }
  .card-detail-btn:active { background: rgba(255,255,255,0.05); }

  /* 操作按钮 - 收藏+打卡（自选配餐页） */
  .recipe-action-btn { background: var(--warm-paper); border-color: var(--border); color: var(--ink-light); }
  .recipe-action-save.saved { background: var(--peach-bg); border-color: rgba(232, 160, 191, 0.3); color: var(--peach-dark); }
  .recipe-action-punch { background: rgba(123, 174, 127, 0.1); border-color: rgba(123, 174, 127, 0.25); color: #8FC293; }

  /* 底部固定操作栏暗色 */
  .recipe-action-bar { background: rgba(42, 39, 32, 0.96); border-top-color: var(--border); }
  .action-bar-detail { background: var(--warm-paper); border-color: var(--border); color: var(--ink-light); }
  .action-bar-detail:active { background: rgba(255,255,255,0.05); }
  .action-bar-record { background: #6A9D6E; border-color: #6A9D6E; }
  .action-bar-record.recorded { background: var(--warm-beige); border-color: var(--border); color: var(--ink-light); }

  /* 自选配餐弹窗操作栏暗色 */
  .custom-recipe-action-bar { background: var(--card-bg); border-top-color: var(--border); }
  .custom-action-save { background: var(--warm-paper); border-color: var(--border); color: var(--ink-light); }
  .custom-action-save:active { background: rgba(255,255,255,0.05); }
  .custom-action-save.saved { background: var(--peach-bg); border-color: rgba(232, 160, 191, 0.3); color: var(--peach-dark); }
  .custom-action-record { background: #6A9D6E; border-color: #6A9D6E; }
  .custom-action-record.recorded { background: var(--warm-beige); border-color: var(--border); color: var(--ink-light); }
  .custom-recipe-name { color: var(--primary-dark); }

  /* 打卡确认框暗色 */
  .punch-confirm-box { background: var(--card-bg); }
  .punch-confirm-title { color: var(--ink); }
  .punch-confirm-desc { color: var(--ink-light); }
  .punch-confirm-recipe { background: rgba(123, 174, 127, 0.12); color: #8FC293; }
  .punch-confirm-no { color: var(--ink-lighter); }
  .punch-confirm-no:active { background: rgba(255,255,255,0.05); }

  /* 自定义确认弹窗暗色模式 */
  .app-confirm-box { background: var(--card-bg); }
  .app-confirm-title { color: var(--ink); }
  .app-confirm-message { color: var(--ink-light); }
  .app-confirm-cancel { background: rgba(255,255,255,0.08); color: var(--ink-lighter); }
  .app-confirm-cancel:active { background: rgba(255,255,255,0.12); }

  /* TabBar */
  .tabbar { background: rgba(42, 39, 32, 0.95); border-top-color: var(--border); }
  .tab-item { color: var(--ink-lighter); }
  .tab-item.active { color: var(--primary-dark); }

  /* 按钮 */
  .btn-secondary { background: var(--warm-beige); color: var(--ink); }
  .btn-outline { background: transparent; border-color: var(--border); color: var(--ink-light); }

  /* 自选食材芯片 */
  .food-chip { background: var(--card-bg); border-color: var(--border); color: var(--ink-light); }
  .food-chip .chip-name { color: var(--ink); }
  .food-chip .chip-benefit { color: rgba(123, 174, 127, 0.8); background: rgba(123, 174, 127, 0.12); }
  .food-chip.selected { background: var(--primary-bg); border-color: rgba(123, 174, 127, 0.4); color: var(--primary-dark); }
  .food-chip.selected .chip-name { color: var(--primary-dark); }
  .food-chip.selected .chip-benefit { color: var(--primary-dark); background: rgba(123, 174, 127, 0.2); }

  /* 自选配餐页 */
  .custom-top { background: var(--bg); }
  .custom-pet-avatar { background: rgba(123, 174, 127, 0.15); }
  .custom-pet-name { color: var(--ink); }
  .custom-type-toggle { background: #252219; }
  .custom-type-btn.active { background: #2A2720; color: var(--primary-dark); }
  .food-group { background: var(--card-bg); border-color: var(--border); }
  .food-group-title { color: var(--ink); }
  .food-selected-tag { background: rgba(123, 174, 127, 0.08); border-color: rgba(123, 174, 127, 0.3); color: var(--ink); }
  .food-selected-tag .tag-cal { color: var(--ink-lighter); }
  .food-group-add-btn { background: var(--warm-paper); color: var(--primary); }
  .food-group-add-btn:active { background: var(--warm-beige); }
  .food-picker-sheet { background: var(--bg); }
  .food-picker-header { border-bottom-color: var(--border); }
  .food-picker-title { color: var(--ink); }
  .food-picker-close { background: var(--warm-beige); color: var(--ink-light); }
  .food-picker-footer { border-top-color: var(--border); background: var(--bg); }
  .food-picker-confirm-btn { background: #6A9D6E; }
  .food-picker-confirm-btn:active { background: #5A8D5E; }
  .food-picker-confirm-btn.no-selection { background: #6A9D6E; opacity: 0.55; }

  /* 配方卡片 */
  .recipe-card { background: var(--card-bg); border-color: var(--border); }
  .recipe-card-body { background: var(--card-bg); }
  .ingredient-row { border-bottom-color: var(--border); }
  .ingredient-name { color: var(--ink); }
  .ingredient-amount { color: var(--primary-dark); }
  .ingredient-benefit { background: rgba(107, 142, 35, 0.2); color: var(--primary-dark); }
  .ingredient-cook-note { color: var(--ink-lighter); }
  .card-recipe-item-benefit { background: rgba(107, 142, 35, 0.2); color: var(--primary-dark); }
  .recipe-note { background: var(--warning-bg); color: #E2A858; border-color: rgba(226, 168, 88, 0.15); }
  .recipe-special-note { background: var(--danger-bg); border-color: rgba(212, 112, 112, 0.15); color: #E89090; }
  .supplement-item { border-bottom-color: var(--border); color: var(--ink); }
  .recipe-tag-badge { background: rgba(255,255,255,0.15); }

  /* 日历 */
  .mini-calendar { background: var(--card-bg); border-color: var(--border); }
  .cal-nav { color: var(--ink); }
  .cal-day { color: var(--ink); }
  .cal-day:active { background: var(--warm-beige); }
  .cal-day.today { color: var(--primary-dark); background: var(--primary-bg); }
  .cal-day.other-month { color: var(--ink-faint); }
  .day-detail { background: var(--card-bg); border-color: var(--border); }

  /* 餐次卡片 */
  .meal-card { background: var(--card-bg); border-color: var(--border); }
  .meal-card-title { color: var(--ink); }
  .meal-card-sub { color: var(--ink-light); }

  /* 食材选择浮层暗色 */
  .food-picker-left { background: rgba(255,255,255,0.03); border-right-color: var(--border); }
  .food-picker-cat-item { color: var(--ink-light); }
  .food-picker-cat-item.active { background: var(--card-bg); color: var(--primary); border-left-color: var(--primary); }
  .food-picker-food-name { color: var(--ink); }
  .food-picker-food-detail { color: var(--ink-light); }
  .food-picker-food-check { border-color: var(--border); }
  .meal-ing-tag { background: rgba(255,255,255,0.05); border-color: var(--border); color: var(--ink); }
  .meal-ing-tag .ing-tag-amount input { border-color: var(--border); color: var(--ink); }
  .import-recipe-item-name { color: var(--ink); }
  .import-recipe-item-meta { color: var(--ink-light); }

  /* 营养分析 */
  .analysis-card { background: var(--card-bg); border-color: var(--border); }
  .analysis-card h3 { color: var(--ink); }
  .nutrient-bar { background: var(--warm-beige); }
  .score-value { color: var(--primary-dark); }

  /* 内容管理 */
  .manage-tabs { background: #252219; }
  .manage-tab.active { background: #2A2720; color: var(--primary-dark); }
  .manage-item { background: var(--card-bg); border-color: var(--border); }
  .manage-item-title { color: var(--ink); }
  .manage-action-btn { background: var(--warm-paper); }
  .manage-action-btn:active { background: var(--warm-beige); }
  .badge-source { background: var(--info-bg); color: #7BA8C9; }
  .badge-manual { background: var(--warning-bg); color: #E2A858; }
  .badge-auto { background: var(--primary-bg); color: var(--primary-dark); }

  /* 类型切换 */
  .type-toggle { background: #252219; }
  .type-btn.active { background: #2A2720; color: var(--primary-dark); }
  .range-tabs { background: #252219; }
  .range-tab.active { background: #2A2720; color: var(--primary-dark); }

  /* 弹窗 */
  .modal-overlay { background: rgba(0, 0, 0, 0.55); }
  .modal-sheet { background: var(--card-bg); }
  .modal-handle { background: var(--warm-beige); }
  .modal-header h2 { color: var(--ink); }
  .modal-close { background: var(--warm-beige); color: var(--ink-light); }
  .modal-close:active { background: var(--border); }

  /* Radio Pills & 头像选择 */
  .pill { background: var(--card-bg); border-color: var(--border); color: var(--ink-light); }
  .pill.active, .pill:has(input:checked) { background: var(--primary-bg); border-color: rgba(123, 174, 127, 0.4); color: var(--primary-dark); }
  .av { background: var(--warm-paper); }
  .av.selected { border-color: rgba(232, 160, 191, 0.5); background: var(--peach-bg); }

  /* 输入单位 */
  .input-unit span { background: var(--warm-beige); border-color: var(--border); color: var(--ink-light); }

  /* 食材行 */
  .ingredient-remove { background: var(--danger-bg); color: #E89090; }

  /* Toast - 深色模式：浅色毛玻璃底 + 绿色描边（方案A） */
  .toast {
    background: rgba(255, 253, 247, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-color: rgba(123, 174, 127, 0.45);
    color: #3D3929;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08), 0 1px 4px rgba(0, 0, 0, 0.04);
  }
  .toast.success { border-color: rgba(123, 174, 127, 0.55); }
  .toast.error   { border-color: rgba(212, 112, 112, 0.5); }
  .toast.info    { border-color: rgba(123, 174, 127, 0.45); }
  .toast-backdrop { background: transparent; }

  /* Loading */
  .loading-overlay { background: rgba(28, 26, 21, 0.85); }
  .cat-img-walk { filter: drop-shadow(0 2px 8px rgba(0,0,0,0.3)); }
  .cat-img-shadow { background: radial-gradient(ellipse, rgba(255,255,255,0.08) 0%, transparent 70%); }
  .cat-img-dots span { background: var(--leaf-dark, #9BC49E); }

  /* 空状态提示 */
  .empty-hint { color: var(--ink-lighter); }

  /* 配置区域标签 */
  .config-label { color: var(--ink-light); }
  .form-group label { color: var(--ink-light); }

  /* 我的页面 */
  .profile-card { box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3); }
  .profile-pet-card { background: var(--card-bg); border-color: var(--border); }
  .profile-pet-name { color: var(--ink); }
  .profile-pet-detail { color: var(--ink-lighter); }
  .profile-menu { background: var(--card-bg); border-color: var(--border); }
  .profile-menu-item { color: var(--ink-light); }
  .profile-menu-item:not(:last-child) { border-bottom-color: var(--border); }
  .profile-menu-item:active { background: var(--warm-beige); }
  .profile-menu-danger { color: #E89090 !important; }

  /* 分析区标题 */
  .analysis-section { border-top-color: var(--border); }
  .analysis-controls-capsule { background: var(--card-bg); border-color: var(--border); }
  .analysis-pet-capsule { background: var(--warm-paper); border-color: var(--border); }
  .analysis-pet-capsule:active { background: var(--primary-bg); }
  .analysis-pet-name { color: var(--ink); }
  .analysis-pet-sheet-overlay { background: rgba(0, 0, 0, 0.55); }
  .analysis-pet-sheet-overlay .pet-sheet { background: var(--card-bg); }
  .analysis-standards-overlay { background: rgba(0, 0, 0, 0.6); }
  .analysis-standards-sheet { background: var(--card-bg); box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.3); }
  .standards-section h4 { color: var(--ink); }
  .standards-section p { color: var(--ink-light); }
  .standards-section ul { color: var(--ink-light); }
  .dashboard-indicator { background: rgba(123, 174, 127, 0.08); border-color: rgba(123, 174, 127, 0.15); }
  .nutrient-bar-100-marker { background: #C8A96E; opacity: 0.6; }
  .nutrient-bar-marker-label { color: #C8A96E; }
  .nutrient-bar-pct { background: rgba(255,255,255,0.08); }
  .advice-title { color: var(--ink); }
  .advice-text { color: var(--ink-light); }
  .advice-pct { background: rgba(255, 255, 255, 0.08); }
  .advice-critical .advice-item { background: rgba(239, 68, 68, 0.08); }
  .advice-warning .advice-item { background: rgba(245, 158, 11, 0.08); }
  .advice-supplement .advice-item { background: rgba(99, 102, 241, 0.08); }
  .advice-success .advice-item { background: rgba(34, 197, 94, 0.1); }

  /* 搜索 */
  .manage-search { background: var(--warm-paper); }

  /* 食谱收藏 */
  .recipe-save-btn { background: var(--warm-paper); border-color: var(--border); color: var(--ink-light); }
  .recipe-save-btn.saved { background: var(--peach-bg); border-color: rgba(232, 160, 191, 0.3); color: var(--peach-dark); }
  .recipe-save-btn-header { background: rgba(255, 255, 255, 0.12); border-color: rgba(255, 255, 255, 0.2); color: rgba(255, 255, 255, 0.9); }
  .recipe-save-btn-header.saved { background: rgba(255, 255, 255, 0.2); border-color: rgba(255, 255, 255, 0.35); }
  .saved-recipe-card { background: var(--card-bg); border-color: var(--border); }
  .saved-recipe-title { color: var(--ink); }
  .saved-recipe-meta { color: var(--ink-lighter); }
  .saved-recipe-ingredients { color: var(--ink-light); }
  .saved-recipe-date { color: var(--ink-faint); }
  .saved-recipe-avatar { background: rgba(123, 174, 127, 0.15); }
  .saved-recipe-delete { background: var(--warm-paper); color: var(--ink-faint); }
  .saved-recipe-delete:active { background: var(--danger-bg); color: #E89090; }

  /* 主题色 meta 标签适配 - 通过 JS 处理 */
}
