/* ============================================================
   零售门店管理系统 · 界面样式
   设计基线：深墨侧栏 + 浅底内容区，靛蓝主色，卡片式分区
   ============================================================ */

:root {
  /* 品牌 */
  --brand: #3d5bf5;
  --brand-600: #2f4ae0;
  --brand-700: #2438bf;
  --brand-soft: #eef1ff;
  --brand-glow: rgba(61, 91, 245, .18);
  --violet: #7c5cf6;
  --violet-soft: #f1eeff;
  --amber: #d97706;
  --amber-soft: #fef4e6;
  --ok: #0e9f6e;
  --ok-soft: #e7f7f1;
  --danger: #d92d20;
  --danger-soft: #fdeceb;
  --warn: #b45309;
  --warn-soft: #fdf3e3;

  /* 中性 */
  --bg: #f5f6fa;
  --surface: #ffffff;
  --surface-2: #f8f9fc;
  --line: #e7eaf2;
  --line-strong: #d6dce8;
  --text: #131a28;
  --text-2: #5a6478;
  --text-3: #6b7585;

  /* 侧栏 */
  --nav-text: #b9c5da;
  --nav-muted: #6e7e9b;

  /* 形状 */
  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 8px;
  --shadow-1: 0 1px 2px rgba(16, 24, 40, .04), 0 12px 32px -24px rgba(16, 24, 40, .22);
  --shadow-2: 0 2px 6px rgba(16, 24, 40, .06), 0 18px 40px -20px rgba(16, 24, 40, .28);
  --shadow-3: 0 40px 90px -30px rgba(8, 15, 30, .45);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "HarmonyOS Sans SC",
    "Microsoft YaHei UI", "Microsoft YaHei", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: var(--brand); text-decoration: none; }
button, input, select, textarea { font-family: inherit; font-size: 14px; }
.hidden { display: none !important; }
::selection { background: rgba(61, 91, 245, .18); }

/* 滚动条 */
* { scrollbar-width: thin; scrollbar-color: #cfd7e6 transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: #d6dce8; border-radius: 20px; border: 3px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background: #c3cadd; background-clip: content-box; }
*::-webkit-scrollbar-track { background: transparent; }

/* 启动占位 */
.boot {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--text-2);
  font-size: 13.5px;
  background: var(--bg);
}
.boot::before {
  content: "";
  width: 16px; height: 16px;
  border-radius: 50%;
  border: 2px solid #dfe4f2;
  border-top-color: var(--brand);
  animation: spin .8s linear infinite;
}

/* ============================================================
   外壳布局
   ============================================================ */
.app {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: 100vh;
  background: var(--bg);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 20px 14px 14px;
  color: var(--nav-text);
  background:
    radial-gradient(90% 40% at 20% 0%, rgba(61, 91, 245, .22), transparent 62%),
    radial-gradient(70% 35% at 100% 12%, rgba(124, 92, 246, .12), transparent 60%),
    linear-gradient(180deg, #0a1020 0%, #0c1526 55%, #0a1120 100%);
  border-right: 1px solid rgba(255, 255, 255, .06);
  overflow: hidden;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 2px 8px 18px;
}
.brand-mark {
  width: 38px; height: 38px;
  flex: none;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(140deg, #5b74ff 0%, #4a5cf0 45%, #7c5cf6 100%);
  box-shadow: 0 10px 22px -10px rgba(74, 92, 240, .9), inset 0 1px 0 rgba(255, 255, 255, .28);
}
.brand-mark svg { width: 22px; height: 22px; }
.brand-text { min-width: 0; }
.brand-name {
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  letter-spacing: .02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.brand-sub {
  font-size: 10.5px;
  color: var(--nav-muted);
  margin-top: 3px;
  letter-spacing: .16em;
}

.nav-group { margin-bottom: 14px; }
.nav-group-label {
  font-size: 10.5px;
  letter-spacing: .14em;
  color: #687894;
  padding: 0 12px 7px;
  user-select: none;
}
.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  height: 38px;
  padding: 0 12px;
  margin-bottom: 1px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--nav-text);
  font-size: 13.5px;
  font-weight: 450;
  text-align: left;
  cursor: pointer;
  transition: background .16s, color .16s;
}
.nav-item:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav-item:focus-visible { outline: 2px solid rgba(140, 160, 255, .9); outline-offset: 2px; }
.nav-item.active {
  background: linear-gradient(90deg, rgba(61, 91, 245, .32), rgba(61, 91, 245, .05));
  color: #fff;
  font-weight: 600;
}
.nav-item.active::before {
  content: "";
  position: absolute;
  left: 0; top: 9px; bottom: 9px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: #7d93ff;
  box-shadow: 0 0 12px rgba(125, 147, 255, .8);
}
.nav-item .ico {
  width: 18px; height: 18px;
  flex: none;
  display: grid;
  place-items: center;
  color: #8fa3c4;
  transition: color .16s;
}
.nav-item .ico svg { width: 18px; height: 18px; stroke: currentColor; }
.nav-item:hover .ico { color: #c9d6ec; }
.nav-item.active .ico { color: #b6c4ff; }
.nav-label { min-width: 0; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.nav-scroll { flex: 1; overflow-y: auto; overflow-x: hidden; margin: 0 -4px; padding: 0 4px; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .18) transparent; }
.nav-scroll::-webkit-scrollbar { width: 6px; height: 6px; }
.nav-scroll::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .16); border-radius: 6px; }
.nav-scroll::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, .28); }
.nav-scroll::-webkit-scrollbar-track { background: transparent; }

.side-footer {
  margin-top: auto;
  padding: 12px 8px 2px;
  border-top: 1px solid rgba(255, 255, 255, .07);
  font-size: 11px;
  color: #71829f;
  line-height: 1.7;
  font-variant-numeric: tabular-nums;
}
.side-footer strong { color: #9fb0cb; font-weight: 600; }

.main { min-width: 0; display: flex; flex-direction: column; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, .86);
  backdrop-filter: blur(14px) saturate(150%);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 14px 28px;
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.page-heading { min-width: 0; }
.topbar h1 {
  font-size: 21px;
  line-height: 1.25;
  margin: 0;
  font-weight: 650;
  letter-spacing: -.02em;
  color: var(--text);
}
.topbar .sub {
  color: var(--text-2);
  font-size: 12.5px;
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.topbar .sub::before {
  content: "";
  width: 5px; height: 5px;
  border-radius: 50%;
  background: #b0b9ca;
  flex: none;
}

.userbox {
  display: flex;
  align-items: center;
  gap: 11px;
  flex: none;
}
.avatar {
  width: 36px; height: 36px;
  flex: none;
  border-radius: 11px;
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(140deg, #5b74ff, #7c5cf6);
  box-shadow: 0 8px 18px -10px rgba(74, 92, 240, .9);
  user-select: none;
}
.user-meta { line-height: 1.35; min-width: 0; }
.userbox .name { font-size: 13.5px; font-weight: 600; color: var(--text); white-space: nowrap; }
.userbox .sub { color: var(--text-3); font-size: 11.5px; margin: 0; display: block; }
.userbox .sub::before { display: none; }
.user-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: 6px;
  padding-left: 10px;
  border-left: 1px solid var(--line);
}

.main-inner {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 24px 28px 64px;
}

/* ============================================================
   基础组件
   ============================================================ */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
  padding: 20px 20px 18px;
}
.card + .card { margin-top: 16px; }
.card-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 0 0 16px;
  font-size: 15.5px;
  font-weight: 650;
  letter-spacing: -.01em;
  color: var(--text);
}
.card-title .hint { font-weight: 450; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  border: 1px solid #dfe3ee;
  border-radius: var(--radius-sm);
  background: #fff;
  color: #2a3346;
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: background .16s, border-color .16s, box-shadow .16s, color .16s, transform .12s;
  box-shadow: 0 1px 1px rgba(16, 24, 40, .04);
}
.btn:hover { border-color: #c7d0e2; background: #fafbfe; color: #111827; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-glow);
}
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn-primary {
  background: linear-gradient(180deg, #4a67ff, #3b55ee);
  border-color: #3b55ee;
  color: #fff;
  box-shadow: 0 8px 18px -10px rgba(59, 85, 238, .9), inset 0 1px 0 rgba(255, 255, 255, .22);
}
.btn-primary:hover { background: linear-gradient(180deg, #4060fb, #3350e8); border-color: #3350e8; color: #fff; }
.btn-primary:focus-visible { border-color: #3350e8; box-shadow: 0 0 0 3px var(--brand-glow); }
.btn-danger { color: var(--danger); border-color: #f0cdca; background: #fff; }
.btn-danger:hover { background: #fff5f4; border-color: #e4aba7; color: var(--danger); }
.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--text-2);
  box-shadow: none;
  padding: 0 10px;
}
.btn-ghost:hover { background: #f2f4fa; color: var(--text); border-color: transparent; }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: var(--radius-xs); }
.btn-link {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 7px;
  margin: 1px 2px 1px 0;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--brand);
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.btn-link:hover { background: var(--brand-soft); color: var(--brand-700); }
.btn-link.danger { color: var(--danger); }
.btn-link.danger:hover { background: var(--danger-soft); }

.input, .select, .textarea {
  width: 100%;
  height: 36px;
  padding: 0 12px;
  border: 1px solid #e1e5ef;
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text);
  font-size: 13.5px;
  line-height: 1.4;
  outline: none;
  transition: border-color .16s, box-shadow .16s, background .16s;
  box-shadow: inset 0 1px 1px rgba(16, 24, 40, .02);
}
.input:hover, .select:hover, .textarea:hover { border-color: #cbd3e3; }
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-glow);
  background: #fff;
}
.input::placeholder, .textarea::placeholder { color: #a4adc0; }
.input:disabled, .select:disabled, .textarea:disabled {
  background: #f6f7fb;
  color: var(--text-3);
  cursor: not-allowed;
  box-shadow: none;
}
.fluct-row { gap: 10px; }
.fluct-row .input { min-width: 160px; }
.select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 34px;
  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='%23667087' stroke-width='1.8' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  cursor: pointer;
}
.textarea {
  height: auto;
  min-height: 84px;
  padding: 10px 12px;
  resize: vertical;
  line-height: 1.6;
}
input[type="date"] { color-scheme: light; }
input[type="checkbox"] {
  width: 15px; height: 15px;
  margin: 0;
  accent-color: var(--brand);
  cursor: pointer;
}
.checkbox { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; white-space: nowrap; }
input[type="file"] { font-size: 12.5px; color: var(--text-2); }

.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 14px; }
.field label { font-size: 12.5px; font-weight: 500; color: var(--text-2); letter-spacing: .01em; }
.required-star { color: var(--danger); margin-left: 2px; }
.field .hint { margin-top: -1px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.spacer { flex: 1; }
.hint { color: var(--text-2); font-size: 12px; line-height: 1.65; }
.err { color: var(--danger); font-size: 12.5px; line-height: 1.6; }
.num, .table .num { font-variant-numeric: tabular-nums; }

/* ============================================================
   表单增强：品类下拉 / 参数行 / 富文本 / 物料选择 / 多图
   ============================================================ */
.cat-select { position: relative; }
.cat-select-el { width: 100%; }
.param-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.param-row .input { flex: 0 1 260px; }

.rich-editor { border: 1px solid #e1e5ef; border-radius: var(--radius-sm); background: #fff; overflow: hidden; transition: border-color .16s, box-shadow .16s; }
.rich-editor:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-glow); }
.rich-toolbar { display: flex; align-items: center; gap: 4px; padding: 6px 10px; border-bottom: 1px solid var(--line); background: var(--surface-2); flex-wrap: wrap; }
.rich-toolbar button {
  min-width: 30px; height: 28px; padding: 0 8px; border: 1px solid transparent; background: transparent;
  border-radius: 6px; color: var(--text-2); font-size: 13px; cursor: pointer;
}
.rich-toolbar button:hover { background: #fff; border-color: var(--line); color: var(--text); }
.rich-divider { width: 1px; height: 18px; background: var(--line-strong); margin: 0 6px; }
.rich-color { display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 6px; border-radius: 6px; cursor: pointer; }
.rich-color:hover { background: #fff; border-color: var(--line); }
.rich-color-dot { width: 14px; height: 14px; border-radius: 50%; border: 1px solid var(--line-strong); }
.rich-color input[type="color"] { width: 0; height: 0; opacity: 0; position: absolute; }
.rich-body { min-height: 120px; padding: 10px 12px; line-height: 1.7; font-size: 13.5px; outline: none; }
.rich-body:empty::before { content: attr(data-placeholder); color: #a4adc0; }
.rich-body ul { margin: 4px 0; padding-left: 20px; }
.rich-body img { max-width: 100%; border-radius: 8px; display: inline-block; }
.img-handle-layer { position: absolute; display: none; z-index: 5; }
.img-resize-handle {
  position: absolute; right: -9px; bottom: -9px; width: 18px; height: 18px;
  background: var(--brand); border: 2px solid #fff; border-radius: 50%; cursor: nwse-resize;
  box-shadow: 0 1px 4px rgba(16, 24, 40, .4);
}
.img-resize-handle::after {
  content: ''; position: absolute; right: 3px; bottom: 3px; width: 6px; height: 6px;
  border-right: 2px solid #fff; border-bottom: 2px solid #fff;
}

.material-pick { display: flex; flex-direction: column; gap: 10px; }
.material-pick .pick-list { max-height: 300px; }
.mat-empty { padding: 20px 0; text-align: center; }
.mat-selected .mat-chip { gap: 4px; }
.mat-chip button { background: none; border: none; color: inherit; cursor: pointer; font-size: 14px; line-height: 1; padding: 0 2px; }

/* 成本价合计汇总块 */
.cost-summary {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #f7f9fc;
  padding: 12px 14px;
  margin-bottom: 16px;
}
.cost-summary-title { font-size: 12.5px; color: var(--text-3); margin-bottom: 4px; }
.cost-summary-val { font-size: 22px; font-weight: 700; color: var(--brand); }
.cost-summary-detail { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 6px; }
.cost-part { font-size: 12.5px; color: var(--text-2); }

/* 已关联物料行（逐行数量） */
.mat-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border: 1px solid var(--line);
  border-radius: var(--radius-sm); background: #fff; margin-bottom: 8px;
}
.mat-row-meta { flex: 1; min-width: 0; }
.mat-row-meta .t { font-size: 13.5px; font-weight: 500; }
.mat-row-meta .code { font-size: 12px; color: var(--text-3); }
.mat-row-warn { border-color: var(--danger); background: #fff7f7; }
.mat-qty { width: 90px; flex: none; }

.image-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.image-cell { position: relative; aspect-ratio: 1; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-2); }
.image-cell img { width: 100%; height: 100%; object-fit: cover; display: block; cursor: zoom-in; }
.image-del {
  position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border: none; border-radius: 50%;
  background: rgba(19, 26, 40, .72); color: #fff; font-size: 14px; line-height: 1; cursor: pointer;
  display: grid; place-items: center;
}
.image-del:hover { background: var(--danger); }
@media (max-width: 900px) { .image-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.form-footer { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }

/* ============================================================
   数据卡
   ============================================================ */
.kpi { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.kpi-card {
  position: relative;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
  padding: 17px 18px 16px;
}
.kpi-card::after {
  content: "";
  position: absolute;
  right: -34px; top: -46px;
  width: 140px; height: 140px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(61, 91, 245, .1), transparent 68%);
  pointer-events: none;
}
.kpi-card.tone-violet::after { background: radial-gradient(circle, rgba(124, 92, 246, .12), transparent 68%); }
.kpi-card.tone-amber::after { background: radial-gradient(circle, rgba(217, 119, 6, .13), transparent 68%); }
.kpi-card.tone-ok::after { background: radial-gradient(circle, rgba(14, 159, 110, .12), transparent 68%); }
.kpi-top { display: flex; align-items: center; gap: 9px; }
.kpi-ico {
  width: 30px; height: 30px;
  flex: none;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: var(--brand-soft);
  color: var(--brand);
}
.kpi-ico svg { width: 17px; height: 17px; }
.kpi-card.tone-violet .kpi-ico { background: var(--violet-soft); color: var(--violet); }
.kpi-card.tone-amber .kpi-ico { background: var(--amber-soft); color: var(--amber); }
.kpi-card.tone-ok .kpi-ico { background: var(--ok-soft); color: var(--ok); }
.kpi-card .label { color: var(--text-2); font-size: 12.5px; font-weight: 500; }
.kpi-card .value {
  font-size: clamp(20px, 2.1vw, 28px);
  font-weight: 650;
  letter-spacing: -.02em;
  margin-top: 12px;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}
.kpi-card .foot { color: var(--text-3); font-size: 12px; margin-top: 7px; }

.summary-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(158px, 1fr));
  gap: 12px;
  margin: 16px 0;
}
.summary-strip .cell {
  background: var(--surface-2);
  border: 1px solid #eff1f6;
  border-radius: 12px;
  padding: 13px 15px;
}
.summary-strip .cell .label { color: var(--text-2); font-size: 12px; }
.summary-strip .cell .val {
  font-size: 20px;
  font-weight: 650;
  margin-top: 5px;
  letter-spacing: -.01em;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

/* 快捷操作 */
.quick-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); gap: 10px; }
.quick-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  font-size: 13.5px;
  font-weight: 550;
  text-align: left;
  cursor: pointer;
  transition: border-color .16s, background .16s, box-shadow .16s, transform .12s;
}
.quick-item:hover { border-color: #cfd7ec; background: #fbfcff; box-shadow: 0 10px 24px -18px rgba(16, 24, 40, .5); transform: translateY(-1px); }
.quick-item:focus-visible { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-glow); }
.quick-item .qi-ico {
  width: 32px; height: 32px;
  flex: none;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: var(--brand-soft);
  color: var(--brand);
}
.quick-item .qi-ico svg { width: 17px; height: 17px; }
.quick-item .qi-text { min-width: 0; }
.quick-item .qi-sub { display: block; font-size: 11.5px; font-weight: 400; color: var(--text-3); margin-top: 1px; }
.quick-item .qi-arrow { margin-left: auto; color: #b6bfd2; }
.quick-item .qi-arrow svg { width: 16px; height: 16px; }

.mini-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.mini-stat { background: var(--surface-2); border: 1px solid #eff1f6; border-radius: 12px; padding: 12px 14px; }
.mini-stat .label { color: var(--text-2); font-size: 11.5px; }
.mini-stat .value { font-size: 21px; font-weight: 650; letter-spacing: -.01em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.mini-stat.ok .value { color: var(--ok); }
.mini-stat.amber .value { color: var(--amber); }

.rank-list { list-style: none; margin: 0; padding: 0; }
.rank-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid #f0f2f7;
  font-size: 13px;
}
.rank-list li:last-child { border-bottom: none; }
.rank-no {
  width: 24px; height: 24px;
  flex: none;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #f2f4fa;
  color: #8189a0;
  font-size: 11.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.rank-list li:nth-child(1) .rank-no { background: var(--brand-soft); color: var(--brand-600); }
.rank-list li:nth-child(2) .rank-no { background: #f0f2ff; color: #5d6ec4; }
.rank-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); font-weight: 500; }
.rank-qty { color: var(--text-3); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rank-amt { min-width: 82px; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ============================================================
   表格
   ============================================================ */
.table-wrap {
  overflow: auto;
  max-height: 62vh;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
/* 物料分页列表：固定展示当前页 10 条，不出现内部滚动条，行高更紧凑 */
.table-wrap.no-scroll { overflow: visible; max-height: none; }
.table-wrap.no-scroll thead th { position: static; }
.table-wrap.no-scroll .table th,
.table-wrap.no-scroll .table td { padding: 8px 14px; }
.table-wrap.no-scroll .table .thumb { width: 32px; height: 32px; border-radius: 8px; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
.table th, .table td {
  padding: 11px 14px;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid #eff1f6;
  white-space: nowrap;
}
.table th {
  color: var(--text-2);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: .02em;
  background: #f8f9fc;
  border-bottom: 1px solid var(--line);
}
.table-wrap thead th {
  position: sticky;
  top: 0;
  z-index: 1;
}
.table tbody tr:hover { background: #fbfcff; }
.table tbody tr:last-child td { border-bottom: none; }
.table .num { text-align: right; }
.table td .hint { white-space: normal; }

/* 员工列表：可点击行与展开的品类提成明细 */
.table tbody tr.emp-row.expanded { background: #f4f7ff; }
.table tbody tr.emp-detail td { white-space: normal; }
.emp-detail-box { display: flex; flex-direction: column; gap: 8px; }

/* 订单管理：可点击行与行内展开的商品明细 */
.table tbody tr.order-row.expanded { background: #f4f7ff; }
.table tbody tr.order-detail td { white-space: normal; }
.order-detail-box { display: flex; flex-direction: column; gap: 8px; }
.order-detail-table { font-size: 13px; }
.order-detail-table th, .order-detail-table td { padding: 7px 10px; }
.order-detail-table .thumb { width: 36px; height: 36px; border-radius: 8px; overflow: hidden; flex: none; }
.order-detail-table .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.order-detail-summary { display: flex; justify-content: flex-end; gap: 18px; align-items: center; font-size: 13px; color: var(--text-2); padding: 4px 2px; }
.order-detail-summary strong { color: var(--brand-600); font-size: 15px; font-variant-numeric: tabular-nums; }
.section-title { font-size: 14px; font-weight: 600; color: var(--text); margin: 20px 0 12px; }
.section-title:first-child { margin-top: 0; }

/* 展开行内的品类提成层级树 */
.rule-tree { display: flex; flex-direction: column; gap: 4px; }
.rule-tree-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 8px;
  border-radius: 6px;
}
.rule-tree-row:hover { background: #f4f6fb; }
.rule-tree-name { color: var(--text); min-width: 120px; }
.rule-tree-edit { display: inline-flex; align-items: center; gap: 6px; }
.rule-tree-edit .rule-rate-input { height: 30px; }
.rule-tree-edit .btn-ghost { color: var(--brand); padding: 0 7px; }

/* 表格单元格超长省略，悬停 title 展示完整内容 */
.cell-ellipsis {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 操作日志详情：固定两行高度，悬停展示完整内容 */
.audit-detail {
  max-width: 260px;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
  word-break: break-all;
  cursor: default;
}

/* 详情只读视图：与编辑页字段对齐，纯文本展示不可编辑 */
.detail-view .detail-value {
  min-height: 38px;
  display: flex;
  align-items: center;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text);
  font-size: 13.5px;
  word-break: break-all;
}

/* 订单金额 / 优惠方式 / 优惠金额 / 实付金额 重点标记 */
.field.amount-emphasis label { color: var(--brand); font-weight: 700; }
.field.amount-emphasis label::before {
  content: '';
  display: inline-block;
  width: 3px; height: 12px;
  background: var(--brand);
  border-radius: 2px;
  margin-right: 6px;
  vertical-align: -1px;
}
.field.amount-emphasis .detail-value {
  background: var(--brand-soft);
  border-color: var(--brand-glow);
  color: var(--brand);
  font-weight: 600;
}
.param-read { display: flex; flex-direction: column; gap: 6px; }
.param-read-item {
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font-size: 13px;
}
.detail-richtext {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  padding: 12px;
  min-height: 60px;
}
.detail-images { margin-top: 4px; }

.group-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  font-size: 12.5px;
  color: #4a5670;
  background: linear-gradient(90deg, #f6f8fd, #fafbff);
  border-bottom: 1px solid #e9ecf3;
}
.group-head strong { font-weight: 600; color: #1b2434; }
.group-head span { color: var(--text-3); font-size: 12px; }

/* 商品列表多图：固定正方形宫格小格，横向并排，超出省略 */
.goods-thumbs { display: flex; flex-wrap: nowrap; gap: 6px; align-items: center; }
.goods-thumbs .thumb,
.goods-thumbs .thumb-ph { width: 40px; height: 40px; border-radius: 8px; overflow: hidden; flex: none; }
.goods-thumbs .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; cursor: zoom-in; }
.goods-thumbs .thumb-ph { display: grid; place-items: center; background: #f3f6fb; color: #b3bfd0; border: 1px solid var(--line); }
.goods-thumbs .thumb.more { background: var(--surface-2); color: var(--text-muted); font-size: 11px; border-style: dashed; }
.prod-name { display: flex; align-items: center; gap: 10px; min-width: 0; }
.prod-name .t { font-weight: 550; color: var(--text); white-space: normal; }
.prod-name .code { color: var(--text-3); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.prod-cell { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.prod-cell .t { font-weight: 550; color: var(--text); white-space: normal; }
.prod-cell .code { color: var(--text-3); font-size: 11.5px; font-variant-numeric: tabular-nums; }

/* ============================================================
   品类管理 · 树形结构
   ============================================================ */
.cat-tree { display: flex; flex-direction: column; gap: 5px; }
.cat-node { display: flex; flex-direction: column; gap: 5px; }
.cat-children {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-left: 24px;
  padding-left: 13px;
  border-left: 1px dashed var(--line-strong);
}
.cat-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
  transition: border-color .16s, background .16s, box-shadow .16s;
}
.cat-row:hover {
  border-color: #cfd7ec;
  background: #fbfcff;
  box-shadow: 0 10px 24px -20px rgba(16, 24, 40, .5);
}
.cat-row.is-parent { cursor: pointer; }
.cat-caret {
  width: 20px; height: 20px;
  flex: none;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 7px;
  padding: 0;
  background: transparent;
  color: var(--text-3);
  cursor: pointer;
}
.cat-caret:hover { background: var(--surface-2); color: var(--text); }
.cat-caret.no-kids { cursor: default; }
.cat-level {
  flex: none;
  min-width: 30px;
  height: 20px;
  padding: 0 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  font-size: 10.5px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  letter-spacing: .02em;
}
.cat-level.lv-1 { background: var(--brand-soft); color: var(--brand-600); }
.cat-level.lv-2 { background: var(--violet-soft); color: var(--violet); }
.cat-level.lv-3 { background: var(--amber-soft); color: var(--amber); }
.cat-level.lv-4 { background: var(--ok-soft); color: var(--ok); }
.cat-main { flex: 1; min-width: 0; }
.cat-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cat-meta {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 2px;
  flex-wrap: wrap;
}
.cat-meta .hint { font-size: 11.5px; }
.cat-meta-link {
  border: none;
  padding: 0;
  background: transparent;
  color: var(--brand-600);
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 1px dashed rgba(61, 91, 245, .4);
}
.cat-meta-link:hover { color: var(--brand-700); border-bottom-style: solid; }
.cat-actions {
  flex: none;
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
  padding-left: 6px;
}
.cat-node.is-stopped .cat-row { background: var(--surface-2); border-style: dashed; }
.cat-node.is-stopped .cat-name { color: var(--text-3); }
.cat-node.is-stopped .cat-level { opacity: .55; }

/* ============================================================
   标签、缩略图
   ============================================================ */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 22px;
  padding: 0 9px;
  border-radius: 999px;
  background: #f1f3f8;
  color: #5a6478;
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  vertical-align: middle;
}
.chip.ok { background: var(--ok-soft); color: #0a7a55; }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.danger { background: var(--danger-soft); color: var(--danger); }
.chip.info { background: var(--brand-soft); color: var(--brand-600); }
.chip.gray { background: #f0f2f7; color: #77819a; }
.chip.ok::before, .chip.warn::before, .chip.danger::before, .chip.info::before {
  content: "";
  width: 5px; height: 5px;
  border-radius: 50%;
  background: currentColor;
  opacity: .85;
  flex: none;
}

.thumb {
  width: 44px; height: 44px;
  border-radius: 10px;
  object-fit: cover;
  background: #f4f6fb;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  color: #a9b3c6;
  font-size: 11px;
  flex: none;
}
.thumb-lg {
  width: 100%;
  height: 200px;
  border-radius: 12px;
  object-fit: contain;
  background: #f7f8fc;
  border: 1px solid var(--line);
}

/* 可点击缩略图 */
.thumb.clickable { cursor: zoom-in; }

/* 图片预览灯箱 */
.lightbox-mask {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  background: rgba(8, 13, 26, .72);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  animation: maskIn .18s ease;
}
.lightbox {
  display: flex;
  flex-direction: column;
  max-width: min(880px, 92vw);
  max-height: 86vh;
  background: #fff;
  border-radius: 18px;
  box-shadow: var(--shadow-3);
  overflow: hidden;
  animation: modalIn .2s cubic-bezier(.2, .8, .3, 1);
}
.lightbox-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid #edf0f6;
}
.lightbox-title { font-size: 14.5px; font-weight: 600; color: var(--text); }
.lightbox-body {
  display: grid;
  place-items: center;
  padding: 20px;
  overflow: auto;
  background: #f7f8fc;
}
.lightbox-body img {
  max-width: 100%;
  max-height: 66vh;
  object-fit: contain;
  border-radius: 12px;
}

/* 多图宫格预览 */
.lightbox.gallery { max-width: min(720px, 92vw); }
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding: 20px;
  overflow-y: auto;
  max-height: 76vh;
  background: #f7f8fc;
}
.gallery-cell {
  position: relative;
  aspect-ratio: 1;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  cursor: zoom-in;
}
.gallery-cell img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery-cell:hover { border-color: var(--primary); }

/* 分页 */
.pager {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 14px;
  flex-wrap: wrap;
}
.pager-info {
  margin-right: auto;
  color: var(--text-2);
  font-size: 12.5px;
}
.pager-btn {
  min-width: 30px;
  height: 30px;
  padding: 0 10px;
  border: 1px solid #e1e5ef;
  border-radius: var(--radius-xs);
  background: #fff;
  color: var(--text-2);
  font-size: 13px;
  cursor: pointer;
  transition: border-color .16s, background .16s, color .16s;
}
.pager-btn:hover:not(:disabled):not(.active) {
  border-color: #cbd3e3;
  background: #fafbfe;
  color: var(--text);
}
.pager-btn.active {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand-600);
  font-weight: 600;
  cursor: default;
}
.pager-btn:disabled { opacity: .45; cursor: not-allowed; }

/* ============================================================
   分段导航
   ============================================================ */
.tabs {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 4px;
  margin-bottom: 16px;
  background: #f1f3f9;
  border-radius: 12px;
  max-width: 100%;
  overflow-x: auto;
}
.tab {
  height: 32px;
  padding: 0 16px;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: #66708a;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: background .16s, color .16s, box-shadow .16s;
}
.tab:hover { color: var(--text); }
.tab:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.tab.active {
  background: #fff;
  color: #22305b;
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .08), 0 4px 10px -6px rgba(16, 24, 40, .28);
}

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 48px 20px;
  color: #8a93a6;
  font-size: 13px;
  text-align: center;
}
.empty::before {
  content: "";
  width: 46px; height: 46px;
  border-radius: 14px;
  background: #f5f7fc url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239aa4b8' stroke-width='1.5' stroke-linecap='round'%3E%3Cpath d='M3.5 8l1.2-3h14.6l1.2 3'/%3E%3Cpath d='M4 8h16v11H4z'/%3E%3Cpath d='M9 12.5h6'/%3E%3C/svg%3E") center / 24px 24px no-repeat;
  border: 1px solid #e9ecf4;
}
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 44px 20px;
  color: var(--text-2);
  font-size: 13px;
}
.loading::before {
  content: "";
  width: 15px; height: 15px;
  border-radius: 50%;
  border: 2px solid #e2e6f1;
  border-top-color: var(--brand);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   弹窗
   ============================================================ */
.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 48px 16px;
  background: rgba(11, 18, 32, .5);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  overflow: auto;
  animation: maskIn .18s ease;
}
.modal {
  width: 640px;
  max-width: 100%;
  background: #fff;
  border-radius: 18px;
  box-shadow: var(--shadow-3);
  overflow: hidden;
  animation: modalIn .2s cubic-bezier(.2, .8, .3, 1);
}
.modal.wide { width: 920px; }
.modal.small { width: 440px; }
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 17px 22px;
  border-bottom: 1px solid #edf0f6;
}
.modal-head h3 { margin: 0; font-size: 16.5px; font-weight: 650; letter-spacing: -.01em; color: var(--text); }
.modal-body { padding: 20px 22px; max-height: 68vh; overflow: auto; }
.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 22px;
  border-top: 1px solid #edf0f6;
  background: #fbfcfe;
}
.close {
  width: 32px; height: 32px;
  flex: none;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: #8a93a6;
  font-size: 19px;
  line-height: 1;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.close:hover { background: #f2f4fa; color: var(--text); }
@keyframes maskIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: none; } }

/* ============================================================
   轻提示
   ============================================================ */
.toast-wrap {
  position: fixed;
  left: 50%;
  bottom: 30px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 80;
  pointer-events: none;
}
.toast {
  max-width: 72vw;
  padding: 10px 16px;
  border-radius: 10px;
  background: rgba(17, 24, 39, .94);
  color: #fff;
  font-size: 13px;
  box-shadow: 0 14px 30px -12px rgba(6, 12, 24, .6);
  animation: toastIn .2s ease;
}
.toast.ok { background: #0b8058; }
.toast.err { background: #bf2a1f; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ============================================================
   登录
   ============================================================ */
.login-wrap {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(360px, 1.02fr) minmax(430px, 1fr);
  background: var(--bg);
}
.login-brand {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 32px;
  padding: 56px 60px;
  color: #fff;
  background:
    radial-gradient(70% 45% at 12% 4%, rgba(61, 91, 245, .3), transparent 62%),
    radial-gradient(50% 40% at 95% 95%, rgba(124, 92, 246, .22), transparent 65%),
    linear-gradient(165deg, #0a1020 0%, #111b30 55%, #0b1424 100%);
}
.login-brand::after {
  content: "";
  position: absolute;
  inset: auto -80px -120px auto;
  width: 320px; height: 320px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .08);
  pointer-events: none;
}
.login-brand-top { display: flex; align-items: center; gap: 14px; }
.login-brand .brand-mark { width: 46px; height: 46px; border-radius: 14px; }
.login-brand .brand-mark svg { width: 26px; height: 26px; }
.lb-name { font-size: 19px; font-weight: 600; letter-spacing: .01em; }
.lb-sub { font-size: 11px; color: #8ea0bf; letter-spacing: .18em; margin-top: 4px; }
.login-copy {
  margin-top: auto;
  margin-bottom: auto;
  max-width: 400px;
}
.login-copy h1 {
  font-size: 30px;
  line-height: 1.35;
  font-weight: 600;
  letter-spacing: -.01em;
  margin: 0 0 14px;
  color: #f5f8ff;
}
.login-copy p { margin: 0; color: #9fb0cc; font-size: 13.5px; line-height: 1.85; }
.login-points { list-style: none; margin: 26px 0 0; padding: 0; display: grid; gap: 12px; }
.login-points li { display: flex; align-items: center; gap: 10px; font-size: 13px; color: #c2cfe4; }
.login-points li i {
  width: 18px; height: 18px;
  flex: none;
  border-radius: 50%;
  background: rgba(125, 147, 255, .16);
  display: grid;
  place-items: center;
  color: #a9bbff;
  font-style: normal;
  font-size: 11px;
}
.login-foot { font-size: 11.5px; color: #6e7e9b; letter-spacing: .04em; }

.login-panel {
  display: grid;
  place-items: center;
  padding: 44px 32px;
  background: radial-gradient(70% 50% at 50% 0%, #eff2fb 0%, var(--bg) 60%);
}
.login-card {
  width: 400px;
  max-width: 100%;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 24px 60px -30px rgba(16, 32, 64, .28), 0 1px 2px rgba(16, 24, 40, .04);
  padding: 32px 30px 28px;
}
.login-mini { display: none; align-items: center; gap: 10px; margin-bottom: 18px; }
.login-mini .brand-mark { width: 34px; height: 34px; border-radius: 10px; }
.login-mini span { font-size: 14px; font-weight: 600; }
.login-card h2 { margin: 0 0 6px; font-size: 23px; font-weight: 650; letter-spacing: -.02em; color: var(--text); }
.login-card .sub { color: var(--text-2); font-size: 13px; margin: 0 0 22px; }
.login-card .field { margin-bottom: 15px; }
.login-card .field label { font-size: 12.5px; }
.login-card .input { height: 42px; border-radius: 11px; }
.login-card .btn { height: 42px; border-radius: 11px; font-size: 14px; }
.login-note {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid #f0f2f7;
  color: var(--text-3);
  font-size: 12px;
  line-height: 1.65;
}

/* ============================================================
   开单
   ============================================================ */
.order-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(340px, 1fr);
  gap: 16px;
  align-items: start;
}

/* 模糊搜索选择器 */
.combo { position: relative; }
.radio { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--text); cursor: pointer; padding: 6px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; }
.radio input { accent-color: var(--brand); cursor: pointer; }
.combo-drop {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 240px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: 0 14px 30px -16px rgba(16, 40, 90, .45);
  z-index: 30;
  padding: 4px;
}
.combo-item { padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.combo-item:hover { background: var(--surface-2, #f3f5fb); }
.combo-main { font-size: 13.5px; font-weight: 500; color: var(--text); }
.combo-sub { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.combo-empty { padding: 14px 10px; text-align: center; color: var(--text-3); font-size: 12.5px; }
.pick-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(152px, 1fr));
  gap: 12px;
  max-height: 56vh;
  overflow: auto;
  padding: 2px;
}
.pick-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  background: #fff;
  cursor: pointer;
  transition: border-color .16s, box-shadow .16s, transform .12s;
}
.pick-card:hover {
  border-color: #c5cff0;
  box-shadow: 0 14px 28px -20px rgba(16, 40, 90, .55);
  transform: translateY(-2px);
}
.pick-card.out { opacity: .55; cursor: not-allowed; }
.pick-card.out:hover { border-color: var(--line); box-shadow: none; transform: none; }
.pick-card img, .pick-card .ph {
  width: 100%;
  height: 96px;
  border-radius: 9px;
  object-fit: cover;
  background: #f3f5fb;
  display: grid;
  place-items: center;
  color: #b3bdcf;
  font-size: 12px;
}
.pick-card .n {
  font-size: 13px;
  font-weight: 600;
  margin-top: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
}
.pick-card .p { color: var(--brand-600); font-weight: 650; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.pick-card .s { color: var(--text-3); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.cart-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #f0f2f7;
}
.qty {
  display: inline-flex;
  align-items: center;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}
.qty button {
  width: 28px; height: 30px;
  border: none;
  background: #f7f8fc;
  color: #5a6b80;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  transition: background .15s;
}
.qty button:hover { background: #eef1f8; color: var(--text); }
.qty input {
  width: 40px;
  height: 30px;
  border: none;
  outline: none;
  text-align: center;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  background: #fff;
  -moz-appearance: textfield;
}
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.order-total { font-size: 26px; font-weight: 650; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.25; }
.order-summary-totals { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; }
.order-total-paid { color: var(--brand-600); }
.order-total-label { color: var(--text-2); font-size: 12px; }
.order-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 4px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

/* 提示条 */
.notice {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
  margin-top: 12px;
}
.notice.danger { background: #fff7f6; border-color: #f6d8d4; }

/* ============================================================
   角色管理：搜索栏 + 权限树
   ============================================================ */
.role-search-card { padding: 16px 20px; }
.role-search-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.role-search-label { font-size: 13px; font-weight: 500; color: var(--text-2); white-space: nowrap; }
.role-search-input { max-width: 320px; }

.perm-panel-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 18px 0 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.perm-panel-title { font-size: 14px; font-weight: 600; color: var(--text); }
.perm-tree { display: flex; flex-direction: column; gap: 4px; }
.perm-group { border: 1px solid var(--line); border-radius: 12px; background: #fff; overflow: hidden; }
.perm-group + .perm-group { margin-top: 10px; }
.perm-group-row {
  display: flex;
  align-items: center;
  padding: 10px 14px;
  background: linear-gradient(90deg, #f6f8fd, #fafbff);
  border-bottom: 1px solid #eef1f7;
}
.perm-caret-label { gap: 8px; }
.perm-caret {
  display: inline-grid;
  place-items: center;
  width: 18px; height: 18px;
  color: var(--text-3);
  font-size: 12px;
  transition: transform .15s;
}
.perm-caret.collapsed { transform: rotate(-90deg); }
.perm-group-name { font-weight: 600; color: var(--text); font-size: 13.5px; }
.perm-group-body { display: flex; flex-direction: column; }
.perm-menu-row {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 11px 14px;
  border-top: 1px solid #f0f2f7;
}
.perm-menu-row + .perm-menu-row { border-top: 1px solid #f0f2f7; }
.perm-menu-main { display: flex; align-items: center; }
.perm-menu-name { font-weight: 550; color: var(--text); }
.perm-menu-perms {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  padding-top: 2px;
}
.perm-perm-item { color: var(--text-2); font-size: 13px; }
.perm-perm-item input:disabled { cursor: not-allowed; }

@media (max-width: 620px) {
  .perm-menu-row { grid-template-columns: 1fr; gap: 6px; }
  .role-search-input { max-width: none; }
}

/* ============================================================
   响应式
   ============================================================ */
@media (max-width: 1180px) {
  .order-layout { grid-template-columns: 1fr; }
  .pick-list { max-height: none; }
  .kpi { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: sticky;
    top: 0;
    height: auto;
    width: 100%;
    z-index: 30;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
    overflow: visible;
  }
  .brand { padding: 0; gap: 8px; flex: none; }
  .brand-mark { width: 30px; height: 30px; border-radius: 9px; }
  .brand-mark svg { width: 18px; height: 18px; }
  .brand-text { display: none; }
  .nav-scroll {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 4px;
    overflow-x: auto;
    overflow-y: hidden;
    margin: 0;
    padding: 0;
  }
  .nav-group { display: flex; align-items: center; gap: 2px; flex: none; margin: 0; }
  .nav-group-label { display: none; }
  .nav-item {
    width: auto;
    flex: none;
    height: 34px;
    padding: 0 12px;
    margin: 0;
    white-space: nowrap;
    gap: 7px;
    font-size: 12.5px;
  }
  .nav-item .ico { display: none; }
  .nav-item.active::before { display: none; }
  .nav-item.active { background: rgba(61, 91, 245, .34); }
  .side-footer { display: none; }
  .topbar-inner { padding: 12px 18px; min-height: 64px; }
  .topbar { top: 54px; }
  .topbar h1 { font-size: 18px; }
  .main-inner { padding: 16px 16px 48px; }
  .card { padding: 16px; border-radius: 14px; }
  .login-wrap { grid-template-columns: 1fr; }
  .login-brand { display: none; }
  .login-mini { display: flex; }
  .login-panel { padding: 24px 16px; min-height: 100vh; }
}
@media (max-width: 620px) {
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .kpi { grid-template-columns: 1fr; }
  .summary-strip { grid-template-columns: 1fr 1fr; }
  .quick-grid { grid-template-columns: 1fr 1fr; }
  .user-meta { display: none; }
  .user-actions { margin-left: 0; padding-left: 4px; border-left: none; }
  .topbar .sub { display: none; }
  .table-wrap { max-height: none; }
  .modal-mask { padding: 16px 10px; }
  .modal-head { padding: 14px 16px; }
  .modal-body { padding: 16px; }
  .modal-foot { padding: 12px 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, .toast, .modal, .modal-mask { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ============================================================
   打印
   ============================================================ */
@media print {
  .sidebar, .topbar, .tabs, .btn, .toast-wrap, .userbox { display: none !important; }
  .app { display: block; }
  .main-inner { padding: 0; max-width: none; }
  .card { box-shadow: none; border: none; padding: 0; }
}
