/* 九寨沟县农特产品展示展销中心 · 商家后台
   纯静态样式，无外部依赖。 */

:root {
  --brand: #1F7A4D;
  --brand-dark: #175F3B;
  --brand-light: #E6F2EB;
  --brand-soft: #F2F8F4;
  --accent: #C8862C;
  --accent-light: #FBF3E5;
  --danger: #C0392B;
  --danger-light: #FBECEA;
  --blue: #2E6DA4;
  --blue-light: #EAF1F8;
  --bg: #F5F4EF;
  --card: #FFFFFF;
  --line: #E8E6DF;
  --line-strong: #D9D6CC;
  --text: #1C1C1C;
  --text-2: #6B6B6B;
  --text-3: #9A9A9A;
  --side: #1F2933;
  --side-2: #293542;
  --side-text: #C8D0D8;
  --side-muted: #7E8A96;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(31, 41, 51, .04), 0 6px 18px rgba(31, 41, 51, .05);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", sans-serif;
}

* { box-sizing: border-box; }

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

body {
  min-width: 1280px;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--brand); text-decoration: none; }

h1, h2, h3, h4, p { margin: 0; }

.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.text-right { text-align: right; }
.text-muted { color: var(--text-2); }
.text-weak { color: var(--text-3); }
.text-danger { color: var(--danger); }
.text-brand { color: var(--brand); }
.grow { flex: 1; }

/* ---------- 布局 ---------- */
.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 220px;
  background: var(--side);
  color: var(--side-text);
  display: flex;
  flex-direction: column;
  z-index: 40;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 18px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, .07);
}

.brand-logo {
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 10px;
  background: linear-gradient(145deg, var(--brand), #2E9963);
  color: #fff;
  font-size: 19px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 1px;
  box-shadow: 0 4px 12px rgba(31, 122, 77, .35);
}

.brand-text { min-width: 0; }
.brand-name {
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.brand-sub {
  color: var(--side-muted);
  font-size: 11px;
  letter-spacing: 1px;
  margin-top: 2px;
}

.nav {
  flex: 1;
  overflow-y: auto;
  padding: 14px 10px 20px;
}
.nav::-webkit-scrollbar { width: 6px; }
.nav::-webkit-scrollbar-thumb { background: #3A4653; border-radius: 3px; }

.nav-group + .nav-group { margin-top: 14px; }
.nav-group-title {
  padding: 0 12px 8px;
  font-size: 11px;
  letter-spacing: 1.5px;
  color: var(--side-muted);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 40px;
  padding: 0 12px;
  margin-bottom: 2px;
  border-radius: var(--radius-sm);
  color: var(--side-text);
  font-size: 14px;
  cursor: pointer;
  border: 0;
  background: transparent;
  width: 100%;
  text-align: left;
  transition: background .16s, color .16s;
}
.nav-item:hover { background: var(--side-2); color: #fff; }
.nav-item.active {
  background: rgba(31, 122, 77, .22);
  color: #fff;
  box-shadow: inset 2px 0 0 #46B97C;
}
.nav-icon {
  width: 18px;
  height: 18px;
  flex: none;
  display: inline-flex;
  opacity: .85;
}
.nav-icon svg { width: 100%; height: 100%; }
.nav-item.active .nav-icon { opacity: 1; color: #6FDDA4; }

.side-foot {
  padding: 14px 16px 18px;
  border-top: 1px solid rgba(255, 255, 255, .07);
  display: flex;
  align-items: center;
  gap: 10px;
}
.avatar {
  width: 32px;
  height: 32px;
  flex: none;
  border-radius: 50%;
  background: #35424F;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
}
.side-user { flex: 1; min-width: 0; }
.side-user-name { color: #fff; font-size: 13px; }
.side-user-role { color: var(--side-muted); font-size: 11px; }
.logout-btn {
  flex: none;
  border: 1px solid rgba(255, 255, 255, .14);
  background: transparent;
  color: var(--side-text);
  font-size: 12px;
  padding: 4px 9px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.logout-btn:hover { border-color: rgba(255, 255, 255, .3); color: #fff; }

.main {
  flex: 1;
  min-width: 0;
  margin-left: 220px;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: 56px;
  flex: none;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 30;
}
.crumb { color: var(--text-3); font-size: 13px; display: flex; align-items: center; gap: 8px; }
.crumb b { color: var(--text); font-weight: 600; font-size: 14px; }
.crumb .sep { color: #C6C3BA; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.env-chip {
  font-size: 12px;
  color: var(--text-2);
  background: #F2F1EB;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 10px;
}

.content {
  padding: 22px 24px 40px;
  width: 100%;
  max-width: 1500px;
}

/* ---------- 页脚 / ICP 备案 ---------- */
.app-foot {
  margin-top: auto;
  padding: 16px 24px 26px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text-3);
  font-size: 12px;
}
.app-foot-sep { color: #C6C3BA; }
.icp-link {
  color: inherit;
  text-decoration: none;
}
.icp-link:hover { color: var(--brand); text-decoration: underline; }

/* ---------- 页头 ---------- */
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.page-title { font-size: 22px; font-weight: 650; letter-spacing: .2px; }
.page-sub { color: var(--text-2); font-size: 13px; margin-top: 4px; }
.page-actions { display: flex; align-items: center; gap: 8px; }

/* ---------- 卡片 ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 18px;
  overflow: hidden;
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
}
.card-head h3 { font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.card-head h3::before {
  content: "";
  width: 3px;
  height: 14px;
  border-radius: 2px;
  background: var(--brand);
  display: inline-block;
}
.card-extra { display: flex; align-items: center; gap: 8px; color: var(--text-2); font-size: 13px; }
.card-body { padding: 18px; }
.card-body.flush { padding: 0; }

/* ---------- KPI ---------- */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
.kpi {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.kpi::after {
  content: "";
  position: absolute;
  right: -24px;
  top: -24px;
  width: 86px;
  height: 86px;
  border-radius: 50%;
  background: var(--brand-soft);
}
.kpi.warn::after { background: var(--accent-light); }
.kpi.danger::after { background: var(--danger-light); }
.kpi-label { color: var(--text-2); font-size: 13px; display: flex; align-items: center; gap: 6px; }
.kpi-value { font-size: 28px; font-weight: 650; letter-spacing: .3px; margin-top: 8px; font-variant-numeric: tabular-nums; }
.kpi-value small { font-size: 14px; font-weight: 500; color: var(--text-2); margin-left: 4px; }
.kpi-foot { color: var(--text-3); font-size: 12px; margin-top: 6px; position: relative; z-index: 1; }

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

/* ---------- 工具栏 ---------- */
.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: #FCFCFA;
}
.toolbar-group { display: flex; align-items: center; gap: 8px; }
.toolbar-label { font-size: 13px; color: var(--text-2); }

/* ---------- 表单控件 ---------- */
.input, .select, .textarea {
  height: 34px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: #fff;
  padding: 0 10px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  min-width: 0;
}
.textarea { height: auto; min-height: 84px; padding: 8px 10px; resize: vertical; line-height: 1.6; }
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(31, 122, 77, .12);
}
.input::placeholder, .textarea::placeholder { color: #B4B1A8; }
.input[type="date"], .input[type="datetime-local"] { padding-left: 8px; }
.select { padding-right: 26px; cursor: pointer; }

.input-sm { height: 30px; font-size: 13px; }
.w-90 { width: 90px; }
.w-110 { width: 110px; }
.w-140 { width: 140px; }
.w-160 { width: 160px; }
.w-200 { width: 200px; }
.w-240 { width: 240px; }
.w-full { width: 100%; }

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 18px;
}
.form-grid .span-2 { grid-column: span 2; }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field .input, .field .select, .field .textarea { width: 100%; }
.field-label { font-size: 13px; color: var(--text-2); display: flex; align-items: center; gap: 4px; }
.field-label .req { color: var(--danger); }
.field-hint { font-size: 12px; color: var(--text-3); }
.field-error .input, .field-error .select, .field-error .textarea { border-color: var(--danger); }

.check-row { display: flex; flex-wrap: wrap; gap: 8px 18px; padding-top: 2px; }
.check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  user-select: none;
}
.check input[type="checkbox"], .check input[type="radio"] {
  width: 15px;
  height: 15px;
  accent-color: var(--brand);
  cursor: pointer;
}

.form-section + .form-section {
  border-top: 1px dashed var(--line);
  margin-top: 20px;
  padding-top: 18px;
}
.form-section-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.form-section-title .badge-soft {
  font-size: 11px;
  font-weight: 400;
  color: var(--text-2);
  background: #F2F1EB;
  border-radius: 4px;
  padding: 1px 6px;
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--text);
  font-size: 13.5px;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
}
.btn:hover { border-color: #C3BFB2; background: #FBFAF7; }
.btn:active { transform: translateY(.5px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  box-shadow: 0 2px 8px rgba(31, 122, 77, .2);
}
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn-accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-accent:hover { background: #B07422; border-color: #B07422; }
.btn-danger { background: #fff; border-color: #E9C4BF; color: var(--danger); }
.btn-danger:hover { background: var(--danger-light); border-color: #DDA9A2; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: #F1F0EA; color: var(--text); }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12.5px; border-radius: 5px; }
.btn-xs { height: 24px; padding: 0 8px; font-size: 12px; border-radius: 4px; }
.btn-link {
  border: 0;
  background: none;
  color: var(--brand);
  padding: 0 2px;
  height: auto;
  font-size: 12.5px;
  cursor: pointer;
}
.btn-link:hover { text-decoration: underline; }
.btn-link.danger { color: var(--danger); }
.btn-icon { width: 32px; padding: 0; }

/* ---------- 表格 ---------- */
.table-wrap { width: 100%; overflow-x: auto; }
table.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
table.table thead th {
  background: #FAF9F5;
  color: var(--text-2);
  font-weight: 500;
  font-size: 12.5px;
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  position: sticky;
  top: 0;
}
table.table tbody td {
  padding: 11px 14px;
  border-bottom: 1px solid #F0EEE7;
  vertical-align: middle;
}
table.table tbody tr:nth-child(even) { background: #FCFCFA; }
table.table tbody tr:hover { background: var(--brand-soft); }
table.table tbody tr:last-child td { border-bottom: 0; }
.cell-main { color: var(--text); font-weight: 500; }
.cell-sub { color: var(--text-3); font-size: 12px; margin-top: 2px; }
.cell-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.thumb {
  width: 42px;
  height: 42px;
  border-radius: 6px;
  object-fit: cover;
  background: #F2F1EB;
  border: 1px solid var(--line);
  display: block;
}
.thumb-lg { width: 54px; height: 54px; }
.thumb-ph {
  width: 42px;
  height: 42px;
  border-radius: 6px;
  background: #F2F1EB;
  border: 1px dashed var(--line-strong);
  color: var(--text-3);
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.product-cell { display: flex; align-items: center; gap: 10px; min-width: 220px; }
.product-cell .p-name { font-weight: 500; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.product-cell .p-sub { color: var(--text-3); font-size: 12px; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- 标签 ---------- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  border: 1px solid transparent;
}
.tag-green { background: #E9F5EE; color: #1B6B44; border-color: #CDE8DA; }
.tag-blue { background: var(--blue-light); color: #2A5F8F; border-color: #D3E3F2; }
.tag-gold { background: var(--accent-light); color: #96631C; border-color: #F0DFC0; }
.tag-red { background: var(--danger-light); color: #A43226; border-color: #F0D2CE; }
.tag-orange { background: #FDF1E3; color: #A66A16; border-color: #F3DFC4; }
.tag-gray { background: #F2F1EC; color: #6B6B6B; border-color: #E4E1D8; }
.tag-outline-gold { background: #fff; color: var(--accent); border-color: #E2C48F; }
.tag-dot::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  display: inline-block;
}
.tag-stack { display: inline-flex; flex-wrap: wrap; gap: 4px; }

/* ---------- 分页 ---------- */
.pager {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 18px;
  border-top: 1px solid var(--line);
  background: #FCFCFA;
}
.pager-info { color: var(--text-2); font-size: 12.5px; margin-right: auto; }
.pager-btn {
  min-width: 30px;
  height: 30px;
  padding: 0 8px;
  border: 1px solid var(--line-strong);
  background: #fff;
  border-radius: 5px;
  color: var(--text-2);
  font-size: 12.5px;
  cursor: pointer;
}
.pager-btn:hover:not(:disabled) { border-color: var(--brand); color: var(--brand); }
.pager-btn.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.pager-btn:disabled { opacity: .45; cursor: not-allowed; }
.pager-gap { color: var(--text-3); font-size: 12px; }

/* ---------- 空状态 / 加载 ---------- */
.empty { padding: 38px 20px; text-align: center; color: var(--text-3); }
.empty-icon { font-size: 26px; opacity: .5; margin-bottom: 6px; }
.empty-title { color: var(--text-2); font-size: 13.5px; }
.empty-hint { font-size: 12px; margin-top: 4px; }

.is-busy { opacity: .55; pointer-events: none; transition: opacity .15s; }

.skeleton {
  height: 14px;
  border-radius: 4px;
  background: linear-gradient(90deg, #F0EEE7 25%, #F7F6F1 37%, #F0EEE7 63%);
  background-size: 400% 100%;
  animation: shimmer 1.2s ease infinite;
}
@keyframes shimmer {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

.spinner {
  width: 15px;
  height: 15px;
  border: 2px solid rgba(255, 255, 255, .35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: inline-block;
}
.btn-ghost .spinner, .btn:not(.btn-primary):not(.btn-accent) .spinner {
  border-color: rgba(31, 41, 51, .2);
  border-top-color: var(--brand);
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 弹窗 ---------- */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(20, 26, 31, .45);
  z-index: 100;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 48px 20px;
  overflow-y: auto;
  animation: fade .16s ease;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.modal {
  background: #fff;
  border-radius: 12px;
  width: 560px;
  max-width: 100%;
  box-shadow: 0 18px 50px rgba(15, 23, 30, .28);
  animation: pop .18s ease;
  margin: auto 0;
}
@keyframes pop {
  from { transform: translateY(-8px); opacity: .6; }
  to { transform: translateY(0); opacity: 1; }
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}
.modal-head h3 { font-size: 16px; font-weight: 600; }
.modal-x {
  border: 0;
  background: #F2F1EB;
  color: var(--text-2);
  width: 28px;
  height: 28px;
  border-radius: 6px;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.modal-x:hover { background: #E9E6DD; color: var(--text); }
.modal-body { padding: 20px; max-height: calc(100vh - 220px); overflow-y: auto; }
.modal-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  background: #FCFCFA;
  border-radius: 0 0 12px 12px;
}
.modal-foot .foot-left { margin-right: auto; color: var(--text-3); font-size: 12px; }

/* ---------- Toast ---------- */
.toast-host {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 180px;
  max-width: 520px;
  padding: 9px 16px;
  border-radius: 8px;
  background: #1F2933;
  color: #fff;
  font-size: 13.5px;
  box-shadow: 0 8px 26px rgba(15, 23, 30, .25);
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast-dot { width: 7px; height: 7px; border-radius: 50%; background: #fff; flex: none; }
.toast-success .toast-dot { background: #5FD79B; }
.toast-error .toast-dot { background: #FF7B6E; }
.toast-error { background: #3A2220; }
.toast-info .toast-dot { background: #8FB6E0; }

/* ---------- Tabs ---------- */
.tabbar {
  display: flex;
  align-items: center;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  padding: 0 18px;
  background: #fff;
}
.tab {
  height: 44px;
  padding: 0 14px;
  border: 0;
  background: none;
  color: var(--text-2);
  font-size: 14px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }

.seg {
  display: inline-flex;
  background: #F2F1EB;
  border-radius: 7px;
  padding: 2px;
  gap: 2px;
}
.seg button {
  height: 28px;
  padding: 0 12px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--text-2);
  font-size: 12.5px;
  cursor: pointer;
}
.seg button.active { background: #fff; color: var(--text); box-shadow: 0 1px 3px rgba(31, 41, 51, .12); font-weight: 500; }

/* ---------- 图片 / 上传 ---------- */
.img-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.img-item {
  position: relative;
  width: 84px;
  height: 84px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #F7F6F1;
}
.img-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.img-del {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 20px;
  height: 20px;
  border: 0;
  border-radius: 50%;
  background: rgba(28, 28, 28, .62);
  color: #fff;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.img-del:hover { background: var(--danger); }
.upload-box {
  width: 84px;
  height: 84px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  background: #FCFCFA;
  color: var(--text-2);
  font-size: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  cursor: pointer;
}
.upload-box:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }
.upload-box:disabled { opacity: .55; cursor: wait; }
.upload-plus { font-size: 20px; line-height: 1; }
.img-hint { width: 100%; font-size: 12px; color: var(--text-3); margin-top: 2px; }

/* ---------- SKU ---------- */
.sku-head, .sku-row {
  display: grid;
  grid-template-columns: 1.4fr .9fr .9fr .7fr 32px;
  gap: 8px;
  align-items: center;
}
.sku-head {
  font-size: 12px;
  color: var(--text-3);
  padding: 0 0 4px;
}
.sku-row { margin-bottom: 8px; }
.sku-row .input { height: 32px; width: 100%; min-width: 0; }
.area-row .input, .time-row .input { width: 100%; min-width: 0; }
.sku-empty { font-size: 12.5px; color: var(--text-3); padding: 6px 0; }

/* ---------- 图表 ---------- */
.chart-svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart-svg text { font-family: var(--font); font-size: 11px; fill: var(--text-3); }
.chart-svg .chart-val { fill: var(--text-2); font-weight: 600; font-size: 11px; }
.chart-svg .axis-line { stroke: var(--line); stroke-width: 1; }
.chart-svg .grid-line { stroke: #EFEDE6; stroke-width: 1; stroke-dasharray: 3 3; }
.chart-svg .bar-rect { transition: opacity .15s; }
.chart-svg .bar-rect:hover { opacity: .82; }
.chart-legend { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-2); }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend-swatch { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }
.legend-swatch.line { width: 14px; height: 3px; border-radius: 2px; }

.bar-list { display: flex; flex-direction: column; gap: 12px; }
.bar-row { display: grid; grid-template-columns: 34px 1fr 118px; gap: 10px; align-items: center; }
.bar-rank {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: #F2F1EB;
  color: var(--text-2);
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}
.bar-rank.top { background: var(--brand); color: #fff; }
.bar-rank.top2 { background: #E3B267; color: #fff; }
.bar-body { min-width: 0; }
.bar-name { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-bottom: 5px; }
.bar-track { height: 8px; border-radius: 4px; background: #F1EFE8; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 4px; background: linear-gradient(90deg, #2C9A63, var(--brand)); }
.bar-fill.gold { background: linear-gradient(90deg, #DCA855, var(--accent)); }
.bar-value { text-align: right; font-size: 12.5px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.bar-value b { color: var(--text); font-weight: 600; }

.donut-wrap { display: flex; align-items: center; gap: 22px; }
.donut-center { font-size: 12px; fill: var(--text-2); }

/* ---------- 分类树 ---------- */
.cat-group { border-bottom: 1px solid #F0EEE7; }
.cat-group:last-child { border-bottom: 0; }
.cat-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  background: #fff;
}
.cat-row:hover { background: var(--brand-soft); }
.cat-row.child { background: #FCFCFA; padding-left: 46px; }
.cat-row.child:hover { background: var(--brand-soft); }
.cat-name { font-weight: 500; min-width: 160px; display: flex; align-items: center; gap: 8px; }
.cat-name .cat-icon { color: var(--text-3); font-size: 14px; }
.cat-meta { color: var(--text-3); font-size: 12px; min-width: 60px; }
.cat-actions { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.cat-branch {
  position: absolute;
  left: 28px;
  width: 12px;
  height: 1px;
  background: var(--line-strong);
}
.cat-row-wrap { position: relative; }

/* ---------- 登录 ---------- */
.login-page {
  min-height: 100vh;
  display: flex;
  background: var(--bg);
}
.login-visual {
  flex: 1.15;
  background:
    radial-gradient(900px 420px at 18% 12%, rgba(58, 160, 112, .55), transparent 62%),
    radial-gradient(700px 500px at 92% 88%, rgba(200, 134, 44, .35), transparent 60%),
    linear-gradient(150deg, #123A2A, #1F2933 74%);
  color: #fff;
  padding: 64px 68px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}
.login-visual::after {
  content: "";
  position: absolute;
  inset: auto -80px -140px auto;
  width: 460px;
  height: 460px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 50%;
}
.login-brand { display: flex; align-items: center; gap: 12px; }
.login-brand .brand-logo { width: 46px; height: 46px; font-size: 22px; border-radius: 12px; }
.login-brand-name { font-size: 15px; letter-spacing: 2px; color: #DDE7E1; }
.login-hero h1 {
  font-size: 40px;
  line-height: 1.28;
  letter-spacing: 2px;
  font-weight: 650;
  margin-bottom: 18px;
}
.login-hero p { color: rgba(255, 255, 255, .68); font-size: 14.5px; max-width: 460px; line-height: 1.9; }
.login-feats { display: flex; gap: 26px; margin-top: 34px; }
.login-feat { border-left: 2px solid rgba(255, 255, 255, .22); padding-left: 12px; }
.login-feat b { display: block; font-size: 18px; font-weight: 600; }
.login-feat span { font-size: 12.5px; color: rgba(255, 255, 255, .6); }
.login-foot { color: rgba(255, 255, 255, .4); font-size: 12px; display: flex; flex-direction: column; gap: 6px; }
.login-foot .icp-link:hover { color: rgba(255, 255, 255, .8); }

.login-side {
  width: 500px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}
.login-card {
  width: 100%;
  max-width: 380px;
}
.login-title { font-size: 24px; font-weight: 650; }
.login-desc { color: var(--text-2); font-size: 13.5px; margin: 6px 0 26px; }
.login-form { display: flex; flex-direction: column; gap: 16px; }
.login-form .input { height: 44px; border-radius: 8px; font-size: 14px; }
.login-form .btn { height: 44px; border-radius: 8px; font-size: 15px; }
.login-hint {
  margin-top: 18px;
  padding: 10px 12px;
  background: #F7F6F1;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  font-size: 12.5px;
  color: var(--text-2);
}
.login-error {
  color: var(--danger);
  font-size: 13px;
  background: var(--danger-light);
  border: 1px solid #F0D2CE;
  border-radius: 6px;
  padding: 8px 10px;
  display: none;
}
.login-error.show { display: block; }

/* ---------- 设置页 ---------- */
.settings-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
.area-row {
  display: grid;
  grid-template-columns: 1.4fr .8fr 1fr 32px;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}
.area-head {
  display: grid;
  grid-template-columns: 1.4fr .8fr 1fr 32px;
  gap: 8px;
  font-size: 12px;
  color: var(--text-3);
  margin-bottom: 4px;
}
.time-row {
  display: grid;
  grid-template-columns: 1fr 32px;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}
.inline-add {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}
.num-suffix { color: var(--text-3); font-size: 12px; margin-left: 6px; }
.setting-line { display: flex; align-items: center; gap: 8px; }
.setting-line .input { width: 160px; }

/* ---------- 商品选择器 ---------- */
.picker { border: 1px solid var(--line); border-radius: 8px; padding: 10px; background: #FCFCFA; }
.picker-search { display: flex; gap: 8px; }
.picker-results { margin-top: 8px; display: flex; flex-direction: column; gap: 4px; max-height: 150px; overflow-y: auto; }
.picker-result {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 5px;
  background: #fff;
  border: 1px solid var(--line);
  font-size: 12.5px;
}
.picker-result .grow { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picker-result.is-picked { border-color: var(--brand); background: var(--brand-soft); }
.picker-picked { font-size: 12.5px; color: var(--brand); margin-top: 6px; }

/* ---------- 滚动条 ---------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #D8D5CB; border-radius: 6px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: #C4C0B4; background-clip: padding-box; }

/* ---------- 打印 / 小屏兜底 ---------- */
@media (max-width: 1360px) {
  .kpi-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .content { padding: 20px; }
}
