:root {
  --green: #16c784;
  --green-dark: #087a50;
  --green-soft: #e8f8f1;
  --ink: #1e2823;
  --muted: #89958f;
  --line: #e4ebe7;
  --surface: #ffffff;
  --page: #eef4f0;
  --shadow: 0 12px 32px rgba(27, 74, 52, 0.1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--page);
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible { outline: 3px solid rgba(22, 199, 132, 0.25); outline-offset: 2px; }

.app-shell {
  width: min(100%, 680px);
  min-height: 100vh;
  margin: 0 auto;
  padding-bottom: 104px;
  background: #f8fbf9;
  box-shadow: 0 0 40px rgba(31, 65, 49, 0.08);
  overflow: clip;
}

.hero {
  position: relative;
  height: 188px;
  overflow: hidden;
  color: white;
  background: linear-gradient(135deg, #10c987, #11bd78);
}
.hero::before,
.hero::after,
.hero-shape {
  content: "";
  position: absolute;
  pointer-events: none;
}
.hero::before {
  inset: -72px auto auto 32%;
  width: 170px;
  height: 270px;
  background: rgba(255,255,255,.09);
  transform: rotate(-43deg);
}
.hero::after {
  right: -48px;
  bottom: -95px;
  width: 235px;
  height: 235px;
  border-radius: 50%;
  background: rgba(255,255,255,.08);
}
.shape-one { left: -42px; bottom: -62px; width: 150px; height: 150px; border-radius: 50%; background: rgba(0, 140, 91, .13); }
.shape-two { right: 34%; top: 58px; width: 105px; height: 210px; background: rgba(255,255,255,.06); transform: rotate(43deg); }
.chef-portrait {
  position: absolute;
  z-index: 2;
  left: 17px;
  bottom: -2px;
  height: 166px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 8px 12px rgba(0, 86, 54, .18));
}
.hero-copy {
  position: absolute;
  z-index: 3;
  left: 130px;
  right: 15px;
  top: 0;
  height: 100%;
  text-align: center;
}
.shop-sign {
  position: absolute;
  top: 11px;
  left: 50%;
  width: min(216px, 100%);
  transform: translateX(-50%);
}
.shop-sign img { display: block; width: 100%; height: 66px; object-fit: fill; }
.shop-sign span {
  position: absolute;
  left: 16px;
  right: 16px;
  top: 28px;
  overflow: hidden;
  color: #684622;
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.hero h1 { margin: 84px 0 1px; font-size: clamp(25px, 7.1vw, 40px); line-height: 1.2; letter-spacing: -1px; white-space: nowrap; }
.hero p { margin: 0; font-size: 14px; font-weight: 600; opacity: .95; }

.random-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 50px;
  padding: 7px 18px;
  color: #f4e9d2;
  background: #353534;
}
.random-strip div { display: flex; align-items: center; gap: 8px; min-width: 0; }
.random-strip strong { overflow: hidden; font-size: 14px; white-space: nowrap; text-overflow: ellipsis; }
.random-strip button {
  flex: none;
  min-width: 88px;
  margin-left: 12px;
  padding: 7px 14px;
  border: 0;
  border-radius: 999px;
  color: #684622;
  background: #f7e9cb;
  font-size: 13px;
  font-weight: 800;
}

.search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  margin: 10px 12px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: white;
  box-shadow: 0 4px 16px rgba(30, 70, 50, .05);
}
.search-wrap > span { color: var(--green); font-size: 24px; line-height: 1; transform: rotate(-20deg); }
.search-wrap input { min-width: 0; flex: 1; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 14px; }
.search-wrap input::placeholder { color: #a4ada8; }
.search-wrap button { display: none; width: 28px; height: 28px; border: 0; border-radius: 50%; color: #718078; background: #edf2ef; }
.search-wrap.has-value button { display: grid; place-items: center; }

.menu-layout {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  align-items: start;
  border-top: 1px solid var(--line);
}
.category-nav {
  position: sticky;
  top: 0;
  max-height: 100vh;
  overflow-y: auto;
  align-self: start;
  scrollbar-width: none;
  background: #f0f7f3;
}
.category-nav::-webkit-scrollbar { display: none; }
.category-button {
  position: relative;
  display: flex;
  width: 100%;
  min-height: 62px;
  padding: 10px 8px 9px 16px;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 3px;
  border: 0;
  color: #59655f;
  background: transparent;
  text-align: left;
}
.category-button strong { font-size: 14px; font-weight: 700; }
.category-button span { color: #9aa59f; font-size: 10px; }
.category-button.active { color: var(--green-dark); background: white; }
.category-button.active::before { content: ""; position: absolute; left: 0; top: 17px; bottom: 17px; width: 4px; border-radius: 0 4px 4px 0; background: var(--green); }
.category-button.active span { color: #5dad8a; }

.dish-panel { min-width: 0; padding: 13px 12px 24px; background: white; scroll-margin-top: 8px; }
.dish-list { display: grid; gap: 18px; }
.stream-category { min-width: 0; scroll-margin-top: 8px; }
.stream-heading { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin: 0 2px 12px; }
.stream-heading p { margin: 0 0 2px; color: var(--green); font-size: 11px; font-weight: 800; letter-spacing: .04em; }
.stream-heading h2 { margin: 0; font-size: 20px; }
.stream-heading > span { padding-bottom: 2px; color: #97a19c; font-size: 12px; }
.category-card-list { display: grid; gap: 12px; }
.dish-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 7px 20px rgba(31, 79, 55, .075);
}
.dish-image {
  display: block;
  width: 100%;
  height: clamp(132px, 38vw, 180px);
  max-height: 180px;
  object-fit: cover;
  background: #edf3ef;
}
.dish-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 65px;
  padding: 9px 10px 10px 12px;
}
.dish-copy { min-width: 0; }
.dish-copy h3 { margin: 0 0 3px; overflow: hidden; font-size: 16px; white-space: nowrap; text-overflow: ellipsis; }
.dish-copy p { margin: 0; overflow: hidden; color: #a0aaa5; font-size: 11px; white-space: nowrap; text-overflow: ellipsis; }
.choose-button {
  min-width: 74px;
  padding: 8px 12px;
  border: 0;
  border-radius: 999px;
  color: white;
  background: var(--green);
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 6px 14px rgba(22, 199, 132, .22);
}
.quantity { display: grid; grid-template-columns: 30px 24px 30px; align-items: center; justify-content: end; }
.quantity button { display: grid; width: 30px; height: 30px; place-items: center; border: 0; border-radius: 50%; color: white; background: var(--green); font-size: 20px; line-height: 1; }
.quantity button:first-child { border: 1px solid #c8ded3; color: var(--green-dark); background: white; }
.quantity span { color: var(--ink); font-size: 14px; font-weight: 800; text-align: center; }
.empty-state { padding: 48px 12px; color: #8d9892; text-align: center; }
.empty-state > span { font-size: 36px; }
.empty-state h3 { margin: 8px 0 4px; color: var(--ink); }
.empty-state p { margin: 0; font-size: 13px; }
.load-sentinel { display: flex; align-items: center; gap: 10px; padding: 8px 4px 2px; color: #95a29b; font-size: 11px; text-align: center; }
.load-sentinel::before, .load-sentinel::after { content: ""; height: 1px; flex: 1; background: #e2ebe6; }
.load-sentinel span { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.load-sentinel i { width: 13px; height: 13px; border: 2px solid #cfe5da; border-top-color: var(--green); border-radius: 50%; animation: sentinel-spin .8s linear infinite; }
.stream-ending { padding: 10px 6px 2px; color: #9aa59f; font-size: 11px; text-align: center; }
@keyframes sentinel-spin { to { transform: rotate(360deg); } }

.cart-bar {
  position: fixed;
  z-index: 30;
  left: 50%;
  bottom: max(10px, env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: minmax(0, 1fr) 128px;
  width: min(calc(100% - 20px), 660px);
  min-height: 64px;
  padding: 8px;
  transform: translateX(-50%);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 20px;
  background: rgba(32, 42, 37, .96);
  box-shadow: 0 14px 34px rgba(24, 40, 32, .26);
  backdrop-filter: blur(10px);
}
.cart-summary { display: flex; min-width: 0; align-items: center; gap: 10px; border: 0; color: white; background: transparent; text-align: left; }
.cart-summary > span:last-child { display: flex; min-width: 0; flex-direction: column; }
.cart-summary strong { font-size: 15px; }
.cart-summary small { overflow: hidden; margin-top: 2px; color: #aeb8b3; font-size: 11px; white-space: nowrap; text-overflow: ellipsis; }
.cart-icon { position: relative; display: grid; width: 42px; height: 42px; place-items: center; flex: none; border-radius: 14px; background: #4b5650; font-size: 23px; }
.cart-icon b { position: absolute; right: -4px; top: -5px; display: grid; min-width: 20px; height: 20px; padding: 0 5px; place-items: center; border: 2px solid #28312c; border-radius: 999px; color: white; background: var(--green); font-size: 10px; }
.checkout-button { border: 0; border-radius: 15px; color: white; background: var(--green); font-weight: 800; }
.checkout-button:disabled { cursor: not-allowed; color: #83918a; background: #536059; }

.overlay { position: fixed; z-index: 40; inset: 0; background: rgba(14, 26, 20, .48); backdrop-filter: blur(2px); }
.drawer {
  position: fixed;
  z-index: 50;
  left: 50%;
  bottom: 0;
  width: min(100%, 680px);
  max-height: min(78vh, 720px);
  padding: 10px 18px calc(18px + env(safe-area-inset-bottom));
  transform: translate(-50%, 105%);
  border-radius: 26px 26px 0 0;
  background: white;
  box-shadow: 0 -18px 48px rgba(20, 51, 36, .2);
  transition: transform .28s ease;
}
.drawer.open { transform: translate(-50%, 0); }
.drawer-handle { width: 42px; height: 5px; margin: 0 auto 15px; border-radius: 99px; background: #d7dfda; }
.drawer-header { display: flex; align-items: end; justify-content: space-between; margin-bottom: 10px; }
.drawer-header p { margin: 0 0 2px; color: var(--green); font-size: 12px; font-weight: 800; }
.drawer-header h2 { margin: 0; font-size: 23px; }
.text-button { padding: 7px 10px; border: 0; color: #9b655f; background: transparent; font-size: 13px; }
.cart-items { max-height: calc(78vh - 170px); overflow-y: auto; }
.cart-row { display: grid; grid-template-columns: 54px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.cart-row img { width: 54px; height: 54px; border-radius: 11px; object-fit: cover; }
.cart-row > div:not(.quantity) { min-width: 0; }
.cart-row strong, .cart-row small { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.cart-row strong { font-size: 14px; }
.cart-row small { margin-top: 4px; color: #98a29d; font-size: 10px; }
.cart-empty { padding: 42px 10px; color: #97a19c; text-align: center; }
.drawer-action { width: 100%; height: 48px; margin-top: 13px; border: 0; border-radius: 15px; color: white; background: var(--green); font-weight: 800; }
.drawer-action:disabled { cursor: not-allowed; background: #cad5cf; }
.toast { position: fixed; z-index: 70; left: 50%; bottom: 100px; max-width: calc(100% - 48px); padding: 10px 16px; transform: translate(-50%, 16px); border-radius: 999px; color: white; background: rgba(25, 36, 30, .92); font-size: 13px; opacity: 0; pointer-events: none; transition: .2s ease; }
.toast.show { transform: translate(-50%, 0); opacity: 1; }

/* 下单结果页 */
.order-shell { width: min(100%, 680px); min-height: 100vh; margin: 0 auto; padding-bottom: 32px; background: #f7faf8; box-shadow: 0 0 40px rgba(31, 65, 49, .08); }
.order-hero { position: relative; overflow: hidden; padding: calc(20px + env(safe-area-inset-top)) 18px 24px; color: white; background: linear-gradient(135deg, #0ebc79, #16c784); }
.order-hero::after { content: ""; position: absolute; right: -50px; top: -60px; width: 190px; height: 190px; border-radius: 50%; background: rgba(255,255,255,.1); }
.back-link { position: relative; z-index: 2; display: inline-flex; align-items: center; gap: 4px; color: white; text-decoration: none; font-size: 13px; font-weight: 700; }
.order-hero h1 { position: relative; z-index: 2; margin: 28px 0 5px; font-size: 30px; }
.order-hero p { position: relative; z-index: 2; margin: 0; font-size: 14px; opacity: .9; }
.order-content { padding: 14px 12px; }
.order-section { margin-bottom: 14px; padding: 16px; border: 1px solid var(--line); border-radius: 18px; background: white; box-shadow: 0 8px 24px rgba(28, 70, 50, .06); }
.order-section-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 11px; }
.order-section-heading h2 { margin: 0; font-size: 18px; }
.order-section-heading span { color: #8e9993; font-size: 12px; }
.ordered-dishes { display: grid; gap: 10px; }
.ordered-dish { display: grid; grid-template-columns: 68px minmax(0, 1fr) auto; align-items: center; gap: 11px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.ordered-dish:last-child { padding-bottom: 0; border-bottom: 0; }
.ordered-dish img { width: 68px; height: 58px; border-radius: 11px; object-fit: cover; }
.ordered-dish h3 { margin: 0 0 4px; font-size: 15px; }
.ordered-dish p { margin: 0; overflow: hidden; color: #9aa49f; font-size: 11px; white-space: nowrap; text-overflow: ellipsis; }
.ordered-dish strong { color: var(--green-dark); font-size: 13px; }
.ingredient-groups { display: grid; gap: 14px; }
.ingredient-group-block h3 { margin: 0 0 8px; color: var(--green-dark); font-size: 13px; }
.ingredient-tags { display: flex; flex-wrap: wrap; gap: 7px; }
.ingredient-tag { padding: 7px 10px; border: 1px solid #dcebe4; border-radius: 999px; color: #3f4c46; background: #f5faf7; font-size: 12px; }
.order-actions { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; margin-top: 14px; }
.order-actions a, .order-actions button { display: grid; min-height: 46px; place-items: center; border-radius: 14px; font-weight: 800; text-decoration: none; }
.order-actions a { border: 1px solid #cfe3d9; color: var(--green-dark); background: white; }
.order-actions button { border: 0; color: white; background: var(--green); }
.order-empty { padding: 70px 24px; text-align: center; }
.order-empty span { font-size: 44px; }
.order-empty h2 { margin: 12px 0 6px; }
.order-empty p { margin: 0 0 20px; color: #8e9993; font-size: 13px; }
.order-empty a { display: inline-grid; min-height: 44px; padding: 0 24px; place-items: center; border-radius: 14px; color: white; background: var(--green); font-weight: 800; text-decoration: none; }

@media (max-width: 420px) {
  .hero-copy { left: 122px; right: 9px; }
  .chef-portrait { left: 10px; height: 158px; }
  .shop-sign { width: min(198px, 100%); }
  .shop-sign span { font-size: 13px; }
  .hero h1 { font-size: clamp(23px, 7.2vw, 30px); }
  .menu-layout { grid-template-columns: 96px minmax(0, 1fr); }
  .category-button { padding-left: 13px; }
  .dish-panel { padding-inline: 9px; }
  .dish-image { height: clamp(126px, 38vw, 158px); }
  .dish-copy h3 { font-size: 15px; }
  .choose-button { min-width: 70px; padding-inline: 10px; }
  .cart-bar { grid-template-columns: minmax(0, 1fr) 116px; }
}

@media (max-width: 350px) {
  .hero-copy { left: 108px; }
  .chef-portrait { left: 4px; height: 148px; }
  .hero h1 { font-size: 22px; }
  .random-strip { padding-inline: 12px; }
  .random-strip strong { font-size: 12px; }
  .menu-layout { grid-template-columns: 88px minmax(0, 1fr); }
  .dish-content { grid-template-columns: 1fr; }
  .quantity-slot { justify-self: end; }
}
