/* ECP 跨境统一后台 — 设计系统
   风格: shadcn 克制型（indigo 主色 / 中性基底 / 双层阴影 / 微动效）
   规范: 4/8 栅格 · 圆角 3 档(8/12/16) · 字号 4 档 · 五态完备 */

:root {
  /* 色板（60-30-10：中性基底 60% / 次要 30% / 主色 ≤10%） */
  --bg: #f6f7fb;
  --card: #ffffff;
  --border: #e9ecf3;
  --border-strong: #d8dde9;
  --text: #16192b;
  --muted: #64708a;
  --primary: #5b5bd6;
  --primary-2: #8b5cf6;
  --primary-soft: #eef0ff;
  --primary-ring: rgba(91, 91, 214, .15);
  --green: #16a34a;
  --green-soft: #e7f7ee;
  --red: #dc2626;
  --red-soft: #fdecec;
  --amber: #d97706;
  --amber-soft: #fdf3e3;
  /* 圆角 3 档：控件 8 / 卡片 12 / 浮层 16 */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  /* 阴影：双层（环境光+关键光） */
  --shadow-xs: 0 1px 2px rgba(23, 25, 43, .05);
  --shadow-sm: 0 1px 3px rgba(23, 25, 43, .08), 0 1px 2px rgba(23, 25, 43, .05);
  --shadow-md: 0 4px 8px -2px rgba(23, 25, 43, .1), 0 2px 4px -2px rgba(23, 25, 43, .08);
  --shadow-lg: 0 12px 24px -6px rgba(23, 25, 43, .12), 0 4px 8px -4px rgba(23, 25, 43, .08);
  /* 字号 4 档：辅助 12 / 正文 13 / 强调 14 / 标题 20 */
  /* 动效时长：悬停 120ms / 进入 240ms（ease-out） */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: "Inter", -apple-system, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  font-size: 14px; -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; transition: color 120ms ease-out; }
a:hover { color: var(--primary-2); }

/* 键盘焦点统一：2px 主色环（可交互元素） */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--primary); outline-offset: 2px;
}
input:focus-visible, select:focus-visible { outline: none; }

/* 减弱动效偏好：关闭位移，仅保留透明度 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}

/* ---------- 布局 ---------- */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 240px; flex-shrink: 0; background: var(--card);
  border-right: 1px solid var(--border);
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; z-index: 30;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  padding: 20px 20px 16px; font-weight: 800; font-size: 16px; letter-spacing: -.2px;
}
.brand .logo {
  width: 34px; height: 34px; border-radius: var(--radius-sm); display: grid; place-items: center;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff; font-size: 17px; box-shadow: 0 4px 12px -2px rgba(91, 91, 214, .5);
}
.brand small { display: block; font-size: 12px; color: var(--muted); font-weight: 500; margin-top: 2px; }

.sidebar nav { flex: 1; padding: 8px 12px; }
.sidebar nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; margin: 2px 0; color: #46506b;
  border-radius: var(--radius-sm); font-weight: 550; font-size: 13px;
  transition: background 120ms ease-out, color 120ms ease-out;
}
.sidebar nav a .ico { font-size: 16px; width: 20px; text-align: center; }
.sidebar nav a:hover { background: #f5f6fa; color: var(--text); }
.sidebar nav a.active {
  background: linear-gradient(135deg, rgba(91, 91, 214, .12), rgba(139, 92, 246, .10));
  color: var(--primary); font-weight: 650;
}
.sidebar-foot { padding: 12px 20px; border-top: 1px solid var(--border);
  color: var(--muted); font-size: 12px; line-height: 1.7; }

.main { flex: 1; padding: 24px 32px 60px; max-width: 1500px; min-width: 0; overflow: visible; }

/* ---------- 顶栏 ---------- */
.page-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  flex-wrap: wrap; gap: 16px; margin-bottom: 24px;
  position: relative; z-index: 40;
  animation: fadeUp 280ms var(--ease-out) both;
}
.page-title { font-size: 22px; font-weight: 800; margin: 0 0 4px; letter-spacing: -.4px; }
.page-sub { color: var(--muted); font-size: 13px; }
.actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* 用户菜单 */
.user-menu { position: relative; }
.user-btn {
  display: flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px;
  border: 1px solid var(--border); border-radius: 999px; cursor: pointer;
  background: var(--card); font-size: 13px; font-weight: 600; color: var(--text);
  transition: box-shadow 120ms ease-out;
}
.user-btn:hover { box-shadow: var(--shadow-sm); }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  color: #fff; font-size: 13px; font-weight: 700;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
}
.avatar-sm {
  width: 26px; height: 26px; font-size: 12px; display: inline-grid;
  vertical-align: middle; margin-right: 8px;
}
.dropdown {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 200px;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg); padding: 4px;
  z-index: 100;
  opacity: 0; transform: translateY(-4px) scale(.98); pointer-events: none;
  transition: opacity 150ms ease-out, transform 150ms ease-out;
}
.dropdown.open { opacity: 1; transform: none; pointer-events: auto; }
.dropdown .dd-head { padding: 8px 12px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.dropdown .dd-head .name { font-weight: 700; }
.dropdown .dd-head .role { font-size: 12px; color: var(--muted); margin-top: 2px; }
.dropdown button, .dropdown a.dd-item {
  display: flex; width: 100%; text-align: left; padding: 8px 12px; border: none;
  background: none; border-radius: var(--radius-sm); cursor: pointer;
  font-size: 13px; color: var(--text); font-weight: 550;
}
.dropdown button:hover, .dropdown a.dd-item:hover { background: #f5f6fa; }
.dropdown .dd-logout { color: var(--red); }

/* ---------- KPI ---------- */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.kpi {
  position: relative; overflow: hidden;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 16px 20px; box-shadow: var(--shadow-sm);
  transition: box-shadow 150ms ease-out;
  animation: fadeUp 300ms var(--ease-out) both;
}
.kpi:nth-child(2) { animation-delay: 40ms; }
.kpi:nth-child(3) { animation-delay: 80ms; }
.kpi:nth-child(4) { animation-delay: 120ms; }
.kpi:hover { box-shadow: var(--shadow-md); }
.kpi::after {
  content: ""; position: absolute; right: -32px; top: -32px; width: 112px; height: 112px;
  border-radius: 50%; opacity: .09;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
}
.kpi .kpi-icon {
  width: 36px; height: 36px; border-radius: var(--radius-sm); display: grid; place-items: center;
  font-size: 17px; margin-bottom: 12px;
}
.kpi.g1 .kpi-icon { background: var(--primary-soft); }
.kpi.g2 .kpi-icon { background: var(--green-soft); }
.kpi.g3 .kpi-icon { background: linear-gradient(135deg, #eef0ff, #f3ecfe); }
.kpi.g4 .kpi-icon { background: var(--amber-soft); }
.kpi .label { font-size: 12px; color: var(--muted); font-weight: 600; }
.kpi .value { font-size: 24px; font-weight: 800; margin-top: 4px; letter-spacing: -.8px;
  font-variant-numeric: tabular-nums; }
.kpi .hint { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* ---------- 卡片 ---------- */
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-md);
  margin-bottom: 20px; box-shadow: var(--shadow-sm);
  animation: fadeUp 300ms var(--ease-out) both; animation-delay: 80ms;
  transition: box-shadow 150ms ease-out;
}
.card:hover { box-shadow: var(--shadow-md); }
.card-header {
  padding: 12px 20px; border-bottom: 1px solid var(--border); font-weight: 700;
  font-size: 14px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.card-body { padding: 20px; }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; border-radius: 0 0 var(--radius-md) var(--radius-md); }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th {
  text-align: left; padding: 12px 16px; color: var(--muted); font-weight: 600;
  border-bottom: 1px solid var(--border); white-space: nowrap; background: #fafbfe;
  font-size: 12px; text-transform: none;
}
table.data td { padding: 12px 16px; border-bottom: 1px solid #f2f3f8; vertical-align: middle; }
table.data tr { transition: background 120ms ease-out; }
table.data tbody tr:hover td, table.data tr:hover td { background: #f8f9fd; }
table.data tr:last-child td { border-bottom: none; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pos { color: var(--green); font-weight: 650; }
.neg { color: var(--red); font-weight: 650; }

table.kv { width: 100%; font-size: 13px; border-collapse: collapse; }
table.kv td { padding: 8px 4px; border-bottom: 1px dashed #edeff5; }
table.kv td:first-child { color: var(--muted); width: 96px; }
table.kv tr:last-child td { border-bottom: none; }

/* ---------- 徽章 ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px;
  border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap;
}
.b-NEW { background: var(--primary-soft); color: var(--primary); }
.b-PACKED { background: var(--amber-soft); color: var(--amber); }
.b-SHIPPED { background: #f0eafd; color: #6d3fd4; }
.b-DONE { background: var(--green-soft); color: var(--green); }
.b-CANCELLED { background: #eef0f3; color: var(--muted); }
.b-FAILED { background: var(--red-soft); color: var(--red); }
.dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; display: inline-block; }

/* ---------- 按钮（五态完备：default/hover/active/focus-visible/disabled） ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px;
  border-radius: var(--radius-sm); border: 1px solid var(--border-strong);
  background: var(--card); color: var(--text);
  font-size: 13px; font-weight: 600; cursor: pointer;
  line-height: 1.4; transition: background 120ms ease-out,
    box-shadow 120ms ease-out, transform 120ms ease-out;
  box-shadow: var(--shadow-xs);
}
.btn:hover {
  background: #f5f6fa; box-shadow: var(--shadow-sm); transform: translateY(-1px);
  text-decoration: none; color: var(--text);
}
.btn:active { transform: translateY(0); box-shadow: none; }
.btn:disabled, .btn.disabled {
  opacity: .5; pointer-events: none; cursor: not-allowed;
}
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  border-color: transparent; color: #fff;
  box-shadow: 0 2px 8px -2px rgba(91, 91, 214, .45);
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  box-shadow: 0 4px 12px -2px rgba(91, 91, 214, .55);
  filter: brightness(1.04); color: #fff;
}
.btn-danger { border-color: #f3c1c1; color: var(--red); }
.btn-danger:hover { background: var(--red-soft); color: var(--red); }
/* 尺寸体系：默认 36px 高 / sm 32px / 图标按钮 32×32 */
.btn-sm { padding: 4px 12px; font-size: 12px; border-radius: var(--radius-sm); }
.btn-icon {
  width: 32px; height: 32px; padding: 0; justify-content: center;
  border-radius: var(--radius-sm); font-size: 14px; flex-shrink: 0;
}
.btn-sm.btn-icon { width: 28px; height: 28px; font-size: 12px; }
.btn-block { width: 100%; justify-content: center; }
.btn-ghost { border-color: transparent; box-shadow: none; background: transparent; color: var(--primary); }
.btn-ghost:hover { background: var(--primary-soft); box-shadow: none; transform: none; color: var(--primary); }

/* ---------- 统一缩略图尺寸（消除 32/34/36/40px 混用） ---------- */
.thumb { object-fit: cover; border: 1px solid var(--border); flex-shrink: 0; background: #f0f1f6; }
.thumb-sm { width: 32px; height: 32px; border-radius: var(--radius-sm); }
.thumb-md { width: 40px; height: 40px; border-radius: var(--radius-sm); }
.thumb-lg { width: 52px; height: 52px; border-radius: var(--radius-md); }
.thumb-emoji { display: grid; place-items: center; font-size: 20px; }

/* ---------- 统一店铺切换/汇率徽章胶囊 ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border);
  background: #fff; font-size: 13px; font-weight: 600; color: var(--text);
  cursor: pointer; white-space: nowrap;
}

/* ---------- 统一表情图标尺寸 ---------- */
.emoji-ico { display: inline-grid; place-items: center; font-size: 17px; line-height: 1; }

/* ---------- 表单（含 disabled 态） ---------- */
.form-row { display: flex; gap: 16px; flex-wrap: wrap; align-items: flex-end; }
.field label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; font-weight: 600; }
input, select {
  padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 13px; background: var(--card); color: var(--text);
  min-width: 0; max-width: 100%;
  transition: border-color 120ms ease-out, box-shadow 120ms ease-out;
}
.field input, .field select { width: 100%; }
input:focus, select:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-ring);
}
input:disabled, select:disabled {
  background: #f3f4f8; color: var(--muted); cursor: not-allowed; opacity: .7;
}
input::placeholder { color: #9aa3b8; }
/* 行内紧凑表单（表格单元格内） */
.inline-form { display: flex; gap: 8px; flex-wrap: nowrap; align-items: center; }
.inline-form input, .inline-form select { padding: 4px 8px; font-size: 12px; flex: 0 0 auto; }

/* ---------- 提示条 ---------- */
.alert {
  padding: 12px 16px; border-radius: var(--radius-md); background: var(--green-soft);
  color: #137a3c; margin-bottom: 16px; font-size: 13px; font-weight: 550;
  border: 1px solid #cdeed8; animation: slideIn 240ms ease-out both;
}

/* ---------- 新手引导 ---------- */
.onboard {
  display: flex; gap: 0; margin-bottom: 20px; background: linear-gradient(120deg, #f4f4ff, #faf5ff);
  border: 1px solid #e5e2fb; border-radius: var(--radius-md); padding: 16px 20px;
  animation: fadeUp 280ms var(--ease-out) both; position: relative; overflow: hidden;
}
.onboard::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(600px 100px at 20% 0%, rgba(139, 92, 246, .08), transparent);
  pointer-events: none;
}
.onboard-step {
  flex: 1; display: flex; gap: 12px; align-items: flex-start; padding: 4px 16px;
  border-right: 1px dashed #dcd9f2; color: inherit;
}
.onboard-step:last-child { border-right: none; }
.onboard-step .step-ico {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center; font-size: 15px; font-weight: 800;
  background: var(--card); border: 2px solid #d9d6f0; color: var(--muted);
  transition: background 200ms ease-out, border-color 200ms ease-out;
}
.onboard-step.done .step-ico {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  border-color: transparent; color: #fff;
}
.onboard-step .st { font-size: 13px; font-weight: 700; }
.onboard-step .sd { font-size: 12px; color: var(--muted); margin-top: 2px; line-height: 1.5; }
.onboard-step.done .st { color: var(--primary); }
.onboard-close { position: absolute; top: 8px; right: 12px; border: none; background: none;
  cursor: pointer; color: var(--muted); font-size: 15px; }

/* ---------- 空状态 ---------- */
.empty {
  text-align: center; padding: 60px 24px;
}
.empty .empty-ico { font-size: 44px; margin-bottom: 12px; }
.empty h3 { margin: 0 0 8px; font-size: 16px; }
.empty p { color: var(--muted); font-size: 13px; margin: 0 0 18px; line-height: 1.8; }

/* ---------- 布局网格 ---------- */
.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 20px; align-items: start; }
.grid-2 > * { min-width: 0; } /* 防止宽内容把网格列撑爆 */
.card { min-width: 0; }

/* ---------- 时间线 ---------- */
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li {
  padding: 12px 0 12px 24px; border-left: 2px solid #e5e8f0; position: relative; font-size: 13px;
  animation: fadeUp 240ms var(--ease-out) both;
}
.timeline li:nth-child(2) { animation-delay: 40ms; }
.timeline li:nth-child(3) { animation-delay: 80ms; }
.timeline li:nth-child(4) { animation-delay: 120ms; }
.timeline li::before {
  content: ""; position: absolute; left: -6px; top: 17px; width: 10px; height: 10px;
  border-radius: 50%; background: var(--card); border: 2px solid var(--primary);
}
.timeline .t { color: var(--muted); font-size: 12px; margin-top: 2px; }

/* ---------- 图表 ---------- */
.chart { width: 100%; height: 320px; }

/* ---------- 其他 ---------- */
.muted { color: var(--muted); }
.small { font-size: 12px; }
.pager { display: flex; gap: 8px; align-items: center; margin-top: 16px; font-size: 13px; }
.profit-card .profit-big {
  font-size: 34px; font-weight: 800; text-align: center; padding: 16px 0; letter-spacing: -1.2px;
}
.bar-row { display: grid; grid-template-columns: 84px 1fr auto; gap: 8px; align-items: center;
  margin-bottom: 12px; font-size: 12px; }
.bar-label { color: var(--muted); }
.bar-track { background: #eef0f5; border-radius: 999px; height: 8px; overflow: hidden; }
.bar-fill { background: linear-gradient(90deg, #818cf8, var(--primary)); height: 100%;
  border-radius: 999px; min-width: 4px; transition: width 600ms var(--ease-out); }
.bar-val { white-space: nowrap; font-variant-numeric: tabular-nums; }
.steps { padding-left: 20px; line-height: 2; margin: 0; }
code, pre { background: #f3f4f9; border-radius: var(--radius-sm); padding: 2px 8px; font-size: 12px; }
pre { padding: 12px 16px; overflow-x: auto; margin: 8px 0; }

/* ---------- 登录页 ---------- */
.auth-body {
  min-height: 100vh; display: grid; place-items: center;
  background:
    radial-gradient(800px 500px at 15% 10%, rgba(91, 91, 214, .18), transparent),
    radial-gradient(700px 500px at 85% 90%, rgba(139, 92, 246, .16), transparent),
    linear-gradient(160deg, #f4f5fd, #eef1fa);
  padding: 24px;
}
.auth-card {
  width: 400px; max-width: 100%; background: var(--card); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); padding: 36px 32px; border: 1px solid rgba(255,255,255,.6);
  animation: popIn 280ms var(--ease-out) both;
}
.auth-card .auth-logo {
  width: 52px; height: 52px; border-radius: var(--radius-md); display: grid; place-items: center;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff; font-size: 25px; margin: 0 auto 16px;
  box-shadow: 0 8px 22px -6px rgba(91, 91, 214, .55);
}
.auth-card h1 { text-align: center; font-size: 20px; margin: 0 0 6px; letter-spacing: -.3px; }
.auth-card .auth-sub { text-align: center; color: var(--muted); font-size: 13px; margin-bottom: 24px; }
.auth-card .field { margin-bottom: 16px; }
.auth-card input, .auth-card select { width: 100%; }
.auth-card .btn { width: 100%; justify-content: center; padding: 12px; font-size: 14px; }
.auth-error {
  background: var(--red-soft); color: var(--red); border: 1px solid #f5cdcd;
  border-radius: var(--radius-sm); padding: 10px 14px; font-size: 13px; margin-bottom: 16px;
  animation: shake 400ms ease-out;
}

/* ---------- 动效（进入 ≤300ms ease-out；反馈 ≤150ms） ---------- */
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes slideIn { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: none; } }
@keyframes popIn { from { opacity: 0; transform: scale(.96) translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes shake { 0%,100% { transform: none; } 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
@keyframes pulse { 0%,100% { box-shadow: 0 4px 14px -4px rgba(91,91,214,.5); } 50% { box-shadow: 0 4px 22px -4px rgba(91,91,214,.75); } }

/* ---------- 响应式 ---------- */
@media (max-width: 1100px) {
  .grid-2 { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .onboard { flex-direction: column; gap: 12px; }
  .onboard-step { border-right: none; border-bottom: 1px dashed #dcd9f2; padding-bottom: 12px; }
  .onboard-step:last-child { border-bottom: none; }
}

/* ---------- 移动端（≤760px）汉堡菜单 ---------- */
.mobile-topbar { display: none; }
.nav-overlay { display: none; }
.nav-close { display: none; }
/* 桌面显示表格，移动显示卡片 */
.mobile-only { display: none; }

@media (max-width: 760px) {
  /* 顶栏 */
  .mobile-topbar {
    display: flex; align-items: center; gap: 12px;
    position: sticky; top: 0; z-index: 60;
    background: #fff; border-bottom: 1px solid var(--border);
    padding: 12px 16px; box-shadow: var(--shadow-sm);
  }
  .m-brand { font-weight: 800; font-size: 15px; }
  .hamburger {
    border: 1px solid var(--border); background: var(--card); border-radius: var(--radius-sm);
    font-size: 18px; width: 38px; height: 36px; cursor: pointer; line-height: 1;
  }
  .mobile-topbar .store-switch { max-width: 130px; font-size: 12px; padding: 6px 8px; }

  /* 侧边栏变抽屉 */
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; z-index: 70;
    width: 250px; height: 100vh; flex-direction: column;
    transform: translateX(-100%); transition: transform 280ms var(--ease-out);
    box-shadow: var(--shadow-lg);
  }
  .sidebar.open { transform: translateX(0); }
  .nav-overlay.open {
    display: block; position: fixed; inset: 0; z-index: 65;
    background: rgba(20, 22, 40, .45); backdrop-filter: blur(2px);
    animation: fadeUp 200ms ease-out;
  }
  .nav-close {
    display: grid; place-items: center; margin-left: auto;
    width: 32px; height: 32px; border-radius: var(--radius-sm); border: none;
    background: #f0f1f6; color: var(--muted); cursor: pointer; font-size: 14px;
  }
  .sidebar nav { display: block; overflow-y: auto; flex: 1; padding: 6px 12px; }
  .sidebar nav a { white-space: normal; }
  .sidebar-foot { display: block; }

  /* 主内容 */
  .main { padding: 16px 16px 48px; }
  .layout { flex-direction: column; }

  /* 双栏网格移动端强制单列（覆盖内联自定义列宽） */
  .grid-2 { grid-template-columns: 1fr !important; }
  /* 内部三栏 KPI/网格也降列 */
  .kpi-grid[style*="repeat(3"], .kpi-grid[style*="repeat(4"] { grid-template-columns: 1fr 1fr !important; }
  div[style*="grid-template-columns:1fr 1fr"],
  div[style*="grid-template-columns: 1fr 1fr"],
  div[style*="grid-template-columns:1.6fr"],
  div[style*="grid-template-columns: 1.6fr"],
  div[style*="minmax(0,1.4fr)"] { grid-template-columns: 1fr !important; }

  /* 页头：标题与操作分行 */
  .page-head { flex-direction: column; align-items: stretch; gap: 12px; }
  .page-head .actions { flex-wrap: wrap; }
  .page-head .actions .btn { flex: 1; justify-content: center; min-width: 0; }
  .page-head .actions .user-menu { margin-left: auto; }
  /* 桌面店铺切换器在页头隐藏（顶栏已有） */
  .page-head .actions > form .store-switch { display: none; }

  /* KPI 单列 */
  .kpi-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .kpi { padding: 14px; }
  .kpi .value { font-size: 20px; }

  /* 卡片内边距收窄 */
  .card-body { padding: 14px; }
  .card-header { padding: 12px 14px; font-size: 13px; flex-wrap: wrap; }

  /* 表格横滚 */
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table.data { min-width: 560px; font-size: 12px; }
  table.data th, table.data td { padding: 8px 12px; }

  /* 表单竖排 */
  .form-row { flex-direction: column; align-items: stretch; gap: 10px; }
  .form-row .field { width: 100%; }
  .form-row input, .form-row select { width: 100%; min-width: 0; }
  .inline-form { flex-wrap: wrap; }

  /* 图表降高 */
  .chart { height: 240px; }

  /* 新手引导纵向 */
  .onboard { flex-direction: column; gap: 10px; padding: 14px; }
  .onboard-step { border-right: none; padding: 4px 0; }

  /* 订单详情双栏改单栏 */
  .profit-card .profit-big { font-size: 26px; }
  .bar-row { grid-template-columns: 70px 1fr auto; gap: 6px; font-size: 11px; }

  /* 登录卡 */
  .auth-card { padding: 26px 20px; }

  /* 移动卡片视图（替代大表格） */
  .pc-only { display: none !important; }
  .mobile-only { display: block !important; }
  .m-card {
    background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-md);
    padding: 12px; margin-bottom: 12px; box-shadow: var(--shadow-sm);
  }
  .m-card-top { display: flex; gap: 12px; align-items: center; }
  .m-thumb { width: 52px; height: 52px; object-fit: cover; border-radius: var(--radius-md);
    border: 1px solid var(--border); flex-shrink: 0; }
  .m-name { font-weight: 650; font-size: 13px; overflow: hidden;
    text-overflow: ellipsis; white-space: nowrap; }
  .m-stats { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 8px;
    font-size: 12px; color: var(--muted); }
  .m-stats b { color: var(--text); }
}

@media (max-width: 400px) {
  .kpi-grid { grid-template-columns: 1fr; }
}

/* 双币显示：人民币主（大）+ 卢布辅（小灰） */
.money-main { font-weight: inherit; }
.money-sub { color:#9aa3b8; font-size:.78em; margin-left:2px; white-space:nowrap; }
.money-cny { color:#9aa3b8; font-size:.78em; margin-left:2px; }
