/* ===== Font Awesome 图标库 ===== */
@import url('https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/css/font-awesome.min.css');

/* 图标基础样式 */
.iconfont {
    display: inline-block;
    font: normal normal normal 14px/1 FontAwesome;
    font-size: inherit;
    line-height: 1;
    text-rendering: auto;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
.nav-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    font-size: 18px;
    flex-shrink: 0;
}
.icon-button .iconfont {
    font-size: 20px;
}

/* ===== CSS 变量 ===== */
:root {
  --bg: #f5f7fb;
  --panel: #ffffff;
  --panel-soft: #f8fafc;
  --line: #e3e8ef;
  --line-strong: #cbd5e1;
  --text: #172033;
  --muted: #667085;
  --blue: #2563eb;
  --blue-soft: #eef4ff;
  --green: #138763;
  --green-soft: #e7f8f1;
  --red: #dc2626;
  --red-soft: #feecec;
  --orange: #d97706;
  --orange-soft: #fff4e5;
  --sidebar: #101828;
  --sidebar-width: 220px;
  --shadow: 0 10px 28px rgba(15, 23, 42, .06);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(ellipse 70% 45% at 10% 10%, rgba(99, 102, 241, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse 60% 50% at 20% 50%, rgba(59, 130, 246, 0.05) 0%, transparent 55%),
    radial-gradient(ellipse 55% 45% at 75% 30%, rgba(139, 92, 246, 0.06) 0%, transparent 50%),
    radial-gradient(ellipse 50% 55% at 70% 75%, rgba(14, 165, 233, 0.05) 0%, transparent 50%),
    radial-gradient(ellipse 45% 40% at 40% 90%, rgba(6, 182, 212, 0.04) 0%, transparent 50%),
    linear-gradient(180deg, #f0f3fa 0%, #f5f7fb 30%, #fafbfd 60%, #f4f6fa 100%);
  background-attachment: fixed;
  color: var(--text);
  font-family: "Microsoft YaHei", Arial, sans-serif;
  letter-spacing: 0;
}

body.modal-open {
  overflow: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font-family: inherit;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-width);
  padding: 20px 14px;
  background:
    radial-gradient(ellipse 80% 40% at 30% 10%, rgba(99, 102, 241, 0.28) 0%, transparent 60%),
    radial-gradient(ellipse 60% 45% at 75% 50%, rgba(59, 130, 246, 0.18) 0%, transparent 55%),
    radial-gradient(ellipse 50% 40% at 40% 85%, rgba(14, 165, 233, 0.15) 0%, transparent 55%),
    linear-gradient(175deg, #1e293b 0%, #1e2d44 50%, #1b2838 100%);
  color: #e2e8f0;
  transition: width .22s cubic-bezier(.4,0,.2,1);
  display: flex;
  flex-direction: column;
  box-shadow: 2px 0 30px rgba(0,0,0,.15);
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 60;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.1) transparent;
}
/* 侧边栏滚动条美化 */
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,.1);
  border-radius: 4px;
}
.sidebar::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,.2);
}

/* 侧边栏底部版权 */
.sidebar-footer {
  margin-top: auto;
  padding: 14px 6px 4px;
  border-top: 1px solid rgba(255,255,255,.1);
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.5;
  color: rgba(226, 232, 240, .55);
  text-align: center;
  flex-shrink: 0;
}
.sidebar-footer span {
  font-weight: 400;
}

.sidebar > nav {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}

.brand {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
  padding: 0 6px;
  flex-shrink: 0;
}

.brand-mark {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 10px;
  background: linear-gradient(135deg, #6366f1 0%, #3b82f6 50%, #06b6d4 100%);
  font-weight: 800;
  font-size: 18px;
  color: #fff;
  box-shadow: 0 4px 14px rgba(99, 102, 241, .35);
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  margin-top: 3px;
  color: #94a3b8;
  font-size: 12px;
}

.sidebar nav {
  gap: 3px;
}

.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 9px;
  color: #cbd5e1;
  font-size: 14px;
  font-weight: 600;
  position: relative;
  transition: background .15s ease, color .15s ease;
}

.sidebar nav a.active::before {
  content: '';
  position: absolute;
  left: -2px;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 999px;
  background: linear-gradient(180deg, #818cf8 0%, #38bdf8 100%);
  box-shadow: 0 0 10px rgba(129,140,248,.4);
}

.nav-group-label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px 8px;
  margin-top: 2px;
  color: #b0bdd0;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  cursor: pointer;
  user-select: none;
  transition: color .15s ease;
}

.nav-group-label:hover {
  color: #cbd5e1;
}

.nav-group-label .nav-icon {
  display: grid;
  width: 20px;
  min-width: 20px;
  height: 20px;
  place-items: center;
  background: rgba(148,163,184,.12);
  border-radius: 5px;
  color: #94a3b8;
  font-size: 10px;
  line-height: 1;
  transition: background .15s ease, color .15s ease;
}

.nav-group-label:hover .nav-icon {
  background: rgba(99,102,241,.25);
  color: #cbd5e1;
}

.nav-group-arrow {
  margin-left: auto;
  font-size: 10px;
  line-height: 1;
  transition: transform .22s ease;
  flex-shrink: 0;
  color: #94a3b8;
}

.nav-group-label.is-collapsed .nav-group-arrow {
  transform: rotate(-90deg);
}

/* 分组横线 */
.nav-group-divider {
  height: 1px;
  margin: 0 16px 8px;
  background: linear-gradient(90deg, transparent, rgba(148,163,184,.18) 30%, rgba(148,163,184,.18) 70%, transparent);
}

/* 分组折叠时隐藏分隔线 */
.nav-group-label.is-collapsed + .nav-group-divider {
  display: none;
}

/* 子项容器 */
.nav-sub-group {
  display: grid;
  gap: 1px;
  margin: 0 8px 6px;
  max-height: 500px;
  opacity: 1;
  overflow: hidden;
  transition: max-height .3s ease, opacity .25s ease, margin .3s ease;
}

.nav-sub-group.is-collapsed {
  max-height: 0;
  opacity: 0;
  margin-top: 0;
  margin-bottom: 0;
  pointer-events: none;
}

/* 顶部导航（首页） */
.nav-top-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  margin-bottom: 8px;
  border-radius: 9px;
  color: #b0bdd0;
  font-size: 14px;
  font-weight: 600;
  transition: background .15s ease, color .15s ease;
  position: relative;
}

.nav-top-link.active::before {
  content: '';
  position: absolute;
  left: -2px;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 999px;
  background: var(--blue);
  box-shadow: 0 0 8px rgba(37,99,235,.5);
}

.nav-top-link.active,
.nav-top-link:hover {
  background: rgba(148,163,184,.12);
  color: #f1f5f9;
}

.nav-top-link .nav-icon {
  display: grid;
  width: 22px;
  min-width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 6px;
  background: rgba(148,163,184,.12);
  color: #94a3b8;
  font-size: 13px;
  line-height: 1;
  transition: background .15s ease, color .15s ease;
  flex-shrink: 0;
}

.nav-top-link.active .nav-icon,
.nav-top-link:hover .nav-icon {
  background: rgba(99,102,241,.25);
  color: #a5b4fc;
}

/* SVG icon in nav */
.nav-icon svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
  transition: stroke-width .2s ease;
}

/* 底部区域分隔 */
.nav-bottom-section {
  margin-top: auto;
  padding-top: 10px;
  display: grid;
  gap: 2px;
}

/* 底部链接（统一风格） */
.nav-bottom-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 9px;
  color: #cbd5e1;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: background .15s ease, color .15s ease;
  position: relative;
}

.nav-bottom-link:hover {
  background: rgba(148,163,184,.12);
  color: #e2e8f0;
}

.nav-bottom-link.active {
  color: #f1f5f9;
}

.nav-bottom-link.active::before {
  content: '';
  position: absolute;
  left: -2px;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 999px;
  background: #818cf8;
}

.nav-bottom-link .nav-icon {
  display: grid;
  width: 22px;
  min-width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 6px;
  background: rgba(148,163,184,.12);
  color: #94a3b8;
  transition: background .15s ease, color .15s ease;
  flex-shrink: 0;
}

.nav-bottom-link:hover .nav-icon,
.nav-bottom-link.active .nav-icon {
  background: rgba(99,102,241,.25);
  color: #a5b4fc;
}

.nav-sub-link {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 9px 14px 9px 28px;
  border-radius: 7px;
  color: #cbd5e1;
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  transition: background .15s ease, color .15s ease, padding-left .22s ease;
  position: relative;
  gap: 10px;
}

.nav-sub-link .nav-label {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
}

.nav-sub-link .nav-label-full {
  display: inline;
}

.nav-sub-link .nav-label-short {
  display: none;
}

.nav-sub-link.active {
  background: rgba(99, 102, 241, .28);
  color: #e0e7ff;
  font-weight: 600;
}

.nav-sub-link.active::before {
  content: '';
  position: absolute;
  left: -2px;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 999px;
  background: #818cf8;
}

.nav-sub-link:hover:not(.active) {
  background: rgba(148,163,184,.12);
  color: #e2e8f0;
  padding-left: 32px;
}

.nav-icon {
  display: grid;
  width: 22px;
  min-width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 6px;
  background: rgba(148,163,184,.12);
  color: #94a3b8;
  font-size: 14px;
  line-height: 1;
  transition: background .15s ease, color .15s ease;
}

.sidebar nav a.active:not(.nav-sub-link),
.sidebar nav a:hover:not(.nav-sub-link) {
  background: rgba(148,163,184,.12);
  color: #f1f5f9;
}

.main {
  margin-left: var(--sidebar-width);
  padding: 0 22px 22px;
  padding-top: 72px;
  transition: margin-left .22s cubic-bezier(.4,0,.2,1);
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
}

.topbar {
  position: fixed;
  top: 0;
  left: var(--sidebar-width);
  right: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  will-change: transform;
  gap: 10px;
  border-bottom: 1px solid rgba(203, 213, 240, 0.5);
  background: linear-gradient(180deg, rgba(255,255,255,.92) 0%, rgba(245,247,251,.88) 100%);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  min-height: 58px;
  padding: 8px 18px;
  box-shadow:
    0 2px 16px rgba(99, 102, 241, .06),
    0 1px 3px rgba(15, 23, 42, .04),
    0 0 0 1px rgba(255, 255, 255, .6) inset;
  flex-wrap: wrap;
  transition: left .22s cubic-bezier(.4,0,.2,1);
}

.title-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  min-width: 0;
  flex: 1 1 auto;
  margin-left: 14px;
  padding: 4px 0;
}

.title-row-inner {
  display: flex;
  align-items: baseline;
  gap: 12px;
  min-width: 0;
}

.title-row-inner h1 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.title-row-inner p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1 1 auto;
  min-width: 0;
}

.topbar-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 600;
  color: #6366f1;
  letter-spacing: .5px;
  margin-bottom: 2px;
}

.topbar-eyebrow-bar {
  display: inline-block;
  width: 22px;
  height: 2px;
  border-radius: 1px;
  background: linear-gradient(90deg, #6366f1 0%, #06b6d4 100%);
  flex-shrink: 0;
}


.workspace-head,
.control-panel,
.form-card,
.data-card {
  border: 1px solid rgba(203, 213, 240, .5);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255,255,255,.92) 0%, rgba(250,251,253,.88) 100%);
  backdrop-filter: blur(12px) saturate(160%);
  -webkit-backdrop-filter: blur(12px) saturate(160%);
  box-shadow: 0 2px 16px rgba(15, 23, 42, .04), 0 0 0 1px rgba(255,255,255,.6) inset;
  transition: box-shadow .25s ease, transform .2s ease, border-color .25s ease;
}
.workspace-head:hover,
.data-card:hover {
  border-color: rgba(165, 180, 252, .3);
  box-shadow: 0 6px 28px rgba(99, 102, 241, .06), 0 0 0 1px rgba(255,255,255,.8) inset;
  transform: translateY(-2px);
}

.global-exchange {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  flex-shrink: 0;
}

.exchange-rate {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(165, 180, 252, .25);
  border-radius: 10px;
  background: linear-gradient(135deg, #eef2ff 0%, #f0f5ff 50%, #f5f3ff 100%);
  padding: 6px 14px;
  white-space: nowrap;
}

.exchange-rate span {
  color: #5b6abf;
  font-size: 12px;
  font-weight: 600;
}

.exchange-rate small {
  color: #8b9cc9;
  font-size: 11px;
}

.exchange-rate strong {
  color: #1e1b4b;
  font-size: 18px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* 墨西哥时间 */
.mexico-time {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(125, 211, 252, .25);
  border-radius: 10px;
  background: linear-gradient(135deg, #ecfeff 0%, #f0f9ff 50%, #f0fdf4 100%);
  padding: 6px 14px;
  white-space: nowrap;
}
.mexico-time span {
  color: #5b8cbf;
  font-size: 12px;
  font-weight: 600;
}
.mexico-time strong {
  color: #164e63;
  font-size: 18px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  min-width: 68px;
}
.mexico-time small {
  color: #8b9cc9;
  font-size: 11px;
}

@media (max-width: 768px) {
  .mexico-time {
    padding: 4px 10px;
    gap: 6px;
  }
  .mexico-time strong {
    font-size: 14px;
    min-width: auto;
  }
  .mexico-time span,
  .mexico-time small {
    display: none;
  }
}

.exchange-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.icon-action {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid rgba(165, 180, 252, .3);
  border-radius: 8px;
  background: linear-gradient(135deg, #eef2ff 0%, #f5f3ff 100%);
  color: #6366f1;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, box-shadow .15s ease, transform .15s ease;
  padding: 0;
  flex-shrink: 0;
}

.icon-action:hover {
  background: linear-gradient(135deg, #dde4ff 0%, #ede9fe 100%);
  border-color: #a5b4fc;
  box-shadow: 0 2px 10px rgba(99, 102, 241, .12);
  transform: translateY(-1px);
}

.icon-action svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.currency-toggle {
  display: inline-flex;
  overflow: hidden;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #eff6ff;
  flex-shrink: 0;
}

.currency-toggle button {
  min-height: 34px;
  border: 0;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  padding: 6px 12px;
  transition: background .14s ease, color .14s ease;
  white-space: nowrap;
}

.currency-toggle button.active {
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  color: #ffffff;
  box-shadow: 0 1px 4px rgba(37,99,235,.3);
}

.workspace-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
  padding: 18px;
}

.workspace-head h2,
.section-title h2,
.data-card-head h2,
.modal-head h2 {
  margin: 0;
  font-size: 18px;
}

.workspace-head p,
.section-title p,
.data-card-head p,
.modal-head p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.eyebrow {
  display: block;
  margin-bottom: 5px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.primary-action,
.secondary-action,
.filter-bar button,
.store-form button,
.form-actions button,
.date-row button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  background: var(--blue);
  color: #fff;
  cursor: pointer;
  font-size: 14px;
  font-weight: 800;
  padding: 10px 16px;
}

.secondary-action {
  border: 1px solid #dbeafe;
  background: #eff6ff;
  color: var(--blue);
  font-weight: 700;
  transition: background .12s ease, border-color .12s ease;
  flex-shrink: 0;
  min-height: 34px;
  border-radius: 8px;
  padding: 6px 14px;
}

.secondary-action:hover {
  background: #dbeafe;
  border-color: #93c5fd;
}

.temp-action {
  border-color: #fbbf24;
  color: #92400e;
  background: #fffbeb;
}

.control-panel {
  margin-bottom: 14px;
  padding: 14px;
}

.store-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 10px;
}

.store-strip a {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #475467;
  font-size: 13px;
  font-weight: 800;
  padding: 8px 12px;
}

.store-strip a.active,
.store-strip a:hover {
  border-color: var(--blue);
  background: var(--blue-soft);
  color: var(--blue);
}

.filter-bar {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) repeat(2, 170px) auto;
  gap: 12px;
  align-items: end;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.purchase-stats {
  grid-template-columns: repeat(2, minmax(220px, 280px));
}

.overseas-stats {
  grid-template-columns: repeat(6, minmax(170px, 1fr));
}

.purchase-table-filter {
  min-width: 720px;
}

.purchase-sku-filter {
  display: grid;
  width: 140px;
  gap: 3px;
}

.purchase-sku-filter span {
  margin: 0;
  line-height: 1;
}

.purchase-sku-filter input {
  min-height: 34px;
  font-size: 12px;
  padding: 7px 9px;
}

.purchase-table table {
  min-width: 1680px;
}

.purchase-table th {
  background: #f3f7ff;
  color: #344054;
}

.purchase-table td:nth-child(3),
.purchase-table td:nth-child(4) {
  font-weight: 800;
}

.overseas-table table {
  min-width: 1080px;
}

.overseas-table th {
  background: #f3f7ff;
  color: #344054;
  text-align: center;
}

.overseas-table td {
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.overseas-table td:nth-child(1),
.overseas-table td:nth-child(2),
.overseas-table td:nth-child(9) {
  text-align: left;
}

.overseas-store-total td {
  border-top: 2px solid var(--line-strong);
  background: #f8fafc;
  font-weight: 900;
}

.overseas-store-total {
  cursor: pointer;
}

.overseas-store-total:hover td {
  background: #eef4ff;
}

.overseas-store-total.is-open td {
  background: #edf7ff;
}

.overseas-expand-btn {
  display: inline-grid;
  width: 22px;
  height: 22px;
  margin-right: 8px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--blue);
  cursor: pointer;
  font-size: 16px;
  font-weight: 900;
  line-height: 1;
  transition: transform .16s ease, background .16s ease;
}

.overseas-store-total.is-open .overseas-expand-btn {
  background: var(--blue);
  color: #fff;
}

.overseas-store-total.is-open .overseas-expand-btn span {
  transform: rotate(90deg);
}

.overseas-expand-btn span {
  display: block;
  transform-origin: center;
  transition: transform .16s ease;
}

.overseas-detail-row td {
  background: #fff;
}

.overseas-detail-row td:first-child {
  color: var(--muted);
  padding-left: 48px;
}

.operation-form {
  display: grid;
  grid-template-columns: minmax(150px, .8fr) minmax(130px, .7fr) minmax(220px, 1.2fr) minmax(130px, .7fr) minmax(150px, .8fr) minmax(220px, 1.2fr) auto auto;
  gap: 12px;
  align-items: end;
}

.operation-form .store-multi {
  width: 100%;
}

/* ===== 运营小组卡片布局 ===== */
.operation-groups {
  display: grid;
  gap: 10px;
}

.op-group-card {
  border: 1px solid rgba(203, 213, 240, .5);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255,255,255,.92) 0%, rgba(250,251,253,.9) 100%);
  box-shadow: 0 2px 12px rgba(15, 23, 42, .03);
  overflow: hidden;
  transition: border-color .25s ease, box-shadow .25s ease;
}

.op-group-card.is-open {
  border-color: rgba(165, 180, 252, .4);
  box-shadow: 0 4px 20px rgba(99, 102, 241, .06);
}

.op-group-header {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 14px;
  cursor: pointer;
  transition: background .12s ease;
  user-select: none;
}

.op-group-header:hover {
  background: #fbfdff;
}

.op-header-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.op-header-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
}
.op-header-row-top {
  font-size: 13px;
  color: var(--muted);
}
.op-header-row-bottom {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 6px;
}
.op-meta-sep {
  color: #d1d5db;
  font-size: 10px;
}

.op-expand-btn {
  display: inline-grid;
  width: 24px;
  min-width: 24px;
  height: 24px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--blue);
  cursor: pointer;
  font-size: 16px;
  font-weight: 900;
  line-height: 1;
  transition: background .14s ease, color .14s ease, transform .14s ease;
  flex-shrink: 0;
  margin-top: 1px;
}

.op-group-card.is-open .op-expand-btn {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
}

.op-expand-btn span {
  display: block;
  transition: transform .16s ease;
}

.op-group-card.is-open .op-expand-btn span {
  transform: rotate(90deg);
}

/* 小组名称 */
.op-group-name {
  font-size: 15px;
  font-weight: 900;
  color: var(--text);
}

/* 元信息 */
.op-meta-label {
  font-weight: 700;
  font-size: 12px;
  color: var(--muted);
}

.op-meta-value {
  color: var(--text);
  font-weight: 800;
  font-size: 13px;
}

.op-target-label {
  margin-right: -2px;
}

/* 内联编辑 - 下拉选择 */
.op-inline-select {
  width: 96px;
  min-height: 26px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  color: var(--blue);
  font-size: 11px;
  font-weight: 800;
  padding: 2px 18px 2px 5px;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%232563eb'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 3px center;
  transition: border-color .14s ease, background .14s ease;
}

.op-inline-select:hover,
.op-inline-select:focus {
  border-color: var(--line);
  background-color: #fff;
  outline: none;
}

/* 内联编辑 - 数字输入 */
.op-inline-input {
  width: 100px;
  min-height: 26px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  padding: 2px 5px;
  text-align: left;
  transition: border-color .14s ease, background .14s ease;
}

.op-inline-input:hover,
.op-inline-input:focus {
  border-color: var(--line);
  background-color: #fff;
  outline: none;
}

.op-inline-input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, .1);
}

/* 内联保存反馈 */
.op-inline-select.saved,
.op-inline-input.saved {
  border-color: var(--green) !important;
  background-color: var(--green-soft) !important;
  transition: border-color .14s ease, background .14s ease;
}

/* 操作按钮区 */
.op-group-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  margin-left: auto;
}

.op-group-actions button {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--blue);
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
  padding: 4px 8px;
  white-space: nowrap;
  line-height: 1.4;
}

.btn-delete-group {
  color: var(--red) !important;
}

/* ===== 组员面板 ===== */
.op-member-panel {
  border-top: 1px solid #dbeafe;
  background: #f8fbff;
  padding: 14px 16px;
}

.op-member-panel[hidden] {
  display: none;
}

.op-member-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 10px;
}

.op-member-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.op-member-card.empty-card {
  border-style: dashed;
  border-color: var(--line-strong);
  background: transparent;
}

.op-member-card.empty-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
  padding: 16px 0;
}

.op-member-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.op-member-identity {
  display: flex;
  align-items: center;
  gap: 8px;
}

.op-member-identity strong {
  font-size: 14px;
  font-weight: 900;
}

/* ===== 考核配置区域（紧凑） ===== */
.op-assessment-section {
  border-top: 1px solid #e0e7ff;
  background: #f8fbff;
  padding: 8px 12px;
}
.op-assessment-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.op-assessment-card {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  padding: 7px 8px;
  transition: border-color .14s ease, box-shadow .14s ease;
}
.op-assessment-card.is-unset {
  border-style: dashed;
  border-color: #d1d5db;
  background: #fafcff;
}
.op-assessment-card.is-configured {
  border-left: 3px solid var(--blue);
}
.op-assessment-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 5px;
}
.op-assessment-card-title {
  font-size: 11px;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .3px;
}
.assessment-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.assessment-dot.configured {
  background: var(--green);
  box-shadow: 0 0 0 2px rgba(19, 135, 99, .15);
}
.assessment-dot.unset {
  background: #d1d5db;
}
.op-assessment-card-body {
  display: flex;
  align-items: center;
  gap: 4px;
}
.op-assessment-card-body .op-inline-select {
  width: 0;
  flex: 1;
  min-height: 24px;
  font-size: 10px;
  padding: 1px 16px 1px 4px;
  background-position: right 2px center;
}
.op-assessment-card-body .op-inline-input {
  width: 60px;
  min-height: 24px;
  font-size: 11px;
  padding: 1px 4px;
  flex-shrink: 0;
}

/* ===== 编辑弹窗 - 周期考核 ===== */
.op-modal-periods {
  grid-column: 1 / -1;
  margin-top: 4px;
}
.assessment-section-label {
  font-size: 13px;
  font-weight: 800;
  color: var(--blue);
  margin-bottom: 10px;
}
.op-modal-periods-grid {
  display: grid;
  gap: 10px;
}
.op-modal-period-row {
  display: grid;
  grid-template-columns: 60px 1fr 1fr;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}
.op-modal-period-label {
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
  white-space: nowrap;
}

.op-role-badge {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  padding: 3px 8px;
}

.op-role-badge.leader {
  border-color: #93c5fd;
  background: #eff6ff;
  color: #1d4ed8;
}

.op-member-card-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.op-member-card-actions button,
.op-member-card-actions .btn-delete-member {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--blue);
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
  padding: 4px 8px;
}

.btn-delete-member {
  color: var(--red) !important;
}

.op-member-card-stores {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.op-store-tag {
  display: inline-flex;
  align-items: center;
  border: 1px solid #dbeafe;
  border-radius: 5px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 7px;
}

.op-store-tag.empty {
  border-color: var(--line);
  background: var(--panel-soft);
  color: var(--muted);
}

/* ===== 空状态 ===== */
.op-empty-state {
  text-align: center;
  padding: 40px 16px;
  color: var(--muted);
  font-size: 14px;
}

/* ===== 弹窗 ===== */
.operation-modal-card {
  width: min(660px, calc(100vw - 28px));
}

.operation-modal-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 12px;
}

.operation-modal-form .full-span,
.operation-modal-form .modal-actions {
  grid-column: 1 / -1;
}

/* 组员弹窗（含店铺绑定） */
.operation-member-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.op-member-form-body {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 20px;
  align-items: start;
}

.op-member-name-field {
  display: flex;
  flex-direction: column;
}

.op-member-name-field label {
  width: 100%;
}

.op-member-store-field {
  display: flex;
  flex-direction: column;
}

.op-bind-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.op-bind-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.op-bind-count {
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.op-bind-count.is-empty {
  color: var(--muted);
}

.op-bind-store-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(90px, 1fr));
  gap: 7px;
  max-height: 256px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  padding: 10px;
}

.op-bind-store-item {
  display: flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  padding: 8px 9px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: border-color .14s ease, background .14s ease;
}

.op-bind-store-item:hover {
  border-color: var(--blue);
  background: #f8faff;
}

.op-bind-store-item:has(input:checked) {
  border-color: var(--blue);
  background: var(--blue-soft);
  color: var(--blue);
}

.op-bind-store-item input {
  width: 16px;
  min-height: 16px;
  cursor: pointer;
}

.op-bind-store-item span {
  font-weight: 700;
}

.op-bind-actions {
  display: flex;
  gap: 8px;
  margin: 10px 0 0;
}

.op-bind-actions button {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: #475467;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  padding: 6px 12px;
  transition: border-color .14s ease, color .14s ease;
}

.op-bind-actions button:hover {
  border-color: var(--blue);
  color: var(--blue);
}

.metric-badge {
  display: inline-flex;
  min-width: 54px;
  justify-content: center;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  padding: 5px 8px;
}

/* ===== Dashboard ===== */
.dashboard-filter {
  display: flex;
  align-items: center;
}

.chart-wrap {
  position: relative;
  width: 100%;
  height: 280px;
}

.chart-legend {
  display: flex;
  gap: 14px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.legend-item i {
  display: inline-block;
  width: 14px;
  height: 4px;
  border-radius: 999px;
}

.dashboard-row {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}

@media (max-width: 980px) {
  .dashboard-row {
    grid-template-columns: 1fr;
  }
}

.dashboard-col .data-card {
  margin-bottom: 0;
  height: 100%;
}

/* 小组排行 */
.group-rank-list {
  display: grid;
  gap: 0;
}

.group-rank-head {
  display: grid;
  grid-template-columns: 40px 1.2fr 80px 1.2fr 1fr 1fr;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.group-rank-row {
  display: grid;
  grid-template-columns: 40px 1.2fr 80px 1.2fr 1fr 1fr;
  gap: 8px;
  align-items: center;
  padding: 10px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  transition: background .1s ease;
}

.group-rank-row:last-child {
  border-bottom: 0;
}

.group-rank-row:hover {
  background: #f8fafc;
}

.rank-num {
  text-align: center;
  font-weight: 900;
  font-size: 14px;
  color: var(--muted);
}

.group-rank-row:first-child .rank-num {
  color: #d97706;
  font-size: 18px;
}

.group-rank-row:nth-child(2) .rank-num {
  color: #94a3b8;
  font-size: 16px;
}

.group-rank-row:nth-child(3) .rank-num {
  color: #cd7f32;
  font-size: 15px;
}

.name-col strong {
  display: block;
  font-size: 14px;
  line-height: 1.2;
}

.name-col small {
  color: var(--muted);
  font-size: 11px;
}

.rank-progress-track {
  display: inline-block;
  width: 72px;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5e7eb;
  vertical-align: middle;
}

.rank-progress-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
  transition: width .3s ease;
}

.group-rank-row:first-child .rank-progress-track i {
  background: linear-gradient(90deg, #d97706, #f59e0b);
}

.progress-col {
  display: flex;
  align-items: center;
  gap: 8px;
}

.progress-col b {
  font-variant-numeric: tabular-nums;
  font-size: 13px;
}

.target-col,
.achieved-col {
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

/* 各店铺排行榜 */
.rank-tabs {
  display: flex;
  gap: 4px;
}
.rank-tab {
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all .15s;
  display: flex;
  align-items: center;
  gap: 4px;
  position: relative;
}
.rank-tab:hover { border-color: var(--blue); color: var(--blue); }
.rank-tab.active { background: var(--blue); color: #fff; border-color: var(--blue); }
.rank-tab-hint {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #e2e8f0;
  color: #64748b;
  font-size: 10px;
  font-weight: 800;
}
.rank-tab.active .rank-tab-hint { background: rgba(255,255,255,.25); color: #fff; }

.rank-list {
  margin-top: 6px;
}
.rank-tab-content { display: none; }
.rank-tab-content.active { display: block; }

.rank-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px 8px;
  font-size: 11px;
  font-weight: 800;
  color: var(--muted);
  border-bottom: 2px solid var(--line);
  margin-bottom: 4px;
}
.rank-h-rank { width: 44px; flex-shrink: 0; }
.rank-h-name { flex: 1; min-width: 0; }
.rank-h-value { text-align: right; flex-shrink: 0; }

.rank-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 8px;
  border-radius: 6px;
  transition: background .15s;
}
.rank-row:hover { background: var(--panel-soft); }
.rank-row.top-1 { background: #fef9e7; }
.rank-row.top-2 { background: #f1f5f9; }
.rank-row.top-3 { background: #fef7ed; }
.rank-row.top-1:hover { background: #fdf3d4; }
.rank-row.top-2:hover { background: #e5eaf2; }
.rank-row.top-3:hover { background: #fcede0; }

.rank-num {
  width: 44px;
  min-width: 44px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 900;
  background: #f1f5f9;
  color: #64748b;
}
.rank-row.top-1 .rank-num { background: #fef3c7; color: #d97706; font-size: 18px; }
.rank-row.top-2 .rank-num { background: #e2e8f0; color: #64748b; font-size: 18px; }
.rank-row.top-3 .rank-num { background: #fde8d0; color: #c2410c; font-size: 18px; }

.rank-name {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-val {
  flex-shrink: 0;
  text-align: right;
  font-size: 12px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.risk-danger {
  color: var(--red);
}

.risk-warn {
  color: var(--orange);
}

.dashboard-summary {
  margin-bottom: 0;
}

.target-value {
  color: var(--text);
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.row-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.row-actions a,
.row-actions button {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--blue);
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
  padding: 6px 9px;
  text-decoration: none;
}

.row-actions button {
  color: var(--red);
}

.statistics-head {
  align-items: center;
}

.statistics-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: flex-end;
  gap: 8px;
}

.statistics-filter label {
  width: 120px;
}

.report-switch {
  display: inline-flex;
  overflow: hidden;
  align-self: end;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.report-switch button {
  min-height: 38px;
  border: 0;
  border-right: 1px solid var(--line);
  background: #fff;
  color: #475467;
  cursor: pointer;
  font-size: 13px;
  font-weight: 900;
  padding: 8px 14px;
}

.report-switch button:last-child {
  border-right: 0;
}

.report-switch button.active {
  background: linear-gradient(180deg, #fff5cf 0%, #edc24a 100%);
  color: #6b4700;
}

.statistics-table table {
  width: max-content;
  min-width: max-content;
  max-width: none;
  margin-right: 22px;
  table-layout: auto;
}

.statistics-table .stat-col-store { width: 96px; }
.statistics-table .stat-col-operator { width: 108px; }

.statistics-table th,
.statistics-table td {
  min-width: 86px;
  padding: 7px 9px;
  font-size: 12px;
  line-height: 1.3;
  white-space: nowrap;
}

.statistics-table th {
  text-align: center;
  vertical-align: middle;
}

.statistics-table td {
  text-align: right;
  vertical-align: middle;
}

.statistics-table td:empty {
  color: var(--muted);
  text-align: center;
}

.statistics-table td:empty::before {
  content: "-";
}

.statistics-table .currency-cell,
.statistics-table .currency-cny-cell,
.statistics-table .statistics-deduction-total,
.statistics-table .statistics-actual-profit {
  min-width: 106px;
  font-variant-numeric: tabular-nums;
}

.statistics-table .statistics-actual-profit-rate {
  min-width: 88px;
  font-variant-numeric: tabular-nums;
}

.statistics-table .sticky-store {
  left: 0;
  width: 96px;
  min-width: 96px;
  max-width: 96px;
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
}

.statistics-table .sticky-operator {
  left: 96px;
  width: 108px;
  min-width: 108px;
  max-width: 108px;
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
  z-index: 6;
}

.statistics-table .sticky-basic-span {
  left: 0;
  width: 204px;
  min-width: 204px;
  max-width: 204px;
  z-index: 14;
  text-align: center;
}

.statistics-table thead tr:nth-child(2) .sticky-store,
.statistics-table thead tr:nth-child(2) .sticky-operator {
  z-index: 13;
  text-align: center;
}

.statistics-table tbody .sticky-store,
.statistics-table tbody .sticky-operator {
  z-index: 7;
}

.statistics-table .sticky-store,
.statistics-table .sticky-operator,
.statistics-table .sticky-basic-span {
  background-clip: padding-box;
  box-shadow: 1px 0 0 var(--line);
}

.statistics-table .sticky-store,
.statistics-table .sticky-operator {
  padding-left: 10px;
  padding-right: 10px;
}

.statistics-table .group-row th {
  height: 34px;
  padding: 6px 8px;
  font-size: 12px;
}

.statistics-table thead tr:nth-child(2) th {
  height: 44px;
  white-space: normal;
  word-break: keep-all;
}

.statistics-table tbody td {
  height: 34px;
}

.statistics-table tfoot td {
  height: 36px;
  border-top: 2px solid var(--line-strong);
  background: #f8fafc;
  font-weight: 900;
}

.statistics-table tfoot .sticky-store,
.statistics-table tfoot .sticky-operator {
  z-index: 8;
}

.statistics-table th:last-child,
.statistics-table td:last-child {
  padding-right: 24px;
}

.statistics-table .stat-wide-col {
  min-width: 132px;
}

.statistics-table .stat-text-wide {
  min-width: 112px;
}

.statistics-table .th-label {
  display: inline-block;
  max-width: 92px;
  white-space: normal;
}

.statistics-table .formula-source-icon {
  margin-left: 4px;
  vertical-align: middle;
}

.statistics-table::after {
  position: sticky;
  right: 0;
  display: block;
  width: 14px;
  height: 1px;
  content: "";
}

.operation-task-card {
  margin-top: 16px;
}

.operation-task-table table {
  min-width: 1500px;
}

.operation-task-table th {
  height: 42px;
  background: #f3f7ff;
  color: #344054;
  text-align: center;
  white-space: normal;
}

.operation-task-table td {
  height: 38px;
  font-variant-numeric: tabular-nums;
  text-align: right;
  vertical-align: middle;
}

.operation-task-table .task-text-cell,
.operation-task-table .task-operator-cell {
  text-align: left;
}

.operation-task-table .task-text-cell {
  min-width: 110px;
}

.operation-task-table .task-operator-cell {
  min-width: 240px;
  max-width: 360px;
  overflow-wrap: anywhere;
  white-space: normal;
}

.operation-task-table .task-store-cell {
  min-width: 220px;
  max-width: 320px;
  overflow-wrap: anywhere;
  text-align: left;
  white-space: normal;
}

.operation-task-target,
.operation-task-remaining,
.operation-task-actual-profit {
  min-width: 118px;
  font-weight: 900;
}

.operation-task-margin {
  min-width: 92px;
  font-weight: 900;
}

.operation-task-progress {
  min-width: 180px;
}

.task-progress-track {
  display: inline-block;
  width: 96px;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5e7eb;
  vertical-align: middle;
}

.task-progress-track i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
}

.operation-task-progress.is-complete .task-progress-track i {
  background: var(--green);
}

.operation-task-progress b {
  display: inline-block;
  min-width: 62px;
  margin-left: 8px;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

label span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

input,
select {
  width: 100%;
  min-height: 25px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-size: 13px;
  padding: 8px 10px;
}

input:focus,
select:focus {
  border-color: var(--blue);
  outline: 2px solid rgba(37, 99, 235, .12);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.dashboard-kpi-5 {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

@media (max-width: 1300px) {
  .dashboard-kpi-5 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .dashboard-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .overseas-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1100px) {
  .dashboard-kpi-5 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.stat-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, .82);
  backdrop-filter: blur(8px) saturate(140%);
  -webkit-backdrop-filter: blur(8px) saturate(140%);
  padding: 14px;
  box-shadow: 0 1px 8px rgba(15,23,42,.03);
  transition: box-shadow .2s ease, transform .15s ease;
}
.stat-card:hover {
  box-shadow: 0 3px 16px rgba(15,23,42,.06);
  transform: translateY(-1px);
}

.stat-card span,
.stat-card small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.stat-card strong {
  display: block;
  margin: 8px 0 4px;
  font-size: 22px;
  line-height: 1.1;
}

.stat-card.blue { border-top: 3px solid var(--blue); }
.stat-card.green { border-top: 3px solid var(--green); }
.stat-card.red { border-top: 3px solid var(--red); }
.stat-card.orange { border-top: 3px solid var(--orange); }
.stat-card.red-soft { border-top: 3px solid #f43f5e; background: #fff5f7; }

.data-card,
.form-card {
  margin-bottom: 14px;
  padding: 16px;
  max-width: 100%;
}

.data-card {
  min-width: 0;
}

.data-card-head,
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.data-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.data-card-title {
  flex: 0 0 auto;
  min-width: 200px;
}

.data-card-head-spacer {
  display: none;
}

.table-hint {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-soft);
  color: var(--muted);
  cursor: default;
  font-size: 12px;
  font-weight: 800;
  padding: 7px 10px;
}

.table-fullscreen-btn {
  flex: 0 0 auto;
  border-color: #d6a73a;
  background: linear-gradient(180deg, #fff7d6 0%, #f3c94e 100%);
  color: #6b4700;
  cursor: pointer;
  box-shadow: 0 7px 16px rgba(214, 167, 58, 0.22);
}

.table-fullscreen-btn:hover {
  border-color: #b98509;
  background: linear-gradient(180deg, #fff2bd 0%, #e6b42c 100%);
  color: #563800;
}

.fullscreen-icon {
  margin-right: 6px;
  font-size: 13px;
}

.table-filter-panel {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin: 0;
  min-width: 0;
  max-width: 100%;
  flex-wrap: wrap;
}

.store-multi {
  position: relative;
  display: grid;
  width: 138px;
  gap: 3px;
}

.store-multi-caption {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}

.store-multi-trigger {
  display: flex;
  width: 100%;
  min-height: 34px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  padding: 7px 9px;
}

.store-multi-trigger span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.store-multi-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 30;
  display: grid;
  width: 190px;
  max-height: 260px;
  gap: 4px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
  padding: 8px;
}

.store-multi-menu[hidden] {
  display: none;
}

.store-multi-menu label {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  gap: 7px;
  align-items: center;
  border-radius: 6px;
  cursor: pointer;
  padding: 6px;
}

.store-multi-menu label:hover {
  background: var(--panel-soft);
}

.store-multi-menu input {
  width: 16px;
  min-height: 16px;
}

.store-multi-menu span {
  margin: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.store-multi-actions {
  position: sticky;
  bottom: -8px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin: 4px -2px -2px;
  border-top: 1px solid var(--line);
  background: #fff;
  padding: 8px 2px 2px;
}

.store-multi-actions button {
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: #475467;
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
  padding: 5px 6px;
}

.store-multi-actions button:hover {
  border-color: var(--blue);
  background: var(--blue-soft);
  color: var(--blue);
}

.table-filter-dates {
  display: grid;
  gap: 4px;
}

.date-inputs {
  display: grid;
  grid-template-columns: repeat(2, 128px);
  gap: 5px;
}

.date-inputs input {
  min-height: 32px;
  font-size: 12px;
  padding: 6px 8px;
}

.quick-date-actions {
  display: grid;
  grid-template-columns: repeat(6, 42px);
  gap: 4px;
}

.quick-date-actions button {
  min-height: 26px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: #475467;
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
  padding: 4px 5px;
}

.quick-date-actions button:hover {
  border-color: var(--blue);
  background: var(--blue-soft);
  color: var(--blue);
}

.quick-date-actions button.active {
  border-color: #d6a73a;
  background: linear-gradient(180deg, #fff5cf 0%, #edc24a 100%);
  color: #6b4700;
  box-shadow: inset 0 0 0 1px rgba(118, 76, 0, 0.12);
}

.table-filter-submit {
  min-height: 34px;
  padding: 8px 15px;
}

.lazy-status {
  position: sticky;
  left: 0;
  display: grid;
  min-height: 42px;
  place-items: center;
  border-top: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.data-card:fullscreen {
  display: flex;
  flex-direction: column;
  width: 100vw;
  height: 100vh;
  margin: 0;
  border-radius: 0;
  background: #fff;
  padding: 16px;
}

.data-card:fullscreen .table-wrap {
  flex: 1;
  max-height: none;
  min-height: 0;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.data-card .table-wrap {
  max-height: max(420px, calc(100vh - 260px));
  min-height: 420px;
  overflow: auto;
}

.data-card .table-wrap::-webkit-scrollbar {
  width: 14px;
  height: 14px;
}

.data-card .table-wrap::-webkit-scrollbar-track {
  background: #edf2f7;
  border-radius: 999px;
}

.data-card .table-wrap::-webkit-scrollbar-thumb {
  border: 3px solid #edf2f7;
  border-radius: 999px;
  background: #94a3b8;
}

.data-card .table-wrap::-webkit-scrollbar-thumb:hover {
  background: #7a8aa3;
}

/* 合计行 */
.report-tfoot td {
  position: sticky;
  bottom: 0;
  z-index: 10;
  border-top: 2px solid var(--line-strong);
  background: #f0f4ff !important;
  font-weight: 900;
  box-shadow: 0 -1px 0 var(--line-strong);
}

/* 数据锁图标 */
.lock-icon {
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-right: 4px;
  vertical-align: -2px;
  cursor: pointer;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2322c55e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='11' width='18' height='11' rx='2' ry='2'/%3E%3Cpath d='M7 11V7a5 5 0 0110 0v4'/%3E%3C/svg%3E") no-repeat center/contain;
}
.lock-icon.locked {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ef4444' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='11' width='18' height='11' rx='2' ry='2'/%3E%3Cpath d='M7 11V7a5 5 0 0110 0v4'/%3E%3C/svg%3E");
}
.lock-icon:hover {
  opacity: .8;
}

/* 数据锁悬浮提示（fixed 顶层） */
.lock-tip {
  position: fixed;
  z-index: 999999;
  padding: 6px 12px;
  border-radius: 6px;
  background: #1e293b;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  line-height: 1.4;
  pointer-events: none;
  box-shadow: 0 4px 16px rgba(0,0,0,.3);
}
.lock-tip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -5px;
  border: 5px solid transparent;
  border-top-color: #1e293b;
}

/* 右上角浮出提示 */
.lock-toast {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 99999;
  padding: 12px 22px 12px 46px;
  border-radius: 10px;
  background: #1e293b;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
  box-shadow: 0 8px 28px rgba(0,0,0,.2);
  opacity: 0;
  transform: translateX(40px) scale(.95);
  transition: opacity .3s, transform .3s cubic-bezier(.34,1.56,.64,1);
  pointer-events: none;
}
.lock-toast::before {
  content: '✓';
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #22c55e;
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.lock-toast.show {
  opacity: 1;
  transform: translateX(0) scale(1);
}

/* 通知条 */
.notice-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  padding: 10px 14px;
  border: 1px solid #facc15;
  border-radius: 8px;
  background: #fefce8;
  color: #92400e;
  font-size: 13px;
}
.notice-bar.warning {
  border-color: #f59e0b;
  background: #fffbeb;
}

/* 只读字段 */
.readonly-field {
  display: flex;
  align-items: center;
  min-height: 38px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 14px;
}

.all-data-table table {
  table-layout: fixed;
  will-change: scroll-position;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 8px 9px;
  font-size: 12px;
  text-align: left;
  white-space: nowrap;
}

th {
  position: sticky;
  top: 0;
  z-index: 5;
  height: 34px;
  background: linear-gradient(180deg, #eef2ff 0%, #e8edf8 100%);
  will-change: transform;
  color: #4338ca;
  font-size: 12px;
  font-weight: 800;
}

th .th-label {
  vertical-align: middle;
}

.bi-source-icon {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 16px;
  margin-left: 4px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  background: #eef2f7;
  color: #64748b;
  cursor: default;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  vertical-align: middle;
}

.bi-source-icon::after {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  z-index: 50;
  width: max-content;
  max-width: 180px;
  transform: translateX(-50%);
  border-radius: 6px;
  background: #111827;
  color: #fff;
  content: attr(data-tip);
  opacity: 0;
  pointer-events: none;
  padding: 6px 8px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
}

.bi-source-icon::before {
  position: absolute;
  bottom: calc(100% + 3px);
  left: 50%;
  z-index: 51;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: #111827;
  content: "";
  opacity: 0;
  pointer-events: none;
}

.bi-source-icon:hover::after,
.bi-source-icon:hover::before {
  opacity: 1;
}

.formula-source-icon {
  border-color: #d6a73a;
  background: #fff5cf;
  color: #8a5a00;
}

.formula-source-icon::after,
.formula-source-icon::before {
  display: none;
}

.formula-source-icon .formula-card {
  display: none;
}

.formula-floating-card {
  position: fixed;
  box-sizing: border-box;
  display: grid;
  width: min(340px, calc(100vw - 24px));
  max-height: min(360px, calc(100vh - 24px));
  gap: 7px;
  overflow: auto;
  border: 1px solid #f3d27a;
  border-radius: 10px;
  background: #fffdf7;
  box-shadow: 0 18px 38px rgba(15, 23, 42, 0.18);
  color: #344054;
  opacity: 0;
  pointer-events: none;
  padding: 11px 12px;
  text-align: left;
  z-index: 2147483647;
}

.formula-floating-card::before {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  content: "";
}

.formula-floating-card.is-visible {
  opacity: 1;
}

.formula-floating-card.is-below::before {
  top: -10px;
  border-bottom-color: #f3d27a;
}

.formula-floating-card.is-above::before {
  bottom: -10px;
  border-top-color: #f3d27a;
}

.formula-card-eyebrow {
  width: fit-content;
  border-radius: 999px;
  background: #fff0b5;
  color: #8a5a00;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  padding: 4px 7px;
}

.formula-card strong,
.formula-floating-card strong {
  color: #111827;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.2;
}

.formula-card code,
.formula-floating-card code {
  display: block;
  border: 1px solid #fde68a;
  border-radius: 8px;
  background: #fffbeb;
  color: #7c2d12;
  font-family: inherit;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.45;
  overflow-wrap: anywhere;
  padding: 8px;
  white-space: normal;
}

.formula-card small,
.formula-floating-card small {
  color: #667085;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.group-row th {
  top: 0;
  height: 32px;
  background: #eef4ff;
  color: #1d4ed8;
  text-align: center;
}

thead tr:nth-child(2) th {
  top: 32px;
  z-index: 5;
}

tbody tr:hover td {
  background: #fbfdff;
}

th.group-basic,
td.group-basic { background: #f8fafc; }
th.group-actual_profit,
td.group-actual_profit { background: #fff9e8; }
th.group-profit,
td.group-profit { background: #f3f7ff; }
th.group-movement,
td.group-movement { background: #f1fbf7; }
th.group-inventory,
td.group-inventory { background: #fff8ed; }
th.group-monthly,
td.group-monthly { background: #f7f3ff; }
th.group-slow,
td.group-slow { background: #fff3f4; }
th.group-store_deductions,
td.group-store_deductions { background: #f4f7fb; }
th.group-discard_loss,
td.group-discard_loss { background: #f1fbff; }
th.group-other_deductions,
td.group-other_deductions { background: #fff7f2; }
th.group-action,
td.group-action { background: #f8fafc; }

.group-row th.group-basic { background: #e9eef6; color: #344054; }
.group-row th.group-actual_profit { background: #fde68a; color: #92400e; }
.group-row th.group-profit { background: #dbeafe; color: #1d4ed8; }
.group-row th.group-movement { background: #dcfce7; color: #15803d; }
.group-row th.group-inventory { background: #ffedd5; color: #c2410c; }
.group-row th.group-monthly { background: #ede9fe; color: #6d28d9; }
.group-row th.group-slow { background: #ffe4e6; color: #be123c; }
.group-row th.group-store_deductions { background: #e2e8f0; color: #475569; }
.group-row th.group-discard_loss { background: #dff6ff; color: #0369a1; }
.group-row th.group-other_deductions { background: #ffedd5; color: #9a3412; }
.group-row th.group-action { background: #e9eef6; color: #344054; }

tbody tr:hover td.group-basic,
tbody tr:hover .sticky-col.group-basic { background: #eef2f7; }
tbody tr:hover td.group-actual_profit { background: #fff3cc; }
tbody tr:hover td.group-profit { background: #eaf1ff; }
tbody tr:hover td.group-movement { background: #e8f8f1; }
tbody tr:hover td.group-inventory { background: #fff1dd; }
tbody tr:hover td.group-monthly { background: #f0ebff; }
tbody tr:hover td.group-slow { background: #ffe9eb; }
tbody tr:hover td.group-store_deductions { background: #edf2f7; }
tbody tr:hover td.group-discard_loss { background: #e8f8ff; }
tbody tr:hover td.group-other_deductions { background: #fff0e8; }
tbody tr:hover td.group-action { background: #eef2f7; }

.sticky-col {
  position: sticky;
  z-index: 6;
  background: #fff;
  box-shadow: 1px 0 0 var(--line);
  overflow: hidden;
  will-change: transform;
  text-overflow: ellipsis;
}

.sticky-store {
  left: 0;
  width: 90px;
  min-width: 90px;
  max-width: 90px;
  overflow: visible;
}

.sticky-date {
  left: 90px;
  width: 92px;
  min-width: 92px;
  max-width: 92px;
}

thead .sticky-col,
.group-row .sticky-col {
  z-index: 10;
}

thead .sticky-date {
  z-index: 10;
}

thead tr:nth-child(2) .sticky-col {
  z-index: 12;
}

.group-row .sticky-store {
  z-index: 13;
}

tbody .sticky-date {
  box-shadow: 1px 0 0 var(--line);
}

tbody tr:hover .sticky-col {
  background: #fbfdff;
}

.strong-cell {
  font-weight: 800;
}

.text-good {
  color: var(--green);
  font-weight: 800;
}

.text-danger {
  color: var(--red);
  font-weight: 800;
}

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

.actions a {
  color: var(--blue);
  font-weight: 800;
}

.actions button {
  border: 0;
  background: transparent;
  color: var(--red);
  cursor: pointer;
  font-weight: 800;
  padding: 0;
}

.empty {
  color: var(--muted);
  text-align: center;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 12px;
}

.base-grid {
  grid-template-columns: repeat(2, minmax(220px, 1fr));
}

.store-form {
  display: grid;
  grid-template-columns: minmax(160px, 1.2fr) minmax(160px, 1fr) minmax(150px, 1fr) minmax(120px, .7fr) auto;
  gap: 12px;
  align-items: end;
}

.store-edit-list {
  display: grid;
  gap: 8px;
}

.store-edit-head,
.store-edit-row {
  display: grid;
  grid-template-columns: 48px minmax(160px, 1.2fr) minmax(160px, 1fr) minmax(140px, 1fr) minmax(110px, .7fr) auto;
  gap: 8px;
  align-items: center;
}

.store-edit-head {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  padding: 0 4px;
}

.store-edit-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  padding: 8px;
}

.store-id-label {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.table-button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--blue);
  cursor: pointer;
  font-weight: 800;
  padding: 8px 13px;
}

.field-section.profit { border-left: 3px solid var(--blue); }
.field-section.movement { border-left: 3px solid var(--green); }
.field-section.inventory { border-left: 3px solid var(--orange); }
.field-section.slow { border-left: 3px solid var(--red); }

.sticky-base {
  position: sticky;
  top: 0;
  z-index: 10;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.form-actions a {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-weight: 800;
  padding: 10px 16px;
}

.sticky-actions {
  position: sticky;
  bottom: 0;
  border-top: 1px solid var(--line);
  background: rgba(245, 247, 251, .94);
  padding: 12px 0;
  backdrop-filter: blur(10px);
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  background: rgba(15, 23, 42, .42);
  padding: 22px;
}

.modal-overlay[hidden] {
  display: none;
}

.modal-card {
  width: min(920px, 100%);
  max-height: calc(100vh - 44px);
  overflow: auto;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 28px 80px rgba(15, 23, 42, .26);
  padding: 20px;
}

.compact-modal {
  width: min(620px, 100%);
}

.rate-card {
  width: min(460px, 100%);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 28px 80px rgba(15, 23, 42, .26);
  padding: 20px;
}

.rate-form {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.rate-form button {
  min-height: 38px;
  border: 0;
  border-radius: 8px;
  background: var(--blue);
  color: #fff;
  cursor: pointer;
  font-weight: 800;
  padding: 8px 14px;
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.icon-button {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #475467;
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
}

.sync-modal-form {
  display: grid;
  gap: 14px;
}

.sync-store-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  padding: 12px;
}

.sync-store-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.sync-store-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.sync-store-head button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--blue);
  cursor: pointer;
  font-weight: 800;
  padding: 7px 10px;
}

.sync-store-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}

.check-row {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  gap: 7px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  min-height: 36px;
  padding: 7px 9px;
}

.check-row input {
  min-height: 16px;
  width: 16px;
}

.check-row span {
  margin: 0;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.check-row small {
  grid-column: 2;
  color: var(--muted);
  display: none;
}

.date-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(160px, 1fr)) auto;
  gap: 12px;
  align-items: end;
}

.sync-warning {
  color: var(--orange);
  font-weight: 800;
}

.quick-sync-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.quick-sync-date,
.quick-sync-meta {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  padding: 12px;
}

.quick-sync-date span,
.quick-sync-meta span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.quick-sync-date strong,
.quick-sync-meta strong {
  color: var(--text);
  font-size: 20px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}

button:disabled {
  cursor: not-allowed;
  opacity: .58;
}

.progress-box {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  padding: 12px;
}

.progress-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #475467;
  font-size: 13px;
  font-weight: 800;
}

.progress-track {
  height: 10px;
  margin-top: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e2e8f0;
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: 999px;
  background: var(--blue);
  transition: width .2s ease;
}

.sync-log {
  display: grid;
  max-height: 280px;
  gap: 7px;
  margin-top: 12px;
  overflow: auto;
}

.sync-log div {
  border-radius: 8px;
  padding: 9px 10px;
  font-size: 13px;
  font-weight: 800;
}

.sync-log .ok {
  background: var(--green-soft);
  color: var(--green);
}

.sync-log .fail {
  background: var(--red-soft);
  color: var(--red);
}

/* 全局页面导航加载条 */
#pageLoader {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 2147483646;
  width: 100%;
  height: 3px;
  pointer-events: none;
  opacity: 0;
  transition: opacity .15s ease;
}
#pageLoader.is-loading {
  opacity: 1;
}
#pageLoader::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 30%;
  border-radius: 0 3px 3px 0;
  background: linear-gradient(90deg, #2563eb, #60a5fa);
  animation: pageLoaderSweep 1.2s cubic-bezier(.4,0,.2,1) infinite;
}
@keyframes pageLoaderSweep {
  0%   { left: -35%; width: 30%; }
  50%  { left: 100%; width: 40%; }
  100% { left: 100%; width: 30%; }
}

@media (max-width: 1300px) {
  .exchange-rate small {
    display: none;
  }
}

@media (max-width: 1100px) {
  .topbar {
    flex-wrap: wrap;
    gap: 10px;
  }
  .title-row {
    flex: 1 1 auto;
    min-width: 0;
  }
  .global-exchange {
    flex: 0 0 auto;
  }
}

@media (max-width: 980px) {
  /* 中等屏幕：侧边栏变为顶部导航条风格 */
  .sidebar {
    position: relative;
    width: 100%;
    padding: 10px 16px;
    flex-shrink: 0;
    box-shadow: 0 2px 12px rgba(0,0,0,.1);
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    transform: none !important;
  }
  .sidebar::-webkit-scrollbar { display: none; }
  .sidebar > nav {
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 4px;
    align-items: center;
  }
  .sidebar .brand,
  .sidebar .nav-group-label,
  .sidebar .nav-group-divider,
  .sidebar .nav-group-arrow,
  .sidebar .nav-sub-group,
  .sidebar .nav-label-short {
    display: none !important;
  }
  /* 底部区域取消分隔线，保持内联 */
  .sidebar .nav-bottom-section {
    border-top: none;
    padding-top: 0;
    display: flex !important;
    flex-direction: row !important;
    gap: 4px;
    margin-left: 8px;
    padding-left: 8px;
    border-left: 1px solid rgba(255,255,255,.12);
  }
  .sidebar .nav-top-link,
  .sidebar .nav-bottom-link {
    color: #cbd5e1;
    font-size: 12px;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 6px;
    white-space: nowrap;
    flex-shrink: 0;
    margin: 0;
    min-height: auto;
  }
  .sidebar .nav-top-link.active,
  .sidebar .nav-bottom-link.active {
    background: rgba(37,99,235,.2);
    color: #fff;
  }
  .sidebar .nav-top-link .nav-label,
  .sidebar .nav-bottom-link .nav-label {
    display: inline !important;
  }
  .sidebar .nav-top-link .nav-icon,
  .sidebar .nav-bottom-link .nav-icon {
    display: none;
  }
  .sidebar .nav-top-link::before,
  .sidebar .nav-bottom-link::before,
  .sidebar .nav-sub-link::before {
    display: none;
  }

  .main {
    margin-left: 0;
    padding: 16px 12px 12px;
  }

  .topbar {
    left: 0;
  }

  /* 中等屏幕下隐藏移动端菜单元素 */
  .mobile-menu-btn,
  .mobile-menu-close,
  .sidebar-backdrop {
    display: none !important;
  }

  /* 移动端侧边栏变为顶部导航条，隐藏底部版权 */
  .sidebar-footer {
    display: none;
  }

  .workspace-head,
  .data-card-head,
  .modal-head {
    align-items: stretch;
    flex-direction: column;
  }

  .data-card-head-spacer {
    display: none;
  }

  .topbar {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
  }

  .title-row,
  .global-exchange {
    align-items: stretch;
    flex-direction: column;
  }

  .title-row-inner {
    flex-direction: row;
  }

  .topbar-eyebrow {
    font-size: 10px;
  }

  .title-row-inner p {
    white-space: normal;
  }

  .filter-bar,
  .rate-form,
  .stats-grid,
  .form-grid,
  .base-grid,
  .store-form,
  .operation-form,
  .operation-modal-form,
  .operation-member-form,
  .group-rank-head,
  .group-rank-row,
  .store-edit-row,
  .table-filter-panel,
  .date-inputs,
  .date-row,
  .quick-sync-panel,
  .sync-store-list {
    grid-template-columns: 1fr;
  }

  .table-filter-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .purchase-table-filter {
    min-width: 0;
  }

  .purchase-sku-filter {
    width: 100%;
  }

  .operation-form .store-multi {
    width: 100%;
  }

  .store-multi {
    width: 100%;
  }

  .store-edit-head {
    display: none;
  }

  .report-switch {
    flex-wrap: wrap;
    gap: 4px;
  }

  .report-switch button {
    font-size: 12px;
    padding: 5px 12px;
  }

  .rank-tabs {
    flex-wrap: wrap;
  }

  .rank-tab {
    font-size: 12px;
    padding: 6px 10px;
  }

  .overseas-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .data-card {
    padding: 12px;
  }

  .section-title {
    gap: 8px;
  }
}

/* ── 小平板过渡（≤768px） ── */
@media (max-width: 768px) {
  .dashboard-kpi-5 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .overseas-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .chart-wrap {
    height: 200px;
  }

  .report-switch button {
    font-size: 11px;
    padding: 4px 8px;
    min-height: 28px;
  }

  .rank-tab {
    font-size: 11px;
    padding: 5px 8px;
  }

  .title-row-inner h1 {
    font-size: 16px;
  }

  .workspace-head h2 {
    font-size: 16px;
  }
}

/* ── 移动端菜单 ── */
.mobile-menu-btn {
  display: none;
}

.mobile-menu-close {
  display: none;
  position: absolute;
  top: 12px;
  right: 14px;
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 8px;
  background: rgba(255,255,255,.04);
  color: #cbd5e1;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  z-index: 201;
  transition: background .15s ease, border-color .15s ease;
}
.mobile-menu-close:hover {
  background: rgba(255,255,255,.1);
  border-color: rgba(255,255,255,.3);
}

.sidebar-backdrop {
  display: none;
}

@media (max-width: 600px) {
  /* 移动端菜单按钮显示 */
  .mobile-menu-btn {
    display: inline-flex;
  }
  .mobile-menu-close {
    display: flex;
  }


  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 200;
    width: 272px;
    max-width: 85vw;
    height: 100vh;
    height: 100dvh;
    padding: 16px 14px;
    overflow-y: auto;
    box-shadow: 6px 0 30px rgba(0,0,0,.3);
    transform: translateX(-100%);
    transition: transform .28s cubic-bezier(.4,0,.2,1);
  }

  .sidebar.mobile-open {
    transform: translateX(0);
  }

  /* 抽屉遮罩 */
  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 199;
    background: rgba(15,23,42,.45);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    opacity: 0;
    pointer-events: none;
    transition: opacity .28s ease;
  }

  .sidebar-backdrop.is-visible {
    opacity: 1;
    pointer-events: auto;
  }

  /* 移动端菜单按钮 */
  .mobile-menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: #fff;
    color: #475467;
    cursor: pointer;
    flex-shrink: 0;
    padding: 0;
    transition: background .15s ease, box-shadow .15s ease;
  }
  .mobile-menu-btn:hover {
    background: var(--blue-soft);
    box-shadow: 0 2px 8px rgba(37,99,235,.1);
  }

  .mobile-menu-btn svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  .mobile-menu-btn:active {
    background: #e2e8f0;
  }

  .main {
    margin-left: 0 !important;
    padding: 72px 10px 10px !important;
    width: 100%;
  }

  /* 顶部栏 */
  .topbar {
    padding: 8px 10px;
    gap: 6px;
  }
  .title-row {
    margin-left: 0;
  }
  .title-row-inner h1 {
    font-size: 15px;
  }
  .title-row-inner p {
    display: none;
  }
  .topbar-eyebrow {
    font-size: 10px;
  }
  .topbar-eyebrow-bar {
    width: 16px;
  }
  .global-exchange {
    gap: 4px;
  }
  .exchange-rate {
    padding: 4px 10px;
  }
  .exchange-rate strong {
    font-size: 14px;
  }
  .exchange-rate span {
    display: none;
  }
  .icon-action, .secondary-action, .currency-toggle button {
    min-height: 30px;
  }
  .secondary-action {
    padding: 4px 10px;
    font-size: 12px;
  }
  .currency-toggle button {
    padding: 4px 10px;
    font-size: 12px;
  }

  /* 页面头部 */
  .workspace-head {
    padding: 10px;
    gap: 6px;
  }
  .workspace-head h2 {
    font-size: 15px;
  }
  .workspace-head p {
    font-size: 11px;
  }
  .eyebrow {
    font-size: 10px;
  }

  /* 卡片 */
  .data-card {
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 8px;
  }

  .section-title {
    flex-wrap: wrap;
    gap: 6px;
    padding: 0 0 8px;
  }
  .section-title h2 {
    font-size: 14px;
  }

  /* KPI / 统计卡片 */
  .stat-card {
    padding: 10px;
  }
  .stat-card strong {
    font-size: 15px;
  }
  .stat-card span {
    font-size: 11px;
  }
  .stat-card small {
    font-size: 10px;
  }

  .stats-grid {
    gap: 6px;
  }
  .dashboard-kpi-5 {
    gap: 6px;
  }

  /* 时间切换按钮 */
  .report-switch {
    flex-wrap: wrap;
    gap: 3px;
  }
  .report-switch button {
    font-size: 10px;
    padding: 4px 7px;
    min-height: 26px;
  }

  /* 排行榜切换 */
  .rank-tabs {
    flex-wrap: wrap;
    gap: 3px;
  }
  .rank-tab {
    font-size: 10px;
    padding: 4px 7px;
  }

  /* 图表 */
  .chart-wrap {
    height: 180px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* 模态框全屏 */
  .modal-overlay {
    padding: 0;
  }
  .modal-card,
  .rate-card {
    width: 100%;
    max-width: 100vw;
    max-height: 100vh;
    padding: 12px;
    border-radius: 0;
  }
  .modal-head h2 {
    font-size: 15px;
  }

  /* 表格 */
  table {
    font-size: 10px;
  }
  th, td {
    padding: 4px 5px;
    font-size: 10px;
  }
  .table-wrap {
    -webkit-overflow-scrolling: touch;
  }

  /* 汇率区域 */
  .global-exchange {
    gap: 4px;
  }
  .exchange-rate {
    padding: 4px 8px;
  }
  .exchange-rate strong {
    font-size: 13px;
  }
  .exchange-rate small {
    font-size: 10px;
  }
  .currency-toggle button {
    font-size: 10px;
    padding: 3px 6px;
  }

  /* 小组排行 */
  .group-rank-head,
  .group-rank-row {
    font-size: 10px;
    gap: 4px;
  }
  .group-rank-row strong {
    font-size: 11px;
  }
  .group-rank-row small {
    font-size: 9px;
  }

  /* 排行榜行 */
  .rank-row {
    font-size: 10px;
    gap: 4px;
  }

  /* 导航子项 */
  .nav-sub-group {
    margin: 0 2px 4px;
  }
  .nav-group-divider {
    margin: 0 4px 3px;
  }

  /* 图标按钮缩小 */
  .icon-action,
  button.secondary-action {
    font-size: 10px;
    padding: 4px 8px;
  }
}

/* =============================================
   用户下拉菜单
   ============================================= */
.user-dropdown {
  position: relative;
  flex-shrink: 0;
  margin-right: 4px;
}

.user-dropdown-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 4px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: border-color .15s, box-shadow .15s;
  white-space: nowrap;
}

.user-dropdown-trigger:hover {
  border-color: var(--blue);
  box-shadow: 0 2px 8px rgba(37,99,235,.1);
}

.user-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  flex-shrink: 0;
}

.user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-avatar-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
}

.user-avatar-lg {
  width: 44px;
  height: 44px;
}

.user-avatar-lg .user-avatar-fallback {
  font-size: 18px;
}

.user-name-text {
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-dropdown-arrow {
  font-size: 10px;
  color: var(--muted);
  transition: transform .2s;
}

.user-dropdown.open .user-dropdown-arrow {
  transform: rotate(180deg);
}

.user-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 220px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  z-index: 100;
  overflow: hidden;
}

.user-dropdown-menu[hidden] {
  display: none;
}

.user-dropdown-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: var(--panel-soft);
}

.user-dropdown-head strong {
  display: block;
  font-size: 14px;
  color: var(--text);
  margin-bottom: 2px;
}

.user-dropdown-head small {
  font-size: 12px;
  color: var(--muted);
}

.user-dropdown-divider {
  height: 1px;
  background: var(--line);
  margin: 0;
}

.user-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  font-size: 13px;
  color: var(--text);
  text-decoration: none;
  transition: background .12s;
  cursor: pointer;
}

.user-dropdown-item:hover {
  background: var(--blue-soft);
  color: var(--blue);
}

.user-dropdown-item svg {
  flex-shrink: 0;
  color: var(--muted);
}

.user-dropdown-item:hover svg {
  color: var(--blue);
}

@media (max-width: 768px) {
  .user-name-text {
    display: none;
  }
  .user-dropdown-menu {
    right: -20px;
  }
}
