/* 货盘链 ERP 原型样式 */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 14px; color: #1e293b; background: #f1f5f9;
}
a { text-decoration: none; color: inherit; }
button { font-family: inherit; cursor: pointer; }

/* ===== 布局 ===== */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 224px; background: #0f172a; color: #94a3b8;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.sidebar .logo {
  display: flex; align-items: center; gap: 10px; padding: 18px 20px;
  color: #fff; font-size: 16px; font-weight: 700; border-bottom: 1px solid #1e293b;
}
.sidebar .logo .dot {
  width: 30px; height: 30px; border-radius: 8px; background: linear-gradient(135deg, #2563eb, #7c3aed);
  display: flex; align-items: center; justify-content: center; font-size: 15px;
}
.sidebar .nav { padding: 12px 10px; flex: 1; }
.sidebar .nav-group { font-size: 11px; color: #64748b; padding: 14px 10px 6px; letter-spacing: 1px; }
.sidebar .nav a {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px;
  font-size: 13.5px; margin-bottom: 2px; transition: background .15s;
}
.sidebar .nav a:hover { background: #1e293b; color: #e2e8f0; }
.sidebar .nav a.active { background: #2563eb; color: #fff; }
.sidebar .nav a .ico { width: 18px; text-align: center; }
.sidebar .user-box { padding: 14px 20px; border-top: 1px solid #1e293b; font-size: 12px; }
.sidebar .user-box .name { color: #e2e8f0; font-weight: 600; }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: 56px; background: #fff; border-bottom: 1px solid #e2e8f0;
  display: flex; align-items: center; justify-content: space-between; padding: 0 24px; position: sticky; top: 0; z-index: 10;
}
.topbar .page-title { font-size: 16px; font-weight: 600; }
.topbar .right { display: flex; align-items: center; gap: 12px; }
.content { padding: 24px; max-width: 1280px; width: 100%; margin: 0 auto; }

/* ===== 组件 ===== */
.card { background: #fff; border: 1px solid #e2e8f0; border-radius: 10px; padding: 20px; }
.card + .card { margin-top: 16px; }
.card-title { font-size: 15px; font-weight: 600; margin-bottom: 14px; display: flex; align-items: center; justify-content: space-between; }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 16px; }
.stat-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 10px; padding: 18px; }
.stat-card .label { font-size: 12.5px; color: #64748b; }
.stat-card .value { font-size: 26px; font-weight: 700; margin-top: 6px; }
.stat-card .sub { font-size: 12px; color: #94a3b8; margin-top: 4px; }
.stat-card .value.up { color: #16a34a; }
.stat-card .value.warn { color: #d97706; }

.badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 500; white-space: nowrap;
}
.badge.pending { background: #fef3c7; color: #b45309; }
.badge.shipped { background: #dbeafe; color: #1d4ed8; }
.badge.done { background: #dcfce7; color: #15803d; }
.badge.cancel { background: #f1f5f9; color: #64748b; }
.badge.draft { background: #f1f5f9; color: #64748b; }
.badge.off { background: #fee2e2; color: #b91c1c; }
.badge.live { background: #dcfce7; color: #15803d; }
.badge.connected { background: #dcfce7; color: #15803d; }
.badge.disconnected { background: #f1f5f9; color: #64748b; }
.badge.partner { background: #ede9fe; color: #6d28d9; }

table.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left; font-size: 12px; color: #64748b; font-weight: 500;
  padding: 10px 14px; background: #f8fafc; border-bottom: 1px solid #e2e8f0; white-space: nowrap;
}
.table td { padding: 12px 14px; border-bottom: 1px solid #f1f5f9; font-size: 13.5px; vertical-align: middle; }
.table tr:hover td { background: #f8fafc; }
.table .strong { font-weight: 600; }
.table .muted { color: #94a3b8; font-size: 12.5px; }

.btn {
  display: inline-flex; align-items: center; gap: 6px; border: 1px solid #e2e8f0; background: #fff;
  color: #334155; padding: 7px 14px; border-radius: 8px; font-size: 13px; font-weight: 500; transition: all .15s;
}
.btn:hover { background: #f8fafc; border-color: #cbd5e1; }
.btn-primary { background: #2563eb; border-color: #2563eb; color: #fff; }
.btn-primary:hover { background: #1d4ed8; border-color: #1d4ed8; }
.btn-sm { padding: 4px 10px; font-size: 12.5px; border-radius: 6px; }
.btn-success { background: #16a34a; border-color: #16a34a; color: #fff; }
.btn-success:hover { background: #15803d; }
.btn-danger { background: #dc2626; border-color: #dc2626; color: #fff; }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: #475569; margin-bottom: 6px; font-weight: 500; }
.field .hint { font-size: 12px; color: #94a3b8; margin-top: 4px; }
.input, .select, .textarea {
  width: 100%; border: 1px solid #cbd5e1; border-radius: 8px; padding: 8px 12px; font-size: 13.5px;
  font-family: inherit; color: #1e293b; background: #fff; outline: none;
}
.input:focus, .select:focus, .textarea:focus { border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37, 99, 235, .12); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }

/* ===== 表格内商品缩略 ===== */
.prod-cell { display: flex; align-items: center; gap: 10px; }
.prod-thumb {
  width: 40px; height: 40px; border-radius: 8px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 18px; color: #fff;
}
.prod-cell .name { font-weight: 500; font-size: 13.5px; }
.prod-cell .sku { font-size: 12px; color: #94a3b8; }

/* ===== 筛选栏 ===== */
.filter-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.filter-bar .input, .filter-bar .select { width: auto; min-width: 140px; }
.filter-bar .spacer { flex: 1; }

/* ===== Toast ===== */
#toast {
  position: fixed; right: 24px; bottom: 24px; background: #0f172a; color: #fff;
  padding: 12px 18px; border-radius: 10px; font-size: 13.5px; box-shadow: 0 8px 24px rgba(0,0,0,.2);
  opacity: 0; transform: translateY(10px); transition: all .25s; z-index: 999; pointer-events: none;
}
#toast.show { opacity: 1; transform: translateY(0); }
#toast .ok { color: #4ade80; }

/* ===== 状态时间线 ===== */
.timeline { display: flex; align-items: center; gap: 0; margin: 6px 0 2px; }
.tl-step { flex: 1; text-align: center; position: relative; }
.tl-step .dot { width: 12px; height: 12px; border-radius: 50%; background: #cbd5e1; margin: 0 auto 6px; position: relative; z-index: 1; }
.tl-step.done .dot { background: #2563eb; }
.tl-step.done .label { color: #1e293b; font-weight: 600; }
.tl-step .label { font-size: 12px; color: #94a3b8; }
.tl-step .time { font-size: 11px; color: #cbd5e1; margin-top: 2px; }
.tl-step:not(:first-child)::before {
  content: ""; position: absolute; top: 5px; left: -50%; width: 100%; height: 2px; background: #e2e8f0;
}
.tl-step.done:not(:first-child)::before { background: #2563eb; }

/* ===== 图表 ===== */
.bars { display: flex; align-items: flex-end; gap: 12px; height: 140px; padding-top: 10px; }
.bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.bar .col { width: 100%; max-width: 36px; background: linear-gradient(180deg, #60a5fa, #2563eb); border-radius: 6px 6px 0 0; min-height: 4px; }
.bar .day { font-size: 11.5px; color: #94a3b8; }
.bar .num { font-size: 11.5px; color: #475569; font-weight: 600; }

/* ===== 详情页 ===== */
.detail-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 16px; align-items: start; }
.info-list { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 24px; }
.info-list .item .k { font-size: 12px; color: #94a3b8; margin-bottom: 2px; }
.info-list .item .v { font-size: 13.5px; font-weight: 500; }

/* ===== 空态 / 占位 ===== */
.empty { text-align: center; padding: 48px 0; color: #94a3b8; }
.empty .big { font-size: 40px; margin-bottom: 10px; }

/* ===== 登录页 ===== */
.login-wrap { min-height: 100vh; display: flex; }
.login-left {
  flex: 1.2; background: linear-gradient(150deg, #0f172a 0%, #1e3a8a 60%, #312e81 100%);
  color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: center;
}
.login-left h1 { font-size: 30px; margin-bottom: 12px; }
.login-left p { color: #cbd5e1; line-height: 1.8; font-size: 14px; max-width: 460px; }
.login-left .steps { margin-top: 32px; display: flex; flex-direction: column; gap: 14px; }
.login-left .step { display: flex; gap: 12px; align-items: flex-start; }
.login-left .step .n { width: 24px; height: 24px; border-radius: 50%; background: rgba(255,255,255,.15); display: flex; align-items: center; justify-content: center; font-size: 12px; flex-shrink: 0; }
.login-right { flex: 1; display: flex; align-items: center; justify-content: center; background: #f8fafc; }
.login-card { width: 360px; background: #fff; border: 1px solid #e2e8f0; border-radius: 14px; padding: 32px; box-shadow: 0 8px 30px rgba(15, 23, 42, .06); }
.login-card h2 { font-size: 18px; margin-bottom: 4px; }
.login-card .sub { font-size: 12.5px; color: #94a3b8; margin-bottom: 22px; }
.login-card .demo-tip { background: #eff6ff; border: 1px solid #bfdbfe; color: #1d4ed8; font-size: 12px; border-radius: 8px; padding: 10px 12px; margin-top: 18px; line-height: 1.6; }

/* ===== 供应商切换 ===== */
.switch-box { font-size: 12px; color: #64748b; }
.switch-box select { margin-left: 6px; }

/* ===== 原型提示条 ===== */
.proto-bar {
  background: #fefce8; border-bottom: 1px solid #fde68a; color: #854d0e; font-size: 12.5px;
  padding: 7px 24px; display: flex; align-items: center; gap: 8px;
}

/* ===== 扩展组件：Tabs / 审核 / 变体 / 预警 ===== */
.tabs { display: flex; gap: 4px; border-bottom: 2px solid #e2e8f0; margin-bottom: 16px; }
.tabs a { padding: 9px 16px; font-size: 13.5px; color: #64748b; border-bottom: 2px solid transparent; margin-bottom: -2px; }
.tabs a.active { color: #2563eb; font-weight: 600; border-bottom-color: #2563eb; }

.badge.reviewing { background: #fef3c7; color: #b45309; }
.badge.rejected { background: #fee2e2; color: #b91c1c; }
.badge.timeout { background: #fee2e2; color: #dc2626; }

.tag { display: inline-flex; padding: 1px 8px; border-radius: 6px; background: #f1f5f9; color: #475569; font-size: 12px; border: 1px solid #e2e8f0; margin-right: 4px; }
.tag.spec { background: #eff6ff; border-color: #bfdbfe; color: #1d4ed8; }

.alert-bar {
  display: flex; align-items: center; gap: 8px; background: #fef2f2; border: 1px solid #fecaca;
  color: #b91c1c; border-radius: 10px; padding: 10px 16px; font-size: 13px; margin-bottom: 16px;
}
.alert-bar.warn { background: #fffbeb; border-color: #fde68a; color: #92400e; }

.warn-cell { color: #dc2626; font-weight: 600; }
.oversee { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #dc2626; margin-right: 6px; }
.dot-green { width: 8px; height: 8px; border-radius: 50%; background: #16a34a; display: inline-block; margin-right: 6px; }

.upload-box {
  border: 2px dashed #cbd5e1; border-radius: 10px; padding: 28px; text-align: center;
  color: #94a3b8; font-size: 13px; cursor: pointer; transition: all .15s;
}
.upload-box:hover { border-color: #2563eb; color: #2563eb; background: #eff6ff; }

.avatar { width: 32px; height: 32px; border-radius: 50%; background: #e0e7ff; color: #4338ca; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; }

.share-banner {
  background: linear-gradient(90deg, #1e3a8a, #312e81); color: #fff; border-radius: 10px;
  padding: 14px 18px; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px;
}
.share-banner .url { font-size: 12.5px; color: #bfdbfe; }

.merchant-head { display: flex; align-items: center; gap: 14px; }
.merchant-head .avatar-lg { width: 48px; height: 48px; border-radius: 12px; background: #e0e7ff; color: #4338ca; display: flex; align-items: center; justify-content: center; font-size: 22px; }

/* ===== 顶栏账号 ===== */
.top-user { display: flex; align-items: center; gap: 10px; margin-left: 4px; }
.top-user .tu-name { font-size: 13px; font-weight: 600; line-height: 1.3; }
.top-user .tu-sub { font-size: 11.5px; color: #94a3b8; line-height: 1.3; }

/* ===== 分页 ===== */
.pagination { display: flex; align-items: center; gap: 6px; padding: 14px 16px; border-top: 1px solid #f1f5f9; }
.pagination .info { font-size: 12.5px; color: #94a3b8; margin-right: auto; }
.pagination .info b { color: #475569; }
.pagination a.page {
  min-width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid #e2e8f0; border-radius: 6px; font-size: 12.5px; color: #475569; background: #fff; user-select: none;
}
.pagination a.page:hover:not(.active):not(.disabled) { border-color: #2563eb; color: #2563eb; }
.pagination a.page.active { background: #2563eb; border-color: #2563eb; color: #fff; }
.pagination a.page.disabled { opacity: .4; pointer-events: none; }

@media (max-width: 960px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .detail-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .sidebar { display: none; }
}
