/* ============ 全局样式 ============ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "PingFang SC", "Microsoft YaHei", -apple-system, sans-serif;
}

body {
  background: #FFF8F0;
  min-height: 100vh;
  color: #3d2b1f;
}

/* ============ 登录页 ============ */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #FFE8D6 0%, #FFDAB9 50%, #FFB88C 100%);
  padding: 20px;
}

.login-card {
  background: #fff;
  border-radius: 24px;
  padding: 48px 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 20px 60px rgba(255, 123, 66, 0.25);
  text-align: center;
}

.login-logo {
  font-size: 64px;
  margin-bottom: 12px;
}

.login-title {
  font-size: 28px;
  font-weight: 700;
  color: #E85D3D;
  margin-bottom: 6px;
}

.login-subtitle {
  font-size: 14px;
  color: #b8a99a;
  margin-bottom: 32px;
}

.login-form .form-group {
  margin-bottom: 18px;
  text-align: left;
}

.login-form label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #7a6a5f;
  margin-bottom: 6px;
}

.login-form input {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid #FFE3D0;
  border-radius: 12px;
  font-size: 16px;
  transition: border-color 0.2s;
  outline: none;
}

.login-form input:focus {
  border-color: #FF8C42;
}

.btn {
  display: inline-block;
  border: none;
  border-radius: 12px;
  padding: 14px 24px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary {
  width: 100%;
  background: linear-gradient(135deg, #FF8C42, #FF6B35);
  color: #fff;
  box-shadow: 0 6px 20px rgba(255, 107, 53, 0.35);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(255, 107, 53, 0.45);
}

.login-error {
  color: #e74c3c;
  font-size: 14px;
  margin-top: 12px;
  min-height: 20px;
}

/* ============ 用户端 - 点餐 ============ */
.user-page {
  max-width: 480px;
  margin: 0 auto;
  padding: 20px 16px 100px;
}

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

.user-greeting h1 {
  font-size: 24px;
  color: #3d2b1f;
}

.user-greeting p {
  font-size: 13px;
  color: #a08d7e;
  margin-top: 4px;
}

.btn-logout {
  background: #fff;
  border: 1px solid #f0d9c8;
  color: #c96f4a;
  border-radius: 20px;
  padding: 8px 16px;
  font-size: 13px;
  cursor: pointer;
}

/* 餐次选择 tabs */
.meal-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.meal-tab {
  flex: 1;
  border: 2px solid #FFE3D0;
  background: #fff;
  border-radius: 16px;
  padding: 14px 8px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}

.meal-tab.active {
  background: linear-gradient(135deg, #FF8C42, #FF6B35);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 6px 16px rgba(255, 107, 53, 0.3);
}

.meal-tab .tab-emoji {
  font-size: 26px;
  display: block;
  margin-bottom: 4px;
}

.meal-tab .tab-name {
  font-size: 15px;
  font-weight: 600;
}

.meal-tab .tab-count {
  font-size: 11px;
  opacity: 0.7;
  margin-top: 2px;
}

/* 菜品列表 */
.dish-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.dish-card {
  background: #fff;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(61, 43, 31, 0.06);
  cursor: pointer;
  transition: all 0.2s;
  border: 2.5px solid transparent;
  position: relative;
}

.dish-card.selected {
  border-color: #FF6B35;
  box-shadow: 0 8px 20px rgba(255, 107, 53, 0.25);
}

.dish-card.selected::after {
  content: "✓";
  position: absolute;
  top: 10px;
  right: 10px;
  width: 26px;
  height: 26px;
  background: #FF6B35;
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
}

.dish-image {
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
}

.dish-info {
  padding: 12px 14px 14px;
}

.dish-name {
  font-size: 15px;
  font-weight: 700;
  color: #3d2b1f;
  margin-bottom: 4px;
}

.dish-flavor {
  font-size: 11.5px;
  color: #a08d7e;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 底部提交栏 */
.submit-bar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  background: #fff;
  padding: 14px 20px;
  box-shadow: 0 -6px 20px rgba(61, 43, 31, 0.08);
  display: flex;
  gap: 12px;
  align-items: center;
  z-index: 100;
}

.submit-bar .selected-info {
  flex: 1;
  font-size: 14px;
  color: #7a6a5f;
}

.submit-bar .selected-info strong {
  color: #FF6B35;
}

.btn-submit {
  background: linear-gradient(135deg, #FF8C42, #FF6B35);
  color: #fff;
  border: none;
  border-radius: 24px;
  padding: 14px 32px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(255, 107, 53, 0.35);
}

.btn-submit:disabled {
  background: #e0d5cc;
  box-shadow: none;
  cursor: not-allowed;
}

/* 备注 */
.note-input {
  width: 100%;
  border: 2px solid #FFE3D0;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 14px;
  margin-bottom: 16px;
  outline: none;
  background: #fff;
}

.note-input:focus {
  border-color: #FF8C42;
}

/* 菜品详情弹窗 */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(61, 43, 31, 0.5);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

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

.modal {
  background: #fff;
  border-radius: 24px;
  max-width: 480px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  padding: 28px;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: #FFF0E5;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 16px;
  cursor: pointer;
  color: #c96f4a;
}

.dish-detail-emoji {
  text-align: center;
  font-size: 72px;
  margin: 10px 0;
}

.dish-detail-name {
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  color: #3d2b1f;
}

.dish-detail-flavor {
  text-align: center;
  font-size: 14px;
  color: #c96f4a;
  margin: 8px 0 16px;
  line-height: 1.6;
}

.recipe-section {
  margin-top: 20px;
}

.recipe-section h3 {
  font-size: 16px;
  color: #E85D3D;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.ingredient-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ingredient-list li {
  background: #FFF4EC;
  color: #8a5a3e;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 13px;
}

.step-list {
  list-style: none;
  counter-reset: step;
}

.step-list li {
  counter-increment: step;
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
  font-size: 14px;
  line-height: 1.6;
  color: #5a4a3e;
}

.step-list li::before {
  content: counter(step);
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  background: #FF8C42;
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}

.recipe-tips {
  background: #FFF9E8;
  border-left: 4px solid #FFC53D;
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 13px;
  color: #8a6d3b;
  line-height: 1.6;
}

/* toast 提示 */
.toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  background: rgba(61, 43, 31, 0.9);
  color: #fff;
  padding: 16px 32px;
  border-radius: 16px;
  font-size: 15px;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s;
  z-index: 999;
  text-align: center;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

/* 历史订单 */
.order-history {
  margin-top: 24px;
}

.order-history h2 {
  font-size: 18px;
  color: #3d2b1f;
  margin-bottom: 14px;
}

.order-card {
  background: #fff;
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: 0 2px 8px rgba(61, 43, 31, 0.05);
}

.order-card .order-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.order-card .order-meal-type {
  font-size: 13px;
  font-weight: 700;
  color: #FF6B35;
  background: #FFF0E5;
  padding: 4px 12px;
  border-radius: 12px;
}

.order-card .order-time {
  font-size: 12px;
  color: #a08d7e;
}

.order-card .order-dishes {
  font-size: 14px;
  color: #5a4a3e;
  line-height: 1.6;
}

.order-card .order-note {
  font-size: 12px;
  color: #c96f4a;
  margin-top: 6px;
  background: #FFF9F5;
  padding: 6px 10px;
  border-radius: 8px;
}

/* ============ 管理后台 ============ */
.admin-page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 20px 60px;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 2px solid #FFE3D0;
}

.admin-header h1 {
  font-size: 24px;
  color: #3d2b1f;
}

.admin-header .admin-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* 后台导航 tabs */
.admin-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  background: #fff;
  padding: 6px;
  border-radius: 16px;
  box-shadow: 0 2px 8px rgba(61, 43, 31, 0.05);
}

.admin-tab {
  flex: 1;
  border: none;
  background: transparent;
  border-radius: 12px;
  padding: 12px;
  font-size: 15px;
  font-weight: 600;
  color: #a08d7e;
  cursor: pointer;
  transition: all 0.2s;
}

.admin-tab.active {
  background: linear-gradient(135deg, #FF8C42, #FF6B35);
  color: #fff;
  box-shadow: 0 4px 12px rgba(255, 107, 53, 0.25);
}

/* 今日订单 */
.today-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}

.meal-summary-card {
  background: #fff;
  border-radius: 18px;
  padding: 20px;
  text-align: center;
  box-shadow: 0 4px 14px rgba(61, 43, 31, 0.06);
}

.meal-summary-card .meal-emoji {
  font-size: 36px;
  margin-bottom: 6px;
}

.meal-summary-card .meal-title {
  font-size: 16px;
  font-weight: 700;
  color: #3d2b1f;
}

.meal-summary-card .meal-dishes {
  font-size: 13px;
  color: #7a6a5f;
  margin-top: 8px;
  line-height: 1.6;
}

.meal-summary-card .meal-empty {
  font-size: 12px;
  color: #ccc;
  margin-top: 8px;
}

/* 订单列表 */
.admin-section-title {
  font-size: 18px;
  font-weight: 700;
  color: #3d2b1f;
  margin: 24px 0 14px;
}

.order-table {
  width: 100%;
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(61, 43, 31, 0.06);
}

.order-table table {
  width: 100%;
  border-collapse: collapse;
}

.order-table th {
  background: #FFF4EC;
  color: #8a5a3e;
  font-size: 13px;
  font-weight: 700;
  padding: 14px 16px;
  text-align: left;
}

.order-table td {
  padding: 14px 16px;
  font-size: 14px;
  border-top: 1px solid #FFF4EC;
  color: #5a4a3e;
}

.dish-name-link {
  color: #FF6B35;
  cursor: pointer;
  text-decoration: underline;
}

.dish-name-link:hover {
  color: #E85D3D;
}

/* 菜品管理 */
.admin-toolbar {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}

.admin-toolbar input {
  flex: 1;
  border: 2px solid #FFE3D0;
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 14px;
  outline: none;
}

.admin-toolbar input:focus {
  border-color: #FF8C42;
}

.btn-add {
  background: linear-gradient(135deg, #52c41a, #389e0d);
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(82, 196, 26, 0.3);
}

.dish-manage-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}

.dish-manage-card {
  background: #fff;
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 4px 14px rgba(61, 43, 31, 0.06);
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.dish-manage-card .dish-m-emoji {
  font-size: 40px;
  flex-shrink: 0;
}

.dish-manage-card .dish-m-info {
  flex: 1;
  min-width: 0;
}

.dish-manage-card .dish-m-name {
  font-size: 15px;
  font-weight: 700;
  color: #3d2b1f;
  margin-bottom: 4px;
}

.dish-manage-card .dish-m-flavor {
  font-size: 12px;
  color: #a08d7e;
  line-height: 1.5;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.dish-manage-card .dish-m-actions {
  display: flex;
  gap: 8px;
}

.btn-sm {
  border: none;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.btn-view {
  background: #FFF0E5;
  color: #FF6B35;
}

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

/* 账号管理 */
.user-table {
  width: 100%;
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(61, 43, 31, 0.06);
}

.user-table table {
  width: 100%;
  border-collapse: collapse;
}

.user-table th {
  background: #FFF4EC;
  color: #8a5a3e;
  font-size: 13px;
  font-weight: 700;
  padding: 14px 16px;
  text-align: left;
}

.user-table td {
  padding: 14px 16px;
  font-size: 14px;
  border-top: 1px solid #FFF4EC;
  color: #5a4a3e;
}

.role-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
}

.role-badge.admin {
  background: #FFF0E5;
  color: #FF6B35;
}

.role-badge.user {
  background: #E8F4FD;
  color: #1890ff;
}

/* 表单弹窗 */
.form-group {
  margin-bottom: 16px;
  text-align: left;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #7a6a5f;
  margin-bottom: 6px;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  border: 2px solid #FFE3D0;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 14px;
  outline: none;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: #FF8C42;
}

.form-group textarea {
  resize: vertical;
  min-height: 70px;
}

.form-group .checkbox-group {
  display: flex;
  gap: 12px;
  margin-top: 4px;
}

.form-group .checkbox-group label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: #5a4a3e;
  cursor: pointer;
}

.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

.btn-cancel {
  flex: 1;
  background: #f5efe9;
  color: #7a6a5f;
  border: none;
  border-radius: 12px;
  padding: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.btn-confirm {
  flex: 1;
  background: linear-gradient(135deg, #FF8C42, #FF6B35);
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

/* 搜索结果高亮 */
.search-highlight {
  background: #FFF3CD;
  padding: 0 2px;
  border-radius: 3px;
}

/* 网络菜谱搜索结果 */
.web-result-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.web-result-card {
  background: #fff;
  border-radius: 16px;
  padding: 16px 18px;
  box-shadow: 0 4px 14px rgba(61, 43, 31, 0.06);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

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

.web-result-title {
  font-size: 15px;
  font-weight: 700;
  color: #3d2b1f;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.web-result-title a {
  color: inherit;
  text-decoration: none;
}

.web-result-title a:hover {
  color: #FF6B35;
  text-decoration: underline;
}

.web-result-source {
  background: #FFF0E5;
  color: #c96f4a;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 10px;
  flex-shrink: 0;
}

.web-result-snippet {
  font-size: 13px;
  color: #a08d7e;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.btn-open-recipe {
  background: linear-gradient(135deg, #FF8C42, #FF6B35);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 4px 10px rgba(255, 107, 53, 0.25);
  flex-shrink: 0;
}

.btn-open-recipe:hover {
  transform: translateY(-1px);
}

/* 许愿新菜按钮（老婆端） */
.wish-btn {
  width: 100%;
  margin-top: 14px;
  padding: 12px 16px;
  border: 2px dashed #ff6b8a;
  border-radius: 12px;
  background: #fff5f7;
  color: #e64980;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.wish-btn:hover {
  background: #ffe4ec;
  border-style: solid;
}

/* 许愿菜爱心角标（菜品卡片） */
.wish-badge {
  position: absolute;
  top: 8px;
  right: 10px;
  font-size: 18px;
  filter: drop-shadow(0 2px 3px rgba(230, 73, 128, 0.4));
  animation: wishPulse 1.6s ease-in-out infinite;
}

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

/* 许愿标签（后台菜品管理列表） */
.wish-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 8px;
  border-radius: 20px;
  background: #ffe4ec;
  color: #e64980;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

/* 视频来源角标 */
.video-source {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 8px;
  border-radius: 20px;
  background: #eef4ff;
  color: #3b82f6;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

/* 菜谱筹备中提示 */
.recipe-pending {
  text-align: center;
  padding: 28px 16px;
  border-radius: 12px;
  background: #fff5f7;
  color: #e64980;
  font-size: 14px;
  line-height: 1.8;
}

/* 空状态 */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: #b8a99a;
}

.empty-state .empty-emoji {
  font-size: 48px;
  margin-bottom: 10px;
}

.empty-state p {
  font-size: 14px;
}

/* 响应式 */
@media (max-width: 768px) {
  .today-summary {
    grid-template-columns: 1fr;
  }

  .admin-tabs {
    flex-wrap: wrap;
  }

  .admin-tab {
    flex: 1 1 40%;
  }

  .order-table,
  .user-table {
    overflow-x: auto;
  }
}

@media (max-width: 480px) {
  .dish-list {
    grid-template-columns: 1fr 1fr;
  }

  .admin-toolbar {
    flex-direction: column;
  }
}

/* ============ ICP 备案信息 ============ */
.icp-footer {
  text-align: center;
  padding: 20px 16px 22px;
  font-size: 12px;
  line-height: 1.8;
  color: #a08d7e;
}

.icp-footer a {
  color: #a08d7e;
  text-decoration: none;
  transition: color 0.2s;
}

.icp-footer a:hover {
  color: #FF6B35;
  text-decoration: underline;
}

/* 登录页：固定在最底部，不占文档流 */
.icp-footer--fixed {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 10px 16px;
  z-index: 5;
  color: #8a6f5c;
}

/* 登录页背景是橙色渐变，加深颜色 + 浅色描边保证可读性 */
.icp-footer--fixed a {
  color: #7a5d49;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.7);
}
