:root {
  color-scheme: light;
  --bg: #f5f5f5;
  --surface: #ffffff;
  --surface-soft: #fafafa;
  --text: #333333;
  --muted: #777777;
  --line: #eeeeee;
  --red: #d9001b;
  --red-soft: #fff1f2;
  --blue: #409eff;
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.055);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

button, input, textarea { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }

.app-shell {
  width: min(100%, 560px);
  min-height: 100vh;
  margin: 0 auto;
  padding-bottom: calc(112px + env(safe-area-inset-bottom));
  background: var(--bg);
  position: relative;
}

.app-header {
  min-height: 68px;
  padding: 12px 16px;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(12px);
}

.app-header h1 { margin: 0; font-size: 18px; line-height: 1.35; }
.app-header p { margin: 2px 0 0; color: var(--muted); font-size: 12px; }

.icon-button {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: #f2f3f5;
  color: var(--text);
  font-size: 30px;
  line-height: 28px;
  cursor: pointer;
}

.is-hidden { visibility: hidden; }

.status-dot {
  max-width: 92px;
  padding: 5px 9px;
  border-radius: 999px;
  background: #f1f3f5;
  color: #6b7280;
  font-size: 11px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.progress {
  display: flex;
  align-items: center;
  padding: 14px 20px;
  background: var(--surface);
}

.progress i { flex: 1; height: 1px; background: #e5e7eb; }
.progress-item { color: #a0a0a0; font-size: 11px; font-style: normal; }
.progress-item.active, .progress-item.done { color: var(--red); font-weight: 700; }

.page { display: none; padding: 12px; }
.page.active { display: block; animation: page-in 180ms ease-out; }

@keyframes page-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.validation-card {
  min-height: 330px;
  padding: 54px 24px;
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.validation-spinner {
  width: 54px;
  height: 54px;
  margin-bottom: 24px;
  border: 4px solid #f6cbd0;
  border-top-color: var(--red);
  border-radius: 50%;
  animation: validation-spin .8s linear infinite;
}

.validation-card h2 { margin: 0; font-size: 21px; }
.validation-card p { margin: 10px 0 0; color: var(--muted); font-size: 14px; line-height: 1.6; }

@keyframes validation-spin {
  to { transform: rotate(360deg); }
}

.intro-card, .form-card, .search-card, .order-overview, .result-card {
  background: var(--surface);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.intro-card {
  min-height: 150px;
  padding: 22px 18px;
  display: grid;
  grid-template-columns: 72px 1fr;
  align-items: center;
  gap: 16px;
  overflow: hidden;
  position: relative;
}

.intro-card::after {
  content: "1";
  position: absolute;
  right: -8px;
  bottom: -50px;
  color: #f7dadd;
  font-size: 150px;
  line-height: 1;
  font-weight: 900;
  z-index: 0;
}

.brand-mark { width: 72px; height: 72px; display: grid; place-items: center; border-radius: 18px; background: var(--red); color: white; font-size: 30px; font-weight: 900; box-shadow: 0 8px 18px rgba(217, 0, 27, .18); z-index: 1; }
.intro-card > div { position: relative; z-index: 1; }
.eyebrow { color: var(--red); font-size: 10px; font-weight: 800; letter-spacing: .12em; }
.intro-card h2 { margin: 5px 0 7px; font-size: 24px; }
.intro-card p { margin: 0; max-width: 260px; color: var(--muted); font-size: 13px; line-height: 1.6; }

.form-card, .search-card { margin-top: 12px; padding: 16px; }
label { display: grid; gap: 8px; color: #555; font-size: 13px; font-weight: 600; }
label + label { margin-top: 14px; }

textarea, input {
  width: 100%;
  border: 1px solid #dcdfe6;
  border-radius: 9px;
  outline: none;
  background: #fff;
  color: var(--text);
  padding: 11px 12px;
  resize: none;
  font-size: 15px;
  transition: border-color .15s, box-shadow .15s;
}

textarea:focus, input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 2px rgba(64, 158, 255, .1);
}

.inline-notice {
  margin-top: 12px;
  padding: 11px 12px;
  border-radius: 8px;
  background: #f7f8fa;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.inline-notice strong { color: var(--text); }
.inline-notice .warn { color: var(--red); }

.field-row { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 10px; }
.small-button {
  height: 42px;
  padding: 0 14px;
  border: 1px solid #dcdfe6;
  border-radius: 9px;
  background: white;
  color: #606266;
  cursor: pointer;
}

.location-status {
  margin: 10px 0 14px;
  padding: 9px 10px;
  border-radius: 8px;
  background: #f0f7ff;
  color: #337ecc;
  font-size: 12px;
  line-height: 1.5;
}

.section-heading { display: flex; align-items: center; justify-content: space-between; padding: 18px 4px 10px; }
.section-heading h2 { margin: 0; font-size: 17px; }
.section-heading span { color: var(--muted); font-size: 12px; }

.store-list { display: grid; gap: 10px; }
.store-card {
  width: 100%;
  padding: 16px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
  text-align: left;
  color: var(--text);
  cursor: pointer;
}

.store-card.selected { border-color: var(--red); box-shadow: 0 0 0 2px rgba(217, 0, 27, .08); }
.store-card.closed { opacity: .5; cursor: not-allowed; }
.store-card-head { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.store-card strong { font-size: 16px; }
.selected-tag, .closed-tag { padding: 3px 7px; border-radius: 5px; font-size: 11px; }
.selected-tag { background: var(--red-soft); color: var(--red); }
.closed-tag { background: #f1f1f1; color: #888; }
.store-address { margin: 10px 0 7px; color: #666; font-size: 13px; line-height: 1.5; }
.store-meta { display: flex; flex-wrap: wrap; gap: 5px 14px; color: #999; font-size: 12px; }

.empty-state {
  min-height: 180px;
  display: grid;
  place-items: center;
  padding: 24px;
  color: #999;
  text-align: center;
}

.meal-box { display: grid; gap: 12px; }
.meal-hero { margin: -12px -12px 0; background: var(--surface); overflow: hidden; }
.meal-hero img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: #eee; }
.meal-hero-copy { padding: 16px; }
.meal-hero h2 { margin: 0 0 7px; font-size: 20px; }
.meal-hero p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.55; }

.product-group { padding: 14px 12px; border-radius: 12px; background: var(--surface); box-shadow: var(--shadow); }
.group-title { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.group-title strong { font-size: 15px; }
.group-title span { color: var(--muted); font-size: 12px; }
.product-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.product-card { min-width: 0; min-height: 132px; padding: 8px 5px; border: 1px solid var(--line); border-radius: 8px; display: flex; flex-direction: column; align-items: center; background: #fff; }
.product-card.saleout { opacity: .45; }
.product-card img { width: 54px; height: 54px; border-radius: 6px; object-fit: cover; }
.product-name { margin-top: 6px; min-height: 30px; color: #333; font-size: 11px; line-height: 1.35; text-align: center; overflow-wrap: anywhere; }
.fixed-count { margin-top: auto; color: #666; font-size: 12px; }
.stepper { margin-top: auto; display: flex; align-items: center; justify-content: center; gap: 7px; }
.stepper button { width: 25px; height: 25px; padding: 0; border: 1px solid #dcdfe6; border-radius: 50%; background: #fff; color: #333; cursor: pointer; }
.stepper button:disabled { color: #c0c4cc; background: #f5f7fa; }
.stepper span { min-width: 13px; font-size: 13px; text-align: center; }

.order-overview { padding: 16px; }
.overview-shop { padding-bottom: 13px; border-bottom: 1px solid var(--line); font-size: 17px; font-weight: 700; }
.overview-product { display: grid; grid-template-columns: 58px 1fr; gap: 12px; padding-top: 14px; align-items: center; }
.overview-product img { width: 58px; height: 58px; border-radius: 8px; object-fit: cover; background: #eee; }
.overview-product strong { display: block; font-size: 15px; }
.overview-product p { margin: 5px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.confirm-form h2 { margin: 0 0 14px; font-size: 17px; }
.order-type-options { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 18px; }
.order-type-option { height: 72px; border: 1px solid #e4e7ed; border-radius: 11px; background: #fff; color: #606266; cursor: pointer; font-weight: 700; }
.order-type-option.active { border-color: var(--red); background: var(--red-soft); color: var(--red); }
.order-warning { margin: 14px 0 0; color: var(--red); font-size: 12px; line-height: 1.5; }

.result-card { padding: 26px 18px; text-align: center; }
.result-icon { width: 52px; height: 52px; margin: 0 auto 12px; display: grid; place-items: center; border-radius: 50%; background: #ecf8f1; color: #21a366; font-size: 28px; }
.result-icon.failed { background: var(--red-soft); color: var(--red); }
.result-title { margin: 0; font-size: 22px; }
.pickup-label { margin-top: 22px; color: var(--muted); font-size: 13px; }
.pickup-number { margin: 3px 0 18px; color: var(--red); font-size: 46px; line-height: 1.1; font-weight: 800; letter-spacing: .06em; }
.result-info { margin-top: 16px; padding-top: 4px; border-top: 1px solid var(--line); text-align: left; }
.result-row { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; color: var(--muted); font-size: 13px; }
.result-row strong { color: var(--text); text-align: right; overflow-wrap: anywhere; }
.result-message { margin: 10px 0 0; color: var(--muted); font-size: 13px; line-height: 1.6; }

.action-bar {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 30;
  width: min(100%, 560px);
  transform: translateX(-50%);
  padding: 10px 16px calc(12px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, .97);
  box-shadow: 0 -2px 10px rgba(0, 0, 0, .08);
  backdrop-filter: blur(12px);
}

.action-hint { margin-bottom: 7px; color: var(--red); font-size: 13px; font-weight: 600; text-align: center; }
.primary-action { width: 100%; height: 52px; border: 0; border-radius: 26px; background: var(--red); color: #fff; font-size: 17px; font-weight: 700; cursor: pointer; }
.primary-action:disabled { background: #f1a1aa; cursor: not-allowed; }

.toast {
  position: fixed;
  left: 50%;
  top: 86px;
  z-index: 100;
  max-width: calc(100vw - 40px);
  transform: translate(-50%, -10px);
  padding: 10px 15px;
  border-radius: 8px;
  background: rgba(0, 0, 0, .78);
  color: #fff;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s, transform .18s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (min-width: 561px) {
  body { padding: 18px 0; }
  .app-shell { min-height: calc(100vh - 36px); border-radius: 20px; overflow: hidden; box-shadow: 0 8px 40px rgba(0, 0, 0, .1); }
  .action-bar { bottom: 18px; border-radius: 0 0 20px 20px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* 门店页沿用历史旧版视觉结构，数据来自当前后端。 */
[hidden] { display: none !important; }
body.popup-open { overflow: hidden; }

.app-shell.store-mode {
  width: 100%;
  max-width: none;
  padding-bottom: calc(96px + env(safe-area-inset-bottom));
  background: #f5f7fa;
  border-radius: 0;
  box-shadow: none;
  overflow: visible;
}

.store-mode .app-header,
.store-mode .progress { display: none; }
.store-mode .page[data-page="store"] { padding: 0; animation: none; }

.legacy-store-list {
  padding: 12px;
  padding-bottom: 70px;
}

.legacy-store-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 20px;
}

.legacy-store-header h2 {
  margin: 0;
  color: #303133;
  font-size: 24px;
  line-height: 1.2;
}

.refresh-store-button {
  width: 32px;
  height: 32px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 1px solid #409eff;
  border-radius: 50%;
  background: #409eff;
  color: #fff;
  cursor: pointer;
}

.refresh-store-button svg,
.city-selector svg,
.city-search-field svg,
.legacy-icon {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.refresh-store-button svg { width: 17px; height: 17px; }
.refresh-store-button.loading svg { animation: validation-spin .8s linear infinite; }
.refresh-store-button:disabled { opacity: .65; cursor: not-allowed; }

.legacy-search-box { padding: 0 0 10px; }
.legacy-search-input {
  height: 44px;
  display: flex;
  align-items: center;
  overflow: hidden;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 0 0 1px #dcdfe6 inset;
  transition: box-shadow .2s;
}
.legacy-search-input:hover { box-shadow: 0 0 0 1px #c0c4cc inset; }
.legacy-search-input:focus-within { box-shadow: 0 0 0 1px #409eff inset; }

.city-selector {
  min-width: 88px;
  height: 36px;
  margin-left: 4px;
  padding: 4px 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #409eff;
  font-size: 15px;
  cursor: pointer;
  user-select: none;
}
.city-selector:active { background: #e6f7ff; }
.city-selector svg { width: 14px; height: 14px; }

.legacy-search-input > input {
  min-width: 0;
  height: 44px;
  padding: 0 8px;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
  font-size: 16px;
}
.legacy-search-input > input:focus { border: 0; box-shadow: none; }

.clear-search {
  width: 34px;
  height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #c0c4cc;
  font-size: 22px;
  visibility: hidden;
  cursor: pointer;
}
.clear-search.visible { visibility: visible; }
.legacy-search-box .location-status { display: none; }

.section-title {
  margin: 16px 0 10px 4px;
  color: #333;
  font-size: 15px;
  font-weight: 600;
}

.last-store-section { margin-bottom: 8px; }
.guess-store-card {
  width: 100%;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid #ffe0e0;
  border-radius: 12px;
  background: linear-gradient(135deg, #fff5f5 0%, #fff 100%);
  text-align: left;
  cursor: pointer;
  transition: transform .2s, border-color .2s, box-shadow .2s;
}
.guess-store-card:active { transform: scale(.98); }
.guess-store-card.selected { border: 2px solid #f5222d; box-shadow: 0 0 8px rgba(245, 34, 45, .15); }
.guess-store-card.closed { filter: grayscale(1); opacity: .6; pointer-events: none; }
.guess-store-name { color: #333; font-size: 16px; font-weight: 600; }

.store-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 10px;
  margin-bottom: 40px;
}

.store-grid .store-card {
  width: 100%;
  min-height: 140px;
  padding: 20px;
  position: relative;
  border: 1.5px solid #ebeef5;
  border-radius: 4px;
  background: #fff;
  box-shadow: none;
  color: #303133;
  text-align: left;
  cursor: pointer;
  transition: transform .3s, box-shadow .3s, border-color .3s;
}
.store-grid .store-card.selected { border: 2px solid #f5222d; box-shadow: 0 0 8px rgba(245, 34, 45, .08); }
.store-grid .store-card.closed { filter: grayscale(1); opacity: .6; pointer-events: none; }
.store-grid .store-info { display: block; padding: 3px; }
.store-grid .store-name {
  display: block;
  margin: 0 0 3px;
  padding-left: 3px;
  color: #303133;
  font-size: 16px;
  font-weight: 700;
}
.store-grid .closed-tag,
.guess-store-card .closed-tag {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 8px;
  background: #bbb;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  vertical-align: middle;
}
.store-details { display: block; color: #606266; }
.store-address,
.store-time,
.store-phone,
.store-distance {
  display: flex;
  align-items: flex-start;
  gap: 5px;
  margin: 3px 0;
  line-height: 1.4;
  font-size: 12px;
  font-weight: 400;
}
.store-grid .store-address { padding-left: 3px; color: #606266; }
.store-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 3px 0;
  padding: 0 3px;
}
.store-info-row .store-phone,
.store-info-row .store-distance { margin: 0; align-items: center; }
.store-phone { color: #409eff; }
.store-distance { color: #67c23a; }
.store-grid .store-time { padding-left: 3px; color: #e6a23c; }
.legacy-icon { width: 14px; height: 14px; margin-top: 1px; flex: 0 0 14px; }

.store-grid.empty-state,
.store-grid.legacy-error {
  min-height: 180px;
  display: grid;
  grid-template-columns: 1fr;
  place-items: center;
  padding: 24px;
  color: #909399;
  text-align: center;
}
.legacy-alert {
  width: min(100%, 560px);
  padding: 14px 16px;
  display: grid;
  gap: 5px;
  border-radius: 4px;
  background: #fef0f0;
  color: #f56c6c;
  text-align: left;
  font-size: 13px;
}

.store-mode .action-bar {
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  padding: 20px 36px calc(20px + env(safe-area-inset-bottom));
  transform: none;
  display: flex;
  justify-content: center;
  background: #fff;
  box-shadow: 0 -2px 8px rgba(0, 0, 0, .04);
  backdrop-filter: none;
  border-radius: 0;
}
.store-mode .action-hint { display: none; }
.store-mode .primary-action {
  width: 90vw;
  max-width: 500px;
  height: 56px;
  border-radius: 28px;
  background: #f56c6c;
  font-size: 18px;
  font-weight: 700;
}
.store-mode .primary-action:disabled { background: #fab6b6; }

.city-popup-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: flex-end;
  background: rgba(0, 0, 0, .5);
}
.city-popup {
  width: 100%;
  height: 80vh;
  display: flex;
  flex-direction: column;
  background: #fff;
}
.city-popup-header {
  flex: 0 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 16px 8px;
  border-bottom: 1px solid #f0f0f0;
  background: #fff;
}
.city-btn {
  width: 90px;
  height: 40px;
  margin: 0 6px;
  border-radius: 20px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}
.city-btn-close { border: 1px solid #e4e7ed; background: #f5f7fa; color: #666; }
.city-btn-confirm { border: 1px solid #409eff; background: #409eff; color: #fff; }
.city-btn-confirm:disabled { border-color: #a0cfff; background: #a0cfff; cursor: not-allowed; }
.city-search-sticky { flex: 0 0 auto; padding: 10px 12px; background: #fff; }
.city-search-field {
  height: 34px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: 2px;
  background: #f7f8fa;
  color: #969799;
}
.city-search-field svg { width: 17px; height: 17px; }
.city-search-field input {
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
  font-size: 16px;
}
.city-search-field input:focus { border: 0; box-shadow: none; }
.city-list-scroll { flex: 1; min-height: 0; overflow-y: auto; }
.city-index-anchor {
  height: 32px;
  padding: 6px 16px;
  background: #f7f8fa;
  color: #323233;
  font-size: 14px;
  font-weight: 600;
}
.city-cell {
  width: 100%;
  min-height: 44px;
  padding: 10px 16px;
  display: block;
  border: 0;
  border-bottom: 1px solid #f5f5f5;
  border-radius: 0;
  background: #fff;
  color: #323233;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
}
.city-cell.city-selected { background: #e6f7ff; color: #409eff; }
.city-empty { padding: 40px 16px; color: #969799; text-align: center; }

.store-loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: rgba(0, 0, 0, .7);
  color: #fff;
  font-size: 14px;
}
.store-loading-spinner {
  width: 42px;
  height: 42px;
  border: 3px solid rgba(255, 255, 255, .35);
  border-top-color: #409eff;
  border-radius: 50%;
  animation: validation-spin .8s linear infinite;
}

@media (max-width: 560px) {
  .store-grid { grid-template-columns: 1fr; }
}

/* 取餐详情页沿用历史旧版视觉结构。 */
.app-shell.result-mode {
  width: 100%;
  max-width: none;
  min-height: 100vh;
  padding-bottom: 0;
  background: #f5f5f5;
  border-radius: 0;
  box-shadow: none;
  overflow: visible;
}
.result-mode .app-header,
.result-mode .progress { display: none; }
.result-mode .page[data-page="result"] { padding: 0; animation: none; }

.order-detail-page {
  min-height: 100vh;
  padding: 1px 0 70px;
  background: #f5f5f5;
}
.order-status-card {
  margin: 16px 12px 0;
  padding: 24px 0 16px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .03);
  text-align: center;
}
.pickup-no-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  text-align: center;
}
.pickup-no {
  width: auto;
  margin-bottom: 4px;
  display: inline-block;
  color: #333;
  font-size: 44px;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: 2px;
}
.pickup-tag {
  margin-left: 8px;
  padding: 2px 8px;
  border: 1px solid #d9001b;
  border-radius: 4px;
  color: #d9001b;
  font-size: 15px;
  font-weight: 500;
}
.phone-tail {
  margin-top: 16px;
  padding: 8px 16px;
  display: inline-block;
  border-radius: 24px;
  background: #f5f5f5;
  color: #666;
  font-size: 15px;
  font-weight: 500;
}
.phone-number { color: #333; font-weight: 600; letter-spacing: 1px; }
.phone-tail-red { color: #d9001b; font-weight: 700; }
.order-status-text {
  margin: 8px 0 0;
  color: #d9001b;
  font-size: 32px;
  line-height: 1.35;
  font-weight: 600;
}
.order-status-note {
  margin: 12px 16px 0;
  color: #909399;
  font-size: 13px;
  line-height: 1.5;
}
.order-steps {
  min-width: 0;
  margin: 40px 0 0;
  padding: 0 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  overflow-x: auto;
}
.order-steps img { width: 60px; height: 60px; flex: 0 0 60px; object-fit: contain; }
.order-steps .step-line {
  width: 50px;
  height: 2px;
  margin: 0 2px;
  flex: none;
  border-top: 2px dashed #eee;
  background: none;
}
.order-shop-card {
  margin: 16px 12px 0;
  padding: 16px;
  border-radius: 12px;
  background: #fff;
}
.shop-title {
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #333;
  font-size: 18px;
  font-weight: 900;
}
.order-goods-list { margin-bottom: 8px; }
.goods-item {
  padding: 8px 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  font-size: 16px;
  font-weight: 500;
}
.goods-item img { width: 50px; height: 50px; object-fit: contain; }
.goods-item1 {
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  font-size: 11px;
  font-weight: 500;
}
.goods-name {
  flex: 1;
  color: #222;
  font-size: 16px;
  font-weight: 500;
  text-align: left;
}
.goods-name1 {
  flex: 1;
  color: #222;
  font-size: 13px;
  font-weight: 500;
  text-align: left;
}
.goods-num {
  margin-left: 8px;
  color: #333;
  font-size: 15px;
  font-weight: 400;
  text-align: left;
}
.order-info-card {
  margin: 16px 12px 0;
  padding: 16px;
  border-radius: 12px;
  background: #fff;
  color: #666;
  font-size: 14px;
}
.order-info-title {
  margin-bottom: 10px;
  color: #222;
  font-size: 18px;
  font-weight: 800;
  text-align: left;
}
.order-info-row {
  padding: 6px 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  border-bottom: 1px solid #f5f5f5;
  font-size: 14px;
  font-weight: 400;
  text-align: left;
}
.order-info-row:last-child { border-bottom: 0; }
.order-info-row span {
  min-width: 18vw;
  display: inline-block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
}
.order-info-row span:last-child { text-align: right; }
.order-info-row span.address-content {
  max-width: 100%;
  display: inline-block;
  white-space: normal;
  word-break: break-all;
  text-align: left;
}
.legacy-result-error {
  margin: 16px 12px;
  padding: 24px 18px;
  display: grid;
  gap: 8px;
  border-radius: 12px;
  background: #fff;
  color: #606266;
  text-align: center;
}
.legacy-result-error strong { color: #d9001b; font-size: 20px; }

/* 商品选择与下单弹窗沿用历史旧版视觉结构。 */
.app-shell.meal-mode {
  width: 100%;
  max-width: none;
  min-height: 100vh;
  padding-bottom: 0;
  background: #f5f7fa;
  border-radius: 0;
  box-shadow: none;
  overflow: visible;
}
.meal-mode .app-header,
.meal-mode .progress { display: none; }
.meal-mode .page[data-page="meal"] { padding: 0; animation: none; }
.legacy-menu { padding: 0; }
.package-image-container {
  width: 100%;
  padding-top: 75%;
  position: relative;
  overflow: hidden;
}
.package-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.legacy-menu .package-name {
  margin: .67em 0 20px;
  padding: 0 12px;
  color: #333;
  font-size: 20px;
  line-height: 1.3;
  font-weight: 700;
  text-align: left;
}
.package-detail {
  margin: 0 0 20px;
  padding: 0 12px;
  color: #666;
  font-size: 18px;
  line-height: 1.5;
  font-weight: 600;
  text-align: left;
}
.menu-content {
  padding: 0 24px 220px 0;
  position: relative;
  z-index: 1;
}
.meal-mode .product-group {
  width: 100%;
  margin-bottom: 24px;
  padding: 0 12px;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.meal-mode .product-group h3 {
  margin: 0;
  color: #333;
  font-size: 16px;
  line-height: 1.5;
  font-weight: 500;
  text-align: left;
}
.meal-mode .product-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.meal-mode .product-card {
  width: 100%;
  min-width: 0;
  height: 120px;
  min-height: 120px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  border: 1px solid #eee;
  border-radius: 8px;
  background: #fff;
  opacity: 1;
}
.meal-mode .product-card.saleout { opacity: .55; }
.meal-mode .product-card img {
  width: 50px;
  height: 50px;
  margin-bottom: 8px;
  border-radius: 0;
  object-fit: cover;
}
.meal-mode .product-name {
  width: 100%;
  min-height: 0;
  margin: 0 0 4px;
  flex: 1;
  color: #222;
  font-size: 10px;
  line-height: 1.3;
  font-weight: 500;
  text-align: center;
  white-space: normal;
  word-break: break-all;
  overflow-wrap: break-word;
}
.meal-mode .saleout-text { color: #f56c6c; }
.meal-mode .fixed-count { margin-top: auto; color: #333; font-size: 13px; }
.selector {
  width: auto;
  min-width: 0;
  max-width: 100%;
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.selector button {
  width: 24px;
  height: 24px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #dcdfe6;
  border-radius: 50%;
  background: #fff;
  color: #222;
  font-size: 16px;
  cursor: pointer;
}
.selector button:disabled { border-color: #e4e7ed; background: #f5f7fa; color: #c0c4cc; cursor: not-allowed; }
.selector span { min-width: 20px; color: #333; font-size: 14px; text-align: center; }
.empty-space { width: 70px; }
.selector button.empty-circle {
  border: 0;
  background: transparent;
  color: #bbb;
  font-size: 24px;
}

.meal-mode .action-bar {
  left: 0;
  bottom: 0;
  width: 100%;
  padding: 0;
  transform: none;
  display: block;
  background: #fff;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, .1);
  backdrop-filter: none;
}
.selected-items-images { padding: 12px; border-bottom: 1px solid #eee; }
.selected-items-images-title { margin-bottom: 8px; color: #333; font-size: 14px; }
.selected-items-list {
  max-height: 50px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  overflow-y: auto;
}
.selected-item-wrapper { width: 48px; height: 48px; position: relative; }
.selected-item-image { width: 40px; height: 40px; border-radius: 4px; object-fit: cover; }
.selected-item-count {
  position: absolute;
  right: 0;
  bottom: 0;
  padding: 2px 4px;
  border-radius: 0 0 4px 0;
  background: rgba(0, 0, 0, .6);
  color: #fff;
  font-size: 12px;
}
.meal-mode .action-hint {
  margin: 0 12px 8px;
  color: red;
  font-size: 18px;
  line-height: 1.4;
  font-weight: 700;
  text-align: center;
}
.meal-mode .primary-action {
  width: 90vw;
  max-width: 500px;
  height: 56px;
  margin: 0 auto calc(12px + env(safe-area-inset-bottom));
  display: block;
  border-radius: 28px;
  background: #f56c6c;
  font-size: 18px;
  font-weight: 700;
}
.meal-mode .primary-action:disabled { background: #fab6b6; }

.order-dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1500;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, .5);
}
.order-type-dialog {
  width: 80%;
  max-width: 560px;
  max-height: 92vh;
  overflow-y: auto;
  border-radius: 12px;
  background: #fff;
}
.order-dialog-header {
  padding: 20px;
  border-bottom: 1px solid #eee;
  text-align: center;
}
.order-dialog-header h2 { margin: 0; color: #333; font-size: 18px; font-weight: 700; }
.order-dialog-body { padding: 30px 20px; }
.order-dialog-body .order-type-options {
  margin: 0;
  display: flex;
  justify-content: space-around;
  gap: 20px;
}
.order-dialog-body .order-type-option {
  height: auto;
  min-width: 0;
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  border: 2px solid #eee;
  border-radius: 12px;
  background: #fff;
  color: #666;
  cursor: pointer;
  transition: border-color .3s, background .3s;
}
.order-dialog-body .order-type-option.active { border-color: #409eff; background: #ecf5ff; color: #409eff; }
.option-icon {
  width: 32px;
  height: 32px;
  margin-bottom: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.option-text { color: #333; font-size: 16px; font-weight: 400; }
.order-type-option.active .option-text { color: #409eff; }
.remark-section { margin-top: 20px; padding: 0 10px; }
.remark-section textarea,
.remark-section input {
  border-radius: 8px;
  font-size: 16px;
}
.remark-section textarea { padding-bottom: 25px; resize: none; }
.remark-section input { margin-top: 24px; padding-right: 48px; }
.input-counter {
  height: 18px;
  margin: -23px 10px 5px 0;
  position: relative;
  color: #909399;
  font-size: 12px;
  text-align: right;
  pointer-events: none;
}
.remark-section .input-error { border-color: #f56c6c; box-shadow: 0 0 0 1px rgba(245, 108, 108, .15); }
.error-text { margin-top: 4px; color: #f56c6c; font-size: 12px; }
.order-notice { padding: 15px 20px 0; border-top: 1px solid #eee; text-align: center; }
.order-notice p {
  margin: 0;
  padding: 12px 16px;
  border: 1px solid #fbc4c4;
  border-radius: 6px;
  background: #fef0f0;
  color: #f56c6c;
  font-size: 14px;
  line-height: 1.5;
  font-weight: 500;
}
.store-name-red { color: #f56c6c; font-size: 16px; font-weight: 500; }
.dialog-footer {
  padding: 20px;
  display: flex;
  justify-content: center;
  gap: 20px;
  text-align: center;
}
.footer-btn {
  max-width: 200px;
  height: 44px;
  flex: 1;
  border-radius: 22px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
}
.cancel-btn { border: 1px solid #dcdfe6; background: #f5f7fa; color: #606266; }
.confirm-btn { border: 1px solid #409eff; background: #409eff; color: #fff; }
.footer-btn:disabled { opacity: .7; cursor: not-allowed; }

@media (max-width: 360px) {
  .order-type-dialog { width: 90%; }
  .order-dialog-body { padding: 24px 14px; }
  .order-dialog-body .order-type-options { gap: 10px; }
  .order-dialog-body .order-type-option { padding: 16px 10px; }
}
