:root {
  --bg: #f5f6f8;
  --card: #fff;
  --text: #1a1a1a;
  --muted: #6b7280;
  --accent: #07c160;
  --accent-dark: #06ad56;
  --border: #e5e7eb;
  --radius: 12px;
  --shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  padding-bottom: env(safe-area-inset-bottom, 16px);
  min-height: 100vh;
}

.page {
  max-width: 480px;
  margin: 0 auto;
  padding: 12px 14px 24px;
}

/* 顶部栏 */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0 14px;
}

.logo {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
}

/* 搜索 */
.search-wrap {
  margin-bottom: 14px;
}

.search-input {
  width: 100%;
  height: 44px;
  padding: 0 16px 0 44px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background-color: var(--card);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Ccircle cx='8' cy='8' r='6'/%3E%3Cpath d='M13 13l5 5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 14px center;
  background-size: 18px;
  font-size: 15px;
  outline: none;
  box-shadow: var(--shadow);
}

.search-input:focus {
  border-color: var(--accent);
}

/* 轮播 */
.carousel {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
  background: var(--card);
}

.carousel-track {
  display: flex;
  transition: transform 0.35s ease;
}

.carousel-slide {
  flex: 0 0 100%;
  aspect-ratio: 16 / 9;
}

.carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.carousel-dots {
  position: absolute;
  bottom: 10px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 6px;
}

.carousel-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  border: none;
  padding: 0;
  cursor: pointer;
}

.carousel-dot.active {
  background: #fff;
  width: 16px;
  border-radius: 3px;
}

.section-title {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 10px;
  font-weight: 500;
}

/* 商品列表 */
.product-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.product-card {
  display: flex;
  gap: 12px;
  background: var(--card);
  border-radius: var(--radius);
  padding: 12px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.product-card.hidden {
  display: none;
}

.product-cover {
  width: 96px;
  height: 96px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
  background: #eef2f7;
}

.product-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.product-name {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
}

.price {
  color: #e11d48;
  font-weight: 700;
  font-size: 1.05rem;
}

.price small {
  font-size: 0.75rem;
  font-weight: 500;
}

.btn-buy {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fff;
  border: none;
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.btn-buy:active {
  opacity: 0.9;
  transform: scale(0.98);
}

.empty-hint {
  text-align: center;
  color: var(--muted);
  padding: 32px 16px;
  font-size: 14px;
}

/* 表单页 */
.form-page .page-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.form-page .sub {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 20px;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 15px;
  background: var(--card);
}

.form-group textarea {
  min-height: 72px;
  resize: vertical;
}

.btn-block {
  width: 100%;
  height: 48px;
  border: none;
  border-radius: 24px;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  margin-top: 8px;
  cursor: pointer;
}

.order-preview {
  background: var(--card);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 20px;
  border: 1px solid var(--border);
  font-size: 14px;
}

.order-preview dt {
  color: var(--muted);
  font-size: 12px;
  margin-top: 10px;
}

.order-preview dt:first-child {
  margin-top: 0;
}

.order-preview dd {
  font-weight: 500;
  margin-top: 4px;
}

/* 收银台 */
.checkout-summary {
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.checkout-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.checkout-row:last-child {
  border-bottom: none;
}

.checkout-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 2px dashed var(--border);
}

.checkout-total strong {
  color: #e11d48;
  font-size: 1.35rem;
}

.pay-section {
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.pay-section h3 {
  font-size: 15px;
  margin-bottom: 14px;
}

.btn-wechat-pay {
  width: 100%;
  height: 52px;
  border: none;
  border-radius: 26px;
  background: #07c160;
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
}

.btn-wechat-pay .icon {
  width: 24px;
  height: 24px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M8.5 10.5c.8 0 1.5-.7 1.5-1.5S9.3 7.5 8.5 7.5 7 8.2 7 9s.7 1.5 1.5 1.5zm7 0c.8 0 1.5-.7 1.5-1.5S16.3 7.5 15.5 7.5 14 8.2 14 9s.7 1.5 1.5 1.5zM12 2C6.5 2 2 5.6 2 10c0 2.4 1.3 4.5 3.3 5.8L4 22l6.2-3.3c.6.1 1.2.2 1.8.2 5.5 0 10-3.6 10-8s-4.5-8-10-8z'/%3E%3C/svg%3E")
    center/contain no-repeat;
}

.pay-note {
  margin-top: 12px;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 100px;
  transform: translateX(-50%) translateY(20px);
  background: rgba(0, 0, 0, 0.78);
  color: #fff;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  z-index: 1000;
  max-width: 85%;
  text-align: center;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.back-link {
  display: inline-block;
  color: var(--accent);
  font-size: 14px;
  text-decoration: none;
  margin-bottom: 12px;
}

.back-link:active {
  opacity: 0.7;
}

.fixed-paybar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.98);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom, 0);
  z-index: 999;
}

.fixed-paybar-inner {
  max-width: 480px;
  margin: 0 auto;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.fixed-paybar-amount {
  font-size: 14px;
  color: var(--muted);
}

.fixed-paybar-amount strong {
  color: #e11d48;
  font-size: 18px;
}

.pay-option {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  cursor: pointer;
}

.pay-option.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(7, 193, 96, 0.12);
}

.pay-icon {
  width: 26px;
  height: 26px;
  object-fit: contain;
  flex-shrink: 0;
}

.pay-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.auth-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
