* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: #ececec;
  color: #333;
  min-height: 100vh;
}
a { color: inherit; }
button, input, textarea { font-family: inherit; }
.container {
  max-width: 480px;
  margin: 0 auto;
  background: #fff;
  min-height: 100vh;
  position: relative;
  padding-bottom: 74px;
}
.header {
  background: #1a1a1a url('../images/megatron.jpg') center 30% / cover no-repeat;
  color: #fff;
  padding: 15px 15px 14px;
  position: relative;
  overflow: hidden;
}
.header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(10,5,2,.22) 0%, rgba(10,5,2,0) 70%);
}
.header > *:not(.user-area) { position: relative; z-index: 1; }
.logo {
  font-size: 28px;
  font-weight: 700;
  background: linear-gradient(135deg, #f5d878, #ffe8a0 50%, #d4a017);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,.5));
}
.user-area {
  position: absolute;
  top: 15px;
  right: 15px;
  display: flex;
  gap: 8px;
  z-index: 2;
}
.user-btn {
  color: #fff;
  text-decoration: none;
  font-size: 13px;
  padding: 5px 12px;
  border-radius: 20px;
  background: rgba(139,105,20,.5);
  border: 1px solid rgba(212,160,23,.6);
}
.category-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 36px;
  background: rgba(139,105,20,.5);
  border: 1px solid rgba(212,160,23,.6);
  color: #fff;
  padding: 6px 14px;
  border-radius: 20px;
  cursor: pointer;
}
.announce { padding: 10px 12px 0; }
.announce-card { background: #fff1f0; border: 1px solid #ffccc7; border-radius: 12px; padding: 10px 12px; }
.announce-card b { color: #cf1322; }
.announce-card p { margin-top: 4px; font-size: 13px; line-height: 1.55; white-space: pre-wrap; }
.shop-notice { padding: 10px 12px 0; }
.notice-card { background: #fff8e8; border: 1px solid #f0d48a; border-radius: 12px; padding: 10px 12px; }
.notice-title { font-weight: 700; margin-bottom: 6px; }
.req-row { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; }
.req-chip { display: flex; gap: 6px; align-items: center; border: 1px solid #ead7a2; background: #fff; border-radius: 10px; padding: 6px 8px; text-align: left; cursor: pointer; min-width: 160px; }
.req-chip img { width: 42px; height: 42px; object-fit: cover; border-radius: 6px; background: #f6f6f6; }
.req-chip span { font-size: 12px; line-height: 1.35; }
.fee-line { display: flex; justify-content: space-between; font-size: 14px; padding: 3px 0; }
.fee-note { font-size: 12px; color: #887; margin-top: 4px; }
.need-required { background: #fff4f0; color: #c0392b; border-radius: 8px; padding: 8px; font-size: 13px; margin-bottom: 8px; }
.need-required button { margin-left: 8px; border: none; background: #e67e22; color: #fff; border-radius: 6px; padding: 4px 8px; cursor: pointer; }
.activity-banner-home {
  margin: 10px 12px 0;
  background: linear-gradient(135deg, #ff6b6b, #ee5a24);
  border-radius: 12px;
  color: #fff;
  cursor: pointer;
}
.activity-banner-home-content { display: flex; align-items: center; padding: 12px 15px; gap: 10px; }
.activity-banner-home-info { flex: 1; }
.activity-banner-home-title { font-weight: 700; }
.activity-banner-home-desc { font-size: 12px; opacity: .9; }
.activity-banner-home-arrow { background: rgba(255,255,255,.25); padding: 4px 10px; border-radius: 12px; font-size: 13px; }
.products-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 10px; }
.product-card { background: #fff; border-radius: 10px; overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.product-image { position: relative; aspect-ratio: 1; background: #f7f7f7; cursor: pointer; overflow: hidden; }
.product-image img { width: 100%; height: 100%; object-fit: cover; }
.stock-tag, .badge-top, .badge-new, .badge-limit {
  position: absolute; top: 6px; color: #fff; font-size: 11px; font-weight: 700;
  padding: 2px 6px; border-radius: 4px;
}
.stock-tag { right: 6px; background: rgba(0,0,0,.5); font-weight: 400; }
.badge-top { left: 6px; background: linear-gradient(135deg, #ff6b6b, #ee5a24); }
.badge-new { left: 46px; background: linear-gradient(135deg, #667eea, #764ba2); }
.badge-limit { left: 6px; bottom: 6px; top: auto; background: linear-gradient(135deg, #f39c12, #e67e22); }
.sold-out {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  background: rgba(0,0,0,.6); color: #fff; padding: 5px 14px; border-radius: 6px; font-weight: 700;
}
.product-info { padding: 10px; }
.product-name { font-size: 14px; line-height: 1.35; height: 38px; overflow: hidden; }
.product-price { color: #e74c3c; font-size: 18px; font-weight: 700; margin: 4px 0; }
.product-price span { font-size: 12px; color: #888; font-weight: 400; }
.product-sales { color: #999; font-size: 12px; margin-bottom: 8px; }
.add-to-cart-btn, .btn-primary, .btn {
  border: none; cursor: pointer; border-radius: 6px;
}
.add-to-cart-btn, .btn-primary {
  width: 100%; background: #667eea; color: #fff; padding: 8px; font-size: 13px;
}
.add-to-cart-btn:disabled { background: #ccc; }
.floating-button {
  position: fixed; right: max(15px, calc(50vw - 225px)); bottom: 86px;
  width: 52px; height: 52px; border-radius: 50%; background: #667eea; color: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  box-shadow: 0 3px 12px rgba(102,126,234,.4); z-index: 20; cursor: pointer;
}
.floating-button .label { font-size: 10px; }
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; max-width: 480px; margin: 0 auto;
  background: #fff; display: flex; border-top: 1px solid #eee; z-index: 40; padding: 6px 0 8px;
}
.nav-item {
  flex: 1; background: none; border: none; color: #999; display: flex; flex-direction: column;
  align-items: center; gap: 2px; cursor: pointer; position: relative; font-size: 12px;
}
.nav-item.active { color: #667eea; }
.nav-icon { font-size: 20px; }
.cart-badge {
  position: absolute; top: -2px; right: 28%; min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 8px; background: #e74c3c; color: #fff; font-size: 10px; display: none;
  align-items: center; justify-content: center;
}
.modal-overlay {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5);
  z-index: 80; align-items: center; justify-content: center;
}
.modal-overlay.show { display: flex; }
.modal-content {
  width: min(92%, 400px); background: #fff; border-radius: 12px; padding: 20px; position: relative;
  max-height: 86vh; overflow: auto;
}
.close-modal {
  position: absolute; right: 12px; top: 8px; border: none; background: none; font-size: 28px; color: #999; cursor: pointer;
}
.qrcode-container, .welcome-container, .category-container { text-align: center; }
.qrcode-image { width: 200px; height: 200px; object-fit: contain; }
.category-list { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.category-item {
  display: flex; align-items: center; gap: 10px; padding: 14px; border: none; border-radius: 10px;
  background: #f6f7fb; cursor: pointer; font-size: 15px;
}
.category-item.active { background: #e8eaf6; color: #4c5fd7; }
.detail-image img { width: 140px; height: 140px; object-fit: cover; border-radius: 8px; }
.detail-price { color: #e74c3c; font-size: 22px; font-weight: 700; text-align: center; margin: 6px 0; }
.detail-desc { background: #f8f9fa; border-radius: 6px; padding: 8px; font-size: 13px; color: #666; margin: 8px 0; }
.page-head {
  background: linear-gradient(135deg, #667eea, #764ba2); color: #fff; padding: 18px 16px 16px; position: relative;
}
.page-head h1 { text-align: center; font-size: 18px; }
.back-link { position: absolute; left: 14px; top: 18px; color: #fff; text-decoration: none; font-size: 14px; }
.subpage { background: #f5f5f5; }
.card { background: #fff; margin: 12px; border-radius: 12px; padding: 14px; }
.auth-body {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #667eea, #764ba2); padding: 24px 12px;
}
.auth-card { width: min(420px, 100%); background: #fff; border-radius: 12px; padding: 32px 24px; }
.auth-card h1 { text-align: center; margin-bottom: 6px; }
.auth-card .tip { text-align: center; color: #777; font-size: 13px; margin-bottom: 20px; }
.field { margin-bottom: 14px; }
.field label { display: block; margin-bottom: 6px; font-size: 14px; }
.field input, .field textarea, .line input {
  width: 100%; border: 1px solid #ddd; border-radius: 6px; padding: 12px; font-size: 14px;
}
.row-btn { display: flex; gap: 8px; }
.row-btn input { flex: 1; }
.ghost {
  border: none; background: #eef0fb; color: #667eea; border-radius: 6px; padding: 0 12px; cursor: pointer; white-space: nowrap;
}
.links { text-align: center; margin-top: 16px; font-size: 14px; }
.links a { color: #667eea; text-decoration: none; }
.error { color: #e74c3c; font-size: 13px; min-height: 18px; }
.profile-hero { background: linear-gradient(135deg, #667eea, #764ba2); color: #fff; text-align: center; padding: 36px 16px 48px; position: relative; }
.avatar {
  width: 76px; height: 76px; margin: 0 auto 10px; border-radius: 50%;
  background: rgba(255,255,255,.25); display: flex; align-items: center; justify-content: center; font-size: 34px;
}
.logout-btn { margin-top: 14px; background: rgba(255,255,255,.2); color: #fff; border: none; border-radius: 20px; padding: 8px 18px; cursor: pointer; }
.stats-card { margin: -28px 14px 14px; background: #fff; border-radius: 12px; padding: 16px; box-shadow: 0 4px 12px rgba(0,0,0,.08); position: relative; }
.stats-grid, .menu-list { display: flex; }
.stats-grid { justify-content: space-around; text-align: center; }
.stat-value { font-size: 22px; color: #667eea; font-weight: 700; }
.stat-label, .menu-title { color: #999; font-size: 12px; }
.menu-title { margin: 4px 16px; }
.menu-list { flex-direction: column; background: #fff; margin: 0 14px 14px; border-radius: 12px; overflow: hidden; }
.menu-item { display: flex; align-items: center; gap: 12px; padding: 15px 16px; border-bottom: 1px solid #f2f2f2; cursor: pointer; background: #fff; }
.menu-text { flex: 1; }
.menu-arrow { color: #ccc; }
.cart-item, .order-card, .addr-card, .record-item {
  display: flex; gap: 10px; background: #fff; margin: 10px 12px; padding: 12px; border-radius: 10px;
}
.cart-item img, .order-thumb { width: 72px; height: 72px; border-radius: 8px; object-fit: cover; background: #f3f3f3; }
.grow { flex: 1; }
.qty { display: flex; align-items: center; gap: 6px; margin-top: 8px; }
.qty button { width: 26px; height: 26px; border: 1px solid #ddd; background: #fff; border-radius: 4px; cursor: pointer; }
.price { color: #e74c3c; font-weight: 700; }
.muted { color: #999; font-size: 12px; }
.danger { color: #e74c3c; background: none; border: none; cursor: pointer; }
.footer-bar {
  position: fixed; left: 0; right: 0; bottom: 58px; max-width: 480px; margin: 0 auto;
  background: #fff; border-top: 1px solid #eee; padding: 10px 12px 12px;
}
.free-bar { font-size: 12px; color: #e67e22; margin-bottom: 6px; }
.free-track { height: 6px; background: #f3e6d4; border-radius: 4px; overflow: hidden; margin-bottom: 8px; }
.free-fill { height: 100%; width: 0; background: #e67e22; }
.free-fill.ok, .free-bar.ok { background: #52c41a; color: #52c41a; }
.sum { display: flex; justify-content: space-between; font-size: 13px; margin-top: 4px; }
.checkout-btn { width: 100%; margin-top: 8px; background: #667eea; color: #fff; border: none; border-radius: 8px; padding: 12px; font-size: 16px; cursor: pointer; }
.empty { text-align: center; color: #999; padding: 48px 16px; }
.sheet { width: min(480px, 100%); margin-top: auto; border-radius: 16px 16px 0 0; max-height: 92vh; }
.modal-overlay.sheet-wrap { align-items: flex-end; }
.line { margin-bottom: 10px; }
.switch { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.tabs { display: flex; background: #fff; position: sticky; top: 0; }
.tabs button { flex: 1; border: none; background: #fff; padding: 12px 0; cursor: pointer; color: #666; }
.tabs button.on { color: #667eea; border-bottom: 2px solid #667eea; }
.order-card { display: block; }
.order-top, .order-actions { display: flex; justify-content: space-between; align-items: center; }
.status { font-size: 13px; color: #e67e22; }
.status.done { color: #52c41a; }
.status.cancel { color: #999; }
.mini { border: none; border-radius: 16px; padding: 6px 12px; cursor: pointer; background: #667eea; color: #fff; }
.mini.line { background: #fff; color: #667eea; border: 1px solid #667eea; }
.points-hero { text-align: center; padding: 28px 12px; background: linear-gradient(135deg, #667eea, #764ba2); color: #fff; }
.points-hero strong { font-size: 42px; display: block; }
.code-box { text-align: center; font-size: 28px; letter-spacing: 4px; font-weight: 700; color: #667eea; }
.copy-btn { width: 100%; margin-top: 10px; }
.toast {
  position: fixed; left: 50%; top: 46%; transform: translate(-50%, -50%);
  background: rgba(0,0,0,.78); color: #fff; padding: 10px 16px; border-radius: 8px; z-index: 100; font-size: 14px;
}
.pay-methods { display: flex; gap: 8px; }
.pay-methods button { flex: 1; padding: 12px; border-radius: 8px; border: 1px solid #ddd; background: #fff; cursor: pointer; }
.pay-methods button.on { border-color: #667eea; color: #667eea; background: #f4f6ff; }
.pay-qr { width: min(280px, 86vw); display: block; margin: 12px auto; border-radius: 12px; background: #fff; }
.pay-amount { text-align: center; font-size: 32px; font-weight: 700; color: #e23d3d; margin: 8px 0; }
.pay-wait { text-align: center; color: #667eea; margin-top: 10px; }
.rank-item, .reward-item { display: flex; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid #f2f2f2; }
.rank-no { width: 28px; height: 28px; border-radius: 50%; background: #eef0fb; display: flex; align-items: center; justify-content: center; font-weight: 700; }
.countdown { display: flex; justify-content: center; gap: 8px; margin-top: 12px; }
.countdown div { background: rgba(255,255,255,.18); min-width: 54px; border-radius: 8px; padding: 6px; text-align: center; }
.tag { display: inline-block; background: #fff3e6; color: #e67e22; border-radius: 4px; padding: 1px 6px; font-size: 12px; }
