/* ==================== 全局变量 ==================== */
:root {
  --primary: #FF6B9D;
  --primary-light: #FFA0C4;
  --primary-dark: #E84B7A;
  --secondary: #FF8A80;
  --accent: #FFD54F;
  --bg-gradient-start: #FFF0F5;
  --bg-gradient-end: #FFE4F0;
  --card-bg: #FFFFFF;
  --text-primary: #2D1B30;
  --text-secondary: #6B4C6E;
  --text-light: #9B7E9E;
  --border: #FFE0EB;
  --shadow: rgba(255, 107, 157, 0.15);
  --shadow-hover: rgba(255, 107, 157, 0.3);
  --success: #66BB6A;
  --warning: #FFA726;
  --danger: #EF5350;
  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 24px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* ==================== 基础样式 ==================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  background: linear-gradient(135deg, var(--bg-gradient-start), var(--bg-gradient-end));
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  position: relative;
  background: linear-gradient(180deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
}

/* ==================== 飘落爱心背景 ==================== */
.hearts-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.floating-heart {
  position: absolute;
  top: -30px;
  animation: heartFall linear infinite;
  opacity: 0.15;
  font-size: 20px;
  user-select: none;
}

@keyframes heartFall {
  0% { transform: translateY(0) rotate(0deg) scale(1); opacity: 0; }
  10% { opacity: 0.15; }
  90% { opacity: 0.15; }
  100% { transform: translateY(100vh) rotate(360deg) scale(0.5); opacity: 0; }
}

/* ==================== 顶部导航 ==================== */
.header {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  padding: 20px 20px 16px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 4px 20px var(--shadow);
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo-heart {
  font-size: 28px;
  animation: heartBeat 1.5s ease-in-out infinite;
}

@keyframes heartBeat {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2); }
}

.logo h1 {
  font-size: 22px;
  color: white;
  font-weight: 700;
  text-shadow: 0 2px 4px rgba(0,0,0,0.1);
  letter-spacing: 1px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cart-btn {
  background: rgba(255,255,255,0.25);
  border: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  cursor: pointer;
  position: relative;
  transition: all 0.3s;
  backdrop-filter: blur(10px);
}

.cart-btn:active { transform: scale(0.9); }

.cart-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  background: var(--danger);
  color: white;
  font-size: 11px;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  border: 2px solid white;
  animation: badgePop 0.3s ease;
}

@keyframes badgePop {
  0% { transform: scale(0); }
  50% { transform: scale(1.3); }
  100% { transform: scale(1); }
}

.love-note {
  color: rgba(255,255,255,0.9);
  font-size: 13px;
  margin-top: 10px;
  text-align: center;
  font-style: italic;
  animation: fadeInUp 0.8s ease;
  min-height: 20px;
}

/* ==================== 标签页导航 ==================== */
.tab-bar {
  display: flex;
  background: white;
  padding: 6px;
  margin: 12px 16px;
  border-radius: var(--radius);
  box-shadow: 0 2px 12px var(--shadow);
  position: sticky;
  top: 100px;
  z-index: 99;
}

.tab {
  flex: 1;
  border: none;
  background: transparent;
  padding: 10px 4px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-light);
  transition: all 0.3s;
}

.tab.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: white;
  box-shadow: 0 4px 12px var(--shadow);
}

.tab-icon { font-size: 18px; }

.tab-content {
  display: none;
  padding: 0 16px 100px;
  animation: fadeInUp 0.3s ease;
}

.tab-content.active { display: block; }

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==================== 搜索框 ==================== */
.search-box {
  display: flex;
  align-items: center;
  background: white;
  border-radius: var(--radius);
  padding: 0 16px;
  margin-bottom: 12px;
  box-shadow: 0 2px 12px var(--shadow);
  border: 2px solid transparent;
  transition: all 0.3s;
}

.search-box:focus-within {
  border-color: var(--primary-light);
  box-shadow: 0 4px 20px var(--shadow-hover);
}

.search-icon { font-size: 18px; margin-right: 10px; }

.search-box input {
  flex: 1;
  border: none;
  outline: none;
  padding: 14px 0;
  font-size: 15px;
  background: transparent;
  color: var(--text-primary);
}

.search-box input::placeholder { color: var(--text-light); }

.search-clear {
  border: none;
  background: var(--border);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
}

/* ==================== 分类横向滚动 ==================== */
.category-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 0 12px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.category-scroll::-webkit-scrollbar { display: none; }

.cat-chip {
  flex-shrink: 0;
  border: none;
  background: white;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--text-secondary);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  transition: all 0.3s;
  white-space: nowrap;
}

.cat-chip.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: white;
  box-shadow: 0 4px 12px var(--shadow);
}

.cat-chip:active { transform: scale(0.95); }

/* ==================== 菜品网格 ==================== */
.dish-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.dish-card {
  background: white;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  cursor: pointer;
  transition: all 0.3s;
  animation: cardFadeIn 0.5s ease both;
}

.dish-card:active { transform: scale(0.97); }

.dish-card:hover {
  box-shadow: 0 8px 24px var(--shadow);
  transform: translateY(-2px);
}

@keyframes cardFadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.dish-card-img {
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 56px;
  position: relative;
  overflow: hidden;
}

.dish-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.dish-card:hover .dish-card-img img {
  transform: scale(1.08);
}

.dish-card-emoji-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: 56px;
}

.card-bg-1 { background: linear-gradient(135deg, #FFE0E6, #FFF0F0); }
.card-bg-2 { background: linear-gradient(135deg, #E0F0FF, #F0F8FF); }
.card-bg-3 { background: linear-gradient(135deg, #FFF8E0, #FFFBF0); }
.card-bg-4 { background: linear-gradient(135deg, #E8F5E9, #F0FFF0); }
.card-bg-5 { background: linear-gradient(135deg, #F3E5F5, #FCF0FF); }
.card-bg-6 { background: linear-gradient(135deg, #FFF3E0, #FFFAF0); }

.dish-card-info {
  padding: 10px 12px 12px;
}

.dish-card-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dish-card-desc {
  font-size: 11px;
  color: var(--text-light);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 8px;
  min-height: 30px;
}

.dish-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dish-card-tags {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.dish-tag {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--bg-gradient-start);
  color: var(--primary);
}

.dish-card-time {
  font-size: 11px;
  color: var(--text-light);
  display: flex;
  align-items: center;
  gap: 2px;
}

.dish-card-actions {
  display: flex;
  gap: 6px;
  padding: 0 12px 12px;
}

.btn-add-cart {
  flex: 1;
  border: none;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: white;
  padding: 8px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.3s;
  font-weight: 500;
}

.btn-add-cart:active { transform: scale(0.95); }

.btn-add-cart.in-cart {
  background: linear-gradient(135deg, var(--success), #81C784);
}

.btn-fav {
  border: none;
  background: var(--bg-gradient-start);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
}

.btn-fav.active { background: #FFE0E6; }
.btn-fav:active { transform: scale(0.85); }

/* ==================== 难度星星 ==================== */
.difficulty {
  display: flex;
  gap: 2px;
}

.difficulty .star { font-size: 10px; }
.difficulty .star.filled { color: var(--accent); }
.difficulty .star.empty { color: #E0E0E0; }

/* ==================== 随机点菜页 ==================== */
.random-container {
  padding: 10px 0;
}

.random-header {
  text-align: center;
  margin-bottom: 20px;
}

.random-header h2 { font-size: 24px; margin-bottom: 6px; }
.random-header p { color: var(--text-light); font-size: 14px; }

.random-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}

.random-option {
  border: 2px solid var(--border);
  background: white;
  padding: 16px;
  border-radius: var(--radius);
  cursor: pointer;
  text-align: center;
  transition: all 0.3s;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
}

.random-option.active {
  border-color: var(--primary);
  background: linear-gradient(135deg, #FFF0F5, #FFE4F0);
  color: var(--primary);
}

.random-option:active { transform: scale(0.95); }

.option-icon {
  font-size: 32px;
  margin-bottom: 8px;
}

.random-btn {
  width: 100%;
  border: none;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  padding: 16px;
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 6px 20px var(--shadow);
  transition: all 0.3s;
  margin-bottom: 20px;
}

.random-btn:active {
  transform: scale(0.97);
  box-shadow: 0 2px 10px var(--shadow);
}

.random-btn-icon {
  font-size: 24px;
  animation: shake 0.5s ease-in-out infinite;
}

@keyframes shake {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-15deg); }
  75% { transform: rotate(15deg); }
}

.random-result {
  background: white;
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: 0 4px 20px var(--shadow);
  animation: fadeInUp 0.5s ease;
}

.random-result h3 {
  text-align: center;
  font-size: 20px;
  margin-bottom: 16px;
  color: var(--primary);
}

.random-dishes, .random-soups {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.random-dish-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--bg-gradient-start);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.3s;
}

.random-dish-item:active { transform: scale(0.98); }

.random-dish-emoji { font-size: 32px; }

.random-dish-info { flex: 1; }
.random-dish-info h4 { font-size: 15px; margin-bottom: 2px; }
.random-dish-info p { font-size: 12px; color: var(--text-light); }

.random-soups .random-dish-item {
  background: linear-gradient(135deg, #E3F2FD, #F0F8FF);
}

.btn-primary, .btn-secondary {
  width: 100%;
  border: none;
  padding: 14px;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  margin-bottom: 8px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: white;
  box-shadow: 0 4px 16px var(--shadow);
}

.btn-secondary {
  background: white;
  color: var(--primary);
  border: 2px solid var(--primary-light);
}

.btn-primary:active, .btn-secondary:active { transform: scale(0.97); }

/* ==================== 空状态 ==================== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-light);
}

.empty-icon {
  font-size: 64px;
  display: block;
  margin-bottom: 16px;
}

.empty-state p { font-size: 15px; line-height: 1.8; }

/* ==================== 历史记录 ==================== */
.section-title {
  font-size: 20px;
  margin-bottom: 16px;
  padding-top: 8px;
}

.history-card {
  background: white;
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  animation: cardFadeIn 0.5s ease both;
}

.history-date {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.history-date span:first-child {
  font-weight: 600;
  color: var(--text-primary);
}

.history-meal-type {
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 10px;
  background: var(--bg-gradient-start);
  color: var(--primary);
}

.history-dishes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.history-dish-tag {
  font-size: 13px;
  padding: 4px 10px;
  border-radius: 8px;
  background: #F5F5F5;
  display: flex;
  align-items: center;
  gap: 4px;
}

.history-note {
  font-size: 13px;
  color: var(--text-light);
  font-style: italic;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.history-status {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 8px;
}

.status-pending { background: #FFF3E0; color: #F57C00; }
.status-cooking { background: #E3F2FD; color: #1976D2; }
.status-done { background: #E8F5E9; color: #388E3C; }
.status-cancelled { background: #FFEBEE; color: #D32F2F; }

/* ==================== 弹窗 ==================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 200;
  display: none;
  align-items: flex-end;
  justify-content: center;
  backdrop-filter: blur(4px);
}

.modal-overlay.show {
  display: flex;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal {
  background: white;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  width: 100%;
  max-width: 480px;
  max-height: 85vh;
  overflow-y: auto;
  animation: slideUp 0.3s ease;
  overscroll-behavior: contain;
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  border: none;
  background: rgba(0,0,0,0.08);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: all 0.3s;
}

.modal-close:active { transform: scale(0.9); }

/* 菜品详情弹窗内容 */
.detail-header {
  padding: 24px 20px 16px;
  text-align: center;
  position: relative;
}

.detail-img-wrap {
  margin-bottom: 12px;
}

.detail-img {
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  border-radius: var(--radius);
  animation: bounceIn 0.5s ease;
}

.detail-emoji {
  font-size: 72px;
  display: block;
  margin-bottom: 12px;
  animation: bounceIn 0.5s ease;
}

@keyframes bounceIn {
  0% { transform: scale(0); }
  60% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

.detail-name {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 6px;
}

.detail-desc {
  font-size: 14px;
  color: var(--text-light);
  margin-bottom: 12px;
}

.detail-meta {
  display: flex;
  justify-content: center;
  gap: 20px;
  padding: 12px;
  background: var(--bg-gradient-start);
  border-radius: var(--radius-sm);
}

.detail-meta-item {
  text-align: center;
}

.detail-meta-item .value {
  font-size: 16px;
  font-weight: 600;
  color: var(--primary);
}

.detail-meta-item .label {
  font-size: 11px;
  color: var(--text-light);
}

.detail-section {
  padding: 16px 20px;
}

.detail-section-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.ingredient-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.ingredient-item {
  display: flex;
  justify-content: space-between;
  padding: 8px 12px;
  background: #FAFAFA;
  border-radius: 8px;
  font-size: 13px;
}

.ingredient-name { color: var(--text-primary); }
.ingredient-amount { color: var(--primary); font-weight: 500; }

.step-list { display: flex; flex-direction: column; gap: 12px; }

.step-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.step-num {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: white;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.step-text {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-secondary);
  padding-top: 3px;
}

.detail-tips {
  padding: 16px 20px 24px;
}

.tips-box {
  background: linear-gradient(135deg, #FFF8E1, #FFFDE7);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-size: 13px;
  color: #F57F17;
  line-height: 1.6;
  border-left: 4px solid var(--accent);
}

.detail-actions {
  padding: 12px 20px 24px;
  display: flex;
  gap: 10px;
  position: sticky;
  bottom: 0;
  background: white;
  border-top: 1px solid var(--border);
}

.detail-actions .btn-primary { margin: 0; }
.detail-actions .btn-fav {
  width: 50px;
  height: auto;
  font-size: 22px;
}

/* ==================== 购物车弹窗 ==================== */
.cart-modal { position: relative; }

.cart-header {
  padding: 20px 20px 12px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.cart-header h2 { font-size: 20px; }

.cart-body {
  padding: 12px 20px;
  max-height: 40vh;
  overflow-y: auto;
}

.cart-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid #F5F5F5;
  animation: fadeInUp 0.3s ease;
}

.cart-item-emoji { font-size: 36px; }

.cart-item-info { flex: 1; }
.cart-item-info h4 { font-size: 15px; }
.cart-item-info p { font-size: 12px; color: var(--text-light); }

.cart-item-remove {
  border: none;
  background: #FFEBEE;
  color: var(--danger);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
}

.cart-item-remove:active { transform: scale(0.85); }

.cart-footer {
  padding: 12px 20px 24px;
  border-top: 1px solid var(--border);
}

.cart-note {
  margin-bottom: 12px;
}

.cart-note input {
  width: 100%;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.3s;
}

.cart-note input:focus { border-color: var(--primary-light); }

.cart-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.meal-select {
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 14px;
  outline: none;
  background: white;
  cursor: pointer;
}

.btn-submit {
  flex: 1;
  border: none;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  padding: 12px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 4px 16px var(--shadow);
}

.btn-submit:active { transform: scale(0.97); }

/* ==================== 提交成功弹窗 ==================== */
.success-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
}

.success-content {
  background: white;
  border-radius: var(--radius-lg);
  padding: 40px 32px;
  text-align: center;
  max-width: 320px;
  width: 90%;
  animation: bounceIn 0.5s ease;
}

.success-hearts {
  font-size: 64px;
  margin-bottom: 16px;
  animation: heartBeat 1s ease-in-out infinite;
}

.success-content h2 {
  font-size: 24px;
  margin-bottom: 8px;
  color: var(--primary);
}

.success-content > p {
  font-size: 14px;
  color: var(--text-light);
  margin-bottom: 20px;
}

.success-animation {
  font-size: 36px;
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 24px;
  animation: successBounce 1s ease infinite;
}

@keyframes successBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.success-content .btn-primary { margin: 0; }

/* ==================== Toast ==================== */
.toast {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: rgba(0,0,0,0.8);
  color: white;
  padding: 10px 24px;
  border-radius: 24px;
  font-size: 14px;
  z-index: 400;
  opacity: 0;
  transition: all 0.3s ease;
  pointer-events: none;
  white-space: nowrap;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ==================== 滚动条美化 ==================== */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--primary-light); border-radius: 4px; }

/* ==================== 响应式 ==================== */
@media (max-width: 360px) {
  .dish-grid { grid-template-columns: 1fr; }
  .random-options { grid-template-columns: 1fr; }
}

@media (min-width: 481px) {
  #app {
    box-shadow: 0 0 40px rgba(0,0,0,0.1);
  }
}

/* ==================== 加载动画 ==================== */
.loading {
  text-align: center;
  padding: 40px;
}

.loading-spinner {
  display: inline-block;
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-text {
  margin-top: 12px;
  color: var(--text-light);
  font-size: 14px;
}

/* ==================== 大厨心里话 ==================== */
.chef-letter {
  background: linear-gradient(135deg, #FFF0F5, #FFE4F0);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.chef-letter::before {
  content: '💕';
  position: absolute;
  top: -8px;
  right: -8px;
  font-size: 60px;
  opacity: 0.1;
  transform: rotate(15deg);
}

.letter-content {
  font-size: 16px;
  line-height: 1.8;
  color: var(--primary-dark);
  font-style: italic;
  font-weight: 500;
  margin-bottom: 12px;
}

.letter-sign {
  font-size: 13px;
  color: var(--text-light);
  text-align: right;
}

/* ==================== 美食氛围 ==================== */
.vibe-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.vibe-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  background: white;
  color: var(--text-secondary);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  animation: tagPop 0.4s ease both;
}

.vibe-tag:nth-child(1) { animation-delay: 0.05s; }
.vibe-tag:nth-child(2) { animation-delay: 0.1s; }
.vibe-tag:nth-child(3) { animation-delay: 0.15s; }
.vibe-tag:nth-child(4) { animation-delay: 0.2s; }
.vibe-tag:nth-child(5) { animation-delay: 0.25s; }
.vibe-tag:nth-child(6) { animation-delay: 0.3s; }

@keyframes tagPop {
  from { opacity: 0; transform: scale(0.8); }
  to { opacity: 1; transform: scale(1); }
}

.vibe-scenes {
  background: white;
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 14px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.scene-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.scene-item {
  font-size: 14px;
  padding: 6px 0;
  color: var(--text-secondary);
  border-bottom: 1px dashed var(--border);
}

.scene-item:last-child { border-bottom: none; }

.love-meter {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, #FFF8E1, #FFFDE7);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
}

.love-meter-label {
  font-size: 13px;
  font-weight: 600;
  color: #F57F17;
}

.love-meter-hearts {
  font-size: 16px;
  letter-spacing: 2px;
}

/* ==================== 美食冷知识 ==================== */
.fun-fact-box {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: linear-gradient(135deg, #E8F5E9, #F1F8E9);
  border-radius: var(--radius);
  padding: 16px;
  border-left: 4px solid var(--success);
}

.fun-fact-icon {
  font-size: 24px;
  flex-shrink: 0;
  animation: lightBulb 2s ease-in-out infinite;
}

@keyframes lightBulb {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-8deg); }
  75% { transform: rotate(8deg); }
}

.fun-fact-text {
  font-size: 14px;
  line-height: 1.7;
  color: #2E7D32;
}

/* ==================== 左右滑动切换动画 ==================== */
.dish-grid.slide-in-left {
  animation: slideFromLeft 0.3s ease;
}

.dish-grid.slide-in-right {
  animation: slideFromRight 0.3s ease;
}

@keyframes slideFromLeft {
  from { opacity: 0; transform: translateX(-40px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes slideFromRight {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}

/* 分类指示器 */
.swipe-indicator {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  background: rgba(0, 0, 0, 0.75);
  color: white;
  padding: 14px 28px;
  border-radius: 20px;
  z-index: 150;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s ease;
  backdrop-filter: blur(10px);
}

.swipe-indicator.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.swipe-label {
  font-size: 18px;
  font-weight: 600;
  white-space: nowrap;
}

.swipe-dots {
  font-size: 12px;
  opacity: 0.7;
}

/* 菜品卡片波纹效果 */
.ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 107, 157, 0.3);
  transform: scale(0);
  animation: rippleEffect 0.6s ease-out;
  pointer-events: none;
}

@keyframes rippleEffect {
  to { transform: scale(4); opacity: 0; }
}
