:root {
  --bg: #f5f6f8;
  --card: #ffffff;
  --primary: #ff7a45;
  --primary-dark: #e8622f;
  --text: #222;
  --muted: #888;
  --border: #eaeaea;
  --danger: #e53935;
  --ok: #2e9e5b;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

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

html,
body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
}

#app {
  max-width: 640px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg);
  padding-bottom: 64px;
}

/* 顶栏 */
.topbar {
  position: sticky;
  top: 0;
  background: var(--primary);
  color: #fff;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 10;
}
.topbar h1 {
  font-size: 17px;
  margin: 0;
  font-weight: 600;
}
.topbar .who {
  font-size: 13px;
  opacity: 0.95;
}

/* 内容区 */
.content {
  padding: 14px;
}
.section-title {
  font-size: 15px;
  font-weight: 600;
  margin: 6px 2px 10px;
}

/* 按钮 */
.btn {
  display: inline-block;
  border: none;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 14px;
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  text-align: center;
}
.btn:active {
  background: var(--primary-dark);
}
.btn.block {
  width: 100%;
}
.btn.ghost {
  background: #fff;
  color: var(--primary);
  border: 1px solid var(--primary);
}
.btn.danger {
  background: #fff;
  color: var(--danger);
  border: 1px solid var(--danger);
}
.btn.small {
  padding: 6px 10px;
  font-size: 13px;
}
.btn:disabled {
  opacity: 0.5;
}

/* 卡片 */
.card {
  background: var(--card);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 12px;
  margin-bottom: 12px;
}

/* 分类 chip */
.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 0 10px;
}
.chip {
  flex: 0 0 auto;
  padding: 7px 14px;
  border-radius: 20px;
  background: #fff;
  border: 1px solid var(--border);
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}
.chip.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* 菜品卡片 */
.dish {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.dish img {
  width: 76px;
  height: 76px;
  border-radius: 10px;
  object-fit: cover;
  background: #eee;
  flex: 0 0 auto;
}
.dish .info {
  flex: 1;
  min-width: 0;
}
.dish .name {
  font-weight: 600;
  font-size: 15px;
}
.dish .recipe {
  color: var(--muted);
  font-size: 13px;
  margin-top: 4px;
  white-space: pre-wrap;
  word-break: break-word;
}
.dish .actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* 用料 / 做法 */
.ingredients {
  color: var(--muted);
  font-size: 13px;
  margin-top: 4px;
  word-break: break-word;
}
.recipe-toggle {
  margin-top: 6px;
  display: inline-block;
  border: none;
  background: #fff0e8;
  color: var(--primary-dark);
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
}
.recipe-text {
  margin-top: 6px;
  font-size: 13px;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
  background: #fafafa;
  border-radius: 8px;
  padding: 8px;
}

/* 选菜弹窗：左侧分类 + 右侧带图菜品 */
.order-picker {
  display: flex;
  gap: 10px;
  height: 54vh;
  margin-top: 6px;
}
.cat-side {
  flex: 0 0 84px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-right: 2px;
}
.cat-tab {
  flex: 0 0 auto;
  padding: 10px 6px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid var(--border);
  font-size: 13px;
  text-align: center;
  cursor: pointer;
  line-height: 1.3;
}
.cat-tab.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.dish-area {
  flex: 1;
  overflow-y: auto;
  min-width: 0;
}
.picker-dish {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: var(--card);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 10px;
  margin-bottom: 10px;
}
.picker-dish img {
  width: 64px;
  height: 64px;
  border-radius: 10px;
  object-fit: cover;
  background: #eee;
  flex: 0 0 auto;
}
.picker-info {
  flex: 1;
  min-width: 0;
}
.picker-info .name {
  font-weight: 600;
  font-size: 15px;
}
.stepper {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}
.stepper b {
  min-width: 18px;
  text-align: center;
}

/* 表单 */
.field {
  margin-bottom: 12px;
}
.field label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 5px;
}
.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  font-size: 15px;
  background: #fff;
  font-family: inherit;
}
.field textarea {
  min-height: 84px;
  resize: vertical;
}

/* 底部导航 */
.tabbar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 640px;
  background: #fff;
  border-top: 1px solid var(--border);
  display: flex;
}
.tabbar button {
  flex: 1;
  border: none;
  background: none;
  padding: 8px 0;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
}
.tabbar button.active {
  color: var(--primary);
  font-weight: 600;
}
.tabbar .ico {
  font-size: 20px;
  display: block;
  margin-bottom: 2px;
}

/* 弹窗 */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 50;
}
.modal {
  background: #fff;
  width: 100%;
  max-width: 640px;
  border-radius: 16px 16px 0 0;
  padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
  max-height: 86vh;
  overflow-y: auto;
}
.modal h3 {
  margin: 0 0 14px;
  font-size: 16px;
}
.modal .row {
  display: flex;
  gap: 10px;
  margin-top: 6px;
}

/* 点单 */
.seg {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}
.seg button {
  flex: 1;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 10px;
  padding: 9px 0;
  font-size: 14px;
  cursor: pointer;
}
.seg button.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.summary-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px dashed var(--border);
}
.summary-item:last-child {
  border-bottom: none;
}
.tag {
  display: inline-block;
  background: #fff0e8;
  color: var(--primary-dark);
  border-radius: 8px;
  padding: 2px 8px;
  font-size: 12px;
  margin: 2px 4px 2px 0;
}

.order-card .orderer {
  font-weight: 600;
  margin-bottom: 6px;
}

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 80px;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.82);
  color: #fff;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 14px;
  z-index: 100;
  max-width: 80%;
  text-align: center;
}

.empty {
  text-align: center;
  color: var(--muted);
  padding: 30px 0;
  font-size: 14px;
}

.auth-wrap {
  max-width: 360px;
  margin: 12vh auto 0;
  padding: 0 20px;
}
.auth-wrap h2 {
  text-align: center;
  color: var(--primary);
}
.auth-toggle {
  text-align: center;
  margin-top: 14px;
  font-size: 13px;
  color: var(--muted);
}
.auth-toggle a {
  color: var(--primary);
  cursor: pointer;
}
.gate-hint {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
  margin: 0 0 14px;
}
.mu {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.mu img {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  object-fit: cover;
  background: #eee;
}
