* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --primary: #1677ff;
  --primary-light: #e6f4ff;
  --danger: #ff4d4f;
  --success: #52c41a;
  --text: #333;
  --text-secondary: #666;
  --text-hint: #999;
  --border: #e8e8e8;
  --bg: #f5f5f5;
  --card-bg: #fff;
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
}
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  padding-bottom: 80px;
}
/* Header */
.header {
  background: linear-gradient(135deg, var(--primary), #4096ff);
  color: #fff;
  padding: 20px 16px 16px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(22,119,255,0.3);
}
.header-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.header-actions { display: flex; align-items: center; gap: 6px; }
.header h1 { font-size: 20px; font-weight: 600; }
.header .meta { font-size: 12px; opacity: 0.85; margin-bottom: 12px; }
.register-btn {
  background: rgba(255,255,255,0.2);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.5);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
}
.register-btn:active { background: rgba(255,255,255,0.3); }
/* Category bar: search + hot tags */
.category-bar {
  padding: 10px 16px;
  background: #fff;
  border-bottom: 1px solid var(--border);
}
.cat-search-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.cat-search-wrap {
  position: relative;
  flex: 1;
}
.cat-search-input {
  width: 100%;
  padding: 8px 12px 8px 32px;
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s;
}
.cat-search-input:focus { border-color: var(--primary); }
.cat-search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  color: var(--text-hint);
  pointer-events: none;
}
.cat-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  max-height: 260px;
  overflow-y: auto;
  z-index: 150;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  margin-top: 4px;
}
.cat-dropdown.show { display: block; }
.cat-dropdown-item {
  padding: 10px 14px;
  font-size: 13px;
  cursor: pointer;
  border-bottom: 1px solid #f0f0f0;
  transition: background 0.15s;
}
.cat-dropdown-item:last-child { border-bottom: none; }
.cat-dropdown-item:hover { background: var(--primary-light); }
.cat-dropdown-item.active {
  color: var(--primary);
  font-weight: 500;
  background: var(--primary-light);
}
.cat-dropdown-empty {
  padding: 20px;
  text-align: center;
  color: var(--text-hint);
  font-size: 13px;
}
.cat-active-tag {
  display: none;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  border: 1px solid var(--primary);
}
.cat-active-tag.show { display: flex; }
.cat-active-tag .tag-close {
  font-size: 14px;
  margin-left: 2px;
  opacity: 0.7;
}
/* Hot tags row */
.hot-tags-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.hot-tags-label {
  font-size: 11px;
  color: var(--text-hint);
  white-space: nowrap;
}
.hot-tag {
  padding: 4px 10px;
  background: #fff7e6;
  color: #d46b08;
  border: 1px solid #ffd591;
  border-radius: 14px;
  font-size: 11px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}
.hot-tag:active {
  background: #fff1b8;
  transform: scale(0.96);
}
.cat-tags-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.cat-tag-more { padding: 4px 10px; background: #fff7e6; color: #d46b08; border: none; border-radius: 20px; font-size: 12px; cursor: pointer; white-space: nowrap; margin-top: 8px; }
.cat-tag-more:active { background: #fff1b8; }
.hot-tag.selected {
  background: #d46b08;
  color: #fff;
  border-color: #d46b08;
}
.cat-tag {
  padding: 4px 10px;
  background: #f5f5f5;
  color: #595959;
  border: 1px solid #e0e0e0;
  border-radius: 14px;
  font-size: 11px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}
.cat-tag:active {
  background: #e8e8e8;
  transform: scale(0.96);
}
.cat-tag.selected {
  background: #1890ff;
  color: #fff;
  border-color: #1890ff;
}

/* 回到顶部浮标 */
.back-to-top {
  position: fixed;
  top: 50%;
  left: 12px;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
}
.back-to-top.show {
  opacity: 1;
  visibility: visible;
}
.back-to-top:hover {
  transform: translateY(calc(-50% - 3px));
  box-shadow: 0 6px 16px rgba(102, 126, 234, 0.5);
}
.back-to-top:active {
  transform: scale(0.9);
}
/* Product grid */
.product-list {
  padding: 12px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
@media (min-width: 768px) {
  .product-list { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 1024px) {
  .product-list { grid-template-columns: repeat(4, 1fr); max-width: 1200px; margin: 0 auto; }
}
.product-card {
  background: var(--card-bg);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.2s;
  cursor: pointer;
  position: relative;
}
.product-card:active { transform: scale(0.98); }
.product-img-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  background: #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.product-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  padding: 6px;
}
.product-img-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ccc;
  font-size: 32px;
}
.sku-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 500;
}
/* Category tag on product card */
.product-cat-tag {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(22,119,255,0.85);
  color: #fff;
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 400;
  max-width: 70%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.product-info { padding: 10px; }
.product-name {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 36px;
}
.product-price-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-top: 8px;
}
.product-price-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.product-wholesale {
  color: var(--danger);
  font-size: 16px;
  font-weight: 600;
}
.product-wholesale small { font-size: 11px; font-weight: 400; color: var(--text-secondary); }
.product-retail {
  font-size: 11px;
  color: var(--text-hint);
  text-decoration: line-through;
}
.product-stock { font-size: 11px; color: var(--text-hint); }
.product-stock.low { color: #d48806; }
.product-stock.out { color: var(--danger); font-weight: 500; }
.product-card.sold-out { opacity: 0.55; }
.product-card.sold-out .product-img-wrap::after {
  content: '售罄';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0,0,0,0.65);
  color: #fff;
  padding: 4px 14px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 1px;
  z-index: 2;
}
.sku-item.sold-out .sku-name { color: var(--text-hint); }
.sku-item.sold-out .sku-price { opacity: 0.45; }
.sku-item.sold-out .sku-stock { color: var(--danger); font-weight: 500; }
.sku-item.sold-out .qty-btn,
.sku-item.sold-out .qty-input { opacity: 0.35; pointer-events: none; }
.qty-warn { color: var(--danger); font-size: 11px; margin-top: 2px; }
/* Detail modal */
.detail-img {
  width: 100%;
  max-height: 280px;
  object-fit: contain;
  border-radius: 8px;
  background: #f5f5f5;
}
.detail-meta {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.detail-cat-tag {
  display: inline-block;
  background: var(--primary-light);
  color: var(--primary);
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 12px;
  border: 1px solid var(--primary);
}
.sku-list { margin-top: 12px; }
.sku-item {
  display: flex;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  gap: 10px;
}
.sku-item:last-child { border-bottom: none; }
.sku-info { flex: 1; min-width: 0; }
.sku-name { font-size: 14px; font-weight: 500; word-break: break-all; }
.sku-spec { font-size: 12px; color: var(--text-hint); margin-top: 2px; }
.sku-price { font-size: 13px; color: var(--danger); margin-top: 2px; }
.sku-price .retail-line { font-size: 11px; color: var(--text-hint); text-decoration: line-through; margin-left: 6px; }
.sku-stock { font-size: 11px; color: var(--text-hint); margin-top: 2px; }
.sku-stock.low { color: var(--danger); }
.sku-qty {
  display: flex;
  align-items: center;
  gap: 0;
  flex-shrink: 0;
}
/* Confirm button in detail modal */
.detail-confirm-bar {
  position: sticky;
  bottom: 0;
  background: #fff;
  padding: 12px 0 0;
  margin-top: 12px;
  border-top: 1px solid var(--border);
}
.detail-confirm-btn {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}
.detail-confirm-btn.has-items {
  background: var(--primary);
  color: #fff;
}
.detail-confirm-btn.has-items:active { background: #0958d9; }
.detail-confirm-btn.no-items {
  background: var(--bg);
  color: var(--text-hint);
}
/* Quantity control */
.qty-btn {
  width: 28px;
  height: 28px;
  border: 1px solid var(--primary);
  background: var(--primary-light);
  color: var(--primary);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}
.qty-btn.minus { border-radius: 4px 0 0 4px; }
.qty-btn.plus { border-radius: 0 4px 4px 0; }
.qty-input {
  width: 40px;
  height: 28px;
  border: 1px solid var(--primary);
  border-left: none;
  border-right: none;
  text-align: center;
  font-size: 13px;
  outline: none;
}
/* Cart bar */
.cart-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #fff;
  border-top: 1px solid var(--border);
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 200;
  box-shadow: 0 -2px 12px rgba(0,0,0,0.08);
}
.presale-nav-entry {
  text-decoration: none;
  color: var(--primary);
  text-align: center;
  font-size: 18px;
  line-height: 1.1;
  cursor: pointer;
  padding: 2px 12px;
  border-radius: 8px;
  transition: background 0.2s;
}
.presale-nav-entry small { font-size: 10px; }
.presale-nav-entry:active { background: rgba(22,119,255,0.08); }
.presale-badge {
  position: absolute;
  top: -4px;
  right: -8px;
  background: #ff4d4f;
  color: #fff;
  font-size: 8px;
  padding: 1px 4px;
  border-radius: 6px;
  line-height: 1;
  font-style: normal;
}
.original-nav-entry {
  text-decoration: none;
  color: #722ed1;
  text-align: center;
  font-size: 18px;
  line-height: 1.1;
  cursor: pointer;
  padding: 2px 12px;
  border-radius: 8px;
  transition: background 0.2s;
}
.original-nav-entry small { font-size: 10px; }
.original-nav-entry:active { background: rgba(114,46,209,0.08); }
.original-badge {
  position: absolute;
  top: -4px;
  right: -8px;
  background: #ff4d4f;
  color: #fff;
  font-size: 8px;
  padding: 1px 4px;
  border-radius: 6px;
  line-height: 1;
  font-style: normal;
}
.cart-right-actions { display: flex; align-items: center; gap: 12px; }
.cart-info { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.cart-icon { position: relative; font-size: 24px; }
.cart-badge {
  position: absolute;
  top: -6px;
  right: -8px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}
.cart-total { font-size: 16px; font-weight: 600; color: var(--danger); }
.cart-total small { font-size: 12px; color: var(--text-secondary); font-weight: 400; }
.checkout-btn {
  padding: 10px 24px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
}
.checkout-btn:disabled { background: #ccc; cursor: not-allowed; }
/* Modal overlay */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 300;
  justify-content: center;
  align-items: flex-end;
}
.modal-overlay.show { display: flex; }
.modal-content {
  background: #fff;
  width: 100%;
  max-width: 600px;
  max-height: 85vh;
  border-radius: 16px 16px 0 0;
  overflow-y: auto;
  padding: 20px 16px;
  animation: slideUp 0.3s ease;
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.modal-header h2 { font-size: 18px; }
.modal-close {
  width: 32px;
  height: 32px;
  border: none;
  background: var(--bg);
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
/* Cart items */
.cart-item {
  display: flex;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}
.cart-item-info { flex: 1; }
.cart-item-name { font-size: 14px; font-weight: 500; }
.cart-item-spec { font-size: 12px; color: var(--text-hint); }
.cart-item-price { font-size: 13px; margin-top: 4px; }
.cart-item-price .ws-price { color: var(--danger); font-weight: 600; }
.cart-item-price .rt-price { font-size: 11px; color: var(--text-hint); text-decoration: line-through; margin-left: 6px; }
.cart-item-qty { display: flex; align-items: center; gap: 0; }
.cart-item-remove {
  margin-left: 12px;
  color: var(--text-hint);
  cursor: pointer;
  font-size: 18px;
}
/* Order form */
.order-form { margin-top: 20px; }
.order-form h3 { font-size: 16px; margin-bottom: 12px; }
.form-group { margin-bottom: 12px; }
.form-group label { display: block; font-size: 13px; color: var(--text-secondary); margin-bottom: 4px; }
.form-group input, .form-group textarea, .form-group select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
  background: #fff;
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus { border-color: var(--primary); }
.form-group textarea { resize: vertical; min-height: 60px; }
.addr-row { display: flex; gap: 8px; }
.addr-row .form-group { flex: 1; }
.order-summary {
  background: var(--bg);
  border-radius: 8px;
  padding: 12px;
  margin: 16px 0;
}
.order-summary .summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}
.order-summary .summary-row.last { margin-bottom: 0; }
.order-summary .total-row {
  display: flex;
  justify-content: space-between;
  font-size: 16px;
  font-weight: 600;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  margin-top: 6px;
}
.order-summary .total-row .amount { color: var(--danger); }
.order-actions { display: flex; gap: 10px; margin-top: 16px; }
.order-actions button {
  flex: 1;
  padding: 12px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}
.btn-copy { background: var(--primary); color: #fff; }
.btn-csv { background: var(--success); color: #fff; }
.btn-clear { background: var(--bg); color: var(--text-secondary); border: 1px solid var(--border); }
.btn-submit {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, #ff4d4f, #ff7875);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 12px;
  letter-spacing: 2px;
}
.btn-submit:active { background: linear-gradient(135deg, #cf1322, #ff4d4f); }
.btn-submit:disabled { background: #ccc; cursor: not-allowed; }
.order-preview {
  display: none;
  background: var(--bg);
  border-radius: 8px;
  padding: 16px;
  margin-top: 16px;
  font-size: 13px;
  line-height: 1.8;
  white-space: pre-wrap;
  word-break: break-all;
}
.order-preview.show { display: block; }
.copy-feedback {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0,0,0,0.75);
  color: #fff;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  z-index: 999;
  display: none;
}
.copy-feedback.show { display: block; }
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-hint);
}
.empty-state .icon { font-size: 48px; margin-bottom: 12px; }
.no-results { display: none; text-align: center; padding: 40px; color: var(--text-hint); }
.register-form { margin-top: 10px; }
.login-hint {
  display: none;
  background: #fff7e6;
  color: #d48806;
  border: 1px solid #ffe58f;
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 500;
  text-align: center;
  margin-bottom: 8px;
}
.login-hint.show { display: block; }
.field-error { color: #ff4d4f; font-size: 12px; margin-top: 4px; display: none; }
.field-error.show { display: block; }

/* ===== 登录/注册弹窗 参考图风格 ===== */
.auth-modal .modal-content {
  max-width: 380px;
  padding: 36px 28px 28px;
  border-radius: 20px;
  text-align: center;
  position: relative;
}
.auth-logo {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4facfe 0%, #3b82f6 100%);
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: 18px;
  box-shadow: 0 4px 16px rgba(59,130,246,0.25);
}
.auth-logo span {
  color: #fff; font-size: 24px; font-weight: 700; letter-spacing: 1px;
}
.auth-title {
  font-size: 22px; font-weight: 700; color: #1a1a1a; margin: 0 0 4px;
}
.auth-subtitle {
  font-size: 13px; color: #999; margin: 0 0 24px;
}
.auth-field {
  position: relative;
  margin-bottom: 14px;
  text-align: left;
}
.auth-field-icon {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  width: 18px; height: 18px; color: #bbb; pointer-events: none;
}
.auth-field input {
  width: 100%; box-sizing: border-box;
  padding: 12px 14px 12px 42px;
  border: 1.5px solid #e8e8e8; border-radius: 12px;
  font-size: 14px; color: #333; background: #fff;
  outline: none; transition: border-color 0.2s;
}
.auth-field input:focus {
  border-color: #3b82f6;
}
.auth-field input::placeholder { color: #c0c0c0; }
.auth-field .toggle-pwd {
  position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  cursor: pointer; color: #bbb; font-size: 13px; user-select: none;
}
.auth-field .toggle-pwd:hover { color: #666; }
.auth-error {
  color: #ff4d4f; font-size: 12px; margin: -6px 0 10px 4px;
  display: none; text-align: left;
}
.auth-error.show { display: block; }
.auth-btn {
  width: 100%; padding: 13px 0; border: none; border-radius: 24px;
  font-size: 16px; font-weight: 600; color: #fff; cursor: pointer;
  background: linear-gradient(135deg, #4facfe 0%, #3b82f6 100%);
  box-shadow: 0 4px 14px rgba(59,130,246,0.3);
  transition: opacity 0.2s, transform 0.1s;
  margin-top: 6px;
}
.auth-btn:active { transform: scale(0.98); }
.auth-btn:hover { opacity: 0.92; }
.auth-switch {
  text-align: center; margin-top: 18px; margin-bottom: 8px; font-size: 13px; color: #999; position: relative; z-index: 1;
}
.auth-switch a {
  color: #3b82f6; font-weight: 500; cursor: pointer; text-decoration: none; position: relative; z-index: 1; padding: 8px 4px;
}
.auth-switch a:hover { text-decoration: underline; }

.register-form .form-group { margin-bottom: 14px; }
.register-submit {
  width: 100%;
  padding: 12px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  margin-top: 8px;
}
.register-submit:active { background: #0958d9; }
.register-success {
  display: none;
  text-align: center;
  padding: 30px 20px;
}
.register-success .icon { font-size: 48px; color: var(--success); margin-bottom: 12px; }
.register-success h3 { font-size: 18px; margin-bottom: 8px; }
.register-success p { color: var(--text-secondary); font-size: 14px; }
.register-success .countdown { color: var(--primary); font-weight: 600; }
.register-confirm-btn {
  display: inline-block;
  padding: 10px 36px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  margin-top: 16px;
}
.register-confirm-btn:active { background: #0958d9; }
/* Logged-in state */
.user-info {
  display: none;
  align-items: center;
  gap: 6px;
  color: #fff;
  font-size: 12px;
}
.user-info.show { display: flex; }
.user-info .user-name {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
  background: rgba(255,255,255,0.22);
  border: 1.5px solid rgba(255,255,255,0.7);
  padding: 5px 12px;
  border-radius: 16px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5px;
  transition: all 0.2s;
  position: relative;
}
.user-info .user-name::after {
  content: ' ▾';
  font-size: 10px;
  opacity: 0.7;
  margin-left: 2px;
}
.user-info .user-name:hover {
  background: rgba(255,255,255,0.35);
  border-color: #fff;
}
.user-name-badge {
  position: absolute;
  top: -6px;
  right: -8px;
  background: #ff4d4f;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  line-height: 16px;
  text-align: center;
  border-radius: 8px;
  padding: 0 4px;
  display: none;
  box-shadow: 0 1px 3px rgba(255,77,79,0.4);
}
.user-name-badge.show {
  display: block;
}
.user-info .logout-btn {
  background: rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.8);
  border: none;
  padding: 5px 10px;
  border-radius: 12px;
  font-size: 11px;
  cursor: pointer;
  white-space: nowrap;
}
.user-info .logout-btn:hover { background: rgba(255,255,255,0.25); color: #fff; }
.user-info .logout-btn:active { background: rgba(255,255,255,0.3); }
/* Logged-in order fields */
.form-group input.logged-in,
.form-group textarea.logged-in,
.form-group select.logged-in {
  background: var(--bg);
  color: var(--text-secondary);
}
/* User Center */
.user-center-greeting { text-align: center; padding: 16px 0 8px; }
.user-center-greeting .greeting-name { font-size: 20px; font-weight: 600; color: var(--text); }
.user-center-greeting .greeting-phone { font-size: 13px; color: var(--text-hint); margin-top: 4px; }
.order-tabs { display: flex; border-bottom: 1px solid var(--border); margin: 0 -20px; padding: 0 20px; }
.order-tab { flex: 1; text-align: center; padding: 10px 0; font-size: 14px; color: var(--text-hint); cursor: pointer; border-bottom: 2px solid transparent; }
.order-tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 500; }
.tab-badge { display: inline-block; background: #ff4d4f; color: #fff; font-size: 10px; font-weight: 700; min-width: 16px; height: 16px; line-height: 16px; text-align: center; border-radius: 8px; padding: 0 4px; margin-left: 4px; vertical-align: middle; }
.order-list { margin-top: 12px; max-height: 55vh; overflow-y: auto; }
.order-card { background: var(--bg); border-radius: 10px; padding: 14px; margin-bottom: 10px; }
.order-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.order-card-time { font-size: 12px; color: var(--text-hint); }
.order-card-status { font-size: 12px; padding: 2px 8px; border-radius: 10px; font-weight: 500; }
.order-card-status.pending { background: #fff7e6; color: #d48806; }
.order-card-status.confirmed { background: #e6f4ff; color: #1677ff; }
.order-card-status.shipped { background: #f6ffed; color: #52c41a; }
.order-card-products { font-size: 13px; color: var(--text-secondary); line-height: 1.6; }
.order-card-products .product-row { display: flex; justify-content: space-between; }
.order-card-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.order-card-total { font-size: 16px; font-weight: 600; color: var(--danger); }
.order-card-total small { font-size: 12px; color: var(--text-hint); font-weight: 400; }
.order-card-detail-btn { font-size: 13px; color: var(--primary); cursor: pointer; background: none; border: none; padding: 4px 8px; }
.order-card-detail-btn:active { opacity: 0.7; }
.order-empty { text-align: center; padding: 40px 20px; color: var(--text-hint); }
.order-empty .empty-icon { font-size: 40px; margin-bottom: 8px; }
/* Order detail expand */
.order-card-expanded { display: none; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border); font-size: 12px; color: var(--text-secondary); line-height: 1.8; }
.order-card-expanded.show { display: block; }
.order-card-expanded .expand-row { display: flex; justify-content: space-between; }
.order-card-expanded .expand-label { color: var(--text-hint); }

/* ========== Mobile Responsive ========== */
@media (max-width: 480px) {
  body { padding-bottom: 70px; -webkit-text-size-adjust: 100%; }
  .header { padding: 14px 12px 10px; }
  .header h1 { font-size: 17px; }
  .header .meta { font-size: 11px; margin-bottom: 8px; }
  .register-btn { padding: 5px 10px; font-size: 11px; }

  .user-info .user-name { font-size: 11px; max-width: 80px; padding: 4px 8px; }
  .user-info .logout-btn { padding: 3px 8px; font-size: 10px; }
  .register-confirm-btn { padding: 9px 28px; font-size: 14px; }
  .user-center-greeting .greeting-name { font-size: 17px; }
  .order-card { padding: 10px; }
  .order-card-header { margin-bottom: 6px; }
  .order-card-products { font-size: 12px; }
  .order-card-total { font-size: 14px; }
  .order-list { max-height: 60vh; }
  .category-bar { padding: 8px 12px; }
  .cat-search-input { padding: 7px 10px 7px 28px; font-size: 13px; border-radius: 16px; }
  .cat-search-icon { font-size: 13px; left: 8px; }
  .hot-tags-row { gap: 5px; margin-top: 8px; }
  .hot-tag { padding: 3px 8px; font-size: 10px; }
  .hot-tags-label { font-size: 10px; }
  .product-list { padding: 8px; gap: 8px; grid-template-columns: repeat(2, 1fr); }
  .product-card { border-radius: 8px; }
  .product-info { padding: 8px; }
  .product-name { font-size: 12px; min-height: 32px; -webkit-line-clamp: 2; }
  .product-price-row { margin-top: 6px; flex-direction: column; align-items: flex-start; gap: 2px; }
  .product-wholesale { font-size: 14px; }
  .product-retail { font-size: 10px; }
  .product-stock { font-size: 10px; }
  .product-cat-tag { top: 6px; left: 6px; font-size: 9px; padding: 1px 6px; }
  .sku-badge { top: 6px; right: 6px; font-size: 9px; padding: 1px 6px; }
  .product-img { padding: 4px; }
  /* Cart bar */
  .cart-bar { padding: 8px 12px; }
  .cart-icon { font-size: 20px; }
  .cart-badge { min-width: 16px; height: 16px; font-size: 9px; top: -4px; right: -6px; }
  .cart-total { font-size: 14px; }
  .cart-total small { font-size: 11px; }
  .checkout-btn { padding: 8px 16px; font-size: 13px; border-radius: 6px; }
  /* Modal */
  .modal-content { padding: 16px 12px; border-radius: 12px 12px 0 0; max-height: 90vh; }
  .modal-header { margin-bottom: 12px; }
  .modal-header h2 { font-size: 16px; }
  .modal-close { width: 28px; height: 28px; font-size: 16px; }
  /* Detail */
  .detail-img { max-height: 220px; }
  .sku-item { padding: 8px 0; gap: 8px; }
  .sku-name { font-size: 13px; }
  .sku-spec { font-size: 11px; }
  .sku-price { font-size: 12px; }
  .sku-price .retail-line { font-size: 10px; margin-left: 4px; }
  .sku-stock { font-size: 10px; }
  .qty-btn { width: 30px; height: 30px; }
  .qty-input { width: 36px; height: 30px; font-size: 14px; }
  .detail-confirm-btn { padding: 11px; font-size: 14px; }
  /* Cart items */
  .cart-item { padding: 10px 0; gap: 8px; }
  .cart-item-name { font-size: 13px; }
  .cart-item-spec { font-size: 11px; }
  .cart-item-price { font-size: 12px; }
  .cart-item-price .rt-price { font-size: 10px; margin-left: 4px; }
  .cart-item-remove { margin-left: 8px; font-size: 16px; }
  /* Order form */
  .order-form h3 { font-size: 14px; margin-bottom: 8px; }
  .form-group { margin-bottom: 10px; }
  .form-group label { font-size: 12px; }
  .form-group input, .form-group textarea, .form-group select {
    padding: 9px 10px; font-size: 16px; border-radius: 6px; /* 16px prevents iOS zoom */
  }
  .form-group textarea { min-height: 50px; }
  .addr-row { flex-direction: column; gap: 0; }
  .addr-row .form-group { width: 100%; }
  .order-summary { padding: 10px; margin: 12px 0; }
  .order-summary .summary-row { font-size: 12px; }
  .order-summary .total-row { font-size: 14px; }
  .order-actions { gap: 6px; }
  .order-actions button { padding: 10px 6px; font-size: 13px; }
  .btn-submit { padding: 12px; font-size: 15px; letter-spacing: 1px; }
  .order-preview { padding: 12px; font-size: 12px; line-height: 1.6; }
  /* Register */
  .register-submit { padding: 11px; font-size: 14px; }
}
@media (max-width: 360px) {
  .product-list { gap: 6px; padding: 6px; }
  .product-name { font-size: 11px; }
  .product-wholesale { font-size: 13px; }
  .product-retail { font-size: 9px; }
  .header h1 { font-size: 15px; }
}

/* 地址选择器样式 */
/* 注册表单分组标题 */
.reg-section-title {
  font-size: 13px;
  font-weight: 600;
  color: #1a1a1a;
  margin: 18px 0 10px;
  padding-left: 8px;
  border-left: 3px solid #3b82f6;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.reg-required-hint {
  font-size: 11px;
  color: #ff4d4f;
  font-weight: 400;
}
#registerFormWrap .reg-section-title:first-of-type { margin-top: 4px; }

/* 会员中心信息样式 */
.uc-section-title {
  font-size: 14px;
  font-weight: 600;
  color: #1a1a1a;
  margin: 20px 0 10px;
  padding-left: 8px;
  border-left: 3px solid #3b82f6;
}
.uc-info-group {
  background: #f7f8fa;
  border-radius: 8px;
  padding: 2px 12px;
}
.uc-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #e8e8e8;
  font-size: 13px;
}
.uc-info-row:last-child { border-bottom: none; }
.uc-info-label { color: #999; }
.uc-info-value { color: #333; text-align: right; max-width: 65%; word-break: break-all; }

.address-section {
  margin-top: 4px;
}
.address-label {
  font-size: 13px;
  color: #666;
  margin-bottom: 6px;
  padding-left: 2px;
}
.address-select-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}
.address-select {
  flex: 1;
  height: 42px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 0 10px;
  font-size: 14px;
  color: #333;
  background: #fff;
  outline: none;
  cursor: pointer;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
}
.address-select:focus {
  border-color: #ff6b35;
}
.address-select:invalid {
  color: #999;
}
.address-detail-field {
  margin-top: 0;
}
.address-detail-field .auth-field-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: #aaa;
}
.address-detail-field input {
  padding-left: 40px;
}


/* === 通知铃铛 === */
.notif-bell-wrap { position: relative; cursor: pointer; margin-left: 8px; display: none; align-items: center; justify-content: center; background: rgba(255,255,255,0.25); border-radius: 50%; width: 36px; height: 36px; transition: background 0.2s; }
.notif-bell-wrap.show { display: flex !important; align-items: center; justify-content: center; }
.notif-bell { font-size: 22px; line-height: 1; color: #fff; position: relative; display: flex; align-items: center; justify-content: center; }
.notif-bell-count {
  position: absolute; top: -6px; right: -8px;
  background: #ff4d4f; color: #fff; font-size: 10px;
  min-width: 16px; height: 16px; line-height: 16px;
  text-align: center; border-radius: 8px; padding: 0 4px;
  display: none; font-weight: 600;
}
.notif-bell-count.show { display: block; }
/* 通知面板 */
.notif-panel {
  display: none; position: absolute; top: 100%; right: 0; margin-top: 8px;
  width: 320px; max-height: 400px; overflow-y: auto;
  background: #fff; border-radius: 12px; box-shadow: 0 6px 24px rgba(0,0,0,0.15);
  z-index: 200;
}
.notif-panel.open { display: block; }
.notif-panel-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px; border-bottom: 1px solid #f0f0f0; font-size: 14px; font-weight: 600;
}
.notif-panel-header .read-all-btn { font-size: 12px; color: #1677ff; cursor: pointer; background: none; border: none; }
.notif-item {
  padding: 12px 16px; border-bottom: 1px solid #f5f5f5; position: relative;
}
.notif-item.unread { background: #f0f7ff; }
.notif-item:last-child { border-bottom: none; }
.notif-item-title { font-size: 13px; font-weight: 600; color: #333; margin-bottom: 2px; }
.notif-item-msg { font-size: 12px; color: #666; line-height: 1.4; }
.notif-item-time { font-size: 11px; color: #999; margin-top: 4px; }
.notif-item .unread-dot { position: absolute; top: 14px; right: 16px; width: 6px; height: 6px; border-radius: 50%; background: #ff4d4f; }
.notif-empty { padding: 30px 16px; text-align: center; color: #999; font-size: 13px; }
/* Toast通知 */
.notif-toast-wrap {
  position: fixed; top: 80px; right: 16px; z-index: 9999;
  display: flex; flex-direction: column; gap: 8px;
}
.notif-toast {
  background: #fff; border-radius: 10px; box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  padding: 12px 16px; min-width: 260px; max-width: 340px;
  animation: notifSlideIn 0.3s ease; border-left: 3px solid #1677ff;
}
.notif-toast.closing { animation: notifSlideOut 0.3s ease forwards; }
.notif-toast-title { font-size: 13px; font-weight: 600; color: #333; }
.notif-toast-msg { font-size: 12px; color: #666; margin-top: 2px; }
@keyframes notifSlideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes notifSlideOut { from { transform: translateX(0); opacity: 1; } to { transform: translateX(100%); opacity: 0; } }



/* 预售选品入口 - 底部居中浮动按钮 */


/* 骨架屏样式 */
/* 加载状态 */
.loading-state{position:fixed;top:0;left:0;right:0;bottom:0;display:flex;flex-direction:column;align-items:center;justify-content:center;z-index:100;background:rgba(255,255,255,.95);animation:fadeInUp .5s ease}
.loading-dots{display:flex;gap:6px;margin-bottom:16px}
.loading-dots span{width:6px;height:6px;border-radius:50%;background:#bbb;animation:dotBounce 1.4s infinite ease-in-out both}
.loading-dots span:nth-child(1){animation-delay:-.32s}
.loading-dots span:nth-child(2){animation-delay:-.16s}
.loading-dots span:nth-child(3){animation-delay:0s}
.loading-text{font-size:0;color:transparent}
@keyframes dotBounce{0%,80%,100%{transform:scale(0);opacity:.4}40%{transform:scale(1);opacity:1}}

/* ========================================
   UI Improvements v5 (2026-08-24)
   ======================================== */

/* --- Modal overlay fade-in --- */
.modal-overlay.show {
  animation: overlayFadeIn 0.25s ease;
}
@keyframes overlayFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Desktop: center modal instead of bottom sheet */
@media (min-width: 768px) {
  .modal-overlay {
    align-items: center;
    padding: 20px;
  }
  .modal-content {
    border-radius: 16px;
    max-height: 85vh;
    animation: scaleIn 0.25s ease;
  }
  @keyframes scaleIn {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
  }
}

/* --- Cart badge bounce --- */
@keyframes cartBounce {
  0%, 100% { transform: scale(1); }
  30% { transform: scale(1.5); }
  50% { transform: scale(0.85); }
  70% { transform: scale(1.25); }
}
.cart-badge.bounce {
  animation: cartBounce 0.5s ease;
}

/* --- Card hover & spacing (desktop) --- */
@media (hover: hover) {
  .product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
  }
}
.product-list {
  gap: 12px;
}
.product-card {
  border-radius: 12px;
}
.product-info {
  padding: 10px 12px 12px;
}

/* --- Mobile touch target & spacing polish --- */
@media (max-width: 480px) {
  .product-list { gap: 8px; padding: 8px; }
  .checkout-btn { min-height: 40px; }
  .qty-btn { min-width: 32px; min-height: 32px; }
  .register-btn { min-height: 36px; }
  .cat-search-input { min-height: 36px; }
  .hot-tag { min-height: 28px; display: inline-flex; align-items: center; }
}

/* --- Smooth image loading --- */
.product-img {
  transition: opacity 0.3s;
}
