:root {
  color-scheme: light;
  --bg: #f4f7f6;
  --surface: #ffffff;
  --surface-soft: #eef4f3;
  --text: #18201f;
  --muted: #687574;
  --line: #dfe8e6;
  --primary: #0f766e;
  --primary-strong: #0b5f58;
  --primary-soft: #d8efec;
  --accent: #d97706;
  --accent-soft: #fff0d9;
  --danger: #c2413d;
  --shadow: 0 10px 28px rgba(24, 32, 31, 0.09);
  --radius: 8px;
  --topbar-height: 56px;
  --nav-height: 64px;
}

* {
  box-sizing: border-box;
}

html {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: var(--bg);
  letter-spacing: 0;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    linear-gradient(180deg, #e6f2f0 0, var(--bg) 280px);
}

button,
input,
textarea,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  border: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

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

.app-shell {
  width: min(100%, 520px);
  min-height: 100vh;
  margin: 0 auto;
  position: relative;
  background: var(--bg);
  box-shadow: 0 0 0 1px rgba(24, 32, 31, 0.03), var(--shadow);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  background: rgba(244, 247, 246, 0.94);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(223, 232, 230, 0.8);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.brand-mark {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  font-size: 17px;
}

.brand-text {
  font-size: 17px;
  font-weight: 700;
  white-space: nowrap;
}

.icon-button {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  position: relative;
}

.icon-button:active {
  background: var(--surface-soft);
}

.icon-button svg {
  width: 21px;
  height: 21px;
}

.cart-badge {
  position: absolute;
  top: 2px;
  right: 1px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  line-height: 18px;
  text-align: center;
  font-weight: 700;
}

.view {
  min-height: calc(100vh - var(--topbar-height) - var(--nav-height));
  padding: 0 14px calc(24px + env(safe-area-inset-bottom));
  outline: none;
}

.site-footer {
  padding: 18px 14px calc(88px + env(safe-area-inset-bottom));
  color: var(--muted);
  font-size: 12px;
  line-height: 1.8;
  text-align: center;
}

.site-footer a {
  color: inherit;
  text-decoration: none;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 18px 0 10px;
}

.section-title {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
}

.section-link {
  color: var(--muted);
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 12px;
  margin: 14px 0 0;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
}

.search-box svg {
  width: 19px;
  height: 19px;
  color: var(--muted);
  flex: 0 0 19px;
}

.search-box input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text);
  font-size: 14px;
}

.search-box input::placeholder {
  color: #91a09e;
}

.category-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 14px 0 0;
}

.category-tile {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 5px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 12px;
  color: var(--text);
  cursor: pointer;
  text-align: center;
}

.category-tile svg {
  width: 22px;
  height: 22px;
  color: var(--primary);
}

.banner {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 82px;
  margin: 14px 0 0;
  padding: 13px 14px;
  border-radius: 8px;
  background: linear-gradient(120deg, #0f766e, #1a9a8e);
  color: #fff;
  overflow: hidden;
  position: relative;
}

.banner::after {
  content: "";
  position: absolute;
  right: -28px;
  top: -38px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.11);
}

.banner-copy {
  position: relative;
  z-index: 1;
  min-width: 0;
}

.banner-copy strong {
  display: block;
  font-size: 16px;
  margin-bottom: 4px;
}

.banner-copy span {
  display: block;
  font-size: 12px;
  opacity: 0.88;
  line-height: 1.45;
}

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

.product-card {
  min-width: 0;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  cursor: pointer;
}

.product-card:active {
  transform: scale(0.99);
}

.product-image {
  aspect-ratio: 1 / 1;
  width: 100%;
  object-fit: cover;
  background: var(--surface-soft);
}

.product-body {
  padding: 9px 10px 11px;
}

.product-name {
  min-height: 38px;
  margin: 0 0 7px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 8px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 0 6px;
  border-radius: 4px;
  font-size: 11px;
  background: var(--accent-soft);
  color: #9a5a00;
}

.tag.blue {
  background: var(--primary-soft);
  color: var(--primary-strong);
}

.price-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 6px;
}

.price {
  color: #c2413d;
  font-weight: 700;
  font-size: 17px;
  white-space: nowrap;
}

.price small {
  font-size: 12px;
  margin-right: 2px;
}

.sales {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.tab-bar {
  position: sticky;
  top: var(--topbar-height);
  z-index: 10;
  display: flex;
  gap: 8px;
  margin: 0 -14px;
  padding: 10px 14px;
  overflow-x: auto;
  background: rgba(244, 247, 246, 0.96);
  backdrop-filter: blur(12px);
  scrollbar-width: none;
}

.tab-bar::-webkit-scrollbar {
  display: none;
}

.tab {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 0 15px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
}

.tab.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.list-row {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px;
  margin-bottom: 10px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
}

.list-row img {
  width: 84px;
  height: 84px;
  flex: 0 0 84px;
  object-fit: cover;
  border-radius: 6px;
  background: var(--surface-soft);
}

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

.list-info h3 {
  margin: 0 0 5px;
  font-size: 14px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

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

.list-meta .price {
  font-size: 16px;
}

.cart-list,
.order-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 14px;
}

.cart-item {
  display: grid;
  grid-template-columns: 24px 76px minmax(0, 1fr) 30px;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
}

.cart-item img {
  width: 76px;
  height: 76px;
  object-fit: cover;
  border-radius: 6px;
  background: var(--surface-soft);
}

.checkbox {
  width: 20px;
  height: 20px;
  accent-color: var(--primary);
}

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

.cart-item-name {
  margin: 0 0 6px;
  font-size: 13px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.cart-item-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  background: var(--surface);
}

.stepper button {
  width: 30px;
  height: 28px;
  display: grid;
  place-items: center;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}

.stepper button:active {
  background: var(--surface-soft);
}

.stepper span {
  width: 30px;
  text-align: center;
  font-size: 13px;
}

.remove-button {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.remove-button svg {
  width: 17px;
  height: 17px;
}

.cart-summary {
  position: sticky;
  bottom: calc(var(--nav-height) + env(safe-area-inset-bottom));
  z-index: 15;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 14px -14px -24px;
  padding: 12px 14px calc(12px + env(safe-area-inset-bottom));
  background: var(--surface);
  border-top: 1px solid var(--line);
}

.cart-summary-left {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.cart-total {
  min-width: 0;
  text-align: right;
}

.cart-total strong {
  display: block;
  color: #c2413d;
  font-size: 19px;
  white-space: nowrap;
}

.cart-total span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 2px;
}

.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 42px;
  padding: 0 17px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.primary-button {
  background: var(--primary);
  color: #fff;
}

.primary-button:active {
  background: var(--primary-strong);
}

.primary-button:disabled {
  background: #9db5b1;
  cursor: not-allowed;
}

.secondary-button {
  background: var(--surface);
  color: var(--primary);
  border: 1px solid var(--primary);
}

.wide {
  width: 100%;
}

.form-card,
.info-card,
.empty-card {
  padding: 14px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
}

.form-card {
  margin-bottom: 12px;
}

.form-card h2,
.info-card h2 {
  margin: 0 0 12px;
  font-size: 15px;
}

.field {
  display: block;
  margin-bottom: 12px;
}

.field:last-child {
  margin-bottom: 0;
}

.field label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
}

.field input,
.field textarea {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fbfdfc;
  color: var(--text);
  outline: none;
  font-size: 14px;
}

.field textarea {
  min-height: 78px;
  resize: vertical;
  line-height: 1.5;
}

.field input:focus,
.field textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.pay-method {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px;
  border-radius: var(--radius);
  background: #eef7ff;
  border: 1px solid #b9d9f8;
}

.pay-logo {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #1677ff;
  color: #fff;
  font-weight: 800;
  font-size: 13px;
}

.pay-method strong {
  display: block;
  font-size: 14px;
}

.pay-method span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.order-summary {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 4px;
}

.summary-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  color: var(--muted);
}

.summary-line.total {
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  color: var(--text);
  font-weight: 700;
}

.summary-line.total .price {
  font-size: 18px;
}

.checkout-actions {
  position: sticky;
  bottom: calc(var(--nav-height) + env(safe-area-inset-bottom));
  z-index: 15;
  margin: 14px -14px -24px;
  padding: 12px 14px calc(12px + env(safe-area-inset-bottom));
  background: var(--surface);
  border-top: 1px solid var(--line);
}

.payment-hero {
  padding: 24px 16px 20px;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.payment-amount {
  display: block;
  margin-top: 10px;
  color: #c2413d;
  font-size: 30px;
  font-weight: 800;
}

.payment-order {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.payment-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
}

.order-card {
  padding: 14px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
}

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

.order-no {
  font-size: 12px;
  color: var(--muted);
}

.status {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
}

.status.success {
  color: var(--primary);
}

.order-products {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.order-products img {
  width: 58px;
  height: 58px;
  flex: 0 0 58px;
  border-radius: 6px;
  object-fit: cover;
  background: var(--surface-soft);
}

.order-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  font-size: 13px;
}

.order-foot .price {
  font-size: 16px;
}

.profile-card {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 14px 0 12px;
  padding: 16px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
}

.avatar {
  width: 52px;
  height: 52px;
  flex: 0 0 52px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--primary-soft);
  color: var(--primary);
}

.avatar svg {
  width: 27px;
  height: 27px;
}

.profile-card h2 {
  margin: 0 0 4px;
  font-size: 17px;
}

.profile-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.menu-list {
  margin: 0;
  padding: 0;
  list-style: none;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
}

.menu-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
  cursor: pointer;
}

.menu-list li:last-child {
  border-bottom: 0;
}

.menu-list li:active {
  background: var(--surface-soft);
}

.menu-list svg {
  width: 19px;
  height: 19px;
  color: var(--primary);
}

.menu-list .arrow {
  margin-left: auto;
  color: #9aaba9;
}

.empty-card {
  margin-top: 14px;
  padding: 42px 16px;
  text-align: center;
  color: var(--muted);
}

.empty-card svg {
  width: 42px;
  height: 42px;
  margin-bottom: 10px;
  color: #a4b2b0;
}

.empty-card h3 {
  margin: 0 0 6px;
  color: var(--text);
  font-size: 16px;
}

.empty-card p {
  margin: 0 0 16px;
  font-size: 13px;
}

.merchant-note {
  margin-top: 14px;
  padding: 14px;
  border-radius: var(--radius);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.merchant-note strong {
  color: var(--text);
}

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  width: min(100%, 520px);
  height: calc(var(--nav-height) + env(safe-area-inset-bottom));
  padding: 0 8px env(safe-area-inset-bottom);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.nav-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 0;
  color: var(--muted);
  font-size: 11px;
}

.nav-item svg {
  width: 21px;
  height: 21px;
}

.nav-item.active {
  color: var(--primary);
  font-weight: 700;
}

.nav-cart-badge {
  top: 3px;
  right: calc(50% - 23px);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(13, 24, 22, 0.48);
}

.product-sheet {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  z-index: 50;
  width: min(100%, 520px);
  max-height: 88vh;
  overflow-y: auto;
  padding: 0 16px calc(16px + env(safe-area-inset-bottom));
  border-radius: 14px 14px 0 0;
  background: var(--surface);
}

.sheet-close {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  justify-content: flex-end;
  margin: 0 -16px;
  padding: 9px 12px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
}

.sheet-image {
  width: 100%;
  aspect-ratio: 1.25 / 1;
  object-fit: cover;
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.sheet-title {
  margin: 14px 0 8px;
  font-size: 19px;
  line-height: 1.4;
}

.sheet-price {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  margin-bottom: 12px;
}

.sheet-price .price {
  font-size: 24px;
}

.sheet-price s {
  color: var(--muted);
  font-size: 13px;
}

.spec-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin: 0 0 14px;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.sheet-actions {
  display: grid;
  grid-template-columns: 1fr 1.35fr;
  gap: 10px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--nav-height) + 24px);
  z-index: 60;
  transform: translate(-50%, 12px);
  max-width: min(82vw, 380px);
  padding: 10px 14px;
  border-radius: 8px;
  background: rgba(24, 32, 31, 0.94);
  color: #fff;
  font-size: 13px;
  line-height: 1.45;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (min-width: 600px) {
  .app-shell {
    border-left: 1px solid var(--line);
    border-right: 1px solid var(--line);
  }

  .bottom-nav,
  .product-sheet {
    left: 50%;
    right: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
