/*
 * 守卷 · 运营工作台 —— 「密集架 · 档案库房」视觉系统
 *
 * 设计主张：把工作台做成一座秩序井然的档案库房。
 *   steel 钢灰绿 #2F4739（档案架/主色） · kraft 牛皮纸 #C8A063（标签/高亮）
 *   vermilion 朱砂 #C1352B（急件/当前项，全局唯一强色） · paper 纸白 #F4F1E9（画布）
 *   ink 墨黑 #232A26（正文） · 等宽数字 tabular-nums（单号/金额/库存/编号）
 * 侧栏＝档案架轨道；数据块＝档案盒标签；表格＝线装台账（虚线行）；朱砂章只盖急件。
 *
 * 约束：保留全部既有类名与四档响应式断点；focus-visible / sr-only 不回退；
 *       data-action / 表单字段名 / 折叠态 / 弹窗焦点等交互契约全部不动。
 */
:root {
  --steel: #2F4739;
  --steel-deep: #1E2E26;
  --steel-mid: #42604D;
  --steel-wash: #E8EFE8;
  --kraft: #C8A063;
  --kraft-soft: #E9D9B4;
  --kraft-ink: #795B26;
  --vermilion: #C1352B;
  --vermilion-s: #F6E2DE;
  --paper: #F4F1E9;
  --paper-card: #FBF9F3;
  --ink: #232A26;
  --ink-soft: #4E5A53;
  --ink-mute: #626D66;
  --rule: #DCD7C7;
  --field-border: #CFC9B8;
  --side-text: #B7C5BA;
  --side-dim: #8FA396;
  /* 兼容旧视图 inline style 中的历史变量名，避免升级后样式失效 */
  --urgent: var(--vermilion);
  --urgent-bg: var(--vermilion-s);
  --sidebar-w: 216px;
  --sidebar-w-collapsed: 64px;
  --topbar-h: 58px;
  --mono: "SF Mono", SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Source Han Sans SC", sans-serif;
}

* { box-sizing: border-box; }
/* 2026-11-30 美术收口：焦点统一 2px 半透明墨绿外圈（朱砂只做异常语义，不承担焦点含义） */
:focus-visible { outline: 2px solid rgba(47, 71, 57, .45); outline-offset: 2px; }
.sidebar :focus-visible { outline-color: rgba(237, 231, 216, .55); }
/* 页面标题只在关闭弹窗后由脚本聚焦，用于读屏定位；它不是 Tab 停靠点，
   因此不显示可见 outline，避免刷新/关闭弹窗后出现一圈红框。 */
#view-root h2:focus,
#view-root h2:focus-visible { outline: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }
html, body {
  margin: 0; padding: 0; min-height: 100%;
  background: var(--paper);
  color: var(--ink);
  font: 14px/1.6 var(--sans);
  background-image: repeating-linear-gradient(0deg, transparent 0 3px, rgba(47, 71, 57, .012) 3px 4px);
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--steel); text-decoration: none; }
.mono, .data td.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: .01em; }
.right { text-align: right; }
.small { font-size: 12.5px; }
.muted { color: var(--ink-mute); }
.nowrap { white-space: nowrap; }
.actions, .ops { white-space: nowrap; }
.empty { color: var(--ink-mute); padding: 32px; text-align: center; }

/* ---------------- 登录：档案袋 / 员工证 ---------------- */
.login-root {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background:
    radial-gradient(900px 500px at 12% -8%, rgba(200, 160, 99, .18), transparent 62%),
    linear-gradient(155deg, #16251E 0%, var(--steel-deep) 52%, #24382E 100%);
}
.login-card {
  width: 400px; max-width: 100%; position: relative;
  background: var(--paper-card);
  box-shadow: 0 30px 70px rgba(0, 0, 0, .45);
  padding: 38px 36px 30px;
  border-top: 6px solid var(--steel);
}
/* 档案袋封口金属扣 */
.login-card::before {
  content: ""; position: absolute; top: -6px; left: 50%; transform: translateX(-50%);
  width: 64px; height: 16px; background: var(--kraft); border-radius: 0 0 8px 8px;
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .08);
}
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
/* 朱砂印章（装饰，不参与读屏） */
.login-brand::before {
  content: "卷"; width: 42px; height: 42px; flex: none;
  border: 2px solid var(--vermilion); color: var(--vermilion);
  display: grid; place-items: center; font-weight: 800; font-size: 20px;
  border-radius: 50%; transform: rotate(-8deg); letter-spacing: -2px;
}
.login-brand strong { font-size: 19px; font-weight: 800; letter-spacing: .06em; }
.login-brand span { font-size: 11px; color: var(--ink-mute); letter-spacing: .18em; }
.login-sub { color: var(--ink-soft); font-size: 13px; margin: 16px 0 22px; }
.login-demo-hint, .login-real-hint {
  margin-top: 22px; padding: 12px 14px;
  background: var(--kraft-soft); border-left: 3px solid var(--kraft);
  color: #5A4A2C; font-size: 12px; line-height: 1.7;
}
.login-demo-hint strong, .login-real-hint strong { font-family: var(--mono); }
.login-real-hint { background: var(--steel-wash); border-left-color: var(--steel); color: var(--ink-soft); }

/* ---------------- 表单基础 ---------------- */
.field { margin-bottom: 16px; }
.field label { display: block; margin-bottom: 6px; font-size: 12px; color: var(--ink-soft); letter-spacing: .05em; font-weight: 600; }
.field input, .field select, .field textarea, .toolbar input, .toolbar select {
  width: 100%; padding: 9px 11px;
  border: 1px solid var(--field-border); border-radius: 0;
  background: #fff; outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.field input:focus, .field select:focus, .field textarea:focus,
.toolbar input:focus, .toolbar select:focus {
  border-color: var(--steel); box-shadow: 0 0 0 2px rgba(47, 71, 57, .14);
}
.field textarea { resize: vertical; }
.field .hint { margin-top: 5px; font-size: 12px; color: var(--ink-mute); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; column-gap: 16px; }
.form-actions { display: flex; gap: 8px; margin-top: 16px; }
.form-section { margin-bottom: 4px; }
.form-section-title {
  margin: 18px 0 12px; padding-left: 9px;
  border-left: 3px solid var(--kraft);
  font-size: 12.5px; font-weight: 700; color: var(--ink); line-height: 1.35;
  letter-spacing: .04em;
}
.form-section:first-of-type .form-section-title { margin-top: 2px; }
/* 2026-11-24 商品编辑 tab 分区（档案台账页签语言，零依赖纯 CSS 切换） */
.form-tabs {
  display: flex; gap: 0; margin: 4px 0 8px;
  border-bottom: 1px solid var(--rule);
}
.form-tab {
  appearance: none; border: 0; border-bottom: 2px solid transparent;
  background: transparent; color: var(--ink-mute); cursor: pointer;
  padding: 9px 14px; font-size: 13px; font-weight: 600;
}
.form-tab:hover { color: var(--ink); }
.form-tab.active {
  color: var(--steel-deep); border-bottom-color: var(--vermilion);
  background: var(--kraft-soft);
}
.form-tab-panel { display: none; }
.form-tab-panel.active { display: block; }
.check-field {
  display: flex; align-items: center; gap: 8px; font-size: 13px;
  color: var(--ink); padding: 8px 0; cursor: pointer;
}
.check-field input { width: 15px; height: 15px; }
.img-preview {
  margin-top: 8px; padding: 10px; border: 1px dashed var(--field-border);
  background: var(--paper); display: flex; align-items: center; justify-content: center;
}
.img-preview img { max-height: 160px; max-width: 100%; object-fit: contain; }

/* ---------------- 按钮：方角档案签 ---------------- */
.btn {
  display: inline-block; padding: 8px 16px;
  border: 1px solid var(--field-border); border-radius: 0;
  background: var(--paper-card); color: var(--ink);
  font-weight: 600; font-size: 13px; letter-spacing: .02em;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.btn:hover:not(:disabled) { border-color: var(--steel); color: var(--steel); background: #fff; }
.btn:focus-visible { outline: 2px solid var(--vermilion); outline-offset: 1px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--steel); border-color: var(--steel); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--steel-deep); border-color: var(--steel-deep); color: #fff; }
.btn-ok { background: var(--steel-mid); border-color: var(--steel-mid); color: #fff; }
.btn-ok:hover:not(:disabled) { background: var(--steel); border-color: var(--steel); color: #fff; }
.btn-danger { background: var(--vermilion); border-color: var(--vermilion); color: #fff; }
.btn-danger:hover:not(:disabled) { background: #A52C23; border-color: #A52C23; color: #fff; }
.btn-sm { padding: 5px 12px; font-size: 12.5px; }
.btn-link {
  border: none; background: none; padding: 4px 8px;
  color: var(--steel); font-weight: 700; border-radius: 0;
}
.btn-link:hover:not(:disabled) { background: var(--steel-wash); color: var(--steel); }
.btn-link[data-action="order-cancel"]:hover:not(:disabled) { background: var(--vermilion-s); color: var(--vermilion); }
.btn-danger-ghost { color: var(--vermilion); border-color: transparent; background: transparent; }
.btn-danger-ghost:hover { background: var(--vermilion-s); }
.ops .btn + .btn { margin-left: 6px; }

/* 专题列表行上下线开关（2026-11-26）：原生 checkbox 视觉隐藏，保留键盘可达。 */
.switch { display: inline-flex; align-items: center; vertical-align: middle;
  margin-right: 8px; cursor: pointer; }
.switch input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.switch-track { position: relative; display: inline-block; width: 34px; height: 18px;
  border: 1px solid var(--rule); border-radius: 9px; background: var(--paper);
  transition: background .15s ease, border-color .15s ease; }
.switch-track::after { content: ""; position: absolute; top: 2px; left: 2px;
  width: 12px; height: 12px; border-radius: 50%; background: var(--ink-mute);
  transition: transform .15s ease, background .15s ease; }
.switch input:checked + .switch-track { background: var(--steel-wash); border-color: var(--steel); }
.switch input:checked + .switch-track::after { transform: translateX(16px); background: var(--steel); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--kraft); outline-offset: 2px; }
.switch input:disabled + .switch-track { opacity: .5; cursor: not-allowed; }

/* ---------------- 外壳：顶栏 + 档案架侧栏 ---------------- */
.app-shell { min-height: 100vh; }
.app-body { display: flex; align-items: stretch; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  height: var(--topbar-h); margin-left: var(--sidebar-w);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 22px;
  background: var(--paper-card);
  border-bottom: 1px solid var(--rule);
}
.topbar-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.side-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; flex: none;
  border: 1px solid var(--rule); background: transparent;
  color: var(--ink-soft); border-radius: 0;
}
.side-toggle:hover { background: var(--steel-wash); color: var(--steel); }
.topbar .page-name { font-size: 13px; color: var(--ink-mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.page-name .crumb-root { color: var(--ink-soft); letter-spacing: .04em; }
.page-name strong { color: var(--ink); font-weight: 700; }
.crumb-sep { margin: 0 8px; color: var(--kraft); }
.topbar-right { display: flex; align-items: center; gap: 12px; }
/* 顶栏工具区（2026-11-26 批次2）：全局搜索 + 通知铃，保持档案签方角语言。 */
.topbar-tools { display: flex; align-items: center; gap: 8px; }
.topbar-search {
  display: inline-flex; align-items: center; gap: 6px; height: 32px;
  padding: 0 11px; border: 1px solid var(--rule); background: transparent;
  color: var(--ink-soft); font-size: 12px; letter-spacing: .04em;
}
.topbar-search:hover { border-color: var(--steel); color: var(--steel); background: var(--steel-wash); }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border: 1px solid var(--rule);
  background: transparent; color: var(--ink-soft); position: relative;
}
.icon-btn:hover, .notify-wrap .icon-btn[aria-expanded="true"] { border-color: var(--steel); color: var(--steel); background: var(--steel-wash); }
.notify-wrap { position: relative; }
.notify-badge {
  position: absolute; top: -6px; right: -7px; min-width: 17px; height: 17px;
  padding: 0 4px; border-radius: 9px; background: var(--vermilion); color: #fff;
  font-size: 10px; line-height: 17px; font-weight: 700; text-align: center;
}
.notify-pop {
  position: absolute; top: calc(100% + 9px); right: 0; width: 304px; z-index: 60;
  background: var(--paper-card); border: 1px solid var(--rule);
  border-top: 3px solid var(--kraft); box-shadow: 0 12px 30px rgba(17, 31, 24, .18);
}
.notify-pop[hidden] { display: none; }
.notify-pop-head { padding: 10px 14px; border-bottom: 1px dashed var(--rule); font-size: 11px; letter-spacing: .16em; color: var(--ink-mute); }
.notify-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  width: 100%; padding: 11px 14px; border: 0; border-bottom: 1px dashed var(--rule);
  background: transparent; text-align: left;
}
.notify-item:hover { background: var(--steel-wash); }
.notify-item span { display: block; }
.notify-item strong { display: block; font-size: 13px; }
.notify-item span span { margin-top: 2px; font-size: 11px; color: var(--ink-mute); }
.notify-item .notify-count { flex: none; color: var(--vermilion); font-weight: 700; font-size: 13px; }
.notify-item .notify-count.is-read { color: var(--ink-mute); font-weight: 500; font-size: 11px; }
.notify-empty { padding: 16px 14px; color: var(--ink-mute); font-size: 12px; }
.topbar .who { color: var(--ink-soft); font-size: 13px; }
.badge-demo, .tag-demo { font-size: 11px; letter-spacing: .1em; padding: 3px 8px; border: 1px dashed var(--kraft); color: var(--kraft-ink); background: transparent; }
/* 视觉版本切换按钮：顶栏右侧 / 登录页右上角各一枚，data-theme 一改全站生效 */
.theme-toggle-btn {
  flex: none; padding: 5px 12px;
  border: 1px solid var(--field-border); border-radius: 0;
  background: transparent; color: var(--ink-soft);
  font-size: 12px; font-weight: 600; letter-spacing: .04em;
}
.theme-toggle-btn:hover { border-color: var(--steel); color: var(--steel); background: #fff; }
.theme-toggle-fixed { position: fixed; top: 14px; right: 14px; z-index: 300; background: rgba(255, 255, 255, .92); }

.user-wrap { position: relative; }
.user-chip { display: flex; align-items: center; gap: 9px; padding: 4px 6px; background: none; border: 0; border-radius: 0; }
.user-chip:hover, .user-wrap.open .user-chip { background: var(--steel-wash); }
.user-avatar {
  width: 30px; height: 30px; border-radius: 50%; flex: none;
  background: var(--steel); color: #F6EFDD;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px;
}
.user-meta { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.2; }
.user-name { font-size: 13px; font-weight: 700; }
.user-role { font-size: 11px; color: var(--ink-mute); }
.user-chev { color: var(--ink-mute); display: inline-flex; transition: transform .15s ease; }
.user-wrap.open .user-chev { transform: rotate(180deg); }
.user-pop {
  display: none; position: absolute; top: calc(100% + 8px); right: 0;
  width: 200px; padding: 0; z-index: 60;
  background: var(--paper-card); border: 1px solid var(--rule);
  box-shadow: 0 12px 30px rgba(0, 0, 0, .18);
}
.user-wrap.open .user-pop { display: block; }
.user-pop-head { padding: 12px 14px; border-bottom: 1px solid var(--rule); font-size: 12px; color: var(--ink-soft); }
.user-pop-head strong { display: block; color: var(--ink); font-size: 13px; }
.user-pop-item { display: block; width: 100%; text-align: left; padding: 10px 14px; background: none; border: 0; border-radius: 0; font-size: 13px; color: var(--ink-soft); }
.user-pop-item:hover { background: var(--paper); color: var(--ink); }
.user-pop-item[data-action="logout"]:hover { background: var(--vermilion-s); color: var(--vermilion); }

.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 10;
  width: var(--sidebar-w); padding: 18px 0 14px;
  background: linear-gradient(180deg, var(--steel-deep), #17271F);
  display: flex; flex-direction: column; gap: 2px;
  overflow-y: auto; transition: width .18s ease;
}
.sidebar-brand { display: flex; align-items: center; gap: 11px; padding: 0 16px 18px; border-bottom: 1px solid rgba(255, 255, 255, .08); margin-bottom: 10px; }
/* 品牌标识＝朱砂藏书印：印面、印框、落纸阴影，是侧栏唯一一枚亮章 */
.brand-mark {
  position: relative; width: 34px; height: 34px; flex: none; border-radius: 4px;
  background: linear-gradient(155deg, #C74034, #A02B21);
  color: #F6EFDD;
  display: flex; align-items: center; justify-content: center;
  font: 800 15px/1 "Songti SC", "STSong", SimSun, serif;
}
.brand-mark::after { content: ""; position: absolute; inset: 2px; border-radius: 2px; border: 1px solid rgba(246, 239, 221, .5); }
.brand-text { min-width: 0; }
.sidebar-brand strong { display: block; color: #EDE7D8; font-size: 14px; letter-spacing: .08em; white-space: nowrap; }
.sidebar-brand .brand-text span { display: block; margin-top: 2px; color: var(--side-dim); font-size: 11px; letter-spacing: .16em; white-space: nowrap; }
.nav-group { margin: 4px 0 0; padding: 0 0 3px; border-top: 1px solid rgba(255, 255, 255, .075); }
.sidebar-brand + .nav-group { border-top: 0; margin-top: 0; }
/* 一级＝分组签：整条浅底 + 牛皮纸短脊 + 小字距，和二级导航项拉开层级 */
.nav-group-toggle {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 8px 14px 7px 15px; border: 0; border-radius: 2px;
  background: linear-gradient(90deg, rgba(255, 255, 255, .055), rgba(255, 255, 255, 0) 76%);
  color: var(--side-dim); font-size: 11px; font-weight: 700; letter-spacing: .17em;
  text-align: left; cursor: pointer; white-space: nowrap;
  transition: color .15s ease, background .15s ease;
}
.nav-group-toggle::before {
  content: ""; flex: none; width: 3px; height: 12px; border-radius: 1px;
  background: rgba(200, 160, 99, .58); transition: background .15s ease;
}
.nav-group-toggle:hover { color: #EDE7D8; background: rgba(255, 255, 255, .075); }
.nav-group.has-active .nav-group-toggle {
  background: linear-gradient(90deg, rgba(200, 160, 99, .16), rgba(255, 255, 255, 0) 76%);
  color: var(--kraft-soft);
}
.nav-group.has-active .nav-group-toggle::before { background: var(--kraft); }
.nav-group-name { flex: 1; min-width: 0; }
.nav-group-count {
  flex: none; min-width: 19px; padding: 2px 5px; text-align: center;
  border: 1px solid rgba(255, 255, 255, .14); border-radius: 9px;
  font: 500 10px/1.2 var(--font-mono); font-variant-numeric: tabular-nums;
  color: var(--side-dim); opacity: .85; letter-spacing: 0;
}
.nav-group.has-active .nav-group-count { border-color: rgba(200, 160, 99, .4); color: var(--kraft-soft); opacity: 1; }
.nav-group-chev {
  flex: none; display: inline-flex; color: var(--kraft); opacity: .55;
  transition: transform .15s ease;
}
.nav-group.is-collapsed .nav-group-items { display: none; }
.nav-group.is-collapsed .nav-group-chev { transform: rotate(-90deg); }
/* 二级＝组内条目：沿分组短脊垂下的细轨 + 内缩，形成「签—目」树形关系 */
.nav-group-items { margin: 0 8px 5px 15px; padding: 1px 0 1px 6px; border-left: 1px solid rgba(255, 255, 255, .09); }
.nav-item {
  display: flex; align-items: center; gap: 11px; width: 100%;
  padding: 9px 10px; position: relative;
  border: 0; border-radius: 2px; background: none;
  color: var(--side-text); font-size: 14px; line-height: 1.35; text-align: left; white-space: nowrap;
  transition: background .15s ease, color .15s ease;
}
.nav-item:hover { background: rgba(255, 255, 255, .055); color: #F6EFDD; }
/* 当前项＝抽出的档案盒：牛皮纸标签 + 2px 立线（2026-11-30 收口：立线改牛皮纸 2px，去朱砂） */
.nav-item.active { background: linear-gradient(90deg, rgba(200, 160, 99, .14), transparent); color: #F6EFDD; font-weight: 700; }
.nav-item.active::before { content: ""; position: absolute; left: 0; top: 4px; bottom: 4px; width: 2px; background: var(--kraft); }
.nav-ico { width: 18px; display: inline-flex; justify-content: center; color: var(--kraft); opacity: .82; flex: none; }
.nav-item.active .nav-ico { opacity: 1; }
.sidebar-foot { margin-top: auto; padding: 12px 18px 0; border-top: 1px solid rgba(255, 255, 255, .08); font-size: 12px; color: var(--side-dim); line-height: 1.6; white-space: nowrap; }
.app-shell.side-collapsed .sidebar { width: var(--sidebar-w-collapsed); }
.app-shell.side-collapsed .brand-text, .app-shell.side-collapsed .nav-text,
.app-shell.side-collapsed .nav-group-toggle, .app-shell.side-collapsed .sidebar-foot { display: none; }
.app-shell.side-collapsed .sidebar-brand { justify-content: center; padding: 0 0 16px; }
.app-shell.side-collapsed .nav-item { justify-content: center; padding: 11px 0; }
.app-shell.side-collapsed .nav-group-items { margin: 0; padding: 0; border-left: 0; }
.app-shell.side-collapsed .topbar, .app-shell.side-collapsed .main { margin-left: var(--sidebar-w-collapsed); }

.main { flex: 1; margin-left: var(--sidebar-w); padding: 10px 30px 56px; min-width: 0; max-width: 1500px; }
.view-root { animation: view-in .16s ease-out both; }
@keyframes view-in { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .view-root { animation: none; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* ---------------- 页头：标签尺 ---------------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; padding: 18px 0 14px; flex-wrap: wrap; }
.page-head h2 { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: .06em; }
.page-head h2::after { content: ""; display: inline-block; width: 26px; height: 4px; background: var(--kraft); vertical-align: middle; margin-left: 10px; }
.page-desc { margin-top: 5px; color: var(--ink-mute); font-size: 12px; letter-spacing: .03em; }

/* ---------------- 档案盒数字块 ---------------- */
/* 主档案件：第一排 4 个大盒（当日业务），其后的金额/扩展项收为半宽账签 */
.today-strip { counter-reset: box; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin: 16px 0 24px; }
.today-item {
  position: relative; counter-increment: box; min-height: 112px;
  background: var(--paper-card); border: 1px solid var(--rule); border-top: 4px solid var(--steel);
  padding: 16px 16px 14px;
}
.today-item::before { content: "NO." counter(box, decimal-leading-zero); position: absolute; top: 10px; right: 12px; font: 10px var(--mono); color: var(--ink-mute); }
.today-item:first-child::after {
  content: ""; position: absolute; top: -4px; left: 16px;
  width: 56px; height: 11px; background: var(--kraft-soft);
  transform: rotate(-3deg); border: 1px solid rgba(0, 0, 0, .04);
}
.t-num { font: 700 34px/1 var(--mono); letter-spacing: -.02em; }
.t-num.t-urgent { color: var(--vermilion); }
.t-label { margin-top: 8px; font-size: 11px; color: var(--ink-mute); }
.stamp {
  position: absolute; right: 12px; bottom: 10px;
  border: 2px solid var(--vermilion); color: var(--vermilion);
  width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 800; font-size: 14px;
  transform: rotate(-14deg); opacity: .85;
}
.today-item:nth-child(n+5) { grid-column: span 2; min-height: 78px; padding: 12px 16px 10px; border-top-width: 3px; }
.today-item:nth-child(n+5) .t-num { font-size: 24px; }
.today-item:nth-child(n+5) .t-label { margin-top: 5px; }
.today-item:nth-child(n+5) .stamp { width: 30px; height: 30px; font-size: 12px; }
.t-link { border: 0; background: none; padding: 2px; color: var(--steel); font-size: 12px; font-weight: 700; }
.t-link:hover { text-decoration: underline; }

/* ---------------- 线装台账卡片 ---------------- */
.card { background: var(--paper-card); border: 1px solid var(--rule); border-top: 3px solid var(--steel); padding: 16px 18px; margin-top: 16px; }
.card-title, .card-head h3 { margin: 0 0 12px; font-size: 14px; font-weight: 700; letter-spacing: .08em; }
.card-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 2px solid var(--steel); margin: -16px -18px 14px; }
.card-head h3 { margin: 0; }
.card-title .count-note { margin-left: 8px; font-size: 12px; font-weight: 400; color: var(--ink-mute); letter-spacing: 0; }
.dash-cols { display: grid; grid-template-columns: 1fr 1.4fr; gap: 16px; align-items: start; }

.queue-row { display: flex; align-items: center; gap: 16px; padding: 11px 4px; border-bottom: 1px dashed var(--rule); }
.queue-row:last-child { border-bottom: 0; }
.q-no { min-width: 190px; font: 600 13px var(--mono); font-variant-numeric: tabular-nums; }
.q-meta { flex: 1; color: var(--ink-soft); font-size: 13px; }
.q-sub { color: var(--ink-mute); font-size: 12px; margin-top: 1px; }
.q-amount { font: 700 15px var(--mono); font-variant-numeric: tabular-nums; }
.queue-empty { padding: 18px 4px; color: var(--steel-mid); font-size: 13.5px; }

/* ---------------- 状态档案贴纸 ---------------- */
.badge {
  display: inline-block; padding: 3px 8px; border: 1px solid; border-radius: 0;
  font-size: 11px; font-weight: 600; letter-spacing: .04em; line-height: 1.5;
  background: transparent; color: var(--ink-soft); white-space: nowrap;
}
.badge-success { color: var(--steel); border-color: var(--steel); background: var(--steel-wash); }
.badge-warn { color: var(--kraft-ink); border-color: var(--kraft); background: var(--kraft-soft); }
.badge-danger { color: var(--vermilion); border-color: var(--vermilion); background: var(--vermilion-s); }
.badge-info { color: var(--steel-mid); border-color: var(--steel-mid); background: #EFF3EC; }
.badge-muted { color: var(--ink-mute); border-color: var(--rule); background: var(--paper); }
.badge-demo { border-style: dashed; }

/* ---------------- 表格 / 工具条 / 分页 ---------------- */
.table-wrap { overflow-x: auto; }
/* table.table 是 2026-11-27 之前部分视图沿用的旧类名，此前一直没有样式，
   导致库存流水/余额/财务等 7 个页面的台账退化成「一堆纯文本」。这里与
   table.data 共用同一套线装台账样式，避免逐页改 HTML 又漏页。 */
table.data, table.table, table.line-items { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data th, table.table th, table.line-items th {
  text-align: left; padding: 10px 14px;
  background: rgba(47, 71, 57, .035);
  color: var(--ink-mute); font-size: 11px; font-weight: 600; letter-spacing: .1em;
  border-bottom: 1px solid var(--rule); white-space: nowrap;
}
table.data td, table.table td, table.line-items td { padding: 12px 14px; border-bottom: 1px dashed var(--rule); vertical-align: middle; }
table.data tbody tr:last-child td, table.table tbody tr:last-child td, table.line-items tbody tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover, table.table tbody tr:hover, table.line-items tbody tr:hover { background: rgba(200, 160, 99, .06); }
table.data td.right, table.data th.right, table.table td.right, table.table th.right, table.line-items td.right, table.line-items th.right { text-align: right; }
table.data td.center, table.data th.center, table.table td.center, table.table th.center { text-align: center; }
table.data td.empty, table.table td.empty, table.line-items td.empty { text-align: center; color: var(--ink-mute); padding: 30px 10px; }
/* 按视图收敛列宽：编号/金额/时间/操作不再被长文本挤变形（纯展示，不改列数） */
.view-root[data-view="orders"] table.data th:nth-child(1),
.view-root[data-view="orders"] table.data td:nth-child(1) { min-width: 168px; }
.view-root[data-view="orders"] table.data th:nth-child(3),
.view-root[data-view="orders"] table.data td:nth-child(3) { min-width: 110px; }
.view-root[data-view="orders"] table.data th:nth-child(5),
.view-root[data-view="orders"] table.data td:nth-child(5) { min-width: 120px; }
.view-root[data-view="products"] table.data th:nth-child(2),
.view-root[data-view="products"] table.data td:nth-child(2) { min-width: 108px; }
.view-root[data-view="products"] table.data th:nth-child(3),
.view-root[data-view="products"] table.data td:nth-child(3) { min-width: 180px; }
.view-root[data-view="products"] table.data th:nth-child(4),
.view-root[data-view="products"] table.data td:nth-child(4) { min-width: 84px; }
.view-root[data-view="products"] table.data th:nth-child(5),
.view-root[data-view="products"] table.data td:nth-child(5) { min-width: 96px; }
.view-root[data-view="orders"] table.data th:last-child,
.view-root[data-view="orders"] table.data td:last-child,
.view-root[data-view="products"] table.data th:last-child,
.view-root[data-view="products"] table.data td:last-child { min-width: 148px; text-align: right; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding-bottom: 12px; margin-bottom: 14px; border-bottom: 1px dashed var(--rule); }
.toolbar input[type="search"] { width: 240px; }
.toolbar select { width: 150px; }
.toolbar .spacer { flex: 1; }
/* 检索台：独立于台账卡片的筛选行（列表页统一骨架：页头 → 检索台 → 台账卡） */
.filter-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  background: var(--paper-card); border: 1px solid var(--rule); border-left: 4px solid var(--steel);
  padding: 12px 16px; margin-top: 16px;
}
.filter-bar input[type="search"] { width: 240px; }
.filter-bar select { width: 170px; }
.filter-bar .spacer { flex: 1; }
/* 客户列表（2026-11-27）：六格检索台 + 复选台账，窄屏自动降列 */
.filter-bar.filter-grid {
  display: grid; grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 12px 18px; align-items: end;
}
.filter-bar.filter-grid .field { margin: 0; }
.filter-bar.filter-grid .field label { font-size: 11px; letter-spacing: .08em; color: var(--ink-mute); }
.filter-bar.filter-grid .filter-actions { grid-column: 1 / -1; display: flex; gap: 8px; }
.filter-bar.filter-grid .filter-actions .btn { min-width: 76px; }
.customer-cell { display: flex; align-items: center; gap: 10px; min-width: 200px; }
.customer-name { font-weight: 600; line-height: 1.35; }
.customer-sub { margin-top: 2px; font-size: 12px; color: var(--ink-mute); }
.pick-col { width: 42px; }
.customer-toolbar { margin: 4px 0 10px; padding-bottom: 8px; border-bottom: 0; }
@media (max-width: 1080px) { .filter-bar.filter-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 680px) { .filter-bar.filter-grid { grid-template-columns: 1fr; } }
/* 订单状态分段档案签：整行置顶，点击即筛选；隐藏域保留原表单参数 */
.status-chips { flex-basis: 100%; order: -1; display: flex; flex-wrap: wrap; gap: 6px; }
.status-chips .chip {
  border: 1px solid var(--rule); background: var(--paper-card); color: var(--ink-soft);
  padding: 5px 11px; border-radius: 0; font-size: 12px; font-weight: 600; letter-spacing: .03em;
}
.status-chips .chip:hover { border-color: var(--steel); color: var(--steel); }
.status-chips .chip.on { background: var(--steel); border-color: var(--steel); color: #fff; }
.status-chips .chip.on::before { content: "▍"; color: var(--kraft); margin-right: 4px; }
/* 告警级别行级色条（2026-11-26）：错误朱砂、警告牛皮纸、信息钢灰，扫一眼可分级。 */
.alert-row td:first-child { box-shadow: inset 3px 0 0 var(--rule); }
.alert-row.alert-error td:first-child { box-shadow: inset 3px 0 0 var(--vermilion); }
.alert-row.alert-warn td:first-child { box-shadow: inset 3px 0 0 var(--kraft); }
.alert-row.alert-info td:first-child { box-shadow: inset 3px 0 0 var(--steel-mid); }
.pager { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 12px 4px 2px; }
.pager-info { font-size: 12.5px; color: var(--ink-mute); margin-right: 4px; }
.pager-btn { padding: 5px 13px; border: 1px solid var(--field-border); background: var(--paper-card); color: var(--ink); font-size: 13px; border-radius: 0; }
.pager-btn:hover:not(:disabled) { border-color: var(--steel); color: var(--steel); }
.pager-btn:disabled { opacity: .45; cursor: not-allowed; }
.cat-chip { display: inline-block; width: 14px; height: 14px; margin-right: 8px; vertical-align: -2px; border: 1px solid rgba(0, 0, 0, .12); }
/* ---------------- 分类管理：两级分类树（2026-11-26） ---------------- */
.cat-row-root > td { background: rgba(200, 160, 99, .08); border-bottom-color: var(--rule); }
.cat-row-root > td:first-child { box-shadow: inset 3px 0 0 var(--kraft); }
.cat-tree-root { display: inline-flex; align-items: center; }
.cat-subcount { margin-left: 8px; font-size: 12px; color: var(--ink-mute); white-space: nowrap; }
.cat-tree-leaf { position: relative; display: inline-block; padding-left: 28px; }
.cat-tree-leaf::before {
  content: ""; position: absolute; left: 9px; top: -20px; bottom: -20px;
  border-left: 1px solid rgba(121, 91, 38, .32);
}
.cat-row-leaf.is-last .cat-tree-leaf::before { bottom: 50%; }
.cat-tree-leaf::after {
  content: ""; position: absolute; left: 9px; top: 50%; width: 13px;
  border-top: 1px solid rgba(121, 91, 38, .32);
}
.reason-cell { max-width: 300px; word-break: break-word; }

/* ---------------- 柱状图：库存账页 ---------------- */
.bar-chart { display: flex; align-items: flex-end; gap: 14px; height: 190px; padding: 4px 2px 0; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; }
.bar-value { font: 12px var(--mono); color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.bar { width: 60%; max-width: 46px; min-height: 4px; background: var(--steel-mid); border-radius: 0; }
.bar-col:last-child .bar { background: var(--kraft); }
.bar-label { font-size: 11.5px; color: var(--ink-mute); white-space: nowrap; }

/* ---------------- 数据统计（2026-11-26）：提示条 / 排行榜占比条 ---------------- */
.hint-box {
  margin: 12px 0 0; padding: 10px 14px; border-left: 3px solid var(--kraft);
  background: rgba(0, 0, 0, .03); font-size: 13px; line-height: 1.7; color: var(--ink-soft);
}
.rank-bar { height: 8px; background: rgba(0, 0, 0, .06); overflow: hidden; }
.rank-bar-fill { height: 100%; background: var(--steel-mid); }
.today-item.t-click { cursor: pointer; }

/* ---------------- 弹窗 / 抽屉 / toast ---------------- */
.modal-mask { position: fixed; inset: 0; background: rgba(17, 31, 24, .62); z-index: 100; }
.modal-dialog, .drawer { background: var(--paper-card); color: var(--ink); border-radius: 0; }
.modal-dialog {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 580px; max-width: calc(100vw - 32px); max-height: calc(100vh - 48px); overflow-y: auto;
  border: 1px solid var(--rule); border-top: 4px solid var(--steel);
  box-shadow: 0 24px 64px rgba(0, 0, 0, .4); padding: 24px 26px; z-index: 101;
}
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: 540px; max-width: calc(100vw - 32px); overflow-y: auto;
  border-left: 4px solid var(--steel); box-shadow: -16px 0 48px rgba(0, 0, 0, .3);
  padding: 24px 26px; z-index: 101;
}
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; padding-bottom: 14px; border-bottom: 2px solid var(--steel); }
.modal-head h3 { margin: 0; font-size: 16px; font-weight: 800; letter-spacing: .05em; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; padding-top: 16px; border-top: 1px dashed var(--rule); }
/* 全局搜索（2026-11-26 批次2）：结果按商品/订单两组，整行可点。 */
.modal-search { width: 620px; }
.search-results { margin-top: 6px; }
.search-group h4 { margin: 18px 0 8px; font-size: 12px; letter-spacing: .12em; color: var(--ink-mute); }
.search-group h4 .muted { letter-spacing: 0; }
.search-result {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%; padding: 10px 12px; border: 1px solid var(--rule); border-left: 3px solid var(--kraft);
  background: var(--paper-card); text-align: left; margin-bottom: 6px;
}
.search-result:hover { background: var(--steel-wash); border-color: var(--steel); border-left-color: var(--vermilion); }
.search-result-main { min-width: 0; }
.search-result-main strong { display: block; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-result-sub { display: block; margin-top: 2px; font-size: 11px; color: var(--ink-mute); }
.search-result-go { flex: none; font-size: 11px; color: var(--steel); }
.search-empty { padding: 14px 2px; color: var(--ink-mute); font-size: 12px; }
.kv { display: grid; grid-template-columns: 96px 1fr; row-gap: 9px; margin: 0 0 6px; }
.kv dt { color: var(--ink-mute); font-size: 13px; }
.kv dd { margin: 0; font-size: 13.5px; }
.kv dd.right { text-align: right; }
/* 抽屉内键值对更紧凑；急件提示统一朱砂批注条 */
.drawer .kv { grid-template-columns: 88px 1fr; row-gap: 8px; }
.note-strip {
  background: var(--vermilion-s); border-left: 3px solid var(--vermilion);
  color: #8F2F27; padding: 11px 14px; font-size: 12.5px; margin-top: 14px; line-height: 1.6;
}
.toast-root { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast { padding: 11px 20px; background: var(--steel-deep); color: #F4F1E9; border-left: 3px solid var(--kraft); font-size: 13.5px; box-shadow: 0 10px 28px rgba(0, 0, 0, .3); }
.toast-success { background: var(--steel); border-left-color: var(--kraft); }
.toast-error { background: var(--vermilion); border-left-color: var(--kraft-soft); }

/* ---------------- 富文本编辑器 ---------------- */
.img-upload-row { display: flex; gap: 8px; align-items: center; }
.img-upload-row input { flex: 1; min-width: 0; }
.rte { border: 1px solid var(--field-border); background: #fff; }
.rte-toolbar { display: flex; flex-wrap: wrap; gap: 2px; padding: 6px 8px; border-bottom: 1px solid var(--rule); background: var(--paper); }
.rte-btn { min-width: 32px; height: 28px; padding: 0 8px; border: 1px solid transparent; background: transparent; color: var(--ink); font-size: 13px; cursor: pointer; border-radius: 0; }
.rte-btn:hover { background: var(--steel-wash); border-color: var(--rule); }
.rte-btn:focus-visible, .rte-file:focus-visible { outline: 2px solid var(--vermilion); outline-offset: 1px; }
.rte-area { min-height: 160px; max-height: 420px; overflow-y: auto; padding: 12px 14px; font-size: 14px; line-height: 1.7; outline: none; word-break: break-word; }
.rte-area:focus { box-shadow: inset 0 0 0 2px rgba(47, 71, 57, .22); }
.rte-area:empty::before { content: attr(data-placeholder); color: var(--ink-mute); }
.rte-area img { max-width: 100%; height: auto; }
.rte-area h2 { font-size: 17px; margin: 14px 0 8px; }
.rte-area p { margin: 0 0 8px; }
.rte-area ul, .rte-area ol { padding-left: 22px; margin: 0 0 8px; }

/* ---------------- 商品缩略图 / 九宫格 / 规格型号 ---------------- */
table.data td.product-thumb-cell { width: 56px; padding: 6px 8px; }
.product-thumb-img { width: 44px; height: 44px; object-fit: cover; display: block; border: 1px solid var(--rule); background: var(--kraft-soft); }
.product-thumb-ph { display: inline-block; min-width: 44px; height: 44px; line-height: 42px; text-align: center; color: var(--ink-mute); font-size: 11px; border: 1px dashed var(--field-border); }
.gallery-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.gallery-cell { position: relative; width: 108px; height: 108px; border: 1px solid var(--rule); overflow: hidden; background: var(--kraft-soft); }
.gallery-cell img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery-cover { position: absolute; top: 0; left: 0; background: var(--steel); color: #fff; font-size: 11px; line-height: 18px; padding: 0 6px; }
.gallery-ops { position: absolute; left: 0; right: 0; bottom: 0; display: flex; gap: 4px; padding: 3px 4px; background: rgba(30, 46, 38, .82); justify-content: center; }
.gallery-ops .glink { border: 0; background: transparent; color: #fff; font-size: 11px; cursor: pointer; padding: 2px; }
.gallery-ops .glink.gdel { color: #F6B8B2; }
.gallery-add { width: 108px; height: 108px; border: 1px dashed var(--field-border); background: var(--paper); color: var(--ink-mute); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; cursor: pointer; font-size: 12px; }
.gallery-add:hover { border-color: var(--steel); color: var(--steel); }
.gallery-add .plus { font-size: 22px; line-height: 1; }
.sku-group-card { border: 1px solid var(--rule); border-top: 3px solid var(--steel-mid); padding: 10px 12px; margin-bottom: 10px; background: var(--paper); }
.sku-group-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.sku-group-head label { font-size: 12px; color: var(--ink-soft); }
.sku-group-head input { width: 180px; }
.sku-group-head .gdel, .sku-opt .gdel { color: var(--vermilion); }
.sku-opt { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.sku-opt input[data-opt-label] { flex: 1; max-width: 280px; }
/* SKU 选项图（2026-11-20）：行内小预览 + 传图/换图/清图 */
.sku-opt-media { display: inline-flex; align-items: center; flex: none; }
.sku-opt-media img[data-opt-preview] { width: 36px; height: 36px; object-fit: cover; border-radius: 4px; border: 1px solid var(--rule); }
.sku-delta { display: inline-flex; align-items: center; gap: 4px; }
.sku-delta input { width: 84px; text-align: right; }
.sku-delta em { font-style: normal; font-size: 12px; color: var(--ink-mute); }
.sku-opt .gdel { font-size: 16px; }
#f-sku-editor > .btn { margin-top: 2px; }

/* ---------------- 权限分级 / 内容中心 / 首页推荐 ---------------- */
.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; padding: 6px 0; }
.perm-check { display: inline-flex; align-items: center; gap: 6px; padding: 7px 10px; border: 1px solid var(--rule); background: #fff; cursor: pointer; font-size: 13px; }
.perm-check.manager { border-color: var(--kraft); background: var(--kraft-soft); }
.perm-check input { accent-color: var(--steel); }
.perm-check input:disabled { cursor: not-allowed; opacity: .7; }
.perm-levels { display: flex; flex-direction: column; gap: 12px; }
.perm-level-group { border: 1px solid var(--rule); border-left: 4px solid var(--steel-mid); padding: 8px 12px 12px; background: var(--paper); }
.perm-level-group:nth-child(3) { border-left-color: var(--kraft); }
.perm-level-group:nth-child(4) { border-left-color: var(--vermilion); }
.perm-level-title { font-size: 13px; font-weight: 700; color: var(--ink); padding: 4px 0 2px; border-bottom: 1px dashed var(--rule); margin-bottom: 8px; }
.perm-level-title .muted { font-weight: 400; font-size: 12px; }
.content-group { margin-bottom: 16px; }
.content-thumb { width: 72px; height: 40px; object-fit: cover; border: 1px solid var(--rule); vertical-align: middle; }
.content-text-preview { color: var(--ink); font-size: 12px; }
.rec-preview { display: inline-block; min-width: 80px; }
.rec-thumb { width: 84px; height: 46px; object-fit: cover; border: 1px solid var(--rule); }
.rec-thumb-lg { max-width: 240px; max-height: 120px; object-fit: cover; border: 1px solid var(--rule); }
.rec-image-row { display: flex; align-items: flex-start; gap: 16px; }
.rec-image-preview { min-width: 120px; min-height: 60px; display: flex; align-items: center; justify-content: center; }

/* ---------------- 响应式四档（对齐小程序 device.js 理念） ---------------- */
@media (max-width: 980px) {
  .dash-cols { grid-template-columns: 1fr; }
}
@media (max-width: 849px) {
  .sidebar { width: var(--sidebar-w-collapsed); padding: 16px 0; }
  .brand-text, .nav-text, .nav-group-toggle, .sidebar-foot { display: none; }
  .sidebar-brand { justify-content: center; padding: 0 0 16px; }
  .nav-item { justify-content: center; padding: 11px 0; }
  .topbar, .main { margin-left: var(--sidebar-w-collapsed); }
  .main { padding: 6px 16px 40px; }
  .today-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .today-item { padding: 12px 14px; min-height: 96px; }
  .today-item .t-num { font-size: 22px; }
  .today-item:nth-child(n+5) { grid-column: span 1; min-height: 78px; }
  .q-no { min-width: 140px; }
}
@media (max-width: 640px) {
  .app-body { flex-direction: column; }
  .sidebar { position: static; height: auto; width: 100%; flex-direction: row; overflow-x: auto; padding: 8px 0; }
  .sidebar-brand, .sidebar-foot { display: none; }
  .nav-group { display: flex; padding: 0; margin: 0; border-top: 0; }
  .nav-group-items { display: flex; margin: 0; padding: 0; border-left: 0; }
  .nav-item { width: auto; }
  .topbar, .main { margin-left: 0; }
  .app-shell.side-collapsed .topbar, .app-shell.side-collapsed .main { margin-left: 0; }
  .topbar { padding: 0 14px; }
  table.data, table.line-items { font-size: 12px; }
  table.data th, table.data td, table.line-items th, table.line-items td { padding: 9px 10px; }
}
@media (max-width: 599px) {
  .topbar { padding: 0 12px; }
  .crumb-root, .crumb-sep { display: none; }
  .user-meta { display: none; }
  .topbar-search { width: 34px; padding: 0; justify-content: center; }
  .topbar-search-label { display: none; }
  .notify-pop { width: 276px; }
  .toolbar input[type="search"], .filter-bar input[type="search"] { width: 100%; }
  .filter-bar { padding: 10px 12px; }
  .form-grid { grid-template-columns: 1fr; }
  .drawer { width: 100vw; border-left: 0; }
  .page-head { flex-wrap: wrap; }
}
@media (max-width: 359px) {
  .today-strip { grid-template-columns: 1fr; }
  .today-item:nth-child(n+5) { grid-column: span 1; }
  .bar-chart { gap: 6px; }
}

/* ===== 结构化商品详情编辑器（2026-11-20 方案 A：参数表 + 卖点 + 图文段落） ===== */
.detail-editor { display: flex; flex-direction: column; gap: 12px; }
.detail-sec { border: 1px solid var(--rule); border-radius: var(--radius-sm, 6px); padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; background: var(--paper-card); }
.detail-sec-title { font-size: 12px; color: var(--ink-mute); letter-spacing: .1em; }
.detail-rows, .detail-blocks { display: flex; flex-direction: column; gap: 8px; }
.detail-spec-row, .detail-point-row { display: flex; gap: 8px; align-items: center; }
.detail-spec-row input:first-child { flex: 0 0 38%; min-width: 0; }
.detail-spec-row input:nth-child(2), .detail-point-row input { flex: 1; min-width: 0; }
.detail-del { color: var(--urgent); }
.detail-block { display: grid; grid-template-columns: 150px 1fr; gap: 8px; border: 1px dashed var(--field-border); border-radius: var(--radius-sm, 6px); padding: 8px; }
.detail-block-media { display: flex; flex-direction: column; gap: 6px; }
.detail-block-media img { width: 100%; height: 90px; object-fit: cover; border-radius: 4px; }
.detail-block textarea { width: 100%; box-sizing: border-box; resize: vertical; }
.detail-block-ops { grid-column: 1 / -1; display: flex; gap: 6px; justify-content: flex-end; }

/* ---- 客服话术库（2026-11-20）：纯静态问答排版 ---- */
.faq-item { border-bottom: 1px solid var(--field-border); padding: 10px 0; }
.faq-item:last-child { border-bottom: none; }
.faq-q { font-weight: 600; margin-bottom: 4px; }
.faq-a { color: var(--text-dim, #555); line-height: 1.7; }

/* ---- 中控台开关滑块（2026-11-27）：用 button 画滑块，保留 data-action 委托与键盘可达 ---- */
.switch {
  position: relative; width: 46px; height: 24px; padding: 0; flex: 0 0 auto;
  border: 1px solid var(--field-border); border-radius: 999px;
  background: #DFDACB; cursor: pointer;
  transition: background .16s ease, border-color .16s ease;
}
.switch .switch-thumb {
  position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--paper-card); box-shadow: 0 1px 2px rgba(30, 46, 38, .2);
  transition: left .16s ease;
}
.switch.is-on { background: var(--steel); border-color: var(--steel); }
.switch.is-on .switch-thumb { left: 24px; }
.switch:disabled { opacity: .5; cursor: not-allowed; }
.switch:focus-visible { outline: 2px solid var(--kraft); outline-offset: 2px; }
.control-state .switch-note { display: inline-block; min-width: 3em; }

/* ======================================================================
   2026-11-30 演示轮收口：角标降噪 + 点击反馈 + 动效节奏（覆盖块，置于末尾生效）
   总纲：角标三套形态（圆点 / 档案贴纸 / 数字胶囊）；主按钮给按压；
   动效只做翻页 / 抽卡 / 盖章，其余安静；一页只留一个强色。
   ====================================================================== */

/* ---- 角标三套 ---- */
/* 普通状态＝6px 圆点 + 11.5px 文字：无边框、无底色、不加字距 */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 2px 0; border: 0; border-radius: 0; background: transparent;
  font-size: 11.5px; font-weight: 600; letter-spacing: 0; line-height: 1.4;
  color: var(--ink-soft); white-space: nowrap;
}
.badge::before {
  content: ""; flex: none; width: 6px; height: 6px; border-radius: 50%;
  background: #6E766F; /* 普通/已下架 灰点 */
}
/* 完成/在售：墨绿点 + 深绿字 */
.badge-success { color: #2F6B4F; background: transparent; border: 0; }
.badge-success::before { background: #4C8A68; }
/* 信息/当前项：钢绿点 */
.badge-info { color: var(--steel-mid); background: transparent; border: 0; }
.badge-info::before { background: var(--steel-mid); }
/* 弱化态：灰点 + 次要字色 */
.badge-muted { color: var(--ink-mute); background: transparent; border: 0; }
.badge-muted::before { background: #6E766F; }
/* 待处理/预警：方角档案贴纸（牛皮金描边，2px 小圆角），一眼可见但不刺眼 */
.badge-warn {
  color: #8A6425; background: rgba(200, 160, 99, .10);
  border: 1px solid var(--kraft); border-radius: 2px; padding: 2px 8px;
}
.badge-warn::before { display: none; }
/* 异常/缺货：朱砂贴纸——红色只留给异常和删除确认 */
.badge-danger {
  color: var(--vermilion); background: transparent;
  border: 1px solid var(--vermilion); border-radius: 2px; padding: 2px 8px;
}
.badge-danger::before { display: none; }
.badge-demo { border-style: dashed; }
/* 通知数字胶囊＝计数不是状态签：16px 高 / 10px 字 / 不加描边（99+ 由脚本处理） */
.notify-badge {
  min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 8px; font-size: 10px; line-height: 16px;
}

/* ---- 点击反馈（分控件） ---- */
.btn { transition: background .12s ease-out, border-color .12s ease-out, color .12s ease-out, transform .12s ease-out; }
/* 主按钮：按下下移 1px + 底色压深约 6%，120ms 回弹；不缩放不弹簧 */
.btn-primary:not(:disabled):active { transform: translateY(1px); background: #26402F; border-color: #26402F; }
.btn-ok:not(:disabled):active { background: #2F4739; border-color: #2F4739; }
.btn-danger:not(:disabled):active { background: #A52C23; border-color: #A52C23; }
/* 次按钮：只加深底色和边框，不位移 */
.btn:not(.btn-primary):not(.btn-ok):not(.btn-danger):not(:disabled):active { background: var(--steel-wash); border-color: var(--steel); }
/* 图标按钮：只做底色 wash，不位移（一排图标不抖） */
.icon-btn { transition: background .12s ease-out, border-color .12s ease-out, color .12s ease-out; }
.icon-btn:active { background: var(--steel-wash); }
/* 表格行 hover：浅牛皮色 90ms 渐入 */
table.data tbody tr, table.table tbody tr, table.line-items tbody tr { transition: background .09s ease-out; }
/* 操作列文字按钮：视觉是文字，点击区 ≥28px 高、左右 6px 内边距 */
.ops .btn, .actions .btn { min-height: 28px; padding-top: 4px; padding-bottom: 4px; }
.ops .btn-link, .btn-link { min-height: 28px; padding-left: 6px; padding-right: 6px; }

/* ---- 动效节奏：弹层 220ms / 通知 160ms / Toast 160ms，统一 ease-out 无回弹 ---- */
.modal-mask { animation: mask-in .22s ease-out both; }
@keyframes mask-in { from { opacity: 0; } to { opacity: 1; } }
.modal-dialog { animation: dialog-in .22s ease-out both; }
@keyframes dialog-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.drawer { animation: drawer-in .22s ease-out both; }
@keyframes drawer-in { from { transform: translateX(24px); opacity: .4; } to { transform: none; opacity: 1; } }
.notify-pop { animation: pop-in .16s ease-out both; }
@keyframes pop-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.toast { animation: toast-in .16s ease-out both; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
