/* ==========================================================================
   员工端外壳与页面样式（2026-10-17 重做），在 app.css 之后、player-mobile.css 之前加载。
   作用域：
   · .app-layout              桌面外壳（侧栏、顶栏、账号菜单），所有角色共用；
   · html.is-staff            员工账号（桌面与手机）：页面内容、弹窗、浮层的统一样式；
   · .is-staff-app / html.staff-app-mode   员工手机 App 模式（≤900px 或触屏横屏，断点见 app.js 的 PLAYER_APP_QUERY）。
   陪玩 App 模式（.player-app）与陪玩页面内容不在此文件处理。
   PC 卡片（.entity-card / .pc-figma-*）的几何由 app.css 与专项测试约束：这里不改它们的尺寸与圆角，
   也不改侧栏宽度（232/76px）与内容区左右留白（32/24px）。
   ========================================================================== */

:root {
  --shell-topbar-h: 60px;
  --ui-radius-sm: 6px;
  --ui-radius: 8px;
  --ui-radius-lg: 12px;
  --ui-ctl-h: 34px;
  --ui-border-strong: #d9dce6;
  --ui-hover: #f4f5f9;
  --ui-shadow-sm: 0 1px 2px rgba(16, 24, 40, .04);
  --ui-shadow-pop: 0 12px 32px rgba(16, 24, 40, .14), 0 2px 6px rgba(16, 24, 40, .06);
  --ui-focus-ring: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent);
  --ui-text-2: #4b5263;
}
:root[data-theme="dark"] {
  --ui-border-strong: #3a4160;
  --ui-hover: #22273e;
  --ui-shadow-sm: 0 1px 2px rgba(0, 0, 0, .2);
  --ui-shadow-pop: 0 14px 36px rgba(0, 0, 0, .45), 0 2px 6px rgba(0, 0, 0, .25);
  --ui-text-2: #c4cadb;
}

.ui-icon { display: block; flex: 0 0 auto; }

/* ---------- 桌面外壳：侧栏 ---------- */
.app-layout > aside {
  background: var(--surface);
  border-right: 1px solid var(--line);
}
.app-layout .brand {
  height: 64px;
  padding: 0 20px;
  gap: 10px;
  border-bottom: 1px solid var(--line);
}
.app-layout .brand-mark { width: 32px; height: 32px; flex-basis: 32px; border-radius: 10px; box-shadow: none; }
.app-layout .brand-copy b { font-size: 15px; letter-spacing: .2px; }
.app-layout .brand small { font-size: 10px; letter-spacing: .6px; color: var(--muted); }
.app-layout .sidebar-nav { padding: 12px 10px 16px; }
.app-layout .nav-group { margin: 0 0 6px; }
.app-layout .nav-group-title.nav-group-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 30px;
  padding: 0 10px;
  margin: 4px 0 2px;
  border-radius: var(--ui-radius-sm);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .4px;
  color: var(--muted);
}
.app-layout .nav-group-title.nav-group-toggle:hover { color: var(--text); background: var(--ui-hover); }
.app-layout .nav-group.is-current > .nav-group-toggle { color: var(--text); }
.app-layout .nav-group-chevron { opacity: .7; transition: transform 160ms ease; }
.app-layout .nav-group-toggle[aria-expanded="false"] .nav-group-chevron { transform: rotate(-90deg); }
.app-layout .nav-item,
.app-layout .nav-item.active {
  height: 38px;
  margin: 1px 0;
  padding: 0 10px;
  gap: 10px;
  border: 0;
  border-radius: var(--ui-radius);
  font-size: 13.5px;
  color: var(--ui-text-2);
}
.app-layout .nav-item:hover { background: var(--ui-hover); color: var(--text); }
.app-layout .nav-item.active {
  background: var(--blue-soft);
  color: var(--primary);
  font-weight: 600;
}
.app-layout .nav-item.active::before { left: -10px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; }
.app-layout .nav-icon { width: 18px; flex: 0 0 18px; display: grid; place-items: center; color: var(--muted); }
.app-layout .nav-item:hover .nav-icon { color: var(--text); }
.app-layout .nav-item.active .nav-icon { color: var(--primary); }
.app-layout .nav-badge {
  min-width: 20px;
  height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  line-height: 18px;
  font-variant-numeric: tabular-nums;
}
.app-layout .sidebar-bottom { margin: 0 10px; padding: 10px 0 12px; border-top: 1px solid var(--line); }
.app-layout .sidebar-collapse {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 36px;
  padding: 0 10px;
  border: 0;
  border-radius: var(--ui-radius);
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  text-align: left;
}
.app-layout .sidebar-collapse:hover { background: var(--ui-hover); color: var(--text); }
.app-layout aside.collapsed .brand { padding: 0; justify-content: center; }
.app-layout aside.collapsed .sidebar-nav { padding: 12px 8px; }
.app-layout aside.collapsed .nav-group { margin: 0 0 6px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.app-layout aside.collapsed .nav-group:last-child { border-bottom: 0; }
.app-layout aside.collapsed .nav-group-toggle { display: none; }
.app-layout aside.collapsed .nav-item { justify-content: center; padding: 0; }
.app-layout aside.collapsed .nav-item.active::before { left: -8px; }
.app-layout aside.collapsed .sidebar-collapse { justify-content: center; padding: 0; }
.app-layout aside.collapsed .sidebar-collapse span { display: none; }
.app-layout aside.collapsed .dispatch-application-count { position: absolute; top: 2px; right: 6px; }

/* ---------- 桌面外壳：顶栏 ---------- */
.app-layout header.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--shell-topbar-h);
  min-height: var(--shell-topbar-h);
  padding: 0 24px 0 32px;
  gap: 16px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.app-layout .topbar-heading { display: flex; flex-direction: column; justify-content: center; min-width: 0; flex: 0 1 auto; }
.app-layout .topbar-crumb { font-size: 12px; line-height: 16px; color: var(--muted); }
.app-layout .page-title { font-size: 18px; line-height: 24px; font-weight: 650; letter-spacing: 0; color: var(--text); }
.app-layout .topbar-search {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 1 360px;
  min-width: 0;
  height: 36px;
  margin-left: auto;
  padding: 0 8px 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--ui-radius);
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  transition: border-color 150ms ease, background 150ms ease;
}
.app-layout .topbar-search:hover { border-color: var(--ui-border-strong); background: var(--surface); color: var(--text); }
.topbar-search-text { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; text-align: left; }
.app-layout .topbar-search kbd,
.cmd-foot kbd,
.cmd-esc {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 6px;
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: var(--surface);
  color: var(--muted);
  font: 600 11px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.app-layout .user-box { gap: 4px; margin-left: 0; flex: 0 0 auto; }
.app-layout header.topbar:not(:has(.topbar-search)) .user-box { margin-left: auto; }
.topbar-icon-btn {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: var(--ui-radius);
  background: transparent;
  color: var(--ui-text-2);
}
.topbar-icon-btn:hover { background: var(--ui-hover); color: var(--text); }
.topbar-icon-btn:disabled { opacity: .5; cursor: not-allowed; }
.topbar-icon-btn.sound-toggle.is-off { color: var(--muted); }
.app-layout .ann-entry .ann-unread {
  position: absolute;
  top: 3px;
  right: 2px;
  min-width: 16px;
  height: 16px;
  margin: 0;
  padding: 0 4px;
  border: 2px solid var(--surface);
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 12px;
  box-sizing: content-box;
}
.app-layout .theme-toggle { padding: 0; margin: 0; border: 0; border-radius: var(--ui-radius); }

.user-menu { position: relative; margin-left: 6px; }
.user-menu-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 8px 0 4px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
}
.user-menu-trigger:hover,
.user-menu-trigger[aria-expanded="true"] { background: var(--ui-hover); color: var(--text); }
.user-menu .user-avatar,
.user-menu-head .user-avatar { width: 30px; height: 30px; flex-basis: 30px; border-radius: 9px; font-size: 13px; }
.user-menu-text { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.25; text-align: left; }
.user-menu-text .user-name { font-size: 13px; font-weight: 600; color: var(--text); }
.app-layout .user-menu-text .role { font-size: 11px; color: var(--muted); }
.user-menu-pop {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 90;
  width: 240px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: var(--ui-radius-lg);
  background: var(--surface);
  box-shadow: var(--ui-shadow-pop);
}
.user-menu-head { display: flex; align-items: center; gap: 10px; padding: 10px 10px 12px; border-bottom: 1px solid var(--line); }
.user-menu-head b { display: block; font-size: 14px; color: var(--text); }
.user-menu-head small { display: block; font-size: 12px; color: var(--muted); }
.user-menu-section { padding: 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.user-menu-label { margin-bottom: 8px; font-size: 12px; color: var(--muted); }
.user-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 36px;
  padding: 0 10px;
  border: 0;
  border-radius: var(--ui-radius);
  background: transparent;
  color: var(--text);
  font-size: 13px;
  text-align: left;
}
.user-menu-item:hover { background: var(--ui-hover); }
.user-menu-item.is-danger { color: var(--danger); }

/* ---------- 快捷新建 ---------- */
.quick-create { position: relative; margin-right: 6px; }
.quick-create-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 10px 0 12px;
  border: 0;
  border-radius: var(--ui-radius);
  background: var(--primary);
  color: var(--on-primary);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.quick-create-trigger:hover { background: var(--primary-dark); }
.quick-create-trigger.is-compact { width: 40px; height: 40px; padding: 0; justify-content: center; border-radius: 12px; }
.quick-create-pop {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 90;
  width: 280px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: var(--ui-radius-lg);
  background: var(--surface);
  box-shadow: var(--ui-shadow-pop);
}
.quick-create-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: var(--ui-radius);
  background: transparent;
  color: var(--text);
  text-align: left;
}
.quick-create-item:hover,
.quick-create-item:focus-visible { background: var(--ui-hover); }
.quick-create-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border-radius: var(--ui-radius);
  background: var(--blue-soft);
  color: var(--primary);
}
.quick-create-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.quick-create-text b { font-size: 13.5px; font-weight: 600; }
.quick-create-text small { font-size: 12px; color: var(--muted); }
.quick-action-body { padding-top: 18px; }

/* ---------- 全局搜索（Ctrl / ⌘ + K） ---------- */
.cmd-mask {
  position: fixed;
  inset: 0;
  z-index: 2600;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 12vh 16px 16px;
  background: rgba(15, 18, 32, .42);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}
.cmd-panel {
  display: flex;
  flex-direction: column;
  width: min(640px, 100%);
  max-height: min(560px, 76vh);
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--ui-shadow-pop);
}
.cmd-input-row { display: flex; align-items: center; gap: 10px; padding: 0 12px 0 16px; border-bottom: 1px solid var(--line); color: var(--muted); }
.cmd-input-row .cmd-input,
.cmd-input-row .cmd-input:focus {
  flex: 1;
  min-width: 0;
  height: 54px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--text);
  font-size: 16px;
}
.cmd-close { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 4px; border: 0; background: transparent; color: var(--muted); }
.cmd-close .ui-icon { display: none; }
.cmd-results { flex: 1; min-height: 120px; overflow-y: auto; padding: 6px 8px 10px; }
.cmd-section-title { padding: 10px 10px 6px; font-size: 12px; font-weight: 600; color: var(--muted); }
.cmd-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 46px;
  padding: 6px 10px;
  border: 0;
  border-radius: var(--ui-radius);
  background: transparent;
  color: var(--text);
  text-align: left;
}
.cmd-row.is-active { background: var(--blue-soft); }
.cmd-row-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border: 1px solid var(--line);
  border-radius: var(--ui-radius);
  background: var(--surface);
  color: var(--ui-text-2);
}
.cmd-row.is-active .cmd-row-icon { color: var(--primary); border-color: transparent; }
.cmd-row-text { display: flex; flex-direction: column; flex: 1; min-width: 0; line-height: 1.35; }
.cmd-row-text b { overflow: hidden; font-size: 13.5px; font-weight: 600; white-space: nowrap; text-overflow: ellipsis; }
.cmd-row-text small { overflow: hidden; font-size: 12px; color: var(--muted); white-space: nowrap; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.cmd-row-enter { color: var(--muted); opacity: 0; }
.cmd-row.is-active .cmd-row-enter { opacity: 1; }
.cmd-empty { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 40px 16px; color: var(--muted); font-size: 13px; }
.cmd-loading { padding: 8px 12px; color: var(--muted); font-size: 12px; }
.cmd-foot { display: flex; gap: 16px; padding: 10px 16px; border-top: 1px solid var(--line); background: var(--surface-soft); color: var(--muted); font-size: 12px; }
.cmd-foot span { display: inline-flex; align-items: center; gap: 4px; }

/* ==========================================================================
   员工页面统一样式（html.is-staff）：容器、表单控件、按钮、表格、页签、状态胶囊、弹窗、分页、提示。
   只调外观，不改按钮高度与内边距（PC 卡片操作栏按真实宽度收放按钮，测试按此计算）。
   ========================================================================== */
html.is-staff .page-content { padding-top: 24px; }
html.is-staff .card,
html.is-staff .stat,
html.is-staff .mini-panel,
html.is-staff .overview-stat,
html.is-staff .boss-kpi,
html.is-staff .eval-stat,
html.is-staff .ranking-board {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--ui-radius-lg);
  box-shadow: var(--ui-shadow-sm);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
html.is-staff .card { padding: 20px; margin-bottom: 16px; }
html.is-staff .card:hover,
html.is-staff .stat:hover,
html.is-staff .mini-panel:hover,
html.is-staff .overview-stat:hover,
html.is-staff .boss-kpi:hover,
html.is-staff .eval-stat:hover,
html.is-staff .ranking-board:hover { transform: none; box-shadow: var(--ui-shadow-sm); }
html.is-staff .stat.is-clickable:hover,
html.is-staff .overview-stat:has(button):hover { border-color: var(--ui-border-strong); box-shadow: 0 4px 14px rgba(16, 24, 40, .07); }
html.is-staff .card-t,
html.is-staff .section-title {
  padding-left: 0;
  border-left: 0;
  font-size: 15px;
  font-weight: 650;
  letter-spacing: 0;
}
html.is-staff .section-title { margin: 20px 0 12px; }

/* 工具栏：一行筛选条，控件统一 36px，视图切换与列设置靠右。 */
html.is-staff .toolbar.card { padding: 12px 16px; gap: 10px; }
html.is-staff .toolbar .date-label,
html.is-staff .toolbar > label { color: var(--muted); font-size: 13px; }

/* 表单控件：白底、清晰边框、统一圆角与聚焦光圈。 */
html.is-staff input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not(.picker-inline-input):not(.m-search-input):not(.cmd-input),
html.is-staff select,
html.is-staff textarea,
html.is-staff .picker-box,
html.is-staff .dash-multi-trigger,
html.is-staff .date-range-trigger {
  border-color: var(--ui-border-strong);
  border-radius: var(--ui-radius);
  background: var(--surface);
  color: var(--text);
}
html.is-staff input:not([type="checkbox"]):not([type="radio"]):not(.picker-inline-input):not(.m-search-input):not(.cmd-input):hover,
html.is-staff select:hover,
html.is-staff textarea:hover,
html.is-staff .picker-box:hover,
html.is-staff .date-range-trigger:hover { border-color: color-mix(in srgb, var(--ui-border-strong) 60%, var(--text)); }
html.is-staff input:not([type="checkbox"]):not([type="radio"]):not(.picker-inline-input):not(.m-search-input):not(.cmd-input):focus,
html.is-staff select:focus,
html.is-staff textarea:focus,
html.is-staff .picker-box:focus-within {
  border-color: var(--primary);
  box-shadow: var(--ui-focus-ring);
}
html.is-staff input:disabled,
html.is-staff select:disabled,
html.is-staff textarea:disabled { background: var(--surface-soft); }
html.is-staff .field label { color: var(--ui-text-2); font-size: 13px; font-weight: 500; margin-bottom: 6px; }
html.is-staff .form-grid { gap: 16px 20px; }

/* 按钮：统一 8px 圆角（卡片操作栏的胶囊按钮除外），默认白底描边、悬停浅灰。 */
html.is-staff .btn:not(.entity-action-pill) { border-radius: var(--ui-radius); }
html.is-staff .btn:not(.btn-primary):not(.btn-danger):not(.entity-action-pill) {
  border-color: var(--ui-border-strong);
  background: var(--surface);
  color: var(--ui-text-2);
}
html.is-staff .btn:not(.btn-primary):not(.btn-danger):not(.entity-action-pill):hover {
  border-color: var(--ui-border-strong);
  background: var(--ui-hover);
  color: var(--text);
}
html.is-staff .btn.btn-primary { font-weight: 600; box-shadow: 0 1px 2px color-mix(in srgb, var(--primary) 30%, transparent); }
html.is-staff .btn:active { transform: none; }
html.is-staff .view-switch { padding: 3px; border-radius: 10px; background: var(--surface-soft); border: 1px solid var(--line); }
html.is-staff .view-switch .btn:not(.btn-primary) { border: 0; background: transparent; box-shadow: none; }
html.is-staff .view-switch .btn { border-radius: 7px; min-height: 28px; }
html.is-staff .view-switch .btn.btn-primary { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(16, 24, 40, .12); }
:root[data-theme="dark"] html.is-staff .view-switch .btn.btn-primary,
html.is-staff[data-theme="dark"] .view-switch .btn.btn-primary { background: var(--ui-hover); }

/* 表格：表头浅底、行高 44、悬停高亮、数字等宽。 */
html.is-staff table.tbl th {
  height: 42px;
  padding: 8px 14px;
  background: var(--surface-soft);
  color: var(--ui-text-2);
  font-size: 12.5px;
  font-weight: 600;
}
html.is-staff table.tbl td { height: 46px; padding: 8px 14px; }
html.is-staff table.tbl tbody tr:hover td { background: color-mix(in srgb, var(--primary) 4%, var(--surface)); }
html.is-staff .table-scroll { border-radius: var(--ui-radius); }

/* 页签：下划线式（.tabs .tab）。 */
html.is-staff .tabs { gap: 4px; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
html.is-staff .tabs .tab {
  margin-bottom: -1px;
  padding: 9px 14px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 500;
}
html.is-staff .tabs .tab:hover { color: var(--text); background: transparent; }
html.is-staff .tabs .tab.active { color: var(--primary); border-bottom-color: var(--primary); background: transparent; font-weight: 600; }

/* 订单状态快捷筛选：分段控件。 */
html.is-staff .order-status-chips { gap: 14px; padding: 8px 10px 8px 16px; }
html.is-staff .order-status-heading { padding: 0; border-left: 0; }
html.is-staff .order-status-heading span { color: var(--muted); font-weight: 600; }
html.is-staff .order-status-options { gap: 4px; }
html.is-staff .order-status-chip {
  min-height: 34px;
  border: 0;
  border-radius: var(--ui-radius);
  background: transparent;
  color: var(--ui-text-2);
  font-size: 13px;
  font-weight: 500;
}
html.is-staff .order-status-chip:hover { background: var(--ui-hover); color: var(--text); }
html.is-staff .order-status-chip.is-active,
html.is-staff .order-status-chip.is-active:hover { background: var(--blue-soft); color: var(--primary); font-weight: 650; box-shadow: none; }
html.is-staff .order-status-chip:active { transform: none; }

/* 汇总卡：左对齐数值、等宽数字，不再整体居中放大。 */
html.is-staff .cards,
html.is-staff .stats { gap: 12px; margin-bottom: 20px; }
html.is-staff .stat { padding: 16px 18px; }
html.is-staff :is(.cards, .stats) > .stat { margin-bottom: 0; }
html.is-staff .stat .t { text-align: left; color: var(--muted); font-size: 12.5px; }
html.is-staff .stat .v { margin-top: 6px; text-align: left; font-size: 24px; font-weight: 650; letter-spacing: -.2px; }
html.is-staff .stat .v .u { margin-left: 3px; font-size: 12px; font-weight: 500; }
html.is-staff .boss-overview-head h2 { font-size: 15px; font-weight: 650; }
html.is-staff .boss-overview-stats .stat .v { font-size: 22px; }

/* 状态徽标：细描边浅底。 */
html.is-staff .badge { border-radius: var(--ui-radius-sm); box-shadow: inset 0 0 0 1px color-mix(in srgb, currentColor 16%, transparent); }

/* 提示块 */
html.is-staff .notice { padding: 10px 14px; border-radius: var(--ui-radius); font-size: 13px; line-height: 1.6; }
html.is-staff .notice:not(.warn):not(.err):not(.ok) { background: var(--blue-soft); color: var(--ui-text-2); }

/* 空状态 */
html.is-staff .empty { color: var(--muted); }

/* 分页器 */
html.is-staff .pager { gap: 6px; margin-top: 16px; }
html.is-staff .pager-num,
html.is-staff .pager button { min-width: 32px; height: 32px; border-radius: var(--ui-radius); }
html.is-staff .pager-num.active { box-shadow: 0 1px 2px color-mix(in srgb, var(--primary) 30%, transparent); }

/* 弹窗：圆角 14、头尾固定、底部浅底；手机模式另见下方 html.staff-app-mode。 */
html.is-staff .modal-mask { background: rgba(15, 18, 32, .45); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
html.is-staff .modal { border-radius: 14px; border-color: var(--border); box-shadow: var(--ui-shadow-pop); }
html.is-staff .modal-head { min-height: 56px; padding: 14px 20px; font-size: 16px; font-weight: 650; }
html.is-staff .modal-body { padding: 20px; }
html.is-staff .modal-foot { padding: 12px 20px; border-radius: 0 0 14px 14px; }

/* 下拉/弹层 */
html.is-staff .action-pop,
html.is-staff .picker-pop,
html.is-staff .col-pop,
html.is-staff .dash-multi-pop,
html.is-staff .search-select-popover,
html.is-staff .column-filter-popup,
html.is-staff .date-range-pop { border-radius: var(--ui-radius-lg); box-shadow: var(--ui-shadow-pop); }

/* 派单动态：页面顶部的紧凑提醒条。 */
html.is-staff .dispatch-notices {
  margin-bottom: 16px;
  border: 1px solid color-mix(in srgb, var(--primary) 22%, var(--border));
  border-radius: var(--ui-radius-lg);
  background: color-mix(in srgb, var(--primary) 5%, var(--surface));
  box-shadow: var(--ui-shadow-sm);
}
html.is-staff .order-status-options { display: flex; flex-wrap: wrap; }
html.is-staff .order-status-chip { flex: 0 0 auto; padding: 7px 14px; }
html.is-staff .toolbar.card > input:first-child:not([type="checkbox"]) { min-width: 240px; }

/* ==========================================================================
   员工手机 App 模式（.layout.is-staff-app + html.staff-app-mode 浮层）
   断点由 app.js 判定（与陪玩 App 同一 PLAYER_APP_QUERY），作用域类本身就是断点，这里不写宽度查询。
   页面组件与桌面同一份：表格保留横向滚动，筛选条与表单改单列，弹窗改为贴底面板。
   ========================================================================== */
html.staff-app-mode {
  --sa-bar-h: 56px;
  --sa-sections-h: 46px;
  --sa-tabbar-h: 58px;
  --sa-tap: 44px;
  --sa-gap: 12px;
  --sa-safe-top: env(safe-area-inset-top, 0px);
  --sa-safe-bottom: env(safe-area-inset-bottom, 0px);
}
html.staff-app-mode body { background: var(--bg); -webkit-tap-highlight-color: transparent; }
html.staff-app-mode #toasts { top: calc(var(--sa-safe-top) + var(--sa-bar-h) + 10px); transform: translateX(-50%); }
.layout.is-staff-app > aside { display: none; }
.layout.is-staff-app > main { margin-left: 0; min-width: 0; }
.is-staff-app .ui-icon { flex: none; }

/* 导航栏 */
.is-staff-app .sa-bar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 8px;
  box-sizing: border-box;
  height: calc(var(--sa-bar-h) + var(--sa-safe-top));
  padding: var(--sa-safe-top) 6px 0 16px;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  -webkit-backdrop-filter: saturate(1.5) blur(14px);
  backdrop-filter: saturate(1.5) blur(14px);
  border-bottom: 1px solid var(--line);
}
.is-staff-app .sa-bar-heading { display: flex; flex-direction: column; justify-content: center; flex: 1; min-width: 0; }
.is-staff-app .sa-bar-group { overflow: hidden; color: var(--muted); font-size: 11px; line-height: 14px; white-space: nowrap; text-overflow: ellipsis; }
.is-staff-app .sa-bar-title { margin: 0; overflow: hidden; font-size: 18px; font-weight: 700; line-height: 24px; white-space: nowrap; text-overflow: ellipsis; }
.is-staff-app .sa-bar-actions { display: flex; align-items: center; gap: 2px; }
.is-staff-app .sa-icon-btn {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: var(--sa-tap);
  height: var(--sa-tap);
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--text);
}
.is-staff-app .sa-icon-btn:active { background: var(--surface-soft); }
.is-staff-app .sa-dot-badge {
  position: absolute;
  top: 6px;
  right: 4px;
  box-sizing: border-box;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
}
.is-staff-app .quick-create { margin: 0 2px; }

/* 分区页签：同一分区的相关页面，横向滑动 */
.is-staff-app .sa-sections {
  position: sticky;
  top: calc(var(--sa-bar-h) + var(--sa-safe-top));
  z-index: 29;
  display: flex;
  gap: 6px;
  box-sizing: border-box;
  height: var(--sa-sections-h);
  padding: 6px 12px;
  overflow-x: auto;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  scrollbar-width: none;
}
.is-staff-app .sa-sections::-webkit-scrollbar { display: none; }
.is-staff-app .sa-section {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--ui-text-2);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  text-decoration: none;
}
.is-staff-app .sa-section::after { content: ''; position: absolute; inset: -5px 0; }
.is-staff-app .sa-section.is-active { background: var(--primary); color: var(--on-primary); font-weight: 600; }
.is-staff-app .sa-section-badge { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; }

/* 内容区：文档仍是滚动根（测试与浏览器原生滚动都依赖它），底部给底栏留位 */
html.is-staff .is-staff-app .page-content {
  flex: 1;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: var(--sa-gap) var(--sa-gap) calc(var(--sa-tabbar-h) + var(--sa-safe-bottom) + 24px);
}

/* 底栏 */
.is-staff-app .sa-tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 35;
  display: flex;
  box-sizing: border-box;
  height: calc(var(--sa-tabbar-h) + var(--sa-safe-bottom));
  padding-bottom: var(--sa-safe-bottom);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  -webkit-backdrop-filter: saturate(1.6) blur(16px);
  backdrop-filter: saturate(1.6) blur(16px);
  border-top: 1px solid var(--line);
}
.is-staff-app .sa-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-width: 0;
  min-height: var(--sa-tap);
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 11px;
  font-weight: 500;
  text-decoration: none;
}
.is-staff-app .sa-tab.is-active { color: var(--primary); font-weight: 650; }
.is-staff-app .sa-tab.is-active .ui-icon { stroke-width: 2.2; }
.is-staff-app .sa-tab-icon { position: relative; display: inline-flex; }
.is-staff-app .sa-tab-badge.is-ready { left: auto; right: 14px; background: var(--ok); }
.is-staff-app .sa-tab-badge.is-ready + .sa-tab-badge { left: 16px; }
.is-staff-app .sa-tab-badge {
  position: absolute;
  top: -5px;
  left: 14px;
  box-sizing: border-box;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
}

/* 「全部功能」面板 */
html.staff-app-mode .sa-more-body { padding-top: 0; }
.sa-more-user { display: flex; align-items: center; gap: 12px; padding: 4px 0 14px; border-bottom: 1px solid var(--line); }
.sa-avatar { display: grid; place-items: center; width: 44px; height: 44px; flex: none; border-radius: 14px; background: linear-gradient(135deg, #06b6d4, var(--primary)); color: #fff; font-size: 18px; font-weight: 700; }
.sa-more-user-text b { display: block; font-size: 16px; }
.sa-more-user-text small { color: var(--muted); font-size: 12px; }
.sa-more-group { padding: 14px 0 4px; }
.sa-more-group h3 { margin: 0 0 10px; color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: .3px; }
.sa-more-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px 6px; }
.sa-more-item { display: flex; flex-direction: column; align-items: center; gap: 6px; min-height: 72px; padding: 6px 2px; border-radius: 12px; color: var(--text); font-size: 12px; text-align: center; text-decoration: none; }
.sa-more-item:active { background: var(--surface-soft); }
.sa-more-icon { position: relative; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; background: var(--surface-soft); color: var(--ui-text-2); }
.sa-more-item.is-active .sa-more-icon { background: var(--blue-soft); color: var(--primary); }
.sa-more-icon .dispatch-application-count,
.sa-more-badge { position: absolute; top: -5px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; }
.sa-more-badge { background: var(--danger); color: #fff; }
.sa-more-icon .dispatch-application-count { background: var(--ok); color: #fff; }
.sa-more-label { display: -webkit-box; overflow: hidden; line-height: 1.3; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.sa-more-settings { display: flex; flex-direction: column; }
.sa-setting {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 50px;
  padding: 0 4px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 15px;
  text-align: left;
}
.sa-setting > span:first-of-type { flex: 1; }
.sa-setting .ui-icon { color: var(--muted); }
.sa-setting.is-danger,
.sa-setting.is-danger .ui-icon { color: var(--danger); }
.sa-setting:disabled { opacity: .5; }
.sa-switch { position: relative; flex: none; width: 46px; height: 28px; border-radius: 999px; background: var(--border); transition: background .18s ease; }
.sa-switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .18s ease; }
.sa-switch.is-on { background: var(--ok); }
.sa-switch.is-on::after { transform: translateX(18px); }
.sa-swatches { display: flex; gap: 8px; }
.sa-swatches .palette-swatch { width: 28px; height: 28px; }
.sa-more-footer { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 18px 0 4px; color: var(--muted); font-size: 12px; }
.sa-more-footer a { display: inline-flex; align-items: center; min-height: 32px; color: inherit; }
.sa-more-footer .beian-icon { height: 14px; margin-right: 4px; }

/* ---------- 手机页面适配（页面组件与桌面同一份） ---------- */
html.is-staff .is-staff-app .card { padding: 14px; margin-bottom: 12px; border-radius: 14px; }
html.is-staff .is-staff-app .toolbar,
html.is-staff .is-staff-app .toolbar.card { gap: 8px; }
html.is-staff .is-staff-app .toolbar > input:not([type="checkbox"]):not([type="radio"]),
html.is-staff .is-staff-app .toolbar > .search-input,
html.is-staff .is-staff-app .toolbar.card > input:first-child:not([type="checkbox"]) { flex: 1 1 100%; min-width: 0; }
html.is-staff .is-staff-app .toolbar > select,
html.is-staff .is-staff-app .toolbar > .date-range-control,
html.is-staff .is-staff-app .toolbar > .boss-picker,
html.is-staff .is-staff-app .toolbar > .picker { flex: 1 1 calc(50% - 4px); min-width: 0; }
html.is-staff .is-staff-app .toolbar .date-range-trigger { width: 100%; }
html.is-staff .is-staff-app .toolbar .view-switch { margin-left: 0; }
html.is-staff .is-staff-app :is(input:not([type="checkbox"]):not([type="radio"]):not(.picker-inline-input):not(.m-search-input), select, textarea) { min-height: 40px; font-size: 16px; }
html.is-staff .is-staff-app .form-grid { grid-template-columns: minmax(0, 1fr); gap: 14px; }
/* 汇总卡在手机上排成一行横向滑动，不把列表挤到首屏之外 */
html.is-staff .is-staff-app :is(.cards, .stats) {
  grid-template-columns: none;
  grid-auto-flow: column;
  grid-auto-columns: minmax(132px, 42%);
  gap: 10px;
  margin: 0 calc(-1 * var(--sa-gap)) 14px;
  padding: 2px var(--sa-gap) 4px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scroll-padding-inline: var(--sa-gap);
  scrollbar-width: none;
}
html.is-staff .is-staff-app :is(.cards, .stats)::-webkit-scrollbar { display: none; }
html.is-staff .is-staff-app :is(.cards, .stats) > * { scroll-snap-align: start; }
html.is-staff .is-staff-app .stat { padding: 12px 14px; }
html.is-staff .is-staff-app .stat .v { margin-top: 2px; font-size: 19px; overflow-wrap: normal; white-space: nowrap; }
html.is-staff .is-staff-app .tabs { overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
html.is-staff .is-staff-app .tabs::-webkit-scrollbar { display: none; }
html.is-staff .is-staff-app .tabs .tab { flex: none; }
html.is-staff .is-staff-app .order-status-chips { flex-wrap: nowrap; padding: 6px; }
html.is-staff .is-staff-app .order-status-heading { display: none; }
html.is-staff .is-staff-app .order-status-options { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
html.is-staff .is-staff-app .order-status-options::-webkit-scrollbar { display: none; }
html.is-staff .is-staff-app .order-status-chip { min-height: 36px; }
html.is-staff .is-staff-app .pager { justify-content: flex-start; }
html.is-staff .is-staff-app .dispatch-notices { margin-bottom: 12px; }

/* 贴底面板：员工手机下的所有 app-modal（含详情、确认框） */
html.staff-app-mode .modal-mask { align-items: flex-end; padding: 0; overflow: hidden; top: var(--pa-vvt, 0px); height: var(--pa-vvh, 100dvh); bottom: auto; animation: sa-sheet-mask-in .18s ease-out both; }
html.staff-app-mode .modal-mask.modal-mask-xl { padding: 0; }
html.staff-app-mode .modal-mask .modal { display: flex; flex-direction: column; width: 100%; min-width: 100%; max-width: 100%; max-height: calc(var(--pa-vvh, 100dvh) - var(--sa-safe-top) - 28px); border: 0; border-radius: 20px 20px 0 0; box-shadow: 0 -8px 30px rgba(15, 23, 42, .2); animation: sa-sheet-up .22s cubic-bezier(.2, .8, .2, 1) both; }
html.staff-app-mode .modal-mask .modal.modal-xl { height: calc(var(--pa-vvh, 100dvh) - var(--sa-safe-top) - 28px); }
html.staff-app-mode .modal-mask .modal::before { content: ''; flex: none; align-self: center; width: 36px; height: 5px; margin-top: 8px; border-radius: 999px; background: var(--border); }
html.staff-app-mode .modal-mask .modal-head { min-height: 48px; padding: 4px 6px 4px 18px; border-bottom: 0; font-size: 17px; }
html.staff-app-mode .modal-mask .modal-head .close-button { width: var(--sa-tap); height: var(--sa-tap); }
html.staff-app-mode .modal-mask .modal-body { flex: 1; min-height: 0; max-height: none; padding: 4px 16px 16px; overflow-y: auto; overscroll-behavior: contain; }
html.staff-app-mode .modal-mask .modal-foot { flex-wrap: wrap; gap: 10px; padding: 10px 16px calc(10px + var(--sa-safe-bottom)); border-top: 1px solid var(--line); border-radius: 0; background: var(--surface); }
html.staff-app-mode .modal-mask .modal-foot:empty { display: none; }
html.staff-app-mode .modal-mask .modal-foot > .btn { flex: 1 1 auto; justify-content: center; min-height: 44px; }
html.staff-app-mode .modal-mask .form-grid { grid-template-columns: minmax(0, 1fr); }
html.staff-app-mode .modal-mask :is(input:not([type="checkbox"]):not([type="radio"]):not(.picker-inline-input):not(.m-search-input), select, textarea) { min-height: var(--sa-tap); font-size: 16px; }
html.staff-app-mode :is(.date-range-pop, .search-select-popover, .column-filter-popup) button { min-height: 40px; }
html.staff-app-mode .date-range-pop :is(input:not([type="checkbox"]):not([type="radio"]), select) { font-size: 16px; }
@keyframes sa-sheet-up {
  from { transform: translateY(24px); opacity: 0; }
  to { transform: none; opacity: 1; }
}
@keyframes sa-sheet-mask-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  html.staff-app-mode .modal-mask,
  html.staff-app-mode .modal-mask .modal { animation: none; }
}

/* 全局搜索在手机上铺满屏幕 */
html.staff-app-mode .cmd-mask { padding: 0; align-items: stretch; }
html.staff-app-mode .cmd-panel { width: 100%; max-height: none; height: 100%; border: 0; border-radius: 0; padding-top: var(--sa-safe-top); }
html.staff-app-mode .cmd-close .cmd-esc { display: none; }
html.staff-app-mode .cmd-close .ui-icon { display: block; }
html.staff-app-mode .cmd-close { width: var(--sa-tap); height: var(--sa-tap); justify-content: center; }
html.staff-app-mode .cmd-foot { display: none; }
html.staff-app-mode .cmd-row { min-height: 52px; }
html.staff-app-mode .quick-create-pop { position: fixed; top: calc(var(--sa-safe-top) + var(--sa-bar-h) + 4px); right: 8px; width: min(300px, calc(100vw - 16px)); }

/* ---------- 客服工作台 ---------- */
html.is-staff .workbench { gap: 16px; }
html.is-staff .workbench .wb-panel { border-radius: var(--ui-radius-lg); box-shadow: var(--ui-shadow-sm); }
html.is-staff .workbench .wb-panel-title { min-height: 56px; padding: 10px 14px 10px 18px; gap: 6px; font-size: 15px; font-weight: 650; }
html.is-staff .workbench .wb-panel-title .wb-step {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  margin-right: 4px;
  border-radius: 7px;
  background: var(--primary);
  color: var(--on-primary);
  font-size: 12px;
  font-weight: 700;
}
html.is-staff .workbench .wb-body { padding: 18px; }
html.is-staff .recharge-tabs { align-items: center; }
html.is-staff .recharge-tabs .coupon-launch { margin-left: auto; }

/* ==========================================================================
   登录页（所有角色共用）：桌面左侧品牌区 + 右侧登录卡片；窄屏只保留登录卡片。
   测试依赖：.login-box 内恰好两个 input（账号、密码）与唯一的 button.btn-primary；
   桌面输入框 13px、手机 ≥16px（app.css 末尾的媒体查询）。
   ========================================================================== */
.app-shell > .login-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(420px, 1fr);
  align-items: stretch;
  padding: 0;
  background: var(--bg);
}
.login-hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 48px;
  color: #fff;
  background:
    radial-gradient(circle at 18% 22%, rgba(255, 255, 255, .16), transparent 34%),
    radial-gradient(circle at 82% 78%, rgba(6, 182, 212, .38), transparent 42%),
    linear-gradient(140deg, var(--primary-dark), var(--primary) 46%, #0e7490);
}
.login-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, .14) 1px, transparent 1px);
  background-size: 22px 22px;
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 40%, transparent);
  mask-image: linear-gradient(180deg, transparent, #000 40%, transparent);
  pointer-events: none;
}
.login-hero-inner { position: relative; z-index: 1; width: min(420px, 100%); }
.login-hero-mark { display: block; width: 56px; height: 56px; border-radius: 16px; background: #fff; box-shadow: 0 10px 30px rgba(0, 0, 0, .18); object-fit: cover; }
.login-hero h2 { margin: 24px 0 8px; font-size: 32px; font-weight: 700; letter-spacing: 1px; }
.login-hero p { margin: 0 0 32px; font-size: 16px; opacity: .86; }
.login-hero-points { display: flex; flex-direction: column; gap: 14px; margin: 0; padding: 0; list-style: none; }
.login-hero-points li { display: flex; align-items: center; gap: 12px; font-size: 14px; opacity: .95; }
.login-hero-points span { display: grid; place-items: center; width: 34px; height: 34px; flex: none; border-radius: 10px; background: rgba(255, 255, 255, .16); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .2); }
.app-shell > .login-wrap .login-box {
  align-self: center;
  justify-self: center;
  width: min(400px, calc(100% - 48px));
  padding: 40px 36px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 18px 48px rgba(16, 24, 40, .08);
}
.app-shell > .login-wrap .login-brand { margin-bottom: 8px; }
.app-shell > .login-wrap .login-box p { margin: 0 0 24px; font-size: 13px; }
.app-shell > .login-wrap .login-box input {
  height: 44px;
  margin-bottom: 14px;
  padding: 0 14px;
  border: 1px solid var(--ui-border-strong);
  border-radius: 10px;
  background: var(--surface);
}
.app-shell > .login-wrap .login-box input:focus { border-color: var(--primary); box-shadow: var(--ui-focus-ring); }
.app-shell > .login-wrap .login-box .btn {
  justify-content: center;
  height: 44px;
  margin-top: 6px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 2px;
}
.app-shell > .login-wrap .demo-tip { margin-top: 18px; padding-top: 14px; border-top: 1px dashed var(--border); font-size: 12px; line-height: 1.8; }
@media (max-width: 900px) {
  .app-shell > .login-wrap { grid-template-columns: minmax(0, 1fr); padding: 32px 16px; }
  .login-hero { display: none; }
  .app-shell > .login-wrap .login-box { width: 100%; max-width: 420px; padding: 32px 22px; }
}

/* ---------- 经营待办（待处理事项） ---------- */
.finance-todo-page {
  --todo-warn-text: color-mix(in srgb, var(--warn) 55%, #000);
  --todo-danger-text: color-mix(in srgb, var(--danger) 78%, #000);
  min-width: 0;
  color: var(--text);
}
:root[data-theme="dark"] .finance-todo-page {
  --todo-warn-text: color-mix(in srgb, var(--warn) 75%, var(--text));
  --todo-danger-text: color-mix(in srgb, var(--danger) 75%, var(--text));
}
.todo-page-head { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px 20px; }
.todo-page-head h2 { margin: 0; line-height: 1.4; }
.todo-page-head .todo-summary { margin: 0; overflow-wrap: anywhere; }
.todo-group { min-width: 0; }
.todo-grid { display: grid; }
.todo-card { position: relative; min-width: 0; margin: 0; overflow: hidden; }
.todo-card-head { display: flex; }
.todo-card.is-attention::before,
.todo-card.is-priority::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--warn); }
.todo-card.is-priority::before { background: var(--danger); }
.todo-card .todo-badge.orange { color: var(--todo-warn-text); background: var(--peach-soft); }
.todo-card .todo-badge.red { color: var(--todo-danger-text); background: var(--rose-soft); }
.finance-todo-page .todo-state { margin: 0; padding: 20px 0; color: var(--muted); }
.todo-error p { margin: 0 0 14px; color: var(--todo-danger-text); }
html.is-staff .todo-page-head { align-items: flex-end; margin-bottom: 20px; }
html.is-staff .todo-page-head h2 { font-size: 20px; font-weight: 650; }
html.is-staff .todo-page-head .todo-summary { margin-top: 4px; font-size: 13px; }
html.is-staff .todo-refresh { gap: 6px; }
html.is-staff .todo-group + .todo-group { margin-top: 24px; }
html.is-staff .todo-group .section-title { display: flex; align-items: baseline; gap: 10px; margin: 0 0 12px; }
html.is-staff .todo-group-count { color: var(--muted); font-size: 12px; font-weight: 500; }
html.is-staff .todo-grid { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); grid-auto-rows: auto; gap: 14px; }
html.is-staff .finance-todo-page .todo-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: var(--ui-radius-lg);
  background: var(--surface);
  box-shadow: var(--ui-shadow-sm);
  color: var(--text);
  text-decoration: none;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
html.is-staff .finance-todo-page a.todo-card:hover { border-color: color-mix(in srgb, var(--primary) 40%, var(--border)); box-shadow: 0 6px 18px rgba(16, 24, 40, .08); }
html.is-staff .finance-todo-page .todo-card.is-empty { background: var(--surface-soft); box-shadow: none; }
html.is-staff .finance-todo-page .todo-card.is-empty .todo-card-count { color: var(--muted); }
html.is-staff .todo-card.is-attention::before,
html.is-staff .todo-card.is-priority::before { border-radius: var(--ui-radius-lg) 0 0 var(--ui-radius-lg); }
html.is-staff .todo-card-head { align-items: center; min-height: 0; gap: 10px; }
html.is-staff .todo-card-title { flex: 1; min-width: 0; margin: 0; font-size: 14px; font-weight: 600; }
html.is-staff .todo-card-icon { display: grid; place-items: center; width: 32px; height: 32px; flex: none; border-radius: 9px; background: var(--blue-soft); color: var(--primary); }
html.is-staff .todo-card-icon.is-settlement { background: var(--sage-soft); color: var(--ok); }
html.is-staff .todo-card.is-empty .todo-card-icon { background: var(--surface); color: var(--muted); }
html.is-staff .todo-card-figures { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; min-height: 40px; }
html.is-staff .todo-card-count { font-size: 30px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
html.is-staff .todo-card-count span { margin-left: 4px; color: var(--muted); font-size: 13px; font-weight: 500; }
html.is-staff .todo-card-amount { color: var(--ui-text-2); font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
html.is-staff .todo-card-amount span { color: var(--muted); font-size: 12px; font-weight: 500; }
html.is-staff .todo-card-amount.is-negative { color: var(--danger); }
html.is-staff .todo-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 12.5px; }
html.is-staff .todo-card-wait { display: inline-flex; align-items: center; gap: 4px; min-width: 0; color: var(--muted); }
html.is-staff .todo-card.is-attention .todo-card-wait { color: var(--todo-warn-text); }
html.is-staff .todo-card.is-priority .todo-card-wait { color: var(--todo-danger-text); }
html.is-staff .todo-card-action { display: inline-flex; align-items: center; gap: 2px; flex: none; color: var(--primary); font-weight: 600; }
html.is-staff .todo-card.is-empty .todo-card-action { color: var(--muted); font-weight: 500; }
html.is-staff .todo-card.is-skeleton { gap: 12px; min-height: 150px; }
html.is-staff .todo-card.is-skeleton span { display: block; height: 14px; border-radius: 6px; background: linear-gradient(90deg, var(--surface-soft), var(--line), var(--surface-soft)); background-size: 200% 100%; animation: ui-shimmer 1.2s linear infinite; }
html.is-staff .todo-card.is-skeleton span:nth-child(1) { width: 50%; }
html.is-staff .todo-card.is-skeleton span:nth-child(2) { width: 30%; height: 28px; }
html.is-staff .todo-card.is-skeleton span:nth-child(3) { width: 80%; }
@keyframes ui-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { html.is-staff .todo-card.is-skeleton span { animation: none; } }
.app-layout .nav-item .dispatch-application-count { margin-left: auto; }
.app-layout .nav-item .dispatch-application-count + .nav-badge { margin-left: 4px; }
html.is-staff .stat .v { white-space: nowrap; }
html.is-staff .order-overview-stats .stat .v { font-size: clamp(18px, 1.55vw, 24px); }
html.is-staff .modal-foot:empty { display: none; }

/* ---------- 分析页：快捷导航 ---------- */
html.is-staff .quick-grid { gap: 8px; }
html.is-staff .quick-grid .quick-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 88px;
  padding: 10px 6px;
  border: 1px solid var(--line);
  border-radius: var(--ui-radius-lg);
  background: var(--surface);
  color: var(--ui-text-2);
  font: inherit;
  font-size: 12.5px;
  text-decoration: none;
  cursor: pointer;
}
html.is-staff .quick-grid .quick-link:hover { border-color: color-mix(in srgb, var(--primary) 35%, var(--border)); background: var(--blue-soft); color: var(--primary); }
html.is-staff .quick-grid .quick-link strong { font-weight: 600; }
html.is-staff .quick-icon { width: 36px; height: 36px; border-radius: 10px; }
:root[data-theme="dark"] .quick-icon { background: var(--surface-soft); }

/* ---------- 提示条：桌面顶栏正下方居中（原为屏幕正中，会挡住正在操作的内容） ---------- */
html.is-staff:not(.staff-app-mode) #toasts { top: calc(var(--shell-topbar-h) + 12px); transform: translateX(-50%); }
html.is-staff .toast {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: min(520px, calc(100vw - 32px));
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 13.5px;
  line-height: 1.5;
  box-shadow: 0 10px 28px rgba(16, 24, 40, .18);
}

/* 表格单元格默认不换行（日期、姓名、金额不再被挤成多行），表格放不下时在卡片内横向滚动；
   备注、原因、明细等自由文本列标 .cell-wrap，保持换行并给出最小宽度。 */
html.is-staff table.tbl td { white-space: nowrap; }
html.is-staff table.tbl td.cell-wrap,
html.is-staff table.tbl td.cell-remark { min-width: 160px; white-space: normal; overflow-wrap: anywhere; }
html.is-staff .table-scroll,
html.is-staff .card:has(> table.tbl) { scrollbar-width: thin; }
/* 横向滚动时「操作」列（最后一列且里面是按钮或「更多」菜单）固定在右侧，不用滚到最右才能点按钮；
   最后一列是备注、明细等普通数据时照常随表格滚动。 */
html.is-staff table.tbl tr > td:last-child:not(:first-child):has(.action-menu, .btn, button:not(.entity-link)),
html.is-staff table.tbl:has(> tbody > tr > td:last-child:not(:first-child) :is(.action-menu, .btn, button:not(.entity-link))) > thead > tr > th:last-child:not(:first-child) { position: sticky; right: 0; z-index: 1; box-shadow: inset 1px 0 0 var(--line); }
html.is-staff table.tbl tr > td:last-child:not(:first-child):has(.action-menu, .btn, button:not(.entity-link)) { background: var(--surface); }
/* 卡片本身是滚动容器时，固定列只贴到内容区右缘，右侧内边距里会露出滚过去的内容：在固定列右侧补一条卡片底色盖住这段内边距
   （合并边框的表格里单元格外投影不绘制，只能用伪元素）。 */
html.is-staff .card > table.tbl > tbody > tr > td:last-child:not(:first-child):has(.action-menu, .btn, button:not(.entity-link))::after,
html.is-staff .card > table.tbl:has(> tbody > tr > td:last-child:not(:first-child) :is(.action-menu, .btn, button:not(.entity-link))) > thead > tr > th:last-child:not(:first-child)::after { content: ''; position: absolute; top: -1px; bottom: -1px; left: 100%; width: 24px; background: var(--surface); pointer-events: none; }
html.is-staff table.tbl tbody tr:hover > td:last-child:not(:first-child):has(.action-menu, .btn, button:not(.entity-link)) { background: color-mix(in srgb, var(--primary) 4%, var(--surface)); }
/* 订单详情（PC Figma 详情）表格按固定列宽排版，保持原换行与普通最后一列。 */
html.is-staff .pc-figma-order-detail table.tbl td { white-space: normal; }
html.is-staff .pc-figma-order-detail table.tbl tr > :last-child { position: static; box-shadow: none; }
html.is-staff .pc-figma-order-detail table.tbl tr > td:last-child { background: transparent; }
html.is-staff .pc-figma-order-detail table.tbl tr > :last-child::after { content: none; }

/* 数据页在手机上：指标卡收紧，数值不被省略号截断 */
html.is-staff .is-staff-app .player-kpi-icon { display: none; }
html.is-staff .is-staff-app .player-kpi-body { min-height: 60px; padding: 10px 12px; }
html.is-staff .is-staff-app .player-kpi-value strong { overflow: visible; font-size: 19px; }
html.is-staff .is-staff-app .player-kpi-head { min-height: 38px; padding: 7px 12px; }
/* app.css 窄屏规则把筛选条里的所有 input 拉到 120px 宽（带 !important），复选框不应被拉伸。 */
html.is-staff .toolbar input:is([type="checkbox"], [type="radio"]) { flex: none; min-width: 0 !important; min-height: 0; width: 16px; height: 16px; }
html.is-staff .toolbar label:has(> input[type="checkbox"]) { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }

/* 客服工作台在手机上：三块改为分段切换，一次只显示一块。 */
.workbench .wb-switch { display: none; }
html.is-staff .is-staff-app .workbench .wb-switch {
  position: sticky;
  top: calc(var(--sa-bar-h) + var(--sa-safe-top) + 6px);
  z-index: 5;
  display: flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: var(--ui-shadow-sm);
}
html.is-staff .is-staff-app .workbench .wb-switch button {
  flex: 1;
  min-height: 38px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
}
html.is-staff .is-staff-app .workbench .wb-switch button[aria-selected="true"] { background: var(--primary); color: var(--on-primary); }
html.is-staff .is-staff-app .workbench:has(> .wb-switch [data-panel="boss"][aria-selected="true"]) > section.wb-panel:not(:nth-of-type(1)),
html.is-staff .is-staff-app .workbench:has(> .wb-switch [data-panel="recharge"][aria-selected="true"]) > section.wb-panel:not(:nth-of-type(2)),
html.is-staff .is-staff-app .workbench:has(> .wb-switch [data-panel="order"][aria-selected="true"]) > section.wb-panel:not(:nth-of-type(3)) { display: none; }

/* 空状态 */
.empty-icon .ui-icon { display: block; }
html.is-staff .empty { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 36px 16px; }
html.is-staff .empty-icon { display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 4px; border-radius: 14px; background: var(--surface-soft); color: var(--faint); font-size: 0; }
html.is-staff .empty strong { color: var(--ui-text-2); font-size: 14px; font-weight: 600; }
html.is-staff .empty small { color: var(--muted); font-size: 12px; }

/* 选择框箭头、折叠区块、日期按钮统一用线性图标（原为 ▼ ▸ ▦ 字符，各平台字体渲染不一致） */
.picker-arrow { display: inline-flex; align-items: center; flex: none; color: var(--muted); transition: transform 160ms ease; }
.picker-arrow.is-open { transform: rotate(180deg); }
.collapse-section-head .collapse-section-chevron { color: var(--muted); transition: transform 160ms ease; }
.collapse-section.is-collapsed .collapse-section-chevron { transform: rotate(-90deg); }
.date-range-icon { display: inline-flex; align-items: center; color: var(--muted); }

/* 售后处理：顶栏已有页面标题，去掉页内重复的大标题与说明。 */
html.is-staff .eval-intro { display: none; }
html.is-staff .eval-overview { margin-top: 4px; }

/* 折叠区块标题获得焦点时，焦点框画在标题内侧，不压到下面的按钮。 */
.collapse-section-head:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; border-radius: 10px; }
html.is-staff .collapse-section { border-radius: var(--ui-radius-lg); }
html.is-staff .collapse-section-head { font-weight: 600; }

/* 窄桌面（901–1279px）：顶栏只留图标搜索与头像，标题单行省略，不挤成两行。 */
.app-layout .topbar-heading { flex: 1 1 auto; }
.app-layout .topbar-crumb,
.app-layout .page-title { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
@media (max-width: 1279px) {
  .app-layout .topbar-search { flex: 0 0 36px; width: 36px; padding: 0; justify-content: center; }
  .app-layout .topbar-search .topbar-search-text,
  .app-layout .topbar-search kbd { display: none; }
}
@media (max-width: 1099px) {
  .app-layout .user-menu-text { display: none; }
  .app-layout header.topbar { padding-left: 24px; gap: 10px; }
}

/* 订单列表：筛选条与订单状态分段合成一个筛选面板（两行），少一层卡片。 */
html.is-staff .card.toolbar:has(+ .order-status-chips) { margin-bottom: 0; border-bottom-color: var(--line); border-bottom-left-radius: 0; border-bottom-right-radius: 0; box-shadow: none; }
html.is-staff .card.toolbar + .order-status-chips { border-top: 0; border-top-left-radius: 0; border-top-right-radius: 0; }

/* 提现审核：列筛选提示 */
html.is-staff .wd-filter-hint { margin: -6px 4px 10px; color: var(--primary); font-size: 12.5px; }
