/* ==========================================================================
   EcomERP · 跨境电商 ERP — 设计系统
   ========================================================================== */

:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-soft: #eff6ff;
  --success: #16a34a;
  --success-soft: #f0fdf4;
  --warning: #d97706;
  --warning-soft: #fffbeb;
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --violet: #7c3aed;
  --violet-soft: #f5f3ff;
  --cyan: #0891b2;
  --cyan-soft: #ecfeff;
  --pink: #db2777;

  --sidebar: #0f172a;
  --sidebar-soft: #16213a;
  --sidebar-line: #1e293b;
  --sidebar-text: #94a3b8;
  --sidebar-active: #1e293b;

  --bg: #f1f5f9;
  --card: #ffffff;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --text: #0f172a;
  --text-2: #475569;
  --muted: #94a3b8;

  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow: 0 8px 24px -12px rgba(15, 23, 42, 0.18);
  --shadow-lg: 0 24px 60px -20px rgba(15, 23, 42, 0.38);

  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  --mono: "SFMono-Regular", ui-monospace, Menlo, Consolas, monospace;

  --sidebar-w: 220px;
  --topbar-h: 68px;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.modal-open { overflow: hidden; }

h1, h2, h3, h4, p { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
img { display: block; }

input, select, textarea { font-family: inherit; font-size: 14px; }

code {
  font-family: var(--mono);
  font-size: 12px;
  background: #f1f5f9;
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1px 5px;
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 8px;
  border: 2px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: #94a3b8; background-clip: content-box; }

:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ============================== 启动屏 ============================== */
.boot-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  background: radial-gradient(1100px 500px at 15% -10%, #1d4ed8 0%, transparent 55%), var(--sidebar);
}

.boot-logo {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #fff;
}

.boot-text { color: var(--sidebar-text); font-size: 13px; }

/* ============================== 登录页 ============================== */
.login-mount { min-height: 100vh; }

.login-screen {
  position: relative;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  overflow: hidden;
  background: #0b1222;
}

.login-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(900px 520px at 8% 4%, rgba(37, 99, 235, 0.55) 0%, transparent 60%),
    radial-gradient(700px 480px at 92% 96%, rgba(124, 58, 237, 0.45) 0%, transparent 62%),
    radial-gradient(600px 400px at 70% -10%, rgba(8, 145, 178, 0.35) 0%, transparent 60%),
    linear-gradient(140deg, #0f172a 0%, #0b1222 55%, #0c1a33 100%);
  z-index: 0;
}

.login-screen::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.06) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(circle at 30% 30%, #000 0%, transparent 75%);
  -webkit-mask-image: radial-gradient(circle at 30% 30%, #000 0%, transparent 75%);
  z-index: 0;
}

.login-left {
  position: relative;
  z-index: 1;
  padding: 64px 72px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: #e2e8f0;
}

.login-brand { display: flex; align-items: center; gap: 12px; }

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #60a5fa, #2563eb);
  color: #fff;
  box-shadow: 0 10px 24px -10px rgba(37, 99, 235, 0.9);
  flex: none;
}

.brand-name { font-size: 19px; font-weight: 800; color: #fff; letter-spacing: 0.3px; }
.brand-sub { font-size: 12px; color: #94a3b8; letter-spacing: 2px; }

.login-hero { max-width: 520px; margin: 56px 0; }

.login-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  letter-spacing: 1px;
  color: #93c5fd;
  background: rgba(37, 99, 235, 0.16);
  border: 1px solid rgba(96, 165, 250, 0.28);
  padding: 5px 12px;
  border-radius: 999px;
  margin-bottom: 22px;
}

.login-hero h1 {
  font-size: 40px;
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: #fff;
}

.login-hero h1 span {
  background: linear-gradient(120deg, #93c5fd, #c4b5fd 60%, #67e8f9);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.login-hero p {
  margin-top: 18px;
  color: #94a3b8;
  font-size: 15px;
  max-width: 440px;
}

.login-features {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 34px;
  max-width: 480px;
}

.login-feature {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 13px 14px;
  border-radius: 10px;
  background: rgba(148, 163, 184, 0.07);
  border: 1px solid rgba(148, 163, 184, 0.14);
}

.login-feature .feat-icon {
  color: #60a5fa;
  flex: none;
  margin-top: 2px;
}

.login-feature strong { display: block; font-size: 13px; color: #e2e8f0; font-weight: 600; }
.login-feature span { font-size: 12px; color: #7d8ba3; }

.login-foot { font-size: 12px; color: #64748b; }

.login-right {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: #fff;
  border-radius: 20px;
  padding: 36px 34px 28px;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(226, 232, 240, 0.6);
  animation: floatUp 0.5s ease both;
}

.login-card-head { margin-bottom: 26px; }
.login-card-head h2 { font-size: 22px; font-weight: 700; letter-spacing: -0.2px; }
.login-card-head p { color: var(--muted); font-size: 13px; margin-top: 6px; }

.login-form { display: flex; flex-direction: column; gap: 16px; }

.login-form .field { gap: 6px; }

.login-form .input { height: 44px; }

.login-submit { height: 44px; margin-top: 4px; font-weight: 600; }

.login-error {
  display: none;
  align-items: flex-start;
  gap: 8px;
  background: var(--danger-soft);
  border: 1px solid #fecaca;
  color: #b91c1c;
  font-size: 13px;
  border-radius: 10px;
  padding: 10px 12px;
  line-height: 1.45;
}

.login-error.show { display: flex; }

.login-error svg { flex: none; margin-top: 1px; }

.login-hint {
  margin-top: 24px;
  padding: 12px 14px;
  background: #f8fafc;
  border: 1px dashed var(--border-strong);
  border-radius: 10px;
  font-size: 12.5px;
  color: var(--text-2);
  display: flex;
  gap: 9px;
  align-items: flex-start;
  line-height: 1.6;
}

.login-hint svg { color: var(--primary); flex: none; margin-top: 2px; }
.login-hint code { background: #fff; color: var(--primary-dark); font-weight: 600; }
.login-hint .fill-demo {
  border: 0;
  background: none;
  color: var(--primary);
  font-size: 12.5px;
  cursor: pointer;
  padding: 0;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.login-copy { margin-top: 22px; text-align: center; font-size: 12px; color: var(--muted); }

/* ============================== 应用骨架 ============================== */
.shell { min-height: 100vh; }

.sidebar {
  position: fixed;
  z-index: 40;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--sidebar-w);
  background: linear-gradient(180deg, #0f172a 0%, #0d1526 100%);
  display: flex;
  flex-direction: column;
  color: var(--sidebar-text);
  border-right: 1px solid #0b1120;
  transition: transform 0.22s ease;
}

.sidebar-head {
  height: var(--topbar-h);
  flex: none;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 18px;
  border-bottom: 1px solid rgba(30, 41, 59, 0.7);
}

.sidebar-head .brand-mark { width: 34px; height: 34px; border-radius: 10px; }

.sidebar-brand-name { font-size: 15px; font-weight: 800; color: #fff; letter-spacing: 0.3px; line-height: 1.2; }
.sidebar-brand-sub { font-size: 10.5px; color: #64748b; letter-spacing: 1.4px; line-height: 1.5; }

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.nav-label {
  font-size: 10.5px;
  letter-spacing: 1.4px;
  color: #475569;
  padding: 6px 10px 8px;
  font-weight: 600;
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: 9px;
  font-size: 13.5px;
  color: #a7b4c8;
  transition: background 0.16s ease, color 0.16s ease;
  cursor: pointer;
  user-select: none;
}

.nav-item .nav-icon { display: flex; color: #64748b; transition: color 0.16s ease; flex: none; }

.nav-item:hover { background: rgba(148, 163, 184, 0.09); color: #e2e8f0; }
.nav-item:hover .nav-icon { color: #cbd5e1; }

.nav-item.active { background: var(--sidebar-active); color: #fff; font-weight: 600; }
.nav-item.active .nav-icon { color: #60a5fa; }

.nav-item.active::before {
  content: "";
  position: absolute;
  left: -12px;
  top: 9px;
  bottom: 9px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: #3b82f6;
}

.sidebar-foot {
  flex: none;
  border-top: 1px solid rgba(30, 41, 59, 0.75);
  padding: 14px 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.side-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 9px;
  border-radius: 10px;
  background: rgba(148, 163, 184, 0.07);
}

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #6366f1, #2563eb);
  flex: none;
}

.user-meta { min-width: 0; }
.user-name { font-size: 13px; color: #e2e8f0; font-weight: 600; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 11px; color: #64748b; }

.logout-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  padding: 8px 10px;
  font-size: 12.5px;
  color: #94a3b8;
  background: transparent;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.16s ease;
}

.logout-btn:hover { color: #fca5a5; border-color: rgba(248, 113, 113, 0.35); background: rgba(248, 113, 113, 0.08); }

.main {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: var(--topbar-h);
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 26px;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border);
}

.topbar-left { display: flex; align-items: center; gap: 12px; min-width: 0; }

.topbar-title {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.page-subtitle {
  font-size: 12px;
  color: var(--muted);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.page-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

.topbar-user {
  display: flex;
  align-items: center;
  gap: 7px;
  padding-left: 14px;
  margin-left: 4px;
  border-left: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--text-2);
  white-space: nowrap;
}

.dot-online { width: 7px; height: 7px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.16); }

.menu-btn { display: none; }

.content {
  flex: 1;
  padding: 24px 26px 44px;
  max-width: 1480px;
  width: 100%;
  margin: 0 auto;
}

.sidebar-overlay {
  position: fixed;
  inset: 0;
  z-index: 35;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  display: none;
}

/* ============================== 按钮 ============================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 36px;
  padding: 0 15px;
  font-size: 13px;
  font-weight: 500;
  border-radius: 8px;
  border: 1px solid transparent;
  background: #f1f5f9;
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}

.btn:hover { background: #e2e8f0; }
.btn:active { transform: translateY(0.5px); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 6px 16px -8px rgba(37, 99, 235, 0.8);
}
.btn-primary:hover { background: var(--primary-dark); }

.btn-dark { background: var(--sidebar); color: #fff; }
.btn-dark:hover { background: #1e293b; }

.btn-outline { background: #fff; border-color: var(--border-strong); color: var(--text-2); }
.btn-outline:hover { background: #f8fafc; border-color: #94a3b8; color: var(--text); }

.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: #f1f5f9; color: var(--text); }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; }

.btn-danger-ghost { background: var(--danger-soft); color: var(--danger); border-color: #fecaca; }
.btn-danger-ghost:hover { background: #fee2e2; }

.btn-sm { height: 31px; padding: 0 11px; font-size: 12.5px; border-radius: 7px; }
.btn-lg { height: 42px; padding: 0 20px; font-size: 14px; }
.btn-block { width: 100%; }

.btn.is-loading { pointer-events: none; }

.icon-btn {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  transition: all 0.15s ease;
  flex: none;
}

.icon-btn:hover { background: #f1f5f9; color: var(--text); }
.icon-btn.sm { width: 28px; height: 28px; border-radius: 6px; }

.link-btn {
  border: 0;
  background: none;
  padding: 0;
  font-size: 13px;
  color: var(--primary);
  cursor: pointer;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.link-btn:hover { color: var(--primary-dark); text-decoration: underline; text-underline-offset: 2px; }
.link-btn.danger { color: var(--danger); }

/* ============================== 卡片 ============================== */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  min-width: 0;
}

.card + .card, .card + .section-gap { margin-top: 18px; }

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 17px 20px;
  border-bottom: 1px solid #f1f5f9;
  flex-wrap: wrap;
}

.card-title { font-size: 14.5px; font-weight: 650; letter-spacing: -0.1px; display: flex; align-items: center; gap: 8px; }
.card-title .badge-count {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--primary-dark);
  background: var(--primary-soft);
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  padding: 0 8px;
  line-height: 19px;
}

.card-sub { font-size: 12px; color: var(--muted); margin-top: 3px; }

.card-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.card-body { padding: 20px; }
.card-body.flush { padding: 0; }
.card-body.tight { padding: 14px 20px; }

.card-foot { padding: 12px 20px; border-top: 1px solid #f1f5f9; }

/* ============================== 统计卡 ============================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(196px, 1fr));
  gap: 14px;
}

.stat-card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px 15px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }

.stat-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.stat-label { font-size: 12.5px; color: var(--text-2); font-weight: 500; }

.stat-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}

.tone-blue { background: var(--primary-soft); color: var(--primary); }
.tone-green { background: var(--success-soft); color: var(--success); }
.tone-amber { background: var(--warning-soft); color: var(--warning); }
.tone-red { background: var(--danger-soft); color: var(--danger); }
.tone-violet { background: var(--violet-soft); color: var(--violet); }
.tone-cyan { background: var(--cyan-soft); color: var(--cyan); }

.stat-value { font-size: 26px; font-weight: 750; letter-spacing: -0.8px; margin-top: 10px; line-height: 1.15; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.stat-value.sm { font-size: 22px; }
.stat-foot { font-size: 11.5px; color: var(--muted); margin-top: 5px; display: flex; align-items: center; gap: 5px; }
.stat-accent { position: absolute; right: -26px; top: -26px; width: 86px; height: 86px; border-radius: 50%; opacity: 0.06; background: currentColor; }

/* ============================== 表单 ============================== */
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.label { font-size: 12.5px; font-weight: 500; color: var(--text-2); }
.label .req { color: var(--danger); margin-left: 2px; }

.input, .select, .textarea {
  width: 100%;
  height: 38px;
  padding: 0 11px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  outline: none;
}

.textarea { height: auto; min-height: 76px; padding: 9px 11px; resize: vertical; line-height: 1.5; }

.select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 32px;
  cursor: pointer;
}

.input::placeholder, .textarea::placeholder { color: #b6c2d2; }

.input:hover, .select:hover, .textarea:hover { border-color: #94a3b8; }
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.13);
}

.input.invalid, .select.invalid, .textarea.invalid { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1); }

.input[type="date"] { padding-right: 8px; }
.input:disabled, .select:disabled { background: #f8fafc; color: var(--muted); cursor: not-allowed; }

.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap .input { padding-left: 34px; }
.input-wrap .wrap-icon { position: absolute; left: 11px; color: var(--muted); display: flex; pointer-events: none; }

.search-input { min-width: 200px; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.form-grid .span-2 { grid-column: span 2; }

.form-section-title {
  grid-column: 1 / -1;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.6px;
  color: var(--muted);
  text-transform: uppercase;
  padding-top: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.form-section-title::after { content: ""; flex: 1; height: 1px; background: var(--border); }

.form-hint { font-size: 11.5px; color: var(--muted); margin-top: 2px; line-height: 1.45; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; }

.check { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--text-2); cursor: pointer; user-select: none; }
.check input { width: 15px; height: 15px; accent-color: var(--primary); cursor: pointer; margin: 0; }

.radio-group { display: flex; flex-wrap: wrap; gap: 8px; }
.radio-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  font-size: 13px;
  color: var(--text-2);
  cursor: pointer;
  background: #fff;
  transition: all 0.15s ease;
}
.radio-pill input { position: absolute; opacity: 0; pointer-events: none; }
.radio-pill:hover { border-color: #94a3b8; }
.radio-pill.checked, .radio-pill:has(input:checked) {
  border-color: var(--primary);
  color: var(--primary-dark);
  background: var(--primary-soft);
  font-weight: 600;
}

/* ============================== 筛选栏 ============================== */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid #f1f5f9;
}

.filter-bar .field { min-width: 140px; }
.filter-bar .field.grow { flex: 1 1 190px; }
.filter-bar .range-sep { color: var(--muted); font-size: 12px; padding-bottom: 11px; }
.filter-bar .filter-actions { display: flex; gap: 8px; margin-left: auto; }

/* ============================== 表格 ============================== */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table {
  width: 100%;
  min-width: 720px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}

.table.wide { min-width: 920px; }

.table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
  padding: 10px 14px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  white-space: nowrap;
  letter-spacing: 0.2px;
}

.table tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
  color: var(--text-2);
}

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

.table tbody tr { transition: background 0.12s ease; }
.table tbody tr:hover { background: #f8fafc; }
.table tbody tr.row-click { cursor: pointer; }
.table tbody tr.row-warning { background: #fffbeb; }
.table tbody tr.row-warning:hover { background: #fef3c7; }
.table tbody tr.row-warning td:first-child { box-shadow: inset 3px 0 0 #f59e0b; }

.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table .cell-actions { display: flex; gap: 6px; align-items: center; flex-wrap: nowrap; }

.cell-main { color: var(--text); font-weight: 550; }
.cell-sub { color: var(--muted); font-size: 11.5px; margin-top: 2px; }
.mono { font-family: var(--mono); font-size: 12px; letter-spacing: -0.2px; }
.nowrap { white-space: nowrap; }
.truncate { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.thumb {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  border-radius: 8px;
  overflow: hidden;
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.5px;
  vertical-align: middle;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16);
}
.thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #fff; }

.product-cell { display: flex; align-items: center; gap: 10px; min-width: 0; }
.product-cell .pc-body { min-width: 0; }

/* ============================== 药丸 / 标签 ============================== */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px 2px 7px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 19px;
  white-space: nowrap;
  border: 1px solid transparent;
}

.pill-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0.85; flex: none; }

.pill-warning { color: #b45309; background: #fffbeb; border-color: #fde68a; }
.pill-info { color: #1d4ed8; background: #eff6ff; border-color: #bfdbfe; }
.pill-success { color: #15803d; background: #f0fdf4; border-color: #bbf7d0; }
.pill-danger { color: #b91c1c; background: #fef2f2; border-color: #fecaca; }
.pill-neutral { color: #475569; background: #f8fafc; border-color: #e2e8f0; }
.pill-violet { color: #6d28d9; background: #f5f3ff; border-color: #ddd6fe; }
.pill-cyan { color: #0e7490; background: #ecfeff; border-color: #a5f3fc; }

.platform-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-2); white-space: nowrap; }
.platform-badge .dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }

.demo-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  font-weight: 700;
  color: #6d28d9;
  background: #f5f3ff;
  border: 1px solid #ddd6fe;
  border-radius: 5px;
  padding: 0 6px;
  line-height: 17px;
  letter-spacing: 0.3px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  background: #f8fafc;
  border: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-2);
}

.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }

.amount { font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; white-space: nowrap; }
.amount-pos { color: var(--success); }
.amount-neg { color: var(--danger); }

/* ============================== 分页 ============================== */
.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 20px;
  border-top: 1px solid #f1f5f9;
}

.pager-info { font-size: 12px; color: var(--muted); }
.pager-info strong { color: var(--text-2); font-weight: 600; }
.pager-btns { display: flex; align-items: center; gap: 4px; }

.page-btn {
  min-width: 30px;
  height: 30px;
  padding: 0 8px;
  border-radius: 7px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-2);
  font-size: 12.5px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.14s ease;
}
.page-btn:hover:not(:disabled) { background: #f1f5f9; color: var(--text); }
.page-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); font-weight: 600; box-shadow: 0 4px 10px -6px rgba(37, 99, 235, 0.9); }
.page-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.page-btn.page-arrow { border-color: var(--border); background: #fff; }
.page-btn.page-arrow:hover:not(:disabled) { border-color: var(--border-strong); }

/* ============================== 空状态 / 错误 / 骨架 ============================== */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 46px 24px;
  gap: 4px;
}

.empty-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f1f5f9;
  color: #94a3b8;
  margin-bottom: 8px;
}
.empty-icon.danger { background: var(--danger-soft); color: var(--danger); }

.empty-title { font-size: 14px; font-weight: 600; color: var(--text); }
.empty-desc { font-size: 12.5px; color: var(--muted); max-width: 360px; margin-top: 2px; line-height: 1.6; }
.empty .btn { margin-top: 14px; }

.skeleton-page { display: flex; flex-direction: column; gap: 18px; }
.sk-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(196px, 1fr)); gap: 14px; }
.sk-block, .sk-card {
  border-radius: var(--radius);
  background: #fff;
  border: 1px solid var(--border);
  overflow: hidden;
  position: relative;
}
.sk-card { height: 116px; }
.sk-block { height: 260px; }
.sk-block.sk-lg { height: 360px; }

.sk-block::after, .sk-card::after, .sk-line::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(148, 163, 184, 0.13), transparent);
  transform: translateX(-100%);
  animation: shimmer 1.35s infinite;
}

.sk-line { height: 14px; border-radius: 6px; background: #f1f5f9; position: relative; overflow: hidden; }
.sk-line + .sk-line { margin-top: 10px; }
.sk-line.w40 { width: 40%; }
.sk-line.w60 { width: 60%; }
.sk-lines { padding: 18px 20px; }

.skeleton-inline { padding: 8px 0; }

/* ============================== Spinner ============================== */
.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(37, 99, 235, 0.2);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
  flex: none;
}
.spinner.spinner-xs { width: 13px; height: 13px; border-width: 2px; }
.spinner.spinner-lg { width: 34px; height: 34px; border-width: 3px; border-top-color: #60a5fa; }
.spinner.spinner-light { border-color: rgba(255, 255, 255, 0.35); border-top-color: #fff; }

/* ============================== 弹窗 ============================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(15, 23, 42, 0.52);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 56px 20px 40px;
  overflow-y: auto;
  animation: fadeIn 0.16s ease both;
}

.modal-overlay.closing { animation: fadeOut 0.14s ease both; }

.modal {
  position: relative;
  width: 100%;
  max-width: 560px;
  background: #fff;
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 96px);
  animation: modalIn 0.2s cubic-bezier(0.16, 1, 0.3, 1) both;
  margin: auto 0;
}

.modal-sm { max-width: 420px; }
.modal-md { max-width: 680px; }
.modal-lg { max-width: 900px; }
.modal-xl { max-width: 1040px; }

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 19px 22px 15px;
  border-bottom: 1px solid #f1f5f9;
  flex: none;
}

.modal-title { font-size: 16px; font-weight: 700; letter-spacing: -0.2px; }
.modal-sub { font-size: 12px; color: var(--muted); margin-top: 3px; }
.modal-close { margin: -4px -6px 0 0; }

.modal-body { padding: 20px 22px; overflow-y: auto; flex: 1; min-height: 0; }

.modal-foot {
  padding: 14px 22px;
  border-top: 1px solid #f1f5f9;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  flex: none;
}

.modal-foot .foot-left { margin-right: auto; display: flex; gap: 8px; align-items: center; }

/* ============================== Toast ============================== */
.toast-root {
  position: fixed;
  z-index: 200;
  top: 18px;
  right: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(360px, calc(100vw - 36px));
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: #fff;
  border: 1px solid var(--border);
  border-left: 3px solid var(--primary);
  border-radius: 10px;
  padding: 11px 12px;
  box-shadow: 0 16px 40px -18px rgba(15, 23, 42, 0.45);
  animation: toastIn 0.22s cubic-bezier(0.16, 1, 0.3, 1) both;
  font-size: 13px;
  color: var(--text);
}

.toast.leaving { animation: toastOut 0.18s ease both; }
.toast-icon { flex: none; margin-top: 1px; display: flex; }
.toast-msg { flex: 1; line-height: 1.5; word-break: break-word; }
.toast-close { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 1px; display: flex; border-radius: 4px; flex: none; }
.toast-close:hover { color: var(--text); background: #f1f5f9; }

.toast-success { border-left-color: var(--success); }
.toast-success .toast-icon { color: var(--success); }
.toast-error { border-left-color: var(--danger); }
.toast-error .toast-icon { color: var(--danger); }
.toast-warning { border-left-color: var(--warning); }
.toast-warning .toast-icon { color: var(--warning); }
.toast-info .toast-icon { color: var(--primary); }

/* ============================== 仪表盘 ============================== */
.dash-charts { display: grid; grid-template-columns: 1.25fr 1fr; gap: 18px; margin-top: 18px; align-items: start; }

.chart-body { padding: 10px 20px 16px; }

.trend-chart {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 214px;
  padding: 20px 2px 0;
}

.trend-col {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
}

.trend-bar-wrap {
  width: 100%;
  flex: 1;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  min-height: 0;
}

.trend-bar {
  width: min(68%, 30px);
  min-height: 4px;
  border-radius: 6px 6px 3px 3px;
  background: linear-gradient(180deg, #93c5fd, #3b82f6);
  transition: filter 0.15s ease, transform 0.15s ease;
  position: relative;
}

.trend-col:hover .trend-bar { filter: saturate(1.3) brightness(1.04); transform: translateY(-2px); }
.trend-bar.today { background: linear-gradient(180deg, #60a5fa, #1d4ed8); box-shadow: 0 6px 16px -6px rgba(37, 99, 235, 0.65); }
.trend-bar.zero { background: #e2e8f0; }

.trend-x {
  font-size: 10px;
  color: var(--muted);
  margin-top: 8px;
  height: 14px;
  white-space: nowrap;
  transform: scale(0.94);
}

.trend-tip {
  position: absolute;
  bottom: calc(100% - 16px);
  left: 50%;
  transform: translateX(-50%) translateY(3px);
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 11.5px;
  line-height: 1.5;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.14s ease, transform 0.14s ease;
  z-index: 5;
  box-shadow: 0 12px 28px -12px rgba(15, 23, 42, 0.6);
}

.trend-tip strong { display: block; color: #fff; font-weight: 600; }
.trend-tip span { display: block; color: #94a3b8; }
.trend-col:hover .trend-tip { opacity: 1; transform: translateX(-50%) translateY(0); }

.trend-summary { display: flex; gap: 18px; flex-wrap: wrap; padding: 2px 0 8px; }
.trend-summary .ts-item { font-size: 12px; color: var(--muted); }
.trend-summary .ts-item strong { color: var(--text); font-size: 14px; margin-right: 4px; font-variant-numeric: tabular-nums; }

.donut-wrap { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; padding: 6px 4px 4px; }

.donut {
  width: 158px;
  height: 158px;
  border-radius: 50%;
  position: relative;
  flex: none;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.03);
}

.donut-hole {
  position: absolute;
  inset: 26px;
  border-radius: 50%;
  background: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.04);
}
.donut-hole strong { font-size: 22px; font-weight: 750; letter-spacing: -0.5px; line-height: 1.2; }
.donut-hole span { font-size: 11px; color: var(--muted); }

.legend { display: flex; flex-direction: column; gap: 9px; flex: 1; min-width: 150px; }
.legend-row { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-2); }
.legend-dot { width: 9px; height: 9px; border-radius: 3px; flex: none; }
.legend-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.legend-val { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.legend-pct { color: var(--muted); font-size: 11px; width: 38px; text-align: right; font-variant-numeric: tabular-nums; }

.dist-list { display: flex; flex-direction: column; gap: 12px; }
.dist-row { display: flex; flex-direction: column; gap: 5px; }
.dist-head { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--text-2); }
.dist-head strong { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.dist-track { height: 7px; border-radius: 999px; background: #f1f5f9; overflow: hidden; }
.dist-fill { height: 100%; border-radius: 999px; transition: width 0.5s ease; }

.dash-bottom { margin-top: 18px; }

/* ============================== 店铺 ============================== */
.platform-strip { display: flex; flex-wrap: wrap; gap: 10px; }
.platform-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 13px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: #f8fafc;
  font-size: 12.5px;
  color: var(--text-2);
}
.platform-chip .dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.platform-chip.on { background: var(--primary-soft); border-color: #bfdbfe; color: var(--primary-dark); }
.platform-chip .pc-count { font-size: 11px; color: var(--muted); }
.platform-chip .pc-status { font-size: 10.5px; padding: 0 6px; border-radius: 4px; line-height: 17px; background: #fff; border: 1px solid var(--border); color: var(--muted); }
.platform-chip .pc-status.ok { color: var(--success); border-color: #bbf7d0; background: #f0fdf4; }

.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 16px; }

.shop-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 17px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: box-shadow 0.18s ease, border-color 0.18s ease;
}
.shop-card:hover { box-shadow: var(--shadow); border-color: #cbd5e1; }

.shop-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.shop-name-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.shop-name { font-size: 14.5px; font-weight: 650; color: var(--text); letter-spacing: -0.1px; }
.shop-code { font-size: 11.5px; color: var(--muted); font-family: var(--mono); margin-top: 3px; }

.shop-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; font-size: 12px; }
.shop-meta .meta-item { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.shop-meta .meta-label { color: var(--muted); font-size: 11px; }
.shop-meta .meta-value { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.token-chip { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; }
.token-chip .dot { width: 6px; height: 6px; border-radius: 50%; }

.shop-actions { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 11px; border-top: 1px solid #f1f5f9; }

/* ============================== 详情 / 时间线 ============================== */
.kv-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px 18px; }
.kv-item { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.kv-label { font-size: 11.5px; color: var(--muted); }
.kv-value { font-size: 13px; color: var(--text); word-break: break-word; }
.kv-value.mono { font-size: 12px; }
.kv-value.strong { font-weight: 600; }

.detail-section { margin-bottom: 20px; }
.detail-section:last-child { margin-bottom: 0; }

.section-title {
  font-size: 12.5px;
  font-weight: 650;
  color: var(--text-2);
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 12px;
  letter-spacing: 0.2px;
}
.section-title .icon { color: var(--muted); }

.detail-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 15px 16px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid #f1f5f9;
  margin-bottom: 20px;
}
.detail-hero .dh-main { font-size: 14px; font-weight: 650; }
.detail-hero .dh-sub { font-size: 12px; color: var(--muted); margin-top: 3px; }
.detail-hero .dh-amount { font-size: 22px; font-weight: 750; letter-spacing: -0.5px; text-align: right; }
.detail-hero .dh-amount small { display: block; font-size: 11px; color: var(--muted); font-weight: 500; letter-spacing: 0; margin-top: 2px; }

.order-items { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.order-item-row { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-bottom: 1px solid #f1f5f9; }
.order-item-row:last-child { border-bottom: 0; }
.order-item-row .oi-body { flex: 1; min-width: 0; }
.oi-name { font-size: 13px; color: var(--text); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.oi-sku { font-size: 11px; color: var(--muted); font-family: var(--mono); margin-top: 2px; }
.oi-qty { font-size: 12px; color: var(--muted); white-space: nowrap; }
.oi-amount { font-size: 13px; font-weight: 600; min-width: 88px; text-align: right; font-variant-numeric: tabular-nums; }

.order-total {
  display: flex;
  justify-content: flex-end;
  gap: 26px;
  padding: 12px 14px;
  background: #f8fafc;
  border-top: 1px solid var(--border);
  font-size: 13px;
}
.order-total .ot-row { display: flex; align-items: baseline; gap: 8px; color: var(--muted); }
.order-total .ot-row strong { font-size: 16px; color: var(--text); font-variant-numeric: tabular-nums; }

.timeline { position: relative; padding-left: 22px; margin-top: 4px; }
.timeline::before { content: ""; position: absolute; left: 5px; top: 8px; bottom: 8px; width: 2px; background: #e2e8f0; border-radius: 2px; }
.tl-item { position: relative; padding-bottom: 20px; }
.tl-item:last-child { padding-bottom: 2px; }
.tl-dot {
  position: absolute;
  left: -22px;
  top: 3px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #94a3b8;
  box-shadow: 0 0 0 3px #fff;
}
.tl-item.first .tl-dot { border-color: var(--primary); background: var(--primary); }
.tl-title { font-size: 13px; font-weight: 600; color: var(--text); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tl-meta { font-size: 11.5px; color: var(--muted); margin-top: 3px; display: flex; gap: 10px; flex-wrap: wrap; }
.tl-desc { font-size: 12.5px; color: var(--text-2); margin-top: 4px; line-height: 1.55; }

.info-banner {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--primary-soft);
  border: 1px solid #bfdbfe;
  color: #1e40af;
  font-size: 12.5px;
  line-height: 1.55;
}
.info-banner.warning { background: var(--warning-soft); border-color: #fde68a; color: #92400e; }
.info-banner.danger { background: var(--danger-soft); border-color: #fecaca; color: #991b1b; }
.info-banner svg { flex: none; margin-top: 1px; }

.danger-zone {
  border: 1px solid #fecaca;
  background: #fffbfb;
  border-radius: var(--radius);
  padding: 18px 20px;
}

/* ============================== Tabs ============================== */
.tabs { display: inline-flex; align-items: center; gap: 2px; padding: 3px; background: #f1f5f9; border-radius: 9px; }
.tab {
  border: 0;
  background: transparent;
  padding: 6px 14px;
  border-radius: 7px;
  font-size: 12.5px;
  color: var(--text-2);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.tab:hover { color: var(--text); }
.tab.active { background: #fff; color: var(--primary-dark); font-weight: 600; box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12); }
.tab-badge { font-size: 10.5px; background: #e2e8f0; color: var(--text-2); border-radius: 999px; padding: 0 6px; line-height: 16px; }
.tab.active .tab-badge { background: var(--primary-soft); color: var(--primary-dark); }

/* ============================== 工具类 ============================== */
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.gap-4 { gap: 4px; }
.gap-6 { gap: 6px; }
.gap-8 { gap: 8px; }
.gap-10 { gap: 10px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.w-full { width: 100%; }
.flex-1 { flex: 1; min-width: 0; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.muted { color: var(--muted); }
.text-sm { font-size: 12px; }
.text-xs { font-size: 11px; }
.strong { font-weight: 600; color: var(--text); }
.hidden { display: none !important; }
.divider { height: 1px; background: var(--border); margin: 16px 0; }
.row-actions { display: flex; gap: 2px; align-items: center; flex-wrap: nowrap; }

.section-gap { margin-top: 18px; }

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

/* ============================== 动画 ============================== */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { 100% { transform: translateX(100%); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeOut { from { opacity: 1; } to { opacity: 0; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(12px) scale(0.985); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px) scale(0.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes toastOut { from { opacity: 1; } to { opacity: 0; transform: translateY(-6px); } }
@keyframes floatUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }

/* ============================== 响应式 ============================== */
@media (min-width: 1180px) {
  .stats-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 1200px) {
  .dash-charts { grid-template-columns: 1fr; }
  .login-left { padding: 48px; }
  .login-hero h1 { font-size: 34px; }
}

@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
    box-shadow: 24px 0 60px -30px rgba(15, 23, 42, 0.6);
  }
  body.sidebar-open .sidebar { transform: translateX(0); }
  .main { margin-left: 0; }
  .sidebar-overlay { display: block; }
  body.sidebar-open .sidebar-overlay { opacity: 1; pointer-events: auto; }
  .menu-btn { display: inline-flex; }
  .topbar { padding: 0 16px; }
  .content { padding: 18px 16px 40px; }
  .topbar-user { display: none; }
  .topbar-actions { gap: 8px; }
  .page-actions .btn span.btn-label { display: none; }
  .page-actions .btn { padding: 0 11px; }
  .login-screen { grid-template-columns: 1fr; }
  .login-left { display: none; }
  .login-right { padding: 24px 16px; min-height: 100vh; }
  .login-card { max-width: 420px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: auto; }
  .kv-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sk-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .shop-grid { grid-template-columns: 1fr; }
  .modal-overlay { padding: 20px 12px 24px; align-items: flex-end; }
  .modal { max-height: calc(100vh - 36px); border-radius: 16px; }
  .modal-body { padding: 16px 18px; }
  .modal-head { padding: 16px 18px 12px; }
  .modal-foot { padding: 12px 18px; }
  .trend-chart { height: 190px; gap: 3px; }
  .trend-tip { display: none; }
  .filter-bar { padding: 12px 16px; }
  .filter-bar .field { flex: 1 1 140px; }
  .filter-bar .filter-actions { margin-left: 0; width: 100%; }
  .filter-bar .filter-actions .btn { flex: 1; }
  .card-head { padding: 14px 16px; }
  .card-body { padding: 16px; }
  .pager { padding: 10px 16px; }
  .table thead th, .table tbody td { padding: 10px 12px; }
  .donut-wrap { justify-content: center; }
  .legend { flex: 1 1 100%; }
  .detail-hero .dh-amount { text-align: left; }
  .order-total { justify-content: space-between; }
}

@media (max-width: 560px) {
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-card { padding: 13px 14px; }
  .stat-value { font-size: 19px; }
  .stat-value.sm { font-size: 17px; }
  .stat-label { font-size: 12px; }
  .stat-icon { width: 30px; height: 30px; }
  .sk-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .page-subtitle { display: none; }
  .topbar-title { font-size: 15.5px; }
  .filter-bar .field { flex: 1 1 100%; }
  .shop-meta { grid-template-columns: 1fr; }
  .trend-chart { height: 170px; }
  .trend-x { font-size: 9px; }
  .toast-root { top: 10px; right: 10px; width: calc(100vw - 20px); }
  .page-actions { gap: 6px; }
  .card-head { gap: 8px; }
  .login-card { padding: 28px 22px 22px; }
  .login-features { grid-template-columns: 1fr; }
  .donut { width: 138px; height: 138px; }
  .donut-hole { inset: 23px; }
  .pager { flex-direction: column; align-items: flex-start; gap: 8px; }
  .detail-hero { padding: 12px 14px; }
  .modal-foot { flex-direction: column-reverse; }
  .modal-foot .btn { width: 100%; }
  .modal-foot .foot-left { width: 100%; }
  .order-total { flex-direction: column; gap: 6px; padding: 10px 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* ==========================================================================
   增量：选品采集 / 选品库 / 上架工作流 / 店铺授权中心 / 配置中心
   （仅追加，复用既有变量与设计语言）
   ========================================================================== */

/* ---------- 侧边栏分组 ---------- */
.nav-group + .nav-group { margin-top: 6px; }

/* ---------- 插件接入 / 接口地址 ---------- */
.plugin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 14px 20px;
}

.endpoint-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}

.endpoint-row .endpoint-input {
  flex: 1 1 240px;
  min-width: 0;
  font-family: var(--mono);
  font-size: 12px;
}

.endpoint-row .btn { flex: none; }

/* ---------- 可折叠代码块 ---------- */
.code-folds {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
}

.code-fold {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
}

.code-fold > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 14px;
  font-size: 12.5px;
  color: var(--text-2);
  cursor: pointer;
  list-style: none;
  user-select: none;
  background: #f8fafc;
  transition: background 0.15s ease, color 0.15s ease;
}

.code-fold > summary::-webkit-details-marker { display: none; }
.code-fold > summary:hover { background: #f1f5f9; color: var(--text); }
.code-fold[open] > summary { border-bottom: 1px solid var(--border); }

.code-fold-caret {
  margin-left: auto;
  display: flex;
  color: var(--muted);
  transition: transform 0.18s ease;
}

.code-fold[open] .code-fold-caret { transform: rotate(90deg); }

.code-block {
  margin: 0;
  padding: 14px 16px;
  background: #0f172a;
  color: #e2e8f0;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.7;
  overflow-x: auto;
  white-space: pre;
  tab-size: 2;
}

/* ---------- 采集渠道卡片 ---------- */
.channel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.channel-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 15px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: #fff;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.channel-card:hover {
  border-color: #cbd5e1;
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.channel-head { display: flex; align-items: flex-start; gap: 10px; min-width: 0; }

.channel-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}

.channel-name { font-size: 13.5px; font-weight: 650; color: var(--text); letter-spacing: -0.1px; }
.channel-desc { font-size: 12px; color: var(--muted); line-height: 1.55; margin-top: 3px; }

.channel-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  padding-top: 2px;
}

/* ---------- 评分 ---------- */
.rating-line {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12.5px;
  color: var(--text-2);
}

.rating-line .icon { color: #f59e0b; flex: none; }

/* ---------- 表格勾选 / 加载态 ---------- */
.table .check-cell { width: 38px; padding-right: 4px; }

.table .check-cell input {
  width: 15px;
  height: 15px;
  accent-color: var(--primary);
  cursor: pointer;
  vertical-align: middle;
  margin: 0;
}

.is-loading-zone {
  opacity: 0.55;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

/* ---------- 批量操作栏 ---------- */
.batch-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 20px;
  background: var(--primary-soft);
  border-bottom: 1px solid #bfdbfe;
  font-size: 12.5px;
  color: var(--primary-dark);
}

.batch-bar .batch-info strong { font-weight: 700; font-variant-numeric: tabular-nums; }
.batch-bar .batch-hint { margin-left: auto; color: #3b82f6; font-size: 11.5px; }

/* ---------- 图片墙 / 媒体空态 ---------- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 10px;
}

.gallery-item {
  display: block;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #f8fafc;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.gallery-item:hover { transform: translateY(-1px); box-shadow: var(--shadow); }

.gallery-item .thumb {
  width: 100% !important;
  height: 104px !important;
  border-radius: 0;
  font-size: 30px !important;
}

.gallery-item .thumb img { object-fit: cover; }

.media-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 26px 20px;
  border: 1px dashed var(--border-strong);
  border-radius: 10px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 12.5px;
}

/* ---------- 详情：属性 / 卖点 / 描述 ---------- */
.attr-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 8px 12px;
}

.attr-item {
  display: flex;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid #f1f5f9;
  font-size: 12.5px;
  min-width: 0;
}

.attr-key { color: var(--muted); flex: none; min-width: 64px; }
.attr-val { color: var(--text); word-break: break-word; min-width: 0; }

.bullet-list {
  margin: 0;
  padding-left: 20px;
  font-size: 12.5px;
  color: var(--text-2);
  line-height: 1.7;
}

.bullet-list li + li { margin-top: 4px; }

.desc-text {
  font-size: 12.5px;
  color: var(--text-2);
  line-height: 1.75;
  white-space: pre-wrap;
  word-break: break-word;
}

.claim-preview {
  margin: 0;
  padding-left: 20px;
  font-size: 12.5px;
  color: var(--text-2);
  line-height: 1.75;
}

.claim-preview li { word-break: break-word; }

/* ---------- 上架进度条 ---------- */
.progress-cell { min-width: 150px; }

.progress-track {
  height: 6px;
  border-radius: 999px;
  background: #f1f5f9;
  overflow: hidden;
  margin: 3px 0 5px;
}

.progress-fill {
  height: 100%;
  border-radius: 999px;
  background: #cbd5e1;
  transition: width 0.45s ease;
}

.progress-fill.queued { background: #cbd5e1; }
.progress-fill.running { background: linear-gradient(90deg, #3b82f6, #06b6d4); }
.progress-fill.success { background: var(--success); }
.progress-fill.failed { background: var(--danger); }

.progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
  color: var(--muted);
  min-width: 0;
}

/* ---------- 平台授权卡片 ---------- */
.platform-auth-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(248px, 1fr));
  gap: 14px;
}

.platform-auth-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 15px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.platform-auth-card:hover {
  border-color: #cbd5e1;
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.pac-top { display: flex; align-items: flex-start; gap: 10px; min-width: 0; }

.pac-logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.3px;
  flex: none;
  box-shadow: 0 6px 14px -8px rgba(15, 23, 42, 0.6);
}

.pac-name { font-size: 13.5px; font-weight: 650; color: var(--text); letter-spacing: -0.1px; }

.pac-sub {
  font-size: 11px;
  color: var(--muted);
  font-family: var(--mono);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pac-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
}

.pac-meta-item { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.pac-meta-label { font-size: 11px; color: var(--muted); }
.pac-meta-value { font-size: 12px; color: var(--text-2); font-weight: 500; }

.pac-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; }
.pac-actions .btn { flex: 1 1 auto; }

/* ---------- 配置中心：过滤卡片 ---------- */
.check-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 14px;
}

.check-card {
  align-items: flex-start;
  gap: 9px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #f8fafc;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.check-card:hover { border-color: var(--border-strong); background: #fff; }
.check-card input { margin-top: 2px; flex: none; }

.check-card .check-title { display: block; font-size: 12.5px; font-weight: 600; color: var(--text); }
.check-card .check-desc { display: block; font-size: 11.5px; color: var(--muted); line-height: 1.5; margin-top: 1px; }

/* ---------- 字段说明 ---------- */
.field-doc { display: flex; flex-direction: column; background: #fff; }

.field-doc-row {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 12px;
  padding: 8px 14px;
  border-bottom: 1px solid #f1f5f9;
  font-size: 12.5px;
  color: var(--text-2);
  line-height: 1.55;
}

.field-doc-row:last-child { border-bottom: 0; }
.field-doc-key { font-family: var(--mono); font-size: 12px; color: var(--primary-dark); word-break: break-word; }

/* ---------- 增量页面响应式 ---------- */
@media (max-width: 900px) {
  .plugin-grid { grid-template-columns: 1fr; }
  .channel-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .platform-auth-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gallery-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .check-grid { grid-template-columns: 1fr; }
  .batch-bar { padding: 10px 16px; }
  .batch-bar .batch-hint { display: none; }
  .field-doc-row { grid-template-columns: 1fr; gap: 2px; }
}

@media (max-width: 560px) {
  .channel-grid { grid-template-columns: 1fr; }
  .platform-auth-grid { grid-template-columns: 1fr; }
  .gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .endpoint-row .btn { flex: 1 1 auto; }
  .progress-cell { min-width: 120px; }
  .attr-list { grid-template-columns: 1fr; }
}

/* 补充工具类（增量页面使用） */
.flex-wrap { flex-wrap: wrap; }

/* 页签在窄屏下横向滚动，避免溢出卡片 */
.card-tools { max-width: 100%; min-width: 0; }
.card-head .tabs {
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}
.card-head .tabs::-webkit-scrollbar { display: none; }

/* ==========================================================================
   增量：数据质量 / 告警 / 变体 / 一次性令牌 / 一致性维护
   （仅追加，复用既有变量与设计语言）
   ========================================================================== */

/* ---------- 列表：告警角标、币种修正标签 ---------- */
.warn-badge {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-left: 6px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--warning-soft);
  border: 1px solid #fde68a;
  color: #b45309;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 17px;
  white-space: nowrap;
  vertical-align: 1px;
}

.tag-currency,
.tag-unconfirmed {
  display: inline-flex;
  align-items: center;
  margin-left: 4px;
  padding: 0 5px;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 600;
  line-height: 16px;
  white-space: nowrap;
  vertical-align: 1px;
}

.tag-currency { color: #6d28d9; background: #f5f3ff; border: 1px solid #ddd6fe; }
.tag-unconfirmed { color: #b45309; background: #fffbeb; border: 1px solid #fde68a; }

/* ---------- 详情：数据质量告警区 ---------- */
.alert-list { display: flex; flex-direction: column; gap: 8px; }

.alert-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: #f8fafc;
  color: var(--text-2);
  font-size: 12.5px;
  line-height: 1.55;
}

.alert-item.warn { background: var(--warning-soft); border-color: #fde68a; color: #92400e; }
.alert-item.info { background: #f8fafc; border-color: var(--border); color: var(--text-2); }

.alert-level {
  flex: none;
  padding: 0 5px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  margin-top: 1px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid currentColor;
  opacity: 0.9;
}

.alert-msg { min-width: 0; word-break: break-word; }

.alert-code {
  flex: none;
  margin-left: auto;
  font-family: var(--mono);
  font-size: 10.5px;
  opacity: 0.7;
  white-space: nowrap;
}

/* ---------- 详情：变体表 ---------- */
.variant-wrap { border: 1px solid var(--border); border-radius: 10px; overflow: auto; }
.variant-wrap .table { min-width: 560px; }
.variant-options { display: flex; flex-wrap: wrap; gap: 4px; }
.variant-option {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 7px;
  border-radius: 999px;
  background: #f8fafc;
  border: 1px solid var(--border);
  font-size: 11px;
  color: var(--text-2);
  white-space: nowrap;
}
.variant-option b { font-weight: 600; color: var(--text); }

/* ---------- 一次性令牌弹窗 ---------- */
.token-once {
  border: 1px solid #fde68a;
  background: var(--warning-soft);
  border-radius: 10px;
  padding: 14px;
}

.token-once-value {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.token-once-value .input {
  flex: 1 1 260px;
  min-width: 0;
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.2px;
}

.token-once-note { margin-top: 10px; font-size: 11.5px; color: #92400e; line-height: 1.55; }

/* ---------- 系统设置：数据一致性维护 ---------- */
.maint-counts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.maint-count {
  border: 1px solid var(--border);
  background: #f8fafc;
  border-radius: 10px;
  padding: 10px 12px;
}

.maint-count .maint-count-label { font-size: 11.5px; color: var(--muted); }
.maint-count .maint-count-value { font-size: 20px; font-weight: 750; letter-spacing: -0.4px; margin-top: 2px; }
.maint-count.ok .maint-count-value { color: var(--success); }
.maint-count.warn .maint-count-value { color: #b45309; }

.maint-list { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.maint-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  font-size: 12.5px;
  color: var(--text-2);
}
.maint-row .mono { font-size: 12px; }

@media (max-width: 560px) {
  .token-once-value .input { flex: 1 1 100%; }
  .alert-code { display: none; }
  .variant-wrap .table { min-width: 480px; }
}
