:root {
  --bg: #faf7f2;
  --card: #ffffff;
  --text: #222222;
  --text-sub: #6b6b6b;
  --primary: #ff6b35;
  --primary-dark: #e85520;
  --primary-soft: #fff0ea;
  --green: #16a34a;
  --green-soft: #dcfce7;
  --amber: #d97706;
  --amber-soft: #fef3c7;
  --border: #ede6dc;
  --shadow: 0 4px 16px rgba(60, 35, 15, 0.06);
  --radius: 16px;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

.app-shell {
  max-width: 560px;
  margin: 0 auto;
  min-height: 100vh;
  padding-bottom: 100px;
  background: var(--bg);
}

/* 顶部栏 */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 10px;
  background: rgba(250, 247, 242, 0.94);
  backdrop-filter: blur(10px);
}

.topbar-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-icon {
  font-size: 28px;
  line-height: 1;
}

.topbar h1 {
  margin: 0;
  font-size: 19px;
  font-weight: 700;
}

.topbar p {
  margin: 0;
  font-size: 12px;
  color: var(--text-sub);
}

.icon-btn {
  border: 1px solid var(--border);
  background: var(--card);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  font-size: 16px;
  cursor: pointer;
  display: grid;
  place-items: center;
}

/* 角色切换 Tabs */
.role-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 4px 16px 12px;
  padding: 4px;
  background: #efe9e0;
  border-radius: 14px;
}

.role-tab {
  border: none;
  background: transparent;
  padding: 10px 8px;
  border-radius: 11px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-sub);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.18s ease;
}

.role-tab.active {
  background: var(--card);
  color: var(--primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.view {
  display: none;
  padding: 0 16px;
}

.view.active {
  display: block;
}

/* 搜索框 */
.search-bar-wrap {
  margin-bottom: 12px;
}

.search-bar-wrap input {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
  font-size: 14px;
  outline: none;
}

.search-bar-wrap input:focus {
  border-color: var(--primary);
}

/* 分类条 */
.category-pills {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 10px;
  margin-bottom: 6px;
  scrollbar-width: none;
}
.category-pills::-webkit-scrollbar {
  display: none;
}

.pill {
  flex: 0 0 auto;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text-sub);
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.pill.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* 菜品卡片 */
.menu-list,
.kitchen-orders-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dish-card {
  display: flex;
  gap: 12px;
  background: var(--card);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  align-items: stretch;
}

.dish-emoji {
  width: 66px;
  height: 66px;
  border-radius: 14px;
  background: var(--primary-soft);
  display: grid;
  place-items: center;
  font-size: 34px;
  flex-shrink: 0;
}

.dish-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.dish-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.dish-name {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
}

.dish-meta {
  font-size: 12px;
  color: var(--text-sub);
  margin-top: 2px;
}

.dish-summary {
  margin: 6px 0 8px;
  font-size: 13px;
  color: var(--text-sub);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.dish-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.tags-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.tag {
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 6px;
  background: #f5f0e8;
  color: #6b5b4b;
}

.add-btn {
  flex-shrink: 0;
  border: none;
  background: var(--primary);
  color: #fff;
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.add-btn.in-cart {
  background: var(--green-soft);
  color: var(--green);
}

/* 底部购物车 */
.cart-bar {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: max(14px, env(safe-area-inset-bottom));
  width: calc(100% - 28px);
  max-width: 528px;
  background: #24211f;
  color: #fff;
  border-radius: 999px;
  padding: 8px 8px 8px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.25);
  z-index: 40;
}

.cart-bar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
  cursor: pointer;
}

.cart-bubble {
  background: var(--primary);
  border-radius: 999px;
  padding: 6px 11px;
  font-size: 14px;
  font-weight: 700;
}

.cart-info {
  min-width: 0;
}

.cart-title {
  font-size: 14px;
}

.cart-sub {
  font-size: 11px;
  color: #c9c2ba;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.primary-btn {
  border: none;
  background: var(--primary);
  color: #fff;
  padding: 11px 18px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.primary-btn:active {
  background: var(--primary-dark);
}

.secondary-btn {
  width: 100%;
  border: 1px dashed #d3c7b8;
  background: var(--card);
  color: var(--text);
  padding: 12px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 16px;
}

.ghost-btn {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-sub);
  padding: 11px 14px;
  border-radius: 999px;
  font-size: 14px;
  cursor: pointer;
}

.text-btn {
  border: none;
  background: transparent;
  color: var(--primary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

/* 大厨端 */
.kitchen-summary-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
  margin-bottom: 12px;
}

.summary-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.summary-title {
  font-size: 15px;
  font-weight: 700;
}

.summary-desc {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--text-sub);
}

.note-banner {
  margin-top: 10px;
  padding: 9px 12px;
  border-radius: 10px;
  background: var(--amber-soft);
  color: #92400e;
  font-size: 13px;
  font-weight: 600;
}

.prep-section {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.prep-toggle-btn {
  width: 100%;
  border: none;
  background: var(--card);
  padding: 13px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  color: var(--text);
}

.prep-content {
  padding: 0 14px 14px;
  border-top: 1px solid var(--border);
  font-size: 13px;
}

.prep-group-title {
  margin: 10px 0 6px;
  font-weight: 700;
  color: var(--primary);
}

.prep-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.prep-chip {
  background: #f6f1ea;
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 12px;
}

.kitchen-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
}

.kitchen-card.is-done {
  opacity: 0.72;
}

.kitchen-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.kitchen-card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 700;
}

.status-pill {
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
}

.status-pending {
  background: var(--primary-soft);
  color: var(--primary);
}

.status-cooking {
  background: var(--amber-soft);
  color: var(--amber);
}

.status-done {
  background: var(--green-soft);
  color: var(--green);
}

.kitchen-card-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.kitchen-card-actions button {
  flex: 1;
}

.empty-state {
  text-align: center;
  padding: 36px 16px;
  color: var(--text-sub);
  background: var(--card);
  border-radius: var(--radius);
  border: 1px dashed var(--border);
}

.empty-state .empty-emoji {
  font-size: 40px;
  margin-bottom: 8px;
}

/* 弹窗 */
.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}

.modal-sheet {
  position: relative;
  width: 100%;
  max-width: 560px;
  max-height: 82vh;
  background: var(--card);
  border-radius: 20px 20px 0 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-sheet-tall {
  max-height: 90vh;
}

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

.sheet-header h3 {
  margin: 0;
  font-size: 17px;
}

.close-btn {
  border: none;
  background: #f3eee7;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 15px;
  cursor: pointer;
}

.sheet-body {
  padding: 14px 16px;
  overflow-y: auto;
  flex: 1;
}

.sheet-footer {
  padding: 12px 16px max(16px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
  background: #fcfaf7;
}

.note-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
}

.sheet-footer input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  margin-bottom: 10px;
}

.sheet-actions {
  display: flex;
  gap: 8px;
}

.flex-1 {
  flex: 1;
}

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

/* 菜谱详情 */
.recipe-detail-body h4 {
  margin: 16px 0 8px;
  font-size: 15px;
  color: var(--primary);
}

.recipe-detail-body h4:first-child {
  margin-top: 0;
}

.ing-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.ing-item {
  background: #f9f6f1;
  padding: 8px 10px;
  border-radius: 10px;
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  gap: 6px;
}

.ing-amt {
  color: var(--text-sub);
  font-weight: 600;
}

.steps-list {
  padding-left: 0;
  list-style: none;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.steps-list li {
  display: flex;
  gap: 10px;
  font-size: 15px;
  line-height: 1.65;
  background: #fcfaf7;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid #f1ebe2;
}

.step-num {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: grid;
  place-items: center;
  margin-top: 2px;
}

.tip-box {
  margin-top: 14px;
  padding: 12px;
  border-radius: 12px;
  background: var(--amber-soft);
  color: #854d0e;
  font-size: 14px;
}

/* Toast */
.toast {
  position: fixed;
  top: 72px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(34, 34, 34, 0.92);
  color: #fff;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 13px;
  z-index: 100;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.hidden {
  display: none !important;
}
