/* 百姓厨房 · 会员中心 / My orders
 * 沿用 tokens.css 的色板与字体（辣椒红 + 芥末黄 + 米纸底）；手机端优先。
 * 铁律：组件内不硬编码色值，一律引用 token 变量。 */

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: var(--font-body);
  background: var(--paper);
  color: var(--ink);
  font-size: var(--text-base);
  line-height: 1.7;
  letter-spacing: 0.02em;
  -webkit-font-smoothing: antialiased;
  padding-bottom: var(--space-xl);
}
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
.hidden { display: none !important; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* ═══════════ 顶部条 ═══════════ */
.m-header {
  position: sticky; top: 0; z-index: var(--z-nav);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.m-header-inner {
  max-width: 720px; margin: 0 auto;
  padding: var(--space-2xs) var(--space-sm);
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-2xs);
  min-height: var(--banner-height);
}
.m-brand { display: flex; align-items: center; gap: var(--space-2xs); }
.m-brand-seal {
  width: 42px; height: 42px; border-radius: var(--radius-sm);
  background: var(--tomato); color: var(--tomato-ink);
  font-family: var(--font-display); font-size: 13px; line-height: 1.1;
  display: flex; align-items: center; justify-content: center; text-align: center;
}
.m-brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.m-brand-text strong { font-family: var(--font-display); font-size: var(--text-sm); letter-spacing: 0.04em; }
.m-brand-text small { color: var(--muted); font-size: var(--text-xs); }
.m-header-actions { display: flex; align-items: center; gap: var(--space-2xs); }
.m-chip {
  border: 1px solid var(--line-strong); background: var(--surface);
  color: var(--ink); border-radius: var(--radius-full);
  padding: 8px 12px; min-height: 40px; font-size: var(--text-sm);
}
.m-chip:hover { background: var(--surface-2); }

/* ═══════════ 布局 ═══════════ */
.m-main { max-width: 720px; margin: 0 auto; padding: var(--space-sm); display: grid; gap: var(--space-sm); }
.m-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-md); box-shadow: var(--shadow-sm);
  padding: var(--space-sm);
}
.m-title { font-family: var(--font-display); font-size: var(--text-lg); line-height: 1.3; }
.m-sub { color: var(--muted); font-size: var(--text-sm); }
.m-hint { color: var(--muted); font-size: var(--text-xs); }

/* ═══════════ 登录 ═══════════ */
.m-form { display: grid; gap: var(--space-xs); margin-top: var(--space-xs); }
.m-label { font-size: var(--text-sm); font-weight: 700; }
.m-input {
  width: 100%; min-height: 48px; padding: 10px 12px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--paper); color: var(--ink); font-size: var(--text-md);
}
.m-btn {
  width: 100%; min-height: 50px; border: 0; border-radius: var(--radius-full);
  background: var(--tomato); color: var(--tomato-ink);
  font-family: var(--font-display); font-size: var(--text-md); font-weight: 700;
  box-shadow: var(--shadow-sm);
}
.m-btn:disabled { opacity: 0.6; }
.m-btn-ghost {
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--line-strong); box-shadow: none;
}
.m-error {
  background: var(--tomato-soft); color: var(--tomato-deep);
  border-radius: var(--radius-sm); padding: 8px 10px; font-size: var(--text-sm);
}

.m-member-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-xs); flex-wrap: wrap; }
.m-name { font-family: var(--font-display); font-size: var(--text-lg); }
.m-block { margin-top: var(--space-sm); }
.m-orders-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2xs); }

/* ═══════════ 订单列表 ═══════════ */
.m-order-list { display: grid; gap: var(--space-xs); margin-top: var(--space-xs); }
.m-order {
  border: 1px solid var(--line); border-radius: var(--radius-md);
  background: var(--surface); padding: var(--space-xs);
  display: grid; gap: var(--space-2xs); text-align: left;
}
.m-order-top { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2xs); flex-wrap: wrap; }
.m-order-no { font-family: var(--font-num); font-weight: 700; font-size: var(--text-sm); }
.m-order-meta { display: flex; gap: var(--space-xs); flex-wrap: wrap; color: var(--muted); font-size: var(--text-xs); }
.m-order-bottom { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2xs); flex-wrap: wrap; }
.m-amount { font-family: var(--font-num); font-size: var(--text-md); font-weight: 700; }

/* ═══════════ 状态徽标 ═══════════ */
.m-badge {
  border-radius: var(--radius-full); padding: 3px 10px;
  font-size: var(--text-xs); font-weight: 700; white-space: nowrap;
  background: var(--surface-2); color: var(--ink-soft); border: 1px solid var(--line);
}
.m-badge.is-pending { background: var(--mustard-soft); color: var(--mustard-deep); border-color: var(--mustard); }
.m-badge.is-paid, .m-badge.is-confirmed { background: var(--herb-soft); color: var(--herb-deep); border-color: var(--herb); }
.m-badge.is-cancelled, .m-badge.is-payment_error { background: var(--tomato-soft); color: var(--tomato-deep); border-color: var(--tomato); }
.m-badge.is-kitchen { background: var(--sky-soft); color: var(--ink-soft); border-color: var(--sky); }

/* ═══════════ 4 段进度条 ═══════════ */
.m-progress { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: var(--space-2xs); }
.m-step { display: grid; gap: 4px; justify-items: center; }
.m-step-bar { width: 100%; height: 6px; border-radius: var(--radius-full); background: var(--line); }
.m-step-label { font-size: var(--text-xs); color: var(--muted); text-align: center; line-height: 1.25; }
.m-step.is-done .m-step-bar { background: var(--herb); }
.m-step.is-now .m-step-bar { background: var(--tomato); }
.m-step.is-now .m-step-label { color: var(--tomato-deep); font-weight: 700; }
.m-step.is-done .m-step-label { color: var(--herb-deep); }

/* ═══════════ 详情抽屉 ═══════════ */
.m-overlay {
  position: fixed; inset: 0; z-index: var(--z-overlay);
  background: oklch(28% 0.03 55 / 0.45);
  display: flex; align-items: flex-end; justify-content: center;
}
.m-sheet {
  background: var(--surface); width: 100%; max-width: 720px;
  max-height: 92vh; overflow-y: auto;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: var(--space-sm); display: grid; gap: var(--space-xs);
}
.m-sheet-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2xs); position: sticky; top: 0; background: var(--surface); padding-bottom: var(--space-2xs); }
.m-close { border: 0; background: var(--surface-2); border-radius: var(--radius-full); width: 40px; height: 40px; font-size: 22px; line-height: 1; color: var(--ink-soft); }
.m-kv { display: flex; justify-content: space-between; gap: var(--space-xs); font-size: var(--text-sm); padding: 3px 0; }
.m-kv span:first-child { color: var(--muted); }
.m-kv span:last-child { text-align: right; font-weight: 600; }
.m-items { display: grid; gap: 6px; border-top: 1px dashed var(--line); border-bottom: 1px dashed var(--line); padding: var(--space-2xs) 0; }
.m-item-row { display: flex; justify-content: space-between; gap: var(--space-xs); font-size: var(--text-sm); }
.m-item-row .m-item-name { display: grid; }
.m-item-row em { color: var(--muted); font-style: normal; font-size: var(--text-xs); }
.m-total-row { display: flex; justify-content: space-between; font-family: var(--font-num); font-size: var(--text-md); font-weight: 700; }

/* ═══════════ Toast ═══════════ */
.m-toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: var(--paper);
  border-radius: var(--radius-full); padding: 10px 18px;
  font-size: var(--text-sm); opacity: 0; pointer-events: none;
  transition: opacity var(--dur-2) var(--ease-out), transform var(--dur-2) var(--ease-out);
  z-index: var(--z-toast); max-width: 90vw; text-align: center;
}
.m-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.m-empty { color: var(--muted); font-size: var(--text-sm); padding: var(--space-sm) 0; text-align: center; }
.m-foot { text-align: center; color: var(--muted); font-size: var(--text-xs); padding: var(--space-xs) 0 var(--space-lg); }
.m-foot a { color: var(--tomato-deep); font-weight: 700; }

/* ═══════════ 桌面/平板 ═══════════ */
@media (min-width: 768px) {
  .m-main { padding: var(--space-md); gap: var(--space-md); }
  .m-card { padding: var(--space-md); }
  .m-overlay { align-items: center; }
  .m-sheet { border-radius: var(--radius-lg); max-width: 560px; }
}

/* ---------- Uber Direct 追踪（2026-09-28）---------- */
.m-track { color: var(--tomato, #e2503a); font-weight: 800; text-decoration: none; }
.m-track-note { color: var(--muted, #8a8a8a); font-size: 12.5px; }
.m-order-track { display: inline-block; margin-top: 6px; font-size: 12px; font-weight: 700; color: var(--tomato, #e2503a); }
