/* 全局样式 */
.app-container {
  min-height: 100vh;
  padding-bottom: 40px;
}

/* 顶部导航 */
.header {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 28px;
  color: #667eea;
  font-weight: 700;
}

.header-actions {
  display: flex;
  gap: 15px;
  align-items: center;
}

.admin-btn {
  background: #f8f9fa;
  border: 1px solid #ddd;
  padding: 8px 16px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.3s;
}

.admin-btn:hover {
  background: #667eea;
  color: white;
  border-color: #667eea;
}

.cart-btn {
  position: relative;
  cursor: pointer;
  padding: 10px;
  border-radius: 50%;
  transition: all 0.3s;
}

.cart-btn:hover {
  background: #f0f0f0;
}

.cart-icon {
  font-size: 24px;
}

.cart-badge {
  position: absolute;
  top: 0;
  right: 0;
  background: #ff4757;
  color: white;
  font-size: 12px;
  font-weight: bold;
  padding: 2px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

/* 消息提示 */
.message {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 24px;
  border-radius: 8px;
  color: white;
  font-weight: 500;
  z-index: 1000;
  animation: slideDown 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.message.success {
  background: #2ed573;
}

.message.error {
  background: #ff4757;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

/* 主内容区 */
.main-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

/* 分类筛选 */
.category-filter {
  display: flex;
  gap: 10px;
  margin-bottom: 30px;
  flex-wrap: wrap;
  justify-content: center;
}

.category-btn {
  padding: 10px 20px;
  border: 2px solid white;
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border-radius: 25px;
  cursor: pointer;
  transition: all 0.3s;
  font-size: 14px;
  font-weight: 500;
}

.category-btn:hover {
  background: rgba(255, 255, 255, 0.4);
}

.category-btn.active {
  background: white;
  color: #667eea;
}

/* 菜品网格 */
.menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.menu-card {
  background: white;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s, box-shadow 0.3s;
}

.menu-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.menu-image {
  width: 100%;
  height: 150px;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 60px;
  overflow: hidden;
}

.menu-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.menu-info {
  padding: 20px;
}

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

.menu-header h3 {
  font-size: 18px;
  color: #333;
}

.category-tag {
  font-size: 12px;
  color: #667eea;
  background: rgba(102, 126, 234, 0.1);
  padding: 4px 10px;
  border-radius: 12px;
}

.description {
  color: #666;
  font-size: 14px;
  margin-bottom: 10px;
  line-height: 1.5;
}

.ingredients {
  color: #888;
  font-size: 12px;
  margin-bottom: 15px;
  line-height: 1.4;
  font-style: italic;
}

.ingredients strong {
  color: #667eea;
  font-style: normal;
}

.menu-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.add-btn {
  background: #667eea;
  color: white;
  border: none;
  padding: 10px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.3s;
  font-weight: 500;
}

.add-btn:hover {
  background: #5a6fd6;
  transform: scale(1.05);
}

/* 购物车侧边栏 */
.cart-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 200;
  display: flex;
  justify-content: flex-end;
}

.cart-panel {
  width: 100%;
  max-width: 400px;
  background: white;
  height: 100%;
  display: flex;
  flex-direction: column;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
  }
  to {
    transform: translateX(0);
  }
}

.cart-header {
  padding: 20px;
  border-bottom: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cart-header h2 {
  color: #333;
}

.close-btn {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #999;
  transition: color 0.3s;
}

.close-btn:hover {
  color: #333;
}

.empty-cart {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #999;
}

.empty-cart p:first-child {
  font-size: 18px;
  margin-bottom: 10px;
}

.hint {
  font-size: 14px;
}

.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.cart-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px;
  border-bottom: 1px solid #f0f0f0;
}

.item-info h4 {
  color: #333;
}

.quantity-control {
  display: flex;
  align-items: center;
  gap: 12px;
}

.quantity-control button {
  width: 28px;
  height: 28px;
  border: 1px solid #ddd;
  background: white;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.3s;
}

.quantity-control button:hover {
  background: #f0f0f0;
}

.quantity-control span {
  font-weight: 500;
  min-width: 20px;
  text-align: center;
}

.cart-footer {
  padding: 20px;
  border-top: 2px solid #eee;
  background: #fafafa;
}

.clear-btn {
  width: 100%;
  padding: 12px;
  margin-bottom: 10px;
  background: white;
  border: 1px solid #ddd;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s;
}

.clear-btn:hover {
  background: #f0f0f0;
}

.checkout-btn {
  width: 100%;
  padding: 14px;
  background: #667eea;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

.checkout-btn:hover {
  background: #5a6fd6;
}

/* 弹窗样式 */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-content {
  background: white;
  border-radius: 16px;
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  animation: fadeIn 0.3s ease;
}

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

.modal-header {
  padding: 20px;
  border-bottom: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h2 {
  color: #333;
}

/* 表单样式 */
.order-form {
  padding: 20px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  color: #333;
  font-weight: 500;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
  transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #667eea;
}

.order-summary {
  background: #f8f9fa;
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 20px;
}

.order-summary h3 {
  margin-bottom: 15px;
  color: #333;
}

.summary-item {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  color: #666;
}

.submit-btn {
  width: 100%;
  padding: 16px;
  background: #2ed573;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

.submit-btn:hover:not(:disabled) {
  background: #26b965;
}

.submit-btn:disabled {
  background: #95a5a6;
  cursor: not-allowed;
}

/* 过渡动画 */
.slide-enter-active,
.slide-leave-active {
  transition: opacity 0.3s;
}

.slide-enter-from,
.slide-leave-to {
  opacity: 0;
}

.fade-enter-active,
.fade-leave-active {
  transition: opacity 0.3s;
}

.fade-enter-from,
.fade-leave-to {
  opacity: 0;
}

/* 管理界面样式 */
.admin-modal {
  max-width: 700px;
}

.admin-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  padding: 20px;
}

.admin-form-section,
.admin-list-section {
  background: #f8f9fa;
  padding: 20px;
  border-radius: 12px;
}

.admin-form-section h3,
.admin-list-section h3 {
  margin-bottom: 15px;
  color: #333;
  font-size: 16px;
}

.emoji-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.emoji-item {
  font-size: 24px;
  padding: 8px;
  text-align: center;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.3s;
  background: white;
}

.emoji-item:hover {
  background: #e0e0e0;
}

.emoji-item.active {
  background: #667eea;
  transform: scale(1.1);
}

.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 15px;
}

.cancel-btn,
.save-btn {
  flex: 1;
  padding: 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s;
}

.cancel-btn {
  background: white;
  border: 1px solid #ddd;
}

.cancel-btn:hover {
  background: #f0f0f0;
}

.save-btn {
  background: #667eea;
  color: white;
  border: none;
}

.save-btn:hover:not(:disabled) {
  background: #5a6fd6;
}

.save-btn:disabled {
  background: #95a5a6;
  cursor: not-allowed;
}

.admin-list {
  max-height: 400px;
  overflow-y: auto;
}

.admin-list-item {
  display: flex;
  align-items: center;
  padding: 12px;
  background: white;
  border-radius: 8px;
  margin-bottom: 8px;
  gap: 10px;
}

.item-emoji {
  font-size: 24px;
}

.item-details {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.item-name {
  font-weight: 500;
  color: #333;
}

.item-category {
  font-size: 12px;
  color: #667eea;
}

.item-ingredients {
  font-size: 11px;
  color: #888;
  font-style: italic;
  margin-top: 2px;
}

.item-actions {
  display: flex;
  gap: 5px;
}

.edit-btn,
.delete-btn {
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  border: none;
  transition: all 0.3s;
}

.edit-btn {
  background: #3498db;
  color: white;
}

.edit-btn:hover {
  background: #2980b9;
}

.delete-btn {
  background: #e74c3c;
  color: white;
}

.delete-btn:hover {
  background: #c0392b;
}

@media (max-width: 768px) {
  .admin-content {
    grid-template-columns: 1fr;
  }
  
  .emoji-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 768px) {
  .menu-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  }
  
  .cart-panel {
    max-width: 100%;
  }
  
  .modal-content {
    max-height: 95vh;
  }
}

/* 图片上传区域 */
.image-upload-area {
  width: 100%;
  height: 160px;
  border: 2px dashed #c3cfe2;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  background: #f5f7fa;
  transition: border-color 0.3s, background 0.3s;
}

.image-upload-area:hover {
  border-color: #667eea;
  background: #f0f2ff;
}

.upload-preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.emoji-preview {
  font-size: 64px;
  line-height: 1;
}

.upload-placeholder {
  text-align: center;
  color: #999;
}

.upload-icon {
  font-size: 36px;
  display: block;
  margin-bottom: 8px;
}

.upload-hint-sub {
  font-size: 11px;
  color: #bbb;
  margin-top: 4px;
}

.upload-loading {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: #667eea;
}

.upload-hint {
  font-size: 12px;
  color: #888;
  margin-top: 8px;
  margin-bottom: 4px;
}

.emoji-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 18px;
  outline: none;
  transition: border-color 0.3s;
}

.emoji-input:focus {
  border-color: #667eea;
}

/* 管理列表缩略图 */
.admin-thumb {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 6px;
  display: block;
}