/* assets/common.css - ERP shared style foundation */

/* tokens */
:root {
  --primary: #2563eb;
  --primary2: #1d4ed8;
  --primary-soft: #eff6ff;
  --bg: #f5f7fb;
  --bg2: #eef2ff;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --border: rgba(15,23,42,.10);
  --border2: rgba(15,23,42,.18);
  --radius: 10px;
  --radius-sm: 8px;
  --radius-lg: 12px;
  --radius-pill: 999px;
  --shadow: 0 1px 2px rgba(15,23,42,0.04);
  --shadow-pop: 0 10px 24px rgba(15,23,42,0.12);
  --success: #16a34a;
  --success-bg: #f0fdf4;
  --success-border: #bbf7d0;
  --warning: #d97706;
  --warning-bg: #fffbeb;
  --warning-border: #fcd34d;
  --danger: #dc2626;
  --danger-bg: #fef2f2;
  --danger-border: #fecaca;
  --info: #2563eb;
  --info-bg: #eff6ff;
  --info-border: #bfdbfe;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: 'PingFang SC', 'MiSans', 'HarmonyOS Sans SC', 'Noto Sans SC', ui-sans-serif, system-ui, sans-serif; font-size: 13px; color: var(--text); background: var(--bg); overflow-y: scroll; }
a { color: inherit; text-decoration: none; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.mono { font-family: ui-monospace, SFMono-Regular, monospace; }

/* shared navigation */
.app-header, .top-nav { --header-content-max-width: 1952px; --header-content-gutter: 16px; background: #fff; border-bottom: 1px solid #e5e7eb; position: sticky; top: 0; z-index: 100; height: 60px; box-shadow: 0 1px 3px rgba(15,23,42,.04); line-height: 1; }
.app-header__inner, .nav-inner { width: calc(100% - (2 * var(--header-content-gutter))); max-width: var(--header-content-max-width); min-height: 60px; height: 100%; margin: 0 auto; padding: 0; display: grid; grid-template-columns: max-content minmax(0, 1fr) max-content; align-items: center; gap: 16px; }
.app-header__brand, .brand-area { display: flex; align-items: center; gap: 10px; min-width: max-content; text-decoration: none; }
.brand-logo { width: 36px; height: 36px; border-radius: 10px; background: var(--primary); display: flex; align-items: center; justify-content: center; color: #fff; box-shadow: 0 3px 10px rgba(37,99,235,.18); }
.brand-logo svg { width: 24px; height: 24px; color: currentColor; }
.brand-text h1 { margin: 0; font-size: 16px; font-weight: 750; color: #111827; white-space: nowrap; }
.app-header__nav, .nav-tabs { display: flex; align-items: center; justify-content: center; justify-content: safe center; gap: 1px; min-width: 0; height: 100%; padding: 0; overflow-x: auto; overflow-y: hidden; border: 0; border-radius: 0; background: transparent; box-shadow: none; white-space: nowrap; scrollbar-width: none; }
.nav-tab { position: relative; display: flex; flex: 0 0 auto; align-items: center; gap: 7px; height: 40px; padding: 0 10px; border-radius: 8px; font-size: 14px; font-weight: 600; color: #4b5563; cursor: pointer; transition: background .15s ease, color .15s ease; border: none; background: transparent; text-decoration: none; white-space: nowrap; -webkit-tap-highlight-color: transparent; }
.nav-tab:hover { background: #f7f8fa; color: #111827; }
.nav-tab:active { outline: none; }
.nav-tab.active { background: #eff6ff; color: #1d4ed8; font-weight: 700; }
.nav-tab.active::after { content: ''; position: absolute; left: 10px; right: 10px; bottom: 0; height: 2px; border-radius: 2px 2px 0 0; background: #2563eb; }
.nav-tab svg { width: 17px; height: 17px; flex-shrink: 0; }
.nav-tabs::-webkit-scrollbar { display: none; }
.app-header__actions, .user-area { display: flex; align-items: center; gap: 8px; min-width: max-content; padding-left: 16px; border-left: 1px solid #edf0f4; }
.user-menu { position: relative; }
.user-menu__trigger { display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 9px 0 7px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: #334155; font: inherit; font-size: 13px; font-weight: 650; line-height: 1; cursor: pointer; white-space: nowrap; transition: background .15s ease, border-color .15s ease; }
.user-menu__trigger:hover, .user-menu__trigger[aria-expanded="true"] { background: #f8fafc; border-color: #e5e7eb; }
.user-menu__avatar { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; background: #2563eb; color: #fff; font-size: 12px; font-weight: 700; }
.user-menu__name { max-width: 112px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-menu__chevron { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; transition: transform .15s ease; }
.user-menu__trigger[aria-expanded="true"] .user-menu__chevron { transform: rotate(180deg); }
.user-menu__panel { position: absolute; top: calc(100% + 8px); right: 0; z-index: 210; min-width: 148px; padding: 8px; border: 1px solid #e5e7eb; border-radius: 10px; background: #fff; box-shadow: var(--shadow-pop); }
.user-menu__panel[hidden] { display: none; }
.user-menu__identity { padding: 7px 9px 8px; color: #64748b; font-size: 12px; border-bottom: 1px solid #f1f5f9; }
.user-menu__logout.logout-btn { width: 100%; height: 34px; margin-top: 6px; padding: 0 9px; justify-content: flex-start; border: 0; border-radius: 7px; background: transparent; color: #475569; cursor: pointer; font-size: 13px; }
.user-menu__logout.logout-btn:hover { background: #fef2f2; color: #dc2626; }
@media (max-width: 1500px) {
  .nav-inner { gap: 10px; }
  .nav-tab { padding: 0 7px; }
  .user-area { padding-left: 10px; }
}
@media (max-width: 1450px) {
  .nav-tabs {
    justify-content: flex-start;
  }
}
@media (max-width: 1380px) {
  .nav-tab { gap: 5px; padding-left: 6px; padding-right: 6px; font-size: 13px; }
  .nav-tab svg { width: 15px; height: 15px; }
}
@media (min-width: 1920px) {
  .app-header, .top-nav { --header-content-gutter: 32px; }
}
/* 统一各页面主体容器顶部留白，避免切换页面时内容首行错位 */
.top-nav + main,
.top-nav ~ main { padding-top: 20px !important; }
/* legacy navigation */
.topbar, .ozon-header { background: #fff; border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 100; height: 54px; box-shadow: 0 1px 2px rgba(0,0,0,0.02); }
.topbar .inner, .header-inner { max-width: 1840px; margin: 0 auto; padding: 0 20px; height: 100%; display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand .logo { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--primary); box-shadow: 0 3px 10px rgba(37,99,235,.20); flex: 0 0 auto; }
.brand .title { font-weight: 900; letter-spacing: .2px; line-height: 1.1; font-size: 16px; color: #111827; }
.brand .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.topbar-user-controls { display: flex; align-items: center; gap: 12px; margin-left: 10px; border-left: 1px solid #e5e7eb; padding-left: 12px; }
.topbar-user-badge { background: var(--success-bg); color: #166534; border-color: var(--success-border); font-size: 13px; }
.topbar-logout-btn { color: var(--danger); padding: 4px 8px; }

/* 容器与卡片 */
.container { max-width: 1200px; margin: 0 auto; padding: 22px 16px 34px; }
.container-fluid { padding: 16px; max-width: 1800px; margin: 0 auto; padding-bottom: 80px; }
.card, .card-lite { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); margin-bottom: 16px; }
.card-header { margin-bottom: 12px; display: flex; justify-content: space-between; align-items: center; }
.card-title { font-weight: 900; font-size: 16px; }
.card-desc { font-size: 13px; color: var(--muted); margin-top: 4px; }

/* 工具条 */
.erp-toolbar { background: #fff; border: 1px solid var(--border); padding: 16px; border-radius: var(--radius); margin-bottom: 16px; box-shadow: var(--shadow); }
.erp-row-top { display: flex; flex-direction: row; flex-wrap: nowrap; align-items: center; gap: 16px; margin-bottom: 16px; }
.picker-box { width: 240px; flex-shrink: 0; position: relative; z-index: 10; }
.group-box { flex: 1; min-width: 0; display: flex; flex-direction: row; flex-wrap: nowrap; gap: 8px; align-items: center; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.group-box::-webkit-scrollbar { display: none; }
.group-pill { height: 32px; display: inline-flex; align-items: center; justify-content: center; padding: 0 16px; border-radius: 999px; background: #f8fafc; border: 1px solid var(--border); font-size: 13px; cursor: pointer; color: var(--muted); font-weight: 600; flex-shrink: 0; white-space: nowrap; transition: 0.2s; }
.group-pill:hover { background: #f1f5f9; color: var(--text); border-color: #cbd5e1; }
.group-pill.active { background: var(--text); color: #fff; border-color: var(--text); box-shadow: 0 2px 6px rgba(0,0,0,0.15); }
.erp-row-bottom { display: flex; flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; background: #f8fafc; padding: 10px 14px; border-radius: 10px; border: 1px solid var(--border); }
.search-box { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.tabs-box { display: flex; flex-direction: row; gap: 8px; align-items: center; justify-content: center; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.tabs-box::-webkit-scrollbar { display: none; }
.tab { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 16px; border-radius: 20px; background: #f3f4f6; color: var(--muted); font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap; flex-shrink: 0; transition: 0.2s; border: 1px solid transparent; }
.tab[data-active="true"] { background: #fff; border-color: var(--border2); color: var(--text); box-shadow: var(--shadow); font-weight: 600; }
.tab[data-active="true"][data-status="awaiting_packaging"] { color: #d97706; border-color: #fcd34d; background: #fffbeb; }
.tab[data-active="true"][data-status="awaiting_deliver"] { color: var(--primary); border-color: #bfdbfe; background: #eff6ff; }
.date-box { display: flex; align-items: center; gap: 8px; height: 34px; background: #fff; border: 1px solid var(--border2); border-radius: 8px; padding: 0 8px; flex-shrink: 0; }

/* 表格通用 */
.table-card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--border); overflow: hidden; margin-bottom: 16px; }
.table-scroll { overflow-x: auto; width: 100%; }
.table { width: 100%; min-width: 1200px; border-collapse: collapse; text-align: center; }
.table th { background: #f8fafc; color: var(--muted); font-weight: 600; font-size: 13px; padding: 12px 10px; text-align: center; border-bottom: 1px solid var(--border2); white-space: nowrap; }
.table td { padding: 14px 10px; font-size: 13px; text-align: center; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
.table tbody tr:hover { background: #f8fafc; }
.text-left { text-align: left; } .text-right { text-align: right; } .text-center, .td-center { text-align: center; }

/* page-board: shipping table */
body.page-board .board-table th:nth-child(5), body.page-board .board-table td:nth-child(5) { text-align: left; }
body.page-board .col-posting { font-weight: 600; font-size: 14px; color: #111827; }
body.page-board .track-link { color: var(--primary); text-decoration: none; font-weight: 500; font-size: 14px; cursor: pointer; border:none; background:transparent; display: block; width: 100%; }
body.page-board .track-link:hover { text-decoration: underline; color: var(--primary2); }
body.page-board .prod { display: flex; gap: 16px; align-items: center; }
body.page-board .prod-info { display: flex; flex-direction: column; justify-content: center; line-height: 1.5; }
body.page-board .prod-title { font-weight: 600; color: var(--primary); font-size: 14px; margin-bottom: 8px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; text-decoration:none; }
body.page-board .tag-sku { background: #f1f5f9; padding: 2px 6px; border-radius: 4px; font-size: 13px; color: var(--muted); border: 1px solid #e2e8f0; }
body.page-board .tag-store { background: #e0e7ff; padding: 2px 6px; border-radius: 4px; font-size: 12px; font-weight: 600; color: #3730a3; margin-top: 6px; display: inline-block; }
body.page-board .thumb { width: 72px; height: 72px; border-radius: 8px; border: 1px solid var(--border); object-fit: contain; background: #f9fafb; cursor: zoom-in; flex-shrink: 0; }
body.page-board .price-cell { font-weight: 700; font-family: monospace; font-size: 15px; color: #111827; }
body.page-board .qty-tag { display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; padding: 2px 7px; border-radius: 6px; line-height: 1; white-space: nowrap; margin-left: 6px; box-sizing: border-box; }
body.page-board .qty-tag-single { background-color: #f1f5f9; color: #64748b; border: 1px solid #e2e8f0; }
body.page-board .qty-tag-multi { background-color: #ef4444; color: #ffffff; border: 1px solid transparent; box-shadow: 0 0 6px rgba(239,68,68,0.3); }
body.page-board .overdue-badge { background: var(--danger-bg); color: var(--danger); border: 1px solid var(--danger-border); padding: 2px 6px; border-radius: 4px; font-size: 12px; font-weight: bold; display: inline-block; margin-bottom: 4px; }

/* 基础组件 */
.btn { display: inline-flex; align-items: center; justify-content: center; padding: 0 14px; border-radius: var(--radius-sm); border: 1px solid var(--border2); background: #fff; cursor: pointer; font-size: 13px; font-weight: 600; transition: 0.2s; white-space: nowrap; height: 34px; box-sizing: border-box;}
.btn:hover { border-color: var(--muted); }
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); } .btn-primary:hover { background: var(--primary2); }
.btn-ghost { background: transparent; border-color: transparent; } .btn-ghost:hover { background: #f1f5f9; }
.btn-sm { padding: 0 10px; font-size: 12px; height: 30px; }
.input { width: 100%; height: 34px; background: #fff; border: 1px solid var(--border2); border-radius: var(--radius-sm); padding: 0 12px; outline: none; font-size: 13px; box-sizing: border-box; }
.input:focus { border-color: var(--primary); }
.badge { display: inline-flex; align-items: center; justify-content: center; background: var(--info-bg); color: var(--primary); border: 1px solid var(--info-border); padding: 2px 8px; border-radius: 4px; font-size: 12px; font-weight: 600; line-height: 1.2; vertical-align: middle; }
.badge.primary { background: var(--info-bg); color: var(--primary); border-color: var(--info-border); }
.badge.success, .badge-success { background: var(--success-bg); color: var(--success); border-color: var(--success-border); }
.badge.warning { background: var(--warning-bg); color: var(--warning); border-color: var(--warning-border); }
.badge.danger, .badge-failed { background: var(--danger-bg); color: var(--danger); border-color: var(--danger-border); }
.badge.muted { background: #f1f5f9; color: var(--muted); border-color: #e2e8f0; }
.status-badge { padding: 4px 8px; border-radius: 4px; font-size: 12px; font-weight: bold; display: inline-block; }
.status-failed { background: var(--danger-bg); color: #ef4444; cursor: help; }
.status-publishing { background: var(--warning-bg); color: var(--warning); }
.status-published { background: #ecfdf5; color: #10b981; }
.status-pending { background: #f1f5f9; color: #64748b; }

/* toast */
#toast-container, .toast-container { position: fixed; top: 70px; right: 20px; z-index: 99999; display: flex; flex-direction: column; gap: 10px; width: min(380px, calc(100vw - 32px)); pointer-events: none; }
#toast-container > *, .toast-container > * { pointer-events: auto; }
.toast { display: flex; align-items: flex-start; gap: 10px; padding: 12px 16px; border-radius: var(--radius); box-shadow: var(--shadow-pop); color: #fff; font-size: 14px; font-weight: 500; line-height: 1.35; pointer-events: auto; transition: opacity .25s ease, transform .25s ease; animation: toast-slide-in .2s ease; }
.toast.toast-clickable { cursor: pointer; }
.toast.is-hiding { opacity: 0; transform: translateX(16px); }
.toast-icon { width: 20px; height: 20px; flex: 0 0 auto; margin-top: 1px; border-radius: 999px; background: rgba(255,255,255,.22); display: inline-flex; align-items: center; justify-content: center; font-size: 12px; }
.toast-content { min-width: 0; flex: 1 1 auto; display: grid; gap: 2px; }
.toast-message { min-width: 0; overflow-wrap: anywhere; }
.toast-detail { min-width: 0; opacity: .9; font-size: 12px; overflow-wrap: anywhere; }
.toast-action { min-width: 0; margin-top: 1px; opacity: .95; font-size: 12px; font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.toast-success { background: #10b981; }
.toast-error { background: #ef4444; }
.toast-warning { background: #f59e0b; }
.toast-info { background: #3b82f6; }
@keyframes toast-slide-in {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* 财务页模块 & 弹窗 */
.modal-overlay { position: fixed; inset: 0; background: rgba(15,23,42,0.3); z-index: 9999; }

/* 2026-09-20 P1-24 修复：共享确认弹窗必须高于页面自己的弹窗。
   商品编辑弹窗 #globalModal 是 z-index:10000，而 .modal-overlay 只有 9999，
   导致「删除 SKU 变体」这类确认框被压在编辑弹窗下面，点不到、也拿不到焦点。
   这里只抬高共享确认弹窗，不动任何页面弹窗的既有层级。 */
.modal-overlay.ops-confirm-overlay { z-index: 100000; }

.modal-container { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); background: #fff; border-radius: var(--radius-lg); width: 900px; max-width: 95vw; max-height: 90vh; display: flex; flex-direction: column; box-shadow: var(--shadow-pop); border: 1px solid var(--border); }
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--border); cursor: move; user-select: none; }
.modal-title { font-size: 17px; font-weight: 800; }
.modal-close { background: transparent; border: none; font-size: 20px; color: var(--muted); cursor: pointer; } .modal-close:hover { color: #dc2626; }
.modal-body { padding: 24px; overflow-y: auto; flex: 1; }

/* 全站共用的确认 / 输入弹窗（assets/common.js 的 window.showOpsConfirm / showOpsPrompt）。
   挂在上面这套 .modal-* 上，宽度取退货页 .modal-dialog-sm 的 400px，页脚取退货页
   .modal-footer-actions 的 16px 内边距 + #e5e7eb 上边框，好让各页的确认框和本页已有
   弹窗站在一起像是同一个组件。单类选择器写在 .modal-container（900px）之后，
   同权重下靠顺序压过它。 */
.ops-confirm-dialog {
  width: 400px;
  max-width: calc(100vw - 32px);
}

/* .modal-header 在别的弹窗里是可拖拽的（上面给了 cursor: move），这个确认框不拖拽，
   光标别骗人。 */
.ops-confirm-dialog .modal-header {
  cursor: default;
}

.ops-confirm-body {
  padding: 20px;
}

.ops-confirm-text {
  margin: 0;
  color: var(--text);
  font-size: 13px;
  line-height: 1.75;
  /* 原生 confirm 的 "第一行\n第二行" 也走这里，一个 \n 就是一次换行。 */
  white-space: pre-line;
}

.ops-confirm-note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
  white-space: pre-line;
}

/* 页脚逐值对齐退货页的 .modal-footer-actions（padding:16px + border-top:#e5e7eb），
   但不铺底色：.modal-container 有圆角而没有 overflow: hidden，铺色会顶出圆角。 */
.ops-confirm-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 16px;
  border-top: 1px solid #e5e7eb;
}


body.page-finance .finance-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 16px; }
body.page-finance .stat-box { padding: 16px; border-radius: var(--radius); border: 1px solid var(--border); background: #fff; }
body.page-finance .stat-box.bg-blue { background: var(--info-bg); border-color: var(--info-border); }
body.page-finance .stat-box.bg-green { background: var(--success-bg); border-color: var(--success-border); }
body.page-finance .stat-box.bg-yellow { background: #fefce8; border-color: #fef08a; }
body.page-finance .stat-box.bg-red { background: var(--danger-bg); border-color: var(--danger-border); }
body.page-finance .stat-box.bg-purple { background: #faf5ff; border-color: #e9d5ff; }
body.page-finance .stat-title { font-size: 13px; color: var(--muted); margin-bottom: 6px; font-weight: 600; }
body.page-finance .stat-value { font-size: 18px; font-weight: 900; font-family: monospace; }
.text-primary { color: var(--primary); } .text-success { color: var(--success); } .text-danger { color: var(--danger); }
body.page-finance .progress-bar-bg { width: 100%; height: 6px; background: #e2e8f0; border-radius: 999px; overflow: hidden; margin-top: 10px; }
body.page-finance .progress-bar-fill { height: 100%; background: var(--primary); width: 0%; transition: width 0.3s; }
body.page-finance .query-area { display: flex; gap: 16px; align-items: stretch; }
body.page-finance .query-textarea { flex: 1; min-height: 120px; resize: none; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius); outline: none; font-size: 13px; line-height: 1.6; font-family: monospace; }
body.page-finance .query-textarea:focus { border-color: var(--primary); }
body.page-finance .query-actions { display: flex; flex-direction: column; gap: 10px; width: 160px; justify-content: space-between; }
body.page-finance .query-actions .btn { width: 100%; justify-content: center; }

/* 图片预览弹窗 */
.img-preview-modal { position: fixed; inset: 0; z-index: 9999; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,0.8); }
.img-preview-modal img { max-width: 90vw; max-height: 90vh; border-radius: 8px; background: #fff; object-fit: contain; }
.img-preview-modal.high-z { z-index: 9999999; }
.img-preview-modal.high-z img { max-width: 85vw; max-height: 85vh; }

body.page-stores .detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 20px; }
body.page-stores .detail-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px dashed #e2e8f0; font-size: 14px; }
body.page-stores .group-store-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; background: #f8fafc; padding: 15px; border-radius: var(--radius); border: 1px solid #e2e8f0; max-height: 200px; overflow-y: auto; }
body.page-stores .store-chk-item { display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; padding: 6px; border-radius: 6px; background: #fff; border: 1px solid transparent; }
body.page-stores .role-badge { font-size: 12px; padding: 2px 8px; border-radius: 4px; font-weight: bold; background:var(--info-bg); color:var(--primary); border:1px solid var(--info-border); }
body.page-stores .role-admin { background:var(--danger-bg); color:var(--danger); border-color:var(--danger-border); }


/* ===================================================
   找回的登录页专属样式 (独立作用域，不影响内部页面)
   =================================================== */
.login-body {
    display: flex; align-items: center; justify-content: center;
    min-height: 100vh; margin: 0; padding: 24px;
    background: var(--bg);
}
.login-box {
    background: var(--card); width: 100%; max-width: 400px;
    padding: 40px 32px; border-radius: var(--radius-lg);
    box-shadow: var(--shadow-pop);
    border: 1px solid var(--border2); text-align: center;
}
.login-box .logo-icon {
    width: 56px; height: 56px; border-radius: var(--radius-lg);
    display: inline-grid; place-items: center;
    background: var(--primary);
    box-shadow: 0 10px 20px rgba(37,99,235,.22);
    margin-bottom: 20px;
}
.login-box .title { font-size: 24px; font-weight: 900; color: #0f172a; letter-spacing: 0; margin-bottom: 8px; }
.login-box .sub-title { font-size: 14px; color: var(--muted); margin-bottom: 30px; }

.login-box .input-group { text-align: left; margin-bottom: 20px; }
.login-box .input-group label {
    display: block; font-size: 13px; font-weight: 700;
    color: #334155; margin-bottom: 8px;
}
.login-box .input {
    height: 48px; font-size: 15px; border-radius: 12px;
    background: #f8fafc; border-color: #e2e8f0;
}
.login-box .input:focus { background: #fff; box-shadow: 0 0 0 4px rgba(37,99,235,0.1); }

.btn-login {
    width: 100%; height: 48px; background: var(--primary);
    color: #fff; border: none; border-radius: var(--radius);
    font-size: 16px; font-weight: 700; cursor: pointer;
    transition: 0.2s; box-shadow: 0 4px 12px rgba(37,99,235,.18);
    margin-top: 10px;
}
.btn-login:hover { background: var(--primary2); }

.error-msg {
    color: #dc2626; font-size: 13px; margin-top: 20px;
    font-weight: 600; background: #fef2f2; padding: 10px;
    border-radius: 8px; border: 1px solid #fecaca;
}

/* 核心修复：当框内为空（没有报错文字）时，彻底隐藏它 */
.error-msg:empty {
    display: none !important;
}

/* ========================================================
   SKU 编辑弹窗专用样式
   ======================================================== */
body.page-scrape .sku-img-box {
    width: 60px;
    height: 60px;
    border: 1px dashed #cbd5e1;
    border-radius: 4px;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
}
body.page-scrape .sku-img-box.has-img {
    border-style: solid;
    border-color: var(--border2);
    cursor: default;
}
body.page-scrape .sku-img-box i {
    color: #94a3b8;
    font-size: 20px;
}
body.page-scrape .sku-img-box img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    cursor: zoom-in;
    border-radius: 4px;
}
body.page-scrape .sku-img-del {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #ef4444;
    color: #fff;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    text-align: center;
    line-height: 16px;
    cursor: pointer;
    font-size: 12px;
    z-index: 10;
}
body.page-scrape .sku-img-del:hover { background: #dc2626; }

/* 表格内单元格 */
body.page-scrape .td-sku-img { padding: 10px; text-align: center; width: 80px; }

/* 徽章 */
body.page-scrape .erp-sku-table .badge { padding: 2px 6px; border-radius: 4px; font-size: 11px; margin-left: 8px; }

/* 删除按钮 */
body.page-scrape .btn-del-sku {
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
    font-size: 14px;
}
body.page-scrape .btn-del-sku:hover { color: #dc2626; }

/* 编辑弹窗Tab（保持基础层，scrape 页面由 scoped 样式覆盖） */
body:is(.page-board, .page-actions, .page-finance, .page-inventory, .page-returns, .page-stores, .page-home) .edit-tabs { display: flex; border-bottom: 2px solid #e2e8f0; margin-bottom: 16px; }
body:is(.page-board, .page-actions, .page-finance, .page-inventory, .page-returns, .page-stores, .page-home) .edit-tab { padding: 10px 20px; cursor: pointer; font-size: 14px; font-weight: 600; color: #64748b; border-bottom: 2px solid transparent; margin-bottom: -2px; transition: 0.2s; }
body:is(.page-board, .page-actions, .page-finance, .page-inventory, .page-returns, .page-stores, .page-home) .edit-tab:hover { color: #3b82f6; }
body:is(.page-board, .page-actions, .page-finance, .page-inventory, .page-returns, .page-stores, .page-home) .edit-tab.active { color: #3b82f6; border-bottom-color: #3b82f6; }
body:is(.page-board, .page-actions, .page-finance, .page-inventory, .page-returns, .page-stores, .page-home) .edit-tab-content { display: none; }
body:is(.page-board, .page-actions, .page-finance, .page-inventory, .page-returns, .page-stores, .page-home) .edit-tab-content.active { display: block; }
body:is(.page-board, .page-actions, .page-finance, .page-inventory, .page-returns, .page-stores, .page-home) .desc-image-editor img { max-width: 30% !important; height: auto !important; display: block; margin: 8px 0; border-radius: 4px; }

/* 组件样式（避免覆盖 scrape 企业版页面） */
body:is(.page-board, .page-actions, .page-finance, .page-inventory, .page-returns, .page-stores, .page-home) .action-module { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; padding: 8px 12px; }
body:is(.page-board, .page-actions, .page-finance, .page-inventory, .page-returns, .page-stores, .page-home) .action-module .module-title { font-size: 11px; color: #64748b; font-weight: 600; margin-bottom: 6px; text-transform: uppercase; }
body:is(.page-board, .page-actions, .page-finance, .page-inventory, .page-returns, .page-stores, .page-home) .action-module .module-btns { display: flex; gap: 6px; flex-wrap: wrap; }
body:is(.page-board, .page-actions, .page-finance, .page-inventory, .page-returns, .page-stores, .page-home) .action-module .wb-btn { font-size: 12px; padding: 5px 10px; }

/* 分页基础样式 */
body:is(.page-board, .page-actions, .page-finance, .page-inventory, .page-returns, .page-stores, .page-home) #pagination { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; background: #fff; border-top: 1px solid #e2e8f0; border-radius: 0 0 8px 8px; }
body:is(.page-board, .page-actions, .page-finance, .page-inventory, .page-returns, .page-stores, .page-home) #pagination .page-info { font-size: 13px; color: #64748b; }
body:is(.page-board, .page-actions, .page-finance, .page-inventory, .page-returns, .page-stores, .page-home) #pagination .page-controls { display: flex; align-items: center; gap: 12px; }
body:is(.page-board, .page-actions, .page-finance, .page-inventory, .page-returns, .page-stores, .page-home) #pagination select { padding: 6px 10px; border-radius: 4px; border: 1px solid #d1d5db; font-size: 13px; }
body:is(.page-board, .page-actions, .page-finance, .page-inventory, .page-returns, .page-stores, .page-home) #pagination button { padding: 6px 14px; border-radius: 4px; border: 1px solid #d1d5db; background: #fff; cursor: pointer; font-size: 13px; }
body:is(.page-board, .page-actions, .page-finance, .page-inventory, .page-returns, .page-stores, .page-home) #pagination button:hover { background: #f3f4f6; }
body:is(.page-board, .page-actions, .page-finance, .page-inventory, .page-returns, .page-stores, .page-home) #pagination button:disabled { opacity: 0.5; cursor: not-allowed; }

/* 状态标签和筛选行基础样式 */
body:is(.page-board, .page-actions, .page-finance, .page-inventory, .page-returns, .page-stores, .page-home) .status-tabs-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 8px 0; }
body:is(.page-board, .page-actions, .page-finance, .page-inventory, .page-returns, .page-stores, .page-home) .search-filter-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 10px 0; border-top: 1px solid #e2e8f0; }

/* 平台筛选下拉框样式 */
body.page-scrape #platformFilter option[value="ozon"] { color: #005bff; font-weight: 500; }
body.page-scrape #platformFilter option[value="aliexpress"] { color: #ff6a00; font-weight: 500; }
body.page-scrape #platformFilter option[value="1688"] { color: #ff6027; font-weight: 500; }
body.page-scrape #platformFilter option[value="taobao"] { color: #ff4400; font-weight: 500; }
body.page-scrape #platformFilter option[value="tmall"] { color: #ff0036; font-weight: 500; }
body.page-scrape #platformFilter option[value="pdd"] { color: #e02e24; font-weight: 500; }

/* 队列状态动画 */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ========================================================
   商品表格样式
   ======================================================== */
body.page-scrape .product-row { transition: background 0.2s; }
body.page-scrape .product-row:hover { background: #f8fafc; }

body.page-scrape .td-left { text-align: left; }

/* 主图 */
body.page-scrape .img-wrap { position: relative; display: inline-block; }
body.page-scrape .product-thumb { width: 64px; height: 64px; border-radius: 6px; object-fit: cover; border: 1px solid var(--border2); cursor: zoom-in; }

/* 标题与来源 */
body.page-scrape .product-title { font-size: 13px; color: #1e293b; font-weight: 600; line-height: 1.5; margin-bottom: 6px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
body.page-scrape .product-source { font-size: 12px; color: #64748b; }
body.page-scrape .product-source a { color: #0ea5e9; text-decoration: none; }
body.page-scrape .source-id { margin-left: 6px; background: #f1f5f9; padding: 2px 6px; border-radius: 4px; }

/* 类目 */
body.page-scrape .cat-name { color: #4f46e5; font-weight: 600; }
body.page-scrape .cat-missing { color: #ef4444; font-weight: 600; }
body.page-scrape .cat-row { font-size: 12px; margin-bottom: 2px; }

/* 库存 */
body.page-scrape .stock-box { font-size: 11px; color: #065f46; font-weight: bold; background: #d1fae5; border: 1px solid #6ee7b7; padding: 4px 6px; border-radius: 4px; display: inline-block; margin-top: 6px; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.page-scrape .stock-warning { font-size: 11px; color: #b45309; font-weight: bold; background: #fef3c7; border: 1px solid #fde68a; padding: 4px 6px; border-radius: 4px; display: inline-block; margin-top: 6px; }
body.page-scrape .stock-synced { color: #059669; font-size: 10px; }
body.page-scrape .stock-pending { color: #d97706; font-size: 10px; }
body.page-scrape .stock-exhausted { color: #b91c1c; font-size: 10px; }

/* 尺寸 */
body.page-scrape .dimensions { font-size: 11px; margin-top: 6px; color: var(--muted); }

/* 价格 */
body.page-scrape .price-main { font-size: 14px; font-weight: bold; color: #ef4444; }
body.page-scrape .price-pending { font-size: 13px; font-weight: 600; color: #f59e0b; background: #fffbeb; padding: 4px 8px; border-radius: 4px; display: inline-block; }
body.page-scrape .price-source { font-size: 11px; color: #10b981; margin-top: 3px; font-weight: 500; }

/* 状态徽章 */
body.page-scrape .store-published { font-size: 10px; color: #059669; margin-top: 3px; font-weight: 600; background: #d1fae5; padding: 2px 6px; border-radius: 4px; }

/* 时间 */
body.page-scrape .time-collect { font-size: 11px; color: #64748b; }
body.page-scrape .time-publish { font-size: 11px; color: #10b981; margin-top: 2px; }

/* 销量 */
body.page-scrape .sales-num { font-size: 14px; font-weight: bold; color: #059669; }
body.page-scrape .sales-label { font-size: 10px; color: #64748b; }
body.page-scrape .sales-empty { font-size: 12px; color: #94a3b8; }

/* 店铺与采集人 */
body.page-scrape .store-name { font-size: 11px; color: #6366f1; font-weight: 500; margin-bottom: 4px; max-width: 80px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.page-scrape .scraper-badge { display: inline-flex; align-items: center; background: #f3e8ff; color: #6d28d9; padding: 3px 8px; border-radius: 12px; font-size: 11px; font-weight: 500; }

/* 分组 */
body.page-scrape .group-badge { display: inline-flex; align-items: center; background: #ecfdf5; color: #059669; padding: 3px 8px; border-radius: 12px; font-size: 11px; font-weight: 500; max-width: 70px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.page-scrape .group-empty { font-size: 11px; color: #94a3b8; }
