* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --primary: #4F46E5;
  --primary-light: #EEF2FF;
  --orange: #F59E0B;
  --green: #10B981;
  --blue: #3B82F6;
  --red: #EF4444;
  --purple: #8B5CF6;
  --gray-50: #F9FAFB;
  --gray-100: #F3F4F6;
  --gray-200: #E5E7EB;
  --gray-300: #D1D5DB;
  --gray-500: #6B7280;
  --gray-700: #374151;
  --gray-900: #111827;
  --sidebar-w: 220px;
  --header-h: 60px;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,.1);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', sans-serif;
  background: var(--gray-50);
  color: var(--gray-900);
  line-height: 1.5;
}

.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  background: var(--gray-900);
  color: #fff;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
}

.logo {
  height: var(--header-h);
  display: flex;
  align-items: center;
  padding: 0 20px;
  border-bottom: 1px solid rgba(255,255,255,.1);
  gap: 10px;
}
.logo-icon { font-size: 24px; }
.logo-text { font-size: 18px; font-weight: 600; }

.nav { padding: 12px 0; flex: 1; }
.nav-item {
  display: flex;
  align-items: center;
  padding: 12px 20px;
  color: var(--gray-300);
  cursor: pointer;
  transition: all .2s;
  gap: 10px;
  text-decoration: none;
  font-size: 14px;
}
.nav-item:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav-item.active { background: var(--primary); color: #fff; border-radius: 0; }

.main {
  flex: 1;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
}

.header {
  height: var(--header-h);
  background: #fff;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 50;
}
.page-title { font-size: 18px; font-weight: 600; }
.time { color: var(--gray-500); font-size: 14px; }

.page { padding: 24px; }
.hidden { display: none !important; }

.dashboard-toolbar {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.dashboard-date-picker {
  display: flex;
  align-items: center;
  gap: 8px;
}
.dashboard-date-label {
  font-size: 13px;
  color: var(--gray-600);
  white-space: nowrap;
}
.dashboard-period {
  font-size: 13px;
  color: var(--gray-500);
  margin-left: auto;
}
#dashboardDate { width: 150px; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}
.stat-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--primary);
}
.stat-card.orange { border-left-color: var(--orange); }
.stat-card.blue { border-left-color: var(--blue); }
.stat-card.green { border-left-color: var(--green); }
.stat-card.purple { border-left-color: var(--purple); }
.stat-card.red { border-left-color: var(--red); }
.stat-value { font-size: 28px; font-weight: 700; color: var(--gray-900); }
.stat-label { font-size: 14px; color: var(--gray-500); margin-top: 4px; }

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}
.toolbar-left { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.toolbar-right { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.page-size-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--gray-600);
  white-space: nowrap;
}
.page-size-label .select { width: 72px; }
.pagination-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
  flex-wrap: wrap;
  gap: 12px;
}
.pagination-info {
  font-size: 13px;
  color: var(--gray-500);
}
.pagination-bar .pagination { margin-top: 0; }

.input {
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--gray-300);
  border-radius: 6px;
  font-size: 14px;
  outline: none;
  transition: border-color .2s;
  background: #fff;
}
.input:focus { border-color: var(--primary); }
.input.full { width: 100%; }
.select { min-width: 120px; }

.btn {
  height: 36px;
  padding: 0 16px;
  border: 1px solid var(--gray-300);
  border-radius: 6px;
  background: #fff;
  font-size: 14px;
  cursor: pointer;
  transition: all .2s;
  white-space: nowrap;
}
.btn:hover { background: var(--gray-50); }
.btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.btn-primary:hover { opacity: .9; }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12px; }
.btn-danger { color: var(--red); border-color: var(--red); }
.btn-danger:hover { background: #FEF2F2; }
.btn-warning { color: #D97706; border-color: #D97706; }
.btn-warning:hover { background: #FFFBEB; }
.btn-success { color: var(--green); border-color: var(--green); }
.btn-success:hover { background: #F0FDF4; }
.btn-blue { color: var(--blue); border-color: var(--blue); }
.btn-blue:hover { background: #EFF6FF; }
.btn-pin { color: var(--primary); border-color: var(--primary); }
.btn-pin:hover { background: var(--primary-light); }

.table-wrap {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow-x: auto;
}
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  text-align: left;
  padding: 12px 16px;
  background: var(--gray-50);
  color: var(--gray-500);
  font-weight: 500;
  border-bottom: 1px solid var(--gray-200);
  white-space: nowrap;
}
.table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--gray-100);
  vertical-align: middle;
}
.table tr:hover td { background: var(--gray-50); }

.table .thumb {
  width: 50px;
  height: 50px;
  object-fit: cover;
  border-radius: 6px;
  background: var(--gray-100);
  content-visibility: auto;
  contain-intrinsic-size: 50px 50px;
}
.table .actions { display: flex; gap: 6px; }

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 500;
}
.badge-pending { background: #FEF3C7; color: #92400E; }
.badge-paid { background: #FEE2E2; color: #991B1B; }
.badge-shipped { background: #DBEAFE; color: #1E40AF; }
.badge-completed { background: #D1FAE5; color: #065F46; }
.badge-cancelled { background: var(--gray-100); color: var(--gray-500); }
.badge-refunding { background: #FEF3C7; color: #92400E; }
.badge-refunded { background: #FDE68A; color: #78350F; }

.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
}
.pagination button {
  width: 32px; height: 32px;
  border: 1px solid var(--gray-300);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  font-size: 13px;
}
.pagination button.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.pagination button:disabled { opacity: .4; cursor: not-allowed; }

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}
.modal {
  background: #fff;
  border-radius: 12px;
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,.2);
}
.modal-sm { max-width: 440px; }
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--gray-200);
}
.modal-header h3 { font-size: 16px; }
.modal-close {
  width: 32px; height: 32px;
  border: none; background: none;
  font-size: 20px; cursor: pointer;
  border-radius: 6px;
  color: var(--gray-500);
}
.modal-close:hover { background: var(--gray-100); }
.modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 16px 20px;
  border-top: 1px solid var(--gray-200);
}

.radio-group {
  display: flex;
  gap: 20px;
  align-items: center;
}
.radio-option {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--gray-700);
  cursor: pointer;
}
.radio-option input[type="radio"] {
  accent-color: var(--primary);
  width: 16px;
  height: 16px;
}
.input-addon-group {
  display: flex;
  align-items: stretch;
  max-width: 320px;
}
.input-addon-group .input-addon {
  display: flex;
  align-items: center;
  padding: 0 12px;
  background: var(--gray-100);
  border: 1px solid var(--gray-300);
  font-size: 13px;
  color: var(--gray-600);
  white-space: nowrap;
}
.input-addon-group .input-addon:first-child {
  border-right: none;
  border-radius: 6px 0 0 6px;
}
.input-addon-group .input-addon:last-child {
  border-left: none;
  border-radius: 0 6px 6px 0;
}
.input-addon-group .input {
  flex: 1;
  border-radius: 0;
  text-align: center;
}

.shipping-template-modal { max-width: 720px; }
.shipping-rules-container { display: flex; flex-direction: column; gap: 12px; }
.shipping-rule-card {
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 14px;
  background: #fafafa;
}
.shipping-rule-card .rule-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.shipping-rule-card .rule-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-700);
}
.shipping-rule-grid {
  display: grid;
  grid-template-columns: 1fr repeat(4, minmax(72px, 1fr));
  gap: 8px;
  align-items: end;
}
.shipping-rule-grid .rule-field label {
  display: block;
  font-size: 12px;
  color: var(--gray-500);
  margin-bottom: 4px;
}
.shipping-rule-grid .rule-field .input { width: 100%; }
.region-picker-btn {
  width: 100%;
  text-align: left;
  min-height: 36px;
  padding: 8px 12px;
  border: 1px solid var(--gray-300);
  border-radius: 6px;
  background: #fff;
  font-size: 13px;
  color: var(--gray-700);
  cursor: pointer;
}
.region-picker-btn.placeholder { color: var(--gray-400); }
.region-picker-btn:hover { border-color: var(--primary); }
.btn-link-add {
  margin-top: 8px;
  border: none;
  background: none;
  color: var(--primary);
  font-size: 13px;
  cursor: pointer;
  padding: 0;
}
.btn-link-add:hover { text-decoration: underline; }
.btn-text-danger {
  border: none;
  background: none;
  color: var(--red);
  font-size: 12px;
  cursor: pointer;
}
.region-picker-toolbar {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.region-picker-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  max-height: 320px;
  overflow-y: auto;
}
.region-picker-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--gray-700);
  cursor: pointer;
  padding: 4px 2px;
}
.region-picker-item input { accent-color: var(--primary); }
.shipping-template-preview {
  margin-top: 8px;
  padding: 10px 12px;
  background: var(--gray-50, #f9fafb);
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  font-size: 12px;
  color: var(--gray-600);
  line-height: 1.6;
}
.shipping-template-preview strong { color: var(--gray-800); }

.form-row { margin-bottom: 16px; }
.form-row label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-700);
  margin-bottom: 6px;
}
.form-row .required { color: var(--red); }
.form-text { font-size: 14px; color: var(--gray-700); padding: 6px 0; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.four-col { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 900px) {
  .four-col { grid-template-columns: repeat(2, 1fr); }
}

.upload-area { }
.upload-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 14px;
  border: 1px dashed var(--gray-300);
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  color: var(--gray-500);
  transition: all .2s;
}
.upload-btn:hover { border-color: var(--primary); color: var(--primary); }
.upload-btn input[type=file] { display: none; }

.upload-preview {
  margin-bottom: 8px;
}
.upload-preview img {
  width: 100px; height: 100px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--gray-200);
}
.upload-previews {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}
.upload-previews .preview-item {
  position: relative;
}
.upload-previews img {
  width: 80px; height: 80px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--gray-200);
}
.upload-previews .remove-img {
  position: absolute;
  top: -6px; right: -6px;
  width: 18px; height: 18px;
  background: var(--red);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 11px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.preview-item-uploading {
  position: relative;
}
.preview-uploading-img {
  opacity: 0.55;
}
.preview-uploading-mask {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.45);
  border-radius: 6px;
}
.preview-uploading-mask .spinner {
  width: 18px; height: 18px;
  border: 2px solid var(--gray-300);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
.upload-preview .preview-item-uploading img {
  width: 100px; height: 100px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--gray-200);
}

.order-detail-section {
  margin-bottom: 20px;
}
.order-detail-section h4 {
  font-size: 14px;
  color: var(--gray-500);
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--gray-100);
}
.detail-row {
  display: flex;
  padding: 6px 0;
  font-size: 14px;
}
.detail-label {
  width: 80px;
  color: var(--gray-500);
  flex-shrink: 0;
}
.detail-value { color: var(--gray-900); }

.order-items-list { }
.order-item-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--gray-100);
}
.order-item-row img {
  width: 50px; height: 50px;
  object-fit: cover;
  border-radius: 6px;
}
.order-item-info { flex: 1; }
.order-item-title { font-size: 14px; }
.order-item-meta { font-size: 12px; color: var(--gray-500); }

/* Order shipping info cell */
.order-shipping-info {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.order-shipping-text {
  flex: 1;
  min-width: 0;
}
.order-shipping-name {
  font-size: 13px;
  line-height: 1.4;
  word-break: break-all;
}
.order-shipping-addr {
  font-size: 12px;
  color: var(--gray-500);
  line-height: 1.5;
  margin-top: 2px;
  word-break: break-all;
}
.order-detail-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.order-detail-section-head h4 {
  margin-bottom: 0;
}

/* Order list inline product images */
.order-items-preview {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.order-item-inline {
  display: flex;
  align-items: center;
  gap: 10px;
}
.order-item-inline img {
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--gray-200);
  flex-shrink: 0;
  content-visibility: auto;
}
.order-item-inline-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.order-item-inline-title {
  font-size: 13px;
  color: var(--gray-700);
  font-weight: 500;
  word-break: break-all;
  line-height: 1.4;
}
.order-item-inline-qty {
  font-size: 12px;
  color: var(--gray-500);
  white-space: nowrap;
}

/* Order actions two rows */
.actions-two-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.actions-row {
  display: flex;
  gap: 4px;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--gray-500);
}
.empty-state .empty-icon { font-size: 48px; margin-bottom: 12px; }

.toast {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 12px 20px;
  border-radius: 8px;
  background: var(--gray-900);
  color: #fff;
  font-size: 14px;
  z-index: 2000;
  animation: slideIn .3s ease;
  box-shadow: 0 10px 30px rgba(0,0,0,.2);
}
.toast.success { background: var(--green); }
.toast.error { background: var(--red); }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.video-mode-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 12px;
  border: 1px solid var(--gray-300);
  border-radius: 6px;
  overflow: hidden;
  width: fit-content;
}
.tab-btn {
  padding: 6px 16px;
  border: none;
  background: #fff;
  font-size: 13px;
  cursor: pointer;
  color: var(--gray-500);
  transition: all .2s;
}
.tab-btn:not(:last-child) { border-right: 1px solid var(--gray-300); }
.tab-btn.active {
  background: var(--primary);
  color: #fff;
}
.tab-btn:hover:not(.active) { background: var(--gray-50); }

.video-preview { margin-bottom: 8px; }
.video-preview video {
  max-width: 320px;
  max-height: 200px;
  border-radius: 6px;
  border: 1px solid var(--gray-200);
  background: #000;
}

.upload-hint {
  font-size: 12px;
  color: var(--gray-500);
  margin-top: 6px;
}

.url-input-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.url-input-row .input { flex: 1; }

.video-uploading {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px;
  background: var(--gray-50);
  border-radius: 6px;
  font-size: 13px;
  color: var(--gray-700);
}
.video-uploading .spinner {
  width: 18px; height: 18px;
  border: 2px solid var(--gray-300);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ========== Template card list ========== */
.showcase-card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 16px;
  overflow: hidden;
}
.showcase-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--gray-100);
}
.showcase-card-header h4 {
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.showcase-card-header .sc-meta {
  font-size: 12px;
  color: var(--gray-500);
  font-weight: 400;
}
.showcase-card-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}
.showcase-card-body {
  padding: 16px 20px;
}

.sc-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--gray-500);
  font-size: 14px;
}

.es-item {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 14px 16px;
  cursor: grab;
  transition: all .2s;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.es-item:hover { box-shadow: 0 2px 8px rgba(0,0,0,.08); border-color: var(--primary); }
.es-item.dragging { opacity: .4; }
.es-drag { color: var(--gray-300); font-size: 18px; cursor: grab; padding-top: 2px; user-select: none; }
.es-body { flex: 1; min-width: 0; }
.es-header { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.es-type-badge {
  font-size: 11px; padding: 2px 8px;
  background: var(--primary-light); color: var(--primary);
  border-radius: 4px; font-weight: 600;
  white-space: nowrap;
}
.es-title { font-size: 14px; font-weight: 500; color: var(--gray-700); }
.es-summary {
  font-size: 12px; color: var(--gray-500); line-height: 1.5;
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
}
.es-summary-img {
  width: 36px; height: 36px;
  border-radius: 4px; border: 1px solid var(--gray-200);
  object-fit: cover; vertical-align: middle;
}
.es-summary-tag {
  background: var(--gray-100); padding: 1px 6px; border-radius: 3px;
  font-size: 11px; color: var(--gray-700);
}
.es-actions { display: flex; gap: 4px; flex-shrink: 0; padding-top: 2px; }

.es-add-btn {
  display: flex; align-items: center; justify-content: center;
  padding: 14px; border: 2px dashed var(--gray-300);
  border-radius: var(--radius); color: var(--gray-500);
  cursor: pointer; font-size: 14px; font-weight: 500;
  transition: all .2s; margin-top: 4px;
}
.es-add-btn:hover {
  border-color: var(--primary); color: var(--primary); background: var(--primary-light);
}

/* ========== Phone Preview ========== */
.phone-preview-wrap { text-align: center; }
.phone-frame {
  width: 320px;
  height: 580px;
  border: 3px solid var(--gray-900);
  border-radius: 32px;
  overflow: hidden;
  background: #FFF9E6;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 30px rgba(0,0,0,.15);
  position: relative;
}
.phone-notch {
  width: 120px; height: 24px;
  background: var(--gray-900);
  border-radius: 0 0 14px 14px;
  margin: 0 auto;
  position: relative; z-index: 2;
}
.phone-header {
  background: #FF6B35;
  padding: 6px 16px 10px;
  text-align: center;
  margin-top: -2px;
}
.phone-header-title {
  color: #fff; font-size: 14px; font-weight: 600;
}
.phone-screen {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}
.phone-screen::-webkit-scrollbar { width: 0; }
.phone-empty {
  display: flex; align-items: center; justify-content: center;
  height: 100%; color: var(--gray-500); font-size: 13px;
}
.preview-hint {
  font-size: 12px; color: var(--gray-500); margin-top: 10px;
}

/* ========== Product Picker ========== */
.picker-list { max-height: 400px; overflow-y: auto; }
.picker-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px; border-bottom: 1px solid var(--gray-100);
  cursor: pointer; transition: background .2s;
}
.picker-item:hover { background: var(--primary-light); }
.picker-item img {
  width: 44px; height: 44px;
  border-radius: 6px; object-fit: cover; background: var(--gray-100);
}
.picker-item-info { flex: 1; min-width: 0; }
.picker-item-title { font-size: 13px; color: var(--gray-900); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.picker-item-meta { font-size: 12px; color: var(--gray-500); }
.picker-item-price { color: var(--red); font-weight: 600; font-size: 14px; white-space: nowrap; }
.picker-item-id { font-size: 11px; color: var(--gray-500); background: var(--gray-100); padding: 1px 6px; border-radius: 3px; }

/* Inline image preview for config forms */
.cfg-img-preview {
  display: inline-block; margin-top: 6px;
}
.cfg-img-preview img {
  width: 60px; height: 60px; object-fit: cover;
  border-radius: 4px; border: 1px solid var(--gray-200);
}

/* ========== Reviews ========== */
.review-stats-card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
}
.review-stats-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 12px;
}
.review-stats-card-header h4 {
  margin: 0 0 4px;
  font-size: 15px;
  color: var(--gray-800);
}
.review-stats-hint {
  margin: 0;
  font-size: 12px;
  color: var(--gray-500);
}
.review-stats-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--gray-700);
  white-space: nowrap;
  cursor: pointer;
}
.review-stats-form.disabled {
  opacity: 0.55;
  pointer-events: none;
}
.review-stats-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}
.field-hint {
  font-size: 11px;
  color: var(--gray-500);
  margin-top: 4px;
}
.review-stars { color: #FFB800; font-size: 14px; letter-spacing: 1px; }
.review-thumb {
  width: 36px; height: 36px; object-fit: cover;
  border-radius: 4px; border: 1px solid var(--gray-200);
  margin-right: 2px; vertical-align: middle;
  content-visibility: auto;
  contain-intrinsic-size: 36px 36px;
}
.review-media { display: flex; align-items: center; gap: 2px; flex-wrap: nowrap; }
.review-more {
  font-size: 11px; color: var(--gray-500); background: var(--gray-100);
  border-radius: 4px; padding: 2px 6px; white-space: nowrap;
}
.review-video-tag {
  display: inline-block; font-size: 11px; color: #fff; background: var(--primary);
  border-radius: 3px; padding: 1px 6px; margin-left: 4px; white-space: nowrap;
}

.star-select { display: flex; gap: 4px; align-items: center; padding-top: 8px; }
.star-item {
  font-size: 24px; color: var(--gray-300); cursor: pointer;
  transition: color 0.15s; user-select: none;
}
.star-item.active { color: #FFB800; }
.star-item:hover { color: #FFC940; }

.review-spec-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 36px;
}
.review-spec-option {
  padding: 8px 14px;
  border: 1px solid var(--gray-300);
  border-radius: 6px;
  background: #fafafa;
  color: var(--gray-800);
  font-size: 13px;
  line-height: 1.4;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.review-spec-option:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.review-spec-option.selected {
  border-color: var(--primary);
  background: #fff3e8;
  color: var(--primary);
  font-weight: 600;
}
.review-spec-empty {
  font-size: 13px;
  color: var(--gray-500);
}

@media (max-width: 768px) {
  .sidebar { width: 60px; }
  .logo-text, .nav-item span:not(.nav-icon) { display: none; }
  .main { margin-left: 60px; }
  .nav-item { justify-content: center; padding: 14px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .hp-editor-layout {
    flex-direction: column;
  }
}

/* ========== SKU/规格管理 ========== */
.sku-toolbar {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}
.sku-list {
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  overflow: hidden;
}
.sku-empty {
  padding: 20px;
  text-align: center;
  color: var(--gray-500);
  font-size: 13px;
}
.sku-table-header,
.sku-item-edit {
  display: grid;
  grid-template-columns: minmax(80px, 1fr) 60px 88px 88px 80px 44px 60px;
  gap: 6px;
  align-items: center;
  padding: 10px 12px;
}
.sku-default-cell {
  display: flex;
  align-items: center;
  justify-content: center;
}
.sku-default-cell input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
}
.sku-table-header {
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200);
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-600);
}
.sku-item-edit {
  border-bottom: 1px solid var(--gray-100);
  transition: background 0.15s;
}
.sku-item-edit:last-child {
  border-bottom: none;
}
.sku-item-edit:hover {
  background: var(--gray-50);
}
.sku-input-spec {
  min-width: 0;
}
.sku-input-font-size,
.sku-input-price,
.sku-input-original-price,
.sku-input-stock {
  min-width: 0;
}

/* Product sorting & top */
#productList tr[draggable="true"] {
  transition: background 0.15s, box-shadow 0.15s;
}
#productList tr.dragging {
  opacity: 0.5;
  background: var(--gray-100);
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
#productList tr.product-row-top {
  background: var(--primary-light);
  box-shadow: inset 3px 0 0 rgba(79, 70, 229, 0.28);
}
#productList tr.product-row-top:hover {
  background: #E0E7FF;
}
.drag-handle:hover {
  color: var(--primary) !important;
}
.sort-order-input:focus {
  outline: none;
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 2px rgba(255, 107, 53, 0.15);
}
.product-sort-hint {
  display: flex;
  align-items: center;
  gap: 8px;
}
.btn-warning {
  background: #F59E0B;
  color: #fff;
  border: none;
}
.btn-warning:hover {
  background: #D97706;
}

/* ========== User Center / Distribution ========== */
.uc-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--gray-200);
  margin-bottom: 20px;
}
.uc-tab {
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 500;
  border: none;
  background: none;
  color: var(--gray-500);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all .2s;
}
.uc-tab:hover { color: var(--primary); }
.uc-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.uc-panel { }

.uc-desc-card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 24px;
  margin-top: 20px;
}
.uc-desc-card h4 {
  font-size: 15px;
  margin-bottom: 12px;
  color: var(--gray-700);
}
.uc-desc-card ul {
  padding-left: 20px;
  list-style: disc;
}
.uc-desc-card li {
  font-size: 14px;
  color: var(--gray-500);
  line-height: 2;
}
.uc-desc-card li strong {
  color: var(--primary);
}

.uc-summary-row {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 20px;
}
.uc-storage-card,
.uc-points-card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  flex: 1 1 280px;
  max-width: 600px;
  min-width: 280px;
}
.uc-points-hint {
  font-size: 13px;
  color: var(--gray-500);
}
.uc-points-value-wrap {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 8px 0 4px;
}
.uc-points-value {
  font-size: 36px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--primary);
}
.uc-points-unit {
  font-size: 14px;
  color: var(--gray-500);
}
.uc-points-expire {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--gray-600);
}
.uc-invite-field {
  margin-top: 16px;
}
.uc-invite-field label {
  display: block;
  font-size: 13px;
  color: var(--gray-600);
  margin-bottom: 8px;
}
.uc-invite-copy-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.uc-invite-copy-row .input {
  flex: 1;
}
.uc-invite-hint {
  margin: 12px 0 0;
  font-size: 13px;
  color: var(--gray-500);
  text-align: center;
}

/* 我的邀请：客服微信 + 定制广告并排 */
.uc-invitation-contact-card {
  max-width: 720px;
}
.uc-invitation-contact-row {
  display: flex;
  gap: 20px;
  align-items: stretch;
}
.uc-invitation-wechat-col {
  flex: 0 0 240px;
}
.uc-invitation-wechat-col .wechat-image-preview {
  width: 100%;
}
.uc-custom-dev-ad {
  flex: 1;
  min-width: 0;
  position: relative;
  padding: 20px 18px 18px;
  border-radius: var(--radius);
  background: linear-gradient(145deg, #EEF2FF 0%, #F5F3FF 48%, #FFF7ED 100%);
  border: 1px solid #C7D2FE;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.uc-custom-dev-ad::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: var(--radius) var(--radius) 0 0;
  background: linear-gradient(90deg, var(--primary), var(--purple), var(--orange));
}
.uc-custom-dev-ad-badge {
  display: inline-flex;
  align-self: flex-start;
  align-items: center;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--primary);
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid #C7D2FE;
  border-radius: 999px;
  margin-bottom: 12px;
}
.uc-custom-dev-ad-title {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--gray-900);
}
.uc-custom-dev-ad-desc {
  margin: 0 0 14px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--gray-600);
}
.uc-custom-dev-ad-tags {
  list-style: none;
  margin: 0 0 14px;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.uc-custom-dev-ad-tags li {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-700);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(199, 210, 254, 0.6);
  border-radius: 6px;
}
.uc-custom-dev-ad-icon {
  font-size: 15px;
  line-height: 1;
}
.uc-custom-dev-ad-cta {
  margin: 0;
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.5;
  color: #4338CA;
  text-align: center;
  background: rgba(255, 255, 255, 0.9);
  border: 1px dashed #A5B4FC;
  border-radius: 6px;
}
@media (max-width: 680px) {
  .uc-invitation-contact-row {
    flex-direction: column;
    align-items: center;
  }
  .uc-invitation-wechat-col {
    flex: none;
    width: 100%;
    max-width: 240px;
  }
  .uc-custom-dev-ad {
    width: 100%;
  }
}
.uc-storage-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.uc-storage-header h4 {
  font-size: 16px;
  margin: 0;
  color: var(--gray-900);
}
.uc-storage-remaining {
  font-size: 13px;
  color: var(--gray-500);
}
.uc-storage-bar-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}
.uc-storage-bar-bg {
  flex: 1;
  height: 10px;
  background: var(--gray-100);
  border-radius: 5px;
  overflow: hidden;
}
.uc-storage-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #FF8C42, #FF4D00);
  border-radius: 5px;
  transition: width 0.3s ease;
}
.uc-storage-bar-fill.warning {
  background: linear-gradient(90deg, #FFB020, #FF8C00);
}
.uc-storage-bar-fill.full {
  background: linear-gradient(90deg, #FF6B6B, #EE4444);
}
.uc-storage-percent {
  font-size: 13px;
  color: var(--gray-600);
  min-width: 42px;
  text-align: right;
}
.uc-storage-detail {
  margin: 12px 0 0;
  font-size: 13px;
  color: var(--gray-500);
}
.uc-storage-card.warning {
  border: 1px solid #FFD591;
  background: #FFFBF0;
}
.uc-storage-warning {
  margin: 12px 0 0;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.5;
  color: #D46B08;
  background: #FFF7E6;
  border: 1px solid #FFD591;
  border-radius: 6px;
}

.uc-settings-card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  max-width: 600px;
}
.uc-settings-card h4 {
  font-size: 16px;
  margin-bottom: 8px;
  color: var(--gray-900);
}
.uc-settings-desc {
  font-size: 13px;
  color: var(--gray-500);
  margin-bottom: 16px;
}

.uc-audit-prep-card {
  max-width: 520px;
}
.uc-audit-prep-list {
  margin: 0 0 16px 20px;
  font-size: 14px;
  color: var(--gray-700);
  line-height: 1.8;
}
.uc-audit-prep-list strong {
  color: var(--gray-900);
}
.uc-audit-prep-warning {
  font-size: 13px;
  color: #D97706;
  background: #FFFBEB;
  border: 1px solid #FDE68A;
  border-radius: 6px;
  padding: 10px 12px;
  margin-bottom: 16px;
}
.uc-audit-prep-alert {
  font-size: 14px;
  font-weight: 600;
  color: #DC2626;
  background: #FEF2F2;
  border: 2px solid #FCA5A5;
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 16px;
  line-height: 1.6;
}

.wechat-image-preview {
  width: 240px;
  min-height: 240px;
  border: 2px dashed var(--gray-300);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--gray-50);
}
.wechat-image-preview img {
  width: 100%;
  height: auto;
  display: block;
}
.wechat-image-empty {
  color: var(--gray-500);
  font-size: 13px;
  text-align: center;
  padding: 20px;
}

.user-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}
.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--gray-100);
}
.user-avatar-placeholder {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

/* ========== Display Settings ========== */
.img-size-selector {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.img-size-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border: 2px solid var(--gray-200);
  border-radius: 8px;
  cursor: pointer;
  transition: all .2s;
}
.img-size-option:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}
.img-size-option:has(input:checked) {
  border-color: var(--primary);
  background: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}
.img-size-option input[type="radio"] {
  display: none;
}
.img-size-option span {
  font-size: 12px;
  color: var(--gray-700);
  font-weight: 500;
}
.img-size-demo {
  background: var(--gray-200);
  border-radius: 4px;
  border: 1px dashed var(--gray-400);
}
.img-size-preview-box {
  background: var(--gray-100);
  border: 2px dashed var(--primary);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-500);
  font-size: 12px;
  margin-top: 8px;
  transition: all .3s ease;
}

/* 合并发货 */
.merge-hint {
  background: #fffbeb;
  border: 1px solid #fbbf24;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 10px;
  font-size: 14px;
  color: #92400e;
}
.merge-order-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 10px;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  margin-bottom: 6px;
  cursor: pointer;
  transition: background .15s;
}
.merge-order-item:hover {
  background: var(--gray-100);
}
.merge-order-item input[type="checkbox"] {
  margin-top: 3px;
  flex-shrink: 0;
}
.merge-order-info {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  font-size: 13px;
}
.merge-order-no {
  font-family: monospace;
  color: var(--gray-700);
}
.merge-order-price {
  color: var(--red);
  font-weight: 600;
}
.merge-order-items {
  color: var(--gray-500);
  font-size: 12px;
  width: 100%;
}

/* ========== Homepage Template Management ========== */
.hp-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--gray-200);
  padding-bottom: 0;
}
.hp-tab {
  padding: 8px 20px;
  font-size: 14px;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--gray-500);
  border-bottom: 2px solid transparent;
  transition: all .2s;
}
.hp-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 600;
}
.hp-tab:hover { color: var(--primary); }
.hp-panel { }
.hp-panel.hidden { display: none; }

/* Homepage help cards */
.hp-help-card {
  background: linear-gradient(135deg, #f0f7ff 0%, #fff 100%);
  border: 1px solid #dbeafe;
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: 16px;
}
.hp-help-card-ab {
  background: linear-gradient(135deg, #f0fdf4 0%, #fff 100%);
  border-color: #bbf7d0;
}
.hp-help-card h4 {
  font-size: 15px;
  font-weight: 600;
  color: var(--gray-800);
  margin: 0 0 10px;
}
.hp-help-intro {
  font-size: 14px;
  color: var(--gray-600);
  line-height: 1.7;
  margin: 0 0 16px;
}
.hp-help-intro strong {
  color: var(--primary);
}
.hp-help-steps {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.hp-help-step {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: #fff;
  border-radius: 8px;
  padding: 12px 14px;
  border: 1px solid var(--gray-200);
}
.hp-help-step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.hp-help-step strong {
  display: block;
  font-size: 13px;
  color: var(--gray-800);
  margin-bottom: 2px;
}
.hp-help-step span {
  font-size: 12px;
  color: var(--gray-500);
  line-height: 1.5;
}
.hp-help-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}
.hp-help-block {
  background: #fff;
  border-radius: 8px;
  padding: 14px 16px;
  border: 1px solid var(--gray-200);
}
.hp-help-block h5 {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-700);
  margin: 0 0 8px;
}
.hp-help-block ul {
  margin: 0;
  padding-left: 18px;
  list-style: disc;
}
.hp-help-block li {
  font-size: 12px;
  color: var(--gray-500);
  line-height: 1.8;
}
.hp-help-block li strong {
  color: var(--primary);
}
.hp-help-tip {
  font-size: 13px;
  color: #166534;
  background: #dcfce7;
  border-radius: 8px;
  padding: 10px 14px;
  line-height: 1.6;
}
.hp-help-tip strong {
  color: #15803d;
}

/* AB test summary & legend */
.hp-ab-summary {
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 13px;
  line-height: 1.7;
  margin-bottom: 16px;
}
.hp-ab-summary-warn {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
}
.hp-ab-summary-info {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e40af;
}
.hp-ab-summary-success {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
}
.hp-ab-legend {
  margin-top: 20px;
  background: var(--gray-50);
  border-radius: 10px;
  padding: 16px 20px;
  border: 1px solid var(--gray-200);
}
.hp-ab-legend h5 {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-600);
  margin: 0 0 10px;
}
.hp-ab-legend-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 6px 20px;
  font-size: 12px;
  color: var(--gray-500);
  line-height: 1.8;
}
.hp-ab-legend-grid strong {
  color: var(--gray-700);
}
.ab-stat-best {
  border-color: #22c55e;
  box-shadow: 0 0 0 1px #22c55e;
}
.ab-best-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  background: #22c55e;
  border-radius: 4px;
  padding: 1px 6px;
  vertical-align: middle;
  margin-left: 4px;
}
.ab-stat-note {
  margin-top: 10px;
  font-size: 11px;
  color: var(--gray-400);
  text-align: center;
}
.ab-metric {
  cursor: help;
}

/* Product list in editor */
.hp-prod-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.hp-prod-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  cursor: grab;
  transition: box-shadow .15s, background .15s;
}
.hp-prod-item:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
  background: var(--gray-50);
}
.hp-prod-item.dragging {
  opacity: .4;
  box-shadow: 0 4px 12px rgba(0,0,0,.12);
}
.hp-prod-drag {
  color: var(--gray-400);
  cursor: grab;
  font-size: 14px;
  user-select: none;
}
.hp-prod-order {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-500);
  flex-shrink: 0;
}
.hp-prod-img {
  width: 56px;
  height: 56px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
}
.hp-prod-info {
  flex: 1;
  min-width: 0;
}
.hp-prod-title {
  font-size: 14px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hp-prod-meta {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: var(--gray-500);
  margin-top: 4px;
}

/* AB Test Stats */
.ab-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
}
.ab-stat-card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  padding: 16px;
  transition: box-shadow .2s;
}
.ab-stat-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,.06);
}
.ab-stat-disabled {
  opacity: .6;
}
.ab-stat-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}
.ab-stat-header h4 {
  font-size: 15px;
  font-weight: 600;
  margin: 0;
}
.ab-stat-body {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin-bottom: 14px;
}
.ab-metric {
  text-align: center;
  padding: 8px 4px;
  background: var(--gray-50);
  border-radius: 8px;
}
.ab-metric-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--gray-800);
}
.ab-metric-label {
  font-size: 11px;
  color: var(--gray-500);
  margin-top: 2px;
}
.ab-stat-rates {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ab-rate {
  display: flex;
  align-items: center;
  gap: 8px;
}
.ab-rate-label {
  font-size: 12px;
  color: var(--gray-500);
  width: 42px;
  flex-shrink: 0;
}
.ab-rate-bar {
  flex: 1;
  height: 8px;
  background: var(--gray-100);
  border-radius: 4px;
  overflow: hidden;
}
.ab-rate-fill {
  height: 100%;
  border-radius: 4px;
  transition: width .3s;
}
.ab-rate-value {
  font-size: 13px;
  font-weight: 600;
  width: 48px;
  text-align: right;
}

/* Homepage Editor - Two Part Layout */
.hp-editor-layout {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}
.hp-editor-left {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.preview-modal {
  max-width: 400px;
}
.preview-modal-body {
  padding: 20px;
  display: flex;
  justify-content: center;
}
.hp-editor-part {
  background: #fff;
  border-radius: 10px;
  border: 1px solid var(--gray-200);
  overflow: hidden;
}
.hp-part-header {
  padding: 16px 20px;
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  gap: 12px;
}
.hp-part-header h4 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}
.hp-part-desc {
  font-size: 12px;
  color: var(--gray-500);
}
.hp-section-list {
  padding: 12px;
  min-height: 80px;
}
.hp-remaining-preview {
  padding: 12px;
}
.hp-remaining-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.hp-remaining-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  background: var(--gray-50);
  border-radius: 8px;
  border: 1px solid var(--gray-100);
}
.hp-remaining-item img {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
}
.hp-remaining-info {
  flex: 1;
  min-width: 0;
}
.hp-remaining-title {
  font-size: 13px;
  color: #333;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Section product list in editor */
.hp-sec-prod-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 6px;
}
.hp-sec-prod-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px;
  background: var(--gray-50);
  border-radius: 6px;
  font-size: 12px;
}
.hp-sec-prod-item img {
  width: 32px;
  height: 32px;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
  content-visibility: auto;
  contain-intrinsic-size: 32px 32px;
}
.hp-sec-prod-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--gray-700);
}
.hp-sec-prod-price {
  color: var(--red);
  font-weight: 600;
  flex-shrink: 0;
}
/* Homepage phone preview inner elements */
.hpv-banner {
  width: 100%;
  height: 100px;
  background: linear-gradient(135deg, #FF8C42, #FF4D00);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
}
.hpv-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hpv-sec-header { padding: 8px 10px 4px; }
.hpv-sec-title { font-size: 12px; font-weight: 700; color: #FF4D00; }
.hpv-sec-sub { font-size: 9px; color: #999; margin-top: 2px; }

.hpv-two-col {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 8px 6px;
}
.hpv-two-col-item {
  width: calc(50% - 3px);
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.hpv-two-col-item img { width: 100%; height: 72px; object-fit: cover; }
.hpv-prod-info { padding: 6px; }
.hpv-prod-title {
  font-size: 9px;
  color: #333;
  line-height: 1.3;
  height: 24px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.hpv-prod-price { font-size: 11px; font-weight: 700; color: #FF4D00; margin-top: 2px; }
.hpv-prod-old { font-size: 8px; color: #999; text-decoration: line-through; margin-left: 4px; }
.hpv-prod-sold { font-size: 8px; color: #999; margin-top: 2px; }

.hpv-waterfall {
  display: flex;
  gap: 6px;
  padding: 0 8px 6px;
}
.hpv-waterfall-col { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.hpv-waterfall-card {
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.hpv-waterfall-card img { width: 100%; height: 60px; object-fit: cover; }

.hpv-single-card { padding: 0 8px 6px; }
.hpv-single-item {
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 6px;
  box-shadow: 0 2px 6px rgba(0,0,0,.08);
}
.hpv-single-item img { width: 100%; height: 90px; object-fit: cover; }
.hpv-single-body { padding: 8px; }
.hpv-single-title { font-size: 11px; font-weight: 700; color: #222; line-height: 1.3; }

/* single-large-image preview */
.hpv-single-large-image { padding: 0 8px 6px; }
.hpv-single-large-item {
  position: relative;
  margin-bottom: 8px;
  border-radius: 8px;
  overflow: hidden;
}
.hpv-single-large-item img { width: 100%; display: block; border-radius: 8px; }
.hpv-single-large-item.has-link { cursor: pointer; }
.hpv-single-large-link-badge {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0,0,0,.55);
  color: #fff;
  font-size: 9px;
  padding: 2px 6px;
  border-radius: 4px;
}

/* section image config form */
.hp-img-list { display: flex; flex-direction: column; gap: 10px; }
.hp-img-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 10px;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: 8px;
}

.hpv-three-col {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 0 8px 6px;
}
.hpv-three-col-item {
  width: calc(33.33% - 3px);
  background: #fff;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,.05);
}
.hpv-three-col-item img { width: 100%; height: 48px; object-fit: cover; }
.hpv-three-col-name {
  font-size: 8px;
  color: #333;
  padding: 3px 4px 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hpv-three-col-price {
  font-size: 9px;
  color: #FF4D00;
  font-weight: 600;
  padding: 2px 4px 6px;
}

.hpv-big-small { padding: 0 8px 6px; }
.hpv-big-small-main { position: relative; border-radius: 8px; overflow: hidden; margin-bottom: 6px; }
.hpv-big-small-main img { width: 100%; height: 90px; object-fit: cover; }
.hpv-big-small-overlay {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 8px;
  background: linear-gradient(transparent, rgba(0,0,0,.6));
}
.hpv-big-small-name { color: #fff; font-size: 11px; font-weight: 700; }
.hpv-big-small-price { color: #FFD54F; font-size: 12px; font-weight: 700; }
.hpv-big-small-grid { display: flex; flex-wrap: wrap; gap: 4px; }
.hpv-big-small-sub {
  width: calc(50% - 2px);
  background: #fff;
  border-radius: 6px;
  overflow: hidden;
}
.hpv-big-small-sub img { width: 100%; height: 48px; object-fit: cover; }

.hpv-immersive { padding: 0 6px 6px; }
.hpv-immersive-item { position: relative; margin-bottom: 4px; border-radius: 6px; overflow: hidden; }
.hpv-immersive-item img { width: 100%; height: 110px; object-fit: cover; }
.hpv-immersive-tag {
  position: absolute;
  bottom: 6px; right: 6px;
  background: rgba(0,0,0,.5);
  color: #FFD54F;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
}

.hpv-shelf { margin-bottom: 6px; }
.hpv-shelf-cat { padding: 6px 10px 4px; font-size: 10px; font-weight: 600; color: #333; border-left: 3px solid #FF4D00; margin-left: 8px; padding-left: 8px; }
.hpv-shelf-scroll {
  display: flex;
  gap: 6px;
  padding: 0 8px 6px;
  overflow-x: auto;
}
.hpv-shelf-scroll::-webkit-scrollbar { height: 0; }
.hpv-shelf-item {
  flex-shrink: 0;
  width: 70px;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.hpv-shelf-item img { width: 70px; height: 70px; object-fit: cover; }

.hpv-remaining-header {
  display: flex;
  align-items: center;
  padding: 8px 10px 4px;
  gap: 8px;
}
.hpv-remaining-tag {
  background: linear-gradient(135deg, #FF8C42, #FF4D00);
  color: #fff;
  font-size: 8px;
  padding: 2px 8px;
  border-radius: 10px;
}

.hpv-legacy-list { padding: 0 8px 6px; }
.hpv-legacy-single {
  display: flex;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 6px;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.hpv-legacy-single img { width: 72px; height: 72px; object-fit: cover; flex-shrink: 0; }
.hpv-legacy-single-info { flex: 1; padding: 8px; }

.hp-sec-prod-remove {
  width: 20px;
  height: 20px;
  border: none;
  background: transparent;
  color: var(--gray-400);
  cursor: pointer;
  font-size: 12px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all .15s;
}
.hp-sec-prod-remove:hover {
  background: #fee2e2;
  color: var(--red);
}

/* Product detail phone preview */
.pdv-page {
  background: #F5F5F5;
  min-height: 100%;
  padding-bottom: 52px;
}
.pdv-swiper {
  position: relative;
  width: 100%;
  height: 200px;
  background: #fff;
  overflow: hidden;
}
.pdv-swiper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.pdv-swiper-empty,
.pdv-empty-media {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #999;
  font-size: 12px;
  background: #fff;
}
.pdv-swiper-video-badge,
.pdv-gif-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 9px;
  color: #fff;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
}
.pdv-swiper-video-badge { background: rgba(0, 120, 215, 0.85); }
.pdv-gif-badge { background: rgba(255, 77, 0, 0.85); }
.pdv-swiper-video img { opacity: 0.85; }
.pdv-thumbs {
  display: flex;
  gap: 4px;
  padding: 6px 8px;
  background: #fff;
  overflow-x: auto;
}
.pdv-thumbs::-webkit-scrollbar { height: 0; }
.pdv-thumb {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 4px;
  overflow: hidden;
  flex-shrink: 0;
  border: 2px solid transparent;
}
.pdv-thumb.active { border-color: #FF4D00; }
.pdv-thumb img { width: 100%; height: 100%; object-fit: cover; }
.pdv-thumb-tag {
  position: absolute;
  bottom: 1px;
  right: 1px;
  font-size: 7px;
  color: #fff;
  background: rgba(0, 0, 0, 0.55);
  padding: 0 2px;
  border-radius: 2px;
}
.pdv-thumb-tag.gif { background: rgba(255, 77, 0, 0.85); }
.pdv-thumb-more {
  width: 36px;
  height: 36px;
  border-radius: 4px;
  background: #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: #666;
  flex-shrink: 0;
}
.pdv-price-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 10px 10px 6px;
  background: #fff;
}
.pdv-price { color: #FF4D00; font-weight: 700; }
.pdv-price-symbol { font-size: 11px; }
.pdv-price-value { font-size: 18px; }
.pdv-price-suffix { font-size: 11px; margin-left: 2px; }
.pdv-original-price {
  font-size: 10px;
  color: #999;
  text-decoration: line-through;
}
.pdv-title-block {
  padding: 0 10px 10px;
  background: #fff;
  margin-bottom: 6px;
}
.pdv-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 6px;
}
.pdv-tag {
  font-size: 8px;
  padding: 2px 6px;
  border-radius: 4px;
  color: #fff;
  display: inline-flex;
  align-items: center;
  gap: 2px;
}
.pdv-tag-video { background: #0078D7; }
.pdv-tag-gif { background: #FF4D00; color: #fff; }
.pdv-tag-cat { background: #FF6B35; }
.pdv-tag-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #fff;
}
.pdv-title {
  font-size: 12px;
  font-weight: 700;
  color: #222;
  line-height: 1.4;
  margin-bottom: 6px;
}
.pdv-hot-bar-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}
.pdv-hot-label { font-size: 9px; color: #999; white-space: nowrap; }
.pdv-hot-bar {
  flex: 1;
  height: 4px;
  background: #f0f0f0;
  border-radius: 2px;
  overflow: hidden;
}
.pdv-hot-fill {
  height: 100%;
  border-radius: 2px;
}
.pdv-hot-fill.fire { background: linear-gradient(90deg, #FF2D2D, #FF6B35); }
.pdv-hot-fill.hot { background: linear-gradient(90deg, #FF6B35, #FFAA33); }
.pdv-hot-fill.warm { background: linear-gradient(90deg, #FFAA33, #FFD54F); }
.pdv-hot-fill.normal { background: #ccc; }
.pdv-hot-value { font-size: 10px; font-weight: 600; }
.pdv-stats { font-size: 9px; color: #999; }
.pdv-spec {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px;
  background: #fff;
  margin-bottom: 6px;
  font-size: 11px;
}
.pdv-spec-label { color: #999; }
.pdv-spec-value { flex: 1; color: #333; }
.pdv-spec-arrow { color: #ccc; }
.pdv-detail {
  background: #fff;
  margin-bottom: 6px;
}
.pdv-detail-header {
  padding: 8px 10px;
  font-size: 11px;
  font-weight: 600;
  color: #333;
  border-bottom: 1px solid #f0f0f0;
}
.pdv-detail-item {
  position: relative;
}
.pdv-detail-item img {
  width: 100%;
  display: block;
}
.pdv-detail-video {
  height: 80px;
  background: #111;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 11px;
}
.pdv-detail-gif {
  position: absolute;
  bottom: 6px;
  left: 6px;
  font-size: 8px;
  color: #fff;
  background: rgba(255, 77, 0, 0.85);
  padding: 2px 6px;
  border-radius: 4px;
}
.pdv-footer {
  position: sticky;
  bottom: 0;
  display: flex;
  gap: 8px;
  padding: 8px 10px;
  background: #fff;
  border-top: 1px solid #f0f0f0;
  margin-top: 6px;
}
.pdv-footer-btn {
  flex: 1;
  text-align: center;
  padding: 8px 0;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}
.pdv-footer-btn.cart {
  background: #FFF3E0;
  color: #FF6B35;
  border: 1px solid #FF6B35;
}
.pdv-footer-btn.buy {
  background: linear-gradient(135deg, #FF6B35, #FF4D00);
  color: #fff;
}

/* Toggle switch */
.switch-label {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  cursor: pointer;
}
.switch-label input {
  opacity: 0;
  width: 0;
  height: 0;
}
.switch-slider {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--gray-300);
  border-radius: 24px;
  transition: background 0.2s;
}
.switch-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
}
.switch-label input:checked + .switch-slider {
  background: var(--primary, #4F46E5);
}
.switch-label input:checked + .switch-slider::before {
  transform: translateX(20px);
}

.admin-user-info {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-right: 16px;
}
.admin-username {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-700);
}
.role-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
}
.badge-admin {
  background: #EEF2FF;
  color: var(--primary);
}
.badge-operator {
  background: #ECFDF5;
  color: var(--green);
}

.password-field {
  position: relative;
}
.password-field .input,
.password-field .login-input {
  padding-right: 40px;
}
.password-toggle {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--gray-500);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  padding: 0;
  transition: color .2s, background .2s;
}
.password-toggle:hover {
  color: var(--gray-700);
  background: var(--gray-100);
}
.password-toggle:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
}
.password-icon {
  display: block;
  flex-shrink: 0;
}
.password-icon-hide {
  display: none;
}
.password-toggle.is-visible .password-icon-show {
  display: none;
}
.password-toggle.is-visible .password-icon-hide {
  display: block;
}

/* 快递查询额度 */
.tracking-quota-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 72px;
}
.tracking-quota-num {
  font-size: 28px;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.2;
}
.tracking-quota-label {
  font-size: 12px;
  color: var(--gray-500);
  margin-top: 4px;
}
.tracking-quota-bar-wrap {
  width: 100%;
  max-width: 360px;
}
.tracking-quota-bar-bg {
  height: 8px;
  background: var(--gray-100);
  border-radius: 4px;
  overflow: hidden;
}
.tracking-quota-bar-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 4px;
  transition: width .4s ease;
}
