/* ============================================================
   ML ERP 苹果极简 · 全站业务页（采集/商品/刊登/设置/登录等）
   在 styles.css 末尾 @import，覆盖旧 Ant 风格
   ============================================================ */

.layout .sidebar .nav-item.active,
.layout .sidebar .nav-item.nav-top.active {
  background: #fff;
  color: #0071e3;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  border-left-color: transparent;
  font-weight: 500;
}

.layout .sidebar .nav-item.active .nav-ico {
  color: #0071e3;
}

.main:not(.main-shell):not(.main-orders-page) {
  padding: 8px 16px 48px;
}

.main.main-shell {
  padding: 0;
  background: #f5f5f7;
  display: flex;
  flex-direction: column;
}

/* —— 顶部四胶囊：总览 / 采集库 / 店铺商品 / 订单 —— */
.erp-top-pills {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  flex-shrink: 0;
  padding: 8px 16px;
  background: transparent;
  border: none;
  border-bottom: none;
  box-shadow: none;
}

.erp-top-pills a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  padding: 0 18px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 999px;
  background: #fff;
  color: #6e6e73 !important;
  font-family: SimHei, "黑体", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  font-weight: 400;
  text-decoration: none;
  white-space: nowrap;
}

.erp-top-pills a:hover {
  color: #1d1d1f !important;
  border-color: rgba(0, 0, 0, 0.1);
}

.erp-top-pills a.on,
.erp-top-pills a.on:hover,
.erp-top-pills a.on:visited {
  background: #0071e3 !important;
  border-color: #0071e3 !important;
  color: #fff !important;
}

html.erp-embed .erp-top-pills {
  display: none !important;
}

.main:not(:has(#productTabsBar)) {
  padding-top: 8px;
}

/* —— 顶栏玻璃卡片 —— */
.products-sticky-top .topbar,
.products-sticky-top .mgmt-topbar,
.main-mgmt-page > .topbar.mgmt-topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  padding: 10px 16px;
  min-height: 0;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 18px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 4px 16px rgba(0, 0, 0, 0.03);
}

.topbar h1,
.mgmt-topbar h1,
.main-mgmt-page .mgmt-topbar h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.022em;
  color: #1d1d1f;
}

.topbar-count {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  color: #86868b;
}

.top-actions {
  margin-left: auto;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* —— 按钮 / 输入 —— */
.btn {
  border-radius: 9px;
  border-color: rgba(0, 0, 0, 0.08);
  font-weight: 500;
}

.btn.primary {
  background: #0071e3;
  border-color: #0071e3;
  border-radius: 999px;
}

.btn.primary:hover {
  background: #0077ed;
  border-color: #0077ed;
}

.btn.ghost {
  border-radius: 9px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.filters input,
.filters select,
.filter-panel input,
.filter-panel select,
.upload-search,
.upload-id-input,
.owner-gate-label input,
.overview-today-filters select,
.account-filter-panel select,
.account-filter-panel input {
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 9px;
}

.filters input:focus,
.filters select:focus,
.filter-panel input:focus,
.filter-panel select:focus,
.owner-gate-label input:focus {
  outline: none;
  border-color: rgba(0, 0, 0, 0.14);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

/* —— 状态分段（替代下划线 Tab） —— */
.mgmt-status-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  margin: 8px 0 10px;
  padding: 2px;
  border-bottom: none;
  background: rgba(0, 0, 0, 0.04);
  border-radius: 9px;
  width: fit-content;
  max-width: 100%;
}

.mgmt-status-tab {
  border: 0;
  background: transparent;
  border-radius: 7px;
  padding: 6px 12px;
  font-size: 13px;
  color: #6e6e73;
  margin-bottom: 0;
  border-bottom: none;
}

.mgmt-status-tab:hover {
  color: #1d1d1f;
}

.mgmt-status-tab.active {
  background: #fff;
  color: #1d1d1f;
  font-weight: 500;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
  border-bottom: none;
}

/* —— 表格 / 面板卡片 —— */
.mgmt-table-wrap {
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 18px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 4px 16px rgba(0, 0, 0, 0.03);
  overflow: auto;
}

.mgmt-table th {
  background: #fafafa;
  color: #86868b;
  font-weight: 500;
  border-bottom-color: rgba(0, 0, 0, 0.06);
}

.mgmt-table td {
  border-bottom-color: rgba(0, 0, 0, 0.06);
}

.mgmt-table tr:hover td {
  background: rgba(0, 0, 0, 0.015);
}

.mgmt-panel,
.upload-panel,
.stats-bar,
.filter-panel,
.account-settings-panel,
.account-filter-panel {
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 18px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 4px 16px rgba(0, 0, 0, 0.03);
}

.filter-panel {
  border-radius: 16px;
  padding: 12px 14px;
}

.products-sticky-top .filter-panel {
  margin-bottom: 10px;
}

/* 一行约 10 张，铺满不留白；窄屏自动减列 */
.grid {
  grid-template-columns: repeat(10, minmax(0, 1fr)) !important;
  gap: 8px !important;
  justify-content: stretch;
  align-content: start;
  grid-auto-rows: auto !important;
}

@media (max-width: 1600px) {
  .grid {
    grid-template-columns: repeat(8, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 1280px) {
  .grid {
    grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 960px) {
  .grid {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  }
}

.grid .product-card {
  width: auto !important;
  max-width: none !important;
  min-width: 0 !important;
  min-height: auto !important;
  height: auto !important;
  align-self: start;
}

/* 不能 overflow:hidden：会让 grid 行高按裁切后高度算，售价/成本/标题全被切掉；也挡 1688 搜图图标 */
.product-card {
  border: 1px solid #d0d0d5;
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  overflow: visible;
}

.product-card.selected {
  border-color: rgba(0, 113, 227, 0.55);
  box-shadow: 0 0 0 2px rgba(0, 113, 227, 0.45);
}

.product-card-image-wrap {
  border-radius: 12px 12px 0 0;
  overflow: visible;
}

.product-card-image,
.listed-thumb {
  border-radius: 10px;
  min-height: 140px;
  max-height: 200px;
}

.card-check-overlay {
  border-radius: 6px;
}

/* —— 底栏分页 —— */
.mgmt-bottom-dock,
.bottom-dock {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

/* —— 链接 —— */
.layout .main a:not(.btn):not(.nav-item):not(.module-tab):not(.erp-top-pills a) {
  color: #0071e3;
  font-weight: 500;
}

.edit-link {
  color: #0071e3;
}

/* —— 登录 / 注册 —— */
.owner-gate-body {
  background: #f5f5f7;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

.owner-gate {
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 20px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 12px 40px rgba(0, 0, 0, 0.08);
  padding: 32px 28px;
}

.owner-gate h1 {
  font-weight: 600;
  letter-spacing: -0.02em;
}

/* —— 上传页 —— */
.upload-shop-card {
  border-radius: 12px;
  border-color: rgba(0, 0, 0, 0.08);
  background: #fafafa;
}

.upload-shop-card:has(input:checked) {
  border-color: #0071e3;
  background: #eef6ff;
}

.upload-id-input-filled {
  border-color: #0071e3;
  background: #f5faff;
}

/* —— 账号设置侧栏内容区 —— */
.main-account-page .account-layout-card {
  border-radius: 18px;
  border-color: rgba(0, 0, 0, 0.06);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 4px 16px rgba(0, 0, 0, 0.03);
}

/* —— 弹窗 —— */
.edit-dialog,
.log-detail-dialog,
.erp-modal-card {
  border-radius: 16px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}

/* —— 售后页等与商品页同结构 —— */
.main-mgmt-page {
  background: #f5f5f7;
}

.main-mgmt-page .products-sticky-top {
  background: transparent;
  box-shadow: none;
  border: none;
  padding: 0;
}

.main-mgmt-page .mgmt-table-wrap {
  margin-top: 4px;
}

.overview-today-filters select {
  height: 32px;
  padding: 0 10px;
  background: #fff;
}

/* —— 去掉长灰字说明（保留 JS 动态 banner） —— */
.orders-profit-hint {
  display: none !important;
}

/* —— 采集库 / 店铺商品 / 回收站：v7 整块白 page-shell —— */
:root {
  --erp-page-surface: #ffffff;
}

.layout > .main.main-collection-page,
.layout > .main.main-products-page,
.layout > .main.main-recycle-page {
  display: flex;
  flex-direction: column;
  overflow: hidden !important;
  background: var(--erp-page-surface) !important;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 20px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 4px 16px rgba(0, 0, 0, 0.03);
  padding: 16px 24px 0 !important;
  padding-bottom: 0 !important;
}

/* 旧 styles 给这些页留了 72px 底，相对底栏后不需要 */
.main-collection-page,
.main-products-page,
.main-recycle-page {
  padding-bottom: 0 !important;
}

.main-collection-page > :not(#productTabsBar),
.main-products-page > :not(#productTabsBar),
.main-recycle-page > :not(#productTabsBar) {
  width: 100%;
  max-width: 100%;
}

.layout > .main.main-collection-page .products-sticky-top,
.layout > .main.main-products-page .products-sticky-top,
.layout > .main.main-recycle-page .products-sticky-top {
  position: relative;
  top: auto;
  flex-shrink: 0;
  z-index: 1;
}

.products-sticky-top {
  position: sticky;
  top: 0;
  z-index: 30;
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  margin: 0 auto !important;
  padding: 0 0 12px !important;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06) !important;
}

.products-sticky-top .topbar,
.products-sticky-top .mgmt-topbar {
  background: transparent !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  margin-bottom: 0 !important;
  padding: 0 0 8px !important;
}

.products-sticky-top .group-bar {
  margin: 0;
  padding: 8px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.products-sticky-top .filter-panel,
.products-sticky-top .mgmt-status-tabs {
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  margin: 0 !important;
  padding: 10px 0 0 !important;
}

.products-sticky-top .mgmt-status-tabs {
  padding-top: 8px !important;
  margin-bottom: 8px !important;
}

.product-table-wrap {
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  margin: 0 auto 12px !important;
  overflow: auto;
}

.layout > .main.main-collection-page > #grid:not([hidden]),
.layout > .main.main-collection-page > #collectionTableWrap:not([hidden]),
.layout > .main.main-products-page > #grid:not([hidden]),
.layout > .main.main-products-page > #productTableWrap:not([hidden]),
.layout > .main.main-recycle-page > #grid {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  margin: 12px 0 0;
  -webkit-overflow-scrolling: touch;
}

.layout > .main.main-collection-page > footer.bottom-dock,
.layout > .main.main-products-page > footer.bottom-dock,
.layout > .main.main-recycle-page > footer.bottom-dock {
  position: relative !important;
  left: auto !important;
  right: auto !important;
  bottom: auto !important;
  width: auto;
  flex-shrink: 0;
  margin: 0 -24px;
  padding: 10px 24px;
  background: rgba(255, 255, 255, 0.98) !important;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  border-bottom-left-radius: 20px;
  border-bottom-right-radius: 20px;
  z-index: 30;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  row-gap: 8px;
}

.layout > .main.main-collection-page > footer.bottom-dock .bottom-dock-left,
.layout > .main.main-products-page > footer.bottom-dock .bottom-dock-left,
.layout > .main.main-recycle-page > footer.bottom-dock .bottom-dock-left {
  flex: 0 1 auto;
  min-width: 0;
}

.layout > .main.main-collection-page > footer.bottom-dock .bottom-dock-center,
.layout > .main.main-products-page > footer.bottom-dock .bottom-dock-center,
.layout > .main.main-recycle-page > footer.bottom-dock .bottom-dock-center {
  flex: 1 1 auto;
  flex-wrap: nowrap;
  justify-content: flex-start;
  min-width: min(100%, 280px);
  overflow-x: auto;
}

.layout > .main.main-collection-page > footer.bottom-dock .bottom-dock-right,
.layout > .main.main-products-page > footer.bottom-dock .bottom-dock-right,
.layout > .main.main-recycle-page > footer.bottom-dock .bottom-dock-right {
  flex: 0 0 auto;
  margin-left: auto;
}
