/**
 * 温贸国际 · 企业商户工作台框架体系 (B2B Admin Framework)
 * 标杆参照：1688 商家工作台 / 阿里巴巴卖家中心 / Element Plus Pro Admin
 */

/* ==========================================================================
   1. 基础重置与后台主视口 (Viewport & Master Layout)
   ========================================================================== */
html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  width: 100%;
  overflow: hidden;
  background-color: #f1f5f9;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Source Han Sans CN", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  color: #0f172a;
  -webkit-font-smoothing: antialiased;
}

/* 全屏 Admin 主布局容器 */
.admin-layout {
  display: flex;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background-color: #f1f5f9;
}

/* ==========================================================================
   2. 左侧专业侧边栏 (Sidebar Navigation)
   ========================================================================== */
.admin-sidebar {
  width: 240px;
  min-width: 240px;
  height: 100vh;
  background: #0f172a; /* 沉稳深邃深蓝黑 */
  color: #94a3b8;
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  user-select: none;
  z-index: 50;
  transition: width 0.2s ease, transform 0.2s ease;
}

/* 顶部品牌与平台标识 */
.admin-sidebar-brand {
  height: 60px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 18px;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.admin-brand-logo {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, #2563eb, #0ea5e9);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 16px;
  letter-spacing: -0.5px;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.4);
}

.admin-brand-info {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.admin-brand-title {
  font-size: 15px;
  font-weight: 700;
  color: #f8fafc;
  letter-spacing: 0.2px;
}

.admin-brand-subtitle {
  font-size: 11px;
  color: #64748b;
  letter-spacing: 0.5px;
}

/* 企业主体名片卡 (当前站点上下文) */
.admin-site-context-card {
  margin: 14px 14px 8px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.admin-site-context-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.admin-site-name {
  font-size: 13px;
  font-weight: 600;
  color: #e2e8f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 145px;
}

.admin-site-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.admin-site-domain {
  font-size: 11px;
  color: #64748b;
  font-family: var(--font-mono, monospace);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 导航分组与菜单列表 */
.admin-sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 10px 0;
}

.admin-sidebar-nav::-webkit-scrollbar {
  width: 4px;
}
.admin-sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
}

.admin-nav-group {
  margin-bottom: 16px;
}

.admin-nav-group-title {
  padding: 6px 18px 4px;
  font-size: 11px;
  font-weight: 600;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.admin-nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 18px;
  margin: 2px 10px;
  border-radius: 6px;
  color: #94a3b8;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s ease;
}

.admin-nav-item-content {
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-nav-icon {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  transition: color 0.15s ease;
}

.admin-nav-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #f8fafc;
}

.admin-nav-item:hover .admin-nav-icon {
  color: #38bdf8;
}

.admin-nav-item.is-active {
  background: #1e293b;
  color: #ffffff;
  font-weight: 600;
  box-shadow: inset 3px 0 0 #2563eb;
}

.admin-nav-item.is-active .admin-nav-icon {
  color: #38bdf8;
}

.admin-nav-badge {
  padding: 1px 6px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
  background: #ef4444;
  color: #ffffff;
  min-width: 16px;
  text-align: center;
  line-height: 14px;
}

/* 侧栏底部状态与支持 */
.admin-sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
}

.admin-footer-status {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #64748b;
}

.admin-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.6);
}

.admin-footer-link {
  color: #64748b;
  text-decoration: none;
  font-size: 11px;
  transition: color 0.15s;
}

.admin-footer-link:hover {
  color: #94a3b8;
}

/* ==========================================================================
   3. 右侧主工作容器与全局顶栏 (Main Workbench & Global Header)
   ========================================================================== */
.admin-main {
  flex: 1;
  min-width: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: #f8fafc;
  overflow: hidden;
}

/* 全局工作台顶栏 */
.admin-header {
  height: 60px;
  min-height: 60px;
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 40;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

/* 顶栏左侧：面包屑与位置感知 */
.admin-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #64748b;
}

.admin-breadcrumb a {
  color: #475569;
  text-decoration: none;
  transition: color 0.15s;
}

.admin-breadcrumb a:hover {
  color: #2563eb;
}

.admin-breadcrumb-separator {
  color: #cbd5e1;
}

.admin-breadcrumb-current {
  color: #0f172a;
  font-weight: 600;
}

/* 顶栏中间：业务状态提示胶囊 */
.admin-header-center {
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-status-capsule {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  font-size: 12px;
  color: #475569;
}

.admin-status-capsule-icon {
  color: #2563eb;
}

/* 顶栏右侧：快捷动作与个人中心 */
.admin-header-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.admin-btn-preview-site {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 6px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #0f172a;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  transition: all 0.15s ease;
}

.admin-btn-preview-site:hover {
  background: #f8fafc;
  border-color: #94a3b8;
  color: #2563eb;
}

.admin-user-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  border-radius: 6px;
  color: #334155;
  font-size: 13px;
  text-decoration: none;
  transition: background 0.15s;
}

.admin-user-pill:hover {
  background: #f1f5f9;
}

.admin-user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #e2e8f0;
  color: #475569;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
  border: 1px solid #cbd5e1;
}

.admin-btn-logout {
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  border-radius: 6px;
  transition: all 0.15s;
  text-decoration: none;
}

.admin-btn-logout:hover {
  background: #fee2e2;
  color: #ef4444;
}

/* ==========================================================================
   4. 页面主体工作画布 (Canvas & Page Content)
   ========================================================================== */
.admin-content-canvas {
  flex: 1;
  overflow-y: auto;
  padding: 24px 28px 64px;
  background: #f8fafc;
}

/* 页面头部定义区 (Page Header Bar) */
.admin-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.admin-page-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.admin-page-title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.3px;
}

.admin-page-desc {
  margin: 0;
  font-size: 13px;
  color: #64748b;
  line-height: 1.5;
}

.admin-page-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* 主操作按钮 (CTA) */
.admin-btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 6px;
  background: #2563eb;
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid #1d4ed8;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(37, 99, 235, 0.2);
  transition: all 0.15s ease;
  text-decoration: none;
}

.admin-btn-primary:hover {
  background: #1d4ed8;
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.3);
}

.admin-btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 6px;
  background: #ffffff;
  color: #334155;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid #cbd5e1;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
}

.admin-btn-secondary:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: #0f172a;
}

/* ==========================================================================
   5. 数据概览指标条 (KPI Stats Strip)
   ========================================================================== */
.admin-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.admin-kpi-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 16px 20px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.admin-kpi-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #64748b;
  font-size: 13px;
  font-weight: 500;
}

.admin-kpi-icon {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: #f1f5f9;
  color: #2563eb;
  display: flex;
  align-items: center;
  justify-content: center;
}

.admin-kpi-value {
  font-size: 24px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.2;
}

.admin-kpi-footer {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #64748b;
}

.admin-kpi-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}

.admin-kpi-badge.is-success {
  background: #ecfdf5;
  color: #059669;
}

.admin-kpi-badge.is-warning {
  background: #fffbeb;
  color: #d97706;
}

.admin-kpi-badge.is-info {
  background: #eff6ff;
  color: #2563eb;
}

.admin-kpi-badge.is-neutral {
  background: #f1f5f9;
  color: #64748b;
}

.admin-kpi-badge.is-danger {
  background: #fef2f2;
  color: #dc2626;
}

/* ==========================================================================
   6. 筛选与检索工具栏 (Filter & Search Toolbar)
   ========================================================================== */
.admin-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
  overflow: hidden;
  margin-bottom: 20px;
}

.admin-toolbar {
  padding: 14px 20px;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.admin-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  background: #f1f5f9;
  padding: 3px;
  border-radius: 6px;
}

.admin-tab {
  padding: 5px 12px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 500;
  color: #64748b;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s;
}

.admin-tab:hover {
  color: #0f172a;
}

.admin-tab.is-active {
  background: #ffffff;
  color: #2563eb;
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.admin-filters {
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-input-search {
  height: 32px;
  padding: 0 12px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  font-size: 13px;
  color: #0f172a;
  outline: none;
  transition: border-color 0.15s;
  width: 220px;
}

.admin-input-search:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.admin-select {
  height: 32px;
  padding: 0 28px 0 10px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  background: #ffffff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' viewBox='0 0 24 24' stroke='%2364748b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E") no-repeat right 8px center;
  font-size: 13px;
  color: #334155;
  outline: none;
  appearance: none;
  cursor: pointer;
}

.admin-select:focus {
  border-color: #2563eb;
}

/* ==========================================================================
   7. 严谨专业的企业级数据表格 (Enterprise Data Table)
   ========================================================================== */
.admin-table-container {
  width: 100%;
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}

.admin-table thead th {
  background: #f8fafc;
  color: #475569;
  font-weight: 600;
  font-size: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid #e2e8f0;
  white-space: nowrap;
}

.admin-table tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid #f1f5f9;
  color: #334155;
  vertical-align: middle;
}

.admin-table tbody tr:hover {
  background: #f8fafc;
}

.admin-table tbody tr:last-child td {
  border-bottom: none;
}

/* 表格主体商品单元格 */
.admin-goods-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-goods-thumb {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  object-fit: cover;
  background: #f8fafc;
  flex-shrink: 0;
}

.admin-goods-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.admin-goods-name {
  font-weight: 600;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 320px;
}

.admin-goods-meta {
  font-size: 12px;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

/* 价格单元格 (强化内控出厂价保密标识) */
.admin-price-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.admin-price-val {
  font-weight: 700;
  font-size: 14px;
  color: #0f172a;
  font-family: var(--font-mono, monospace);
}

.admin-price-sub {
  font-size: 11px;
  color: #d97706;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* 操作列按钮组 */
.admin-table-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.admin-btn-action {
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #334155;
  font-size: 12px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s;
}

.admin-btn-action:hover {
  background: #f1f5f9;
  color: #2563eb;
  border-color: #94a3b8;
}

.admin-btn-action.is-danger:hover {
  background: #fee2e2;
  color: #dc2626;
  border-color: #fca5a5;
}

/* ==========================================================================
   8. 标准抽屉浮层规范 (Slide-over Drawer)
   彻底解决“在主页面硬展开几百像素大表单撑破页面”的病根
   ========================================================================== */
.admin-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.admin-drawer-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.admin-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 580px;
  max-width: 90vw;
  background: #ffffff;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
  z-index: 101;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.admin-drawer-overlay.is-open .admin-drawer {
  transform: translateX(0);
}

.admin-drawer-header {
  height: 60px;
  padding: 0 24px;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ffffff;
}

.admin-drawer-title {
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
}

.admin-drawer-close {
  background: transparent;
  border: none;
  font-size: 20px;
  color: #64748b;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.admin-drawer-close:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.admin-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

.admin-drawer-footer {
  padding: 16px 24px;
  border-top: 1px solid #e2e8f0;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

/* 抽屉与通用表单规范 */
.drawer-form-group {
  margin-bottom: 18px;
}

.drawer-form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #334155;
  margin-bottom: 6px;
}

.drawer-form-label .required {
  color: #ef4444;
}

.drawer-form-control {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 13px;
  color: #0f172a;
  outline: none;
  transition: border-color 0.15s;
}

.drawer-form-control:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.12);
}

.drawer-form-hint {
  font-size: 12px;
  color: #64748b;
  margin-top: 4px;
}

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

/* ==========================================================================
   9. 通用两列内容网格与设置页组件 (2:1 Grid & Form Layout)
   ========================================================================== */
.admin-grid-2-1 {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  align-items: start;
}

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

.admin-card-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-card-body {
  padding: 20px;
}

.admin-form-section-title {
  font-size: 13px;
  font-weight: 700;
  color: #1e293b;
  padding: 12px 0 8px;
  margin: 16px 0 12px;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.admin-form-section-title:first-child {
  margin-top: 0;
  padding-top: 0;
}

.admin-kv-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 13px;
}

.admin-kv-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.admin-kv-label {
  color: #64748b;
  flex-shrink: 0;
}

.admin-kv-value {
  color: #0f172a;
  font-weight: 500;
  text-align: right;
  word-break: break-all;
}

.admin-quick-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.admin-quick-btn {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  text-decoration: none;
  transition: all 0.15s;
}

.admin-quick-btn:hover {
  background: #eff6ff;
  border-color: #93c5fd;
}

.admin-quick-title {
  font-size: 13px;
  font-weight: 600;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 6px;
}

.admin-quick-desc {
  font-size: 11px;
  color: #64748b;
}

.admin-notice-bar {
  padding: 12px 16px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  color: #1e40af;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

/* ==========================================================================
   10. 商品图片本地上传与多图池管理组件 (Image Pool & Upload Grid)
   彻底杜绝“一般人找不到上传按钮”，对标 1688 卖家中心主流大加号磁贴范式
   ========================================================================== */
.img-upload-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  gap: 10px;
  flex-wrap: wrap;
}

.img-btn-upload-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border-radius: 6px;
  background: #2563eb;
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  border: 1px solid #1d4ed8;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.25);
  transition: all 0.15s ease;
}

.img-btn-upload-primary:hover {
  background: #1d4ed8;
  box-shadow: 0 3px 8px rgba(37, 99, 235, 0.35);
  transform: translateY(-1px);
}

.img-btn-link-aux {
  font-size: 12px;
  color: #64748b;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.img-btn-link-aux:hover {
  color: #2563eb;
  text-decoration: underline;
}

.img-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-top: 10px;
}

/* 上传大加号磁贴 (Tile) */
.img-tile-add {
  aspect-ratio: 1 / 1;
  border: 2px dashed #93c5fd;
  border-radius: 8px;
  background: #f0f7ff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  padding: 8px;
  text-align: center;
}

.img-tile-add:hover,
.img-tile-add.is-dragover {
  border-color: #2563eb;
  background: #dbeafe;
  transform: translateY(-1px);
}

.img-tile-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #2563eb;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 6px;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.3);
}

.img-tile-label {
  font-size: 12px;
  font-weight: 700;
  color: #1e40af;
}

.img-tile-counter {
  font-size: 10px;
  color: #64748b;
  margin-top: 2px;
}

.img-cell {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  overflow: hidden;
  transition: all 0.15s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.img-cell img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.img-cell.is-main {
  border: 2px solid #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.25);
}

.img-badge-main {
  position: absolute;
  top: 6px;
  left: 6px;
  background: #2563eb;
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  z-index: 2;
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
}

.img-btn-del {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.75);
  color: #ffffff;
  border: none;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
  transition: background 0.15s;
}

.img-btn-del:hover {
  background: #ef4444;
}

.img-btn-set-main {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(15, 23, 42, 0.8);
  color: #ffffff;
  border: none;
  font-size: 11px;
  padding: 4px 0;
  text-align: center;
  cursor: pointer;
  z-index: 2;
  opacity: 0;
  transition: opacity 0.15s;
}

.img-cell:hover .img-btn-set-main {
  opacity: 1;
}

.img-cell.is-main .img-btn-set-main {
  display: none;
}

