:root {
  --red: #e02e24;
  --red-dark: #c41e17;
  --wx: #07c160;
  --wx-dark: #06ad56;
  --text: #111;
  --sub: #666;
  --muted: #999;
  --line: #eee;
  --bg: #f5f5f5;
  --card: #fff;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: #e8e8e8;
  -webkit-tap-highlight-color: transparent;
}

img { display: block; max-width: 100%; }
button, input { font: inherit; border: 0; outline: 0; background: none; }
a { color: inherit; text-decoration: none; }

.app {
  width: 100%;
  max-width: 430px;
  min-height: 100vh;
  margin: 0 auto;
  background: var(--bg);
  position: relative;
  overflow-x: hidden;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.12);
  padding-bottom: 8px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 46px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  border-bottom: 1px solid #f0f0f0;
}
.topbar-left, .topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 88px;
}
.topbar-right { justify-content: flex-end; }
.topbar-title {
  font-size: 16px;
  font-weight: 600;
}
.icon-btn {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  color: #333;
  font-size: 28px;
  line-height: 1;
}
.login-link, .user-chip {
  font-size: 13px;
  color: var(--sub);
}
.user-chip {
  max-width: 84px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hero { position: relative; background: #111; touch-action: pan-y; }
.hero-viewport {
  overflow: hidden;
  width: 100%;
  aspect-ratio: 4 / 3;
}
.hero-track {
  display: flex;
  height: 100%;
  width: 100%;
  transition: transform 0.35s ease;
  will-change: transform;
}
.hero-track.dragging { transition: none; }
.hero-track img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  flex: 0 0 100%;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}
.hero-index {
  position: absolute;
  right: 12px;
  bottom: 28px;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font-size: 12px;
  border-radius: 12px;
  padding: 3px 8px;
  z-index: 2;
  pointer-events: none;
}
.hero-dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 10px;
  z-index: 2;
  display: flex;
  justify-content: center;
  gap: 5px;
  pointer-events: none;
}
.hero-dots i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.45);
}
.hero-dots i.on {
  width: 14px;
  border-radius: 4px;
  background: #fff;
}

.card {
  background: var(--card);
  margin: 10px 12px 0;
  padding: 16px 16px 18px;
  border-radius: 12px;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.04);
}
.card-info { margin-top: 12px; }
.price-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
}
.price {
  color: var(--red);
  font-weight: 700;
  line-height: 1;
}
.price em { font-style: normal; font-size: 16px; }
.price strong { font-size: 32px; letter-spacing: -0.5px; }
.price span { font-size: 14px; margin-left: 2px; font-weight: 600; }
.sales { font-size: 12px; color: var(--muted); padding-bottom: 4px; }
.coupon {
  display: inline-block;
  margin-top: 12px;
  color: var(--red);
  font-size: 12px;
  line-height: 1.2;
  padding: 5px 8px;
  border: 1px solid #ffccc7;
  background: #fff7f6;
  border-radius: 4px;
}
.hotel-title {
  margin-top: 14px;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.45;
}
.hotel-sub {
  margin-top: 8px;
  font-size: 13px;
  color: var(--sub);
  line-height: 1.5;
}

.info-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}
.info-k {
  width: 36px;
  padding-top: 2px;
  font-size: 13px;
  color: var(--muted);
  flex-shrink: 0;
}
.info-v { flex: 1; min-width: 0; }
.info-v .main { font-size: 14px; color: #222; font-weight: 500; }
.info-v .sub { margin-top: 6px; font-size: 12px; color: var(--muted); line-height: 1.5; }

.trust {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 18px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid #f3f3f3;
  font-size: 12px;
  color: var(--sub);
}
.trust i {
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 4px;
  border-radius: 50%;
  background: #19be6b;
  vertical-align: -1px;
  position: relative;
}
.trust i::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 2px;
  width: 4px;
  height: 6px;
  border: 1.5px solid #fff;
  border-top: 0;
  border-left: 0;
  transform: rotate(45deg);
}

.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.tag {
  font-size: 12px;
  color: #666;
  background: #f4f5f7;
  border-radius: 999px;
  padding: 5px 10px;
}

.section-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.section-h h2 { font-size: 16px; }
.section-h span { font-size: 12px; color: var(--muted); }

.notice { font-size: 13px; color: #666; line-height: 1.8; word-break: break-word; }
.notice img { max-width: 100%; height: auto; border-radius: 6px; margin: 8px 0; }
.notice p { margin: 0 0 10px; }
.review { display: flex; gap: 12px; padding: 14px 0; }
.review + .review { border-top: 1px solid #f3f3f3; }
.review:first-child { padding-top: 2px; }
.review:last-child { padding-bottom: 0; }
.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ffd3c4, #ff8a6a);
  color: #fff;
  font-size: 13px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.review b { font-size: 14px; font-weight: 600; }
.review p { margin-top: 6px; font-size: 13px; color: #444; line-height: 1.6; }
.review time { display: block; margin-top: 6px; font-size: 11px; color: var(--muted); }

.bottom-bar {
  position: sticky;
  bottom: 0;
  z-index: 20;
  display: flex;
  align-items: stretch;
  background: #fff;
  border-top: 1px solid #f0f0f0;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.04);
  padding-bottom: var(--safe-b);
}
.bar-icon {
  width: 64px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: #555;
  gap: 4px;
}
.bar-icon svg { width: 20px; height: 20px; }
.buy-btn {
  flex: 1;
  margin: 10px 12px;
  height: 44px;
  border-radius: 22px;
  background: var(--red);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
}
.buy-btn:active { background: var(--red-dark); }

.sheet-mask {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 40;
  display: none;
}
.sheet-mask.show { display: block; }
.sheet {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 100%;
  max-width: 430px;
  background: #fff;
  border-radius: 16px 16px 0 0;
  padding: 18px 16px calc(16px + var(--safe-b));
  max-height: 86vh;
  overflow: auto;
}
.sheet-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 32px;
  height: 32px;
  font-size: 22px;
  color: #999;
  line-height: 1;
}
.sheet-head {
  display: flex;
  gap: 12px;
  padding: 0 24px 16px 0;
}
.sheet-head img {
  width: 72px;
  height: 72px;
  border-radius: 6px;
  object-fit: cover;
  background: #f3f3f3;
}
.sheet-price {
  color: var(--red);
  font-weight: 700;
  line-height: 1.1;
}
.sheet-price em { font-style: normal; font-size: 14px; }
.sheet-price span { font-size: 26px; }
.sheet-price small {
  font-size: 13px;
  font-weight: 500;
  margin-left: 2px;
}
.sheet-meta { margin-top: 8px; font-size: 13px; color: #333; }
.sku-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 4px 0 16px;
}
.sku {
  position: relative;
  border: 0;
  border-radius: 6px;
  padding: 12px 14px 10px;
  text-align: left;
  background: #f5f5f5;
  font-size: 13px;
  line-height: 1.45;
  color: #333;
  overflow: hidden;
}
.sku-title { display: block; padding-right: 42px; }
.sku-meta {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: #888;
}
.sku-empty {
  padding: 18px 12px;
  text-align: center;
  color: #999;
  background: #fafafa;
  border-radius: 6px;
}
.sku.active {
  background: #fff1f0;
  color: var(--red);
  box-shadow: inset 0 0 0 1px #ffccc7;
}
.sku.disabled {
  color: #bbb;
  background: #f7f7f7;
}
.sku-sold {
  position: absolute;
  top: 0;
  right: 0;
  background: #c8c8c8;
  color: #fff;
  font-size: 10px;
  line-height: 1;
  padding: 4px 6px;
  border-radius: 0 6px 0 8px;
}
.qty-row {
  display: flex;
  align-items: center;
  padding: 8px 0 4px;
  font-size: 14px;
}
.qty-ctrl {
  margin-left: auto;
  display: flex;
  align-items: center;
  border: 1px solid #e5e5e5;
  border-radius: 4px;
  overflow: hidden;
}
.qty-ctrl button {
  width: 28px;
  height: 28px;
  color: #666;
  background: #fafafa;
}
.qty-ctrl button:disabled { color: #ddd; }
.qty-ctrl input {
  width: 36px;
  height: 28px;
  text-align: center;
  font-size: 14px;
  border-left: 1px solid #e5e5e5;
  border-right: 1px solid #e5e5e5;
}
.qty-stock {
  margin-left: 10px;
  font-size: 12px;
  color: var(--muted);
}
.sheet-buy {
  width: 100%;
  height: 44px;
  margin-top: 16px;
  border-radius: 22px;
  background: var(--red);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
}

.goods {
  display: flex;
  gap: 10px;
}
.goods img {
  width: 88px;
  height: 88px;
  border-radius: 6px;
  object-fit: cover;
}
.goods h3 { font-size: 15px; line-height: 1.4; }
.goods p { margin-top: 6px; font-size: 12px; color: var(--sub); }
.goods .price { margin-top: 8px; font-size: 16px; }

.field {
  display: flex;
  align-items: center;
  min-height: 48px;
  border-bottom: 1px solid #f2f2f2;
}
.field label { width: 88px; font-size: 14px; color: #333; }
.field input {
  flex: 1;
  height: 44px;
  font-size: 15px;
}
.field input::placeholder { color: #c8c8c8; }
.guest-tip {
  padding: 12px 12px 4px;
  font-size: 12px;
  color: var(--sub);
  line-height: 1.5;
}
.guest-fields .field:last-child { border-bottom: 0; }

.login-tip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: #f6fff9;
  border: 1px solid #d8f3e3;
  border-radius: 8px;
  font-size: 13px;
  color: #2b8a4e;
}
.wx-login-btn {
  height: 30px;
  padding: 0 12px;
  border-radius: 15px;
  background: var(--wx);
  color: #fff;
  font-size: 12px;
}

.pay-method {
  display: flex;
  align-items: center;
  gap: 10px;
}
.wx-logo {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  background: var(--wx);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: grid;
  place-items: center;
}
.pay-method b { font-size: 14px; }
.check {
  margin-left: auto;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--red);
  position: relative;
}
.check::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 3px;
  width: 5px;
  height: 8px;
  border: 1.6px solid #fff;
  border-top: 0;
  border-left: 0;
  transform: rotate(45deg);
}

.app-order {
  padding-bottom: calc(72px + var(--safe-b));
}

.order-bottom {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 100%;
  max-width: 430px;
  z-index: 30;
  background: #fff;
  border-top: 1px solid #f0f0f0;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.06);
  padding: 10px 16px calc(10px + var(--safe-b));
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.order-bottom .sum { font-size: 13px; color: var(--sub); }
.order-bottom .sum b { color: var(--red); font-size: 20px; }
.confirm-btn, .wx-pay-btn {
  min-width: 132px;
  height: 42px;
  border-radius: 21px;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
}
.confirm-btn { background: var(--red); }
.wx-pay-btn { background: var(--wx); width: 100%; border-radius: 4px; }

.pay-page .amount-box {
  text-align: center;
  padding: 36px 16px 20px;
  background: #fff;
}
.pay-page .amount-box small { color: var(--muted); font-size: 13px; }
.pay-page .amount-box b {
  display: block;
  margin-top: 8px;
  font-size: 36px;
  letter-spacing: -0.5px;
}

.cashier-mask {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 50;
  display: none;
}
.cashier-mask.show { display: block; }
.cashier {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 100%;
  max-width: 430px;
  background: #fff;
  border-radius: 10px 10px 0 0;
  padding: 8px 16px calc(16px + var(--safe-b));
}
.cashier-bar {
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: #ddd;
  margin: 6px auto 12px;
}
.cashier-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 15px;
  font-weight: 600;
}
.cashier-close { font-size: 22px; color: #888; width: 32px; }
.cashier-amount {
  text-align: center;
  padding: 22px 0 8px;
  font-size: 34px;
  font-weight: 700;
}
.cashier-row {
  display: flex;
  justify-content: space-between;
  padding: 14px 0;
  font-size: 14px;
  border-top: 1px solid #f3f3f3;
}
.cashier-row span { color: var(--sub); }
.cashier-pay {
  width: 100%;
  height: 46px;
  margin-top: 8px;
  border-radius: 4px;
  background: var(--wx);
  color: #fff;
  font-size: 17px;
  font-weight: 600;
}

.tabs {
  display: flex;
  background: #fff;
  border-bottom: 1px solid #f0f0f0;
}
.tabs button {
  flex: 1;
  height: 42px;
  font-size: 14px;
  color: var(--sub);
  position: relative;
}
.tabs button.active { color: var(--text); font-weight: 600; }
.tabs button.active::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 28px;
  height: 2px;
  background: var(--red);
  transform: translateX(-50%);
}

.empty {
  padding: 80px 24px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}
.order-card {
  background: #fff;
  margin: 10px 12px 0;
  border-radius: 10px;
  padding: 12px;
  cursor: pointer;
}
.order-card-h {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--muted);
  padding-bottom: 10px;
  border-bottom: 1px solid #f5f5f5;
}
.order-card-no {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.order-card-status {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  gap: 4px;
}
.order-card-arrow {
  font-size: 16px;
  color: #ccc;
  line-height: 1;
}
.st-paid { color: var(--wx); }
.st-unpaid { color: var(--red); }
.st-cancelled { color: var(--muted); }
.order-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}
.ghost, .primary {
  height: 30px;
  padding: 0 12px;
  border-radius: 15px;
  font-size: 12px;
}
.ghost { border: 1px solid #ddd; color: #555; }
.primary { background: var(--red); color: #fff; }

.app-order-detail {
  padding-bottom: calc(72px + var(--safe-b));
}
.order-detail-status {
  margin: 12px;
  padding: 18px 16px;
  border-radius: 10px;
  color: #fff;
}
.order-detail-status h2 {
  font-size: 18px;
  font-weight: 600;
}
.order-detail-status p {
  margin-top: 6px;
  font-size: 13px;
  opacity: 0.92;
}
.order-detail-status.paid { background: linear-gradient(135deg, #07c160, #05a650); }
.order-detail-status.unpaid { background: linear-gradient(135deg, #e02e24, #c41e17); }
.order-detail-status.cancelled { background: linear-gradient(135deg, #999, #777); }
.order-detail-info {
  padding: 4px 0;
}
.order-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  font-size: 14px;
  border-bottom: 1px solid #f5f5f5;
}
.order-detail-row:last-child {
  border-bottom: 0;
}
.order-detail-row span {
  color: var(--sub);
  flex-shrink: 0;
}
.order-detail-val {
  text-align: right;
  font-weight: 500;
  word-break: break-all;
}
.order-detail-bottom {
  gap: 10px;
}
.order-detail-bottom .ghost,
.order-detail-bottom .confirm-btn {
  flex: 1;
  min-width: 0;
}
.order-detail-bottom.hidden {
  display: none;
}

.wx-auth-mask {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 80;
  display: grid;
  place-items: center;
}
.wx-auth-card {
  width: 250px;
  background: #fff;
  border-radius: 12px;
  padding: 24px 20px 20px;
  text-align: center;
}
.wx-auth-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 12px;
  border-radius: 10px;
  background: var(--wx);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 15px;
  font-weight: 700;
}
.wx-auth-card h3 { font-size: 16px; }
.wx-auth-card p { margin-top: 8px; font-size: 13px; color: var(--sub); }
.wx-auth-dots { margin-top: 16px; display: flex; justify-content: center; gap: 6px; }
.wx-auth-dots i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--wx);
  animation: blink 1s infinite;
}
.wx-auth-dots i:nth-child(2) { animation-delay: 0.15s; }
.wx-auth-dots i:nth-child(3) { animation-delay: 0.3s; }
@keyframes blink {
  0%, 80%, 100% { opacity: 0.25; }
  40% { opacity: 1; }
}

.toast {
  position: fixed;
  left: 50%;
  top: 42%;
  transform: translate(-50%, -10px);
  background: rgba(0, 0, 0, 0.78);
  color: #fff;
  font-size: 13px;
  padding: 10px 16px;
  border-radius: 6px;
  z-index: 90;
  opacity: 0;
  transition: 0.2s;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.page-pad { padding-bottom: 8px; }
.hidden { display: none !important; }

.phone-login-mask {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 85;
  display: none;
  place-items: center;
  padding: 20px;
}
.phone-login-mask.show {
  display: grid;
}
.phone-login-card {
  width: 100%;
  max-width: 340px;
  background: #fff;
  border-radius: 12px;
  padding: 22px 18px 18px;
  position: relative;
}
.phone-login-close {
  position: absolute;
  right: 10px;
  top: 8px;
  border: 0;
  background: transparent;
  font-size: 24px;
  line-height: 1;
  color: var(--sub);
}
.phone-login-card h3 {
  font-size: 18px;
  margin-bottom: 6px;
}
.phone-login-tip {
  font-size: 13px;
  color: var(--sub);
  margin-bottom: 16px;
}
.phone-login-card .field {
  display: block;
  min-height: 0;
  margin-bottom: 14px;
  border-bottom: 0;
}
.phone-login-card .field label {
  display: block;
  width: auto;
  margin-bottom: 6px;
  font-size: 13px;
  color: var(--sub);
}
.phone-login-card .field input {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafafa;
  box-sizing: border-box;
}
.phone-login-card .phone-code-row .field,
.phone-login-card .phone-code-row {
  display: block;
}
.phone-login-card .phone-code-row .phone-code-input {
  display: flex;
  gap: 8px;
}
.phone-code-row .phone-code-input {
  display: flex;
  gap: 8px;
}
.phone-code-row .phone-code-input input {
  flex: 1;
  min-width: 0;
}
.phone-code-row .phone-code-input button {
  flex-shrink: 0;
  height: 42px;
  border: 1px solid var(--red);
  background: #fff;
  color: var(--red);
  border-radius: 8px;
  padding: 0 12px;
  font-size: 13px;
  white-space: nowrap;
}
.phone-code-row .phone-code-input button:disabled {
  color: var(--sub);
  border-color: var(--line);
}
.phone-login-submit {
  display: block;
  width: 100%;
  margin-top: 18px;
  height: 44px;
  border: 0;
  border-radius: 22px;
  background: var(--red);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}
.guest-fields .field input[readonly] {
  background: #f7f7f7;
  color: var(--sub);
}
