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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: #f0f2f5;
  color: #333;
}

/* 登录页 */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #ff6b35 0%, #ff8c5a 100%);
}

.login-box {
  background: #fff;
  padding: 40px;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.15);
  width: 380px;
}

.login-box h1 {
  text-align: center;
  color: #ff6b35;
  font-size: 28px;
  margin-bottom: 8px;
}

.subtitle {
  text-align: center;
  color: #999;
  margin-bottom: 30px;
  font-size: 14px;
}

.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  color: #666;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #ff6b35;
}

.btn-login {
  width: 100%;
  padding: 12px;
  background: #ff6b35;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 16px;
  cursor: pointer;
  margin-top: 10px;
  transition: background 0.2s;
}

.btn-login:hover {
  background: #e55a2b;
}

.tip {
  text-align: center;
  margin-top: 16px;
  font-size: 12px;
  color: #999;
}

/* 主布局 */
.main-page {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 220px;
  background: #1f2937;
  color: #fff;
  display: flex;
  flex-direction: column;
}

.logo {
  padding: 24px 20px;
  font-size: 18px;
  font-weight: bold;
  border-bottom: 1px solid #374151;
  color: #ff6b35;
}

.sidebar nav {
  flex: 1;
  padding: 16px 0;
}

.nav-item {
  display: block;
  padding: 12px 20px;
  color: #d1d5db;
  text-decoration: none;
  transition: all 0.2s;
  font-size: 14px;
}

.nav-item:hover,
.nav-item.active {
  background: #374151;
  color: #fff;
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid #374151;
}

.btn-logout {
  width: 100%;
  padding: 10px;
  background: transparent;
  border: 1px solid #4b5563;
  color: #d1d5db;
  border-radius: 6px;
  cursor: pointer;
}

.btn-logout:hover {
  background: #374151;
}

.content {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
}

.page h2 {
  font-size: 22px;
  margin-bottom: 20px;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

/* 统计卡片 */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 30px;
}

.stat-card {
  background: #fff;
  padding: 24px;
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.stat-value {
  font-size: 28px;
  font-weight: bold;
  color: #ff6b35;
}

.stat-label {
  font-size: 13px;
  color: #999;
  margin-top: 6px;
}

/* 表格 */
.data-table,
.recent-orders table {
  width: 100%;
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  border-collapse: collapse;
}

.data-table th,
.recent-orders th {
  background: #f9fafb;
  padding: 12px 16px;
  text-align: left;
  font-size: 13px;
  color: #666;
  font-weight: 600;
  border-bottom: 1px solid #eee;
}

.data-table td,
.recent-orders td {
  padding: 12px 16px;
  font-size: 13px;
  border-bottom: 1px solid #f3f4f6;
}

.data-table tr:hover {
  background: #fafafa;
}

.product-img {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 6px;
}

.status-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
}

.status-上架, .status-已完成 {
  background: #d1fae5;
  color: #065f46;
}

.status-下架, .status-已取消 {
  background: #fee2e2;
  color: #991b1b;
}

.status-待发货 {
  background: #fef3c7;
  color: #92400e;
}

.status-已发货 {
  background: #dbeafe;
  color: #1e40af;
}

.btn-sm {
  padding: 4px 10px;
  font-size: 12px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  margin-right: 4px;
}

.btn-edit {
  background: #e0f2fe;
  color: #0369a1;
}

.btn-delete {
  background: #fee2e2;
  color: #b91c1c;
}

.btn-primary {
  background: #ff6b35;
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
}

.btn-primary:hover {
  background: #e55a2b;
}

.toolbar {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.toolbar select,
.toolbar input {
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 13px;
}

.toolbar input {
  width: 220px;
}

/* 弹窗 */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  background: #fff;
  border-radius: 12px;
  width: 520px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid #eee;
}

.modal-header h3 {
  font-size: 16px;
}

.close {
  font-size: 24px;
  cursor: pointer;
  color: #999;
}

.modal-body {
  padding: 20px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.modal-footer {
  padding: 12px 20px;
  border-top: 1px solid #eee;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.btn-cancel {
  padding: 8px 16px;
  border: 1px solid #ddd;
  background: #fff;
  border-radius: 6px;
  cursor: pointer;
}

.recent-orders {
  background: #fff;
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.recent-orders h3 {
  margin-bottom: 16px;
  font-size: 16px;
}

@media (max-width: 900px) {
  .stats {
    grid-template-columns: repeat(2, 1fr);
  }
  .sidebar {
    width: 60px;
  }
  .logo, .nav-item span, .sidebar-footer {
    display: none;
  }
}

/* 首页布局 */
.hint {
  color: #666;
  font-size: 13px;
  margin-bottom: 16px;
}
.layout-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.layout-item {
  background: #fff;
  border-radius: 10px;
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  border-left: 4px solid #ddd;
}
.layout-item.enabled {
  border-left-color: #ff6b35;
}
.layout-item.disabled {
  opacity: 0.7;
}
.layout-head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.mod-type {
  background: #f3f4f6;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 12px;
  color: #555;
  white-space: nowrap;
}
.mod-title {
  flex: 1;
  min-width: 120px;
  padding: 6px 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
}
.switch {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  cursor: pointer;
}
.mod-actions {
  display: flex;
  gap: 6px;
}
.mod-extra {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #f0f0f0;
}
.mod-extra label {
  display: block;
  font-size: 12px;
  color: #666;
  margin-bottom: 4px;
  margin-top: 8px;
}
.mod-extra label:first-child {
  margin-top: 0;
}
.mod-extra input,
.mod-extra textarea,
.mod-extra select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 13px;
}
.mod-extra select[multiple] {
  height: auto;
}

/* 商户配置 */
.config-card {
  background: #fff;
  padding: 24px;
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  max-width: 640px;
}
.config-card .form-group {
  margin-bottom: 16px;
}
.tip-warn {
  margin-top: 16px;
  font-size: 12px;
  color: #b45309;
  background: #fffbeb;
  padding: 10px 12px;
  border-radius: 6px;
}

.header-actions { display: flex; gap: 10px; align-items: center; }
.btn-outline {
  background: #fff; border: 1px solid #ddd; color: #333;
  padding: 8px 14px; border-radius: 6px; cursor: pointer; font-size: 13px;
}
.btn-outline:hover { border-color: #ff6b35; color: #ff6b35; }

.layout-workspace { display: flex; gap: 20px; align-items: flex-start; }
.layout-editor { flex: 1; min-width: 0; }
.layout-preview {
  width: 320px; flex-shrink: 0;
  position: sticky; top: 20px;
}
.preview-phone {
  background: #1a1a1a; border-radius: 28px; padding: 12px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}
.preview-status {
  color: #fff; font-size: 11px; text-align: center; padding: 4px 0 8px;
}
.preview-nav {
  background: #ff6b35; color: #fff; text-align: center;
  padding: 12px; font-size: 14px; font-weight: 600;
  border-radius: 4px 4px 0 0;
}
.preview-body {
  background: #f5f5f5; min-height: 480px; max-height: 560px;
  overflow-y: auto; border-radius: 0 0 4px 4px; padding: 8px;
}
.pv-banner { height: 100px; background: #ddd; border-radius: 8px; margin-bottom: 10px;
  display: flex; align-items: center; justify-content: center; color: #888; font-size: 12px;
  overflow: hidden; }
.pv-banner img { width: 100%; height: 100%; object-fit: cover; }
.pv-cate { display: flex; flex-wrap: wrap; background: #fff; border-radius: 8px;
  padding: 8px; margin-bottom: 10px; }
.pv-cate-item { width: 25%; text-align: center; font-size: 10px; padding: 6px 0; color: #333; }
.pv-cate-icon {
  width: 28px; height: 28px; border-radius: 50%; background: #ff6b35; color: #fff;
  margin: 0 auto 4px; display: flex; align-items: center; justify-content: center; font-size: 12px;
}
.pv-section { font-size: 13px; font-weight: 600; margin: 8px 0 6px 4px; color: #333; }
.pv-products { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.pv-product {
  width: calc(50% - 3px); background: #fff; border-radius: 8px; overflow: hidden;
}
.pv-product img { width: 100%; height: 70px; object-fit: cover; background: #eee; }
.pv-product-name { font-size: 11px; padding: 4px 6px 0; color: #333;
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.pv-product-price { font-size: 12px; color: #ff6b35; padding: 2px 6px 6px; font-weight: 600; }
.pv-activity {
  background: #fff; border-radius: 8px; margin-bottom: 10px; overflow: hidden;
  text-align: center;
}
.pv-activity img { width: 100%; height: 80px; object-fit: cover; }
.pv-activity-text { padding: 8px; font-size: 12px; color: #333; }

.layout-list { display: flex; flex-direction: column; gap: 10px; }
.layout-item {
  background: #fff; border-radius: 12px; border: 1px solid #eee;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04); transition: box-shadow 0.2s;
  display: flex; align-items: stretch;
}
.layout-item:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
.layout-item.dragging { opacity: 0.5; border: 2px dashed #ff6b35; }
.layout-item.drag-over { border-top: 3px solid #ff6b35; }
.drag-handle {
  width: 36px; display: flex; align-items: center; justify-content: center;
  cursor: grab; color: #bbb; font-size: 16px; background: #fafafa;
  border-radius: 12px 0 0 12px; user-select: none; flex-shrink: 0;
}
.drag-handle:active { cursor: grabbing; }
.layout-body { flex: 1; padding: 14px 16px; min-width: 0; }
.layout-head {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.mod-type {
  background: #f3f4f6; padding: 3px 8px; border-radius: 4px;
  font-size: 11px; color: #666; white-space: nowrap;
}
.mod-title {
  flex: 1; min-width: 100px; padding: 5px 10px;
  border: 1px solid transparent; border-radius: 6px; font-size: 14px;
  font-weight: 500; background: transparent;
}
.mod-title:hover, .mod-title:focus {
  border-color: #ddd; background: #fff; outline: none;
}
.switch-wrap {
  display: flex; align-items: center; gap: 6px; font-size: 12px; color: #666;
}
.switch-wrap input { accent-color: #ff6b35; }
.btn-icon {
  width: 28px; height: 28px; border: none; background: #f5f5f5;
  border-radius: 6px; cursor: pointer; color: #999; font-size: 14px;
  display: flex; align-items: center; justify-content: center;
}
.btn-icon:hover { background: #fee2e2; color: #dc2626; }
.mod-extra {
  margin-top: 10px; padding-top: 10px; border-top: 1px solid #f5f5f5;
}
.mod-extra label {
  display: block; font-size: 11px; color: #999; margin-bottom: 4px; margin-top: 8px;
}
.mod-extra label:first-child { margin-top: 0; }
.mod-extra input, .mod-extra textarea, .mod-extra select {
  width: 100%; padding: 7px 10px; border: 1px solid #e5e5e5;
  border-radius: 6px; font-size: 13px;
}
.mod-extra select[multiple] { height: auto; min-height: 80px; }

.module-type-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}
.module-type-card {
  border: 1px solid #eee; border-radius: 10px; padding: 20px;
  text-align: center; cursor: pointer; transition: all 0.2s;
}
.module-type-card:hover {
  border-color: #ff6b35; background: #fff7f4;
}
.mt-icon { font-size: 28px; margin-bottom: 8px; }
.mt-name { font-size: 14px; color: #333; }

.upload-btn {
  display: inline-block;
  margin-top: 8px;
  padding: 8px 14px;
  background: #f3f4f6;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  color: #333;
}
.upload-btn:hover { background: #e5e7eb; }
.img-preview-box {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.img-preview-box img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #eee;
}
.preview-empty { color: #999; font-size: 13px; }

.toggle-btn {
  border: none;
  padding: 4px 12px;
  border-radius: 14px;
  font-size: 12px;
  cursor: pointer;
  min-width: 52px;
}
.toggle-btn.on { background: #dcfce7; color: #16a34a; }
.toggle-btn.off { background: #f3f4f6; color: #9ca3af; }

.pick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 8px;
  max-height: 220px;
  overflow-y: auto;
  margin-top: 6px;
}
.pick-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  border: 2px solid #eee;
  border-radius: 8px;
  padding: 6px;
  cursor: pointer;
  font-size: 11px;
  text-align: center;
  background: #fff;
}
.pick-item.selected { border-color: #ff6b35; background: #fff7f4; }
.pick-item input { display: none; }
.pick-item img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 6px;
  margin-bottom: 4px;
}
.pick-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  width: 100%;
}
.picked-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.picked-chip {
  position: relative;
  width: 56px;
  height: 56px;
}
.picked-chip img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 6px;
}
.picked-chip button {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 18px;
  height: 18px;
  border: none;
  border-radius: 50%;
  background: #ef4444;
  color: #fff;
  font-size: 12px;
  cursor: pointer;
  line-height: 18px;
  padding: 0;
}
.cate-edit-list { display: flex; flex-direction: column; gap: 8px; }
.cate-edit-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.cate-img-box {
  width: 48px;
  height: 48px;
  border: 1px dashed #ddd;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
  background: #fafafa;
  flex-shrink: 0;
}
.cate-img-box img { width: 100%; height: 100%; object-fit: cover; }
.cate-img-box span { color: #aaa; font-size: 18px; }
.cate-edit-row input {
  flex: 1;
  padding: 6px 10px;
  border: 1px solid #e5e5e5;
  border-radius: 6px;
}

.btn-sm-add {
  margin-top: 8px;
  font-size: 12px;
  padding: 6px 12px;
}
.hint-inline {
  color: #999;
  font-size: 12px;
  padding: 8px 0;
}
.picked-chip.wide {
  width: auto;
  height: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px 4px 4px;
  background: #f8fafc;
  border-radius: 8px;
  border: 1px solid #eee;
}
.picked-chip.wide img {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  object-fit: cover;
}
.picked-chip.wide span {
  font-size: 12px;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.picked-chip.wide button {
  position: static;
  margin-left: 4px;
}
.products-picked {
  flex-direction: column;
  align-items: flex-start;
}
.picker-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid transparent;
}
.picker-item:hover { background: #f8fafc; }
.picker-item.active {
  border-color: #ff6b35;
  background: #fff7f4;
}
.picker-item img {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  object-fit: cover;
}
.picker-name { font-size: 14px; color: #333; }
.picker-price { font-size: 12px; color: #ff6b35; margin-top: 2px; }

.toggle-switch-btn {
  min-width: 88px;
  height: 36px;
  border: none;
  border-radius: 18px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 0 16px;
  transition: all .2s;
}
.toggle-switch-btn.on {
  background: #07c160;
  color: #fff;
}
.toggle-switch-btn.off {
  background: #e5e7eb;
  color: #666;
}


.mount-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(200px,1fr));gap:12px;margin-top:12px}
.mount-card{border:1px solid #eee;border-radius:10px;padding:14px;background:#fff}
.mount-card.ok{border-color:#86efac;background:#f0fdf4}
.mount-card.bad{border-color:#fecaca;background:#fef2f2}
.mount-title{font-weight:600;margin-bottom:8px}
.mount-line{font-size:13px;color:#555;line-height:1.6}
.mount-pre{background:#0f172a;color:#e2e8f0;padding:12px;border-radius:8px;font-size:12px;overflow:auto;max-height:240px;white-space:pre-wrap}


.cert-block{margin-top:20px;padding-top:16px;border-top:1px dashed #e5e5e5}
.cert-title{font-size:15px;margin:0 0 8px;font-weight:600}
.cert-status{font-size:13px;padding:10px 12px;border-radius:8px;margin:10px 0;background:#f8fafc;color:#475569}
.cert-status.ok{background:#f0fdf4;color:#166534}
.cert-status.bad{background:#fef2f2;color:#991b1b}
.cert-upload-row{display:flex;flex-wrap:wrap;gap:12px;align-items:center}
.cert-item{display:flex;align-items:center;gap:10px;padding:10px 12px;border:1px solid #eee;border-radius:8px;background:#fff}
.cert-name{font-size:13px;color:#333;font-family:monospace}

.order-filter-bar { flex-wrap: wrap; gap: 12px; align-items: center; }
.order-status-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.order-status-tabs .ostab {
  border: 1px solid #e5e7eb;
  background: #fff;
  color: #4b5563;
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 13px;
  cursor: pointer;
  line-height: 1;
}
.order-status-tabs .ostab:hover { border-color: #ff6b35; color: #ff6b35; }
.order-status-tabs .ostab.active {
  background: #ff6b35;
  border-color: #ff6b35;
  color: #fff;
  font-weight: 600;
}
.order-ops {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 6px;
  align-items: center;
  white-space: nowrap;
}
.order-ops .btn-sm {
  margin: 0;
  flex-shrink: 0;
}
.order-extra {
  font-size: 11px;
  color: #666;
  margin-top: 6px;
  max-width: 220px;
  white-space: normal;
  line-height: 1.35;
}
.order-extra.as { color: #b45309; }

.product-images-grid{display:flex;flex-wrap:wrap;gap:10px;margin:8px 0}
.product-images-grid .img-slot{width:88px;height:88px;border:1px dashed #ddd;border-radius:8px;overflow:hidden;position:relative;background:#fafafa}
.product-images-grid .img-slot img{width:100%;height:100%;object-fit:cover;display:block}
.product-images-grid .img-slot .rm{position:absolute;top:2px;right:2px;background:rgba(0,0,0,.55);color:#fff;border:none;border-radius:4px;font-size:11px;padding:1px 5px;cursor:pointer}
.product-images-grid .img-slot .main-tag{position:absolute;left:2px;bottom:2px;background:#ff6b35;color:#fff;font-size:10px;padding:1px 4px;border-radius:3px}
.sku-list{display:flex;flex-direction:column;gap:8px;margin:8px 0}
.sku-row{display:flex;gap:8px;align-items:center}
.sku-row input{flex:1;padding:8px 10px;border:1px solid #e5e5e5;border-radius:8px}
.sku-row .sku-del{border:none;background:#fee2e2;color:#b91c1c;border-radius:6px;padding:6px 10px;cursor:pointer}
