/* ============================================
   店铺管理+产品上传弹窗
   从 style.css 拆分
   ============================================ */

/* ----- Store Management (Warm Orange Theme) ----- */
#page-store-mgmt {
  --store-gray-50: #FAFAF8;
  --store-gray-100: #F4F3F0;
  --store-gray-200: #EBE9E5;
  --store-gray-300: #D7D5D1;
  --store-gray-500: #A8A29E;
  --store-gray-700: #57534E;
  --store-gray-900: #1C1917;
}

/* ===== Store Banner Card ===== */
.store-banner {
  margin: var(--space-3) var(--space-4) 0;
  padding: var(--space-4);
  background: linear-gradient(145deg, #FFFBF7 0%, #FFF7ED 40%, #FFF5F0 100%);
  border-radius: 16px;
  border: 1px solid rgba(249,115,22,.08);
  box-shadow: 0 1px 3px rgba(0,0,0,.03), 0 4px 14px rgba(249,115,22,.05);
  transition: background .4s ease, box-shadow .4s ease;
}
.store-banner-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.store-banner-icon {
  font-size: 32px;
  flex-shrink: 0;
  line-height: 1;
  filter: drop-shadow(0 2px 4px rgba(249,115,22,.15));
}
.store-banner-info {
  flex: 1;
  min-width: 0;
}
.store-banner-name {
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: .01em;
}
.store-banner-settings {
  flex-shrink: 0;
  height: 30px;
  border: 1px solid rgba(0,0,0,.06);
  border-radius: 8px;
  background: rgba(255,255,255,.6);
  color: var(--color-text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 0 8px;
  font-size: var(--text-xs);
  font-weight: 500;
  transition: all .2s ease;
}
.store-banner-settings:hover,
.store-banner-settings.open {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: rgba(249,115,22,.06);
}
.store-banner-settings .gear-chevron {
  transition: transform .25s ease;
}
.store-banner-settings.open .gear-chevron {
  transform: rotate(180deg);
}

/* Status Row */
.store-banner-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: var(--space-3);
}
.store-status-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: var(--text-xs);
  font-weight: 500;
  transition: all .35s ease;
}
.store-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #A8A29E;
  transition: background .35s ease;
}
.store-status-label {
  transition: color .35s ease;
  color: var(--color-text-muted);
}

/* Open state */
.store-banner.open .store-status-badge {
  background: #ECFDF5;
}
.store-banner.open .store-status-dot {
  background: #10B981;
  box-shadow: 0 0 0 3px rgba(16,185,129,.15);
  animation: statusPulse 2s ease-in-out infinite;
}
.store-banner.open .store-status-label {
  color: #059669;
}
@keyframes statusPulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(16,185,129,.15); }
  50%      { box-shadow: 0 0 0 6px rgba(16,185,129,.06); }
}

/* Closed state banner tint */
.store-banner:not(.open) {
  background: linear-gradient(145deg, #FAFAF9 0%, #F6F5F3 40%, #F5F4F1 100%);
  box-shadow: 0 1px 3px rgba(0,0,0,.02), 0 2px 8px rgba(0,0,0,.03);
}

/* Stats */
.store-banner-stats {
  display: flex;
  margin-top: var(--space-4);
  padding-top: var(--space-3);
  border-top: 1px solid rgba(0,0,0,.05);
}
.store-stat {
  flex: 1;
  text-align: center;
  cursor: pointer;
  border-radius: 10px;
  padding: var(--space-2) 0;
  transition: background .15s ease;
}
.store-stat:active {
  background: rgba(249,115,22,.06);
}
.store-stat-num {
  display: block;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.2;
}
.store-stat-desc {
  display: block;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: 2px;
}
.store-stat-divider {
  width: 1px;
  background: rgba(0,0,0,.06);
  margin: var(--space-1) 0;
  flex-shrink: 0;
}

/* iOS-style toggle switch (in banner context) */
.tswitch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 26px;
  flex-shrink: 0;
}
.tswitch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.tswitch-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background: #D7D3CC;
  border-radius: 26px;
  transition: all .3s cubic-bezier(.4,0,.2,1);
}
.tswitch-slider::before {
  content: '';
  position: absolute;
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: all .3s cubic-bezier(.4,0,.2,1);
  box-shadow: 0 1px 4px rgba(0,0,0,.12), 0 1px 2px rgba(0,0,0,.08);
}
.tswitch input:checked + .tswitch-slider {
  background: var(--color-primary);
}
.tswitch input:checked + .tswitch-slider::before {
  transform: translateX(18px);
}
  transform: rotate(180deg);
}

/* ===== Store Settings Panel ===== */
.store-settings-panel {
  border-bottom: 1px solid var(--color-border-light);
  background: var(--color-surface);
  overflow: hidden;
  animation: storeSlideDown .25s var(--ease-out);
}
@keyframes storeSlideDown {
  from { max-height: 0; opacity: 0; }
  to   { max-height: 400px; opacity: 1; }
}
.store-settings-inner {
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.store-field-label {
  display: block;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-1);
  letter-spacing: .02em;
  text-transform: uppercase;
}
.store-field-input,
.store-field-textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--color-border);
  border-radius: 10px;
  font-size: var(--text-sm);
  font-family: var(--font-sans);
  color: var(--color-text);
  background: var(--color-surface);
  outline: none;
  transition: border-color .2s, box-shadow .2s;
  box-sizing: border-box;
}
.store-field-input:focus,
.store-field-textarea:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(249,115,22,.08);
}
.store-field-input::placeholder,
.store-field-textarea::placeholder {
  color: var(--color-text-muted);
}
.store-field-textarea {
  resize: vertical;
  min-height: 56px;
}
.store-field-actions {
  display: flex;
  gap: var(--space-2);
}
.btn-pill {
  flex: 1;
  padding: 9px 0;
  border-radius: 10px;
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all .2s ease;
}
.btn-pill-primary {
  background: var(--color-primary);
  color: #fff;
}
.btn-pill-primary:active {
  background: var(--color-primary-hover);
}
.btn-pill-outline {
  background: transparent;
  color: var(--color-primary);
  border: 1.5px solid var(--color-primary);
}
.btn-pill-outline:active {
  background: var(--color-primary-soft);
}

/* ===== Store Tabs Bar ===== */
.store-tabs-bar {
  display: flex;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border-light);
}
.store-tab-item {
  flex: 1;
  padding: var(--space-3);
  border: none;
  background: transparent;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-muted);
  cursor: pointer;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  transition: color .2s;
}
.store-tab-item.active {
  color: var(--color-primary);
  font-weight: 600;
}
.store-tab-item.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 20%;
  right: 20%;
  height: 2px;
  background: var(--color-primary);
  border-radius: 1px;
}
.store-tab-count {
  font-size: var(--text-xs);
  font-weight: 400;
  opacity: .7;
}
.store-tab-item.active .store-tab-count {
  opacity: 1;
}

/* ===== Store Tab Panel ===== */
.store-tab-panel {
  display: none;
  padding: var(--space-4) var(--space-4) 0;
  background: var(--color-surface);
}
.store-tab-panel.active {
  display: block;
  animation: storeFadeIn .2s var(--ease-out);
}
@keyframes storeFadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Product search */
.store-search-row {
  display: flex;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.store-search-input {
  flex: 1;
  height: 36px;
  padding: 0 var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  font-size: var(--text-sm);
  font-family: var(--font-sans);
  color: var(--color-text);
  background: var(--color-surface);
  outline: none;
  transition: border-color var(--duration-fast);
}
.store-search-input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-soft);
}
.store-search-input::placeholder {
  color: var(--color-text-muted);
}

.store-search-btn {
  flex-shrink: 0;
  height: 36px;
  padding: 0 var(--space-4);
  border: none;
  border-radius: 8px;
  background: var(--color-primary);
  color: #fff;
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
  transition: background var(--duration-fast);
}
.store-search-btn:active {
  background: var(--color-primary-hover);
}

/* Search results & shelf */
.store-result-list,
.store-shelf-list {
  border-top: 1px solid var(--color-border-light);
}

.store-result-item,
.store-shelf-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--color-border-light);
}
.store-result-item:last-child,
.store-shelf-item:last-child {
  border-bottom: none;
}

.store-item-thumb {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--color-primary-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.store-item-info {
  flex: 1;
  min-width: 0;
}
.store-item-name {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.store-item-meta {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: 1px;
}
.store-item-note {
  font-size: var(--text-xs);
  color: var(--color-primary);
  margin-top: 2px;
}

.store-item-actions {
  display: flex;
  gap: var(--space-1);
  flex-shrink: 0;
}
.store-item-actions .btn {
  font-size: var(--text-xs);
  padding: 4px var(--space-3);
  border-radius: 8px;
}

.store-shelf-item.inactive {
  opacity: .4;
}

/* Order filters */
.store-order-filters {
  display: flex;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.store-order-filters::-webkit-scrollbar { display: none; }

.store-filter-chip {
  flex-shrink: 0;
  padding: var(--space-1) var(--space-3);
  border-radius: 8px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
}
.store-filter-chip.active {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}
.store-filter-chip:not(.active):active {
  background: var(--color-surface-hover);
}

/* Order list */
.store-order-list {
  border-top: 1px solid var(--color-border-light);
}

.store-order-item {
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--color-border-light);
}
.store-order-item:last-child {
  border-bottom: none;
}

.store-order-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-2);
}
.store-order-sn {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  font-family: "SF Mono", "Menlo", monospace;
}
.store-order-status {
  font-size: var(--text-xs);
  font-weight: 500;
  padding: 2px var(--space-2);
  border-radius: 4px;
}
.store-order-status.pending   { background: var(--color-warning-bg); color: var(--color-warning); }
.store-order-status.confirmed { background: var(--color-primary-soft); color: var(--color-primary); }
.store-order-status.shipped   { background: #F3E8FF; color: #7C3AED; }
.store-order-status.completed { background: var(--color-success-bg); color: var(--color-success); }
.store-order-status.cancelled { background: var(--color-surface-hover); color: var(--color-text-muted); }

.store-order-tracking {
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
  margin-top: var(--space-1);
}

.store-order-address {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: var(--space-1);
}

.store-order-items {
  font-size: var(--text-sm);
  color: var(--color-text);
  margin-bottom: var(--space-2);
  line-height: 1.5;
}

.store-order-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.store-order-customer {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}
.store-order-amount {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--color-text);
}

.store-order-actions {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-3);
  justify-content: flex-end;
}
.store-order-actions .btn {
  font-size: var(--text-xs);
  border-radius: 8px;
  padding: 4px var(--space-3);
}

/* Empty state */
.store-empty {
  text-align: center;
  padding: var(--space-10) var(--space-4);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

/* ----- Spinner ----- */
.spinner {
  display: flex;
  justify-content: center;
  padding: var(--space-10);
  gap: 6px;
}

.spinner-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-primary);
  animation: dotBounce 1.2s infinite ease-in-out;
}
.spinner-dot:nth-child(2) { animation-delay: .15s; }
.spinner-dot:nth-child(3) { animation-delay: .30s; }

@keyframes dotBounce {
  0%, 80%, 100% { transform: scale(.5); opacity: .3; }
  40% { transform: scale(1); opacity: 1; }
}

/* ----- Toast ----- */
.toast {
  position: fixed;
  bottom: calc(var(--nav-height) + var(--space-6));
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: var(--color-text);
  color: #fff;
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: 600;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: all var(--duration-normal) var(--ease-out);
  box-shadow: var(--shadow-lg);
  max-width: calc(100vw - 48px);
  text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); pointer-events: auto; }

/* ----- Alert Cards ----- */
.alert-card {
  padding: var(--space-4);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-3);
  border: 1px solid;
}

.alert-critical { background: var(--color-danger-bg); border-color: #FECACA; }
.alert-high     { background: var(--color-warning-bg); border-color: #FDE68A; }
.alert-medium   { background: #FFF7ED; border-color: #FED7AA; }

.alert-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-1);
}

.alert-level {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .03em;
}
.alert-critical .alert-level { color: var(--color-danger); }
.alert-high     .alert-level { color: var(--color-warning); }
.alert-medium   .alert-level { color: var(--color-primary); }

.alert-days {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.alert-suggestion {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
}

/* ----- Growth Cards ----- */
.growth-card {
  padding: var(--space-4);
  background: var(--color-surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border-light);
  margin-bottom: var(--space-3);
}

.growth-priority {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: var(--space-1);
}

.growth-title { font-size: var(--text-lg); font-weight: 600; margin-bottom: 2px; }
.growth-desc  { font-size: var(--text-sm); color: var(--color-text-secondary); }

/* ----- Search Bar ----- */
.search-bar {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  background: #F8F7F5;
  border: 1.5px solid transparent;
  border-radius: 14px;
  padding: 0 var(--space-4);
  margin-bottom: var(--space-3);
  transition: all .25s var(--ease-out);
}
.search-bar:focus-within {
  background: var(--color-surface);
  border-color: var(--color-primary);
  box-shadow: 0 0 0 4px rgba(249,115,22,.08);
}

.search-icon {
  font-size: 0.875rem;
  opacity: 0.4;
  flex-shrink: 0;
}

.search-input {
  flex: 1;
  border: none;
  background: transparent;
  padding: var(--space-3) 0;
  font-size: var(--text-sm);
  font-family: var(--font-sans);
  color: var(--color-text);
  outline: none;
  min-width: 0;
}
.search-input::placeholder {
  color: var(--color-text-muted);
}

.search-clear {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: var(--color-surface-hover);
  color: var(--color-text-muted);
  font-size: 0.625rem;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.search-clear:active { background: var(--color-border); }

/* ----- Filter Chips (horizontal scroll) ----- */
.filter-scroll {
  display: flex;
  gap: var(--space-2);
  overflow-x: auto;
  padding-bottom: var(--space-2);
  margin-bottom: var(--space-3);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.filter-scroll::-webkit-scrollbar { display: none; }

/* ===== Filter Chips ===== */
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 14px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: var(--color-surface);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text-secondary);
  cursor: pointer;
  white-space: nowrap;
  transition: all .2s var(--ease-out);
  flex-shrink: 0;
}
.filter-chip:active { transform: scale(.95); }
.filter-chip.active {
  background: #FFF7ED;
  border-color: rgba(249,115,22,.2);
  color: #EA580C;
  box-shadow: 0 1px 3px rgba(249,115,22,.06);
}

.filter-chip-count {
  font-weight: 400;
  opacity: 0.5;
  font-size: 0.5625rem;
}

/* ===== Sort Bar ===== */
.sort-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--color-border-light);
}

.sort-label {
  font-size: var(--text-sm);
  color: var(--color-text);
  font-weight: 600;
}

.sort-select {
  border: none;
  border-radius: 8px;
  padding: 6px 28px 6px 12px;
  font-size: var(--text-xs);
  font-family: var(--font-sans);
  font-weight: 600;
  color: var(--color-text-secondary);
  background: #F4F2EF;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%2378716C' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}
.sort-select:focus { outline: none; }

/* ===== Tab Toggle — Refined Pill ===== */
.tab-toggle {
  display: flex;
  background: #F4F2EF;
  border-radius: 14px;
  padding: 4px;
  margin-bottom: var(--space-5);
  position: relative;
}

.tab-toggle-btn {
  flex: 1;
  padding: var(--space-2) var(--space-4);
  border: none;
  border-radius: 11px;
  background: transparent;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all .25s var(--ease-out);
  position: relative;
  z-index: 1;
  letter-spacing: .01em;
}

.tab-toggle-btn.active {
  background: var(--color-surface);
  color: var(--color-text);
  box-shadow: 0 1px 3px rgba(0,0,0,.06), 0 2px 8px rgba(0,0,0,.04);
}

/* ===== Price Filter ===== */
.price-filter-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.price-input {
  width: 0;
  flex: 1;
  min-width: 60px;
  padding: var(--space-2) var(--space-3);
  border: 1.5px solid transparent;
  border-radius: 10px;
  font-size: var(--text-sm);
  font-family: var(--font-sans);
  color: var(--color-text);
  background: #F8F7F5;
  outline: none;
  -moz-appearance: textfield;
  transition: all .2s var(--ease-out);
}
.price-input:focus {
  background: var(--color-surface);
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(249,115,22,.06);
}
.price-input::-webkit-inner-spin-button,
.price-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
}

.price-separator {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  flex-shrink: 0;
  font-weight: 500;
}

.btn-sm {
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-xs);
  border-radius: var(--radius-sm);
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--color-text-muted);
}
.btn-ghost:active {
  background: var(--color-surface-hover);
}

/* ----- Category Grid (Home) ----- */
.category-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-2);
  margin-bottom: var(--space-6);
}

.category-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: var(--space-3) var(--space-1);
  border-radius: 14px;
  cursor: pointer;
  transition: all .2s var(--ease-out);
  border: none;
}
.category-card:nth-child(4n+1) { background: #FFFBF7; }
.category-card:nth-child(4n+2) { background: #FAFBFF; }
.category-card:nth-child(4n+3) { background: #FAFDFB; }
.category-card:nth-child(4n+4) { background: #FFF5F5; }
.category-card:active {
  transform: scale(.94);
  filter: brightness(.97);
}

.category-card-icon {
  font-size: 1.625rem;
  line-height: 1;
}

.category-card-name {
  font-size: 0.625rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  line-height: 1.2;
}

/* ===== Pagination ===== */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  padding: var(--space-6) 0 var(--space-4);
}

.page-btn {
  padding: var(--space-2) var(--space-4);
  border: none;
  border-radius: 10px;
  background: var(--color-surface);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-primary);
  cursor: pointer;
  transition: all .2s var(--ease-out);
}
.page-btn:active { background: #FFF7ED; transform: scale(.95); }
.page-btn[disabled] {
  color: var(--color-text-muted);
  pointer-events: none;
  opacity: 0.35;
}

.page-info {
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* ----- Product Detail Modal ----- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(0,0,0,.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration-normal) var(--ease-out);
}
.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  width: 100%;
  max-width: var(--content-max);
  max-height: 85vh;
  margin: 0 var(--space-4);
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  position: relative;
  padding: var(--space-5);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: modalIn var(--duration-normal) var(--ease-out);
}

@keyframes modalIn {
  from { transform: translateY(20px) scale(0.96); opacity: 0; }
  to   { transform: translateY(0) scale(1); opacity: 1; }
}


/* ========== Upload Product Modal ========== */

.upload-modal {
  width: 100%;
  max-width: 448px;
  max-height: 92vh;
  margin: auto var(--space-4);
  background: var(--color-surface);
  border-radius: 22px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: uploadModalIn .35s cubic-bezier(.34,1.56,.64,1);
  box-shadow: 0 0 0 1px rgba(0,0,0,.04), 0 8px 32px rgba(0,0,0,.12), 0 20px 64px rgba(249,115,22,.08);
}
@keyframes uploadModalIn {
  from { transform: translateY(32px) scale(.92); opacity: 0; }
  to   { transform: translateY(0) scale(1); opacity: 1; }
}

.upload-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 10;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,.06);
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .2s, color .2s;
  -webkit-tap-highlight-color: transparent;
}
.upload-modal-close:active { background: rgba(0,0,0,.12); color: var(--color-text); }

/* Header */
.upload-header {
  padding: var(--space-6) var(--space-5) var(--space-3);
  text-align: center;
  background: linear-gradient(180deg, #FFFBF7 0%, #FFF8F0 60%, var(--color-surface) 100%);
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}
.upload-header-visual {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  margin-bottom: var(--space-3);
}
.upload-header-blob {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 40%, rgba(249,115,22,.18) 0%, rgba(249,115,22,.04) 70%, transparent 100%);
  animation: uploadBlobPulse 3s ease-in-out infinite;
}
@keyframes uploadBlobPulse {
  0%, 100% { transform: scale(1); opacity: .7; }
  50%      { transform: scale(1.12); opacity: 1; }
}
.upload-header-emoji {
  position: relative;
  z-index: 1;
  font-size: 36px;
  line-height: 1;
  filter: drop-shadow(0 2px 4px rgba(249,115,22,.25));
}
.upload-header-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -.02em;
  color: var(--color-text);
}
.upload-header-desc {
  margin: 4px 0 0;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

/* Body */
.upload-body {
  padding: var(--space-3) var(--space-5) var(--space-6);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1;
  min-height: 0;
}

/* Image Zone */
.upload-zone {
  background: #FBFAF7;
  border: 2px dashed #E8E4DA;
  border-radius: 16px;
  padding: var(--space-4);
  margin-bottom: var(--space-4);
  transition: border-color .25s;
}
.upload-zone:has(.upload-previews:not(:empty)) {
  border-style: solid;
  border-color: #E8E4DA;
}
.upload-zone-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-3);
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-text);
}
.upload-zone-hint {
  font-weight: 500;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  background: rgba(0,0,0,.04);
  padding: 2px 8px;
  border-radius: 100px;
}
.upload-zone-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

/* Preview images */
.upload-previews {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.upload-previews:empty { display: none; }
.upload-preview-item {
  position: relative;
  width: 88px;
  height: 88px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
  animation: previewIn .3s cubic-bezier(.34,1.56,.64,1);
}
@keyframes previewIn {
  from { transform: scale(.6); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}
.upload-preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.upload-preview-del {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,.45);
  backdrop-filter: blur(4px);
  color: #fff;
  font-size: 12px;
  line-height: 22px;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s;
  -webkit-tap-highlight-color: transparent;
}
.upload-preview-del:active { background: rgba(0,0,0,.7); }

/* Upload buttons */
.upload-zone-actions {
  display: flex;
  gap: var(--space-2);
}
.upload-zone-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: var(--space-3);
  border-radius: 12px;
  cursor: pointer;
  font-size: var(--text-sm);
  font-weight: 600;
  transition: all .2s;
  -webkit-tap-highlight-color: transparent;
  color: var(--color-text-secondary);
  background: var(--color-surface);
  border: 1.5px solid #E8E4DA;
}
.upload-zone-btn input[type="file"] { display: none; }
.upload-zone-btn:active {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: #FFF7ED;
}
.upload-zone-btn--camera { color: #F97316; border-color: rgba(249,115,22,.25); background: #FFFBF7; }
.upload-zone-btn--album  { color: #8B5CF6; border-color: rgba(139,92,246,.25); background: #FBFAFE; }

/* Section */
.upload-section {
  margin-bottom: var(--space-4);
}
.upload-section-chip {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--color-primary);
  margin-bottom: var(--space-3);
  padding: 3px 10px;
  border-radius: 100px;
  background: linear-gradient(135deg, #FFF7ED, #FFF0E0);
}

/* Fields */
.upload-field {
  margin-bottom: var(--space-3);
}
.upload-field-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text-secondary);
  margin-bottom: 4px;
}
.upload-required { color: var(--color-primary); }
.upload-field-unit { color: var(--color-text-muted); font-weight: 400; }
.upload-field-optional { color: var(--color-text-muted); font-weight: 400; font-size: var(--text-xs); }

/* Rows */
.upload-row {
  display: flex;
  gap: var(--space-3);
}
.upload-field--half { flex: 1; }
.upload-field--third { flex: 1; }

/* Promotion hint */
.upload-promo-hint {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  padding: var(--space-3) 0;
  background: linear-gradient(135deg, #FFFBEB, #FFF7ED);
  border-radius: 12px;
  margin-bottom: var(--space-4);
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  border: 1px solid rgba(249,115,22,.1);
}
.upload-promo-icon { font-size: 16px; line-height: 1; flex-shrink: 0; margin-top: 1px; }
.upload-promo-link { color: var(--color-primary); font-weight: 700; text-decoration: none; }

/* Submit */
.upload-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(135deg, #F97316 0%, #EA580C 100%);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: .02em;
  cursor: pointer;
  transition: all .2s;
  box-shadow: 0 4px 16px rgba(249,115,22,.3), 0 1px 4px rgba(249,115,22,.15);
  -webkit-tap-highlight-color: transparent;
}
.upload-submit:active {
  transform: scale(.98);
  box-shadow: 0 2px 8px rgba(249,115,22,.25);
}
.upload-submit:disabled {
  opacity: .6;
  pointer-events: none;
}
.upload-submit-icon { font-size: 18px; line-height: 1; }

.modal-close {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--color-surface);
  color: var(--color-text-secondary);
  font-size: 1rem;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
}
.modal-close:active { background: var(--color-surface-hover); }

.modal-scroll {
  overflow-y: auto;
  padding-top: var(--space-4);
  -webkit-overflow-scrolling: touch;
}

/* Detail content */
.detail-emoji {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-lg);
  background: var(--color-primary-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin-bottom: var(--space-3);
}

.detail-name {
  font-size: var(--text-xl);
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: var(--space-2);
}

.detail-brand {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-3);
}

.detail-pricing {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  margin-bottom: var(--space-5);
  border: 1px solid var(--color-border-light);
}

.detail-price-row {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.detail-price-now {
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--color-primary);
}

.detail-price-cost {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  text-decoration: line-through;
}

.detail-margin {
  font-size: var(--text-xs);
  color: var(--color-success);
  font-weight: 600;
  background: var(--color-success-bg);
  padding: 2px var(--space-2);
  border-radius: var(--radius-sm);
  margin-left: auto;
}

.detail-section {
  margin-bottom: var(--space-5);
}

.detail-section h4 {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-2);
  letter-spacing: .02em;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2);
}

.detail-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-2) var(--space-3);
  background: var(--color-surface);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  border: 1px solid var(--color-border-light);
}

.detail-label {
  color: var(--color-text-muted);
  font-size: var(--text-xs);
}

.detail-desc {
  font-size: var(--text-sm);
  line-height: 1.7;
  color: var(--color-text-secondary);
}

.detail-spec {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: var(--color-surface);
  border-radius: var(--radius-sm);
}

.detail-tags {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.detail-actions {
  padding: var(--space-6) 0 var(--space-4);
}

