:root {
  --primary: #7f9670;
  --primary-dark: #637754;
  --primary-soft: #edf4e9;
  --bg: #f5f5f5;
  --surface: #ffffff;
  --ink: #333333;
  --muted: #999999;
  --line: #f0f0f0;
  --cart: #333333;
  --warn-bg: #fff7e6;
  --warn-line: #ffe4b5;
  --warn-text: #fa8c16;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: #e8e8e8;
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
  letter-spacing: 0;
}

button {
  border: 0;
  padding: 0;
  color: inherit;
  background: none;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

img {
  display: block;
  max-width: 100%;
}

[hidden] {
  display: none !important;
}

.yo-shell {
  position: relative;
  width: min(430px, 100vw);
  min-height: 100svh;
  margin: 0 auto;
  overflow: hidden;
  background: var(--bg);
  box-shadow: 0 0 28px rgba(0, 0, 0, 0.12);
}

.yo-page {
  display: none;
  width: 100%;
  min-height: 100svh;
  background: var(--bg);
}

.yo-page.is-active {
  display: flex;
  flex-direction: column;
}

.wechat-guide {
  position: fixed;
  left: 50%;
  top: 62px;
  z-index: 150;
  display: flex;
  align-items: center;
  gap: 10px;
  width: calc(min(430px, 100vw) - 20px);
  padding: 10px 10px 10px 12px;
  border-radius: 8px;
  color: var(--ink);
  background-color: white;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.16);
  transform: translateX(-50%);
}

.wechat-guide-text {
  display: grid;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.wechat-guide-text strong {
  color: var(--ink);
  font-size: 14px;
  line-height: 1.2;
}

.wechat-guide-text span {
  color: #666666;
  font-size: 12px;
  line-height: 1.3;
}

.wechat-guide button,
.wechat-copy-btn {
  min-height: 34px;
  border-radius: 18px;
  font-size: 14px;
  font-weight: 600;
}

.wechat-guide button {
  padding: 0 12px;
  color: white;
  background-color: var(--primary);
  flex-shrink: 0;
}

.wechat-mask {
  position: fixed;
  inset: 0;
  z-index: 180;
  background-color: rgba(0, 0, 0, 0.36);
}

.wechat-panel {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: min(430px, 100vw);
  padding: 16px 15px max(16px, env(safe-area-inset-bottom));
  border-radius: 14px 14px 0 0;
  background-color: white;
  transform: translateX(-50%);
}

.wechat-panel-header {
  display: flex;
  align-items: center;
  justify-content: center;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  text-align: center;
}

.wechat-panel-header strong {
  color: var(--ink);
  font-size: 17px;
  font-weight: 600;
}

.wechat-steps {
  display: grid;
  gap: 10px;
  padding: 14px 0;
}

.wechat-step {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.wechat-step span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  color: white;
  background-color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

.wechat-step p {
  margin: 0;
  color: #555555;
  font-size: 14px;
  line-height: 1.45;
}

.wechat-copy-btn {
  width: 100%;
}

.wechat-copy-btn {
  color: white;
  background-color: var(--primary);
}

.app-nav {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 52px;
  padding: 8px 14px;
  color: white;
  background-color: var(--primary);
}

.nav-title {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.nav-title strong {
  font-size: 18px;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-title span {
  font-size: 12px;
  line-height: 1.2;
  opacity: 0.9;
}

.language-switch {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.2);
  flex-shrink: 0;
}

.language-switch button {
  min-width: 31px;
  height: 28px;
  border-radius: 15px;
  color: white;
  font-size: 12px;
  font-weight: 700;
  line-height: 28px;
  text-align: center;
}

.language-switch button.active {
  color: var(--primary);
  background-color: white;
}

.store-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background-color: white;
  border-bottom: 1px solid var(--line);
}

.store-logo {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  background-color: var(--bg);
}

.store-copy {
  min-width: 0;
  flex: 1;
}

.store-copy h1 {
  margin: 0;
  color: var(--ink);
  font-size: 22px;
  font-weight: 700;
  line-height: 1.12;
}

.store-copy p {
  margin: 5px 0 0;
  color: #666666;
  font-size: 14px;
  line-height: 1.3;
}

.store-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 7px;
}

.store-tags span,
.tag {
  display: inline-flex;
  align-items: center;
  min-height: 18px;
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--primary);
  background-color: var(--primary-soft);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.2;
}

.store-info {
  background-color: white;
  border-bottom: 1px solid var(--line);
}

.store-info-summary {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  min-height: 38px;
  padding: 6px 10px;
  background-color: white;
  text-align: left;
}

.summary-main {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex: 1;
}

.summary-main strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.summary-muted {
  color: #666666;
  font-size: 12px;
  line-height: 1.2;
  white-space: nowrap;
}

.summary-toggle {
  min-height: 24px;
  padding: 0 8px;
  border-radius: 12px;
  color: var(--primary);
  background-color: var(--primary-soft);
  font-size: 12px;
  font-weight: 600;
  line-height: 24px;
  white-space: nowrap;
  flex-shrink: 0;
}

.store-info.is-collapsed .store-info-details {
  display: none;
}

.store-info-details {
  border-top: 1px solid var(--line);
}

.store-info-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-top: 1px solid var(--line);
}

.store-info-row:first-child {
  border-top: 0;
}

.info-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  color: var(--primary);
  background-color: var(--primary-soft);
  font-size: 14px;
  flex-shrink: 0;
}

.store-info-row div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.store-info-row strong {
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.25;
}

.store-info-row span:not(.info-icon) {
  color: #666666;
  font-size: 12px;
  line-height: 1.3;
}

.store-link {
  color: #666666;
  font-size: 12px;
  line-height: 1.3;
  text-decoration: none;
}

.store-link:active {
  color: var(--primary);
}

.menu-container {
  height: 100svh;
}

.search-bar {
  background-color: white;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
}

.search-input {
  display: flex;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 18px;
  background-color: var(--bg);
}

.search-input span {
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
}

.search-input input {
  flex: 1;
  width: 100%;
  min-width: 0;
  height: 34px;
  margin: 0 8px;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font-size: 14px;
}

.clear-search {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  color: white;
  background-color: #bbbbbb;
  font-size: 18px;
  line-height: 24px;
  text-align: center;
}

.menu-content {
  flex: 1;
  display: flex;
  min-height: 0;
  overflow: hidden;
}

.category-list {
  width: 80px;
  flex-shrink: 0;
  overflow-y: auto;
  padding-bottom: 112px;
  background-color: var(--bg);
}

.category-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 66px;
  padding: 9px 5px;
}

.category-item.active {
  background-color: white;
}

.category-item.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 3px;
  height: 20px;
  border-radius: 0 3px 3px 0;
  background-color: var(--primary);
  transform: translateY(-50%);
}

.category-icon {
  margin-bottom: 4px;
  font-size: 20px;
  line-height: 1;
}

.category-name {
  color: var(--ink);
  font-size: 12px;
  line-height: 1.2;
  text-align: center;
}

.category-item.active .category-name {
  color: var(--primary);
  font-weight: 500;
}

.dish-list {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  padding: 8px 10px 112px;
  background-color: white;
}

.search-status {
  margin: 0 0 8px;
  padding: 10px;
  border-bottom: 1px solid var(--warn-line);
  color: var(--warn-text);
  background-color: var(--warn-bg);
  font-size: 14px;
  line-height: 1.4;
}

.dish-section {
  min-height: 100%;
}

.dish-card {
  display: flex;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.dish-card:last-child {
  border-bottom: none;
}

.dish-image {
  width: 84px;
  height: 84px;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
  background-color: var(--bg);
}

.dish-info {
  flex: 1;
  min-width: 0;
  margin-left: 10px;
  display: flex;
  flex-direction: column;
}

.dish-name {
  margin: 0 0 4px;
  color: var(--ink);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.25;
}

.dish-desc {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.dish-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  margin-bottom: 5px;
}

.sales {
  color: var(--muted);
  font-size: 12px;
  line-height: 20px;
}

.option-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 6px;
}

.option-btn {
  min-height: 24px;
  max-width: 100%;
  padding: 0 8px;
  border-radius: 12px;
  color: #666666;
  background-color: var(--bg);
  font-size: 12px;
  line-height: 24px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.option-btn.active {
  color: white;
  background-color: var(--primary);
}

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

.dish-price {
  color: var(--primary);
  font-weight: 600;
  white-space: nowrap;
}

.price-symbol {
  font-size: 13px;
}

.price-number {
  font-size: 18px;
}

.price-ask {
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.dish-action {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 22px;
  line-height: 1;
}

.action-btn.add {
  color: white;
  background-color: var(--primary);
}

.action-btn.reduce {
  color: #666666;
  background-color: var(--bg);
}

.action-btn.ask {
  width: auto;
  min-width: 64px;
  padding: 0 9px;
  border-radius: 12px;
  color: #999999;
  background-color: var(--bg);
  font-size: 12px;
  font-weight: 500;
}

.quantity {
  min-width: 28px;
  color: var(--ink);
  font-size: 14px;
  text-align: center;
}

.empty {
  padding: 50px 20px;
  text-align: center;
}

.empty-image {
  display: grid;
  place-items: center;
  width: 86px;
  height: 86px;
  margin: 0 auto 15px;
  border-radius: 50%;
  color: #bbbbbb;
  background-color: var(--bg);
  font-size: 42px;
}

.empty-text {
  margin-bottom: 10px;
  color: #666666;
  font-size: 16px;
}

.empty-tips {
  color: var(--muted);
  font-size: 14px;
}

.cart-detail-mask {
  position: fixed;
  inset: 0;
  z-index: 90;
  background-color: rgba(0, 0, 0, 0.35);
}

.cart-detail {
  position: absolute;
  left: 50%;
  bottom: 56px;
  display: flex;
  flex-direction: column;
  width: min(430px, 100vw);
  max-height: 70vh;
  border-radius: 12px 12px 0 0;
  background-color: white;
  transform: translateX(-50%);
}

.cart-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px;
  border-bottom: 1px solid var(--line);
}

.cart-detail-title {
  color: var(--ink);
  font-size: 16px;
  font-weight: 500;
}

.cart-detail-clear {
  padding: 4px 8px;
  color: var(--muted);
  font-size: 14px;
}

.cart-detail-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px 15px;
}

.cart-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.cart-item:last-child {
  border-bottom: none;
}

.cart-item-info {
  flex: 1;
  min-width: 0;
}

.cart-item-name {
  color: var(--ink);
  font-size: 15px;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cart-item-specs {
  margin-top: 4px;
  color: #666666;
  font-size: 12px;
}

.cart-item-price {
  color: var(--primary);
  font-size: 15px;
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
}

.cart-item-quantity {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.quantity-btn {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  color: #666666;
  background-color: var(--bg);
  font-size: 18px;
  line-height: 24px;
  text-align: center;
}

.quantity-number {
  min-width: 26px;
  color: var(--ink);
  font-size: 14px;
  text-align: center;
}

.cart-bar {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  width: min(430px, 100vw);
  height: 56px;
  padding: 0 10px max(0px, env(safe-area-inset-bottom));
  background-color: var(--cart);
  transform: translateX(-50%);
}

.cart-icon-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 56px;
  flex-shrink: 0;
}

.cart-icon {
  color: white;
  font-size: 24px;
  line-height: 1;
}

.cart-badge {
  position: absolute;
  top: 6px;
  right: 5px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 9px;
  color: white;
  background-color: var(--primary);
  font-size: 12px;
  line-height: 18px;
  text-align: center;
}

.cart-info {
  flex: 1;
  min-width: 0;
  margin-left: 10px;
}

.cart-amount {
  color: white;
  line-height: 1;
}

.amount-symbol {
  font-size: 14px;
}

.amount-number {
  font-size: 20px;
  font-weight: 600;
}

.cart-empty {
  color: #999999;
  font-size: 14px;
}

.cart-btn {
  min-width: 94px;
  min-height: 38px;
  padding: 0 20px;
  border-radius: 25px;
  color: #999999;
  background-color: #666666;
  font-size: 15px;
  font-weight: 500;
  flex-shrink: 0;
}

.cart-btn.active {
  color: white;
  background-color: var(--primary);
}

.confirm-page {
  background-color: var(--bg);
}

.confirm-nav {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  gap: 0;
  justify-content: stretch;
}

.confirm-nav .nav-title {
  justify-items: center;
  text-align: center;
}

.back-btn,
.nav-spacer {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  flex-shrink: 0;
}

.back-btn {
  color: white;
  background-color: rgba(255, 255, 255, 0.18);
  font-size: 32px;
  line-height: 1;
}

.confirm-container {
  flex: 1;
  overflow-y: auto;
  padding-bottom: 88px;
  background-color: var(--bg);
}

.section {
  margin-bottom: 10px;
  padding: 15px;
  background-color: white;
}

.section-title {
  margin-bottom: 12px;
  color: var(--ink);
  font-size: 16px;
  font-weight: 500;
}

.required {
  margin-left: 4px;
  color: #ff4d4f;
}

.order-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.order-item:last-child {
  border-bottom: none;
}

.item-info {
  flex: 1;
  min-width: 0;
}

.item-name {
  color: var(--ink);
  font-size: 15px;
  line-height: 1.35;
}

.item-note {
  margin-top: 4px;
  color: #666666;
  font-size: 12px;
}

.item-right {
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: right;
  flex-shrink: 0;
}

.item-quantity {
  color: #666666;
  font-size: 14px;
}

.item-price {
  color: var(--ink);
  font-size: 15px;
}

.mode-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.mode-option {
  min-height: 44px;
  border-radius: 22px;
  color: #666666;
  background-color: var(--bg);
  font-size: 15px;
  font-weight: 500;
}

.mode-option.active {
  color: white;
  background-color: var(--primary);
}

.time-select-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.86fr) minmax(0, 1.14fr);
  gap: 10px;
  align-items: stretch;
}

.order-date-pill {
  display: grid;
  align-content: center;
  gap: 2px;
  min-height: 44px;
  padding: 5px 10px;
  border-radius: 4px;
  color: var(--ink);
  background-color: var(--bg);
  line-height: 1.18;
}

.date-pill-main {
  display: block;
  font-size: 14px;
  font-weight: 600;
}

.date-pill-sub {
  display: block;
  color: #666666;
  font-size: 12px;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.form-item {
  width: 100%;
  margin-top: 10px;
}

.time-select-grid .form-item {
  margin-top: 0;
}

.form-item:first-of-type {
  margin-top: 0;
}

.form-item input,
.form-item select,
.form-item textarea {
  width: 100%;
  min-height: 44px;
  border: 0;
  border-radius: 4px;
  outline: 0;
  color: var(--ink);
  background-color: var(--bg);
  font-size: 15px;
}

.form-item input,
.form-item select {
  padding: 0 12px;
}

.form-item select {
  appearance: none;
}

.form-item textarea {
  min-height: 88px;
  padding: 12px;
  resize: vertical;
}

.phone-tips {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--ink);
  font-size: 16px;
}

.total-price {
  color: var(--primary);
  font-size: 20px;
  font-weight: 600;
}

.bottom-bar {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  width: min(430px, 100vw);
  padding: 10px 15px max(10px, env(safe-area-inset-bottom));
  background-color: white;
  box-shadow: 0 -1px 5px rgba(0, 0, 0, 0.05);
  transform: translateX(-50%);
}

.total-info {
  flex: 1;
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
}

.total-info span:first-child {
  color: var(--ink);
  font-size: 14px;
}

.submit-btn {
  min-width: 128px;
  height: 44px;
  border-radius: 24px;
  color: white;
  background-color: var(--primary);
  font-size: 16px;
  font-weight: 500;
}

.success-page {
  background-color: var(--bg);
}

.success-card {
  display: grid;
  justify-items: center;
  gap: 14px;
  margin: 18px 15px;
  padding: 32px 18px;
  border-radius: 8px;
  background-color: white;
  text-align: center;
}

.success-icon {
  display: grid;
  place-items: center;
  width: 66px;
  height: 66px;
  border-radius: 50%;
  color: white;
  background-color: var(--primary);
  font-size: 38px;
  font-weight: 700;
}

.success-card h2 {
  margin: 0;
  color: var(--ink);
  font-size: 22px;
  font-weight: 600;
}

.success-card p {
  margin: 0;
  color: #666666;
  font-size: 15px;
  line-height: 1.5;
}

.reference-box {
  display: grid;
  gap: 6px;
  width: 100%;
  padding: 14px;
  border-radius: 8px;
  background-color: var(--bg);
}

.reference-box span {
  color: var(--muted);
  font-size: 13px;
}

.reference-box strong {
  color: var(--primary);
  font-size: 20px;
  font-weight: 600;
}

.success-actions {
  display: grid;
  gap: 10px;
  width: 100%;
}

.success-actions button,
.success-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border-radius: 24px;
  color: white;
  background-color: var(--primary);
  font-size: 16px;
  font-weight: 500;
  text-decoration: none;
}

.success-actions .success-primary {
  color: white;
  background-color: var(--primary);
}

.success-actions .success-secondary {
  color: var(--primary);
  background-color: var(--primary-soft);
}

@media (min-width: 700px) {
  body {
    padding: 22px 0;
  }

  .yo-shell {
    min-height: calc(100svh - 44px);
    border-radius: 18px;
  }

  .yo-page {
    min-height: calc(100svh - 44px);
  }

  .menu-container {
    height: calc(100svh - 44px);
  }

  .cart-bar,
  .bottom-bar {
    bottom: 22px;
    border-radius: 0 0 18px 18px;
  }

  .wechat-guide {
    top: 84px;
  }

  .cart-detail {
    bottom: 78px;
  }
}
