:root {
  color-scheme: light;
  --bg: #fff8f1;
  --panel: rgba(255, 255, 255, 0.9);
  --panel-strong: #ffffff;
  --line: rgba(120, 53, 15, 0.12);
  --text: #1f2937;
  --muted: #6b7280;
  --brand: #f97316;
  --brand-dark: #ea580c;
  --brand-soft: #ffedd5;
  --shadow: 0 20px 60px rgba(249, 115, 22, 0.16);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top left, rgba(251, 146, 60, 0.22), transparent 34%),
    radial-gradient(circle at top right, rgba(253, 186, 116, 0.18), transparent 26%),
    linear-gradient(180deg, #fff9f3 0%, #fff4ea 48%, #fffaf6 100%);
  color: var(--text);
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}

body {
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input {
  font: inherit;
}

textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.page-view {
  display: none;
}

.page-view.is-active {
  display: block;
}

.app-shell {
  max-width: 820px;
  margin: 0 auto;
  padding: 16px 14px 96px;
}

.hero {
  position: relative;
  overflow: hidden;
  padding: 18px;
  border-radius: 32px;
  background:
    linear-gradient(145deg, rgba(249, 115, 22, 0.98), rgba(234, 88, 12, 0.96)),
    linear-gradient(120deg, #f97316, #fb923c);
  color: #fff;
  box-shadow: var(--shadow);
}

.hero::before,
.hero::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  filter: blur(2px);
}

.hero::before {
  width: 180px;
  height: 180px;
  top: -84px;
  right: -48px;
}

.hero::after {
  width: 120px;
  height: 120px;
  bottom: -54px;
  left: -20px;
}

.hero__topbar,
.hero__card,
.section-head,
.cart-summary,
.checkout-bar,
.dish-card__title-row,
.dish-card__footer,
.cart-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand__mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.22);
  font-weight: 800;
  letter-spacing: 0.04em;
}

.brand__name {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
}

.brand__subtitle {
  margin: 4px 0 0;
  font-size: 0.88rem;
  opacity: 0.9;
}

.icon-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: 1rem;
  backdrop-filter: blur(10px);
}

.hero__card {
  margin-top: 18px;
  padding: 18px;
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(16px);
  align-items: stretch;
}

.hero__info {
  flex: 1;
}

.hero h1 {
  margin: 0;
  font-size: clamp(1.5rem, 5vw, 2.2rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.hero__meta {
  width: min(170px, 100%);
  display: grid;
  gap: 10px;
}

.meta-pill {
  padding: 12px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.meta-pill span {
  display: block;
  font-size: 0.76rem;
  opacity: 0.82;
}

.meta-pill strong {
  display: block;
  margin-top: 5px;
  font-size: 0.98rem;
}

.meta-pill--accent {
  background: rgba(255, 255, 255, 0.2);
}

.search {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.95);
  color: #9ca3af;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.5);
}

.search input {
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

.content {
  display: grid;
  gap: 16px;
  margin-top: 16px;
}

.tabs {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tab {
  flex: 0 0 auto;
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
  border: 1px solid var(--line);
}

.tab.is-active {
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  color: #fff;
  box-shadow: 0 10px 24px rgba(249, 115, 22, 0.25);
}

.section-head {
  padding: 0 2px;
}

.section-head h2 {
  margin: 0;
  font-size: 1.22rem;
}

.dish-list {
  display: grid;
  gap: 14px;
}

.dish-card {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 14px;
  padding: 14px;
  border-radius: 24px;
  background: var(--panel-strong);
  border: 1px solid var(--line);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.05);
}

.dish-card__thumb {
  aspect-ratio: 1 / 1;
  border-radius: 20px;
  background-image:
    var(--dish-image, none),
    radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.72), transparent 22%),
    linear-gradient(135deg, #fed7aa, #fb923c 58%, #ea580c);
  background-size: cover, cover, cover;
  background-position: center, center, center;
  background-repeat: no-repeat;
  position: relative;
  overflow: hidden;
}

.dish-card__thumb::before {
  content: "热";
  position: absolute;
  inset: auto auto 10px 10px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 800;
}

.dish-card__thumb::after {
  content: "";
  position: absolute;
  right: -10px;
  top: 12px;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  filter: blur(2px);
}

.dish-card__body {
  min-width: 0;
}

.dish-card h3 {
  margin: 0;
  font-size: 1.02rem;
}

.tag,
.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  white-space: nowrap;
}

.tag {
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-weight: 700;
}

.dish-card__desc {
  margin: 10px 0 12px;
  color: var(--muted);
  line-height: 1.55;
  font-size: 0.92rem;
}

.dish-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  background: rgba(249, 115, 22, 0.1);
  color: var(--brand-dark);
}

.chip--muted {
  background: #f3f4f6;
  color: #6b7280;
}

.add-btn,
.text-btn,
.back-btn,
.submit-order,
.checkout-bar__btn,
.qty-btn {
  transition:
    transform 0.18s ease,
    background 0.18s ease,
    box-shadow 0.18s ease,
    opacity 0.18s ease;
}

.add-btn,
.checkout-bar__btn,
.submit-order {
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  color: #fff;
  font-weight: 700;
}

.add-btn {
  padding: 10px 14px;
  border-radius: 16px;
  box-shadow: 0 12px 18px rgba(249, 115, 22, 0.22);
}

.text-btn {
  background: transparent;
  color: var(--brand-dark);
  padding: 8px 0;
}

.cart-panel {
  padding: 16px;
  border-radius: 26px;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.cart-panel__head {
  padding: 0;
  margin-bottom: 8px;
}

.cart-empty {
  padding: 18px 14px;
  border-radius: 20px;
  border: 1px dashed rgba(249, 115, 22, 0.22);
  background: rgba(255, 247, 237, 0.8);
  color: var(--muted);
}

.cart-items {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.cart-item {
  padding: 14px;
  border-radius: 18px;
  background: #fff;
  border: 1px solid rgba(249, 115, 22, 0.12);
}

.cart-item h3 {
  margin: 0;
  font-size: 0.98rem;
}

.cart-item__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.qty-btn {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: 1.2rem;
  font-weight: 700;
}

.qty {
  min-width: 20px;
  text-align: center;
}

.cart-summary {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(249, 115, 22, 0.12);
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
}

.cart-summary > div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.cart-summary span {
  color: var(--muted);
}

.cart-summary strong {
  font-size: 1.05rem;
}

.cart-summary__total strong {
  color: var(--brand-dark);
  font-size: 1.2rem;
}

.checkout-bar {
  position: fixed;
  left: 50%;
  bottom: calc(14px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: min(820px, calc(100% - 18px));
  padding: 12px 14px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(249, 115, 22, 0.15);
  backdrop-filter: blur(18px);
  box-shadow: 0 16px 44px rgba(15, 23, 42, 0.16);
}

.checkout-bar__price span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
}

.checkout-bar__price strong {
  display: block;
  color: var(--brand-dark);
  font-size: 1.28rem;
}

.checkout-bar__btn {
  padding: 14px 22px;
  border-radius: 16px;
  min-width: 128px;
}

.checkout-page {
  padding-bottom: 18px;
}

.checkout-head {
  display: grid;
  gap: 18px;
  padding: 18px;
  border-radius: 28px;
  background: linear-gradient(145deg, rgba(249, 115, 22, 0.98), rgba(234, 88, 12, 0.96));
  color: #fff;
  box-shadow: var(--shadow);
}

.checkout-head p,
.checkout-head h1 {
  margin: 0;
}

.checkout-head p {
  opacity: 0.86;
  font-size: 0.9rem;
}

.checkout-head h1 {
  margin-top: 4px;
  font-size: clamp(1.5rem, 5vw, 2.1rem);
  line-height: 1.15;
}

.back-btn {
  justify-self: start;
  padding: 9px 13px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.22);
}

.checkout-content {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.checkout-card {
  padding: 16px;
  border-radius: 24px;
  background: var(--panel-strong);
  border: 1px solid var(--line);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.05);
}

.checkout-card h2 {
  margin: 0 0 14px;
  font-size: 1.14rem;
}

.checkout-list {
  display: grid;
  gap: 10px;
}

.checkout-row,
.checkout-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.checkout-row {
  padding: 10px 0;
  border-bottom: 1px solid rgba(249, 115, 22, 0.1);
}

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

.checkout-total {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(249, 115, 22, 0.16);
}

.checkout-total strong {
  color: var(--brand-dark);
  font-size: 1.35rem;
}

.checkout-form {
  display: grid;
  gap: 13px;
}

.checkout-form label {
  display: grid;
  gap: 7px;
}

.checkout-form label span {
  color: var(--muted);
  font-size: 0.9rem;
}

.checkout-form input,
.checkout-form textarea {
  width: 100%;
  border: 1px solid rgba(249, 115, 22, 0.16);
  border-radius: 16px;
  background: #fffaf6;
  color: var(--text);
  outline: 0;
  padding: 13px 14px;
}

.checkout-form textarea {
  resize: vertical;
  min-height: 88px;
}

.checkout-form input:focus,
.checkout-form textarea:focus {
  border-color: rgba(249, 115, 22, 0.62);
  box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.1);
}

.form-hint {
  margin: -2px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.form-status {
  min-height: 22px;
  color: var(--brand-dark);
  font-size: 0.92rem;
}

.submit-order {
  width: 100%;
  padding: 15px 18px;
  border-radius: 17px;
  box-shadow: 0 12px 18px rgba(249, 115, 22, 0.22);
}

.checkout-form.is-sending .submit-order {
  pointer-events: none;
  opacity: 0.68;
}

.add-btn:hover,
.checkout-bar__btn:hover,
.qty-btn:hover,
.tab:hover,
.icon-btn:hover,
.text-btn:hover,
.back-btn:hover,
.submit-order:hover {
  transform: translateY(-1px);
}

.add-btn:active,
.checkout-bar__btn:active,
.qty-btn:active,
.tab:active,
.icon-btn:active,
.text-btn:active,
.back-btn:active,
.submit-order:active {
  transform: translateY(0);
  opacity: 0.92;
}

@media (max-width: 640px) {
  .app-shell {
    padding-inline: 12px;
  }

  .hero {
    padding: 16px;
    border-radius: 28px;
  }

  .hero__card {
    flex-direction: column;
  }

  .hero__meta {
    width: 100%;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .dish-card {
    grid-template-columns: 88px minmax(0, 1fr);
    padding: 12px;
  }

  .dish-card__footer {
    align-items: flex-end;
  }

  .section-head {
    align-items: flex-start;
  }

  .checkout-bar {
    width: calc(100% - 14px);
  }
}

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

  .dish-card {
    grid-template-columns: 1fr;
  }

  .dish-card__thumb {
    width: 100%;
  }

  .checkout-bar {
    flex-wrap: wrap;
  }

  .checkout-bar__btn {
    width: 100%;
  }
}
