:root {
  --brand: #ee1d48;
  --brand-dark: #c4183d;
  --bg: #f6f7fb;
  --card: #fff;
  --text: #1a1a1a;
  --muted: #6b7280;
  --radius: 12px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

a {
  color: var(--brand);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--card);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  font-weight: 800;
  color: var(--brand);
  font-size: 1.1rem;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: center;
  font-size: 0.9rem;
}

.nav a {
  color: var(--text);
}
.nav a:hover {
  color: var(--brand);
}

.badge {
  display: inline-block;
  min-width: 18px;
  padding: 0 5px;
  margin-left: 4px;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-size: 0.7rem;
  line-height: 18px;
  text-align: center;
}

.main {
  max-width: 960px;
  margin: 0 auto;
  padding: 20px 16px 48px;
}

.footer {
  text-align: center;
  padding: 24px;
}

.hero {
  margin-bottom: 20px;
}

.hero__brand {
  text-align: center;
  margin-bottom: 16px;
}

.hero__logo {
  max-height: 64px;
  margin-bottom: 8px;
}

.hero__title {
  margin: 0;
  font-size: 1.5rem;
}

.hero__sub {
  color: var(--muted);
  margin: 8px 0 0;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}

.card--cta {
  text-align: center;
  margin-top: 12px;
}

.toolbar {
  margin-bottom: 20px;
}

.search-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.input {
  flex: 1;
  min-width: 140px;
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  font-size: 1rem;
}

.input--sm {
  max-width: 120px;
}

textarea.input {
  width: 100%;
  resize: vertical;
}

.btn {
  display: inline-block;
  padding: 10px 16px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
}

.btn--primary {
  background: var(--brand);
  color: #fff;
}
.btn--primary:hover {
  background: var(--brand-dark);
}

.btn--ghost {
  background: transparent;
  color: var(--brand);
  border: 1px solid var(--brand);
}

.btn--block {
  width: 100%;
}

.btn--sm {
  padding: 6px 10px;
  font-size: 0.85rem;
}

.section {
  margin-top: 28px;
}

.section__title {
  font-size: 1.15rem;
  margin: 0 0 12px;
}

.banner-strip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.banner-card {
  display: block;
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  color: inherit;
}
.banner-card:hover {
  text-decoration: none;
  opacity: 0.95;
}
.banner-card img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  display: block;
}
.banner-card span {
  display: block;
  padding: 8px 10px;
  font-size: 0.9rem;
}

.chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  padding: 8px 14px;
  background: #fff;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  font-size: 0.9rem;
  color: var(--text);
}
.chip:hover {
  border-color: var(--brand);
  text-decoration: none;
}

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

.card--rest {
  display: block;
  overflow: hidden;
  color: inherit;
  transition: transform 0.15s;
}
.card--rest:hover {
  transform: translateY(-2px);
  text-decoration: none;
}

.card__img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  display: block;
  background: #eee;
}
.card__img--ph {
  height: 120px;
}

.card__body {
  padding: 10px 12px;
}

.card__name {
  font-weight: 700;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 0.85rem;
}

.auth-card {
  max-width: 420px;
  margin: 0 auto;
}

.auth-card label {
  display: block;
  margin-bottom: 12px;
  font-size: 0.9rem;
}

.auth-card .input {
  width: 100%;
  margin-top: 4px;
}

.login-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 16px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid rgba(238, 29, 72, 0.25);
}

.login-tab {
  flex: 1;
  padding: 10px 12px;
  border: none;
  background: var(--bg);
  color: var(--muted);
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.login-tab--active {
  background: var(--brand);
  color: #fff;
  font-weight: 600;
}

.login-panel {
  margin-bottom: 4px;
}

.login-hint {
  margin: 0 0 12px;
  line-height: 1.5;
}

.login-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0 16px;
  color: var(--muted);
  font-size: 0.85rem;
}

.login-divider::before,
.login-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(0, 0, 0, 0.08);
}

.login-oauth {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal[hidden] {
  display: none !important;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}

.modal__box {
  position: relative;
  z-index: 1;
  max-width: 400px;
  width: 100%;
  max-height: 90vh;
  overflow: auto;
  margin: 0;
}

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

.modal__close {
  border: none;
  background: transparent;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
  padding: 0 4px;
}

.modal__close:hover {
  color: var(--text);
}

.wechat-qr-container {
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wechat-qr-img {
  display: block;
  max-width: 100%;
  height: auto;
}

.wechat-qr-status {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 0.9rem;
  line-height: 1.45;
}

.wechat-qr-status--info {
  background: rgba(59, 130, 246, 0.12);
  color: #1e40af;
}

.wechat-qr-status--success {
  background: rgba(16, 185, 129, 0.15);
  color: #047857;
}

.wechat-qr-status--warning {
  background: rgba(245, 158, 11, 0.2);
  color: #b45309;
}

.login-otp-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
  margin-bottom: 12px;
}

.login-otp-row__field {
  flex: 1 1 160px;
  margin-bottom: 0;
  display: block;
  font-size: 0.9rem;
}

.login-otp-row__btn {
  flex: 0 0 auto;
  white-space: nowrap;
  margin-bottom: 2px;
}

.modal__box--phone-sms {
  max-width: 480px;
}

.phone-sms-frame-wrap {
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
  min-height: 320px;
}

.phone-sms-frame {
  width: 100%;
  height: 420px;
  border: 0;
  display: block;
}

.modal__box--wechat-qr {
  max-width: 420px;
}

.wechat-qr-loading {
  text-align: center;
  padding: 24px 16px;
}

.wechat-qr-spinner {
  width: 36px;
  height: 36px;
  margin: 0 auto 12px;
  border: 3px solid rgba(238, 29, 72, 0.2);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: wechat-spin 0.8s linear infinite;
}

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

.wechat-qr-loading-text {
  margin: 0;
}

.checkout-form__field {
  display: block;
  margin-bottom: 12px;
  font-size: 0.9rem;
}

.checkout-form__field .input {
  width: 100%;
  margin-top: 4px;
}

.req {
  color: var(--brand);
  font-weight: 700;
}

.detail-head {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

@media (min-width: 600px) {
  .detail-head {
    grid-template-columns: 200px 1fr;
    align-items: start;
  }
}

.detail-head__img {
  width: 100%;
  max-height: 200px;
  object-fit: cover;
  border-radius: var(--radius);
}

.menu-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.menu-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  align-items: center;
  padding: 12px;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

@media (max-width: 520px) {
  .menu-row {
    grid-template-columns: 1fr;
  }
}

.menu-row__name {
  font-weight: 600;
}

.menu-row__price {
  font-weight: 600;
  color: var(--brand);
}

.order-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.order-card--link {
  display: block;
  color: inherit;
  text-decoration: none;
}
.order-card--link:hover {
  box-shadow: 0 6px 28px rgba(0, 0, 0, 0.08);
}

/* 订单详情：餐厅 / 骑手进展 */
.order-flow {
  margin: 16px 0;
  padding: 14px 12px;
  background: linear-gradient(180deg, #fffaf8 0%, #fff 100%);
  border-radius: var(--radius);
  border: 1px solid #fce7e8;
}
.order-flow--bad {
  background: #fef2f2;
  border-color: #fecaca;
}
.order-flow__title {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 10px;
  color: var(--text);
}
.order-flow__alert {
  margin: 0;
  color: #991b1b;
  font-size: 0.9rem;
}
.order-flow__lanes {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 10px;
  font-size: 0.75rem;
}
.order-flow__lane--r {
  color: #c2410c;
  font-weight: 600;
}
.order-flow__lane--d {
  color: #1d4ed8;
  font-weight: 600;
}
.order-flow__track {
  display: flex;
  align-items: flex-start;
  gap: 0;
  overflow-x: auto;
  padding: 4px 0 8px;
  -webkit-overflow-scrolling: touch;
}
.order-flow__col {
  flex: 0 0 auto;
  width: 76px;
  text-align: center;
}
.order-flow__dot-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 6px;
}
.order-flow__dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid #d1d5db;
  background: #f9fafb;
  transition: transform 0.15s ease;
}
.order-flow__dot--done {
  background: var(--brand);
  border-color: var(--brand);
}
.order-flow__dot--current {
  background: #fff;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(238, 29, 72, 0.22);
  transform: scale(1.12);
}
.order-flow__dot--todo {
  opacity: 0.65;
}
.order-flow__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: center;
}
.order-flow__label {
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.25;
  color: var(--text);
}
.order-flow__side {
  font-size: 0.65rem;
  color: #6b7280;
  line-height: 1.2;
}
.order-flow__hint {
  font-size: 0.62rem;
  line-height: 1.2;
  max-width: 76px;
}
.order-flow__line {
  flex: 0 0 14px;
  width: 14px;
  align-self: flex-start;
  margin-top: 5px;
  height: 3px;
  border-radius: 2px;
  flex-shrink: 0;
}
.order-flow__line--done {
  background: var(--brand);
  opacity: 0.85;
}
.order-flow__line--todo {
  background: #e5e7eb;
}
.order-flow__caption {
  margin: 8px 0 0;
  font-size: 0.75rem;
}
.order-detail__status-text {
  margin: 0 0 8px;
  font-size: 0.9rem;
}

.order-card__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.pill {
  background: #fef2f2;
  color: var(--brand);
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.8rem;
}

.profile {
  text-align: center;
}

.profile__avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
}

.error,
.error-card {
  color: #b91c1c;
}

.cart-lines {
  padding-left: 18px;
}

/* toast */
.toast-host {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: min(360px, 100vw - 32px);
}

.toast {
  padding: 10px 14px;
  border-radius: 10px;
  background: #111827;
  color: #fff;
  font-size: 0.9rem;
  box-shadow: var(--shadow);
}

.toast--ok {
  background: #065f46;
}
.toast--err {
  background: #991b1b;
}

.global-loading {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.5);
  z-index: 50;
  align-items: center;
  justify-content: center;
}

.global-loading--on {
  display: flex;
}

.global-loading__spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #e5e7eb;
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.boot-placeholder {
  margin: 0;
}

.boot-pre {
  white-space: pre-wrap;
  font-size: 12px;
  overflow: auto;
  max-height: 200px;
  background: #f3f4f6;
  padding: 8px;
  border-radius: 8px;
}

.pay-methods {
  margin: 12px 0;
}
.pay-methods__row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 6px 0;
  cursor: pointer;
  font-weight: 500;
}
.pay-methods__row input {
  margin: 0;
}
